@ukpc-lib/react 0.11.6 → 0.12.1-dev.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/GlobalMenu/components/MenuItem.d.ts +2 -1
- package/dist/components/GlobalMenu/data.json.d.ts +1979 -1143
- package/dist/components/index.cjs +2 -2
- package/dist/components/index.js +5 -3
- package/dist/index.esm2017-5e128de3.cjs +1101 -0
- package/dist/index.esm2017-e23bb13e.js +41224 -0
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +1 -1
- package/package.json +2 -2
- package/web-components-bundle/access-denied/index.js +1 -1
- package/web-components-bundle/favorite-menu/index.js +2 -2
- package/web-components-bundle/global-menu/index.js +2 -2
- package/web-components-bundle/global-topbar/index.js +2 -2
- package/web-components-bundle/has-permission/index.js +2 -2
- package/web-components-bundle/{index-106dff30.js → index-4908ae68.js} +19380 -18789
- package/web-components-bundle/{index-c91ec106.js → index-a07af468.js} +29 -29
- package/dist/index.esm2017-3eee8145.js +0 -40631
- package/dist/index.esm2017-f3d75692.cjs +0 -1101
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),T=require("react"),m=require("../index.esm2017-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),T=require("react"),m=require("../index.esm2017-5e128de3.cjs"),X=require("moment"),$=require("@mui/material");require("axios");require("@r2wc/react-to-web-component");const gr=require("react-router-dom");require("react-query");require("react-dom");function bo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const W=bo(T),vo=e=>{var r,o;const{tabs:t}=e,n=s=>{e.setCurrentTab(s.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),c.jsxs(c.Fragment,{children:[c.jsx("style",{children:`
|
|
2
2
|
.tab-title {
|
|
3
3
|
min-width: 90px;
|
|
4
4
|
padding: 5px 16px;
|
|
@@ -94,5 +94,5 @@ const theme1 = createTheme({ palette: {
|
|
|
94
94
|
const theme2 = createTheme({ palette: {
|
|
95
95
|
primary: { main: green[500] },
|
|
96
96
|
} });`:Je(12,x?` (${x})`:"",JSON.stringify(a.main)));return or(a,"light",E,r),or(a,"dark",_,r),a.contrastText||(a.contrastText=h(a.main)),a},b={dark:Ht,light:rr};return process.env.NODE_ENV!=="production"&&(b[t]||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),pe(m._extends({common:m._extends({},nt),mode:t,primary:p({color:s,name:"primary"}),secondary:p({color:i,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:p({color:l,name:"error"}),warning:p({color:f,name:"warning"}),info:p({color:u,name:"info"}),success:p({color:d,name:"success"}),grey:lc,contrastThreshold:n,getContrastText:h,augmentColor:p,tonalOffset:r},b[t]),o)}const _c=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function Ec(e){return Math.round(e*1e5)/1e5}const sr={textTransform:"uppercase"},ir='"Roboto", "Helvetica", "Arial", sans-serif';function Cc(e,t){const n=typeof t=="function"?t(e):t,{fontFamily:r=ir,fontSize:o=14,fontWeightLight:s=300,fontWeightRegular:i=400,fontWeightMedium:l=500,fontWeightBold:u=700,htmlFontSize:d=16,allVariants:f,pxToRem:h}=n,p=m._objectWithoutPropertiesLoose(n,_c);process.env.NODE_ENV!=="production"&&(typeof o!="number"&&console.error("MUI: `fontSize` is required to be a number."),typeof d!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const b=o/14,g=h||(S=>`${S/d*b}rem`),a=(S,E,_,C,v)=>m._extends({fontFamily:r,fontWeight:S,fontSize:g(E),lineHeight:_},r===ir?{letterSpacing:`${Ec(C/E)}em`}:{},v,f),x={h1:a(s,96,1.167,-1.5),h2:a(s,60,1.2,-.5),h3:a(i,48,1.167,0),h4:a(i,34,1.235,.25),h5:a(i,24,1.334,0),h6:a(l,20,1.6,.15),subtitle1:a(i,16,1.75,.15),subtitle2:a(l,14,1.57,.1),body1:a(i,16,1.5,.15),body2:a(i,14,1.43,.15),button:a(l,14,1.75,.4,sr),caption:a(i,12,1.66,.4),overline:a(i,12,2.66,1,sr),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return pe(m._extends({htmlFontSize:d,pxToRem:g,fontFamily:r,fontSize:o,fontWeightLight:s,fontWeightRegular:i,fontWeightMedium:l,fontWeightBold:u},x),p,{clone:!1})}const Tc=.2,Ic=.14,Mc=.12;function U(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Tc})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Ic})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Mc})`].join(",")}const kc=["none",U(0,2,1,-1,0,1,1,0,0,1,3,0),U(0,3,1,-2,0,2,2,0,0,1,5,0),U(0,3,3,-2,0,3,4,0,0,1,8,0),U(0,2,4,-1,0,4,5,0,0,1,10,0),U(0,3,5,-1,0,5,8,0,0,1,14,0),U(0,3,5,-1,0,6,10,0,0,1,18,0),U(0,4,5,-2,0,7,10,1,0,2,16,1),U(0,5,5,-3,0,8,10,1,0,3,14,2),U(0,5,6,-3,0,9,12,1,0,3,16,2),U(0,6,6,-3,0,10,14,1,0,4,18,3),U(0,6,7,-4,0,11,15,1,0,4,20,3),U(0,7,8,-4,0,12,17,2,0,5,22,4),U(0,7,8,-4,0,13,19,2,0,5,24,4),U(0,7,9,-4,0,14,21,2,0,5,26,4),U(0,8,9,-5,0,15,22,2,0,6,28,5),U(0,8,10,-5,0,16,24,2,0,6,30,5),U(0,8,11,-5,0,17,26,2,0,6,32,5),U(0,9,11,-5,0,18,28,2,0,7,34,6),U(0,9,12,-6,0,19,29,2,0,7,36,6),U(0,10,13,-6,0,20,31,3,0,8,38,7),U(0,10,13,-6,0,21,33,3,0,8,40,7),U(0,10,14,-6,0,22,35,3,0,8,42,7),U(0,11,14,-7,0,23,36,3,0,9,44,8),U(0,11,15,-7,0,24,38,3,0,9,46,8)],Ac=kc,jc=["duration","easing","delay"],Oc={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)"},Pc={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function ar(e){return`${Math.round(e)}ms`}function $c(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function Nc(e){const t=m._extends({},Oc,e.easing),n=m._extends({},Pc,e.duration),r=(o=["all"],s={})=>{const{duration:i=n.standard,easing:l=t.easeInOut,delay:u=0}=s,d=m._objectWithoutPropertiesLoose(s,jc);if(process.env.NODE_ENV!=="production"){const f=p=>typeof p=="string",h=p=>!isNaN(parseFloat(p));!f(o)&&!Array.isArray(o)&&console.error('MUI: Argument "props" must be a string or Array.'),!h(i)&&!f(i)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${i}.`),f(l)||console.error('MUI: Argument "easing" must be a string.'),!h(u)&&!f(u)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof s!="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(`
|
|
97
|
-
`)),Object.keys(d).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(d).join(",")}].`)}return(Array.isArray(o)?o:[o]).map(f=>`${f} ${typeof i=="string"?i:ar(i)} ${l} ${typeof u=="string"?u:ar(u)}`).join(",")};return m._extends({getAutoHeightDuration:$c,create:r},e,{easing:t,duration:n})}const Rc={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},zc=Rc,Dc=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function Lc(e={},...t){const{mixins:n={},palette:r={},transitions:o={},typography:s={}}=e,i=m._objectWithoutPropertiesLoose(e,Dc);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.":Je(18));const l=wc(r),u=io(e);let d=pe(u,{mixins:Ul(u.breakpoints,n),palette:l,shadows:Ac.slice(),typography:Cc(l,s),transitions:Nc(o),zIndex:m._extends({},zc)});if(d=pe(d,i),d=t.reduce((f,h)=>pe(f,h),d),process.env.NODE_ENV!=="production"){const f=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],h=(p,b)=>{let g;for(g in p){const a=p[g];if(f.indexOf(g)!==-1&&Object.keys(a).length>0){if(process.env.NODE_ENV!=="production"){const x=dn("",g);console.error([`MUI: The \`${b}\` component increases the CSS specificity of the \`${g}\` internal state.`,"You can not override it like this: ",JSON.stringify(p,null,2),"",`Instead, you need to use the '&.${x}' syntax:`,JSON.stringify({root:{[`&.${x}`]:a}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
|
|
97
|
+
`)),Object.keys(d).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(d).join(",")}].`)}return(Array.isArray(o)?o:[o]).map(f=>`${f} ${typeof i=="string"?i:ar(i)} ${l} ${typeof u=="string"?u:ar(u)}`).join(",")};return m._extends({getAutoHeightDuration:$c,create:r},e,{easing:t,duration:n})}const Rc={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},zc=Rc,Dc=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function Lc(e={},...t){const{mixins:n={},palette:r={},transitions:o={},typography:s={}}=e,i=m._objectWithoutPropertiesLoose(e,Dc);if(e.vars&&e.generateCssVars===void 0)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name.":Je(18));const l=wc(r),u=io(e);let d=pe(u,{mixins:Ul(u.breakpoints,n),palette:l,shadows:Ac.slice(),typography:Cc(l,s),transitions:Nc(o),zIndex:m._extends({},zc)});if(d=pe(d,i),d=t.reduce((f,h)=>pe(f,h),d),process.env.NODE_ENV!=="production"){const f=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],h=(p,b)=>{let g;for(g in p){const a=p[g];if(f.indexOf(g)!==-1&&Object.keys(a).length>0){if(process.env.NODE_ENV!=="production"){const x=dn("",g);console.error([`MUI: The \`${b}\` component increases the CSS specificity of the \`${g}\` internal state.`,"You can not override it like this: ",JSON.stringify(p,null,2),"",`Instead, you need to use the '&.${x}' syntax:`,JSON.stringify({root:{[`&.${x}`]:a}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
|
|
98
98
|
`))}p[g]={}}}};Object.keys(d.components).forEach(p=>{const b=d.components[p].styleOverrides;b&&p.indexOf("Mui")===0&&h(b,p)})}return d.unstable_sxConfig=m._extends({},at,i==null?void 0:i.unstable_sxConfig),d.unstable_sx=function(h){return Sn({sx:h,theme:this})},d}const Fc=Lc(),Bc=Fc,Hc="$$material";function Wc(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Vc=e=>Wc(e)&&e!=="classes",Uc=Vc,Yc=Al({themeId:Hc,defaultTheme:Bc,rootShouldForwardProp:Uc}),Kc=Yc;function Gc(e){return dn("MuiSvgIcon",e)}ii("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const qc=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],Zc=e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root",t!=="inherit"&&`color${Ie(t)}`,`fontSize${Ie(n)}`]};return ti(o,Gc,r)},Xc=Kc("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Ie(n.color)}`],t[`fontSize${Ie(n.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var n,r,o,s,i,l,u,d,f,h,p,b,g;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=e.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(o=e.transitions)==null||(o=o.duration)==null?void 0:o.shorter}),fontSize:{inherit:"inherit",small:((s=e.typography)==null||(i=s.pxToRem)==null?void 0:i.call(s,20))||"1.25rem",medium:((l=e.typography)==null||(u=l.pxToRem)==null?void 0:u.call(l,24))||"1.5rem",large:((d=e.typography)==null||(f=d.pxToRem)==null?void 0:f.call(d,35))||"2.1875rem"}[t.fontSize],color:(h=(p=(e.vars||e).palette)==null||(p=p[t.color])==null?void 0:p.main)!=null?h:{action:(b=(e.vars||e).palette)==null||(b=b.action)==null?void 0:b.active,disabled:(g=(e.vars||e).palette)==null||(g=g.action)==null?void 0:g.disabled,inherit:void 0}[t.color]}}),Cn=W.forwardRef(function(t,n){const r=fi({props:t,name:"MuiSvgIcon"}),{children:o,className:s,color:i="inherit",component:l="svg",fontSize:u="medium",htmlColor:d,inheritViewBox:f=!1,titleAccess:h,viewBox:p="0 0 24 24"}=r,b=m._objectWithoutPropertiesLoose(r,qc),g=W.isValidElement(o)&&o.type==="svg",a=m._extends({},r,{color:i,component:l,fontSize:u,instanceFontSize:t.fontSize,inheritViewBox:f,viewBox:p,hasSvgAsChild:g}),x={};f||(x.viewBox=p);const S=Zc(a);return c.jsxs(Xc,m._extends({as:l,className:m.clsx(S.root,s),focusable:"false",color:d,"aria-hidden":h?void 0:!0,role:h?"img":void 0,ref:n},x,b,g&&o.props,{ownerState:a,children:[g?o.props.children:o,h?c.jsx("title",{children:h}):null]}))});process.env.NODE_ENV!=="production"&&(Cn.propTypes={children:m.PropTypes.node,classes:m.PropTypes.object,className:m.PropTypes.string,color:m.PropTypes.oneOfType([m.PropTypes.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),m.PropTypes.string]),component:m.PropTypes.elementType,fontSize:m.PropTypes.oneOfType([m.PropTypes.oneOf(["inherit","large","medium","small"]),m.PropTypes.string]),htmlColor:m.PropTypes.string,inheritViewBox:m.PropTypes.bool,shapeRendering:m.PropTypes.string,sx:m.PropTypes.oneOfType([m.PropTypes.arrayOf(m.PropTypes.oneOfType([m.PropTypes.func,m.PropTypes.object,m.PropTypes.bool])),m.PropTypes.func,m.PropTypes.object]),titleAccess:m.PropTypes.string,viewBox:m.PropTypes.string});Cn.muiName="SvgIcon";const lr=Cn;function Jc(e,t){function n(r,o){return c.jsx(lr,m._extends({"data-testid":`${t}Icon`,ref:o},r,{children:e}))}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=lr.muiName,W.memo(W.forwardRef(n))}const Qc=Jc(c.jsx("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown");var cr=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function e0(e,t){return!!(e===t||cr(e)&&cr(t))}function t0(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!e0(e[n],t[n]))return!1;return!0}function Wt(e,t){t===void 0&&(t=t0);var n,r=[],o,s=!1;function i(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];return s&&n===this&&t(l,r)||(o=e.apply(this,l),s=!0,n=this,r=l),o}return i}var n0=typeof performance=="object"&&typeof performance.now=="function",ur=n0?function(){return performance.now()}:function(){return Date.now()};function dr(e){cancelAnimationFrame(e.id)}function r0(e,t){var n=ur();function r(){ur()-n>=t?e.call(null):o.id=requestAnimationFrame(r)}var o={id:requestAnimationFrame(r)};return o}var Vt=-1;function fr(e){if(e===void 0&&(e=!1),Vt===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),Vt=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Vt}var Le=null;function hr(e){if(e===void 0&&(e=!1),Le===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?Le="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Le="negative":Le="positive-ascending"),document.body.removeChild(t),Le}return Le}process.env.NODE_ENV;var o0=150,s0=function(t,n){return t},xt=null,bt=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(xt=new WeakSet,bt=new WeakSet);function i0(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,o=e.getItemSize,s=e.getOffsetForIndexAndAlignment,i=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,u=e.initInstanceProps,d=e.shouldResetStyleCacheOnItemSizeChange,f=e.validateProps;return t=function(h){m._inheritsLoose(p,h);function p(g){var a;return a=h.call(this,g)||this,a._instanceProps=u(a.props,m._assertThisInitialized(a)),a._outerRef=void 0,a._resetIsScrollingTimeoutId=null,a.state={instance:m._assertThisInitialized(a),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof a.props.initialScrollOffset=="number"?a.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},a._callOnItemsRendered=void 0,a._callOnItemsRendered=Wt(function(x,S,E,_){return a.props.onItemsRendered({overscanStartIndex:x,overscanStopIndex:S,visibleStartIndex:E,visibleStopIndex:_})}),a._callOnScroll=void 0,a._callOnScroll=Wt(function(x,S,E){return a.props.onScroll({scrollDirection:x,scrollOffset:S,scrollUpdateWasRequested:E})}),a._getItemStyle=void 0,a._getItemStyle=function(x){var S=a.props,E=S.direction,_=S.itemSize,C=S.layout,v=a._getItemStyleCache(d&&_,d&&C,d&&E),y;if(v.hasOwnProperty(x))y=v[x];else{var w=n(a.props,x,a._instanceProps),k=o(a.props,x,a._instanceProps),A=E==="horizontal"||C==="horizontal",j=E==="rtl",I=A?w:0;v[x]=y={position:"absolute",left:j?void 0:I,right:j?I:void 0,top:A?0:w,height:A?"100%":k,width:A?k:"100%"}}return y},a._getItemStyleCache=void 0,a._getItemStyleCache=Wt(function(x,S,E){return{}}),a._onScrollHorizontal=function(x){var S=x.currentTarget,E=S.clientWidth,_=S.scrollLeft,C=S.scrollWidth;a.setState(function(v){if(v.scrollOffset===_)return null;var y=a.props.direction,w=_;if(y==="rtl")switch(hr()){case"negative":w=-_;break;case"positive-descending":w=C-E-_;break}return w=Math.max(0,Math.min(w,C-E)),{isScrolling:!0,scrollDirection:v.scrollOffset<w?"forward":"backward",scrollOffset:w,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._onScrollVertical=function(x){var S=x.currentTarget,E=S.clientHeight,_=S.scrollHeight,C=S.scrollTop;a.setState(function(v){if(v.scrollOffset===C)return null;var y=Math.max(0,Math.min(C,_-E));return{isScrolling:!0,scrollDirection:v.scrollOffset<y?"forward":"backward",scrollOffset:y,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._outerRefSetter=function(x){var S=a.props.outerRef;a._outerRef=x,typeof S=="function"?S(x):S!=null&&typeof S=="object"&&S.hasOwnProperty("current")&&(S.current=x)},a._resetIsScrollingDebounced=function(){a._resetIsScrollingTimeoutId!==null&&dr(a._resetIsScrollingTimeoutId),a._resetIsScrollingTimeoutId=r0(a._resetIsScrolling,o0)},a._resetIsScrolling=function(){a._resetIsScrollingTimeoutId=null,a.setState({isScrolling:!1},function(){a._getItemStyleCache(-1,null)})},a}p.getDerivedStateFromProps=function(a,x){return a0(a,x),f(a),null};var b=p.prototype;return b.scrollTo=function(a){a=Math.max(0,a),this.setState(function(x){return x.scrollOffset===a?null:{scrollDirection:x.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},b.scrollToItem=function(a,x){x===void 0&&(x="auto");var S=this.props,E=S.itemCount,_=S.layout,C=this.state.scrollOffset;a=Math.max(0,Math.min(a,E-1));var v=0;if(this._outerRef){var y=this._outerRef;_==="vertical"?v=y.scrollWidth>y.clientWidth?fr():0:v=y.scrollHeight>y.clientHeight?fr():0}this.scrollTo(s(this.props,a,x,C,this._instanceProps,v))},b.componentDidMount=function(){var a=this.props,x=a.direction,S=a.initialScrollOffset,E=a.layout;if(typeof S=="number"&&this._outerRef!=null){var _=this._outerRef;x==="horizontal"||E==="horizontal"?_.scrollLeft=S:_.scrollTop=S}this._callPropsCallbacks()},b.componentDidUpdate=function(){var a=this.props,x=a.direction,S=a.layout,E=this.state,_=E.scrollOffset,C=E.scrollUpdateWasRequested;if(C&&this._outerRef!=null){var v=this._outerRef;if(x==="horizontal"||S==="horizontal")if(x==="rtl")switch(hr()){case"negative":v.scrollLeft=-_;break;case"positive-ascending":v.scrollLeft=_;break;default:var y=v.clientWidth,w=v.scrollWidth;v.scrollLeft=w-y-_;break}else v.scrollLeft=_;else v.scrollTop=_}this._callPropsCallbacks()},b.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&dr(this._resetIsScrollingTimeoutId)},b.render=function(){var a=this.props,x=a.children,S=a.className,E=a.direction,_=a.height,C=a.innerRef,v=a.innerElementType,y=a.innerTagName,w=a.itemCount,k=a.itemData,A=a.itemKey,j=A===void 0?s0:A,I=a.layout,O=a.outerElementType,N=a.outerTagName,V=a.style,ee=a.useIsScrolling,ce=a.width,Ee=this.state.isScrolling,ge=E==="horizontal"||I==="horizontal",Ge=ge?this._onScrollHorizontal:this._onScrollVertical,be=this._getRangeToRender(),Me=be[0],ke=be[1],Ae=[];if(w>0)for(var ue=Me;ue<=ke;ue++)Ae.push(T.createElement(x,{data:k,key:j(ue,k),index:ue,isScrolling:ee?Ee:void 0,style:this._getItemStyle(ue)}));var je=r(this.props,this._instanceProps);return T.createElement(O||N||"div",{className:S,onScroll:Ge,ref:this._outerRefSetter,style:m._extends({position:"relative",height:_,width:ce,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:E},V)},T.createElement(v||y||"div",{children:Ae,ref:C,style:{height:ge?"100%":je,pointerEvents:Ee?"none":void 0,width:ge?je:"100%"}}))},b._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var a=this.props.itemCount;if(a>0){var x=this._getRangeToRender(),S=x[0],E=x[1],_=x[2],C=x[3];this._callOnItemsRendered(S,E,_,C)}}if(typeof this.props.onScroll=="function"){var v=this.state,y=v.scrollDirection,w=v.scrollOffset,k=v.scrollUpdateWasRequested;this._callOnScroll(y,w,k)}},b._getRangeToRender=function(){var a=this.props,x=a.itemCount,S=a.overscanCount,E=this.state,_=E.isScrolling,C=E.scrollDirection,v=E.scrollOffset;if(x===0)return[0,0,0,0];var y=i(this.props,v,this._instanceProps),w=l(this.props,y,v,this._instanceProps),k=!_||C==="backward"?Math.max(1,S):1,A=!_||C==="forward"?Math.max(1,S):1;return[Math.max(0,y-k),Math.max(0,Math.min(x-1,w+A)),y,w]},p}(T.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var a0=function(t,n){var r=t.children,o=t.direction,s=t.height,i=t.layout,l=t.innerTagName,u=t.outerTagName,d=t.width,f=n.instance;if(process.env.NODE_ENV!=="production"){(l!=null||u!=null)&&bt&&!bt.has(f)&&(bt.add(f),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var h=o==="horizontal"||i==="horizontal";switch(o){case"horizontal":case"vertical":xt&&!xt.has(f)&&(xt.add(f),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+o+'" was specified.'))}switch(i){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+i+'" was specified.'))}if(r==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(r===null?"null":typeof r)+'" was specified.'));if(h&&typeof d!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(d===null?"null":typeof d)+'" was specified.'));if(!h&&typeof s!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(s===null?"null":typeof s)+'" was specified.'))}},l0=50,Fe=function(t,n,r){var o=t,s=o.itemSize,i=r.itemMetadataMap,l=r.lastMeasuredIndex;if(n>l){var u=0;if(l>=0){var d=i[l];u=d.offset+d.size}for(var f=l+1;f<=n;f++){var h=s(f);i[f]={offset:u,size:h},u+=h}r.lastMeasuredIndex=n}return i[n]},c0=function(t,n,r){var o=n.itemMetadataMap,s=n.lastMeasuredIndex,i=s>0?o[s].offset:0;return i>=r?mo(t,n,s,0,r):u0(t,n,Math.max(0,s),r)},mo=function(t,n,r,o,s){for(;o<=r;){var i=o+Math.floor((r-o)/2),l=Fe(t,i,n).offset;if(l===s)return i;l<s?o=i+1:l>s&&(r=i-1)}return o>0?o-1:0},u0=function(t,n,r,o){for(var s=t.itemCount,i=1;r<s&&Fe(t,r,n).offset<o;)r+=i,i*=2;return mo(t,n,Math.min(r,s-1),Math.floor(r/2),o)},pr=function(t,n){var r=t.itemCount,o=n.itemMetadataMap,s=n.estimatedItemSize,i=n.lastMeasuredIndex,l=0;if(i>=r&&(i=r-1),i>=0){var u=o[i];l=u.offset+u.size}var d=r-i-1,f=d*s;return l+f},d0=i0({getItemOffset:function(t,n,r){return Fe(t,n,r).offset},getItemSize:function(t,n,r){return r.itemMetadataMap[n].size},getEstimatedTotalSize:pr,getOffsetForIndexAndAlignment:function(t,n,r,o,s,i){var l=t.direction,u=t.height,d=t.layout,f=t.width,h=l==="horizontal"||d==="horizontal",p=h?f:u,b=Fe(t,n,s),g=pr(t,s),a=Math.max(0,Math.min(g-p,b.offset)),x=Math.max(0,b.offset-p+b.size+i);switch(r==="smart"&&(o>=x-p&&o<=a+p?r="auto":r="center"),r){case"start":return a;case"end":return x;case"center":return Math.round(x+(a-x)/2);case"auto":default:return o>=x&&o<=a?o:o<x?x:a}},getStartIndexForOffset:function(t,n,r){return c0(t,r,n)},getStopIndexForStartIndex:function(t,n,r,o){for(var s=t.direction,i=t.height,l=t.itemCount,u=t.layout,d=t.width,f=s==="horizontal"||u==="horizontal",h=f?d:i,p=Fe(t,n,o),b=r+h,g=p.offset+p.size,a=n;a<l-1&&g<b;)a++,g+=Fe(t,a,o).size;return a},initInstanceProps:function(t,n){var r=t,o=r.estimatedItemSize,s={itemMetadataMap:{},estimatedItemSize:o||l0,lastMeasuredIndex:-1};return n.resetAfterIndex=function(i,l){l===void 0&&(l=!0),s.lastMeasuredIndex=Math.min(s.lastMeasuredIndex,i-1),n._getItemStyleCache(-1),l&&n.forceUpdate()},s},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(t){var n=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof n!="function")throw Error('An invalid "itemSize" prop has been specified. Value should be a function. '+('"'+(n===null?"null":typeof n)+'" was specified.'))}});function ln(e){const{colors:t}=m.useTheme();return c.jsx($.Stack,{sx:{cursor:"pointer"},onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=e.onClick)==null||r.call(e,e.option)},...e.stackProps,children:c.jsx($.Stack,{sx:{p:1,transition:"0.2s",borderRadius:"5px",cursor:"pointer",...m.activeStyles({backgroundColor:t.primary200},e.select),":hover":{backgroundColor:"#eeeeee80",borderColor:"transparent"}},children:e.renderOption(e.option)})})}const Et=37,f0=(e,t)=>{const i=document.createElement("p");i.innerText=t,i.style.width=`${e-16-16-4}px`,document.body.appendChild(i);const l=i.offsetHeight;return document.body.removeChild(i),l>21?Et+21:Et};function h0(e){const[t,n]=T.useState(!1),[r,o]=T.useState(""),[s,i]=T.useState(""),[l,u]=T.useState(!1),{isRequired:d=!1}=e,f=T.useCallback(m._.debounce(y=>{var w;(w=e.handleChangeSearch)==null||w.call(e,y)},300),[e.handleChangeSearch]),h=()=>{n(!t)},p=()=>{n(!1),i(""),f("")};T.useEffect(()=>{o(e.value?e.getOptionLabel(e.value):"")},[e.value]),T.useEffect(()=>{t||o(e.value?e.getOptionLabel(e.value):"")},[t]),T.useEffect(()=>{u(e.searchLoading)},[e.paging.rows,e.searchLoading]);const b=e.paging.rows,{hasNextPage:g}=e,a=g?b.length+1:b.length,x=()=>e.isNextPageLoading?void 0:e.loadNextPage(s),S=y=>!g||y<b.length,E=y=>{o(y.target.value),t&&(i(y.target.value),f(y.target.value),u(!0))},_=T.useRef(null),C=T.useRef(null),v=T.useRef(null);return T.useEffect(()=>{var y,w,k,A;t?((y=C.current)==null||y.classList.add("Mui-focused"),(w=v.current)==null||w.classList.add("Mui-focused")):((k=C.current)==null||k.classList.remove("Mui-focused"),(A=v.current)==null||A.classList.remove("Mui-focused"))},[t]),c.jsx($.ClickAwayListener,{onClickAway:p,mouseEvent:"onMouseDown",touchEvent:"onTouchEnd",children:c.jsx("div",{ref:_,style:{width:e.wrapperWidth??"auto"},children:c.jsxs($.Stack,{sx:{position:"relative"},children:[c.jsx($.TextField,{required:d,label:e.label,value:r,disabled:e.loading||e.disabled||e.readOnly,fullWidth:!0,error:e.error,helperText:e.helperText,onFocus:y=>{e.loading||e.disabled||e.readOnly||(y.preventDefault(),y.stopPropagation(),n(!0))},autoComplete:"off",onChange:E,placeholder:e.placeholder||"All options",sx:{"& input:not(:focus)":{"&::placeholder":{color:e.placeHolderColor||"#C5C5C5",opacity:1}}},InputLabelProps:{ref:C,shrink:!0},InputProps:{readOnly:e.readOnly,ref:v,endAdornment:c.jsx($.IconButton,{size:"small",sx:{padding:"1px"},onClick:y=>{var w;y.preventDefault(),y.stopPropagation(),h(),(w=_.current)==null||w.focus()},disabled:e.loading||e.disabled||e.readOnly,children:e.loading?c.jsx($.CircularProgress,{size:"16px"}):c.jsx(Qc,{fontSize:"small",style:{transition:"0.3s"},className:t?"rotate":""})})}}),c.jsx($.Fade,{in:t,timeout:0,unmountOnExit:!1,children:c.jsxs($.Paper,{sx:{position:"absolute",top:"calc(100% + 2px)",zIndex:2,left:0,right:0,p:1},children:[!e.disabledAllOption&&c.jsx($.Stack,{sx:{...m.activeStyles({display:"none"},!!l)},children:c.jsx($.Stack,{children:c.jsx(ln,{option:void 0,select:!e.value,renderOption:()=>c.jsx($.Typography,{children:e.placeholder||"All options"}),onClick:()=>{var y,w;p(),(y=e.onChange)==null||y.call(e,void 0),(w=e.handleChangeSearch)==null||w.call(e,"")}})})}),!l&&c.jsx(m.InfiniteLoader,{isItemLoaded:S,itemCount:a,loadMoreItems:x,threshold:5,children:({onItemsRendered:y,ref:w})=>c.jsx(d0,{ref:w,onItemsRendered:y,height:Et*Math.min(e.itemsNumber||6,a),itemCount:a,itemSize:k=>{var A;return f0((A=_.current)==null?void 0:A.offsetWidth,b[k]?e.getOptionLabel(b[k]):"")},width:"100%",className:"styled-scroll",children:({index:k,style:A})=>{var I;const j=b[k];return S(k)?c.jsx(ln,{stackProps:{style:A},option:j,renderOption:O=>{var N;return c.jsxs($.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[c.jsx($.Typography,{children:e.getOptionLabel(O)}),(N=e.renderOptionTooltip)==null?void 0:N.call(e,O)]})},onClick:O=>{var N;p(),(N=e.onChange)==null||N.call(e,O)},select:((I=e.isEqual)==null?void 0:I.call(e,j,e.value))??m._.isEqual(j,e.value)}):c.jsx($.Stack,{style:A,sx:{height:Et,pl:1},justifyContent:"center",children:c.jsx($.Typography,{children:"Loading..."})})}})}),c.jsx($.Stack,{sx:{height:30,display:"flex",justifyContent:"center",paddingLeft:"5px",...m.activeStyles({display:"none"},!l)},children:c.jsx($.Typography,{color:"grayText",children:"Searching..."})}),c.jsx($.Stack,{sx:{height:30,display:"flex",justifyContent:"center",paddingLeft:"5px",...m.activeStyles({display:"none"},!!(b.length||e.loading||l))},children:c.jsx($.Typography,{color:"grayText",children:"No options"})})]})})]})})})}function p0(e){var f;const{listProps:t}=e,[n,r]=T.useState({initLoading:!e.disabled,searchLoading:!1,hasNextPage:!1,isNextPageLoading:!1,paging:{page:1,pageSize:((f=e.listProps)==null?void 0:f.pageSize)||20,rows:[],total:0,totalPages:1}}),o=async(h,p)=>{var b,g;if(e.list)r(()=>{var S;const a=((S=h==null?void 0:h.search)==null?void 0:S.content)||"";return{hasNextPage:!1,isNextPageLoading:!1,paging:{page:1,pageSize:1e5,rows:e.list.options.filter(E=>e.list.searchOption?e.list.searchOption(E,a):m.search(E,a,e.list.searchFields)),total:e.list.options.length,totalPages:1},searchLoading:!1,initLoading:!1}});else{r(a=>({...a,isNextPageLoading:!0}));try{const a={page:1,pageSize:20,filter:{...t==null?void 0:t.filter,...h==null?void 0:h.filter},...m.lodashExports.omit(t,"filter"),...m.lodashExports.omit(h,"filter"),search:{fields:((b=t==null?void 0:t.search)==null?void 0:b.fields)??[],content:((g=h==null?void 0:h.search)==null?void 0:g.content)??""}};p&&(a.filter={},a.search&&(a.search.content=""),a.page=1);const x=await e.getList(a);r(S=>({initLoading:!1,searchLoading:!1,isNextPageLoading:!1,paging:{...x,rows:(h==null?void 0:h.page)===1?x.rows:S.paging.rows.concat(x.rows)},hasNextPage:x.page<x.totalPages}))}catch{}}},s=()=>(r(h=>({...h,initLoading:!0})),o(void 0,!0)),i=h=>(r(p=>({...p,initLoading:!0})),o(h)),l=h=>{o({page:n.paging.page+1,search:{content:h}})},u=h=>{r(p=>({...p,searchLoading:!0})),o({page:1,search:{content:h}})};T.useEffect(()=>{e.disabled||(r(h=>({...h,initLoading:!0})),o({page:1}))},[...e.dependencyList||[]]);const d=()=>{r(h=>({...h,initLoading:!h.initLoading}))};return{...e,loadNextPage:l,handleChangeSearch:u,paging:n.paging,hasNextPage:n.hasNextPage,isNextPageLoading:n.isNextPageLoading,searchLoading:n.searchLoading,loading:e.loading||n.initLoading,getList:i,reset:s,toggleLoading:d}}function m0(e){return c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[c.jsx("path",{d:"M12 3.16663H3.99998C2.80336 3.16663 1.83331 4.13668 1.83331 5.33329V12C1.83331 13.1966 2.80336 14.1666 3.99998 14.1666H12C13.1966 14.1666 14.1666 13.1966 14.1666 12V5.33329C14.1666 4.13668 13.1966 3.16663 12 3.16663Z",stroke:"#85858A"}),c.jsx("path",{d:"M4.5 1.83337V4.16671",stroke:"#85858A",strokeLinecap:"round"}),c.jsx("path",{d:"M2.5 6.16663H13.5",stroke:"#85858A",strokeLinecap:"round"}),c.jsx("path",{d:"M11.8333 1.83337V4.16671",stroke:"#85858A",strokeLinecap:"round"}),c.jsx("path",{d:"M5.5 9.33337C5.77614 9.33337 6 9.10952 6 8.83337C6 8.55723 5.77614 8.33337 5.5 8.33337C5.22386 8.33337 5 8.55723 5 8.83337C5 9.10952 5.22386 9.33337 5.5 9.33337Z",fill:"#85858A"}),c.jsx("path",{d:"M8.16669 9.33337C8.44283 9.33337 8.66669 9.10952 8.66669 8.83337C8.66669 8.55723 8.44283 8.33337 8.16669 8.33337C7.89054 8.33337 7.66669 8.55723 7.66669 8.83337C7.66669 9.10952 7.89054 9.33337 8.16669 9.33337Z",fill:"#85858A"}),c.jsx("path",{d:"M10.8333 9.33337C11.1095 9.33337 11.3333 9.10952 11.3333 8.83337C11.3333 8.55723 11.1095 8.33337 10.8333 8.33337C10.5572 8.33337 10.3333 8.55723 10.3333 8.83337C10.3333 9.10952 10.5572 9.33337 10.8333 9.33337Z",fill:"#85858A"}),c.jsx("path",{d:"M5.5 12C5.77614 12 6 11.7761 6 11.5C6 11.2239 5.77614 11 5.5 11C5.22386 11 5 11.2239 5 11.5C5 11.7761 5.22386 12 5.5 12Z",fill:"#85858A"}),c.jsx("path",{d:"M8.16669 12C8.44283 12 8.66669 11.7761 8.66669 11.5C8.66669 11.2239 8.44283 11 8.16669 11C7.89054 11 7.66669 11.2239 7.66669 11.5C7.66669 11.7761 7.89054 12 8.16669 12Z",fill:"#85858A"}),c.jsx("path",{d:"M10.8333 12C11.1095 12 11.3333 11.7761 11.3333 11.5C11.3333 11.2239 11.1095 11 10.8333 11C10.5572 11 10.3333 11.2239 10.3333 11.5C10.3333 11.7761 10.5572 12 10.8333 12Z",fill:"#85858A"})]})}const g0="Reset date";function y0(e){var l,u;const[t,n]=T.useState(e.value),r=!(t!=null&&t.startDate)||!(t!=null&&t.endDate)?"":X(t==null?void 0:t.startDate).format("DD/MM/YYYY")+" ~ "+X(t==null?void 0:t.endDate).format("DD/MM/YYYY");T.useEffect(()=>{n(e.value)},[e.value]);const o=T.useRef(null),s=T.useRef(null),i=T.useRef(null);return console.log("inputRef",o),console.log("labelRef",s),c.jsx(m.DateRangePicker,{initialSettings:{autoApply:!0,ranges:{Today:[X(),X()],Yesterday:[X().subtract(1,"days"),X().subtract(1,"days")],"Last 7 days":[X().subtract(6,"days"),X()],"Last 30 days":[X().subtract(29,"days"),X()],"This month":[X().startOf("month"),X().endOf("month")],"Last month":[X().subtract(1,"month").startOf("month"),X().subtract(1,"month").endOf("month")],"Reset date":[((l=e.dateReset)==null?void 0:l.startDate)??void 0,((u=e.dateReset)==null?void 0:u.endDate)??void 0]},alwaysShowCalendars:!0,startDate:(t==null?void 0:t.startDate)??void 0,endDate:(t==null?void 0:t.endDate)??void 0,opens:"left",maxDate:X(),...e.initialSettings},onApply:(d,f)=>{var x,S,E;const h=f.chosenLabel===g0,{startDate:p,endDate:b}=f,g=h?((x=e.dateReset)==null?void 0:x.startDate)??void 0:p.toDate(),a=h?((S=e.dateReset)==null?void 0:S.endDate)??void 0:b.toDate();n({startDate:g,endDate:a}),(E=e.onChange)==null||E.call(e,{startDate:g,endDate:a})},children:c.jsx($.TextField,{inputRef:o,label:e.label??"Permit date",placeholder:"Select date range",value:r,InputLabelProps:{ref:s,shrink:!0},InputProps:{readOnly:!0,ref:i,endAdornment:c.jsx(m0,{onClick:()=>{var d;return(d=o.current)==null?void 0:d.focus()},width:24,height:24,color:"gray"})},fullWidth:!0,sx:{"& *":{cursor:"pointer"},display:"flex",justifyContent:"center",minWidth:"250px"}})})}function go(e){return c.jsx("svg",{...e,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M16 2.75H8C5.10051 2.75 2.75 5.10051 2.75 8V16C2.75 18.8995 5.10051 21.25 8 21.25H16C18.8995 21.25 21.25 18.8995 21.25 16V8C21.25 5.10051 18.8995 2.75 16 2.75Z",stroke:"#85858A",strokeWidth:"1.5"})})}function yo(e){return c.jsxs("svg",{...e,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("path",{d:"M16 2.75H8C5.10051 2.75 2.75 5.10051 2.75 8V16C2.75 18.8995 5.10051 21.25 8 21.25H16C18.8995 21.25 21.25 18.8995 21.25 16V8C21.25 5.10051 18.8995 2.75 16 2.75Z",stroke:"currentColor",strokeWidth:"1.5"}),c.jsx("path",{d:"M9 12L11 14L15 10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function x0(e){return c.jsx($.Checkbox,{sx:{"& input:disabled ~ svg":{fill:"#ddd"}},color:"primary",icon:c.jsx(go,{fontSize:"small"}),checkedIcon:c.jsx(yo,{fontSize:"small"}),style:{padding:0},...e})}const mr=e=>{"serviceWorker"in navigator&&navigator.serviceWorker.register(e.path).then(function(t){console.log("Registration successful, scope is:",t.scope),console.log("initialize service worker props ",e);const n=m.getMessagingInWindow(m.initializeApp({apiKey:e.apiKey,authDomain:e.authDomain,projectId:e.projectId,storageBucket:e.storageBucket,messagingSenderId:e.messagingSenderId,appId:e.appId,measurementId:e.measurementId}));m.getToken(n,{serviceWorkerRegistration:t,vapidKey:e.vapidKey}).then(async r=>{if(r){console.log("current token for client: ",r);try{const o="/notification-management/api/v1/notifications/registrations",s=e.baseUrl+o;await m.axiosInstance.post(s,{deviceToken:r})}catch(o){console.log(o)}}else console.log("No registration token available. Request permission to generate one.")}).catch(r=>{console.log("An error occurred while retrieving token. ",r)})}).catch(function(t){console.log("Service worker registration failed, error:",t)})},b0=e=>{const t=new BroadcastChannel("my-channel");t.onmessage=n=>{console.log("Broadcast chanel message",n),n&&e(r=>({...r,unread:{...r.unread,total:r.unread.total+1}}))}},v0=e=>new Promise(t=>{const n=m.getMessagingInWindow(m.initializeApp({apiKey:e.apiKey,authDomain:e.authDomain,projectId:e.projectId,storageBucket:e.storageBucket,messagingSenderId:e.messagingSenderId,appId:e.appId,measurementId:e.measurementId}));m.onMessage(n,r=>{console.log("payload",r),t(r)})}),xo=e=>{const[t,n]=T.useState({actorName:"",message:"",context:"",contextUrl:""});console.log(t);const{setNotiData:r}=T.useContext(m.CustomOpenList);function o(){const s=c.jsxs("div",{className:"notification-massage_content",children:[c.jsx("h6",{className:"notification-name",children:t==null?void 0:t.actorName}),c.jsxs("div",{className:"notification-message_service",children:[c.jsxs("span",{children:[`${t==null?void 0:t.message} `," "]}),c.jsx("span",{children:t==null?void 0:t.context})]})]});return c.jsxs(c.Fragment,{children:[c.jsx("style",{children:yr}),t!=null&&t.contextUrl?c.jsx("a",{className:"notification-massage_container",href:t.contextUrl,style:{display:"block"},children:s}):c.jsx("div",{className:"notification-massage_container",style:{width:"100%",display:"block"},children:s})]})}return T.useEffect(()=>{t&&Notification.permission==="granted"&&(t.actorName||t.message||t.context||t.contextUrl)&&m.notify(c.jsx(o,{}))},[t]),T.useEffect(()=>{"Notification"in window&&(console.log("notification permission",Notification.permission),Notification.permission==="default"?Notification.requestPermission(function(s){s==="granted"&&mr(e)}):Notification.permission==="granted"&&mr(e))},[Notification.permission]),T.useEffect(()=>{b0(r)},[]),v0(e).then(s=>{var i,l,u,d,f,h,p;console.log("aaa",s),n({actorName:(i=s==null?void 0:s.data)==null?void 0:i.actorName,message:(l=s==null?void 0:s.data)!=null&&l.actionKey?m.translate(`notificationAdmin.notify.actionKey.${(u=s==null?void 0:s.data)==null?void 0:u.actionKey}`,{defaultValue:`${(d=s==null?void 0:s.data)==null?void 0:d.message}`}):(f=s==null?void 0:s.data)==null?void 0:f.message,context:(h=s==null?void 0:s.data)==null?void 0:h.context,contextUrl:(p=s==null?void 0:s.data)==null?void 0:p.contextUrl}),r(b=>{var g;return{...b,unread:{...b.unread,total:((g=b.unread)==null?void 0:g.total)+1}}})}).catch(s=>console.log("failed: ",s)),c.jsx(c.Fragment,{})},S0=(e,t)=>T.cloneElement(t,{},e),w0=({children:e,providers:t})=>c.jsx(c.Fragment,{children:t.reduceRight(S0,e)}),_0=()=>{const{colors:e}=m.useTheme(),t=()=>{window.location.href=`${window.location.origin}/home`};return console.log("window.location.origin",window.location.origin),c.jsxs($.Stack,{py:2,gap:2,style:{alignItems:"center"},children:[c.jsx("img",{width:120,height:120,src:"https://ukpcsaprod.blob.core.windows.net/lib/images/page-not-found.png",alt:""}),c.jsxs($.Stack,{gap:1,alignItems:"center",children:[c.jsx($.Typography,{variant:"h4",textAlign:"center",children:"Page Not Found"}),c.jsxs($.Typography,{textAlign:"center",color:e.grey600,children:["We’re sorry. The page you requested could no be found. ",c.jsx("br",{}),"Please go back to the home page"]}),c.jsx($.Button,{variant:"primary",style:{maxWidth:"200px",width:"100%"},onClick:t,children:"Go to homepage"})]})]})};exports.FavoriteMenu=m.FavoriteMenu;exports.GlobalMenu=m.GlobalMenu;exports.IconComponent=m.IconComponent;exports.notify=m.notify;exports.pushError=m.pushError;exports.pushSuccess=m.pushSuccess;exports.pushWarning=m.pushWarning;exports.updateFavoriteItems=m.updateFavoriteItems;exports.AutocompleteOption=ln;exports.BaseCheckbox=x0;exports.CheckedIcon=yo;exports.HomePage=Vs;exports.LanguageDropdown=kr;exports.MultiProvider=w0;exports.NoData=Rs;exports.NotFoundPage=Ws;exports.NotificationBase=xo;exports.PageNotFound=_0;exports.PopUpBase=Bs;exports.StyledAutocomplete=h0;exports.StyledDateRangePicker=y0;exports.ToastConfig=$s;exports.ToastConfigNotification=Ns;exports.TopBar=Ps;exports.UnauthorizedPage=Us;exports.UncheckedIcon=go;exports.usePopUp=Hs;exports.useStyledAutocomplete=p0;
|
package/dist/components/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as k, Fragment as ue, jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import * as W from "react";
|
|
3
3
|
import pe, { useState as B, useContext as Ae, useEffect as q, useRef as ve, useCallback as kt, forwardRef as Vo, createElement as ir, PureComponent as Wo } from "react";
|
|
4
|
-
import { c as De, a as gt, C as Le, t as ct, p as Uo, L as Ur, u as Yo, b as Ko, S as Go, d as qo, e as Zo, Q as Hn, f as Et, g as Tr, h as Xo, s as Ct, _ as V, P as N, i as we, j as Jo, o as Qo, k as Oe, l as ei, m as ti, n as Yr, q as At, r as Kr, I as ri, v as ni, w as Gr, D as oi, x as Bn, y as Vn, z as ii, A as ai, B as si } from "../index.esm2017-
|
|
5
|
-
import { H as H1, G as B1, K as V1, E as W1, F as U1, J as Y1 } from "../index.esm2017-
|
|
4
|
+
import { c as De, a as gt, C as Le, t as ct, p as Uo, L as Ur, u as Yo, b as Ko, S as Go, d as qo, e as Zo, Q as Hn, f as Et, g as Tr, h as Xo, s as Ct, _ as V, P as N, i as we, j as Jo, o as Qo, k as Oe, l as ei, m as ti, n as Yr, q as At, r as Kr, I as ri, v as ni, w as Gr, D as oi, x as Bn, y as Vn, z as ii, A as ai, B as si } from "../index.esm2017-e23bb13e.js";
|
|
5
|
+
import { H as H1, G as B1, K as V1, E as W1, F as U1, J as Y1 } from "../index.esm2017-e23bb13e.js";
|
|
6
6
|
import Q from "moment";
|
|
7
7
|
import { Stack as oe, Dialog as li, DialogTitle as ci, Typography as Ee, DialogContent as ui, DialogActions as di, Button as Lt, Box as fi, ClickAwayListener as hi, TextField as Wn, IconButton as mi, CircularProgress as pi, Fade as gi, Paper as yi, Checkbox as bi } from "@mui/material";
|
|
8
8
|
import "axios";
|
|
@@ -6276,7 +6276,9 @@ function $0(e = {}, ...t) {
|
|
|
6276
6276
|
transitions: o = {},
|
|
6277
6277
|
typography: i = {}
|
|
6278
6278
|
} = e, a = Oe(e, O0);
|
|
6279
|
-
if (e.vars
|
|
6279
|
+
if (e.vars && // The error should throw only for the root theme creation because user is not allowed to use a custom node `vars`.
|
|
6280
|
+
// `generateCssVars` is the closest identifier for checking that the `options` is a result of `extendTheme` with CSS variables so that user can create new theme for nested ThemeProvider.
|
|
6281
|
+
e.generateCssVars === void 0)
|
|
6280
6282
|
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: `vars` is a private field used for CSS variables support.\nPlease use another name." : dt(18));
|
|
6281
6283
|
const l = p0(n), c = Ro(e);
|
|
6282
6284
|
let d = xe(c, {
|