(()=>{ var __RUSHSTACK_CURRENT_SCRIPT__ = document.currentScript; define("459579c7-954c-469e-b707-ca75d808603f_0.0.1", ["react","react-dom","@microsoft/sp-core-library","@microsoft/sp-property-pane","@microsoft/sp-webpart-base","CtFormsPortalWebPartStrings","@microsoft/sp-http"], (__WEBPACK_EXTERNAL_MODULE__959__, __WEBPACK_EXTERNAL_MODULE__398__, __WEBPACK_EXTERNAL_MODULE__676__, __WEBPACK_EXTERNAL_MODULE__877__, __WEBPACK_EXTERNAL_MODULE__642__, __WEBPACK_EXTERNAL_MODULE__735__, __WEBPACK_EXTERNAL_MODULE__909__) => { return /******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 945:
/*!*****************************************************************************!*\
!*** ./lib/webparts/ctFormsPortal/components/CtFormsPortal.module.scss.css ***!
\*****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_microsoft_sp_css_loader_node_modules_microsoft_load_themed_styles_lib_es6_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/@microsoft/sp-css-loader/node_modules/@microsoft/load-themed-styles/lib-es6/index.js */ 323);
// Imports
_node_modules_microsoft_sp_css_loader_node_modules_microsoft_load_themed_styles_lib_es6_index_js__WEBPACK_IMPORTED_MODULE_0__.loadStyles("#spPageCanvasContent,#workbenchPageContent,.CanvasComponent.LCS .CanvasZone,.CanvasZone,.SPCanvas-canvas{max-width:100%!important}.root_5d66f4da{width:100%}", true);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
root: "root_5d66f4da"
});
/***/ }),
/***/ 9:
/*!*************************************************************************!*\
!*** ./lib/webparts/ctFormsPortal/components/Dashboard.module.scss.css ***!
\*************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_microsoft_sp_css_loader_node_modules_microsoft_load_themed_styles_lib_es6_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../node_modules/@microsoft/sp-css-loader/node_modules/@microsoft/load-themed-styles/lib-es6/index.js */ 323);
// Imports
_node_modules_microsoft_sp_css_loader_node_modules_microsoft_load_themed_styles_lib_es6_index_js__WEBPACK_IMPORTED_MODULE_0__.loadStyles(".head_2269bbe3{align-items:center;display:flex;flex-wrap:wrap;gap:16px;justify-content:space-between;margin-bottom:16px}.title_2269bbe3{color:#0f2440;font-family:Lora,Georgia,serif;font-size:22px;font-weight:600;margin:0}.toolbar_2269bbe3{align-items:center;display:flex;flex-wrap:wrap;gap:12px}.search_2269bbe3{max-width:100%;width:280px}.filter_2269bbe3{width:200px}.tableWrap_2269bbe3{background:#fff;border:1px solid #e5e7eb;border-radius:10px;box-shadow:0 1px 2px rgba(15,36,64,.04),0 1px 3px rgba(15,36,64,.06);margin-top:16px;overflow:hidden}.state_2269bbe3{color:#6b7280;font-size:13px;margin-top:16px}@media (max-width:640px){.filter_2269bbe3,.search_2269bbe3{width:100%}}", true);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
head: "head_2269bbe3",
title: "title_2269bbe3",
toolbar: "toolbar_2269bbe3",
search: "search_2269bbe3",
tableWrap: "tableWrap_2269bbe3",
state: "state_2269bbe3",
filter: "filter_2269bbe3"
});
/***/ }),
/***/ 943:
/*!**************************************************!*\
!*** ./node_modules/@tnsu/ui-kit/dist/style.css ***!
\**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _microsoft_sp_css_loader_node_modules_microsoft_load_themed_styles_lib_es6_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../@microsoft/sp-css-loader/node_modules/@microsoft/load-themed-styles/lib-es6/index.js */ 323);
// Imports
_microsoft_sp_css_loader_node_modules_microsoft_load_themed_styles_lib_es6_index_js__WEBPACK_IMPORTED_MODULE_0__.loadStyles("._btn_104wo_1{align-items:center;border:1px solid #0000;border-radius:6px;cursor:pointer;display:inline-flex;font-family:Inter,-apple-system,Segoe UI,sans-serif;font-size:13px;font-weight:500;gap:7px;justify-content:center;letter-spacing:.15px;padding:10px 20px;transition:all .18s;white-space:nowrap}._btn_104wo_1:disabled{cursor:default;opacity:.55;pointer-events:none}._sm_104wo_23{font-size:12.5px;padding:7px 14px}._full_104wo_28{width:100%}._primary_104wo_32{background:#1b3a5c;border-color:#1b3a5c;color:#fff}._primary_104wo_32:hover{background:#244b73;box-shadow:0 4px 16px #0f244012}._accent_104wo_42{background:linear-gradient(135deg,#e5b635,#d4a01e);border-color:#d4a01e;color:#0a1b30;font-weight:600}._accent_104wo_42:hover{box-shadow:0 4px 20px #d4a01e2e;transform:translateY(-1px)}._secondary_104wo_53{background:#fff;border-color:#d1d5db;color:#1b3a5c}._secondary_104wo_53:hover{border-color:#d4a01e;color:#0f2440}._ghost_104wo_63{background:0 0;color:#244b73}._ghost_104wo_63:hover{background:#e8eef4}._danger_104wo_71{background:#fff;border-color:#d1d5db;color:#dc2626}._danger_104wo_71:hover{background:#fef2f2;border-color:#dc2626}._icon_bqhxe_1{fill:none;stroke:currentColor;stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0;height:20px;width:20px}._sm_bqhxe_12{height:16px;width:16px}._lg_bqhxe_17{height:24px;width:24px}._alert_1qa2n_1{align-items:center;border:1px solid;border-radius:10px;display:flex;font-size:12.5px;gap:10px;margin-bottom:18px;padding:12px 16px}._warn_1qa2n_12{background:#fefbf0;border-color:#f0cc5e;color:#854d0e}._ok_1qa2n_18{background:#f0fdf4;border-color:#bbf7d0;color:#15803d}._err_1qa2n_24{background:#fef2f2;border-color:#fecaca;color:#dc2626}._badge_6pzfu_1{background:#f4f7fa;border:1px solid #e5e7eb;color:#1b3a5c;font-size:13px;letter-spacing:.3px}._badge_1emt2_1,._badge_6pzfu_1{align-items:center;border-radius:6px;display:inline-flex;font-family:Inter,-apple-system,Segoe UI,sans-serif;font-weight:600;padding:5px 12px;white-space:nowrap}._badge_1emt2_1{font-size:12.5px;letter-spacing:.2px}._sm_1emt2_13{border-radius:10px;font-size:11px;letter-spacing:normal;padding:3px 10px}._neutral_1emt2_20{background:#f3f4f6;color:#374151}._muted_1emt2_25{background:#f3f4f6;color:#6b7280}._info_1emt2_30{background:#eff6ff;color:#2563eb}._success_1emt2_35{background:#f0fdf4;color:#15803d}._warning_1emt2_40{background:#fefbf0;color:#854d0e}._danger_1emt2_45{background:#fef2f2;color:#dc2626}._primary_1emt2_50{background:#f4f7fa;color:#1b3a5c}._header_1n3g3_1{align-items:center;background:#f4f7fa;border:1px solid #e8eef4;border-left:3px solid #d4a01e;border-radius:10px;display:flex;gap:12px;padding:14px 20px}._icon_1n3g3_12{color:#244b73;flex-shrink:0}._title_1n3g3_17{color:#0f2440;flex:auto;font-family:Lora,Georgia,serif;font-size:15px;font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._right_1n3g3_29{align-items:center;display:flex;flex-shrink:0;gap:8px}@media (width<=640px){._header_1n3g3_1{flex-wrap:wrap;padding:12px 14px}._title_1n3g3_17{white-space:normal}}._card_rzq1u_1{background:#fff;border:1px solid #e5e7eb;border-radius:14px;box-shadow:0 1px 2px #0f24400a,0 1px 3px #0f24400f;padding:32px}@media (width<=640px){._card_rzq1u_1{padding:18px}}._header_rzq1u_14{align-items:flex-start;display:flex;gap:16px;justify-content:space-between}._title_rzq1u_21{color:#0f2440;font-family:Lora,Georgia,serif;font-size:22px;font-weight:600}._headerRight_rzq1u_28{align-items:center;display:flex;flex-shrink:0;gap:8px}._subtitle_rzq1u_35{color:#9ca3af;font-size:12px;letter-spacing:.3px;margin-top:6px}._hairline_rzq1u_42{background:linear-gradient(90deg,#e5b635,#0000 70%);border:0;height:1px;margin:6px 0 22px}._grid_1ypoi_1{display:grid;gap:18px 22px;grid-template-columns:1fr 1fr}@media (width<=640px){._grid_1ypoi_1{grid-template-columns:1fr}}._field_1wk7n_1{display:flex;flex-direction:column;gap:6px;min-width:0}._full_1wk7n_8{grid-column:1/-1}._label_1wk7n_12{color:#374151;font-size:12px;font-weight:500;letter-spacing:.2px}._req_1wk7n_19{color:#b8881a}._actions_fpjnj_1{background:#fff;border-radius:0 0 14px 14px;border-top:1px solid #e5e7eb;bottom:0;box-shadow:0 -4px 16px #0f24400a;display:flex;gap:10px;justify-content:flex-end;margin:26px -32px -32px;padding:16px 32px;position:sticky}@media (width<=640px){._actions_fpjnj_1{flex-direction:column-reverse;margin:20px -18px -18px;padding:14px 18px}._actions_fpjnj_1>*{width:100%}}._section_v562g_1{margin-top:8px}._header_v562g_5{align-items:center;background:0 0;border:0;border-top:1px solid #e5e7eb;cursor:pointer;display:flex;justify-content:space-between;padding:14px 0 10px;position:relative;width:100%}._header_v562g_5:before{background:#d4a01e;content:\"\";height:1px;left:0;position:absolute;top:-1px;width:48px}._title_v562g_27{align-items:center;color:#0f2440;display:flex;font-family:Lora,Georgia,serif;font-size:14.5px;font-weight:600;gap:10px;letter-spacing:.2px}._title_v562g_27 svg{color:#b8881a}._chevron_v562g_41{color:#9ca3af;display:flex;transition:transform .2s}._open_v562g_47{transform:rotate(180deg)}._body_v562g_51{display:grid;gap:16px 22px;grid-template-columns:1fr 1fr;padding-top:16px}@media (width<=640px){._body_v562g_51{grid-template-columns:1fr}}._input_pzmln_1{background:#fff;border:1px solid #d1d5db;border-radius:6px;box-sizing:border-box;color:#111827;font-family:Inter,-apple-system,Segoe UI,sans-serif;font-size:13.5px;padding:11px 13px;transition:all .18s;width:100%}._input_pzmln_1:focus{border-color:#d4a01e;box-shadow:0 0 0 3px #d4a01e1f;outline:0}._input_pzmln_1:read-only,._input_pzmln_1:read-only:focus{background:#f9fafb;border-color:#e5e7eb;box-shadow:none;color:#6b7280;cursor:default}._input_pzmln_1:-ms-input-placeholder{color:#9ca3af}._input_pzmln_1::placeholder{color:#9ca3af}._textarea_ps7q9_1{background:#fff;border:1px solid #d1d5db;border-radius:6px;box-sizing:border-box;color:#111827;font-family:Inter,-apple-system,Segoe UI,sans-serif;font-size:13.5px;min-height:80px;padding:11px 13px;resize:vertical;transition:all .18s;width:100%}._textarea_ps7q9_1:focus{border-color:#d4a01e;box-shadow:0 0 0 3px #d4a01e1f;outline:0}._textarea_ps7q9_1:read-only,._textarea_ps7q9_1:read-only:focus{background:#f9fafb;border-color:#e5e7eb;box-shadow:none;color:#6b7280;cursor:default}._textarea_ps7q9_1:-ms-input-placeholder{color:#9ca3af}._textarea_ps7q9_1::placeholder{color:#9ca3af}._select_pfqjp_1{appearance:none;background-color:#fff;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='12' height='8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m1 1.5 5 5 5-5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");background-position:right 12px center;background-repeat:no-repeat;border:1px solid #d1d5db;border-radius:6px;box-sizing:border-box;color:#111827;cursor:pointer;font-family:Inter,-apple-system,Segoe UI,sans-serif;font-size:13.5px;padding:11px 36px 11px 13px;transition:all .18s;width:100%}._select_pfqjp_1:focus{border-color:#d4a01e;box-shadow:0 0 0 3px #d4a01e1f;outline:0}._select_pfqjp_1:disabled,._select_pfqjp_1:disabled:focus{background:#f9fafb;border-color:#e5e7eb;box-shadow:none;color:#6b7280;cursor:default}._wrap_2wriw_1{align-items:center;cursor:pointer;display:inline-flex;gap:10px;padding:6px 0}._input_2wriw_9{height:0;opacity:0;position:absolute;width:0}._track_2wriw_16{background:#d1d5db;border-radius:11px;flex-shrink:0;height:22px;position:relative;transition:background .18s;width:40px}._thumb_2wriw_26{background:#fff;border-radius:50%;box-shadow:0 1px 2px #0f24400a,0 1px 3px #0f24400f;height:18px;left:2px;position:absolute;top:2px;transition:transform .18s;width:18px}._input_2wriw_9:checked+._track_2wriw_16{background:#d4a01e}._input_2wriw_9:checked+._track_2wriw_16 ._thumb_2wriw_26{transform:translate(18px)}._input_2wriw_9:focus-visible+._track_2wriw_16{box-shadow:0 0 0 3px #d4a01e40}._input_2wriw_9:disabled+._track_2wriw_16{cursor:default;opacity:.5}._input_2wriw_9:disabled~._text_2wriw_55{color:#9ca3af}._text_2wriw_55{color:#374151;font-size:13px}._zone_m7ku4_1{align-items:center;border:1.5px dashed #d1d5db;border-radius:10px;color:#9ca3af;cursor:pointer;display:flex;font-size:12.5px;gap:10px;justify-content:center;padding:24px;transition:all .18s}._zone_m7ku4_1._over_m7ku4_14,._zone_m7ku4_1:hover{background:#fefbf0;border-color:#d4a01e;color:#b8881a}._hidden_m7ku4_20{display:none}._list_m7ku4_24{display:flex;flex-direction:column;gap:6px;list-style:none;margin:10px 0 0;padding:0}._item_m7ku4_33{align-items:center;background:#f9fafb;border:1px solid #e5e7eb;border-radius:6px;color:#374151;display:flex;font-size:13px;gap:10px;padding:8px 12px}._name_m7ku4_45{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._size_m7ku4_53{color:#9ca3af;flex-shrink:0;font-size:11.5px}._remove_m7ku4_59{background:0 0;border:0;color:#9ca3af;cursor:pointer;display:inline-flex;flex-shrink:0;padding:2px}._remove_m7ku4_59:hover{color:#dc2626}._list_16ms4_1{display:flex;flex-direction:column;gap:6px;list-style:none;margin:0;padding:0}._item_16ms4_10{align-items:center;background:#f9fafb;border:1px solid #e5e7eb;border-radius:6px;display:flex;font-size:13px;gap:10px;padding:8px 12px}._link_16ms4_21{color:#244b73;flex:1;min-width:0;text-decoration:none}._link_16ms4_21:hover{color:#b8881a;text-decoration:underline}._removeBtn_16ms4_32{align-items:center;background:#fff;border:1px solid #d1d5db;border-radius:6px;color:#6b7280;cursor:pointer;display:inline-flex;flex-shrink:0;height:26px;justify-content:center;padding:0;transition:all .16s;width:26px}._removeBtn_16ms4_32:hover{border-color:#dc2626;color:#dc2626}._empty_16ms4_52{color:#6b7280;font-size:13px}._overlay_1bmoc_1{align-items:center;animation:_overlayIn_1bmoc_1 .14s ease-out;background:#0a1b308c;display:flex;font-family:Inter,-apple-system,Segoe UI,sans-serif;inset:0;justify-content:center;padding:24px;position:fixed;z-index:999997}._card_1bmoc_14{animation:_cardIn_1bmoc_1 .16s ease-out;background:#fff;border-radius:14px;box-shadow:0 24px 70px #0a1b3040;box-sizing:border-box;max-width:440px;padding:20px 20px 16px;width:100%}._title_1bmoc_25{color:#0a1b30;font-family:Lora,Georgia,serif;font-size:22px;font-weight:600}._message_1bmoc_32{color:#374151;font-size:13px;line-height:1.5;margin-top:8px}._actions_1bmoc_39{display:flex;gap:8px;justify-content:flex-end;margin-top:20px}._cancelBtn_1bmoc_46{background:#fff;border:1px solid #d1d5db;border-radius:6px;color:#1b3a5c;cursor:pointer;font-family:Inter,-apple-system,Segoe UI,sans-serif;font-size:13px;padding:9px 18px;transition:all .15s}._cancelBtn_1bmoc_46:hover{border-color:#e5b635}._confirmBtn_1bmoc_61{background:linear-gradient(135deg,#e5b635,#d4a01e);border:1px solid #d4a01e;color:#0a1b30;font-weight:600}._confirmBtn_1bmoc_61:hover{box-shadow:0 4px 20px #d4a01e2e;transform:translateY(-1px)}._confirmBtn_1bmoc_61{border-radius:6px;cursor:pointer;font-size:13px;padding:9px 18px}._confirmDanger_1bmoc_78{background:#dc2626;border:0;border-radius:6px;color:#fff;cursor:pointer;font-family:Inter,-apple-system,Segoe UI,sans-serif;font-size:13px;padding:9px 18px;transition:all .15s}._confirmDanger_1bmoc_78:hover{filter:brightness(.94)}@keyframes _overlayIn_1bmoc_1{0%{opacity:0}to{opacity:1}}@keyframes _cardIn_1bmoc_1{0%{opacity:0;transform:translateY(8px)scale(.98)}to{opacity:1;transform:translateY(0)scale(1)}}._layout_vc8am_1{align-items:stretch;display:flex;font-family:Inter,-apple-system,Segoe UI,sans-serif;min-height:78vh;width:100%}._side_vc8am_9{display:flex;flex:none}._main_vc8am_14{display:flex;flex:auto;flex-direction:column;min-width:0;padding:20px 24px 32px}._mobileBar_vc8am_22{display:none;margin-bottom:16px}@media (width<=768px){._layout_vc8am_1{min-height:0}._mobileBar_vc8am_22{display:block}._main_vc8am_14{padding:16px}}._tabs_w5rn3_1{align-items:stretch;border-bottom:1px solid #e5e7eb;display:flex;gap:8px;overflow-x:auto}._tab_w5rn3_1{align-items:center;background:0 0;border:0;border-bottom:2px solid #0000;color:#6b7280;cursor:pointer;display:inline-flex;font-family:Inter,-apple-system,Segoe UI,sans-serif;font-size:13px;font-weight:500;gap:8px;letter-spacing:.2px;padding:12px 16px;transition:color .18s,border-color .18s;white-space:nowrap}._tab_w5rn3_1:hover{color:#1b3a5c}._active_w5rn3_30{border-bottom-color:#d4a01e;color:#0f2440;font-weight:600}._count_w5rn3_36{color:#9ca3af;font-weight:500}._stepper_1tzrv_1{align-items:flex-start;display:flex;font-family:Inter,-apple-system,Segoe UI,sans-serif;overflow-x:auto;padding:4px 0;width:100%}._step_1tzrv_1{align-items:center;background:0 0;border:0;cursor:pointer;display:flex;flex:none;flex-direction:column;gap:6px;padding:0}._step_1tzrv_1:disabled{cursor:default}._circle_1tzrv_25{align-items:center;background:#fff;border:1.5px solid #d1d5db;border-radius:100px;color:#6b7280;display:inline-flex;font-size:13px;font-weight:600;height:30px;justify-content:center;transition:all .18s;width:30px}._completed_1tzrv_40{background:#1b3a5c;border-color:#1b3a5c;color:#fff}._current_1tzrv_46{background:linear-gradient(135deg,#e5b635,#d4a01e);border-color:#d4a01e;box-shadow:0 4px 20px #d4a01e2e;color:#0a1b30}._connector_1tzrv_53{background:#e5e7eb;flex:auto;height:2px;margin-top:15px;min-width:24px}._label_1tzrv_61{color:#6b7280;font-size:11px;white-space:nowrap}._labelCurrent_1tzrv_67{color:#0f2440;font-weight:600}@media (width<=640px){._label_1tzrv_61{display:none}}._nav_1aclb_1{background:linear-gradient(135deg,#0a1b30,#1b3a5c 85%);box-shadow:inset -1px 0 #ffffff0f;display:flex;flex-direction:column;padding:16px 0 12px;transition:width .2s;width:248px}._navCollapsed_1aclb_11{width:64px}._head_1aclb_15{align-items:center;border-bottom:1px solid #ffffff14;display:flex;gap:8px;justify-content:space-between;padding:0 16px 16px}._navCollapsed_1aclb_11 ._head_1aclb_15{flex-direction:column;gap:12px;padding:0 0 12px}._brand_1aclb_30{align-items:center;display:flex;gap:8px;min-width:0}._brandText_1aclb_37{color:#fff;font-family:Lora,Georgia,serif;font-size:15px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._toggle_1aclb_47{align-items:center;background:0 0;border:1px solid #ffffff2e;border-radius:6px;color:#fff9;cursor:pointer;display:inline-flex;flex-shrink:0;height:26px;justify-content:center;padding:0;transition:all .16s;width:26px}._toggle_1aclb_47:hover{border-color:#e5b635;color:#f0cc5e}._items_1aclb_67{display:flex;flex-direction:column;gap:2px;margin-top:16px}._navCollapsed_1aclb_11 ._items_1aclb_67{margin-top:12px}._item_1aclb_67{align-items:center;background:0 0;border:0;border-left:3px solid #0000;color:#ffffff9e;cursor:pointer;display:flex;font-family:Inter,-apple-system,Segoe UI,sans-serif;font-size:13.5px;font-weight:500;gap:12px;padding:12px 18px;position:relative;text-align:left;transition:color .18s,background .18s,border-color .18s;white-space:nowrap;width:100%}._item_1aclb_67:hover{background:#ffffff0a;color:#ffffffeb}._navCollapsed_1aclb_11 ._item_1aclb_67{justify-content:center;padding:12px 0}._itemActive_1aclb_107{background:#ffffff12;border-left-color:#d4a01e;color:#fff}._itemActive_1aclb_107 ._itemIcon_1aclb_112{color:#e5b635}._itemIcon_1aclb_112{color:inherit;display:inline-flex;flex-shrink:0}._itemTitle_1aclb_122{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}._badge_1aclb_129{background:#d4a01e;border-radius:100px;color:#0a1b30;flex-shrink:0;font-size:10.5px;font-weight:700;min-width:18px;padding:1px 6px;text-align:center}._navCollapsed_1aclb_11 ._badge_1aclb_129{position:absolute;right:8px;top:6px}._backdrop_1aclb_147{display:none}@media (width<=768px){._navCollapsed_1aclb_11,._nav_1aclb_1{bottom:0;left:0;position:fixed;top:0;transform:translate(-100%);transition:transform .25s;width:248px;z-index:1000}._navMobileOpen_1aclb_163{box-shadow:0 24px 70px #0a1b3040;transform:translate(0)}._toggle_1aclb_47{display:none}._backdrop_1aclb_147{background:#0a1b3073;display:block;inset:0;position:fixed;z-index:999}}@media (width<=350px){._navCollapsed_1aclb_11,._nav_1aclb_1{max-width:300px;width:86vw}}._toggle_1s269_1{align-items:center;background:#fff;border:1px solid #d1d5db;border-radius:6px;color:#1b3a5c;cursor:pointer;display:none;height:40px;justify-content:center;padding:0;transition:border-color .16s,color .16s;width:40px}._toggle_1s269_1:hover{border-color:#d4a01e;color:#0f2440}@media (width<=768px){._toggle_1s269_1{display:inline-flex}}._wrap_1q0gd_1{overflow-x:auto;width:100%}._table_1q0gd_6{border-collapse:collapse;font-family:Inter,-apple-system,Segoe UI,sans-serif;font-size:13px;width:100%}._table_1q0gd_6 th{border-bottom:1px solid #e5e7eb;color:#6b7280;font-size:10.5px;font-weight:600;letter-spacing:.6px;padding:10px 14px;text-align:left;text-transform:uppercase;white-space:nowrap}._table_1q0gd_6 td{border-bottom:1px solid #f3f4f6;color:#111827;padding:12px 14px;vertical-align:middle}._table_1q0gd_6 tbody tr:last-child td{border-bottom:0}._rowClickable_1q0gd_33{cursor:pointer;transition:background .14s}._rowClickable_1q0gd_33:hover{background:#f4f7fa}._rowClickable_1q0gd_33:focus-visible{outline:2px solid #e5b635;outline-offset:-2px}._empty_1q0gd_45{color:#9ca3af;padding:24px 14px;text-align:center}", true);
/***/ }),
/***/ 779:
/*!************************************************************!*\
!*** ./lib/webparts/ctFormsPortal/CtFormsPortalWebPart.js ***!
\************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! tslib */ 196);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 959);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ 398);
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _microsoft_sp_core_library__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @microsoft/sp-core-library */ 676);
/* harmony import */ var _microsoft_sp_core_library__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_microsoft_sp_core_library__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _microsoft_sp_property_pane__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @microsoft/sp-property-pane */ 877);
/* harmony import */ var _microsoft_sp_property_pane__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_microsoft_sp_property_pane__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _microsoft_sp_webpart_base__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @microsoft/sp-webpart-base */ 642);
/* harmony import */ var _microsoft_sp_webpart_base__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_microsoft_sp_webpart_base__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var CtFormsPortalWebPartStrings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! CtFormsPortalWebPartStrings */ 735);
/* harmony import */ var CtFormsPortalWebPartStrings__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(CtFormsPortalWebPartStrings__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _components_CtFormsPortal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/CtFormsPortal */ 263);
var CtFormsPortalWebPart = /** @class */ (function (_super) {
(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__extends)(CtFormsPortalWebPart, _super);
function CtFormsPortalWebPart() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._isDarkTheme = false;
_this._environmentMessage = '';
return _this;
}
CtFormsPortalWebPart.prototype.render = function () {
var element = react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_CtFormsPortal__WEBPACK_IMPORTED_MODULE_6__["default"], {
description: this.properties.description,
isDarkTheme: this._isDarkTheme,
environmentMessage: this._environmentMessage,
hasTeamsContext: !!this.context.sdks.microsoftTeams,
userDisplayName: this.context.pageContext.user.displayName,
context: this.context
});
react_dom__WEBPACK_IMPORTED_MODULE_1__.render(element, this.domElement);
};
CtFormsPortalWebPart.prototype.onInit = function () {
var _this = this;
return this._getEnvironmentMessage().then(function (message) {
_this._environmentMessage = message;
});
};
CtFormsPortalWebPart.prototype._getEnvironmentMessage = function () {
var _this = this;
if (!!this.context.sdks.microsoftTeams) { // running in Teams, office.com or Outlook
return this.context.sdks.microsoftTeams.teamsJs.app.getContext()
.then(function (context) {
var environmentMessage = '';
switch (context.app.host.name) {
case 'Office': // running in Office
environmentMessage = _this.context.isServedFromLocalhost ? CtFormsPortalWebPartStrings__WEBPACK_IMPORTED_MODULE_5__.AppLocalEnvironmentOffice : CtFormsPortalWebPartStrings__WEBPACK_IMPORTED_MODULE_5__.AppOfficeEnvironment;
break;
case 'Outlook': // running in Outlook
environmentMessage = _this.context.isServedFromLocalhost ? CtFormsPortalWebPartStrings__WEBPACK_IMPORTED_MODULE_5__.AppLocalEnvironmentOutlook : CtFormsPortalWebPartStrings__WEBPACK_IMPORTED_MODULE_5__.AppOutlookEnvironment;
break;
case 'Teams': // running in Teams
case 'TeamsModern':
environmentMessage = _this.context.isServedFromLocalhost ? CtFormsPortalWebPartStrings__WEBPACK_IMPORTED_MODULE_5__.AppLocalEnvironmentTeams : CtFormsPortalWebPartStrings__WEBPACK_IMPORTED_MODULE_5__.AppTeamsTabEnvironment;
break;
default:
environmentMessage = CtFormsPortalWebPartStrings__WEBPACK_IMPORTED_MODULE_5__.UnknownEnvironment;
}
return environmentMessage;
});
}
return Promise.resolve(this.context.isServedFromLocalhost ? CtFormsPortalWebPartStrings__WEBPACK_IMPORTED_MODULE_5__.AppLocalEnvironmentSharePoint : CtFormsPortalWebPartStrings__WEBPACK_IMPORTED_MODULE_5__.AppSharePointEnvironment);
};
CtFormsPortalWebPart.prototype.onThemeChanged = function (currentTheme) {
if (!currentTheme) {
return;
}
this._isDarkTheme = !!currentTheme.isInverted;
var semanticColors = currentTheme.semanticColors;
if (semanticColors) {
this.domElement.style.setProperty('--bodyText', semanticColors.bodyText || null);
this.domElement.style.setProperty('--link', semanticColors.link || null);
this.domElement.style.setProperty('--linkHovered', semanticColors.linkHovered || null);
}
};
CtFormsPortalWebPart.prototype.onDispose = function () {
react_dom__WEBPACK_IMPORTED_MODULE_1__.unmountComponentAtNode(this.domElement);
};
Object.defineProperty(CtFormsPortalWebPart.prototype, "dataVersion", {
get: function () {
return _microsoft_sp_core_library__WEBPACK_IMPORTED_MODULE_2__.Version.parse('1.0');
},
enumerable: false,
configurable: true
});
CtFormsPortalWebPart.prototype.getPropertyPaneConfiguration = function () {
return {
pages: [
{
header: {
description: CtFormsPortalWebPartStrings__WEBPACK_IMPORTED_MODULE_5__.PropertyPaneDescription
},
groups: [
{
groupName: CtFormsPortalWebPartStrings__WEBPACK_IMPORTED_MODULE_5__.BasicGroupName,
groupFields: [
(0,_microsoft_sp_property_pane__WEBPACK_IMPORTED_MODULE_3__.PropertyPaneTextField)('description', {
label: CtFormsPortalWebPartStrings__WEBPACK_IMPORTED_MODULE_5__.DescriptionFieldLabel
})
]
}
]
}
]
};
};
return CtFormsPortalWebPart;
}(_microsoft_sp_webpart_base__WEBPACK_IMPORTED_MODULE_4__.BaseClientSideWebPart));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CtFormsPortalWebPart);
/***/ }),
/***/ 263:
/*!****************************************************************!*\
!*** ./lib/webparts/ctFormsPortal/components/CtFormsPortal.js ***!
\****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 959);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _tnsu_ui_kit_styles_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tnsu/ui-kit/styles.css */ 943);
/* harmony import */ var _tnsu_ui_kit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tnsu/ui-kit */ 658);
/* harmony import */ var _CtFormsPortal_module_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CtFormsPortal.module.scss */ 945);
/* harmony import */ var _Dashboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Dashboard */ 499);
// Корень веб-парта: спрайт иконок (один раз) + дашборд-реестр.
// Импорт CtFormsPortal.module.scss обязателен — в нём :global full-width правила канвы.
var CtFormsPortal = function (props) { return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _CtFormsPortal_module_scss__WEBPACK_IMPORTED_MODULE_2__["default"].root },
react__WEBPACK_IMPORTED_MODULE_0__.createElement(_tnsu_ui_kit__WEBPACK_IMPORTED_MODULE_4__.IconSprite, null),
react__WEBPACK_IMPORTED_MODULE_0__.createElement(_Dashboard__WEBPACK_IMPORTED_MODULE_3__.Dashboard, { context: props.context }))); };
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CtFormsPortal);
/***/ }),
/***/ 499:
/*!************************************************************!*\
!*** ./lib/webparts/ctFormsPortal/components/Dashboard.js ***!
\************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Dashboard: () => (/* binding */ Dashboard)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 959);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Dashboard_module_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Dashboard.module.scss */ 9);
/* harmony import */ var _tnsu_ui_kit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tnsu/ui-kit */ 658);
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./config */ 274);
/* harmony import */ var _registry_useDocumentDashboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./registry/useDocumentDashboard */ 169);
// Иконка сайдбара по типу (kit-иконки; Fluent-иконки из конфигов тут не используем).
var TYPE_ICON = { ct: 'clipboard', oid: 'chart', kps: 'building' };
// Цвет статуса DashboardRow → вариант нашего Badge (error → danger).
var VARIANT_MAP = {
neutral: 'neutral',
info: 'info',
success: 'success',
error: 'danger'
};
function formatDate(iso) {
if (!iso)
return '';
var d = new Date(iso);
var dd = d.getDate() < 10 ? "0".concat(d.getDate()) : "".concat(d.getDate());
var mm = d.getMonth() + 1 < 10 ? "0".concat(d.getMonth() + 1) : "".concat(d.getMonth() + 1);
return "".concat(dd, ".").concat(mm, ".").concat(d.getFullYear());
}
// Дашборд-реестр (config-driven, данные из SharePoint). Оболочка и элементы — из @tnsu/ui-kit.
var Dashboard = function (_a) {
var _b;
var context = _a.context;
var _c = (0,_registry_useDocumentDashboard__WEBPACK_IMPORTED_MODULE_3__.useDocumentDashboard)(context, _config__WEBPACK_IMPORTED_MODULE_2__.DOCUMENT_TYPES), myDocs = _c.myDocs, approvedDocs = _c.approvedDocs, pendingDocs = _c.pendingDocs, isLoading = _c.isLoading, error = _c.error;
var _d = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(_config__WEBPACK_IMPORTED_MODULE_2__.DOCUMENT_TYPES[0].typeKey), activeType = _d[0], setActiveType = _d[1];
var _e = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)('pending'), queue = _e[0], setQueue = _e[1];
var _f = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false), collapsed = _f[0], setCollapsed = _f[1];
var _g = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false), mobileOpen = _g[0], setMobileOpen = _g[1];
var _h = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''), search = _h[0], setSearch = _h[1];
var _j = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''), status = _j[0], setStatus = _j[1];
var cfg = _config__WEBPACK_IMPORTED_MODULE_2__.DOCUMENT_TYPES.filter(function (t) { return t.typeKey === activeType; })[0];
var byType = function (arr) { return arr.filter(function (r) { return r.typeKey === activeType; }); };
var pendingForType = byType(pendingDocs);
var mineForType = byType(myDocs);
var approvedForType = byType(approvedDocs);
var sidebarItems = _config__WEBPACK_IMPORTED_MODULE_2__.DOCUMENT_TYPES.map(function (t) {
var _a;
return ({
id: t.typeKey,
title: t.typeLabel,
icon: (_a = TYPE_ICON[t.typeKey]) !== null && _a !== void 0 ? _a : 'document',
count: pendingDocs.filter(function (r) { return r.typeKey === t.typeKey; }).length
});
});
var tabs = [
{ id: 'pending', label: 'На согласовании у меня', count: pendingForType.length },
{ id: 'mine', label: 'Инициализированные мной', count: mineForType.length },
{ id: 'approved', label: 'Согласованные мной', count: approvedForType.length }
];
var activeRows = queue === 'pending' ? pendingForType : queue === 'mine' ? mineForType : approvedForType;
var statusOptions = Array.from(new Set(activeRows.map(function (r) { return r.statusLabel; }))).map(function (s) { return ({
value: s,
label: s
}); });
var rows = activeRows
.filter(function (r) { var _a; return !search || "".concat(r.title, " ").concat((_a = r.subtitle) !== null && _a !== void 0 ? _a : '').toLowerCase().indexOf(search.toLowerCase()) !== -1; })
.filter(function (r) { return !status || r.statusLabel === status; });
var renderCell = function (row, key) {
var _a;
if (key === 'status') {
return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(_tnsu_ui_kit__WEBPACK_IMPORTED_MODULE_4__.Badge, { variant: VARIANT_MAP[row.statusVariant], size: "sm" }, row.statusLabel));
}
if (key === 'created')
return formatDate(row.createdDate);
return String((_a = row[key]) !== null && _a !== void 0 ? _a : '');
};
var columns = cfg.columns.map(function (c) { return ({
key: c.key,
title: c.label,
width: c.minWidth ? "".concat(c.minWidth, "px") : undefined,
render: function (row) { return renderCell(row, c.key); }
}); });
var selectType = function (id) {
setActiveType(String(id));
setQueue('pending');
setSearch('');
setStatus('');
};
return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(_tnsu_ui_kit__WEBPACK_IMPORTED_MODULE_4__.AppLayout, { sidebar: react__WEBPACK_IMPORTED_MODULE_0__.createElement(_tnsu_ui_kit__WEBPACK_IMPORTED_MODULE_4__.Sidebar, { items: sidebarItems, activeId: activeType, onChange: selectType, brand: "\u0414\u043E\u0433\u043E\u0432\u043E\u0440\u0430", collapsed: collapsed, onToggleCollapsed: function () { return setCollapsed(function (c) { return !c; }); }, mobileOpen: mobileOpen, onMobileClose: function () { return setMobileOpen(false); } }), mobileToggle: react__WEBPACK_IMPORTED_MODULE_0__.createElement(_tnsu_ui_kit__WEBPACK_IMPORTED_MODULE_4__.SidebarToggle, { onClick: function () { return setMobileOpen(true); } }) },
react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _Dashboard_module_scss__WEBPACK_IMPORTED_MODULE_1__["default"].head },
react__WEBPACK_IMPORTED_MODULE_0__.createElement("h2", { className: _Dashboard_module_scss__WEBPACK_IMPORTED_MODULE_1__["default"].title }, cfg.typeLabel),
cfg.createNewUrl && (react__WEBPACK_IMPORTED_MODULE_0__.createElement(_tnsu_ui_kit__WEBPACK_IMPORTED_MODULE_4__.Button, { variant: "accent", onClick: function () { return window.open(cfg.createNewUrl, '_blank'); } }, (_b = cfg.createNewLabel) !== null && _b !== void 0 ? _b : 'Создать'))),
react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _Dashboard_module_scss__WEBPACK_IMPORTED_MODULE_1__["default"].toolbar },
react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _Dashboard_module_scss__WEBPACK_IMPORTED_MODULE_1__["default"].search },
react__WEBPACK_IMPORTED_MODULE_0__.createElement(_tnsu_ui_kit__WEBPACK_IMPORTED_MODULE_4__.TextInput, { value: search, onChange: setSearch, placeholder: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043D\u043E\u043C\u0435\u0440\u0443 \u0438\u043B\u0438 \u043F\u0440\u043E\u0435\u043A\u0442\u0443" })),
react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _Dashboard_module_scss__WEBPACK_IMPORTED_MODULE_1__["default"].filter },
react__WEBPACK_IMPORTED_MODULE_0__.createElement(_tnsu_ui_kit__WEBPACK_IMPORTED_MODULE_4__.Select, { value: status, onChange: setStatus, options: statusOptions, placeholder: "\u0412\u0441\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u044B" }))),
react__WEBPACK_IMPORTED_MODULE_0__.createElement(_tnsu_ui_kit__WEBPACK_IMPORTED_MODULE_4__.Tabs, { tabs: tabs, activeId: queue, onChange: function (id) { return setQueue(id); } }),
error && (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _Dashboard_module_scss__WEBPACK_IMPORTED_MODULE_1__["default"].state },
react__WEBPACK_IMPORTED_MODULE_0__.createElement(_tnsu_ui_kit__WEBPACK_IMPORTED_MODULE_4__.Alert, { variant: "err" },
"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435: ",
error))),
!error && isLoading && react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _Dashboard_module_scss__WEBPACK_IMPORTED_MODULE_1__["default"].state }, "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430\u2026"),
!error && !isLoading && (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: _Dashboard_module_scss__WEBPACK_IMPORTED_MODULE_1__["default"].tableWrap },
react__WEBPACK_IMPORTED_MODULE_0__.createElement(_tnsu_ui_kit__WEBPACK_IMPORTED_MODULE_4__.DataTable, { columns: columns, rows: rows, rowKey: function (r) { return "".concat(r.typeKey, "-").concat(r.id); }, onRowClick: function (r) { return window.open(cfg.buildLinkUrl(r), '_blank'); }, emptyText: "\u041D\u0435\u0442 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u0432" })))));
};
/***/ }),
/***/ 996:
/*!**************************************************************************!*\
!*** ./lib/webparts/ctFormsPortal/components/config/ctDocumentConfig.js ***!
\**************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ createCtDocumentConfig: () => (/* binding */ createCtDocumentConfig)
/* harmony export */ });
var STATUS_LABEL = {
'Черновик': 'Сформирована',
'На согласовании': 'На согласовании',
'Согласовано': 'Согласована',
'Отклонено': 'Отклонена'
};
var STATUS_VARIANT = {
'Черновик': 'neutral',
'На согласовании': 'info',
'Согласовано': 'success',
'Отклонено': 'error'
};
function createCtDocumentConfig() {
return {
typeKey: 'ct',
typeLabel: 'СТ ОМТС',
icon: 'ShoppingCart',
// Списки СТ ОМТС — на сайте СЭД. Явно, чтобы портал не зависел от места размещения.
siteUrl: 'https://tnsukz.sharepoint.com/sites/sed',
myDocsListName: 'Сравнительная таблица',
buildMyDocsFilter: function (userId) { return "AuthorId eq ".concat(userId); },
myDocsSelect: 'Id,Title,number,project,status,Created',
pendingApproval: {
approvalListName: 'Согласование СТ',
buildPendingFilter: function (userId) { return "aproover/Id eq ".concat(userId, " and status eq '\u041D\u0430 \u0441\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0438'"); },
approvalSelect: 'Id,CTId,status,aproover/Id',
approvalExpand: 'aproover',
parentIdField: 'CTId',
buildParentQuery: function (parentIds) { return ({
listName: 'Сравнительная таблица',
filter: parentIds.map(function (id) { return "Id eq ".concat(id); }).join(' or '),
select: 'Id,Title,number,project,status,Created'
}); }
},
approvedByMe: {
approvalListName: 'Согласование СТ',
buildPendingFilter: function (userId) { return "aproover/Id eq ".concat(userId, " and status eq '\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u043E'"); },
approvalSelect: 'Id,CTId,status,aproover/Id',
approvalExpand: 'aproover',
parentIdField: 'CTId',
buildParentQuery: function (parentIds) { return ({
listName: 'Сравнительная таблица',
filter: parentIds.map(function (id) { return "Id eq ".concat(id); }).join(' or '),
select: 'Id,Title,number,project,status,Created'
}); }
},
buildLinkUrl: function (row) {
var base = 'https://tnsukz.sharepoint.com/sites/sed/SitePages/Сравнительная-таблица.aspx';
var param = row.status === 'Черновик' ? 'ctId' : 'ctid';
return "".concat(base, "?").concat(param, "=").concat(row.id);
},
createNewUrl: 'https://tnsukz.sharepoint.com/sites/sed/SitePages/Сравнительная-таблица.aspx',
createNewLabel: 'Создать новую форму СТ',
mapItem: function (raw) {
var _a, _b, _c, _d, _e;
var spStatus = String((_a = raw['status']) !== null && _a !== void 0 ? _a : '');
return {
typeKey: 'ct',
id: String(raw['Id']),
title: "\u0421\u0422 \u2116".concat((_b = raw['number']) !== null && _b !== void 0 ? _b : raw['Title']),
subtitle: String((_c = raw['project']) !== null && _c !== void 0 ? _c : ''),
status: spStatus,
statusLabel: (_d = STATUS_LABEL[spStatus]) !== null && _d !== void 0 ? _d : spStatus,
statusVariant: (_e = STATUS_VARIANT[spStatus]) !== null && _e !== void 0 ? _e : 'neutral',
createdDate: raw['Created'] ? String(raw['Created']) : undefined
};
},
columns: [
{ key: 'title', label: 'Номер СТ', minWidth: 120 },
{ key: 'subtitle', label: 'Проект', minWidth: 180 },
{ key: 'status', label: 'Статус', minWidth: 130 },
{ key: 'created', label: 'Создана', minWidth: 110 }
]
};
}
/***/ }),
/***/ 274:
/*!***************************************************************!*\
!*** ./lib/webparts/ctFormsPortal/components/config/index.js ***!
\***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ DOCUMENT_TYPES: () => (/* binding */ DOCUMENT_TYPES)
/* harmony export */ });
/* harmony import */ var _ctDocumentConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ctDocumentConfig */ 996);
/* harmony import */ var _oidDocumentConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./oidDocumentConfig */ 633);
/* harmony import */ var _kpsDocumentConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./kpsDocumentConfig */ 257);
// Все типы документов портала. Добавить тип = добавить конфиг сюда.
var DOCUMENT_TYPES = [
(0,_ctDocumentConfig__WEBPACK_IMPORTED_MODULE_0__.createCtDocumentConfig)(),
(0,_oidDocumentConfig__WEBPACK_IMPORTED_MODULE_1__.createOidDocumentConfig)(),
(0,_kpsDocumentConfig__WEBPACK_IMPORTED_MODULE_2__.createKpsDocumentConfig)()
];
/***/ }),
/***/ 257:
/*!***************************************************************************!*\
!*** ./lib/webparts/ctFormsPortal/components/config/kpsDocumentConfig.js ***!
\***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ createKpsDocumentConfig: () => (/* binding */ createKpsDocumentConfig)
/* harmony export */ });
var KPS_SITE_URL = 'https://tnsukz.sharepoint.com/sites/kps';
var KPS_FORM_PAGE = "".concat(KPS_SITE_URL, "/SitePages/\u0421\u0440\u0430\u0432\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F-\u0442\u0430\u0431\u043B\u0438\u0446\u0430.aspx");
var STATUS_LABEL = {
'Черновик': 'Сформирована',
'На согласовании': 'На согласовании',
'Согласовано': 'Согласована',
'Отклонено': 'Отклонена'
};
var STATUS_VARIANT = {
'Черновик': 'neutral',
'На согласовании': 'info',
'Согласовано': 'success',
'Отклонено': 'error'
};
function createKpsDocumentConfig() {
return {
typeKey: 'kps',
typeLabel: 'СТ КПС',
icon: 'Processing',
// Списки КПС — на отдельном сайт-коллекшене /sites/kps.
siteUrl: KPS_SITE_URL,
myDocsListName: 'Сравнительная таблица',
buildMyDocsFilter: function (userId) { return "AuthorId eq ".concat(userId); },
myDocsSelect: 'Id,Title,number,project,status,Created',
pendingApproval: {
approvalListName: 'Согласование СТ',
buildPendingFilter: function (userId) { return "aproover/Id eq ".concat(userId, " and status eq '\u041D\u0430 \u0441\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0438'"); },
approvalSelect: 'Id,CTId,status,aproover/Id',
approvalExpand: 'aproover',
parentIdField: 'CTId',
buildParentQuery: function (parentIds) { return ({
listName: 'Сравнительная таблица',
filter: parentIds.map(function (id) { return "Id eq ".concat(id); }).join(' or '),
select: 'Id,Title,number,project,status,Created'
}); }
},
approvedByMe: {
approvalListName: 'Согласование СТ',
buildPendingFilter: function (userId) { return "aproover/Id eq ".concat(userId, " and status eq '\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u043E'"); },
approvalSelect: 'Id,CTId,status,aproover/Id',
approvalExpand: 'aproover',
parentIdField: 'CTId',
buildParentQuery: function (parentIds) { return ({
listName: 'Сравнительная таблица',
filter: parentIds.map(function (id) { return "Id eq ".concat(id); }).join(' or '),
select: 'Id,Title,number,project,status,Created'
}); }
},
buildLinkUrl: function (row) {
var param = row.status === 'Черновик' ? 'ctId' : 'ctid';
return "".concat(KPS_FORM_PAGE, "?").concat(param, "=").concat(row.id);
},
createNewUrl: KPS_FORM_PAGE,
createNewLabel: 'Создать новую форму КПС',
mapItem: function (raw) {
var _a, _b, _c, _d, _e;
var spStatus = String((_a = raw['status']) !== null && _a !== void 0 ? _a : '');
return {
typeKey: 'kps',
id: String(raw['Id']),
title: "\u0421\u0422 \u2116".concat((_b = raw['number']) !== null && _b !== void 0 ? _b : raw['Title']),
subtitle: String((_c = raw['project']) !== null && _c !== void 0 ? _c : ''),
status: spStatus,
statusLabel: (_d = STATUS_LABEL[spStatus]) !== null && _d !== void 0 ? _d : spStatus,
statusVariant: (_e = STATUS_VARIANT[spStatus]) !== null && _e !== void 0 ? _e : 'neutral',
createdDate: raw['Created'] ? String(raw['Created']) : undefined
};
},
columns: [
{ key: 'title', label: 'Номер СТ', minWidth: 120 },
{ key: 'subtitle', label: 'Проект', minWidth: 180 },
{ key: 'status', label: 'Статус', minWidth: 130 },
{ key: 'created', label: 'Создана', minWidth: 110 }
]
};
}
/***/ }),
/***/ 633:
/*!***************************************************************************!*\
!*** ./lib/webparts/ctFormsPortal/components/config/oidDocumentConfig.js ***!
\***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ createOidDocumentConfig: () => (/* binding */ createOidDocumentConfig)
/* harmony export */ });
var STATUS_LABEL = {
'Черновик': 'Сформирована',
'formed': 'Сформирована',
'На согласовании': 'На согласовании',
'on_approval': 'На согласовании',
'Согласовано': 'Согласована',
'approved': 'Согласована',
'Отклонено': 'Отклонена'
};
var STATUS_VARIANT = {
'Черновик': 'neutral',
'formed': 'neutral',
'На согласовании': 'info',
'on_approval': 'info',
'Согласовано': 'success',
'approved': 'success',
'Отклонено': 'error'
};
function createOidDocumentConfig() {
return {
typeKey: 'oid',
typeLabel: 'СТ ОИД',
icon: 'CRMServices',
// Списки СТ ОИД — на сайте СЭД. Явно, чтобы портал не зависел от места размещения.
siteUrl: 'https://tnsukz.sharepoint.com/sites/sed',
myDocsListName: 'Сравнительная таблица ОИД',
buildMyDocsFilter: function (userId) { return "AuthorId eq ".concat(userId); },
myDocsSelect: 'Id,Title,number,project,status,Created',
pendingApproval: {
approvalListName: 'Согласование СТ ОИД',
buildPendingFilter: function (userId) { return "aproover/Id eq ".concat(userId, " and status eq '\u041D\u0430 \u0441\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0438'"); },
approvalSelect: 'Id,CTId,status,aproover/Id',
approvalExpand: 'aproover',
parentIdField: 'CTId',
buildParentQuery: function (parentIds) { return ({
listName: 'Сравнительная таблица ОИД',
filter: parentIds.map(function (id) { return "Id eq ".concat(id); }).join(' or '),
select: 'Id,Title,number,project,status,Created'
}); }
},
approvedByMe: {
approvalListName: 'Согласование СТ ОИД',
buildPendingFilter: function (userId) { return "aproover/Id eq ".concat(userId, " and status eq '\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u043E'"); },
approvalSelect: 'Id,CTId,status,aproover/Id',
approvalExpand: 'aproover',
parentIdField: 'CTId',
buildParentQuery: function (parentIds) { return ({
listName: 'Сравнительная таблица ОИД',
filter: parentIds.map(function (id) { return "Id eq ".concat(id); }).join(' or '),
select: 'Id,Title,number,project,status,Created'
}); }
},
buildLinkUrl: function (row) {
var base = 'https://tnsukz.sharepoint.com/sites/sed/SitePages/Сравнительная-таблица-ОИД.aspx';
var param = row.status === 'Черновик' || row.status === 'formed' ? 'oidId' : 'oidid';
return "".concat(base, "?").concat(param, "=").concat(row.id);
},
createNewUrl: 'https://tnsukz.sharepoint.com/sites/sed/SitePages/Сравнительная-таблица-ОИД.aspx',
createNewLabel: 'Создать новую форму ОИД',
mapItem: function (raw) {
var _a, _b, _c, _d, _e;
var spStatus = String((_a = raw['status']) !== null && _a !== void 0 ? _a : '');
return {
typeKey: 'oid',
id: String(raw['Id']),
title: "\u0421\u0422 \u2116".concat((_b = raw['number']) !== null && _b !== void 0 ? _b : raw['Title']),
subtitle: String((_c = raw['project']) !== null && _c !== void 0 ? _c : ''),
status: spStatus,
statusLabel: (_d = STATUS_LABEL[spStatus]) !== null && _d !== void 0 ? _d : spStatus,
statusVariant: (_e = STATUS_VARIANT[spStatus]) !== null && _e !== void 0 ? _e : 'neutral',
createdDate: raw['Created'] ? String(raw['Created']) : undefined
};
},
columns: [
{ key: 'title', label: 'Номер СТ', minWidth: 120 },
{ key: 'subtitle', label: 'Проект', minWidth: 180 },
{ key: 'status', label: 'Статус', minWidth: 130 },
{ key: 'created', label: 'Создана', minWidth: 110 }
]
};
}
/***/ }),
/***/ 406:
/*!****************************************************************************!*\
!*** ./lib/webparts/ctFormsPortal/components/registry/documentsService.js ***!
\****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ DocumentsService: () => (/* binding */ DocumentsService)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ 196);
/* harmony import */ var _microsoft_sp_http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @microsoft/sp-http */ 909);
/* harmony import */ var _microsoft_sp_http__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_microsoft_sp_http__WEBPACK_IMPORTED_MODULE_0__);
// Загрузка реестра из SharePoint (перенесено из ct-forms-list/myDocuments).
// Поддерживает типы на разных сайт-коллекшенах (KPS на /sites/kps).
var DocumentsService = /** @class */ (function () {
function DocumentsService(context) {
this.context = context;
this.userIdCache = new Map();
}
Object.defineProperty(DocumentsService.prototype, "currentUserId", {
get: function () {
var _a;
return Number((_a = this.context.pageContext.legacyPageContext['userId']) !== null && _a !== void 0 ? _a : 0);
},
enumerable: false,
configurable: true
});
Object.defineProperty(DocumentsService.prototype, "webUrl", {
get: function () {
return this.context.pageContext.web.absoluteUrl;
},
enumerable: false,
configurable: true
});
DocumentsService.prototype.siteUrlFor = function (config) {
var _a;
return (_a = config.siteUrl) !== null && _a !== void 0 ? _a : this.webUrl;
};
DocumentsService.prototype.resolveUserId = function (config) {
return (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__awaiter)(this, void 0, void 0, function () {
var site, cached, response, json;
return (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__generator)(this, function (_a) {
switch (_a.label) {
case 0:
site = this.siteUrlFor(config);
if (site === this.webUrl)
return [2 /*return*/, this.currentUserId];
cached = this.userIdCache.get(site);
if (cached !== undefined)
return [2 /*return*/, cached];
return [4 /*yield*/, this.context.spHttpClient.get("".concat(site, "/_api/web/currentUser?$select=Id"), _microsoft_sp_http__WEBPACK_IMPORTED_MODULE_0__.SPHttpClient.configurations.v1)];
case 1:
response = _a.sent();
if (!response.ok) {
throw new Error("\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0438\u0442\u044C \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043D\u0430 \u0441\u0430\u0439\u0442\u0435 \"".concat(site, "\": ").concat(response.status));
}
return [4 /*yield*/, response.json()];
case 2:
json = _a.sent();
this.userIdCache.set(site, json.Id);
return [2 /*return*/, json.Id];
}
});
});
};
DocumentsService.prototype.buildListUrl = function (siteUrl, listName) {
return "".concat(siteUrl, "/_api/web/lists/getByTitle('").concat(listName, "')/items");
};
DocumentsService.prototype.fetchItems = function (siteUrl, listName, params) {
return (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__awaiter)(this, void 0, void 0, function () {
var q, url, response, json;
return (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__generator)(this, function (_a) {
switch (_a.label) {
case 0:
q = [];
if (params.filter)
q.push("$filter=".concat(params.filter));
if (params.select)
q.push("$select=".concat(params.select));
if (params.expand)
q.push("$expand=".concat(params.expand));
if (params.orderby)
q.push("$orderby=".concat(params.orderby));
if (params.top !== undefined)
q.push("$top=".concat(params.top));
url = q.length > 0 ? "".concat(this.buildListUrl(siteUrl, listName), "?").concat(q.join('&')) : this.buildListUrl(siteUrl, listName);
return [4 /*yield*/, this.context.spHttpClient.get(url, _microsoft_sp_http__WEBPACK_IMPORTED_MODULE_0__.SPHttpClient.configurations.v1)];
case 1:
response = _a.sent();
if (!response.ok) {
throw new Error("\u041E\u0448\u0438\u0431\u043A\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438 \u0441\u043F\u0438\u0441\u043A\u0430 \"".concat(listName, "\": ").concat(response.status));
}
return [4 /*yield*/, response.json()];
case 2:
json = _a.sent();
return [2 /*return*/, json.value];
}
});
});
};
DocumentsService.prototype.fetchMyDocs = function (config) {
return (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__awaiter)(this, void 0, void 0, function () {
var siteUrl, userId, items;
var _this = this;
return (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__generator)(this, function (_a) {
switch (_a.label) {
case 0:
siteUrl = this.siteUrlFor(config);
return [4 /*yield*/, this.resolveUserId(config)];
case 1:
userId = _a.sent();
return [4 /*yield*/, this.fetchItems(siteUrl, config.myDocsListName, {
filter: config.buildMyDocsFilter(userId),
select: config.myDocsSelect,
expand: config.myDocsExpand,
orderby: 'Created desc',
top: 100
})];
case 2:
items = _a.sent();
return [2 /*return*/, items.map(function (item) { return config.mapItem(item, _this.context); })];
}
});
});
};
DocumentsService.prototype.fetchApprovedByMe = function (config) {
return (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__awaiter)(this, void 0, void 0, function () {
return (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__generator)(this, function (_a) {
if (!config.approvedByMe)
return [2 /*return*/, []];
return [2 /*return*/, this._fetchApprovalSection(config, config.approvedByMe)];
});
});
};
DocumentsService.prototype.fetchPendingApprovals = function (config) {
return (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__awaiter)(this, void 0, void 0, function () {
return (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__generator)(this, function (_a) {
if (!config.pendingApproval)
return [2 /*return*/, []];
return [2 /*return*/, this._fetchApprovalSection(config, config.pendingApproval)];
});
});
};
DocumentsService.prototype._fetchApprovalSection = function (config, pa) {
return (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__awaiter)(this, void 0, void 0, function () {
var siteUrl, userId, approvalItems, parentIds, parentQuery, parentItems;
var _this = this;
return (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__generator)(this, function (_a) {
switch (_a.label) {
case 0:
siteUrl = this.siteUrlFor(config);
return [4 /*yield*/, this.resolveUserId(config)];
case 1:
userId = _a.sent();
return [4 /*yield*/, this.fetchItems(siteUrl, pa.approvalListName, {
filter: pa.buildPendingFilter(userId),
select: pa.approvalSelect,
expand: pa.approvalExpand,
top: 200
})];
case 2:
approvalItems = _a.sent();
parentIds = Array.from(new Set(approvalItems.map(function (item) { return Number(item[pa.parentIdField]); }).filter(function (id) { return !isNaN(id) && id > 0; })));
if (parentIds.length === 0)
return [2 /*return*/, []];
parentQuery = pa.buildParentQuery(parentIds);
return [4 /*yield*/, this.fetchItems(siteUrl, parentQuery.listName, {
filter: parentQuery.filter,
select: parentQuery.select,
top: 200
})];
case 3:
parentItems = _a.sent();
return [2 /*return*/, parentItems.map(function (item) { return config.mapItem(item, _this.context); })];
}
});
});
};
return DocumentsService;
}());
/***/ }),
/***/ 169:
/*!********************************************************************************!*\
!*** ./lib/webparts/ctFormsPortal/components/registry/useDocumentDashboard.js ***!
\********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ useDocumentDashboard: () => (/* binding */ useDocumentDashboard)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 959);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _documentsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./documentsService */ 406);
// Грузит три очереди (мои / согласованные / на согласовании) по всем типам сразу.
function useDocumentDashboard(context, documentTypes) {
var _a = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]), myDocs = _a[0], setMyDocs = _a[1];
var _b = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]), approvedDocs = _b[0], setApprovedDocs = _b[1];
var _c = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]), pendingDocs = _c[0], setPendingDocs = _c[1];
var _d = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true), isLoading = _d[0], setIsLoading = _d[1];
var _e = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null), error = _e[0], setError = _e[1];
var _f = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0), tick = _f[0], setTick = _f[1];
var reload = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () { return setTick(function (t) { return t + 1; }); }, []);
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
var service = new _documentsService__WEBPACK_IMPORTED_MODULE_1__.DocumentsService(context);
setIsLoading(true);
setError(null);
Promise.all([
Promise.all(documentTypes.map(function (cfg) { return service.fetchMyDocs(cfg); })),
Promise.all(documentTypes.map(function (cfg) { return service.fetchApprovedByMe(cfg); })),
Promise.all(documentTypes.map(function (cfg) { return service.fetchPendingApprovals(cfg); }))
])
.then(function (_a) {
var myDocGroups = _a[0], approvedGroups = _a[1], pendingGroups = _a[2];
setMyDocs(myDocGroups.reduce(function (acc, arr) { return acc.concat(arr); }, []));
setApprovedDocs(approvedGroups.reduce(function (acc, arr) { return acc.concat(arr); }, []));
setPendingDocs(pendingGroups.reduce(function (acc, arr) { return acc.concat(arr); }, []));
setIsLoading(false);
})
.catch(function (err) {
var _a;
setError((_a = err.message) !== null && _a !== void 0 ? _a : 'Произошла ошибка при загрузке данных');
setIsLoading(false);
});
}, [context, tick]); // eslint-disable-line react-hooks/exhaustive-deps
return { myDocs: myDocs, approvedDocs: approvedDocs, pendingDocs: pendingDocs, isLoading: isLoading, error: error, reload: reload };
}
/***/ }),
/***/ 323:
/*!***********************************************************************************************************!*\
!*** ./node_modules/@microsoft/sp-css-loader/node_modules/@microsoft/load-themed-styles/lib-es6/index.js ***!
\***********************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ clearStyles: () => (/* binding */ clearStyles),
/* harmony export */ configureLoadStyles: () => (/* binding */ configureLoadStyles),
/* harmony export */ configureRunMode: () => (/* binding */ configureRunMode),
/* harmony export */ detokenize: () => (/* binding */ detokenize),
/* harmony export */ flush: () => (/* binding */ flush),
/* harmony export */ loadStyles: () => (/* binding */ loadStyles),
/* harmony export */ loadTheme: () => (/* binding */ loadTheme),
/* harmony export */ splitStyles: () => (/* binding */ splitStyles)
/* harmony export */ });
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
var __assign = (undefined && undefined.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
// Store the theming state in __themeState__ global scope for reuse in the case of duplicate
// load-themed-styles hosted on the page.
var _root = typeof window === 'undefined' ? __webpack_require__.g : window; // eslint-disable-line @typescript-eslint/no-explicit-any
// Nonce string to inject into script tag if one provided. This is used in CSP (Content Security Policy).
var _styleNonce = _root && _root.CSPSettings && _root.CSPSettings.nonce;
var _themeState = initializeThemeState();
/**
* Matches theming tokens. For example, "[theme: themeSlotName, default: #FFF]" (including the quotes).
*/
var _themeTokenRegex = /[\'\"]\[theme:\s*(\w+)\s*(?:\,\s*default:\s*([\\"\']?[\.\,\(\)\#\-\s\w]*[\.\,\(\)\#\-\w][\"\']?))?\s*\][\'\"]/g;
var now = function () {
return typeof performance !== 'undefined' && !!performance.now ? performance.now() : Date.now();
};
function measure(func) {
var start = now();
func();
var end = now();
_themeState.perf.duration += end - start;
}
/**
* initialize global state object
*/
function initializeThemeState() {
var state = _root.__themeState__ || {
theme: undefined,
lastStyleElement: undefined,
registeredStyles: []
};
if (!state.runState) {
state = __assign(__assign({}, state), { perf: {
count: 0,
duration: 0
}, runState: {
flushTimer: 0,
mode: 0 /* Mode.sync */,
buffer: []
} });
}
if (!state.registeredThemableStyles) {
state = __assign(__assign({}, state), { registeredThemableStyles: [] });
}
_root.__themeState__ = state;
return state;
}
/**
* Loads a set of style text. If it is registered too early, we will register it when the window.load
* event is fired.
* @param {string | ThemableArray} styles Themable style text to register.
* @param {boolean} loadAsync When true, always load styles in async mode, irrespective of current sync mode.
*/
function loadStyles(styles, loadAsync) {
if (loadAsync === void 0) { loadAsync = false; }
measure(function () {
var styleParts = Array.isArray(styles) ? styles : splitStyles(styles);
var _a = _themeState.runState, mode = _a.mode, buffer = _a.buffer, flushTimer = _a.flushTimer;
if (loadAsync || mode === 1 /* Mode.async */) {
buffer.push(styleParts);
if (!flushTimer) {
_themeState.runState.flushTimer = asyncLoadStyles();
}
}
else {
applyThemableStyles(styleParts);
}
});
}
/**
* Allows for customizable loadStyles logic. e.g. for server side rendering application
* @param {(processedStyles: string, rawStyles?: string | ThemableArray) => void}
* a loadStyles callback that gets called when styles are loaded or reloaded
*/
function configureLoadStyles(loadStylesFn) {
_themeState.loadStyles = loadStylesFn;
}
/**
* Configure run mode of load-themable-styles
* @param mode load-themable-styles run mode, async or sync
*/
function configureRunMode(mode) {
_themeState.runState.mode = mode;
}
/**
* external code can call flush to synchronously force processing of currently buffered styles
*/
function flush() {
measure(function () {
var styleArrays = _themeState.runState.buffer.slice();
_themeState.runState.buffer = [];
var mergedStyleArray = [].concat.apply([], styleArrays);
if (mergedStyleArray.length > 0) {
applyThemableStyles(mergedStyleArray);
}
});
}
/**
* register async loadStyles
*/
function asyncLoadStyles() {
return setTimeout(function () {
_themeState.runState.flushTimer = 0;
flush();
}, 0);
}
/**
* Loads a set of style text. If it is registered too early, we will register it when the window.load event
* is fired.
* @param {string} styleText Style to register.
* @param {IStyleRecord} styleRecord Existing style record to re-apply.
*/
function applyThemableStyles(stylesArray, styleRecord) {
if (_themeState.loadStyles) {
_themeState.loadStyles(resolveThemableArray(stylesArray).styleString, stylesArray);
}
else {
registerStyles(stylesArray);
}
}
/**
* Registers a set theme tokens to find and replace. If styles were already registered, they will be
* replaced.
* @param {theme} theme JSON object of theme tokens to values.
*/
function loadTheme(theme) {
_themeState.theme = theme;
// reload styles.
reloadStyles();
}
/**
* Clear already registered style elements and style records in theme_State object
* @param option - specify which group of registered styles should be cleared.
* Default to be both themable and non-themable styles will be cleared
*/
function clearStyles(option) {
if (option === void 0) { option = 3 /* ClearStyleOptions.all */; }
if (option === 3 /* ClearStyleOptions.all */ || option === 2 /* ClearStyleOptions.onlyNonThemable */) {
clearStylesInternal(_themeState.registeredStyles);
_themeState.registeredStyles = [];
}
if (option === 3 /* ClearStyleOptions.all */ || option === 1 /* ClearStyleOptions.onlyThemable */) {
clearStylesInternal(_themeState.registeredThemableStyles);
_themeState.registeredThemableStyles = [];
}
}
function clearStylesInternal(records) {
records.forEach(function (styleRecord) {
var styleElement = styleRecord && styleRecord.styleElement;
if (styleElement && styleElement.parentElement) {
styleElement.parentElement.removeChild(styleElement);
}
});
}
/**
* Reloads styles.
*/
function reloadStyles() {
if (_themeState.theme) {
var themableStyles = [];
for (var _i = 0, _a = _themeState.registeredThemableStyles; _i < _a.length; _i++) {
var styleRecord = _a[_i];
themableStyles.push(styleRecord.themableStyle);
}
if (themableStyles.length > 0) {
clearStyles(1 /* ClearStyleOptions.onlyThemable */);
applyThemableStyles([].concat.apply([], themableStyles));
}
}
}
/**
* Find theme tokens and replaces them with provided theme values.
* @param {string} styles Tokenized styles to fix.
*/
function detokenize(styles) {
if (styles) {
styles = resolveThemableArray(splitStyles(styles)).styleString;
}
return styles;
}
/**
* Resolves ThemingInstruction objects in an array and joins the result into a string.
* @param {ThemableArray} splitStyleArray ThemableArray to resolve and join.
*/
function resolveThemableArray(splitStyleArray) {
var theme = _themeState.theme;
var themable = false;
// Resolve the array of theming instructions to an array of strings.
// Then join the array to produce the final CSS string.
var resolvedArray = (splitStyleArray || []).map(function (currentValue) {
var themeSlot = currentValue.theme;
if (themeSlot) {
themable = true;
// A theming annotation. Resolve it.
var themedValue = theme ? theme[themeSlot] : undefined;
var defaultValue = currentValue.defaultValue || 'inherit';
// Warn to console if we hit an unthemed value even when themes are provided, but only if "DEBUG" is true.
// Allow the themedValue to be undefined to explicitly request the default value.
if (theme &&
!themedValue &&
console &&
!(themeSlot in theme) &&
"boolean" !== 'undefined' &&
true) {
console.warn("Theming value not provided for \"".concat(themeSlot, "\". Falling back to \"").concat(defaultValue, "\"."));
}
return themedValue || defaultValue;
}
else {
// A non-themable string. Preserve it.
return currentValue.rawString;
}
});
return {
styleString: resolvedArray.join(''),
themable: themable
};
}
/**
* Split tokenized CSS into an array of strings and theme specification objects
* @param {string} styles Tokenized styles to split.
*/
function splitStyles(styles) {
var result = [];
if (styles) {
var pos = 0; // Current position in styles.
var tokenMatch = void 0;
while ((tokenMatch = _themeTokenRegex.exec(styles))) {
var matchIndex = tokenMatch.index;
if (matchIndex > pos) {
result.push({
rawString: styles.substring(pos, matchIndex)
});
}
result.push({
theme: tokenMatch[1],
defaultValue: tokenMatch[2] // May be undefined
});
// index of the first character after the current match
pos = _themeTokenRegex.lastIndex;
}
// Push the rest of the string after the last match.
result.push({
rawString: styles.substring(pos)
});
}
return result;
}
/**
* Registers a set of style text. If it is registered too early, we will register it when the
* window.load event is fired.
* @param {ThemableArray} styleArray Array of IThemingInstruction objects to register.
* @param {IStyleRecord} styleRecord May specify a style Element to update.
*/
function registerStyles(styleArray) {
if (typeof document === 'undefined') {
return;
}
var head = document.getElementsByTagName('head')[0];
var styleElement = document.createElement('style');
var _a = resolveThemableArray(styleArray), styleString = _a.styleString, themable = _a.themable;
styleElement.setAttribute('data-load-themed-styles', 'true');
if (_styleNonce) {
styleElement.setAttribute('nonce', _styleNonce);
}
styleElement.appendChild(document.createTextNode(styleString));
_themeState.perf.count++;
head.appendChild(styleElement);
var ev = document.createEvent('HTMLEvents');
ev.initEvent('styleinsert', true /* bubbleEvent */, false /* cancelable */);
ev.args = {
newStyle: styleElement
};
document.dispatchEvent(ev);
var record = {
styleElement: styleElement,
themableStyle: styleArray
};
if (themable) {
_themeState.registeredThemableStyles.push(record);
}
else {
_themeState.registeredStyles.push(record);
}
}
/***/ }),
/***/ 223:
/*!***************************************************!*\
!*** ./node_modules/ansi-html-community/index.js ***!
\***************************************************/
/***/ ((module) => {
"use strict";
module.exports = ansiHTML
// Reference to https://github.com/sindresorhus/ansi-regex
var _regANSI = /(?:(?:\u001b\[)|\u009b)(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m])|\u001b[A-M]/
var _defColors = {
reset: ['fff', '000'], // [FOREGROUD_COLOR, BACKGROUND_COLOR]
black: '000',
red: 'ff0000',
green: '209805',
yellow: 'e8bf03',
blue: '0000ff',
magenta: 'ff00ff',
cyan: '00ffee',
lightgrey: 'f0f0f0',
darkgrey: '888'
}
var _styles = {
30: 'black',
31: 'red',
32: 'green',
33: 'yellow',
34: 'blue',
35: 'magenta',
36: 'cyan',
37: 'lightgrey'
}
var _openTags = {
'1': 'font-weight:bold', // bold
'2': 'opacity:0.5', // dim
'3': '', // italic
'4': '', // underscore
'8': 'display:none', // hidden
'9': '' // delete
}
var _closeTags = {
'23': '', // reset italic
'24': '', // reset underscore
'29': '' // reset delete
}
;[0, 21, 22, 27, 28, 39, 49].forEach(function (n) {
_closeTags[n] = ''
})
/**
* Converts text with ANSI color codes to HTML markup.
* @param {String} text
* @returns {*}
*/
function ansiHTML (text) {
// Returns the text if the string has no ANSI escape code.
if (!_regANSI.test(text)) {
return text
}
// Cache opened sequence.
var ansiCodes = []
// Replace with markup.
var ret = text.replace(/\033\[(\d+)m/g, function (match, seq) {
var ot = _openTags[seq]
if (ot) {
// If current sequence has been opened, close it.
if (!!~ansiCodes.indexOf(seq)) { // eslint-disable-line no-extra-boolean-cast
ansiCodes.pop()
return ''
}
// Open tag.
ansiCodes.push(seq)
return ot[0] === '<' ? ot : ''
}
var ct = _closeTags[seq]
if (ct) {
// Pop sequence
ansiCodes.pop()
return ct
}
return ''
})
// Make sure tags are closed.
var l = ansiCodes.length
;(l > 0) && (ret += Array(l + 1).join(''))
return ret
}
/**
* Customize colors.
* @param {Object} colors reference to _defColors
*/
ansiHTML.setColors = function (colors) {
if (typeof colors !== 'object') {
throw new Error('`colors` parameter must be an Object.')
}
var _finalColors = {}
for (var key in _defColors) {
var hex = colors.hasOwnProperty(key) ? colors[key] : null
if (!hex) {
_finalColors[key] = _defColors[key]
continue
}
if ('reset' === key) {
if (typeof hex === 'string') {
hex = [hex]
}
if (!Array.isArray(hex) || hex.length === 0 || hex.some(function (h) {
return typeof h !== 'string'
})) {
throw new Error('The value of `' + key + '` property must be an Array and each item could only be a hex string, e.g.: FF0000')
}
var defHexColor = _defColors[key]
if (!hex[0]) {
hex[0] = defHexColor[0]
}
if (hex.length === 1 || !hex[1]) {
hex = [hex[0]]
hex.push(defHexColor[1])
}
hex = hex.slice(0, 2)
} else if (typeof hex !== 'string') {
throw new Error('The value of `' + key + '` property must be a hex string, e.g.: FF0000')
}
_finalColors[key] = hex
}
_setTags(_finalColors)
}
/**
* Reset colors.
*/
ansiHTML.reset = function () {
_setTags(_defColors)
}
/**
* Expose tags, including open and close.
* @type {Object}
*/
ansiHTML.tags = {}
if (Object.defineProperty) {
Object.defineProperty(ansiHTML.tags, 'open', {
get: function () { return _openTags }
})
Object.defineProperty(ansiHTML.tags, 'close', {
get: function () { return _closeTags }
})
} else {
ansiHTML.tags.open = _openTags
ansiHTML.tags.close = _closeTags
}
function _setTags (colors) {
// reset all
_openTags['0'] = 'font-weight:normal;opacity:1;color:#' + colors.reset[0] + ';background:#' + colors.reset[1]
// inverse
_openTags['7'] = 'color:#' + colors.reset[1] + ';background:#' + colors.reset[0]
// dark grey
_openTags['90'] = 'color:#' + colors.darkgrey
for (var code in _styles) {
var color = _styles[code]
var oriColor = colors[color] || '000'
_openTags[code] = 'color:#' + oriColor
code = parseInt(code)
_openTags[(code + 10).toString()] = 'background:#' + oriColor
}
}
ansiHTML.reset()
/***/ }),
/***/ 216:
/*!***************************************!*\
!*** ./node_modules/events/events.js ***!
\***************************************/
/***/ ((module) => {
"use strict";
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var R = typeof Reflect === 'object' ? Reflect : null
var ReflectApply = R && typeof R.apply === 'function'
? R.apply
: function ReflectApply(target, receiver, args) {
return Function.prototype.apply.call(target, receiver, args);
}
var ReflectOwnKeys
if (R && typeof R.ownKeys === 'function') {
ReflectOwnKeys = R.ownKeys
} else if (Object.getOwnPropertySymbols) {
ReflectOwnKeys = function ReflectOwnKeys(target) {
return Object.getOwnPropertyNames(target)
.concat(Object.getOwnPropertySymbols(target));
};
} else {
ReflectOwnKeys = function ReflectOwnKeys(target) {
return Object.getOwnPropertyNames(target);
};
}
function ProcessEmitWarning(warning) {
if (console && console.warn) console.warn(warning);
}
var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
return value !== value;
}
function EventEmitter() {
EventEmitter.init.call(this);
}
module.exports = EventEmitter;
module.exports.once = once;
// Backwards-compat with node 0.10.x
EventEmitter.EventEmitter = EventEmitter;
EventEmitter.prototype._events = undefined;
EventEmitter.prototype._eventsCount = 0;
EventEmitter.prototype._maxListeners = undefined;
// By default EventEmitters will print a warning if more than 10 listeners are
// added to it. This is a useful default which helps finding memory leaks.
var defaultMaxListeners = 10;
function checkListener(listener) {
if (typeof listener !== 'function') {
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
}
}
Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
enumerable: true,
get: function() {
return defaultMaxListeners;
},
set: function(arg) {
if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
}
defaultMaxListeners = arg;
}
});
EventEmitter.init = function() {
if (this._events === undefined ||
this._events === Object.getPrototypeOf(this)._events) {
this._events = Object.create(null);
this._eventsCount = 0;
}
this._maxListeners = this._maxListeners || undefined;
};
// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
}
this._maxListeners = n;
return this;
};
function _getMaxListeners(that) {
if (that._maxListeners === undefined)
return EventEmitter.defaultMaxListeners;
return that._maxListeners;
}
EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
return _getMaxListeners(this);
};
EventEmitter.prototype.emit = function emit(type) {
var args = [];
for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
var doError = (type === 'error');
var events = this._events;
if (events !== undefined)
doError = (doError && events.error === undefined);
else if (!doError)
return false;
// If there is no 'error' event listener then throw.
if (doError) {
var er;
if (args.length > 0)
er = args[0];
if (er instanceof Error) {
// Note: The comments on the `throw` lines are intentional, they show
// up in Node's output if this results in an unhandled exception.
throw er; // Unhandled 'error' event
}
// At least give some kind of context to the user
var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
err.context = er;
throw err; // Unhandled 'error' event
}
var handler = events[type];
if (handler === undefined)
return false;
if (typeof handler === 'function') {
ReflectApply(handler, this, args);
} else {
var len = handler.length;
var listeners = arrayClone(handler, len);
for (var i = 0; i < len; ++i)
ReflectApply(listeners[i], this, args);
}
return true;
};
function _addListener(target, type, listener, prepend) {
var m;
var events;
var existing;
checkListener(listener);
events = target._events;
if (events === undefined) {
events = target._events = Object.create(null);
target._eventsCount = 0;
} else {
// To avoid recursion in the case that type === "newListener"! Before
// adding it to the listeners, first emit "newListener".
if (events.newListener !== undefined) {
target.emit('newListener', type,
listener.listener ? listener.listener : listener);
// Re-assign `events` because a newListener handler could have caused the
// this._events to be assigned to a new object
events = target._events;
}
existing = events[type];
}
if (existing === undefined) {
// Optimize the case of one listener. Don't need the extra array object.
existing = events[type] = listener;
++target._eventsCount;
} else {
if (typeof existing === 'function') {
// Adding the second element, need to change to array.
existing = events[type] =
prepend ? [listener, existing] : [existing, listener];
// If we've already got an array, just append.
} else if (prepend) {
existing.unshift(listener);
} else {
existing.push(listener);
}
// Check for listener leak
m = _getMaxListeners(target);
if (m > 0 && existing.length > m && !existing.warned) {
existing.warned = true;
// No error code for this since it is a Warning
// eslint-disable-next-line no-restricted-syntax
var w = new Error('Possible EventEmitter memory leak detected. ' +
existing.length + ' ' + String(type) + ' listeners ' +
'added. Use emitter.setMaxListeners() to ' +
'increase limit');
w.name = 'MaxListenersExceededWarning';
w.emitter = target;
w.type = type;
w.count = existing.length;
ProcessEmitWarning(w);
}
}
return target;
}
EventEmitter.prototype.addListener = function addListener(type, listener) {
return _addListener(this, type, listener, false);
};
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
EventEmitter.prototype.prependListener =
function prependListener(type, listener) {
return _addListener(this, type, listener, true);
};
function onceWrapper() {
if (!this.fired) {
this.target.removeListener(this.type, this.wrapFn);
this.fired = true;
if (arguments.length === 0)
return this.listener.call(this.target);
return this.listener.apply(this.target, arguments);
}
}
function _onceWrap(target, type, listener) {
var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
var wrapped = onceWrapper.bind(state);
wrapped.listener = listener;
state.wrapFn = wrapped;
return wrapped;
}
EventEmitter.prototype.once = function once(type, listener) {
checkListener(listener);
this.on(type, _onceWrap(this, type, listener));
return this;
};
EventEmitter.prototype.prependOnceListener =
function prependOnceListener(type, listener) {
checkListener(listener);
this.prependListener(type, _onceWrap(this, type, listener));
return this;
};
// Emits a 'removeListener' event if and only if the listener was removed.
EventEmitter.prototype.removeListener =
function removeListener(type, listener) {
var list, events, position, i, originalListener;
checkListener(listener);
events = this._events;
if (events === undefined)
return this;
list = events[type];
if (list === undefined)
return this;
if (list === listener || list.listener === listener) {
if (--this._eventsCount === 0)
this._events = Object.create(null);
else {
delete events[type];
if (events.removeListener)
this.emit('removeListener', type, list.listener || listener);
}
} else if (typeof list !== 'function') {
position = -1;
for (i = list.length - 1; i >= 0; i--) {
if (list[i] === listener || list[i].listener === listener) {
originalListener = list[i].listener;
position = i;
break;
}
}
if (position < 0)
return this;
if (position === 0)
list.shift();
else {
spliceOne(list, position);
}
if (list.length === 1)
events[type] = list[0];
if (events.removeListener !== undefined)
this.emit('removeListener', type, originalListener || listener);
}
return this;
};
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
EventEmitter.prototype.removeAllListeners =
function removeAllListeners(type) {
var listeners, events, i;
events = this._events;
if (events === undefined)
return this;
// not listening for removeListener, no need to emit
if (events.removeListener === undefined) {
if (arguments.length === 0) {
this._events = Object.create(null);
this._eventsCount = 0;
} else if (events[type] !== undefined) {
if (--this._eventsCount === 0)
this._events = Object.create(null);
else
delete events[type];
}
return this;
}
// emit removeListener for all listeners on all events
if (arguments.length === 0) {
var keys = Object.keys(events);
var key;
for (i = 0; i < keys.length; ++i) {
key = keys[i];
if (key === 'removeListener') continue;
this.removeAllListeners(key);
}
this.removeAllListeners('removeListener');
this._events = Object.create(null);
this._eventsCount = 0;
return this;
}
listeners = events[type];
if (typeof listeners === 'function') {
this.removeListener(type, listeners);
} else if (listeners !== undefined) {
// LIFO order
for (i = listeners.length - 1; i >= 0; i--) {
this.removeListener(type, listeners[i]);
}
}
return this;
};
function _listeners(target, type, unwrap) {
var events = target._events;
if (events === undefined)
return [];
var evlistener = events[type];
if (evlistener === undefined)
return [];
if (typeof evlistener === 'function')
return unwrap ? [evlistener.listener || evlistener] : [evlistener];
return unwrap ?
unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
}
EventEmitter.prototype.listeners = function listeners(type) {
return _listeners(this, type, true);
};
EventEmitter.prototype.rawListeners = function rawListeners(type) {
return _listeners(this, type, false);
};
EventEmitter.listenerCount = function(emitter, type) {
if (typeof emitter.listenerCount === 'function') {
return emitter.listenerCount(type);
} else {
return listenerCount.call(emitter, type);
}
};
EventEmitter.prototype.listenerCount = listenerCount;
function listenerCount(type) {
var events = this._events;
if (events !== undefined) {
var evlistener = events[type];
if (typeof evlistener === 'function') {
return 1;
} else if (evlistener !== undefined) {
return evlistener.length;
}
}
return 0;
}
EventEmitter.prototype.eventNames = function eventNames() {
return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
};
function arrayClone(arr, n) {
var copy = new Array(n);
for (var i = 0; i < n; ++i)
copy[i] = arr[i];
return copy;
}
function spliceOne(list, index) {
for (; index + 1 < list.length; index++)
list[index] = list[index + 1];
list.pop();
}
function unwrapListeners(arr) {
var ret = new Array(arr.length);
for (var i = 0; i < ret.length; ++i) {
ret[i] = arr[i].listener || arr[i];
}
return ret;
}
function once(emitter, name) {
return new Promise(function (resolve, reject) {
function errorListener(err) {
emitter.removeListener(name, resolver);
reject(err);
}
function resolver() {
if (typeof emitter.removeListener === 'function') {
emitter.removeListener('error', errorListener);
}
resolve([].slice.call(arguments));
};
eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
if (name !== 'error') {
addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
}
});
}
function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
if (typeof emitter.on === 'function') {
eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
}
}
function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
if (typeof emitter.on === 'function') {
if (flags.once) {
emitter.once(name, listener);
} else {
emitter.on(name, listener);
}
} else if (typeof emitter.addEventListener === 'function') {
// EventTarget does not have `error` event semantics like Node
// EventEmitters, we do not listen for `error` events here.
emitter.addEventListener(name, function wrapListener(arg) {
// IE does not have builtin `{ once: true }` support so we
// have to do it manually.
if (flags.once) {
emitter.removeEventListener(name, wrapListener);
}
listener(arg);
});
} else {
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
}
}
/***/ }),
/***/ 15:
/*!*********************************************!*\
!*** ./node_modules/object-assign/index.js ***!
\*********************************************/
/***/ ((module) => {
"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
// Detect buggy property enumeration order in older V8 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
test1[5] = 'de';
if (Object.getOwnPropertyNames(test1)[0] === '5') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test2 = {};
for (var i = 0; i < 10; i++) {
test2['_' + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
return test2[n];
});
if (order2.join('') !== '0123456789') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3 = {};
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
/***/ }),
/***/ 687:
/*!*****************************************************************!*\
!*** ./node_modules/react/cjs/react-jsx-runtime.development.js ***!
\*****************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
/** @license React v17.0.1
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
if (true) {
(function() {
'use strict';
var React = __webpack_require__(/*! react */ 959);
var _assign = __webpack_require__(/*! object-assign */ 15);
// ATTENTION
// When adding new symbols to this file,
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = 0xeac7;
var REACT_PORTAL_TYPE = 0xeaca;
exports.Fragment = 0xeacb;
var REACT_STRICT_MODE_TYPE = 0xeacc;
var REACT_PROFILER_TYPE = 0xead2;
var REACT_PROVIDER_TYPE = 0xeacd;
var REACT_CONTEXT_TYPE = 0xeace;
var REACT_FORWARD_REF_TYPE = 0xead0;
var REACT_SUSPENSE_TYPE = 0xead1;
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
var REACT_MEMO_TYPE = 0xead3;
var REACT_LAZY_TYPE = 0xead4;
var REACT_BLOCK_TYPE = 0xead9;
var REACT_SERVER_BLOCK_TYPE = 0xeada;
var REACT_FUNDAMENTAL_TYPE = 0xead5;
var REACT_SCOPE_TYPE = 0xead7;
var REACT_OPAQUE_ID_TYPE = 0xeae0;
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
var REACT_OFFSCREEN_TYPE = 0xeae2;
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
if (typeof Symbol === 'function' && Symbol.for) {
var symbolFor = Symbol.for;
REACT_ELEMENT_TYPE = symbolFor('react.element');
REACT_PORTAL_TYPE = symbolFor('react.portal');
exports.Fragment = symbolFor('react.fragment');
REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
REACT_PROFILER_TYPE = symbolFor('react.profiler');
REACT_PROVIDER_TYPE = symbolFor('react.provider');
REACT_CONTEXT_TYPE = symbolFor('react.context');
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
REACT_MEMO_TYPE = symbolFor('react.memo');
REACT_LAZY_TYPE = symbolFor('react.lazy');
REACT_BLOCK_TYPE = symbolFor('react.block');
REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
REACT_SCOPE_TYPE = symbolFor('react.scope');
REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
}
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator';
function getIteratorFn(maybeIterable) {
if (maybeIterable === null || typeof maybeIterable !== 'object') {
return null;
}
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
if (typeof maybeIterator === 'function') {
return maybeIterator;
}
return null;
}
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function error(format) {
{
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
printWarning('error', format, args);
}
}
function printWarning(level, format, args) {
// When changing this logic, you might want to also
// update consoleWithStackDev.www.js as well.
{
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame.getStackAddendum();
if (stack !== '') {
format += '%s';
args = args.concat([stack]);
}
var argsWithFormat = args.map(function (item) {
return '' + item;
}); // Careful: RN currently depends on this prefix
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
// breaks IE9: https://github.com/facebook/react/issues/13610
// eslint-disable-next-line react-internal/no-production-logging
Function.prototype.apply.call(console[level], console, argsWithFormat);
}
}
// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
var enableScopeAPI = false; // Experimental Create Event Handle API.
function isValidElementType(type) {
if (typeof type === 'string' || typeof type === 'function') {
return true;
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
return true;
}
if (typeof type === 'object' && type !== null) {
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
return true;
}
}
return false;
}
function getWrappedName(outerType, innerType, wrapperName) {
var functionName = innerType.displayName || innerType.name || '';
return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
}
function getContextName(type) {
return type.displayName || 'Context';
}
function getComponentName(type) {
if (type == null) {
// Host root, text node or just invalid type.
return null;
}
{
if (typeof type.tag === 'number') {
error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
}
}
if (typeof type === 'function') {
return type.displayName || type.name || null;
}
if (typeof type === 'string') {
return type;
}
switch (type) {
case exports.Fragment:
return 'Fragment';
case REACT_PORTAL_TYPE:
return 'Portal';
case REACT_PROFILER_TYPE:
return 'Profiler';
case REACT_STRICT_MODE_TYPE:
return 'StrictMode';
case REACT_SUSPENSE_TYPE:
return 'Suspense';
case REACT_SUSPENSE_LIST_TYPE:
return 'SuspenseList';
}
if (typeof type === 'object') {
switch (type.$$typeof) {
case REACT_CONTEXT_TYPE:
var context = type;
return getContextName(context) + '.Consumer';
case REACT_PROVIDER_TYPE:
var provider = type;
return getContextName(provider._context) + '.Provider';
case REACT_FORWARD_REF_TYPE:
return getWrappedName(type, type.render, 'ForwardRef');
case REACT_MEMO_TYPE:
return getComponentName(type.type);
case REACT_BLOCK_TYPE:
return getComponentName(type._render);
case REACT_LAZY_TYPE:
{
var lazyComponent = type;
var payload = lazyComponent._payload;
var init = lazyComponent._init;
try {
return getComponentName(init(payload));
} catch (x) {
return null;
}
}
}
}
return null;
}
// Helpers to patch console.logs to avoid logging during side-effect free
// replaying on render function. This currently only patches the object
// lazily which won't cover if the log function was extracted eagerly.
// We could also eagerly patch the method.
var disabledDepth = 0;
var prevLog;
var prevInfo;
var prevWarn;
var prevError;
var prevGroup;
var prevGroupCollapsed;
var prevGroupEnd;
function disabledLog() {}
disabledLog.__reactDisabledLog = true;
function disableLogs() {
{
if (disabledDepth === 0) {
/* eslint-disable react-internal/no-production-logging */
prevLog = console.log;
prevInfo = console.info;
prevWarn = console.warn;
prevError = console.error;
prevGroup = console.group;
prevGroupCollapsed = console.groupCollapsed;
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
var props = {
configurable: true,
enumerable: true,
value: disabledLog,
writable: true
}; // $FlowFixMe Flow thinks console is immutable.
Object.defineProperties(console, {
info: props,
log: props,
warn: props,
error: props,
group: props,
groupCollapsed: props,
groupEnd: props
});
/* eslint-enable react-internal/no-production-logging */
}
disabledDepth++;
}
}
function reenableLogs() {
{
disabledDepth--;
if (disabledDepth === 0) {
/* eslint-disable react-internal/no-production-logging */
var props = {
configurable: true,
enumerable: true,
writable: true
}; // $FlowFixMe Flow thinks console is immutable.
Object.defineProperties(console, {
log: _assign({}, props, {
value: prevLog
}),
info: _assign({}, props, {
value: prevInfo
}),
warn: _assign({}, props, {
value: prevWarn
}),
error: _assign({}, props, {
value: prevError
}),
group: _assign({}, props, {
value: prevGroup
}),
groupCollapsed: _assign({}, props, {
value: prevGroupCollapsed
}),
groupEnd: _assign({}, props, {
value: prevGroupEnd
})
});
/* eslint-enable react-internal/no-production-logging */
}
if (disabledDepth < 0) {
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
}
}
}
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name, source, ownerFn) {
{
if (prefix === undefined) {
// Extract the VM specific prefix used by each line.
try {
throw Error();
} catch (x) {
var match = x.stack.trim().match(/\n( *(at )?)/);
prefix = match && match[1] || '';
}
} // We use the prefix to ensure our stacks line up with native stack frames.
return '\n' + prefix + name;
}
}
var reentry = false;
var componentFrameCache;
{
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
componentFrameCache = new PossiblyWeakMap();
}
function describeNativeComponentFrame(fn, construct) {
// If something asked for a stack inside a fake render, it should get ignored.
if (!fn || reentry) {
return '';
}
{
var frame = componentFrameCache.get(fn);
if (frame !== undefined) {
return frame;
}
}
var control;
reentry = true;
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
Error.prepareStackTrace = undefined;
var previousDispatcher;
{
previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
// for warnings.
ReactCurrentDispatcher.current = null;
disableLogs();
}
try {
// This should throw.
if (construct) {
// Something should be setting the props in the constructor.
var Fake = function () {
throw Error();
}; // $FlowFixMe
Object.defineProperty(Fake.prototype, 'props', {
set: function () {
// We use a throwing setter instead of frozen or non-writable props
// because that won't throw in a non-strict mode function.
throw Error();
}
});
if (typeof Reflect === 'object' && Reflect.construct) {
// We construct a different control for this case to include any extra
// frames added by the construct call.
try {
Reflect.construct(Fake, []);
} catch (x) {
control = x;
}
Reflect.construct(fn, [], Fake);
} else {
try {
Fake.call();
} catch (x) {
control = x;
}
fn.call(Fake.prototype);
}
} else {
try {
throw Error();
} catch (x) {
control = x;
}
fn();
}
} catch (sample) {
// This is inlined manually because closure doesn't do it for us.
if (sample && control && typeof sample.stack === 'string') {
// This extracts the first frame from the sample that isn't also in the control.
// Skipping one frame that we assume is the frame that calls the two.
var sampleLines = sample.stack.split('\n');
var controlLines = control.stack.split('\n');
var s = sampleLines.length - 1;
var c = controlLines.length - 1;
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
// We expect at least one stack frame to be shared.
// Typically this will be the root most one. However, stack frames may be
// cut off due to maximum stack limits. In this case, one maybe cut off
// earlier than the other. We assume that the sample is longer or the same
// and there for cut off earlier. So we should find the root most frame in
// the sample somewhere in the control.
c--;
}
for (; s >= 1 && c >= 0; s--, c--) {
// Next we find the first one that isn't the same which should be the
// frame that called our sample function and the control.
if (sampleLines[s] !== controlLines[c]) {
// In V8, the first line is describing the message but other VMs don't.
// If we're about to return the first line, and the control is also on the same
// line, that's a pretty good indicator that our sample threw at same line as
// the control. I.e. before we entered the sample frame. So we ignore this result.
// This can happen if you passed a class to function component, or non-function.
if (s !== 1 || c !== 1) {
do {
s--;
c--; // We may still have similar intermediate frames from the construct call.
// The next one that isn't the same should be our match though.
if (c < 0 || sampleLines[s] !== controlLines[c]) {
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
{
if (typeof fn === 'function') {
componentFrameCache.set(fn, _frame);
}
} // Return the line we found.
return _frame;
}
} while (s >= 1 && c >= 0);
}
break;
}
}
}
} finally {
reentry = false;
{
ReactCurrentDispatcher.current = previousDispatcher;
reenableLogs();
}
Error.prepareStackTrace = previousPrepareStackTrace;
} // Fallback to just using the name if we couldn't make it throw.
var name = fn ? fn.displayName || fn.name : '';
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
{
if (typeof fn === 'function') {
componentFrameCache.set(fn, syntheticFrame);
}
}
return syntheticFrame;
}
function describeFunctionComponentFrame(fn, source, ownerFn) {
{
return describeNativeComponentFrame(fn, false);
}
}
function shouldConstruct(Component) {
var prototype = Component.prototype;
return !!(prototype && prototype.isReactComponent);
}
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
if (type == null) {
return '';
}
if (typeof type === 'function') {
{
return describeNativeComponentFrame(type, shouldConstruct(type));
}
}
if (typeof type === 'string') {
return describeBuiltInComponentFrame(type);
}
switch (type) {
case REACT_SUSPENSE_TYPE:
return describeBuiltInComponentFrame('Suspense');
case REACT_SUSPENSE_LIST_TYPE:
return describeBuiltInComponentFrame('SuspenseList');
}
if (typeof type === 'object') {
switch (type.$$typeof) {
case REACT_FORWARD_REF_TYPE:
return describeFunctionComponentFrame(type.render);
case REACT_MEMO_TYPE:
// Memo may contain any component type so we recursively resolve it.
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
case REACT_BLOCK_TYPE:
return describeFunctionComponentFrame(type._render);
case REACT_LAZY_TYPE:
{
var lazyComponent = type;
var payload = lazyComponent._payload;
var init = lazyComponent._init;
try {
// Lazy may contain any component type so we recursively resolve it.
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
} catch (x) {}
}
}
}
return '';
}
var loggedTypeFailures = {};
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
function setCurrentlyValidatingElement(element) {
{
if (element) {
var owner = element._owner;
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
ReactDebugCurrentFrame.setExtraStackFrame(stack);
} else {
ReactDebugCurrentFrame.setExtraStackFrame(null);
}
}
}
function checkPropTypes(typeSpecs, values, location, componentName, element) {
{
// $FlowFixMe This is okay but Flow doesn't know it.
var has = Function.call.bind(Object.prototype.hasOwnProperty);
for (var typeSpecName in typeSpecs) {
if (has(typeSpecs, typeSpecName)) {
var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
if (typeof typeSpecs[typeSpecName] !== 'function') {
var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
err.name = 'Invariant Violation';
throw err;
}
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
} catch (ex) {
error$1 = ex;
}
if (error$1 && !(error$1 instanceof Error)) {
setCurrentlyValidatingElement(element);
error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
setCurrentlyValidatingElement(null);
}
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
loggedTypeFailures[error$1.message] = true;
setCurrentlyValidatingElement(element);
error('Failed %s type: %s', location, error$1.message);
setCurrentlyValidatingElement(null);
}
}
}
}
}
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var RESERVED_PROPS = {
key: true,
ref: true,
__self: true,
__source: true
};
var specialPropKeyWarningShown;
var specialPropRefWarningShown;
var didWarnAboutStringRefs;
{
didWarnAboutStringRefs = {};
}
function hasValidRef(config) {
{
if (hasOwnProperty.call(config, 'ref')) {
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
if (getter && getter.isReactWarning) {
return false;
}
}
}
return config.ref !== undefined;
}
function hasValidKey(config) {
{
if (hasOwnProperty.call(config, 'key')) {
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
if (getter && getter.isReactWarning) {
return false;
}
}
}
return config.key !== undefined;
}
function warnIfStringRefCannotBeAutoConverted(config, self) {
{
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
var componentName = getComponentName(ReactCurrentOwner.current.type);
if (!didWarnAboutStringRefs[componentName]) {
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
didWarnAboutStringRefs[componentName] = true;
}
}
}
}
function defineKeyPropWarningGetter(props, displayName) {
{
var warnAboutAccessingKey = function () {
if (!specialPropKeyWarningShown) {
specialPropKeyWarningShown = true;
error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
}
};
warnAboutAccessingKey.isReactWarning = true;
Object.defineProperty(props, 'key', {
get: warnAboutAccessingKey,
configurable: true
});
}
}
function defineRefPropWarningGetter(props, displayName) {
{
var warnAboutAccessingRef = function () {
if (!specialPropRefWarningShown) {
specialPropRefWarningShown = true;
error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
}
};
warnAboutAccessingRef.isReactWarning = true;
Object.defineProperty(props, 'ref', {
get: warnAboutAccessingRef,
configurable: true
});
}
}
/**
* Factory method to create a new React element. This no longer adheres to
* the class pattern, so do not use new to call it. Also, instanceof check
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
* if something is a React Element.
*
* @param {*} type
* @param {*} props
* @param {*} key
* @param {string|object} ref
* @param {*} owner
* @param {*} self A *temporary* helper to detect places where `this` is
* different from the `owner` when React.createElement is called, so that we
* can warn. We want to get rid of owner and replace string `ref`s with arrow
* functions, and as long as `this` and owner are the same, there will be no
* change in behavior.
* @param {*} source An annotation object (added by a transpiler or otherwise)
* indicating filename, line number, and/or other information.
* @internal
*/
var ReactElement = function (type, key, ref, self, source, owner, props) {
var element = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: REACT_ELEMENT_TYPE,
// Built-in properties that belong on the element
type: type,
key: key,
ref: ref,
props: props,
// Record the component responsible for creating this element.
_owner: owner
};
{
// The validation flag is currently mutative. We put it on
// an external backing store so that we can freeze the whole object.
// This can be replaced with a WeakMap once they are implemented in
// commonly used development environments.
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
// the validation flag non-enumerable (where possible, which should
// include every environment we run tests in), so the test framework
// ignores it.
Object.defineProperty(element._store, 'validated', {
configurable: false,
enumerable: false,
writable: true,
value: false
}); // self and source are DEV only properties.
Object.defineProperty(element, '_self', {
configurable: false,
enumerable: false,
writable: false,
value: self
}); // Two elements created in two different places should be considered
// equal for testing purposes and therefore we hide it from enumeration.
Object.defineProperty(element, '_source', {
configurable: false,
enumerable: false,
writable: false,
value: source
});
if (Object.freeze) {
Object.freeze(element.props);
Object.freeze(element);
}
}
return element;
};
/**
* https://github.com/reactjs/rfcs/pull/107
* @param {*} type
* @param {object} props
* @param {string} key
*/
function jsxDEV(type, config, maybeKey, source, self) {
{
var propName; // Reserved names are extracted
var props = {};
var key = null;
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
// issue if key is also explicitly declared (ie.