@3sc/common-component 0.0.110 → 0.0.111
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.es.js +44 -19
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
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[av]=this[av]={accessors:{}}).accessors,r=this.prototype;function s(a){const c=Fi(a);o[c]||(gN(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 od(e,t){const n=this||ji,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 lv(e){return!!(e&&e.__CANCEL__)}function Tr(e,t,n){we.call(this,e??"canceled",we.ERR_CANCELED,t,n),this.name="CanceledError"}G.inherits(Tr,we,{__CANCEL__:!0});function cv(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 bN(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function vN(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 m=d&&u-d;return m?Math.round(f*1e3/m):void 0}}function yN(e,t){let n=0;const o=1e3/t;let r=null;return function(){const a=this===!0,c=Date.now();if(a||c-n>o)return r&&(clearTimeout(r),r=null),n=c,e.apply(null,arguments);r||(r=setTimeout(()=>(r=null,n=Date.now(),e.apply(null,arguments)),o-(c-n)))}}const Ra=(e,t,n=3)=>{let o=0;const r=vN(50,250);return yN(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};p[t?"download":"upload"]=!0,e(p)},n)},xN=xn.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let o;function r(s){let a=s;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return o=r(window.location.href),function(a){const c=G.isString(a)?r(a):a;return c.protocol===o.protocol&&c.host===o.host}}():function(){return function(){return!0}}(),CN=xn.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 TN(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function EN(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function uv(e,t){return e&&!TN(t)?EN(e,t):t}const dv=e=>e instanceof zt?{...e}:e;function Oo(e,t){t=t||{};const n={};function o(u,d,p){return G.isPlainObject(u)&&G.isPlainObject(d)?G.merge.call({caseless:p},u,d):G.isPlainObject(d)?G.merge({},d):G.isArray(d)?d.slice():d}function r(u,d,p){if(G.isUndefined(d)){if(!G.isUndefined(u))return o(void 0,u,p)}else return o(u,d,p)}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)=>r(dv(u),dv(d),!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 pv=e=>{const t=Oo({},e);let{data:n,withXSRFToken:o,xsrfHeaderName:r,xsrfCookieName:s,headers:a,auth:c}=t;t.headers=a=zt.from(a),t.url=ov(uv(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(xn.hasStandardBrowserEnv||xn.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(xn.hasStandardBrowserEnv&&(o&&G.isFunction(o)&&(o=o(t)),o||o!==!1&&xN(t.url))){const u=r&&s&&CN.read(s);u&&a.set(r,u)}return t},IN=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,o){const r=pv(e);let s=r.data;const a=zt.from(r.headers).normalize();let{responseType:c}=r,l;function u(){r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener("abort",l)}let d=new XMLHttpRequest;d.open(r.method.toUpperCase(),r.url,!0),d.timeout=r.timeout;function p(){if(!d)return;const m=zt.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),h={data:!c||c==="text"||c==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:m,config:e,request:d};cv(function(b){n(b),u()},function(b){o(b),u()},h),d=null}"onloadend"in d?d.onloadend=p:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(p)},d.onabort=function(){d&&(o(new we("Request aborted",we.ECONNABORTED,r,d)),d=null)},d.onerror=function(){o(new we("Network Error",we.ERR_NETWORK,r,d)),d=null},d.ontimeout=function(){let g=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const h=r.transitional||iv;r.timeoutErrorMessage&&(g=r.timeoutErrorMessage),o(new we(g,h.clarifyTimeoutError?we.ETIMEDOUT:we.ECONNABORTED,r,d)),d=null},s===void 0&&a.setContentType(null),"setRequestHeader"in d&&G.forEach(a.toJSON(),function(g,h){d.setRequestHeader(h,g)}),G.isUndefined(r.withCredentials)||(d.withCredentials=!!r.withCredentials),c&&c!=="json"&&(d.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&d.addEventListener("progress",Ra(r.onDownloadProgress,!0)),typeof r.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",Ra(r.onUploadProgress)),(r.cancelToken||r.signal)&&(l=m=>{d&&(o(!m||m.type?new Tr(null,e,d):m),d.abort(),d=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener("abort",l)));const f=bN(r.url);if(f&&xn.protocols.indexOf(f)===-1){o(new we("Unsupported protocol "+f+":",we.ERR_BAD_REQUEST,e));return}d.send(s||null)})},SN=(e,t)=>{let n=new AbortController,o;const r=function(l){if(!o){o=!0,a();const u=l instanceof Error?l:this.reason;n.abort(u instanceof we?u:new Tr(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{r(new we(`timeout ${t} of ms exceeded`,we.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(l=>{l&&(l.removeEventListener?l.removeEventListener("abort",r):l.unsubscribe(r))}),e=null)};e.forEach(l=>l&&l.addEventListener&&l.addEventListener("abort",r));const{signal:c}=n;return c.unsubscribe=a,[c,()=>{s&&clearTimeout(s),s=null}]},wN=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let o=0,r;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},AN=async function*(e,t,n){for await(const o of e)yield*wN(ArrayBuffer.isView(o)?o:await n(String(o)),t)},fv=(e,t,n,o,r)=>{const s=AN(e,t,r);let a=0;return new ReadableStream({type:"bytes",async pull(c){const{done:l,value:u}=await s.next();if(l){c.close(),o();return}let d=u.byteLength;n&&n(a+=d),c.enqueue(new Uint8Array(u))},cancel(c){return o(c),s.return()}},{highWaterMark:2})},hv=(e,t)=>{const n=e!=null;return o=>setTimeout(()=>t({lengthComputable:n,total:e,loaded:o}))},Pa=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",mv=Pa&&typeof ReadableStream=="function",rd=Pa&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ON=mv&&(()=>{let e=!1;const t=new Request(xn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),gv=64*1024,id=mv&&!!(()=>{try{return G.isReadableStream(new Response("").body)}catch{}})(),Na={stream:id&&(e=>e.body)};Pa&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Na[t]&&(Na[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 RN=async e=>{if(e==null)return 0;if(G.isBlob(e))return e.size;if(G.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(G.isArrayBufferView(e))return e.byteLength;if(G.isURLSearchParams(e)&&(e=e+""),G.isString(e))return(await rd(e)).byteLength},PN=async(e,t)=>{const n=G.toFiniteNumber(e.getContentLength());return n??RN(t)},sd={http:Q4,xhr:IN,fetch:Pa&&(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}=pv(e);u=u?(u+"").toLowerCase():"text";let[m,g]=r||s||a?SN([r,s],a):[],h,y;const b=()=>{!h&&setTimeout(()=>{m&&m.unsubscribe()}),h=!0};let I;try{if(l&&ON&&n!=="get"&&n!=="head"&&(I=await PN(d,o))!==0){let w=new Request(t,{method:"POST",body:o,duplex:"half"}),A;G.isFormData(o)&&(A=w.headers.get("content-type"))&&d.setContentType(A),w.body&&(o=fv(w.body,gv,hv(I,Ra(l)),null,rd))}G.isString(p)||(p=p?"cors":"omit"),y=new Request(t,{...f,signal:m,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:o,duplex:"half",withCredentials:p});let C=await fetch(y);const S=id&&(u==="stream"||u==="response");if(id&&(c||S)){const w={};["status","statusText","headers"].forEach(O=>{w[O]=C[O]});const A=G.toFiniteNumber(C.headers.get("content-length"));C=new Response(fv(C.body,gv,c&&hv(A,Ra(c,!0)),S&&b,rd),w)}u=u||"text";let x=await Na[G.findKey(Na,u)||"text"](C,e);return!S&&b(),g&&g(),await new Promise((w,A)=>{cv(w,A,{data:x,headers:zt.from(C.headers),status:C.status,statusText:C.statusText,config:e,request:y})})}catch(C){throw b(),C&&C.name==="TypeError"&&/fetch/i.test(C.message)?Object.assign(new we("Network Error",we.ERR_NETWORK,e,y),{cause:C.cause||C}):we.from(C,C&&C.code,e,y)}})};G.forEach(sd,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const bv=e=>`- ${e}`,NN=e=>G.isFunction(e)||e===null||e===!1,vv={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,!NN(n)&&(o=sd[(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(bv).join(`
|
|
252
252
|
`):" "+bv(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:sd};function ad(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Tr(null,e)}function yv(e){return ad(e),e.headers=zt.from(e.headers),e.data=od.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),vv.getAdapter(e.adapter||ji.adapter)(e).then(function(o){return ad(e),o.data=od.call(e,e.transformResponse,o),o.headers=zt.from(o.headers),o},function(o){return lv(o)||(ad(e),o&&o.response&&(o.response.data=od.call(e,e.transformResponse,o.response),o.response.headers=zt.from(o.response.headers))),Promise.reject(o)})}const xv="1.7.2",ld={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ld[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const Cv={};ld.transitional=function(t,n,o){function r(s,a){return"[Axios v"+xv+"] 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&&!Cv[a]&&(Cv[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}};function kN(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 cd={assertOptions:kN,validators:ld},io=cd.validators;class Ro{constructor(t){this.defaults=t,this.interceptors={request:new rv,response:new rv}}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=Oo(this.defaults,n);const{transitional:o,paramsSerializer:r,headers:s}=n;o!==void 0&&cd.assertOptions(o,{silentJSONParsing:io.transitional(io.boolean),forcedJSONParsing:io.transitional(io.boolean),clarifyTimeoutError:io.transitional(io.boolean)},!1),r!=null&&(G.isFunction(r)?n.paramsSerializer={serialize:r}:cd.assertOptions(r,{encode:io.function,serialize:io.function},!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"],g=>{delete s[g]}),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 g=[yv.bind(this),void 0];for(g.unshift.apply(g,c),g.push.apply(g,u),f=g.length,d=Promise.resolve(n);p<f;)d=d.then(g[p++],g[p++]);return d}f=c.length;let m=n;for(p=0;p<f;){const g=c[p++],h=c[p++];try{m=g(m)}catch(y){h.call(this,y);break}}try{d=yv.call(this,m)}catch(g){return Promise.reject(g)}for(p=0,f=u.length;p<f;)d=d.then(u[p++],u[p++]);return d}getUri(t){t=Oo(this.defaults,t);const n=uv(t.baseURL,t.url);return ov(n,t.params,t.paramsSerializer)}}G.forEach(["delete","get","head","options"],function(t){Ro.prototype[t]=function(n,o){return this.request(Oo(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(Oo(c||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Ro.prototype[t]=n(),Ro.prototype[t+"Form"]=n(!0)});class ud{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 Tr(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)}static source(){let t;return{token:new ud(function(r){t=r}),cancel:t}}}function MN(e){return function(n){return e.apply(null,n)}}function DN(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 Tv(e){const t=new Ro(e),n=$b(Ro.prototype.request,t);return G.extend(n,Ro.prototype,t,{allOwnKeys:!0}),G.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Tv(Oo(e,r))},n}const rt=Tv(ji);rt.Axios=Ro,rt.CanceledError=Tr,rt.CancelToken=ud,rt.isCancel=lv,rt.VERSION=xv,rt.toFormData=Aa,rt.AxiosError=we,rt.Cancel=rt.CanceledError,rt.all=function(t){return Promise.all(t)},rt.spread=MN,rt.isAxiosError=DN,rt.mergeConfig=Oo,rt.AxiosHeaders=zt,rt.formToJSON=e=>sv(G.isHTMLForm(e)?new FormData(e):e),rt.getAdapter=vv.getAdapter,rt.HttpStatusCode=dd,rt.default=rt;const pd={BASE_URL:"https://qa.3sc.ai/api",VERSION:"/v1"};/*! js-cookie v3.0.5 | MIT */function ka(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 BN={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=ka({},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,"",ka({},s,{expires:-1}))},withAttributes:function(r){return fd(this.converter,ka({},this.attributes,r))},withConverter:function(r){return fd(ka({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var jN=fd(BN,{path:"/"});const Ma=e=>{const t=localStorage.getItem(e);return t?JSON.parse(t):""},FN=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),VN=e=>{let t=0;for(let n=0;n<e.length;n++)e[n].isRead||t++;return t},LN=e=>{const t=[];return e.forEach(n=>{n.isRead||t.push(n.id)}),t},_N=(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())})),$N=(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(" ")},WN=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)))},GN=(e,t=20)=>(e==null?void 0:e.length)>t?`${e.slice(0,t)}...`:e,so={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"},Da={REFRESH:"refresh",CLOSE:"close"},zN=Object.values({"SKU Name":"sku_name",Node:"node","Channel Name":"channel_name"}),Ev=[10,25,50,100],Iv={MARK_ALL_READ:"MARK_ALL_READ"},HN=Ev.map(e=>({label:e,value:e})),vd=Ma(so.SNOP),yd=Ma(so.SELECTED_BU),xd=Ma(so.USER),XN=Ma(so.SETTINGS),Po={BU_IDS:yd==null?void 0:yd.business_unit_id,TOKEN:JSON.parse(jN.get(so.TOKEN)||null),TENANT_IDS:xd==null?void 0:xd.tenant_id,SNOP_IDS:vd==null?void 0:vd.snop_id,GRID_SETTINGS:XN},Vi={headers:{"Content-Type":"application/json",Authorization:`${bd.BEARER} ${Po.TOKEN}`}},Sv=rt.create({baseURL:pd.BASE_URL,axiosConfig:Vi});Sv.interceptors.request.use(function(e){return e},function(e){return Promise.reject(e)}),Sv.interceptors.response.use(function(e){return e},function(e){return Promise.reject(e)});const Ba={NOTIFICATION:"/notifications",SETTING:"/configuration/setting"},{TENANT_ID:UN,BU_ID:ZN}=bd,{TENANT_IDS:YN,BU_IDS:JN}=Po,ja=async({baseUrl:e,payload:t})=>{try{const n=`${e}${Ba.SETTING}/v1?${UN}=${YN}&${ZN}=${JN}`;return await rt.post(n,t,Vi)}catch(n){return n}},qN=(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:Me.SET_GRID_DATA,payload:{visibleGridColumns:u}});let d=Po.GRID_SETTINGS||{platform:{theme:"light"},grid:{}};d.grid=d.grid||{},d.grid[o]=u,localStorage.setItem(so.SETTINGS,JSON.stringify(d)),await ja({baseUrl:n,payload:d}),c()}}},KN=({columns:e,gridPath:t,baseUrl:n})=>{var p,f;const o=(f=(p=Po.GRID_SETTINGS)==null?void 0:p.grid)==null?void 0:f[t];let{definitions:r,defaultUserSettings:s,labels:a}=e;s=o??s??ek({definitions:r}),(!o||!s)&&(async()=>{try{let m=Po.GRID_SETTINGS||{platform:{theme:"light"},grid:{}};m.grid=m.grid||{},m.grid[t]=s,localStorage.setItem(so.SETTINGS,JSON.stringify(m)),await ja({baseUrl:n,payload:m})}catch(m){console.error(m)}})();const c=s.reduce((m,g)=>(m[g.id]=g,m),{}),l=a.reduce((m,g)=>(m[g.id]=g,m),{}),u=[];for(const m of r){const{id:g}=m,h=c[g],y=l[g];let b={...m,...h,...y};u.push(b)}return u.sort((m,g)=>m.sequenceId-g.sequenceId)},QN=e=>e.sort((t,n)=>t.sequenceId-n.sequenceId),ek=({definitions:e})=>e.map((t,n)=>({id:t.id,key:t.key,sequenceId:n+1,isHidden:!1,style:{}})),tk=({options:e})=>{const t=P.useRef(null),[n,o]=P.useState(!1),[r,s]=P.useState(null),[a,c]=P.useState(e),[l,u]=P.useState(!1),d=P.useContext(Mi),{hasChange:p}=P.useContext(Ta);P.useEffect(()=>{c(e)},[e]);const f=y=>{s(y)},m=y=>{y.preventDefault()},g=y=>{if(r===null)return;const b=[...a],[I]=b.splice(r,1);b.splice(y,0,I),c(b),d({type:Me.SET_GRID_DATA,payload:{visibleGridColumns:b}}),d({type:Me.HAS_SETTING_CHANGE,payload:{hasChange:!0}}),s(null)},h=()=>{p&&d({type:Me.TRIGGER_API,payload:{triggerApi:!0}}),o(!1)};return P.useEffect(()=>{if(!n)return;const y=b=>{t.current&&!t.current.contains(b.target)&&h()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[n,p,a]),P.useEffect(()=>{if(t.current){const y=t.current.getBoundingClientRect(),b=window.innerHeight-y.bottom;u(b<200)}},[n]),{dropdownRef:t,isOpen:n,items:a,expandUp:l,setIsOpen:o,handleDragStart:f,handleDragOver:m,handleDrop:g}},nk=({isOpen:e,setIsOpen:t,placeholder:n,theme:o,selectedValue:r,styles:s,children:a,dropdownRef:c,expandUp:l})=>v.jsxs(de,{sx:{position:"relative",width:"100%",flexShrink:0},ref:c,children:[v.jsx(de,{sx:{cursor:"pointer",height:"3rem",width:"100%",position:"relative",zIndex:1},onClick:()=>t(!e)}),v.jsxs(vn.div,{style:{position:"absolute",left:0,width:"100%",zIndex:1e3,border:`0.1rem solid ${o.palette.primary.notifyBorderColor}`,borderRadius:"0.7rem",color:o.palette.primary.notifyTextColor,backgroundColor:o.palette.primary.notifyBackground,overflow:"hidden",...l?{bottom:0}:{top:0}},animate:{maxHeight:e?"15rem":"3rem"},transition:{duration:.2,ease:"easeInOut"},children:[l&&v.jsxs(v.Fragment,{children:[v.jsx(Gc,{children:e&&a}),e&&v.jsx("hr",{style:{width:"100%",height:"0.1rem",backgroundColor:o.palette.primary.notifyBorderColor,border:"none",margin:"0rem"}})]}),v.jsxs(de,{sx:{padding:"0.65rem",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",gap:"0.5rem"},onClick:()=>t(!e),children:[v.jsx(de,{component:"img",className:"select-icon",src:s==null?void 0:s.icon}),v.jsx(Ot,{sx:{color:o.palette.primary.notifyTextColor,flex:1,fontSize:"1.1rem",whiteSpace:"nowrap"},children:n||r}),v.jsx(de,{component:"img",className:"child",src:e?gt.ArrowSelectDown:gt.ArrowSelectUp})]}),!l&&v.jsxs(v.Fragment,{children:[e&&v.jsx("hr",{style:{width:"100%",height:"0.1rem",backgroundColor:o.palette.primary.notifyBorderColor,border:"none",margin:"0rem"}}),v.jsx(Gc,{children:e&&a})]})]})]}),wv=({options:e,onChange:t,showCheckBox:n,placeholder:o,isDraggable:r,value:s,isMulti:a,handleCheck:c})=>{const l=nt(),{dropdownRef:u,isOpen:d,items:p,expandUp:f,setIsOpen:m,handleDragStart:g,handleDragOver:h,handleDrop:y}=tk({options:e});return v.jsx(nk,{isOpen:d,setIsOpen:m,placeholder:o,selectedValue:s,theme:l,dropdownRef:u,expandUp:f,children:v.jsx(vn.ul,{style:{listStyle:"none",padding:"0rem 1rem 0.8rem 1rem",margin:0,maxHeight:"10rem",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:`${l.palette.primary.notifyIconColor} transparent`},initial:{opacity:0},animate:{opacity:1},transition:{duration:.3,ease:"easeInOut"},children:p==null?void 0:p.map((b,I)=>{const C=b==null?void 0:b.isMandatory;return v.jsxs("li",{draggable:r&&!C,onDragStart:C?void 0:()=>g(I),onDragOver:C?void 0:h,onDrop:C?void 0:()=>y(I),style:{padding:n?"0.4rem 0":"0.2rem 0.4rem",cursor:C?"not-allowed":"pointer",display:"flex",alignItems:"center",color:C?l.palette.grey[500]:l.palette.primary.notifyTextColor,backgroundColor:l.palette.primary.notifyBackground,opacity:C?.5:1,whiteSpace:"nowrap",pointerEvents:C?"none":"auto"},onClick:()=>{C||(m(!!a),t(b))},children:[n&&v.jsx(Xs,{size:"medium",sx:{color:l.palette.primary.notifyIconColor,"&.Mui-checked":{color:l.palette.brandColor.orange},p:"0.2rem 0.5rem"},checked:c(b),disabled:C}),v.jsx(Ot,{sx:{fontSize:"1.1rem"},children:b.label})]},I)})})})},Av=({pagination:e})=>{const{selectedPage:t,rowPerPage:n,totalRecords:o,onPageChange:r,onPageSizeChange:s}=e,a=nt();return v.jsxs(de,{sx:{display:"flex",p:"1rem 2rem"},children:[v.jsxs(de,{sx:{zIndex:10,display:"flex",flexDirection:"row",gap:"0.5rem",width:"100%"},children:[v.jsx(de,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:v.jsx(Ot,{sx:{fontSize:"1.1rem",color:a.palette.primary.notifyTextColor},children:`Showing ${(t-1)*n+1} to ${t*n} of ${o} rows`})}),v.jsx(de,{sx:{display:"flex",flexDirection:"row",gap:"0.5rem",justifyContent:"space-between"},children:v.jsx(de,{sx:{display:"flex",flexDirection:"row",width:"5.2rem"},children:v.jsx(wv,{options:HN,value:n,onChange:s})})}),v.jsx(de,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:v.jsx(Ot,{sx:{fontSize:"1.1rem",color:a.palette.primary.notifyTextColor},children:"records per page"})})]}),v.jsx(Rc,{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`}}})]})};Av.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(de,{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(de,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},component:"label",children:GN(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(Ac,{open:!!e,anchorEl:e,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:v.jsx(de,{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(hc,{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 ok=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(Ot)(({theme:e})=>({color:e.palette.primary.notifyTextColor})),rk=Y(Nm)(({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)"})}})),ik=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(de,{sx:{pl:"0.5rem",pb:"0.5rem"},children:t})})},sk=Y(Ys)(({theme:e})=>({color:e.palette.primary.notifyTextColor,padding:"0.6rem 0",fontSize:"0.9rem",fontWeight:500,"&::before, &::after":{borderColor:`${e.palette.primary.notifyBorderColor}!important`}})),ak=Y(fc)(({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 lk=Y(Hm)(({theme:e})=>({"& .MuiTabs-indicator":{height:"0.1rem",backgroundColor:e.palette.primary.notifyActiveBorderColor}})),ck=Y(km)(({theme:e})=>({color:"gray","&.Mui-selected":{color:e.palette.primary.notifyActiveBorderColor,fontWeight:"bold"}})),Rv=({sortKey:e,sortField:t,sortDir:n,handleSortClick:o})=>{const r=s=>v.jsx(Ps,{onClick:o,sx:{padding:"0.5rem"},children:v.jsx(de,{component:"img",src:s})});return v.jsx(v.Fragment,{children:r(t===e?n==="asc"?gt.AscSort:gt.DescSort:gt.Unsort)})};Rv.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(de,{sx:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem"},children:[s,a&&v.jsx(Rv,{sortKey:e==null?void 0:e.key,sortField:c,sortDir:l,handleSortClick:()=>u({column:e,sortDir:l,sortField:c})}),o&&!r&&v.jsx(Ps,{onClick:d=>n(d,e),sx:{padding:"0.5rem"},children:v.jsx(de,{component:"img",src:gt.Menu})})]})}Pv.propTypes={column:i.object.isRequired,sort:i.object.isRequired,handleMenuClick:i.func,isManageable:i.bool};const uk=Y(jc)(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"table-cell",[`&.${Bc.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"},[`&.${Bc.body}`]:{color:e.palette.primary.notifyTextColor,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 1rem",textAlign:"center"}}));function Li({children:e,...t}){return v.jsx(uk,{...t,children:e})}Li.propTypes={children:i.node};const dk=Y(fi)(()=>({"&:last-child td":{borderBottom:0}}));function _i({children:e,...t}){return v.jsx(dk,{...t,children:e})}_i.propTypes={children:i.node};function Nv({sort:e,data:t,pagination:n,columns:o,nested:r,baseUrl:s,gridPath:a}){var W;const c=nt(),{visibleGridColumns:l}=P.useContext(Ta),u=P.useContext(Mi),{selectedColumn:d,handleMenuClick:p,handleClose:f,handleHideClick:m}=qN(l,u,s,a),g=o==null?void 0:o.isManageable,h=(t==null?void 0:t.length)>0,y=P.useRef(null),[b,I]=P.useState(null);let C=null;const S=QN(((W=r==null?void 0:r.column)==null?void 0:W.definitions)||[]),x=r==null?void 0:r.isNested,w=(r==null?void 0:r.data)||[],A=r==null?void 0:r.hashKey;if(!h)return v.jsx(Dn,{sx:{textAlign:"center"},children:dn.NRF});const O=(B,L)=>{I(L),B.dataTransfer.setData("colIndex",L)},k=B=>{B.preventDefault(),j(B)},N=async(B,L)=>{if(B.preventDefault(),clearInterval(C),b===null||b===L)return;const _=[...l];[_[b],_[L]]=[_[L],_[b]],u({type:Me.SET_GRID_DATA,payload:{visibleGridColumns:_}});let V=Po.GRID_SETTINGS||{platform:{theme:"light"},grid:{}};V.grid=V.grid||{},V.grid[a]=_,localStorage.setItem(so.SETTINGS,JSON.stringify(V)),await ja({baseUrl:s,payload:V}),I(null)},j=B=>{const L=y.current,{left:_,right:V}=L.getBoundingClientRect(),$=50,M=B.clientX>V-$?1:B.clientX<_+$?-1:0;M!==0?(clearInterval(C),C=setInterval(()=>{L.scrollLeft+=M*10},50)):clearInterval(C)};return v.jsxs(v.Fragment,{children:[v.jsx(Bm,{ref:y,sx:{maxHeight:"100%",overflowX:"auto",whiteSpace:"nowrap"},children:v.jsxs(Mc,{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(Fc,{children:v.jsx(_i,{children:l.map((B,L)=>B!=null&&B.isHidden?null:v.jsx(Li,{style:B==null?void 0:B.style,draggable:g,onDragStart:g?_=>O(_,L):void 0,onDragOver:g?k:void 0,onDrop:g?_=>N(_,L):void 0,children:v.jsx(Pv,{column:B,sort:e,handleMenuClick:p,isManageable:g})},L))})}),v.jsx(Dc,{children:t.map((B,L)=>{const _=B[A],V=w==null?void 0:w[_],$=(V==null?void 0:V.length)>0;return v.jsxs(v.Fragment,{children:[v.jsx(_i,{children:l.map((M,H)=>M!=null&&M.isHidden?null:v.jsx(Li,{style:M==null?void 0:M.style,children:v.jsx(Cd,{isRenderCellContent:!!(M!=null&&M.cellRenderer),column:M,row:B})},H))},L),x&&V&&v.jsx(v.Fragment,{children:$?V.map((M,H)=>v.jsx(_i,{children:S.map((D,z)=>v.jsx(Li,{style:D==null?void 0:D.style,children:v.jsx(Cd,{isRenderCellContent:!!(D!=null&&D.cellRenderer),column:D,row:M})},z))},H)):v.jsx(_i,{children:v.jsx(Li,{colSpan:S.length,children:v.jsx(Dn,{sx:{textAlign:"center"},children:dn.NRF})})})})]})})})]})}),v.jsx(Av,{pagination:n}),v.jsx(Ov,{menuOpen:d==null?void 0:d.isOpen,handleClose:f,onHideClick:m})]})}Nv.propTypes={sort:i.object,data:i.array,pagination:i.object,columns:i.object,nested:i.object};function kv({tableProps:e,mergedColumns:t,gridPath:n,baseUrl:o}){const r=P.useContext(Mi);return P.useEffect(()=>{r({type:Me.SET_GRID_DATA,payload:{visibleGridColumns:t}})},[t,r]),v.jsx(v.Fragment,{children:v.jsx(Nv,{...e,gridPath:n,baseUrl:o})})}kv.propTypes={tableProps:i.object.isRequired,mergedColumns:i.array.isRequired};const pk=e=>{if(!e)return null;const{subAction:t,...n}=e,o=t?"select":"button",r={button:s=>v.jsx(Ao,{...s}),select:s=>v.jsx(Vb,{...s})};return r[o]?r[o](n):null},fk=({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}},hk=async({baseUrl:e,gridSetting:t,gridPath:n})=>{try{const o=JSON.parse(localStorage.getItem("settings")),{settingObject:r,defaultUserSettings:s}=fk({presentSetting:o,gridSetting:t,gridPath:n});return localStorage.setItem("settings",JSON.stringify(r)),await ja({baseUrl:e,payload:r}),s}catch(o){console.error(o)}},mk=({...e})=>{const[t,n]=P.useState(!1),o=nt();return v.jsx(vn.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})},gk=({customTools:e})=>({sortedTools:e==null?void 0:e.sort((n,o)=>n.sequenceId-o.sequenceId)}),Mv=({customTools:e})=>{const{sortedTools:t}=gk({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(vn.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(de,{sx:{flexShrink:0,minWidth:"fit-content"},children:pk(l)},l.id))}),r&&v.jsx(de,{sx:{zIndex:1e3,pointerEvents:"auto"},children:v.jsx(Ao,{label:n?"":"More Actions",styles:{icon:n?gt.Cross:gt.More},onClick:()=>o(l=>!l)})})]})};Mv.propTypes={customTools:i.array.isRequired};const Dv=({defaultTools:e,isManageable:t,customTools:n,baseUrl:o,gridPath:r})=>{var d,p,f,m,g,h,y;const s=P.useContext(Mi),{visibleGridColumns:a,triggerApi:c}=P.useContext(Ta);console.log({triggerApi:c});const l=async b=>{try{await hk({baseUrl:o,gridPath:r,gridSetting:b})}catch(I){console.error(I)}finally{s({type:Me.HAS_SETTING_CHANGE,payload:{hasChange:!1}}),s({type:Me.TRIGGER_API,payload:{triggerApi:!1}})}};P.useEffect(()=>{c&&l(a)},[c]);const u=b=>{const I=[...a].map(C=>C.id===(b==null?void 0:b.id)?{...C,isHidden:!C.isHidden}:C);s({type:Me.SET_GRID_DATA,payload:{visibleGridColumns:I}}),s({type:Me.HAS_SETTING_CHANGE,payload:{hasChange:!0}})};return v.jsxs(de,{sx:{margin:"1rem 0",position:"relative",zIndex:10,display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"0.5rem",width:"100%"},children:[v.jsxs(de,{sx:{display:"flex",flexDirection:"row",gap:"0.5rem"},children:[((d=e==null?void 0:e.search)==null?void 0:d.isRequired)&&v.jsx(mk,{...e==null?void 0:e.search}),((p=e==null?void 0:e.refresh)==null?void 0:p.isRequired)&&v.jsx(Ao,{...e==null?void 0:e.refresh,styles:{...(f=e==null?void 0:e.refresh)==null?void 0:f.styles,icon:gt.Refresh}}),t&&v.jsx(de,{sx:{width:"12rem"},children:v.jsx(wv,{placeholder:"Manage Columns",options:a,value:a,isMulti:!0,showCheckBox:!0,isDraggable:!0,handleCheck:b=>{var I;return!((I=a==null?void 0:a.find(C=>C.id===b.id))!=null&&I.isHidden)},onChange:(b,I)=>u(b)})})]}),v.jsxs(de,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",gap:"0.6rem"},children:[v.jsx(Mv,{customTools:n}),((m=e==null?void 0:e.upload)==null?void 0:m.isRequired)&&v.jsx(Ao,{...e==null?void 0:e.upload,styles:{...(g=e==null?void 0:e.upload)==null?void 0:g.styles,icon:gt.Upload,color:"secondary",isAnimate:!0}}),((h=e==null?void 0:e.download)==null?void 0:h.isRequired)&&v.jsx(Ao,{...e==null?void 0:e.download,styles:{...(y=e==null?void 0:e.download)==null?void 0:y.styles,icon:gt.Download,isAnimate:!0}})]})]})};Dv.propTypes={defaultTools:i.object.isRequired,customTools:i.array,isManageable:i.bool,baseUrl:i.string,gridPath:i.gridPath};function Bv({tableProps:e,toolbarProps:t}){var s;const n=(s=e.columns)==null?void 0:s.isManageable,{columns:o}=e,r=KN({columns:o,gridPath:t.gridPath,baseUrl:t.baseUrl});return v.jsxs(_b,{children:[v.jsx(Dv,{...t,isManageable:n}),v.jsx(kv,{tableProps:e,mergedColumns:r,gridPath:t.gridPath,baseUrl:t.baseUrl})]})}Bv.propTypes={tableProps:i.object.isRequired,toolbarProps:i.object.isRequired};const jv=({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(Sc,{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(Ot,{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(de,{component:"img",src:gt.ArrowRight}),children:o({list:e})})};jv.propTypes={list:i.array.isRequired,handleLinkClick:i.func};const Fv=({breadcrumbProps:e})=>{const t=nt();return v.jsx(an,{sx:{background:t.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${t.palette.primary.notifyBorderColor}`,height:"3rem",p:"0 1.4rem",zIndex:4,position:"relative"},direction:"row",justifyContent:"space-between",alignItems:"center",children:v.jsx(jv,{...e})})};Fv.propTypes={breadcrumbProps:i.object.isRequired};function Vv({headerProps:e}){return v.jsx(Ca,{children:v.jsx(Fv,{...e})})}Vv.propTypes={headerProps:i.object.isRequired};const Td=P.createContext(null),Lv=P.createContext(null);function bk({children:e}){const[t,n]=P.useReducer(vk,yk);return v.jsx(Td.Provider,{value:t,children:v.jsx(Lv.Provider,{value:n,children:e})})}function vk(e,t){var n;switch(t.type){case Me.LOADING:return{...e,loading:t.loading};case Me.SUCCESS:return{...e,data:(n=t.data)==null?void 0:n.sort((o,r)=>new Date(r.createdAt)-new Date(o.createdAt))};case Me.MARK_ALL_AS_READ:return{...e,isMarkAllAsRead:t.isMarkAllAsRead};case Me.ERROR:return{...e,error:t.error};default:throw new Error(`${dn.UNHANDLED}: ${t}`)}}const yk={loading:!1,data:[],error:"",isMarkAllAsRead:{count:0,boo:!1}},{TENANT_ID:Ed,BU_ID:Id,SNOP_ID:_v}=bd,{TENANT_IDS:Sd,BU_IDS:wd}=Po,xk=async e=>{try{const t=`${e}${Ba.NOTIFICATION}/v1?${Ed}=${Sd}&${Id}=${wd}`;return await rt.get(t,Vi)}catch(t){return t}},$v=async(e,t,n)=>{try{const o=n===Iv.MARK_ALL_READ?"":`&${_v}=${n}&`,r=`${e}${Ba.NOTIFICATION}${pd.VERSION}?${Ed}=${Sd}&${Id}=${wd}${o}`;return await rt.put(r,t,Vi)}catch(o){return o}},Ck=async({baseUrl:e,id:t,snopId:n})=>{try{const o=`${e}${Ba.NOTIFICATION}${pd.VERSION}?${Ed}=${Sd}&${Id}=${wd}&${_v}=${n}&id=${t}`;return await rt.get(o,Vi)}catch(o){return o}},Fa={OK:200,CREATED:201,NO_CONTENT:204,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,INTERNAL_SERVER_ERROR:500};var Wv,Gv,zv,Hv;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 Tk=function(t){return E.createElement("svg",Ad({xmlns:"http://www.w3.org/2000/svg",width:16,height:18,fill:"none"},t),Wv||(Wv=E.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"})),Gv||(Gv=E.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"})),zv||(zv=E.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"})),Hv||(Hv=E.createElement("circle",{cx:12.266,cy:3,r:2.5,fill:"#E85353",stroke:"#F8FAFB"})))};const Ek=({count:e})=>(nt(),v.jsxs(v.Fragment,{children:[v.jsx(de,{sx:{gap:"0.5rem",display:"flex",justifyContent:"center",alignItems:"center"},className:"notify-icon-container",children:v.jsx(Tk,{style:{scale:2}})}),v.jsx(ak,{badgeContent:e==0?"":null,color:"error"})]}));var Xv;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 Ik=function(t){return E.createElement("svg",Od({xmlns:"http://www.w3.org/2000/svg",width:13,height:8,fill:"none"},t),Xv||(Xv=E.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 Uv=({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:m,data:g,toggleNotify:h,mode:y,isDetail:b=!1,...I})=>{var O,k;const[C,S]=P.useState(0),x=nt(),w=(N,j)=>{S(j)},A=()=>{switch(d){case Da.REFRESH:return v.jsx(de,{component:"img",src:gt.Refresh,alt:"refresh",onClick:o,sx:{cursor:"pointer"}});case Da.CLOSE:return v.jsx(de,{component:"img",src:gt.Close,alt:"refresh",onClick:r,sx:{cursor:"pointer"}});default:return null}};return v.jsxs(ok,{maxWidth:b?"xs":"md",onClose:r,...I,className:["notification-dialog",f,m==="notifcation-dialog"?"notification-main-box":""].join(" "),dialogType:!0,children:[v.jsxs(de,{sx:m==="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(de,{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})]}),A()]}),b?v.jsx(v.Fragment,{children:n}):v.jsxs(v.Fragment,{children:[v.jsx(de,{sx:{borderBottom:1,borderColor:x.palette.primary.notifyBorderColor},className:"tab-panel",children:v.jsx(lk,{value:C,onChange:w,children:v.jsx(ck,{label:v.jsxs(de,{sx:{display:"flex",alignItems:"center",fontSize:"1rem"},children:["All (",v.jsx(Ot,{component:"span",sx:{fontWeight:"bold"},children:((O=g==null?void 0:g.filter(N=>!(N!=null&&N.isRead)))==null?void 0:O.length)||0}),")"]})})})}),v.jsx(ik,{value:C,index:0,children:n})]}),p&&v.jsxs(xc,{className:"dialog-action",sx:{px:"1rem"},children:[v.jsxs(an,{direction:"row",gap:1,children:[v.jsx(Dn,{sx:{fontSize:"0.9rem"},children:"Only show unread"}),v.jsx(rk,{disabled:s,checked:y,onChange:h})]}),v.jsx(hc,{variant:"outlined",className:"view-all",onClick:c,startIcon:v.jsx(Ik,{}),disabled:!((k=g==null?void 0:g.filter(N=>!(N!=null&&N.isRead)))!=null&&k.length),style:{backgroundColor:"transparent"},sx:{p:0,color:x.palette.primary.notifyTextColor},children:"Mark all as read"})]})]})};var Zv,Yv;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 Sk=function(t){return E.createElement("svg",Rd({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},t),Zv||(Zv=E.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"})),Yv||(Yv=E.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"})))},Jv;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 wk=function(t){return E.createElement("svg",Pd({xmlns:"http://www.w3.org/2000/svg",width:9,height:8,fill:"none"},t),Jv||(Jv=E.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,y;const m=nt(),g=(y=(h=JSON.parse(localStorage.getItem("settings")))==null?void 0:h.platform)==null?void 0:y.theme;return v.jsxs(de,{className:"cards",children:[v.jsxs(an,{display:"flex",flexDirection:"row",alignItems:"start",justifyContent:"space-between",gap:1,children:[s&&v.jsx(Xs,{checked:!!a.includes(c),onChange:b=>l(b,c),disabled:n,sx:{padding:"4px 7px 0 7px"}}),v.jsx(fc,{sx:{"& .MuiBadge-badge":{backgroundColor:"#6041EA"}},variant:"dot",className:"badge",invisible:n,children:v.jsx(Dn,{sx:{color:m.palette.primary.notifyActiveText},component:"p",className:["title-card",n&&"read"].join(" "),children:t})})]}),v.jsxs(an,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:[v.jsxs(an,{display:"flex",flexDirection:"row",justifyContent:"start",gap:1,sx:{p:"0.5rem 0"},children:[f&&v.jsx(lc,{icon:v.jsx(Sk,{className:`${g==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:u,onClick:o,label:u===c?v.jsx(oi,{color:"primary",size:13}):"Show Details",component:"button",variant:"filled",clickable:!0,size:"small",sx:{height:"2rem",fontWeight:"300",fontSize:"0.9rem",color:m.palette.primary.notifyActiveText,borderColor:m.palette.primary.notifyBorderColor,background:m.palette.primary.notifyButtonBackground,borderRadius:"0.6rem",padding:"0.2rem"}}),!n&&v.jsx(lc,{icon:v.jsx(wk,{className:`${g==="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:m.palette.primary.notifyBorderColor,color:m.palette.primary.notifyActiveText,borderRadius:"0.6rem",padding:"0.2rem"}})]}),v.jsxs(an,{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:m.palette.primary.notifyTextColor,children:"•"}),v.jsx(Dn,{sx:{fontSize:"0.9rem"},children:FN(p)})]})]})]})};qv.propTypes={type:i.string,title:i.string,subTitle:i.string,isRead:i.bool,handleShowDetails:i.func,handleRead:i.func};const Kv=({data:e,handleRead:t,handleShowDetails:n,clickId:o,mode:r,page:s,setPage:a})=>{P.useContext(Td);const c=new Date,l=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"long",year:"numeric"}).format(c),[u,d]=P.useState([]),[p,f]=P.useState(!1),[m,g]=P.useState(!0),h=P.useRef(null),y=nt();return P.useEffect(()=>{d([...e])},[e]),P.useEffect(()=>{const b=new IntersectionObserver(I=>{I[0].isIntersecting&&!p&&m&&a(C=>C+1)},{threshold:1});return h.current&&b.observe(h.current),()=>{h.current&&b.unobserve(h.current)}},[p,m]),v.jsxs(de,{sx:u.length?{py:"0.5rem"}:{py:"0.5rem",justifyContent:"center",alignItems:"center",display:"flex",height:"100%"},children:[Object.entries(WN(u)).map(([b,I])=>v.jsxs(P.Fragment,{children:[b!==l&&v.jsx(sk,{children:b}),I.map((C,S)=>v.jsx(qv,{type:"success",title:C.message,subTitle:C.createdAt,isRead:C.isRead,handleShowDetails:()=>n(C.id,C.snopId),handleRead:()=>t([C.id],C.snopId),clickId:o,id:C.id,product:C.product,createdAt:C.createdAt,isShowVisible:C==null?void 0:C.isNotificationDetails},C.id||S))]},b)),p&&s>1&&!!(u!=null&&u.length)&&v.jsx(de,{sx:{display:"flex",justifyContent:"center",alignItems:"center",pl:"0.5rem",py:"0.3rem"},children:v.jsx(oi,{size:20,className:"circular-loader"})}),!(u!=null&&u.length)&&v.jsx(Ot,{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(de,{ref:h,style:{height:"0.1rem",backgroundColor:"transparent"}})]})};Kv.propTypes={data:i.array,handleRead:i.func,handleShowDetails:i.func};function $i(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 Qv(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?Qv(Object(n),!0).forEach(function(o){$i(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qv(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Ak(e){if(Array.isArray(e))return e}function Ok(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 Nd(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 ey(e,t){if(e){if(typeof e=="string")return Nd(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)?Nd(e,t):void 0}}function Rk(){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=Oo(this.defaults,n);const{transitional:o,paramsSerializer:r,headers:s}=n;o!==void 0&&cd.assertOptions(o,{silentJSONParsing:io.transitional(io.boolean),forcedJSONParsing:io.transitional(io.boolean),clarifyTimeoutError:io.transitional(io.boolean)},!1),r!=null&&(G.isFunction(r)?n.paramsSerializer={serialize:r}:cd.assertOptions(r,{encode:io.function,serialize:io.function},!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"],g=>{delete s[g]}),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 g=[yv.bind(this),void 0];for(g.unshift.apply(g,c),g.push.apply(g,u),f=g.length,d=Promise.resolve(n);p<f;)d=d.then(g[p++],g[p++]);return d}f=c.length;let m=n;for(p=0;p<f;){const g=c[p++],h=c[p++];try{m=g(m)}catch(y){h.call(this,y);break}}try{d=yv.call(this,m)}catch(g){return Promise.reject(g)}for(p=0,f=u.length;p<f;)d=d.then(u[p++],u[p++]);return d}getUri(t){t=Oo(this.defaults,t);const n=uv(t.baseURL,t.url);return ov(n,t.params,t.paramsSerializer)}}G.forEach(["delete","get","head","options"],function(t){Ro.prototype[t]=function(n,o){return this.request(Oo(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(Oo(c||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Ro.prototype[t]=n(),Ro.prototype[t+"Form"]=n(!0)});class ud{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 Tr(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)}static source(){let t;return{token:new ud(function(r){t=r}),cancel:t}}}function MN(e){return function(n){return e.apply(null,n)}}function DN(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 Tv(e){const t=new Ro(e),n=$b(Ro.prototype.request,t);return G.extend(n,Ro.prototype,t,{allOwnKeys:!0}),G.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Tv(Oo(e,r))},n}const rt=Tv(ji);rt.Axios=Ro,rt.CanceledError=Tr,rt.CancelToken=ud,rt.isCancel=lv,rt.VERSION=xv,rt.toFormData=Aa,rt.AxiosError=we,rt.Cancel=rt.CanceledError,rt.all=function(t){return Promise.all(t)},rt.spread=MN,rt.isAxiosError=DN,rt.mergeConfig=Oo,rt.AxiosHeaders=zt,rt.formToJSON=e=>sv(G.isHTMLForm(e)?new FormData(e):e),rt.getAdapter=vv.getAdapter,rt.HttpStatusCode=dd,rt.default=rt;const pd={BASE_URL:"https://qa.3sc.ai/api",VERSION:"/v1"};/*! js-cookie v3.0.5 | MIT */function ka(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 BN={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=ka({},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,"",ka({},s,{expires:-1}))},withAttributes:function(r){return fd(this.converter,ka({},this.attributes,r))},withConverter:function(r){return fd(ka({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var jN=fd(BN,{path:"/"});const Ma=e=>{const t=localStorage.getItem(e);return t?JSON.parse(t):""},FN=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),VN=e=>{let t=0;for(let n=0;n<e.length;n++)e[n].isRead||t++;return t},LN=e=>{const t=[];return e.forEach(n=>{n.isRead||t.push(n.id)}),t},_N=(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())})),$N=(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(" ")},WN=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)))},GN=(e,t=20)=>(e==null?void 0:e.length)>t?`${e.slice(0,t)}...`:e,so={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"},Da={REFRESH:"refresh",CLOSE:"close"},zN=Object.values({"SKU Name":"sku_name",Node:"node","Channel Name":"channel_name"}),Ev=[10,25,50,100],Iv={MARK_ALL_READ:"MARK_ALL_READ"},HN=Ev.map(e=>({label:e,value:e})),vd=Ma(so.SNOP),yd=Ma(so.SELECTED_BU),xd=Ma(so.USER),XN=Ma(so.SETTINGS),Po={BU_IDS:yd==null?void 0:yd.business_unit_id,TOKEN:JSON.parse(jN.get(so.TOKEN)||null),TENANT_IDS:xd==null?void 0:xd.tenant_id,SNOP_IDS:vd==null?void 0:vd.snop_id,GRID_SETTINGS:XN},Vi={headers:{"Content-Type":"application/json",Authorization:`${bd.BEARER} ${Po.TOKEN}`}},Sv=rt.create({baseURL:pd.BASE_URL,axiosConfig:Vi});Sv.interceptors.request.use(function(e){return e},function(e){return Promise.reject(e)}),Sv.interceptors.response.use(function(e){return e},function(e){return Promise.reject(e)});const Ba={NOTIFICATION:"/notifications",SETTING:"/configuration/setting"},{TENANT_ID:UN,BU_ID:ZN}=bd,{TENANT_IDS:YN,BU_IDS:JN}=Po,ja=async({baseUrl:e,payload:t})=>{try{const n=`${e}${Ba.SETTING}/v1?${UN}=${YN}&${ZN}=${JN}`;return await rt.post(n,t,Vi)}catch(n){return n}},qN=(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:Me.SET_GRID_DATA,payload:{visibleGridColumns:u}});let d=Po.GRID_SETTINGS||{platform:{theme:"light"},grid:{}};d.grid=d.grid||{},d.grid[o]=u,localStorage.setItem(so.SETTINGS,JSON.stringify(d)),await ja({baseUrl:n,payload:d}),c()}}},KN=({columns:e,gridPath:t,baseUrl:n,isDefaultConfig:o})=>{var p,f;let{definitions:r,defaultUserSettings:s,labels:a}=e;if(!o){const m=(f=(p=Po.GRID_SETTINGS)==null?void 0:p.grid)==null?void 0:f[t];s=m??s??ek({definitions:r}),(!m||!s)&&(async()=>{try{let g=Po.GRID_SETTINGS||{platform:{theme:"light"},grid:{}};g.grid=g.grid||{},g.grid[t]=s,localStorage.setItem(so.SETTINGS,JSON.stringify(g)),await ja({baseUrl:n,payload:g})}catch(g){console.error(g)}})()}const c=s.reduce((m,g)=>(m[g.id]=g,m),{}),l=a.reduce((m,g)=>(m[g.id]=g,m),{}),u=[];for(const m of r){const{id:g}=m,h=c[g],y=l[g];let b={...m,...h,...y};u.push(b)}return u.sort((m,g)=>m.sequenceId-g.sequenceId)},QN=e=>e.sort((t,n)=>t.sequenceId-n.sequenceId),ek=({definitions:e})=>e.map((t,n)=>({id:t.id,key:t.key,sequenceId:n+1,isHidden:!1,style:{}})),tk=({options:e})=>{const t=P.useRef(null),[n,o]=P.useState(!1),[r,s]=P.useState(null),[a,c]=P.useState(e),[l,u]=P.useState(!1),d=P.useContext(Mi),{hasChange:p}=P.useContext(Ta);P.useEffect(()=>{c(e)},[e]);const f=y=>{s(y)},m=y=>{y.preventDefault()},g=y=>{if(r===null)return;const b=[...a],[I]=b.splice(r,1);b.splice(y,0,I),c(b),d({type:Me.SET_GRID_DATA,payload:{visibleGridColumns:b}}),d({type:Me.HAS_SETTING_CHANGE,payload:{hasChange:!0}}),s(null)},h=()=>{p&&d({type:Me.TRIGGER_API,payload:{triggerApi:!0}}),o(!1)};return P.useEffect(()=>{if(!n)return;const y=b=>{t.current&&!t.current.contains(b.target)&&h()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[n,p,a]),P.useEffect(()=>{if(t.current){const y=t.current.getBoundingClientRect(),b=window.innerHeight-y.bottom;u(b<200)}},[n]),{dropdownRef:t,isOpen:n,items:a,expandUp:l,setIsOpen:o,handleDragStart:f,handleDragOver:m,handleDrop:g}},nk=({isOpen:e,setIsOpen:t,placeholder:n,theme:o,selectedValue:r,styles:s,children:a,dropdownRef:c,expandUp:l})=>v.jsxs(de,{sx:{position:"relative",width:"100%",flexShrink:0},ref:c,children:[v.jsx(de,{sx:{cursor:"pointer",height:"3rem",width:"100%",position:"relative",zIndex:1},onClick:()=>t(!e)}),v.jsxs(vn.div,{style:{position:"absolute",left:0,width:"100%",zIndex:1e3,border:`0.1rem solid ${o.palette.primary.notifyBorderColor}`,borderRadius:"0.7rem",color:o.palette.primary.notifyTextColor,backgroundColor:o.palette.primary.notifyBackground,overflow:"hidden",...l?{bottom:0}:{top:0}},animate:{maxHeight:e?"15rem":"3rem"},transition:{duration:.2,ease:"easeInOut"},children:[l&&v.jsxs(v.Fragment,{children:[v.jsx(Gc,{children:e&&a}),e&&v.jsx("hr",{style:{width:"100%",height:"0.1rem",backgroundColor:o.palette.primary.notifyBorderColor,border:"none",margin:"0rem"}})]}),v.jsxs(de,{sx:{padding:"0.65rem",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",gap:"0.5rem"},onClick:()=>t(!e),children:[v.jsx(de,{component:"img",className:"select-icon",src:s==null?void 0:s.icon}),v.jsx(Ot,{sx:{color:o.palette.primary.notifyTextColor,flex:1,fontSize:"1.1rem",whiteSpace:"nowrap"},children:n||r}),v.jsx(de,{component:"img",className:"child",src:e?gt.ArrowSelectDown:gt.ArrowSelectUp})]}),!l&&v.jsxs(v.Fragment,{children:[e&&v.jsx("hr",{style:{width:"100%",height:"0.1rem",backgroundColor:o.palette.primary.notifyBorderColor,border:"none",margin:"0rem"}}),v.jsx(Gc,{children:e&&a})]})]})]}),wv=({options:e,onChange:t,showCheckBox:n,placeholder:o,isDraggable:r,value:s,isMulti:a,handleCheck:c})=>{const l=nt(),{dropdownRef:u,isOpen:d,items:p,expandUp:f,setIsOpen:m,handleDragStart:g,handleDragOver:h,handleDrop:y}=tk({options:e});return v.jsx(nk,{isOpen:d,setIsOpen:m,placeholder:o,selectedValue:s,theme:l,dropdownRef:u,expandUp:f,children:v.jsx(vn.ul,{style:{listStyle:"none",padding:"0rem 1rem 0.8rem 1rem",margin:0,maxHeight:"10rem",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:`${l.palette.primary.notifyIconColor} transparent`},initial:{opacity:0},animate:{opacity:1},transition:{duration:.3,ease:"easeInOut"},children:p==null?void 0:p.map((b,I)=>{const C=b==null?void 0:b.isMandatory;return v.jsxs("li",{draggable:r&&!C,onDragStart:C?void 0:()=>g(I),onDragOver:C?void 0:h,onDrop:C?void 0:()=>y(I),style:{padding:n?"0.4rem 0":"0.2rem 0.4rem",cursor:C?"not-allowed":"pointer",display:"flex",alignItems:"center",color:C?l.palette.grey[500]:l.palette.primary.notifyTextColor,backgroundColor:l.palette.primary.notifyBackground,opacity:C?.5:1,whiteSpace:"nowrap",pointerEvents:C?"none":"auto"},onClick:()=>{C||(m(!!a),t(b))},children:[n&&v.jsx(Xs,{size:"medium",sx:{color:l.palette.primary.notifyIconColor,"&.Mui-checked":{color:l.palette.brandColor.orange},p:"0.2rem 0.5rem"},checked:c(b),disabled:C}),v.jsx(Ot,{sx:{fontSize:"1.1rem"},children:b.label})]},I)})})})},Av=({pagination:e})=>{const{selectedPage:t,rowPerPage:n,totalRecords:o,onPageChange:r,onPageSizeChange:s}=e,a=nt();return v.jsxs(de,{sx:{display:"flex",p:"1rem 2rem"},children:[v.jsxs(de,{sx:{zIndex:10,display:"flex",flexDirection:"row",gap:"0.5rem",width:"100%"},children:[v.jsx(de,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:v.jsx(Ot,{sx:{fontSize:"1.1rem",color:a.palette.primary.notifyTextColor},children:`Showing ${(t-1)*n+1} to ${t*n} of ${o} rows`})}),v.jsx(de,{sx:{display:"flex",flexDirection:"row",gap:"0.5rem",justifyContent:"space-between"},children:v.jsx(de,{sx:{display:"flex",flexDirection:"row",width:"5.2rem"},children:v.jsx(wv,{options:HN,value:n,onChange:s})})}),v.jsx(de,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:v.jsx(Ot,{sx:{fontSize:"1.1rem",color:a.palette.primary.notifyTextColor},children:"records per page"})})]}),v.jsx(Rc,{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`}}})]})};Av.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(de,{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(de,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},component:"label",children:GN(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(Ac,{open:!!e,anchorEl:e,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:v.jsx(de,{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(hc,{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 ok=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(Ot)(({theme:e})=>({color:e.palette.primary.notifyTextColor})),rk=Y(Nm)(({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)"})}})),ik=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(de,{sx:{pl:"0.5rem",pb:"0.5rem"},children:t})})},sk=Y(Ys)(({theme:e})=>({color:e.palette.primary.notifyTextColor,padding:"0.6rem 0",fontSize:"0.9rem",fontWeight:500,"&::before, &::after":{borderColor:`${e.palette.primary.notifyBorderColor}!important`}})),ak=Y(fc)(({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 lk=Y(Hm)(({theme:e})=>({"& .MuiTabs-indicator":{height:"0.1rem",backgroundColor:e.palette.primary.notifyActiveBorderColor}})),ck=Y(km)(({theme:e})=>({color:"gray","&.Mui-selected":{color:e.palette.primary.notifyActiveBorderColor,fontWeight:"bold"}})),Rv=({sortKey:e,sortField:t,sortDir:n,handleSortClick:o})=>{const r=s=>v.jsx(Ps,{onClick:o,sx:{padding:"0.5rem"},children:v.jsx(de,{component:"img",src:s})});return v.jsx(v.Fragment,{children:r(t===e?n==="asc"?gt.AscSort:gt.DescSort:gt.Unsort)})};Rv.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(de,{sx:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem"},children:[s,a&&v.jsx(Rv,{sortKey:e==null?void 0:e.key,sortField:c,sortDir:l,handleSortClick:()=>u({column:e,sortDir:l,sortField:c})}),o&&!r&&v.jsx(Ps,{onClick:d=>n(d,e),sx:{padding:"0.5rem"},children:v.jsx(de,{component:"img",src:gt.Menu})})]})}Pv.propTypes={column:i.object.isRequired,sort:i.object.isRequired,handleMenuClick:i.func,isManageable:i.bool};const uk=Y(jc)(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"table-cell",[`&.${Bc.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"},[`&.${Bc.body}`]:{color:e.palette.primary.notifyTextColor,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 1rem",textAlign:"center"}}));function Li({children:e,...t}){return v.jsx(uk,{...t,children:e})}Li.propTypes={children:i.node};const dk=Y(fi)(()=>({"&:last-child td":{borderBottom:0}}));function _i({children:e,...t}){return v.jsx(dk,{...t,children:e})}_i.propTypes={children:i.node};function Nv({sort:e,data:t,pagination:n,columns:o,nested:r,baseUrl:s,gridPath:a}){var W;const c=nt(),{visibleGridColumns:l}=P.useContext(Ta),u=P.useContext(Mi),{selectedColumn:d,handleMenuClick:p,handleClose:f,handleHideClick:m}=qN(l,u,s,a),g=o==null?void 0:o.isManageable,h=(t==null?void 0:t.length)>0,y=P.useRef(null),[b,I]=P.useState(null);let C=null;const S=QN(((W=r==null?void 0:r.column)==null?void 0:W.definitions)||[]),x=r==null?void 0:r.isNested,w=(r==null?void 0:r.data)||[],A=r==null?void 0:r.hashKey;if(!h)return v.jsx(Dn,{sx:{textAlign:"center"},children:dn.NRF});const O=(B,L)=>{I(L),B.dataTransfer.setData("colIndex",L)},k=B=>{B.preventDefault(),j(B)},N=async(B,L)=>{if(B.preventDefault(),clearInterval(C),b===null||b===L)return;const _=[...l];[_[b],_[L]]=[_[L],_[b]],u({type:Me.SET_GRID_DATA,payload:{visibleGridColumns:_}});let V=Po.GRID_SETTINGS||{platform:{theme:"light"},grid:{}};V.grid=V.grid||{},V.grid[a]=_,localStorage.setItem(so.SETTINGS,JSON.stringify(V)),await ja({baseUrl:s,payload:V}),I(null)},j=B=>{const L=y.current,{left:_,right:V}=L.getBoundingClientRect(),$=50,M=B.clientX>V-$?1:B.clientX<_+$?-1:0;M!==0?(clearInterval(C),C=setInterval(()=>{L.scrollLeft+=M*10},50)):clearInterval(C)};return v.jsxs(v.Fragment,{children:[v.jsx(Bm,{ref:y,sx:{maxHeight:"100%",overflowX:"auto",whiteSpace:"nowrap"},children:v.jsxs(Mc,{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(Fc,{children:v.jsx(_i,{children:l.map((B,L)=>B!=null&&B.isHidden?null:v.jsx(Li,{style:B==null?void 0:B.style,draggable:g,onDragStart:g?_=>O(_,L):void 0,onDragOver:g?k:void 0,onDrop:g?_=>N(_,L):void 0,children:v.jsx(Pv,{column:B,sort:e,handleMenuClick:p,isManageable:g})},L))})}),v.jsx(Dc,{children:t.map((B,L)=>{const _=B[A],V=w==null?void 0:w[_],$=(V==null?void 0:V.length)>0;return v.jsxs(v.Fragment,{children:[v.jsx(_i,{children:l.map((M,H)=>M!=null&&M.isHidden?null:v.jsx(Li,{style:M==null?void 0:M.style,children:v.jsx(Cd,{isRenderCellContent:!!(M!=null&&M.cellRenderer),column:M,row:B})},H))},L),x&&V&&v.jsx(v.Fragment,{children:$?V.map((M,H)=>v.jsx(_i,{children:S.map((D,z)=>v.jsx(Li,{style:D==null?void 0:D.style,children:v.jsx(Cd,{isRenderCellContent:!!(D!=null&&D.cellRenderer),column:D,row:M})},z))},H)):v.jsx(_i,{children:v.jsx(Li,{colSpan:S.length,children:v.jsx(Dn,{sx:{textAlign:"center"},children:dn.NRF})})})})]})})})]})}),v.jsx(Av,{pagination:n}),v.jsx(Ov,{menuOpen:d==null?void 0:d.isOpen,handleClose:f,onHideClick:m})]})}Nv.propTypes={sort:i.object,data:i.array,pagination:i.object,columns:i.object,nested:i.object};function kv({tableProps:e,mergedColumns:t,gridPath:n,baseUrl:o}){const r=P.useContext(Mi);return P.useEffect(()=>{r({type:Me.SET_GRID_DATA,payload:{visibleGridColumns:t}})},[t,r]),v.jsx(v.Fragment,{children:v.jsx(Nv,{...e,gridPath:n,baseUrl:o})})}kv.propTypes={tableProps:i.object.isRequired,mergedColumns:i.array.isRequired};const pk=e=>{if(!e)return null;const{subAction:t,...n}=e,o=t?"select":"button",r={button:s=>v.jsx(Ao,{...s}),select:s=>v.jsx(Vb,{...s})};return r[o]?r[o](n):null},fk=({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}},hk=async({baseUrl:e,gridSetting:t,gridPath:n})=>{try{const o=JSON.parse(localStorage.getItem("settings")),{settingObject:r,defaultUserSettings:s}=fk({presentSetting:o,gridSetting:t,gridPath:n});return localStorage.setItem("settings",JSON.stringify(r)),await ja({baseUrl:e,payload:r}),s}catch(o){console.error(o)}},mk=({...e})=>{const[t,n]=P.useState(!1),o=nt();return v.jsx(vn.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})},gk=({customTools:e})=>({sortedTools:e==null?void 0:e.sort((n,o)=>n.sequenceId-o.sequenceId)}),Mv=({customTools:e})=>{const{sortedTools:t}=gk({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(vn.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(de,{sx:{flexShrink:0,minWidth:"fit-content"},children:pk(l)},l.id))}),r&&v.jsx(de,{sx:{zIndex:1e3,pointerEvents:"auto"},children:v.jsx(Ao,{label:n?"":"More Actions",styles:{icon:n?gt.Cross:gt.More},onClick:()=>o(l=>!l)})})]})};Mv.propTypes={customTools:i.array.isRequired};const Dv=({defaultTools:e,isManageable:t,customTools:n,baseUrl:o,gridPath:r})=>{var d,p,f,m,g,h,y;const s=P.useContext(Mi),{visibleGridColumns:a,triggerApi:c}=P.useContext(Ta),l=async b=>{try{await hk({baseUrl:o,gridPath:r,gridSetting:b})}catch(I){console.error(I)}finally{s({type:Me.HAS_SETTING_CHANGE,payload:{hasChange:!1}}),s({type:Me.TRIGGER_API,payload:{triggerApi:!1}})}};P.useEffect(()=>{c&&l(a)},[c]);const u=b=>{const I=[...a].map(C=>C.id===(b==null?void 0:b.id)?{...C,isHidden:!C.isHidden}:C);s({type:Me.SET_GRID_DATA,payload:{visibleGridColumns:I}}),s({type:Me.HAS_SETTING_CHANGE,payload:{hasChange:!0}})};return v.jsxs(de,{sx:{margin:"1rem 0",position:"relative",zIndex:10,display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"0.5rem",width:"100%"},children:[v.jsxs(de,{sx:{display:"flex",flexDirection:"row",gap:"0.5rem"},children:[((d=e==null?void 0:e.search)==null?void 0:d.isRequired)&&v.jsx(mk,{...e==null?void 0:e.search}),((p=e==null?void 0:e.refresh)==null?void 0:p.isRequired)&&v.jsx(Ao,{...e==null?void 0:e.refresh,styles:{...(f=e==null?void 0:e.refresh)==null?void 0:f.styles,icon:gt.Refresh}}),t&&v.jsx(de,{sx:{width:"12rem"},children:v.jsx(wv,{placeholder:"Manage Columns",options:a,value:a,isMulti:!0,showCheckBox:!0,isDraggable:!0,handleCheck:b=>{var I;return!((I=a==null?void 0:a.find(C=>C.id===b.id))!=null&&I.isHidden)},onChange:(b,I)=>u(b)})})]}),v.jsxs(de,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",gap:"0.6rem"},children:[v.jsx(Mv,{customTools:n}),((m=e==null?void 0:e.upload)==null?void 0:m.isRequired)&&v.jsx(Ao,{...e==null?void 0:e.upload,styles:{...(g=e==null?void 0:e.upload)==null?void 0:g.styles,icon:gt.Upload,color:"secondary",isAnimate:!0}}),((h=e==null?void 0:e.download)==null?void 0:h.isRequired)&&v.jsx(Ao,{...e==null?void 0:e.download,styles:{...(y=e==null?void 0:e.download)==null?void 0:y.styles,icon:gt.Download,isAnimate:!0}})]})]})};Dv.propTypes={defaultTools:i.object.isRequired,customTools:i.array,isManageable:i.bool,baseUrl:i.string,gridPath:i.gridPath};function Bv({tableProps:e,toolbarProps:t,isDefaultConfig:n}){var a;const o=(a=e.columns)==null?void 0:a.isManageable,{columns:r}=e,s=KN({columns:r,gridPath:t.gridPath,baseUrl:t.baseUrl,isDefaultConfig:n});return v.jsxs(_b,{children:[v.jsx(Dv,{...t,isManageable:o}),v.jsx(kv,{tableProps:e,mergedColumns:s,gridPath:t.gridPath,baseUrl:t.baseUrl})]})}Bv.propTypes={tableProps:i.object.isRequired,toolbarProps:i.object.isRequired,isDefaultConfig:i.bool};const jv=({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(Sc,{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(Ot,{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(de,{component:"img",src:gt.ArrowRight}),children:o({list:e})})};jv.propTypes={list:i.array.isRequired,handleLinkClick:i.func};const Fv=({breadcrumbProps:e})=>{const t=nt();return v.jsx(an,{sx:{background:t.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${t.palette.primary.notifyBorderColor}`,height:"3rem",p:"0 1.4rem",zIndex:4,position:"relative"},direction:"row",justifyContent:"space-between",alignItems:"center",children:v.jsx(jv,{...e})})};Fv.propTypes={breadcrumbProps:i.object.isRequired};function Vv({headerProps:e}){return v.jsx(Ca,{children:v.jsx(Fv,{...e})})}Vv.propTypes={headerProps:i.object.isRequired};const Td=P.createContext(null),Lv=P.createContext(null);function bk({children:e}){const[t,n]=P.useReducer(vk,yk);return v.jsx(Td.Provider,{value:t,children:v.jsx(Lv.Provider,{value:n,children:e})})}function vk(e,t){var n;switch(t.type){case Me.LOADING:return{...e,loading:t.loading};case Me.SUCCESS:return{...e,data:(n=t.data)==null?void 0:n.sort((o,r)=>new Date(r.createdAt)-new Date(o.createdAt))};case Me.MARK_ALL_AS_READ:return{...e,isMarkAllAsRead:t.isMarkAllAsRead};case Me.ERROR:return{...e,error:t.error};default:throw new Error(`${dn.UNHANDLED}: ${t}`)}}const yk={loading:!1,data:[],error:"",isMarkAllAsRead:{count:0,boo:!1}},{TENANT_ID:Ed,BU_ID:Id,SNOP_ID:_v}=bd,{TENANT_IDS:Sd,BU_IDS:wd}=Po,xk=async e=>{try{const t=`${e}${Ba.NOTIFICATION}/v1?${Ed}=${Sd}&${Id}=${wd}`;return await rt.get(t,Vi)}catch(t){return t}},$v=async(e,t,n)=>{try{const o=n===Iv.MARK_ALL_READ?"":`&${_v}=${n}&`,r=`${e}${Ba.NOTIFICATION}${pd.VERSION}?${Ed}=${Sd}&${Id}=${wd}${o}`;return await rt.put(r,t,Vi)}catch(o){return o}},Ck=async({baseUrl:e,id:t,snopId:n})=>{try{const o=`${e}${Ba.NOTIFICATION}${pd.VERSION}?${Ed}=${Sd}&${Id}=${wd}&${_v}=${n}&id=${t}`;return await rt.get(o,Vi)}catch(o){return o}},Fa={OK:200,CREATED:201,NO_CONTENT:204,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,INTERNAL_SERVER_ERROR:500};var Wv,Gv,zv,Hv;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 Tk=function(t){return E.createElement("svg",Ad({xmlns:"http://www.w3.org/2000/svg",width:16,height:18,fill:"none"},t),Wv||(Wv=E.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"})),Gv||(Gv=E.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"})),zv||(zv=E.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"})),Hv||(Hv=E.createElement("circle",{cx:12.266,cy:3,r:2.5,fill:"#E85353",stroke:"#F8FAFB"})))};const Ek=({count:e})=>(nt(),v.jsxs(v.Fragment,{children:[v.jsx(de,{sx:{gap:"0.5rem",display:"flex",justifyContent:"center",alignItems:"center"},className:"notify-icon-container",children:v.jsx(Tk,{style:{scale:2}})}),v.jsx(ak,{badgeContent:e==0?"":null,color:"error"})]}));var Xv;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 Ik=function(t){return E.createElement("svg",Od({xmlns:"http://www.w3.org/2000/svg",width:13,height:8,fill:"none"},t),Xv||(Xv=E.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 Uv=({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:m,data:g,toggleNotify:h,mode:y,isDetail:b=!1,...I})=>{var O,k;const[C,S]=P.useState(0),x=nt(),w=(N,j)=>{S(j)},A=()=>{switch(d){case Da.REFRESH:return v.jsx(de,{component:"img",src:gt.Refresh,alt:"refresh",onClick:o,sx:{cursor:"pointer"}});case Da.CLOSE:return v.jsx(de,{component:"img",src:gt.Close,alt:"refresh",onClick:r,sx:{cursor:"pointer"}});default:return null}};return v.jsxs(ok,{maxWidth:b?"xs":"md",onClose:r,...I,className:["notification-dialog",f,m==="notifcation-dialog"?"notification-main-box":""].join(" "),dialogType:!0,children:[v.jsxs(de,{sx:m==="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(de,{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})]}),A()]}),b?v.jsx(v.Fragment,{children:n}):v.jsxs(v.Fragment,{children:[v.jsx(de,{sx:{borderBottom:1,borderColor:x.palette.primary.notifyBorderColor},className:"tab-panel",children:v.jsx(lk,{value:C,onChange:w,children:v.jsx(ck,{label:v.jsxs(de,{sx:{display:"flex",alignItems:"center",fontSize:"1rem"},children:["All (",v.jsx(Ot,{component:"span",sx:{fontWeight:"bold"},children:((O=g==null?void 0:g.filter(N=>!(N!=null&&N.isRead)))==null?void 0:O.length)||0}),")"]})})})}),v.jsx(ik,{value:C,index:0,children:n})]}),p&&v.jsxs(xc,{className:"dialog-action",sx:{px:"1rem"},children:[v.jsxs(an,{direction:"row",gap:1,children:[v.jsx(Dn,{sx:{fontSize:"0.9rem"},children:"Only show unread"}),v.jsx(rk,{disabled:s,checked:y,onChange:h})]}),v.jsx(hc,{variant:"outlined",className:"view-all",onClick:c,startIcon:v.jsx(Ik,{}),disabled:!((k=g==null?void 0:g.filter(N=>!(N!=null&&N.isRead)))!=null&&k.length),style:{backgroundColor:"transparent"},sx:{p:0,color:x.palette.primary.notifyTextColor},children:"Mark all as read"})]})]})};var Zv,Yv;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 Sk=function(t){return E.createElement("svg",Rd({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},t),Zv||(Zv=E.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"})),Yv||(Yv=E.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"})))},Jv;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 wk=function(t){return E.createElement("svg",Pd({xmlns:"http://www.w3.org/2000/svg",width:9,height:8,fill:"none"},t),Jv||(Jv=E.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,y;const m=nt(),g=(y=(h=JSON.parse(localStorage.getItem("settings")))==null?void 0:h.platform)==null?void 0:y.theme;return v.jsxs(de,{className:"cards",children:[v.jsxs(an,{display:"flex",flexDirection:"row",alignItems:"start",justifyContent:"space-between",gap:1,children:[s&&v.jsx(Xs,{checked:!!a.includes(c),onChange:b=>l(b,c),disabled:n,sx:{padding:"4px 7px 0 7px"}}),v.jsx(fc,{sx:{"& .MuiBadge-badge":{backgroundColor:"#6041EA"}},variant:"dot",className:"badge",invisible:n,children:v.jsx(Dn,{sx:{color:m.palette.primary.notifyActiveText},component:"p",className:["title-card",n&&"read"].join(" "),children:t})})]}),v.jsxs(an,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:[v.jsxs(an,{display:"flex",flexDirection:"row",justifyContent:"start",gap:1,sx:{p:"0.5rem 0"},children:[f&&v.jsx(lc,{icon:v.jsx(Sk,{className:`${g==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:u,onClick:o,label:u===c?v.jsx(oi,{color:"primary",size:13}):"Show Details",component:"button",variant:"filled",clickable:!0,size:"small",sx:{height:"2rem",fontWeight:"300",fontSize:"0.9rem",color:m.palette.primary.notifyActiveText,borderColor:m.palette.primary.notifyBorderColor,background:m.palette.primary.notifyButtonBackground,borderRadius:"0.6rem",padding:"0.2rem"}}),!n&&v.jsx(lc,{icon:v.jsx(wk,{className:`${g==="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:m.palette.primary.notifyBorderColor,color:m.palette.primary.notifyActiveText,borderRadius:"0.6rem",padding:"0.2rem"}})]}),v.jsxs(an,{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:m.palette.primary.notifyTextColor,children:"•"}),v.jsx(Dn,{sx:{fontSize:"0.9rem"},children:FN(p)})]})]})]})};qv.propTypes={type:i.string,title:i.string,subTitle:i.string,isRead:i.bool,handleShowDetails:i.func,handleRead:i.func};const Kv=({data:e,handleRead:t,handleShowDetails:n,clickId:o,mode:r,page:s,setPage:a})=>{P.useContext(Td);const c=new Date,l=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"long",year:"numeric"}).format(c),[u,d]=P.useState([]),[p,f]=P.useState(!1),[m,g]=P.useState(!0),h=P.useRef(null),y=nt();return P.useEffect(()=>{d([...e])},[e]),P.useEffect(()=>{const b=new IntersectionObserver(I=>{I[0].isIntersecting&&!p&&m&&a(C=>C+1)},{threshold:1});return h.current&&b.observe(h.current),()=>{h.current&&b.unobserve(h.current)}},[p,m]),v.jsxs(de,{sx:u.length?{py:"0.5rem"}:{py:"0.5rem",justifyContent:"center",alignItems:"center",display:"flex",height:"100%"},children:[Object.entries(WN(u)).map(([b,I])=>v.jsxs(P.Fragment,{children:[b!==l&&v.jsx(sk,{children:b}),I.map((C,S)=>v.jsx(qv,{type:"success",title:C.message,subTitle:C.createdAt,isRead:C.isRead,handleShowDetails:()=>n(C.id,C.snopId),handleRead:()=>t([C.id],C.snopId),clickId:o,id:C.id,product:C.product,createdAt:C.createdAt,isShowVisible:C==null?void 0:C.isNotificationDetails},C.id||S))]},b)),p&&s>1&&!!(u!=null&&u.length)&&v.jsx(de,{sx:{display:"flex",justifyContent:"center",alignItems:"center",pl:"0.5rem",py:"0.3rem"},children:v.jsx(oi,{size:20,className:"circular-loader"})}),!(u!=null&&u.length)&&v.jsx(Ot,{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(de,{ref:h,style:{height:"0.1rem",backgroundColor:"transparent"}})]})};Kv.propTypes={data:i.array,handleRead:i.func,handleShowDetails:i.func};function $i(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 Qv(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?Qv(Object(n),!0).forEach(function(o){$i(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qv(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Ak(e){if(Array.isArray(e))return e}function Ok(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 Nd(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 ey(e,t){if(e){if(typeof e=="string")return Nd(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)?Nd(e,t):void 0}}function Rk(){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 $n(e,t){return Ak(e)||Ok(e,t)||ey(e,t)||Rk()}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.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Pk=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Nk(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,m=e.value,g=Wn(e,Pk),h=P.useState(c!==void 0?c:n),y=$n(h,2),b=y[0],I=y[1],C=P.useState(l!==void 0?l:r),S=$n(C,2),x=S[0],w=S[1],A=P.useState(m!==void 0?m:a),O=$n(A,2),k=O[0],N=O[1],j=P.useCallback(function(M,H){typeof u=="function"&&u(M,H),N(M)},[u]),W=P.useCallback(function(M,H){var D;typeof d=="function"&&(D=d(M,H)),I(D!==void 0?D:M)},[d]),B=P.useCallback(function(){typeof f=="function"&&f(),w(!0)},[f]),L=P.useCallback(function(){typeof p=="function"&&p(),w(!1)},[p]),_=c!==void 0?c:b,V=l!==void 0?l:x,$=m!==void 0?m:k;return ve(ve({},g),{},{inputValue:_,menuIsOpen:V,onChange:j,onInputChange:W,onMenuClose:L,onMenuOpen:B,value:$})}function kk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ty(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 Mk(e,t,n){return t&&ty(e.prototype,t),n&&ty(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Dk(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&&Ss(e,t)}function Va(e){return Va=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Va(e)}function ny(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ny=function(){return!!e})()}function Bk(e,t){if(t&&(fo(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ih(e)}function jk(e){var t=ny();return function(){var n,o=Va(e);if(t){var r=Va(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return Bk(this,n)}}function Fk(e){if(Array.isArray(e))return Nd(e)}function Vk(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Lk(){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 kd(e){return Fk(e)||Vk(e)||ey(e)||Lk()}function _k(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const $k=Math.min,Wk=Math.max,La=Math.round,_a=Math.floor,$a=e=>({x:e,y:e});function Gk(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 oy(e){return iy(e)?(e.nodeName||"").toLowerCase():"#document"}function Gn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ry(e){var t;return(t=(iy(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function iy(e){return e instanceof Node||e instanceof Gn(e).Node}function zk(e){return e instanceof Element||e instanceof Gn(e).Element}function Md(e){return e instanceof HTMLElement||e instanceof Gn(e).HTMLElement}function sy(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Gn(e).ShadowRoot}function ay(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Dd(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function Hk(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Xk(e){return["html","body","#document"].includes(oy(e))}function Dd(e){return Gn(e).getComputedStyle(e)}function Uk(e){if(oy(e)==="html")return e;const t=e.assignedSlot||e.parentNode||sy(e)&&e.host||ry(e);return sy(t)?t.host:t}function ly(e){const t=Uk(e);return Xk(t)?e.ownerDocument?e.ownerDocument.body:e.body:Md(t)&&ay(t)?t:ly(t)}function Wa(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=ly(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),a=Gn(r);return s?t.concat(a,a.visualViewport||[],ay(r)?r:[],a.frameElement&&n?Wa(a.frameElement):[]):t.concat(r,Wa(r,[],n))}function Zk(e){const t=Dd(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Md(e),s=r?e.offsetWidth:n,a=r?e.offsetHeight:o,c=La(n)!==s||La(o)!==a;return c&&(n=s,o=a),{width:n,height:o,$:c}}function Bd(e){return zk(e)?e:e.contextElement}function cy(e){const t=Bd(e);if(!Md(t))return $a(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Zk(t);let a=(s?La(n.width):n.width)/o,c=(s?La(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Yk=$a(0);function Jk(e){const t=Gn(e);return!Hk()||!t.visualViewport?Yk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qk(e,t,n){return!1}function uy(e,t,n,o){t===void 0&&(t=!1);const r=e.getBoundingClientRect(),s=Bd(e);let a=$a(1);t&&(a=cy(e));const c=qk()?Jk(s):$a(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=Gn(s),m=o;let g=f,h=g.frameElement;for(;h&&o&&m!==g;){const y=cy(h),b=h.getBoundingClientRect(),I=Dd(h),C=b.left+(h.clientLeft+parseFloat(I.paddingLeft))*y.x,S=b.top+(h.clientTop+parseFloat(I.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,p*=y.y,l+=C,u+=S,g=Gn(h),h=g.frameElement}}return Gk({width:d,height:p,x:l,y:u})}function Kk(e,t){let n=null,o;const r=ry(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{left:u,top:d,width:p,height:f}=e.getBoundingClientRect();if(c||t(),!p||!f)return;const m=_a(d),g=_a(r.clientWidth-(u+p)),h=_a(r.clientHeight-(d+f)),y=_a(u),I={rootMargin:-m+"px "+-g+"px "+-h+"px "+-y+"px",threshold:Wk(0,$k(1,l))||1};let C=!0;function S(x){const w=x[0].intersectionRatio;if(w!==l){if(!C)return a();w?a(!1,w):o=setTimeout(()=>{a(!1,1e-7)},1e3)}C=!1}try{n=new IntersectionObserver(S,{...I,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,I)}n.observe(e)}return a(!0),s}function Qk(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=Bd(e),d=r||s?[...u?Wa(u):[],...Wa(t)]:[];d.forEach(b=>{r&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const p=u&&c?Kk(u,n):null;let f=-1,m=null;a&&(m=new ResizeObserver(b=>{let[I]=b;I&&I.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var C;(C=m)==null||C.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let g,h=l?uy(e):null;l&&y();function y(){const b=uy(e);h&&(b.x!==h.x||b.y!==h.y||b.width!==h.width||b.height!==h.height)&&n(),h=b,g=requestAnimationFrame(y)}return n(),()=>{var b;d.forEach(I=>{r&&I.removeEventListener("scroll",n),s&&I.removeEventListener("resize",n)}),p==null||p(),(b=m)==null||b.disconnect(),m=null,l&&cancelAnimationFrame(g)}}var jd=P.useLayoutEffect,eM=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Ga=function(){};function tM(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function nM(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(tM(e,a)));return s.filter(function(c){return c}).map(function(c){return String(c).trim()}).join(" ")}var dy=function(t){return dM(t)?t.filter(Boolean):fo(t)==="object"&&t!==null?[t]:[]},py=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,eM);return ve({},n)},dt=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 za(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function oM(e){return za(e)?window.innerHeight:e.clientHeight}function fy(e){return za(e)?window.pageYOffset:e.scrollTop}function Ha(e,t){if(za(e)){window.scrollTo(0,t);return}e.scrollTop=t}function rM(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 iM(e,t,n,o){return n*((e=e/o-1)*e*e+1)+t}function Xa(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ga,r=fy(e),s=t-r,a=10,c=0;function l(){c+=a;var u=iM(c,r,s,n);Ha(e,u),c<n?window.requestAnimationFrame(l):o(e)}l()}function hy(e,t){var n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=t.offsetHeight/3;o.bottom+r>n.bottom?Ha(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight)):o.top-r<n.top&&Ha(e,Math.max(t.offsetTop-r,0))}function sM(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 my(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function aM(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var gy=!1,lM={get passive(){return gy=!0}},Ua=typeof window<"u"?window:{};Ua.addEventListener&&Ua.removeEventListener&&(Ua.addEventListener("p",Ga,lM),Ua.removeEventListener("p",Ga,!1));var cM=gy;function uM(e){return e!=null}function dM(e){return Array.isArray(e)}function Za(e,t,n){return e?t:n}function fj(e){return e}function hj(e){return e}var pM=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=$n(a,1),l=c[0];return!o.includes(l)});return s.reduce(function(a,c){var l=$n(c,2),u=l[0],d=l[1];return a[u]=d,a},{})},fM=["children","innerProps"],hM=["children","innerProps"];function mM(e){var t=e.maxHeight,n=e.menuEl,o=e.minHeight,r=e.placement,s=e.shouldScroll,a=e.isFixedPosition,c=e.controlHeight,l=rM(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var d=l.getBoundingClientRect(),p=d.height,f=n.getBoundingClientRect(),m=f.bottom,g=f.height,h=f.top,y=n.offsetParent.getBoundingClientRect(),b=y.top,I=a?window.innerHeight:oM(l),C=fy(l),S=parseInt(getComputedStyle(n).marginBottom,10),x=parseInt(getComputedStyle(n).marginTop,10),w=b-x,A=I-h,O=w+C,k=p-C-h,N=m-I+C+S,j=C+h-x,W=160;switch(r){case"auto":case"bottom":if(A>=g)return{placement:"bottom",maxHeight:t};if(k>=g&&!a)return s&&Xa(l,N,W),{placement:"bottom",maxHeight:t};if(!a&&k>=o||a&&A>=o){s&&Xa(l,N,W);var B=a?A-S:k-S;return{placement:"bottom",maxHeight:B}}if(r==="auto"||a){var L=t,_=a?w:O;return _>=o&&(L=Math.min(_-S-c,t)),{placement:"top",maxHeight:L}}if(r==="bottom")return s&&Ha(l,N),{placement:"bottom",maxHeight:t};break;case"top":if(w>=g)return{placement:"top",maxHeight:t};if(O>=g&&!a)return s&&Xa(l,j,W),{placement:"top",maxHeight:t};if(!a&&O>=o||a&&w>=o){var V=t;return(!a&&O>=o||a&&w>=o)&&(V=a?w-x:O-x),s&&Xa(l,j,W),{placement:"top",maxHeight:V}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return u}function gM(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var by=function(t){return t==="auto"?"bottom":t},bM=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"},$i(o,gM(r),"100%"),$i(o,"position","absolute"),$i(o,"width","100%"),$i(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})},vy=P.createContext(null),vM=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(vy)||{},d=u.setPortalPlacement,p=P.useRef(null),f=P.useState(r),m=$n(f,2),g=m[0],h=m[1],y=P.useState(null),b=$n(y,2),I=b[0],C=b[1],S=l.spacing.controlHeight;return jd(function(){var x=p.current;if(x){var w=a==="fixed",A=c&&!w,O=mM({maxHeight:r,menuEl:x,minHeight:o,placement:s,shouldScroll:A,isFixedPosition:w,controlHeight:S});h(O.maxHeight),C(O.placement),d==null||d(O.placement)}},[r,s,a,c,o,d,S]),n({ref:p,placerProps:ve(ve({},t),{},{placement:I||by(s),maxHeight:g})})},yM=function(t){var n=t.children,o=t.innerRef,r=t.innerProps;return me("div",T({},dt(t,"menu",{menu:!0}),{ref:o},r),n)},xM=yM,CM=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})},TM=function(t){var n=t.children,o=t.innerProps,r=t.innerRef,s=t.isMulti;return me("div",T({},dt(t,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:r},o),n)},yy=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")})},EM=yy,IM=yy,SM=function(t){var n=t.children,o=n===void 0?"No options":n,r=t.innerProps,s=Wn(t,fM);return me("div",T({},dt(ve(ve({},s),{},{children:o,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),o)},wM=function(t){var n=t.children,o=n===void 0?"Loading...":n,r=t.innerProps,s=Wn(t,hM);return me("div",T({},dt(ve(ve({},s),{},{children:o,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),o)},AM=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}},OM=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(by(a)),p=$n(d,2),f=p[0],m=p[1],g=P.useMemo(function(){return{setPortalPlacement:m}},[]),h=P.useState(null),y=$n(h,2),b=y[0],I=y[1],C=P.useCallback(function(){if(r){var A=sM(r),O=c==="fixed"?0:window.pageYOffset,k=A[f]+O;(k!==(b==null?void 0:b.offset)||A.left!==(b==null?void 0:b.rect.left)||A.width!==(b==null?void 0:b.rect.width))&&I({offset:k,rect:A})}},[r,c,f,b==null?void 0:b.offset,b==null?void 0:b.rect.left,b==null?void 0:b.rect.width]);jd(function(){C()},[C]);var S=P.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),r&&l.current&&(u.current=Qk(r,l.current,C,{elementResize:"ResizeObserver"in window}))},[r,C]);jd(function(){S()},[S]);var x=P.useCallback(function(A){l.current=A,S()},[S]);if(!n&&c!=="fixed"||!b)return null;var w=me("div",T({ref:x},dt(ve(ve({},t),{},{offset:b.offset,position:c,rect:b.rect}),"menuPortal",{"menu-portal":!0}),s),o);return me(vy.Provider,{value:g},n?Bo.createPortal(w,n):w)},RM=function(t){var n=t.isDisabled,o=t.isRtl;return{label:"container",direction:o?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},PM=function(t){var n=t.children,o=t.innerProps,r=t.isDisabled,s=t.isRtl;return me("div",T({},dt(t,"container",{"--is-disabled":r,"--is-rtl":s}),o),n)},NM=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")})},kM=function(t){var n=t.children,o=t.innerProps,r=t.isMulti,s=t.hasValue;return me("div",T({},dt(t,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":s}),o),n)},MM=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},DM=function(t){var n=t.children,o=t.innerProps;return me("div",T({},dt(t,"indicatorsContainer",{indicators:!0}),o),n)},xy,BM=["size"],jM=["innerProps","isRtl","size"];function FM(){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 VM=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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lLFxuICB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WydkaXYnXTtcbiAgLyoqIFRoZSBmb2N1c2VkIHN0YXRlIG9mIHRoZSBzZWxlY3QuICovXG4gIGlzRm9jdXNlZDogYm9vbGVhbjtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgLyoqIFNldCBzaXplIG9mIHRoZSBjb250YWluZXIuICovXG4gIHNpemU6IG51bWJlcjtcbn1cbmV4cG9ydCBjb25zdCBMb2FkaW5nSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KHtcbiAgaW5uZXJQcm9wcyxcbiAgaXNSdGwsXG4gIHNpemUgPSA0LFxuICAuLi5yZXN0UHJvcHNcbn06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPikgPT4ge1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKFxuICAgICAgICB7IC4uLnJlc3RQcm9wcywgaW5uZXJQcm9wcywgaXNSdGwsIHNpemUgfSxcbiAgICAgICAgJ2xvYWRpbmdJbmRpY2F0b3InLFxuICAgICAgICB7XG4gICAgICAgICAgaW5kaWNhdG9yOiB0cnVlLFxuICAgICAgICAgICdsb2FkaW5nLWluZGljYXRvcic6IHRydWUsXG4gICAgICAgIH1cbiAgICAgICl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MH0gb2Zmc2V0PXtpc1J0bH0gLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXsxNjB9IG9mZnNldCAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezMyMH0gb2Zmc2V0PXshaXNSdGx9IC8+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuIl19 */",toString:FM},Cy=function(t){var n=t.size,o=Wn(t,BM);return me("svg",T({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:VM},o))},Fd=function(t){return me(Cy,T({size:20},t),me("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"}))},Ty=function(t){return me(Cy,T({size:20},t),me("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"}))},Ey=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}})},LM=Ey,_M=function(t){var n=t.children,o=t.innerProps;return me("div",T({},dt(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),o),n||me(Ty,null))},$M=Ey,WM=function(t){var n=t.children,o=t.innerProps;return me("div",T({},dt(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),o),n||me(Fd,null))},GM=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})},zM=function(t){var n=t.innerProps;return me("span",T({},n,dt(t,"indicatorSeparator",{"indicator-separator":!0})))},HM=lo(xy||(xy=_k([`
|
|
256
256
|
0%, 80%, 100% { opacity: 0; }
|