@producteca/producteca-ui-kit 1.94.1-alpha.1 → 1.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/modals/warningModal/warningModal.types.d.ts +3 -0
- package/dist/components/table/tableBody/tableBody.d.ts +1 -1
- package/dist/components/table/tableBody/tableBody.types.d.ts +0 -5
- package/dist/producteca-ui-kit.es.js +2 -2
- package/dist/producteca-ui-kit.umd.js +2 -2
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
2
|
import { ModalProps } from '../modal/modal.types';
|
|
3
|
+
import { DataAttributes } from '../../../utils';
|
|
3
4
|
|
|
4
5
|
export interface WarningModalProps extends Omit<ModalProps, 'children'> {
|
|
5
6
|
onSave?: () => void;
|
|
@@ -8,7 +9,9 @@ export interface WarningModalProps extends Omit<ModalProps, 'children'> {
|
|
|
8
9
|
confirmLabel?: string;
|
|
9
10
|
icon?: React.ReactNode;
|
|
10
11
|
title?: React.ReactNode;
|
|
12
|
+
saveAttrs?: DataAttributes;
|
|
11
13
|
helpArticleHref?: string;
|
|
14
|
+
cancelAttrs?: DataAttributes;
|
|
12
15
|
dontShowAgainLabel?: string;
|
|
13
16
|
description: React.ReactNode;
|
|
14
17
|
onChangeDontShowAgain?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TableBodyProps } from './tableBody.types';
|
|
2
2
|
|
|
3
|
-
export declare const TableBody: <T>({ data, isLoading, error, empty, success,
|
|
3
|
+
export declare const TableBody: <T>({ data, isLoading, error, empty, success, ...props }: TableBodyProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { AsyncContentErrorProps, AsyncContentEmptyProps, AsyncContentSuccessProps } from '../../patterns/asyncContent';
|
|
2
|
-
import { CSSProperties } from 'react';
|
|
3
2
|
|
|
4
|
-
type RowVerticalAlign = CSSProperties['verticalAlign'];
|
|
5
|
-
type RowVerticalAlignResolver<T> = (row: T, index: number) => RowVerticalAlign;
|
|
6
3
|
export interface TableBodyProps<T> {
|
|
7
4
|
data: T[];
|
|
8
5
|
isLoading?: boolean;
|
|
9
6
|
error?: AsyncContentErrorProps;
|
|
10
7
|
empty?: Omit<AsyncContentEmptyProps, 'items'>;
|
|
11
8
|
success?: AsyncContentSuccessProps;
|
|
12
|
-
rowVerticalAlign?: RowVerticalAlign | RowVerticalAlignResolver<T>;
|
|
13
9
|
}
|
|
14
|
-
export {};
|
|
@@ -7036,7 +7036,7 @@ animation:"".concat(bufferKeyframe," 3s infinite linear")});var LinearProgressBa
|
|
|
7036
7036
|
* The variant to use.
|
|
7037
7037
|
* Use indeterminate or query when there is no progress value.
|
|
7038
7038
|
* @default 'indeterminate'
|
|
7039
|
-
*/variant:PropTypes.oneOf(["buffer","determinate","indeterminate","query"])}:void 0;var progressbar="progressbar-module_progressbar_8ygYR";var lg$2="progressbar-module_lg_5JGr-";var sm$2="progressbar-module_sm_LPtUo";var styles$d={progressbar:progressbar,lg:lg$2,sm:sm$2};var _excluded$h=["size","progress","variant"];var Progressbar=function Progressbar2(_ref3){var _ref$size=_ref3.size,size2=_ref$size===void 0?"lg":_ref$size,_ref$progress=_ref3.progress,initialProgress=_ref$progress===void 0?0:_ref$progress,_ref$variant=_ref3.variant,variant=_ref$variant===void 0?"determinate":_ref$variant,props=_objectWithoutProperties$1(_ref3,_excluded$h);var _useState=useState(initialProgress),_useState2=_slicedToArray$1(_useState,2),progress2=_useState2[0],setProgress=_useState2[1];useEffect(function(){if(variant==="buffer"){var timer=setInterval(function(){setProgress(function(oldProgress){var newProgress=Math.min(100,oldProgress+Math.sqrt(100-oldProgress)*0.5);return Math.round(newProgress);});},100);return function(){clearInterval(timer);};}else{setProgress(initialProgress);}},[variant,initialProgress]);return/* @__PURE__ */jsx$1(LinearProgress,_objectSpread2$1({variant:variant=="buffer"?"determinate":variant,value:progress2,className:clsx(styles$d["progressbar"],styles$d[size2]),"aria-label":locale("a11y.progress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":progress2},props));};var defaultDuration=2500;var stepInterval=100;var easeOutQuad=function easeOutQuad2(ratio){return ratio*(2-ratio);};var useAutoloadProgress=function useAutoloadProgress2(_ref3){var enabled=_ref3.enabled,_ref$duration=_ref3.duration,duration2=_ref$duration===void 0?defaultDuration:_ref$duration,_ref$onComplete=_ref3.onComplete,onComplete=_ref$onComplete===void 0?void 0:_ref$onComplete;var _useState=useState(0),_useState2=_slicedToArray$1(_useState,2),progress2=_useState2[0],setProgress=_useState2[1];var onCompleteRef=useRef(onComplete);useEffect(function(){onCompleteRef.current=onComplete;},[onComplete]);useEffect(function(){if(!enabled){setProgress(0);return void 0;}if(duration2<=0){var _onCompleteRef$curren;setProgress(100);(_onCompleteRef$curren=onCompleteRef.current)===null||_onCompleteRef$curren===void 0||_onCompleteRef$curren.call(onCompleteRef);return void 0;}var startedAt=Date.now();setProgress(0);var timer=setInterval(function(){var _onCompleteRef$curren2;var ratio=Math.min(1,(Date.now()-startedAt)/duration2);setProgress(Math.floor(easeOutQuad(ratio)*100));if(ratio<1)return;clearInterval(timer);(_onCompleteRef$curren2=onCompleteRef.current)===null||_onCompleteRef$curren2===void 0||_onCompleteRef$curren2.call(onCompleteRef);},stepInterval);return function(){return clearInterval(timer);};},[enabled,duration2]);return progress2;};var _excluded$g=["name","progress","autoload","autoloadDuration","onAutoloadComplete","error","onRemove","showRemoveAction"];var FileRowBase=function FileRowBase2(_ref3){var name2=_ref3.name,_ref$progress=_ref3.progress,progress2=_ref$progress===void 0?void 0:_ref$progress,_ref$autoload=_ref3.autoload,autoload=_ref$autoload===void 0?false:_ref$autoload,_ref$autoloadDuration=_ref3.autoloadDuration,autoloadDuration=_ref$autoloadDuration===void 0?void 0:_ref$autoloadDuration,_ref$onAutoloadComple=_ref3.onAutoloadComplete,onAutoloadComplete=_ref$onAutoloadComple===void 0?void 0:_ref$onAutoloadComple,_ref$error=_ref3.error,error2=_ref$error===void 0?void 0:_ref$error,_ref$onRemove=_ref3.onRemove,onRemove=_ref$onRemove===void 0?void 0:_ref$onRemove,_ref$showRemoveAction=_ref3.showRemoveAction,showRemoveAction=_ref$showRemoveAction===void 0?true:_ref$showRemoveAction,props=_objectWithoutProperties$1(_ref3,_excluded$g);var isControlled=progress2!==void 0;var autoloadProgress=useAutoloadProgress({enabled:autoload&&!isControlled,duration:autoloadDuration,onComplete:onAutoloadComplete});var isAutoloading=autoload&&!isControlled&&autoloadProgress<100;var currentProgress=isControlled?progress2:autoloadProgress;var hasProgress=isControlled||isAutoloading;var isRemovable=showRemoveAction&&!!onRemove;return/* @__PURE__ */jsxs("div",_objectSpread2$1(_objectSpread2$1({className:styles$e["file-row"]},props),{},{children:[/* @__PURE__ */jsxs("div",{className:clsx(styles$e.card,_defineProperty$2(_defineProperty$2({},styles$e.invalid,!!error2),styles$e.compact,hasProgress)),children:[/* @__PURE__ */jsxs("div",{className:styles$e.header,children:[/* @__PURE__ */jsx$1("span",{className:styles$e.name,children:name2}),isRemovable&&/* @__PURE__ */jsx$1("button",{type:"button",className:styles$e.remove,"aria-label":locale("dropzone.removeFile"),onClick:onRemove,children:/* @__PURE__ */jsx$1(TrashIcon,{size:16,color:getColor("primary","500")})})]}),hasProgress&&/* @__PURE__ */jsxs("div",{className:styles$e.progress,children:[/* @__PURE__ */jsx$1(Progressbar,{size:"sm",progress:currentProgress}),/* @__PURE__ */jsx$1("span",{className:styles$e.percentage,children:locale("dropzone.percentage",{progress:currentProgress})})]})]}),!!error2&&/* @__PURE__ */jsx$1("span",{role:"alert",className:styles$e.error,children:error2})]}));};var FileRow=withDebugHandlers(FileRowBase,"FileRow");var EditRoundedIcon=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M3 17.46v3.04c0 .28.22.5.5.5h3.04c.13 0 .26-.05.35-.15L17.81 9.94l-3.75-3.75L3.15 17.1q-.15.15-.15.36M20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"EditRounded");var VisibilityRoundedIcon=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M12 4C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4m0 12.5c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"VisibilityRounded");var VisibilityOffRoundedIcon=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M12 6.5c2.76 0 5 2.24 5 5 0 .51-.1 1-.24 1.46l3.06 3.06c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l2.17 2.17c.47-.14.96-.24 1.47-.24M2.71 3.16c-.39.39-.39 1.02 0 1.41l1.97 1.97C3.06 7.83 1.77 9.53 1 11.5 2.73 15.89 7 19 12 19c1.52 0 2.97-.3 4.31-.82l2.72 2.72c.39.39 1.02.39 1.41 0s.39-1.02 0-1.41L4.13 3.16c-.39-.39-1.03-.39-1.42 0M12 16.5c-2.76 0-5-2.24-5-5 0-.77.18-1.5.49-2.14l1.57 1.57c-.03.18-.06.37-.06.57 0 1.66 1.34 3 3 3 .2 0 .38-.03.57-.07L14.14 16c-.65.32-1.37.5-2.14.5m2.97-5.33c-.15-1.4-1.25-2.49-2.64-2.64z"}),"VisibilityOffRounded");var label$3="permissionOption-module_label_Vxb8a";var active$2="permissionOption-module_active_adte8";var clickable="permissionOption-module_clickable_qJgeM";var disabled$4="permissionOption-module_disabled_GSgD5";var styles$c={"permission-option":"permissionOption-module_permission-option_n5PwJ",label:label$3,active:active$2,"no-background":"permissionOption-module_no-background_IsIRU",clickable:clickable,disabled:disabled$4};var _excluded$f=["permission","isActive","disabled","showBackground","label","icon","onClick"];var permissionConfig={read:{icon:/* @__PURE__ */jsx$1(VisibilityRoundedIcon,{}),labelKey:"permissions.read"},edit:{icon:/* @__PURE__ */jsx$1(EditRoundedIcon,{}),labelKey:"permissions.edit"},noAccess:{icon:/* @__PURE__ */jsx$1(VisibilityOffRoundedIcon,{}),labelKey:"permissions.noAccess"}};var PermissionOptionBase=function PermissionOptionBase2(_ref3){var permission=_ref3.permission,_ref$isActive=_ref3.isActive,isActive=_ref$isActive===void 0?false:_ref$isActive,_ref$disabled=_ref3.disabled,disabled2=_ref$disabled===void 0?false:_ref$disabled,_ref$showBackground=_ref3.showBackground,showBackground=_ref$showBackground===void 0?true:_ref$showBackground,label2=_ref3.label,icon2=_ref3.icon,_ref$onClick=_ref3.onClick,onClick=_ref$onClick===void 0?void 0:_ref$onClick,props=_objectWithoutProperties$1(_ref3,_excluded$f);var _permissionConfig$per=permissionConfig[permission],defaultIcon=_permissionConfig$per.icon,labelKey=_permissionConfig$per.labelKey;var resolvedIcon=icon2!==null&&icon2!==void 0?icon2:defaultIcon;var resolvedLabel=label2!==null&&label2!==void 0?label2:locale(labelKey);var isClickable=!!onClick&&!disabled2;var iconColor=isActive?getColor("primary","500"):getColor("grey","800");return/* @__PURE__ */jsxs("div",_objectSpread2$1(_objectSpread2$1({className:clsx(styles$c["permission-option"],_defineProperty$2(_defineProperty$2(_defineProperty$2(_defineProperty$2({},styles$c.active,isActive),styles$c.disabled,disabled2),styles$c.clickable,isClickable),styles$c["no-background"],!showBackground)),role:isClickable?"button":void 0,tabIndex:isClickable?0:void 0,"aria-pressed":isClickable?isActive:void 0,"aria-disabled":disabled2||void 0,onClick:isClickable?onClick:void 0},props),{},{children:[/* @__PURE__ */jsx$1(CustomIcon,{size:"8",color:iconColor,children:resolvedIcon}),/* @__PURE__ */jsx$1("span",{className:styles$c.label,children:resolvedLabel})]}));};var PermissionOption=withDebugHandlers(PermissionOptionBase,"PermissionOption");var styles$b={"permission-selector":"permissionSelector-module_permission-selector_4Bgcp"};var _excluded$e=["sx","value","name","onChange","items","defaultValue"];var DEFAULT_ITEMS=[{permission:"noAccess"},{permission:"read"},{permission:"edit"}];var PermissionSelectorBase=function PermissionSelectorBase2(_ref3){var sx=_ref3.sx,value=_ref3.value,name2=_ref3.name,onChange2=_ref3.onChange,_ref$items=_ref3.items,items=_ref$items===void 0?DEFAULT_ITEMS:_ref$items,_ref$defaultValue=_ref3.defaultValue,defaultValue2=_ref$defaultValue===void 0?"noAccess":_ref$defaultValue,props=_objectWithoutProperties$1(_ref3,_excluded$e);var _React$useState=React__default.useState(defaultValue2),_React$useState2=_slicedToArray$1(_React$useState,2),internalValue=_React$useState2[0],setInternalValue=_React$useState2[1];var activeValue=value!==null&&value!==void 0?value:internalValue;var combinedSx=useMemo(function(){return sxTabs$1(sx);},[sx]);var _handleChange=function _handleChange2(_event,newValue){if(value===void 0)setInternalValue(newValue);var fakeEvent={target:{name:name2,value:newValue}};onChange2===null||onChange2===void 0||onChange2(fakeEvent);};return/* @__PURE__ */jsx$1("div",_objectSpread2$1(_objectSpread2$1({className:styles$b["permission-selector"]},props),{},{children:/* @__PURE__ */jsx$1(Tabs$1,{sx:combinedSx,value:activeValue,onChange:_handleChange,"aria-label":locale("permissionSelector.ariaLabel"),children:map$2(items,function(item2){return/* @__PURE__ */jsx$1(Tab,{value:item2.permission,sx:sxTab$1,disableRipple:true,disabled:item2.disabled,label:/* @__PURE__ */jsx$1(PermissionOption,{icon:item2.icon,label:item2.label,showBackground:false,disabled:item2.disabled,permission:item2.permission,isActive:item2.permission===activeValue})},item2.permission);})})}));};var sxTabs$1=function sxTabs(sxListStyles){return{padding:0,minHeight:0,"& .MuiTabs-list":_objectSpread2$1({gap:"2px"},sxListStyles||{}),"& .MuiTab-root":{minWidth:0,minHeight:0,padding:0,zIndex:1,textTransform:"none"},"& .MuiTabs-indicator":{bottom:0,height:"100%",zIndex:0,borderRadius:"var(--radius-md)",backgroundColor:getColor("primary","50")}};};var sxTab$1={padding:0,minHeight:0};var PermissionSelector=withDebugHandlers(PermissionSelectorBase,"PermissionSelector");var Cancel=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel");var ErrorIcon=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error");var Info=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info");var CheckCircle=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle");var alert="alert-module_alert_j7ZRS";var icon="alert-module_icon_vbZHd";var message="alert-module_message_klR2U";var close="alert-module_close_x5ptw";var success="alert-module_success_AVBKS";var error$1="alert-module_error_cxg96";var warning="alert-module_warning_zkMaJ";var info="alert-module_info_PBo1l";var styles$a={alert:alert,"full-width":"alert-module_full-width_eKIHw",icon:icon,message:message,close:close,success:success,error:error$1,warning:warning,info:info};var _excluded$d=["message","variant","className","icon","fullWidth","link","onClose"];var AlertBase=function AlertBase2(_ref3){var _link$href;var message2=_ref3.message,_ref$variant=_ref3.variant,variant=_ref$variant===void 0?"success":_ref$variant,className=_ref3.className,icon2=_ref3.icon,_ref$fullWidth=_ref3.fullWidth,fullWidth=_ref$fullWidth===void 0?false:_ref$fullWidth,link2=_ref3.link,onClose=_ref3.onClose,props=_objectWithoutProperties$1(_ref3,_excluded$d);var defaultIcons={success:/* @__PURE__ */jsx$1(CustomIcon,{size:"12",color:getColor("success","500"),children:/* @__PURE__ */jsx$1(CheckCircle,{"data-testid":"CheckCircleIcon"})}),error:/* @__PURE__ */jsx$1(CustomIcon,{size:"12",color:getColor("error","700"),children:/* @__PURE__ */jsx$1(Cancel,{})}),warning:/* @__PURE__ */jsx$1(CustomIcon,{size:"12",color:getColor("secondary","500"),children:/* @__PURE__ */jsx$1(ErrorIcon,{})}),info:/* @__PURE__ */jsx$1(CustomIcon,{size:"12",color:getColor("primary","500"),children:/* @__PURE__ */jsx$1(Info,{})})};return/* @__PURE__ */jsxs("div",_objectSpread2$1(_objectSpread2$1({className:clsx(styles$a["alert"],styles$a[variant],_defineProperty$2({},styles$a["full-width"],fullWidth),className)},props),{},{children:[/* @__PURE__ */jsx$1("div",{className:styles$a["icon"],children:icon2||defaultIcons[variant]}),/* @__PURE__ */jsxs("div",{className:styles$a["message"],children:[isString$4(message2)?/* @__PURE__ */jsx$1("span",{dangerouslySetInnerHTML:{__html:message2}}):/* @__PURE__ */jsxs("span",{children:[" ",message2]}),link2&&/* @__PURE__ */jsxs(Fragment$1,{children:[" ",/* @__PURE__ */jsx$1(Link,{href:(_link$href=link2.href)!==null&&_link$href!==void 0?_link$href:"#",size:"sm",weight:400,decoration:"underline",onClick:link2.onClick,children:link2.text})]})]}),onClose&&/* @__PURE__ */jsx$1("button",{type:"button",className:styles$a["close"],"aria-label":locale("a11y.close"),onClick:onClose,children:/* @__PURE__ */jsx$1(CustomIcon,{size:"12",color:getColor("grey","800"),children:/* @__PURE__ */jsx$1(CloseRoundedIcon,{})})})]}));};var Alert=withDebugHandlers(AlertBase,"Alert");var breadcrumb="breadcrumb-module_breadcrumb_r-ILp";var styles$9={breadcrumb:breadcrumb,"breadcrumb-item":"breadcrumb-module_breadcrumb-item_suTUF"};var _excluded$c=["text","href","onClick"],_excluded2$5=["items","className"];var BreadcrumbItemComponent=function BreadcrumbItemComponent2(_ref3){var item2=_ref3.item;var itemText=item2.text,href=item2.href,onClick=item2.onClick,itemProps=_objectWithoutProperties$1(item2,_excluded$c);var text2="".concat(itemText," >");return onClick||href?/* @__PURE__ */jsx$1(Link,_objectSpread2$1(_objectSpread2$1({size:"sm",href:"".concat(href),onClick:onClick},itemProps),{},{children:text2})):/* @__PURE__ */jsxs("div",_objectSpread2$1(_objectSpread2$1({className:styles$9["breadcrumb-item"]},itemProps),{},{children:[" ",text2," "]}));};var BreadcrumbBase=function BreadcrumbBase2(_ref22){var items=_ref22.items,className=_ref22.className,otherProps=_objectWithoutProperties$1(_ref22,_excluded2$5);return/* @__PURE__ */jsx$1("nav",_objectSpread2$1(_objectSpread2$1({className:clsx(styles$9["breadcrumb"],className),"aria-label":"Breadcrumb"},otherProps),{},{children:map$2(items,function(item2,index2){return/* @__PURE__ */jsx$1(BreadcrumbItemComponent,{item:item2},index2);})}));};var Breadcrumb=withDebugHandlers(BreadcrumbBase,"Breadcrumb");var MoreVertIcon=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert");var menuPaperSx=function menuPaperSx2(size2,maxItemsVisible){return{"& .MuiPopover-paper":{boxShadow:"var(--shadow-md)",maxHeight:"".concat(maxHeight(size2,maxItemsVisible),"px")}};};var getMenuActionSize=function getMenuActionSize2(size2){switch(size2){case"sm":return 32;case"md":return 37;case"lg":return 42;default:return 37;}};var maxHeight=function maxHeight2(size2,maxItemsVisible){return getMenuActionSize(size2)*(maxItemsVisible!==null&&maxItemsVisible!==void 0?maxItemsVisible:6);};var item="menuItem-module_item_IbBuJ";var lg$1="menuItem-module_lg_ZMwXU";var md="menuItem-module_md_apOGd";var sm$1="menuItem-module_sm_gHxtB";var disabled$3="menuItem-module_disabled_LOHD3";var styles$8={item:item,lg:lg$1,md:md,sm:sm$1,disabled:disabled$3};var menuItemSx={fontFamily:"var(--primary-font-family)",fontSize:"14px",color:getColor("grey","900"),"&.Mui-selected":{backgroundColor:getColor("grey","100")},"&.Mui-selected:hover":{backgroundColor:getColor("grey","100")},"&.Mui-disabled":{opacity:0.5,pointerEvents:"none","& > *":{pointerEvents:"auto"}},padding:"0 16px"};var _excluded$b=["label","icon","onClick","selected","disabled","onClose","size","tooltipProps"];var ItemContent=function ItemContent2(_ref3){var icon2=_ref3.icon,label2=_ref3.label,disabled2=_ref3.disabled,_ref$size=_ref3.size,size2=_ref$size===void 0?"md":_ref$size;return/* @__PURE__ */jsxs("div",{className:clsx(styles$8.item,styles$8[size2],_defineProperty$2({},styles$8.disabled,disabled2)),children:[!!icon2&&icon2,/* @__PURE__ */jsx$1("span",{children:label2})]});};var MenuItemComponentBase=function MenuItemComponentBase2(_ref22){var label2=_ref22.label,icon2=_ref22.icon,onClick=_ref22.onClick,selected2=_ref22.selected,disabled2=_ref22.disabled,onClose=_ref22.onClose,_ref2$size=_ref22.size,size2=_ref2$size===void 0?"md":_ref2$size,tooltipProps=_ref22.tooltipProps,otherProps=_objectWithoutProperties$1(_ref22,_excluded$b);var _handleClick=function _handleClick2(){if(!disabled2){onClose===null||onClose===void 0||onClose();onClick===null||onClick===void 0||onClick();}};var shouldShowTooltip=(tooltipProps===null||tooltipProps===void 0?void 0:tooltipProps.shouldShowTooltip)||disabled2&&!!(tooltipProps!==null&&tooltipProps!==void 0&&tooltipProps.content);return/* @__PURE__ */jsx$1(MenuItem$1,_objectSpread2$1(_objectSpread2$1({sx:menuItemSx,selected:selected2,disabled:disabled2,onClick:_handleClick},otherProps),{},{children:/* @__PURE__ */jsx$1(WithTooltip,_objectSpread2$1(_objectSpread2$1({},tooltipProps),{},{shouldShowTooltip:shouldShowTooltip,children:/* @__PURE__ */jsx$1("span",{role:"tooltip",children:/* @__PURE__ */jsx$1(ItemContent,{icon:icon2,label:label2,disabled:disabled2,size:size2})})}))}));};var MenuItemComponent=withDebugHandlers(MenuItemComponentBase,"MenuItemComponent");var _excluded$a=["items","id","maxItemsVisible","icon","size","disableRipple","iconButtonSx"];var MenuAction=function MenuAction2(_ref3){var items=_ref3.items,_ref$id=_ref3.id,id=_ref$id===void 0?"menu-action-button":_ref$id,_ref$maxItemsVisible=_ref3.maxItemsVisible,maxItemsVisible=_ref$maxItemsVisible===void 0?6:_ref$maxItemsVisible,icon2=_ref3.icon,_ref$size=_ref3.size,size2=_ref$size===void 0?"md":_ref$size,_ref$disableRipple=_ref3.disableRipple,disableRipple=_ref$disableRipple===void 0?false:_ref$disableRipple,iconButtonSx=_ref3.iconButtonSx,otherProps=_objectWithoutProperties$1(_ref3,_excluded$a);var _useState=useState(null),_useState2=_slicedToArray$1(_useState,2),anchorEl=_useState2[0],setAnchorEl=_useState2[1];var open=Boolean(anchorEl);var _splitDataProps=splitDataProps(otherProps),_splitDataProps2=_slicedToArray$1(_splitDataProps,2),dataProps=_splitDataProps2[0],menuProps=_splitDataProps2[1];var handleClick=function handleClick2(event){setAnchorEl(event.currentTarget);};var handleClose=function handleClose2(){setAnchorEl(null);};return/* @__PURE__ */jsxs("div",{children:[/* @__PURE__ */jsx$1(IconButton,_objectSpread2$1(_objectSpread2$1({id:id,"aria-label":locale("a11y.moreActions"),"aria-controls":open?"".concat(id,"-menu"):void 0,"aria-expanded":open?"true":void 0,"aria-haspopup":"true",onClick:handleClick,disableRipple:disableRipple,sx:iconButtonSx},dataProps),{},{children:icon2!==null&&icon2!==void 0?icon2:/* @__PURE__ */jsx$1(CustomIcon,{color:getColor("grey","900"),children:/* @__PURE__ */jsx$1(MoreVertIcon,{})})})),/* @__PURE__ */jsx$1(Menu$1,_objectSpread2$1(_objectSpread2$1({id:"".concat(id,"-menu"),anchorEl:anchorEl,open:open,onClose:handleClose,disableScrollLock:true,slotProps:{list:{"aria-labelledby":id}},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:menuPaperSx(size2,maxItemsVisible)},menuProps),{},{children:map$2(items,function(item2,index2){var _item$size;return/* @__PURE__ */jsx$1(MenuItemComponent,_objectSpread2$1(_objectSpread2$1({},item2),{},{size:(_item$size=item2.size)!==null&&_item$size!==void 0?_item$size:size2,onClose:handleClose}),index2);})}))]});};var title$1="warningModal-module_title_kZiTR";var styles$7={"custom-header":"warningModal-module_custom-header_kflIT","help-container":"warningModal-module_help-container_hsnyD","header-icon":"warningModal-module_header-icon_qOIRS",title:title$1,"warning-modal":"warningModal-module_warning-modal_Nlamu","warning-body":"warningModal-module_warning-body_5DHA9"};var _excluded$9=["icon","onSave","onCancel","className","description","size","open","helpArticleHref","isLoading","fitContent","onChangeDontShowAgain","cancelLabel","confirmLabel","title","dontShowAgainLabel"];var DefaultIcon=/* @__PURE__ */jsx$1(CustomIcon,{size:"32",color:getColor("secondary","500"),children:/* @__PURE__ */jsx$1(ErrorIcon,{})});var WarningModalBase=function WarningModalBase2(_ref3){var icon2=_ref3.icon,onSave=_ref3.onSave,onCancel=_ref3.onCancel,className=_ref3.className,description2=_ref3.description,_ref$size=_ref3.size,size2=_ref$size===void 0?"sm":_ref$size,_ref$open=_ref3.open,open=_ref$open===void 0?true:_ref$open,helpArticleHref=_ref3.helpArticleHref,_ref$isLoading=_ref3.isLoading,isLoading=_ref$isLoading===void 0?false:_ref$isLoading,_ref$fitContent=_ref3.fitContent,fitContent=_ref$fitContent===void 0?true:_ref$fitContent,onChangeDontShowAgain=_ref3.onChangeDontShowAgain,_ref$cancelLabel=_ref3.cancelLabel,cancelLabel=_ref$cancelLabel===void 0?locale("cancel"):_ref$cancelLabel,_ref$confirmLabel=_ref3.confirmLabel,confirmLabel=_ref$confirmLabel===void 0?locale("continue"):_ref$confirmLabel,_ref$title=_ref3.title,title2=_ref$title===void 0?locale("warningModal.warning"):_ref$title,_ref$dontShowAgainLab=_ref3.dontShowAgainLabel,dontShowAgainLabel=_ref$dontShowAgainLab===void 0?locale("warningModal.dontShowAgain"):_ref$dontShowAgainLab,props=_objectWithoutProperties$1(_ref3,_excluded$9);var _splitDataProps=splitDataProps(props),_splitDataProps2=_slicedToArray$1(_splitDataProps,2),dataProps=_splitDataProps2[0],checkboxProps=_splitDataProps2[1];return/* @__PURE__ */jsxs(Modal2,_objectSpread2$1(_objectSpread2$1({open:open,size:size2,onClose:onCancel,isLoading:isLoading,className:clsx(styles$7["warning-modal"],className),fitContent:fitContent,ariaLabel:typeof title2==="string"?title2:void 0},dataProps),{},{children:[/* @__PURE__ */jsxs("div",{className:styles$7["custom-header"],children:[/* @__PURE__ */jsx$1("div",{className:styles$7["help-container"],children:/* @__PURE__ */jsx$1(HelpArticleLink,{href:helpArticleHref,tooltip:locale("guide")})}),/* @__PURE__ */jsxs("div",{className:styles$7["header-icon"],children:[!!icon2?icon2:DefaultIcon,/* @__PURE__ */jsx$1("div",{className:styles$7["title"],children:title2})]})]}),/* @__PURE__ */jsxs(Modal2.Body,{className:styles$7["warning-body"],children:[/* @__PURE__ */jsx$1("span",{children:description2}),onChangeDontShowAgain&&/* @__PURE__ */jsx$1(CheckboxInput,_objectSpread2$1({name:"dont-show-again",label:dontShowAgainLabel,onChange:onChangeDontShowAgain},checkboxProps))]}),/* @__PURE__ */jsx$1(Modal2.Footer,{cancelProps:{onCancel:onCancel,label:cancelLabel},saveProps:{onSave:onSave,label:confirmLabel,variant:"primary",size:"md"}})]}));};var WarningModal=withDebugHandlers(WarningModalBase,"WarningModal");var baseIteratee$1=_baseIteratee,isArrayLike$1=isArrayLike_1,keys=keys_1;function createFind$1(findIndexFunc){return function(collection,predicate,fromIndex){var iterable=Object(collection);if(!isArrayLike$1(collection)){var iteratee=baseIteratee$1(predicate);collection=keys(collection);predicate=function predicate(key){return iteratee(iterable[key],key,iterable);};}var index2=findIndexFunc(collection,predicate,fromIndex);return index2>-1?iterable[iteratee?collection[index2]:index2]:void 0;};}var _createFind=createFind$1;var baseFindIndex=_baseFindIndex,baseIteratee=_baseIteratee,toInteger=toInteger_1;var nativeMax=Math.max;function findIndex$1(array,predicate,fromIndex){var length2=array==null?0:array.length;if(!length2){return-1;}var index2=fromIndex==null?0:toInteger(fromIndex);if(index2<0){index2=nativeMax(length2+index2,0);}return baseFindIndex(array,baseIteratee(predicate),index2);}var findIndex_1=findIndex$1;var createFind=_createFind,findIndex=findIndex_1;var find=createFind(findIndex);var find_1=find;var find$1=/* @__PURE__ */getDefaultExportFromCjs(find_1);function isUndefined(value){return value===void 0;}var isUndefined_1=isUndefined;var isUndefined$1=/* @__PURE__ */getDefaultExportFromCjs(isUndefined_1);var tabs="tabs-module_tabs_UMeM9";var list="tabs-module_list_rsWgV";var tab="tabs-module_tab_qi523";var label$2="tabs-module_label_gXlYw";var active$1="tabs-module_active_PvUYu";var disabled$2="tabs-module_disabled_Lue6Q";var styles$6={tabs:tabs,list:list,tab:tab,label:label$2,active:active$1,disabled:disabled$2};var _excluded$8=["content","shouldShowTooltip"],_excluded2$4=["sx","items","value","onChange","defaultValue"],_excluded3$1=["id","href","label","disabled","tooltipProps","target","onClick"];var TabLabel=function TabLabel2(_ref3){var label2=_ref3.label,tooltipProps=_ref3.tooltipProps;var _ref22=tooltipProps!==null&&tooltipProps!==void 0?tooltipProps:{},content2=_ref22.content,_ref2$shouldShowToolt=_ref22.shouldShowTooltip,shouldShowTooltip=_ref2$shouldShowToolt===void 0?true:_ref2$shouldShowToolt,otherTooltipProps=_objectWithoutProperties$1(_ref22,_excluded$8);var tabLabel=/* @__PURE__ */jsx$1("span",{className:styles$6["label"],children:label2});if(!content2||!shouldShowTooltip)return tabLabel;return/* @__PURE__ */jsx$1(WithTooltip,_objectSpread2$1(_objectSpread2$1({},otherTooltipProps),{},{content:content2,describeChild:true,children:tabLabel}));};var TabsBase=function TabsBase2(_ref3){var sx=_ref3.sx,items=_ref3.items,value=_ref3.value,onChange2=_ref3.onChange,defaultValue2=_ref3.defaultValue,props=_objectWithoutProperties$1(_ref3,_excluded2$4);var _React$useState=React__default.useState(defaultValue2),_React$useState2=_slicedToArray$1(_React$useState,2),internalValue=_React$useState2[0],setInternalValue=_React$useState2[1];var activeId=!isUndefined$1(value)?value:internalValue;var firstEnabledId=useMemo(function(){var _find;return(_find=find$1(items,function(i){return!i.disabled;}))===null||_find===void 0?void 0:_find.id;},[items]);var combinedSx=useMemo(function(){return sxTabs2(sx);},[sx]);useEffect(function(){if(activeId===void 0){setInternalValue(firstEnabledId);}},[activeId,firstEnabledId]);var _handleSelect=function _handleSelect2(_event,newValue){var selectedId=String(newValue);var itemSelected=find$1(items,function(item2){return item2.id===selectedId;});if(itemSelected!==null&&itemSelected!==void 0&&itemSelected.disabled)return;if(value===void 0)setInternalValue(selectedId);onChange2===null||onChange2===void 0||onChange2(itemSelected);};var _handleTabClick=function _handleTabClick2(item2,event){if(item2.disabled||!item2.href)return;var isCtrlClick=event.ctrlKey||event.metaKey;var isMiddleClick=event.button===1;var isTargetBlank=item2.target==="_blank";if(isCtrlClick||isMiddleClick||isTargetBlank){return;}event.preventDefault();if(item2!==null&&item2!==void 0&&item2.onClick){var _item$onClick;item2===null||item2===void 0||(_item$onClick=item2.onClick)===null||_item$onClick===void 0||_item$onClick.call(item2);}else{setTimeout(function(){window.location.href=item2.href;},300);}};return/* @__PURE__ */jsx$1("div",_objectSpread2$1(_objectSpread2$1({className:clsx(styles$6["tabs"])},props),{},{children:/* @__PURE__ */jsx$1(Tabs$1,{sx:combinedSx,value:activeId,"aria-label":"tabs",onChange:_handleSelect,className:styles$6["list"],children:map$2(items,function(item2){var id=item2.id,href=item2.href,label2=item2.label,disabled2=item2.disabled,tooltipProps=item2.tooltipProps,target=item2.target;item2.onClick;var itemProps=_objectWithoutProperties$1(item2,_excluded3$1);return/* @__PURE__ */jsx$1(Tab,_objectSpread2$1({value:id,sx:sxTab,disableRipple:true,component:"a",disabled:disabled2,label:/* @__PURE__ */jsx$1(TabLabel,{label:label2,tooltipProps:tooltipProps}),onClick:function onClick(e){return _handleTabClick(item2,e);},className:clsx(styles$6["tab"],_defineProperty$2(_defineProperty$2({},styles$6["active"],id===activeId),styles$6["disabled"],disabled2)),href:href,target:target},itemProps),id);})})}));};var sxTabs2=function sxTabs3(sxListStyles){return{padding:0,minHeight:0,"& .MuiTabs-list":_objectSpread2$1({gap:"24px",padding:"0 32px"},sxListStyles||{}),"& .MuiTab-root":{minWidth:"0"},"& .MuiTabs-indicator":{borderRadius:"48px",backgroundColor:getColor("primary","500")}};};var sxTab={padding:0,minHeight:0};var Tabs2=withDebugHandlers(TabsBase,"Tabs");/*! *****************************************************************************
|
|
7039
|
+
*/variant:PropTypes.oneOf(["buffer","determinate","indeterminate","query"])}:void 0;var progressbar="progressbar-module_progressbar_8ygYR";var lg$2="progressbar-module_lg_5JGr-";var sm$2="progressbar-module_sm_LPtUo";var styles$d={progressbar:progressbar,lg:lg$2,sm:sm$2};var _excluded$h=["size","progress","variant"];var Progressbar=function Progressbar2(_ref3){var _ref$size=_ref3.size,size2=_ref$size===void 0?"lg":_ref$size,_ref$progress=_ref3.progress,initialProgress=_ref$progress===void 0?0:_ref$progress,_ref$variant=_ref3.variant,variant=_ref$variant===void 0?"determinate":_ref$variant,props=_objectWithoutProperties$1(_ref3,_excluded$h);var _useState=useState(initialProgress),_useState2=_slicedToArray$1(_useState,2),progress2=_useState2[0],setProgress=_useState2[1];useEffect(function(){if(variant==="buffer"){var timer=setInterval(function(){setProgress(function(oldProgress){var newProgress=Math.min(100,oldProgress+Math.sqrt(100-oldProgress)*0.5);return Math.round(newProgress);});},100);return function(){clearInterval(timer);};}else{setProgress(initialProgress);}},[variant,initialProgress]);return/* @__PURE__ */jsx$1(LinearProgress,_objectSpread2$1({variant:variant=="buffer"?"determinate":variant,value:progress2,className:clsx(styles$d["progressbar"],styles$d[size2]),"aria-label":locale("a11y.progress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":progress2},props));};var defaultDuration=2500;var stepInterval=100;var easeOutQuad=function easeOutQuad2(ratio){return ratio*(2-ratio);};var useAutoloadProgress=function useAutoloadProgress2(_ref3){var enabled=_ref3.enabled,_ref$duration=_ref3.duration,duration2=_ref$duration===void 0?defaultDuration:_ref$duration,_ref$onComplete=_ref3.onComplete,onComplete=_ref$onComplete===void 0?void 0:_ref$onComplete;var _useState=useState(0),_useState2=_slicedToArray$1(_useState,2),progress2=_useState2[0],setProgress=_useState2[1];var onCompleteRef=useRef(onComplete);useEffect(function(){onCompleteRef.current=onComplete;},[onComplete]);useEffect(function(){if(!enabled){setProgress(0);return void 0;}if(duration2<=0){var _onCompleteRef$curren;setProgress(100);(_onCompleteRef$curren=onCompleteRef.current)===null||_onCompleteRef$curren===void 0||_onCompleteRef$curren.call(onCompleteRef);return void 0;}var startedAt=Date.now();setProgress(0);var timer=setInterval(function(){var _onCompleteRef$curren2;var ratio=Math.min(1,(Date.now()-startedAt)/duration2);setProgress(Math.floor(easeOutQuad(ratio)*100));if(ratio<1)return;clearInterval(timer);(_onCompleteRef$curren2=onCompleteRef.current)===null||_onCompleteRef$curren2===void 0||_onCompleteRef$curren2.call(onCompleteRef);},stepInterval);return function(){return clearInterval(timer);};},[enabled,duration2]);return progress2;};var _excluded$g=["name","progress","autoload","autoloadDuration","onAutoloadComplete","error","onRemove","showRemoveAction"];var FileRowBase=function FileRowBase2(_ref3){var name2=_ref3.name,_ref$progress=_ref3.progress,progress2=_ref$progress===void 0?void 0:_ref$progress,_ref$autoload=_ref3.autoload,autoload=_ref$autoload===void 0?false:_ref$autoload,_ref$autoloadDuration=_ref3.autoloadDuration,autoloadDuration=_ref$autoloadDuration===void 0?void 0:_ref$autoloadDuration,_ref$onAutoloadComple=_ref3.onAutoloadComplete,onAutoloadComplete=_ref$onAutoloadComple===void 0?void 0:_ref$onAutoloadComple,_ref$error=_ref3.error,error2=_ref$error===void 0?void 0:_ref$error,_ref$onRemove=_ref3.onRemove,onRemove=_ref$onRemove===void 0?void 0:_ref$onRemove,_ref$showRemoveAction=_ref3.showRemoveAction,showRemoveAction=_ref$showRemoveAction===void 0?true:_ref$showRemoveAction,props=_objectWithoutProperties$1(_ref3,_excluded$g);var isControlled=progress2!==void 0;var autoloadProgress=useAutoloadProgress({enabled:autoload&&!isControlled,duration:autoloadDuration,onComplete:onAutoloadComplete});var isAutoloading=autoload&&!isControlled&&autoloadProgress<100;var currentProgress=isControlled?progress2:autoloadProgress;var hasProgress=isControlled||isAutoloading;var isRemovable=showRemoveAction&&!!onRemove;return/* @__PURE__ */jsxs("div",_objectSpread2$1(_objectSpread2$1({className:styles$e["file-row"]},props),{},{children:[/* @__PURE__ */jsxs("div",{className:clsx(styles$e.card,_defineProperty$2(_defineProperty$2({},styles$e.invalid,!!error2),styles$e.compact,hasProgress)),children:[/* @__PURE__ */jsxs("div",{className:styles$e.header,children:[/* @__PURE__ */jsx$1("span",{className:styles$e.name,children:name2}),isRemovable&&/* @__PURE__ */jsx$1("button",{type:"button",className:styles$e.remove,"aria-label":locale("dropzone.removeFile"),onClick:onRemove,children:/* @__PURE__ */jsx$1(TrashIcon,{size:16,color:getColor("primary","500")})})]}),hasProgress&&/* @__PURE__ */jsxs("div",{className:styles$e.progress,children:[/* @__PURE__ */jsx$1(Progressbar,{size:"sm",progress:currentProgress}),/* @__PURE__ */jsx$1("span",{className:styles$e.percentage,children:locale("dropzone.percentage",{progress:currentProgress})})]})]}),!!error2&&/* @__PURE__ */jsx$1("span",{role:"alert",className:styles$e.error,children:error2})]}));};var FileRow=withDebugHandlers(FileRowBase,"FileRow");var EditRoundedIcon=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M3 17.46v3.04c0 .28.22.5.5.5h3.04c.13 0 .26-.05.35-.15L17.81 9.94l-3.75-3.75L3.15 17.1q-.15.15-.15.36M20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"EditRounded");var VisibilityRoundedIcon=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M12 4C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4m0 12.5c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"VisibilityRounded");var VisibilityOffRoundedIcon=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M12 6.5c2.76 0 5 2.24 5 5 0 .51-.1 1-.24 1.46l3.06 3.06c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l2.17 2.17c.47-.14.96-.24 1.47-.24M2.71 3.16c-.39.39-.39 1.02 0 1.41l1.97 1.97C3.06 7.83 1.77 9.53 1 11.5 2.73 15.89 7 19 12 19c1.52 0 2.97-.3 4.31-.82l2.72 2.72c.39.39 1.02.39 1.41 0s.39-1.02 0-1.41L4.13 3.16c-.39-.39-1.03-.39-1.42 0M12 16.5c-2.76 0-5-2.24-5-5 0-.77.18-1.5.49-2.14l1.57 1.57c-.03.18-.06.37-.06.57 0 1.66 1.34 3 3 3 .2 0 .38-.03.57-.07L14.14 16c-.65.32-1.37.5-2.14.5m2.97-5.33c-.15-1.4-1.25-2.49-2.64-2.64z"}),"VisibilityOffRounded");var label$3="permissionOption-module_label_Vxb8a";var active$2="permissionOption-module_active_adte8";var clickable="permissionOption-module_clickable_qJgeM";var disabled$4="permissionOption-module_disabled_GSgD5";var styles$c={"permission-option":"permissionOption-module_permission-option_n5PwJ",label:label$3,active:active$2,"no-background":"permissionOption-module_no-background_IsIRU",clickable:clickable,disabled:disabled$4};var _excluded$f=["permission","isActive","disabled","showBackground","label","icon","onClick"];var permissionConfig={read:{icon:/* @__PURE__ */jsx$1(VisibilityRoundedIcon,{}),labelKey:"permissions.read"},edit:{icon:/* @__PURE__ */jsx$1(EditRoundedIcon,{}),labelKey:"permissions.edit"},noAccess:{icon:/* @__PURE__ */jsx$1(VisibilityOffRoundedIcon,{}),labelKey:"permissions.noAccess"}};var PermissionOptionBase=function PermissionOptionBase2(_ref3){var permission=_ref3.permission,_ref$isActive=_ref3.isActive,isActive=_ref$isActive===void 0?false:_ref$isActive,_ref$disabled=_ref3.disabled,disabled2=_ref$disabled===void 0?false:_ref$disabled,_ref$showBackground=_ref3.showBackground,showBackground=_ref$showBackground===void 0?true:_ref$showBackground,label2=_ref3.label,icon2=_ref3.icon,_ref$onClick=_ref3.onClick,onClick=_ref$onClick===void 0?void 0:_ref$onClick,props=_objectWithoutProperties$1(_ref3,_excluded$f);var _permissionConfig$per=permissionConfig[permission],defaultIcon=_permissionConfig$per.icon,labelKey=_permissionConfig$per.labelKey;var resolvedIcon=icon2!==null&&icon2!==void 0?icon2:defaultIcon;var resolvedLabel=label2!==null&&label2!==void 0?label2:locale(labelKey);var isClickable=!!onClick&&!disabled2;var iconColor=isActive?getColor("primary","500"):getColor("grey","800");return/* @__PURE__ */jsxs("div",_objectSpread2$1(_objectSpread2$1({className:clsx(styles$c["permission-option"],_defineProperty$2(_defineProperty$2(_defineProperty$2(_defineProperty$2({},styles$c.active,isActive),styles$c.disabled,disabled2),styles$c.clickable,isClickable),styles$c["no-background"],!showBackground)),role:isClickable?"button":void 0,tabIndex:isClickable?0:void 0,"aria-pressed":isClickable?isActive:void 0,"aria-disabled":disabled2||void 0,onClick:isClickable?onClick:void 0},props),{},{children:[/* @__PURE__ */jsx$1(CustomIcon,{size:"8",color:iconColor,children:resolvedIcon}),/* @__PURE__ */jsx$1("span",{className:styles$c.label,children:resolvedLabel})]}));};var PermissionOption=withDebugHandlers(PermissionOptionBase,"PermissionOption");var styles$b={"permission-selector":"permissionSelector-module_permission-selector_4Bgcp"};var _excluded$e=["sx","value","name","onChange","items","defaultValue"];var DEFAULT_ITEMS=[{permission:"noAccess"},{permission:"read"},{permission:"edit"}];var PermissionSelectorBase=function PermissionSelectorBase2(_ref3){var sx=_ref3.sx,value=_ref3.value,name2=_ref3.name,onChange2=_ref3.onChange,_ref$items=_ref3.items,items=_ref$items===void 0?DEFAULT_ITEMS:_ref$items,_ref$defaultValue=_ref3.defaultValue,defaultValue2=_ref$defaultValue===void 0?"noAccess":_ref$defaultValue,props=_objectWithoutProperties$1(_ref3,_excluded$e);var _React$useState=React__default.useState(defaultValue2),_React$useState2=_slicedToArray$1(_React$useState,2),internalValue=_React$useState2[0],setInternalValue=_React$useState2[1];var activeValue=value!==null&&value!==void 0?value:internalValue;var combinedSx=useMemo(function(){return sxTabs$1(sx);},[sx]);var _handleChange=function _handleChange2(_event,newValue){if(value===void 0)setInternalValue(newValue);var fakeEvent={target:{name:name2,value:newValue}};onChange2===null||onChange2===void 0||onChange2(fakeEvent);};return/* @__PURE__ */jsx$1("div",_objectSpread2$1(_objectSpread2$1({className:styles$b["permission-selector"]},props),{},{children:/* @__PURE__ */jsx$1(Tabs$1,{sx:combinedSx,value:activeValue,onChange:_handleChange,"aria-label":locale("permissionSelector.ariaLabel"),children:map$2(items,function(item2){return/* @__PURE__ */jsx$1(Tab,{value:item2.permission,sx:sxTab$1,disableRipple:true,disabled:item2.disabled,label:/* @__PURE__ */jsx$1(PermissionOption,{icon:item2.icon,label:item2.label,showBackground:false,disabled:item2.disabled,permission:item2.permission,isActive:item2.permission===activeValue})},item2.permission);})})}));};var sxTabs$1=function sxTabs(sxListStyles){return{padding:0,minHeight:0,"& .MuiTabs-list":_objectSpread2$1({gap:"2px"},sxListStyles||{}),"& .MuiTab-root":{minWidth:0,minHeight:0,padding:0,zIndex:1,textTransform:"none"},"& .MuiTabs-indicator":{bottom:0,height:"100%",zIndex:0,borderRadius:"var(--radius-md)",backgroundColor:getColor("primary","50")}};};var sxTab$1={padding:0,minHeight:0};var PermissionSelector=withDebugHandlers(PermissionSelectorBase,"PermissionSelector");var Cancel=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel");var ErrorIcon=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error");var Info=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info");var CheckCircle=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle");var alert="alert-module_alert_j7ZRS";var icon="alert-module_icon_vbZHd";var message="alert-module_message_klR2U";var close="alert-module_close_x5ptw";var success="alert-module_success_AVBKS";var error$1="alert-module_error_cxg96";var warning="alert-module_warning_zkMaJ";var info="alert-module_info_PBo1l";var styles$a={alert:alert,"full-width":"alert-module_full-width_eKIHw",icon:icon,message:message,close:close,success:success,error:error$1,warning:warning,info:info};var _excluded$d=["message","variant","className","icon","fullWidth","link","onClose"];var AlertBase=function AlertBase2(_ref3){var _link$href;var message2=_ref3.message,_ref$variant=_ref3.variant,variant=_ref$variant===void 0?"success":_ref$variant,className=_ref3.className,icon2=_ref3.icon,_ref$fullWidth=_ref3.fullWidth,fullWidth=_ref$fullWidth===void 0?false:_ref$fullWidth,link2=_ref3.link,onClose=_ref3.onClose,props=_objectWithoutProperties$1(_ref3,_excluded$d);var defaultIcons={success:/* @__PURE__ */jsx$1(CustomIcon,{size:"12",color:getColor("success","500"),children:/* @__PURE__ */jsx$1(CheckCircle,{"data-testid":"CheckCircleIcon"})}),error:/* @__PURE__ */jsx$1(CustomIcon,{size:"12",color:getColor("error","700"),children:/* @__PURE__ */jsx$1(Cancel,{})}),warning:/* @__PURE__ */jsx$1(CustomIcon,{size:"12",color:getColor("secondary","500"),children:/* @__PURE__ */jsx$1(ErrorIcon,{})}),info:/* @__PURE__ */jsx$1(CustomIcon,{size:"12",color:getColor("primary","500"),children:/* @__PURE__ */jsx$1(Info,{})})};return/* @__PURE__ */jsxs("div",_objectSpread2$1(_objectSpread2$1({className:clsx(styles$a["alert"],styles$a[variant],_defineProperty$2({},styles$a["full-width"],fullWidth),className)},props),{},{children:[/* @__PURE__ */jsx$1("div",{className:styles$a["icon"],children:icon2||defaultIcons[variant]}),/* @__PURE__ */jsxs("div",{className:styles$a["message"],children:[isString$4(message2)?/* @__PURE__ */jsx$1("span",{dangerouslySetInnerHTML:{__html:message2}}):/* @__PURE__ */jsxs("span",{children:[" ",message2]}),link2&&/* @__PURE__ */jsxs(Fragment$1,{children:[" ",/* @__PURE__ */jsx$1(Link,{href:(_link$href=link2.href)!==null&&_link$href!==void 0?_link$href:"#",size:"sm",weight:400,decoration:"underline",onClick:link2.onClick,children:link2.text})]})]}),onClose&&/* @__PURE__ */jsx$1("button",{type:"button",className:styles$a["close"],"aria-label":locale("a11y.close"),onClick:onClose,children:/* @__PURE__ */jsx$1(CustomIcon,{size:"12",color:getColor("grey","800"),children:/* @__PURE__ */jsx$1(CloseRoundedIcon,{})})})]}));};var Alert=withDebugHandlers(AlertBase,"Alert");var breadcrumb="breadcrumb-module_breadcrumb_r-ILp";var styles$9={breadcrumb:breadcrumb,"breadcrumb-item":"breadcrumb-module_breadcrumb-item_suTUF"};var _excluded$c=["text","href","onClick"],_excluded2$5=["items","className"];var BreadcrumbItemComponent=function BreadcrumbItemComponent2(_ref3){var item2=_ref3.item;var itemText=item2.text,href=item2.href,onClick=item2.onClick,itemProps=_objectWithoutProperties$1(item2,_excluded$c);var text2="".concat(itemText," >");return onClick||href?/* @__PURE__ */jsx$1(Link,_objectSpread2$1(_objectSpread2$1({size:"sm",href:"".concat(href),onClick:onClick},itemProps),{},{children:text2})):/* @__PURE__ */jsxs("div",_objectSpread2$1(_objectSpread2$1({className:styles$9["breadcrumb-item"]},itemProps),{},{children:[" ",text2," "]}));};var BreadcrumbBase=function BreadcrumbBase2(_ref22){var items=_ref22.items,className=_ref22.className,otherProps=_objectWithoutProperties$1(_ref22,_excluded2$5);return/* @__PURE__ */jsx$1("nav",_objectSpread2$1(_objectSpread2$1({className:clsx(styles$9["breadcrumb"],className),"aria-label":"Breadcrumb"},otherProps),{},{children:map$2(items,function(item2,index2){return/* @__PURE__ */jsx$1(BreadcrumbItemComponent,{item:item2},index2);})}));};var Breadcrumb=withDebugHandlers(BreadcrumbBase,"Breadcrumb");var MoreVertIcon=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert");var menuPaperSx=function menuPaperSx2(size2,maxItemsVisible){return{"& .MuiPopover-paper":{boxShadow:"var(--shadow-md)",maxHeight:"".concat(maxHeight(size2,maxItemsVisible),"px")}};};var getMenuActionSize=function getMenuActionSize2(size2){switch(size2){case"sm":return 32;case"md":return 37;case"lg":return 42;default:return 37;}};var maxHeight=function maxHeight2(size2,maxItemsVisible){return getMenuActionSize(size2)*(maxItemsVisible!==null&&maxItemsVisible!==void 0?maxItemsVisible:6);};var item="menuItem-module_item_IbBuJ";var lg$1="menuItem-module_lg_ZMwXU";var md="menuItem-module_md_apOGd";var sm$1="menuItem-module_sm_gHxtB";var disabled$3="menuItem-module_disabled_LOHD3";var styles$8={item:item,lg:lg$1,md:md,sm:sm$1,disabled:disabled$3};var menuItemSx={fontFamily:"var(--primary-font-family)",fontSize:"14px",color:getColor("grey","900"),"&.Mui-selected":{backgroundColor:getColor("grey","100")},"&.Mui-selected:hover":{backgroundColor:getColor("grey","100")},"&.Mui-disabled":{opacity:0.5,pointerEvents:"none","& > *":{pointerEvents:"auto"}},padding:"0 16px"};var _excluded$b=["label","icon","onClick","selected","disabled","onClose","size","tooltipProps"];var ItemContent=function ItemContent2(_ref3){var icon2=_ref3.icon,label2=_ref3.label,disabled2=_ref3.disabled,_ref$size=_ref3.size,size2=_ref$size===void 0?"md":_ref$size;return/* @__PURE__ */jsxs("div",{className:clsx(styles$8.item,styles$8[size2],_defineProperty$2({},styles$8.disabled,disabled2)),children:[!!icon2&&icon2,/* @__PURE__ */jsx$1("span",{children:label2})]});};var MenuItemComponentBase=function MenuItemComponentBase2(_ref22){var label2=_ref22.label,icon2=_ref22.icon,onClick=_ref22.onClick,selected2=_ref22.selected,disabled2=_ref22.disabled,onClose=_ref22.onClose,_ref2$size=_ref22.size,size2=_ref2$size===void 0?"md":_ref2$size,tooltipProps=_ref22.tooltipProps,otherProps=_objectWithoutProperties$1(_ref22,_excluded$b);var _handleClick=function _handleClick2(){if(!disabled2){onClose===null||onClose===void 0||onClose();onClick===null||onClick===void 0||onClick();}};var shouldShowTooltip=(tooltipProps===null||tooltipProps===void 0?void 0:tooltipProps.shouldShowTooltip)||disabled2&&!!(tooltipProps!==null&&tooltipProps!==void 0&&tooltipProps.content);return/* @__PURE__ */jsx$1(MenuItem$1,_objectSpread2$1(_objectSpread2$1({sx:menuItemSx,selected:selected2,disabled:disabled2,onClick:_handleClick},otherProps),{},{children:/* @__PURE__ */jsx$1(WithTooltip,_objectSpread2$1(_objectSpread2$1({},tooltipProps),{},{shouldShowTooltip:shouldShowTooltip,children:/* @__PURE__ */jsx$1("span",{role:"tooltip",children:/* @__PURE__ */jsx$1(ItemContent,{icon:icon2,label:label2,disabled:disabled2,size:size2})})}))}));};var MenuItemComponent=withDebugHandlers(MenuItemComponentBase,"MenuItemComponent");var _excluded$a=["items","id","maxItemsVisible","icon","size","disableRipple","iconButtonSx"];var MenuAction=function MenuAction2(_ref3){var items=_ref3.items,_ref$id=_ref3.id,id=_ref$id===void 0?"menu-action-button":_ref$id,_ref$maxItemsVisible=_ref3.maxItemsVisible,maxItemsVisible=_ref$maxItemsVisible===void 0?6:_ref$maxItemsVisible,icon2=_ref3.icon,_ref$size=_ref3.size,size2=_ref$size===void 0?"md":_ref$size,_ref$disableRipple=_ref3.disableRipple,disableRipple=_ref$disableRipple===void 0?false:_ref$disableRipple,iconButtonSx=_ref3.iconButtonSx,otherProps=_objectWithoutProperties$1(_ref3,_excluded$a);var _useState=useState(null),_useState2=_slicedToArray$1(_useState,2),anchorEl=_useState2[0],setAnchorEl=_useState2[1];var open=Boolean(anchorEl);var _splitDataProps=splitDataProps(otherProps),_splitDataProps2=_slicedToArray$1(_splitDataProps,2),dataProps=_splitDataProps2[0],menuProps=_splitDataProps2[1];var handleClick=function handleClick2(event){setAnchorEl(event.currentTarget);};var handleClose=function handleClose2(){setAnchorEl(null);};return/* @__PURE__ */jsxs("div",{children:[/* @__PURE__ */jsx$1(IconButton,_objectSpread2$1(_objectSpread2$1({id:id,"aria-label":locale("a11y.moreActions"),"aria-controls":open?"".concat(id,"-menu"):void 0,"aria-expanded":open?"true":void 0,"aria-haspopup":"true",onClick:handleClick,disableRipple:disableRipple,sx:iconButtonSx},dataProps),{},{children:icon2!==null&&icon2!==void 0?icon2:/* @__PURE__ */jsx$1(CustomIcon,{color:getColor("grey","900"),children:/* @__PURE__ */jsx$1(MoreVertIcon,{})})})),/* @__PURE__ */jsx$1(Menu$1,_objectSpread2$1(_objectSpread2$1({id:"".concat(id,"-menu"),anchorEl:anchorEl,open:open,onClose:handleClose,disableScrollLock:true,slotProps:{list:{"aria-labelledby":id}},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:menuPaperSx(size2,maxItemsVisible)},menuProps),{},{children:map$2(items,function(item2,index2){var _item$size;return/* @__PURE__ */jsx$1(MenuItemComponent,_objectSpread2$1(_objectSpread2$1({},item2),{},{size:(_item$size=item2.size)!==null&&_item$size!==void 0?_item$size:size2,onClose:handleClose}),index2);})}))]});};var title$1="warningModal-module_title_kZiTR";var styles$7={"custom-header":"warningModal-module_custom-header_kflIT","help-container":"warningModal-module_help-container_hsnyD","header-icon":"warningModal-module_header-icon_qOIRS",title:title$1,"warning-modal":"warningModal-module_warning-modal_Nlamu","warning-body":"warningModal-module_warning-body_5DHA9"};var _excluded$9=["icon","onSave","onCancel","className","saveAttrs","description","size","open","cancelAttrs","helpArticleHref","isLoading","fitContent","onChangeDontShowAgain","cancelLabel","confirmLabel","title","dontShowAgainLabel"];var DefaultIcon=/* @__PURE__ */jsx$1(CustomIcon,{size:"32",color:getColor("secondary","500"),children:/* @__PURE__ */jsx$1(ErrorIcon,{})});var WarningModalBase=function WarningModalBase2(_ref3){var icon2=_ref3.icon,onSave=_ref3.onSave,onCancel=_ref3.onCancel,className=_ref3.className,saveAttrs=_ref3.saveAttrs,description2=_ref3.description,_ref$size=_ref3.size,size2=_ref$size===void 0?"sm":_ref$size,_ref$open=_ref3.open,open=_ref$open===void 0?true:_ref$open,cancelAttrs=_ref3.cancelAttrs,helpArticleHref=_ref3.helpArticleHref,_ref$isLoading=_ref3.isLoading,isLoading=_ref$isLoading===void 0?false:_ref$isLoading,_ref$fitContent=_ref3.fitContent,fitContent=_ref$fitContent===void 0?true:_ref$fitContent,onChangeDontShowAgain=_ref3.onChangeDontShowAgain,_ref$cancelLabel=_ref3.cancelLabel,cancelLabel=_ref$cancelLabel===void 0?locale("cancel"):_ref$cancelLabel,_ref$confirmLabel=_ref3.confirmLabel,confirmLabel=_ref$confirmLabel===void 0?locale("continue"):_ref$confirmLabel,_ref$title=_ref3.title,title2=_ref$title===void 0?locale("warningModal.warning"):_ref$title,_ref$dontShowAgainLab=_ref3.dontShowAgainLabel,dontShowAgainLabel=_ref$dontShowAgainLab===void 0?locale("warningModal.dontShowAgain"):_ref$dontShowAgainLab,props=_objectWithoutProperties$1(_ref3,_excluded$9);var _splitDataProps=splitDataProps(props),_splitDataProps2=_slicedToArray$1(_splitDataProps,2),dataProps=_splitDataProps2[0],checkboxProps=_splitDataProps2[1];return/* @__PURE__ */jsxs(Modal2,_objectSpread2$1(_objectSpread2$1({open:open,size:size2,onClose:onCancel,isLoading:isLoading,className:clsx(styles$7["warning-modal"],className),fitContent:fitContent,ariaLabel:typeof title2==="string"?title2:void 0},dataProps),{},{children:[/* @__PURE__ */jsxs("div",{className:styles$7["custom-header"],children:[/* @__PURE__ */jsx$1("div",{className:styles$7["help-container"],children:/* @__PURE__ */jsx$1(HelpArticleLink,{href:helpArticleHref,tooltip:locale("guide")})}),/* @__PURE__ */jsxs("div",{className:styles$7["header-icon"],children:[!!icon2?icon2:DefaultIcon,/* @__PURE__ */jsx$1("div",{className:styles$7["title"],children:title2})]})]}),/* @__PURE__ */jsxs(Modal2.Body,{className:styles$7["warning-body"],children:[/* @__PURE__ */jsx$1("span",{children:description2}),onChangeDontShowAgain&&/* @__PURE__ */jsx$1(CheckboxInput,_objectSpread2$1({name:"dont-show-again",label:dontShowAgainLabel,onChange:onChangeDontShowAgain},checkboxProps))]}),/* @__PURE__ */jsx$1(Modal2.Footer,{cancelProps:_objectSpread2$1({onCancel:onCancel,label:cancelLabel},cancelAttrs),saveProps:_objectSpread2$1({onSave:onSave,label:confirmLabel,variant:"primary",size:"md"},saveAttrs)})]}));};var WarningModal=withDebugHandlers(WarningModalBase,"WarningModal");var baseIteratee$1=_baseIteratee,isArrayLike$1=isArrayLike_1,keys=keys_1;function createFind$1(findIndexFunc){return function(collection,predicate,fromIndex){var iterable=Object(collection);if(!isArrayLike$1(collection)){var iteratee=baseIteratee$1(predicate);collection=keys(collection);predicate=function predicate(key){return iteratee(iterable[key],key,iterable);};}var index2=findIndexFunc(collection,predicate,fromIndex);return index2>-1?iterable[iteratee?collection[index2]:index2]:void 0;};}var _createFind=createFind$1;var baseFindIndex=_baseFindIndex,baseIteratee=_baseIteratee,toInteger=toInteger_1;var nativeMax=Math.max;function findIndex$1(array,predicate,fromIndex){var length2=array==null?0:array.length;if(!length2){return-1;}var index2=fromIndex==null?0:toInteger(fromIndex);if(index2<0){index2=nativeMax(length2+index2,0);}return baseFindIndex(array,baseIteratee(predicate),index2);}var findIndex_1=findIndex$1;var createFind=_createFind,findIndex=findIndex_1;var find=createFind(findIndex);var find_1=find;var find$1=/* @__PURE__ */getDefaultExportFromCjs(find_1);function isUndefined(value){return value===void 0;}var isUndefined_1=isUndefined;var isUndefined$1=/* @__PURE__ */getDefaultExportFromCjs(isUndefined_1);var tabs="tabs-module_tabs_UMeM9";var list="tabs-module_list_rsWgV";var tab="tabs-module_tab_qi523";var label$2="tabs-module_label_gXlYw";var active$1="tabs-module_active_PvUYu";var disabled$2="tabs-module_disabled_Lue6Q";var styles$6={tabs:tabs,list:list,tab:tab,label:label$2,active:active$1,disabled:disabled$2};var _excluded$8=["content","shouldShowTooltip"],_excluded2$4=["sx","items","value","onChange","defaultValue"],_excluded3$1=["id","href","label","disabled","tooltipProps","target","onClick"];var TabLabel=function TabLabel2(_ref3){var label2=_ref3.label,tooltipProps=_ref3.tooltipProps;var _ref22=tooltipProps!==null&&tooltipProps!==void 0?tooltipProps:{},content2=_ref22.content,_ref2$shouldShowToolt=_ref22.shouldShowTooltip,shouldShowTooltip=_ref2$shouldShowToolt===void 0?true:_ref2$shouldShowToolt,otherTooltipProps=_objectWithoutProperties$1(_ref22,_excluded$8);var tabLabel=/* @__PURE__ */jsx$1("span",{className:styles$6["label"],children:label2});if(!content2||!shouldShowTooltip)return tabLabel;return/* @__PURE__ */jsx$1(WithTooltip,_objectSpread2$1(_objectSpread2$1({},otherTooltipProps),{},{content:content2,describeChild:true,children:tabLabel}));};var TabsBase=function TabsBase2(_ref3){var sx=_ref3.sx,items=_ref3.items,value=_ref3.value,onChange2=_ref3.onChange,defaultValue2=_ref3.defaultValue,props=_objectWithoutProperties$1(_ref3,_excluded2$4);var _React$useState=React__default.useState(defaultValue2),_React$useState2=_slicedToArray$1(_React$useState,2),internalValue=_React$useState2[0],setInternalValue=_React$useState2[1];var activeId=!isUndefined$1(value)?value:internalValue;var firstEnabledId=useMemo(function(){var _find;return(_find=find$1(items,function(i){return!i.disabled;}))===null||_find===void 0?void 0:_find.id;},[items]);var combinedSx=useMemo(function(){return sxTabs2(sx);},[sx]);useEffect(function(){if(activeId===void 0){setInternalValue(firstEnabledId);}},[activeId,firstEnabledId]);var _handleSelect=function _handleSelect2(_event,newValue){var selectedId=String(newValue);var itemSelected=find$1(items,function(item2){return item2.id===selectedId;});if(itemSelected!==null&&itemSelected!==void 0&&itemSelected.disabled)return;if(value===void 0)setInternalValue(selectedId);onChange2===null||onChange2===void 0||onChange2(itemSelected);};var _handleTabClick=function _handleTabClick2(item2,event){if(item2.disabled||!item2.href)return;var isCtrlClick=event.ctrlKey||event.metaKey;var isMiddleClick=event.button===1;var isTargetBlank=item2.target==="_blank";if(isCtrlClick||isMiddleClick||isTargetBlank){return;}event.preventDefault();if(item2!==null&&item2!==void 0&&item2.onClick){var _item$onClick;item2===null||item2===void 0||(_item$onClick=item2.onClick)===null||_item$onClick===void 0||_item$onClick.call(item2);}else{setTimeout(function(){window.location.href=item2.href;},300);}};return/* @__PURE__ */jsx$1("div",_objectSpread2$1(_objectSpread2$1({className:clsx(styles$6["tabs"])},props),{},{children:/* @__PURE__ */jsx$1(Tabs$1,{sx:combinedSx,value:activeId,"aria-label":"tabs",onChange:_handleSelect,className:styles$6["list"],children:map$2(items,function(item2){var id=item2.id,href=item2.href,label2=item2.label,disabled2=item2.disabled,tooltipProps=item2.tooltipProps,target=item2.target;item2.onClick;var itemProps=_objectWithoutProperties$1(item2,_excluded3$1);return/* @__PURE__ */jsx$1(Tab,_objectSpread2$1({value:id,sx:sxTab,disableRipple:true,component:"a",disabled:disabled2,label:/* @__PURE__ */jsx$1(TabLabel,{label:label2,tooltipProps:tooltipProps}),onClick:function onClick(e){return _handleTabClick(item2,e);},className:clsx(styles$6["tab"],_defineProperty$2(_defineProperty$2({},styles$6["active"],id===activeId),styles$6["disabled"],disabled2)),href:href,target:target},itemProps),id);})})}));};var sxTabs2=function sxTabs3(sxListStyles){return{padding:0,minHeight:0,"& .MuiTabs-list":_objectSpread2$1({gap:"24px",padding:"0 32px"},sxListStyles||{}),"& .MuiTab-root":{minWidth:"0"},"& .MuiTabs-indicator":{borderRadius:"48px",backgroundColor:getColor("primary","500")}};};var sxTab={padding:0,minHeight:0};var Tabs2=withDebugHandlers(TabsBase,"Tabs");/*! *****************************************************************************
|
|
7040
7040
|
Copyright (c) Microsoft Corporation.
|
|
7041
7041
|
|
|
7042
7042
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -7161,4 +7161,4 @@ droppable:false};}return{draggable:(_localDisabled$dragga=localDisabled==null?vo
|
|
|
7161
7161
|
* Either a string to use a HTML element or a component.
|
|
7162
7162
|
*/component:PropTypes.elementType,/**
|
|
7163
7163
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
7164
|
-
*/sx:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func,PropTypes.object,PropTypes.bool])),PropTypes.func,PropTypes.object])}:void 0;var DragIndicator=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");var DraggableRow=/* @__PURE__ */React__default.memo(function(_ref3){var item2=_ref3.item,isAdding=_ref3.isAdding,onRemove=_ref3.onRemove,canRemove=_ref3.canRemove,_ref$showRemoveAction=_ref3.showRemoveAction,showRemoveAction=_ref$showRemoveAction===void 0?true:_ref$showRemoveAction,component=_ref3.component,isRemoving=_ref3.isRemoving,onSelectValue=_ref3.onSelectValue,componentProps=_ref3.componentProps;var resolvedDisabled=Boolean(componentProps===null||componentProps===void 0?void 0:componentProps.disabled);var canRemoveItem=canRemove?canRemove(item2):true;var _useSortable=useSortable({id:item2.id,disabled:resolvedDisabled}),attributes=_useSortable.attributes,listeners=_useSortable.listeners,setActivatorNodeRef=_useSortable.setActivatorNodeRef,setNodeRef=_useSortable.setNodeRef,transform=_useSortable.transform,transition=_useSortable.transition,isDragging=_useSortable.isDragging;var _handleRemove=useCallback(function(){if(!canRemoveItem){return;}onRemove(item2.id);},[canRemoveItem,item2.id,onRemove]);var Component2=component;return/* @__PURE__ */jsxs(Paper,{ref:setNodeRef,className:clsx(styles$3["draggable-list--item"],_defineProperty$2(_defineProperty$2(_defineProperty$2({},styles$3["draggable-list--item--dragging"],isDragging),styles$3["draggable-list--item--adding"],isAdding),styles$3["draggable-list--item--removing"],isRemoving)),elevation:0,style:{transform:CSS$1.Transform.toString(transform),transition:transition},children:[/* @__PURE__ */jsx$1("span",_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({ref:setActivatorNodeRef,"aria-label":locale("a11y.reorder")},attributes),listeners),{},{children:/* @__PURE__ */jsx$1(CustomIcon,{size:"16",children:/* @__PURE__ */jsx$1(DragIndicator,{})})})),Component2?/* @__PURE__ */jsx$1(Component2,_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},componentProps),item2),{},{item:item2,disabled:resolvedDisabled,onItemChange:function onItemChange(value){return onSelectValue(item2.id,value);}})):null,showRemoveAction&&/* @__PURE__ */jsx$1(CustomIcon,{size:"8",role:"button","aria-label":locale("a11y.remove"),onClick:_handleRemove,disabled:resolvedDisabled||!canRemoveItem,color:getColor("primary","500"),children:/* @__PURE__ */jsx$1(TrashIcon,{})})]});});DraggableRow.displayName="DraggableRow";var _excluded$5=["label","addLabel","onChange","canRemove","showRemoveAction","itemComponent","value","componentProps","input"];var ITEM_ID_PREFIX="draggable-item";var _isStringArray=function _isStringArray2(value){return Array.isArray(value)&&(value.length===0||typeof value[0]==="string");};var _normalizeToItems=function _normalizeToItems2(value){if(!Array.isArray(value)){return[];}if(_isStringArray(value)){return value.map(function(val,index2){return{id:"".concat(ITEM_ID_PREFIX,"-string-").concat(index2,"-").concat(val),value:val};});}return value;};var _buildItem=function _buildItem2(currentLength){return{id:"".concat(ITEM_ID_PREFIX,"-").concat(currentLength,"-").concat(Date.now()),value:""};};var DraggableListBase=function DraggableListBase2(_ref3){var _ref22,_input$value;var label2=_ref3.label,addLabel=_ref3.addLabel,_onChange=_ref3.onChange,canRemove=_ref3.canRemove,_ref$showRemoveAction=_ref3.showRemoveAction,showRemoveAction=_ref$showRemoveAction===void 0?true:_ref$showRemoveAction,itemComponent=_ref3.itemComponent,_ref$value=_ref3.value,controlledItems=_ref$value===void 0?[]:_ref$value,componentProps=_ref3.componentProps,input2=_ref3.input,props=_objectWithoutProperties$1(_ref3,_excluded$5);if(!itemComponent){return null;}var rawValue=(_ref22=(_input$value=input2===null||input2===void 0?void 0:input2.value)!==null&&_input$value!==void 0?_input$value:controlledItems)!==null&&_ref22!==void 0?_ref22:[];var resolvedItems=useMemo(function(){return _normalizeToItems(rawValue);},[rawValue]);var outputFormatRef=useRef(_isStringArray(rawValue)?"strings":"objects");var _useState=useState(resolvedItems),_useState2=_slicedToArray$1(_useState,2),items=_useState2[0],setItems=_useState2[1];var _useState3=useState(/* @__PURE__ */new Set()),_useState4=_slicedToArray$1(_useState3,2),addingItems=_useState4[0],setAddingItems=_useState4[1];var _useState5=useState(/* @__PURE__ */new Set()),_useState6=_slicedToArray$1(_useState5,2),removingItems=_useState6[0],setRemovingItems=_useState6[1];var sensors=useSensors(useSensor(PointerSensor));var itemIds=useMemo(function(){return items.map(function(item2){return item2.id;});},[items]);useEffect(function(){outputFormatRef.current=_isStringArray(rawValue)?"strings":"objects";setItems(resolvedItems);},[resolvedItems,rawValue]);var _valueToOutput=useCallback(function(nextItems){return outputFormatRef.current==="strings"?nextItems.map(function(item2){var _item$value;return(_item$value=item2.value)!==null&&_item$value!==void 0?_item$value:"";}):nextItems;},[]);var _useReduxFormField=useReduxFormField({input:input2,onChange:function onChange2(nextItems){var _ref32,_input$name;if(!_onChange){return;}var value=_valueToOutput(nextItems);var resolvedName=(_ref32=(_input$name=input2===null||input2===void 0?void 0:input2.name)!==null&&_input$name!==void 0?_input$name:componentProps===null||componentProps===void 0?void 0:componentProps.name)!==null&&_ref32!==void 0?_ref32:"draggableList";var event={target:{name:resolvedName,value:value}};_onChange(event);},transformValue:function transformValue(nextItems){return _valueToOutput(nextItems);}}),_handleItemsChange=_useReduxFormField.handleChange;var _syncItems=useCallback(function(updater){setItems(function(prev2){var next2=typeof updater==="function"?updater(prev2):updater;_handleItemsChange(next2);return next2;});},[_handleItemsChange]);var _handleRemove=useCallback(function(id){setRemovingItems(function(prev2){return new Set(prev2).add(id);});setTimeout(function(){_syncItems(function(prev2){return prev2.filter(function(item2){return item2.id!==id;});});setRemovingItems(function(prev2){var next2=new Set(prev2);next2.delete(id);return next2;});},300);},[_syncItems]);var _handleSelectValue=useCallback(function(id,value){_syncItems(function(prev2){return prev2.map(function(item2){return item2.id===id?_objectSpread2$1(_objectSpread2$1({},item2),{},{value:value}):item2;});});},[_syncItems]);var _handleAdd=useCallback(function(){_syncItems(function(prev2){var newItem=_buildItem(prev2.length);setAddingItems(function(adding){return new Set(adding).add(newItem.id);});setTimeout(function(){setAddingItems(function(adding){var next2=new Set(adding);next2.delete(newItem.id);return next2;});},300);return[].concat(_toConsumableArray$1(prev2),[newItem]);});},[_syncItems]);var _handleDragEnd=useCallback(function(event){var active2=event.active,over=event.over;if(!over||active2.id===over.id)return;_syncItems(function(prev2){var oldIndex=prev2.findIndex(function(item2){return item2.id===active2.id;});var newIndex=prev2.findIndex(function(item2){return item2.id===over.id;});if(oldIndex===-1||newIndex===-1){return prev2;}return arrayMove(prev2,oldIndex,newIndex);});},[_syncItems]);return/* @__PURE__ */jsxs("div",_objectSpread2$1(_objectSpread2$1({className:clsx(styles$3["draggable-list"])},props),{},{children:[label2&&/* @__PURE__ */jsx$1("div",{className:styles$3["draggable-list--label"],children:label2}),/* @__PURE__ */jsx$1(DndContext,{sensors:sensors,collisionDetection:closestCenter,onDragEnd:_handleDragEnd,children:/* @__PURE__ */jsx$1(SortableContext,{items:itemIds,strategy:verticalListSortingStrategy,children:items.map(function(item2){return/* @__PURE__ */jsx$1(DraggableRow,{item:item2,component:itemComponent,canRemove:canRemove,showRemoveAction:showRemoveAction,onRemove:_handleRemove,componentProps:componentProps,onSelectValue:_handleSelectValue,isAdding:addingItems.has(item2.id),isRemoving:removingItems.has(item2.id)},item2.id);})})}),/* @__PURE__ */jsx$1("div",{className:clsx(styles$3["draggable-list--add-button"]),children:/* @__PURE__ */jsx$1(Link,{href:"#",size:"sm",onClick:function onClick(event){event.preventDefault();_handleAdd();},children:addLabel||locale("addPlus")})})]}));};var DraggableList=withDebugHandlers(DraggableListBase,"DraggableList");var dropzone="dropzone-module_dropzone_s6uiA";var label$1="dropzone-module_label_LGKwn";var input="dropzone-module_input_W4Rty";var area="dropzone-module_area_24Xf3";var error="dropzone-module_error_c-jB-";var instructions="dropzone-module_instructions_Q21KZ";var action="dropzone-module_action_zulkw";var hint="dropzone-module_hint_aTyPQ";var loading="dropzone-module_loading_zmnqc";var invalid="dropzone-module_invalid_dnk8R";var disabled="dropzone-module_disabled_2ajiy";var styles$2={dropzone:dropzone,label:label$1,input:input,area:area,error:error,instructions:instructions,action:action,hint:hint,"drag-active":"dropzone-module_drag-active_f00v1",loading:loading,invalid:invalid,disabled:disabled};var CloudUploadIcon=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"}),"CloudUpload");var fileTypes={PDF:{mime:"application/pdf",extensions:[".pdf"]},XML:{mime:"text/xml",extensions:[".xml"]},XLSX:{mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",extensions:[".xlsx"]},XLS:{mime:"application/vnd.ms-excel",extensions:[".xls"]},CSV:{mime:"text/csv",extensions:[".csv"]},PNG:{mime:"image/png",extensions:[".png"]},JPEG:{mime:"image/jpeg",extensions:[".jpeg",".jpg"]},IMAGE:{mime:"image/*",extensions:[]}};var megabytesToBytes=function megabytesToBytes2(megabytes){return megabytes*1024*1024;};var matchesMime=function matchesMime2(fileMime,acceptedMime){return acceptedMime.endsWith("/*")?fileMime.startsWith(acceptedMime.replace("/*","/")):fileMime===acceptedMime;};var matchesExtension=function matchesExtension2(fileName,extensions){return extensions.some(function(extension){return fileName.toLowerCase().endsWith(extension);});};var buildAcceptAttribute=function buildAcceptAttribute2(accept){if(!(accept!==null&&accept!==void 0&&accept.length))return void 0;var tokens=accept.reduce(function(current2,type){var definition=fileTypes[type];if(!definition)return current2;return current2.concat(definition.mime,definition.extensions);},[]);return Array.from(new Set(tokens)).join(",");};var isAcceptedType=function isAcceptedType2(file,accept){if(!(accept!==null&&accept!==void 0&&accept.length))return true;return accept.some(function(type){var definition=fileTypes[type];if(!definition)return false;return matchesMime(file.type,definition.mime)||matchesExtension(file.name,definition.extensions);});};var partitionFiles=function partitionFiles2(files,_ref3){var accept=_ref3.accept,maxSize=_ref3.maxSize,maxFiles=_ref3.maxFiles;var withinLimit=files.slice(0,maxFiles);var exceeding=files.slice(maxFiles);var accepted=[];var rejected=exceeding.map(function(file){return{file:file,reason:"tooManyFiles"};});withinLimit.forEach(function(file){if(!isAcceptedType(file,accept)){rejected.push({file:file,reason:"invalidType"});return;}if(maxSize&&file.size>megabytesToBytes(maxSize)){rejected.push({file:file,reason:"tooLarge"});return;}accepted.push(file);});return{accepted:accepted,rejected:rejected};};var useDropzone=function useDropzone2(_ref3){var onDrop=_ref3.onDrop,_ref$onReject=_ref3.onReject,onReject=_ref$onReject===void 0?void 0:_ref$onReject,_ref$accept=_ref3.accept,accept=_ref$accept===void 0?void 0:_ref$accept,_ref$maxSize=_ref3.maxSize,maxSize=_ref$maxSize===void 0?void 0:_ref$maxSize,_ref$maxFiles=_ref3.maxFiles,maxFiles=_ref$maxFiles===void 0?1:_ref$maxFiles,_ref$disabled=_ref3.disabled,disabled2=_ref$disabled===void 0?false:_ref$disabled;var _useState=useState(false),_useState2=_slicedToArray$1(_useState,2),isDragActive=_useState2[0],setIsDragActive=_useState2[1];var dragDepth=useRef(0);var acceptAttribute=useMemo(function(){return buildAcceptAttribute(accept);},[accept]);var processFiles=useCallback(function(fileList){var files=Array.from(fileList!==null&&fileList!==void 0?fileList:[]);if(!files.length)return;var _partitionFiles=partitionFiles(files,{accept:accept,maxSize:maxSize,maxFiles:maxFiles}),accepted=_partitionFiles.accepted,rejected=_partitionFiles.rejected;if(rejected.length)onReject===null||onReject===void 0||onReject(rejected);if(accepted.length)onDrop(accepted);},[accept,maxSize,maxFiles,onDrop,onReject]);var handleDragEnter=useCallback(function(event){event.preventDefault();if(disabled2)return;dragDepth.current+=1;setIsDragActive(true);},[disabled2]);var handleDragOver=useCallback(function(event){event.preventDefault();},[]);var handleDragLeave=useCallback(function(event){event.preventDefault();dragDepth.current=Math.max(0,dragDepth.current-1);if(!dragDepth.current)setIsDragActive(false);},[]);var handleDrop=useCallback(function(event){var _event$dataTransfer$f,_event$dataTransfer;event.preventDefault();dragDepth.current=0;setIsDragActive(false);if(disabled2)return;processFiles((_event$dataTransfer$f=(_event$dataTransfer=event.dataTransfer)===null||_event$dataTransfer===void 0?void 0:_event$dataTransfer.files)!==null&&_event$dataTransfer$f!==void 0?_event$dataTransfer$f:null);},[disabled2,processFiles]);var handleInputChange2=useCallback(function(event){processFiles(event.target.files);event.target.value="";},[processFiles]);var dragHandlers=useMemo(function(){return{onDragEnter:handleDragEnter,onDragOver:handleDragOver,onDragLeave:handleDragLeave,onDrop:handleDrop};},[handleDragEnter,handleDragOver,handleDragLeave,handleDrop]);return{isDragActive:isDragActive,acceptAttribute:acceptAttribute,dragHandlers:dragHandlers,handleInputChange:handleInputChange2,isMultiple:maxFiles>1};};var _excluded$4=["onDrop","onReject","accept","maxSize","maxFiles","label","error","isLoading","loadingText","disabled","name"];var DropzoneBase=function DropzoneBase2(_ref3){var onDrop=_ref3.onDrop,_ref$onReject=_ref3.onReject,onReject=_ref$onReject===void 0?void 0:_ref$onReject,_ref$accept=_ref3.accept,accept=_ref$accept===void 0?void 0:_ref$accept,_ref$maxSize=_ref3.maxSize,maxSize=_ref$maxSize===void 0?void 0:_ref$maxSize,_ref$maxFiles=_ref3.maxFiles,maxFiles=_ref$maxFiles===void 0?1:_ref$maxFiles,_ref$label=_ref3.label,label2=_ref$label===void 0?void 0:_ref$label,_ref$error=_ref3.error,error2=_ref$error===void 0?void 0:_ref$error,_ref$isLoading=_ref3.isLoading,isLoading=_ref$isLoading===void 0?false:_ref$isLoading,_ref$loadingText=_ref3.loadingText,loadingText=_ref$loadingText===void 0?void 0:_ref$loadingText,_ref$disabled=_ref3.disabled,disabled2=_ref$disabled===void 0?false:_ref$disabled,_ref$name=_ref3.name,name2=_ref$name===void 0?void 0:_ref$name,props=_objectWithoutProperties$1(_ref3,_excluded$4);var generatedId=useId$2();var inputId=name2!==null&&name2!==void 0?name2:generatedId;var isDisabled=disabled2||isLoading;var _useDropzone=useDropzone({onDrop:onDrop,onReject:onReject,accept:accept,maxSize:maxSize,maxFiles:maxFiles,disabled:isDisabled}),isDragActive=_useDropzone.isDragActive,acceptAttribute=_useDropzone.acceptAttribute,dragHandlers=_useDropzone.dragHandlers,handleInputChange2=_useDropzone.handleInputChange,isMultiple=_useDropzone.isMultiple;return/* @__PURE__ */jsxs("div",{className:styles$2.dropzone,children:[!!label2&&/* @__PURE__ */jsx$1("label",{htmlFor:inputId,className:styles$2.label,children:label2}),/* @__PURE__ */jsx$1("input",_objectSpread2$1({id:inputId,name:name2,type:"file",className:styles$2.input,accept:acceptAttribute,multiple:isMultiple,disabled:isDisabled,"aria-describedby":error2?"".concat(inputId,"-error"):void 0,onChange:handleInputChange2},props)),/* @__PURE__ */jsx$1("label",_objectSpread2$1(_objectSpread2$1({htmlFor:inputId,"aria-busy":isLoading||void 0,className:clsx(styles$2.area,_defineProperty$2(_defineProperty$2(_defineProperty$2(_defineProperty$2({},styles$2["drag-active"],isDragActive&&!isDisabled),styles$2.loading,isLoading),styles$2.invalid,!!error2),styles$2.disabled,isDisabled))},dragHandlers),{},{children:isLoading?/* @__PURE__ */jsxs(Fragment$1,{children:[/* @__PURE__ */jsx$1(Spinner,{size:"sm"}),/* @__PURE__ */jsx$1("p",{className:styles$2.instructions,children:loadingText!==null&&loadingText!==void 0?loadingText:locale("dropzone.uploadingFile")})]}):/* @__PURE__ */jsxs(Fragment$1,{children:[/* @__PURE__ */jsx$1(CustomIcon,{size:"24",color:getColor("primary","500"),children:/* @__PURE__ */jsx$1(CloudUploadIcon,{"data-testid":"CloudUploadIcon"})}),/* @__PURE__ */jsxs("p",{className:styles$2.instructions,children:[locale("dropzone.dropFiles")," ",/* @__PURE__ */jsx$1("span",{className:styles$2.action,children:locale("dropzone.clickHere")})]}),!!maxSize&&/* @__PURE__ */jsx$1("span",{className:styles$2.hint,children:locale("dropzone.maxSize",{maxSize:maxSize})})]})})),!!error2&&/* @__PURE__ */jsx$1("span",{id:"".concat(inputId,"-error"),role:"alert",className:styles$2.error,children:error2})]});};var Dropzone=withDebugHandlers(DropzoneBase,"Dropzone");var baseKeys=_baseKeys,getTag=_getTag,isArrayLike=isArrayLike_1,isString=isString_1,stringSize=_stringSize;var mapTag="[object Map]",setTag="[object Set]";function size(collection){if(collection==null){return 0;}if(isArrayLike(collection)){return isString(collection)?stringSize(collection):collection.length;}var tag=getTag(collection);if(tag==mapTag||tag==setTag){return collection.size;}return baseKeys(collection).length;}var size_1=size;var size$1=/* @__PURE__ */getDefaultExportFromCjs(size_1);var CheckRoundedIcon=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M9 16.17 5.53 12.7a.996.996 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71c.39-.39.39-1.02 0-1.41a.996.996 0 0 0-1.41 0z"}),"CheckRounded");var stepper="stepper-module_stepper_gHKwd";var step="stepper-module_step_Azhew";var circle="stepper-module_circle_Bke9b";var circleNumber="stepper-module_circleNumber_B5iiB";var checkIcon="stepper-module_checkIcon_FBwCT";var completed="stepper-module_completed_v-jTa";var current="stepper-module_current_-39vJ";var pending="stepper-module_pending_HgdCr";var label="stepper-module_label_-YviU";var separator="stepper-module_separator_8n-wG";var styles$1={stepper:stepper,step:step,circle:circle,circleNumber:circleNumber,checkIcon:checkIcon,"stepper-check-in":"stepper-module_stepper-check-in_ebuuV",completed:completed,"stepper-pop":"stepper-module_stepper-pop_HEFCF",current:current,pending:pending,label:label,separator:separator};var _excluded$3=["label","status"],_excluded2$1=["steps","activeStep"];var resolveStatus=function resolveStatus2(index2,activeStep,explicitStatus){if(explicitStatus)return explicitStatus;if(index2<activeStep)return"completed";if(index2===activeStep)return"current";return"pending";};var StepCircle=function StepCircle2(_ref3){var status=_ref3.status,index2=_ref3.index;return/* @__PURE__ */jsx$1("span",{className:clsx(styles$1.circle,styles$1[status]),children:status==="completed"?/* @__PURE__ */jsx$1(CheckRoundedIcon,{"data-testid":"CheckRoundedIcon",className:styles$1.checkIcon}):/* @__PURE__ */jsx$1("span",{className:styles$1.circleNumber,children:index2+1})});};var StepItemComponent=function StepItemComponent2(_ref22){var step2=_ref22.step,index2=_ref22.index,isLast=_ref22.isLast,activeStep=_ref22.activeStep;var label2=step2.label,explicitStatus=step2.status,stepProps=_objectWithoutProperties$1(step2,_excluded$3);var status=resolveStatus(index2,activeStep,explicitStatus);return/* @__PURE__ */jsxs(Fragment$1,{children:[/* @__PURE__ */jsxs("div",_objectSpread2$1(_objectSpread2$1({className:clsx(styles$1.step,styles$1[status])},stepProps),{},{children:[/* @__PURE__ */jsx$1(StepCircle,{status:status,index:index2}),/* @__PURE__ */jsx$1("span",{className:styles$1.label,children:label2})]})),!isLast&&/* @__PURE__ */jsx$1("span",{className:clsx(styles$1.separator,status==="completed"&&styles$1.completed),"aria-hidden":"true"})]});};var Stepper=function Stepper2(_ref3){var steps=_ref3.steps,_ref3$activeStep=_ref3.activeStep,activeStep=_ref3$activeStep===void 0?0:_ref3$activeStep,otherProps=_objectWithoutProperties$1(_ref3,_excluded2$1);var total=size$1(steps);return/* @__PURE__ */jsx$1("nav",_objectSpread2$1(_objectSpread2$1({className:styles$1.stepper,"aria-label":"Stepper"},otherProps),{},{children:map$2(steps,function(step2,index2){return/* @__PURE__ */jsx$1(StepItemComponent,{step:step2,index:index2,activeStep:activeStep,isLast:index2===total-1},index2);})}));};var TableContext=/* @__PURE__ */createContext([]);var table="table-module_table_NUX-V";var styles={"table-wrapper":"table-module_table-wrapper_vhMx4",table:table,"header-row":"table-module_header-row_ry6Lv","body-row":"table-module_body-row_OMOX0","header-cell":"table-module_header-cell_0FEWz","body-cell":"table-module_body-cell_p4019","body-async":"table-module_body-async_21Z7L"};var _excluded$2=["data","isLoading","error","empty","success","rowVerticalAlign"];var TableBody=function TableBody2(_ref3){var data=_ref3.data,isLoading=_ref3.isLoading,error2=_ref3.error,empty=_ref3.empty,success2=_ref3.success,rowVerticalAlign=_ref3.rowVerticalAlign,props=_objectWithoutProperties$1(_ref3,_excluded$2);var columns=useContext(TableContext);var showContent=!isLoading&&!(error2!==null&&error2!==void 0&&error2.value)&&!(success2!==null&&success2!==void 0&&success2.value)&&data.length>0;if(!showContent){return/* @__PURE__ */jsx$1("tbody",_objectSpread2$1(_objectSpread2$1({},props),{},{children:/* @__PURE__ */jsx$1("tr",{children:/* @__PURE__ */jsx$1("td",{colSpan:columns.length,className:styles["body-async"],children:/* @__PURE__ */jsx$1(AsyncContent,{isLoading:isLoading,error:error2,success:success2,empty:_objectSpread2$1(_objectSpread2$1({},empty),{},{items:data}),children:/* @__PURE__ */jsx$1(Fragment$1,{})})})})}));}return/* @__PURE__ */jsx$1("tbody",_objectSpread2$1(_objectSpread2$1({},props),{},{children:data.map(function(row,rowIndex){var resolvedRowVerticalAlign=typeof rowVerticalAlign==="function"?rowVerticalAlign(row,rowIndex):rowVerticalAlign;return/* @__PURE__ */jsx$1("tr",{className:styles["body-row"],children:columns.map(function(col){var value=row[col.key];return/* @__PURE__ */jsx$1(Box,{sx:resolvedRowVerticalAlign?[col.sx,{verticalAlign:resolvedRowVerticalAlign}]:col.sx,component:"td",className:styles["body-cell"],children:col.render?col.render(row,rowIndex):String(value!==null&&value!==void 0?value:"")},col.key);})},rowIndex);})}));};var _excluded$1=["columns"],_excluded2=["key","header","sx","render"];var TableHeader=function TableHeader2(_ref3){var columnsProp=_ref3.columns,props=_objectWithoutProperties$1(_ref3,_excluded$1);var contextColumns=useContext(TableContext);var columns=columnsProp!==null&&columnsProp!==void 0?columnsProp:contextColumns;return/* @__PURE__ */jsx$1("thead",_objectSpread2$1(_objectSpread2$1({},props),{},{children:/* @__PURE__ */jsx$1("tr",{className:styles["header-row"],children:columns.map(function(_ref22){var key=_ref22.key,header2=_ref22.header,sx=_ref22.sx;_ref22.render;var columnProps=_objectWithoutProperties$1(_ref22,_excluded2);return/* @__PURE__ */jsx$1(Box,_objectSpread2$1(_objectSpread2$1({sx:sx,component:"th",className:styles["header-cell"]},columnProps),{},{children:header2||/* @__PURE__ */jsx$1(Box,{component:"span",sx:visuallyHidden,children:key})}),key);})})}));};var _excluded=["columns","children","className"];var Table$1=function Table(_ref3){var columns=_ref3.columns,children=_ref3.children,className=_ref3.className,props=_objectWithoutProperties$1(_ref3,_excluded);return/* @__PURE__ */jsx$1(TableContext.Provider,{value:columns,children:/* @__PURE__ */jsx$1("div",_objectSpread2$1(_objectSpread2$1({className:clsx(styles["table-wrapper"],className)},props),{},{children:/* @__PURE__ */jsx$1("table",{className:styles.table,children:children})}))});};var Table2=Table$1;Table2.Header=TableHeader;Table2.Body=TableBody;var getProvider=function getProvider2(){if(typeof document!=="undefined"){var fromDocument=document.modelContext;if(fromDocument)return fromDocument;}if(typeof navigator!=="undefined"){return navigator.modelContext;}return void 0;};var useModelContextTool=function useModelContextTool2(_ref3){var name2=_ref3.name,title2=_ref3.title,description2=_ref3.description,inputSchema=_ref3.inputSchema,annotations=_ref3.annotations,execute=_ref3.execute;var _ref22=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_ref2$enabled=_ref22.enabled,enabled=_ref2$enabled===void 0?true:_ref2$enabled;var isSupported=getProvider()!==void 0;var executeRef=useRef(execute);var inputSchemaRef=useRef(inputSchema);var annotationsRef=useRef(annotations);var schemaKey=JSON.stringify(inputSchema);var annotationsKey=JSON.stringify(annotations);useEffect(function(){executeRef.current=execute;inputSchemaRef.current=inputSchema;annotationsRef.current=annotations;});useEffect(function(){if(!enabled)return;var provider=getProvider();if(!provider)return;var controller=new AbortController();provider.registerTool(_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({name:name2},title2!==void 0&&{title:title2}),{},{description:description2,inputSchema:inputSchemaRef.current},annotationsRef.current!==void 0&&{annotations:annotationsRef.current}),{},{execute:function execute2(args){return Promise.resolve(executeRef.current(args));}}),{signal:controller.signal}).catch(function(error2){if(controller.signal.aborted)return;logWarning('useModelContextTool: could not register the tool "'.concat(name2,'" (').concat(String(error2),")"));});return function(){return controller.abort();};},[enabled,name2,title2,description2,schemaKey,annotationsKey]);return{isSupported:isSupported};};export{ActionBar,Alert,AsyncContent,Breadcrumb,Button$2 as Button,Card,Categories,CheckIcon,CheckboxInput as Checkbox,CheckboxInputGroup as CheckboxGroup,CheckboxInput,CheckboxInputGroup,Chip$1 as Chip,ClearComponent,ColorOptions,ColorValues,Colors,ConditionalOperator,CopyButton,CustomIcon,DatePicker2 as DatePicker,DatePickerInput,DateRangePicker,DateRangePickerInput,DraggableList,Dropdown,Dropzone,EmptyState,EmptyStateIcon,ErrorStateIcon,FileIcon,FileRow,FormField,GeneratingState,GeneratingStateIcon,HeaderSection,HelpArticleLink,IconWithIdentifier,Image,Link,LinkWithIcon,MailIcon,Maintenance,MaintenanceIcon,MenuAction,MenuItemComponent,Modal2 as Modal,ModalBody,ModalFooter,ModalTitle,NewStateIcon,Option$1 as Option,OverflowChecker,PermissionOption,PermissionSelector,PickChannelModal,PriceCloseIcon,PriceDownIcon,ProductecaIcon,Progressbar,SearchComponent,SearchPublication,Searcher,SelectField,Shades,AppSidebar as Sidebar,SingleValue2 as SingleValue,Spinner,Stepper,SuccessStateIcon,SwitchInput as Switch,SwitchInputGroup as SwitchGroup,SwitchInput,SwitchInputGroup,Table2 as Table,TableBody,TableHeader,Tabs2 as Tabs,TextInput,TrashIcon,VALUE_AND,VALUE_OR,WarningModal,WithOverflowTooltip,WithTooltip,allColors,configureLocale,datePickerDayStyles,datePickerDigitalClockStyles,datePickerInputStyles,datePickerLayoutStyles,datePickerPopperStyles,datePickerYearStyles,formatDate,getActiveLocale,getColor,isValidColor,useAutoloadProgress,useDropzone,useModelContextTool,useReduxFormField};
|
|
7164
|
+
*/sx:PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func,PropTypes.object,PropTypes.bool])),PropTypes.func,PropTypes.object])}:void 0;var DragIndicator=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");var DraggableRow=/* @__PURE__ */React__default.memo(function(_ref3){var item2=_ref3.item,isAdding=_ref3.isAdding,onRemove=_ref3.onRemove,canRemove=_ref3.canRemove,_ref$showRemoveAction=_ref3.showRemoveAction,showRemoveAction=_ref$showRemoveAction===void 0?true:_ref$showRemoveAction,component=_ref3.component,isRemoving=_ref3.isRemoving,onSelectValue=_ref3.onSelectValue,componentProps=_ref3.componentProps;var resolvedDisabled=Boolean(componentProps===null||componentProps===void 0?void 0:componentProps.disabled);var canRemoveItem=canRemove?canRemove(item2):true;var _useSortable=useSortable({id:item2.id,disabled:resolvedDisabled}),attributes=_useSortable.attributes,listeners=_useSortable.listeners,setActivatorNodeRef=_useSortable.setActivatorNodeRef,setNodeRef=_useSortable.setNodeRef,transform=_useSortable.transform,transition=_useSortable.transition,isDragging=_useSortable.isDragging;var _handleRemove=useCallback(function(){if(!canRemoveItem){return;}onRemove(item2.id);},[canRemoveItem,item2.id,onRemove]);var Component2=component;return/* @__PURE__ */jsxs(Paper,{ref:setNodeRef,className:clsx(styles$3["draggable-list--item"],_defineProperty$2(_defineProperty$2(_defineProperty$2({},styles$3["draggable-list--item--dragging"],isDragging),styles$3["draggable-list--item--adding"],isAdding),styles$3["draggable-list--item--removing"],isRemoving)),elevation:0,style:{transform:CSS$1.Transform.toString(transform),transition:transition},children:[/* @__PURE__ */jsx$1("span",_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({ref:setActivatorNodeRef,"aria-label":locale("a11y.reorder")},attributes),listeners),{},{children:/* @__PURE__ */jsx$1(CustomIcon,{size:"16",children:/* @__PURE__ */jsx$1(DragIndicator,{})})})),Component2?/* @__PURE__ */jsx$1(Component2,_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({},componentProps),item2),{},{item:item2,disabled:resolvedDisabled,onItemChange:function onItemChange(value){return onSelectValue(item2.id,value);}})):null,showRemoveAction&&/* @__PURE__ */jsx$1(CustomIcon,{size:"8",role:"button","aria-label":locale("a11y.remove"),onClick:_handleRemove,disabled:resolvedDisabled||!canRemoveItem,color:getColor("primary","500"),children:/* @__PURE__ */jsx$1(TrashIcon,{})})]});});DraggableRow.displayName="DraggableRow";var _excluded$5=["label","addLabel","onChange","canRemove","showRemoveAction","itemComponent","value","componentProps","input"];var ITEM_ID_PREFIX="draggable-item";var _isStringArray=function _isStringArray2(value){return Array.isArray(value)&&(value.length===0||typeof value[0]==="string");};var _normalizeToItems=function _normalizeToItems2(value){if(!Array.isArray(value)){return[];}if(_isStringArray(value)){return value.map(function(val,index2){return{id:"".concat(ITEM_ID_PREFIX,"-string-").concat(index2,"-").concat(val),value:val};});}return value;};var _buildItem=function _buildItem2(currentLength){return{id:"".concat(ITEM_ID_PREFIX,"-").concat(currentLength,"-").concat(Date.now()),value:""};};var DraggableListBase=function DraggableListBase2(_ref3){var _ref22,_input$value;var label2=_ref3.label,addLabel=_ref3.addLabel,_onChange=_ref3.onChange,canRemove=_ref3.canRemove,_ref$showRemoveAction=_ref3.showRemoveAction,showRemoveAction=_ref$showRemoveAction===void 0?true:_ref$showRemoveAction,itemComponent=_ref3.itemComponent,_ref$value=_ref3.value,controlledItems=_ref$value===void 0?[]:_ref$value,componentProps=_ref3.componentProps,input2=_ref3.input,props=_objectWithoutProperties$1(_ref3,_excluded$5);if(!itemComponent){return null;}var rawValue=(_ref22=(_input$value=input2===null||input2===void 0?void 0:input2.value)!==null&&_input$value!==void 0?_input$value:controlledItems)!==null&&_ref22!==void 0?_ref22:[];var resolvedItems=useMemo(function(){return _normalizeToItems(rawValue);},[rawValue]);var outputFormatRef=useRef(_isStringArray(rawValue)?"strings":"objects");var _useState=useState(resolvedItems),_useState2=_slicedToArray$1(_useState,2),items=_useState2[0],setItems=_useState2[1];var _useState3=useState(/* @__PURE__ */new Set()),_useState4=_slicedToArray$1(_useState3,2),addingItems=_useState4[0],setAddingItems=_useState4[1];var _useState5=useState(/* @__PURE__ */new Set()),_useState6=_slicedToArray$1(_useState5,2),removingItems=_useState6[0],setRemovingItems=_useState6[1];var sensors=useSensors(useSensor(PointerSensor));var itemIds=useMemo(function(){return items.map(function(item2){return item2.id;});},[items]);useEffect(function(){outputFormatRef.current=_isStringArray(rawValue)?"strings":"objects";setItems(resolvedItems);},[resolvedItems,rawValue]);var _valueToOutput=useCallback(function(nextItems){return outputFormatRef.current==="strings"?nextItems.map(function(item2){var _item$value;return(_item$value=item2.value)!==null&&_item$value!==void 0?_item$value:"";}):nextItems;},[]);var _useReduxFormField=useReduxFormField({input:input2,onChange:function onChange2(nextItems){var _ref32,_input$name;if(!_onChange){return;}var value=_valueToOutput(nextItems);var resolvedName=(_ref32=(_input$name=input2===null||input2===void 0?void 0:input2.name)!==null&&_input$name!==void 0?_input$name:componentProps===null||componentProps===void 0?void 0:componentProps.name)!==null&&_ref32!==void 0?_ref32:"draggableList";var event={target:{name:resolvedName,value:value}};_onChange(event);},transformValue:function transformValue(nextItems){return _valueToOutput(nextItems);}}),_handleItemsChange=_useReduxFormField.handleChange;var _syncItems=useCallback(function(updater){setItems(function(prev2){var next2=typeof updater==="function"?updater(prev2):updater;_handleItemsChange(next2);return next2;});},[_handleItemsChange]);var _handleRemove=useCallback(function(id){setRemovingItems(function(prev2){return new Set(prev2).add(id);});setTimeout(function(){_syncItems(function(prev2){return prev2.filter(function(item2){return item2.id!==id;});});setRemovingItems(function(prev2){var next2=new Set(prev2);next2.delete(id);return next2;});},300);},[_syncItems]);var _handleSelectValue=useCallback(function(id,value){_syncItems(function(prev2){return prev2.map(function(item2){return item2.id===id?_objectSpread2$1(_objectSpread2$1({},item2),{},{value:value}):item2;});});},[_syncItems]);var _handleAdd=useCallback(function(){_syncItems(function(prev2){var newItem=_buildItem(prev2.length);setAddingItems(function(adding){return new Set(adding).add(newItem.id);});setTimeout(function(){setAddingItems(function(adding){var next2=new Set(adding);next2.delete(newItem.id);return next2;});},300);return[].concat(_toConsumableArray$1(prev2),[newItem]);});},[_syncItems]);var _handleDragEnd=useCallback(function(event){var active2=event.active,over=event.over;if(!over||active2.id===over.id)return;_syncItems(function(prev2){var oldIndex=prev2.findIndex(function(item2){return item2.id===active2.id;});var newIndex=prev2.findIndex(function(item2){return item2.id===over.id;});if(oldIndex===-1||newIndex===-1){return prev2;}return arrayMove(prev2,oldIndex,newIndex);});},[_syncItems]);return/* @__PURE__ */jsxs("div",_objectSpread2$1(_objectSpread2$1({className:clsx(styles$3["draggable-list"])},props),{},{children:[label2&&/* @__PURE__ */jsx$1("div",{className:styles$3["draggable-list--label"],children:label2}),/* @__PURE__ */jsx$1(DndContext,{sensors:sensors,collisionDetection:closestCenter,onDragEnd:_handleDragEnd,children:/* @__PURE__ */jsx$1(SortableContext,{items:itemIds,strategy:verticalListSortingStrategy,children:items.map(function(item2){return/* @__PURE__ */jsx$1(DraggableRow,{item:item2,component:itemComponent,canRemove:canRemove,showRemoveAction:showRemoveAction,onRemove:_handleRemove,componentProps:componentProps,onSelectValue:_handleSelectValue,isAdding:addingItems.has(item2.id),isRemoving:removingItems.has(item2.id)},item2.id);})})}),/* @__PURE__ */jsx$1("div",{className:clsx(styles$3["draggable-list--add-button"]),children:/* @__PURE__ */jsx$1(Link,{href:"#",size:"sm",onClick:function onClick(event){event.preventDefault();_handleAdd();},children:addLabel||locale("addPlus")})})]}));};var DraggableList=withDebugHandlers(DraggableListBase,"DraggableList");var dropzone="dropzone-module_dropzone_s6uiA";var label$1="dropzone-module_label_LGKwn";var input="dropzone-module_input_W4Rty";var area="dropzone-module_area_24Xf3";var error="dropzone-module_error_c-jB-";var instructions="dropzone-module_instructions_Q21KZ";var action="dropzone-module_action_zulkw";var hint="dropzone-module_hint_aTyPQ";var loading="dropzone-module_loading_zmnqc";var invalid="dropzone-module_invalid_dnk8R";var disabled="dropzone-module_disabled_2ajiy";var styles$2={dropzone:dropzone,label:label$1,input:input,area:area,error:error,instructions:instructions,action:action,hint:hint,"drag-active":"dropzone-module_drag-active_f00v1",loading:loading,invalid:invalid,disabled:disabled};var CloudUploadIcon=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"}),"CloudUpload");var fileTypes={PDF:{mime:"application/pdf",extensions:[".pdf"]},XML:{mime:"text/xml",extensions:[".xml"]},XLSX:{mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",extensions:[".xlsx"]},XLS:{mime:"application/vnd.ms-excel",extensions:[".xls"]},CSV:{mime:"text/csv",extensions:[".csv"]},PNG:{mime:"image/png",extensions:[".png"]},JPEG:{mime:"image/jpeg",extensions:[".jpeg",".jpg"]},IMAGE:{mime:"image/*",extensions:[]}};var megabytesToBytes=function megabytesToBytes2(megabytes){return megabytes*1024*1024;};var matchesMime=function matchesMime2(fileMime,acceptedMime){return acceptedMime.endsWith("/*")?fileMime.startsWith(acceptedMime.replace("/*","/")):fileMime===acceptedMime;};var matchesExtension=function matchesExtension2(fileName,extensions){return extensions.some(function(extension){return fileName.toLowerCase().endsWith(extension);});};var buildAcceptAttribute=function buildAcceptAttribute2(accept){if(!(accept!==null&&accept!==void 0&&accept.length))return void 0;var tokens=accept.reduce(function(current2,type){var definition=fileTypes[type];if(!definition)return current2;return current2.concat(definition.mime,definition.extensions);},[]);return Array.from(new Set(tokens)).join(",");};var isAcceptedType=function isAcceptedType2(file,accept){if(!(accept!==null&&accept!==void 0&&accept.length))return true;return accept.some(function(type){var definition=fileTypes[type];if(!definition)return false;return matchesMime(file.type,definition.mime)||matchesExtension(file.name,definition.extensions);});};var partitionFiles=function partitionFiles2(files,_ref3){var accept=_ref3.accept,maxSize=_ref3.maxSize,maxFiles=_ref3.maxFiles;var withinLimit=files.slice(0,maxFiles);var exceeding=files.slice(maxFiles);var accepted=[];var rejected=exceeding.map(function(file){return{file:file,reason:"tooManyFiles"};});withinLimit.forEach(function(file){if(!isAcceptedType(file,accept)){rejected.push({file:file,reason:"invalidType"});return;}if(maxSize&&file.size>megabytesToBytes(maxSize)){rejected.push({file:file,reason:"tooLarge"});return;}accepted.push(file);});return{accepted:accepted,rejected:rejected};};var useDropzone=function useDropzone2(_ref3){var onDrop=_ref3.onDrop,_ref$onReject=_ref3.onReject,onReject=_ref$onReject===void 0?void 0:_ref$onReject,_ref$accept=_ref3.accept,accept=_ref$accept===void 0?void 0:_ref$accept,_ref$maxSize=_ref3.maxSize,maxSize=_ref$maxSize===void 0?void 0:_ref$maxSize,_ref$maxFiles=_ref3.maxFiles,maxFiles=_ref$maxFiles===void 0?1:_ref$maxFiles,_ref$disabled=_ref3.disabled,disabled2=_ref$disabled===void 0?false:_ref$disabled;var _useState=useState(false),_useState2=_slicedToArray$1(_useState,2),isDragActive=_useState2[0],setIsDragActive=_useState2[1];var dragDepth=useRef(0);var acceptAttribute=useMemo(function(){return buildAcceptAttribute(accept);},[accept]);var processFiles=useCallback(function(fileList){var files=Array.from(fileList!==null&&fileList!==void 0?fileList:[]);if(!files.length)return;var _partitionFiles=partitionFiles(files,{accept:accept,maxSize:maxSize,maxFiles:maxFiles}),accepted=_partitionFiles.accepted,rejected=_partitionFiles.rejected;if(rejected.length)onReject===null||onReject===void 0||onReject(rejected);if(accepted.length)onDrop(accepted);},[accept,maxSize,maxFiles,onDrop,onReject]);var handleDragEnter=useCallback(function(event){event.preventDefault();if(disabled2)return;dragDepth.current+=1;setIsDragActive(true);},[disabled2]);var handleDragOver=useCallback(function(event){event.preventDefault();},[]);var handleDragLeave=useCallback(function(event){event.preventDefault();dragDepth.current=Math.max(0,dragDepth.current-1);if(!dragDepth.current)setIsDragActive(false);},[]);var handleDrop=useCallback(function(event){var _event$dataTransfer$f,_event$dataTransfer;event.preventDefault();dragDepth.current=0;setIsDragActive(false);if(disabled2)return;processFiles((_event$dataTransfer$f=(_event$dataTransfer=event.dataTransfer)===null||_event$dataTransfer===void 0?void 0:_event$dataTransfer.files)!==null&&_event$dataTransfer$f!==void 0?_event$dataTransfer$f:null);},[disabled2,processFiles]);var handleInputChange2=useCallback(function(event){processFiles(event.target.files);event.target.value="";},[processFiles]);var dragHandlers=useMemo(function(){return{onDragEnter:handleDragEnter,onDragOver:handleDragOver,onDragLeave:handleDragLeave,onDrop:handleDrop};},[handleDragEnter,handleDragOver,handleDragLeave,handleDrop]);return{isDragActive:isDragActive,acceptAttribute:acceptAttribute,dragHandlers:dragHandlers,handleInputChange:handleInputChange2,isMultiple:maxFiles>1};};var _excluded$4=["onDrop","onReject","accept","maxSize","maxFiles","label","error","isLoading","loadingText","disabled","name"];var DropzoneBase=function DropzoneBase2(_ref3){var onDrop=_ref3.onDrop,_ref$onReject=_ref3.onReject,onReject=_ref$onReject===void 0?void 0:_ref$onReject,_ref$accept=_ref3.accept,accept=_ref$accept===void 0?void 0:_ref$accept,_ref$maxSize=_ref3.maxSize,maxSize=_ref$maxSize===void 0?void 0:_ref$maxSize,_ref$maxFiles=_ref3.maxFiles,maxFiles=_ref$maxFiles===void 0?1:_ref$maxFiles,_ref$label=_ref3.label,label2=_ref$label===void 0?void 0:_ref$label,_ref$error=_ref3.error,error2=_ref$error===void 0?void 0:_ref$error,_ref$isLoading=_ref3.isLoading,isLoading=_ref$isLoading===void 0?false:_ref$isLoading,_ref$loadingText=_ref3.loadingText,loadingText=_ref$loadingText===void 0?void 0:_ref$loadingText,_ref$disabled=_ref3.disabled,disabled2=_ref$disabled===void 0?false:_ref$disabled,_ref$name=_ref3.name,name2=_ref$name===void 0?void 0:_ref$name,props=_objectWithoutProperties$1(_ref3,_excluded$4);var generatedId=useId$2();var inputId=name2!==null&&name2!==void 0?name2:generatedId;var isDisabled=disabled2||isLoading;var _useDropzone=useDropzone({onDrop:onDrop,onReject:onReject,accept:accept,maxSize:maxSize,maxFiles:maxFiles,disabled:isDisabled}),isDragActive=_useDropzone.isDragActive,acceptAttribute=_useDropzone.acceptAttribute,dragHandlers=_useDropzone.dragHandlers,handleInputChange2=_useDropzone.handleInputChange,isMultiple=_useDropzone.isMultiple;return/* @__PURE__ */jsxs("div",{className:styles$2.dropzone,children:[!!label2&&/* @__PURE__ */jsx$1("label",{htmlFor:inputId,className:styles$2.label,children:label2}),/* @__PURE__ */jsx$1("input",_objectSpread2$1({id:inputId,name:name2,type:"file",className:styles$2.input,accept:acceptAttribute,multiple:isMultiple,disabled:isDisabled,"aria-describedby":error2?"".concat(inputId,"-error"):void 0,onChange:handleInputChange2},props)),/* @__PURE__ */jsx$1("label",_objectSpread2$1(_objectSpread2$1({htmlFor:inputId,"aria-busy":isLoading||void 0,className:clsx(styles$2.area,_defineProperty$2(_defineProperty$2(_defineProperty$2(_defineProperty$2({},styles$2["drag-active"],isDragActive&&!isDisabled),styles$2.loading,isLoading),styles$2.invalid,!!error2),styles$2.disabled,isDisabled))},dragHandlers),{},{children:isLoading?/* @__PURE__ */jsxs(Fragment$1,{children:[/* @__PURE__ */jsx$1(Spinner,{size:"sm"}),/* @__PURE__ */jsx$1("p",{className:styles$2.instructions,children:loadingText!==null&&loadingText!==void 0?loadingText:locale("dropzone.uploadingFile")})]}):/* @__PURE__ */jsxs(Fragment$1,{children:[/* @__PURE__ */jsx$1(CustomIcon,{size:"24",color:getColor("primary","500"),children:/* @__PURE__ */jsx$1(CloudUploadIcon,{"data-testid":"CloudUploadIcon"})}),/* @__PURE__ */jsxs("p",{className:styles$2.instructions,children:[locale("dropzone.dropFiles")," ",/* @__PURE__ */jsx$1("span",{className:styles$2.action,children:locale("dropzone.clickHere")})]}),!!maxSize&&/* @__PURE__ */jsx$1("span",{className:styles$2.hint,children:locale("dropzone.maxSize",{maxSize:maxSize})})]})})),!!error2&&/* @__PURE__ */jsx$1("span",{id:"".concat(inputId,"-error"),role:"alert",className:styles$2.error,children:error2})]});};var Dropzone=withDebugHandlers(DropzoneBase,"Dropzone");var baseKeys=_baseKeys,getTag=_getTag,isArrayLike=isArrayLike_1,isString=isString_1,stringSize=_stringSize;var mapTag="[object Map]",setTag="[object Set]";function size(collection){if(collection==null){return 0;}if(isArrayLike(collection)){return isString(collection)?stringSize(collection):collection.length;}var tag=getTag(collection);if(tag==mapTag||tag==setTag){return collection.size;}return baseKeys(collection).length;}var size_1=size;var size$1=/* @__PURE__ */getDefaultExportFromCjs(size_1);var CheckRoundedIcon=createSvgIcon(/* @__PURE__ */jsx$1("path",{d:"M9 16.17 5.53 12.7a.996.996 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71c.39-.39.39-1.02 0-1.41a.996.996 0 0 0-1.41 0z"}),"CheckRounded");var stepper="stepper-module_stepper_gHKwd";var step="stepper-module_step_Azhew";var circle="stepper-module_circle_Bke9b";var circleNumber="stepper-module_circleNumber_B5iiB";var checkIcon="stepper-module_checkIcon_FBwCT";var completed="stepper-module_completed_v-jTa";var current="stepper-module_current_-39vJ";var pending="stepper-module_pending_HgdCr";var label="stepper-module_label_-YviU";var separator="stepper-module_separator_8n-wG";var styles$1={stepper:stepper,step:step,circle:circle,circleNumber:circleNumber,checkIcon:checkIcon,"stepper-check-in":"stepper-module_stepper-check-in_ebuuV",completed:completed,"stepper-pop":"stepper-module_stepper-pop_HEFCF",current:current,pending:pending,label:label,separator:separator};var _excluded$3=["label","status"],_excluded2$1=["steps","activeStep"];var resolveStatus=function resolveStatus2(index2,activeStep,explicitStatus){if(explicitStatus)return explicitStatus;if(index2<activeStep)return"completed";if(index2===activeStep)return"current";return"pending";};var StepCircle=function StepCircle2(_ref3){var status=_ref3.status,index2=_ref3.index;return/* @__PURE__ */jsx$1("span",{className:clsx(styles$1.circle,styles$1[status]),children:status==="completed"?/* @__PURE__ */jsx$1(CheckRoundedIcon,{"data-testid":"CheckRoundedIcon",className:styles$1.checkIcon}):/* @__PURE__ */jsx$1("span",{className:styles$1.circleNumber,children:index2+1})});};var StepItemComponent=function StepItemComponent2(_ref22){var step2=_ref22.step,index2=_ref22.index,isLast=_ref22.isLast,activeStep=_ref22.activeStep;var label2=step2.label,explicitStatus=step2.status,stepProps=_objectWithoutProperties$1(step2,_excluded$3);var status=resolveStatus(index2,activeStep,explicitStatus);return/* @__PURE__ */jsxs(Fragment$1,{children:[/* @__PURE__ */jsxs("div",_objectSpread2$1(_objectSpread2$1({className:clsx(styles$1.step,styles$1[status])},stepProps),{},{children:[/* @__PURE__ */jsx$1(StepCircle,{status:status,index:index2}),/* @__PURE__ */jsx$1("span",{className:styles$1.label,children:label2})]})),!isLast&&/* @__PURE__ */jsx$1("span",{className:clsx(styles$1.separator,status==="completed"&&styles$1.completed),"aria-hidden":"true"})]});};var Stepper=function Stepper2(_ref3){var steps=_ref3.steps,_ref3$activeStep=_ref3.activeStep,activeStep=_ref3$activeStep===void 0?0:_ref3$activeStep,otherProps=_objectWithoutProperties$1(_ref3,_excluded2$1);var total=size$1(steps);return/* @__PURE__ */jsx$1("nav",_objectSpread2$1(_objectSpread2$1({className:styles$1.stepper,"aria-label":"Stepper"},otherProps),{},{children:map$2(steps,function(step2,index2){return/* @__PURE__ */jsx$1(StepItemComponent,{step:step2,index:index2,activeStep:activeStep,isLast:index2===total-1},index2);})}));};var TableContext=/* @__PURE__ */createContext([]);var table="table-module_table_NUX-V";var styles={"table-wrapper":"table-module_table-wrapper_vhMx4",table:table,"header-row":"table-module_header-row_ry6Lv","body-row":"table-module_body-row_OMOX0","header-cell":"table-module_header-cell_0FEWz","body-cell":"table-module_body-cell_p4019","body-async":"table-module_body-async_21Z7L"};var _excluded$2=["data","isLoading","error","empty","success"];var TableBody=function TableBody2(_ref3){var data=_ref3.data,isLoading=_ref3.isLoading,error2=_ref3.error,empty=_ref3.empty,success2=_ref3.success,props=_objectWithoutProperties$1(_ref3,_excluded$2);var columns=useContext(TableContext);var showContent=!isLoading&&!(error2!==null&&error2!==void 0&&error2.value)&&!(success2!==null&&success2!==void 0&&success2.value)&&data.length>0;if(!showContent){return/* @__PURE__ */jsx$1("tbody",_objectSpread2$1(_objectSpread2$1({},props),{},{children:/* @__PURE__ */jsx$1("tr",{children:/* @__PURE__ */jsx$1("td",{colSpan:columns.length,className:styles["body-async"],children:/* @__PURE__ */jsx$1(AsyncContent,{isLoading:isLoading,error:error2,success:success2,empty:_objectSpread2$1(_objectSpread2$1({},empty),{},{items:data}),children:/* @__PURE__ */jsx$1(Fragment$1,{})})})})}));}return/* @__PURE__ */jsx$1("tbody",_objectSpread2$1(_objectSpread2$1({},props),{},{children:data.map(function(row,rowIndex){return/* @__PURE__ */jsx$1("tr",{className:styles["body-row"],children:columns.map(function(col){var value=row[col.key];return/* @__PURE__ */jsx$1(Box,{sx:col.sx,component:"td",className:styles["body-cell"],children:col.render?col.render(row,rowIndex):String(value!==null&&value!==void 0?value:"")},col.key);})},rowIndex);})}));};var _excluded$1=["columns"],_excluded2=["key","header","sx","render"];var TableHeader=function TableHeader2(_ref3){var columnsProp=_ref3.columns,props=_objectWithoutProperties$1(_ref3,_excluded$1);var contextColumns=useContext(TableContext);var columns=columnsProp!==null&&columnsProp!==void 0?columnsProp:contextColumns;return/* @__PURE__ */jsx$1("thead",_objectSpread2$1(_objectSpread2$1({},props),{},{children:/* @__PURE__ */jsx$1("tr",{className:styles["header-row"],children:columns.map(function(_ref22){var key=_ref22.key,header2=_ref22.header,sx=_ref22.sx;_ref22.render;var columnProps=_objectWithoutProperties$1(_ref22,_excluded2);return/* @__PURE__ */jsx$1(Box,_objectSpread2$1(_objectSpread2$1({sx:sx,component:"th",className:styles["header-cell"]},columnProps),{},{children:header2||/* @__PURE__ */jsx$1(Box,{component:"span",sx:visuallyHidden,children:key})}),key);})})}));};var _excluded=["columns","children","className"];var Table$1=function Table(_ref3){var columns=_ref3.columns,children=_ref3.children,className=_ref3.className,props=_objectWithoutProperties$1(_ref3,_excluded);return/* @__PURE__ */jsx$1(TableContext.Provider,{value:columns,children:/* @__PURE__ */jsx$1("div",_objectSpread2$1(_objectSpread2$1({className:clsx(styles["table-wrapper"],className)},props),{},{children:/* @__PURE__ */jsx$1("table",{className:styles.table,children:children})}))});};var Table2=Table$1;Table2.Header=TableHeader;Table2.Body=TableBody;var getProvider=function getProvider2(){if(typeof document!=="undefined"){var fromDocument=document.modelContext;if(fromDocument)return fromDocument;}if(typeof navigator!=="undefined"){return navigator.modelContext;}return void 0;};var useModelContextTool=function useModelContextTool2(_ref3){var name2=_ref3.name,title2=_ref3.title,description2=_ref3.description,inputSchema=_ref3.inputSchema,annotations=_ref3.annotations,execute=_ref3.execute;var _ref22=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_ref2$enabled=_ref22.enabled,enabled=_ref2$enabled===void 0?true:_ref2$enabled;var isSupported=getProvider()!==void 0;var executeRef=useRef(execute);var inputSchemaRef=useRef(inputSchema);var annotationsRef=useRef(annotations);var schemaKey=JSON.stringify(inputSchema);var annotationsKey=JSON.stringify(annotations);useEffect(function(){executeRef.current=execute;inputSchemaRef.current=inputSchema;annotationsRef.current=annotations;});useEffect(function(){if(!enabled)return;var provider=getProvider();if(!provider)return;var controller=new AbortController();provider.registerTool(_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({name:name2},title2!==void 0&&{title:title2}),{},{description:description2,inputSchema:inputSchemaRef.current},annotationsRef.current!==void 0&&{annotations:annotationsRef.current}),{},{execute:function execute2(args){return Promise.resolve(executeRef.current(args));}}),{signal:controller.signal}).catch(function(error2){if(controller.signal.aborted)return;logWarning('useModelContextTool: could not register the tool "'.concat(name2,'" (').concat(String(error2),")"));});return function(){return controller.abort();};},[enabled,name2,title2,description2,schemaKey,annotationsKey]);return{isSupported:isSupported};};export{ActionBar,Alert,AsyncContent,Breadcrumb,Button$2 as Button,Card,Categories,CheckIcon,CheckboxInput as Checkbox,CheckboxInputGroup as CheckboxGroup,CheckboxInput,CheckboxInputGroup,Chip$1 as Chip,ClearComponent,ColorOptions,ColorValues,Colors,ConditionalOperator,CopyButton,CustomIcon,DatePicker2 as DatePicker,DatePickerInput,DateRangePicker,DateRangePickerInput,DraggableList,Dropdown,Dropzone,EmptyState,EmptyStateIcon,ErrorStateIcon,FileIcon,FileRow,FormField,GeneratingState,GeneratingStateIcon,HeaderSection,HelpArticleLink,IconWithIdentifier,Image,Link,LinkWithIcon,MailIcon,Maintenance,MaintenanceIcon,MenuAction,MenuItemComponent,Modal2 as Modal,ModalBody,ModalFooter,ModalTitle,NewStateIcon,Option$1 as Option,OverflowChecker,PermissionOption,PermissionSelector,PickChannelModal,PriceCloseIcon,PriceDownIcon,ProductecaIcon,Progressbar,SearchComponent,SearchPublication,Searcher,SelectField,Shades,AppSidebar as Sidebar,SingleValue2 as SingleValue,Spinner,Stepper,SuccessStateIcon,SwitchInput as Switch,SwitchInputGroup as SwitchGroup,SwitchInput,SwitchInputGroup,Table2 as Table,TableBody,TableHeader,Tabs2 as Tabs,TextInput,TrashIcon,VALUE_AND,VALUE_OR,WarningModal,WithOverflowTooltip,WithTooltip,allColors,configureLocale,datePickerDayStyles,datePickerDigitalClockStyles,datePickerInputStyles,datePickerLayoutStyles,datePickerPopperStyles,datePickerYearStyles,formatDate,getActiveLocale,getColor,isValidColor,useAutoloadProgress,useDropzone,useModelContextTool,useReduxFormField};
|