@fluidattacks/design 3.33.13 → 3.33.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/@core/index.js +1 -1
- package/dist/components/accordion/accordion-content/index.js +1 -1
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/advanced-badge/index.js +1 -1
- package/dist/components/advisories-card/index.js +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/card/card-header/index.js +1 -1
- package/dist/components/card/card-with-image/index.js +1 -1
- package/dist/components/card/card-with-input/index.js +1 -1
- package/dist/components/card/card-with-options/index.js +1 -1
- package/dist/components/card/card-with-selector/index.js +1 -1
- package/dist/components/card/card-with-switch/index.js +1 -1
- package/dist/components/card/index.js +1 -1
- package/dist/components/card/indicator-card/index.js +1 -1
- package/dist/components/card/indicator-card/index.stories.d.ts +8 -8
- package/dist/components/card-container/index.js +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/cloud-image/index.js +1 -1
- package/dist/components/code-snippet/index.js +1 -1
- package/dist/components/code-snippet/location-code/index.js +1 -1
- package/dist/components/colors/index.js +1 -1
- package/dist/components/conditions-dialog/index.js +1 -1
- package/dist/components/confirm-dialog/index.js +1 -1
- package/dist/components/container/index.js +1 -1
- package/dist/components/copy-button/index.js +1 -1
- package/dist/components/divider/index.js +1 -1
- package/dist/components/dropdown/index.js +1 -1
- package/dist/components/empty-state/empty-button/index.js +1 -1
- package/dist/components/empty-state/index.js +1 -1
- package/dist/components/fa-tag/index.js +1 -1
- package/dist/components/file-preview/index.js +1 -1
- package/dist/components/filters/active-filters/active-filter/index.js +1 -1
- package/dist/components/filters/active-filters/index.js +1 -1
- package/dist/components/filters/active-filters/utils.d.ts +1 -1
- package/dist/components/filters/context/index.js +1 -1
- package/dist/components/filters/filters-menu/index.js +1 -1
- package/dist/components/filters/index.js +1 -1
- package/dist/components/filters/options-menu/index.js +1 -1
- package/dist/components/filters/options-menu/options/index.js +1 -1
- package/dist/components/filters/search/no-matches/index.js +1 -1
- package/dist/components/form/index.js +1 -1
- package/dist/components/form/inner-form/index.js +1 -1
- package/dist/components/grid-container/index.js +1 -1
- package/dist/components/group-selector/index.js +1 -1
- package/dist/components/group-selector/option-container/index.js +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/indicator-card-db/index.js +1 -1
- package/dist/components/info-sidebar/index.js +1 -1
- package/dist/components/inputs/fields/combobox/field/index.js +1 -1
- package/dist/components/inputs/fields/combobox/index.js +1 -1
- package/dist/components/inputs/fields/combobox/option/index.js +1 -1
- package/dist/components/inputs/fields/date/calendar/cell/index.js +1 -1
- package/dist/components/inputs/fields/date/calendar/grid/index.js +1 -1
- package/dist/components/inputs/fields/date/calendar/header/index.js +1 -1
- package/dist/components/inputs/fields/date/calendar/index.js +1 -1
- package/dist/components/inputs/fields/date/index.js +1 -1
- package/dist/components/inputs/fields/date-range/calendar/index.js +1 -1
- package/dist/components/inputs/fields/date-range/index.js +1 -1
- package/dist/components/inputs/fields/date-time/calendar/index.js +1 -1
- package/dist/components/inputs/fields/date-time/index.js +1 -1
- package/dist/components/inputs/fields/editable/index.js +1 -1
- package/dist/components/inputs/fields/input-array/field/index.js +1 -1
- package/dist/components/inputs/fields/input-array/index.js +1 -1
- package/dist/components/inputs/fields/input-file/default/index.js +1 -1
- package/dist/components/inputs/fields/input-file/dropzone/index.js +1 -1
- package/dist/components/inputs/fields/input-file/index.js +1 -1
- package/dist/components/inputs/fields/input-section/index.js +1 -1
- package/dist/components/inputs/fields/input-tags/field/index.js +1 -1
- package/dist/components/inputs/fields/input-tags/index.js +1 -1
- package/dist/components/inputs/fields/number/index.js +1 -1
- package/dist/components/inputs/fields/number-range/index.js +1 -1
- package/dist/components/inputs/fields/phone/index.js +1 -1
- package/dist/components/inputs/fields/text-area/index.js +1 -1
- package/dist/components/inputs/fields/text-input/index.js +1 -1
- package/dist/components/inputs/index.js +1 -1
- package/dist/components/inputs/label/index.js +1 -1
- package/dist/components/inputs/outline-container/index.js +1 -1
- package/dist/components/inputs/utils/action-button/index.js +1 -1
- package/dist/components/inputs/utils/calendar-button/index.js +1 -1
- package/dist/components/inputs/utils/date-selector/index.js +1 -1
- package/dist/components/inputs/utils/date-time-field/index.js +1 -1
- package/dist/components/inputs/utils/dialog/index.js +1 -1
- package/dist/components/inputs/utils/number-field/index.js +1 -1
- package/dist/components/inputs/utils/popover/index.js +1 -1
- package/dist/components/item-card-db/index.js +1 -1
- package/dist/components/layout/categories/buttons/index.js +1 -1
- package/dist/components/layout/categories/column/index.js +1 -1
- package/dist/components/layout/categories/gap/index.js +1 -1
- package/dist/components/layout/categories/row/index.js +1 -1
- package/dist/components/layout/index.js +1 -1
- package/dist/components/link/index.js +1 -1
- package/dist/components/list-item/index.js +1 -1
- package/dist/components/little-flag/index.js +1 -1
- package/dist/components/loading/index.js +1 -1
- package/dist/components/logo/index.js +1 -1
- package/dist/components/lottie/index.js +1 -1
- package/dist/components/menu/index.js +1 -1
- package/dist/components/message-banner/index.js +1 -1
- package/dist/components/modal/columns-modal/index.js +1 -1
- package/dist/components/modal/columns-modal/preview-panel/index.js +1 -1
- package/dist/components/modal/columns-modal/search-panel/index.js +1 -1
- package/dist/components/modal/filters-modal/applied-filter/index.js +1 -1
- package/dist/components/modal/filters-modal/applied-filters/index.js +1 -1
- package/dist/components/modal/filters-modal/column-filters/index.js +1 -1
- package/dist/components/modal/filters-modal/filter-control/index.js +1 -1
- package/dist/components/modal/filters-modal/filter-form/form-content/index.js +1 -1
- package/dist/components/modal/filters-modal/filter-form/hooks/index.js +1 -1
- package/dist/components/modal/filters-modal/filter-form/index.js +1 -1
- package/dist/components/modal/filters-modal/filters-list/index.js +1 -1
- package/dist/components/modal/filters-modal/index.js +1 -1
- package/dist/components/modal/footer/index.js +1 -1
- package/dist/components/modal/header/index.js +1 -1
- package/dist/components/modal/index.js +1 -1
- package/dist/components/modal/modal-confirm/index.js +1 -1
- package/dist/components/notification/index.js +1 -1
- package/dist/components/notification-sign/index.js +1 -1
- package/dist/components/oauth-selector/index.js +1 -1
- package/dist/components/oauth-selector/option-container/index.js +1 -1
- package/dist/components/paginator-db/btn/index.js +1 -1
- package/dist/components/paginator-db/dropdown/index.js +1 -1
- package/dist/components/paginator-db/index.js +1 -1
- package/dist/components/pop-up/description/index.js +1 -1
- package/dist/components/pop-up/index.js +1 -1
- package/dist/components/premium-feature/index.js +1 -1
- package/dist/components/priority-cards/card/index.js +1 -1
- package/dist/components/priority-cards/index.js +1 -1
- package/dist/components/priority-score/index.js +1 -1
- package/dist/components/progress-bar/index.js +1 -1
- package/dist/components/progress-indicator/in-progress-icon/index.js +1 -1
- package/dist/components/progress-indicator/index.js +1 -1
- package/dist/components/progress-indicator/step/index.js +1 -1
- package/dist/components/radio-button/index.js +1 -1
- package/dist/components/rank-position/icon/index.js +1 -1
- package/dist/components/rank-position/index.js +1 -1
- package/dist/components/rules-card/index.js +1 -1
- package/dist/components/scroll-button/index.js +1 -1
- package/dist/components/search/index.js +1 -1
- package/dist/components/search-dropdown/index.js +1 -1
- package/dist/components/severity-badge/index.js +1 -1
- package/dist/components/severity-overview/badge/index.js +1 -1
- package/dist/components/severity-overview/index.js +1 -1
- package/dist/components/show-on-hover/index.js +1 -1
- package/dist/components/slide-out-menu/index.js +1 -1
- package/dist/components/slide-out-menu/menu-item/index.js +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/thumb/index.js +1 -1
- package/dist/components/step-lapse/index.js +1 -1
- package/dist/components/table/context/index.js +1 -1
- package/dist/components/table/export-csv/index.js +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/table/pagination/pagination-control/index.js +1 -1
- package/dist/components/table/pagination/pagination-dropdown/index.js +1 -1
- package/dist/components/table/pagination/pagination-size/index.js +1 -1
- package/dist/components/table/sort-icon/index.js +1 -1
- package/dist/components/table/table-body/index.js +1 -1
- package/dist/components/table/table-column-toggle/index.js +1 -1
- package/dist/components/table/table-content/head/index.js +1 -1
- package/dist/components/table/table-content/index.js +1 -1
- package/dist/components/table/table-footer/footer-content/index.js +1 -1
- package/dist/components/table/table-footer/index.js +1 -1
- package/dist/components/table/table-options/caption-content/index.js +1 -1
- package/dist/components/table/table-options/controls-content/index.js +1 -1
- package/dist/components/table/table-options/highlighted-content/index.js +1 -1
- package/dist/components/table/table-options/index.js +1 -1
- package/dist/components/table/wrapper/index.js +1 -1
- package/dist/components/table-button/index.js +1 -1
- package/dist/components/table-content/index.js +1 -1
- package/dist/components/table-content/item-content/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/tab/index.js +1 -1
- package/dist/components/tag/index.d.ts +1 -1
- package/dist/components/tag/index.js +1 -1
- package/dist/components/tag/types.d.ts +1 -0
- package/dist/components/timeline/card/index.js +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/toggle/index.js +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tour/index.js +1 -1
- package/dist/components/typography/heading/index.js +1 -1
- package/dist/components/typography/index.js +1 -1
- package/dist/components/typography/span/index.js +1 -1
- package/dist/components/typography/text/index.js +1 -1
- package/dist/components/weaknesses-card/index.js +1 -1
- package/dist/{components-Bj79vSGF.mjs → components-D9_Ooe7u.mjs} +1796 -1736
- package/dist/{components-10ncsIOh.js → components-fU4umxUy.js} +237 -237
- package/dist/context/index.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{vendor-C0CrxSAa.mjs → vendor-DqWEtepN.mjs} +11530 -11214
- package/dist/vendor-_hdBUzNL.js +173 -0
- package/package.json +16 -13
- package/dist/vendor-uQRonpxh.js +0 -173
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),u=require("react"),
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),u=require("react"),y=require("styled-components"),f=require("./vendor-_hdBUzNL.js"),je=require("react-dom"),pt=require("react-router-dom"),tr=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},et=tr(u),ae=e=>({getVariant:(n,i)=>e(n)[i]}),yn=["padding","px","py","pl","pr","pt","pb","margin","mx","my","ml","mr","mt","mb","zIndex","position","top","right","bottom","left","border","borderTop","borderRight","borderBottom","borderLeft","borderColor","borderRadius","scroll","visibility","display","height","width","maxHeight","maxWidth","minHeight","minWidth","shadow","bgColor","bgGradient","gap","flexDirection","flexGrow","justify","justifySelf","alignItems","alignSelf","wrap","color","fontFamily","fontSize","fontWeight","textAlign","whiteSpace","letterSpacing","lineSpacing","textDecoration","textOverflow","whiteSpace","wordBreak","wordWrap","cursor","transition","borderColorHover","bgColorHover","shadowHover"],nr={25:"#fcfcfd",50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#2f394b",800:"#212a36",900:"#161b25"},ir={25:"#fef2f3",50:"#fddfe2",100:"#fbbac0",200:"#f9959e",300:"#f65e6a",400:"#f32637",500:"#bf0b1a",600:"#ac0a17",700:"#9a0915",800:"#870812",900:"#750710"},rr={25:"",50:"",100:"#f59dbe",200:"",300:"#b8075d",400:"",500:"#7f0540",600:"",700:"#59042d",800:"",900:"#460323"},or={25:"",50:"#fef3f2",100:"",200:"#fecdca",300:"",400:"",500:"#f04438",600:"",700:"#b42318",800:"",900:""},sr={25:"",50:"#fffaeb",100:"",200:"#fef0c7",300:"",400:"#ffd562",500:"#fdb022",600:"#f27100",700:"#b54708",800:"",900:""},ar={25:"",50:"#f6fef9",100:"",200:"#a6f4c5",300:"",400:"",500:"#12b76a",600:"",700:"#027a48",800:"",900:""},lr={25:"",50:"#eff8ff",100:"",200:"#b2ddff",300:"",400:"",500:"#2e90fa",600:"",700:"#175cd3",800:"",900:""},cr="linear-gradient(180deg, #BF0B1A 0%, #F32637 100%)",dr={type:{primary:"Roboto, sans-serif",mono:"'Space Mono', monospace"},heading:{lg:"32px",md:"24px",sm:"20px",xs:"16px"},text:{lg:"16px",md:"14px",sm:"12px",xs:"10px"},weight:{bold:"700",regular:"400"}},pr={none:"none",sm:"0px 1px 2px 0px rgba(16, 24, 40, 0.15)",md:"0px 4px 6px 0px rgba(16, 24, 40, 0.15)",lg:"0px 8px 24px 0px rgba(16, 24, 40, 0.15)"},gr={sm:"1024px",md:"1440px",lg:"1920px"},ur={0:"0rem",.125:"0.125rem",.25:"0.25rem",.5:"0.5rem",.625:"0.625rem",.75:"0.75rem",.875:"0.875rem",1:"1rem",1.25:"1.25rem",1.5:"1.5rem",1.75:"1.75rem",2:"2rem",2.25:"2.25rem",2.5:"2.5rem",3:"3rem",4:"4rem",5:"5rem",6:"6rem"},xr=["lock-keyhole","bars-sort","bolt","books","brain-circuit","briefcase","bug","buildings","bullseye-pointer","calendar-clock","calendar-xmark","chart-network","clipboard-check","comment","envelope","eye","file","flag","globe","hand-holding-dollar","hands-clapping","headset","hexagon-exclamation","light-emergency-on","magnifying-glass","pen-line","plane-departure","screwdriver-wrench","sensor-triangle-exclamation","shield-check","sidebar","skull","sliders","star-christmas","telescope","trash","unlock","user-group","user-hoodie","xmark","arrow-down","arrow-left","arrow-right","arrow-up","plus","minus","check","circle-question"],A={typography:dr,shadows:pr,breakpoints:gr,spacing:ur,palette:{primary:ir,complementary:rr,error:or,info:lr,warning:sr,success:ar,black:"#0c111d",gradient:cr,white:"#ffffff",gray:nr}},hr=({children:e})=>t.jsx(y.ThemeProvider,{theme:A,children:e}),L=(e,n)=>n===void 0?"":`${e}: ${n};`,Ne=e=>{const n=e.py??e.pt??0,i=e.px??e.pr??0,r=e.py??e.pb??0,o=e.px??e.pl??0;if(e.padding){const[s,l,a,c]=e.padding;return`padding: ${A.spacing[s]} ${A.spacing[l]} ${A.spacing[a]} ${A.spacing[c]};`}return`padding: ${A.spacing[n]} ${A.spacing[i]} ${A.spacing[r]} ${A.spacing[o]};`},Ae=e=>{const n=e.my??e.mt??0,i=e.mx??e.mr??0,r=e.my??e.mb??0,o=e.mx??e.ml??0;if(e.margin){const[s,l,a,c]=e.margin;return`margin: ${A.spacing[s]} ${A.spacing[l]} ${A.spacing[a]} ${A.spacing[c]};`}return`margin: ${A.spacing[n]} ${A.spacing[i]} ${A.spacing[r]} ${A.spacing[o]};`},Le=e=>{const n=L("position",e.position),i=L("top",e.top),r=L("right",e.right),o=L("bottom",e.bottom),s=L("left",e.left),l=L("z-index",e.zIndex);return`
|
|
2
2
|
${n}
|
|
3
3
|
${i}
|
|
4
4
|
${r}
|
|
5
5
|
${o}
|
|
6
|
-
${
|
|
6
|
+
${s}
|
|
7
7
|
${l}
|
|
8
|
-
`},Pe=e=>{const n=L("border",e.border),i=L("border-top",e.borderTop),r=L("border-right",e.borderRight),o=L("border-bottom",e.borderBottom),
|
|
8
|
+
`},Pe=e=>{const n=L("border",e.border),i=L("border-top",e.borderTop),r=L("border-right",e.borderRight),o=L("border-bottom",e.borderBottom),s=L("border-left",e.borderLeft),l=L("border-color",e.borderColor),a=L("border-radius",e.borderRadius);return`
|
|
9
9
|
${n}
|
|
10
10
|
${i}
|
|
11
11
|
${r}
|
|
12
12
|
${o}
|
|
13
|
-
${a}
|
|
14
|
-
${l}
|
|
15
13
|
${s}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
${l}
|
|
15
|
+
${a}
|
|
16
|
+
`},fr=e=>e.includes("x")?"overflow-x: auto;":"",yr=e=>e.includes("y")?"overflow-y: auto;":"",Oe=e=>{const n=e.scroll?`
|
|
17
|
+
${fr(e.scroll)}
|
|
18
|
+
${yr(e.scroll)}
|
|
19
|
+
`:"",i=L("visibility",e.visibility),r=L("display",e.display),o=L("height",e.height),s=L("width",e.width),l=L("max-height",e.maxHeight),a=L("max-width",e.maxWidth),c=L("min-height",e.minHeight),p=L("min-width",e.minWidth),d=L("box-shadow",e.shadow?A.shadows[e.shadow]:void 0),g=L("gap",e.gap===void 0?void 0:A.spacing[e.gap]),x=L("background-color",e.bgColor),h=L("background",e.bgGradient),b=L("flex-direction",e.flexDirection),m=L("flex-grow",e.flexGrow),j=L("justify-content",e.justify),w=L("justify-self",e.justifySelf),C=L("align-items",e.alignItems),k=L("align-self",e.alignSelf),v=L("flex-wrap",e.wrap);return`
|
|
20
20
|
${n}
|
|
21
21
|
${i}
|
|
22
22
|
${r}
|
|
23
23
|
${o}
|
|
24
|
-
${a}
|
|
25
|
-
${l}
|
|
26
24
|
${s}
|
|
25
|
+
${l}
|
|
26
|
+
${a}
|
|
27
27
|
${c}
|
|
28
28
|
${p}
|
|
29
29
|
${d}
|
|
@@ -37,29 +37,29 @@
|
|
|
37
37
|
${C}
|
|
38
38
|
${k}
|
|
39
39
|
${v}
|
|
40
|
-
`},Be=e=>{const n=L("color",e.color),i=L("font-family",e.fontFamily),r=L("font-size",e.fontSize),o=L("font-weight",e.fontWeight),
|
|
40
|
+
`},Be=e=>{const n=L("color",e.color),i=L("font-family",e.fontFamily),r=L("font-size",e.fontSize),o=L("font-weight",e.fontWeight),s=L("line-spacing",e.letterSpacing),l=L("line-height",e.lineSpacing),a=L("text-align",e.textAlign),c=L("text-decoration",e.textDecoration),p=L("text-overflow",e.textOverflow),d=L("white-space",e.whiteSpace),g=L("word-break",e.wordBreak),x=L("word-wrap",e.wordWrap);return`
|
|
41
41
|
${n}
|
|
42
42
|
${i}
|
|
43
43
|
${r}
|
|
44
44
|
${o}
|
|
45
|
-
${a}
|
|
46
|
-
${l}
|
|
47
45
|
${s}
|
|
46
|
+
${l}
|
|
47
|
+
${a}
|
|
48
48
|
${c}
|
|
49
49
|
${p}
|
|
50
50
|
${d}
|
|
51
51
|
${g}
|
|
52
52
|
${x}
|
|
53
|
-
`},We=e=>{const n=L("cursor",e.cursor),i=L("border-color",e.borderColorHover),r=L("background-color",e.bgColorHover),o=L("box-shadow",e.shadowHover===void 0?void 0:A.shadows[e.shadowHover]),
|
|
53
|
+
`},We=e=>{const n=L("cursor",e.cursor),i=L("border-color",e.borderColorHover),r=L("background-color",e.bgColorHover),o=L("box-shadow",e.shadowHover===void 0?void 0:A.shadows[e.shadowHover]),s=L("transition",e.transition);return`
|
|
54
54
|
${n}
|
|
55
55
|
|
|
56
56
|
&:hover {
|
|
57
|
-
${
|
|
57
|
+
${s||"transition: all 0.2s;"}
|
|
58
58
|
${i}
|
|
59
59
|
${r}
|
|
60
60
|
${o}
|
|
61
61
|
}
|
|
62
|
-
`},
|
|
62
|
+
`},Me={shouldForwardProp:e=>!yn.includes(e)},_e=y.styled.div.withConfig(Me)`
|
|
63
63
|
${Ne}
|
|
64
64
|
${Ae}
|
|
65
65
|
${Le}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
${Be}
|
|
68
68
|
${Pe}
|
|
69
69
|
${We}
|
|
70
|
-
`,jt=
|
|
70
|
+
`,jt=y.styled.button.withConfig(Me)`
|
|
71
71
|
${Ne}
|
|
72
72
|
${Ae}
|
|
73
73
|
${Le}
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
${Be}
|
|
76
76
|
${Pe}
|
|
77
77
|
${We}
|
|
78
|
-
`,wt=
|
|
78
|
+
`,wt=y.styled.p.withConfig(Me)`
|
|
79
79
|
${Ne}
|
|
80
80
|
${Ae}
|
|
81
81
|
${Le}
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
${Be}
|
|
84
84
|
${Pe}
|
|
85
85
|
${We}
|
|
86
|
-
`,vt=
|
|
86
|
+
`,vt=y.styled.span.withConfig(Me)`
|
|
87
87
|
${Ne}
|
|
88
88
|
${Ae}
|
|
89
89
|
${Le}
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
${Be}
|
|
92
92
|
${Pe}
|
|
93
93
|
${We}
|
|
94
|
-
`,
|
|
94
|
+
`,br=y.styled(_e)`
|
|
95
95
|
${({theme:e,$center:n=!1,$styleMd:i,$styleSm:r})=>`
|
|
96
96
|
${n?"margin: auto;":""}
|
|
97
97
|
scrollbar-color: ${e.palette.gray[600]} ${e.palette.gray[100]};
|
|
@@ -108,17 +108,17 @@
|
|
|
108
108
|
${r};
|
|
109
109
|
}
|
|
110
110
|
`}
|
|
111
|
-
`,$=u.forwardRef(function({as:n="div",center:i,children:r,id:o,onHover:
|
|
112
|
-
${({theme:e,$bgGradient:n="unset",$color:i=e.palette.gray[800],$display:r="block",$fontFamily:o=e.typography.type.primary,$fontWeight:
|
|
111
|
+
`,$=u.forwardRef(function({as:n="div",center:i,children:r,id:o,onHover:s,onLeave:l,styleMd:a,styleSm:c,...p},d){return t.jsx(br,{$center:i,$styleMd:a,$styleSm:c,as:n,id:o,onMouseLeave:l,onMouseOver:s,ref:d,...p,children:r})}),bn=(e,n=!1)=>{if(n)switch(e){case"lg":return 2.5;case"md":return 2;case"sm":return 1.75;case"xs":return 1.5}switch(e){case"lg":return 1.5;case"md":case"sm":return 1.25;case"xs":return 1}},$r=y.styled(wt)`
|
|
112
|
+
${({theme:e,$bgGradient:n="unset",$color:i=e.palette.gray[800],$display:r="block",$fontFamily:o=e.typography.type.primary,$fontWeight:s="bold",$letterSpacing:l=0,$overflow:a="unset",$size:c,$sizeMd:p,$textFill:d="unset",$whiteSpace:g="pre-line",$wordBreak:x="normal"})=>`
|
|
113
113
|
background: ${n};
|
|
114
114
|
color: ${i};
|
|
115
115
|
display: ${r};
|
|
116
116
|
font-family: ${o};
|
|
117
117
|
font-size: ${e.typography.heading[c]};
|
|
118
|
-
font-weight: ${e.typography.weight[
|
|
118
|
+
font-weight: ${e.typography.weight[s]};
|
|
119
119
|
letter-spacing: ${l};
|
|
120
120
|
line-height: ${e.spacing[bn(c,!0)]};
|
|
121
|
-
overflow: ${
|
|
121
|
+
overflow: ${a};
|
|
122
122
|
width: ${r==="block"?"100%":"auto"};
|
|
123
123
|
white-space: ${g};
|
|
124
124
|
word-break: ${x};
|
|
@@ -133,16 +133,16 @@
|
|
|
133
133
|
font-size: ${e.typography.heading[p??c]};
|
|
134
134
|
}
|
|
135
135
|
`}
|
|
136
|
-
`,$n=
|
|
137
|
-
${({theme:e,$bgGradient:n="unset",$color:i=e.palette.gray[600],$display:r="block",$fontFamily:o=e.typography.type.primary,$fontWeight:
|
|
136
|
+
`,$n=y.styled(wt)`
|
|
137
|
+
${({theme:e,$bgGradient:n="unset",$color:i=e.palette.gray[600],$display:r="block",$fontFamily:o=e.typography.type.primary,$fontWeight:s="regular",$fontStyle:l="normal",$letterSpacing:a=0,$overflow:c="unset",$size:p,$sizeMd:d,$textFill:g="unset",$whiteSpace:x="pre-line",$wordBreak:h="normal"})=>`
|
|
138
138
|
background: ${n};
|
|
139
139
|
color: ${i};
|
|
140
140
|
display: ${r};
|
|
141
141
|
font-family: ${o};
|
|
142
142
|
font-size: ${e.typography.text[p]};
|
|
143
143
|
font-style: ${l};
|
|
144
|
-
font-weight: ${e.typography.weight[
|
|
145
|
-
letter-spacing: ${
|
|
144
|
+
font-weight: ${e.typography.weight[s]};
|
|
145
|
+
letter-spacing: ${a};
|
|
146
146
|
line-height: ${e.spacing[bn(p)]};
|
|
147
147
|
overflow: ${c};
|
|
148
148
|
width: ${r==="block"?"100%":"auto"};
|
|
@@ -159,12 +159,12 @@
|
|
|
159
159
|
font-size: ${e.typography.text[d??p]};
|
|
160
160
|
}
|
|
161
161
|
`}
|
|
162
|
-
`,
|
|
163
|
-
${({theme:e,$color:n=e.palette.gray[600],$content:i=void 0,$display:r="inline",$fontWeight:o="regular",$size:
|
|
162
|
+
`,mr=y.styled(vt)`
|
|
163
|
+
${({theme:e,$color:n=e.palette.gray[600],$content:i=void 0,$display:r="inline",$fontWeight:o="regular",$size:s,$lineSpacing:l=1.25})=>`
|
|
164
164
|
color: ${n};
|
|
165
165
|
display: ${r};
|
|
166
166
|
font-family: ${e.typography.type.primary};
|
|
167
|
-
font-size: ${e.typography.text[
|
|
167
|
+
font-size: ${e.typography.text[s]};
|
|
168
168
|
font-weight: ${e.typography.weight[o]};
|
|
169
169
|
line-height: ${e.spacing[l]};
|
|
170
170
|
max-width: 100%;
|
|
@@ -172,11 +172,11 @@
|
|
|
172
172
|
|
|
173
173
|
${i===void 0?"":`&::after { content: "${i}"; }`}
|
|
174
174
|
`}
|
|
175
|
-
`,G=u.forwardRef(function({bgGradient:n,children:i,className:r,color:o,display:
|
|
176
|
-
${({$clickable:e,$color:n="inherit",$disabled:i=!1,$hoverColor:r,$rotation:o,$size:
|
|
175
|
+
`,G=u.forwardRef(function({bgGradient:n,children:i,className:r,color:o,display:s,fontFamily:l,fontWeight:a,letterSpacing:c,lineSpacing:p,lineSpacingSm:d,overflow:g,size:x,sizeMd:h,sizeSm:b,textFill:m,whiteSpace:j,wordBreak:w,...C},k){return t.jsx($r,{$bgGradient:n,$color:o,$display:s,$fontFamily:l,$fontWeight:a,$letterSpacing:c,$lineSpacing:p,$lineSpacingSm:d,$overflow:g,$size:x,$sizeMd:h,$sizeSm:b,$textFill:m,$whiteSpace:j,$wordBreak:w,className:r,ref:k,...C,children:i})}),be=u.forwardRef(function({children:n,color:i,content:r,display:o,fontFamily:s,fontWeight:l,letterSpacing:a,lineSpacing:c,lineSpacingSm:p,size:d,sizeMd:g,sizeSm:x,...h},b){return t.jsx(mr,{$color:i,$content:r,$display:o,$fontFamily:s,$fontWeight:l,$letterSpacing:a,$lineSpacing:c,$lineSpacingSm:p,$size:d,$sizeMd:g,$sizeSm:x,ref:b,...h,children:n})}),I=u.forwardRef(function({bgGradient:n,children:i,className:r,color:o,display:s,fontFamily:l,fontWeight:a,letterSpacing:c,lineSpacing:p,lineSpacingSm:d,overflow:g,size:x,sizeMd:h,sizeSm:b,textFill:m,whiteSpace:j,wordBreak:w,fontStyle:C,...k},v){return t.jsx($n,{$bgGradient:n,$color:o,$display:s,$fontFamily:l,$fontStyle:C,$fontWeight:a,$letterSpacing:c,$lineSpacing:p,$lineSpacingSm:d,$overflow:g,$size:x,$sizeMd:h,$sizeSm:b,$textFill:m,$whiteSpace:j,$wordBreak:w,className:r,ref:v,...k,children:i})}),mn=({item:e})=>{const n=e.description&&typeof e.description=="string"?t.jsx(I,{mb:e.extraElement?.5:void 0,size:"md",children:e.description}):e.description??void 0;return t.jsxs($,{display:"block",id:`panel-${e.title}`,padding:[.875,.875,.875,.875],children:[n,e.extraElement?t.jsx($,{children:e.extraElement}):void 0]})},at={xl:"24px",lg:"16px",md:"14px",sm:"12px",xs:"10px"},jr=e=>at[e]?at[e]:typeof e=="string"&&e.includes("px")?e:at.md,wr=y.styled(vt)`
|
|
176
|
+
${({$clickable:e,$color:n="inherit",$disabled:i=!1,$hoverColor:r,$rotation:o,$size:s,$secondaryColor:l})=>{const a=r?"":"brightness(50%)",c=r??"";return`
|
|
177
177
|
color: ${n};
|
|
178
178
|
cursor: ${e?"pointer":"inherit"};
|
|
179
|
-
font-size: ${
|
|
179
|
+
font-size: ${jr(s)};
|
|
180
180
|
line-height: 0;
|
|
181
181
|
vertical-align: middle;
|
|
182
182
|
pointer-events: inherit;
|
|
@@ -197,18 +197,18 @@
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
${e?`&:hover {
|
|
200
|
-
filter: ${
|
|
200
|
+
filter: ${a};
|
|
201
201
|
color: ${c};
|
|
202
202
|
}`:""}
|
|
203
203
|
`}}
|
|
204
|
-
`;
|
|
204
|
+
`;y.styled.div`
|
|
205
205
|
cursor: pointer;
|
|
206
206
|
transition: all 0.2s ease-in-out;
|
|
207
207
|
|
|
208
208
|
&:hover:not([disabled]) {
|
|
209
209
|
transform: scale(1.2);
|
|
210
210
|
}
|
|
211
|
-
`;const R=u.forwardRef(function({clickable:n,disabled:i,hoverColor:r,icon:o,iconClass:
|
|
211
|
+
`;const R=u.forwardRef(function({clickable:n,disabled:i,hoverColor:r,icon:o,iconClass:s="",iconColor:l,iconMask:a,iconSize:c,iconTransform:p,iconType:d="fa-solid",onClick:g,rotation:x,spanClass:h,secondaryColor:b,...m},j){return t.jsx(wr,{$clickable:n,$color:l,$disabled:i,$hoverColor:r,$rotation:x,$secondaryColor:b,$size:c,className:h,"data-testid":`${o}-icon`,onClick:g,ref:j,...m,children:t.jsx("i",{className:`${d} fa-${o} ${s}`,...a!==void 0?{"data-fa-mask":a}:{},...p!==void 0?{"data-fa-transform":p}:{}})},`${d}-${o}`)}),vr=u.forwardRef(function({aligned:n="end",items:i,bgColor:r},o){const s=y.useTheme(),[l,a]=u.useState(i.map(p=>p.expanded??!1)),c=u.useCallback(p=>d=>{d.preventDefault(),a(g=>g.map((x,h)=>h===p?!x:x))},[]);return t.jsx($,{borderColor:s.palette.gray[200],borderTop:"1px solid",ref:o,children:i.map((p,d)=>{const g=l[d];return t.jsxs($,{bgColor:r??s.palette.white,borderBottom:"1px solid",borderColor:s.palette.gray[200],children:[t.jsx($,{"aria-controls":`panel-${p.title}`,"aria-expanded":g,"aria-label":p.title,as:"button",bgColor:r??s.palette.white,bgColorHover:s.palette.gray[100],cursor:"pointer",display:"flex",onClick:c(d),padding:[.875,.875,.875,.875],width:"100%",children:t.jsxs($,{as:"summary",display:"flex",flexDirection:n==="end"?"row":"row-reverse",gap:.75,justify:"space-between",width:"100%",children:[t.jsx(I,{color:s.palette.gray[800],fontWeight:"bold",size:"md",textAlign:"start",children:p.title}),t.jsx(R,{icon:g?"chevron-up":"chevron-down",iconColor:s.palette.gray[400],iconSize:"lg",iconType:"fa-light"})]})}),g&&t.jsx(mn,{item:p})]},p.title)})})}),kr=36,Cr=2,Sr=9,zr={sm:12,md:16,lg:24},Tr=({size:e="lg"})=>{const n=zr[e],i=`bookmarkGradient-${Math.random().toString(kr).substr(Cr,Sr)}`;return t.jsxs("div",{style:{alignItems:"center",display:"flex",height:n,justifyContent:"center",position:"relative",width:n},children:[t.jsxs("svg",{height:n,style:{position:"absolute",zIndex:1},viewBox:"0 0 14 14",width:n,xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M0 0H14V14L7 11.0213L0 14V0Z",fill:`url(#${i})`}),t.jsx("defs",{children:t.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:i,x1:7,x2:7,y1:0,y2:14,children:[t.jsx("stop",{stopColor:"#F32637"}),t.jsx("stop",{offset:"1",stopColor:"#B8075D"})]})})]}),t.jsx("div",{style:{position:"relative",top:"-2px",zIndex:3},children:t.jsx(R,{icon:"crown",iconColor:"#FFFFFF",iconSize:`${n/2-1}px`,iconType:"fa-solid"})})]})},gt=e=>({pentester:{bgColor:e.palette.gradient,color:e.palette.white},scanner:{bgColor:e.palette.gray[800],color:e.palette.white},external:{bgColor:e.palette.gray[200],color:e.palette.gray[600]}}),Ir=y.styled.div`
|
|
212
212
|
${({theme:e,$includeAuthor:n,$variant:i})=>`
|
|
213
213
|
display: inline-flex;
|
|
214
214
|
align-items: center;
|
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
}
|
|
233
233
|
`:""}
|
|
234
234
|
`}
|
|
235
|
-
`,
|
|
235
|
+
`,Dr=y.styled.div`
|
|
236
236
|
${({theme:e,$variant:n})=>`
|
|
237
237
|
display: flex;
|
|
238
238
|
align-items: center;
|
|
@@ -248,7 +248,7 @@
|
|
|
248
248
|
padding: ${e.spacing[.125]} ${e.spacing[.5]};
|
|
249
249
|
position: relative;
|
|
250
250
|
`}
|
|
251
|
-
`,jn=(e,n)=>{const[r,o]=u.useState(0),[
|
|
251
|
+
`,jn=(e,n)=>{const[r,o]=u.useState(0),[s,l]=u.useState(0);return u.useEffect(()=>{s===100&&(()=>{o(c=>c===n-1?0:c+1)})()},[s,n]),u.useEffect(()=>{const a=setInterval(()=>{l(c=>c===100?0:c+1)},e);return()=>{clearInterval(a)}},[e]),{cycle:r,progress:s,setCycle:o,setProgress:l}},re=(e,n,i=!1,r)=>{u.useEffect(()=>{var s;const o=l=>{e&&!e.contains(l.target)&&!(r!=null&&r.some(a=>a==null?void 0:a.contains(l.target)))&&n()};return i?(document.addEventListener("mousedown",o,!0),()=>{document.removeEventListener("mousedown",o,!0)}):((s=document.getElementById("root"))==null||s.addEventListener("mousedown",o,!0),()=>{var l;(l=document.getElementById("root"))==null||l.removeEventListener("mousedown",o,!0)})},[i,e,r,n])},wn=({publicId:e,format:n="webp"})=>{const i=u.useMemo(()=>new f.Cloudinary({cloud:{cloudName:"fluid-attacks"}}),[]);return u.useMemo(()=>i.image(e).format(n),[i,e,n])},we=e=>{const[n,i]=u.useState(!1),r=u.useCallback(()=>{i(!0)},[]),o=u.useCallback(()=>{i(!1)},[]),s=u.useCallback(()=>{i(l=>!l)},[]);return{close:o,isOpen:n,name:e,open:r,setIsOpen:i,toggle:s}},Er=e=>e.reduce((n,i)=>({...n,[i.id]:i.visible}),{}),vn=({name:e,items:n,columnOrder:i,setColumnOrder:r,setColumnVisibility:o})=>{const s=u.useMemo(()=>[...n.filter(({locked:g})=>g).map(({locked:g,...x})=>({...x,visible:!0,locked:g})),...n.filter(({locked:g})=>!g)],[n]),[l,a]=u.useState(s),c=u.useCallback(g=>{const x=g.filter(({locked:j})=>!j),b=[...g.filter(({locked:j})=>j),...x],m=b.map(({name:j})=>j);a(j=>[...b,...j.filter(({name:w})=>!m.includes(w))]),r&&r(b.map(({id:j})=>j))},[r]),p=u.useCallback(()=>{const g=l.map(x=>({...x,visible:x.locked||((i==null?void 0:i.includes(x.id))??!1)})).toSorted((x,h)=>{if(x.locked&&!h.locked)return-1;if(!x.locked&&h.locked)return 1;if(Number(h.visible)!==Number(x.visible))return Number(h.visible)-Number(x.visible);const b=(i==null?void 0:i.indexOf(x.id))??0,m=(i==null?void 0:i.indexOf(h.id))??0;return b-m});o==null||o(Er(g)),c(g)},[l,i,c,o]),d=u.useMemo(()=>f.some(l,g=>((i==null?void 0:i.includes(g.id))??!1)!==g.visible),[l,i]);return{setColumns:c,resetToDefault:p,columns:l,...we(e),hasChanged:d}},kt=(e,n)=>u.useMemo(()=>f._.debounce(e,n),[e,n]),Ct=({filters:e})=>{const n=e.flatMap(a=>a.id),[i,r]=f.useQueryStates({...Object.fromEntries(n.map(a=>[a,f.parseAsString.withDefault("")])),searchGlobal:f.parseAsString.withDefault(""),search:f.parseAsString.withDefault("")}),o=Object.values(i).filter(a=>!!a&&a!=="undefined").flatMap(a=>a.split(",")).filter(a=>a!=="-").length,s=u.useMemo(()=>{const a=new Map(e.map(c=>[c.id,c]));return Object.entries(i).filter(([,c])=>!!c&&c!=="undefined").flatMap(([c,p])=>{var w;const d=a.get(c);if(!d)return[{id:c,label:void 0,value:p}];const g=p.split(","),x=new Set(g),h=g.filter(C=>C==="-"||RegExp(/^\d+$/).test(C)||RegExp(/^\d+\-\d+\-\d+$/).test(C.trim())),b=(w=d.options)==null?void 0:w.flatMap(C=>{var k;return((k=C.items)==null?void 0:k.filter(v=>x.has(v.value)).map(v=>v.label??v.value))??[]}).filter(Boolean),m=b&&b.length>0,j=h.length>0;return m&&j?[{id:c,label:d.label,value:b.join(", ")},{id:c,label:d.label,value:h.join(", ")}]:m?[{id:c,label:d.label,value:b.join(", ")}]:j?[{id:c,label:d.label,value:h.join(", ")}]:[{id:c,label:d.label,value:p}]})},[i,e]),l=u.useCallback(a=>()=>{r(c=>({...c,[a]:null}))},[r]);return{activeFilters:o,appliedFilters:s,removeFilter:l,setValues:r,values:i}},Fr=e=>{const[n,i]=u.useState(),r=kt(o=>{i(o)},(e==null?void 0:e.debounceWait)??300);return[n,r]},Rr=({alt:e="img",height:n="",width:i="",transformation:r,plugins:o=[f.lazyload(),f.placeholder()],publicId:s})=>{const l=wn({publicId:s});return r&&l.addTransformation(r),t.jsx(f.AdvancedImage,{alt:e,cldImg:l,height:n,plugins:o,width:i})},oe=et.default.memo(Rr),Zt={external:"External pentester",scanner:"Fluid Attacks Scanner",pentester:"Fluid Attacks Pentester"},kn=({author:e,variant:n})=>{const i=n==="external"?"t_fav_g":"t_fav_w";return t.jsxs(Ir,{$includeAuthor:!!e,$variant:n,children:[t.jsxs(Dr,{$variant:n,children:[t.jsx(oe,{alt:Zt[n],height:"11px",publicId:"airs/logo/logo_icon",transformation:i,width:"11px"}),Zt[n]]}),e?t.jsx(I,{display:"inline",size:"sm",children:e}):void 0]})},Nr={critical:{bgColor:A.palette.primary[700],colorL:A.palette.gray[800],colorR:A.palette.white},disable:{bgColor:A.palette.gray[200],colorL:A.palette.gray[400],colorR:A.palette.gray[400]},high:{bgColor:A.palette.error[500],colorL:A.palette.gray[800],colorR:A.palette.white},low:{bgColor:A.palette.warning[200],colorL:A.palette.gray[800],colorR:A.palette.gray[800]},medium:{bgColor:A.palette.warning[500],colorL:A.palette.gray[800],colorR:A.palette.gray[800]}},tt=({textL:e,textR:n,variant:i})=>{const r=y.useTheme(),{bgColor:o,colorL:s,colorR:l}=Nr[i];return t.jsxs($,{alignItems:"flex-start",display:"inline-flex",children:[e?t.jsx($,{alignItems:"center",bgColor:r.palette.white,border:`1px solid ${o}`,borderRadius:"4px 0px 0px 4px",display:"flex",justify:"center",padding:[0,.25,0,.25],children:t.jsx(I,{color:s,size:"md",children:e})}):void 0,t.jsx($,{alignItems:"center",bgColor:o,border:`1px solid ${o}`,borderRadius:e?"0px 4px 4px 0px":"4px",display:"flex",padding:e?[0,.25,0,.125]:[0,.25,0,.25],pb:.125,pl:.125,pr:.125,pt:.125,children:t.jsx(I,{color:l,size:"md",children:n})})]})},Ar=(e,n)=>n==="0"?`${e.spacing[1]} ${e.spacing[1]} 0 0`:n==="-1"?`0 0 ${e.spacing[1]} ${e.spacing[1]}`:"unset",St=y.styled.div`
|
|
252
252
|
${({theme:e,$index:n})=>`
|
|
253
253
|
align-items: flex-start;
|
|
254
254
|
display: flex;
|
|
@@ -256,7 +256,7 @@
|
|
|
256
256
|
background-color: ${e.palette.white};
|
|
257
257
|
border: 1px solid;
|
|
258
258
|
border-color: ${e.palette.gray[200]};
|
|
259
|
-
border-radius: ${
|
|
259
|
+
border-radius: ${Ar(e,n)};
|
|
260
260
|
gap: ${e.spacing[.5]};
|
|
261
261
|
padding: ${e.spacing[1.5]};
|
|
262
262
|
overflow: hidden;
|
|
@@ -270,12 +270,12 @@
|
|
|
270
270
|
border-color: transparent;
|
|
271
271
|
}
|
|
272
272
|
`}
|
|
273
|
-
`,
|
|
273
|
+
`,se=y.styled.div`
|
|
274
274
|
display: inline-block;
|
|
275
275
|
content: "";
|
|
276
276
|
height: 24px;
|
|
277
277
|
border-left: 2px solid ${({theme:e})=>e.palette.gray[100]};
|
|
278
|
-
`,
|
|
278
|
+
`,Lr=({affects:e,author:n,creator:i,href:r,ids:o,indx:s,Link:l,packageName:a,publishedDate:c,score:p,severity:d,title:g})=>{const x=y.useTheme(),h=l??"a";return t.jsxs(St,{$index:s,children:[t.jsxs($,{display:"flex",flexDirection:"column",gap:.25,width:"100%",children:[t.jsxs($,{display:"flex",justify:"space-between",children:[t.jsxs(I,{color:x.palette.primary[500],display:"inline",size:"lg",children:[o.flatId,t.jsxs(be,{color:x.palette.gray[800],display:"inline",size:"lg",children:[" ",`(${o.advId})`]})]}),i?t.jsx(kn,{author:n,variant:i}):void 0]}),t.jsx(h,{href:r,children:t.jsx(G,{fontWeight:"bold",size:"sm",wordBreak:"break-word",children:g})})]}),t.jsxs($,{alignItems:"center",display:"flex",flexDirection:"row",gap:.75,width:"fit-content",wrap:"wrap",children:[t.jsx(tt,{textL:p,textR:f.capitalize(d==="disable"?"Unknown":d),variant:d}),e?t.jsxs(t.Fragment,{children:[t.jsx(se,{}),t.jsxs(I,{color:x.palette.gray[400],display:"inline",size:"lg",children:[t.jsx("b",{children:"Affects: "}),e]})]}):void 0,a?t.jsxs(t.Fragment,{children:[t.jsx(se,{}),t.jsxs(I,{color:x.palette.gray[400],display:"inline",size:"lg",children:[t.jsx("b",{children:"Package: "}),a]})]}):void 0,c?t.jsxs(t.Fragment,{children:[t.jsx(se,{}),t.jsxs(I,{color:x.palette.gray[400],display:"inline",size:"lg",children:[t.jsx("b",{children:"Published date: "}),c]})]}):void 0]})]})},Pr=e=>{switch(e){case"warning":return"triangle-exclamation";case"info":return"circle-info";case"success":return"circle-check";case"error":default:return"circle-exclamation"}},{getVariant:Or}=ae(e=>({error:`
|
|
279
279
|
background: ${e.palette.error[50]};
|
|
280
280
|
border: 1px solid ${e.palette.error[500]};
|
|
281
281
|
color: ${e.palette.error[700]};
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
color: ${e.palette.warning[700]};
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
`})),
|
|
330
|
+
`})),Br=y.styled.div`
|
|
331
331
|
${({theme:e,$variant:n,$iconPosition:i="center"})=>`
|
|
332
332
|
background: transparent;
|
|
333
333
|
align-items: ${i==="top"?"flex-start":"center"};
|
|
@@ -347,18 +347,18 @@
|
|
|
347
347
|
background-color: transparent;
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
${
|
|
350
|
+
${Or(e,n??"error")}
|
|
351
351
|
`}
|
|
352
|
-
`,
|
|
352
|
+
`,Wr=y.styled.div`
|
|
353
353
|
padding-right: 4px;
|
|
354
354
|
width: 100%;
|
|
355
355
|
font-size: 20px;
|
|
356
356
|
font-weight: ${({theme:e})=>e.typography.weight.bold};
|
|
357
|
-
`,
|
|
357
|
+
`,Mr=y.styled.div`
|
|
358
358
|
padding-right: 4px;
|
|
359
359
|
width: 100%;
|
|
360
360
|
font-weight: ${({theme:e,$hasTitle:n})=>n?e.typography.weight.regular:e.typography.weight.bold};
|
|
361
|
-
`,{getVariant:
|
|
361
|
+
`,{getVariant:_r}=ae(e=>({ghost:`
|
|
362
362
|
background: transparent;
|
|
363
363
|
border: none;
|
|
364
364
|
color: ${e.palette.gray[800]};
|
|
@@ -432,7 +432,7 @@
|
|
|
432
432
|
background-color: ${e.palette.primary[500]};
|
|
433
433
|
color: ${e.palette.white};
|
|
434
434
|
}
|
|
435
|
-
`})),Cn=
|
|
435
|
+
`})),Cn=y.styled(jt)`
|
|
436
436
|
${({theme:e,justify:n,$variant:i})=>`
|
|
437
437
|
align-items: center;
|
|
438
438
|
border-radius: var(--btn-spacing);
|
|
@@ -454,10 +454,10 @@
|
|
|
454
454
|
${i!=="link"?`--btn-padding-y: ${e.spacing[1]}`:""};
|
|
455
455
|
}
|
|
456
456
|
|
|
457
|
-
${
|
|
457
|
+
${_r(e,i??"primary")}
|
|
458
458
|
`}
|
|
459
|
-
`,
|
|
460
|
-
${({theme:e,disabled:n,borderRadius:i="4px",px:r=.5,py:o=.5,$variant:
|
|
459
|
+
`,Hr=y.styled(Cn)`
|
|
460
|
+
${({theme:e,disabled:n,borderRadius:i="4px",px:r=.5,py:o=.5,$variant:s})=>`
|
|
461
461
|
--btn-spacing: ${i};
|
|
462
462
|
--btn-padding-x: ${e.spacing[r]};
|
|
463
463
|
--btn-padding-y: ${e.spacing[o]};
|
|
@@ -465,14 +465,14 @@
|
|
|
465
465
|
align-items: center;
|
|
466
466
|
line-height: 0;
|
|
467
467
|
text-align: center;
|
|
468
|
-
${
|
|
468
|
+
${s==="ghost"?`color: ${e.palette.gray[700]};`:""}
|
|
469
469
|
|
|
470
470
|
> span {
|
|
471
471
|
margin: 0 !important;
|
|
472
472
|
${n?`color: ${e.palette.gray[300]};`:""}
|
|
473
473
|
}
|
|
474
474
|
`}
|
|
475
|
-
`,
|
|
475
|
+
`,Vr=y.styled(_e)``,Ur=y.styled.div`
|
|
476
476
|
${({theme:e,$maxWidth:n="320px"})=>`
|
|
477
477
|
background-color: ${e.palette.gray[700]};
|
|
478
478
|
border-radius: 8px;
|
|
@@ -484,7 +484,7 @@
|
|
|
484
484
|
word-break: break-word;
|
|
485
485
|
z-index: 999999;
|
|
486
486
|
`}
|
|
487
|
-
`,
|
|
487
|
+
`,Gr=y.styled.div`
|
|
488
488
|
position: absolute;
|
|
489
489
|
width: 16px;
|
|
490
490
|
height: 8px;
|
|
@@ -509,7 +509,7 @@
|
|
|
509
509
|
left: 50%;
|
|
510
510
|
transform: translateX(-50%) rotate(180deg);
|
|
511
511
|
`}}}
|
|
512
|
-
`,Z=({children:e,disabled:n=!1,display:i="inline-block",height:r,icon:o,iconColor:
|
|
512
|
+
`,Z=({children:e,disabled:n=!1,display:i="inline-block",height:r,icon:o,iconColor:s,iconSize:l,id:a,maxWidth:c,nodeTip:p,place:d="bottom",tip:g="",title:x="",hide:h=g===""&&x===""&&p===void 0,width:b})=>{const m=y.useTheme(),[j,w]=u.useState(!1),{refs:C,floatingStyles:k,context:v,placement:z}=f.useFloating({middleware:[f.flip({fallbackAxisSideDirection:"start"}),f.offset({mainAxis:10}),f.shift()],onOpenChange:w,open:j,placement:d,whileElementsMounted:f.autoUpdate}),S=f.useHover(v,{delay:{close:0,open:500},move:!1}),T=f.useFocus(v),N=f.useRole(v,{role:o?"label":"tooltip"}),{getReferenceProps:E,getFloatingProps:D}=f.useInteractions([S,T,N]),F=u.useMemo(()=>z.startsWith("top")?"top":z.startsWith("bottom")?"bottom":z.startsWith("left")?"left":z.startsWith("right")?"right":"bottom",[z]);return n?t.jsx(u.StrictMode,{children:e}):t.jsxs(t.Fragment,{children:[t.jsx(Vr,{...E(),display:i,height:r,id:a,ref:C.setReference,width:b,children:o?t.jsx(R,{clickable:!0,disabled:n,icon:o,iconColor:s,iconSize:l??"sm",iconType:j?"fa-solid":"fa-light"}):e}),j&&!h&&je.createPortal(t.jsxs(Ur,{...D(),$maxWidth:c,id:`floating-${a}`,ref:C.setFloating,style:k,children:[f.lodashExports.isEmpty(x)?void 0:t.jsx(I,{color:m.palette.white,fontWeight:"bold",mb:.25,size:"sm",textAlign:"start",wordWrap:"break-word",children:x}),f.lodashExports.isEmpty(g)?void 0:t.jsx(I,{color:m.palette.gray[100],size:"sm",textAlign:"start",whiteSpace:"normal",wordWrap:"break-word",children:g}),f.lodashExports.isEmpty(p)?void 0:p,t.jsx(Gr,{$placement:F,children:t.jsx("svg",{fill:"none",height:"8",viewBox:"0 0 16 8",width:"16",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M16 0L0 0L6.58579 6.58579C7.36684 7.36684 8.63317 7.36684 9.41421 6.58579L16 0Z",fill:m.palette.gray[700]})})})]}),document.getElementById("root")??document.body)]})},V=u.forwardRef(function({borderRadius:n,disabled:i,icon:r,iconColor:o,iconSize:s="sm",iconTransform:l,iconType:a,id:c,justify:p="center",onClick:d,px:g,py:x,type:h="button",tooltip:b,tooltipPlace:m,value:j,variant:w="primary",...C},k){const v=t.jsx(Hr,{$variant:w,"aria-disabled":i,"aria-label":c,borderRadius:n,disabled:i,id:c,justify:p,onClick:d,px:g,py:x,ref:k,type:h,value:j,...C,children:t.jsx(R,{clickable:!1,icon:r,iconColor:o,iconSize:s,iconTransform:l,iconType:a})}),S=(h+(w??"")+(c??r)).replace(/ /u,"_");return b===void 0?v:t.jsx(Z,{id:`${S}-tooltip`,place:m,tip:b,children:v})}),Yr=u.forwardRef(function({autoHide:n=!1,children:i,closable:r=!1,icon:o,iconEnabled:s=!0,iconPosition:l="center",onClose:a=void 0,onTimeOut:c,show:p=!0,time:d=8,title:g,variant:x="error",id:h,...b},m){const[j,w]=u.useState(p),C=u.useCallback(()=>{a==null||a(),w(!1)},[a]);return u.useEffect(()=>{const k=setTimeout(()=>{c==null||c(!0),n&&C()},d*1e3);return()=>{clearTimeout(k)}},[n,C,d,c]),u.useEffect(()=>{w(p)},[p,w]),t.jsx($,{display:j?"block":"none",ref:m,role:"alert",...b,children:t.jsxs(Br,{$iconPosition:l,$variant:x,id:h,children:[s?t.jsx(R,{clickable:!1,icon:o??Pr(x),iconSize:"lg",iconType:"fa-light",mt:l==="top"?.25:0}):void 0,t.jsxs($,{display:"flex",flexDirection:"column",gap:.25,style:{flex:1},children:[g?t.jsx(Wr,{children:g}):void 0,t.jsx(Mr,{$hasTitle:!!g,children:i})]}),r?t.jsx(V,{height:"fit-content",icon:"close",iconSize:"lg",iconType:"fa-light",onClick:C,px:.125,py:.125,style:{alignSelf:"flex-start"},variant:"ghost"}):void 0]})})}),qt=y.styled.div`
|
|
513
513
|
${({theme:e})=>`
|
|
514
514
|
align-items: center;
|
|
515
515
|
background-color: ${e.palette.gray[200]};
|
|
@@ -525,7 +525,7 @@
|
|
|
525
525
|
width: ${e.spacing[1.25]};
|
|
526
526
|
height: ${e.spacing[1.25]};
|
|
527
527
|
`}
|
|
528
|
-
`,
|
|
528
|
+
`,Xr=y.styled.div`
|
|
529
529
|
ul,
|
|
530
530
|
ol {
|
|
531
531
|
padding-top: 6px;
|
|
@@ -589,7 +589,7 @@
|
|
|
589
589
|
#menu-profile-container li div {
|
|
590
590
|
min-width: unset;
|
|
591
591
|
}
|
|
592
|
-
`,
|
|
592
|
+
`,Kr=y.styled(_e)`
|
|
593
593
|
${({theme:e,$variant:n,$numberIndicator:i})=>{const r=i!=null&&i>0;return`
|
|
594
594
|
align-items: center;
|
|
595
595
|
background: ${n==="error"?e.palette.primary[400]:e.palette.warning[500]};
|
|
@@ -603,14 +603,14 @@
|
|
|
603
603
|
min-width: ${r?e.spacing[1.25]:e.spacing[.5]};
|
|
604
604
|
height: ${r?"14px":e.spacing[.5]}};
|
|
605
605
|
`}}
|
|
606
|
-
`,
|
|
606
|
+
`,Zr=y.styled.div`
|
|
607
607
|
align-items: center;
|
|
608
608
|
color: ${({theme:e})=>e.palette.white};
|
|
609
609
|
display: flex;
|
|
610
610
|
font-size: ${({theme:e})=>e.typography.text.sm};
|
|
611
611
|
font-weight: ${({theme:e})=>e.typography.weight.regular};
|
|
612
612
|
justify-content: center;
|
|
613
|
-
`,
|
|
613
|
+
`,Ze=u.forwardRef(function({numberIndicator:n,show:i,variant:r="error",...o},s){return t.jsx(Kr,{$numberIndicator:n,$variant:r,className:i?"flex":"hidden","data-testid":"notification-sign",ref:s,...o,children:n&&t.jsx(Zr,{children:n<=9?n:9})})}),{getVariant:qr}=ae(e=>({default:`
|
|
614
614
|
background-color: ${e.palette.gray[200]};
|
|
615
615
|
color: ${e.palette.gray[800]};
|
|
616
616
|
`,error:`
|
|
@@ -685,7 +685,7 @@
|
|
|
685
685
|
background-color: ${e.palette.warning[400]};
|
|
686
686
|
color: ${e.palette.warning[700]};
|
|
687
687
|
}
|
|
688
|
-
`})),
|
|
688
|
+
`})),Jr=y.styled.span`
|
|
689
689
|
${({theme:e,$fontSize:n=e.typography.text.sm,$variant:i})=>`
|
|
690
690
|
align-items: center;
|
|
691
691
|
border-radius: ${e.spacing[i==="technique"?1:.25]};
|
|
@@ -706,9 +706,9 @@
|
|
|
706
706
|
display: flex;
|
|
707
707
|
}
|
|
708
708
|
|
|
709
|
-
${
|
|
709
|
+
${qr(e,i)}
|
|
710
710
|
`}
|
|
711
|
-
`,{getVariant:
|
|
711
|
+
`,{getVariant:Qr}=ae(e=>({highRelevance:`
|
|
712
712
|
color: ${e.palette.primary[500]};
|
|
713
713
|
|
|
714
714
|
&:hover:not([disabled]) {
|
|
@@ -720,7 +720,7 @@
|
|
|
720
720
|
&:hover:not([disabled]) {
|
|
721
721
|
color: ${e.palette.gray[500]};
|
|
722
722
|
}
|
|
723
|
-
`})),zt=
|
|
723
|
+
`})),zt=y.css`
|
|
724
724
|
${({theme:e,$color:n,$variant:i,$wrap:r})=>`
|
|
725
725
|
align-items: center;
|
|
726
726
|
cursor: pointer;
|
|
@@ -747,13 +747,13 @@
|
|
|
747
747
|
text-decoration: none;
|
|
748
748
|
}
|
|
749
749
|
|
|
750
|
-
${n?`color: ${n}`:
|
|
750
|
+
${n?`color: ${n}`:Qr(e,i)}
|
|
751
751
|
`}
|
|
752
|
-
`,
|
|
752
|
+
`,eo=y.styled.a`
|
|
753
753
|
${zt}
|
|
754
|
-
`,
|
|
754
|
+
`,to=y.styled(pt.Link)`
|
|
755
755
|
${zt}
|
|
756
|
-
`,le=({children:e,color:n,download:i,href:r,iconPosition:o="right",onClick:
|
|
756
|
+
`,le=({children:e,color:n,download:i,href:r,iconPosition:o="right",onClick:s,target:l,variant:a="lowRelevance",wrap:c=!1})=>{const p=r.startsWith("https://"),d=t.jsx(R,{icon:i===void 0?"arrow-up-right-from-square":"arrow-down-to-bracket",iconSize:"sm",iconType:"fa-light",ml:.25,mr:.25});return p?t.jsxs(eo,{$color:n,$variant:a,$wrap:c,download:i,href:r,onClick:s,rel:"nofollow noopener noreferrer",target:l??"_blank",children:[o==="left"?d:void 0,e,o==="right"?d:void 0]}):t.jsxs(to,{$variant:a,$wrap:c,download:i,onClick:s,rel:"nofollow noopener noreferrer",target:l,to:r,children:[l!==void 0&&o==="left"?d:void 0,e,l!==void 0&&o==="right"?d:void 0]})},q=({disabled:e,icon:n,iconColor:i="inherit",iconType:r="fa-light",id:o="close-tag",filterId:s="",filterValues:l="",fontSize:a,href:c,linkLabel:p,onClose:d,priority:g="default",tagTitle:x="",tagLabel:h,variant:b="default"})=>{const m=h.length>25&&f.lodashExports.isEmpty(x+l),j=`${h.slice(0,25)}...`;return t.jsxs(be,{className:"gap-0.5","data-testid":s,display:c===void 0?"initial":"flex",size:"md",children:[t.jsxs(Jr,{$fontSize:a,$variant:b,className:g,children:[n&&t.jsx(R,{icon:n,iconColor:i,iconSize:"sm",iconType:r}),t.jsxs("span",{className:"w-full",children:[t.jsx("strong",{children:x}),t.jsx("span",{children:m?j:h}),t.jsx("strong",{className:"w-full",children:l})]}),d?t.jsx(V,{disabled:e,icon:"xmark",iconSize:"sm",iconType:"fa-light",id:o,onClick:d,px:.125,py:.125,variant:"ghost"}):void 0]}),c===void 0?void 0:t.jsx(le,{href:c,children:p})]})},Sn=(e,n=!0)=>{const i=window.open(e,n?void 0:"_self","noopener,noreferrer,");f.lodashExports.isObject(i)&&(i.opener=null)},_=u.forwardRef(function({children:n,disabled:i=!1,external:r=!1,href:o,id:s,icon:l,iconColor:a,iconSize:c="lg",iconType:p,name:d,dotNotification:g,notification:x,onClick:h,rightIcon:b,tag:m,type:j="button",tooltip:w,tooltipPlace:C="bottom",underline:k=!1,value:v,variant:z="primary",width:S,...T},N){const E=w!==void 0,D=`${s}-tooltip`,F=u.useCallback(()=>{o&&Sn(o,r)},[r,o]),P=t.jsxs(Cn,{$variant:z,"aria-disabled":i,className:k?"underline":void 0,disabled:i,id:s,name:d,onClick:z==="link"?F:h,ref:N,type:j,value:v,width:S,...E?{"data-tooltip-id":D}:{},...T,children:[g&&z==="ghost"&&!i?t.jsx(Ze,{left:l!==void 0?"13%":"1%",show:!0,top:"20%",variant:"error"}):void 0,l!==void 0&&t.jsx(R,{icon:l,iconColor:a??void 0,iconSize:c,iconType:p??"fa-light"}),n,b||z==="link"?t.jsx(R,{icon:b??"arrow-right",iconSize:c,iconType:"fa-light"}):void 0,m===void 0||i?null:t.jsx(q,{tagLabel:m,variant:"default"}),x!==void 0&&z==="ghost"&&!i?t.jsx(Ze,{numberIndicator:x,show:!0,variant:"error"}):void 0]});return E?t.jsx(Z,{disabled:!E,id:D,place:C,tip:w,width:S,children:P}):P}),no=u.forwardRef(function({children:n,onClick:i,userName:r,showIcon:o=!1,showUsername:s=!1},l){const a=!!i,c=y.useTheme();return t.jsx($,{id:"navbar-user-profile",ref:l,zIndex:9999,children:t.jsxs($,{alignItems:"end",display:"flex",flexDirection:"column",position:"relative",zIndex:30,children:[a?t.jsxs(_,{onClick:i,px:.5,py:.5,variant:"ghost",children:[t.jsx(qt,{children:r[0].toUpperCase()}),s?t.jsx(I,{color:c.palette.gray[800],display:"inline",ml:.5,size:"md",children:r.split(" ")[0]}):void 0,o?t.jsx(R,{clickable:!1,icon:"ellipsis-v",iconSize:"xs",ml:.5}):void 0]}):t.jsxs($,{alignItems:"center",display:"flex",px:.5,py:.5,children:[t.jsx(qt,{children:r[0].toUpperCase()}),s?t.jsxs(I,{color:c.palette.gray[800],display:"inline",ml:.5,size:"md",children:["Hi ",r.split(" ")[0],"!"]}):void 0,o?t.jsx(R,{clickable:!1,icon:"ellipsis-v",iconSize:"xs",ml:.5}):void 0]}),t.jsx(Xr,{children:n})]})})}),nt=({authorEmail:e,date:n,description:i,descriptionColor:r,id:o,title:s,titleColor:l,textAlign:a,textSpacing:c=0,tooltip:p})=>{const d=y.useTheme();return t.jsxs($,{width:"100%",children:[typeof s=="string"||p?t.jsxs($,{alignItems:"center",display:"inline-flex",gap:.5,width:"100%",children:[typeof s=="string"?t.jsx(I,{color:l??d.palette.gray[800],fontWeight:"bold",mb:c,size:"md",textAlign:a,wordBreak:"break-word",children:s}):s,p&&t.jsx(Z,{icon:"circle-info",id:o,place:"top",tip:p})]}):void 0,t.jsxs($,{alignItems:"start",display:"flex",flexDirection:"column",gap:.25,children:[i&&t.jsx(I,{color:r??d.palette.gray[800],fontWeight:i===void 0?"bold":"regular",size:"md",textAlign:a,wordBreak:"break-word",children:i}),n&&t.jsx(I,{color:d.palette.gray[800],fontWeight:"bold",size:"md",textAlign:a,wordBreak:"break-word",children:`Date: ${n.split(" ")[0]}`}),e&&t.jsx(I,{color:d.palette.gray[800],fontWeight:"bold",size:"md",textAlign:a,wordBreak:"break-word",children:`Author: ${e}`})]})]})},Jt=y.styled($).attrs(({...e})=>({display:"inline-block",position:"relative",...e}))`
|
|
757
757
|
& img {
|
|
758
758
|
display: block;
|
|
759
759
|
}
|
|
@@ -768,7 +768,7 @@
|
|
|
768
768
|
pointer-events: none;
|
|
769
769
|
${({$opacity:e=0})=>`background-color: rgba(0, 0, 0, ${e});`}
|
|
770
770
|
}
|
|
771
|
-
`,
|
|
771
|
+
`,io=e=>{if(f._.isNil(e))return"";const n=e.split(".");return(n.length>1?f._.last(n):"").toLowerCase()},ro=(e,n)=>f._.isUndefined(n)?!1:f._.includes(e,io(n)),zn=({alt:e,fileType:n,width:i="100%",opacity:r=0,src:o,height:s="auto"})=>n==="video"||ro(["webm"],o)?t.jsx(Jt,{$opacity:r,children:t.jsx(le,{href:o,iconPosition:"hidden",children:t.jsxs("video",{controls:!0,muted:!0,style:{height:s,width:i},children:[t.jsx("source",{src:o,type:"video/webm"}),o]})})}):t.jsx(Jt,{$opacity:r,children:t.jsx("img",{alt:e,src:o,style:{height:s,width:i}})}),oo=({alt:e,authorEmail:n,date:i,description:r,src:o,children:s,isEditing:l,onClick:a,title:c,hideDescription:p=!1,headerType:d="image",showMaximize:g=!0})=>{const x=y.useTheme(),[h,b]=u.useState(!1),m=u.useCallback(()=>{b(!0)},[]),j=u.useCallback(()=>{b(!1)},[]);return t.jsxs($,{bgColor:"transparent",border:"1px solid transparent",borderColorHover:"black",borderRadius:x.spacing[.25],display:"flex",flexDirection:"column",gap:1,onHover:m,onLeave:j,padding:[.5,.5,.5,.5],width:"100%",children:[t.jsx($,{bgColor:x.palette.black,borderRadius:x.spacing[.25],cursor:l?"unset":"pointer",display:"inline-flex",justify:"center",onClick:a,position:"relative",width:"100%",children:s===void 0?t.jsxs(et.default.Fragment,{children:[t.jsx(zn,{alt:e,fileType:d,height:"147px",opacity:h?.3:0,src:o,width:"100%"}),g?t.jsx($,{bottom:"10px",position:"absolute",right:"10px",children:t.jsx(V,{color:"white",icon:"arrows-maximize",iconSize:"sm",iconType:"fa-light",variant:"secondary"})}):void 0]}):s}),p?null:t.jsx(nt,{authorEmail:n,date:i,description:r,descriptionColor:x.palette.gray[600],id:`${e}-card-header`,title:c})]})},so=y.styled.div`
|
|
772
772
|
${({theme:e,$align:n="center",$minWidth:i="auto",$minHeight:r="auto"})=>`
|
|
773
773
|
display: flex;
|
|
774
774
|
background-color: ${e.palette.white};
|
|
@@ -787,7 +787,7 @@
|
|
|
787
787
|
text-align: ${n};
|
|
788
788
|
}
|
|
789
789
|
`}
|
|
790
|
-
`,Tt=({htmlFor:e,label:n,link:i,required:r,tooltip:o,weight:
|
|
790
|
+
`,Tt=({htmlFor:e,label:n,link:i,required:r,tooltip:o,weight:s="normal"})=>{const l=y.useTheme(),a=`${e}-tooltip`,c=o!==void 0&&!f.lodashExports.isEmpty(o);return t.jsxs("label",{className:"flex gap-1 w-full",htmlFor:e,style:{fontFamily:l.typography.type.primary,fontWeight:l.typography.weight[s]},children:[n,r&&t.jsx(R,{icon:"asterisk",iconColor:l.palette.error[500],iconSize:"xs",spanClass:"required-icon"}),c?t.jsx(Z,{display:"inline-flex",icon:"circle-info",id:a,place:"top",tip:o}):null,i?t.jsx(le,{href:i,target:"_blank"}):null]})},ao=y.styled.div`
|
|
791
791
|
${({theme:e})=>`
|
|
792
792
|
align-items: flex-start;
|
|
793
793
|
display: inline-flex;
|
|
@@ -834,7 +834,7 @@
|
|
|
834
834
|
line-height: ${e.spacing[1.25]};
|
|
835
835
|
}
|
|
836
836
|
`}
|
|
837
|
-
`,ie=
|
|
837
|
+
`,ie=y.styled.div`
|
|
838
838
|
${({theme:e,$overflowX:n,$variant:i})=>`
|
|
839
839
|
align-items: center;
|
|
840
840
|
display: flex;
|
|
@@ -969,7 +969,7 @@
|
|
|
969
969
|
border: 1px solid ${e.palette.gray[600]};
|
|
970
970
|
}
|
|
971
971
|
`}
|
|
972
|
-
`,
|
|
972
|
+
`,lo=y.styled.div`
|
|
973
973
|
height: 1px;
|
|
974
974
|
background-color: ${({theme:e})=>e.palette.gray[300]};
|
|
975
975
|
flex-shrink: 0;
|
|
@@ -983,7 +983,7 @@
|
|
|
983
983
|
${ie}:focus-within:not(.disabled, .error) & {
|
|
984
984
|
border: 1px solid ${({theme:e})=>e.palette.black};
|
|
985
985
|
}
|
|
986
|
-
`,
|
|
986
|
+
`,co=y.styled.div`
|
|
987
987
|
${({theme:e,$show:n})=>`
|
|
988
988
|
align-items: center;
|
|
989
989
|
align-self: stretch;
|
|
@@ -996,7 +996,7 @@
|
|
|
996
996
|
line-height: 18px;
|
|
997
997
|
text-align: left;
|
|
998
998
|
`}
|
|
999
|
-
`,J=({children:e,disabled:n,id:i,error:r,helpLink:o,helpLinkText:
|
|
999
|
+
`,J=({children:e,disabled:n,id:i,error:r,helpLink:o,helpLinkText:s="Link here",helpText:l,htmlFor:a,label:c,linkPosition:p="down",maxLength:d,required:g,tooltip:x,value:h,weight:b})=>{const m=y.useTheme(),j=h?h.length:0;return t.jsxs(ao,{id:i,children:[c===void 0?void 0:t.jsx(Tt,{htmlFor:a,label:c,link:p==="up"?o:void 0,required:g,tooltip:x,weight:b}),e,r||d?t.jsxs($,{display:"flex",justify:r===void 0?"end":"space-between",width:"100%",children:[r&&t.jsx(I,{className:"error-msg",color:m.palette.error[500],display:"block",size:"md",children:r}),d&&t.jsx(q,{priority:"low",tagLabel:`${j}/${d}`,variant:n?"inactive":"error"})]}):void 0,l||o?t.jsxs($,{alignItems:"center",display:"flex",gap:.25,width:"100%",children:[l&&t.jsxs(t.Fragment,{children:[t.jsx(R,{icon:"circle-info",iconColor:m.palette.gray[400],iconSize:"sm",iconType:"fa-light"}),t.jsx(I,{color:m.palette.gray[400],display:"inline-block",size:"md",children:l})]}),o&&p==="down"?t.jsx(le,{href:o,children:s}):void 0]}):void 0]})},$e=({className:e,children:n,isFilter:i=!1,popoverRef:r,state:o,triggerRef:s,...l})=>{var x;const a=y.useTheme(),c=u.useRef(null),p=(x=s==null?void 0:s.current)==null?void 0:x.getBoundingClientRect(),{popoverProps:d}=f.$f2f8a6077418541e$export$542a6fd13ac93354({...l,popoverRef:r??c,triggerRef:s,isNonModal:r?!0:void 0,shouldFlip:e==="dropdown"},o),g=u.useCallback(h=>{h.preventDefault()},[]);return t.jsx(f.$337b884510726a0d$export$c6fdb837b070b4ff,{children:t.jsx("div",{...d,className:e,id:"popover",onPointerDown:i?g:void 0,ref:r??c,style:{...d.style,maxHeight:300,overflowY:"auto",scrollbarColor:`${a.palette.gray[600]} ${a.palette.gray[100]}`,scrollPadding:a.spacing[.5],...e==="dropdown"?{display:"flex",justifyContent:"center",width:p==null?void 0:p.width}:{}},children:n})})},Qt=y.styled.ul`
|
|
1000
1000
|
${({theme:e,$multiSelection:n,$width:i})=>`
|
|
1001
1001
|
align-self: center;
|
|
1002
1002
|
background: ${e.palette.white};
|
|
@@ -1016,7 +1016,7 @@
|
|
|
1016
1016
|
border-bottom: ${n?`1px solid ${e.palette.gray[200]}`:"unset"};
|
|
1017
1017
|
}
|
|
1018
1018
|
`}
|
|
1019
|
-
`,
|
|
1019
|
+
`,po=y.styled.li`
|
|
1020
1020
|
${({theme:e,$multiSelection:n})=>`
|
|
1021
1021
|
align-items: center;
|
|
1022
1022
|
color: ${e.palette.gray[800]};
|
|
@@ -1059,7 +1059,7 @@
|
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
1061
|
`}
|
|
1062
|
-
`,
|
|
1062
|
+
`,go=y.styled.li`
|
|
1063
1063
|
${({theme:e})=>`
|
|
1064
1064
|
align-items: center;
|
|
1065
1065
|
color: ${e.palette.gray[400]};
|
|
@@ -1070,7 +1070,7 @@
|
|
|
1070
1070
|
padding: ${e.spacing[.25]} ${e.spacing[1]};
|
|
1071
1071
|
size: 28;
|
|
1072
1072
|
`}
|
|
1073
|
-
`,
|
|
1073
|
+
`,uo=y.styled.label`
|
|
1074
1074
|
${({theme:e})=>`
|
|
1075
1075
|
align-items: center;
|
|
1076
1076
|
color: ${e.palette.gray[600]};
|
|
@@ -1142,7 +1142,7 @@
|
|
|
1142
1142
|
fill: ${e.palette.white};
|
|
1143
1143
|
}
|
|
1144
1144
|
`}
|
|
1145
|
-
`,pe=u.forwardRef(function({checked:n,disabled:i=!1,label:r,name:o,onChange:
|
|
1145
|
+
`,pe=u.forwardRef(function({checked:n,disabled:i=!1,label:r,name:o,onChange:s,onClick:l,onFocus:a,onKeyDown:c,tooltip:p,value:d,...g},x){return t.jsxs("div",{className:"gap-1 inline-flex items-start parent-checkbox",children:[t.jsxs(uo,{"aria-disabled":i,children:[t.jsx("input",{"aria-checked":n,"aria-disabled":i,"aria-hidden":!1,"aria-label":o,checked:n,"data-testid":typeof r=="string"?r??d:d,disabled:i,id:o,name:o,onChange:s,onClick:l,onFocus:a,onKeyDown:c,ref:x,type:"checkbox",value:d,...g}),t.jsx(R,{disabled:i,icon:"check",iconSize:"xl"}),r??d]}),p===void 0?void 0:t.jsx(Z,{icon:"circle-info",id:p,place:"right",tip:p})]})}),Tn=({item:e,multiSelection:n,name:i,register:r,setInputValue:o,setValue:s,state:l,watch:a})=>{var T,N,E;const c=y.useTheme(),p=u.useRef(null),d=e.props.hrefLang,g=l.disabledKeys,x=Array.from(l.collection.getKeys()).filter(D=>!Array.from(g).includes(D)&&D!=="All"),{optionProps:h,isSelected:b,isFocused:m,isDisabled:j}=f.$293f70390ea03370$export$497855f14858aa34({key:e.key},l,p),w=[b?"selected":"",m?"focused":"",j?"disabled":""].join(" "),C=u.useCallback(D=>{o(""),s==null||s(`${i}Options`,""),D.currentTarget.checked&&(o(D.currentTarget.value),s==null||s(`${i}Options`,x))},[x,i,o,s]),k=u.useCallback(()=>{const D=a==null?void 0:a(`${i}Options`),F=typeof D=="string"?[D]:D;f.isEqual(x,F)&&!Array.from(g).includes("All")?(s==null||s("checkAll","All vulnerability types"),o("All vulnerability types")):(s==null||s("checkAll",""),o((F==null?void 0:F.length)<=2?F.join(", "):`${F.slice(0,2).join(", ")+`, +${F.length-2} more`}`))},[g,x,i,o,s,a]),v=e.key==="All"?t.jsx(pe,{...r==null?void 0:r("checkAll",{onChange:C}),label:(T=e.rendered)==null?void 0:T.toString(),name:"checkAll",value:(N=e.rendered)==null?void 0:N.toString()}):t.jsx(pe,{...r==null?void 0:r(`${i}Options`,{onChange:k}),label:(E=e.rendered)==null?void 0:E.toString(),name:`${i}Options`,value:e.key.toString()}),z=n&&!j?v:t.jsx(I,{color:c.palette.gray[800],size:"md",textOverflow:"ellipsis",whiteSpace:"nowrap",children:e.rendered}),S=u.useCallback(D=>{var F;D.preventDefault(),o(((F=e.rendered)==null?void 0:F.toString())??""),l.setSelectedKey(e.key),setTimeout(()=>{l.setOpen(!1)},50),Sn(d)},[d,e.key,e.rendered,l,o]);return re(document.getElementsByClassName("dropdown")[0],()=>{n&&l.close()},!0,[document.getElementById("combobox")]),t.jsxs(po,{...!n&&!d?h:{},$multiSelection:n,className:w,ref:p,children:[d?t.jsx(le,{href:d,onClick:S,children:z}):z,b&&!j&&!n?t.jsx(R,{icon:"check",iconSize:"sm",iconType:"fa-light"}):void 0,e.rendered===e.textValue?void 0:t.jsx(q,{tagLabel:e.textValue,variant:"inactive"})]})},ut=({field:e,disabled:n=!1,disabledKeys:i,error:r,helpLink:o,helpLinkText:s,helpText:l,label:a,loadingItems:c,name:p,multiSelection:d=!1,items:g,onBlur:x,onChange:h,onClear:b,placeholder:m,clearable:j=!1,emptyMessage:w,register:C,required:k,setValue:v,tooltip:z,value:S,watch:T,weight:N})=>{var Yt,Xt;const E=y.useTheme(),D=n?void 0:r,F=(e==null?void 0:e.value)??S,[P,W]=u.useState(((Yt=g.find(O=>O.value===F))==null?void 0:Yt.name)??""),[H,B]=u.useState(F),[M,U]=u.useState(g),[ue,ee]=u.useState(!1),{contains:Y}=f.$bb77f239b46e8c72$export$3274cf84b703fff({sensitivity:"base"}),he=u.useRef(null),ve=u.useRef(null),ke=u.useRef(null),Ce=u.useRef(null),Ue=u.useRef(null),Ui=u.useMemo(()=>g.toSorted((O,K)=>{const Q=Array.from(i??[]),Se=Q.includes(O.value),Kt=Q.includes(K.value);return Se&&!Kt?1:!Se&&Kt?-1:0}).map(O=>Y(O.name,P)||ue?t.jsx(f.$c1d7fb2ec91bae71$export$6d08773d2e66f8f2,{"aria-label":O.value,hrefLang:O.href,textValue:O.tag,children:O.name},O.value):null),[Y,i,P,g,ue]),Gi=u.useCallback(O=>{const K=O.split(/,|\s/u).slice(-1)[0].trim();W(d?K:O),O===""||O.endsWith(",")?ee(!0):(ee(!1),B(Q=>{const Se=O===""?"":Q;return e&&e.onChange(Se),h&&h(O),Se}),U(g.filter(Q=>Y(Q.name,d?K:O))))},[Y,g,e,d,h]),Yi=u.useCallback(O=>{var K;W(((K=g.find(Q=>Q.value===O))==null?void 0:K.name)??""),B(O?String(O):""),e&&e.onChange(O),h&&h(O?String(O):""),U(g)},[g,e,h]),_t=u.useCallback(O=>{O.key==="Enter"&&O.preventDefault(),ee(!1)},[]),Xi=u.useCallback(()=>{x&&x(),e&&e.onBlur()},[e,x]),Ki=u.useCallback(()=>{ee(!0)},[]),X=f.$a9e7382a7d111cb5$export$b453a3bfd4a5fa9e({allowsCustomValue:d,allowsEmptyCollection:!0,disabledKeys:i,inputValue:P,items:M,menuTrigger:"focus",shouldCloseOnBlur:!d,selectedKey:H,onBlur:Xi,onInputChange:Gi,onKeyDown:_t,onKeyUp:Ki,onOpenChange(O,K){ee(O&&(K==="manual"||K==="focus")),O&&setTimeout(()=>{var Q;return(Q=he.current)==null?void 0:Q.focus()},50)},onSelectionChange:d?void 0:Yi,children:Ui}),Zi=u.useCallback(()=>{W(""),B(null),U(g),X.setSelectedKey(null),X.setInputValue(""),h&&h(""),b==null||b()},[g,b,X,h]),{buttonProps:qi,inputProps:Ji,listBoxProps:Qi}=f.$c350ade66beef0af$export$8c18d1b4f7232bbf({inputValue:P,buttonRef:ve,id:p,inputRef:he,label:a??p,listBoxRef:ke,name:p,placeholder:m,popoverRef:Ue},X),{listBoxProps:Ht}=f.$c132121280ec012d$export$50eacbbf140a3141(Qi,X,ke),{buttonProps:er}=f.$701a24aa0da5b062$export$ea18c227d4417cc3(qi,ve),{width:Vt}=((Xt=Ce.current)==null?void 0:Xt.getBoundingClientRect())??{width:240};re(Ce.current,()=>{X.isOpen&&!d&&X.close()},!0,[Ue.current]),u.useEffect(()=>{var O;if((c===!1||!F)&&!d){const K=((O=g.find(Q=>Q.value===F))==null?void 0:O.name)??"";W(K),B(K)}},[F,g,c,d]);const Ut=Array.from(X.collection),Gt=f.useVirtualizer({count:Ut.length,estimateSize:()=>28,getScrollElement:()=>ke.current});return t.jsxs(J,{error:D,helpLink:o,helpLinkText:s,helpText:l,htmlFor:p,id:"combobox",label:a,required:k,tooltip:z,weight:N,children:[t.jsxs(ie,{className:`${n?"disabled":""} ${D?"error":""}`,ref:Ce,children:[t.jsx("input",{...Ji,"aria-invalid":D?"true":"false","aria-label":p,disabled:n,onKeyDown:_t,ref:he}),D?t.jsx(R,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:E.palette.error[500],iconSize:"lg"}):void 0,j&&H&&!n?t.jsx(V,{icon:"xmark",iconColor:E.palette.gray[400],iconSize:"sm",iconType:"fa-light",onClick:Zi,px:.125,py:.125,type:"reset",variant:"ghost"}):void 0,t.jsx(V,{...er,className:"action",disabled:n,icon:X.isOpen&&!n?"chevron-up":"chevron-down",iconColor:E.palette.gray[400],iconSize:"sm",iconType:"fa-light",px:.125,py:.125,ref:ve,type:"button",variant:"ghost"})]}),X.isOpen&&X.collection.size>0&&!n?t.jsx($e,{className:"dropdown",offset:4,placement:"bottom start",popoverRef:Ue,state:X,triggerRef:Ce,children:t.jsx(Qt,{...Ht,$multiSelection:d&&!Array.from(i??[]).includes("All"),$width:Vt,ref:ke,children:t.jsx("div",{style:{height:`${Gt.getTotalSize()}px`,position:"relative"},children:Gt.getVirtualItems().map(O=>{const K=Ut[O.index];return t.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:`${O.size}px`,transform:`translateY(${O.start}px)`},children:t.jsx(Tn,{item:K,multiSelection:d,name:p,register:C,setInputValue:W,setValue:v,state:X,watch:T})},O.index)})})})}):g.length>0||!X.isOpen||n||!w?null:t.jsx($e,{className:"dropdown",offset:4,placement:"bottom start",popoverRef:Ue,state:X,triggerRef:Ce,children:t.jsx(Qt,{...Ht,$multiSelection:!1,$width:Vt,ref:ke,children:t.jsx(go,{children:t.jsx(I,{color:E.palette.gray[400],size:"md",textOverflow:"auto",whiteSpace:"wrap",children:w})})})})]})},It=({control:e,disabled:n=!1,disabledKeys:i,error:r,helpLink:o,helpLinkText:s,helpText:l,label:a,loadingItems:c,name:p,multiSelection:d,items:g,onBlur:x,onChange:h,onClear:b,placeholder:m,clearable:j=!1,emptyMessage:w,register:C,required:k,setValue:v,tooltip:z,value:S,watch:T,weight:N})=>e?t.jsx(f.Controller,{control:e,name:p,render:({field:E,fieldState:D})=>{var F;return t.jsx(ut,{clearable:j,disabled:n,disabledKeys:i,emptyMessage:w,error:(F=D.error)==null?void 0:F.message,field:E,helpLink:o,helpLinkText:s,helpText:l,items:g,label:a,loadingItems:c,multiSelection:d,name:p,onBlur:x,onChange:h,onClear:b,placeholder:m,register:C,required:k,setValue:v,tooltip:z,value:S,watch:T,weight:N})},rules:{required:k}}):t.jsx(ut,{clearable:j,disabled:n,disabledKeys:i,emptyMessage:w,error:r,helpLink:o,helpLinkText:s,helpText:l,items:g,label:a,loadingItems:c,multiSelection:d,name:p,onBlur:x,onChange:h,onClear:b,placeholder:m,required:k,tooltip:z,value:S,weight:N}),xo=y.styled.div`
|
|
1146
1146
|
${({theme:e})=>`
|
|
1147
1147
|
align-items: center;
|
|
1148
1148
|
color: ${e.palette.gray[800]};
|
|
@@ -1163,7 +1163,7 @@
|
|
|
1163
1163
|
display: none;
|
|
1164
1164
|
}
|
|
1165
1165
|
`}
|
|
1166
|
-
`,
|
|
1166
|
+
`,ho=y.styled.div.attrs({className:"year-selection"})`
|
|
1167
1167
|
align-items: flex-start;
|
|
1168
1168
|
display: flex;
|
|
1169
1169
|
flex-direction: column;
|
|
@@ -1174,12 +1174,12 @@
|
|
|
1174
1174
|
padding: 0 0.5px;
|
|
1175
1175
|
position: relative;
|
|
1176
1176
|
width: 8px;
|
|
1177
|
-
`,en=
|
|
1177
|
+
`,en=y.styled.tr`
|
|
1178
1178
|
align-items: flex-start;
|
|
1179
1179
|
display: flex;
|
|
1180
1180
|
padding: ${({theme:e})=>e.spacing[.25]} 0;
|
|
1181
1181
|
width: 100%;
|
|
1182
|
-
`,In=
|
|
1182
|
+
`,In=y.css`
|
|
1183
1183
|
${({theme:e})=>`
|
|
1184
1184
|
align-items: center;
|
|
1185
1185
|
color: ${e.palette.gray[800]};
|
|
@@ -1195,9 +1195,9 @@
|
|
|
1195
1195
|
text-align: center;
|
|
1196
1196
|
width: ${e.spacing[2.5]};
|
|
1197
1197
|
`}
|
|
1198
|
-
`,
|
|
1198
|
+
`,fo=y.styled.th`
|
|
1199
1199
|
${In}
|
|
1200
|
-
`,
|
|
1200
|
+
`,yo=y.styled.td`
|
|
1201
1201
|
${({theme:e})=>`
|
|
1202
1202
|
${In}
|
|
1203
1203
|
height: ${e.spacing[2.5]};
|
|
@@ -1247,14 +1247,14 @@
|
|
|
1247
1247
|
}
|
|
1248
1248
|
}
|
|
1249
1249
|
`}
|
|
1250
|
-
`,
|
|
1250
|
+
`,bo=y.styled.div.attrs({className:"dot"})`
|
|
1251
1251
|
position: absolute;
|
|
1252
1252
|
top: 48%;
|
|
1253
1253
|
|
|
1254
1254
|
> span {
|
|
1255
1255
|
font-size: 4px;
|
|
1256
1256
|
}
|
|
1257
|
-
`,tn=
|
|
1257
|
+
`,tn=y.styled.button`
|
|
1258
1258
|
cursor: pointer;
|
|
1259
1259
|
display: flex;
|
|
1260
1260
|
|
|
@@ -1262,7 +1262,7 @@
|
|
|
1262
1262
|
height: 3.5px;
|
|
1263
1263
|
width: 7px;
|
|
1264
1264
|
}
|
|
1265
|
-
`,Dt=
|
|
1265
|
+
`,Dt=y.styled.div`
|
|
1266
1266
|
${({theme:e})=>`
|
|
1267
1267
|
align-items: end;
|
|
1268
1268
|
border-top: 1px solid ${e.palette.gray[200]};
|
|
@@ -1274,9 +1274,9 @@
|
|
|
1274
1274
|
padding: 0 ${e.spacing[.25]};
|
|
1275
1275
|
width: 100%;
|
|
1276
1276
|
`}
|
|
1277
|
-
`,Dn=({state:e,date:n})=>{const i=u.useRef(null),r=
|
|
1278
|
-
${
|
|
1279
|
-
${!e.isFocused&&!r?"focused":""} ${g}`,ref:i,children:[c,r?t.jsx(
|
|
1277
|
+
`,Dn=({state:e,date:n})=>{const i=u.useRef(null),r=f.$14e0f24ef4ac5c92$export$629b0a497aa65267(n,f.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()),{cellProps:o,buttonProps:s,isSelected:l,isDisabled:a,formattedDate:c}=f.$36a0ac60f04457c5$export$136073280381448e({date:n},e,i),p="highlightedRange"in e&&!f.lodashExports.isNull(e.highlightedRange)?f.$14e0f24ef4ac5c92$export$ea39ec197993aef0(n,e.highlightedRange.start):l,d="highlightedRange"in e&&!f.lodashExports.isNull(e.highlightedRange)?f.$14e0f24ef4ac5c92$export$ea39ec197993aef0(n,e.highlightedRange.end):l,g=l&&!a&&!(p||d)?"range":"";return t.jsx(yo,{id:g,...o,children:t.jsxs("div",{...s,className:`cell ${p||d?"selected":""}
|
|
1278
|
+
${a?"disabled":""} ${r?"today":""}
|
|
1279
|
+
${!e.isFocused&&!r?"focused":""} ${g}`,ref:i,children:[c,r?t.jsx(bo,{children:t.jsx(R,{clickable:!1,icon:"circle",iconSize:"sm"})}):void 0]})})},it=({state:e,...n})=>{const{locale:i}=f.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),{weekDays:r}=f.$e3031d1f8c9d64eb$export$cb95147730a423f5(n,e),o=f.$14e0f24ef4ac5c92$export$ccc1b2479e7dd654(e.visibleRange.start,i);return t.jsxs("table",{children:[t.jsx("thead",{children:t.jsx(en,{children:r.map((s,l)=>{const a=`key_${l}`;return t.jsx(fo,{children:s},a)})})}),t.jsx("tbody",{children:[...new Array(o).keys()].map(s=>t.jsx(en,{children:e.getDatesInWeek(s).map((l,a)=>{const c=`key_${a}`;return l?t.jsx(Dn,{date:l,state:e},c):t.jsx("td",{},c)})},s))})]})},$o=y.styled(jt)`
|
|
1280
1280
|
align-items: center;
|
|
1281
1281
|
background-color: inherit;
|
|
1282
1282
|
border-color: inherit;
|
|
@@ -1284,7 +1284,7 @@
|
|
|
1284
1284
|
height: 38px;
|
|
1285
1285
|
justify-content: center;
|
|
1286
1286
|
width: 40px;
|
|
1287
|
-
margin: ${({$margin:e="0"})=>
|
|
1287
|
+
margin: ${({$margin:e="0"})=>y.css`
|
|
1288
1288
|
${e}
|
|
1289
1289
|
`};
|
|
1290
1290
|
|
|
@@ -1296,7 +1296,7 @@
|
|
|
1296
1296
|
background-color: ${({theme:e})=>e.palette.gray[100]};
|
|
1297
1297
|
cursor: pointer;
|
|
1298
1298
|
}
|
|
1299
|
-
`,
|
|
1299
|
+
`,mo=y.styled.div`
|
|
1300
1300
|
${({theme:e})=>`
|
|
1301
1301
|
align-items: flex-start;
|
|
1302
1302
|
background: ${e.palette.white};
|
|
@@ -1310,7 +1310,7 @@
|
|
|
1310
1310
|
padding: ${e.spacing[.25]};
|
|
1311
1311
|
width: 292px;
|
|
1312
1312
|
`}
|
|
1313
|
-
|
|
1313
|
+
`,jo=y.styled.button`
|
|
1314
1314
|
${({theme:e,$disabled:n,$focus:i,$header:r})=>{const o=i?"34px":"40px";return`
|
|
1315
1315
|
align-items: center;
|
|
1316
1316
|
border-radius: ${r?`0 ${e.spacing[.5]} ${e.spacing[.5]} 0`:"4px"};
|
|
@@ -1325,7 +1325,7 @@
|
|
|
1325
1325
|
background-color: ${e.palette.gray[n?500:100]};
|
|
1326
1326
|
}
|
|
1327
1327
|
`}}
|
|
1328
|
-
`,
|
|
1328
|
+
`,wo=y.styled.div`
|
|
1329
1329
|
${({theme:e})=>`
|
|
1330
1330
|
align-items: center;
|
|
1331
1331
|
background: transparent;
|
|
@@ -1336,13 +1336,13 @@
|
|
|
1336
1336
|
justify-content: space-between;
|
|
1337
1337
|
width: calc(100% - 40px);
|
|
1338
1338
|
`}
|
|
1339
|
-
`,
|
|
1339
|
+
`,vo=y.styled.div`
|
|
1340
1340
|
align-items: center;
|
|
1341
1341
|
display: flex;
|
|
1342
1342
|
justify-content: flex-end;
|
|
1343
1343
|
gap: ${({theme:e})=>e.spacing[.5]};
|
|
1344
1344
|
flex: 1 0 0;
|
|
1345
|
-
`,nn=
|
|
1345
|
+
`,nn=y.styled.div`
|
|
1346
1346
|
${({theme:e})=>`
|
|
1347
1347
|
align-items: center;
|
|
1348
1348
|
align-self: stretch;
|
|
@@ -1354,7 +1354,7 @@
|
|
|
1354
1354
|
line-height: ${e.spacing[1.5]};
|
|
1355
1355
|
padding: 2px ${e.spacing[.25]};
|
|
1356
1356
|
`}
|
|
1357
|
-
`,rn=
|
|
1357
|
+
`,rn=y.styled.button`
|
|
1358
1358
|
${({theme:e})=>`
|
|
1359
1359
|
align-items: center;
|
|
1360
1360
|
background-color: inherit;
|
|
@@ -1374,7 +1374,7 @@
|
|
|
1374
1374
|
font-weight: ${e.typography.weight.bold};
|
|
1375
1375
|
}
|
|
1376
1376
|
`}
|
|
1377
|
-
`,
|
|
1377
|
+
`,qe=({disabled:e=!1,icon:n,props:i})=>{const r=u.useRef(null),{buttonProps:o}=f.$701a24aa0da5b062$export$ea18c227d4417cc3(i,r);return t.jsx(jo,{...o,$disabled:e,$focus:!!o["aria-expanded"],$header:n==="calendar"||n==="calendar-clock",disabled:e,ref:r,type:"button",children:t.jsx(R,{icon:n,iconColor:A.palette.gray[e?400:700],iconSize:"lg",iconType:"fa-light"})})},rt=({state:e,prevButtonProps:n,nextButtonProps:i,title:r})=>{const o=e.focusedDate,s=y.useTheme(),l=u.useCallback(()=>{e.setFocusedDate(o.add({years:1}))},[o,e]),a=u.useCallback(()=>{e.setFocusedDate(o.subtract({years:1}))},[o,e]);return t.jsxs("div",{className:"header flex items-start",style:{position:"sticky",top:0,zIndex:2,background:s.palette.white},children:[t.jsx(qe,{icon:"chevron-left",props:n}),t.jsxs(xo,{children:[r,t.jsxs(ho,{children:[t.jsx(tn,{"aria-label":"top",onClick:l,children:t.jsx(R,{icon:"caret-up",iconClass:"fa-sharp",iconSize:"xs"})}),t.jsx(tn,{"aria-label":"bottom",onClick:a,children:t.jsx(R,{icon:"caret-down",iconClass:"fa-sharp",iconSize:"xs"})})]})]}),t.jsx(qe,{icon:"chevron-right",props:i})]})},En=({onClose:e,props:n})=>{const{locale:i}=f.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),r=f.$131cf43a05231e1e$export$6d095e787d2b5e1f({...n,createCalendar:f.$64244302c3013299$export$dd0bbc9b26defe37,locale:i}),{prevButtonProps:o,nextButtonProps:s,title:l}=f.$9942cad8a072a530$export$3ee915f8151bd4f1(n,r);return t.jsxs("div",{className:"calendar",children:[t.jsx(rt,{nextButtonProps:s,prevButtonProps:o,state:r,title:l}),t.jsx(it,{state:r}),t.jsx(Dt,{children:t.jsx(_,{onClick:e,variant:"ghost",children:"Cancel"})})]})},Fn=({segment:e,state:n})=>{const i=y.useTheme(),r=u.useRef(null),s={...e,placeholder:{day:"dd",dayPeriod:"(AM/PM)",era:"",hour:"hh",literal:"",minute:"mm",month:"mm",second:"",timeZoneName:"",year:"yyyy"}[e.type]},{segmentProps:l}=f.$32489daedd52963e$export$1315d136e6f7581(s,n,r),a=i.palette.gray[s.isEditable?800:500];return t.jsx("div",{...s.type!=="literal"&&{...l,className:"segment-cell"},ref:r,style:s.type==="literal"?void 0:{color:s.isPlaceholder?i.palette.gray[400]:a},children:s.isPlaceholder?s.placeholder:s.text})},Rn=({disabled:e,error:n=!1,props:i})=>{const r=y.useTheme(),o=u.useRef(null),s=f.$3c0fc76039f1c516$export$60e84778edff6d26({...i,createCalendar:f.$64244302c3013299$export$dd0bbc9b26defe37,locale:"en-US"}),{fieldProps:l}=f.$16f0b7bb276bc17e$export$5591b0b878c1a989(i,s,o),a=u.useCallback(c=>{const p=document.getElementsByClassName("segment-cell"),d=c.currentTarget;Object.values(p).some(g=>g.contains(d))||(c.preventDefault(),c.stopPropagation())},[]);return t.jsxs(wo,{...l,onClick:a,children:[t.jsx("div",{className:"flex flex-row",style:{color:r.palette.gray[f.lodashExports.isNil(s.value)?400:800]},tabIndex:-1,children:s.segments.map((c,p)=>{const d=`key_${p}`;return t.jsx(Fn,{segment:{...c,isEditable:!e},state:s},d)})}),n?t.jsx(R,{icon:"exclamation-circle",iconColor:r.palette.error[500],iconSize:"lg"}):void 0]})},Nn=e=>{const n=u.useRef(null),i=f.$eff5d8ee529ac4bb$export$fd53cef0cc796101({...e,locale:"en-US",shouldForceLeadingZeros:!0}),{timeValue:r}=i,o=!f.lodashExports.isNil(r)&&r.hour<12?"AM":"PM",[s,l]=u.useState(f.lodashExports.isNil(r)?"AM":o),{fieldProps:a}=f.$16f0b7bb276bc17e$export$4c842f6a241dc825(e,i,n),c=u.useCallback(p=>{const d=p.currentTarget.name;d!==s&&(f.lodashExports.isNil(r)||(d==="AM"?i.setSegment("dayPeriod",0):d==="PM"&&i.setSegment("dayPeriod",12))),l(d)},[s,i,r]);return t.jsxs(vo,{children:[t.jsx(nn,{...a,ref:n,children:i.segments.slice(0,-2).map((p,d)=>{const g=`key_${d}`;return t.jsx(Fn,{segment:p,state:i},g)})}),t.jsxs(nn,{children:[t.jsx(rn,{id:s==="AM"?"active":"",name:"AM",onClick:c,type:"button",children:"AM"}),t.jsx(rn,{id:s==="PM"?"active":"",name:"PM",onClick:c,type:"button",children:"PM"})]})]})},Je=e=>e&&e!=="-"?f.dayjs(e).format("YYYY-MM-DD"):"-",ko=e=>e&&e!=="-"?f.dayjs(e).format("YYYY-MM-DD hh:mm A"):"-",on=(e,n)=>f.dayjs(String(e).replace(/-/gu,"/")).hour(n.hour).minute(n.minute).second(n.second).format("YYYY/MM/DD hh:mm A"),Qe=(e,n="day")=>{const i=n==="day"?f.$fae977aafc393c5c$export$6b862160d295c8e:f.$fae977aafc393c5c$export$588937bcd60ade55,r=n==="day"?f.dayjs(e).isValid():f.dayjs(e,"YYYY/MM/DD hh:mm A").isValid();return!f._.isNil(e)&&!f._.isEmpty(e)&&e!=="-"&&r?i(n==="day"?e.trim().replace(/\//gu,"-"):f.dayjs(e).format("YYYY-MM-DDTHH:mm:ss")):null},Co=(e,n)=>{const i=!f._.isNil(e)&&/\d+/u.test(e??""),r=f._.isNil(n)?void 0:f._.toNumber(n);return i?f._.toNumber(e):r},Ee=({error:e,buttonProps:n,datePickerRef:i,disabled:r=!1,granularity:o="day",fieldProps:s,groupProps:l,name:a,onChange:c,register:p,required:d,setValue:g,value:x})=>{const h=Qe(x,o),b=u.useCallback(j=>{if(s.onChange&&s.onChange(j),j!=null&&j.year&&String(j.year).length>=4){const w=o==="day"?Je(String(j)):ko(String(j));g&&g(a,w,{shouldDirty:!0}),c&&c(w)}},[s,o,a,g,c]),m=u.useCallback(j=>{c==null||c(j.currentTarget.value)},[c]);return t.jsxs(ie,{...l,className:`${r?"disabled":""} ${e?"error":""}`,ref:i,children:[t.jsx(Rn,{disabled:r,error:e!=null,props:{...s,autoFocus:!1,granularity:o,onChange:b,shouldForceLeadingZeros:!0,...h&&!g?{value:h}:{}}}),t.jsx(qe,{disabled:r,icon:o==="minute"?"calendar-clock":"calendar",props:n}),t.jsx("input",{...p==null?void 0:p(a,{required:d}),...c?{onChange:m}:{},"aria-label":a,className:"date-input",disabled:r,id:a,name:a,type:"text",value:(x==null?void 0:x.trim())??""})]})},ot=({children:e,...n})=>{const i=u.useRef(null),{dialogProps:r}=f.$40df3f8667284809$export$d55e7ee900f34e93(n,i);return t.jsx(mo,{...r,ref:i,children:e})},An=({disabled:e=!1,error:n,helpLink:i,helpLinkText:r,helpText:o,required:s,label:l,name:a,register:c,setValue:p,tooltip:d,watch:g,...x})=>{const h=u.useRef(null),b=g==null?void 0:g(a),m=Qe(b),j=u.useCallback(N=>{p&&N&&p(a,Je(String(N)),{shouldDirty:!0})},[a,p]),w=f.$ab5bf3f618090389$export$87194bb378cc3ac2({...x,onChange(N){j(N)},...m?{defaultValue:m}:{}}),{close:C}=w,{groupProps:k,fieldProps:v,buttonProps:z,dialogProps:S,calendarProps:T}=f.$6057a3d2a53a12fd$export$42df105a73306d51({...x,"aria-label":l??a,name:a},w,h);return t.jsxs(J,{error:e?void 0:n,helpLink:i,helpLinkText:r,helpText:o,htmlFor:a,label:l,required:s,tooltip:d,children:[t.jsx(Ee,{buttonProps:z,datePickerRef:h,disabled:e,error:n,fieldProps:v,groupProps:k,name:a,register:c,required:s,setValue:p,value:b}),w.isOpen&&!e?t.jsx($e,{offset:8,placement:"bottom start",state:w,triggerRef:h,children:t.jsx(ot,{...S,children:t.jsx(En,{onClose:C,props:T})})}):null]})},Ln=({onClose:e,props:n})=>{const{locale:i}=f.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),r=u.useRef(null),o=f.$9a36b6ba2fb1a7c5$export$9a987164d97ecc90({...n,createCalendar:f.$64244302c3013299$export$dd0bbc9b26defe37,locale:i}),{prevButtonProps:s,nextButtonProps:l,title:a}=f.$46a4342aab3d8076$export$87e0539f600c24e5(n,o,r);return t.jsxs("div",{className:"calendar-range",ref:r,children:[t.jsx(rt,{nextButtonProps:l,prevButtonProps:s,state:o,title:a}),t.jsx(it,{state:o}),t.jsx(Dt,{children:t.jsx(_,{onClick:e,variant:"ghost",children:"Cancel"})})]})},So=y.styled.div`
|
|
1378
1378
|
${({theme:e,$disabled:n,$show:i})=>`
|
|
1379
1379
|
border-color: ${i?e.palette.error[500]:e.palette.gray[300]};
|
|
1380
1380
|
display: flex;
|
|
@@ -1385,7 +1385,7 @@
|
|
|
1385
1385
|
background: ${n?e.palette.gray[200]:e.palette.white};
|
|
1386
1386
|
}
|
|
1387
1387
|
`}
|
|
1388
|
-
`,
|
|
1388
|
+
`,Et=({disabled:e=!1,error:n,label:i,name:r,required:o,tooltip:s,onOpenCalendar:l,register:a,setValue:c,propsMax:p,propsMin:d,variant:g="default",...x})=>{const h=`${r}Max`,b=`${r}Min`,m=u.useRef(null),j=Qe(d==null?void 0:d.value),w=Qe(p==null?void 0:p.value),C=u.useCallback(F=>{if(F){const P=Je(String(F.end)),W=Je(String(F.start));c&&(c((p==null?void 0:p.name)??h,P),c((d==null?void 0:d.name)??b,W)),p!=null&&p.onChange&&(p==null||p.onChange(P)),d!=null&&d.onChange&&(d==null||d.onChange(W))}},[h,b,c,p,d]),k=f.$93c38a5e28be6249$export$e50a61c1de9f574({...x,endName:(p==null?void 0:p.name)??h,startName:(d==null?void 0:d.name)??b,onChange(F){C(F)},...w&&j&&!c?{value:{start:j,end:w}}:p!=null&&p.onChange||d!=null&&d.onChange?{value:null}:{}}),{close:v}=k,{groupProps:z,startFieldProps:S,endFieldProps:T,buttonProps:N,dialogProps:E,calendarProps:D}=f.$887cac91b7cc8801$export$12fd5f0e9f4bb192({...x,"aria-label":i??r},k,m);return u.useEffect(()=>{l&&l(k.isOpen)},[l,k.isOpen]),t.jsxs(J,{error:e?void 0:n,htmlFor:r,label:i,required:o,tooltip:s,children:[t.jsxs(So,{$disabled:e,$show:n!==void 0,ref:m,style:{flexDirection:g==="filters"?"column":"row"},children:[t.jsx(Ee,{buttonProps:N,datePickerRef:m,disabled:e,error:n,fieldProps:{...S,"aria-label":`${S["aria-label"]} ${r}`,validate:F=>T.value&&F>T.value?"Start date must be less than or equal to end date":null},groupProps:z,name:(d==null?void 0:d.name)??b,onChange:d==null?void 0:d.onChange,register:a,setValue:c,value:d==null?void 0:d.value}),t.jsx(Ee,{buttonProps:N,datePickerRef:m,disabled:e,error:n,fieldProps:{...T,"aria-label":`${T["aria-label"]} ${r}`,validate:F=>S.value&&F<S.value?"End date must be greater than or equal to start date":null},groupProps:z,name:(p==null?void 0:p.name)??h,onChange:p==null?void 0:p.onChange,register:a,setValue:c,value:p==null?void 0:p.value})]}),k.isOpen&&!e?t.jsx($e,{offset:8,placement:"bottom start",state:k,triggerRef:m,children:t.jsx(ot,{...E,children:t.jsx(Ln,{onClose:v,props:D})})}):null]})},zo=y.styled.div`
|
|
1389
1389
|
${({theme:e})=>`
|
|
1390
1390
|
align-items: center;
|
|
1391
1391
|
border-top: 1px solid ${e.palette.gray[200]};
|
|
@@ -1394,19 +1394,19 @@
|
|
|
1394
1394
|
justify-content: center;
|
|
1395
1395
|
padding: ${e.spacing[.5]} ${e.spacing[1.25]};
|
|
1396
1396
|
`}
|
|
1397
|
-
`,
|
|
1397
|
+
`,To=y.styled.div`
|
|
1398
1398
|
align-items: center;
|
|
1399
1399
|
display: flex;
|
|
1400
1400
|
gap: ${({theme:e})=>e.spacing[.5]};
|
|
1401
1401
|
justify-content: flex-end;
|
|
1402
1402
|
flex: 1 0 0;
|
|
1403
|
-
`,Pn=({handleTimeChange:e,onClose:n,props:i,timeState:r})=>{const o=
|
|
1403
|
+
`,Pn=({handleTimeChange:e,onClose:n,props:i,timeState:r})=>{const o=y.useTheme(),{locale:s}=f.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),l=f.$131cf43a05231e1e$export$6d095e787d2b5e1f({...i,createCalendar:f.$64244302c3013299$export$dd0bbc9b26defe37,locale:s}),{prevButtonProps:a,nextButtonProps:c,title:p}=f.$9942cad8a072a530$export$3ee915f8151bd4f1(i,l);return t.jsxs("div",{className:"calendar",children:[t.jsx(rt,{nextButtonProps:c,prevButtonProps:a,state:l,title:p}),t.jsx(it,{state:l}),t.jsxs(zo,{children:[t.jsx(I,{color:o.palette.gray[800],fontWeight:"bold",size:"md",children:"Time"}),t.jsx(To,{children:t.jsx(Nn,{hourCycle:12,label:"time-field",onChange:e,value:r.timeValue})})]}),t.jsx(Dt,{children:t.jsx(_,{onClick:n,variant:"ghost",children:"Cancel"})})]})},Io=e=>{const{disabled:n=!1,error:i,required:r,label:o,name:s,tooltip:l,register:a,setValue:c,watch:p}=e,d=p==null?void 0:p(s),g=u.useRef(null),x=f.$ab5bf3f618090389$export$87194bb378cc3ac2({...e,granularity:"minute",hourCycle:12,isDisabled:n,isRequired:r,shouldCloseOnSelect:!1,value:f._.isNil(d)||f._.isEmpty(d)||d==="-"||f.dayjs(d,"YYYY/MM/DD hh:mm A").isValid()===!1?null:f.$fae977aafc393c5c$export$588937bcd60ade55(f.dayjs(d,"YYYY/MM/DD hh:mm A").format("YYYY-MM-DDTHH:mm:ss"))}),{close:h}=x,{groupProps:b,fieldProps:m,buttonProps:j,dialogProps:w,calendarProps:C}=f.$6057a3d2a53a12fd$export$42df105a73306d51(e,x,g),k=u.useCallback(z=>{if(C.onChange&&C.onChange(z),x.timeValue){const S=on(z,x.timeValue);c==null||c(s,S,{shouldDirty:!0})}else x.setDateValue(z)},[C,s,c,x]),v=u.useCallback(z=>{if(z){x.setTimeValue(z);const S=x.dateValue;if(S){const T=on(S,z);c==null||c(s,T,{shouldDirty:!0})}}},[x,c,s]);return t.jsxs(J,{error:n?void 0:i,htmlFor:s,label:o,required:r,tooltip:l,children:[t.jsx(Ee,{buttonProps:j,datePickerRef:g,disabled:n,error:i,fieldProps:m,granularity:"minute",groupProps:b,name:s,register:a,setValue:c,value:d}),x.isOpen&&!n?t.jsx($e,{offset:8,placement:"bottom start",state:x,triggerRef:g,children:t.jsx(ot,{...w,children:t.jsx(Pn,{handleTimeChange:v,onClose:h,props:{...C,onChange:k},timeState:x})})}):null]})},Do=({children:e,currentValue:n,externalLink:i,isEditing:r,label:o,name:s,tooltip:l})=>{if(r)return t.jsx("div",{children:e});const a=f.lodashExports.isNil(n)?"":n,c=String(i??a);return t.jsxs($,{children:[t.jsx(Tt,{htmlFor:s,label:o,tooltip:l,weight:"bold"}),c.startsWith("https://")?t.jsx(le,{href:c,children:a}):t.jsx(I,{size:"md",children:a})]})},st=({disabled:e=!1,hasIcon:n=!1,helpLink:i,helpLinkText:r,helpText:o,error:s,id:l,indexArray:a=0,isValid:c,isTouched:p,label:d,name:g,maskValue:x=!1,onPaste:h,placeholder:b,removeItemArray:m,register:j,suggestions:w,tooltip:C,type:k="text",weight:v,...z})=>{const{required:S,onBlur:T,onChange:N}=z,E=y.useTheme(),D=e?void 0:s,[F,P]=u.useState(""),W=u.useCallback(M=>{P(M.target.value),N==null||N(M)},[N]),H=c&&p&&!e&&F.trim()!=="",B=u.useCallback(M=>{M.key==="Enter"&&M.preventDefault()},[]);return t.jsxs(J,{error:D,helpLink:i,helpLinkText:r,helpText:o,htmlFor:g,label:d,required:S,tooltip:C,weight:v,children:[t.jsxs(ie,{className:`
|
|
1404
1404
|
${e?"disabled":""} ${D?"error":""} ${H?"success":""}
|
|
1405
|
-
`,children:[n?t.jsx(R,{icon:"user",iconSize:"xl",iconType:"fa-light"}):void 0,t.jsx("input",{"aria-hidden":!1,"aria-invalid":D?"true":"false","aria-label":g,"aria-required":S,autoComplete:"off",className:x?"sr-block":"","data-testid":`${g}-input`,disabled:e,id:g,list:w?`list_${g}`:void 0,onKeyDown:B,onPaste:h,placeholder:b,type:k,...j?j(g,{required:S,onBlur:T,onChange:W}):{...z,onChange:W}}),D?t.jsx(R,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:E.palette.error[500],iconSize:"lg"}):void 0,H?t.jsx(R,{icon:"check-circle",iconClass:"success-icon",iconColor:E.palette.success[500],iconSize:"lg"}):void 0,l==="array"&&
|
|
1405
|
+
`,children:[n?t.jsx(R,{icon:"user",iconSize:"xl",iconType:"fa-light"}):void 0,t.jsx("input",{"aria-hidden":!1,"aria-invalid":D?"true":"false","aria-label":g,"aria-required":S,autoComplete:"off",className:x?"sr-block":"","data-testid":`${g}-input`,disabled:e,id:g,list:w?`list_${g}`:void 0,onKeyDown:B,onPaste:h,placeholder:b,type:k,...j?j(g,{required:S,onBlur:T,onChange:W}):{...z,onChange:W}}),D?t.jsx(R,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:E.palette.error[500],iconSize:"lg"}):void 0,H?t.jsx(R,{icon:"check-circle",iconClass:"success-icon",iconColor:E.palette.success[500],iconSize:"lg"}):void 0,l==="array"&&a>0?t.jsx(V,{color:E.palette.gray[400],icon:"trash",iconSize:"sm",iconType:"fa-light",onClick:m?m(a):void 0,variant:"ghost"}):void 0]}),w?t.jsx("datalist",{id:`list_${g}`,children:w.map(M=>t.jsx("option",{value:M},M))}):void 0]})},Eo=y.styled.div.attrs({className:"flex flex-wrap justify-center pv3 w-100"})``,Fo=y.styled.div.attrs({className:"flex flex-wrap items-center justify-start mb2"})`
|
|
1406
1406
|
gap: 12px;
|
|
1407
|
-
`,
|
|
1407
|
+
`,Ro=y.styled.div.attrs({className:"flex flex-wrap items-center justify-end mb2"})`
|
|
1408
1408
|
gap: 8px;
|
|
1409
|
-
`,Ge=e=>e===void 0?"flex-grow: 1;":`width: calc(${e}00% / var(--cols));`,
|
|
1409
|
+
`,Ge=e=>e===void 0?"flex-grow: 1;":`width: calc(${e}00% / var(--cols));`,No=y.styled.div.attrs({className:"comp-col"})`
|
|
1410
1410
|
word-wrap: break-word;
|
|
1411
1411
|
|
|
1412
1412
|
${({$width:e=null})=>e===null?"":`width: ${e}`};
|
|
@@ -1425,12 +1425,12 @@
|
|
|
1425
1425
|
${({$lg:e})=>Ge(e)}
|
|
1426
1426
|
}
|
|
1427
1427
|
|
|
1428
|
-
${({$xl:e})=>
|
|
1428
|
+
${({$xl:e})=>f.isNumber(e)?`@media (min-width: 1200px) { ${Ge(e)} }`:""}
|
|
1429
1429
|
|
|
1430
1430
|
> .comp-card {
|
|
1431
1431
|
height: 100%;
|
|
1432
1432
|
}
|
|
1433
|
-
`,xt=({children:e,xl:n,lg:i,md:r,sm:o,paddingTop:
|
|
1433
|
+
`,xt=({children:e,xl:n,lg:i,md:r,sm:o,paddingTop:s,width:l})=>t.jsx(No,{$lg:i,$md:r,$paddingTop:s,$sm:o,$width:l,$xl:n,children:e}),Ao=y.styled.div.attrs({className:"comp-gap"})`
|
|
1434
1434
|
${({$disp:e="flex",$mh:n=4,$mv:i=4})=>`
|
|
1435
1435
|
align-items: center;
|
|
1436
1436
|
display: ${e};
|
|
@@ -1440,7 +1440,7 @@
|
|
|
1440
1440
|
margin: ${i}px ${n}px;
|
|
1441
1441
|
}
|
|
1442
1442
|
`}
|
|
1443
|
-
`,
|
|
1443
|
+
`,Lo=({children:e,disp:n,mh:i,mv:r})=>t.jsx(Ao,{$disp:n,$mh:i,$mv:r,children:e}),Po=y.styled.div.attrs({className:"comp-row flex flex-row flex-wrap"})`
|
|
1444
1444
|
${({$align:e="stretch",$cols:n=100,$colsPadding:i=6,$justify:r="start"})=>`
|
|
1445
1445
|
align-items: ${e};
|
|
1446
1446
|
justify-content: ${r};
|
|
@@ -1458,13 +1458,13 @@
|
|
|
1458
1458
|
padding: ${i}px;
|
|
1459
1459
|
}
|
|
1460
1460
|
`}
|
|
1461
|
-
`,On=({align:e,children:n,cols:i,colsPadding:r,justify:o})=>t.jsx(
|
|
1461
|
+
`,On=({align:e,children:n,cols:i,colsPadding:r,justify:o})=>t.jsx(Po,{$align:e,$cols:i,$colsPadding:r,$justify:o,children:n}),ht=({addText:e,append:n,disabled:i=!1,fields:r,fieldState:o,initValue:s="",index:l=0,required:a,label:c,max:p=100,name:d,onBlur:g,onChange:x,placeholder:h,tooltip:b,remove:m,value:j})=>{var k;const w=u.useCallback(()=>{n==null||n(s)},[n,s]),C=u.useCallback(v=>()=>{m==null||m(v)},[m]);return t.jsxs(On,{align:"start",children:[t.jsx(xt,{lg:75,md:75,sm:75,children:t.jsx(st,{disabled:i,error:o?(k=o.error)==null?void 0:k.message:void 0,id:"array",indexArray:l,isTouched:o?o.isTouched:void 0,isValid:o?!o.invalid:void 0,label:c,name:d,onBlur:g,onChange:x,placeholder:h,removeItemArray:C,required:a,tooltip:b,value:j})}),l<p-1&&l+1===(r==null?void 0:r.length)?t.jsx(xt,{lg:25,md:25,sm:25,children:t.jsx(_,{disabled:i,icon:"plus",onClick:w,variant:"ghost",width:"max-content",children:e??"Add"})}):void 0]})},Oo=({addText:e,append:n,control:i,disabled:r,fields:o,initValue:s="",required:l,label:a,max:c=void 0,name:p="array-field",onChange:d,placeholder:g,remove:x,tooltip:h})=>i&&o?t.jsx(u.Fragment,{children:o.map((b,m)=>t.jsx(f.Controller,{control:i,name:`${p}.${m}`,render:({field:j,fieldState:w})=>t.jsx(ht,{addText:e,append:n,disabled:r,fieldState:w,fields:o,index:m,initValue:s,label:a,max:c,name:j.name,onBlur:j.onBlur,onChange:d??j.onChange,placeholder:g,remove:x,required:l,tooltip:h,value:typeof j.value=="object"?j.value.value:j.value}),index:m},b.id))}):t.jsx(ht,{addText:e,disabled:r,initValue:s,label:a,max:c,name:p,onChange:d,placeholder:g,required:l,tooltip:h}),Bo=y.styled($n)`
|
|
1462
1462
|
white-space: nowrap;
|
|
1463
1463
|
margin-right: ${({theme:e})=>e.spacing[.25]};
|
|
1464
1464
|
text-overflow: ellipsis;
|
|
1465
1465
|
overflow: hidden;
|
|
1466
1466
|
max-width: 80%;
|
|
1467
|
-
`,
|
|
1467
|
+
`,Wo=y.styled.div`
|
|
1468
1468
|
${({theme:e})=>`
|
|
1469
1469
|
align-items: center;
|
|
1470
1470
|
display: flex;
|
|
@@ -1511,7 +1511,7 @@
|
|
|
1511
1511
|
border: 1px solid ${e.palette.gray[600]};
|
|
1512
1512
|
}
|
|
1513
1513
|
`}
|
|
1514
|
-
`,
|
|
1514
|
+
`,Mo=y.styled.div`
|
|
1515
1515
|
${({theme:e})=>`
|
|
1516
1516
|
display: flex;
|
|
1517
1517
|
flex-direction: column;
|
|
@@ -1555,7 +1555,7 @@
|
|
|
1555
1555
|
border: 1px solid ${e.palette.success[500]};
|
|
1556
1556
|
}
|
|
1557
1557
|
`}
|
|
1558
|
-
`,
|
|
1558
|
+
`,lt=y.styled.button`
|
|
1559
1559
|
${({theme:e,$variant:n})=>`
|
|
1560
1560
|
background: transparent;
|
|
1561
1561
|
border: none;
|
|
@@ -1580,12 +1580,12 @@
|
|
|
1580
1580
|
text-decoration: none;
|
|
1581
1581
|
}
|
|
1582
1582
|
`}
|
|
1583
|
-
`,
|
|
1583
|
+
`,_o=y.styled.input`
|
|
1584
1584
|
opacity: 0;
|
|
1585
1585
|
position: absolute;
|
|
1586
1586
|
visibility: hidden;
|
|
1587
1587
|
width: 0;
|
|
1588
|
-
`,Bn=({disabled:e=!1,handleButtonClick:n,errorMsg:i,fileName:r,handleRemoveFile:o,theme:
|
|
1588
|
+
`,Bn=({disabled:e=!1,handleButtonClick:n,errorMsg:i,fileName:r,handleRemoveFile:o,theme:s})=>t.jsxs(ie,{className:`${e?"disabled":""} ${i?"error":""}`,children:[t.jsx(Bo,{$size:"md",children:r}),t.jsxs($,{alignItems:"center",display:"flex",gap:.625,children:[f.lodashExports.isEmpty(r)||e?void 0:t.jsx(V,{color:s.palette.gray[400],height:"20px",icon:"xmark",iconSize:"64px",iconType:"fa-light",onClick:o,variant:"ghost",width:"20px"}),i&&t.jsx(R,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:s.palette.error[500],iconSize:"lg"}),t.jsxs(_,{border:e?`1px solid ${s.palette.gray[300]} !important`:"",borderRadius:"0px 8px 8px 0px !important",disabled:e,height:"40px",onClick:n,variant:"primary",width:"96px",children:[t.jsx(R,{icon:"search",iconSize:"xl",mr:.5}),"Add file"]})]})]}),Ho={"vnd.ms-excel":"XLS","vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX","vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX",msword:"DOC"},Fe=(e,n,i)=>{const r=new Event(e);return Object.defineProperty(r,"target",{value:{name:n,value:i}}),r},Vo=e=>{const n=e;return n?Array.from(n).map(i=>i.name).join(", "):""},Uo=e=>{if(!e)return"All files";const n=e.split(",").map(r=>{const o=r.trim();if(e==="image/*")return"Images";if(e==="video/*")return"Videos";if(e==="audio/*")return"Audio files";if(o.startsWith("."))return o.substring(1).toUpperCase();if(o.includes("/")){const s=o.split("/")[1];return Ho[s]??s.toUpperCase()}return o.toUpperCase()});return[...new Set(n)].join(", ")},sn=(e,n=2)=>{if(e===0)return"0 Bytes";const i=1024,r=n<0?0:n,o=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],s=Math.floor(Math.log(e)/Math.log(i));return parseFloat((e/Math.pow(i,s)).toFixed(r))+o[s]},{getVariant:Go}=ae(e=>({compliance:`
|
|
1589
1589
|
display: inline-flex;
|
|
1590
1590
|
|
|
1591
1591
|
&.horizontal {
|
|
@@ -1643,17 +1643,17 @@
|
|
|
1643
1643
|
.progress-bar {
|
|
1644
1644
|
background-color: ${e.palette.primary[500]};
|
|
1645
1645
|
}
|
|
1646
|
-
`})),
|
|
1646
|
+
`})),Yo=(e,n)=>n<50?e.palette.error[500]:n<80?e.palette.warning[500]:e.palette.success[500],Xo=y.styled.div`
|
|
1647
1647
|
${({theme:e,$minWidth:n,$orientation:i,$rounded:r,$variant:o})=>`
|
|
1648
1648
|
background-color: ${e.palette.gray[100]};
|
|
1649
1649
|
border-radius: ${r?"100px":"unset"};
|
|
1650
1650
|
${i==="horizontal"?"min-width":"min-height"}: ${n=="full"?"100%":`${n}px`};
|
|
1651
1651
|
${i==="horizontal"?"":"height: 100%;"}
|
|
1652
1652
|
|
|
1653
|
-
${
|
|
1653
|
+
${Go(e,o)}
|
|
1654
1654
|
|
|
1655
1655
|
`}
|
|
1656
|
-
`,
|
|
1656
|
+
`,Ko=y.styled.div`
|
|
1657
1657
|
${({theme:e,$percentage:n,$rounded:i,$variant:r})=>`
|
|
1658
1658
|
display: inline-flex;
|
|
1659
1659
|
width: ${n}%;
|
|
@@ -1663,15 +1663,15 @@
|
|
|
1663
1663
|
border-radius: ${i?"100px":"unset"};
|
|
1664
1664
|
border-end-end-radius: ${i&&n<100?"0":"inherit"};
|
|
1665
1665
|
border-start-end-radius: ${i&&n<100?"0":"inherit"};
|
|
1666
|
-
background-color: ${r==="compliance"?
|
|
1666
|
+
background-color: ${r==="compliance"?Yo(e,n):"inherit"};
|
|
1667
1667
|
`}
|
|
1668
|
-
`,
|
|
1668
|
+
`,Ft=({minWidth:e=100,percentage:n,percentageLocation:i="right",showPercentage:r=!1,orientation:o="horizontal",rounded:s=!0,variant:l="default"})=>{const a=r&&i==="left",c=r?t.jsx($,{alignItems:"center",display:"flex",justify:a?"flex-end":"flex-start",width:"40px",children:t.jsx(I,{ml:.5,mr:a?.5:0,size:"md",children:`${n}%`})}):null,p=t.jsx(Xo,{$minWidth:e,$orientation:o,$rounded:s,$variant:l,className:o,children:t.jsx(Ko,{$percentage:n,$rounded:s,$variant:l,className:"progress-bar"})});return t.jsxs($,{alignItems:"center",display:"inline-flex",flexDirection:a?"row-reverse":"row",height:o==="horizontal"?"auto":"100%",maxWidth:a&&e!=="full"?`${e+43}px`:e=="full"?"100%":void 0,minWidth:a&&e!=="full"?`${e+43}px`:e=="full"?"100%":void 0,textAlign:"end",children:[p,c]})},Zo=e=>e.split(",").map(n=>n.trim().toLowerCase()),qo=(e,n)=>{const i=e.name.toLowerCase(),r=e.type.toLowerCase();return n.some(o=>o?o.startsWith(".")?i.endsWith(o):o.endsWith("/*")?r.startsWith(o.slice(0,-1)):r===o:!1)},Wn=({disabled:e=!1,handleButtonClick:n,errorMsg:i,fileName:r,handleRemoveFile:o,resetField:s,name:l,theme:a,accept:c,value:p,viewMode:d,progressPercentage:g,canReplaceInViewMode:x,multiple:h,maxSize:b,setIsReading:m,inputRef:j})=>{const w=u.useRef(null);function C(F){o(F),s==null||s(l??"")}const{dropProps:k,isDropTarget:v}=f.$5c06e4929e123553$export$ccdee5eaf73cf661({ref:w,async onDrop(F){m==null||m(!0);try{const P=F.items.filter(U=>U.kind==="file"),W=await Promise.all(P.map(async U=>U.getFile())),H=c?W.filter(U=>qo(U,Zo(c))):W;c&&H.length<W.length&&console.warn("InputFile: Some files were rejected due to invalid type.");const B=new DataTransfer;(h?H:[H[0]]).forEach(U=>B.items.add(U));const M=B.files;if(j!=null&&j.current){j.current.files=M;const U=new Event("change",{bubbles:!0});j.current.dispatchEvent(U)}}catch(P){console.error("Error reading dropped files:",P)}}}),z=t.jsx(V,{color:a.palette.gray[700],height:"20px",icon:"xmark",iconSize:"64px",iconType:"fa-light",onClick:o,variant:"ghost",width:"20px"}),S=i?t.jsx(R,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:a.palette.error[500],iconSize:"lg"}):g||d?void 0:t.jsx(R,{icon:"circle-check",iconClass:"success-icon",iconColor:a.palette.success[500],iconSize:"lg"}),T=!i&&r?t.jsxs(I,{color:a.palette.gray[400],size:"md",children:[Array.from(p).map(F=>sn(F.size)).join(", "),g?` • ${g}% uploaded`:void 0]}):t.jsx(q,{priority:"low",tagLabel:"Error uploading",variant:"error"}),N=t.jsx(lt,{$variant:"highRelevance",disabled:e,onClick:n,children:"click to browse"}),E=t.jsx(lt,{$variant:"lowRelevance",disabled:e,onClick:C,children:"Try again"}),D=x?t.jsx(lt,{$variant:"lowRelevance",disabled:e,onClick:n,children:"Replace file"}):void 0;return t.jsxs(u.Fragment,{children:[!r&&t.jsxs(Wo,{...k,className:`${e?"disabled":""} ${i?"error":""} ${v?"target":""} dropzone`,onClick:e?void 0:n,children:[r,t.jsx(R,{icon:"cloud-arrow-up",iconColor:a.palette.gray[800],iconSize:"xl",iconType:"fa-light"}),t.jsx($,{display:"inline-flex",gap:.25,children:t.jsxs(I,{color:a.palette.gray[800],size:"md",textAlign:"center",children:["Drop your file here, or ",N]})}),t.jsxs(I,{color:a.palette.gray[400],size:"sm",textAlign:"center",children:[`${Uo(c)}`,b?` (max. ${sn(b)} total limit)`:void 0]})]}),r&&t.jsxs(Mo,{className:`${i?"error":""} dropzone`,children:[t.jsxs($,{alignItems:"center",display:"flex",flexDirection:"row",justify:"space-between",children:[t.jsxs($,{display:"flex",flexDirection:"column",children:[t.jsxs($,{alignItems:"center",display:"inline-flex",gap:.25,justify:"center",children:[S,t.jsx(I,{color:a.palette.gray[700],fontWeight:"bold",size:"md",children:r})]}),t.jsx("div",{children:T})]}),i?E:f.lodashExports.isEmpty(r)?void 0:d?D:z]}),g?t.jsx(Ft,{minWidth:"full",percentage:g}):void 0]})]})},Jo=({accept:e,disabled:n=!1,error:i,label:r,helpLink:o,helpText:s,id:l,multiple:a,name:c,onChange:p,required:d,register:g,setValue:x,resetField:h,tooltip:b,watch:m,weight:j,variant:w="default",viewMode:C,canReplaceInViewMode:k,progressPercentage:v,maxSize:z})=>{const S=y.useTheme(),T=n?void 0:i,N=u.useRef(null),E=g==null?void 0:g(c,{required:d}),D=m==null?void 0:m(c),F=Vo(D),[P,W]=u.useState(!1),[H,B]=u.useState(v);u.useEffect(()=>{B(!v&&P?50:!v&&!P?void 0:v)},[P,v]);const M=u.useCallback(ee=>{ee.stopPropagation();const Y=Fe("change",c,null);x&&x(c,void 0),E&&E.onChange(Y)},[E,c,x]),U=u.useCallback(async ee=>{W(!0);try{const{files:Y}=ee.currentTarget,he=Fe("change",c,Y&&Y.length>0?Y:null);Y&&Y.length>0&&(p==null||p(he),x&&x(c,Y),E&&E.onChange(he),await new Promise(ve=>setTimeout(ve,100)))}catch(Y){console.error("Error handling file change:",Y)}finally{W(!1)}},[E,c,p,x]),ue=u.useCallback(ee=>{ee.stopPropagation(),n?ee.preventDefault():N.current&&N.current.click()},[n]);return t.jsxs(J,{error:T,helpLink:o,helpText:s,htmlFor:l??c,label:r,required:d,tooltip:b,weight:j,children:[w==="default"&&t.jsx(Bn,{disabled:n,errorMsg:T,fileName:F,handleButtonClick:ue,handleRemoveFile:M,theme:S}),w==="dropzone"&&t.jsx(Wn,{accept:e,canReplaceInViewMode:k,disabled:n,errorMsg:T,fileName:F,handleButtonClick:ue,handleRemoveFile:M,inputRef:N,maxSize:z,multiple:a,name:c,progressPercentage:H,resetField:h,setIsReading:W,theme:S,value:D,viewMode:C}),t.jsx(_o,{...E,accept:e,"aria-label":c,"data-testid":c,disabled:n,id:l??c,multiple:a,name:c,onChange:U,ref:N,type:"file"})]})},Qo=({title:e,icon:n="circle-info",children:i,tagElement:r})=>t.jsxs($,{display:"flex",flexDirection:"column",gap:.25,children:[t.jsxs($,{alignItems:"center",display:"flex",flexDirection:"row",gap:.75,children:[t.jsx(R,{icon:n,iconSize:"md",iconType:"fa-light"}),t.jsx(G,{fontWeight:"bold",size:"xs",children:e}),r&&t.jsx($,{display:"flex",flexDirection:"row",mb:.25,children:r})]}),t.jsx($,{children:i})]}),es=y.styled.input`
|
|
1669
1669
|
border: none;
|
|
1670
1670
|
background: transparent;
|
|
1671
1671
|
min-width: 15rem;
|
|
1672
1672
|
padding: 0;
|
|
1673
1673
|
flex: 1;
|
|
1674
|
-
`,ft=({disabled:e=!1,error:n,field:i,helpLink:r,helpLinkText:o,helpText:
|
|
1674
|
+
`,ft=({disabled:e=!1,error:n,field:i,helpLink:r,helpLinkText:o,helpText:s,label:l,name:a="input-tag",onChange:c,onRemove:p,placeholder:d,required:g,tooltip:x,value:h,weight:b})=>{const m=y.useTheme(),j=e?void 0:n,[w,C]=u.useState(""),k=c?h:i==null?void 0:i.value,v=u.useMemo(()=>k&&typeof k=="string"?k.split(",").filter(Boolean):[],[k]),z=u.useCallback(D=>{const P=[...new Set(D.filter(Boolean))].join(","),W=Fe("change",a,P);i&&i.onChange(W),c&&c(W)},[i,a,c]),S=u.useCallback(D=>{C(D.target.value)},[]),T=u.useCallback(D=>{const F=w.trim();F.length&&!v.includes(F)&&(D.preventDefault(),z([...v,F]),C("")),i&&i.onBlur()},[w,i,z,v]),N=u.useCallback(D=>{const F=w.trim();D.key==="Enter"&&F.length===0&&D.preventDefault(),["Enter",","].includes(D.key)&&F.length>0&&!v.includes(F)?(D.preventDefault(),z([...v,F]),C("")):D.key==="Backspace"&&!F.length&&v.length&&(D.preventDefault(),p==null||p(v[v.length-1]),z(v.slice(0,-1)))},[w,p,z,v]),E=u.useCallback(D=>()=>{p==null||p(D),z(v.filter(F=>F!==D))},[p,z,v]);return t.jsx(J,{error:j,helpLink:r,helpLinkText:o,helpText:s,htmlFor:a,label:l,required:g,tooltip:x,weight:b,children:t.jsxs(ie,{$overflowX:"auto",className:`${e?"disabled":""} ${j?"error":""}`,children:[v.map(D=>t.jsx(q,{disabled:e,onClose:E(D),tagLabel:D},D)),t.jsx(es,{"aria-hidden":!1,"aria-invalid":j?"true":"false","aria-label":a,"aria-required":g,autoComplete:"off",disabled:e,id:a,onBlur:T,onChange:S,onKeyDown:N,placeholder:v.length===0?d:void 0,ref:i==null?void 0:i.ref,type:"text",value:w}),j?t.jsx(R,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:m.palette.error[500],iconSize:"lg"}):void 0]})})},ts=({disabled:e=!1,control:n,error:i,helpLink:r,helpLinkText:o,helpText:s,label:l,name:a="input-tag",onChange:c,onRemove:p,placeholder:d,required:g,tooltip:x,value:h,weight:b})=>n?t.jsx(f.Controller,{control:n,name:a,render:({field:m})=>t.jsx(ft,{disabled:e,error:i,field:m,helpLink:r,helpLinkText:o,helpText:s,label:l,name:a,onRemove:p,placeholder:d,required:g,tooltip:x,weight:b}),rules:{required:g}}):t.jsx(ft,{disabled:e,error:i,helpLink:r,helpLinkText:o,helpText:s,label:l,name:a,onChange:c,onRemove:p,placeholder:d,required:g,tooltip:x,value:h,weight:b}),ze=u.forwardRef(function({disabled:n,icon:i,margin:r,onClick:o,...s},l){return t.jsx($o,{$margin:r,"aria-label":i,className:"action-btn",disabled:n,onClick:o,ref:l,type:"button",...s,children:t.jsx(R,{icon:i,iconClass:"action",iconSize:"lg",iconType:"fa-light"})})}),Re=({error:e,decimalPlaces:n=0,disabled:i=!1,id:r,maxLength:o,max:s=1/0,min:l=0,name:a,onChange:c,onEnter:p,placeholder:d,register:g,required:x,setValue:h,tooltipMessage:b,value:m,variant:j="full",defaultValue:w})=>{const C=y.useTheme(),k=i?void 0:e,v=n<0?0:n,z=Co(m==null?void 0:m.toString(),w),[S,T]=u.useState(z);u.useEffect(()=>{T(z)},[z]);const N=u.useCallback(()=>{const H=((S??Number(l))-10**-v).toFixed(v),B=Math.max(Number(l),Number(H));h&&h(a,B,{shouldDirty:!0}),T(B);const M=Fe("change",a,H);c&&c(M)},[S,v,l,h,a,c]),E=u.useCallback(()=>{const H=((S??Number(l))+10**-v).toFixed(v),B=Math.min(Number(s),Number(H)>Number(l)?Number(H):Number(l));h&&h(a,B,{shouldDirty:!0}),T(B);const M=Fe("change",a,H);c&&c(M)},[S,v,s,l,h,a,c]),D=u.useCallback(W=>{const{value:H}=W.target,B=/\d+/u.test(H)&&!f._.isEmpty(H);h&&h(a,B?H:void 0),c&&c(W),T(f._.isEmpty(H)?void 0:Number(H))},[a,c,h]),F=u.useCallback(W=>{W.stopPropagation(),W.key==="Enter"&&!f.lodashExports.isEmpty(W.currentTarget.value)&&(p==null||p(f.lodashExports.toNumber(W.currentTarget.value)))},[p]),P=()=>t.jsx("input",{"aria-hidden":!1,"aria-invalid":k?"true":"false","aria-label":a,"aria-required":x,autoComplete:"off",disabled:i,id:r??a,max:s,min:l,onChange:D,onKeyUp:F,placeholder:d,required:x,step:10**-v,type:"number",value:S??"",...g==null?void 0:g(a,{maxLength:o,max:s,min:l,onChange:D,value:m,valueAsNumber:!0})});return t.jsxs(ie,{$variant:j,className:`${i?"disabled":""} ${k?"error":""}`,children:[j==="compact"&&b?t.jsx(Z,{id:`numberInputTooltip-${a}`,tip:b,width:"100%",children:P()}):P(),k&&t.jsx(R,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:C.palette.error[500],iconSize:"lg"}),j==="compact"?t.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",borderLeft:"inherit"},children:[t.jsx(ze,{borderRadius:`0 ${C.spacing[.5]} 0 0`,disabled:i,icon:"plus",onClick:E,px:.25}),t.jsx(lo,{}),t.jsx(ze,{borderRadius:`0 0 ${C.spacing[.5]} 0`,disabled:i,icon:"minus",onClick:N,px:.25})]}):t.jsxs(t.Fragment,{children:[t.jsx(ze,{borderLeft:"inherit",borderRight:"inherit",disabled:i,icon:"minus",margin:"0 -0.625rem 0 0",onClick:N,px:.75,py:.75}),t.jsx(ze,{borderRadius:`0 ${C.spacing[.5]} ${C.spacing[.5]} 0`,disabled:i,icon:"plus",onClick:E,px:.75,py:.75})]})]})},Mn=({autoUpdate:e,decimalPlaces:n,disabled:i=!1,error:r,helpLink:o,helpLinkText:s,helpText:l,id:a,label:c,linkPosition:p,maxLength:d,max:g,min:x,name:h,onChange:b,onEnter:m,placeholder:j,register:w,required:C,setValue:k,tooltip:v,tooltipMessage:z,value:S,variant:T="full",watch:N,weight:E,defaultValue:D})=>T==="compact"?t.jsx(Re,{"aria-label":h,autoUpdate:e,decimalPlaces:n,defaultValue:D??Number(S??0),disabled:i,max:g,min:x,name:h,onEnter:m??(()=>{}),tooltipMessage:z,value:S,variant:T}):t.jsx(J,{error:i?void 0:r,helpLink:o,helpLinkText:s,helpText:l,htmlFor:h,label:c,linkPosition:p,maxLength:d,required:C,tooltip:v,weight:E,children:t.jsx(Re,{decimalPlaces:n,disabled:i,error:r,id:a,max:g,maxLength:d,min:x,name:h,onChange:b,placeholder:j,register:w,required:C,setValue:k,value:N?N(h):S,variant:T})}),Rt=({disabled:e=!1,error:n,name:i,label:r,propsMax:o,propsMin:s,required:l,tooltip:a,variant:c="default"})=>{const p=`${i}Max`,d=`${i}Min`;return t.jsx(J,{error:e?void 0:n,htmlFor:i,label:r,required:l,tooltip:a,children:t.jsxs($,{display:"flex",flexDirection:c==="filters"?"column":"row",gap:.25,width:"100%",children:[t.jsx(Re,{...s,disabled:e,error:n,name:(s==null?void 0:s.name)??d}),t.jsx(Re,{...o,disabled:e,error:n,name:(o==null?void 0:o.name)??p})]})})},ns=y.styled.div`
|
|
1675
1675
|
${({theme:e})=>`
|
|
1676
1676
|
align-items: flex-start;
|
|
1677
1677
|
align-self: stretch;
|
|
@@ -1711,7 +1711,7 @@
|
|
|
1711
1711
|
}
|
|
1712
1712
|
}
|
|
1713
1713
|
`}
|
|
1714
|
-
`,
|
|
1714
|
+
`,is=y.styled.button`
|
|
1715
1715
|
${({theme:e})=>`
|
|
1716
1716
|
align-items: center;
|
|
1717
1717
|
background: inherit;
|
|
@@ -1727,7 +1727,7 @@
|
|
|
1727
1727
|
cursor: not-allowed;
|
|
1728
1728
|
}
|
|
1729
1729
|
`}
|
|
1730
|
-
`,
|
|
1730
|
+
`,rs=y.styled.ul`
|
|
1731
1731
|
${({theme:e})=>`
|
|
1732
1732
|
align-items: flex-start;
|
|
1733
1733
|
box-shadow: ${e.shadows.md};
|
|
@@ -1741,7 +1741,7 @@
|
|
|
1741
1741
|
scrollbar-width: thin;
|
|
1742
1742
|
width: max-content;
|
|
1743
1743
|
`}
|
|
1744
|
-
`,
|
|
1744
|
+
`,os=y.styled.li`
|
|
1745
1745
|
${({theme:e})=>`
|
|
1746
1746
|
align-items: center;
|
|
1747
1747
|
background: ${e.palette.white};
|
|
@@ -1758,22 +1758,22 @@
|
|
|
1758
1758
|
background: ${e.palette.gray[100]};
|
|
1759
1759
|
}
|
|
1760
1760
|
`}
|
|
1761
|
-
`,
|
|
1761
|
+
`,ss=y.styled.p`
|
|
1762
1762
|
color: ${({theme:e})=>e.palette.gray[800]};
|
|
1763
1763
|
font-size: inherit;
|
|
1764
1764
|
min-width: 55%;
|
|
1765
1765
|
overflow: hidden;
|
|
1766
1766
|
text-overflow: ellipsis;
|
|
1767
1767
|
white-space: nowrap;
|
|
1768
|
-
`,
|
|
1768
|
+
`,as=({disabled:e,error:n,label:i,name:r,placeholder:o,required:s,register:l,tooltip:a,value:c,watch:p,weight:d})=>{const g=y.useTheme(),x=u.useRef(null),h=e?void 0:n,b=(p==null?void 0:p(r))??c,[m,j]=u.useState(!1),[w,C]=u.useState(""),{refs:k,floatingStyles:v}=f.useFloating$1({placement:"bottom-start",whileElementsMounted:f.autoUpdate}),{inputRef:z,inputValue:S,handlePhoneValueChange:T,country:N,setCountry:E}=f.ee({countries:f._$1,defaultCountry:"co",forceDialCode:!0,value:b?String(b):""}),D=u.useCallback(B=>{B.key==="Enter"&&B.preventDefault()},[]),F=u.useCallback(B=>{B.preventDefault(),j(M=>!M),m||C("")},[m]),P=u.useCallback(B=>()=>{E(B),j(!1),C("")},[E,j]),W=u.useCallback(B=>{B.key.length===1?C(M=>M+B.key):B.key==="Backspace"&&C(M=>M.slice(0,-1))},[]),H=f._$1.filter(B=>{const{name:M}=f.M(B);return M.toLowerCase().includes(w.toLowerCase())});return re(k.floating.current,()=>{j(!1),C("")},!0),t.jsx(J,{error:h,htmlFor:r,label:i,required:s,tooltip:a,weight:d,children:t.jsxs(ns,{className:`${e?"disabled":""} ${h?"error":""}`,ref:x,children:[t.jsxs(is,{"aria-label":"country-selector","data-testid":"country-selector",disabled:e,id:"country-selector",onClick:F,onKeyDown:W,ref:k.setReference,children:[t.jsx(f.q,{iso2:N.iso2,size:"16px"}),t.jsx(R,{icon:"angle-down",iconColor:g.palette.gray[400],iconSize:"lg",iconType:"fa-light"})]}),t.jsxs(ie,{className:`${e?"disabled":""} ${h?"error":""}`,children:[t.jsx("input",{"aria-hidden":!1,"aria-invalid":h?"true":"false","aria-label":r,"aria-required":s,autoComplete:"off","data-testid":`${r}-input`,disabled:e,id:r,name:r,onKeyDown:D,placeholder:o,ref:z,type:"tel",value:S,...l==null?void 0:l(r,{required:s,onChange:T})}),h?t.jsx(R,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:g.palette.error[500],iconSize:"lg"}):void 0]}),m&&je.createPortal(t.jsx(rs,{ref:k.setFloating,style:v,children:H.map(B=>{const{dialCode:M,iso2:U,name:ue}=f.M(B);return t.jsxs(os,{onClick:P(U),value:U,children:[t.jsx(f.q,{iso2:U,size:"16px"}),t.jsx(ss,{children:ue}),t.jsx(I,{color:g.palette.gray[400],size:"md",textAlign:"end",children:"+"+M})]},U)})}),document.getElementById("modal-wrapper")??document.getElementById("root")??document.body)]})})},ls=({disabled:e=!1,error:n,helpLink:i,helpLinkText:r,helpText:o,isTouched:s,isValid:l,label:a,name:c="input-text",id:p,maskValue:d=!1,maxLength:g,onBlur:x,placeholder:h,register:b,required:m,rows:j,tooltip:w,watch:C,weight:k,value:v})=>{const z=y.useTheme(),S=(C==null?void 0:C(c))??v,T=l&&s&&!e,N=e?void 0:n;return t.jsx(J,{disabled:e,error:N,helpLink:i,helpLinkText:r,helpText:o,htmlFor:c,label:a,maxLength:g,required:m,tooltip:w,value:S?String(S):void 0,weight:k,children:t.jsxs(ie,{className:`
|
|
1769
1769
|
${e?"disabled":""} ${N?"error":""} ${T?"success":""}
|
|
1770
|
-
`,children:[t.jsx("textarea",{"aria-hidden":!1,"aria-invalid":N?"true":"false","aria-label":c,"aria-required":m,className:d?"sr-block":"","data-testid":`${c}-text-area`,disabled:e,id:p??c,maxLength:g,placeholder:h,rows:j,value:S,...b==null?void 0:b(c,{required:m,onBlur:x})}),N?t.jsx(R,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:z.palette.error[500],iconSize:"lg"}):void 0,T?t.jsx(R,{icon:"check-circle",iconClass:"success-icon",iconColor:z.palette.success[500],iconSize:"lg"}):void 0]})})},
|
|
1770
|
+
`,children:[t.jsx("textarea",{"aria-hidden":!1,"aria-invalid":N?"true":"false","aria-label":c,"aria-required":m,className:d?"sr-block":"","data-testid":`${c}-text-area`,disabled:e,id:p??c,maxLength:g,placeholder:h,rows:j,value:S,...b==null?void 0:b(c,{required:m,onBlur:x})}),N?t.jsx(R,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:z.palette.error[500],iconSize:"lg"}):void 0,T?t.jsx(R,{icon:"check-circle",iconClass:"success-icon",iconColor:z.palette.success[500],iconSize:"lg"}):void 0]})})},cs=({control:e,description:n,disabled:i,id:r,items:o,align:s,inputType:l="text",inputNumberProps:a,minHeight:c,minWidth:p,name:d,placeholder:g,textAlign:x,tooltip:h,title:b,value:m,isTouched:j,isValid:w,error:C,onChange:k,register:v,setValue:z,watch:S})=>{const T=u.useMemo(()=>{if(l==="text")return t.jsx(st,{disabled:i,error:C,isTouched:j,isValid:w,name:d,placeholder:g,register:v});if(l==="date")return t.jsx(An,{disabled:i,error:C,name:d,register:v,setValue:z,watch:S});if(l==="select"&&o)return t.jsx(It,{control:e,disabled:i,items:o,name:d,placeholder:g,value:m});const{decimalPlaces:N,max:E,min:D}=a??{};return t.jsx(Mn,{decimalPlaces:N,disabled:i,error:C,max:E,min:D,name:d,onChange:k,placeholder:g,register:v,setValue:z,value:m,watch:S})},[e,i,C,a,l,j,w,o,d,k,g,v,z,m,S]);return t.jsxs(so,{$align:s,$minHeight:c,$minWidth:p,children:[t.jsx(nt,{description:n,id:r,textAlign:x,title:b,tooltip:h}),T]})},_n=({options:e,title:n,checkboxesName:i,defaultBgColor:r,defaultCollapsed:o,onChange:s})=>{const l=y.useTheme(),[a,c]=u.useState(o??!1),p=u.useCallback(()=>{c(d=>!d)},[]);return t.jsxs($,{"aria-label":n,bgColor:a&&!r?l.palette.gray[50]:l.palette.white,border:"1px solid"+l.palette.gray[300],borderRadius:"8px",display:"inline-flex",flexDirection:"column",gap:.625,px:.75,py:.625,role:"region",width:"100%",children:[t.jsxs($,{alignItems:"center",cursor:"pointer",display:"flex",onClick:p,children:[t.jsx(I,{color:l.palette.gray[800],fontWeight:"bold",size:"md",children:n}),t.jsx(R,{icon:a?"chevron-up":"chevron-down",iconColor:l.palette.gray[400],iconSize:"lg"})]}),a?t.jsx($,{display:"flex",gap:.75,wrap:"wrap",children:e.map(d=>t.jsx($,{bgColor:l.palette.white,border:"1px solid",borderColor:l.palette.gray[300],borderRadius:l.spacing[.25],px:.5,py:.5,children:t.jsx(pe,{checked:d.visible,disabled:d.locked,label:d.name,name:`${i}-${d.name}`,onChange:s,value:d.name})},d.name))}):void 0]})},ds=y.styled.div`
|
|
1771
1771
|
display: flex;
|
|
1772
1772
|
align-self: flex-start;
|
|
1773
1773
|
margin-left: auto;
|
|
1774
1774
|
width: 40px;
|
|
1775
1775
|
height: auto;
|
|
1776
|
-
`,
|
|
1776
|
+
`,ps=y.styled.label`
|
|
1777
1777
|
${({theme:e})=>`
|
|
1778
1778
|
align-items: center;
|
|
1779
1779
|
display: flex;
|
|
@@ -1852,7 +1852,7 @@
|
|
|
1852
1852
|
}
|
|
1853
1853
|
|
|
1854
1854
|
`}
|
|
1855
|
-
`,
|
|
1855
|
+
`,gs=y.styled.span.attrs({className:"checkmark"})``,Nt=u.forwardRef(function({checked:n,disabled:i=!1,label:r,name:o,onChange:s,onClick:l,value:a,...c},p){return t.jsxs(ps,{"aria-disabled":i,"aria-label":r??o,role:"radiogroup",children:[t.jsx("input",{"aria-checked":n,"aria-disabled":i,"aria-label":r??o,checked:n,disabled:i,name:o,onChange:s,onClick:l,ref:p,type:"radio",value:a,...c}),t.jsx(gs,{}),r??null]})}),us=({alt:e,customDescription:n,imageId:i,icon:r,selectorProps:o,onClick:s,register:l,bgColor:a,title:c,isATag:p=!1,width:d="fit-content"})=>{const g=y.useTheme();return t.jsxs($,{alignItems:"center",bgColor:a??"",border:`1px solid ${g.palette.gray[200]}`,borderColorHover:g.palette.gray[600],borderRadius:g.spacing[.25],display:"inline-flex",pr:p?1:0,shadowHover:"md",width:d,children:[t.jsxs($,{display:"inline-flex",padding:[1,1,1,1],children:[t.jsx($,{alignSelf:"start",display:"flex",width:"fit-content",children:t.jsx(Nt,{defaultChecked:o.defaultChecked,name:o.name,onClick:s,value:o.value,...l==null?void 0:l(o.name)})}),t.jsxs($,{alignItems:"center",display:"flex",gap:.5,justify:"space-between",ml:1,mr:1,width:"100%",children:[!p&&i!==void 0&&t.jsx(oe,{alt:e??"card image",height:"32px",publicId:i,width:"32px"}),r===void 0?void 0:t.jsx(R,{icon:r,iconSize:"xl",iconType:"fa-light"}),t.jsxs($,{display:"flex",flexDirection:"column",width:"100%",children:[t.jsx(I,{color:g.palette.gray[800],fontWeight:"bold",size:"md",children:c}),n===void 0?void 0:t.jsx($,{children:n})]})]})]}),p&&t.jsx(ds,{children:t.jsx(oe,{alt:e??"tag image",height:"40px",publicId:i??"tag image",width:"40px"})})]})},ne=y.styled.div`
|
|
1856
1856
|
${({theme:e})=>`
|
|
1857
1857
|
align-items: center;
|
|
1858
1858
|
background-color: ${e.palette.gray[200]};
|
|
@@ -1864,7 +1864,7 @@
|
|
|
1864
1864
|
transition: 0.2s;
|
|
1865
1865
|
width: 44px;
|
|
1866
1866
|
`}
|
|
1867
|
-
`,xe=
|
|
1867
|
+
`,xe=y.styled.div`
|
|
1868
1868
|
${({theme:e})=>`
|
|
1869
1869
|
align-items: center;
|
|
1870
1870
|
background-color: ${e.palette.white};
|
|
@@ -1879,7 +1879,7 @@
|
|
|
1879
1879
|
width: ${e.spacing[1.25]};
|
|
1880
1880
|
z-index: 1;
|
|
1881
1881
|
`}
|
|
1882
|
-
`,
|
|
1882
|
+
`,xs=y.styled.label`
|
|
1883
1883
|
display: inline-block;
|
|
1884
1884
|
|
|
1885
1885
|
input {
|
|
@@ -1932,7 +1932,7 @@
|
|
|
1932
1932
|
background-color: ${({theme:e})=>e.palette.gray[200]};
|
|
1933
1933
|
border: 1px solid ${({theme:e})=>e.palette.gray[400]};
|
|
1934
1934
|
}
|
|
1935
|
-
`,te=
|
|
1935
|
+
`,te=y.styled.div`
|
|
1936
1936
|
align-items: center;
|
|
1937
1937
|
border: 1px solid transparent;
|
|
1938
1938
|
border-radius: 16px;
|
|
@@ -1943,7 +1943,7 @@
|
|
|
1943
1943
|
position: relative;
|
|
1944
1944
|
transition: 0.2s;
|
|
1945
1945
|
width: 51px;
|
|
1946
|
-
`,fe=
|
|
1946
|
+
`,fe=y.styled.div`
|
|
1947
1947
|
${({theme:e})=>`
|
|
1948
1948
|
align-items: center;
|
|
1949
1949
|
background-color: ${e.palette.white};
|
|
@@ -1959,7 +1959,7 @@
|
|
|
1959
1959
|
width: 20px;
|
|
1960
1960
|
z-index: 2;
|
|
1961
1961
|
`}
|
|
1962
|
-
`,
|
|
1962
|
+
`,Ke=y.styled.span`
|
|
1963
1963
|
font-size: 12px;
|
|
1964
1964
|
font-weight: 700;
|
|
1965
1965
|
letter-spacing: 0.5px;
|
|
@@ -1968,7 +1968,7 @@
|
|
|
1968
1968
|
text-transform: uppercase;
|
|
1969
1969
|
transition: 0.2s;
|
|
1970
1970
|
z-index: 1;
|
|
1971
|
-
`,
|
|
1971
|
+
`,hs=y.styled.label`
|
|
1972
1972
|
display: inline-block;
|
|
1973
1973
|
|
|
1974
1974
|
input {
|
|
@@ -1995,12 +1995,12 @@
|
|
|
1995
1995
|
color: ${({theme:e})=>e.palette.success[500]};
|
|
1996
1996
|
}
|
|
1997
1997
|
|
|
1998
|
-
input:checked + ${te} > ${
|
|
1998
|
+
input:checked + ${te} > ${Ke} {
|
|
1999
1999
|
color: ${({theme:e})=>e.palette.white};
|
|
2000
2000
|
left: 3px;
|
|
2001
2001
|
}
|
|
2002
2002
|
|
|
2003
|
-
input:not(:checked):not(:disabled) + ${te} > ${
|
|
2003
|
+
input:not(:checked):not(:disabled) + ${te} > ${Ke} {
|
|
2004
2004
|
color: ${({theme:e})=>e.palette.gray[500]};
|
|
2005
2005
|
right: 6px;
|
|
2006
2006
|
}
|
|
@@ -2023,26 +2023,26 @@
|
|
|
2023
2023
|
color: ${({theme:e})=>e.palette.white};
|
|
2024
2024
|
}
|
|
2025
2025
|
|
|
2026
|
-
input:disabled + ${te} > ${
|
|
2026
|
+
input:disabled + ${te} > ${Ke} {
|
|
2027
2027
|
color: ${({theme:e})=>e.palette.gray[400]};
|
|
2028
2028
|
right: 6px;
|
|
2029
2029
|
}
|
|
2030
|
-
`,Hn=u.forwardRef(function({defaultChecked:n,disabled:i=!1,variant:r="default",icon:o=!1,justify:
|
|
2030
|
+
`,Hn=u.forwardRef(function({defaultChecked:n,disabled:i=!1,variant:r="default",icon:o=!1,justify:s,name:l,leftText:a,leftTextMinWidth:c,rightText:p,tooltip:d,tooltipPlace:g,onChange:x,...h},b){const m=n===!0?"on":"off",j=typeof a=="object"&&a.on&&a.off?a[m]:a,w=u.useCallback(v=>{v.stopPropagation()},[]),C=()=>r==="inline"?t.jsxs(hs,{onClick:w,role:"switch",children:[t.jsx("input",{...h,"aria-disabled":i,"aria-label":l,checked:n===!0,disabled:i,name:l,onChange:x,ref:b,type:"checkbox"}),t.jsxs(te,{"aria-label":"Toggle Switch",id:`${l}Toggle`,children:[t.jsx(fe,{children:n?t.jsx(R,{icon:"check",iconSize:"sm"}):t.jsx(R,{icon:"times",iconSize:"sm"})}),t.jsx(Ke,{children:n?"YES":"NO"})]})]}):t.jsxs(xs,{onClick:w,role:"switch",children:[t.jsx("input",{...h,"aria-disabled":i,"aria-label":l,checked:n===!0,disabled:i,name:l,onChange:x,ref:b,type:"checkbox"}),t.jsx(ne,{"aria-label":"Toggle Switch",id:`${l}Toggle`,children:t.jsx(xe,{children:o?t.jsx(R,{icon:n?"check":"times",iconSize:"md"}):void 0})})]}),k=()=>{const v=C();return i&&d?t.jsx(Z,{id:`${l}-tooltip`,place:g,tip:d,children:v}):v};return r==="inline"?t.jsxs($,{alignItems:"center",display:"flex",fontSize:"14px",gap:.75,justify:s,children:[t.jsx($,{minWidth:c,children:j}),k(),p]}):t.jsxs($,{alignItems:"center",display:"flex",fontSize:"14px",gap:.75,justify:s,children:[t.jsx($,{minWidth:c,children:j}),k(),p]})}),fs=({id:e,title:n,toggles:i,minWidth:r="auto",height:o="auto"})=>{const s=y.useTheme();return t.jsxs($,{alignItems:"center",bgColor:s.palette.white,border:`1px solid ${s.palette.gray[200]}`,borderRadius:s.spacing[.25],display:"flex",flexDirection:"column",gap:.5,height:o,justify:"center",minHeight:"100px",minWidth:r,padding:[1.25,1.25,1.25,1.25],children:[t.jsx(nt,{id:e,title:n}),t.jsx($,{display:"flex",flexDirection:"column",gap:.5,minHeight:"40px",width:"100%",children:i.map(l=>t.jsx(Hn,{...l},`$card-toggle-${l.name}`))})]})},ys=({description:e,height:n="auto",leftIconName:i,children:r,rightIconName:o,title:s,tooltipId:l,tooltipTip:a,tooltipPlace:c="bottom",variant:p="centered",width:d="318px"})=>{const g=y.useTheme(),x=p==="centered",h=l&&a?t.jsx(Z,{display:"flex",icon:o??i,iconColor:g.palette.gray[800],id:l,place:c,tip:a}):void 0;return t.jsxs($,{alignItems:x?"center":"flex-start",bgColor:g.palette.gray[50],border:`1px solid ${g.palette.gray[200]}`,borderRadius:"4px",display:"inline-flex",flexDirection:x?"column":"column-reverse",gap:.5,height:n,justify:"center",padding:[1.25,1.25,1.25,1.25],width:d,children:[t.jsxs($,{alignItems:"center",display:"flex",gap:.5,children:[x||f.isUndefined(i)?void 0:h,t.jsx(I,{color:x?g.palette.gray[800]:g.palette.gray[400],size:"md",textAlign:x?"center":"start",children:e}),x||f.isUndefined(o)?void 0:h]}),t.jsxs($,{alignItems:"center",display:"flex",gap:.5,children:[x&&!f.isUndefined(i)?h:void 0,t.jsxs("div",{style:{display:"flex",gap:"12px"},children:[f.isUndefined(s)?void 0:t.jsx(G,{fontWeight:"bold",size:"sm",children:s}),r]}),x&&!f.isUndefined(o)?h:void 0]})]})},bs=.5,an=1.25,$s=({children:e,bgColor:n,border:i,gap:r=bs,px:o=an,py:s=an,...l})=>{const a=y.useTheme();return t.jsx($,{bgColor:n??a.palette.white,border:i??`1px solid ${a.palette.gray[200]}`,borderRadius:"4px",display:"inline-flex",flexDirection:"column",gap:r,px:o,py:s,...l,children:e})},ms=y.styled.div`
|
|
2031
2031
|
position: relative;
|
|
2032
2032
|
margin: auto;
|
|
2033
2033
|
overflow: hidden;
|
|
2034
|
-
|
|
2034
|
+
`,js=y.styled.div`
|
|
2035
2035
|
display: flex;
|
|
2036
2036
|
transition: transform 0.5s ease-in-out;
|
|
2037
2037
|
transform: translateX(
|
|
2038
2038
|
${({$currentIndex:e})=>-e*100}%
|
|
2039
2039
|
);
|
|
2040
|
-
`,
|
|
2040
|
+
`,ws=y.styled.div`
|
|
2041
2041
|
align-items: center;
|
|
2042
2042
|
display: flex;
|
|
2043
2043
|
justify-content: center;
|
|
2044
2044
|
min-width: 100%;
|
|
2045
|
-
`,
|
|
2045
|
+
`,vs=y.styled.button`
|
|
2046
2046
|
${({theme:e,$isActive:n})=>`
|
|
2047
2047
|
background-color: ${n?e.palette.primary[400]:e.palette.white};
|
|
2048
2048
|
border: none;
|
|
@@ -2051,13 +2051,13 @@
|
|
|
2051
2051
|
height: ${e.spacing[.75]};
|
|
2052
2052
|
width: ${e.spacing[.75]};
|
|
2053
2053
|
`}
|
|
2054
|
-
`,
|
|
2054
|
+
`,ks=y.styled.div`
|
|
2055
2055
|
align-items: center;
|
|
2056
2056
|
display: flex;
|
|
2057
2057
|
gap: ${({theme:e})=>e.spacing[.5]};
|
|
2058
2058
|
justify-content: center;
|
|
2059
2059
|
margin-top: ${({theme:e})=>e.spacing[2]};
|
|
2060
|
-
`,
|
|
2060
|
+
`,Cs=({slides:e,interval:n=300})=>{const{cycle:i,setCycle:r,setProgress:o}=jn(n,e.length),s=u.useCallback(l=>()=>{r(l),o(0)},[r,o]);return t.jsxs(ms,{"aria-roledescription":"carousel",children:[t.jsx(js,{$currentIndex:i,children:e.map((l,a)=>{const c=`slide-${a}`;return t.jsx(ws,{"aria-label":c,"aria-roledescription":"slide",children:l.content},c)})}),t.jsx(ks,{children:e.map((l,a)=>{const c=`nav-button-${a}`;return t.jsx(vs,{$isActive:a===i,"aria-label":`Go to slide ${a+1}`,"data-testid":a===i?"active":"inactive",onClick:s(a)},c)})})]})},Vn=y.styled.div`
|
|
2061
2061
|
${({theme:e})=>`
|
|
2062
2062
|
background-color: ${e.palette.gray[100]};
|
|
2063
2063
|
border-radius: ${e.spacing[.25]};
|
|
@@ -2133,7 +2133,7 @@
|
|
|
2133
2133
|
padding-bottom: unset;
|
|
2134
2134
|
}
|
|
2135
2135
|
`}
|
|
2136
|
-
`,
|
|
2136
|
+
`,Ss=y.styled.div`
|
|
2137
2137
|
${({theme:e})=>`
|
|
2138
2138
|
align-items: end;
|
|
2139
2139
|
background-color: ${e.palette.gray[100]};
|
|
@@ -2148,10 +2148,10 @@
|
|
|
2148
2148
|
background-color: ${e.palette.gray[200]};
|
|
2149
2149
|
}
|
|
2150
2150
|
`}
|
|
2151
|
-
`,Un=({noCodeMessage:e="Code snippet not available",snippet:n,specific:i})=>(u.useEffect(()=>{
|
|
2152
|
-
`);return m.length>8&&!
|
|
2151
|
+
`,Un=({noCodeMessage:e="Code snippet not available",snippet:n,specific:i})=>(u.useEffect(()=>{f.prismExports.highlightAll()},[]),t.jsx(Vn,{"data-private":!0,children:t.jsx("pre",{className:"line-highlight","data-line-offset":f._.isNil(n)||f._.isString(n)?0:n.offset+.7,...i!==void 0?{"data-line":String(Number(i))}:{},children:f._.isNil(n)||f._.isString(n)||f._.isEmpty(n.content)?t.jsx("div",{className:"no-data",children:t.jsx("p",{children:e})}):t.jsx("code",{className:"language-none",children:n.content})})})),zs=({minWidth:e="565px",noCodeMessage:n="Code snippet not available",snippet:i,specific:r,variant:o="normal",expanded:s=!1})=>{const l=y.useTheme(),[a,c]=u.useState(!1),[p,d]=u.useState(!0),g=u.useCallback(()=>{c(m=>!m)},[c]),x=u.useCallback(()=>{if(f._.isNil(i)||f._.isEmpty(i)||!f._.isString(i))return d(!1),n;const m=i.split(`
|
|
2152
|
+
`);return m.length>8&&!a?`${[...m].splice(0,7).join(`
|
|
2153
2153
|
`)}
|
|
2154
|
-
${m[8]}...`:(m.length<8&&d(!1),i)},[
|
|
2154
|
+
${m[8]}...`:(m.length<8&&d(!1),i)},[a,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(async()=>{await navigator.clipboard.writeText(h)},[h]);return o==="location"?t.jsx(Un,{noCodeMessage:n,snippet:i,specific:r}):t.jsxs($,{bgColor:l.palette.gray[100],borderRadius:"4px",display:"inline-flex",justify:s?"space-between":"center",minWidth:e,position:"relative",px:1,py:1,scroll:"x",width:s?"100%":"fit-content",children:[t.jsx(Vn,{"data-private":!0,children:t.jsx("pre",{children:t.jsx("code",{className:"language-none",children:h})})}),t.jsxs(Ss,{children:[t.jsx(V,{height:l.spacing[2.5],icon:"copy",iconColor:l.palette.gray[700],iconSize:"lg",iconType:"fa-light",onClick:b,variant:"ghost",width:l.spacing[2.5]}),p?t.jsxs(_,{onClick:g,variant:"ghost",children:[a?"Show Less":"Show more",t.jsx(R,{icon:a?"chevron-up":"chevron-down",iconColor:l.palette.gray[700],iconSize:"sm",iconType:"fa-light",ml:.25,onClick:b})]}):!1]})]})},{getVariant:Ts}=ae(e=>({fixed:`
|
|
2155
2155
|
height: auto;
|
|
2156
2156
|
min-width: 300px;
|
|
2157
2157
|
padding: ${e.spacing[1.25]};
|
|
@@ -2174,13 +2174,13 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2174
2174
|
@media screen and (min-width: ${e.breakpoints.sm}) {
|
|
2175
2175
|
width: 32%;
|
|
2176
2176
|
}
|
|
2177
|
-
`})),Gn=
|
|
2177
|
+
`})),Gn=y.styled.div.attrs({className:"comp-modal fixed inset-0 overflow-auto"})`
|
|
2178
2178
|
align-items: center;
|
|
2179
2179
|
background-color: ${({$bgColor:e="rgb(52 64 84 / 70%)"})=>e};
|
|
2180
2180
|
display: flex;
|
|
2181
2181
|
justify-content: center;
|
|
2182
2182
|
z-index: 99999;
|
|
2183
|
-
`,At=
|
|
2183
|
+
`,At=y.styled($)`
|
|
2184
2184
|
${({theme:e,$size:n})=>`
|
|
2185
2185
|
background-color: ${e.palette.white};
|
|
2186
2186
|
border: 1px solid ${e.palette.gray[200]};
|
|
@@ -2195,9 +2195,9 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2195
2195
|
margin: auto;
|
|
2196
2196
|
white-space: pre-line;
|
|
2197
2197
|
|
|
2198
|
-
${
|
|
2198
|
+
${Ts(e,n)}
|
|
2199
2199
|
`}
|
|
2200
|
-
`,
|
|
2200
|
+
`,Is=y.styled.div`
|
|
2201
2201
|
${({theme:e})=>`
|
|
2202
2202
|
background-color: ${e.palette.white};
|
|
2203
2203
|
border-radius: 0 0 ${e.spacing[.25]} ${e.spacing[.25]};
|
|
@@ -2225,7 +2225,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2225
2225
|
}
|
|
2226
2226
|
}
|
|
2227
2227
|
`}
|
|
2228
|
-
`,
|
|
2228
|
+
`,Ds=y.styled.div`
|
|
2229
2229
|
border-radius: ${({theme:e})=>`${e.spacing[.25]} ${e.spacing[.25]} 0 0`};
|
|
2230
2230
|
display: block;
|
|
2231
2231
|
overflow: unset;
|
|
@@ -2235,7 +2235,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2235
2235
|
padding: ${({theme:e})=>`${e.spacing[1.25]}`};
|
|
2236
2236
|
padding-bottom: ${({theme:e})=>`${e.spacing[1.5]}`};
|
|
2237
2237
|
position: sticky;
|
|
2238
|
-
`,
|
|
2238
|
+
`,Es=y.styled.div.attrs({className:"flex items-center justify-between"})``,Fs=y.styled.div`
|
|
2239
2239
|
${({theme:e})=>`
|
|
2240
2240
|
border-radius: 0 0 ${e.spacing[.25]} ${e.spacing[.25]};
|
|
2241
2241
|
display: flex;
|
|
@@ -2266,7 +2266,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2266
2266
|
margin-right: 0;
|
|
2267
2267
|
}
|
|
2268
2268
|
`}
|
|
2269
|
-
`,
|
|
2269
|
+
`,Rs=y.styled.div`
|
|
2270
2270
|
img {
|
|
2271
2271
|
margin: 0 calc(-${({theme:e})=>e.spacing[1.25]} - 1px)
|
|
2272
2272
|
${({theme:e})=>e.spacing[1.25]};
|
|
@@ -2282,11 +2282,11 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2282
2282
|
margin-right: 0;
|
|
2283
2283
|
`:""}
|
|
2284
2284
|
}
|
|
2285
|
-
`,Yn=({alert:e,modalRef:n,confirmButton:i=void 0,cancelButton:r=void 0})=>{const{close:o}=n,
|
|
2285
|
+
`,Yn=({alert:e,modalRef:n,confirmButton:i=void 0,cancelButton:r=void 0})=>{const{close:o}=n,s=u.useCallback(()=>{r!=null&&r.onClick&&r.onClick(),o()},[r,o]),l=u.useCallback(()=>{i!=null&&i.onClick&&i.onClick(),o()},[i,o]);return[i,r].some(c=>!f.lodashExports.isEmpty(c))?t.jsxs($,{display:"flex",flexDirection:"column",gap:.625,position:"sticky",px:1.25,py:1.25,children:[e,t.jsx(Fs,{children:t.jsxs("div",{children:[r&&t.jsx(_,{id:r.id,onClick:s,variant:"tertiary",width:"100%",children:r.text}),i&&t.jsx(_,{id:i.id,onClick:l,variant:"primary",width:"100%",children:i.text})]})})]}):null},Xn=({title:e,description:n,modalRef:i,otherActions:r,onClose:o})=>{const s=y.useTheme(),l=u.useCallback(()=>{o==null||o(),i.close()},[i,o]);return u.useEffect(()=>{const a=c=>{c.key==="Escape"&&l()};return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[l]),t.jsxs(Ds,{children:[t.jsxs(Es,{children:[typeof e=="string"?t.jsx(G,{fontWeight:"bold",mr:1,size:"sm",wordBreak:"break-word",children:e}):e,t.jsxs("div",{className:"items-center flex gap-3",children:[r,t.jsx(V,{icon:"close",iconColor:s.palette.gray[400],iconSize:"lg",iconTransform:"grow-2",iconType:"fa-light",id:"modal-close",onClick:l,px:.25,py:.25,variant:"ghost"})]})]}),n&&f.lodashExports.isString(n)&&!f.lodashExports.isEmpty(n)?t.jsx(I,{mt:.5,size:"md",children:n}):void 0,n&&!f.lodashExports.isString(n)&&t.jsx(be,{display:"block",mt:.5,size:"md",children:n})]})},Kn=({disabled:e,id:n="modal-confirm",onCancel:i,onConfirm:r="submit",txtCancel:o,txtConfirm:s})=>{const l=r==="submit";return t.jsxs($,{display:"flex",gap:.75,id:"footer",maxWidth:i?"392px":"190px",mt:1.5,children:[i?t.jsx(_,{id:`${n}-cancel`,justify:"center",onClick:i,variant:"tertiary",width:"100%",children:o??"Cancel"}):void 0,t.jsx(_,{disabled:e,id:n,justify:"center",onClick:l?void 0:r,type:l?"submit":"button",variant:"primary",width:"100%",children:s??"Confirm"})]})},Ns=(e,n,i)=>i?n==="secondary"?`3px solid ${e.palette.primary[100]}`:`3px solid ${e.palette.primary[500]}`:"unset",As=y.styled.div`
|
|
2286
2286
|
display: flex;
|
|
2287
2287
|
flex-direction: row;
|
|
2288
2288
|
gap: ${({theme:e})=>e.spacing[.25]};
|
|
2289
|
-
border-bottom: ${({theme:e,$borderButton:n,$variant:i})=>
|
|
2289
|
+
border-bottom: ${({theme:e,$borderButton:n,$variant:i})=>Ns(e,i,n)};
|
|
2290
2290
|
align-items: center;
|
|
2291
2291
|
padding: ${({theme:e})=>e.spacing[.625]}
|
|
2292
2292
|
${({theme:e})=>e.spacing[.5]};
|
|
@@ -2325,7 +2325,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2325
2325
|
}
|
|
2326
2326
|
}
|
|
2327
2327
|
}
|
|
2328
|
-
`,Zn=({end:e=!1,label:n,id:i,isActive:r=!1,link:o,notificationSign:
|
|
2328
|
+
`,Zn=({end:e=!1,label:n,id:i,isActive:r=!1,link:o,notificationSign:s,onClick:l,tooltip:a="",variant:c="primary",tag:p})=>{const{pathname:d}=pt.useLocation(),g=r||(c==="primary"?d.includes(o):d.endsWith(o));return t.jsx(Z,{display:"flex",id:`${i}-tooltip`,tip:a,children:t.jsxs(As,{$borderButton:g,$variant:c,children:[t.jsx(pt.NavLink,{end:e,id:i,onClick:l,to:o,children:n}),t.jsx(Ze,{left:s==null?void 0:s.left,numberIndicator:s==null?void 0:s.numberIndicator,show:s==null?void 0:s.show,top:s==null?void 0:s.top,variant:s==null?void 0:s.variant}),p===void 0?null:t.jsx(q,{tagLabel:`${p}`,variant:"default"})]})})},Lt=({items:e,borders:n=!0,box:i=!1,variant:r="primary"})=>{const o=y.useTheme();return t.jsx($,{alignItems:"center",bgColor:o.palette.white,border:i?"1px solid":void 0,borderBottom:n?`1px solid ${o.palette.gray[300]}`:void 0,borderColor:i?o.palette.gray[200]:void 0,borderRadius:i?o.spacing[.25]:void 0,display:"inline-flex",gap:.25,id:"tablist",padding:i?[0,0,0,0]:void 0,pl:n?1.25:void 0,pr:n?1.25:void 0,role:"tablist",width:i?"max-content":"100%",children:e.map(({end:s,id:l,isActive:a,link:c,label:p,notificationSign:d,onClick:g,tag:x,tooltip:h})=>t.jsx(Zn,{end:s,id:l,isActive:a,label:p,link:c,notificationSign:d,onClick:g,tag:x,tooltip:h,variant:r},l))})},me=u.forwardRef(function({color:n=A.palette.gray[100],mt:i=.5,mb:r=.5,width:o,...s},l){return t.jsx($,{as:"hr",borderTop:`1px solid ${n}`,mb:r,mt:i,ref:l,width:o??"100%",...s})}),Ls=y.styled.li`
|
|
2329
2329
|
${({theme:e})=>`
|
|
2330
2330
|
align-items: center;
|
|
2331
2331
|
background-color: ${e.palette.white};
|
|
@@ -2372,7 +2372,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2372
2372
|
background-color: ${e.palette.gray[100]};
|
|
2373
2373
|
}
|
|
2374
2374
|
`}
|
|
2375
|
-
`,qn=
|
|
2375
|
+
`,qn=y.styled.ul`
|
|
2376
2376
|
${({theme:e})=>`
|
|
2377
2377
|
background-color: ${e.palette.white};
|
|
2378
2378
|
border: 1px solid ${e.palette.gray[200]};
|
|
@@ -2383,7 +2383,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2383
2383
|
min-width: 240px;
|
|
2384
2384
|
padding: ${e.spacing[.25]} 0 ${e.spacing[.25]} 0;
|
|
2385
2385
|
`}
|
|
2386
|
-
`,He=({children:e,disabled:n=!1,icon:i,iconType:r="fa-light",href:o,onClick:
|
|
2386
|
+
`,He=({children:e,disabled:n=!1,icon:i,iconType:r="fa-light",href:o,onClick:s,onClickIcon:l,onKeyDown:a,rightIcon:c,selected:p=!1,value:d,...g})=>{const h=y.useTheme().palette.gray[n?300:800],b=n?u.Children.map(e,m=>u.isValidElement(m)?u.cloneElement(m,{disabled:n,...m.props}):m):e;return t.jsxs(Ls,{"aria-disabled":n,"aria-label":d,"aria-selected":p,"data-testid":d,onClick:s,onKeyDown:a,value:d,...g,children:[i!==void 0||d!==void 0?t.jsxs($,{alignItems:"center",display:"flex",gap:.625,children:[i?t.jsx(R,{disabled:n,icon:i,iconColor:h,iconSize:"sm",iconType:r}):null,o===void 0?b:t.jsx(le,{href:o,children:b})]}):null,p||c?t.jsx(R,{disabled:n,icon:c??"check",iconClass:"selected",iconColor:h,iconSize:"lg",iconType:r,onClick:l}):null]})},Ps=y.styled(He)`
|
|
2387
2387
|
margin-top: 10px;
|
|
2388
2388
|
border: 1px solid ${({theme:e})=>e.palette.gray[300]};
|
|
2389
2389
|
border-radius: 4px;
|
|
@@ -2406,7 +2406,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2406
2406
|
border: 2px solid ${n.palette.black};
|
|
2407
2407
|
background-color: ${n.palette.white} !important;
|
|
2408
2408
|
`:""}
|
|
2409
|
-
`,Jn=({items:e,onReorder:n,title:i,description:r,onClickClose:o})=>{const[
|
|
2409
|
+
`,Jn=({items:e,onReorder:n,title:i,description:r,onClickClose:o})=>{const[s,l]=u.useState(null),a=u.useCallback(g=>()=>{o(g)},[o]),c=u.useCallback(g=>{l(g.name)},[]),p=u.useCallback(()=>{l(null)},[]),d=u.useCallback(g=>()=>{c(g)},[c]);return t.jsxs(f.ReorderGroup,{as:"div",axis:"y",layoutScroll:!0,onReorder:n,style:{height:"max-content",padding:"1.25rem 0",width:"45%"},values:e,children:[t.jsxs($,{display:"flex",gap:.25,children:[t.jsx(G,{display:"flex",size:"xs",children:i}),t.jsx(q,{priority:"high",tagLabel:String(e.filter(g=>g.visible).length),variant:"error"})]}),t.jsx(I,{size:"md",children:r}),e.map(g=>g.visible?t.jsx(f.ReorderItem,{as:"div",dragListener:!g.locked,onDragEnd:p,onDragStart:d(g),style:{zIndex:s===g.name?9999:"auto",position:s===g.name?"relative":"static"},value:g,children:t.jsx(Ps,{$isDragging:s===g.name,disabled:g.locked,icon:"grip-vertical",iconType:"fa-light",label:g.name,onClickIcon:g.locked?void 0:a(g.id),rightIcon:g.locked?"lock":"close",selected:g.visible,value:g.name,children:g.name})},g.name):void 0)]})},Os=y.styled(He)`
|
|
2410
2410
|
padding: 7px 8px;
|
|
2411
2411
|
|
|
2412
2412
|
&[aria-selected="true"] {
|
|
@@ -2422,24 +2422,24 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2422
2422
|
display: none;
|
|
2423
2423
|
}
|
|
2424
2424
|
}
|
|
2425
|
-
`,Pt=e=>e.reduce((i,r)=>r.group?i[r.group]?{...i,[r.group]:[...i[r.group],r]}:{...i,[r.group]:[r]}:i,{}),
|
|
2425
|
+
`,Pt=e=>e.reduce((i,r)=>r.group?i[r.group]?{...i,[r.group]:[...i[r.group],r]}:{...i,[r.group]:[r]}:i,{}),Bs=300,ge=({name:e,onClear:n,onChange:i,value:r,maxLength:o=Bs,...s})=>{const l=u.useRef(null),a=y.useTheme(),[c,p]=u.useState(r??"");u.useEffect(()=>{p(r??"")},[r]);const d=u.useCallback(b=>{b.key==="Enter"&&b.preventDefault()},[]),g=u.useCallback(b=>{const m=b.target.value;if(m.length>o){const j=m.slice(0,o);p(j);return}p(m),i==null||i(b)},[i,o]),x=u.useCallback(()=>{p(""),n==null||n(),i&&i({target:{value:""},currentTarget:{value:""}})},[n,i]),h=!f.lodashExports.isEmpty(c);return t.jsx(J,{htmlFor:e??"",children:t.jsxs(ie,{children:[t.jsx(R,{icon:"magnifying-glass",iconColor:a.palette.gray[700],iconSize:"lg",iconType:"fa-light"}),t.jsx("input",{"aria-label":e,id:e,maxLength:o,name:e,onChange:g,onKeyDown:d,ref:l,type:"search",value:c,...s}),t.jsx("span",{style:{visibility:h?"visible":"hidden",margin:0},children:t.jsx(V,{icon:"xmark",iconColor:a.palette.gray[400],iconSize:"lg",iconType:"fa-light",onClick:x,px:.25,py:.25,type:"reset",variant:"ghost"})})]})})},Qn=({columns:e,formId:n,onChangeHandler:i,variant:r})=>{const o=u.useRef(null),[s,l]=u.useState([]),[a,c]=u.useState(""),p=u.useCallback(g=>{const{value:x}=g.target;c(x)},[]),d=u.useCallback(()=>{o.current&&(o.current.reset(),c(""))},[o]);return u.useEffect(()=>{l(e.filter(g=>{var x;return r==="grouped"?g.name.toLowerCase().includes(a.toLowerCase())||((x=g.group)==null?void 0:x.includes(a.toLowerCase())):g.name.toLowerCase().includes(a.toLowerCase())}))},[e,a,r]),r==="grouped"?t.jsxs($,{display:"flex",flexDirection:"column",gap:.625,height:"100%",id:"columns-buttons",py:1.25,width:"55%",children:[t.jsx("form",{id:"search-form",ref:o,children:t.jsx(ge,{name:"search",onChange:p,onClear:d,value:a})}),t.jsx("form",{"data-testid":n,id:n,onReset:d,style:{display:"flex",flexDirection:"column",gap:"0.625rem"},children:Object.entries(Pt(s)).map(([g,x],h)=>{const b=`li-checkbox${g}`;return t.jsx(_n,{checkboxesName:g,defaultBgColor:!0,defaultCollapsed:h===0,onChange:i,options:x,title:g},b)})})]}):t.jsxs($,{height:"100%",id:"columns-buttons",py:1.25,width:"55%",children:[t.jsx("form",{id:"search-form",ref:o,children:t.jsx(ge,{name:"search",onChange:p,onClear:d,value:a})}),t.jsx("form",{"data-testid":n,id:n,onReset:d,style:{paddingTop:"0.625rem"},children:s.map(g=>{const x=`li-checkbox-${g.name}`;return t.jsx(Os,{selected:g.visible,value:x,width:"content",children:t.jsx(pe,{checked:g.visible,disabled:g.locked,label:g.name,name:g.name,onChange:i,value:g.name})},x)})})]})},ei=({_containerId:e="portals",title:n,modalRef:i,variant:r})=>{const o=y.useTheme(),s=u.useRef(null),[l,a]=u.useState(void 0),c=u.useCallback(g=>{const{checked:x,value:h}=g.target,b=i.columns.map(m=>{var j;return m.name===h?((j=m.toggleVisibility)==null||j.call(m,x),{...m,visible:x}):m});i.setColumns(b)},[i]),p=u.useCallback(g=>{const x=i.columns.map(h=>{var b;return h.id===g?((b=h.toggleVisibility)==null||b.call(h,!1),{...h,visible:!1}):h});i.setColumns(x)},[i]),d=u.useCallback(()=>{var x;const g=(x=s.current)==null?void 0:x.scrollHeight;l!==g&&a(g)},[l]);return i.isOpen?je.createPortal(t.jsx(Gn,{"aria-label":i.name,"aria-modal":"true",children:t.jsxs(At,{$size:"md",flexDirection:"column",children:[t.jsxs($,{display:"flex",justify:"space-between",px:1.25,py:1.25,children:[t.jsx(G,{size:"sm",children:n}),t.jsx(V,{icon:"close",iconColor:o.palette.gray[400],iconSize:"lg",iconTransform:"grow-2",iconType:"fa-light",id:"modal-close",onClick:i.close,px:.25,py:.25,variant:"ghost"})]}),t.jsx(me,{mb:0,mt:0}),t.jsxs($,{display:"flex",gap:1.25,onScroll:d,px:1.25,ref:s,scroll:"y",width:"100%",children:[t.jsx(Qn,{columns:i.columns,formId:"columns-visibility",onChangeHandler:c,variant:r}),t.jsx($,{borderLeft:`2px solid ${o.palette.gray[100]}`,height:l?`${l}px`:"auto"}),t.jsx(Jn,{description:"Click and drag to reorder the columns",items:i.columns,onClickClose:p,onReorder:i.setColumns,title:"Reorder columns"})]}),t.jsx(me,{mb:0,mt:0}),t.jsxs($,{display:"flex",justify:"space-between",px:1.25,py:1.25,children:[t.jsx(_,{disabled:!i.hasChanged,form:"columns-visibility",id:"columns-modal-cancel",justify:"center",onClick:i.resetToDefault,type:"reset",variant:"tertiary",children:"Reset to default"}),t.jsx(_,{id:"columns-modal-submit",justify:"center",onClick:i.close,variant:"primary",children:"Save"})]})]})}),document.getElementById(e)??document.body):t.jsx("div",{})},Ws=y.styled(He)`
|
|
2426
2426
|
padding: 8px;
|
|
2427
2427
|
min-height: 36px;
|
|
2428
2428
|
min-width: unset;
|
|
2429
|
-
`,
|
|
2429
|
+
`,Ms=(e,n)=>{var i,r,o,s,l;n("checkbox",e.filter(a=>a.type==="checkboxes").flatMap(a=>{var c;return((c=a.options)==null?void 0:c.filter(p=>p.checked).map(p=>p.value))??[]})),n("radio",((o=(r=(i=e.find(a=>a.type==="radioButton"))==null?void 0:i.options)==null?void 0:r.find(({checked:a})=>a))==null?void 0:o.value)??""),n("text",e.filter(a=>["text","select"].includes(a.type)).reduce((a,c)=>({...a,[`${String(c.key)}-${c.filterFn??"caseInsensitive"}`]:c.value??""}),{})),n("minValue",(s=e.find(a=>["numberRange","dateRange"].includes(a.type)))==null?void 0:s.minValue),n("maxValue",(l=e.find(a=>["numberRange","dateRange"].includes(a.type)))==null?void 0:l.maxValue)},ln=(e,n)=>(e==null?void 0:e.filter(i=>{var r;return((r=i.label)==null?void 0:r.toLowerCase().includes((n==null?void 0:n.toLowerCase())??""))??i.value.toLowerCase().includes((n==null?void 0:n.toLowerCase())??"")}))??[],cn=50,_s=(e,n,i)=>{const r=e.filter((p,d,g)=>g.findIndex(x=>x.value===p.value)===d);if(r.length<=cn)return n.trim()?ln(r,n):r;const o=r.filter(p=>i.includes(p.value)),s=r.filter(p=>!i.includes(p.value)),l=n.trim()?ln(s,n):s,a=cn-o.length,c=l.slice(0,Math.max(0,a));return[...o,...c]},Hs=y.styled.div.attrs({className:"comp-modal absolute top-[55px] overflow-auto"})`
|
|
2430
2430
|
align-items: center;
|
|
2431
2431
|
background-color: ${({$bgColor:e="rgb(52 64 84 / 70%)"})=>e};
|
|
2432
2432
|
display: flex;
|
|
2433
2433
|
justify-content: center;
|
|
2434
2434
|
z-index: 99999;
|
|
2435
|
-
`,dn=
|
|
2435
|
+
`,dn=y.styled(He)`
|
|
2436
2436
|
padding: 7px 8px;
|
|
2437
2437
|
word-wrap: break-word;
|
|
2438
2438
|
|
|
2439
2439
|
svg.fa-check {
|
|
2440
2440
|
border-radius: 2px;
|
|
2441
2441
|
}
|
|
2442
|
-
`,ti=({control:e,option:n,register:i,watch:r,setValue:o})=>{var a,l,s,c;switch(n.type){case"checkboxes":{const d=r("search")??"",g=r("checkbox")??[],x=n.options??[],h=Wa(x,d,g);return t.jsxs("div",{style:{overflowX:"hidden",overflowY:"auto",maxHeight:"280px"},children:[!n.label||n.label===""?void 0:null,h.map(b=>t.jsx(dn,{value:b.value,width:"content",children:t.jsx(pe,{...i("checkbox"),label:b.label,value:b.value})},`li-checkbox-${b.value}`))]})}case"radioButton":return t.jsxs("div",{style:{overflowX:"hidden",overflowY:"auto",maxHeight:"280px"},children:[n.label,(a=n.options)==null?void 0:a.map(d=>t.jsx(dn,{value:d.value,width:"content",children:t.jsx(Nt,{...i("radio"),label:d.label,value:d.value})},`li-radio-${d.value}`))]});case"select":return t.jsx(It,{control:e,items:((l=n.options)==null?void 0:l.map(d=>({name:d.label??"",value:d.value})))??[],label:n.label,name:`text.${String(n.key)}-${n.filterFn??"caseInsensitive"}`,placeholder:n.placeholder,value:n.value});case"text":const p=`text.${String(n.key)}-${n.filterFn??"caseInsensitive"}`;return t.jsx(ot,{label:n.label,name:p,placeholder:n.placeholder,register:i,value:n.value});case"numberRange":return t.jsx(Rt,{label:n.label,name:String(n.key),propsMax:{placeholder:n.placeholder?`${n.placeholder} Max`:"Max",register:i,name:"maxValue",value:n.maxValue,setValue:o},propsMin:{placeholder:n.placeholder?`${n.placeholder} Min`:"Min",register:i,name:"minValue",value:n.minValue,setValue:o},variant:"filters"});case"dateRange":return t.jsx(Ft,{label:n.label,name:String(n.key),propsMax:{name:"maxValue",value:(s=n.maxValue)==null?void 0:s.toString()},propsMin:{name:"minValue",value:(c=n.minValue)==null?void 0:c.toString()},register:i,setValue:o,variant:"filters"});default:return t.jsx("div",{})}},ni=({control:e,items:n,register:i,setValue:r,watch:o})=>t.jsx(t.Fragment,{children:n.map((a,l)=>{const s=`${a.type}-${a.value}-${a.filterFn??"default"}`;return t.jsxs("div",{children:[t.jsx(ti,{control:e,option:a,register:i,setValue:r,watch:o}),l<n.length-1&&t.jsx("hr",{style:{margin:"1.25rem 0 0.625rem"}})]},s)})}),ii=e=>{var c,p,d,g,x;const[n,i]=u.useState([...e]),{control:r,register:o,handleSubmit:a,setValue:l,watch:s}=y.useForm({defaultValues:{checkbox:e.filter(h=>h.type==="checkboxes").flatMap(h=>{var b;return((b=h.options)==null?void 0:b.filter(m=>m.checked).map(m=>m.value))??[]}),radio:((d=(p=(c=e.find(h=>h.type==="radioButton"))==null?void 0:c.options)==null?void 0:p.find(({checked:h})=>h))==null?void 0:d.value)??"",text:e.filter(h=>["text","select"].includes(h.type)).reduce((h,b)=>({...h,[`${String(b.key)}-${b.filterFn??"caseInsensitive"}`]:b.value??""}),{}),minValue:(g=e.find(h=>["numberRange","dateRange"].includes(h.type)))==null?void 0:g.minValue,maxValue:(x=e.find(h=>["numberRange","dateRange"].includes(h.type)))==null?void 0:x.maxValue,search:""}});return{control:r,items:n,setItems:i,register:o,handleSubmit:a,setValue:l,watch:s}},yt=({options:e,onSearch:n,onSubmit:i,id:r,selectedFilter:o})=>{const{control:a,items:l,setItems:s,register:c,handleSubmit:p,setValue:d,watch:g}=ii(e),x=e.some(w=>w.type==="checkboxes"&&w.hideSearch!==!0),h=e.some(w=>w.label&&w.label!==""),b=u.useCallback(async w=>{const{value:C}=w.target;d("search",C),n&&n(C)},[n,d]),m=u.useCallback(()=>{d("search",""),n&&n("")},[n,d]),j=u.useCallback(w=>{i&&i(w)},[i]);return u.useEffect(()=>{s(e),Ba(e,d)},[e,s,d]),t.jsxs("div",{className:"flex flex-col gap-[8px]",id:r,style:{writingMode:"horizontal-tb",maxWidth:"300px",width:"100%"},children:[x&&t.jsxs("div",{children:[h?o:void 0,t.jsx(ge,{onChange:b,onClear:m,placeholder:"Search"})]}),t.jsxs("form",{id:r,onSubmit:p(j),children:[t.jsx(ni,{control:a,items:l,register:c,setValue:d,watch:g}),t.jsx(M,{mt:1,type:"submit",children:"Apply"})]})]})},ri=({options:e,variant:n,onApplyFilters:i,onSearch:r,setDirection:o,setHandler:a,onFilterStateChange:l})=>{const s=f.useTheme(),[c,p]=u.useState(e),[d,g]=u.useState([]),[x,h]=u.useState({}),[b,m]=u.useState(""),j=u.useCallback(k=>()=>{const v=c.find(S=>S.label===k),z=!(v!=null&&v.filterOptions.some(S=>S.type==="dateRange"||S.type==="select"));a==null||a(z??!0),m(k),g((v==null?void 0:v.filterOptions)??[])},[c,a]),w=u.useCallback(k=>{const v=[...k.checkbox,...Object.values(k.text??{}),...k.radio?[k.radio]:[],...k.minValue?[String(k.minValue)]:[],...k.maxValue?[String(k.maxValue)]:[]];h(E=>v.length>0?{...E,[b]:v}:E);const z=E=>{var D,F;return{...E,options:(D=E.options)==null?void 0:D.map(P=>({...P,checked:k.checkbox.includes(P.value)||k.radio===P.value})),value:["text","select"].includes(E.type)?((F=k.text)==null?void 0:F[`${String(E.key)}-${E.filterFn??"caseInsensitive"}`])??E.value:E.value,minValue:["numberRange","dateRange"].includes(E.type)?k.minValue:E.minValue,maxValue:["numberRange","dateRange"].includes(E.type)?k.maxValue:E.maxValue}},S=E=>E.label===b?{...E,filterOptions:E.filterOptions.map(z)}:E,T=c.map(S);p(E=>E.map(S));const N=T.flatMap(({filterOptions:E})=>E);i(N),g([])},[c,i,b]),C=u.useCallback((k,v)=>{const z=`li-filter-option-${k}`;return t.jsxs(Oa,{icon:v,onClick:j(k),style:{minWidth:"180px",writingMode:"horizontal-tb"},value:z,width:"100%",children:[k,x[k]===void 0?void 0:t.jsx(q,{tagLabel:x[k].length.toString()})]},z)},[x,j]);return u.useEffect(()=>{const k=e.reduce((v,{label:z,filterOptions:S})=>{const T=S.flatMap(({value:D,minValue:F,maxValue:P})=>[F,P,D]).filter(Boolean),N=S.flatMap(({options:D})=>D??[]).filter(({checked:D=!1})=>D).map(({value:D})=>D),E=[...T,...N];return E.length===0?v:{...v,[z]:E}},{});h(k),d.length>0&&o&&o("column")},[d,e,o]),u.useEffect(()=>{l==null||l(d.length>0)},[d.length,l]),n==="grouped"?t.jsx($,{display:"flex",flexDirection:"row",height:"max-content",maxHeight:d.length>0?"unset":"360px",style:{rowGap:"10px",writingMode:"vertical-lr"},wrap:"wrap",children:d.length>0?t.jsx(yt,{id:"filters-options",onSearch:r,onSubmit:w,options:d,selectedFilter:b}):Object.entries(Pt(e)).map(([k,v])=>t.jsxs($,{style:{writingMode:"horizontal-tb"},children:[t.jsx(I,{color:s.palette.gray[400],fontWeight:"bold",mb:.25,size:"md",children:k}),v.map(({label:z,icon:S="filter-list"})=>C(z,S))]},k))}):t.jsx($,{display:"flex",flexDirection:"row",height:"max-content",maxHeight:d.length>0?"unset":"200px",style:{rowGap:"10px",writingMode:"vertical-lr"},wrap:"wrap",children:d.length>0?t.jsx(yt,{id:"filters-options",onSearch:r,onSubmit:w,options:d,selectedFilter:b}):e.map(({label:k,icon:v="filter-list"})=>C(k,v))})},oi=({options:e,onApplyFilters:n,onSearch:i,modalRef:r,variant:o})=>{const[a,l]=u.useState("row"),[s,c]=u.useState(!0),[p,d]=u.useState(!1),x=(o==="grouped"?Object.values(Pt(e)).reduce((j,w)=>j+w.length,0):e.length)>5&&!p,h=f.useTheme(),b=u.useRef(null),m=t.jsx(V,{icon:"close",iconColor:h.palette.gray[400],iconSize:"lg",iconTransform:"grow-2",iconType:"fa-light",id:"modal-close",onClick:r.close,px:.25,py:.25,variant:"ghost"});return u.useEffect(()=>{const j=w=>{const C=b.current;C&&!C.contains(w.target)&&r.close()};if(s)return document.addEventListener("mousedown",j,!0),()=>{document.removeEventListener("mousedown",j,!0)}},[b,s,r]),t.jsx(_a,{$bgColor:"transparent","aria-label":r.name,children:t.jsxs(At,{$size:"fixed",alignItems:a==="row"?"start":"end",display:"flex",flexDirection:a,gap:.5,id:"filters-list",justify:"space-between",position:"relative",px:1.25,py:1.25,ref:b,style:{maxWidth:"620px",overflow:"hidden",width:"fit-content",paddingBottom:x?"0":void 0},children:[a==="column"?m:void 0,t.jsx(ri,{onApplyFilters:n,onFilterStateChange:d,onSearch:i,options:e,setDirection:l,setHandler:c,variant:o}),a==="row"?m:void 0]})})};function Ma(e){if(!e)return;const n=20;if(e.length<=n)return e;const i=n-3,r=Math.ceil(i/2),o=Math.floor(i/2);return`${e.slice(0,r)}...${e.slice(e.length-o)}`}function ai(e){if(!e||e.length===0)return;const n=e.filter(s=>s.checked).map(s=>s.label??s.value);if(n.length===0)return;const i=(s,c=20)=>{if(s.length<=c)return s;const p=c-3,d=Math.ceil(p/2),g=Math.floor(p/2);return`${s.slice(0,d)}...${s.slice(s.length-g)}`};if(n.length===1){const s=n[0];return s.length>20?i(s,20):s}if(n.length===2){const s=n[0],c=n.join(", ").length;return s.length>20||c>20?`${i(s,20)} +1 more`:`${n[0]}, ${n[1]}`}const r=n[0],o=n.length-1,a=20,l=n.join(", ").length;return r.length>a||l>a?`${i(r,a)} +${o} more`:`${n[0]}, ${n[1]}`}function Ha(e,n,i){const r=i??"",o=y._.isEmpty(e)&&typeof e!="number"||Number.isNaN(e)?void 0:Number(e),a=y._.isEmpty(n)&&typeof n!="number"||Number.isNaN(n)?void 0:Number(String(n));if(!y._.isUndefined(o)&&!y._.isUndefined(a))return`${o}${r} - ${a}${r}`;if(!y._.isUndefined(o))return`Min ${o}${r}`;if(!y._.isUndefined(a))return`Max ${a}${r}`}function Va(e,n){if(y.dayjs_minExports.extend(y.localizedFormat),!(y._.isUndefined(e)&&y._.isUndefined(n))){if(e!==""&&n!==""&&!y._.isUndefined(e)&&!y._.isUndefined(n))return`${y.dayjs(e).format("LL")} - ${y.dayjs(n).format("LL")}`;if(e!==""&&!y._.isUndefined(e))return`From ${y.dayjs(e).format("LL")}`;if(n!==""&&!y._.isUndefined(n))return`To ${y.dayjs(n).format("LL")}`}}function Ua(e,n,i){return e==="select"?n:`${n} ${i==="includesInsensitive"?"contains":"is"}`}const Te=({filter:e,icon:n="filter-list",label:i,onClose:r,filterValue:o})=>{if(y._.isNil(o)||y._.isEmpty(String(o)))return null;const a=e.type==="checkboxes"?(e.options??[]).filter(c=>c.checked).map(c=>c.label??c.value):[],{tooltipContent:l,shouldShowTooltip:s}=(()=>{var p,d,g;if(a.length>0){if(a.length===1){const m=(((p=a[0])==null?void 0:p.length)??0)>20;return{shouldShowTooltip:m,tooltipContent:m?a[0]:void 0}}if(a.length===2){const m=((d=a[0])==null?void 0:d.length)??0,j=a.join(", ").length,w=m>20||j>20;return{shouldShowTooltip:w,tooltipContent:w?a:void 0}}const x=((g=a[0])==null?void 0:g.length)??0,h=a.join(", ").length,b=x>20||h>20;return{shouldShowTooltip:b,tooltipContent:b?a:void 0}}const c=e.value;return typeof c=="string"&&c.length>20?{shouldShowTooltip:!0,tooltipContent:c}:{shouldShowTooltip:!1,tooltipContent:void 0}})();return t.jsx(Z,{disabled:!s,id:"applied-filter-tooltip",nodeTip:s?Array.isArray(l)?t.jsx($,{display:"flex",flexDirection:"column",gap:.25,children:l.map(c=>t.jsxs($,{alignItems:"flex-start",display:"flex",gap:.5,children:[t.jsx("span",{children:"•"}),t.jsx($,{whiteSpace:"normal",wordWrap:"break-word",children:c})]},c))}):t.jsx($,{whiteSpace:"normal",wordWrap:"break-word",children:l}):void 0,children:t.jsx(q,{filterValues:o,icon:n,id:"remove-filter",onClose:r(e),tagLabel:`${i} `})})},Ga=({options:e,onClose:n})=>{const i=e.flatMap(r=>r.filterOptions.map(o=>{const{filterFn:a,label:l,type:s,value:c,options:p,minValue:d,maxValue:g}=o;switch(s){case"numberRange":{const x=Ha(d,g,r.placeholder);return t.jsx(Te,{filter:o,filterValue:x,icon:r.icon,label:r.label,onClose:n},l)}case"dateRange":{const x=Va(d==null?void 0:d.toString(),g==null?void 0:g.toString());return t.jsx(Te,{filter:o,filterValue:x,icon:r.icon,label:r.label,onClose:n},l)}case"radioButton":case"checkboxes":{const x=ai(p);return t.jsx(Te,{filter:o,filterValue:x,icon:r.icon,label:r.label,onClose:n},l)}case void 0:case"select":case"text":default:{const x=Ma(c),h=Ua(s,r.label,a);return t.jsx(Te,{filter:o,filterValue:x,icon:r.icon,label:h,onClose:n},l)}}})).filter(r=>{if(r===null)return!1;const{filterValue:o}=r.props;return!y._.isNil(o)&&!y._.isEmpty(String(o))});return i.length>0?t.jsx($,{alignItems:"center",display:"flex",gap:.5,pb:1,width:"100%",wrap:"wrap",children:i}):null},Ya=e=>e.map(n=>{const i={key:String(n.key),type:n.type},r=(()=>{let o={...i};if(n.filterFn&&(o={...o,filterFn:n.filterFn}),n.value&&(o={...o,value:n.value}),n.minValue!==void 0&&n.minValue!==null&&(o={...o,minValue:n.minValue}),n.maxValue!==void 0&&n.maxValue!==null&&(o={...o,maxValue:n.maxValue}),n.options&&n.options.length>0){const a=n.options.filter(l=>l.checked).map(l=>l.value);a.length>0&&(o={...o,selectedValues:a})}return o})();return Object.keys(r).length>2?r:null}).filter(Boolean),Xa=(e,n)=>n.map(i=>{const r=e.find(a=>a.key===String(i.key)&&a.type===i.type);return r?(()=>{let a={...i};return r.filterFn&&(a={...a,filterFn:r.filterFn}),r.value!==void 0&&r.value!==null&&(a={...a,value:r.value}),r.minValue!==void 0&&r.minValue!==null&&(a={...a,minValue:r.minValue}),r.maxValue!==void 0&&r.maxValue!==null&&(a={...a,maxValue:r.maxValue}),r.selectedValues&&i.options&&(a={...a,options:i.options.map(l=>{var s;return{...l,checked:((s=r.selectedValues)==null?void 0:s.includes(l.value))??!1}})}),a})():i}),lt=(e,n)=>{const i=Ya(e);n(JSON.stringify(i))},Ka=(e,n)=>{const i=e();if(!i)return n;try{const r=JSON.parse(i);return Xa(r,n)}catch{return n}},Za=(e,n)=>{function i(l,s){if(s.value===""||s.value===void 0||y._.defaultTo(s.isBackFilter,!1))return!0;switch(s.filterFn){case"includesInsensitive":return String(l[s.key]).toLowerCase().includes(s.value.toLowerCase());case"caseInsensitive":case void 0:default:return String(l[s.key]).toLowerCase()===s.value.toLowerCase()}}function r(l,s){if(!s.options||s.options.length===0)return!0;const c=s.options.filter(p=>p.checked).map(p=>p.value);return c.length===0?!0:c.includes(String(l[s.key]))}function o(l,s,c){const p=c(String(l[s.key])),{minValue:d,maxValue:g}=s,x=y._.isEmpty(d)&&typeof d!="number"?void 0:c(String(d)),h=y._.isEmpty(g)&&typeof g!="number"?void 0:c(String(g));return y._.isUndefined(x)&&y._.isUndefined(h)?!0:(x??-1/0)<=p&&p<=(h??1/0)}function a(l){return n.every(s=>{if(typeof s.key=="function")return s.key(l,s.value);switch(s.type){case"radioButton":case"checkboxes":return r(l,s);case"numberRange":return o(l,s,Number);case"dateRange":return o(l,s,c=>new Date(c));case"select":case"text":default:return i(l,s)}})}return e.filter(a)},qa=e=>[...e.flatMap(({options:i})=>i).filter(i=>i==null?void 0:i.checked),...e.flatMap(i=>[i.value,i.maxValue,i.minValue]).filter(Boolean)].length,Ja=e=>{var i;const n=((i=e.options)==null?void 0:i.map(r=>({...r,checked:void 0})))??void 0;return{...e,minValue:void 0,maxValue:void 0,value:void 0,options:n}},Qa=({dataset:e,setValues:n,getValues:i,options:r,setFilteredDataset:o,onFiltersChange:a,onReset:l,onSearch:s,variant:c="ungrouped"})=>{const p=we("filters-modal"),[d,g]=u.useState(!1),[x,h]=u.useState([]),b=qa(x),m=r.map(v=>({...v,filterOptions:v.filterOptions.map(z=>x.find(T=>T.key===z.key&&T.type===z.type&&T.filterFn===z.filterFn)??{...z})})),j=u.useCallback(v=>{h([...v]),lt(v,n)},[h,n]),w=u.useCallback(()=>{l&&l(),p.isOpen||g(!0),p.toggle()},[p,l]),C=u.useCallback(v=>()=>{l&&l();const z=x.map(S=>S.key===v.key&&S.type===v.type&&S.filterFn===v.filterFn?Ja(S):S);h(z),lt(z,n)},[x,l,n]);return u.useEffect(()=>{const v=r.flatMap(T=>T.filterOptions),z=i();if((()=>{if(!z)return!1;try{const T=JSON.parse(z);return Array.isArray(T)&&T.length>0}catch{return!1}})()){const T=Ka(i,v);h(T)}else v.flatMap(N=>N.value).filter(Boolean).length>0||v.flatMap(N=>N.options).filter(N=>(N==null?void 0:N.checked)===!0).length>0?(h(v),d&<(v,n)):h(v)},[r,h,n,i,d]),u.useEffect(()=>{o&&e!==void 0&&o(Za(e,x)),a==null||a(x)},[e,x,o,a]),{Filters:()=>t.jsxs($,{alignItems:"center",display:"flex",gap:.25,maxWidth:"100%",position:"relative",wrap:"wrap",children:[t.jsx($,{pr:.25,children:t.jsx(M,{icon:"filter",id:"filter-btn",onClick:w,tag:b.toString(),variant:"ghost"})}),p.isOpen&&t.jsx(oi,{modalRef:p,onApplyFilters:j,onSearch:s,options:m,variant:c})]}),options:m,removeFilter:C}},Ot=({_portal:e=!0,alert:n,cancelButton:i=void 0,children:r=void 0,confirmButton:o=void 0,content:a=void 0,description:l=void 0,modalRef:s,otherActions:c=void 0,onClose:p=void 0,tabItems:d=void 0,title:g=void 0,size:x,id:h="modal-container"})=>{const b=f.useTheme(),[m,j]=u.useState(void 0),w=u.useRef(null),C=u.useRef(!1),k=Array.isArray(d)&&d.length>0,v=i??o;u.useEffect(()=>{if(k&&!C.current&&w.current){const S=w.current.getBoundingClientRect().height;S>50&&(j(S),C.current=!0)}s.isOpen||(j(void 0),C.current=!1)},[k,s.isOpen]);const z=t.jsx(Gn,{"aria-label":s.name,"aria-modal":"true",id:"modal-wrapper",children:t.jsxs(At,{$size:x,"data-testid":h,flexDirection:"column",id:h,ref:k?w:void 0,style:k&&m?{height:m}:void 0,children:[!y._.isEmpty(g)&&!y._.isNil(g)&&t.jsx(Xn,{description:l,modalRef:s,onClose:p,otherActions:c,title:g}),d&&t.jsx($,{borderTop:`1px solid ${b.palette.gray[300]}`,display:"block",mb:1.25,position:"sticky",children:t.jsx(Lt,{items:d})}),(y._.isObject(a)||r)&&t.jsxs(za,{style:v?{borderBottom:`1px solid ${b.palette.gray[200]}`}:void 0,children:[r,y._.isObject(a)&&y._.isString(a.imageSrc)&&t.jsx(Fa,{$framed:a.imageFramed,children:t.jsx(oe,{alt:"modal-img",publicId:a.imageSrc})}),y._.isObject(a)&&y._.isString(a.imageText)&&t.jsx(I,{size:"md",children:a.imageText})]}),t.jsx(Yn,{alert:n,cancelButton:i,confirmButton:o,modalRef:s})]})});return e&&s.isOpen?je.createPortal(z,document.getElementById("portals")??document.body):s.isOpen?z:null},es=(e,n,i)=>{const r=we("confirm-dialog-modal"),o=u.useRef(null),a=u.useCallback(async()=>(r.open(),new Promise(p=>{o.current=p})),[r]),l=u.useCallback(()=>{var p;r.close(),(p=o.current)==null||p.call(o,!0)},[r]),s=u.useCallback(()=>{var p;r.close(),(p=o.current)==null||p.call(o,!1)},[r]);return[a,({children:p})=>{const[d,g]=u.useState(i),x=u.useCallback(()=>{g({...i})},[]),h=u.useCallback(j=>()=>{g(w=>({...w,[j]:{...w[j],state:!w[j].state}}))},[]),b=!Object.values(d).every(({state:j})=>j),m=Object.entries(d).map(([j,{state:w,label:C}])=>t.jsx(pe,{defaultChecked:w,label:C,name:j,onChange:h(j)},j));return t.jsxs(Ot,{"data-testid":e,id:e,modalRef:{...r,close:s},onClose:x,size:"sm",title:n,children:[p,t.jsx($,{display:"flex",flexDirection:"column",gap:.5,children:m}),t.jsx(Kn,{disabled:b,id:e,onConfirm:l})]})}]},ts=()=>{const[e,n]=u.useState(!1),[i,r]=u.useState(),o=u.useRef(null),a=we("confirm-dialog-modal"),l=u.useCallback(async d=>(r(d),n(!0),new Promise(g=>{o.current=g})),[]),s=u.useCallback(()=>{var d;n(!1),r(void 0),(d=o.current)==null||d.call(o,!0)},[]),c=u.useCallback(()=>{var d;n(!1),r(void 0),(d=o.current)==null||d.call(o,!1)},[]);return u.useEffect(()=>{a.setIsOpen(e)},[e,a]),{ConfirmDialog:({id:d="confirm-dialog-modal",children:g})=>t.jsxs(Ot,{cancelButton:{onClick:c,text:"Cancel"},confirmButton:{id:(i==null?void 0:i.id)??"modal-confirm",onClick:s,text:"Confirm"},description:i==null?void 0:i.message,id:d,modalRef:{...a,close:c},size:"sm",title:i==null?void 0:i.title,children:[i==null?void 0:i.content,g]}),confirm:l}},ns=2e3,is=({content:e})=>{const[n,i]=u.useState("Copy"),r=u.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{i("Copied"),setTimeout(()=>{i("Copy")},ns)}).catch(()=>{i("Failed to copy")})},[e]);return t.jsx(V,{icon:"copy",iconSize:"lg",iconType:"fa-light",onClick:r,tooltip:n,variant:"ghost"})},rs=f.styled.ul`
|
|
2442
|
+
`,ti=({control:e,option:n,register:i,watch:r,setValue:o})=>{var s,l,a,c;switch(n.type){case"checkboxes":{const d=r("search")??"",g=r("checkbox")??[],x=n.options??[],h=_s(x,d,g);return t.jsxs("div",{style:{overflowX:"hidden",overflowY:"auto",maxHeight:"280px"},children:[!n.label||n.label===""?void 0:null,h.map(b=>t.jsx(dn,{value:b.value,width:"content",children:t.jsx(pe,{...i("checkbox"),label:b.label,value:b.value})},`li-checkbox-${b.value}`))]})}case"radioButton":return t.jsxs("div",{style:{overflowX:"hidden",overflowY:"auto",maxHeight:"280px"},children:[n.label,(s=n.options)==null?void 0:s.map(d=>t.jsx(dn,{value:d.value,width:"content",children:t.jsx(Nt,{...i("radio"),label:d.label,value:d.value})},`li-radio-${d.value}`))]});case"select":return t.jsx(It,{control:e,items:((l=n.options)==null?void 0:l.map(d=>({name:d.label??"",value:d.value})))??[],label:n.label,name:`text.${String(n.key)}-${n.filterFn??"caseInsensitive"}`,placeholder:n.placeholder,value:n.value});case"text":const p=`text.${String(n.key)}-${n.filterFn??"caseInsensitive"}`;return t.jsx(st,{label:n.label,name:p,placeholder:n.placeholder,register:i,value:n.value});case"numberRange":return t.jsx(Rt,{label:n.label,name:String(n.key),propsMax:{placeholder:n.placeholder?`${n.placeholder} Max`:"Max",register:i,name:"maxValue",value:n.maxValue,setValue:o},propsMin:{placeholder:n.placeholder?`${n.placeholder} Min`:"Min",register:i,name:"minValue",value:n.minValue,setValue:o},variant:"filters"});case"dateRange":return t.jsx(Et,{label:n.label,name:String(n.key),propsMax:{name:"maxValue",value:(a=n.maxValue)==null?void 0:a.toString()},propsMin:{name:"minValue",value:(c=n.minValue)==null?void 0:c.toString()},register:i,setValue:o,variant:"filters"});default:return t.jsx("div",{})}},ni=({control:e,items:n,register:i,setValue:r,watch:o})=>t.jsx(t.Fragment,{children:n.map((s,l)=>{const a=`${s.type}-${s.value}-${s.filterFn??"default"}`;return t.jsxs("div",{children:[t.jsx(ti,{control:e,option:s,register:i,setValue:r,watch:o}),l<n.length-1&&t.jsx("hr",{style:{margin:"1.25rem 0 0.625rem"}})]},a)})}),ii=e=>{var c,p,d,g,x;const[n,i]=u.useState([...e]),{control:r,register:o,handleSubmit:s,setValue:l,watch:a}=f.useForm({defaultValues:{checkbox:e.filter(h=>h.type==="checkboxes").flatMap(h=>{var b;return((b=h.options)==null?void 0:b.filter(m=>m.checked).map(m=>m.value))??[]}),radio:((d=(p=(c=e.find(h=>h.type==="radioButton"))==null?void 0:c.options)==null?void 0:p.find(({checked:h})=>h))==null?void 0:d.value)??"",text:e.filter(h=>["text","select"].includes(h.type)).reduce((h,b)=>({...h,[`${String(b.key)}-${b.filterFn??"caseInsensitive"}`]:b.value??""}),{}),minValue:(g=e.find(h=>["numberRange","dateRange"].includes(h.type)))==null?void 0:g.minValue,maxValue:(x=e.find(h=>["numberRange","dateRange"].includes(h.type)))==null?void 0:x.maxValue,search:""}});return{control:r,items:n,setItems:i,register:o,handleSubmit:s,setValue:l,watch:a}},yt=({options:e,onSearch:n,onSubmit:i,id:r,selectedFilter:o})=>{const{control:s,items:l,setItems:a,register:c,handleSubmit:p,setValue:d,watch:g}=ii(e),x=e.some(w=>w.type==="checkboxes"&&w.hideSearch!==!0),h=e.some(w=>w.label&&w.label!==""),b=u.useCallback(async w=>{const{value:C}=w.target;d("search",C),n&&n(C)},[n,d]),m=u.useCallback(()=>{d("search",""),n&&n("")},[n,d]),j=u.useCallback(w=>{i&&i(w)},[i]);return u.useEffect(()=>{a(e),Ms(e,d)},[e,a,d]),t.jsxs("div",{className:"flex flex-col gap-[8px]",id:r,style:{writingMode:"horizontal-tb",maxWidth:"300px",width:"100%"},children:[x&&t.jsxs("div",{children:[h?o:void 0,t.jsx(ge,{onChange:b,onClear:m,placeholder:"Search"})]}),t.jsxs("form",{id:r,onSubmit:p(j),children:[t.jsx(ni,{control:s,items:l,register:c,setValue:d,watch:g}),t.jsx(_,{mt:1,type:"submit",children:"Apply"})]})]})},ri=({options:e,variant:n,onApplyFilters:i,onSearch:r,setDirection:o,setHandler:s,onFilterStateChange:l})=>{const a=y.useTheme(),[c,p]=u.useState(e),[d,g]=u.useState([]),[x,h]=u.useState({}),[b,m]=u.useState(""),j=u.useCallback(k=>()=>{const v=c.find(S=>S.label===k),z=!(v!=null&&v.filterOptions.some(S=>S.type==="dateRange"||S.type==="select"));s==null||s(z??!0),m(k),g((v==null?void 0:v.filterOptions)??[])},[c,s]),w=u.useCallback(k=>{const v=[...k.checkbox,...Object.values(k.text??{}),...k.radio?[k.radio]:[],...k.minValue?[String(k.minValue)]:[],...k.maxValue?[String(k.maxValue)]:[]];h(E=>v.length>0?{...E,[b]:v}:E);const z=E=>{var D,F;return{...E,options:(D=E.options)==null?void 0:D.map(P=>({...P,checked:k.checkbox.includes(P.value)||k.radio===P.value})),value:["text","select"].includes(E.type)?((F=k.text)==null?void 0:F[`${String(E.key)}-${E.filterFn??"caseInsensitive"}`])??E.value:E.value,minValue:["numberRange","dateRange"].includes(E.type)?k.minValue:E.minValue,maxValue:["numberRange","dateRange"].includes(E.type)?k.maxValue:E.maxValue}},S=E=>E.label===b?{...E,filterOptions:E.filterOptions.map(z)}:E,T=c.map(S);p(E=>E.map(S));const N=T.flatMap(({filterOptions:E})=>E);i(N),g([])},[c,i,b]),C=u.useCallback((k,v)=>{const z=`li-filter-option-${k}`;return t.jsxs(Ws,{icon:v,onClick:j(k),style:{minWidth:"180px",writingMode:"horizontal-tb"},value:z,width:"100%",children:[k,x[k]===void 0?void 0:t.jsx(q,{tagLabel:x[k].length.toString()})]},z)},[x,j]);return u.useEffect(()=>{const k=e.reduce((v,{label:z,filterOptions:S})=>{const T=S.flatMap(({value:D,minValue:F,maxValue:P})=>[F,P,D]).filter(Boolean),N=S.flatMap(({options:D})=>D??[]).filter(({checked:D=!1})=>D).map(({value:D})=>D),E=[...T,...N];return E.length===0?v:{...v,[z]:E}},{});h(k),d.length>0&&o&&o("column")},[d,e,o]),u.useEffect(()=>{l==null||l(d.length>0)},[d.length,l]),n==="grouped"?t.jsx($,{display:"flex",flexDirection:"row",height:"max-content",maxHeight:d.length>0?"unset":"360px",style:{rowGap:"10px",writingMode:"vertical-lr"},wrap:"wrap",children:d.length>0?t.jsx(yt,{id:"filters-options",onSearch:r,onSubmit:w,options:d,selectedFilter:b}):Object.entries(Pt(e)).map(([k,v])=>t.jsxs($,{style:{writingMode:"horizontal-tb"},children:[t.jsx(I,{color:a.palette.gray[400],fontWeight:"bold",mb:.25,size:"md",children:k}),v.map(({label:z,icon:S="filter-list"})=>C(z,S))]},k))}):t.jsx($,{display:"flex",flexDirection:"row",height:"max-content",maxHeight:d.length>0?"unset":"200px",style:{rowGap:"10px",writingMode:"vertical-lr"},wrap:"wrap",children:d.length>0?t.jsx(yt,{id:"filters-options",onSearch:r,onSubmit:w,options:d,selectedFilter:b}):e.map(({label:k,icon:v="filter-list"})=>C(k,v))})},oi=({options:e,onApplyFilters:n,onSearch:i,modalRef:r,variant:o})=>{const[s,l]=u.useState("row"),[a,c]=u.useState(!0),[p,d]=u.useState(!1),x=(o==="grouped"?Object.values(Pt(e)).reduce((j,w)=>j+w.length,0):e.length)>5&&!p,h=y.useTheme(),b=u.useRef(null),m=t.jsx(V,{icon:"close",iconColor:h.palette.gray[400],iconSize:"lg",iconTransform:"grow-2",iconType:"fa-light",id:"modal-close",onClick:r.close,px:.25,py:.25,variant:"ghost"});return u.useEffect(()=>{const j=w=>{const C=b.current;C&&!C.contains(w.target)&&r.close()};if(a)return document.addEventListener("mousedown",j,!0),()=>{document.removeEventListener("mousedown",j,!0)}},[b,a,r]),t.jsx(Hs,{$bgColor:"transparent","aria-label":r.name,children:t.jsxs(At,{$size:"fixed",alignItems:s==="row"?"start":"end",display:"flex",flexDirection:s,gap:.5,id:"filters-list",justify:"space-between",position:"relative",px:1.25,py:1.25,ref:b,style:{maxWidth:"620px",overflow:"hidden",width:"fit-content",paddingBottom:x?"0":void 0},children:[s==="column"?m:void 0,t.jsx(ri,{onApplyFilters:n,onFilterStateChange:d,onSearch:i,options:e,setDirection:l,setHandler:c,variant:o}),s==="row"?m:void 0]})})};function Vs(e){if(!e)return;const n=20;if(e.length<=n)return e;const i=n-3,r=Math.ceil(i/2),o=Math.floor(i/2);return`${e.slice(0,r)}...${e.slice(e.length-o)}`}function si(e){if(!e||e.length===0)return;const n=e.filter(a=>a.checked).map(a=>a.label??a.value);if(n.length===0)return;const i=(a,c=20)=>{if(a.length<=c)return a;const p=c-3,d=Math.ceil(p/2),g=Math.floor(p/2);return`${a.slice(0,d)}...${a.slice(a.length-g)}`};if(n.length===1){const a=n[0];return a.length>20?i(a,20):a}if(n.length===2){const a=n[0],c=n.join(", ").length;return a.length>20||c>20?`${i(a,20)} +1 more`:`${n[0]}, ${n[1]}`}const r=n[0],o=n.length-1,s=20,l=n.join(", ").length;return r.length>s||l>s?`${i(r,s)} +${o} more`:`${n[0]}, ${n[1]}`}function Us(e,n,i){const r=i??"",o=f._.isEmpty(e)&&typeof e!="number"||Number.isNaN(e)?void 0:Number(e),s=f._.isEmpty(n)&&typeof n!="number"||Number.isNaN(n)?void 0:Number(String(n));if(!f._.isUndefined(o)&&!f._.isUndefined(s))return`${o}${r} - ${s}${r}`;if(!f._.isUndefined(o))return`Min ${o}${r}`;if(!f._.isUndefined(s))return`Max ${s}${r}`}function Gs(e,n){if(f.dayjs_minExports.extend(f.localizedFormat),!(f._.isUndefined(e)&&f._.isUndefined(n))){if(e!==""&&n!==""&&!f._.isUndefined(e)&&!f._.isUndefined(n))return`${f.dayjs(e).format("LL")} - ${f.dayjs(n).format("LL")}`;if(e!==""&&!f._.isUndefined(e))return`From ${f.dayjs(e).format("LL")}`;if(n!==""&&!f._.isUndefined(n))return`To ${f.dayjs(n).format("LL")}`}}function Ys(e,n,i){return e==="select"?n:`${n} ${i==="includesInsensitive"?"contains":"is"}`}const Te=({filter:e,icon:n="filter-list",label:i,onClose:r,filterValue:o})=>{if(f._.isNil(o)||f._.isEmpty(String(o)))return null;const s=e.type==="checkboxes"?(e.options??[]).filter(c=>c.checked).map(c=>c.label??c.value):[],{tooltipContent:l,shouldShowTooltip:a}=(()=>{var p,d,g;if(s.length>0){if(s.length===1){const m=(((p=s[0])==null?void 0:p.length)??0)>20;return{shouldShowTooltip:m,tooltipContent:m?s[0]:void 0}}if(s.length===2){const m=((d=s[0])==null?void 0:d.length)??0,j=s.join(", ").length,w=m>20||j>20;return{shouldShowTooltip:w,tooltipContent:w?s:void 0}}const x=((g=s[0])==null?void 0:g.length)??0,h=s.join(", ").length,b=x>20||h>20;return{shouldShowTooltip:b,tooltipContent:b?s:void 0}}const c=e.value;return typeof c=="string"&&c.length>20?{shouldShowTooltip:!0,tooltipContent:c}:{shouldShowTooltip:!1,tooltipContent:void 0}})();return t.jsx(Z,{disabled:!a,id:"applied-filter-tooltip",nodeTip:a?Array.isArray(l)?t.jsx($,{display:"flex",flexDirection:"column",gap:.25,children:l.map(c=>t.jsxs($,{alignItems:"flex-start",display:"flex",gap:.5,children:[t.jsx("span",{children:"•"}),t.jsx($,{whiteSpace:"normal",wordWrap:"break-word",children:c})]},c))}):t.jsx($,{whiteSpace:"normal",wordWrap:"break-word",children:l}):void 0,children:t.jsx(q,{filterValues:o,icon:n,id:"remove-filter",onClose:r(e),tagLabel:`${i} `})})},Xs=({options:e,onClose:n})=>{const i=e.flatMap(r=>r.filterOptions.map(o=>{const{filterFn:s,label:l,type:a,value:c,options:p,minValue:d,maxValue:g}=o;switch(a){case"numberRange":{const x=Us(d,g,r.placeholder);return t.jsx(Te,{filter:o,filterValue:x,icon:r.icon,label:r.label,onClose:n},l)}case"dateRange":{const x=Gs(d==null?void 0:d.toString(),g==null?void 0:g.toString());return t.jsx(Te,{filter:o,filterValue:x,icon:r.icon,label:r.label,onClose:n},l)}case"radioButton":case"checkboxes":{const x=si(p);return t.jsx(Te,{filter:o,filterValue:x,icon:r.icon,label:r.label,onClose:n},l)}case void 0:case"select":case"text":default:{const x=Vs(c),h=Ys(a,r.label,s);return t.jsx(Te,{filter:o,filterValue:x,icon:r.icon,label:h,onClose:n},l)}}})).filter(r=>{if(r===null)return!1;const{filterValue:o}=r.props;return!f._.isNil(o)&&!f._.isEmpty(String(o))});return i.length>0?t.jsx($,{alignItems:"center",display:"flex",gap:.5,pb:1,width:"100%",wrap:"wrap",children:i}):null},Ks=e=>e.map(n=>{const i={key:String(n.key),type:n.type},r=(()=>{let o={...i};if(n.filterFn&&(o={...o,filterFn:n.filterFn}),n.value&&(o={...o,value:n.value}),n.minValue!==void 0&&n.minValue!==null&&(o={...o,minValue:n.minValue}),n.maxValue!==void 0&&n.maxValue!==null&&(o={...o,maxValue:n.maxValue}),n.options&&n.options.length>0){const s=n.options.filter(l=>l.checked).map(l=>l.value);s.length>0&&(o={...o,selectedValues:s})}return o})();return Object.keys(r).length>2?r:null}).filter(Boolean),Zs=(e,n)=>n.map(i=>{const r=e.find(s=>s.key===String(i.key)&&s.type===i.type);return r?(()=>{let s={...i};return r.filterFn&&(s={...s,filterFn:r.filterFn}),r.value!==void 0&&r.value!==null&&(s={...s,value:r.value}),r.minValue!==void 0&&r.minValue!==null&&(s={...s,minValue:r.minValue}),r.maxValue!==void 0&&r.maxValue!==null&&(s={...s,maxValue:r.maxValue}),r.selectedValues&&i.options&&(s={...s,options:i.options.map(l=>{var a;return{...l,checked:((a=r.selectedValues)==null?void 0:a.includes(l.value))??!1}})}),s})():i}),ct=(e,n)=>{const i=Ks(e);n(JSON.stringify(i))},qs=(e,n)=>{const i=e();if(!i)return n;try{const r=JSON.parse(i);return Zs(r,n)}catch{return n}},Js=(e,n)=>{function i(l,a){if(a.value===""||a.value===void 0||f._.defaultTo(a.isBackFilter,!1))return!0;switch(a.filterFn){case"includesInsensitive":return String(l[a.key]).toLowerCase().includes(a.value.toLowerCase());case"caseInsensitive":case void 0:default:return String(l[a.key]).toLowerCase()===a.value.toLowerCase()}}function r(l,a){if(!a.options||a.options.length===0)return!0;const c=a.options.filter(p=>p.checked).map(p=>p.value);return c.length===0?!0:c.includes(String(l[a.key]))}function o(l,a,c){const p=c(String(l[a.key])),{minValue:d,maxValue:g}=a,x=f._.isEmpty(d)&&typeof d!="number"?void 0:c(String(d)),h=f._.isEmpty(g)&&typeof g!="number"?void 0:c(String(g));return f._.isUndefined(x)&&f._.isUndefined(h)?!0:(x??-1/0)<=p&&p<=(h??1/0)}function s(l){return n.every(a=>{if(typeof a.key=="function")return a.key(l,a.value);switch(a.type){case"radioButton":case"checkboxes":return r(l,a);case"numberRange":return o(l,a,Number);case"dateRange":return o(l,a,c=>new Date(c));case"select":case"text":default:return i(l,a)}})}return e.filter(s)},Qs=e=>[...e.flatMap(({options:i})=>i).filter(i=>i==null?void 0:i.checked),...e.flatMap(i=>[i.value,i.maxValue,i.minValue]).filter(Boolean)].length,ea=e=>{var i;const n=((i=e.options)==null?void 0:i.map(r=>({...r,checked:void 0})))??void 0;return{...e,minValue:void 0,maxValue:void 0,value:void 0,options:n}},ta=({dataset:e,setValues:n,getValues:i,options:r,setFilteredDataset:o,onFiltersChange:s,onReset:l,onSearch:a,variant:c="ungrouped"})=>{const p=we("filters-modal"),[d,g]=u.useState(!1),[x,h]=u.useState([]),b=Qs(x),m=r.map(v=>({...v,filterOptions:v.filterOptions.map(z=>x.find(T=>T.key===z.key&&T.type===z.type&&T.filterFn===z.filterFn)??{...z})})),j=u.useCallback(v=>{h([...v]),ct(v,n)},[h,n]),w=u.useCallback(()=>{l&&l(),p.isOpen||g(!0),p.toggle()},[p,l]),C=u.useCallback(v=>()=>{l&&l();const z=x.map(S=>S.key===v.key&&S.type===v.type&&S.filterFn===v.filterFn?ea(S):S);h(z),ct(z,n)},[x,l,n]);return u.useEffect(()=>{const v=r.flatMap(T=>T.filterOptions),z=i();if((()=>{if(!z)return!1;try{const T=JSON.parse(z);return Array.isArray(T)&&T.length>0}catch{return!1}})()){const T=qs(i,v);h(T)}else v.flatMap(N=>N.value).filter(Boolean).length>0||v.flatMap(N=>N.options).filter(N=>(N==null?void 0:N.checked)===!0).length>0?(h(v),d&&ct(v,n)):h(v)},[r,h,n,i,d]),u.useEffect(()=>{o&&e!==void 0&&o(Js(e,x)),s==null||s(x)},[e,x,o,s]),{Filters:()=>t.jsxs($,{alignItems:"center",display:"flex",gap:.25,maxWidth:"100%",position:"relative",wrap:"wrap",children:[t.jsx($,{pr:.25,children:t.jsx(_,{icon:"filter",id:"filter-btn",onClick:w,tag:b.toString(),variant:"ghost"})}),p.isOpen&&t.jsx(oi,{modalRef:p,onApplyFilters:j,onSearch:a,options:m,variant:c})]}),options:m,removeFilter:C}},Ot=({_portal:e=!0,alert:n,cancelButton:i=void 0,children:r=void 0,confirmButton:o=void 0,content:s=void 0,description:l=void 0,modalRef:a,otherActions:c=void 0,onClose:p=void 0,tabItems:d=void 0,title:g=void 0,size:x,id:h="modal-container"})=>{const b=y.useTheme(),[m,j]=u.useState(void 0),w=u.useRef(null),C=u.useRef(!1),k=Array.isArray(d)&&d.length>0,v=i??o;u.useEffect(()=>{if(k&&!C.current&&w.current){const S=w.current.getBoundingClientRect().height;S>50&&(j(S),C.current=!0)}a.isOpen||(j(void 0),C.current=!1)},[k,a.isOpen]);const z=t.jsx(Gn,{"aria-label":a.name,"aria-modal":"true",id:"modal-wrapper",children:t.jsxs(At,{$size:x,"data-testid":h,flexDirection:"column",id:h,ref:k?w:void 0,style:k&&m?{height:m}:void 0,children:[!f._.isEmpty(g)&&!f._.isNil(g)&&t.jsx(Xn,{description:l,modalRef:a,onClose:p,otherActions:c,title:g}),d&&t.jsx($,{borderTop:`1px solid ${b.palette.gray[300]}`,display:"block",mb:1.25,position:"sticky",children:t.jsx(Lt,{items:d})}),(f._.isObject(s)||r)&&t.jsxs(Is,{style:v?{borderBottom:`1px solid ${b.palette.gray[200]}`}:void 0,children:[r,f._.isObject(s)&&f._.isString(s.imageSrc)&&t.jsx(Rs,{$framed:s.imageFramed,children:t.jsx(oe,{alt:"modal-img",publicId:s.imageSrc})}),f._.isObject(s)&&f._.isString(s.imageText)&&t.jsx(I,{size:"md",children:s.imageText})]}),t.jsx(Yn,{alert:n,cancelButton:i,confirmButton:o,modalRef:a})]})});return e&&a.isOpen?je.createPortal(z,document.getElementById("portals")??document.body):a.isOpen?z:null},na=(e,n,i)=>{const r=we("confirm-dialog-modal"),o=u.useRef(null),s=u.useCallback(async()=>(r.open(),new Promise(p=>{o.current=p})),[r]),l=u.useCallback(()=>{var p;r.close(),(p=o.current)==null||p.call(o,!0)},[r]),a=u.useCallback(()=>{var p;r.close(),(p=o.current)==null||p.call(o,!1)},[r]);return[s,({children:p})=>{const[d,g]=u.useState(i),x=u.useCallback(()=>{g({...i})},[]),h=u.useCallback(j=>()=>{g(w=>({...w,[j]:{...w[j],state:!w[j].state}}))},[]),b=!Object.values(d).every(({state:j})=>j),m=Object.entries(d).map(([j,{state:w,label:C}])=>t.jsx(pe,{defaultChecked:w,label:C,name:j,onChange:h(j)},j));return t.jsxs(Ot,{"data-testid":e,id:e,modalRef:{...r,close:a},onClose:x,size:"sm",title:n,children:[p,t.jsx($,{display:"flex",flexDirection:"column",gap:.5,children:m}),t.jsx(Kn,{disabled:b,id:e,onConfirm:l})]})}]},ia=()=>{const[e,n]=u.useState(!1),[i,r]=u.useState(),o=u.useRef(null),s=we("confirm-dialog-modal"),l=u.useCallback(async d=>(r(d),n(!0),new Promise(g=>{o.current=g})),[]),a=u.useCallback(()=>{var d;n(!1),r(void 0),(d=o.current)==null||d.call(o,!0)},[]),c=u.useCallback(()=>{var d;n(!1),r(void 0),(d=o.current)==null||d.call(o,!1)},[]);return u.useEffect(()=>{s.setIsOpen(e)},[e,s]),{ConfirmDialog:({id:d="confirm-dialog-modal",children:g})=>t.jsxs(Ot,{cancelButton:{onClick:c,text:"Cancel"},confirmButton:{id:(i==null?void 0:i.id)??"modal-confirm",onClick:a,text:"Confirm"},description:i==null?void 0:i.message,id:d,modalRef:{...s,close:c},size:"sm",title:i==null?void 0:i.title,children:[i==null?void 0:i.content,g]}),confirm:l}},ra=2e3,oa=({content:e})=>{const[n,i]=u.useState("Copy"),r=u.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{i("Copied"),setTimeout(()=>{i("Copy")},ra)}).catch(()=>{i("Failed to copy")})},[e]);return t.jsx(V,{icon:"copy",iconSize:"lg",iconType:"fa-light",onClick:r,tooltip:n,variant:"ghost"})},sa=y.styled.ul`
|
|
2443
2443
|
${({theme:e})=>`
|
|
2444
2444
|
align-items: flex-start;
|
|
2445
2445
|
border-radius: ${e.spacing[.25]};
|
|
@@ -2452,7 +2452,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2452
2452
|
width: 166px;
|
|
2453
2453
|
z-index: 9999;
|
|
2454
2454
|
`}
|
|
2455
|
-
`,
|
|
2455
|
+
`,aa=y.styled.li`
|
|
2456
2456
|
${({theme:e})=>`
|
|
2457
2457
|
align-items: center;
|
|
2458
2458
|
background: ${e.palette.white}
|
|
@@ -2478,7 +2478,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2478
2478
|
cursor: not-allowed;
|
|
2479
2479
|
}
|
|
2480
2480
|
`}
|
|
2481
|
-
`,
|
|
2481
|
+
`,la=({icon:e,iconColor:n,id:i,showChevron:r,options:o,title:s})=>{const l=y.useTheme(),[a,c]=u.useState(!1),p=a?"chevron-up":"chevron-down",{refs:d,floatingStyles:g}=f.useFloating({middleware:[f.offset({mainAxis:4})],placement:"bottom-start"}),x=u.useCallback(()=>{c(h=>!h)},[]);return re(a?d.floating.current:null,()=>{c(!1)},!0,[document.getElementById(`dropdown-toggle-${i}`)]),t.jsxs(u.Fragment,{children:[t.jsx(_,{"aria-label":s,icon:e,iconColor:n,iconType:"fa-solid",id:`dropdown-toggle-${i}`,onClick:x,ref:d.setReference,rightIcon:r?p:void 0,variant:"ghost",children:s}),a?t.jsx(sa,{ref:d.setFloating,style:g,children:o.map(h=>{const b=({})=>{h.onClick(),c(!1)};return t.jsxs(aa,{"aria-disabled":h.disabled,"aria-label":h.label,onClick:h.disabled?void 0:b,children:[t.jsx(R,{icon:h.icon,iconColor:h.iconColor??l.palette.gray[300],iconSize:"sm",iconType:"fa-light"}),h.label]},h.label)})}):void 0]})},bt=({buttonProps:e,variant:n})=>t.jsx(_,{onClick:e.onClick,variant:n,children:e.text}),ca=y.styled.div`
|
|
2482
2482
|
display: flex;
|
|
2483
2483
|
flex-direction: column;
|
|
2484
2484
|
align-items: center;
|
|
@@ -2486,7 +2486,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2486
2486
|
max-width: 900px;
|
|
2487
2487
|
white-space: pre-line;
|
|
2488
2488
|
margin: 0 auto;
|
|
2489
|
-
`,
|
|
2489
|
+
`,da=y.styled.div`
|
|
2490
2490
|
display: flex;
|
|
2491
2491
|
flex-direction: row;
|
|
2492
2492
|
justify-content: center;
|
|
@@ -2499,7 +2499,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2499
2499
|
> img {
|
|
2500
2500
|
width: 100%;
|
|
2501
2501
|
}
|
|
2502
|
-
`,
|
|
2502
|
+
`,pa=y.styled.div`
|
|
2503
2503
|
display: flex;
|
|
2504
2504
|
flex-direction: row;
|
|
2505
2505
|
margin: 0;
|
|
@@ -2512,7 +2512,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2512
2512
|
> *:last-child {
|
|
2513
2513
|
margin-right: 0;
|
|
2514
2514
|
}
|
|
2515
|
-
`,pn={md:{description:"md",title:"md"},sm:{description:"md",title:"xs"}},
|
|
2515
|
+
`,pn={md:{description:"md",title:"md"},sm:{description:"md",title:"xs"}},ga=({cancelButton:e=void 0,confirmButton:n=void 0,description:i,imageSrc:r="integrates/empty/addRoot",padding:o=1.25,title:s,size:l="md"})=>{const a=(n??e)!==void 0;return t.jsxs(ca,{$padding:o,children:[t.jsx(da,{children:t.jsx(oe,{alt:"empty-icon",publicId:r})}),t.jsx(G,{fontWeight:"bold",mb:.25,size:pn[l].title,textAlign:"center",children:s}),t.jsx(I,{mb:a?2:void 0,size:pn[l].description,textAlign:"center",children:i}),a?t.jsxs(pa,{children:[e&&t.jsx(bt,{buttonProps:e,variant:"tertiary"}),n&&t.jsx(bt,{buttonProps:n,variant:"primary"})]}):void 0]})},ye=20,ai=e=>{const[n,i]=(e==null?void 0:e.split(",").map(r=>r.trim()))??[];return!!(n&&n!=="-"&&f.dayjs(n).isValid()&&/^\d+\-\d+\-\d+$/.test(n.trim())||i&&i!=="-"&&f.dayjs(i).isValid()&&/^\d+\-\d+\-\d+$/.test(i.trim()))},li=e=>{const[n,i]=(e==null?void 0:e.split(",").map(r=>r.trim()))??[];return!!(n&&n!=="-"&&/^\d+$/.test(n.trim())||i&&i!=="-"&&/^\d+$/.test(i.trim()))},ua=e=>{var s,l;const n=e.split(",");if(n.length===0||ai(e)||li(e))return{content:void 0,showTooltip:!1};if(n.length===1){const a=(((s=n[0])==null?void 0:s.length)??0)>20;return{content:a?n[0]:void 0,showTooltip:a}}const i=((l=n[0])==null?void 0:l.length)??0,r=n.join(", ").length,o=i>20||r>20;return{content:o?[...n]:void 0,showTooltip:o}},dt=e=>{if(e.length<=ye)return e;const n=ye-3,i=Math.ceil(n/2),r=Math.floor(n/2);return`${e.slice(0,i)}...${e.slice(e.length-r)}`},xa=e=>{const[n,i]=(e==null?void 0:e.split(",").map(r=>r.trim()))??[];return n&&i&&n!=="-"&&i!=="-"?`${n} - ${i}`:e},ha=e=>{f.dayjs_minExports.extend(f.localizedFormat);const[n,i]=(e==null?void 0:e.split(",").map(r=>r.trim()))??[];return n&&i&&n!=="-"&&i!=="-"?`${f.dayjs(n).format("LL")} - ${f.dayjs(i).format("LL")}`:n&&n!=="-"?`From ${f.dayjs(n).format("LL")}`:i&&i!=="-"?`To ${f.dayjs(i).format("LL")}`:e},fa=e=>{const n=e.split(",");if(ai(e))return ha(e);if(li(e))return xa(e);if(n.length===1)return dt(e);if(n.length<=2){const s=n[0],l=n.join(", ").length;return s.length>ye||l>ye?`${dt(s)} +1 more`:e}const i=n[0],r=n.length-1,o=n.join(", ").length;return i.length>ye||o>ye?`${dt(i)} +${r} more`:e},ci=({filter:{id:e,label:n,value:i},onClose:r})=>{const o=fa(i),{content:s,showTooltip:l}=ua(i),a=t.jsx(q,{filterId:`${n}=${o}`,filterValues:o,icon:"filter-list",id:"remove-filter",onClose:r(e),tagLabel:`${n} `});return l?t.jsx(Z,{disabled:!l,id:"applied-filter-tooltip",nodeTip:Array.isArray(s)?t.jsx($,{display:"flex",flexDirection:"column",gap:.25,children:s.map(c=>t.jsxs($,{alignItems:"flex-start",display:"flex",gap:.5,whiteSpace:"normal",wordWrap:"break-word",children:[t.jsx("span",{children:"•"}),c]},c))}):t.jsx($,{whiteSpace:"normal",wordWrap:"break-word",children:s}),children:a}):a},ya=({filters:e})=>{const{appliedFilters:n,removeFilter:i}=Ct({filters:e});return n.length>0?t.jsx($,{alignItems:"center",display:"flex",gap:.5,pb:1,width:"100%",wrap:"wrap",children:n.map(r=>t.jsx(ci,{filter:r,onClose:i},`${r.id}-${r.value}`))}):null},Ve=u.createContext({id:"",calendarState:{isOpen:!1,updateCalendarState:()=>{}},searchState:{includeSearch:!1,previousValue:""},scrollState:{height:"0",ref:{current:null}},values:{},setValues:()=>Promise.resolve(new URLSearchParams),updateSearch:()=>{},updateScrollHeight:()=>{}}),di=y.styled.div`
|
|
2516
2516
|
${({theme:e,$left:n="0"})=>`
|
|
2517
2517
|
align-items: flex-start;
|
|
2518
2518
|
background: ${e.palette.white};
|
|
@@ -2529,7 +2529,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2529
2529
|
width: 342px;
|
|
2530
2530
|
z-index: 99999;
|
|
2531
2531
|
`}
|
|
2532
|
-
`,
|
|
2532
|
+
`,pi=y.styled.div`
|
|
2533
2533
|
${({theme:e})=>`
|
|
2534
2534
|
align-items: flex-start;
|
|
2535
2535
|
display: flex;
|
|
@@ -2538,7 +2538,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2538
2538
|
padding: ${e.spacing[.875]} ${e.spacing[.875]} 0 ${e.spacing[.875]};
|
|
2539
2539
|
width: 100%;
|
|
2540
2540
|
`}
|
|
2541
|
-
`,Bt=
|
|
2541
|
+
`,Bt=y.styled.div`
|
|
2542
2542
|
${({theme:e,$border:n})=>`
|
|
2543
2543
|
align-items: flex-start;
|
|
2544
2544
|
border-top: ${n?`1px solid ${e.palette.gray[200]}`:"unset"};
|
|
@@ -2552,7 +2552,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2552
2552
|
width: 100%;
|
|
2553
2553
|
}
|
|
2554
2554
|
`}
|
|
2555
|
-
`,Ie=
|
|
2555
|
+
`,Ie=y.styled.div`
|
|
2556
2556
|
${({theme:e})=>`
|
|
2557
2557
|
align-items: center;
|
|
2558
2558
|
display: flex;
|
|
@@ -2574,10 +2574,10 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2574
2574
|
background: ${e.palette.gray[100]};
|
|
2575
2575
|
}
|
|
2576
2576
|
`}
|
|
2577
|
-
`,
|
|
2577
|
+
`,gi=y.styled.button`
|
|
2578
2578
|
${zt}
|
|
2579
2579
|
min-width: fit-content;
|
|
2580
|
-
`,Wt=()=>{const e=f.useTheme();return t.jsx(Bt,{children:t.jsxs($,{alignItems:"center",display:"flex",flexDirection:"column",gap:.75,justify:"center",px:1.25,py:1.25,children:[t.jsx($,{alignItems:"center",bgColor:e.palette.gray[200],borderRadius:e.spacing[.5],display:"flex",justify:"center",children:t.jsx(R,{icon:"search",iconSize:"lg",mx:.5,my:.5})}),t.jsxs($,{alignItems:"center",display:"flex",flexDirection:"column",gap:.25,justify:"center",children:[t.jsx(G,{fontWeight:"bold",size:"xs",textAlign:"center",children:"No matches found"}),t.jsx(I,{size:"md",textAlign:"center",children:"We couldn’t find anything that matches your filters. Try adjusting your search or clearing filters."})]})]})})},pi=7,xs=e=>e.reduce((n,i)=>(i.group?(n[i.group]||(n[i.group]=[]),n[i.group].push(i)):n.default=[...n.default||[],i],n),{}),hs=(e,n,i)=>{var l;const r=e.find(s=>s.id===n);if(!r||!i)return{label:(r==null?void 0:r.label)??"",options:(r==null?void 0:r.options)??[]};const o=i.split(","),a=(l=r.options)==null?void 0:l.map(s=>{if(!s.items)return s;const c=[...s.items].sort((p,d)=>{const g=o.includes(p.value),x=o.includes(d.value);return g===x?0:g?-1:1});return{...s,items:c}});return{label:r.label,options:a}},fs=(e,n)=>Object.entries(e).map(([i,r])=>{const o=r.filter(a=>a.label.toLowerCase().includes(n.toLowerCase()));return o.length>0?{group:i,filters:o}:void 0}).filter(i=>i!==void 0),gi=u.forwardRef(function({includeSearch:n=!1,groupedFilters:i,handleChangeId:r},o){const a=f.useTheme(),[l,s]=u.useState(""),{values:c,updateSearch:p,setValues:d}=u.useContext(Ve),{searchGlobal:g}=c,x=fs(i,g),h=u.useMemo(()=>Object.values(c).filter(Boolean).length>0,[c]),b=u.useCallback(w=>()=>{r(w),s(w),p({previousValue:c[w]??""}),d(C=>({...C,searchGlobal:null,search:null}))},[r,p,d,c]),m=u.useCallback(()=>{d(w=>Object.keys(w).reduce((C,k)=>({...C,[k]:null}),{})),s("")},[d]),j=u.useCallback(w=>{d(C=>({...C,searchGlobal:w.target.value}))},[d]);return t.jsxs(li,{ref:o,children:[t.jsxs(ci,{children:[t.jsxs($,{display:"flex",justify:"space-between",width:"100%",children:[t.jsx(I,{color:a.palette.gray[800],fontWeight:"bold",size:"md",children:"Filters menu"}),h?t.jsx(di,{$variant:"lowRelevance",onClick:m,type:"button",children:"Reset all"}):void 0]}),n?t.jsx(ge,{onChange:j,placeholder:"Search filter...",value:g}):void 0]}),t.jsx($,{alignItems:"flex-start",display:"flex",flexDirection:"column",scroll:"y",width:"100%",children:x.length>0?x.map(({group:w,filters:C},k)=>C.length>0?t.jsxs(Bt,{$border:k>0&&w!=="default",children:[w!=="default"?t.jsx(I,{color:a.palette.gray[400],fontWeight:"bold",mb:.5,size:"md",children:w}):void 0,C.map(v=>{const S=c[v.id].split(",").filter(T=>T&&T!=="-").length.toString();return t.jsx(u.Fragment,{children:t.jsxs(Ie,{as:"button","data-testid":v.id,onClick:b(v.id),children:[t.jsx(R,{icon:"filter",iconClass:"filter-item",iconSize:"md",iconType:"fa-light"}),v.label,t.jsxs($,{alignItems:"center",display:"flex",gap:.5,style:{marginLeft:"auto"},children:[l===v.id?t.jsx(R,{icon:"chevron-right",iconClass:"selected",iconSize:"lg",iconType:"fa-light"}):void 0,S>0?t.jsx(q,{tagLabel:S,variant:"default"}):void 0]})]})},`${v.id}-${y.random(1,10)}`)})]},w):void 0):t.jsx(Wt,{})})]})}),ys=e=>{const[n,i]=u.useState({includeSearch:e,previousValue:""}),r=u.useCallback(o=>{i(a=>({...a,...o}))},[]);return{searchState:n,updateSearch:r}},bs=()=>{const e=u.useRef(null),[n,i]=u.useState("0"),r=u.useMemo(()=>({height:n,ref:e}),[n]),o=u.useCallback(a=>{i(a)},[]);return{scrollState:r,updateScrollHeight:o}},$s=()=>{const[e,n]=u.useState(!1),i=u.useCallback(r=>{n(r)},[]);return{calendarState:{isOpen:e,updateCalendarState:i}}},ms={checkboxes:({items:e,virtualItems:n,filterValue:i,ref:r,onChange:o})=>n.length>0?n.map(a=>{const l=e[a.index];return t.jsx("div",{"data-index":a.index,ref:r,style:{position:"absolute",top:`${a.start}px`,left:0,width:"100%"},children:t.jsx(Ie,{children:t.jsx(pe,{checked:i==null?void 0:i.split(",").includes(l==null?void 0:l.value),label:l==null?void 0:l.label,name:l==null?void 0:l.value,onChange:o,value:l==null?void 0:l.value})})},`${a.index}-${l==null?void 0:l.value}`)}):t.jsx(Wt,{}),list:({items:e,filterValue:n,onListChange:i})=>e.map(r=>t.jsxs(Ie,{as:"button",onClick:i==null?void 0:i(r.value),children:[r.icon?t.jsx(R,{icon:r.icon,iconSize:"md",iconType:"fa-light"}):void 0,r.label,t.jsx("span",{className:"filter-item"}),n===r.value?t.jsx("div",{style:{marginLeft:"auto"},children:t.jsx(R,{icon:"check",iconClass:"selected",iconSize:"lg",iconType:"fa-light"})}):void 0]},`li-radio-${r.value}`)),dateRange:({id:e,filterValue:n,onRangeChange:i,updateCalendarState:r})=>{const[o,a]=(n==null?void 0:n.split(",").filter(l=>y.dayjs(l).isValid()||l==="-"))??[];return t.jsx(Ie,{children:t.jsx(Ft,{name:e,onOpenCalendar:r,propsMax:{name:"maxValue",value:a!=="-"?a:"",onChange:i==null?void 0:i(1)},propsMin:{name:"minValue",value:o!=="-"?o:"",onChange:i==null?void 0:i(0)},variant:"filters"})})},numberRange:({id:e,filterValue:n,minValue:i,maxValue:r,onRangeNumberChange:o})=>{const[a,l]=(n==null?void 0:n.split(",").filter(Boolean).map(Number).filter(s=>!y.isNaN(s)))??[];return t.jsx(Ie,{children:t.jsx(Rt,{name:e,propsMax:{name:"maxValue",min:i,max:r,onChange:o==null?void 0:o(1),placeholder:"Max %",value:l},propsMin:{name:"minValue",min:i,max:r,onChange:o==null?void 0:o(0),placeholder:"Min %",value:a},variant:"filters"})})}},ui=({id:e,filterValue:n,option:i,onChange:r})=>{const{items:o=[],type:a,minValue:l,maxValue:s}=i??{},c=a&&ms[a],{calendarState:{updateCalendarState:p},scrollState:d,updateSearch:g,updateScrollHeight:x,values:h}=u.useContext(Ve),{search:b}=h,m=u.useMemo(()=>o.filter(S=>{var T;return((T=S.label)==null?void 0:T.toLowerCase().includes(b.toLowerCase()))??!1}),[o,b]),j=y.useVirtualizer({count:m.length,estimateSize:()=>36,getScrollElement:()=>d.ref.current}),w=j.getVirtualItems(),C=u.useCallback(S=>{S.stopPropagation(),S.preventDefault(),r(S.target.value,a??"")},[r,a]),k=u.useCallback(S=>T=>{r(T,"dateRange",S)},[r]),v=u.useCallback(S=>T=>{T.stopPropagation(),T.preventDefault(),r(T.target.value,"numberRange",S)},[r]),z=u.useCallback(S=>()=>{r(S,"list")},[r]);return u.useEffect(()=>{g({includeSearch:o.length>pi}),a==="checkboxes"&&w.length>0?x(`${j.getTotalSize()}px`):a==="checkboxes"&&w.length===0&&x("fit-content")},[j,x,a,o.length,g,w.length]),t.jsx(t.Fragment,{children:(c==null?void 0:c({items:m,virtualItems:w,id:e,filterValue:n,onChange:C,onListChange:z,onRangeChange:k,onRangeNumberChange:v,ref:j.measureElement,updateCalendarState:p,minValue:l,maxValue:s}))??null})},dt=e=>(e==null?void 0:e.split(",").filter(n=>n!==""))??[],xi=u.forwardRef(function({label:n,options:i},r){const o=f.useTheme(),{id:a,searchState:l,values:s,setValues:c,scrollState:p}=u.useContext(Ve),{includeSearch:d}=l,{height:g,ref:x}=p,h=g!=="fit-content",b=s[a],{search:m}=s,j=u.useCallback(()=>{c(k=>({...k,[a]:null}))},[c,a]),w=u.useCallback(k=>{c(v=>({...v,search:k.target.value}))},[c]),C=u.useCallback((k,v,z)=>{c(S=>{if(v==="checkboxes"){const T=dt(S[a]??""),N=T!=null&&T.includes(k)?T==null?void 0:T.filter(E=>E!==k).join(","):[...T,k].join(",");return{...S,[a]:N}}if(v==="dateRange"){const T=dt(S[a]??""),N=T.filter(P=>P!=="-"&&!RegExp(/^\d+\-\d+\-\d+$/).test(P.trim())),E=T.filter(P=>y.dayjs(P).isValid()&&y.dayjs(P).isAfter(y.dayjs("1900-01-01"))),D=y.dayjs(k,"YYYY-MM-DD",!0),F=["-","-"];return E.length===2?(F[0]=E[0],F[1]=E[1]):E.length===1&&(D.isAfter(y.dayjs(E[0]))?(F[0]=E[0],F[1]=k):(F[0]=k,F[1]=E[0])),F[z??0]=k,{...S,[a]:[...N,...F].join(",")}}if(v==="numberRange"){const T=dt(S[a]??""),N=T.filter(F=>!RegExp(/^\d+$/).test(F)),E=T.map(Number).filter(F=>y.lodashExports.isNumber(F)&&!y.lodashExports.isNaN(F)),D=[E[0]??"",E[1]??""];return D[z??0]=Number(k),{...S,[a]:[...N,...D].join(",")}}return{...S,[a]:k}})},[a,c]);return t.jsxs(li,{$left:"346px",ref:r,children:[t.jsxs(ci,{style:{paddingBottom:d&&h?o.spacing[.875]:0},children:[t.jsxs($,{display:"flex",justify:"space-between",width:"100%",children:[t.jsx(I,{color:o.palette.gray[800],fontWeight:"bold",size:"md",children:`Select ${n}`}),b?t.jsx(di,{$variant:"lowRelevance",onClick:j,type:"button",children:"Reset all"}):void 0]}),d?t.jsx(ge,{onChange:w,placeholder:`Search ${n}...`,value:m}):void 0]}),t.jsx($,{ref:x,scroll:"y",width:"100%",children:i==null?void 0:i.map((k,v,z)=>t.jsx("div",{style:{...k.type==="checkboxes"?{height:g,...h?{margin:d?` 0 ${o.spacing[.875]} ${o.spacing[.875]} ${o.spacing[.875]}`:o.spacing[.875],width:"90%"}:{}}:{},position:"relative"},children:t.jsxs(Bt,{$border:z.length>1&&v>0,style:{padding:h?o.spacing[.875]:0},children:[v>0?t.jsx(I,{color:o.palette.gray[800],fontWeight:"bold",mb:.5,size:"md",children:k.label}):void 0,t.jsx(ui,{filterValue:b,id:a,onChange:C,option:k})]})},`${k.label}-${v}`))})]})}),js=({filters:e})=>{const n=we("filters"),{calendarState:i}=$s(),{searchState:r,updateSearch:o}=ys(!1),{scrollState:a,updateScrollHeight:l}=bs(),[s,c]=y.useQueryState("filter"),[p,d]=u.useState(""),{refs:g}=y.useFloating({placement:"bottom-start"}),{refs:x}=y.useFloating({elements:{reference:g.reference.current},placement:"right-end"}),{activeFilters:h,values:b,setValues:m}=Ct({filters:e}),{previousValue:j}=r,{label:w,options:C}=hs(e,p,j),k=xs(e),v=y.isEmpty(s)||s===null||p!==s,z=u.useCallback(T=>{d(T),c(T)},[c]),S=u.useCallback(()=>{n.toggle(),c(null),m(T=>({...T,searchGlobal:null,search:null}))},[n,c,m]);return re(g.floating.current,()=>{i.isOpen||(n.close(),c(null),m(T=>({...T,searchGlobal:null,search:null})))},!0,[g.reference.current,x.floating.current]),t.jsx(Ve.Provider,{value:{id:p,calendarState:i,searchState:r,values:b,scrollState:a,setValues:m,updateSearch:o,updateScrollHeight:l},children:t.jsxs($,{alignItems:"center",display:"flex",position:"relative",wrap:"wrap",children:[t.jsx(M,{icon:"filter",id:"filter-btn",onClick:S,ref:g.setReference,tag:h.toString(),variant:"ghost"}),n.isOpen?t.jsx(gi,{groupedFilters:k,handleChangeId:z,includeSearch:e.length>pi,ref:g.setFloating}):void 0,v?void 0:t.jsx(xi,{label:w.toLowerCase(),options:C,ref:x.setFloating})]})})},ws=({children:e})=>{const n=y.useFormContext();return e({...n})},vs=f.styled.form`
|
|
2580
|
+
`,Wt=()=>{const e=y.useTheme();return t.jsx(Bt,{children:t.jsxs($,{alignItems:"center",display:"flex",flexDirection:"column",gap:.75,justify:"center",px:1.25,py:1.25,children:[t.jsx($,{alignItems:"center",bgColor:e.palette.gray[200],borderRadius:e.spacing[.5],display:"flex",justify:"center",children:t.jsx(R,{icon:"search",iconSize:"lg",mx:.5,my:.5})}),t.jsxs($,{alignItems:"center",display:"flex",flexDirection:"column",gap:.25,justify:"center",children:[t.jsx(G,{fontWeight:"bold",size:"xs",textAlign:"center",children:"No matches found"}),t.jsx(I,{size:"md",textAlign:"center",children:"We couldn’t find anything that matches your filters. Try adjusting your search or clearing filters."})]})]})})},ui=7,ba=e=>e.reduce((n,i)=>(i.group?(n[i.group]||(n[i.group]=[]),n[i.group].push(i)):n.default=[...n.default||[],i],n),{}),$a=(e,n,i)=>{var l;const r=e.find(a=>a.id===n);if(!r||!i)return{label:(r==null?void 0:r.label)??"",options:(r==null?void 0:r.options)??[]};const o=i.split(","),s=(l=r.options)==null?void 0:l.map(a=>{if(!a.items)return a;const c=[...a.items].sort((p,d)=>{const g=o.includes(p.value),x=o.includes(d.value);return g===x?0:g?-1:1});return{...a,items:c}});return{label:r.label,options:s}},ma=(e,n)=>Object.entries(e).map(([i,r])=>{const o=r.filter(s=>s.label.toLowerCase().includes(n.toLowerCase()));return o.length>0?{group:i,filters:o}:void 0}).filter(i=>i!==void 0),xi=u.forwardRef(function({includeSearch:n=!1,groupedFilters:i,handleChangeId:r},o){const s=y.useTheme(),[l,a]=u.useState(""),{values:c,updateSearch:p,setValues:d}=u.useContext(Ve),{searchGlobal:g}=c,x=ma(i,g),h=u.useMemo(()=>Object.values(c).filter(Boolean).length>0,[c]),b=u.useCallback(w=>()=>{r(w),a(w),p({previousValue:c[w]??""}),d(C=>({...C,searchGlobal:null,search:null}))},[r,p,d,c]),m=u.useCallback(()=>{d(w=>Object.keys(w).reduce((C,k)=>({...C,[k]:null}),{})),a("")},[d]),j=u.useCallback(w=>{d(C=>({...C,searchGlobal:w.target.value}))},[d]);return t.jsxs(di,{"data-testid":"filters-menu",ref:o,children:[t.jsxs(pi,{children:[t.jsxs($,{display:"flex",justify:"space-between",width:"100%",children:[t.jsx(I,{color:s.palette.gray[800],fontWeight:"bold",size:"md",children:"Filters menu"}),h?t.jsx(gi,{$variant:"lowRelevance",onClick:m,type:"button",children:"Reset all"}):void 0]}),n?t.jsx(ge,{name:"filters-search",onChange:j,placeholder:"Search filter...",value:g}):void 0]}),t.jsx($,{alignItems:"flex-start",display:"flex",flexDirection:"column",scroll:"y",width:"100%",children:x.length>0?x.map(({group:w,filters:C},k)=>C.length>0?t.jsxs(Bt,{$border:k>0&&w!=="default","data-testid":`${w?`menu-${f.snakeCase(w)}`:"menu-content"}`,children:[w!=="default"?t.jsx(I,{color:s.palette.gray[400],fontWeight:"bold",mb:.5,size:"md",children:w}):void 0,C.map(v=>{const S=c[v.id].split(",").filter(T=>T&&T!=="-").length.toString();return t.jsx(u.Fragment,{children:t.jsxs(Ie,{as:"button","data-testid":v.id,onClick:b(v.id),children:[t.jsx(R,{icon:"filter",iconClass:"filter-item",iconSize:"md",iconType:"fa-light"}),v.label,t.jsxs($,{alignItems:"center",display:"flex",gap:.5,style:{marginLeft:"auto"},children:[l===v.id?t.jsx(R,{icon:"chevron-right",iconClass:"selected",iconSize:"lg",iconType:"fa-light"}):void 0,S>0?t.jsx(q,{tagLabel:S,variant:"default"}):void 0]})]})},`${v.id}-${f.random(1,10)}`)})]},w):void 0):t.jsx(Wt,{})})]})}),ja=e=>{const[n,i]=u.useState({includeSearch:e,previousValue:""}),r=u.useCallback(o=>{i(s=>({...s,...o}))},[]);return{searchState:n,updateSearch:r}},wa=()=>{const e=u.useRef(null),[n,i]=u.useState("0"),r=u.useMemo(()=>({height:n,ref:e}),[n]),o=u.useCallback(s=>{i(s)},[]);return{scrollState:r,updateScrollHeight:o}},va=()=>{const[e,n]=u.useState(!1),i=u.useCallback(r=>{n(r)},[]);return{calendarState:{isOpen:e,updateCalendarState:i}}},ka={checkboxes:({items:e,virtualItems:n,filterValue:i,ref:r,onChange:o})=>n.length>0?n.map(s=>{const l=e[s.index],a=i==null?void 0:i.split(",").includes(l==null?void 0:l.value);return t.jsx("div",{"data-index":s.index,ref:r,style:{position:"absolute",top:`${s.start}px`,left:0,width:"100%"},children:t.jsx(Ie,{"aria-selected":a,children:t.jsx(pe,{checked:a,label:l==null?void 0:l.label,name:l==null?void 0:l.value,onChange:o,value:l==null?void 0:l.value})})},`${s.index}-${l==null?void 0:l.value}`)}):t.jsx(Wt,{}),list:({items:e,filterValue:n,onListChange:i})=>e.map(r=>t.jsxs(Ie,{"aria-selected":n==null?void 0:n.split(",").includes(r==null?void 0:r.value),as:"button",onClick:i==null?void 0:i(r.value),children:[r.icon?t.jsx(R,{icon:r.icon,iconSize:"md",iconType:"fa-light"}):void 0,r.label,t.jsx("span",{className:"filter-item"}),n!=null&&n.split(",").includes(r==null?void 0:r.value)?t.jsx("div",{style:{marginLeft:"auto"},children:t.jsx(R,{icon:"check",iconClass:"selected",iconSize:"lg",iconType:"fa-light"})}):void 0]},`li-radio-${r.value}`)),dateRange:({id:e,filterValue:n,onRangeChange:i,updateCalendarState:r})=>{const[o,s]=(n==null?void 0:n.split(",").filter(l=>f.dayjs(l).isValid()||l==="-"))??[];return t.jsx(Ie,{children:t.jsx(Et,{name:e,onOpenCalendar:r,propsMax:{name:"maxValue",value:s!=="-"?s:"",onChange:i==null?void 0:i(1)},propsMin:{name:"minValue",value:o!=="-"?o:"",onChange:i==null?void 0:i(0)},variant:"filters"})})},numberRange:({id:e,filterValue:n,minValue:i,maxValue:r,onRangeNumberChange:o})=>{const[s,l]=(n==null?void 0:n.split(",").filter(Boolean).map(Number).filter(a=>!f.isNaN(a)))??[];return t.jsx(Ie,{children:t.jsx(Rt,{name:e,propsMax:{name:"maxValue",min:i,max:r,onChange:o==null?void 0:o(1),placeholder:"Max %",value:l},propsMin:{name:"minValue",min:i,max:r,onChange:o==null?void 0:o(0),placeholder:"Min %",value:s},variant:"filters"})})}},hi=({id:e,filterValue:n,option:i,onChange:r})=>{const{items:o=[],type:s,minValue:l,maxValue:a}=i??{},c=s&&ka[s],{calendarState:{updateCalendarState:p},scrollState:d,updateSearch:g,updateScrollHeight:x,values:h}=u.useContext(Ve),{search:b}=h,m=u.useMemo(()=>o.filter(S=>{var T;return((T=S.label)==null?void 0:T.toLowerCase().includes(b.toLowerCase()))??!1}),[o,b]),j=f.useVirtualizer({count:m.length,estimateSize:()=>36,getScrollElement:()=>d.ref.current}),w=j.getVirtualItems(),C=u.useCallback(S=>{S.stopPropagation(),S.preventDefault(),r(S.target.value,s??"")},[r,s]),k=u.useCallback(S=>T=>{r(T,"dateRange",S)},[r]),v=u.useCallback(S=>T=>{T.stopPropagation(),T.preventDefault(),r(T.target.value,"numberRange",S)},[r]),z=u.useCallback(S=>()=>{r(S,"list")},[r]);return u.useEffect(()=>{g({includeSearch:o.length>ui}),s==="checkboxes"&&w.length>0?x(`${j.getTotalSize()}px`):s==="checkboxes"&&w.length===0&&x("fit-content")},[j,x,s,o.length,g,w.length]),t.jsx(t.Fragment,{children:(c==null?void 0:c({items:m,virtualItems:w,id:e,filterValue:n,onChange:C,onListChange:z,onRangeChange:k,onRangeNumberChange:v,ref:j.measureElement,updateCalendarState:p,minValue:l,maxValue:a}))??null})},Ye=e=>(e==null?void 0:e.split(",").filter(n=>n!==""))??[],fi=u.forwardRef(function({label:n,options:i},r){const o=y.useTheme(),{id:s,searchState:l,values:a,setValues:c,scrollState:p}=u.useContext(Ve),{includeSearch:d}=l,{height:g,ref:x}=p,h=g!=="fit-content",b=a[s],{search:m}=a,j=u.useCallback(()=>{c(k=>({...k,[s]:null}))},[c,s]),w=u.useCallback(k=>{c(v=>({...v,search:k.target.value}))},[c]),C=u.useCallback((k,v,z)=>{c(S=>{if(v==="checkboxes"){const T=Ye(S[s]??""),N=T!=null&&T.includes(k)?T==null?void 0:T.filter(E=>E!==k).join(","):[...T,k].join(",");return{...S,[s]:N}}if(v==="dateRange"){const T=Ye(S[s]??""),N=T.filter(P=>P!=="-"&&!RegExp(/^\d+\-\d+\-\d+$/).test(P.trim())),E=T.filter(P=>f.dayjs(P).isValid()&&f.dayjs(P).isAfter(f.dayjs("1903-01-01"))),D=f.dayjs(k,"YYYY-MM-DD",!0),F=["-","-"];return E.length===2?(F[0]=E[0],F[1]=E[1]):E.length===1&&(D.isAfter(f.dayjs(E[0]))?(F[0]=E[0],F[1]=k):(F[0]=k,F[1]=E[0])),F[z??0]=k,{...S,[s]:[...N,...F].join(",")}}if(v==="numberRange"){const T=Ye(S[s]??""),N=T.filter(F=>!RegExp(/^\d+$/).test(F)),E=T.map(Number).filter(F=>f.lodashExports.isNumber(F)&&!f.lodashExports.isNaN(F)),D=[E[0]??"",E[1]??""];return D[z??0]=Number(k),{...S,[s]:[...N,...D].join(",")}}if(v==="list"){const N=Ye(S[s]??"").filter(E=>E==="-"||RegExp(/^\d+$/).test(E)||RegExp(/^\d+\-\d+\-\d+$/).test(E.trim()));return{...S,[s]:[...N,k].join(",")}}return{...S,[s]:k}})},[s,c]);return t.jsxs(di,{$left:"346px","data-testid":"options-menu",ref:r,children:[t.jsxs(pi,{style:{paddingBottom:d&&h?o.spacing[.875]:0},children:[t.jsxs($,{display:"flex",justify:"space-between",width:"100%",children:[t.jsx(I,{color:o.palette.gray[800],fontWeight:"bold",size:"md",children:`Select ${n}`}),b?t.jsx(gi,{$variant:"lowRelevance",onClick:j,type:"button",children:"Reset all"}):void 0]}),d?t.jsx(ge,{name:"options-search",onChange:w,placeholder:`Search ${n}...`,value:m}):void 0]}),t.jsx($,{"data-testid":"options-scrollable-menu",ref:x,scroll:"y",width:"100%",children:i==null?void 0:i.map((k,v,z)=>t.jsx("div",{style:{...k.type==="checkboxes"?{height:g,...h?{margin:d?` 0 ${o.spacing[.875]} ${o.spacing[.875]} ${o.spacing[.875]}`:o.spacing[.875],width:"90%"}:{}}:{},position:"relative"},children:t.jsxs(Bt,{$border:z.length>1&&v>0,style:{padding:h?o.spacing[.875]:0},children:[v>0?t.jsx(I,{color:o.palette.gray[800],fontWeight:"bold",mb:.5,size:"md",children:k.label}):void 0,t.jsx(hi,{filterValue:b,id:s,onChange:C,option:k})]})},`${k.label}-${v}`))})]})}),Ca=({filters:e})=>{const n=we("filters"),{calendarState:i}=va(),{searchState:r,updateSearch:o}=ja(!1),{scrollState:s,updateScrollHeight:l}=wa(),[a,c]=f.useQueryState("filter"),[p,d]=u.useState(""),{refs:g}=f.useFloating({placement:"bottom-start"}),{refs:x}=f.useFloating({elements:{reference:g.reference.current},placement:"right-end"}),{activeFilters:h,values:b,setValues:m}=Ct({filters:e}),{previousValue:j}=r,{label:w,options:C}=$a(e,p,j),k=ba(e),v=f.isEmpty(a)||a===null||p!==a,z=u.useCallback(T=>{d(T),c(T)},[c]),S=u.useCallback(()=>{n.toggle(),c(null),m(T=>({...T,searchGlobal:null,search:null}))},[n,c,m]);return re(g.floating.current,()=>{i.isOpen||(n.close(),c(null),m(T=>({...T,searchGlobal:null,search:null})))},!0,[g.reference.current,x.floating.current]),t.jsx(Ve.Provider,{value:{id:p,calendarState:i,searchState:r,values:b,scrollState:s,setValues:m,updateSearch:o,updateScrollHeight:l},children:t.jsxs($,{alignItems:"center",display:"flex",position:"relative",wrap:"wrap",children:[t.jsx(_,{"data-testid":"filter-btn",icon:"filter",id:"filter-btn",onClick:S,ref:g.setReference,tag:h.toString(),variant:"ghost"}),n.isOpen?t.jsx(xi,{groupedFilters:k,handleChangeId:z,includeSearch:e.length>ui,ref:g.setFloating}):void 0,v?void 0:t.jsx(fi,{label:w.toLowerCase(),options:C,ref:x.setFloating})]})})},Sa=({children:e})=>{const n=f.useFormContext();return e({...n})},za=y.styled.form`
|
|
2581
2581
|
${({theme:e})=>`
|
|
2582
2582
|
align-items: flex-start;
|
|
2583
2583
|
align-self: stretch;
|
|
@@ -2587,7 +2587,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2587
2587
|
overflow: hidden auto;
|
|
2588
2588
|
width: 100%;
|
|
2589
2589
|
`}
|
|
2590
|
-
`,
|
|
2590
|
+
`,Ta=({alert:e,buttonAlignment:n,cancelButton:i,children:r,confirmButton:o,defaultDisabled:s=!0,id:l="modal-confirm",maxButtonWidth:a="392px",mode:c,onSubmit:p,padding:d=!0,showButtons:g=!0,yupSchema:x,...h})=>{const b=y.useTheme(),m=f.useForm({...h,mode:c??"all",resolver:x?f.o(x):void 0});function j(v){v.stopPropagation(),m.handleSubmit(p)(v)}const C=g?`calc(100% - ${e?"139px":"83px"})`:"100%",k=d?1.5:0;return t.jsx(f.FormProvider,{...m,children:t.jsx(za,{onSubmit:j,children:t.jsxs($,{scroll:"y",width:"100%",children:[t.jsx($,{borderRadius:`0 0 ${b.spacing[.25]} ${b.spacing[.25]}`,display:"flex",flexDirection:"column",gap:.5,height:C,pb:k,pt:0,px:k,scroll:"y",children:r}),g&&t.jsxs($,{borderRadius:`0 0 ${b.spacing[.25]} ${b.spacing[.25]}`,borderTop:`1px solid ${b.palette.gray[200]}`,display:"flex",flexDirection:n?"unset":"column",gap:.625,justify:n??"stretch",position:"sticky",px:1.25,py:1.25,children:[e,t.jsxs($,{display:"flex",gap:.75,maxWidth:a,children:[i?t.jsx(_,{icon:i.icon,id:`${l}-cancel`,justify:"center",onClick:i.onClick,type:"reset",variant:"tertiary",width:"100%",children:i.label??"Cancel"}):void 0,t.jsx(_,{disabled:((o==null?void 0:o.disabled)??!1)||m.formState.isSubmitting||s&&!m.formState.isDirty,icon:o==null?void 0:o.icon,id:l,justify:"center",type:"submit",width:"100%",children:(o==null?void 0:o.label)??"Confirm"})]})]})]})})})},Ia=y.styled(_e)`
|
|
2591
2591
|
display: grid;
|
|
2592
2592
|
grid-template-columns: ${({$sm:e})=>`repeat(${e}, 1fr)`};
|
|
2593
2593
|
grid-auto-flow: ${({$autoFlow:e="row"})=>e};
|
|
@@ -2607,7 +2607,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2607
2607
|
grid-template-columns: repeat(${n}, 1fr);
|
|
2608
2608
|
}
|
|
2609
2609
|
`}
|
|
2610
|
-
`,
|
|
2610
|
+
`,Da=u.forwardRef(function({children:n,md:i,sm:r,lg:o,xl:s,gap:l,gridAutoFlow:a,rowGap:c,columnGap:p,...d},g){return t.jsx(Ia,{$autoFlow:a,$columnGap:p,$gap:l,$lg:o,$md:i,$rowGap:c,$sm:r,$xl:s,ref:g,...d,children:n})}),Ea=y.styled.div`
|
|
2611
2611
|
${({theme:e,$itemsLength:n})=>`
|
|
2612
2612
|
display: flex;
|
|
2613
2613
|
background-color: ${e.palette.white};
|
|
@@ -2626,7 +2626,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2626
2626
|
width: 507px;
|
|
2627
2627
|
}
|
|
2628
2628
|
`}
|
|
2629
|
-
`,
|
|
2629
|
+
`,Mt=y.styled.div`
|
|
2630
2630
|
${({theme:e,$isSelected:n})=>`
|
|
2631
2631
|
align-items: center;
|
|
2632
2632
|
background-color: ${n?e.palette.gray[100]:e.palette.white};
|
|
@@ -2643,7 +2643,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2643
2643
|
background-color: ${e.palette.gray[100]};
|
|
2644
2644
|
}
|
|
2645
2645
|
`}
|
|
2646
|
-
`,
|
|
2646
|
+
`,yi=({isSelected:e=!1,label:n,onSelect:i})=>{const r=y.useTheme(),o=u.useCallback(()=>{i&&i(n)},[i,n]);return t.jsxs(Mt,{$isSelected:e,onClick:o,children:[e?t.jsx(R,{icon:"check",iconColor:r.palette.gray[800],iconSize:"lg"}):null,t.jsx(I,{color:r.palette.gray[800],fontWeight:"bold",size:"md",children:n})]})},Xe=100,Fa=({isOpen:e=!0,items:n,handleNewOrganization:i,onSelect:r,onClose:o,selectedItem:s,title:l,variant:a})=>{const c=y.useTheme(),[p,d]=u.useState(n),[g,x]=u.useState(""),h=u.useCallback(w=>{if(!w){d(n);return}const C=w.slice(0,Xe);d(k=>{const v=C.toLowerCase();return k.filter(z=>{const S=String(z.name).toLowerCase();return S.startsWith(v)||S.includes(v)})})},[d,n]),b=u.useCallback(w=>{if(w.currentTarget){const C=w.currentTarget.value.slice(0,Xe);x(C),h(C)}},[x,h]),m=u.useCallback(w=>{const C=w.target.value.slice(0,Xe);x(C),h(C)},[x,h]);u.useEffect(()=>{e&&(x(""),d(n))},[e,n]),u.useEffect(()=>{g?h(g):d(n)},[n,g,h]);const j=t.jsx($,{"aria-modal":"true",className:"comp-modal fixed inset-0 overflow-auto",zIndex:99999,children:t.jsx($,{alignItems:"center",bgColor:"rgb(52 64 84 / 70%)",display:"flex",height:"100vh",justify:"center",left:"0",top:"0",width:"100%",children:t.jsxs(Ea,{$itemsLength:p.length,children:[t.jsxs($,{alignItems:"center",display:"flex",justify:"space-between",children:[t.jsx(I,{color:c.palette.gray[800],fontWeight:"bold",size:"lg",children:l}),t.jsx(V,{icon:"xmark",iconColor:c.palette.gray[400],iconSize:"lg",iconType:"fa-light",onClick:o,variant:"ghost"})]}),t.jsx($,{mt:1,children:t.jsx(ge,{maxLength:Xe,onChange:m,onInput:b,placeholder:"Search",value:g})}),t.jsx(me,{mb:1,mt:1}),t.jsxs($,{display:"inline-flex",gap:1,maxHeight:"332px",scroll:"y",wrap:"wrap",children:[a==="organization-selector"?t.jsx(Mt,{onClick:i,children:t.jsxs($,{alignItems:"center",display:"flex",children:[t.jsx(R,{icon:"square-plus",iconColor:c.palette.gray[400],iconSize:"lg",iconType:"fa-light",mr:.5}),t.jsx(I,{color:c.palette.gray[400],size:"md",children:"New organization"})]})}):void 0,p.map(w=>t.jsx(yi,{isSelected:s.toLowerCase()===w.name,label:w.name.charAt(0).toUpperCase()+w.name.slice(1),onSelect:r},w.name))]})]})})});return e?je.createPortal(j,document.body):t.jsx("div",{})},Ra=y.styled.div`
|
|
2647
2647
|
${({theme:e,$backgroundColor:n=e.palette.white})=>`
|
|
2648
2648
|
align-items: flex-start;
|
|
2649
2649
|
display: flex;
|
|
@@ -2660,7 +2660,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2660
2660
|
fill: url(#gradient-01);
|
|
2661
2661
|
}
|
|
2662
2662
|
`}
|
|
2663
|
-
`,
|
|
2663
|
+
`,Na=({backgroundColor:e,title:n,indicator:i,description:r,icon:o})=>{const s=y.useTheme(),l=e?s.palette.white:void 0,a=f.$a916eb452884faea$export$b7a616150fdb9f44();return t.jsxs(Ra,{$backgroundColor:e,children:[t.jsxs($,{alignItems:"center","aria-label":n,"data-testid":n,display:"flex",gap:.75,justify:"space-between",width:"100%",children:[t.jsxs($,{alignItems:"start",display:"flex",flexDirection:"column",children:[t.jsx(I,{fontWeight:"bold",size:"lg",...l?{color:l}:{},children:n}),t.jsx(G,{fontWeight:"bold",size:"lg",...l?{color:l}:{},children:a.format(Number(i))})]}),t.jsxs("span",{className:"fa-stack fa-2x",children:[t.jsx("i",{className:"fa-solid fa-square fa-stack-2x",style:{color:s.palette.primary[25]}}),t.jsx("i",{className:`fa-solid fa-${o} fa-stack-1x fill-gradient-01`,style:{width:"24px",height:"24px"}})]},o)]}),r?t.jsx(I,{size:"md",...l?{color:l}:{},children:r}):void 0]})},Aa=({actions:e,children:n,header:i,title:r,tabs:o,footer:s})=>{const l=y.useTheme();return t.jsxs($,{alignItems:"flex-start",bgColor:l.palette.white,borderLeft:`1px solid ${l.palette.gray[300]}`,display:"flex",flexDirection:"column",maxHeight:"750px",width:"480px",children:[t.jsxs($,{alignItems:"flex-start",alignSelf:"stretch",borderBottom:`1px solid ${l.palette.gray[300]}`,display:"flex",gap:.25,justify:"space-between",px:1.25,py:1,children:[t.jsxs($,{display:"flex",flexDirection:"column",gap:.25,children:[t.jsx(I,{color:l.palette.gray[800],fontWeight:"bold",size:"lg",children:r}),i]}),e&&t.jsx($,{display:"flex",gap:.25,children:e.map(({icon:a,onClick:c},p)=>t.jsx(V,{icon:a??"paper-plane",iconColor:l.palette.gray[400],iconSize:"sm",iconType:"fa-light",onClick:c,variant:"ghost"},`${p}-${a}`))})]}),t.jsx($,{display:"flex",pt:.25,width:"100%",children:t.jsx(Lt,{items:o})}),t.jsx($,{alignSelf:"stretch",display:"flex",flexDirection:"column",px:1.25,py:1,scroll:"y",children:n}),s&&t.jsx($,{alignSelf:"stretch",borderTop:`1px solid ${l.palette.gray[300]}`,display:"flex",gap:.5,justify:"end",px:1.25,py:1,children:s.map(({icon:a,text:c,onClick:p},d)=>t.jsx(_,{icon:a,onClick:p,variant:d===0?"primary":"tertiary",width:"100%",children:c},`${d}-${c}`))})]})},La=y.styled.article`
|
|
2664
2664
|
${({theme:e})=>`
|
|
2665
2665
|
align-items: flex-start;
|
|
2666
2666
|
align-self: stretch;
|
|
@@ -2696,7 +2696,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2696
2696
|
fill: url(#gradient-01);
|
|
2697
2697
|
}
|
|
2698
2698
|
`}
|
|
2699
|
-
`,
|
|
2699
|
+
`,Pa=y.styled.div`
|
|
2700
2700
|
${({theme:e,$hasImage:n,$width:i,$height:r})=>`
|
|
2701
2701
|
width: ${i}px;
|
|
2702
2702
|
height: ${r}px;
|
|
@@ -2706,7 +2706,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2706
2706
|
align-items: center;
|
|
2707
2707
|
justify-content: center;
|
|
2708
2708
|
`}
|
|
2709
|
-
`,
|
|
2709
|
+
`,Oa={md:{titleSize:"xs",descSize:"md",linkTextSize:"md"},lg:{titleSize:"sm",descSize:"lg",linkTextSize:"lg"}},Ba=({desc:e,href:n,icon:i,imageHeight:r=48,imageWidth:o=48,Link:s,LinkElement:l,linkText:a="Learn more ",publicId:c,size:p="lg",tag:d,title:g})=>{const x=s??"a",{titleSize:h,descSize:b,linkTextSize:m}=Oa[p];return t.jsxs(La,{"data-testid":g,children:[t.jsxs($,{display:"flex",gap:.75,justify:"space-between",width:"100%",children:[t.jsxs(Pa,{$hasImage:!!c,$height:r,$width:o,children:[i?t.jsx("i",{className:`fa-solid fa-${i} fill-gradient-01`,style:{fontSize:24}}):void 0,c?t.jsx(oe,{alt:g,height:r,publicId:c,width:o}):void 0]}),d?t.jsx(q,{tagLabel:d,variant:"inactive"}):void 0]}),t.jsx(G,{size:h,children:g}),e?t.jsx(I,{size:b,children:e}):void 0,l??t.jsx(x,{href:n,style:{textDecoration:"none"},children:t.jsxs(I,{size:m,children:[a,t.jsx(R,{icon:"arrow-right",iconSize:"sm",iconType:"fa-light"})]})})]})},Wa=y.styled.span`
|
|
2710
2710
|
${({theme:e,$bgColor:n=e.palette.secondary[500],$txtDecoration:i="none"})=>`
|
|
2711
2711
|
background-color: ${n};
|
|
2712
2712
|
border-radius: 5px;
|
|
@@ -2715,14 +2715,14 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2715
2715
|
padding: ${e.spacing[.125]} ${e.spacing[.25]} ${e.spacing[.125]} ${e.spacing[.25]};
|
|
2716
2716
|
text-decoration: ${i}
|
|
2717
2717
|
`}
|
|
2718
|
-
`,
|
|
2718
|
+
`,Ma=({bgColor:e,children:n,txtDecoration:i,ml:r=1})=>t.jsx(Wa,{$bgColor:e,$txtDecoration:i,className:`ml-${r}`,children:n}),_a={lg:"56",md:"30",sm:"12"},{getVariant:Ha}=ae(e=>({blue:`stroke: ${e.palette.info[500]};`,red:`stroke: ${e.palette.primary[500]};`,white:`stroke: ${e.palette.white};`})),Va=y.keyframes`
|
|
2719
2719
|
0% {
|
|
2720
2720
|
transform: rotateZ(0deg);
|
|
2721
2721
|
}
|
|
2722
2722
|
100% {
|
|
2723
2723
|
transform: rotateZ(360deg)
|
|
2724
2724
|
}
|
|
2725
|
-
`,
|
|
2725
|
+
`,Ua=y.keyframes`
|
|
2726
2726
|
0%,
|
|
2727
2727
|
25% {
|
|
2728
2728
|
stroke-dashoffset: 280;
|
|
@@ -2739,16 +2739,16 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2739
2739
|
stroke-dashoffset: 280;
|
|
2740
2740
|
transform: rotate(360deg);
|
|
2741
2741
|
}
|
|
2742
|
-
`,
|
|
2743
|
-
${({$size:e="md"})=>
|
|
2744
|
-
animation: ${
|
|
2742
|
+
`,Ga=y.styled.svg`
|
|
2743
|
+
${({$size:e="md"})=>y.css`
|
|
2744
|
+
animation: ${Va} 2s linear infinite;
|
|
2745
2745
|
animation-timing-function: linear;
|
|
2746
2746
|
display: inline-block;
|
|
2747
|
-
width: ${
|
|
2747
|
+
width: ${_a[e]}px;
|
|
2748
2748
|
`}
|
|
2749
|
-
`,
|
|
2750
|
-
${({theme:e,$color:n="red"})=>
|
|
2751
|
-
animation: 1.4s ease-in-out infinite both ${
|
|
2749
|
+
`,Ya=y.styled.circle`
|
|
2750
|
+
${({theme:e,$color:n="red"})=>y.css`
|
|
2751
|
+
animation: 1.4s ease-in-out infinite both ${Ua};
|
|
2752
2752
|
display: block;
|
|
2753
2753
|
fill: transparent;
|
|
2754
2754
|
stroke-linecap: round;
|
|
@@ -2757,9 +2757,9 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2757
2757
|
stroke-width: 10px;
|
|
2758
2758
|
transform-origin: 50% 50%;
|
|
2759
2759
|
|
|
2760
|
-
${
|
|
2760
|
+
${Ha(e,n)}
|
|
2761
2761
|
`}
|
|
2762
|
-
`,
|
|
2762
|
+
`,Xa=y.styled.circle`
|
|
2763
2763
|
display: block;
|
|
2764
2764
|
fill: transparent;
|
|
2765
2765
|
stroke: ${({theme:e})=>e.palette.gray[200]};
|
|
@@ -2767,12 +2767,12 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2767
2767
|
stroke-width: 10px;
|
|
2768
2768
|
transform-origin: 50% 50%;
|
|
2769
2769
|
opacity: ${({$color:e})=>e==="white"?"20%":"unset"};
|
|
2770
|
-
`,
|
|
2770
|
+
`,bi=({color:e="red",label:n,size:i})=>{const r=y.useTheme();return t.jsxs($,{alignItems:"center",display:"flex",children:[t.jsxs(Ga,{$size:i,viewBox:"0 0 100 100",children:[t.jsx(Xa,{$color:e,cx:"50",cy:"50",r:"45"}),t.jsx(Ya,{$color:e,cx:"50",cy:"50",r:"45"})]}),n&&t.jsx(I,{color:e==="red"||e==="blue"?r.palette.gray[700]:r.palette.white,ml:.5,size:"md",children:n})]})},Ka={company:{height:"83px",width:"460px"},footer:{height:"57px",width:"315px"},header:{height:"35px",width:"160px"},icon:{height:"40px",width:"40px"},inline:{width:"150px"}},Za=({publicId:e,variant:n})=>t.jsx($,{...Ka[n],children:t.jsx(oe,{alt:"logo",publicId:e})}),qa=y.styled(f.Lottie).attrs(({autoplay:e=!0})=>({autoplay:e,className:"comp-lottie"}))`
|
|
2771
2771
|
${({$size:e=16})=>`
|
|
2772
2772
|
height: ${e}px;
|
|
2773
2773
|
width: ${e}px;
|
|
2774
2774
|
`}
|
|
2775
|
-
`,
|
|
2775
|
+
`,Ja=e=>{const{size:n}=e;return t.jsx(qa,{$size:n,...e})},Qa=({children:e,commitSha:n,commitShortSha:i,parentElement:r,userInfo:o,setVisibility:s})=>{const l=y.useTheme(),{userName:a,email:c,phone:p,userRole:d}=o;return re(r,()=>{s(!1)}),t.jsxs(qn,{children:[t.jsx("li",{className:"user-info",children:t.jsxs($,{display:"inline-flex",gap:.25,width:"100%",children:[t.jsxs($,{display:"flex",flexDirection:"column",gap:.25,width:"100%",children:[t.jsx(I,{color:l.palette.gray[800],fontWeight:"bold",size:"md",children:a}),t.jsx(I,{color:l.palette.gray[400],size:"md",children:c}),f.lodashExports.isUndefined(p)?void 0:t.jsx(I,{color:l.palette.gray[400],size:"md",children:p})]}),t.jsx($,{children:t.jsx(q,{tagLabel:d,variant:"role"})})]})}),t.jsx(me,{}),e,t.jsx(me,{}),t.jsx("li",{className:"commit-info",children:t.jsx(le,{href:`https://github.com/fluidattacks/universe/tree/${n}`,iconPosition:"hidden",children:t.jsx(I,{color:l.palette.gray[400],size:"sm",children:`commit : ${i}`})})})]})},el=y.styled.button`
|
|
2776
2776
|
align-items: center;
|
|
2777
2777
|
background-color: transparent;
|
|
2778
2778
|
border: unset;
|
|
@@ -2789,7 +2789,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2789
2789
|
&:hover span {
|
|
2790
2790
|
color: ${A.palette.primary[200]};
|
|
2791
2791
|
}
|
|
2792
|
-
`,
|
|
2792
|
+
`,tl=({message:e,onClickButton:n,buttonText:i,buttonFontWeight:r="regular",show:o=!0,icon:s,onClose:l,buttonSide:a="end"})=>{const c=y.useTheme(),[p,d]=u.useState(o),g=u.useCallback(()=>{d(!1),l==null||l()},[l]);u.useEffect(()=>{d(o)},[o,d]);const x=t.jsxs(el,{onClick:n,children:[t.jsx(I,{color:c.palette.white,fontWeight:r,size:"md",textDecoration:"underline",children:i}),t.jsx(R,{icon:s??"arrow-right",iconColor:c.palette.white,iconSize:"lg",iconType:r==="bold"?"fa-regular":"fa-light"})]});return t.jsxs($,{alignItems:"center",bgGradient:"linear-gradient(45deg, #f32637 0%, #b8075d 100%)",display:p?"flex":"none",id:"message-banner",justify:"space-between",padding:[.75,.75,.75,.75],children:[t.jsxs($,{display:"flex",gap:.5,justify:"center",width:"100%",children:[a==="start"&&n?x:void 0,t.jsx($,{children:typeof e=="string"?t.jsx(I,{color:c.palette.white,display:"inline",size:"md",children:e}):e}),a==="end"&&n?x:void 0]}),t.jsx(R,{clickable:!0,hoverColor:c.palette.primary[200],icon:"close",iconColor:c.palette.white,iconSize:"lg",iconType:"fa-light",onClick:g})]})},nl=y.styled.div`
|
|
2793
2793
|
${({theme:e,$variant:n})=>`
|
|
2794
2794
|
background: ${e.palette.white};
|
|
2795
2795
|
border: 1px solid ${e.palette.gray[200]};
|
|
@@ -2808,9 +2808,9 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2808
2808
|
right: 16px;
|
|
2809
2809
|
}
|
|
2810
2810
|
`}
|
|
2811
|
-
`,
|
|
2811
|
+
`,il=y.styled(G)`
|
|
2812
2812
|
font-size: ${({theme:e})=>e.typography.text.md};
|
|
2813
|
-
`,
|
|
2813
|
+
`,rl=y.styled.div`
|
|
2814
2814
|
${({theme:e,$variant:n})=>`
|
|
2815
2815
|
height: ${e.spacing[2.5]};
|
|
2816
2816
|
width: ${e.spacing[2.5]};
|
|
@@ -2841,7 +2841,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2841
2841
|
color: ${e.palette[n][500]};
|
|
2842
2842
|
}
|
|
2843
2843
|
`}
|
|
2844
|
-
`,
|
|
2844
|
+
`,ol=e=>e==="warning"?"triangle-exclamation":e==="info"?"circle-info":e==="success"?"circle-check":"circle-exclamation",sl=({description:e,onClose:n,title:i,variant:r})=>{const o=y.useTheme(),s=u.useCallback(()=>{n==null||n()},[n]);return t.jsxs(nl,{$variant:r,className:`notification notification__${r}`,role:"alertdialog",children:[t.jsxs(rl,{$variant:r,children:[t.jsx(R,{icon:"circle",iconClass:"ellipse-1",iconSize:"lg"}),t.jsx(R,{icon:"circle",iconClass:"ellipse-2",iconSize:"lg"}),t.jsx(R,{icon:ol(r),iconClass:"icon",iconSize:"lg",iconType:"fa-light"})]}),t.jsxs($,{pr:1.5,children:[t.jsx(il,{fontWeight:"bold",size:"xs",children:i}),t.jsx(I,{size:"md",whiteSpace:"break-spaces",wordWrap:"break-word",children:e})]}),t.jsx(V,{height:"fit-content",icon:"close",iconColor:o.palette.gray[400],iconSize:"lg",iconType:"fa-light",onClick:s,px:.125,py:.125,variant:"ghost"})]})},al={Azure:"integrates/autoenrollment/azureIcon",Bitbucket:"integrates/autoenrollment/bitbucketLogo",GitHub:"integrates/autoenrollment/githubLogo",GitLab:"integrates/autoenrollment/gitlabIcon"},$t=({icon:e,label:n,onClick:i,onlyLabel:r=!1,provider:o="GitLab"})=>{const s=y.useTheme();return t.jsxs($,{alignItems:"center",bgColorHover:s.palette.gray[100],borderRadius:"4px",cursor:"pointer",display:"flex",flexDirection:"column",gap:.25,height:"62px",justify:"center",minWidth:"64px",onClick:i,pb:.5,pl:.25,pr:.25,pt:.5,children:[r?!1:t.jsx($,{height:"24px",width:"24px",children:e===void 0?t.jsx(oe,{alt:`${o} Logo`,height:"100%",publicId:al[o],width:"100%"}):t.jsx(R,{icon:e,iconColor:"#000",iconSize:"xl",iconType:"fa-light"})}),t.jsx($,{alignItems:"center",display:"flex",minWidth:"24px",children:t.jsx(I,{color:s.palette.gray[800],display:"inline",size:"sm",textAlign:"center",whiteSpace:r?"break-spaces":"nowrap",wordWrap:"unset",children:n??o})})]})},ll=({align:e="end",buttonLabel:n="Add Credential",children:i,id:r,manualOption:o,providers:s})=>{const l=y.useTheme(),[a,c]=u.useState(!1),p=u.useRef(null);re(p.current,()=>{c(!1)},!0);const d=u.useCallback(h=>{o==null||o.onClick(h),c(!1)},[o]),g=u.useCallback(()=>{c(h=>!h)},[c]),x=u.useCallback(h=>b=>{var m;(m=s[h])==null||m.onClick(b),c(!1)},[s]);return t.jsxs($,{alignItems:e,display:"flex",flexDirection:"column",position:"relative",ref:p,width:"max-content",zIndex:10,children:[t.jsx(_,{icon:"plus",onClick:g,variant:"primary",children:n}),t.jsxs($,{alignItems:"center",bgColor:"#fff",border:`1px solid ${l.palette.gray[200]}`,borderRadius:"4px",display:"flex",gap:.5,height:"78px",id:r,pb:.5,pl:.75,position:"absolute",pr:.75,pt:.5,shadow:"md",top:"40px",visibility:a?"visible":"hidden",zIndex:10,children:[Object.keys(s).map(h=>t.jsx($t,{onClick:x(h),provider:h},h)),o===void 0?void 0:t.jsx($t,{icon:"square-plus",label:o.label??"Add manually",onClick:d}),i]})]})},cl=y.styled.button`
|
|
2845
2845
|
${({theme:e,$hasIcon:n})=>`
|
|
2846
2846
|
align-items: center;
|
|
2847
2847
|
background-color: ${n?"unset":e.palette.white};
|
|
@@ -2875,7 +2875,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2875
2875
|
color: ${e.palette.white};
|
|
2876
2876
|
}
|
|
2877
2877
|
`}
|
|
2878
|
-
`,de=({children:e,disabled:n,hasIcon:i=!1,selected:r,onClick:o})=>t.jsx(
|
|
2878
|
+
`,de=({children:e,disabled:n,hasIcon:i=!1,selected:r,onClick:o})=>t.jsx(cl,{...r?{className:"selected"}:{},$hasIcon:i,disabled:n,onClick:n||r?void 0:o,children:e}),dl=[10,20,50,100],$i=({pageSize:e,setPageSize:n})=>{const i=y.useTheme(),[r,o]=u.useState(!1),{refs:s,floatingStyles:l}=f.useFloating({middleware:[f.flip(),f.offset({mainAxis:4})],placement:"top-end",whileElementsMounted:f.autoUpdate}),a=u.useCallback(()=>{o(p=>!p)},[]),c=u.useCallback(p=>()=>{n(p),o(!1)},[n]);return re(s.reference.current,()=>{o(!1)},!0,[s.floating.current]),t.jsxs(u.Fragment,{children:[t.jsxs($,{alignItems:"center",bgColor:i.palette.white,border:"1px solid",borderColor:i.palette.gray[200],borderRadius:i.spacing[.25],display:"flex",gap:.125,px:.25,py:.125,children:[t.jsx(I,{size:"md",children:e}),t.jsx(V,{color:i.palette.gray[400],icon:r?"chevron-up":"chevron-down",iconSize:"sm",iconType:"fa-light",id:"paginator-dropdown",onClick:a,px:.125,py:.125,ref:s.setReference,variant:"ghost"})]}),r?t.jsx($,{bgColor:i.palette.white,border:`1px solid ${i.palette.gray[200]}`,borderRadius:i.spacing[.5],display:"flex",flexDirection:"column",px:.25,py:.25,ref:s.setFloating,shadow:"md",style:l,children:dl.map(p=>{const d=c(p);return t.jsx($,{bgColor:e===p?i.palette.gray[800]:"transparent",bgColorHover:i.palette.gray[e===p?800:100],borderRadius:i.spacing["0.25"],cursor:"pointer",maxWidth:"40px",minWidth:"40px",onClick:d,px:.25,py:.25,children:t.jsx(I,{color:e===p?i.palette.white:i.palette.gray[600],size:"md",textAlign:"center",children:p})},`${p}-${f.random(10)}`)})}):void 0]})},pl=(e,n)=>{if(n<=7)return{pages:Array.from({length:n},(o,s)=>s+1),ellipsis:{start:!1,middle:!1,end:!1}};if(e<=3||e>=n-2){const o=[1,2,3],s=[n-2,n-1,n];return{pages:[...o,...s],ellipsis:{start:!1,middle:!0,end:!1}}}return{pages:[1,...Array.from({length:5},(o,s)=>e-2+s),n],ellipsis:{start:!0,middle:!1,end:!0}}},gl=({totalItems:e,totalPages:n,page:{pageIndex:i,pageSize:r},onPageChange:o,onPageSizeChange:s})=>{const l=y.useTheme(),a=i*r,c=i===1,p=i===n,{pages:d,ellipsis:{start:g,middle:x,end:h}}=pl(i,n),b=u.useCallback(C=>()=>{o(C)},[o]),m=u.useCallback(()=>{i>1&&o(i-1)},[o,i]),j=u.useCallback(()=>{i<n&&o(i+1)},[o,i,n]),w=u.useCallback(C=>{s(C)},[s]);return t.jsxs($,{alignItems:"center",as:"nav",display:"flex",justify:"space-between",py:.875,children:[t.jsx(I,{color:l.palette.gray[800],display:"inline",size:"md",children:`${a-r+1}-${a} of ${e} items`}),t.jsxs($,{alignItems:"center",display:"flex",gap:1,children:[t.jsx(de,{disabled:c,hasIcon:!0,onClick:b(1),children:t.jsx(R,{icon:"angles-left",iconSize:"sm",iconType:"fa-light"})}),t.jsx(de,{disabled:c,hasIcon:!0,onClick:m,children:t.jsx(R,{icon:"angle-left",iconSize:"sm",iconType:"fa-light"})}),d.map((C,k,v)=>{const z=C===1,S=C===n,T=g&&z&&k===0,N=h&&S&&k===d.length-1,E=x&&k===v.length/2-1;return t.jsxs(et.default.Fragment,{children:[N&&t.jsx(de,{disabled:!0,children:"..."}),t.jsx(de,{onClick:b(C),selected:i===C,children:C}),(T||E)&&t.jsx(de,{disabled:!0,children:"..."})]},C)}),t.jsx(de,{disabled:p,hasIcon:!0,onClick:j,children:t.jsx(R,{icon:"angle-right",iconSize:"sm",iconType:"fa-light"})}),t.jsx(de,{disabled:p,hasIcon:!0,onClick:b(n),children:t.jsx(R,{icon:"angles-right",iconSize:"sm",iconType:"fa-light"})})]}),t.jsxs($,{alignItems:"center",display:"flex",gap:1,children:[t.jsx($i,{pageSize:r,setPageSize:w}),t.jsx(I,{color:l.palette.gray[800],display:"inline",size:"md",children:"Items per page"})]})]})},ul=y.styled.div`
|
|
2879
2879
|
${({theme:e})=>`
|
|
2880
2880
|
height: ${e.spacing[1]};
|
|
2881
2881
|
width: ${e.spacing[1]};
|
|
@@ -2906,7 +2906,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2906
2906
|
font-size: ${e.spacing[.5]};
|
|
2907
2907
|
}
|
|
2908
2908
|
`}
|
|
2909
|
-
`,
|
|
2909
|
+
`,mi=({margin:e,onClick:n,text:i})=>{const r=y.useTheme(),o=t.jsxs(ul,{children:[t.jsx(R,{icon:"circle",iconClass:"ellipse-1",iconSize:"lg"}),t.jsx(R,{icon:"circle",iconClass:"ellipse-2",iconSize:"lg"}),t.jsx(R,{icon:"crown",iconClass:"icon",iconSize:"lg"})]});return i!==void 0?t.jsx($,{cursor:"pointer",display:"inline-block",mr:e,onClick:n,children:t.jsxs($,{alignItems:"center",bgColor:r.palette.warning[50],borderRadius:"4px",display:"flex",padding:[.25,.25,.25,.25],width:"fit-content",children:[o,t.jsx(I,{color:r.palette.warning[500],display:"inline",ml:.25,size:"sm",children:i})]})}):t.jsx($,{display:"inline-block",mr:e,onClick:n,children:o})},xl=y.styled.div`
|
|
2910
2910
|
${({theme:e,$isDragging:n})=>`
|
|
2911
2911
|
align-items: center;
|
|
2912
2912
|
display: flex;
|
|
@@ -2919,12 +2919,12 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2919
2919
|
|
|
2920
2920
|
${n?`border: 1px solid ${e.palette.black};`:""}
|
|
2921
2921
|
`}
|
|
2922
|
-
|
|
2922
|
+
`,ji=({color:e,icon:n})=>t.jsxs("span",{style:{display:"inline-flex",position:"relative"},children:[t.jsxs("span",{className:"fa-stack",style:{zIndex:0,height:"20px",width:"20px"},children:[t.jsx("i",{className:"fa-solid fa-square fa-stack-2x",style:{color:e,height:"20px",width:"20px"}}),t.jsx("i",{className:"fa-solid fa-circle fa-stack-1x",style:{color:"#ffffff",height:"14px",width:"14px"}})]}),t.jsx("i",{className:`fa-regular fa-${n}`,style:{color:e,position:"absolute",height:"14px",left:"3px",top:"3px",width:"14px"}})]},`${n}-${e}`),wi=({rank:e})=>{const n=y.useTheme(),i={1:{color:n.palette.error[700],icon:"gauge-max"},2:{color:n.palette.error[500],icon:"gauge-high"},3:{color:n.palette.warning[500],icon:"gauge"},4:{color:n.palette.success[500],icon:"gauge-low"},5:{color:n.palette.info[700],icon:"gauge-min"},6:{color:n.palette.gray[400],icon:"gauge-min"}};return t.jsxs($,{alignItems:"center",display:"inline-flex",gap:.5,children:[t.jsx(ji,{color:i[e].color,icon:i[e].icon}),t.jsx(G,{fontWeight:"bold",size:"xs",children:e})]})},vi=({item:e,disabled:n,draggedItem:i,position:r,handleDragEnd:o,handleItemDragStart:s})=>{const l=y.useTheme();return t.jsx(f.ReorderItem,{as:"div",dragListener:!n,onDragEnd:o,onDragStart:s(e.title),style:{zIndex:i===e.title?9999:"auto",position:i===e.title?"relative":"static"},value:e,children:t.jsxs(xl,{$isDragging:i===e.title,children:[t.jsxs($,{alignItems:"center",borderRight:"1px solid "+l.palette.gray[200],display:"flex",gap:.625,minWidth:"200px",px:1,py:1,width:"200px",children:[!n&&t.jsx(R,{icon:"grip-vertical",iconColor:l.palette.gray[400],iconSize:"md",mx:.75,my:.75}),t.jsx(G,{fontWeight:"bold",size:"xs",children:e.title})]}),t.jsxs($,{alignItems:"center",display:"flex",gap:.625,justify:"space-between",pl:1,pr:1.75,py:1,width:"100%",children:[t.jsx(I,{size:"md",children:e.description}),t.jsx(wi,{rank:r+1})]})]})},e.title)},hl=({disabled:e,items:n,handleSetItems:i})=>{const r=y.useTheme(),[o,s]=u.useState(n),[l,a]=u.useState(void 0);u.useEffect(()=>{s(n)},[n]);const c=u.useCallback(x=>{s([...x])},[]),p=u.useCallback(x=>{a(x)},[]),d=u.useCallback(()=>{a(void 0),i(o)},[i,o]),g=u.useCallback(x=>()=>{p(x)},[p]);return t.jsx(f.ReorderGroup,{as:"div",axis:"y",layoutScroll:!0,onReorder:c,style:{borderBottom:`1px solid ${r.palette.gray[200]}`},values:o,children:o.map((x,h)=>t.jsx(vi,{disabled:e,draggedItem:l,handleDragEnd:d,handleItemDragStart:g,item:x,position:h},x.title))})},gn=2,fl=({score:e,toFixed:n=void 0})=>{const i=y.useTheme(),r=e<=33?"priority-bars-low":"priority-bars-medium",o=e>66||e===0?"priority-bars-high":r,s=n===void 0||n<0?0:n,l=e%1===0?gn+s:gn+s+1;return t.jsxs($,{alignItems:"center",display:"inline-flex",gap:.25,children:[t.jsx(R,{icon:o,iconClass:e<=66?"fa-kit-duotone":"",iconColor:e>0?i.palette.primary[500]:i.palette.gray[200],iconSize:"lg",iconType:"fa-kit",secondaryColor:i.palette.gray[200]}),t.jsx(I,{color:i.palette.gray[800],size:"md",textAlign:"right",children:(n===void 0?e:e.toFixed(s).toString().padStart(l,"0"))+"%"})]})},ki=({onClick:e})=>t.jsx("svg",{className:"in-progress-icon",fill:"none",height:"13",onClick:e,viewBox:"0 0 12 13",width:"12",xmlns:"http://www.w3.org/2000/svg",children:t.jsxs("g",{id:"Group 8",children:[t.jsx("path",{d:"M9.40199 3.00342L9.95715 2.34182C9.42087 1.88791 8.80949 1.53109 8.15051 1.28741L7.8552 2.09852C8.41952 2.30786 8.94298 2.61408 9.40199 3.00342Z",fill:"#1D2939"}),t.jsx("path",{d:"M11.1498 6.08815L11.9998 5.90982C11.8803 5.21957 11.6409 4.55558 11.2923 3.94793L10.5444 4.36018C10.8429 4.89758 11.0476 5.48194 11.1498 6.08815Z",fill:"#1D2939"}),t.jsx("path",{d:"M7.8552 11.8057L8.15051 12.6168C8.80949 12.3731 9.42087 12.0163 9.95715 11.5624L9.40199 10.9008C8.94298 11.2901 8.41952 11.5963 7.8552 11.8057Z",fill:"#1D2939"}),t.jsx("path",{d:"M10.5444 9.54409L11.2923 9.97608C11.6411 9.36144 11.8805 8.69095 12 7.99444L11.1498 7.84459C11.0476 8.44177 10.8427 9.01676 10.5444 9.54409Z",fill:"#1D2939"}),t.jsx("path",{d:"M6.04789 13V0.904236C4.44389 0.904236 2.90559 1.54142 1.77139 2.67562C0.637187 3.80982 0 5.34813 0 6.95213C0 8.55613 0.637187 10.0944 1.77139 11.2286C2.90559 12.3628 4.44389 13 6.04789 13Z",fill:"#1D2939"})]})}),Ci=(e,n)=>{switch(e){case"completed":return n.palette.success[500];case"disabled":return n.palette.gray[300];case"error":return n.palette.error[500];case"in progress":return n.palette.gray[800];case"not completed":default:return n.palette.gray[800]}},yl=y.styled(R)`
|
|
2923
2923
|
box-sizing: border-box;
|
|
2924
2924
|
|
|
2925
|
-
border-right: ${({theme:e,$variant:n})=>n==="in progress"?`1px dashed ${
|
|
2925
|
+
border-right: ${({theme:e,$variant:n})=>n==="in progress"?`1px dashed ${Ci("in progress",e)}`:"unset"};
|
|
2926
2926
|
border-radius: 50%;
|
|
2927
|
-
`,
|
|
2927
|
+
`,bl=y.styled.div`
|
|
2928
2928
|
${({$minWidth:e,$orientation:n})=>`
|
|
2929
2929
|
display: flex;
|
|
2930
2930
|
flex-direction: ${n==="horizontal"?"row":"column"};
|
|
@@ -2934,16 +2934,16 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2934
2934
|
flex-flow: row wrap;
|
|
2935
2935
|
}
|
|
2936
2936
|
`}
|
|
2937
|
-
|
|
2937
|
+
`,$l=150,ml=({label:e,minWidth:n=$l,state:i="not completed",stepNumber:r=1,title:o,onClick:s,orientation:l="horizontal"})=>{const a=y.useTheme(),c={completed:"circle-check",disabled:"circle-dashed",error:"circle-exclamation","in progress":"circle-half","not completed":"circle-dashed"},p=i==="disabled";return t.jsxs($,{display:"inline-flex",flexDirection:l==="horizontal"?"column":"row",minWidth:`${n}px`,children:[t.jsx(Ft,{minWidth:n,orientation:l,percentage:p||i==="not completed"?0:100,rounded:!1,variant:i==="error"?"progressIndicatorError":"progressIndicator"}),t.jsxs($,{display:"flex",gap:.5,px:.5,py:.5,width:"100%",children:[i==="in progress"?t.jsx(ki,{onClick:s}):t.jsx(yl,{$variant:i,clickable:!p,disabled:p,icon:c[i],iconColor:Ci(i,a),iconSize:"lg",iconType:"fa-light",onClick:p?void 0:s}),t.jsxs($,{children:[t.jsx(I,{color:a.palette.gray[p?300:800],fontWeight:"bold",size:"md",children:`${r}.${o}`}),e===void 0?null:t.jsx(I,{color:a.palette.gray[p?300:600],size:"sm",children:e})]})]})]})},jl=150,wl=({children:e,orientation:n="horizontal",minWidth:i=jl})=>{const r=u.Children.toArray(e),o=u.useMemo(()=>u.Children.count(e),[e]),s=u.useMemo(()=>o*i,[o,i]);return t.jsx(bl,{$minWidth:`${s}px`,$orientation:n,children:r.map(l=>u.cloneElement(l,{minWidth:i,orientation:n}))})},Si=({description:e="",highlightDescription:n="",mobile:i})=>{const r=y.useTheme(),o=i?"md":"lg",s=typeof n=="string",l=s?"":new RegExp(`(${n.join("|")})`,"u");return n.length>0?t.jsx(I,{display:"inline",lineSpacing:1.5,size:o,textAlign:i?"start":"center",children:s?t.jsxs(u.Fragment,{children:[t.jsx(be,{color:r.palette.gray[600],display:"inline",fontWeight:"bold",lineSpacing:1.5,size:o,children:n}),e]}):e.split(l).map((a,c)=>n.includes(a)?t.jsx(be,{color:r.palette.gray[600],display:"inline",fontWeight:"bold",lineSpacing:1.5,size:o,children:a},`${c+1}-bold`):a)}):t.jsx(I,{lineSpacing:1.5,size:o,textAlign:i?"start":"center",children:e})},vl=({_portal:e=!1,cancelButton:n,darkBackground:i=!1,children:r,confirmButton:o,container:s,description:l,highlightDescription:a="",image:c,maxWidth:p,mobile:d=!1,title:g,titleColor:x})=>{const h=y.useTheme(),{alt:b,src:m,width:j="77px",height:w="77px"}=c,C=u.useCallback(()=>{n==null||n.onClick()},[n]),k=u.useCallback(()=>{o==null||o.onClick()},[o]),v=t.jsx(G,{color:x,fontWeight:"bold",lineSpacing:d?1.5:2.5,mb:d?1.5:0,size:d?"sm":"md",textAlign:d?"start":"center",children:g}),z=t.jsx(oe,{alt:b,height:w,publicId:m,width:j}),S=t.jsx($,{alignItems:"center","aria-label":g,"aria-modal":"true",bgColor:i?"rgba(52, 64, 84, 70%)":"",display:"flex",height:"100vh",justify:"center",left:"0",position:e?"fixed":"absolute",top:"0px",width:"100%",zIndex:99999,children:t.jsxs($,{bgColor:h.palette.white,border:`1px solid ${h.palette.gray[200]}`,borderRadius:"8px",display:"inline-flex",flexDirection:"column",maxWidth:p,position:"relative",px:d?1.5:2.5,py:d?1.5:2.5,shadow:"lg",width:d?"335px":"100%",zIndex:11,children:[t.jsxs($,{alignItems:"center",display:"flex",flexDirection:"column",width:"100%",children:[d?v:void 0,d?t.jsx($,{alignItems:"center",height:w,justify:"center",mr:0,children:t.jsx($,{bgColor:h.palette.gray[100],left:"0",position:"absolute",textAlign:"center",width:"100%",children:z})}):z,t.jsxs($,{display:"flex",flexDirection:"column",gap:.5,mb:1.5,mt:1.5,children:[d?void 0:v,t.jsx(Si,{description:l,highlightDescription:a,mobile:d})]})]}),r&&t.jsx($,{mb:1,scroll:"y",children:t.jsx($,{height:"100%",children:r})}),t.jsxs($,{alignItems:"flex-start",display:"flex",gap:1,justify:d?"start":"center",children:[f.lodashExports.isObject(o)?t.jsx(_,{onClick:k,variant:(o==null?void 0:o.variant)??"primary",children:o==null?void 0:o.text},o==null?void 0:o.key):void 0,f.lodashExports.isObject(n)?t.jsx(_,{onClick:C,variant:(n==null?void 0:n.variant)??"tertiary",children:n==null?void 0:n.text},n==null?void 0:n.key):void 0]})]})});return e?je.createPortal(S,s??document.body):S},kl={md:{methodIdSize:"sm",titleSize:"xs",detailsSize:"md"},lg:{methodIdSize:"md",titleSize:"sm",detailsSize:"lg"}},Cl=({technology:e,technique:n,cwes:i,href:r,id:o,indx:s,Link:l,language:a,lastUpdated:c,score:p,size:d="lg",severity:g,title:x})=>{const h=y.useTheme(),{methodIdSize:b,titleSize:m,detailsSize:j}=kl[d],w=l??"a";return t.jsxs(St,{$index:s,children:[t.jsxs($,{display:"flex",flexDirection:"column",gap:.25,width:"100%",children:[t.jsxs($,{display:"flex",justify:"space-between",children:[t.jsx(I,{color:h.palette.gray[800],display:"inline",size:b,children:o}),t.jsx(q,{tagLabel:n})]}),t.jsx(w,{href:r,children:t.jsx(G,{fontWeight:"bold",size:m,children:x})})]}),t.jsxs($,{alignItems:d==="md"?"flex-start":"center",display:"flex",flexDirection:d==="md"?"column":"row",gap:.75,width:"fit-content",children:[t.jsx(tt,{textL:p,textR:f.capitalize(g==="disable"?"Unknown":g),variant:g}),t.jsxs(t.Fragment,{children:[d==="lg"?t.jsx(se,{}):void 0,t.jsxs(I,{color:h.palette.gray[400],size:j,whiteSpace:"nowrap",children:[t.jsx("b",{children:"Language: "}),a]})]}),t.jsxs(t.Fragment,{children:[d==="lg"?t.jsx(se,{}):void 0,t.jsxs(I,{color:h.palette.gray[400],size:j,whiteSpace:"nowrap",children:[t.jsx("b",{children:"Technology: "}),e]})]}),t.jsxs(t.Fragment,{children:[d==="lg"?t.jsx(se,{}):void 0,t.jsx(I,{color:h.palette.gray[400],fontWeight:"bold",size:j,whiteSpace:"nowrap",children:"CWE ID(s): "}),i.map((C,k)=>t.jsxs(u.Fragment,{children:[k>0?t.jsx(I,{color:h.palette.gray[400],size:j,whiteSpace:"nowrap",children:" , "}):void 0,t.jsx(w,{href:C.href,children:t.jsx(I,{color:h.palette.gray[400],size:j,textDecoration:"underline",whiteSpace:"nowrap",children:C.key})})]},C.key))]}),c?t.jsxs(t.Fragment,{children:[d==="lg"?t.jsx(se,{}):void 0,t.jsxs(I,{color:h.palette.gray[400],size:j,whiteSpace:"nowrap",children:[t.jsx("b",{children:"Last update time: "}),c]})]}):void 0]})]})},Sl=y.styled.div.attrs({className:"comp-scroll-up"})`
|
|
2938
2938
|
position: fixed;
|
|
2939
2939
|
bottom: ${({bottom:e})=>e??"unset"};
|
|
2940
2940
|
right: ${({right:e})=>e??"unset"};
|
|
2941
2941
|
z-index: ${({zIndex:e})=>e??"unset"};
|
|
2942
2942
|
left: ${({left:e})=>e??"unset"};
|
|
2943
|
-
`,
|
|
2943
|
+
`,zl=({scrollerId:e="dashboard",left:n,visibleAt:i=500,bottom:r,right:o,zIndex:s=100})=>{const[l,a]=u.useState(!1),[c,p]=u.useState(null),d=y.useTheme();u.useEffect(()=>{p(document.getElementById(e)),c==null||c.addEventListener("scroll",()=>{a(c.scrollTop>i)})},[c,e,i]);const g=u.useCallback(()=>{c==null||c.scrollTo({behavior:"smooth",top:0})},[c]);return l?t.jsx(Sl,{bottom:r,left:n,right:o,zIndex:s,children:t.jsx(V,{borderRadius:"50%",height:"40px",icon:"arrow-up",iconSize:"xl",id:"scroll-up",onClick:g,style:{backgroundColor:d.palette.black,borderRadius:"50%",color:d.palette.white},width:"40px"})}):null},Tl=y.styled.div`
|
|
2944
2944
|
position: relative;
|
|
2945
2945
|
width: 100%;
|
|
2946
|
-
`,
|
|
2946
|
+
`,Il=y.styled.div`
|
|
2947
2947
|
${({theme:e})=>`
|
|
2948
2948
|
align-items: center;
|
|
2949
2949
|
background-color: ${e.palette.white};
|
|
@@ -2958,7 +2958,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2958
2958
|
&:hover { border-color: ${e.palette.gray[600]}; }
|
|
2959
2959
|
&:focus-within { border: 2px solid ${e.palette.black}; }
|
|
2960
2960
|
`}
|
|
2961
|
-
`,
|
|
2961
|
+
`,Dl=y.styled.input`
|
|
2962
2962
|
${({theme:e})=>`
|
|
2963
2963
|
background: none;
|
|
2964
2964
|
border: none !important;
|
|
@@ -2975,7 +2975,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2975
2975
|
::-webkit-search-results-button,
|
|
2976
2976
|
::-webkit-search-results-decoration { display: none; }
|
|
2977
2977
|
`}
|
|
2978
|
-
`,
|
|
2978
|
+
`,El=y.styled.div`
|
|
2979
2979
|
${({theme:e})=>`
|
|
2980
2980
|
position: absolute;
|
|
2981
2981
|
z-index: 50;
|
|
@@ -2989,7 +2989,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2989
2989
|
box-shadow: ${e.shadows.md};
|
|
2990
2990
|
overflow: hidden;
|
|
2991
2991
|
`}
|
|
2992
|
-
`,
|
|
2992
|
+
`,Fl=y.styled.ul`
|
|
2993
2993
|
${({theme:e})=>`
|
|
2994
2994
|
list-style: none;
|
|
2995
2995
|
margin: 0;
|
|
@@ -2997,18 +2997,18 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2997
2997
|
max-height: 300px;
|
|
2998
2998
|
overflow-y: auto;
|
|
2999
2999
|
`}
|
|
3000
|
-
`,
|
|
3000
|
+
`,Rl=y.styled.li`
|
|
3001
3001
|
${({theme:e})=>`
|
|
3002
3002
|
padding: ${e.spacing[.5]} ${e.spacing[.75]};
|
|
3003
3003
|
cursor: pointer;
|
|
3004
3004
|
&:hover { background: ${e.palette.gray[50]}; }
|
|
3005
3005
|
`}
|
|
3006
|
-
`,
|
|
3006
|
+
`,Nl=y.styled.div`
|
|
3007
3007
|
${({theme:e})=>`
|
|
3008
3008
|
padding: ${e.spacing[.75]};
|
|
3009
3009
|
color: ${e.palette.gray[500]};
|
|
3010
3010
|
`}
|
|
3011
|
-
`,
|
|
3011
|
+
`,Al=300,Ll=({name:e,items:n=[],renderItem:i,onSelectItem:r,onClear:o,onChange:s,value:l,maxLength:a=Al,emptyText:c="No results",openOnFocus:p=!0,...d})=>{const g=y.useTheme(),x=u.useRef(null),[h,b]=u.useState(!1),[m,j]=u.useState(String(l??""));u.useEffect(()=>{j(String(l??""))},[l]);const{refs:w,floatingStyles:C}=f.useFloating$1({placement:"bottom-start"});re(w.floating.current,()=>b(!1),!0);const k=u.useCallback(()=>{p&&b(!0)},[p]),v=u.useCallback(D=>{const F=D.target.value;if(F.length>a){j(F.slice(0,a));return}j(F),s==null||s(D),b(!0)},[s,a]),z=u.useCallback(()=>{var D;j(""),o==null||o(),s&&s({target:{value:""},currentTarget:{value:""}}),(D=x.current)==null||D.focus(),b(!1)},[o,s]),S=u.useCallback(D=>{const F=Number(D.currentTarget.dataset.index),P=n[F];r==null||r(P),b(!1)},[n,r]),T=h&&(m.trim().length>0||n.length>0),N=u.useMemo(()=>n.length===0?t.jsx(Nl,{children:c}):t.jsx(Fl,{role:"listbox",children:n.map((D,F)=>t.jsx(Rl,{onClick:S,role:"option",children:i(D)},F))}),[n,c,i,S]),E=u.useCallback(D=>{D.key==="Escape"&&b(!1)},[]);return t.jsxs(Tl,{ref:w.setReference,children:[t.jsxs(Il,{children:[t.jsx(R,{icon:"magnifying-glass",iconColor:g.palette.gray[700],iconSize:"lg",iconType:"fa-light"}),t.jsx(Dl,{"aria-expanded":T,id:e,maxLength:a,name:e,onChange:v,onFocus:k,onKeyDown:E,ref:x,type:"search",value:m,...d}),!f.lodashExports.isEmpty(m)&&t.jsx(V,{icon:"xmark",iconColor:g.palette.gray[300],iconSize:"lg",iconType:"fa-light",onClick:z,px:.25,py:.25,type:"reset",variant:"ghost"})]}),T?t.jsx(El,{ref:w.setFloating,style:C,children:N}):void 0]})},Pl=(e,n)=>{const i={critical:A.palette.primary[700],high:A.palette.error[500],low:A.palette.warning[200],medium:A.palette.warning[500],none:A.palette.gray[200]},r={disabled:A.palette.gray[400],enabled:A.palette.gray[800]},o={critical:A.palette.white,high:A.palette.white,low:A.palette.gray[800],medium:A.palette.gray[800],none:A.palette.gray[400]};return{iconColor:n<1?i.none:i[e],iconText:f.lodashExports.capitalize(e.charAt(0)),iconTextColor:n<1?o.none:o[e],textColor:n<1?r.disabled:r.enabled}},De=({variant:e,value:n})=>{const{iconColor:i,iconText:r,iconTextColor:o,textColor:s}=Pl(e,n),l=f.lodashExports.capitalize(e.charAt(0))+e.slice(1);return t.jsxs($,{alignItems:"center",display:"inline-flex",gap:.5,minWidth:"43px",children:[t.jsx(Z,{id:l,place:"top",tip:l,children:t.jsx($,{alignItems:"center",bgColor:i,borderRadius:"4px",cursor:"pointer",display:"flex",height:"22px",maxWidth:"22px",minWidth:"22px",children:t.jsx(I,{color:o,size:"md",textAlign:"center",children:r})})}),t.jsx(I,{color:s,size:"md",children:n})]})},Ol=({critical:e,high:n,medium:i,low:r})=>t.jsxs($,{alignItems:"center",display:"inline-flex",gap:1,children:[t.jsx(De,{value:e,variant:"critical"}),t.jsx(De,{value:n,variant:"high"}),t.jsx(De,{value:i,variant:"medium"}),t.jsx(De,{value:r,variant:"low"})]}),Bl=y.styled.div`
|
|
3012
3012
|
${({theme:e})=>`
|
|
3013
3013
|
border-radius: ${e.spacing[.25]};
|
|
3014
3014
|
cursor: pointer;
|
|
@@ -3026,7 +3026,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3026
3026
|
display: block;
|
|
3027
3027
|
}
|
|
3028
3028
|
`}
|
|
3029
|
-
`,
|
|
3029
|
+
`,Wl=({visibleElement:e,hiddenElement:n})=>t.jsxs(Bl,{children:[e,t.jsx($,{display:"none",position:"absolute",top:"100%",zIndex:10,children:n})]}),zi=({customBadge:e=void 0,description:n,icon:i,onClick:r,requiresUpgrade:o=!1,title:s})=>{const l=y.useTheme();return t.jsxs($,{bgColor:l.palette.white,bgColorHover:l.palette.gray[100],cursor:"pointer",display:"flex",gap:.5,onClick:r,px:1.25,py:1,width:"100%",children:[t.jsx($,{alignItems:"center",bgColor:l.palette.gray[300],borderRadius:l.spacing[.25],display:"flex",height:"24px",justify:"center",width:"24px",children:t.jsx(R,{icon:i,iconColor:l.palette.gray[800],iconSize:"sm",ml:.5,mr:.5})}),t.jsxs($,{children:[t.jsxs($,{alignItems:"center",display:"inline-flex",gap:.5,children:[t.jsx(I,{color:l.palette.gray[800],size:"md",children:s}),o?t.jsx(mi,{text:"Upgrade"}):void 0,e]}),t.jsx(I,{color:l.palette.gray[400],size:"sm",children:n})]})]})},Ml=y.styled(f.m.div)`
|
|
3030
3030
|
${({theme:e})=>`
|
|
3031
3031
|
background-color: ${e.palette.white};
|
|
3032
3032
|
box-shadow: ${e.shadows.lg};
|
|
@@ -3049,7 +3049,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3049
3049
|
height: auto;
|
|
3050
3050
|
}
|
|
3051
3051
|
`}
|
|
3052
|
-
`,
|
|
3052
|
+
`,_l=({children:e,closeIconId:n="close-menu",isOpen:i,items:r,onClose:o,title:s})=>{const l=y.useTheme(),a=u.useRef(null),c=u.useCallback(p=>()=>{p(),o()},[o]);return u.useEffect(()=>{const p=["mousedown","touchstart"],d=g=>{var j;const x=g.target,h=document.getElementById("helpBtn"),b=document.getElementById("filter-btn"),m=(x===h||((h==null?void 0:h.contains(x))??!1)||x===b||(b==null?void 0:b.contains(x)))??!1;i&&!m&&!(((j=a.current)==null?void 0:j.contains(x))??!1)&&o()};return p.forEach(g=>{document.addEventListener(g,d,{passive:!0})}),()=>{p.forEach(g=>{document.removeEventListener(g,d)})}},[i,o]),t.jsx(f.LazyMotion,{features:f.domAnimation,children:t.jsx(Ml,{animate:i?{display:"block",x:0}:{transitionEnd:{display:"none"},x:"100%"},initial:{display:"none",x:"100%"},ref:a,transition:{bounce:0,duration:.6,type:"spring"},children:t.jsxs($,{height:"100%",position:"relative",children:[t.jsxs($,{alignItems:"center",bgColor:l.palette.white,borderBottom:"1px solid",borderColor:l.palette.gray[200],display:"flex",gap:1.25,justify:"space-between",padding:[1.25,1.25,1.25,1.25],position:"sticky",top:"0",zIndex:40,children:[t.jsx(I,{color:l.palette.black,display:"inline",fontWeight:"bold",size:"lg",children:s}),t.jsx(V,{icon:"close",iconColor:l.palette.gray[400],iconSize:"lg",iconTransform:"grow-4",iconType:"fa-light",id:n,onClick:o,px:.25,py:.25,variant:"ghost"})]}),t.jsx($,{display:"flex",flexDirection:"column",justify:"space-between",minHeight:"100vh",children:t.jsxs($,{py:1.25,children:[(r??[]).map(({customBadge:p,description:d,icon:g,onClick:x,requiresUpgrade:h,title:b})=>t.jsx(zi,{customBadge:p,description:d,icon:g,onClick:c(x),requiresUpgrade:h,title:b},b)),e&&t.jsx($,{px:1.25,children:e})]})})]})})})},Hl=(e,n)=>n>=50?`
|
|
3053
3053
|
${e.palette.gray[200]} 50%,
|
|
3054
3054
|
${e.palette.primary[500]} 50.05%,
|
|
3055
3055
|
${e.palette.primary[500]} ${n}%,
|
|
@@ -3060,7 +3060,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3060
3060
|
${e.palette.primary[500]} 50%,
|
|
3061
3061
|
${e.palette.gray[200]} 50.05%,
|
|
3062
3062
|
${e.palette.gray[200]} 100%
|
|
3063
|
-
`,
|
|
3063
|
+
`,Vl=y.styled.div`
|
|
3064
3064
|
${({theme:e,$min:n,$value:i})=>`
|
|
3065
3065
|
align-items: center;
|
|
3066
3066
|
align-self: stretch;
|
|
@@ -3076,7 +3076,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3076
3076
|
${n>=0?`
|
|
3077
3077
|
${e.palette.primary[500]} ${i}%,
|
|
3078
3078
|
${e.palette.gray[200]} ${i}%
|
|
3079
|
-
`:
|
|
3079
|
+
`:Hl(e,i)}
|
|
3080
3080
|
);
|
|
3081
3081
|
border-radius: ${e.spacing[.125]};
|
|
3082
3082
|
height: ${e.spacing[.25]};
|
|
@@ -3100,7 +3100,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3100
3100
|
border: 1px solid ${e.palette.primary[500]};
|
|
3101
3101
|
}
|
|
3102
3102
|
`}
|
|
3103
|
-
`,
|
|
3103
|
+
`,Ul=y.styled.div`
|
|
3104
3104
|
${({theme:e})=>`
|
|
3105
3105
|
align-items: center;
|
|
3106
3106
|
display: flex;
|
|
@@ -3114,7 +3114,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3114
3114
|
font-size: ${e.spacing[.5]};
|
|
3115
3115
|
}
|
|
3116
3116
|
`}
|
|
3117
|
-
`,
|
|
3117
|
+
`,Gl=y.styled.output`
|
|
3118
3118
|
${({theme:e})=>`
|
|
3119
3119
|
align-items: flex-end;
|
|
3120
3120
|
border-radius: ${e.spacing[.5]};
|
|
@@ -3125,7 +3125,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3125
3125
|
padding: ${e.spacing[.625]} ${e.spacing[.75]};
|
|
3126
3126
|
width: 59px;
|
|
3127
3127
|
`}
|
|
3128
|
-
`,
|
|
3128
|
+
`,Ti=({state:e,trackRef:n,index:i,name:r})=>{const o=u.useRef(null),{thumbProps:s,inputProps:l,isDragging:a}=f.$47b897dc8cdb026b$export$8d15029008292ae({index:i,trackRef:n,inputRef:o},e);return t.jsx("div",{...s,className:`thumb ${a?"dragging":""}`,children:t.jsx(f.$5c3e21d68f1c4674$export$439d29a4e110a164,{children:t.jsx("input",{...l,"aria-label":r,ref:o})})})},Yl=(e,n,i)=>Math.round((i-e)/(n-e)*100),Xl=e=>{const n=y.useTheme(),i=u.useRef(null),{label:r,minValue:o=0,maxValue:s=100,name:l,setValue:a,watch:c}=e,p=f.$a916eb452884faea$export$b7a616150fdb9f44(),d=f.$28f99e3e86e6ec45$export$e5fda3247f5d67f9({...e,numberFormatter:p,onChange(b){a==null||a(l,b)},value:c==null?void 0:c(l)}),g=Yl(o,s,d.getThumbValue(0)),{groupProps:x,trackProps:h}=f.$bcca50147b47f54d$export$56b2c08e277f365({...e,"aria-label":l,id:l},d,i);return t.jsx(J,{htmlFor:l,label:r,children:t.jsxs($,{alignItems:"center",display:"inline-flex",gap:1.25,pl:.5,width:"100%",children:[t.jsxs(Vl,{...x,$min:o??0,$value:g,className:"slider",children:[t.jsx("div",{...h,className:`track ${d.isDisabled?"disabled":""}`,ref:i,children:t.jsx(Ti,{index:0,name:l,state:d,trackRef:i})}),t.jsxs(Ul,{children:[t.jsx("p",{children:`${p.format(o)} (Low)`}),o<0&&t.jsx("p",{children:"0"}),t.jsx("p",{children:`${p.format(s)} (High)`})]})]}),t.jsx(Gl,{children:t.jsx(I,{color:n.palette.gray[800],size:"md",textAlign:"right",children:d.getThumbValueLabel(0)})})]})})},{getVariant:Kl}=ae(e=>({completed:`
|
|
3129
3129
|
background-color: ${e.palette.primary[500]};
|
|
3130
3130
|
color: ${e.palette.white};
|
|
3131
3131
|
|
|
@@ -3148,7 +3148,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3148
3148
|
&::after {
|
|
3149
3149
|
background-color: ${e.palette.gray[200]};
|
|
3150
3150
|
}
|
|
3151
|
-
`})),
|
|
3151
|
+
`})),Zl=y.styled.div`
|
|
3152
3152
|
${({theme:e})=>`
|
|
3153
3153
|
align-items: stretch;
|
|
3154
3154
|
background-color: ${e.palette.white};
|
|
@@ -3158,7 +3158,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3158
3158
|
padding: ${`${e.spacing[1]} ${e.spacing[1]}`};
|
|
3159
3159
|
scroll-behavior: unset;
|
|
3160
3160
|
`}
|
|
3161
|
-
`,
|
|
3161
|
+
`,ql=y.styled.div`
|
|
3162
3162
|
display: flex;
|
|
3163
3163
|
flex-direction: row;
|
|
3164
3164
|
margin-bottom: ${({theme:e})=>e.spacing[2]};
|
|
@@ -3166,7 +3166,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3166
3166
|
&:last-child > div:first-child > span::after {
|
|
3167
3167
|
display: none;
|
|
3168
3168
|
}
|
|
3169
|
-
`,
|
|
3169
|
+
`,Jl=y.styled.div`
|
|
3170
3170
|
${({theme:e})=>`
|
|
3171
3171
|
display: inline-flex;
|
|
3172
3172
|
font-family: ${e.typography.type.primary};
|
|
@@ -3178,7 +3178,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3178
3178
|
margin-right: ${e.spacing[.5]};
|
|
3179
3179
|
}
|
|
3180
3180
|
`}
|
|
3181
|
-
`,
|
|
3181
|
+
`,Ql=y.styled.span`
|
|
3182
3182
|
${({theme:e,$variant:n})=>`
|
|
3183
3183
|
border-radius: 6px;
|
|
3184
3184
|
display: inline-block;
|
|
@@ -3201,9 +3201,9 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3201
3201
|
height: calc(100% - ${e.spacing[1]});
|
|
3202
3202
|
}
|
|
3203
3203
|
|
|
3204
|
-
${
|
|
3204
|
+
${Kl(e,n)}
|
|
3205
3205
|
`}
|
|
3206
|
-
`,
|
|
3206
|
+
`,ec=({button:{disabled:e=!1,text:n,type:i="button",onClick:r},steps:o})=>{const[s,l]=u.useState(1),a=u.useCallback((c,p)=>()=>{l(d=>d+c),p==null||p()},[]);return t.jsx(Zl,{children:o.map((c,p)=>{const{content:d,title:g,nextAction:x,previousAction:h}=c,b=p+1,m=b===s?"current":"disabled",j=b<s?"completed":m;return t.jsxs(ql,{children:[t.jsx($,{maxWidth:"40px",position:"relative",children:t.jsx(Ql,{$variant:j,children:j==="completed"?t.jsx(R,{icon:"check",iconSize:"lg",iconType:"fa-solid"}):b})}),t.jsxs($,{ml:1.5,width:"100%",children:[t.jsx(G,{fontWeight:"bold",lineSpacing:1.25,mb:1.5,size:"xs",children:g}),j==="current"&&t.jsxs($,{children:[d,t.jsxs(Jl,{children:[s>1&&t.jsx(_,{disabled:c.isDisabledPrevious??!1,onClick:a(-1,h),variant:"tertiary",children:"Previous"}),s<o.length?t.jsx(_,{disabled:c.isDisabledNext??!1,onClick:a(1,x),variant:"primary",children:"Next step"}):t.jsx(_,{disabled:e,onClick:r,type:i,variant:"primary",children:n})]})]})]})]},c.title)})})},tc=e=>{const n=(o,s)=>s.reduce((a,[c,p])=>{if(u.isValidElement(p)||c==="__typename")return a.concat([["",""]]);if(typeof p=="object"&&p){const g=Object.entries(p);return a.concat(n(c,g))}const d=o===""?"":`${o}.`;return a.concat([[d+c,p]])},[]),i=Object.entries(e),r=n("",i).filter(([o])=>o!=="");return Object.fromEntries(r)},un=e=>e.map(tc),Ii=({csvConfig:e={},data:n,children:i})=>{const{columns:r=void 0,export:o=!1,headers:s={},name:l="Report"}=e,a=u.useMemo(()=>f._.isUndefined(r)?un(n):un(n).map(d=>f._.pick(d,r)),[n,r]),c=u.useMemo(()=>a.length>0&&!f._.isEmpty(s),[a.length,s]),p=u.useMemo(()=>(c?Object.keys(a[0]):[]).map(d=>f._.includes(Object.keys(s),d)?{key:d,label:s[d]}:{key:d,label:d}),[c,a,s]);return o?t.jsx(f.CSVLink,{data:a,filename:l,headers:c?p:void 0,children:i}):t.jsx(u.Fragment,{children:i})},Di=e=>{const{table:n}=e,{meta:i}=n.options,[r,o]=u.useState(0),[,s]=n.getHeaderGroups(),l=n.getState(),a=u.useMemo(()=>n.getAllLeafColumns().filter(g=>g.id!=="selection"),[n]),c=u.useMemo(()=>a.map(g=>{var x;return{group:(x=g.parent)==null?void 0:x.id,id:g.id,locked:g.getIsPinned()==="left",name:typeof g.columnDef.header=="string"?g.columnDef.header:g.columnDef.id??"",toggleVisibility:g.toggleVisibility,visible:g.getIsVisible()}}),[a]),p=vn({columnOrder:(i==null?void 0:i.defaultColumnOrder)??[],items:c,name:"table-column-management",setColumnOrder:n.setColumnOrder,setColumnVisibility:n.setColumnVisibility}),d=u.useCallback(()=>{p.toggle()},[p]);return u.useEffect(()=>{o(n.getVisibleLeafColumns().filter(g=>g.id!=="selection").length)},[n,l]),t.jsxs("div",{id:"columns-filter",children:[t.jsx(_,{icon:"columns",id:"columns-toggle-btn",onClick:d,tag:r.toString(),variant:"ghost"}),t.jsx(ei,{modalRef:p,title:"Manage columns",variant:f.isNil(s)?"ungrouped":"grouped"})]})},ce=u.createContext({containerRef:void 0,elementName:"",handleUnselectAll:void 0,hidden:!1,onKeyDown:void 0,selected:0,tableSize:0,tableRef:void 0,table:void 0}),nc=y.styled.span`
|
|
3207
3207
|
transition: all 150ms;
|
|
3208
3208
|
width: 5px;
|
|
3209
3209
|
height: 10px;
|
|
@@ -3228,7 +3228,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3228
3228
|
transition: opacity 150ms;
|
|
3229
3229
|
opacity: ${({$variant:e})=>e==="asc"?0:1};
|
|
3230
3230
|
}
|
|
3231
|
-
`,mt=e=>{const n=
|
|
3231
|
+
`,mt=e=>{const n=y.useTheme(),{variant:i}=e;return t.jsxs(nc,{$variant:i,children:[t.jsx(R,{icon:"caret-up",iconColor:n.palette.gray[600],iconSize:"xs",iconType:"fa-solid"}),t.jsx(R,{icon:"caret-down",iconColor:n.palette.gray[600],iconSize:"xs",iconType:"fa-solid"})]})},ic=y.styled.div`
|
|
3232
3232
|
position: relative;
|
|
3233
3233
|
|
|
3234
3234
|
div:has(table) {
|
|
@@ -3392,7 +3392,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3392
3392
|
}
|
|
3393
3393
|
}
|
|
3394
3394
|
}
|
|
3395
|
-
`,
|
|
3395
|
+
`,rc=y.styled.div`
|
|
3396
3396
|
${({$width:e,theme:n})=>`
|
|
3397
3397
|
display: flex;
|
|
3398
3398
|
flex-direction: column;
|
|
@@ -3420,7 +3420,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3420
3420
|
}
|
|
3421
3421
|
}
|
|
3422
3422
|
`}
|
|
3423
|
-
`,
|
|
3423
|
+
`,oc=y.styled.div`
|
|
3424
3424
|
align-items: center;
|
|
3425
3425
|
background-color: transparent;
|
|
3426
3426
|
display: flex;
|
|
@@ -3449,7 +3449,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3449
3449
|
margin-right: ${({theme:e})=>e.spacing[.5]};
|
|
3450
3450
|
}
|
|
3451
3451
|
}
|
|
3452
|
-
`,xn=
|
|
3452
|
+
`,xn=y.styled.div`
|
|
3453
3453
|
transition: all 150ms;
|
|
3454
3454
|
content: "";
|
|
3455
3455
|
z-index: 2;
|
|
@@ -3468,11 +3468,11 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3468
3468
|
transition: all 150ms;
|
|
3469
3469
|
border-right: 1px solid ${({theme:e})=>e.palette.black};
|
|
3470
3470
|
}
|
|
3471
|
-
`,
|
|
3471
|
+
`,Ei=()=>{const e=y.useTheme(),{table:n}=u.useContext(ce),{groupHeaders:i,tooltips:r}=(n==null?void 0:n.options.meta)??{},o=u.useCallback(p=>()=>{p.column.getCanSort()&&(n==null||n.setPageIndex(0),p.column.toggleSorting())},[n]),s=p=>d=>{p.getResizeHandler()(d)};if(i)return t.jsx("thead",{children:n==null?void 0:n.getHeaderGroups().map(p=>t.jsx("tr",{"data-testid":"row-headers",children:p.headers.map(d=>{var b;const{isPlaceholder:g}=d,x=g?d.subHeaders[0]:d;return f._.isUndefined(d.column.parent)&&d.depth>1?null:t.jsxs("th",{colSpan:x.colSpan,id:`header-${x.id}`,rowSpan:g?0:1,style:{borderRight:d.headerGroup.headers.indexOf(d)!==d.headerGroup.headers.length-1?"1px solid white":void 0,position:"relative",width:d.getSize()},children:[t.jsxs($,{alignItems:"center",bgColor:e.palette.gray[200],borderBottom:g?void 0:`1px solid${e.palette.white}`,display:"flex",gap:.25,height:g?"6rem":"3rem",lineSpacing:0,onClick:o(x),pl:.5,pt:g?3:0,whiteSpace:"nowrap",width:"100%",children:[f.flexRender(x.column.columnDef.header,x.getContext()),x.column.getCanSort()?t.jsx(mt,{variant:x.column.getIsSorted()}):void 0,(r==null?void 0:r.map(m=>m.columnId).includes(x.id))??!1?t.jsx(Z,{icon:"circle-info",id:x.id,place:"right",tip:((b=r==null?void 0:r.find(m=>m.columnId===x.id))==null?void 0:b.tip)??""}):void 0]}),x.column.getCanResize()&&t.jsx(xn,{onMouseDown:s(d)})]},x.id)})},p.id))});const[l,a]=(n==null?void 0:n.getHeaderGroups())??[],c=f.lodashExports.isNil(a)?l:a;return t.jsx("thead",{children:t.jsx("tr",{"data-testid":"row-headers",children:c.headers.map(p=>{var d;return t.jsxs("th",{id:`header-${p.id}`,style:{position:"relative",width:p.getSize()},children:[t.jsxs($,{alignItems:"center",bgColor:e.palette.gray[200],display:"flex",gap:.25,height:"3rem",lineSpacing:0,onClick:o(p),px:.5,whiteSpace:"nowrap",width:"100%",children:[f.flexRender(p.column.columnDef.header,p.getContext()),p.column.getCanSort()?t.jsx(mt,{variant:p.column.getIsSorted()}):void 0,(r==null?void 0:r.map(g=>g.columnId).includes(p.id))??!1?t.jsx(Z,{icon:"circle-info",id:p.id,place:"right",tip:((d=r==null?void 0:r.find(g=>g.columnId===p.id))==null?void 0:d.tip)??""}):void 0]}),p.column.getCanResize()&&t.jsx(xn,{onMouseDown:s(p)})]},p.id)})})})},sc=y.styled.div`
|
|
3472
3472
|
align-items: center;
|
|
3473
3473
|
display: flex;
|
|
3474
3474
|
width: 100%;
|
|
3475
|
-
`,
|
|
3475
|
+
`,Fi=()=>{const e=y.useTheme(),{table:n}=u.useContext(ce),{loading:i}=(n==null?void 0:n.options.meta)??{},r=u.useMemo(()=>{const{enableRowSelection:a,enableMultiRowSelection:c}=(n==null?void 0:n.options)??{};return a||c?1:0},[n==null?void 0:n.options]),o=u.useCallback((a,c)=>{if(c===r)return p=>{var d,g;p.stopPropagation(),(g=(d=n==null?void 0:n.options)==null?void 0:d.onRowClick)==null||g.call(d,a)}},[r,n]),s=u.useCallback(a=>c=>{c.stopPropagation(),a.toggleExpanded()},[]),l=u.useCallback(a=>{const{meta:c}=(n==null?void 0:n.options)??{},{onExpand:p=void 0}=c??{};return p?p(a):null},[n]);return i?t.jsx("tbody",{children:t.jsx("tr",{className:"row-loading","data-testid":"row-loading",children:t.jsx("td",{colSpan:(n==null?void 0:n.getVisibleLeafColumns().length)??0,children:t.jsx($,{alignItems:"center",display:"flex",justify:"center",width:"100%",children:t.jsx(bi,{size:"md"})})})})}):(n==null?void 0:n.getRowModel().rows.length)===0?t.jsx("tbody",{children:t.jsx("tr",{className:"row-no-data","data-testid":"row-no-data",children:t.jsx("td",{colSpan:n.getVisibleLeafColumns().length+1,children:t.jsx(I,{color:e.palette.gray[800],size:"md",textAlign:"center",children:"No data to display"})})})}):t.jsx("tbody",{children:n==null?void 0:n.getRowModel().rows.map(a=>t.jsxs(et.default.Fragment,{children:[t.jsx("tr",{"aria-expanded":a.getIsExpanded(),"data-testid":`row-${a.id}`,children:a.getVisibleCells().map((c,p)=>t.jsx("td",{className:p===r&&n.options.onRowClick?"clickable":"","data-testid":`cell-${c.id}`,onClick:o(a,p),children:t.jsxs(sc,{children:[p===r&&a.getCanExpand()?t.jsx("button",{onClick:s(a),style:{cursor:"pointer",marginRight:"1rem"},children:t.jsx(R,{icon:a.getIsExpanded()?"angle-up":"angle-down",iconSize:"lg",iconType:"fa-light"})}):void 0,f.flexRender(c.column.columnDef.cell,c.getContext())]})},c.id))}),a.getIsExpanded()?t.jsx("tr",{"data-testid":`row-${a.id}-expand`,id:"description",children:t.jsx("td",{colSpan:100,children:l(a)})}):void 0]},a.id))})},Ri=()=>{const{containerRef:e,hidden:n,elementName:i,handleUnselectAll:r,onKeyDown:o,selected:s,tableSize:l,tableRef:a}=u.useContext(ce);return t.jsxs("div",{ref:e,children:[n?void 0:t.jsx(rc,{$width:l,children:t.jsxs("div",{children:[t.jsx("b",{children:`${s} ${i} `}),`${s===1?"has":"have"} been selected. `,t.jsx("span",{onClick:r,onKeyDown:o,role:"link",tabIndex:0,children:"Unselect all"})]})}),t.jsxs("table",{ref:a,children:[t.jsx(Ei,{}),t.jsx(Fi,{})]})]})},hn=y.styled(V)`
|
|
3476
3476
|
${({theme:e,$padding:n})=>`
|
|
3477
3477
|
background-color: ${e.palette.white};
|
|
3478
3478
|
border: 1px solid ${e.palette.gray[200]};
|
|
@@ -3498,7 +3498,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3498
3498
|
background-color: ${e.palette.gray[100]};
|
|
3499
3499
|
}
|
|
3500
3500
|
`}
|
|
3501
|
-
`,
|
|
3501
|
+
`,Ni=()=>{const{table:e}=u.useContext(ce),{pagination:{pageIndex:n}={pageIndex:0}}=(e==null?void 0:e.getState())??{},i=(e==null?void 0:e.getPageCount())??0,r=u.useCallback(()=>{e==null||e.setPageIndex(n+1)},[n,e]),o=u.useCallback(()=>{e==null||e.previousPage()},[e]);return t.jsxs($,{alignItems:"center",display:"flex",gap:.5,children:[t.jsx(hn,{$padding:"4px 6px",disabled:!(e!=null&&e.getCanPreviousPage()),icon:"chevron-left",iconSize:"sm",iconType:"fa-light",id:"go-previous",onClick:o,variant:"ghost"}),t.jsx(hn,{$padding:"4px 6px",disabled:n>i-2,icon:"chevron-right",iconSize:"sm",iconType:"fa-light",id:"go-next",onClick:r,variant:"ghost"})]})},ac=10,lc=20,cc=50,dc=100,Ai=()=>{const e=y.useTheme(),{table:n}=u.useContext(ce),i=(n==null?void 0:n.getRowCount())??0,[r,o]=u.useState(!1),[s,l]=u.useState((n==null?void 0:n.getState().pagination.pageSize)??10),{refs:a,floatingStyles:c}=f.useFloating$1({middleware:[f.offset({mainAxis:4})],open:r,placement:"top-end",whileElementsMounted:f.autoUpdate}),p=u.useMemo(()=>f.transform([ac,lc,cc,dc],(h,b)=>(h.push(b),b===i?!1:b<=i),[]),[i]),d=u.useCallback(()=>{r&&o(!1)},[r]),g=u.useCallback(()=>{o(h=>!h)},[]),x=u.useCallback(h=>()=>{l(h),n==null||n.setPageSize(h),o(!1)},[n,l]);return re(a.reference.current,()=>{o(!1)},!0,[a.floating.current]),u.useEffect(()=>(window.addEventListener("scrollend",d,!0),()=>{window.removeEventListener("scrollend",d,!0)}),[d]),t.jsxs(u.Fragment,{children:[t.jsxs($,{alignItems:"center",bgColor:e.palette.white,border:"1px solid",borderColor:e.palette.gray[200],borderRadius:"4px",display:"flex",minHeight:"24px",px:.25,children:[t.jsx(I,{pr:.25,size:"md",children:s}),t.jsx(V,{color:e.palette.gray[400],icon:r?"chevron-up":"chevron-down",iconSize:"sm",iconType:"fa-light",id:"paginator-dropdown",onClick:g,px:.25,py:.25,ref:a.setReference,variant:"ghost"})]}),r?t.jsx($,{bgColor:e.palette.white,border:`1px solid ${e.palette.gray[200]}`,borderRadius:e.spacing[.5],display:"flex",flexDirection:"column",px:.25,py:.25,ref:a.setFloating,shadow:"md",style:c,children:p.map(h=>{const b=x(h);return t.jsx($,{bgColor:s===h?e.palette.gray[800]:"transparent",bgColorHover:e.palette.gray[s===h?800:100],borderRadius:e.spacing["0.25"],cursor:"pointer",maxWidth:"40px",minWidth:"40px",onClick:b,px:.25,py:.25,children:t.jsx(I,{color:s===h?e.palette.white:e.palette.gray[600],size:"md",textAlign:"center",children:h})},h)})}):void 0]})},Li=()=>{const{table:e}=u.useContext(ce),{pagination:{pageIndex:n,pageSize:i}={pageIndex:0,pageSize:10}}=(e==null?void 0:e.getState())??{},r=(e==null?void 0:e.getRowCount())??0,o=u.useCallback((s,l,a)=>{if(a===0)return"0 of 0";if(l*s>=a)return`${a} of ${a}`;const c=l*s+1,p=Math.min(l*(s+1),a);return`${c}-${p} of ${a}`},[]);return t.jsx(I,{display:"inline-block",fontWeight:"bold",size:"md",children:o(n,i,r)})},Pi=({children:e})=>t.jsxs(oc,{children:[t.jsxs("div",{className:"pagination-container",children:[t.jsx(Li,{}),t.jsx(Ai,{}),t.jsx(Ni,{})]}),e]}),Oi=({children:e})=>t.jsx("div",{className:"footer-container",children:e}),pc=y.styled.div.attrs({className:"search-container"})`
|
|
3502
3502
|
${({theme:e})=>`
|
|
3503
3503
|
display: flex;
|
|
3504
3504
|
flex-direction: column;
|
|
@@ -3545,7 +3545,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3545
3545
|
}
|
|
3546
3546
|
}
|
|
3547
3547
|
`}
|
|
3548
|
-
`,
|
|
3548
|
+
`,gc=y.styled.div.attrs({className:"controls-container"})`
|
|
3549
3549
|
display: flex;
|
|
3550
3550
|
flex: 1 0 50%;
|
|
3551
3551
|
|
|
@@ -3561,7 +3561,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3561
3561
|
justify-content: flex-end;
|
|
3562
3562
|
width: 100%;
|
|
3563
3563
|
}
|
|
3564
|
-
`,
|
|
3564
|
+
`,uc=y.styled.div`
|
|
3565
3565
|
display: flex;
|
|
3566
3566
|
flex-wrap: wrap;
|
|
3567
3567
|
width: 100%;
|
|
@@ -3576,7 +3576,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3576
3576
|
.highlight-container ~ .controls-container {
|
|
3577
3577
|
flex: 1 0 100%;
|
|
3578
3578
|
}
|
|
3579
|
-
`,
|
|
3579
|
+
`,xc=500,fn=300,Bi=({children:e})=>{const{table:n}=u.useContext(ce),{onSearch:i,search:r,searchPlaceholder:o="Search"}=(n==null?void 0:n.options.meta)??{},s=kt(a=>{const c=a.target.value.slice(0,fn);i==null||i(c)},xc),l=u.useCallback(()=>{i==null||i("")},[i]);return t.jsxs(uc,{children:[i===void 0?void 0:t.jsx(pc,{children:t.jsx(ge,{maxLength:fn,name:"search",onChange:s,onClear:l,placeholder:o,value:r})}),e]})},Wi=({children:e})=>t.jsx($,{display:"flex",flexDirection:"column",children:t.jsx("div",{className:"caption-container",children:e})}),Mi=({children:e})=>t.jsx(gc,{children:e}),_i=({children:e})=>t.jsx("div",{className:"highlight-container",children:e}),hc=160,Hi=({children:e,table:n})=>{var x;const i=u.useRef(null),r=u.useRef(null),{id:o}=n.options.meta??{},{enableMultiRowSelection:s}=(n==null?void 0:n.options)??{},l=Object.keys(n.getState().rowSelection).length,a=l===1?"item":"items",c=l===0||!s,p=Math.max(((x=i.current)==null?void 0:x.clientWidth)??0,n.getTotalSize()+hc),d=u.useCallback(()=>{n.resetRowSelection()},[n]),g=u.useCallback(h=>{h.key==="Enter"&&d()},[d]);return u.useEffect(()=>{n.setPageIndex(0)},[n]),t.jsx(ce.Provider,{value:{containerRef:i,elementName:a,handleUnselectAll:d,hidden:c,onKeyDown:g,selected:l,tableSize:p,tableRef:r,table:n},children:t.jsx(ic,{id:o,children:e})})},fc=Object.assign(Hi,{Caption:Wi,Columns:Di,Content:Ri,Controls:Mi,Export:Ii,Footer:Pi,FooterContent:Oi,Highlighted:_i,Options:Bi}),yc=y.styled.button`
|
|
3580
3580
|
${({theme:e})=>`
|
|
3581
3581
|
align-items: center;
|
|
3582
3582
|
background-color: ${e.palette.white};
|
|
@@ -3630,7 +3630,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3630
3630
|
background-color: ${e.palette.gray[100]};
|
|
3631
3631
|
}
|
|
3632
3632
|
`}
|
|
3633
|
-
`,
|
|
3633
|
+
`,bc=({disabled:e=!1,icon:n,id:i,label:r,name:o,onClick:s,type:l="button",variant:a})=>{const c=y.useTheme(),p=t.jsxs(yc,{"aria-label":o??void 0,className:a,disabled:e,id:i,onClick:s,type:l,children:[n&&t.jsx(R,{clickable:!1,icon:n,iconSize:o===void 0?"sm":"lg",iconType:"fa-light"}),o??void 0]});return t.jsxs($,{display:"flex",children:[p,r&&t.jsx(I,{color:c.palette.gray[800],ml:.5,size:"md",children:r})]})},$c=({items:e,spacing:n=.75})=>{const i=y.useTheme();return t.jsx($,{alignItems:"flex-start",display:"flex",flexDirection:"column",width:"100%",children:e.map(r=>t.jsxs($,{alignItems:"center",borderBottom:`1px solid ${i.palette.gray[200]}`,display:"flex",gap:.75,justify:"flex-start",pr:n,py:n,width:"100%",children:[t.jsx(I,{display:"inline-flex",fontWeight:"bold",size:"lg",whiteSpace:"nowrap",...r.backgroundColor?{bgGradient:r.backgroundColor,textFill:"transparent"}:{},children:r.header}),r.content??void 0]},r.header))})},mc=y.styled.div`
|
|
3634
3634
|
${({theme:e})=>`
|
|
3635
3635
|
align-items: flex-start;
|
|
3636
3636
|
display: flex;
|
|
@@ -3647,7 +3647,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3647
3647
|
fill: url(#gradient-01);
|
|
3648
3648
|
}
|
|
3649
3649
|
`}
|
|
3650
|
-
`,
|
|
3650
|
+
`,jc=({children:e,title:n,titleSize:i="sm",description:r,icon:o})=>{const s=y.useTheme();return t.jsxs(mc,{children:[n||r?t.jsxs($,{alignItems:"flex-start",display:"flex",flexDirection:"column",gap:.75,width:"100%",children:[t.jsxs($,{alignItems:"center",display:"flex",gap:.75,height:"max-content",children:[t.jsx("div",{style:{width:"30px",height:"30px",backgroundColor:s.palette.primary[25],borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t.jsx("i",{className:`fa-solid fa-${o} fill-gradient-01`,style:{fontSize:"14px",width:"14px",height:"14px"}})}),n?t.jsx(G,{fontWeight:"bold",size:i,children:n}):void 0]}),r??void 0]}):void 0,e]})},wc=y.styled.div`
|
|
3651
3651
|
${({theme:e})=>`
|
|
3652
3652
|
align-items: center;
|
|
3653
3653
|
background-color: ${e.palette.white};
|
|
@@ -3669,7 +3669,7 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3669
3669
|
border: 1px solid ${e.palette.gray[600]};
|
|
3670
3670
|
}
|
|
3671
3671
|
`}
|
|
3672
|
-
|
|
3672
|
+
`,vc=y.styled.div`
|
|
3673
3673
|
${({theme:e,$size:n})=>`
|
|
3674
3674
|
display: ${n==="long"?"flex":"block"};
|
|
3675
3675
|
flex-direction: column;
|
|
@@ -3719,4 +3719,4 @@ ${m[8]}...`:(m.length<8&&d(!1),i)},[s,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3719
3719
|
transform: translateX(-50%);
|
|
3720
3720
|
}
|
|
3721
3721
|
`}
|
|
3722
|
-
`,
|
|
3722
|
+
`,Vi=({date:e,description:n,title:i})=>{const r=y.useTheme();return t.jsxs(wc,{className:"timeline-card",children:[t.jsx(I,{color:r.palette.gray[800],fontWeight:"bold",size:"md",textAlign:"start",children:e}),t.jsx(I,{color:r.palette.gray[800],fontWeight:"bold",mb:.5,size:"md",textAlign:"center",children:i}),t.jsx("div",{children:n.map((o,s)=>{const l=`${o}#${s}`;return t.jsx(I,{size:"md",textAlign:"center",wordBreak:"break-word",children:o},l)})})]})},kc=({items:e})=>{const n=u.useRef(null),[i,r]=u.useState("long");return u.useEffect(()=>{n.current&&r(n.current.offsetWidth<=1100?"small":"long")},[]),t.jsx($,{ref:n,width:"100%",children:t.jsx(vc,{$size:i,children:e.map((o,s)=>t.jsx(Vi,{date:o.date,description:o.description,size:i,title:o.title},`${o.title}-${s}`))})})},Cc={content:"",disableBeacon:!0,hideCloseButton:!1,locale:{back:"Back",close:"Close",last:"Close",next:"Next",open:"Open the dialog",skip:"Skip"},showSkipButton:!0,styles:{buttonBack:{fontFamily:"roboto"},buttonNext:{fontFamily:"roboto"},buttonSkip:{fontFamily:"roboto"},options:{zIndex:9999},tooltipContainer:{fontFamily:"roboto",textAlign:"left"}},target:""},Sc=({run:e,steps:n,onFinish:i})=>{const[r,o]=u.useState(e),[s,l]=u.useState(0),a=u.useCallback(c=>{const{action:p,index:d,status:g,type:x}=c;[f.EVENTS.STEP_AFTER,f.EVENTS.TARGET_NOT_FOUND].includes(x)?l(d+(p===f.ACTIONS.PREV?-1:1)):([f.STATUS.FINISHED,f.STATUS.SKIPPED].includes(g)||p==="close")&&(o(!1),f.lodashExports.isUndefined(i)||i())},[i]);return t.jsx(f.components_default,{callback:a,continuous:!0,disableOverlayClose:!0,disableScrollParentFix:!0,run:r,spotlightClicks:!0,stepIndex:s,steps:n,styles:{buttonNext:{display:s===n.length-1?"none":"block"},options:{zIndex:9999}}})},zc={md:{categorySize:"sm",titleSize:"xs",descriptionSize:"md",detailsSize:"md"},lg:{categorySize:"md",titleSize:"sm",descriptionSize:"lg",detailsSize:"lg"}},Tc=({title:e,href:n,description:i,category:r,id:o,indx:s,remediationTime:l,score:a,severity:c,size:p="lg",requirements:d,Link:g})=>{const x=y.useTheme(),{categorySize:h,titleSize:b,descriptionSize:m,detailsSize:j}=zc[p],w=g??"a";return t.jsxs(St,{$index:s,children:[t.jsx(I,{bgGradient:x.palette.gradient,fontWeight:"bold",size:h,textFill:"transparent",children:r}),t.jsxs(w,{href:n,children:[t.jsx(G,{color:x.palette.gray[400],display:"inline",fontWeight:"bold",size:b,children:o}),t.jsx(G,{display:"inline",fontWeight:"bold",ml:.25,size:b,children:e})]}),t.jsx(I,{size:m,children:i}),t.jsxs($,{alignItems:p==="md"?"flex-start":"center",display:"flex",flexDirection:p==="md"?"column":"row",gap:.75,width:"100%",children:[t.jsxs(I,{color:x.palette.gray[400],display:"inline",size:j,children:[t.jsx("b",{children:"Remediation time: "}),`${l} min`]}),p==="lg"?t.jsx(se,{}):void 0,t.jsxs($,{alignItems:p==="md"?"flex-start":"center",display:"flex",gap:.25,children:[t.jsx(I,{color:x.palette.gray[400],display:"inline",fontWeight:"bold",size:j,children:"Default score: "}),t.jsx(tt,{textL:a,textR:f.capitalize(c==="disable"?"Unknown":c),variant:c})]}),p==="lg"?t.jsx(se,{}):void 0,t.jsxs($,{alignItems:"center",children:[t.jsx(I,{color:x.palette.gray[400],display:"inline",fontWeight:"bold",size:j,children:"Requirements: "}),d.map((C,k)=>t.jsxs(u.Fragment,{children:[k>0?t.jsx(I,{color:x.palette.gray[400],display:"inline",size:j,children:" / "}):void 0,t.jsx("a",{href:C.href,style:{color:x.palette.gray[400],fontSize:x.typography.text[j],textDecoration:"underline"},children:C.title})]},C.key))]})]})]})};exports.Accordion=vr;exports.AccordionContent=mn;exports.ActionButton=ze;exports.ActiveFilter=ci;exports.ActiveFilters=ya;exports.AdvancedBadge=Tr;exports.AdvisoriesCard=Lr;exports.Alert=Yr;exports.AppliedFilter=Te;exports.AppliedFilters=Xs;exports.ArrayField=ht;exports.Avatar=no;exports.BaseButtonComponent=jt;exports.BaseComponent=_e;exports.BaseSpanComponent=vt;exports.BaseTextComponent=wt;exports.Body=Fi;exports.Button=_;exports.Button$1=qe;exports.Button$2=de;exports.ButtonToolbarCenter=Eo;exports.ButtonToolbarRow=Ro;exports.ButtonToolbarStartRow=Fo;exports.Calendar=En;exports.Calendar$1=Ln;exports.Calendar$2=Pn;exports.CalendarCell=Dn;exports.CalendarGrid=it;exports.CaptionContent=Wi;exports.CardContainer=$s;exports.CardHeader=nt;exports.CardWithImage=oo;exports.CardWithInput=cs;exports.CardWithOptions=_n;exports.CardWithSelector=us;exports.CardWithSwitch=fs;exports.Carousel=Cs;exports.Checkbox=pe;exports.CodeSnippet=zs;exports.Col=xt;exports.ColumFilters=oi;exports.ColumnToggle=Di;exports.ColumnsModal=ei;exports.ComboBox=It;exports.ComboBoxField=ut;exports.Container=$;exports.ControlsContent=Mi;exports.CopyButton=oa;exports.CustomThemeProvider=hr;exports.DateField=Rn;exports.DateSelector=Ee;exports.DefaultInputFile=Bn;exports.Description=Si;exports.Dialog=ot;exports.Divider=me;exports.Dropdown=la;exports.DropzoneInputFile=Wn;exports.Editable=Do;exports.EmptyButton=bt;exports.EmptyState=ga;exports.ErrorMessage=co;exports.ExportCsv=Ii;exports.FATag=kn;exports.FilePreview=zn;exports.FilterControl=ti;exports.FilterForm=yt;exports.FilterFormContent=ni;exports.Filters=Ca;exports.FiltersContext=Ve;exports.FiltersList=ri;exports.FiltersMenu=xi;exports.FooterContent=Oi;exports.Form=Ta;exports.Gap=Lo;exports.GridContainer=Da;exports.GroupSelector=Fa;exports.Head=Ei;exports.Header=rt;exports.Header$1=Xn;exports.Heading=G;exports.HighlightedContent=_i;exports.Icon=R;exports.IconButton=V;exports.InProgressIcon=ki;exports.IndicatorCard=ys;exports.IndicatorCardDB=Na;exports.InfoSidebar=Aa;exports.InnerForm=Sa;exports.InputArray=Oo;exports.InputDate=An;exports.InputDateRange=Et;exports.InputDateTime=Io;exports.InputFile=Jo;exports.InputNumber=Mn;exports.InputNumberRange=Rt;exports.InputSection=Qo;exports.InputTags=ts;exports.ItemCardDB=Ba;exports.ItemContent=$c;exports.Label=Tt;exports.Link=le;exports.ListItem=He;exports.ListItemsWrapper=qn;exports.LittleFlag=Ma;exports.Loading=bi;exports.LocationCode=Un;exports.Logo=Za;exports.Lottie=Ja;exports.MemoizedImage=oe;exports.Menu=Qa;exports.MenuItem=zi;exports.MessageBanner=tl;exports.Modal=Ot;exports.ModalConfirm=Kn;exports.ModalFooter=Yn;exports.NoMatches=Wt;exports.Notification=sl;exports.NotificationSign=Ze;exports.NumberField=Re;exports.OAuthSelector=ll;exports.Option=Tn;exports.OptionBoxContainer=Mt;exports.OptionContainer=$t;exports.OptionContainer$1=yi;exports.Options=hi;exports.OptionsMenu=fi;exports.OutlineContainer=J;exports.PaginationControl=Ni;exports.PaginationDropdown=Ai;exports.PaginationSize=Li;exports.PaginatorDb=gl;exports.PaginatorDbDropdown=$i;exports.PhoneInput=as;exports.PopUp=vl;exports.Popover=$e;exports.PremiumFeature=mi;exports.PreviewPanel=Jn;exports.PriorityCard=vi;exports.PriorityCards=hl;exports.PriorityScore=fl;exports.ProgressBar=Ft;exports.ProgressIndicator=wl;exports.ProgressStep=ml;exports.RadioButton=Nt;exports.RankPosition=wi;exports.RankPositionIcon=ji;exports.Row=On;exports.RulesCard=Cl;exports.ScrollUpButton=zl;exports.Search=ge;exports.SearchDropdown=Ll;exports.SearchPanel=Qn;exports.SeverityBadge=tt;exports.SeverityOverview=Ol;exports.SeverityOverviewBadge=De;exports.ShowOnHover=Wl;exports.SlideOutMenu=_l;exports.Slider=Xl;exports.SortIcon=mt;exports.Span=be;exports.StepLapse=ec;exports.Tab=Zn;exports.Table=fc;exports.Table$1=Hi;exports.TableButton=bc;exports.TableContent=jc;exports.TableContent$1=Ri;exports.TableContext=ce;exports.TableFooter=Pi;exports.TableOptions=Bi;exports.Tabs=Lt;exports.Tag=q;exports.TagsField=ft;exports.Text=I;exports.TextArea=ls;exports.TextInput=st;exports.Thumb=Ti;exports.TimeField=Nn;exports.TimeLine=kc;exports.TimeLineCard=Vi;exports.Toggle=Hn;exports.Tooltip=Z;exports.Tour=Sc;exports.WeaknessesCard=Tc;exports.baseStep=Cc;exports.formatCheckValues=si;exports.getStyledConfig=Me;exports.hiddenProps=yn;exports.icons=xr;exports.setBorder=Pe;exports.setDisplay=Oe;exports.setInteraction=We;exports.setMargin=Ae;exports.setPadding=Ne;exports.setPosition=Le;exports.setText=Be;exports.theme=A;exports.useCarousel=jn;exports.useClickOutside=re;exports.useCloudinaryImage=wn;exports.useColumnsModal=vn;exports.useConditionsDialog=na;exports.useConfirmDialog=ia;exports.useDebouncedCallback=kt;exports.useFilterForm=ii;exports.useFilters=ta;exports.useFiltersValues=Ct;exports.useModal=we;exports.useSearch=Fr;exports.variantBuilder=ae;
|