@tap-payments/os-micro-frontend-shared 0.3.171 → 0.3.173
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/build/_chunks/{chunk-C6VKE434.js → chunk-22MLKC6N.js} +1 -1
- package/build/_chunks/chunk-2GEJSH7A.js +2 -0
- package/build/_chunks/{chunk-HFYCWBSA.js → chunk-34ZHW63S.js} +1 -1
- package/build/_chunks/{chunk-TY5FA4Z6.js → chunk-36W7SQXA.js} +1 -1
- package/build/_chunks/{chunk-FYWEAGW7.js → chunk-3Y372LT6.js} +1 -1
- package/build/_chunks/{chunk-AALHIAWL.js → chunk-4DM7PNQX.js} +1 -1
- package/build/_chunks/{chunk-ZOO54PIG.js → chunk-4QJYZRZS.js} +1 -1
- package/build/_chunks/{chunk-ERYXQBTU.js → chunk-4XI2TEVH.js} +1 -1
- package/build/_chunks/{chunk-4BDCKXPD.js → chunk-5ES3XAUG.js} +1 -1
- package/build/_chunks/{chunk-7D6GNZ4V.js → chunk-6ZKYVDT4.js} +1 -1
- package/build/_chunks/{chunk-7YUGABD6.js → chunk-72LYLQAO.js} +1 -1
- package/build/_chunks/{chunk-SJCW4SLG.js → chunk-7SBQGNHM.js} +1 -1
- package/build/_chunks/{chunk-CBUJ5RW2.js → chunk-BBZTHC7L.js} +1 -1
- package/build/_chunks/{chunk-JVX2RO7Q.js → chunk-BIDKUCJX.js} +1 -1
- package/build/_chunks/{chunk-YTH72BBA.js → chunk-BZYJBEEP.js} +1 -1
- package/build/_chunks/{chunk-O6C2464W.js → chunk-C7ODXDT4.js} +1 -1
- package/build/_chunks/{chunk-BFBXNTIB.js → chunk-DGI5YXRN.js} +1 -1
- package/build/_chunks/{chunk-T6LIO4ZZ.js → chunk-DR3MPTUY.js} +1 -1
- package/build/_chunks/{chunk-PEBLGGN7.js → chunk-E3DWNGCJ.js} +1 -1
- package/build/_chunks/{chunk-RZ3GOLOH.js → chunk-FCLSSGNS.js} +1 -1
- package/build/_chunks/{chunk-XMZ5XGUR.js → chunk-GTUDQSUY.js} +1 -1
- package/build/_chunks/{chunk-XXFZYM4P.js → chunk-HAFC7C4D.js} +1 -1
- package/build/_chunks/{chunk-MW4KHDFL.js → chunk-HVBTEWJC.js} +1 -1
- package/build/_chunks/{chunk-JSSZZ4ZU.js → chunk-JFAVZAMW.js} +1 -1
- package/build/_chunks/{chunk-74AGBIWJ.js → chunk-M3NEABHH.js} +1 -1
- package/build/_chunks/{chunk-LS5NCSOA.js → chunk-MFA3KVRV.js} +1 -1
- package/build/_chunks/{chunk-XU5U5UY5.js → chunk-S4JEL3W5.js} +1 -1
- package/build/_chunks/{chunk-REP2WDKF.js → chunk-SHWOYOJZ.js} +1 -1
- package/build/_chunks/{chunk-IHNM2KRX.js → chunk-SOWSXULD.js} +1 -1
- package/build/_chunks/{chunk-PHLJSQ63.js → chunk-SULHRLPV.js} +1 -1
- package/build/_chunks/{chunk-CC2T7ZQ2.js → chunk-T4RMGRRN.js} +1 -1
- package/build/_chunks/{chunk-YNMDL3HQ.js → chunk-UOOKEXZU.js} +1 -1
- package/build/_chunks/{chunk-EA6MZFQ5.js → chunk-VMFH3EYE.js} +1 -1
- package/build/_chunks/{chunk-5ONMPFXY.js → chunk-VS5GQVCD.js} +1 -1
- package/build/_chunks/{chunk-4Z3NCIRW.js → chunk-WOSZ3B4D.js} +1 -1
- package/build/_chunks/{chunk-DZRT5LO3.js → chunk-WU4EGLXN.js} +1 -1
- package/build/_chunks/{chunk-WGGSVBPM.js → chunk-X6H5Y7XD.js} +1 -1
- package/build/_chunks/{chunk-GZAQEIWS.js → chunk-YIO3PHGZ.js} +1 -1
- package/build/_chunks/{chunk-FG5WYGID.js → chunk-ZIKWCAC5.js} +1 -1
- package/build/_chunks/chunk-ZK7ZZAYA.js +1 -0
- package/build/components/ActionMenu/index.js +1 -1
- package/build/components/ActiveFilterChip/index.js +1 -1
- package/build/components/AmountConversionFilter/index.js +1 -1
- package/build/components/AmountInput/index.js +1 -1
- package/build/components/AmountSlider/index.js +1 -1
- package/build/components/AppServices/index.js +1 -1
- package/build/components/AppServicesBar/index.js +1 -1
- package/build/components/BrandLogo/index.js +1 -1
- package/build/components/Button/index.js +1 -1
- package/build/components/ChipStack/index.js +1 -1
- package/build/components/ColorPicker/index.js +1 -1
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/ConfirmDialog/index.js +1 -1
- package/build/components/CopyImage/index.js +1 -1
- package/build/components/CountryFilter/index.js +1 -1
- package/build/components/CurrencyFilter/index.js +1 -1
- package/build/components/Customer/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/DeviceIcon/index.js +1 -1
- package/build/components/Discount/index.js +1 -1
- package/build/components/Dropdown2/index.js +1 -1
- package/build/components/DropdownButton/index.js +1 -1
- package/build/components/DropdownMenu/index.js +1 -1
- package/build/components/ExpandableSideBar/index.js +1 -1
- package/build/components/FileInputPreview/index.js +1 -1
- package/build/components/FileUpload/index.js +1 -1
- package/build/components/FilterDropdown/index.js +1 -1
- package/build/components/Filters/index.js +1 -1
- package/build/components/HeatMap/index.js +1 -1
- package/build/components/IconWithBadge/index.js +1 -1
- package/build/components/InputBase/index.js +1 -1
- package/build/components/Inputs/index.js +1 -1
- package/build/components/LanguageDropdown/index.js +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/MenuItem/index.js +1 -1
- package/build/components/MerchantCurrencyDropdown/index.js +1 -1
- package/build/components/MerchantLogo/index.js +1 -1
- package/build/components/MerchantsDropdown/index.js +1 -1
- package/build/components/MultiSelectDropdownButton/index.js +1 -1
- package/build/components/MultiSelectWithSearch/index.js +1 -1
- package/build/components/NestedDropdown/index.js +1 -1
- package/build/components/PartnersFilter/index.js +1 -1
- package/build/components/PaymentSourceFilter/index.js +1 -1
- package/build/components/PhoneFilter/index.js +1 -1
- package/build/components/ProgressRing/index.js +1 -1
- package/build/components/RFH/index.js +1 -1
- package/build/components/RadioGroup/index.js +1 -1
- package/build/components/RangeCalender/index.js +1 -1
- package/build/components/RatingCount/index.js +1 -1
- package/build/components/ReceiptsViewer/index.js +1 -1
- package/build/components/ReferenceTypeFilter/index.js +1 -1
- package/build/components/SalesChannelFilter/index.js +1 -1
- package/build/components/SearchButton/index.js +1 -1
- package/build/components/SelectWithSearch/index.js +1 -1
- package/build/components/StatusBar/index.js +1 -1
- package/build/components/StatusButton/index.js +1 -1
- package/build/components/StatusFilter/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/StatusLabel/index.js +1 -1
- package/build/components/TableCells/index.js +1 -1
- package/build/components/TableReports/index.js +1 -1
- package/build/components/TooltipChip/index.js +1 -1
- package/build/components/TreeDropdown/index.js +1 -1
- package/build/components/VAT/index.js +1 -1
- package/build/components/VerificationIcon/index.js +1 -1
- package/build/components/ViewColumnRadioFilter/index.js +1 -1
- package/build/components/VirtualTables/index.js +1 -1
- package/build/components/WindowSideBar/index.js +1 -1
- package/build/components/index.js +1 -1
- package/build/components/primitives/index.js +1 -1
- package/build/index.js +1 -1
- package/package.json +1 -1
- package/build/_chunks/chunk-HCZUDLZR.js +0 -1
- package/build/_chunks/chunk-RXT7RBES.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import {i}from'./chunk-XMZ5XGUR.js';import {p}from'./chunk-RXT7RBES.js';import {Aa}from'./chunk-W6W4YZ7G.js';import ee,{memo,useMemo,Children,useState,useRef,useEffect,useCallback,useLayoutEffect,isValidElement}from'react';import {motion}from'framer-motion';import P from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var h=24;var D=.22;var nt=styled(P)(()=>({display:"flex",gap:"8px",overflow:"visible"})),Ut=["trackWidth","minTrackWidth","slotSize","hoverZIndex"],it=styled("div",{shouldForwardProp:t=>!Ut.includes(t)})(({trackWidth:t,minTrackWidth:e,slotSize:r,hoverZIndex:o})=>({position:"relative",overflow:"visible",width:t,minWidth:e,height:r,transition:`width ${.22}s ease-out`,...o!==void 0?{zIndex:o}:{}})),$=styled(P)(()=>({display:"flex",alignItems:"center",paddingRight:"8px","& .chip-stack-overlap-slot":{marginRight:"-8px",position:"relative",zIndex:1},"& .chip-stack-overlap-slot:hover":{zIndex:2}}));function at(t){return {display:"flex",alignItems:"center",justifyContent:"center",width:`var(--chip-stack-slot-size, ${24}px)`,height:`var(--chip-stack-slot-size, ${24}px)`,borderRadius:"50%",border:`1px solid ${t.palette.divider}`,backgroundColor:t.palette.common.white,flexShrink:0}}var ct=styled(({title:t,className:e,...r})=>t!=null&&t!==""?jsx(p,{title:t,wrapperProps:{className:"chip-stack-overlap-slot"},children:jsx(P,{className:e,...r})}):jsx(P,{className:["chip-stack-overlap-slot",e].filter(Boolean).join(" "),...r}))(({theme:t})=>({...at(t),overflow:"hidden",lineHeight:0,boxSizing:"border-box",padding:0,"& > *":{width:"100%",height:"100%",minWidth:0,minHeight:0},"& img":{display:"block",width:"100%",height:"100%",objectFit:"contain"}})),K=styled(({title:t,...e})=>jsx(p,{title:t??"",wrapperProps:{className:"chip-stack-overlap-slot"},children:jsx(P,{...e})}))(({theme:t})=>({...at(t),fontSize:`max(${8}px, calc(var(--chip-stack-slot-size, ${24}px) * ${8.5} / ${24}))`,fontWeight:500,color:t.palette.text.disabled}));function st({overflowItems:t,size:e}){let r=`${Math.max(8,8.5*e/24)}px`;return jsxs(P,{sx:{width:e,height:e,borderRadius:"50%",border:o=>`1px solid ${o.palette.divider}`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:r,fontWeight:600,bgcolor:"action.hover",flexShrink:0},children:["+",t.length]})}var Gt=["faceSize","avatarFill"],pt=styled(i,{shouldForwardProp:t=>!Gt.includes(t)})(({theme:t,faceSize:e,avatarFill:r})=>{let o=`${e}px`,i=`${Math.max(7,8.5*e/24)}px`;return {width:o,height:o,fontSize:i,fontWeight:500,lineHeight:"100%",letterSpacing:"0%",textAlign:"center",color:t.palette.common.white,background:r,backgroundSize:"cover","&.MuiAvatar-colorDefault":{background:r,color:t.palette.common.white},"& .MuiAvatar-img":{objectFit:"cover"}}});function lt(t){return t==="fanout-left"?"left":t==="fanout-center"?"center":"right"}function mt(t,e,r){return t==="static"?e?"static-children":r?"static-items":null:e?"animated-children":r?"animated-items":null}function dt({size:t,stackStep:e,gap:r,minTrackWidth:o}){let i=t??24,n=e??Math.round(i/2),s=r??Math.max(1,Math.round(i*3/24)),a=o??Math.max(60,Math.round(i*60/24));return {size:i,stackStep:n,gap:s,minTrackWidth:a}}function ut(t,e){if(t<=0)return 0;switch(e){case "right":return 0;case "left":return t-1;default:return Math.floor((t-1)/2)}}function ht(t,e){return e!==void 0&&t>e}function M(t,e){return e===void 0||e<1||t.length<e?{visibleItems:t,hiddenItems:[]}:{visibleItems:t.slice(0,e-1),hiddenItems:t.slice(e-1)}}function Yt(t,e){return isValidElement(t)&&t.key!=null&&t.key!==""?String(t.key):`chip-stack-child-${e}`}function B({items:t,maxItems:e,getItemKey:r,renderItem:o,renderOverflow:i,slotSize:n}){let s={slotSize:n};if(t.length===0)return [];let{visibleItems:a,hiddenItems:c}=M(t,e),p=a.map((m,l)=>({key:r(m,l),render:()=>o(m,l,s)}));return c.length>0&&p.push({key:`chip-stack-overflow-${c.length}-${a.length}`,render:()=>i({items:t,overflowItems:c,size:n})}),p}function ft({children:t,maxItems:e,slotSize:r,renderOverflow:o}){let i=Children.toArray(t);return B({items:i,maxItems:e,getItemKey:Yt,renderItem:n=>n,renderOverflow:o,slotSize:r})}function St(t,e){return t.length===e.length&&t.every((r,o)=>r===e[o])}function X(t,e,r){return t[e]??r}function kt(t,e,r,o,i,n){if(t===0)return [];let s=e*i,a=new Array(t);a[e]=s;for(let c=e-1;c>=0;c-=1)a[c]=a[c+1]-X(r,c,n)-o;for(let c=e+1;c<t;c+=1)a[c]=a[c-1]+X(r,c-1,n)+o;return a}function Ct(t,e,r){return t<=0?0:(t-1)*e+r}function xt(t,e,r,o){return Array.from({length:t},(i,n)=>t<=1||!e?0:r[n]-n*o)}function At(t,e,r,o,i){if(t<=0)return 0;let n=e.map((c,p)=>c+X(r,p,i)),s=Math.min(...e),a=Math.max(...n);return Math.max(o,a-s)}function gt(t,e,r){return Array.from({length:t},(o,i)=>{let n=e.current[i];return n?n.offsetWidth:r})}function Z(t,e){return t.id??`${t.first}-${t.last}-${e}`}function yt(t){return [t.first,t.last].map(e=>e?.[0]).filter(e=>e!=null&&e!=="").join("")}function Tt(t){if(t.tooltip!==void 0)return t.tooltip===null?null:t.tooltip;let e=`${t.first||""} ${t.last||""}`.trim();return e!==""?e:null}function Rt({slotCount:t,anchorIndex:e,size:r,stackStep:o,gap:i,fanOutEnabled:n,compact:s}){let[a,c]=useState(false),[p,m]=useState(()=>Array.from({length:t},()=>r)),l=useRef(null),f=useRef([]),C=useRef(null),x=useCallback(()=>{let v=gt(t,f,r);m(g=>St(g,v)?g:v);},[t,r]),d=useCallback(()=>{C.current&&cancelAnimationFrame(C.current),C.current=requestAnimationFrame(x);},[x]),A=useMemo(()=>kt(t,e,p,i,o,r),[t,e,p,i,o,r]),y=useMemo(()=>xt(t,n&&a,A,o),[t,n,a,A,o]),S=useMemo(()=>Ct(t,o,r),[t,o,r]),O=useMemo(()=>At(t,A,p,S,r),[t,A,p,S,r]),k=useCallback(()=>{n&&(l.current&&clearTimeout(l.current),c(true));},[n]),u=useCallback(()=>{n&&(l.current&&clearTimeout(l.current),l.current=setTimeout(()=>c(false),120));},[n]);useEffect(()=>()=>{l.current&&clearTimeout(l.current);},[]),useEffect(()=>{n||c(false);},[n]),useLayoutEffect(()=>{m(Array.from({length:t},()=>r));},[t,r]),useLayoutEffect(()=>{x();},[t,r,x]),useEffect(()=>(d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d),C.current&&cancelAnimationFrame(C.current);}),[d]);let T=n&&a?O:s?r:S,b=n&&a,F=useMemo(()=>s?Array.from({length:t},(v,g)=>g===e||a?1:0):Array.from({length:t},()=>1),[s,t,e,a]);return {isHovering:a,handleMouseEnter:k,handleMouseLeave:u,slotRefs:f,translateX:y,slotOpacity:F,collapsedStackWidthPx:S,fannedRowWidthPx:O,trackWidth:T,hoverZIndexActive:b}}function H({items:t,children:e,maxItems:r,getItemKey:o,renderItem:i,renderOverflow:n,fanOutDirection:s,compact:a=false,"data-testid":c,sx:p,className:m,slotProps:l}){let f=Children.count(e)>0,{zIndex:C=1e3,size:x,stackStep:d,gap:A,minTrackWidth:y}=l?.layout??{},S=useMemo(()=>f?Children.toArray(e??null).length:t?.length??0,[f,e,t]),k=!(!a&&ht(S,r)),{size:u,stackStep:w,gap:T,minTrackWidth:b}=useMemo(()=>dt({size:x,stackStep:d,gap:A,minTrackWidth:y}),[x,d,A,y]),F=n??st,v=useMemo(()=>f?ft({children:e??null,maxItems:r,slotSize:u,renderOverflow:F}):!t?.length||!o||!i?[]:B({items:t,maxItems:r,getItemKey:o,renderItem:i,slotSize:u,renderOverflow:F}),[f,e,t,r,o,i,F,u]),g=v.length,Nt=useMemo(()=>ut(g,s),[g,s]),{handleMouseEnter:Et,handleMouseLeave:Mt,slotRefs:Wt,translateX:Lt,slotOpacity:tt,collapsedStackWidthPx:Kt,trackWidth:Vt,hoverZIndexActive:zt}=Rt({slotCount:g,anchorIndex:Nt,size:u,stackStep:w,gap:T,fanOutEnabled:k,compact:a});if(g===0)return null;let{sx:L,...Ht}=l?.shell??{},{style:Dt,...$t}=l?.track??{};return jsx(nt,{className:m,...Ht,sx:[{justifyContent:"flex-start",...k||a?{width:"100%"}:{}},...Array.isArray(p)?p:p!=null?[p]:[],...Array.isArray(L)?L:L!=null?[L]:[]],children:jsx(it,{"data-testid":c,...$t,style:Dt,onMouseEnter:k?Et:void 0,onMouseLeave:k?Mt:void 0,trackWidth:Vt,minTrackWidth:a?u:Math.max(b,Kt),slotSize:u,hoverZIndex:zt?C:void 0,children:v.map((et,R)=>jsx(motion.div,{ref:Xt=>{Wt.current[R]=Xt;},initial:false,animate:{x:Lt[R]??0,opacity:tt[R]??1},transition:{duration:.22,ease:"easeOut"},style:{position:"absolute",top:0,left:R*w,zIndex:R,width:u,height:u,pointerEvents:tt[R]===0?"none":"auto"},children:et.render()},et.key))})})}function oe({children:t,maxItems:e,renderOverflow:r,slotSize:o=24,sx:i,...n}){let s=useMemo(()=>ee.Children.toArray(t),[t]),{visibleItems:a,hiddenItems:c}=useMemo(()=>M(s,e),[s,e]),p=c.length>0,m=useMemo(()=>[{"--chip-stack-slot-size":`${o}px`},...Array.isArray(i)?i:i!=null?[i]:[]],[o,i]);if(!p)return jsx($,{"data-testid":"ChipStack",...n,sx:m,children:t});let l=r?.({items:s,overflowItems:c,size:o});return jsxs($,{"data-testid":"ChipStack",...n,sx:m,children:[a,l??jsx(K,{title:`${c.length} more`,children:jsxs("span",{children:["+",c.length]})})]})}var J=memo(oe);function ie(t){return jsx(ct,{"data-testid":"OverlapChip",...t})}var Q=memo(ie);var ce=["static","fanout-right","fanout-left","fanout-center"],Y="static";function pe(t){let{variant:e=Y,maxItems:r,renderOverflow:o,children:i,items:n,getItemKey:s,renderItem:a,compact:c=false,"data-testid":p,slotProps:m,sx:l,className:f}=t,C=Children.count(i??null)>0,x=!C&&(n?.length??0)>0&&s!=null&&a!=null,d=mt(e,C,x);if(d===null)return null;if(d==="static-children"||d==="static-items"){let S=m?.layout?.size??24;if(d==="static-items"&&n&&s&&a){let{visibleItems:O,hiddenItems:k}=M(n,r),u=k.length>0?o?.({items:n,overflowItems:k,size:S})??jsx(K,{title:`${k.length} more`,children:jsxs("span",{children:["+",k.length]})}):null,w=jsxs(Fragment,{children:[O.map((T,b)=>jsx(Q,{children:a(T,b,{slotSize:S})},s(T,b))),u]});return jsx(J,{"data-testid":p,slotSize:S,sx:l,className:f,children:w})}return jsx(J,{"data-testid":p,maxItems:r,renderOverflow:o,slotSize:S,sx:l,className:f,children:i})}let A=lt(e),y={maxItems:r,renderOverflow:o,fanOutDirection:A,compact:c,"data-testid":p??"ChipStack",slotProps:m,sx:l,className:f};return d==="animated-children"?jsx(H,{...y,children:i}):jsx(H,{...y,items:n,getItemKey:s,renderItem:a})}var wt=pe;function he({item:t,sourceIndex:e,slotSize:r}){let[o,i]=useState(false),n=useRef(null);useEffect(()=>{i(false);},[t.logo]);let s=!t.logo||o,a=Z(t,e),c="transparent";s&&(n.current?.key!==a&&(n.current={key:a,fill:Aa()}),c=n.current.fill);let p$1=jsx(pt,{faceSize:r,avatarFill:c,src:s?void 0:t.logo,slotProps:s?void 0:{img:{onError:()=>i(true)}},children:yt(t)}),m=Tt(t);return m!=null&&m!==""?jsx(p,{title:m,children:p$1}):p$1}var fe=he;var dr=wt;export{h as a,D as b,Z as c,Q as d,ce as e,Y as f,wt as g,fe as h,dr as i};
|
|
1
|
+
import {i}from'./chunk-GTUDQSUY.js';import {p}from'./chunk-2GEJSH7A.js';import {Aa}from'./chunk-W6W4YZ7G.js';import ee,{memo,useMemo,Children,useState,useRef,useEffect,useCallback,useLayoutEffect,isValidElement}from'react';import {motion}from'framer-motion';import P from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var h=24;var D=.22;var nt=styled(P)(()=>({display:"flex",gap:"8px",overflow:"visible"})),Ut=["trackWidth","minTrackWidth","slotSize","hoverZIndex"],it=styled("div",{shouldForwardProp:t=>!Ut.includes(t)})(({trackWidth:t,minTrackWidth:e,slotSize:r,hoverZIndex:o})=>({position:"relative",overflow:"visible",width:t,minWidth:e,height:r,transition:`width ${.22}s ease-out`,...o!==void 0?{zIndex:o}:{}})),$=styled(P)(()=>({display:"flex",alignItems:"center",paddingRight:"8px","& .chip-stack-overlap-slot":{marginRight:"-8px",position:"relative",zIndex:1},"& .chip-stack-overlap-slot:hover":{zIndex:2}}));function at(t){return {display:"flex",alignItems:"center",justifyContent:"center",width:`var(--chip-stack-slot-size, ${24}px)`,height:`var(--chip-stack-slot-size, ${24}px)`,borderRadius:"50%",border:`1px solid ${t.palette.divider}`,backgroundColor:t.palette.common.white,flexShrink:0}}var ct=styled(({title:t,className:e,...r})=>t!=null&&t!==""?jsx(p,{title:t,wrapperProps:{className:"chip-stack-overlap-slot"},children:jsx(P,{className:e,...r})}):jsx(P,{className:["chip-stack-overlap-slot",e].filter(Boolean).join(" "),...r}))(({theme:t})=>({...at(t),overflow:"hidden",lineHeight:0,boxSizing:"border-box",padding:0,"& > *":{width:"100%",height:"100%",minWidth:0,minHeight:0},"& img":{display:"block",width:"100%",height:"100%",objectFit:"contain"}})),K=styled(({title:t,...e})=>jsx(p,{title:t??"",wrapperProps:{className:"chip-stack-overlap-slot"},children:jsx(P,{...e})}))(({theme:t})=>({...at(t),fontSize:`max(${8}px, calc(var(--chip-stack-slot-size, ${24}px) * ${8.5} / ${24}))`,fontWeight:500,color:t.palette.text.disabled}));function st({overflowItems:t,size:e}){let r=`${Math.max(8,8.5*e/24)}px`;return jsxs(P,{sx:{width:e,height:e,borderRadius:"50%",border:o=>`1px solid ${o.palette.divider}`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:r,fontWeight:600,bgcolor:"action.hover",flexShrink:0},children:["+",t.length]})}var Gt=["faceSize","avatarFill"],pt=styled(i,{shouldForwardProp:t=>!Gt.includes(t)})(({theme:t,faceSize:e,avatarFill:r})=>{let o=`${e}px`,i=`${Math.max(7,8.5*e/24)}px`;return {width:o,height:o,fontSize:i,fontWeight:500,lineHeight:"100%",letterSpacing:"0%",textAlign:"center",color:t.palette.common.white,background:r,backgroundSize:"cover","&.MuiAvatar-colorDefault":{background:r,color:t.palette.common.white},"& .MuiAvatar-img":{objectFit:"cover"}}});function lt(t){return t==="fanout-left"?"left":t==="fanout-center"?"center":"right"}function mt(t,e,r){return t==="static"?e?"static-children":r?"static-items":null:e?"animated-children":r?"animated-items":null}function dt({size:t,stackStep:e,gap:r,minTrackWidth:o}){let i=t??24,n=e??Math.round(i/2),s=r??Math.max(1,Math.round(i*3/24)),a=o??Math.max(60,Math.round(i*60/24));return {size:i,stackStep:n,gap:s,minTrackWidth:a}}function ut(t,e){if(t<=0)return 0;switch(e){case "right":return 0;case "left":return t-1;default:return Math.floor((t-1)/2)}}function ht(t,e){return e!==void 0&&t>e}function M(t,e){return e===void 0||e<1||t.length<e?{visibleItems:t,hiddenItems:[]}:{visibleItems:t.slice(0,e-1),hiddenItems:t.slice(e-1)}}function Yt(t,e){return isValidElement(t)&&t.key!=null&&t.key!==""?String(t.key):`chip-stack-child-${e}`}function B({items:t,maxItems:e,getItemKey:r,renderItem:o,renderOverflow:i,slotSize:n}){let s={slotSize:n};if(t.length===0)return [];let{visibleItems:a,hiddenItems:c}=M(t,e),p=a.map((m,l)=>({key:r(m,l),render:()=>o(m,l,s)}));return c.length>0&&p.push({key:`chip-stack-overflow-${c.length}-${a.length}`,render:()=>i({items:t,overflowItems:c,size:n})}),p}function ft({children:t,maxItems:e,slotSize:r,renderOverflow:o}){let i=Children.toArray(t);return B({items:i,maxItems:e,getItemKey:Yt,renderItem:n=>n,renderOverflow:o,slotSize:r})}function St(t,e){return t.length===e.length&&t.every((r,o)=>r===e[o])}function X(t,e,r){return t[e]??r}function kt(t,e,r,o,i,n){if(t===0)return [];let s=e*i,a=new Array(t);a[e]=s;for(let c=e-1;c>=0;c-=1)a[c]=a[c+1]-X(r,c,n)-o;for(let c=e+1;c<t;c+=1)a[c]=a[c-1]+X(r,c-1,n)+o;return a}function Ct(t,e,r){return t<=0?0:(t-1)*e+r}function xt(t,e,r,o){return Array.from({length:t},(i,n)=>t<=1||!e?0:r[n]-n*o)}function At(t,e,r,o,i){if(t<=0)return 0;let n=e.map((c,p)=>c+X(r,p,i)),s=Math.min(...e),a=Math.max(...n);return Math.max(o,a-s)}function gt(t,e,r){return Array.from({length:t},(o,i)=>{let n=e.current[i];return n?n.offsetWidth:r})}function Z(t,e){return t.id??`${t.first}-${t.last}-${e}`}function yt(t){return [t.first,t.last].map(e=>e?.[0]).filter(e=>e!=null&&e!=="").join("")}function Tt(t){if(t.tooltip!==void 0)return t.tooltip===null?null:t.tooltip;let e=`${t.first||""} ${t.last||""}`.trim();return e!==""?e:null}function Rt({slotCount:t,anchorIndex:e,size:r,stackStep:o,gap:i,fanOutEnabled:n,compact:s}){let[a,c]=useState(false),[p,m]=useState(()=>Array.from({length:t},()=>r)),l=useRef(null),f=useRef([]),C=useRef(null),x=useCallback(()=>{let v=gt(t,f,r);m(g=>St(g,v)?g:v);},[t,r]),d=useCallback(()=>{C.current&&cancelAnimationFrame(C.current),C.current=requestAnimationFrame(x);},[x]),A=useMemo(()=>kt(t,e,p,i,o,r),[t,e,p,i,o,r]),y=useMemo(()=>xt(t,n&&a,A,o),[t,n,a,A,o]),S=useMemo(()=>Ct(t,o,r),[t,o,r]),O=useMemo(()=>At(t,A,p,S,r),[t,A,p,S,r]),k=useCallback(()=>{n&&(l.current&&clearTimeout(l.current),c(true));},[n]),u=useCallback(()=>{n&&(l.current&&clearTimeout(l.current),l.current=setTimeout(()=>c(false),120));},[n]);useEffect(()=>()=>{l.current&&clearTimeout(l.current);},[]),useEffect(()=>{n||c(false);},[n]),useLayoutEffect(()=>{m(Array.from({length:t},()=>r));},[t,r]),useLayoutEffect(()=>{x();},[t,r,x]),useEffect(()=>(d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d),C.current&&cancelAnimationFrame(C.current);}),[d]);let T=n&&a?O:s?r:S,b=n&&a,F=useMemo(()=>s?Array.from({length:t},(v,g)=>g===e||a?1:0):Array.from({length:t},()=>1),[s,t,e,a]);return {isHovering:a,handleMouseEnter:k,handleMouseLeave:u,slotRefs:f,translateX:y,slotOpacity:F,collapsedStackWidthPx:S,fannedRowWidthPx:O,trackWidth:T,hoverZIndexActive:b}}function H({items:t,children:e,maxItems:r,getItemKey:o,renderItem:i,renderOverflow:n,fanOutDirection:s,compact:a=false,"data-testid":c,sx:p,className:m,slotProps:l}){let f=Children.count(e)>0,{zIndex:C=1e3,size:x,stackStep:d,gap:A,minTrackWidth:y}=l?.layout??{},S=useMemo(()=>f?Children.toArray(e??null).length:t?.length??0,[f,e,t]),k=!(!a&&ht(S,r)),{size:u,stackStep:w,gap:T,minTrackWidth:b}=useMemo(()=>dt({size:x,stackStep:d,gap:A,minTrackWidth:y}),[x,d,A,y]),F=n??st,v=useMemo(()=>f?ft({children:e??null,maxItems:r,slotSize:u,renderOverflow:F}):!t?.length||!o||!i?[]:B({items:t,maxItems:r,getItemKey:o,renderItem:i,slotSize:u,renderOverflow:F}),[f,e,t,r,o,i,F,u]),g=v.length,Nt=useMemo(()=>ut(g,s),[g,s]),{handleMouseEnter:Et,handleMouseLeave:Mt,slotRefs:Wt,translateX:Lt,slotOpacity:tt,collapsedStackWidthPx:Kt,trackWidth:Vt,hoverZIndexActive:zt}=Rt({slotCount:g,anchorIndex:Nt,size:u,stackStep:w,gap:T,fanOutEnabled:k,compact:a});if(g===0)return null;let{sx:L,...Ht}=l?.shell??{},{style:Dt,...$t}=l?.track??{};return jsx(nt,{className:m,...Ht,sx:[{justifyContent:"flex-start",...k||a?{width:"100%"}:{}},...Array.isArray(p)?p:p!=null?[p]:[],...Array.isArray(L)?L:L!=null?[L]:[]],children:jsx(it,{"data-testid":c,...$t,style:Dt,onMouseEnter:k?Et:void 0,onMouseLeave:k?Mt:void 0,trackWidth:Vt,minTrackWidth:a?u:Math.max(b,Kt),slotSize:u,hoverZIndex:zt?C:void 0,children:v.map((et,R)=>jsx(motion.div,{ref:Xt=>{Wt.current[R]=Xt;},initial:false,animate:{x:Lt[R]??0,opacity:tt[R]??1},transition:{duration:.22,ease:"easeOut"},style:{position:"absolute",top:0,left:R*w,zIndex:R,width:u,height:u,pointerEvents:tt[R]===0?"none":"auto"},children:et.render()},et.key))})})}function oe({children:t,maxItems:e,renderOverflow:r,slotSize:o=24,sx:i,...n}){let s=useMemo(()=>ee.Children.toArray(t),[t]),{visibleItems:a,hiddenItems:c}=useMemo(()=>M(s,e),[s,e]),p=c.length>0,m=useMemo(()=>[{"--chip-stack-slot-size":`${o}px`},...Array.isArray(i)?i:i!=null?[i]:[]],[o,i]);if(!p)return jsx($,{"data-testid":"ChipStack",...n,sx:m,children:t});let l=r?.({items:s,overflowItems:c,size:o});return jsxs($,{"data-testid":"ChipStack",...n,sx:m,children:[a,l??jsx(K,{title:`${c.length} more`,children:jsxs("span",{children:["+",c.length]})})]})}var J=memo(oe);function ie(t){return jsx(ct,{"data-testid":"OverlapChip",...t})}var Q=memo(ie);var ce=["static","fanout-right","fanout-left","fanout-center"],Y="static";function pe(t){let{variant:e=Y,maxItems:r,renderOverflow:o,children:i,items:n,getItemKey:s,renderItem:a,compact:c=false,"data-testid":p,slotProps:m,sx:l,className:f}=t,C=Children.count(i??null)>0,x=!C&&(n?.length??0)>0&&s!=null&&a!=null,d=mt(e,C,x);if(d===null)return null;if(d==="static-children"||d==="static-items"){let S=m?.layout?.size??24;if(d==="static-items"&&n&&s&&a){let{visibleItems:O,hiddenItems:k}=M(n,r),u=k.length>0?o?.({items:n,overflowItems:k,size:S})??jsx(K,{title:`${k.length} more`,children:jsxs("span",{children:["+",k.length]})}):null,w=jsxs(Fragment,{children:[O.map((T,b)=>jsx(Q,{children:a(T,b,{slotSize:S})},s(T,b))),u]});return jsx(J,{"data-testid":p,slotSize:S,sx:l,className:f,children:w})}return jsx(J,{"data-testid":p,maxItems:r,renderOverflow:o,slotSize:S,sx:l,className:f,children:i})}let A=lt(e),y={maxItems:r,renderOverflow:o,fanOutDirection:A,compact:c,"data-testid":p??"ChipStack",slotProps:m,sx:l,className:f};return d==="animated-children"?jsx(H,{...y,children:i}):jsx(H,{...y,items:n,getItemKey:s,renderItem:a})}var wt=pe;function he({item:t,sourceIndex:e,slotSize:r}){let[o,i]=useState(false),n=useRef(null);useEffect(()=>{i(false);},[t.logo]);let s=!t.logo||o,a=Z(t,e),c="transparent";s&&(n.current?.key!==a&&(n.current={key:a,fill:Aa()}),c=n.current.fill);let p$1=jsx(pt,{faceSize:r,avatarFill:c,src:s?void 0:t.logo,slotProps:s?void 0:{img:{onError:()=>i(true)}},children:yt(t)}),m=Tt(t);return m!=null&&m!==""?jsx(p,{title:m,children:p$1}):p$1}var fe=he;var dr=wt;export{h as a,D as b,Z as c,Q as d,ce as e,Y as f,wt as g,fe as h,dr as i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {kc,yc,ab,Zb,jc,zc,xa}from'./chunk-W6W4YZ7G.js';import {forwardRef,memo,useId,createElement,useState,useCallback,useMemo,Children,useEffect,useRef}from'react';import Qe from'@mui/material/Box';import Za,{circularProgressClasses}from'@mui/material/CircularProgress';import Wa from'@mui/material/ButtonBase';import {styled,alpha,useTheme}from'@mui/material/styles';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import Ko from'@mui/material/SvgIcon';import _a from'@mui/material/Checkbox';import qa from'@mui/material/FormControlLabel';import ts from'@mui/material/Switch';import ls from'@mui/material/Typography';import gs from'@mui/material/Radio';import Ts from'@mui/material/Tooltip';import As from'@mui/material/Skeleton';import Os from'@mui/material/Avatar';import Ys from'@mui/material/Divider';import tn from'@mui/material/Collapse';import {createPortal}from'react-dom';import xn from'@mui/material/Backdrop';import On,{SliderThumb}from'@mui/material/Slider';import _n from'@mui/material/FormControl';import qn from'@mui/material/InputLabel';import Jn from'@mui/material/Input';import ai from'@mui/material/InputBase';import pi from'@mui/material/Accordion';import di from'@mui/material/AccordionDetails';import ci from'@mui/material/AccordionSummary';import xi from'@mui/material/Popper';import ki from'@mui/material/Dialog';import wi from'@mui/material/DialogActions';import Ii from'@mui/material/DialogContent';import Bi from'@mui/material/DialogTitle';import {LazyLoadImage}from'react-lazy-load-image-component';import rl from'@mui/material/Stack';var z="os-shared-Button",N={root:`${z}-root`,content:`${z}-content`,startIcon:`${z}-startIcon`,endIcon:`${z}-endIcon`,icon:`${z}-icon`,loading:`${z}-loading`,loadingSpinner:`${z}-loadingSpinner`},be={sm:{height:24,paddingY:8,paddingX:16,fontSize:"10px"},md:{height:32,minWidth:79,paddingY:8,paddingX:24,fontSize:"13px",lineHeight:"16px"},lg:{height:40,paddingY:8,paddingX:32,fontSize:"12px"}},Se={sm:{width:24,minWidth:24,height:24,padding:0},md:{width:30,minWidth:30,height:30,padding:0},lg:{width:38,minWidth:38,height:38,padding:0}},ve={sm:12,md:12,lg:14};var ke=styled(Wa,{shouldForwardProp:o=>o!=="$variant"&&o!=="$size"&&o!=="$fullWidth"&&o!=="$isLoading"&&o!=="$hasIcon"&&o!=="$isIconOnly"})(({theme:o,$variant:e="primary",$size:t="md",$fullWidth:r,$isLoading:a,$hasIcon:s,$isIconOnly:i})=>{let n=o.v2.palette,{paddingX:p,paddingY:d,...c}=be[t],f=Se[t];return {display:"inline-flex",alignItems:"center",justifyContent:"center",gap:o.v2.spacing(6),borderRadius:o.v2.radius(4),lineHeight:"100%",whiteSpace:"nowrap",position:"relative",cursor:a?"not-allowed":"pointer",transition:"background-color 0.15s ease, opacity 0.15s ease",...c,padding:`${o.v2.spacing(d)} ${o.v2.spacing(p)}`,fontWeight:o.typography.fontWeightMedium,...r&&!i&&{width:"100%"},...s&&!r&&!i&&{width:"auto",minWidth:0},...e==="primary"&&{background:n.brand[500],color:n.base.white,"&.Mui-disabled":{opacity:1,background:n.interactive.primary.disabled,color:n.base.white}},...e==="secondary"&&{backgroundColor:n.base.white,color:n.grey[900],border:`1px solid ${n.grey[100]}`,"&.Mui-disabled":{opacity:1,color:n.foreground.disabled}},...e==="ghost"&&{padding:0,minWidth:0,backgroundColor:"transparent",color:n.foreground.brand,"&.Mui-disabled":{opacity:.5}},...e==="danger"&&{backgroundColor:n.status.danger.default,color:n.base.white,"&.Mui-disabled":{opacity:1,backgroundColor:alpha(n.status.danger.default,.14),color:n.base.white}},...i&&{boxSizing:"border-box",...f}}}),Q=styled("span")(({theme:o})=>{let e=o.v2.spacing(16);return {display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0,width:e,height:e}});var Ie=forwardRef(({children:o,variant:e="primary",size:t="md",isLoading:r=false,startIcon:a,endIcon:s,icon:i,fullWidth:n=false,disabled:p,className:d,sx:c,...f},u)=>{let m=i!=null;return jsxs(ke,{ref:u,className:kc(N.root,d),$variant:e,$size:t,$fullWidth:n,$isLoading:r,$hasIcon:m||!!a||!!s||r,$isIconOnly:m,disabled:p||r,"data-testid":"Button",sx:c,...f,children:[jsx(Qe,{component:"span",className:N.content,sx:{display:"inline-flex",alignItems:"center",gap:"inherit",visibility:r?"hidden":"visible"},children:m?jsx(Q,{className:N.icon,children:i}):jsxs(Fragment,{children:[a&&jsx(Q,{className:N.startIcon,children:a}),o,s&&jsx(Q,{className:N.endIcon,children:s})]})}),r&&jsx(Q,{className:N.loading,sx:{position:"absolute"},children:jsx(Za,{className:N.loadingSpinner,size:ve[t],color:"inherit"})})]})});Ie.displayName="Button";var Be=memo(Ie);var Ka="os-shared-Icon",po={root:`${Ka}-root`};var Te=styled("img")(({theme:o})=>({width:o.v2.spacing(16),height:o.v2.spacing(16),verticalAlign:"middle",flexShrink:0}));var Pe=forwardRef(({className:o,sx:e,...t},r)=>jsx(Te,{className:kc(po.root,o),sx:e,"data-testid":"Icon",...t,ref:r}));Pe.displayName="Icon";var $e=memo(Pe);var jo="os-shared-Checkbox",D={root:`${jo}-root`,control:`${jo}-control`,label:`${jo}-label`};var Me=({disabled:o,...e})=>{let{v2:t}=useTheme(),{brand:r,base:a,foreground:s}=t.palette;return jsxs(Ko,{viewBox:"0 0 12 12",sx:{width:12,height:12},...e,children:[jsx("rect",{width:"12",height:"12",rx:"2.4",fill:o?s.disabled:r[500]}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.83391 3.74206C9.04243 3.9443 9.05652 4.28711 8.86537 4.50775L5.64586 8.22387C5.55146 8.33284 5.41909 8.39627 5.27942 8.39948C5.13975 8.40269 5.0049 8.3454 4.90612 8.24088L3.15002 6.38282C2.94999 6.17118 2.94999 5.82804 3.15002 5.61641C3.35004 5.40477 3.67435 5.40477 3.87437 5.61641L5.2522 7.07424L8.11024 3.77535C8.30138 3.55472 8.62538 3.53981 8.83391 3.74206Z",fill:a.white})]})},Fe=({disabled:o,...e})=>{let{v2:t}=useTheme(),{base:r,grey:a}=t.palette;return jsx(Ko,{viewBox:"0 0 12 12",sx:{width:12,height:12},...e,children:jsx("rect",{x:"0.6",y:"0.6",width:"10.8",height:"10.8",rx:"1.8",fill:o?a[50]:r.white,stroke:o?a[200]:a[500],strokeWidth:"1.2"})})},Le=({disabled:o,...e})=>{let{v2:t}=useTheme(),{brand:r,base:a,foreground:s}=t.palette;return jsxs(Ko,{viewBox:"0 0 12 12",sx:{width:12,height:12},...e,children:[jsx("rect",{width:"12",height:"12",rx:"2.4",fill:o?s.disabled:r[500]}),jsx("rect",{x:"3",y:"5.4",width:"6",height:"1.2",rx:"0.5",fill:a.white})]})};var Ae=styled(_a)(({theme:o})=>({padding:o.v2.spacing(2),"&:hover":{backgroundColor:"transparent"}})),Re=styled(qa)(({theme:o})=>{let{base:e,grey:t}=o.v2.palette;return {marginLeft:0,gap:o.v2.spacing(4),"& .MuiFormControlLabel-label":{fontSize:"11px",color:e.black},"& .MuiFormControlLabel-label.Mui-disabled":{color:t[500]}}});var We=forwardRef(({label:o,labelPlacement:e="end",disabled:t,sx:r,className:a,...s},i)=>{let n=yc(useId(),"checkbox"),p=jsx(Ae,{id:n,ref:i,disableRipple:true,disabled:t,checkedIcon:jsx(Me,{disabled:t}),icon:jsx(Fe,{disabled:t}),indeterminateIcon:jsx(Le,{disabled:t}),"data-testid":"Checkbox",className:kc(o?D.control:D.root,o?void 0:a),sx:o?void 0:r,...s});return o?jsx(Re,{className:kc(D.root,a),sx:r,control:p,label:o,labelPlacement:e,disabled:t,componentsProps:{typography:{className:D.label}}}):p});We.displayName="Checkbox";var Ee=memo(We);var es="os-shared-Switch",co={root:`${es}-root`};var He=styled(ts)(({theme:o,disabled:e})=>{let{base:t,grey:r,success:a}=o.v2.palette;return {width:28,height:16,padding:0,borderRadius:o.v2.radius(8),opacity:e?.5:1,overflow:"visible","& .MuiSwitch-switchBase":{padding:0,margin:o.v2.spacing(1),color:t.white,transitionDuration:"300ms","&:hover":{backgroundColor:"transparent"},"&.Mui-focusVisible":{outline:`2px solid ${r[400]}`,outlineOffset:2},"&.Mui-checked":{transform:"translateX(12px)",color:t.white,"& + .MuiSwitch-track":{backgroundColor:a[500],opacity:1,border:0}},"&.Mui-disabled":{color:t.white,"& + .MuiSwitch-track":{opacity:1},"& .MuiSwitch-thumb":{filter:"none"}},"&.Mui-checked.Mui-disabled":{color:t.white}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:14,height:14,color:t.white,backgroundColor:t.white,boxShadow:"none",filter:e?"none":"drop-shadow(0px 3px 0.5px rgba(0, 0, 0, 0.04)) drop-shadow(0px 3px 4px rgba(0, 0, 0, 0.12))"},"& .MuiSwitch-track":{borderRadius:o.v2.radius(8),backgroundColor:"#D9D9D9",opacity:1,transition:o.transitions.create(["background-color"],{duration:300})}}});var Ve=forwardRef(({className:o,sx:e,...t},r)=>jsx(He,{ref:r,className:kc(co.root,o),sx:e,"data-testid":"Switch",disableRipple:true,...t}));Ve.displayName="Switch";var Oe=memo(Ve);var is="os-shared-Typography",mo={root:`${is}-root`};var Ze=styled(ls)(({theme:o})=>{let{base:e}=o.v2.palette;return {color:e.black}});var je=forwardRef(({variant:o="body1",weight:e,isTruncated:t=false,isUppercase:r=false,className:a,sx:s,...i},n)=>{let p=useTheme(),d={regular:p.typography.fontWeightRegular,medium:p.typography.fontWeightMedium,semibold:p.typography.fontWeightBold,bold:p.typography.fontWeightBolder??700},c=e!==void 0?typeof e=="number"?e:d[e]:void 0,f=Array.isArray(s)?s:[s];return jsx(Ze,{ref:n,className:kc(mo.root,a),variant:o,sx:[c!==void 0&&{fontWeight:c},t&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},r&&{textTransform:"uppercase"},...f],"data-testid":"Typography",...i})});je.displayName="Typography";var Ke=memo(je);var us="os-shared-RadioButton";var fo={root:`${us}-root`};var Ge=({disabled:o,...e})=>{let{v2:t}=useTheme(),{brand:r,base:a}=t.palette,s=o?"#BDC1CC":r[500];return jsxs(Ko,{viewBox:"0 0 12 12",sx:{width:12,height:12,fill:"none"},...e,children:[jsx("rect",{x:"1.2",y:"1.2",width:"9.6",height:"9.6",rx:"4.8",fill:s,stroke:s,strokeWidth:"1.2",style:{fill:s,stroke:s}}),jsx("circle",{cx:"6",cy:"6",r:"2.25",fill:a.white,style:{fill:a.white}})]})},Ye=({disabled:o,...e})=>{let{v2:t}=useTheme(),{base:r,grey:a}=t.palette,s=o?a[50]:r.white,i=o?a[200]:a[500];return jsx(Ko,{viewBox:"0 0 12 12",sx:{width:12,height:12,fill:"none"},...e,children:jsx("rect",{x:"1.2",y:"1.2",width:"9.6",height:"9.6",rx:"4.8",fill:s,stroke:i,strokeWidth:"1.2",style:{fill:s,stroke:i}})})};var _e=styled(gs)(({theme:o})=>({padding:o.v2.spacing(2),"&:hover":{backgroundColor:"transparent"},"& .MuiSvgIcon-root":{fontSize:12,width:12,height:12}}));var qe=forwardRef(({disabled:o,sx:e,className:t,...r},a)=>jsx(_e,{ref:a,disableRipple:true,disabled:o,checkedIcon:jsx(Ge,{disabled:o}),icon:jsx(Ye,{disabled:o}),"data-testid":"RadioButton",className:kc(fo.root,t),sx:e,...r}));qe.displayName="RadioButton";var Je=memo(qe);var yo="os-shared-CircularProgress",A={root:`${yo}-root`,progress:`${yo}-progress`,labelOverlay:`${yo}-labelOverlay`,labelText:`${yo}-labelText`};var ot=styled(Za)(({theme:o})=>{let{brand:e}=o.v2.palette;return {color:"#147DC5",background:alpha(e[500],.05),borderRadius:"50%",[`& .${circularProgressClasses.circle}`]:{strokeLinecap:"round"}}}),et=styled(Qe)(()=>({position:"relative",display:"inline-flex"})),tt=styled(Qe)(()=>({top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"})),rt=styled(ls)(({theme:o})=>({fontSize:o.typography.fontSize,fontWeight:o.typography.fontWeightBolder??700,color:"#3B4152"}));var at=forwardRef(({variant:o="indeterminate",hasLabel:e=true,value:t,className:r,sx:a,...s},i)=>{let n=o==="determinate"&&e;return jsxs(et,{className:kc(A.root,r),sx:a,"data-testid":"CircularProgress",children:[jsx(ot,{ref:i,variant:o,value:t,className:A.progress,...s}),n&&jsx(tt,{className:A.labelOverlay,children:jsx(rt,{className:A.labelText,variant:"caption",color:"text.secondary",children:`${Math.round(t??0)}%`})})]})});at.displayName="CircularProgress";var st=memo(at);var R="os-shared-Tooltip",h={popper:`${R}-popper`,tooltip:`${R}-tooltip`,arrow:`${R}-arrow`,content:`${R}-content`,title:`${R}-title`,supportingText:`${R}-supportingText`,wrapper:`${R}-wrapper`};var nt=styled(({className:o,...e})=>createElement(Ts,{...e,classes:{popper:kc(h.popper,o),tooltip:h.tooltip,arrow:h.arrow}}))(({theme:o})=>{let{base:e,grey:t}=o.v2.palette,r=e.white,a="var(--tooltip-border-width) solid var(--tooltip-border-color)";return {"--tooltip-border-color":"#3C373721","--tooltip-border-width":"1px",zIndex:999999,[`& .${h.arrow}`]:{color:r,"&:before":{backgroundColor:r,boxSizing:"border-box",border:a}},[`& .${h.tooltip}`]:{backgroundColor:r,color:t[700],boxShadow:o.v2.elevation[200],fontSize:12,fontWeight:400,lineHeight:1.2,padding:o.v2.spacing(6),borderRadius:o.v2.radius(8),border:a,maxWidth:320,wordBreak:"break-word"}}}),it=styled("div")(({theme:o})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:o.v2.spacing(6),maxWidth:296,width:"100%"})),lt=styled("div",{shouldForwardProp:o=>o!=="$hasSupportingText"})(({theme:o,$hasSupportingText:e})=>{let{grey:t}=o.v2.palette;return {margin:0,fontSize:12,fontWeight:e?600:400,lineHeight:e?1:1.2,color:e?t[700]:alpha(t[700],.77),width:e?"100%":void 0}}),pt=styled("div")(({theme:o})=>{let{grey:e}=o.v2.palette;return {margin:0,fontSize:11,fontWeight:400,lineHeight:"normal",color:e[500],width:"100%",whiteSpace:"pre-wrap"}});function Fs(o){return o!=null&&o!==false&&o!==""}function Ls(o,e){let t=Fs(e),r=jsx(lt,{className:h.title,$hasSupportingText:t,children:o});return t?jsxs(it,{className:h.content,children:[r,jsx(pt,{className:h.supportingText,children:e})]}):r}function dt({className:o,title:e,supportingText:t,placement:r="top",children:a,wrapperProps:s,sx:i,...n}){let{className:p,...d}=s??{};return jsx(nt,{className:o,title:Ls(e,t),placement:r,arrow:true,sx:i,...n,children:jsx(Qe,{display:"flex",alignItems:"center","data-testid":"Tooltip",className:kc(h.wrapper,p),...d,children:a})})}dt.displayName="Tooltip";var ct=memo(dt);var Ds="os-shared-Skeleton",ho={root:`${Ds}-root`};var mt=styled(As)(()=>({}));var ft=forwardRef(({className:o,sx:e,variant:t="rounded",height:r=16,...a},s)=>jsx(mt,{ref:s,className:kc(ho.root,o),sx:e,"data-testid":"Skeleton",variant:t,height:r,...a}));ft.displayName="Skeleton";var ut=memo(ft);var Vs="os-shared-Avatar",bo={root:`${Vs}-root`},So="xs",vo="teal",yt={teal:{from:"#31D5C8",to:"#1186C5"},green:{from:"#A2E9BD",to:"#44BB74"},cyan:{from:"#6BF6EB",to:"#32D6C9"},steel:{from:"#61AFC9",to:"#7FBFD4"},sage:{from:"#9DB7A4",to:"#7FBFD4"},gold:{from:"#D7B38C",to:"#FFE09F"},lime:{from:"#ADD6A2",to:"#FFDDB2"}},gt={xs:{dimension:24,fontSize:"9px"},sm:{dimension:32,fontSize:"12px"},md:{dimension:40,fontSize:"15px"},lg:{dimension:48,fontSize:"17px"},xl:{dimension:56,fontSize:"20px"}};function js(o){let{from:e,to:t}=yt[o];return `linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%), linear-gradient(135deg, ${e} 0%, ${t} 100%)`}var xt=styled(Os,{shouldForwardProp:o=>!["$size","$color"].includes(o)})(({theme:o,$size:e=So,$color:t=vo})=>{let{dimension:r,fontSize:a}=gt[e],{base:s}=o.v2.palette,i=js(t);return {width:r,height:r,flexShrink:0,fontSize:a,fontWeight:o.typography.fontWeightMedium,lineHeight:"normal",color:s.white,background:i,backgroundColor:"transparent","&.MuiAvatar-colorDefault":{color:s.white,background:i,backgroundColor:"transparent"}}});var Ct=forwardRef(({className:o,sx:e,size:t=So,color:r=vo,...a},s)=>jsx(xt,{ref:s,className:kc(bo.root,o),sx:e,"data-testid":"Avatar",...a,$size:t,$color:r,variant:"circular"}));Ct.displayName="Avatar";var ht=memo(Ct);var Gs="os-shared-Divider",No={root:`${Gs}-root`};function qs(o,e){let{grey:t,border:r}=e.v2.palette;return o==="subtle"?r.subtle:t[100]}var bt=styled(Ys,{shouldForwardProp:o=>o!=="$type"})(({theme:o,$type:e="default",orientation:t="horizontal"})=>({borderColor:qs(e,o),...t==="vertical"?{borderBottomWidth:0,borderRightWidth:1}:{borderBottomWidth:1}}));var St=forwardRef(({className:o,sx:e,orientation:t="horizontal",type:r="default",...a},s)=>jsx(bt,{ref:s,className:kc(No.root,o),sx:e,"data-testid":"Divider",orientation:t,$type:r,...a}));St.displayName="Divider";var vt=memo(St);var en="os-shared-Collapse",ko={root:`${en}-root`};var Nt=styled(tn)(()=>({}));var kt=forwardRef(({className:o,sx:e,children:t,unmountOnExit:r=true,timeout:a=300,...s},i)=>jsx(Nt,{ref:i,className:kc(ko.root,o),sx:e,"data-testid":"Collapse",unmountOnExit:r,timeout:a,...s,children:t}));kt.displayName="Collapse";var wt=memo(kt);var ln="os-shared-Badge",wo={root:`${ln}-root`},Io="default",It={default:"#29b6f6",primary:"#1976d2",secondary:"#f50057",neutral:"#656565",gray:"#CFCFCF",orange:"#FFD503"};function cn(o,e){let{base:t,grey:r,brand:a,success:s,warning:i,error:n,gradient:p}=e.v2.palette;if(o==="highlight")return p.brand;let d=It[o];return d||({inactive:r[100],active:alpha(t.black,.1),dark:a[500],red:n[500],success:s[500],warning:i[500],error:n[500]}[o]??t.white)}function mn(o,e){let{base:t}=e.v2.palette;return o==="inactive"?t.black:(t.white)}var Tt=styled("span",{shouldForwardProp:o=>!["$color","$compact","$round","$pointer"].includes(o)})(({theme:o,$color:e=Io,$compact:t,$round:r,$pointer:a})=>{let s=cn(e,o);return {paddingBlock:o.v2.spacing(2),paddingInline:t?"0.16056rem":r?"0.275rem":o.v2.spacing(4),borderRadius:t?o.v2.radius(4):r?o.v2.radius(16):o.v2.radius(48),background:s,color:mn(e,o),fontSize:"8px",fontWeight:700,lineHeight:"10px",letterSpacing:0,overflow:"hidden",height:t?"12px":r?"16px":void 0,display:"inline-flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",cursor:a?"pointer":"auto"}});var Pt=forwardRef(({className:o,sx:e,color:t,state:r,compact:a,round:s,pointer:i,children:n,...p},d)=>{let c=t??r??Io;return jsx(Tt,{ref:d,className:kc(wo.root,o),sx:e,"data-testid":"Badge",...p,$color:c,$compact:a,$round:s,$pointer:i,children:n})});Pt.displayName="Badge";var $t=memo(Pt);var gn="os-shared-Backdrop",Bo={root:`${gn}-root`};var Mt=styled(xn,{shouldForwardProp:o=>o!=="$hasBlur"})(({theme:o,$hasBlur:e=false})=>{let t=e?o.v2.blur[6]:"none";return {zIndex:1,backgroundColor:alpha("#000",.3),backdropFilter:t,WebkitBackdropFilter:t}});var Ft=forwardRef(({className:o,sx:e,open:t=true,hasBlur:r=false,onClose:a,onClick:s,...i},n)=>{if(!t)return null;let p=d=>{a?.(),s?.(d);};return createPortal(jsx(Mt,{open:t,$hasBlur:r,ref:n,className:kc(Bo.root,o),sx:e,"data-testid":"Backdrop",onClick:p,...i}),document.body)});Ft.displayName="Backdrop";var Lt=memo(Ft);var To="os-shared-CopyButton",B={root:`${To}-root`,icon:`${To}-icon`,copyIcon:`${To}-copyIcon`,copiedIcon:`${To}-copiedIcon`};var At=o=>{let{v2:e}=useTheme(),{base:t}=e.palette;return jsx(Ko,{sx:{height:12.6,width:13},...o,children:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"13",viewBox:"2.67 1.67 10.66 12.66",fill:"none",children:jsx("path",{d:"M11.3333 13.6978L11.3332 13.6979C11.1002 14.0479 10.7072 14.2582 10.2863 14.2582H5.83317C4.12559 14.2582 2.7415 12.8741 2.7415 11.1665V4.71338C2.7415 4.29279 2.95172 3.89983 3.30186 3.66641L3.5915 3.47331V11.1665C3.5915 12.4046 4.59508 13.4082 5.83317 13.4082H11.5264L11.3333 13.6978ZM4.40817 3.49984C4.40817 2.53467 5.20133 1.7415 6.1665 1.7415H11.4998C12.465 1.7415 13.2582 2.53467 13.2582 3.49984V10.8332C13.2582 11.7983 12.465 12.5915 11.4998 12.5915H6.1665C5.20133 12.5915 4.40817 11.7983 4.40817 10.8332V3.49984ZM11.4998 2.5915H6.1665C5.65901 2.5915 5.25817 2.99234 5.25817 3.49984V10.8332C5.25817 11.3407 5.65901 11.7415 6.1665 11.7415H11.4998C12.0073 11.7415 12.4082 11.3407 12.4082 10.8332V3.49984C12.4082 2.99234 12.0073 2.5915 11.4998 2.5915Z",fill:t.black,stroke:t.white,strokeWidth:"0.15"})})})},Rt=o=>{let{v2:e}=useTheme(),{success:t,base:r}=e.palette;return jsx(Ko,{sx:{height:12.6,width:13},...o,children:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"2 2 12.33 12.33",fill:"none",children:[jsx("path",{d:"M8.16646 2.00146C11.5718 2.00146 14.3315 4.76114 14.3315 8.16646C14.3315 11.5718 11.5718 14.3315 8.16646 14.3315C4.76114 14.3315 2.00146 11.5718 2.00146 8.16646C2.00146 4.76114 4.76114 2.00146 8.16646 2.00146Z",fill:t[500]}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.984 5.89153C11.2107 6.10097 11.2247 6.45454 11.0152 6.68124L7.57351 10.4067C7.46772 10.5212 7.31891 10.5863 7.16302 10.5863C7.00713 10.5863 6.85832 10.5212 6.75253 10.4067L5.03167 8.54397C4.82222 8.31726 4.83622 7.9637 5.06293 7.75425C5.28963 7.54481 5.6432 7.55881 5.85264 7.78552L7.16302 9.20392L10.1943 5.92279C10.4037 5.69608 10.7573 5.68209 10.984 5.89153Z",fill:r.white})]})})};var Et=styled("span")({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:16,height:16,flexShrink:0,cursor:"pointer",verticalAlign:"middle"}),Yo=styled("span",{shouldForwardProp:o=>o!=="$visible"})(({$visible:o})=>({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",opacity:o?1:0,transition:"opacity 200ms ease"}));var Ht=forwardRef(({className:o,sx:e,text:t,feedbackMs:r=2e3,onClick:a,...s},i)=>{let[n,p]=useState(false),d=c=>{c.stopPropagation(),ab(t),p(true),setTimeout(()=>p(false),r),a?.(c);};return jsxs(Et,{ref:i,className:kc(B.root,o),sx:e,role:"button",tabIndex:0,"data-testid":"CopyButton",onClick:d,...s,children:[jsx(Yo,{className:kc(B.icon,B.copyIcon),$visible:!n,children:jsx(At,{})}),jsx(Yo,{className:kc(B.icon,B.copiedIcon),$visible:n,children:jsx(Rt,{})})]})});Ht.displayName="CopyButton";var Vt=memo(Ht);var _o="os-shared-ProgressBar",U={root:`${_o}-root`,fill:`${_o}-fill`,text:`${_o}-text`};var Zt=styled(Qe,{shouldForwardProp:o=>!["$value","$isDecimal"].includes(o)})(({theme:o,$value:e,$isDecimal:t})=>{let{base:r}=o.v2.palette;return {width:`${e}%`,minWidth:e>=10?"28px":"24px",height:"18px",borderRadius:o.v2.radius(50),background:"linear-gradient(256deg, #147DC5 0%, #3DA6E1 100%)",display:"flex",alignItems:"center",justifyContent:e>10?"flex-end":"center",paddingInlineEnd:e>10?o.v2.spacing(2):o.v2.spacing(0),...e===0&&{background:alpha(r.black,26/255)},...t&&{minWidth:e>=10?"40px":"36px"}}}),jt=styled(Qe,{shouldForwardProp:o=>o!=="$value"})(({theme:o,$value:e})=>{let{base:t}=o.v2.palette;return {height:"14px",maxWidth:"36px",minWidth:"20px",background:alpha(t.black,26/255),borderRadius:o.v2.radius(50),display:"flex",alignItems:"center",justifyContent:"center",padding:0,...e===0&&{background:alpha(t.black,0)}}}),Kt=styled(ls,{shouldForwardProp:o=>o!=="$value"})(({theme:o,$value:e})=>{let{base:t,grey:r}=o.v2.palette;return {fontSize:"8px",fontWeight:o.typography.fontWeightBolder??700,color:t.white,padding:`${o.v2.spacing(2)} ${o.v2.spacing(4)}`,...e===0&&{color:alpha(r[500],.5)}}});var Xt=forwardRef(({className:o,sx:e,value:t},r)=>{let a=!Number.isInteger(t);return jsx(Zt,{ref:r,className:kc(U.root,o),sx:e,"data-testid":"ProgressBar",$value:t,$isDecimal:a,children:jsx(jt,{className:U.fill,$value:t,children:jsxs(Kt,{className:U.text,$value:t,variant:"caption",children:[Number(t.toFixed(2)),"%"]})})})});Xt.displayName="ProgressBar";var Gt=memo(Xt);var Mo="os-shared-Chip",k={root:`${Mo}-root`,text:`${Mo}-text`,copyButton:`${Mo}-copyButton`,icon:`${Mo}-icon`},Yt={text:{height:24,paddingBlock:4,paddingInline:8,borderRadius:48},circular:{height:24,width:24,padding:4,borderRadius:12},"pill-icon":{height:24,width:36,paddingBlock:4,paddingInline:6,borderRadius:12}};var Jt=o=>{let{v2:e}=useTheme(),{base:t}=e.palette;return jsx(Ko,{sx:{height:"10px"},...o,children:jsx("svg",{width:"11",height:"13",viewBox:"0 0 11 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M0.924805 9.5C0.924805 10.7381 1.9289 11.7412 3.16699 11.7412H8.86035L8.66699 12.0312C8.43398 12.3812 8.04094 12.5917 7.62012 12.5918H3.16699C1.45941 12.5918 0.0751953 11.2076 0.0751953 9.5V3.04688C0.0751953 2.62628 0.28561 2.23342 0.635742 2L0.924805 1.80664V9.5ZM3.5 0.0751953H8.83301C9.79807 0.0751953 10.5916 0.867985 10.5918 1.83301V9.16699C10.5916 10.132 9.79807 10.9248 8.83301 10.9248H3.5C2.53494 10.9248 1.74139 10.132 1.74121 9.16699V1.83301C1.74139 0.867985 2.53494 0.0751953 3.5 0.0751953ZM3.5 0.924805C2.99261 0.924805 2.59197 1.32567 2.5918 1.83301V9.16699C2.59197 9.67433 2.99261 10.0752 3.5 10.0752H8.83301C9.3404 10.0752 9.74104 9.67433 9.74121 9.16699V1.83301C9.74104 1.32567 9.3404 0.924805 8.83301 0.924805H3.5Z",fill:t.black,stroke:t.white,strokeWidth:"0.15"})})})},Qt=o=>{let{v2:e}=useTheme(),{success:t,base:r}=e.palette;return jsx(Ko,{sx:{height:"10px"},...o,children:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"2 2 12.33 12.33",fill:"none",children:[jsx("path",{d:"M8.16646 2.00146C11.5718 2.00146 14.3315 4.76114 14.3315 8.16646C14.3315 11.5718 11.5718 14.3315 8.16646 14.3315C4.76114 14.3315 2.00146 11.5718 2.00146 8.16646C2.00146 4.76114 4.76114 2.00146 8.16646 2.00146Z",fill:t[500]}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.984 5.89153C11.2107 6.10097 11.2247 6.45454 11.0152 6.68124L7.57351 10.4067C7.46772 10.5212 7.31891 10.5863 7.16302 10.5863C7.00713 10.5863 6.85832 10.5212 6.75253 10.4067L5.03167 8.54397C4.82222 8.31726 4.83622 7.9637 5.06293 7.75425C5.28963 7.54481 5.6432 7.55881 5.85264 7.78552L7.16302 9.20392L10.1943 5.92279C10.4037 5.69608 10.7573 5.68209 10.984 5.89153Z",fill:r.white})]})})};function zn(o,e){let t=Yt[o];return {height:t.height,..."width"in t&&{width:t.width,minWidth:t.width},..."padding"in t&&{padding:e.v2.spacing(t.padding)},..."paddingBlock"in t&&{paddingBlock:e.v2.spacing(t.paddingBlock)},..."paddingInline"in t&&{paddingInline:e.v2.spacing(t.paddingInline)},borderRadius:e.v2.radius(t.borderRadius)}}var er=styled(Qe,{shouldForwardProp:o=>!["$variant","$hasIcon","$hasCopy","$isSelected","$disableAnimation"].includes(o)})(({theme:o,$variant:e="text",$hasIcon:t,$hasCopy:r,$isSelected:a,$disableAnimation:s})=>{let{grey:i,base:n}=o.v2.palette;return {display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxSizing:"border-box",lineHeight:1,letterSpacing:0,whiteSpace:"nowrap",fontSize:11,fontWeight:o.typography.fontWeightRegular,color:n.black,border:`1px solid ${i[100]}`,backgroundColor:n.white,...zn(e,o),...e==="text"&&t&&{gap:o.v2.spacing(6),paddingInlineStart:o.v2.spacing(5),paddingInlineEnd:o.v2.spacing(8)},...r&&{gap:o.v2.spacing(4)},[`& .${k.icon}`]:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:14,height:14,overflow:"hidden","& img, & svg":{width:14,height:14,display:"block"}},...a&&{boxShadow:`${n.white} 7px 0px 8px 2px`},...s&&{transition:"none !important",animation:"none !important",transform:"none !important","& *":{transition:"none !important",animation:"none !important",transform:"none !important"}}}}),Jo=styled(Qe)({textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,flex:"0 1 auto"}),tr=styled("span",{shouldForwardProp:o=>o!=="$copied"})(({$copied:o})=>({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:12,height:12,flexShrink:0,cursor:"pointer",opacity:o?1:.6,transition:"opacity 150ms ease","&:hover":{opacity:1}})),Qo=styled("span",{shouldForwardProp:o=>o!=="$visible"})(({$visible:o})=>({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",opacity:o?1:0,transition:"opacity 150ms ease"}));var ar=forwardRef(({className:o,sx:e,children:t,icon:r,variant:a="text",disabled:s=false,isSelected:i=false,copyText:n,unknownText:p="Unknown",disableAnimation:d=false,...c},f)=>{let[u,m]=useState(false),y=!!(t&&n),x=r!=null&&!y,g=useCallback(v=>{v.stopPropagation(),n&&(ab(n),m(true),setTimeout(()=>m(false),2e3));},[n]),S=useMemo(()=>x?jsx("span",{className:k.icon,children:r}):null,[x,r]),L=useMemo(()=>{if(t){let v=y&&typeof t=="string"?Zb(t):void 0;return jsx(Jo,{className:k.text,"data-is-arabic":v,children:t})}return x?null:jsx(Jo,{className:k.text,children:p})},[t,y,x,p]),C=useMemo(()=>y?jsxs(tr,{className:k.copyButton,role:"button",tabIndex:0,"aria-label":u?"copied":"copy","data-testid":"ChipCopyButton",$copied:u,onClick:g,children:[jsx(Qo,{$visible:!u,children:jsx(Jt,{})}),jsx(Qo,{$visible:u,children:jsx(Qt,{})})]}):null,[y,u,g]);return jsxs(er,{ref:f,"data-testid":"Chip",className:kc(k.root,o,`CustomVariant_${a}`),sx:jc(s?{cursor:"not-allowed",opacity:.5}:{},e),$variant:a,$hasIcon:x,$hasCopy:y,$isSelected:i,$disableAnimation:d,...c,children:[S,L,C]})});ar.displayName="Chip";var sr=memo(ar);var ee="os-shared-Slider",T={root:`${ee}-root`,thumb:`${ee}-thumb`,thumbIcon:`${ee}-thumbIcon`};var nr=o=>{let{v2:e}=useTheme(),{grey:t}=e.palette;return jsx(Ko,{sx:{width:"5px",height:"8px",pointerEvents:"none"},...o,children:jsxs("svg",{width:"5",height:"8",viewBox:"0 0 5 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M0.459961 0.460449L0.459961 6.59897",stroke:t[500],strokeWidth:"0.920779",strokeLinecap:"round"}),jsx("path",{d:"M2.44531 0.460388L2.44531 6.59891",stroke:t[500],strokeWidth:"0.920779",strokeLinecap:"round"}),jsx("path",{d:"M4.4375 0.460388L4.4375 6.59891",stroke:t[500],strokeWidth:"0.920779",strokeLinecap:"round"})]})})};var ir=styled(On)(({theme:o})=>{let{brand:e,base:t}=o.v2.palette,r=["0px 0px 1.25px 0px rgba(0, 0, 0, 0.1)","0px 1.25px 1.25px 0px rgba(0, 0, 0, 0.09)","0px 3.75px 2.5px 0px rgba(0, 0, 0, 0.05)","0px 7.5px 2.5px 0px rgba(0, 0, 0, 0.01)","0px 11.25px 3.75px 0px rgba(0, 0, 0, 0)"].join(", ");return {color:e[500],height:8,padding:0,"& .MuiSlider-rail":{backgroundColor:"#CFCFCF",opacity:1,left:0},"& .MuiSlider-thumb":{height:20,width:20,backgroundColor:t.white,border:"none",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:r,"&:focus, &:hover, &.Mui-active, &.Mui-focusVisible":{boxShadow:r}},[`& .${T.thumbIcon}`]:{width:"5px",height:"8px",pointerEvents:"none"}}});function Gn({children:o,className:e,...t}){return jsxs(SliderThumb,{className:kc(T.thumb,e),...t,children:[o,jsx(nr,{className:T.thumbIcon})]})}var lr=forwardRef(({className:o,sx:e,value:t,min:r,max:a,step:s,disabled:i,onChange:n,slots:p,...d},c)=>{let f=useCallback((u,m)=>{n(m);},[n]);return jsx(ir,{ref:c,className:kc(T.root,o),sx:e,"data-testid":"Slider",value:t,min:r,max:a,step:s,disabled:i,onChange:f,...d,slots:{thumb:Gn,...p}})});lr.displayName="Slider";var pr=memo(lr);var te="os-shared-Input",G={root:`${te}-root`,label:`${te}-label`,input:`${te}-input`},cr={sm:28,md:32,labelled:40};var mr=(o,e)=>cr[o?"labelled":e],fr=styled(Jn,{shouldForwardProp:o=>!["$hasLabel","$hideArrows","$size"].includes(o)})(({theme:o,$hasLabel:e=false,$hideArrows:t=false,$size:r="md"})=>{let{base:a,grey:s}=o.v2.palette;return {height:mr(e,r),padding:e?o.v2.spacing(8):`0 ${o.v2.spacing(8)}`,border:"none",borderRadius:"inherit",fontSize:"11px",fontWeight:o.typography.fontWeightMedium,color:a.black,backgroundColor:"transparent",display:"flex",alignItems:e?"stretch":"center","&.Mui-disabled":{color:s[500]},"& input":{paddingTop:o.v2.spacing(4),paddingBottom:o.v2.spacing(4)},"& input::placeholder":{color:s[500],fontWeight:o.typography.fontWeightRegular,opacity:e?0:1,...e&&{transition:"opacity 0.2s ease"}},"& input:-webkit-autofill, & input:-webkit-autofill:hover, & input:-webkit-autofill:focus":{WebkitTextFillColor:a.black,caretColor:a.black,transition:"background-color 5000s ease-in-out 0s"},"&::before, &::after":{display:"none"},...e&&{marginTop:0,"& input":{margin:"0px !important",padding:"0px !important",paddingTop:`${o.v2.spacing(10)} !important`,lineHeight:"130%"},"& input:focus::placeholder":{opacity:"1 !important"}},...t&&{"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:0},"& input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}}}}),ur=styled(qn)(({theme:o})=>{let{grey:e}=o.v2.palette;return {fontSize:"11px",color:`${e[500]} !important`}}),yr=styled(_n,{shouldForwardProp:o=>!["$hasLabel","$size"].includes(o)})(({theme:o,disabled:e,error:t,fullWidth:r,$hasLabel:a=false,$size:s="md"})=>{let{grey:i,base:n,error:p}=o.v2.palette;return {position:"relative",display:"flex",flexDirection:"column",width:r?"100%":"auto",height:mr(a,s),margin:0,border:`1px solid ${t?"#FF3D00":i[100]}`,borderRadius:o.v2.radius(4),backgroundColor:e?i[100]:n.white,transition:"border-color 0.15s ease","&:focus-within":{borderColor:t?"#FF3D00":i[50]},"& .MuiFormLabel-asterisk":{color:p[500]},"& .MuiInputLabel-root":{position:"absolute",left:0,top:0,zIndex:1,pointerEvents:"none",padding:o.v2.spacing(8),fontSize:"10px",fontWeight:o.typography.fontWeightMedium,lineHeight:"100%",transform:"translate(0, 6px) scale(1) !important",transformOrigin:"top left"},"& .MuiInputLabel-root.MuiInputLabel-shrink, & .MuiInputLabel-root.MuiFormLabel-filled, & .MuiInputLabel-root.Mui-focused":{transform:"translate(0, -1.5px) scale(0.75) !important",color:`${i[500]} !important`},"& .MuiInput-root":{flex:1,marginTop:"0 !important"}}});var xr=forwardRef(({label:o,size:e="md",error:t=false,disabled:r=false,fullWidth:a=false,placeholder:s,hideArrows:i=false,type:n,id:p,className:d,sx:c,onKeyDown:f,onWheel:u,...m},y)=>{let x=!!o,g=n==="number",S=C=>{let v=C.metaKey||C.ctrlKey||C.altKey,Zo=C.key.length===1;(["e","E","+","-"].includes(C.key)||xa()&&Zo&&!v&&!/^[0-9.]$/.test(C.key))&&C.preventDefault(),f?.(C);},L=C=>{C.target instanceof HTMLElement&&C.target.blur(),u?.(C);};return jsxs(yr,{className:kc(G.root,d),sx:c,error:t,disabled:r,fullWidth:a,"data-testid":"Input",$hasLabel:x,$size:e,children:[x&&jsx(ur,{className:G.label,htmlFor:p,children:o}),jsx(fr,{id:p,inputRef:y,className:G.input,type:n,error:t,disabled:r,placeholder:s??void 0,"aria-invalid":t||void 0,disableUnderline:true,fullWidth:true,$hasLabel:x,$hideArrows:i,$size:e,onKeyDown:g?S:f,onWheel:g?L:u,...m})]})});xr.displayName="Input";var Cr=memo(xr);var ae="os-shared-Textarea",Y={root:`${ae}-root`,label:`${ae}-label`,textarea:`${ae}-textarea`},_=3;var hr=styled(ai,{shouldForwardProp:o=>!["$error","$hasLabel","$minRows"].includes(o)})(({theme:o,$hasLabel:e=false,$minRows:t=_})=>{let{base:r,grey:a}=o.v2.palette;return {border:"none",borderRadius:"inherit",padding:e?`${o.v2.spacing(32)} ${o.v2.spacing(8)} ${o.v2.spacing(8)}`:`${o.v2.spacing(8)} ${o.v2.spacing(12)}`,fontSize:"11px",fontWeight:o.typography.fontWeightMedium,lineHeight:"normal",color:r.black,backgroundColor:"transparent",alignItems:"flex-start",width:"100%",...e&&{marginTop:0},"&.Mui-disabled":{color:a[500]},"& textarea":{resize:"vertical",minHeight:e?void 0:`${Math.max(t*20,60)}px`,padding:0,margin:0},"& textarea::placeholder":{color:a[500],fontWeight:o.typography.fontWeightMedium,opacity:1},"& textarea:-webkit-autofill, & textarea:-webkit-autofill:hover, & textarea:-webkit-autofill:focus":{WebkitTextFillColor:r.black,caretColor:r.black,transition:"background-color 5000s ease-in-out 0s"},"&::before, &::after":{display:"none"}}}),br=styled(qn)(({theme:o})=>{let{grey:e}=o.v2.palette;return {fontSize:"10px",fontWeight:o.typography.fontWeightMedium,color:`${e[500]} !important`}}),Sr=styled(_n,{shouldForwardProp:o=>!["$hasLabel","$minRows"].includes(o)})(({theme:o,disabled:e,error:t,fullWidth:r,$hasLabel:a=false,$minRows:s=_})=>{let{grey:i,base:n,error:p}=o.v2.palette,d=t?p[500]:i[100];return {position:"relative",display:"flex",flexDirection:"column",width:r?"100%":"auto",minHeight:a?96+(s-_)*20:void 0,margin:0,border:`1px solid ${d}`,borderRadius:o.v2.radius(4),backgroundColor:e?i[100]:n.white,transition:"border-color 0.15s ease","&:focus-within":{borderColor:t?p[500]:i[50]},"& .MuiFormLabel-asterisk":{color:p[500]},"& .MuiInputLabel-root":{position:"absolute",left:0,top:0,zIndex:1,pointerEvents:"none",display:"flex",alignItems:"flex-start",gap:o.v2.spacing(2),padding:o.v2.spacing(8),fontSize:"10px",fontWeight:o.typography.fontWeightMedium,lineHeight:"100%",transform:"none !important",transformOrigin:"top left",color:`${i[500]} !important`},"& .MuiInputBase-root":{flex:1,marginTop:"0 !important"}}});var Nr=forwardRef(({label:o,error:e=false,disabled:t=false,fullWidth:r=false,placeholder:a,minRows:s=_,maxRows:i,id:n,className:p,sx:d,required:c,...f},u)=>{let m=!!o;return jsxs(Sr,{className:kc(Y.root,p),sx:d,error:e,disabled:t,fullWidth:r,required:c,variant:"standard","data-testid":"Textarea",$hasLabel:m,$minRows:s,children:[m&&jsx(br,{className:Y.label,htmlFor:n,shrink:true,disableAnimation:true,required:c,children:o}),jsx(hr,{id:n,inputRef:u,className:Y.textarea,multiline:true,minRows:s,maxRows:i,disabled:t,required:c,placeholder:a??void 0,"aria-invalid":e||void 0,fullWidth:true,$error:e,$hasLabel:m,$minRows:s,...f})]})});Nr.displayName="Textarea";var kr=memo(Nr);var E="os-shared-Accordion",w={root:`${E}-root`,summary:`${E}-summary`,content:`${E}-content`,labelStartAdornment:`${E}-labelStartAdornment`,labelContent:`${E}-labelContent`,labelEndAdornment:`${E}-labelEndAdornment`,expandIcon:`${E}-expandIcon`};var Ir=()=>{let{v2:o}=useTheme(),{base:e}=o.palette;return jsx("svg",{width:"9",height:"5",viewBox:"0 0 9 5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M0.0501709 0.427246C0.0493864 0.478467 0.0592757 0.529176 0.0784912 0.57666C0.0976579 0.623937 0.125505 0.667471 0.161499 0.703613L3.82556 4.47803C3.86116 4.51465 3.90353 4.54403 3.95056 4.56396C3.99773 4.58391 4.04876 4.59422 4.09998 4.59424C4.15123 4.59424 4.20218 4.58392 4.24939 4.56396C4.29655 4.54401 4.33969 4.51476 4.37537 4.47803L8.03845 0.703613C8.07407 0.667816 8.10232 0.625348 8.12146 0.578613C8.14069 0.531638 8.15017 0.480932 8.14978 0.430176C8.14935 0.379519 8.13942 0.329298 8.11951 0.282715C8.09956 0.236042 8.06999 0.19405 8.03357 0.158691C7.99716 0.123349 7.95384 0.0952198 7.90662 0.0766602C7.8595 0.0582058 7.80878 0.0491929 7.75818 0.050293C7.70763 0.0514427 7.65792 0.0629948 7.61169 0.0834961C7.56537 0.104067 7.52346 0.13358 7.48865 0.17041L4.09998 3.65967L0.711304 0.17041C0.65912 0.115154 0.592066 0.0759001 0.517944 0.059082C0.443585 0.0422622 0.365385 0.0481013 0.294312 0.0756836C0.22324 0.103266 0.162075 0.15178 0.11853 0.214355C0.0750125 0.276905 0.05135 0.351058 0.0501709 0.427246Z",fill:e.black,stroke:e.black,strokeWidth:"0.1"})})};var Tr=styled(pi)(({theme:o,square:e})=>{let{grey:t,base:r}=o.v2.palette;return {overflow:"hidden",border:`1px solid ${t[100]}`,...!e&&{borderRadius:o.v2.radius(8)},margin:0,background:r.white,"&:before":{content:"unset"},"&.Mui-expanded":{margin:0},"&.Mui-disabled":{opacity:.5,pointerEvents:"none"}}}),Pr=styled(ci)(({theme:o})=>({background:"#fbfbfb",minHeight:"40px",height:"40px",padding:o.v2.spacing(10),"&.Mui-expanded":{minHeight:"40px",height:"40px"},"& .MuiAccordionSummary-content":{margin:0,display:"flex",flexDirection:"row",alignItems:"center",flexGrow:1,minWidth:0,gap:o.v2.spacing(10)},"& .MuiAccordionSummary-expandIconWrapper":{marginLeft:o.v2.spacing(8)}})),$r=styled(di)(({theme:o})=>{let{grey:e}=o.v2.palette;return {padding:0,borderTop:`1px solid ${e[100]}`}}),Mr=styled(Qe)({display:"inline-flex",alignItems:"center",justifyContent:"center",transition:"transform 0.2s ease",transform:"rotate(0deg)"}),Fr=styled(Qe)({minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"});var Dr=forwardRef(({expanded:o,defaultExpanded:e=false,onChange:t,label:r,content:a,labelStartAdornment:s,labelEndAdornment:i,slotProps:n={},disabled:p=false,expandIcon:d,className:c,sx:f,...u},m)=>{let y=o!==void 0,[x,g]=useState(e),S=y?o:x,L=(pl,ye)=>{y||g(ye),t?.(ye);},{showArrow:C=true,...v}=n.label??{},{className:Zo,sx:za,...Da}=n.root??{},Aa=d??(C?jsx(Mr,{component:"span",className:w.expandIcon,children:jsx(Ir,{})}):null),Ra=jsxs(Fragment,{children:[s!=null&&jsx(Qe,{component:"span",className:w.labelStartAdornment,...n.labelStartAdornment,sx:jc({flexShrink:0},n.labelStartAdornment?.sx),children:s}),jsx(Fr,{component:"span",className:w.labelContent,...n.labelContent,sx:n.labelContent?.sx,children:r}),i!=null&&jsx(Qe,{component:"span",className:w.labelEndAdornment,...n.labelEndAdornment,sx:jc({flexShrink:0,marginLeft:"auto"},n.labelEndAdornment?.sx),children:i})]});return jsxs(Tr,{ref:m,"data-testid":"Accordion",disabled:p,expanded:S,onChange:L,className:kc(w.root,c,Zo),sx:jc(f??{},za),...Da,...u,children:[jsx(Pr,{className:w.summary,expandIcon:Aa,"aria-expanded":S,...v,children:Ra}),jsx($r,{className:w.content,...n.content,children:a})]})});Dr.displayName="Accordion";var Ar=memo(Dr);var Rr="os-shared-Menu",to={popper:`${Rr}-popper`,panel:`${Rr}-panel`};var Er=styled(xi)({}),Hr=styled(Qe,{shouldForwardProp:o=>o!=="$showShadow"})(({theme:o,$showShadow:e})=>{let{grey:t,base:r}=o.v2.palette;return {borderRadius:o.v2.radius(4),background:r.white,width:"max-content",cursor:"pointer",boxShadow:o.v2.elevation[200],display:"flex",flexDirection:"column",overflowY:"auto",maxHeight:"432px","&:focus":{outline:"none"},".menu-item + .menu-item":{borderTop:`1px solid ${t[100]}`},"&::after":{content:e?'""':"none",width:"100%",height:"34px",position:"sticky",bottom:0,pointerEvents:"none",background:`linear-gradient(180deg, rgba(255,255,255,0) 0%, ${r.white} 100%)`}}});var Or=forwardRef(({open:o,anchorEl:e,children:t,placement:r,popperSx:a,panelProps:s,className:i,sx:n,...p},d)=>{let[c,f]=useState(false),m=useMemo(()=>Children.count(t),[t])>12&&c,{onScroll:y,className:x,sx:g,...S}=s??{},L=useCallback(v=>{f((v.currentTarget.scrollTop??0)>0),y?.(v);},[y]),C=kc(to.panel,x,"MuiPopper-dropdown");return jsx(Er,{ref:d,className:kc(to.popper,i),"data-testid":"Menu",open:o,anchorEl:e,placement:r??"bottom-start",sx:a,...p,children:jsx(Hr,{$showShadow:m,onScroll:L,className:C,sx:jc(n??{},g),...S,children:t})})});Or.displayName="Menu";var Zr=memo(Or);var ro="os-shared-Dialog",P={root:`${ro}-root`,title:`${ro}-title`,divider:`${ro}-divider`,content:`${ro}-content`,actions:`${ro}-actions`};var jr=styled(ki)(({theme:o})=>{let{base:e}=o.v2.palette;return {"& .MuiDialog-paper:not(.MuiDialog-paperFullWidth)":{width:394},"& .MuiDialog-paper":{backgroundColor:e.white,boxShadow:"0px 0px 16px 0px rgba(0, 0, 0, 0.11)",borderRadius:o.v2.radius(8)},"& .MuiModal-backdrop":{background:alpha("#000",.2)}}}),Kr=styled(Bi)(({theme:o})=>{let{base:e}=o.v2.palette;return {padding:`${o.v2.spacing(16)} ${o.v2.spacing(16)} ${o.v2.spacing(12)}`,fontSize:"13px",fontWeight:o.typography.fontWeightBolder,lineHeight:"normal",color:e.black,whiteSpace:"nowrap"}}),Ur=styled("hr")(({theme:o})=>{let{grey:e}=o.v2.palette;return {display:"block",border:"none",borderTop:`1px solid ${e[100]}`,margin:0,width:"100%",flexShrink:0}}),Xr=styled(Ii,{shouldForwardProp:o=>o!=="$hasHeading"})(({theme:o,$hasHeading:e})=>{let{grey:t}=o.v2.palette;return {padding:`${e?o.v2.spacing(12):o.v2.spacing(16)} ${o.v2.spacing(16)} ${o.v2.spacing(16)}`,fontSize:"12px",fontWeight:o.typography.fontWeightMedium,lineHeight:"normal",color:t[500]}}),Gr=styled(wi)(({theme:o})=>({padding:`0 ${o.v2.spacing(16)} ${o.v2.spacing(16)}`,gap:o.v2.spacing(8),justifyContent:"flex-end","& > :not(style) ~ :not(style)":{marginLeft:0}}));var _r=forwardRef(({heading:o,actions:e,children:t,onClose:r,open:a,className:s,sx:i,...n},p)=>jsxs(jr,{ref:p,"data-testid":"Dialog",open:a,onClose:r,className:kc(P.root,s),sx:i,...n,children:[o?jsxs(Fragment,{children:[jsx(Kr,{className:P.title,children:o}),jsx(Ur,{"aria-hidden":true,className:P.divider})]}):null,t!=null?jsx(Xr,{className:P.content,$hasHeading:!!o,children:t}):null,e?jsx(Gr,{className:P.actions,children:e}):null]}));_r.displayName="Dialog";var qr=memo(_r);var Do="os-shared-MenuItem",$={root:`${Do}-root`,indicator:`${Do}-indicator`,content:`${Do}-content`,disabled:`${Do}-disabled`},V={unchecked:"unchecked",checked:"checked",indeterminate:"indeterminate"};var Qr=()=>{let{v2:o}=useTheme(),{brand:e,base:t}=o.palette;return jsxs("svg",{width:"14",height:"14",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"0.6",y:"0.6",width:"10.8",height:"10.8",rx:"2.4",fill:e[500]}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.83391 3.74245C9.04243 3.94469 9.05652 4.2875 8.86537 4.50814L5.64586 8.22426C5.55146 8.33322 5.41909 8.39666 5.27942 8.39987C5.13975 8.40308 5.0049 8.34579 4.90612 8.24127L3.15002 6.38321C2.94999 6.17157 2.94999 5.82843 3.15002 5.61679C3.35004 5.40516 3.67435 5.40516 3.87437 5.61679L5.2522 7.07463L8.11024 3.77574C8.30138 3.55511 8.62538 3.5402 8.83391 3.74245Z",fill:t.white})]})},oa=()=>jsx("svg",{width:"14",height:"14",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("rect",{x:"1.19998",y:"1.19998",width:"9.6",height:"9.6",rx:"1.8",fill:"#FAFBFB",stroke:"#D2D5D8",strokeWidth:"1.2"})}),ea=()=>{let{v2:o}=useTheme(),{brand:e}=o.palette;return jsxs("svg",{width:"14",height:"14",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"1.2",y:"1.2",width:"9.6",height:"9.6",rx:"2.4",fill:e[500],stroke:e[500],strokeWidth:"1.2"}),jsx("rect",{x:"3",y:"5.4",width:"6",height:"1.2",rx:"0.5",fill:"#FAFBFB"})]})};var aa=styled(Qe,{shouldForwardProp:o=>o!=="$isDisabled"})(({theme:o,$isDisabled:e=false})=>{let{base:t}=o.v2.palette;return {padding:o.v2.spacing(8),position:"relative",display:"flex",alignItems:"center",gap:o.v2.spacing(8),textTransform:"capitalize",cursor:e?"not-allowed":"pointer",flex:1,fontSize:o.typography.subtitle1.fontSize,opacity:e?.5:1,color:t.black}}),ne=styled("span")({width:14,height:14,flexShrink:0,pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center","& svg":{display:"block"}});function Di(o,e){return e?V.indeterminate:o?V.checked:V.unchecked}var Ai={[V.unchecked]:oa,[V.checked]:Qr,[V.indeterminate]:ea};function Ri(o,e,t){if(o===null)return null;if(o!==void 0)return jsx(ne,{className:$.indicator,"aria-hidden":true,children:o});let r=Di(e,t),a=Ai[r];return jsx(ne,{className:$.indicator,"aria-hidden":true,children:jsx(a,{})})}var sa=forwardRef(({isSelected:o=false,isDisabled:e=false,isIndeterminate:t=false,startAdornment:r,onClick:a,children:s,className:i,sx:n,...p},d)=>{let c=kc($.root,"menu-item",e&&$.disabled,i);return jsxs(aa,{ref:d,"data-testid":"MenuItem",className:c,sx:n,onClick:e?void 0:a,$isDisabled:e,...p,children:[Ri(r,o,t),jsx("span",{className:$.content,children:s})]})});sa.displayName="MenuItem";var na=memo(sa);var ia="os-shared-ToggleButtons",so={root:`${ia}-root`,button:`${ia}-button`},ie={text:"text",icon:"icon"},Ro=ie.text,le={sm:"sm",md:"md"},no=le.md,pe={md:{buttonHeight:28,fontSize:11,containerRadius:4,iconCell:28,iconSlot:14},sm:{buttonHeight:20,fontSize:9,containerRadius:3,iconCell:20,iconSlot:11}},la={text:{paddingX:8},icon:{paddingX:0}};function Ei(o,e){let{palette:t,elevation:r}=o.v2;return e?{backgroundColor:t.background.primary,boxShadow:r[100],color:t.foreground.primary}:{backgroundColor:"transparent",boxShadow:"none",color:t.foreground.secondary}}var ca=styled(Qe,{shouldForwardProp:o=>o!=="$size"})(({theme:o,$size:e=no})=>{let t=pe[e];return {backgroundColor:o.v2.palette.background.secondary,display:"inline-flex",alignItems:"center",padding:o.v2.spacing(2),borderRadius:o.v2.radius(t.containerRadius)}}),ma=styled(Qe,{shouldForwardProp:o=>o!=="$isActive"&&o!=="$type"&&o!=="$size"})(({theme:o,$isActive:e=false,$type:t=Ro,$size:r=no})=>{let a=pe[r],s=la[t],i=t==="icon";return {boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,height:a.buttonHeight,width:i?a.iconCell:"auto",minWidth:i?a.iconCell:0,padding:`0 ${o.v2.spacing(s.paddingX)}`,borderRadius:o.v2.radius(2),fontSize:a.fontSize,fontWeight:o.typography.fontWeightMedium,lineHeight:1,letterSpacing:0,whiteSpace:"nowrap",cursor:"pointer",transition:"background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease",...Ei(o,e),...i&&{"& img, & svg":{width:a.iconSlot,height:a.iconSlot,display:"block"}}}});function ua({options:o,activeKey:e,onChange:t,type:r=Ro,size:a=no,containerProps:s,buttonProps:i,id:n,className:p,sx:d},c){let{className:f,sx:u,...m}=s??{},y=kc(so.root,p,f);return jsx(ca,{ref:c,id:n,"data-testid":"ToggleButtons",className:y,$size:a,sx:jc(d??{},u),...m,children:o.map(x=>jsx(ma,{className:so.button,$isActive:e===x.key,$type:r,$size:a,onClick:()=>t(x.key),...i,children:x.content},x.key))})}var Oi=forwardRef(ua);ua.displayName="ToggleButtons";var ya=memo(Oi);var Zi="os-shared-LazyImage",Wo={root:`${Zi}-root`},Eo={opacity:()=>import('react-lazy-load-image-component/src/effects/opacity.css'),blur:()=>import('react-lazy-load-image-component/src/effects/blur.css'),"black-and-white":()=>import('react-lazy-load-image-component/src/effects/black-and-white.css')};var ga=styled(Qe)({display:"inline-flex",justifyContent:"center",alignItems:"center"});function Ho(o){return o!=null&&o in Eo}var qi=LazyLoadImage,Ca=forwardRef(({effect:o,wrapperProps:e,id:t,className:r,sx:a,placeholderSrc:s,...i},n)=>{let[p,d]=useState(Ho(o));if(useEffect(()=>{if(!Ho(o)){d(false);return}d(true),Eo[o]().finally(()=>{d(false);});},[o]),p)return null;let{className:c,sx:f,style:u,...m}=e??{},y=Ho(o)||!!s||u!=null;return jsx(ga,{component:"span",...m,className:kc(Wo.root,c??r),sx:f!=null?jc(a??{},f):a,children:jsx(qi,{...i,ref:n,effect:o,placeholderSrc:s,id:t,"data-testid":"LazyImage",wrapperProps:y?{style:{display:"flex",justifyContent:"center",alignItems:"center",...u}}:void 0})})});Ca.displayName="LazyImage";var ha=memo(Ca);var M="#FF7A00",de="os-shared-FieldFeedback",J={root:`${de}-root`,icon:`${de}-icon`,message:`${de}-message`};var ba=({severity:o="error",...e})=>{let t=useTheme(),{error:r}=t.v2.palette,a=o==="warning"?M:r[500];return jsx(Ko,{sx:{width:12,height:12},...e,children:jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M6 12C9.30838 12 12 9.30838 12 6C12 2.69162 9.30838 -2.35309e-07 6 -5.24537e-07C2.69162 -8.13764e-07 8.13764e-07 2.69162 5.24537e-07 6C2.35309e-07 9.30838 2.69162 12 6 12ZM6 11.1C3.17801 11.1 0.9 8.82198 0.9 6C0.9 3.17802 3.17802 0.899999 6 0.899999C8.82199 0.899999 11.1 3.17802 11.1 6C11.1 8.82198 8.82198 11.1 6 11.1ZM6 9C6.15913 9 6.31174 8.93679 6.42426 8.82426C6.53679 8.71174 6.6 8.55913 6.6 8.4C6.6 8.24087 6.53679 8.08826 6.42426 7.97574C6.31174 7.86321 6.15913 7.8 6 7.8C5.84087 7.8 5.68826 7.86321 5.57574 7.97574C5.46321 8.08826 5.4 8.24087 5.4 8.4C5.4 8.55913 5.46321 8.71174 5.57574 8.82426C5.68826 8.93679 5.84087 9 6 9ZM6.00703 6.90644C6.12628 6.90458 6.23991 6.85546 6.32296 6.76988C6.40602 6.6843 6.45171 6.56925 6.45 6.45L6.45 3.15C6.45084 3.09037 6.43983 3.03116 6.41759 2.97583C6.39535 2.92049 6.36234 2.87013 6.32047 2.82766C6.2786 2.7852 6.22871 2.75148 6.17369 2.72846C6.11868 2.70544 6.05964 2.69359 6 2.69359C5.94036 2.69359 5.88132 2.70544 5.82631 2.72846C5.77129 2.75148 5.7214 2.7852 5.67953 2.82766C5.63766 2.87013 5.60465 2.92049 5.58241 2.97583C5.56017 3.03116 5.54916 3.09037 5.55 3.15L5.55 6.45C5.54914 6.51023 5.56037 6.57002 5.58304 6.62583C5.60571 6.68163 5.63935 6.73232 5.68197 6.77489C5.72459 6.81745 5.77533 6.85103 5.83116 6.87363C5.887 6.89623 5.9468 6.90739 6.00703 6.90644Z",fill:a})})})},Sa=o=>{let{v2:e}=useTheme(),{success:t}=e.palette;return jsx(Ko,{sx:{width:12,height:12},...o,children:jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M9.63285 0.429835C9.54018 0.432536 9.45219 0.471196 9.38752 0.537631L3.21672 6.70844L0.614302 4.10602C0.581421 4.07177 0.542037 4.04443 0.498457 4.0256C0.454877 4.00676 0.407977 3.99681 0.360503 3.99633C0.313029 3.99585 0.265937 4.00484 0.221983 4.02279C0.178029 4.04073 0.138097 4.06727 0.104526 4.10084C0.0709555 4.13441 0.0444206 4.17434 0.0264755 4.21829C0.00853037 4.26225 -0.000464234 4.30934 1.8446e-05 4.35681C0.000501126 4.40429 0.0104514 4.45119 0.0292865 4.49477C0.0481216 4.53835 0.0754629 4.57773 0.109709 4.61061L2.96442 7.46533C3.03134 7.53222 3.12209 7.5698 3.21672 7.5698C3.31134 7.5698 3.40209 7.53222 3.46901 7.46533L9.89212 1.04222C9.9436 0.992086 9.97874 0.927576 9.99295 0.857134C10.0072 0.786693 9.99978 0.713603 9.97176 0.647428C9.94374 0.581254 9.8964 0.525079 9.83593 0.486255C9.77546 0.447431 9.70468 0.427767 9.63285 0.429835Z",fill:t[700]})})})},va=o=>{let{v2:e}=useTheme(),{base:t}=e.palette;return jsx(Ko,{sx:{width:12,height:12},...o,children:jsx("svg",{width:"12",height:"11",viewBox:"0 0 12 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M6 7.5V5.5M6 3.5H6.005M11 5.5C11 8.26142 8.76142 10.5 6 10.5C3.23858 10.5 1 8.26142 1 5.5C1 2.73858 3.23858 0.5 6 0.5C8.76142 0.5 11 2.73858 11 5.5Z",stroke:t.black,strokeWidth:"0.8",strokeLinecap:"round",strokeLinejoin:"round"})})})};function Vo(o,e){let t=e??"error",{brand:r}=o.v2.palette;switch(t){case "warning":return {borderColor:alpha(M,.15),backgroundColor:alpha(M,.15),textColor:M};case "success":return {borderColor:alpha("#76BB40",.15),backgroundColor:alpha("#76BB40",.15),textColor:"#76BB40"};case "info":return {borderColor:alpha(r[500],.12),backgroundColor:alpha(r[500],.12),textColor:r[500]};case "error":return {borderColor:alpha("#FF3D00",.15),backgroundColor:alpha("#FF3D00",.15),textColor:"#FF3D00"};default:return t}}var Na=styled("div",{shouldForwardProp:o=>o!=="$feedbackType"})(({theme:o,$feedbackType:e})=>{let{backgroundColor:t}=Vo(o,e);return {display:"flex",alignItems:"flex-start",gap:o.v2.spacing(4),minHeight:"32px",padding:`${o.v2.spacing(8)} ${o.v2.spacing(12)}`,background:t,borderRadius:`0 0 ${o.v2.radius(4)} ${o.v2.radius(4)}`}}),ka=styled("div",{shouldForwardProp:o=>o!=="$feedbackType"})(({theme:o,$feedbackType:e})=>{let{textColor:t}=Vo(o,e);return {fontSize:"10px",lineHeight:"16px",display:"block",color:t,wordBreak:"break-word"}}),wa=styled("span")({width:12,height:12,flexShrink:0,marginTop:"2px",display:"inline-flex",alignItems:"center",justifyContent:"center","& svg":{width:12,height:12,display:"block"}});function ol(o){switch(o){case "success":return jsx(Sa,{});case "info":return jsx(va,{});case "error":case "warning":return jsx(ba,{severity:o})}}var Ia=forwardRef(({type:o="error",message:e,icon:t,className:r,sx:a},s)=>{if(!zc(e))return null;let i=o;return jsxs(Na,{ref:s,"data-testid":"FieldFeedback",className:kc(J.root,r),sx:a,$feedbackType:i,children:[t??jsx(wa,{className:J.icon,children:ol(i)}),jsx(ka,{className:J.message,$feedbackType:i,children:e})]})});Ia.displayName="FieldFeedback";var Ba=memo(Ia);var tl="os-shared-ScrollLoader",Oo={root:`${tl}-root`};var Ta=styled(rl)({overflow:"auto",height:"100%",maxHeight:"100%"});function ue(o,e=50){return o.scrollHeight-(o.scrollTop+o.clientHeight)<=e}var Fa=forwardRef(({loadMoreItems:o,hasMore:e,isLoading:t=false,isFetchingNextPage:r,children:a,className:s,sx:i,id:n,...p},d)=>{let[c,f]=useState(false),u=useRef(o),m=useRef(null);u.current=o;let y=useCallback(()=>{e&&!r&&u.current();},[e,r]),x=useCallback(()=>{let g=m.current;g&&ue(g)&&y();},[y]);return useEffect(()=>{let g=m.current;if(g)return g.addEventListener("scroll",x),()=>g.removeEventListener("scroll",x)},[x]),useEffect(()=>{let g=m.current;if(!g||t||c)return;let S=window.setTimeout(()=>{f(true),ue(g)&&y();},1e3);return ()=>window.clearTimeout(S)},[t,y,c]),jsx(Ta,{ref:g=>{m.current=g,typeof d=="function"?d(g):d&&(d.current=g);},id:n,"data-testid":"ScrollLoader",className:kc(Oo.root,s),sx:i,...p,children:a})});Fa.displayName="ScrollLoader";var La=memo(Fa);
|
|
2
|
+
export{ha as $,Bo as A,Lt as B,B as C,Vt as D,U as E,Gt as F,k as G,sr as H,T as I,pr as J,G as K,Cr as L,Y as M,kr as N,w as O,Ar as P,to as Q,Zr as R,P as S,qr as T,$ as U,na as V,so as W,ie as X,le as Y,ya as Z,Wo as _,N as a,M as aa,Be as b,J as ba,po as c,Vo as ca,$e as d,Ba as da,D as e,Oo as ea,Ee as f,La as fa,co as g,Oe as h,mo as i,Ke as j,fo as k,Je as l,A as m,st as n,h as o,ct as p,ho as q,ut as r,bo as s,ht as t,No as u,vt as v,ko as w,wt as x,wo as y,$t as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-
|
|
1
|
+
import {c}from'./chunk-72LYLQAO.js';import {s}from'./chunk-32XNGJJX.js';import {memo,useState,useRef,useEffect}from'react';import {useTranslation}from'react-i18next';import F from'@mui/material/Box';import K from'@mui/material/Button';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var Q=styled(F)(({theme:n})=>({background:n.palette.grey[700],width:27,height:14,display:"inline-flex",alignItems:"center",marginInlineStart:"4px",borderRadius:"10px",padding:"2px 6px",img:{cursor:"pointer"}})),E=styled(F)(()=>({padding:"8px 16px",display:"flex",gap:"8px",justifyContent:"center"})),b=styled(K)(({theme:n})=>({textTransform:"capitalize",minWidth:"auto",width:"100%",borderRadius:"4px",border:`1px solid ${n.palette.info.dark}`,backgroundColor:n.palette.info.dark,fontWeight:700,fontSize:"11px",color:n.palette.common.white,"&:hover":{backgroundColor:n.palette.info.dark}})),O=styled(K)(({theme:n})=>({textTransform:"capitalize",minWidth:"auto",width:"100%",borderRadius:"4px",border:`1px solid ${n.palette.divider}`,backgroundColor:n.palette.common.white,fontWeight:500,fontSize:"11px",color:n.palette.text.primary,"&:hover":{background:"transparent"}}));var v="188px";function $({onCloseDropdown:n,filter:o,styles:g,header:R,searchable:c$1}){let[T,W]=useState([]),{t:f}=useTranslation(),p=useRef([]),B=o?.options?.map(e=>e.value).join(",")??"";useEffect(()=>{let e=i=>{let r=o?.data?.[o.apiKey]??[];if(Array.isArray(r)&&r.length)return new Set(r).has(i)},s=i=>i.map(({placeholder:r,value:t,isSelected:a,icon:l,options:d})=>{let x;if(c$1){let m=p.current.find(y=>y.apiKey===t);x=m!==void 0?m.isSelected??false:(a||e(t)||d?.every(({value:y})=>e(y)))??false;}else x=(a||e(t)||d?.every(({value:m})=>e(m)))??false;return {...r&&{label:r},name:t,selected:x,...l&&{icon:l},...d?.length&&{menuItems:s(d)}}});o.options&&W(s(o.options));},[o?.data,B,c$1]);let h=()=>{p.current=[];},P=e=>{h(),n(e);},I=()=>{if(c$1){let e=new Set(o?.data?.[o.apiKey]??[]);p.current.forEach(({apiKey:s,options:i,isSelected:r})=>{i?i.forEach(({apiKey:t,isSelected:a})=>{a?e.add(t):e.delete(t);}):r?e.add(s):e.delete(s);}),o?.onConfirm?.({[o.apiKey]:[...e]});}else {let e=p.current.reduce((s,{options:i,apiKey:r,isSelected:t})=>{if(i){let a=i.filter(({isSelected:l})=>l);a.length&&s.push(...a.map(({apiKey:l})=>l));}else t&&s.push(r);return s},[]);p.current.length&&o?.onConfirm?.({[o.apiKey]:[...new Set(e)]});}h();},V=s(I,n),A=e=>{I(),n(e);},N=e=>{let s=r=>r.map(({name:t,selected:a,menuItems:l,label:d})=>({...d&&{placeholder:d},apiKey:t,isSelected:a,...l?.length&&{options:s(l)}})),i=s(e);if(c$1){let r=new Set(i.map(t=>t.apiKey));p.current=[...p.current.filter(t=>!r.has(t.apiKey)),...i];}else p.current=i;},w=g?.maxWidth??v,k={maxWidth:w,width:`min(${w}, max-content)`};return jsx(c,{"data-testid":"ColumnFilter_List",title:f("filterBy")||"Filter by",menuItems:T,style:g,menuSx:k,sx:[e=>({...k,marginTop:"10px",textAlign:"left",boxShadow:e.shadows[3],overflow:"hidden",".nested-menu-item":{height:41,zIndex:9999}}),...(Array.isArray(o.sx)?o.sx:[o.sx]).filter(Boolean)],updatedList:N,header:R,onKeyDown:V,footer:jsxs(E,{sx:{position:"sticky",bottom:0,zIndex:99999},children:[jsx(O,{onClick:P,children:f("cancel")},"nested-dropdown-cancel"),jsx(b,{onClick:A,children:f("okay")},"nested-dropdown-ok")]})})}var M=memo($);var ce=M;export{v as a,Q as b,E as c,b as d,O as e,ce as f};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {p}from'./chunk-
|
|
1
|
+
import {p}from'./chunk-2GEJSH7A.js';import {yc}from'./chunk-W6W4YZ7G.js';import {Ci}from'./chunk-3YAJNHQC.js';import {useState,useId}from'react';import T from'@mui/material/Skeleton';import i from'@mui/material/Box';import {styled,Box}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var h=styled(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:12,border:"1.03px solid"})),c=styled(Box)`
|
|
2
2
|
position: absolute;
|
|
3
3
|
`;function d({mainIcon:B,overlayIcon:p$1,mainIconAlt:u="main icon",mainIconSize:t=20,containerSize:a=24,overlayPosition:b={top:10,left:17},borderColor:w="#F2F2F2",label:y="",sx:I,onError:W,containerSx:C}){let[e,s]=useState(true),F=yc(useId(),"icon-with-badge");return jsx(p,{title:y,children:jsx(i,{id:F,"data-testid":"IconWithBadge",display:"flex",alignItems:"center",gap:1,sx:{position:"relative",...C},children:jsxs(h,{style:{borderColor:w,width:a,height:a},children:[t&&e&&jsx(i,{width:t,height:t,children:e&&jsx(T,{variant:"circular",width:`${t}px`,height:`${t}px`})}),jsxs(Fragment,{children:[p$1&&jsx(c,{sx:b,children:p$1}),jsx(i,{width:t,height:t,component:"img",src:B||Ci,alt:u,sx:{borderRadius:"50%",objectFit:"scale-down",opacity:e?0:1,...I},onError:n=>{s(false),n.currentTarget.src=Ci,W?.(n);},onLoad:()=>{s(false);}})]})]})})})}var M=d;export{M as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import'./chunk-WMNFDDLA.js';import {P,O as O$1}from'./chunk-
|
|
1
|
+
import'./chunk-WMNFDDLA.js';import {P,O as O$1}from'./chunk-2GEJSH7A.js';import {yc}from'./chunk-W6W4YZ7G.js';import {memo,useId,useState,useEffect}from'react';import p from'@mui/material/Box';import {styled,alpha}from'@mui/material/styles';import {jsx,Fragment}from'react/jsx-runtime';var f="32px";var g=styled(p,{shouldForwardProp:e=>e!=="isMaximized"})(({theme:e,isMaximized:i})=>({background:alpha(e.palette.common.white,.7),backdropFilter:"blur(8px)",width:183,position:"sticky",padding:"16px 8px",paddingTop:i?f:"16px",height:"100%",overflow:"auto"})),b=styled(p)(()=>({display:"flex",flexDirection:"column",gap:"8px"})),S=styled(p,{shouldForwardProp:e=>e!=="isActive"})(({theme:e,isActive:i})=>({background:i?"linear-gradient(270deg, #147DC5 0.67%, #3DA6E1 98.91%)":"transparent",borderRadius:"4px",padding:"4px 8px",color:i?e.palette.common.white:e.palette.text.primary,fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px",cursor:"pointer",fontWeight:600})),h=styled(p,{shouldForwardProp:e=>e!=="isActive"})(({theme:e,isActive:i})=>({background:i?"#FFFFFF":"transparent",borderRadius:"4px",padding:"4px 8px",color:e.palette.text.primary,fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px",cursor:"pointer",fontWeight:600})),B=styled(P)(({theme:e})=>({background:"transparent",border:"none !important",borderRadius:"4px !important",[`& .${O$1.summary}`]:{padding:0,paddingRight:e.spacing(1),minHeight:"40px",height:"40px","&.Mui-expanded":{minHeight:"40px",height:"40px"},marginBottom:4,borderRadius:"4px !important"},[`& .${O$1.content}`]:{borderTop:"none",padding:0}}));function w({sections:e,isMaximized:i,onClick:m,activeSection:A,activeSubSection:k}){let I=yc(useId(),"expandable-side-bar"),r=A||e?.[0]?.id,F=k||e?.[0]?.subSections?.[0]?.id,[C,c]=useState({});return useEffect(()=>{e?.length&&c(t=>{let o=false,d={...t};for(let x of e)x.id in d||(d[x.id]=r===x.id,o=true);return o?d:t});},[e,r]),useEffect(()=>{r&&c(t=>({...t,[r]:true}));},[r]),jsx(g,{isMaximized:i,id:I,"data-testid":"ExpandableSideBar",children:jsx(b,{children:e?.map(t=>jsx(B,{expanded:C[t.id]??false,onChange:o=>c(d=>({...d,[t.id]:o})),slotProps:{root:{component:"section"}},label:jsx(h,{onClick:()=>{m?.(t.id,t.subSections?.[0]?.id);},isActive:r===t.id,children:t.title}),content:jsx(Fragment,{children:t.subSections?.map(o=>jsx(S,{onClick:()=>{m?.(t.id,o.id);},isActive:F===o.id,children:o.title},`${t.id}-${o.id}`))})},`${t.id}`))})})}var E=memo(w);var O=E;export{O as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-SULHRLPV.js';import {yc}from'./chunk-W6W4YZ7G.js';import {xi}from'./chunk-3YAJNHQC.js';import {memo,useId,useState,useRef,useEffect}from'react';import {useTheme}from'@mui/material';import {motion,AnimatePresence}from'framer-motion';import {useTranslation}from'react-i18next';import K from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var h=styled(motion.input)(({theme:t})=>({padding:"8px",paddingRight:"24px",borderRadius:"4px",height:32,color:t.palette.text.primary,fontSize:"11px",outline:0,zIndex:10,background:t.palette.common.white,display:"flex",minWidth:0,flexGrow:1,boxShadow:`0px 0px 4px 0px ${t.palette.info.dark}80`,border:`1px solid ${t.palette.info.dark}`,"::placeholder":{color:"#D5D5D5"}})),x=styled(motion.img)(()=>({position:"absolute",zIndex:11,cursor:"pointer"})),I=styled(b)(()=>({minWidth:"auto",borderRadius:"4px",paddingInline:"8px",position:"relative",zIndex:11})),g=styled(K)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"relative",zIndex:3,height:32,gap:8}));function j({onSearchChange:t,placeholder:v,...b}){let w=yc(useId(),"search-button"),[e,p]=useState(false),[C,i]=useState(false),[r,l]=useState(""),c=useRef(null);useEffect(()=>{e&&c.current?.focus();},[e]);let{t:B}=useTranslation(),E=useTheme(),T=()=>{i(true),p(false),t?.(""),l("");},k=()=>{i(false),p(true),P();},P=()=>{r&&t?.(r);},R=a=>{a.key==="Enter"&&t?.(r);},z=a=>{l(a.currentTarget.value);},D={duration:.18,ease:"easeInOut"},W={duration:.05,ease:"easeIn"},A=e||C;return jsxs(g,{id:w,"data-testid":"SearchButton",children:[jsx(AnimatePresence,{initial:false,onExitComplete:()=>i(false),children:e&&jsxs(Fragment,{children:[jsx(h,{ref:c,initial:{width:30},animate:{width:200},exit:{width:30,border:`1px solid ${E.palette.divider}`,boxShadow:"none"},transition:D,style:{willChange:"width"},placeholder:v??(B("search")||""),onKeyDown:R,onChange:z}),jsx(x,{style:{right:48},initial:{opacity:1},exit:{opacity:0},transition:W,src:xi,alt:"close",onClick:T})]})}),jsx(I,{...b,variant:A?"active":"inActive",icon:"search",onClick:k})]})}var y=memo(j);var pt=y;export{pt as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {T,S,b as b$1}from'./chunk-
|
|
1
|
+
import {T,S,b as b$1}from'./chunk-2GEJSH7A.js';import {forwardRef,memo,createContext,useState,useRef,useCallback,useMemo,useContext}from'react';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var u=styled(T)(({theme:o})=>({[`& .${S.title}`]:{fontSize:"13px",fontWeight:700,lineHeight:o.typography.h6.lineHeight,borderBottom:`1px solid ${o.palette.divider}`,margin:0,padding:"16px 16px 16px 12px",color:o.palette.text.primary}})),x=styled("div")(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing(2),minWidth:"256px",padding:o.spacing(2)})),d=styled(b$1)(({theme:o})=>({paddingInline:o.spacing(3),paddingBlock:o.spacing(1),borderRadius:o.spacing(.5),minWidth:64,fontSize:"11px",fontWeight:o.typography.fontWeightMedium,color:o.palette.text.primary,textTransform:"none",border:`1px solid ${o.palette.divider}`,boxShadow:"none","&:hover":{boxShadow:"none",backgroundColor:o.palette.action.hover}})),y=styled("p")(({theme:o})=>({margin:0,fontSize:o.typography.fontSize,fontWeight:o.typography.fontWeightMedium,lineHeight:o.typography.body1.lineHeight})),D=styled("div")(({theme:o})=>({display:"flex",gap:o.spacing(1),justifyContent:"flex-end"}));var v=forwardRef(({message:o,title:t,confirmText:a,cancelText:i,onConfirm:r,onCancel:s,className:m,sx:e,...n},T)=>jsx(u,{ref:T,"data-testid":"ConfirmDialog",heading:t,className:m,sx:e,...n,children:jsxs(x,{children:[jsx(y,{children:o}),jsxs(D,{children:[jsx(d,{variant:"ghost",onClick:s,children:i||"No"}),jsx(d,{variant:"ghost",onClick:r,children:a||"Yes"})]})]})}));v.displayName="ConfirmDialog";var b=memo(v);var p=createContext(null);function W(){let o=useContext(p);if(!o)throw new Error("useConfirm must be used within <ConfirmDialogProvider>");return o}var R={open:false,message:null,title:void 0,confirmText:void 0,cancelText:void 0,sx:void 0,dismissible:true};function z({children:o}){let[t,a]=useState(R),i=useRef(null),r=useCallback(e=>{let n=i.current;n&&(i.current=null,a(R),n(e));},[]),s=useCallback(e=>new Promise(n=>{i.current?.(false),i.current=n,a({open:true,dismissible:e.dismissible??true,message:e.message,title:e.title,confirmText:e.confirmText,cancelText:e.cancelText,sx:e.sx});}),[]),m=useMemo(()=>({confirm:s}),[s]);return jsxs(p.Provider,{value:m,children:[o,jsx(b,{open:t.open,message:t.message,title:t.title,confirmText:t.confirmText,cancelText:t.cancelText,onConfirm:()=>r(true),onCancel:()=>r(false),onClose:t.dismissible?()=>r(false):void 0,sx:t.sx})]})}var O=memo(z);export{W as a,O as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-YL2COX6W.js';import {ca,da}from'./chunk-RXT7RBES.js';import {yc,Ac}from'./chunk-W6W4YZ7G.js';import {Db,B,Rf}from'./chunk-3YAJNHQC.js';import {memo,useId,useState,useEffect,useRef}from'react';import {styled,Box,TextField,Button,Typography,FormControl,InputLabel,Select,MenuItem}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import W from'@mui/material/Box';import Me from'@mui/material/ClickAwayListener';import ve from'@mui/material/Popper';import T from'@mui/material/Skeleton';import {styled as styled$1}from'@mui/material/styles';import {useFormContext,Controller}from'react-hook-form';var _=styled(Box)(()=>({display:"flex",flexDirection:"column",gap:"4px",width:"100%",height:40,"& *":{flex:1,margin:"0px !important"}})),I=styled(TextField,{shouldForwardProp:e=>!["hasError","feedbackType","hasFeedback","hideArrows"].includes(e)})(({theme:e,hasError:n,feedbackType:o,hasFeedback:l,hideArrows:t})=>{let{borderColor:i}=ca(e,o),a=l?"4px 4px 0 0":"4px",s="#F2F2F2";return o&&(s=i),n&&!o&&(s=e.palette.error.main),{"& .MuiFormLabel-asterisk":{color:"red"},"& .MuiInputBase-root":{maxHeight:"40px !important",alignItems:"flex-end !important"},"& fieldset":{border:"1px solid red"},"&:hover fieldset":{border:"1px solid green"},"&.Mui-focused fieldset":{border:"1px solid blue"},border:`1px solid ${s}`,borderBottom:l?"none":void 0,borderRadius:a,"& .MuiInputBase-input":{margin:"0px !important",padding:"0px !important",color:"#20232B !important",fontSize:"11px !important",fontStyle:"normal !important",fontWeight:"500 !important",lineHeight:"130% !important"},"& .MuiFormLabel-root":{fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%",transform:"translate(0, 8px) scale(1)"},".MuiFormLabel-root.MuiFormLabel-filled, .MuiFormLabel-root.MuiInputLabel-shrink":{transform:"translate(0, -1.5px) scale(0.75) "},".MuiFormLabel-root.Mui-focused":{transform:"translate(0, -1.5px) scale(0.75)",fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%"},...t&&{"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:0},"& input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}}}}),K=styled("small")(({theme:e})=>({color:e.palette.error.main,fontSize:"10px",lineHeight:"10px",marginTop:"4px",display:"block"}));var U=styled("div")(()=>({position:"relative",display:"flex",justifyContent:"flex-end",alignItems:"center"})),O=styled(I)(({theme:e})=>({fontSize:"11px",lineHeight:"11px",color:e.palette.common.black,borderRadius:"5px",boxShadow:"0px 0px 6px 0px rgba(0, 0, 0, 0.11);",padding:"4px 8px",height:"32px",border:"none",outline:"none",width:"100%","&:focus":{border:"1px solid #1F88D0"}})),G=styled(Button)(({theme:e})=>({display:"flex",height:"24px",padding:"8px",justifyContent:"center",alignItems:"center",gap:"8px",backgroundColor:e.palette.divider,color:e.palette.grey[700],fontSize:"9px",fontWeight:500,textTransform:"none",position:"absolute",right:4,opacity:"1 !important",top:4,borderRadius:"4px"}));function L(e){let n=yc(useId(),"file-input"),o=useRef(null);return jsxs(Fragment,{children:[jsxs(U,{id:n,"data-testid":"InputContainer",children:[jsx(O,{value:o.current?.files?.[0]?.name||"",...e}),jsx(G,{onClick:()=>{o.current?.click();},children:"Browse"})]}),jsx("input",{type:"file",ref:o,style:{display:"none"}})]})}var Fe=L;var Q=styled$1("button")(({theme:e})=>({display:"flex",gap:"4px",alignItems:"center",".logo":{width:"15.568px",height:"10.889px",borderRadius:"3px"},".arrow":{width:14},span:{color:e.palette.text.primary,fontWeight:500,fontSize:"11px"},height:24,cursor:"pointer"})),X=styled$1(W)(({theme:e})=>({backgroundColor:e.palette.common.white,padding:"4px 8px",borderRadius:"4px",border:`1px solid ${e.palette.divider}`,width:100})),Y=styled$1("ul")(()=>({listStyle:"none",padding:0,margin:0,maxHeight:100,overflow:"auto"})),Z=styled$1("li")(({theme:e})=>({display:"flex",gap:"4px",alignItems:"center",".logo":{width:"15.568px",height:"10.889px",borderRadius:"3px"},".arrow":{width:14},span:{color:e.palette.text.primary,fontWeight:500,fontSize:"11px"},height:24,cursor:"pointer"})),j=styled$1(a)(()=>({height:24,padding:"4px",marginBottom:"4px"})),ee=styled$1(W)(()=>({color:"red !important"}));styled$1("small")(({theme:e})=>({color:e.palette.error.main,fontSize:"10px",lineHeight:"10px",marginTop:"4px",display:"block"}));var te=styled$1(W)(({theme:e})=>({border:`1px solid ${e.palette.divider}`,display:"flex",position:"relative",paddingInline:"8px",alignItems:"center",borderRadius:"4px",height:"40px"})),oe=styled$1(a,{shouldForwardProp:e=>e!=="error"})(({error:e})=>({img:{cursor:"pointer"},...e&&{borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:"none"}}));function Pe({defaultCountry:e,value:n,onChangeCountry:o,required:l,countries:t=[],isLoading:i=false}){let a=yc(useId(),"countries-dropdown"),[s,g]=useState(null),[F,u]=useState([]),[b,h]=useState(),ue=()=>{if(t&&e){let r=t.find(x=>x.iso2===e);r&&o?.(r);}};useEffect(()=>{u(t||[]),ue();},[t]);let A=!!s,xe=r=>{r.stopPropagation(),g(r.currentTarget);},N=()=>{g(null),h(void 0);},ce=r=>{o?.(r),N(),u(t);},fe=r=>{let x=Number(r.target.value);if(h(x),!x){u(t);return}u(t.filter(ge=>ge.idd_prefix.toString().startsWith(x.toString())));};return i?jsx(T,{variant:"rectangular",width:56.5,height:20,sx:{borderRadius:"4px"}}):jsx(Me,{onClickAway:N,children:jsxs(W,{id:a,"data-testid":"CountriesCode",sx:{position:"relative"},children:[jsxs(Q,{type:"button",onClick:xe,sx:{backgroundColor:"transparent",border:"none",height:34},children:[n?.logo?jsx("img",{src:n.logo,alt:"c",className:"logo"}):jsx(T,{variant:"rectangular",className:"logo"}),jsx("span",{children:`+${n?.idd_prefix}`}),l&&jsx(ee,{component:"span",children:"*"}),jsx(W,{component:"img",src:Db,alt:"d",className:"arrow",sx:{...A&&{transform:"rotate(180deg)"}}})]}),jsx(ve,{open:A,anchorEl:s,children:jsxs(X,{component:"article","data-testid":"CountriesWrapper",children:[jsx(j,{endAdornment:jsx("img",{src:B,alt:"arrow"}),onChange:fe,value:b,hideArrows:true}),jsx(Y,{children:F.map(r=>jsxs(Z,{onClick:()=>{ce(r);},children:[r.logo?jsx("img",{src:r.logo,alt:"c",className:"logo"}):jsx(T,{variant:"rectangular",className:"logo"}),jsx("span",{children:`+${r.idd_prefix}`})]},`country-code-${r.countryId}`))})]})})]})})}var ne=memo(Pe);var Le=ne;function E(e){let n=yc(useId(),"inputs-input"),{control:o}=useFormContext();return jsx(Controller,{name:e.name,control:o,render:({field:l,fieldState:{error:t}})=>{let i=e.feedback,{isProvided:a,isVisible:s,type:g}=Ac(i),F=e.label??e.placeholder,u=e.label&&typeof e.placeholder=="string"?e.placeholder:void 0,b=t?.message??e.helperText,h=!a&&b?jsx(K,{children:b}):null;return jsxs(Box,{sx:{display:"flex",alignItems:"stretch",height:"100%",flexDirection:"column",flex:1},children:[jsx(_,{id:n,"data-testid":"InputWrapper",children:jsx(I,{rows:1,hasError:(!!t?.message||!!e.error)&&!a,hasFeedback:s,feedbackType:g,...l,variant:"standard",label:F,placeholder:u,size:"small",required:e.required,fullWidth:true,InputProps:{disabled:e.disabled,disableUnderline:true,...e.InputProps,sx:{fontSize:"11px",height:"40px",padding:"8px",borderRadius:s?"4px 4px 0 0":"4px",...e.InputProps?.sx},endAdornment:e?.InputProps?.endAdornment},InputLabelProps:{...e.InputLabelProps,sx:{color:"#8D8D94 !important",fontSize:"11px",padding:"8px",...e.InputLabelProps?.sx}},sx:e?.sx,disabled:e?.disabled,focused:e?.focused,type:e?.type,hideArrows:e?.hideArrows,onKeyDown:e?.onKeyDown})}),h,a?jsx(da,{...i}):null]})}})}var H=E;var pe=styled("img")(()=>({width:"12px",height:"12px",marginRight:"4px"})),le=styled("div")(({theme:e})=>({display:"flex",alignItems:"center",color:`${e.palette.custom[500]}`,fontSize:"10px",padding:"8px 12px",background:"#FF000026",borderRadius:"0 0 4px 4px",borderTop:"none",height:"32px"}));function z({showSearchIcon:e=true,error:n,errorMessage:o,feedback:l,...t}){let i=yc(useId(),"search-input"),a=!!(n&&o&&!l);return jsxs(Box,{id:i,"data-testid":"SearchInput",children:[jsx(H,{InputProps:{endAdornment:!t.disabled&&e&&jsx(Box,{component:"img",maxWidth:"16px",maxHeight:"16px",src:B,alt:"search"}),sx:{...a&&{border:"1px solid #FF000026",borderBottom:"none",borderRadius:"4px 4px 0 0"}},...t.InputProps},sx:{...a&&{border:"1px solid #FF000026",borderBottom:"none",borderRadius:"4px 4px 0 0"}},feedback:l,error:n,...t}),a&&jsxs(le,{children:[jsx(pe,{src:Rf}),jsx(Typography,{color:"red",fontSize:"10px",children:o})]})]})}var Ae=z;function D(e){let n=yc(useId(),"inputs-select"),{control:o}=useFormContext();return jsx(Controller,{name:e.name,control:o,render:({field:l,fieldState:{error:t}})=>jsxs(Box,{id:n,"data-testid":"InputsSelect",sx:{display:"flex",alignItems:"stretch",height:"100%",flexDirection:"column",flex:1},children:[jsxs(FormControl,{variant:"filled",sx:{minWidth:52,height:"40px !important",maxHeight:"40px !important",width:"100%","& .MuiFormLabel-asterisk":{color:"red"},"& .MuiFormLabel-root":{fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%",transform:"translate(8px, 15px) scale(1)"},".MuiFormLabel-root.MuiFormLabel-filled":{transform:"translate(8px, 8px) scale(0.75) "},".MuiFormLabel-root.Mui-focused":{transform:"translate(8px, 8px) scale(0.75)",fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%"}},required:e.required,children:[jsx(InputLabel,{id:"demo-simple-select-filled-label",sx:{fontSize:"11px",color:"#8D8D94 !important"},children:e.label}),jsx(Select,{inputProps:{sx:{backgroundColor:"#F9F9F9 !important",borderRadius:"4px",fontSize:"11px"}},...l,value:l.value??"",error:!!t,disableUnderline:true,required:true,labelId:"demo-simple-select-filled-label",id:"demo-simple-select-filled",sx:{width:"100%",height:"40px !important",maxHeight:"40px !important",borderRadius:"4px",overflow:"hidden",".MuiSelect-select":{padding:"0px 8px !important",height:"40px !important",maxHeight:"40px !important",display:"flex",alignItems:"flex-end !important"},".MuiSelect-filled":{padding:"0px 8px !important"},...t&&{border:"1px solid #FF3D00"}},children:(e.options||[]).map(i=>jsx(MenuItem,{value:i.value??"",sx:{fontSize:"12px"},children:i.label},i.value??""))})]}),t?.message&&jsx(Box,{component:"small",sx:i=>({color:i.palette.error.main,fontSize:"10px",lineHeight:"10px",marginTop:"4px",display:"block"}),children:t.message})]})})}var Oe=D;export{Fe as a,te as b,oe as c,Le as d,H as e,Ae as f,Oe as g};
|
|
1
|
+
import {a}from'./chunk-YL2COX6W.js';import {ca,da}from'./chunk-2GEJSH7A.js';import {yc,Ac}from'./chunk-W6W4YZ7G.js';import {Db,B,Rf}from'./chunk-3YAJNHQC.js';import {memo,useId,useState,useEffect,useRef}from'react';import {styled,Box,TextField,Button,Typography,FormControl,InputLabel,Select,MenuItem}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import W from'@mui/material/Box';import Me from'@mui/material/ClickAwayListener';import ve from'@mui/material/Popper';import T from'@mui/material/Skeleton';import {styled as styled$1}from'@mui/material/styles';import {useFormContext,Controller}from'react-hook-form';var _=styled(Box)(()=>({display:"flex",flexDirection:"column",gap:"4px",width:"100%",height:40,"& *":{flex:1,margin:"0px !important"}})),I=styled(TextField,{shouldForwardProp:e=>!["hasError","feedbackType","hasFeedback","hideArrows"].includes(e)})(({theme:e,hasError:n,feedbackType:o,hasFeedback:l,hideArrows:t})=>{let{borderColor:i}=ca(e,o),a=l?"4px 4px 0 0":"4px",s="#F2F2F2";return o&&(s=i),n&&!o&&(s=e.palette.error.main),{"& .MuiFormLabel-asterisk":{color:"red"},"& .MuiInputBase-root":{maxHeight:"40px !important",alignItems:"flex-end !important"},"& fieldset":{border:"1px solid red"},"&:hover fieldset":{border:"1px solid green"},"&.Mui-focused fieldset":{border:"1px solid blue"},border:`1px solid ${s}`,borderBottom:l?"none":void 0,borderRadius:a,"& .MuiInputBase-input":{margin:"0px !important",padding:"0px !important",color:"#20232B !important",fontSize:"11px !important",fontStyle:"normal !important",fontWeight:"500 !important",lineHeight:"130% !important"},"& .MuiFormLabel-root":{fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%",transform:"translate(0, 8px) scale(1)"},".MuiFormLabel-root.MuiFormLabel-filled, .MuiFormLabel-root.MuiInputLabel-shrink":{transform:"translate(0, -1.5px) scale(0.75) "},".MuiFormLabel-root.Mui-focused":{transform:"translate(0, -1.5px) scale(0.75)",fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%"},...t&&{"& input[type=number]":{MozAppearance:"textfield"},"& input[type=number]::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:0},"& input[type=number]::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}}}}),K=styled("small")(({theme:e})=>({color:e.palette.error.main,fontSize:"10px",lineHeight:"10px",marginTop:"4px",display:"block"}));var U=styled("div")(()=>({position:"relative",display:"flex",justifyContent:"flex-end",alignItems:"center"})),O=styled(I)(({theme:e})=>({fontSize:"11px",lineHeight:"11px",color:e.palette.common.black,borderRadius:"5px",boxShadow:"0px 0px 6px 0px rgba(0, 0, 0, 0.11);",padding:"4px 8px",height:"32px",border:"none",outline:"none",width:"100%","&:focus":{border:"1px solid #1F88D0"}})),G=styled(Button)(({theme:e})=>({display:"flex",height:"24px",padding:"8px",justifyContent:"center",alignItems:"center",gap:"8px",backgroundColor:e.palette.divider,color:e.palette.grey[700],fontSize:"9px",fontWeight:500,textTransform:"none",position:"absolute",right:4,opacity:"1 !important",top:4,borderRadius:"4px"}));function L(e){let n=yc(useId(),"file-input"),o=useRef(null);return jsxs(Fragment,{children:[jsxs(U,{id:n,"data-testid":"InputContainer",children:[jsx(O,{value:o.current?.files?.[0]?.name||"",...e}),jsx(G,{onClick:()=>{o.current?.click();},children:"Browse"})]}),jsx("input",{type:"file",ref:o,style:{display:"none"}})]})}var Fe=L;var Q=styled$1("button")(({theme:e})=>({display:"flex",gap:"4px",alignItems:"center",".logo":{width:"15.568px",height:"10.889px",borderRadius:"3px"},".arrow":{width:14},span:{color:e.palette.text.primary,fontWeight:500,fontSize:"11px"},height:24,cursor:"pointer"})),X=styled$1(W)(({theme:e})=>({backgroundColor:e.palette.common.white,padding:"4px 8px",borderRadius:"4px",border:`1px solid ${e.palette.divider}`,width:100})),Y=styled$1("ul")(()=>({listStyle:"none",padding:0,margin:0,maxHeight:100,overflow:"auto"})),Z=styled$1("li")(({theme:e})=>({display:"flex",gap:"4px",alignItems:"center",".logo":{width:"15.568px",height:"10.889px",borderRadius:"3px"},".arrow":{width:14},span:{color:e.palette.text.primary,fontWeight:500,fontSize:"11px"},height:24,cursor:"pointer"})),j=styled$1(a)(()=>({height:24,padding:"4px",marginBottom:"4px"})),ee=styled$1(W)(()=>({color:"red !important"}));styled$1("small")(({theme:e})=>({color:e.palette.error.main,fontSize:"10px",lineHeight:"10px",marginTop:"4px",display:"block"}));var te=styled$1(W)(({theme:e})=>({border:`1px solid ${e.palette.divider}`,display:"flex",position:"relative",paddingInline:"8px",alignItems:"center",borderRadius:"4px",height:"40px"})),oe=styled$1(a,{shouldForwardProp:e=>e!=="error"})(({error:e})=>({img:{cursor:"pointer"},...e&&{borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:"none"}}));function Pe({defaultCountry:e,value:n,onChangeCountry:o,required:l,countries:t=[],isLoading:i=false}){let a=yc(useId(),"countries-dropdown"),[s,g]=useState(null),[F,u]=useState([]),[b,h]=useState(),ue=()=>{if(t&&e){let r=t.find(x=>x.iso2===e);r&&o?.(r);}};useEffect(()=>{u(t||[]),ue();},[t]);let A=!!s,xe=r=>{r.stopPropagation(),g(r.currentTarget);},N=()=>{g(null),h(void 0);},ce=r=>{o?.(r),N(),u(t);},fe=r=>{let x=Number(r.target.value);if(h(x),!x){u(t);return}u(t.filter(ge=>ge.idd_prefix.toString().startsWith(x.toString())));};return i?jsx(T,{variant:"rectangular",width:56.5,height:20,sx:{borderRadius:"4px"}}):jsx(Me,{onClickAway:N,children:jsxs(W,{id:a,"data-testid":"CountriesCode",sx:{position:"relative"},children:[jsxs(Q,{type:"button",onClick:xe,sx:{backgroundColor:"transparent",border:"none",height:34},children:[n?.logo?jsx("img",{src:n.logo,alt:"c",className:"logo"}):jsx(T,{variant:"rectangular",className:"logo"}),jsx("span",{children:`+${n?.idd_prefix}`}),l&&jsx(ee,{component:"span",children:"*"}),jsx(W,{component:"img",src:Db,alt:"d",className:"arrow",sx:{...A&&{transform:"rotate(180deg)"}}})]}),jsx(ve,{open:A,anchorEl:s,children:jsxs(X,{component:"article","data-testid":"CountriesWrapper",children:[jsx(j,{endAdornment:jsx("img",{src:B,alt:"arrow"}),onChange:fe,value:b,hideArrows:true}),jsx(Y,{children:F.map(r=>jsxs(Z,{onClick:()=>{ce(r);},children:[r.logo?jsx("img",{src:r.logo,alt:"c",className:"logo"}):jsx(T,{variant:"rectangular",className:"logo"}),jsx("span",{children:`+${r.idd_prefix}`})]},`country-code-${r.countryId}`))})]})})]})})}var ne=memo(Pe);var Le=ne;function E(e){let n=yc(useId(),"inputs-input"),{control:o}=useFormContext();return jsx(Controller,{name:e.name,control:o,render:({field:l,fieldState:{error:t}})=>{let i=e.feedback,{isProvided:a,isVisible:s,type:g}=Ac(i),F=e.label??e.placeholder,u=e.label&&typeof e.placeholder=="string"?e.placeholder:void 0,b=t?.message??e.helperText,h=!a&&b?jsx(K,{children:b}):null;return jsxs(Box,{sx:{display:"flex",alignItems:"stretch",height:"100%",flexDirection:"column",flex:1},children:[jsx(_,{id:n,"data-testid":"InputWrapper",children:jsx(I,{rows:1,hasError:(!!t?.message||!!e.error)&&!a,hasFeedback:s,feedbackType:g,...l,variant:"standard",label:F,placeholder:u,size:"small",required:e.required,fullWidth:true,InputProps:{disabled:e.disabled,disableUnderline:true,...e.InputProps,sx:{fontSize:"11px",height:"40px",padding:"8px",borderRadius:s?"4px 4px 0 0":"4px",...e.InputProps?.sx},endAdornment:e?.InputProps?.endAdornment},InputLabelProps:{...e.InputLabelProps,sx:{color:"#8D8D94 !important",fontSize:"11px",padding:"8px",...e.InputLabelProps?.sx}},sx:e?.sx,disabled:e?.disabled,focused:e?.focused,type:e?.type,hideArrows:e?.hideArrows,onKeyDown:e?.onKeyDown})}),h,a?jsx(da,{...i}):null]})}})}var H=E;var pe=styled("img")(()=>({width:"12px",height:"12px",marginRight:"4px"})),le=styled("div")(({theme:e})=>({display:"flex",alignItems:"center",color:`${e.palette.custom[500]}`,fontSize:"10px",padding:"8px 12px",background:"#FF000026",borderRadius:"0 0 4px 4px",borderTop:"none",height:"32px"}));function z({showSearchIcon:e=true,error:n,errorMessage:o,feedback:l,...t}){let i=yc(useId(),"search-input"),a=!!(n&&o&&!l);return jsxs(Box,{id:i,"data-testid":"SearchInput",children:[jsx(H,{InputProps:{endAdornment:!t.disabled&&e&&jsx(Box,{component:"img",maxWidth:"16px",maxHeight:"16px",src:B,alt:"search"}),sx:{...a&&{border:"1px solid #FF000026",borderBottom:"none",borderRadius:"4px 4px 0 0"}},...t.InputProps},sx:{...a&&{border:"1px solid #FF000026",borderBottom:"none",borderRadius:"4px 4px 0 0"}},feedback:l,error:n,...t}),a&&jsxs(le,{children:[jsx(pe,{src:Rf}),jsx(Typography,{color:"red",fontSize:"10px",children:o})]})]})}var Ae=z;function D(e){let n=yc(useId(),"inputs-select"),{control:o}=useFormContext();return jsx(Controller,{name:e.name,control:o,render:({field:l,fieldState:{error:t}})=>jsxs(Box,{id:n,"data-testid":"InputsSelect",sx:{display:"flex",alignItems:"stretch",height:"100%",flexDirection:"column",flex:1},children:[jsxs(FormControl,{variant:"filled",sx:{minWidth:52,height:"40px !important",maxHeight:"40px !important",width:"100%","& .MuiFormLabel-asterisk":{color:"red"},"& .MuiFormLabel-root":{fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%",transform:"translate(8px, 15px) scale(1)"},".MuiFormLabel-root.MuiFormLabel-filled":{transform:"translate(8px, 8px) scale(0.75) "},".MuiFormLabel-root.Mui-focused":{transform:"translate(8px, 8px) scale(0.75)",fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%"}},required:e.required,children:[jsx(InputLabel,{id:"demo-simple-select-filled-label",sx:{fontSize:"11px",color:"#8D8D94 !important"},children:e.label}),jsx(Select,{inputProps:{sx:{backgroundColor:"#F9F9F9 !important",borderRadius:"4px",fontSize:"11px"}},...l,value:l.value??"",error:!!t,disableUnderline:true,required:true,labelId:"demo-simple-select-filled-label",id:"demo-simple-select-filled",sx:{width:"100%",height:"40px !important",maxHeight:"40px !important",borderRadius:"4px",overflow:"hidden",".MuiSelect-select":{padding:"0px 8px !important",height:"40px !important",maxHeight:"40px !important",display:"flex",alignItems:"flex-end !important"},".MuiSelect-filled":{padding:"0px 8px !important"},...t&&{border:"1px solid #FF3D00"}},children:(e.options||[]).map(i=>jsx(MenuItem,{value:i.value??"",sx:{fontSize:"12px"},children:i.label},i.value??""))})]}),t?.message&&jsx(Box,{component:"small",sx:i=>({color:i.palette.error.main,fontSize:"10px",lineHeight:"10px",marginTop:"4px",display:"block"}),children:t.message})]})})}var Oe=D;export{Fe as a,te as b,oe as c,Le as d,H as e,Ae as f,Oe as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-ZIKWCAC5.js';import {z}from'./chunk-2GEJSH7A.js';import {yc}from'./chunk-W6W4YZ7G.js';import {Sh}from'./chunk-3YAJNHQC.js';import {memo,useId}from'react';import {styled,Box}from'@mui/material';import {jsxs,jsx}from'react/jsx-runtime';var a=styled(Box,{shouldForwardProp:t=>t!=="isLongLabel"})(({theme:t,isLongLabel:e})=>({display:"flex",justifyContent:"center",alignItems:"center",padding:"6px 16px",height:"32px",background:t.palette.background.gradient.shadedBlue,color:t.palette.common.white,borderRadius:"50px",fontSize:"11px",gap:t.spacing(1),minWidth:e?"12rem":"8.4rem",marginRight:"auto",position:"relative"}));function u({ids:t,visible:e,label:o,onDismiss:c,dismissible:m=true}){let d=yc(useId(),"active-filter-chip");return e?jsxs(a,{id:d,"data-testid":"ActiveFilterChip",isLongLabel:(o?.length??0)>11,children:[o?jsx(b,{children:o}):jsx("span",{children:t?.join(",")}),m&&jsx(z,{pointer:true,round:true,onClick:c,color:"active",sx:{position:"absolute",right:"8px"},children:jsx("img",{src:Sh,alt:"close",style:{width:"8px",height:"7px"}})})]}):null}var s=memo(u);var S=s;export{S as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$4}from'./chunk-UJSTHVLW.js';import {a as a$3}from'./chunk-5ZZCVF4B.js';import {j,a as a$5}from'./chunk-SLTY4KD6.js';import {a}from'./chunk-KUOKFWXS.js';import {a as a$2}from'./chunk-WJML27P6.js';import {x}from'./chunk-RXT7RBES.js';import {a as a$1}from'./chunk-SUBIH236.js';import {lc,yc,o}from'./chunk-W6W4YZ7G.js';import {U}from'./chunk-N372QRVU.js';import {Vc,Wc,Xj,Yj,Zj,ec,fc,_j,dc}from'./chunk-3YAJNHQC.js';import {memo,forwardRef,useState,useMemo,useRef,useId,useEffect,useCallback}from'react';import S from'@mui/material/Box';import bt from'@mui/material/Popper';import Pt from'dayjs';import {useTranslation}from'react-i18next';import {Calendar,DateObject}from'react-multi-date-picker';import Ko from'@mui/material/ClickAwayListener';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';import he from'@mui/material/Button';import q from'react-date-object';import ot from'react-date-object/calendars/arabic';import tt from'react-date-object/calendars/gregorian';import rt from'react-date-object/locales/arabic_ar';import nt from'react-date-object/locales/arabic_en';import it from'react-date-object/locales/gregorian_ar';import at from'react-date-object/locales/gregorian_en';var Ne=styled(S)(({theme:e})=>({color:e.palette.grey[700],fontSize:"9px",fontWeight:500,marginBottom:"6px"})),Ke=styled(S,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:o})=>({borderRadius:"4px",border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,height:32,padding:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",...o&&{border:`1px solid ${e.palette.info.dark}`,background:e.palette.common.white,boxShadow:e.shadows[7]}})),_e=styled(S)(({theme:e})=>({borderRadius:"8px",background:e.palette.common.white,boxShadow:"0px 8px 36px 0px rgba(0, 0, 0, 0.15)",textAlign:"center",color:e.palette.grey[900],fontSize:"12px",fontWeight:500,lineHeight:"20px",letterSpacing:"0.1px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px",flexDirection:"column"})),qe=styled(S)(({theme:e})=>({width:71,padding:"4px 0",cursor:"pointer","&:hover, &.active":{borderRadius:"100px",background:e.palette.info.light}}));var Je={day:"Day",month:"Month",quarter:"Quarter",year:"Year"};function qo({sx:e,groupBy:o,isCalenderOpen:a$1,onUpdate:t}){let[n,p]=useState(null),l=!!n&&a$1,{t:m}=useTranslation(),c=()=>{p(null);},u=d=>{p(d.currentTarget);},s=d=>{t?.(d),c();};return jsx(Ko,{onClickAway:c,children:jsxs(S,{sx:e,children:[jsx(Ne,{children:m("groupedBy")}),jsxs(Ke,{onClick:u,open:l,children:[jsx("span",{children:Je[o]}),jsx(S,{component:"img",src:Wc,alt:"arrow",sx:{...l&&{transform:"rotate(180deg)"}}})]}),jsx(a,{open:l,anchorEl:n,children:jsx(_e,{sx:{width:n?.clientWidth},children:Object.entries(Je).map(([d,i])=>jsx(qe,{onClick:()=>{s(d);},className:o===d?"active":"",children:i},`${d}-groupedBy`))})})]})})}var Ve=memo(qo);var eo=Ve;var oo=styled(S)(({theme:e})=>({border:"1px solid",borderColor:e.palette.divider,borderRadius:"50px",paddingInline:"6px 12px",color:e.palette.text.primary,fontSize:"11px",display:"flex",gap:"8px",alignItems:"center",justifyContent:"space-between",height:32,marginTop:"8px",img:{width:16,height:16},"& > div":{display:"flex",alignItems:"center",gap:"2px"}}));function le({isHijri:e,onCalendarModeSwitch:o}){let{t:a}=useTranslation(),t=()=>{o?.(e?"gregorian":"hijri");};return jsx(S,{children:jsxs(oo,{children:[jsxs(S,{children:[jsx("img",{src:dc,alt:"hijri"}),jsx("span",{children:a("hijri")})]}),jsx(a$4,{checked:e,onChange:t})]})})}var no=le;var ao=styled(he)(({theme:e})=>({cursor:"pointer",borderRadius:"50px",border:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,color:e.palette.text.primary,fontSize:"11px",fontWeight:e.typography.fontWeightRegular,paddingInline:"12px",height:32,width:"max-content",textTransform:"unset","&:hover":{boxShadow:e.shadows[7],border:"1px solid",borderColor:e.palette.info.dark}})),po=styled(S)(()=>({display:"flex",flexDirection:"column",gap:"8px"}));var Z=({isHijri:e,isAr:o=false})=>e?o?rt:nt:o?it:at,J=e=>e?ot:tt,M=e=>e.setHour(0).setMinute(0).setSecond(0).setMillisecond(0),B=e=>e.setHour(23).setMinute(59).setSecond(59).setMillisecond(999),X=e=>{if(!(e?.[0]instanceof Date)||!(e?.[1]instanceof Date)){let[o$1,a]=o();return [new q(o$1),new q(a)]}return [new q(e?.[0]),new q(e?.[1])]};function ce({onChange:e,isHijri:o,isAr:a=false}){let t={locale:Z({isHijri:o,isAr:a}),calendar:J(o)},n=useMemo(()=>[{id:"today",value:[new DateObject(t),new DateObject(t)]},{id:"lastWeek",value:[new DateObject(t).subtract(6,"day"),new DateObject(t)]},{id:"lastMonth",value:[new DateObject(t).subtract(30,"day"),new DateObject(t)]},{id:new DateObject(t).subtract(1,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(1,"month").toFirstOfMonth(),new DateObject(t).subtract(1,"month").toLastOfMonth()]},{id:new DateObject(t).subtract(2,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(2,"month").toFirstOfMonth(),new DateObject(t).subtract(2,"month").toLastOfMonth()]},{id:new DateObject(t).subtract(3,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(3,"month").toFirstOfMonth(),new DateObject(t).subtract(3,"month").toLastOfMonth()]}],[o,a]),{t:p}=useTranslation();return jsx(S,{"data-testid":"RangeCalender_QuickFilters",children:jsx(po,{children:n.map(l=>jsx(ao,{onClick:m=>{m.preventDefault(),e(l.value);},children:p(l.id)},l.id))})})}var so=ce;var lo=styled(he)(()=>({minWidth:"auto",padding:0,"& > img":{cursor:"pointer"}}));var ft=["Su","Mo","Tu","We","Th","Fr","Sa"];function gt({isAr:e=false,isHijri:o,values:a,onChange:t,numberOfMonths:n=2,...p},l){let m=c=>c==="right"?e?ec:fc:e?fc:ec;return jsx(Calendar,{ref:l,numberOfMonths:n,value:a,onChange:t,calendar:J(o),locale:Z({isHijri:o,isAr:e}),range:true,format:"MMM DD",monthYearSeparator:" ",renderButton:(c,u)=>jsx(lo,{onClick:u,children:jsx("img",{src:m(c),alt:"arrow"})}),weekDays:e?void 0:ft,maxDate:new Date,...p})}var mo=forwardRef(gt);var co=mo;var uo=styled(S)(()=>({'[class$="-IndicatorsContainer2"]':{display:"none"},"#react-select-2-listbox":{width:300}})),V=styled(S)(({theme:e})=>({borderRadius:e.spacing(.5),border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,boxShadow:e.shadows[10],minWidth:200,width:"max-content",overflow:"auto"})),fo=styled(S,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:o})=>({width:156,fontSize:"11px",color:e.palette.text.primary,border:"1px solid",borderColor:e.palette.divider,minHeight:32,borderRadius:"4px",padding:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",cursor:"pointer",display:"flex",alignItems:"center",gap:e.spacing(1),fontWeight:500,...o&&{borderRadius:"4px",boxShadow:e.shadows[7],border:"1px solid",borderColor:e.palette.info.dark,background:e.palette.common.white},span:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}})),L=styled(S)(({theme:e})=>({padding:e.spacing(1),color:e.palette.text.primary,fontSize:"11px",display:"flex",alignItems:"center",gap:e.spacing(1),height:33,cursor:"pointer","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"},"&+&":{borderTop:"1px solid",borderColor:e.palette.divider},"&.active span":{fontWeight:500},span:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}})),A=styled(S)(()=>({width:12,height:12})),W=styled(S)(({theme:e})=>({fontSize:"11px",color:e.palette.text.secondary,lineHeight:"15.03px","&.selected":{color:e.palette.info.dark}}));function ge({selectedTimezone:e,onChange:o,timezoneCountriesCodes:a,defaultCountryTimezone:t}){let[n,p]=useState(null),l=i=>{n||p(i.currentTarget);},m=()=>{n&&p(null);},c=(i,D)=>{i.stopPropagation(),o(D);},u=useMemo(()=>a?.map(i=>lc(i)),[a]),s=useMemo(()=>u?.some(i=>e?.timezone===i?.timezone),[u,e]),d=useMemo(()=>e&&s?e:t,[e,t,s]);return jsxs(L,{onMouseEnter:l,onMouseLeave:m,onClick:()=>{e&&o(d);},children:[s?jsx("img",{src:_j,alt:"icon"}):jsx(A,{}),jsx("img",{src:Yj,alt:"entity-timezone"}),jsx(a$1,{countryCode:d?.countryCode}),jsx(W,{className:s?"selected":"",children:s?e?.label:t?.label}),jsx(bt,{open:!!n,anchorEl:n,placement:"right-start",sx:{zIndex:3},disablePortal:true,children:jsx(V,{sx:{maxHeight:300},children:u?.map((i,D)=>{let j=i?.timezone===e?.timezone;return jsxs(L,{onClick:te=>{c(te,i);},sx:{gap:"4px"},children:[j?jsx("img",{src:_j,alt:"icon"}):jsx(A,{}),jsx(a$1,{countryCode:i?.countryCode}),jsx(W,{className:j?"selected":"",children:i?.label})]},`timezone-item-${D}`)})})})]})}function xe({onChange:e,selectedTimezone:o,browserTimezone:a}){let t=useMemo(()=>U.find(({timezone:l})=>l===a),[a]),n=()=>{t&&e(t);},p=t?.timezone===o?.timezone;return jsxs(L,{onClick:n,children:[p?jsx("img",{src:_j,alt:"icon"}):jsx(A,{}),jsx("img",{src:Xj,alt:"user-timezone"}),jsx(a$1,{countryCode:t?.countryCode}),jsx(W,{className:p?"selected":"",children:t?.label})]})}function St({onChange:e,selectedTimezone:o,browserTimezone:a,defaultCountryTimezone:t,timezoneCountriesCodes:n}){let[p,l]=useState(null),m=!!p,c=()=>{l(null);},u=i=>{e(i),c();},s=i=>{l(i.currentTarget);},d=useMemo(()=>a===o?.timezone?Xj:o?.timezone===t.timezone?Yj:Zj,[a,t.timezone,o?.timezone]);return jsx(Ko,{onClickAway:c,children:jsxs(uo,{"data-testid":"CustomTimezone",children:[jsxs(fo,{open:m,onClick:s,children:[jsx("img",{src:d,alt:"timezone-icon"}),jsx(a$1,{countryCode:o?.countryCode}),jsx("span",{children:o?.label})]}),jsx(bt,{open:m,anchorEl:p,placement:"top-start",sx:{zIndex:1400},children:jsxs(V,{"data-testid":"CustomTimezone_dropdown",children:[jsx(ge,{onChange:u,selectedTimezone:o,defaultCountryTimezone:t,timezoneCountriesCodes:n}),jsx(xe,{onChange:u,selectedTimezone:o,browserTimezone:a})]})})]})})}var xo=memo(St);var bo=xo;var ho=styled(S)(({theme:e})=>({display:"flex",marginTop:"8px",background:e.palette.common.white,boxShadow:e.shadows[9],borderRadius:e.spacing(1),color:e.palette.text.primary,fontSize:"11px",".rmdp-calendar":{padding:"8px 16px 16px"},".rmdp-rtl *":{fontFamily:"Tajawal"},".rmdp-rtl .sd":{paddingTop:"4px"},".rmdp-wrapper":{position:"relative",borderRadius:"8px",boxShadow:"none"},".rmdp-day span":{fontSize:"11px",fontWeight:500},".rmdp-day, .rmdp-week-day":{width:40,height:40,marginBottom:"2px",padding:"4px",fontSize:"11px",color:e.palette.grey[900]},".rmdp-day-picker":{padding:0},".rmdp-day.rmdp-today span":{backgroundColor:"transparent !important",color:e.palette.info.dark},".rmdp-day.rmdp-today.end span, .rmdp-day.rmdp-today.end span":{color:e.palette.common.white},".rmdp-range, .rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover":{background:e.palette.info.light,boxShadow:"none",color:e.palette.grey[900]},".rmdp-range-hover.start, .rmdp-range.start, .rmdp-range-hover.end, .rmdp-range.end, .rmdp-rtl .rmdp-range-hover.start, .rmdp-rtl .rmdp-range.start, .rmdp-rtl .rmdp-range-hover.end, .rmdp-rtl .rmdp-range.end":{borderRadius:"50%",background:e.palette.background.gradient.darkShadedBlue,color:e.palette.common.white},".rmdp-range.start:after":{content:'""',position:"absolute",background:e.palette.info.light,height:"100%",width:"50%",right:0,top:0,zIndex:-1},".rmdp-rtl .rmdp-range.start:after":{right:"unset",left:0},".rmdp-range.end:after":{content:'""',position:"absolute",background:e.palette.info.light,height:"100%",width:"50%",left:0,top:0,zIndex:-1},".rmdp-rtl .rmdp-range.end:after":{left:"unset",right:0},".rmdp-week-day":{color:e.palette.grey[700],marginBottom:"4px",fontSize:"11px",padding:"4px"},".rmdp-header-values":{color:e.palette.grey[900],fontSize:"12px",fontWeight:500,lineHeight:"20px",letterSpacing:"0.1px"},".rmdp-header-values span:nth-of-type(2)":{display:"none"},".rmdp-header":{padding:"4px 0",margin:0,fontSize:"12px"},".rmdp-top-class":{display:"block !important"},".rmdp-day.rmdp-selected span:not(.highlight)":{background:e.palette.info.dark},".rmdp-day.start.end":{overflow:"hidden"},".rmdp-day.rmdp-disabled":{color:"#ccc",cursor:"not-allowed"}})),yo=styled(he)(({theme:e})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",background:"transparent",color:e.palette.text.primary,border:"1px solid",borderColor:e.palette.divider,fontWeight:500,borderRadius:"4px","&:hover":{background:"transparent",color:e.palette.text.primary}})),wo=styled(he)(({theme:e})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",borderRadius:"4px",fontWeight:700,background:e.palette.info.dark,"&:hover":{background:e.palette.info.dark}})),Co=styled(S)(()=>({display:"flex",gap:8})),To=styled(he,{shouldForwardProp:e=>e!=="open"})(({open:e,theme:o})=>({color:o.palette.text.primary,fontSize:"11px",fontWeight:500,padding:o.spacing(1),borderRadius:"4px",border:"1px solid",borderColor:o.palette.divider,background:o.palette.common.white,textTransform:"none",height:32,...e&&{border:"1px solid",borderColor:o.palette.info.dark,boxShadow:o.shadows[7]}})),ko=styled(S)(({theme:e})=>({background:e.palette.common.white,display:"flex",justifyContent:"space-between",alignItems:"center",gap:10,padding:"16px",borderTop:"1px solid",borderColor:e.palette.divider,borderBottomRightRadius:"8px"})),zo=styled(S)(({theme:e})=>({padding:16,paddingInlineEnd:"23px",borderRight:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,width:"max-content",borderTopLeftRadius:"8px",borderBottomLeftRadius:"8px",display:"flex",flexDirection:"column",gap:10,justifyContent:"space-between"})),So=styled(S)(()=>({display:"flex",alignItems:"center",gap:"10px"})),vo=styled(S)(()=>({position:"relative"})),Do=styled(S)(()=>({display:"flex",flexDirection:"column",gap:"24px"}));var Mo=styled(S,{shouldForwardProp:e=>e!=="isAllDay"})(({theme:e,isAllDay:o})=>({display:"flex",alignItems:"center",gap:e.spacing(1),position:"relative",paddingInline:"5px",".label":{width:"max-content"},...!o&&{paddingRight:e.spacing(1),"&:after":{content:'""',position:"absolute",width:"1px",background:e.palette.divider,right:0,height:17}}})),Bo=styled(S)(()=>({width:235})),Eo=styled(S)(({theme:e})=>({display:"flex",gap:"4px",".rmdp-input":{width:"64px",borderRadius:"19px",border:"1px solid",borderColor:e.palette.divider,color:e.palette.text.primary,fontSize:"11px",fontWeight:500,background:"transparent",cursor:"pointer"},".rmdp-input:focus":{boxShadow:e.shadows[7],border:`1px solid ${e.palette.info.dark}`,borderRadius:"19px"},".rmdp-time-picker":{boxShadow:e.shadows[5],borderRadius:e.spacing(1),padding:e.spacing(2),minWidth:"auto !important",div:{marginTop:0,display:"block"},"> div":{width:32,height:64},".rmdp-arrow":{borderColor:`${e.palette.background.transparent[1]} !important`},".rmdp-arrow-container":{justifyContent:"center","&:hover":{backgroundColor:"transparent",boxShadow:"unset"}},input:{borderRadius:"4px",border:`1px solid ${e.palette.divider}`,padding:0,width:32,height:32,fontSize:"11px",color:e.palette.text.primary,fontWeight:500,"&:focus, &:focus-visible":{border:`1px solid ${e.palette.info.dark}`,outline:"unset"}},".dvdr":{margin:"7px 4px 0"},".rmdp-am, .rmdp-pm":{margin:0,width:32,height:32,flex:"auto",justifyContent:"center",fontSize:"11px",color:e.palette.text.primary,fontWeight:500,display:"flex",cursor:"default"},"> div:last-child":{marginInlineStart:"4px",display:"block !important"},".rmdp-down, .rmdp-up":{position:"relative",i:{display:"none"},"&:before":{content:'""',position:"absolute",top:"5px",width:"10px",height:"10px",backgroundImage:`url(${Vc})`}},".rmdp-down:before":{transform:"rotate(180deg)"}},".rmdp-container":{position:"relative","> div":{top:"unset !important",bottom:"28px",transform:"unset !important"}}})),Oo=styled(S)(({theme:e})=>({display:"flex",gap:"8px",alignItems:"center",borderRadius:"50px",border:"1px solid",borderColor:e.palette.divider,paddingInline:"5px",width:"fit-content",height:32}));function Mt({values:e,setValues:o}){let{t:a}=useTranslation(),t=new DateObject(e[0]),n=new DateObject(e[1]),[p,l]=useState(t.dayOfYear===n.dayOfYear&&t.hour===0&&t.minute===0&&n.hour===23&&n.minute===59),m=({period:s,hour:d})=>s==="PM"&&d!==12?d+12:s==="AM"&&d===12?0:d,c=({hour:s,minute:d,period:i})=>{o([t.setHour(m({hour:s,period:i})).setMinute(d).setSecond(0),n]);},u=({hour:s,minute:d,period:i})=>{o([t,n.setHour(m({hour:s,period:i})).setMinute(d).setSecond(59)]);};return jsx(Bo,{children:jsxs(Oo,{children:[jsxs(Mo,{isAllDay:p,children:[jsx("span",{className:"label",children:a("allDay")}),jsx(a$4,{checked:p,onChange:s=>{l(!p),s.target.checked?o([M(e[0]),B(e[1])]):o(e);}})]}),!p&&jsxs(Eo,{children:[jsx(j,{defaultTime:{hour:a$5(t.hour),minute:t.minute,period:t.hour>=12?"PM":"AM"},size:"small",onChange:c,enableRealTimeChange:true},`${e[0]?.toString()}-start`),jsx(j,{defaultTime:{hour:a$5(n.hour),minute:n.minute,period:n.hour>=12?"PM":"AM"},size:"small",onChange:u,enableRealTimeChange:true},`${e[1]?.toString()}-end`)]})]})})}var Io=Mt;var Po=Io;function At({defaultDate:e,onDateChange:o,mode:a="gregorian",onCalendarModeSwitch:t,numberOfMonths:n,noTimezone:p,noQuickFilter:l,maxDateRange:m,onCalendarGroupChange:c,groupBy:u,timezone:s,onChangeTimezone:d,browserTimezone:i,renderCalendarButton:D,mainSx:j,popperProps:te,rangeDatePickerProps:Wo,defaultCountryTimezone:Ce,timezoneCountriesCodes:Te}){let[w,ke]=useState(X(e)),[x$1,C]=useState(w),[ze,Se]=useState(s??null),[ve,Fo]=useState(u||"day"),[De,Me]=useState(null),y=!!De,[Be,Ee]=useState(false),{t:re}=useTranslation(),I=useRef(null),Ho=yc(useId(),"range-calender"),ne=a==="hijri",Y=()=>{Me(null);},Oe=r=>{Me(r.currentTarget);};useEffect(()=>{if(!y){if(n===1)return;C(X(e));}},[y]),useEffect(()=>{if(e){let r=X(e);ke(r),C(r),I.current&&I.current.set("date",r[0]);}},[e]),useEffect(()=>{Se(s??null);},[s,y]);let Re=()=>{ke(x$1),Y();let r;x$1[0].dayOfYear===x$1[1].dayOfYear?r=[x$1[0],x$1[1]]:r=[M(x$1[0]),B(x$1[1])],o([r[0].toDate(),r[1].toDate()]),c?.(ve||"day"),d?.(ze);},jo=useCallback(()=>{let r=w[0].format("MMM D"),G=w[1]?w[1].format("MMM D"):w[0].format("MMM D");return r===G&&!p?r:`${r} - ${G}`},[w,p]),Yo=r=>{if(r.length<2||!m){C(r);return}let G=M(r[0]).toDate(),Qo=B(r[1]).toDate(),Ie=Pt(Qo).diff(G,"day");if(Ie<=m){C(r);return}Ee(true),C([r[0],r[1].subtract(Ie-m,"d")]),setTimeout(()=>{Ee(false);},3e3);},Go=r=>{C([M(r[0]),B(r[1])]),I.current&&I.current.set("date",r[0]);},$o=r=>{r.key==="Enter"&&x$1[1]&&!Be?(r.stopPropagation(),Re()):r.key==="Escape"&&(r.stopPropagation(),Y());};return jsxs(vo,{id:Ho,"data-testid":"RangeCalender",sx:j,children:[D?D(y,Oe):jsx(To,{onClick:Oe,open:y,children:(w[0]||w[1])&&jo()}),y&&jsx(a$2,{onClick:r=>{r.stopPropagation(),Y();}}),jsx(bt,{open:y,anchorEl:De,placement:"bottom-end",...te,children:jsxs(ho,{onKeyDown:$o,children:[!l&&jsxs(zo,{children:[jsx(so,{onChange:Go,isHijri:ne}),jsxs(Do,{children:[u&&jsx(eo,{groupBy:ve,isCalenderOpen:y,onUpdate:r=>{Fo(r);}}),jsx(no,{isHijri:ne,onCalendarModeSwitch:t})]})]}),jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsx(co,{values:x$1,onChange:Yo,isHijri:ne,ref:I,numberOfMonths:n,...Wo}),jsx(x,{in:Be&&!!m,children:jsx(a$3,{error:re("dateRangeError",{number:m}),sx:{marginInline:"16px",marginBottom:"16px"}})}),jsxs(ko,{sx:{borderBottomLeftRadius:"8px"},children:[!p&&Ce&&i&&Te?jsx(So,{children:jsx(bo,{onChange:Se,selectedTimezone:ze,browserTimezone:i,defaultCountryTimezone:Ce,timezoneCountriesCodes:Te},String(y))}):jsx("div",{}),new DateObject(x$1[0]).dayOfYear===new DateObject(x$1[1]).dayOfYear&&jsx(Po,{values:x$1,setValues:C}),jsxs(Co,{children:[jsx(yo,{variant:"contained",onClick:Y,children:re("cancel")}),jsx(wo,{variant:"contained",onClick:Re,disabled:!x$1[1],children:re("okay")})]})]})]})]})})]})}var Ao=At;var xi=Ao;export{xi as a};
|
|
1
|
+
import {a as a$4}from'./chunk-UJSTHVLW.js';import {a as a$3}from'./chunk-5ZZCVF4B.js';import {j,a as a$5}from'./chunk-SLTY4KD6.js';import {a}from'./chunk-KUOKFWXS.js';import {a as a$2}from'./chunk-WJML27P6.js';import {x}from'./chunk-2GEJSH7A.js';import {a as a$1}from'./chunk-SUBIH236.js';import {lc,yc,o}from'./chunk-W6W4YZ7G.js';import {U}from'./chunk-N372QRVU.js';import {Vc,Wc,Xj,Yj,Zj,ec,fc,_j,dc}from'./chunk-3YAJNHQC.js';import {memo,forwardRef,useState,useMemo,useRef,useId,useEffect,useCallback}from'react';import S from'@mui/material/Box';import bt from'@mui/material/Popper';import Pt from'dayjs';import {useTranslation}from'react-i18next';import {Calendar,DateObject}from'react-multi-date-picker';import Ko from'@mui/material/ClickAwayListener';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';import he from'@mui/material/Button';import q from'react-date-object';import ot from'react-date-object/calendars/arabic';import tt from'react-date-object/calendars/gregorian';import rt from'react-date-object/locales/arabic_ar';import nt from'react-date-object/locales/arabic_en';import it from'react-date-object/locales/gregorian_ar';import at from'react-date-object/locales/gregorian_en';var Ne=styled(S)(({theme:e})=>({color:e.palette.grey[700],fontSize:"9px",fontWeight:500,marginBottom:"6px"})),Ke=styled(S,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:o})=>({borderRadius:"4px",border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,height:32,padding:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",...o&&{border:`1px solid ${e.palette.info.dark}`,background:e.palette.common.white,boxShadow:e.shadows[7]}})),_e=styled(S)(({theme:e})=>({borderRadius:"8px",background:e.palette.common.white,boxShadow:"0px 8px 36px 0px rgba(0, 0, 0, 0.15)",textAlign:"center",color:e.palette.grey[900],fontSize:"12px",fontWeight:500,lineHeight:"20px",letterSpacing:"0.1px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px",flexDirection:"column"})),qe=styled(S)(({theme:e})=>({width:71,padding:"4px 0",cursor:"pointer","&:hover, &.active":{borderRadius:"100px",background:e.palette.info.light}}));var Je={day:"Day",month:"Month",quarter:"Quarter",year:"Year"};function qo({sx:e,groupBy:o,isCalenderOpen:a$1,onUpdate:t}){let[n,p]=useState(null),l=!!n&&a$1,{t:m}=useTranslation(),c=()=>{p(null);},u=d=>{p(d.currentTarget);},s=d=>{t?.(d),c();};return jsx(Ko,{onClickAway:c,children:jsxs(S,{sx:e,children:[jsx(Ne,{children:m("groupedBy")}),jsxs(Ke,{onClick:u,open:l,children:[jsx("span",{children:Je[o]}),jsx(S,{component:"img",src:Wc,alt:"arrow",sx:{...l&&{transform:"rotate(180deg)"}}})]}),jsx(a,{open:l,anchorEl:n,children:jsx(_e,{sx:{width:n?.clientWidth},children:Object.entries(Je).map(([d,i])=>jsx(qe,{onClick:()=>{s(d);},className:o===d?"active":"",children:i},`${d}-groupedBy`))})})]})})}var Ve=memo(qo);var eo=Ve;var oo=styled(S)(({theme:e})=>({border:"1px solid",borderColor:e.palette.divider,borderRadius:"50px",paddingInline:"6px 12px",color:e.palette.text.primary,fontSize:"11px",display:"flex",gap:"8px",alignItems:"center",justifyContent:"space-between",height:32,marginTop:"8px",img:{width:16,height:16},"& > div":{display:"flex",alignItems:"center",gap:"2px"}}));function le({isHijri:e,onCalendarModeSwitch:o}){let{t:a}=useTranslation(),t=()=>{o?.(e?"gregorian":"hijri");};return jsx(S,{children:jsxs(oo,{children:[jsxs(S,{children:[jsx("img",{src:dc,alt:"hijri"}),jsx("span",{children:a("hijri")})]}),jsx(a$4,{checked:e,onChange:t})]})})}var no=le;var ao=styled(he)(({theme:e})=>({cursor:"pointer",borderRadius:"50px",border:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,color:e.palette.text.primary,fontSize:"11px",fontWeight:e.typography.fontWeightRegular,paddingInline:"12px",height:32,width:"max-content",textTransform:"unset","&:hover":{boxShadow:e.shadows[7],border:"1px solid",borderColor:e.palette.info.dark}})),po=styled(S)(()=>({display:"flex",flexDirection:"column",gap:"8px"}));var Z=({isHijri:e,isAr:o=false})=>e?o?rt:nt:o?it:at,J=e=>e?ot:tt,M=e=>e.setHour(0).setMinute(0).setSecond(0).setMillisecond(0),B=e=>e.setHour(23).setMinute(59).setSecond(59).setMillisecond(999),X=e=>{if(!(e?.[0]instanceof Date)||!(e?.[1]instanceof Date)){let[o$1,a]=o();return [new q(o$1),new q(a)]}return [new q(e?.[0]),new q(e?.[1])]};function ce({onChange:e,isHijri:o,isAr:a=false}){let t={locale:Z({isHijri:o,isAr:a}),calendar:J(o)},n=useMemo(()=>[{id:"today",value:[new DateObject(t),new DateObject(t)]},{id:"lastWeek",value:[new DateObject(t).subtract(6,"day"),new DateObject(t)]},{id:"lastMonth",value:[new DateObject(t).subtract(30,"day"),new DateObject(t)]},{id:new DateObject(t).subtract(1,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(1,"month").toFirstOfMonth(),new DateObject(t).subtract(1,"month").toLastOfMonth()]},{id:new DateObject(t).subtract(2,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(2,"month").toFirstOfMonth(),new DateObject(t).subtract(2,"month").toLastOfMonth()]},{id:new DateObject(t).subtract(3,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(3,"month").toFirstOfMonth(),new DateObject(t).subtract(3,"month").toLastOfMonth()]}],[o,a]),{t:p}=useTranslation();return jsx(S,{"data-testid":"RangeCalender_QuickFilters",children:jsx(po,{children:n.map(l=>jsx(ao,{onClick:m=>{m.preventDefault(),e(l.value);},children:p(l.id)},l.id))})})}var so=ce;var lo=styled(he)(()=>({minWidth:"auto",padding:0,"& > img":{cursor:"pointer"}}));var ft=["Su","Mo","Tu","We","Th","Fr","Sa"];function gt({isAr:e=false,isHijri:o,values:a,onChange:t,numberOfMonths:n=2,...p},l){let m=c=>c==="right"?e?ec:fc:e?fc:ec;return jsx(Calendar,{ref:l,numberOfMonths:n,value:a,onChange:t,calendar:J(o),locale:Z({isHijri:o,isAr:e}),range:true,format:"MMM DD",monthYearSeparator:" ",renderButton:(c,u)=>jsx(lo,{onClick:u,children:jsx("img",{src:m(c),alt:"arrow"})}),weekDays:e?void 0:ft,maxDate:new Date,...p})}var mo=forwardRef(gt);var co=mo;var uo=styled(S)(()=>({'[class$="-IndicatorsContainer2"]':{display:"none"},"#react-select-2-listbox":{width:300}})),V=styled(S)(({theme:e})=>({borderRadius:e.spacing(.5),border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,boxShadow:e.shadows[10],minWidth:200,width:"max-content",overflow:"auto"})),fo=styled(S,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:o})=>({width:156,fontSize:"11px",color:e.palette.text.primary,border:"1px solid",borderColor:e.palette.divider,minHeight:32,borderRadius:"4px",padding:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",cursor:"pointer",display:"flex",alignItems:"center",gap:e.spacing(1),fontWeight:500,...o&&{borderRadius:"4px",boxShadow:e.shadows[7],border:"1px solid",borderColor:e.palette.info.dark,background:e.palette.common.white},span:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}})),L=styled(S)(({theme:e})=>({padding:e.spacing(1),color:e.palette.text.primary,fontSize:"11px",display:"flex",alignItems:"center",gap:e.spacing(1),height:33,cursor:"pointer","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"},"&+&":{borderTop:"1px solid",borderColor:e.palette.divider},"&.active span":{fontWeight:500},span:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}})),A=styled(S)(()=>({width:12,height:12})),W=styled(S)(({theme:e})=>({fontSize:"11px",color:e.palette.text.secondary,lineHeight:"15.03px","&.selected":{color:e.palette.info.dark}}));function ge({selectedTimezone:e,onChange:o,timezoneCountriesCodes:a,defaultCountryTimezone:t}){let[n,p]=useState(null),l=i=>{n||p(i.currentTarget);},m=()=>{n&&p(null);},c=(i,D)=>{i.stopPropagation(),o(D);},u=useMemo(()=>a?.map(i=>lc(i)),[a]),s=useMemo(()=>u?.some(i=>e?.timezone===i?.timezone),[u,e]),d=useMemo(()=>e&&s?e:t,[e,t,s]);return jsxs(L,{onMouseEnter:l,onMouseLeave:m,onClick:()=>{e&&o(d);},children:[s?jsx("img",{src:_j,alt:"icon"}):jsx(A,{}),jsx("img",{src:Yj,alt:"entity-timezone"}),jsx(a$1,{countryCode:d?.countryCode}),jsx(W,{className:s?"selected":"",children:s?e?.label:t?.label}),jsx(bt,{open:!!n,anchorEl:n,placement:"right-start",sx:{zIndex:3},disablePortal:true,children:jsx(V,{sx:{maxHeight:300},children:u?.map((i,D)=>{let j=i?.timezone===e?.timezone;return jsxs(L,{onClick:te=>{c(te,i);},sx:{gap:"4px"},children:[j?jsx("img",{src:_j,alt:"icon"}):jsx(A,{}),jsx(a$1,{countryCode:i?.countryCode}),jsx(W,{className:j?"selected":"",children:i?.label})]},`timezone-item-${D}`)})})})]})}function xe({onChange:e,selectedTimezone:o,browserTimezone:a}){let t=useMemo(()=>U.find(({timezone:l})=>l===a),[a]),n=()=>{t&&e(t);},p=t?.timezone===o?.timezone;return jsxs(L,{onClick:n,children:[p?jsx("img",{src:_j,alt:"icon"}):jsx(A,{}),jsx("img",{src:Xj,alt:"user-timezone"}),jsx(a$1,{countryCode:t?.countryCode}),jsx(W,{className:p?"selected":"",children:t?.label})]})}function St({onChange:e,selectedTimezone:o,browserTimezone:a,defaultCountryTimezone:t,timezoneCountriesCodes:n}){let[p,l]=useState(null),m=!!p,c=()=>{l(null);},u=i=>{e(i),c();},s=i=>{l(i.currentTarget);},d=useMemo(()=>a===o?.timezone?Xj:o?.timezone===t.timezone?Yj:Zj,[a,t.timezone,o?.timezone]);return jsx(Ko,{onClickAway:c,children:jsxs(uo,{"data-testid":"CustomTimezone",children:[jsxs(fo,{open:m,onClick:s,children:[jsx("img",{src:d,alt:"timezone-icon"}),jsx(a$1,{countryCode:o?.countryCode}),jsx("span",{children:o?.label})]}),jsx(bt,{open:m,anchorEl:p,placement:"top-start",sx:{zIndex:1400},children:jsxs(V,{"data-testid":"CustomTimezone_dropdown",children:[jsx(ge,{onChange:u,selectedTimezone:o,defaultCountryTimezone:t,timezoneCountriesCodes:n}),jsx(xe,{onChange:u,selectedTimezone:o,browserTimezone:a})]})})]})})}var xo=memo(St);var bo=xo;var ho=styled(S)(({theme:e})=>({display:"flex",marginTop:"8px",background:e.palette.common.white,boxShadow:e.shadows[9],borderRadius:e.spacing(1),color:e.palette.text.primary,fontSize:"11px",".rmdp-calendar":{padding:"8px 16px 16px"},".rmdp-rtl *":{fontFamily:"Tajawal"},".rmdp-rtl .sd":{paddingTop:"4px"},".rmdp-wrapper":{position:"relative",borderRadius:"8px",boxShadow:"none"},".rmdp-day span":{fontSize:"11px",fontWeight:500},".rmdp-day, .rmdp-week-day":{width:40,height:40,marginBottom:"2px",padding:"4px",fontSize:"11px",color:e.palette.grey[900]},".rmdp-day-picker":{padding:0},".rmdp-day.rmdp-today span":{backgroundColor:"transparent !important",color:e.palette.info.dark},".rmdp-day.rmdp-today.end span, .rmdp-day.rmdp-today.end span":{color:e.palette.common.white},".rmdp-range, .rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover":{background:e.palette.info.light,boxShadow:"none",color:e.palette.grey[900]},".rmdp-range-hover.start, .rmdp-range.start, .rmdp-range-hover.end, .rmdp-range.end, .rmdp-rtl .rmdp-range-hover.start, .rmdp-rtl .rmdp-range.start, .rmdp-rtl .rmdp-range-hover.end, .rmdp-rtl .rmdp-range.end":{borderRadius:"50%",background:e.palette.background.gradient.darkShadedBlue,color:e.palette.common.white},".rmdp-range.start:after":{content:'""',position:"absolute",background:e.palette.info.light,height:"100%",width:"50%",right:0,top:0,zIndex:-1},".rmdp-rtl .rmdp-range.start:after":{right:"unset",left:0},".rmdp-range.end:after":{content:'""',position:"absolute",background:e.palette.info.light,height:"100%",width:"50%",left:0,top:0,zIndex:-1},".rmdp-rtl .rmdp-range.end:after":{left:"unset",right:0},".rmdp-week-day":{color:e.palette.grey[700],marginBottom:"4px",fontSize:"11px",padding:"4px"},".rmdp-header-values":{color:e.palette.grey[900],fontSize:"12px",fontWeight:500,lineHeight:"20px",letterSpacing:"0.1px"},".rmdp-header-values span:nth-of-type(2)":{display:"none"},".rmdp-header":{padding:"4px 0",margin:0,fontSize:"12px"},".rmdp-top-class":{display:"block !important"},".rmdp-day.rmdp-selected span:not(.highlight)":{background:e.palette.info.dark},".rmdp-day.start.end":{overflow:"hidden"},".rmdp-day.rmdp-disabled":{color:"#ccc",cursor:"not-allowed"}})),yo=styled(he)(({theme:e})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",background:"transparent",color:e.palette.text.primary,border:"1px solid",borderColor:e.palette.divider,fontWeight:500,borderRadius:"4px","&:hover":{background:"transparent",color:e.palette.text.primary}})),wo=styled(he)(({theme:e})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",borderRadius:"4px",fontWeight:700,background:e.palette.info.dark,"&:hover":{background:e.palette.info.dark}})),Co=styled(S)(()=>({display:"flex",gap:8})),To=styled(he,{shouldForwardProp:e=>e!=="open"})(({open:e,theme:o})=>({color:o.palette.text.primary,fontSize:"11px",fontWeight:500,padding:o.spacing(1),borderRadius:"4px",border:"1px solid",borderColor:o.palette.divider,background:o.palette.common.white,textTransform:"none",height:32,...e&&{border:"1px solid",borderColor:o.palette.info.dark,boxShadow:o.shadows[7]}})),ko=styled(S)(({theme:e})=>({background:e.palette.common.white,display:"flex",justifyContent:"space-between",alignItems:"center",gap:10,padding:"16px",borderTop:"1px solid",borderColor:e.palette.divider,borderBottomRightRadius:"8px"})),zo=styled(S)(({theme:e})=>({padding:16,paddingInlineEnd:"23px",borderRight:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,width:"max-content",borderTopLeftRadius:"8px",borderBottomLeftRadius:"8px",display:"flex",flexDirection:"column",gap:10,justifyContent:"space-between"})),So=styled(S)(()=>({display:"flex",alignItems:"center",gap:"10px"})),vo=styled(S)(()=>({position:"relative"})),Do=styled(S)(()=>({display:"flex",flexDirection:"column",gap:"24px"}));var Mo=styled(S,{shouldForwardProp:e=>e!=="isAllDay"})(({theme:e,isAllDay:o})=>({display:"flex",alignItems:"center",gap:e.spacing(1),position:"relative",paddingInline:"5px",".label":{width:"max-content"},...!o&&{paddingRight:e.spacing(1),"&:after":{content:'""',position:"absolute",width:"1px",background:e.palette.divider,right:0,height:17}}})),Bo=styled(S)(()=>({width:235})),Eo=styled(S)(({theme:e})=>({display:"flex",gap:"4px",".rmdp-input":{width:"64px",borderRadius:"19px",border:"1px solid",borderColor:e.palette.divider,color:e.palette.text.primary,fontSize:"11px",fontWeight:500,background:"transparent",cursor:"pointer"},".rmdp-input:focus":{boxShadow:e.shadows[7],border:`1px solid ${e.palette.info.dark}`,borderRadius:"19px"},".rmdp-time-picker":{boxShadow:e.shadows[5],borderRadius:e.spacing(1),padding:e.spacing(2),minWidth:"auto !important",div:{marginTop:0,display:"block"},"> div":{width:32,height:64},".rmdp-arrow":{borderColor:`${e.palette.background.transparent[1]} !important`},".rmdp-arrow-container":{justifyContent:"center","&:hover":{backgroundColor:"transparent",boxShadow:"unset"}},input:{borderRadius:"4px",border:`1px solid ${e.palette.divider}`,padding:0,width:32,height:32,fontSize:"11px",color:e.palette.text.primary,fontWeight:500,"&:focus, &:focus-visible":{border:`1px solid ${e.palette.info.dark}`,outline:"unset"}},".dvdr":{margin:"7px 4px 0"},".rmdp-am, .rmdp-pm":{margin:0,width:32,height:32,flex:"auto",justifyContent:"center",fontSize:"11px",color:e.palette.text.primary,fontWeight:500,display:"flex",cursor:"default"},"> div:last-child":{marginInlineStart:"4px",display:"block !important"},".rmdp-down, .rmdp-up":{position:"relative",i:{display:"none"},"&:before":{content:'""',position:"absolute",top:"5px",width:"10px",height:"10px",backgroundImage:`url(${Vc})`}},".rmdp-down:before":{transform:"rotate(180deg)"}},".rmdp-container":{position:"relative","> div":{top:"unset !important",bottom:"28px",transform:"unset !important"}}})),Oo=styled(S)(({theme:e})=>({display:"flex",gap:"8px",alignItems:"center",borderRadius:"50px",border:"1px solid",borderColor:e.palette.divider,paddingInline:"5px",width:"fit-content",height:32}));function Mt({values:e,setValues:o}){let{t:a}=useTranslation(),t=new DateObject(e[0]),n=new DateObject(e[1]),[p,l]=useState(t.dayOfYear===n.dayOfYear&&t.hour===0&&t.minute===0&&n.hour===23&&n.minute===59),m=({period:s,hour:d})=>s==="PM"&&d!==12?d+12:s==="AM"&&d===12?0:d,c=({hour:s,minute:d,period:i})=>{o([t.setHour(m({hour:s,period:i})).setMinute(d).setSecond(0),n]);},u=({hour:s,minute:d,period:i})=>{o([t,n.setHour(m({hour:s,period:i})).setMinute(d).setSecond(59)]);};return jsx(Bo,{children:jsxs(Oo,{children:[jsxs(Mo,{isAllDay:p,children:[jsx("span",{className:"label",children:a("allDay")}),jsx(a$4,{checked:p,onChange:s=>{l(!p),s.target.checked?o([M(e[0]),B(e[1])]):o(e);}})]}),!p&&jsxs(Eo,{children:[jsx(j,{defaultTime:{hour:a$5(t.hour),minute:t.minute,period:t.hour>=12?"PM":"AM"},size:"small",onChange:c,enableRealTimeChange:true},`${e[0]?.toString()}-start`),jsx(j,{defaultTime:{hour:a$5(n.hour),minute:n.minute,period:n.hour>=12?"PM":"AM"},size:"small",onChange:u,enableRealTimeChange:true},`${e[1]?.toString()}-end`)]})]})})}var Io=Mt;var Po=Io;function At({defaultDate:e,onDateChange:o,mode:a="gregorian",onCalendarModeSwitch:t,numberOfMonths:n,noTimezone:p,noQuickFilter:l,maxDateRange:m,onCalendarGroupChange:c,groupBy:u,timezone:s,onChangeTimezone:d,browserTimezone:i,renderCalendarButton:D,mainSx:j,popperProps:te,rangeDatePickerProps:Wo,defaultCountryTimezone:Ce,timezoneCountriesCodes:Te}){let[w,ke]=useState(X(e)),[x$1,C]=useState(w),[ze,Se]=useState(s??null),[ve,Fo]=useState(u||"day"),[De,Me]=useState(null),y=!!De,[Be,Ee]=useState(false),{t:re}=useTranslation(),I=useRef(null),Ho=yc(useId(),"range-calender"),ne=a==="hijri",Y=()=>{Me(null);},Oe=r=>{Me(r.currentTarget);};useEffect(()=>{if(!y){if(n===1)return;C(X(e));}},[y]),useEffect(()=>{if(e){let r=X(e);ke(r),C(r),I.current&&I.current.set("date",r[0]);}},[e]),useEffect(()=>{Se(s??null);},[s,y]);let Re=()=>{ke(x$1),Y();let r;x$1[0].dayOfYear===x$1[1].dayOfYear?r=[x$1[0],x$1[1]]:r=[M(x$1[0]),B(x$1[1])],o([r[0].toDate(),r[1].toDate()]),c?.(ve||"day"),d?.(ze);},jo=useCallback(()=>{let r=w[0].format("MMM D"),G=w[1]?w[1].format("MMM D"):w[0].format("MMM D");return r===G&&!p?r:`${r} - ${G}`},[w,p]),Yo=r=>{if(r.length<2||!m){C(r);return}let G=M(r[0]).toDate(),Qo=B(r[1]).toDate(),Ie=Pt(Qo).diff(G,"day");if(Ie<=m){C(r);return}Ee(true),C([r[0],r[1].subtract(Ie-m,"d")]),setTimeout(()=>{Ee(false);},3e3);},Go=r=>{C([M(r[0]),B(r[1])]),I.current&&I.current.set("date",r[0]);},$o=r=>{r.key==="Enter"&&x$1[1]&&!Be?(r.stopPropagation(),Re()):r.key==="Escape"&&(r.stopPropagation(),Y());};return jsxs(vo,{id:Ho,"data-testid":"RangeCalender",sx:j,children:[D?D(y,Oe):jsx(To,{onClick:Oe,open:y,children:(w[0]||w[1])&&jo()}),y&&jsx(a$2,{onClick:r=>{r.stopPropagation(),Y();}}),jsx(bt,{open:y,anchorEl:De,placement:"bottom-end",...te,children:jsxs(ho,{onKeyDown:$o,children:[!l&&jsxs(zo,{children:[jsx(so,{onChange:Go,isHijri:ne}),jsxs(Do,{children:[u&&jsx(eo,{groupBy:ve,isCalenderOpen:y,onUpdate:r=>{Fo(r);}}),jsx(no,{isHijri:ne,onCalendarModeSwitch:t})]})]}),jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsx(co,{values:x$1,onChange:Yo,isHijri:ne,ref:I,numberOfMonths:n,...Wo}),jsx(x,{in:Be&&!!m,children:jsx(a$3,{error:re("dateRangeError",{number:m}),sx:{marginInline:"16px",marginBottom:"16px"}})}),jsxs(ko,{sx:{borderBottomLeftRadius:"8px"},children:[!p&&Ce&&i&&Te?jsx(So,{children:jsx(bo,{onChange:Se,selectedTimezone:ze,browserTimezone:i,defaultCountryTimezone:Ce,timezoneCountriesCodes:Te},String(y))}):jsx("div",{}),new DateObject(x$1[0]).dayOfYear===new DateObject(x$1[1]).dayOfYear&&jsx(Po,{values:x$1,setValues:C}),jsxs(Co,{children:[jsx(yo,{variant:"contained",onClick:Y,children:re("cancel")}),jsx(wo,{variant:"contained",onClick:Re,disabled:!x$1[1],children:re("okay")})]})]})]})]})})]})}var Ao=At;var xi=Ao;export{xi as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f,p}from'./chunk-
|
|
1
|
+
import {f,p}from'./chunk-2GEJSH7A.js';import {a}from'./chunk-GNY2VGGW.js';import {yc}from'./chunk-W6W4YZ7G.js';import {wb}from'./chunk-3YAJNHQC.js';import {memo,useRef,useState,useEffect,useMemo,useId}from'react';import ie from'@mui/material/Popper';import {styled,Box}from'@mui/material';import {jsx,jsxs}from'react/jsx-runtime';var k=styled(a)(({theme:e})=>({fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.subtitle1.fontSize,color:e.palette.grey[700],paddingInlineStart:e.spacing(2),paddingTop:e.spacing(1),paddingBottom:e.spacing(1),paddingInlineEnd:e.spacing(1)})),R=styled(Box,{shouldForwardProp:e=>e!=="disabled"})(({theme:e,disabled:n})=>({fontWeight:e.typography.fontWeightMedium,padding:e.spacing(1),position:"relative",display:"flex",alignItems:"center",textTransform:"capitalize",cursor:n?"not-allowed":"pointer",flex:1,zIndex:99999,".MuiButtonBase-root":{width:"16px",marginInlineEnd:"4px"}})),z=styled(Box)(({theme:e})=>({borderRadius:e.spacing(.5),background:e.palette.background.default,width:"max-content",cursor:"pointer",zIndex:99999,boxShadow:e.shadows[11],display:"flex",flexDirection:"column",".nested-menu-item + .nested-menu-item":{borderTop:`1px solid ${e.palette.divider}`,zIndex:99999},".nested-menu-item:hover":{transition:e.transitions.create(["boxShadow","border"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.complex}),boxShadow:e.shadows[6],border:"none",position:"relative"}})),B=styled(Box)(({theme:e})=>({...e.typography.subtitle1,color:e.palette.text.primary})),H=styled(f)(()=>({padding:0,paddingRight:"4px",".MuiSvgIcon-root":{width:12,height:12}})),$=styled(Box)(()=>({display:"flex",gap:"4px",alignItems:"center",flexGrow:1,minWidth:0,overflow:"hidden"})),A=styled(Box)(()=>({display:"flex",gap:"12px",justifyContent:"space-between",flexGrow:1,alignItems:"center",minWidth:0,overflow:"hidden"})),O=styled(Box)(({theme:e})=>({borderRadius:"50%",background:e.palette.divider,width:13,height:14,fontSize:"8px",fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"10px"})),G=styled(Box)(()=>({display:"flex",alignItems:"center",gap:"8px",flexShrink:0,position:"relative",left:4})),F=styled(Box)(()=>({flex:"1 0 auto"})),_=styled(Box)(()=>({position:"relative",zIndex:999999}));function q(e){return e.scrollWidth-e.clientWidth>1}function oe({children:e}){let n=useRef(null),[r,t]=useState(false);return jsx(p,{arrow:true,placement:"top",title:e,open:r,onOpen:()=>{let f=n.current;f&&q(f)&&t(true);},onClose:()=>t(false),componentsProps:{tooltip:{sx:{maxWidth:280,whiteSpace:"normal",wordBreak:"break-word"}}},wrapperProps:{sx:{flex:1,minWidth:0,display:"block",overflow:"hidden"}},children:jsx(B,{ref:n,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})})}var K=memo(oe);function se({label:e,icon:n,name:r,menuItems:t,setSelected:f,onSelect:C,selected:i,displayChildrenCount:I,disabled:s,placement:h="right",sx:g,menuSx:P}){let[u,S]=useState(null),l=useRef(null),[a,p]=useState(false),w=o=>{!s&&i!==void 0&&(f({name:o,selected:!i}),i||p(false));};return useEffect(()=>{p(!!(t?.some(o=>o.selected)&&!t?.every(o=>o.selected)));},[]),jsxs(R,{"data-testid":"NestedDropdown_MenuItem",ref:l,className:`nested-menu-item ${u?"active":""} ${s?"disabled":""}`,onMouseEnter:o=>{!u&&t?.length&&S(o.currentTarget);},onMouseLeave:()=>{u&&S(null);},onClick:o=>{s||(o.stopPropagation(),w(r));},sx:{...t?.length&&{cursor:s?"not-allowed":"pointer"},zIndex:99999,...g},disabled:s,children:[i!==void 0&&jsx(H,{size:"small",indeterminate:a,checked:i,disabled:s}),jsxs($,{children:[n&&n,jsxs(A,{children:[e&&jsx(K,{children:e}),!!t?.length&&jsxs(G,{children:[I&&jsx(O,{children:t.length}),jsx("img",{src:wb,className:"arrow-icon",alt:"arrow",style:{height:12}})]})]})]}),t?.length&&jsx(ie,{open:!!(u&&t?.length),anchorEl:u,placement:h==="left"?"left-start":"right-start",sx:{zIndex:99999,...P},children:jsx(T,{className:"child-dropdown",menuItems:t,placement:h,sx:P,onChildrenChange:o=>{let y=o.every(d=>d.selected);i!==void 0&&!s&&(y&&f({name:r,selected:true}),o.every(d=>!d.selected)&&f({name:r,selected:false}),p(o?.some(d=>d.selected)&&!o.every(d=>!d.selected)&&!y));},onSelect:o=>{C(o,r);}})})]})}var M=memo(se);function ae({title:e,menuItems:n,onChildrenChange:r,onSelect:t,className:f,updatedList:C,footer:i,header:I,placement:s="right",...h}){let[g,P]=useState({name:"",selected:false}),[u,S]=useState();return useEffect(()=>{S(n);},[n]),useEffect(()=>{if(g.name){let{name:l,selected:a}=g,p=[],w=d=>d?.map(m=>(p.push({name:m.name,selected:a}),{...m,selected:a,...m.menuItems?.length&&{menuItems:w(m.menuItems)}})),y=(d=>d.map(m=>m.name===l?(p.push({name:m.name,selected:a}),{...m,selected:a,...m.menuItems?.length&&{menuItems:w(m.menuItems)}}):m))(u);S(y),C&&C(y),r&&r(y),t&&t(p);}},[g]),jsxs(z,{component:"article",className:`tap-dropdown ${f||""}`,...h,children:[jsx(_,{children:e&&jsx(k,{component:"p",children:e})}),I,jsx(F,{children:u?.map((l,a)=>jsx(M,{setSelected:({name:p,selected:w})=>{P({name:p,selected:w});},onSelect:p=>{t&&t(p);},placement:s,...l},`${l.name}-${a}`))}),i&&i]})}var T=memo(ae);var Y=(e,{menuItemSx:n,menuSx:r})=>(e.forEach(t=>{t.sx={...n,...t.sx},t.menuSx={...r,...t.menuSx},t.menuItems?.length&&Y(t.menuItems,{menuItemSx:n,menuSx:r});}),e);function he({title:e,menuItems:n,onSelect:r,updatedList:t,header:f,placement:C="right",menuItemSx:i={},menuSx:I={},...s}){let h=useMemo(()=>Y(n,{menuItemSx:i,menuSx:I}),[n,i,I]),[g,P]=useState(h),u=yc(useId(),"nested-dropdown");useEffect(()=>{P(h);},[h]);let S=l=>{let a=w=>w.map(o=>({...o,selected:l.find(y=>o.name===y.name)?.selected??o.selected,...o.menuItems?.length&&{menuItems:a(o.menuItems)}})),p=a(g);P(p),t&&t(p);};return jsx(T,{id:u,"data-testid":"NestedDropdown",placement:C,menuItems:g,title:e,header:f,onSelect:l=>{r&&r(l),S(l);},...s})}var Z=memo(he);var Ue=Z;export{M as a,T as b,Ue as c};
|