Files
doormile_crm_build/dist/assets/TabLabelCount-C8QqvEa3.js
2026-06-20 16:54:56 +05:30

2 lines
16 KiB
JavaScript

import{l as pt,m as ht,a as d,n as vt,o as nt,_ as f,p as N,j as p,q as Nt,v as St,w as A,X as kt,Y as te,Z as jt,$ as Ot,a0 as Ft,a1 as rt,a2 as ee,k as ft,a3 as oe,r as le,i as re,S as ne,B as se}from"./index-Dh7N8U4a.js";import{K as ae,b as ie}from"./PhoneOutlined-Cesap_HI.js";let V;function $t(){if(V)return V;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),V="reverse",t.scrollLeft>0?V="default":(t.scrollLeft=1,t.scrollLeft===0&&(V="negative")),document.body.removeChild(t),V}function ce(t,e){const r=t.scrollLeft;if(e!=="rtl")return r;switch($t()){case"negative":return t.scrollWidth-t.clientWidth+r;case"reverse":return t.scrollWidth-t.clientWidth-r;default:return r}}function de(t){return pt("MuiTab",t)}const L=ht("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),ue=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],fe=t=>{const{classes:e,textColor:r,fullWidth:a,wrapped:s,icon:c,label:v,selected:h,disabled:u}=t,x={root:["root",c&&v&&"labelIcon",`textColor${Nt(r)}`,a&&"fullWidth",s&&"wrapped",h&&"selected",u&&"disabled"],iconWrapper:["iconWrapper"]};return St(x,de,e)},be=A(kt,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.label&&r.icon&&e.labelIcon,e[`textColor${Nt(r.textColor)}`],r.fullWidth&&e.fullWidth,r.wrapped&&e.wrapped,{[`& .${L.iconWrapper}`]:e.iconWrapper}]}})(({theme:t,ownerState:e})=>f({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${L.iconWrapper}`]:f({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${L.selected}`]:{opacity:1},[`&.${L.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${L.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${L.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${L.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${L.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),Fe=d.forwardRef(function(e,r){const a=vt({props:e,name:"MuiTab"}),{className:s,disabled:c=!1,disableFocusRipple:v=!1,fullWidth:h,icon:u,iconPosition:x="top",indicator:C,label:y,onChange:S,onClick:w,onFocus:k,selected:I,selectionFollowsFocus:g,textColor:H="inherit",value:M,wrapped:st=!1}=a,_=nt(a,ue),Y=f({},a,{disabled:c,disableFocusRipple:v,selected:I,icon:!!u,iconPosition:x,label:!!y,fullWidth:h,textColor:H,wrapped:st}),D=fe(Y),j=u&&y&&d.isValidElement(u)?d.cloneElement(u,{className:N(D.iconWrapper,u.props.className)}):u,Z=R=>{!I&&S&&S(R,M),w&&w(R)},X=R=>{g&&!I&&S&&S(R,M),k&&k(R)};return p.jsxs(be,f({focusRipple:!v,className:N(D.root,s),ref:r,role:"tab","aria-selected":I,disabled:c,onClick:Z,onFocus:X,ownerState:Y,tabIndex:I?0:-1},_,{children:[x==="top"||x==="start"?p.jsxs(d.Fragment,{children:[j,y]}):p.jsxs(d.Fragment,{children:[y,j]}),C]}))});function pe(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function he(t,e,r,a={},s=()=>{}){const{ease:c=pe,duration:v=300}=a;let h=null;const u=e[t];let x=!1;const C=()=>{x=!0},y=S=>{if(x){s(new Error("Animation cancelled"));return}h===null&&(h=S);const w=Math.min(1,(S-h)/v);if(e[t]=c(w)*(r-u)+u,w>=1){requestAnimationFrame(()=>{s(null)});return}requestAnimationFrame(y)};return u===r?(s(new Error("Element already at target position")),C):(requestAnimationFrame(y),C)}const ve=["onChange"],Se={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function me(t){const{onChange:e}=t,r=nt(t,ve),a=d.useRef(),s=d.useRef(null),c=()=>{a.current=s.current.offsetHeight-s.current.clientHeight};return te(()=>{const v=jt(()=>{const u=a.current;c(),u!==a.current&&e(a.current)}),h=Ot(s.current);return h.addEventListener("resize",v),()=>{v.clear(),h.removeEventListener("resize",v)}},[e]),d.useEffect(()=>{c(),e(a.current)},[e]),p.jsx("div",f({style:Se},r,{ref:s}))}function xe(t){return pt("MuiTabScrollButton",t)}const ge=ht("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),ye=["className","slots","slotProps","direction","orientation","disabled"],Be=t=>{const{classes:e,orientation:r,disabled:a}=t;return St({root:["root",r,a&&"disabled"]},xe,e)},Ce=A(kt,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.orientation&&e[r.orientation]]}})(({ownerState:t})=>f({width:40,flexShrink:0,opacity:.8,[`&.${ge.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),we=d.forwardRef(function(e,r){var a,s;const c=vt({props:e,name:"MuiTabScrollButton"}),{className:v,slots:h={},slotProps:u={},direction:x}=c,C=nt(c,ye),y=Ft(),S=f({isRtl:y},c),w=Be(S),k=(a=h.StartScrollButtonIcon)!=null?a:ae,I=(s=h.EndScrollButtonIcon)!=null?s:ie,g=rt({elementType:k,externalSlotProps:u.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S}),H=rt({elementType:I,externalSlotProps:u.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S});return p.jsx(Ce,f({component:"div",className:N(w.root,v),ref:r,role:null,ownerState:S,tabIndex:null},C,{children:x==="left"?p.jsx(k,f({},g)):p.jsx(I,f({},H))}))});function Ie(t){return pt("MuiTabs",t)}const bt=ht("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Te=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Wt=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,Pt=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,ot=(t,e,r)=>{let a=!1,s=r(t,e);for(;s;){if(s===t.firstChild){if(a)return;a=!0}const c=s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||c)s=r(t,s);else{s.focus();return}}},Ee=t=>{const{vertical:e,fixed:r,hideScrollbar:a,scrollableX:s,scrollableY:c,centered:v,scrollButtonsHideMobile:h,classes:u}=t;return St({root:["root",e&&"vertical"],scroller:["scroller",r&&"fixed",a&&"hideScrollbar",s&&"scrollableX",c&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",v&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",h&&"scrollButtonsHideMobile"],scrollableX:[s&&"scrollableX"],hideScrollbar:[a&&"hideScrollbar"]},Ie,u)},Me=A("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${bt.scrollButtons}`]:e.scrollButtons},{[`& .${bt.scrollButtons}`]:r.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,r.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>f({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${bt.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Re=A("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.scroller,r.fixed&&e.fixed,r.hideScrollbar&&e.hideScrollbar,r.scrollableX&&e.scrollableX,r.scrollableY&&e.scrollableY]}})(({ownerState:t})=>f({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),ze=A("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.flexContainer,r.vertical&&e.flexContainerVertical,r.centered&&e.centered]}})(({ownerState:t})=>f({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),We=A("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>f({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),Pe=A(me)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Lt={},$e=d.forwardRef(function(e,r){const a=vt({props:e,name:"MuiTabs"}),s=ee(),c=Ft(),{"aria-label":v,"aria-labelledby":h,action:u,centered:x=!1,children:C,className:y,component:S="div",allowScrollButtonsMobile:w=!1,indicatorColor:k="primary",onChange:I,orientation:g="horizontal",ScrollButtonComponent:H=we,scrollButtons:M="auto",selectionFollowsFocus:st,slots:_={},slotProps:Y={},TabIndicatorProps:D={},TabScrollButtonProps:j={},textColor:Z="primary",value:X,variant:R="standard",visibleScrollbar:at=!1}=a,At=nt(a,Te),T=R==="scrollable",B=g==="vertical",U=B?"scrollTop":"scrollLeft",J=B?"top":"left",Q=B?"bottom":"right",it=B?"clientHeight":"clientWidth",q=B?"height":"width",O=f({},a,{component:S,allowScrollButtonsMobile:w,indicatorColor:k,orientation:g,vertical:B,scrollButtons:M,textColor:Z,variant:R,visibleScrollbar:at,fixed:!T,hideScrollbar:T&&!at,scrollableX:T&&!B,scrollableY:T&&B,centered:x&&!T,scrollButtonsHideMobile:!w}),W=Ee(O),Ht=rt({elementType:_.StartScrollButtonIcon,externalSlotProps:Y.startScrollButtonIcon,ownerState:O}),_t=rt({elementType:_.EndScrollButtonIcon,externalSlotProps:Y.endScrollButtonIcon,ownerState:O}),[xt,Dt]=d.useState(!1),[F,gt]=d.useState(Lt),[yt,Xt]=d.useState(!1),[Bt,Vt]=d.useState(!1),[Ct,Yt]=d.useState(!1),[wt,Ut]=d.useState({overflow:"hidden",scrollbarWidth:0}),It=new Map,z=d.useRef(null),$=d.useRef(null),Tt=()=>{const o=z.current;let l;if(o){const n=o.getBoundingClientRect();l={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:ce(o,c?"rtl":"ltr"),scrollWidth:o.scrollWidth,top:n.top,bottom:n.bottom,left:n.left,right:n.right}}let i;if(o&&X!==!1){const n=$.current.children;if(n.length>0){const b=n[It.get(X)];i=b?b.getBoundingClientRect():null}}return{tabsMeta:l,tabMeta:i}},K=ft(()=>{const{tabsMeta:o,tabMeta:l}=Tt();let i=0,n;if(B)n="top",l&&o&&(i=l.top-o.top+o.scrollTop);else if(n=c?"right":"left",l&&o){const m=c?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;i=(c?-1:1)*(l[n]-o[n]+m)}const b={[n]:i,[q]:l?l[q]:0};if(isNaN(F[n])||isNaN(F[q]))gt(b);else{const m=Math.abs(F[n]-b[n]),E=Math.abs(F[q]-b[q]);(m>=1||E>=1)&&gt(b)}}),ct=(o,{animation:l=!0}={})=>{l?he(U,z.current,o,{duration:s.transitions.duration.standard}):z.current[U]=o},Et=o=>{let l=z.current[U];B?l+=o:(l+=o*(c?-1:1),l*=c&&$t()==="reverse"?-1:1),ct(l)},Mt=()=>{const o=z.current[it];let l=0;const i=Array.from($.current.children);for(let n=0;n<i.length;n+=1){const b=i[n];if(l+b[it]>o){n===0&&(l=o);break}l+=b[it]}return l},qt=()=>{Et(-1*Mt())},Kt=()=>{Et(Mt())},Gt=d.useCallback(o=>{Ut({overflow:null,scrollbarWidth:o})},[]),Zt=()=>{const o={};o.scrollbarSizeListener=T?p.jsx(Pe,{onChange:Gt,className:N(W.scrollableX,W.hideScrollbar)}):null;const i=T&&(M==="auto"&&(yt||Bt)||M===!0);return o.scrollButtonStart=i?p.jsx(H,f({slots:{StartScrollButtonIcon:_.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Ht},orientation:g,direction:c?"right":"left",onClick:qt,disabled:!yt},j,{className:N(W.scrollButtons,j.className)})):null,o.scrollButtonEnd=i?p.jsx(H,f({slots:{EndScrollButtonIcon:_.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:_t},orientation:g,direction:c?"left":"right",onClick:Kt,disabled:!Bt},j,{className:N(W.scrollButtons,j.className)})):null,o},Rt=ft(o=>{const{tabsMeta:l,tabMeta:i}=Tt();if(!(!i||!l)){if(i[J]<l[J]){const n=l[U]+(i[J]-l[J]);ct(n,{animation:o})}else if(i[Q]>l[Q]){const n=l[U]+(i[Q]-l[Q]);ct(n,{animation:o})}}}),tt=ft(()=>{T&&M!==!1&&Yt(!Ct)});d.useEffect(()=>{const o=jt(()=>{z.current&&K()});let l;const i=m=>{m.forEach(E=>{E.removedNodes.forEach(G=>{var P;(P=l)==null||P.unobserve(G)}),E.addedNodes.forEach(G=>{var P;(P=l)==null||P.observe(G)})}),o(),tt()},n=Ot(z.current);n.addEventListener("resize",o);let b;return typeof ResizeObserver<"u"&&(l=new ResizeObserver(o),Array.from($.current.children).forEach(m=>{l.observe(m)})),typeof MutationObserver<"u"&&(b=new MutationObserver(i),b.observe($.current,{childList:!0})),()=>{var m,E;o.clear(),n.removeEventListener("resize",o),(m=b)==null||m.disconnect(),(E=l)==null||E.disconnect()}},[K,tt]),d.useEffect(()=>{const o=Array.from($.current.children),l=o.length;if(typeof IntersectionObserver<"u"&&l>0&&T&&M!==!1){const i=o[0],n=o[l-1],b={root:z.current,threshold:.99},m=ut=>{Xt(!ut[0].isIntersecting)},E=new IntersectionObserver(m,b);E.observe(i);const G=ut=>{Vt(!ut[0].isIntersecting)},P=new IntersectionObserver(G,b);return P.observe(n),()=>{E.disconnect(),P.disconnect()}}},[T,M,Ct,C==null?void 0:C.length]),d.useEffect(()=>{Dt(!0)},[]),d.useEffect(()=>{K()}),d.useEffect(()=>{Rt(Lt!==F)},[Rt,F]),d.useImperativeHandle(u,()=>({updateIndicator:K,updateScrollButtons:tt}),[K,tt]);const zt=p.jsx(We,f({},D,{className:N(W.indicator,D.className),ownerState:O,style:f({},F,D.style)}));let et=0;const Jt=d.Children.map(C,o=>{if(!d.isValidElement(o))return null;const l=o.props.value===void 0?et:o.props.value;It.set(l,et);const i=l===X;return et+=1,d.cloneElement(o,f({fullWidth:R==="fullWidth",indicator:i&&!xt&&zt,selected:i,selectionFollowsFocus:st,onChange:I,textColor:Z,value:l},et===1&&X===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),Qt=o=>{const l=$.current,i=oe(l).activeElement;if(i.getAttribute("role")!=="tab")return;let b=g==="horizontal"?"ArrowLeft":"ArrowUp",m=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&c&&(b="ArrowRight",m="ArrowLeft"),o.key){case b:o.preventDefault(),ot(l,i,Pt);break;case m:o.preventDefault(),ot(l,i,Wt);break;case"Home":o.preventDefault(),ot(l,null,Wt);break;case"End":o.preventDefault(),ot(l,null,Pt);break}},dt=Zt();return p.jsxs(Me,f({className:N(W.root,y),ownerState:O,ref:r,as:S},At,{children:[dt.scrollButtonStart,dt.scrollbarSizeListener,p.jsxs(Re,{className:W.scroller,ownerState:O,style:{overflow:wt.overflow,[B?`margin${c?"Left":"Right"}`:"marginBottom"]:at?void 0:-wt.scrollbarWidth},ref:z,children:[p.jsx(ze,{"aria-label":v,"aria-labelledby":h,"aria-orientation":g==="vertical"?"vertical":null,className:W.flexContainer,ownerState:O,onKeyDown:Qt,ref:$,role:"tablist",children:Jt}),xt&&zt]}),dt.scrollButtonEnd]}))});var mt={},Le=re;Object.defineProperty(mt,"__esModule",{value:!0});var Ne=mt.default=void 0,ke=Le(le()),lt=p;Ne=mt.default=(0,ke.default)([(0,lt.jsx)("path",{d:"M14 12h4v1.5h-4zm0 3h4v1.5h-4z"},"0"),(0,lt.jsx)("path",{d:"M20 7h-5V4c0-1.1-.9-2-2-2h-2c-1.1 0-2 .9-2 2v3H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2m-9 0V4h2v5h-2zm9 13H4V9h5c0 1.1.9 2 2 2h2c1.1 0 2-.9 2-2h5z"},"1"),(0,lt.jsx)("circle",{cx:"9",cy:"13.5",r:"1.5"},"2"),(0,lt.jsx)("path",{d:"M11.08 16.18c-.64-.28-1.34-.43-2.08-.43s-1.44.15-2.08.43c-.56.24-.92.78-.92 1.39V18h6v-.43c0-.61-.36-1.15-.92-1.39"},"3")],"BadgeOutlined");function Ae({label:t,count:e,active:r=!1}){return p.jsxs(ne,{direction:"row",alignItems:"center",spacing:1,children:[p.jsx("span",{children:t}),p.jsx(se,{component:"span",sx:{minWidth:20,height:20,px:.75,borderRadius:10,fontSize:"0.72rem",fontWeight:700,lineHeight:"20px",textAlign:"center",bgcolor:r?"primary.main":"grey.200",color:r?"#fff":"text.secondary"},children:e})]})}export{$e as T,Fe as a,Ae as b,Ne as d};