bonuspluscomponents 0.0.66 → 0.0.67
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.
|
@@ -99,7 +99,7 @@ const theme2 = createTheme({ palette: {
|
|
|
99
99
|
} });`:tr(12,h?` (${h})`:"",JSON.stringify(p.main)));return Rn(p,"light",F,n),Rn(p,"dark",g,n),p.contrastText||(p.contrastText=m(p.main)),p},x={dark:nt,light:On};return process.env.NODE_ENV!=="production"&&(x[r]||console.error(`MUI: The palette mode \`${r}\` is not supported.`)),Fe(z({common:z({},hr),mode:r,primary:d({color:i,name:"primary"}),secondary:d({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:d({color:c,name:"error"}),warning:d({color:f,name:"warning"}),info:d({color:u,name:"info"}),success:d({color:l,name:"success"}),grey:Zs,contrastThreshold:t,getContrastText:m,augmentColor:d,tonalOffset:n},x[r]),o)}const pc=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function mc(e){return Math.round(e*1e5)/1e5}const $n={textTransform:"uppercase"},Cn='"Roboto", "Helvetica", "Arial", sans-serif';function hc(e,r){const t=typeof r=="function"?r(e):r,{fontFamily:n=Cn,fontSize:o=14,fontWeightLight:i=300,fontWeightRegular:a=400,fontWeightMedium:c=500,fontWeightBold:u=700,htmlFontSize:l=16,allVariants:f,pxToRem:m}=t,d=Ve(t,pc);process.env.NODE_ENV!=="production"&&(typeof o!="number"&&console.error("MUI: `fontSize` is required to be a number."),typeof l!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const x=o/14,_=m||(O=>`${O/l*x}rem`),p=(O,F,g,R,v)=>z({fontFamily:n,fontWeight:O,fontSize:_(F),lineHeight:g},n===Cn?{letterSpacing:`${mc(R/F)}em`}:{},v,f),h={h1:p(i,96,1.167,-1.5),h2:p(i,60,1.2,-.5),h3:p(a,48,1.167,0),h4:p(a,34,1.235,.25),h5:p(a,24,1.334,0),h6:p(c,20,1.6,.15),subtitle1:p(a,16,1.75,.15),subtitle2:p(c,14,1.57,.1),body1:p(a,16,1.5,.15),body2:p(a,14,1.43,.15),button:p(c,14,1.75,.4,$n),caption:p(a,12,1.66,.4),overline:p(a,12,2.66,1,$n),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Fe(z({htmlFontSize:l,pxToRem:_,fontFamily:n,fontSize:o,fontWeightLight:i,fontWeightRegular:a,fontWeightMedium:c,fontWeightBold:u},h),d,{clone:!1})}const vc=.2,yc=.14,gc=.12;function ne(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${vc})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${yc})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${gc})`].join(",")}const bc=["none",ne(0,2,1,-1,0,1,1,0,0,1,3,0),ne(0,3,1,-2,0,2,2,0,0,1,5,0),ne(0,3,3,-2,0,3,4,0,0,1,8,0),ne(0,2,4,-1,0,4,5,0,0,1,10,0),ne(0,3,5,-1,0,5,8,0,0,1,14,0),ne(0,3,5,-1,0,6,10,0,0,1,18,0),ne(0,4,5,-2,0,7,10,1,0,2,16,1),ne(0,5,5,-3,0,8,10,1,0,3,14,2),ne(0,5,6,-3,0,9,12,1,0,3,16,2),ne(0,6,6,-3,0,10,14,1,0,4,18,3),ne(0,6,7,-4,0,11,15,1,0,4,20,3),ne(0,7,8,-4,0,12,17,2,0,5,22,4),ne(0,7,8,-4,0,13,19,2,0,5,24,4),ne(0,7,9,-4,0,14,21,2,0,5,26,4),ne(0,8,9,-5,0,15,22,2,0,6,28,5),ne(0,8,10,-5,0,16,24,2,0,6,30,5),ne(0,8,11,-5,0,17,26,2,0,6,32,5),ne(0,9,11,-5,0,18,28,2,0,7,34,6),ne(0,9,12,-6,0,19,29,2,0,7,36,6),ne(0,10,13,-6,0,20,31,3,0,8,38,7),ne(0,10,13,-6,0,21,33,3,0,8,40,7),ne(0,10,14,-6,0,22,35,3,0,8,42,7),ne(0,11,14,-7,0,23,36,3,0,9,44,8),ne(0,11,15,-7,0,24,38,3,0,9,46,8)],_c=bc,Ec=["duration","easing","delay"],xc={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Sc={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Pn(e){return`${Math.round(e)}ms`}function wc(e){if(!e)return 0;const r=e/36;return Math.round((4+15*r**.25+r/5)*10)}function Tc(e){const r=z({},xc,e.easing),t=z({},Sc,e.duration);return z({getAutoHeightDuration:wc,create:(o=["all"],i={})=>{const{duration:a=t.standard,easing:c=r.easeInOut,delay:u=0}=i,l=Ve(i,Ec);if(process.env.NODE_ENV!=="production"){const f=d=>typeof d=="string",m=d=>!isNaN(parseFloat(d));!f(o)&&!Array.isArray(o)&&console.error('MUI: Argument "props" must be a string or Array.'),!m(a)&&!f(a)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${a}.`),f(c)||console.error('MUI: Argument "easing" must be a string.'),!m(u)&&!f(u)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof i!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
|
|
100
100
|
`)),Object.keys(l).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(l).join(",")}].`)}return(Array.isArray(o)?o:[o]).map(f=>`${f} ${typeof a=="string"?a:Pn(a)} ${c} ${typeof u=="string"?u:Pn(u)}`).join(",")}},e,{easing:r,duration:t})}const Oc={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},Rc=Oc,$c=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function Cc(e={},...r){const{mixins:t={},palette:n={},transitions:o={},typography:i={}}=e,a=Ve(e,$c);if(e.vars)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name.":tr(18));const c=dc(n),u=Tt(e);let l=Fe(u,{mixins:Hs(u.breakpoints,t),palette:c,shadows:_c.slice(),typography:hc(c,i),transitions:Tc(o),zIndex:z({},Rc)});if(l=Fe(l,a),l=r.reduce((f,m)=>Fe(f,m),l),process.env.NODE_ENV!=="production"){const f=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],m=(d,x)=>{let _;for(_ in d){const p=d[_];if(f.indexOf(_)!==-1&&Object.keys(p).length>0){if(process.env.NODE_ENV!=="production"){const h=pt("",_);console.error([`MUI: The \`${x}\` component increases the CSS specificity of the \`${_}\` internal state.`,"You can not override it like this: ",JSON.stringify(d,null,2),"",`Instead, you need to use the '&.${h}' syntax:`,JSON.stringify({root:{[`&.${h}`]:p}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
|
|
101
101
|
`))}d[_]={}}}};Object.keys(l.components).forEach(d=>{const x=l.components[d].styleOverrides;x&&d.indexOf("Mui")===0&&m(x,d)})}return l.unstable_sxConfig=z({},St,a==null?void 0:a.unstable_sxConfig),l.unstable_sx=function(m){return wt({sx:m,theme:this})},l}const Pc=Cc(),fo=Pc,lo="$$material";function jc({props:e,name:r}){return Ws({props:e,name:r,defaultTheme:fo,themeId:lo})}const Ac=e=>Or(e)&&e!=="classes",Nc=Us({themeId:lo,defaultTheme:fo,rootShouldForwardProp:Ac}),Ic=Nc;function Dc(e){return pt("MuiSvgIcon",e)}Ci("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const kc=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],Mc=e=>{const{color:r,fontSize:t,classes:n}=e,o={root:["root",r!=="inherit"&&`color${Ne(r)}`,`fontSize${Ne(t)}`]};return Ti(o,Dc,n)},Fc=Ic("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,t.color!=="inherit"&&r[`color${Ne(t.color)}`],r[`fontSize${Ne(t.fontSize)}`]]}})(({theme:e,ownerState:r})=>{var t,n,o,i,a,c,u,l,f,m,d,x,_;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:r.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(t=e.transitions)==null||(n=t.create)==null?void 0:n.call(t,"fill",{duration:(o=e.transitions)==null||(o=o.duration)==null?void 0:o.shorter}),fontSize:{inherit:"inherit",small:((i=e.typography)==null||(a=i.pxToRem)==null?void 0:a.call(i,20))||"1.25rem",medium:((c=e.typography)==null||(u=c.pxToRem)==null?void 0:u.call(c,24))||"1.5rem",large:((l=e.typography)==null||(f=l.pxToRem)==null?void 0:f.call(l,35))||"2.1875rem"}[r.fontSize],color:(m=(d=(e.vars||e).palette)==null||(d=d[r.color])==null?void 0:d.main)!=null?m:{action:(x=(e.vars||e).palette)==null||(x=x.action)==null?void 0:x.active,disabled:(_=(e.vars||e).palette)==null||(_=_.action)==null?void 0:_.disabled,inherit:void 0}[r.color]}}),Rt=G.forwardRef(function(r,t){const n=jc({props:r,name:"MuiSvgIcon"}),{children:o,className:i,color:a="inherit",component:c="svg",fontSize:u="medium",htmlColor:l,inheritViewBox:f=!1,titleAccess:m,viewBox:d="0 0 24 24"}=n,x=Ve(n,kc),_=G.isValidElement(o)&&o.type==="svg",p=z({},n,{color:a,component:c,fontSize:u,instanceFontSize:r.fontSize,inheritViewBox:f,viewBox:d,hasSvgAsChild:_}),h={};f||(h.viewBox=d);const O=Mc(p);return y.jsxs(Fc,z({as:c,className:Pi(O.root,i),focusable:"false",color:l,"aria-hidden":m?void 0:!0,role:m?"img":void 0,ref:t},h,x,_&&o.props,{ownerState:p,children:[_?o.props.children:o,m?y.jsx("title",{children:m}):null]}))});process.env.NODE_ENV!=="production"&&(Rt.propTypes={children:ee.node,classes:ee.object,className:ee.string,color:ee.oneOfType([ee.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),ee.string]),component:ee.elementType,fontSize:ee.oneOfType([ee.oneOf(["inherit","large","medium","small"]),ee.string]),htmlColor:ee.string,inheritViewBox:ee.bool,shapeRendering:ee.string,sx:ee.oneOfType([ee.arrayOf(ee.oneOfType([ee.func,ee.object,ee.bool])),ee.func,ee.object]),titleAccess:ee.string,viewBox:ee.string});Rt.muiName="SvgIcon";const jn=Rt;function Lc(e,r){function t(n,o){return y.jsx(jn,z({"data-testid":`${r}Icon`,ref:o},n,{children:e}))}return process.env.NODE_ENV!=="production"&&(t.displayName=`${r}Icon`),t.muiName=jn.muiName,G.memo(G.forwardRef(t))}const Vc={configure:e=>{process.env.NODE_ENV!=="production"&&console.warn(["MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.","","You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead","","The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401","","The updated documentation: https://mui.com/guides/classname-generator/"].join(`
|
|
102
|
-
`)),qn.configure(e)}},zc=Object.freeze(Object.defineProperty({__proto__:null,capitalize:Ne,createChainedFunction:ii,createSvgIcon:Lc,debounce:ai,deprecatedPropType:si,isMuiElement:ci,ownerDocument:Un,ownerWindow:ui,requirePropFactory:fi,setRef:Yn,unstable_ClassNameGenerator:Vc,unstable_useEnhancedEffect:Wn,unstable_useId:pi,unsupportedProp:mi,useControlled:hi,useEventCallback:vi,useForkRef:yi,useIsFocusVisible:wi},Symbol.toStringTag,{value:"Module"})),Uc=Yo(zc);var An;function Ye(){return An||(An=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=Uc}(Hr)),Hr}var Yc=ze;Object.defineProperty(lt,"__esModule",{value:!0});var po=lt.default=void 0,Wc=Yc(Ye()),Bc=y,qc=(0,Wc.default)((0,Bc.jsx)("path",{d:"M18 17H6v-2h12v2zm0-4H6v-2h12v2zm0-4H6V7h12v2zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2v20z"}),"Receipt");po=lt.default=qc;var $t={},Kc=ze;Object.defineProperty($t,"__esModule",{value:!0});var mo=$t.default=void 0,Gc=Kc(Ye()),Hc=y,Jc=(0,Gc.default)((0,Hc.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");mo=$t.default=Jc;var Ct={},Xc=ze;Object.defineProperty(Ct,"__esModule",{value:!0});var ho=Ct.default=void 0,Zc=Xc(Ye()),Qc=y,eu=(0,Zc.default)((0,Qc.jsx)("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}),"CreditCard");ho=Ct.default=eu;var Pt={},ru=ze;Object.defineProperty(Pt,"__esModule",{value:!0});var vo=Pt.default=void 0,tu=ru(Ye()),nu=y,ou=(0,tu.default)((0,nu.jsx)("path",{d:"M21 6h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1zm-4 6V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1z"}),"Forum");vo=Pt.default=ou;var jt={},iu=ze;Object.defineProperty(jt,"__esModule",{value:!0});var yo=jt.default=void 0,au=iu(Ye()),su=y,cu=(0,au.default)((0,su.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}),"Info");yo=jt.default=cu;var At={},uu=ze;Object.defineProperty(At,"__esModule",{value:!0});var go=At.default=void 0,fu=uu(Ye()),lu=y,du=(0,fu.default)((0,lu.jsx)("path",{d:"M10 4h4v4h-4zM4 16h4v4H4zm0-6h4v4H4zm0-6h4v4H4zm10 8.42V10h-4v4h2.42zm6.88-1.13-1.17-1.17c-.16-.16-.42-.16-.58 0l-.88.88L20 12.75l.88-.88c.16-.16.16-.42 0-.58zM11 18.25V20h1.75l6.67-6.67-1.75-1.75zM16 4h4v4h-4z"}),"AppRegistration");go=At.default=du;const pu={cabinetType:null,cabinetIsLoading:!0,apiAxios:()=>null,phoneNumber:null,setPhoneNumber:null,cabinetSettings:null,authToken:null,setAuthToken:null,createAxios:null},br=ue.createContext(pu),mu=({cabinetType:e})=>{const[r,t]=ue.useState(null),[n,o]=ue.useState(null),[i,a]=ue.useState(null),c=()=>Dn.create({baseURL:i??"",headers:{Authorization:`Bearer ${n}`}}),[u,l]=ue.useState(null);return ue.useEffect(()=>{(async()=>{if(!n||!r||e===null)return;const d=await c().post("/externalCustomerCabinet/cabinetInfo",{phoneNumber:r,cabinetType:e});l(d.data)})()},[r,n]),{cabinetType:e,apiAxios:c,cabinetIsLoading:!1,cabinetSettings:u,phoneNumber:r,setPhoneNumber:t,authToken:n,setAuthToken:o,createAxios:(m,d)=>{o(m),a(d)}}},hu=({children:e,cabinetType:r})=>{const t=mu({cabinetType:r});return y.jsx(br.Provider,{value:{...t,cabinetType:r},children:e})};Dn.create();function vu({url:e,method:r,data:t,setIsLoadingVal:n,excludedCodes:o,initLoading:i=!1,successMessage:a,onSuccessMessageConfirm:c}){const[u,l]=ue.useState(i),{apiAxios:f}=ue.useContext(br);return{isLoading:u,setIsLoading:l,Send:async(d,x)=>(l(!0),n==null||n(!0),f()(e,{method:r,data:{...t,...d}}).then(_=>(x==null||x(),_.data)).catch(_=>{throw o!=null&&o.includes(_.response.data.code),{code:_.response.data.code,msg:_.response.data.msg}}).finally(()=>{l(!1),n==null||n(!1)}))}}const bo=({children:e})=>y.jsx("div",{className:"cloud",children:y.jsx(je.Typography,{children:e})}),yu=()=>{const[e,r]=ue.useState(),{phoneNumber:t}=ue.useContext(br),{isLoading:
|
|
102
|
+
`)),qn.configure(e)}},zc=Object.freeze(Object.defineProperty({__proto__:null,capitalize:Ne,createChainedFunction:ii,createSvgIcon:Lc,debounce:ai,deprecatedPropType:si,isMuiElement:ci,ownerDocument:Un,ownerWindow:ui,requirePropFactory:fi,setRef:Yn,unstable_ClassNameGenerator:Vc,unstable_useEnhancedEffect:Wn,unstable_useId:pi,unsupportedProp:mi,useControlled:hi,useEventCallback:vi,useForkRef:yi,useIsFocusVisible:wi},Symbol.toStringTag,{value:"Module"})),Uc=Yo(zc);var An;function Ye(){return An||(An=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=Uc}(Hr)),Hr}var Yc=ze;Object.defineProperty(lt,"__esModule",{value:!0});var po=lt.default=void 0,Wc=Yc(Ye()),Bc=y,qc=(0,Wc.default)((0,Bc.jsx)("path",{d:"M18 17H6v-2h12v2zm0-4H6v-2h12v2zm0-4H6V7h12v2zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2v20z"}),"Receipt");po=lt.default=qc;var $t={},Kc=ze;Object.defineProperty($t,"__esModule",{value:!0});var mo=$t.default=void 0,Gc=Kc(Ye()),Hc=y,Jc=(0,Gc.default)((0,Hc.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");mo=$t.default=Jc;var Ct={},Xc=ze;Object.defineProperty(Ct,"__esModule",{value:!0});var ho=Ct.default=void 0,Zc=Xc(Ye()),Qc=y,eu=(0,Zc.default)((0,Qc.jsx)("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}),"CreditCard");ho=Ct.default=eu;var Pt={},ru=ze;Object.defineProperty(Pt,"__esModule",{value:!0});var vo=Pt.default=void 0,tu=ru(Ye()),nu=y,ou=(0,tu.default)((0,nu.jsx)("path",{d:"M21 6h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1zm-4 6V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1z"}),"Forum");vo=Pt.default=ou;var jt={},iu=ze;Object.defineProperty(jt,"__esModule",{value:!0});var yo=jt.default=void 0,au=iu(Ye()),su=y,cu=(0,au.default)((0,su.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}),"Info");yo=jt.default=cu;var At={},uu=ze;Object.defineProperty(At,"__esModule",{value:!0});var go=At.default=void 0,fu=uu(Ye()),lu=y,du=(0,fu.default)((0,lu.jsx)("path",{d:"M10 4h4v4h-4zM4 16h4v4H4zm0-6h4v4H4zm0-6h4v4H4zm10 8.42V10h-4v4h2.42zm6.88-1.13-1.17-1.17c-.16-.16-.42-.16-.58 0l-.88.88L20 12.75l.88-.88c.16-.16.16-.42 0-.58zM11 18.25V20h1.75l6.67-6.67-1.75-1.75zM16 4h4v4h-4z"}),"AppRegistration");go=At.default=du;const pu={cabinetType:null,cabinetIsLoading:!0,apiAxios:()=>null,phoneNumber:null,setPhoneNumber:null,cabinetSettings:null,authToken:null,setAuthToken:null,createAxios:null},br=ue.createContext(pu),mu=({cabinetType:e})=>{const[r,t]=ue.useState(null),[n,o]=ue.useState(null),[i,a]=ue.useState(null),c=()=>Dn.create({baseURL:i??"",headers:{Authorization:`Bearer ${n}`}}),[u,l]=ue.useState(null);return ue.useEffect(()=>{(async()=>{if(!n||!r||e===null)return;const d=await c().post("/externalCustomerCabinet/cabinetInfo",{phoneNumber:r,cabinetType:e});l(d.data)})()},[r,n]),{cabinetType:e,apiAxios:c,cabinetIsLoading:!1,cabinetSettings:u,phoneNumber:r,setPhoneNumber:t,authToken:n,setAuthToken:o,createAxios:(m,d)=>{o(m),a(d)}}},hu=({children:e,cabinetType:r})=>{const t=mu({cabinetType:r});return y.jsx(br.Provider,{value:{...t,cabinetType:r},children:e})};Dn.create();function vu({url:e,method:r,data:t,setIsLoadingVal:n,excludedCodes:o,initLoading:i=!1,successMessage:a,onSuccessMessageConfirm:c}){const[u,l]=ue.useState(i),{apiAxios:f}=ue.useContext(br);return{isLoading:u,setIsLoading:l,Send:async(d,x)=>(l(!0),n==null||n(!0),f()(e,{method:r,data:{...t,...d}}).then(_=>(x==null||x(),_.data)).catch(_=>{throw o!=null&&o.includes(_.response.data.code),{code:_.response.data.code,msg:_.response.data.msg}}).finally(()=>{l(!1),n==null||n(!1)}))}}const bo=({children:e})=>y.jsx("div",{className:"cloud",children:y.jsx(je.Typography,{children:e})}),yu=()=>{const[e,r]=ue.useState(),{phoneNumber:t,cabinetType:n}=ue.useContext(br),{isLoading:o,Send:i}=vu({url:"/externalCustomerCabinet/purchase/history",method:"post",initLoading:!0}),a=()=>{if(!t)throw ErrorEvent;i({phone:t,cabinetType:n}).then(u=>r(u.activities))};return ue.useEffect(()=>{a()},[t]),{purchaseNotFound:e&&(e==null?void 0:e.length)===0?y.jsx(bo,{children:y.jsx("div",{children:y.jsx("div",{children:"Покупок не было"})})}):null,purchaseHistory:e,isLoading:o}},gu=()=>y.jsx(je.Backdrop,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:!0,children:y.jsx(je.CircularProgress,{color:"inherit"})});var _o=(e=>(e[e.Bonuses=0]="Bonuses",e[e.Purchases=1]="Purchases",e))(_o||{});const bu=e=>{const r=[{id:1,name:"Понедельник"},{id:2,name:"Вторник"},{id:3,name:"Среда"},{id:4,name:"Четверг"},{id:5,name:"Пятница"},{id:6,name:"Суббота"},{id:0,name:"Воскресенье"}],t=[{time:2,name:"Московское время - 1ч"},{time:3,name:"Московское время"},{time:4,name:"Московское время + 1ч"},{time:5,name:"Московское время + 2ч"},{time:6,name:"Московское время + 3ч"},{time:7,name:"Московское время + 4ч"},{time:8,name:"Московское время + 5ч"},{time:9,name:"Московское время + 6ч"},{time:10,name:"Московское время + 7ч"},{time:11,name:"Московское время + 8ч"},{time:12,name:"Московское время + 9ч"}],n=g=>{var R;return(R=r.find(v=>v.id===g))==null?void 0:R.name},o=g=>Date.parse(g)?new Date(g).toLocaleString("en-US"):null,i=(g,R)=>g?new Date(g).toLocaleDateString("ru",R):null,a=g=>g?new Date(g).toLocaleString("ru"):null,c=g=>new Date(g).toLocaleTimeString("ru",{hour:"2-digit",minute:"2-digit"});Date.prototype.addHours=function(g){return this.setTime(this.getTime()+g*60*60*1e3),this};const u=g=>{const R=new RegExp("\\d{2}:\\d{2}:\\d{2}");return new Date(g).addHours(e??0).toISOString().match(R)[0]},l=g=>{if(!g)return null;const R=/^(\d{1,2}).(\d{1,2}).(\d{4})/;let v;try{v=g.match(R)}catch{return null}if(v==null||v.length<4)return null;const L=new Date;return L.setFullYear(Number(v[3]),Number(v[2])-1,Number(v[1])),console.log(L),L};function f(g){return new Date(g.getTime()-g.getTimezoneOffset()*60*1e3)}const m=(g,R=new Date)=>{const L=R.getTime()+g*864e5;return new Date(L)},d=(g,R=new Date)=>{const L=R.getTime()+g*864e5;return new Date(L).toISOString().split("T")[0]},x=()=>new Date().toISOString().split("T")[0],_=g=>{if(!g)return null;const R=/^(\d{4})-(\d{1,2})-(\d{1,2})/,v=g.match(R);return`${v[1]}-${v[2]}-${v[3]}`},p=g=>typeof g=="string"?g:new Date(g.getTime()-g.getTimezoneOffset()*6e4).toISOString(),h=()=>{const g=new Date;return g.getMonth()===0?new Date(g.getFullYear()-1,0,2,1).toISOString().split("T")[0]:new Date(g.getFullYear(),0,2,1).toISOString().split("T")[0]},O=[...Array(12).keys()];return{ConvertUTCDateToLocalDate:f,ParseStringToDate:l,ToIsoWithoutTimeZone:p,ConvertFromStringWithPoints:o,AddDaysToDateToStr:d,ParseDataTimeToRusLocale:a,ParseDataToRusLocale:i,AddDaysToDate:m,GetToday:x,ParseTimeSec:u,GetStartYear:h,DayOfWeeks:r,monthsNum:O,monthsStr:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],UtcOffsets:t,ParseTime:c,DateFromString:_,DayOfWeekById:n}};var Eo={exports:{}};/*!
|
|
103
103
|
Copyright (c) 2018 Jed Watson.
|
|
104
104
|
Licensed under the MIT License (MIT), see
|
|
105
105
|
http://jedwatson.github.io/classnames
|
|
@@ -4715,24 +4715,27 @@ function Ou({ url: e, method: r, data: t, setIsLoadingVal: n, excludedCodes: o,
|
|
|
4715
4715
|
};
|
|
4716
4716
|
}
|
|
4717
4717
|
const So = ({ children: e }) => /* @__PURE__ */ y.jsx("div", { className: "cloud", children: /* @__PURE__ */ y.jsx(Ko, { children: e }) }), Ru = () => {
|
|
4718
|
-
const [e, r] = Le(), { phoneNumber: t } = $r(zr), {
|
|
4719
|
-
isLoading:
|
|
4720
|
-
Send:
|
|
4718
|
+
const [e, r] = Le(), { phoneNumber: t, cabinetType: n } = $r(zr), {
|
|
4719
|
+
isLoading: o,
|
|
4720
|
+
Send: i
|
|
4721
4721
|
} = Ou({
|
|
4722
4722
|
url: "/externalCustomerCabinet/purchase/history",
|
|
4723
4723
|
method: "post",
|
|
4724
4724
|
initLoading: !0
|
|
4725
|
-
}),
|
|
4725
|
+
}), a = () => {
|
|
4726
4726
|
if (!t)
|
|
4727
4727
|
throw ErrorEvent;
|
|
4728
|
-
|
|
4728
|
+
i({
|
|
4729
|
+
phone: t,
|
|
4730
|
+
cabinetType: n
|
|
4731
|
+
}).then((u) => r(u.activities));
|
|
4729
4732
|
};
|
|
4730
4733
|
return Fn(() => {
|
|
4731
|
-
|
|
4734
|
+
a();
|
|
4732
4735
|
}, [t]), {
|
|
4733
4736
|
purchaseNotFound: e && (e == null ? void 0 : e.length) === 0 ? /* @__PURE__ */ y.jsx(So, { children: /* @__PURE__ */ y.jsx("div", { children: /* @__PURE__ */ y.jsx("div", { children: "Покупок не было" }) }) }) : null,
|
|
4734
4737
|
purchaseHistory: e,
|
|
4735
|
-
isLoading:
|
|
4738
|
+
isLoading: o
|
|
4736
4739
|
};
|
|
4737
4740
|
}, $u = () => /* @__PURE__ */ y.jsx(
|
|
4738
4741
|
Go,
|
|
@@ -99,7 +99,7 @@ const theme2 = createTheme({ palette: {
|
|
|
99
99
|
} });`:Ge(12,h?` (${h})`:"",JSON.stringify(p.main)));return Gn(p,"light",F,n),Gn(p,"dark",g,n),p.contrastText||(p.contrastText=m(p.main)),p},x={dark:xt,light:Kn};return process.env.NODE_ENV!=="production"&&(x[r]||console.error(`MUI: The palette mode \`${r}\` is not supported.`)),ke(L({common:L({},vr),mode:r,primary:d({color:i,name:"primary"}),secondary:d({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:d({color:c,name:"error"}),warning:d({color:f,name:"warning"}),info:d({color:u,name:"info"}),success:d({color:l,name:"success"}),grey:$a,contrastThreshold:t,getContrastText:m,augmentColor:d,tonalOffset:n},x[r]),o)}const Ma=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function Fa(e){return Math.round(e*1e5)/1e5}const Hn={textTransform:"uppercase"},Jn='"Roboto", "Helvetica", "Arial", sans-serif';function La(e,r){const t=typeof r=="function"?r(e):r,{fontFamily:n=Jn,fontSize:o=14,fontWeightLight:i=300,fontWeightRegular:s=400,fontWeightMedium:c=500,fontWeightBold:u=700,htmlFontSize:l=16,allVariants:f,pxToRem:m}=t,d=Me(t,Ma);process.env.NODE_ENV!=="production"&&(typeof o!="number"&&console.error("MUI: `fontSize` is required to be a number."),typeof l!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const x=o/14,_=m||(O=>`${O/l*x}rem`),p=(O,F,g,R,v)=>L({fontFamily:n,fontWeight:O,fontSize:_(F),lineHeight:g},n===Jn?{letterSpacing:`${Fa(R/F)}em`}:{},v,f),h={h1:p(i,96,1.167,-1.5),h2:p(i,60,1.2,-.5),h3:p(s,48,1.167,0),h4:p(s,34,1.235,.25),h5:p(s,24,1.334,0),h6:p(c,20,1.6,.15),subtitle1:p(s,16,1.75,.15),subtitle2:p(c,14,1.57,.1),body1:p(s,16,1.5,.15),body2:p(s,14,1.43,.15),button:p(c,14,1.75,.4,Hn),caption:p(s,12,1.66,.4),overline:p(s,12,2.66,1,Hn),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return ke(L({htmlFontSize:l,pxToRem:_,fontFamily:n,fontSize:o,fontWeightLight:i,fontWeightRegular:s,fontWeightMedium:c,fontWeightBold:u},h),d,{clone:!1})}const Va=.2,za=.14,Ua=.12;function oe(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Va})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${za})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Ua})`].join(",")}const Ya=["none",oe(0,2,1,-1,0,1,1,0,0,1,3,0),oe(0,3,1,-2,0,2,2,0,0,1,5,0),oe(0,3,3,-2,0,3,4,0,0,1,8,0),oe(0,2,4,-1,0,4,5,0,0,1,10,0),oe(0,3,5,-1,0,5,8,0,0,1,14,0),oe(0,3,5,-1,0,6,10,0,0,1,18,0),oe(0,4,5,-2,0,7,10,1,0,2,16,1),oe(0,5,5,-3,0,8,10,1,0,3,14,2),oe(0,5,6,-3,0,9,12,1,0,3,16,2),oe(0,6,6,-3,0,10,14,1,0,4,18,3),oe(0,6,7,-4,0,11,15,1,0,4,20,3),oe(0,7,8,-4,0,12,17,2,0,5,22,4),oe(0,7,8,-4,0,13,19,2,0,5,24,4),oe(0,7,9,-4,0,14,21,2,0,5,26,4),oe(0,8,9,-5,0,15,22,2,0,6,28,5),oe(0,8,10,-5,0,16,24,2,0,6,30,5),oe(0,8,11,-5,0,17,26,2,0,6,32,5),oe(0,9,11,-5,0,18,28,2,0,7,34,6),oe(0,9,12,-6,0,19,29,2,0,7,36,6),oe(0,10,13,-6,0,20,31,3,0,8,38,7),oe(0,10,13,-6,0,21,33,3,0,8,40,7),oe(0,10,14,-6,0,22,35,3,0,8,42,7),oe(0,11,14,-7,0,23,36,3,0,9,44,8),oe(0,11,15,-7,0,24,38,3,0,9,46,8)],Wa=["duration","easing","delay"],Ba={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},qa={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Xn(e){return`${Math.round(e)}ms`}function Ka(e){if(!e)return 0;const r=e/36;return Math.round((4+15*r**.25+r/5)*10)}function Ga(e){const r=L({},Ba,e.easing),t=L({},qa,e.duration);return L({getAutoHeightDuration:Ka,create:(o=["all"],i={})=>{const{duration:s=t.standard,easing:c=r.easeInOut,delay:u=0}=i,l=Me(i,Wa);if(process.env.NODE_ENV!=="production"){const f=d=>typeof d=="string",m=d=>!isNaN(parseFloat(d));!f(o)&&!Array.isArray(o)&&console.error('MUI: Argument "props" must be a string or Array.'),!m(s)&&!f(s)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${s}.`),f(c)||console.error('MUI: Argument "easing" must be a string.'),!m(u)&&!f(u)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof i!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
|
|
100
100
|
`)),Object.keys(l).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(l).join(",")}].`)}return(Array.isArray(o)?o:[o]).map(f=>`${f} ${typeof s=="string"?s:Xn(s)} ${c} ${typeof u=="string"?u:Xn(u)}`).join(",")}},e,{easing:r,duration:t})}const Ha={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},Ja=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function Xa(e={},...r){const{mixins:t={},palette:n={},transitions:o={},typography:i={}}=e,s=Me(e,Ja);if(e.vars)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name.":Ge(18));const c=ka(n),u=_t(e);let l=ke(u,{mixins:Ra(u.breakpoints,t),palette:c,shadows:Ya.slice(),typography:La(c,i),transitions:Ga(o),zIndex:L({},Ha)});if(l=ke(l,s),l=r.reduce((f,m)=>ke(f,m),l),process.env.NODE_ENV!=="production"){const f=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],m=(d,x)=>{let _;for(_ in d){const p=d[_];if(f.indexOf(_)!==-1&&Object.keys(p).length>0){if(process.env.NODE_ENV!=="production"){const h=it("",_);console.error([`MUI: The \`${x}\` component increases the CSS specificity of the \`${_}\` internal state.`,"You can not override it like this: ",JSON.stringify(d,null,2),"",`Instead, you need to use the '&.${h}' syntax:`,JSON.stringify({root:{[`&.${h}`]:p}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
|
|
101
101
|
`))}d[_]={}}}};Object.keys(l.components).forEach(d=>{const x=l.components[d].styleOverrides;x&&d.indexOf("Mui")===0&&m(x,d)})}return l.unstable_sxConfig=L({},gt,s==null?void 0:s.unstable_sxConfig),l.unstable_sx=function(m){return bt({sx:m,theme:this})},l}const Zn=Xa(),Qn="$$material";function Za({props:e,name:r}){return xa({props:e,name:r,defaultTheme:Zn,themeId:Qn})}const Qa=_a({themeId:Qn,defaultTheme:Zn,rootShouldForwardProp:e=>zr(e)&&e!=="classes"});function ec(e){return it("MuiSvgIcon",e)}fi("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const rc=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],tc=e=>{const{color:r,fontSize:t,classes:n}=e,o={root:["root",r!=="inherit"&&`color${Pe(r)}`,`fontSize${Pe(t)}`]};return ci(o,ec,n)},nc=Qa("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,t.color!=="inherit"&&r[`color${Pe(t.color)}`],r[`fontSize${Pe(t.fontSize)}`]]}})(({theme:e,ownerState:r})=>{var t,n,o,i,s,c,u,l,f,m,d,x,_;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:r.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(t=e.transitions)==null||(n=t.create)==null?void 0:n.call(t,"fill",{duration:(o=e.transitions)==null||(o=o.duration)==null?void 0:o.shorter}),fontSize:{inherit:"inherit",small:((i=e.typography)==null||(s=i.pxToRem)==null?void 0:s.call(i,20))||"1.25rem",medium:((c=e.typography)==null||(u=c.pxToRem)==null?void 0:u.call(c,24))||"1.5rem",large:((l=e.typography)==null||(f=l.pxToRem)==null?void 0:f.call(l,35))||"2.1875rem"}[r.fontSize],color:(m=(d=(e.vars||e).palette)==null||(d=d[r.color])==null?void 0:d.main)!=null?m:{action:(x=(e.vars||e).palette)==null||(x=x.action)==null?void 0:x.active,disabled:(_=(e.vars||e).palette)==null||(_=_.action)==null?void 0:_.disabled,inherit:void 0}[r.color]}}),St=B.forwardRef(function(r,t){const n=Za({props:r,name:"MuiSvgIcon"}),{children:o,className:i,color:s="inherit",component:c="svg",fontSize:u="medium",htmlColor:l,inheritViewBox:f=!1,titleAccess:m,viewBox:d="0 0 24 24"}=n,x=Me(n,rc),_=B.isValidElement(o)&&o.type==="svg",p=L({},n,{color:s,component:c,fontSize:u,instanceFontSize:r.fontSize,inheritViewBox:f,viewBox:d,hasSvgAsChild:_}),h={};f||(h.viewBox=d);const O=tc(p);return y.jsxs(nc,L({as:c,className:li(O.root,i),focusable:"false",color:l,"aria-hidden":m?void 0:!0,role:m?"img":void 0,ref:t},h,x,_&&o.props,{ownerState:p,children:[_?o.props.children:o,m?y.jsx("title",{children:m}):null]}))});process.env.NODE_ENV!=="production"&&(St.propTypes={children:ee.node,classes:ee.object,className:ee.string,color:ee.oneOfType([ee.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),ee.string]),component:ee.elementType,fontSize:ee.oneOfType([ee.oneOf(["inherit","large","medium","small"]),ee.string]),htmlColor:ee.string,inheritViewBox:ee.bool,shapeRendering:ee.string,sx:ee.oneOfType([ee.arrayOf(ee.oneOfType([ee.func,ee.object,ee.bool])),ee.func,ee.object]),titleAccess:ee.string,viewBox:ee.string}),St.muiName="SvgIcon";const eo=St;function oc(e,r){function t(n,o){return y.jsx(eo,L({"data-testid":`${r}Icon`,ref:o},n,{children:e}))}return process.env.NODE_ENV!=="production"&&(t.displayName=`${r}Icon`),t.muiName=eo.muiName,B.memo(B.forwardRef(t))}const ic=Ro(Object.freeze(Object.defineProperty({__proto__:null,capitalize:Pe,createChainedFunction:Yo,createSvgIcon:oc,debounce:Wo,deprecatedPropType:Bo,isMuiElement:qo,ownerDocument:on,ownerWindow:Ko,requirePropFactory:Go,setRef:sn,unstable_ClassNameGenerator:{configure:e=>{process.env.NODE_ENV!=="production"&&console.warn(["MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.","","You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead","","The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401","","The updated documentation: https://mui.com/guides/classname-generator/"].join(`
|
|
102
|
-
`)),pn.configure(e)}},unstable_useEnhancedEffect:an,unstable_useId:Jo,unsupportedProp:Xo,useControlled:Zo,useEventCallback:Qo,useForkRef:ei,useIsFocusVisible:ai},Symbol.toStringTag,{value:"Module"})));var ro;function We(){return ro||(ro=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=ic}(Gr)),Gr}var sc=Ue;Object.defineProperty(Kr,"__esModule",{value:!0});var to=Kr.default=void 0,ac=sc(We()),cc=y,uc=(0,ac.default)((0,cc.jsx)("path",{d:"M18 17H6v-2h12v2zm0-4H6v-2h12v2zm0-4H6V7h12v2zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2v20z"}),"Receipt");to=Kr.default=uc;var wt={},fc=Ue;Object.defineProperty(wt,"__esModule",{value:!0});var no=wt.default=void 0,lc=fc(We()),dc=y,pc=(0,lc.default)((0,dc.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");no=wt.default=pc;var Tt={},mc=Ue;Object.defineProperty(Tt,"__esModule",{value:!0});var oo=Tt.default=void 0,hc=mc(We()),vc=y,yc=(0,hc.default)((0,vc.jsx)("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}),"CreditCard");oo=Tt.default=yc;var Ot={},gc=Ue;Object.defineProperty(Ot,"__esModule",{value:!0});var io=Ot.default=void 0,bc=gc(We()),_c=y,Ec=(0,bc.default)((0,_c.jsx)("path",{d:"M21 6h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1zm-4 6V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1z"}),"Forum");io=Ot.default=Ec;var Rt={},xc=Ue;Object.defineProperty(Rt,"__esModule",{value:!0});var so=Rt.default=void 0,Sc=xc(We()),wc=y,Tc=(0,Sc.default)((0,wc.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}),"Info");so=Rt.default=Tc;var $t={},Oc=Ue;Object.defineProperty($t,"__esModule",{value:!0});var ao=$t.default=void 0,Rc=Oc(We()),$c=y,Cc=(0,Rc.default)((0,$c.jsx)("path",{d:"M10 4h4v4h-4zM4 16h4v4H4zm0-6h4v4H4zm0-6h4v4H4zm10 8.42V10h-4v4h2.42zm6.88-1.13-1.17-1.17c-.16-.16-.42-.16-.58 0l-.88.88L20 12.75l.88-.88c.16-.16.16-.42 0-.58zM11 18.25V20h1.75l6.67-6.67-1.75-1.75zM16 4h4v4h-4z"}),"AppRegistration");ao=$t.default=Cc;const Pc={cabinetType:null,cabinetIsLoading:!0,apiAxios:()=>null,phoneNumber:null,setPhoneNumber:null,cabinetSettings:null,authToken:null,setAuthToken:null,createAxios:null},gr=ne.createContext(Pc),jc=({cabinetType:e})=>{const[r,t]=ne.useState(null),[n,o]=ne.useState(null),[i,s]=ne.useState(null),c=()=>kt.create({baseURL:i??"",headers:{Authorization:`Bearer ${n}`}}),[u,l]=ne.useState(null);return ne.useEffect(()=>{(async()=>{if(!n||!r||e===null)return;const d=await c().post("/externalCustomerCabinet/cabinetInfo",{phoneNumber:r,cabinetType:e});l(d.data)})()},[r,n]),{cabinetType:e,apiAxios:c,cabinetIsLoading:!1,cabinetSettings:u,phoneNumber:r,setPhoneNumber:t,authToken:n,setAuthToken:o,createAxios:(m,d)=>{o(m),s(d)}}},Ac=({children:e,cabinetType:r})=>{const t=jc({cabinetType:r});return y.jsx(gr.Provider,{value:{...t,cabinetType:r},children:e})},Mu="";kt.create();function Nc({url:e,method:r,data:t,setIsLoadingVal:n,excludedCodes:o,initLoading:i=!1,successMessage:s,onSuccessMessageConfirm:c}){const[u,l]=ne.useState(i),{apiAxios:f}=ne.useContext(gr);return{isLoading:u,setIsLoading:l,Send:async(d,x)=>(l(!0),n==null||n(!0),f()(e,{method:r,data:{...t,...d}}).then(_=>(x==null||x(),_.data)).catch(_=>{throw o!=null&&o.includes(_.response.data.code),{code:_.response.data.code,msg:_.response.data.msg}}).finally(()=>{l(!1),n==null||n(!1)}))}}const Fu="",co=({children:e})=>y.jsx("div",{className:"cloud",children:y.jsx(Ce.Typography,{children:e})}),Ic=()=>{const[e,r]=ne.useState(),{phoneNumber:t}=ne.useContext(gr),{isLoading:
|
|
102
|
+
`)),pn.configure(e)}},unstable_useEnhancedEffect:an,unstable_useId:Jo,unsupportedProp:Xo,useControlled:Zo,useEventCallback:Qo,useForkRef:ei,useIsFocusVisible:ai},Symbol.toStringTag,{value:"Module"})));var ro;function We(){return ro||(ro=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=ic}(Gr)),Gr}var sc=Ue;Object.defineProperty(Kr,"__esModule",{value:!0});var to=Kr.default=void 0,ac=sc(We()),cc=y,uc=(0,ac.default)((0,cc.jsx)("path",{d:"M18 17H6v-2h12v2zm0-4H6v-2h12v2zm0-4H6V7h12v2zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2v20z"}),"Receipt");to=Kr.default=uc;var wt={},fc=Ue;Object.defineProperty(wt,"__esModule",{value:!0});var no=wt.default=void 0,lc=fc(We()),dc=y,pc=(0,lc.default)((0,dc.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");no=wt.default=pc;var Tt={},mc=Ue;Object.defineProperty(Tt,"__esModule",{value:!0});var oo=Tt.default=void 0,hc=mc(We()),vc=y,yc=(0,hc.default)((0,vc.jsx)("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}),"CreditCard");oo=Tt.default=yc;var Ot={},gc=Ue;Object.defineProperty(Ot,"__esModule",{value:!0});var io=Ot.default=void 0,bc=gc(We()),_c=y,Ec=(0,bc.default)((0,_c.jsx)("path",{d:"M21 6h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1zm-4 6V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1z"}),"Forum");io=Ot.default=Ec;var Rt={},xc=Ue;Object.defineProperty(Rt,"__esModule",{value:!0});var so=Rt.default=void 0,Sc=xc(We()),wc=y,Tc=(0,Sc.default)((0,wc.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}),"Info");so=Rt.default=Tc;var $t={},Oc=Ue;Object.defineProperty($t,"__esModule",{value:!0});var ao=$t.default=void 0,Rc=Oc(We()),$c=y,Cc=(0,Rc.default)((0,$c.jsx)("path",{d:"M10 4h4v4h-4zM4 16h4v4H4zm0-6h4v4H4zm0-6h4v4H4zm10 8.42V10h-4v4h2.42zm6.88-1.13-1.17-1.17c-.16-.16-.42-.16-.58 0l-.88.88L20 12.75l.88-.88c.16-.16.16-.42 0-.58zM11 18.25V20h1.75l6.67-6.67-1.75-1.75zM16 4h4v4h-4z"}),"AppRegistration");ao=$t.default=Cc;const Pc={cabinetType:null,cabinetIsLoading:!0,apiAxios:()=>null,phoneNumber:null,setPhoneNumber:null,cabinetSettings:null,authToken:null,setAuthToken:null,createAxios:null},gr=ne.createContext(Pc),jc=({cabinetType:e})=>{const[r,t]=ne.useState(null),[n,o]=ne.useState(null),[i,s]=ne.useState(null),c=()=>kt.create({baseURL:i??"",headers:{Authorization:`Bearer ${n}`}}),[u,l]=ne.useState(null);return ne.useEffect(()=>{(async()=>{if(!n||!r||e===null)return;const d=await c().post("/externalCustomerCabinet/cabinetInfo",{phoneNumber:r,cabinetType:e});l(d.data)})()},[r,n]),{cabinetType:e,apiAxios:c,cabinetIsLoading:!1,cabinetSettings:u,phoneNumber:r,setPhoneNumber:t,authToken:n,setAuthToken:o,createAxios:(m,d)=>{o(m),s(d)}}},Ac=({children:e,cabinetType:r})=>{const t=jc({cabinetType:r});return y.jsx(gr.Provider,{value:{...t,cabinetType:r},children:e})},Mu="";kt.create();function Nc({url:e,method:r,data:t,setIsLoadingVal:n,excludedCodes:o,initLoading:i=!1,successMessage:s,onSuccessMessageConfirm:c}){const[u,l]=ne.useState(i),{apiAxios:f}=ne.useContext(gr);return{isLoading:u,setIsLoading:l,Send:async(d,x)=>(l(!0),n==null||n(!0),f()(e,{method:r,data:{...t,...d}}).then(_=>(x==null||x(),_.data)).catch(_=>{throw o!=null&&o.includes(_.response.data.code),{code:_.response.data.code,msg:_.response.data.msg}}).finally(()=>{l(!1),n==null||n(!1)}))}}const Fu="",co=({children:e})=>y.jsx("div",{className:"cloud",children:y.jsx(Ce.Typography,{children:e})}),Ic=()=>{const[e,r]=ne.useState(),{phoneNumber:t,cabinetType:n}=ne.useContext(gr),{isLoading:o,Send:i}=Nc({url:"/externalCustomerCabinet/purchase/history",method:"post",initLoading:!0}),s=()=>{if(!t)throw ErrorEvent;i({phone:t,cabinetType:n}).then(u=>r(u.activities))};return ne.useEffect(()=>{s()},[t]),{purchaseNotFound:e&&(e==null?void 0:e.length)===0?y.jsx(co,{children:y.jsx("div",{children:y.jsx("div",{children:"Покупок не было"})})}):null,purchaseHistory:e,isLoading:o}},Dc=()=>y.jsx(Ce.Backdrop,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:!0,children:y.jsx(Ce.CircularProgress,{color:"inherit"})});var uo=(e=>(e[e.Bonuses=0]="Bonuses",e[e.Purchases=1]="Purchases",e))(uo||{});const kc=e=>{const r=[{id:1,name:"Понедельник"},{id:2,name:"Вторник"},{id:3,name:"Среда"},{id:4,name:"Четверг"},{id:5,name:"Пятница"},{id:6,name:"Суббота"},{id:0,name:"Воскресенье"}],t=[{time:2,name:"Московское время - 1ч"},{time:3,name:"Московское время"},{time:4,name:"Московское время + 1ч"},{time:5,name:"Московское время + 2ч"},{time:6,name:"Московское время + 3ч"},{time:7,name:"Московское время + 4ч"},{time:8,name:"Московское время + 5ч"},{time:9,name:"Московское время + 6ч"},{time:10,name:"Московское время + 7ч"},{time:11,name:"Московское время + 8ч"},{time:12,name:"Московское время + 9ч"}],n=g=>{var R;return(R=r.find(v=>v.id===g))==null?void 0:R.name},o=g=>Date.parse(g)?new Date(g).toLocaleString("en-US"):null,i=(g,R)=>g?new Date(g).toLocaleDateString("ru",R):null,s=g=>g?new Date(g).toLocaleString("ru"):null,c=g=>new Date(g).toLocaleTimeString("ru",{hour:"2-digit",minute:"2-digit"});Date.prototype.addHours=function(g){return this.setTime(this.getTime()+g*60*60*1e3),this};const u=g=>{const R=new RegExp("\\d{2}:\\d{2}:\\d{2}");return new Date(g).addHours(e??0).toISOString().match(R)[0]},l=g=>{if(!g)return null;const R=/^(\d{1,2}).(\d{1,2}).(\d{4})/;let v;try{v=g.match(R)}catch{return null}if(v==null||v.length<4)return null;const V=new Date;return V.setFullYear(Number(v[3]),Number(v[2])-1,Number(v[1])),console.log(V),V};function f(g){return new Date(g.getTime()-g.getTimezoneOffset()*60*1e3)}const m=(g,R=new Date)=>{const V=R.getTime()+g*864e5;return new Date(V)},d=(g,R=new Date)=>{const V=R.getTime()+g*864e5;return new Date(V).toISOString().split("T")[0]},x=()=>new Date().toISOString().split("T")[0],_=g=>{if(!g)return null;const R=/^(\d{4})-(\d{1,2})-(\d{1,2})/,v=g.match(R);return`${v[1]}-${v[2]}-${v[3]}`},p=g=>typeof g=="string"?g:new Date(g.getTime()-g.getTimezoneOffset()*6e4).toISOString(),h=()=>{const g=new Date;return g.getMonth()===0?new Date(g.getFullYear()-1,0,2,1).toISOString().split("T")[0]:new Date(g.getFullYear(),0,2,1).toISOString().split("T")[0]},O=[...Array(12).keys()];return{ConvertUTCDateToLocalDate:f,ParseStringToDate:l,ToIsoWithoutTimeZone:p,ConvertFromStringWithPoints:o,AddDaysToDateToStr:d,ParseDataTimeToRusLocale:s,ParseDataToRusLocale:i,AddDaysToDate:m,GetToday:x,ParseTimeSec:u,GetStartYear:h,DayOfWeeks:r,monthsNum:O,monthsStr:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],UtcOffsets:t,ParseTime:c,DateFromString:_,DayOfWeekById:n}};var fo={exports:{}};/*!
|
|
103
103
|
Copyright (c) 2018 Jed Watson.
|
|
104
104
|
Licensed under the MIT License (MIT), see
|
|
105
105
|
http://jedwatson.github.io/classnames
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UsePurchaseHistory.d.ts","sourceRoot":"","sources":["../../../../src/components/PurchaseHistory/usePurchaseHistory/UsePurchaseHistory.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAC;AAMnC,QAAA,MAAM,kBAAkB;;;;
|
|
1
|
+
{"version":3,"file":"UsePurchaseHistory.d.ts","sourceRoot":"","sources":["../../../../src/components/PurchaseHistory/usePurchaseHistory/UsePurchaseHistory.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAC;AAMnC,QAAA,MAAM,kBAAkB;;;;CA4CvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|