inventree-manufacturing-costs 0.1.0__py3-none-any.whl
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.
- inventree_manufacturing_costs-0.1.0.dist-info/METADATA +102 -0
- inventree_manufacturing_costs-0.1.0.dist-info/RECORD +25 -0
- inventree_manufacturing_costs-0.1.0.dist-info/WHEEL +5 -0
- inventree_manufacturing_costs-0.1.0.dist-info/entry_points.txt +2 -0
- inventree_manufacturing_costs-0.1.0.dist-info/licenses/LICENSE +21 -0
- inventree_manufacturing_costs-0.1.0.dist-info/top_level.txt +1 -0
- manufacturing_costs/__init__.py +3 -0
- manufacturing_costs/admin.py +23 -0
- manufacturing_costs/apps.py +13 -0
- manufacturing_costs/core.py +118 -0
- manufacturing_costs/migrations/0001_initial.py +163 -0
- manufacturing_costs/migrations/0002_remove_manufacturingcost_amortization_and_more.py +43 -0
- manufacturing_costs/migrations/0003_manufacturingcost_description.py +22 -0
- manufacturing_costs/migrations/0004_manufacturingcost_active_manufacturingcost_inherited.py +31 -0
- manufacturing_costs/migrations/__init__.py +0 -0
- manufacturing_costs/models.py +166 -0
- manufacturing_costs/serializers.py +136 -0
- manufacturing_costs/static/.vite/manifest.json +24 -0
- manufacturing_costs/static/AdminPanel.js +192 -0
- manufacturing_costs/static/AdminPanel.js.map +1 -0
- manufacturing_costs/static/PartPanel.js +333 -0
- manufacturing_costs/static/PartPanel.js.map +1 -0
- manufacturing_costs/static/assets/index-BjwOiYns.js +2744 -0
- manufacturing_costs/static/assets/index-BjwOiYns.js.map +1 -0
- manufacturing_costs/views.py +276 -0
|
@@ -0,0 +1,2744 @@
|
|
|
1
|
+
var __typeError = (msg) => {
|
|
2
|
+
throw TypeError(msg);
|
|
3
|
+
};
|
|
4
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
5
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
6
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
7
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
8
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
9
|
+
var _focused, _cleanup, _setup, _a, _online, _cleanup2, _setup2, _b, _client, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _currentThenable, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _QueryObserver_instances, executeFetch_fn, updateStaleTimeout_fn, computeRefetchInterval_fn, updateRefetchInterval_fn, updateTimers_fn, clearStaleTimeout_fn, clearRefetchInterval_fn, updateQuery_fn, notify_fn, _c;
|
|
10
|
+
const INVENTREE_PLUGIN_VERSION = "0.5.1";
|
|
11
|
+
var ApiEndpoints = /* @__PURE__ */ ((ApiEndpoints2) => {
|
|
12
|
+
ApiEndpoints2["api_server_info"] = "";
|
|
13
|
+
ApiEndpoints2["user_list"] = "user/";
|
|
14
|
+
ApiEndpoints2["user_set_password"] = "user/:id/set-password/";
|
|
15
|
+
ApiEndpoints2["user_me"] = "user/me/";
|
|
16
|
+
ApiEndpoints2["user_profile"] = "user/profile/";
|
|
17
|
+
ApiEndpoints2["user_roles"] = "user/roles/";
|
|
18
|
+
ApiEndpoints2["user_token"] = "user/token/";
|
|
19
|
+
ApiEndpoints2["user_tokens"] = "user/tokens/";
|
|
20
|
+
ApiEndpoints2["user_simple_login"] = "email/generate/";
|
|
21
|
+
ApiEndpoints2["user_reset"] = "auth/v1/auth/password/request";
|
|
22
|
+
ApiEndpoints2["user_reset_set"] = "auth/v1/auth/password/reset";
|
|
23
|
+
ApiEndpoints2["auth_pwd_change"] = "auth/v1/account/password/change";
|
|
24
|
+
ApiEndpoints2["auth_login"] = "auth/v1/auth/login";
|
|
25
|
+
ApiEndpoints2["auth_login_2fa"] = "auth/v1/auth/2fa/authenticate";
|
|
26
|
+
ApiEndpoints2["auth_session"] = "auth/v1/auth/session";
|
|
27
|
+
ApiEndpoints2["auth_signup"] = "auth/v1/auth/signup";
|
|
28
|
+
ApiEndpoints2["auth_authenticators"] = "auth/v1/account/authenticators";
|
|
29
|
+
ApiEndpoints2["auth_recovery"] = "auth/v1/account/authenticators/recovery-codes";
|
|
30
|
+
ApiEndpoints2["auth_mfa_reauthenticate"] = "auth/v1/auth/2fa/reauthenticate";
|
|
31
|
+
ApiEndpoints2["auth_totp"] = "auth/v1/account/authenticators/totp";
|
|
32
|
+
ApiEndpoints2["auth_trust"] = "auth/v1/auth/2fa/trust";
|
|
33
|
+
ApiEndpoints2["auth_reauthenticate"] = "auth/v1/auth/reauthenticate";
|
|
34
|
+
ApiEndpoints2["auth_email"] = "auth/v1/account/email";
|
|
35
|
+
ApiEndpoints2["auth_email_verify"] = "auth/v1/auth/email/verify";
|
|
36
|
+
ApiEndpoints2["auth_providers"] = "auth/v1/account/providers";
|
|
37
|
+
ApiEndpoints2["auth_provider_redirect"] = "auth/v1/auth/provider/redirect";
|
|
38
|
+
ApiEndpoints2["auth_config"] = "auth/v1/config";
|
|
39
|
+
ApiEndpoints2["currency_list"] = "currency/exchange/";
|
|
40
|
+
ApiEndpoints2["currency_refresh"] = "currency/refresh/";
|
|
41
|
+
ApiEndpoints2["all_units"] = "units/all/";
|
|
42
|
+
ApiEndpoints2["task_overview"] = "background-task/";
|
|
43
|
+
ApiEndpoints2["task_pending_list"] = "background-task/pending/";
|
|
44
|
+
ApiEndpoints2["task_scheduled_list"] = "background-task/scheduled/";
|
|
45
|
+
ApiEndpoints2["task_failed_list"] = "background-task/failed/";
|
|
46
|
+
ApiEndpoints2["api_search"] = "search/";
|
|
47
|
+
ApiEndpoints2["settings_global_list"] = "settings/global/";
|
|
48
|
+
ApiEndpoints2["settings_user_list"] = "settings/user/";
|
|
49
|
+
ApiEndpoints2["news"] = "news/";
|
|
50
|
+
ApiEndpoints2["global_status"] = "generic/status/";
|
|
51
|
+
ApiEndpoints2["custom_state_list"] = "generic/status/custom/";
|
|
52
|
+
ApiEndpoints2["version"] = "version/";
|
|
53
|
+
ApiEndpoints2["license"] = "license/";
|
|
54
|
+
ApiEndpoints2["group_list"] = "user/group/";
|
|
55
|
+
ApiEndpoints2["owner_list"] = "user/owner/";
|
|
56
|
+
ApiEndpoints2["ruleset_list"] = "user/ruleset/";
|
|
57
|
+
ApiEndpoints2["content_type_list"] = "contenttype/";
|
|
58
|
+
ApiEndpoints2["icons"] = "icons/";
|
|
59
|
+
ApiEndpoints2["selectionlist_list"] = "selection/";
|
|
60
|
+
ApiEndpoints2["selectionlist_detail"] = "selection/:id/";
|
|
61
|
+
ApiEndpoints2["barcode"] = "barcode/";
|
|
62
|
+
ApiEndpoints2["barcode_history"] = "barcode/history/";
|
|
63
|
+
ApiEndpoints2["barcode_link"] = "barcode/link/";
|
|
64
|
+
ApiEndpoints2["barcode_unlink"] = "barcode/unlink/";
|
|
65
|
+
ApiEndpoints2["barcode_generate"] = "barcode/generate/";
|
|
66
|
+
ApiEndpoints2["data_output"] = "data-output/";
|
|
67
|
+
ApiEndpoints2["import_session_list"] = "importer/session/";
|
|
68
|
+
ApiEndpoints2["import_session_accept_fields"] = "importer/session/:id/accept_fields/";
|
|
69
|
+
ApiEndpoints2["import_session_accept_rows"] = "importer/session/:id/accept_rows/";
|
|
70
|
+
ApiEndpoints2["import_session_column_mapping_list"] = "importer/column-mapping/";
|
|
71
|
+
ApiEndpoints2["import_session_row_list"] = "importer/row/";
|
|
72
|
+
ApiEndpoints2["notifications_list"] = "notifications/";
|
|
73
|
+
ApiEndpoints2["notifications_readall"] = "notifications/readall/";
|
|
74
|
+
ApiEndpoints2["build_order_list"] = "build/";
|
|
75
|
+
ApiEndpoints2["build_order_issue"] = "build/:id/issue/";
|
|
76
|
+
ApiEndpoints2["build_order_cancel"] = "build/:id/cancel/";
|
|
77
|
+
ApiEndpoints2["build_order_hold"] = "build/:id/hold/";
|
|
78
|
+
ApiEndpoints2["build_order_complete"] = "build/:id/finish/";
|
|
79
|
+
ApiEndpoints2["build_output_complete"] = "build/:id/complete/";
|
|
80
|
+
ApiEndpoints2["build_output_create"] = "build/:id/create-output/";
|
|
81
|
+
ApiEndpoints2["build_output_scrap"] = "build/:id/scrap-outputs/";
|
|
82
|
+
ApiEndpoints2["build_output_delete"] = "build/:id/delete-outputs/";
|
|
83
|
+
ApiEndpoints2["build_order_auto_allocate"] = "build/:id/auto-allocate/";
|
|
84
|
+
ApiEndpoints2["build_order_allocate"] = "build/:id/allocate/";
|
|
85
|
+
ApiEndpoints2["build_order_consume"] = "build/:id/consume/";
|
|
86
|
+
ApiEndpoints2["build_order_deallocate"] = "build/:id/unallocate/";
|
|
87
|
+
ApiEndpoints2["build_line_list"] = "build/line/";
|
|
88
|
+
ApiEndpoints2["build_item_list"] = "build/item/";
|
|
89
|
+
ApiEndpoints2["bom_list"] = "bom/";
|
|
90
|
+
ApiEndpoints2["bom_item_validate"] = "bom/:id/validate/";
|
|
91
|
+
ApiEndpoints2["bom_validate"] = "part/:id/bom-validate/";
|
|
92
|
+
ApiEndpoints2["bom_substitute_list"] = "bom/substitute/";
|
|
93
|
+
ApiEndpoints2["part_list"] = "part/";
|
|
94
|
+
ApiEndpoints2["part_parameter_list"] = "part/parameter/";
|
|
95
|
+
ApiEndpoints2["part_parameter_template_list"] = "part/parameter/template/";
|
|
96
|
+
ApiEndpoints2["part_thumbs_list"] = "part/thumbs/";
|
|
97
|
+
ApiEndpoints2["part_pricing"] = "part/:id/pricing/";
|
|
98
|
+
ApiEndpoints2["part_requirements"] = "part/:id/requirements/";
|
|
99
|
+
ApiEndpoints2["part_serial_numbers"] = "part/:id/serial-numbers/";
|
|
100
|
+
ApiEndpoints2["part_scheduling"] = "part/:id/scheduling/";
|
|
101
|
+
ApiEndpoints2["part_pricing_internal"] = "part/internal-price/";
|
|
102
|
+
ApiEndpoints2["part_pricing_sale"] = "part/sale-price/";
|
|
103
|
+
ApiEndpoints2["part_stocktake_list"] = "part/stocktake/";
|
|
104
|
+
ApiEndpoints2["category_list"] = "part/category/";
|
|
105
|
+
ApiEndpoints2["category_tree"] = "part/category/tree/";
|
|
106
|
+
ApiEndpoints2["category_parameter_list"] = "part/category/parameters/";
|
|
107
|
+
ApiEndpoints2["related_part_list"] = "part/related/";
|
|
108
|
+
ApiEndpoints2["part_test_template_list"] = "part/test-template/";
|
|
109
|
+
ApiEndpoints2["company_list"] = "company/";
|
|
110
|
+
ApiEndpoints2["contact_list"] = "company/contact/";
|
|
111
|
+
ApiEndpoints2["address_list"] = "company/address/";
|
|
112
|
+
ApiEndpoints2["supplier_part_list"] = "company/part/";
|
|
113
|
+
ApiEndpoints2["supplier_part_pricing_list"] = "company/price-break/";
|
|
114
|
+
ApiEndpoints2["manufacturer_part_list"] = "company/part/manufacturer/";
|
|
115
|
+
ApiEndpoints2["manufacturer_part_parameter_list"] = "company/part/manufacturer/parameter/";
|
|
116
|
+
ApiEndpoints2["stock_location_list"] = "stock/location/";
|
|
117
|
+
ApiEndpoints2["stock_location_type_list"] = "stock/location-type/";
|
|
118
|
+
ApiEndpoints2["stock_location_tree"] = "stock/location/tree/";
|
|
119
|
+
ApiEndpoints2["stock_item_list"] = "stock/";
|
|
120
|
+
ApiEndpoints2["stock_tracking_list"] = "stock/track/";
|
|
121
|
+
ApiEndpoints2["stock_test_result_list"] = "stock/test/";
|
|
122
|
+
ApiEndpoints2["stock_transfer"] = "stock/transfer/";
|
|
123
|
+
ApiEndpoints2["stock_remove"] = "stock/remove/";
|
|
124
|
+
ApiEndpoints2["stock_return"] = "stock/return/";
|
|
125
|
+
ApiEndpoints2["stock_add"] = "stock/add/";
|
|
126
|
+
ApiEndpoints2["stock_count"] = "stock/count/";
|
|
127
|
+
ApiEndpoints2["stock_change_status"] = "stock/change_status/";
|
|
128
|
+
ApiEndpoints2["stock_merge"] = "stock/merge/";
|
|
129
|
+
ApiEndpoints2["stock_assign"] = "stock/assign/";
|
|
130
|
+
ApiEndpoints2["stock_status"] = "stock/status/";
|
|
131
|
+
ApiEndpoints2["stock_install"] = "stock/:id/install/";
|
|
132
|
+
ApiEndpoints2["stock_uninstall"] = "stock/:id/uninstall/";
|
|
133
|
+
ApiEndpoints2["stock_serialize"] = "stock/:id/serialize/";
|
|
134
|
+
ApiEndpoints2["stock_serial_info"] = "stock/:id/serial-numbers/";
|
|
135
|
+
ApiEndpoints2["generate_batch_code"] = "generate/batch-code/";
|
|
136
|
+
ApiEndpoints2["generate_serial_number"] = "generate/serial-number/";
|
|
137
|
+
ApiEndpoints2["purchase_order_list"] = "order/po/";
|
|
138
|
+
ApiEndpoints2["purchase_order_issue"] = "order/po/:id/issue/";
|
|
139
|
+
ApiEndpoints2["purchase_order_hold"] = "order/po/:id/hold/";
|
|
140
|
+
ApiEndpoints2["purchase_order_cancel"] = "order/po/:id/cancel/";
|
|
141
|
+
ApiEndpoints2["purchase_order_complete"] = "order/po/:id/complete/";
|
|
142
|
+
ApiEndpoints2["purchase_order_line_list"] = "order/po-line/";
|
|
143
|
+
ApiEndpoints2["purchase_order_extra_line_list"] = "order/po-extra-line/";
|
|
144
|
+
ApiEndpoints2["purchase_order_receive"] = "order/po/:id/receive/";
|
|
145
|
+
ApiEndpoints2["sales_order_list"] = "order/so/";
|
|
146
|
+
ApiEndpoints2["sales_order_issue"] = "order/so/:id/issue/";
|
|
147
|
+
ApiEndpoints2["sales_order_hold"] = "order/so/:id/hold/";
|
|
148
|
+
ApiEndpoints2["sales_order_cancel"] = "order/so/:id/cancel/";
|
|
149
|
+
ApiEndpoints2["sales_order_ship"] = "order/so/:id/ship/";
|
|
150
|
+
ApiEndpoints2["sales_order_complete"] = "order/so/:id/complete/";
|
|
151
|
+
ApiEndpoints2["sales_order_allocate"] = "order/so/:id/allocate/";
|
|
152
|
+
ApiEndpoints2["sales_order_allocate_serials"] = "order/so/:id/allocate-serials/";
|
|
153
|
+
ApiEndpoints2["sales_order_line_list"] = "order/so-line/";
|
|
154
|
+
ApiEndpoints2["sales_order_extra_line_list"] = "order/so-extra-line/";
|
|
155
|
+
ApiEndpoints2["sales_order_allocation_list"] = "order/so-allocation/";
|
|
156
|
+
ApiEndpoints2["sales_order_shipment_list"] = "order/so/shipment/";
|
|
157
|
+
ApiEndpoints2["sales_order_shipment_complete"] = "order/so/shipment/:id/ship/";
|
|
158
|
+
ApiEndpoints2["return_order_list"] = "order/ro/";
|
|
159
|
+
ApiEndpoints2["return_order_issue"] = "order/ro/:id/issue/";
|
|
160
|
+
ApiEndpoints2["return_order_hold"] = "order/ro/:id/hold/";
|
|
161
|
+
ApiEndpoints2["return_order_cancel"] = "order/ro/:id/cancel/";
|
|
162
|
+
ApiEndpoints2["return_order_complete"] = "order/ro/:id/complete/";
|
|
163
|
+
ApiEndpoints2["return_order_receive"] = "order/ro/:id/receive/";
|
|
164
|
+
ApiEndpoints2["return_order_line_list"] = "order/ro-line/";
|
|
165
|
+
ApiEndpoints2["return_order_extra_line_list"] = "order/ro-extra-line/";
|
|
166
|
+
ApiEndpoints2["label_list"] = "label/template/";
|
|
167
|
+
ApiEndpoints2["label_print"] = "label/print/";
|
|
168
|
+
ApiEndpoints2["report_list"] = "report/template/";
|
|
169
|
+
ApiEndpoints2["report_print"] = "report/print/";
|
|
170
|
+
ApiEndpoints2["report_snippet"] = "report/snippet/";
|
|
171
|
+
ApiEndpoints2["report_asset"] = "report/asset/";
|
|
172
|
+
ApiEndpoints2["plugin_list"] = "plugins/";
|
|
173
|
+
ApiEndpoints2["plugin_setting_list"] = "plugins/:plugin/settings/";
|
|
174
|
+
ApiEndpoints2["plugin_user_setting_list"] = "plugins/:plugin/user-settings/";
|
|
175
|
+
ApiEndpoints2["plugin_registry_status"] = "plugins/status/";
|
|
176
|
+
ApiEndpoints2["plugin_install"] = "plugins/install/";
|
|
177
|
+
ApiEndpoints2["plugin_reload"] = "plugins/reload/";
|
|
178
|
+
ApiEndpoints2["plugin_activate"] = "plugins/:key/activate/";
|
|
179
|
+
ApiEndpoints2["plugin_uninstall"] = "plugins/:key/uninstall/";
|
|
180
|
+
ApiEndpoints2["plugin_admin"] = "plugins/:key/admin/";
|
|
181
|
+
ApiEndpoints2["plugin_ui_features_list"] = "plugins/ui/features/:feature_type/";
|
|
182
|
+
ApiEndpoints2["plugin_locate_item"] = "locate/";
|
|
183
|
+
ApiEndpoints2["machine_types_list"] = "machine/types/";
|
|
184
|
+
ApiEndpoints2["machine_driver_list"] = "machine/drivers/";
|
|
185
|
+
ApiEndpoints2["machine_registry_status"] = "machine/status/";
|
|
186
|
+
ApiEndpoints2["machine_list"] = "machine/";
|
|
187
|
+
ApiEndpoints2["machine_restart"] = "machine/:machine/restart/";
|
|
188
|
+
ApiEndpoints2["machine_setting_list"] = "machine/:machine/settings/";
|
|
189
|
+
ApiEndpoints2["machine_setting_detail"] = "machine/:machine/settings/:config_type/";
|
|
190
|
+
ApiEndpoints2["attachment_list"] = "attachment/";
|
|
191
|
+
ApiEndpoints2["error_report_list"] = "error-report/";
|
|
192
|
+
ApiEndpoints2["project_code_list"] = "project-code/";
|
|
193
|
+
ApiEndpoints2["custom_unit_list"] = "units/";
|
|
194
|
+
ApiEndpoints2["notes_image_upload"] = "notes-image-upload/";
|
|
195
|
+
ApiEndpoints2["email_list"] = "admin/email/";
|
|
196
|
+
ApiEndpoints2["email_test"] = "admin/email/test/";
|
|
197
|
+
ApiEndpoints2["config_list"] = "admin/config/";
|
|
198
|
+
return ApiEndpoints2;
|
|
199
|
+
})(ApiEndpoints || {});
|
|
200
|
+
window["LinguiCore"].i18n;
|
|
201
|
+
function apiPrefix() {
|
|
202
|
+
return "/api/";
|
|
203
|
+
}
|
|
204
|
+
function apiUrl(endpoint, pk, pathParams) {
|
|
205
|
+
let _url = endpoint;
|
|
206
|
+
if (!_url.startsWith("/")) {
|
|
207
|
+
_url = apiPrefix() + _url;
|
|
208
|
+
}
|
|
209
|
+
if (_url && pk) {
|
|
210
|
+
if (_url.indexOf(":id") >= 0) {
|
|
211
|
+
_url = _url.replace(":id", `${pk}`);
|
|
212
|
+
} else {
|
|
213
|
+
_url += `${pk}/`;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return _url;
|
|
217
|
+
}
|
|
218
|
+
window["LinguiCore"].i18n;
|
|
219
|
+
({
|
|
220
|
+
part: {
|
|
221
|
+
api_endpoint: ApiEndpoints.part_list
|
|
222
|
+
},
|
|
223
|
+
partparametertemplate: {
|
|
224
|
+
api_endpoint: ApiEndpoints.part_parameter_template_list
|
|
225
|
+
},
|
|
226
|
+
parttesttemplate: {
|
|
227
|
+
api_endpoint: ApiEndpoints.part_test_template_list
|
|
228
|
+
},
|
|
229
|
+
supplierpart: {
|
|
230
|
+
api_endpoint: ApiEndpoints.supplier_part_list
|
|
231
|
+
},
|
|
232
|
+
manufacturerpart: {
|
|
233
|
+
api_endpoint: ApiEndpoints.manufacturer_part_list
|
|
234
|
+
},
|
|
235
|
+
partcategory: {
|
|
236
|
+
api_endpoint: ApiEndpoints.category_list
|
|
237
|
+
},
|
|
238
|
+
stockitem: {
|
|
239
|
+
api_endpoint: ApiEndpoints.stock_item_list
|
|
240
|
+
},
|
|
241
|
+
stocklocation: {
|
|
242
|
+
api_endpoint: ApiEndpoints.stock_location_list
|
|
243
|
+
},
|
|
244
|
+
stocklocationtype: {
|
|
245
|
+
api_endpoint: ApiEndpoints.stock_location_type_list
|
|
246
|
+
},
|
|
247
|
+
stockhistory: {
|
|
248
|
+
api_endpoint: ApiEndpoints.stock_tracking_list
|
|
249
|
+
},
|
|
250
|
+
build: {
|
|
251
|
+
api_endpoint: ApiEndpoints.build_order_list
|
|
252
|
+
},
|
|
253
|
+
buildline: {
|
|
254
|
+
api_endpoint: ApiEndpoints.build_line_list
|
|
255
|
+
},
|
|
256
|
+
builditem: {
|
|
257
|
+
api_endpoint: ApiEndpoints.build_item_list
|
|
258
|
+
},
|
|
259
|
+
company: {
|
|
260
|
+
api_endpoint: ApiEndpoints.company_list
|
|
261
|
+
},
|
|
262
|
+
projectcode: {
|
|
263
|
+
api_endpoint: ApiEndpoints.project_code_list
|
|
264
|
+
},
|
|
265
|
+
purchaseorder: {
|
|
266
|
+
api_endpoint: ApiEndpoints.purchase_order_list
|
|
267
|
+
},
|
|
268
|
+
purchaseorderlineitem: {
|
|
269
|
+
api_endpoint: ApiEndpoints.purchase_order_line_list
|
|
270
|
+
},
|
|
271
|
+
salesorder: {
|
|
272
|
+
api_endpoint: ApiEndpoints.sales_order_list
|
|
273
|
+
},
|
|
274
|
+
salesordershipment: {
|
|
275
|
+
api_endpoint: ApiEndpoints.sales_order_shipment_list
|
|
276
|
+
},
|
|
277
|
+
returnorder: {
|
|
278
|
+
api_endpoint: ApiEndpoints.return_order_list
|
|
279
|
+
},
|
|
280
|
+
returnorderlineitem: {
|
|
281
|
+
api_endpoint: ApiEndpoints.return_order_line_list
|
|
282
|
+
},
|
|
283
|
+
address: {
|
|
284
|
+
api_endpoint: ApiEndpoints.address_list
|
|
285
|
+
},
|
|
286
|
+
contact: {
|
|
287
|
+
api_endpoint: ApiEndpoints.contact_list
|
|
288
|
+
},
|
|
289
|
+
owner: {
|
|
290
|
+
api_endpoint: ApiEndpoints.owner_list
|
|
291
|
+
},
|
|
292
|
+
user: {
|
|
293
|
+
api_endpoint: ApiEndpoints.user_list
|
|
294
|
+
},
|
|
295
|
+
group: {
|
|
296
|
+
api_endpoint: ApiEndpoints.group_list
|
|
297
|
+
},
|
|
298
|
+
importsession: {
|
|
299
|
+
api_endpoint: ApiEndpoints.import_session_list
|
|
300
|
+
},
|
|
301
|
+
labeltemplate: {
|
|
302
|
+
api_endpoint: ApiEndpoints.label_list
|
|
303
|
+
},
|
|
304
|
+
reporttemplate: {
|
|
305
|
+
api_endpoint: ApiEndpoints.report_list
|
|
306
|
+
},
|
|
307
|
+
pluginconfig: {
|
|
308
|
+
api_endpoint: ApiEndpoints.plugin_list
|
|
309
|
+
},
|
|
310
|
+
contenttype: {
|
|
311
|
+
api_endpoint: ApiEndpoints.content_type_list
|
|
312
|
+
},
|
|
313
|
+
selectionlist: {
|
|
314
|
+
api_endpoint: ApiEndpoints.selectionlist_list
|
|
315
|
+
},
|
|
316
|
+
error: {
|
|
317
|
+
api_endpoint: ApiEndpoints.error_report_list
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
function cancelEvent(event) {
|
|
321
|
+
var _a2;
|
|
322
|
+
event == null ? void 0 : event.preventDefault();
|
|
323
|
+
event == null ? void 0 : event.stopPropagation();
|
|
324
|
+
(_a2 = event == null ? void 0 : event.nativeEvent) == null ? void 0 : _a2.stopImmediatePropagation();
|
|
325
|
+
}
|
|
326
|
+
function checkPluginVersion(context) {
|
|
327
|
+
var _a2;
|
|
328
|
+
const systemVersion = ((_a2 = context == null ? void 0 : context.version) == null ? void 0 : _a2.inventree) || "";
|
|
329
|
+
if (INVENTREE_PLUGIN_VERSION != systemVersion) {
|
|
330
|
+
console.info(`Plugin version mismatch! Expected version ${INVENTREE_PLUGIN_VERSION}, got ${systemVersion}`);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
function formatDecimal(value, options = {}) {
|
|
334
|
+
const locale = options.locale || navigator.language || "en-US";
|
|
335
|
+
if (value === null || value === void 0) {
|
|
336
|
+
return value;
|
|
337
|
+
}
|
|
338
|
+
try {
|
|
339
|
+
const formatter = new Intl.NumberFormat(locale, {
|
|
340
|
+
style: "decimal",
|
|
341
|
+
maximumFractionDigits: options.digits ?? 6,
|
|
342
|
+
minimumFractionDigits: options.minDigits ?? 0
|
|
343
|
+
});
|
|
344
|
+
return formatter.format(value);
|
|
345
|
+
} catch (e) {
|
|
346
|
+
console.error("Error formatting decimal:", e);
|
|
347
|
+
return value;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
function formatCurrencyValue(value, options = {}) {
|
|
351
|
+
if (value == null || value == void 0) {
|
|
352
|
+
return null;
|
|
353
|
+
}
|
|
354
|
+
value = Number.parseFloat(value.toString());
|
|
355
|
+
if (Number.isNaN(value) || !Number.isFinite(value)) {
|
|
356
|
+
return null;
|
|
357
|
+
}
|
|
358
|
+
value *= options.multiplier ?? 1;
|
|
359
|
+
const locale = options.locale || navigator.language || "en-US";
|
|
360
|
+
const minDigits = options.minDigits ?? 0;
|
|
361
|
+
const maxDigits = options.digits ?? 6;
|
|
362
|
+
try {
|
|
363
|
+
const formatter = new Intl.NumberFormat(locale, {
|
|
364
|
+
style: "currency",
|
|
365
|
+
currency: options.currency || "USD",
|
|
366
|
+
maximumFractionDigits: Math.max(minDigits, maxDigits),
|
|
367
|
+
minimumFractionDigits: Math.min(minDigits, maxDigits)
|
|
368
|
+
});
|
|
369
|
+
return formatter.format(value);
|
|
370
|
+
} catch (e) {
|
|
371
|
+
console.error("Error formatting currency:", e);
|
|
372
|
+
return value;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
var jsxRuntime$1 = { exports: {} };
|
|
376
|
+
var reactJsxRuntime_production$1 = {};
|
|
377
|
+
/**
|
|
378
|
+
* @license React
|
|
379
|
+
* react-jsx-runtime.production.js
|
|
380
|
+
*
|
|
381
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
382
|
+
*
|
|
383
|
+
* This source code is licensed under the MIT license found in the
|
|
384
|
+
* LICENSE file in the root directory of this source tree.
|
|
385
|
+
*/
|
|
386
|
+
var hasRequiredReactJsxRuntime_production$1;
|
|
387
|
+
function requireReactJsxRuntime_production$1() {
|
|
388
|
+
if (hasRequiredReactJsxRuntime_production$1) return reactJsxRuntime_production$1;
|
|
389
|
+
hasRequiredReactJsxRuntime_production$1 = 1;
|
|
390
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
391
|
+
function jsxProd(type, config, maybeKey) {
|
|
392
|
+
var key = null;
|
|
393
|
+
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
394
|
+
void 0 !== config.key && (key = "" + config.key);
|
|
395
|
+
if ("key" in config) {
|
|
396
|
+
maybeKey = {};
|
|
397
|
+
for (var propName in config)
|
|
398
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
399
|
+
} else maybeKey = config;
|
|
400
|
+
config = maybeKey.ref;
|
|
401
|
+
return {
|
|
402
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
403
|
+
type,
|
|
404
|
+
key,
|
|
405
|
+
ref: void 0 !== config ? config : null,
|
|
406
|
+
props: maybeKey
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
reactJsxRuntime_production$1.Fragment = REACT_FRAGMENT_TYPE;
|
|
410
|
+
reactJsxRuntime_production$1.jsx = jsxProd;
|
|
411
|
+
reactJsxRuntime_production$1.jsxs = jsxProd;
|
|
412
|
+
return reactJsxRuntime_production$1;
|
|
413
|
+
}
|
|
414
|
+
var hasRequiredJsxRuntime$1;
|
|
415
|
+
function requireJsxRuntime$1() {
|
|
416
|
+
if (hasRequiredJsxRuntime$1) return jsxRuntime$1.exports;
|
|
417
|
+
hasRequiredJsxRuntime$1 = 1;
|
|
418
|
+
{
|
|
419
|
+
jsxRuntime$1.exports = requireReactJsxRuntime_production$1();
|
|
420
|
+
}
|
|
421
|
+
return jsxRuntime$1.exports;
|
|
422
|
+
}
|
|
423
|
+
var jsxRuntimeExports$1 = requireJsxRuntime$1();
|
|
424
|
+
function identifierString(value) {
|
|
425
|
+
value = value || "-";
|
|
426
|
+
return value.toLowerCase().replace(/[^a-z0-9]/g, "-");
|
|
427
|
+
}
|
|
428
|
+
const ActionIcon$1 = window["MantineCore"].ActionIcon;
|
|
429
|
+
const Group = window["MantineCore"].Group;
|
|
430
|
+
const Tooltip$1 = window["MantineCore"].Tooltip;
|
|
431
|
+
function ActionButton(props) {
|
|
432
|
+
const hidden = props.hidden ?? false;
|
|
433
|
+
return !hidden && /* @__PURE__ */ jsxRuntimeExports$1.jsx(Tooltip$1, { disabled: !props.tooltip && !props.text, label: props.tooltip ?? props.text, position: props.tooltipAlignment ?? "left", children: /* @__PURE__ */ jsxRuntimeExports$1.jsx(ActionIcon$1, { disabled: props.disabled, p: 17, radius: props.radius ?? "xs", color: props.color, size: props.size, "aria-label": `action-button-${identifierString(props.tooltip ?? props.text ?? "")}`, onClick: (event) => {
|
|
434
|
+
props.onClick(event);
|
|
435
|
+
}, variant: props.variant ?? "transparent", children: /* @__PURE__ */ jsxRuntimeExports$1.jsx(Group, { gap: "xs", wrap: "nowrap", children: props.icon }) }, `action-icon-${props.tooltip ?? props.text}`) }, `tooltip-${props.tooltip ?? props.text}`);
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
439
|
+
*
|
|
440
|
+
* This source code is licensed under the MIT license.
|
|
441
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
442
|
+
*/
|
|
443
|
+
var defaultAttributes$1 = {
|
|
444
|
+
outline: {
|
|
445
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
446
|
+
width: 24,
|
|
447
|
+
height: 24,
|
|
448
|
+
viewBox: "0 0 24 24",
|
|
449
|
+
fill: "none",
|
|
450
|
+
stroke: "currentColor",
|
|
451
|
+
strokeWidth: 2,
|
|
452
|
+
strokeLinecap: "round",
|
|
453
|
+
strokeLinejoin: "round"
|
|
454
|
+
},
|
|
455
|
+
filled: {
|
|
456
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
457
|
+
width: 24,
|
|
458
|
+
height: 24,
|
|
459
|
+
viewBox: "0 0 24 24",
|
|
460
|
+
fill: "currentColor",
|
|
461
|
+
stroke: "none"
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
/**
|
|
465
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
466
|
+
*
|
|
467
|
+
* This source code is licensed under the MIT license.
|
|
468
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
469
|
+
*/
|
|
470
|
+
const forwardRef$1 = window["React"].forwardRef;
|
|
471
|
+
const createElement$1 = window["React"].createElement;
|
|
472
|
+
const createReactComponent$1 = (type, iconName, iconNamePascal, iconNode) => {
|
|
473
|
+
const Component = forwardRef$1(
|
|
474
|
+
({ color = "currentColor", size = 24, stroke = 2, title, className, children, ...rest }, ref) => createElement$1(
|
|
475
|
+
"svg",
|
|
476
|
+
{
|
|
477
|
+
ref,
|
|
478
|
+
...defaultAttributes$1[type],
|
|
479
|
+
width: size,
|
|
480
|
+
height: size,
|
|
481
|
+
className: [`tabler-icon`, `tabler-icon-${iconName}`, className].join(" "),
|
|
482
|
+
...{
|
|
483
|
+
strokeWidth: stroke,
|
|
484
|
+
stroke: color
|
|
485
|
+
},
|
|
486
|
+
...rest
|
|
487
|
+
},
|
|
488
|
+
[
|
|
489
|
+
title && createElement$1("title", { key: "svg-title" }, title),
|
|
490
|
+
...iconNode.map(([tag, attrs]) => createElement$1(tag, attrs)),
|
|
491
|
+
...Array.isArray(children) ? children : [children]
|
|
492
|
+
]
|
|
493
|
+
)
|
|
494
|
+
);
|
|
495
|
+
Component.displayName = `${iconNamePascal}`;
|
|
496
|
+
return Component;
|
|
497
|
+
};
|
|
498
|
+
/**
|
|
499
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
500
|
+
*
|
|
501
|
+
* This source code is licensed under the MIT license.
|
|
502
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
503
|
+
*/
|
|
504
|
+
const __iconNode$a = [["path", { "d": "M12 5l0 14", "key": "svg-0" }], ["path", { "d": "M5 12l14 0", "key": "svg-1" }]];
|
|
505
|
+
const IconPlus = createReactComponent$1("outline", "plus", "Plus", __iconNode$a);
|
|
506
|
+
function AddItemButton(props) {
|
|
507
|
+
return /* @__PURE__ */ jsxRuntimeExports$1.jsx(ActionButton, { ...props, color: "green", icon: /* @__PURE__ */ jsxRuntimeExports$1.jsx(IconPlus, {}) });
|
|
508
|
+
}
|
|
509
|
+
window["MantineCore"].ActionIcon;
|
|
510
|
+
window["MantineCore"].Menu;
|
|
511
|
+
window["MantineCore"].Tooltip;
|
|
512
|
+
window["MantineCore"].Progress;
|
|
513
|
+
window["MantineCore"].Stack;
|
|
514
|
+
window["MantineCore"].Text;
|
|
515
|
+
window["React"].useMemo;
|
|
516
|
+
window["LinguiCore"].i18n;
|
|
517
|
+
window["MantineCore"].Badge;
|
|
518
|
+
window["MantineCore"].Skeleton;
|
|
519
|
+
const useState$6 = window["React"].useState;
|
|
520
|
+
const useRef$5 = window["React"].useRef;
|
|
521
|
+
const useEffect$9 = window["React"].useEffect;
|
|
522
|
+
function useDebouncedValue(value, wait, options = { leading: false }) {
|
|
523
|
+
const [_value, setValue] = useState$6(value);
|
|
524
|
+
const mountedRef = useRef$5(false);
|
|
525
|
+
const timeoutRef = useRef$5(null);
|
|
526
|
+
const cooldownRef = useRef$5(false);
|
|
527
|
+
const cancel = () => window.clearTimeout(timeoutRef.current);
|
|
528
|
+
useEffect$9(() => {
|
|
529
|
+
if (mountedRef.current) {
|
|
530
|
+
if (!cooldownRef.current && options.leading) {
|
|
531
|
+
cooldownRef.current = true;
|
|
532
|
+
setValue(value);
|
|
533
|
+
} else {
|
|
534
|
+
cancel();
|
|
535
|
+
timeoutRef.current = window.setTimeout(() => {
|
|
536
|
+
cooldownRef.current = false;
|
|
537
|
+
setValue(value);
|
|
538
|
+
}, wait);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}, [value, options.leading, wait]);
|
|
542
|
+
useEffect$9(() => {
|
|
543
|
+
mountedRef.current = true;
|
|
544
|
+
return cancel;
|
|
545
|
+
}, []);
|
|
546
|
+
return [_value, cancel];
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
550
|
+
*
|
|
551
|
+
* This source code is licensed under the MIT license.
|
|
552
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
553
|
+
*/
|
|
554
|
+
const __iconNode$9 = [["path", { "d": "M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0", "key": "svg-0" }], ["path", { "d": "M21 21l-6 -6", "key": "svg-1" }]];
|
|
555
|
+
const IconSearch = createReactComponent$1("outline", "search", "Search", __iconNode$9);
|
|
556
|
+
const _i18n$1 = window["LinguiCore"].i18n;
|
|
557
|
+
const CloseButton = window["MantineCore"].CloseButton;
|
|
558
|
+
const TextInput = window["MantineCore"].TextInput;
|
|
559
|
+
const useEffect$8 = window["React"].useEffect;
|
|
560
|
+
const useState$5 = window["React"].useState;
|
|
561
|
+
function SearchInput({
|
|
562
|
+
disabled,
|
|
563
|
+
debounce,
|
|
564
|
+
placeholder,
|
|
565
|
+
searchCallback
|
|
566
|
+
}) {
|
|
567
|
+
const [value, setValue] = useState$5("");
|
|
568
|
+
const [searchText] = useDebouncedValue(value, debounce ?? 500);
|
|
569
|
+
useEffect$8(() => {
|
|
570
|
+
searchCallback(searchText);
|
|
571
|
+
}, [searchText]);
|
|
572
|
+
return /* @__PURE__ */ jsxRuntimeExports$1.jsx(TextInput, { value, disabled, "aria-label": "table-search-input", leftSection: /* @__PURE__ */ jsxRuntimeExports$1.jsx(IconSearch, {}), placeholder: placeholder ?? _i18n$1._(
|
|
573
|
+
/*i18n*/
|
|
574
|
+
{
|
|
575
|
+
id: "A1taO8"
|
|
576
|
+
}
|
|
577
|
+
), onChange: (event) => setValue(event.target.value), rightSection: value.length > 0 ? /* @__PURE__ */ jsxRuntimeExports$1.jsx(CloseButton, { size: "xs", onClick: () => {
|
|
578
|
+
setValue("");
|
|
579
|
+
searchCallback("");
|
|
580
|
+
} }) : null });
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
584
|
+
*
|
|
585
|
+
* This source code is licensed under the MIT license.
|
|
586
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
587
|
+
*/
|
|
588
|
+
const __iconNode$8 = [["path", { "d": "M5 12l14 0", "key": "svg-0" }], ["path", { "d": "M13 18l6 -6", "key": "svg-1" }], ["path", { "d": "M13 6l6 6", "key": "svg-2" }]];
|
|
589
|
+
createReactComponent$1("outline", "arrow-right", "ArrowRight", __iconNode$8);
|
|
590
|
+
/**
|
|
591
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
592
|
+
*
|
|
593
|
+
* This source code is licensed under the MIT license.
|
|
594
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
595
|
+
*/
|
|
596
|
+
const __iconNode$7 = [["path", { "d": "M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z", "key": "svg-0" }], ["path", { "d": "M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1", "key": "svg-1" }]];
|
|
597
|
+
const IconCopy = createReactComponent$1("outline", "copy", "Copy", __iconNode$7);
|
|
598
|
+
/**
|
|
599
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
600
|
+
*
|
|
601
|
+
* This source code is licensed under the MIT license.
|
|
602
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
603
|
+
*/
|
|
604
|
+
const __iconNode$6 = [["path", { "d": "M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1", "key": "svg-0" }], ["path", { "d": "M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z", "key": "svg-1" }], ["path", { "d": "M16 5l3 3", "key": "svg-2" }]];
|
|
605
|
+
const IconEdit = createReactComponent$1("outline", "edit", "Edit", __iconNode$6);
|
|
606
|
+
/**
|
|
607
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
608
|
+
*
|
|
609
|
+
* This source code is licensed under the MIT license.
|
|
610
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
611
|
+
*/
|
|
612
|
+
const __iconNode$5 = [["path", { "d": "M4 7l16 0", "key": "svg-0" }], ["path", { "d": "M10 11l0 6", "key": "svg-1" }], ["path", { "d": "M14 11l0 6", "key": "svg-2" }], ["path", { "d": "M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12", "key": "svg-3" }], ["path", { "d": "M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3", "key": "svg-4" }]];
|
|
613
|
+
const IconTrash = createReactComponent$1("outline", "trash", "Trash", __iconNode$5);
|
|
614
|
+
/**
|
|
615
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
616
|
+
*
|
|
617
|
+
* This source code is licensed under the MIT license.
|
|
618
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
619
|
+
*/
|
|
620
|
+
const __iconNode$4 = [["path", { "d": "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", "key": "svg-0" }], ["path", { "d": "M10 10l4 4m0 -4l-4 4", "key": "svg-1" }]];
|
|
621
|
+
createReactComponent$1("outline", "circle-x", "CircleX", __iconNode$4);
|
|
622
|
+
/**
|
|
623
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
624
|
+
*
|
|
625
|
+
* This source code is licensed under the MIT license.
|
|
626
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
627
|
+
*/
|
|
628
|
+
const __iconNode$3 = [["path", { "d": "M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "key": "svg-0" }], ["path", { "d": "M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "key": "svg-1" }], ["path", { "d": "M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "key": "svg-2" }]];
|
|
629
|
+
const IconDots = createReactComponent$1("outline", "dots", "Dots", __iconNode$3);
|
|
630
|
+
const _i18n = window["LinguiCore"].i18n;
|
|
631
|
+
const ActionIcon = window["MantineCore"].ActionIcon;
|
|
632
|
+
const Menu = window["MantineCore"].Menu;
|
|
633
|
+
const Tooltip = window["MantineCore"].Tooltip;
|
|
634
|
+
const useMemo$3 = window["React"].useMemo;
|
|
635
|
+
const useState$4 = window["React"].useState;
|
|
636
|
+
function RowDuplicateAction(props) {
|
|
637
|
+
return {
|
|
638
|
+
...props,
|
|
639
|
+
title: _i18n._(
|
|
640
|
+
/*i18n*/
|
|
641
|
+
{
|
|
642
|
+
id: "euc6Ns"
|
|
643
|
+
}
|
|
644
|
+
),
|
|
645
|
+
color: "green",
|
|
646
|
+
icon: /* @__PURE__ */ jsxRuntimeExports$1.jsx(IconCopy, {})
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
function RowEditAction(props) {
|
|
650
|
+
return {
|
|
651
|
+
...props,
|
|
652
|
+
title: _i18n._(
|
|
653
|
+
/*i18n*/
|
|
654
|
+
{
|
|
655
|
+
id: "ePK91l"
|
|
656
|
+
}
|
|
657
|
+
),
|
|
658
|
+
color: "blue",
|
|
659
|
+
icon: /* @__PURE__ */ jsxRuntimeExports$1.jsx(IconEdit, {})
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
function RowDeleteAction(props) {
|
|
663
|
+
return {
|
|
664
|
+
...props,
|
|
665
|
+
title: _i18n._(
|
|
666
|
+
/*i18n*/
|
|
667
|
+
{
|
|
668
|
+
id: "cnGeoo"
|
|
669
|
+
}
|
|
670
|
+
),
|
|
671
|
+
color: "red",
|
|
672
|
+
icon: /* @__PURE__ */ jsxRuntimeExports$1.jsx(IconTrash, {})
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
function RowActions({
|
|
676
|
+
title,
|
|
677
|
+
actions,
|
|
678
|
+
disabled = false,
|
|
679
|
+
index
|
|
680
|
+
}) {
|
|
681
|
+
function openMenu(event) {
|
|
682
|
+
cancelEvent(event);
|
|
683
|
+
setOpened(!opened);
|
|
684
|
+
}
|
|
685
|
+
const [opened, setOpened] = useState$4(false);
|
|
686
|
+
const visibleActions = useMemo$3(() => {
|
|
687
|
+
return actions.filter((action) => !action.hidden);
|
|
688
|
+
}, [actions]);
|
|
689
|
+
function RowActionIcon(action) {
|
|
690
|
+
return /* @__PURE__ */ jsxRuntimeExports$1.jsx(Tooltip, { withinPortal: true, label: action.tooltip ?? action.title, position: "left", children: /* @__PURE__ */ jsxRuntimeExports$1.jsx(Menu.Item, { color: action.color, leftSection: action.icon, onClick: (event) => {
|
|
691
|
+
var _a2;
|
|
692
|
+
cancelEvent(event);
|
|
693
|
+
(_a2 = action.onClick) == null ? void 0 : _a2.call(action, event);
|
|
694
|
+
setOpened(false);
|
|
695
|
+
}, disabled: action.disabled || false, children: action.title }) }, action.title);
|
|
696
|
+
}
|
|
697
|
+
return visibleActions.length > 0 && /* @__PURE__ */ jsxRuntimeExports$1.jsxs(Menu, { withinPortal: true, disabled, position: "bottom-end", opened, onChange: setOpened, children: [
|
|
698
|
+
/* @__PURE__ */ jsxRuntimeExports$1.jsx(Menu.Target, { children: /* @__PURE__ */ jsxRuntimeExports$1.jsx(Tooltip, { withinPortal: true, label: title || _i18n._(
|
|
699
|
+
/*i18n*/
|
|
700
|
+
{
|
|
701
|
+
id: "7L01XJ"
|
|
702
|
+
}
|
|
703
|
+
), children: /* @__PURE__ */ jsxRuntimeExports$1.jsx(ActionIcon, { "aria-label": `row-action-menu-${index ?? ""}`, onClick: openMenu, disabled, variant: "subtle", color: "gray", children: /* @__PURE__ */ jsxRuntimeExports$1.jsx(IconDots, {}) }, `row-action-menu-${index ?? ""}`) }) }),
|
|
704
|
+
/* @__PURE__ */ jsxRuntimeExports$1.jsx(Menu.Dropdown, { children: visibleActions.map((action) => /* @__PURE__ */ jsxRuntimeExports$1.jsx(RowActionIcon, { ...action }, action.title)) })
|
|
705
|
+
] });
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
709
|
+
*
|
|
710
|
+
* This source code is licensed under the MIT license.
|
|
711
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
712
|
+
*/
|
|
713
|
+
var defaultAttributes = {
|
|
714
|
+
outline: {
|
|
715
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
716
|
+
width: 24,
|
|
717
|
+
height: 24,
|
|
718
|
+
viewBox: "0 0 24 24",
|
|
719
|
+
fill: "none",
|
|
720
|
+
stroke: "currentColor",
|
|
721
|
+
strokeWidth: 2,
|
|
722
|
+
strokeLinecap: "round",
|
|
723
|
+
strokeLinejoin: "round"
|
|
724
|
+
},
|
|
725
|
+
filled: {
|
|
726
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
727
|
+
width: 24,
|
|
728
|
+
height: 24,
|
|
729
|
+
viewBox: "0 0 24 24",
|
|
730
|
+
fill: "currentColor",
|
|
731
|
+
stroke: "none"
|
|
732
|
+
}
|
|
733
|
+
};
|
|
734
|
+
/**
|
|
735
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
736
|
+
*
|
|
737
|
+
* This source code is licensed under the MIT license.
|
|
738
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
739
|
+
*/
|
|
740
|
+
const forwardRef = window["React"].forwardRef;
|
|
741
|
+
const createElement = window["React"].createElement;
|
|
742
|
+
const createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
|
|
743
|
+
const Component = forwardRef(
|
|
744
|
+
({ color = "currentColor", size = 24, stroke = 2, title, className, children, ...rest }, ref) => createElement(
|
|
745
|
+
"svg",
|
|
746
|
+
{
|
|
747
|
+
ref,
|
|
748
|
+
...defaultAttributes[type],
|
|
749
|
+
width: size,
|
|
750
|
+
height: size,
|
|
751
|
+
className: [`tabler-icon`, `tabler-icon-${iconName}`, className].join(" "),
|
|
752
|
+
...{
|
|
753
|
+
strokeWidth: stroke,
|
|
754
|
+
stroke: color
|
|
755
|
+
},
|
|
756
|
+
...rest
|
|
757
|
+
},
|
|
758
|
+
[
|
|
759
|
+
title && createElement("title", { key: "svg-title" }, title),
|
|
760
|
+
...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
|
|
761
|
+
...Array.isArray(children) ? children : [children]
|
|
762
|
+
]
|
|
763
|
+
)
|
|
764
|
+
);
|
|
765
|
+
Component.displayName = `${iconNamePascal}`;
|
|
766
|
+
return Component;
|
|
767
|
+
};
|
|
768
|
+
/**
|
|
769
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
770
|
+
*
|
|
771
|
+
* This source code is licensed under the MIT license.
|
|
772
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
773
|
+
*/
|
|
774
|
+
const __iconNode$2 = [["path", { "d": "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", "key": "svg-0" }], ["path", { "d": "M12 9v4", "key": "svg-1" }], ["path", { "d": "M12 16v.01", "key": "svg-2" }]];
|
|
775
|
+
const IconExclamationCircle = createReactComponent("outline", "exclamation-circle", "ExclamationCircle", __iconNode$2);
|
|
776
|
+
/**
|
|
777
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
778
|
+
*
|
|
779
|
+
* This source code is licensed under the MIT license.
|
|
780
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
781
|
+
*/
|
|
782
|
+
const __iconNode$1 = [["path", { "d": "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0", "key": "svg-0" }], ["path", { "d": "M12 9h.01", "key": "svg-1" }], ["path", { "d": "M11 12h1v4h1", "key": "svg-2" }]];
|
|
783
|
+
const IconInfoCircle = createReactComponent("outline", "info-circle", "InfoCircle", __iconNode$1);
|
|
784
|
+
/**
|
|
785
|
+
* @license @tabler/icons-react v3.34.1 - MIT
|
|
786
|
+
*
|
|
787
|
+
* This source code is licensed under the MIT license.
|
|
788
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
789
|
+
*/
|
|
790
|
+
const __iconNode = [["path", { "d": "M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4", "key": "svg-0" }], ["path", { "d": "M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4", "key": "svg-1" }]];
|
|
791
|
+
const IconRefresh = createReactComponent("outline", "refresh", "Refresh", __iconNode);
|
|
792
|
+
var Subscribable = class {
|
|
793
|
+
constructor() {
|
|
794
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
795
|
+
this.subscribe = this.subscribe.bind(this);
|
|
796
|
+
}
|
|
797
|
+
subscribe(listener) {
|
|
798
|
+
this.listeners.add(listener);
|
|
799
|
+
this.onSubscribe();
|
|
800
|
+
return () => {
|
|
801
|
+
this.listeners.delete(listener);
|
|
802
|
+
this.onUnsubscribe();
|
|
803
|
+
};
|
|
804
|
+
}
|
|
805
|
+
hasListeners() {
|
|
806
|
+
return this.listeners.size > 0;
|
|
807
|
+
}
|
|
808
|
+
onSubscribe() {
|
|
809
|
+
}
|
|
810
|
+
onUnsubscribe() {
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
var isServer = typeof window === "undefined" || "Deno" in globalThis;
|
|
814
|
+
function noop() {
|
|
815
|
+
}
|
|
816
|
+
function isValidTimeout(value) {
|
|
817
|
+
return typeof value === "number" && value >= 0 && value !== Infinity;
|
|
818
|
+
}
|
|
819
|
+
function timeUntilStale(updatedAt, staleTime) {
|
|
820
|
+
return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);
|
|
821
|
+
}
|
|
822
|
+
function resolveStaleTime(staleTime, query) {
|
|
823
|
+
return typeof staleTime === "function" ? staleTime(query) : staleTime;
|
|
824
|
+
}
|
|
825
|
+
function resolveEnabled(enabled, query) {
|
|
826
|
+
return typeof enabled === "function" ? enabled(query) : enabled;
|
|
827
|
+
}
|
|
828
|
+
var hasOwn = Object.prototype.hasOwnProperty;
|
|
829
|
+
function replaceEqualDeep(a, b) {
|
|
830
|
+
if (a === b) {
|
|
831
|
+
return a;
|
|
832
|
+
}
|
|
833
|
+
const array = isPlainArray(a) && isPlainArray(b);
|
|
834
|
+
if (!array && !(isPlainObject(a) && isPlainObject(b))) return b;
|
|
835
|
+
const aItems = array ? a : Object.keys(a);
|
|
836
|
+
const aSize = aItems.length;
|
|
837
|
+
const bItems = array ? b : Object.keys(b);
|
|
838
|
+
const bSize = bItems.length;
|
|
839
|
+
const copy = array ? new Array(bSize) : {};
|
|
840
|
+
let equalItems = 0;
|
|
841
|
+
for (let i = 0; i < bSize; i++) {
|
|
842
|
+
const key = array ? i : bItems[i];
|
|
843
|
+
const aItem = a[key];
|
|
844
|
+
const bItem = b[key];
|
|
845
|
+
if (aItem === bItem) {
|
|
846
|
+
copy[key] = aItem;
|
|
847
|
+
if (array ? i < aSize : hasOwn.call(a, key)) equalItems++;
|
|
848
|
+
continue;
|
|
849
|
+
}
|
|
850
|
+
if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") {
|
|
851
|
+
copy[key] = bItem;
|
|
852
|
+
continue;
|
|
853
|
+
}
|
|
854
|
+
const v2 = replaceEqualDeep(aItem, bItem);
|
|
855
|
+
copy[key] = v2;
|
|
856
|
+
if (v2 === aItem) equalItems++;
|
|
857
|
+
}
|
|
858
|
+
return aSize === bSize && equalItems === aSize ? a : copy;
|
|
859
|
+
}
|
|
860
|
+
function shallowEqualObjects(a, b) {
|
|
861
|
+
if (!b || Object.keys(a).length !== Object.keys(b).length) {
|
|
862
|
+
return false;
|
|
863
|
+
}
|
|
864
|
+
for (const key in a) {
|
|
865
|
+
if (a[key] !== b[key]) {
|
|
866
|
+
return false;
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
return true;
|
|
870
|
+
}
|
|
871
|
+
function isPlainArray(value) {
|
|
872
|
+
return Array.isArray(value) && value.length === Object.keys(value).length;
|
|
873
|
+
}
|
|
874
|
+
function isPlainObject(o) {
|
|
875
|
+
if (!hasObjectPrototype(o)) {
|
|
876
|
+
return false;
|
|
877
|
+
}
|
|
878
|
+
const ctor = o.constructor;
|
|
879
|
+
if (ctor === void 0) {
|
|
880
|
+
return true;
|
|
881
|
+
}
|
|
882
|
+
const prot = ctor.prototype;
|
|
883
|
+
if (!hasObjectPrototype(prot)) {
|
|
884
|
+
return false;
|
|
885
|
+
}
|
|
886
|
+
if (!prot.hasOwnProperty("isPrototypeOf")) {
|
|
887
|
+
return false;
|
|
888
|
+
}
|
|
889
|
+
if (Object.getPrototypeOf(o) !== Object.prototype) {
|
|
890
|
+
return false;
|
|
891
|
+
}
|
|
892
|
+
return true;
|
|
893
|
+
}
|
|
894
|
+
function hasObjectPrototype(o) {
|
|
895
|
+
return Object.prototype.toString.call(o) === "[object Object]";
|
|
896
|
+
}
|
|
897
|
+
function replaceData(prevData, data, options) {
|
|
898
|
+
if (typeof options.structuralSharing === "function") {
|
|
899
|
+
return options.structuralSharing(prevData, data);
|
|
900
|
+
} else if (options.structuralSharing !== false) {
|
|
901
|
+
return replaceEqualDeep(prevData, data);
|
|
902
|
+
}
|
|
903
|
+
return data;
|
|
904
|
+
}
|
|
905
|
+
function shouldThrowError(throwOnError, params) {
|
|
906
|
+
if (typeof throwOnError === "function") {
|
|
907
|
+
return throwOnError(...params);
|
|
908
|
+
}
|
|
909
|
+
return !!throwOnError;
|
|
910
|
+
}
|
|
911
|
+
var FocusManager = (_a = class extends Subscribable {
|
|
912
|
+
constructor() {
|
|
913
|
+
super();
|
|
914
|
+
__privateAdd(this, _focused);
|
|
915
|
+
__privateAdd(this, _cleanup);
|
|
916
|
+
__privateAdd(this, _setup);
|
|
917
|
+
__privateSet(this, _setup, (onFocus) => {
|
|
918
|
+
if (!isServer && window.addEventListener) {
|
|
919
|
+
const listener = () => onFocus();
|
|
920
|
+
window.addEventListener("visibilitychange", listener, false);
|
|
921
|
+
return () => {
|
|
922
|
+
window.removeEventListener("visibilitychange", listener);
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
return;
|
|
926
|
+
});
|
|
927
|
+
}
|
|
928
|
+
onSubscribe() {
|
|
929
|
+
if (!__privateGet(this, _cleanup)) {
|
|
930
|
+
this.setEventListener(__privateGet(this, _setup));
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
onUnsubscribe() {
|
|
934
|
+
var _a2;
|
|
935
|
+
if (!this.hasListeners()) {
|
|
936
|
+
(_a2 = __privateGet(this, _cleanup)) == null ? void 0 : _a2.call(this);
|
|
937
|
+
__privateSet(this, _cleanup, void 0);
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
setEventListener(setup) {
|
|
941
|
+
var _a2;
|
|
942
|
+
__privateSet(this, _setup, setup);
|
|
943
|
+
(_a2 = __privateGet(this, _cleanup)) == null ? void 0 : _a2.call(this);
|
|
944
|
+
__privateSet(this, _cleanup, setup((focused) => {
|
|
945
|
+
if (typeof focused === "boolean") {
|
|
946
|
+
this.setFocused(focused);
|
|
947
|
+
} else {
|
|
948
|
+
this.onFocus();
|
|
949
|
+
}
|
|
950
|
+
}));
|
|
951
|
+
}
|
|
952
|
+
setFocused(focused) {
|
|
953
|
+
const changed = __privateGet(this, _focused) !== focused;
|
|
954
|
+
if (changed) {
|
|
955
|
+
__privateSet(this, _focused, focused);
|
|
956
|
+
this.onFocus();
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
onFocus() {
|
|
960
|
+
const isFocused = this.isFocused();
|
|
961
|
+
this.listeners.forEach((listener) => {
|
|
962
|
+
listener(isFocused);
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
isFocused() {
|
|
966
|
+
var _a2;
|
|
967
|
+
if (typeof __privateGet(this, _focused) === "boolean") {
|
|
968
|
+
return __privateGet(this, _focused);
|
|
969
|
+
}
|
|
970
|
+
return ((_a2 = globalThis.document) == null ? void 0 : _a2.visibilityState) !== "hidden";
|
|
971
|
+
}
|
|
972
|
+
}, _focused = new WeakMap(), _cleanup = new WeakMap(), _setup = new WeakMap(), _a);
|
|
973
|
+
var focusManager = new FocusManager();
|
|
974
|
+
var OnlineManager = (_b = class extends Subscribable {
|
|
975
|
+
constructor() {
|
|
976
|
+
super();
|
|
977
|
+
__privateAdd(this, _online, true);
|
|
978
|
+
__privateAdd(this, _cleanup2);
|
|
979
|
+
__privateAdd(this, _setup2);
|
|
980
|
+
__privateSet(this, _setup2, (onOnline) => {
|
|
981
|
+
if (!isServer && window.addEventListener) {
|
|
982
|
+
const onlineListener = () => onOnline(true);
|
|
983
|
+
const offlineListener = () => onOnline(false);
|
|
984
|
+
window.addEventListener("online", onlineListener, false);
|
|
985
|
+
window.addEventListener("offline", offlineListener, false);
|
|
986
|
+
return () => {
|
|
987
|
+
window.removeEventListener("online", onlineListener);
|
|
988
|
+
window.removeEventListener("offline", offlineListener);
|
|
989
|
+
};
|
|
990
|
+
}
|
|
991
|
+
return;
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
onSubscribe() {
|
|
995
|
+
if (!__privateGet(this, _cleanup2)) {
|
|
996
|
+
this.setEventListener(__privateGet(this, _setup2));
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
onUnsubscribe() {
|
|
1000
|
+
var _a2;
|
|
1001
|
+
if (!this.hasListeners()) {
|
|
1002
|
+
(_a2 = __privateGet(this, _cleanup2)) == null ? void 0 : _a2.call(this);
|
|
1003
|
+
__privateSet(this, _cleanup2, void 0);
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
setEventListener(setup) {
|
|
1007
|
+
var _a2;
|
|
1008
|
+
__privateSet(this, _setup2, setup);
|
|
1009
|
+
(_a2 = __privateGet(this, _cleanup2)) == null ? void 0 : _a2.call(this);
|
|
1010
|
+
__privateSet(this, _cleanup2, setup(this.setOnline.bind(this)));
|
|
1011
|
+
}
|
|
1012
|
+
setOnline(online) {
|
|
1013
|
+
const changed = __privateGet(this, _online) !== online;
|
|
1014
|
+
if (changed) {
|
|
1015
|
+
__privateSet(this, _online, online);
|
|
1016
|
+
this.listeners.forEach((listener) => {
|
|
1017
|
+
listener(online);
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
isOnline() {
|
|
1022
|
+
return __privateGet(this, _online);
|
|
1023
|
+
}
|
|
1024
|
+
}, _online = new WeakMap(), _cleanup2 = new WeakMap(), _setup2 = new WeakMap(), _b);
|
|
1025
|
+
var onlineManager = new OnlineManager();
|
|
1026
|
+
function pendingThenable() {
|
|
1027
|
+
let resolve;
|
|
1028
|
+
let reject;
|
|
1029
|
+
const thenable = new Promise((_resolve, _reject) => {
|
|
1030
|
+
resolve = _resolve;
|
|
1031
|
+
reject = _reject;
|
|
1032
|
+
});
|
|
1033
|
+
thenable.status = "pending";
|
|
1034
|
+
thenable.catch(() => {
|
|
1035
|
+
});
|
|
1036
|
+
function finalize(data) {
|
|
1037
|
+
Object.assign(thenable, data);
|
|
1038
|
+
delete thenable.resolve;
|
|
1039
|
+
delete thenable.reject;
|
|
1040
|
+
}
|
|
1041
|
+
thenable.resolve = (value) => {
|
|
1042
|
+
finalize({
|
|
1043
|
+
status: "fulfilled",
|
|
1044
|
+
value
|
|
1045
|
+
});
|
|
1046
|
+
resolve(value);
|
|
1047
|
+
};
|
|
1048
|
+
thenable.reject = (reason) => {
|
|
1049
|
+
finalize({
|
|
1050
|
+
status: "rejected",
|
|
1051
|
+
reason
|
|
1052
|
+
});
|
|
1053
|
+
reject(reason);
|
|
1054
|
+
};
|
|
1055
|
+
return thenable;
|
|
1056
|
+
}
|
|
1057
|
+
function canFetch(networkMode) {
|
|
1058
|
+
return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true;
|
|
1059
|
+
}
|
|
1060
|
+
var defaultScheduler = (cb) => setTimeout(cb, 0);
|
|
1061
|
+
function createNotifyManager() {
|
|
1062
|
+
let queue = [];
|
|
1063
|
+
let transactions = 0;
|
|
1064
|
+
let notifyFn = (callback) => {
|
|
1065
|
+
callback();
|
|
1066
|
+
};
|
|
1067
|
+
let batchNotifyFn = (callback) => {
|
|
1068
|
+
callback();
|
|
1069
|
+
};
|
|
1070
|
+
let scheduleFn = defaultScheduler;
|
|
1071
|
+
const schedule = (callback) => {
|
|
1072
|
+
if (transactions) {
|
|
1073
|
+
queue.push(callback);
|
|
1074
|
+
} else {
|
|
1075
|
+
scheduleFn(() => {
|
|
1076
|
+
notifyFn(callback);
|
|
1077
|
+
});
|
|
1078
|
+
}
|
|
1079
|
+
};
|
|
1080
|
+
const flush = () => {
|
|
1081
|
+
const originalQueue = queue;
|
|
1082
|
+
queue = [];
|
|
1083
|
+
if (originalQueue.length) {
|
|
1084
|
+
scheduleFn(() => {
|
|
1085
|
+
batchNotifyFn(() => {
|
|
1086
|
+
originalQueue.forEach((callback) => {
|
|
1087
|
+
notifyFn(callback);
|
|
1088
|
+
});
|
|
1089
|
+
});
|
|
1090
|
+
});
|
|
1091
|
+
}
|
|
1092
|
+
};
|
|
1093
|
+
return {
|
|
1094
|
+
batch: (callback) => {
|
|
1095
|
+
let result;
|
|
1096
|
+
transactions++;
|
|
1097
|
+
try {
|
|
1098
|
+
result = callback();
|
|
1099
|
+
} finally {
|
|
1100
|
+
transactions--;
|
|
1101
|
+
if (!transactions) {
|
|
1102
|
+
flush();
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
return result;
|
|
1106
|
+
},
|
|
1107
|
+
/**
|
|
1108
|
+
* All calls to the wrapped function will be batched.
|
|
1109
|
+
*/
|
|
1110
|
+
batchCalls: (callback) => {
|
|
1111
|
+
return (...args) => {
|
|
1112
|
+
schedule(() => {
|
|
1113
|
+
callback(...args);
|
|
1114
|
+
});
|
|
1115
|
+
};
|
|
1116
|
+
},
|
|
1117
|
+
schedule,
|
|
1118
|
+
/**
|
|
1119
|
+
* Use this method to set a custom notify function.
|
|
1120
|
+
* This can be used to for example wrap notifications with `React.act` while running tests.
|
|
1121
|
+
*/
|
|
1122
|
+
setNotifyFunction: (fn) => {
|
|
1123
|
+
notifyFn = fn;
|
|
1124
|
+
},
|
|
1125
|
+
/**
|
|
1126
|
+
* Use this method to set a custom function to batch notifications together into a single tick.
|
|
1127
|
+
* By default React Query will use the batch function provided by ReactDOM or React Native.
|
|
1128
|
+
*/
|
|
1129
|
+
setBatchNotifyFunction: (fn) => {
|
|
1130
|
+
batchNotifyFn = fn;
|
|
1131
|
+
},
|
|
1132
|
+
setScheduler: (fn) => {
|
|
1133
|
+
scheduleFn = fn;
|
|
1134
|
+
}
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
var notifyManager = createNotifyManager();
|
|
1138
|
+
function fetchState(data, options) {
|
|
1139
|
+
return {
|
|
1140
|
+
fetchFailureCount: 0,
|
|
1141
|
+
fetchFailureReason: null,
|
|
1142
|
+
fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused",
|
|
1143
|
+
...data === void 0 && {
|
|
1144
|
+
error: null,
|
|
1145
|
+
status: "pending"
|
|
1146
|
+
}
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
var QueryObserver = (_c = class extends Subscribable {
|
|
1150
|
+
constructor(client, options) {
|
|
1151
|
+
super();
|
|
1152
|
+
__privateAdd(this, _QueryObserver_instances);
|
|
1153
|
+
__privateAdd(this, _client);
|
|
1154
|
+
__privateAdd(this, _currentQuery);
|
|
1155
|
+
__privateAdd(this, _currentQueryInitialState);
|
|
1156
|
+
__privateAdd(this, _currentResult);
|
|
1157
|
+
__privateAdd(this, _currentResultState);
|
|
1158
|
+
__privateAdd(this, _currentResultOptions);
|
|
1159
|
+
__privateAdd(this, _currentThenable);
|
|
1160
|
+
__privateAdd(this, _selectError);
|
|
1161
|
+
__privateAdd(this, _selectFn);
|
|
1162
|
+
__privateAdd(this, _selectResult);
|
|
1163
|
+
// This property keeps track of the last query with defined data.
|
|
1164
|
+
// It will be used to pass the previous data and query to the placeholder function between renders.
|
|
1165
|
+
__privateAdd(this, _lastQueryWithDefinedData);
|
|
1166
|
+
__privateAdd(this, _staleTimeoutId);
|
|
1167
|
+
__privateAdd(this, _refetchIntervalId);
|
|
1168
|
+
__privateAdd(this, _currentRefetchInterval);
|
|
1169
|
+
__privateAdd(this, _trackedProps, /* @__PURE__ */ new Set());
|
|
1170
|
+
this.options = options;
|
|
1171
|
+
__privateSet(this, _client, client);
|
|
1172
|
+
__privateSet(this, _selectError, null);
|
|
1173
|
+
__privateSet(this, _currentThenable, pendingThenable());
|
|
1174
|
+
this.bindMethods();
|
|
1175
|
+
this.setOptions(options);
|
|
1176
|
+
}
|
|
1177
|
+
bindMethods() {
|
|
1178
|
+
this.refetch = this.refetch.bind(this);
|
|
1179
|
+
}
|
|
1180
|
+
onSubscribe() {
|
|
1181
|
+
if (this.listeners.size === 1) {
|
|
1182
|
+
__privateGet(this, _currentQuery).addObserver(this);
|
|
1183
|
+
if (shouldFetchOnMount(__privateGet(this, _currentQuery), this.options)) {
|
|
1184
|
+
__privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this);
|
|
1185
|
+
} else {
|
|
1186
|
+
this.updateResult();
|
|
1187
|
+
}
|
|
1188
|
+
__privateMethod(this, _QueryObserver_instances, updateTimers_fn).call(this);
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
onUnsubscribe() {
|
|
1192
|
+
if (!this.hasListeners()) {
|
|
1193
|
+
this.destroy();
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
shouldFetchOnReconnect() {
|
|
1197
|
+
return shouldFetchOn(
|
|
1198
|
+
__privateGet(this, _currentQuery),
|
|
1199
|
+
this.options,
|
|
1200
|
+
this.options.refetchOnReconnect
|
|
1201
|
+
);
|
|
1202
|
+
}
|
|
1203
|
+
shouldFetchOnWindowFocus() {
|
|
1204
|
+
return shouldFetchOn(
|
|
1205
|
+
__privateGet(this, _currentQuery),
|
|
1206
|
+
this.options,
|
|
1207
|
+
this.options.refetchOnWindowFocus
|
|
1208
|
+
);
|
|
1209
|
+
}
|
|
1210
|
+
destroy() {
|
|
1211
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
1212
|
+
__privateMethod(this, _QueryObserver_instances, clearStaleTimeout_fn).call(this);
|
|
1213
|
+
__privateMethod(this, _QueryObserver_instances, clearRefetchInterval_fn).call(this);
|
|
1214
|
+
__privateGet(this, _currentQuery).removeObserver(this);
|
|
1215
|
+
}
|
|
1216
|
+
setOptions(options) {
|
|
1217
|
+
const prevOptions = this.options;
|
|
1218
|
+
const prevQuery = __privateGet(this, _currentQuery);
|
|
1219
|
+
this.options = __privateGet(this, _client).defaultQueryOptions(options);
|
|
1220
|
+
if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== "boolean") {
|
|
1221
|
+
throw new Error(
|
|
1222
|
+
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
1223
|
+
);
|
|
1224
|
+
}
|
|
1225
|
+
__privateMethod(this, _QueryObserver_instances, updateQuery_fn).call(this);
|
|
1226
|
+
__privateGet(this, _currentQuery).setOptions(this.options);
|
|
1227
|
+
if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) {
|
|
1228
|
+
__privateGet(this, _client).getQueryCache().notify({
|
|
1229
|
+
type: "observerOptionsUpdated",
|
|
1230
|
+
query: __privateGet(this, _currentQuery),
|
|
1231
|
+
observer: this
|
|
1232
|
+
});
|
|
1233
|
+
}
|
|
1234
|
+
const mounted = this.hasListeners();
|
|
1235
|
+
if (mounted && shouldFetchOptionally(
|
|
1236
|
+
__privateGet(this, _currentQuery),
|
|
1237
|
+
prevQuery,
|
|
1238
|
+
this.options,
|
|
1239
|
+
prevOptions
|
|
1240
|
+
)) {
|
|
1241
|
+
__privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this);
|
|
1242
|
+
}
|
|
1243
|
+
this.updateResult();
|
|
1244
|
+
if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== resolveEnabled(prevOptions.enabled, __privateGet(this, _currentQuery)) || resolveStaleTime(this.options.staleTime, __privateGet(this, _currentQuery)) !== resolveStaleTime(prevOptions.staleTime, __privateGet(this, _currentQuery)))) {
|
|
1245
|
+
__privateMethod(this, _QueryObserver_instances, updateStaleTimeout_fn).call(this);
|
|
1246
|
+
}
|
|
1247
|
+
const nextRefetchInterval = __privateMethod(this, _QueryObserver_instances, computeRefetchInterval_fn).call(this);
|
|
1248
|
+
if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== resolveEnabled(prevOptions.enabled, __privateGet(this, _currentQuery)) || nextRefetchInterval !== __privateGet(this, _currentRefetchInterval))) {
|
|
1249
|
+
__privateMethod(this, _QueryObserver_instances, updateRefetchInterval_fn).call(this, nextRefetchInterval);
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
getOptimisticResult(options) {
|
|
1253
|
+
const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), options);
|
|
1254
|
+
const result = this.createResult(query, options);
|
|
1255
|
+
if (shouldAssignObserverCurrentProperties(this, result)) {
|
|
1256
|
+
__privateSet(this, _currentResult, result);
|
|
1257
|
+
__privateSet(this, _currentResultOptions, this.options);
|
|
1258
|
+
__privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state);
|
|
1259
|
+
}
|
|
1260
|
+
return result;
|
|
1261
|
+
}
|
|
1262
|
+
getCurrentResult() {
|
|
1263
|
+
return __privateGet(this, _currentResult);
|
|
1264
|
+
}
|
|
1265
|
+
trackResult(result, onPropTracked) {
|
|
1266
|
+
return new Proxy(result, {
|
|
1267
|
+
get: (target, key) => {
|
|
1268
|
+
this.trackProp(key);
|
|
1269
|
+
onPropTracked == null ? void 0 : onPropTracked(key);
|
|
1270
|
+
if (key === "promise" && !this.options.experimental_prefetchInRender && __privateGet(this, _currentThenable).status === "pending") {
|
|
1271
|
+
__privateGet(this, _currentThenable).reject(
|
|
1272
|
+
new Error(
|
|
1273
|
+
"experimental_prefetchInRender feature flag is not enabled"
|
|
1274
|
+
)
|
|
1275
|
+
);
|
|
1276
|
+
}
|
|
1277
|
+
return Reflect.get(target, key);
|
|
1278
|
+
}
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1281
|
+
trackProp(key) {
|
|
1282
|
+
__privateGet(this, _trackedProps).add(key);
|
|
1283
|
+
}
|
|
1284
|
+
getCurrentQuery() {
|
|
1285
|
+
return __privateGet(this, _currentQuery);
|
|
1286
|
+
}
|
|
1287
|
+
refetch({ ...options } = {}) {
|
|
1288
|
+
return this.fetch({
|
|
1289
|
+
...options
|
|
1290
|
+
});
|
|
1291
|
+
}
|
|
1292
|
+
fetchOptimistic(options) {
|
|
1293
|
+
const defaultedOptions = __privateGet(this, _client).defaultQueryOptions(options);
|
|
1294
|
+
const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), defaultedOptions);
|
|
1295
|
+
return query.fetch().then(() => this.createResult(query, defaultedOptions));
|
|
1296
|
+
}
|
|
1297
|
+
fetch(fetchOptions) {
|
|
1298
|
+
return __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this, {
|
|
1299
|
+
...fetchOptions,
|
|
1300
|
+
cancelRefetch: fetchOptions.cancelRefetch ?? true
|
|
1301
|
+
}).then(() => {
|
|
1302
|
+
this.updateResult();
|
|
1303
|
+
return __privateGet(this, _currentResult);
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1306
|
+
createResult(query, options) {
|
|
1307
|
+
var _a2;
|
|
1308
|
+
const prevQuery = __privateGet(this, _currentQuery);
|
|
1309
|
+
const prevOptions = this.options;
|
|
1310
|
+
const prevResult = __privateGet(this, _currentResult);
|
|
1311
|
+
const prevResultState = __privateGet(this, _currentResultState);
|
|
1312
|
+
const prevResultOptions = __privateGet(this, _currentResultOptions);
|
|
1313
|
+
const queryChange = query !== prevQuery;
|
|
1314
|
+
const queryInitialState = queryChange ? query.state : __privateGet(this, _currentQueryInitialState);
|
|
1315
|
+
const { state } = query;
|
|
1316
|
+
let newState = { ...state };
|
|
1317
|
+
let isPlaceholderData = false;
|
|
1318
|
+
let data;
|
|
1319
|
+
if (options._optimisticResults) {
|
|
1320
|
+
const mounted = this.hasListeners();
|
|
1321
|
+
const fetchOnMount = !mounted && shouldFetchOnMount(query, options);
|
|
1322
|
+
const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);
|
|
1323
|
+
if (fetchOnMount || fetchOptionally) {
|
|
1324
|
+
newState = {
|
|
1325
|
+
...newState,
|
|
1326
|
+
...fetchState(state.data, query.options)
|
|
1327
|
+
};
|
|
1328
|
+
}
|
|
1329
|
+
if (options._optimisticResults === "isRestoring") {
|
|
1330
|
+
newState.fetchStatus = "idle";
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
let { error, errorUpdatedAt, status } = newState;
|
|
1334
|
+
data = newState.data;
|
|
1335
|
+
let skipSelect = false;
|
|
1336
|
+
if (options.placeholderData !== void 0 && data === void 0 && status === "pending") {
|
|
1337
|
+
let placeholderData;
|
|
1338
|
+
if ((prevResult == null ? void 0 : prevResult.isPlaceholderData) && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) {
|
|
1339
|
+
placeholderData = prevResult.data;
|
|
1340
|
+
skipSelect = true;
|
|
1341
|
+
} else {
|
|
1342
|
+
placeholderData = typeof options.placeholderData === "function" ? options.placeholderData(
|
|
1343
|
+
(_a2 = __privateGet(this, _lastQueryWithDefinedData)) == null ? void 0 : _a2.state.data,
|
|
1344
|
+
__privateGet(this, _lastQueryWithDefinedData)
|
|
1345
|
+
) : options.placeholderData;
|
|
1346
|
+
}
|
|
1347
|
+
if (placeholderData !== void 0) {
|
|
1348
|
+
status = "success";
|
|
1349
|
+
data = replaceData(
|
|
1350
|
+
prevResult == null ? void 0 : prevResult.data,
|
|
1351
|
+
placeholderData,
|
|
1352
|
+
options
|
|
1353
|
+
);
|
|
1354
|
+
isPlaceholderData = true;
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
if (options.select && data !== void 0 && !skipSelect) {
|
|
1358
|
+
if (prevResult && data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === __privateGet(this, _selectFn)) {
|
|
1359
|
+
data = __privateGet(this, _selectResult);
|
|
1360
|
+
} else {
|
|
1361
|
+
try {
|
|
1362
|
+
__privateSet(this, _selectFn, options.select);
|
|
1363
|
+
data = options.select(data);
|
|
1364
|
+
data = replaceData(prevResult == null ? void 0 : prevResult.data, data, options);
|
|
1365
|
+
__privateSet(this, _selectResult, data);
|
|
1366
|
+
__privateSet(this, _selectError, null);
|
|
1367
|
+
} catch (selectError) {
|
|
1368
|
+
__privateSet(this, _selectError, selectError);
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
if (__privateGet(this, _selectError)) {
|
|
1373
|
+
error = __privateGet(this, _selectError);
|
|
1374
|
+
data = __privateGet(this, _selectResult);
|
|
1375
|
+
errorUpdatedAt = Date.now();
|
|
1376
|
+
status = "error";
|
|
1377
|
+
}
|
|
1378
|
+
const isFetching = newState.fetchStatus === "fetching";
|
|
1379
|
+
const isPending = status === "pending";
|
|
1380
|
+
const isError = status === "error";
|
|
1381
|
+
const isLoading = isPending && isFetching;
|
|
1382
|
+
const hasData = data !== void 0;
|
|
1383
|
+
const result = {
|
|
1384
|
+
status,
|
|
1385
|
+
fetchStatus: newState.fetchStatus,
|
|
1386
|
+
isPending,
|
|
1387
|
+
isSuccess: status === "success",
|
|
1388
|
+
isError,
|
|
1389
|
+
isInitialLoading: isLoading,
|
|
1390
|
+
isLoading,
|
|
1391
|
+
data,
|
|
1392
|
+
dataUpdatedAt: newState.dataUpdatedAt,
|
|
1393
|
+
error,
|
|
1394
|
+
errorUpdatedAt,
|
|
1395
|
+
failureCount: newState.fetchFailureCount,
|
|
1396
|
+
failureReason: newState.fetchFailureReason,
|
|
1397
|
+
errorUpdateCount: newState.errorUpdateCount,
|
|
1398
|
+
isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,
|
|
1399
|
+
isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,
|
|
1400
|
+
isFetching,
|
|
1401
|
+
isRefetching: isFetching && !isPending,
|
|
1402
|
+
isLoadingError: isError && !hasData,
|
|
1403
|
+
isPaused: newState.fetchStatus === "paused",
|
|
1404
|
+
isPlaceholderData,
|
|
1405
|
+
isRefetchError: isError && hasData,
|
|
1406
|
+
isStale: isStale(query, options),
|
|
1407
|
+
refetch: this.refetch,
|
|
1408
|
+
promise: __privateGet(this, _currentThenable),
|
|
1409
|
+
isEnabled: resolveEnabled(options.enabled, query) !== false
|
|
1410
|
+
};
|
|
1411
|
+
const nextResult = result;
|
|
1412
|
+
if (this.options.experimental_prefetchInRender) {
|
|
1413
|
+
const finalizeThenableIfPossible = (thenable) => {
|
|
1414
|
+
if (nextResult.status === "error") {
|
|
1415
|
+
thenable.reject(nextResult.error);
|
|
1416
|
+
} else if (nextResult.data !== void 0) {
|
|
1417
|
+
thenable.resolve(nextResult.data);
|
|
1418
|
+
}
|
|
1419
|
+
};
|
|
1420
|
+
const recreateThenable = () => {
|
|
1421
|
+
const pending = __privateSet(this, _currentThenable, nextResult.promise = pendingThenable());
|
|
1422
|
+
finalizeThenableIfPossible(pending);
|
|
1423
|
+
};
|
|
1424
|
+
const prevThenable = __privateGet(this, _currentThenable);
|
|
1425
|
+
switch (prevThenable.status) {
|
|
1426
|
+
case "pending":
|
|
1427
|
+
if (query.queryHash === prevQuery.queryHash) {
|
|
1428
|
+
finalizeThenableIfPossible(prevThenable);
|
|
1429
|
+
}
|
|
1430
|
+
break;
|
|
1431
|
+
case "fulfilled":
|
|
1432
|
+
if (nextResult.status === "error" || nextResult.data !== prevThenable.value) {
|
|
1433
|
+
recreateThenable();
|
|
1434
|
+
}
|
|
1435
|
+
break;
|
|
1436
|
+
case "rejected":
|
|
1437
|
+
if (nextResult.status !== "error" || nextResult.error !== prevThenable.reason) {
|
|
1438
|
+
recreateThenable();
|
|
1439
|
+
}
|
|
1440
|
+
break;
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
return nextResult;
|
|
1444
|
+
}
|
|
1445
|
+
updateResult() {
|
|
1446
|
+
const prevResult = __privateGet(this, _currentResult);
|
|
1447
|
+
const nextResult = this.createResult(__privateGet(this, _currentQuery), this.options);
|
|
1448
|
+
__privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state);
|
|
1449
|
+
__privateSet(this, _currentResultOptions, this.options);
|
|
1450
|
+
if (__privateGet(this, _currentResultState).data !== void 0) {
|
|
1451
|
+
__privateSet(this, _lastQueryWithDefinedData, __privateGet(this, _currentQuery));
|
|
1452
|
+
}
|
|
1453
|
+
if (shallowEqualObjects(nextResult, prevResult)) {
|
|
1454
|
+
return;
|
|
1455
|
+
}
|
|
1456
|
+
__privateSet(this, _currentResult, nextResult);
|
|
1457
|
+
const shouldNotifyListeners = () => {
|
|
1458
|
+
if (!prevResult) {
|
|
1459
|
+
return true;
|
|
1460
|
+
}
|
|
1461
|
+
const { notifyOnChangeProps } = this.options;
|
|
1462
|
+
const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps;
|
|
1463
|
+
if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !__privateGet(this, _trackedProps).size) {
|
|
1464
|
+
return true;
|
|
1465
|
+
}
|
|
1466
|
+
const includedProps = new Set(
|
|
1467
|
+
notifyOnChangePropsValue ?? __privateGet(this, _trackedProps)
|
|
1468
|
+
);
|
|
1469
|
+
if (this.options.throwOnError) {
|
|
1470
|
+
includedProps.add("error");
|
|
1471
|
+
}
|
|
1472
|
+
return Object.keys(__privateGet(this, _currentResult)).some((key) => {
|
|
1473
|
+
const typedKey = key;
|
|
1474
|
+
const changed = __privateGet(this, _currentResult)[typedKey] !== prevResult[typedKey];
|
|
1475
|
+
return changed && includedProps.has(typedKey);
|
|
1476
|
+
});
|
|
1477
|
+
};
|
|
1478
|
+
__privateMethod(this, _QueryObserver_instances, notify_fn).call(this, { listeners: shouldNotifyListeners() });
|
|
1479
|
+
}
|
|
1480
|
+
onQueryUpdate() {
|
|
1481
|
+
this.updateResult();
|
|
1482
|
+
if (this.hasListeners()) {
|
|
1483
|
+
__privateMethod(this, _QueryObserver_instances, updateTimers_fn).call(this);
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
}, _client = new WeakMap(), _currentQuery = new WeakMap(), _currentQueryInitialState = new WeakMap(), _currentResult = new WeakMap(), _currentResultState = new WeakMap(), _currentResultOptions = new WeakMap(), _currentThenable = new WeakMap(), _selectError = new WeakMap(), _selectFn = new WeakMap(), _selectResult = new WeakMap(), _lastQueryWithDefinedData = new WeakMap(), _staleTimeoutId = new WeakMap(), _refetchIntervalId = new WeakMap(), _currentRefetchInterval = new WeakMap(), _trackedProps = new WeakMap(), _QueryObserver_instances = new WeakSet(), executeFetch_fn = function(fetchOptions) {
|
|
1487
|
+
__privateMethod(this, _QueryObserver_instances, updateQuery_fn).call(this);
|
|
1488
|
+
let promise = __privateGet(this, _currentQuery).fetch(
|
|
1489
|
+
this.options,
|
|
1490
|
+
fetchOptions
|
|
1491
|
+
);
|
|
1492
|
+
if (!(fetchOptions == null ? void 0 : fetchOptions.throwOnError)) {
|
|
1493
|
+
promise = promise.catch(noop);
|
|
1494
|
+
}
|
|
1495
|
+
return promise;
|
|
1496
|
+
}, updateStaleTimeout_fn = function() {
|
|
1497
|
+
__privateMethod(this, _QueryObserver_instances, clearStaleTimeout_fn).call(this);
|
|
1498
|
+
const staleTime = resolveStaleTime(
|
|
1499
|
+
this.options.staleTime,
|
|
1500
|
+
__privateGet(this, _currentQuery)
|
|
1501
|
+
);
|
|
1502
|
+
if (isServer || __privateGet(this, _currentResult).isStale || !isValidTimeout(staleTime)) {
|
|
1503
|
+
return;
|
|
1504
|
+
}
|
|
1505
|
+
const time = timeUntilStale(__privateGet(this, _currentResult).dataUpdatedAt, staleTime);
|
|
1506
|
+
const timeout = time + 1;
|
|
1507
|
+
__privateSet(this, _staleTimeoutId, setTimeout(() => {
|
|
1508
|
+
if (!__privateGet(this, _currentResult).isStale) {
|
|
1509
|
+
this.updateResult();
|
|
1510
|
+
}
|
|
1511
|
+
}, timeout));
|
|
1512
|
+
}, computeRefetchInterval_fn = function() {
|
|
1513
|
+
return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(__privateGet(this, _currentQuery)) : this.options.refetchInterval) ?? false;
|
|
1514
|
+
}, updateRefetchInterval_fn = function(nextInterval) {
|
|
1515
|
+
__privateMethod(this, _QueryObserver_instances, clearRefetchInterval_fn).call(this);
|
|
1516
|
+
__privateSet(this, _currentRefetchInterval, nextInterval);
|
|
1517
|
+
if (isServer || resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) === false || !isValidTimeout(__privateGet(this, _currentRefetchInterval)) || __privateGet(this, _currentRefetchInterval) === 0) {
|
|
1518
|
+
return;
|
|
1519
|
+
}
|
|
1520
|
+
__privateSet(this, _refetchIntervalId, setInterval(() => {
|
|
1521
|
+
if (this.options.refetchIntervalInBackground || focusManager.isFocused()) {
|
|
1522
|
+
__privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this);
|
|
1523
|
+
}
|
|
1524
|
+
}, __privateGet(this, _currentRefetchInterval)));
|
|
1525
|
+
}, updateTimers_fn = function() {
|
|
1526
|
+
__privateMethod(this, _QueryObserver_instances, updateStaleTimeout_fn).call(this);
|
|
1527
|
+
__privateMethod(this, _QueryObserver_instances, updateRefetchInterval_fn).call(this, __privateMethod(this, _QueryObserver_instances, computeRefetchInterval_fn).call(this));
|
|
1528
|
+
}, clearStaleTimeout_fn = function() {
|
|
1529
|
+
if (__privateGet(this, _staleTimeoutId)) {
|
|
1530
|
+
clearTimeout(__privateGet(this, _staleTimeoutId));
|
|
1531
|
+
__privateSet(this, _staleTimeoutId, void 0);
|
|
1532
|
+
}
|
|
1533
|
+
}, clearRefetchInterval_fn = function() {
|
|
1534
|
+
if (__privateGet(this, _refetchIntervalId)) {
|
|
1535
|
+
clearInterval(__privateGet(this, _refetchIntervalId));
|
|
1536
|
+
__privateSet(this, _refetchIntervalId, void 0);
|
|
1537
|
+
}
|
|
1538
|
+
}, updateQuery_fn = function() {
|
|
1539
|
+
const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), this.options);
|
|
1540
|
+
if (query === __privateGet(this, _currentQuery)) {
|
|
1541
|
+
return;
|
|
1542
|
+
}
|
|
1543
|
+
const prevQuery = __privateGet(this, _currentQuery);
|
|
1544
|
+
__privateSet(this, _currentQuery, query);
|
|
1545
|
+
__privateSet(this, _currentQueryInitialState, query.state);
|
|
1546
|
+
if (this.hasListeners()) {
|
|
1547
|
+
prevQuery == null ? void 0 : prevQuery.removeObserver(this);
|
|
1548
|
+
query.addObserver(this);
|
|
1549
|
+
}
|
|
1550
|
+
}, notify_fn = function(notifyOptions) {
|
|
1551
|
+
notifyManager.batch(() => {
|
|
1552
|
+
if (notifyOptions.listeners) {
|
|
1553
|
+
this.listeners.forEach((listener) => {
|
|
1554
|
+
listener(__privateGet(this, _currentResult));
|
|
1555
|
+
});
|
|
1556
|
+
}
|
|
1557
|
+
__privateGet(this, _client).getQueryCache().notify({
|
|
1558
|
+
query: __privateGet(this, _currentQuery),
|
|
1559
|
+
type: "observerResultsUpdated"
|
|
1560
|
+
});
|
|
1561
|
+
});
|
|
1562
|
+
}, _c);
|
|
1563
|
+
function shouldLoadOnMount(query, options) {
|
|
1564
|
+
return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false);
|
|
1565
|
+
}
|
|
1566
|
+
function shouldFetchOnMount(query, options) {
|
|
1567
|
+
return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);
|
|
1568
|
+
}
|
|
1569
|
+
function shouldFetchOn(query, options, field) {
|
|
1570
|
+
if (resolveEnabled(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== "static") {
|
|
1571
|
+
const value = typeof field === "function" ? field(query) : field;
|
|
1572
|
+
return value === "always" || value !== false && isStale(query, options);
|
|
1573
|
+
}
|
|
1574
|
+
return false;
|
|
1575
|
+
}
|
|
1576
|
+
function shouldFetchOptionally(query, prevQuery, options, prevOptions) {
|
|
1577
|
+
return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options);
|
|
1578
|
+
}
|
|
1579
|
+
function isStale(query, options) {
|
|
1580
|
+
return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query));
|
|
1581
|
+
}
|
|
1582
|
+
function shouldAssignObserverCurrentProperties(observer, optimisticResult) {
|
|
1583
|
+
if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {
|
|
1584
|
+
return true;
|
|
1585
|
+
}
|
|
1586
|
+
return false;
|
|
1587
|
+
}
|
|
1588
|
+
var jsxRuntime = { exports: {} };
|
|
1589
|
+
var reactJsxRuntime_production = {};
|
|
1590
|
+
/**
|
|
1591
|
+
* @license React
|
|
1592
|
+
* react-jsx-runtime.production.js
|
|
1593
|
+
*
|
|
1594
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1595
|
+
*
|
|
1596
|
+
* This source code is licensed under the MIT license found in the
|
|
1597
|
+
* LICENSE file in the root directory of this source tree.
|
|
1598
|
+
*/
|
|
1599
|
+
var hasRequiredReactJsxRuntime_production;
|
|
1600
|
+
function requireReactJsxRuntime_production() {
|
|
1601
|
+
if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
|
|
1602
|
+
hasRequiredReactJsxRuntime_production = 1;
|
|
1603
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
1604
|
+
function jsxProd(type, config, maybeKey) {
|
|
1605
|
+
var key = null;
|
|
1606
|
+
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
1607
|
+
void 0 !== config.key && (key = "" + config.key);
|
|
1608
|
+
if ("key" in config) {
|
|
1609
|
+
maybeKey = {};
|
|
1610
|
+
for (var propName in config)
|
|
1611
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
1612
|
+
} else maybeKey = config;
|
|
1613
|
+
config = maybeKey.ref;
|
|
1614
|
+
return {
|
|
1615
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
1616
|
+
type,
|
|
1617
|
+
key,
|
|
1618
|
+
ref: void 0 !== config ? config : null,
|
|
1619
|
+
props: maybeKey
|
|
1620
|
+
};
|
|
1621
|
+
}
|
|
1622
|
+
reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
|
|
1623
|
+
reactJsxRuntime_production.jsx = jsxProd;
|
|
1624
|
+
reactJsxRuntime_production.jsxs = jsxProd;
|
|
1625
|
+
return reactJsxRuntime_production;
|
|
1626
|
+
}
|
|
1627
|
+
var hasRequiredJsxRuntime;
|
|
1628
|
+
function requireJsxRuntime() {
|
|
1629
|
+
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
|
|
1630
|
+
hasRequiredJsxRuntime = 1;
|
|
1631
|
+
{
|
|
1632
|
+
jsxRuntime.exports = requireReactJsxRuntime_production();
|
|
1633
|
+
}
|
|
1634
|
+
return jsxRuntime.exports;
|
|
1635
|
+
}
|
|
1636
|
+
var jsxRuntimeExports = requireJsxRuntime();
|
|
1637
|
+
const React$4 = window["React"];
|
|
1638
|
+
var QueryClientContext = React$4.createContext(
|
|
1639
|
+
void 0
|
|
1640
|
+
);
|
|
1641
|
+
var useQueryClient = (queryClient) => {
|
|
1642
|
+
const client = React$4.useContext(QueryClientContext);
|
|
1643
|
+
if (queryClient) {
|
|
1644
|
+
return queryClient;
|
|
1645
|
+
}
|
|
1646
|
+
if (!client) {
|
|
1647
|
+
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
1648
|
+
}
|
|
1649
|
+
return client;
|
|
1650
|
+
};
|
|
1651
|
+
const React$3 = window["React"];
|
|
1652
|
+
var IsRestoringContext = React$3.createContext(false);
|
|
1653
|
+
var useIsRestoring = () => React$3.useContext(IsRestoringContext);
|
|
1654
|
+
IsRestoringContext.Provider;
|
|
1655
|
+
const React$2 = window["React"];
|
|
1656
|
+
function createValue() {
|
|
1657
|
+
let isReset = false;
|
|
1658
|
+
return {
|
|
1659
|
+
clearReset: () => {
|
|
1660
|
+
isReset = false;
|
|
1661
|
+
},
|
|
1662
|
+
reset: () => {
|
|
1663
|
+
isReset = true;
|
|
1664
|
+
},
|
|
1665
|
+
isReset: () => {
|
|
1666
|
+
return isReset;
|
|
1667
|
+
}
|
|
1668
|
+
};
|
|
1669
|
+
}
|
|
1670
|
+
var QueryErrorResetBoundaryContext = React$2.createContext(createValue());
|
|
1671
|
+
var useQueryErrorResetBoundary = () => React$2.useContext(QueryErrorResetBoundaryContext);
|
|
1672
|
+
const React$1 = window["React"];
|
|
1673
|
+
var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {
|
|
1674
|
+
if (options.suspense || options.throwOnError || options.experimental_prefetchInRender) {
|
|
1675
|
+
if (!errorResetBoundary.isReset()) {
|
|
1676
|
+
options.retryOnMount = false;
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
};
|
|
1680
|
+
var useClearResetErrorBoundary = (errorResetBoundary) => {
|
|
1681
|
+
React$1.useEffect(() => {
|
|
1682
|
+
errorResetBoundary.clearReset();
|
|
1683
|
+
}, [errorResetBoundary]);
|
|
1684
|
+
};
|
|
1685
|
+
var getHasError = ({
|
|
1686
|
+
result,
|
|
1687
|
+
errorResetBoundary,
|
|
1688
|
+
throwOnError,
|
|
1689
|
+
query,
|
|
1690
|
+
suspense
|
|
1691
|
+
}) => {
|
|
1692
|
+
return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query]));
|
|
1693
|
+
};
|
|
1694
|
+
var ensureSuspenseTimers = (defaultedOptions) => {
|
|
1695
|
+
if (defaultedOptions.suspense) {
|
|
1696
|
+
const MIN_SUSPENSE_TIME_MS = 1e3;
|
|
1697
|
+
const clamp = (value) => value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS);
|
|
1698
|
+
const originalStaleTime = defaultedOptions.staleTime;
|
|
1699
|
+
defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime);
|
|
1700
|
+
if (typeof defaultedOptions.gcTime === "number") {
|
|
1701
|
+
defaultedOptions.gcTime = Math.max(
|
|
1702
|
+
defaultedOptions.gcTime,
|
|
1703
|
+
MIN_SUSPENSE_TIME_MS
|
|
1704
|
+
);
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
};
|
|
1708
|
+
var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;
|
|
1709
|
+
var shouldSuspend = (defaultedOptions, result) => (defaultedOptions == null ? void 0 : defaultedOptions.suspense) && result.isPending;
|
|
1710
|
+
var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {
|
|
1711
|
+
errorResetBoundary.clearReset();
|
|
1712
|
+
});
|
|
1713
|
+
const React = window["React"];
|
|
1714
|
+
function useBaseQuery(options, Observer, queryClient) {
|
|
1715
|
+
var _a2, _b2, _c2, _d, _e;
|
|
1716
|
+
const isRestoring = useIsRestoring();
|
|
1717
|
+
const errorResetBoundary = useQueryErrorResetBoundary();
|
|
1718
|
+
const client = useQueryClient(queryClient);
|
|
1719
|
+
const defaultedOptions = client.defaultQueryOptions(options);
|
|
1720
|
+
(_b2 = (_a2 = client.getDefaultOptions().queries) == null ? void 0 : _a2._experimental_beforeQuery) == null ? void 0 : _b2.call(
|
|
1721
|
+
_a2,
|
|
1722
|
+
defaultedOptions
|
|
1723
|
+
);
|
|
1724
|
+
defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic";
|
|
1725
|
+
ensureSuspenseTimers(defaultedOptions);
|
|
1726
|
+
ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary);
|
|
1727
|
+
useClearResetErrorBoundary(errorResetBoundary);
|
|
1728
|
+
const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash);
|
|
1729
|
+
const [observer] = React.useState(
|
|
1730
|
+
() => new Observer(
|
|
1731
|
+
client,
|
|
1732
|
+
defaultedOptions
|
|
1733
|
+
)
|
|
1734
|
+
);
|
|
1735
|
+
const result = observer.getOptimisticResult(defaultedOptions);
|
|
1736
|
+
const shouldSubscribe = !isRestoring && options.subscribed !== false;
|
|
1737
|
+
React.useSyncExternalStore(
|
|
1738
|
+
React.useCallback(
|
|
1739
|
+
(onStoreChange) => {
|
|
1740
|
+
const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop;
|
|
1741
|
+
observer.updateResult();
|
|
1742
|
+
return unsubscribe;
|
|
1743
|
+
},
|
|
1744
|
+
[observer, shouldSubscribe]
|
|
1745
|
+
),
|
|
1746
|
+
() => observer.getCurrentResult(),
|
|
1747
|
+
() => observer.getCurrentResult()
|
|
1748
|
+
);
|
|
1749
|
+
React.useEffect(() => {
|
|
1750
|
+
observer.setOptions(defaultedOptions);
|
|
1751
|
+
}, [defaultedOptions, observer]);
|
|
1752
|
+
if (shouldSuspend(defaultedOptions, result)) {
|
|
1753
|
+
throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);
|
|
1754
|
+
}
|
|
1755
|
+
if (getHasError({
|
|
1756
|
+
result,
|
|
1757
|
+
errorResetBoundary,
|
|
1758
|
+
throwOnError: defaultedOptions.throwOnError,
|
|
1759
|
+
query: client.getQueryCache().get(defaultedOptions.queryHash),
|
|
1760
|
+
suspense: defaultedOptions.suspense
|
|
1761
|
+
})) {
|
|
1762
|
+
throw result.error;
|
|
1763
|
+
}
|
|
1764
|
+
(_d = (_c2 = client.getDefaultOptions().queries) == null ? void 0 : _c2._experimental_afterQuery) == null ? void 0 : _d.call(
|
|
1765
|
+
_c2,
|
|
1766
|
+
defaultedOptions,
|
|
1767
|
+
result
|
|
1768
|
+
);
|
|
1769
|
+
if (defaultedOptions.experimental_prefetchInRender && !isServer && willFetch(result, isRestoring)) {
|
|
1770
|
+
const promise = isNewCacheEntry ? (
|
|
1771
|
+
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
1772
|
+
fetchOptimistic(defaultedOptions, observer, errorResetBoundary)
|
|
1773
|
+
) : (
|
|
1774
|
+
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
1775
|
+
(_e = client.getQueryCache().get(defaultedOptions.queryHash)) == null ? void 0 : _e.promise
|
|
1776
|
+
);
|
|
1777
|
+
promise == null ? void 0 : promise.catch(noop).finally(() => {
|
|
1778
|
+
observer.updateResult();
|
|
1779
|
+
});
|
|
1780
|
+
}
|
|
1781
|
+
return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;
|
|
1782
|
+
}
|
|
1783
|
+
function useQuery(options, queryClient) {
|
|
1784
|
+
return useBaseQuery(options, QueryObserver, queryClient);
|
|
1785
|
+
}
|
|
1786
|
+
const useRef$4 = window["React"].useRef;
|
|
1787
|
+
const useEffect$7 = window["React"].useEffect;
|
|
1788
|
+
const useMemo$2 = window["React"].useMemo;
|
|
1789
|
+
function useCallbackRef(callback) {
|
|
1790
|
+
const callbackRef = useRef$4(callback);
|
|
1791
|
+
useEffect$7(() => {
|
|
1792
|
+
callbackRef.current = callback;
|
|
1793
|
+
});
|
|
1794
|
+
return useMemo$2(() => (...args) => {
|
|
1795
|
+
var _a2;
|
|
1796
|
+
return (_a2 = callbackRef.current) == null ? void 0 : _a2.call(callbackRef, ...args);
|
|
1797
|
+
}, []);
|
|
1798
|
+
}
|
|
1799
|
+
const useRef$3 = window["React"].useRef;
|
|
1800
|
+
const useMemo$1 = window["React"].useMemo;
|
|
1801
|
+
const useEffect$6 = window["React"].useEffect;
|
|
1802
|
+
function useDebouncedCallback(callback, options) {
|
|
1803
|
+
const { delay, flushOnUnmount, leading } = { delay: options, flushOnUnmount: false, leading: false };
|
|
1804
|
+
const handleCallback = useCallbackRef(callback);
|
|
1805
|
+
const debounceTimerRef = useRef$3(0);
|
|
1806
|
+
const lastCallback = useMemo$1(() => {
|
|
1807
|
+
const currentCallback = Object.assign(
|
|
1808
|
+
(...args) => {
|
|
1809
|
+
window.clearTimeout(debounceTimerRef.current);
|
|
1810
|
+
const isFirstCall = currentCallback._isFirstCall;
|
|
1811
|
+
currentCallback._isFirstCall = false;
|
|
1812
|
+
function clearTimeoutAndLeadingRef() {
|
|
1813
|
+
window.clearTimeout(debounceTimerRef.current);
|
|
1814
|
+
debounceTimerRef.current = 0;
|
|
1815
|
+
currentCallback._isFirstCall = true;
|
|
1816
|
+
}
|
|
1817
|
+
if (leading && isFirstCall) {
|
|
1818
|
+
handleCallback(...args);
|
|
1819
|
+
const resetLeadingState = () => {
|
|
1820
|
+
clearTimeoutAndLeadingRef();
|
|
1821
|
+
};
|
|
1822
|
+
const flush2 = () => {
|
|
1823
|
+
if (debounceTimerRef.current !== 0) {
|
|
1824
|
+
clearTimeoutAndLeadingRef();
|
|
1825
|
+
handleCallback(...args);
|
|
1826
|
+
}
|
|
1827
|
+
};
|
|
1828
|
+
const cancel2 = () => {
|
|
1829
|
+
clearTimeoutAndLeadingRef();
|
|
1830
|
+
};
|
|
1831
|
+
currentCallback.flush = flush2;
|
|
1832
|
+
currentCallback.cancel = cancel2;
|
|
1833
|
+
debounceTimerRef.current = window.setTimeout(resetLeadingState, delay);
|
|
1834
|
+
return;
|
|
1835
|
+
}
|
|
1836
|
+
if (leading && !isFirstCall) {
|
|
1837
|
+
const flush2 = () => {
|
|
1838
|
+
if (debounceTimerRef.current !== 0) {
|
|
1839
|
+
clearTimeoutAndLeadingRef();
|
|
1840
|
+
handleCallback(...args);
|
|
1841
|
+
}
|
|
1842
|
+
};
|
|
1843
|
+
const cancel2 = () => {
|
|
1844
|
+
clearTimeoutAndLeadingRef();
|
|
1845
|
+
};
|
|
1846
|
+
currentCallback.flush = flush2;
|
|
1847
|
+
currentCallback.cancel = cancel2;
|
|
1848
|
+
const resetLeadingState = () => {
|
|
1849
|
+
clearTimeoutAndLeadingRef();
|
|
1850
|
+
};
|
|
1851
|
+
debounceTimerRef.current = window.setTimeout(resetLeadingState, delay);
|
|
1852
|
+
return;
|
|
1853
|
+
}
|
|
1854
|
+
const flush = () => {
|
|
1855
|
+
if (debounceTimerRef.current !== 0) {
|
|
1856
|
+
clearTimeoutAndLeadingRef();
|
|
1857
|
+
handleCallback(...args);
|
|
1858
|
+
}
|
|
1859
|
+
};
|
|
1860
|
+
const cancel = () => {
|
|
1861
|
+
clearTimeoutAndLeadingRef();
|
|
1862
|
+
};
|
|
1863
|
+
currentCallback.flush = flush;
|
|
1864
|
+
currentCallback.cancel = cancel;
|
|
1865
|
+
debounceTimerRef.current = window.setTimeout(flush, delay);
|
|
1866
|
+
},
|
|
1867
|
+
{
|
|
1868
|
+
flush: () => {
|
|
1869
|
+
},
|
|
1870
|
+
cancel: () => {
|
|
1871
|
+
},
|
|
1872
|
+
_isFirstCall: true
|
|
1873
|
+
}
|
|
1874
|
+
);
|
|
1875
|
+
return currentCallback;
|
|
1876
|
+
}, [handleCallback, delay, leading]);
|
|
1877
|
+
useEffect$6(
|
|
1878
|
+
() => () => {
|
|
1879
|
+
if (flushOnUnmount) {
|
|
1880
|
+
lastCallback.flush();
|
|
1881
|
+
} else {
|
|
1882
|
+
lastCallback.cancel();
|
|
1883
|
+
}
|
|
1884
|
+
},
|
|
1885
|
+
[lastCallback, flushOnUnmount]
|
|
1886
|
+
);
|
|
1887
|
+
return lastCallback;
|
|
1888
|
+
}
|
|
1889
|
+
const useRef$2 = window["React"].useRef;
|
|
1890
|
+
const useEffect$5 = window["React"].useEffect;
|
|
1891
|
+
const DEFAULT_EVENTS = ["mousedown", "touchstart"];
|
|
1892
|
+
function useClickOutside(callback, events, nodes) {
|
|
1893
|
+
const ref = useRef$2(null);
|
|
1894
|
+
const eventsList = DEFAULT_EVENTS;
|
|
1895
|
+
useEffect$5(() => {
|
|
1896
|
+
const listener = (event) => {
|
|
1897
|
+
const { target } = event ?? {};
|
|
1898
|
+
if (Array.isArray(nodes)) {
|
|
1899
|
+
const shouldIgnore = !document.body.contains(target) && target.tagName !== "HTML";
|
|
1900
|
+
const shouldTrigger = nodes.every((node) => !!node && !event.composedPath().includes(node));
|
|
1901
|
+
shouldTrigger && !shouldIgnore && callback();
|
|
1902
|
+
} else if (ref.current && !ref.current.contains(target)) {
|
|
1903
|
+
callback();
|
|
1904
|
+
}
|
|
1905
|
+
};
|
|
1906
|
+
eventsList.forEach((fn) => document.addEventListener(fn, listener));
|
|
1907
|
+
return () => {
|
|
1908
|
+
eventsList.forEach((fn) => document.removeEventListener(fn, listener));
|
|
1909
|
+
};
|
|
1910
|
+
}, [ref, callback, nodes]);
|
|
1911
|
+
return ref;
|
|
1912
|
+
}
|
|
1913
|
+
const useState$3 = window["React"].useState;
|
|
1914
|
+
const useEffect$4 = window["React"].useEffect;
|
|
1915
|
+
function attachMediaListener(query, callback) {
|
|
1916
|
+
try {
|
|
1917
|
+
query.addEventListener("change", callback);
|
|
1918
|
+
return () => query.removeEventListener("change", callback);
|
|
1919
|
+
} catch (e) {
|
|
1920
|
+
query.addListener(callback);
|
|
1921
|
+
return () => query.removeListener(callback);
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
function getInitialValue(query, initialValue) {
|
|
1925
|
+
if (typeof window !== "undefined" && "matchMedia" in window) {
|
|
1926
|
+
return window.matchMedia(query).matches;
|
|
1927
|
+
}
|
|
1928
|
+
return false;
|
|
1929
|
+
}
|
|
1930
|
+
function useMediaQuery(query, initialValue, { getInitialValueInEffect } = {
|
|
1931
|
+
getInitialValueInEffect: true
|
|
1932
|
+
}) {
|
|
1933
|
+
const [matches, setMatches] = useState$3(
|
|
1934
|
+
getInitialValueInEffect ? initialValue : getInitialValue(query)
|
|
1935
|
+
);
|
|
1936
|
+
useEffect$4(() => {
|
|
1937
|
+
try {
|
|
1938
|
+
const mediaQuery = window.matchMedia(query);
|
|
1939
|
+
setMatches(mediaQuery.matches);
|
|
1940
|
+
return attachMediaListener(mediaQuery, (event) => setMatches(event.matches));
|
|
1941
|
+
} catch (e) {
|
|
1942
|
+
return void 0;
|
|
1943
|
+
}
|
|
1944
|
+
}, [query]);
|
|
1945
|
+
return matches || false;
|
|
1946
|
+
}
|
|
1947
|
+
const useEffect$3 = window["React"].useEffect;
|
|
1948
|
+
function useWindowEvent(type, listener, options) {
|
|
1949
|
+
useEffect$3(() => {
|
|
1950
|
+
window.addEventListener(type, listener, options);
|
|
1951
|
+
return () => window.removeEventListener(type, listener, options);
|
|
1952
|
+
}, [type, listener]);
|
|
1953
|
+
}
|
|
1954
|
+
const useCallback$3 = window["React"].useCallback;
|
|
1955
|
+
const useState$2 = window["React"].useState;
|
|
1956
|
+
const useEffect$2 = window["React"].useEffect;
|
|
1957
|
+
function serializeJSON(value, hookName = "use-local-storage") {
|
|
1958
|
+
try {
|
|
1959
|
+
return JSON.stringify(value);
|
|
1960
|
+
} catch (error) {
|
|
1961
|
+
throw new Error(`@mantine/hooks ${hookName}: Failed to serialize the value`);
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
function deserializeJSON(value) {
|
|
1965
|
+
try {
|
|
1966
|
+
return value && JSON.parse(value);
|
|
1967
|
+
} catch {
|
|
1968
|
+
return value;
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
function createStorageHandler(type) {
|
|
1972
|
+
const getItem = (key) => {
|
|
1973
|
+
try {
|
|
1974
|
+
return window[type].getItem(key);
|
|
1975
|
+
} catch (error) {
|
|
1976
|
+
console.warn("use-local-storage: Failed to get value from storage, localStorage is blocked");
|
|
1977
|
+
return null;
|
|
1978
|
+
}
|
|
1979
|
+
};
|
|
1980
|
+
const setItem = (key, value) => {
|
|
1981
|
+
try {
|
|
1982
|
+
window[type].setItem(key, value);
|
|
1983
|
+
} catch (error) {
|
|
1984
|
+
console.warn("use-local-storage: Failed to set value to storage, localStorage is blocked");
|
|
1985
|
+
}
|
|
1986
|
+
};
|
|
1987
|
+
const removeItem = (key) => {
|
|
1988
|
+
try {
|
|
1989
|
+
window[type].removeItem(key);
|
|
1990
|
+
} catch (error) {
|
|
1991
|
+
console.warn(
|
|
1992
|
+
"use-local-storage: Failed to remove value from storage, localStorage is blocked"
|
|
1993
|
+
);
|
|
1994
|
+
}
|
|
1995
|
+
};
|
|
1996
|
+
return { getItem, setItem, removeItem };
|
|
1997
|
+
}
|
|
1998
|
+
function createStorage(type, hookName) {
|
|
1999
|
+
const eventName = "mantine-local-storage";
|
|
2000
|
+
const { getItem, setItem, removeItem } = createStorageHandler(type);
|
|
2001
|
+
return function useStorage({
|
|
2002
|
+
key,
|
|
2003
|
+
defaultValue,
|
|
2004
|
+
getInitialValueInEffect = true,
|
|
2005
|
+
sync = true,
|
|
2006
|
+
deserialize = deserializeJSON,
|
|
2007
|
+
serialize = (value) => serializeJSON(value, hookName)
|
|
2008
|
+
}) {
|
|
2009
|
+
const readStorageValue = useCallback$3(
|
|
2010
|
+
(skipStorage) => {
|
|
2011
|
+
let storageBlockedOrSkipped;
|
|
2012
|
+
try {
|
|
2013
|
+
storageBlockedOrSkipped = typeof window === "undefined" || !(type in window) || window[type] === null || !!skipStorage;
|
|
2014
|
+
} catch (_e) {
|
|
2015
|
+
storageBlockedOrSkipped = true;
|
|
2016
|
+
}
|
|
2017
|
+
if (storageBlockedOrSkipped) {
|
|
2018
|
+
return defaultValue;
|
|
2019
|
+
}
|
|
2020
|
+
const storageValue = getItem(key);
|
|
2021
|
+
return storageValue !== null ? deserialize(storageValue) : defaultValue;
|
|
2022
|
+
},
|
|
2023
|
+
[key, defaultValue]
|
|
2024
|
+
);
|
|
2025
|
+
const [value, setValue] = useState$2(readStorageValue(getInitialValueInEffect));
|
|
2026
|
+
const setStorageValue = useCallback$3(
|
|
2027
|
+
(val) => {
|
|
2028
|
+
if (val instanceof Function) {
|
|
2029
|
+
setValue((current) => {
|
|
2030
|
+
const result = val(current);
|
|
2031
|
+
setItem(key, serialize(result));
|
|
2032
|
+
queueMicrotask(() => {
|
|
2033
|
+
window.dispatchEvent(
|
|
2034
|
+
new CustomEvent(eventName, { detail: { key, value: val(current) } })
|
|
2035
|
+
);
|
|
2036
|
+
});
|
|
2037
|
+
return result;
|
|
2038
|
+
});
|
|
2039
|
+
} else {
|
|
2040
|
+
setItem(key, serialize(val));
|
|
2041
|
+
window.dispatchEvent(new CustomEvent(eventName, { detail: { key, value: val } }));
|
|
2042
|
+
setValue(val);
|
|
2043
|
+
}
|
|
2044
|
+
},
|
|
2045
|
+
[key]
|
|
2046
|
+
);
|
|
2047
|
+
const removeStorageValue = useCallback$3(() => {
|
|
2048
|
+
removeItem(key);
|
|
2049
|
+
window.dispatchEvent(new CustomEvent(eventName, { detail: { key, value: defaultValue } }));
|
|
2050
|
+
}, []);
|
|
2051
|
+
useWindowEvent("storage", (event) => {
|
|
2052
|
+
if (sync) {
|
|
2053
|
+
if (event.storageArea === window[type] && event.key === key) {
|
|
2054
|
+
setValue(deserialize(event.newValue ?? void 0));
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
});
|
|
2058
|
+
useWindowEvent(eventName, (event) => {
|
|
2059
|
+
if (sync) {
|
|
2060
|
+
if (event.detail.key === key) {
|
|
2061
|
+
setValue(event.detail.value);
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
});
|
|
2065
|
+
useEffect$2(() => {
|
|
2066
|
+
if (defaultValue !== void 0 && value === void 0) {
|
|
2067
|
+
setStorageValue(defaultValue);
|
|
2068
|
+
}
|
|
2069
|
+
}, [defaultValue, value, setStorageValue]);
|
|
2070
|
+
useEffect$2(() => {
|
|
2071
|
+
const val = readStorageValue();
|
|
2072
|
+
val !== void 0 && setStorageValue(val);
|
|
2073
|
+
}, [key]);
|
|
2074
|
+
return [value === void 0 ? defaultValue : value, setStorageValue, removeStorageValue];
|
|
2075
|
+
};
|
|
2076
|
+
}
|
|
2077
|
+
function useLocalStorage(props) {
|
|
2078
|
+
return createStorage("localStorage", "use-local-storage")(props);
|
|
2079
|
+
}
|
|
2080
|
+
const useCallback$2 = window["React"].useCallback;
|
|
2081
|
+
function assignRef(ref, value) {
|
|
2082
|
+
if (typeof ref === "function") {
|
|
2083
|
+
return ref(value);
|
|
2084
|
+
} else if (typeof ref === "object" && ref !== null && "current" in ref) {
|
|
2085
|
+
ref.current = value;
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
2088
|
+
function mergeRefs(...refs) {
|
|
2089
|
+
const cleanupMap = /* @__PURE__ */ new Map();
|
|
2090
|
+
return (node) => {
|
|
2091
|
+
refs.forEach((ref) => {
|
|
2092
|
+
const cleanup = assignRef(ref, node);
|
|
2093
|
+
if (cleanup) {
|
|
2094
|
+
cleanupMap.set(ref, cleanup);
|
|
2095
|
+
}
|
|
2096
|
+
});
|
|
2097
|
+
if (cleanupMap.size > 0) {
|
|
2098
|
+
return () => {
|
|
2099
|
+
refs.forEach((ref) => {
|
|
2100
|
+
const cleanup = cleanupMap.get(ref);
|
|
2101
|
+
if (cleanup && typeof cleanup === "function") {
|
|
2102
|
+
cleanup();
|
|
2103
|
+
} else {
|
|
2104
|
+
assignRef(ref, null);
|
|
2105
|
+
}
|
|
2106
|
+
});
|
|
2107
|
+
cleanupMap.clear();
|
|
2108
|
+
};
|
|
2109
|
+
}
|
|
2110
|
+
};
|
|
2111
|
+
}
|
|
2112
|
+
function useMergedRef(...refs) {
|
|
2113
|
+
return useCallback$2(mergeRefs(...refs), refs);
|
|
2114
|
+
}
|
|
2115
|
+
const useRef$1 = window["React"].useRef;
|
|
2116
|
+
const useState$1 = window["React"].useState;
|
|
2117
|
+
const useMemo = window["React"].useMemo;
|
|
2118
|
+
const useEffect$1 = window["React"].useEffect;
|
|
2119
|
+
const defaultState = {
|
|
2120
|
+
x: 0,
|
|
2121
|
+
y: 0,
|
|
2122
|
+
width: 0,
|
|
2123
|
+
height: 0,
|
|
2124
|
+
top: 0,
|
|
2125
|
+
left: 0,
|
|
2126
|
+
bottom: 0,
|
|
2127
|
+
right: 0
|
|
2128
|
+
};
|
|
2129
|
+
function useResizeObserver(options) {
|
|
2130
|
+
const frameID = useRef$1(0);
|
|
2131
|
+
const ref = useRef$1(null);
|
|
2132
|
+
const [rect, setRect] = useState$1(defaultState);
|
|
2133
|
+
const observer = useMemo(
|
|
2134
|
+
() => typeof window !== "undefined" ? new ResizeObserver((entries) => {
|
|
2135
|
+
const entry = entries[0];
|
|
2136
|
+
if (entry) {
|
|
2137
|
+
cancelAnimationFrame(frameID.current);
|
|
2138
|
+
frameID.current = requestAnimationFrame(() => {
|
|
2139
|
+
var _a2, _b2;
|
|
2140
|
+
if (ref.current) {
|
|
2141
|
+
const boxSize = ((_a2 = entry.borderBoxSize) == null ? void 0 : _a2[0]) || ((_b2 = entry.contentBoxSize) == null ? void 0 : _b2[0]);
|
|
2142
|
+
if (boxSize) {
|
|
2143
|
+
const width = boxSize.inlineSize;
|
|
2144
|
+
const height = boxSize.blockSize;
|
|
2145
|
+
setRect({
|
|
2146
|
+
width,
|
|
2147
|
+
height,
|
|
2148
|
+
x: entry.contentRect.x,
|
|
2149
|
+
y: entry.contentRect.y,
|
|
2150
|
+
top: entry.contentRect.top,
|
|
2151
|
+
left: entry.contentRect.left,
|
|
2152
|
+
bottom: entry.contentRect.bottom,
|
|
2153
|
+
right: entry.contentRect.right
|
|
2154
|
+
});
|
|
2155
|
+
} else {
|
|
2156
|
+
setRect(entry.contentRect);
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
});
|
|
2160
|
+
}
|
|
2161
|
+
}) : null,
|
|
2162
|
+
[]
|
|
2163
|
+
);
|
|
2164
|
+
useEffect$1(() => {
|
|
2165
|
+
if (ref.current) {
|
|
2166
|
+
observer == null ? void 0 : observer.observe(ref.current, options);
|
|
2167
|
+
}
|
|
2168
|
+
return () => {
|
|
2169
|
+
observer == null ? void 0 : observer.disconnect();
|
|
2170
|
+
if (frameID.current) {
|
|
2171
|
+
cancelAnimationFrame(frameID.current);
|
|
2172
|
+
}
|
|
2173
|
+
};
|
|
2174
|
+
}, [ref.current]);
|
|
2175
|
+
return [ref, rect];
|
|
2176
|
+
}
|
|
2177
|
+
const useState = window["React"].useState;
|
|
2178
|
+
const useCallback$1 = window["React"].useCallback;
|
|
2179
|
+
function useDisclosure(initialState = false, options = {}) {
|
|
2180
|
+
const [opened, setOpened] = useState(initialState);
|
|
2181
|
+
const open = useCallback$1(() => {
|
|
2182
|
+
setOpened((isOpened) => {
|
|
2183
|
+
var _a2;
|
|
2184
|
+
if (!isOpened) {
|
|
2185
|
+
(_a2 = options.onOpen) == null ? void 0 : _a2.call(options);
|
|
2186
|
+
return true;
|
|
2187
|
+
}
|
|
2188
|
+
return isOpened;
|
|
2189
|
+
});
|
|
2190
|
+
}, [options.onOpen]);
|
|
2191
|
+
const close = useCallback$1(() => {
|
|
2192
|
+
setOpened((isOpened) => {
|
|
2193
|
+
var _a2;
|
|
2194
|
+
if (isOpened) {
|
|
2195
|
+
(_a2 = options.onClose) == null ? void 0 : _a2.call(options);
|
|
2196
|
+
return false;
|
|
2197
|
+
}
|
|
2198
|
+
return isOpened;
|
|
2199
|
+
});
|
|
2200
|
+
}, [options.onClose]);
|
|
2201
|
+
const toggle = useCallback$1(() => {
|
|
2202
|
+
opened ? close() : open();
|
|
2203
|
+
}, [close, open, opened]);
|
|
2204
|
+
return [opened, { open, close, toggle }];
|
|
2205
|
+
}
|
|
2206
|
+
const useRef = window["React"].useRef;
|
|
2207
|
+
const useCallback = window["React"].useCallback;
|
|
2208
|
+
const useEffect = window["React"].useEffect;
|
|
2209
|
+
function useTimeout(callback, delay, options = { autoInvoke: false }) {
|
|
2210
|
+
const timeoutRef = useRef(null);
|
|
2211
|
+
const start = useCallback(
|
|
2212
|
+
(...args) => {
|
|
2213
|
+
if (!timeoutRef.current) {
|
|
2214
|
+
timeoutRef.current = window.setTimeout(() => {
|
|
2215
|
+
callback(args);
|
|
2216
|
+
timeoutRef.current = null;
|
|
2217
|
+
}, delay);
|
|
2218
|
+
}
|
|
2219
|
+
},
|
|
2220
|
+
[delay]
|
|
2221
|
+
);
|
|
2222
|
+
const clear = useCallback(() => {
|
|
2223
|
+
if (timeoutRef.current) {
|
|
2224
|
+
window.clearTimeout(timeoutRef.current);
|
|
2225
|
+
timeoutRef.current = null;
|
|
2226
|
+
}
|
|
2227
|
+
}, []);
|
|
2228
|
+
useEffect(() => {
|
|
2229
|
+
if (options.autoInvoke) {
|
|
2230
|
+
start();
|
|
2231
|
+
}
|
|
2232
|
+
return clear;
|
|
2233
|
+
}, [clear, start]);
|
|
2234
|
+
return { start, clear };
|
|
2235
|
+
}
|
|
2236
|
+
function r(e) {
|
|
2237
|
+
var t, f, n = "";
|
|
2238
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
2239
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
2240
|
+
var o = e.length;
|
|
2241
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
2242
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
2243
|
+
return n;
|
|
2244
|
+
}
|
|
2245
|
+
function clsx() {
|
|
2246
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
2247
|
+
return n;
|
|
2248
|
+
}
|
|
2249
|
+
const Kr = window["MantineCore"].Box;
|
|
2250
|
+
const Jr = window["MantineCore"].Table;
|
|
2251
|
+
const ke = window["React"].useCallback;
|
|
2252
|
+
const Yr = window["React"].useMemo;
|
|
2253
|
+
const Ke = window["React"].useState;
|
|
2254
|
+
const kt = window["React"].useState;
|
|
2255
|
+
const $a = window["MantineCore"].createSafeContext;
|
|
2256
|
+
var [Mt, de] = $a("useDataTableColumnsContext must be used within DataTableColumnProvider");
|
|
2257
|
+
var at = (e) => {
|
|
2258
|
+
let { children: t, columnsOrder: o, setColumnsOrder: n, columnsToggle: a, setColumnsToggle: r2, resetColumnsOrder: l, resetColumnsToggle: i, setColumnWidth: s, resetColumnsWidth: d } = e, [m, b] = kt(""), [p, T] = kt("");
|
|
2259
|
+
return jsxRuntimeExports.jsx(Mt, { value: { sourceColumn: m, setSourceColumn: b, targetColumn: p, setTargetColumn: T, columnsToggle: a, setColumnsToggle: r2, swapColumns: () => {
|
|
2260
|
+
if (!o || !n || !m || !p) return;
|
|
2261
|
+
let x = o.indexOf(m), D = o.indexOf(p);
|
|
2262
|
+
if (x !== -1 && D !== -1) {
|
|
2263
|
+
let S = o.splice(x, 1)[0];
|
|
2264
|
+
o.splice(D, 0, S), n([...o]);
|
|
2265
|
+
}
|
|
2266
|
+
}, resetColumnsOrder: l, resetColumnsToggle: i, setColumnWidth: s, resetColumnsWidth: d }, children: t });
|
|
2267
|
+
};
|
|
2268
|
+
function Nt() {
|
|
2269
|
+
return jsxRuntimeExports.jsx("tr", { className: "mantine-datatable-empty-row", children: jsxRuntimeExports.jsx("td", {}) });
|
|
2270
|
+
}
|
|
2271
|
+
const Za = window["MantineCore"].Center;
|
|
2272
|
+
const Ya = window["MantineCore"].Text;
|
|
2273
|
+
function Lt() {
|
|
2274
|
+
return jsxRuntimeExports.jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), jsxRuntimeExports.jsx("path", { d: "M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74" }), jsxRuntimeExports.jsx("path", { d: "M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6" }), jsxRuntimeExports.jsx("path", { d: "M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4" }), jsxRuntimeExports.jsx("path", { d: "M3 3l18 18" })] });
|
|
2275
|
+
}
|
|
2276
|
+
function Ht({ icon: e, text: t, pt: o, pb: n, active: a, children: r2 }) {
|
|
2277
|
+
return jsxRuntimeExports.jsx(Za, { pt: o, pb: n, className: "mantine-datatable-empty-state", "data-active": a || void 0, children: r2 || jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [e || jsxRuntimeExports.jsx("div", { className: "mantine-datatable-empty-state-icon", children: jsxRuntimeExports.jsx(Lt, {}) }), jsxRuntimeExports.jsx(Ya, { component: "div", size: "sm", c: "dimmed", children: t })] }) });
|
|
2278
|
+
}
|
|
2279
|
+
const wn = window["MantineCore"].TableTfoot;
|
|
2280
|
+
const Sn = window["MantineCore"].TableTr;
|
|
2281
|
+
const Pn = window["MantineCore"].rem;
|
|
2282
|
+
const vn = window["React"].forwardRef;
|
|
2283
|
+
const gn = window["MantineCore"].TableTh;
|
|
2284
|
+
const en = window["React"].useMemo;
|
|
2285
|
+
var It = ({ key: e, columns: t = [], getInitialValueInEffect: o = true }) => {
|
|
2286
|
+
function n(c, y) {
|
|
2287
|
+
let f = [];
|
|
2288
|
+
return c.forEach((u) => {
|
|
2289
|
+
y.find((w) => w.accessor === u) && f.push(u);
|
|
2290
|
+
}), y.forEach((u) => {
|
|
2291
|
+
f.includes(u.accessor) || f.push(u.accessor);
|
|
2292
|
+
}), f;
|
|
2293
|
+
}
|
|
2294
|
+
function a(c, y) {
|
|
2295
|
+
let f = [];
|
|
2296
|
+
return c.forEach((u) => {
|
|
2297
|
+
y.find((w) => w.accessor === u.accessor) && f.push(u);
|
|
2298
|
+
}), y.forEach((u) => {
|
|
2299
|
+
f.find((w) => w.accessor === u.accessor) || f.push({ accessor: u.accessor, defaultToggle: u.defaultToggle || true, toggleable: u.toggleable, toggled: u.defaultToggle === void 0 ? true : u.defaultToggle });
|
|
2300
|
+
}), f;
|
|
2301
|
+
}
|
|
2302
|
+
function r2(c, y) {
|
|
2303
|
+
let f = [];
|
|
2304
|
+
return c.forEach((u) => {
|
|
2305
|
+
let w = Object.keys(u)[0];
|
|
2306
|
+
y.find((h) => h.accessor === w) && f.push(u);
|
|
2307
|
+
}), y.forEach((u) => {
|
|
2308
|
+
let w = u.accessor;
|
|
2309
|
+
if (!f.find((h) => Object.keys(h)[0] === w)) {
|
|
2310
|
+
let h = {};
|
|
2311
|
+
h[w] = "", f.push(h);
|
|
2312
|
+
}
|
|
2313
|
+
}), f;
|
|
2314
|
+
}
|
|
2315
|
+
function l() {
|
|
2316
|
+
let [c, y] = useLocalStorage({ key: e ? `${e}-columns-order` : "", defaultValue: e ? d : void 0, getInitialValueInEffect: o });
|
|
2317
|
+
function f(h) {
|
|
2318
|
+
e && y(h);
|
|
2319
|
+
}
|
|
2320
|
+
if (!e) return [c, f];
|
|
2321
|
+
let u = n(c, t), w = JSON.stringify(c);
|
|
2322
|
+
return JSON.stringify(u) !== w && f(u), [u, f];
|
|
2323
|
+
}
|
|
2324
|
+
function i() {
|
|
2325
|
+
let [c, y] = useLocalStorage({ key: e ? `${e}-columns-toggle` : "", defaultValue: e ? b : void 0, getInitialValueInEffect: o });
|
|
2326
|
+
function f(h) {
|
|
2327
|
+
e && y(h);
|
|
2328
|
+
}
|
|
2329
|
+
if (!e) return [c, f];
|
|
2330
|
+
let u = a(c, t), w = JSON.stringify(c);
|
|
2331
|
+
return JSON.stringify(u) !== w && f(u), [a(c, t), f];
|
|
2332
|
+
}
|
|
2333
|
+
function s() {
|
|
2334
|
+
let [c, y] = useLocalStorage({ key: e ? `${e}-columns-width` : "", defaultValue: e ? m : void 0, getInitialValueInEffect: o });
|
|
2335
|
+
function f(h) {
|
|
2336
|
+
e && y(h);
|
|
2337
|
+
}
|
|
2338
|
+
if (!e) return [c, f];
|
|
2339
|
+
let u = r2(c, t), w = JSON.stringify(c);
|
|
2340
|
+
return JSON.stringify(u) !== w && f(u), [r2(c, t), f];
|
|
2341
|
+
}
|
|
2342
|
+
let d = t && t.map((c) => c.accessor) || [], m = t && t.map((c) => ({ [c.accessor]: c.width ?? "initial" })) || [], b = t && t.map((c) => ({ accessor: c.accessor, defaultToggle: c.defaultToggle || true, toggleable: c.toggleable, toggled: c.defaultToggle === void 0 ? true : c.defaultToggle })), [p, T] = l(), [g, x] = i(), [D, S] = s(), R = () => T(d), P = () => {
|
|
2343
|
+
x(b);
|
|
2344
|
+
}, M = () => S(m);
|
|
2345
|
+
return { effectiveColumns: en(() => p ? p.map((f) => t.find((u) => u.accessor === f)).map((f) => {
|
|
2346
|
+
var _a2;
|
|
2347
|
+
return { ...f, hidden: (f == null ? void 0 : f.hidden) || !((_a2 = g.find((u) => u.accessor === (f == null ? void 0 : f.accessor))) == null ? void 0 : _a2.toggled) };
|
|
2348
|
+
}).map((f) => {
|
|
2349
|
+
var _a2;
|
|
2350
|
+
return { ...f, width: (_a2 = D.find((u) => u[f == null ? void 0 : f.accessor])) == null ? void 0 : _a2[f == null ? void 0 : f.accessor] };
|
|
2351
|
+
}) : t, [t, p, g, D]), setColumnsOrder: T, columnsOrder: p, resetColumnsOrder: R, columnsToggle: g, setColumnsToggle: x, resetColumnsToggle: P, columnsWidth: D, setColumnsWidth: S, setColumnWidth: (c, y) => {
|
|
2352
|
+
let f = D.map((u) => u[c] ? { [c]: y } : u);
|
|
2353
|
+
S(f);
|
|
2354
|
+
}, resetColumnsWidth: M };
|
|
2355
|
+
};
|
|
2356
|
+
function ne() {
|
|
2357
|
+
var _a2;
|
|
2358
|
+
let [e] = useResizeObserver(), { width: t, height: o } = ((_a2 = e.current) == null ? void 0 : _a2.getBoundingClientRect()) || { width: 0, height: 0 };
|
|
2359
|
+
return { ref: e, width: t, height: o };
|
|
2360
|
+
}
|
|
2361
|
+
const on = window["React"].useEffect;
|
|
2362
|
+
const an = window["React"].useLayoutEffect;
|
|
2363
|
+
var Ot = typeof window < "u" ? an : on;
|
|
2364
|
+
const nn = window["React"].useEffect;
|
|
2365
|
+
const rn = window["React"].useState;
|
|
2366
|
+
function Wt(e) {
|
|
2367
|
+
let [t, o] = rn(null), n = (e == null ? void 0 : e.join(":")) || "";
|
|
2368
|
+
return nn(() => {
|
|
2369
|
+
o(null);
|
|
2370
|
+
}, [n]), { lastSelectionChangeIndex: t, setLastSelectionChangeIndex: o };
|
|
2371
|
+
}
|
|
2372
|
+
const ln = window["React"].useEffect;
|
|
2373
|
+
const sn = window["React"].useRef;
|
|
2374
|
+
const dn = window["React"].useState;
|
|
2375
|
+
function cn(e, t) {
|
|
2376
|
+
let o = () => {
|
|
2377
|
+
t(e.map((a) => a.matches));
|
|
2378
|
+
}, n = e.map((a) => {
|
|
2379
|
+
try {
|
|
2380
|
+
return a.addEventListener("change", o), () => a.removeEventListener("change", o);
|
|
2381
|
+
} catch {
|
|
2382
|
+
return a.addListener(o), () => a.removeListener(o);
|
|
2383
|
+
}
|
|
2384
|
+
});
|
|
2385
|
+
return () => {
|
|
2386
|
+
n.forEach((a) => a());
|
|
2387
|
+
};
|
|
2388
|
+
}
|
|
2389
|
+
function un(e, t) {
|
|
2390
|
+
return t || (typeof window < "u" && "matchMedia" in window ? e.map((o) => window.matchMedia(o).matches) : e.map(() => false));
|
|
2391
|
+
}
|
|
2392
|
+
function At(e, t, { getInitialValueInEffect: o } = { getInitialValueInEffect: true }) {
|
|
2393
|
+
let [n, a] = dn(o ? t : un(e, t)), r2 = sn(null);
|
|
2394
|
+
return ln(() => {
|
|
2395
|
+
if ("matchMedia" in window) return r2.current = e.map((l) => window.matchMedia(l)), a(r2.current.map((l) => l.matches)), cn(r2.current, (l) => {
|
|
2396
|
+
a(l);
|
|
2397
|
+
});
|
|
2398
|
+
}, [e]), n;
|
|
2399
|
+
}
|
|
2400
|
+
const mn = window["MantineCore"].useMantineTheme;
|
|
2401
|
+
const zt = window["React"].useMemo;
|
|
2402
|
+
function Vt(e) {
|
|
2403
|
+
let t = mn(), o = zt(() => e.map((a) => (typeof a == "function" ? a(t) : a) ?? ""), [e, t]), n = zt(() => e.map(() => true), [e]);
|
|
2404
|
+
return At(o, n);
|
|
2405
|
+
}
|
|
2406
|
+
const pn = window["MantineCore"].useMantineTheme;
|
|
2407
|
+
function K(e) {
|
|
2408
|
+
let t = pn(), o = typeof e == "function" ? e(t) : e;
|
|
2409
|
+
return useMediaQuery(o || "", true);
|
|
2410
|
+
}
|
|
2411
|
+
const bn = window["React"].useState;
|
|
2412
|
+
function ce(e) {
|
|
2413
|
+
let t = e.replace(/([a-z\d])([A-Z]+)/g, "$1 $2").replace(/\W|_/g, " ").trim().toLowerCase();
|
|
2414
|
+
return `${t.charAt(0).toUpperCase()}${t.slice(1)}`;
|
|
2415
|
+
}
|
|
2416
|
+
function _t(e, t, o) {
|
|
2417
|
+
return e.filter((n) => !t.map(o).includes(o(n)));
|
|
2418
|
+
}
|
|
2419
|
+
function We(e, t) {
|
|
2420
|
+
return e.filter((o, n, a) => n === a.findIndex((r2) => t(o) === t(r2)));
|
|
2421
|
+
}
|
|
2422
|
+
function rt(e, t) {
|
|
2423
|
+
return t ? t.match(/([^[.\]])+/g).reduce((n, a) => n && n[a], e) : void 0;
|
|
2424
|
+
}
|
|
2425
|
+
function E(e, t) {
|
|
2426
|
+
return typeof t == "string" ? rt(e, t) : t(e);
|
|
2427
|
+
}
|
|
2428
|
+
function Ft({ rowExpansion: e, records: t, idAccessor: o }) {
|
|
2429
|
+
let n = [];
|
|
2430
|
+
if (e && t) {
|
|
2431
|
+
let { trigger: i, allowMultiple: s, initiallyExpanded: d } = e;
|
|
2432
|
+
t && i === "always" ? n = t.map((m) => E(m, o)) : d && (n = t.filter((m, b) => d({ record: m, index: b })).map((m) => E(m, o)), s || (n = [n[0]]));
|
|
2433
|
+
}
|
|
2434
|
+
let a, r2, l = bn(n);
|
|
2435
|
+
if (e) {
|
|
2436
|
+
let { expandable: i, trigger: s, allowMultiple: d, collapseProps: m, content: b } = e;
|
|
2437
|
+
e.expanded ? { recordIds: a, onRecordIdsChange: r2 } = e.expanded : [a, r2] = l;
|
|
2438
|
+
let p = (T) => r2 == null ? void 0 : r2(a.filter((g) => g !== E(T, o)));
|
|
2439
|
+
return { expandOnClick: s !== "always" && s !== "never", isRowExpanded: (T) => s === "always" ? true : a.includes(E(T, o)), isExpandable: ({ record: T, index: g }) => i ? i({ record: T, index: g }) : true, expandRow: (T) => {
|
|
2440
|
+
let g = E(T, o);
|
|
2441
|
+
r2 == null ? void 0 : r2(d ? [...a, g] : [g]);
|
|
2442
|
+
}, collapseRow: p, collapseProps: m, content: ({ record: T, index: g }) => () => b({ record: T, index: g, collapse: () => p(T) }) };
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
2445
|
+
const Tn = window["React"].useEffect;
|
|
2446
|
+
const Gt = window["React"].useState;
|
|
2447
|
+
function Xt(e, t) {
|
|
2448
|
+
let [o, n] = Gt(e), [a, r2] = Gt(e), l = useTimeout(() => n(true), 0), i = useTimeout(() => r2(false), t || 200);
|
|
2449
|
+
return Tn(() => {
|
|
2450
|
+
e ? (i.clear(), r2(true), l.start()) : (l.clear(), n(false), i.start());
|
|
2451
|
+
}, [l, i, e]), { expanded: o, visible: a };
|
|
2452
|
+
}
|
|
2453
|
+
var ue = "mantine-datatable-nowrap", me = "mantine-datatable-ellipsis", B = "mantine-datatable-pointer-cursor", Ae = "mantine-datatable-context-menu-cursor", Qt = "mantine-datatable-text-selection-disabled", J = "mantine-datatable-text-align-left", Z = "mantine-datatable-text-align-center", Y = "mantine-datatable-text-align-right";
|
|
2454
|
+
function Ut({ className: e, style: t, visibleMediaQuery: o, title: n, noWrap: a, ellipsis: r2, textAlign: l, width: i }) {
|
|
2455
|
+
return K(o) ? jsxRuntimeExports.jsx(gn, { className: clsx({ [ue]: a || r2, [me]: r2, [J]: l === "left", [Z]: l === "center", [Y]: l === "right" }, e), style: [{ width: i, minWidth: i, maxWidth: i }, t], children: n }) : null;
|
|
2456
|
+
}
|
|
2457
|
+
const Dn = window["MantineCore"].TableTh;
|
|
2458
|
+
function $t({ shadowVisible: e }) {
|
|
2459
|
+
return jsxRuntimeExports.jsx(Dn, { className: "mantine-datatable-footer-selector-placeholder-cell", "data-shadow-visible": e || void 0 });
|
|
2460
|
+
}
|
|
2461
|
+
var Kt = vn(function({ className: t, style: o, columns: n, defaultColumnProps: a, selectionVisible: r2, selectorCellShadowVisible: l, scrollDiff: i }, s) {
|
|
2462
|
+
let d = i < 0;
|
|
2463
|
+
return jsxRuntimeExports.jsx(wn, { ref: s, className: clsx("mantine-datatable-footer", t), style: [{ position: d ? "relative" : "sticky", bottom: Pn(d ? i : 0) }, o], children: jsxRuntimeExports.jsxs(Sn, { children: [r2 && jsxRuntimeExports.jsx($t, { shadowVisible: l }), n.map(({ hidden: m, ...b }) => {
|
|
2464
|
+
if (m) return null;
|
|
2465
|
+
let { accessor: p, visibleMediaQuery: T, textAlign: g, width: x, footer: D, footerClassName: S, footerStyle: R, noWrap: P, ellipsis: M } = { ...a, ...b };
|
|
2466
|
+
return jsxRuntimeExports.jsx(Ut, { className: S, style: R, visibleMediaQuery: T, textAlign: g, width: x, title: D, noWrap: P, ellipsis: M }, p);
|
|
2467
|
+
})] }) });
|
|
2468
|
+
});
|
|
2469
|
+
const rr = window["MantineCore"].Checkbox;
|
|
2470
|
+
const lr = window["MantineCore"].Group;
|
|
2471
|
+
const ir = window["MantineCore"].Popover;
|
|
2472
|
+
const sr = window["MantineCore"].PopoverDropdown;
|
|
2473
|
+
const dr = window["MantineCore"].PopoverTarget;
|
|
2474
|
+
const cr = window["MantineCore"].Stack;
|
|
2475
|
+
const ur = window["MantineCore"].TableThead;
|
|
2476
|
+
const mo = window["MantineCore"].TableTr;
|
|
2477
|
+
const pr = window["React"].forwardRef;
|
|
2478
|
+
const fr = window["React"].useState;
|
|
2479
|
+
const Mn = window["MantineCore"].TableTh;
|
|
2480
|
+
const Jt = window["React"].useMemo;
|
|
2481
|
+
function Zt({ group: { id: e, columns: t, title: o, textAlign: n, className: a, style: r2 } }) {
|
|
2482
|
+
let l = Jt(() => t.map(({ visibleMediaQuery: d }) => d), [t]), i = Vt(l), s = Jt(() => t.filter(({ hidden: d }, m) => !d && (i == null ? void 0 : i[m])).length, [t, i]);
|
|
2483
|
+
return s > 0 ? jsxRuntimeExports.jsx(Mn, { colSpan: s, className: clsx("mantine-datatable-column-group-header-cell", { [J]: n === "left", [Z]: n === "center", [Y]: n === "right" }, a), style: r2, children: o ?? ce(e) }) : null;
|
|
2484
|
+
}
|
|
2485
|
+
const io = window["MantineCore"].ActionIcon;
|
|
2486
|
+
const Kn = window["MantineCore"].Box;
|
|
2487
|
+
const Fe = window["MantineCore"].Center;
|
|
2488
|
+
const Jn = window["MantineCore"].Flex;
|
|
2489
|
+
const Zn = window["MantineCore"].Group;
|
|
2490
|
+
const Yn = window["MantineCore"].TableTh;
|
|
2491
|
+
const qn = window["React"].useRef;
|
|
2492
|
+
const jn = window["React"].useState;
|
|
2493
|
+
const Hn = window["MantineCore"].ActionIcon;
|
|
2494
|
+
const In = window["MantineCore"].Popover;
|
|
2495
|
+
const On = window["MantineCore"].PopoverDropdown;
|
|
2496
|
+
const Wn = window["MantineCore"].PopoverTarget;
|
|
2497
|
+
function qt() {
|
|
2498
|
+
return jsxRuntimeExports.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), jsxRuntimeExports.jsx("path", { d: "M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" })] });
|
|
2499
|
+
}
|
|
2500
|
+
function eo() {
|
|
2501
|
+
return jsxRuntimeExports.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), jsxRuntimeExports.jsx("path", { d: "M20 3h-16a1 1 0 0 0 -1 1v2.227l.008 .223a3 3 0 0 0 .772 1.795l4.22 4.641v8.114a1 1 0 0 0 1.316 .949l6 -2l.108 -.043a1 1 0 0 0 .576 -.906v-6.586l4.121 -4.12a3 3 0 0 0 .879 -2.123v-2.171a1 1 0 0 0 -1 -1z", strokeWidth: "0", fill: "currentColor" })] });
|
|
2502
|
+
}
|
|
2503
|
+
function to({ children: e, isActive: t, filterPopoverProps: o }) {
|
|
2504
|
+
let [n, { close: a, toggle: r2 }] = useDisclosure(false), l = t ? eo : qt, i = useClickOutside(a);
|
|
2505
|
+
return jsxRuntimeExports.jsxs(In, { withArrow: true, shadow: "md", opened: n, onClose: a, trapFocus: true, ...o, children: [jsxRuntimeExports.jsx(Wn, { children: jsxRuntimeExports.jsx(Hn, { className: "mantine-datatable-header-cell-filter-action-icon", "data-active": t || void 0, size: "sm", variant: "default", onClick: (s) => {
|
|
2506
|
+
s.preventDefault(), r2();
|
|
2507
|
+
}, onKeyDown: (s) => s.stopPropagation(), children: jsxRuntimeExports.jsx(l, {}) }) }), jsxRuntimeExports.jsx(On, { ref: i, onClick: (s) => s.stopPropagation(), onKeyDown: (s) => s.stopPropagation(), children: typeof e == "function" ? e({ close: a }) : e })] });
|
|
2508
|
+
}
|
|
2509
|
+
const _n = window["MantineCore"].rem;
|
|
2510
|
+
const Fn = window["React"].useRef;
|
|
2511
|
+
const Bn = window["React"].useState;
|
|
2512
|
+
var oo = (e) => {
|
|
2513
|
+
let { accessor: t, columnRef: o } = e, n = Fn(null), [a, r2] = Bn(0), { setColumnWidth: l } = de(), i = (b) => {
|
|
2514
|
+
b.preventDefault(), b.stopPropagation(), document.addEventListener("mousemove", s), document.addEventListener("mouseup", d), document.body.style.cursor = "col-resize";
|
|
2515
|
+
}, s = (b) => {
|
|
2516
|
+
if (!o.current) return;
|
|
2517
|
+
let p = b.clientX - o.current.getBoundingClientRect().right, g = `${o.current.getBoundingClientRect().width + p}px`;
|
|
2518
|
+
o.current.style.width = g, l(t, o.current.style.width), r2(-p);
|
|
2519
|
+
}, d = () => {
|
|
2520
|
+
o.current && (document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", d), document.body.style.cursor = "initial", l(t, o.current.style.width), r2(0));
|
|
2521
|
+
};
|
|
2522
|
+
return jsxRuntimeExports.jsx("div", { ref: n, onClick: (b) => b.stopPropagation(), onMouseDown: i, onDoubleClick: () => {
|
|
2523
|
+
o.current && (o.current.style.maxWidth = "initial", o.current.style.minWidth = "initial", o.current.style.width = "initial", l(t, "initial"));
|
|
2524
|
+
}, className: "mantine-datatable-header-resizable-handle", style: { right: _n(a) } });
|
|
2525
|
+
};
|
|
2526
|
+
function ao() {
|
|
2527
|
+
return jsxRuntimeExports.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), jsxRuntimeExports.jsx("path", { d: "M12 5l0 14" }), jsxRuntimeExports.jsx("path", { d: "M16 9l-4 -4" }), jsxRuntimeExports.jsx("path", { d: "M8 9l4 -4" })] });
|
|
2528
|
+
}
|
|
2529
|
+
function no() {
|
|
2530
|
+
return jsxRuntimeExports.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), jsxRuntimeExports.jsx("path", { d: "M8 7l4 -4l4 4" }), jsxRuntimeExports.jsx("path", { d: "M8 17l4 4l4 -4" }), jsxRuntimeExports.jsx("path", { d: "M12 3l0 18" })] });
|
|
2531
|
+
}
|
|
2532
|
+
function ro() {
|
|
2533
|
+
return jsxRuntimeExports.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), jsxRuntimeExports.jsx("path", { d: "M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }), jsxRuntimeExports.jsx("path", { d: "M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }), jsxRuntimeExports.jsx("path", { d: "M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }), jsxRuntimeExports.jsx("path", { d: "M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }), jsxRuntimeExports.jsx("path", { d: "M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }), jsxRuntimeExports.jsx("path", { d: "M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" })] });
|
|
2534
|
+
}
|
|
2535
|
+
function lo() {
|
|
2536
|
+
return jsxRuntimeExports.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), jsxRuntimeExports.jsx("path", { d: "M18 6l-12 12" }), jsxRuntimeExports.jsx("path", { d: "M6 6l12 12" })] });
|
|
2537
|
+
}
|
|
2538
|
+
function so({ className: e, style: t, accessor: o, visibleMediaQuery: n, title: a, sortable: r2, draggable: l, toggleable: i, resizable: s, sortIcons: d, textAlign: m, width: b, sortStatus: p, onSortStatusChange: T, filter: g, filterPopoverProps: x, filtering: D, sortKey: S }) {
|
|
2539
|
+
let { setSourceColumn: R, setTargetColumn: P, swapColumns: M, setColumnsToggle: N } = de(), [A, c] = jn(false), y = qn(null);
|
|
2540
|
+
if (!K(n)) return null;
|
|
2541
|
+
let f = a ?? ce(o), u = typeof f == "string" ? f : void 0, w = r2 && T ? (k) => {
|
|
2542
|
+
(k == null ? void 0 : k.defaultPrevented) || T({ sortKey: S, columnAccessor: o, direction: (p == null ? void 0 : p.columnAccessor) === o ? p.direction === "asc" ? "desc" : "asc" : (p == null ? void 0 : p.direction) ?? "asc" });
|
|
2543
|
+
} : void 0, h = (k) => {
|
|
2544
|
+
k.stopPropagation(), R(o), c(false);
|
|
2545
|
+
}, L = (k) => {
|
|
2546
|
+
k.preventDefault(), P(o), c(true);
|
|
2547
|
+
}, I = () => {
|
|
2548
|
+
P(o), c(false), M();
|
|
2549
|
+
}, z = () => {
|
|
2550
|
+
c(true);
|
|
2551
|
+
}, Q = () => {
|
|
2552
|
+
c(false);
|
|
2553
|
+
}, F = (k) => {
|
|
2554
|
+
k.stopPropagation(), N((U) => U.map((G) => G.accessor === o ? { ...G, toggled: false } : G));
|
|
2555
|
+
};
|
|
2556
|
+
return jsxRuntimeExports.jsxs(Yn, { className: clsx({ "mantine-datatable-header-cell-sortable": r2, "mantine-datatable-header-cell-toggleable": i, "mantine-datatable-header-cell-resizable": s }, e), style: [{ width: b, ...s ? { minWidth: "1px" } : { minWidth: b, maxWidth: b } }, t], role: r2 ? "button" : void 0, tabIndex: r2 ? 0 : void 0, onClick: w, onKeyDown: (k) => k.key === "Enter" && (w == null ? void 0 : w()), ref: y, children: [jsxRuntimeExports.jsxs(Zn, { className: "mantine-datatable-header-cell-sortable-group", justify: "space-between", wrap: "nowrap", children: [jsxRuntimeExports.jsxs(Jn, { align: "center", w: "100%", className: clsx({ "mantine-datatable-header-cell-draggable": l, "mantine-datatable-header-cell-drag-over": A }), draggable: l, onDragStart: l ? h : void 0, onDragEnter: l ? z : void 0, onDragOver: l ? L : void 0, onDrop: l ? I : void 0, onDragLeave: l ? Q : void 0, children: [l ? jsxRuntimeExports.jsx(Fe, { role: "img", "aria-label": "Drag column", children: jsxRuntimeExports.jsx(io, { className: "mantine-datatable-header-cell-draggable-action-icon", variant: "subtle", size: "xs", onClick: (k) => {
|
|
2557
|
+
k.stopPropagation();
|
|
2558
|
+
}, children: jsxRuntimeExports.jsx(ro, {}) }) }) : null, jsxRuntimeExports.jsx(Kn, { className: clsx("mantine-datatable-header-cell-sortable-text", { [J]: m === "left", [Z]: m === "center", [Y]: m === "right" }, ue, me), title: u, children: f })] }), i ? jsxRuntimeExports.jsx(Fe, { className: "mantine-datatable-header-cell-toggleable-icon", role: "img", "aria-label": "Toggle column", children: jsxRuntimeExports.jsx(io, { size: "xs", variant: "light", onClick: F, children: jsxRuntimeExports.jsx(lo, {}) }) }) : null, r2 || (p == null ? void 0 : p.columnAccessor) === o ? jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: (p == null ? void 0 : p.columnAccessor) === o ? jsxRuntimeExports.jsx(Fe, { className: clsx("mantine-datatable-header-cell-sortable-icon", { "mantine-datatable-header-cell-sortable-icon-reversed": p.direction === "desc" }), role: "img", "aria-label": `Sorted ${p.direction === "desc" ? "descending" : "ascending"}`, children: (d == null ? void 0 : d.sorted) || jsxRuntimeExports.jsx(ao, {}) }) : jsxRuntimeExports.jsx(Fe, { className: "mantine-datatable-header-cell-sortable-unsorted-icon", role: "img", "aria-label": "Not sorted", children: (d == null ? void 0 : d.unsorted) || jsxRuntimeExports.jsx(no, {}) }) }) : null, g ? jsxRuntimeExports.jsx(to, { filterPopoverProps: x, isActive: !!D, children: g }) : null] }), s ? jsxRuntimeExports.jsx(oo, { accessor: o, columnRef: y }) : null] });
|
|
2559
|
+
}
|
|
2560
|
+
const tr = window["MantineCore"].Checkbox;
|
|
2561
|
+
const or = window["MantineCore"].TableTh;
|
|
2562
|
+
const nr = window["React"].forwardRef;
|
|
2563
|
+
var uo = nr(function({ className: t, style: o, trigger: n, shadowVisible: a, checked: r2, indeterminate: l, checkboxProps: i, onChange: s, rowSpan: d }, m) {
|
|
2564
|
+
let b = !i.disabled;
|
|
2565
|
+
return jsxRuntimeExports.jsx(or, { ref: m, className: clsx("mantine-datatable-header-selector-cell", { [B]: n === "cell" && b }, t), style: o, rowSpan: d, "data-shadow-visible": a || void 0, onClick: n === "cell" && b ? s : void 0, children: jsxRuntimeExports.jsx(tr, { classNames: b ? { input: B } : void 0, checked: r2, indeterminate: l, onChange: s, ...i, disabled: !(s || i.onChange) || i.disabled }) });
|
|
2566
|
+
});
|
|
2567
|
+
var po = pr(function({ selectionColumnHeaderRef: t, className: o, style: n, sortStatus: a, sortIcons: r2, onSortStatusChange: l, columns: i, defaultColumnProps: s, groups: d, selectionTrigger: m, selectionVisible: b, selectionChecked: p, selectionIndeterminate: T, onSelectionChange: g, selectionCheckboxProps: x, selectorCellShadowVisible: D, selectionColumnClassName: S, selectionColumnStyle: R }, P) {
|
|
2568
|
+
let M = b ? jsxRuntimeExports.jsx(uo, { ref: t, className: S, style: R, trigger: m, shadowVisible: D, checked: p, indeterminate: T, checkboxProps: x, onChange: g, rowSpan: d ? 2 : void 0 }) : null, { columnsToggle: N, setColumnsToggle: A } = de(), [c, y] = fr(false), f = i.some((h) => h.toggleable), u = f ? Object.fromEntries(i.map(({ accessor: h, title: L }) => [h, L ?? ce(String(h))])) : void 0, w = jsxRuntimeExports.jsxs(ur, { className: clsx("mantine-datatable-header", o), style: n, ref: P, onContextMenu: f ? (h) => {
|
|
2569
|
+
h.preventDefault(), y((L) => !L);
|
|
2570
|
+
} : void 0, children: [d && jsxRuntimeExports.jsxs(mo, { children: [M, d.map((h) => jsxRuntimeExports.jsx(Zt, { group: h }, h.id))] }), jsxRuntimeExports.jsxs(mo, { children: [!d && M, i.map(({ hidden: h, ...L }, I) => {
|
|
2571
|
+
if (h) return null;
|
|
2572
|
+
let { accessor: z, visibleMediaQuery: Q, textAlign: F, width: k, title: U, sortable: G, draggable: pe, toggleable: fe, resizable: be, titleClassName: Te, titleStyle: ge, filter: j, filterPopoverProps: he, filtering: Ce, sortKey: X } = { ...s, ...L };
|
|
2573
|
+
return jsxRuntimeExports.jsx(so, { accessor: z, className: Te, style: ge, visibleMediaQuery: Q, textAlign: F, width: k, title: U, sortable: G, draggable: pe, toggleable: fe, resizable: be && I < i.length - 1, sortStatus: a, sortIcons: r2, sortKey: X, onSortStatusChange: l, filter: j, filterPopoverProps: he, filtering: Ce }, z);
|
|
2574
|
+
})] })] });
|
|
2575
|
+
return f ? jsxRuntimeExports.jsxs(ir, { position: "bottom", withArrow: true, shadow: "md", opened: c, onChange: y, children: [jsxRuntimeExports.jsx(dr, { children: w }), jsxRuntimeExports.jsx(sr, { children: jsxRuntimeExports.jsx(cr, { children: N.filter((h) => h.toggleable).map((h) => jsxRuntimeExports.jsx(lr, { children: jsxRuntimeExports.jsx(rr, { classNames: { label: "mantine-datatable-header-column-toggle-checkbox-label" }, size: "xs", label: u[h.accessor], checked: h.toggled, onChange: (L) => {
|
|
2576
|
+
A(N.map((I) => I.accessor === h.accessor ? { ...I, toggled: L.currentTarget.checked } : I));
|
|
2577
|
+
} }) }, h.accessor)) }) })] }) : w;
|
|
2578
|
+
});
|
|
2579
|
+
const br = window["MantineCore"].Center;
|
|
2580
|
+
const Tr = window["MantineCore"].Loader;
|
|
2581
|
+
function bo({ pt: e, pb: t, fetching: o, customContent: n, backgroundBlur: a, size: r2, type: l, color: i }) {
|
|
2582
|
+
return jsxRuntimeExports.jsx(br, { pt: e, pb: t, className: clsx("mantine-datatable-loader", { "mantine-datatable-loader-fetching": o }), style: [{ backdropFilter: a ? `blur(${a}px)` : void 0 }], children: o && (n || jsxRuntimeExports.jsx(Tr, { size: r2, type: l, color: i })) });
|
|
2583
|
+
}
|
|
2584
|
+
const Rr = window["MantineCore"].Box;
|
|
2585
|
+
const Mr = window["MantineCore"].Pagination;
|
|
2586
|
+
const kr = window["MantineCore"].Text;
|
|
2587
|
+
const Er = window["MantineCore"].rem;
|
|
2588
|
+
const Nr = window["React"].forwardRef;
|
|
2589
|
+
const Dr = window["MantineCore"].Button;
|
|
2590
|
+
const yr = window["MantineCore"].Group;
|
|
2591
|
+
const wr = window["MantineCore"].Menu;
|
|
2592
|
+
const Sr = window["MantineCore"].MenuDropdown;
|
|
2593
|
+
const Pr = window["MantineCore"].MenuItem;
|
|
2594
|
+
const xr = window["MantineCore"].MenuTarget;
|
|
2595
|
+
const Co = window["MantineCore"].Text;
|
|
2596
|
+
const Re = window["MantineCore"].rem;
|
|
2597
|
+
const hr = window["MantineCore"].parseThemeColor;
|
|
2598
|
+
function v(e, t, o) {
|
|
2599
|
+
return e ? hr({ color: typeof e == "object" ? e[o] : e, theme: t }).value : void 0;
|
|
2600
|
+
}
|
|
2601
|
+
function To({ theme: e, c: t, backgroundColor: o, borderColor: n, rowBorderColor: a, stripedColor: r2, highlightOnHoverColor: l }) {
|
|
2602
|
+
return { "--mantine-datatable-color-light": v(t, e, "light"), "--mantine-datatable-color-dark": v(t, e, "dark"), "--mantine-datatable-background-color-light": v(o, e, "light"), "--mantine-datatable-background-color-dark": v(o, e, "dark"), "--mantine-datatable-border-color-light": v(n, e, "light"), "--mantine-datatable-border-color-dark": v(n, e, "dark"), "--mantine-datatable-row-border-color-light": v(a, e, "light"), "--mantine-datatable-row-border-color-dark": v(a, e, "dark"), "--mantine-datatable-striped-color-light": v(r2, e, "light"), "--mantine-datatable-striped-color-dark": v(r2, e, "dark"), "--mantine-datatable-highlight-on-hover-color-light": v(l, e, "light"), "--mantine-datatable-highlight-on-hover-color-dark": v(l, e, "dark") };
|
|
2603
|
+
}
|
|
2604
|
+
function Xe({ theme: e, paginationActiveTextColor: t, paginationActiveBackgroundColor: o }) {
|
|
2605
|
+
return { "--mantine-datatable-pagination-active-text-color-light": v(t, e, "light"), "--mantine-datatable-pagination-active-text-color-dark": v(t, e, "dark"), "--mantine-datatable-pagination-active-background-color-light": v(o, e, "light"), "--mantine-datatable-pagination-active-background-color-dark": v(o, e, "dark") };
|
|
2606
|
+
}
|
|
2607
|
+
function go({ theme: e, color: t, backgroundColor: o }) {
|
|
2608
|
+
return { "--mantine-datatable-row-color-light": v(t, e, "light"), "--mantine-datatable-row-color-dark": v(t, e, "dark"), "--mantine-datatable-row-background-color-light": v(o, e, "light"), "--mantine-datatable-row-background-color-dark": v(o, e, "dark") };
|
|
2609
|
+
}
|
|
2610
|
+
function ho() {
|
|
2611
|
+
return jsxRuntimeExports.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round", children: [jsxRuntimeExports.jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), jsxRuntimeExports.jsx("path", { d: "M8 9l4 -4l4 4" }), jsxRuntimeExports.jsx("path", { d: "M16 15l-4 4l-4 -4" })] });
|
|
2612
|
+
}
|
|
2613
|
+
var Do = { xs: Re(22), sm: Re(26), md: Re(32), lg: Re(38), xl: Re(44) };
|
|
2614
|
+
function wo({ size: e, label: t, values: o, value: n, activeTextColor: a, activeBackgroundColor: r2, onChange: l }) {
|
|
2615
|
+
return jsxRuntimeExports.jsxs(yr, { gap: "xs", children: [jsxRuntimeExports.jsx(Co, { component: "div", size: e, children: t }), jsxRuntimeExports.jsxs(wr, { withinPortal: true, withArrow: true, classNames: { arrow: "mantine-datatable-page-size-selector-menu-arrow" }, children: [jsxRuntimeExports.jsx(xr, { children: jsxRuntimeExports.jsx(Dr, { size: e, variant: "default", classNames: { section: "mantine-datatable-page-size-selector-button-icon" }, rightSection: jsxRuntimeExports.jsx(ho, {}), style: [{ fontWeight: "normal" }, (i) => ({ height: Do[e], paddingLeft: i.spacing[e], paddingRight: i.spacing[e] })], children: n }) }), jsxRuntimeExports.jsx(Sr, { children: o.map((i) => {
|
|
2616
|
+
let s = i === n;
|
|
2617
|
+
return jsxRuntimeExports.jsx(Pr, { className: clsx({ "mantine-datatable-page-size-selector-active": s }), style: [{ height: Do[e] }, s && (a || r2) ? (d) => Xe({ theme: d, paginationActiveTextColor: a, paginationActiveBackgroundColor: r2 }) : void 0], disabled: s, onClick: () => l(i), children: jsxRuntimeExports.jsx(Co, { component: "div", size: e, children: i }) }, i);
|
|
2618
|
+
}) })] })] });
|
|
2619
|
+
}
|
|
2620
|
+
var Po = Nr(function({ className: t, style: o, fetching: n, page: a, onPageChange: r2, paginationWithEdges: l, paginationWithControls: i, paginationActiveTextColor: s, paginationActiveBackgroundColor: d, paginationSize: m, loadingText: b, noRecordsText: p, paginationText: T, totalRecords: g, recordsPerPage: x, onRecordsPerPageChange: D, recordsPerPageLabel: S, recordsPerPageOptions: R, recordsLength: P, horizontalSpacing: M, paginationWrapBreakpoint: N, getPaginationControlProps: A }, c) {
|
|
2621
|
+
let y;
|
|
2622
|
+
if (g) {
|
|
2623
|
+
let u = (a - 1) * x + 1, w = u + (P || 0) - 1;
|
|
2624
|
+
y = T({ from: u, to: w, totalRecords: g });
|
|
2625
|
+
} else y = n ? b : p;
|
|
2626
|
+
let f = K(({ breakpoints: u }) => `(min-width: ${typeof N == "number" ? `${Er(N)}rem` : u[N] || N})`);
|
|
2627
|
+
return jsxRuntimeExports.jsxs(Rr, { ref: c, px: M ?? "xs", py: "xs", className: clsx("mantine-datatable-pagination", t), style: [{ flexDirection: f ? "row" : "column" }, o], children: [jsxRuntimeExports.jsx(kr, { component: "div", className: "mantine-datatable-pagination-text", size: m, children: y }), R && jsxRuntimeExports.jsx(wo, { activeTextColor: s, activeBackgroundColor: d, size: m, label: S, values: R, value: x, onChange: D }), jsxRuntimeExports.jsx(Mr, { classNames: { root: clsx("mantine-datatable-pagination-pages", { "mantine-datatable-pagination-pages-fetching": n || !P }), control: "mantine-datatable-pagination-pages-control" }, style: s || d ? (u) => Xe({ theme: u, paginationActiveTextColor: s, paginationActiveBackgroundColor: d }) : void 0, withEdges: l, withControls: i, value: a, onChange: r2, size: m, total: Math.ceil(g / x), getControlProps: A })] });
|
|
2628
|
+
});
|
|
2629
|
+
const Gr = window["MantineCore"].TableTr;
|
|
2630
|
+
const Hr = window["MantineCore"].TableTd;
|
|
2631
|
+
function xo({ className: e, style: t, visibleMediaQuery: o, record: n, index: a, onClick: r2, onDoubleClick: l, onContextMenu: i, noWrap: s, ellipsis: d, textAlign: m, width: b, accessor: p, render: T, defaultRender: g, customCellAttributes: x }) {
|
|
2632
|
+
return K(o) ? jsxRuntimeExports.jsx(Hr, { className: clsx({ [ue]: s || d, [me]: d, [B]: r2 || l, [Ae]: i, [J]: m === "left", [Z]: m === "center", [Y]: m === "right" }, e), style: [{ width: b, minWidth: b, maxWidth: b }, t], onClick: r2, onDoubleClick: l, onContextMenu: i, ...x == null ? void 0 : x(n, a), children: T ? T(n, a) : g ? g(n, a, p) : rt(n, p) }) : null;
|
|
2633
|
+
}
|
|
2634
|
+
const Wr = window["MantineCore"].Collapse;
|
|
2635
|
+
const Ar = window["MantineCore"].TableTd;
|
|
2636
|
+
const vo = window["MantineCore"].TableTr;
|
|
2637
|
+
function Ro({ open: e, colSpan: t, content: o, collapseProps: n }) {
|
|
2638
|
+
let { expanded: a, visible: r2 } = Xt(e, n == null ? void 0 : n.transitionDuration);
|
|
2639
|
+
return r2 ? jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(vo, {}), jsxRuntimeExports.jsx(vo, { children: jsxRuntimeExports.jsx(Ar, { className: "mantine-datatable-row-expansion-cell", colSpan: t, children: jsxRuntimeExports.jsx(Wr, { in: a, ...n, children: jsxRuntimeExports.jsx("div", { className: "mantine-datatable-row-expansion-cell-content", children: o() }) }) }) })] }) : null;
|
|
2640
|
+
}
|
|
2641
|
+
const _r = window["MantineCore"].Checkbox;
|
|
2642
|
+
const Fr = window["MantineCore"].TableTd;
|
|
2643
|
+
function ko({ className: e, style: t, record: o, index: n, trigger: a, onChange: r2, withRightShadow: l, checkboxProps: i, getCheckboxProps: s, ...d }) {
|
|
2644
|
+
let m = { ...i, ...s(o, n) }, b = !d.disabled && !m.disabled, p = (T) => {
|
|
2645
|
+
T.stopPropagation(), a === "cell" && b && (r2 == null ? void 0 : r2(T));
|
|
2646
|
+
};
|
|
2647
|
+
return jsxRuntimeExports.jsx(Fr, { className: clsx("mantine-datatable-row-selector-cell", { [B]: a === "cell" && b }, e), style: t, "data-shadow-visible": l || void 0, onClick: p, children: jsxRuntimeExports.jsx(_r, { classNames: b ? { input: B } : void 0, onChange: r2, ...d, ...m }) });
|
|
2648
|
+
}
|
|
2649
|
+
function Lo({ record: e, index: t, columns: o, defaultColumnProps: n, defaultColumnRender: a, selectionTrigger: r2, selectionVisible: l, selectionChecked: i, onSelectionChange: s, isRecordSelectable: d, selectionCheckboxProps: m, getSelectionCheckboxProps: b, onClick: p, onDoubleClick: T, onContextMenu: g, onCellClick: x, onCellDoubleClick: D, onCellContextMenu: S, expansion: R, customAttributes: P, color: M, backgroundColor: N, className: A, style: c, selectorCellShadowVisible: y, selectionColumnClassName: f, selectionColumnStyle: u, rowFactory: w }) {
|
|
2650
|
+
let h = jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [l && jsxRuntimeExports.jsx(ko, { className: f, style: u, record: e, index: t, trigger: r2, withRightShadow: y, checked: i, disabled: !s || (d ? !d(e, t) : false), onChange: s, checkboxProps: m, getCheckboxProps: b }), o.map(({ hidden: z, hiddenContent: Q, ...F }, k) => {
|
|
2651
|
+
if (z || Q) return null;
|
|
2652
|
+
let { accessor: U, visibleMediaQuery: G, textAlign: pe, noWrap: fe, ellipsis: be, width: Te, render: ge, cellsClassName: j, cellsStyle: he, customCellAttributes: Ce } = { ...n, ...F };
|
|
2653
|
+
return jsxRuntimeExports.jsx(xo, { className: typeof j == "function" ? j(e, t) : j, style: he == null ? void 0 : he(e, t), visibleMediaQuery: G, record: e, index: t, onClick: x ? (X) => x({ event: X, record: e, index: t, column: F, columnIndex: k }) : void 0, onDoubleClick: D ? (X) => D({ event: X, record: e, index: t, column: F, columnIndex: k }) : void 0, onContextMenu: S ? (X) => S({ event: X, record: e, index: t, column: F, columnIndex: k }) : void 0, accessor: U, textAlign: pe, noWrap: fe, ellipsis: be, width: Te, render: ge, defaultRender: a, customCellAttributes: Ce }, U);
|
|
2654
|
+
})] }), L = R && jsxRuntimeExports.jsx(Ro, { colSpan: o.filter(({ hidden: z }) => !z).length + (l ? 1 : 0), open: R.isRowExpanded(e), content: R.content({ record: e, index: t }), collapseProps: R.collapseProps }), I = Qr({ record: e, index: t, selectionChecked: i, onClick: p, onDoubleClick: T, onContextMenu: g, expansion: R, customAttributes: P, color: M, backgroundColor: N, className: A, style: c });
|
|
2655
|
+
return w ? w({ record: e, index: t, rowProps: I, children: h, expandedElement: L }) : jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Gr, { ...I, children: h }), L] });
|
|
2656
|
+
}
|
|
2657
|
+
function Qr({ record: e, index: t, selectionChecked: o, onClick: n, onDoubleClick: a, onContextMenu: r2, expansion: l, customAttributes: i, color: s, backgroundColor: d, className: m, style: b }) {
|
|
2658
|
+
return { className: clsx("mantine-datatable-row", { [B]: n || a || (l == null ? void 0 : l.isExpandable({ record: e, index: t })) && (l == null ? void 0 : l.expandOnClick) }, { [Ae]: r2 }, typeof m == "function" ? m(e, t) : m), "data-selected": o || void 0, onClick: (p) => {
|
|
2659
|
+
if (l) {
|
|
2660
|
+
let { isExpandable: T, isRowExpanded: g, expandOnClick: x, expandRow: D, collapseRow: S } = l;
|
|
2661
|
+
T({ record: e, index: t }) && x && (g(e) ? S(e) : D(e));
|
|
2662
|
+
}
|
|
2663
|
+
n == null ? void 0 : n({ event: p, record: e, index: t });
|
|
2664
|
+
}, onDoubleClick: a ? (p) => a({ event: p, record: e, index: t }) : void 0, onContextMenu: r2 ? (p) => r2({ event: p, record: e, index: t }) : void 0, style: [s || d ? (p) => {
|
|
2665
|
+
let T = s == null ? void 0 : s(e, t), g = d == null ? void 0 : d(e, t);
|
|
2666
|
+
return go({ theme: p, color: T, backgroundColor: g });
|
|
2667
|
+
} : void 0, b == null ? void 0 : b(e, t)], ...(i == null ? void 0 : i(e, t)) ?? {} };
|
|
2668
|
+
}
|
|
2669
|
+
const Ho = window["MantineCore"].Box;
|
|
2670
|
+
const Ur = window["MantineCore"].ScrollArea;
|
|
2671
|
+
const Io = window["MantineCore"].rem;
|
|
2672
|
+
function Oo({ topShadowVisible: e, leftShadowVisible: t, leftShadowBehind: o, rightShadowVisible: n, rightShadowBehind: a, bottomShadowVisible: r2, headerHeight: l, footerHeight: i, onScrollPositionChange: s, children: d, viewportRef: m, scrollAreaProps: b }) {
|
|
2673
|
+
return jsxRuntimeExports.jsxs(Ur, { ...b, viewportRef: m, classNames: { root: "mantine-datatable-scroll-area", scrollbar: "mantine-datatable-scroll-area-scrollbar", thumb: "mantine-datatable-scroll-area-thumb", corner: "mantine-datatable-scroll-area-corner" }, onScrollPositionChange: s, children: [d, jsxRuntimeExports.jsx(Ho, { className: clsx("mantine-datatable-scroll-area-shadow", "mantine-datatable-scroll-area-top-shadow", { "mantine-datatable-scroll-area-shadow-visible": e }), style: { top: l ? Io(l) : 0 } }), jsxRuntimeExports.jsx("div", { className: clsx("mantine-datatable-scroll-area-shadow", "mantine-datatable-scroll-area-left-shadow", { "mantine-datatable-scroll-area-shadow-visible": t, "mantine-datatable-scroll-area-shadow-behind": o }) }), jsxRuntimeExports.jsx("div", { className: clsx("mantine-datatable-scroll-area-shadow", "mantine-datatable-scroll-area-right-shadow", { "mantine-datatable-scroll-area-shadow-visible": n, "mantine-datatable-scroll-area-shadow-behind": a }) }), jsxRuntimeExports.jsx(Ho, { className: clsx("mantine-datatable-scroll-area-shadow", "mantine-datatable-scroll-area-bottom-shadow", { "mantine-datatable-scroll-area-shadow-visible": r2 }), style: { bottom: i ? Io(i + 1) : 0 } })] });
|
|
2674
|
+
}
|
|
2675
|
+
function qr({ withTableBorder: e, borderRadius: t, textSelectionDisabled: o, height: n = "100%", minHeight: a, maxHeight: r2, shadow: l, verticalAlign: i = "center", fetching: s, columns: d, storeColumnsKey: m, groups: b, pinFirstColumn: p, pinLastColumn: T, defaultColumnProps: g, defaultColumnRender: x, idAccessor: D = "id", records: S, selectionTrigger: R = "checkbox", selectedRecords: P, onSelectedRecordsChange: M, selectionColumnClassName: N, selectionColumnStyle: A, isRecordSelectable: c, selectionCheckboxProps: y, allRecordsSelectionCheckboxProps: f = { "aria-label": "Select all records" }, getRecordSelectionCheckboxProps: u = (O, ee) => ({ "aria-label": `Select record ${ee + 1}` }), sortStatus: w, sortIcons: h, onSortStatusChange: L, horizontalSpacing: I, page: z, onPageChange: Q, totalRecords: F, recordsPerPage: k, onRecordsPerPageChange: U, recordsPerPageOptions: G, recordsPerPageLabel: pe = "Records per page", paginationWithEdges: fe, paginationWithControls: be, paginationActiveTextColor: Te, paginationActiveBackgroundColor: ge, paginationSize: j = "sm", paginationText: he = ({ from: O, to: ee, totalRecords: te }) => `${O} - ${ee} / ${te}`, paginationWrapBreakpoint: Ce = "sm", getPaginationControlProps: X = (O) => O === "previous" ? { "aria-label": "Previous page" } : O === "next" ? { "aria-label": "Next page" } : {}, loaderBackgroundBlur: _o, customLoader: Fo, loaderSize: Bo, loaderType: Go, loaderColor: Xo, loadingText: Qo = "...", emptyState: Uo, noRecordsText: ut = "No records", noRecordsIcon: $o, highlightOnHover: Ko, striped: Jo, noHeader: Zo, onRowClick: Yo, onRowDoubleClick: qo, onRowContextMenu: jo, onCellClick: ea, onCellDoubleClick: ta, onCellContextMenu: oa, onScroll: mt, onScrollToTop: pt, onScrollToBottom: ft, onScrollToLeft: bt, onScrollToRight: Tt, c: aa, backgroundColor: na, borderColor: ra, rowBorderColor: la, stripedColor: ia, highlightOnHoverColor: sa, rowColor: da, rowBackgroundColor: ca, rowExpansion: ua, rowClassName: ma, rowStyle: pa, customRowAttributes: fa, scrollViewportRef: ba, scrollAreaProps: Ta, tableRef: ga, bodyRef: ha, m: Ca, my: Da, mx: ya, mt: wa, mb: Sa, ml: Pa, mr: xa, className: va, classNames: De, style: Ra, styles: ye, rowFactory: Ma, tableWrapper: Je, ...gt }) {
|
|
2676
|
+
let { ref: O, width: ee, height: te } = ne(), we = Yr(() => (b == null ? void 0 : b.flatMap((C) => C.columns)) ?? d, [d, b]), ht = It({ key: m, columns: we }), { ref: ka, height: Ze } = ne(), { ref: Ea, width: Ye, height: Se } = ne(), { ref: Na, height: La } = ne(), { ref: Ha, height: Ct } = ne(), { ref: Ia, width: Oa } = ne(), Wa = useMergedRef(Ea, ga), Aa = useMergedRef(O, ba), [qe, Dt] = Ke(true), [je, yt] = Ke(true), [Pe, wt] = Ke(true), [Ee, St] = Ke(true), za = Ft({ rowExpansion: ua, records: S, idAccessor: D }), et = ke(() => {
|
|
2677
|
+
var _a3, _b2;
|
|
2678
|
+
let C = ((_a3 = O.current) == null ? void 0 : _a3.scrollTop) ?? 0, $ = ((_b2 = O.current) == null ? void 0 : _b2.scrollLeft) ?? 0;
|
|
2679
|
+
if (s || Se <= te) Dt(true), yt(true);
|
|
2680
|
+
else {
|
|
2681
|
+
let V = C === 0, _ = Se - C - te < 1;
|
|
2682
|
+
Dt(V), yt(_), V && V !== qe && (pt == null ? void 0 : pt()), _ && _ !== je && (ft == null ? void 0 : ft());
|
|
2683
|
+
}
|
|
2684
|
+
if (s || Ye === ee) wt(true), St(true);
|
|
2685
|
+
else {
|
|
2686
|
+
let V = $ === 0, _ = Ye - $ - ee < 1;
|
|
2687
|
+
wt(V), St(_), V && V !== Pe && (bt == null ? void 0 : bt()), _ && _ !== Ee && (Tt == null ? void 0 : Tt());
|
|
2688
|
+
}
|
|
2689
|
+
}, [s, ft, bt, Tt, pt, te, O, ee, je, Pe, Ee, qe, Se, Ye]);
|
|
2690
|
+
Ot(et, [et]);
|
|
2691
|
+
let Pt = useDebouncedCallback(et, 50), Va = ke((C) => {
|
|
2692
|
+
mt == null ? void 0 : mt(C), Pt();
|
|
2693
|
+
}, [Pt, mt]), _a2 = ke((C) => {
|
|
2694
|
+
var _a3;
|
|
2695
|
+
(_a3 = O.current) == null ? void 0 : _a3.scrollTo({ top: 0, left: 0 }), Q(C);
|
|
2696
|
+
}, [Q, O]), Ne = S == null ? void 0 : S.length, xt = S == null ? void 0 : S.map((C) => E(C, D)), ie = !!P, xe = P == null ? void 0 : P.map((C) => E(C, D)), vt = xt !== void 0 && xe !== void 0 && xe.length > 0, tt = c ? S == null ? void 0 : S.filter(c) : S, Le = tt == null ? void 0 : tt.map((C) => E(C, D)), He = vt && Le.every((C) => xe.includes(C)), Fa = vt && Le.some((C) => xe.includes(C)), Ba = ke(() => {
|
|
2697
|
+
P && M && M(He ? P.filter((C) => !Le.includes(E(C, D))) : We([...P, ...tt], (C) => E(C, D)));
|
|
2698
|
+
}, [He, D, M, Le, tt, P]), { lastSelectionChangeIndex: Ie, setLastSelectionChangeIndex: Ga } = Wt(xt), ot = ie && !Pe && !p, Xa = { m: Ca, my: Da, mx: ya, mt: wa, mb: Sa, ml: Pa, mr: xa }, Qa = ke(({ children: C }) => Je ? Je({ children: C }) : C, [Je]);
|
|
2699
|
+
return jsxRuntimeExports.jsx(at, { ...ht, children: jsxRuntimeExports.jsxs(Kr, { ...Xa, className: clsx("mantine-datatable", { "mantine-datatable-with-border": e }, va, De == null ? void 0 : De.root), style: [(C) => ({ ...To({ theme: C, c: aa, backgroundColor: na, borderColor: ra, rowBorderColor: la, stripedColor: ia, highlightOnHoverColor: sa }), borderRadius: C.radius[t] || t, boxShadow: C.shadows[l] || l, height: n, minHeight: a, maxHeight: r2 }), Ra, ye == null ? void 0 : ye.root, { position: "relative" }], children: [jsxRuntimeExports.jsx(Oo, { viewportRef: Aa, topShadowVisible: !qe, leftShadowVisible: !Pe, leftShadowBehind: ie || !!p, rightShadowVisible: !Ee, rightShadowBehind: T, bottomShadowVisible: !je, headerHeight: Ze, footerHeight: La, onScrollPositionChange: Va, scrollAreaProps: Ta, children: jsxRuntimeExports.jsx(Qa, { children: jsxRuntimeExports.jsxs(Jr, { ref: Wa, horizontalSpacing: I, className: clsx("mantine-datatable-table", { [Qt]: o, "mantine-datatable-vertical-align-top": i === "top", "mantine-datatable-vertical-align-bottom": i === "bottom", "mantine-datatable-last-row-border-bottom-visible": gt.withRowBorders && Se < te, "mantine-datatable-pin-last-column": T, "mantine-datatable-pin-last-column-scrolled": !Ee && T, "mantine-datatable-selection-column-visible": ie, "mantine-datatable-pin-first-column": p, "mantine-datatable-pin-first-column-scrolled": !Pe && p }, De == null ? void 0 : De.table), style: { ...ye == null ? void 0 : ye.table, "--mantine-datatable-selection-column-width": `${Oa}px` }, "data-striped": Ne && Jo || void 0, "data-highlight-on-hover": Ko || void 0, ...gt, children: [Zo ? null : jsxRuntimeExports.jsx(at, { ...ht, children: jsxRuntimeExports.jsx(po, { ref: ka, selectionColumnHeaderRef: Ia, className: De == null ? void 0 : De.header, style: ye == null ? void 0 : ye.header, columns: we, defaultColumnProps: g, groups: b, sortStatus: w, sortIcons: h, onSortStatusChange: L, selectionTrigger: R, selectionVisible: ie, selectionChecked: He, selectionIndeterminate: Fa && !He, onSelectionChange: Ba, selectionCheckboxProps: { ...y, ...f }, selectorCellShadowVisible: ot, selectionColumnClassName: N, selectionColumnStyle: A }) }), jsxRuntimeExports.jsx("tbody", { ref: ha, children: Ne ? S.map((C, $) => {
|
|
2700
|
+
let V = E(C, D), _ = (xe == null ? void 0 : xe.includes(V)) || false, Rt;
|
|
2701
|
+
return M && P && (Rt = (Ua) => {
|
|
2702
|
+
if (Ua.nativeEvent.shiftKey && Ie !== null) {
|
|
2703
|
+
let se = S.filter($ > Ie ? (oe, ae) => ae >= Ie && ae <= $ && (c ? c(oe, ae) : true) : (oe, ae) => ae >= $ && ae <= Ie && (c ? c(oe, ae) : true));
|
|
2704
|
+
M(_ ? _t(P, se, (oe) => E(oe, D)) : We([...P, ...se], (oe) => E(oe, D)));
|
|
2705
|
+
} else M(_ ? P.filter((se) => E(se, D) !== V) : We([...P, C], (se) => E(se, D)));
|
|
2706
|
+
Ga($);
|
|
2707
|
+
}), jsxRuntimeExports.jsx(Lo, { record: C, index: $, columns: we, defaultColumnProps: g, defaultColumnRender: x, selectionTrigger: R, selectionVisible: ie, selectionChecked: _, onSelectionChange: Rt, isRecordSelectable: c, selectionCheckboxProps: y, getSelectionCheckboxProps: u, onClick: Yo, onDoubleClick: qo, onCellClick: ea, onCellDoubleClick: ta, onContextMenu: jo, onCellContextMenu: oa, expansion: za, color: da, backgroundColor: ca, className: ma, style: pa, customAttributes: fa, selectorCellShadowVisible: ot, selectionColumnClassName: N, selectionColumnStyle: A, idAccessor: D, rowFactory: Ma }, V);
|
|
2708
|
+
}) : jsxRuntimeExports.jsx(Nt, {}) }), we.some(({ footer: C }) => C) && jsxRuntimeExports.jsx(Kt, { ref: Na, className: De == null ? void 0 : De.footer, style: ye == null ? void 0 : ye.footer, columns: we, defaultColumnProps: g, selectionVisible: ie, selectorCellShadowVisible: ot, scrollDiff: Se - te })] }) }) }), z && jsxRuntimeExports.jsx(Po, { ref: Ha, className: De == null ? void 0 : De.pagination, style: ye == null ? void 0 : ye.pagination, horizontalSpacing: I, fetching: s, page: z, onPageChange: _a2, totalRecords: F, recordsPerPage: k, onRecordsPerPageChange: U, recordsPerPageOptions: G, recordsPerPageLabel: pe, paginationWithEdges: fe, paginationWithControls: be, paginationActiveTextColor: Te, paginationActiveBackgroundColor: ge, paginationSize: j, paginationText: he, paginationWrapBreakpoint: Ce, getPaginationControlProps: X, noRecordsText: ut, loadingText: Qo, recordsLength: Ne }), jsxRuntimeExports.jsx(bo, { pt: Ze, pb: Ct, fetching: s, backgroundBlur: _o, customContent: Fo, size: Bo, type: Go, color: Xo }), jsxRuntimeExports.jsx(Ht, { pt: Ze, pb: Ct, icon: $o, text: ut, active: !s && !Ne, children: Uo })] }) });
|
|
2709
|
+
}
|
|
2710
|
+
const jr = window["MantineCore"].TableTr;
|
|
2711
|
+
const tl = window["React"].forwardRef;
|
|
2712
|
+
const ol = window["React"].useEffect;
|
|
2713
|
+
const al = window["React"].useRef;
|
|
2714
|
+
var Vo = tl(function({ children: e, isDragging: t, ...o }, n) {
|
|
2715
|
+
let a = al(null), r2 = useMergedRef(a, n);
|
|
2716
|
+
return ol(() => {
|
|
2717
|
+
if (!a.current || !t) return;
|
|
2718
|
+
let d = a.current.parentElement.parentElement.children[0].children[0];
|
|
2719
|
+
for (let m = 0; m < d.children.length; m++) {
|
|
2720
|
+
let p = d.children[m].getBoundingClientRect(), T = a.current.children[m];
|
|
2721
|
+
T.style.height = p.height + "px", T.style.width = p.width + "px", T.style.minWidth = p.width + "px", T.style.maxWidth = p.width + "px";
|
|
2722
|
+
}
|
|
2723
|
+
}, [t, e]), jsxRuntimeExports.jsx(jr, { "data-is-dragging": t, ref: r2, ...o, children: e });
|
|
2724
|
+
});
|
|
2725
|
+
Vo.displayName = "DataTableDraggableRow";
|
|
2726
|
+
export {
|
|
2727
|
+
AddItemButton as A,
|
|
2728
|
+
IconInfoCircle as I,
|
|
2729
|
+
RowEditAction as R,
|
|
2730
|
+
SearchInput as S,
|
|
2731
|
+
apiUrl as a,
|
|
2732
|
+
RowDuplicateAction as b,
|
|
2733
|
+
RowDeleteAction as c,
|
|
2734
|
+
RowActions as d,
|
|
2735
|
+
IconExclamationCircle as e,
|
|
2736
|
+
formatCurrencyValue as f,
|
|
2737
|
+
IconRefresh as g,
|
|
2738
|
+
checkPluginVersion as h,
|
|
2739
|
+
createReactComponent as i,
|
|
2740
|
+
formatDecimal as j,
|
|
2741
|
+
qr as q,
|
|
2742
|
+
useQuery as u
|
|
2743
|
+
};
|
|
2744
|
+
//# sourceMappingURL=index-BjwOiYns.js.map
|