@openmrs/esm-stock-management-app 3.1.1-pre.997 → 3.2.1-pre.1
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.
- package/.eslintrc +1 -2
- package/.husky/pre-commit +2 -4
- package/.turbo/cache/c469b46f2f5a9ac5-meta.json +1 -0
- package/.turbo/cache/c469b46f2f5a9ac5.tar.zst +0 -0
- package/.turbo/turbo-build.log +45 -0
- package/README.md +157 -1
- package/dist/1116.js +1 -0
- package/dist/1116.js.map +1 -0
- package/dist/1119.js +1 -1
- package/dist/1197.js +1 -1
- package/dist/1351.js +1 -0
- package/dist/1351.js.map +1 -0
- package/dist/1728.js +1 -0
- package/dist/1728.js.map +1 -0
- package/dist/2146.js +1 -1
- package/dist/2177.js +1 -1
- package/dist/2177.js.map +1 -1
- package/dist/2461.js +1 -0
- package/dist/2461.js.map +1 -0
- package/dist/2591.js +1 -0
- package/dist/{3824.js.map → 2591.js.map} +1 -1
- package/dist/2690.js +1 -1
- package/dist/282.js +1 -1
- package/dist/282.js.map +1 -1
- package/dist/3041.js +1 -1
- package/dist/3041.js.map +1 -1
- package/dist/3099.js +1 -1
- package/dist/3184.js +1 -1
- package/dist/3184.js.map +1 -1
- package/dist/3449.js +1 -1
- package/dist/3449.js.map +1 -1
- package/dist/3584.js +1 -1
- package/dist/4055.js +1 -1
- package/dist/4069.js +1 -0
- package/dist/4069.js.map +1 -0
- package/dist/4087.js +1 -0
- package/dist/4132.js +1 -1
- package/dist/4225.js +1 -1
- package/dist/4225.js.map +1 -1
- package/dist/4300.js +1 -1
- package/dist/4335.js +1 -1
- package/dist/4353.js +1 -1
- package/dist/4353.js.map +1 -1
- package/dist/439.js +1 -0
- package/dist/4618.js +1 -1
- package/dist/4652.js +1 -1
- package/dist/4802.js +1 -1
- package/dist/4802.js.map +1 -1
- package/dist/4944.js +1 -1
- package/dist/5173.js +1 -1
- package/dist/5241.js +1 -1
- package/dist/5354.js +1 -1
- package/dist/5354.js.map +1 -1
- package/dist/5422.js +1 -1
- package/dist/5422.js.map +1 -1
- package/dist/5442.js +1 -1
- package/dist/5661.js +1 -1
- package/dist/6022.js +1 -1
- package/dist/6078.js +2 -0
- package/dist/6078.js.map +1 -0
- package/dist/6131.js +1 -0
- package/dist/6131.js.map +1 -0
- package/dist/6184.js +1 -1
- package/dist/6184.js.map +1 -1
- package/dist/6468.js +1 -1
- package/dist/6468.js.map +1 -0
- package/dist/6540.js +1 -1
- package/dist/6540.js.map +1 -1
- package/dist/6589.js +1 -0
- package/dist/6606.js +1 -1
- package/dist/6606.js.map +1 -1
- package/dist/6679.js +1 -1
- package/dist/6840.js +1 -1
- package/dist/6859.js +1 -1
- package/dist/6917.js +1 -0
- package/dist/6917.js.map +1 -0
- package/dist/7097.js +1 -1
- package/dist/7159.js +1 -1
- package/dist/7182.js +1 -0
- package/dist/7182.js.map +1 -0
- package/dist/723.js +1 -1
- package/dist/7255.js +1 -0
- package/dist/7255.js.map +1 -0
- package/dist/744.js +1 -1
- package/dist/744.js.map +1 -1
- package/dist/7617.js +1 -1
- package/dist/7631.js +1 -0
- package/dist/7631.js.map +1 -0
- package/dist/7889.js +1 -0
- package/dist/7889.js.map +1 -0
- package/dist/795.js +1 -1
- package/dist/8044.js +1 -0
- package/dist/8044.js.map +1 -0
- package/dist/8163.js +1 -1
- package/dist/8349.js +1 -1
- package/dist/8371.js +1 -0
- package/dist/8618.js +1 -1
- package/dist/890.js +1 -1
- package/dist/9214.js +1 -1
- package/dist/9538.js +1 -1
- package/dist/9569.js +1 -1
- package/dist/961.js +1 -1
- package/dist/961.js.map +1 -1
- package/dist/986.js +1 -1
- package/dist/9879.js +1 -1
- package/dist/9895.js +1 -1
- package/dist/9900.js +1 -1
- package/dist/9913.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-stock-management-app.js +1 -1
- package/dist/openmrs-esm-stock-management-app.js.buildmanifest.json +450 -404
- package/dist/openmrs-esm-stock-management-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/e2e/support/github/Dockerfile +1 -1
- package/package.json +16 -20
- package/src/config-schema.ts +53 -53
- package/src/constants.ts +2 -3
- package/src/core/components/carbon/controlled-combo-box.component.tsx +15 -12
- package/src/core/components/carbon/controlled-number-input.component.tsx +10 -12
- package/src/core/components/carbon/controlled-radio-button-group.component.tsx +22 -18
- package/src/core/components/table/table.component.tsx +26 -17
- package/src/core/components/table/table.scss +4 -0
- package/src/core/components/table/types.ts +12 -0
- package/src/core/components/tabs/vertical-tabs.component.tsx +2 -6
- package/src/declarations.d.ts +0 -3
- package/src/routes.json +1 -1
- package/src/stock-home/stock-home-inventory-card.component.tsx +2 -2
- package/src/stock-home/stock-home-metrics.component.tsx +5 -5
- package/src/stock-home/stock-home.scss +4 -0
- package/src/stock-home/useStockList.tsx +1 -17
- package/src/stock-items/add-stock-item/add-stock-item.component.tsx +2 -2
- package/src/stock-items/add-stock-item/batch-information/batch-information-locations/batch-information-locations-filter.component.tsx +0 -3
- package/src/stock-items/add-stock-item/batch-information/batch-information.component.tsx +4 -4
- package/src/stock-items/add-stock-item/concepts-selector/concepts-selector.component.tsx +29 -28
- package/src/stock-items/add-stock-item/concepts-selector/concepts-selector.test.tsx +104 -0
- package/src/stock-items/add-stock-item/dispensing-package-measurement/dispensing-package-measurement.component.tsx +2 -5
- package/src/stock-items/add-stock-item/dispensing-unit-selector/dispensing-unit-selector.component.tsx +30 -30
- package/src/stock-items/add-stock-item/drug-selector/drug-selector.component.tsx +83 -44
- package/src/stock-items/add-stock-item/drug-selector/drug-selector.resource.ts +2 -2
- package/src/stock-items/add-stock-item/drug-selector/drug-selector.test.tsx +134 -0
- package/src/stock-items/add-stock-item/packaging-units/packaging-units-delete.modal.tsx +2 -2
- package/src/stock-items/add-stock-item/packaging-units/packaging-units.component.tsx +32 -18
- package/src/stock-items/add-stock-item/packaging-units-concept-selector/packaging-units-concept-selector.component.tsx +4 -7
- package/src/stock-items/add-stock-item/preferred-vendor-selector/preferred-vendor-selector.component.tsx +7 -11
- package/src/stock-items/add-stock-item/stock-item-category-selector/stock-item-category-selector.component.tsx +42 -33
- package/src/stock-items/add-stock-item/stock-item-category-selector/stock-item-category-selector.test.tsx +140 -0
- package/src/stock-items/add-stock-item/stock-item-details/stock-item-details.component.tsx +18 -17
- package/src/stock-items/add-stock-item/stock-item-references/stock-item-references.component.tsx +38 -29
- package/src/stock-items/add-stock-item/stock-item-references/stock-references-selector.component.tsx +2 -5
- package/src/stock-items/add-stock-item/stock-item-rules/add-stock-rules.component.tsx +28 -20
- package/src/stock-items/add-stock-item/stock-item-rules/stock-item-rules.component.tsx +10 -9
- package/src/stock-items/add-stock-item/stock-item-rules/stock-rules-filter.component.tsx +8 -3
- package/src/stock-items/add-stock-item/stock-item-units-edit/stock-item-units-edit.component.tsx +2 -2
- package/src/stock-items/add-stock-item/transactions/printout/printable-bincard-transaction-header.component.tsx +5 -5
- package/src/stock-items/add-stock-item/transactions/printout/printable-stockcard-transaction-header.component.tsx +3 -3
- package/src/stock-items/add-stock-item/transactions/printout/transactions-print-action.component.tsx +2 -5
- package/src/stock-items/add-stock-item/transactions/printout/transactions-print-bincard-preview.modal.tsx +1 -1
- package/src/stock-items/add-stock-item/transactions/transaction-filters/transaction-locations-filter.component.tsx +0 -3
- package/src/stock-items/components/filter-stock-items/filter-stock-items.component.tsx +6 -4
- package/src/stock-items/edit-stock-item/edit-stock-item-action-menu.component.tsx +1 -1
- package/src/stock-items/stock-item.utils.tsx +1 -1
- package/src/stock-items/stock-items-table.component.tsx +21 -15
- package/src/stock-items/stock-items-table.resource.ts +1 -1
- package/src/stock-items/stock-items.resource.ts +1 -2
- package/src/stock-items/validationSchema.ts +65 -61
- package/src/stock-locations/add-locations-form.workspace.tsx +9 -11
- package/src/stock-locations/location-admin-form.component.tsx +9 -4
- package/src/stock-locations/stock-locations-table.component.tsx +3 -3
- package/src/stock-lookups/stock-lookups.resource.ts +8 -10
- package/src/stock-management-admin-card-link.component.tsx +1 -1
- package/src/stock-operations/add-stock-operation/stock-operations-expanded-row/stock-items-table.tsx +12 -8
- package/src/stock-operations/add-stock-operation/stock-operations-expanded-row/stock-operation-expanded-row.component.tsx +4 -4
- package/src/stock-operations/edit-stock-operation/edit-stock-operation-action-menu.component.tsx +6 -7
- package/src/stock-operations/stock-operation-operations-filter/stock-operation-operations-filter.component.tsx +7 -3
- package/src/stock-operations/stock-operation-sources-filter/stock-operation-sources-filter.component.tsx +8 -4
- package/src/stock-operations/stock-operation-statuses-filter/stock-operation-statuses-filter.component.tsx +16 -14
- package/src/stock-operations/stock-operation-types-selector/stock-operation-types-selector.component.tsx +4 -4
- package/src/stock-operations/stock-operation.utils.tsx +1 -1
- package/src/stock-operations/stock-operations-filters.component.tsx +4 -2
- package/src/stock-operations/stock-operations-forms/input-components/batch-no-selector.component.tsx +2 -2
- package/src/stock-operations/stock-operations-forms/input-components/batch-no-selector.test.tsx +1 -1
- package/src/stock-operations/stock-operations-forms/input-components/qty-uim-selector.test.tsx +1 -1
- package/src/stock-operations/stock-operations-forms/input-components/quantity-uom-selector.component.tsx +3 -3
- package/src/stock-operations/stock-operations-forms/input-components/stock-item-search.component.tsx +3 -4
- package/src/stock-operations/stock-operations-forms/input-components/stock-operation-reason-selector.component.tsx +3 -3
- package/src/stock-operations/stock-operations-forms/input-components/users-selector.component.tsx +6 -6
- package/src/stock-operations/stock-operations-forms/step2.test.tsx +1 -5
- package/src/stock-operations/stock-operations-forms/steps/base-operation-details-form-step.tsx +15 -16
- package/src/stock-operations/stock-operations-forms/steps/quantity-uom-cell.component.tsx +1 -1
- package/src/stock-operations/stock-operations-forms/steps/received-items.component.tsx +2 -2
- package/src/stock-operations/stock-operations-forms/steps/stock-operation-items-form-step.component.tsx +24 -21
- package/src/stock-operations/stock-operations-forms/steps/stock-operation-submission-form-step.component.tsx +4 -4
- package/src/stock-operations/stock-operations-forms/stock-item-form/stock-item-form.workspace.tsx +60 -53
- package/src/stock-operations/stock-operations-forms/stock-operation-form.component.tsx +17 -12
- package/src/stock-operations/stock-operations-modal/stock-operations-completed-dispatch-button.component.tsx +1 -1
- package/src/stock-operations/stock-operations-modal/stock-operations-issue-stock-button.component.tsx +1 -1
- package/src/stock-operations/stock-operations-modal/stock-operations-print-button.component.tsx +6 -2
- package/src/stock-operations/stock-operations-modal/stock-operations-reject-button.component.tsx +4 -5
- package/src/stock-operations/stock-operations-modal/stock-operations.modal.tsx +8 -6
- package/src/stock-operations/stock-operations-table.component.tsx +16 -12
- package/src/stock-operations/stock-operations-table.resource.ts +1 -0
- package/src/stock-reports/generate-report/create-stock-report.workspace.tsx +31 -35
- package/src/stock-reports/report-list/stock-reports.component.tsx +5 -9
- package/src/stock-reports/stock-reports.resource.ts +1 -1
- package/src/stock-sources/add-stock-sources/add-stock-sources.workspace.tsx +12 -8
- package/src/stock-sources/stock-sources-items-table.component.tsx +14 -10
- package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.workspace.tsx +54 -55
- package/src/stock-user-role-scopes/delete-stock-user-scope/delete-stock-user-scope.component.tsx +1 -1
- package/src/stock-user-role-scopes/delete-stock-user-scope.modal.tsx +4 -1
- package/src/stock-user-role-scopes/stock-user-role-scopes-items-table.component.tsx +8 -12
- package/src/types/index.ts +0 -10
- package/tools/setup-tests.ts +7 -0
- package/translations/am.json +65 -30
- package/translations/ar.json +65 -30
- package/translations/ar_SY.json +66 -31
- package/translations/bn.json +66 -31
- package/translations/cs.json +380 -0
- package/translations/de.json +369 -334
- package/translations/en.json +109 -74
- package/translations/en_US.json +66 -31
- package/translations/es.json +65 -30
- package/translations/es_MX.json +66 -31
- package/translations/fr.json +139 -104
- package/translations/he.json +65 -30
- package/translations/hi.json +66 -31
- package/translations/hi_IN.json +66 -31
- package/translations/id.json +66 -31
- package/translations/it.json +75 -40
- package/translations/ka.json +65 -30
- package/translations/km.json +67 -32
- package/translations/ku.json +66 -31
- package/translations/ky.json +66 -31
- package/translations/lg.json +66 -31
- package/translations/ne.json +66 -31
- package/translations/pl.json +66 -31
- package/translations/pt.json +66 -31
- package/translations/pt_BR.json +66 -31
- package/translations/qu.json +66 -31
- package/translations/ro_RO.json +375 -340
- package/translations/ru_RU.json +66 -31
- package/translations/si.json +66 -31
- package/translations/sq.json +380 -0
- package/translations/sw.json +66 -31
- package/translations/sw_KE.json +66 -31
- package/translations/tr.json +66 -31
- package/translations/tr_TR.json +66 -31
- package/translations/uk.json +66 -31
- package/translations/uz.json +66 -31
- package/translations/uz@Latn.json +66 -31
- package/translations/uz_UZ.json +66 -31
- package/translations/vi.json +66 -31
- package/translations/zh.json +285 -250
- package/translations/zh_CN.json +377 -342
- package/translations/zh_TW.json +380 -0
- package/turbo.json +23 -0
- package/dist/1033.js +0 -1
- package/dist/1033.js.map +0 -1
- package/dist/130.js +0 -1
- package/dist/130.js.map +0 -1
- package/dist/3220.js +0 -1
- package/dist/3220.js.map +0 -1
- package/dist/3414.js +0 -1
- package/dist/3414.js.map +0 -1
- package/dist/3824.js +0 -1
- package/dist/4693.js +0 -1
- package/dist/4693.js.map +0 -1
- package/dist/4732.js +0 -1
- package/dist/4732.js.map +0 -1
- package/dist/5125.js +0 -1
- package/dist/5125.js.map +0 -1
- package/dist/5333.js +0 -1
- package/dist/5333.js.map +0 -1
- package/dist/537.js +0 -2
- package/dist/537.js.LICENSE.txt +0 -14
- package/dist/537.js.map +0 -1
- package/dist/5609.js +0 -1
- package/dist/5609.js.map +0 -1
- package/dist/6757.js +0 -1
- package/dist/6757.js.map +0 -1
- package/dist/7639.js +0 -2
- package/dist/7639.js.map +0 -1
- package/dist/8161.js +0 -1
- package/dist/8161.js.map +0 -1
- package/dist/886.js +0 -1
- package/dist/886.js.map +0 -1
- package/dist/9186.js +0 -1
- package/dist/9186.js.map +0 -1
- package/src/core/components/carbon/controlled-dropdown.component.tsx +0 -37
- /package/dist/{7639.js.LICENSE.txt → 6078.js.LICENSE.txt} +0 -0
package/.eslintrc
CHANGED
|
@@ -22,9 +22,8 @@
|
|
|
22
22
|
"@typescript-eslint/no-explicit-any": "off",
|
|
23
23
|
"@typescript-eslint/no-non-null-assertion": "off",
|
|
24
24
|
"@typescript-eslint/no-unused-vars": "off",
|
|
25
|
-
"@typescript-eslint/no-
|
|
25
|
+
"@typescript-eslint/no-require-imports": "off",
|
|
26
26
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
27
|
-
"@typescript-eslint/ban-types": "off",
|
|
28
27
|
// Use `import type` instead of `import` for type imports https://typescript-eslint.io/blog/consistent-type-imports-and-exports-why-and-how
|
|
29
28
|
"@typescript-eslint/consistent-type-imports": [
|
|
30
29
|
"error",
|
package/.husky/pre-commit
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"hash":"c469b46f2f5a9ac5","duration":44835}
|
|
Binary file
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
assets by path *.js 6.19 MiB
|
|
2
|
+
assets by chunk 2.54 MiB (id hint: vendors)
|
|
3
|
+
assets by status 2.16 MiB [big]
|
|
4
|
+
asset 6917.js 1.67 MiB [emitted] [minimized] [big] (id hint: vendors) 1 related asset
|
|
5
|
+
asset 6078.js 504 KiB [emitted] [minimized] [big] (id hint: vendors) 2 related assets
|
|
6
|
+
asset 961.js 130 KiB [emitted] [minimized] (id hint: vendors) 2 related assets
|
|
7
|
+
asset 1116.js 115 KiB [emitted] [minimized] (id hint: vendors) 1 related asset
|
|
8
|
+
asset 282.js 74.5 KiB [emitted] [minimized] (id hint: vendors) 2 related assets
|
|
9
|
+
asset 3184.js 45.4 KiB [emitted] [minimized] (id hint: vendors) 2 related assets
|
|
10
|
+
asset 7255.js 13.5 KiB [emitted] [minimized] (id hint: vendors) 1 related asset
|
|
11
|
+
asset 2177.js 11.3 KiB [emitted] [minimized] (id hint: vendors) 2 related assets
|
|
12
|
+
+ 66 assets
|
|
13
|
+
assets by path *.json 40 KiB
|
|
14
|
+
asset openmrs-esm-stock-management-app.js.buildmanifest.json 35.4 KiB [emitted]
|
|
15
|
+
asset routes.json 4.58 KiB [emitted] [from: src/routes.json] [copied]
|
|
16
|
+
orphan modules 8.39 MiB [orphan] 2792 modules
|
|
17
|
+
runtime modules 41.4 KiB 26 modules
|
|
18
|
+
built modules 10.4 MiB (javascript) 336 bytes (share-init) 336 bytes (consume-shared) [built]
|
|
19
|
+
modules by path ./node_modules/ 7.81 MiB 385 modules
|
|
20
|
+
modules by path ./src/ 2 MiB 81 modules
|
|
21
|
+
modules by path ./translations/ 613 KiB
|
|
22
|
+
./translations/ lazy nonrecursive .json$ 160 bytes [built] [code generated]
|
|
23
|
+
+ 42 modules
|
|
24
|
+
provide-module modules 336 bytes
|
|
25
|
+
modules by path provide shared module (default) swr/ 84 bytes 2 modules
|
|
26
|
+
+ 6 modules
|
|
27
|
+
consume-shared-module modules 336 bytes
|
|
28
|
+
modules by path consume shared module (default) swr/ 84 bytes 2 modules
|
|
29
|
+
+ 6 modules
|
|
30
|
+
container entry 42 bytes [built] [code generated]
|
|
31
|
+
|
|
32
|
+
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
|
|
33
|
+
This can impact web performance.
|
|
34
|
+
Assets:
|
|
35
|
+
main.js (1.59 MiB)
|
|
36
|
+
6131.js (865 KiB)
|
|
37
|
+
6917.js (1.67 MiB)
|
|
38
|
+
6078.js (504 KiB)
|
|
39
|
+
|
|
40
|
+
WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
|
|
41
|
+
Entrypoints:
|
|
42
|
+
main (1.59 MiB)
|
|
43
|
+
main.js
|
|
44
|
+
|
|
45
|
+
webpack 5.105.3 compiled with 2 warnings in 42850 ms
|
package/README.md
CHANGED
|
@@ -2,4 +2,160 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The OpenMRS ESM Stock Management app is designed to help healthcare facilities manage inventory of medical supplies, pharmaceuticals, and other stockable items directly within OpenMRS. It facilitates accurate tracking of stock levels, stock movements, and supply chain operations. It uses the [stock management backend module](https://github.com/openmrs/openmrs-module-stockmanagement).
|
|
6
|
+
|
|
7
|
+
## Key Features
|
|
8
|
+
|
|
9
|
+
### Core Operations
|
|
10
|
+
|
|
11
|
+
- **Stock Management**: Comprehensive tracking of drugs, medical supplies, and commodities across multiple locations
|
|
12
|
+
- **Stock Operations**: Complete workflow support including:
|
|
13
|
+
- Stock receipts from suppliers with batch tracking
|
|
14
|
+
- Stock issues to locations/patients with dispatch management
|
|
15
|
+
- Transfers between locations
|
|
16
|
+
- Stock adjustments with reason codes
|
|
17
|
+
- Returns processing with acknowledgments
|
|
18
|
+
- Requisition management and fulfillment
|
|
19
|
+
- Stock takes for physical inventory reconciliation
|
|
20
|
+
- Disposal operations for expired/poor quality items
|
|
21
|
+
|
|
22
|
+
### Dashboard & Monitoring
|
|
23
|
+
|
|
24
|
+
- **Real-time Metrics**: Live dashboard showing stock levels, alerts, and key performance indicators
|
|
25
|
+
- **Smart Alerts**: Automated notifications for expiring stock (6-month forecasting), out-of-stock items, and disposal requirements
|
|
26
|
+
- **Inventory Visibility**: Multi-location stock monitoring with historical movement tracking
|
|
27
|
+
|
|
28
|
+
### Advanced Management
|
|
29
|
+
|
|
30
|
+
- **Batch Management**: Full batch number tracking with expiry dates and quality control
|
|
31
|
+
- **Packaging Units**: Support for multiple units of measure, pack sizes, and dispensing configurations
|
|
32
|
+
- **Stock Rules**: Automated reorder levels, minimum/maximum thresholds, and alert frequencies
|
|
33
|
+
- **Bulk Operations**: CSV import capabilities for large-scale stock item setup
|
|
34
|
+
|
|
35
|
+
### Reporting & Analytics
|
|
36
|
+
|
|
37
|
+
- **Comprehensive Reports**: 15+ report types including:
|
|
38
|
+
- Stock forecasting and trend analysis
|
|
39
|
+
- Movement history and transaction reports
|
|
40
|
+
- Expiry forecasting and disposal tracking
|
|
41
|
+
- Fulfillment analysis (full/partial/none)
|
|
42
|
+
- Most/least moving items analytics
|
|
43
|
+
- **Print Capabilities**: Generate bin cards, stock cards, and operation vouchers
|
|
44
|
+
|
|
45
|
+
### Administration
|
|
46
|
+
|
|
47
|
+
- **User Management**: Role-based permissions with location-specific access control
|
|
48
|
+
- **Source Management**: Supplier/vendor setup with preferred vendor assignments
|
|
49
|
+
- **Location Management**: Hierarchical location setup with inheritance rules
|
|
50
|
+
- **Workflow Controls**: Multi-step approval processes for stock operations
|
|
51
|
+
|
|
52
|
+
### Technical Features
|
|
53
|
+
|
|
54
|
+
- **Integration**: Deep integration with OpenMRS's drug, location, and encounter models
|
|
55
|
+
- **Offline Support**: Operates in both online and offline modes
|
|
56
|
+
- **Multi-language**: Support for 40+ languages with internationalization
|
|
57
|
+
- **Responsive Design**: Optimized for desktop and tablet interfaces
|
|
58
|
+
|
|
59
|
+
## Use Cases
|
|
60
|
+
|
|
61
|
+
- Monitor stock availability at health centers
|
|
62
|
+
- Prevent stock-outs by tracking re-order levels
|
|
63
|
+
- Manage inbound and outbound inventory for drugs and medical commodities
|
|
64
|
+
- Provide real-time stock insights to health workers and supply chain managers
|
|
65
|
+
|
|
66
|
+
## Requirements
|
|
67
|
+
|
|
68
|
+
- OpenMRS Platform 2.x or higher
|
|
69
|
+
- Admin privileges to install and configure the app
|
|
70
|
+
|
|
71
|
+
## Installation
|
|
72
|
+
|
|
73
|
+
1. Install the [stock management backend module](https://github.com/openmrs/openmrs-module-stockmanagement) on your OpenMRS server
|
|
74
|
+
2. Add the frontend module to your distribution by following the [O3 configuration, setup and deployment guide](https://openmrs.atlassian.net/wiki/x/YgabAQ)
|
|
75
|
+
3. Configure initial settings:
|
|
76
|
+
- Set up locations for stock management
|
|
77
|
+
- Define stock items and sources
|
|
78
|
+
- Configure user roles and permissions
|
|
79
|
+
|
|
80
|
+
## Configuration
|
|
81
|
+
|
|
82
|
+
The following configuration options are available for customization:
|
|
83
|
+
|
|
84
|
+
### Essential Configuration Options
|
|
85
|
+
|
|
86
|
+
These must be configured to match your OpenMRS concept dictionary. These UUIDs link the stock management system to the appropriate concepts in your OpenMRS installation:
|
|
87
|
+
|
|
88
|
+
- **`packingUnitsUUID`** - UUID of the concept set containing packaging unit options (e.g., "Box", "Bottle", "Strip"). Used when defining how stock items are packaged for storage and distribution.
|
|
89
|
+
|
|
90
|
+
- **`dispensingUnitsUUID`** - UUID of the concept set for dispensing units (e.g., "Tablet", "ml", "Capsule"). Used when dispensing stock items to patients or other locations.
|
|
91
|
+
|
|
92
|
+
- **`stockAdjustmentReasonUUID`** - UUID of the concept set containing reasons for stock adjustments (e.g., "Expired", "Damaged", "Lost", "Found"). Required for tracking why stock levels were manually adjusted.
|
|
93
|
+
|
|
94
|
+
- **`stockTakeReasonUUID`** - UUID of the concept set for stock take reasons (e.g., "Routine Count", "Audit", "Investigation"). Used during physical inventory reconciliation processes.
|
|
95
|
+
|
|
96
|
+
- **`stockSourceTypeUUID`** - UUID of the concept set defining types of stock sources (e.g., "Supplier", "Pharmacy", "Ward"). Used to categorize where stock comes from or goes to.
|
|
97
|
+
|
|
98
|
+
- **`stockItemCategoryUUID`** - UUID of the concept set for categorizing stock items (e.g., "Drug", "Medical Supply", "Laboratory Supply"). Used for organizing and filtering stock items.
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"packingUnitsUUID": "bce2b1af-98b1-48a2-98a2-3e4ffb3c79c2",
|
|
103
|
+
"dispensingUnitsUUID": "162402AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
|
104
|
+
"stockAdjustmentReasonUUID": "47f0825e-8648-47c2-b847-d3197ed6bb72",
|
|
105
|
+
"stockTakeReasonUUID": "47f0825e-8648-47c2-b847-d3197ed6bb72",
|
|
106
|
+
"stockSourceTypeUUID": "2e1e8049-9cbe-4a2d-b1e5-8a91e5d7d97d",
|
|
107
|
+
"stockItemCategoryUUID": "6d24eb6e-b42f-4706-ab2d-ae4472161f6a"
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Display & Behavior Options
|
|
112
|
+
|
|
113
|
+
- **`useItemCommonNameAsDisplay`** _(default: true)_ - When true, displays the common name of stock items in the UI. When false, displays the drug name instead. Useful for sites that prefer clinical vs. common terminology.
|
|
114
|
+
|
|
115
|
+
- **`autoPopulateResponsiblePerson`** _(default: false)_ - When enabled, automatically fills in the currently logged-in user as the responsible person for stock operations. Saves time for single-user workflows but may not be appropriate for multi-user scenarios.
|
|
116
|
+
|
|
117
|
+
- **`enablePrintButton`** _(default: true)_ - Controls whether print buttons appear in the stock management interface. Set to false if printing capabilities are not needed or if using custom printing solutions.
|
|
118
|
+
|
|
119
|
+
- **`printItemCost`** _(default: false)_ - When enabled, includes item costs on printed reports and documents. Enable only if cost information should be visible on printed materials.
|
|
120
|
+
|
|
121
|
+
- **`printBalanceOnHand`** _(default: false)_ - When enabled, includes current stock balance information on printed reports. Useful for inventory tracking but may not be needed for all report types.
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"useItemCommonNameAsDisplay": true,
|
|
126
|
+
"autoPopulateResponsiblePerson": false,
|
|
127
|
+
"enablePrintButton": true,
|
|
128
|
+
"printItemCost": false,
|
|
129
|
+
"printBalanceOnHand": false
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Organization Branding
|
|
134
|
+
|
|
135
|
+
Customize the appearance of printed reports and system branding:
|
|
136
|
+
|
|
137
|
+
- **`logo.src`** - Path or URL to your organization's logo image. Will be displayed on printed reports and system headers.
|
|
138
|
+
|
|
139
|
+
- **`logo.alt`** _(default: "Logo")_ - Alternative text for the logo image, shown on hover and for accessibility.
|
|
140
|
+
|
|
141
|
+
- **`logo.name`** - Organization name displayed when the logo image is unavailable or not set.
|
|
142
|
+
|
|
143
|
+
```json
|
|
144
|
+
{
|
|
145
|
+
"logo": {
|
|
146
|
+
"src": "/images/my-organization-logo.png",
|
|
147
|
+
"alt": "My Healthcare Organization Logo",
|
|
148
|
+
"name": "My Healthcare Organization"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Refer to the [OpenMRS frontend configuration guide](https://openmrs.atlassian.net/wiki/x/nAP-C) for how to apply these settings.
|
|
154
|
+
|
|
155
|
+
## Documentation
|
|
156
|
+
|
|
157
|
+
For full documentation, visit the [OpenMRS Wiki - Stock Module](https://openmrs.atlassian.net/wiki/x/zg2bAQ).
|
|
158
|
+
|
|
159
|
+
## License
|
|
160
|
+
|
|
161
|
+
This app is released under the [MPL 2.0 license with Healthcare Disclaimer](https://openmrs.org/license).
|
package/dist/1116.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.webpackChunk_openmrs_esm_stock_management_app=globalThis.webpackChunk_openmrs_esm_stock_management_app||[]).push([[1116],{97136(e,t,r){"use strict";r.d(t,{K7:()=>u,aZ:()=>c});var n,a,s,i=r(16072),o=r(60428);const u=i.forwardRef((function({children:e,size:t=16,...r},a){return i.createElement(o.A,{width:t,height:t,ref:a,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},n||(n=i.createElement("path",{d:"M16 22H30V24H16zM14 19.4L12.6 18 6 24.6 3.4 22 2 23.4 6 27.4zM16 8H30V10H16zM14 5.4L12.6 4 6 10.6 3.4 8 2 9.4 6 13.4z"})),e)})),c=i.forwardRef((function({children:e,size:t=16,...r},n){return i.createElement(o.A,{width:t,height:t,ref:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},a||(a=i.createElement("path",{d:"M16,18a5,5,0,1,1,5-5A5.0057,5.0057,0,0,1,16,18Zm0-8a3,3,0,1,0,3,3A3.0033,3.0033,0,0,0,16,10Z"})),s||(s=i.createElement("path",{d:"M16,30,7.5645,20.0513c-.0479-.0571-.3482-.4515-.3482-.4515A10.8888,10.8888,0,0,1,5,13a11,11,0,0,1,22,0,10.8844,10.8844,0,0,1-2.2148,6.5973l-.0015.0025s-.3.3944-.3447.4474ZM8.8125,18.395c.001.0007.2334.3082.2866.3744L16,26.9079l6.91-8.15c.0439-.0552.2783-.3649.2788-.3657A8.901,8.901,0,0,0,25,13,9,9,0,1,0,7,13a8.9054,8.9054,0,0,0,1.8125,5.395Z"})),e)}))},49564(e,t,r){"use strict";r.d(t,{kM:()=>l,pl:()=>d,xj:()=>c});var n,a,s,i,o=r(16072),u=r(60428);const c=o.forwardRef((function({children:e,size:t=16,...r},a){return o.createElement(u.A,{width:t,height:t,ref:a,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},n||(n=o.createElement("path",{d:"M28,9H25V3H7V9H4a2,2,0,0,0-2,2V21a2,2,0,0,0,2,2H7v6H25V23h3a2,2,0,0,0,2-2V11A2,2,0,0,0,28,9ZM9,5H23V9H9ZM23,27H9V17H23Zm5-6H25V15H7v6H4V11H28Z"})),e)})),l=o.forwardRef((function({children:e,size:t=16,...r},n){return o.createElement(u.A,{width:t,height:t,ref:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},a||(a=o.createElement("path",{d:"M6 6H26.1719l-3.586-3.5859L24 1l6 6-6 6-1.4141-1.4141L26.1719 8H6v7H4V8A2.0024 2.0024 0 016 6zM9.4141 20.4141L5.8281 24H26V17h2v7a2.0024 2.0024 0 01-2 2H5.8281L9.414 29.5859 8 31 2 25l6-6z"})),e)})),d=o.forwardRef((function({children:e,size:t=16,...r},n){return o.createElement(u.A,{width:t,height:t,ref:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},s||(s=o.createElement("path",{d:"M10 18H18V20H10zM10 13H22V15H10zM10 23H15V25H10z"})),i||(i=o.createElement("path",{d:"M25,5H22V4a2,2,0,0,0-2-2H12a2,2,0,0,0-2,2V5H7A2,2,0,0,0,5,7V28a2,2,0,0,0,2,2H25a2,2,0,0,0,2-2V7A2,2,0,0,0,25,5ZM12,4h8V8H12ZM25,28H7V7h3v3H22V7h3Z"})),e)}))},31397(e,t,r){"use strict";r.d(t,{QR:()=>o});var n,a,s=r(16072),i=r(60428);const o=s.forwardRef((function({children:e,size:t=16,...r},o){return s.createElement(i.A,{width:t,height:t,ref:o,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},n||(n=s.createElement("path",{d:"M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z"})),a||(a=s.createElement("path",{d:"M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z"})),e)}))},63654(e,t,r){"use strict";r.d(t,{QN:()=>g,U$:()=>y,_N:()=>b,jw:()=>v,rf:()=>m,t0:()=>_});var n,a,s,i,o,u,c,l,d,f,p=r(16072),h=r(60428);const m=p.forwardRef((function({children:e,size:t=16,...r},s){return p.createElement(h.A,{width:t,height:t,ref:s,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},n||(n=p.createElement("path",{d:"M4 16H16V18H4zM2 11H12V13H2z"})),a||(a=p.createElement("path",{d:"M29.9189,16.6064l-3-7A.9985.9985,0,0,0,26,9H23V7a1,1,0,0,0-1-1H6V8H21V20.5562A3.9924,3.9924,0,0,0,19.1421,23H12.8579a4,4,0,1,0,0,2h6.2842a3.9806,3.9806,0,0,0,7.7158,0H29a1,1,0,0,0,1-1V17A.9965.9965,0,0,0,29.9189,16.6064ZM9,26a2,2,0,1,1,2-2A2.0023,2.0023,0,0,1,9,26ZM23,11h2.3408l2.1431,5H23Zm0,15a2,2,0,1,1,2-2A2.0023,2.0023,0,0,1,23,26Zm5-3H26.8579A3.9954,3.9954,0,0,0,23,20V18h5Z"})),e)})),y=p.forwardRef((function({children:e,size:t=16,...r},n){return p.createElement(h.A,{width:t,height:t,ref:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},s||(s=p.createElement("path",{d:"M29.92,16.61l-3-7A1,1,0,0,0,26,9H23V7a1,1,0,0,0-1-1H3A1,1,0,0,0,2,7V24a1,1,0,0,0,1,1H5.14a4,4,0,0,0,7.72,0h6.28a4,4,0,0,0,7.72,0H29a1,1,0,0,0,1-1V17A1,1,0,0,0,29.92,16.61ZM23,11h2.34l2.14,5H23ZM9,26a2,2,0,1,1,2-2A2,2,0,0,1,9,26Zm10.14-3H12.86a4,4,0,0,0-7.72,0H4V8H21V20.56A4,4,0,0,0,19.14,23ZM23,26a2,2,0,1,1,2-2A2,2,0,0,1,23,26Zm5-3H26.86A4,4,0,0,0,23,20V18h5Z"})),e)})),v=p.forwardRef((function({children:e,size:t=16,...r},n){return p.createElement(h.A,{width:t,height:t,ref:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},i||(i=p.createElement("path",{d:"M2 28H30V30H2zM13.48 5.15l5.69 8.14.8 1.15 1.35-.36 4.52-1.21a2.13 2.13 0 011.12 0A1.84 1.84 0 0128.23 14 1.87 1.87 0 0127 16.45l-18.71 5a1.78 1.78 0 01-1 0A1.87 1.87 0 016 20.12l-.25-.93L5 16.38l-.74-2.74 1.44-.39L8 16.35l.81 1.08 1.31-.35 2.8-.75 1.94-.52-.52-1.93L12.08 5.52l1.4-.37M14.16 3a1.06 1.06 0 00-.5 0l-3.09.83A1 1 0 009.89 5l2.5 9.36-2.81.75L6.85 11.5a1 1 0 00-.52-.36 1.06 1.06 0 00-.5 0L2.72 12A1 1 0 002 13.16L3 16.9l.75 2.8.25.94a3.87 3.87 0 002.74 2.74 3.91 3.91 0 002 0l18.7-5a3.84 3.84 0 000-7.44 4.27 4.27 0 00-2.16 0l-4.51 1.21L14.7 3.41A1 1 0 0014.16 3z"})),e)})),g=p.forwardRef((function({children:e,size:t=16,...r},n){return p.createElement(h.A,{width:t,height:t,ref:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},o||(o=p.createElement("path",{d:"M30 25L28.586 23.586 26 26.172 26 18 24 18 24 26.172 21.414 23.586 20 25 25 30 30 25z"})),u||(u=p.createElement("path",{d:"M18,28H8V4h8v6a2.0058,2.0058,0,0,0,2,2h6v3l2,0V10a.9092.9092,0,0,0-.3-.7l-7-7A.9087.9087,0,0,0,18,2H8A2.0058,2.0058,0,0,0,6,4V28a2.0058,2.0058,0,0,0,2,2H18ZM18,4.4,23.6,10H18Z"})),e)})),_=p.forwardRef((function({children:e,size:t=16,...r},n){return p.createElement(h.A,{width:t,height:t,ref:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},c||(c=p.createElement("path",{d:"M28 19L14.83 19 17.41 16.41 16 15 11 20 16 25 17.41 23.59 14.83 21 28 21 28 19z"})),l||(l=p.createElement("path",{d:"M24,14V10a1,1,0,0,0-.29-.71l-7-7A1,1,0,0,0,16,2H6A2,2,0,0,0,4,4V28a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V26H22v2H6V4h8v6a2,2,0,0,0,2,2h6v2Zm-8-4V4.41L21.59,10Z"})),e)})),b=p.forwardRef((function({children:e,size:t=16,...r},n){return p.createElement(h.A,{width:t,height:t,ref:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...r},d||(d=p.createElement("path",{d:"M28,21V18a4,4,0,0,0-8,0v3a2.0025,2.0025,0,0,0-2,2v5a2.0025,2.0025,0,0,0,2,2h8a2.0025,2.0025,0,0,0,2-2V23A2.0025,2.0025,0,0,0,28,21Zm-6-3a2,2,0,0,1,4,0v3H22ZM20,28V23h8v5Z"})),f||(f=p.createElement("path",{d:"M23.499,9.085,16.707,2.293A1,1,0,0,0,16,2H6A2.0058,2.0058,0,0,0,4,4V28a2.0058,2.0058,0,0,0,2,2h8V28H6V4h8v6a2.0023,2.0023,0,0,0,2,2h6.292a1.7075,1.7075,0,0,0,1.207-2.915ZM16,10V4.4141L21.5854,10Z"})),e)}))},8906(e){e.exports=function(){"use strict";return function(e,t){t.prototype.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)}}}()},4213(e,t){var r,n;void 0===(n="function"==typeof(r=function(){"use strict";function t(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){i(n.response,t,r)},n.onerror=function(){console.error("could not download file")},n.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function n(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof globalThis&&globalThis.global===globalThis?globalThis:void 0,s=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),i=a.saveAs||("object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(e,s,i){var o=a.URL||a.webkitURL,u=document.createElement("a");s=s||e.name||"download",u.download=s,u.rel="noopener","string"==typeof e?(u.href=e,u.origin===location.origin?n(u):r(u.href)?t(e,s,i):n(u,u.target="_blank")):(u.href=o.createObjectURL(e),setTimeout((function(){o.revokeObjectURL(u.href)}),4e4),setTimeout((function(){n(u)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,a,s){if(a=a||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,s),a);else if(r(e))t(e,a,s);else{var i=document.createElement("a");i.href=e,i.target="_blank",setTimeout((function(){n(i)}))}}:function(e,r,n,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof e)return t(e,r,n);var o="application/octet-stream"===e.type,u=/constructor/i.test(a.HTMLElement)||a.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||o&&u||s)&&"undefined"!=typeof FileReader){var l=new FileReader;l.onloadend=function(){var e=l.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},l.readAsDataURL(e)}else{var d=a.URL||a.webkitURL,f=d.createObjectURL(e);i?i.location=f:location.href=f,i=null,setTimeout((function(){d.revokeObjectURL(f)}),4e4)}});a.saveAs=i.saveAs=i,e.exports=i})?r.apply(t,[]):r)||(e.exports=n)},57240(e,t,r){var n,a;"undefined"!=typeof self&&self,e.exports=(n=r(16072),a=r(40961),function(){"use strict";var e={328:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.PrintContextConsumer=t.PrintContext=void 0;var n=r(496),a=Object.prototype.hasOwnProperty.call(n,"createContext");t.PrintContext=a?n.createContext({}):null,t.PrintContextConsumer=t.PrintContext?t.PrintContext.Consumer:function(){return null}},428:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.ReactToPrint=void 0;var n=r(316),a=r(496),s=r(190),i=r(328),o=r(940),u=function(e){function t(){var t=e.apply(this,n.__spreadArray([],n.__read(arguments),!1))||this;return t.startPrint=function(e){var r=t.props,n=r.onAfterPrint,a=r.onPrintError,s=r.print,i=r.documentTitle;setTimeout((function(){var r,o;if(e.contentWindow)if(e.contentWindow.focus(),s)s(e).then((function(){return null==n?void 0:n()})).then((function(){return t.handleRemoveIframe()})).catch((function(e){a?a("print",e):t.logMessages(["An error was thrown by the specified `print` function"])}));else{if(e.contentWindow.print){var u=null!==(o=null===(r=e.contentDocument)||void 0===r?void 0:r.title)&&void 0!==o?o:"",c=e.ownerDocument.title;i&&(e.ownerDocument.title=i,e.contentDocument&&(e.contentDocument.title=i)),e.contentWindow.print(),i&&(e.ownerDocument.title=c,e.contentDocument&&(e.contentDocument.title=u))}else t.logMessages(["Printing for this browser is not currently possible: the browser does not have a `print` method available for iframes."]);null==n||n(),t.handleRemoveIframe()}else t.logMessages(["Printing failed because the `contentWindow` of the print iframe did not load. This is possibly an error with `react-to-print`. Please file an issue: https://github.com/gregnb/react-to-print/issues/"])}),500)},t.triggerPrint=function(e){var r=t.props,n=r.onBeforePrint,a=r.onPrintError;if(n){var s=n();s&&"function"==typeof s.then?s.then((function(){t.startPrint(e)})).catch((function(e){a&&a("onBeforePrint",e)})):t.startPrint(e)}else t.startPrint(e)},t.handlePrint=function(e){var r=t.props,a=r.bodyClass,i=r.content,o=r.copyStyles,u=r.fonts,c=r.pageStyle,l=r.nonce,d="function"==typeof e?e():null;if(d&&"function"==typeof i&&t.logMessages(['"react-to-print" received a `content` prop and a content param passed the callback return by `useReactToPrint. The `content` prop will be ignored.'],"warning"),d||"function"!=typeof i||(d=i()),void 0!==d)if(null!==d){var f=document.createElement("iframe");f.width="".concat(document.documentElement.clientWidth,"px"),f.height="".concat(document.documentElement.clientHeight,"px"),f.style.position="absolute",f.style.top="-".concat(document.documentElement.clientHeight+100,"px"),f.style.left="-".concat(document.documentElement.clientWidth+100,"px"),f.id="printWindow",f.srcdoc="<!DOCTYPE html>";var p=(0,s.findDOMNode)(d);if(p){var h=p.cloneNode(!0),m=h instanceof Text,y=document.querySelectorAll("link[rel~='stylesheet'], link[as='style']"),v=m?[]:h.querySelectorAll("img"),g=m?[]:h.querySelectorAll("video"),_=u?u.length:0;t.numResourcesToLoad=y.length+v.length+g.length+_,t.resourcesLoaded=[],t.resourcesErrored=[];var b=function(e,r){t.resourcesLoaded.includes(e)?t.logMessages(["Tried to mark a resource that has already been handled",e],"debug"):(r?(t.logMessages(n.__spreadArray(['"react-to-print" was unable to load a resource but will continue attempting to print the page'],n.__read(r),!1)),t.resourcesErrored.push(e)):t.resourcesLoaded.push(e),t.resourcesLoaded.length+t.resourcesErrored.length===t.numResourcesToLoad&&t.triggerPrint(f))};f.onload=function(){var e,r,s,i;f.onload=null;var d=f.contentDocument||(null===(r=f.contentWindow)||void 0===r?void 0:r.document);if(d){d.body.appendChild(h),u&&((null===(s=f.contentDocument)||void 0===s?void 0:s.fonts)&&(null===(i=f.contentWindow)||void 0===i?void 0:i.FontFace)?u.forEach((function(e){var t=new FontFace(e.family,e.source,{weight:e.weight,style:e.style});f.contentDocument.fonts.add(t),t.loaded.then((function(){b(t)})).catch((function(e){b(t,["Failed loading the font:",t,"Load error:",e])}))})):(u.forEach((function(e){return b(e)})),t.logMessages(['"react-to-print" is not able to load custom fonts because the browser does not support the FontFace API but will continue attempting to print the page'])));var y="function"==typeof c?c():c;if("string"!=typeof y)t.logMessages(['"react-to-print" expected a "string" from `pageStyle` but received "'.concat(typeof y,'". Styles from `pageStyle` will not be applied.')]);else{var _=d.createElement("style");l&&(_.setAttribute("nonce",l),d.head.setAttribute("nonce",l)),_.appendChild(d.createTextNode(y)),d.head.appendChild(_)}if(a&&(e=d.body.classList).add.apply(e,n.__spreadArray([],n.__read(a.split(" ")),!1)),!m){for(var w=m?[]:p.querySelectorAll("canvas"),x=d.querySelectorAll("canvas"),k=0;k<w.length;++k){var A=w[k],E=x[k].getContext("2d");E&&E.drawImage(A,0,0)}var S=function(e){var t=v[e],r=t.getAttribute("src");if(r){var n=new Image;n.onload=function(){return b(t)},n.onerror=function(e,r,n,a,s){return b(t,["Error loading <img>",t,"Error",s])},n.src=r}else b(t,['Found an <img> tag with an empty "src" attribute. This prevents pre-loading it. The <img> is:',t])};for(k=0;k<v.length;k++)S(k);var T=function(e){var t=g[e];t.preload="auto";var r=t.getAttribute("poster");if(r){var n=new Image;n.onload=function(){return b(t)},n.onerror=function(e,n,a,s,i){return b(t,["Error loading video poster",r,"for video",t,"Error:",i])},n.src=r}else t.readyState>=2?b(t):(t.onloadeddata=function(){return b(t)},t.onerror=function(e,r,n,a,s){return b(t,["Error loading video",t,"Error",s])},t.onstalled=function(){return b(t,["Loading video stalled, skipping",t])})};for(k=0;k<g.length;k++)T(k);var O="input",Z=p.querySelectorAll(O),C=d.querySelectorAll(O);for(k=0;k<Z.length;k++)C[k].value=Z[k].value;var V="input[type=checkbox],input[type=radio]",j=p.querySelectorAll(V),P=d.querySelectorAll(V);for(k=0;k<j.length;k++)P[k].checked=j[k].checked;var R="select",M=p.querySelectorAll(R),N=d.querySelectorAll(R);for(k=0;k<M.length;k++)N[k].value=M[k].value}if(o)for(var D=document.querySelectorAll("style, link[rel~='stylesheet'], link[as='style']"),I=function(e,r){var n=D[e];if("style"===n.tagName.toLowerCase()){var a=d.createElement(n.tagName),s=n.sheet;if(s){var i="";try{for(var o=s.cssRules.length,u=0;u<o;++u)"string"==typeof s.cssRules[u].cssText&&(i+="".concat(s.cssRules[u].cssText,"\r\n"))}catch(e){t.logMessages(["A stylesheet could not be accessed. This is likely due to the stylesheet having cross-origin imports, and many browsers block script access to cross-origin stylesheets. See https://github.com/gregnb/react-to-print/issues/429 for details. You may be able to load the sheet by both marking the stylesheet with the cross `crossorigin` attribute, and setting the `Access-Control-Allow-Origin` header on the server serving the stylesheet. Alternatively, host the stylesheet on your domain to avoid this issue entirely.",n],"warning")}a.setAttribute("id","react-to-print-".concat(e)),l&&a.setAttribute("nonce",l),a.appendChild(d.createTextNode(i)),d.head.appendChild(a)}}else if(n.getAttribute("href"))if(n.hasAttribute("disabled"))t.logMessages(["`react-to-print` encountered a <link> tag with a `disabled` attribute and will ignore it. Note that the `disabled` attribute is deprecated, and some browsers ignore it. You should stop using it. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled. The <link> is:",n],"warning"),b(n);else{for(var c=d.createElement(n.tagName),f=(u=0,n.attributes.length);u<f;++u){var p=n.attributes[u];p&&c.setAttribute(p.nodeName,p.nodeValue||"")}c.onload=function(){return b(c)},c.onerror=function(e,t,r,n,a){return b(c,["Failed to load",c,"Error:",a])},l&&c.setAttribute("nonce",l),d.head.appendChild(c)}else t.logMessages(["`react-to-print` encountered a <link> tag with an empty `href` attribute. In addition to being invalid HTML, this can cause problems in many browsers, and so the <link> was not loaded. The <link> is:",n],"warning"),b(n)},L=(k=0,D.length);k<L;++k)I(k)}0!==t.numResourcesToLoad&&o||t.triggerPrint(f)},t.handleRemoveIframe(!0),document.body.appendChild(f)}else t.logMessages(['"react-to-print" could not locate the DOM node corresponding with the `content` prop'])}else t.logMessages(['There is nothing to print because the "content" prop returned "null". Please ensure "content" is renderable before allowing "react-to-print" to be called.']);else t.logMessages(["To print a functional component ensure it is wrapped with `React.forwardRef`, and ensure the forwarded ref is used. See the README for an example: https://github.com/gregnb/react-to-print#examples"])},t.handleRemoveIframe=function(e){var r=t.props.removeAfterPrint;if(e||r){var n=document.getElementById("printWindow");n&&document.body.removeChild(n)}},t.logMessages=function(e,r){void 0===r&&(r="error"),t.props.suppressErrors||("error"===r?console.error(e):"warning"===r?console.warn(e):"debug"===r&&console.debug(e))},t}return n.__extends(t,e),t.prototype.handleClick=function(e,t){var r=this,n=this.props,a=n.onBeforeGetContent,s=n.onPrintError;if(a){var i=a();i&&"function"==typeof i.then?i.then((function(){return r.handlePrint(t)})).catch((function(e){s&&s("onBeforeGetContent",e)})):this.handlePrint(t)}else this.handlePrint(t)},t.prototype.render=function(){var e=this.props,t=e.children,r=e.trigger;if(r)return a.cloneElement(r(),{onClick:this.handleClick.bind(this)});if(!i.PrintContext)return this.logMessages(['"react-to-print" requires React ^16.3.0 to be able to use "PrintContext"']),null;var n={handlePrint:this.handleClick.bind(this)};return a.createElement(i.PrintContext.Provider,{value:n},t)},t.defaultProps=o.defaultProps,t}(a.Component);t.ReactToPrint=u},940:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.defaultProps=void 0,t.defaultProps={copyStyles:!0,pageStyle:"\n @page {\n /* Remove browser default header (title) and footer (url) */\n margin: 0;\n }\n @media print {\n body {\n /* Tell browsers to print background colors */\n -webkit-print-color-adjust: exact; /* Chrome/Safari/Edge/Opera */\n color-adjust: exact; /* Firefox */\n }\n }\n ",removeAfterPrint:!1,suppressErrors:!1}},892:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.useReactToPrint=void 0;var n=r(316),a=r(496),s=r(428),i=r(940),o=r(860),u=Object.prototype.hasOwnProperty.call(a,"useMemo")&&Object.prototype.hasOwnProperty.call(a,"useCallback");t.useReactToPrint=function(e){if(!u)return e.suppressErrors||console.error('"react-to-print" requires React ^16.8.0 to be able to use "useReactToPrint"'),function(){throw new Error('"react-to-print" requires React ^16.8.0 to be able to use "useReactToPrint"')};var t=a.useMemo((function(){return new s.ReactToPrint(n.__assign(n.__assign({},i.defaultProps),e))}),[e]);return a.useCallback((function(e,r){return(0,o.wrapCallbackWithArgs)(t,t.handleClick,r)(e)}),[t])}},860:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.wrapCallbackWithArgs=void 0;var n=r(316);t.wrapCallbackWithArgs=function(e,t){for(var r=[],a=2;a<arguments.length;a++)r[a-2]=arguments[a];return function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return t.apply(e,n.__spreadArray(n.__spreadArray([],n.__read(a),!1),n.__read(r),!1))}}},496:function(e){e.exports=n},190:function(e){e.exports=a},316:function(e,t,r){r.r(t),r.d(t,{__addDisposableResource:function(){return R},__assign:function(){return s},__asyncDelegator:function(){return E},__asyncGenerator:function(){return A},__asyncValues:function(){return S},__await:function(){return k},__awaiter:function(){return h},__classPrivateFieldGet:function(){return V},__classPrivateFieldIn:function(){return P},__classPrivateFieldSet:function(){return j},__createBinding:function(){return y},__decorate:function(){return o},__disposeResources:function(){return N},__esDecorate:function(){return c},__exportStar:function(){return v},__extends:function(){return a},__generator:function(){return m},__importDefault:function(){return C},__importStar:function(){return Z},__makeTemplateObject:function(){return T},__metadata:function(){return p},__param:function(){return u},__propKey:function(){return d},__read:function(){return _},__rest:function(){return i},__runInitializers:function(){return l},__setFunctionName:function(){return f},__spread:function(){return b},__spreadArray:function(){return x},__spreadArrays:function(){return w},__values:function(){return g}});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},s.apply(this,arguments)};function i(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}function o(e,t,r,n){var a,s=arguments.length,i=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(i=(s<3?a(i):s>3?a(t,r,i):a(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i}function u(e,t){return function(r,n){t(r,n,e)}}function c(e,t,r,n,a,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,u=n.kind,c="getter"===u?"get":"setter"===u?"set":"value",l=!t&&e?n.static?e:e.prototype:null,d=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),f=!1,p=r.length-1;p>=0;p--){var h={};for(var m in n)h[m]="access"===m?{}:n[m];for(var m in n.access)h.access[m]=n.access[m];h.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,r[p])("accessor"===u?{get:d.get,set:d.set}:d[c],h);if("accessor"===u){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(o=i(y.get))&&(d.get=o),(o=i(y.set))&&(d.set=o),(o=i(y.init))&&a.unshift(o)}else(o=i(y))&&("field"===u?a.unshift(o):d[c]=o)}l&&Object.defineProperty(l,n.name,d),f=!0}function l(e,t,r){for(var n=arguments.length>2,a=0;a<t.length;a++)r=n?t[a].call(e,r):t[a].call(e);return n?r:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function f(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function p(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,r,n){return new(r||(r=Promise))((function(a,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function o(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,o)}u((n=n.apply(e,t||[])).next())}))}function m(e,t){var r,n,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(i=0)),i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!((a=(a=i.trys).length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}var y=Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function v(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||y(t,e,r)}function g(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(a)throw a.error}}return i}function b(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(_(arguments[t]));return e}function w(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),a=0;for(t=0;t<r;t++)for(var s=arguments[t],i=0,o=s.length;i<o;i++,a++)n[a]=s[i];return n}function x(e,t,r){if(r||2===arguments.length)for(var n,a=0,s=t.length;a<s;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}function k(e){return this instanceof k?(this.v=e,this):new k(e)}function A(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,a=r.apply(e,t||[]),s=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(e){a[e]&&(n[e]=function(t){return new Promise((function(r,n){s.push([e,t,r,n])>1||o(e,t)}))})}function o(e,t){try{(r=a[e](t)).value instanceof k?Promise.resolve(r.value.v).then(u,c):l(s[0][2],r)}catch(e){l(s[0][3],e)}var r}function u(e){o("next",e)}function c(e){o("throw",e)}function l(e,t){e(t),s.shift(),s.length&&o(s[0][0],s[0][1])}}function E(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,a){t[n]=e[n]?function(t){return(r=!r)?{value:k(e[n](t)),done:!1}:a?a(t):t}:a}}function S(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=g(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,a){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,a,(t=e[r](t)).done,t.value)}))}}}function T(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var O=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function Z(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&y(t,e,r);return O(t,e),t}function C(e){return e&&e.__esModule?e:{default:e}}function V(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function j(e,t,r,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(e,r):a?a.value=r:t.set(e,r),r}function P(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function R(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if("function"!=typeof n)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var M="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function N(e){function t(t){e.error=e.hasError?new M(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function r(){for(;e.stack.length;){var n=e.stack.pop();try{var a=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(a).then(r,(function(e){return t(e),r()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}t.default={__extends:a,__assign:s,__rest:i,__decorate:o,__param:u,__metadata:p,__awaiter:h,__generator:m,__createBinding:y,__exportStar:v,__values:g,__read:_,__spread:b,__spreadArrays:w,__spreadArray:x,__await:k,__asyncGenerator:A,__asyncDelegator:E,__asyncValues:S,__makeTemplateObject:T,__importStar:Z,__importDefault:C,__classPrivateFieldGet:V,__classPrivateFieldSet:j,__classPrivateFieldIn:P,__addDisposableResource:R,__disposeResources:N}}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return function(){var e=s;Object.defineProperty(e,"__esModule",{value:!0}),e.useReactToPrint=e.ReactToPrint=e.PrintContextConsumer=void 0;var t=r(328);Object.defineProperty(e,"PrintContextConsumer",{enumerable:!0,get:function(){return t.PrintContextConsumer}});var n=r(428);Object.defineProperty(e,"ReactToPrint",{enumerable:!0,get:function(){return n.ReactToPrint}});var a=r(892);Object.defineProperty(e,"useReactToPrint",{enumerable:!0,get:function(){return a.useReactToPrint}});var i=r(428);e.default=i.ReactToPrint}(),s}())},28871(e,t,r){"use strict";r.d(t,{u:()=>c});var n=r(49785),a=function(e,t,r){if(e&&"reportValidity"in e){var a=(0,n.Jt)(r,t);e.setCustomValidity(a&&a.message||""),e.reportValidity()}},s=function(e,t){var r=function(r){var n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?a(n.ref,r,e):n.refs&&n.refs.forEach((function(t){return a(t,r,e)}))};for(var n in t.fields)r(n)},i=function(e,t){t.shouldUseNativeValidation&&s(e,t);var r={};for(var a in e){var i=(0,n.Jt)(t.fields,a),u=Object.assign(e[a]||{},{ref:i&&i.ref});if(o(t.names||Object.keys(e),a)){var c=Object.assign({},(0,n.Jt)(r,a));(0,n.hZ)(c,"root",u),(0,n.hZ)(r,a,c)}else(0,n.hZ)(r,a,u)}return r},o=function(e,t){return e.some((function(e){return e.startsWith(t+".")}))},u=function(e,t){for(var r={};e.length;){var a=e[0],s=a.code,i=a.message,o=a.path.join(".");if(!r[o])if("unionErrors"in a){var u=a.unionErrors[0].errors[0];r[o]={message:u.message,type:u.code}}else r[o]={message:i,type:s};if("unionErrors"in a&&a.unionErrors.forEach((function(t){return t.errors.forEach((function(t){return e.push(t)}))})),t){var c=r[o].types,l=c&&c[a.code];r[o]=(0,n.Gb)(o,t,r,s,l?[].concat(l,a.message):a.message)}e.shift()}return r},c=function(e,t,r){return void 0===r&&(r={}),function(n,a,o){try{return Promise.resolve(function(a,i){try{var u=Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then((function(e){return o.shouldUseNativeValidation&&s({},o),{errors:{},values:r.raw?n:e}}))}catch(e){return i(e)}return u&&u.then?u.then(void 0,i):u}(0,(function(e){if(function(e){return null!=e.errors}(e))return{values:{},errors:i(u(e.errors,!o.shouldUseNativeValidation&&"all"===o.criteriaMode),o)};throw e})))}catch(e){return Promise.reject(e)}}}},37843(e,t,r){"use strict";r.d(t,{A:()=>Y});const n=(a={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},function(e){return null==a?void 0:a[e]});var a,s=r(28894),i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var u=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var c=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var l="\\ud800-\\udfff",d="\\u2700-\\u27bf",f="a-z\\xdf-\\xf6\\xf8-\\xff",p="A-Z\\xc0-\\xd6\\xd8-\\xde",h="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",m="["+h+"]",y="\\d+",v="["+d+"]",g="["+f+"]",_="[^"+l+h+y+d+f+p+"]",b="(?:\\ud83c[\\udde6-\\uddff]){2}",w="[\\ud800-\\udbff][\\udc00-\\udfff]",x="["+p+"]",k="(?:"+g+"|"+_+")",A="(?:"+x+"|"+_+")",E="(?:['’](?:d|ll|m|re|s|t|ve))?",S="(?:['’](?:D|LL|M|RE|S|T|VE))?",T="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",O="[\\ufe0e\\ufe0f]?",Z=O+T+"(?:\\u200d(?:"+["[^"+l+"]",b,w].join("|")+")"+O+T+")*",C="(?:"+[v,b,w].join("|")+")"+Z,V=RegExp([x+"?"+g+"+"+E+"(?="+[m,x,"$"].join("|")+")",A+"+"+S+"(?="+[m,x+k,"$"].join("|")+")",x+"?"+k+"+"+E,x+"+"+S,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",y,C].join("|"),"g");const j=function(e,t,r){return e=(0,s.A)(e),void 0===(t=r?void 0:t)?function(e){return c.test(e)}(e)?function(e){return e.match(V)||[]}(e):function(e){return e.match(u)||[]}(e):e.match(t)||[]};var P=RegExp("['’]","g");var R=r(37688);var M=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const N=function(e){return M.test(e)};var D="\\ud800-\\udfff",I="["+D+"]",L="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",F="\\ud83c[\\udffb-\\udfff]",H="[^"+D+"]",z="(?:\\ud83c[\\udde6-\\uddff]){2}",U="[\\ud800-\\udbff][\\udc00-\\udfff]",B="(?:"+L+"|"+F+")?",$="[\\ufe0e\\ufe0f]?",W=$+B+"(?:\\u200d(?:"+[H,z,U].join("|")+")"+$+B+")*",q="(?:"+[H+L+"?",L,z,U,I].join("|")+")",K=RegExp(F+"(?="+F+")|"+q+W,"g");const G=function(e){return N(e)?function(e){return e.match(K)||[]}(e):function(e){return e.split("")}(e)},J=function(e){e=(0,s.A)(e);var t,r,n,a,i=N(e)?G(e):void 0,o=i?i[0]:e.charAt(0),u=i?(t=i,r=1,a=t.length,n=void 0===n?a:n,!r&&n>=a?t:(0,R.A)(t,r,n)).join(""):e.slice(1);return o.toUpperCase()+u},Y=(X=function(e,t,r){return e+(r?" ":"")+J(t)},function(e){return function(e,t,r,n){var a=-1,s=null==e?0:e.length;for(n&&s&&(r=e[++a]);++a<s;)r=t(r,e[a],a,e);return r}(j(function(e){return(e=(0,s.A)(e))&&e.replace(i,n).replace(o,"")}(e).replace(P,"")),X,"")});var X},61312(e,t,r){"use strict";r.d(t,{A:()=>V});var n=r(11754),a=r(86993);var s=r(23149);const i=function(e){return e==e&&!(0,s.A)(e)};var o=r(27422);const u=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}},c=function(e){var t=function(e){for(var t=(0,o.A)(e),r=t.length;r--;){var n=t[r],a=e[n];t[r]=[n,a,i(a)]}return t}(e);return 1==t.length&&t[0][2]?u(t[0][0],t[0][1]):function(r){return r===e||function(e,t,r,s){var i=r.length,o=i,u=!s;if(null==e)return!o;for(e=Object(e);i--;){var c=r[i];if(u&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++i<o;){var l=(c=r[i])[0],d=e[l],f=c[1];if(u&&c[2]){if(void 0===d&&!(l in e))return!1}else{var p=new n.A;if(s)var h=s(d,f,l,e,t,p);if(!(void 0===h?(0,a.A)(f,d,3,s,p):h))return!1}}return!0}(r,e,t)}};var l=r(66318);const d=function(e,t){return null!=e&&t in Object(e)};var f=r(63442),p=r(52274),h=r(92049),m=r(25353),y=r(5254),v=r(30901);const g=function(e,t){return null!=e&&function(e,t,r){for(var n=-1,a=(t=(0,f.A)(t,e)).length,s=!1;++n<a;){var i=(0,v.A)(t[n]);if(!(s=null!=e&&r(e,i)))break;e=e[i]}return s||++n!=a?s:!!(a=null==e?0:e.length)&&(0,y.A)(a)&&(0,m.A)(i,a)&&((0,h.A)(e)||(0,p.A)(e))}(e,t,d)};var _=r(86586);const b=function(e,t){return(0,_.A)(e)&&i(t)?u((0,v.A)(e),t):function(r){var n=function(e,t,r){var n=null==e?void 0:(0,l.A)(e,t);return void 0===n?r:n}(r,e);return void 0===n&&n===t?g(r,e):(0,a.A)(t,n,3)}};var w=r(29008);const x=function(e){return(0,_.A)(e)?(t=(0,v.A)(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return(0,l.A)(t,e)}}(e);var t};var k=r(62062);const A=function(e){return e!=e},E=function(e,t){return!(null==e||!e.length)&&function(e,t,r){return t==t?function(e,t,r){for(var n=r-1,a=e.length;++n<a;)if(e[n]===t)return n;return-1}(e,t,r):function(e,t,r,n){for(var a=e.length,s=r+(n?1:-1);n?s--:++s<a;)if(t(e[s],s,e))return s;return-1}(e,A,r)}(e,t,0)>-1},S=function(e,t,r){for(var n=-1,a=null==e?0:e.length;++n<a;)if(r(t,e[n]))return!0;return!1};var T=r(64099),O=r(39857);var Z=r(29959);const C=O.A&&1/(0,Z.A)(new O.A([,-0]))[1]==1/0?function(e){return new O.A(e)}:function(){},V=function(e,t){return e&&e.length?function(e,t,r){var n=-1,a=E,s=e.length,i=!0,o=[],u=o;if(r)i=!1,a=S;else if(s>=200){var c=t?null:C(e);if(c)return(0,Z.A)(c);i=!1,a=T.A,u=new k.A}else u=t?[]:o;e:for(;++n<s;){var l=e[n],d=t?t(l):l;if(l=r||0!==l?l:0,i&&d==d){for(var f=u.length;f--;)if(u[f]===d)continue e;t&&u.push(d),o.push(l)}else a(u,d,r)||(u!==o&&u.push(d),o.push(l))}return o}(e,"function"==typeof(r=t)?r:null==r?w.A:"object"==typeof r?(0,h.A)(r)?b(r[0],r[1]):c(r):x(r)):[];var r}},49785(e,t,r){"use strict";r.d(t,{Gb:()=>L,Jt:()=>m,Op:()=>E,as:()=>D,hZ:()=>N,mN:()=>be,xI:()=>I,xW:()=>A});var n=r(16072),a=e=>"checkbox"===e.type,s=e=>e instanceof Date,i=e=>null==e;const o=e=>"object"==typeof e;var u=e=>!i(e)&&!Array.isArray(e)&&o(e)&&!s(e),c=e=>u(e)&&e.target?a(e.target)?e.target.checked:e.target.value:e,l=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),d="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function f(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(d&&(e instanceof Blob||e instanceof FileList)||!r&&!u(e))return e;if(t=r?[]:{},r||(e=>{const t=e.constructor&&e.constructor.prototype;return u(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=f(e[r]));else t=e}return t}var p=e=>Array.isArray(e)?e.filter(Boolean):[],h=e=>void 0===e,m=(e,t,r)=>{if(!t||!u(e))return r;const n=p(t.split(/[,[\].]+?/)).reduce(((e,t)=>i(e)?e:e[t]),e);return h(n)||n===e?h(e[t])?r:e[t]:n},y=e=>"boolean"==typeof e;const v="blur",g="onChange",_="onSubmit",b="all",w="pattern",x="required",k=n.createContext(null),A=()=>n.useContext(k),E=e=>{const{children:t,...r}=e;return n.createElement(k.Provider,{value:r},t)};var S=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(a,s,{get:()=>{const a=s;return t._proxyFormState[a]!==b&&(t._proxyFormState[a]=!n||b),r&&(r[a]=!0),e[a]}});return a},T=e=>u(e)&&!Object.keys(e).length,O=(e,t,r,n)=>{r(e);const{name:a,...s}=e;return T(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find((e=>t[e]===(!n||b)))},Z=e=>Array.isArray(e)?e:[e],C=(e,t,r)=>!e||!t||e===t||Z(e).some((e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e))));function V(e){const t=n.useRef(e);t.current=e,n.useEffect((()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}}),[e.disabled])}var j=e=>"string"==typeof e,P=(e,t,r,n,a)=>j(e)?(n&&t.watch.add(e),m(r,e,a)):Array.isArray(e)?e.map((e=>(n&&t.watch.add(e),m(r,e)))):(n&&(t.watchAll=!0),r),R=e=>/^\w*$/.test(e),M=e=>p(e.replace(/["|']|\]/g,"").split(/\.|\[/)),N=(e,t,r)=>{let n=-1;const a=R(t)?[t]:M(t),s=a.length,i=s-1;for(;++n<s;){const t=a[n];let s=r;if(n!==i){const r=e[t];s=u(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}e[t]=s,e=e[t]}return e};function D(e){const t=A(),{name:r,disabled:a,control:s=t.control,shouldUnregister:i}=e,o=l(s._names.array,r),u=function(e){const t=A(),{control:r=t.control,name:a,defaultValue:s,disabled:i,exact:o}=e||{},u=n.useRef(a);u.current=a,V({disabled:i,subject:r._subjects.values,next:e=>{C(u.current,e.name,o)&&l(f(P(u.current,r._names,e.values||r._formValues,!1,s)))}});const[c,l]=n.useState(r._getWatch(a,s));return n.useEffect((()=>r._removeUnmounted())),c}({control:s,name:r,defaultValue:m(s._formValues,r,m(s._defaultValues,r,e.defaultValue)),exact:!0}),d=function(e){const t=A(),{control:r=t.control,disabled:a,name:s,exact:i}=e||{},[o,u]=n.useState(r._formState),c=n.useRef(!0),l=n.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=n.useRef(s);return d.current=s,V({disabled:a,next:e=>c.current&&C(d.current,e.name,i)&&O(e,l.current,r._updateFormState)&&u({...r._formState,...e}),subject:r._subjects.state}),n.useEffect((()=>(c.current=!0,l.current.isValid&&r._updateValid(!0),()=>{c.current=!1})),[r]),S(o,r,l.current,!1)}({control:s,name:r}),p=n.useRef(s.register(r,{...e.rules,value:u,...y(e.disabled)?{disabled:e.disabled}:{}}));return n.useEffect((()=>{const e=s._options.shouldUnregister||i,t=(e,t)=>{const r=m(s._fields,e);r&&(r._f.mount=t)};if(t(r,!0),e){const e=f(m(s._options.defaultValues,r));N(s._defaultValues,r,e),h(m(s._formValues,r))&&N(s._formValues,r,e)}return()=>{(o?e&&!s._state.action:e)?s.unregister(r):t(r,!1)}}),[r,s,o,i]),n.useEffect((()=>{m(s._fields,r)&&s._updateDisabledField({disabled:a,fields:s._fields,name:r,value:m(s._fields,r)._f.value})}),[a,r,s]),{field:{name:r,value:u,...y(a)||d.disabled?{disabled:d.disabled||a}:{},onChange:n.useCallback((e=>p.current.onChange({target:{value:c(e),name:r},type:"change"})),[r]),onBlur:n.useCallback((()=>p.current.onBlur({target:{value:m(s._formValues,r),name:r},type:v})),[r,s]),ref:e=>{const t=m(s._fields,r);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}},formState:d,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!m(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!m(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!m(d.touchedFields,r)},error:{enumerable:!0,get:()=>m(d.errors,r)}})}}const I=e=>e.render(D(e));var L=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},F=e=>({isOnSubmit:!e||e===_,isOnBlur:"onBlur"===e,isOnChange:e===g,isOnAll:e===b,isOnTouch:"onTouched"===e}),H=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))));const z=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=m(e,a);if(r){const{_f:e,...s}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],a)&&!n)break;if(e.ref&&t(e.ref,e.name)&&!n)break;z(s,t)}else u(s)&&z(s,t)}}};var U=(e,t,r)=>{const n=p(m(e,r));return N(n,"root",t[r]),N(e,r,n),e},B=e=>"file"===e.type,$=e=>"function"==typeof e,W=e=>{if(!d)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},q=e=>j(e),K=e=>"radio"===e.type,G=e=>e instanceof RegExp;const J={value:!1,isValid:!1},Y={value:!0,isValid:!0};var X=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!h(e[0].attributes.value)?h(e[0].value)||""===e[0].value?Y:{value:e[0].value,isValid:!0}:Y:J}return J};const Q={isValid:!1,value:null};var ee=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),Q):Q;function te(e,t,r="validate"){if(q(e)||Array.isArray(e)&&e.every(q)||y(e)&&!e)return{type:r,message:q(e)?e:"",ref:t}}var re=e=>u(e)&&!G(e)?e:{value:e,message:""},ne=async(e,t,r,n,s)=>{const{ref:o,refs:c,required:l,maxLength:d,minLength:f,min:p,max:v,pattern:g,validate:_,name:b,valueAsNumber:k,mount:A,disabled:E}=e._f,S=m(t,b);if(!A||E)return{};const O=c?c[0]:o,Z=e=>{n&&O.reportValidity&&(O.setCustomValidity(y(e)?"":e||""),O.reportValidity())},C={},V=K(o),P=a(o),R=V||P,M=(k||B(o))&&h(o.value)&&h(S)||W(o)&&""===o.value||""===S||Array.isArray(S)&&!S.length,N=L.bind(null,b,r,C),D=(e,t,r,n="maxLength",a="minLength")=>{const s=e?t:r;C[b]={type:e?n:a,message:s,ref:o,...N(e?n:a,s)}};if(s?!Array.isArray(S)||!S.length:l&&(!R&&(M||i(S))||y(S)&&!S||P&&!X(c).isValid||V&&!ee(c).isValid)){const{value:e,message:t}=q(l)?{value:!!l,message:l}:re(l);if(e&&(C[b]={type:x,message:t,ref:O,...N(x,t)},!r))return Z(t),C}if(!(M||i(p)&&i(v))){let e,t;const n=re(v),a=re(p);if(i(S)||isNaN(S)){const r=o.valueAsDate||new Date(S),s=e=>new Date((new Date).toDateString()+" "+e),i="time"==o.type,u="week"==o.type;j(n.value)&&S&&(e=i?s(S)>s(n.value):u?S>n.value:r>new Date(n.value)),j(a.value)&&S&&(t=i?s(S)<s(a.value):u?S<a.value:r<new Date(a.value))}else{const r=o.valueAsNumber||(S?+S:S);i(n.value)||(e=r>n.value),i(a.value)||(t=r<a.value)}if((e||t)&&(D(!!e,n.message,a.message,"max","min"),!r))return Z(C[b].message),C}if((d||f)&&!M&&(j(S)||s&&Array.isArray(S))){const e=re(d),t=re(f),n=!i(e.value)&&S.length>+e.value,a=!i(t.value)&&S.length<+t.value;if((n||a)&&(D(n,e.message,t.message),!r))return Z(C[b].message),C}if(g&&!M&&j(S)){const{value:e,message:t}=re(g);if(G(e)&&!S.match(e)&&(C[b]={type:w,message:t,ref:o,...N(w,t)},!r))return Z(t),C}if(_)if($(_)){const e=te(await _(S,t),O);if(e&&(C[b]={...e,...N("validate",e.message)},!r))return Z(e.message),C}else if(u(_)){let e={};for(const n in _){if(!T(e)&&!r)break;const a=te(await _[n](S,t),O,n);a&&(e={...a,...N(n,a.message)},Z(a.message),r&&(C[b]=e))}if(!T(e)&&(C[b]={ref:O,...e},!r))return C}return Z(!0),C};function ae(e,t){const r=Array.isArray(t)?t:R(t)?[t]:M(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=h(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,s=r[a];return n&&delete n[s],0!==a&&(u(n)&&T(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!h(e[t]))return!1;return!0}(n))&&ae(e,r.slice(0,-1)),e}var se=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}},ie=e=>i(e)||!o(e);function oe(e,t){if(ie(e)||ie(t))return e===t;if(s(e)&&s(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const a of r){const r=e[a];if(!n.includes(a))return!1;if("ref"!==a){const e=t[a];if(s(r)&&s(e)||u(r)&&u(e)||Array.isArray(r)&&Array.isArray(e)?!oe(r,e):r!==e)return!1}}return!0}var ue=e=>"select-multiple"===e.type,ce=e=>W(e)&&e.isConnected,le=e=>{for(const t in e)if($(e[t]))return!0;return!1};function de(e,t={}){const r=Array.isArray(e);if(u(e)||r)for(const r in e)Array.isArray(e[r])||u(e[r])&&!le(e[r])?(t[r]=Array.isArray(e[r])?[]:{},de(e[r],t[r])):i(e[r])||(t[r]=!0);return t}function fe(e,t,r){const n=Array.isArray(e);if(u(e)||n)for(const n in e)Array.isArray(e[n])||u(e[n])&&!le(e[n])?h(t)||ie(r[n])?r[n]=Array.isArray(e[n])?de(e[n],[]):{...de(e[n])}:fe(e[n],i(t)?{}:t[n],r[n]):r[n]=!oe(e[n],t[n]);return r}var pe=(e,t)=>fe(e,t,de(t)),he=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>h(e)?e:t?""===e?NaN:e?+e:e:r&&j(e)?new Date(e):n?n(e):e;function me(e){const t=e.ref;if(!(e.refs?e.refs.every((e=>e.disabled)):t.disabled))return B(t)?t.files:K(t)?ee(e.refs).value:ue(t)?[...t.selectedOptions].map((({value:e})=>e)):a(t)?X(e.refs).value:he(h(t.value)?e.ref.value:t.value,e)}var ye=e=>h(e)?e:G(e)?e.source:u(e)?G(e.value)?e.value.source:e.value:e;function ve(e,t,r){const n=m(e,r);if(n||R(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),s=m(t,n),i=m(e,n);if(s&&!Array.isArray(s)&&r!==n)return{name:r};if(i&&i.type)return{name:n,error:i};a.pop()}return{name:r}}const ge={mode:_,reValidateMode:g,shouldFocusError:!0};function _e(e={},t){let r,n={...ge,...e},o={submitCount:0,isDirty:!1,isLoading:$(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:n.errors||{},disabled:n.disabled||!1},g={},_=(u(n.defaultValues)||u(n.values))&&f(n.defaultValues||n.values)||{},w=n.shouldUnregister?{}:f(_),x={action:!1,mount:!1,watch:!1},k={mount:new Set,unMount:new Set,array:new Set,watch:new Set},A=0;const E={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},S={values:se(),array:se(),state:se()},O=F(n.mode),C=F(n.reValidateMode),V=n.criteriaMode===b,R=async e=>{if(E.isValid||e){const e=n.resolver?T((await L()).errors):await q(g,!0);e!==o.isValid&&S.state.next({isValid:e})}},M=e=>E.isValidating&&S.state.next({isValidating:e}),D=(e,t,r,n)=>{const a=m(g,e);if(a){const s=m(w,e,h(r)?m(_,e):r);h(s)||n&&n.defaultChecked||t?N(w,e,t?s:me(a._f)):Y(e,s),x.mount&&R()}},I=(e,t,r,n,a)=>{let s=!1,i=!1;const u={name:e},c=!(!m(g,e)||!m(g,e)._f.disabled);if(!r||n){E.isDirty&&(i=o.isDirty,o.isDirty=u.isDirty=G(),s=i!==u.isDirty);const r=c||oe(m(_,e),t);i=!(c||!m(o.dirtyFields,e)),r||c?ae(o.dirtyFields,e):N(o.dirtyFields,e,!0),u.dirtyFields=o.dirtyFields,s=s||E.dirtyFields&&i!==!r}if(r){const t=m(o.touchedFields,e);t||(N(o.touchedFields,e,r),u.touchedFields=o.touchedFields,s=s||E.touchedFields&&t!==r)}return s&&a&&S.state.next(u),s?u:{}},L=async e=>n.resolver(w,n.context,((e,t,r,n)=>{const a={};for(const r of e){const e=m(t,r);e&&N(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}})(e||k.mount,g,n.criteriaMode,n.shouldUseNativeValidation)),q=async(e,t,r={valid:!0})=>{for(const a in e){const s=e[a];if(s){const{_f:e,...a}=s;if(e){const a=k.array.has(e.name),i=await ne(s,w,V,n.shouldUseNativeValidation&&!t,a);if(i[e.name]&&(r.valid=!1,t))break;!t&&(m(i,e.name)?a?U(o.errors,i,e.name):N(o.errors,e.name,i[e.name]):ae(o.errors,e.name))}a&&await q(a,t,r)}}return r.valid},G=(e,t)=>(e&&t&&N(w,e,t),!oe(le(),_)),J=(e,t,r)=>P(e,k,{...x.mount?w:h(t)?_:j(e)?{[e]:t}:t},r,t),Y=(e,t,r={})=>{const n=m(g,e);let s=t;if(n){const r=n._f;r&&(!r.disabled&&N(w,e,he(t,r)),s=W(r.ref)&&i(t)?"":t,ue(r.ref)?[...r.ref.options].forEach((e=>e.selected=s.includes(e.value))):r.refs?a(r.ref)?r.refs.length>1?r.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(s)?!!s.find((t=>t===e.value)):s===e.value))):r.refs[0]&&(r.refs[0].checked=!!s):r.refs.forEach((e=>e.checked=e.value===s)):B(r.ref)?r.ref.value="":(r.ref.value=s,r.ref.type||S.values.next({name:e,values:{...w}})))}(r.shouldDirty||r.shouldTouch)&&I(e,s,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&re(e)},X=(e,t,r)=>{for(const n in t){const a=t[n],i=`${e}.${n}`,o=m(g,i);!k.array.has(e)&&ie(a)&&(!o||o._f)||s(a)?Y(i,a,r):X(i,a,r)}},Q=(e,r,n={})=>{const a=m(g,e),s=k.array.has(e),u=f(r);N(w,e,u),s?(S.array.next({name:e,values:{...w}}),(E.isDirty||E.dirtyFields)&&n.shouldDirty&&S.state.next({name:e,dirtyFields:pe(_,w),isDirty:G(e,u)})):!a||a._f||i(u)?Y(e,u,n):X(e,u,n),H(e,k)&&S.state.next({...o}),S.values.next({name:e,values:{...w}}),!x.mount&&t()},ee=async t=>{const a=t.target;let s=a.name,i=!0;const u=m(g,s),l=e=>{i=Number.isNaN(e)||e===m(w,s,e)};if(u){let f,p;const h=a.type?me(u._f):c(t),_=t.type===v||"focusout"===t.type,b=!((d=u._f).mount&&(d.required||d.min||d.max||d.maxLength||d.minLength||d.pattern||d.validate)||n.resolver||m(o.errors,s)||u._f.deps)||((e,t,r,n,a)=>!a.isOnAll&&(!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:!(r?n.isOnChange:a.isOnChange)||e))(_,m(o.touchedFields,s),o.isSubmitted,C,O),x=H(s,k,_);N(w,s,h),_?(u._f.onBlur&&u._f.onBlur(t),r&&r(0)):u._f.onChange&&u._f.onChange(t);const Z=I(s,h,_,!1),j=!T(Z)||x;if(!_&&S.values.next({name:s,type:t.type,values:{...w}}),b)return E.isValid&&R(),j&&S.state.next({name:s,...x?{}:Z});if(!_&&x&&S.state.next({...o}),M(!0),n.resolver){const{errors:e}=await L([s]);if(l(h),i){const t=ve(o.errors,g,s),r=ve(e,g,t.name||s);f=r.error,s=r.name,p=T(e)}}else f=(await ne(u,w,V,n.shouldUseNativeValidation))[s],l(h),i&&(f?p=!1:E.isValid&&(p=await q(g,!0)));i&&(u._f.deps&&re(u._f.deps),((t,n,a,s)=>{const i=m(o.errors,t),u=E.isValid&&y(n)&&o.isValid!==n;var c;if(e.delayError&&a?(c=()=>((e,t)=>{N(o.errors,e,t),S.state.next({errors:o.errors})})(t,a),r=e=>{clearTimeout(A),A=setTimeout(c,e)},r(e.delayError)):(clearTimeout(A),r=null,a?N(o.errors,t,a):ae(o.errors,t)),(a?!oe(i,a):i)||!T(s)||u){const e={...s,...u&&y(n)?{isValid:n}:{},errors:o.errors,name:t};o={...o,...e},S.state.next(e)}M(!1)})(s,p,f,Z))}var d},te=(e,t)=>{if(m(o.errors,t)&&e.focus)return e.focus(),1},re=async(e,t={})=>{let r,a;const s=Z(e);if(M(!0),n.resolver){const t=await(async e=>{const{errors:t}=await L(e);if(e)for(const r of e){const e=m(t,r);e?N(o.errors,r,e):ae(o.errors,r)}else o.errors=t;return t})(h(e)?e:s);r=T(t),a=e?!s.some((e=>m(t,e))):r}else e?(a=(await Promise.all(s.map((async e=>{const t=m(g,e);return await q(t&&t._f?{[e]:t}:t)})))).every(Boolean),(a||o.isValid)&&R()):a=r=await q(g);return S.state.next({...!j(e)||E.isValid&&r!==o.isValid?{}:{name:e},...n.resolver||!e?{isValid:r}:{},errors:o.errors,isValidating:!1}),t.shouldFocus&&!a&&z(g,te,e?s:k.mount),a},le=e=>{const t={..._,...x.mount?w:{}};return h(e)?t:j(e)?m(t,e):e.map((e=>m(t,e)))},de=(e,t)=>({invalid:!!m((t||o).errors,e),isDirty:!!m((t||o).dirtyFields,e),isTouched:!!m((t||o).touchedFields,e),error:m((t||o).errors,e)}),fe=(e,t,r)=>{const n=(m(g,e,{_f:{}})._f||{}).ref;N(o.errors,e,{...t,ref:n}),S.state.next({name:e,errors:o.errors,isValid:!1}),r&&r.shouldFocus&&n&&n.focus&&n.focus()},_e=(e,t={})=>{for(const r of e?Z(e):k.mount)k.mount.delete(r),k.array.delete(r),t.keepValue||(ae(g,r),ae(w,r)),!t.keepError&&ae(o.errors,r),!t.keepDirty&&ae(o.dirtyFields,r),!t.keepTouched&&ae(o.touchedFields,r),!n.shouldUnregister&&!t.keepDefaultValue&&ae(_,r);S.values.next({values:{...w}}),S.state.next({...o,...t.keepDirty?{isDirty:G()}:{}}),!t.keepIsValid&&R()},be=({disabled:e,name:t,field:r,fields:n,value:a})=>{if(y(e)){const s=e?void 0:h(a)?me(r?r._f:m(n,t)._f):a;N(w,t,s),I(t,s,!1,!1,!0)}},we=(e,t={})=>{let r=m(g,e);const s=y(t.disabled);return N(g,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),k.mount.add(e),r?be({field:r,disabled:t.disabled,name:e,value:t.value}):D(e,!0,t.value),{...s?{disabled:t.disabled}:{},...n.progressive?{required:!!t.required,min:ye(t.min),max:ye(t.max),minLength:ye(t.minLength),maxLength:ye(t.maxLength),pattern:ye(t.pattern)}:{},name:e,onChange:ee,onBlur:ee,ref:s=>{if(s){we(e,t),r=m(g,e);const n=h(s.value)&&s.querySelectorAll&&s.querySelectorAll("input,select,textarea")[0]||s,i=(e=>K(e)||a(e))(n),o=r._f.refs||[];if(i?o.find((e=>e===n)):n===r._f.ref)return;N(g,e,{_f:{...r._f,...i?{refs:[...o.filter(ce),n,...Array.isArray(m(_,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),D(e,!1,void 0,n)}else r=m(g,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!l(k.array,e)||!x.action)&&k.unMount.add(e)}}},xe=()=>n.shouldFocusError&&z(g,te,k.mount),ke=(e,t)=>async r=>{r&&(r.preventDefault&&r.preventDefault(),r.persist&&r.persist());let a=f(w);if(S.state.next({isSubmitting:!0}),n.resolver){const{errors:e,values:t}=await L();o.errors=e,a=t}else await q(g);ae(o.errors,"root"),T(o.errors)?(S.state.next({errors:{}}),await e(a,r)):(t&&await t({...o.errors},r),xe(),setTimeout(xe)),S.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:T(o.errors),submitCount:o.submitCount+1,errors:o.errors})},Ae=(r,n={})=>{const a=r?f(r):_,s=f(a),i=r&&!T(r)?s:_;if(n.keepDefaultValues||(_=a),!n.keepValues){if(n.keepDirtyValues)for(const e of k.mount)m(o.dirtyFields,e)?N(i,e,m(w,e)):Q(e,m(i,e));else{if(d&&h(r))for(const e of k.mount){const t=m(g,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(W(e)){const t=e.closest("form");if(t){t.reset();break}}}}g={}}w=e.shouldUnregister?n.keepDefaultValues?f(_):{}:f(i),S.array.next({values:{...i}}),S.values.next({values:{...i}})}k={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!x.mount&&t(),x.mount=!E.isValid||!!n.keepIsValid,x.watch=!!e.shouldUnregister,S.state.next({submitCount:n.keepSubmitCount?o.submitCount:0,isDirty:n.keepDirty?o.isDirty:!(!n.keepDefaultValues||oe(r,_)),isSubmitted:!!n.keepIsSubmitted&&o.isSubmitted,dirtyFields:n.keepDirtyValues?o.dirtyFields:n.keepDefaultValues&&r?pe(_,r):{},touchedFields:n.keepTouched?o.touchedFields:{},errors:n.keepErrors?o.errors:{},isSubmitSuccessful:!!n.keepIsSubmitSuccessful&&o.isSubmitSuccessful,isSubmitting:!1})},Ee=(e,t)=>Ae($(e)?e(w):e,t);return{control:{register:we,unregister:_e,getFieldState:de,handleSubmit:ke,setError:fe,_executeSchema:L,_getWatch:J,_getDirty:G,_updateValid:R,_removeUnmounted:()=>{for(const e of k.unMount){const t=m(g,e);t&&(t._f.refs?t._f.refs.every((e=>!ce(e))):!ce(t._f.ref))&&_e(e)}k.unMount=new Set},_updateFieldArray:(e,t=[],r,n,a=!0,s=!0)=>{if(n&&r){if(x.action=!0,s&&Array.isArray(m(g,e))){const t=r(m(g,e),n.argA,n.argB);a&&N(g,e,t)}if(s&&Array.isArray(m(o.errors,e))){const t=r(m(o.errors,e),n.argA,n.argB);a&&N(o.errors,e,t),((e,t)=>{!p(m(e,t)).length&&ae(e,t)})(o.errors,e)}if(E.touchedFields&&s&&Array.isArray(m(o.touchedFields,e))){const t=r(m(o.touchedFields,e),n.argA,n.argB);a&&N(o.touchedFields,e,t)}E.dirtyFields&&(o.dirtyFields=pe(_,w)),S.state.next({name:e,isDirty:G(e,t),dirtyFields:o.dirtyFields,errors:o.errors,isValid:o.isValid})}else N(w,e,t)},_updateDisabledField:be,_getFieldArray:t=>p(m(x.mount?w:_,t,e.shouldUnregister?m(_,t,[]):[])),_reset:Ae,_resetDefaultValues:()=>$(n.defaultValues)&&n.defaultValues().then((e=>{Ee(e,n.resetOptions),S.state.next({isLoading:!1})})),_updateFormState:e=>{o={...o,...e}},_disableForm:e=>{y(e)&&(S.state.next({disabled:e}),z(g,((t,r)=>{let n=e;const a=m(g,r);a&&y(a._f.disabled)&&(n||(n=a._f.disabled)),t.disabled=n}),0,!1))},_subjects:S,_proxyFormState:E,_setErrors:e=>{o.errors=e,S.state.next({errors:o.errors,isValid:!1})},get _fields(){return g},get _formValues(){return w},get _state(){return x},set _state(e){x=e},get _defaultValues(){return _},get _names(){return k},set _names(e){k=e},get _formState(){return o},set _formState(e){o=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:re,register:we,handleSubmit:ke,watch:(e,t)=>$(e)?S.values.subscribe({next:r=>e(J(void 0,t),r)}):J(e,t,!0),setValue:Q,getValues:le,reset:Ee,resetField:(e,t={})=>{m(g,e)&&(h(t.defaultValue)?Q(e,f(m(_,e))):(Q(e,t.defaultValue),N(_,e,f(t.defaultValue))),t.keepTouched||ae(o.touchedFields,e),t.keepDirty||(ae(o.dirtyFields,e),o.isDirty=t.defaultValue?G(e,f(m(_,e))):G()),t.keepError||(ae(o.errors,e),E.isValid&&R()),S.state.next({...o}))},clearErrors:e=>{e&&Z(e).forEach((e=>ae(o.errors,e))),S.state.next({errors:e?o.errors:{}})},unregister:_e,setError:fe,setFocus:(e,t={})=>{const r=m(g,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:de}}function be(e={}){const t=n.useRef(),r=n.useRef(),[a,s]=n.useState({isDirty:!1,isValidating:!1,isLoading:$(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:$(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={..._e(e,(()=>s((e=>({...e}))))),formState:a});const i=t.current.control;return i._options=e,V({subject:i._subjects.state,next:e=>{O(e,i._proxyFormState,i._updateFormState,!0)&&s({...i._formState})}}),n.useEffect((()=>i._disableForm(e.disabled)),[i,e.disabled]),n.useEffect((()=>{if(i._proxyFormState.isDirty){const e=i._getDirty();e!==a.isDirty&&i._subjects.state.next({isDirty:e})}}),[i,a.isDirty]),n.useEffect((()=>{e.values&&!oe(e.values,r.current)?(i._reset(e.values,i._options.resetOptions),r.current=e.values,s((e=>({...e})))):i._resetDefaultValues()}),[e.values,i]),n.useEffect((()=>{e.errors&&i._setErrors(e.errors)}),[e.errors,i]),n.useEffect((()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()})),t.current.formState=S(a,i),t.current}},14476(e,t,r){"use strict";var n,a;r.d(t,{z:()=>ut}),function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(n||(n={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(a||(a={}));const s=n.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),i=e=>{switch(typeof e){case"undefined":return s.undefined;case"string":return s.string;case"number":return isNaN(e)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":return Array.isArray(e)?s.array:null===e?s.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?s.promise:"undefined"!=typeof Map&&e instanceof Map?s.map:"undefined"!=typeof Set&&e instanceof Set?s.set:"undefined"!=typeof Date&&e instanceof Date?s.date:s.object;default:return s.unknown}},o=n.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class u extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(n);else if("invalid_return_type"===a.code)n(a.returnTypeError);else if("invalid_arguments"===a.code)n(a.argumentsError);else if(0===a.path.length)r._errors.push(t(a));else{let e=r,n=0;for(;n<a.path.length;){const r=a.path[n];n===a.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(a))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,n.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}u.create=e=>new u(e);const c=(e,t)=>{let r;switch(e.code){case o.invalid_type:r=e.received===s.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case o.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,n.jsonStringifyReplacer)}`;break;case o.unrecognized_keys:r=`Unrecognized key(s) in object: ${n.joinValues(e.keys,", ")}`;break;case o.invalid_union:r="Invalid input";break;case o.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${n.joinValues(e.options)}`;break;case o.invalid_enum_value:r=`Invalid enum value. Expected ${n.joinValues(e.options)}, received '${e.received}'`;break;case o.invalid_arguments:r="Invalid function arguments";break;case o.invalid_return_type:r="Invalid function return type";break;case o.invalid_date:r="Invalid date";break;case o.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:n.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case o.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case o.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case o.custom:r="Invalid input";break;case o.invalid_intersection_types:r="Intersection results could not be merged";break;case o.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case o.not_finite:r="Number must be finite";break;default:r=t.defaultError,n.assertNever(e)}return{message:r}};let l=c;function d(){return l}const f=e=>{const{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],i={...a,path:s};let o="";const u=n.filter((e=>!!e)).slice().reverse();for(const e of u)o=e(i,{data:t,defaultError:o}).message;return{...a,path:s,message:a.message||o}};function p(e,t){const r=f({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,d(),c].filter((e=>!!e))});e.common.issues.push(r)}class h{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return m;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t)r.push({key:await e.key,value:await e.value});return h.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:a}=n;if("aborted"===t.status)return m;if("aborted"===a.status)return m;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!n.alwaysSet||(r[t.value]=a.value)}return{status:e.value,value:r}}}const m=Object.freeze({status:"aborted"}),y=e=>({status:"dirty",value:e}),v=e=>({status:"valid",value:e}),g=e=>"aborted"===e.status,_=e=>"dirty"===e.status,b=e=>"valid"===e.status,w=e=>"undefined"!=typeof Promise&&e instanceof Promise;var x;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(x||(x={}));class k{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const A=(e,t)=>{if(b(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new u(e.common.issues);return this._error=t,this._error}}};function E(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:a}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=r?r:t.defaultError},description:a}}class S{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return i(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new h,ctx:{common:e.parent.common,data:e.data,parsedType:i(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(w(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},a=this._parseSync({data:e,path:n.path,parent:n});return A(n,a)}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:i(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(w(n)?n:Promise.resolve(n));return A(r,a)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const a=e(t),s=()=>n.addIssue({code:o.custom,...r(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(s(),!1))):!!a||(s(),!1)}))}refinement(e,t){return this._refinement(((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1)))}_refinement(e){return new pe({schema:this,typeName:Ee.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return he.create(this,this._def)}nullable(){return me.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return K.create(this,this._def)}promise(){return fe.create(this,this._def)}or(e){return Y.create([this,e],this._def)}and(e){return te.create(this,e,this._def)}transform(e){return new pe({...E(this._def),schema:this,typeName:Ee.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ye({...E(this._def),innerType:this,defaultValue:t,typeName:Ee.ZodDefault})}brand(){return new be({typeName:Ee.ZodBranded,type:this,...E(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ve({...E(this._def),innerType:this,catchValue:t,typeName:Ee.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return we.create(this,e)}readonly(){return xe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const T=/^c[^\s-]{8,}$/i,O=/^[a-z][a-z0-9]*$/,Z=/^[0-9A-HJKMNP-TV-Z]{26}$/,C=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,V=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let j;const P=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,R=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;class M extends S{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==s.string){const t=this._getOrReturnCtx(e);return p(t,{code:o.invalid_type,expected:s.string,received:t.parsedType}),m}const t=new h;let r;for(const s of this._def.checks)if("min"===s.kind)e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),p(r,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("max"===s.kind)e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),p(r,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("length"===s.kind){const n=e.data.length>s.value,a=e.data.length<s.value;(n||a)&&(r=this._getOrReturnCtx(e,r),n?p(r,{code:o.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&p(r,{code:o.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),t.dirty())}else if("email"===s.kind)V.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"email",code:o.invalid_string,message:s.message}),t.dirty());else if("emoji"===s.kind)j||(j=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),j.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"emoji",code:o.invalid_string,message:s.message}),t.dirty());else if("uuid"===s.kind)C.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"uuid",code:o.invalid_string,message:s.message}),t.dirty());else if("cuid"===s.kind)T.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"cuid",code:o.invalid_string,message:s.message}),t.dirty());else if("cuid2"===s.kind)O.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"cuid2",code:o.invalid_string,message:s.message}),t.dirty());else if("ulid"===s.kind)Z.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"ulid",code:o.invalid_string,message:s.message}),t.dirty());else if("url"===s.kind)try{new URL(e.data)}catch(n){r=this._getOrReturnCtx(e,r),p(r,{validation:"url",code:o.invalid_string,message:s.message}),t.dirty()}else"regex"===s.kind?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{validation:"regex",code:o.invalid_string,message:s.message}),t.dirty())):"trim"===s.kind?e.data=e.data.trim():"includes"===s.kind?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),p(r,{code:o.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),t.dirty()):"toLowerCase"===s.kind?e.data=e.data.toLowerCase():"toUpperCase"===s.kind?e.data=e.data.toUpperCase():"startsWith"===s.kind?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),p(r,{code:o.invalid_string,validation:{startsWith:s.value},message:s.message}),t.dirty()):"endsWith"===s.kind?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),p(r,{code:o.invalid_string,validation:{endsWith:s.value},message:s.message}),t.dirty()):"datetime"===s.kind?((u=s).precision?u.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${u.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${u.precision}}Z$`):0===u.precision?u.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):u.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:o.invalid_string,validation:"datetime",message:s.message}),t.dirty()):"ip"===s.kind?(a=e.data,("v4"!==(i=s.version)&&i||!P.test(a))&&("v6"!==i&&i||!R.test(a))&&(r=this._getOrReturnCtx(e,r),p(r,{validation:"ip",code:o.invalid_string,message:s.message}),t.dirty())):n.assertNever(s);var a,i,u;return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement((t=>e.test(t)),{validation:t,code:o.invalid_string,...x.errToObj(r)})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...x.errToObj(e)})}url(e){return this._addCheck({kind:"url",...x.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...x.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...x.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...x.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...x.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...x.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...x.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,...x.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...x.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...x.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...x.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...x.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...x.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...x.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...x.errToObj(t)})}nonempty(e){return this.min(1,x.errToObj(e))}trim(){return new M({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new M({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new M({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function N(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}M.create=e=>{var t;return new M({checks:[],typeName:Ee.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...E(e)})};class D extends S{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==s.number){const t=this._getOrReturnCtx(e);return p(t,{code:o.invalid_type,expected:s.number,received:t.parsedType}),m}let t;const r=new h;for(const a of this._def.checks)"int"===a.kind?n.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),p(t,{code:o.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),p(t,{code:o.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),p(t,{code:o.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):"multipleOf"===a.kind?0!==N(e.data,a.value)&&(t=this._getOrReturnCtx(e,t),p(t,{code:o.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):"finite"===a.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),p(t,{code:o.not_finite,message:a.message}),r.dirty()):n.assertNever(a);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,x.toString(t))}gt(e,t){return this.setLimit("min",e,!1,x.toString(t))}lte(e,t){return this.setLimit("max",e,!0,x.toString(t))}lt(e,t){return this.setLimit("max",e,!1,x.toString(t))}setLimit(e,t,r,n){return new D({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:x.toString(n)}]})}_addCheck(e){return new D({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:x.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:x.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:x.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:x.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:x.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:x.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:x.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:x.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:x.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&n.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}D.create=e=>new D({checks:[],typeName:Ee.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...E(e)});class I extends S{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==s.bigint){const t=this._getOrReturnCtx(e);return p(t,{code:o.invalid_type,expected:s.bigint,received:t.parsedType}),m}let t;const r=new h;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),p(t,{code:o.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),p(t,{code:o.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),p(t,{code:o.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):n.assertNever(a);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,x.toString(t))}gt(e,t){return this.setLimit("min",e,!1,x.toString(t))}lte(e,t){return this.setLimit("max",e,!0,x.toString(t))}lt(e,t){return this.setLimit("max",e,!1,x.toString(t))}setLimit(e,t,r,n){return new I({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:x.toString(n)}]})}_addCheck(e){return new I({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:x.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:x.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:x.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:x.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:x.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}I.create=e=>{var t;return new I({checks:[],typeName:Ee.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...E(e)})};class L extends S{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==s.boolean){const t=this._getOrReturnCtx(e);return p(t,{code:o.invalid_type,expected:s.boolean,received:t.parsedType}),m}return v(e.data)}}L.create=e=>new L({typeName:Ee.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...E(e)});class F extends S{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==s.date){const t=this._getOrReturnCtx(e);return p(t,{code:o.invalid_type,expected:s.date,received:t.parsedType}),m}if(isNaN(e.data.getTime()))return p(this._getOrReturnCtx(e),{code:o.invalid_date}),m;const t=new h;let r;for(const a of this._def.checks)"min"===a.kind?e.data.getTime()<a.value&&(r=this._getOrReturnCtx(e,r),p(r,{code:o.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),t.dirty()):"max"===a.kind?e.data.getTime()>a.value&&(r=this._getOrReturnCtx(e,r),p(r,{code:o.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),t.dirty()):n.assertNever(a);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new F({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:x.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:x.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}F.create=e=>new F({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ee.ZodDate,...E(e)});class H extends S{_parse(e){if(this._getType(e)!==s.symbol){const t=this._getOrReturnCtx(e);return p(t,{code:o.invalid_type,expected:s.symbol,received:t.parsedType}),m}return v(e.data)}}H.create=e=>new H({typeName:Ee.ZodSymbol,...E(e)});class z extends S{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return p(t,{code:o.invalid_type,expected:s.undefined,received:t.parsedType}),m}return v(e.data)}}z.create=e=>new z({typeName:Ee.ZodUndefined,...E(e)});class U extends S{_parse(e){if(this._getType(e)!==s.null){const t=this._getOrReturnCtx(e);return p(t,{code:o.invalid_type,expected:s.null,received:t.parsedType}),m}return v(e.data)}}U.create=e=>new U({typeName:Ee.ZodNull,...E(e)});class B extends S{constructor(){super(...arguments),this._any=!0}_parse(e){return v(e.data)}}B.create=e=>new B({typeName:Ee.ZodAny,...E(e)});class $ extends S{constructor(){super(...arguments),this._unknown=!0}_parse(e){return v(e.data)}}$.create=e=>new $({typeName:Ee.ZodUnknown,...E(e)});class W extends S{_parse(e){const t=this._getOrReturnCtx(e);return p(t,{code:o.invalid_type,expected:s.never,received:t.parsedType}),m}}W.create=e=>new W({typeName:Ee.ZodNever,...E(e)});class q extends S{_parse(e){if(this._getType(e)!==s.undefined){const t=this._getOrReturnCtx(e);return p(t,{code:o.invalid_type,expected:s.void,received:t.parsedType}),m}return v(e.data)}}q.create=e=>new q({typeName:Ee.ZodVoid,...E(e)});class K extends S{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==s.array)return p(t,{code:o.invalid_type,expected:s.array,received:t.parsedType}),m;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,a=t.data.length<n.exactLength.value;(e||a)&&(p(t,{code:e?o.too_big:o.too_small,minimum:a?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(p(t,{code:o.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(p(t,{code:o.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>n.type._parseAsync(new k(t,e,t.path,r))))).then((e=>h.mergeArray(r,e)));const a=[...t.data].map(((e,r)=>n.type._parseSync(new k(t,e,t.path,r))));return h.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new K({...this._def,minLength:{value:e,message:x.toString(t)}})}max(e,t){return new K({...this._def,maxLength:{value:e,message:x.toString(t)}})}length(e,t){return new K({...this._def,exactLength:{value:e,message:x.toString(t)}})}nonempty(e){return this.min(1,e)}}function G(e){if(e instanceof J){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=he.create(G(n))}return new J({...e._def,shape:()=>t})}return e instanceof K?new K({...e._def,type:G(e.element)}):e instanceof he?he.create(G(e.unwrap())):e instanceof me?me.create(G(e.unwrap())):e instanceof re?re.create(e.items.map((e=>G(e)))):e}K.create=(e,t)=>new K({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ee.ZodArray,...E(t)});class J extends S{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=n.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==s.object){const t=this._getOrReturnCtx(e);return p(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),m}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof W&&"strip"===this._def.unknownKeys))for(const e in r.data)a.includes(e)||i.push(e);const u=[];for(const e of a){const t=n[e],a=r.data[e];u.push({key:{status:"valid",value:e},value:t._parse(new k(r,a,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof W){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)u.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)i.length>0&&(p(r,{code:o.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const n=r.data[t];u.push({key:{status:"valid",value:t},value:e._parse(new k(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of u){const r=await t.key;e.push({key:r,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>h.mergeObjectSync(t,e))):h.mergeObjectSync(t,u)}get shape(){return this._def.shape()}strict(e){return x.errToObj,new J({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,a,s,i;const o=null!==(s=null===(a=(n=this._def).errorMap)||void 0===a?void 0:a.call(n,t,r).message)&&void 0!==s?s:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=x.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new J({...this._def,unknownKeys:"strip"})}passthrough(){return new J({...this._def,unknownKeys:"passthrough"})}extend(e){return new J({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new J({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ee.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new J({...this._def,catchall:e})}pick(e){const t={};return n.objectKeys(e).forEach((r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])})),new J({...this._def,shape:()=>t})}omit(e){const t={};return n.objectKeys(this.shape).forEach((r=>{e[r]||(t[r]=this.shape[r])})),new J({...this._def,shape:()=>t})}deepPartial(){return G(this)}partial(e){const t={};return n.objectKeys(this.shape).forEach((r=>{const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()})),new J({...this._def,shape:()=>t})}required(e){const t={};return n.objectKeys(this.shape).forEach((r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof he;)e=e._def.innerType;t[r]=e}})),new J({...this._def,shape:()=>t})}keyof(){return ce(n.objectKeys(this.shape))}}J.create=(e,t)=>new J({shape:()=>e,unknownKeys:"strip",catchall:W.create(),typeName:Ee.ZodObject,...E(t)}),J.strictCreate=(e,t)=>new J({shape:()=>e,unknownKeys:"strict",catchall:W.create(),typeName:Ee.ZodObject,...E(t)}),J.lazycreate=(e,t)=>new J({shape:e,unknownKeys:"strip",catchall:W.create(),typeName:Ee.ZodObject,...E(t)});class Y extends S{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map((e=>new u(e.ctx.common.issues)));return p(t,{code:o.invalid_union,unionErrors:r}),m}));{let e;const n=[];for(const a of r){const r={...t,common:{...t.common,issues:[]},parent:null},s=a._parseSync({data:t.data,path:t.path,parent:r});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=n.map((e=>new u(e)));return p(t,{code:o.invalid_union,unionErrors:a}),m}}get options(){return this._def.options}}Y.create=(e,t)=>new Y({options:e,typeName:Ee.ZodUnion,...E(t)});const X=e=>e instanceof oe?X(e.schema):e instanceof pe?X(e.innerType()):e instanceof ue?[e.value]:e instanceof le?e.options:e instanceof de?Object.keys(e.enum):e instanceof ye?X(e._def.innerType):e instanceof z?[void 0]:e instanceof U?[null]:null;class Q extends S{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.object)return p(t,{code:o.invalid_type,expected:s.object,received:t.parsedType}),m;const r=this.discriminator,n=t.data[r],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(p(t,{code:o.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const r of t){const t=X(r.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of t){if(n.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,r)}}return new Q({typeName:Ee.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...E(r)})}}function ee(e,t){const r=i(e),a=i(t);if(e===t)return{valid:!0,data:e};if(r===s.object&&a===s.object){const r=n.objectKeys(t),a=n.objectKeys(e).filter((e=>-1!==r.indexOf(e))),s={...e,...t};for(const r of a){const n=ee(e[r],t[r]);if(!n.valid)return{valid:!1};s[r]=n.data}return{valid:!0,data:s}}if(r===s.array&&a===s.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const a=ee(e[n],t[n]);if(!a.valid)return{valid:!1};r.push(a.data)}return{valid:!0,data:r}}return r===s.date&&a===s.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class te extends S{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(g(e)||g(n))return m;const a=ee(e.value,n.value);return a.valid?((_(e)||_(n))&&t.dirty(),{status:t.value,value:a.data}):(p(r,{code:o.invalid_intersection_types}),m)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}te.create=(e,t,r)=>new te({left:e,right:t,typeName:Ee.ZodIntersection,...E(r)});class re extends S{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.array)return p(r,{code:o.invalid_type,expected:s.array,received:r.parsedType}),m;if(r.data.length<this._def.items.length)return p(r,{code:o.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m;!this._def.rest&&r.data.length>this._def.items.length&&(p(r,{code:o.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new k(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(n).then((e=>h.mergeArray(t,e))):h.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new re({...this._def,rest:e})}}re.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new re({items:e,typeName:Ee.ZodTuple,rest:null,...E(t)})};class ne extends S{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.object)return p(r,{code:o.invalid_type,expected:s.object,received:r.parsedType}),m;const n=[],a=this._def.keyType,i=this._def.valueType;for(const e in r.data)n.push({key:a._parse(new k(r,e,r.path,e)),value:i._parse(new k(r,r.data[e],r.path,e))});return r.common.async?h.mergeObjectAsync(t,n):h.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new ne(t instanceof S?{keyType:e,valueType:t,typeName:Ee.ZodRecord,...E(r)}:{keyType:M.create(),valueType:e,typeName:Ee.ZodRecord,...E(t)})}}class ae extends S{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.map)return p(r,{code:o.invalid_type,expected:s.map,received:r.parsedType}),m;const n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map((([e,t],s)=>({key:n._parse(new k(r,e,r.path,[s,"key"])),value:a._parse(new k(r,t,r.path,[s,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of i){const n=await r.key,a=await r.value;if("aborted"===n.status||"aborted"===a.status)return m;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of i){const n=r.key,a=r.value;if("aborted"===n.status||"aborted"===a.status)return m;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}}}ae.create=(e,t,r)=>new ae({valueType:t,keyType:e,typeName:Ee.ZodMap,...E(r)});class se extends S{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==s.set)return p(r,{code:o.invalid_type,expected:s.set,received:r.parsedType}),m;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(p(r,{code:o.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(p(r,{code:o.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(e){const r=new Set;for(const n of e){if("aborted"===n.status)return m;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const u=[...r.data.values()].map(((e,t)=>a._parse(new k(r,e,r.path,t))));return r.common.async?Promise.all(u).then((e=>i(e))):i(u)}min(e,t){return new se({...this._def,minSize:{value:e,message:x.toString(t)}})}max(e,t){return new se({...this._def,maxSize:{value:e,message:x.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}se.create=(e,t)=>new se({valueType:e,minSize:null,maxSize:null,typeName:Ee.ZodSet,...E(t)});class ie extends S{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.function)return p(t,{code:o.invalid_type,expected:s.function,received:t.parsedType}),m;function r(e,r){return f({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,d(),c].filter((e=>!!e)),issueData:{code:o.invalid_arguments,argumentsError:r}})}function n(e,r){return f({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,d(),c].filter((e=>!!e)),issueData:{code:o.invalid_return_type,returnTypeError:r}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof fe){const e=this;return v((async function(...t){const s=new u([]),o=await e._def.args.parseAsync(t,a).catch((e=>{throw s.addIssue(r(t,e)),s})),c=await Reflect.apply(i,this,o);return await e._def.returns._def.type.parseAsync(c,a).catch((e=>{throw s.addIssue(n(c,e)),s}))}))}{const e=this;return v((function(...t){const s=e._def.args.safeParse(t,a);if(!s.success)throw new u([r(t,s.error)]);const o=Reflect.apply(i,this,s.data),c=e._def.returns.safeParse(o,a);if(!c.success)throw new u([n(o,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ie({...this._def,args:re.create(e).rest($.create())})}returns(e){return new ie({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ie({args:e||re.create([]).rest($.create()),returns:t||$.create(),typeName:Ee.ZodFunction,...E(r)})}}class oe extends S{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}oe.create=(e,t)=>new oe({getter:e,typeName:Ee.ZodLazy,...E(t)});class ue extends S{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return p(t,{received:t.data,code:o.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ce(e,t){return new le({values:e,typeName:Ee.ZodEnum,...E(t)})}ue.create=(e,t)=>new ue({value:e,typeName:Ee.ZodLiteral,...E(t)});class le extends S{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return p(t,{expected:n.joinValues(r),received:t.parsedType,code:o.invalid_type}),m}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return p(t,{received:t.data,code:o.invalid_enum_value,options:r}),m}return v(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return le.create(e)}exclude(e){return le.create(this.options.filter((t=>!e.includes(t))))}}le.create=ce;class de extends S{_parse(e){const t=n.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==s.string&&r.parsedType!==s.number){const e=n.objectValues(t);return p(r,{expected:n.joinValues(e),received:r.parsedType,code:o.invalid_type}),m}if(-1===t.indexOf(e.data)){const e=n.objectValues(t);return p(r,{received:r.data,code:o.invalid_enum_value,options:e}),m}return v(e.data)}get enum(){return this._def.values}}de.create=(e,t)=>new de({values:e,typeName:Ee.ZodNativeEnum,...E(t)});class fe extends S{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==s.promise&&!1===t.common.async)return p(t,{code:o.invalid_type,expected:s.promise,received:t.parsedType}),m;const r=t.parsedType===s.promise?t.data:Promise.resolve(t.data);return v(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}fe.create=(e,t)=>new fe({type:e,typeName:Ee.ZodPromise,...E(t)});class pe extends S{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ee.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:e=>{p(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===a.type){const e=a.transform(r.data,s);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:r.path,parent:r}))):this._def.schema._parseSync({data:e,path:r.path,parent:r})}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,s);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?m:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((r=>"aborted"===r.status?m:("dirty"===r.status&&t.dirty(),e(r.value).then((()=>({status:t.value,value:r.value}))))))}if("transform"===a.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!b(e))return e;const n=a.transform(e.value,s);if(n instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:n}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e=>b(e)?Promise.resolve(a.transform(e.value,s)).then((e=>({status:t.value,value:e}))):e))}n.assertNever(a)}}pe.create=(e,t,r)=>new pe({schema:e,typeName:Ee.ZodEffects,effect:t,...E(r)}),pe.createWithPreprocess=(e,t,r)=>new pe({schema:t,effect:{type:"preprocess",transform:e},typeName:Ee.ZodEffects,...E(r)});class he extends S{_parse(e){return this._getType(e)===s.undefined?v(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}he.create=(e,t)=>new he({innerType:e,typeName:Ee.ZodOptional,...E(t)});class me extends S{_parse(e){return this._getType(e)===s.null?v(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}me.create=(e,t)=>new me({innerType:e,typeName:Ee.ZodNullable,...E(t)});class ye extends S{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===s.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ye.create=(e,t)=>new ye({innerType:e,typeName:Ee.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...E(t)});class ve extends S{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return w(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new u(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new u(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ve.create=(e,t)=>new ve({innerType:e,typeName:Ee.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...E(t)});class ge extends S{_parse(e){if(this._getType(e)!==s.nan){const t=this._getOrReturnCtx(e);return p(t,{code:o.invalid_type,expected:s.nan,received:t.parsedType}),m}return{status:"valid",value:e.data}}}ge.create=e=>new ge({typeName:Ee.ZodNaN,...E(e)});const _e=Symbol("zod_brand");class be extends S{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class we extends S{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?m:"dirty"===e.status?(t.dirty(),y(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?m:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new we({in:e,out:t,typeName:Ee.ZodPipeline})}}class xe extends S{_parse(e){const t=this._def.innerType._parse(e);return b(t)&&(t.value=Object.freeze(t.value)),t}}xe.create=(e,t)=>new xe({innerType:e,typeName:Ee.ZodReadonly,...E(t)});const ke=(e,t={},r)=>e?B.create().superRefine(((n,a)=>{var s,i;if(!e(n)){const e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:r)||void 0===i||i,u="string"==typeof e?{message:e}:e;a.addIssue({code:"custom",...u,fatal:o})}})):B.create(),Ae={object:J.lazycreate};var Ee;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Ee||(Ee={}));const Se=M.create,Te=D.create,Oe=ge.create,Ze=I.create,Ce=L.create,Ve=F.create,je=H.create,Pe=z.create,Re=U.create,Me=B.create,Ne=$.create,De=W.create,Ie=q.create,Le=K.create,Fe=J.create,He=J.strictCreate,ze=Y.create,Ue=Q.create,Be=te.create,$e=re.create,We=ne.create,qe=ae.create,Ke=se.create,Ge=ie.create,Je=oe.create,Ye=ue.create,Xe=le.create,Qe=de.create,et=fe.create,tt=pe.create,rt=he.create,nt=me.create,at=pe.createWithPreprocess,st=we.create,it={string:e=>M.create({...e,coerce:!0}),number:e=>D.create({...e,coerce:!0}),boolean:e=>L.create({...e,coerce:!0}),bigint:e=>I.create({...e,coerce:!0}),date:e=>F.create({...e,coerce:!0})},ot=m;var ut=Object.freeze({__proto__:null,defaultErrorMap:c,setErrorMap:function(e){l=e},getErrorMap:d,makeIssue:f,EMPTY_PATH:[],addIssueToContext:p,ParseStatus:h,INVALID:m,DIRTY:y,OK:v,isAborted:g,isDirty:_,isValid:b,isAsync:w,get util(){return n},get objectUtil(){return a},ZodParsedType:s,getParsedType:i,ZodType:S,ZodString:M,ZodNumber:D,ZodBigInt:I,ZodBoolean:L,ZodDate:F,ZodSymbol:H,ZodUndefined:z,ZodNull:U,ZodAny:B,ZodUnknown:$,ZodNever:W,ZodVoid:q,ZodArray:K,ZodObject:J,ZodUnion:Y,ZodDiscriminatedUnion:Q,ZodIntersection:te,ZodTuple:re,ZodRecord:ne,ZodMap:ae,ZodSet:se,ZodFunction:ie,ZodLazy:oe,ZodLiteral:ue,ZodEnum:le,ZodNativeEnum:de,ZodPromise:fe,ZodEffects:pe,ZodTransformer:pe,ZodOptional:he,ZodNullable:me,ZodDefault:ye,ZodCatch:ve,ZodNaN:ge,BRAND:_e,ZodBranded:be,ZodPipeline:we,ZodReadonly:xe,custom:ke,Schema:S,ZodSchema:S,late:Ae,get ZodFirstPartyTypeKind(){return Ee},coerce:it,any:Me,array:Le,bigint:Ze,boolean:Ce,date:Ve,discriminatedUnion:Ue,effect:tt,enum:Xe,function:Ge,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>ke((t=>t instanceof e),t),intersection:Be,lazy:Je,literal:Ye,map:qe,nan:Oe,nativeEnum:Qe,never:De,null:Re,nullable:nt,number:Te,object:Fe,oboolean:()=>Ce().optional(),onumber:()=>Te().optional(),optional:rt,ostring:()=>Se().optional(),pipeline:st,preprocess:at,promise:et,record:We,set:Ke,strictObject:He,string:Se,symbol:je,transformer:tt,tuple:$e,undefined:Pe,union:ze,unknown:Ne,void:Ie,NEVER:ot,ZodIssueCode:o,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:u})}}]);
|