@3sc/common-component 0.0.124 → 0.0.126

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/index.umd.js CHANGED
@@ -250,7 +250,7 @@ const theme2 = createTheme({ palette: {
250
250
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const o=new this(t);return n.forEach(r=>o.set(r)),o}static accessor(t){const o=(this[sv]=this[sv]={accessors:{}}).accessors,r=this.prototype;function s(a){const c=_i(a);o[c]||(x4(r,a),o[c]=!0)}return G.isArray(t)?t.forEach(s):s(t),this}};zt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),G.reduceDescriptors(zt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[n]=o}}}),G.freezeMethods(zt);function ad(e,t){const n=this||Li,o=t||n,r=zt.from(o.headers);let s=o.data;return G.forEach(e,function(c){s=c.call(n,s,r.normalize(),t?t.status:void 0)}),r.normalize(),s}function av(e){return!!(e&&e.__CANCEL__)}function Sr(e,t,n){we.call(this,e??"canceled",we.ERR_CANCELED,t,n),this.name="CanceledError"}G.inherits(Sr,we,{__CANCEL__:!0});function lv(e,t,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new we("Request failed with status code "+n.status,[we.ERR_BAD_REQUEST,we.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function C4(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function E4(e,t){e=e||10;const n=new Array(e),o=new Array(e);let r=0,s=0,a;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),d=o[s];a||(a=u),n[r]=l,o[r]=u;let p=s,f=0;for(;p!==r;)f+=n[p++],p=p%e;if(r=(r+1)%e,r===s&&(s=(s+1)%e),u-a<t)return;const g=d&&u-d;return g?Math.round(f*1e3/g):void 0}}function I4(e,t){let n=0,o=1e3/t,r,s;const a=(u,d=Date.now())=>{n=d,r=null,s&&(clearTimeout(s),s=null),e.apply(null,u)};return[(...u)=>{const d=Date.now(),p=d-n;p>=o?a(u,d):(r=u,s||(s=setTimeout(()=>{s=null,a(r)},o-p)))},()=>r&&a(r)]}const Na=(e,t,n=3)=>{let o=0;const r=E4(50,250);return I4(s=>{const a=s.loaded,c=s.lengthComputable?s.total:void 0,l=a-o,u=r(l),d=a<=c;o=a;const p={loaded:a,total:c,progress:c?a/c:void 0,bytes:l,rate:u||void 0,estimated:u&&c&&d?(c-a)/u:void 0,event:s,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(p)},n)},cv=(e,t)=>{const n=e!=null;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},uv=e=>(...t)=>G.asap(()=>e(...t)),T4=At.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,At.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(At.origin),At.navigator&&/(msie|trident)/i.test(At.navigator.userAgent)):()=>!0,S4=At.hasStandardBrowserEnv?{write(e,t,n,o,r,s){const a=[e+"="+encodeURIComponent(t)];G.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),G.isString(o)&&a.push("path="+o),G.isString(r)&&a.push("domain="+r),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function w4(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function R4(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function dv(e,t,n){let o=!w4(t);return e&&o||n==!1?R4(e,t):t}const pv=e=>e instanceof zt?{...e}:e;function Po(e,t){t=t||{};const n={};function o(u,d,p,f){return G.isPlainObject(u)&&G.isPlainObject(d)?G.merge.call({caseless:f},u,d):G.isPlainObject(d)?G.merge({},d):G.isArray(d)?d.slice():d}function r(u,d,p,f){if(G.isUndefined(d)){if(!G.isUndefined(u))return o(void 0,u,p,f)}else return o(u,d,p,f)}function s(u,d){if(!G.isUndefined(d))return o(void 0,d)}function a(u,d){if(G.isUndefined(d)){if(!G.isUndefined(u))return o(void 0,u)}else return o(void 0,d)}function c(u,d,p){if(p in t)return o(u,d);if(p in e)return o(void 0,u)}const l={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(u,d,p)=>r(pv(u),pv(d),p,!0)};return G.forEach(Object.keys(Object.assign({},e,t)),function(d){const p=l[d]||r,f=p(e[d],t[d],d);G.isUndefined(f)&&p!==c||(n[d]=f)}),n}const fv=e=>{const t=Po({},e);let{data:n,withXSRFToken:o,xsrfHeaderName:r,xsrfCookieName:s,headers:a,auth:c}=t;t.headers=a=zt.from(a),t.url=nv(dv(t.baseURL,t.url),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let l;if(G.isFormData(n)){if(At.hasStandardBrowserEnv||At.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((l=a.getContentType())!==!1){const[u,...d]=l?l.split(";").map(p=>p.trim()).filter(Boolean):[];a.setContentType([u||"multipart/form-data",...d].join("; "))}}if(At.hasStandardBrowserEnv&&(o&&G.isFunction(o)&&(o=o(t)),o||o!==!1&&T4(t.url))){const u=r&&s&&S4.read(s);u&&a.set(r,u)}return t},O4=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,o){const r=fv(e);let s=r.data;const a=zt.from(r.headers).normalize();let{responseType:c,onUploadProgress:l,onDownloadProgress:u}=r,d,p,f,g,m;function h(){g&&g(),m&&m(),r.cancelToken&&r.cancelToken.unsubscribe(d),r.signal&&r.signal.removeEventListener("abort",d)}let b=new XMLHttpRequest;b.open(r.method.toUpperCase(),r.url,!0),b.timeout=r.timeout;function y(){if(!b)return;const C=zt.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),x={data:!c||c==="text"||c==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:C,config:e,request:b};lv(function(w){n(w),h()},function(w){o(w),h()},x),b=null}"onloadend"in b?b.onloadend=y:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(y)},b.onabort=function(){b&&(o(new we("Request aborted",we.ECONNABORTED,e,b)),b=null)},b.onerror=function(){o(new we("Network Error",we.ERR_NETWORK,e,b)),b=null},b.ontimeout=function(){let I=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const x=r.transitional||rv;r.timeoutErrorMessage&&(I=r.timeoutErrorMessage),o(new we(I,x.clarifyTimeoutError?we.ETIMEDOUT:we.ECONNABORTED,e,b)),b=null},s===void 0&&a.setContentType(null),"setRequestHeader"in b&&G.forEach(a.toJSON(),function(I,x){b.setRequestHeader(x,I)}),G.isUndefined(r.withCredentials)||(b.withCredentials=!!r.withCredentials),c&&c!=="json"&&(b.responseType=r.responseType),u&&([f,m]=Na(u,!0),b.addEventListener("progress",f)),l&&b.upload&&([p,g]=Na(l),b.upload.addEventListener("progress",p),b.upload.addEventListener("loadend",g)),(r.cancelToken||r.signal)&&(d=C=>{b&&(o(!C||C.type?new Sr(null,e,b):C),b.abort(),b=null)},r.cancelToken&&r.cancelToken.subscribe(d),r.signal&&(r.signal.aborted?d():r.signal.addEventListener("abort",d)));const T=C4(r.url);if(T&&At.protocols.indexOf(T)===-1){o(new we("Unsupported protocol "+T+":",we.ERR_BAD_REQUEST,e));return}b.send(s||null)})},A4=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let o=new AbortController,r;const s=function(u){if(!r){r=!0,c();const d=u instanceof Error?u:this.reason;o.abort(d instanceof we?d:new Sr(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,s(new we(`timeout ${t} of ms exceeded`,we.ETIMEDOUT))},t);const c=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),e=null)};e.forEach(u=>u.addEventListener("abort",s));const{signal:l}=o;return l.unsubscribe=()=>G.asap(c),l}},P4=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let o=0,r;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},M4=async function*(e,t){for await(const n of N4(e))yield*P4(n,t)},N4=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:o}=await t.read();if(n)break;yield o}}finally{await t.cancel()}},hv=(e,t,n,o)=>{const r=M4(e,t);let s=0,a,c=l=>{a||(a=!0,o&&o(l))};return new ReadableStream({async pull(l){try{const{done:u,value:d}=await r.next();if(u){c(),l.close();return}let p=d.byteLength;if(n){let f=s+=p;n(f)}l.enqueue(new Uint8Array(d))}catch(u){throw c(u),u}},cancel(l){return c(l),r.return()}},{highWaterMark:2})},ka=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",mv=ka&&typeof ReadableStream=="function",k4=ka&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),gv=(e,...t)=>{try{return!!e(...t)}catch{return!1}},B4=mv&&gv(()=>{let e=!1;const t=new Request(At.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),bv=64*1024,ld=mv&&gv(()=>G.isReadableStream(new Response("").body)),Ba={stream:ld&&(e=>e.body)};ka&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ba[t]&&(Ba[t]=G.isFunction(e[t])?n=>n[t]():(n,o)=>{throw new we(`Response type '${t}' is not supported`,we.ERR_NOT_SUPPORT,o)})})})(new Response);const D4=async e=>{if(e==null)return 0;if(G.isBlob(e))return e.size;if(G.isSpecCompliantForm(e))return(await new Request(At.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(G.isArrayBufferView(e)||G.isArrayBuffer(e))return e.byteLength;if(G.isURLSearchParams(e)&&(e=e+""),G.isString(e))return(await k4(e)).byteLength},j4=async(e,t)=>{const n=G.toFiniteNumber(e.getContentLength());return n??D4(t)},cd={http:o4,xhr:O4,fetch:ka&&(async e=>{let{url:t,method:n,data:o,signal:r,cancelToken:s,timeout:a,onDownloadProgress:c,onUploadProgress:l,responseType:u,headers:d,withCredentials:p="same-origin",fetchOptions:f}=fv(e);u=u?(u+"").toLowerCase():"text";let g=A4([r,s&&s.toAbortSignal()],a),m;const h=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let b;try{if(l&&B4&&n!=="get"&&n!=="head"&&(b=await j4(d,o))!==0){let x=new Request(t,{method:"POST",body:o,duplex:"half"}),R;if(G.isFormData(o)&&(R=x.headers.get("content-type"))&&d.setContentType(R),x.body){const[w,O]=cv(b,Na(uv(l)));o=hv(x.body,bv,w,O)}}G.isString(p)||(p=p?"include":"omit");const y="credentials"in Request.prototype;m=new Request(t,{...f,signal:g,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:o,duplex:"half",credentials:y?p:void 0});let T=await fetch(m);const C=ld&&(u==="stream"||u==="response");if(ld&&(c||C&&h)){const x={};["status","statusText","headers"].forEach(M=>{x[M]=T[M]});const R=G.toFiniteNumber(T.headers.get("content-length")),[w,O]=c&&cv(R,Na(uv(c),!0))||[];T=new Response(hv(T.body,bv,w,()=>{O&&O(),h&&h()}),x)}u=u||"text";let I=await Ba[G.findKey(Ba,u)||"text"](T,e);return!C&&h&&h(),await new Promise((x,R)=>{lv(x,R,{data:I,headers:zt.from(T.headers),status:T.status,statusText:T.statusText,config:e,request:m})})}catch(y){throw h&&h(),y&&y.name==="TypeError"&&/fetch/i.test(y.message)?Object.assign(new we("Network Error",we.ERR_NETWORK,e,m),{cause:y.cause||y}):we.from(y,y&&y.code,e,m)}})};G.forEach(cd,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const vv=e=>`- ${e}`,F4=e=>G.isFunction(e)||e===null||e===!1,yv={getAdapter:e=>{e=G.isArray(e)?e:[e];const{length:t}=e;let n,o;const r={};for(let s=0;s<t;s++){n=e[s];let a;if(o=n,!F4(n)&&(o=cd[(a=String(n)).toLowerCase()],o===void 0))throw new we(`Unknown adapter '${a}'`);if(o)break;r[a||"#"+s]=o}if(!o){const s=Object.entries(r).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=t?s.length>1?`since :
251
251
  `+s.map(vv).join(`
252
252
  `):" "+vv(s[0]):"as no adapter specified";throw new we("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o},adapters:cd};function ud(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Sr(null,e)}function xv(e){return ud(e),e.headers=zt.from(e.headers),e.data=ad.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),yv.getAdapter(e.adapter||Li.adapter)(e).then(function(o){return ud(e),o.data=ad.call(e,e.transformResponse,o),o.headers=zt.from(o.headers),o},function(o){return av(o)||(ud(e),o&&o.response&&(o.response.data=ad.call(e,e.transformResponse,o.response),o.response.headers=zt.from(o.response.headers))),Promise.reject(o)})}const Cv="1.8.1",Da={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Da[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const Ev={};Da.transitional=function(t,n,o){function r(s,a){return"[Axios v"+Cv+"] Transitional option '"+s+"'"+a+(o?". "+o:"")}return(s,a,c)=>{if(t===!1)throw new we(r(a," has been removed"+(n?" in "+n:"")),we.ERR_DEPRECATED);return n&&!Ev[a]&&(Ev[a]=!0,console.warn(r(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,a,c):!0}},Da.spelling=function(t){return(n,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function V4(e,t,n){if(typeof e!="object")throw new we("options must be an object",we.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let r=o.length;for(;r-- >0;){const s=o[r],a=t[s];if(a){const c=e[s],l=c===void 0||a(c,s,e);if(l!==!0)throw new we("option "+s+" must be "+l,we.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new we("Unknown option "+s,we.ERR_BAD_OPTION)}}const ja={assertOptions:V4,validators:Da},Bn=ja.validators;let Mo=class{constructor(t){this.defaults=t,this.interceptors={request:new ov,response:new ov}}async request(t,n){try{return await this._request(t,n)}catch(o){if(o instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const s=r.stack?r.stack.replace(/^.+\n/,""):"";try{o.stack?s&&!String(o.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(o.stack+=`
