@fluidattacks/design 3.35.1-pr.2 → 3.35.2-pr.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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-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/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/types.d.ts +2 -2
- 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.js +1 -1
- 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-DUYuJhvr.mjs → components-BsV1-bT0.mjs} +117 -120
- package/dist/{components-C4LiAB_2.js → components-Drv0AXbU.js} +39 -39
- package/dist/context/index.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),u=require("react"),y=require("styled-components"),f=require("./vendor-M0fdui5O.js"),
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),u=require("react"),y=require("styled-components"),f=require("./vendor-M0fdui5O.js"),we=require("react-dom"),gt=require("react-router-dom"),ir=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},nt=ir(u),le=e=>({getVariant:(n,i)=>e(n)[i]}),bn=["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"],rr={25:"#fcfcfd",50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#2f394b",800:"#212a36",900:"#161b25"},or={25:"#fef2f3",50:"#fddfe2",100:"#fbbac0",200:"#f9959e",300:"#f65e6a",400:"#f32637",500:"#bf0b1a",600:"#ac0a17",700:"#9a0915",800:"#870812",900:"#750710"},sr={25:"",50:"",100:"#f59dbe",200:"",300:"#b8075d",400:"",500:"#7f0540",600:"",700:"#59042d",800:"",900:"#460323"},ar={25:"",50:"#fef3f2",100:"",200:"#fecdca",300:"",400:"",500:"#f04438",600:"",700:"#b42318",800:"",900:""},lr={25:"",50:"#fffaeb",100:"",200:"#fef0c7",300:"",400:"#ffd562",500:"#fdb022",600:"#f27100",700:"#b54708",800:"",900:""},cr={25:"",50:"#f6fef9",100:"",200:"#a6f4c5",300:"",400:"",500:"#12b76a",600:"",700:"#027a48",800:"",900:""},dr={25:"",50:"#eff8ff",100:"",200:"#b2ddff",300:"",400:"",500:"#2e90fa",600:"",700:"#175cd3",800:"",900:""},pr="linear-gradient(180deg, #BF0B1A 0%, #F32637 100%)",gr={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"}},ur={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)"},xr={sm:"1024px",md:"1440px",lg:"1920px"},hr={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"},fr=["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"],L={typography:gr,shadows:ur,breakpoints:xr,spacing:hr,palette:{primary:or,complementary:sr,error:ar,info:dr,warning:lr,success:cr,black:"#0c111d",gradient:pr,white:"#ffffff",gray:rr}},yr=({children:e})=>t.jsx(y.ThemeProvider,{theme:L,children:e}),P=(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: ${L.spacing[s]} ${L.spacing[l]} ${L.spacing[a]} ${L.spacing[c]};`}return`padding: ${L.spacing[n]} ${L.spacing[i]} ${L.spacing[r]} ${L.spacing[o]};`},Le=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: ${L.spacing[s]} ${L.spacing[l]} ${L.spacing[a]} ${L.spacing[c]};`}return`margin: ${L.spacing[n]} ${L.spacing[i]} ${L.spacing[r]} ${L.spacing[o]};`},Ae=e=>{const n=P("position",e.position),i=P("top",e.top),r=P("right",e.right),o=P("bottom",e.bottom),s=P("left",e.left),l=P("z-index",e.zIndex);return`
|
|
2
2
|
${n}
|
|
3
3
|
${i}
|
|
4
4
|
${r}
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
|
|
173
173
|
${i===void 0?"":`&::after { content: "${i}"; }`}
|
|
174
174
|
`}
|
|
175
|
-
`,Y=u.forwardRef(function({bgGradient:n,children:i,className:r,color:o,display:s,fontFamily:l,fontWeight:a,letterSpacing:c,lineSpacing:d,lineSpacingSm:p,overflow:g,size:x,sizeMd:h,sizeSm:b,textFill:m,whiteSpace:j,wordBreak:v,...k},S){return t.jsx(jr,{$bgGradient:n,$color:o,$display:s,$fontFamily:l,$fontWeight:a,$letterSpacing:c,$lineSpacing:d,$lineSpacingSm:p,$overflow:g,$size:x,$sizeMd:h,$sizeSm:b,$textFill:m,$whiteSpace:j,$wordBreak:v,className:r,ref:S,...k,children:i})})
|
|
175
|
+
`,Y=u.forwardRef(function({bgGradient:n,children:i,className:r,color:o,display:s,fontFamily:l,fontWeight:a,letterSpacing:c,lineSpacing:d,lineSpacingSm:p,overflow:g,size:x,sizeMd:h,sizeSm:b,textFill:m,whiteSpace:j,wordBreak:v,...k},S){return t.jsx(jr,{$bgGradient:n,$color:o,$display:s,$fontFamily:l,$fontWeight:a,$letterSpacing:c,$lineSpacing:d,$lineSpacingSm:p,$overflow:g,$size:x,$sizeMd:h,$sizeSm:b,$textFill:m,$whiteSpace:j,$wordBreak:v,className:r,ref:S,...k,children:i})}),$e=u.forwardRef(function({children:n,color:i,content:r,display:o,fontFamily:s,fontWeight:l,letterSpacing:a,lineSpacing:c,lineSpacingSm:d,size:p,sizeMd:g,sizeSm:x,...h},b){return t.jsx(wr,{$color:i,$content:r,$display:o,$fontFamily:s,$fontWeight:l,$letterSpacing:a,$lineSpacing:c,$lineSpacingSm:d,$size:p,$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:d,lineSpacingSm:p,overflow:g,size:x,sizeMd:h,sizeSm:b,textFill:m,whiteSpace:j,wordBreak:v,fontStyle:k,...S},w){return t.jsx(mn,{$bgGradient:n,$color:o,$display:s,$fontFamily:l,$fontStyle:k,$fontWeight:a,$letterSpacing:c,$lineSpacing:d,$lineSpacingSm:p,$overflow:g,$size:x,$sizeMd:h,$sizeSm:b,$textFill:m,$whiteSpace:j,$wordBreak:v,className:r,ref:w,...S,children:i})}),jn=({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]})},lt={xl:"24px",lg:"16px",md:"14px",sm:"12px",xs:"10px"},vr=e=>lt[e]?lt[e]:typeof e=="string"&&e.includes("px")?e:lt.md,kr=y.styled(kt)`
|
|
176
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"};
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
content: "";
|
|
276
276
|
height: 24px;
|
|
277
277
|
border-left: 2px solid ${({theme:e})=>e.palette.gray[100]};
|
|
278
|
-
`,Vr=({affects:e,author:n,creator:i,href:r,ids:o,indx:s,Link:l,packageName:a,publishedDate:c,score:d,severity:p,title:g})=>{const x=y.useTheme(),h=l??"a";return t.jsxs(zt,{$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(
|
|
278
|
+
`,Vr=({affects:e,author:n,creator:i,href:r,ids:o,indx:s,Link:l,packageName:a,publishedDate:c,score:d,severity:p,title:g})=>{const x=y.useTheme(),h=l??"a";return t.jsxs(zt,{$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($e,{color:x.palette.gray[800],display:"inline",size:"lg",children:[" ",`(${o.advId})`]})]}),i?t.jsx(Sn,{author:n,variant:i}):void 0]}),t.jsx(h,{href:r,children:t.jsx(Y,{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(it,{textL:d,textR:f.capitalize(p==="disable"?"Unknown":p),variant:p}),e?t.jsxs(t.Fragment,{children:[t.jsx(ae,{}),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(ae,{}),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(ae,{}),t.jsxs(I,{color:x.palette.gray[400],display:"inline",size:"lg",children:[t.jsx("b",{children:"Published date: "}),c]})]}):void 0]})]})},Mr=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:_r}=le(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]};
|
|
@@ -509,7 +509,7 @@
|
|
|
509
509
|
left: 50%;
|
|
510
510
|
transform: translateX(-50%) rotate(180deg);
|
|
511
511
|
`}}}
|
|
512
|
-
`,K=({children:e,disabled:n=!1,display:i="inline-block",height:r,icon:o,iconColor:s,iconSize:l,id:a,maxWidth:c,nodeTip:d,place:p="bottom",tip:g="",title:x="",hide:h=g===""&&x===""&&d===void 0,width:b})=>{const m=y.useTheme(),[j,v]=u.useState(!1),{refs:k,floatingStyles:S,context:w,placement:C}=f.useFloating({middleware:[f.flip({fallbackAxisSideDirection:"start"}),f.offset({mainAxis:10}),f.shift()],onOpenChange:v,open:j,placement:p,whileElementsMounted:f.autoUpdate}),z=f.useHover(w,{delay:{close:0,open:500},move:!1}),D=f.useFocus(w),E=f.useRole(w,{role:o?"label":"tooltip"}),{getReferenceProps:R,getFloatingProps:T}=f.useInteractions([z,D,E]),F=u.useMemo(()=>C.startsWith("top")?"top":C.startsWith("bottom")?"bottom":C.startsWith("left")?"left":C.startsWith("right")?"right":"bottom",[C]);return n?t.jsx(u.StrictMode,{children:e}):t.jsxs(t.Fragment,{children:[t.jsx(Zr,{...R(),display:i,height:r,id:a,ref:k.setReference,width:b,children:o?t.jsx(N,{clickable:!0,disabled:n,icon:o,iconColor:s,iconSize:l??"sm",iconType:j?"fa-solid":"fa-light"}):e}),j&&!h&&
|
|
512
|
+
`,K=({children:e,disabled:n=!1,display:i="inline-block",height:r,icon:o,iconColor:s,iconSize:l,id:a,maxWidth:c,nodeTip:d,place:p="bottom",tip:g="",title:x="",hide:h=g===""&&x===""&&d===void 0,width:b})=>{const m=y.useTheme(),[j,v]=u.useState(!1),{refs:k,floatingStyles:S,context:w,placement:C}=f.useFloating({middleware:[f.flip({fallbackAxisSideDirection:"start"}),f.offset({mainAxis:10}),f.shift()],onOpenChange:v,open:j,placement:p,whileElementsMounted:f.autoUpdate}),z=f.useHover(w,{delay:{close:0,open:500},move:!1}),D=f.useFocus(w),E=f.useRole(w,{role:o?"label":"tooltip"}),{getReferenceProps:R,getFloatingProps:T}=f.useInteractions([z,D,E]),F=u.useMemo(()=>C.startsWith("top")?"top":C.startsWith("bottom")?"bottom":C.startsWith("left")?"left":C.startsWith("right")?"right":"bottom",[C]);return n?t.jsx(u.StrictMode,{children:e}):t.jsxs(t.Fragment,{children:[t.jsx(Zr,{...R(),display:i,height:r,id:a,ref:k.setReference,width:b,children:o?t.jsx(N,{clickable:!0,disabled:n,icon:o,iconColor:s,iconSize:l??"sm",iconType:j?"fa-solid":"fa-light"}):e}),j&&!h&&we.createPortal(t.jsxs(qr,{...T(),$maxWidth:c,id:`floating-${a}`,ref:k.setFloating,style:S,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(d)?void 0:d,t.jsx(Kr,{$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)]})},H=u.forwardRef(function({borderRadius:n,disabled:i,icon:r,iconColor:o,iconSize:s="sm",iconTransform:l,iconType:a,id:c,justify:d="center",onClick:p,px:g,py:x,type:h="button",tooltip:b,tooltipPlace:m,value:j,variant:v="primary",...k},S){const w=t.jsx(Xr,{$variant:v,"aria-disabled":i,"aria-label":c,borderRadius:n,disabled:i,id:c,justify:d,onClick:p,px:g,py:x,ref:S,type:h,value:j,...k,children:t.jsx(N,{clickable:!1,icon:r,iconColor:o,iconSize:s,iconTransform:l,iconType:a})}),z=(h+(v??"")+(c??r)).replace(/ /u,"_");return b===void 0?w:t.jsx(K,{id:`${z}-tooltip`,place:m,tip:b,children:w})}),Jr=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:d=!0,time:p=8,title:g,variant:x="error",id:h,...b},m){const[j,v]=u.useState(d),k=u.useCallback(()=>{a==null||a(),v(!1)},[a]);return u.useEffect(()=>{const S=setTimeout(()=>{c==null||c(!0),n&&k()},p*1e3);return()=>{clearTimeout(S)}},[n,k,p,c]),u.useEffect(()=>{v(d)},[d,v]),t.jsx($,{display:j?"block":"none",ref:m,role:"alert",...b,children:t.jsxs(Hr,{$iconPosition:l,$variant:x,id:h,children:[s?t.jsx(N,{clickable:!1,icon:o??Mr(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(Ur,{children:g}):void 0,t.jsx(Gr,{$hasTitle:!!g,children:i})]}),r?t.jsx(H,{height:"fit-content",icon:"close",iconSize:"lg",iconType:"fa-light",onClick:k,px:.125,py:.125,style:{alignSelf:"flex-start"},variant:"ghost"}):void 0]})})}),Jt=y.styled.div`
|
|
513
513
|
${({theme:e})=>`
|
|
514
514
|
align-items: center;
|
|
515
515
|
background-color: ${e.palette.gray[200]};
|
|
@@ -753,7 +753,7 @@
|
|
|
753
753
|
${Tt}
|
|
754
754
|
`,so=y.styled(gt.Link)`
|
|
755
755
|
${Tt}
|
|
756
|
-
`,ce=({children:e,color:n,download:i,href:r,iconPosition:o="right",onClick:s,target:l,variant:a="lowRelevance",wrap:c=!1})=>{const d=r.startsWith("https://"),p=t.jsx(N,{icon:i===void 0?"arrow-up-right-from-square":"arrow-down-to-bracket",iconSize:"sm",iconType:"fa-light",ml:.25,mr:.25});return d?t.jsxs(oo,{$color:n,$variant:a,$wrap:c,download:i,href:r,onClick:s,rel:"nofollow noopener noreferrer",target:l??"_blank",children:[o==="left"?p:void 0,e,o==="right"?p:void 0]}):t.jsxs(so,{$variant:a,$wrap:c,download:i,onClick:s,rel:"nofollow noopener noreferrer",target:l,to:r,children:[l!==void 0&&o==="left"?p:void 0,e,l!==void 0&&o==="right"?p:void 0]})},J=({disabled:e,icon:n,iconColor:i="inherit",iconType:r="fa-light",id:o="close-tag",filterId:s="",filterValues:l="",fontSize:a,href:c,linkLabel:d,onClose:p,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(
|
|
756
|
+
`,ce=({children:e,color:n,download:i,href:r,iconPosition:o="right",onClick:s,target:l,variant:a="lowRelevance",wrap:c=!1})=>{const d=r.startsWith("https://"),p=t.jsx(N,{icon:i===void 0?"arrow-up-right-from-square":"arrow-down-to-bracket",iconSize:"sm",iconType:"fa-light",ml:.25,mr:.25});return d?t.jsxs(oo,{$color:n,$variant:a,$wrap:c,download:i,href:r,onClick:s,rel:"nofollow noopener noreferrer",target:l??"_blank",children:[o==="left"?p:void 0,e,o==="right"?p:void 0]}):t.jsxs(so,{$variant:a,$wrap:c,download:i,onClick:s,rel:"nofollow noopener noreferrer",target:l,to:r,children:[l!==void 0&&o==="left"?p:void 0,e,l!==void 0&&o==="right"?p:void 0]})},J=({disabled:e,icon:n,iconColor:i="inherit",iconType:r="fa-light",id:o="close-tag",filterId:s="",filterValues:l="",fontSize:a,href:c,linkLabel:d,onClose:p,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($e,{className:"gap-0.5","data-testid":s,display:c===void 0?"initial":"flex",size:"md",children:[t.jsxs(io,{$fontSize:a,$variant:b,className:g,children:[n&&t.jsx(N,{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})]}),p?t.jsx(H,{disabled:e,icon:"xmark",iconSize:"sm",iconType:"fa-light",id:o,onClick:p,px:.125,py:.125,variant:"ghost"}):void 0]}),c===void 0?void 0:t.jsx(ce,{href:c,children:d})]})},Tn=(e,n=!0)=>{const i=window.open(e,n?void 0:"_self","noopener,noreferrer,");f.lodashExports.isObject(i)&&(i.opener=null)},W=u.forwardRef(function({children:n,disabled:i=!1,external:r=!1,href:o,id:s,icon:l,iconColor:a,iconSize:c="lg",iconType:d,name:p,dotNotification:g,notification:x,onClick:h,rightIcon:b,tag:m,type:j="button",tooltip:v,tooltipPlace:k="bottom",underline:S=!1,value:w,variant:C="primary",width:z,...D},E){const R=v!==void 0,T=`${s}-tooltip`,F=u.useCallback(()=>{o&&Tn(o,r)},[r,o]),A=t.jsxs(zn,{$variant:C,"aria-disabled":i,className:S?"underline":void 0,disabled:i,id:s,name:p,onClick:C==="link"?F:h,ref:E,type:j,value:w,width:z,...R?{"data-tooltip-id":T}:{},...D,children:[g&&C==="ghost"&&!i?t.jsx(Je,{left:l!==void 0?"13%":"1%",show:!0,top:"20%",variant:"error"}):void 0,l!==void 0&&t.jsx(N,{icon:l,iconColor:a??void 0,iconSize:c,iconType:d??"fa-light"}),n,b||C==="link"?t.jsx(N,{icon:b??"arrow-right",iconSize:c,iconType:"fa-light"}):void 0,m===void 0||i?null:t.jsx(J,{tagLabel:m,variant:"default"}),x!==void 0&&C==="ghost"&&!i?t.jsx(Je,{numberIndicator:x,show:!0,variant:"error"}):void 0]});return R?t.jsx(K,{disabled:!R,id:T,place:k,tip:v,width:z,children:A}):A}),ao=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(W,{onClick:i,px:.5,py:.5,variant:"ghost",children:[t.jsx(Jt,{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(N,{clickable:!1,icon:"ellipsis-v",iconSize:"xs",ml:.5}):void 0]}):t.jsxs($,{alignItems:"center",display:"flex",px:.5,py:.5,children:[t.jsx(Jt,{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(N,{clickable:!1,icon:"ellipsis-v",iconSize:"xs",ml:.5}):void 0]}),t.jsx(Qr,{children:n})]})})}),rt=({authorEmail:e,date:n,description:i,descriptionColor:r,id:o,title:s,titleColor:l,textAlign:a,textSpacing:c=0,tooltip:d})=>{const p=y.useTheme();return t.jsxs($,{width:"100%",children:[typeof s=="string"||d?t.jsxs($,{alignItems:"center",display:"inline-flex",gap:.5,width:"100%",children:[typeof s=="string"?t.jsx(I,{color:l??p.palette.gray[800],fontWeight:"bold",mb:c,size:"md",textAlign:a,wordBreak:"break-word",children:s}):s,d&&t.jsx(K,{icon:"circle-info",id:o,place:"top",tip:d})]}):void 0,t.jsxs($,{alignItems:"start",display:"flex",flexDirection:"column",gap:.25,children:[i&&t.jsx(I,{color:r??p.palette.gray[800],fontWeight:i===void 0?"bold":"regular",size:"md",textAlign:a,wordBreak:"break-word",children:i}),n&&t.jsx(I,{color:p.palette.gray[800],fontWeight:"bold",size:"md",textAlign:a,wordBreak:"break-word",children:`Date: ${n.split(" ")[0]}`}),e&&t.jsx(I,{color:p.palette.gray[800],fontWeight:"bold",size:"md",textAlign:a,wordBreak:"break-word",children:`Author: ${e}`})]})]})},Qt=y.styled($).attrs(({...e})=>({display:"inline-block",position:"relative",...e}))`
|
|
757
757
|
& img {
|
|
758
758
|
display: block;
|
|
759
759
|
}
|
|
@@ -995,7 +995,7 @@
|
|
|
995
995
|
line-height: 18px;
|
|
996
996
|
text-align: left;
|
|
997
997
|
`}
|
|
998
|
-
`,Q=({children:e,disabled:n,id:i,error:r,helpLink:o,helpLinkText:s="Link here",helpText:l,htmlFor:a,label:c,linkPosition:d="down",maxLength:p,required:g,tooltip:x,value:h,weight:b})=>{const m=y.useTheme(),j=h?h.length:0;return t.jsxs(uo,{id:i,children:[c===void 0?void 0:t.jsx(It,{htmlFor:a,label:c,link:d==="up"?o:void 0,required:g,tooltip:x,weight:b}),e,r||p?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}),p&&t.jsx(J,{priority:"low",tagLabel:`${j}/${p}`,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(N,{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&&d==="down"?t.jsx(ce,{href:o,children:s}):void 0]}):void 0]})},
|
|
998
|
+
`,Q=({children:e,disabled:n,id:i,error:r,helpLink:o,helpLinkText:s="Link here",helpText:l,htmlFor:a,label:c,linkPosition:d="down",maxLength:p,required:g,tooltip:x,value:h,weight:b})=>{const m=y.useTheme(),j=h?h.length:0;return t.jsxs(uo,{id:i,children:[c===void 0?void 0:t.jsx(It,{htmlFor:a,label:c,link:d==="up"?o:void 0,required:g,tooltip:x,weight:b}),e,r||p?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}),p&&t.jsx(J,{priority:"low",tagLabel:`${j}/${p}`,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(N,{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&&d==="down"?t.jsx(ce,{href:o,children:s}):void 0]}):void 0]})},me=({className:e,children:n,isFilter:i=!1,popoverRef:r,state:o,triggerRef:s,...l})=>{var x;const a=y.useTheme(),c=u.useRef(null),d=(x=s==null?void 0:s.current)==null?void 0:x.getBoundingClientRect(),{popoverProps:p}=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",{...p,className:e,id:"popover",onPointerDown:i?g:void 0,ref:r??c,style:{...p.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:d==null?void 0:d.width}:{}},children:n})})},en=y.styled.ul`
|
|
999
999
|
${({theme:e,$multiSelection:n,$width:i})=>`
|
|
1000
1000
|
align-self: center;
|
|
1001
1001
|
background: ${e.palette.white};
|
|
@@ -1141,7 +1141,7 @@
|
|
|
1141
1141
|
fill: ${e.palette.white};
|
|
1142
1142
|
}
|
|
1143
1143
|
`}
|
|
1144
|
-
`,
|
|
1144
|
+
`,ge=u.forwardRef(function({checked:n,disabled:i=!1,label:r,name:o,onChange:s,onClick:l,onFocus:a,onKeyDown:c,tooltip:d,value:p,...g},x){return t.jsxs("div",{className:"gap-1 inline-flex items-start parent-checkbox",children:[t.jsxs(bo,{"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??p:p,disabled:i,id:o,name:o,onChange:s,onClick:l,onFocus:a,onKeyDown:c,ref:x,type:"checkbox",value:p,...g}),t.jsx(N,{disabled:i,icon:"check",iconSize:"xl"}),r??p]}),d===void 0?void 0:t.jsx(K,{icon:"circle-info",id:d,place:"right",tip:d})]})}),Dn=({item:e,multiSelection:n,name:i,register:r,setInputValue:o,setValue:s,state:l,watch:a})=>{var D,E,R;const c=y.useTheme(),d=u.useRef(null),p=e.props.hrefLang,g=l.disabledKeys,x=Array.from(l.collection.getKeys()).filter(T=>!Array.from(g).includes(T)&&T!=="All"),{optionProps:h,isSelected:b,isFocused:m,isDisabled:j}=f.$293f70390ea03370$export$497855f14858aa34({key:e.key},l,d),v=[b?"selected":"",m?"focused":"",j?"disabled":""].join(" "),k=u.useCallback(T=>{o(""),s==null||s(`${i}Options`,""),T.currentTarget.checked&&(o(T.currentTarget.value),s==null||s(`${i}Options`,x))},[x,i,o,s]),S=u.useCallback(()=>{const T=a==null?void 0:a(`${i}Options`),F=typeof T=="string"?[T]:T;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]),w=e.key==="All"?t.jsx(ge,{...r==null?void 0:r("checkAll",{onChange:k}),label:(D=e.rendered)==null?void 0:D.toString(),name:"checkAll",value:(E=e.rendered)==null?void 0:E.toString()}):t.jsx(ge,{...r==null?void 0:r(`${i}Options`,{onChange:S}),label:(R=e.rendered)==null?void 0:R.toString(),name:`${i}Options`,value:e.key.toString()}),C=n&&!j?w:t.jsx(I,{color:c.palette.gray[800],size:"md",textOverflow:"ellipsis",whiteSpace:"nowrap",children:e.rendered}),z=u.useCallback(T=>{var F;T.preventDefault(),o(((F=e.rendered)==null?void 0:F.toString())??""),l.setSelectedKey(e.key),setTimeout(()=>{l.setOpen(!1)},50),Tn(p)},[p,e.key,e.rendered,l,o]);return oe(document.getElementsByClassName("dropdown")[0],()=>{n&&l.close()},!0,[document.getElementById("combobox")]),t.jsxs(fo,{...!n&&!p?h:{},$multiSelection:n,className:v,ref:d,children:[p?t.jsx(ce,{href:p,onClick:z,children:C}):C,b&&!j&&!n?t.jsx(N,{icon:"check",iconSize:"sm",iconType:"fa-light"}):void 0,e.rendered===e.textValue?void 0:t.jsx(J,{tagLabel:e.textValue,variant:"inactive"})]})},xt=({field:e,disabled:n=!1,disabledKeys:i,error:r,helpLink:o,helpLinkText:s,helpText:l,label:a,loadingItems:c,name:d,multiSelection:p=!1,items:g,onBlur:x,onChange:h,onClear:b,placeholder:m,clearable:j=!1,emptyMessage:v,register:k,required:S,setValue:w,tooltip:C,value:z,watch:D,weight:E})=>{var Xt,Zt;const R=y.useTheme(),T=n?void 0:r,F=(e==null?void 0:e.value)??z,[A,O]=u.useState(((Xt=g.find(B=>B.value===F))==null?void 0:Xt.name)??""),[M,U]=u.useState(F),[G,X]=u.useState(g),[xe,V]=u.useState(!1),{contains:_}=f.$bb77f239b46e8c72$export$3274cf84b703fff({sensitivity:"base"}),ie=u.useRef(null),he=u.useRef(null),ke=u.useRef(null),Ce=u.useRef(null),Ge=u.useRef(null),Yi=u.useMemo(()=>g.toSorted((B,q)=>{const ee=Array.from(i??[]),Se=ee.includes(B.value),qt=ee.includes(q.value);return Se&&!qt?1:!Se&&qt?-1:0}).map(B=>_(B.name,A)||xe?t.jsx(f.$c1d7fb2ec91bae71$export$6d08773d2e66f8f2,{"aria-label":B.value,hrefLang:B.href,textValue:B.tag,children:B.name},B.value):null),[_,i,A,g,xe]),Xi=u.useCallback(B=>{const q=B.split(/,|\s/u).slice(-1)[0].trim();O(p?q:B),B===""||B.endsWith(",")?V(!0):(V(!1),U(ee=>{const Se=B===""?"":ee;return e&&e.onChange(Se),h&&h(B),Se}),X(g.filter(ee=>_(ee.name,p?q:B))))},[_,g,e,p,h]),Zi=u.useCallback(B=>{var q;O(((q=g.find(ee=>ee.value===B))==null?void 0:q.name)??""),U(B?String(B):""),e&&e.onChange(B),h&&h(B?String(B):""),X(g)},[g,e,h]),_t=u.useCallback(B=>{B.key==="Enter"&&B.preventDefault(),V(!1)},[]),qi=u.useCallback(()=>{x&&x(),e&&e.onBlur()},[e,x]),Ki=u.useCallback(()=>{V(!0)},[]),Z=f.$a9e7382a7d111cb5$export$b453a3bfd4a5fa9e({allowsCustomValue:p,allowsEmptyCollection:!0,disabledKeys:i,inputValue:A,items:G,menuTrigger:"focus",shouldCloseOnBlur:!p,selectedKey:M,onBlur:qi,onInputChange:Xi,onKeyDown:_t,onKeyUp:Ki,onOpenChange(B,q){V(B&&(q==="manual"||q==="focus")),B&&setTimeout(()=>{var ee;return(ee=ie.current)==null?void 0:ee.focus()},50)},onSelectionChange:p?void 0:Zi,children:Yi}),Ji=u.useCallback(()=>{O(""),U(null),X(g),Z.setSelectedKey(null),Z.setInputValue(""),h&&h(""),b==null||b()},[g,b,Z,h]),{buttonProps:Qi,inputProps:er,listBoxProps:tr}=f.$c350ade66beef0af$export$8c18d1b4f7232bbf({inputValue:A,buttonRef:he,id:d,inputRef:ie,label:a??d,listBoxRef:ke,name:d,placeholder:m,popoverRef:Ge},Z),{listBoxProps:Ht}=f.$c132121280ec012d$export$50eacbbf140a3141(tr,Z,ke),{buttonProps:nr}=f.$701a24aa0da5b062$export$ea18c227d4417cc3(Qi,he),{width:Ut}=((Zt=Ce.current)==null?void 0:Zt.getBoundingClientRect())??{width:240};oe(Ce.current,()=>{Z.isOpen&&!p&&Z.close()},!0,[Ge.current]),u.useEffect(()=>{var B;if((c===!1||!F)&&!p){const q=((B=g.find(ee=>ee.value===F))==null?void 0:B.name)??"";O(q),U(q)}},[F,g,c,p]);const Gt=Array.from(Z.collection),Yt=f.useVirtualizer({count:Gt.length,estimateSize:()=>28,getScrollElement:()=>ke.current});return t.jsxs(Q,{error:T,helpLink:o,helpLinkText:s,helpText:l,htmlFor:d,id:"combobox",label:a,required:S,tooltip:C,weight:E,children:[t.jsxs(ne,{className:`${n?"disabled":""} ${T?"error":""}`,ref:Ce,children:[t.jsx("input",{...er,"aria-invalid":T?"true":"false","aria-label":d,disabled:n,onKeyDown:_t,ref:ie}),T?t.jsx(N,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:R.palette.error[500],iconSize:"lg"}):void 0,j&&M&&!n?t.jsx(H,{icon:"xmark",iconColor:R.palette.gray[400],iconSize:"sm",iconType:"fa-light",onClick:Ji,px:.125,py:.125,type:"reset",variant:"ghost"}):void 0,t.jsx(H,{...nr,className:"action",disabled:n,icon:Z.isOpen&&!n?"chevron-up":"chevron-down",iconColor:R.palette.gray[400],iconSize:"sm",iconType:"fa-light",px:.125,py:.125,ref:he,type:"button",variant:"ghost"})]}),Z.isOpen&&Z.collection.size>0&&!n?t.jsx(me,{className:"dropdown",offset:4,placement:"bottom start",popoverRef:Ge,state:Z,triggerRef:Ce,children:t.jsx(en,{...Ht,$multiSelection:p&&!Array.from(i??[]).includes("All"),$width:Ut,ref:ke,children:t.jsx("div",{style:{height:`${Yt.getTotalSize()}px`,position:"relative"},children:Yt.getVirtualItems().map(B=>{const q=Gt[B.index];return t.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:`${B.size}px`,transform:`translateY(${B.start}px)`},children:t.jsx(Dn,{item:q,multiSelection:p,name:d,register:k,setInputValue:O,setValue:w,state:Z,watch:D})},B.index)})})})}):g.length>0||!Z.isOpen||n||!v?null:t.jsx(me,{className:"dropdown",offset:4,placement:"bottom start",popoverRef:Ge,state:Z,triggerRef:Ce,children:t.jsx(en,{...Ht,$multiSelection:!1,$width:Ut,ref:ke,children:t.jsx(yo,{children:t.jsx(I,{color:R.palette.gray[400],size:"md",textOverflow:"auto",whiteSpace:"wrap",children:v})})})})]})},Dt=({control:e,disabled:n=!1,disabledKeys:i,error:r,helpLink:o,helpLinkText:s,helpText:l,label:a,loadingItems:c,name:d,multiSelection:p,items:g,onBlur:x,onChange:h,onClear:b,placeholder:m,clearable:j=!1,emptyMessage:v,register:k,required:S,setValue:w,tooltip:C,value:z,watch:D,weight:E})=>e?t.jsx(f.Controller,{control:e,name:d,render:({field:R,fieldState:T})=>{var F;return t.jsx(xt,{clearable:j,disabled:n,disabledKeys:i,emptyMessage:v,error:(F=T.error)==null?void 0:F.message,field:R,helpLink:o,helpLinkText:s,helpText:l,items:g,label:a,loadingItems:c,multiSelection:p,name:d,onBlur:x,onChange:h,onClear:b,placeholder:m,register:k,required:S,setValue:w,tooltip:C,value:z,watch:D,weight:E})},rules:{required:S}}):t.jsx(xt,{clearable:j,disabled:n,disabledKeys:i,emptyMessage:v,error:r,helpLink:o,helpLinkText:s,helpText:l,items:g,label:a,loadingItems:c,multiSelection:p,name:d,onBlur:x,onChange:h,onClear:b,placeholder:m,required:S,tooltip:C,value:z,weight:E}),$o=y.styled.div`
|
|
1145
1145
|
${({theme:e})=>`
|
|
1146
1146
|
align-items: center;
|
|
1147
1147
|
color: ${e.palette.gray[800]};
|
|
@@ -1373,7 +1373,7 @@
|
|
|
1373
1373
|
font-weight: ${e.typography.weight.bold};
|
|
1374
1374
|
}
|
|
1375
1375
|
`}
|
|
1376
|
-
`,Qe=({disabled:e=!1,icon:n,props:i})=>{const r=u.useRef(null),{buttonProps:o}=f.$701a24aa0da5b062$export$ea18c227d4417cc3(i,r);return t.jsx(So,{...o,$disabled:e,$focus:!!o["aria-expanded"],$header:n==="calendar"||n==="calendar-clock",disabled:e,ref:r,type:"button",children:t.jsx(N,{icon:n,iconColor:L.palette.gray[e?400:700],iconSize:"lg",iconType:"fa-light"})})},st=({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($o,{children:[r,t.jsxs(mo,{children:[t.jsx(nn,{"aria-label":"top",onClick:l,children:t.jsx(N,{icon:"caret-up",iconClass:"fa-sharp",iconSize:"xs"})}),t.jsx(nn,{"aria-label":"bottom",onClick:a,children:t.jsx(N,{icon:"caret-down",iconClass:"fa-sharp",iconSize:"xs"})})]})]}),t.jsx(Qe,{icon:"chevron-right",props:i})]})},Rn=({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(st,{nextButtonProps:s,prevButtonProps:o,state:r,title:l}),t.jsx(ot,{state:r}),t.jsx(Et,{children:t.jsx(W,{onClick:e,variant:"ghost",children:"Cancel"})})]})},Nn=({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})},Ln=({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 d=document.getElementsByClassName("segment-cell"),p=c.currentTarget;Object.values(d).some(g=>g.contains(p))||(c.preventDefault(),c.stopPropagation())},[]);return t.jsxs(zo,{...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,d)=>{const p=`key_${d}`;return t.jsx(Nn,{segment:{...c,isEditable:!e},state:s},p)})}),n?t.jsx(N,{icon:"exclamation-circle",iconColor:r.palette.error[500],iconSize:"lg"}):void 0]})},An=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(d=>{const p=d.currentTarget.name;p!==s&&(f.lodashExports.isNil(r)||(p==="AM"?i.setSegment("dayPeriod",0):p==="PM"&&i.setSegment("dayPeriod",12))),l(p)},[s,i,r]);return t.jsxs(To,{children:[t.jsx(rn,{...a,ref:n,children:i.segments.slice(0,-2).map((d,p)=>{const g=`key_${p}`;return t.jsx(Nn,{segment:d,state:i},g)})}),t.jsxs(rn,{children:[t.jsx(on,{id:s==="AM"?"active":"",name:"AM",onClick:c,type:"button",children:"AM"}),t.jsx(on,{id:s==="PM"?"active":"",name:"PM",onClick:c,type:"button",children:"PM"})]})]})},et=e=>e&&e!=="-"?f.dayjs(e).format("YYYY-MM-DD"):"-",Io=e=>e&&e!=="-"?f.dayjs(e).format("YYYY-MM-DD hh:mm A"):"-",sn=(e,n)=>f.dayjs(String(e).replace(/-/gu,"/")).hour(n.hour).minute(n.minute).second(n.second).format("YYYY/MM/DD hh:mm A"),tt=(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},Do=(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:d,required:p,setValue:g,value:x})=>{const h=tt(x,o),b=u.useCallback(j=>{if(s.onChange&&s.onChange(j),j!=null&&j.year&&String(j.year).length>=4){const v=o==="day"?et(String(j)):Io(String(j));g&&g(a,v,{shouldDirty:!0}),c&&c(v)}},[s,o,a,g,c]),m=u.useCallback(j=>{c==null||c(j.currentTarget.value)},[c]);return t.jsxs(ne,{...l,className:`${r?"disabled":""} ${e?"error":""}`,ref:i,children:[t.jsx(Ln,{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",{...d==null?void 0:d(a,{required:p}),...c?{onChange:m}:{},"aria-label":a,className:"date-input",disabled:r,id:a,name:a,type:"text",value:(x==null?void 0:x.trim())??""})]})},at=({children:e,...n})=>{const i=u.useRef(null),{dialogProps:r}=f.$40df3f8667284809$export$d55e7ee900f34e93(n,i);return t.jsx(Co,{...r,ref:i,children:e})},Pn=({disabled:e=!1,error:n,helpLink:i,helpLinkText:r,helpText:o,required:s,label:l,name:a,register:c,setValue:d,tooltip:p,watch:g,...x})=>{const h=u.useRef(null),b=g==null?void 0:g(a),m=tt(b),j=u.useCallback(E=>{d&&E&&d(a,et(String(E)),{shouldDirty:!0})},[a,d]),v=f.$ab5bf3f618090389$export$87194bb378cc3ac2({...x,onChange(E){j(E)},...m?{defaultValue:m}:{}}),{close:k}=v,{groupProps:S,fieldProps:w,buttonProps:C,dialogProps:z,calendarProps:D}=f.$6057a3d2a53a12fd$export$42df105a73306d51({...x,"aria-label":l??a,name:a},v,h);return t.jsxs(Q,{error:e?void 0:n,helpLink:i,helpLinkText:r,helpText:o,htmlFor:a,label:l,required:s,tooltip:p,children:[t.jsx(Ee,{buttonProps:C,datePickerRef:h,disabled:e,error:n,fieldProps:w,groupProps:S,name:a,register:c,required:s,setValue:d,value:b}),v.isOpen&&!e?t.jsx(
|
|
1376
|
+
`,Qe=({disabled:e=!1,icon:n,props:i})=>{const r=u.useRef(null),{buttonProps:o}=f.$701a24aa0da5b062$export$ea18c227d4417cc3(i,r);return t.jsx(So,{...o,$disabled:e,$focus:!!o["aria-expanded"],$header:n==="calendar"||n==="calendar-clock",disabled:e,ref:r,type:"button",children:t.jsx(N,{icon:n,iconColor:L.palette.gray[e?400:700],iconSize:"lg",iconType:"fa-light"})})},st=({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($o,{children:[r,t.jsxs(mo,{children:[t.jsx(nn,{"aria-label":"top",onClick:l,children:t.jsx(N,{icon:"caret-up",iconClass:"fa-sharp",iconSize:"xs"})}),t.jsx(nn,{"aria-label":"bottom",onClick:a,children:t.jsx(N,{icon:"caret-down",iconClass:"fa-sharp",iconSize:"xs"})})]})]}),t.jsx(Qe,{icon:"chevron-right",props:i})]})},Rn=({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(st,{nextButtonProps:s,prevButtonProps:o,state:r,title:l}),t.jsx(ot,{state:r}),t.jsx(Et,{children:t.jsx(W,{onClick:e,variant:"ghost",children:"Cancel"})})]})},Nn=({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})},Ln=({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 d=document.getElementsByClassName("segment-cell"),p=c.currentTarget;Object.values(d).some(g=>g.contains(p))||(c.preventDefault(),c.stopPropagation())},[]);return t.jsxs(zo,{...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,d)=>{const p=`key_${d}`;return t.jsx(Nn,{segment:{...c,isEditable:!e},state:s},p)})}),n?t.jsx(N,{icon:"exclamation-circle",iconColor:r.palette.error[500],iconSize:"lg"}):void 0]})},An=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(d=>{const p=d.currentTarget.name;p!==s&&(f.lodashExports.isNil(r)||(p==="AM"?i.setSegment("dayPeriod",0):p==="PM"&&i.setSegment("dayPeriod",12))),l(p)},[s,i,r]);return t.jsxs(To,{children:[t.jsx(rn,{...a,ref:n,children:i.segments.slice(0,-2).map((d,p)=>{const g=`key_${p}`;return t.jsx(Nn,{segment:d,state:i},g)})}),t.jsxs(rn,{children:[t.jsx(on,{id:s==="AM"?"active":"",name:"AM",onClick:c,type:"button",children:"AM"}),t.jsx(on,{id:s==="PM"?"active":"",name:"PM",onClick:c,type:"button",children:"PM"})]})]})},et=e=>e&&e!=="-"?f.dayjs(e).format("YYYY-MM-DD"):"-",Io=e=>e&&e!=="-"?f.dayjs(e).format("YYYY-MM-DD hh:mm A"):"-",sn=(e,n)=>f.dayjs(String(e).replace(/-/gu,"/")).hour(n.hour).minute(n.minute).second(n.second).format("YYYY/MM/DD hh:mm A"),tt=(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},Do=(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:d,required:p,setValue:g,value:x})=>{const h=tt(x,o),b=u.useCallback(j=>{if(s.onChange&&s.onChange(j),j!=null&&j.year&&String(j.year).length>=4){const v=o==="day"?et(String(j)):Io(String(j));g&&g(a,v,{shouldDirty:!0}),c&&c(v)}},[s,o,a,g,c]),m=u.useCallback(j=>{c==null||c(j.currentTarget.value)},[c]);return t.jsxs(ne,{...l,className:`${r?"disabled":""} ${e?"error":""}`,ref:i,children:[t.jsx(Ln,{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",{...d==null?void 0:d(a,{required:p}),...c?{onChange:m}:{},"aria-label":a,className:"date-input",disabled:r,id:a,name:a,type:"text",value:(x==null?void 0:x.trim())??""})]})},at=({children:e,...n})=>{const i=u.useRef(null),{dialogProps:r}=f.$40df3f8667284809$export$d55e7ee900f34e93(n,i);return t.jsx(Co,{...r,ref:i,children:e})},Pn=({disabled:e=!1,error:n,helpLink:i,helpLinkText:r,helpText:o,required:s,label:l,name:a,register:c,setValue:d,tooltip:p,watch:g,...x})=>{const h=u.useRef(null),b=g==null?void 0:g(a),m=tt(b),j=u.useCallback(E=>{d&&E&&d(a,et(String(E)),{shouldDirty:!0})},[a,d]),v=f.$ab5bf3f618090389$export$87194bb378cc3ac2({...x,onChange(E){j(E)},...m?{defaultValue:m}:{}}),{close:k}=v,{groupProps:S,fieldProps:w,buttonProps:C,dialogProps:z,calendarProps:D}=f.$6057a3d2a53a12fd$export$42df105a73306d51({...x,"aria-label":l??a,name:a},v,h);return t.jsxs(Q,{error:e?void 0:n,helpLink:i,helpLinkText:r,helpText:o,htmlFor:a,label:l,required:s,tooltip:p,children:[t.jsx(Ee,{buttonProps:C,datePickerRef:h,disabled:e,error:n,fieldProps:w,groupProps:S,name:a,register:c,required:s,setValue:d,value:b}),v.isOpen&&!e?t.jsx(me,{offset:8,placement:"bottom start",state:v,triggerRef:h,children:t.jsx(at,{...z,children:t.jsx(Rn,{onClose:k,props:D})})}):null]})},On=({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(st,{nextButtonProps:l,prevButtonProps:s,state:o,title:a}),t.jsx(ot,{state:o}),t.jsx(Et,{children:t.jsx(W,{onClick:e,variant:"ghost",children:"Cancel"})})]})},Eo=y.styled.div`
|
|
1377
1377
|
${({theme:e,$disabled:n,$show:i})=>`
|
|
1378
1378
|
border-color: ${i?e.palette.error[500]:e.palette.gray[300]};
|
|
1379
1379
|
display: flex;
|
|
@@ -1384,7 +1384,7 @@
|
|
|
1384
1384
|
background: ${n?e.palette.gray[200]:e.palette.white};
|
|
1385
1385
|
}
|
|
1386
1386
|
`}
|
|
1387
|
-
`,Ft=({disabled:e=!1,error:n,label:i,name:r,required:o,tooltip:s,onOpenCalendar:l,register:a,setValue:c,propsMax:d,propsMin:p,variant:g="default",...x})=>{const h=`${r}Max`,b=`${r}Min`,m=u.useRef(null),j=tt(p==null?void 0:p.value),v=tt(d==null?void 0:d.value),k=u.useCallback(F=>{if(F){const A=et(String(F.end)),O=et(String(F.start));c&&(c((d==null?void 0:d.name)??h,A),c((p==null?void 0:p.name)??b,O)),d!=null&&d.onChange&&(d==null||d.onChange(A)),p!=null&&p.onChange&&(p==null||p.onChange(O))}},[h,b,c,d,p]),S=f.$93c38a5e28be6249$export$e50a61c1de9f574({...x,endName:(d==null?void 0:d.name)??h,startName:(p==null?void 0:p.name)??b,onChange(F){k(F)},...v&&j&&!c?{value:{start:j,end:v}}:d!=null&&d.onChange||p!=null&&p.onChange?{value:null}:{}}),{close:w}=S,{groupProps:C,startFieldProps:z,endFieldProps:D,buttonProps:E,dialogProps:R,calendarProps:T}=f.$887cac91b7cc8801$export$12fd5f0e9f4bb192({...x,"aria-label":i??r},S,m);return u.useEffect(()=>{l&&l(S.isOpen)},[l,S.isOpen]),t.jsxs(Q,{error:e?void 0:n,htmlFor:r,label:i,required:o,tooltip:s,children:[t.jsxs(Eo,{$disabled:e,$show:n!==void 0,ref:m,style:{flexDirection:g==="filters"?"column":"row"},children:[t.jsx(Ee,{buttonProps:E,datePickerRef:m,disabled:e,error:n,fieldProps:{...z,"aria-label":`${z["aria-label"]} ${r}`,validate:F=>D.value&&F>D.value?"Start date must be less than or equal to end date":null},groupProps:C,name:(p==null?void 0:p.name)??b,onChange:p==null?void 0:p.onChange,register:a,setValue:c,value:p==null?void 0:p.value}),t.jsx(Ee,{buttonProps:E,datePickerRef:m,disabled:e,error:n,fieldProps:{...D,"aria-label":`${D["aria-label"]} ${r}`,validate:F=>z.value&&F<z.value?"End date must be greater than or equal to start date":null},groupProps:C,name:(d==null?void 0:d.name)??h,onChange:d==null?void 0:d.onChange,register:a,setValue:c,value:d==null?void 0:d.value})]}),S.isOpen&&!e?t.jsx(
|
|
1387
|
+
`,Ft=({disabled:e=!1,error:n,label:i,name:r,required:o,tooltip:s,onOpenCalendar:l,register:a,setValue:c,propsMax:d,propsMin:p,variant:g="default",...x})=>{const h=`${r}Max`,b=`${r}Min`,m=u.useRef(null),j=tt(p==null?void 0:p.value),v=tt(d==null?void 0:d.value),k=u.useCallback(F=>{if(F){const A=et(String(F.end)),O=et(String(F.start));c&&(c((d==null?void 0:d.name)??h,A),c((p==null?void 0:p.name)??b,O)),d!=null&&d.onChange&&(d==null||d.onChange(A)),p!=null&&p.onChange&&(p==null||p.onChange(O))}},[h,b,c,d,p]),S=f.$93c38a5e28be6249$export$e50a61c1de9f574({...x,endName:(d==null?void 0:d.name)??h,startName:(p==null?void 0:p.name)??b,onChange(F){k(F)},...v&&j&&!c?{value:{start:j,end:v}}:d!=null&&d.onChange||p!=null&&p.onChange?{value:null}:{}}),{close:w}=S,{groupProps:C,startFieldProps:z,endFieldProps:D,buttonProps:E,dialogProps:R,calendarProps:T}=f.$887cac91b7cc8801$export$12fd5f0e9f4bb192({...x,"aria-label":i??r},S,m);return u.useEffect(()=>{l&&l(S.isOpen)},[l,S.isOpen]),t.jsxs(Q,{error:e?void 0:n,htmlFor:r,label:i,required:o,tooltip:s,children:[t.jsxs(Eo,{$disabled:e,$show:n!==void 0,ref:m,style:{flexDirection:g==="filters"?"column":"row"},children:[t.jsx(Ee,{buttonProps:E,datePickerRef:m,disabled:e,error:n,fieldProps:{...z,"aria-label":`${z["aria-label"]} ${r}`,validate:F=>D.value&&F>D.value?"Start date must be less than or equal to end date":null},groupProps:C,name:(p==null?void 0:p.name)??b,onChange:p==null?void 0:p.onChange,register:a,setValue:c,value:p==null?void 0:p.value}),t.jsx(Ee,{buttonProps:E,datePickerRef:m,disabled:e,error:n,fieldProps:{...D,"aria-label":`${D["aria-label"]} ${r}`,validate:F=>z.value&&F<z.value?"End date must be greater than or equal to start date":null},groupProps:C,name:(d==null?void 0:d.name)??h,onChange:d==null?void 0:d.onChange,register:a,setValue:c,value:d==null?void 0:d.value})]}),S.isOpen&&!e?t.jsx(me,{offset:8,placement:"bottom start",state:S,triggerRef:m,children:t.jsx(at,{...R,children:t.jsx(On,{onClose:w,props:T})})}):null]})},Fo=y.styled.div`
|
|
1388
1388
|
${({theme:e})=>`
|
|
1389
1389
|
align-items: center;
|
|
1390
1390
|
border-top: 1px solid ${e.palette.gray[200]};
|
|
@@ -1399,7 +1399,7 @@
|
|
|
1399
1399
|
gap: ${({theme:e})=>e.spacing[.5]};
|
|
1400
1400
|
justify-content: flex-end;
|
|
1401
1401
|
flex: 1 0 0;
|
|
1402
|
-
`,Bn=({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:d}=f.$9942cad8a072a530$export$3ee915f8151bd4f1(i,l);return t.jsxs("div",{className:"calendar",children:[t.jsx(st,{nextButtonProps:c,prevButtonProps:a,state:l,title:d}),t.jsx(ot,{state:l}),t.jsxs(Fo,{children:[t.jsx(I,{color:o.palette.gray[800],fontWeight:"bold",size:"md",children:"Time"}),t.jsx(Ro,{children:t.jsx(An,{hourCycle:12,label:"time-field",onChange:e,value:r.timeValue})})]}),t.jsx(Et,{children:t.jsx(W,{onClick:n,variant:"ghost",children:"Cancel"})})]})},No=e=>{const{disabled:n=!1,error:i,required:r,label:o,name:s,tooltip:l,register:a,setValue:c,watch:d}=e,p=d==null?void 0:d(s),g=u.useRef(null),x=f.$ab5bf3f618090389$export$87194bb378cc3ac2({...e,granularity:"minute",hourCycle:12,isDisabled:n,isRequired:r,shouldCloseOnSelect:!1,value:f._.isNil(p)||f._.isEmpty(p)||p==="-"||f.dayjs(p,"YYYY/MM/DD hh:mm A").isValid()===!1?null:f.$fae977aafc393c5c$export$588937bcd60ade55(f.dayjs(p,"YYYY/MM/DD hh:mm A").format("YYYY-MM-DDTHH:mm:ss"))}),{close:h}=x,{groupProps:b,fieldProps:m,buttonProps:j,dialogProps:v,calendarProps:k}=f.$6057a3d2a53a12fd$export$42df105a73306d51(e,x,g),S=u.useCallback(C=>{if(k.onChange&&k.onChange(C),x.timeValue){const z=sn(C,x.timeValue);c==null||c(s,z,{shouldDirty:!0})}else x.setDateValue(C)},[k,s,c,x]),w=u.useCallback(C=>{if(C){x.setTimeValue(C);const z=x.dateValue;if(z){const D=sn(z,C);c==null||c(s,D,{shouldDirty:!0})}}},[x,c,s]);return t.jsxs(Q,{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:p}),x.isOpen&&!n?t.jsx(
|
|
1402
|
+
`,Bn=({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:d}=f.$9942cad8a072a530$export$3ee915f8151bd4f1(i,l);return t.jsxs("div",{className:"calendar",children:[t.jsx(st,{nextButtonProps:c,prevButtonProps:a,state:l,title:d}),t.jsx(ot,{state:l}),t.jsxs(Fo,{children:[t.jsx(I,{color:o.palette.gray[800],fontWeight:"bold",size:"md",children:"Time"}),t.jsx(Ro,{children:t.jsx(An,{hourCycle:12,label:"time-field",onChange:e,value:r.timeValue})})]}),t.jsx(Et,{children:t.jsx(W,{onClick:n,variant:"ghost",children:"Cancel"})})]})},No=e=>{const{disabled:n=!1,error:i,required:r,label:o,name:s,tooltip:l,register:a,setValue:c,watch:d}=e,p=d==null?void 0:d(s),g=u.useRef(null),x=f.$ab5bf3f618090389$export$87194bb378cc3ac2({...e,granularity:"minute",hourCycle:12,isDisabled:n,isRequired:r,shouldCloseOnSelect:!1,value:f._.isNil(p)||f._.isEmpty(p)||p==="-"||f.dayjs(p,"YYYY/MM/DD hh:mm A").isValid()===!1?null:f.$fae977aafc393c5c$export$588937bcd60ade55(f.dayjs(p,"YYYY/MM/DD hh:mm A").format("YYYY-MM-DDTHH:mm:ss"))}),{close:h}=x,{groupProps:b,fieldProps:m,buttonProps:j,dialogProps:v,calendarProps:k}=f.$6057a3d2a53a12fd$export$42df105a73306d51(e,x,g),S=u.useCallback(C=>{if(k.onChange&&k.onChange(C),x.timeValue){const z=sn(C,x.timeValue);c==null||c(s,z,{shouldDirty:!0})}else x.setDateValue(C)},[k,s,c,x]),w=u.useCallback(C=>{if(C){x.setTimeValue(C);const z=x.dateValue;if(z){const D=sn(z,C);c==null||c(s,D,{shouldDirty:!0})}}},[x,c,s]);return t.jsxs(Q,{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:p}),x.isOpen&&!n?t.jsx(me,{offset:8,placement:"bottom start",state:x,triggerRef:g,children:t.jsx(at,{...v,children:t.jsx(Bn,{handleTimeChange:w,onClose:h,props:{...k,onChange:S},timeState:x})})}):null]})},Lo=({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(It,{htmlFor:s,label:o,tooltip:l,weight:"bold"}),c.startsWith("https://")?t.jsx(ce,{href:c,children:a}):t.jsx(I,{size:"md",children:a})]})},_e=({disabled:e=!1,hasIcon:n=!1,helpLink:i,helpLinkText:r,helpText:o,error:s,id:l,indexArray:a=0,isValid:c,isTouched:d,label:p,name:g,maskValue:x=!1,onPaste:h,placeholder:b,removeItemArray:m,register:j,suggestions:v,tooltip:k,type:S="text",weight:w,...C})=>{const{required:z,onBlur:D,onChange:E}=C,R=y.useTheme(),T=e?void 0:s,[F,A]=u.useState(""),O=u.useCallback(G=>{A(G.target.value),E==null||E(G)},[E]),M=c&&d&&!e&&F.trim()!=="",U=u.useCallback(G=>{G.key==="Enter"&&G.preventDefault()},[]);return t.jsxs(Q,{error:T,helpLink:i,helpLinkText:r,helpText:o,htmlFor:g,label:p,required:z,tooltip:k,weight:w,children:[t.jsxs(ne,{className:`
|
|
1403
1403
|
${e?"disabled":""} ${T?"error":""} ${M?"success":""}
|
|
1404
1404
|
`,children:[n?t.jsx(N,{icon:"user",iconSize:"xl",iconType:"fa-light"}):void 0,t.jsx("input",{"aria-hidden":!1,"aria-invalid":T?"true":"false","aria-label":g,"aria-required":z,autoComplete:"off",className:x?"sr-block":"","data-testid":`${g}-input`,disabled:e,id:g,list:v?`list_${g}`:void 0,onKeyDown:U,onPaste:h,placeholder:b,type:S,...j?j(g,{required:z,onBlur:D,onChange:O}):{...C,onChange:O}}),T?t.jsx(N,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:R.palette.error[500],iconSize:"lg"}):void 0,M?t.jsx(N,{icon:"check-circle",iconClass:"success-icon",iconColor:R.palette.success[500],iconSize:"lg"}):void 0,l==="array"&&a>0?t.jsx(H,{color:R.palette.gray[400],icon:"trash",iconSize:"sm",iconType:"fa-light",onClick:m?m(a):void 0,variant:"ghost"}):void 0]}),v?t.jsx("datalist",{id:`list_${g}`,children:v.map(G=>t.jsx("option",{value:G},G))}):void 0]})},Ao=y.styled.div.attrs({className:"flex flex-wrap justify-center pv3 w-100"})``,Po=y.styled.div.attrs({className:"flex flex-wrap items-center justify-start mb2"})`
|
|
1405
1405
|
gap: 12px;
|
|
@@ -1664,7 +1664,7 @@
|
|
|
1664
1664
|
border-start-end-radius: ${i&&n<100?"0":"inherit"};
|
|
1665
1665
|
background-color: ${r==="compliance"?Jo(e,n):"inherit"};
|
|
1666
1666
|
`}
|
|
1667
|
-
`,Rt=({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,d=t.jsx(Qo,{$minWidth:e,$orientation:o,$rounded:s,$variant:l,className:o,children:t.jsx(es,{$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:[d,c]})},ts=e=>e.split(",").map(n=>n.trim().toLowerCase()),ns=(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)},Mn=({disabled:e=!1,handleButtonClick:n,errorMsg:i,fileName:r,handleRemoveFile:o,resetField:s,name:l,theme:a,accept:c,value:d,viewMode:p,progressPercentage:g,canReplaceInViewMode:x,multiple:h,maxSize:b,setIsReading:m,inputRef:j})=>{const v=u.useRef(null);function k(F){o(F),s==null||s(l??"")}const{dropProps:S,isDropTarget:w}=f.$5c06e4929e123553$export$ccdee5eaf73cf661({ref:v,async onDrop(F){m==null||m(!0);try{const A=F.items.filter(X=>X.kind==="file"),O=await Promise.all(A.map(async X=>X.getFile())),M=c?O.filter(X=>ns(X,ts(c))):O;c&&M.length<O.length&&console.warn("InputFile: Some files were rejected due to invalid type.");const U=new DataTransfer;(h?M:[M[0]]).forEach(X=>U.items.add(X));const G=U.files;if(j!=null&&j.current){j.current.files=G;const X=new Event("change",{bubbles:!0});j.current.dispatchEvent(X)}}catch(A){console.error("Error reading dropped files:",A)}}}),C=t.jsx(H,{color:a.palette.gray[700],height:"20px",icon:"xmark",iconSize:"64px",iconType:"fa-light",onClick:o,variant:"ghost",width:"20px"}),z=i?t.jsx(N,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:a.palette.error[500],iconSize:"lg"}):g||p?void 0:t.jsx(N,{icon:"circle-check",iconClass:"success-icon",iconColor:a.palette.success[500],iconSize:"lg"}),D=!i&&r?t.jsxs(I,{color:a.palette.gray[400],size:"md",children:[Array.from(d).map(F=>an(F.size)).join(", "),g?` • ${g}% uploaded`:void 0]}):t.jsx(J,{priority:"low",tagLabel:"Error uploading",variant:"error"}),E=t.jsx(ct,{$variant:"highRelevance",disabled:e,onClick:n,children:"click to browse"}),R=t.jsx(ct,{$variant:"lowRelevance",disabled:e,onClick:k,children:"Try again"}),T=x?t.jsx(ct,{$variant:"lowRelevance",disabled:e,onClick:n,children:"Replace file"}):void 0;return t.jsxs(u.Fragment,{children:[!r&&t.jsxs(Uo,{...S,className:`${e?"disabled":""} ${i?"error":""} ${w?"target":""} dropzone`,onClick:e?void 0:n,children:[r,t.jsx(N,{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 ",E]})}),t.jsxs(I,{color:a.palette.gray[400],size:"sm",textAlign:"center",children:[`${qo(c)}`,b?` (max. ${an(b)} total limit)`:void 0]})]}),r&&t.jsxs(Go,{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:[z,t.jsx(I,{color:a.palette.gray[700],fontWeight:"bold",size:"md",children:r})]}),t.jsx("div",{children:D})]}),i?R:f.lodashExports.isEmpty(r)?void 0:p?T:C]}),g?t.jsx(Rt,{minWidth:"full",percentage:g}):void 0]})]})},is=({accept:e,disabled:n=!1,error:i,label:r,helpLink:o,helpText:s,id:l,multiple:a,name:c,onChange:d,required:p,register:g,setValue:x,resetField:h,tooltip:b,watch:m,weight:j,variant:v="default",viewMode:k,canReplaceInViewMode:S,progressPercentage:w,maxSize:C})=>{const z=y.useTheme(),D=n?void 0:i,E=u.useRef(null),R=g==null?void 0:g(c,{required:p}),T=m==null?void 0:m(c),F=Zo(T),[A,O]=u.useState(!1),[M,U]=u.useState(w);u.useEffect(()=>{U(!w&&A?50:!w&&!A?void 0:w)},[A,w]);const G=u.useCallback(V=>{V.stopPropagation();const _=Fe("change",c,null);x&&x(c,void 0),R&&R.onChange(_)},[R,c,x]),X=u.useCallback(async V=>{O(!0);try{const{files:_}=V.currentTarget,ie=Fe("change",c,_&&_.length>0?_:null);_&&_.length>0&&(d==null||d(ie),x&&x(c,_),R&&R.onChange(ie),await new Promise(
|
|
1667
|
+
`,Rt=({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,d=t.jsx(Qo,{$minWidth:e,$orientation:o,$rounded:s,$variant:l,className:o,children:t.jsx(es,{$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:[d,c]})},ts=e=>e.split(",").map(n=>n.trim().toLowerCase()),ns=(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)},Mn=({disabled:e=!1,handleButtonClick:n,errorMsg:i,fileName:r,handleRemoveFile:o,resetField:s,name:l,theme:a,accept:c,value:d,viewMode:p,progressPercentage:g,canReplaceInViewMode:x,multiple:h,maxSize:b,setIsReading:m,inputRef:j})=>{const v=u.useRef(null);function k(F){o(F),s==null||s(l??"")}const{dropProps:S,isDropTarget:w}=f.$5c06e4929e123553$export$ccdee5eaf73cf661({ref:v,async onDrop(F){m==null||m(!0);try{const A=F.items.filter(X=>X.kind==="file"),O=await Promise.all(A.map(async X=>X.getFile())),M=c?O.filter(X=>ns(X,ts(c))):O;c&&M.length<O.length&&console.warn("InputFile: Some files were rejected due to invalid type.");const U=new DataTransfer;(h?M:[M[0]]).forEach(X=>U.items.add(X));const G=U.files;if(j!=null&&j.current){j.current.files=G;const X=new Event("change",{bubbles:!0});j.current.dispatchEvent(X)}}catch(A){console.error("Error reading dropped files:",A)}}}),C=t.jsx(H,{color:a.palette.gray[700],height:"20px",icon:"xmark",iconSize:"64px",iconType:"fa-light",onClick:o,variant:"ghost",width:"20px"}),z=i?t.jsx(N,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:a.palette.error[500],iconSize:"lg"}):g||p?void 0:t.jsx(N,{icon:"circle-check",iconClass:"success-icon",iconColor:a.palette.success[500],iconSize:"lg"}),D=!i&&r?t.jsxs(I,{color:a.palette.gray[400],size:"md",children:[Array.from(d).map(F=>an(F.size)).join(", "),g?` • ${g}% uploaded`:void 0]}):t.jsx(J,{priority:"low",tagLabel:"Error uploading",variant:"error"}),E=t.jsx(ct,{$variant:"highRelevance",disabled:e,onClick:n,type:"button",children:"click to browse"}),R=t.jsx(ct,{$variant:"lowRelevance",disabled:e,onClick:k,type:"button",children:"Try again"}),T=x?t.jsx(ct,{$variant:"lowRelevance",disabled:e,onClick:n,type:"button",children:"Replace file"}):void 0;return t.jsxs(u.Fragment,{children:[!r&&t.jsxs(Uo,{...S,className:`${e?"disabled":""} ${i?"error":""} ${w?"target":""} dropzone`,onClick:e?void 0:n,children:[r,t.jsx(N,{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 ",E]})}),t.jsxs(I,{color:a.palette.gray[400],size:"sm",textAlign:"center",children:[`${qo(c)}`,b?` (max. ${an(b)} total limit)`:void 0]})]}),r&&t.jsxs(Go,{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:[z,t.jsx(I,{color:a.palette.gray[700],fontWeight:"bold",size:"md",children:r})]}),t.jsx("div",{children:D})]}),i?R:f.lodashExports.isEmpty(r)?void 0:p?T:C]}),g?t.jsx(Rt,{minWidth:"full",percentage:g}):void 0]})]})},is=({accept:e,disabled:n=!1,error:i,label:r,helpLink:o,helpText:s,id:l,multiple:a,name:c,onChange:d,required:p,register:g,setValue:x,resetField:h,tooltip:b,watch:m,weight:j,variant:v="default",viewMode:k,canReplaceInViewMode:S,progressPercentage:w,maxSize:C})=>{const z=y.useTheme(),D=n?void 0:i,E=u.useRef(null),R=g==null?void 0:g(c,{required:p}),T=m==null?void 0:m(c),F=Zo(T),[A,O]=u.useState(!1),[M,U]=u.useState(w);u.useEffect(()=>{U(!w&&A?50:!w&&!A?void 0:w)},[A,w]);const G=u.useCallback(V=>{V.stopPropagation();const _=Fe("change",c,null);x&&x(c,void 0),R&&R.onChange(_)},[R,c,x]),X=u.useCallback(async V=>{O(!0);try{const{files:_}=V.currentTarget,ie=Fe("change",c,_&&_.length>0?_:null);_&&_.length>0&&(d==null||d(ie),x&&x(c,_),R&&R.onChange(ie),await new Promise(he=>setTimeout(he,100)))}catch(_){console.error("Error handling file change:",_)}finally{O(!1)}},[R,c,d,x]),xe=u.useCallback(V=>{V.stopPropagation(),n?V.preventDefault():E.current&&E.current.click()},[n]);return t.jsxs(Q,{error:D,helpLink:o,helpText:s,htmlFor:l??c,label:r,required:p,tooltip:b,weight:j,children:[v==="default"&&t.jsx(Vn,{disabled:n,errorMsg:D,fileName:F,handleButtonClick:xe,handleRemoveFile:G,theme:z}),v==="dropzone"&&t.jsx(Mn,{accept:e,canReplaceInViewMode:S,disabled:n,errorMsg:D,fileName:F,handleButtonClick:xe,handleRemoveFile:G,inputRef:E,maxSize:C,multiple:a,name:c,progressPercentage:M,resetField:h,setIsReading:O,theme:z,value:T,viewMode:k}),t.jsx(Yo,{...R,accept:e,"aria-label":c,"data-testid":c,disabled:n,id:l??c,multiple:a,name:c,onChange:X,ref:E,type:"file"})]})},rs=({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(N,{icon:n,iconSize:"md",iconType:"fa-light"}),t.jsx(Y,{fontWeight:"bold",size:"xs",children:e}),r&&t.jsx($,{display:"flex",flexDirection:"row",mb:.25,children:r})]}),t.jsx($,{children:i})]}),os=y.styled.input`
|
|
1668
1668
|
border: none;
|
|
1669
1669
|
background: transparent;
|
|
1670
1670
|
min-width: 15rem;
|
|
@@ -1770,9 +1770,9 @@
|
|
|
1770
1770
|
overflow: hidden;
|
|
1771
1771
|
text-overflow: ellipsis;
|
|
1772
1772
|
white-space: nowrap;
|
|
1773
|
-
`,gs=({disabled:e,error:n,label:i,name:r,placeholder:o,required:s,register:l,tooltip:a,value:c,watch:d,weight:p})=>{const g=y.useTheme(),x=u.useRef(null),h=e?void 0:n,b=(d==null?void 0:d(r))??c,[m,j]=u.useState(!1),[v,k]=u.useState(""),[S,w]=u.useState(!1),{refs:C,floatingStyles:z}=f.useFloating$1({placement:"bottom-start",whileElementsMounted:f.autoUpdate}),{inputRef:D,inputValue:E,handlePhoneValueChange:R,country:T,setCountry:F}=f.ee({countries:f._$1,defaultCountry:"co",forceDialCode:!0,value:b?String(b):""}),A=u.useCallback(V=>{V.key==="Enter"&&V.preventDefault()},[]),O=u.useCallback(V=>{V.preventDefault(),j(_=>!_),m||k("")},[m]),M=u.useCallback(V=>()=>{F(V),j(!1),k("")},[F,j]),U=u.useCallback(V=>{V.key.length===1?k(_=>_+V.key):V.key==="Backspace"&&k(_=>_.slice(0,-1))},[]),G=u.useCallback(()=>{w(!0)},[]),X=u.useCallback(()=>{w(!1)},[]),
|
|
1773
|
+
`,gs=({disabled:e,error:n,label:i,name:r,placeholder:o,required:s,register:l,tooltip:a,value:c,watch:d,weight:p})=>{const g=y.useTheme(),x=u.useRef(null),h=e?void 0:n,b=(d==null?void 0:d(r))??c,[m,j]=u.useState(!1),[v,k]=u.useState(""),[S,w]=u.useState(!1),{refs:C,floatingStyles:z}=f.useFloating$1({placement:"bottom-start",whileElementsMounted:f.autoUpdate}),{inputRef:D,inputValue:E,handlePhoneValueChange:R,country:T,setCountry:F}=f.ee({countries:f._$1,defaultCountry:"co",forceDialCode:!0,value:b?String(b):""}),A=u.useCallback(V=>{V.key==="Enter"&&V.preventDefault()},[]),O=u.useCallback(V=>{V.preventDefault(),j(_=>!_),m||k("")},[m]),M=u.useCallback(V=>()=>{F(V),j(!1),k("")},[F,j]),U=u.useCallback(V=>{V.key.length===1?k(_=>_+V.key):V.key==="Backspace"&&k(_=>_.slice(0,-1))},[]),G=u.useCallback(()=>{w(!0)},[]),X=u.useCallback(()=>{w(!1)},[]),xe=f._$1.filter(V=>{const{name:_}=f.M(V);return _.toLowerCase().includes(v.toLowerCase())});return oe(C.floating.current,()=>{j(!1),k("")},!0),t.jsx(Q,{error:h,htmlFor:r,label:i,required:s,tooltip:a,weight:p,children:t.jsxs(as,{className:`${e?"disabled":""} ${h?"error":""} ${S||m?"button-focused":""}`,ref:x,children:[t.jsxs(ls,{"aria-label":"country-selector","data-testid":"country-selector",disabled:e,id:"country-selector",onBlur:X,onClick:O,onFocus:G,onKeyDown:U,ref:C.setReference,children:[t.jsx(f.q,{iso2:T.iso2,size:"16px"}),t.jsx(N,{icon:"angle-down",iconColor:g.palette.gray[400],iconSize:"lg",iconType:"fa-light"})]}),t.jsxs(ne,{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:A,placeholder:o,ref:D,type:"tel",value:E,...l==null?void 0:l(r,{required:s,onChange:R})}),h?t.jsx(N,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:g.palette.error[500],iconSize:"lg"}):void 0]}),m&&we.createPortal(t.jsx(cs,{ref:C.setFloating,style:z,children:xe.map(V=>{const{dialCode:_,iso2:ie,name:he}=f.M(V);return t.jsxs(ds,{onClick:M(ie),value:ie,children:[t.jsx(f.q,{iso2:ie,size:"16px"}),t.jsx(ps,{children:he}),t.jsx(I,{color:g.palette.gray[400],size:"md",textAlign:"end",children:"+"+_})]},ie)})}),document.getElementById("modal-wrapper")??document.getElementById("root")??document.body)]})})},us=({disabled:e=!1,error:n,helpLink:i,helpLinkText:r,helpText:o,isTouched:s,isValid:l,label:a,name:c="input-text",id:d,maskValue:p=!1,maxLength:g,onBlur:x,placeholder:h,register:b,required:m,rows:j,tooltip:v,watch:k,weight:S,value:w})=>{const C=y.useTheme(),z=(k==null?void 0:k(c))??w,D=l&&s&&!e,E=e?void 0:n;return t.jsx(Q,{disabled:e,error:E,helpLink:i,helpLinkText:r,helpText:o,htmlFor:c,label:a,maxLength:g,required:m,tooltip:v,value:z?String(z):void 0,weight:S,children:t.jsxs(ne,{className:`
|
|
1774
1774
|
${e?"disabled":""} ${E?"error":""} ${D?"success":""}
|
|
1775
|
-
`,children:[t.jsx("textarea",{"aria-hidden":!1,"aria-invalid":E?"true":"false","aria-label":c,"aria-required":m,className:p?"sr-block":"","data-testid":`${c}-text-area`,disabled:e,id:d??c,maxLength:g,placeholder:h,rows:j,value:z,...b==null?void 0:b(c,{required:m,onBlur:x})}),E?t.jsx(N,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:C.palette.error[500],iconSize:"lg"}):void 0,D?t.jsx(N,{icon:"check-circle",iconClass:"success-icon",iconColor:C.palette.success[500],iconSize:"lg"}):void 0]})})},xs=({control:e,description:n,disabled:i,id:r,items:o,align:s,inputType:l="text",inputNumberProps:a,minHeight:c,minWidth:d,name:p,placeholder:g,textAlign:x,tooltip:h,title:b,value:m,isTouched:j,isValid:v,error:k,onChange:S,register:w,setValue:C,watch:z})=>{const D=u.useMemo(()=>{if(l==="text")return t.jsx(_e,{disabled:i,error:k,isTouched:j,isValid:v,name:p,placeholder:g,register:w});if(l==="date")return t.jsx(Pn,{disabled:i,error:k,name:p,register:w,setValue:C,watch:z});if(l==="select"&&o)return t.jsx(Dt,{control:e,disabled:i,items:o,name:p,placeholder:g,value:m});const{decimalPlaces:E,max:R,min:T}=a??{};return t.jsx(_n,{decimalPlaces:E,disabled:i,error:k,max:R,min:T,name:p,onChange:S,placeholder:g,register:w,setValue:C,value:m,watch:z})},[e,i,k,a,l,j,v,o,p,S,g,w,C,m,z]);return t.jsxs(go,{$align:s,$minHeight:c,$minWidth:d,children:[t.jsx(rt,{description:n,id:r,textAlign:x,title:b,tooltip:h}),D]})},Hn=({options:e,title:n,checkboxesName:i,defaultBgColor:r,defaultCollapsed:o,onChange:s})=>{const l=y.useTheme(),[a,c]=u.useState(o??!1),d=u.useCallback(()=>{c(p=>!p)},[]);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:d,children:[t.jsx(I,{color:l.palette.gray[800],fontWeight:"bold",size:"md",children:n}),t.jsx(N,{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(p=>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(
|
|
1775
|
+
`,children:[t.jsx("textarea",{"aria-hidden":!1,"aria-invalid":E?"true":"false","aria-label":c,"aria-required":m,className:p?"sr-block":"","data-testid":`${c}-text-area`,disabled:e,id:d??c,maxLength:g,placeholder:h,rows:j,value:z,...b==null?void 0:b(c,{required:m,onBlur:x})}),E?t.jsx(N,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:C.palette.error[500],iconSize:"lg"}):void 0,D?t.jsx(N,{icon:"check-circle",iconClass:"success-icon",iconColor:C.palette.success[500],iconSize:"lg"}):void 0]})})},xs=({control:e,description:n,disabled:i,id:r,items:o,align:s,inputType:l="text",inputNumberProps:a,minHeight:c,minWidth:d,name:p,placeholder:g,textAlign:x,tooltip:h,title:b,value:m,isTouched:j,isValid:v,error:k,onChange:S,register:w,setValue:C,watch:z})=>{const D=u.useMemo(()=>{if(l==="text")return t.jsx(_e,{disabled:i,error:k,isTouched:j,isValid:v,name:p,placeholder:g,register:w});if(l==="date")return t.jsx(Pn,{disabled:i,error:k,name:p,register:w,setValue:C,watch:z});if(l==="select"&&o)return t.jsx(Dt,{control:e,disabled:i,items:o,name:p,placeholder:g,value:m});const{decimalPlaces:E,max:R,min:T}=a??{};return t.jsx(_n,{decimalPlaces:E,disabled:i,error:k,max:R,min:T,name:p,onChange:S,placeholder:g,register:w,setValue:C,value:m,watch:z})},[e,i,k,a,l,j,v,o,p,S,g,w,C,m,z]);return t.jsxs(go,{$align:s,$minHeight:c,$minWidth:d,children:[t.jsx(rt,{description:n,id:r,textAlign:x,title:b,tooltip:h}),D]})},Hn=({options:e,title:n,checkboxesName:i,defaultBgColor:r,defaultCollapsed:o,onChange:s})=>{const l=y.useTheme(),[a,c]=u.useState(o??!1),d=u.useCallback(()=>{c(p=>!p)},[]);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:d,children:[t.jsx(I,{color:l.palette.gray[800],fontWeight:"bold",size:"md",children:n}),t.jsx(N,{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(p=>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(ge,{checked:p.visible,disabled:p.locked,label:p.name,name:`${i}-${p.name}`,onChange:s,value:p.name})},p.name))}):void 0]})},hs=y.styled.div`
|
|
1776
1776
|
display: flex;
|
|
1777
1777
|
align-self: flex-start;
|
|
1778
1778
|
margin-left: auto;
|
|
@@ -1869,7 +1869,7 @@
|
|
|
1869
1869
|
transition: 0.2s;
|
|
1870
1870
|
width: 44px;
|
|
1871
1871
|
`}
|
|
1872
|
-
`,
|
|
1872
|
+
`,fe=y.styled.div`
|
|
1873
1873
|
${({theme:e})=>`
|
|
1874
1874
|
align-items: center;
|
|
1875
1875
|
background-color: ${e.palette.white};
|
|
@@ -1902,7 +1902,7 @@
|
|
|
1902
1902
|
transform: translateX(100%);
|
|
1903
1903
|
}
|
|
1904
1904
|
|
|
1905
|
-
input:checked + ${re} > ${
|
|
1905
|
+
input:checked + ${re} > ${fe} svg {
|
|
1906
1906
|
color: ${({theme:e})=>e.palette.primary[500]};
|
|
1907
1907
|
}
|
|
1908
1908
|
|
|
@@ -1910,25 +1910,25 @@
|
|
|
1910
1910
|
background-color: ${({theme:e})=>e.palette.gray[300]};
|
|
1911
1911
|
}
|
|
1912
1912
|
|
|
1913
|
-
input:not(:checked):not(:disabled) + ${re} > ${
|
|
1913
|
+
input:not(:checked):not(:disabled) + ${re} > ${fe} svg {
|
|
1914
1914
|
color: ${({theme:e})=>e.palette.gray[500]};
|
|
1915
1915
|
}
|
|
1916
1916
|
|
|
1917
|
-
input:disabled + ${re} > ${
|
|
1917
|
+
input:disabled + ${re} > ${fe} svg {
|
|
1918
1918
|
color: ${({theme:e})=>e.palette.white};
|
|
1919
1919
|
}
|
|
1920
1920
|
|
|
1921
|
-
input:disabled + ${re} > ${
|
|
1921
|
+
input:disabled + ${re} > ${fe} {
|
|
1922
1922
|
background-color: ${({theme:e})=>e.palette.gray[400]};
|
|
1923
1923
|
border: 1px solid ${({theme:e})=>e.palette.gray[400]};
|
|
1924
1924
|
}
|
|
1925
1925
|
|
|
1926
|
-
input:checked:disabled + ${re} > ${
|
|
1926
|
+
input:checked:disabled + ${re} > ${fe} {
|
|
1927
1927
|
color: ${({theme:e})=>e.palette.white};
|
|
1928
1928
|
left: 0.5px;
|
|
1929
1929
|
}
|
|
1930
1930
|
|
|
1931
|
-
input:disabled:not(:checked) + ${re} > ${
|
|
1931
|
+
input:disabled:not(:checked) + ${re} > ${fe} {
|
|
1932
1932
|
left: 1.5px;
|
|
1933
1933
|
}
|
|
1934
1934
|
|
|
@@ -1948,7 +1948,7 @@
|
|
|
1948
1948
|
position: relative;
|
|
1949
1949
|
transition: 0.2s;
|
|
1950
1950
|
width: 51px;
|
|
1951
|
-
`,
|
|
1951
|
+
`,ye=y.styled.div`
|
|
1952
1952
|
${({theme:e})=>`
|
|
1953
1953
|
align-items: center;
|
|
1954
1954
|
background-color: ${e.palette.white};
|
|
@@ -1992,11 +1992,11 @@
|
|
|
1992
1992
|
border: 1px solid ${({theme:e})=>e.palette.success[500]};
|
|
1993
1993
|
}
|
|
1994
1994
|
|
|
1995
|
-
input:checked + ${te} > ${
|
|
1995
|
+
input:checked + ${te} > ${ye} {
|
|
1996
1996
|
transform: translateX(27px);
|
|
1997
1997
|
}
|
|
1998
1998
|
|
|
1999
|
-
input:checked + ${te} > ${
|
|
1999
|
+
input:checked + ${te} > ${ye} svg {
|
|
2000
2000
|
color: ${({theme:e})=>e.palette.success[500]};
|
|
2001
2001
|
}
|
|
2002
2002
|
|
|
@@ -2010,7 +2010,7 @@
|
|
|
2010
2010
|
right: 6px;
|
|
2011
2011
|
}
|
|
2012
2012
|
|
|
2013
|
-
input:not(:checked):not(:disabled) + ${te} > ${
|
|
2013
|
+
input:not(:checked):not(:disabled) + ${te} > ${ye} svg {
|
|
2014
2014
|
color: ${({theme:e})=>e.palette.gray[500]};
|
|
2015
2015
|
}
|
|
2016
2016
|
|
|
@@ -2020,11 +2020,11 @@
|
|
|
2020
2020
|
border: 1px solid ${({theme:e})=>e.palette.gray[400]};
|
|
2021
2021
|
}
|
|
2022
2022
|
|
|
2023
|
-
input:disabled + ${te} > ${
|
|
2023
|
+
input:disabled + ${te} > ${ye} {
|
|
2024
2024
|
background-color: ${({theme:e})=>e.palette.gray[400]};
|
|
2025
2025
|
}
|
|
2026
2026
|
|
|
2027
|
-
input:disabled + ${te} > ${
|
|
2027
|
+
input:disabled + ${te} > ${ye} svg {
|
|
2028
2028
|
color: ${({theme:e})=>e.palette.white};
|
|
2029
2029
|
}
|
|
2030
2030
|
|
|
@@ -2032,7 +2032,7 @@
|
|
|
2032
2032
|
color: ${({theme:e})=>e.palette.gray[400]};
|
|
2033
2033
|
right: 6px;
|
|
2034
2034
|
}
|
|
2035
|
-
`,Un=u.forwardRef(function({defaultChecked:n,disabled:i=!1,variant:r="default",icon:o=!1,justify:s,name:l,leftText:a,leftTextMinWidth:c,rightText:d,tooltip:p,tooltipPlace:g,onChange:x,...h},b){const m=n===!0?"on":"off",j=typeof a=="object"&&a.on&&a.off?a[m]:a,v=u.useCallback(w=>{w.stopPropagation()},[]),k=()=>r==="inline"?t.jsxs(ms,{onClick:v,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(
|
|
2035
|
+
`,Un=u.forwardRef(function({defaultChecked:n,disabled:i=!1,variant:r="default",icon:o=!1,justify:s,name:l,leftText:a,leftTextMinWidth:c,rightText:d,tooltip:p,tooltipPlace:g,onChange:x,...h},b){const m=n===!0?"on":"off",j=typeof a=="object"&&a.on&&a.off?a[m]:a,v=u.useCallback(w=>{w.stopPropagation()},[]),k=()=>r==="inline"?t.jsxs(ms,{onClick:v,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(ye,{children:n?t.jsx(N,{icon:"check",iconSize:"sm"}):t.jsx(N,{icon:"times",iconSize:"sm"})}),t.jsx(qe,{children:n?"YES":"NO"})]})]}):t.jsxs($s,{onClick:v,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(re,{"aria-label":"Toggle Switch",id:`${l}Toggle`,children:t.jsx(fe,{children:o?t.jsx(N,{icon:n?"check":"times",iconSize:"md"}):void 0})})]}),S=()=>{const w=k();return i&&p?t.jsx(K,{id:`${l}-tooltip`,place:g,tip:p,children:w}):w};return r==="inline"?t.jsxs($,{alignItems:"center",display:"flex",fontSize:"14px",gap:.75,justify:s,children:[t.jsx($,{minWidth:c,children:j}),S(),d]}):t.jsxs($,{alignItems:"center",display:"flex",fontSize:"14px",gap:.75,justify:s,children:[t.jsx($,{minWidth:c,children:j}),S(),d]})}),js=({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(rt,{id:e,title:n}),t.jsx($,{display:"flex",flexDirection:"column",gap:.5,minHeight:"40px",width:"100%",children:i.map(l=>t.jsx(Un,{...l},`$card-toggle-${l.name}`))})]})},ws=({description:e,height:n="auto",leftIconName:i,children:r,rightIconName:o,title:s,tooltipId:l,tooltipTip:a,tooltipPlace:c="bottom",variant:d="centered",width:p="318px"})=>{const g=y.useTheme(),x=d==="centered",h=l&&a?t.jsx(K,{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:p,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(Y,{fontWeight:"bold",size:"sm",children:s}),r]}),x&&!f.isUndefined(o)?h:void 0]})]})},vs=.5,ln=1.25,ks=({children:e,bgColor:n,border:i,gap:r=vs,px:o=ln,py:s=ln,...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})},Cs=y.styled.div`
|
|
2036
2036
|
position: relative;
|
|
2037
2037
|
margin: auto;
|
|
2038
2038
|
overflow: hidden;
|
|
@@ -2287,7 +2287,7 @@ ${m[8]}...`:(m.length<8&&p(!1),i)},[a,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2287
2287
|
margin-right: 0;
|
|
2288
2288
|
`:""}
|
|
2289
2289
|
}
|
|
2290
|
-
`,Zn=({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(Ps,{children:t.jsxs("div",{children:[r&&t.jsx(W,{id:r.id,onClick:s,variant:"tertiary",width:"100%",children:r.text}),i&&t.jsx(W,{id:i.id,onClick:l,variant:"primary",width:"100%",children:i.text})]})})]}):null},qn=({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(Ls,{children:[t.jsxs(As,{children:[typeof e=="string"?t.jsx(Y,{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(H,{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(
|
|
2290
|
+
`,Zn=({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(Ps,{children:t.jsxs("div",{children:[r&&t.jsx(W,{id:r.id,onClick:s,variant:"tertiary",width:"100%",children:r.text}),i&&t.jsx(W,{id:i.id,onClick:l,variant:"primary",width:"100%",children:i.text})]})})]}):null},qn=({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(Ls,{children:[t.jsxs(As,{children:[typeof e=="string"?t.jsx(Y,{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(H,{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($e,{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(W,{id:`${n}-cancel`,justify:"center",onClick:i,variant:"tertiary",width:"100%",children:o??"Cancel"}):void 0,t.jsx(W,{disabled:e,id:n,justify:"center",onClick:l?void 0:r,type:l?"submit":"button",variant:"primary",width:"100%",children:s??"Confirm"})]})},Bs=(e,n,i)=>i?n==="secondary"?`3px solid ${e.palette.primary[100]}`:`3px solid ${e.palette.primary[500]}`:"unset",Ws=y.styled.div`
|
|
2291
2291
|
display: flex;
|
|
2292
2292
|
flex-direction: row;
|
|
2293
2293
|
gap: ${({theme:e})=>e.spacing[.25]};
|
|
@@ -2330,7 +2330,7 @@ ${m[8]}...`:(m.length<8&&p(!1),i)},[a,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2330
2330
|
}
|
|
2331
2331
|
}
|
|
2332
2332
|
}
|
|
2333
|
-
`,Jn=({end:e=!1,label:n,id:i,isActive:r=!1,link:o,notificationSign:s,onClick:l,tooltip:a="",variant:c="primary",tag:d})=>{const{pathname:p}=gt.useLocation(),g=r||(c==="primary"?p.includes(o):p.endsWith(o));return t.jsx(K,{display:"flex",id:`${i}-tooltip`,tip:a,children:t.jsxs(Ws,{$borderButton:g,$variant:c,children:[t.jsx(gt.NavLink,{end:e,id:i,onClick:l,to:o,children:n}),t.jsx(Je,{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}),d===void 0?null:t.jsx(J,{tagLabel:`${d}`,variant:"default"})]})})},Pt=({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:d,notificationSign:p,onClick:g,tag:x,tooltip:h})=>t.jsx(Jn,{end:s,id:l,isActive:a,label:d,link:c,notificationSign:p,onClick:g,tag:x,tooltip:h,variant:r},l))})},
|
|
2333
|
+
`,Jn=({end:e=!1,label:n,id:i,isActive:r=!1,link:o,notificationSign:s,onClick:l,tooltip:a="",variant:c="primary",tag:d})=>{const{pathname:p}=gt.useLocation(),g=r||(c==="primary"?p.includes(o):p.endsWith(o));return t.jsx(K,{display:"flex",id:`${i}-tooltip`,tip:a,children:t.jsxs(Ws,{$borderButton:g,$variant:c,children:[t.jsx(gt.NavLink,{end:e,id:i,onClick:l,to:o,children:n}),t.jsx(Je,{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}),d===void 0?null:t.jsx(J,{tagLabel:`${d}`,variant:"default"})]})})},Pt=({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:d,notificationSign:p,onClick:g,tag:x,tooltip:h})=>t.jsx(Jn,{end:s,id:l,isActive:a,label:d,link:c,notificationSign:p,onClick:g,tag:x,tooltip:h,variant:r},l))})},je=u.forwardRef(function({color:n=L.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})}),Vs=y.styled.li`
|
|
2334
2334
|
${({theme:e})=>`
|
|
2335
2335
|
align-items: center;
|
|
2336
2336
|
background-color: ${e.palette.white};
|
|
@@ -2427,7 +2427,7 @@ ${m[8]}...`:(m.length<8&&p(!1),i)},[a,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2427
2427
|
display: none;
|
|
2428
2428
|
}
|
|
2429
2429
|
}
|
|
2430
|
-
`,Ot=e=>e.reduce((i,r)=>r.group?i[r.group]?{...i,[r.group]:[...i[r.group],r]}:{...i,[r.group]:[r]}:i,{}),Hs=300,
|
|
2430
|
+
`,Ot=e=>e.reduce((i,r)=>r.group?i[r.group]?{...i,[r.group]:[...i[r.group],r]}:{...i,[r.group]:[r]}:i,{}),Hs=300,ue=({name:e,onClear:n,onChange:i,value:r,maxLength:o=Hs,...s})=>{const l=u.useRef(null),a=y.useTheme(),[c,d]=u.useState(r??"");u.useEffect(()=>{d(r??"")},[r]);const p=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);d(j);return}d(m),i==null||i(b)},[i,o]),x=u.useCallback(()=>{d(""),n==null||n(),i&&i({target:{value:""},currentTarget:{value:""}})},[n,i]),h=!f.lodashExports.isEmpty(c);return t.jsx(Q,{htmlFor:e??"",children:t.jsxs(ne,{children:[t.jsx(N,{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:p,ref:l,type:"search",value:c,...s}),t.jsx("span",{style:{visibility:h?"visible":"hidden",margin:0},children:t.jsx(H,{icon:"xmark",iconColor:a.palette.gray[400],iconSize:"lg",iconType:"fa-light",onClick:x,px:.25,py:.25,type:"reset",variant:"ghost"})})]})})},ti=({columns:e,formId:n,onChangeHandler:i,variant:r})=>{const o=u.useRef(null),[s,l]=u.useState([]),[a,c]=u.useState(""),d=u.useCallback(g=>{const{value:x}=g.target;c(x)},[]),p=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(ue,{name:"search",onChange:d,onClear:p,value:a})}),t.jsx("form",{"data-testid":n,id:n,onReset:p,style:{display:"flex",flexDirection:"column",gap:"0.625rem"},children:Object.entries(Ot(s)).map(([g,x],h)=>{const b=`li-checkbox${g}`;return t.jsx(Hn,{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(ue,{name:"search",onChange:d,onClear:p,value:a})}),t.jsx("form",{"data-testid":n,id:n,onReset:p,style:{paddingTop:"0.625rem"},children:s.map(g=>{const x=`li-checkbox-${g.name}`;return t.jsx(_s,{selected:g.visible,value:x,width:"content",children:t.jsx(ge,{checked:g.visible,disabled:g.locked,label:g.name,name:g.name,onChange:i,value:g.name})},x)})})]})},ni=({_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]),d=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]),p=u.useCallback(()=>{var x;const g=(x=s.current)==null?void 0:x.scrollHeight;l!==g&&a(g)},[l]);return i.isOpen?we.createPortal(t.jsx(Xn,{"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(Y,{size:"sm",children:n}),t.jsx(H,{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(je,{mb:0,mt:0}),t.jsxs($,{display:"flex",gap:1.25,onScroll:p,px:1.25,ref:s,scroll:"y",width:"100%",children:[t.jsx(ti,{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(ei,{description:"Click and drag to reorder the columns",items:i.columns,onClickClose:d,onReorder:i.setColumns,title:"Reorder columns"})]}),t.jsx(je,{mb:0,mt:0}),t.jsxs($,{display:"flex",justify:"space-between",px:1.25,py:1.25,children:[t.jsx(W,{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(W,{id:"columns-modal-submit",justify:"center",onClick:i.close,variant:"primary",children:"Save"})]})]})}),document.getElementById(e)??document.body):t.jsx("div",{})},Us=y.styled(He)`
|
|
2431
2431
|
padding: 8px;
|
|
2432
2432
|
min-height: 36px;
|
|
2433
2433
|
min-width: unset;
|
|
@@ -2444,7 +2444,7 @@ ${m[8]}...`:(m.length<8&&p(!1),i)},[a,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2444
2444
|
svg.fa-check {
|
|
2445
2445
|
border-radius: 2px;
|
|
2446
2446
|
}
|
|
2447
|
-
`,ii=({control:e,option:n,register:i,watch:r,setValue:o})=>{var s,l,a,c;switch(n.type){case"checkboxes":{const p=r("search")??"",g=r("checkbox")??[],x=n.options??[],h=Ys(x,p,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(pn,{value:b.value,width:"content",children:t.jsx(ue,{...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(p=>t.jsx(pn,{value:p.value,width:"content",children:t.jsx(Lt,{...i("radio"),label:p.label,value:p.value})},`li-radio-${p.value}`))]});case"select":return t.jsx(Dt,{control:e,items:((l=n.options)==null?void 0:l.map(p=>({name:p.label??"",value:p.value})))??[],label:n.label,name:`text.${String(n.key)}-${n.filterFn??"caseInsensitive"}`,placeholder:n.placeholder,value:n.value});case"text":const d=`text.${String(n.key)}-${n.filterFn??"caseInsensitive"}`;return t.jsx(_e,{label:n.label,name:d,placeholder:n.placeholder,register:i,value:n.value});case"numberRange":return t.jsx(Nt,{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:(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",{})}},ri=({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(ii,{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)})}),oi=e=>{var c,d,p,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:((p=(d=(c=e.find(h=>h.type==="radioButton"))==null?void 0:c.options)==null?void 0:d.find(({checked:h})=>h))==null?void 0:p.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}},bt=({options:e,onSearch:n,onSubmit:i,id:r,selectedFilter:o})=>{const{control:s,items:l,setItems:a,register:c,handleSubmit:d,setValue:p,watch:g}=oi(e),x=e.some(v=>v.type==="checkboxes"&&v.hideSearch!==!0),h=e.some(v=>v.label&&v.label!==""),b=u.useCallback(async v=>{const{value:k}=v.target;p("search",k),n&&n(k)},[n,p]),m=u.useCallback(()=>{p("search",""),n&&n("")},[n,p]),j=u.useCallback(v=>{i&&i(v)},[i]);return u.useEffect(()=>{a(e),Gs(e,p)},[e,a,p]),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(xe,{onChange:b,onClear:m,placeholder:"Search"})]}),t.jsxs("form",{id:r,onSubmit:d(j),children:[t.jsx(ri,{control:s,items:l,register:c,setValue:p,watch:g}),t.jsx(W,{mt:1,type:"submit",children:"Apply"})]})]})},si=({options:e,variant:n,onApplyFilters:i,onSearch:r,setDirection:o,setHandler:s,onFilterStateChange:l})=>{const a=y.useTheme(),[c,d]=u.useState(e),[p,g]=u.useState([]),[x,h]=u.useState({}),[b,m]=u.useState(""),j=u.useCallback(S=>()=>{const w=c.find(z=>z.label===S),C=!(w!=null&&w.filterOptions.some(z=>z.type==="dateRange"||z.type==="select"));s==null||s(C??!0),m(S),g((w==null?void 0:w.filterOptions)??[])},[c,s]),v=u.useCallback(S=>{const w=[...S.checkbox,...Object.values(S.text??{}),...S.radio?[S.radio]:[],...S.minValue?[String(S.minValue)]:[],...S.maxValue?[String(S.maxValue)]:[]];h(R=>w.length>0?{...R,[b]:w}:R);const C=R=>{var T,F;return{...R,options:(T=R.options)==null?void 0:T.map(A=>({...A,checked:S.checkbox.includes(A.value)||S.radio===A.value})),value:["text","select"].includes(R.type)?((F=S.text)==null?void 0:F[`${String(R.key)}-${R.filterFn??"caseInsensitive"}`])??R.value:R.value,minValue:["numberRange","dateRange"].includes(R.type)?S.minValue:R.minValue,maxValue:["numberRange","dateRange"].includes(R.type)?S.maxValue:R.maxValue}},z=R=>R.label===b?{...R,filterOptions:R.filterOptions.map(C)}:R,D=c.map(z);d(R=>R.map(z));const E=D.flatMap(({filterOptions:R})=>R);i(E),g([])},[c,i,b]),k=u.useCallback((S,w)=>{const C=`li-filter-option-${S}`;return t.jsxs(Us,{icon:w,onClick:j(S),style:{minWidth:"180px",writingMode:"horizontal-tb"},value:C,width:"100%",children:[S,x[S]===void 0?void 0:t.jsx(J,{tagLabel:x[S].length.toString()})]},C)},[x,j]);return u.useEffect(()=>{const S=e.reduce((w,{label:C,filterOptions:z})=>{const D=z.flatMap(({value:T,minValue:F,maxValue:A})=>[F,A,T]).filter(Boolean),E=z.flatMap(({options:T})=>T??[]).filter(({checked:T=!1})=>T).map(({value:T})=>T),R=[...D,...E];return R.length===0?w:{...w,[C]:R}},{});h(S),p.length>0&&o&&o("column")},[p,e,o]),u.useEffect(()=>{l==null||l(p.length>0)},[p.length,l]),n==="grouped"?t.jsx($,{display:"flex",flexDirection:"row",height:"max-content",maxHeight:p.length>0?"unset":"360px",style:{rowGap:"10px",writingMode:"vertical-lr"},wrap:"wrap",children:p.length>0?t.jsx(bt,{id:"filters-options",onSearch:r,onSubmit:v,options:p,selectedFilter:b}):Object.entries(Ot(e)).map(([S,w])=>t.jsxs($,{style:{writingMode:"horizontal-tb"},children:[t.jsx(I,{color:a.palette.gray[400],fontWeight:"bold",mb:.25,size:"md",children:S}),w.map(({label:C,icon:z="filter-list"})=>k(C,z))]},S))}):t.jsx($,{display:"flex",flexDirection:"row",height:"max-content",maxHeight:p.length>0?"unset":"200px",style:{rowGap:"10px",writingMode:"vertical-lr"},wrap:"wrap",children:p.length>0?t.jsx(bt,{id:"filters-options",onSearch:r,onSubmit:v,options:p,selectedFilter:b}):e.map(({label:S,icon:w="filter-list"})=>k(S,w))})},ai=({options:e,onApplyFilters:n,onSearch:i,modalRef:r,variant:o})=>{const[s,l]=u.useState("row"),[a,c]=u.useState(!0),[d,p]=u.useState(!1),x=(o==="grouped"?Object.values(Ot(e)).reduce((j,v)=>j+v.length,0):e.length)>5&&!d,h=y.useTheme(),b=u.useRef(null),m=t.jsx(H,{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=v=>{const k=b.current;k&&!k.contains(v.target)&&r.close()};if(a)return document.addEventListener("mousedown",j,!0),()=>{document.removeEventListener("mousedown",j,!0)}},[b,a,r]),t.jsx(Xs,{$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(si,{onApplyFilters:n,onFilterStateChange:p,onSearch:i,options:e,setDirection:l,setHandler:c,variant:o}),s==="row"?m:void 0]})})};function Zs(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 li(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 d=c-3,p=Math.ceil(d/2),g=Math.floor(d/2);return`${a.slice(0,p)}...${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 qs(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 Ks(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 Js(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 d,p,g;if(s.length>0){if(s.length===1){const m=(((d=s[0])==null?void 0:d.length)??0)>20;return{shouldShowTooltip:m,tooltipContent:m?s[0]:void 0}}if(s.length===2){const m=((p=s[0])==null?void 0:p.length)??0,j=s.join(", ").length,v=m>20||j>20;return{shouldShowTooltip:v,tooltipContent:v?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(K,{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(J,{filterValues:o,icon:n,id:"remove-filter",onClose:r(e),tagLabel:`${i} `})})},Qs=({options:e,onClose:n})=>{const i=e.flatMap(r=>r.filterOptions.map(o=>{const{filterFn:s,label:l,type:a,value:c,options:d,minValue:p,maxValue:g}=o;switch(a){case"numberRange":{const x=qs(p,g,r.placeholder);return t.jsx(Te,{filter:o,filterValue:x,icon:r.icon,label:r.label,onClose:n},l)}case"dateRange":{const x=Ks(p==null?void 0:p.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=li(d);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=Zs(c),h=Js(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},ea=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),ta=(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}),dt=(e,n)=>{const i=ea(e);n(JSON.stringify(i))},na=(e,n)=>{const i=e();if(!i)return n;try{const r=JSON.parse(i);return ta(r,n)}catch{return n}},ia=(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(d=>d.checked).map(d=>d.value);return c.length===0?!0:c.includes(String(l[a.key]))}function o(l,a,c){const d=c(String(l[a.key])),{minValue:p,maxValue:g}=a,x=f._.isEmpty(p)&&typeof p!="number"?void 0:c(String(p)),h=f._.isEmpty(g)&&typeof g!="number"?void 0:c(String(g));return f._.isUndefined(x)&&f._.isUndefined(h)?!0:(x??-1/0)<=d&&d<=(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)},ra=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,oa=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}},sa=({dataset:e,setValues:n,getValues:i,options:r,setFilteredDataset:o,onFiltersChange:s,onReset:l,onSearch:a,variant:c="ungrouped"})=>{const d=ve("filters-modal"),[p,g]=u.useState(!1),[x,h]=u.useState([]),b=ra(x),m=r.map(w=>({...w,filterOptions:w.filterOptions.map(C=>x.find(D=>D.key===C.key&&D.type===C.type&&D.filterFn===C.filterFn)??{...C})})),j=u.useCallback(w=>{h([...w]),dt(w,n)},[h,n]),v=u.useCallback(()=>{l&&l(),d.isOpen||g(!0),d.toggle()},[d,l]),k=u.useCallback(w=>()=>{l&&l();const C=x.map(z=>z.key===w.key&&z.type===w.type&&z.filterFn===w.filterFn?oa(z):z);h(C),dt(C,n)},[x,l,n]);return u.useEffect(()=>{const w=r.flatMap(D=>D.filterOptions),C=i();if((()=>{if(!C)return!1;try{const D=JSON.parse(C);return Array.isArray(D)&&D.length>0}catch{return!1}})()){const D=na(i,w);h(D)}else w.flatMap(E=>E.value).filter(Boolean).length>0||w.flatMap(E=>E.options).filter(E=>(E==null?void 0:E.checked)===!0).length>0?(h(w),p&&dt(w,n)):h(w)},[r,h,n,i,p]),u.useEffect(()=>{o&&e!==void 0&&o(ia(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(W,{icon:"filter",id:"filter-btn",onClick:v,tag:b.toString(),variant:"ghost"})}),d.isOpen&&t.jsx(ai,{modalRef:d,onApplyFilters:j,onSearch:a,options:m,variant:c})]}),options:m,removeFilter:k}},Bt=({_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:d=void 0,tabItems:p=void 0,title:g=void 0,size:x,id:h="modal-container"})=>{const b=y.useTheme(),[m,j]=u.useState(void 0),v=u.useRef(null),k=u.useRef(!1),S=Array.isArray(p)&&p.length>0,w=i??o;u.useEffect(()=>{if(S&&!k.current&&v.current){const z=v.current.getBoundingClientRect().height;z>50&&(j(z),k.current=!0)}a.isOpen||(j(void 0),k.current=!1)},[S,a.isOpen]);const C=t.jsx(Xn,{"aria-label":a.name,"aria-modal":"true",id:"modal-wrapper",children:t.jsxs(At,{$size:x,"data-testid":h,flexDirection:"column",id:h,ref:S?v:void 0,style:S&&m?{height:m}:void 0,children:[!f._.isEmpty(g)&&!f._.isNil(g)&&t.jsx(qn,{description:l,modalRef:a,onClose:d,otherActions:c,title:g}),p&&t.jsx($,{borderTop:`1px solid ${b.palette.gray[300]}`,display:"block",mb:1.25,position:"sticky",children:t.jsx(Pt,{items:p})}),(f._.isObject(s)||r)&&t.jsxs(Ns,{style:w?{borderBottom:`1px solid ${b.palette.gray[200]}`}:void 0,children:[r,f._.isObject(s)&&f._.isString(s.imageSrc)&&t.jsx(Os,{$framed:s.imageFramed,children:t.jsx(se,{alt:"modal-img",publicId:s.imageSrc})}),f._.isObject(s)&&f._.isString(s.imageText)&&t.jsx(I,{size:"md",children:s.imageText})]}),t.jsx(Zn,{alert:n,cancelButton:i,confirmButton:o,modalRef:a})]})});return e&&a.isOpen?ge.createPortal(C,document.getElementById("portals")??document.body):a.isOpen?C:null},aa=(e,n,i)=>{const r=ve("confirm-dialog-modal"),o=u.useRef(null),s=u.useCallback(async()=>(r.open(),new Promise(d=>{o.current=d})),[r]),l=u.useCallback(()=>{var d;r.close(),(d=o.current)==null||d.call(o,!0)},[r]),a=u.useCallback(()=>{var d;r.close(),(d=o.current)==null||d.call(o,!1)},[r]);return[s,({children:d})=>{const[p,g]=u.useState(i),x=u.useCallback(()=>{g({...i})},[]),h=u.useCallback(j=>()=>{g(v=>({...v,[j]:{...v[j],state:!v[j].state}}))},[]),b=!Object.values(p).every(({state:j})=>j),m=Object.entries(p).map(([j,{state:v,label:k}])=>t.jsx(ue,{defaultChecked:v,label:k,name:j,onChange:h(j)},j));return t.jsxs(Bt,{"data-testid":e,id:e,modalRef:{...r,close:a},onClose:x,size:"sm",title:n,children:[d,t.jsx($,{display:"flex",flexDirection:"column",gap:.5,children:m}),t.jsx(Kn,{disabled:b,id:e,onConfirm:l})]})}]},la=()=>{const[e,n]=u.useState(!1),[i,r]=u.useState(),o=u.useRef(null),s=ve("confirm-dialog-modal"),l=u.useCallback(async p=>(r(p),n(!0),new Promise(g=>{o.current=g})),[]),a=u.useCallback(()=>{var p;n(!1),r(void 0),(p=o.current)==null||p.call(o,!0)},[]),c=u.useCallback(()=>{var p;n(!1),r(void 0),(p=o.current)==null||p.call(o,!1)},[]);return u.useEffect(()=>{s.setIsOpen(e)},[e,s]),{ConfirmDialog:({id:p="confirm-dialog-modal",children:g})=>t.jsxs(Bt,{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:p,modalRef:{...s,close:c},size:"sm",title:i==null?void 0:i.title,children:[i==null?void 0:i.content,g]}),confirm:l}},ca=2e3,da=({content:e})=>{const[n,i]=u.useState("Copy"),r=u.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{i("Copied"),setTimeout(()=>{i("Copy")},ca)}).catch(()=>{i("Failed to copy")})},[e]);return t.jsx(H,{icon:"copy",iconSize:"lg",iconType:"fa-light",onClick:r,tooltip:n,variant:"ghost"})},pa=y.styled.ul`
|
|
2447
|
+
`,ii=({control:e,option:n,register:i,watch:r,setValue:o})=>{var s,l,a,c;switch(n.type){case"checkboxes":{const p=r("search")??"",g=r("checkbox")??[],x=n.options??[],h=Ys(x,p,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(pn,{value:b.value,width:"content",children:t.jsx(ge,{...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(p=>t.jsx(pn,{value:p.value,width:"content",children:t.jsx(Lt,{...i("radio"),label:p.label,value:p.value})},`li-radio-${p.value}`))]});case"select":return t.jsx(Dt,{control:e,items:((l=n.options)==null?void 0:l.map(p=>({name:p.label??"",value:p.value})))??[],label:n.label,name:`text.${String(n.key)}-${n.filterFn??"caseInsensitive"}`,placeholder:n.placeholder,value:n.value});case"text":const d=`text.${String(n.key)}-${n.filterFn??"caseInsensitive"}`;return t.jsx(_e,{label:n.label,name:d,placeholder:n.placeholder,register:i,value:n.value});case"numberRange":return t.jsx(Nt,{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:(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",{})}},ri=({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(ii,{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)})}),oi=e=>{var c,d,p,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:((p=(d=(c=e.find(h=>h.type==="radioButton"))==null?void 0:c.options)==null?void 0:d.find(({checked:h})=>h))==null?void 0:p.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}},bt=({options:e,onSearch:n,onSubmit:i,id:r,selectedFilter:o})=>{const{control:s,items:l,setItems:a,register:c,handleSubmit:d,setValue:p,watch:g}=oi(e),x=e.some(v=>v.type==="checkboxes"&&v.hideSearch!==!0),h=e.some(v=>v.label&&v.label!==""),b=u.useCallback(async v=>{const{value:k}=v.target;p("search",k),n&&n(k)},[n,p]),m=u.useCallback(()=>{p("search",""),n&&n("")},[n,p]),j=u.useCallback(v=>{i&&i(v)},[i]);return u.useEffect(()=>{a(e),Gs(e,p)},[e,a,p]),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(ue,{onChange:b,onClear:m,placeholder:"Search"})]}),t.jsxs("form",{id:r,onSubmit:d(j),children:[t.jsx(ri,{control:s,items:l,register:c,setValue:p,watch:g}),t.jsx(W,{mt:1,type:"submit",children:"Apply"})]})]})},si=({options:e,variant:n,onApplyFilters:i,onSearch:r,setDirection:o,setHandler:s,onFilterStateChange:l})=>{const a=y.useTheme(),[c,d]=u.useState(e),[p,g]=u.useState([]),[x,h]=u.useState({}),[b,m]=u.useState(""),j=u.useCallback(S=>()=>{const w=c.find(z=>z.label===S),C=!(w!=null&&w.filterOptions.some(z=>z.type==="dateRange"||z.type==="select"));s==null||s(C??!0),m(S),g((w==null?void 0:w.filterOptions)??[])},[c,s]),v=u.useCallback(S=>{const w=[...S.checkbox,...Object.values(S.text??{}),...S.radio?[S.radio]:[],...S.minValue?[String(S.minValue)]:[],...S.maxValue?[String(S.maxValue)]:[]];h(R=>w.length>0?{...R,[b]:w}:R);const C=R=>{var T,F;return{...R,options:(T=R.options)==null?void 0:T.map(A=>({...A,checked:S.checkbox.includes(A.value)||S.radio===A.value})),value:["text","select"].includes(R.type)?((F=S.text)==null?void 0:F[`${String(R.key)}-${R.filterFn??"caseInsensitive"}`])??R.value:R.value,minValue:["numberRange","dateRange"].includes(R.type)?S.minValue:R.minValue,maxValue:["numberRange","dateRange"].includes(R.type)?S.maxValue:R.maxValue}},z=R=>R.label===b?{...R,filterOptions:R.filterOptions.map(C)}:R,D=c.map(z);d(R=>R.map(z));const E=D.flatMap(({filterOptions:R})=>R);i(E),g([])},[c,i,b]),k=u.useCallback((S,w)=>{const C=`li-filter-option-${S}`;return t.jsxs(Us,{icon:w,onClick:j(S),style:{minWidth:"180px",writingMode:"horizontal-tb"},value:C,width:"100%",children:[S,x[S]===void 0?void 0:t.jsx(J,{tagLabel:x[S].length.toString()})]},C)},[x,j]);return u.useEffect(()=>{const S=e.reduce((w,{label:C,filterOptions:z})=>{const D=z.flatMap(({value:T,minValue:F,maxValue:A})=>[F,A,T]).filter(Boolean),E=z.flatMap(({options:T})=>T??[]).filter(({checked:T=!1})=>T).map(({value:T})=>T),R=[...D,...E];return R.length===0?w:{...w,[C]:R}},{});h(S),p.length>0&&o&&o("column")},[p,e,o]),u.useEffect(()=>{l==null||l(p.length>0)},[p.length,l]),n==="grouped"?t.jsx($,{display:"flex",flexDirection:"row",height:"max-content",maxHeight:p.length>0?"unset":"360px",style:{rowGap:"10px",writingMode:"vertical-lr"},wrap:"wrap",children:p.length>0?t.jsx(bt,{id:"filters-options",onSearch:r,onSubmit:v,options:p,selectedFilter:b}):Object.entries(Ot(e)).map(([S,w])=>t.jsxs($,{style:{writingMode:"horizontal-tb"},children:[t.jsx(I,{color:a.palette.gray[400],fontWeight:"bold",mb:.25,size:"md",children:S}),w.map(({label:C,icon:z="filter-list"})=>k(C,z))]},S))}):t.jsx($,{display:"flex",flexDirection:"row",height:"max-content",maxHeight:p.length>0?"unset":"200px",style:{rowGap:"10px",writingMode:"vertical-lr"},wrap:"wrap",children:p.length>0?t.jsx(bt,{id:"filters-options",onSearch:r,onSubmit:v,options:p,selectedFilter:b}):e.map(({label:S,icon:w="filter-list"})=>k(S,w))})},ai=({options:e,onApplyFilters:n,onSearch:i,modalRef:r,variant:o})=>{const[s,l]=u.useState("row"),[a,c]=u.useState(!0),[d,p]=u.useState(!1),x=(o==="grouped"?Object.values(Ot(e)).reduce((j,v)=>j+v.length,0):e.length)>5&&!d,h=y.useTheme(),b=u.useRef(null),m=t.jsx(H,{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=v=>{const k=b.current;k&&!k.contains(v.target)&&r.close()};if(a)return document.addEventListener("mousedown",j,!0),()=>{document.removeEventListener("mousedown",j,!0)}},[b,a,r]),t.jsx(Xs,{$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(si,{onApplyFilters:n,onFilterStateChange:p,onSearch:i,options:e,setDirection:l,setHandler:c,variant:o}),s==="row"?m:void 0]})})};function Zs(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 li(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 d=c-3,p=Math.ceil(d/2),g=Math.floor(d/2);return`${a.slice(0,p)}...${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 qs(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 Ks(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 Js(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 d,p,g;if(s.length>0){if(s.length===1){const m=(((d=s[0])==null?void 0:d.length)??0)>20;return{shouldShowTooltip:m,tooltipContent:m?s[0]:void 0}}if(s.length===2){const m=((p=s[0])==null?void 0:p.length)??0,j=s.join(", ").length,v=m>20||j>20;return{shouldShowTooltip:v,tooltipContent:v?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(K,{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(J,{filterValues:o,icon:n,id:"remove-filter",onClose:r(e),tagLabel:`${i} `})})},Qs=({options:e,onClose:n})=>{const i=e.flatMap(r=>r.filterOptions.map(o=>{const{filterFn:s,label:l,type:a,value:c,options:d,minValue:p,maxValue:g}=o;switch(a){case"numberRange":{const x=qs(p,g,r.placeholder);return t.jsx(Te,{filter:o,filterValue:x,icon:r.icon,label:r.label,onClose:n},l)}case"dateRange":{const x=Ks(p==null?void 0:p.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=li(d);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=Zs(c),h=Js(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},ea=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),ta=(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}),dt=(e,n)=>{const i=ea(e);n(JSON.stringify(i))},na=(e,n)=>{const i=e();if(!i)return n;try{const r=JSON.parse(i);return ta(r,n)}catch{return n}},ia=(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(d=>d.checked).map(d=>d.value);return c.length===0?!0:c.includes(String(l[a.key]))}function o(l,a,c){const d=c(String(l[a.key])),{minValue:p,maxValue:g}=a,x=f._.isEmpty(p)&&typeof p!="number"?void 0:c(String(p)),h=f._.isEmpty(g)&&typeof g!="number"?void 0:c(String(g));return f._.isUndefined(x)&&f._.isUndefined(h)?!0:(x??-1/0)<=d&&d<=(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)},ra=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,oa=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}},sa=({dataset:e,setValues:n,getValues:i,options:r,setFilteredDataset:o,onFiltersChange:s,onReset:l,onSearch:a,variant:c="ungrouped"})=>{const d=ve("filters-modal"),[p,g]=u.useState(!1),[x,h]=u.useState([]),b=ra(x),m=r.map(w=>({...w,filterOptions:w.filterOptions.map(C=>x.find(D=>D.key===C.key&&D.type===C.type&&D.filterFn===C.filterFn)??{...C})})),j=u.useCallback(w=>{h([...w]),dt(w,n)},[h,n]),v=u.useCallback(()=>{l&&l(),d.isOpen||g(!0),d.toggle()},[d,l]),k=u.useCallback(w=>()=>{l&&l();const C=x.map(z=>z.key===w.key&&z.type===w.type&&z.filterFn===w.filterFn?oa(z):z);h(C),dt(C,n)},[x,l,n]);return u.useEffect(()=>{const w=r.flatMap(D=>D.filterOptions),C=i();if((()=>{if(!C)return!1;try{const D=JSON.parse(C);return Array.isArray(D)&&D.length>0}catch{return!1}})()){const D=na(i,w);h(D)}else w.flatMap(E=>E.value).filter(Boolean).length>0||w.flatMap(E=>E.options).filter(E=>(E==null?void 0:E.checked)===!0).length>0?(h(w),p&&dt(w,n)):h(w)},[r,h,n,i,p]),u.useEffect(()=>{o&&e!==void 0&&o(ia(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(W,{icon:"filter",id:"filter-btn",onClick:v,tag:b.toString(),variant:"ghost"})}),d.isOpen&&t.jsx(ai,{modalRef:d,onApplyFilters:j,onSearch:a,options:m,variant:c})]}),options:m,removeFilter:k}},Bt=({_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:d=void 0,tabItems:p=void 0,title:g=void 0,size:x,id:h="modal-container"})=>{const b=y.useTheme(),[m,j]=u.useState(void 0),v=u.useRef(null),k=u.useRef(!1),S=Array.isArray(p)&&p.length>0,w=i??o;u.useEffect(()=>{if(S&&!k.current&&v.current){const z=v.current.getBoundingClientRect().height;z>50&&(j(z),k.current=!0)}a.isOpen||(j(void 0),k.current=!1)},[S,a.isOpen]);const C=t.jsx(Xn,{"aria-label":a.name,"aria-modal":"true",id:"modal-wrapper",children:t.jsxs(At,{$size:x,"data-testid":h,flexDirection:"column",id:h,ref:S?v:void 0,style:S&&m?{height:m}:void 0,children:[!f._.isEmpty(g)&&!f._.isNil(g)&&t.jsx(qn,{description:l,modalRef:a,onClose:d,otherActions:c,title:g}),p&&t.jsx($,{borderTop:`1px solid ${b.palette.gray[300]}`,display:"block",mb:1.25,position:"sticky",children:t.jsx(Pt,{items:p})}),(f._.isObject(s)||r)&&t.jsxs(Ns,{style:w?{borderBottom:`1px solid ${b.palette.gray[200]}`}:void 0,children:[r,f._.isObject(s)&&f._.isString(s.imageSrc)&&t.jsx(Os,{$framed:s.imageFramed,children:t.jsx(se,{alt:"modal-img",publicId:s.imageSrc})}),f._.isObject(s)&&f._.isString(s.imageText)&&t.jsx(I,{size:"md",children:s.imageText})]}),t.jsx(Zn,{alert:n,cancelButton:i,confirmButton:o,modalRef:a})]})});return e&&a.isOpen?we.createPortal(C,document.getElementById("portals")??document.body):a.isOpen?C:null},aa=(e,n,i)=>{const r=ve("confirm-dialog-modal"),o=u.useRef(null),s=u.useCallback(async()=>(r.open(),new Promise(d=>{o.current=d})),[r]),l=u.useCallback(()=>{var d;r.close(),(d=o.current)==null||d.call(o,!0)},[r]),a=u.useCallback(()=>{var d;r.close(),(d=o.current)==null||d.call(o,!1)},[r]);return[s,({children:d})=>{const[p,g]=u.useState(i),x=u.useCallback(()=>{g({...i})},[]),h=u.useCallback(j=>()=>{g(v=>({...v,[j]:{...v[j],state:!v[j].state}}))},[]),b=!Object.values(p).every(({state:j})=>j),m=Object.entries(p).map(([j,{state:v,label:k}])=>t.jsx(ge,{defaultChecked:v,label:k,name:j,onChange:h(j)},j));return t.jsxs(Bt,{"data-testid":e,id:e,modalRef:{...r,close:a},onClose:x,size:"sm",title:n,children:[d,t.jsx($,{display:"flex",flexDirection:"column",gap:.5,children:m}),t.jsx(Kn,{disabled:b,id:e,onConfirm:l})]})}]},la=()=>{const[e,n]=u.useState(!1),[i,r]=u.useState(),o=u.useRef(null),s=ve("confirm-dialog-modal"),l=u.useCallback(async p=>(r(p),n(!0),new Promise(g=>{o.current=g})),[]),a=u.useCallback(()=>{var p;n(!1),r(void 0),(p=o.current)==null||p.call(o,!0)},[]),c=u.useCallback(()=>{var p;n(!1),r(void 0),(p=o.current)==null||p.call(o,!1)},[]);return u.useEffect(()=>{s.setIsOpen(e)},[e,s]),{ConfirmDialog:({id:p="confirm-dialog-modal",children:g})=>t.jsxs(Bt,{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:p,modalRef:{...s,close:c},size:"sm",title:i==null?void 0:i.title,children:[i==null?void 0:i.content,g]}),confirm:l}},ca=2e3,da=({content:e})=>{const[n,i]=u.useState("Copy"),r=u.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{i("Copied"),setTimeout(()=>{i("Copy")},ca)}).catch(()=>{i("Failed to copy")})},[e]);return t.jsx(H,{icon:"copy",iconSize:"lg",iconType:"fa-light",onClick:r,tooltip:n,variant:"ghost"})},pa=y.styled.ul`
|
|
2448
2448
|
${({theme:e})=>`
|
|
2449
2449
|
align-items: flex-start;
|
|
2450
2450
|
border-radius: ${e.spacing[.25]};
|
|
@@ -2517,7 +2517,7 @@ ${m[8]}...`:(m.length<8&&p(!1),i)},[a,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2517
2517
|
> *:last-child {
|
|
2518
2518
|
margin-right: 0;
|
|
2519
2519
|
}
|
|
2520
|
-
`,gn={md:{description:"md",title:"md"},sm:{description:"md",title:"xs"}},ya=({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(xa,{$padding:o,children:[t.jsx(ha,{children:t.jsx(se,{alt:"empty-icon",publicId:r})}),t.jsx(Y,{fontWeight:"bold",mb:.25,size:gn[l].title,textAlign:"center",children:s}),t.jsx(I,{mb:a?2:void 0,size:gn[l].description,textAlign:"center",children:i}),a?t.jsxs(fa,{children:[e&&t.jsx($t,{buttonProps:e,variant:"tertiary"}),n&&t.jsx($t,{buttonProps:n,variant:"primary"})]}):void 0]})}
|
|
2520
|
+
`,gn={md:{description:"md",title:"md"},sm:{description:"md",title:"xs"}},ya=({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(xa,{$padding:o,children:[t.jsx(ha,{children:t.jsx(se,{alt:"empty-icon",publicId:r})}),t.jsx(Y,{fontWeight:"bold",mb:.25,size:gn[l].title,textAlign:"center",children:s}),t.jsx(I,{mb:a?2:void 0,size:gn[l].description,textAlign:"center",children:i}),a?t.jsxs(fa,{children:[e&&t.jsx($t,{buttonProps:e,variant:"tertiary"}),n&&t.jsx($t,{buttonProps:n,variant:"primary"})]}):void 0]})},be=20,ci=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()))},di=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()))},ba=e=>{var s,l;const n=e.split(",");if(n.length===0||ci(e)||di(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}},pt=e=>{if(e.length<=be)return e;const n=be-3,i=Math.ceil(n/2),r=Math.floor(n/2);return`${e.slice(0,i)}...${e.slice(e.length-r)}`},$a=e=>{const[n,i]=(e==null?void 0:e.split(",").map(r=>r.trim()))??[];return n&&i&&n!=="-"&&i!=="-"?`${n} - ${i}`:e},ma=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},ja=e=>{const n=e.split(",");if(ci(e))return ma(e);if(di(e))return $a(e);if(n.length===1)return pt(e);if(n.length<=2){const s=n[0],l=n.join(", ").length;return s.length>be||l>be?`${pt(s)} +1 more`:e}const i=n[0],r=n.length-1,o=n.join(", ").length;return i.length>be||o>be?`${pt(i)} +${r} more`:e},pi=({filter:{id:e,label:n,value:i},onClose:r})=>{const o=ja(i),{content:s,showTooltip:l}=ba(i),a=t.jsx(J,{filterId:`${n}=${o}`,filterValues:o,icon:"filter-list",id:"remove-filter",onClose:r(e),tagLabel:`${n} `});return l?t.jsx(K,{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},wa=({filters:e})=>{const{appliedFilters:n,removeFilter:i}=St({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(pi,{filter:r,onClose:i},`${r.id}-${r.value}`))}):null},Ue=u.createContext({id:"",calendarState:{isOpen:!1,updateCalendarState:()=>{}},searchState:{includeSearch:!1,previousValue:""},scrollState:{height:"0",ref:{current:null}},searchValues:{searchGlobal:"",search:""},setSearchValues:()=>Promise.resolve(new URLSearchParams),values:{},setValues:()=>Promise.resolve(new URLSearchParams),updateSearch:()=>{},updateScrollHeight:()=>{}}),gi=y.styled.div`
|
|
2521
2521
|
${({theme:e,$left:n="0"})=>`
|
|
2522
2522
|
align-items: flex-start;
|
|
2523
2523
|
background: ${e.palette.white};
|
|
@@ -2532,7 +2532,7 @@ ${m[8]}...`:(m.length<8&&p(!1),i)},[a,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2532
2532
|
top: 100%;
|
|
2533
2533
|
left: ${n};
|
|
2534
2534
|
width: 342px;
|
|
2535
|
-
z-index:
|
|
2535
|
+
z-index: 99999;
|
|
2536
2536
|
`}
|
|
2537
2537
|
`,ui=y.styled.div`
|
|
2538
2538
|
${({theme:e})=>`
|
|
@@ -2582,7 +2582,7 @@ ${m[8]}...`:(m.length<8&&p(!1),i)},[a,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2582
2582
|
`,xi=y.styled.button`
|
|
2583
2583
|
${Tt}
|
|
2584
2584
|
min-width: fit-content;
|
|
2585
|
-
`,Vt=()=>{const e=y.useTheme();return t.jsx(Wt,{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(N,{icon:"search",iconSize:"lg",mx:.5,my:.5})}),t.jsxs($,{alignItems:"center",display:"flex",flexDirection:"column",gap:.25,justify:"center",children:[t.jsx(Y,{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."})]})]})})},hi=7,va=e=>e.reduce((n,i)=>(i.group?(n[i.group]||(n[i.group]=[]),n[i.group].push(i)):n.default=[...n.default||[],i],n),{}),ka=(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((d,p)=>{const g=o.includes(d.value),x=o.includes(p.value);return g===x?0:g?-1:1});return{...a,items:c}});return{label:r.label,options:s}},Ca=(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),fi=u.forwardRef(function({includeSearch:n=!1,groupedFilters:i,handleChangeId:r},o){const s=y.useTheme(),[l,a]=u.useState(""),{searchValues:{searchGlobal:c},setSearchValues:d,values:p,updateSearch:g,setValues:x}=u.useContext(Ue),h=Ca(i,c),b=u.useMemo(()=>Object.values(p).filter(Boolean).length>0,[p]),m=u.useCallback(k=>()=>{r(k),a(k),g({previousValue:p[k]??""}),d({search:"",searchGlobal:""})},[r,g,d,p]),j=u.useCallback(()=>{x(k=>Object.keys(k).reduce((S,w)=>({...S,[w]:null}),{})),a("")},[x]),v=u.useCallback(k=>{d({searchGlobal:k.target.value})},[d]);return t.jsxs(gi,{"data-testid":"filters-menu",ref:o,children:[t.jsxs(ui,{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"}),b?t.jsx(xi,{$variant:"lowRelevance",onClick:j,type:"button",children:"Reset all"}):void 0]}),n?t.jsx(xe,{name:"filters-search",onChange:v,placeholder:"Search filter...",value:c}):void 0]}),t.jsx($,{alignItems:"flex-start",display:"flex",flexDirection:"column",scroll:"y",width:"100%",children:h.length>0?h.map(({group:k,filters:S},w)=>S.length>0?t.jsxs(Wt,{$border:w>0&&k!=="default","data-testid":`${k?`menu-${f.snakeCase(k)}`:"menu-content"}`,children:[k!=="default"?t.jsx(I,{color:s.palette.gray[400],fontWeight:"bold",mb:.5,size:"md",children:k}):void 0,S.map(C=>{const D=p[C.id].split(",").filter(E=>E&&E!=="-").length.toString();return t.jsx(u.Fragment,{children:t.jsxs(Ie,{as:"button","data-testid":C.id,onClick:m(C.id),children:[t.jsx(N,{icon:"filter",iconClass:"filter-item",iconSize:"md",iconType:"fa-light"}),C.label,t.jsxs($,{alignItems:"center",display:"flex",gap:.5,style:{marginLeft:"auto"},children:[l===C.id?t.jsx(N,{icon:"chevron-right",iconClass:"selected",iconSize:"lg",iconType:"fa-light"}):void 0,D>0?t.jsx(J,{tagLabel:D,variant:"default"}):void 0]})]})},`${C.id}-${f.random(1,10)}`)})]},k):void 0):t.jsx(Vt,{})})]})}),Sa=e=>{const[n,i]=u.useState({includeSearch:e,previousValue:""}),r=u.useCallback(o=>{i(s=>({...s,...o}))},[]);return{searchState:n,updateSearch:r}},za=()=>{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}},Ta=()=>{const[e,n]=u.useState(!1),i=u.useCallback(r=>{n(r)},[]);return{calendarState:{isOpen:e,updateCalendarState:i}}},Ia={text:({id:e,filterValue:n,onChange:i})=>t.jsx(_e,{name:e,onChange:i,value:n??""}),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(ue,{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(Vt,{}),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(N,{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(N,{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(Ft,{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(Nt,{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"})})}},yi=({id:e,filterValue:n,option:i,onChange:r})=>{const{items:o=[],type:s,minValue:l,maxValue:a}=i??{},c=s&&Ia[s],{calendarState:{updateCalendarState:d},scrollState:p,updateSearch:g,updateScrollHeight:x,searchValues:{search:h}}=u.useContext(Ue),b=u.useMemo(()=>o.filter(C=>{var z;return((z=C.label)==null?void 0:z.toLowerCase().includes(h.toLowerCase()))??!1}),[o,h]),m=f.useVirtualizer({count:b.length,estimateSize:()=>36,getScrollElement:()=>p.ref.current}),j=m.getVirtualItems(),v=u.useCallback(C=>{C.stopPropagation(),C.preventDefault(),r(C.target.value,s??"")},[r,s]),k=u.useCallback(C=>z=>{r(z,"dateRange",C)},[r]),S=u.useCallback(C=>z=>{z.stopPropagation(),z.preventDefault(),r(z.target.value,"numberRange",C)},[r]),w=u.useCallback(C=>()=>{r(C,"list")},[r]);return u.useEffect(()=>{g({includeSearch:o.length>hi}),s==="checkboxes"&&j.length>0?x(`${m.getTotalSize()}px`):s==="checkboxes"&&j.length===0&&x("fit-content")},[m,x,s,o.length,g,j.length]),t.jsx(t.Fragment,{children:(c==null?void 0:c({items:b,virtualItems:j,id:e,filterValue:n,onChange:v,onListChange:w,onRangeChange:k,onRangeNumberChange:S,ref:m.measureElement,updateCalendarState:d,minValue:l,maxValue:a}))??null})},Xe=e=>(e==null?void 0:e.split(",").filter(n=>n!==""))??[],bi=u.forwardRef(function({label:n,options:i},r){const o=y.useTheme(),{id:s,searchState:l,searchValues:{search:a},setSearchValues:c,values:d,setValues:p,scrollState:g}=u.useContext(Ue),{includeSearch:x}=l,{height:h,ref:b}=g,m=h!=="fit-content",j=d[s],v=u.useCallback(()=>{p(w=>({...w,[s]:null}))},[p,s]),k=u.useCallback(w=>{c({search:w.target.value})},[c]),S=u.useCallback((w,C,z)=>{p(D=>{if(C==="checkboxes"){const E=Xe(D[s]??""),R=E!=null&&E.includes(w)?E==null?void 0:E.filter(T=>T!==w).join(","):[...E,w].join(",");return{...D,[s]:R}}if(C==="dateRange"){const E=Xe(D[s]??""),R=E.filter(O=>O!=="-"&&!RegExp(/^\d+\-\d+\-\d+$/).test(O.trim())),T=E.filter(O=>f.dayjs(O).isValid()&&f.dayjs(O).isAfter(f.dayjs("1903-01-01"))),F=f.dayjs(w,"YYYY-MM-DD",!0),A=["-","-"];return T.length===2?(A[0]=T[0],A[1]=T[1]):T.length===1&&(F.isAfter(f.dayjs(T[0]))?(A[0]=T[0],A[1]=w):(A[0]=w,A[1]=T[0])),A[z??0]=w,{...D,[s]:[...R,...A].join(",")}}if(C==="numberRange"){const E=Xe(D[s]??""),R=E.filter(A=>!RegExp(/^\d+$/).test(A)),T=E.map(Number).filter(A=>f.lodashExports.isNumber(A)&&!f.lodashExports.isNaN(A)),F=[T[0]??"",T[1]??""];return F[z??0]=Number(w),{...D,[s]:[...R,...F].join(",")}}if(C==="list"){const R=Xe(D[s]??"").filter(T=>T==="-"||RegExp(/^\d+$/).test(T)||RegExp(/^\d+\-\d+\-\d+$/).test(T.trim()));return{...D,[s]:[...R,w].join(",")}}return{...D,[s]:w}})},[s,p]);return t.jsxs(gi,{$left:"346px","data-testid":"options-menu",ref:r,children:[t.jsxs(ui,{style:{paddingBottom:x&&m?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}`}),j?t.jsx(xi,{$variant:"lowRelevance",onClick:v,type:"button",children:"Reset all"}):void 0]}),x?t.jsx(xe,{name:"options-search",onChange:k,placeholder:`Search ${n}...`,value:a}):void 0]}),t.jsx($,{"data-testid":"options-scrollable-menu",ref:b,scroll:"y",width:"100%",children:i==null?void 0:i.map((w,C,z)=>t.jsx("div",{style:{...w.type==="checkboxes"?{height:h,...m?{margin:x?` 0 ${o.spacing[.875]} ${o.spacing[.875]} ${o.spacing[.875]}`:o.spacing[.875],width:"90%"}:{}}:{},position:"relative"},children:t.jsxs(Wt,{$border:z.length>1&&C>0,style:{padding:m?o.spacing[.875]:0},children:[C>0?t.jsx(I,{color:o.palette.gray[800],fontWeight:"bold",mb:.5,size:"md",children:w.label}):void 0,t.jsx(yi,{filterValue:j,id:s,onChange:S,option:w})]})},`${w.label}-${C}`))})]})}),Da=({filters:e})=>{const n=ve("filters"),{calendarState:i}=Ta(),{searchState:r,updateSearch:o}=Sa(!1),{scrollState:s,updateScrollHeight:l}=za(),[a,c]=f.useQueryState("filter",{history:"replace"}),[d,p]=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}=St({filters:e}),[j,v]=f.useQueryStates({searchGlobal:f.parseAsString.withDefault(""),search:f.parseAsString.withDefault("")}),{previousValue:k}=r,{label:S,options:w}=ka(e,d,k),C=va(e),z=f.isEmpty(a)||a===null||d!==a,D=u.useMemo(Cn,[]),E=u.useCallback(F=>{p(F),c(F)},[c]),R=u.useCallback(()=>{h===0&&!n.isOpen&&Ke(D),n.toggle(),c(null),v({searchGlobal:"",search:""})},[h,n,D,c,v]),T=u.useCallback(()=>{i.isOpen||(n.close(),c(null),v({searchGlobal:"",search:""}),h===0&&Ke(D))},[h,i.isOpen,n,D,c,v]);return oe(g.floating.current,T,!0,[g.reference.current,x.floating.current]),t.jsx(Ue.Provider,{value:{id:d,calendarState:i,searchState:r,values:b,scrollState:s,searchValues:j,setSearchValues:v,setValues:m,updateSearch:o,updateScrollHeight:l},children:t.jsxs($,{alignItems:"center",display:"flex",position:"relative",wrap:"wrap",children:[t.jsx(W,{"data-testid":"filter-btn",icon:"filter",id:"filter-btn",onClick:R,ref:g.setReference,tag:h.toString(),variant:"ghost"}),n.isOpen?ge.createPortal(t.jsx(fi,{groupedFilters:C,handleChangeId:E,includeSearch:e.length>hi,ref:g.setFloating}),document.body):void 0,z?void 0:ge.createPortal(t.jsx(bi,{label:S.toLowerCase(),options:w,ref:x.setFloating}),document.body)]})})},Ea=({children:e})=>{const n=f.useFormContext();return e({...n})},Fa=y.styled.form`
|
|
2585
|
+
`,Vt=()=>{const e=y.useTheme();return t.jsx(Wt,{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(N,{icon:"search",iconSize:"lg",mx:.5,my:.5})}),t.jsxs($,{alignItems:"center",display:"flex",flexDirection:"column",gap:.25,justify:"center",children:[t.jsx(Y,{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."})]})]})})},hi=7,va=e=>e.reduce((n,i)=>(i.group?(n[i.group]||(n[i.group]=[]),n[i.group].push(i)):n.default=[...n.default||[],i],n),{}),ka=(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((d,p)=>{const g=o.includes(d.value),x=o.includes(p.value);return g===x?0:g?-1:1});return{...a,items:c}});return{label:r.label,options:s}},Ca=(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),fi=u.forwardRef(function({includeSearch:n=!1,groupedFilters:i,handleChangeId:r},o){const s=y.useTheme(),[l,a]=u.useState(""),{searchValues:{searchGlobal:c},setSearchValues:d,values:p,updateSearch:g,setValues:x}=u.useContext(Ue),h=Ca(i,c),b=u.useMemo(()=>Object.values(p).filter(Boolean).length>0,[p]),m=u.useCallback(k=>()=>{r(k),a(k),g({previousValue:p[k]??""}),d({search:"",searchGlobal:""})},[r,g,d,p]),j=u.useCallback(()=>{x(k=>Object.keys(k).reduce((S,w)=>({...S,[w]:null}),{})),a("")},[x]),v=u.useCallback(k=>{d({searchGlobal:k.target.value})},[d]);return t.jsxs(gi,{"data-testid":"filters-menu",ref:o,children:[t.jsxs(ui,{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"}),b?t.jsx(xi,{$variant:"lowRelevance",onClick:j,type:"button",children:"Reset all"}):void 0]}),n?t.jsx(ue,{name:"filters-search",onChange:v,placeholder:"Search filter...",value:c}):void 0]}),t.jsx($,{alignItems:"flex-start",display:"flex",flexDirection:"column",scroll:"y",width:"100%",children:h.length>0?h.map(({group:k,filters:S},w)=>S.length>0?t.jsxs(Wt,{$border:w>0&&k!=="default","data-testid":`${k?`menu-${f.snakeCase(k)}`:"menu-content"}`,children:[k!=="default"?t.jsx(I,{color:s.palette.gray[400],fontWeight:"bold",mb:.5,size:"md",children:k}):void 0,S.map(C=>{const D=p[C.id].split(",").filter(E=>E&&E!=="-").length.toString();return t.jsx(u.Fragment,{children:t.jsxs(Ie,{as:"button","data-testid":C.id,onClick:m(C.id),children:[t.jsx(N,{icon:"filter",iconClass:"filter-item",iconSize:"md",iconType:"fa-light"}),C.label,t.jsxs($,{alignItems:"center",display:"flex",gap:.5,style:{marginLeft:"auto"},children:[l===C.id?t.jsx(N,{icon:"chevron-right",iconClass:"selected",iconSize:"lg",iconType:"fa-light"}):void 0,D>0?t.jsx(J,{tagLabel:D,variant:"default"}):void 0]})]})},`${C.id}-${f.random(1,10)}`)})]},k):void 0):t.jsx(Vt,{})})]})}),Sa=e=>{const[n,i]=u.useState({includeSearch:e,previousValue:""}),r=u.useCallback(o=>{i(s=>({...s,...o}))},[]);return{searchState:n,updateSearch:r}},za=()=>{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}},Ta=()=>{const[e,n]=u.useState(!1),i=u.useCallback(r=>{n(r)},[]);return{calendarState:{isOpen:e,updateCalendarState:i}}},Ia={text:({id:e,filterValue:n,onChange:i})=>t.jsx(_e,{name:e,onChange:i,value:n??""}),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(ge,{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(Vt,{}),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(N,{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(N,{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(Ft,{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(Nt,{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"})})}},yi=({id:e,filterValue:n,option:i,onChange:r})=>{const{items:o=[],type:s,minValue:l,maxValue:a}=i??{},c=s&&Ia[s],{calendarState:{updateCalendarState:d},scrollState:p,updateSearch:g,updateScrollHeight:x,searchValues:{search:h}}=u.useContext(Ue),b=u.useMemo(()=>o.filter(C=>{var z;return((z=C.label)==null?void 0:z.toLowerCase().includes(h.toLowerCase()))??!1}),[o,h]),m=f.useVirtualizer({count:b.length,estimateSize:()=>36,getScrollElement:()=>p.ref.current}),j=m.getVirtualItems(),v=u.useCallback(C=>{C.stopPropagation(),C.preventDefault(),r(C.target.value,s??"")},[r,s]),k=u.useCallback(C=>z=>{r(z,"dateRange",C)},[r]),S=u.useCallback(C=>z=>{z.stopPropagation(),z.preventDefault(),r(z.target.value,"numberRange",C)},[r]),w=u.useCallback(C=>()=>{r(C,"list")},[r]);return u.useEffect(()=>{g({includeSearch:o.length>hi}),s==="checkboxes"&&j.length>0?x(`${m.getTotalSize()}px`):s==="checkboxes"&&j.length===0&&x("fit-content")},[m,x,s,o.length,g,j.length]),t.jsx(t.Fragment,{children:(c==null?void 0:c({items:b,virtualItems:j,id:e,filterValue:n,onChange:v,onListChange:w,onRangeChange:k,onRangeNumberChange:S,ref:m.measureElement,updateCalendarState:d,minValue:l,maxValue:a}))??null})},Xe=e=>(e==null?void 0:e.split(",").filter(n=>n!==""))??[],bi=u.forwardRef(function({label:n,options:i},r){const o=y.useTheme(),{id:s,searchState:l,searchValues:{search:a},setSearchValues:c,values:d,setValues:p,scrollState:g}=u.useContext(Ue),{includeSearch:x}=l,{height:h,ref:b}=g,m=h!=="fit-content",j=d[s],v=u.useCallback(()=>{p(w=>({...w,[s]:null}))},[p,s]),k=u.useCallback(w=>{c({search:w.target.value})},[c]),S=u.useCallback((w,C,z)=>{p(D=>{if(C==="checkboxes"){const E=Xe(D[s]??""),R=E!=null&&E.includes(w)?E==null?void 0:E.filter(T=>T!==w).join(","):[...E,w].join(",");return{...D,[s]:R}}if(C==="dateRange"){const E=Xe(D[s]??""),R=E.filter(O=>O!=="-"&&!RegExp(/^\d+\-\d+\-\d+$/).test(O.trim())),T=E.filter(O=>f.dayjs(O).isValid()&&f.dayjs(O).isAfter(f.dayjs("1903-01-01"))),F=f.dayjs(w,"YYYY-MM-DD",!0),A=["-","-"];return T.length===2?(A[0]=T[0],A[1]=T[1]):T.length===1&&(F.isAfter(f.dayjs(T[0]))?(A[0]=T[0],A[1]=w):(A[0]=w,A[1]=T[0])),A[z??0]=w,{...D,[s]:[...R,...A].join(",")}}if(C==="numberRange"){const E=Xe(D[s]??""),R=E.filter(A=>!RegExp(/^\d+$/).test(A)),T=E.map(Number).filter(A=>f.lodashExports.isNumber(A)&&!f.lodashExports.isNaN(A)),F=[T[0]??"",T[1]??""];return F[z??0]=Number(w),{...D,[s]:[...R,...F].join(",")}}if(C==="list"){const R=Xe(D[s]??"").filter(T=>T==="-"||RegExp(/^\d+$/).test(T)||RegExp(/^\d+\-\d+\-\d+$/).test(T.trim()));return{...D,[s]:[...R,w].join(",")}}return{...D,[s]:w}})},[s,p]);return t.jsxs(gi,{$left:"346px","data-testid":"options-menu",ref:r,children:[t.jsxs(ui,{style:{paddingBottom:x&&m?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}`}),j?t.jsx(xi,{$variant:"lowRelevance",onClick:v,type:"button",children:"Reset all"}):void 0]}),x?t.jsx(ue,{name:"options-search",onChange:k,placeholder:`Search ${n}...`,value:a}):void 0]}),t.jsx($,{"data-testid":"options-scrollable-menu",ref:b,scroll:"y",width:"100%",children:i==null?void 0:i.map((w,C,z)=>t.jsx("div",{style:{...w.type==="checkboxes"?{height:h,...m?{margin:x?` 0 ${o.spacing[.875]} ${o.spacing[.875]} ${o.spacing[.875]}`:o.spacing[.875],width:"90%"}:{}}:{},position:"relative"},children:t.jsxs(Wt,{$border:z.length>1&&C>0,style:{padding:m?o.spacing[.875]:0},children:[C>0?t.jsx(I,{color:o.palette.gray[800],fontWeight:"bold",mb:.5,size:"md",children:w.label}):void 0,t.jsx(yi,{filterValue:j,id:s,onChange:S,option:w})]})},`${w.label}-${C}`))})]})}),Da=({filters:e})=>{const n=ve("filters"),{calendarState:i}=Ta(),{searchState:r,updateSearch:o}=Sa(!1),{scrollState:s,updateScrollHeight:l}=za(),[a,c]=f.useQueryState("filter",{history:"replace"}),[d,p]=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}=St({filters:e}),[j,v]=f.useQueryStates({searchGlobal:f.parseAsString.withDefault(""),search:f.parseAsString.withDefault("")}),{previousValue:k}=r,{label:S,options:w}=ka(e,d,k),C=va(e),z=f.isEmpty(a)||a===null||d!==a,D=u.useMemo(Cn,[]),E=u.useCallback(F=>{p(F),c(F)},[c]),R=u.useCallback(()=>{h===0&&!n.isOpen&&Ke(D),n.toggle(),c(null),v({searchGlobal:"",search:""})},[h,n,D,c,v]),T=u.useCallback(()=>{i.isOpen||(n.close(),c(null),v({searchGlobal:"",search:""}),h===0&&Ke(D))},[h,i.isOpen,n,D,c,v]);return oe(g.floating.current,T,!0,[g.reference.current,x.floating.current]),t.jsx(Ue.Provider,{value:{id:d,calendarState:i,searchState:r,values:b,scrollState:s,searchValues:j,setSearchValues:v,setValues:m,updateSearch:o,updateScrollHeight:l},children:t.jsxs($,{alignItems:"center",display:"flex",position:"relative",wrap:"wrap",children:[t.jsx(W,{"data-testid":"filter-btn",icon:"filter",id:"filter-btn",onClick:R,ref:g.setReference,tag:h.toString(),variant:"ghost"}),n.isOpen?t.jsx(fi,{groupedFilters:C,handleChangeId:E,includeSearch:e.length>hi,ref:g.setFloating}):void 0,z?void 0:t.jsx(bi,{label:S.toLowerCase(),options:w,ref:x.setFloating})]})})},Ea=({children:e})=>{const n=f.useFormContext();return e({...n})},Fa=y.styled.form`
|
|
2586
2586
|
${({theme:e})=>`
|
|
2587
2587
|
align-items: flex-start;
|
|
2588
2588
|
align-self: stretch;
|
|
@@ -2648,7 +2648,7 @@ ${m[8]}...`:(m.length<8&&p(!1),i)},[a,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2648
2648
|
background-color: ${e.palette.gray[100]};
|
|
2649
2649
|
}
|
|
2650
2650
|
`}
|
|
2651
|
-
`,$i=({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(N,{icon:"check",iconColor:r.palette.gray[800],iconSize:"lg"}):null,t.jsx(I,{color:r.palette.gray[800],fontWeight:"bold",size:"md",children:n})]})},Ze=100,Pa=({isOpen:e=!0,items:n,handleNewOrganization:i,onSelect:r,onClose:o,selectedItem:s,title:l,variant:a})=>{const c=y.useTheme(),[d,p]=u.useState(n),[g,x]=u.useState(""),h=u.useCallback(v=>{if(!v){p(n);return}const k=v.slice(0,Ze);p(S=>{const w=k.toLowerCase();return S.filter(C=>{const z=String(C.name).toLowerCase();return z.startsWith(w)||z.includes(w)})})},[p,n]),b=u.useCallback(v=>{if(v.currentTarget){const k=v.currentTarget.value.slice(0,Ze);x(k),h(k)}},[x,h]),m=u.useCallback(v=>{const k=v.target.value.slice(0,Ze);x(k),h(k)},[x,h]);u.useEffect(()=>{e&&(x(""),p(n))},[e,n]),u.useEffect(()=>{g?h(g):p(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(Aa,{$itemsLength:d.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(H,{icon:"xmark",iconColor:c.palette.gray[400],iconSize:"lg",iconType:"fa-light",onClick:o,variant:"ghost"})]}),t.jsx($,{mt:1,children:t.jsx(
|
|
2651
|
+
`,$i=({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(N,{icon:"check",iconColor:r.palette.gray[800],iconSize:"lg"}):null,t.jsx(I,{color:r.palette.gray[800],fontWeight:"bold",size:"md",children:n})]})},Ze=100,Pa=({isOpen:e=!0,items:n,handleNewOrganization:i,onSelect:r,onClose:o,selectedItem:s,title:l,variant:a})=>{const c=y.useTheme(),[d,p]=u.useState(n),[g,x]=u.useState(""),h=u.useCallback(v=>{if(!v){p(n);return}const k=v.slice(0,Ze);p(S=>{const w=k.toLowerCase();return S.filter(C=>{const z=String(C.name).toLowerCase();return z.startsWith(w)||z.includes(w)})})},[p,n]),b=u.useCallback(v=>{if(v.currentTarget){const k=v.currentTarget.value.slice(0,Ze);x(k),h(k)}},[x,h]),m=u.useCallback(v=>{const k=v.target.value.slice(0,Ze);x(k),h(k)},[x,h]);u.useEffect(()=>{e&&(x(""),p(n))},[e,n]),u.useEffect(()=>{g?h(g):p(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(Aa,{$itemsLength:d.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(H,{icon:"xmark",iconColor:c.palette.gray[400],iconSize:"lg",iconType:"fa-light",onClick:o,variant:"ghost"})]}),t.jsx($,{mt:1,children:t.jsx(ue,{maxLength:Ze,onChange:m,onInput:b,placeholder:"Search",value:g})}),t.jsx(je,{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(N,{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,d.map(v=>t.jsx($i,{isSelected:s.toLowerCase()===v.name,label:v.name.charAt(0).toUpperCase()+v.name.slice(1),onSelect:r},v.name))]})]})})});return e?we.createPortal(j,document.body):t.jsx("div",{})},Oa=y.styled.div`
|
|
2652
2652
|
${({theme:e,$backgroundColor:n=e.palette.white})=>`
|
|
2653
2653
|
align-items: flex-start;
|
|
2654
2654
|
display: flex;
|
|
@@ -2777,7 +2777,7 @@ ${m[8]}...`:(m.length<8&&p(!1),i)},[a,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2777
2777
|
height: ${e}px;
|
|
2778
2778
|
width: ${e}px;
|
|
2779
2779
|
`}
|
|
2780
|
-
`,rl=e=>{const{size:n}=e;return t.jsx(il,{$size:n,...e})},ol=({children:e,commitSha:n,commitShortSha:i,parentElement:r,userInfo:o,setVisibility:s})=>{const l=y.useTheme(),{userName:a,email:c,phone:d,userRole:p}=o;return oe(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(d)?void 0:t.jsx(I,{color:l.palette.gray[400],size:"md",children:d})]}),t.jsx($,{children:t.jsx(J,{tagLabel:p,variant:"role"})})]})}),t.jsx(
|
|
2780
|
+
`,rl=e=>{const{size:n}=e;return t.jsx(il,{$size:n,...e})},ol=({children:e,commitSha:n,commitShortSha:i,parentElement:r,userInfo:o,setVisibility:s})=>{const l=y.useTheme(),{userName:a,email:c,phone:d,userRole:p}=o;return oe(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(d)?void 0:t.jsx(I,{color:l.palette.gray[400],size:"md",children:d})]}),t.jsx($,{children:t.jsx(J,{tagLabel:p,variant:"role"})})]})}),t.jsx(je,{}),e,t.jsx(je,{}),t.jsx("li",{className:"commit-info",children:t.jsx(ce,{href:`https://github.com/fluidattacks/universe/tree/${n}`,iconPosition:"hidden",children:t.jsx(I,{color:l.palette.gray[400],size:"sm",children:`commit : ${i}`})})})]})},sl=y.styled.button`
|
|
2781
2781
|
align-items: center;
|
|
2782
2782
|
background-color: transparent;
|
|
2783
2783
|
border: unset;
|
|
@@ -2939,7 +2939,7 @@ ${m[8]}...`:(m.length<8&&p(!1),i)},[a,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2939
2939
|
flex-flow: row wrap;
|
|
2940
2940
|
}
|
|
2941
2941
|
`}
|
|
2942
|
-
`,Cl=150,Sl=({label:e,minWidth:n=Cl,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"},d=i==="disabled";return t.jsxs($,{display:"inline-flex",flexDirection:l==="horizontal"?"column":"row",minWidth:`${n}px`,children:[t.jsx(Rt,{minWidth:n,orientation:l,percentage:d||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(Si,{onClick:s}):t.jsx(vl,{$variant:i,clickable:!d,disabled:d,icon:c[i],iconColor:zi(i,a),iconSize:"lg",iconType:"fa-light",onClick:d?void 0:s}),t.jsxs($,{children:[t.jsx(I,{color:a.palette.gray[d?300:800],fontWeight:"bold",size:"md",children:`${r}.${o}`}),e===void 0?null:t.jsx(I,{color:a.palette.gray[d?300:600],size:"sm",children:e})]})]})]})},zl=150,Tl=({children:e,orientation:n="horizontal",minWidth:i=zl})=>{const r=u.Children.toArray(e),o=u.useMemo(()=>u.Children.count(e),[e]),s=u.useMemo(()=>o*i,[o,i]);return t.jsx(kl,{$minWidth:`${s}px`,$orientation:n,children:r.map(l=>u.cloneElement(l,{minWidth:i,orientation:n}))})},Ti=({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(
|
|
2942
|
+
`,Cl=150,Sl=({label:e,minWidth:n=Cl,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"},d=i==="disabled";return t.jsxs($,{display:"inline-flex",flexDirection:l==="horizontal"?"column":"row",minWidth:`${n}px`,children:[t.jsx(Rt,{minWidth:n,orientation:l,percentage:d||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(Si,{onClick:s}):t.jsx(vl,{$variant:i,clickable:!d,disabled:d,icon:c[i],iconColor:zi(i,a),iconSize:"lg",iconType:"fa-light",onClick:d?void 0:s}),t.jsxs($,{children:[t.jsx(I,{color:a.palette.gray[d?300:800],fontWeight:"bold",size:"md",children:`${r}.${o}`}),e===void 0?null:t.jsx(I,{color:a.palette.gray[d?300:600],size:"sm",children:e})]})]})]})},zl=150,Tl=({children:e,orientation:n="horizontal",minWidth:i=zl})=>{const r=u.Children.toArray(e),o=u.useMemo(()=>u.Children.count(e),[e]),s=u.useMemo(()=>o*i,[o,i]);return t.jsx(kl,{$minWidth:`${s}px`,$orientation:n,children:r.map(l=>u.cloneElement(l,{minWidth:i,orientation:n}))})},Ti=({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($e,{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($e,{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})},Il=({_portal:e=!1,cancelButton:n,darkBackground:i=!1,children:r,confirmButton:o,container:s,description:l,highlightDescription:a="",image:c,maxWidth:d,mobile:p=!1,title:g,titleColor:x})=>{const h=y.useTheme(),{alt:b,src:m,width:j="77px",height:v="77px"}=c,k=u.useCallback(()=>{n==null||n.onClick()},[n]),S=u.useCallback(()=>{o==null||o.onClick()},[o]),w=t.jsx(Y,{color:x,fontWeight:"bold",lineSpacing:p?1.5:2.5,mb:p?1.5:0,size:p?"sm":"md",textAlign:p?"start":"center",children:g}),C=t.jsx(se,{alt:b,height:v,publicId:m,width:j}),z=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:d,position:"relative",px:p?1.5:2.5,py:p?1.5:2.5,shadow:"lg",width:p?"335px":"100%",zIndex:11,children:[t.jsxs($,{alignItems:"center",display:"flex",flexDirection:"column",width:"100%",children:[p?w:void 0,p?t.jsx($,{alignItems:"center",height:v,justify:"center",mr:0,children:t.jsx($,{bgColor:h.palette.gray[100],left:"0",position:"absolute",textAlign:"center",width:"100%",children:C})}):C,t.jsxs($,{display:"flex",flexDirection:"column",gap:.5,mb:1.5,mt:1.5,children:[p?void 0:w,t.jsx(Ti,{description:l,highlightDescription:a,mobile:p})]})]}),r&&t.jsx($,{mb:1,scroll:"y",children:t.jsx($,{height:"100%",children:r})}),t.jsxs($,{alignItems:"flex-start",display:"flex",gap:1,justify:p?"start":"center",children:[f.lodashExports.isObject(o)?t.jsx(W,{onClick:S,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(W,{onClick:k,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?we.createPortal(z,s??document.body):z},Dl={md:{methodIdSize:"sm",titleSize:"xs",detailsSize:"md"},lg:{methodIdSize:"md",titleSize:"sm",detailsSize:"lg"}},El=({technology:e,technique:n,cwes:i,href:r,id:o,indx:s,Link:l,target:a,lastUpdated:c,score:d,size:p="lg",severity:g,title:x})=>{const h=y.useTheme(),{methodIdSize:b,titleSize:m,detailsSize:j}=Dl[p],v=l??"a";return t.jsxs(zt,{$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(J,{tagLabel:n})]}),t.jsx(v,{href:r,children:t.jsx(Y,{fontWeight:"bold",size:m,children:x})})]}),t.jsxs($,{alignItems:p==="md"?"flex-start":"center",display:"flex",flexDirection:p==="md"?"column":"row",gap:.75,width:"fit-content",children:[t.jsx(it,{textL:d,textR:f.capitalize(g==="disable"?"Unknown":g),variant:g}),t.jsxs(t.Fragment,{children:[p==="lg"?t.jsx(ae,{}):void 0,t.jsxs(I,{color:h.palette.gray[400],size:j,whiteSpace:"nowrap",children:[t.jsx("b",{children:"Target: "}),a]})]}),t.jsxs(t.Fragment,{children:[p==="lg"?t.jsx(ae,{}):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:[p==="lg"?t.jsx(ae,{}):void 0,t.jsx(I,{color:h.palette.gray[400],fontWeight:"bold",size:j,whiteSpace:"nowrap",children:"CWE ID(s): "}),i.map((k,S)=>t.jsxs(u.Fragment,{children:[S>0?t.jsx(I,{color:h.palette.gray[400],size:j,whiteSpace:"nowrap",children:" , "}):void 0,t.jsx(v,{href:k.href,children:t.jsx(I,{color:h.palette.gray[400],size:j,textDecoration:"underline",whiteSpace:"nowrap",children:k.key})})]},k.key))]}),c?t.jsxs(t.Fragment,{children:[p==="lg"?t.jsx(ae,{}):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]})]})},Fl=y.styled.div.attrs({className:"comp-scroll-up"})`
|
|
2943
2943
|
position: fixed;
|
|
2944
2944
|
bottom: ${({bottom:e})=>e??"unset"};
|
|
2945
2945
|
right: ${({right:e})=>e??"unset"};
|
|
@@ -3581,7 +3581,7 @@ ${m[8]}...`:(m.length<8&&p(!1),i)},[a,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3581
3581
|
.highlight-container ~ .controls-container {
|
|
3582
3582
|
flex: 1 0 100%;
|
|
3583
3583
|
}
|
|
3584
|
-
`,mc=500,yn=300,Vi=({children:e})=>{const{table:n}=u.useContext(de),{onSearch:i,search:r,searchPlaceholder:o="Search"}=(n==null?void 0:n.options.meta)??{},s=Ct(a=>{const c=a.target.value.slice(0,yn);i==null||i(c)},mc),l=u.useCallback(()=>{i==null||i("")},[i]);return t.jsxs($c,{children:[i===void 0?void 0:t.jsx(yc,{children:t.jsx(
|
|
3584
|
+
`,mc=500,yn=300,Vi=({children:e})=>{const{table:n}=u.useContext(de),{onSearch:i,search:r,searchPlaceholder:o="Search"}=(n==null?void 0:n.options.meta)??{},s=Ct(a=>{const c=a.target.value.slice(0,yn);i==null||i(c)},mc),l=u.useCallback(()=>{i==null||i("")},[i]);return t.jsxs($c,{children:[i===void 0?void 0:t.jsx(yc,{children:t.jsx(ue,{maxLength:yn,name:"search",onChange:s,onClear:l,placeholder:o,value:r})}),e]})},Mi=({children:e})=>t.jsx($,{display:"flex",flexDirection:"column",children:t.jsx("div",{className:"caption-container",children:e})}),_i=({children:e})=>t.jsx(bc,{children:e}),Hi=({children:e})=>t.jsx("div",{className:"highlight-container",children:e}),jc=160,Ui=({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,d=Math.max(((x=i.current)==null?void 0:x.clientWidth)??0,n.getTotalSize()+jc),p=u.useCallback(()=>{n.resetRowSelection()},[n]),g=u.useCallback(h=>{h.key==="Enter"&&p()},[p]);return u.useEffect(()=>{n.setPageIndex(0)},[n]),t.jsx(de.Provider,{value:{containerRef:i,elementName:a,handleUnselectAll:p,hidden:c,onKeyDown:g,selected:l,tableSize:d,tableRef:r,table:n},children:t.jsx(cc,{id:o,children:e})})},wc=Object.assign(Ui,{Caption:Mi,Columns:Fi,Content:Li,Controls:_i,Export:Ei,Footer:Bi,FooterContent:Wi,Highlighted:Hi,Options:Vi}),vc=y.styled.button`
|
|
3585
3585
|
${({theme:e})=>`
|
|
3586
3586
|
align-items: center;
|
|
3587
3587
|
background-color: ${e.palette.white};
|
|
@@ -3724,4 +3724,4 @@ ${m[8]}...`:(m.length<8&&p(!1),i)},[a,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
3724
3724
|
transform: translateX(-50%);
|
|
3725
3725
|
}
|
|
3726
3726
|
`}
|
|
3727
|
-
`,Gi=({date:e,description:n,title:i})=>{const r=y.useTheme();return t.jsxs(Tc,{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)})})]})},Dc=({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(Ic,{$size:i,children:e.map((o,s)=>t.jsx(Gi,{date:o.date,description:o.description,size:i,title:o.title},`${o.title}-${s}`))})})},Ec={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:""},Fc=({run:e,steps:n,onFinish:i})=>{const[r,o]=u.useState(e),[s,l]=u.useState(0),a=u.useCallback(c=>{const{action:d,index:p,status:g,type:x}=c;[f.EVENTS.STEP_AFTER,f.EVENTS.TARGET_NOT_FOUND].includes(x)?l(p+(d===f.ACTIONS.PREV?-1:1)):([f.STATUS.FINISHED,f.STATUS.SKIPPED].includes(g)||d==="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}}})},Rc={md:{categorySize:"sm",titleSize:"xs",descriptionSize:"md",detailsSize:"md"},lg:{categorySize:"md",titleSize:"sm",descriptionSize:"lg",detailsSize:"lg"}},Nc=({title:e,href:n,description:i,category:r,id:o,indx:s,remediationTime:l,score:a,severity:c,size:d="lg",requirements:p,Link:g})=>{const x=y.useTheme(),{categorySize:h,titleSize:b,descriptionSize:m,detailsSize:j}=Rc[d],v=g??"a";return t.jsxs(zt,{$index:s,children:[t.jsx(I,{bgGradient:x.palette.gradient,fontWeight:"bold",size:h,textFill:"transparent",children:r}),t.jsxs(v,{href:n,children:[t.jsx(Y,{color:x.palette.gray[400],display:"inline",fontWeight:"bold",size:b,children:o}),t.jsx(Y,{display:"inline",fontWeight:"bold",ml:.25,size:b,children:e})]}),t.jsx(I,{size:m,children:i}),t.jsxs($,{alignItems:d==="md"?"flex-start":"center",display:"flex",flexDirection:d==="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`]}),d==="lg"?t.jsx(ae,{}):void 0,t.jsxs($,{alignItems:d==="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(it,{textL:a,textR:f.capitalize(c==="disable"?"Unknown":c),variant:c})]}),d==="lg"?t.jsx(ae,{}):void 0,t.jsxs($,{alignItems:"center",children:[t.jsx(I,{color:x.palette.gray[400],display:"inline",fontWeight:"bold",size:j,children:"Requirements: "}),p.map((k,S)=>t.jsxs(u.Fragment,{children:[S>0?t.jsx(I,{color:x.palette.gray[400],display:"inline",size:j,children:" / "}):void 0,t.jsx("a",{href:k.href,style:{color:x.palette.gray[400],fontSize:x.typography.text[j],textDecoration:"underline"},children:k.title})]},k.key))]})]})]})};exports.Accordion=Cr;exports.AccordionContent=jn;exports.ActionButton=ze;exports.ActiveFilter=pi;exports.ActiveFilters=wa;exports.AdvancedBadge=Dr;exports.AdvisoriesCard=Vr;exports.Alert=Jr;exports.AppliedFilter=Te;exports.AppliedFilters=Qs;exports.ArrayField=ft;exports.Avatar=ao;exports.BaseButtonComponent=wt;exports.BaseComponent=Me;exports.BaseSpanComponent=kt;exports.BaseTextComponent=vt;exports.Body=Ni;exports.Button=W;exports.Button$1=Qe;exports.Button$2=pe;exports.ButtonToolbarCenter=Ao;exports.ButtonToolbarRow=Oo;exports.ButtonToolbarStartRow=Po;exports.Calendar=Rn;exports.Calendar$1=On;exports.Calendar$2=Bn;exports.CalendarCell=Fn;exports.CalendarGrid=ot;exports.CaptionContent=Mi;exports.CardContainer=ks;exports.CardHeader=rt;exports.CardWithImage=po;exports.CardWithInput=xs;exports.CardWithOptions=Hn;exports.CardWithSelector=bs;exports.CardWithSwitch=js;exports.Carousel=Ds;exports.Checkbox=
|
|
3727
|
+
`,Gi=({date:e,description:n,title:i})=>{const r=y.useTheme();return t.jsxs(Tc,{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)})})]})},Dc=({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(Ic,{$size:i,children:e.map((o,s)=>t.jsx(Gi,{date:o.date,description:o.description,size:i,title:o.title},`${o.title}-${s}`))})})},Ec={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:""},Fc=({run:e,steps:n,onFinish:i})=>{const[r,o]=u.useState(e),[s,l]=u.useState(0),a=u.useCallback(c=>{const{action:d,index:p,status:g,type:x}=c;[f.EVENTS.STEP_AFTER,f.EVENTS.TARGET_NOT_FOUND].includes(x)?l(p+(d===f.ACTIONS.PREV?-1:1)):([f.STATUS.FINISHED,f.STATUS.SKIPPED].includes(g)||d==="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}}})},Rc={md:{categorySize:"sm",titleSize:"xs",descriptionSize:"md",detailsSize:"md"},lg:{categorySize:"md",titleSize:"sm",descriptionSize:"lg",detailsSize:"lg"}},Nc=({title:e,href:n,description:i,category:r,id:o,indx:s,remediationTime:l,score:a,severity:c,size:d="lg",requirements:p,Link:g})=>{const x=y.useTheme(),{categorySize:h,titleSize:b,descriptionSize:m,detailsSize:j}=Rc[d],v=g??"a";return t.jsxs(zt,{$index:s,children:[t.jsx(I,{bgGradient:x.palette.gradient,fontWeight:"bold",size:h,textFill:"transparent",children:r}),t.jsxs(v,{href:n,children:[t.jsx(Y,{color:x.palette.gray[400],display:"inline",fontWeight:"bold",size:b,children:o}),t.jsx(Y,{display:"inline",fontWeight:"bold",ml:.25,size:b,children:e})]}),t.jsx(I,{size:m,children:i}),t.jsxs($,{alignItems:d==="md"?"flex-start":"center",display:"flex",flexDirection:d==="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`]}),d==="lg"?t.jsx(ae,{}):void 0,t.jsxs($,{alignItems:d==="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(it,{textL:a,textR:f.capitalize(c==="disable"?"Unknown":c),variant:c})]}),d==="lg"?t.jsx(ae,{}):void 0,t.jsxs($,{alignItems:"center",children:[t.jsx(I,{color:x.palette.gray[400],display:"inline",fontWeight:"bold",size:j,children:"Requirements: "}),p.map((k,S)=>t.jsxs(u.Fragment,{children:[S>0?t.jsx(I,{color:x.palette.gray[400],display:"inline",size:j,children:" / "}):void 0,t.jsx("a",{href:k.href,style:{color:x.palette.gray[400],fontSize:x.typography.text[j],textDecoration:"underline"},children:k.title})]},k.key))]})]})]})};exports.Accordion=Cr;exports.AccordionContent=jn;exports.ActionButton=ze;exports.ActiveFilter=pi;exports.ActiveFilters=wa;exports.AdvancedBadge=Dr;exports.AdvisoriesCard=Vr;exports.Alert=Jr;exports.AppliedFilter=Te;exports.AppliedFilters=Qs;exports.ArrayField=ft;exports.Avatar=ao;exports.BaseButtonComponent=wt;exports.BaseComponent=Me;exports.BaseSpanComponent=kt;exports.BaseTextComponent=vt;exports.Body=Ni;exports.Button=W;exports.Button$1=Qe;exports.Button$2=pe;exports.ButtonToolbarCenter=Ao;exports.ButtonToolbarRow=Oo;exports.ButtonToolbarStartRow=Po;exports.Calendar=Rn;exports.Calendar$1=On;exports.Calendar$2=Bn;exports.CalendarCell=Fn;exports.CalendarGrid=ot;exports.CaptionContent=Mi;exports.CardContainer=ks;exports.CardHeader=rt;exports.CardWithImage=po;exports.CardWithInput=xs;exports.CardWithOptions=Hn;exports.CardWithSelector=bs;exports.CardWithSwitch=js;exports.Carousel=Ds;exports.Checkbox=ge;exports.CodeSnippet=Fs;exports.Col=ht;exports.ColumFilters=ai;exports.ColumnToggle=Fi;exports.ColumnsModal=ni;exports.ComboBox=Dt;exports.ComboBoxField=xt;exports.Container=$;exports.ControlsContent=_i;exports.CopyButton=da;exports.CustomThemeProvider=yr;exports.DateField=Ln;exports.DateSelector=Ee;exports.DefaultInputFile=Vn;exports.Description=Ti;exports.Dialog=at;exports.Divider=je;exports.Dropdown=ua;exports.DropzoneInputFile=Mn;exports.Editable=Lo;exports.EmptyButton=$t;exports.EmptyState=ya;exports.ErrorMessage=ho;exports.ExportCsv=Ei;exports.FATag=Sn;exports.FilePreview=In;exports.FilterControl=ii;exports.FilterForm=bt;exports.FilterFormContent=ri;exports.Filters=Da;exports.FiltersContext=Ue;exports.FiltersList=si;exports.FiltersMenu=fi;exports.FooterContent=Wi;exports.Form=Ra;exports.Gap=Vo;exports.GridContainer=La;exports.GroupSelector=Pa;exports.Head=Ri;exports.Header=st;exports.Header$1=qn;exports.Heading=Y;exports.HighlightedContent=Hi;exports.Icon=N;exports.IconButton=H;exports.InProgressIcon=Si;exports.IndicatorCard=ws;exports.IndicatorCardDB=Ba;exports.InfoSidebar=Wa;exports.InnerForm=Ea;exports.InputArray=_o;exports.InputDate=Pn;exports.InputDateRange=Ft;exports.InputDateTime=No;exports.InputFile=is;exports.InputNumber=_n;exports.InputNumberRange=Nt;exports.InputSection=rs;exports.InputTags=ss;exports.ItemCardDB=Ha;exports.ItemContent=Cc;exports.Label=It;exports.Link=ce;exports.ListItem=He;exports.ListItemsWrapper=Qn;exports.LittleFlag=Ga;exports.Loading=mi;exports.LocationCode=Yn;exports.Logo=nl;exports.Lottie=rl;exports.MemoizedImage=se;exports.Menu=ol;exports.MenuItem=Ii;exports.MessageBanner=al;exports.Modal=Bt;exports.ModalConfirm=Kn;exports.ModalFooter=Zn;exports.NoMatches=Vt;exports.Notification=gl;exports.NotificationSign=Je;exports.NumberField=Re;exports.OAuthSelector=xl;exports.Option=Dn;exports.OptionBoxContainer=Mt;exports.OptionContainer=mt;exports.OptionContainer$1=$i;exports.Options=yi;exports.OptionsMenu=bi;exports.OutlineContainer=Q;exports.PaginationControl=Ai;exports.PaginationDropdown=Pi;exports.PaginationSize=Oi;exports.PaginatorDb=bl;exports.PaginatorDbDropdown=ji;exports.PhoneInput=gs;exports.PopUp=Il;exports.Popover=me;exports.PremiumFeature=wi;exports.PreviewPanel=ei;exports.PriorityCard=Ci;exports.PriorityCards=jl;exports.PriorityScore=wl;exports.ProgressBar=Rt;exports.ProgressIndicator=Tl;exports.ProgressStep=Sl;exports.RadioButton=Lt;exports.RankPosition=ki;exports.RankPositionIcon=vi;exports.Row=Wn;exports.RulesCard=El;exports.ScrollUpButton=Rl;exports.Search=ue;exports.SearchDropdown=Ml;exports.SearchPanel=ti;exports.SeverityBadge=it;exports.SeverityOverview=Hl;exports.SeverityOverviewBadge=De;exports.ShowOnHover=Gl;exports.SlideOutMenu=Xl;exports.Slider=ec;exports.SortIcon=jt;exports.Span=$e;exports.StepLapse=sc;exports.Tab=Jn;exports.Table=wc;exports.Table$1=Ui;exports.TableButton=kc;exports.TableContent=zc;exports.TableContent$1=Li;exports.TableContext=de;exports.TableFooter=Bi;exports.TableOptions=Vi;exports.Tabs=Pt;exports.Tag=J;exports.TagsField=yt;exports.Text=I;exports.TextArea=us;exports.TextInput=_e;exports.Thumb=Di;exports.TimeField=An;exports.TimeLine=Dc;exports.TimeLineCard=Gi;exports.Toggle=Un;exports.Tooltip=K;exports.Tour=Fc;exports.WeaknessesCard=Nc;exports.baseStep=Ec;exports.formatCheckValues=li;exports.getStyledConfig=Ve;exports.hiddenProps=bn;exports.icons=fr;exports.setBorder=Pe;exports.setDisplay=Oe;exports.setInteraction=We;exports.setMargin=Le;exports.setPadding=Ne;exports.setPosition=Ae;exports.setText=Be;exports.theme=L;exports.useCarousel=wn;exports.useClickOutside=oe;exports.useCloudinaryImage=vn;exports.useColumnsModal=kn;exports.useConditionsDialog=aa;exports.useConfirmDialog=la;exports.useDebouncedCallback=Ct;exports.useFilterForm=oi;exports.useFilters=sa;exports.useFiltersValues=St;exports.useModal=ve;exports.useSearch=Pr;exports.variantBuilder=le;
|