253
- `+s):o.stack=s}catch{}}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Po(this.defaults,n);const{transitional:o,paramsSerializer:r,headers:s}=n;o!==void 0&&ja.assertOptions(o,{silentJSONParsing:Bn.transitional(Bn.boolean),forcedJSONParsing:Bn.transitional(Bn.boolean),clarifyTimeoutError:Bn.transitional(Bn.boolean)},!1),r!=null&&(G.isFunction(r)?n.paramsSerializer={serialize:r}:ja.assertOptions(r,{encode:Bn.function,serialize:Bn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ja.assertOptions(n,{baseUrl:Bn.spelling("baseURL"),withXsrfToken:Bn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&G.merge(s.common,s[n.method]);s&&G.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),n.headers=zt.concat(a,s);const c=[];let l=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(l=l&&h.synchronous,c.unshift(h.fulfilled,h.rejected))});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let d,p=0,f;if(!l){const m=[xv.bind(this),void 0];for(m.unshift.apply(m,c),m.push.apply(m,u),f=m.length,d=Promise.resolve(n);p<f;)d=d.then(m[p++],m[p++]);return d}f=c.length;let g=n;for(p=0;p<f;){const m=c[p++],h=c[p++];try{g=m(g)}catch(b){h.call(this,b);break}}try{d=xv.call(this,g)}catch(m){return Promise.reject(m)}for(p=0,f=u.length;p<f;)d=d.then(u[p++],u[p++]);return d}getUri(t){t=Po(this.defaults,t);const n=dv(t.baseURL,t.url,t.allowAbsoluteUrls);return nv(n,t.params,t.paramsSerializer)}};G.forEach(["delete","get","head","options"],function(t){Mo.prototype[t]=function(n,o){return this.request(Po(o||{},{method:t,url:n,data:(o||{}).data}))}}),G.forEach(["post","put","patch"],function(t){function n(o){return function(s,a,c){return this.request(Po(c||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Mo.prototype[t]=n(),Mo.prototype[t+"Form"]=n(!0)});let L4=class tx{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const o=this;this.promise.then(r=>{if(!o._listeners)return;let s=o._listeners.length;for(;s-- >0;)o._listeners[s](r);o._listeners=null}),this.promise.then=r=>{let s;const a=new Promise(c=>{o.subscribe(c),s=c}).then(r);return a.cancel=function(){o.unsubscribe(s)},a},t(function(s,a,c){o.reason||(o.reason=new Sr(s,a,c),n(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=o=>{t.abort(o)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new tx(function(r){t=r}),cancel:t}}};function _4(e){return function(n){return e.apply(null,n)}}function $4(e){return G.isObject(e)&&e.isAxiosError===!0}const dd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(dd).forEach(([e,t])=>{dd[t]=e});function Iv(e){const t=new Mo(e),n=G0(Mo.prototype.request,t);return G.extend(n,Mo.prototype,t,{allOwnKeys:!0}),G.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Iv(Po(e,r))},n}const ot=Iv(Li);ot.Axios=Mo,ot.CanceledError=Sr,ot.CancelToken=L4,ot.isCancel=av,ot.VERSION=Cv,ot.toFormData=Pa,ot.AxiosError=we,ot.Cancel=ot.CanceledError,ot.all=function(t){return Promise.all(t)},ot.spread=_4,ot.isAxiosError=$4,ot.mergeConfig=Po,ot.AxiosHeaders=zt,ot.formToJSON=e=>iv(G.isHTMLForm(e)?new FormData(e):e),ot.getAdapter=yv.getAdapter,ot.HttpStatusCode=dd,ot.default=ot;const{Axios:m9,AxiosError:g9,CanceledError:b9,isCancel:v9,CancelToken:y9,VERSION:x9,all:C9,Cancel:E9,isAxiosError:I9,spread:T9,toFormData:S9,AxiosHeaders:w9,HttpStatusCode:R9,formToJSON:O9,getAdapter:A9,mergeConfig:P9}=ot,pd={BASE_URL:"https://qa.3sc.ai/api",VERSION:"/v1"};/*! js-cookie v3.0.5 | MIT */function Fa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var G4={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function fd(e,t){function n(r,s,a){if(!(typeof document>"u")){a=Fa({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var l in a)a[l]&&(c+="; "+l,a[l]!==!0&&(c+="="+a[l].split(";")[0]));return document.cookie=r+"="+e.write(s,r)+c}}function o(r){if(!(typeof document>"u"||arguments.length&&!r)){for(var s=document.cookie?document.cookie.split("; "):[],a={},c=0;c<s.length;c++){var l=s[c].split("="),u=l.slice(1).join("=");try{var d=decodeURIComponent(l[0]);if(a[d]=e.read(u,d),r===d)break}catch{}}return r?a[r]:a}}return Object.create({set:n,get:o,remove:function(r,s){n(r,"",Fa({},s,{expires:-1}))},withAttributes:function(r){return fd(this.converter,Fa({},this.attributes,r))},withConverter:function(r){return fd(Fa({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var W4=fd(G4,{path:"/"});const Va=e=>{const t=localStorage.getItem(e);return t?JSON.parse(t):""},z4=e=>{const t=new Date,n=new Date(e);let o=t-n;o<0&&(o=0);const r=Math.floor(o/1e3),s=Math.floor(r/60);return r<60?`${r} sec ago`:s<60?`${s} min ago`:n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0})},hd=e=>e.sort((n,o)=>{let r=new Date(n.createdAt),s=new Date(o.createdAt);return r===s?0:r>s?-1:1}).sort((n,o)=>n.isRead===o.isRead?0:o.isRead?-1:1),H4=e=>{let t=0;for(let n=0;n<e.length;n++)e[n].isRead||t++;return t},X4=e=>{const t=[];return e.forEach(n=>{n.isRead||t.push(n.id)}),t},U4=(e,t,n)=>e.filter(r=>t.some(s=>{var a,c,l;return(l=(a=r[s])==null?void 0:a.toLowerCase())==null?void 0:l.includes((c=n==null?void 0:n.trim())==null?void 0:c.toLowerCase())})),Y4=(e,t,n)=>e.sort((r,s)=>n==="asc"?r[t].toLowerCase().localeCompare(s[t].toLowerCase()):s[t].toLowerCase().localeCompare(r[t].toLowerCase())),md=(e,t,n)=>e.slice((t-1)*n,t*n),gd=e=>{var r;const t=JSON.parse(localStorage.getItem("configuration")),n=((r=t==null?void 0:t.entities)==null?void 0:r.labelChannel)||"Channel";return e==="channel_name"?n:e.split("_").map(s=>s[0].toUpperCase()+s.substring(1)).join(" ")},Z4=e=>{const t=e.reduce((o,r)=>{const s=new Date(r==null?void 0:r.createdAt),a=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"long",year:"numeric"}).format(s);return o[a]||(o[a]=[]),o[a].push(r),o},{});return Object.fromEntries(Object.entries(t).sort(([o],[r])=>new Date(r)-new Date(o)))},J4=(e,t=20)=>(e==null?void 0:e.length)>t?`${e.slice(0,t)}...`:e,io={TOKEN:"token",USER:"user",SNOP:"snop",SELECTED_BU:"selected_business_unit",SETTINGS:"settings"},bd={BEARER:"Bearer",TENANT_ID:"tenant_id",BU_ID:"bu_id",SNOP_ID:"snop_id"},La={REFRESH:"refresh",CLOSE:"close"},q4=Object.values({"SKU Name":"sku_name",Node:"node","Channel Name":"channel_name"}),Tv=[10,25,50,100],Sv={MARK_ALL_READ:"MARK_ALL_READ"},K4=Tv.map(e=>({label:e,value:e})),vd=Va(io.SNOP),yd=Va(io.SELECTED_BU),xd=Va(io.USER),Q4=Va(io.SETTINGS),No={BU_IDS:yd==null?void 0:yd.business_unit_id,TOKEN:JSON.parse(W4.get(io.TOKEN)||null),TENANT_IDS:xd==null?void 0:xd.tenant_id,SNOP_IDS:vd==null?void 0:vd.snop_id,GRID_SETTINGS:Q4},$i={headers:{"Content-Type":"application/json",Authorization:`${bd.BEARER} ${No.TOKEN}`}},wv=ot.create({baseURL:pd.BASE_URL,axiosConfig:$i});wv.interceptors.request.use(function(e){return e},function(e){return Promise.reject(e)}),wv.interceptors.response.use(function(e){return e},function(e){return Promise.reject(e)});const _a={NOTIFICATION:"/notifications",SETTING:"/configuration/setting"},{TENANT_ID:e3,BU_ID:t3}=bd,{TENANT_IDS:n3,BU_IDS:o3}=No,$a=async({baseUrl:e,payload:t})=>{try{const n=`${e}${_a.SETTING}/v1?${e3}=${n3}&${t3}=${o3}`;return await ot.post(n,t,$i)}catch(n){return n}},r3=(e,t,n,o)=>{const[r,s]=P.useState({isOpen:!1,column:null}),a=(u,d)=>{s({isOpen:u.currentTarget,column:d})},c=()=>{s({isOpen:!1,column:null})};return{selectedColumn:r,handleMenuClick:a,handleClose:c,handleHideClick:async()=>{const u=e.map(p=>{var f;return p.id===((f=r==null?void 0:r.column)==null?void 0:f.id)?{...p,isHidden:!0}:p});t({type:ke.SET_GRID_DATA,payload:{visibleGridColumns:u}});let d=No.GRID_SETTINGS||{platform:{theme:"light"},grid:{}};d.grid=d.grid||{},d.grid[o]=u,localStorage.setItem(io.SETTINGS,JSON.stringify(d)),await $a({baseUrl:n,payload:d}),c()}}},i3=({columns:e,gridPath:t,baseUrl:n,isDefaultConfig:o})=>{var p,f;let{definitions:r,defaultUserSettings:s,labels:a}=e;if(!o){const g=(f=(p=No.GRID_SETTINGS)==null?void 0:p.grid)==null?void 0:f[t];s=g??s??a3({definitions:r}),(!g||!s)&&(async()=>{try{let m=No.GRID_SETTINGS||{platform:{theme:"light"},grid:{}};m.grid=m.grid||{},m.grid[t]=s,localStorage.setItem(io.SETTINGS,JSON.stringify(m)),await $a({baseUrl:n,payload:m})}catch(m){console.error(m)}})()}const c=s.reduce((g,m)=>(g[m.id]=m,g),{}),l=a.reduce((g,m)=>(g[m.id]=m,g),{}),u=[];for(const g of r){const{id:m}=g,h=c[m],b=l[m];let y={...g,...h,...b};u.push(y)}return u.sort((g,m)=>g.sequenceId-m.sequenceId)},s3=e=>e.sort((t,n)=>t.sequenceId-n.sequenceId),a3=({definitions:e})=>e.map((t,n)=>({id:t.id,key:t.key,sequenceId:n+1,isHidden:!1,style:{}})),Rv=({pagination:e})=>{const{selectedPage:t,rowPerPage:n,totalRecords:o,onPageChange:r,onPageSizeChange:s}=e,a=nt();return v.jsxs(ue,{sx:{display:"flex",p:"1rem 2rem"},children:[v.jsxs(ue,{sx:{zIndex:10,display:"flex",flexDirection:"row",gap:"0.5rem",width:"100%"},children:[v.jsx(ue,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:v.jsx(wt,{sx:{fontSize:"1.1rem",color:a.palette.primary.notifyTextColor},children:`Showing ${(t-1)*n+1} to ${t*n} of ${o} rows`})}),v.jsx(ue,{sx:{display:"flex",flexDirection:"row",gap:"0.5rem",justifyContent:"space-between"},children:v.jsx(ue,{sx:{display:"flex",flexDirection:"row",width:"5.2rem"},children:v.jsx(Qu,{options:K4,value:n,onChange:s})})}),v.jsx(ue,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:v.jsx(wt,{sx:{fontSize:"1.1rem",color:a.palette.primary.notifyTextColor},children:"records per page"})})]}),v.jsx(kc,{count:Math.ceil(o/n),page:t,onChange:(c,l)=>{r(l)},shape:"rounded",sx:{width:"100%","& .MuiPagination-ul":{width:"100%",display:"flex",justifyContent:"flex-end","& li:first-of-type":{border:`0.1rem solid ${a.palette.primary.notifyBorderColor}`,color:a.palette.primary.notifyActiveText,marginRight:"1.5rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex"},"& li:last-child":{border:`0.1rem solid ${a.palette.primary.notifyBorderColor}`,color:a.palette.primary.notifyActiveText,marginLeft:"1.5rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex"}},"& .MuiPaginationItem-root":{color:"#595959",fontSize:"1.1rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex","& .MuiSvgIcon-root":{fontSize:"2.2rem"}},"& .Mui-selected":{color:a.palette.primary.notifyActiveText,backgroundColor:`${a.palette.brandColor.paginationBc} !important`}}})]})};Rv.propTypes={pagination:i.object.isRequired};function Cd({isRenderCellContent:e,column:t,row:n}){const o=n[t.key];return v.jsx(v.Fragment,{children:e?v.jsx(ue,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},component:"label",children:t==null?void 0:t.cellRenderer(n)}):v.jsx(Pm,{title:(o==null?void 0:o.length)>20?o:"",arrow:!0,children:v.jsx(ue,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},component:"label",children:J4(o)})})})}Cd.propTypes={isRenderCellContent:i.bool,column:i.object,row:i.object};const Ov=({menuOpen:e,handleClose:t,onHideClick:n})=>{const o=nt();return v.jsx(Mc,{open:!!e,anchorEl:e,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:v.jsx(ue,{sx:{p:"0.4rem 1rem",backgroundColor:o.palette.primary.notifyBackground,border:`0.1rem solid ${o.palette.primary.notifyBorderColor}`,minHeight:"2.3rem",display:"flex",justifyContent:"center",alignItems:"center"},children:v.jsx(Zs,{onClick:n,sx:{textTransform:"none",fontSize:"1.1rem",p:0,minHeight:"unset",fontWeight:"500",color:o.palette.primary.notifyTextColor},children:"Hide Column"})})})};Ov.propTypes={menuOpen:i.object,handleClose:i.func,onHideClick:i.func};const l3=Y(Kh)(({theme:e})=>({"& .MuiPaper-root":{borderRadius:8,border:`1px solid ${e.palette.primary.notifyBorderColor}`,boxShadow:e.shadows[4],padding:"1rem 1rem 0rem 1rem",backgroundColor:e.palette.primary.notifyBackground}})),Dn=Y(wt)(({theme:e})=>({color:e.palette.primary.notifyTextColor})),c3=Y(Mm)(({theme:e})=>({width:28,height:16,padding:0,display:"flex","&:active":{"& .MuiSwitch-thumb":{width:15},"& .MuiSwitch-switchBase.Mui-checked":{transform:"translateX(9px)"}},"& .MuiSwitch-switchBase":{padding:2,"&.Mui-checked":{transform:"translateX(12px)",color:"#fff","& + .MuiSwitch-track":{opacity:1,backgroundColor:"#1890ff",...e.applyStyles("dark",{backgroundColor:"#177ddc"})}}},"& .MuiSwitch-thumb":{boxShadow:"0 2px 4px 0 rgb(0 35 11 / 20%)",width:12,height:12,borderRadius:6,transition:e.transitions.create(["width"],{duration:200})},"& .MuiSwitch-track":{borderRadius:16/2,opacity:1,backgroundColor:"rgba(0,0,0,.25)",boxSizing:"border-box",...e.applyStyles("dark",{backgroundColor:"rgba(255,255,255,.35)"})}})),u3=e=>{const{children:t,value:n,index:o,...r}=e;return v.jsx("div",{role:"tabpanel",hidden:n!==o,...r,children:n===o&&v.jsx(ue,{sx:{pl:"0.5rem",pb:"0.5rem"},children:t})})},d3=Y(Qs)(({theme:e})=>({color:e.palette.primary.notifyTextColor,padding:"0.6rem 0",fontSize:"0.9rem",fontWeight:500,"&::before, &::after":{borderColor:`${e.palette.primary.notifyBorderColor}!important`}})),p3=Y(vc)(({theme:e})=>({"& .MuiBadge-badge":{right:3.5,top:2.34,border:`0.1rem solid ${e.palette.primary.notifyBackground}`,padding:"0 1.3px",borderRadius:"50%",backgroundColor:"#D44E40",fontSize:"0.725rem",minWidth:"0.7rem",height:"0.7rem"}}));Y(Xm)(({theme:e})=>({"& .MuiInputBase-root":{height:"3.52rem"},"& .MuiFormLabel-root":{color:`${e.palette.primary.notifyBorderColor} !important`,fontSize:"1rem",marginTop:"0.4rem"},"& label.Mui-focused":{color:e.palette.primary.notifyTextColor},"& .MuiInput-underline:after":{borderBottomColor:e.palette.primary.notifyBorderColor,borderBottomWidth:"0.1rem"},"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"},"&:hover fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"},"&.Mui-focused fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"}}}));const f3=Y(Hm)(({theme:e})=>({"& .MuiTabs-indicator":{height:"0.1rem",backgroundColor:e.palette.primary.notifyActiveBorderColor}})),h3=Y(Nm)(({theme:e})=>({color:"gray","&.Mui-selected":{color:e.palette.primary.notifyActiveBorderColor,fontWeight:"bold"}})),Av=({sortKey:e,sortField:t,sortDir:n,handleSortClick:o})=>{const r=s=>v.jsx(Bs,{onClick:o,sx:{padding:"0.5rem"},children:v.jsx(ue,{component:"img",src:s})});return v.jsx(v.Fragment,{children:r(t===e?n==="asc"?mt.AscSort:mt.DescSort:mt.Unsort)})};Av.propTypes={sortKey:i.string.isRequired,sortField:i.string,sortDir:i.string,handleSortClick:i.func};function Pv({column:e,sort:t,handleMenuClick:n,isManageable:o}){const r=e==null?void 0:e.isMandatory,s=e==null?void 0:e.label,a=e==null?void 0:e.isSortable,c=t==null?void 0:t.sortField,l=t==null?void 0:t.sortDir,u=t==null?void 0:t.onSort;return v.jsxs(ue,{sx:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem"},children:[s,a&&v.jsx(Av,{sortKey:e==null?void 0:e.key,sortField:c,sortDir:l,handleSortClick:()=>u({column:e,sortDir:l,sortField:c})}),o&&!r&&v.jsx(Bs,{onClick:d=>n(d,e),sx:{padding:"0.5rem"},children:v.jsx(ue,{component:"img",src:mt.Menu})})]})}Pv.propTypes={column:i.object.isRequired,sort:i.object.isRequired,handleMenuClick:i.func,isManageable:i.bool};const m3=Y(_c)(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"table-cell",[`&.${Lc.head}`]:{color:e.palette.primary.notifyTextColor,backgroundColor:e.palette.primary.notifyBackground,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 1rem",borderTopLeftRadius:"1.4rem",borderTopRightRadius:"1.4rem",textAlign:"center"},[`&.${Lc.body}`]:{color:e.palette.primary.notifyTextColor,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 1rem",textAlign:"center"}}));function Gi({children:e,...t}){return v.jsx(m3,{...t,children:e})}Gi.propTypes={children:i.node};const g3=Y(gi)(()=>({"&:last-child td":{borderBottom:0}}));function Wi({children:e,...t}){return v.jsx(g3,{...t,children:e})}Wi.propTypes={children:i.node};function Mv({sort:e,data:t,pagination:n,columns:o,nested:r,baseUrl:s,gridPath:a}){var W;const c=nt(),{visibleGridColumns:l}=P.useContext(Sa),u=P.useContext(ji),{selectedColumn:d,handleMenuClick:p,handleClose:f,handleHideClick:g}=r3(l,u,s,a),m=o==null?void 0:o.isManageable,h=(t==null?void 0:t.length)>0,b=P.useRef(null),[y,T]=P.useState(null);let C=null;const I=s3(((W=r==null?void 0:r.column)==null?void 0:W.definitions)||[]),x=r==null?void 0:r.isNested,R=(r==null?void 0:r.data)||[],w=r==null?void 0:r.hashKey;if(!h)return v.jsx(Dn,{sx:{textAlign:"center"},children:fn.NRF});const O=(D,L)=>{T(L),D.dataTransfer.setData("colIndex",L)},M=D=>{D.preventDefault(),j(D)},N=async(D,L)=>{if(D.preventDefault(),clearInterval(C),y===null||y===L)return;const _=[...l];[_[y],_[L]]=[_[L],_[y]],u({type:ke.SET_GRID_DATA,payload:{visibleGridColumns:_}});let V=No.GRID_SETTINGS||{platform:{theme:"light"},grid:{}};V.grid=V.grid||{},V.grid[a]=_,localStorage.setItem(io.SETTINGS,JSON.stringify(V)),await $a({baseUrl:s,payload:V}),T(null)},j=D=>{const L=b.current,{left:_,right:V}=L.getBoundingClientRect(),$=50,k=D.clientX>V-$?1:D.clientX<_+$?-1:0;k!==0?(clearInterval(C),C=setInterval(()=>{L.scrollLeft+=k*10},50)):clearInterval(C)};return v.jsxs(v.Fragment,{children:[v.jsx(Dm,{ref:b,sx:{maxHeight:"100%",overflowX:"auto",whiteSpace:"nowrap"},children:v.jsxs(Fc,{stickyHeader:!0,sx:{backgroundColor:c.palette.primary.notifyBackground,border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,borderRadius:"1.4rem","& .MuiTableHead-root":{backgroundColor:c.palette.primary.notifyBackground}},children:[v.jsx($c,{children:v.jsx(Wi,{children:l.map((D,L)=>D!=null&&D.isHidden?null:v.jsx(Gi,{style:D==null?void 0:D.style,draggable:m,onDragStart:m?_=>O(_,L):void 0,onDragOver:m?M:void 0,onDrop:m?_=>N(_,L):void 0,children:v.jsx(Pv,{column:D,sort:e,handleMenuClick:p,isManageable:m})},L))})}),v.jsx(Vc,{children:t.map((D,L)=>{const _=D[w],V=R==null?void 0:R[_],$=(V==null?void 0:V.length)>0;return v.jsxs(v.Fragment,{children:[v.jsx(Wi,{children:l.map((k,H)=>k!=null&&k.isHidden?null:v.jsx(Gi,{style:k==null?void 0:k.style,children:v.jsx(Cd,{isRenderCellContent:!!(k!=null&&k.cellRenderer),column:k,row:D})},H))},L),x&&V&&v.jsx(v.Fragment,{children:$?V.map((k,H)=>v.jsx(Wi,{children:I.map((B,z)=>v.jsx(Gi,{style:B==null?void 0:B.style,children:v.jsx(Cd,{isRenderCellContent:!!(B!=null&&B.cellRenderer),column:B,row:k})},z))},H)):v.jsx(Wi,{children:v.jsx(Gi,{colSpan:I.length,children:v.jsx(Dn,{sx:{textAlign:"center"},children:fn.NRF})})})})]})})})]})}),n&&v.jsx(Rv,{pagination:n}),v.jsx(Ov,{menuOpen:d==null?void 0:d.isOpen,handleClose:f,onHideClick:g})]})}Mv.propTypes={sort:i.object,data:i.array,pagination:i.object,columns:i.object,nested:i.object};function Nv({tableProps:e,mergedColumns:t,gridPath:n,baseUrl:o}){const r=P.useContext(ji);return P.useEffect(()=>{r({type:ke.SET_GRID_DATA,payload:{visibleGridColumns:t}})},[t,r]),v.jsx(v.Fragment,{children:v.jsx(Mv,{...e,gridPath:n,baseUrl:o})})}Nv.propTypes={tableProps:i.object.isRequired,mergedColumns:i.array.isRequired};const b3=({styles:e,label:t,hasFooter:n=!1,showCheckBox:o=!1,options:r,defaultValue:s=!0,isMulti:a=!1,onChange:c})=>{var x,R;const l=nt(),[u,d]=P.useState(!1),p=P.useRef(null),f=P.useRef(null),[g,m]=P.useState("auto"),[h,b]=P.useState(s?(x=r==null?void 0:r[0])==null?void 0:x.label:"Select option"),[y,T]=P.useState(r||[]);((R=y==null?void 0:y.filter(w=>!(w!=null&&w.isMandatory)))==null?void 0:R.length)>7,P.useRef(null),P.useRef(null),P.useCallback(w=>{let O=[...y];O=O==null?void 0:O.map(M=>(M==null?void 0:M.key)===w?{...M,hidden:!M.hidden}:M),T(O),d(!0)},[y]),P.useCallback(()=>{},[y]);const C=()=>{},I=()=>{};return P.useEffect(()=>{const w=O=>{f.current&&!f.current.contains(O.target)&&d(!1)};return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}},[]),v.jsxs(ue,{ref:f,sx:{position:"relative",width:"100%",flexShrink:0},children:[v.jsx(ue,{sx:{cursor:"pointer",height:"3rem",width:"100%",position:"relative",zIndex:1}}),v.jsxs(yn.div,{style:{position:"relative",maxHeight:"3rem",position:"absolute",top:0,left:0,width:"100%",zIndex:1e3,border:`0.1rem solid ${l.palette.primary.notifyBorderColor}`,borderRadius:"0.7rem",color:l.palette.primary.notifyTextColor,backgroundColor:l.palette.primary.notifyBackground,overflow:"hidden"},animate:{maxHeight:u?"15rem":"3rem"},transition:{duration:.2,ease:"easeInOut"},children:[v.jsxs(ue,{sx:{padding:"0.65rem",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",gap:"0.5rem"},onClick:()=>d(!u),children:[v.jsx(ue,{component:"img",className:"select-icon",src:e==null?void 0:e.icon,sx:{cursor:"pointer"}}),v.jsx(wt,{ref:p,sx:{color:l.palette.primary.notifyTextColor,flex:1,fontSize:"1.1rem",whiteSpace:"nowrap"},children:t||h}),v.jsx(ue,{component:"img",className:"child",src:u?mt.ArrowSelectDown:mt.ArrowSelectUp,sx:{cursor:"pointer"}})]}),u&&v.jsx("hr",{style:{width:"100%",height:"0.1rem",backgroundColor:l.palette.primary.notifyBorderColor,border:"none",margin:"0rem"}}),v.jsx(Uc,{children:u&&v.jsx(yn.ul,{style:{listStyle:"none",padding:"0rem 1rem 0.8rem 1rem",margin:0,opacity:1,visibility:"visible",maxHeight:"10rem",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:`${l.palette.primary.notifyIconColor} transparent`},initial:{opacity:0},animate:{opacity:1},transition:{duration:.3,ease:"easeInOut"},children:r==null?void 0:r.map((w,O)=>v.jsxs("li",{style:{padding:o?"0.4rem 0":"0.2rem 0.4rem",cursor:"pointer",display:"flex",alignItems:"center",color:l.palette.primary.notifyTextColor,backgroundColor:l.palette.primary.notifyBackground,whiteSpace:"nowrap"},onClick:()=>{d(!1),c(w)},children:[o&&v.jsx(Js,{size:"medium",sx:{color:l.palette.primary.notifyIconColor,"&.Mui-checked":{color:l.palette.brandColor.orange},p:"0.2rem 0.5rem"},checked:!(w!=null&&w.isHidden)}),v.jsx(wt,{sx:{fontSize:"1.1rem"},children:w==null?void 0:w.label})]},O))})}),n&&u&&v.jsxs(yn.div,{style:{display:"flex",flexDirection:"row",padding:"0.5rem 1rem",justifyContent:"space-between",borderTop:`0.1rem solid ${l.palette.primary.notifyBorderColor}`,position:"sticky",bottom:0,opacity:1,visibility:"visible"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.3,ease:"easeInOut"},children:[v.jsx(yn.button,{onClick:C,style:{textTransform:"none",padding:"0.4rem",background:"transparent",color:l.palette.primary.notifyTextColor,fontSize:"1.1rem",border:"none",cursor:"pointer"},children:"Apply"}),v.jsx(yn.button,{onClick:I,style:{textTransform:"none",padding:"0.4rem",background:"transparent",color:l.palette.primary.notifyTextColor,fontSize:"1.1rem",border:"none",cursor:"pointer"},children:"Cancel"})]})]})]})},v3=e=>{if(!e)return null;const{subAction:t,...n}=e,o=t?"select":"button",r={button:s=>v.jsx(Ir,{...s}),select:s=>v.jsx(b3,{...s})};return r[o]?r[o](n):null},y3=({presentSetting:e,gridSetting:t,gridPath:n})=>{if(!n)return e;let o=(e==null?void 0:e.grid)||{};const r=t==null?void 0:t.map(({id:s,isHidden:a,isSortable:c,key:l,sequenceId:u})=>({id:s,isHidden:a,isSortable:c,key:l,sequenceId:u}));return o[n]=r,e.grid=o,{settingObject:e,defaultUserSettings:r}},x3=async({baseUrl:e,gridSetting:t,gridPath:n})=>{try{const o=JSON.parse(localStorage.getItem("settings")),{settingObject:r,defaultUserSettings:s}=y3({presentSetting:o,gridSetting:t,gridPath:n});return localStorage.setItem("settings",JSON.stringify(r)),await $a({baseUrl:e,payload:r}),s}catch(o){console.error(o)}},C3=({...e})=>{const[t,n]=P.useState(!1),o=nt();return v.jsx(yn.input,{type:"text",onFocus:()=>n(!0),onBlur:()=>n(!1),initial:{width:"10rem",borderRadius:"0.7rem"},animate:{width:t?"13rem":"10rem"},transition:{duration:.3,ease:"easeInOut"},style:{height:"3rem",outline:"none",boxShadow:"none",fontSize:"1.1rem",border:`0.1rem solid ${o.palette.primary.notifyBorderColor}`,backgroundColor:o.palette.primary.notifyBackground,padding:"0rem 1rem",color:o.palette.primary.notifyTextColor,transition:"height 0.1s ease"},...e})};function kv({...e}){return v.jsx(Io,{children:v.jsx(C3,{...e})})}const E3=({customTools:e})=>({sortedTools:e==null?void 0:e.sort((n,o)=>n.sequenceId-o.sequenceId)}),Bv=({customTools:e})=>{const{sortedTools:t}=E3({customTools:e}),[n,o]=P.useState(!1),r=(t==null?void 0:t.length)>3,c=r?Math.min(t.length,3.37)*45+20:"auto";return v.jsxs(v.Fragment,{children:[n&&v.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:998}}),v.jsx(yn.div,{className:"custom-tools-container",initial:{width:c!=="auto"?`${c/10}rem`:c},animate:r&&{width:n?"100%":`${c/10}rem`},transition:{duration:.4,ease:"easeInOut"},style:{height:"3rem",outline:"none",overflow:"hidden",display:"flex",alignItems:"center",gap:"0.5rem",whiteSpace:"nowrap",borderTopRightRadius:"0.8rem",borderBottomRightRadius:"0.8rem",zIndex:999,pointerEvents:n||!r?"auto":"none",boxShadow:"rgba(0, 0, 0, 0.95) -2px 0px 3px -3px inset"},layout:!0,children:t==null?void 0:t.map(l=>v.jsx(ue,{sx:{flexShrink:0,minWidth:"fit-content"},children:v3(l)},l.id))}),r&&v.jsx(ue,{sx:{zIndex:1e3,pointerEvents:"auto"},children:v.jsx(Ir,{label:n?"":"More Actions",styles:{icon:n?mt.Cross:mt.More},onClick:()=>o(l=>!l)})})]})};Bv.propTypes={customTools:i.array.isRequired};const Dv=({defaultTools:e,isManageable:t,customTools:n,baseUrl:o,gridPath:r})=>{var d,p,f,g,m,h,b;const s=P.useContext(ji),{visibleGridColumns:a,triggerApi:c}=P.useContext(Sa),l=async y=>{try{await x3({baseUrl:o,gridPath:r,gridSetting:y})}catch(T){console.error(T)}finally{s({type:ke.HAS_SETTING_CHANGE,payload:{hasChange:!1}}),s({type:ke.TRIGGER_API,payload:{triggerApi:!1}})}};P.useEffect(()=>{c&&l(a)},[c]);const u=y=>{const T=[...a].map(C=>C.id===(y==null?void 0:y.id)?{...C,isHidden:!C.isHidden}:C);s({type:ke.SET_GRID_DATA,payload:{visibleGridColumns:T}}),s({type:ke.HAS_SETTING_CHANGE,payload:{hasChange:!0}})};return v.jsxs(ue,{sx:{margin:"1rem 0",position:"relative",zIndex:10,display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"0.5rem",width:"100%"},children:[v.jsxs(ue,{sx:{display:"flex",flexDirection:"row",gap:"0.5rem"},children:[((d=e==null?void 0:e.search)==null?void 0:d.isRequired)&&v.jsx(kv,{...e==null?void 0:e.search}),((p=e==null?void 0:e.refresh)==null?void 0:p.isRequired)&&v.jsx(Ir,{...e==null?void 0:e.refresh,styles:{...(f=e==null?void 0:e.refresh)==null?void 0:f.styles,icon:mt.Refresh}}),t&&v.jsx(ue,{sx:{width:"12rem"},children:v.jsx(Qu,{placeholder:"Manage Columns",options:a,value:a,isMulti:!0,showCheckBox:!0,isDraggable:!0,handleCheck:y=>{var T;return!((T=a==null?void 0:a.find(C=>C.id===y.id))!=null&&T.isHidden)},onChange:(y,T)=>u(y)})})]}),v.jsxs(ue,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",gap:"0.6rem"},children:[v.jsx(Bv,{customTools:n}),((g=e==null?void 0:e.upload)==null?void 0:g.isRequired)&&v.jsx(Ir,{...e==null?void 0:e.upload,styles:{...(m=e==null?void 0:e.upload)==null?void 0:m.styles,icon:mt.Upload,color:"secondary",isAnimate:!0}}),((h=e==null?void 0:e.download)==null?void 0:h.isRequired)&&v.jsx(Ir,{...e==null?void 0:e.download,styles:{...(b=e==null?void 0:e.download)==null?void 0:b.styles,icon:mt.Download,isAnimate:!0}})]})]})};Dv.propTypes={defaultTools:i.object.isRequired,customTools:i.array,isManageable:i.bool,baseUrl:i.string,gridPath:i.gridPath};function jv({tableProps:e,toolbarProps:t,isDefaultConfig:n}){var a;const o=(a=e.columns)==null?void 0:a.isManageable,{columns:r}=e,s=i3({columns:r,gridPath:(t==null?void 0:t.gridPath)||"",baseUrl:(t==null?void 0:t.baseUrl)||"",isDefaultConfig:n});return v.jsxs($0,{children:[t&&v.jsx(Dv,{...t,isManageable:o}),v.jsx(Nv,{tableProps:e,mergedColumns:s,gridPath:(t==null?void 0:t.gridPath)||"",baseUrl:(t==null?void 0:t.baseUrl)||""})]})}jv.propTypes={tableProps:i.object.isRequired,toolbarProps:i.object,isDefaultConfig:i.bool};const Fv=({list:e,handleLinkClick:t})=>{const n=nt(),o=({list:r})=>{var s;return(s=r==null?void 0:r.sort((a,c)=>a.order-c.order))==null?void 0:s.map((a,c)=>a!=null&&a.link?v.jsx(Ac,{component:"h3",sx:{fontSize:"1rem",cursor:"pointer",color:c===(r==null?void 0:r.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},href:a==null?void 0:a.link,underline:"hover",onClick:()=>t(a),children:a==null?void 0:a.title},c):v.jsx(wt,{component:"h3",sx:{fontSize:"1rem",color:c===(r==null?void 0:r.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},children:a==null?void 0:a.title},c))};return v.jsx($h,{separator:v.jsx(ue,{component:"img",src:mt.ArrowRight}),children:o({list:e})})};Fv.propTypes={list:i.array.isRequired,handleLinkClick:i.func};const I3=Y(ue)(({theme:e})=>({borderRadius:"0.4rem",position:"relative",background:e.palette.primary.notifyButtonBackground,display:"flex"})),T3=Y(ue)(({theme:e})=>({borderRadius:"0.4rem",position:"absolute",background:e.palette.primary.notifyBackground,border:`0.1rem solid ${e.palette.primary.notifyBorderColor}`,transition:"all 0.5s ease"})),Vv=Y(Zs)(({theme:e})=>({borderRadius:"0.4rem",fontWeight:"400",transition:"all 0.2s 0.1s ease",padding:"0.4rem 0.8rem",fontSize:"1rem",textTransform:"none",zIndex:1,"&:hover":{background:"transparent",boxShadow:"none"}})),S3=({isChartType:e,setIsChartType:t})=>v.jsx(ue,{sx:{display:"flex"},children:v.jsxs(I3,{children:[v.jsx(T3,{sx:{width:e?"6rem":"8rem",height:"2.35rem",transform:`translateX(${e?0:"6rem"})`}}),v.jsx(Vv,{disableRipple:!0,sx:{color:n=>e?n.palette.primary.notifyActiveText:n.palette.brandColor.grey1},onClick:()=>t(!0),children:"Table only"}),v.jsx(Vv,{disableRipple:!0,sx:{color:n=>e?n.palette.brandColor.grey1:n.palette.primary.notifyActiveText},onClick:()=>t(!1),children:"Table with charts"})]})}),Lv=({breadcrumbProps:e,switchProps:t})=>{const n=nt();return v.jsxs(cn,{sx:{background:n.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${n.palette.primary.notifyBorderColor}`,height:"3rem",p:"0 1.4rem",zIndex:4,position:"relative"},direction:"row",justifyContent:"space-between",alignItems:"center",children:[v.jsx(Fv,{...e}),t&&v.jsx(S3,{...t})]})};Lv.propTypes={breadcrumbProps:i.object.isRequired,switchProps:i.object};function _v({headerProps:e}){return v.jsx(Io,{children:v.jsx(Lv,{...e})})}_v.propTypes={headerProps:i.object.isRequired};const Ed=P.createContext(null),$v=P.createContext(null);function w3({children:e}){const[t,n]=P.useReducer(R3,O3);return v.jsx(Ed.Provider,{value:t,children:v.jsx($v.Provider,{value:n,children:e})})}function R3(e,t){var n;switch(t.type){case ke.LOADING:return{...e,loading:t.loading};case ke.SUCCESS:return{...e,data:(n=t.data)==null?void 0:n.sort((o,r)=>new Date(r.createdAt)-new Date(o.createdAt))};case ke.MARK_ALL_AS_READ:return{...e,isMarkAllAsRead:t.isMarkAllAsRead};case ke.ERROR:return{...e,error:t.error};default:throw new Error(`${fn.UNHANDLED}: ${t}`)}}const O3={loading:!1,data:[],error:"",isMarkAllAsRead:{count:0,boo:!1}},{TENANT_ID:Id,BU_ID:Td,SNOP_ID:Gv}=bd,{TENANT_IDS:Sd,BU_IDS:wd}=No,A3=async e=>{try{const t=`${e}${_a.NOTIFICATION}/v1?${Id}=${Sd}&${Td}=${wd}`;return await ot.get(t,$i)}catch(t){return t}},Wv=async(e,t,n)=>{try{const o=n===Sv.MARK_ALL_READ?"":`&${Gv}=${n}&`,r=`${e}${_a.NOTIFICATION}${pd.VERSION}?${Id}=${Sd}&${Td}=${wd}${o}`;return await ot.put(r,t,$i)}catch(o){return o}},P3=async({baseUrl:e,id:t,snopId:n})=>{try{const o=`${e}${_a.NOTIFICATION}${pd.VERSION}?${Id}=${Sd}&${Td}=${wd}&${Gv}=${n}&id=${t}`;return await ot.get(o,$i)}catch(o){return o}},Ga={OK:200,CREATED:201,NO_CONTENT:204,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,INTERNAL_SERVER_ERROR:500};var zv,Hv,Xv,Uv;function Rd(){return Rd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Rd.apply(null,arguments)}var M3=function(t){return S.createElement("svg",Rd({xmlns:"http://www.w3.org/2000/svg",width:16,height:18,fill:"none"},t),zv||(zv=S.createElement("path",{stroke:"#666D80",strokeLinecap:"round",strokeMiterlimit:10,d:"M8.013 3.44c-2.206 0-4 1.793-4 4v1.927c0 .406-.173 1.026-.38 1.373l-.766 1.273c-.474.787-.147 1.66.72 1.954 2.873.96 5.973.96 8.846 0a1.335 1.335 0 0 0 .72-1.954l-.766-1.273c-.2-.347-.374-.967-.374-1.373V7.44c0-2.2-1.8-4-4-4Z"})),Hv||(Hv=S.createElement("path",{stroke:"#666D80",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,d:"M9.247 3.633a4.503 4.503 0 0 0-2.467 0 1.324 1.324 0 0 1 2.467 0"})),Xv||(Xv=S.createElement("path",{stroke:"#666D80",strokeMiterlimit:10,d:"M10.014 14.207c0 1.1-.9 2-2 2a2.007 2.007 0 0 1-2-2"})),Uv||(Uv=S.createElement("circle",{cx:12.266,cy:3,r:2.5,fill:"#E85353",stroke:"#F8FAFB"})))};const N3=({count:e})=>(nt(),v.jsxs(v.Fragment,{children:[v.jsx(ue,{sx:{gap:"0.5rem",display:"flex",justifyContent:"center",alignItems:"center"},className:"notify-icon-container",children:v.jsx(M3,{style:{scale:2}})}),v.jsx(p3,{badgeContent:e==0?"":null,color:"error"})]}));var Yv;function Od(){return Od=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Od.apply(null,arguments)}var k3=function(t){return S.createElement("svg",Od({xmlns:"http://www.w3.org/2000/svg",width:13,height:8,fill:"none"},t),Yv||(Yv=S.createElement("path",{fill:"#A8A8A8",fillRule:"evenodd",d:"M8.954 1.004a.406.406 0 0 1 0 .575L3.537 6.996a.406.406 0 0 1-.574 0L.796 4.829a.406.406 0 1 1 .575-.575l1.879 1.88 5.13-5.13a.406.406 0 0 1 .574 0m3.25 0a.406.406 0 0 1 0 .575L6.787 6.996a.406.406 0 1 1-.574-.575l5.416-5.417a.406.406 0 0 1 .575 0",clipRule:"evenodd"})))};const Zv=({title:e,subTitle:t,children:n,onRefresh:o,onClose:r,loading:s,handleShowAll:a,handleMarkAllAsRead:c,isMarkAllAsRead:l,width:u,headerIconType:d,isDialogActionShow:p,className:f,dialogType:g,data:m,toggleNotify:h,mode:b,isDetail:y=!1,...T})=>{var O,M;const[C,I]=P.useState(0),x=nt(),R=(N,j)=>{I(j)},w=()=>{switch(d){case La.REFRESH:return v.jsx(ue,{component:"img",src:mt.Refresh,alt:"refresh",onClick:o,sx:{cursor:"pointer"}});case La.CLOSE:return v.jsx(ue,{component:"img",src:mt.Close,alt:"refresh",onClick:r,sx:{cursor:"pointer"}});default:return null}};return v.jsxs(l3,{maxWidth:y?"xs":"md",onClose:r,...T,className:["notification-dialog",f,g==="notifcation-dialog"?"notification-main-box":""].join(" "),dialogType:!0,children:[v.jsxs(ue,{sx:g==="notifcation-dialog"?{gap:1,display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"}:{gap:1,display:"flex",width:"100%",justifyContent:"space-between",paddingBottom:1.2},children:[v.jsxs(ue,{className:"title-container",children:[v.jsx(Dn,{variant:"h6",component:"h6",className:"title",children:e}),t&&v.jsx(Dn,{variant:"h6",className:"title sub-title",children:t})]}),w()]}),y?v.jsx(v.Fragment,{children:n}):v.jsxs(v.Fragment,{children:[v.jsx(ue,{sx:{borderBottom:1,borderColor:x.palette.primary.notifyBorderColor},className:"tab-panel",children:v.jsx(f3,{value:C,onChange:R,children:v.jsx(h3,{label:v.jsxs(ue,{sx:{display:"flex",alignItems:"center",fontSize:"1rem"},children:["All (",v.jsx(wt,{component:"span",sx:{fontWeight:"bold"},children:((O=m==null?void 0:m.filter(N=>!(N!=null&&N.isRead)))==null?void 0:O.length)||0}),")"]})})})}),v.jsx(u3,{value:C,index:0,children:n})]}),p&&v.jsxs(Tc,{className:"dialog-action",sx:{px:"1rem"},children:[v.jsxs(cn,{direction:"row",gap:1,children:[v.jsx(Dn,{sx:{fontSize:"0.9rem"},children:"Only show unread"}),v.jsx(c3,{disabled:s,checked:b,onChange:h})]}),v.jsx(Zs,{variant:"outlined",className:"view-all",onClick:c,startIcon:v.jsx(k3,{}),disabled:!((M=m==null?void 0:m.filter(N=>!(N!=null&&N.isRead)))!=null&&M.length),style:{backgroundColor:"transparent"},sx:{p:0,color:x.palette.primary.notifyTextColor},children:"Mark all as read"})]})]})};var Jv,qv;function Ad(){return Ad=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ad.apply(null,arguments)}var B3=function(t){return S.createElement("svg",Ad({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},t),Jv||(Jv=S.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M7.79 6c0 .99-.8 1.79-1.79 1.79S4.21 6.99 4.21 6 5.01 4.21 6 4.21s1.79.8 1.79 1.79"})),qv||(qv=S.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M6 10.135c1.765 0 3.41-1.04 4.555-2.84.45-.705.45-1.89 0-2.595C9.41 2.9 7.765 1.86 6 1.86S2.59 2.9 1.445 4.7c-.45.705-.45 1.89 0 2.595 1.145 1.8 2.79 2.84 4.555 2.84"})))},Kv;function Pd(){return Pd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Pd.apply(null,arguments)}var D3=function(t){return S.createElement("svg",Pd({xmlns:"http://www.w3.org/2000/svg",width:9,height:8,fill:"none"},t),Kv||(Kv=S.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M8.277 1.004a.406.406 0 0 1 0 .575L2.86 6.996a.406.406 0 0 1-.574 0L.119 4.829a.406.406 0 1 1 .575-.575l1.879 1.88 5.13-5.13a.406.406 0 0 1 .574 0",clipRule:"evenodd"})))};const Qv=({type:e,title:t,isRead:n,handleShowDetails:o,handleRead:r,isCheckBox:s,selectedAlert:a,id:c,handleCheckboxChange:l,clickId:u,product:d,createdAt:p,isShowVisible:f})=>{var h,b;const g=nt(),m=(b=(h=JSON.parse(localStorage.getItem("settings")))==null?void 0:h.platform)==null?void 0:b.theme;return v.jsxs(ue,{className:"cards",children:[v.jsxs(cn,{display:"flex",flexDirection:"row",alignItems:"start",justifyContent:"space-between",gap:1,children:[s&&v.jsx(Js,{checked:!!a.includes(c),onChange:y=>l(y,c),disabled:n,sx:{padding:"4px 7px 0 7px"}}),v.jsx(vc,{sx:{"& .MuiBadge-badge":{backgroundColor:"#6041EA"}},variant:"dot",className:"badge",invisible:n,children:v.jsx(Dn,{sx:{color:g.palette.primary.notifyActiveText},component:"p",className:["title-card",n&&"read"].join(" "),children:t})})]}),v.jsxs(cn,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:[v.jsxs(cn,{display:"flex",flexDirection:"row",justifyContent:"start",gap:1,sx:{p:"0.5rem 0"},children:[f&&v.jsx(fc,{icon:v.jsx(B3,{className:`${m==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:u,onClick:o,label:u===c?v.jsx(si,{color:"primary",size:13}):"Show Details",component:"button",variant:"filled",clickable:!0,size:"small",sx:{height:"2rem",fontWeight:"300",fontSize:"0.9rem",color:g.palette.primary.notifyActiveText,borderColor:g.palette.primary.notifyBorderColor,background:g.palette.primary.notifyButtonBackground,borderRadius:"0.6rem",padding:"0.2rem"}}),!n&&v.jsx(fc,{icon:v.jsx(D3,{className:`${m==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:u,onClick:r,label:"Acknowledge",component:"button",variant:"outlined",clickable:!0,size:"small",sx:{height:"2rem",fontSize:"0.9rem",fontWeight:"300",borderColor:g.palette.primary.notifyBorderColor,color:g.palette.primary.notifyActiveText,borderRadius:"0.6rem",padding:"0.2rem"}})]}),v.jsxs(cn,{display:"flex",justifyContent:"space-between",flexDirection:"row",alignItems:"center",gap:.35,children:[v.jsx(Dn,{sx:{fontSize:"0.9rem"},children:d}),v.jsx(Dn,{color:g.palette.primary.notifyTextColor,children:"•"}),v.jsx(Dn,{sx:{fontSize:"0.9rem"},children:z4(p)})]})]})]})};Qv.propTypes={type:i.string,title:i.string,subTitle:i.string,isRead:i.bool,handleShowDetails:i.func,handleRead:i.func};const ey=({data:e,handleRead:t,handleShowDetails:n,clickId:o,mode:r,page:s,setPage:a})=>{const{isMarkAllAsRead:c}=P.useContext(Ed),l=new Date,u=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"long",year:"numeric"}).format(l),[d,p]=P.useState([]),[f,g]=P.useState(!1),[m,h]=P.useState(!0),b=P.useRef(null),y=nt();return P.useEffect(()=>{p([...e])},[e]),P.useEffect(()=>{const T=new IntersectionObserver(C=>{C[0].isIntersecting&&!f&&m&&a(I=>I+1)},{threshold:1});return b.current&&T.observe(b.current),()=>{b.current&&T.unobserve(b.current)}},[f,m]),v.jsxs(ue,{sx:d.length?{py:"0.5rem"}:{py:"0.5rem",justifyContent:"center",alignItems:"center",display:"flex",height:"100%"},children:[Object.entries(Z4(d)).map(([T,C])=>v.jsxs(P.Fragment,{children:[T!==u&&v.jsx(d3,{children:T}),C.map((I,x)=>v.jsx(Qv,{type:"success",title:I.message,subTitle:I.createdAt,isRead:I.isRead,handleShowDetails:()=>n(I.id,I.snopId),handleRead:()=>t([I.id],I.snopId),clickId:o,id:I.id,product:I.product,createdAt:I.createdAt,isShowVisible:I==null?void 0:I.isNotificationDetails},I.id||x))]},T)),f&&s>1&&!!(d!=null&&d.length)&&v.jsx(ue,{sx:{display:"flex",justifyContent:"center",alignItems:"center",pl:"0.5rem",py:"0.3rem"},children:v.jsx(si,{size:20,className:"circular-loader"})}),!(d!=null&&d.length)&&v.jsx(wt,{sx:{fontSize:"1.1rem",color:y.palette.primary.notifyTextColor,textAlign:"center",px:"0.8rem"},children:"You don't have any unread notification here. Use the toggle to switch between read and unread notification."}),v.jsx(ue,{ref:b,style:{height:"0.1rem",backgroundColor:"transparent"}})]})};ey.propTypes={data:i.array,handleRead:i.func,handleShowDetails:i.func};function zi(e,t,n){return(t=kf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ty(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function ve(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ty(Object(n),!0).forEach(function(o){zi(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ty(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function j3(e){if(Array.isArray(e))return e}function F3(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,r,s,a,c=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=s.call(n)).done)&&(c.push(o.value),c.length!==t);l=!0);}catch(d){u=!0,r=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return c}}function Md(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function ny(e,t){if(e){if(typeof e=="string")return Md(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Md(e,t):void 0}}function V3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
253
+ `+s):o.stack=s}catch{}}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Po(this.defaults,n);const{transitional:o,paramsSerializer:r,headers:s}=n;o!==void 0&&ja.assertOptions(o,{silentJSONParsing:Bn.transitional(Bn.boolean),forcedJSONParsing:Bn.transitional(Bn.boolean),clarifyTimeoutError:Bn.transitional(Bn.boolean)},!1),r!=null&&(G.isFunction(r)?n.paramsSerializer={serialize:r}:ja.assertOptions(r,{encode:Bn.function,serialize:Bn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ja.assertOptions(n,{baseUrl:Bn.spelling("baseURL"),withXsrfToken:Bn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&G.merge(s.common,s[n.method]);s&&G.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),n.headers=zt.concat(a,s);const c=[];let l=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(l=l&&h.synchronous,c.unshift(h.fulfilled,h.rejected))});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let d,p=0,f;if(!l){const m=[xv.bind(this),void 0];for(m.unshift.apply(m,c),m.push.apply(m,u),f=m.length,d=Promise.resolve(n);p<f;)d=d.then(m[p++],m[p++]);return d}f=c.length;let g=n;for(p=0;p<f;){const m=c[p++],h=c[p++];try{g=m(g)}catch(b){h.call(this,b);break}}try{d=xv.call(this,g)}catch(m){return Promise.reject(m)}for(p=0,f=u.length;p<f;)d=d.then(u[p++],u[p++]);return d}getUri(t){t=Po(this.defaults,t);const n=dv(t.baseURL,t.url,t.allowAbsoluteUrls);return nv(n,t.params,t.paramsSerializer)}};G.forEach(["delete","get","head","options"],function(t){Mo.prototype[t]=function(n,o){return this.request(Po(o||{},{method:t,url:n,data:(o||{}).data}))}}),G.forEach(["post","put","patch"],function(t){function n(o){return function(s,a,c){return this.request(Po(c||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Mo.prototype[t]=n(),Mo.prototype[t+"Form"]=n(!0)});let L4=class tx{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const o=this;this.promise.then(r=>{if(!o._listeners)return;let s=o._listeners.length;for(;s-- >0;)o._listeners[s](r);o._listeners=null}),this.promise.then=r=>{let s;const a=new Promise(c=>{o.subscribe(c),s=c}).then(r);return a.cancel=function(){o.unsubscribe(s)},a},t(function(s,a,c){o.reason||(o.reason=new Sr(s,a,c),n(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=o=>{t.abort(o)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new tx(function(r){t=r}),cancel:t}}};function _4(e){return function(n){return e.apply(null,n)}}function $4(e){return G.isObject(e)&&e.isAxiosError===!0}const dd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(dd).forEach(([e,t])=>{dd[t]=e});function Iv(e){const t=new Mo(e),n=G0(Mo.prototype.request,t);return G.extend(n,Mo.prototype,t,{allOwnKeys:!0}),G.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Iv(Po(e,r))},n}const ot=Iv(Li);ot.Axios=Mo,ot.CanceledError=Sr,ot.CancelToken=L4,ot.isCancel=av,ot.VERSION=Cv,ot.toFormData=Pa,ot.AxiosError=we,ot.Cancel=ot.CanceledError,ot.all=function(t){return Promise.all(t)},ot.spread=_4,ot.isAxiosError=$4,ot.mergeConfig=Po,ot.AxiosHeaders=zt,ot.formToJSON=e=>iv(G.isHTMLForm(e)?new FormData(e):e),ot.getAdapter=yv.getAdapter,ot.HttpStatusCode=dd,ot.default=ot;const{Axios:m9,AxiosError:g9,CanceledError:b9,isCancel:v9,CancelToken:y9,VERSION:x9,all:C9,Cancel:E9,isAxiosError:I9,spread:T9,toFormData:S9,AxiosHeaders:w9,HttpStatusCode:R9,formToJSON:O9,getAdapter:A9,mergeConfig:P9}=ot,pd={BASE_URL:"https://qa.3sc.ai/api",VERSION:"/v1"};/*! js-cookie v3.0.5 | MIT */function Fa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var G4={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function fd(e,t){function n(r,s,a){if(!(typeof document>"u")){a=Fa({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var l in a)a[l]&&(c+="; "+l,a[l]!==!0&&(c+="="+a[l].split(";")[0]));return document.cookie=r+"="+e.write(s,r)+c}}function o(r){if(!(typeof document>"u"||arguments.length&&!r)){for(var s=document.cookie?document.cookie.split("; "):[],a={},c=0;c<s.length;c++){var l=s[c].split("="),u=l.slice(1).join("=");try{var d=decodeURIComponent(l[0]);if(a[d]=e.read(u,d),r===d)break}catch{}}return r?a[r]:a}}return Object.create({set:n,get:o,remove:function(r,s){n(r,"",Fa({},s,{expires:-1}))},withAttributes:function(r){return fd(this.converter,Fa({},this.attributes,r))},withConverter:function(r){return fd(Fa({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var W4=fd(G4,{path:"/"});const Va=e=>{const t=localStorage.getItem(e);return t?JSON.parse(t):""},z4=e=>{const t=new Date,n=new Date(e);let o=t-n;o<0&&(o=0);const r=Math.floor(o/1e3),s=Math.floor(r/60);return r<60?`${r} sec ago`:s<60?`${s} min ago`:n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0})},hd=e=>e.sort((n,o)=>{let r=new Date(n.createdAt),s=new Date(o.createdAt);return r===s?0:r>s?-1:1}).sort((n,o)=>n.isRead===o.isRead?0:o.isRead?-1:1),H4=e=>{let t=0;for(let n=0;n<e.length;n++)e[n].isRead||t++;return t},X4=e=>{const t=[];return e.forEach(n=>{n.isRead||t.push(n.id)}),t},U4=(e,t,n)=>e.filter(r=>t.some(s=>{var a,c,l;return(l=(a=r[s])==null?void 0:a.toLowerCase())==null?void 0:l.includes((c=n==null?void 0:n.trim())==null?void 0:c.toLowerCase())})),Y4=(e,t,n)=>e.sort((r,s)=>n==="asc"?r[t].toLowerCase().localeCompare(s[t].toLowerCase()):s[t].toLowerCase().localeCompare(r[t].toLowerCase())),md=(e,t,n)=>e.slice((t-1)*n,t*n),gd=e=>{var r;const t=JSON.parse(localStorage.getItem("configuration")),n=((r=t==null?void 0:t.entities)==null?void 0:r.labelChannel)||"Channel";return e==="channel_name"?n:e.split("_").map(s=>s[0].toUpperCase()+s.substring(1)).join(" ")},Z4=e=>{const t=e.reduce((o,r)=>{const s=new Date(r==null?void 0:r.createdAt),a=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"long",year:"numeric"}).format(s);return o[a]||(o[a]=[]),o[a].push(r),o},{});return Object.fromEntries(Object.entries(t).sort(([o],[r])=>new Date(r)-new Date(o)))},J4=(e,t=20)=>(e==null?void 0:e.length)>t?`${e.slice(0,t)}...`:e,io={TOKEN:"token",USER:"user",SNOP:"snop",SELECTED_BU:"selected_business_unit",SETTINGS:"settings"},bd={BEARER:"Bearer",TENANT_ID:"tenant_id",BU_ID:"bu_id",SNOP_ID:"snop_id"},La={REFRESH:"refresh",CLOSE:"close"},q4=Object.values({"SKU Name":"sku_name",Node:"node","Channel Name":"channel_name"}),Tv=[10,25,50,100],Sv={MARK_ALL_READ:"MARK_ALL_READ"},K4=Tv.map(e=>({label:e,value:e})),vd=Va(io.SNOP),yd=Va(io.SELECTED_BU),xd=Va(io.USER),Q4=Va(io.SETTINGS),No={BU_IDS:yd==null?void 0:yd.business_unit_id,TOKEN:JSON.parse(W4.get(io.TOKEN)||null),TENANT_IDS:xd==null?void 0:xd.tenant_id,SNOP_IDS:vd==null?void 0:vd.snop_id,GRID_SETTINGS:Q4},$i={headers:{"Content-Type":"application/json",Authorization:`${bd.BEARER} ${No.TOKEN}`}},wv=ot.create({baseURL:pd.BASE_URL,axiosConfig:$i});wv.interceptors.request.use(function(e){return e},function(e){return Promise.reject(e)}),wv.interceptors.response.use(function(e){return e},function(e){return Promise.reject(e)});const _a={NOTIFICATION:"/notifications",SETTING:"/configuration/setting"},{TENANT_ID:e3,BU_ID:t3}=bd,{TENANT_IDS:n3,BU_IDS:o3}=No,$a=async({baseUrl:e,payload:t})=>{try{const n=`${e}${_a.SETTING}/v1?${e3}=${n3}&${t3}=${o3}`;return await ot.post(n,t,$i)}catch(n){return n}},r3=(e,t,n,o)=>{const[r,s]=P.useState({isOpen:!1,column:null}),a=(u,d)=>{s({isOpen:u.currentTarget,column:d})},c=()=>{s({isOpen:!1,column:null})};return{selectedColumn:r,handleMenuClick:a,handleClose:c,handleHideClick:async()=>{const u=e.map(p=>{var f;return p.id===((f=r==null?void 0:r.column)==null?void 0:f.id)?{...p,isHidden:!0}:p});t({type:ke.SET_GRID_DATA,payload:{visibleGridColumns:u}});let d=No.GRID_SETTINGS||{platform:{theme:"light"},grid:{}};d.grid=d.grid||{},d.grid[o]=u,localStorage.setItem(io.SETTINGS,JSON.stringify(d)),await $a({baseUrl:n,payload:d}),c()}}},i3=({columns:e,gridPath:t,baseUrl:n,isDefaultConfig:o})=>{var p,f;let{definitions:r,defaultUserSettings:s,labels:a}=e;if(!o){const g=(f=(p=No.GRID_SETTINGS)==null?void 0:p.grid)==null?void 0:f[t];s=g??s??a3({definitions:r}),(!g||!s)&&(async()=>{try{let m=No.GRID_SETTINGS||{platform:{theme:"light"},grid:{}};m.grid=m.grid||{},m.grid[t]=s,localStorage.setItem(io.SETTINGS,JSON.stringify(m)),await $a({baseUrl:n,payload:m})}catch(m){console.error(m)}})()}const c=s.reduce((g,m)=>(g[m.id]=m,g),{}),l=a.reduce((g,m)=>(g[m.id]=m,g),{}),u=[];for(const g of r){const{id:m}=g,h=c[m],b=l[m];let y={...g,...h,...b};u.push(y)}return u.sort((g,m)=>g.sequenceId-m.sequenceId)},s3=e=>e.sort((t,n)=>t.sequenceId-n.sequenceId),a3=({definitions:e})=>e.map((t,n)=>({id:t.id,key:t.key,sequenceId:n+1,isHidden:!1,style:{}})),Rv=({pagination:e})=>{const{selectedPage:t,rowPerPage:n,totalRecords:o,onPageChange:r,onPageSizeChange:s}=e,a=nt();return v.jsxs(ue,{sx:{display:"flex",p:"1rem 2rem"},children:[v.jsxs(ue,{sx:{zIndex:10,display:"flex",flexDirection:"row",gap:"0.5rem",width:"100%"},children:[v.jsx(ue,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:v.jsx(wt,{sx:{fontSize:"1.1rem",color:a.palette.primary.notifyTextColor},children:`Showing ${(t-1)*n+1} to ${t*n} of ${o} rows`})}),v.jsx(ue,{sx:{display:"flex",flexDirection:"row",gap:"0.5rem",justifyContent:"space-between"},children:v.jsx(ue,{sx:{display:"flex",flexDirection:"row",width:"5.2rem"},children:v.jsx(Qu,{options:K4,value:n,onChange:s})})}),v.jsx(ue,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:v.jsx(wt,{sx:{fontSize:"1.1rem",color:a.palette.primary.notifyTextColor},children:"records per page"})})]}),v.jsx(kc,{count:Math.ceil(o/n),page:t,onChange:(c,l)=>{r(l)},shape:"rounded",sx:{width:"100%","& .MuiPagination-ul":{width:"100%",display:"flex",justifyContent:"flex-end","& li:first-of-type":{border:`0.1rem solid ${a.palette.primary.notifyBorderColor}`,color:a.palette.primary.notifyActiveText,marginRight:"1.5rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex"},"& li:last-child":{border:`0.1rem solid ${a.palette.primary.notifyBorderColor}`,color:a.palette.primary.notifyActiveText,marginLeft:"1.5rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex"}},"& .MuiPaginationItem-root":{color:"#595959",fontSize:"1.1rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex","& .MuiSvgIcon-root":{fontSize:"2.2rem"}},"& .Mui-selected":{color:a.palette.primary.notifyActiveText,backgroundColor:`${a.palette.brandColor.paginationBc} !important`}}})]})};Rv.propTypes={pagination:i.object.isRequired};function Cd({isRenderCellContent:e,column:t,row:n}){const o=n[t.key];return v.jsx(v.Fragment,{children:e?v.jsx(ue,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},component:"label",children:t==null?void 0:t.cellRenderer(n)}):v.jsx(Pm,{title:(o==null?void 0:o.length)>20?o:"",arrow:!0,children:v.jsx(ue,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},component:"label",children:J4(o)})})})}Cd.propTypes={isRenderCellContent:i.bool,column:i.object,row:i.object};const Ov=({menuOpen:e,handleClose:t,onHideClick:n})=>{const o=nt();return v.jsx(Mc,{open:!!e,anchorEl:e,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:v.jsx(ue,{sx:{p:"0.4rem 1rem",backgroundColor:o.palette.primary.notifyBackground,border:`0.1rem solid ${o.palette.primary.notifyBorderColor}`,minHeight:"2.3rem",display:"flex",justifyContent:"center",alignItems:"center"},children:v.jsx(Zs,{onClick:n,sx:{textTransform:"none",fontSize:"1.1rem",p:0,minHeight:"unset",fontWeight:"500",color:o.palette.primary.notifyTextColor},children:"Hide Column"})})})};Ov.propTypes={menuOpen:i.object,handleClose:i.func,onHideClick:i.func};const l3=Y(Kh)(({theme:e})=>({"& .MuiPaper-root":{borderRadius:8,border:`1px solid ${e.palette.primary.notifyBorderColor}`,boxShadow:e.shadows[4],padding:"1rem 1rem 0rem 1rem",backgroundColor:e.palette.primary.notifyBackground}})),Dn=Y(wt)(({theme:e})=>({color:e.palette.primary.notifyTextColor})),c3=Y(Mm)(({theme:e})=>({width:28,height:16,padding:0,display:"flex","&:active":{"& .MuiSwitch-thumb":{width:15},"& .MuiSwitch-switchBase.Mui-checked":{transform:"translateX(9px)"}},"& .MuiSwitch-switchBase":{padding:2,"&.Mui-checked":{transform:"translateX(12px)",color:"#fff","& + .MuiSwitch-track":{opacity:1,backgroundColor:"#1890ff",...e.applyStyles("dark",{backgroundColor:"#177ddc"})}}},"& .MuiSwitch-thumb":{boxShadow:"0 2px 4px 0 rgb(0 35 11 / 20%)",width:12,height:12,borderRadius:6,transition:e.transitions.create(["width"],{duration:200})},"& .MuiSwitch-track":{borderRadius:16/2,opacity:1,backgroundColor:"rgba(0,0,0,.25)",boxSizing:"border-box",...e.applyStyles("dark",{backgroundColor:"rgba(255,255,255,.35)"})}})),u3=e=>{const{children:t,value:n,index:o,...r}=e;return v.jsx("div",{role:"tabpanel",hidden:n!==o,...r,children:n===o&&v.jsx(ue,{sx:{pl:"0.5rem",pb:"0.5rem"},children:t})})},d3=Y(Qs)(({theme:e})=>({color:e.palette.primary.notifyTextColor,padding:"0.6rem 0",fontSize:"0.9rem",fontWeight:500,"&::before, &::after":{borderColor:`${e.palette.primary.notifyBorderColor}!important`}})),p3=Y(vc)(({theme:e})=>({"& .MuiBadge-badge":{right:3.5,top:2.34,border:`0.1rem solid ${e.palette.primary.notifyBackground}`,padding:"0 1.3px",borderRadius:"50%",backgroundColor:"#D44E40",fontSize:"0.725rem",minWidth:"0.7rem",height:"0.7rem"}}));Y(Xm)(({theme:e})=>({"& .MuiInputBase-root":{height:"3.52rem"},"& .MuiFormLabel-root":{color:`${e.palette.primary.notifyBorderColor} !important`,fontSize:"1rem",marginTop:"0.4rem"},"& label.Mui-focused":{color:e.palette.primary.notifyTextColor},"& .MuiInput-underline:after":{borderBottomColor:e.palette.primary.notifyBorderColor,borderBottomWidth:"0.1rem"},"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"},"&:hover fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"},"&.Mui-focused fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"}}}));const f3=Y(Hm)(({theme:e})=>({"& .MuiTabs-indicator":{height:"0.1rem",backgroundColor:e.palette.primary.notifyActiveBorderColor}})),h3=Y(Nm)(({theme:e})=>({color:"gray","&.Mui-selected":{color:e.palette.primary.notifyActiveBorderColor,fontWeight:"bold"}})),Av=({sortKey:e,sortField:t,sortDir:n,handleSortClick:o})=>{const r=s=>v.jsx(Bs,{onClick:o,sx:{padding:"0.5rem"},children:v.jsx(ue,{component:"img",src:s})});return v.jsx(v.Fragment,{children:r(t===e?n==="asc"?mt.AscSort:mt.DescSort:mt.Unsort)})};Av.propTypes={sortKey:i.string.isRequired,sortField:i.string,sortDir:i.string,handleSortClick:i.func};function Pv({column:e,sort:t,handleMenuClick:n,isManageable:o}){const r=e==null?void 0:e.isMandatory,s=e==null?void 0:e.label,a=e==null?void 0:e.isSortable,c=t==null?void 0:t.sortField,l=t==null?void 0:t.sortDir,u=t==null?void 0:t.onSort;return v.jsxs(ue,{sx:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem"},children:[s,a&&v.jsx(Av,{sortKey:e==null?void 0:e.key,sortField:c,sortDir:l,handleSortClick:()=>u({column:e,sortDir:l,sortField:c})}),o&&!r&&v.jsx(Bs,{onClick:d=>n(d,e),sx:{padding:"0.5rem"},children:v.jsx(ue,{component:"img",src:mt.Menu})})]})}Pv.propTypes={column:i.object.isRequired,sort:i.object.isRequired,handleMenuClick:i.func,isManageable:i.bool};const m3=Y(_c)(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"table-cell",[`&.${Lc.head}`]:{color:e.palette.primary.notifyTextColor,backgroundColor:e.palette.primary.notifyBackground,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 1rem",borderTopLeftRadius:"1.4rem",borderTopRightRadius:"1.4rem",textAlign:"center"},[`&.${Lc.body}`]:{color:e.palette.primary.notifyTextColor,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 1rem",textAlign:"center"}}));function Gi({children:e,...t}){return v.jsx(m3,{...t,children:e})}Gi.propTypes={children:i.node};const g3=Y(gi)(()=>({"&:last-child td":{borderBottom:0}}));function Wi({children:e,...t}){return v.jsx(g3,{...t,children:e})}Wi.propTypes={children:i.node};function Mv({sort:e,data:t,pagination:n,columns:o,nested:r,baseUrl:s,gridPath:a}){var W;const c=nt(),{visibleGridColumns:l}=P.useContext(Sa),u=P.useContext(ji),{selectedColumn:d,handleMenuClick:p,handleClose:f,handleHideClick:g}=r3(l,u,s,a),m=o==null?void 0:o.isManageable,h=(t==null?void 0:t.length)>0,b=P.useRef(null),[y,T]=P.useState(null);let C=null;const I=s3(((W=r==null?void 0:r.column)==null?void 0:W.definitions)||[]),x=r==null?void 0:r.isNested,R=(r==null?void 0:r.data)||[],w=r==null?void 0:r.hashKey;if(!h)return v.jsx(Dn,{sx:{textAlign:"center"},children:fn.NRF});const O=(D,L)=>{T(L),D.dataTransfer.setData("colIndex",L)},M=D=>{D.preventDefault(),j(D)},N=async(D,L)=>{if(D.preventDefault(),clearInterval(C),y===null||y===L)return;const _=[...l];[_[y],_[L]]=[_[L],_[y]],u({type:ke.SET_GRID_DATA,payload:{visibleGridColumns:_}});let V=No.GRID_SETTINGS||{platform:{theme:"light"},grid:{}};V.grid=V.grid||{},V.grid[a]=_,localStorage.setItem(io.SETTINGS,JSON.stringify(V)),await $a({baseUrl:s,payload:V}),T(null)},j=D=>{const L=b.current,{left:_,right:V}=L.getBoundingClientRect(),$=50,k=D.clientX>V-$?1:D.clientX<_+$?-1:0;k!==0?(clearInterval(C),C=setInterval(()=>{L.scrollLeft+=k*10},50)):clearInterval(C)};return v.jsxs(v.Fragment,{children:[v.jsx(Dm,{ref:b,sx:{maxHeight:"100%",overflowX:"auto",whiteSpace:"nowrap"},children:v.jsxs(Fc,{stickyHeader:!0,sx:{backgroundColor:c.palette.primary.notifyBackground,border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,borderRadius:"1.4rem","& .MuiTableHead-root":{backgroundColor:c.palette.primary.notifyBackground}},children:[v.jsx($c,{children:v.jsx(Wi,{children:l.map((D,L)=>D!=null&&D.isHidden?null:v.jsx(Gi,{style:D==null?void 0:D.style,draggable:m,onDragStart:m?_=>O(_,L):void 0,onDragOver:m?M:void 0,onDrop:m?_=>N(_,L):void 0,children:v.jsx(Pv,{column:D,sort:e,handleMenuClick:p,isManageable:m})},L))})}),v.jsx(Vc,{children:t.map((D,L)=>{const _=D[w],V=R==null?void 0:R[_],$=(V==null?void 0:V.length)>0;return v.jsxs(v.Fragment,{children:[v.jsx(Wi,{children:l.map((k,H)=>k!=null&&k.isHidden?null:v.jsx(Gi,{style:k==null?void 0:k.style,children:v.jsx(Cd,{isRenderCellContent:!!(k!=null&&k.cellRenderer),column:k,row:D})},H))},L),x&&V&&v.jsx(v.Fragment,{children:$?V.map((k,H)=>v.jsx(Wi,{children:I.map((B,z)=>v.jsx(Gi,{style:B==null?void 0:B.style,children:v.jsx(Cd,{isRenderCellContent:!!(B!=null&&B.cellRenderer),column:B,row:k})},z))},H)):v.jsx(Wi,{children:v.jsx(Gi,{colSpan:I.length,children:v.jsx(Dn,{sx:{textAlign:"center"},children:fn.NRF})})})})]})})})]})}),n&&v.jsx(Rv,{pagination:n}),v.jsx(Ov,{menuOpen:d==null?void 0:d.isOpen,handleClose:f,onHideClick:g})]})}Mv.propTypes={sort:i.object,data:i.array,pagination:i.object,columns:i.object,nested:i.object};function Nv({tableProps:e,mergedColumns:t,gridPath:n,baseUrl:o}){const r=P.useContext(ji);return P.useEffect(()=>{r({type:ke.SET_GRID_DATA,payload:{visibleGridColumns:t}})},[t,r]),v.jsx(v.Fragment,{children:v.jsx(Mv,{...e,gridPath:n,baseUrl:o})})}Nv.propTypes={tableProps:i.object.isRequired,mergedColumns:i.array.isRequired};const b3=({styles:e,label:t,hasFooter:n=!1,showCheckBox:o=!1,options:r,defaultValue:s=!0,isMulti:a=!1,onChange:c})=>{var x,R;const l=nt(),[u,d]=P.useState(!1),p=P.useRef(null),f=P.useRef(null),[g,m]=P.useState("auto"),[h,b]=P.useState(s?(x=r==null?void 0:r[0])==null?void 0:x.label:"Select option"),[y,T]=P.useState(r||[]);((R=y==null?void 0:y.filter(w=>!(w!=null&&w.isMandatory)))==null?void 0:R.length)>7,P.useRef(null),P.useRef(null),P.useCallback(w=>{let O=[...y];O=O==null?void 0:O.map(M=>(M==null?void 0:M.key)===w?{...M,hidden:!M.hidden}:M),T(O),d(!0)},[y]),P.useCallback(()=>{},[y]);const C=()=>{},I=()=>{};return P.useEffect(()=>{const w=O=>{f.current&&!f.current.contains(O.target)&&d(!1)};return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}},[]),v.jsxs(ue,{ref:f,sx:{position:"relative",width:"100%",flexShrink:0},children:[v.jsx(ue,{sx:{cursor:"pointer",height:"3rem",width:"100%",position:"relative",zIndex:1}}),v.jsxs(yn.div,{style:{position:"relative",maxHeight:"3rem",position:"absolute",top:0,left:0,width:"100%",zIndex:1e3,border:`0.1rem solid ${l.palette.primary.notifyBorderColor}`,borderRadius:"0.7rem",color:l.palette.primary.notifyTextColor,backgroundColor:l.palette.primary.notifyBackground,overflow:"hidden"},animate:{maxHeight:u?"15rem":"3rem"},transition:{duration:.2,ease:"easeInOut"},children:[v.jsxs(ue,{sx:{padding:"0.65rem",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",gap:"0.5rem"},onClick:()=>d(!u),children:[v.jsx(ue,{component:"img",className:"select-icon",src:e==null?void 0:e.icon,sx:{cursor:"pointer"}}),v.jsx(wt,{ref:p,sx:{color:l.palette.primary.notifyTextColor,flex:1,fontSize:"1.1rem",whiteSpace:"nowrap"},children:t||h}),v.jsx(ue,{component:"img",className:"child",src:u?mt.ArrowSelectDown:mt.ArrowSelectUp,sx:{cursor:"pointer"}})]}),u&&v.jsx("hr",{style:{width:"100%",height:"0.1rem",backgroundColor:l.palette.primary.notifyBorderColor,border:"none",margin:"0rem"}}),v.jsx(Uc,{children:u&&v.jsx(yn.ul,{style:{listStyle:"none",padding:"0rem 1rem 0.8rem 1rem",margin:0,opacity:1,visibility:"visible",maxHeight:"10rem",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:`${l.palette.primary.notifyIconColor} transparent`},initial:{opacity:0},animate:{opacity:1},transition:{duration:.3,ease:"easeInOut"},children:r==null?void 0:r.map((w,O)=>v.jsxs("li",{style:{padding:o?"0.4rem 0":"0.2rem 0.4rem",cursor:"pointer",display:"flex",alignItems:"center",color:l.palette.primary.notifyTextColor,backgroundColor:l.palette.primary.notifyBackground,whiteSpace:"nowrap"},onClick:()=>{d(!1),c(w)},children:[o&&v.jsx(Js,{size:"medium",sx:{color:l.palette.primary.notifyIconColor,"&.Mui-checked":{color:l.palette.brandColor.orange},p:"0.2rem 0.5rem"},checked:!(w!=null&&w.isHidden)}),v.jsx(wt,{sx:{fontSize:"1.1rem"},children:w==null?void 0:w.label})]},O))})}),n&&u&&v.jsxs(yn.div,{style:{display:"flex",flexDirection:"row",padding:"0.5rem 1rem",justifyContent:"space-between",borderTop:`0.1rem solid ${l.palette.primary.notifyBorderColor}`,position:"sticky",bottom:0,opacity:1,visibility:"visible"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.3,ease:"easeInOut"},children:[v.jsx(yn.button,{onClick:C,style:{textTransform:"none",padding:"0.4rem",background:"transparent",color:l.palette.primary.notifyTextColor,fontSize:"1.1rem",border:"none",cursor:"pointer"},children:"Apply"}),v.jsx(yn.button,{onClick:I,style:{textTransform:"none",padding:"0.4rem",background:"transparent",color:l.palette.primary.notifyTextColor,fontSize:"1.1rem",border:"none",cursor:"pointer"},children:"Cancel"})]})]})]})},v3=e=>{if(!e)return null;const{subAction:t,...n}=e,o=t?"select":"button",r={button:s=>v.jsx(Ir,{...s}),select:s=>v.jsx(b3,{...s})};return r[o]?r[o](n):null},y3=({presentSetting:e,gridSetting:t,gridPath:n})=>{if(!n)return e;let o=(e==null?void 0:e.grid)||{};const r=t==null?void 0:t.map(({id:s,isHidden:a,isSortable:c,key:l,sequenceId:u})=>({id:s,isHidden:a,isSortable:c,key:l,sequenceId:u}));return o[n]=r,e.grid=o,{settingObject:e,defaultUserSettings:r}},x3=async({baseUrl:e,gridSetting:t,gridPath:n})=>{try{const o=JSON.parse(localStorage.getItem("settings")),{settingObject:r,defaultUserSettings:s}=y3({presentSetting:o,gridSetting:t,gridPath:n});return localStorage.setItem("settings",JSON.stringify(r)),await $a({baseUrl:e,payload:r}),s}catch(o){console.error(o)}},C3=({...e})=>{const[t,n]=P.useState(!1),o=nt();return v.jsx(yn.input,{type:"text",onFocus:()=>n(!0),onBlur:()=>n(!1),initial:{width:"10rem",borderRadius:"0.7rem"},animate:{width:t?"13rem":"10rem"},transition:{duration:.3,ease:"easeInOut"},style:{height:"3rem",outline:"none",boxShadow:"none",fontSize:"1.1rem",border:`0.1rem solid ${o.palette.primary.notifyBorderColor}`,backgroundColor:o.palette.primary.notifyBackground,padding:"0rem 1rem",color:o.palette.primary.notifyTextColor,transition:"height 0.1s ease"},...e})};function kv({...e}){return v.jsx(Io,{children:v.jsx(C3,{...e})})}const E3=({customTools:e})=>({sortedTools:e==null?void 0:e.sort((n,o)=>n.sequenceId-o.sequenceId)}),Bv=({customTools:e})=>{const{sortedTools:t}=E3({customTools:e}),[n,o]=P.useState(!1),r=(t==null?void 0:t.length)>3,c=r?Math.min(t.length,3.37)*45+20:"auto";return v.jsxs(v.Fragment,{children:[n&&v.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:998}}),v.jsx(yn.div,{className:"custom-tools-container",initial:{width:c!=="auto"?`${c/10}rem`:c},animate:r&&{width:n?"100%":`${c/10}rem`},transition:{duration:.4,ease:"easeInOut"},style:{height:"3rem",outline:"none",overflow:"hidden",display:"flex",alignItems:"center",gap:"0.5rem",whiteSpace:"nowrap",borderTopRightRadius:"0.8rem",borderBottomRightRadius:"0.8rem",zIndex:999,pointerEvents:n||!r?"auto":"none",boxShadow:"rgba(0, 0, 0, 0.95) -2px 0px 3px -3px inset"},layout:!0,children:t==null?void 0:t.map(l=>v.jsx(ue,{sx:{flexShrink:0,minWidth:"fit-content"},children:v3(l)},l.id))}),r&&v.jsx(ue,{sx:{zIndex:1e3,pointerEvents:"auto"},children:v.jsx(Ir,{label:n?"":"More Actions",styles:{icon:n?mt.Cross:mt.More},onClick:()=>o(l=>!l)})})]})};Bv.propTypes={customTools:i.array.isRequired};const Dv=({defaultTools:e,isManageable:t,customTools:n,baseUrl:o,gridPath:r})=>{var d,p,f,g,m,h,b;const s=P.useContext(ji),{visibleGridColumns:a,triggerApi:c}=P.useContext(Sa),l=async y=>{try{await x3({baseUrl:o,gridPath:r,gridSetting:y})}catch(T){console.error(T)}finally{s({type:ke.HAS_SETTING_CHANGE,payload:{hasChange:!1}}),s({type:ke.TRIGGER_API,payload:{triggerApi:!1}})}};P.useEffect(()=>{c&&l(a)},[c]);const u=y=>{const T=[...a].map(C=>C.id===(y==null?void 0:y.id)?{...C,isHidden:!C.isHidden}:C);s({type:ke.SET_GRID_DATA,payload:{visibleGridColumns:T}}),s({type:ke.HAS_SETTING_CHANGE,payload:{hasChange:!0}})};return v.jsxs(ue,{sx:{margin:"1rem 0",position:"relative",zIndex:10,display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"0.5rem",width:"100%"},children:[v.jsxs(ue,{sx:{display:"flex",flexDirection:"row",gap:"0.5rem"},children:[((d=e==null?void 0:e.search)==null?void 0:d.isRequired)&&v.jsx(kv,{...e==null?void 0:e.search}),((p=e==null?void 0:e.refresh)==null?void 0:p.isRequired)&&v.jsx(Ir,{...e==null?void 0:e.refresh,styles:{...(f=e==null?void 0:e.refresh)==null?void 0:f.styles,icon:mt.Refresh}}),t&&v.jsx(ue,{sx:{width:"12rem"},children:v.jsx(Qu,{placeholder:"Manage Columns",options:a,value:a,isMulti:!0,showCheckBox:!0,isDraggable:!0,handleCheck:y=>{var T;return!((T=a==null?void 0:a.find(C=>C.id===y.id))!=null&&T.isHidden)},onChange:(y,T)=>u(y)})})]}),v.jsxs(ue,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",gap:"0.6rem"},children:[v.jsx(Bv,{customTools:n}),((g=e==null?void 0:e.upload)==null?void 0:g.isRequired)&&v.jsx(Ir,{...e==null?void 0:e.upload,styles:{...(m=e==null?void 0:e.upload)==null?void 0:m.styles,icon:mt.Upload,color:"secondary",isAnimate:!0}}),((h=e==null?void 0:e.download)==null?void 0:h.isRequired)&&v.jsx(Ir,{...e==null?void 0:e.download,styles:{...(b=e==null?void 0:e.download)==null?void 0:b.styles,icon:mt.Download,isAnimate:!0}})]})]})};Dv.propTypes={defaultTools:i.object.isRequired,customTools:i.array,isManageable:i.bool,baseUrl:i.string,gridPath:i.gridPath};function jv({tableProps:e,toolbarProps:t,isDefaultConfig:n}){var a;const o=(a=e.columns)==null?void 0:a.isManageable,{columns:r}=e,s=i3({columns:r,gridPath:(t==null?void 0:t.gridPath)||"",baseUrl:(t==null?void 0:t.baseUrl)||"",isDefaultConfig:n});return v.jsxs($0,{children:[t&&v.jsx(Dv,{...t,isManageable:o}),v.jsx(Nv,{tableProps:e,mergedColumns:s,gridPath:(t==null?void 0:t.gridPath)||"",baseUrl:(t==null?void 0:t.baseUrl)||""})]})}jv.propTypes={tableProps:i.object.isRequired,toolbarProps:i.object,isDefaultConfig:i.bool};const Fv=({list:e,handleLinkClick:t})=>{const n=nt(),o=({list:r})=>{var s;return(s=r==null?void 0:r.sort((a,c)=>a.order-c.order))==null?void 0:s.map((a,c)=>a!=null&&a.link?v.jsx(Ac,{component:"h3",sx:{fontSize:"1rem",cursor:"pointer",color:c===(r==null?void 0:r.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},href:a==null?void 0:a.link,underline:"hover",onClick:()=>t(a),children:a==null?void 0:a.title},c):v.jsx(wt,{component:"h3",sx:{fontSize:"1rem",color:c===(r==null?void 0:r.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},children:a==null?void 0:a.title},c))};return v.jsx($h,{separator:v.jsx(ue,{component:"img",src:mt.ArrowRight}),children:o({list:e})})};Fv.propTypes={list:i.array.isRequired,handleLinkClick:i.func};const I3=Y(ue)(({theme:e})=>({borderRadius:"0.4rem",position:"relative",background:e.palette.primary.notifyButtonBackground,display:"flex"})),T3=Y(ue)(({theme:e})=>({borderRadius:"0.4rem",position:"absolute",background:e.palette.primary.notifyBackground,border:`0.1rem solid ${e.palette.primary.notifyBorderColor}`,transition:"all 0.5s ease"})),Vv=Y(Zs)(({theme:e})=>({borderRadius:"0.4rem",fontWeight:"400",transition:"all 0.2s 0.1s ease",padding:"0.4rem 0.8rem",fontSize:"1rem",textTransform:"none",zIndex:1,"&:hover":{background:"transparent",boxShadow:"none"}})),S3=({isChartType:e,setIsChartType:t})=>v.jsx(ue,{sx:{display:"flex"},children:v.jsxs(I3,{children:[v.jsx(T3,{sx:{width:e?"6.5rem":"9.6rem",height:"2.5rem",transform:`translateX(${e?0:"6.4rem"})`}}),v.jsx(Vv,{disableRipple:!0,sx:{color:n=>e?n.palette.primary.notifyActiveText:n.palette.brandColor.grey1},onClick:()=>t(!0),children:"Table only"}),v.jsx(Vv,{disableRipple:!0,sx:{color:n=>e?n.palette.brandColor.grey1:n.palette.primary.notifyActiveText},onClick:()=>t(!1),children:"Table with charts"})]})}),Lv=({breadcrumbProps:e,switchProps:t})=>{const n=nt();return v.jsxs(cn,{sx:{background:n.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${n.palette.primary.notifyBorderColor}`,height:"3rem",p:"0px 5.5rem 0 1.5rem",zIndex:4,position:"relative"},direction:"row",justifyContent:"space-between",alignItems:"center",children:[v.jsx(Fv,{...e}),t&&v.jsx(S3,{...t})]})};Lv.propTypes={breadcrumbProps:i.object.isRequired,switchProps:i.object};function _v({headerProps:e}){return v.jsx(Io,{children:v.jsx(Lv,{...e})})}_v.propTypes={headerProps:i.object.isRequired};const Ed=P.createContext(null),$v=P.createContext(null);function w3({children:e}){const[t,n]=P.useReducer(R3,O3);return v.jsx(Ed.Provider,{value:t,children:v.jsx($v.Provider,{value:n,children:e})})}function R3(e,t){var n;switch(t.type){case ke.LOADING:return{...e,loading:t.loading};case ke.SUCCESS:return{...e,data:(n=t.data)==null?void 0:n.sort((o,r)=>new Date(r.createdAt)-new Date(o.createdAt))};case ke.MARK_ALL_AS_READ:return{...e,isMarkAllAsRead:t.isMarkAllAsRead};case ke.ERROR:return{...e,error:t.error};default:throw new Error(`${fn.UNHANDLED}: ${t}`)}}const O3={loading:!1,data:[],error:"",isMarkAllAsRead:{count:0,boo:!1}},{TENANT_ID:Id,BU_ID:Td,SNOP_ID:Gv}=bd,{TENANT_IDS:Sd,BU_IDS:wd}=No,A3=async e=>{try{const t=`${e}${_a.NOTIFICATION}/v1?${Id}=${Sd}&${Td}=${wd}`;return await ot.get(t,$i)}catch(t){return t}},Wv=async(e,t,n)=>{try{const o=n===Sv.MARK_ALL_READ?"":`&${Gv}=${n}&`,r=`${e}${_a.NOTIFICATION}${pd.VERSION}?${Id}=${Sd}&${Td}=${wd}${o}`;return await ot.put(r,t,$i)}catch(o){return o}},P3=async({baseUrl:e,id:t,snopId:n})=>{try{const o=`${e}${_a.NOTIFICATION}${pd.VERSION}?${Id}=${Sd}&${Td}=${wd}&${Gv}=${n}&id=${t}`;return await ot.get(o,$i)}catch(o){return o}},Ga={OK:200,CREATED:201,NO_CONTENT:204,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,INTERNAL_SERVER_ERROR:500};var zv,Hv,Xv,Uv;function Rd(){return Rd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Rd.apply(null,arguments)}var M3=function(t){return S.createElement("svg",Rd({xmlns:"http://www.w3.org/2000/svg",width:16,height:18,fill:"none"},t),zv||(zv=S.createElement("path",{stroke:"#666D80",strokeLinecap:"round",strokeMiterlimit:10,d:"M8.013 3.44c-2.206 0-4 1.793-4 4v1.927c0 .406-.173 1.026-.38 1.373l-.766 1.273c-.474.787-.147 1.66.72 1.954 2.873.96 5.973.96 8.846 0a1.335 1.335 0 0 0 .72-1.954l-.766-1.273c-.2-.347-.374-.967-.374-1.373V7.44c0-2.2-1.8-4-4-4Z"})),Hv||(Hv=S.createElement("path",{stroke:"#666D80",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,d:"M9.247 3.633a4.503 4.503 0 0 0-2.467 0 1.324 1.324 0 0 1 2.467 0"})),Xv||(Xv=S.createElement("path",{stroke:"#666D80",strokeMiterlimit:10,d:"M10.014 14.207c0 1.1-.9 2-2 2a2.007 2.007 0 0 1-2-2"})),Uv||(Uv=S.createElement("circle",{cx:12.266,cy:3,r:2.5,fill:"#E85353",stroke:"#F8FAFB"})))};const N3=({count:e})=>(nt(),v.jsxs(v.Fragment,{children:[v.jsx(ue,{sx:{gap:"0.5rem",display:"flex",justifyContent:"center",alignItems:"center"},className:"notify-icon-container",children:v.jsx(M3,{style:{scale:2}})}),v.jsx(p3,{badgeContent:e==0?"":null,color:"error"})]}));var Yv;function Od(){return Od=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Od.apply(null,arguments)}var k3=function(t){return S.createElement("svg",Od({xmlns:"http://www.w3.org/2000/svg",width:13,height:8,fill:"none"},t),Yv||(Yv=S.createElement("path",{fill:"#A8A8A8",fillRule:"evenodd",d:"M8.954 1.004a.406.406 0 0 1 0 .575L3.537 6.996a.406.406 0 0 1-.574 0L.796 4.829a.406.406 0 1 1 .575-.575l1.879 1.88 5.13-5.13a.406.406 0 0 1 .574 0m3.25 0a.406.406 0 0 1 0 .575L6.787 6.996a.406.406 0 1 1-.574-.575l5.416-5.417a.406.406 0 0 1 .575 0",clipRule:"evenodd"})))};const Zv=({title:e,subTitle:t,children:n,onRefresh:o,onClose:r,loading:s,handleShowAll:a,handleMarkAllAsRead:c,isMarkAllAsRead:l,width:u,headerIconType:d,isDialogActionShow:p,className:f,dialogType:g,data:m,toggleNotify:h,mode:b,isDetail:y=!1,...T})=>{var O,M;const[C,I]=P.useState(0),x=nt(),R=(N,j)=>{I(j)},w=()=>{switch(d){case La.REFRESH:return v.jsx(ue,{component:"img",src:mt.Refresh,alt:"refresh",onClick:o,sx:{cursor:"pointer"}});case La.CLOSE:return v.jsx(ue,{component:"img",src:mt.Close,alt:"refresh",onClick:r,sx:{cursor:"pointer"}});default:return null}};return v.jsxs(l3,{maxWidth:y?"xs":"md",onClose:r,...T,className:["notification-dialog",f,g==="notifcation-dialog"?"notification-main-box":""].join(" "),dialogType:!0,children:[v.jsxs(ue,{sx:g==="notifcation-dialog"?{gap:1,display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"}:{gap:1,display:"flex",width:"100%",justifyContent:"space-between",paddingBottom:1.2},children:[v.jsxs(ue,{className:"title-container",children:[v.jsx(Dn,{variant:"h6",component:"h6",className:"title",children:e}),t&&v.jsx(Dn,{variant:"h6",className:"title sub-title",children:t})]}),w()]}),y?v.jsx(v.Fragment,{children:n}):v.jsxs(v.Fragment,{children:[v.jsx(ue,{sx:{borderBottom:1,borderColor:x.palette.primary.notifyBorderColor},className:"tab-panel",children:v.jsx(f3,{value:C,onChange:R,children:v.jsx(h3,{label:v.jsxs(ue,{sx:{display:"flex",alignItems:"center",fontSize:"1rem"},children:["All (",v.jsx(wt,{component:"span",sx:{fontWeight:"bold"},children:((O=m==null?void 0:m.filter(N=>!(N!=null&&N.isRead)))==null?void 0:O.length)||0}),")"]})})})}),v.jsx(u3,{value:C,index:0,children:n})]}),p&&v.jsxs(Tc,{className:"dialog-action",sx:{px:"1rem"},children:[v.jsxs(cn,{direction:"row",gap:1,children:[v.jsx(Dn,{sx:{fontSize:"0.9rem"},children:"Only show unread"}),v.jsx(c3,{disabled:s,checked:b,onChange:h})]}),v.jsx(Zs,{variant:"outlined",className:"view-all",onClick:c,startIcon:v.jsx(k3,{}),disabled:!((M=m==null?void 0:m.filter(N=>!(N!=null&&N.isRead)))!=null&&M.length),style:{backgroundColor:"transparent"},sx:{p:0,color:x.palette.primary.notifyTextColor},children:"Mark all as read"})]})]})};var Jv,qv;function Ad(){return Ad=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ad.apply(null,arguments)}var B3=function(t){return S.createElement("svg",Ad({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},t),Jv||(Jv=S.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M7.79 6c0 .99-.8 1.79-1.79 1.79S4.21 6.99 4.21 6 5.01 4.21 6 4.21s1.79.8 1.79 1.79"})),qv||(qv=S.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M6 10.135c1.765 0 3.41-1.04 4.555-2.84.45-.705.45-1.89 0-2.595C9.41 2.9 7.765 1.86 6 1.86S2.59 2.9 1.445 4.7c-.45.705-.45 1.89 0 2.595 1.145 1.8 2.79 2.84 4.555 2.84"})))},Kv;function Pd(){return Pd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Pd.apply(null,arguments)}var D3=function(t){return S.createElement("svg",Pd({xmlns:"http://www.w3.org/2000/svg",width:9,height:8,fill:"none"},t),Kv||(Kv=S.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M8.277 1.004a.406.406 0 0 1 0 .575L2.86 6.996a.406.406 0 0 1-.574 0L.119 4.829a.406.406 0 1 1 .575-.575l1.879 1.88 5.13-5.13a.406.406 0 0 1 .574 0",clipRule:"evenodd"})))};const Qv=({type:e,title:t,isRead:n,handleShowDetails:o,handleRead:r,isCheckBox:s,selectedAlert:a,id:c,handleCheckboxChange:l,clickId:u,product:d,createdAt:p,isShowVisible:f})=>{var h,b;const g=nt(),m=(b=(h=JSON.parse(localStorage.getItem("settings")))==null?void 0:h.platform)==null?void 0:b.theme;return v.jsxs(ue,{className:"cards",children:[v.jsxs(cn,{display:"flex",flexDirection:"row",alignItems:"start",justifyContent:"space-between",gap:1,children:[s&&v.jsx(Js,{checked:!!a.includes(c),onChange:y=>l(y,c),disabled:n,sx:{padding:"4px 7px 0 7px"}}),v.jsx(vc,{sx:{"& .MuiBadge-badge":{backgroundColor:"#6041EA"}},variant:"dot",className:"badge",invisible:n,children:v.jsx(Dn,{sx:{color:g.palette.primary.notifyActiveText},component:"p",className:["title-card",n&&"read"].join(" "),children:t})})]}),v.jsxs(cn,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:[v.jsxs(cn,{display:"flex",flexDirection:"row",justifyContent:"start",gap:1,sx:{p:"0.5rem 0"},children:[f&&v.jsx(fc,{icon:v.jsx(B3,{className:`${m==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:u,onClick:o,label:u===c?v.jsx(si,{color:"primary",size:13}):"Show Details",component:"button",variant:"filled",clickable:!0,size:"small",sx:{height:"2rem",fontWeight:"300",fontSize:"0.9rem",color:g.palette.primary.notifyActiveText,borderColor:g.palette.primary.notifyBorderColor,background:g.palette.primary.notifyButtonBackground,borderRadius:"0.6rem",padding:"0.2rem"}}),!n&&v.jsx(fc,{icon:v.jsx(D3,{className:`${m==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:u,onClick:r,label:"Acknowledge",component:"button",variant:"outlined",clickable:!0,size:"small",sx:{height:"2rem",fontSize:"0.9rem",fontWeight:"300",borderColor:g.palette.primary.notifyBorderColor,color:g.palette.primary.notifyActiveText,borderRadius:"0.6rem",padding:"0.2rem"}})]}),v.jsxs(cn,{display:"flex",justifyContent:"space-between",flexDirection:"row",alignItems:"center",gap:.35,children:[v.jsx(Dn,{sx:{fontSize:"0.9rem"},children:d}),v.jsx(Dn,{color:g.palette.primary.notifyTextColor,children:"•"}),v.jsx(Dn,{sx:{fontSize:"0.9rem"},children:z4(p)})]})]})]})};Qv.propTypes={type:i.string,title:i.string,subTitle:i.string,isRead:i.bool,handleShowDetails:i.func,handleRead:i.func};const ey=({data:e,handleRead:t,handleShowDetails:n,clickId:o,mode:r,page:s,setPage:a})=>{const{isMarkAllAsRead:c}=P.useContext(Ed),l=new Date,u=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"long",year:"numeric"}).format(l),[d,p]=P.useState([]),[f,g]=P.useState(!1),[m,h]=P.useState(!0),b=P.useRef(null),y=nt();return P.useEffect(()=>{p([...e])},[e]),P.useEffect(()=>{const T=new IntersectionObserver(C=>{C[0].isIntersecting&&!f&&m&&a(I=>I+1)},{threshold:1});return b.current&&T.observe(b.current),()=>{b.current&&T.unobserve(b.current)}},[f,m]),v.jsxs(ue,{sx:d.length?{py:"0.5rem"}:{py:"0.5rem",justifyContent:"center",alignItems:"center",display:"flex",height:"100%"},children:[Object.entries(Z4(d)).map(([T,C])=>v.jsxs(P.Fragment,{children:[T!==u&&v.jsx(d3,{children:T}),C.map((I,x)=>v.jsx(Qv,{type:"success",title:I.message,subTitle:I.createdAt,isRead:I.isRead,handleShowDetails:()=>n(I.id,I.snopId),handleRead:()=>t([I.id],I.snopId),clickId:o,id:I.id,product:I.product,createdAt:I.createdAt,isShowVisible:I==null?void 0:I.isNotificationDetails},I.id||x))]},T)),f&&s>1&&!!(d!=null&&d.length)&&v.jsx(ue,{sx:{display:"flex",justifyContent:"center",alignItems:"center",pl:"0.5rem",py:"0.3rem"},children:v.jsx(si,{size:20,className:"circular-loader"})}),!(d!=null&&d.length)&&v.jsx(wt,{sx:{fontSize:"1.1rem",color:y.palette.primary.notifyTextColor,textAlign:"center",px:"0.8rem"},children:"You don't have any unread notification here. Use the toggle to switch between read and unread notification."}),v.jsx(ue,{ref:b,style:{height:"0.1rem",backgroundColor:"transparent"}})]})};ey.propTypes={data:i.array,handleRead:i.func,handleShowDetails:i.func};function zi(e,t,n){return(t=kf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ty(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function ve(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ty(Object(n),!0).forEach(function(o){zi(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ty(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function j3(e){if(Array.isArray(e))return e}function F3(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o,r,s,a,c=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=s.call(n)).done)&&(c.push(o.value),c.length!==t);l=!0);}catch(d){u=!0,r=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return c}}function Md(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function ny(e,t){if(e){if(typeof e=="string")return Md(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Md(e,t):void 0}}function V3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
254
254
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gn(e,t){return j3(e)||F3(e,t)||ny(e,t)||V3()}function Wn(e,t){if(e==null)return{};var n,o,r=ne(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var L3=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function _3(e){var t=e.defaultInputValue,n=t===void 0?"":t,o=e.defaultMenuIsOpen,r=o===void 0?!1:o,s=e.defaultValue,a=s===void 0?null:s,c=e.inputValue,l=e.menuIsOpen,u=e.onChange,d=e.onInputChange,p=e.onMenuClose,f=e.onMenuOpen,g=e.value,m=Wn(e,L3),h=P.useState(c!==void 0?c:n),b=Gn(h,2),y=b[0],T=b[1],C=P.useState(l!==void 0?l:r),I=Gn(C,2),x=I[0],R=I[1],w=P.useState(g!==void 0?g:a),O=Gn(w,2),M=O[0],N=O[1],j=P.useCallback(function(k,H){typeof u=="function"&&u(k,H),N(k)},[u]),W=P.useCallback(function(k,H){var B;typeof d=="function"&&(B=d(k,H)),T(B!==void 0?B:k)},[d]),D=P.useCallback(function(){typeof f=="function"&&f(),R(!0)},[f]),L=P.useCallback(function(){typeof p=="function"&&p(),R(!1)},[p]),_=c!==void 0?c:y,V=l!==void 0?l:x,$=g!==void 0?g:M;return ve(ve({},m),{},{inputValue:_,menuIsOpen:V,onChange:j,onInputChange:W,onMenuClose:L,onMenuOpen:D,value:$})}function $3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oy(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,kf(o.key),o)}}function G3(e,t,n){return t&&oy(e.prototype,t),n&&oy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function W3(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&As(e,t)}function Wa(e){return Wa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wa(e)}function ry(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ry=function(){return!!e})()}function z3(e,t){if(t&&(ho(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sh(e)}function H3(e){var t=ry();return function(){var n,o=Wa(e);if(t){var r=Wa(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return z3(this,n)}}function X3(e){if(Array.isArray(e))return Md(e)}function U3(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Y3(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
255
255
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nd(e){return X3(e)||U3(e)||ny(e)||Y3()}function Z3(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const J3=Math.min,q3=Math.max,za=Math.round,Ha=Math.floor,Xa=e=>({x:e,y:e});function K3(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Ua(){return typeof window<"u"}function iy(e){return ay(e)?(e.nodeName||"").toLowerCase():"#document"}function zn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function sy(e){var t;return(t=(ay(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ay(e){return Ua()?e instanceof Node||e instanceof zn(e).Node:!1}function Q3(e){return Ua()?e instanceof Element||e instanceof zn(e).Element:!1}function kd(e){return Ua()?e instanceof HTMLElement||e instanceof zn(e).HTMLElement:!1}function ly(e){return!Ua()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof zn(e).ShadowRoot}function cy(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Bd(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function eB(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function tB(e){return["html","body","#document"].includes(iy(e))}function Bd(e){return zn(e).getComputedStyle(e)}function nB(e){if(iy(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ly(e)&&e.host||sy(e);return ly(t)?t.host:t}function uy(e){const t=nB(e);return tB(t)?e.ownerDocument?e.ownerDocument.body:e.body:kd(t)&&cy(t)?t:uy(t)}function Ya(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=uy(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),a=zn(r);if(s){const c=Dd(a);return t.concat(a,a.visualViewport||[],cy(r)?r:[],c&&n?Ya(c):[])}return t.concat(r,Ya(r,[],n))}function Dd(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oB(e){const t=Bd(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=kd(e),s=r?e.offsetWidth:n,a=r?e.offsetHeight:o,c=za(n)!==s||za(o)!==a;return c&&(n=s,o=a),{width:n,height:o,$:c}}function jd(e){return Q3(e)?e:e.contextElement}function dy(e){const t=jd(e);if(!kd(t))return Xa(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=oB(t);let a=(s?za(n.width):n.width)/o,c=(s?za(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const rB=Xa(0);function iB(e){const t=zn(e);return!eB()||!t.visualViewport?rB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sB(e,t,n){return!1}function py(e,t,n,o){t===void 0&&(t=!1);const r=e.getBoundingClientRect(),s=jd(e);let a=Xa(1);t&&(a=dy(e));const c=sB()?iB(s):Xa(0);let l=(r.left+c.x)/a.x,u=(r.top+c.y)/a.y,d=r.width/a.x,p=r.height/a.y;if(s){const f=zn(s),g=o;let m=f,h=Dd(m);for(;h&&o&&g!==m;){const b=dy(h),y=h.getBoundingClientRect(),T=Bd(h),C=y.left+(h.clientLeft+parseFloat(T.paddingLeft))*b.x,I=y.top+(h.clientTop+parseFloat(T.paddingTop))*b.y;l*=b.x,u*=b.y,d*=b.x,p*=b.y,l+=C,u+=I,m=zn(h),h=Dd(m)}}return K3({width:d,height:p,x:l,y:u})}function fy(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function aB(e,t){let n=null,o;const r=sy(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function a(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:d,top:p,width:f,height:g}=u;if(c||t(),!f||!g)return;const m=Ha(p),h=Ha(r.clientWidth-(d+f)),b=Ha(r.clientHeight-(p+g)),y=Ha(d),C={rootMargin:-m+"px "+-h+"px "+-b+"px "+-y+"px",threshold:q3(0,J3(1,l))||1};let I=!0;function x(R){const w=R[0].intersectionRatio;if(w!==l){if(!I)return a();w?a(!1,w):o=setTimeout(()=>{a(!1,1e-7)},1e3)}w===1&&!fy(u,e.getBoundingClientRect())&&a(),I=!1}try{n=new IntersectionObserver(x,{...C,root:r.ownerDocument})}catch{n=new IntersectionObserver(x,C)}n.observe(e)}return a(!0),s}function lB(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=jd(e),d=r||s?[...u?Ya(u):[],...Ya(t)]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const p=u&&c?aB(u,n):null;let f=-1,g=null;a&&(g=new ResizeObserver(y=>{let[T]=y;T&&T.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var C;(C=g)==null||C.observe(t)})),n()}),u&&!l&&g.observe(u),g.observe(t));let m,h=l?py(e):null;l&&b();function b(){const y=py(e);h&&!fy(h,y)&&n(),h=y,m=requestAnimationFrame(b)}return n(),()=>{var y;d.forEach(T=>{r&&T.removeEventListener("scroll",n),s&&T.removeEventListener("resize",n)}),p==null||p(),(y=g)==null||y.disconnect(),g=null,l&&cancelAnimationFrame(m)}}var Fd=P.useLayoutEffect,cB=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Za=function(){};function uB(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function dB(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];var s=[].concat(o);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&s.push("".concat(uB(e,a)));return s.filter(function(c){return c}).map(function(c){return String(c).trim()}).join(" ")}var hy=function(t){return xB(t)?t.filter(Boolean):ho(t)==="object"&&t!==null?[t]:[]},my=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=Wn(t,cB);return ve({},n)},pt=function(t,n,o){var r=t.cx,s=t.getStyles,a=t.getClassNames,c=t.className;return{css:s(n,t),className:r(o??{},a(n,t),c)}};function Ja(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function pB(e){return Ja(e)?window.innerHeight:e.clientHeight}function gy(e){return Ja(e)?window.pageYOffset:e.scrollTop}function qa(e,t){if(Ja(e)){window.scrollTo(0,t);return}e.scrollTop=t}function fB(e){var t=getComputedStyle(e),n=t.position==="absolute",o=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var r=e;r=r.parentElement;)if(t=getComputedStyle(r),!(n&&t.position==="static")&&o.test(t.overflow+t.overflowY+t.overflowX))return r;return document.documentElement}function hB(e,t,n,o){return n*((e=e/o-1)*e*e+1)+t}function Ka(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Za,r=gy(e),s=t-r,a=10,c=0;function l(){c+=a;var u=hB(c,r,s,n);qa(e,u),c<n?window.requestAnimationFrame(l):o(e)}l()}function by(e,t){var n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=t.offsetHeight/3;o.bottom+r>n.bottom?qa(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight)):o.top-r<n.top&&qa(e,Math.max(t.offsetTop-r,0))}function mB(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function vy(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function gB(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var yy=!1,bB={get passive(){return yy=!0}},Qa=typeof window<"u"?window:{};Qa.addEventListener&&Qa.removeEventListener&&(Qa.addEventListener("p",Za,bB),Qa.removeEventListener("p",Za,!1));var vB=yy;function yB(e){return e!=null}function xB(e){return Array.isArray(e)}function el(e,t,n){return e?t:n}function N9(e){return e}function k9(e){return e}var CB=function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];var s=Object.entries(t).filter(function(a){var c=Gn(a,1),l=c[0];return!o.includes(l)});return s.reduce(function(a,c){var l=Gn(c,2),u=l[0],d=l[1];return a[u]=d,a},{})},EB=["children","innerProps"],IB=["children","innerProps"];function TB(e){var t=e.maxHeight,n=e.menuEl,o=e.minHeight,r=e.placement,s=e.shouldScroll,a=e.isFixedPosition,c=e.controlHeight,l=fB(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var d=l.getBoundingClientRect(),p=d.height,f=n.getBoundingClientRect(),g=f.bottom,m=f.height,h=f.top,b=n.offsetParent.getBoundingClientRect(),y=b.top,T=a?window.innerHeight:pB(l),C=gy(l),I=parseInt(getComputedStyle(n).marginBottom,10),x=parseInt(getComputedStyle(n).marginTop,10),R=y-x,w=T-h,O=R+C,M=p-C-h,N=g-T+C+I,j=C+h-x,W=160;switch(r){case"auto":case"bottom":if(w>=m)return{placement:"bottom",maxHeight:t};if(M>=m&&!a)return s&&Ka(l,N,W),{placement:"bottom",maxHeight:t};if(!a&&M>=o||a&&w>=o){s&&Ka(l,N,W);var D=a?w-I:M-I;return{placement:"bottom",maxHeight:D}}if(r==="auto"||a){var L=t,_=a?R:O;return _>=o&&(L=Math.min(_-I-c,t)),{placement:"top",maxHeight:L}}if(r==="bottom")return s&&qa(l,N),{placement:"bottom",maxHeight:t};break;case"top":if(R>=m)return{placement:"top",maxHeight:t};if(O>=m&&!a)return s&&Ka(l,j,W),{placement:"top",maxHeight:t};if(!a&&O>=o||a&&R>=o){var V=t;return(!a&&O>=o||a&&R>=o)&&(V=a?R-x:O-x),s&&Ka(l,j,W),{placement:"top",maxHeight:V}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return u}function SB(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var xy=function(t){return t==="auto"?"bottom":t},wB=function(t,n){var o,r=t.placement,s=t.theme,a=s.borderRadius,c=s.spacing,l=s.colors;return ve((o={label:"menu"},zi(o,SB(r),"100%"),zi(o,"position","absolute"),zi(o,"width","100%"),zi(o,"zIndex",1),o),n?{}:{backgroundColor:l.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:c.menuGutter,marginTop:c.menuGutter})},Cy=P.createContext(null),RB=function(t){var n=t.children,o=t.minMenuHeight,r=t.maxMenuHeight,s=t.menuPlacement,a=t.menuPosition,c=t.menuShouldScrollIntoView,l=t.theme,u=P.useContext(Cy)||{},d=u.setPortalPlacement,p=P.useRef(null),f=P.useState(r),g=Gn(f,2),m=g[0],h=g[1],b=P.useState(null),y=Gn(b,2),T=y[0],C=y[1],I=l.spacing.controlHeight;return Fd(function(){var x=p.current;if(x){var R=a==="fixed",w=c&&!R,O=TB({maxHeight:r,menuEl:x,minHeight:o,placement:s,shouldScroll:w,isFixedPosition:R,controlHeight:I});h(O.maxHeight),C(O.placement),d==null||d(O.placement)}},[r,s,a,c,o,d,I]),n({ref:p,placerProps:ve(ve({},t),{},{placement:T||xy(s),maxHeight:m})})},OB=function(t){var n=t.children,o=t.innerRef,r=t.innerProps;return ge("div",E({},pt(t,"menu",{menu:!0}),{ref:o},r),n)},AB=OB,PB=function(t,n){var o=t.maxHeight,r=t.theme.spacing.baseUnit;return ve({maxHeight:o,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:r,paddingTop:r})},MB=function(t){var n=t.children,o=t.innerProps,r=t.innerRef,s=t.isMulti;return ge("div",E({},pt(t,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:r},o),n)},Ey=function(t,n){var o=t.theme,r=o.spacing.baseUnit,s=o.colors;return ve({textAlign:"center"},n?{}:{color:s.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},NB=Ey,kB=Ey,BB=function(t){var n=t.children,o=n===void 0?"No options":n,r=t.innerProps,s=Wn(t,EB);return ge("div",E({},pt(ve(ve({},s),{},{children:o,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),o)},DB=function(t){var n=t.children,o=n===void 0?"Loading...":n,r=t.innerProps,s=Wn(t,IB);return ge("div",E({},pt(ve(ve({},s),{},{children:o,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),o)},jB=function(t){var n=t.rect,o=t.offset,r=t.position;return{left:n.left,position:r,top:o,width:n.width,zIndex:1}},FB=function(t){var n=t.appendTo,o=t.children,r=t.controlElement,s=t.innerProps,a=t.menuPlacement,c=t.menuPosition,l=P.useRef(null),u=P.useRef(null),d=P.useState(xy(a)),p=Gn(d,2),f=p[0],g=p[1],m=P.useMemo(function(){return{setPortalPlacement:g}},[]),h=P.useState(null),b=Gn(h,2),y=b[0],T=b[1],C=P.useCallback(function(){if(r){var w=mB(r),O=c==="fixed"?0:window.pageYOffset,M=w[f]+O;(M!==(y==null?void 0:y.offset)||w.left!==(y==null?void 0:y.rect.left)||w.width!==(y==null?void 0:y.rect.width))&&T({offset:M,rect:w})}},[r,c,f,y==null?void 0:y.offset,y==null?void 0:y.rect.left,y==null?void 0:y.rect.width]);Fd(function(){C()},[C]);var I=P.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),r&&l.current&&(u.current=lB(r,l.current,C,{elementResize:"ResizeObserver"in window}))},[r,C]);Fd(function(){I()},[I]);var x=P.useCallback(function(w){l.current=w,I()},[I]);if(!n&&c!=="fixed"||!y)return null;var R=ge("div",E({ref:x},pt(ve(ve({},t),{},{offset:y.offset,position:c,rect:y.rect}),"menuPortal",{"menu-portal":!0}),s),o);return ge(Cy.Provider,{value:m},n?jo.createPortal(R,n):R)},VB=function(t){var n=t.isDisabled,o=t.isRtl;return{label:"container",direction:o?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},LB=function(t){var n=t.children,o=t.innerProps,r=t.isDisabled,s=t.isRtl;return ge("div",E({},pt(t,"container",{"--is-disabled":r,"--is-rtl":s}),o),n)},_B=function(t,n){var o=t.theme.spacing,r=t.isMulti,s=t.hasValue,a=t.selectProps.controlShouldRenderValue;return ve({alignItems:"center",display:r&&s&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(o.baseUnit/2,"px ").concat(o.baseUnit*2,"px")})},$B=function(t){var n=t.children,o=t.innerProps,r=t.isMulti,s=t.hasValue;return ge("div",E({},pt(t,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":s}),o),n)},GB=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},WB=function(t){var n=t.children,o=t.innerProps;return ge("div",E({},pt(t,"indicatorsContainer",{indicators:!0}),o),n)},Iy,zB=["size"],HB=["innerProps","isRtl","size"];function XB(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var UB=process.env.NODE_ENV==="production"?{name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"}:{name:"tj5bde-Svg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;label:Svg;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3gsIGtleWZyYW1lcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHtcbiAgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWUsXG4gIENTU09iamVjdFdp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toString:XB},Ty=function(t){var n=t.size,o=Wn(t,zB);return ge("svg",E({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:UB},o))},Vd=function(t){return ge(Ty,E({size:20},t),ge("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Sy=function(t){return ge(Ty,E({size:20},t),ge("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},wy=function(t,n){var o=t.isFocused,r=t.theme,s=r.spacing.baseUnit,a=r.colors;return ve({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:o?a.neutral60:a.neutral20,padding:s*2,":hover":{color:o?a.neutral80:a.neutral40}})},YB=wy,ZB=function(t){var n=t.children,o=t.innerProps;return ge("div",E({},pt(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),o),n||ge(Sy,null))},JB=wy,qB=function(t){var n=t.children,o=t.innerProps;return ge("div",E({},pt(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),o),n||ge(Vd,null))},KB=function(t,n){var o=t.isDisabled,r=t.theme,s=r.spacing.baseUnit,a=r.colors;return ve({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:o?a.neutral10:a.neutral20,marginBottom:s*2,marginTop:s*2})},QB=function(t){var n=t.innerProps;return ge("span",E({},n,pt(t,"indicatorSeparator",{"indicator-separator":!0})))},eD=co(Iy||(Iy=Z3([`
256
256
  0%, 80%, 100% { opacity: 0; }