@acuteinfo/common-base 1.2.39 → 1.2.40
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.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -130,5 +130,5 @@ re=de,"undefined"!=typeof self&&self||void 0!==cd&&cd||"undefined"!=typeof windo
|
|
|
130
130
|
*/},function(e){var t,r,n,s,a,o,l,h,c,d,u,A,p,f,g,m,w,b,v,y;t=function(){return function(t){return e.prototype=t,new e};function e(){}}(),d=function(e){var t,i,r,n,s,a,o;for(i=0,r=e.length,t=void 0,a=n=!1;!n&&i!==r;)(t=e[i]=e[i].trimLeft())&&(n=!0),i++;for(i=r-1;r&&!a&&-1!==i;)(t=e[i]=e[i].trimRight())&&(a=!0),i--;for(s=/\s+$/g,o=!0,i=0;i!==r;)"\u2028"!=e[i]&&(t=e[i].replace(/\s+/g," "),o&&(t=t.trimLeft()),t&&(o=s.test(t)),e[i]=t),i++;return e},A=function(e){var t,i,r;for(t=void 0,i=(r=e.split(",")).shift();!t&&i;)t=n[i.trim().toLowerCase()],i=r.shift();return t},p=function(e){var t;return-1<(e="auto"===e?"0px":e).indexOf("em")&&!isNaN(Number(e.replace("em","")))&&(e=18.719*Number(e.replace("em",""))+"px"),-1<e.indexOf("pt")&&!isNaN(Number(e.replace("pt","")))&&(e=1.333*Number(e.replace("pt",""))+"px"),(t=f[e])?t:void 0!==(t={"xx-small":9,"x-small":11,small:13,medium:16,large:19,"x-large":23,"xx-large":28,auto:0}[e])||(t=parseFloat(e))?f[e]=t/16:(t=e.match(/([\d\.]+)(px)/),Array.isArray(t)&&3===t.length?f[e]=parseFloat(t[1])/16:f[e]=1)},c=function(e){var t,i,r,n,c;return c=e,n=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(c,null):c.currentStyle?c.currentStyle:c.style,i=void 0,(t={})["font-family"]=A((r=function(e){return e=e.replace(/-\D/g,(function(e){return e.charAt(1).toUpperCase()})),n[e]})("font-family"))||"times",t["font-style"]=s[r("font-style")]||"normal",t["text-align"]=a[r("text-align")]||"left","bold"===(i=o[r("font-weight")]||"normal")&&("normal"===t["font-style"]?t["font-style"]=i:t["font-style"]=i+t["font-style"]),t["font-size"]=p(r("font-size"))||1,t["line-height"]=p(r("line-height"))||1,t.display="inline"===r("display")?"inline":"block",i="block"===t.display,t["margin-top"]=i&&p(r("margin-top"))||0,t["margin-bottom"]=i&&p(r("margin-bottom"))||0,t["padding-top"]=i&&p(r("padding-top"))||0,t["padding-bottom"]=i&&p(r("padding-bottom"))||0,t["margin-left"]=i&&p(r("margin-left"))||0,t["margin-right"]=i&&p(r("margin-right"))||0,t["padding-left"]=i&&p(r("padding-left"))||0,t["padding-right"]=i&&p(r("padding-right"))||0,t["page-break-before"]=r("page-break-before")||"auto",t.float=l[r("cssFloat")]||"none",t.clear=h[r("clear")]||"none",t.color=r("color"),t},g=function(e,t,i){var r,n,s,a,o;if(s=!1,a=n=void 0,r=i["#"+e.id])if("function"==typeof r)s=r(e,t);else for(n=0,a=r.length;!s&&n!==a;)s=r[n](e,t),n++;if(r=i[e.nodeName],!s&&r)if("function"==typeof r)s=r(e,t);else for(n=0,a=r.length;!s&&n!==a;)s=r[n](e,t),n++;for(o="string"==typeof e.className?e.className.split(" "):[],n=0;n<o.length;n++)if(r=i["."+o[n]],!s&&r)if("function"==typeof r)s=r(e,t);else for(n=0,a=r.length;!s&&n!==a;)s=r[n](e,t),n++;return s},y=function(e,t){var i,r,n,s,a,o,l,h,c;for(i=[],r=[],n=0,c=e.rows[0].cells.length,l=e.clientWidth;n<c;)h=e.rows[0].cells[n],r[n]={name:h.textContent.toLowerCase().replace(/\s+/g,""),prompt:h.textContent.replace(/\r?\n/g,""),width:h.clientWidth/l*t.pdf.internal.pageSize.getWidth()},n++;for(n=1;n<e.rows.length;){for(o=e.rows[n],a={},s=0;s<o.cells.length;)a[r[s].name]=o.cells[s].textContent.replace(/\r?\n/g,""),s++;i.push(a),n++}return{rows:i,headers:r}};var B={SCRIPT:1,STYLE:1,NOSCRIPT:1,OBJECT:1,EMBED:1,SELECT:1},C=1;r=function(e,n,s){var a,o,l,h,d,u,A,p;for(o=e.childNodes,a=void 0,(d="block"===(l=c(e)).display)&&(n.setBlockBoundary(),n.setBlockStyle(l)),h=0,u=o.length;h<u;){if("object"===i(a=o[h])){if(n.executeWatchFunctions(a),1===a.nodeType&&"HEADER"===a.nodeName){var f=a,w=n.pdf.margins_doc.top;n.pdf.internal.events.subscribe("addPage",(function(e){n.y=w,r(f,n,s),n.pdf.margins_doc.top=n.y+10,n.y+=10}),!1)}if(8===a.nodeType&&"#comment"===a.nodeName)~a.textContent.indexOf("ADD_PAGE")&&(n.pdf.addPage(),n.y=n.pdf.margins_doc.top);else if(1!==a.nodeType||B[a.nodeName])if(3===a.nodeType){var b=a.nodeValue;if(a.nodeValue&&"LI"===a.parentNode.nodeName)if("OL"===a.parentNode.parentNode.nodeName)b=C+++". "+b;else{var v=l["font-size"],x=(3-.75*v)*n.pdf.internal.scaleFactor,F=.75*v*n.pdf.internal.scaleFactor,N=1.74*v/n.pdf.internal.scaleFactor;p=function(e,t){this.pdf.circle(e+x,t+F,N,"FD")}}16&a.ownerDocument.body.compareDocumentPosition(a)&&n.addText(b,l)}else"string"==typeof a&&n.addText(a,l);else{var S;if("IMG"===a.nodeName){var E=a.getAttribute("src");S=m[n.pdf.sHashCode(E)||E]}if(S){n.pdf.internal.pageSize.getHeight()-n.pdf.margins_doc.bottom<n.y+a.height&&n.y>n.pdf.margins_doc.top&&(n.pdf.addPage(),n.y=n.pdf.margins_doc.top,n.executeWatchFunctions(a));var T=c(a),L=n.x,k=12/n.pdf.internal.scaleFactor,D=(T["margin-left"]+T["padding-left"])*k,I=(T["margin-right"]+T["padding-right"])*k,U=(T["margin-top"]+T["padding-top"])*k,P=(T["margin-bottom"]+T["padding-bottom"])*k;void 0!==T.float&&"right"===T.float?L+=n.settings.width-a.width-I:L+=D,n.pdf.addImage(S,L,n.y+U,a.width,a.height),S=void 0,"right"===T.float||"left"===T.float?(n.watchFunctions.push(function(e,t,i,r){return n.y>=t?(n.x+=e,n.settings.width+=i,!0):!!(r&&1===r.nodeType&&!B[r.nodeName]&&n.x+r.width>n.pdf.margins_doc.left+n.pdf.margins_doc.width)&&(n.x+=e,n.y=t,n.settings.width+=i,!0)}.bind(this,"left"===T.float?-a.width-D-I:0,n.y+a.height+U+P,a.width)),n.watchFunctions.push(function(e,t,i){return!(n.y<e&&t===n.pdf.internal.getNumberOfPages())||1===i.nodeType&&"both"===c(i).clear&&(n.y=e,!0)}.bind(this,n.y+a.height,n.pdf.internal.getNumberOfPages())),n.settings.width-=a.width+D+I,"left"===T.float&&(n.x+=a.width+D+I)):n.y+=a.height+U+P}else if("TABLE"===a.nodeName)A=y(a,n),n.y+=10,n.pdf.table(n.x,n.y,A.rows,A.headers,{autoSize:!1,printHeaders:s.printHeaders,margins:n.pdf.margins_doc,css:c(a)}),n.y=n.pdf.lastCellPos.y+n.pdf.lastCellPos.h+20;else if("OL"===a.nodeName||"UL"===a.nodeName)C=1,g(a,n,s)||r(a,n,s),n.y+=10;else if("LI"===a.nodeName){var O=n.x;n.x+=20/n.pdf.internal.scaleFactor,n.y+=3,g(a,n,s)||r(a,n,s),n.x=O}else"BR"===a.nodeName?(n.y+=l["font-size"]*n.pdf.internal.scaleFactor,n.addText("\u2028",t(l))):g(a,n,s)||r(a,n,s)}}h++}if(s.outY=n.y,d)return n.setBlockBoundary(p)},m={},w=function(e,t,i,r){var n,s=e.getElementsByTagName("img"),a=s.length,o=0;function l(){t.pdf.internal.events.publish("imagesLoaded"),r(n)}function h(e,i,r){if(e){var s=new Image;n=++o,s.crossOrigin="",s.onerror=s.onload=function(){if(s.complete&&(0===s.src.indexOf("data:image/")&&(s.width=i||s.width||0,s.height=r||s.height||0),s.width+s.height)){var n=t.pdf.sHashCode(e)||e;m[n]=m[n]||s}--o||l()},s.src=e}}for(;a--;)h(s[a].getAttribute("src"),s[a].width,s[a].height);return o||l()},b=function(e,t,i){var n=e.getElementsByTagName("footer");if(0<n.length){n=n[0];var s=t.pdf.internal.write,a=t.y;t.pdf.internal.write=function(){},r(n,t,i);var o=Math.ceil(t.y-a)+5;t.y=a,t.pdf.internal.write=s,t.pdf.margins_doc.bottom+=o;for(var l=function(e){var s=void 0!==e?e.pageNumber:1,a=t.y;t.y=t.pdf.internal.pageSize.getHeight()-t.pdf.margins_doc.bottom,t.pdf.margins_doc.bottom-=o;for(var l=n.getElementsByTagName("span"),h=0;h<l.length;++h)-1<(" "+l[h].className+" ").replace(/[\n\t]/g," ").indexOf(" pageCounter ")&&(l[h].innerHTML=s),-1<(" "+l[h].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")&&(l[h].innerHTML="###jsPDFVarTotalPages###");r(n,t,i),t.pdf.margins_doc.bottom+=o,t.y=a},h=n.getElementsByTagName("span"),c=0;c<h.length;++c)-1<(" "+h[c].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")&&t.pdf.internal.events.subscribe("htmlRenderingFinished",t.pdf.putTotalPages.bind(t.pdf,"###jsPDFVarTotalPages###"),!0);t.pdf.internal.events.subscribe("addPage",l,!1),l(),B.FOOTER=1}},v=function(e,t,i,n,s,a){if(!t)return!1;var o,l,h,c;"string"==typeof t||t.parentNode||(t=""+t.innerHTML),"string"==typeof t&&(o=t.replace(/<\/?script[^>]*?>/gi,""),c="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),(h=document.createElement("div")).style.cssText="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",h.innerHTML='<iframe style="height:1px;width:1px" name="'+c+'" />',document.body.appendChild(h),(l=window.frames[c]).document.open(),l.document.writeln(o),l.document.close(),t=l.document.body);var d,A=new u(e,i,n,s);return w.call(this,t,A,s.elementHandlers,(function(e){b(t,A,s.elementHandlers),r(t,A,s.elementHandlers),A.pdf.internal.events.publish("htmlRenderingFinished"),d=A.dispose(),"function"==typeof a?a(d):e&&console.error("jsPDF Warning: rendering issues? provide a callback to fromHTML!")})),d||{x:A.x,y:A.y}},(u=function(e,t,i,r){return this.pdf=e,this.x=t,this.y=i,this.settings=r,this.watchFunctions=[],this.init(),this}).prototype.init=function(){return this.paragraph={text:[],style:[]},this.pdf.internal.write("q")},u.prototype.dispose=function(){return this.pdf.internal.write("Q"),{x:this.x,y:this.y,ready:!0}},u.prototype.executeWatchFunctions=function(e){var t=!1,i=[];if(0<this.watchFunctions.length){for(var r=0;r<this.watchFunctions.length;++r)!0===this.watchFunctions[r](e)?t=!0:i.push(this.watchFunctions[r]);this.watchFunctions=i}return t},u.prototype.splitFragmentsIntoLines=function(e,i){var r,n,s,a,o,l,h,c,d,u,A,p,f,g;for(u=this.pdf.internal.scaleFactor,a={},l=h=c=g=o=s=d=n=void 0,p=[A=[]],r=0,f=this.settings.width;e.length;)if(o=e.shift(),g=i.shift(),o)if((s=a[(n=g["font-family"])+(d=g["font-style"])])||(s=this.pdf.internal.getFont(n,d).metadata.Unicode,a[n+d]=s),c={widths:s.widths,kerning:s.kerning,fontSize:12*g["font-size"],textIndent:r},h=this.pdf.getStringUnitWidth(o,c)*c.fontSize/u,"\u2028"==o)A=[],p.push(A);else if(f<r+h){for(l=this.pdf.splitTextToSize(o,f,c),A.push([l.shift(),g]);l.length;)A=[[l.shift(),g]],p.push(A);r=this.pdf.getStringUnitWidth(A[0][0],c)*c.fontSize/u}else A.push([o,g]),r+=h;if(void 0!==g["text-align"]&&("center"===g["text-align"]||"right"===g["text-align"]||"justify"===g["text-align"]))for(var m=0;m<p.length;++m){var w=this.pdf.getStringUnitWidth(p[m][0][0],c)*c.fontSize/u;0<m&&(p[m][0][1]=t(p[m][0][1]));var b=f-w;if("right"===g["text-align"])p[m][0][1]["margin-left"]=b;else if("center"===g["text-align"])p[m][0][1]["margin-left"]=b/2;else if("justify"===g["text-align"]){var v=p[m][0][0].split(" ").length-1;p[m][0][1]["word-spacing"]=b/v,m===p.length-1&&(p[m][0][1]["word-spacing"]=0)}}return p},u.prototype.RenderTextFragment=function(e,t){var i,r;r=0,this.pdf.internal.pageSize.getHeight()-this.pdf.margins_doc.bottom<this.y+this.pdf.internal.getFontSize()&&(this.pdf.internal.write("ET","Q"),this.pdf.addPage(),this.y=this.pdf.margins_doc.top,this.pdf.internal.write("q","BT",this.getPdfColor(t.color),this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td"),r=Math.max(r,t["line-height"],t["font-size"]),this.pdf.internal.write(0,(-12*r).toFixed(2),"Td")),i=this.pdf.internal.getFont(t["font-family"],t["font-style"]);var n=this.getPdfColor(t.color);n!==this.lastTextColor&&(this.pdf.internal.write(n),this.lastTextColor=n),void 0!==t["word-spacing"]&&0<t["word-spacing"]&&this.pdf.internal.write(t["word-spacing"].toFixed(2),"Tw"),this.pdf.internal.write("/"+i.id,(12*t["font-size"]).toFixed(2),"Tf","("+this.pdf.internal.pdfEscape(e)+") Tj"),void 0!==t["word-spacing"]&&this.pdf.internal.write(0,"Tw")},u.prototype.getPdfColor=function(e){var t,i,r,n=/rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+\s*)\)/.exec(e);if(null!=n)t=parseInt(n[1]),i=parseInt(n[2]),r=parseInt(n[3]);else{if("string"==typeof e&&"#"!=e.charAt(0)){var s=new RGBColor(e);e=s.ok?s.toHex():"#000000"}t=e.substring(1,3),t=parseInt(t,16),i=e.substring(3,5),i=parseInt(i,16),r=e.substring(5,7),r=parseInt(r,16)}if("string"==typeof t&&/^#[0-9A-Fa-f]{6}$/.test(t)){var a=parseInt(t.substr(1),16);t=a>>16&255,i=a>>8&255,r=255&a}var o=this.f3;return 0===t&&0===i&&0===r||void 0===i?o(t/255)+" g":[o(t/255),o(i/255),o(r/255),"rg"].join(" ")},u.prototype.f3=function(e){return e.toFixed(3)},u.prototype.renderParagraph=function(e){var t,i,r,n,s,a,o,l,h,c,u,A,p;if(r=d(this.paragraph.text),A=this.paragraph.style,t=this.paragraph.blockstyle,this.paragraph.priorblockstyle,this.paragraph={text:[],style:[],blockstyle:{},priorblockstyle:t},r.join("").trim()){o=this.splitFragmentsIntoLines(r,A),l=a=void 0,i=12/this.pdf.internal.scaleFactor,this.priorMarginBottom=this.priorMarginBottom||0,u=(Math.max((t["margin-top"]||0)-this.priorMarginBottom,0)+(t["padding-top"]||0))*i,c=((t["margin-bottom"]||0)+(t["padding-bottom"]||0))*i,this.priorMarginBottom=t["margin-bottom"]||0,"always"===t["page-break-before"]&&(this.pdf.addPage(),this.y=0,u=((t["margin-top"]||0)+(t["padding-top"]||0))*i),h=this.pdf.internal.write,s=n=void 0,this.y+=u,h("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td");for(var f=0;o.length;){for(n=l=0,s=(a=o.shift()).length;n!==s;)a[n][0].trim()&&(l=Math.max(l,a[n][1]["line-height"],a[n][1]["font-size"]),p=7*a[n][1]["font-size"]),n++;var g=0,m=0;for(void 0!==a[0][1]["margin-left"]&&0<a[0][1]["margin-left"]&&(g=(m=this.pdf.internal.getCoordinateString(a[0][1]["margin-left"]))-f,f=m),h(g+Math.max(t["margin-left"]||0,0)*i,(-12*l).toFixed(2),"Td"),n=0,s=a.length;n!==s;)a[n][0]&&this.RenderTextFragment(a[n][0],a[n][1]),n++;if(this.y+=l*i,this.executeWatchFunctions(a[0][1])&&0<o.length){var w=[],b=[];o.forEach((function(e){for(var t=0,i=e.length;t!==i;)e[t][0]&&(w.push(e[t][0]+" "),b.push(e[t][1])),++t})),o=this.splitFragmentsIntoLines(d(w),b),h("ET","Q"),h("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td")}}return e&&"function"==typeof e&&e.call(this,this.x-9,this.y-p/2),h("ET","Q"),this.y+=c}},u.prototype.setBlockBoundary=function(e){return this.renderParagraph(e)},u.prototype.setBlockStyle=function(e){return this.paragraph.blockstyle=e},u.prototype.addText=function(e,t){return this.paragraph.text.push(e),this.paragraph.style.push(t)},n={helvetica:"helvetica","sans-serif":"helvetica","times new roman":"times",serif:"times",times:"times",monospace:"courier",courier:"courier"},o={100:"normal",200:"normal",300:"normal",400:"normal",500:"bold",600:"bold",700:"bold",800:"bold",900:"bold",normal:"normal",bold:"bold",bolder:"bold",lighter:"normal"},s={normal:"normal",italic:"italic",oblique:"italic"},a={left:"left",right:"right",center:"center",justify:"justify"},l={none:"none",right:"right",left:"left"},h={none:"none",both:"both"},f={normal:1},e.fromHTML=function(e,t,i,r,n,s){return this.margins_doc=s||{top:0,bottom:0},r||(r={}),r.elementHandlers||(r.elementHandlers={}),v(this,e,isNaN(t)?4:t,isNaN(i)?4:i,r,n)}}(de.API),de.API,("undefined"!=typeof window&&window||void 0!==cd&&cd).html2pdf=function(e,t,i){var r=t.canvas;if(r){var n,s;if((r.pdf=t).annotations={_nameMap:[],createAnnotation:function(e,i){var r,n=t.context2d._wrapX(i.left),s=t.context2d._wrapY(i.top),a=(t.context2d._page(i.top),e.indexOf("#"));r=0<=a?{name:e.substring(a+1)}:{url:e},t.link(n,s,i.right-i.left,i.bottom-i.top,r)},setName:function(e,i){var r=t.context2d._wrapX(i.left),n=t.context2d._wrapY(i.top),s=t.context2d._page(i.top);this._nameMap[e]={page:s,x:r,y:n}}},r.annotations=t.annotations,t.context2d._pageBreakAt=function(e){this.pageBreaks.push(e)},t.context2d._gotoPage=function(e){for(;t.internal.getNumberOfPages()<e;)t.addPage();t.setPage(e)},"string"==typeof e){e=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");var a,o,l=document.createElement("iframe");document.body.appendChild(l),null!=(a=l.contentDocument)&&null!=a||(a=l.contentWindow.document),a.open(),a.write(e),a.close(),n=a.body,o=a.body||{},e=a.documentElement||{},s=Math.max(o.scrollHeight,o.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}else o=(n=e).body||{},s=Math.max(o.scrollHeight,o.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight);var h={async:!0,allowTaint:!0,backgroundColor:"#ffffff",canvas:r,imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1,windowHeight:s=t.internal.pageSize.getHeight(),scrollY:s};t.context2d.pageWrapYEnabled=!0,t.context2d.pageWrapY=t.internal.pageSize.getHeight(),html2canvas(n,h).then((function(e){i&&(l&&l.parentElement.removeChild(l),i(t))}))}else alert("jsPDF canvas plugin not installed")},window.tmp=html2pdf,function(e){var t=e.BlobBuilder||e.WebKitBlobBuilder||e.MSBlobBuilder||e.MozBlobBuilder;e.URL=e.URL||e.webkitURL||function(e,t){return(t=document.createElement("a")).href=e,t};var i=e.Blob,r=URL.createObjectURL,n=URL.revokeObjectURL,s=e.Symbol&&e.Symbol.toStringTag,a=!1,o=!1,l=!!e.ArrayBuffer,h=t&&t.prototype.append&&t.prototype.getBlob;try{a=2===new Blob(["ä"]).size,o=2===new Blob([new Uint8Array([1,2])]).size}catch(a){}function c(e){return e.map((function(e){if(e.buffer instanceof ArrayBuffer){var t=e.buffer;if(e.byteLength!==t.byteLength){var i=new Uint8Array(e.byteLength);i.set(new Uint8Array(t,e.byteOffset,e.byteLength)),t=i.buffer}return t}return e}))}function d(e,i){i=i||{};var r=new t;return c(e).forEach((function(e){r.append(e)})),i.type?r.getBlob(i.type):r.getBlob()}function u(e,t){return new i(c(e),t||{})}if(e.Blob&&(d.prototype=Blob.prototype,u.prototype=Blob.prototype),s)try{File.prototype[s]="File",Blob.prototype[s]="Blob",FileReader.prototype[s]="FileReader"}catch(a){}function A(){var t=!!e.ActiveXObject||"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,i=e.XMLHttpRequest&&e.XMLHttpRequest.prototype.send;t&&i&&(XMLHttpRequest.prototype.send=function(e){e instanceof Blob&&this.setRequestHeader("Content-Type",e.type),i.call(this,e)});try{new File([],"")}catch(t){try{var r=new Function('class File extends Blob {constructor(chunks, name, opts) {opts = opts || {};super(chunks, opts || {});this.name = name;this.lastModifiedDate = opts.lastModified ? new Date(opts.lastModified) : new Date;this.lastModified = +this.lastModifiedDate;}};return new File([], ""), File')();e.File=r}catch(t){r=function(e,t,i){var r=new Blob(e,i),n=i&&void 0!==i.lastModified?new Date(i.lastModified):new Date;return r.name=t,r.lastModifiedDate=n,r.lastModified=+n,r.toString=function(){return"[object File]"},s&&(r[s]="File"),r},e.File=r}}}a?(A(),e.Blob=o?e.Blob:u):h?(A(),e.Blob=d):function(){function t(e){for(var t=[],i=0;i<e.length;i++){var r=e.charCodeAt(i);r<128?t.push(r):r<2048?t.push(192|r>>6,128|63&r):r<55296||57344<=r?t.push(224|r>>12,128|r>>6&63,128|63&r):(i++,r=65536+((1023&r)<<10|1023&e.charCodeAt(i)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t}function i(e){var t,i,r,n,s,a;for(t="",r=e.length,i=0;i<r;)switch((n=e[i++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=String.fromCharCode(n);break;case 12:case 13:s=e[i++],t+=String.fromCharCode((31&n)<<6|63&s);break;case 14:s=e[i++],a=e[i++],t+=String.fromCharCode((15&n)<<12|(63&s)<<6|63&a)}return t}function s(e){for(var t=new Array(e.byteLength),i=new Uint8Array(e),r=t.length;r--;)t[r]=i[r];return t}function a(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=[],r=0;r<e.length;r+=3){var n=e[r],s=r+1<e.length,a=s?e[r+1]:0,o=r+2<e.length,l=o?e[r+2]:0,h=n>>2,c=(3&n)<<4|a>>4,d=(15&a)<<2|l>>6,u=63&l;o||(u=64,s||(d=64)),i.push(t[h],t[c],t[d],t[u])}return i.join("")}var o=Object.create||function(e){function t(){}return t.prototype=e,new t};if(l)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&-1<h.indexOf(Object.prototype.toString.call(e))};function d(e,i){for(var r=0,n=(e=e||[]).length;r<n;r++){var a=e[r];a instanceof d?e[r]=a._buffer:"string"==typeof a?e[r]=t(a):l&&(ArrayBuffer.prototype.isPrototypeOf(a)||c(a))?e[r]=s(a):l&&(o=a)&&DataView.prototype.isPrototypeOf(o)?e[r]=s(a.buffer):e[r]=t(String(a))}var o;this._buffer=[].concat.apply([],e),this.size=this._buffer.length,this.type=i&&i.type||""}function u(e,t,i){var r=d.call(this,e,i=i||{})||this;return r.name=t,r.lastModifiedDate=i.lastModified?new Date(i.lastModified):new Date,r.lastModified=+r.lastModifiedDate,r}if(d.prototype.slice=function(e,t,i){return new d([this._buffer.slice(e||0,t||this._buffer.length)],{type:i})},d.prototype.toString=function(){return"[object Blob]"},(u.prototype=o(d.prototype)).constructor=u,Object.setPrototypeOf)Object.setPrototypeOf(u,d);else try{u.__proto__=d}catch(o){}function A(){if(!(this instanceof A))throw new TypeError("Failed to construct 'FileReader': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");var e=document.createDocumentFragment();this.addEventListener=e.addEventListener,this.dispatchEvent=function(t){var i=this["on"+t.type];"function"==typeof i&&i(t),e.dispatchEvent(t)},this.removeEventListener=e.removeEventListener}function p(e,t,i){if(!(t instanceof d))throw new TypeError("Failed to execute '"+i+"' on 'FileReader': parameter 1 is not of type 'Blob'.");e.result="",setTimeout((function(){this.readyState=A.LOADING,e.dispatchEvent(new Event("load")),e.dispatchEvent(new Event("loadend"))}))}u.prototype.toString=function(){return"[object File]"},A.EMPTY=0,A.LOADING=1,A.DONE=2,A.prototype.error=null,A.prototype.onabort=null,A.prototype.onerror=null,A.prototype.onload=null,A.prototype.onloadend=null,A.prototype.onloadstart=null,A.prototype.onprogress=null,A.prototype.readAsDataURL=function(e){p(this,e,"readAsDataURL"),this.result="data:"+e.type+";base64,"+a(e._buffer)},A.prototype.readAsText=function(e){p(this,e,"readAsText"),this.result=i(e._buffer)},A.prototype.readAsArrayBuffer=function(e){p(this,e,"readAsText"),this.result=e._buffer.slice()},A.prototype.abort=function(){},URL.createObjectURL=function(e){return e instanceof d?"data:"+e.type+";base64,"+a(e._buffer):r.call(URL,e)},URL.revokeObjectURL=function(e){n&&n.call(URL,e)};var f=e.XMLHttpRequest&&e.XMLHttpRequest.prototype.send;f&&(XMLHttpRequest.prototype.send=function(e){e instanceof d?(this.setRequestHeader("Content-Type",e.type),f.call(this,i(e._buffer))):f.call(this,e)}),e.FileReader=A,e.File=u,e.Blob=d}()}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0!==cd&&cd||Function('return typeof this === "object" && this.content')()||Function("return this")());var ue,Ae,pe,fe,ge,me,we,be,ve,ye,Be,Ce,xe,Fe,Ne,Se=Se||function(e){if(!(void 0===e||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var t=e.document,i=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),n="download"in r,s=/constructor/i.test(e.HTMLElement)||e.safari,a=/CriOS\/[\d]+/.test(navigator.userAgent),o=e.setImmediate||e.setTimeout,l=function(e){o((function(){throw e}),0)},h=function(e){setTimeout((function(){"string"==typeof e?i().revokeObjectURL(e):e.remove()}),4e4)},c=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},d=function(t,d,u){u||(t=c(t));var A,p=this,f="application/octet-stream"===t.type,g=function(){!function(e,t,i){for(var r=(t=[].concat(t)).length;r--;){var n=e["on"+t[r]];if("function"==typeof n)try{n.call(e,i||e)}catch(e){l(e)}}}(p,"writestart progress write writeend".split(" "))};if(p.readyState=p.INIT,n)return A=i().createObjectURL(t),void o((function(){var e,t;r.href=A,r.download=d,e=r,t=new MouseEvent("click"),e.dispatchEvent(t),g(),h(A),p.readyState=p.DONE}),0);!function(){if((a||f&&s)&&e.FileReader){var r=new FileReader;return r.onloadend=function(){var t=a?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");e.open(t,"_blank")||(e.location.href=t),t=void 0,p.readyState=p.DONE,g()},r.readAsDataURL(t),p.readyState=p.INIT}A||(A=i().createObjectURL(t)),f?e.location.href=A:e.open(A,"_blank")||(e.location.href=A),p.readyState=p.DONE,g(),h(A)}()},u=d.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,i){return t=t||e.name||"download",i||(e=c(e)),navigator.msSaveOrOpenBlob(e,t)}:(u.abort=function(){},u.readyState=u.INIT=0,u.WRITING=1,u.DONE=2,u.error=u.onwritestart=u.onprogress=u.onwrite=u.onabort=u.onerror=u.onwriteend=null,function(e,t,i){return new d(e,t||e.name||"download",i)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0);function Ee(e){var t=0;if(71!==e[t++]||73!==e[t++]||70!==e[t++]||56!==e[t++]||56!=(e[t++]+1&253)||97!==e[t++])throw"Invalid GIF 87a/89a header.";var i=e[t++]|e[t++]<<8,r=e[t++]|e[t++]<<8,n=e[t++],s=n>>7,a=1<<1+(7&n);e[t++],e[t++];var o=null;s&&(o=t,t+=3*a);var l=!0,h=[],c=0,d=null,u=0,A=null;for(this.width=i,this.height=r;l&&t<e.length;)switch(e[t++]){case 33:switch(e[t++]){case 255:if(11!==e[t]||78==e[t+1]&&69==e[t+2]&&84==e[t+3]&&83==e[t+4]&&67==e[t+5]&&65==e[t+6]&&80==e[t+7]&&69==e[t+8]&&50==e[t+9]&&46==e[t+10]&&48==e[t+11]&&3==e[t+12]&&1==e[t+13]&&0==e[t+16])t+=14,A=e[t++]|e[t++]<<8,t++;else for(t+=12;0!==(x=e[t++]);)t+=x;break;case 249:if(4!==e[t++]||0!==e[t+4])throw"Invalid graphics extension block.";var p=e[t++];c=e[t++]|e[t++]<<8,d=e[t++],!(1&p)&&(d=null),u=p>>2&7,t++;break;case 254:for(;0!==(x=e[t++]);)t+=x;break;default:throw"Unknown graphic control label: 0x"+e[t-1].toString(16)}break;case 44:var f=e[t++]|e[t++]<<8,g=e[t++]|e[t++]<<8,m=e[t++]|e[t++]<<8,w=e[t++]|e[t++]<<8,b=e[t++],v=b>>6&1,y=o,B=!1;b>>7&&(B=!0,y=t,t+=3*(1<<1+(7&b)));var C=t;for(t++;;){var x;if(0===(x=e[t++]))break;t+=x}h.push({x:f,y:g,width:m,height:w,has_local_palette:B,palette_offset:y,data_offset:C,data_length:t-C,transparent_index:d,interlaced:!!v,delay:c,disposal:u});break;case 59:l=!1;break;default:throw"Unknown gif block: 0x"+e[t-1].toString(16)}this.numFrames=function(){return h.length},this.loopCount=function(){return A},this.frameInfo=function(e){if(e<0||e>=h.length)throw"Frame index out of range.";return h[e]},this.decodeAndBlitFrameBGRA=function(t,r){var n=this.frameInfo(t),s=n.width*n.height,a=new Uint8Array(s);Te(e,n.data_offset,a,s);var o=n.palette_offset,l=n.transparent_index;null===l&&(l=256);var h=n.width,c=i-h,d=h,u=4*(n.y*i+n.x),A=4*((n.y+n.height)*i+n.x),p=u,f=4*c;!0===n.interlaced&&(f+=4*(h+c)*7);for(var g=8,m=0,w=a.length;m<w;++m){var b=a[m];if(0===d&&(d=h,A<=(p+=f)&&(f=c+4*(h+c)*(g-1),p=u+(h+c)*(g<<1),g>>=1)),b===l)p+=4;else{var v=e[o+3*b],y=e[o+3*b+1],B=e[o+3*b+2];r[p++]=B,r[p++]=y,r[p++]=v,r[p++]=255}--d}},this.decodeAndBlitFrameRGBA=function(t,r){var n=this.frameInfo(t),s=n.width*n.height,a=new Uint8Array(s);Te(e,n.data_offset,a,s);var o=n.palette_offset,l=n.transparent_index;null===l&&(l=256);var h=n.width,c=i-h,d=h,u=4*(n.y*i+n.x),A=4*((n.y+n.height)*i+n.x),p=u,f=4*c;!0===n.interlaced&&(f+=4*(h+c)*7);for(var g=8,m=0,w=a.length;m<w;++m){var b=a[m];if(0===d&&(d=h,A<=(p+=f)&&(f=c+4*(h+c)*(g-1),p=u+(h+c)*(g<<1),g>>=1)),b===l)p+=4;else{var v=e[o+3*b],y=e[o+3*b+1],B=e[o+3*b+2];r[p++]=v,r[p++]=y,r[p++]=B,r[p++]=255}--d}}}function Te(e,t,i,r){for(var n=e[t++],s=1<<n,a=s+1,o=a+1,l=n+1,h=(1<<l)-1,c=0,d=0,u=0,A=e[t++],p=new Int32Array(4096),f=null;;){for(;c<16&&0!==A;)d|=e[t++]<<c,c+=8,1===A?A=e[t++]:--A;if(c<l)break;var g=d&h;if(d>>=l,c-=l,g!==s){if(g===a)break;for(var m=g<o?g:f,w=0,b=m;s<b;)b=p[b]>>8,++w;var v=b;if(r<u+w+(m!==g?1:0))return void console.log("Warning, gif stream longer than expected.");i[u++]=v;var y=u+=w;for(m!==g&&(i[u++]=v),b=m;w--;)b=p[b],i[--y]=255&b,b>>=8;null!==f&&o<4096&&(p[o++]=f<<8|v,h+1<=o&&l<12&&(++l,h=h<<1|1)),f=g}else o=a+1,h=(1<<(l=n+1))-1,f=null}return u!==r&&console.log("Warning, gif stream shorter than expected."),i}try{t.GifWriter=function(e,t,i,r){var n=0,s=void 0===(r=void 0===r?{}:r).loop?null:r.loop,a=void 0===r.palette?null:r.palette;if(t<=0||i<=0||65535<t||65535<i)throw"Width/Height invalid.";function o(e){var t=e.length;if(t<2||256<t||t&t-1)throw"Invalid code/color length, must be power of 2 and 2 .. 256.";return t}e[n++]=71,e[n++]=73,e[n++]=70,e[n++]=56,e[n++]=57,e[n++]=97;var l=0,h=0;if(null!==a){for(var c=o(a);c>>=1;)++l;if(c=1<<l,--l,void 0!==r.background){if(c<=(h=r.background))throw"Background index out of range.";if(0===h)throw"Background index explicitly passed as 0."}}if(e[n++]=255&t,e[n++]=t>>8&255,e[n++]=255&i,e[n++]=i>>8&255,e[n++]=(null!==a?128:0)|l,e[n++]=h,e[n++]=0,null!==a)for(var d=0,u=a.length;d<u;++d){var A=a[d];e[n++]=A>>16&255,e[n++]=A>>8&255,e[n++]=255&A}if(null!==s){if(s<0||65535<s)throw"Loop count invalid.";e[n++]=33,e[n++]=255,e[n++]=11,e[n++]=78,e[n++]=69,e[n++]=84,e[n++]=83,e[n++]=67,e[n++]=65,e[n++]=80,e[n++]=69,e[n++]=50,e[n++]=46,e[n++]=48,e[n++]=3,e[n++]=1,e[n++]=255&s,e[n++]=s>>8&255,e[n++]=0}var p=!1;this.addFrame=function(t,i,r,s,l,h){if(!0===p&&(--n,p=!1),h=void 0===h?{}:h,t<0||i<0||65535<t||65535<i)throw"x/y invalid.";if(r<=0||s<=0||65535<r||65535<s)throw"Width/Height invalid.";if(l.length<r*s)throw"Not enough pixels for the frame size.";var c=!0,d=h.palette;if(null==d&&(c=!1,d=a),null==d)throw"Must supply either a local or global palette.";for(var u=o(d),A=0;u>>=1;)++A;u=1<<A;var f=void 0===h.delay?0:h.delay,g=void 0===h.disposal?0:h.disposal;if(g<0||3<g)throw"Disposal out of range.";var m=!1,w=0;if(void 0!==h.transparent&&null!==h.transparent&&(m=!0,(w=h.transparent)<0||u<=w))throw"Transparent color index.";if((0!==g||m||0!==f)&&(e[n++]=33,e[n++]=249,e[n++]=4,e[n++]=g<<2|(!0===m?1:0),e[n++]=255&f,e[n++]=f>>8&255,e[n++]=w,e[n++]=0),e[n++]=44,e[n++]=255&t,e[n++]=t>>8&255,e[n++]=255&i,e[n++]=i>>8&255,e[n++]=255&r,e[n++]=r>>8&255,e[n++]=255&s,e[n++]=s>>8&255,e[n++]=!0===c?128|A-1:0,!0===c)for(var b=0,v=d.length;b<v;++b){var y=d[b];e[n++]=y>>16&255,e[n++]=y>>8&255,e[n++]=255&y}n=function(e,t,i,r){e[t++]=i;var n=t++,s=1<<i,a=s-1,o=s+1,l=o+1,h=i+1,c=0,d=0;function u(i){for(;i<=c;)e[t++]=255&d,d>>=8,c-=8,t===n+256&&(e[n]=255,n=t++)}function A(e){d|=e<<c,c+=h,u(8)}var p=r[0]&a,f={};A(s);for(var g=1,m=r.length;g<m;++g){var w=r[g]&a,b=p<<8|w,v=f[b];if(void 0===v){for(d|=p<<c,c+=h;8<=c;)e[t++]=255&d,d>>=8,c-=8,t===n+256&&(e[n]=255,n=t++);4096===l?(A(s),l=o+1,h=i+1,f={}):(1<<h<=l&&++h,f[b]=l++),p=w}else p=v}return A(p),A(o),u(1),n+1===t?e[n]=0:(e[n]=t-n-1,e[t++]=0),t}(e,n,A<2?2:A,l)},this.end=function(){return!1===p&&(e[n++]=59,p=!0),n}},t.GifReader=Ee}catch(r){}function Le(e){var t,i,r,n,s,a=Math.floor,o=new Array(64),l=new Array(64),h=new Array(64),c=new Array(64),d=new Array(65535),u=new Array(65535),A=new Array(64),p=new Array(64),f=[],g=0,m=7,w=new Array(64),b=new Array(64),v=new Array(64),y=new Array(256),B=new Array(2048),C=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],x=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],F=[0,1,2,3,4,5,6,7,8,9,10,11],N=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],S=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],E=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],T=[0,1,2,3,4,5,6,7,8,9,10,11],L=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],k=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function D(e,t){for(var i=0,r=0,n=new Array,s=1;s<=16;s++){for(var a=1;a<=e[s];a++)n[t[r]]=[],n[t[r]][0]=i,n[t[r]][1]=s,r++,i++;i*=2}return n}function I(e){for(var t=e[0],i=e[1]-1;0<=i;)t&1<<i&&(g|=1<<m),i--,--m<0&&(255==g?(U(255),U(0)):U(g),m=7,g=0)}function U(e){f.push(e)}function P(e){U(e>>8&255),U(255&e)}function O(e,t,i,r,n){for(var s,a=n[0],o=n[240],l=function(e,t){var i,r,n,s,a,o,l,h,c,d,u=0;for(c=0;c<8;++c){i=e[u],r=e[u+1],n=e[u+2],s=e[u+3],a=e[u+4],o=e[u+5],l=e[u+6];var p=i+(h=e[u+7]),f=i-h,g=r+l,m=r-l,w=n+o,b=n-o,v=s+a,y=s-a,B=p+v,C=p-v,x=g+w,F=g-w;e[u]=B+x,e[u+4]=B-x;var N=.707106781*(F+C);e[u+2]=C+N,e[u+6]=C-N;var S=.382683433*((B=y+b)-(F=m+f)),E=.5411961*B+S,T=1.306562965*F+S,L=.707106781*(x=b+m),k=f+L,D=f-L;e[u+5]=D+E,e[u+3]=D-E,e[u+1]=k+T,e[u+7]=k-T,u+=8}for(c=u=0;c<8;++c){i=e[u],r=e[u+8],n=e[u+16],s=e[u+24],a=e[u+32],o=e[u+40],l=e[u+48];var I=i+(h=e[u+56]),U=i-h,P=r+l,O=r-l,R=n+o,Q=n-o,H=s+a,M=s-a,_=I+H,j=I-H,z=P+R,V=P-R;e[u]=_+z,e[u+32]=_-z;var K=.707106781*(V+j);e[u+16]=j+K,e[u+48]=j-K;var q=.382683433*((_=M+Q)-(V=O+U)),G=.5411961*_+q,W=1.306562965*V+q,J=.707106781*(z=Q+O),X=U+J,Y=U-J;e[u+40]=Y+G,e[u+24]=Y-G,e[u+8]=X+W,e[u+56]=X-W,u++}for(c=0;c<64;++c)d=e[c]*t[c],A[c]=0<d?d+.5|0:d-.5|0;return A}(e,t),h=0;h<64;++h)p[C[h]]=l[h];var c=p[0]-i;i=p[0],0==c?I(r[0]):(I(r[u[s=32767+c]]),I(d[s]));for(var f=63;0<f&&0==p[f];f--);if(0==f)return I(a),i;for(var g,m=1;m<=f;){for(var w=m;0==p[m]&&m<=f;++m);var b=m-w;if(16<=b){g=b>>4;for(var v=1;v<=g;++v)I(o);b&=15}s=32767+p[m],I(n[(b<<4)+u[s]]),I(d[s]),m++}return 63!=f&&I(a),i}function R(e){e<=0&&(e=1),100<e&&(e=100),s!=e&&(function(e){for(var t=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],i=0;i<64;i++){var r=a((t[i]*e+50)/100);r<1?r=1:255<r&&(r=255),o[C[i]]=r}for(var n=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],s=0;s<64;s++){var d=a((n[s]*e+50)/100);d<1?d=1:255<d&&(d=255),l[C[s]]=d}for(var u=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],A=0,p=0;p<8;p++)for(var f=0;f<8;f++)h[A]=1/(o[C[A]]*u[p]*u[f]*8),c[A]=1/(l[C[A]]*u[p]*u[f]*8),A++}(e<50?Math.floor(5e3/e):Math.floor(200-2*e)),s=e)}this.encode=function(e,s){var a,d;(new Date).getTime(),s&&R(s),f=new Array,g=0,m=7,P(65496),P(65504),P(16),U(74),U(70),U(73),U(70),U(0),U(1),U(1),U(0),P(1),P(1),U(0),U(0),function(){P(65499),P(132),U(0);for(var e=0;e<64;e++)U(o[e]);U(1);for(var t=0;t<64;t++)U(l[t])}(),a=e.width,d=e.height,P(65472),P(17),U(8),P(d),P(a),U(3),U(1),U(17),U(0),U(2),U(17),U(1),U(3),U(17),U(1),function(){P(65476),P(418),U(0);for(var e=0;e<16;e++)U(x[e+1]);for(var t=0;t<=11;t++)U(F[t]);U(16);for(var i=0;i<16;i++)U(N[i+1]);for(var r=0;r<=161;r++)U(S[r]);U(1);for(var n=0;n<16;n++)U(E[n+1]);for(var s=0;s<=11;s++)U(T[s]);U(17);for(var a=0;a<16;a++)U(L[a+1]);for(var o=0;o<=161;o++)U(k[o])}(),P(65498),P(12),U(3),U(1),U(0),U(2),U(17),U(3),U(17),U(0),U(63),U(0);var u=0,A=0,p=0;g=0,m=7,this.encode.displayName="_encode_";for(var y,C,D,Q,H,M,_,j,z,V=e.data,K=e.width,q=e.height,G=4*K,W=0;W<q;){for(y=0;y<G;){for(M=H=G*W+y,_=-1,z=j=0;z<64;z++)M=H+(j=z>>3)*G+(_=4*(7&z)),q<=W+j&&(M-=G*(W+1+j-q)),G<=y+_&&(M-=y+_-G+4),C=V[M++],D=V[M++],Q=V[M++],w[z]=(B[C]+B[D+256|0]+B[Q+512|0]>>16)-128,b[z]=(B[C+768|0]+B[D+1024|0]+B[Q+1280|0]>>16)-128,v[z]=(B[C+1280|0]+B[D+1536|0]+B[Q+1792|0]>>16)-128;u=O(w,h,u,t,r),A=O(b,c,A,i,n),p=O(v,c,p,i,n),y+=32}W+=8}if(0<=m){var J=[];J[1]=m+1,J[0]=(1<<m+1)-1,I(J)}return P(65497),new Uint8Array(f)},(new Date).getTime(),e||(e=50),function(){for(var e=String.fromCharCode,t=0;t<256;t++)y[t]=e(t)}(),t=D(x,F),i=D(E,T),r=D(N,S),n=D(L,k),function(){for(var e=1,t=2,i=1;i<=15;i++){for(var r=e;r<t;r++)u[32767+r]=i,d[32767+r]=[],d[32767+r][1]=i,d[32767+r][0]=r;for(var n=-(t-1);n<=-e;n++)u[32767+n]=i,d[32767+n]=[],d[32767+n][1]=i,d[32767+n][0]=t-1+n;e<<=1,t<<=1}}(),function(){for(var e=0;e<256;e++)B[e]=19595*e,B[e+256|0]=38470*e,B[e+512|0]=7471*e+32768,B[e+768|0]=-11059*e,B[e+1024|0]=-21709*e,B[e+1280|0]=32768*e+8421375,B[e+1536|0]=-27439*e,B[e+1792|0]=-5329*e}(),R(e),(new Date).getTime()}function ke(e,t){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!t,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,-1===["BM","BA","CI","CP","IC","PT"].indexOf(this.flag))throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}window.tmp=Ee,de.API.adler32cs=(me="function"==typeof ArrayBuffer&&"function"==typeof Uint8Array,we=null,be=function(){if(!me)return function(){return!1};try{var e={};"function"==typeof e.Buffer&&(we=e.Buffer)}catch(e){}return function(e){return e instanceof ArrayBuffer||null!==we&&e instanceof we}}(),ve=null!==we?function(e){return new we(e,"utf8").toString("binary")}:function(e){return unescape(encodeURIComponent(e))},ye=function(e,t){for(var i=65535&e,r=e>>>16,n=0,s=t.length;n<s;n++)r=(r+(i=(i+(255&t.charCodeAt(n)))%65521))%65521;return(r<<16|i)>>>0},Be=function(e,t){for(var i=65535&e,r=e>>>16,n=0,s=t.length;n<s;n++)r=(r+(i=(i+t[n])%65521))%65521;return(r<<16|i)>>>0},xe=(Ce={}).Adler32=(((ge=(fe=function(e){if(!(this instanceof fe))throw new TypeError("Constructor cannot called be as a function.");if(!isFinite(e=null==e?1:+e))throw new Error("First arguments needs to be a finite number.");this.checksum=e>>>0}).prototype={}).constructor=fe).from=((ue=function(e){if(!(this instanceof fe))throw new TypeError("Constructor cannot called be as a function.");if(null==e)throw new Error("First argument needs to be a string.");this.checksum=ye(1,e.toString())}).prototype=ge,ue),fe.fromUtf8=((Ae=function(e){if(!(this instanceof fe))throw new TypeError("Constructor cannot called be as a function.");if(null==e)throw new Error("First argument needs to be a string.");var t=ve(e.toString());this.checksum=ye(1,t)}).prototype=ge,Ae),me&&(fe.fromBuffer=((pe=function(e){if(!(this instanceof fe))throw new TypeError("Constructor cannot called be as a function.");if(!be(e))throw new Error("First argument needs to be ArrayBuffer.");var t=new Uint8Array(e);return this.checksum=Be(1,t)}).prototype=ge,pe)),ge.update=function(e){if(null==e)throw new Error("First argument needs to be a string.");return e=e.toString(),this.checksum=ye(this.checksum,e)},ge.updateUtf8=function(e){if(null==e)throw new Error("First argument needs to be a string.");var t=ve(e.toString());return this.checksum=ye(this.checksum,t)},me&&(ge.updateBuffer=function(e){if(!be(e))throw new Error("First argument needs to be ArrayBuffer.");var t=new Uint8Array(e);return this.checksum=Be(this.checksum,t)}),ge.clone=function(){return new xe(this.checksum)},fe),Ce.from=function(e){if(null==e)throw new Error("First argument needs to be a string.");return ye(1,e.toString())},Ce.fromUtf8=function(e){if(null==e)throw new Error("First argument needs to be a string.");var t=ve(e.toString());return ye(1,t)},me&&(Ce.fromBuffer=function(e){if(!be(e))throw new Error("First argument need to be ArrayBuffer.");var t=new Uint8Array(e);return Be(1,t)}),Ce),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(e){var i,r,n,s,a,o,l,h=t,c=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],d=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],u={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},A={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},p=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","�?�","�?�","�?�","�?�","�?�","�?�","�?","₎","�?","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","�?","﹞","�?","﹤","﹥","﹤"],f=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),g=!1,m=0;this.__bidiEngine__={};var w=function(e){var t=e.charCodeAt(),i=t>>8,r=A[i];return void 0!==r?h[256*r+(255&t)]:252===i||253===i?"AL":f.test(i)?"L":8===i?"R":"N"},b=function(e){for(var t,i=0;i<e.length;i++){if("L"===(t=w(e.charAt(i))))return!1;if("R"===t)return!0}return!1},v=function(e,t,a,o){var l,h,c,d,u=t[o];switch(u){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":g=!1;break;case"N":case"AN":break;case"EN":g&&(u="AN");break;case"AL":g=!0,u="R";break;case"WS":case"BN":u="N";break;case"CS":o<1||o+1>=t.length||"EN"!==(l=a[o-1])&&"AN"!==l||"EN"!==(h=t[o+1])&&"AN"!==h?u="N":g&&(h="AN"),u=h===l?h:"N";break;case"ES":u="EN"===(l=0<o?a[o-1]:"B")&&o+1<t.length&&"EN"===t[o+1]?"EN":"N";break;case"ET":if(0<o&&"EN"===a[o-1]){u="EN";break}if(g){u="N";break}for(c=o+1,d=t.length;c<d&&"ET"===t[c];)c++;u=c<d&&"EN"===t[c]?"EN":"N";break;case"NSM":if(n&&!s){for(d=t.length,c=o+1;c<d&&"NSM"===t[c];)c++;if(c<d){var A=e[o],p=1425<=A&&A<=2303||64286===A;if(l=t[c],p&&("R"===l||"AL"===l)){u="R";break}}}u=o<1||"B"===(l=t[o-1])?"N":a[o-1];break;case"B":i=!(g=!1),u=m;break;case"S":r=!0,u="N"}return u},y=function(e,t,i){var r=e.split("");return i&&B(r,i,{hiLevel:m}),r.reverse(),t&&t.reverse(),r.join("")},B=function(e,t,n){var s,a,o,l,h,A=-1,p=e.length,f=0,b=[],y=m?d:c,B=[];for(r=i=g=!1,a=0;a<p;a++)B[a]=w(e[a]);for(o=0;o<p;o++){if(h=f,b[o]=v(e,B,b,o),s=240&(f=y[h][u[b[o]]]),f&=15,t[o]=l=y[f][5],0<s)if(16===s){for(a=A;a<o;a++)t[a]=1;A=-1}else A=-1;if(y[f][6])-1===A&&(A=o);else if(-1<A){for(a=A;a<o;a++)t[a]=l;A=-1}"B"===B[o]&&(t[o]=0),n.hiLevel|=l}r&&function(e,t,i){for(var r=0;r<i;r++)if("S"===e[r]){t[r]=m;for(var n=r-1;0<=n&&"WS"===e[n];n--)t[n]=m}}(B,t,p)},C=function(e,t,r,n,s){if(!(s.hiLevel<e)){if(1===e&&1===m&&!i)return t.reverse(),void(r&&r.reverse());for(var a,o,l,h,c=t.length,d=0;d<c;){if(n[d]>=e){for(l=d+1;l<c&&n[l]>=e;)l++;for(h=d,o=l-1;h<o;h++,o--)a=t[h],t[h]=t[o],t[o]=a,r&&(a=r[h],r[h]=r[o],r[o]=a);d=l}d++}}},x=function(e,t,i){var r=e.split(""),n={hiLevel:m};return i||(i=[]),B(r,i,n),function(e,t,i){if(0!==i.hiLevel&&l)for(var r,n=0;n<e.length;n++)1===t[n]&&0<=(r=p.indexOf(e[n]))&&(e[n]=p[r+1])}(r,i,n),C(2,r,t,i,n),C(1,r,t,i,n),r.join("")};return this.__bidiEngine__.doBidiReorder=function(e,t,i){if(function(e,t){if(t)for(var i=0;i<e.length;i++)t[i]=i;void 0===s&&(s=b(e)),void 0===o&&(o=b(e))}(e,t),n||!a||o)if(n&&a&&s^o)m=s?1:0,e=y(e,t,i);else if(!n&&a&&o)m=s?1:0,e=x(e,t,i),e=y(e,t);else if(!n||s||a||o){if(n&&!a&&s^o)e=y(e,t),e=s?(m=0,x(e,t,i)):(m=1,e=x(e,t,i),y(e,t));else if(n&&s&&!a&&o)m=1,e=x(e,t,i),e=y(e,t);else if(!n&&!a&&s^o){var r=l;s?(m=1,e=x(e,t,i),m=0,l=!1,e=x(e,t,i),l=r):(m=0,e=x(e,t,i),e=y(e,t),l=!(m=1),e=x(e,t,i),l=r,e=y(e,t))}}else m=0,e=x(e,t,i);else m=s?1:0,e=x(e,t,i);return e},this.__bidiEngine__.setOptions=function(e){e&&(n=e.isInputVisual,a=e.isOutputVisual,s=e.isInputRtl,o=e.isOutputRtl,l=e.isSymmetricSwapping)},this.__bidiEngine__.setOptions(e),this.__bidiEngine__};var t=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],i=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(e){var t=e.text,r=(e.x,e.y,e.options||{}),n=(e.mutex,r.lang,[]);if("[object Array]"===Object.prototype.toString.call(t)){var s=0;for(n=[],s=0;s<t.length;s+=1)"[object Array]"===Object.prototype.toString.call(t[s])?n.push([i.doBidiReorder(t[s][0]),t[s][1],t[s][2]]):n.push([i.doBidiReorder(t[s])]);e.text=n}else e.text=i.doBidiReorder(t)}])}(de),window.tmp=Le,ke.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=0===this.colors?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var t=0;t<e;t++){var i=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0);this.palette[t]={red:n,green:r,blue:i,quad:s}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},ke.prototype.parseBGR=function(){this.pos=this.offset;try{var e="bit"+this.bitPP,t=this.width*this.height*4;this.data=new Uint8Array(t),this[e]()}catch(e){console.log("bit decode error:"+e)}},ke.prototype.bit1=function(){var e=Math.ceil(this.width/8),t=e%4,i=0<=this.height?this.height-1:-this.height;for(i=this.height-1;0<=i;i--){for(var r=this.bottom_up?i:this.height-1-i,n=0;n<e;n++)for(var s=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+8*n*4,o=0;o<8&&8*n+o<this.width;o++){var l=this.palette[s>>7-o&1];this.data[a+4*o]=l.blue,this.data[a+4*o+1]=l.green,this.data[a+4*o+2]=l.red,this.data[a+4*o+3]=255}0!=t&&(this.pos+=4-t)}},ke.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,i=this.height-1;0<=i;i--){for(var r=this.bottom_up?i:this.height-1-i,n=0;n<e;n++){var s=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+2*n*4,o=s>>4,l=15&s,h=this.palette[o];if(this.data[a]=h.blue,this.data[a+1]=h.green,this.data[a+2]=h.red,this.data[a+3]=255,2*n+1>=this.width)break;h=this.palette[l],this.data[a+4]=h.blue,this.data[a+4+1]=h.green,this.data[a+4+2]=h.red,this.data[a+4+3]=255}0!=t&&(this.pos+=4-t)}},ke.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;0<=t;t--){for(var i=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),s=i*this.width*4+4*r;if(n<this.palette.length){var a=this.palette[n];this.data[s]=a.red,this.data[s+1]=a.green,this.data[s+2]=a.blue,this.data[s+3]=255}else this.data[s]=255,this.data[s+1]=255,this.data[s+2]=255,this.data[s+3]=255}0!=e&&(this.pos+=4-e)}},ke.prototype.bit15=function(){for(var e=this.width%3,t=parseInt("11111",2),i=this.height-1;0<=i;i--){for(var r=this.bottom_up?i:this.height-1-i,n=0;n<this.width;n++){var s=this.datav.getUint16(this.pos,!0);this.pos+=2;var a=(s&t)/t*255|0,o=(s>>5&t)/t*255|0,l=(s>>10&t)/t*255|0,h=s>>15?255:0,c=r*this.width*4+4*n;this.data[c]=l,this.data[c+1]=o,this.data[c+2]=a,this.data[c+3]=h}this.pos+=e}},ke.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),i=parseInt("111111",2),r=this.height-1;0<=r;r--){for(var n=this.bottom_up?r:this.height-1-r,s=0;s<this.width;s++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(a&t)/t*255|0,l=(a>>5&i)/i*255|0,h=(a>>11)/t*255|0,c=n*this.width*4+4*s;this.data[c]=h,this.data[c+1]=l,this.data[c+2]=o,this.data[c+3]=255}this.pos+=e}},ke.prototype.bit24=function(){for(var e=this.height-1;0<=e;e--){for(var t=this.bottom_up?e:this.height-1-e,i=0;i<this.width;i++){var r=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),a=t*this.width*4+4*i;this.data[a]=s,this.data[a+1]=n,this.data[a+2]=r,this.data[a+3]=255}this.pos+=this.width%4}},ke.prototype.bit32=function(){for(var e=this.height-1;0<=e;e--)for(var t=this.bottom_up?e:this.height-1-e,i=0;i<this.width;i++){var r=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=t*this.width*4+4*i;this.data[o]=s,this.data[o+1]=n,this.data[o+2]=r,this.data[o+3]=a}},ke.prototype.getData=function(){return this.data},window.tmp=ke,function(e){var t=15,i=573,r=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29];function n(){var e=this;function r(e,t){for(var i=0;i|=1&e,e>>>=1,i<<=1,0<--t;);return i>>>1}e.build_tree=function(n){var s,a,o,l=e.dyn_tree,h=e.stat_desc.static_tree,c=e.stat_desc.elems,d=-1;for(n.heap_len=0,n.heap_max=i,s=0;s<c;s++)0!==l[2*s]?(n.heap[++n.heap_len]=d=s,n.depth[s]=0):l[2*s+1]=0;for(;n.heap_len<2;)l[2*(o=n.heap[++n.heap_len]=d<2?++d:0)]=1,n.depth[o]=0,n.opt_len--,h&&(n.static_len-=h[2*o+1]);for(e.max_code=d,s=Math.floor(n.heap_len/2);1<=s;s--)n.pqdownheap(l,s);for(o=c;s=n.heap[1],n.heap[1]=n.heap[n.heap_len--],n.pqdownheap(l,1),a=n.heap[1],n.heap[--n.heap_max]=s,n.heap[--n.heap_max]=a,l[2*o]=l[2*s]+l[2*a],n.depth[o]=Math.max(n.depth[s],n.depth[a])+1,l[2*s+1]=l[2*a+1]=o,n.heap[1]=o++,n.pqdownheap(l,1),2<=n.heap_len;);n.heap[--n.heap_max]=n.heap[1],function(r){var n,s,a,o,l,h,c=e.dyn_tree,d=e.stat_desc.static_tree,u=e.stat_desc.extra_bits,A=e.stat_desc.extra_base,p=e.stat_desc.max_length,f=0;for(o=0;o<=t;o++)r.bl_count[o]=0;for(c[2*r.heap[r.heap_max]+1]=0,n=r.heap_max+1;n<i;n++)p<(o=c[2*c[2*(s=r.heap[n])+1]+1]+1)&&(o=p,f++),c[2*s+1]=o,s>e.max_code||(r.bl_count[o]++,l=0,A<=s&&(l=u[s-A]),h=c[2*s],r.opt_len+=h*(o+l),d&&(r.static_len+=h*(d[2*s+1]+l)));if(0!==f){do{for(o=p-1;0===r.bl_count[o];)o--;r.bl_count[o]--,r.bl_count[o+1]+=2,r.bl_count[p]--,f-=2}while(0<f);for(o=p;0!==o;o--)for(s=r.bl_count[o];0!==s;)(a=r.heap[--n])>e.max_code||(c[2*a+1]!=o&&(r.opt_len+=(o-c[2*a+1])*c[2*a],c[2*a+1]=o),s--)}}(n),function(e,i,n){var s,a,o,l=[],h=0;for(s=1;s<=t;s++)l[s]=h=h+n[s-1]<<1;for(a=0;a<=i;a++)0!==(o=e[2*a+1])&&(e[2*a]=r(l[o]++,o))}(l,e.max_code,n.bl_count)}}function s(e,t,i,r,n){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=r,this.max_length=n}function a(e,t,i,r,n){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=r,this.func=n}n._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28],n.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],n.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],n.d_code=function(e){return e<256?r[e]:r[256+(e>>>7)]},n.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],n.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],n.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],n.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],s.static_ltree=[12,8,140,8,76,8,204,8,44,8,172,8,108,8,236,8,28,8,156,8,92,8,220,8,60,8,188,8,124,8,252,8,2,8,130,8,66,8,194,8,34,8,162,8,98,8,226,8,18,8,146,8,82,8,210,8,50,8,178,8,114,8,242,8,10,8,138,8,74,8,202,8,42,8,170,8,106,8,234,8,26,8,154,8,90,8,218,8,58,8,186,8,122,8,250,8,6,8,134,8,70,8,198,8,38,8,166,8,102,8,230,8,22,8,150,8,86,8,214,8,54,8,182,8,118,8,246,8,14,8,142,8,78,8,206,8,46,8,174,8,110,8,238,8,30,8,158,8,94,8,222,8,62,8,190,8,126,8,254,8,1,8,129,8,65,8,193,8,33,8,161,8,97,8,225,8,17,8,145,8,81,8,209,8,49,8,177,8,113,8,241,8,9,8,137,8,73,8,201,8,41,8,169,8,105,8,233,8,25,8,153,8,89,8,217,8,57,8,185,8,121,8,249,8,5,8,133,8,69,8,197,8,37,8,165,8,101,8,229,8,21,8,149,8,85,8,213,8,53,8,181,8,117,8,245,8,13,8,141,8,77,8,205,8,45,8,173,8,109,8,237,8,29,8,157,8,93,8,221,8,61,8,189,8,125,8,253,8,19,9,275,9,147,9,403,9,83,9,339,9,211,9,467,9,51,9,307,9,179,9,435,9,115,9,371,9,243,9,499,9,11,9,267,9,139,9,395,9,75,9,331,9,203,9,459,9,43,9,299,9,171,9,427,9,107,9,363,9,235,9,491,9,27,9,283,9,155,9,411,9,91,9,347,9,219,9,475,9,59,9,315,9,187,9,443,9,123,9,379,9,251,9,507,9,7,9,263,9,135,9,391,9,71,9,327,9,199,9,455,9,39,9,295,9,167,9,423,9,103,9,359,9,231,9,487,9,23,9,279,9,151,9,407,9,87,9,343,9,215,9,471,9,55,9,311,9,183,9,439,9,119,9,375,9,247,9,503,9,15,9,271,9,143,9,399,9,79,9,335,9,207,9,463,9,47,9,303,9,175,9,431,9,111,9,367,9,239,9,495,9,31,9,287,9,159,9,415,9,95,9,351,9,223,9,479,9,63,9,319,9,191,9,447,9,127,9,383,9,255,9,511,9,0,7,64,7,32,7,96,7,16,7,80,7,48,7,112,7,8,7,72,7,40,7,104,7,24,7,88,7,56,7,120,7,4,7,68,7,36,7,100,7,20,7,84,7,52,7,116,7,3,8,131,8,67,8,195,8,35,8,163,8,99,8,227,8],s.static_dtree=[0,5,16,5,8,5,24,5,4,5,20,5,12,5,28,5,2,5,18,5,10,5,26,5,6,5,22,5,14,5,30,5,1,5,17,5,9,5,25,5,5,5,21,5,13,5,29,5,3,5,19,5,11,5,27,5,7,5,23,5],s.static_l_desc=new s(s.static_ltree,n.extra_lbits,257,286,t),s.static_d_desc=new s(s.static_dtree,n.extra_dbits,0,30,t),s.static_bl_desc=new s(null,n.extra_blbits,0,19,7);var o=[new a(0,0,0,0,0),new a(4,4,8,4,1),new a(4,5,16,8,1),new a(4,6,32,32,1),new a(4,4,16,16,2),new a(8,16,32,32,2),new a(8,16,128,128,2),new a(8,32,128,256,2),new a(32,128,258,1024,2),new a(32,258,258,4096,2)],l=["need dictionary","stream end","","","stream error","data error","","buffer error","",""];function h(e,t,i,r){var n=e[2*t],s=e[2*i];return n<s||n==s&&r[t]<=r[i]}function c(){var e,t,i,r,a,c,d,u,A,p,f,g,m,w,b,v,y,B,C,x,F,N,S,E,T,L,k,D,I,U,P,O,R,Q,H,M,_,j,z,V,K,q=this,G=new n,W=new n,J=new n;function X(){var e;for(e=0;e<286;e++)P[2*e]=0;for(e=0;e<30;e++)O[2*e]=0;for(e=0;e<19;e++)R[2*e]=0;P[512]=1,q.opt_len=q.static_len=0,M=j=0}function Y(e,t){var i,r,n=-1,s=e[1],a=0,o=7,l=4;for(0===s&&(o=138,l=3),e[2*(t+1)+1]=65535,i=0;i<=t;i++)r=s,s=e[2*(i+1)+1],++a<o&&r==s||(a<l?R[2*r]+=a:0!==r?(r!=n&&R[2*r]++,R[32]++):a<=10?R[34]++:R[36]++,n=r,l=(a=0)===s?(o=138,3):r==s?(o=6,3):(o=7,4))}function $(e){q.pending_buf[q.pending++]=e}function Z(e){$(255&e),$(e>>>8&255)}function ee(e,t){var i,r=t;16-r<K?(Z(V|=(i=e)<<K&65535),V=i>>>16-K,K+=r-16):(V|=e<<K&65535,K+=r)}function te(e,t){var i=2*e;ee(65535&t[i],65535&t[i+1])}function ie(e,t){var i,r,n=-1,s=e[1],a=0,o=7,l=4;for(0===s&&(o=138,l=3),i=0;i<=t;i++)if(r=s,s=e[2*(i+1)+1],!(++a<o&&r==s)){if(a<l)for(;te(r,R),0!=--a;);else 0!==r?(r!=n&&(te(r,R),a--),te(16,R),ee(a-3,2)):a<=10?(te(17,R),ee(a-3,3)):(te(18,R),ee(a-11,7));n=r,l=(a=0)===s?(o=138,3):r==s?(o=6,3):(o=7,4)}}function re(){16==K?(Z(V),K=V=0):8<=K&&($(255&V),V>>>=8,K-=8)}function ne(e,t){var i,r,s;if(q.pending_buf[_+2*M]=e>>>8&255,q.pending_buf[_+2*M+1]=255&e,q.pending_buf[Q+M]=255&t,M++,0===e?P[2*t]++:(j++,e--,P[2*(n._length_code[t]+256+1)]++,O[2*n.d_code(e)]++),!(8191&M)&&2<k){for(i=8*M,r=F-y,s=0;s<30;s++)i+=O[2*s]*(5+n.extra_dbits[s]);if(i>>>=3,j<Math.floor(M/2)&&i<Math.floor(r/2))return!0}return M==H-1}function se(e,t){var i,r,s,a,o=0;if(0!==M)for(;i=q.pending_buf[_+2*o]<<8&65280|255&q.pending_buf[_+2*o+1],r=255&q.pending_buf[Q+o],o++,0===i?te(r,e):(te((s=n._length_code[r])+256+1,e),0!==(a=n.extra_lbits[s])&&ee(r-=n.base_length[s],a),te(s=n.d_code(--i),t),0!==(a=n.extra_dbits[s])&&ee(i-=n.base_dist[s],a)),o<M;);te(256,e),z=e[513]}function ae(){8<K?Z(V):0<K&&$(255&V),K=V=0}function oe(e,t,i){var r,n,s;ee(0+(i?1:0),3),r=e,n=t,s=!0,ae(),z=8,s&&(Z(n),Z(~n)),q.pending_buf.set(u.subarray(r,r+n),q.pending),q.pending+=n}function le(e,t,i){var r,a,o=0;0<k?(G.build_tree(q),W.build_tree(q),o=function(){var e;for(Y(P,G.max_code),Y(O,W.max_code),J.build_tree(q),e=18;3<=e&&0===R[2*n.bl_order[e]+1];e--);return q.opt_len+=3*(e+1)+5+5+4,e}(),r=q.opt_len+3+7>>>3,(a=q.static_len+3+7>>>3)<=r&&(r=a)):r=a=t+5,t+4<=r&&-1!=e?oe(e,t,i):a==r?(ee(2+(i?1:0),3),se(s.static_ltree,s.static_dtree)):(ee(4+(i?1:0),3),function(e,t,i){var r;for(ee(e-257,5),ee(t-1,5),ee(i-4,4),r=0;r<i;r++)ee(R[2*n.bl_order[r]+1],3);ie(P,e-1),ie(O,t-1)}(G.max_code+1,W.max_code+1,o+1),se(P,O)),X(),i&&ae()}function he(t){le(0<=y?y:-1,F-y,t),y=F,e.flush_pending()}function ce(){var t,i,r,n;do{if(0===(n=A-S-F)&&0===F&&0===S)n=a;else if(-1==n)n--;else if(a+a-262<=F){for(u.set(u.subarray(a,a+a),0),N-=a,F-=a,y-=a,r=t=m;i=65535&f[--r],f[r]=a<=i?i-a:0,0!=--t;);for(r=t=a;i=65535&p[--r],p[r]=a<=i?i-a:0,0!=--t;);n+=a}if(0===e.avail_in)return;t=e.read_buf(u,F+S,n),3<=(S+=t)&&(g=((g=255&u[F])<<v^255&u[F+1])&b)}while(S<262&&0!==e.avail_in)}function de(e){var t,i,r=T,n=F,s=E,o=a-262<F?F-(a-262):0,l=U,h=d,c=F+258,A=u[n+s-1],f=u[n+s];I<=E&&(r>>=2),S<l&&(l=S);do{if(u[(t=e)+s]==f&&u[t+s-1]==A&&u[t]==u[n]&&u[++t]==u[n+1]){n+=2,t++;do{}while(u[++n]==u[++t]&&u[++n]==u[++t]&&u[++n]==u[++t]&&u[++n]==u[++t]&&u[++n]==u[++t]&&u[++n]==u[++t]&&u[++n]==u[++t]&&u[++n]==u[++t]&&n<c);if(i=258-(c-n),n=c-258,s<i){if(N=e,l<=(s=i))break;A=u[n+s-1],f=u[n+s]}}}while((e=65535&p[e&h])>o&&0!=--r);return s<=S?s:S}function ue(e){return e.total_in=e.total_out=0,e.msg=null,q.pending=0,q.pending_out=0,t=113,r=0,G.dyn_tree=P,G.stat_desc=s.static_l_desc,W.dyn_tree=O,W.stat_desc=s.static_d_desc,J.dyn_tree=R,J.stat_desc=s.static_bl_desc,K=V=0,z=8,X(),function(){var e;for(A=2*a,e=f[m-1]=0;e<m-1;e++)f[e]=0;L=o[k].max_lazy,I=o[k].good_length,U=o[k].nice_length,T=o[k].max_chain,B=E=2,g=x=S=y=F=0}(),0}q.depth=[],q.bl_count=[],q.heap=[],P=[],O=[],R=[],q.pqdownheap=function(e,t){for(var i=q.heap,r=i[t],n=t<<1;n<=q.heap_len&&(n<q.heap_len&&h(e,i[n+1],i[n],q.depth)&&n++,!h(e,r,i[n],q.depth));)i[t]=i[n],t=n,n<<=1;i[t]=r},q.deflateInit=function(e,t,r,n,s,o){return n||(n=8),s||(s=8),o||(o=0),e.msg=null,-1==t&&(t=6),s<1||9<s||8!=n||r<9||15<r||t<0||9<t||o<0||2<o?-2:(e.dstate=q,d=(a=1<<(c=r))-1,b=(m=1<<(w=s+7))-1,v=Math.floor((w+3-1)/3),u=new Uint8Array(2*a),p=[],f=[],H=1<<s+6,q.pending_buf=new Uint8Array(4*H),i=4*H,_=Math.floor(H/2),Q=3*H,k=t,D=o,ue(e))},q.deflateEnd=function(){return 42!=t&&113!=t&&666!=t?-2:(q.pending_buf=null,u=p=f=null,q.dstate=null,113==t?-3:0)},q.deflateParams=function(e,t,i){var r=0;return-1==t&&(t=6),t<0||9<t||i<0||2<i?-2:(o[k].func!=o[t].func&&0!==e.total_in&&(r=e.deflate(1)),k!=t&&(L=o[k=t].max_lazy,I=o[k].good_length,U=o[k].nice_length,T=o[k].max_chain),D=i,r)},q.deflateSetDictionary=function(e,i,r){var n,s=r,o=0;if(!i||42!=t)return-2;if(s<3)return 0;for(a-262<s&&(o=r-(s=a-262)),u.set(i.subarray(o,o+s),0),y=F=s,g=((g=255&u[0])<<v^255&u[1])&b,n=0;n<=s-3;n++)g=(g<<v^255&u[n+2])&b,p[n&d]=f[g],f[g]=n;return 0},q.deflate=function(n,h){var A,w,T,I,U,P;if(4<h||h<0)return-2;if(!n.next_out||!n.next_in&&0!==n.avail_in||666==t&&4!=h)return n.msg=l[4],-2;if(0===n.avail_out)return n.msg=l[7],-5;if(e=n,I=r,r=h,42==t&&(w=8+(c-8<<4)<<8,3<(T=(k-1&255)>>1)&&(T=3),w|=T<<6,0!==F&&(w|=32),t=113,$((P=w+=31-w%31)>>8&255),$(255&P)),0!==q.pending){if(e.flush_pending(),0===e.avail_out)return r=-1,0}else if(0===e.avail_in&&h<=I&&4!=h)return e.msg=l[7],-5;if(666==t&&0!==e.avail_in)return n.msg=l[7],-5;if(0!==e.avail_in||0!==S||0!=h&&666!=t){switch(U=-1,o[k].func){case 0:U=function(t){var r,n=65535;for(i-5<n&&(n=i-5);;){if(S<=1){if(ce(),0===S&&0==t)return 0;if(0===S)break}if(F+=S,r=y+n,((S=0)===F||r<=F)&&(S=F-r,F=r,he(!1),0===e.avail_out))return 0;if(a-262<=F-y&&(he(!1),0===e.avail_out))return 0}return he(4==t),0===e.avail_out?4==t?2:0:4==t?3:1}(h);break;case 1:U=function(t){for(var i,r=0;;){if(S<262){if(ce(),S<262&&0==t)return 0;if(0===S)break}if(3<=S&&(g=(g<<v^255&u[F+2])&b,r=65535&f[g],p[F&d]=f[g],f[g]=F),0!==r&&(F-r&65535)<=a-262&&2!=D&&(B=de(r)),3<=B)if(i=ne(F-N,B-3),S-=B,B<=L&&3<=S){for(B--;g=(g<<v^255&u[2+ ++F])&b,r=65535&f[g],p[F&d]=f[g],f[g]=F,0!=--B;);F++}else F+=B,B=0,g=((g=255&u[F])<<v^255&u[F+1])&b;else i=ne(0,255&u[F]),S--,F++;if(i&&(he(!1),0===e.avail_out))return 0}return he(4==t),0===e.avail_out?4==t?2:0:4==t?3:1}(h);break;case 2:U=function(t){for(var i,r,n=0;;){if(S<262){if(ce(),S<262&&0==t)return 0;if(0===S)break}if(3<=S&&(g=(g<<v^255&u[F+2])&b,n=65535&f[g],p[F&d]=f[g],f[g]=F),E=B,C=N,B=2,0!==n&&E<L&&(F-n&65535)<=a-262&&(2!=D&&(B=de(n)),B<=5&&(1==D||3==B&&4096<F-N)&&(B=2)),3<=E&&B<=E){for(r=F+S-3,i=ne(F-1-C,E-3),S-=E-1,E-=2;++F<=r&&(g=(g<<v^255&u[F+2])&b,n=65535&f[g],p[F&d]=f[g],f[g]=F),0!=--E;);if(x=0,B=2,F++,i&&(he(!1),0===e.avail_out))return 0}else if(0!==x){if((i=ne(0,255&u[F-1]))&&he(!1),F++,S--,0===e.avail_out)return 0}else x=1,F++,S--}return 0!==x&&(i=ne(0,255&u[F-1]),x=0),he(4==t),0===e.avail_out?4==t?2:0:4==t?3:1}(h)}if(2!=U&&3!=U||(t=666),0==U||2==U)return 0===e.avail_out&&(r=-1),0;if(1==U){if(1==h)ee(2,3),te(256,s.static_ltree),re(),1+z+10-K<9&&(ee(2,3),te(256,s.static_ltree),re()),z=7;else if(oe(0,0,!1),3==h)for(A=0;A<m;A++)f[A]=0;if(e.flush_pending(),0===e.avail_out)return r=-1,0}}return 4!=h?0:1}}function d(){this.next_in_index=0,this.next_out_index=0,this.avail_in=0,this.total_in=0,this.avail_out=0,this.total_out=0}d.prototype={deflateInit:function(e,i){return this.dstate=new c,i||(i=t),this.dstate.deflateInit(this,e,i)},deflate:function(e){return this.dstate?this.dstate.deflate(this,e):-2},deflateEnd:function(){if(!this.dstate)return-2;var e=this.dstate.deflateEnd();return this.dstate=null,e},deflateParams:function(e,t){return this.dstate?this.dstate.deflateParams(this,e,t):-2},deflateSetDictionary:function(e,t){return this.dstate?this.dstate.deflateSetDictionary(this,e,t):-2},read_buf:function(e,t,i){var r=this.avail_in;return i<r&&(r=i),0===r?0:(this.avail_in-=r,e.set(this.next_in.subarray(this.next_in_index,this.next_in_index+r),t),this.next_in_index+=r,this.total_in+=r,r)},flush_pending:function(){var e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),0!==t&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,0===e.dstate.pending&&(e.dstate.pending_out=0))}};var u=e.zip||e;u.Deflater=u._jzlib_Deflater=function(e){var t=new d,i=new Uint8Array(512),r=e?e.level:-1;void 0===r&&(r=-1),t.deflateInit(r),t.next_out=i,this.append=function(e,r){var n,s=[],a=0,o=0,l=0;if(e.length){t.next_in_index=0,t.next_in=e,t.avail_in=e.length;do{if(t.next_out_index=0,t.avail_out=512,0!=t.deflate(0))throw new Error("deflating: "+t.msg);t.next_out_index&&(512==t.next_out_index?s.push(new Uint8Array(i)):s.push(new Uint8Array(i.subarray(0,t.next_out_index)))),l+=t.next_out_index,r&&0<t.next_in_index&&t.next_in_index!=a&&(r(t.next_in_index),a=t.next_in_index)}while(0<t.avail_in||0===t.avail_out);return n=new Uint8Array(l),s.forEach((function(e){n.set(e,o),o+=e.length})),n}},this.flush=function(){var e,r,n=[],s=0,a=0;do{if(t.next_out_index=0,t.avail_out=512,1!=(e=t.deflate(4))&&0!=e)throw new Error("deflating: "+t.msg);0<512-t.avail_out&&n.push(new Uint8Array(i.subarray(0,t.next_out_index))),a+=t.next_out_index}while(0<t.avail_in||0===t.avail_out);return t.deflateEnd(),r=new Uint8Array(a),n.forEach((function(e){r.set(e,s),s+=e.length})),r}}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0!==cd&&cd||Function('return typeof this === "object" && this.content')()||Function("return this")()),("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0!==cd&&cd||Function('return typeof this === "object" && this.content')()||Function("return this")()).RGBColor=function(e){var t;e=e||"",this.ok=!1,"#"==e.charAt(0)&&(e=e.substr(1,6)),e=(e=e.replace(/ /g,"")).toLowerCase();var i={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};for(var r in i)e==r&&(e=i[r]);for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(e){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],s=0;s<n.length;s++){var a=n[s].re,o=n[s].process,l=a.exec(e);l&&(t=o(l),this.r=t[0],this.g=t[1],this.b=t[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:255<this.r?255:this.r,this.g=this.g<0||isNaN(this.g)?0:255<this.g?255:this.g,this.b=this.b<0||isNaN(this.b)?0:255<this.b?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var e=this.r.toString(16),t=this.g.toString(16),i=this.b.toString(16);return 1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==i.length&&(i="0"+i),"#"+e+t+i}},function(e){var t="+".charCodeAt(0),i="/".charCodeAt(0),r="0".charCodeAt(0),n="a".charCodeAt(0),s="A".charCodeAt(0),a="-".charCodeAt(0),o="_".charCodeAt(0),l=function(e){var l=e.charCodeAt(0);return l===t||l===a?62:l===i||l===o?63:l<r?-1:l<r+10?l-r+26+26:l<s+26?l-s:l<n+26?l-n+26:void 0};e.API.TTFFont=function(){function e(e,t,i){var r;if(this.rawData=e,r=this.contents=new c(e),this.contents.pos=4,"ttcf"===r.readString(4)){if(!t)throw new Error("Must specify a font name for TTC files.");throw new Error("Font "+t+" not found in TTC file.")}r.pos=0,this.parse(),this.subset=new T(this),this.registerTTF()}return e.open=function(t,i,r,n){if("string"!=typeof r)throw new Error("Invalid argument supplied in TTFFont.open");return new e(function(e){var t,i,r,n,s,a;if(0<e.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var o=e.length;s="="===e.charAt(o-2)?2:"="===e.charAt(o-1)?1:0,a=new Uint8Array(3*e.length/4-s),r=0<s?e.length-4:e.length;var h=0;function c(e){a[h++]=e}for(i=t=0;t<r;t+=4,i+=3)c((16711680&(n=l(e.charAt(t))<<18|l(e.charAt(t+1))<<12|l(e.charAt(t+2))<<6|l(e.charAt(t+3))))>>16),c((65280&n)>>8),c(255&n);return 2===s?c(255&(n=l(e.charAt(t))<<2|l(e.charAt(t+1))>>4)):1===s&&(c((n=l(e.charAt(t))<<10|l(e.charAt(t+1))<<4|l(e.charAt(t+2))>>2)>>8&255),c(255&n)),a}(r),i)},e.prototype.parse=function(){return this.directory=new d(this.contents),this.head=new p(this),this.name=new y(this),this.cmap=new g(this),this.toUnicode=new Map,this.hhea=new m(this),this.maxp=new B(this),this.hmtx=new C(this),this.post=new b(this),this.os2=new w(this),this.loca=new E(this),this.glyf=new F(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var e,t,i,r,n;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var t,i,r,n;for(n=[],t=0,i=(r=this.bbox).length;t<i;t++)e=r[t],n.push(Math.round(e*this.scaleFactor));return n}.call(this),this.stemV=0,this.post.exists?(i=255&(r=this.post.italic_angle),!0&(t=r>>16)&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+i)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=1===(n=this.familyClass)||2===n||3===n||4===n||5===n||7===n,this.isScript=10===this.familyClass,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),0!==this.italicAngle&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(e){var t;return(null!=(t=this.cmap.unicode)?t.codeMap[e]:void 0)||0},e.prototype.widthOfGlyph=function(e){var t;return t=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*t},e.prototype.widthOfString=function(e,t,i){var r,n,s,a,o;for(n=a=s=0,o=(e=""+e).length;0<=o?a<o:o<a;n=0<=o?++a:--a)r=e.charCodeAt(n),s+=this.widthOfGlyph(this.characterToGlyph(r))+i*(1e3/t)||0;return s*(t/1e3)},e.prototype.lineHeight=function(e,t){var i;return null==t&&(t=!1),i=t?this.lineGap:0,(this.ascender+i-this.decender)/1e3*e},e}();var h,c=function(){function e(e){this.data=null!=e?e:[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(e){return this.data[this.pos++]=e},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt32=function(){var e;return 2147483648<=(e=this.readUInt32())?e-4294967296:e},e.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt16=function(){var e;return 32768<=(e=this.readUInt16())?e-65536:e},e.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},e.prototype.readString=function(e){var t,i,r;for(i=[],t=r=0;0<=e?r<e:e<r;t=0<=e?++r:--r)i[t]=String.fromCharCode(this.readByte());return i.join("")},e.prototype.writeString=function(e){var t,i,r,n;for(n=[],t=i=0,r=e.length;0<=r?i<r:r<i;t=0<=r?++i:--i)n.push(this.writeByte(e.charCodeAt(t)));return n},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(e){return this.writeInt16(e)},e.prototype.readLongLong=function(){var e,t,i,r,n,s,a,o;return e=this.readByte(),t=this.readByte(),i=this.readByte(),r=this.readByte(),n=this.readByte(),s=this.readByte(),a=this.readByte(),o=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^t)+1099511627776*(255^i)+4294967296*(255^r)+16777216*(255^n)+65536*(255^s)+256*(255^a)+(255^o)+1):72057594037927940*e+281474976710656*t+1099511627776*i+4294967296*r+16777216*n+65536*s+256*a+o},e.prototype.writeLongLong=function(e){var t,i;return t=Math.floor(e/4294967296),i=4294967295&e,this.writeByte(t>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t),this.writeByte(i>>24&255),this.writeByte(i>>16&255),this.writeByte(i>>8&255),this.writeByte(255&i)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(e){return this.writeInt32(e)},e.prototype.read=function(e){var t,i;for(t=[],i=0;0<=e?i<e:e<i;0<=e?++i:--i)t.push(this.readByte());return t},e.prototype.write=function(e){var t,i,r,n;for(n=[],i=0,r=e.length;i<r;i++)t=e[i],n.push(this.writeByte(t));return n},e}(),d=function(){var e;function t(e){var t,i,r;for(this.scalarType=e.readInt(),this.tableCount=e.readShort(),this.searchRange=e.readShort(),this.entrySelector=e.readShort(),this.rangeShift=e.readShort(),this.tables={},i=0,r=this.tableCount;0<=r?i<r:r<i;0<=r?++i:--i)t={tag:e.readString(4),checksum:e.readInt(),offset:e.readInt(),length:e.readInt()},this.tables[t.tag]=t}return t.prototype.encode=function(t){var i,r,n,s,a,o,l,h,d,u,A,p,f;for(f in A=Object.keys(t).length,o=Math.log(2),d=16*Math.floor(Math.log(A)/o),s=Math.floor(d/o),h=16*A-d,(r=new c).writeInt(this.scalarType),r.writeShort(A),r.writeShort(d),r.writeShort(s),r.writeShort(h),n=16*A,l=r.pos+n,a=null,p=[],t)for(u=t[f],r.writeString(f),r.writeInt(e(u)),r.writeInt(l),r.writeInt(u.length),p=p.concat(u),"head"===f&&(a=l),l+=u.length;l%4;)p.push(0),l++;return r.write(p),i=2981146554-e(r.data),r.pos=a+8,r.writeUInt32(i),r.data},e=function(e){var t,i,r,n;for(e=x.call(e);e.length%4;)e.push(0);for(i=new c(e),r=t=0,n=e.length;r<n;r+=4)t+=i.readUInt32();return 4294967295&t},t}(),u={}.hasOwnProperty,A=function(e,t){for(var i in t)u.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};h=function(){function e(e){var t;this.file=e,t=this.file.directory.tables[this.tag],this.exists=!!t,t&&(this.offset=t.offset,this.length=t.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var p=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="head",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.revision=e.readInt(),this.checkSumAdjustment=e.readInt(),this.magicNumber=e.readInt(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.readLongLong(),this.modified=e.readLongLong(),this.xMin=e.readShort(),this.yMin=e.readShort(),this.xMax=e.readShort(),this.yMax=e.readShort(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort(),this.indexToLocFormat=e.readShort(),this.glyphDataFormat=e.readShort()},e.prototype.encode=function(e){var t;return(t=new c).writeInt(this.version),t.writeInt(this.revision),t.writeInt(this.checkSumAdjustment),t.writeInt(this.magicNumber),t.writeShort(this.flags),t.writeShort(this.unitsPerEm),t.writeLongLong(this.created),t.writeLongLong(this.modified),t.writeShort(this.xMin),t.writeShort(this.yMin),t.writeShort(this.xMax),t.writeShort(this.yMax),t.writeShort(this.macStyle),t.writeShort(this.lowestRecPPEM),t.writeShort(this.fontDirectionHint),t.writeShort(e),t.writeShort(this.glyphDataFormat),t.data},e}(),f=function(){function e(e,t){var i,r,n,s,a,o,l,h,c,d,u,A,p,f,g,m,w,b;switch(this.platformID=e.readUInt16(),this.encodingID=e.readShort(),this.offset=t+e.readInt(),c=e.pos,e.pos=this.offset,this.format=e.readUInt16(),this.length=e.readUInt16(),this.language=e.readUInt16(),this.isUnicode=3===this.platformID&&1===this.encodingID&&4===this.format||0===this.platformID&&4===this.format,this.codeMap={},this.format){case 0:for(o=g=0;g<256;o=++g)this.codeMap[o]=e.readByte();break;case 4:for(u=e.readUInt16(),d=u/2,e.pos+=6,n=function(){var t,i;for(i=[],o=t=0;0<=d?t<d:d<t;o=0<=d?++t:--t)i.push(e.readUInt16());return i}(),e.pos+=2,p=function(){var t,i;for(i=[],o=t=0;0<=d?t<d:d<t;o=0<=d?++t:--t)i.push(e.readUInt16());return i}(),l=function(){var t,i;for(i=[],o=t=0;0<=d?t<d:d<t;o=0<=d?++t:--t)i.push(e.readUInt16());return i}(),h=function(){var t,i;for(i=[],o=t=0;0<=d?t<d:d<t;o=0<=d?++t:--t)i.push(e.readUInt16());return i}(),r=(this.length-e.pos+this.offset)/2,a=function(){var t,i;for(i=[],o=t=0;0<=r?t<r:r<t;o=0<=r?++t:--t)i.push(e.readUInt16());return i}(),o=m=0,b=n.length;m<b;o=++m)for(f=n[o],i=w=A=p[o];A<=f?w<=f:f<=w;i=A<=f?++w:--w)0===h[o]?s=i+l[o]:0!==(s=a[h[o]/2+(i-A)-(d-o)]||0)&&(s+=l[o]),this.codeMap[i]=65535&s}e.pos=c}return e.encode=function(e,t){var i,r,n,s,a,o,l,h,d,u,A,p,f,g,m,w,b,v,y,B,C,x,F,N,S,E,T,L,k,D,I,U,P,O,R,Q,H,M,_,j,z,V,K,q,G,W;switch(L=new c,s=Object.keys(e).sort((function(e,t){return e-t})),t){case"macroman":for(f=0,g=function(){var e,t;for(t=[],p=e=0;e<256;p=++e)t.push(0);return t}(),w={0:0},n={},k=0,P=s.length;k<P;k++)null==w[K=e[r=s[k]]]&&(w[K]=++f),n[r]={old:e[r],new:w[e[r]]},g[r]=w[e[r]];return L.writeUInt16(1),L.writeUInt16(0),L.writeUInt32(12),L.writeUInt16(0),L.writeUInt16(262),L.writeUInt16(0),L.write(g),{charMap:n,subtable:L.data,maxGlyphID:f+1};case"unicode":for(E=[],d=[],w={},i={},m=l=null,D=b=0,O=s.length;D<O;D++)null==w[y=e[r=s[D]]]&&(w[y]=++b),i[r]={old:y,new:w[y]},a=w[y]-r,null!=m&&a===l||(m&&d.push(m),E.push(r),l=a),m=r;for(m&&d.push(m),d.push(65535),E.push(65535),N=2*(F=E.length),x=2*Math.pow(Math.log(F)/Math.LN2,2),u=Math.log(x/2)/Math.LN2,C=2*F-x,o=[],B=[],A=[],p=I=0,R=E.length;I<R;p=++I){if(S=E[p],h=d[p],65535===S){o.push(0),B.push(0);break}if(32768<=S-(T=i[S].new))for(o.push(0),B.push(2*(A.length+F-p)),r=U=S;S<=h?U<=h:h<=U;r=S<=h?++U:--U)A.push(i[r].new);else o.push(T-S),B.push(0)}for(L.writeUInt16(3),L.writeUInt16(1),L.writeUInt32(12),L.writeUInt16(4),L.writeUInt16(16+8*F+2*A.length),L.writeUInt16(0),L.writeUInt16(N),L.writeUInt16(x),L.writeUInt16(u),L.writeUInt16(C),z=0,Q=d.length;z<Q;z++)r=d[z],L.writeUInt16(r);for(L.writeUInt16(0),V=0,H=E.length;V<H;V++)r=E[V],L.writeUInt16(r);for(q=0,M=o.length;q<M;q++)a=o[q],L.writeUInt16(a);for(G=0,_=B.length;G<_;G++)v=B[G],L.writeUInt16(v);for(W=0,j=A.length;W<j;W++)f=A[W],L.writeUInt16(f);return{charMap:i,subtable:L.data,maxGlyphID:b+1}}},e}(),g=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="cmap",e.prototype.parse=function(e){var t,i,r;for(e.pos=this.offset,this.version=e.readUInt16(),i=e.readUInt16(),this.tables=[],this.unicode=null,r=0;0<=i?r<i:i<r;0<=i?++r:--r)t=new f(e,this.offset),this.tables.push(t),t.isUnicode&&null==this.unicode&&(this.unicode=t);return!0},e.encode=function(e,t){var i,r;return null==t&&(t="macroman"),i=f.encode(e,t),(r=new c).writeUInt16(0),r.writeUInt16(1),i.table=r.data.concat(i.subtable),i},e}(),m=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="hhea",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},e}(),w=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="OS/2",e.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=function(){var t,i;for(i=[],t=0;t<10;++t)i.push(e.readByte());return i}(),this.charRange=function(){var t,i;for(i=[],t=0;t<4;++t)i.push(e.readInt());return i}(),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),0<this.version&&(this.ascent=e.readShort(),this.descent=e.readShort(),this.lineGap=e.readShort(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=function(){var t,i;for(i=[],t=0;t<2;++t)i.push(e.readInt());return i}(),1<this.version))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},e}(),b=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="post",e.prototype.parse=function(e){var t,i,r,n;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:for(i=e.readUInt16(),this.glyphNameIndex=[],r=0;0<=i?r<i:i<r;0<=i?++r:--r)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],n=[];e.pos<this.offset+this.length;)t=e.readByte(),n.push(this.names.push(e.readString(t)));return n;case 151552:return i=e.readUInt16(),this.offsets=e.read(i);case 262144:return this.map=function(){var t,i,r;for(r=[],t=0,i=this.file.maxp.numGlyphs;0<=i?t<i:i<t;0<=i?++t:--t)r.push(e.readUInt32());return r}.call(this)}},e}(),v=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},y=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="name",e.prototype.parse=function(e){var t,i,r,n,s,a,o,l,h,c,d,u;for(e.pos=this.offset,e.readShort(),t=e.readShort(),a=e.readShort(),i=[],n=h=0;0<=t?h<t:t<h;n=0<=t?++h:--h)i.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+a+e.readShort()});for(o={},n=c=0,d=i.length;c<d;n=++c)r=i[n],e.pos=r.offset,l=e.readString(r.length),s=new v(l,r),null==o[u=r.nameID]&&(o[u]=[]),o[r.nameID].push(s);this.strings=o,this.copyright=o[0],this.fontFamily=o[1],this.fontSubfamily=o[2],this.uniqueSubfamily=o[3],this.fontName=o[4],this.version=o[5];try{this.postscriptName=o[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch(e){this.postscriptName=o[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=o[7],this.manufacturer=o[8],this.designer=o[9],this.description=o[10],this.vendorUrl=o[11],this.designerUrl=o[12],this.license=o[13],this.licenseUrl=o[14],this.preferredFamily=o[15],this.preferredSubfamily=o[17],this.compatibleFull=o[18],this.sampleText=o[19]},e}(),B=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="maxp",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.numGlyphs=e.readUInt16(),this.maxPoints=e.readUInt16(),this.maxContours=e.readUInt16(),this.maxCompositePoints=e.readUInt16(),this.maxComponentContours=e.readUInt16(),this.maxZones=e.readUInt16(),this.maxTwilightPoints=e.readUInt16(),this.maxStorage=e.readUInt16(),this.maxFunctionDefs=e.readUInt16(),this.maxInstructionDefs=e.readUInt16(),this.maxStackElements=e.readUInt16(),this.maxSizeOfInstructions=e.readUInt16(),this.maxComponentElements=e.readUInt16(),this.maxComponentDepth=e.readUInt16()},e}(),C=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="hmtx",e.prototype.parse=function(e){var t,i,r,n,s,a,o;for(e.pos=this.offset,this.metrics=[],n=0,a=this.file.hhea.numberOfMetrics;0<=a?n<a:a<n;0<=a?++n:--n)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(i=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var t,r;for(r=[],t=0;0<=i?t<i:i<t;0<=i?++t:--t)r.push(e.readInt16());return r}(),this.widths=function(){var e,t,i,n;for(n=[],e=0,t=(i=this.metrics).length;e<t;e++)r=i[e],n.push(r.advance);return n}.call(this),t=this.widths[this.widths.length-1],o=[],s=0;0<=i?s<i:i<s;0<=i?++s:--s)o.push(this.widths.push(t));return o},e.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},e}(),x=[].slice,F=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="glyf",e.prototype.parse=function(e){return this.cache={}},e.prototype.glyphFor=function(e){var t,i,r,n,s,a,o,l,h,d;return e in this.cache?this.cache[e]:(n=this.file.loca,t=this.file.contents,i=n.indexOf(e),0===(r=n.lengthOf(e))?this.cache[e]=null:(t.pos=this.offset+i,s=(a=new c(t.read(r))).readShort(),l=a.readShort(),d=a.readShort(),o=a.readShort(),h=a.readShort(),this.cache[e]=-1===s?new S(a,l,d,o,h):new N(a,s,l,d,o,h),this.cache[e]))},e.prototype.encode=function(e,t,i){var r,n,s,a,o;for(s=[],n=[],a=0,o=t.length;a<o;a++)r=e[t[a]],n.push(s.length),r&&(s=s.concat(r.encode(i)));return n.push(s.length),{table:s,offsets:n}},e}(),N=function(){function e(e,t,i,r,n,s){this.raw=e,this.numberOfContours=t,this.xMin=i,this.yMin=r,this.xMax=n,this.yMax=s,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),S=function(){function e(e,t,i,r,n){var s,a;for(this.raw=e,this.xMin=t,this.yMin=i,this.xMax=r,this.yMax=n,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],s=this.raw;a=s.readShort(),this.glyphOffsets.push(s.pos),this.glyphIDs.push(s.readShort()),32&a;)s.pos+=1&a?4:2,128&a?s.pos+=8:64&a?s.pos+=4:8&a&&(s.pos+=2)}return e.prototype.encode=function(e){var t,i,r,n,s;for(i=new c(x.call(this.raw.data)),t=r=0,n=(s=this.glyphIDs).length;r<n;t=++r)s[t],i.pos=this.glyphOffsets[t];return i.data},e}(),E=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="loca",e.prototype.parse=function(e){var t;return e.pos=this.offset,t=this.file.head.indexToLocFormat,this.offsets=0===t?function(){var t,i,r;for(r=[],t=0,i=this.length;t<i;t+=2)r.push(2*e.readUInt16());return r}.call(this):function(){var t,i,r;for(r=[],t=0,i=this.length;t<i;t+=4)r.push(e.readUInt32());return r}.call(this)},e.prototype.indexOf=function(e){return this.offsets[e]},e.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},e.prototype.encode=function(e,t){for(var i=new Uint32Array(this.offsets.length),r=0,n=0,s=0;s<i.length;++s)if(i[s]=r,n<t.length&&t[n]==s){++n,i[s]=r;var a=this.offsets[s],o=this.offsets[s+1]-a;0<o&&(r+=o)}for(var l=new Array(4*i.length),h=0;h<i.length;++h)l[4*h+3]=255&i[h],l[4*h+2]=(65280&i[h])>>8,l[4*h+1]=(16711680&i[h])>>16,l[4*h]=(4278190080&i[h])>>24;return l},e}(),T=function(){function e(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var e,t,i,r,n;for(t in r=this.font.cmap.tables[0].codeMap,e={},n=this.subset)i=n[t],e[t]=r[i];return e},e.prototype.glyphsFor=function(e){var t,i,r,n,s,a,o;for(r={},s=0,a=e.length;s<a;s++)r[n=e[s]]=this.font.glyf.glyphFor(n);for(n in t=[],r)(null!=(i=r[n])?i.compound:void 0)&&t.push.apply(t,i.glyphIDs);if(0<t.length)for(n in o=this.glyphsFor(t))i=o[n],r[n]=i;return r},e.prototype.encode=function(e,t){var i,r,n,s,a,o,l,h,c,d,u,A,p,f,m;for(r in i=g.encode(this.generateCmap(),"unicode"),s=this.glyphsFor(e),u={0:0},m=i.charMap)u[(o=m[r]).old]=o.new;for(A in d=i.maxGlyphID,s)A in u||(u[A]=d++);return h=function(e){var t,i;for(t in i={},e)i[e[t]]=t;return i}(u),c=Object.keys(h).sort((function(e,t){return e-t})),p=function(){var e,t,i;for(i=[],e=0,t=c.length;e<t;e++)a=c[e],i.push(h[a]);return i}(),n=this.font.glyf.encode(s,p,u),l=this.font.loca.encode(n.offsets,p),f={cmap:this.font.cmap.raw(),glyf:n.table,loca:l,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(t)},this.font.os2.exists&&(f["OS/2"]=this.font.os2.raw()),this.font.directory.encode(f)},e}();e.API.PDFObject=function(){var e;function t(){}return e=function(e,t){return(Array(t+1).join("0")+e).slice(-t)},t.convert=function(i){var r,n,s,a;if(Array.isArray(i))return"["+function(){var e,n,s;for(s=[],e=0,n=i.length;e<n;e++)r=i[e],s.push(t.convert(r));return s}().join(" ")+"]";if("string"==typeof i)return"/"+i;if(null!=i?i.isString:void 0)return"("+i+")";if(i instanceof Date)return"(D:"+e(i.getUTCFullYear(),4)+e(i.getUTCMonth(),2)+e(i.getUTCDate(),2)+e(i.getUTCHours(),2)+e(i.getUTCMinutes(),2)+e(i.getUTCSeconds(),2)+"Z)";if("[object Object]"!=={}.toString.call(i))return""+i;for(n in s=["<<"],i)a=i[n],s.push("/"+n+" "+t.convert(a));return s.push(">>"),s.join("\n")},t}()}(de),Fe="undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0!==cd&&cd||Function('return typeof this === "object" && this.content')()||Function("return this")(),Ne=function(){var e,t,i;function r(e){var t,i,r,n,s,a,o,l,h,c,d,u,A,p;for(this.data=e,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},a=null;;){switch(t=this.readUInt32(),h=function(){var e,t;for(t=[],e=0;e<4;++e)t.push(String.fromCharCode(this.data[this.pos++]));return t}.call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(t);break;case"fcTL":a&&this.animation.frames.push(a),this.pos+=4,a={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},s=this.readUInt16(),n=this.readUInt16()||100,a.delay=1e3*s/n,a.disposeOp=this.data[this.pos++],a.blendOp=this.data[this.pos++],a.data=[];break;case"IDAT":case"fdAT":for("fdAT"===h&&(this.pos+=4,t-=4),e=(null!=a?a.data:void 0)||this.imgData,u=0;0<=t?u<t:t<u;0<=t?++u:--u)e.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(r=this.palette.length/3,this.transparency.indexed=this.read(t),this.transparency.indexed.length>r)throw new Error("More transparent colors than palette size");if(0<(c=r-this.transparency.indexed.length))for(A=0;0<=c?A<c:c<A;0<=c?++A:--A)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(t)[0];break;case 2:this.transparency.rgb=this.read(t)}break;case"tEXt":o=(d=this.read(t)).indexOf(0),l=String.fromCharCode.apply(String,d.slice(0,o)),this.text[l]=String.fromCharCode.apply(String,d.slice(o+1));break;case"IEND":return a&&this.animation.frames.push(a),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(p=this.colorType)||6===p,i=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*i,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=t}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}r.load=function(e,t,i){var n;return"function"==typeof t&&(i=t),(n=new XMLHttpRequest).open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){var e;return e=new r(new Uint8Array(n.response||n.mozResponseArrayBuffer)),"function"==typeof(null!=t?t.getContext:void 0)&&e.render(t),"function"==typeof i?i(e):void 0},n.send(null)},r.prototype.read=function(e){var t,i;for(i=[],t=0;0<=e?t<e:e<t;0<=e?++t:--t)i.push(this.data[this.pos++]);return i},r.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},r.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},r.prototype.decodePixels=function(e){var t=this.pixelBitlength/8,i=new Uint8Array(this.width*this.height*t),r=0,n=this;if(null==e&&(e=this.imgData),0===e.length)return new Uint8Array(0);function s(s,a,o,l){var h,c,d,u,A,p,f,g,m,w,b,v,y,B,C,x,F,N,S,E,T,L=Math.ceil((n.width-s)/o),k=Math.ceil((n.height-a)/l),D=n.width==L&&n.height==k;for(B=t*L,v=D?i:new Uint8Array(B*k),p=e.length,c=y=0;y<k&&r<p;){switch(e[r++]){case 0:for(u=F=0;F<B;u=F+=1)v[c++]=e[r++];break;case 1:for(u=N=0;N<B;u=N+=1)h=e[r++],A=u<t?0:v[c-t],v[c++]=(h+A)%256;break;case 2:for(u=S=0;S<B;u=S+=1)h=e[r++],d=(u-u%t)/t,C=y&&v[(y-1)*B+d*t+u%t],v[c++]=(C+h)%256;break;case 3:for(u=E=0;E<B;u=E+=1)h=e[r++],d=(u-u%t)/t,A=u<t?0:v[c-t],C=y&&v[(y-1)*B+d*t+u%t],v[c++]=(h+Math.floor((A+C)/2))%256;break;case 4:for(u=T=0;T<B;u=T+=1)h=e[r++],d=(u-u%t)/t,A=u<t?0:v[c-t],0===y?C=x=0:(C=v[(y-1)*B+d*t+u%t],x=d&&v[(y-1)*B+(d-1)*t+u%t]),f=A+C-x,g=Math.abs(f-A),w=Math.abs(f-C),b=Math.abs(f-x),m=g<=w&&g<=b?A:w<=b?C:x,v[c++]=(h+m)%256;break;default:throw new Error("Invalid filter algorithm: "+e[r-1])}if(!D){var I=((a+y*l)*n.width+s)*t,U=y*B;for(u=0;u<L;u+=1){for(var P=0;P<t;P+=1)i[I++]=v[U++];I+=(o-1)*t}}y++}}return e=(e=new Ie(e)).getBytes(),1==n.interlaceMethod?(s(0,0,8,8),s(4,0,8,8),s(0,4,4,8),s(2,0,4,4),s(0,2,2,4),s(1,0,2,2),s(0,1,1,2)):s(0,0,1,1),i},r.prototype.decodePalette=function(){var e,t,i,r,n,s,a,o,l;for(i=this.palette,s=this.transparency.indexed||[],n=new Uint8Array((s.length||0)+i.length),r=0,i.length,t=a=e=0,o=i.length;a<o;t=a+=3)n[r++]=i[t],n[r++]=i[t+1],n[r++]=i[t+2],n[r++]=null!=(l=s[e++])?l:255;return n},r.prototype.copyToImageData=function(e,t){var i,r,n,s,a,o,l,h,c,d,u;if(r=this.colors,c=null,i=this.hasAlphaChannel,this.palette.length&&(c=null!=(u=this._decodedPalette)?u:this._decodedPalette=this.decodePalette(),r=4,i=!0),h=(n=e.data||e).length,a=c||t,s=o=0,1===r)for(;s<h;)l=c?4*t[s/4]:o,d=a[l++],n[s++]=d,n[s++]=d,n[s++]=d,n[s++]=i?a[l++]:255,o=l;else for(;s<h;)l=c?4*t[s/4]:o,n[s++]=a[l++],n[s++]=a[l++],n[s++]=a[l++],n[s++]=i?a[l++]:255,o=l},r.prototype.decode=function(){var e;return e=new Uint8Array(this.width*this.height*4),this.copyToImageData(e,this.decodePixels()),e};try{t=Fe.document.createElement("canvas"),i=t.getContext("2d")}catch(e){return-1}return e=function(e){var r;return i.width=e.width,i.height=e.height,i.clearRect(0,0,e.width,e.height),i.putImageData(e,0,0),(r=new Image).src=t.toDataURL(),r},r.prototype.decodeFrames=function(t){var i,r,n,s,a,o,l,h;if(this.animation){for(h=[],r=a=0,o=(l=this.animation.frames).length;a<o;r=++a)i=l[r],n=t.createImageData(i.width,i.height),s=this.decodePixels(new Uint8Array(i.data)),this.copyToImageData(n,s),i.imageData=n,h.push(i.image=e(n));return h}},r.prototype.renderFrame=function(e,t){var i,r,n;return i=(r=this.animation.frames)[t],n=r[t-1],0===t&&e.clearRect(0,0,this.width,this.height),1===(null!=n?n.disposeOp:void 0)?e.clearRect(n.xOffset,n.yOffset,n.width,n.height):2===(null!=n?n.disposeOp:void 0)&&e.putImageData(n.imageData,n.xOffset,n.yOffset),0===i.blendOp&&e.clearRect(i.xOffset,i.yOffset,i.width,i.height),e.drawImage(i.image,i.xOffset,i.yOffset)},r.prototype.animate=function(e){var t,i,r,n,s,a,o=this;return i=0,a=this.animation,n=a.numFrames,r=a.frames,s=a.numPlays,(t=function(){var a,l;if(a=i++%n,l=r[a],o.renderFrame(e,a),1<n&&i/n<s)return o.animation._timeout=setTimeout(t,l.delay)})()},r.prototype.stopAnimation=function(){var e;return clearTimeout(null!=(e=this.animation)?e._timeout:void 0)},r.prototype.render=function(e){var t,i;return e._png&&e._png.stopAnimation(),e._png=this,e.width=this.width,e.height=this.height,t=e.getContext("2d"),this.animation?(this.decodeFrames(t),this.animate(t)):(i=t.createImageData(this.width,this.height),this.copyToImageData(i,this.decodePixels()),t.putImageData(i,0,0))},r}(),Fe.PNG=Ne;var De=function(){function e(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return e.prototype={ensureBuffer:function(e){var t=this.buffer,i=t?t.byteLength:0;if(e<i)return t;for(var r=512;r<e;)r<<=1;for(var n=new Uint8Array(r),s=0;s<i;++s)n[s]=t[s];return this.buffer=n},getByte:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return this.buffer[this.pos++]},getBytes:function(e){var t=this.pos;if(e){this.ensureBuffer(t+e);for(var i=t+e;!this.eof&&this.bufferLength<i;)this.readBlock();var r=this.bufferLength;r<i&&(i=r)}else{for(;!this.eof;)this.readBlock();i=this.bufferLength}return this.pos=i,this.buffer.subarray(t,i)},lookChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(e,t,i){for(var r=e+t;this.bufferLength<=r&&!this.eof;)this.readBlock();return new Stream(this.buffer,e,t,i)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=0}},e}(),Ie=function(){if("undefined"!=typeof Uint32Array){var e=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),t=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),i=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),r=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],n=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];return(a.prototype=Object.create(De.prototype)).getBits=function(e){for(var t,i=this.codeSize,r=this.codeBuf,n=this.bytes,a=this.bytesPos;i<e;)void 0===(t=n[a++])&&s("Bad encoding in flate stream"),r|=t<<i,i+=8;return t=r&(1<<e)-1,this.codeBuf=r>>e,this.codeSize=i-=e,this.bytesPos=a,t},a.prototype.getCode=function(e){for(var t=e[0],i=e[1],r=this.codeSize,n=this.codeBuf,a=this.bytes,o=this.bytesPos;r<i;){var l;void 0===(l=a[o++])&&s("Bad encoding in flate stream"),n|=l<<r,r+=8}var h=t[n&(1<<i)-1],c=h>>16,d=65535&h;return(0==r||r<c||0==c)&&s("Bad encoding in flate stream"),this.codeBuf=n>>c,this.codeSize=r-c,this.bytesPos=o,d},a.prototype.generateHuffmanTable=function(e){for(var t=e.length,i=0,r=0;r<t;++r)e[r]>i&&(i=e[r]);for(var n=1<<i,s=new Uint32Array(n),a=1,o=0,l=2;a<=i;++a,o<<=1,l<<=1)for(var h=0;h<t;++h)if(e[h]==a){var c=0,d=o;for(r=0;r<a;++r)c=c<<1|1&d,d>>=1;for(r=c;r<n;r+=l)s[r]=a<<16|h;++o}return[s,i]},a.prototype.readBlock=function(){function a(e,t,i,r,n){for(var s=e.getBits(i)+r;0<s--;)t[p++]=n}var o=this.getBits(3);if(1&o&&(this.eof=!0),0!=(o>>=1)){var l,h;if(1==o)l=r,h=n;else if(2==o){for(var c=this.getBits(5)+257,d=this.getBits(5)+1,u=this.getBits(4)+4,A=Array(e.length),p=0;p<u;)A[e[p++]]=this.getBits(3);for(var f=this.generateHuffmanTable(A),g=0,m=(p=0,c+d),w=new Array(m);p<m;){var b=this.getCode(f);16==b?a(this,w,2,3,g):17==b?a(this,w,3,3,g=0):18==b?a(this,w,7,11,g=0):w[p++]=g=b}l=this.generateHuffmanTable(w.slice(0,c)),h=this.generateHuffmanTable(w.slice(c,m))}else s("Unknown block type in flate stream");for(var v=(D=this.buffer)?D.length:0,y=this.bufferLength;;){var B=this.getCode(l);if(B<256)v<=y+1&&(v=(D=this.ensureBuffer(y+1)).length),D[y++]=B;else{if(256==B)return void(this.bufferLength=y);var C=(B=t[B-=257])>>16;0<C&&(C=this.getBits(C)),g=(65535&B)+C,B=this.getCode(h),0<(C=(B=i[B])>>16)&&(C=this.getBits(C));var x=(65535&B)+C;v<=y+g&&(v=(D=this.ensureBuffer(y+g)).length);for(var F=0;F<g;++F,++y)D[y]=D[y-x]}}}else{var N,S=this.bytes,E=this.bytesPos;void 0===(N=S[E++])&&s("Bad block header in flate stream");var T=N;void 0===(N=S[E++])&&s("Bad block header in flate stream"),T|=N<<8,void 0===(N=S[E++])&&s("Bad block header in flate stream");var L=N;void 0===(N=S[E++])&&s("Bad block header in flate stream"),(L|=N<<8)!=(65535&~T)&&s("Bad uncompressed block length in flate stream"),this.codeBuf=0,this.codeSize=0;var k=this.bufferLength,D=this.ensureBuffer(k+T),I=k+T;this.bufferLength=I;for(var U=k;U<I;++U){if(void 0===(N=S[E++])){this.eof=!0;break}D[U]=N}this.bytesPos=E}},a}function s(e){throw new Error(e)}function a(e){var t=0,i=e[t++],r=e[t++];-1!=i&&-1!=r||s("Invalid header in flate stream"),8!=(15&i)&&s("Unknown compression method in flate stream"),((i<<8)+r)%31!=0&&s("Bad FCHECK in flate stream"),32&r&&s("FDICT bit set in flate stream"),this.bytes=e,this.bytesPos=2,this.codeSize=0,this.codeBuf=0,De.call(this)}}();window.tmp=Ie}();try{e.exports=jsPDF}catch(e){}
|
|
131
131
|
/** @license html2canvas 1.0.0-rc.1 | Copyright (c) 2019 Niklas von Hertzen [https://html2canvas.hertzen.com] | MIT License [https://github.com/niklasvh/html2canvas/blob/master/LICENSE] */r=function(){return function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=5)}([function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var r=i(1);Object.defineProperty(t,"toCodePoints",{enumerable:!0,get:function(){return r.toCodePoints}}),Object.defineProperty(t,"fromCodePoint",{enumerable:!0,get:function(){return r.fromCodePoint}});var n=i(2);Object.defineProperty(t,"LineBreaker",{enumerable:!0,get:function(){return n.LineBreaker}})},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.toCodePoints=function(e){for(var t=[],i=0,r=e.length;i<r;){var n=e.charCodeAt(i++);if(n>=55296&&n<=56319&&i<r){var s=e.charCodeAt(i++);56320==(64512&s)?t.push(((1023&n)<<10)+(1023&s)+65536):(t.push(n),i--)}else t.push(n)}return t},t.fromCodePoint=function(){if(String.fromCodePoint)return String.fromCodePoint.apply(String,arguments);var e=arguments.length;if(!e)return"";for(var t=[],i=-1,r="";++i<e;){var n=arguments.length<=i?void 0:arguments[i];n<=65535?t.push(n):(n-=65536,t.push(55296+(n>>10),n%1024+56320)),(i+1===e||t.length>16384)&&(r+=String.fromCharCode.apply(String,t),t.length=0)}return r};for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="undefined"==typeof Uint8Array?[]:new Uint8Array(256),s=0;s<64;s++)n[r.charCodeAt(s)]=s;t.decode=function(e){var t=.75*e.length,i=e.length,r=void 0,s=0,a=void 0,o=void 0,l=void 0,h=void 0;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(t):new Array(t),d=Array.isArray(c)?c:new Uint8Array(c);for(r=0;r<i;r+=4)a=n[e.charCodeAt(r)],o=n[e.charCodeAt(r+1)],l=n[e.charCodeAt(r+2)],h=n[e.charCodeAt(r+3)],d[s++]=a<<2|o>>4,d[s++]=(15&o)<<4|l>>2,d[s++]=(3&l)<<6|63&h;return c},t.polyUint16Array=function(e){for(var t=e.length,i=[],r=0;r<t;r+=2)i.push(e[r+1]<<8|e[r]);return i},t.polyUint32Array=function(e){for(var t=e.length,i=[],r=0;r<t;r+=4)i.push(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]);return i}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.LineBreaker=t.inlineBreakOpportunities=t.lineBreakAtIndex=t.codePointsToCharacterClasses=t.UnicodeTrie=t.BREAK_ALLOWED=t.BREAK_NOT_ALLOWED=t.BREAK_MANDATORY=t.classes=t.LETTER_NUMBER_MODIFIER=void 0;var r=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],r=!0,n=!1,s=void 0;try{for(var a,o=e[Symbol.iterator]();!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){n=!0,s=e}finally{try{!r&&o.return&&o.return()}finally{if(n)throw s}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},s=i(3),a=function(e){return e&&e.__esModule?e:{default:e}}(i(4)),o=i(1),l=t.LETTER_NUMBER_MODIFIER=50,h=10,c=13,d=15,u=17,A=18,p=19,f=20,g=21,m=22,w=24,b=25,v=26,y=27,B=28,C=30,x=32,F=33,N=34,S=35,E=37,T=38,L=39,k=40,D=42,I=(t.classes={BK:1,CR:2,LF:3,CM:4,NL:5,SG:6,WJ:7,ZW:8,GL:9,SP:h,ZWJ:11,B2:12,BA:c,BB:14,HY:d,CB:16,CL:u,CP:A,EX:p,IN:f,NS:g,OP:m,QU:23,IS:w,NU:b,PO:v,PR:y,SY:B,AI:29,AL:C,CJ:31,EB:x,EM:F,H2:N,H3:S,HL:36,ID:E,JL:T,JV:L,JT:k,RI:41,SA:D,XX:43},t.BREAK_MANDATORY="!"),U=t.BREAK_NOT_ALLOWED="×",P=t.BREAK_ALLOWED="÷",O=t.UnicodeTrie=(0,s.createTrieFromBase64)(a.default),R=[C,36],Q=[1,2,3,5],H=[h,8],M=[y,v],_=Q.concat(H),j=[T,L,k,N,S],z=[d,c],V=t.codePointsToCharacterClasses=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"strict",i=[],r=[],n=[];return e.forEach((function(e,s){var a=O.get(e);if(a>l?(n.push(!0),a-=l):n.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(e))return r.push(s),i.push(16);if(4===a||11===a){if(0===s)return r.push(s),i.push(C);var o=i[s-1];return-1===_.indexOf(o)?(r.push(r[s-1]),i.push(o)):(r.push(s),i.push(C))}return r.push(s),31===a?i.push("strict"===t?g:E):a===D||29===a?i.push(C):43===a?e>=131072&&e<=196605||e>=196608&&e<=262141?i.push(E):i.push(C):void i.push(a)})),[r,i,n]},K=function(e,t,i,r){var n=r[i];if(Array.isArray(e)?-1!==e.indexOf(n):e===n)for(var s=i;s<=r.length;){var a=r[++s];if(a===t)return!0;if(a!==h)break}if(n===h)for(var o=i;o>0;){var l=r[--o];if(Array.isArray(e)?-1!==e.indexOf(l):e===l)for(var c=i;c<=r.length;){var d=r[++c];if(d===t)return!0;if(d!==h)break}if(l!==h)break}return!1},q=function(e,t){for(var i=e;i>=0;){var r=t[i];if(r!==h)return r;i--}return 0},G=function(e,t,i,r,n){if(0===i[r])return U;var s=r-1;if(Array.isArray(n)&&!0===n[s])return U;var a=s-1,o=s+1,l=t[s],C=a>=0?t[a]:0,D=t[o];if(2===l&&3===D)return U;if(-1!==Q.indexOf(l))return I;if(-1!==Q.indexOf(D))return U;if(-1!==H.indexOf(D))return U;if(8===q(s,t))return P;if(11===O.get(e[s])&&(D===E||D===x||D===F))return U;if(7===l||7===D)return U;if(9===l)return U;if(-1===[h,c,d].indexOf(l)&&9===D)return U;if(-1!==[u,A,p,w,B].indexOf(D))return U;if(q(s,t)===m)return U;if(K(23,m,s,t))return U;if(K([u,A],g,s,t))return U;if(K(12,12,s,t))return U;if(l===h)return P;if(23===l||23===D)return U;if(16===D||16===l)return P;if(-1!==[c,d,g].indexOf(D)||14===l)return U;if(36===C&&-1!==z.indexOf(l))return U;if(l===B&&36===D)return U;if(D===f&&-1!==R.concat(f,p,b,E,x,F).indexOf(l))return U;if(-1!==R.indexOf(D)&&l===b||-1!==R.indexOf(l)&&D===b)return U;if(l===y&&-1!==[E,x,F].indexOf(D)||-1!==[E,x,F].indexOf(l)&&D===v)return U;if(-1!==R.indexOf(l)&&-1!==M.indexOf(D)||-1!==M.indexOf(l)&&-1!==R.indexOf(D))return U;if(-1!==[y,v].indexOf(l)&&(D===b||-1!==[m,d].indexOf(D)&&t[o+1]===b)||-1!==[m,d].indexOf(l)&&D===b||l===b&&-1!==[b,B,w].indexOf(D))return U;if(-1!==[b,B,w,u,A].indexOf(D))for(var _=s;_>=0;){var V=t[_];if(V===b)return U;if(-1===[B,w].indexOf(V))break;_--}if(-1!==[y,v].indexOf(D))for(var G=-1!==[u,A].indexOf(l)?a:s;G>=0;){var W=t[G];if(W===b)return U;if(-1===[B,w].indexOf(W))break;G--}if(T===l&&-1!==[T,L,N,S].indexOf(D)||-1!==[L,N].indexOf(l)&&-1!==[L,k].indexOf(D)||-1!==[k,S].indexOf(l)&&D===k)return U;if(-1!==j.indexOf(l)&&-1!==[f,v].indexOf(D)||-1!==j.indexOf(D)&&l===y)return U;if(-1!==R.indexOf(l)&&-1!==R.indexOf(D))return U;if(l===w&&-1!==R.indexOf(D))return U;if(-1!==R.concat(b).indexOf(l)&&D===m||-1!==R.concat(b).indexOf(D)&&l===A)return U;if(41===l&&41===D){for(var J=i[s],X=1;J>0&&41===t[--J];)X++;if(X%2!=0)return U}return l===x&&D===F?U:P},W=(t.lineBreakAtIndex=function(e,t){if(0===t)return U;if(t>=e.length)return I;var i=V(e),r=n(i,2),s=r[0],a=r[1];return G(e,a,s,t)},function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var i=V(e,t.lineBreak),r=n(i,3),s=r[0],a=r[1],o=r[2];return"break-all"!==t.wordBreak&&"break-word"!==t.wordBreak||(a=a.map((function(e){return-1!==[b,C,D].indexOf(e)?E:e}))),[s,a,"keep-all"===t.wordBreak?o.map((function(t,i){return t&&e[i]>=19968&&e[i]<=40959})):null]}),J=(t.inlineBreakOpportunities=function(e,t){var i=(0,o.toCodePoints)(e),r=U,s=W(i,t),a=n(s,3),l=a[0],h=a[1],c=a[2];return i.forEach((function(e,t){r+=(0,o.fromCodePoint)(e)+(t>=i.length-1?I:G(i,h,l,t+1,c))})),r},function(){function e(t,i,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._codePoints=t,this.required=i===I,this.start=r,this.end=n}return r(e,[{key:"slice",value:function(){return o.fromCodePoint.apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}(this._codePoints.slice(this.start,this.end)))}}]),e}());t.LineBreaker=function(e,t){var i=(0,o.toCodePoints)(e),r=W(i,t),s=n(r,3),a=s[0],l=s[1],h=s[2],c=i.length,d=0,u=0;return{next:function(){if(u>=c)return{done:!0};for(var e=U;u<c&&(e=G(i,l,a,++u,h))===U;);if(e!==U||u===c){var t=new J(i,e,d,u);return d=u,{value:t,done:!1}}return{done:!0}}}}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.Trie=t.createTrieFromBase64=t.UTRIE2_INDEX_2_MASK=t.UTRIE2_INDEX_2_BLOCK_LENGTH=t.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH=t.UTRIE2_INDEX_1_OFFSET=t.UTRIE2_UTF8_2B_INDEX_2_LENGTH=t.UTRIE2_UTF8_2B_INDEX_2_OFFSET=t.UTRIE2_INDEX_2_BMP_LENGTH=t.UTRIE2_LSCP_INDEX_2_LENGTH=t.UTRIE2_DATA_MASK=t.UTRIE2_DATA_BLOCK_LENGTH=t.UTRIE2_LSCP_INDEX_2_OFFSET=t.UTRIE2_SHIFT_1_2=t.UTRIE2_INDEX_SHIFT=t.UTRIE2_SHIFT_1=t.UTRIE2_SHIFT_2=void 0;var r=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),n=i(1),s=t.UTRIE2_SHIFT_2=5,a=t.UTRIE2_SHIFT_1=11,o=t.UTRIE2_INDEX_SHIFT=2,l=t.UTRIE2_SHIFT_1_2=a-s,h=t.UTRIE2_LSCP_INDEX_2_OFFSET=65536>>s,c=t.UTRIE2_DATA_BLOCK_LENGTH=1<<s,d=t.UTRIE2_DATA_MASK=c-1,u=t.UTRIE2_LSCP_INDEX_2_LENGTH=1024>>s,A=t.UTRIE2_INDEX_2_BMP_LENGTH=h+u,p=t.UTRIE2_UTF8_2B_INDEX_2_OFFSET=A,f=t.UTRIE2_UTF8_2B_INDEX_2_LENGTH=32,g=t.UTRIE2_INDEX_1_OFFSET=p+f,m=t.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH=65536>>a,w=t.UTRIE2_INDEX_2_BLOCK_LENGTH=1<<l,b=t.UTRIE2_INDEX_2_MASK=w-1,v=(t.createTrieFromBase64=function(e){var t=(0,n.decode)(e),i=Array.isArray(t)?(0,n.polyUint32Array)(t):new Uint32Array(t),r=Array.isArray(t)?(0,n.polyUint16Array)(t):new Uint16Array(t),s=r.slice(12,i[4]/2),a=2===i[5]?r.slice((24+i[4])/2):i.slice(Math.ceil((24+i[4])/4));return new v(i[0],i[1],i[2],i[3],s,a)},t.Trie=function(){function e(t,i,r,n,s,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initialValue=t,this.errorValue=i,this.highStart=r,this.highValueIndex=n,this.index=s,this.data=a}return r(e,[{key:"get",value:function(e){var t=void 0;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>s])<<o)+(e&d),this.data[t];if(e<=65535)return t=((t=this.index[h+(e-55296>>s)])<<o)+(e&d),this.data[t];if(e<this.highStart)return t=g-m+(e>>a),t=this.index[t],t+=e>>s&b,t=((t=this.index[t])<<o)+(e&d),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue}}]),e}())},function(e,t,i){e.exports="KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAEUARoBIgGAAIgAJwEvATcBPwFFAU0BTAFUAVwBZAFsAXMBewGDATAAiwGTAZsBogGkAawBtAG8AcIBygHSAdoB4AHoAfAB+AH+AQYCDgIWAv4BHgImAi4CNgI+AkUCTQJTAlsCYwJrAnECeQKBAk0CiQKRApkCoQKoArACuALAAsQCzAIwANQC3ALkAjAA7AL0AvwCAQMJAxADGAMwACADJgMuAzYDPgOAAEYDSgNSA1IDUgNaA1oDYANiA2IDgACAAGoDgAByA3YDfgOAAIQDgACKA5IDmgOAAIAAogOqA4AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAK8DtwOAAIAAvwPHA88D1wPfAyAD5wPsA/QD/AOAAIAABAQMBBIEgAAWBB4EJgQuBDMEIAM7BEEEXgBJBCADUQRZBGEEaQQwADAAcQQ+AXkEgQSJBJEEgACYBIAAoASoBK8EtwQwAL8ExQSAAIAAgACAAIAAgACgAM0EXgBeAF4AXgBeAF4AXgBeANUEXgDZBOEEXgDpBPEE+QQBBQkFEQUZBSEFKQUxBTUFPQVFBUwFVAVcBV4AYwVeAGsFcwV7BYMFiwWSBV4AmgWgBacFXgBeAF4AXgBeAKsFXgCyBbEFugW7BcIFwgXIBcIFwgXQBdQF3AXkBesF8wX7BQMGCwYTBhsGIwYrBjMGOwZeAD8GRwZNBl4AVAZbBl4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAGMGXgBqBnEGXgBeAF4AXgBeAF4AXgBeAF4AXgB5BoAG4wSGBo4GkwaAAIADHgR5AF4AXgBeAJsGgABGA4AAowarBrMGswagALsGwwbLBjAA0wbaBtoG3QbaBtoG2gbaBtoG2gblBusG8wb7BgMHCwcTBxsHCwcjBysHMAc1BzUHOgdCB9oGSgdSB1oHYAfaBloHaAfaBlIH2gbaBtoG2gbaBtoG2gbaBjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHbQdeAF4ANQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQd1B30HNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B4MH2gaKB68EgACAAIAAgACAAIAAgACAAI8HlwdeAJ8HpweAAIAArwe3B14AXgC/B8UHygcwANAH2AfgB4AA6AfwBz4B+AcACFwBCAgPCBcIogEYAR8IJwiAAC8INwg/CCADRwhPCFcIXwhnCEoDGgSAAIAAgABvCHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIhAiLCI4IMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAANQc1BzUHNQc1BzUHNQc1BzUHNQc1B54INQc1B6II2gaqCLIIugiAAIAAvgjGCIAAgACAAIAAgACAAIAAgACAAIAAywiHAYAA0wiAANkI3QjlCO0I9Aj8CIAAgACAAAIJCgkSCRoJIgknCTYHLwk3CZYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiAAIAAAAFAAXgBeAGAAcABeAHwAQACQAKAArQC9AJ4AXgBeAE0A3gBRAN4A7AD8AMwBGgEAAKcBNwEFAUwBXAF4QkhCmEKnArcCgAHHAsABz4LAAcABwAHAAd+C6ABoAG+C/4LAAcABwAHAAc+DF4MAAcAB54M3gweDV4Nng3eDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEeDqABVg6WDqABoQ6gAaABoAHXDvcONw/3DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DncPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB7cPPwlGCU4JMACAAIAAgABWCV4JYQmAAGkJcAl4CXwJgAkwADAAMAAwAIgJgACLCZMJgACZCZ8JowmrCYAAswkwAF4AXgB8AIAAuwkABMMJyQmAAM4JgADVCTAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAqwYWBNkIMAAwADAAMADdCeAJ6AnuCR4E9gkwAP4JBQoNCjAAMACAABUK0wiAAB0KJAosCjQKgAAwADwKQwqAAEsKvQmdCVMKWwowADAAgACAALcEMACAAGMKgABrCjAAMAAwADAAMAAwADAAMAAwADAAMAAeBDAAMAAwADAAMAAwADAAMAAwADAAMAAwAIkEPQFzCnoKiQSCCooKkAqJBJgKoAqkCokEGAGsCrQKvArBCjAAMADJCtEKFQHZCuEK/gHpCvEKMAAwADAAMACAAIwE+QowAIAAPwEBCzAAMAAwADAAMACAAAkLEQswAIAAPwEZCyELgAAOCCkLMAAxCzkLMAAwADAAMAAwADAAXgBeAEELMAAwADAAMAAwADAAMAAwAEkLTQtVC4AAXAtkC4AAiQkwADAAMAAwADAAMAAwADAAbAtxC3kLgAuFC4sLMAAwAJMLlwufCzAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAApwswADAAMACAAIAAgACvC4AAgACAAIAAgACAALcLMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAvwuAAMcLgACAAIAAgACAAIAAyguAAIAAgACAAIAA0QswADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAANkLgACAAIAA4AswADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACJCR4E6AswADAAhwHwC4AA+AsADAgMEAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMACAAIAAGAwdDCUMMAAwAC0MNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQw1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHPQwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADUHNQc1BzUHNQc1BzUHNQc2BzAAMAA5DDUHNQc1BzUHNQc1BzUHNQc1BzUHNQdFDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAATQxSDFoMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAF4AXgBeAF4AXgBeAF4AYgxeAGoMXgBxDHkMfwxeAIUMXgBeAI0MMAAwADAAMAAwAF4AXgCVDJ0MMAAwADAAMABeAF4ApQxeAKsMswy7DF4Awgy9DMoMXgBeAF4AXgBeAF4AXgBeAF4AXgDRDNkMeQBqCeAM3Ax8AOYM7Az0DPgMXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgCgAAANoAAHDQ4NFg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAeDSYNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAC4NMABeAF4ANg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAD4NRg1ODVYNXg1mDTAAbQ0wADAAMAAwADAAMAAwADAA2gbaBtoG2gbaBtoG2gbaBnUNeg3CBYANwgWFDdoGjA3aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gaUDZwNpA2oDdoG2gawDbcNvw3HDdoG2gbPDdYN3A3fDeYN2gbsDfMN2gbaBvoN/g3aBgYODg7aBl4AXgBeABYOXgBeACUG2gYeDl4AJA5eACwO2w3aBtoGMQ45DtoG2gbaBtoGQQ7aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B1EO2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQdZDjUHNQc1BzUHNQc1B2EONQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHaA41BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B3AO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B2EO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBkkOeA6gAKAAoAAwADAAMAAwAKAAoACgAKAAoACgAKAAgA4wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAD//wQABAAEAAQABAAEAAQABAAEAA0AAwABAAEAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAKABMAFwAeABsAGgAeABcAFgASAB4AGwAYAA8AGAAcAEsASwBLAEsASwBLAEsASwBLAEsAGAAYAB4AHgAeABMAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAFgAbABIAHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYADQARAB4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkAFgAaABsAGwAbAB4AHQAdAB4ATwAXAB4ADQAeAB4AGgAbAE8ATwAOAFAAHQAdAB0ATwBPABcATwBPAE8AFgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwArAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAAQABAANAA0ASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAUAArACsAKwArACsAKwArACsABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAGgAaAFAAUABQAFAAUABMAB4AGwBQAB4AKwArACsABAAEAAQAKwBQAFAAUABQAFAAUAArACsAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUAArAFAAUAArACsABAArAAQABAAEAAQABAArACsAKwArAAQABAArACsABAAEAAQAKwArACsABAArACsAKwArACsAKwArAFAAUABQAFAAKwBQACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwAEAAQAUABQAFAABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQAKwArAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeABsAKwArACsAKwArACsAKwBQAAQABAAEAAQABAAEACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAKwArACsAKwArACsAKwArAAQABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAEAFAAKwBQAFAAUABQAFAAUAArACsAKwBQAFAAUAArAFAAUABQAFAAKwArACsAUABQACsAUAArAFAAUAArACsAKwBQAFAAKwArACsAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQAKwArACsABAAEAAQAKwAEAAQABAAEACsAKwBQACsAKwArACsAKwArAAQAKwArACsAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAB4AHgAeAB4AHgAeABsAHgArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArAFAAUABQACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAB4AUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArACsAKwArACsAKwArAFAAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwArAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAKwBcAFwAKwBcACsAKwBcACsAKwArACsAKwArAFwAXABcAFwAKwBcAFwAXABcAFwAXABcACsAXABcAFwAKwBcACsAXAArACsAXABcACsAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgArACoAKgBcACsAKwBcAFwAXABcAFwAKwBcACsAKgAqACoAKgAqACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAFwAXABcAFwAUAAOAA4ADgAOAB4ADgAOAAkADgAOAA0ACQATABMAEwATABMACQAeABMAHgAeAB4ABAAEAB4AHgAeAB4AHgAeAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUAANAAQAHgAEAB4ABAAWABEAFgARAAQABABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAAQABAAEAAQABAANAAQABABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsADQANAB4AHgAeAB4AHgAeAAQAHgAeAB4AHgAeAB4AKwAeAB4ADgAOAA0ADgAeAB4AHgAeAB4ACQAJACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgAeAB4AHgBcAFwAXABcAFwAXAAqACoAKgAqAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAKgAqACoAKgAqACoAKgBcAFwAXAAqACoAKgAqAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAXAAqAEsASwBLAEsASwBLAEsASwBLAEsAKgAqACoAKgAqACoAUABQAFAAUABQAFAAKwBQACsAKwArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQACsAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwAEAAQABAAeAA0AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAEQArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAADQANAA0AUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAA0ADQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoADQANABUAXAANAB4ADQAbAFwAKgArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAB4AHgATABMADQANAA4AHgATABMAHgAEAAQABAAJACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAUABQAFAAUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwAeACsAKwArABMAEwBLAEsASwBLAEsASwBLAEsASwBLAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwBcAFwAXABcAFwAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcACsAKwArACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwAeAB4AXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsABABLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgBcACoAKgAqACoAKgAqACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAUABQAFAAUABQAFAAUAArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4ADQANAA0ADQAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAHgAeAB4AHgBQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwANAA0ADQANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwBQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsABAAEAAQAHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAABABQAFAAUABQAAQABAAEAFAAUAAEAAQABAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAKwBQACsAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAKwArAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAKwAeAB4AHgAeAB4AHgAeAA4AHgArAA0ADQANAA0ADQANAA0ACQANAA0ADQAIAAQACwAEAAQADQAJAA0ADQAMAB0AHQAeABcAFwAWABcAFwAXABYAFwAdAB0AHgAeABQAFAAUAA0AAQABAAQABAAEAAQABAAJABoAGgAaABoAGgAaABoAGgAeABcAFwAdABUAFQAeAB4AHgAeAB4AHgAYABYAEQAVABUAFQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgANAB4ADQANAA0ADQAeAA0ADQANAAcAHgAeAB4AHgArAAQABAAEAAQABAAEAAQABAAEAAQAUABQACsAKwBPAFAAUABQAFAAUAAeAB4AHgAWABEATwBQAE8ATwBPAE8AUABQAFAAUABQAB4AHgAeABYAEQArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGgAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgBQABoAHgAdAB4AUAAeABoAHgAeAB4AHgAeAB4AHgAeAB4ATwAeAFAAGwAeAB4AUABQAFAAUABQAB4AHgAeAB0AHQAeAFAAHgBQAB4AUAAeAFAATwBQAFAAHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AUABQAFAAUABPAE8AUABQAFAAUABQAE8AUABQAE8AUABPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAE8ATwBPAE8ATwBPAE8ATwBPAE8AUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAATwAeAB4AKwArACsAKwAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB0AHQAeAB4AHgAdAB0AHgAeAB0AHgAeAB4AHQAeAB0AGwAbAB4AHQAeAB4AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB0AHgAdAB4AHQAdAB0AHQAdAB0AHgAdAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAdAB0AHQAdAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAlACUAHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB0AHQAeAB4AHgAeAB0AHQAdAB4AHgAdAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB0AHQAeAB4AHQAeAB4AHgAeAB0AHQAeAB4AHgAeACUAJQAdAB0AJQAeACUAJQAlACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHQAdAB0AHgAdACUAHQAdAB4AHQAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHQAdAB0AHQAlAB4AJQAlACUAHQAlACUAHQAdAB0AJQAlAB0AHQAlAB0AHQAlACUAJQAeAB0AHgAeAB4AHgAdAB0AJQAdAB0AHQAdAB0AHQAlACUAJQAlACUAHQAlACUAIAAlAB0AHQAlACUAJQAlACUAJQAlACUAHgAeAB4AJQAlACAAIAAgACAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeABcAFwAXABcAFwAXAB4AEwATACUAHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACUAJQBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwArACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAE8ATwBPAE8ATwBPAE8ATwAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeACsAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUAArACsAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQBQAFAAUABQACsAKwArACsAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAABAAEAAQAKwAEAAQAKwArACsAKwArAAQABAAEAAQAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsABAAEAAQAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsADQANAA0ADQANAA0ADQANAB4AKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAUABQAFAAUABQAA0ADQANAA0ADQANABQAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwANAA0ADQANAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAeAAQABAAEAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLACsADQArAB4AKwArAAQABAAEAAQAUABQAB4AUAArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwAEAAQABAAEAAQABAAEAAQABAAOAA0ADQATABMAHgAeAB4ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0AUABQAFAAUAAEAAQAKwArAAQADQANAB4AUAArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXABcAA0ADQANACoASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUAArACsAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANACsADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEcARwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwAeAAQABAANAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAEAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUAArACsAUAArACsAUABQACsAKwBQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAeAB4ADQANAA0ADQAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAArAAQABAArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAEAAQABAAEAAQABAAEACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAFgAWAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAKwBQACsAKwArACsAKwArAFAAKwArACsAKwBQACsAUAArAFAAKwBQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQACsAUAArAFAAKwBQACsAUABQACsAUAArACsAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAUABQAFAAUAArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUAArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAlACUAJQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeACUAJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeACUAJQAlACUAJQAeACUAJQAlACUAJQAgACAAIAAlACUAIAAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIQAhACEAIQAhACUAJQAgACAAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAIAAlACUAJQAlACAAJQAgACAAIAAgACAAIAAgACAAIAAlACUAJQAgACUAJQAlACUAIAAgACAAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeACUAHgAlAB4AJQAlACUAJQAlACAAJQAlACUAJQAeACUAHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAIAAgACAAIAAgAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFwAXABcAFQAVABUAHgAeAB4AHgAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAlACAAIAAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsA"},function(e,t,i){i.r(t);var r=0,n=1,s=2,a=/^#([a-f0-9]{3})$/i,o=function(e){var t=e.match(a);return!!t&&[parseInt(t[1][0]+t[1][0],16),parseInt(t[1][1]+t[1][1],16),parseInt(t[1][2]+t[1][2],16),null]},l=/^#([a-f0-9]{6})$/i,h=function(e){var t=e.match(l);return!!t&&[parseInt(t[1].substring(0,2),16),parseInt(t[1].substring(2,4),16),parseInt(t[1].substring(4,6),16),null]},c=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/,d=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/,u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t=[],i=!0,r=!1,n=void 0;try{for(var s,a=e[Symbol.iterator]();!(i=(s=a.next()).done)&&(t.push(s.value),4!==t.length);i=!0);}catch(e){r=!0,n=e}finally{try{i||null==a.return||a.return()}finally{if(r)throw n}}return t}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(Array.isArray(t)?function(e){return[Math.min(e[0],255),Math.min(e[1],255),Math.min(e[2],255),e.length>3?e[3]:null]}(t):o(t)||function(e){var t=e.match(c);return!!t&&[Number(t[1]),Number(t[2]),Number(t[3]),null]}(t)||function(e){var t=e.match(d);return!!(t&&t.length>4)&&[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4])]}(t)||function(e){return A[e.toLowerCase()]||!1}(t)||h(t)||[0,0,0,null]),r=i[0],n=i[1],s=i[2],a=i[3];this.r=r,this.g=n,this.b=s,this.a=a}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"isTransparent",value:function(){return 0===this.a}},{key:"toString",value:function(){return null!==this.a&&1!==this.a?"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")"):"rgb(".concat(this.r,",").concat(this.g,",").concat(this.b,")")}}]),e}(),A={transparent:[0,0,0,0],aliceblue:[240,248,255,null],antiquewhite:[250,235,215,null],aqua:[0,255,255,null],aquamarine:[127,255,212,null],azure:[240,255,255,null],beige:[245,245,220,null],bisque:[255,228,196,null],black:[0,0,0,null],blanchedalmond:[255,235,205,null],blue:[0,0,255,null],blueviolet:[138,43,226,null],brown:[165,42,42,null],burlywood:[222,184,135,null],cadetblue:[95,158,160,null],chartreuse:[127,255,0,null],chocolate:[210,105,30,null],coral:[255,127,80,null],cornflowerblue:[100,149,237,null],cornsilk:[255,248,220,null],crimson:[220,20,60,null],cyan:[0,255,255,null],darkblue:[0,0,139,null],darkcyan:[0,139,139,null],darkgoldenrod:[184,134,11,null],darkgray:[169,169,169,null],darkgreen:[0,100,0,null],darkgrey:[169,169,169,null],darkkhaki:[189,183,107,null],darkmagenta:[139,0,139,null],darkolivegreen:[85,107,47,null],darkorange:[255,140,0,null],darkorchid:[153,50,204,null],darkred:[139,0,0,null],darksalmon:[233,150,122,null],darkseagreen:[143,188,143,null],darkslateblue:[72,61,139,null],darkslategray:[47,79,79,null],darkslategrey:[47,79,79,null],darkturquoise:[0,206,209,null],darkviolet:[148,0,211,null],deeppink:[255,20,147,null],deepskyblue:[0,191,255,null],dimgray:[105,105,105,null],dimgrey:[105,105,105,null],dodgerblue:[30,144,255,null],firebrick:[178,34,34,null],floralwhite:[255,250,240,null],forestgreen:[34,139,34,null],fuchsia:[255,0,255,null],gainsboro:[220,220,220,null],ghostwhite:[248,248,255,null],gold:[255,215,0,null],goldenrod:[218,165,32,null],gray:[128,128,128,null],green:[0,128,0,null],greenyellow:[173,255,47,null],grey:[128,128,128,null],honeydew:[240,255,240,null],hotpink:[255,105,180,null],indianred:[205,92,92,null],indigo:[75,0,130,null],ivory:[255,255,240,null],khaki:[240,230,140,null],lavender:[230,230,250,null],lavenderblush:[255,240,245,null],lawngreen:[124,252,0,null],lemonchiffon:[255,250,205,null],lightblue:[173,216,230,null],lightcoral:[240,128,128,null],lightcyan:[224,255,255,null],lightgoldenrodyellow:[250,250,210,null],lightgray:[211,211,211,null],lightgreen:[144,238,144,null],lightgrey:[211,211,211,null],lightpink:[255,182,193,null],lightsalmon:[255,160,122,null],lightseagreen:[32,178,170,null],lightskyblue:[135,206,250,null],lightslategray:[119,136,153,null],lightslategrey:[119,136,153,null],lightsteelblue:[176,196,222,null],lightyellow:[255,255,224,null],lime:[0,255,0,null],limegreen:[50,205,50,null],linen:[250,240,230,null],magenta:[255,0,255,null],maroon:[128,0,0,null],mediumaquamarine:[102,205,170,null],mediumblue:[0,0,205,null],mediumorchid:[186,85,211,null],mediumpurple:[147,112,219,null],mediumseagreen:[60,179,113,null],mediumslateblue:[123,104,238,null],mediumspringgreen:[0,250,154,null],mediumturquoise:[72,209,204,null],mediumvioletred:[199,21,133,null],midnightblue:[25,25,112,null],mintcream:[245,255,250,null],mistyrose:[255,228,225,null],moccasin:[255,228,181,null],navajowhite:[255,222,173,null],navy:[0,0,128,null],oldlace:[253,245,230,null],olive:[128,128,0,null],olivedrab:[107,142,35,null],orange:[255,165,0,null],orangered:[255,69,0,null],orchid:[218,112,214,null],palegoldenrod:[238,232,170,null],palegreen:[152,251,152,null],paleturquoise:[175,238,238,null],palevioletred:[219,112,147,null],papayawhip:[255,239,213,null],peachpuff:[255,218,185,null],peru:[205,133,63,null],pink:[255,192,203,null],plum:[221,160,221,null],powderblue:[176,224,230,null],purple:[128,0,128,null],rebeccapurple:[102,51,153,null],red:[255,0,0,null],rosybrown:[188,143,143,null],royalblue:[65,105,225,null],saddlebrown:[139,69,19,null],salmon:[250,128,114,null],sandybrown:[244,164,96,null],seagreen:[46,139,87,null],seashell:[255,245,238,null],sienna:[160,82,45,null],silver:[192,192,192,null],skyblue:[135,206,235,null],slateblue:[106,90,205,null],slategray:[112,128,144,null],slategrey:[112,128,144,null],snow:[255,250,250,null],springgreen:[0,255,127,null],steelblue:[70,130,180,null],tan:[210,180,140,null],teal:[0,128,128,null],thistle:[216,191,216,null],tomato:[255,99,71,null],turquoise:[64,224,208,null],violet:[238,130,238,null],wheat:[245,222,179,null],white:[255,255,255,null],whitesmoke:[245,245,245,null],yellow:[255,255,0,null],yellowgreen:[154,205,50,null]},p=new u([0,0,0,0]),f=function(e){switch(e){case"underline":return 1;case"overline":return 2;case"line-through":return 3}return 4},g=function(e){var t=function(e){return"none"===e?null:e.split(" ").map(f)}(e.textDecorationLine?e.textDecorationLine:e.textDecoration);return null===t?null:{textDecorationLine:t,textDecorationColor:e.textDecorationColor?new u(e.textDecorationColor):null,textDecorationStyle:function(e){switch(e){case"double":return 1;case"dotted":return 2;case"dashed":return 3;case"wavy":return 4}return 0}(e.textDecorationStyle)}},m=function(e,t){var i=Math.max.apply(null,e.colorStops.map((function(e){return e.stop}))),r=1/Math.max(1,i);e.colorStops.forEach((function(e){t.addColorStop(Math.floor(Math.max(0,r*e.stop)),e.color.toString())}))},w=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.canvas=t||document.createElement("canvas")}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"render",value:function(e){this.ctx=this.canvas.getContext("2d"),this.options=e,this.canvas.width=Math.floor(e.width*e.scale),this.canvas.height=Math.floor(e.height*e.scale),this.canvas.style.width="".concat(e.width,"px"),this.canvas.style.height="".concat(e.height,"px"),this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-e.x,-e.y),this.ctx.textBaseline="bottom",e.logger.log("Canvas renderer initialized (".concat(e.width,"x").concat(e.height," at ").concat(e.x,",").concat(e.y,") with scale ").concat(this.options.scale))}},{key:"clip",value:function(e,t){var i=this;e.length&&(this.ctx.save(),e.forEach((function(e){i.path(e),i.ctx.clip()}))),t(),e.length&&this.ctx.restore()}},{key:"drawImage",value:function(e,t,i){this.ctx.drawImage(e,t.left,t.top,t.width,t.height,i.left,i.top,i.width,i.height)}},{key:"drawShape",value:function(e,t){this.path(e),this.ctx.fillStyle=t.toString(),this.ctx.fill()}},{key:"fill",value:function(e){this.ctx.fillStyle=e.toString(),this.ctx.fill()}},{key:"getTarget",value:function(){return this.canvas.getContext("2d").setTransform(1,0,0,1,0,0),Promise.resolve(this.canvas)}},{key:"path",value:function(e){var t=this;this.ctx.beginPath(),Array.isArray(e)?e.forEach((function(e,i){var s=e.type===r?e:e.start;0===i?t.ctx.moveTo(s.x,s.y):t.ctx.lineTo(s.x,s.y),e.type===n&&t.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)})):this.ctx.arc(e.x+e.radius,e.y+e.radius,e.radius,0,2*Math.PI,!0),this.ctx.closePath()}},{key:"rectangle",value:function(e,t,i,r,n){this.ctx.fillStyle=n.toString(),this.ctx.fillRect(e,t,i,r)}},{key:"renderLinearGradient",value:function(e,t){var i=this.ctx.createLinearGradient(e.left+t.direction.x1,e.top+t.direction.y1,e.left+t.direction.x0,e.top+t.direction.y0);m(t,i),this.ctx.fillStyle=i,this.ctx.fillRect(e.left,e.top,e.width,e.height)}},{key:"renderRadialGradient",value:function(e,t){var i=this,r=e.left+t.center.x,n=e.top+t.center.y,s=this.ctx.createRadialGradient(r,n,0,r,n,t.radius.x);if(s)if(m(t,s),this.ctx.fillStyle=s,t.radius.x!==t.radius.y){var a=e.left+.5*e.width,o=e.top+.5*e.height,l=t.radius.y/t.radius.x,h=1/l;this.transform(a,o,[1,0,0,l,0,0],(function(){return i.ctx.fillRect(e.left,h*(e.top-o)+o,e.width,e.height*h)}))}else this.ctx.fillRect(e.left,e.top,e.width,e.height)}},{key:"renderRepeat",value:function(e,t,i,r,n){this.path(e),this.ctx.fillStyle=this.ctx.createPattern(this.resizeImage(t,i),"repeat"),this.ctx.translate(r,n),this.ctx.fill(),this.ctx.translate(-r,-n)}},{key:"renderTextNode",value:function(e,t,i,r,n){var s=this;this.ctx.font=[i.fontStyle,i.fontVariant,i.fontWeight,i.fontSize,i.fontFamily].join(" "),e.forEach((function(e){if(s.ctx.fillStyle=t.toString(),n&&e.text.trim().length?(n.slice(0).reverse().forEach((function(t){s.ctx.shadowColor=t.color.toString(),s.ctx.shadowOffsetX=t.offsetX*s.options.scale,s.ctx.shadowOffsetY=t.offsetY*s.options.scale,s.ctx.shadowBlur=t.blur,s.ctx.fillText(e.text,e.bounds.left,e.bounds.top+e.bounds.height)})),s.ctx.shadowColor="",s.ctx.shadowOffsetX=0,s.ctx.shadowOffsetY=0,s.ctx.shadowBlur=0):s.ctx.fillText(e.text,e.bounds.left,e.bounds.top+e.bounds.height),null!==r){var a=r.textDecorationColor||t;r.textDecorationLine.forEach((function(t){switch(t){case 1:var r=s.options.fontMetrics.getMetrics(i).baseline;s.rectangle(e.bounds.left,Math.round(e.bounds.top+r),e.bounds.width,1,a);break;case 2:s.rectangle(e.bounds.left,Math.round(e.bounds.top),e.bounds.width,1,a);break;case 3:var n=s.options.fontMetrics.getMetrics(i).middle;s.rectangle(e.bounds.left,Math.ceil(e.bounds.top+n),e.bounds.width,1,a)}}))}}))}},{key:"resizeImage",value:function(e,t){if(e.width===t.width&&e.height===t.height)return e;var i=this.canvas.ownerDocument.createElement("canvas");return i.width=t.width,i.height=t.height,i.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),i}},{key:"setOpacity",value:function(e){this.ctx.globalAlpha=e}},{key:"transform",value:function(e,t,i,r){this.ctx.save(),this.ctx.translate(e,t),this.ctx.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this.ctx.translate(-e,-t),r(),this.ctx.restore()}}]),e}(),b=function(){function e(t,i,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.enabled="undefined"!=typeof window&&t,this.start=r||Date.now(),this.id=i}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"child",value:function(t){return new e(this.enabled,t,this.start)}},{key:"log",value:function(){}},{key:"error",value:function(){if(this.enabled&&window.console&&window.console.error){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];Function.prototype.bind.call(window.console.error,window.console).apply(window.console,[Date.now()-this.start+"ms",this.id?"html2canvas (".concat(this.id,"):"):"html2canvas:"].concat([].slice.call(t,0)))}}}]),e}(),v=function(e,t){return 0!=(e&t)},y=function(e,t){return Math.sqrt(e*e+t*t)},B=function(e,t){for(var i=e.length-1;i>=0;i--){var r=e.item(i);"content"!==r&&t.style.setProperty(r,e.getPropertyValue(r))}return t};function C(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var x=0,F=1,N=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type="%"===t.substr(t.length-1)?F:x;var i=parseFloat(t);this.value=isNaN(i)?0:i}return function(e,t,i){t&&C(e.prototype,t),i&&C(e,i)}(e,[{key:"isPercentage",value:function(){return this.type===F}},{key:"getAbsoluteValue",value:function(e){return this.isPercentage()?e*(this.value/100):this.value}}],[{key:"create",value:function(t){return new e(t)}}]),e}(),S=function(e,t,i){switch(i){case"px":case"%":return new N(t+i);case"em":case"rem":var r=new N(t);return r.value*="em"===i?parseFloat(e.style.font.fontSize):function e(t){var i=t.parent;return i?e(i):parseFloat(t.style.font.fontSize)}(e),r;default:return new N("0")}},E=function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.width=t,this.height=i},T=function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=r,this.x=t,this.y=i},L=function(e,t,i){return new T(e.x+(t.x-e.x)*i,e.y+(t.y-e.y)*i)},k=function(){function e(t,i,r,s){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=n,this.start=t,this.startControl=i,this.endControl=r,this.end=s}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"subdivide",value:function(t,i){var r=L(this.start,this.startControl,t),n=L(this.startControl,this.endControl,t),s=L(this.endControl,this.end,t),a=L(r,n,t),o=L(n,s,t),l=L(a,o,t);return i?new e(this.start,r,a,l):new e(l,o,s,this.end)}},{key:"reverse",value:function(){return new e(this.end,this.endControl,this.startControl,this.start)}}]),e}(),D=function(){function e(t,i,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.left=t,this.top=i,this.width=r,this.height=n}return function(e,t,i){i&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e,i)}(e,0,[{key:"fromClientRect",value:function(t,i,r){return new e(t.left+i,t.top+r,t.width,t.height)}}]),e}(),I=function(e,t,i){return D.fromClientRect(e.getBoundingClientRect(),t,i)},U=function(e){var t=e.body,i=e.documentElement;if(!t||!i)throw new Error("");var r=Math.max(Math.max(t.scrollWidth,i.scrollWidth),Math.max(t.offsetWidth,i.offsetWidth),Math.max(t.clientWidth,i.clientWidth)),n=Math.max(Math.max(t.scrollHeight,i.scrollHeight),Math.max(t.offsetHeight,i.offsetHeight),Math.max(t.clientHeight,i.clientHeight));return new D(0,0,r,n)},P=function(e,t,i,r){var n=[];return e instanceof k?n.push(e.subdivide(.5,!1)):n.push(e),i instanceof k?n.push(i.subdivide(.5,!0)):n.push(i),r instanceof k?n.push(r.subdivide(.5,!0).reverse()):n.push(r),t instanceof k?n.push(t.subdivide(.5,!1).reverse()):n.push(t),n},O=function(e){return[e.topLeftInner,e.topRightInner,e.bottomRightInner,e.bottomLeftInner]},R=function(e,t,i){var r=i[Q.TOP_LEFT][0].getAbsoluteValue(e.width),n=i[Q.TOP_LEFT][1].getAbsoluteValue(e.height),s=i[Q.TOP_RIGHT][0].getAbsoluteValue(e.width),a=i[Q.TOP_RIGHT][1].getAbsoluteValue(e.height),o=i[Q.BOTTOM_RIGHT][0].getAbsoluteValue(e.width),l=i[Q.BOTTOM_RIGHT][1].getAbsoluteValue(e.height),h=i[Q.BOTTOM_LEFT][0].getAbsoluteValue(e.width),c=i[Q.BOTTOM_LEFT][1].getAbsoluteValue(e.height),d=[];d.push((r+s)/e.width),d.push((h+o)/e.width),d.push((n+c)/e.height),d.push((a+l)/e.height);var u=Math.max.apply(Math,d);u>1&&(r/=u,n/=u,s/=u,a/=u,o/=u,l/=u,h/=u,c/=u);var A=e.width-s,p=e.height-l,f=e.width-o,g=e.height-c;return{topLeftOuter:r>0||n>0?H(e.left,e.top,r,n,Q.TOP_LEFT):new T(e.left,e.top),topLeftInner:r>0||n>0?H(e.left+t[3].borderWidth,e.top+t[0].borderWidth,Math.max(0,r-t[3].borderWidth),Math.max(0,n-t[0].borderWidth),Q.TOP_LEFT):new T(e.left+t[3].borderWidth,e.top+t[0].borderWidth),topRightOuter:s>0||a>0?H(e.left+A,e.top,s,a,Q.TOP_RIGHT):new T(e.left+e.width,e.top),topRightInner:s>0||a>0?H(e.left+Math.min(A,e.width+t[3].borderWidth),e.top+t[0].borderWidth,A>e.width+t[3].borderWidth?0:s-t[3].borderWidth,a-t[0].borderWidth,Q.TOP_RIGHT):new T(e.left+e.width-t[1].borderWidth,e.top+t[0].borderWidth),bottomRightOuter:o>0||l>0?H(e.left+f,e.top+p,o,l,Q.BOTTOM_RIGHT):new T(e.left+e.width,e.top+e.height),bottomRightInner:o>0||l>0?H(e.left+Math.min(f,e.width-t[3].borderWidth),e.top+Math.min(p,e.height+t[0].borderWidth),Math.max(0,o-t[1].borderWidth),l-t[2].borderWidth,Q.BOTTOM_RIGHT):new T(e.left+e.width-t[1].borderWidth,e.top+e.height-t[2].borderWidth),bottomLeftOuter:h>0||c>0?H(e.left,e.top+g,h,c,Q.BOTTOM_LEFT):new T(e.left,e.top+e.height),bottomLeftInner:h>0||c>0?H(e.left+t[3].borderWidth,e.top+g,Math.max(0,h-t[3].borderWidth),c-t[2].borderWidth,Q.BOTTOM_LEFT):new T(e.left+t[3].borderWidth,e.top+e.height-t[2].borderWidth)}},Q={TOP_LEFT:0,TOP_RIGHT:1,BOTTOM_RIGHT:2,BOTTOM_LEFT:3},H=function(e,t,i,r,n){var s=(Math.sqrt(2)-1)/3*4,a=i*s,o=r*s,l=e+i,h=t+r;switch(n){case Q.TOP_LEFT:return new k(new T(e,h),new T(e,h-o),new T(l-a,t),new T(l,t));case Q.TOP_RIGHT:return new k(new T(e,t),new T(e+a,t),new T(l,h-o),new T(l,h));case Q.BOTTOM_RIGHT:return new k(new T(l,t),new T(l,t+o),new T(e+a,h),new T(e,h));case Q.BOTTOM_LEFT:default:return new k(new T(l,h),new T(l-a,h),new T(e,t+o),new T(e,t))}},M=["top","right","bottom","left"],_=function(e){return M.map((function(t){return new N(e.getPropertyValue("padding-".concat(t)))}))},j={BORDER_BOX:0,PADDING_BOX:1,CONTENT_BOX:2},z=j,V=function e(t){switch(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t){case"contain":this.size=1;break;case"cover":this.size=2;break;case"auto":this.size=0;break;default:this.value=new N(t)}},K=new V("auto"),q=function(e,t,i,r){var n=function(e,t){return new D(e.left+t[3].borderWidth,e.top+t[0].borderWidth,e.width-(t[1].borderWidth+t[3].borderWidth),e.height-(t[0].borderWidth+t[2].borderWidth))}(t,r);switch(e){case z.BORDER_BOX:return t;case z.CONTENT_BOX:var s=i[3].getAbsoluteValue(t.width),a=i[1].getAbsoluteValue(t.width),o=i[0].getAbsoluteValue(t.width),l=i[2].getAbsoluteValue(t.width);return new D(n.left+s,n.top+o,n.width-s-a,n.height-o-l);default:return n}},G=function(e,t,i){return new T(e[0].getAbsoluteValue(i.width-t.width),e[1].getAbsoluteValue(i.height-t.height))},W=function(e,t){return{backgroundColor:new u(e.backgroundColor),backgroundImage:Y(e,t),backgroundClip:J(e.backgroundClip),backgroundOrigin:X(e.backgroundOrigin)}},J=function(e){switch(e){case"padding-box":return j.PADDING_BOX;case"content-box":return j.CONTENT_BOX}return j.BORDER_BOX},X=function(e){switch(e){case"padding-box":return z.PADDING_BOX;case"content-box":return z.CONTENT_BOX}return z.BORDER_BOX},Y=function(e,t){var i=ee(e.backgroundImage).map((function(e){if("url"===e.method){var i=t.loadImage(e.args[0]);e.args=i?[i]:[]}return e})),r=e.backgroundPosition.split(","),n=e.backgroundRepeat.split(","),s=e.backgroundSize.split(",");return i.map((function(e,t){var i=(s[t]||"auto").trim().split(" ").map($),a=(r[t]||"auto").trim().split(" ").map(Z);return{source:e,repeat:function(){switch(("string"==typeof n[t]?n[t]:n[0]).trim()){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":return 0}return 0}(),size:i.length<2?[i[0],K]:[i[0],i[1]],position:a.length<2?[a[0],a[0]]:[a[0],a[1]]}}))},$=function(e){return"auto"===e?K:new V(e)},Z=function(e){switch(e){case"bottom":case"right":return new N("100%");case"left":case"top":return new N("0%");case"auto":return new N("0")}return new N(e)},ee=function(e){var t=/^\s$/,i=[],r=[],n="",s=null,a="",o=0,l=0,h=function(){var e="";if(n){'"'===a.substr(0,1)&&(a=a.substr(1,a.length-2)),a&&r.push(a.trim());var t=n.indexOf("-",1)+1;"-"===n.substr(0,1)&&t>0&&(e=n.substr(0,t).toLowerCase(),n=n.substr(t)),"none"!==(n=n.toLowerCase())&&i.push({prefix:e,method:n,args:r})}r=[],n=a=""};return e.split("").forEach((function(e){if(0!==o||!t.test(e)){switch(e){case'"':s?s===e&&(s=null):s=e;break;case"(":if(s)break;if(0===o)return void(o=1);l++;break;case")":if(s)break;if(1===o){if(0===l)return o=0,void h();l--}break;case",":if(s)break;if(0===o)return void h();if(1===o&&0===l&&!n.match(/^url$/i))return r.push(a.trim()),void(a="")}0===o?n+=e:a+=e}})),h(),i},te=Object.keys({TOP:0,RIGHT:1,BOTTOM:2,LEFT:3}).map((function(e){return e.toLowerCase()})),ie=function(e){return te.map((function(t){var i=new u(e.getPropertyValue("border-".concat(t,"-color"))),r=function(e){return"none"===e?0:1}(e.getPropertyValue("border-".concat(t,"-style"))),n=parseFloat(e.getPropertyValue("border-".concat(t,"-width")));return{borderColor:i,borderStyle:r,borderWidth:isNaN(n)?0:n}}))},re=["top-left","top-right","bottom-right","bottom-left"],ne=function(e){return re.map((function(t){var i=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t=[],i=!0,r=!1,n=void 0;try{for(var s,a=e[Symbol.iterator]();!(i=(s=a.next()).done)&&(t.push(s.value),2!==t.length);i=!0);}catch(e){r=!0,n=e}finally{try{i||null==a.return||a.return()}finally{if(r)throw n}}return t}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(e.getPropertyValue("border-".concat(t,"-radius")).split(" ").map(N.create)),r=i[0],n=i[1];return void 0===n?[r,r]:[r,n]}))},se=1,ae=2,oe=4,le=8,he=16,ce=32,de=64,ue=128,Ae=256,pe=512,fe=1024,ge=2048,me=4096,we=8192,be=16384,ve=32768,ye=65536,Be=1<<17,Ce=1<<18,xe=1<<19,Fe=1<<20,Ne=1<<21,Se=1<<22,Ee=1<<23,Te=1<<24,Le=1<<25,ke=1<<26,De=1<<27,Ie=1<<28,Ue=1<<29,Pe=function(e,t){return e|function(){switch(t){case"block":return ae;case"inline":return oe;case"run-in":return le;case"flow":return he;case"flow-root":return ce;case"table":return de;case"flex":return ue;case"grid":return Ae;case"ruby":return pe;case"subgrid":return fe;case"list-item":return ge;case"table-row-group":return me;case"table-header-group":return we;case"table-footer-group":return be;case"table-row":return ve;case"table-cell":return ye;case"table-column-group":return Be;case"table-column":return Ce;case"table-caption":return xe;case"ruby-base":return Fe;case"ruby-text":return Ne;case"ruby-base-container":return Se;case"ruby-text-container":return Ee;case"contents":return Te;case"inline-block":return Le;case"inline-list-item":return ke;case"inline-table":return De;case"inline-flex":return Ie;case"inline-grid":return Ue}return se}()},Oe=function(e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0},Re=function(e){return{fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontVariant:e.fontVariant,fontWeight:function(e){switch(e){case"normal":return 400;case"bold":return 700}var t=parseInt(e,10);return isNaN(t)?400:t}(e.fontWeight)}},Qe=function(e){if("normal"===e)return 0;var t=parseFloat(e);return isNaN(t)?0:t},He=function(e){return"strict"===e?"strict":"normal"},Me=function(e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}},_e=function(e){var t=ee(e.getPropertyValue("list-style-image"));return{listStyleType:Me(e.getPropertyValue("list-style-type")),listStyleImage:t.length?t[0]:null,listStylePosition:je(e.getPropertyValue("list-style-position"))}},je=function(e){return"inside"===e?0:1},ze=["top","right","bottom","left"],Ve=function(e){return ze.map((function(t){return new N(e.getPropertyValue("margin-".concat(t)))}))},Ke=0,qe=1,Ge=2,We=3,Je=function(e){switch(e){case"hidden":return qe;case"scroll":return Ge;case"auto":return We;default:return Ke}},Xe=function(e){return"break-word"===e?1:0},Ye=0,$e=1,Ze=2,et=3,tt=4,it=/^([+-]|\d|\.)$/i,rt=function(e){if("none"===e||"string"!=typeof e)return null;for(var t="",i=!1,r=[],n=[],s=0,a=null,o=function(){t.length&&(i?r.push(parseFloat(t)):a=new u(t)),i=!1,t=""},l=function(){r.length&&null!==a&&n.push({color:a,offsetX:r[0]||0,offsetY:r[1]||0,blur:r[2]||0}),r.splice(0,r.length),a=null},h=0;h<e.length;h++){var c=e[h];switch(c){case"(":t+=c,s++;break;case")":t+=c,s--;break;case",":0===s?(o(),l()):t+=c;break;case" ":0===s?o():t+=c;break;default:0===t.length&&it.test(c)&&(i=!0),t+=c}}return o(),l(),0===n.length?null:n},nt=function(e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0},st=function(e){return parseFloat(e.trim())},at=/(matrix|matrix3d)\((.+)\)/,ot=function(e){var t=ht(e.transform||e.webkitTransform||e.mozTransform||e.msTransform||e.oTransform);return null===t?null:{transform:t,transformOrigin:lt(e.transformOrigin||e.webkitTransformOrigin||e.mozTransformOrigin||e.msTransformOrigin||e.oTransformOrigin)}},lt=function(e){if("string"!=typeof e){var t=new N("0");return[t,t]}var i=e.split(" ").map(N.create);return[i[0],i[1]]},ht=function(e){if("none"===e||"string"!=typeof e)return null;var t=e.match(at);if(t){if("matrix"===t[1]){var i=t[2].split(",").map(st);return[i[0],i[1],i[2],i[3],i[4],i[5]]}var r=t[2].split(",").map(st);return[r[0],r[1],r[4],r[5],r[12],r[13]]}return null},ct=function(e){switch(e){case"hidden":return 1;case"collapse":return 2;default:return 0}},dt=function(e){switch(e){case"break-all":return"break-all";case"keep-all":return"keep-all";default:return"normal"}},ut=function(e){var t="auto"===e;return{auto:t,order:t?0:parseInt(e,10)}},At=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"render",value:function(e){var t=this;this.options=e,this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.canvas.width=Math.floor(e.width)*e.scale,this.canvas.height=Math.floor(e.height)*e.scale,this.canvas.style.width="".concat(e.width,"px"),this.canvas.style.height="".concat(e.height,"px"),this.ctx.scale(e.scale,e.scale),e.logger.log("ForeignObject renderer initialized (".concat(e.width,"x").concat(e.height," at ").concat(e.x,",").concat(e.y,") with scale ").concat(e.scale));var i=pt(Math.max(e.windowWidth,e.width)*e.scale,Math.max(e.windowHeight,e.height)*e.scale,e.scrollX*e.scale,e.scrollY*e.scale,this.element);return ft(i).then((function(i){return e.backgroundColor&&(t.ctx.fillStyle=e.backgroundColor.toString(),t.ctx.fillRect(0,0,e.width*e.scale,e.height*e.scale)),t.ctx.drawImage(i,-e.x*e.scale,-e.y*e.scale),t.canvas}))}}]),e}(),pt=function(e,t,i,r,n){var s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),o=document.createElementNS(s,"foreignObject");return a.setAttributeNS(null,"width",e),a.setAttributeNS(null,"height",t),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",i),o.setAttributeNS(null,"y",r),o.setAttributeNS(null,"externalResourcesRequired","true"),a.appendChild(o),o.appendChild(n),a},ft=function(e){return new Promise((function(t,i){var r=new Image;r.onload=function(){return t(r)},r.onerror=i,r.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent((new XMLSerializer).serializeToString(e)))}))},gt=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},mt={get SUPPORT_RANGE_BOUNDS(){var e=function(e){if(e.createRange){var t=e.createRange();if(t.getBoundingClientRect){var i=e.createElement("boundtest");i.style.height="".concat(123,"px"),i.style.display="block",e.body.appendChild(i),t.selectNode(i);var r=t.getBoundingClientRect(),n=Math.round(r.height);if(e.body.removeChild(i),123===n)return!0}}return!1}(document);return Object.defineProperty(mt,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=function(e){var t=new Image,i=e.createElement("canvas"),r=i.getContext("2d");t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(t,0,0),i.toDataURL()}catch(e){return!1}return!0}(document);return Object.defineProperty(mt,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"==typeof Array.from&&"function"==typeof window.fetch?function(e){var t=e.createElement("canvas");t.width=100,t.height=100;var i=t.getContext("2d");i.fillStyle="rgb(0, 255, 0)",i.fillRect(0,0,100,100);var r=new Image,n=t.toDataURL();r.src=n;var s=pt(100,100,0,0,r);return i.fillStyle="red",i.fillRect(0,0,100,100),ft(s).then((function(t){i.drawImage(t,0,0);var r=i.getImageData(0,0,100,100).data;i.fillStyle="red",i.fillRect(0,0,100,100);var s=e.createElement("div");return s.style.backgroundImage="url(".concat(n,")"),s.style.height="".concat(100,"px"),gt(r)?ft(pt(100,100,0,0,s)):Promise.reject(!1)})).then((function(e){return i.drawImage(e,0,0),gt(i.getImageData(0,0,100,100).data)})).catch((function(e){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(mt,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=void 0!==(new Image).crossOrigin;return Object.defineProperty(mt,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(mt,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(mt,"SUPPORT_CORS_XHR",{value:e}),e}},wt=mt,bt=i(0),vt=function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.text=t,this.bounds=i},yt=function(e,t,i){var r=e.ownerDocument.createElement("html2canvaswrapper");r.appendChild(e.cloneNode(!0));var n=e.parentNode;if(n){n.replaceChild(r,e);var s=I(r,t,i);return r.firstChild&&n.replaceChild(r.firstChild,r),s}return new D(0,0,0,0)},Bt=function(e,t,i,r,n){var s=e.ownerDocument.createRange();return s.setStart(e,t),s.setEnd(e,t+i),D.fromClientRect(s.getBoundingClientRect(),r,n)},Ct=function(){function e(t,i,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.text=t,this.parent=i,this.bounds=r}return function(e,t,i){i&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e,i)}(e,0,[{key:"fromTextNode",value:function(t,i){var r=Ft(t.data,i.style.textTransform);return new e(r,i,function(e,t,i){for(var r=0!==t.style.letterSpacing?Object(bt.toCodePoints)(e).map((function(e){return Object(bt.fromCodePoint)(e)})):function(e,t){for(var i,r=Object(bt.LineBreaker)(e,{lineBreak:t.style.lineBreak,wordBreak:1===t.style.overflowWrap?"break-word":t.style.wordBreak}),n=[];!(i=r.next()).done;)n.push(i.value.slice());return n}(e,t),n=r.length,s=i.parentNode?i.parentNode.ownerDocument.defaultView:null,a=s?s.pageXOffset:0,o=s?s.pageYOffset:0,l=[],h=0,c=0;c<n;c++){var d=r[c];if(null!==t.style.textDecoration||d.trim().length>0)if(wt.SUPPORT_RANGE_BOUNDS)l.push(new vt(d,Bt(i,h,d.length,a,o)));else{var u=i.splitText(d.length);l.push(new vt(d,yt(i,a,o))),i=u}else wt.SUPPORT_RANGE_BOUNDS||(i=i.splitText(d.length));h+=d.length}return l}(r,i,t))}}]),e}(),xt=/(^|\s|:|-|\(|\))([a-z])/g,Ft=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(xt,Nt);case 2:return e.toUpperCase();default:return e}};function Nt(e,t,i){return e.length>0?t+i.toUpperCase():e}var St=function e(t,i,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=s,this.x=t,this.y=i,this.radius=r},Et=new u([42,42,42]),Tt=new u([165,165,165]),Lt=new u([222,222,222]),kt={borderWidth:1,borderColor:Tt,borderStyle:1},Dt=[kt,kt,kt,kt],It={backgroundColor:Lt,backgroundImage:[],backgroundClip:j.PADDING_BOX,backgroundOrigin:z.PADDING_BOX},Ut=new N("50%"),Pt=[Ut,Ut],Ot=[Pt,Pt,Pt,Pt],Rt=new N("3px"),Qt=[Rt,Rt],Ht=[Qt,Qt,Qt,Qt],Mt=function(e){return"radio"===e.type?Ot:Ht},_t=function(e,t){if("radio"===e.type||"checkbox"===e.type){if(e.checked){var i=Math.min(t.bounds.width,t.bounds.height);t.childNodes.push("checkbox"===e.type?[new T(t.bounds.left+.39363*i,t.bounds.top+.79*i),new T(t.bounds.left+.16*i,t.bounds.top+.5549*i),new T(t.bounds.left+.27347*i,t.bounds.top+.44071*i),new T(t.bounds.left+.39694*i,t.bounds.top+.5649*i),new T(t.bounds.left+.72983*i,t.bounds.top+.23*i),new T(t.bounds.left+.84*i,t.bounds.top+.34085*i),new T(t.bounds.left+.39363*i,t.bounds.top+.79*i)]:new St(t.bounds.left+i/4,t.bounds.top+i/4,i/4))}}else Vt(Kt(e),e,t,!1)},jt=function(e,t){Vt(e.value,e,t,!0)},zt=function(e,t){var i=e.options[e.selectedIndex||0];Vt(i&&i.text||"",e,t,!1)},Vt=function(e,t,i,r){var n=t.ownerDocument.body;if(e.length>0&&n){var s=t.ownerDocument.createElement("html2canvaswrapper");B(t.ownerDocument.defaultView.getComputedStyle(t,null),s),s.style.position="absolute",s.style.left="".concat(i.bounds.left,"px"),s.style.top="".concat(i.bounds.top,"px"),r||(s.style.whiteSpace="nowrap");var a=t.ownerDocument.createTextNode(e);s.appendChild(a),n.appendChild(s),i.childNodes.push(Ct.fromTextNode(a,i)),n.removeChild(s)}},Kt=function(e){var t="password"===e.type?new Array(e.value.length+1).join("•"):e.value;return 0===t.length?e.placeholder||"":t},qt=["OL","UL","MENU"],Gt=function(e,t,i){var r=t.style.listStyle;if(r){var n,s=e.ownerDocument.defaultView.getComputedStyle(e,null),a=e.ownerDocument.createElement("html2canvaswrapper");switch(B(s,a),a.style.position="absolute",a.style.bottom="auto",a.style.display="block",a.style.letterSpacing="normal",r.listStylePosition){case 1:a.style.left="auto",a.style.right="".concat(e.ownerDocument.defaultView.innerWidth-t.bounds.left-t.style.margin[1].getAbsoluteValue(t.bounds.width)+7,"px"),a.style.textAlign="right";break;case 0:a.style.left="".concat(t.bounds.left-t.style.margin[3].getAbsoluteValue(t.bounds.width),"px"),a.style.right="auto",a.style.textAlign="left"}var o=t.style.margin[0].getAbsoluteValue(t.bounds.width),l=r.listStyleImage;if(l)if("url"===l.method){var h=e.ownerDocument.createElement("img");h.src=l.args[0],a.style.top="".concat(t.bounds.top-o,"px"),a.style.width="auto",a.style.height="auto",a.appendChild(h)}else{var c=.5*parseFloat(t.style.font.fontSize);a.style.top="".concat(t.bounds.top-o+t.bounds.height-1.5*c,"px"),a.style.width="".concat(c,"px"),a.style.height="".concat(c,"px"),a.style.backgroundImage=s.listStyleImage}else"number"==typeof t.listIndex&&(n=e.ownerDocument.createTextNode(ri(t.listIndex,r.listStyleType,!0)),a.appendChild(n),a.style.top="".concat(t.bounds.top-o,"px"));var d=e.ownerDocument.body;d.appendChild(a),n?(t.childNodes.push(Ct.fromTextNode(n,t)),d.removeChild(a)):t.childNodes.push(new si(a,t,i,0))}},Wt={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Jt={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","�?","�?","Վ","�?","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","�?","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Xt={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","�?׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","�?"]},Yt={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","�?","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","�?"]},$t=function(e,t,i,r,n,s){return e<t||e>i?ri(e,n,s.length>0):r.integers.reduce((function(t,i,n){for(;e>=i;)e-=i,t+=r.values[n];return t}),"")+s},Zt=function(e,t,i,r){var n="";do{i||e--,n=r(e)+n,e/=t}while(e*t>=t);return n},ei=function(e,t,i,r,n){var s=i-t+1;return(e<0?"-":"")+(Zt(Math.abs(e),s,r,(function(e){return Object(bt.fromCodePoint)(Math.floor(e%s)+t)}))+n)},ti=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:". ",r=t.length;return Zt(Math.abs(e),r,!1,(function(e){return t[Math.floor(e%r)]}))+i},ii=function(e,t,i,r,n,s){if(e<-9999||e>9999)return ri(e,4,n.length>0);var a=Math.abs(e),o=n;if(0===a)return t[0]+o;for(var l=0;a>0&&l<=4;l++){var h=a%10;0===h&&v(s,1)&&""!==o?o=t[h]+o:h>1||1===h&&0===l||1===h&&1===l&&v(s,2)||1===h&&1===l&&v(s,4)&&e>100||1===h&&l>1&&v(s,8)?o=t[h]+(l>0?i[l-1]:"")+o:1===h&&l>0&&(o=i[l-1]+o),a=Math.floor(a/10)}return(e<0?r:"")+o},ri=function(e,t,i){var r=i?". ":"",n=i?"�?":"",s=i?", ":"";switch(t){case 0:return"•";case 1:return"◦";case 2:return"◾";case 5:var a=ei(e,48,57,!0,r);return a.length<4?"0".concat(a):a;case 4:return ti(e,"〇一二三四五六七八�?",n);case 6:return $t(e,1,3999,Wt,3,r).toLowerCase();case 7:return $t(e,1,3999,Wt,3,r);case 8:return ei(e,945,969,!1,r);case 9:return ei(e,97,122,!1,r);case 10:return ei(e,65,90,!1,r);case 11:return ei(e,1632,1641,!0,r);case 12:case 49:return $t(e,1,9999,Jt,3,r);case 35:return $t(e,1,9999,Jt,3,r).toLowerCase();case 13:return ei(e,2534,2543,!0,r);case 14:case 30:return ei(e,6112,6121,!0,r);case 15:return ti(e,"�?丑寅�?�辰巳�?�未申酉戌亥",n);case 16:return ti(e,"甲乙丙�?戊己庚辛壬癸",n);case 17:case 48:return ii(e,"零一二三四五六七八�?","�??百�?��?�","負",n,14);case 47:return ii(e,"零壹貳�?�肆�?陸柒�?�玖","拾佰仟�?�","負",n,15);case 42:return ii(e,"零一二三四五六七八�?","�??百�?��?�","负",n,14);case 41:return ii(e,"零壹贰�??肆�?陆柒�?�玖","拾佰仟�?�","负",n,15);case 26:return ii(e,"〇一二三四五六七八�?","�??百�?�万","マイナス",n,0);case 25:return ii(e,"零壱�?�?�四�?六七八�?","拾百�?�万","マイナス",n,7);case 31:return ii(e,"�?�?��?�삼사오육칠팔구","십백천만","마�?�너스",s,7);case 33:return ii(e,"零一二三四五六七八�?","�??百�?��?�","마�?�너스",s,0);case 32:return ii(e,"零壹貳�?�四五六七八�?","拾百�?�","마�?�너스",s,7);case 18:return ei(e,2406,2415,!0,r);case 20:return $t(e,1,19999,Yt,3,r);case 21:return ei(e,2790,2799,!0,r);case 22:return ei(e,2662,2671,!0,r);case 22:return $t(e,1,10999,Xt,3,r);case 23:return ti(e,"�?��?��?��?��?��?��??�??�?��?��?��?��?��?��??�?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?��?�む�?もやゆよらりるれ�?�?�?ゑをん");case 24:return ti(e,"�?��?�?��?��?��?��?��?�り�?�るを�?�?�よ�?�れ�??�?��?��?�らむ�?��?�?��?��??や�?��?��?��?��?��?��?��?��??ゆ�?�?��?�ゑ�?�も�?��?�");case 27:return ei(e,3302,3311,!0,r);case 28:return ti(e,"アイウエオカキクケコサシスセソタ�?ツテトナニヌ�?ノ�?ヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",n);case 29:return ti(e,"イロ�?ニホヘト�?リヌルヲワカヨタレソツ�?ナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case 34:return ei(e,3792,3801,!0,r);case 37:return ei(e,6160,6169,!0,r);case 38:return ei(e,4160,4169,!0,r);case 39:return ei(e,2918,2927,!0,r);case 40:return ei(e,1776,1785,!0,r);case 43:return ei(e,3046,3055,!0,r);case 44:return ei(e,3174,3183,!0,r);case 45:return ei(e,3664,3673,!0,r);case 46:return ei(e,3872,3881,!0,r);default:return ei(e,48,57,!0,r)}},ni=["INPUT","TEXTAREA","SELECT"],si=function(){function e(t,i,r,n){var s=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.parent=i,this.tagName=t.tagName,this.index=n,this.childNodes=[],this.listItems=[],"number"==typeof t.start&&(this.listStart=t.start);var a=t.ownerDocument.defaultView,o=a.pageXOffset,l=a.pageYOffset,h=a.getComputedStyle(t,null),c=function(e){return e.split(" ").reduce(Pe,0)}(h.display),d="radio"===t.type||"checkbox"===t.type,A=function(e){switch(e){case"relative":return $e;case"absolute":return Ze;case"fixed":return et;case"sticky":return tt}return Ye}(h.position);if(this.style={background:d?It:W(h,r),border:d?Dt:ie(h),borderRadius:(t instanceof a.HTMLInputElement||t instanceof HTMLInputElement)&&d?Mt(t):ne(h),color:d?Et:new u(h.color),display:c,float:Oe(h.float),font:Re(h),letterSpacing:Qe(h.letterSpacing),listStyle:c===ge?_e(h):null,lineBreak:He(h.lineBreak),margin:Ve(h),opacity:parseFloat(h.opacity),overflow:-1===ni.indexOf(t.tagName)?Je(h.overflow):qe,overflowWrap:Xe(h.overflowWrap?h.overflowWrap:h.wordWrap),padding:_(h),position:A,textDecoration:g(h),textShadow:rt(h.textShadow),textTransform:nt(h.textTransform),transform:ot(h),visibility:ct(h.visibility),wordBreak:dt(h.wordBreak),zIndex:ut(A!==Ye?h.zIndex:"auto")},this.isTransformed()&&(t.style.transform="matrix(1,0,0,1,0,0)"),c===ge){var p=function(e){var t=e.parent;if(!t)return null;do{if(-1!==qt.indexOf(t.tagName))return t;t=t.parent}while(t);return e.parent}(this);if(p){var f=p.listItems.length;p.listItems.push(this),this.listIndex=t.hasAttribute("value")&&"number"==typeof t.value?t.value:0===f?"number"==typeof p.listStart?p.listStart:1:p.listItems[f-1].listIndex+1}}"IMG"===t.tagName&&t.addEventListener("load",(function(){s.bounds=I(t,o,l),s.curvedBounds=R(s.bounds,s.style.border,s.style.borderRadius)})),this.image=ai(t,r),this.bounds=d?function(e){return e.width>e.height?(e.left+=(e.width-e.height)/2,e.width=e.height):e.width<e.height&&(e.top+=(e.height-e.width)/2,e.height=e.width),e}(I(t,o,l)):I(t,o,l),this.curvedBounds=R(this.bounds,this.style.border,this.style.borderRadius)}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"getClipPaths",value:function(){var e=this.parent?this.parent.getClipPaths():[];return this.style.overflow!==Ke?e.concat([O(this.curvedBounds)]):e}},{key:"isInFlow",value:function(){return this.isRootElement()&&!this.isFloating()&&!this.isAbsolutelyPositioned()}},{key:"isVisible",value:function(){return!v(this.style.display,se)&&this.style.opacity>0&&0===this.style.visibility}},{key:"isAbsolutelyPositioned",value:function(){return this.style.position!==Ye&&this.style.position!==$e}},{key:"isPositioned",value:function(){return this.style.position!==Ye}},{key:"isFloating",value:function(){return 0!==this.style.float}},{key:"isRootElement",value:function(){return null===this.parent}},{key:"isTransformed",value:function(){return null!==this.style.transform}},{key:"isPositionedWithZIndex",value:function(){return this.isPositioned()&&!this.style.zIndex.auto}},{key:"isInlineLevel",value:function(){return v(this.style.display,oe)||v(this.style.display,Le)||v(this.style.display,Ie)||v(this.style.display,Ue)||v(this.style.display,ke)||v(this.style.display,De)}},{key:"isInlineBlockOrInlineTable",value:function(){return v(this.style.display,Le)||v(this.style.display,De)}}]),e}(),ai=function(e,t){if(e instanceof e.ownerDocument.defaultView.SVGSVGElement||e instanceof SVGSVGElement){var i=new XMLSerializer;return t.loadImage("data:image/svg+xml,".concat(encodeURIComponent(i.serializeToString(e))))}switch(e.tagName){case"IMG":var r=e;return t.loadImage(r.currentSrc||r.src);case"CANVAS":var n=e;return t.loadCanvas(n);case"IFRAME":var s=e.getAttribute("data-html2canvas-internal-iframe-key");if(s)return s}return null},oi=function(){function e(t,i,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.container=t,this.parent=i,this.contexts=[],this.children=[],this.treatAsRealStackingContext=r}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"getOpacity",value:function(){return this.parent?this.container.style.opacity*this.parent.getOpacity():this.container.style.opacity}},{key:"getRealParentStackingContext",value:function(){return!this.parent||this.treatAsRealStackingContext?this:this.parent.getRealParentStackingContext()}}]),e}(),li=["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"],hi=function(e,t){return e.isRootElement()||e.isPositionedWithZIndex()||e.style.opacity<1||e.isTransformed()||di(e,t)},ci=function(e){return e.isPositioned()||e.isFloating()},di=function(e,t){return"BODY"===t.nodeName&&e.parent instanceof si&&e.parent.style.background.backgroundColor.isTransparent()},ui=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._data={},this._document=t}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"_parseMetrics",value:function(e){var t=this._document.createElement("div"),i=this._document.createElement("img"),r=this._document.createElement("span"),n=this._document.body;if(!n)throw new Error("");t.style.visibility="hidden",t.style.fontFamily=e.fontFamily,t.style.fontSize=e.fontSize,t.style.margin="0",t.style.padding="0",n.appendChild(t),i.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",r.style.fontFamily=e.fontFamily,r.style.fontSize=e.fontSize,r.style.margin="0",r.style.padding="0",r.appendChild(this._document.createTextNode("Hidden Text")),t.appendChild(r),t.appendChild(i);var s=i.offsetTop-r.offsetTop+2;t.removeChild(r),t.appendChild(this._document.createTextNode("Hidden Text")),t.style.lineHeight="normal",i.style.verticalAlign="super";var a=i.offsetTop-t.offsetTop+2;return n.removeChild(t),{baseline:s,middle:a}}},{key:"getMetrics",value:function(e){var t="".concat(e.fontFamily," ").concat(e.fontSize);return void 0===this._data[t]&&(this._data[t]=this._parseMetrics(e)),this._data[t]}}]),e}(),Ai=/([+-]?\d*\.?\d+)(deg|grad|rad|turn)/i;function pi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var fi=/^(to )?(left|top|right|bottom)( (left|top|right|bottom))?$/i,gi=/^([+-]?\d*\.?\d+)% ([+-]?\d*\.?\d+)%$/i,mi=/(px)|%|( 0)$/i,wi=/^(from|to|color-stop)\((?:([\d.]+)(%)?,\s*)?(.+?)\)$/i,bi=/^\s*(circle|ellipse)?\s*((?:([\d.]+)(px|r?em|%)\s*(?:([\d.]+)(px|r?em|%))?)|closest-side|closest-corner|farthest-side|farthest-corner)?\s*(?:at\s*(?:(left|center|right)|([\d.]+)(px|r?em|%))\s+(?:(top|center|bottom)|([\d.]+)(px|r?em|%)))?(?:\s|$)/i,vi={left:new N("0%"),top:new N("0%"),center:new N("50%"),right:new N("100%"),bottom:new N("100%")},yi=function(e,t,i){for(var r=[],n=t;n<e.length;n++){var s=e[n],a=mi.test(s),o=s.lastIndexOf(" "),l=new u(a?s.substring(0,o):s),h=a?new N(s.substring(o+1)):n===t?new N("0%"):n===e.length-1?new N("100%"):null;r.push({color:l,stop:h})}for(var c=r.map((function(e){var t=e.color,r=e.stop;return{color:t,stop:0===i?0:r?r.getAbsoluteValue(i)/i:null}})),d=c[0].stop,A=0;A<c.length;A++)if(null!==d){var p=c[A].stop;if(null===p){for(var f=A;null===c[f].stop;)f++;for(var g=f-A+1,m=(c[f].stop-d)/g;A<f;A++)d=c[A].stop=d+m}else d=p}return c},Bi=function(e,t,i){var r=function(e){var t=e.match(Ai);if(t){var i=parseFloat(t[1]);switch(t[2].toLowerCase()){case"deg":return Math.PI*i/180;case"grad":return Math.PI/200*i;case"rad":return i;case"turn":return 2*Math.PI*i}}return null}(e[0]),n=fi.test(e[0]),s=n||null!==r||gi.test(e[0]),a=s?null!==r?xi(i?r-.5*Math.PI:r,t):n?Ni(e[0],t):Si(e[0],t):xi(Math.PI,t),o=s?1:0,l=Math.min(y(Math.abs(a.x0)+Math.abs(a.x1),Math.abs(a.y0)+Math.abs(a.y1)),2*t.width,2*t.height);return new function e(t,i){pi(this,e),this.type=0,this.colorStops=t,this.direction=i}(yi(e,o,l),a)},Ci=function(e,t,i){var r=t[0].match(bi),n=r&&("circle"===r[1]||void 0!==r[3]&&void 0===r[5])?0:1,s={},a={};r&&(void 0!==r[3]&&(s.x=S(e,r[3],r[4]).getAbsoluteValue(i.width)),void 0!==r[5]&&(s.y=S(e,r[5],r[6]).getAbsoluteValue(i.height)),r[7]?a.x=vi[r[7].toLowerCase()]:void 0!==r[8]&&(a.x=S(e,r[8],r[9])),r[10]?a.y=vi[r[10].toLowerCase()]:void 0!==r[11]&&(a.y=S(e,r[11],r[12])));var o={x:void 0===a.x?i.width/2:a.x.getAbsoluteValue(i.width),y:void 0===a.y?i.height/2:a.y.getAbsoluteValue(i.height)},l=Ti(r&&r[2]||"farthest-corner",n,o,s,i);return new function e(t,i,r,n){pi(this,e),this.type=1,this.colorStops=t,this.shape=i,this.center=r,this.radius=n}(yi(t,r?1:0,Math.min(l.x,l.y)),n,o,l)},xi=function(e,t){var i=t.width,r=t.height,n=.5*i,s=.5*r,a=(Math.abs(i*Math.sin(e))+Math.abs(r*Math.cos(e)))/2,o=n+Math.sin(e)*a,l=s-Math.cos(e)*a;return{x0:o,x1:i-o,y0:l,y1:r-l}},Fi=function(e){return Math.acos(e.width/2/(y(e.width,e.height)/2))},Ni=function(e,t){switch(e){case"bottom":case"to top":return xi(0,t);case"left":case"to right":return xi(Math.PI/2,t);case"right":case"to left":return xi(3*Math.PI/2,t);case"top right":case"right top":case"to bottom left":case"to left bottom":return xi(Math.PI+Fi(t),t);case"top left":case"left top":case"to bottom right":case"to right bottom":return xi(Math.PI-Fi(t),t);case"bottom left":case"left bottom":case"to top right":case"to right top":return xi(Fi(t),t);case"bottom right":case"right bottom":case"to top left":case"to left top":return xi(2*Math.PI-Fi(t),t);default:return xi(Math.PI,t)}},Si=function(e,t){var i=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t=[],i=!0,r=!1,n=void 0;try{for(var s,a=e[Symbol.iterator]();!(i=(s=a.next()).done)&&(t.push(s.value),2!==t.length);i=!0);}catch(e){r=!0,n=e}finally{try{i||null==a.return||a.return()}finally{if(r)throw n}}return t}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(e.split(" ").map(parseFloat)),r=i[0],n=i[1],s=r/100*t.width/(n/100*t.height);return xi(Math.atan(isNaN(s)?1:s)+Math.PI/2,t)},Ei=function(e,t,i,r){return[{x:0,y:0},{x:0,y:e.height},{x:e.width,y:0},{x:e.width,y:e.height}].reduce((function(e,n){var s=y(t-n.x,i-n.y);return(r?s<e.optimumDistance:s>e.optimumDistance)?{optimumCorner:n,optimumDistance:s}:e}),{optimumDistance:r?1/0:-1/0,optimumCorner:null}).optimumCorner},Ti=function(e,t,i,r,n){var s=i.x,a=i.y,o=0,l=0;switch(e){case"closest-side":0===t?o=l=Math.min(Math.abs(s),Math.abs(s-n.width),Math.abs(a),Math.abs(a-n.height)):1===t&&(o=Math.min(Math.abs(s),Math.abs(s-n.width)),l=Math.min(Math.abs(a),Math.abs(a-n.height)));break;case"closest-corner":if(0===t)o=l=Math.min(y(s,a),y(s,a-n.height),y(s-n.width,a),y(s-n.width,a-n.height));else if(1===t){var h=Math.min(Math.abs(a),Math.abs(a-n.height))/Math.min(Math.abs(s),Math.abs(s-n.width)),c=Ei(n,s,a,!0);l=h*(o=y(c.x-s,(c.y-a)/h))}break;case"farthest-side":0===t?o=l=Math.max(Math.abs(s),Math.abs(s-n.width),Math.abs(a),Math.abs(a-n.height)):1===t&&(o=Math.max(Math.abs(s),Math.abs(s-n.width)),l=Math.max(Math.abs(a),Math.abs(a-n.height)));break;case"farthest-corner":if(0===t)o=l=Math.max(y(s,a),y(s,a-n.height),y(s-n.width,a),y(s-n.width,a-n.height));else if(1===t){var d=Math.max(Math.abs(a),Math.abs(a-n.height))/Math.max(Math.abs(s),Math.abs(s-n.width)),u=Ei(n,s,a,!1);l=d*(o=y(u.x-s,(u.y-a)/d))}break;default:o=r.x||0,l=void 0!==r.y?r.y:o}return{x:o,y:l}},Li=function(e){var t="",i="",r="",n="",s=0,a=/^(left|center|right|\d+(?:px|r?em|%)?)(?:\s+(top|center|bottom|\d+(?:px|r?em|%)?))?$/i,o=/^\d+(px|r?em|%)?(?:\s+\d+(px|r?em|%)?)?$/i,l=e[s].match(a);l&&s++;var h=e[s].match(/^(circle|ellipse)?\s*(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)?$/i);h&&(t=h[1]||"","contain"===(r=h[2]||"")?r="closest-side":"cover"===r&&(r="farthest-corner"),s++);var c=e[s].match(o);c&&s++;var d=e[s].match(a);d&&s++;var u=e[s].match(o);u&&s++;var A=d||l;A&&A[1]&&(n=A[1]+(/^\d+$/.test(A[1])?"px":""),A[2]&&(n+=" "+A[2]+(/^\d+$/.test(A[2])?"px":"")));var p=u||c;return p&&(i=p[0],p[1]||(i+="px")),!n||t||i||r||(i=n,n=""),n&&(n="at ".concat(n)),[[t,r,i,n].filter((function(e){return!!e})).join(" ")].concat(e.slice(s))},ki=function(e){return e.map((function(e){return e.match(wi)})).map((function(t,i){if(!t)return e[i];switch(t[1]){case"from":return"".concat(t[4]," 0%");case"to":return"".concat(t[4]," 100%");case"color-stop":return"%"===t[3]?"".concat(t[4]," ").concat(t[2]):"".concat(t[4]," ").concat(100*parseFloat(t[2]),"%")}}))};function Di(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=[],r=!0,n=!1,s=void 0;try{for(var a,o=e[Symbol.iterator]();!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){n=!0,s=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw s}}return i}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Ii=function(){function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.target=t,this.options=i,t.render(i)}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"renderNode",value:function(e){e.isVisible()&&(this.renderNodeBackgroundAndBorders(e),this.renderNodeContent(e))}},{key:"renderNodeContent",value:function(e){var t=this,i=function(){if(e.childNodes.length&&e.childNodes.forEach((function(i){if(i instanceof Ct){var r=i.parent.style;t.target.renderTextNode(i.bounds,r.color,r.font,r.textDecoration,r.textShadow)}else t.target.drawShape(i,e.style.color)})),e.image){var i=t.options.imageStore.get(e.image);if(i){var r=function(e,t,i){var r=t[0].value,n=t[1].value,s=t[2].value,a=t[3].value;return new D(e.left+a+i[3].borderWidth,e.top+r+i[0].borderWidth,e.width-(i[1].borderWidth+i[3].borderWidth+a+n),e.height-(i[0].borderWidth+i[2].borderWidth+r+s))}(e.bounds,e.style.padding,e.style.border),n="number"==typeof i.width&&i.width>0?i.width:r.width,s="number"==typeof i.height&&i.height>0?i.height:r.height;n>0&&s>0&&t.target.clip([O(e.curvedBounds)],(function(){t.target.drawImage(i,new D(0,0,n,s),r)}))}}},r=e.getClipPaths();r.length?this.target.clip(r,i):i()}},{key:"renderNodeBackgroundAndBorders",value:function(e){var t=this,i=!e.style.background.backgroundColor.isTransparent()||e.style.background.backgroundImage.length,r=e.style.border.some((function(e){return 0!==e.borderStyle&&!e.borderColor.isTransparent()})),n=function(){var r=function(e,t){return t===j.BORDER_BOX?function(e){return[e.topLeftOuter,e.topRightOuter,e.bottomRightOuter,e.bottomLeftOuter]}(e):O(e)}(e.curvedBounds,e.style.background.backgroundClip);i&&t.target.clip([r],(function(){e.style.background.backgroundColor.isTransparent()||t.target.fill(e.style.background.backgroundColor),t.renderBackgroundImage(e)})),e.style.border.forEach((function(i,r){0===i.borderStyle||i.borderColor.isTransparent()||t.renderBorder(i,r,e.curvedBounds)}))};if(i||r){var s=e.parent?e.parent.getClipPaths():[];s.length?this.target.clip(s,n):n()}}},{key:"renderBackgroundImage",value:function(e){var t=this;e.style.background.backgroundImage.slice(0).reverse().forEach((function(i){"url"===i.source.method&&i.source.args.length?t.renderBackgroundRepeat(e,i):/gradient/i.test(i.source.method)&&t.renderBackgroundGradient(e,i)}))}},{key:"renderBackgroundRepeat",value:function(e,t){var i=this.options.imageStore.get(t.source.args[0]);if(i){var r=q(e.style.background.backgroundOrigin,e.bounds,e.style.padding,e.style.border),n=function(e,t,i){var r=0,n=0,s=e.size;if(1===s[0].size||2===s[0].size){var a=i.width/i.height,o=t.width/t.height;return a<o!=(2===s[0].size)?new E(i.width,i.width/o):new E(i.height*o,i.height)}return s[0].value&&(r=s[0].value.getAbsoluteValue(i.width)),0===s[0].size&&0===s[1].size?n=t.height:0===s[1].size?n=r/t.width*t.height:s[1].value&&(n=s[1].value.getAbsoluteValue(i.height)),0===s[0].size&&(r=n/t.height*t.width),new E(r,n)}(t,i,r),s=G(t.position,n,r),a=function(e,t,i,r,n){switch(e.repeat){case 2:return[new T(Math.round(n.left),Math.round(r.top+t.y)),new T(Math.round(n.left+n.width),Math.round(r.top+t.y)),new T(Math.round(n.left+n.width),Math.round(i.height+r.top+t.y)),new T(Math.round(n.left),Math.round(i.height+r.top+t.y))];case 3:return[new T(Math.round(r.left+t.x),Math.round(n.top)),new T(Math.round(r.left+t.x+i.width),Math.round(n.top)),new T(Math.round(r.left+t.x+i.width),Math.round(n.height+n.top)),new T(Math.round(r.left+t.x),Math.round(n.height+n.top))];case 1:return[new T(Math.round(r.left+t.x),Math.round(r.top+t.y)),new T(Math.round(r.left+t.x+i.width),Math.round(r.top+t.y)),new T(Math.round(r.left+t.x+i.width),Math.round(r.top+t.y+i.height)),new T(Math.round(r.left+t.x),Math.round(r.top+t.y+i.height))];default:return[new T(Math.round(n.left),Math.round(n.top)),new T(Math.round(n.left+n.width),Math.round(n.top)),new T(Math.round(n.left+n.width),Math.round(n.height+n.top)),new T(Math.round(n.left),Math.round(n.height+n.top))]}}(t,s,n,r,e.bounds),o=Math.round(r.left+s.x),l=Math.round(r.top+s.y);this.target.renderRepeat(a,i,n,o,l)}}},{key:"renderBackgroundGradient",value:function(e,t){var i=q(e.style.background.backgroundOrigin,e.bounds,e.style.padding,e.style.border),r=function(e,t){var i=e.size,r=i[0].value?i[0].value.getAbsoluteValue(t.width):t.width,n=i[1].value?i[1].value.getAbsoluteValue(t.height):i[0].value?r:t.height;return new E(r,n)}(t,i),n=G(t.position,r,i),s=new D(Math.round(i.left+n.x),Math.round(i.top+n.y),r.width,r.height),a=function(e,t,i){var r=t.args,n=t.method,s=t.prefix;return"linear-gradient"===n?Bi(r,i,!!s):"gradient"===n&&"linear"===r[0]?Bi(["to bottom"].concat(ki(r.slice(3))),i,!!s):"radial-gradient"===n?Ci(e,"-webkit-"===s?Li(r):r,i):"gradient"===n&&"radial"===r[0]?Ci(e,ki(Li(r.slice(1))),i):void 0}(e,t.source,s);if(a)switch(a.type){case 0:this.target.renderLinearGradient(s,a);break;case 1:this.target.renderRadialGradient(s,a)}}},{key:"renderBorder",value:function(e,t,i){this.target.drawShape(function(e,t){switch(t){case 0:return P(e.topLeftOuter,e.topLeftInner,e.topRightOuter,e.topRightInner);case 1:return P(e.topRightOuter,e.topRightInner,e.bottomRightOuter,e.bottomRightInner);case 2:return P(e.bottomRightOuter,e.bottomRightInner,e.bottomLeftOuter,e.bottomLeftInner);default:return P(e.bottomLeftOuter,e.bottomLeftInner,e.topLeftOuter,e.topLeftInner)}}(i,t),e.borderColor)}},{key:"renderStack",value:function(e){var t=this;if(e.container.isVisible()){var i=e.getOpacity();i!==this._opacity&&(this.target.setOpacity(e.getOpacity()),this._opacity=i);var r=e.container.style.transform;null!==r?this.target.transform(e.container.bounds.left+r.transformOrigin[0].value,e.container.bounds.top+r.transformOrigin[1].value,r.transform,(function(){return t.renderStackContent(e)})):this.renderStackContent(e)}}},{key:"renderStackContent",value:function(e){var t=Di(Pi(e),5),i=t[0],r=t[1],n=t[2],s=t[3],a=t[4],o=Di(Ui(e),2),l=o[0],h=o[1];this.renderNodeBackgroundAndBorders(e.container),i.sort(Oi).forEach(this.renderStack,this),this.renderNodeContent(e.container),h.forEach(this.renderNode,this),s.forEach(this.renderStack,this),a.forEach(this.renderStack,this),l.forEach(this.renderNode,this),r.forEach(this.renderStack,this),n.sort(Oi).forEach(this.renderStack,this)}},{key:"render",value:function(e){return this.options.backgroundColor&&this.target.rectangle(this.options.x,this.options.y,this.options.width,this.options.height,this.options.backgroundColor),this.renderStack(e),this.target.getTarget()}}]),e}(),Ui=function(e){for(var t=[],i=[],r=e.children.length,n=0;n<r;n++){var s=e.children[n];s.isInlineLevel()?t.push(s):i.push(s)}return[t,i]},Pi=function(e){for(var t=[],i=[],r=[],n=[],s=[],a=e.contexts.length,o=0;o<a;o++){var l=e.contexts[o];l.container.isPositioned()||l.container.style.opacity<1||l.container.isTransformed()?l.container.style.zIndex.order<0?t.push(l):l.container.style.zIndex.order>0?r.push(l):i.push(l):l.container.isFloating()?n.push(l):s.push(l)}return[t,i,r,n,s]},Oi=function(e,t){return e.container.style.zIndex.order>t.container.style.zIndex.order?1:e.container.style.zIndex.order<t.container.style.zIndex.order?-1:e.container.index>t.container.index?1:-1},Ri=function(e,t){if(!t.proxy)return Promise.reject(null);var i=t.proxy;return new Promise((function(r,n){var s=wt.SUPPORT_CORS_XHR&&wt.SUPPORT_RESPONSE_TYPE?"blob":"text",a=wt.SUPPORT_CORS_XHR?new XMLHttpRequest:new XDomainRequest;if(a.onload=function(){if(a instanceof XMLHttpRequest)if(200===a.status)if("text"===s)r(a.response);else{var e=new FileReader;e.addEventListener("load",(function(){return r(e.result)}),!1),e.addEventListener("error",(function(e){return n(e)}),!1),e.readAsDataURL(a.response)}else n("");else r(a.responseText)},a.onerror=n,a.open("GET","".concat(i,"?url=").concat(encodeURIComponent(e),"&responseType=").concat(s)),"text"!==s&&a instanceof XMLHttpRequest&&(a.responseType=s),t.imageTimeout){var o=t.imageTimeout;a.timeout=o,a.ontimeout=function(){return n("")}}a.send()}))};function Qi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hi(e,t,i){return t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}var Mi=function(){function e(t,i,r){Qi(this,e),this.options=t,this._window=r,this.origin=this.getOrigin(r.location.href),this.cache={},this.logger=i,this._index=0}return Hi(e,[{key:"loadImage",value:function(e){var t=this;if(this.hasResourceInCache(e))return e;if(Gi(e))return this.cache[e]=Ji(e,this.options.imageTimeout||0),e;if(!Wi(e)||wt.SUPPORT_SVG_DRAWING){if(!0===this.options.allowTaint||Ki(e)||this.isSameOrigin(e))return this.addImage(e,e,!1);if(!this.isSameOrigin(e)){if("string"==typeof this.options.proxy)return this.cache[e]=Ri(e,this.options).then((function(e){return Ji(e,t.options.imageTimeout||0)})),e;if(!0===this.options.useCORS&&wt.SUPPORT_CORS_IMAGES)return this.addImage(e,e,!0)}}}},{key:"inlineImage",value:function(e){var t=this;return Ki(e)?Ji(e,this.options.imageTimeout||0):this.hasResourceInCache(e)?this.cache[e]:this.isSameOrigin(e)||"string"!=typeof this.options.proxy?this.xhrImage(e):this.cache[e]=Ri(e,this.options).then((function(e){return Ji(e,t.options.imageTimeout||0)}))}},{key:"xhrImage",value:function(e){var t=this;return this.cache[e]=new Promise((function(i,r){var n=new XMLHttpRequest;if(n.onreadystatechange=function(){if(4===n.readyState)if(200!==n.status)r("Failed to fetch image ".concat(e.substring(0,256)," with status code ").concat(n.status));else{var t=new FileReader;t.addEventListener("load",(function(){var e=t.result;i(e)}),!1),t.addEventListener("error",(function(e){return r(e)}),!1),t.readAsDataURL(n.response)}},n.responseType="blob",t.options.imageTimeout){var s=t.options.imageTimeout;n.timeout=s,n.ontimeout=function(){return r("")}}n.open("GET",e,!0),n.send()})).then((function(e){return Ji(e,t.options.imageTimeout||0)})),this.cache[e]}},{key:"loadCanvas",value:function(e){var t=String(this._index++);return this.cache[t]=Promise.resolve(e),t}},{key:"hasResourceInCache",value:function(e){return void 0!==this.cache[e]}},{key:"addImage",value:function(e,t,i){var r=this;return this.cache[e]=new Promise((function(e,n){var s=new Image;if(s.onload=function(){return e(s)},(qi(t)||i)&&(s.crossOrigin="anonymous"),s.onerror=n,s.src=t,!0===s.complete&&setTimeout((function(){e(s)}),500),r.options.imageTimeout){var a=r.options.imageTimeout;setTimeout((function(){return n("")}),a)}})),e}},{key:"isSameOrigin",value:function(e){return this.getOrigin(e)===this.origin}},{key:"getOrigin",value:function(e){var t=this._link||(this._link=this._window.document.createElement("a"));return t.href=e,t.href=t.href,t.protocol+t.hostname+t.port}},{key:"ready",value:function(){var e=this,t=Object.keys(this.cache),i=t.map((function(t){return e.cache[t].catch((function(e){return null}))}));return Promise.all(i).then((function(e){return new _i(t,e)}))}}]),e}(),_i=function(){function e(t,i){Qi(this,e),this._keys=t,this._resources=i}return Hi(e,[{key:"get",value:function(e){var t=this._keys.indexOf(e);return-1===t?null:this._resources[t]}}]),e}(),ji=/^data:image\/svg\+xml/i,zi=/^data:image\/.*;base64,/i,Vi=/^data:image\/.*/i,Ki=function(e){return Vi.test(e)},qi=function(e){return zi.test(e)},Gi=function(e){return"blob"===e.substr(0,4)},Wi=function(e){return"svg"===e.substr(-3).toLowerCase()||ji.test(e)},Ji=function(e,t){return new Promise((function(i,r){var n=new Image;n.onload=function(){return i(n)},n.onerror=r,n.src=e,!0===n.complete&&setTimeout((function(){i(n)}),500),t&&setTimeout((function(){return r("")}),t)}))};function Xi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=[],r=!0,n=!1,s=void 0;try{for(var a,o=e[Symbol.iterator]();!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){n=!0,s=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw s}}return i}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Yi=function(e,t,i){if(!t||!t.content||"none"===t.content||"-moz-alt-content"===t.content||"none"===t.display)return null;var r=$i(t.content),n=r.length,s=[],a="",o=t.counterIncrement;if(o&&"none"!==o){var l=Xi(o.split(/\s+/),2),h=l[0],c=l[1],d=i.counters[h];d&&(d[d.length-1]+=void 0===c?1:parseInt(c,10))}for(var u=0;u<n;u++){var A=r[u];switch(A.type){case 0:a+=A.value||"";break;case 1:e instanceof HTMLElement&&A.value&&(a+=e.getAttribute(A.value)||"");break;case 3:var p=i.counters[A.name||""];p&&(a+=tr([p[p.length-1]],"",A.format));break;case 4:var f=i.counters[A.name||""];f&&(a+=tr(f,A.glue,A.format));break;case 5:a+=er(t,!0,i.quoteDepth),i.quoteDepth++;break;case 6:i.quoteDepth--,a+=er(t,!1,i.quoteDepth);break;case 2:a&&(s.push({type:0,value:a}),a=""),s.push({type:1,value:A.value||""})}}return a&&s.push({type:0,value:a}),s},$i=function(e,t){for(var i=[],r=e.length,n=!1,s=!1,a=!1,o="",l="",h=[],c=0;c<r;c++){var d=e.charAt(c);switch(d){case"'":case'"':s?o+=d:(n=!n,a||n||(i.push({type:0,value:o}),o=""));break;case"\\":s?(o+=d,s=!1):s=!0;break;case"(":n?o+=d:(a=!0,l=o,o="",h=[]);break;case")":if(n)o+=d;else if(a){switch(o&&h.push(o),l){case"attr":h.length>0&&i.push({type:1,value:h[0]});break;case"counter":if(h.length>0){var u={type:3,name:h[0]};h.length>1&&(u.format=h[1]),i.push(u)}break;case"counters":if(h.length>0){var A={type:4,name:h[0]};h.length>1&&(A.glue=h[1]),h.length>2&&(A.format=h[2]),i.push(A)}break;case"url":h.length>0&&i.push({type:2,value:h[0]})}a=!1,o=""}break;case",":n?o+=d:a&&(h.push(o),o="");break;case" ":case"\t":n?o+=d:o&&(Zi(i,o),o="");break;default:o+=d}"\\"!==d&&(s=!1)}return o&&Zi(i,o),i},Zi=function(e,t){switch(t){case"open-quote":e.push({type:5});break;case"close-quote":e.push({type:6})}},er=function(e,t,i){var r=e.quotes?e.quotes.split(/\s+/):["'\"'","'\"'"],n=2*i;return n>=r.length&&(n=r.length-2),t||++n,r[n].replace(/^["']|["']$/g,"")},tr=function(e,t,i){for(var r=e.length,n="",s=0;s<r;s++)s>0&&(n+=t||""),n+=ri(e[s],Me(i||"decimal"),!1);return n},ir=function(){function e(t,i,r,n,s){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.referenceElement=t,this.scrolledElements=[],this.copyStyles=n,this.inlineImages=n,this.logger=r,this.options=i,this.renderer=s,this.resourceLoader=new Mi(i,r,window),this.pseudoContentData={counters:{},quoteDepth:0},this.documentElement=this.cloneNode(t.ownerDocument.documentElement)}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"inlineAllImages",value:function(e){var t=this;if(this.inlineImages&&e){var i=e.style;Promise.all(ee(i.backgroundImage).map((function(e){return"url"===e.method?t.resourceLoader.inlineImage(e.args[0]).then((function(e){return e&&"string"==typeof e.src?'url("'.concat(e.src,'")'):"none"})).catch((function(e){})):Promise.resolve("".concat(e.prefix).concat(e.method,"(").concat(e.args.join(","),")"))}))).then((function(e){e.length>1&&(i.backgroundColor=""),i.backgroundImage=e.join(",")})),e instanceof HTMLImageElement&&this.resourceLoader.inlineImage(e.src).then((function(t){if(t&&e instanceof HTMLImageElement&&e.parentNode){var i=e.parentNode,r=B(e.style,t.cloneNode(!1));i.replaceChild(r,e)}})).catch((function(e){}))}}},{key:"inlineFonts",value:function(e){var t=this;return Promise.all(Array.from(e.styleSheets).map((function(t){return t.href?fetch(t.href).then((function(e){return e.text()})).then((function(e){return nr(e,t.href)})).catch((function(e){return[]})):rr(t,e)}))).then((function(e){return e.reduce((function(e,t){return e.concat(t)}),[])})).then((function(e){return Promise.all(e.map((function(e){return fetch(e.formats[0].src).then((function(e){return e.blob()})).then((function(e){return new Promise((function(t,i){var r=new FileReader;r.onerror=i,r.onload=function(){var e=r.result;t(e)},r.readAsDataURL(e)}))})).then((function(t){return e.fontFace.setProperty("src",'url("'.concat(t,'")')),"@font-face {".concat(e.fontFace.cssText," ")}))})))})).then((function(i){var r=e.createElement("style");r.textContent=i.join("\n"),t.documentElement.appendChild(r)}))}},{key:"createElementClone",value:function(e){var t=this;if(this.copyStyles&&e instanceof HTMLCanvasElement){var i=e.ownerDocument.createElement("img");try{return i.src=e.toDataURL(),i}catch(e){}}if(e instanceof HTMLIFrameElement){var r=e.cloneNode(!1),n=pr();r.setAttribute("data-html2canvas-internal-iframe-key",n);var s=I(e,0,0),a=s.width,o=s.height;return this.resourceLoader.cache[n]=gr(e,this.options).then((function(e){return t.renderer(e,{allowTaint:t.options.allowTaint,backgroundColor:"#ffffff",canvas:null,imageTimeout:t.options.imageTimeout,logging:t.options.logging,proxy:t.options.proxy,removeContainer:t.options.removeContainer,scale:t.options.scale,foreignObjectRendering:t.options.foreignObjectRendering,useCORS:t.options.useCORS,target:new w,width:a,height:o,x:0,y:0,windowWidth:e.ownerDocument.defaultView.innerWidth,windowHeight:e.ownerDocument.defaultView.innerHeight,scrollX:e.ownerDocument.defaultView.pageXOffset,scrollY:e.ownerDocument.defaultView.pageYOffset},t.logger.child(n))})).then((function(t){return new Promise((function(i,n){var s=document.createElement("img");s.onload=function(){return i(t)},s.onerror=function(e){"data:,"==s.src?i(t):n(e)},s.src=t.toDataURL(),r.parentNode&&r.parentNode.replaceChild(B(e.ownerDocument.defaultView.getComputedStyle(e),s),r)}))})),r}try{if(e instanceof HTMLStyleElement&&e.sheet&&e.sheet.cssRules){var l=[].slice.call(e.sheet.cssRules,0).reduce((function(e,t){return t&&t.cssText?e+t.cssText:e}),""),h=e.cloneNode(!1);return h.textContent=l,h}}catch(e){if(this.logger.log("Unable to access cssRules property"),"SecurityError"!==e.name)throw this.logger.log(e),e}return e.cloneNode(!1)}},{key:"cloneNode",value:function(e){var t=e.nodeType===Node.TEXT_NODE?document.createTextNode(e.nodeValue):this.createElementClone(e),i=e.ownerDocument.defaultView,r=e instanceof i.HTMLElement?i.getComputedStyle(e):null,n=e instanceof i.HTMLElement?i.getComputedStyle(e,":before"):null,s=e instanceof i.HTMLElement?i.getComputedStyle(e,":after"):null;this.referenceElement===e&&t instanceof i.HTMLElement&&(this.clonedReferenceElement=t),t instanceof i.HTMLBodyElement&&dr(t);for(var a=function(e,t){if(!e||!e.counterReset||"none"===e.counterReset)return[];for(var i=[],r=e.counterReset.split(/\s*,\s*/),n=r.length,s=0;s<n;s++){var a=Xi(r[s].split(/\s+/),2),o=a[0],l=a[1];i.push(o);var h=t.counters[o];h||(h=t.counters[o]=[]),h.push(parseInt(l||0,10))}return i}(r,this.pseudoContentData),o=Yi(e,n,this.pseudoContentData),l=e.firstChild;l;l=l.nextSibling)l.nodeType===Node.ELEMENT_NODE&&("SCRIPT"===l.nodeName||l.hasAttribute("data-html2canvas-ignore")||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(l))||this.copyStyles&&"STYLE"===l.nodeName||t.appendChild(this.cloneNode(l));var h=Yi(e,s,this.pseudoContentData);if(function(e,t){for(var i=e.length,r=0;r<i;r++)t.counters[e[r]].pop()}(a,this.pseudoContentData),e instanceof i.HTMLElement&&t instanceof i.HTMLElement)switch(n&&this.inlineAllImages(ar(e,t,n,o,or)),s&&this.inlineAllImages(ar(e,t,s,h,lr)),!r||!this.copyStyles||e instanceof HTMLIFrameElement||B(r,t),this.inlineAllImages(t),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([t,e.scrollLeft,e.scrollTop]),e.nodeName){case"CANVAS":this.copyStyles||sr(e,t);break;case"TEXTAREA":case"SELECT":t.value=e.value}return t}}]),e}(),rr=function(e,t){return(e.cssRules?Array.from(e.cssRules):[]).filter((function(e){return e.type===CSSRule.FONT_FACE_RULE})).map((function(e){for(var i=ee(e.style.getPropertyValue("src")),r=[],n=0;n<i.length;n++)if("url"===i[n].method&&i[n+1]&&"format"===i[n+1].method){var s=t.createElement("a");s.href=i[n].args[0],t.body&&t.body.appendChild(s);var a={src:s.href,format:i[n+1].args[0]};r.push(a)}return{formats:r.filter((function(e){return/^woff/i.test(e.format)})),fontFace:e.style}})).filter((function(e){return e.formats.length}))},nr=function(e,t){var i=document.implementation.createHTMLDocument(""),r=document.createElement("base");r.href=t;var n=document.createElement("style");return n.textContent=e,i.head&&i.head.appendChild(r),i.body&&i.body.appendChild(n),n.sheet?rr(n.sheet,i):[]},sr=function(e,t){try{if(t){t.width=e.width,t.height=e.height;var i=e.getContext("2d"),r=t.getContext("2d");i?r.putImageData(i.getImageData(0,0,e.width,e.height),0,0):r.drawImage(e,0,0)}}catch(e){}},ar=function(e,t,i,r,n){if(i&&i.content&&"none"!==i.content&&"-moz-alt-content"!==i.content&&"none"!==i.display){var s=t.ownerDocument.createElement("html2canvaspseudoelement");if(B(i,s),r)for(var a=r.length,o=0;o<a;o++){var l=r[o];switch(l.type){case 1:var h=t.ownerDocument.createElement("img");h.src=ee("url(".concat(l.value,")"))[0].args[0],h.style.opacity="1",s.appendChild(h);break;case 0:s.appendChild(t.ownerDocument.createTextNode(l.value))}}return s.className="".concat(hr," ").concat(cr),t.className+=" ".concat(n===or?hr:cr),n===or?t.insertBefore(s,t.firstChild):t.appendChild(s),s}},or=":before",lr=":after",hr="___html2canvas___pseudoelement_before",cr="___html2canvas___pseudoelement_after",dr=function(e){ur(e,".".concat(hr).concat(or).concat('{\n content: "" !important;\n display: none !important;\n}',"\n .").concat(cr).concat(lr).concat('{\n content: "" !important;\n display: none !important;\n}'))},ur=function(e,t){var i=e.ownerDocument.createElement("style");i.innerHTML=t,e.appendChild(i)},Ar=function(e){var t=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t=[],i=!0,r=!1,n=void 0;try{for(var s,a=e[Symbol.iterator]();!(i=(s=a.next()).done)&&(t.push(s.value),3!==t.length);i=!0);}catch(e){r=!0,n=e}finally{try{i||null==a.return||a.return()}finally{if(r)throw n}}return t}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(e),i=t[0],r=t[1],n=t[2];i.scrollLeft=r,i.scrollTop=n},pr=function(){return Math.ceil(Date.now()+1e7*Math.random()).toString(16)},fr=/^data:text\/(.+);(base64)?,(.*)$/i,gr=function(e,t){try{return Promise.resolve(e.contentWindow.document.documentElement)}catch(i){return t.proxy?Ri(e.src,t).then((function(e){var t=e.match(fr);return t?"base64"===t[2]?window.atob(decodeURIComponent(t[3])):decodeURIComponent(t[3]):Promise.reject()})).then((function(t){return mr(e.ownerDocument,I(e,0,0)).then((function(e){var i=e.contentWindow.document;i.open(),i.write(t);var r=wr(e).then((function(){return i.documentElement}));return i.close(),r}))})):Promise.reject()}},mr=function(e,t){var i=e.createElement("iframe");return i.className="html2canvas-container",i.style.visibility="hidden",i.style.position="fixed",i.style.left="-10000px",i.style.top="0px",i.style.border="0",i.width=t.width.toString(),i.height=t.height.toString(),i.scrolling="no",i.setAttribute("data-html2canvas-ignore","true"),e.body?(e.body.appendChild(i),Promise.resolve(i)):Promise.reject("")},wr=function(e){var t=e.contentWindow,i=t.document;return new Promise((function(r,n){t.onload=e.onload=i.onreadystatechange=function(){var t=setInterval((function(){i.body.childNodes.length>0&&"complete"===i.readyState&&(clearInterval(t),r(e))}),50)}}))},br=function e(t,i,r){var n=t.ownerDocument,s=new D(i.scrollX,i.scrollY,i.windowWidth,i.windowHeight),a=n.documentElement?new u(getComputedStyle(n.documentElement).backgroundColor):p,o=n.body?new u(getComputedStyle(n.body).backgroundColor):p,l=t===n.documentElement?a.isTransparent()?o.isTransparent()?i.backgroundColor?new u(i.backgroundColor):null:o:a:i.backgroundColor?new u(i.backgroundColor):null;return(i.foreignObjectRendering?wt.SUPPORT_FOREIGNOBJECT_DRAWING:Promise.resolve(!1)).then((function(a){return a?function(e){return e.inlineFonts(n).then((function(){return e.resourceLoader.ready()})).then((function(){var s=new At(e.documentElement),a=n.defaultView,o=a.pageXOffset,h=a.pageYOffset,c="HTML"===t.tagName||"BODY"===t.tagName?U(n):I(t,o,h),d=c.width,u=c.height,A=c.left,p=c.top;return s.render({backgroundColor:l,logger:r,scale:i.scale,x:"number"==typeof i.x?i.x:A,y:"number"==typeof i.y?i.y:p,width:"number"==typeof i.width?i.width:Math.ceil(d),height:"number"==typeof i.height?i.height:Math.ceil(u),windowWidth:i.windowWidth,windowHeight:i.windowHeight,scrollX:i.scrollX,scrollY:i.scrollY})}))}(new ir(t,i,r,!0,e)):function(e,t,i,r,n,s){var a=new ir(i,r,n,!1,s),o=e.defaultView.pageXOffset,l=e.defaultView.pageYOffset;return mr(e,t).then((function(n){var s=n.contentWindow,h=s.document,c=wr(n).then((function(){a.scrolledElements.forEach(Ar),s.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===t.top&&s.scrollX===t.left||(h.documentElement.style.top=-t.top+"px",h.documentElement.style.left=-t.left+"px",h.documentElement.style.position="absolute");var i=Promise.resolve([n,a.clonedReferenceElement,a.resourceLoader]),o=r.onclone;return a.clonedReferenceElement instanceof s.HTMLElement||a.clonedReferenceElement instanceof e.defaultView.HTMLElement||a.clonedReferenceElement instanceof HTMLElement?"function"==typeof o?Promise.resolve().then((function(){return o(h)})).then((function(){return i})):i:Promise.reject("")}));return h.open(),h.write("".concat(function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'.concat(e.publicId,'"')),e.systemId&&(t+='"'.concat(e.systemId,'"')),t+=">"),t}(document.doctype),"<html></html>")),function(e,t,i){!e.defaultView||t===e.defaultView.pageXOffset&&i===e.defaultView.pageYOffset||e.defaultView.scrollTo(t,i)}(i.ownerDocument,o,l),h.replaceChild(h.adoptNode(a.documentElement),h.documentElement),h.close(),c}))}(n,s,t,i,r,e).then((function(e){var t=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t=[],i=!0,r=!1,n=void 0;try{for(var s,a=e[Symbol.iterator]();!(i=(s=a.next()).done)&&(t.push(s.value),3!==t.length);i=!0);}catch(e){r=!0,n=e}finally{try{i||null==a.return||a.return()}finally{if(r)throw n}}return t}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(e),s=t[0],a=t[1],o=t[2],h=function(e,t){var i=0,r=new si(e,null,t,i++),n=new oi(r,null,!0);return function e(t,i,r,n,s){for(var a,o=t.firstChild;o;o=a){a=o.nextSibling;var l=o.ownerDocument.defaultView;if(o instanceof l.Text||o instanceof Text||l.parent&&o instanceof l.parent.Text)o.data.trim().length>0&&i.childNodes.push(Ct.fromTextNode(o,i));else if(o instanceof l.HTMLElement||o instanceof HTMLElement||l.parent&&o instanceof l.parent.HTMLElement){if(-1===li.indexOf(o.nodeName)){var h=new si(o,i,n,s++);if(h.isVisible()){"INPUT"===o.tagName?_t(o,h):"TEXTAREA"===o.tagName?jt(o,h):"SELECT"===o.tagName?zt(o,h):h.style.listStyle&&-1!==h.style.listStyle.listStyleType&&Gt(o,h,n);var c="TEXTAREA"!==o.tagName,d=hi(h,o);if(d||ci(h)){var u=d||h.isPositioned()?r.getRealParentStackingContext():r,A=new oi(h,u,d);u.contexts.push(A),c&&e(o,h,A,n,s)}else r.children.push(h),c&&e(o,h,r,n,s)}}}else if(o instanceof l.SVGSVGElement||o instanceof SVGSVGElement||l.parent&&o instanceof l.parent.SVGSVGElement){var p=new si(o,i,n,s++),f=hi(p,o);if(f||ci(p)){var g=f||p.isPositioned()?r.getRealParentStackingContext():r,m=new oi(p,g,f);g.contexts.push(m)}else r.children.push(p)}}}(e,r,n,t,1),n}(a,o),c=a.ownerDocument;return l===h.container.style.background.backgroundColor&&(h.container.style.background.backgroundColor=p),o.ready().then((function(e){var t=new ui(c),o=c.defaultView,d=o.pageXOffset,u=o.pageYOffset,A="HTML"===a.tagName||"BODY"===a.tagName?U(n):I(a,d,u),p=A.width,f=A.height,g=A.left,m=A.top,w={backgroundColor:l,fontMetrics:t,imageStore:e,logger:r,scale:i.scale,x:"number"==typeof i.x?i.x:g,y:"number"==typeof i.y?i.y:m,width:"number"==typeof i.width?i.width:Math.ceil(p),height:"number"==typeof i.height?i.height:Math.ceil(f)};if(Array.isArray(i.target))return Promise.all(i.target.map((function(e){return new Ii(e,w).render(h)})));var b=new Ii(i.target,w).render(h);return!0===i.removeContainer&&s.parentNode&&s.parentNode.removeChild(s),b}))}))}))};function vr(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var yr=function(e,t){var i=t||{},r=new b("boolean"!=typeof i.logging||i.logging);r.log("html2canvas ".concat("1.0.0-rc.1"));var n=e.ownerDocument;if(!n)return Promise.reject("Provided element is not within a Document");var s=n.defaultView,a={allowTaint:!1,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,scale:s.devicePixelRatio||1,target:new w(i.canvas),useCORS:!1,windowWidth:s.innerWidth,windowHeight:s.innerHeight,scrollX:s.pageXOffset,scrollY:s.pageYOffset};return br(e,function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},r=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(i).filter((function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable})))),r.forEach((function(t){vr(e,t,i[t])}))}return e}({},a,i),r)};yr.CanvasRenderer=w,t.default=yr}]).default},window.html2canvas=r(),e.exports=r();
|
|
132
132
|
/** @license JSZip v3.1.5 | Copyright (c) 2009-2016 Stuart Knightley <stuart@stuartk.com> [https://stuk.github.io/jszip/] | MIT License [https://raw.github.com/Stuk/jszip/master/LICENSE.markdown] */
|
|
133
|
-
var s="undefined",a=null,o=!1,l=function(e,t){this.files={},this.root="",e&&this.load(e,t)};l.signature={LOCAL_FILE_HEADER:"PK",CENTRAL_FILE_HEADER:"PK",CENTRAL_DIRECTORY_END:"PK",ZIP64_CENTRAL_DIRECTORY_LOCATOR:"PK",ZIP64_CENTRAL_DIRECTORY_END:"PK",DATA_DESCRIPTOR:"PK\b"},l.defaults={base64:o,binary:o,dir:o,date:a,compression:a},l.support={arraybuffer:typeof ArrayBuffer!==s&&typeof Uint8Array!==s,nodebuffer:!0,uint8array:typeof Uint8Array!==s,blob:function(){if(typeof ArrayBuffer===s)return o;var e=new ArrayBuffer(0);try{return 0===new Blob([e],{type:"application/zip"}).size}catch(e){}try{var t=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);return t.append(e),0===t.getBlob("application/zip").size}catch(e){}return o}()},l.prototype=function(){var e,t;l.support.uint8array&&"function"==typeof TextEncoder&&"function"==typeof TextDecoder&&(e=new TextEncoder("utf-8"),t=new TextDecoder("utf-8"));var i=function(e){if(e._data instanceof l.CompressedObject&&(e._data=e._data.getContent(),e.options.binary=!0,e.options.base64=!1,"uint8array"===l.utils.getTypeOf(e._data))){var t=e._data;e._data=new Uint8Array(t.length),0!==t.length&&e._data.set(t,0)}return e._data},r=function(t){var r=i(t);if("string"===l.utils.getTypeOf(r)){if(!t.options.binary){if(e)return e.encode(r);if(l.support.nodebuffer)return new vn(r,"utf-8")}return t.asBinary()}return r},n=function(e){var t=i(this);return null==t?"":(this.options.base64&&(t=l.base64.decode(t)),t=e&&this.options.binary?l.prototype.utf8decode(t):l.utils.transformTo("string",t),e||this.options.binary||(t=l.prototype.utf8encode(t)),t)},s=function(e,t,i){this.name=e,this._data=t,this.options=i};s.prototype={asText:function(){return n.call(this,!0)},asBinary:function(){return n.call(this,!1)},asNodeBuffer:function(){var e=r(this);return l.utils.transformTo("nodebuffer",e)},asUint8Array:function(){var e=r(this);return l.utils.transformTo("uint8array",e)},asArrayBuffer:function(){return this.asUint8Array().buffer}};var a=function(e,t){var i,r="";for(i=0;i<t;i++)r+=String.fromCharCode(255&e),e>>>=8;return r},o=function(){var e,t,i={};for(e=0;e<arguments.length;e++)for(t in arguments[e])arguments[e].hasOwnProperty(t)&&void 0===i[t]&&(i[t]=arguments[e][t]);return i},h=function(e,t,i){var r=c(e),n=l.utils.getTypeOf(t);if(r&&d.call(this,r),i=function(e){return!0===(e=e||{}).base64&&null==e.binary&&(e.binary=!0),(e=o(e,l.defaults)).date=e.date||new Date,null!==e.compression&&(e.compression=e.compression.toUpperCase()),e}(i),i.dir||null==t)i.base64=!1,i.binary=!1,t=null;else if("string"===n)i.binary&&!i.base64&&!0!==i.optimizedBinaryString&&(t=l.utils.string2binary(t));else{if(i.base64=!1,i.binary=!0,!(n||t instanceof l.CompressedObject))throw new Error("The data of '"+e+"' is in an unsupported format !");"arraybuffer"===n&&(t=l.utils.transformTo("uint8array",t))}return this.files[e]=new s(e,t,i)},c=function(e){"/"==e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},d=function(e){return"/"!=e.slice(-1)&&(e+="/"),this.files[e]||h.call(this,e,null,{dir:!0}),this.files[e]},u=function(e,t){var i,n=new l.CompressedObject;return e._data instanceof l.CompressedObject?(n.uncompressedSize=e._data.uncompressedSize,n.crc32=e._data.crc32,0===n.uncompressedSize||e.options.dir?(t=l.compressions.STORE,n.compressedContent="",n.crc32=0):e._data.compressionMethod===t.magic?n.compressedContent=e._data.getCompressedContent():(i=e._data.getContent(),n.compressedContent=t.compress(l.utils.transformTo(t.compressInputType,i)))):((i=r(e))&&0!==i.length&&!e.options.dir||(t=l.compressions.STORE,i=""),n.uncompressedSize=i.length,n.crc32=this.crc32(i),n.compressedContent=t.compress(l.utils.transformTo(t.compressInputType,i))),n.compressedSize=n.compressedContent.length,n.compressionMethod=t.magic,n},A=function(e,t,i,r){i.compressedContent;var n,s,o=this.utf8encode(t.name),h=o!==t.name,c=t.options;n=c.date.getHours(),n<<=6,n|=c.date.getMinutes(),n<<=5,n|=c.date.getSeconds()/2,s=c.date.getFullYear()-1980,s<<=4,s|=c.date.getMonth()+1,s<<=5,s|=c.date.getDate();var d="";return d+="\n\0",d+=h?"\0\b":"\0\0",d+=i.compressionMethod,d+=a(n,2),d+=a(s,2),d+=a(i.crc32,4),d+=a(i.compressedSize,4),d+=a(i.uncompressedSize,4),d+=a(o.length,2),d+="\0\0",{fileRecord:l.signature.LOCAL_FILE_HEADER+d+o,dirRecord:l.signature.CENTRAL_FILE_HEADER+"\0"+d+"\0\0\0\0\0\0"+(!0===t.options.dir?"\0\0\0":"\0\0\0\0")+a(r,4)+o,compressedObject:i}},p=function(){this.data=[]};p.prototype={append:function(e){e=l.utils.transformTo("string",e),this.data.push(e)},finalize:function(){return this.data.join("")}};var f=function(e){this.data=new Uint8Array(e),this.index=0};return f.prototype={append:function(e){0!==e.length&&(e=l.utils.transformTo("uint8array",e),this.data.set(e,this.index),this.index+=e.length)},finalize:function(){return this.data}},{load:function(e,t){throw new Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(e){var t,i,r,n,a=[];for(t in this.files)this.files.hasOwnProperty(t)&&(r=this.files[t],n=new s(r.name,r._data,o(r.options)),i=t.slice(this.root.length,t.length),t.slice(0,this.root.length)===this.root&&e(i,n)&&a.push(n));return a},file:function(e,t,i){if(1===arguments.length){if(l.utils.isRegExp(e)){var r=e;return this.filter((function(e,t){return!t.options.dir&&r.test(e)}))}return this.filter((function(t,i){return!i.options.dir&&t===e}))[0]||null}return e=this.root+e,h.call(this,e,t,i),this},folder:function(e){if(!e)return this;if(l.utils.isRegExp(e))return this.filter((function(t,i){return i.options.dir&&e.test(t)}));var t=this.root+e,i=d.call(this,t),r=this.clone();return r.root=i.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!=e.slice(-1)&&(e+="/"),t=this.files[e]),t)if(t.options.dir)for(var i=this.filter((function(t,i){return i.name.slice(0,e.length)===e})),r=0;r<i.length;r++)delete this.files[i[r].name];else delete this.files[e];return this},generate:function(e){e=o(e||{},{base64:!0,compression:"STORE",type:"base64"}),l.utils.checkSupport(e.type);var t,i,r=[],n=0,s=0;for(var h in this.files)if(this.files.hasOwnProperty(h)){var c=this.files[h],d=c.options.compression||e.compression.toUpperCase(),g=l.compressions[d];if(!g)throw new Error(d+" is not a valid compression method !");var m=u.call(this,c,g),w=A.call(this,h,c,m,n);n+=w.fileRecord.length+m.compressedSize,s+=w.dirRecord.length,r.push(w)}var b;switch(b=l.signature.CENTRAL_DIRECTORY_END+"\0\0\0\0"+a(r.length,2)+a(r.length,2)+a(s,4)+a(n,4)+"\0\0",e.type.toLowerCase()){case"uint8array":case"arraybuffer":case"blob":case"nodebuffer":t=new f(n+s+b.length);break;default:t=new p(n+s+b.length)}for(i=0;i<r.length;i++)t.append(r[i].fileRecord),t.append(r[i].compressedObject.compressedContent);for(i=0;i<r.length;i++)t.append(r[i].dirRecord);t.append(b);var v=t.finalize();switch(e.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":return l.utils.transformTo(e.type.toLowerCase(),v);case"blob":return l.utils.arrayBuffer2Blob(l.utils.transformTo("arraybuffer",v));case"base64":return e.base64?l.base64.encode(v):v;default:return v}},crc32:function(e,t){if(void 0===e||!e.length)return 0;var i="string"!==l.utils.getTypeOf(e),r=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];void 0===t&&(t=0);t^=-1;for(var n=0,s=e.length;n<s;n++)t=t>>>8^r[255&(t^(i?e[n]:e.charCodeAt(n)))];return-1^t},clone:function(){var e=new l;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e},utf8encode:function(t){if(e){var i=e.encode(t);return l.utils.transformTo("string",i)}if(l.support.nodebuffer)return l.utils.transformTo("string",new vn(t,"utf-8"));for(var r=[],n=0,s=0;s<t.length;s++){var a=t.charCodeAt(s);a<128?r[n++]=String.fromCharCode(a):a>127&&a<2048?(r[n++]=String.fromCharCode(a>>6|192),r[n++]=String.fromCharCode(63&a|128)):(r[n++]=String.fromCharCode(a>>12|224),r[n++]=String.fromCharCode(a>>6&63|128),r[n++]=String.fromCharCode(63&a|128))}return r.join("")},utf8decode:function(e){var i=[],r=0,n="string"!==l.utils.getTypeOf(e),s=0,a=0,o=0,h=0;if(t)return t.decode(l.utils.transformTo("uint8array",e));if(l.support.nodebuffer)return l.utils.transformTo("nodebuffer",e).toString("utf-8");for(;s<e.length;)(a=n?e[s]:e.charCodeAt(s))<128?(i[r++]=String.fromCharCode(a),s++):a>191&&a<224?(o=n?e[s+1]:e.charCodeAt(s+1),i[r++]=String.fromCharCode((31&a)<<6|63&o),s+=2):(o=n?e[s+1]:e.charCodeAt(s+1),h=n?e[s+2]:e.charCodeAt(s+2),i[r++]=String.fromCharCode((15&a)<<12|(63&o)<<6|63&h),s+=3);return i.join("")}}}(),l.compressions={STORE:{magic:"\0\0",compress:function(e){return e},uncompress:function(e){return e},compressInputType:a,uncompressInputType:a}},function(){function e(e){return e}function t(e,t){for(var i=0;i<e.length;++i)t[i]=255&e.charCodeAt(i);return t}function i(e){var t=65536,i=[],r=e.length,n=l.utils.getTypeOf(e),s=0,a=!0;try{switch(n){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,new vn(0))}}catch(e){a=!1}if(!a){for(var o="",h=0;h<e.length;h++)o+=String.fromCharCode(e[h]);return o}for(;s<r&&t>1;)try{"array"===n||"nodebuffer"===n?i.push(String.fromCharCode.apply(null,e.slice(s,Math.min(s+t,r)))):i.push(String.fromCharCode.apply(null,e.subarray(s,Math.min(s+t,r)))),s+=t}catch(e){t=Math.floor(t/2)}return i.join("")}function r(e,t){for(var i=0;i<e.length;i++)t[i]=e[i];return t}l.utils={string2binary:function(e){for(var t="",i=0;i<e.length;i++)t+=String.fromCharCode(255&e.charCodeAt(i));return t},string2Uint8Array:function(e){return l.utils.transformTo("uint8array",e)},uint8Array2String:function(e){return l.utils.transformTo("string",e)},arrayBuffer2Blob:function(e){l.utils.checkSupport("blob");try{return new Blob([e],{type:"application/zip"})}catch(e){}try{var t=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);return t.append(e),t.getBlob("application/zip")}catch(e){}throw new Error("Bug : can't construct the Blob.")},string2Blob:function(e){var t=l.utils.transformTo("arraybuffer",e);return l.utils.arrayBuffer2Blob(t)}};var n={};n.string={string:e,array:function(e){return t(e,new Array(e.length))},arraybuffer:function(e){return n.string.uint8array(e).buffer},uint8array:function(e){return t(e,new Uint8Array(e.length))},nodebuffer:function(e){return t(e,new vn(e.length))}},n.array={string:i,array:e,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return new vn(e)}},n.arraybuffer={string:function(e){return i(new Uint8Array(e))},array:function(e){return r(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:e,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return new vn(new Uint8Array(e))}},n.uint8array={string:i,array:function(e){return r(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:e,nodebuffer:function(e){return new vn(e)}},n.nodebuffer={string:i,array:function(e){return r(e,new Array(e.length))},arraybuffer:function(e){return n.nodebuffer.uint8array(e).buffer},uint8array:function(e){return r(e,new Uint8Array(e.length))},nodebuffer:e},l.utils.transformTo=function(e,t){if(t||(t=""),!e)return t;l.utils.checkSupport(e);var i=l.utils.getTypeOf(t);return n[i][e](t)},l.utils.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":l.support.nodebuffer&&vn.isBuffer(e)?"nodebuffer":l.support.uint8array&&e instanceof Uint8Array?"uint8array":l.support.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},l.utils.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},l.utils.checkSupport=function(e){var t=!0;switch(e.toLowerCase()){case"uint8array":t=l.support.uint8array;break;case"arraybuffer":t=l.support.arraybuffer;break;case"nodebuffer":t=l.support.nodebuffer;break;case"blob":t=l.support.blob}if(!t)throw new Error(e+" is not supported by this browser")}}(),l.CompressedObject=function(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=a,this.compressedContent=a},l.CompressedObject.prototype={getContent:function(){return a},getCompressedContent:function(){return a}},l.base64=function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return{encode:function(t,i){for(var r,n,s,a,o,l,h,c="",d=0;d<t.length;)a=(r=t.charCodeAt(d++))>>2,o=(3&r)<<4|(n=t.charCodeAt(d++))>>4,l=(15&n)<<2|(s=t.charCodeAt(d++))>>6,h=63&s,isNaN(n)?l=h=64:isNaN(s)&&(h=64),c=c+e.charAt(a)+e.charAt(o)+e.charAt(l)+e.charAt(h);return c},decode:function(t,i){var r,n,s,a,o,l,h="",c=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<t.length;)r=e.indexOf(t.charAt(c++))<<2|(a=e.indexOf(t.charAt(c++)))>>4,n=(15&a)<<4|(o=e.indexOf(t.charAt(c++)))>>2,s=(3&o)<<6|(l=e.indexOf(t.charAt(c++))),h+=String.fromCharCode(r),64!=o&&(h+=String.fromCharCode(n)),64!=l&&(h+=String.fromCharCode(s));return h}}}(),void 0!==window.jQuery&&(window.jQuery.fn.webdatarocks=function(e){return(e=e||{}).container=this.get(0),e=window.WebDataRocks?window.WebDataRocks(e):window.PivotApi(e),this.data("webdatarocks",e),e}),void 0!==window.angular&&window.angular.module("webdatarocks",[]).directive("wbrPivot",(function(){return{restrict:"A",scope:{report:"=wbrReport",customizeCell:"&wbrCustomizeCell",cellclick:"&wbrCellClick",celldoubleclick:"&wbrCellDoubleClick",dataerror:"&wbrDataError",datafilecancelled:"&wbrDataFileCancelled",dataloaded:"&wbrDataLoaded",datachanged:"&wbrDataChanged",fieldslistclose:"&wbrFieldsListClose",fieldslistopen:"&wbrFieldsListOpen",filteropen:"&wbrFilteropen",fullscreen:"&wbrFullscreen",loadingdata:"&wbrLoadingData",loadinglocalization:"&wbrLoadingLocalization",loadingolapstructure:"&wbrLoadingOlapStructure",loadingreportfile:"&wbrLoadingReportFile",localizationerror:"&wbrLocalizationError",localizationloaded:"&wbrLocalizationLoaded",openingreportfile:"&wbrOpeningReportFile",querycomplete:"&wbrQueryComplete",queryerror:"&wbrQueryError",ready:"&wbrReady",reportchange:"&wbrReportChange",reportcomplete:"&wbrReportComplete",reportfilecancelled:"&wbrReportFileCancelled",reportfileerror:"&wbrReportFileError",reportfileloaded:"&wbrReportFileLoaded",runningquery:"&wbrRunningQuery",update:"&wbrUpdate",beforetoolbarcreated:"&wbrBeforeToolbarCreated"},link:function(e,t,i,r){(r={}).container=t[0],function(e,t){void 0!==e.wbrGlobal&&(t.global=e.wbrGlobal),void 0!==e.wbrWidth&&(t.width=e.wbrWidth),void 0!==e.wbrHeight&&(t.height=e.wbrHeight),void 0!==e.wbrToolbar&&(t.toolbar=!0===e.wbrToolbar||"true"==e.wbrToolbar||"on"==e.wbrToolbar)}(i,r),e.customizeCell&&(r.customizeCell=function(t,i){return e.customizeCell({html:t,data:i})}),e.cellclick&&(r.cellclick=function(t){e.cellclick({cell:t})}),e.celldoubleclick&&(r.celldoubleclick=function(t){e.celldoubleclick({cell:t})}),r.dataerror=e.dataerror,r.datafilecancelled=e.datafilecancelled,r.dataloaded=e.dataloaded,r.datachanged&&(r.datachanged=function(t){e.datachanged({event:t})}),r.fieldslistclose=e.fieldslistclose,r.fieldslistopen=e.fieldslistopen,r.filteropen&&(r.filteropen=function(t){e.filteropen({params:t})}),r.fullscreen&&(r.fullscreen=function(t){e.fullscreen({fullScreenMode:t})}),r.loadingdata=e.loadingdata,r.loadinglocalization=e.loadinglocalization,r.loadingolapstructure=e.loadingolapstructure,r.loadingreportfile=e.loadingreportfile,r.localizationerror=e.localizationerror,r.localizationloaded=e.localizationloaded,r.olapstructureerror=e.olapstructureerror,r.olapstructureloaded=e.olapstructureloaded,r.openingreportfile=e.openingreportfile,r.querycomplete=e.querycomplete,r.queryerror=e.queryerror,e.ready&&(r.ready=function(){e.ready({pivot:n})}),r.reportchange=e.reportchange,r.reportcomplete=e.reportcomplete,r.reportfilecancelled=e.reportfilecancelled,r.reportfileerror=e.reportfileerror,r.reportfileloaded=e.reportfileloaded,r.runningquery=e.runningquery,r.loadingdata=e.loadingdata,r.loadingdata=e.loadingdata,r.loadingdata=e.loadingdata,r.update=e.update,e.beforetoolbarcreated&&(r.beforetoolbarcreated=function(t){e.beforetoolbarcreated({toolbar:t})}),e.report&&(r.report=e.report),e.global&&(r.global=e.global);var n=new WebDataRocks(r)}}})),void 0!==window.React&&(window.WebDataRocksReact={Pivot:React.createClass({propTypes:{global:React.PropTypes.object,width:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.number]),height:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.number]),report:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.object]),toolbar:React.PropTypes.bool,customizeCell:React.PropTypes.func,cellclick:React.PropTypes.func,celldoubleclick:React.PropTypes.func,dataerror:React.PropTypes.func,datafilecancelled:React.PropTypes.func,dataloaded:React.PropTypes.func,datachanged:React.PropTypes.func,fieldslistclose:React.PropTypes.func,fieldslistopen:React.PropTypes.func,filteropen:React.PropTypes.func,fullscreen:React.PropTypes.func,loadingdata:React.PropTypes.func,loadinglocalization:React.PropTypes.func,loadingolapstructure:React.PropTypes.func,loadingreportfile:React.PropTypes.func,localizationerror:React.PropTypes.func,localizationloaded:React.PropTypes.func,olapstructureerror:React.PropTypes.func,olapstructureloaded:React.PropTypes.func,openingreportfile:React.PropTypes.func,querycomplete:React.PropTypes.func,queryerror:React.PropTypes.func,ready:React.PropTypes.func,reportchange:React.PropTypes.func,reportcomplete:React.PropTypes.func,reportfilecancelled:React.PropTypes.func,reportfileerror:React.PropTypes.func,reportfileloaded:React.PropTypes.func,runningquery:React.PropTypes.func,update:React.PropTypes.func,beforetoolbarcreated:React.PropTypes.func},render:function(){return React.DOM.div()},componentDidMount:function(){var e={};e.container=ReactDOM.findDOMNode(this),this.parseProps(e),this.webdatarocks=new window.WebDataRocks(e)},shouldComponentUpdate:function(){return!1},componentWillUnmount:function(){},parseProps:function(e){for(var t in this.props)e[t]=this.props[t]}})}),e.exports&&(e.exports=WebDataRocks)}(Md,Md.exports)),Md.exports}var jd=function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.Pivot=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},n=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),s=l(i(1)),a=l(i(2)),o=l(i(3));function l(e){return e&&e.__esModule?e:{default:e}}var h=t.Pivot=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return i.DOMNodeRef=a.default.createRef(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"componentDidMount",value:function(){var e=this.DOMNodeRef.current;this.webdatarocks=new o.default(r({},this.props,{container:e}))}},{key:"shouldComponentUpdate",value:function(){return!1}},{key:"componentWillUnmount",value:function(){this.webdatarocks.dispose()}},{key:"render",value:function(){return a.default.createElement("div",{ref:this.DOMNodeRef},"Pivot")}}]),t}(a.default.Component);h.propTypes={beforetoolbarcreated:s.default.func,cellclick:s.default.func,celldoubleclick:s.default.func,customizeCell:s.default.func,datachanged:s.default.func,dataerror:s.default.func,datafilecancelled:s.default.func,dataloaded:s.default.func,fieldslistclose:s.default.func,fieldslistopen:s.default.func,filteropen:s.default.func,fullscreen:s.default.func,global:s.default.object,height:s.default.oneOfType([s.default.string,s.default.number]),loadingdata:s.default.func,loadinglocalization:s.default.func,loadingreportfile:s.default.func,localizationerror:s.default.func,localizationloaded:s.default.func,openingreportfile:s.default.func,querycomplete:s.default.func,queryerror:s.default.func,ready:s.default.func,report:s.default.oneOfType([s.default.string,s.default.object]),reportchange:s.default.func,reportcomplete:s.default.func,reportfilecancelled:s.default.func,reportfileerror:s.default.func,reportfileloaded:s.default.func,runningquery:s.default.func,toolbar:s.default.bool,update:s.default.func,width:s.default.oneOfType([s.default.string,s.default.number])},t.default=h},function(e,t){e.exports=Qd()},function(e,t){e.exports=r},function(e,t){e.exports=_d()}]);const zd=({rows:t,columns:i,title:r="",onClose:n=()=>{}})=>{const s=o(null),{dynamicAmountSymbol:l,decimalCount:h}=Ws();const c=a((()=>i.filter((e=>!0!==e?.isAutoSequence&&"SRNO"!==e.accessor))),[i]),d=a((()=>{const e={};return c.forEach((t=>{"currency"===t.componentType||t.Cell===kc?e[t.columnName]={type:"number"}:"date"===t.componentType||t.Cell===mc||t.Cell===gc?e[t.columnName]={type:"datetime"}:e[t.columnName]={type:"string"}})),e}),[c]),u=a((()=>t&&t.length?t.map((e=>{const{SRNO:t,...i}=e.values;return i})):[]),[t]),A=a((()=>{if(!u||!u.length)return[];const e=u.map((e=>{const t={};return c.forEach((i=>{t[i.columnName]=e[i.accessor]})),t}));return[d,...e]}),[u,c,d]);return e("div",{children:e(jd.Pivot,{ref:s,toolbar:!0,beforetoolbarcreated:function(e){let t=e.getTabs();e.getTabs=function(){t=t.filter((e=>"wdr-tab-connect"!==e.id&&"wdr-tab-open"!==e.id&&"wdr-tab-save"!==e.id&&"wdr-tab-fullscreen"!==e.id)),t.push({id:"wdr-tab-fullscreen",title:"Fullscreen",rightGroup:!0,mobile:!1,handler:()=>{var e;document.fullscreenElement?document.exitFullscreen&&document.exitFullscreen():(e=document.documentElement).requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()},icon:e.icons.fullscreen},{id:"wdr-tab-close-modal tab",title:"Close",handler:n,rightGroup:!0,icon:'<svg fill="#000000" height="30px" width="30px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" \n viewBox="0 0 512 512" xml:space="preserve">\n <g>\n <g>\n <polygon points="512,59.076 452.922,0 256,196.922 59.076,0 0,59.076 196.922,256 0,452.922 59.076,512 256,315.076 452.922,512 \n 512,452.922 315.076,256"/>\n </g>\n </g>\n </svg>'});const i=t.map((e=>{if("wdr-tab-export"===e.id){e.menu=e.menu.filter((e=>"wdr-tab-export-print"!==e.id&&"wdr-tab-export-pdf"!==e.id));let t=e.menu.findIndex((e=>"wdr-tab-export-excel"===e.id)),i=e.menu.findIndex((e=>"wdr-tab-export-html"===e.id));-1!==t&&(e.menu[t].handler=()=>{s.current?.webdatarocks?.exportTo("excel",{filename:r||"pivot"})}),-1!==i&&(e.menu[i].handler=()=>{s.current?.webdatarocks?.exportTo("html",{filename:r||"pivot"})})}return e}));return i}},height:670,customizeCell:function(e,t){e.text="(blank)"===e.text?" ":e.text},report:{formats:[{name:"",decimalPlaces:h,currencySymbol:sl(l),thousandsSeparator:","}],dataSource:{data:A},options:{grid:{type:"flat",showTooltips:!1},drillThrough:!1}}})})};let Vd=[];const Kd=({label:r,dense:n,columns:s,data:h,loading:d,getRowId:u,defaultColumn:A,allowColumnReordering:p,disableSorting:f,defaultHiddenColumns:g,defaultSortOrder:m,defaultGroupBy:w,multipleActions:b,singleActions:v,doubleClickAction:y,alwaysAvailableAction:B,setGridAction:C,updateGridData:x,hideFooter:F,hideHeader:N,disableGlobalFilter:S,disableGroupBy:E,disableLoader:T,containerHeight:L,occupiedHeight:k,gridProps:D,pageSizes:I,defaultPageSize:U,enablePagination:P,allowRowSelection:O,hideNoDataFound:R,refetchData:Q,hiddenFlag:H,autoRefreshInterval:M,allowFilter:_,filterMeta:j,allowColumnHiding:V,defaultFilter:K,isCusrsorFocused:q,onButtonActionHandel:G,controlsAtBottom:W,actionContextAtBottom:J,headerToolbarStyle:X,disableMultipleRowSelect:Y,columnHeaderStyle:$,variant:Z,enablePaginationInput:ee,defaultSelectedRowId:te,footerNote:re,footerNoteStyles:se,paginationText:ae,searchPlaceholder:le,enableExport:he,subGridLabel:ce,hideActionBar:de,finalMetaData:ue,externalExportState:Ae,onExportModalClose:pe,enablePdfPrint:ge,reportTemplateCode:me,enablePivot:we,handleClickAction:be,RenderSubHeader:ye,subHeaderComponentProps:Be,gridPaperProps:Ce,enableEnterToFocus:xe})=>{const[Fe,Ne]=c(K);Vd=a((()=>qo(Fe,h)),[Fe,h]);const[Se,Ee]=c(te),{defaultGridConfig:Te}=Ws(),{getTableProps:Le,getTableBodyProps:ke,headerGroups:De,prepareRow:Ie,selectedFlatRows:Ue,rows:Pe,page:Oe,gotoPage:Re,footerGroups:Qe,setPageSize:He,state:Me,setGlobalFilter:_e,preGlobalFilteredRows:je,state:{pageIndex:ze,pageSize:Ve},setSortBy:Ke,columns:qe,toggleAllRowsSelected:Ge}=Gt({initialState:{pageIndex:0,pageSize:U,hiddenColumns:g,sortBy:m,groupBy:w},columns:s,defaultColumn:A,data:Vd,getRowId:u,allowColumnReordering:p,autoResetSortBy:!1,disableSortBy:Boolean(f),disableGlobalFilter:Boolean(S),disableGroupBy:Boolean(E),updateGridData:x,gridProps:D,singleActions:v,setGridAction:C,hiddenFlag:H,loading:d,onButtonActionHandel:G,autoResetGlobalFilter:!1,autoResetPage:!s?.some((e=>Boolean(e?.enableColumnSelection))),globalFilter:(e,t,i)=>((e,t,i,r)=>{const n=i.toLowerCase();return e.filter((e=>t.some((t=>{const i=r.find((e=>e.accessor===t)),s=e.values[t];return!ca(s)||"dateTime"!==i?.componentType&&"date"!==i?.componentType?String(s).toLowerCase().includes(n):z(new Date(s),i.dateFormat??"dd/MM/yyyy hh:mm a").toLowerCase().includes(n)}))))})(e,t,i,ue)},Wt,Jt,Xt,Yt,$t,Zt,ei,ti,ii,((t,i)=>r=>{Boolean(t)&&r.visibleColumns.push((t=>[{id:"selectionCheckbox",Header:t=>e(Cl,{...t,setContextMenuSelectedRowId:i}),Cell:t=>e(Bl,{...t,setContextMenuSelectedRowId:i}),minWidth:40,width:40,maxWidth:40},...t]))})(O&&!Y,Ee)),{authState:We}=Vs(),Je=eh(),[Xe,Ye]=c(!1),[$e,Ze]=c(!1),et=o(null),tt=o(null),it=o(null),rt=o(null),nt=P?Oe:Pe,{t:st}=ne(),at=a((()=>Pe.reduce(((e,t)=>(t?.original?._hidden||++e,e)),0)),[Pe]);v=Ko(v,at),b=Ko(b,at),v=Vo(v,Ue,We),b=Vo(b,Ue,We),B=Vo(B,Pe,We,!1,!0);const[ot,lt]=c(null),[ht,ct]=c(null),dt=o(0),ut=o(null),At=(e,t)=>{Re(t)},pt=e=>{He(Number(e.target.value))};l((()=>{const e=e=>{"Enter"===e.key&&it.current&&it?.current?.click?.()};return window.document.addEventListener("keypress",e),()=>{window.document.removeEventListener("keypress",e)}}),[]),l((()=>{const e=setTimeout((()=>{rt.current?.focus?.()}),200);return()=>{e&&clearTimeout(e)}}),[d]),l((()=>{Ue.length>0&&Y&&JSON.stringify(Ue[0]?.original)!==JSON.stringify(tt.current)&&(tt.current=Ue[0]?.original,C({name:"_rowChanged",rows:[{data:Ue[0]?.original}]}))}),[Ue[0]?.original]);const ft=a((()=>{const e=e=>{const t=Ue.length>0&&!J&&!de&&O?`calc(${L?.[e]} - 48px)`:L?.[e];return t&&k?.[e]?W||J&&Ue.length>0?Fe.length?`calc(${t} - ${k?.[e]} - 98px)`:`calc(${t} - ${k?.[e]} - 50px)`:Fe.length?`calc(${t} - ${k?.[e]} - 48px)`:`calc(${t} - ${k?.[e]})`:Fe.length>0?`calc(${t} - 48px)`:t};return{min:e("min"),max:e("max")}}),[Ue,J,de,L,k,Fe]);return i(t,{children:[i(ni,{style:{width:"100%"},...Ce,children:[Boolean(N)?null:e(Ql,{label:r,dense:n,preGlobalFilteredRows:je,globalFilter:Me.globalFilter,setGlobalFilter:_e,alwaysAvailableAction:W?[]:B,setGridAction:C,filteredRows:Pe,selectedFlatRows:Ue,disableGlobalFilter:Boolean(S),refetchData:Q,autoRefreshInterval:M,gotoPage:Re,setSortBy:Ke,allowFilter:_,filters:Fe,setAllFilters:Ne,filterMeta:j,visibleColumns:qe,defaultHiddenColumns:g,allowColumnHiding:V,loading:d,headerToolbarStyle:X,searchPlaceholder:le,enableExport:he&&nt?.length,setOpenExport:Ye,subGridLabel:ce,enablePivot:we&&nt?.length,setOpenPivot:Ze,RenderSubHeader:ye,subHeaderComponentProps:Be}),ye&&!Be.__showInHeader?e(ye,{...Be}):null,Boolean(J)||de||!O?null:e(Fl,{dense:n,selectedFlatRows:Ue,multipleActions:b,singleActions:v,setGridAction:C,submitButtonRef:it,loading:d}),e(Sl,{contextMenuRow:ht,selectedFlatRows:Ue,singleActions:v,multipleActions:b,setGridAction:C,mouseX:ot?.mouseX??null,mouseY:ot?.mouseY??null,handleClose:()=>{ct(null),lt(null),Ee(null)},authState:We}),e(Xl,{dense:n,setAllFilters:Ne,filters:Fe,gotoPage:Re,setSortBy:Ke}),T?null:d?e(gt,{color:"secondary"}):e(Gl,{}),i(ai,{style:{position:"relative",display:"inline-block",overflow:"auto",padding:"outlined"===Z?"0 .5rem":"",maxHeight:ft.max,minHeight:ft.min,borderBottom:F?"":"1px solid rgba(133, 130, 130, 0.8)"},children:[i(oi,{component:"div",...Le(),size:n?"small":"medium",children:[e(Hl,{component:"div",sx:{background:$?.background?$?.background:$?.backgroundColor?$?.backgroundColor:"standard"!==Z?"var(--theme-color4)":"white"},children:De.map((t=>e(hi,{component:"div",...t.getHeaderGroupProps(),children:t.headers.map((t=>e(jl,{variant:Z,column:t,rows:nt,children:t.render("Header")},t.getHeaderProps().key)))})))}),i(di,{component:"div",ref:et,...ke([{style:{display:"block"}}]),onContextMenu:e=>{at<=0&&(v.length>0||b.length>0)&&(e.preventDefault(),ct({}),Ee(""),lt(null===ot?{mouseX:e.clientX-2,mouseY:e.clientY-4}:null))},style:{height:`calc(${ft.min} - 62px)`},children:[nt.length<=0&&!1===R?e(ie,{container:!0,justifyContent:"center",children:e("div",{style:{position:"absolute",left:"50%",height:`calc(${ft.min} - 50px)`,display:"flex",alignItems:"center",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:st("Nodatafound")})}):null,nt.map(((t,i)=>{if(Boolean(t?.original?.[H]))return null;Ie(t);const r=(e=>t=>{t.preventDefault(),ct(e),lt(null===ot?{mouseX:t.clientX-2,mouseY:t.clientY-4}:null)})(t),n=(e=>t=>{t.preventDefault(),void 0!==Vo(y,[e],We,!0)&&C({name:y.actionName,rows:[{data:e?.original,id:e?.id}]})})(t),s=((e,t,i)=>r=>{if("INPUT"!==r?.target?.tagName&&"TEXTAREA"!==r?.target?.tagName){if("Enter"!==r.key&&"Tab"!==r.key&&r.preventDefault(),"Space"===r.code&&Boolean(y)&&Te?.enableDoubleSpaceAction)if(dt.current+=1,2===dt.current){if(void 0===Vo(y,[i],We,!0))return;C({name:y.actionName,rows:[{data:i?.original,id:i?.id}]}),dt.current=0}else ut.current&&clearTimeout(ut.current),ut.current=setTimeout((()=>{dt.current=0}),300);"ArrowUp"===r.key&&t>0?e[t-1]?.id&&(Ge(!1),e[t-1].toggleRowSelected(!0),Ee(e[t-1]?.id),r?.target?.previousElementSibling?.focus?.()):"ArrowDown"===r.key&&t<e.length-1&&e[t+1]?.id&&(Ge(!1),e[t+1].toggleRowSelected(!0),Ee(e[t+1].id),r?.target?.nextElementSibling?.focus?.())}})(nt,i,t);let a=[];return Boolean(t?.original?._rowColor)&&(a=[{style:{background:t?.original?._rowColor}}]),Boolean(t?.original?._style)&&(a=[{style:{...a[0]?.style,...t?.original?._style}}]),q&&(a.length>0?a[0].style.cursor="pointer":a=[{style:{cursor:"pointer"}}]),e(Ml,{...t.getRowProps(a),id:t.id,tabIndex:0,component:"div",ref:t.isSelected||Se===t.id?rt:null,selected:!!t.isSelected||Se===t.id&&t.toggleRowSelected(!0),onKeyDown:s,onContextMenu:r,onDoubleClick:Boolean(y)?n:void 0,onClick:e=>{Boolean(Y)&&(Ge(!1),t.toggleRowSelected(!0),Ee(t.id)),"function"==typeof be&&be(e,{data:t?.original,id:t?.id})},className:"outlined"===Z?Je.outlinedClass:null,sx:{"& > .MuiTableCell-root":{border:"outlined"===Z?"none !important":"auto"},background:t.isSelected?"rgba(0, 0, 0, 0.08)":""},children:t.cells.map((e=>{const{key:t}=e.getCellProps();return e.isAggregated?e.render("Aggregated",{key:t}):e.render("Cell",{key:t})}))})}))]}),e((({footerGroup:t})=>Array.isArray(t?.headers)&&t.headers.some((e=>e.isTotalWithCurrency||e.isTotalWithoutCurrency||e.isSelectedTotal))?e(ve,{component:"div",style:{color:"var(--theme-color2)",background:"var(--theme-color4)",position:"sticky",bottom:0},children:e(hi,{...t.getFooterGroupProps(),component:"div",children:t.headers.map((t=>e(ci,{...t.getFooterProps({style:{textAlign:t?.TableCellProps?.align||"unset",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 10px",lineHeight:"22px",fontWeight:700,fontSize:"small",color:"var(--theme-color3)"}}),component:"div",children:t.render("Footer")},t.id)))})}):null),{footerGroup:Qe[0]})]}),e(Wl,{open:Boolean(d)})]}),re&&e(fe,{component:"div",fontWeight:500,pl:"24px",sx:se,children:st(re)}),F?null:P&&Pe.length>U?e(Ki,{sx:{display:"flex","& .MuiToolbar-root":{display:"flex",alignItems:"baseline",minHeight:"44px"}},variant:"body",component:"div",rowsPerPageOptions:[...new Set([U,...I])]?.sort(((e,t)=>e-t)),colSpan:3,count:Pe.length,rowsPerPage:Number(Ve),page:Number(ze),onPageChange:At,onRowsPerPageChange:pt,ActionsComponent:ee?Kl:Vl}):i(ci,{style:{display:"flex",padding:"8px"},children:[st("TotalNoofRecords")," ",st(ae),": ",at]}),Boolean(W)||Boolean(J)?i("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:Ue.length>0||W?".5rem":0,paddingTop:0},children:[Boolean(W)&&e(Nl,{actions:B,setAction:C,selectedRows:Ue.map((e=>({data:e.original,id:e.id}))),filteredRows:Pe,buttonTextColor:"#fff",buttonBackground:"var(--theme-color1)",loading:d},"alwaysRender"),Boolean(J)&&1===Ue.length?e(Nl,{actions:v,setAction:C,selectedRows:Ue.map((e=>({data:e.original,id:e.id}))),buttonTextColor:"#fff",buttonBackground:"var(--theme-color1)",style:{border:"1px solid var(--theme-color3)",width:"8rem"},submitButtonRef:it,loading:d},"singleFilters"):null,Boolean(J)&&Ue.length>0?e(Nl,{actions:b,setAction:C,selectedRows:Ue.map((e=>({data:e.original,id:e.id}))),buttonTextColor:"#fff",buttonBackground:"var(--theme-color1)",submitButtonRef:it,loading:d},"multipleFilters"):null]}):null]}),$e?e(oe,{open:!0,fullScreen:!0,children:e(zd,{rows:Pe,title:r,columns:ue,onClose:()=>Ze(!1)})}):null,Xe||Ae?e(oe,{open:Xe||Ae,children:e(hd,{globalFilter:Me.globalFilter??"",filters:Fe,title:r,rows:Pe,columns:ue,onClose:()=>{Ye(!1),"function"==typeof pe&&pe()},enablePdfPrint:ge,reportTemplateCode:h?.find((e=>e?.REPORT_PERSONALIZATION_ID))?.REPORT_PERSONALIZATION_ID??me,enableEnterToFocus:xe})}):null]})};function qd(e,t,i="en-IN",r=0,n="start",s=" "){const a=new Intl.NumberFormat(i,{minimumFractionDigits:r}).format(e);return"end"===n?`${a} ${t} ${s}`:`${t} ${a} ${s}`}const Gd=t=>{const i=Ws(),{dynamicAmountSymbol:r,currencyFormat:n,decimalCount:s}=i,{value:a,row:o,column:{isCurrencyCode:l,currencyRefColumn:h,currencySymbolPosition:c}}=t;let d="";l?d=sl(h??r):o&&(d=sl(o?.original?.[h]||r));let u="";return null===a||""===a||isNaN(Number(a))||(u=`${qd(a,d,n,s,c)}`),e($a,{...t,children:u})},Wd=(e,t,i,r=0)=>`${i} ${new Intl.NumberFormat(t,{minimumFractionDigits:r}).format(e)}`,Jd=w((({rows:e,column:{id:r,isTotalWithoutCurrency:n=!1,isTotalWithCurrency:s=!1,totalDecimalCount:o,isSelectedTotal:l=!1,setFooterValue:h,footerLabel:c="",footerIsMultivalue:d=!1,currencyRefColumn:u,isCurrencyCode:A,Cell:p}})=>{const f=Ws();let g=c,m=e.filter((e=>!e.original.ignoreValue));const w=a((()=>m.reduce(((e,t)=>Number(t.values?.[r]??0)+e),0)),[m,r]),b=e.filter((e=>e.isSelected)),v=a((()=>b.reduce(((e,t)=>Number(t.values?.[r]??0)+e),0)),[b,r]);let y=n?"":sl(f.dynamicAmountSymbol);s&&(A?y=sl(u??f.dynamicAmountSymbol):e?.[0]?.original?.[u]&&(y=sl(e?.[0]?.original?.[u]??"")));const B=a((()=>{if(!h)return isNaN(w)?"":p===Gd?Wd(w,f.currencyFormat,y,o??f.decimalCount):w;if("function"==typeof h){const e=h(w,m,f);return d?(Array.isArray(e)&&e?.forEach(((e,t)=>{g=g.replace(`{${t}}`,e)})),g):isNaN(e)?0:e}}),[b,v,w,m]),C=isNaN(v)?"":p===Gd?Wd(v,f.currencyFormat,y,o??f.decimalCount):v;return i(t,{children:[(s||n)&&""!==B&&i("span",{style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:g.includes("\n")?"pre-line":"nowrap",textAlign:"center"},children:[`${Boolean(g)?g:""}`," ",!d&&B]}),l&&""!==C&&i("span",{style:{paddingLeft:"10px"},children:["Selected Total: ",C]})]})})),Xd=d(((t,i)=>e(Tl,{children:e(Yd,{...t,ref:i})}))),Yd=d((({finalMetaData:t,data:i,setData:r,actions:n,setAction:s,loading:c,gridProps:d,refetchData:u,defaultSortOrder:p=[],defaultGroupBy:f=[],defaultFilter:g=[],hideHeader:m=!1,hideFooter:w=!1,autoRefreshInterval:b=0,onClickActionEvent:v=()=>{},controlsAtBottom:y=!1,actionContextAtBottom:B=!1,headerToolbarStyle:C={},disableMultipleRowSelect:x=!1,columnHeaderStyle:F={},variant:N,defaultSelectedRowId:S="",enableExport:E=!1,fieldDataRef:T=null,externalExportState:L=!1,onExportModalClose:k,reportTemplateCode:D,enablePivot:I,handleClickAction:U,RenderSubHeader:P,subHeaderComponentProps:O={},focusScopeId:R="enter-to-focus-static-grid",enableEnterToFocus:Q},H)=>{const{authState:M}=Vs(),{defaultGridConfig:_,defaultExportConfig:j,enableEnterToFocus:z}=Ws(),{pause:V,resume:K}=Ll(),q=o(null),{t:G}=ne();null===q.current&&(q.current=$d({metaData:t,actions:n,setAction:s,authState:M,fieldDataRef:T}));let W=o(i);W.current=i;let J=q.current;const X=a((()=>Array.isArray(J.columns)?J.columns.map((e=>({...e,columnName:G(e.columnName)}))):J.columns??[]),[G]),Y=a((()=>Array.isArray(J.filters)?J.filters.map((e=>({...e,columnName:G(e.columnName)}))):J.filters??[]),[G]),$=a((()=>g),[g]),Z=a((()=>X.reduce(((e,t)=>(e[t.accessor]=t.validation,e)),{})),[X]),ee=a((()=>X.reduce(((e,t)=>(e[t.accessor]="",e)),{})),[X]),te=a((()=>({width:150,maxWidth:200,minWidth:50,Header:el,Footer:Jd,...J?.gridConfig?.defaultColumnConfig})),[J?.gridConfig?.defaultColumnConfig]),ie=h((e=>e[J?.gridConfig?.rowIdColumn]),[J?.gridConfig?.rowIdColumn]),re=a((()=>p),[]),se=a((()=>f),[]),ae=h(((e,t,i,n,s,a="S")=>{let o=0;r((r=>r?.map(((l,h)=>{if(!("A"===a||h===e))return Boolean(l?._hidden)||(o+=1),{...l,_displaySequence:o};let c=!0,d="";if(c=(!Boolean(r?.[h]?._oldData?.[t])||!Boolean(i)||r?.[h]?._oldData?.[t]!==i)&&(!!Boolean(r?.[h]?._isTouchedCol?.[t])||(!(!Boolean(r[h]?.[t])||Boolean(i))||(!(!Boolean(r[h]?.[t])||!Boolean(i)||r[h]?.[t]==i)||!(Boolean(r[h]?.[t])||!Boolean(i))))),c){let e=r?.[h]?._oldData?.[t];d=null==e?r?.[h]?.[t]??"":e}else d=r?.[h]?._oldData?.[t]??"";let u={...r[h],[t]:i,_touched:{...r?.[h]?._touched,[t]:n},_error:{...r?.[h]?._error,[t]:s},_isTouchedCol:{...r?.[h]?._isTouchedCol,[t]:c},_oldData:{...r?.[h]?._oldData}};return c&&(u={...u,_oldData:{...u._oldData,[t]:d}}),"_hidden"!==t&&(o+=1),{...u,_displaySequence:o}}))))}),[r]),oe=h((()=>Array.isArray(W.current)?W.current.map((e=>{const{_touched:t,_error:i,_rowColor:r,_style:n,...s}=e;return s})):[]),[]),le=h((async(e,t)=>{let i=!1,r=Object.keys(Z);if(!Array.isArray(e))return{isValid:i,data:[]};let n=e.map((async(n,s)=>{let a=J?.gridConfig?.hiddenFlag;if(Boolean(n?.[a]))return n;const o=n._touched??{},l=n._error??{};for(let h=0;h<r.length;h++){const c=o[r[h]],d=l[r[h]],u=n[r[h]],A=Z[r[h]];if(Boolean(c)&&!1===t){if(!Boolean(d))continue;i=!0}else if("function"==typeof A){let t=await A(u,n,e.slice(0,s).filter((e=>!0!==Boolean(e[a]))),e.slice(s+1).filter((e=>!0!==Boolean(e[a]))));Boolean(t)&&(i=!0),o[r[h]]=!0,l[r[h]]=t}}return{...n,_touched:o,_error:l}})),s=await Promise.all(n);return{hasError:i,data:s}}),[]),he=h((async e=>le(W.current,e)),[]),ce=h(((e,t)=>{v(e,t,i[e])}),[i]);A(H,(()=>({validate:(e=!1)=>he(e),validator:()=>le,cleanData:()=>oe(),columns:ee,pause:V,resume:K,refetch:u,updateGridData:ae})));const de=o(null),ue=Q??z,Ae=R&&ue?{"data-scope-id":R}:{};return l((()=>{ue&&de.current&&de.current.focus()}),[ue]),Array.isArray(i)?e("div",{ref:de,tabIndex:0,onKeyDown:e=>{ue&&ma(e,R)},style:{width:"100%",position:"relative"},...Ae,children:e(Kd,{label:J.gridConfig?.gridLabel?G(J.gridConfig.gridLabel):fa(window.location.pathname,M?.menulistdata??[],!0),dense:!0,getRowId:ie,columns:X,defaultColumn:te,data:i,loading:c,allowColumnReordering:J.gridConfig?.allowColumnReordering,disableSorting:J?.gridConfig?.disableSorting,defaultHiddenColumns:J.hiddenColumns,defaultSortOrder:re,defaultGroupBy:se,multipleActions:J?.multipleActions,singleActions:J?.singleActions,handleClickAction:U,doubleClickAction:J?.doubleClickAction,alwaysAvailableAction:J?.alwaysAvailableAction,setGridAction:J?.setAction,updateGridData:ae,hideFooter:J?.gridConfig?.hideFooter??w,hideHeader:J?.gridConfig?.hideHeader??m,containerHeight:J?.gridConfig?.containerHeight,occupiedHeight:J?.gridConfig?.occupiedHeight,allowRowSelection:J?.gridConfig?.allowRowSelection??!0,disableGlobalFilter:J?.gridConfig?.disableGlobalFilter,disableGroupBy:J?.gridConfig?.disableGroupBy,disableLoader:J?.gridConfig?.disableLoader,pageSizes:J?.gridConfig?.pageSizes??[5,10],defaultPageSize:J?.gridConfig?.defaultPageSize??10,enablePagination:J?.gridConfig?.enablePagination??!1,hideNoDataFound:J?.gridConfig?.hideNoDataFound??!1,hiddenFlag:J?.gridConfig?.hiddenFlag,gridProps:d,refetchData:u,autoRefreshInterval:b,allowFilter:J.gridConfig?.allowFilter??!1,filterMeta:Y,allowColumnHiding:J.gridConfig?.allowColumnHiding??!1,defaultFilter:$,isCusrsorFocused:J.gridConfig?.isCusrsorFocused??!1,onButtonActionHandel:ce,controlsAtBottom:y,actionContextAtBottom:B,headerToolbarStyle:C,disableMultipleRowSelect:x,columnHeaderStyle:F,variant:N??_?.variant??"standard",enablePaginationInput:J.gridConfig?.enablePaginationInput??_?.enablePaginationInput??!0,defaultSelectedRowId:S,searchPlaceholder:J.gridConfig?.searchPlaceholder??"records",paginationText:J.gridConfig?.paginationText??"records",enableExport:E,footerNote:J.gridConfig?.footerNote??"",footerNoteStyles:J.gridConfig?.footerNoteStyles??{},subGridLabel:G(J.gridConfig?.subGridLabel??""),hideActionBar:J.gridConfig.hideActionBar??!1,finalMetaData:t.columns.map((e=>({...e,columnName:G(e.columnName)}))),externalExportState:L,onExportModalClose:k,enablePdfPrint:J?.gridConfig?.enablePdfPrint??j?.enablePdfPrint??!1,reportTemplateCode:D,enablePivot:I,RenderSubHeader:P,subHeaderComponentProps:O,gridPaperProps:J?.gridConfig?.gridPaperProps??{},enableEnterToFocus:ue})}):e("div",{children:"Invalid data received"})}));Xd.displayName="GridWrapper";const $d=({metaData:e,actions:t,setAction:i,authState:r,fieldDataRef:n})=>{let s=O(e),a=(e=>Fa(e,ss,Wo,Jo))(s),o=a.columns;const l=_o(o);o=(e=>Array.isArray(e)?e.map((e=>{const{schemaValidation:t,...i}=e;return{...i,schemaValidation:Yo(t)}})):[])(o),o=eo(o),o=Xa(o),o=((e,t,i)=>Array.isArray(e)?e.map((e=>{const{schemaValidation:r,validation:n,...s}=e;return{...s,validation:Zo(r,n,t,i)}})):[])(o,r,n),o=jo(o);let h=s.filters;try{h=Mo(h)}catch(e){console.log(e)}const c=zo(t??null);return{hiddenColumns:l,columns:o,gridConfig:s.gridConfig,setAction:i,filters:h,...c}},Zd=e=>[{columnName:"FileName",componentType:e?"editableTextField":"default",accessor:"name",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Size",componentType:"default",accessor:"sizeStr",sequence:2,alignment:"left",width:100,maxWidth:100,minWidth:100},{columnName:"Type",componentType:"default",accessor:"fileExt",sequence:3,alignment:"left",width:100,maxWidth:100,minWidth:100}],eu={columns:[{columnName:"File ID",componentType:"default",accessor:"id",sequence:0,alignment:"left",isVisible:!1},...Zd(!1)],gridConfig:{dense:!0,gridLabel:"Files",rowIdColumn:"id",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,disableLoader:!0,hideHeader:!0,containerHeight:{min:"40vh",max:"50vh"}}},tu={columns:[{columnName:"File ID",componentType:"default",accessor:"id",sequence:0,alignment:"left",isVisible:!1},{columnName:"File Name",componentType:"default",accessor:"name",sequence:1,alignment:"left",width:400,maxWidth:400,minWidth:400},{columnName:"Size",componentType:"default",accessor:"sizeStr",sequence:2,alignment:"left",width:100,maxWidth:100,minWidth:100},{columnName:"Type",componentType:"default",accessor:"fileExt",sequence:3,alignment:"left",width:100,maxWidth:100,minWidth:100},{columnName:"Reason",componentType:"default",accessor:"failedReason",sequence:4,alignment:"left",width:300,maxWidth:300,minWidth:300}],gridConfig:{dense:!0,gridLabel:"Failed To Add These Files For Upload",rowIdColumn:"id",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,allowRowSelection:!1,disableGlobalFilter:!0,disableSorting:!0,disableGroupBy:!0,hideHeader:!0}},iu=Ci((e=>({uploadWrapper:{backgroundImage:"url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' stroke='%232538584A' stroke-width='4' stroke-dasharray='8' stroke-dashoffset='4' stroke-linecap='square'/%3e%3c/svg%3e\")",display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing(4)}}))),ru=({disabled:e})=>({pointerEvents:e?"none":"all",opacity:e?.5:1}),nu=r=>{const n=iu(),{onDrop:s,disabled:a,existingFiles:l,accept:h,multiple:c}=r,d=o(null),{t:u}=ne(),[{canDrop:A,isOver:p},f]=bt({accept:[mt.FILE],drop(e,t){if("function"==typeof s){const e=Array.from(t.getItem().files);s(e,l)}},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),g=A&&p;return e("div",{ref:f,style:ru({disabled:Boolean(a)}),className:n.uploadWrapper,children:g?e(vt,{children:u("DropFileshere")}):i(t,{children:[e(vt,{children:u("DragandDropor")}),e(ct,{color:"secondary",onClick:()=>d?.current?.click(),children:u("Browse")}),e("input",{type:"file",multiple:c,accept:Array.isArray(h)?h?.map((e=>`.${e}`)).join(","):`.${h}`,style:{display:"none"},ref:d,onChange:e=>{const t=e.target.files,i=Array.from(t);s(i,l)},onClick:e=>{e.target.value=""}})]})})};function su(e){var t=0;if(0===e.length)return t;for(var i=0;i<e.length;i++){t=(t<<5)-t+e.charCodeAt(i),t&=t}return t}function au(e){return su([e.name,e.type,e.size,e.lastModified].join("-"))}const ou=e=>{if(Number.isInteger(Number(e))){let t=`${e} bytes`;const i=["KB","MB","GB","TB","PB","EB","ZB","YB"];for(let r=0,n=e/1024;n>1;n/=1024,r++)t=`${n.toFixed(2)} ${i[r]}`;return t}return"cannot compute size"},lu=async e=>{var t;return await(t=e,new Promise(((e,i)=>{try{const r=new FileReader;r.onloadend=i=>{const r=new Uint8Array(i?.target?.result).subarray(0,4);let n,s="";for(let e=0;e<r.length;e++){let t=r[e].toString(16);t.length<2&&(t="0"+t),s+=t}switch(s=s.toUpperCase(),s){case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":n={ext:"jpg",mime:"image/jpeg"};break;case"89504E47":n={ext:"png",mime:"image/png"};break;case"47494638":n={ext:"gif",mime:"image/gif"};break;case"25504446":n={ext:"pdf",mime:"application/pdf"};break;case"504B0304":n={ext:t.name.split(".").pop()??"xlsx",mime:t.type??"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};break;case"494433":n={ext:"mp3",mime:"audio/mpeg"};break;case"66747970":n={ext:"mp4",mime:"video/mp4"};break;case"52494646":n={ext:"wav",mime:"audio/wav"};break;case"74657874":n={ext:"txt",mime:"text/plain"};break;default:return void e(void 0)}e(n)},r.onerror=i,r.readAsArrayBuffer(t.slice(0,4))}catch(e){i(void 0)}})))};const hu=(e,t)=>"all"===t||Array.isArray(t)&&t.indexOf(e)>-1,cu=(e,t)=>Array.isArray(t)&&t.indexOf(e.id)>-1;function du(e,t){const i="object"==typeof e&&URL.createObjectURL(e),r=document.createElement("a");r.href=String(i),r.download=t??e.name??`download-${(new Date).getUTCMilliseconds()}`;const n=()=>{setTimeout((()=>{URL.revokeObjectURL(String(i)),r.removeEventListener("click",n)}),150)};r.target="_blank",r.addEventListener("click",n,!1),r.click()}const uu=(e,t,i)=>{const r=O(e);if(Boolean(i))for(let e=0;e<r.columns.length;e++)"name"===r.columns[e].accessor&&(r.columns[e].componentType="editableTextField");return Array.isArray(t)&&(r.columns=[...e.columns,...t]),r},Au=e=>{if(Array.isArray(e)){return e.reduce(((e,t)=>(e[t.accessor]="",e)),{})}return{}},pu=(e,t,i)=>async(r,n)=>{let s=[],a=r.map((t=>e(t))),o=await Promise.all(a),l=[];Array.isArray(n)&&(l=n.map((e=>e.id)));let h=o.filter((e=>e.size>t?(s.push({...e,failedReason:"File Size exceed maximum size"}),!1):hu(e.fileExt,i)?!cu(e,l)||(s.push({...e,failedReason:"File already added for uploading"}),!1):(s.push({...e,failedReason:"File type is not allowed"}),!1)));return{failedFiles:s,filteredNewFilesObj:h}},fu=e=>async t=>{const i=await lu(t);return{...e,id:au(t),blob:t,name:t.name.split(".").slice(0,-1).join("."),sizeStr:ou(t.size),size:t.size,mimeType:t.type,_mimeType:i?.mime??t.type,ext:i?.ext??t.name.split(".").pop(),fileExt:t.name.split(".").pop()}},gu=e=>Array.isArray(e)?e.map((e=>{const{id:t,blob:i,name:r,sizeStr:n,size:s,mimeType:a,_mimeType:o,ext:l,fileExt:h,...c}=e;return{name:`${r}.${l}`,blob:i,ext:l,id:t,...c}})):[],mu=async e=>{let t=[];if(!Array.isArray(e)||0===e.length)return t;for(let i=0;i<e.length;i++){const{blob:r,...n}=e[i];let s=await na(r);t.push({...n,blob:s[1],blobtype:s[0]})}return t},wu=e=>{const t=new FormData;if(!Array.isArray(e)||0===e.length)return t;const i={};for(let r=0;r<e.length;r++){const{blob:n,id:s,...a}=e[r];t.append("blob",n,`${s}`),i[`${s}`]=a}return t.append("metaData",JSON.stringify(i)),t},bu=e=>{const t=e[0]?.map(((e,t)=>({accessor:e,columnName:e,sequence:t+1,componentType:"default",width:180,minWidth:120,maxWidth:600,showTooltip:!0})));let i=[];return t&&(i=[{columnName:"UNIQUE",accessor:"UNIQUE",componentType:"default",isVisible:!1},...t]),i},vu=e=>{const t=e.slice(1).map((t=>t.reduce(((t,i,r)=>({...t,[e[0][r]]:i})),{})));let i=[];return t&&(i=t.map(((e,t)=>({UNIQUE:t+1,...e})))),i},yu=e=>({gridConfig:{gridLabel:"",rowIdColumn:"UNIQUE",defaultColumnConfig:{width:400,maxWidth:450,minWidth:300},hideHeader:!0,disableGroupBy:!0,enablePagination:!0,pageSizes:[15,30,50],defaultPageSize:15,containerHeight:{min:"67vh",max:"70vh"},allowFilter:!1,allowColumnHiding:!1,allowRowSelection:!1},columns:bu(e)??[]}),Bu=({blob:t,fileName:r,onClose:n})=>{const[s,a]=c([]),[o,h]=c(!1);return l((()=>{(()=>{const e=new FileReader;h(!0),e.onload=e=>{const t=e.target.result,i=tt.read(t,{type:"binary",raw:!1}),r=i.SheetNames[0],n=i.Sheets[r],s=tt.utils.sheet_to_json(n,{header:1,raw:!1}).map((e=>e.map((e=>{const t=pa(e,!0);return t instanceof Date&&V(t)?t.toLocaleDateString("en-UK"):e}))));h(!1),a(s)},t?e.readAsBinaryString(t):a([])})()}),[]),i(p,{children:[i(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:r}),e("div",{style:{flexGrow:1}}),"function"==typeof n?e(C,{color:"secondary",onClick:n,children:e(Bt,{})}):null]}),i(pt,{children:[o?e(Ga,{}):null,s.length>0?e(Yd,{finalMetaData:yu(s??[]),data:vu(s)??[],setData:()=>null},"previewExcelFileData"):e("p",{style:{textAlign:"center",color:"#888"},children:e("em",{children:o?"File is Loading...":"Empty file found!!!"})})]})]})},Cu=({blob:t,fileName:r,onClose:n})=>{const[s,a]=c([]),[o,h]=c(!1);return l((()=>{(async()=>{h(!0),Ct.parse(t,{header:!1,skipEmptyLines:!0,complete:e=>{h(!1);const t=e.data.map((e=>e.map((e=>{const t=pa(e,!0);return t instanceof Date&&V(t)?t.toLocaleDateString("en-UK"):e}))));a(t)},error:e=>{h(!1),a([])}})})()}),[]),i(p,{children:[i(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:r}),e("div",{style:{flexGrow:1}}),"function"==typeof n?e(C,{color:"secondary",onClick:n,children:e(Bt,{})}):null]}),i(pt,{children:[o?e(Ga,{}):null,s.length>0?e(Yd,{finalMetaData:yu(s??[]),data:vu(s)??[],setData:()=>null},"previewCsvFileData"):e("p",{style:{textAlign:"center",color:"#888"},children:e("em",{children:o?"File is Loading...":"Empty file found!!!"})})]})]})},xu=({blob:r,fileName:n,onClose:s,optionalActionButton:a,hideDownloadBtn:o=!1,hideFilename:h=!1,contentStyle:d,actionStyle:u})=>{const{t:A}=ne(),[f,g]=c("object"==typeof r&&Boolean(r)?URL.createObjectURL(r):null);return l((()=>{let e=f??"";return()=>{URL.revokeObjectURL(e)}}),[]),l((()=>{g("object"==typeof r&&Boolean(r)?URL.createObjectURL(r):null)}),[r]),i(p,{children:[i(At,{style:{display:"flex",padding:"8px 24px",...u},children:[h?null:i(t,{children:[i(vt,{variant:"h6",color:"textSecondary",children:[A("File"),":"]}),e(vt,{variant:"h6",children:n})]}),e("div",{style:{flexGrow:1}}),Boolean(a)?e(za,{color:"primary",onClick:()=>{"function"==typeof a?.callback&&a.callback()},children:a?.label??"NO_LABEL"}):null,o&&e(C,{color:"secondary",onClick:()=>du(r,n),children:e(yt,{})}),"function"==typeof s?e(C,{color:"secondary",onClick:s,children:e(Bt,{})}):null]}),e(pt,{style:{...d},children:e("iframe",{title:"Document Preview",src:`${f}`,style:{height:"100%",width:"100%"},"aria-label":"PDF Preview"})})]})},Fu=({blob:r,fileName:n,onClose:s,hideFilename:a,canZoom:o=!0})=>{const[h,d]=c("object"==typeof r&&Boolean(r)?URL.createObjectURL(r):""),[u,A]=c(1);return l((()=>{let e=h??"";return()=>URL.revokeObjectURL(e)}),[]),l((()=>{d("object"==typeof r&&Boolean(r)?URL.createObjectURL(r):"")}),[r]),i(p,{children:[i(At,{style:{display:"flex",padding:"8px 24px"},children:[a?null:i(t,{children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:n})]}),e("div",{style:{flexGrow:1}}),o?i(t,{children:[e(C,{color:"secondary",onClick:()=>A((e=>Math.max(e-.25,.25))),children:e(Ft,{})}),e(C,{color:"secondary",onClick:()=>A(1),children:e(Nt,{})}),e(C,{color:"secondary",onClick:()=>A((e=>Math.min(e+.25,4))),children:e(xt,{})})]}):null,e(C,{color:"secondary",onClick:()=>du(r,n),children:e(yt,{})}),"function"==typeof s?e(C,{color:"secondary",onClick:s,children:e(Bt,{})}):null]}),e(pt,{children:e("img",{src:h,alt:"Preview",style:{transform:`scale(${u})`,transition:"transform 0.2s ease",transformOrigin:"top left",maxWidth:"100%",width:"60%",maxHeight:"80vh"}})})]})},Nu=({onClose:t,fileName:r,message:n})=>i(p,{children:[i(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:r}),e("div",{style:{flexGrow:1}}),"function"==typeof t?e(C,{color:"secondary",onClick:t,children:e(Bt,{})}):null]}),e(pt,{children:n})]}),Su=[{actionName:"Delete",actionLabel:"Delete",multiple:!0,rowDoubleClick:!1},{actionName:"View",actionLabel:"ViewFile",multiple:!1,rowDoubleClick:!1}],Eu=({additionalColumns:t,editableFileName:r,onClose:n,onUpload:s,dataChangedRef:d,allowedExtensions:u=["pdf"],maxAllowedSize:A=3145728,gridProps:f,defaultFileData:g=[],onUpdateFileData:m=e=>{},allowMultipleFilesSelection:w=!1})=>{const b=a((()=>uu(eu,t,r)),[]),v=a((()=>Au(t)),[]),y=h((e=>fu(v)(e)),[v]),[B,C]=c(g),[x,F]=c(""),[N,S]=c([]),[E,T]=c(!1),[L,k]=c(null),[D,I]=c(!1),[U,P]=c(1/0),O=o(null),{t:R}=ne(),Q=h((async(e,t)=>{let{filteredNewFilesObj:i,failedFiles:r}=await pu(y,A,u)(e,t);C((e=>w?[...e,...i]:i)),r.length>0&&(S(r),T(!0))}),[C,S,T,y,A,u]);l((()=>{if("Delete"===L?.name){const e=L?.rows?.map?.((e=>e.id)),t=B.filter((t=>e.indexOf(t.id)<0));C(t),k(null)}}),[L]),l((()=>{m(B)}),[B]);const H=h((async e=>{let{hasError:t,data:i}=await(O?.current?.validate?.(!0));if(!0===t)C(i);else{let t=O?.current?.cleanData?.(),i=gu(t),r=wu(i),s=await mu(t);I(!0),F(""),e(r,(e=>{P(e)}),(({status:e,data:t})=>{"success"===e?(d.current=!0,n()):F(t?.error_msg??"unknown error occured"),I(!1)}),s,t)}}),[I,F,C]);return i(p,{children:[D?e(gt,{variant:U===1/0?"indeterminate":"determinate",value:U,color:"secondary"}):null,i(st,{children:[e(lt,{title:R("FileUpload"),action:i(ot,{children:[e("div",{style:{flexGrow:2}}),"function"==typeof s?e(ct,{disabled:D||B.length<=0,size:"small",color:"secondary",onClick:()=>H(s),endIcon:D?e(re,{size:20,color:"secondary"}):null,children:R("Upload")}):null,e(ct,{disabled:D||B.length<=0,onClick:()=>C([]),size:"small",color:"secondary",children:R("ClearAll")}),"function"==typeof n?e(ct,{disabled:D,onClick:()=>{let e=O?.current?.cleanData?.();m(e),n()},size:"small",color:"secondary",children:R("Close")}):null]})}),Boolean(x)?e(ft,{severity:"error",children:x}):null,i(at,{children:[e(nu,{existingFiles:B,onDrop:Q,disabled:D,multiple:w,accept:u}),e(ht,{in:B.length>0,children:e(Xd,{finalMetaData:b,data:B,setData:C,actions:Su,setAction:k,loading:D,ref:O,gridProps:f})})]})]}),i(dt,{open:E,maxWidth:"lg",children:[e(ut,{children:R("FailedToAddFollowingFilesForUpload")}),e(pt,{children:e(Xd,{finalMetaData:tu,data:N,setData:e=>null})}),e(At,{children:e(ct,{color:"secondary",onClick:()=>{T(!1),S([])},children:R("Ok")})})]}),e(dt,{open:Boolean(L),maxWidth:"lg",onClose:()=>k(null),PaperProps:{style:{width:"100%",height:"100%"}},children:L?.rows[0]?.data?._mimeType?.includes("pdf")?e(xu,{blob:L?.rows[0]?.data?.blob,fileName:L?.rows[0]?.data?.name,onClose:()=>k(null)}):L?.rows[0]?.data?._mimeType?.includes("image")?e(Fu,{blob:L?.rows[0]?.data?.blob,fileName:L?.rows[0]?.data?.name,onClose:()=>k(null)}):"xlsx"===L?.rows[0]?.data?.ext||"xls"===L?.rows[0]?.data?.ext?e(Bu,{blob:L?.rows[0]?.data?.blob,fileName:L?.rows[0]?.data?.name,onClose:()=>k(null)}):"csv"===L?.rows[0]?.data?.ext?e(Cu,{blob:L?.rows[0]?.data?.blob,fileName:L?.rows[0]?.data?.name,onClose:()=>k(null)}):e(Nu,{fileName:L?.rows[0]?.data?.name,onClose:()=>k(null),message:"No preview available for this file"})})]})},Tu=[{actionName:"View",actionLabel:"ViewFile",multiple:!1,rowDoubleClick:!1}],Lu=({additionalColumns:t,editableFileName:r,fileData:n,onClose:s,gridProps:l})=>{const h=a((()=>uu(eu,t,r)),[]),[d,u]=c(n??[]),[A,f]=c(null),g=o(null),{t:m}=ne();return i(p,{children:[e(st,{children:i(at,{children:[e(lt,{title:m("FileViewer"),action:i(ot,{children:[e("div",{style:{flexGrow:2}}),"function"==typeof s?e(ct,{disabled:!1,onClick:()=>s(),size:"small",color:"secondary",children:m("Close")}):null]})}),e(Xd,{finalMetaData:h,data:d,setData:u,actions:Tu,setAction:f,loading:!1,ref:g,gridProps:l})]})}),e(dt,{open:Boolean(A),maxWidth:"lg",onClose:()=>f(null),PaperProps:{style:{width:"100%",height:"100%"}},children:A?.rows[0]?.data?._mimeType?.includes("pdf")?e(xu,{blob:A?.rows[0]?.data?.blob,fileName:A?.rows[0]?.data?.name,onClose:()=>f(null)}):A?.rows[0]?.data?._mimeType?.includes("image")?e(Fu,{blob:A?.rows[0]?.data?.blob,fileName:A?.rows[0]?.data?.name,onClose:()=>f(null)}):e(Nu,{fileName:A?.rows[0]?.data?.name})})]})},ku=({open:i,closeDialog:r,setImportedData:n})=>{const[s,a]=c(!0),[o,l]=c([]),h=()=>{r()};return e(t,{children:s?e(oe,{fullWidth:!0,maxWidth:"md",open:i,children:e(Eu,{onClose:()=>{h()},additionalColumns:[],editableFileName:!1,defaultFileData:[],onUpload:(e,t,i,r,s)=>{r.length>0?(t(10),setTimeout((async()=>{try{(async(e,t)=>{t(20);let i=80/(e.length>0?e.length:1),r=[];e.forEach(((e,n)=>{let s=Ja({data:e}),{blob:a,...o}=e,l=((e,t,i,r)=>(i(r-10),t))(0,s,t,10+i*(n+1));r=[...r??[],...l]})),t(95),t(100),l(r),n(r),setTimeout((()=>{a(!1),h()}),1e3),t(97),r=r.filter((e=>Boolean(e?._isNewRow))),t(99),r=r.map(((e,t)=>({...e,TRAN_CD:t+1})))})(r,t)}catch(e){i({status:"failed",data:{error_msg:"Error in file read "+String(e)}})}}),1e3)):i({status:"failed",data:{error_msg:"Error in file read"}})},gridProps:{},maxAllowedSize:12328960,allowedExtensions:["xlsx","csv"],onUpdateFileData:e=>{}},"GridFileUploadData")}):null})},Du=e=>{const{data:t,index:i,style:r}=e;return g(t[i],{style:{...r,whiteSpace:"pre",width:"max-content",minWidth:"100%",top:r.top+8}})},Iu=n({}),Uu=d(((t,i)=>{const r=s(Iu);return e("div",{ref:i,...t,...r})})),Pu=d(((t,i)=>{const{children:r,...n}=t,s=b.toArray(r),a=ue(),h=Ni(a.breakpoints.up("sm"),{noSsr:!0}),c=s.length,d=h?29.5:48,u=()=>d,A=(e=>{const t=o(null);return l((()=>{null!==t.current&&t.current.resetAfterIndex(0,!0)}),[e]),t})(c);return e("div",{ref:i,children:e(Iu.Provider,{value:n,children:e(Si,{itemData:s,height:(c>8?10*d:s.map(u).reduce(((e,t)=>e+t),0))+16,width:"100%",ref:A,outerElementType:Uu,innerElementType:"ul",itemSize:u,overscan:5,itemCount:c,children:Du})})})}));var Ou=Object.freeze({__proto__:null,ListBoxComponent:Pu});const Ru=[{actionName:"close",actionLabel:"Close",multiple:void 0,alwaysAvailable:!0},{actionName:"close-dbl",actionLabel:"Close",multiple:void 0,alwaysAvailable:!1,rowDoubleClick:!0}],Qu=(e=[],t={})=>({gridConfig:{dense:!0,gridLabel:"SelectAValue",rowIdColumn:"UNIQUE_ID",defaultColumnConfig:{width:440,maxWidth:450,minWidth:300},allowColumnReordering:!0,disableSorting:!1,hideHeader:!1,disableGroupBy:!0,enablePagination:!0,pageSizes:[10,20,30],defaultPageSize:10,containerHeight:{min:"53vh",max:"53vh"},allowFilter:!0,allowColumnHiding:!1,allowRowSelection:!1,isCusrsorFocused:!0},columns:[{accessor:"UNIQUE_ID",columnName:"SrNo",sequence:0,componentType:"default",width:70,minWidth:60,maxWidth:100},...e.length>0?Object.keys(e[0]).map(((e,i)=>({accessor:e,columnName:e,sequence:i+1,componentType:"default",width:150,minWidth:100,showTooltip:!0,...t[e]}))):[]],filters:e.length>0?Object.keys(e[0]).filter((e=>!1!==t[e]?.isVisible)).map((e=>({accessor:e,columnName:t[e]?.columnName??e,filterComponentType:"valueFilter",gridProps:{xs:12,md:12,sm:12}}))):[]}),Hu=({handleClose:t,options:i,optionsGridColDef:r})=>{const n=a((()=>i.map((e=>{const{label:t,value:i,REPORT_PERSONALIZATION_ID:r,...n}=e;return{label:t,value:i,...n}}))),[i]),s=h((e=>{if("close"===e?.name)t();else if("close-dbl"===e?.name){const i=e?.rows[0]?.data?.value??void 0;t(i)}}),[]),o=a((()=>n.map(((e,t)=>({...e,UNIQUE_ID:t+1})))),[n]);return l((()=>{const e=setTimeout((()=>{const e=document.querySelectorAll(".gridwrapper_global_search input");e.length>0&&e[e.length-1].focus()}),100);return()=>clearTimeout(e)}),[]),e(oe,{open:!0,className:"optionsGrid",PaperProps:{style:{width:"100%",padding:"8px"}},maxWidth:"md",onKeyUp:e=>{"Escape"===e.key&&t()},children:e(Xd,{finalMetaData:Qu(n,r),data:o??[],setData:()=>null,actions:Ru,setAction:s,enableExport:!0},"optionsGrid")})},Mu=vi(ye)({[`& .${fi.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}}),_u=Ci((e=>({root:{"& .MuiInputBase-root.MuiAutocomplete-inputRoot":{paddingRight:"0 !important"},"& .MuiInputBase-root > .MuiAutocomplete-endAdornment":{display:"none"}}}))),ju=e=>t=>Boolean(e)?t:t?.label??"",zu=({name:r,validate:n,validationRun:s,shouldExclude:d,isReadOnly:A,postValidationSetCrossFieldValues:f,skipValueUpdateFromCrossFieldWhenReadOnly:g,runPostValidationHookAlways:w,dependentFields:b,fieldKey:v,options:y,GridProps:B,enableGrid:C,multiple:x,disableClearable:F,freeSolo:N,TextFieldProps:S,CircularProgressProps:E,ChipProps:T,showCheckbox:L,CreateFilterOptionsConfig:k,runValidationOnDependentFieldsChange:D,label:I,placeholder:U,limitTags:P,required:O,enableVirtualized:R,isFieldFocused:Q,_optionsKey:H,disableCaching:M,disableAdornment:_,ignoreInSubmit:j=!1,textFieldStyle:z,setFieldLabel:V,defaultValueKey:K,listBoxMinWidth:q,listBoxMaxWidth:J,setValueOnDependentFieldsChange:X,runExternalFunction:Y,onFormDataChange:$,componentType:Z,optionsGridColDef:ee,runPostValidationForInitValue:te,className:ne,skipInitialDefaultValueKeyValidation:ae=!1,filterOptionsCb:oe,...le})=>{const{enableOptionsGridForAutocomplete:he}=Ws(),[ce,de]=c(B),[ue,Ae]=c(!1),[fe,ge]=c(!1),{formState:me,error:be,touched:ve,handleChange:ye,handleBlur:Be,runValidation:Ce,isSubmitting:xe,validationRunning:Fe,fieldKey:Ne,name:Se,dependentValues:Ee,readOnly:Te,excluded:Le,incomingMessage:ke,whenToRunValidation:De,value:Ie,prevValue:Ue,setIncomingMessage:Pe,setIgnoreInSubmit:Oe,handleOptionValueExtraData:Re,setErrorAsCB:Qe,setValue:He,setFilteredOptions:Me}=Js({name:r,fieldKey:v,dependentFields:b,validate:n,validationRun:s,runPostValidationHookAlways:w,postValidationSetCrossFieldValues:f,isReadOnly:A,shouldExclude:d,runValidationOnDependentFieldsChange:D,skipValueUpdateFromCrossFieldWhenReadOnly:g,runExternalFunction:Y,onFormDataChange:$,componentType:Z,runPostValidationForInitValue:te}),_e=o(),je=_u(),ze=o(-1),Ve=o(new Map),Ke=h(ju(N),[]),qe=h((e=>t=>Boolean(e)?t:t?.value??"")(N),[]),Ge=h(((e,t)=>{if(Array.isArray(e)||(e=[e]),t)return e;return e.map((e=>Ve.current.has(`${e}`)?Ve.current.get(`${e}`):{label:e,value:e}))}),[]);l((()=>{if(Boolean(j))if("function"==typeof j){let e=j(ta(Ee),me,{isSubmitting:xe,value:Ie});Oe(e)}else Oe(j)}),[j,Oe,Ee,Ie]);const We=()=>{setTimeout((()=>{_e?.current?.focus?.()}),50)};l((()=>{Q&&We()}),[Q]),l((()=>{const e=e=>{if(!fe)return;const t=document.querySelector(`.${fi.listbox}`),i=e.target;t&&(t===i||t.contains(i))||ge(!1)};return window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("scroll",e,!0)}}),[fe]);const[Je,Xe]=c([]),[Ye,$e]=c([]),Ze=h((e=>fo(Je)(e)),[Je]),et=h((e=>{if(Ve.current.clear(),"function"==typeof e)Xe((t=>{let i=e(t);return N&&Array.isArray(i)?i.map((e=>ju(!1)(e))):(Array.isArray(i)&&i.map((e=>{Ve.current.set(`${qe(e)}`,e)})),i)}));else{if(N&&Array.isArray(e)){let t=e.map((e=>ju(!1)(e)));return void Xe(t)}Array.isArray(e)&&e.map((e=>{Ve.current.set(`${qe(e)}`,e)})),$e(e),Me(e),Xe(e)}}),[$e,Xe,Ke,qe]),tt=h((()=>{let e=Ze(Ie);Re(e),Be()}),[Be,Ze,Re,Ie]),it=(e,t)=>{if(Te||xe)return;t||(ze.current=-1),Array.isArray(t)||(t=[t]),t=N?t.map((e=>Ke(e)??"")):t.map((e=>qe(e)??""));let i=Ze(t);Re(i),!Boolean(x)&&Array.isArray(t)?ye(t[0],void 0,!1,{optionData:i}):ye(t,void 0,!1,{optionData:i})},rt=h((e=>{"backspace"!==e.key.toLowerCase()&&"escape"!==e.key.toLowerCase()||(ze.current=-1),"tab"===e.key.toLowerCase()&&-1!==ze.current&&Je[ze.current]&&fe&&it(0,Je[ze.current]),"f9"===e.key.toLowerCase()&&he&&Je.length&&Ae(!0)}),[Ke,Je,it,ze.current]),{loadingOptions:nt}=co(me,y,et,ye,Ee,ke,Ce,De,H,M,Pe,!0,"",!1);l((()=>{let e=Ze(Ie);Re(e)}),[nt,Ze,Re]),l((()=>{if("function"!=typeof oe)return;const e=oe(Ye,ta(Ee),me)??Ye;Xe(e),Me(e)}),[Ee,me,Ye,oe,Me]),l((()=>{if(null!==ke&&"object"==typeof ke){const{error:e,isErrorBlank:t,isFieldFocused:i,GridProps:r}=ke;if("object"==typeof r){const e={...B,xs:r?.xs??B?.xs??"auto",md:r?.md??B?.md??"auto",xl:r?.xl??r?.md??B?.xl??"auto",sm:r?.sm??B?.sm??"auto",lg:r?.lg??r?.md??B?.lg??"auto"};de(e)}i&&We(),t?Qe(""):Boolean(e)&&Qe(e)}}),[ke,Qe]);const st=a((()=>{if("function"==typeof V)return V(ta(Ee),Ie)}),[V,Ee,Ie]);l((()=>{if(!K||Ie||nt)return;const e=Je.find((e=>e[K]===e.value));if(e){let t=e;Array.isArray(t)||(t=[t]),t=N?t.map((e=>Ke(e)??"")):t.map((e=>qe(e)??""));let i=Ze(t);Re(i),!Boolean(x)&&Array.isArray(t)?He(t[0],void 0):He(t,void 0),ae||setTimeout((()=>{tt()}),0)}}),[nt,Je]),l((()=>{(async()=>{if("function"==typeof X)try{let e=await X(ta(Ee),me,{value:Ie,isSubmitting:xe});if(null!=e){const t=Boolean(e)?Je?.find((t=>e===t.value)):null;it(0,t)}}catch(e){console.error("An error occurred:",e)}})()}),[Ee,ye,X]);const at=h((e=>po(Je)(e)),[Je]),ot=a((()=>Ge(Ie,N)),[Ie,N,Je]);if(Le)return null;const lt=ve&&""!==(be??""),ht=i(m,{fallback:"loading...",children:[u(Ai,{...le,className:_?je.root:"",key:Ne,id:Ne,defaultValue:[],limitTags:P??2,multiple:x,autoHighlight:!0,open:fe,onOpen:()=>ge(!0),onClose:()=>ge(!1),disableClearable:F,options:Je,freeSolo:N,getOptionLabel:Ke,value:nt?x?[]:null:x?ot:ot.length>0?ot[0]:null,isOptionEqualToValue:(e,t)=>N?e===t:e.value===t.value,PopperComponent:Mu,ListboxComponent:Boolean(R)?Pu:void 0,PaperComponent:({children:t})=>e("div",{style:{width:"fit-content",background:"white",boxShadow:"rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px",overflow:"hidden",maxWidth:J||"320px",minWidth:q?`max(${q}px, 100%)`:"max(120px, 100%)"},children:t}),onKeyDown:rt,onChange:it,onBlur:()=>{ze.current=-1,tt()},onHighlightChange:(e,t)=>{ze.current="mousemove"!==e?.type?Je.indexOf(t):-1},disabled:xe||Te,filterOptions:Boolean(k)&&"object"==typeof k?pi(k):(e,t)=>{const i=t.inputValue.toLowerCase();return e.filter((e=>e.label.toLowerCase().includes(i))).sort(((e,t)=>{const r=e.label.toLowerCase().startsWith(i),n=t.label.toLowerCase().startsWith(i);return r&&!n?-1:!r&&n?1:0}))},renderTags:(e,t)=>e.map(((e,i)=>u(mi,"string"==typeof e?{variant:"outlined",...T,label:e,...t({index:i}),key:e}:{variant:"outlined",...T,label:e.label,...t({index:i}),key:`${e.label}-${i}`}))),renderInput:r=>{const n=e(to,{...S,...r,name:Se,className:se(ne,{hasOldValue:void 0!==Ue&&void 0!==Ie&&!W.isEqual(Ue,Ie)}),inputRef:_e,label:st?.label?G(st.label):I,placeholder:Te?"":st?.placeholder?G(st.placeholder):U,autoComplete:"off",type:"text",error:!xe&<,required:O,helperText:e(we,{children:!xe&<?be:null}),sx:{"& .MuiInputBase-root":{background:Boolean(Te||xe)?"#f3f3f3 !important":""},...z},InputProps:{...r.InputProps,endAdornment:i(p,{children:[Fe||nt?e(re,{sx:{position:"absolute",right:_?"0.5rem":"1.5rem"},size:25,color:"secondary",variant:"indeterminate",...E}):null,r.InputProps.endAdornment]})},InputLabelProps:{shrink:!0},inputProps:{...r.inputProps,autoComplete:"off"}});return e(t,{children:void 0===Ue||void 0===Ie||W.isEqual(Ue,Ie)?n:e(il,{title:e(rl,{label:`${G("OldValueOf")} ${st?.label?G(st.label):I}`,value:Ue?at(Ue)??Ue:"(blank)"}),arrow:!0,followCursor:!0,children:n})})},renderOption:(t,r,n)=>{t.key=t.id;let{selected:s,inputValue:a}=n,o=Ke(r);const l=wi(o,a),h=bi(o,l).map(((t,i)=>e("span",{style:{fontWeight:t.highlight?700:400},children:t.text},i)));return R?i("li",{style:{whiteSpace:"pre",width:"max-content",minWidth:"100%"},...t,children:[L?e(so,{checked:s}):null,h]}):e(pe,{title:r.label,disableInteractive:!0,children:i("li",{style:{whiteSpace:"pre",width:"max-content",minWidth:"100%"},...t,children:[L?e(so,{checked:s}):null,h]})})}}),ue?e(Hu,{handleClose:e=>{if(e){const t=e?Je?.find((t=>e===t.value)):null;it(0,t)}Ae(!1)},options:Je,optionsGridColDef:ee}):null]});return Boolean(C)?e(ie,{...ce,children:ht}):ht},Vu=f((()=>Promise.resolve().then((function(){return Ou})).then((e=>({default:e.ListBoxComponent}))))),Ku=e=>t=>Boolean(e)?t:t?.label??"",qu=({options:t,optionsProps:r,multiple:n,disableClearable:s,freeSolo:a,CircularProgressProps:l,ChipProps:d,showCheckbox:A,CreateFilterOptionsConfig:f,placeholder:g="Select Option",limitTags:w,required:b,enableVirtualized:v,_optionsKey:y,disableCaching:B,error:C,handleChange:x,handleBlur:F,touched:N,value:S,fullWidth:E,disableAdornment:T,isAutoFocus:L,...k})=>{const D=o(-1),I=o(new Map),U=_u(),P=h(Ku(a),[]),O=h((e=>t=>Boolean(e)?t:t?.value??"")(a),[]),R=h(((e,t)=>{if(Array.isArray(e)||(e=[e]),t)return e;return e.map((e=>I.current.has(`${e}`)?I.current.get(`${e}`):{label:e,value:e}))}),[]),[Q,H]=c([]),M=(e,t)=>{t||(D.current=-1),Array.isArray(t)||(t=[t]),t=a?t.map((e=>P(e)??"")):t.map((e=>O(e)??"")),!Boolean(n)&&Array.isArray(t)?x(t[0]):x(t)},_=h((e=>{"backspace"!==e.key.toLowerCase()&&"escape"!==e.key.toLowerCase()||(D.current=-1),"tab"===e.key.toLowerCase()&&-1!==D.current&&Q[D.current]&&M(0,Q[D.current])}),[P,Q,M,D.current]),j=h((e=>{if(I.current.clear(),"function"==typeof e)H((t=>{let i=e(t);return a&&Array.isArray(i)?i.map((e=>Ku(!1)(e))):(Array.isArray(i)&&i.map((e=>{I.current.set(`${O(e)}`,e)})),i)}));else{if(a&&Array.isArray(e)){let t=e.map((e=>Ku(!1)(e)));return void H(t)}Array.isArray(e)&&e.map((e=>{I.current.set(`${O(e)}`,e)})),H(e)}}),[H,P,O]),{loadingOptions:z}=uo(t,j,y,B,r,!0,"",!1),V=N&&""!==(C??"");return e(m,{fallback:"loading...",children:e(Ai,{...k,className:T?U.root:"",defaultValue:[],limitTags:w??2,multiple:n,disableClearable:s,options:Q,autoHighlight:!0,freeSolo:a,getOptionLabel:P,value:z?[]:n?R(S,a):R(S,a)[0],isOptionEqualToValue:(e,t)=>a?e===t:e.value===t.value,PaperComponent:({children:t})=>e("div",{style:{width:"fit-content",background:"white",boxShadow:"rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px",overflow:"hidden",maxWidth:"320px",minWidth:"max(120px, 100%)"},children:t}),ListboxComponent:Boolean(v)?Vu:void 0,onKeyDown:_,onChange:M,onBlur:()=>{D.current=-1,F()},onHighlightChange:(e,t)=>{D.current="mousemove"!==e?.type?Q.indexOf(t):-1},filterOptions:Boolean(f)&&"object"==typeof f?pi(f):(e,t)=>{const i=t.inputValue.toLowerCase();return e.filter((e=>e.label.toLowerCase().includes(i))).sort(((e,t)=>{const r=e.label.toLowerCase().startsWith(i),n=t.label.toLowerCase().startsWith(i);return r&&!n?-1:!r&&n?1:0}))},renderTags:(e,t)=>e.map(((e,i)=>u(mi,"string"==typeof e?{variant:"outlined",...d,label:e,...t({index:i}),key:e}:{variant:"outlined",...d,label:e.label,...t({index:i}),key:`${e.label}-${i}`}))),renderInput:t=>e(gi,{...t,...t.InputProps,placeholder:g,autoComplete:"disabled",type:"text",error:V,required:b,fullWidth:E,autoFocus:L,disableUnderline:!0,endAdornment:i(p,{children:[z?e(re,{size:25,color:"secondary",variant:"indeterminate",...l}):null,t.InputProps.endAdornment]})}),renderOption:(t,r,n)=>{t.key=t.id;let{selected:s,inputValue:a}=n,o=P(r);const l=wi(o,a),h=bi(o,l).map(((t,i)=>e("span",{style:{fontWeight:t.highlight?700:400},children:t.text},i)));return e(pe,{title:o,children:i("li",{style:{whiteSpace:"pre",width:"max-content",minWidth:"100%"},...t,children:[A?e(so,{checked:s}):null,h]})})}})})},Gu=({options:t,MenuItemProps:i,SelectProps:r,multiple:n,showCheckbox:s,CircularProgressProps:a,handleBlur:o,handleChange:l,error:d,touched:A,value:p,loading:f,readOnly:g,_optionsKey:m,disableCaching:w,optionsProps:b,skipDefaultOption:v=!1,defaultOptionLabel:y,enableDefaultOption:C=!1,...x})=>{const[F,N]=c([]),S=Boolean(A)&&Boolean(d),{loadingOptions:E}=uo(t,N,m,w,b,v,y,C),T=h((e=>po(F)(e)),[F]),L=h((e=>{const t="object"==typeof e?e?.target?.value??"":e;let i=T(t);i=n?i:i[0],"00"===t&&(e.target.value=""),l(e,i)}),[l,T,n]),k=F.map(((t,r)=>u(te,{...i,key:t.value??r,value:t.value,disabled:t.disabled,style:{fontWeight:"00"===t.value?500:"inherit"}},s?e(so,{checked:Boolean(n)?Array.isArray(p)&&p.indexOf(t.value)>=0:p===t.value}):null,t.label)));return e(Ti,{...x,value:n&&!Array.isArray(p)?[p]:Boolean(p)?p:"string"==typeof p?"00":p,error:S,onChange:L,onBlur:o,native:!1,multiple:n,renderValue:n?po(F,!0):void 0,style:{fontWeight:"00"===(n&&!Array.isArray(p)?[p]:Boolean(p)?p:"string"==typeof p?"00":p)?"500":""},input:e(gi,{sx:{"& > .MuiSvgIcon-root.MuiSelect-icon":{right:"-0.5px"}},endAdornment:f||E?e(B,{position:"end",children:e(re,{color:"primary",variant:"indeterminate",...a})}):null,disableUnderline:!0}),readOnly:g,IconComponent:r?.IconComponent,children:k})};function Wu(t){const{inputRef:i,onChange:r,MaskProps:n,...s}=t;return e(Li,{...s,inputRef:i,onAccept:(e,t)=>{r({target:{value:t.unmaskedValue}})},...n})}function Ju(t){const{inputRef:i,onChange:r,FormatProps:n,...s}=t;return e(Ht,{...s,getInputRef:i,onValueChange:e=>{r({target:{name:t.name,value:e.value,formattedValue:e.formattedValue}},e.formattedValue)},valueIsNumericString:!1,...n})}const Xu=xi((e=>({tooltip:{backgroundColor:"#f5f5f9",color:"rgba(0, 0, 0, 0.87)",maxWidth:220,fontSize:e.typography.pxToRem(12),border:"1px solid #dadde9"}})))(ki),Yu=({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:s,postValidationSetCrossFieldValues:o,runPostValidationHookAlways:d,dependentFields:A,fieldKey:p,label:f,FormControlProps:g,FormHelperTextProps:m,FormControlLabelProps:w,GridProps:b,enableGrid:v,runValidationOnDependentFieldsChange:y,skipValueUpdateFromCrossFieldWhenReadOnly:B,ignoreInSubmit:C=!1,setFieldLabel:x,runPostValidationForInitValue:F,...N})=>{const[S,E]=c(b),{value:T,error:L,touched:k,handleChange:D,handleBlur:I,isSubmitting:U,fieldKey:P,name:O,excluded:R,readOnly:Q,whenToRunValidation:H,incomingMessage:M,runValidation:_,setIgnoreInSubmit:j,dependentValues:z,formState:V}=Js({name:t,fieldKey:p,dependentFields:A,validate:i,validationRun:r,runPostValidationHookAlways:d,postValidationSetCrossFieldValues:o,isReadOnly:s,shouldExclude:n,runValidationOnDependentFieldsChange:y,skipValueUpdateFromCrossFieldWhenReadOnly:B,runPostValidationForInitValue:F});l((()=>{if(Boolean(C))if("function"==typeof C){let e=C(ta(z),V,{isSubmitting:U,value:T});j(e)}else j(C)}),[C,j,z,T]),l((()=>{if(null!==M&&"object"==typeof M){const{value:e,ignoreUpdate:t,GridProps:i}=M;if("object"==typeof i){const e={...b,xs:i?.xs??b?.xs??"auto",md:i?.md??b?.md??"auto",xl:i?.xl??i?.md??b?.xl??"auto",sm:i?.sm??b?.sm??"auto",lg:i?.lg??i?.md??b?.lg??"auto"};E(e)}"boolean"==typeof e&&(D(e),t||"onBlur"!==H||_({value:e},!0))}}),[M,D,_,H]);const K=h((e=>{const{value:t,checked:i}=e.target;e.target.value="boolean"==typeof i&&i,D(e)}),[D]),q=a((()=>{if("function"==typeof x)return x(ta(z),T)}),[x,z,T]);if(R)return null;const W=k&&""!==(L??""),J=u($e,{...g,key:P,component:"fieldset",disabled:U||Q,error:!U&&W,onBlur:I},e(Ye,{...w,name:O,control:e(so,{...N,readOnly:Q,tabIndex:Q?-1:void 0}),onChange:K,label:q?.label?G(q.label):f,checked:Boolean("string"==typeof T?"Y"===T||"true"===T:T)}),!U&&W?e(Ze,{...m,children:L}):null);return Boolean(v)?u(ie,{style:{alignSelf:"center"},...S,key:P},J):J},$u=(e,t)=>Array.isArray(e)&&e.indexOf(t)>-1;var Zu=Object.freeze({__proto__:null,Checkbox:Yu,CheckboxGroup:({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:s,postValidationSetCrossFieldValues:a,runPostValidationHookAlways:o,dependentFields:l,fieldKey:d,label:A,options:p,FormControlProps:f,FormLabelProps:g,FormGroupProps:m,FormHelperTextProps:w,FormControlLabelProps:b,GridProps:v,enableGrid:y,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x,CircularProgressProps:F,_optionsKey:N,disableCaching:S,...E})=>{const{formState:T,value:L,error:k,touched:D,handleChange:I,handleBlur:U,isSubmitting:P,fieldKey:O,name:R,excluded:Q,readOnly:H,dependentValues:M,incomingMessage:_,runValidation:j,whenToRunValidation:z,setIncomingMessage:V}=Js({name:t,fieldKey:d,dependentFields:l,validate:i,validationRun:r,runPostValidationHookAlways:o,postValidationSetCrossFieldValues:a,isReadOnly:s,shouldExclude:n,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x}),[K,q]=c([]),G=h((e=>po(K)(e)),[K]),W=h((e=>{let t=G("object"==typeof e?e?.target?.value??"":e);I(e,t[0])}),[I,G]),{loadingOptions:J}=co(T,p,q,W,M,_,j,z,N,S,V,!0,"",!1);if(Q)return null;const X=D&&""!==(k??""),Y=K.map((t=>u(Ye,{...b,control:e(so,{...E,readOnly:H,tabIndex:H?-1:void 0}),key:t.value,name:R,onChange:W,label:t.label,value:t.value,checked:$u(L,t.value)}))),$=u($e,{...f,key:O,component:"fieldset",disabled:P,error:!P&&X,onBlur:U},e(Je,{...g,component:"label",children:A}),e(Xe,{...m,children:J?e(B,{position:"end",children:e(re,{color:"primary",variant:"indeterminate",...F})}):Y}),!P&&X?e(Ze,{...w,children:k}):null);return Boolean(y)?u(ie,{...v,key:O},$):$}});const eA=Ci((e=>({wrapperclass:{textAlign:"center","& div":{"& fieldset":{verticalAlign:"middle","& label":{marginLeft:0,marginRight:0}}}}}))),tA=Ci((()=>({wrapperclass:{textAlign:"center","& div":{"& fieldset":{verticalAlign:"middle","& label":{marginLeft:0,marginRight:0}}}}})));as.registerFn("currency",Gd),as.registerFn("date",(t=>{const{commonDateFormat:i}=Ws(),{value:r,column:{dateFormat:n,showTooltip:s,tooltipPlacement:a="bottom-start"}}=t;if(!Boolean(r))return e($a,{...t});const o=new Date(r);let l;try{const t=z(o,(Boolean(n)?n:i)||"dd/MM/yyyy hh:mm aaa");l=s?e(pe,{title:t,placement:a,children:e("span",{children:t})}):t}catch(e){l="-"}return e($a,{...t,children:l})})),as.registerFn("default",Za),as.registerFn("icondefault",(t=>{const{value:i,column:{showTooltip:r=!1,tooltipPlacement:n="bottom-start",transform:s=e=>e,isAutoSequence:o=!1,isImageURL:h=!1,shouldExclude:d},row:u}=t,[A,p]=c(null);let f;f=o?Number(u?.index??0)+1:s(i);const g=a((()=>"function"==typeof d&&d(f,u?.original)),[f,u.original]);if(l((()=>{if(Boolean(f)){let e="";if(h)e=f;else{let t=ra(f);e="object"==typeof t&&Boolean(t)?URL.createObjectURL(t):""}p(e)}}),[f]),g)return e($a,{showBorder:!0,...t});let m=r?e(ki,{title:f,placement:n,children:e("div",{children:e(Hi,{alt:"User",src:Boolean(A)?A:"",style:{width:"30px",height:"30px",borderRadius:0}})})}):e("div",{children:e(Hi,{alt:"User",src:Boolean(A)?A:"",style:{width:"30px",height:"30px",borderRadius:0}})});return e($a,{...t,children:m})})),as.registerFn("editableAutocomplete",(t=>{const{value:r,rows:n,row:{index:s,original:o},column:{id:h,options:d,validation:u,_optionsKey:A,disableCachingOptions:p,disableAdornment:f,placeholder:g,isReadOnly:m,isAutoFocus:w,__EDIT__:b},updateGridData:v,gridProps:y,loading:B,hiddenFlag:C,loading:x}=t,F=n.slice(0,s).map((e=>e?.original)).filter((e=>!0!==Boolean(e[C]))),N=n.slice(s+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[C]))),S=Boolean(o?._touched?.[h]),E=o?._error?.[h]??"",[T,L]=c(!1),[k,D]=c(r),{t:I}=ne(),U=e=>{D(e)},P=()=>{L(!0),u(k,o,F,N).then((e=>{L(!1),v(s,h,k,!0,e)}))};l((()=>{D(r)}),[r]);const O=a((()=>!0===o?._isReadOnly||!0!==o?._isNewRow&&(!!m||!1===o?._isNewRow&&!0===b?.isReadOnly)),[m,o,b]);return i($a,{showBorder:!0,...t,children:[e(qu,{value:k,onChange:U,onBlur:P,fullWidth:!0,error:E,touched:S,handleChange:U,handleBlur:P,options:d,loading:x,disabled:x||B,_optionsKey:A,optionsProps:y,disableCaching:p,showCheckbox:!1,renderInput:()=>null,placeholder:String(I(g)),disableAdornment:f,readOnly:O,isAutoFocus:w}),Boolean(S)&&Boolean(E)?e(we,{style:{whiteSpace:"break-spaces"},error:!0,children:I(E)}):null]})})),as.registerFn("editableSelect",(t=>{const{value:r,rows:n,row:{index:s,original:o},column:{id:h,options:d,validation:u,_optionsKey:A,disableCachingOptions:p,skipDefaultOption:f,defaultOptionLabel:g,requestProps:m,isReadOnly:w,__EDIT__:b,dependentOptionField:v,enableDefaultOption:y},updateGridData:B,gridProps:C,hiddenFlag:x,loading:F}=t,N=Boolean(o?._touched?.[h]),S=o?._error?.[h]??"",[E,T]=c(!1),[L,k]=c(r),D=a((()=>!0===o?._isReadOnly||!0!==o?._isNewRow&&(!!w||!1===o?._isNewRow&&!0===b?.isReadOnly)),[w,o,b]);let I=Boolean(v)?o[v]:m;const U=n.slice(0,s).map((e=>e?.original)).filter((e=>!0!==Boolean(e[x]))),P=n.slice(s+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[x]))),O=e=>{k(e.target.value)},R=()=>{T(!0),u(L,o,U,P).then((e=>{T(!1),B(s,h,L,!0,e)}))};return l((()=>{k(r)}),[r,S]),i($a,{showBorder:!0,...t,children:[e(Gu,{value:L,onChange:O,onBlur:R,fullWidth:!0,touched:N,error:S,handleChange:O,handleBlur:R,options:d,loading:E,disabled:E||F||D,_optionsKey:A,optionsProps:I,disableCaching:p,skipDefaultOption:f,defaultOptionLabel:g,enableDefaultOption:y,CircularProgressProps:{color:"secondary",size:20},SelectProps:E||F||D?{IconComponent:()=>null}:void 0}),Boolean(N)&&Boolean(S)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:S}):null]})})),as.registerFn("editableTextField",(t=>{const{value:r,rows:n,row:{index:s,original:h},column:{id:d,validation:u,isPassword:A,TableCellProps:p,isDisabledOnBlurEvent:f,maxLength:g,placeholder:m,autoComplete:w,isAutoFocus:b,multiline:x,minRows:F,maxRows:N,isReadOnly:S,__EDIT__:E},updateGridData:T,hiddenFlag:L,loading:k}=t,D=n.slice(0,s).map((e=>e?.original)).filter((e=>!0!==Boolean(e[L]))),I=n.slice(s+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[L]))),U=Boolean(h?._touched?.[d]),P=h?._error?.[d]??"",O=o(Boolean(A)),[R,Q]=c(Boolean(A)?"password":"text"),[H,M]=c(!1),[_,j]=c(r),z=o(null),{t:V}=ne(),K=a((()=>!0===h?._isReadOnly||!0!==h?._isNewRow&&(!!S||!1===h?._isNewRow&&!0===E?.isReadOnly)),[S,h,E]),q=()=>{M(!0),u(_,h,D,I).then((e=>{M(!1),T(s,d,_,!0,e)}))};return l((()=>{Boolean(f)&&q()}),[_]),l((()=>{!Boolean(_)&&Boolean(b)&&n.length===s+1&&z?.current?.firstChild?.focus?.()}),[s,b]),l((()=>{j(r)}),[r]),i($a,{showBorder:!0,...t,children:[e(gi,{name:d,value:"string"==typeof _?_.trimStart():_,onChange:e=>{e.target.value.length<=(g??200)&&j(e.target.value)},onFocus:e=>{e.target.select()},type:R,onBlur:()=>{Boolean(f)||q()},multiline:x,minRows:F??"",maxRows:N??"",margin:"none",fullWidth:!0,error:Boolean(U)&&Boolean(P),placeholder:String(V(m)),autoComplete:w,endAdornment:O.current?e(B,{position:"end",children:e(C,{"aria-label":"toggle password visibility",onClick:()=>Q((e=>"password"===e?"text":"password")),onMouseDown:e=>{e.preventDefault()},children:e("password"===R?v:y,{})})}):null,style:{marginTop:"0px",direction:"right"===p?.align?"rtl":"ltr"},disableUnderline:!0,disabled:k||H,readOnly:K,ref:z}),Boolean(U)&&Boolean(P)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:P}):null]})})),as.registerFn("editableMaskInputField",(t=>{const{value:r,rows:n,row:{index:s,original:a},column:{id:o,validation:l,MaskProps:h},updateGridData:d,hiddenFlag:u}=t,A=Boolean(a?._touched?.[o]),p=a?._error?.[o]??"",[f,g]=c(!1),[m,w]=c(r),b=n.slice(0,s).map((e=>e?.original)).filter((e=>!0!==Boolean(e[u]))),v=n.slice(s+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[u])));return i($a,{showBorder:!0,...t,children:[e(gi,{name:o,value:m,onChange:e=>{w(e.target.value)},onFocus:e=>{e.target.select()},onBlur:()=>{g(!0),l(m,a,b,v).then((e=>{g(!1),d(s,o,m,!0,e)}))},fullWidth:!0,margin:"none",disableUnderline:!0,error:Boolean(A)&&Boolean(p),inputComponent:Wu,inputProps:{MaskProps:h},disabled:f}),Boolean(A)&&Boolean(p)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:p}):null]})})),as.registerFn("editableNumberFormat",(t=>{const{value:r,rows:n,row:{index:s,original:h},column:{id:d,validation:u,FormatProps:A,placeholder:p="",enableNumWords:f,className:g,isReadOnly:m,__EDIT__:w,isDisabledOnBlurEvent:b,autoComplete:v,isAutoFocus:y},updateGridData:B,hiddenFlag:C,loading:x}=t,F=n.slice(0,s).map((e=>e?.original)).filter((e=>!0!==Boolean(e[C]))),N=n.slice(s+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[C]))),S=Boolean(h?._touched?.[d]),E=h?._error?.[d]??"",[T,L]=c(!1),[k,D]=c(r),I=o(null),{t:U}=ne(),P=a((()=>!0===h?._isReadOnly||!0!==h?._isNewRow&&(!!m||!1===h?._isNewRow&&!0===w?.isReadOnly)),[m,h,w]);let O=null;try{if(f&&Boolean(k)){let e=String(k).split("."),t=Number(e[0]);t<0?(t=Math.abs(Number(t)),O=`Negative ${yo(t)} Rupees`):O=`${yo(t)} Rupees`,2===e.length&&Boolean(e[1])&&(O=`${O} and ${yo(e[1])} paise`)}}catch(e){}const R=()=>{L(!0),u(k,h,F,N).then((e=>{L(!1),B(s,d,k,!0,e)}))};return l((()=>{Boolean(b)&&R()}),[k]),l((()=>{!Boolean(k)&&Boolean(y)&&n.length===s+1&&I?.current?.firstChild?.focus?.()}),[n,s,y]),i($a,{showBorder:!0,...t,children:[e(gi,{name:d,value:k,onChange:e=>{D(e.target.value)},onFocus:e=>{e.target.select()},onBlur:()=>{Boolean(b)||R()},placeholder:String(U(p)),fullWidth:!0,margin:"none",disableUnderline:!0,error:Boolean(S)&&Boolean(E),inputComponent:Ju,inputProps:{FormatProps:A},disabled:T||x,className:g,readOnly:x||P,autoComplete:v,ref:I}),Boolean(S)&&Boolean(E)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:E}):Boolean(f)?e(Ze,{style:{whiteSpace:"break-spaces"},children:O}):null]})})),as.registerFn("editableNumberFormatLessValidation",(t=>{const{value:r,rows:n,row:{index:s,original:a},column:{id:h,validation:d,FormatProps:u,placeholder:A="",enableNumWords:p,className:f,isDisabledOnBlurEvent:g},updateGridData:m,hiddenFlag:w,loading:b}=t,v=[],y=[],B=Boolean(a?._touched?.[h]),C=a?._error?.[h]??"",x=o(!0),[F,N]=c(!1),[S,E]=c(r),{t:T}=ne();const L=()=>{N(!0),d(S,a,v,y).then((e=>{N(!1),m(s,h,S,!0,e)}))};return l((()=>{Boolean(g)&&!x.current&&L(),x.current=!1}),[S]),i($a,{showBorder:!0,...t,children:[e(gi,{name:h,value:S,onChange:e=>{E(e.target.value)},onFocus:e=>{e.target.select()},onBlur:()=>{Boolean(g)||L()},placeholder:String(T(A)),fullWidth:!0,margin:"none",disableUnderline:!0,error:Boolean(B)&&Boolean(C),inputComponent:Ju,inputProps:{FormatProps:u},disabled:F,className:f,readOnly:b}),Boolean(B)&&Boolean(C)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:C}):Boolean(p)?e(Ze,{style:{whiteSpace:"break-spaces"},children:null}):null]})})),as.registerFn("action",(t=>{let{column:{actions:i},row:r,setGridAction:n,singleActions:s}=t;return Array.isArray(i)||(i=[i]),s=s.filter((e=>i.indexOf(e?.actionName)>=0)),s.length>0&&(s=Vo(s,[r],{},!1)),e($a,{...t,children:e(Ui,{size:"small","aria-label":"actions",children:s.map((t=>e(ct,{onClick:()=>{return e=t.actionName,void n({name:e,rows:[{data:r?.original,id:r?.id}]});var e},children:t.actionLabel})))})})})),as.registerFn("dateDiffere",(t=>{const i=t?.cell?.row?.original??"",r=(new Date).getTime(),n=new Date(i?.due_date).getTime(),s=new Date(i?.completion_date).getTime();let a,o="-";if(""!==n||""===s?a=K(r,n):""===n&&""===s||(a=K(n,s)),"Completed"===i?.status)o="-";else if(a>"0")o=`${a} days over due`;else if(a<"0")o=-1*a+" days left";else if("0"==a){let e=new Date(r-n);var l=Math.floor(e/1e3/60/60);e-=1e3*l*60*60;var h=Math.floor(e/1e3/60);e-=1e3*h*60,l<10&&(l=`0${l}`),h<10&&(h=`0${h}`),o=l+":"+h+" mins left"}return e($a,{...t,children:o})})),as.registerFn("chip",(t=>{const{value:i,column:{transform:r=e=>e}}=t;let n=r(i);return e($a,{...t,children:e(mi,{label:n,variant:"outlined"})})})),as.registerFn("multipleValuesCellRenderer",(t=>{const{row:{original:r},column:{_accessor:n}}=t;let s=r[n],a=Array.isArray(s),o=s.map(((t,i)=>e("li",{children:t},i)));return i($a,{positionRelative:!0,...t,children:[a?s[0]:"-",a&&s.length>1?e(Xu,{title:e("ul",{style:{padding:0,listStyle:"none",margin:"0px 0px"},children:o}),children:e(Pi,{style:{position:"absolute",right:"5px",top:"5px",color:"#8d868685"}})}):null]})})),as.registerFn("deleteRowCell",(t=>{const{value:i,row:{index:r,original:n},column:{id:s,shouldExclude:o,buttonLabel:l,showDeleteIconOnly:h=!1},updateGridData:c,data:d}=t,{t:u}=ne(),A=a((()=>"function"==typeof o&&o(i,n,d,r)),[i,n,d,r]),p=e=>{c(r,s,!0,!0,"")};return e($a,A?{showBorder:!0,...t}:{showBorder:!0,...t,children:h?e(Be,{onClick:p,sx:{width:"35px",height:"35px","&:hover":{background:"#fccfcf"},color:"#ff2626"},children:e(Oi,{})}):e(ct,{onClick:p,fullWidth:!0,variant:"contained",color:"secondary",style:{height:"28px"},children:Boolean(l)?u(l):u("Delete")})})})),as.registerFn("buttonRowCell",Ec),as.registerFn("percentageDiff",(t=>{const i=t?.cell?.row?.original??"";let r=0;const n=Number(i?.fromPercentage),s=Number(i?.toPercentage);return isNaN(n)||isNaN(s)||(r=s-n+"%"),e($a,{...t,children:r})})),as.registerFn("editableCheckbox",(t=>{const{value:r,rows:n,row:{index:s,original:o},column:{id:h,validation:d,isReadOnly:u,setValueFUNC:A,shouldExclude:p,__EDIT__:f},updateGridData:g,hiddenFlag:m,loading:w}=t,b=Boolean(o?._touched?.[h]),v=o?._error?.[h]??"",[y,B]=c(!1),C=eA(),[x,F]=c(r),N=n.slice(0,s).map((e=>e?.original)).filter((e=>!0!==Boolean(e[m]))),S=n.slice(s+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[m]))),E=a((()=>"function"==typeof p&&p(r,o,N,S)),[r,N,S,o]),T=a((()=>u?"function"!=typeof u||u(r,o,N,S):!0===o?._isReadOnly||!0!==o?._isNewRow&&(!1===o?._isNewRow&&!0===f?.isReadOnly)),[u,o,f]);return l((()=>{F(r)}),[r,v]),e($a,E?{showBorder:!0,...t}:{...t,children:i("div",{className:C.wrapperclass,children:[e(Yu,{checked:Boolean("string"==typeof x?"Y"===x||"true"===x||"N"!==x&&"false"!==x&&x:x),onChange:e=>{let t=e.target.checked;"function"==typeof A&&(t=A(t)),F(t)},onBlur:()=>{B(!0),d(x,o,N,S).then((e=>{B(!1);g(s,h,"Y"===x||!0===x?"Y":"N",!0,e)}))},disabled:y||w||T,enableGrid:!0,name:h,label:"",fieldKey:h}),Boolean(b)&&Boolean(v)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:v}):null]})})})),as.registerFn("editableDatetimePicker",(t=>{const{commonDateTimeFormat:r}=Ws(),{value:n,rows:s,row:{index:o,original:h},column:{id:d,validation:u,dateFormat:A,mindate:p,isReadOnly:f,__EDIT__:g},updateGridData:m,hiddenFlag:w,loading:b}=t,v=Boolean(h?._touched?.[d]),y=h?._error?.[d]??"",[B,C]=c(!1),[x,F]=c(n),N=a((()=>!!f||!1===h?._isNewRow&&!0===g?.isReadOnly),[f,h?._isNewRow,g]),S=s.slice(0,o).map((e=>e?.original)).filter((e=>!0!==Boolean(e[w]))),E=s.slice(o+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[w])));return l((()=>{F(n)}),[n]),i($a,{showBorder:!0,...t,children:[e(Ri,{dateAdapter:Qi,children:e(Lo,{format:(Boolean(A)?A:r)||"dd/MM/yyyy HH:mm:ss",onChange:e=>{F(e),u(e,h,S,E).then((t=>{const i=e?new Date(e):e;let r=ca(i)?z(i,"yyyy-MM-dd HH:mm:ss.S"):i;m(o,d,r,!0,t)}))},value:""===x||null===x?null:pa(x),disabled:B||b,readOnly:N,minDate:p||new Date("1900-01-01"),views:["year","month","day","hours","minutes","seconds"],slotProps:{textField:{onBlur:()=>{C(!0),u(x,h,S,E).then((e=>{C(!1);const t=x?new Date(x):x;let i=ca(t)?z(t,"yyyy-MM-dd HH:mm:ss.S"):t;m(o,d,i,!0,e)}))},name:d,"aria-label":"Select Date",autoComplete:"off",InputProps:{disableUnderline:!0},InputLabelProps:{shrink:!0}},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%"}})}),Boolean(v)&&Boolean(y)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:y}):null]})})),as.registerFn("editableDatePicker",(t=>{const{commonDateFormat:r}=Ws(),[n,s]=c(null),{authState:o}=Vs(),{value:h,rows:d,row:{index:u,original:A},column:{id:p,validation:f,dateFormat:g,mindate:m,maxdate:w,disablePast:b,disableFuture:v,disableToday:y,isReadOnly:B,__EDIT__:C},updateGridData:x,hiddenFlag:F,loading:N}=t,S=Boolean(A?._touched?.[p]),E=A?._error?.[p]??"",[T,L]=c(!1),[k,D]=c(h),I=a((()=>!0===A?._isReadOnly||!0!==A?._isNewRow&&(!!B||!1===A?._isNewRow&&!0===C?.isReadOnly)),[B,A,C]),U=d.slice(0,u).map((e=>e?.original)).filter((e=>!0!==Boolean(e[F]))),P=d.slice(u+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[F]))),O=e=>{D(e),f(e,A,U,P).then((t=>{const i=e?new Date(e):e;let r=ca(i)?z(i,"yyyy-MM-dd HH:mm:ss.S"):i;x(u,p,r,!0,t)}))};return l((()=>{D(h)}),[h]),i($a,{showBorder:!0,...t,children:[e(Ri,{dateAdapter:Qi,children:e(Eo,{format:(Boolean(g)?g:r)||"dd/MM/yyyy",onChange:O,value:""===k||null===k?null:pa(k),disabled:T||N,readOnly:I,minDate:m||new Date("1900-01-01"),maxDate:w||null,disablePast:b,disableFuture:v,onSelectedSectionsChange:e=>{s(e)},selectedSections:n,slotProps:{textField:{onBlur:()=>{L(!0),f(k,A,U,P).then((e=>{L(!1);const t=k?new Date(k):k;let i=ca(t)?z(t,"yyyy-MM-dd HH:mm:ss.S"):t;x(u,p,i,!0,e)}))},onKeyDown:e=>{const t=g??r;if(!o?.workingDate||"ArrowUp"!==e.key&&"ArrowDown"!==e.key){if("Home"===e.key)s(0);else if("End"===e.key){const e=t.includes("/")?"/":t.includes("-")?"-":null,i=e?t.split(e).length:1;s(i-1)}}else{const i=e.target.value;if(!V(k)&&i?.toLowerCase()===t?.toLowerCase()){const t=o?.workingDate;let i="";"ArrowUp"===e.key?i=(new Date).setDate(new Date(t).getDate()+1):"ArrowDown"===e.key&&(i=(new Date).setDate(new Date(t).getDate()-1)),setTimeout((()=>O(new Date(i))),0)}}},"aria-label":"Select Date",name:p,autoComplete:"off",InputLabelProps:{shrink:!0},InputProps:{disableUnderline:!0}},actionBar:{actions:y?["accept","cancel"]:["today","accept","cancel"]}}})}),Boolean(S)&&Boolean(E)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:E}):null]})})),as.registerFn("disableSelect",(t=>{const{value:r,rows:n,row:{index:s,original:a},column:{id:o,options:h,validation:d,_optionsKey:u,disableCachingOptions:A,defaultOptionLabel:p,requestProps:f},updateGridData:g,gridProps:m,hiddenFlag:w,loading:b}=t,v=Boolean(a?._touched?.[o]),y=a?._error?.[o]??"",[B,C]=c(!1),[x,F]=c(r);const N=n.slice(0,s).map((e=>e?.original)).filter((e=>!0!==Boolean(e[w]))),S=n.slice(s+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[w]))),E=e=>{F(e.target.value)},T=()=>{C(!0),d(x,a,N,S).then((e=>{C(!1),g(s,o,x,!0,e)}))};return l((()=>{F(r)}),[r,y]),i($a,{showBorder:!0,...t,children:[e(Gu,{value:x,onChange:E,onBlur:T,fullWidth:!0,touched:v,error:y,handleChange:E,handleBlur:T,options:h,loading:B,disabled:!0,_optionsKey:u,optionsProps:f,disableCaching:A,defaultOptionLabel:p,CircularProgressProps:{color:"secondary",size:20},readOnly:!0,SelectProps:{IconComponent:()=>null}}),Boolean(v)&&Boolean(y)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:y}):null]})})),as.registerFn("customIconCell",(t=>{const{value:r,row:{index:n,original:s},column:{id:a,isReadOnly:o,activeIcon:{icon:h,tooltip:d},inActiveIcon:{icon:u,tooltip:A}},loading:p,onButtonActionHandel:f}=t,g=Boolean(s?._touched?.[a]),m=s?._error?.[a]??"",w=tA(),[b,v]=c(r),y=()=>{"function"==typeof f&&f(n,a)};return l((()=>{v(r)}),[r,m]),e($a,{...t,children:i("div",{className:w.wrapperclass,children:[Boolean(b)?e(pe,{title:d,children:e(Be,{name:a,onClick:y,disabled:p||o,size:"small",children:h??""})}):e(pe,{title:A,children:e(Be,{onClick:y,disabled:p||o,size:"small",children:u??""})}),Boolean(g)&&Boolean(m)?e(we,{style:{whiteSpace:"break-spaces"},error:!0,children:m}):null]})})}));Ka(":root{--theme-color1:maroon;--theme-color2:#fedad8;--theme-color3:#fe0000;--theme-color4:#fcbab7;--theme-color5:#efe0e0;--white:#fff;--white-dim:#ffffff8a;--primary-bg:linear-gradient(45deg,maroon,#ff5a5a);--report-export-theme:maroon;--old-value-text-primary:#7b4f00;--old-value-bg-primary:#fff8dc}");const iA=Ce("div")((({theme:e,ownerState:t})=>({backgroundColor:"dark"===e.palette.mode?e.palette.grey[700]:"#ccc",zIndex:1,color:"#fff",width:30,height:30,display:"flex",borderRadius:"50%",justifyContent:"center",alignItems:"center",...t.active&&{background:"var(--theme-color1)",boxShadow:"0 4px 10px 0 rgba(0,0,0,.25)"},...t.completed&&{background:"var(--theme-color1)"}}))),rA=Ce(Mi)((({theme:e})=>({[`&.${_i.alternativeLabel}`]:{top:15,left:"calc(-50% + 10px)"},[`&.${_i.active}`]:{[`& .${_i.line}`]:{background:"var(--theme-color1)"}},[`&.${_i.completed}`]:{[`& .${_i.line}`]:{background:"var(--theme-color1)"}},[`& .${_i.line}`]:{height:3,border:0,backgroundColor:"dark"===e.palette.mode?e.palette.grey[800]:"#eaeaf0",borderRadius:1}}))),nA=n(null),sA=({gridCode:t,getGridData:i,children:r})=>"function"!=typeof i?e("div",{children:"Invalid Grid FNS passed"}):e(nA.Provider,{value:{getGridData:i,gridCode:t},children:r}),aA=({column:t,visibleColumns:r,setColumnOrder:n,allowColumnReordering:s})=>{const[{isDragging:a},l]=wt({type:"Column",collect:e=>({isDragging:!!e.isDragging()}),end:(e,i)=>{if(i.didDrop()){const{id:e}=i.getDropResult(),a=r.map((e=>e.id)),o=a.indexOf(e),l=a.indexOf(t.id);var s=a[o];a[o]=a[l],a[l]=s,n(a)}},canDrag:()=>s}),[{isOver:h},c]=bt({accept:"Column",drop:()=>({id:t.id}),collect:e=>({isOver:s&&!!e.isOver()}),canDrop:()=>s}),d=o(null);return l(c(d)),i(p,{children:[e(Vi,{active:t.isSorted,direction:t.isSortedDesc?"desc":"asc",hideSortIcon:!0,ref:d,...t.getSortByToggleProps([{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",color:"var(--theme-color1)",fontSize:"1 rem",fontWeight:"600",opacity:a||h?.5:1,cursor:a?"move":"default"}}]),children:e("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingRight:"10px"},children:t.columnName})}),e("div",{...t.getResizerProps([{style:{minHeight:"26px",opacity:1,color:"rgba(224, 224, 224, 1)",right:"0px",display:"flex",zIndex:100,position:"absolute",flexDirection:"column",justifyContent:"center"}}]),children:e("svg",{focusable:"false",viewBox:"0 0 24 24","aria-hidden":"true","data-testid":"SeparatorIcon",style:{color:"inherit",userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,transition:"fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",fontSize:"20px"},children:e("path",{d:"M11 19V5h2v14z"})})})]})},oA=xi((e=>({root:{"&.Mui-checked":{color:"var(--theme-color1)"},"&.MuiCheckbox-indeterminate":{color:e.palette.text.secondary}},checked:{}})))(ui),lA=({row:t,cell:i})=>e(ci,{component:"div",variant:"head",...i.getCellProps([{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 10px",lineHeight:"28px"}}]),children:e(oA,{size:"small",...t.getToggleRowSelectedProps([{style:{padding:0,position:"sticky",background:"white",left:0,zIndex:1}}])})}),hA=({getToggleAllPageRowsSelectedProps:t})=>e(oA,{size:"small",...t([{style:{padding:0,position:"sticky",left:0,zIndex:1}}])}),cA=Ci((e=>({root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),background:"var(--primary-bg)",borderTopLeftRadius:"4px",borderTopRightRadius:"4px"},title:{color:"var(--white)",letterSpacing:"1px",fontSize:"1.25rem"},refreshiconhover:{}}))),dA=d((({dense:t,label:r,visibleColumns:n,defaultHiddenColumns:s,allowColumnHiding:a,setGridAction:o,selectedFlatRows:l,alwaysAvailableAction:h,allowFilter:c,setAllFilters:d,gotoPage:u,setSortBy:A,filterMeta:p,filters:f,autoRefreshInterval:g,loading:m,enableExport:w,setOpenExport:b,headerToolbarStyle:v},y)=>{const B=cA(),{defaultGridConfig:x}=Ws(),{progress:F,enabled:N,intervalElapsed:S,pause:E,resume:T}=kl(y?.current?.fetchData,g);return i(si,{className:se(B.root,"server__grid__header"),variant:t?"dense":"regular",sx:v,children:[e(vt,{className:B.title,color:"inherit",variant:"h6",component:"div",children:r}),i("div",{style:{display:"flex",alignItems:"center",marginLeft:"auto"},children:[c?e(Ul,{setAllFilters:d,filters:f,filterMeta:p,gotoPage:u,setSortBy:A,classes:B}):null,e(C,{"aria-label":"refresh","aria-controls":"button","aria-haspopup":"false",onClick:()=>y?.current?.fetchData?.(),color:"primary",className:B.refreshiconhover,children:e(qi,{})}),N?e(Dl,{variant:"determinate",value:F,interval:S,pause:E,resume:T}):null,a?e(Ol,{visibleColumns:n,defaultHiddenColumns:s,classes:B}):null,!m&&w?e(Ae,{control:e(pe,{title:G("Showexportoptions"),children:i(ae,{onClick:()=>{b(!0)},style:{color:"white",background:x?.isContainedActionButton?"var(--primary-bg)":"inherit",boxShadow:x?.isContainedActionButton?"2px 2px 4px 0px rgba(0,0,0,.2)":"none"},children:[G("Export")," ",e(Gi,{})]})}),sx:{color:"var(--white)",margin:"0 !important"},label:""}):null,e(Nl,{actions:h??[],setAction:o,selectedRows:l},"alwaysRender")]})]})})),uA=d((({label:r,dense:n,columns:s,defaultColumn:h,setData:d,data:u,onFetchData:p,loading:f,getRowId:g,totalRecords:m,pageCount:w,pageSizes:b,defaultPageSize:v,defaultSortOrder:y,defaultFilter:B,defaultHiddenColumns:C,allowColumnReordering:x,allowColumnHiding:F,allowKeyboardNavigation:N,setGridAction:S,multipleActions:E,singleActions:T,doubleClickAction:L,alwaysAvailableAction:k,allowFilter:D,allowRowSelection:I,filterMeta:U,autoRefreshInterval:P,enablePaginationInput:O=!0,finalMetaData:R,enableExport:Q,enablePdfPrint:H,reportTemplateCode:M,variant:_,containerHeight:j,occupiedHeight:z,autoFetch:V,handleReset:K,headerToolbarStyle:q,enableEnterToFocus:G},W)=>{const[J,X]=c(V),{getTableProps:Y,getTableBodyProps:$,headerGroups:Z,prepareRow:ee,rows:te,page:ie,selectedFlatRows:re,gotoPage:se,setPageSize:ae,state:le,setSortBy:he,columns:ce}=Gt({columns:s,defaultColumn:h,data:u,getRowId:g,initialState:{pageIndex:0,pageSize:v,hiddenColumns:C,sortBy:y},manualPagination:!0,pageCount:w,autoResetPage:!1,manualSortBy:!0,autoResetSortBy:!1,manualFilters:!0,autoResetFilters:!1,allowColumnReordering:x,singleActions:T,setGridAction:S},Jt,ri,Yt,Zt,ei,ti,ii,(de=I,e=>{Boolean(de)&&e.visibleColumns.push((e=>[{id:"selectionCheckbox",Header:hA,Cell:lA,minWidth:40,width:40,maxWidth:40},...e]))}));var de;const{authState:ue}=Vs(),[Ae,pe]=c(B),[fe,ge]=c(!1),{t:me}=ne();T=Vo(T,re,ue),E=Vo(E,re,ue),k=Vo(k,ie,ue,!1,!0);const{pageIndex:we,pageSize:be,sortBy:ve}=le,ye=qt(p,500),Be=o(null),[Ce,xe]=c(null),[Fe,Ne]=c(null),[Se,Ee]=c(null),{resume:Te,pause:Le}=Ll();l((()=>{J&&ye({pageIndex:we,pageSize:be,sortBy:ve,filters:Ae})}),[ye,we,be,ve,Ae,J]),A(W,(()=>({fetchData:()=>{J||X(!0),ye({pageIndex:we,pageSize:be,sortBy:ve,filters:Ae})},setData:d,handleReset:()=>{pe([]),he([]),X(!1),se(0),K()},resume:Te,pause:Le})));const ke=a((()=>{const e=e=>{const t=re.length>0&&I?`calc(${j?.[e]} - 48px)`:j?.[e];return t&&z?.[e]?Ae.length?`calc(${t} - ${z?.[e]} - 48px)`:`calc(${t} - ${z?.[e]})`:Ae.length>0?`calc(${t} - 48px)`:t};return{min:e("min"),max:e("max")}}),[re,j,z,Ae]);return i(t,{children:[i(ni,{style:{width:"100%",background:"var(--white)"},children:[e(dA,{ref:W,label:r,dense:n,loading:f,visibleColumns:ce,defaultHiddenColumns:C,allowColumnHiding:F,alwaysAvailableAction:k,setGridAction:S,selectedFlatRows:re,allowFilter:D,setAllFilters:pe,gotoPage:se,setSortBy:he,filters:Ae,filterMeta:U,autoRefreshInterval:P,enableExport:Q&&ie?.length,setOpenExport:ge,headerToolbarStyle:q}),e(Fl,{dense:n,selectedFlatRows:re,multipleActions:E,singleActions:T,setGridAction:S}),e(Sl,{selectedFlatRows:re,contextMenuRow:Fe,multipleActions:E,singleActions:T,setGridAction:S,mouseX:Ce?.mouseX??null,mouseY:Ce?.mouseY??null,handleClose:()=>{Ne(null),xe(null),Ee(null)},authState:ue}),e(Xl,{dense:n,setAllFilters:pe,filters:Ae,gotoPage:se,setSortBy:he}),f?e(gt,{color:"secondary",style:{marginTop:"1px"}}):e(Gl,{}),i(ai,{style:{position:"relative",display:"inline-block",overflow:"auto",padding:"outlined"===_?"0 .5rem":"",maxHeight:ke.max,minHeight:ke.min,borderBottom:"1px solid rgba(133, 130, 130, 0.8)"},children:[i(oi,{component:"div",...Y(),size:n?"small":"medium",children:[e(Hl,{component:"div",sx:{background:"standard"!==_?"var(--theme-color4)":"white"},children:Z.map((t=>e(hi,{component:"div",...t.getHeaderGroupProps(),children:t.headers.map((t=>e(jl,{variant:_,column:t,children:t.render("Header")},t.getHeaderProps().key)))})))}),i(di,{component:"div",ref:Be,...$([{style:{display:"block"}}]),style:{height:`calc(${ke.min} - 62px)`},children:[ie.length<=0&&!1===f?e("div",{style:{position:"absolute",left:"50%",height:`calc(${ke.min} - 50px)`,display:"flex",alignItems:"center",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:me("Nodatafound")}):null,ie.map(((t,i)=>{ee(t);const r=(e=>t=>{t.preventDefault(),Ne(e),Ee(e?.id),xe(null===Ce?{mouseX:t.clientX-2,mouseY:t.clientY-4}:null)})(t),n=(e=>t=>{t.preventDefault(),void 0!==Vo(L,[e],ue,!0)&&S({name:L.actionName,rows:[{data:e?.original,id:e?.id}]})})(t);return e(Ml,{...t.getRowProps(),id:t.id,tabIndex:0,component:"div",selected:t.isSelected||Se===t.id,onKeyDown:N?e=>((e,t)=>{e.stopPropagation();const i=Be.current?.children.namedItem(t.id);let r;switch(e.keyCode){case 38:r=i?.previousElementSibling,null!==r&&(r?.focus(),e.preventDefault(),r.offsetTop>Be.current?.offsetHeight&&console.log("need to scroll here"));break;case 40:r=i?.nextElementSibling,null!==r&&(r?.focus(),e.preventDefault());break;case 32:t.toggleRowSelected(),e.preventDefault()}})(e,t):void 0,onContextMenu:r,onDoubleClick:Boolean(L)?n:void 0,children:t.cells.map((e=>{const{key:t}=e.getCellProps();return e.render("Cell",{key:t})}))})}))]})]}),e(Wl,{open:f})]}),e(Ki,{sx:{display:"flex","& .MuiToolbar-root":{display:"flex",alignItems:"baseline",minHeight:"44px"}},variant:"body",component:"div",rowsPerPageOptions:[...new Set([v,...b])]?.sort(((e,t)=>e-t)),colSpan:3,count:m,rowsPerPage:Number(be),page:Number(we),onPageChange:(e,t)=>{se(t)},onRowsPerPageChange:e=>{ae(Number(e.target.value))},ActionsComponent:O?Kl:Vl})]}),fe?e(oe,{open:fe,children:e(hd,{filters:Ae,title:r,rows:te,columns:R,onClose:()=>{ge(!1)},enablePdfPrint:H,reportTemplateCode:u?.find((e=>e?.REPORT_PERSONALIZATION_ID))?.REPORT_PERSONALIZATION_ID??M,enableEnterToFocus:G})}):null]})})),AA=d((({metaData:r,defaultFilter:n,defaultSortOrder:d,dataTransformer:u,autoRefreshInterval:A,enableExport:p,reportTemplateCode:f,variant:g,autoFetch:m,headerToolbarStyle:w,enableEnterToFocus:b,focusScopeId:v},y)=>{const{authState:B}=Vs(),{defaultGridConfig:C,defaultExportConfig:x}=Ws(),F=s(nA),{enqueueSnackbar:N}=ji(),{t:S}=ne(),E=a((()=>Array.isArray(r.columns)?r.columns.map((e=>({...e,columnName:S(e.columnName)}))):r.columns??[]),[S]),T=a((()=>Array.isArray(r.filters)?r.filters.map((e=>({...e,columnName:S(e.columnName)}))):r.filters??[]),[S]),L=a((()=>({width:150,maxWidth:400,minWidth:50,Header:aA})),[]),k=a((()=>n),[]),D=a((()=>d),[]),I=h((e=>e[r?.gridConfig?.rowIdColumn]),[r?.gridConfig?.rowIdColumn]),[U,P]=c(!1),[O,R]=c([]),[Q,H]=c(0),[M,_]=c(0),[j,z]=c(null),V=o(0),K=o(null),q=h((()=>{R([]),H(0),_(0),V.current=0}),[]),G=h((({pageSize:e,pageIndex:t,sortBy:i,filters:r})=>{P(!0),z(null);const n=++V.current,s=Number(e)*Number(t)+1,a=Number(s)+Number(e)-1;let o=((e=[])=>(Array.isArray(e)||(e=[e]),e.map(((e,t)=>({ACCESSOR:e.id,CONDITION:e.value.condition,VALUE:e.value.value,TYPE:e.value?.type??""})))))(r);K.current&&K.current?.abort?.(),K.current=new AbortController,F?.getGridData(s,a,((e=[])=>e.map(((e,t)=>({ACCESSOR:e.id??"",VALUE:e?.desc?"desc":"asc"}))))(i),o,K.current).then((t=>{n===V.current&&(R(u(t?.[0]?.REPORT_DATA??[])),_(Math.ceil(Number(t?.[0]?.COUNT??1)/Number(e))),H(Number(t?.[0]?.COUNT??1)),P(!1))})).catch((e=>{e?.error_msg?.includes("AbortError")||z(e),P(!1)}))}),[H,P,R,F]),W=o(null),J=v&&b?{"data-scope-id":v}:{};return l((()=>{b&&W.current&&W.current.focus()}),[b]),i(t,{children:[j&&e(Va,{severity:"error",errorMsg:j?.error_msg??"Unknown Error occured",errorDetail:j?.error_detail}),e("div",{ref:W,tabIndex:0,onKeyDown:e=>{b&&ma(e,v)},style:{width:"100%",position:"relative"},...J,children:e(uA,{ref:y,label:r.gridConfig?.gridLabel?S(r.gridConfig.gridLabel):S(fa(window.location.pathname,B?.menulistdata??[],!0)),dense:!0,multipleActions:r?.multipleActions,singleActions:r?.singleActions,doubleClickAction:r?.doubleClickAction,alwaysAvailableAction:r?.alwaysAvailableAction,setGridAction:r?.setAction,filterMeta:T,getRowId:I,columns:E,defaultColumn:L,defaultHiddenColumns:r.hiddenColumns,defaultFilter:k,defaultSortOrder:D,loading:U,data:O,setData:R,onFetchData:G,pageCount:M,totalRecords:Q,pageSizes:r.gridConfig?.pageSizes??[5,10],defaultPageSize:r.gridConfig?.defaultPageSize??10,allowColumnReordering:r.gridConfig?.allowColumnReordering??!1,allowColumnHiding:r.gridConfig?.allowColumnHiding??!1,allowKeyboardNavigation:r.gridConfig?.allowKeyboardNavigation??!1,allowFilter:r.gridConfig?.allowFilter??!0,filterAlwaysVisible:r.gridConfig?.filterAlwaysVisible??!1,containerHeight:r?.gridConfig?.containerHeight,occupiedHeight:r?.gridConfig?.occupiedHeight,allowRowSelection:r?.gridConfig?.allowRowSelection??!0,autoRefreshInterval:A,enablePaginationInput:r.gridConfig?.enablePaginationInput??C?.enablePaginationInput??!0,finalMetaData:r.columns.map((e=>({...e,columnName:S(e.columnName)}))),enableExport:p,enablePdfPrint:r?.gridConfig?.enablePdfPrint??x?.enablePdfPrint??!1,reportTemplateCode:f,variant:g??C?.variant??"standard",autoFetch:r?.gridConfig?.autoFetch??m??!0,handleReset:q,headerToolbarStyle:w,enableEnterToFocus:b})})]})})),pA=d((({gridCode:t,getGridData:i,metaData:r,actions:n,setAction:s,defaultFilter:a=[],defaultSortOrder:o=[],dataTransformer:l=e=>e,autoRefreshInterval:h,enableExport:c,reportTemplateCode:d,variant:u,autoFetch:A,headerToolbarStyle:p,enableEnterToFocus:f,focusScopeId:g},m)=>{let w=fA({metaData:r,actions:n,setAction:s});return e(sA,{gridCode:t,getGridData:i,children:e(Tl,{children:e(AA,{ref:m,metaData:w,defaultFilter:a,defaultSortOrder:o,dataTransformer:l,autoRefreshInterval:h,enableExport:c,reportTemplateCode:d,variant:u,autoFetch:A,headerToolbarStyle:p,enableEnterToFocus:f,focusScopeId:g})})})})),fA=({metaData:e,actions:t,setAction:i})=>{let r=O(e),n=r.columns,s=r.filters;s=Mo(s);const a=_o(n);n=eo(n),n=Xa(n),n=jo(n);const o=zo(t??null);return{columns:n,gridConfig:r.gridConfig,hiddenColumns:a,filters:s,setAction:i,...o}},gA=({content:i,buttonText:r="",...n})=>e(Wi,{...n,content:i,children:e(Ji,{children:({handlePrint:i})=>e(t,{children:Boolean(r)?e(za,{onClick:i,children:r}):e(tl,{title:G("Print"),arrow:!0,children:e(C,{onClick:i,size:"small",children:e(Xi,{style:{color:"var(--white)"}})})})})})}),mA=({isOpen:t=!1,validMessage:r,onActionYes:n,onActionNo:s,rows:a,isLoading:o=!1,isError:l=!1,error_msg:h="",error_detail:c="",loadingText:d="Loading..."})=>{const{t:u}=ne();return i(dt,{open:t,maxWidth:"sm",children:[e(ut,{children:r}),e(pt,{children:o?e(Ga,{text:d},"loaderforDeleteing"):l?e(Va,{severity:"error",errorMsg:h??"Unknown Error occured",errorDetail:c??""}):null}),i(At,{children:[e(ct,{onClick:()=>s(),color:"secondary",disabled:o,children:u("No")}),e(ct,{onClick:()=>n(a),color:"secondary",disabled:o,children:u("Yes")})]})]})},wA=({validMessage:t,onActionYes:i,onActionNo:r,isLoading:n=!1,isError:s=!1,error_msg:a="",error_detail:o="",loadingText:l="Loading..."})=>{const{state:h}=Yi();return e(mA,{isOpen:!0,validMessage:t,isLoading:n,onActionYes:i,onActionNo:r,isError:s,rows:h,error_msg:a,error_detail:o,loadingText:l})},bA=({MessageTitle:r,Message:n,onActionYes:s,onActionNo:a,rows:o,open:l=!1,loading:h=!1,enableEnterToFocus:c,focusScopeId:d="enter-to-focus-popup-msg"})=>{const u=qc(),{t:A}=ne(),{enableEnterToFocus:p}=Ws(),f=c??p;return e(t,{children:i(oe,{fullWidth:!1,open:l,className:"PopupMessageAPIWrapper__base",onKeyDown:e=>{f&&ma(e,d)},...d&&f?{"data-scope-id":d}:{},children:[e(le,{className:u.dialogTitleClass,children:A(r)}),e(he,{children:e(ce,{style:{color:"black",marginTop:"8px",marginBottom:"6px"},children:A(n)})}),i(de,{className:u.verifybutton,children:[e(za,{endIcon:h?e(be,{size:20}):null,onClick:()=>s(o),disabled:h,children:A("Yes")}),e(za,{onClick:()=>a(),disabled:h,children:A("No")})]})]})})},vA=Ci((e=>({arrayRowContainer:{position:"relative",boxShadow:e.shadows[3],marginBottom:e.spacing(1),paddingRight:"8px",paddingBottom:"8px"},newArrayRowContainer:{position:"relative",boxShadow:"",marginBottom:"0","& .MuiInputBase-root":{marginTop:"0px"},"& .css-1qlanbt-MuiInputBase-root-MuiFilledInput-root":{"&:after":{borderBottom:"none"},"&:hover":{"&:before":{borderBottom:"none"}}},"& .MuiGrid-item":{}},newSecondArrayRowContainer:{position:"relative",boxShadow:"",marginBottom:"0","& .css-1qlanbt-MuiInputBase-root-MuiFilledInput-root":{"&:after":{borderBottom:"none"},"&:hover":{"&:before":{borderBottom:"none"}}}},arrayRowRemoveBtn:{position:"absolute",top:-8,right:-8,color:"#f50057"},arrayRowCard:{width:"100%",position:"relative",overflow:"unset"},arrayRowCardContent:{paddingLeft:"25px"},arrayRowCount:{display:"flex",width:"100%",margin:"0px 0 6px -8px"},arrayRowCountCustomStyle:{display:"flex",width:"100%",margin:"2px 0 0px -8px"},arrayRowCountFixedRows:{display:"flex",width:"100%",margin:"2px 0 6px -8px"},arrayScreenRowCount:{display:"flex",width:"100%",margin:"2px 0 12px 0px"},newArrayRowCardContent:{paddingLeft:"32px","& .MuiInputBase-root":{marginTop:"0px"}},arrayFieldSelected:{padding:"8px 0px 0px 8px",background:"#eee",width:"100%"},arrayFieldUnselected:{width:"100%"}}))),yA=({row:r,getAllRowsValues:n,fieldKey:s,oneRow:a,classes:o,removeFn:l,rowIndex:d,removeRowFn:u,totalRows:A,isSubmitting:f,formState:g,formName:m,arrayFieldIDName:w,arrayFieldName:b,fixedRows:v,isDisplayCount:y=!0,isCustomStyle:B=!1,disagreeButtonName:C,agreeButtonName:x,errorTitle:F,displayCountName:N,isRemoveButton:S,selectedRowIndex:E,setSelectedRowIndex:T,hideRemoveIconOnSingleRecord:k,enableEnterToFocus:D})=>{const{messageBoxConfig:I}=id(),{t:U}=ne(),P=qc(),[O,R]=c(!1),[Q,H]=c(!1),[M,_]=c(""),[j,z]=c(!1),[V,K]=c({allow:!0,reason:""});L((({snapshot:e})=>async()=>{const t=e.getLoadable(Ns(`${m}/${s}`));if("hasValue"===t.state){const e=t.contents;if(Boolean(e.value))try{H(!0),await Promise.resolve(u({...g,[w]:e.value},b)),H(!1),_(""),z(!0)}catch(e){console.log(e),H(!1),_(e?.error_msg??"Unkown error occured")}else z(!0)}}),[_,z,H]);const q=h(((e=!1)=>{j||e?l(d):(R(!1),setTimeout((()=>{H(!1),_(""),z(!1)}),1))}),[R,H,_,z,j,l,d]),G=h((async()=>{let e=!0,t="Cannot remove a Row",i=!0;if("function"==typeof u){try{i=await u(g,b,n(),d)}catch(e){console.error("Remove row function error<<",e)}"boolean"==typeof i?e=i:"object"==typeof i&&(e=i?.allow??!1,t=i?.reason??"Cannot remove a Row")}e?R(!0):K({allow:e,reason:t})}),[R,d]);let W;W=Boolean(B)?0!==d?o.newArrayRowContainer:o.newSecondArrayRowContainer:Boolean(v)?o.newSecondArrayRowContainer:o.arrayRowContainer;const J=n()?.[b]?.[d]?._rowColor,X=()=>{T(d);const e=n(),t=Object.keys(r.cells).reduce(((t,i)=>{const n=(t=>{const i=t.replace(/\]/g,"").split(/\[|\./);let r=e;return i.forEach((e=>{r=r&&e in r?r[e]:void 0})),r})(r.cells[i].name);return t[i]=n,t}),{});"function"==typeof g?.onArrayFieldRowClickHandle&&g?.onArrayFieldRowClickHandle(t),"function"==typeof g?.onArrayFieldRowDoubleClickHandle&&g?.onArrayFieldRowDoubleClickHandle(t)},Y={INFO:I?.iconsConfig?.INFO?.color??"dodgerblue",SUCCESS:I?.iconsConfig?.SUCCESS?.color??"green",WARNING:I?.iconsConfig?.WARNING?.color??"orange",ERROR:I?.iconsConfig?.ERROR?.color??"#f44336",CONFIRM:I?.iconsConfig?.CONFIRM?.color??"#474e5b"},$=I?.iconsConfig?.SUCCESS?.icon??Lt,Z=I?.iconsConfig?.CONFIRM?.icon??Tt;return i(p,{children:[Boolean(y)?e(t,{children:e(fe,N?{gutterBottom:!0,className:(B?o.arrayRowCountCustomStyle:v?o.arrayRowCountFixedRows:o.arrayRowCount)+` ${b}-arrayField-firstrow`,children:`${N} ${d+1} of ${A}`}:{gutterBottom:!0,className:(B?o.arrayRowCountCustomStyle:v?o.arrayRowCountFixedRows:o.arrayRowCount)+` ${b}-arrayField-firstrow`,children:`${d+1} of ${A}`})}):null,e("div",{onClick:g?.onArrayFieldRowClickHandle&&X,onDoubleClick:g?.onArrayFieldRowDoubleClickHandle&&X,className:E===d?o?.arrayFieldSelected:o?.arrayFieldUnselected,children:i(Se,{container:!0,item:!0,xs:12,md:12,sm:12,spacing:1,className:W+` ${b}-array-field-row`,sx:{background:`${Boolean(J)&&"string"==typeof J?J:"none"}`},children:[a,"function"==typeof l&&!Boolean(v)||Boolean(S)?e(t,{children:A>1||!k?e(Be,{onClick:G,className:o.arrayRowRemoveBtn,disabled:f,children:e(Et,{})}):null}):null]})}),v&&d+1<A?e(Ee,{sx:{backgroundColor:"rgba(0, 0, 0, 0.6)",width:"100%"}}):null,i(oe,{open:O,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",className:"arrayfield__delete__dialog__base",onKeyDown:e=>{D&&ma(e)},children:[e(le,{className:P.dialogTitleClass,style:{background:j?Y.SUCCESS:Y.CONFIRM},children:U(j?"Success":"Confirmation")}),i(he,{sx:{padding:".75rem 10px 1.5rem 10px !important",display:"flex",alignItems:"center",gap:"0.5rem"},children:[e(me,{children:j?e($,{fontSize:"large",style:{color:Y.SUCCESS}}):e(Z,{fontSize:"large",style:{color:Y.CONFIRM}})}),e(ce,{children:e(fe,{color:"black",children:j?U("Recordsuccessfullydeleted"):Q?U("Pleasewaitdeletingrecord"):Boolean(M)?M:U(F||"AreyouSureyouwanttodeletethisrecord")})})]}),i(de,{children:[e(za,{onClick:()=>q(!0),sx:{background:Y.CONFIRM,"&:hover":{background:Y.CONFIRM}},children:U(x||"Yes")}),e(za,{onClick:()=>q(!1),sx:{background:Y.CONFIRM,"&:hover":{background:Y.CONFIRM}},children:U(C||"No")})]})]}),V.allow?null:e(BA,{open:!V.allow,className:"arrayfield__remove__error__dialog__base",icon:"ERROR",reason:V.reason,handleClick:()=>{K({allow:!0,reason:""})},enableEnterToFocus:D},"remove-error-dialog")]},r.fieldIndexKey)},BA=({open:t,icon:r="ERROR",className:n,reason:s,handleClick:a,enableEnterToFocus:h})=>{const c=qc(),d=o(null),{messageBoxConfig:u}=id(),A={INFO:u?.iconsConfig?.INFO?.color??"dodgerblue",SUCCESS:u?.iconsConfig?.SUCCESS?.color??"green",WARNING:u?.iconsConfig?.WARNING?.color??"orange",ERROR:u?.iconsConfig?.ERROR?.color??"#f44336",CONFIRM:u?.iconsConfig?.CONFIRM?.color??"#474e5b"},p=u?.iconsConfig?.[r]?.icon??kt;return l((()=>{setTimeout((()=>{d.current&&d.current.focus()}),100)}),[]),i(oe,{open:t,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",className:n,onKeyDown:e=>{h&&ma(e)},children:[e(le,{className:c.dialogTitleClass,style:{background:A[r]},children:G("Stop")}),i(he,{sx:{padding:".75rem 10px 1.5rem 10px !important",display:"flex",alignItems:"center",gap:"0.5rem"},children:[e(me,{children:e(p,{fontSize:"large",style:{color:A[r]}})}),e(ce,{children:e(fe,{color:"black",children:s})})]}),e(de,{children:e(za,{onClick:a,ref:d,sx:{background:A[r],"&:hover":{background:A[r]}},children:G("Ok")})})]})};var CA=Object.freeze({__proto__:null,ArrayField2:({name:t,label:r,_fields:n,GridProps:s,enableGrid:a,componentProps:l={},removeRowFn:d,addRowFn:A,arrayFieldIDName:f,dependentFields:m,shouldExclude:w,fixedRows:b,isDisplayCount:v,isCustomStyle:y,getFixedRowsCount:B,onFormButtonClickHandel:C,onFormDataChange:x,disagreeButtonName:F,agreeButtonName:N,errorTitle:S,displayCountName:E,isRemoveButton:T,changeRowOrder:L,noRecordMessage:k,hideRemoveIconOnSingleRecord:D=!0,enableEnterToFocus:I})=>{const{t:U}=ne(),P=Ws(),{authState:R}=Vs();let Q=O(n);const H=vA(),[M,_]=c(!1),[j,z]=c(""),[V,K]=c(null);let q={form:{},fields:Q};const G=o(null);null===G.current&&(G.current=((e,t,i,r)=>(e=Gh(e,uc,t,i,r),e=qh(e),Wh(e)))(q,U,R,P));const W=o(G?.current?.fields?.reduce(((e,t)=>(e[t.name]="",e)),{})),J=o(G?.current?.fields?.reduce(((e,t)=>(e[t.name]=t,e)),{})),{renderRows:X,getAllRowsValues:Y,unshift:$,isSubmitting:Z,formState:ee,formName:te,excluded:ie,push:re}=va({arrayFieldName:t,template:W.current,dependentFields:m,shouldExclude:w,getFixedRowsCount:B}),se=h((()=>{setTimeout((()=>{const e=document.querySelectorAll(`.${t}-arrayField-firstrow`)?.[0],i=document.querySelectorAll(`.${t}-array-field-row`),r=i[i.length-1];!L&&e?e.scrollIntoView({behavior:"smooth",block:"center"}):L&&r&&r.scrollIntoView({behavior:"smooth",block:"center"})}),50)}),[t,L]),ae=h((()=>{if("function"==typeof A){let e=A(Y(),t),i=!1,r="Cannot add a new Row";"boolean"==typeof e&&(i=e),"object"==typeof e&&(i=e?.allow??!1,r=e?.reason??"Cannot add a new Row"),i?(Boolean(L)?re():$(),se()):(_(!0),z(r))}else Boolean(L)?re():$(),se()}),[$,Y]);if(ie)return null;let oe=X((({row:i,removeFn:r,rowIndex:n,fields:s,totalRows:a})=>{const o=s.map((r=>{const s=J.current[r];if(!Boolean(s))return null;let a;s.onFormButtonClickHandel=C,s.onFormDataChange=x,a=0===n?{...s}:{...s,label:null};const o=kh(y?a:s,{},t,l);let h=g(o,{fieldKey:i.cells[r].key,name:i.cells[r].name,label:U(o?.props?.label),placeholder:U(o?.props?.placeholder)});return e(p,{children:h},i.cells[r].key)}));return e(yA,{fieldKey:i.cells[f??""]?.key??"",getAllRowsValues:Y,oneRow:o,classes:H,removeFn:r,rowIndex:n,removeRowFn:d,row:i,totalRows:a,isSubmitting:Z,formState:ee,formName:te,arrayFieldIDName:f,arrayFieldName:t,fixedRows:b,isDisplayCount:v,isCustomStyle:y,disagreeButtonName:F,agreeButtonName:N,errorTitle:S,displayCountName:E,isRemoveButton:T,selectedRowIndex:V,setSelectedRowIndex:K,hideRemoveIconOnSingleRecord:D,enableEnterToFocus:I??P.enableEnterToFocus},i.fieldIndexKey)}));let le=i(p,{children:[i(xe,{className:H.arrayRowCard,children:[e(Fe,{style:{paddingTop:0,paddingBottom:0,position:"sticky",top:0,zIndex:1},sx:{"& .MuiCardHeader-title":r?{background:"var(--theme-color5)",ml:1.5,mt:1,p:1,color:"var(--theme-color2)"}:null,"& .MuiCardHeader-action":{}},title:r,action:Boolean(b)?null:e(Be,{style:{background:"#fff",boxShadow:"0 1px 3px rgba(0,0,0,.2)"},onClick:ae,disabled:Z,size:"small",children:e(St,{})})}),e(Ne,{className:H.arrayRowCardContent,style:{paddingTop:"0px",paddingBottom:"16px"},children:i(Se,{container:!0,item:!0,spacing:1,xs:12,md:12,sm:12,style:{marginTop:"2px"},children:[oe,oe.length<=0?e(fe,{children:U(k||"NoRecordsFoundclicktheaddbuttontoaddone")}):null]})})]}),M?e(BA,{open:M,className:"arrayfield__add__error__dialog__base",icon:"ERROR",reason:j,handleClick:()=>{_(!1),z("")},enableEnterToFocus:I??P.enableEnterToFocus},"add-error-dialog"):null]});return Boolean(a)?u(Se,{container:!0,...s,key:t},le):e(p,{children:le},t)},ArrayFieldValues:({name:t,label:r,_fields:n,GridProps:s,enableGrid:a,defaultValue:o,componentProps:l={}})=>{let h=O(n);const c=vA();if(!Array.isArray(o))return e("div",{children:"Invalid data for arrayField"});const d=o.map(((i,r)=>{const n=(s=h,a=i,Array.isArray(s)?s.map((e=>{const{name:t,...i}=e;return{...i,name:t,defaultValue:a[t]??"N/A"}})):[]);var s,a;const o=n.map(((i,r)=>{const n=((t,i,r,n={})=>{const{render:s,schemaValidation:a,...o}=t;let l=null;switch(s.componentType){case"arrayField":l=Uh;break;case"spacer":l=Ih;break;case"typography":l=Oh;break;case"hidden":l=Ph;break;default:l=Dh}if(l===Ih||l===Oh)return e(l,{...o},`${r}/${o.name}`);{const e={...n[s.componentType],...o},t={...i?.gridConfig?.item,...o?.GridProps};return u(l,{...e,fieldKey:o.name,key:`${r}/${o.name}`,enableGrid:!0,GridProps:{item:!0,xs:t?.xs??"auto",md:t?.sm??"auto",xl:t?.xs??"auto"}})}})(i,{},t,l);return e(p,{children:n},`${i.name}-${r}`)}));return e(p,{children:e(ie,{container:!0,item:!0,xs:12,md:12,sm:12,spacing:2,className:c.arrayRowContainer,children:o})},r)}));let A=e(p,{children:i(st,{className:c.arrayRowCard,children:[e(lt,{title:r}),e(at,{className:c.arrayRowCardContent,children:e(ie,{container:!0,spacing:1,xs:12,md:12,sm:12,children:d})})]})});return Boolean(a)?u(ie,{container:!0,...s,key:t},A):e(p,{children:A},t)}});const xA=xi({root:{"& .MuiFormLabel-root":{fontWeight:600,textTransform:"capitalize",fontSize:"1rem","@media (max-width: 1200px)":{fontSize:"0.75rem"},"@media (max-width: 1440px)":{fontSize:"0.875rem"}},"& label.Mui-focused":{color:"var(--theme-color1)"},"& .MuiRadio-root.Mui-checked":{color:"var(--theme-color1) !important"}}})($e),FA=({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:s,postValidationSetCrossFieldValues:a,runPostValidationHookAlways:o,dependentFields:l,fieldKey:d,label:A,options:p,FormControlProps:f,FormLabelProps:g,RadioGroupProps:m,FormHelperTextProps:w,FormControlLabelProps:b,GridProps:v,enableGrid:y,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x,CircularProgressProps:F,_optionsKey:N,disableCaching:S,...E})=>{const{formState:T,value:L,error:k,touched:D,handleChange:I,handleBlur:U,isSubmitting:P,fieldKey:O,name:R,excluded:Q,readOnly:H,dependentValues:M,incomingMessage:_,runValidation:j,whenToRunValidation:z,setIncomingMessage:V}=Js({name:t,fieldKey:d,dependentFields:l,validate:i,validationRun:r,runPostValidationHookAlways:o,postValidationSetCrossFieldValues:a,isReadOnly:s,shouldExclude:n,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x}),[K,q]=c([]),G=h((e=>po(K)(e)),[K]),W=h((e=>{let t=G("object"==typeof e?e?.target?.value??"":e);I(e,t[0])}),[I,G]),{loadingOptions:J}=co(T,p,q,W,M,_,j,z,N,S,V,!0,"",!1);if(Q)return null;const X=D&&""!==(k??""),Y=K.map((t=>u(Ye,{...b,control:e(Zi,{...E,disabled:H,readOnly:H,tabIndex:H?-1:void 0}),key:t.value,label:t.label,value:t.value}))),$=u(xA,{...f,key:O,component:"fieldset",disabled:P,error:!P&&X,onBlur:U},e(Je,{...g,component:"label",children:A}),e($i,{...m,onChange:W,name:R,value:L,children:J?e(B,{position:"end",children:e(re,{color:"primary",variant:"indeterminate",...F})}):Y}),!P&&X?e(Ze,{...w,children:k}):null);return Boolean(y)?u(ie,{...v,key:O},$):$};var NA=Object.freeze({__proto__:null,Radio:FA,default:FA});const SA=(e,t)=>Array.isArray(e)&&e.indexOf(t)>-1;var EA=Object.freeze({__proto__:null,Switch:({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:s,postValidationSetCrossFieldValues:a,runPostValidationHookAlways:o,dependentFields:l,fieldKey:h,label:c,FormControlProps:d,FormHelperTextProps:A,FormControlLabelProps:p,GridProps:f,enableGrid:g,runValidationOnDependentFieldsChange:m,skipValueUpdateFromCrossFieldWhenReadOnly:w,...b})=>{const{value:v,error:y,touched:B,handleChange:C,handleBlur:x,isSubmitting:F,fieldKey:N,name:S,excluded:E,readOnly:T}=Js({name:t,fieldKey:h,dependentFields:l,validate:i,validationRun:r,runPostValidationHookAlways:o,postValidationSetCrossFieldValues:a,runValidationOnDependentFieldsChange:m,skipValueUpdateFromCrossFieldWhenReadOnly:w,isReadOnly:s,shouldExclude:n});if(E)return null;const L=B&&""!==(y??""),k=u($e,{...d,key:N,component:"fieldset",disabled:F,error:!F&&L,onBlur:x,tabIndex:T?-1:void 0},e(Ye,{...p,name:S,control:e(Dt,{...b,readOnly:T,tabIndex:T?-1:void 0}),onChange:C,label:c,checked:Boolean(v)}),!F&&L?e(Ze,{...A,children:y}):null);return Boolean(g)?e(ie,{...f,children:k}):k},SwitchGroup:({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:s,postValidationSetCrossFieldValues:a,runValidationOnDependentFieldsChange:o,runPostValidationHookAlways:l,dependentFields:d,fieldKey:A,label:p,options:f,FormControlProps:g,FormLabelProps:m,FormGroupProps:w,FormHelperTextProps:b,FormControlLabelProps:v,GridProps:y,enableGrid:C,CircularProgressProps:x,_optionsKey:F,disableCaching:N,skipValueUpdateFromCrossFieldWhenReadOnly:S,...E})=>{const{formState:T,value:L,error:k,touched:D,handleChange:I,handleBlur:U,isSubmitting:P,fieldKey:O,name:R,excluded:Q,readOnly:H,dependentValues:M,incomingMessage:_,runValidation:j,whenToRunValidation:z,setIncomingMessage:V}=Js({name:t,fieldKey:A,dependentFields:d,validate:i,validationRun:r,runPostValidationHookAlways:l,postValidationSetCrossFieldValues:a,isReadOnly:s,shouldExclude:n,runValidationOnDependentFieldsChange:o,skipValueUpdateFromCrossFieldWhenReadOnly:S}),[K,q]=c([]),G=h((e=>po(K)(e)),[K]),W=h((e=>{let t=G("object"==typeof e?e?.target?.value??"":e);I(e,t[0])}),[I,G]),{loadingOptions:J}=co(T,f,q,W,M,_,j,z,F,N,V,!0,"",!1);if(Q)return null;const X=D&&""!==(k??""),Y=K.map((t=>u(Ye,{...v,control:e(Dt,{...E,readOnly:H,tabIndex:H?-1:void 0}),key:t.value,name:R,onChange:W,label:t.label,value:t.value,checked:SA(L,t.value)}))),$=u($e,{...g,key:O,component:"fieldset",disabled:P,error:!P&&X,onBlur:U},e(Je,{...m,component:"label",children:p}),e(Xe,{...w,children:J?e(B,{position:"end",children:e(re,{color:"primary",variant:"indeterminate",...x})}):Y}),!P&&X?e(Ze,{...b,children:k}):null);return Boolean(C)?e(ie,{...y,children:$}):$}});const TA=({name:t,fieldKey:r,shouldExclude:n,isReadOnly:s,postValidationSetCrossFieldValues:a,runPostValidationHookAlways:o,dependentFields:d,validate:A,validationRun:f,label:g,InputLabelProps:m,GridProps:w,enableGrid:b,runValidationOnDependentFieldsChange:v,skipValueUpdateFromCrossFieldWhenReadOnly:y,...B})=>{const{handleChange:C,handleBlur:x,isSubmitting:F,fieldKey:N,name:S,value:E,excluded:T}=Js({name:t,fieldKey:r,dependentFields:d,validate:A,validationRun:f,runPostValidationHookAlways:o,postValidationSetCrossFieldValues:a,isReadOnly:s,shouldExclude:n,runValidationOnDependentFieldsChange:v,skipValueUpdateFromCrossFieldWhenReadOnly:y}),[L,k]=c(Number(E));l((()=>{k(Number(E))}),[E]);const[D,I]=c(!1),U=h(((e,t)=>{k(t)}),[k]),P=h(((e,t)=>{C(t)}),[C]),O=h((()=>{x(),I(!1)}),[x,I]),R=h((()=>{I(!0)}),[I]);if(T)return null;const Q=i(p,{children:[e(Ut,{...m,focused:D,disabled:F,children:g}),u(It,{...B,key:N,id:N,name:S,value:L,disabled:F,onFocus:R,onChange:U,onChangeCommitted:P,onBlur:O})]},N);return Boolean(b)?e(ie,{...w,children:Q}):Q};var LA=Object.freeze({__proto__:null,Slider:TA,default:TA});function kA(e,t,i,r=!1){const n={};return i&&ds(e,i,{ignoreTime:r})&&(n._maxDt=i),t&&As(e,t,{ignoreTime:r})&&(n._minDt=t),n}Ka(".MuiPickersDay-current.MuiPickersDay-day{color:var(--theme-color1)}.MuiPickersDay-daySelected.MuiPickersDay-day,.MuiPickersDay-daySelected.MuiPickersDay-day:hover{background-color:var(--theme-color1);color:var(--white)}.MuiPickersYear-root.MuiPickersYear-yearSelected{color:var(--theme-color1)}.MuiPickersLayout-contentWrapper .MuiButtonBase-root.Mui-selected{background-color:var(--theme-color1)!important;color:#fff}.MuiPickersLayout-contentWrapper .MuiButtonBase-root:hover{background-color:#8000000a}.MuiPickersSlideTransition-root{min-height:220px}");Ka(".MuiPickersClock-pin,.MuiPickersClockPointer-pointer,.MuiPickersToolbar-toolbar{background-color:var(--theme-color1)!important}.MuiPickersClockPointer-thumb{background-color:var(--white)!important;border:14px solid var(--theme-color1)!important}.MuiPickersClockPointer-noPoint{background-color:var(--theme-color1)!important;border:14px solid var(--theme-color1)!important}.MuiPickersClockNumber-clockNumberSelected,.MuiPickersToolbarText-toolbarBtnSelected{color:var(--white)!important}.MuiPickersToolbarText-toolbarTxt:not(.MuiPickersToolbarText-toolbarBtnSelected){color:var(--white-dim)!important}.MuiPickersLayout-root>.MuiDialogActions-root>button.MuiButton-textPrimary{color:var(--theme-color1)}");var DA=Object.freeze({__proto__:null,DatePicker:({name:i,validate:r,validationRun:n,shouldExclude:s,isReadOnly:d,postValidationSetCrossFieldValues:A,setValueOnDependentFieldsChange:p,runPostValidationHookAlways:f,dependentFields:g,fieldKey:m,type:w,GridProps:b,enableGrid:v,isFieldFocused:y,InputProps:B,inputProps:C,runValidationOnDependentFieldsChange:x,skipValueUpdateFromCrossFieldWhenReadOnly:F,required:N,disablePast:S,disableFuture:E,ignoreInSubmit:T=!1,label:L,setFieldLabel:k,placeholder:D,format:I,CircularProgressProps:U,componentType:P,runPostValidationForInitValue:O,className:R,...Q})=>{const[H,M]=c(null),{commonDateFormat:_}=Ws(),{authState:j}=Vs(),{value:K,prevValue:q,error:G,touched:W,handleChange:J,handleBlur:X,isSubmitting:Y,fieldKey:Z,name:ee,excluded:te,readOnly:re,setIgnoreInSubmit:ae,incomingMessage:oe,whenToRunValidation:le,runValidation:he,dependentValues:ce,validationRunning:de,setErrorAsCB:ue,formState:Ae}=Js({name:i,fieldKey:m,dependentFields:g,validate:r,componentType:P,validationRun:n,runPostValidationHookAlways:f,postValidationSetCrossFieldValues:A,isReadOnly:d,shouldExclude:s,runValidationOnDependentFieldsChange:x,skipValueUpdateFromCrossFieldWhenReadOnly:F,runPostValidationForInitValue:O});l((()=>{if(Boolean(T))if("function"==typeof T){let e=T(ta(ce),Ae,{isSubmitting:Y,value:K});ae(e)}else ae(T)}),[T,ae,ce,K]),l((()=>{if("string"==typeof K){let e=pa(K);if(!isNaN(e)){const t=kA(e,Q?.minDate,Q?.maxDate,!0);J(e,void 0,!1,t)}}}),[K,J]);const{t:pe}=ne(),fe=o();l((()=>{y&&setTimeout((()=>{fe?.current?.focus?.()}),1)}),[y]),l((()=>{if(null!==oe&&"object"==typeof oe){const{isFieldFocused:e,value:t,ignoreUpdate:i}=oe;if(e&&setTimeout((()=>{fe?.current?.focus?.()}),50),Boolean(t)||""===t){const e=kA(t,Q?.minDate,Q?.maxDate,!0);J(t,void 0,!1,e),i||"onBlur"!==le||he({value:t},!0)}}}),[oe,J,he,le]),l((()=>{if("function"==typeof p){let e=p(ta(ce),Ae,{value:K,isSubmitting:Y});if(null!=e){const t=kA(e,Q?.minDate,Q?.maxDate,!0);J(e,void 0,!1,t)}}}),[ce,J,p]);const me=a((()=>{if("function"==typeof k)return k(ta(ce),K)}),[k,ce,K]),ve=W&&""!==(G??""),ye=h((i=>e(t,{children:void 0===q||void 0===K||$(pa(q).toUTCString(),pa(K).toUTCString())?e(to,{...i}):e(il,{title:e(rl,{label:`${pe("OldValueOf")} ${me?.label?pe(me.label):L}`,value:(()=>{if(!q)return"(blank)";try{const e=pa(q);return z(e,(I??_)||"dd/MM/yyyy")}catch{return console.error("Invalid time provided while comparing old value!!!"),""}})()}),arrow:!0,followCursor:!0,children:e(to,{...i})})})),[q]);if(te)return null;const Be=u(Eo,{...Q,key:Z,label:me?.label?pe(me.label):L,format:(I??_)||"dd/MM/yyyy",value:""===K||null===K?null:pa(K),tabIndex:re?-1:void 0,onChange:e=>{const t=kA(e,Q?.minDate,Q?.maxDate,!0);J(e,void 0,!1,t)},onSelectedSectionsChange:e=>{M(e)},selectedSections:H,onClose:()=>{setTimeout((()=>X()),0)},disabled:Y||re,readOnly:re,disablePast:S,disableFuture:E,className:se(R,{hasOldValue:void 0!==q&&void 0!==K&&!$(pa(q).toUTCString(),pa(K).toUTCString())}),slots:{textField:ye},slotProps:{textField:{onBlur:e=>{const t=kA(K,Q?.minDate,Q?.maxDate,!0);X(e,t)},onKeyDown:e=>{const t=I??_;if(!j?.workingDate||"ArrowUp"!==e.key&&"ArrowDown"!==e.key){if("Home"===e.key)M(0);else if("End"===e.key){const e=t.includes("/")?"/":t.includes("-")?"-":null,i=e?t.split(e).length:1;M(i-1)}}else{const i=e.target.value;if(!V(K)&&i?.toLowerCase()===t?.toLowerCase()){const t=j?.workingDate;let i="";"ArrowUp"===e.key?i=(new Date).setDate(new Date(t).getDate()+1):"ArrowDown"===e.key&&(i=(new Date).setDate(new Date(t).getDate()-1)),setTimeout((()=>{const e=kA(new Date(i),Q?.minDate,Q?.maxDate,!0);J(new Date(i),void 0,!1,e)}),0)}}},id:Z,name:ee,placeholder:re?"":me?.placeholder?pe(me.placeholder):D,autoComplete:"off",required:N,error:!Y&&ve,helperText:e(we,{children:!Y&&ve?G:null}),inputProps:{tabIndex:re?-1:void 0,...C},InputProps:{style:{background:Boolean(re||Y)?"#f3f3f3":""},readOnly:re,startAdornment:de?e(ge,{position:"end",sx:{position:"absolute",right:"38px"},children:e(be,{color:"secondary",variant:"indeterminate",size:20,...U})}):null,...B},InputLabelProps:{shrink:!0},inputRef:fe},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%"},cancelLabel:e(ct,{color:"secondary",style:{border:"1px solid rgba(128, 0, 0, 0.23)"},disableElevation:!0,children:pe("Cancel")}),okLabel:e(ct,{color:"secondary",variant:"contained",disableElevation:!0,children:pe("Ok")})});return Boolean(v)?u(ie,{...b,key:Z},Be):Be},DateTimePicker:({name:i,validate:r,validationRun:n,shouldExclude:s,isReadOnly:c,postValidationSetCrossFieldValues:d,setValueOnDependentFieldsChange:A,runPostValidationHookAlways:p,dependentFields:f,fieldKey:g,type:m,GridProps:w,CircularProgressProps:b,enableGrid:v,isFieldFocused:y,InputProps:B,inputProps:C,runValidationOnDependentFieldsChange:x,skipValueUpdateFromCrossFieldWhenReadOnly:F,disablePast:N,disableFuture:S,ignoreInSubmit:E=!1,label:T,setFieldLabel:L,format:k,required:D,placeholder:I,runPostValidationForInitValue:U,componentType:P,className:O,...R})=>{const{commonDateTimeFormat:Q}=Ws(),{value:H,prevValue:M,error:_,touched:j,handleChange:V,handleBlur:K,isSubmitting:q,fieldKey:W,name:J,excluded:X,readOnly:Y,setIgnoreInSubmit:Z,incomingMessage:ee,whenToRunValidation:te,dependentValues:re,runValidation:ne,validationRunning:ae,formState:oe}=Js({name:i,fieldKey:g,dependentFields:f,validate:r,validationRun:n,runPostValidationHookAlways:p,postValidationSetCrossFieldValues:d,isReadOnly:c,shouldExclude:s,runValidationOnDependentFieldsChange:x,skipValueUpdateFromCrossFieldWhenReadOnly:F,runPostValidationForInitValue:U,componentType:P});l((()=>{if(Boolean(E))if("function"==typeof E){let e=E(ta(re),oe,{isSubmitting:q,value:H});Z(e)}else Z(E)}),[E,Z,re,H]),l((()=>{if("string"==typeof H){let e=pa(H);if(!isNaN(e)){const t=kA(e,R?.minDate,R?.maxDate);V(e,void 0,!1,t)}}}),[H,V]);const le=o();l((()=>{y&&setTimeout((()=>{le?.current?.focus?.()}),1)}),[y]),l((()=>{if(null!==ee&&"object"==typeof ee){const{value:e,ignoreUpdate:t}=ee;if(Boolean(e)||""===e){const i=kA(e,R?.minDate,R?.maxDate);V(e,void 0,!1,i),t||"onBlur"!==te||ne({value:e},!0)}}}),[ee,V,ne,te]),l((()=>{if("function"==typeof A){let e=A(ta(re),oe,{value:H,isSubmitting:q});if(null!=e){const t=kA(e,R?.minDate,R?.maxDate);V(e,void 0,!1,t)}}}),[re,V,A]);const he=a((()=>{if("function"==typeof L)return L(ta(re),H)}),[L,re,H]),ce=h((i=>e(t,{children:void 0===M||void 0===H||$(pa(M).toUTCString(),pa(H).toUTCString())?e(to,{...i}):e(il,{title:e(rl,{label:`${G("OldValueOf")} ${he?.label?G(he.label):T}`,value:(()=>{if(!M)return"(blank)";try{const e=pa(M);return z(e,(k??Q)||"dd/MM/yyyy HH:mm:ss aa")}catch{return console.error("Invalid time provided while comparing old value!!!"),""}})()}),arrow:!0,followCursor:!0,children:e(to,{...i})})})),[M]),de=j&&""!==(_??"");if(X)return null;const ue=u(Lo,{...R,key:W,label:he?.label?G(he.label):T,format:(k??Q)||"dd/MM/yyyy HH:mm:ss aa",value:""===H||null===H?null:pa(H),views:["year","month","day","hours","minutes","seconds"],disablePast:N,disableFuture:S,onChange:e=>{const t=kA(e,R?.minDate,R?.maxDate);V(e,void 0,!1,t)},onClose:()=>{setTimeout((()=>K()),0)},disabled:q||Y,readOnly:Y,className:se(O,{hasOldValue:void 0!==M&&void 0!==H&&!$(pa(M).toUTCString(),pa(H).toUTCString())}),slots:{textField:ce},slotProps:{textField:{name:J,id:W,onBlur:e=>{const t=kA(H,R?.minDate,R?.maxDate);K(e,t)},placeholder:Y?"":he?.placeholder?G(he.placeholder):I,required:D,error:!q&&de,helperText:e(we,{children:!q&&de?_:null}),inputProps:{tabIndex:Y?-1:void 0,...C},InputProps:{style:{background:Boolean(Y||q)?"#f3f3f3":""},readOnly:Y,startAdornment:ae?e(ge,{position:"end",sx:{position:"absolute",right:"38px"},children:e(be,{color:"secondary",variant:"indeterminate",size:20,...b})}):null,...B},InputLabelProps:{shrink:!0}},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%"}});return Boolean(v)?u(ie,{...w,key:W},ue):ue},TimePicker:({name:i,validate:r,validationRun:n,shouldExclude:s,isReadOnly:c,postValidationSetCrossFieldValues:d,runPostValidationHookAlways:A,dependentFields:p,fieldKey:f,type:g,GridProps:m,CircularProgressProps:w,enableGrid:b,isFieldFocused:v,InputProps:y,inputProps:B,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x,required:F,format:N,runPostValidationForInitValue:S,componentType:E,className:T,label:L,placeholder:k,setFieldLabel:D,...I})=>{const{commonTimeFormat:U}=Ws(),{value:P,prevValue:O,error:R,touched:Q,handleChange:H,handleBlur:M,isSubmitting:_,fieldKey:j,name:V,excluded:K,readOnly:q,validationRunning:W,dependentValues:J}=Js({name:i,fieldKey:f,dependentFields:p,validate:r,validationRun:"onChange",runPostValidationHookAlways:A,postValidationSetCrossFieldValues:d,isReadOnly:c,shouldExclude:s,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x,runPostValidationForInitValue:S,componentType:E});l((()=>{if("string"==typeof P){let e=new Date(P);isNaN(e)||H(e)}}),[P,H]);const X=o();l((()=>{v&&setTimeout((()=>{X?.current?.focus?.()}),1)}),[v]);const Y=Q&&""!==(R??""),Z=a((()=>{if("function"==typeof D)return D(ta(J),P)}),[D,J,P]),ee=h((i=>e(t,{children:void 0===O||void 0===P||$(pa(O).toUTCString(),pa(P).toUTCString())?e(to,{...i}):e(il,{title:e(rl,{label:`${G("OldValueOf")} ${Z?.label?G(Z.label):L}`,value:(()=>{if(!O)return"(blank)";try{const e=pa(O);return z(e,(N??U)||"HH:mm:ss aa")}catch{return console.error("Invalid time provided while comparing old value!!!"),""}})()}),arrow:!0,followCursor:!0,children:e(to,{...i})})})),[O]);if(K)return null;const te=u(To,{...I,key:j,id:j,name:V,label:Z?.label?G(Z.label):L,format:(N??U)||"HH:mm:ss aa",value:""===P?null:new Date(P),onChange:H,onClose:()=>{setTimeout((()=>M()),0)},disabled:_||q,readOnly:q,className:se(T,{hasOldValue:void 0!==O&&void 0!==P&&!$(pa(O).toUTCString(),pa(P).toUTCString())}),slots:{textField:ee},slotProps:{textField:{onBlur:M,placeholder:q?"":Z?.placeholder?G(Z.placeholder):k,error:!_&&Y,helperText:e(we,{children:!_&&Y?R:null}),inputProps:{tabIndex:q?-1:void 0,...B},InputLabelProps:{shrink:!0},InputProps:{style:{background:Boolean(q||_)?"#f3f3f3":""},readOnly:q,tabIndex:q?-1:void 0,startAdornment:W?e(ge,{position:"end",sx:{position:"absolute",right:"38px"},children:e(be,{color:"secondary",variant:"indeterminate",size:20,...w})}):null,...y},required:F}}});return Boolean(b)?u(ie,{...m,key:j},te):te}});const IA=({name:t,validate:r,validationRun:n,shouldExclude:s,postValidationSetCrossFieldValues:a,isReadOnly:o,runPostValidationHookAlways:l,dependentFields:d,fieldKey:A,label:f,InputLabelProps:g,GridProps:m,enableGrid:w,runValidationOnDependentFieldsChange:b,skipValueUpdateFromCrossFieldWhenReadOnly:v,...y})=>{const{value:B,handleChange:C,handleBlur:x,isSubmitting:F,fieldKey:N,name:S,excluded:E,readOnly:T}=Js({name:t,fieldKey:A,dependentFields:d,validate:r,validationRun:n,runPostValidationHookAlways:l,postValidationSetCrossFieldValues:a,isReadOnly:o,shouldExclude:s,runValidationOnDependentFieldsChange:b,skipValueUpdateFromCrossFieldWhenReadOnly:v}),[L,k]=c(!1),D=h((()=>{x(),k(!1)}),[x,k]),I=h((()=>{k(!0)}),[k]),U=h(((e,t)=>{C(t)}),[C]);if(E)return null;const P=i(p,{children:[e(Ut,{...g,focused:L,disabled:F,children:f}),u(Pt,{...y,key:N,id:N,name:S,value:""===B?0:B,onFocus:I,onChange:U,onBlur:D,disabled:F,readOnly:T,tabIndex:T?-1:void 0})]},N);return Boolean(w)?u(ie,{...m,key:N},P):P};var UA=Object.freeze({__proto__:null,Rating:IA,default:IA});const PA=xi((e=>({grouped:{marginRight:e.spacing(2),marginTop:e.spacing(1),borderColor:"#8C8C8C",transition:"border 0.3s ease-in",borderRadius:"8px",textTransform:"capitalize",color:"#727272",padding:"4px 10px",fontWeight:700,"&:not(:first-child)":{borderRadius:"8px",borderLeft:"1px solid #8C8C8C"},"&:first-child":{borderRadius:"8px"},"&.Mui-selected":{border:"1px solid #57D3C3",background:"linear-gradient(0deg, rgba(94,231,131,1) 0%, rgba(74,205,159,1) 10%, rgba(33,150,218,1) 100%)",color:"white"},"& label":{color:"#736f6f",fontWeight:"600",textTransform:"capitalize",fontSize:"1rem",marginBottom:"0.5 rem"},"& .MuiSvgIcon-root":{maxHeight:"20px"}}})))(er),OA=({name:t,validate:r,validationRun:n,shouldExclude:s,isReadOnly:a,postValidationSetCrossFieldValues:o,runValidationOnDependentFieldsChange:l,runPostValidationHookAlways:h,dependentFields:c,fieldKey:d,options:A,ToggleButtonProps:p,GridProps:f,enableGrid:g,label:m,isFieldFocused:w,skipValueUpdateFromCrossFieldWhenReadOnly:b,...v})=>{const{value:y,handleChange:B,handleBlur:C,isSubmitting:x,fieldKey:F,excluded:N}=Js({name:t,fieldKey:d,dependentFields:c,validate:r,validationRun:n,runPostValidationHookAlways:h,postValidationSetCrossFieldValues:o,runValidationOnDependentFieldsChange:l,isReadOnly:a,shouldExclude:s,skipValueUpdateFromCrossFieldWhenReadOnly:b});if(N)return null;const S=A.map((t=>u(Ot,{...p,key:t.value,value:t.value,disabled:x},"business"===t.iconName?e(Qt,{}):"person"===t.iconName?e(Rt,{}):null,e("span",{children:t.label})))),E=i($e,{disabled:x,children:[e(Je,{children:m}),e(PA,{...v,value:y,onChange:(e,t)=>{B(t)},onBlur:C,children:S})]});return Boolean(g)?u(ie,{...f,key:F},E):E};var RA=Object.freeze({__proto__:null,ToggleButtonGroup:OA,default:OA});const QA=({name:t,HiddenProps:i,GridProps:r,shouldExclude:n,fieldKey:s,dependentFields:a,componentType:o})=>{const{name:l,excluded:h}=Js({name:t,fieldKey:s,dependentFields:a,shouldExclude:n,componentType:o});return h?null:e(p,{children:e(Te,{...i,children:e(Se,{item:!0,...r})})},l)};var HA=Object.freeze({__proto__:null,Spacer:QA,default:QA});const MA=f((()=>Promise.resolve().then((function(){return Ou})).then((e=>({default:e.ListBoxComponent}))))),_A=e=>e?.label??"";var jA=Object.freeze({__proto__:null,AutoComplete:zu,AutocompleteRenderOnly:({label:t,showCheckbox:r,CircularProgressProps:n,TextFieldProps:s,ChipProps:a,CreateFilterOptionsConfig:h,placeholder:d,required:A,enableVirtualized:f,handleBlur:g,handleChange:w,freeSolo:b,multiple:v,options:y,error:B,touched:C,disableClearable:x,value:F,_optionsKey:N,disableCaching:S,optionsProps:E,...T})=>{const L=Boolean(C)&&Boolean(B),[k,D]=c([]),[I,U]=c((new Date).getTime()),P=o(!1),O=o(null),{loadingOptions:R}=uo(y,D,N,S,E,!0,"",!1);return l((()=>{let e=F;if(!P.current&&Boolean(e)&&k.length>0&&"00"!==k[0].value&&null!==k[0].value){Array.isArray(e)||(e=[F]);let t=[];for(let i=0;i<k.length&&e.length>0;i++){let r=e.findIndex((e=>e==k[i].value));if(r>-1){t.push(k[i]);const n=e.slice(0,r),s=e.slice(r+1);e=[...n,...s]}}P.current=!0,O.current=v?t:t[0],U((new Date).getTime())}}),[R,k,F,v]),e(m,{fallback:"loading...",children:u(Ai,{...T,key:`${I}`,multiple:v,disableClearable:x,freeSolo:b,options:k,getOptionLabel:_A,ListboxComponent:Boolean(f)?MA:void 0,onChange:(e,t)=>{Array.isArray(t)||(t=[t]),t=t.map((e=>{return"object"==typeof e?Boolean(b)?_A(e):(t=e,t?.value??""):e;var t})),!Boolean(v)&&Array.isArray(t)?w(t[0]):w(t)},onBlur:g,filterOptions:Boolean(h)&&"object"==typeof h?pi(h):void 0,renderTags:(e,t)=>e.map(((e,i)=>u(mi,"string"==typeof e?{variant:"outlined",...a,label:e,...t({index:i}),key:e}:{variant:"outlined",...a,label:e.label,...t({index:i}),key:`${e.label}-${i}`}))),renderInput:r=>e(to,{...s,...r,label:t,placeholder:d,autoComplete:"disabled",type:"text",error:L,required:A,helperText:L?B:null,InputProps:{...r.InputProps,endAdornment:i(p,{children:[R?e(re,{color:"primary",variant:"indeterminate",...n}):null,r.InputProps.endAdornment]})},InputLabelProps:{shrink:!0},inputProps:{...r.inputProps,autoComplete:"new-user-street-address"}}),renderOption:(t,n,s)=>{t.key=t.id;let{selected:a,inputValue:o}=s,l=_A(n);const h=wi(l,o),c=bi(l,h).map(((t,i)=>e("span",{style:{fontWeight:t.highlight?700:400},children:t.text},i)));return i("li",{style:{whiteSpace:"pre"},...t,children:[r?e(so,{checked:a}):null,c]})}})})},default:zu});function zA(t){const{inputRef:i,onChange:r,FormatProps:n,...s}=t;return e(Ht,{...s,getInputRef:i,onValueChange:e=>{r({target:{value:e.value,formattedValue:e.formattedValue}},e.formattedValue)},...n})}function VA(t){const{inputRef:i,onChange:r,FormatProps:n,...s}=t;return e(Ht,{...s,getInputRef:i,onValueChange:e=>{r({target:{value:e.value,formattedValue:e.formattedValue}},e.formattedValue)},...n})}const KA=({name:t,fieldKey:r,validate:n,leftName:s,rightName:a,leftLabel:h,rightLabel:c,leftTransform:d=e=>e,rightTransform:u=e=>e,GridProps:A,enableGrid:p,dependentFields:f,validationRun:g,runValidationOnDependentFieldsChange:m})=>{const{touched:w,value:b,error:v,setValue:y,handleBlur:B,isSubmitting:C,dependentValues:x}=Js({name:t,fieldKey:r,validate:n,validationRun:g,dependentFields:f,runValidationOnDependentFieldsChange:m}),F=b[s],N=b[a],S=o(F);S.current=F;const E=o(N);E.current=N,l((()=>{let e=ta(x),t=d(S.current,s,e),i=u(E.current,a,e);null===t&&null===i||y({[s]:t,[a]:i},{[s]:t,[a]:i},!0)}),[x]);const T=w&&""!==(v??"");let L=i("div",{style:{display:"flex"},tabIndex:0,onBlur:B,children:[e(to,{id:"left",name:s,value:F,label:h,onChange:e=>{let t=e.target.value,i=u(t,a,ta(x));y({[s]:t,[a]:i},{[s]:t,[a]:i},!0)},disabled:C,error:!C&&T,helperText:!C&&T?v:"",InputLabelProps:{shrink:!0},InputProps:{inputComponent:zA,inputProps:{FormatProps:{thousandSeparator:!0,prefix:"৳",thousandsGroupStyle:"lakh",allowNegative:!0,allowLeadingZeros:!1,decimalScale:2,isAllowed:e=>!(e?.value?.length>10)&&0!==e.floatValue}}}},"left"),e(to,{id:"right",name:a,label:c,value:N,onChange:e=>{let t=e.target.value,i=d(t,s,ta(x));y({[s]:i,[a]:t},{[s]:i,[a]:t},!0)},InputLabelProps:{shrink:!0},InputProps:{inputComponent:VA,inputProps:{FormatProps:{suffix:"%",decimalScale:2,fixedDecimalScale:!0,allowNegative:!0,allowEmptyFormatting:!0,isAllowed:e=>!(e.floatValue>=999.99)}}}},"right")]});return Boolean(p)?e(ie,{...A,children:L}):L};var qA=Object.freeze({__proto__:null,Visaversa:KA,default:KA});const GA=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR"}),WA=({rows:t,column:{id:i,footerRenderStyle:r}})=>{const n=a((()=>t.reduce(((e,t)=>Number(t.values?.[i]??0)+e),0)),[t,i]);let s=isNaN(n)?"":n;return"currency"===r&&(s=GA.format(n)),e("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s})},JA=({value:t})=>e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:t}),XA=n({}),YA=d((({currentRowError:t,currentRowObj:i,children:r,initialData:n,rowValidator:s,setFormError:o,prevRows:d,nextRows:u},p)=>{const f=a((()=>{let e={};for(const t in n)e[t]=!1;return e}),[]),[g,m]=c({}),[w,b]=c(!1),[v,y]=c(n),[B,C]=c(f),x=h((()=>{let e={};for(const t in f)e[t]=!0;C(e)}),[f]);A(p,(()=>({touchAll:x})));const F=h((e=>{y((t=>{let r={...t,...e};return i.current=r,r}))}),[]),N=h((e=>{C((t=>({...t,...e})))}),[]);return l((()=>{(async(e,i,r)=>{try{await s(e,i,r),m({}),b(!1),t.current={}}catch(e){m(e),b(!0),t.current=e}})(v,d,u)}),[v]),l((()=>{o(w?"has error":"")}),[w]),l((()=>()=>{o("")}),[]),e(XA.Provider,{value:{error:g,currentRow:v,setCellValue:F,touched:B,setCellTouched:N},children:r})})),$A=t=>{const{column:{id:i,type:r,clearFields:n,maxLength:s=NaN},row:{id:a},currentEditRow:o}=t;return o===a?e(ZA,{columnName:i,type:r??"text",clearFields:n,maxLength:s},i):e(JA,{...t})},ZA=({columnName:t,type:i,clearFields:r,maxLength:n})=>{const{error:a,setCellValue:o,currentRow:l,touched:h,setCellTouched:c}=s(XA);return e(_t,{type:i,value:l?.[t],size:"small",variant:"outlined",onChange:e=>{(n!=n||e.target.value.length<=n)&&o({[t]:e.target.value,...r})},helperText:h?.[t]&&a?.[t],error:Boolean(h?.[t])&&Boolean(a?.[t]),onBlur:()=>c({[t]:!0}),fullWidth:!0})};let ep=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR"});const tp=({value:t,displayStyle:i})=>{let r="-";if(!isNaN(t))switch(i){case"currency":r=ep.format(t);break;case"percentage":r=`${t}%`;break;case"squareFeet":r=(new Intl.NumberFormat).format(t);break;default:r=t}return e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:r})},ip=t=>{const{column:{id:i,FormatProps:r,formattedValue:n,displayStyle:s,clearFields:a,enableNumWords:o},row:{id:l},currentEditRow:h}=t;return h===l?e(rp,{columnName:i,FormatProps:r,formattedValue:n,clearFields:a,enableNumWords:o},i):e(tp,{...t,displayStyle:s})},rp=({columnName:t,FormatProps:i,formattedValue:r,clearFields:n,enableNumWords:a})=>{const{error:o,setCellValue:l,currentRow:h,touched:c,setCellTouched:d}=s(XA);let u=null;try{if(a&&Boolean(h?.[t])){let e=String(h?.[t]).split("."),i=Number(e[0]);i<0?(i=Math.abs(Number(i)),u=`Negative ${yo(i)} Rupees`):u=`${yo(i)} Rupees`,2===e.length&&Boolean(e[1])&&(u=`${u} and ${yo(e[1])} paise`)}}catch(e){}return e(io,{value:h?.[t],onChange:e=>l({[t]:e.target.value,...n}),helperText:Boolean(o?.[t])?o?.[t]:u,error:Boolean(c?.[t])&&Boolean(o?.[t]),onBlur:()=>d({[t]:!0}),InputLabelProps:{shrink:!0},size:"small",fullWidth:!0,margin:"none",InputProps:{inputComponent:dl,inputProps:{FormatProps:{...i,formattedValue:r}}}})},np=t=>{const{column:{id:i,options:r,_optionsKey:n,multiple:s,showCheckbox:a,clearFields:o},row:{id:l},currentEditRow:h}=t,[d,u]=c([]),{loadingOptions:A}=Ao(r,u,n,!1,{},!1,void 0);return h===l?e(sp,{columnName:i,options:d,loadingOptions:A,multiple:s,showCheckbox:a,clearFields:o},i):e(ap,{...t,options:d})},sp=({columnName:t,options:i,loadingOptions:r,multiple:n,showCheckbox:a,clearFields:o})=>{const{error:l,setCellValue:h,currentRow:c,setCellTouched:d,touched:u}=s(XA);let A=c?.[t];return e(Fo,{value:A,error:l?.[t],touched:u?.[t],size:"small",variant:"outlined",handleChange:e=>{h({[t]:e.target.value,...o})},handleBlur:()=>d({[t]:!0}),options:i,loadingOptions:r,multiple:n,showCheckbox:a,fullWidth:!0})},ap=({value:t,options:i})=>e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:po(i,!0)(t)});let op=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR"});function lp(t){const{inputRef:i,onChange:r,FormatProps:n,setChange:s,side:a,...o}=t;return e(Ht,{...o,getInputRef:i,onChange:e=>{s(a)},onValueChange:e=>{r({target:{value:e.value,formattedValue:e.formattedValue}},e.formattedValue)},...n})}const hp=({value:t})=>e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:op.format(t)}),cp=t=>{const{column:{id:i,ViceVersaProps:r,clearFields:n},row:{id:s},currentEditRow:a}=t;return a===s?e(up,{columnName:i,clearFields:n,...r}):e(hp,{...t,displayStyle:r.leftAdornment})},dp=(e,t)=>e,up=({columnName:t,rightTransform:r=dp,leftTransform:n=dp,dependentField:a,leftFormatProps:o,rightFormatProps:h})=>{const{error:d,setCellValue:u,currentRow:A,touched:p,setCellTouched:f}=s(XA),[g,m]=c(""),[w,b]=c("");l((()=>{let e=r(A?.[t],A?.[a]);m(e),f({[t]:!0})}),[]);let v=A?.[t];l((()=>{""===v&&m("")}),[v]);return i("div",{style:{display:"flex"},children:[e(_t,{value:A?.[t],onChange:e=>{let i=e?.target?.value??e;u({[t]:i})},onBlur:()=>{if("left"!==w)return;let e=r(A?.[t],A?.[a]);m(e)},helperText:p?.[t]&&d?.[t],error:Boolean(p?.[t])&&Boolean(d?.[t]),size:"small",variant:"outlined",InputProps:{inputComponent:lp,inputProps:{FormatProps:o,setChange:b,side:"left"}},fullWidth:!0},"left"),e("div",{style:{padding:"0px 4px"}}),e(_t,{value:g,onChange:e=>{m(e?.target?.value??e)},onBlur:()=>{if("right"!==w)return;let e=n(g,A?.[a]);u({[t]:e})},size:"small",variant:"outlined",InputProps:{inputComponent:lp,inputProps:{FormatProps:h,setChange:b,side:"right"}},fullWidth:!0},"right")]})},Ap=({value:t})=>e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:t}),pp=t=>{const{column:{id:i,MaskProps:r,formattedValue:n=!0,clearFields:s},row:{id:a},currentEditRow:o}=t;return o===a?e(fp,{columnName:i,MaskProps:r,formattedValue:n,clearFields:s},i):e(Ap,{...t})},fp=({columnName:t,MaskProps:i,formattedValue:r,clearFields:n})=>{const{error:a,setCellValue:o,currentRow:l,touched:h,setCellTouched:c}=s(XA);return e(io,{value:l?.[t],onChange:e=>o({[t]:e.target.value,...n}),helperText:h?.[t]?a?.[t]:"",error:Boolean(h?.[t])&&Boolean(a?.[t]),onBlur:()=>c({[t]:!0}),InputLabelProps:{shrink:!0},size:"small",fullWidth:!0,margin:"none",InputProps:{inputComponent:pl,inputProps:{MaskProps:{...i,formattedValue:r}}}})},gp={accessor:"action",alignment:"left",width:150,Cell:({requestRowEdit:t,currentEditRow:r,saveCurrentRow:n,cancelCurrentRowEdit:s,row:{id:a}})=>e("div",{style:{display:"flex",alignItems:"start"},children:r===a?i(p,{children:[e(ct,{onClick:()=>n(a),size:"small",variant:"outlined",disableRipple:!0,children:"Done"}),e(ct,{onClick:()=>s(a),size:"small",variant:"outlined",disableRipple:!0,children:"Cancel"})]}):e(ct,{onClick:()=>t(a),size:"small",variant:"outlined",disableRipple:!0,children:"Edit"})}),columnName:"Action"},mp=e=>(e=(e=>{if(Array.isArray(e)){let t=e;return t=t.map((e=>{if("string"==typeof e.options){let t=e.options,i=ss.getFn(t,(async()=>[{label:"Cannot fetch options",value:""}]));return{...e,_optionsKey:t,options:i}}return e})),t}return e})(e),e=(e=>{if(Array.isArray(e)){let t=e;return t=t.map((e=>{if("string"!=typeof e.Cell)return e;switch(e.Cell){case"textField":return{...e,Cell:$A};case"numberField":return{...e,Cell:ip};case"selectField":return{...e,Cell:np};case"visaversa":return{...e,Cell:cp};case"monthYear":return{...e,Cell:pp};default:return{...e,Cell:JA}}})),t}return e})(e=(e=>{if(Array.isArray(e)){let t=e;return t=t.map((e=>{if(Boolean(e.footer)){const{footer:t,...i}=e;return{...i,Footer:WA}}return e})),t}return e})(e=(e=>{if(Array.isArray(e))return[...e,gp];return e})(e)))),wp=({column:{columnName:r,getResizerProps:n}})=>i(t,{children:[e("span",{style:{whiteSpace:"nowrap"},children:r}),e("div",{...n([{style:{display:"inline-block",position:"absolute",right:"-5px",top:"0",padding:"0 5px",zIndex:1}}]),children:e("div",{style:{height:"35px",width:"6px",backgroundColor:"#888"}})})]}),bp=({row:t})=>e(ui,{size:"small",...t.getToggleRowSelectedProps([{style:{padding:0}}])}),vp=({getToggleAllRowsSelectedProps:t})=>e(ui,{size:"small",...t([{style:{padding:0}}])}),yp=async()=>{},Bp={},Cp=async()=>{throw{error_msg:"Fn not defined"}},xp=({columns:t,defaultColumn:r,data:n,setData:s,rowIDColumn:a,label:l,setFormError:d,disabled:u,maxHeight:A="200px",newRowObj:f=Bp,dataIdColumn:g="id",rowValidator:m=yp,deleteRowFn:w=Cp,disableFooter:b=!1})=>{const v=o(null),y=o(-1),B=o({}),C=o({}),[x,F]=c(-1),[N,S]=c(!1),[E,T]=c(!1),L=o(null),k=h((e=>e[a]),[]),{t:D}=ne(),I=h((()=>{T(!1)}),[T]),U=h((()=>{N||(s((e=>[...e,{...f,[a]:++y.current}])),S(!0),F(y.current),B.current={},setTimeout((()=>{let e=L.current;e?.scrollTo({behavior:"smooth",top:e.scrollHeight-e.offsetHeight,left:0})}),1))}),[s,S,F,N,n]),P=h((e=>{if(Object.keys(C.current).length>0)return v?.current?.touchAll?.(),!1;let t=n.map((t=>k(t)===e?{...t,...B.current}:t));return s(t),F(-1),S(!1),B.current={},!0}),[s,S,F,n,k]),O=h((e=>{N&&s((t=>t.filter((t=>!(k(t)===e))))),F(-1),S(!1),B.current={},C.current={}}),[s,F,S,N]),R=h((e=>{N||Object.keys(C.current).length>0||(-1===x||O(x),F(e),B.current={})}),[P,F,x,N]),Q=Gt({columns:t,data:n,defaultColumn:r,requestRowEdit:R,currentEditRow:x,getRowId:k,saveCurrentRow:P,cancelCurrentRowEdit:O},ei,ti,ii,(H=!0,t=>{Boolean(H)&&t.visibleColumns.push((t=>[{id:"selectionCheckbox",Header:vp,Cell:bp,minWidth:25,width:25,maxWidth:25,sticky:!0,Footer:()=>e("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingRight:"10px"},children:"Total"})},...t]))}));var H;const{getTableProps:M,getTableBodyProps:_,headerGroups:j,footerGroups:z,rows:V,prepareRow:K,selectedFlatRows:q}=Q;return i(p,{children:[i(ni,{style:{width:"90%",overflow:"hidden"},tabIndex:0,children:[i(si,{variant:"dense",style:{display:"flex",minHeight:"40px",paddingLeft:"16px",paddingRight:"16px"},children:[e(vt,{variant:"h6",children:l}),e("div",{style:{flexGrow:1}}),q.length>0?e(ct,{variant:"outlined",size:"small",onClick:()=>{T(!0)},children:D("Delete")}):null]}),e(ai,{style:u?{opacity:.5}:{},children:i(oi,{...M(),size:"small",component:"div",children:[e(li,{component:"div",children:j.map((t=>e(hi,{...t.getHeaderGroupProps(),component:"div",children:t.headers.map((t=>e(ci,{...t.getHeaderProps([{style:{overflow:"hidden",textOverflow:"ellipsis",textAlign:t?.alignment??"unset",pointerEvents:u?"none":"unset"}}]),component:"div",children:t.render("Header")})))})))}),e(di,{..._({}),component:"div",children:e("div",{style:{overflowY:"scroll",maxHeight:A,overflowX:"hidden"},ref:L,children:V.map(((t,i)=>{K(t);const r=t.getRowProps([{style:{pointerEvents:u?"none":"unset"}}]),n=e(hi,{...r,component:"div",children:t.cells.map((t=>e(ci,{...t.getCellProps([{style:{textOverflow:"ellipsis",overflow:"hidden",textAlign:t?.column?.alignment??"unset"}}]),component:"div",children:t.render("Cell")})))});if(x===t.id){let s=V.slice(0,i).map((e=>e?.original)),a=V.slice(i+1).map((e=>e?.original));return e(YA,{currentRowError:C,currentRowObj:B,initialData:t.original,rowValidator:m,prevRows:s,nextRows:a,setFormError:d,ref:v,children:n},`${r.key}_row_with_context`)}return n}))})}),b?null:e(li,{component:"div",children:z.map((t=>e(hi,{...t.getFooterGroupProps(),component:"div",children:t.headers.map((t=>e(ci,{...t.getFooterProps([{style:{textAlign:t?.alignment??"unset"}}]),component:"div",children:t.render("Footer")})))})))})]})}),e(ct,{onClick:U,disabled:u,children:D("AddRow")})]}),e(Fp,{selectedRows:q,dataIdColumn:g,open:E,closeDialog:I,deleteFn:w,setData:s})]})},Fp=({selectedRows:t,dataIdColumn:r,deleteFn:n,open:s,closeDialog:a,setData:o})=>{const{t:l}=ne(),h=()=>{c.reset(),a()},c=Vt((d=n,async({data:e})=>d(e)),{onSuccess:()=>{h()}});var d;return i(dt,{open:s,children:[c.isError?e(Va,{severity:"error",errorMsg:c.error?.error_msg??"Unknown error occured",errorDetail:c.error?.error_detail??""}):null,e(ut,{children:l("Wouldyouliketodeletetheselectedrecord")}),i(At,{children:[e(ct,{onClick:()=>{let e=t.map((e=>e?.original?.[r]??Number.MAX_SAFE_INTEGER)).filter((e=>e!==Number.MAX_SAFE_INTEGER));c.mutate({data:e}),o((t=>t.filter((t=>!(e.indexOf(t[r])>=0)))))},disabled:c.isLoading,children:l("Yes")}),e(ct,{onClick:h,disabled:c.isLoading,children:l("No")})]})]})},Np=e=>e,Sp="__id",Ep=({_columns:t,arrayFieldIDName:i,dataTransformer:r=Np,rowValidator:n,removeRowFn:s,name:d,fieldKey:u,GridProps:A,enableGrid:p,label:f,maxHeight:g,shouldExclude:m,dependentFields:w,disableFooter:b})=>{const v=a((()=>{let e=Mt(t);return mp(e)}),[]),y=a((()=>({Header:wp,Cell:JA})),[]),B=a((()=>{let e=(e=>{if(Array.isArray(e))return e.reduce(((e,t)=>(e[t.accessor]=t?.defaultValue??"",e)),{});return{}})(t);return e={[i]:"",...e},e}),[]),C=o(-1e3),[x,F]=c(!1),{value:N,setValueAsCB:S,setErrorAsCB:E,isSubmitting:T,fieldKey:L,excluded:k}=Js({name:d,fieldKey:u,shouldExclude:m,dependentFields:w}),D=h((e=>{S("function"==typeof e?t=>r(e(t)):r(e))}),[S,r]);if(l((()=>{if(!x&&Array.isArray(N)&&N.length>0){let e=N.map((e=>void 0===e[Sp]?{...e,[Sp]:C.current++}:e));D(e),F(!0)}})),k)return null;const I=e(xp,{columns:v,defaultColumn:y,dataIdColumn:i,newRowObj:B,rowValidator:n,setData:D,data:Array.isArray(N)?N:[],rowIDColumn:Sp,deleteRowFn:s,label:f,maxHeight:g,setFormError:E,disabled:T,disableFooter:b},L);return Boolean(p)?e(ie,{...A,children:I}):I};var Tp=Object.freeze({__proto__:null,DataTable:Ep,default:Ep});const Lp=({name:t,fieldKey:i,TypographyProps:r,GridProps:n,label:s,dependentFields:a,shouldExclude:o,setValueOnDependentFieldsChange:h,componentType:c})=>{const{value:d,handleChange:u,name:A,excluded:f,dependentValues:g,incomingMessage:m,formState:w}=Js({name:t,fieldKey:i,dependentFields:a,shouldExclude:o,componentType:c});return l((()=>{if("function"==typeof h){let e=h(ta(g),w);null!=e&&u(e)}}),[g,u,h]),l((()=>{if(null!==m&&"object"==typeof m){const{value:e}=m;(Boolean(e)||""===e)&&u(e)}}),[m,u]),f?null:e(p,{children:e(Se,{...n,children:e(fe,{variant:"h6",style:void 0,...r,children:d||s})})},A)},kp=Ci((e=>({root:{paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5),background:"var(--theme-color1)"},title:{flex:"1 1 100%",color:"var(--white)",letterSpacing:"1px",fontSize:"1.5rem"},refreshiconhover:{}})));let Dp=[];const Ip=d((({dense:t,title:r,allowColumnHiding:n,fields:s,initialDataValue:h,initialVisibleColumnData:d,submitButtonHide:u,submitButtonName:f,submitSecondButtonHide:g=!0,submitSecondButtonName:m="submit",submitSecondLoading:w=!1,submitSecondAction:b=(e,t)=>{},submitSecondValidtion:v=!0,hideHeader:y,isDisplayOnly:B,onAction:C,loading:x,onFieldAction:F=(e,t)=>{},propStyles:N,focusScopeId:S,enableEnterToFocus:E},T)=>{const L=kp(),k=o(null),[D,I]=c({}),[U,P]=c(h),[O,R]=c(s),{t:Q}=ne(),[H,M]=c(d),_=a((()=>{let e={};return s.forEach((t=>{Boolean(t.dependFields)&&Array.isArray(t.dependFields)&&t.dependFields.forEach((i=>{Boolean(e[i])?e[i].push(t.name):e[i]=[t.name]}))})),e}),[s]),j=a((()=>{let e={};return s.forEach((t=>{Boolean(t.dependFields)&&Array.isArray(t.dependFields)&&"function"==typeof t.dependFieldsonchange&&(e[t.name]=t.dependFieldsonchange)})),e}),[s]),z=(e,t="",i=!1)=>{const r=e.target.name,n=i?e.target.value.toUpperCase():e.target.value;P((e=>({...e,[r]:n}))),Boolean(n)&&D[r]?.isError&&I((e=>({...e,[r]:{isError:!1,ErrorMessage:" "}}))),Boolean(_[r])&&_[r].forEach((e=>{if("function"==typeof j[e]){let i=j[e](U,n,r,t);Boolean(i)&&R((t=>t.map((t=>{let r=t;return t.name===e&&"object"==typeof i&&(r={...r,...i},i.hasOwnProperty("isVisible")&&M((e=>({...e,[t.name]:Boolean(i?.isVisible)}))),i.hasOwnProperty("__DATA")&&P((e=>({...e,[t.name]:i.__DATA})))),r}))))}}))};l((()=>{P(h),Object.keys(h).forEach((e=>{let t={target:{name:e,value:h[e]}};z(t)}))}),[JSON.stringify(h)]);Dp=a((()=>O.map((e=>{let t=()=>{M((t=>({...t,[e.name]:!H[e.name]})))};return{id:e.name,isTableHidden:e?.isTableHidden??!1,columnName:e?.label??"",isColumnHidingDisabled:e?.isColumnHidingDisabled??!1,getToggleHiddenProps:()=>({checked:H[e.name]??!0,onChange:t,style:{cursor:"pointer"}})}}))),[O,H]);const V=async(e,t,i,r)=>{let n=!0,s={};for(const a of e)if(i[a.name]??1)if(a?.isRequired&&!Boolean(t[a.name]))s={...s,[a.name]:{isError:!0,ErrorMessage:Q("ThisFieldisrequired")}},n=!1;else{let e="";"function"==typeof a?.validate&&(e=await a.validate(t[a.name],t,r)),n=!Boolean(e)&&n,s={...s,[a.name]:{isError:Boolean(e),ErrorMessage:Boolean(e)?e:" "}}}else s={...s,[a.name]:{isError:!1,ErrorMessage:" "}};return I(s),n};A(T,(()=>({columnVal:U,onAction:C})));const{dynamicAmountSymbol:K}=Ws(),q=S&&E?{"data-scope-id":S}:{};return e(p,{children:i(ni,{style:{width:"100%"},sx:N.paperStyle,onKeyDown:e=>{E&&ma(e,S)},...q,children:[y?null:i(si,{className:L.root,variant:t?"dense":"regular",sx:N.toolbarStyles,children:[e(vt,{className:L.title,color:"inherit",variant:"h6",component:"div",sx:N.titleStyle,children:r}),n?e(Ol,{visibleColumns:Dp,defaultHiddenColumns:[],classes:L,IconButtonStyle:N.IconButtonStyle}):null]}),e("div",{style:{flexGrow:"1",margin:"15px"},children:i(ie,{container:!0,spacing:2,justifyContent:"flex-start",alignItems:"center",direction:"row",children:[e(ie,{item:!0,xs:u?12:10,container:!0,spacing:1,justifyContent:"flex-start",alignItems:"center",children:O.map((t=>H[t.name]??1?e(ie,{item:!0,xs:t?.gridconfig?.xs??6,sm:t?.gridconfig?.sm??3,children:"select"===(t?.type??"text").toLowerCase()?e(Bo,{name:t.name,options:t?.optiondata??[],_optionsKey:t?._optionsKey??"",handleChange:(e,i)=>{z(e,i),!Boolean(t?.externalFunctionCall)||"onChange"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value,i)},label:Q(t?.label??""),fullWidth:!0,value:U[t.name],selectVariant:"regular",enableDefaultOption:Boolean(t?.enableDefaultOption),defaultOptionLabel:t?.defaultOptionLabel??"Select Value",disabled:!!t?.isDisabled||(!!B||(x||w)),skipDefaultOption:t?.skipDefaultOption??!0,error:Boolean(D[t.name]?.isError)?D[t.name]?.ErrorMessage??"Error":"",touched:t?.touched??!0,defaultSpaceAdd:t?.defaultSpaceAdd??!0,required:t?.isRequired??!1,handleBlur:(e,i)=>{O.forEach((e=>{"function"==typeof e?.onBlurHandler&&e.onBlurHandler(U[e.name],U)})),!Boolean(t?.externalFunctionCall)||"onBlur"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value,i)}}):"spacer"===(t?.type??"text").toLowerCase()?e(QA,{...t},`${t.name}`):"typography"===(t?.type??"text").toLowerCase()?e(Lp,{fieldKey:t.name,name:t.name,label:Q(t?.label??""),TypographyProps:{color:"secondary"}}):"datetimepicker"===(t?.type??"text").toLowerCase()||"datepicker"===(t?.type??"text").toLowerCase()?e(tr,{dateAdapter:Qi,children:e(Lo,{format:t?.dateFormat?t?.dateFormat:"datepicker"===(t?.type??"text").toLowerCase()?"dd/MM/yyyy":"dd/MM/yyyy HH:mm:ss",value:""===U[t.name]||null===U[t.name]?null:new Date(U[t.name]),label:Q(t?.label??""),views:"datetimepicker"===(t?.type??"text").toLowerCase()?["year","month","day","hours","minutes","seconds"]:["year","month","day"],onChange:e=>{let i={target:{name:t.name,value:e}};z(i),!Boolean(t?.externalFunctionCall)||"onChange"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(i.target.name,i.target.value)},disabled:!!t?.isDisabled||(!!B||(x||w)),slots:{textField:to},slotProps:{textField:{name:t.name,error:Boolean(D[t.name]?.isError),InputLabelProps:{shrink:!0},onKeyDown:e=>{"Enter"===e.key&&t?.entertoSubmit&&k?.current?.click?.()}},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%",mb:3}})}):"amountfield"===(t?.type??"text").toLowerCase()||"numberfield"===(t?.type??"text").toLowerCase()?e(to,{sx:{mb:3},label:Q(t?.label??""),value:U[t.name],onChange:e=>{z(e),!Boolean(t?.externalFunctionCall)||"onChange"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value)},onBlur:e=>{!Boolean(t?.externalFunctionCall)||"onBlur"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value)},InputProps:{inputComponent:Up,inputProps:{FormatProps:{...t?.FormatProps,type:t?.type??"",name:t?.name??""}},startAdornment:"amountfield"===t?.type?e(ge,{position:"start",style:{padding:"0 0.6rem 0 0"},children:t?.StartAdornment?sl(t?.StartAdornment):sl(K)??"₹"}):null},InputLabelProps:{shrink:!0},onKeyDown:e=>{"Enter"===e.key&&t?.entertoSubmit&&k?.current?.click?.()},disabled:!!t?.isDisabled||(!!B||(x||w))}):"pancard"===(t?.type??"text").toLowerCase()?e(to,{label:Q(t?.label??""),value:U[t.name],placeholder:t.placeholder??"",fullWidth:!0,onChange:e=>{z(e),!Boolean(t?.externalFunctionCall)||"onChange"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value)},onBlur:e=>{!Boolean(t?.externalFunctionCall)||"onBlur"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value)},InputProps:{inputComponent:pl,inputProps:{MaskProps:{mask:"aaaaa0000a",prepare:function(e){return e.toUpperCase()},lazy:!0,...t?.MaskProps},name:t.name??""}},InputLabelProps:{shrink:!0},error:Boolean(D[t.name]?.isError),helperText:i("div",{style:{display:"flex"},children:[e(Ze,{children:Boolean(D[t.name]?.isError)?D[t.name]?.ErrorMessage??"Error":" "}),(t?.maxLength??0)>0&&Boolean(t?.showMaxLength??!1)?i(Ze,{error:!1,style:{flex:1,textAlign:"right",margin:"5px 15px 0 0"},children:[U[t.name].length,"/",t?.maxLength]}):null]}),onKeyDown:e=>{"Enter"===e.key&&t?.entertoSubmit&&k?.current?.click?.()},disabled:!!t?.isDisabled||(!!B||(x||w))}):"autocomplete"===(t?.type??"text").toLowerCase()?e(Pp,{name:t?.name??"",placeholder:Q(t?.placeholder??""),label:Q(t?.label??""),options:t?.optiondata,_optionsKey:t?._optionsKey,handleChange:(e,i)=>{z(e,i),!Boolean(t?.externalFunctionCall)||"onChange"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value,i)},columnValue:U,dependentField:_,disabled:!!t?.isDisabled||(!!B||(x||w))}):e(to,{autoFocus:t?.defaultfocus??!1,label:Q(t?.label??""),fullWidth:!0,placeholder:String(Q(t?.placeholder??"")),type:"text",name:t.name,value:U[t.name],InputProps:{style:{background:Boolean(t?.isDisabled)?"#f3f3f3":""}},onChange:e=>{if(-1===(t?.maxLength??-1)||e.target.value.length<=t?.maxLength){const i=/^[0-9\b]+$/,r=/^[a-zA-Z0-9\b]+$/;(""===e.target.value||("number"===(t?.type??"text")?i.test(e.target.value):"alphanumeric"!==(t?.type??"text")||r.test(e.target.value)))&&(z(e,"",Boolean(t?.toUpperCase)),!Boolean(t?.externalFunctionCall)||"onChange"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value))}},onBlur:e=>{!Boolean(t?.externalFunctionCall)||"onBlur"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value)},InputLabelProps:{shrink:!0},required:t?.isRequired??!1,autoComplete:t?.autoComplete??"off",disabled:!!t?.isDisabled||(!!B||(x||w)),error:Boolean(D[t.name]?.isError),helperText:i("div",{style:{display:"flex"},children:[e(Ze,{children:Boolean(D[t.name]?.isError)?D[t.name]?.ErrorMessage??"Error":" "}),(t?.maxLength??0)>0&&Boolean(t?.showMaxLength??!1)?i(Ze,{error:!1,style:{flex:1,textAlign:"right",margin:"5px 15px 0 0"},children:[U[t.name].length,"/",t?.maxLength]}):null]}),onKeyDown:e=>{"Enter"===e.key&&t?.entertoSubmit&&k?.current?.click?.()}})},`gird${t.name}`):null))}),i(ie,{item:!0,xs:2,container:!0,justifyContent:"center",alignItems:"center",spacing:2,style:{maxWidth:"16%"},children:[e(ie,{item:!0,children:e(za,{sx:{display:u?"none":"auto"},disabled:x||w,endIcon:x?e(re,{size:20}):null,onClick:async()=>{await V(O,U,H,"FIRST")&&C(U,H)},ref:k,children:Q(f)})},`gird${f}`),g?null:e(ie,{item:!0,children:e(za,{disabled:x||w,endIcon:w?e(re,{size:20}):null,onClick:async()=>{v&&!await V(O,U,H,"SECOND")||b(U,H)},children:Q(m)})},`gird${m}`)]})]})})]})})})),Up=t=>{const{inputRef:i,onChange:r,FormatProps:n,...s}=t,{type:a,name:o,...l}=n,{decimalCount:h,dynamicAmountGroupStyle:c}=Ws();return e(Ht,{...s,getInputRef:i,onValueChange:e=>{r({target:{value:e.value,name:o}})},valueIsNumericString:!1,..."amountfield"===a?{thousandSeparator:!0,isNumericString:!0,decimalScale:n?.decimalScale?n?.decimalScale:h??2,fixedDecimalScale:!0,thousandsGroupStyle:n?.thousandsGroupStyle?n?.thousandsGroupStyle:c??"lakh"}:{},...l})},Pp=({name:t,label:r,placeholder:n,options:s,_optionsKey:a,handleChange:o,freeSolo:l=!1,disabled:c,columnValue:d,dependentField:u})=>{const A=h((e=>t=>Boolean(e)?t:t?.label??"")(l),[]),{t:f}=ne(),{authState:g}=Vs(),{data:m,status:w,isLoading:b,isFetching:v,error:y}=zt([a],(()=>s(d?.[t]??void 0,d,u,g)));return e(Le,{sx:{mb:3},options:m??[],onChange:(e,i)=>{o({target:{value:i?.value,name:t}},i?.label)},disabled:c,getOptionLabel:A,renderInput:s=>e(to,{...s,label:f(r??""),placeholder:String(f(n??"")),name:t,autoComplete:"disable",InputProps:{...s.InputProps,endAdornment:i(p,{children:[b||v?e(re,{size:25,color:"secondary",variant:"indeterminate"}):null,s.InputProps.endAdornment]})},InputLabelProps:{shrink:!0}}),renderOption:(t,i,r)=>{t.key=t.id;let{selected:n,inputValue:s}=r,a=A(i);const o=wi(a,s),l=bi(a,o).map(((t,i)=>e("span",{style:{fontWeight:t.highlight?700:400},children:t.text},i)));return e("li",{style:{whiteSpace:"pre"},...t,children:l})}})},Op=d((({finalMetaData:t,onAction:i,loading:r,data:n,submitSecondButtonHide:s=!0,submitSecondButtonName:a="submit",submitSecondLoading:o=!1,submitSecondAction:l=(e,t)=>{},submitSecondValidtion:h=!0,onFieldAction:c=(e,t,i)=>{},propStyles:d={titleStyle:{},toolbarStyles:{},IconButtonStyle:{},paperStyle:{}},enableEnterToFocus:u,focusScopeId:A="enter-to-focus-formComponentView"},p)=>{const{enableEnterToFocus:f}=Ws(),g=t.gridConfig?.isDisplayOnly??!1,{t:m}=ne();let w=Rp({metaData:t,isDisplayOnly:g,data:n});return e(Ip,{dense:w.gridConfig?.dense??!0,title:m(w.gridConfig?.title??"No Title"),fields:w.fields,allowColumnHiding:w.gridConfig?.allowColumnHiding??!1,initialDataValue:w.initialData,initialVisibleColumnData:w.initialVisibleColumnData,submitButtonHide:w.gridConfig?.submitButtonHide??!1,submitButtonName:w.gridConfig?.submitButtonName??"SUBMIT",hideHeader:w.gridConfig?.HideHeader??!1,isDisplayOnly:g,onAction:i,loading:r,submitSecondButtonHide:s,submitSecondButtonName:a,submitSecondLoading:o,submitSecondAction:l,submitSecondValidtion:h,onFieldAction:c,propStyles:d,enableEnterToFocus:u??f,focusScopeId:A,ref:p})})),Rp=({metaData:e,isDisplayOnly:t,data:i})=>{let r=O(e),n=r.fields.reduce(((e,r)=>e={...e,[r.name]:t||Boolean(i[r?.accessor])?i[r?.accessor]??"":r?.defaultValue??""}),{}),s=r.fields.reduce(((e,t)=>e={...e,[t.name]:t?.isVisible??!0}),{});return{gridConfig:r.gridConfig,fields:r.fields,initialData:n,initialVisibleColumnData:s}},Qp=R.object().shape({name:R.string().required(),label:R.string().required(),render:R.object().shape({ordering:R.string().required(),renderType:R.string().required(),groups:R.object().required()}),submitAction:R.string().required()}),Hp=R.array().of(R.object().shape({name:R.string().required(),label:R.string().required(),render:R.object().shape({componentType:R.string().required(),group:R.number().required()}),sequence:R.number(),GridProps:R.object().shape({xs:R.number().required(),md:R.number().required(),sm:R.number().required()})}));R.object().shape({form:Qp,fields:Hp});const Mp=d((({metaData:t,children:r=()=>{},actions:n=[],initialData:s={},isError:h=!1,errorObj:d={},handelActionEvent:u=()=>{},formStyle:f={background:"white",height:"calc(100vh - 650px)",overflowY:"auto",overflowX:"hidden"},isNewRow:g=null,isLoading:m=!1,onSubmitData:w=()=>{},displayMode:b=null,containerstyle:v={padding:"10px"},formName:y="",formNameMaster:B="",onFormButtonClickHandel:C=e=>{},onClickActionEvent:x=()=>{},hideHeader:F=!1,onFormDataChange:N=()=>{},isDetailHide:S=!1,formState:E={},setDataOnFieldChange:T,isDetailRowRequire:L=!0,subHeaderLabel:k,subHeaderLabelStyle:D,hideDisplayModeInTitle:I=!1,headerToolbarStyle:U={},refetchData:P,formHeaderStyle:O={},enableEnterToFocus:R,focusScopeId:Q="enter-to-focus-master-details-form"},H)=>{const{enableEnterToFocus:M}=Ws(),_=a((()=>{const{DETAILS_DATA:e=[],...t}=s;return e}),[s]),[j,z]=c(_),{t:V}=ne(),K=o(null),q=o(null),G=o(!1),[W,J]=c(""),X=a((()=>Na(t.masterForm,b)),[t,b,B]),Y=a((()=>Sa(t.detailsGrid,b)),[t,b,y]),$=a((()=>t?.detailsGrid?.gridConfig?.rowIdColumn||"id"),[t]),Z=a((()=>{const{DETAILS_DATA:e,...t}=s;return t}),[s]),ee=a((()=>Y.columns.reduce(((e,t)=>("deleteRowCell"===t?.componentType||(e[t?.accessor]=t?.defaultValue??""),e)),{})),[Y]),te=a((()=>{let e=Y.columns;return"view"===b&&(e=Y.columns.filter((e=>"_hidden"!==e.accessor))),{...Y,columns:e}}),[b,Y]);l((()=>{G.current=S,S&&Boolean(W)&&J("")}),[S,J]);const ie=()=>{q?.current?.handleFormReset({preventDefault:()=>{}}),z([])},re=()=>{q?.current?.handleFormClear({preventDefault:()=>{}}),z([])};return A(H,(()=>({addNewRow:(e=!1,t=ee)=>(async(e=!1,t=ee)=>{if(!m){if(Boolean(W)&&J(""),e){let{hasError:e,data:t}=await(K.current?.validate(!0));if(!0===e)return void(t&&z(t))}z((e=>{if(Array.isArray(e)){let i=ia(e,$);const r={...t,_isNewRow:!0,[$]:i};return[...e,r]}return[{...t,_isNewRow:!0,[$]:1}]}))}})(e,t),GetGirdData:()=>K?.current?.cleanData?.(),onSubmitHandler:(e,t="action",i=!0)=>{q.current?.handleSubmit(e,t,i)},setGridData:z,getFieldData:q?.current?.getFieldData,handleFormReset:ie,clearMasterDetailForm:re,handleFormClear:q?.current?.handleFormClear}))),e(p,{children:i("div",{style:{paddingBottom:"10px"},children:[h?e("div",{style:{padding:"10px 10px 0 10px"},children:e(sr,{position:"relative",color:"primary",children:e(Va,{severity:"error",errorMsg:d?.error_msg??"Unknow Error",errorDetail:d?.error_detail??"",color:"error"})})}):Boolean(W)?e("div",{style:{padding:"10px 10px 0 10px"},children:e(sr,{position:"relative",color:"primary",children:e(Va,{errorMsg:W,errorDetail:"",severity:"error"})})}):null,e(Ac,{metaData:X,initialValues:Z,formStyle:f,onSubmitHandler:async(e,t,i,r,n,s,a,o)=>{if(G.current){Boolean(W)&&J("");let l=ha(e,Z),h={_isNewRow:Boolean(g),...e,DETAILS_DATA:{isNewRow:[],isUpdatedRow:[],isDeleteRow:[]},...l};w({data:h,resultValueObj:e,resultDisplayValueObj:t,endSubmit:i,setFieldErrors:r,actionFlag:n,hasError:s,optionalData:a,errorFields:o})}else{let{hasError:s,data:l}=await(K.current?.validate(!0));if(Boolean(W)&&J(""),!0===s)i(!0),l&&z(l);else{let l=K?.current?.cleanData?.();if(Array.isArray(l)||(l=[l]),0===l.length&&L)i(!0),J(String(V("Atleastonerowmustbeindetail")));else{let h=l.filter((e=>Boolean(e?._hidden)));if("edit"===b&&h.length===l.length&&L)return i(!0),void J(String(V("Atleastonerowmustbeindetail")));let c=l.filter((e=>!(Boolean(e?._hidden)&&Boolean(e?._isNewRow))));if(0===c.length&&L)i(!0),J(String(V("Atleastonerowmustbeindetail")));else{c=Oa(c);let l=ha(e,Z),h={_isNewRow:Boolean(g),...e,DETAILS_DATA:c,...l};w({data:h,resultValueObj:e,resultDisplayValueObj:t,endSubmit:i,setFieldErrors:r,actionFlag:n,hasError:s,optionalData:a,errorFields:o})}}}}},displayMode:b,hideDisplayModeInTitle:I,containerstyle:v,onFormButtonClickHandel:C,onFormDataChange:N,hideHeader:F,formState:E,ref:q,setDataOnFieldChange:T,subHeaderLabel:k,subHeaderLabelStyle:D,formHeaderStyle:O,focusScopeId:Q,enableEnterToFocus:R??M,children:r},(Boolean(B),B)),e("div",{style:{paddingRight:"10px",paddingLeft:"10px",display:S?"none":"inherit"},children:e(Xd,{finalMetaData:te,data:j,setData:z,loading:m,actions:n,setAction:u,refetchData:P,ref:K,onClickActionEvent:x,fieldDataRef:q,headerToolbarStyle:U,focusScopeId:Q,enableEnterToFocus:R??M},(Boolean(y),y))})]})})})),_p=n({}),jp=({children:t,insertFormData:i,checkFormDataExist:r,deleteFormData:n,updateFormData:s,getFormData:a,getGridFormData:o,getFormMetaData:l,getGridFormMetaData:h,context:c})=>e(_p.Provider,{value:{context:c,insertFormData:i,checkFormDataExist:r,deleteFormData:n,updateFormData:s,getFormData:a,getGridFormData:o,getFormMetaData:l,getGridFormMetaData:h},children:t}),zp=({isDataChangedRef:r,successAction:n,cancelAction:a,formStyle:h})=>{const{insertFormData:c,getFormMetaData:d,context:u}=s(_p),{enqueueSnackbar:A}=ji(),{addEntry:p}=s(oo),f=o(null);null===f.current&&(f.current=ho(Object.values(c.args)));const g=Vt((e=>async({data:t})=>e(t))(c.fn(c.args)),{onError:(e,{endSubmit:t})=>{let i="Unknown Error occured";"object"==typeof e&&(i=e?.error_msg??i),t(!1,i,e?.error_detail??"")},onSuccess:(e,{endSubmit:t})=>{t(!0,""),r.current=!0,A("Data is successfully saved with",{variant:"success"}),"function"==typeof n&&n()}});l((()=>{p(["getFormMetaData",f.current,"new"])}),[p]);const m=zt(["getFormMetaData",f.current,"new"],(()=>d.fn(d.args)("new"))),w=m.dataUpdatedAt,b=m.isLoading||m.isFetching;let v=m.isError,y=`${m.error?.error_msg??"unknown error occured"}`,B={};m.isSuccess&&(B=O(m.data),B.form.formState={...u,formCode:B?.form?.name},B.form.name=`${B.form.name}-New`,"stepper"===B?.form?.render?.renderType&&(B.form.render.renderType="tabs")),!1===b&&!1===v&&(!1===v||(y="Error loading form"));return b?i(t,{children:[e(sd,{}),"function"==typeof a?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:a,children:e(ar,{})})}):null]}):!0===v?i(t,{children:[e("span",{children:y}),"function"==typeof a?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:a,children:e(ar,{})})}):null]}):e(Ac,{metaData:B,initialValues:{},onSubmitHandler:(e,t,i,r)=>{g.mutate({data:e,displayData:t,endSubmit:i,setFieldError:r})},displayMode:"new",formStyle:h,children:({isSubmitting:r,handleSubmit:n})=>i(t,{children:[e(ct,{onClick:n,disabled:r,endIcon:r?e(re,{size:20}):null,children:"Save"}),"function"==typeof a?e(ct,{onClick:a,disabled:r,children:"Cancel"}):null]})},`${f.current}-${w}-new`)},Vp=({isDataChangedRef:r,closeDialog:n,defaultView:a="view",serialNo:d="1",setEditFormStateFromInitValues:u,readOnly:A=!1,disableCache:p=!1,formStyle:f})=>{const{updateFormData:g,getFormData:m,getFormMetaData:w,context:b}=s(_p),{addEntry:v}=s(oo),[y,B]=c(a),{enqueueSnackbar:x}=ji(),F=h((()=>B("view")),[B]),N=h((()=>B("edit")),[B]),S=o(null);null===S.current&&(S.current=ho(Object.values(m.args)));const E=Vt((e=>async({data:t,serialNo:i})=>e(t,i))(g.fn(g.args)),{onError:(e,{endSubmit:t})=>{let i="Unknown Error occured";"object"==typeof e&&(i=e?.error_msg??i),t(!1,i,e?.error_detail??"")},onSuccess:(e,{serialNo:t})=>{ao.refetchQueries(["getFormData",S.current,t]),x("Data changes successfully saved",{variant:"success"}),r.current=!0,F(),"function"==typeof n&&n()}}),T=(e,t,i,r)=>{E.mutate({data:e,displayData:t,endSubmit:i,setFieldError:r,serialNo:d})};l((()=>{v(["getFormData",S.current,d]),v(["getFormMetaData",S.current,"view"]),v(["getFormMetaData",S.current,"edit"])}),[v,d]);const L=Kt([p?{queryKey:["getFormData",S.current,d],queryFn:()=>m.fn(m.args)(d),cacheTime:0}:{queryKey:["getFormData",S.current,d],queryFn:()=>m.fn(m.args)(d)},{queryKey:["getFormMetaData",S.current,"view"],queryFn:()=>w.fn(w.args)("view")},{queryKey:["getFormMetaData",S.current,"edit"],queryFn:()=>w.fn(w.args)("edit")}]),k=`${L[0].dataUpdatedAt}`,D=L[0].isLoading||L[1].isLoading||L[2].isLoading||L[0].isFetching||L[1].isFetching||L[2].isFetching;let I=L[0].isError||L[1].isError||L[2].isError,U=`${L[0].error?.error_msg} ${L[1].error?.error_msg} ${L[2].error?.error_msg}`;U=Boolean(U.trim())?U:"Unknown error occured";let P=L[0].data,R={},Q={};if(L[1].isSuccess&&L[2].isSuccess&&L[0].isSuccess){const e="function"==typeof u?u(L[0].data):void 0;Q=O(L[1].data),R=O(L[2].data),R.form.formState={...b,serialNo:d,formCode:R.form.name,...e},R.form.name=`${R.form.name}-edit`,"stepper"===R?.form?.render?.renderType&&(R.form.render.renderType="tabs"),Q.form.formState={...b,serialNo:d,formCode:Q.form.name,...e},Q.form.name=`${Q.form.name}-view`,"stepper"===Q?.form?.render?.renderType&&(Q.form.render.renderType="tabs")}return D?i(t,{children:[e(sd,{}),"function"==typeof n?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:n,children:e(ar,{})})}):null]}):!0===I?i(t,{children:[e("span",{children:U}),"function"==typeof n?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:n,children:e(ar,{})})}):null]}):"view"===y?i(Ac,{metaData:Q,initialValues:P,onSubmitHandler:T,displayMode:y,formStyle:f,children:[A?null:e(ct,{onClick:N,children:"Edit"}),"function"==typeof n?e(ct,{onClick:n,children:"Cancel"}):null]},`${S.current}-${k}-${y}`):"edit"===y?e(Ac,{metaData:R,initialValues:P,onSubmitHandler:T,displayMode:y,formStyle:f,children:({isSubmitting:r,handleSubmit:n})=>i(t,{children:[e(ct,{onClick:n,disabled:r,endIcon:r?e(re,{size:20}):null,children:"Save"}),e(ct,{onClick:F,disabled:r,children:"Cancel"})]})},`${S.current}-${k}-${y}`):null},Kp=({isDataChangedRef:t,closeDialog:r,serialNo:n})=>{const{deleteFormData:a}=s(_p),l=o(null),{t:h}=ne();null===l.current&&(l.current=ho(Object.values(a.args)));const c=Vt((e=>async({serialNo:t})=>e(t))(a.fn(a.args)),{onError:e=>{},onSuccess:e=>{t.current=!0,r()}});return i(p,{children:[e(ut,{id:"alert-dialog-title",children:h("AreyousureyouwanttodeletetheselectedRecords")}),c.isLoading?e(pt,{children:"Deleting..."}):c?.isError?e(pt,{children:e(Va,{severity:"error",errorMsg:c.error?.error_msg??"Unknown Error occured",errorDetail:c.error?.error_detail??""})}):c.isSuccess?e(pt,{children:h("AllRecordssuccessfullydeleted")}):null,c.isSuccess?e(At,{children:e(ct,{onClick:r,color:"primary",children:h("Close")})}):i(At,{children:[e(ct,{onClick:r,color:"primary",disabled:c.isLoading,children:h("Disagree")}),e(ct,{onClick:()=>c.mutate({serialNo:n}),color:"primary",disabled:c.isLoading,children:h("Agree")})]})]},l.current)},qp=d((({actions:t,setAction:i},r)=>{const{addEntry:n}=s(oo),{getGridFormData:a,getGridFormMetaData:h,context:c}=s(_p),d=o(null);null===d.current&&(d.current=ho(Object.values(a.args)));const u=Kt([{queryKey:["getGridFormMetaData",d.current],queryFn:()=>h.fn(h.args)()},{queryKey:["getStaticGridData",d.current],queryFn:()=>a.fn(a.args)()}]);l((()=>{n(["getGridFormMetaData",d.current]),n(["getStaticGridData",d.current])}),[n]),A(r,(()=>({refetch:()=>u[1].refetch()})));const p=u[0].isLoading||u[0].isFetching;let f=u[0].isError||u[1].isError,g=`${u[0].error?.error_msg} ${u[1].error?.error_msg}`.trimStart().trimEnd();g=Boolean(g)?g:"unknown error occured";return p?e(sd,{}):!0===f?e("span",{children:g}):e(Xd,{finalMetaData:u[0].data,data:u[1].data??[],setData:()=>null,actions:t,setAction:i,loading:u[1].isLoading||u[1].isFetching,gridProps:c},`staticGridData-${d.current}`)}));qp.displayName="MyGridWrapper";const Gp=[{label:"KYC",sequence:0,docType:[{label:"Add Documents",type:"kyc",primary:!0,categoryCD:"KYC_DOC_TYPE_CO"}]},{label:"Bank",sequence:1,docType:[{label:"Add Documents",type:"bank",primary:!0,categoryCD:"BANK_DOC_TYPE"}]},{label:"Financial",sequence:2,docType:[{label:"ITR",type:"itr",primary:!0,categoryCD:"ITR_DOC_TYPE"},{label:"Others",type:"itrOther",primary:!1,categoryCD:"ITR_DOC_TYPE_O"}]},{label:"GST",sequence:3,docType:[{label:"Analysis",type:"gst",primary:!0,categoryCD:"GST_DOC_TYPE"},{label:"Others",type:"gstOther",primary:!0,categoryCD:"GST_DOC_TYPE_O"}]},{label:"Others",sequence:4,docType:[{label:"Add Documents",type:"other",primary:!0,categoryCD:"OTHER_DOC_TYPE"}]}],Wp=[{label:"KYC",sequence:0,docType:[{label:"Add Documents",type:"kyc",primary:!0,categoryCD:"KYC_DOC_TYPE"}]},{label:"Bank",sequence:1,docType:[{label:"Add Documents",type:"bank",primary:!0,categoryCD:"BANK_DOC_TYPE"}]},{label:"Financial",sequence:2,docType:[{label:"ITR",type:"itr",primary:!0,categoryCD:"ITR_DOC_TYPE"},{label:"Others",type:"itrOther",primary:!1,categoryCD:"ITR_DOC_TYPE_O"}]},{label:"Others",sequence:3,docType:[{label:"Add Documents",type:"other",primary:!0,categoryCD:"OTHER_DOC_TYPE"}]}],Jp={gridConfig:{dense:!0,gridLabel:"Update Statement",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Bank",componentType:"editableSelect",accessor:"bankID",sequence:4,alignment:"left",options:"getBankListForLeadDocuments",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]},disableCachingOptions:!0},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getBankDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},Xp={gridConfig:{dense:!0,gridLabel:"Bank Statement",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Bank Name",componentType:"default",accessor:"bank",sequence:4,alignment:"left"},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},Yp=[{columnName:"Bank",componentType:"editableSelect",accessor:"bankLineID",sequence:4,alignment:"left",options:"getBankListForLeadDocuments",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]},disableCachingOptions:!0},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getBankDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],$p={gridConfig:{dense:!0,gridLabel:"GST Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getGSTDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},Zp={gridConfig:{dense:!0,gridLabel:"GST",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},ef=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getGSTDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],tf=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getGSTDocTypeOther",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],rf={gridConfig:{dense:!0,gridLabel:"GST Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getGSTDocTypeOther",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},nf={gridConfig:{dense:!0,gridLabel:"ITR Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Financial Year",componentType:"editableNumberFormat",accessor:"finYear",sequence:5,alignment:"left",FormatProps:{format:"####",placeholder:"YYYY",mask:["Y","Y","Y","Y"]},schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getITRDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},sf={gridConfig:{dense:!0,gridLabel:"ITR",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Financial Year",componentType:"default",accessor:"finYear",sequence:4,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},af=[{columnName:"Financial Year",componentType:"editableNumberFormat",accessor:"finYear",sequence:4,alignment:"left",FormatProps:{format:"####",placeholder:"YYYY",mask:["Y","Y","Y","Y"]},schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getITRDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],of={gridConfig:{dense:!0,gridLabel:"ITR Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getITRDocTypeOther",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},lf=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getITRDocTypeOther",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],hf={gridConfig:{dense:!0,gridLabel:"KYC Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getKYCDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},cf={gridConfig:{dense:!0,gridLabel:"KYC",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},df=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getKYCDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],uf={gridConfig:{dense:!0,gridLabel:"KYC Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getKYCDocTypeLegal",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},Af=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getKYCDocTypeLegal",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],pf={gridConfig:{dense:!0,gridLabel:"Others Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getOtherDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},ff={gridConfig:{dense:!0,gridLabel:"Others",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},gf=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getOtherDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],mf=({moduleType:e,productType:t,docCategory:i,categoryCD:r,refID:n,serialNo:s})=>async(e,t=()=>{},i=()=>{})=>{},wf=({moduleType:e,productType:t,refID:i,serialNo:r})=>async e=>{},bf=({moduleType:e,productType:t,refID:i,serialNo:r})=>async(e,t)=>{},vf=({moduleType:e,productType:t,refID:i,serialNo:r})=>async(e,t)=>{},yf=({moduleType:e,productType:t,refID:i,serialNo:r})=>async(e,t,i,r)=>{},Bf=({moduleType:e,productType:t})=>(e,t)=>(Array.isArray(t)||(t=[t]),t.join(","),new URL("").href),Cf=({moduleType:e,productType:t})=>async(e,t)=>{Array.isArray(t)||(t=[t]);const i=new URL("").href;try{let e=await fetch(i,{method:"POST",body:JSON.stringify({request_data:{docUUID:t}}),headers:new Headers({"Content-Type":"application/json"})});if("200"===String(e.status)){return await e.blob()}return new Error("Error getting file")}catch(e){return e}},xf=({moduleType:e,productType:t,metaDataType:i})=>async e=>{if("grid"===i)switch(e){case"bank":return Xp;case"itr":return sf;case"gst":return Zp;case"other":return ff;case"kyc":return cf;default:throw{error_msg:"Invalid docCategory"}}else if("upload"===i)switch(e){case"bank":return Yp;case"itr":return af;case"itrOther":return lf;case"gst":return ef;case"gstOther":return tf;case"other":return gf;case"kyc":return"management"===t?df:Af;default:throw{error_msg:"Invalid docCategory"}}else{if("edit"!==i)throw{error_msg:"Invalid MetaData Type requested"};switch(e){case"bank":return Jp;case"itr":return nf;case"itrOther":return of;case"gst":return $p;case"gstOther":return rf;case"other":return pf;case"kyc":return"management"===t?hf:uf;default:throw{error_msg:"Invalid docCategory"}}}},Ff=n({}),Nf=({children:t,uploadDocuments:i,deleteDocuments:r,updateDocument:n,verifyDocuments:s,getDocumentsGridData:a,getDocumentListingGridMetaData:o,getDocumentUploadAddtionalFieldsMetaData:l,getDocumentEditGridMetaData:h,generateDocumentDownloadURL:c,previewDocument:d,context:u})=>e(Ff.Provider,{value:{uploadDocuments:i,deleteDocuments:r,updateDocument:n,verifyDocuments:s,getDocumentsGridData:a,getDocumentListingGridMetaData:o,getDocumentUploadAddtionalFieldsMetaData:l,getDocumentEditGridMetaData:h,generateDocumentDownloadURL:c,previewDocument:d,context:u},children:t}),Sf=(e,t,i,r,n)=>({context:{moduleType:e,productType:t,docCategory:i,refID:r,serialNo:n},uploadDocuments:{fn:mf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},getDocumentsGridData:{fn:wf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},deleteDocuments:{fn:bf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},updateDocument:{fn:vf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},verifyDocuments:{fn:yf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},getDocumentListingGridMetaData:{fn:xf,args:{moduleType:e,productType:t,metaDataType:"grid"}},getDocumentUploadAddtionalFieldsMetaData:{fn:xf,args:{moduleType:e,productType:t,metaDataType:"upload"}},getDocumentEditGridMetaData:{fn:xf,args:{moduleType:e,productType:t,metaDataType:"edit"}},generateDocumentDownloadURL:{fn:Bf,args:{moduleType:e,productType:t}},previewDocument:{fn:Cf,args:{moduleType:e,productType:t}}}),Ef=d((({actions:t,setAction:r,transformData:n=e=>e,defaultSortOrder:a,defaultGroupBy:h},c)=>{const{addEntry:d}=s(oo),{getDocumentsGridData:u,getDocumentListingGridMetaData:f,context:g}=s(Ff),m=g.docCategory.filter((e=>!0===e.primary))[0].type,w=o(null);null===w.current&&(w.current=ho(Object.values(u.args))),l((()=>{d(["getDocumentListingGridMetaData",g.refID,m]),d(["getDocumentsGridData",w.current,m])}),[d,g,m]),A(c,(()=>({refetch:()=>b[0].refetch()})));const b=Kt([{queryKey:["getDocumentsGridData",w.current,m],queryFn:()=>u.fn(u.args)(m)},{queryKey:["getDocumentListingGridMetaData",g.refID,m],queryFn:()=>f.fn(f.args)(m)}]);return b[1].isLoading||b[1].isFetching?e(sd,{}):b[1].isError?e("span",{children:b[1]?.error?.error_msg??"Unknown Error occured"}):i(p,{children:[b[0].isError?e(ft,{severity:"error",children:b[0]?.error?.error_msg??"Unknown Error occured"}):null,e(Xd,{data:n(b[0].data??[]),finalMetaData:b[1].data,setData:()=>null,actions:t,setAction:r,loading:b[0].isFetching||b[0].isLoading,refetchData:()=>b[0].refetch(),defaultSortOrder:a,defaultGroupBy:h},"listingDocuments")]})}));Ef.displayName="MyGridWrapper";const Tf=({dataChangedRef:t,closeDialog:r,docUUID:n})=>{const{deleteDocuments:a,context:o}=s(Ff),l=o.docCategory.filter((e=>!0===e.primary))[0].type,{enqueueSnackbar:h}=ji(),c=Vt((e=>async({docType:t,docUUID:i})=>e(t,i))(a.fn(a.args)),{onError:e=>{},onSuccess:e=>{t.current=!0,h("Documents successful deleted",{variant:"success"}),r()}});return i(p,{children:[c.isError?e(ft,{severity:"error",children:c?.error?.error_msg??"Unknown Error occured"}):null,c.isLoading?e(gt,{variant:"indeterminate"}):null,e(ut,{id:"alert-dialog-title",children:"Are you sure you want to delete the selected Records"}),i(At,{children:[e(ct,{onClick:r,color:"primary",disabled:c.isLoading,children:"No"}),e(ct,{color:"primary",onClick:()=>c.mutate({docType:l,docUUID:n}),disabled:c.isLoading,children:"Yes"})]})]})},Lf=({dataChangedRef:t,closeDialog:r,docUUID:n})=>{const{verifyDocuments:a,context:o}=s(Ff),l=o.docCategory.filter((e=>!0===e.primary))[0].type,[h,d]=c(""),[u,A]=c(""),{enqueueSnackbar:f}=ji(),g=Vt((e=>async({docType:t,docUUID:i,remarks:r})=>e(t,i,r,"Verify"))(a.fn(a.args)),{onError:e=>{},onSuccess:e=>{t.current=!0,f("Documents Successfully verified",{variant:"success"}),r()}}),m=Vt((e=>async({docType:t,docUUID:i,remarks:r})=>e(t,i,r,"Rejected"))(a.fn(a.args)),{onError:e=>{},onSuccess:e=>{t.current=!0,f("Documents Successfully Rejected",{variant:"success"}),r()}}),w=m.isError||g.isError,b=m.isLoading||g.isLoading;let v=`${m?.error?.error_msg??""} ${g?.error?.error_msg??""}`;return v=Boolean(v.trimEnd().trimStart())?v:"unknown error occured",i(p,{children:[b?e(gt,{variant:"indeterminate"}):null,w?e(ft,{severity:"error",children:v}):null,e(ut,{id:"alert-dialog-title",children:"Document Verification"}),e(pt,{children:e(_t,{onChange:e=>d(e.target.value),multiline:!0,rows:4,maxRows:4,error:Boolean(u),helperText:u,fullWidth:!0,label:"Remarks",InputLabelProps:{shrink:!0}})}),i(At,{children:[e(ct,{onClick:r,color:"primary",children:"Cancel"}),e(ct,{color:"primary",onClick:()=>{Boolean(h)?g.mutate({docType:l,docUUID:n,remarks:h}):A("This is a required field")},disabled:b,children:"Verify"}),e(ct,{color:"primary",onClick:()=>{Boolean(h)?m.mutate({docType:l,docUUID:n,remarks:h}):A("This is a required filed")},disabled:b,children:"Reject"})]})]})},kf=({row:{data:r,id:n},closeDialog:a,dataChangedRef:h})=>{const[d,u]=c(Array.isArray(r)?r:[r]),{updateDocument:A,getDocumentEditGridMetaData:p,context:f}=s(Ff),g=f.docCategory.filter((e=>e.categoryCD===r.docCategory))[0].type,m=f.docCategory.filter((e=>!0===e.primary))[0].type,{addEntry:w}=s(oo),{enqueueSnackbar:b}=ji(),v=o(null);l((()=>{w(["getDocumentEditGridMetaData",f.moduleType,f.productType??"legal",g])}),[w,f,g]);const y=zt(["getDocumentEditGridMetaData",f.moduleType,f.productType??"legal",g],(()=>p.fn(p.args)(g))),B=Vt((e=>async({docType:t,data:i})=>e(t,i))(A.fn(A.args)),{onError:e=>{},onSuccess:e=>{h.current=!0,b("Document changes successful",{variant:"success"}),a()}});let C=`${y.error?.error_msg??"unknown message"}`;const x=y.isLoading?e(sd,{}):!0===y.isError?e("span",{children:C}):i(t,{children:[B.isError?e(ft,{severity:"error",children:B?.error?.error_msg??"Unknown Error occured"}):null,B.isLoading?e(gt,{variant:"indeterminate"}):null,e(ut,{id:"alert-dialog-title",children:"Update Documents"}),e(pt,{children:e(Xd,{data:d??[],finalMetaData:y.data,setData:u,gridProps:f,ref:v,loading:B.isLoading},"listingDocumentsForUpdate")}),i(At,{children:[e(ct,{onClick:a,color:"primary",disabled:B.isLoading,children:"Cancel"}),e(ct,{color:"primary",onClick:async()=>{let{hasError:e,data:t}=await(v?.current?.validate?.());if(!0===e)u(t);else{let e=v?.current?.cleanData?.();await B.mutate({docType:m,data:e})}},disabled:B.isLoading,children:"Update"})]})]});return x},Df=({onClose:t,editableFileName:i,dataChangedRef:r,currentAction:n})=>{const{uploadDocuments:a,getDocumentUploadAddtionalFieldsMetaData:o,context:h}=s(Ff),c=h.docCategory.filter((e=>e.type===n))[0],d=c.type,u=c.categoryCD,A=h.docCategory.filter((e=>!0===e.primary))[0].type,{addEntry:p}=s(oo),{enqueueSnackbar:f}=ji();l((()=>{p(["getDocumentUploadAddtionalFieldsMetaData",h.moduleType,h.productType,d])}),[h,p,d]);const g=zt(["getDocumentUploadAddtionalFieldsMetaData",h.moduleType,h.productType,d],(()=>o.fn(o.args)(d)));let m=`${g.error?.error_msg??"unknown error occured"}`;return g.isLoading?e(sd,{}):!0===g.isError?e("span",{children:m}):e(Eu,{onClose:()=>{!0===r.current&&f("Documents Successfully uploaded",{variant:"success"}),t()},additionalColumns:g.data,editableFileName:i,dataChangedRef:r,onUpload:a.fn({...a.args,docCategory:A,categoryCD:u}),gridProps:{...h,docCategory:d},maxAllowedSize:12328960,allowedExtensions:"partner"===h.productType||["kyc","other"].indexOf(d)>=0?["pdf","jpg","jpeg","png"]:["pdf"]})},If=(e,t)=>{const i=document.createElement("a");i.href=String(e),i.download=t;const r=()=>{setTimeout((()=>{URL.revokeObjectURL(String(e)),i.removeEventListener("click",r)}),150)};i.target="_blank",i.addEventListener("click",r,!1),i.click()},Uf=({docData:t,closeDialog:r,maxDownloadLimit:n=3})=>{const{generateDocumentDownloadURL:a,context:o}=s(Ff),h=o.docCategory.filter((e=>!0===e.primary))[0].type,[d,u]=c("");return l((()=>{if(t.length>Number(n))u(`Cannot download more than ${n} files at a time`);else{if(1===t.length){const e=a.fn(a.args)(h,t.map((e=>e.id)));If(e,t[0].name)}else if(t.length>1){const e=a.fn(a.args)(h,t.map((e=>e.id)));If(e,`download-${(new Date).getUTCMilliseconds()}`)}r()}}),[n,t,h,r,a]),Boolean(d)?i(p,{children:[e(ut,{children:d}),e(At,{children:e(ct,{onClick:()=>{u(""),r()},children:"Ok"})})]}):null},Pf=({fileType:t,fileName:i,docUUID:r,closeDialog:n})=>t.indexOf("pdf")>=0||t.indexOf("image")>=0?e(Of,{fileName:i,onClose:n,docUUID:r,fileType:t}):e(Rf,{onClose:n,fileName:i}),Of=({fileName:t,onClose:r,docUUID:n,fileType:s})=>{const{loading:a,blob:h,error:c,success:d}=Qf({docUUID:n,fileType:s}),u=o("");return d&&(u.current=URL.createObjectURL(h)),l((()=>{let e=u.current??"";return()=>{URL.revokeObjectURL(e)}}),[]),i(p,{children:[i(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:t}),e("div",{style:{flexGrow:1}}),d?e(C,{color:"primary",onClick:()=>du(h,t),children:e(yt,{})}):null,"function"==typeof r?e(C,{color:"primary",onClick:r,children:e(Bt,{})}):null]}),e(pt,{children:a?e(sd,{}):Boolean(c)?e("span",{children:c}):e("iframe",{src:`${u.current}`,title:"Document View",style:{height:"100%",width:"100%"},"aria-label":"File Preview"})})]})},Rf=({onClose:t,fileName:r,message:n})=>i(p,{children:[i(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:r}),e("div",{style:{flexGrow:1}}),"function"==typeof t?e(C,{color:"primary",onClick:t,children:e(Bt,{})}):null]}),e(pt,{children:n})]}),Qf=({docUUID:e,fileType:t})=>{const[i,r]=c(!0),[n,a]=c(!1),[o,h]=c(""),{previewDocument:d,context:u}=s(Ff),A=u.docCategory.filter((e=>!0===e.primary))[0].type,[p,f]=c(null);return l((()=>{d.fn(d.args)(A,e).then((e=>{if(e instanceof Error)h(e.message),r(!1),a(!1);else if("application/json"===e.type)e.text((e=>{h(e),r(!1),a(!1)}));else{const i=new Blob([e],{type:t});f(i),a(!0),h(""),r(!1)}})).catch((e=>{h(e.message),r(!0),a(!1)}))}),[h,r,a,f,e,t,d,A]),{success:n,loading:i,error:o,blob:p}},Hf=({closeDialog:e})=>(l((()=>{e()}),[e]),null),Mf=[{actionName:"Verify",actionLabel:"Verify",multiple:!0,shouldExclude:e=>{let t=!1;for(let i=0;i<e.length;i++)if("Pending"!==e[i].data?.status){t=!0;break}return t}},{actionName:"View",actionLabel:"View",multiple:!1,rowDoubleClick:!0},{actionName:"Download",actionLabel:"Download",multiple:!0},{actionName:"Delete",actionLabel:"Delete",multiple:!0},{actionName:"Update",actionLabel:"Update",multiple:!1}],_f=({disableActions:t})=>{const{context:r}=s(Ff),n=o(null);if(null===n.current){let e,i=r.docCategory.map((e=>({actionName:`Add_${e.type}`,actionLabel:e.label,multiple:void 0,alwaysAvailable:!0})));n.current=[...i,...Mf],e="string"==typeof t?[t]:Array.isArray(t)?t:[],Array.isArray(e)&&(n.current=n.current.filter((t=>!(e.indexOf("Add")>=0&&t.actionName?.indexOf("Add")>=0)&&!(e?.indexOf(t.actionName)>=0))))}const[a,d]=c(null),u=o(null),A=o(!1),f=h((()=>{d(null),!0===A.current&&(u.current?.refetch?.(),A.current=!1)}),[d]);l((()=>()=>{ao.removeQueries(["getBankListForLeadDocuments"],{exact:!1})}),[]);let g=a?.name??"";return i(p,{children:[e(Ef,{ref:u,actions:n.current,setAction:d},"documentListing"),e(dt,{open:Boolean(a),maxWidth:"xl",PaperProps:{style:g.indexOf("Add")>=0||"View"===g?{width:"100%",height:"100%"}:"Verify"===g?{width:"40%"}:{}},children:g.indexOf("Add")>=0?e(Df,{onClose:f,editableFileName:!1,dataChangedRef:A,currentAction:g.slice(g.indexOf("Add_")+4)}):"Update"===g?e(kf,{row:a?.rows[0],closeDialog:f,dataChangedRef:A}):"Delete"===g?e(Tf,{docUUID:a?.rows.map((e=>e.id)),closeDialog:f,dataChangedRef:A}):"Verify"===g?e(Lf,{docUUID:a?.rows.map((e=>e.id)),closeDialog:f,dataChangedRef:A}):"Download"===g?e(Uf,{closeDialog:f,docData:a?.rows.map((e=>({id:e.id,name:e.data?.fileName})))}):"View"===g?e(Pf,{closeDialog:f,docUUID:a?.rows[0]?.id,fileName:a?.rows[0]?.data?.fileName,fileType:a?.rows[0]?.data?.fileType}):e(Hf,{closeDialog:f})})]})},jf=Ci((e=>({tabPanel:{borderTop:"0",padding:`${e.spacing(2)},0`,backgroundColor:"#fff"}}))),zf=({value:e,index:t,children:i})=>Number(e)===Number(t)?i:null,Vf=({moduleType:t,productType:r,refID:n,serialNo:a,onClose:o,skipBankDetails:h=!1,readOnly:d})=>{const{addEntry:u}=s(oo),[A,f]=c(0),g=jf();l((()=>{u(["getDocumentCRUDTabsMetadata",t,r??"legal",n])}),[u,t,n]);const m=zt(["getDocumentCRUDTabsMetadata",t,r??"legal",n],(()=>(async({moduleType:e,productType:t,refID:i})=>Boolean(t)?Wp:Gp)({moduleType:t,productType:r,refID:n})));let w=m.data;m.isSuccess&&(Array.isArray(w)?(h&&(w=w.filter((e=>"Bank"!==e.label))),w=w.sort(((e,t)=>e.sequence>t.sequence?1:e.sequence<t.sequence?-1:0)),h&&(w=w.map(((e,t)=>({...e,sequence:t}))))):w=[]);return m.isLoading?e(sd,{}):m.isError?m.error?.error_msg??"unknown error occured":i(p,{children:[i("div",{style:{display:"flex"},children:[e(or,{value:A,onChange:(e,t)=>{f(t)},variant:"scrollable",children:w.map((t=>e(lr,{label:t.label,id:`${t.sequence}`},t.sequence)))}),"function"==typeof o?i(p,{children:[e("div",{style:{flexGrow:1}}),e(ct,{variant:"text",onClick:o,children:"Close"})]}):null]}),e("div",{className:g.tabPanel,children:w.map((i=>e(zf,{value:A,index:`${i.sequence}`,children:e(Nf,{...Sf(t,r,i.docType,n,a),children:e(_f,{disableActions:d?["Add","Verify","Delete","Update"]:[]})},i.docType.filter((e=>!0===e?.primary))[0].type)},i.sequence)))})]})},Kf=({isDataChangedRef:r,successAction:n,readOnly:a,closeDialog:c,formStyle:d})=>{const{addEntry:u}=s(oo),{checkFormDataExist:A}=s(_p),{insertFormData:p}=s(_p),f=o(null);null===f.current&&(f.current=ho(Object.values(p.args)));let g=zt(["checkFormDataExist",f.current],(()=>A.fn(A.args)()));l((()=>{u(["checkFormDataExist",f.current])}),[u]);const m=g.isFetching||g.isLoading,w=g.isError,b="YES"===g.data?.exists||(g.data,!1),v=h((()=>{"function"==typeof n&&(n(),g.refetch())}),[]);return l((()=>{b&&"function"==typeof n&&v()}),[b,v]),m?i(t,{children:[e(sd,{}),"function"==typeof c?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:c,children:e(ar,{})})}):null]}):w?i(t,{children:[i("div",{children:[g?.error?.error_msg??"Unknown error occured"," "]}),"function"==typeof c?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:c,children:e(ar,{})})}):null]}):b?null:e(qf,{successAction:v,isDataChangedRef:r,readOnly:a,closeDialog:c,formStyle:d})},qf=({successAction:t,isDataChangedRef:i,readOnly:r,closeDialog:n,formStyle:s})=>{const a=h((()=>{"function"==typeof n&&n()}),[]);return r?e(ft,{severity:"info",children:"No Details Found"}):e(zp,{isDataChangedRef:i,cancelAction:a,successAction:t,formStyle:s})},Gf=({isDataChangedRef:t,closeDialog:i,dataAlwaysExists:r,readOnly:n,disableCache:s,formStyle:a})=>{const[o,l]=c(Boolean(r));return o?e(Vp,{isDataChangedRef:t,closeDialog:i,readOnly:n,disableCache:s,formStyle:a}):e(Kf,{isDataChangedRef:t,successAction:()=>l(!0),readOnly:n,closeDialog:i,formStyle:a})},Wf=Ci({topScrollPaper:{alignItems:"flex-start"},topPaperScrollBody:{verticalAlign:"top"}}),Jf=[{actionName:"View",actionLabel:"View Details",multiple:!1,rowDoubleClick:!0},{actionName:"Delete",actionLabel:"Delete",multiple:!0,rowDoubleClick:!1},{actionName:"Add",actionLabel:"Add Detail",multiple:void 0,alwaysAvailable:!0}],Xf=({isDataChangedRef:t,showDocuments:r,disableActions:n,setEditFormStateFromInitValues:a,secondaryProduct:l,secondaryProductDataExist:h,secondaryProductDisableCache:d,maxWidth:u="xl",dialogAlignTop:A=!1,formStyle:f,readOnly:g,detailsContextGenerator:m})=>{let w=o(null);if(null===w.current){let e;w.current=[...Jf],Boolean(r)&&w.current.push({actionName:"Document",actionLabel:"Document Details",multiple:!1,rowDoubleClick:!1}),Boolean(l)&&w.current.push({actionName:"Detail",actionLabel:"Master",multiple:void 0,alwaysAvailable:!0}),e="string"==typeof n?[n]:Array.isArray(n)?n:[],Array.isArray(e)&&(w.current=w.current.filter((t=>!(e?.indexOf(t.actionName)>=0))))}const[b,v]=c(null),y=o(null),B=o(!1),{context:C}=s(_p),x=()=>{v(null),!0===B.current&&(t.current=!0,y.current?.refetch?.(),B.current=!1)},F=Wf(),N={scrollPaper:F.topScrollPaper,paperScrollBody:F.topPaperScrollBody};return i(p,{children:[e(qp,{ref:y,actions:w.current,setAction:v},"grid"),e(dt,{open:Boolean(b),maxWidth:u,PaperProps:"Delete"===b?.name?{}:{style:{width:"100%",height:A?void 0:"100%"}},classes:A?N:{},children:"Add"===(b?.name??"")?e(zp,{successAction:x,cancelAction:x,isDataChangedRef:B,formStyle:f}):"View"===(b?.name??"")?e(Vp,{isDataChangedRef:B,closeDialog:x,serialNo:b?.rows[0]?.id,setEditFormStateFromInitValues:a,formStyle:f,readOnly:g}):"Delete"===(b?.name??"")?e(Kp,{serialNo:b?.rows.map((e=>e.id)),closeDialog:x,isDataChangedRef:B}):"Document"===(b?.name??"")?e(Vf,{refID:C?.refID,productType:C?.productType,moduleType:C?.moduleType,serialNo:b?.rows[0]?.id,onClose:x}):"Detail"===(b?.name??"")?e(jp,{...m(C?.moduleType,l,C?.refID),children:e(Gf,{isDataChangedRef:B,dataAlwaysExists:h,closeDialog:x,readOnly:g,disableCache:d})}):e(Hf,{closeDialog:x})})]})},Yf=n({}),$f=({children:t,getGridMetaData:i,getGridData:r})=>e(Yf.Provider,{value:{getGridMetaData:i,getGridData:r},children:t}),Zf=(e,t,i)=>({getGridData:{fn:t,args:{reqPara:i}},getGridMetaData:{fn:e,args:{reqPara:i}}}),eg=d((({dataGridKey:t,getAPIReqPara:i,actions:r,setAction:n,defaultSortOrder:a,defaultFilter:o,dataTransformer:c,autoRefreshInterval:d,enableExport:u,reportTemplateCode:A,variant:p,autoFetch:f,headerToolbarStyle:g,enableEnterToFocus:m,focusScopeId:w},b)=>{const{getGridData:v,getGridMetaData:y}=s(Yf),B=h(v.fn(v.args),[i]);return l((()=>()=>{ao.removeQueries(["gridMetaData",i])}),[i]),e(pA,{ref:b,metaData:y.fn,gridCode:i,getGridData:B,actions:r,setAction:n,defaultSortOrder:a,defaultFilter:o,dataTransformer:c,autoRefreshInterval:d,enableExport:u,reportTemplateCode:A,variant:p,autoFetch:f,headerToolbarStyle:g,enableEnterToFocus:m,focusScopeId:w},t)})),tg=d((({dataGridKey:t,metaData:i,getAPIFn:r=()=>{},getAPIReqPara:n,actions:s,setAction:a,defaultFilter:o,defaultSortOrder:l,dataTransformer:h,autoRefreshInterval:c,enableExport:d=!1,reportTemplateCode:u,variant:A,autoFetch:p,headerToolbarStyle:f={},enableEnterToFocus:g,focusScopeId:m="enter-to-focus-server-grid"},w)=>e($f,{...Zf(i,r,n),children:e(eg,{dataGridKey:t,getAPIReqPara:n,actions:s,setAction:a,defaultFilter:o,defaultSortOrder:l,dataTransformer:h,ref:w,autoRefreshInterval:c,enableExport:d,reportTemplateCode:u,variant:A,autoFetch:p,headerToolbarStyle:f,enableEnterToFocus:g,focusScopeId:m})}))),ig=Ci((e=>({tabPanel:{border:"1px solid #e8e8e8",borderTop:"0",backgroundColor:"#fff",boxShadow:"0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12)"}}))),rg=xi((e=>({root:{textTransform:"none",minWidth:72,marginRight:e.spacing(4),opacity:1,color:e.palette.secondary.main,fontWeight:600,fontFamily:["Montserrat","Helvetica","Arial","Lucida","sans-serif"].join(","),"&:hover":{color:"#0063a3",opacity:1},"&$selected":{color:"#fff",fontWeight:"600",background:"var(--theme-color1)","&:active":{color:"#fff"}},"&:active":{color:"var(--theme-color1)"},"&:focus:not(:selected)":{color:"var(--theme-color1)"}},selected:{}})))(lr),ng=xi((e=>({root:{border:"2px solid #e8e8e8",background:"#fff",boxShadow:"0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12)"},indicator:{background:"var(--theme-color1)",top:0}})))(or),sg=n(null),ag=()=>{const e=s(sg);if(!e)throw new Error("useSnackbarProviderWrapper must be used within a SnackbarProviderWrapper");return e.snackbarProps},og=({children:t,...i})=>{const r=a((()=>({snackbarProps:i})),[i]);return e(sg.Provider,{value:r,children:e(zi,{...i,children:t})})},lg=Ci({topScrollPaper:{alignItems:"center"},topPaperScrollBody:{verticalAlign:"top"},title:{flex:"1 1 100%",color:"var(--white)",letterSpacing:"1px",fontSize:"1.5rem"}}),hg=({metadata:t,ClosedEventCall:r,data:n,HeaderMetaData:s,HeaderData:l,ClickEventManage:h,children:d,isLoading:u=!1,isError:A=!1,ErrorMessage:p="",actions:f=[],setData:g=e=>{},setCurrentAction:m=e=>{},mode:w="view",isEditableForm:b=!1,refID:v={},onSubmit:y=()=>{},submitSecondAction:B=()=>{},submitSecondButtonName:C="",submitSecondButtonHide:x=!0,submitSecondLoading:F=!1,onFieldAction:N=(e,t,i)=>{},formComponentPropStyles:S={},dialogProps:E={},enableEnterToFocus:T,focusScopeId:L="enter-to-focus-detailsGrid"})=>{const{enableEnterToFocus:k}=Ws(),D=lg(),I=o(null),{t:U}=ne(),[P,O]=c(""),R=()=>{r()},Q=a((()=>{let e=t.columns;return"view"===w&&(e=t.columns.filter((e=>"_hidden"!==e.accessor))),{...t,columns:e}}),[w,t]);return e(dt,{open:!0,TransitionComponent:th,PaperProps:{style:{width:"100%",minHeight:"20vh"}},maxWidth:"lg",classes:{scrollPaper:D.topScrollPaper,paperScrollBody:D.topPaperScrollBody},...E,children:i("div",{style:{padding:"10px"},children:[A?e(Va,{severity:"error",errorMsg:p,errorDetail:"",color:"error"}):Boolean(P)?e(Va,{errorMsg:P,errorDetail:"",severity:"error"}):null,Boolean(d)?"function"==typeof d?d({handelCloseEvent:R,handleSubmit:async()=>{let{hasError:e,data:t}=await(I.current?.validate());if(!0===e)g(t);else{let e=I?.current?.cleanData?.(),t=e.filter((e=>!(Boolean(e?._hidden)&&!Boolean(e?.lineNo)))),i={...v,config:t};y({data:i,mode:w,setServerError:O})}},classes:D}):d:e(sr,{position:"relative",color:"secondary",style:{marginBottom:"10px"},children:i(si,{variant:"dense",children:[e(vt,{className:D.title,color:"inherit",variant:"h6",component:"div",children:U(s?.gridConfig?.title??"")}),e(ct,{onClick:R,color:"primary",children:U("Close")})]})}),e(Op,{finalMetaData:s,onAction:h,loading:u,data:l??{},submitSecondAction:B,submitSecondButtonName:C,submitSecondButtonHide:x,submitSecondLoading:F,onFieldAction:N,propStyles:S,enableEnterToFocus:T??k,focusScopeId:L},"DetailsHeadersView"),e(Xd,{finalMetaData:Q,data:n,setData:g,loading:b?"view"===w:u,actions:f,setAction:async e=>{await m(e)},refetchData:null,enableEnterToFocus:T??k,focusScopeId:L,ref:I},"customerDetailsGrid")]})})},cg=t=>{const{row:i}=t;let r=`${Number(i.index)+1}`;return e(fc,{...t,children:r})},dg=t=>e("div",{children:"#"}),ug=e=>t=>{e&&t.visibleColumns.push((e=>[{id:"sequence",Header:dg,Cell:cg,width:5,maxWidth:5,minWidth:5},...e]))},Ag=({globalFilter:t,setGlobalFilter:i,rowCount:r})=>{const[,n]=c(t),{t:s}=ne(),a=qt((e=>i(e||void 0)),200);return e(wl,{type:"text",onChange:e=>{n(e.target.value),a(e.target.value)},placeholder:`${s("profile.Searchin")} ${r} ${s("records")}`})},pg=Ci((e=>({root:{display:"flex",justifyContent:"left",flexWrap:"wrap",listStyle:"none",paddingLeft:e.spacing(2),paddingRight:e.spacing(2),margin:0,overflowX:"auto"},chip:{margin:e.spacing(.5)}}))),fg=({dense:r,filters:n,setAllFilters:s})=>{const a=pg(),{t:o}=ne();return Array.isArray(n)&&n.length<=0?null:i(si,{component:"ul",className:a.root,variant:r?"dense":"regular",children:[e("li",{children:i(vt,{variant:"h6",children:[o("RetrievalParameters")," : "]})}),n.map((i=>e(t,{children:Boolean(i?.value?.value)?e("li",{children:e(mi,{label:gg(i?.value?.condition,o(i?.value?.columnName),i?.value?.value,o(i?.value?.label),i?.value?.displayValue),className:a.chip,variant:"outlined"})},i?.id):null})))]})},gg=(e,t,i,r,n)=>{let s=Boolean(r)?r:t;switch(e){case"equal":return`${s} = ${mg(n??i)}`;case"between":return`${s} between ${mg(i[0])} and ${mg(i[1])}`;case"in":return`${s} in ${wg(i,r)}`;case"contains":return`${s} like ${i}`;case"endsWith":return`${s} ends with ${i}`;case"startsWith":return`${s} starts with ${i}`;default:return`${s} : ${i}`}},mg=e=>{let t;return ca(e)&&(t=z(new Date(e),"dd/MM/yyyy")),isNaN(t)?e:t},wg=(e,t)=>Array.isArray(t)&&Array.isArray(e)&&e.length===t.length?JSON.stringify(t).replaceAll(/"/g," "):JSON.stringify(e).replaceAll(/"/g," "),bg=({setQueryFilters:r,filterMeta:n,filterData:s,retrievalType:a,isOpenRetrievalDefault:h,setShowFilters:d=e=>{},setAllFilters:A=e=>{},retrievalComponent:p})=>{const[f,g]=c(h),m=o(s),{t:w}=ne();l((()=>{document.addEventListener("keydown",(e=>{!e.ctrlKey||"R"!==e.key&&"r"!==e.key||(e.preventDefault(),g(!0))}))}),[]);return e(Ri,{dateAdapter:Qi,children:i(t,{children:[Boolean(a)&&"function"==typeof p?e(t,{children:"CUSTOM"===a&&n?.fields?.length>0||"CUSTOM"!==a?e(ct,{onClick:()=>{g(!0),d(!1),A([])},color:"primary",children:w("RetrieveData")}):null}):e(t,{}),f&&a&&p&&"function"==typeof p?u(p,{classes:{},open:f,handleClose:()=>{g(!1)},loginState:{},defaultData:m.current,retrievalParaValues:(e,t)=>{r(e),g(!1),t&&(m.current=t)},retrievalType:a,metaData:n}):null]})})},vg=(e=[],t={})=>{switch(t.type){case"setValue":{const{id:i,...r}=t.payload;let n=e.findIndex((e=>e.id===i));return n>=0?(e[n].value=r,[...e]):[...e,{id:i,value:r}]}case"removeValue":{const{id:i}=t.payload;return e.filter((e=>e.id!=i))}case"resetAll":return[];default:return e}},yg=({setQueryFilters:t,filterMeta:r,filterData:n,retrievalWindowOpen:s=!1})=>{const{t:a}=ne(),[l,d]=c(s),{filterState:A,dispatch:p}=(e=>{const t=o([]);return{dispatch:h((i=>{let r=e(t.current,i);t.current=r}),[]),filterState:t}})(vg),f=()=>{d(!1)};let g=[];return Array.isArray(r)&&(g=r.filter((e=>"function"==typeof e.Filter)),g=g.map((e=>{const{Filter:t,accessor:i,...r}=e;return u(t,{key:i,filterValue:n.filter((e=>e.id===i))?.[0]?.value,id:i,dispatch:p,...r})}))),i(Ri,{dateAdapter:Qi,children:[e(ae,{onClick:()=>{d(!0)},color:"primary",children:"Retrieve Data"}),i(ke,{anchor:"right",id:"columnVisibility",open:l,onClose:f,PaperProps:{style:{width:"520px"}},children:[e(De,{position:"relative",color:"secondary",children:i(Ie,{variant:"dense",children:[e(fe,{variant:"h6",children:a("Filter")}),e("div",{style:{flexGrow:1}}),e(ae,{onClick:()=>{t(A.current),d(!1)},color:"primary",children:a("Apply")}),e(ae,{onClick:()=>{t([]),d(!1)},color:"primary",children:a("Clear")}),e(ae,{onClick:f,color:"primary",children:a("Close")})]})}),e(Ne,{children:e(Se,{container:!0,spacing:2,children:g})})]})]})},Bg=({dateRange:t,setDateRange:r,columnFormat:n="dd/MM/yyyy HH:mm:ss",setIsError:s,isDate:a})=>{let o=a?Eo:Lo;const[l,h]=c({from:"",to:""}),d=(e,t)=>{let i=!1;const r={from:"",to:""};return e instanceof Date&&!isNaN(e?.getTime())||(r.from=G("Mustbeavaliddate"),i=!0),t instanceof Date&&!isNaN(t?.getTime())||(r.to=G("Mustbeavaliddate"),i=!0),e instanceof Date&&t instanceof Date&&e>t&&(r.from=G("FromDateshouldbelessthanorequaltoToDate"),r.to=G("ToDateshouldbegreaterthanorequaltoFromDate"),i=!0),h(r),s(i),!i};return i(Ue,{spacing:1,children:[e(o,{format:n,value:t.from??new Date,label:G("From")??"From",views:a?["year","month","day"]:["year","month","day","hours","minutes","seconds"],onChange:e=>{const i=e instanceof Date&&!isNaN(e?.getTime())?e:null,n={...t,from:i};d(i,t.to)&&r(n)},slots:{textField:to},slotProps:{textField:{error:!!l.from,helperText:l.from},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%",mb:1}}),e(o,{format:n,label:G("To")??"To",value:t.to??new Date,views:a?["year","month","day"]:["year","month","day","hours","minutes","seconds"],onChange:e=>{const i=e instanceof Date&&!isNaN(e?.getTime())?e:null,n={...t,to:i};d(t.from,i)&&r(n)},slots:{textField:to},slotProps:{textField:{error:!!l.to,helperText:l.to},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%"}})]})},Cg=({dateValue:t,setDateValue:i,columnFormat:r="dd/MM/yyyy HH:mm:ss",setIsError:n,isDate:s})=>{const[a,o]=c("");return e(s?Eo:Lo,{format:r??"dd/MM/yyyy HH:mm:ss",value:t??new Date,views:s?["year","month","day"]:["year","month","day","hours","minutes","seconds"],onChange:e=>{if(!V(e))return o(G("Mustbeavaliddate")??""),void n(!0);o(""),n(!1),i(e instanceof Date?e:new Date)},slots:{textField:to},slotProps:{textField:{error:Boolean(a),helperText:a,sx:{"& .MuiInputBase-root":{margin:"0 !important"}}},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%",mb:1}})},xg=(e,t)=>z(new Date(e),t??"dd/MM/yyyy HH:mm:ss"),Fg=e=>e instanceof Date&&!isNaN(e.getTime())?new Date(e.getFullYear(),e.getMonth(),e.getDate()):null,Ng=(e,t,i)=>{const{type:r,value:n}=i;return null==n||""===n||Array.isArray(n)&&0===n.length?e:e.filter((i=>{const s=""===i.values[t]?.trim()&&"multi-select"===r?"(Blanks)":i.values[t];if("multi-select"===r)return n.includes(s);if("Before"===r||"After"===r||"Equal (Date)"===r||"Equal (Date & Time)"===r||"Between (Date)"===r||"Between (Date & Time)"===r||"Today"===r||"Yesterday"===r||"This Week"===r||"Last Week"===r||"This Month"===r||"Last Month"===r){const e=new Date(s),t=Array.isArray(n)?[new Date(n[0]),new Date(n[1])]:new Date(n);if(isNaN(e.getTime())||(Array.isArray(t)?t.some((e=>isNaN(e.getTime()))):isNaN(t.getTime())))return!1;switch(r){case"Before":return e<t;case"After":return e>t;case"Equal (Date)":return!Array.isArray(t)&&Fg(e)?.toLocaleString()===Fg(t)?.toLocaleString();case"Equal (Date & Time)":return!Array.isArray(t)&&e.toLocaleString()===t.toLocaleString();case"Between (Date)":const[i,r]=Array.isArray(t)?t:[];return!(!i||!r)&&(Fg(e)>=Fg(i)&&Fg(e)<=Fg(r));case"Between (Date & Time)":const[n,s]=Array.isArray(t)?t:[];return!(!n||!s)&&(e>=n&&e<=s);case"Today":{const t=new Date;return Fg(e)?.getTime()===Fg(t)?.getTime()}case"Yesterday":{const t=new Date;return t.setDate(t.getDate()-1),Fg(e)?.getTime()===Fg(t)?.getTime()}case"This Week":{const t=new Date,i=Fg(new Date(t.setDate(t.getDate()-t.getDay()))),r=new Date(i);r.setDate(i.getDate()+6);const n=Fg(e);return!!n&&n>=i&&n<=Fg(r)}case"Last Week":{const t=new Date,i=Fg(new Date(t.setDate(t.getDate()-t.getDay()-7))),r=new Date(i);r.setDate(i.getDate()+6);const n=Fg(e);return!!n&&n>=i&&n<=Fg(r)}case"This Month":{const t=new Date,i=Fg(new Date(t.getFullYear(),t.getMonth(),1)),r=Fg(new Date(t.getFullYear(),t.getMonth()+1,0)),n=Fg(e);return!!n&&n>=i&&n<=r}case"Last Month":{const t=new Date,i=Fg(new Date(t.getFullYear(),t.getMonth()-1,1)),r=Fg(new Date(t.getFullYear(),t.getMonth(),0)),n=Fg(e);return!!n&&n>=i&&n<=r}default:return!0}}const a=s?.toString().toLowerCase(),o=n?.toString().toLowerCase();switch(r){case"Contains":return a.includes(o);case"Starts With":return a.startsWith(o);case"Ends With":return a.endsWith(o);case"Equal":return a===o;case"Not Equal":return a!==o;case"Empty":return""===a;case"Not Empty":return""!==a;case"Greater Than":return parseFloat(s)>parseFloat(n);case"Less Than":return parseFloat(s)<parseFloat(n);case"Greater Than or Equal To":return parseFloat(s)>=parseFloat(n);case"Less Than or Equal To":return parseFloat(s)<=parseFloat(n);case"Does not contain":return!a.includes(o);case"Between":const i=o.split(",")?.map((e=>parseFloat(e))),r=parseFloat(s);return r>=i[0]&&r<=i[1];case"Above Average":const l=e.reduce(((e,i)=>e+parseFloat(i.values[t])),0)/e.length;return parseFloat(s)>l;case"Below Average":const h=e.reduce(((e,i)=>e+parseFloat(i.values[t])),0)/e.length;return parseFloat(s)<h;default:return!0}}))},Sg=({amtRange:t,setAmtRange:r,setIsError:n})=>{const{dynamicAmountSymbol:s,decimalCount:a,dynamicAmountGroupStyle:o}=Ws(),[l,h]=c({from:"",to:""}),d=(e,t)=>{let i=!1;const r={from:"",to:""},s=parseFloat(e),a=parseFloat(t);isNaN(s)||isNaN(a)||s>a&&(r.from="'From' value must be less than 'To' value",r.to="'To' value must be greater than 'From' value",i=!0),h(r),n(i)};return i(Ue,{spacing:1.5,children:[i("div",{children:[e(ul,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:o,allowNegative:!0,allowLeadingZeros:!1,decimalScale:a,fixedDecimalScale:!0,placeholder:"From amount",isAllowed:e=>e?.value?.length<=15,value:t.from,onValueChange:e=>{if(!isNaN(Number(e.value))){const t=e.value;r((e=>{const i={...e,from:t};return d(t,e.to),i}))}}},enableGrid:!1,fieldKey:"FromAmount",name:"from-amount",StartAdornment:sl(s),className:"textInputFromRight",maxLength:15,showMaxLength:!1,textFieldStyle:{width:"100%","& .MuiInputBase-root":{margin:"0 !important"}}}),l.from?e(we,{error:!0,sx:{mt:0},children:l.from}):null]}),i("div",{children:[e(ul,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:o,allowNegative:!0,allowLeadingZeros:!1,decimalScale:a,fixedDecimalScale:!0,placeholder:"To amount",isAllowed:e=>e?.value?.length<=15,value:t.to,onValueChange:e=>{if(!isNaN(Number(e.value))){const t=e.value;r((e=>{const i={...e,to:t};return d(e.from,t),i}))}}},enableGrid:!1,fieldKey:"ToAmount",name:"to-amount",StartAdornment:sl(s),className:"textInputFromRight",maxLength:15,showMaxLength:!1,textFieldStyle:{width:"100%",".MuiInputBase-root":{margin:"0 !important"}}}),l.to?e(we,{error:!0,sx:{mt:0},children:l.to}):null]})]})},Eg=({inputValue:t,setInputValue:i})=>{const{dynamicAmountSymbol:r,decimalCount:n,dynamicAmountGroupStyle:s}=Ws();return e(ul,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:s,allowNegative:!0,allowLeadingZeros:!1,decimalScale:n,fixedDecimalScale:!0,placeholder:"Enter a value",isAllowed:e=>!(e?.value?.length>15),value:t,onValueChange:e=>{isNaN(Number(e.value))||i(String(e.value))}},enableGrid:!1,fieldKey:"Amount",name:"amount",StartAdornment:sl(r),className:"textInputFromRight",maxLength:15,showMaxLength:!1,textFieldStyle:{width:"100%",".MuiInputBase-root":{margin:"0 !important"}}})},Tg={text:["Contains","Starts With","Ends With","Equal","Not Equal","Does not contain"],number:["Equal","Greater Than","Greater Than or Equal To","Less Than","Less Than or Equal To","Not Equal","Between","Above Average","Below Average"],date:["Equal (Date)","Equal (Date & Time)","Before","After","Between (Date)","Between (Date & Time)","Yesterday","Today","This Week","Last Week","This Month","Last Month"],dropdown:["Equal","Not Equal"]},Lg=({column:r,filters:n,enableEnterToFocus:s})=>{const{id:d,columnName:u,columnFormat:A,filterType:p,Cell:f,options:g,filterValue:m,setFilter:w,preFilteredRows:b,alignment:v}=r,[y,B]=c(null),[C,x]=c(0),[F,N]=c((()=>(Tg[p||"text"]||[])[0])),[S,E]=c(!1),[T,L]=c(""),[k,D]=c(new Date),[I,U]=c({from:new Date,to:new Date}),[P,O]=c({from:"",to:""}),[R,Q]=c(""),[H,M]=c([]),_=o({dateValue:k,dateRange:I,amtRange:P,inputValue:T,selectedOption:F,selectedValues:H,search:R}),j=Boolean(y),z=f===gc||f===mc?"date":f===kc?"number":p||"text",V=Tg[z]||[],K=()=>{S&&(O({from:"",to:""}),E(!1)),B(null),M(_.current.selectedValues),D(_.current.dateValue),U(_.current.dateRange),O(_.current.amtRange),L(_.current.inputValue),N(_.current.selectedOption),Q(_.current.search)},q=a((()=>{const e=new Set;b?.forEach((t=>{e.add(""===t.values[d]?.trim()?"(Blanks)":t.values[d])}));const t=Array.from(e).filter((e=>e?.toString().toLowerCase().includes(R.toLowerCase())));return t.includes("(Blanks)")?[...t.filter((e=>"(Blanks)"!==e)),"(Blanks)"]:t}),[b,d,R]),W=a((()=>{const e={};return b?.forEach((t=>{const i=""===t.values[d]?.trim()?"(Blanks)":t.values[d],r=String(i??"");e[r]=(e[r]||0)+1})),e}),[b,d]);l((()=>{const e=(Tg[z]||[])[0];N(e)}),[z]),l((()=>{n.length||(_.current={dateValue:new Date,dateRange:{from:new Date,to:new Date},amtRange:{from:"",to:""},inputValue:"",selectedOption:(Tg[z]||[])[0],selectedValues:[],search:""},M([]),L(""),D(new Date),U({from:new Date,to:new Date}),O({from:"",to:""}),Q(""),N((Tg[z]||[])[0]))}),[n,z]);const J=h((()=>{if(!m)return"";if("multi-select"===m.type&&"date"===z&&Array.isArray(m.value)){const e=m.value.map((e=>xg(e,A)));return`${G("Filtered")}: ${e.join(", ")}`}return"multi-select"===m.type&&Array.isArray(m.value)?`${G("Filtered")}: ${m.value.join(", ")}`:"date"===z&&Array.isArray(m.value)?`${m.type}: ${xg(m.value[0],m.type.includes("Time")?A:A?.split(" ")[0]??"dd/MM/yyyy")} - ${xg(m.value[1],m.type.includes("Time")?A:A?.split(" ")[0]??"dd/MM/yyyy")}`:"date"===z&&m.value instanceof Date?`${m.type}: ${xg(m.value,m.type.includes("Time")?A:A?.split(" ")[0]??"dd/MM/yyyy")}`:"number"===z&&F.includes("Average")?m.type:`${m.type}: ${m.value}`}),[m,z,F,A]);return f===Ec?null:i(t,{children:[e(Be,{size:"small",onClick:e=>{m||"date"!==z||(D(new Date),U({from:new Date,to:new Date}),O({from:"",to:""})),B(e.currentTarget)},sx:{...r.canGroupBy?{}:{ml:"right"!==v?"auto":0,mr:"right"===v?"auto":0}},children:e(pe,m?{disableInteractive:!0,title:m?e(me,{sx:{p:.5},children:e(fe,{variant:"caption",sx:{fontWeight:600,color:"var(--theme-color1)",fontSize:"0.75rem"},children:J()})}):"",arrow:!0,disableHoverListener:!m,componentsProps:{tooltip:{sx:{backgroundColor:"var(--theme-color2)",color:"var(--theme-color1)",fontSize:"0.75rem",borderRadius:1.5,boxShadow:4,maxWidth:240,whiteSpace:"normal"}},arrow:{sx:{color:"var(--theme-color2)"}}},children:e(Ar,{fontSize:"small",style:{color:"var(--theme-color1)"}})}:{title:G("AdvanceFilter"),disableInteractive:!0,children:e(ur,{fontSize:"small"})})}),e(Pe,{open:j,anchorEl:y,onClose:K,onKeyDown:e=>{s&&ma(e)},children:i(me,{p:2,width:300,children:[e(fe,{variant:"subtitle2",mb:1,children:u}),i(ng,{value:C,onChange:(e,t)=>x(t),variant:"fullWidth",TabIndicatorProps:{style:{display:"none"}},sx:{border:"none !important",boxShadow:"none !important",backgroundColor:"transparent !important",minHeight:0,"& .MuiTabs-flexContainer":{gap:1},"& .MuiTab-root":{minHeight:30,padding:"4px 12px",borderRadius:"20px",fontSize:"0.75rem",fontWeight:600}},children:[e(rg,{label:G("FilterByValue"),style:{padding:0,margin:0,borderRadius:"10px"}}),e(rg,{label:G("FilterByCondition"),style:{padding:0,margin:0,borderRadius:"10px"}})]}),0===C&&i(Ue,{spacing:1,mt:2,children:[e(to,{size:"small",placeholder:G("Search")??"Search...",value:R,onChange:e=>Q(e.target.value),fullWidth:!0,InputProps:{sx:{marginTop:"0px !important"}}}),e(me,{sx:{maxHeight:200,overflowY:"auto",border:"1px solid #ccc",p:1,borderRadius:1},children:e(kg,{uniqueValues:q,selectedValues:H,setSelectedValues:M,valueCounts:W,Cell:f,column:r,type:z})})]}),1===C&&i(Ue,{spacing:2,mt:2,children:[e(Oe,{value:F,onChange:e=>N(e.target.value),size:"small",fullWidth:!0,children:V.map((t=>e(Re,{value:t,children:t},t)))}),"date"===z?e(tr,{dateAdapter:Qi,children:"Between (Date)"===F||"Between (Date & Time)"===F?e(Bg,{dateRange:I,setDateRange:U,columnFormat:"Between (Date)"===F?A?.split(" ")[0]??"dd/MM/yyyy":A,setIsError:E,isDate:"Between (Date)"===F}):["Equal (Date)","Equal (Date & Time)","Before","After"].includes(F)?e(Cg,{dateValue:k,setDateValue:D,columnFormat:"Equal (Date)"===F?A?.split(" ")[0]??"dd/MM/yyyy":A,setIsError:E,isDate:"Equal (Date)"===F}):null}):"dropdown"===z&&g?.length?e(Oe,{value:T,onChange:e=>L(e.target.value),size:"small",fullWidth:!0,children:g.map((t=>e(Re,{value:t,children:t},t)))}):e(t,{children:"number"===z?e(t,{children:"Between"===F?e(Sg,{amtRange:P,setAmtRange:O,setIsError:E}):e(t,{children:F.includes("Average")?null:e(Eg,{inputValue:T,setInputValue:L})})}):e(to,{size:"small",placeholder:"Enter value",value:T,type:"number"===z?"number":"text",onChange:e=>L(e.target.value),fullWidth:!0,InputProps:{sx:{marginTop:"0px !important"}}})})]}),i(Ue,{direction:"row",spacing:1,justifyContent:"flex-end",mt:2,children:[e(za,{variant:"contained",size:"small",onClick:()=>{_.current={dateValue:new Date,dateRange:{from:new Date,to:new Date},amtRange:{from:"",to:""},inputValue:"",selectedOption:(Tg[z]||[])[0],selectedValues:[],search:""},M([]),L(""),D(new Date),U({from:new Date,to:new Date}),O({from:"",to:""}),w(void 0),K()},children:G("Clear")}),e(za,{variant:"contained",size:"small",onClick:()=>{if(_.current={dateValue:k,dateRange:I,amtRange:P,inputValue:T,selectedOption:F,selectedValues:H,search:R},0===C)Array.isArray(H)&&H?.length>0&&w({type:"multi-select",value:H});else if(!S){let e;if("date"===z?"Between (Date)"===F||"Between (Date & Time)"===F?e=[I.from,I.to]:e=["Yesterday","Today","This Week","Last Week","This Month","Last Month"].includes(F)?(e=>{const t=new Date,i=new Date(t);i.setDate(t.getDate()-t.getDay());const r=new Date(i);r.setDate(i.getDate()+6);const n=new Date(i);n.setDate(n.getDate()-7);const s=new Date(n);s.setDate(n.getDate()+6);const a=new Date(t.getFullYear(),t.getMonth(),1),o=new Date(t.getFullYear(),t.getMonth()+1,0),l=new Date(t.getFullYear(),t.getMonth()-1,1),h=new Date(t.getFullYear(),t.getMonth(),0);switch(e){case"Yesterday":const e=new Date;return e.setDate(t.getDate()-1),e;case"Today":return t;case"This Week":return[i,r];case"Last Week":return[n,s];case"This Month":return[a,o];case"Last Month":return[l,h];default:return null}})(F):k:e="Between"===F?[P.from,P.to]:F.includes("Average")?F:T,Array.isArray(e)){const[t,i]=e;t&&i&&w({type:F,condition:F?.toLowerCase(),value:e})}else e&&w({type:F,condition:F?.toLowerCase(),value:e,showType:F.includes("Average")})}K()},children:G("Apply")})]})]})})]})},kg=({uniqueValues:t,selectedValues:r,setSelectedValues:n,valueCounts:s,Cell:a,column:o,type:l,height:h=144})=>{const c=t.length>0&&t.every((e=>r.includes(e)));return i(Ue,{direction:"column",spacing:1,children:[e(Ae,{control:e(so,{checked:c,indeterminate:r.length>0&&!c,color:"secondary",onChange:()=>{n(c?[]:[...t])}}),label:e(fe,{sx:{fontWeight:"bold"},children:G("SelectAll")}),sx:{mx:0,pb:1,borderBottom:"1px solid #eee"}}),e(Ei,{height:t.length?h:0,itemCount:t.length,itemSize:30,width:"100%",children:({index:h,style:c})=>{const d=t[h];return e("div",{style:c,children:e(Ae,{control:e(so,{checked:r.includes(d),onChange:()=>(e=>{r.includes(e)?n(r.filter((t=>t!==e))):n([...r,e])})(d),sx:{p:.5}}),sx:{width:"100%",alignItems:"center",mx:0,my:.5},label:i(me,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",pr:1},children:[e(fe,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.875rem"},children:"function"==typeof a&&"text"!==l?a({value:d,column:o,isAdvanceFilter:!0}):d?.toString()}),i(fe,{sx:{fontSize:"0.75rem",color:"#888",marginLeft:1,flexShrink:0},children:["(",s[String(d??"")]||0,")"]})]})})},d?.toString())}})]})},Dg=({footerGroup:t,loading:i})=>e(hi,{...t.getFooterGroupProps(),component:"div",children:t.headers.map((t=>e(ci,{...t.getFooterProps([{style:{textAlign:t?.alignment??"unset",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 20px 0px 10px",lineHeight:"34px",backgroundColor:"var(--theme-color2)"}}]),component:"div",children:t.render("Footer",{loading:i})})))}),Ig=({footerGroup:t})=>e("div",{style:{backgroundColor:"var(--theme-color2)"},children:e(hi,{...t.getFooterGroupProps(),children:e("div",{children:t.headers.map((t=>e("span",{style:{textAlign:t?.alignment??"unset",display:"flex",gap:"3rem",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:"34px",marginLeft:"10px",fontWeight:"500"},children:t.render("Footer1")},t.id)))})})}),Ug=({columns:r,defaultColumn:n,data:s,maxHeight:d=300,containerHeight:u,occupiedHeight:A,initialState:f={},filterTypes:g,title:m,options:w,loading:b=!1,hideFooter:v=!1,showSerialNoColumn:y=!1,onClose:B=null,setQueryFilters:x,filterMeta:F,queryFilters:N,hideAmountIn:S,retrievalType:E,onButtonActionHandel:T,isOpenRetrievalDefault:L,hideHeader:k=!1,hideShowFiltersSwitch:D,hideStatusBar:I,refetchData:U,pageSizes:P=[20,30,40],totalRecords:O=0,defaultPageSize:R=20,defaultSortOrder:Q=[],defaultHiddenColumns:H=[],enablePagination:M=!1,retrievalComponent:_,openDrawerFilter:j,onDoubleClickAction:V,enablePdfPrint:K,reportTemplateCode:q,enablePivot:G,actions:W,getReportData:J,disableFilters:X,headerToolbarStyle:Y,enableEnterToFocus:$})=>{const Z=a((()=>r.some((e=>e.isDisplayValueTotal))),[r]),ee=a((()=>r.some((e=>e.isTotalWithCurrency||e.isTotalWithoutCurrency))),[r]),[te,ie]=c(!1),[re,se]=c(!1),{t:ae}=ne(),{disableColumnFilters:le}=Ws(),he=a((()=>r.map((e=>({...e,disableFilters:e?.disableFilters??X??le??!1,filter:Ng})))),[r,X,le]),ce=Gt({columns:he,data:s,defaultColumn:n,filterTypes:g,onButtonActionHandel:T,autoResetGlobalFilter:!1,autoResetFilters:!1,autoResetGroupBy:!1,autoResetExpanded:!1,autoResetSortBy:!1,globalFilter:(e,t,i)=>((e,t,i,r)=>{const n=i.toLowerCase();return e.filter((e=>t.some((t=>{const i=r.find((e=>e.accessor===t)),s=e.values[t];return!ca(s)||i?.Cell!==gc&&i?.Cell!==mc&&i?.Cell!==Ic?String(s).toLowerCase().includes(n):z(new Date(s),i.format??"dd/MM/yyyy hh:mm:ss a").toLowerCase().includes(n)}))))})(e,t,i,r),initialState:{pageIndex:0,pageSize:R,hiddenColumns:H,sortBy:Q,...f},...w},Wt,ri,Xt,Yt,$t,ti,ii,ug(y),T),{getTableProps:de,getTableBodyProps:ue,headerGroups:Ae,footerGroups:pe,rows:fe,prepareRow:ge,totalColumnsWidth:me,toggleAllRowsExpanded:we,isAllRowsExpanded:be,setAllFilters:ve,setGlobalFilter:ye,preGlobalFilteredRows:Be,gotoPage:Ce,setPageSize:xe,state:{filters:Fe,globalFilter:Ne,pageIndex:Se,pageSize:Ee}}=ce;l((()=>{"function"==typeof J&&J(Fe,N,Ne,s,fe?.map((e=>e.values)))}),[Fe,N,Ne,s,fe]),l((()=>{ve([])}),[N]);const Te=h((t=>{let{index:i,style:r}=t;const n=fe[i];return ge(n),n?.isGrouped&&n?.isExpanded&&(r={...r,backgroundColor:"rgba(0, 0, 0, 0.04)"}),e(hi,{...n.getRowProps({style:r}),component:"div",onDoubleClick:()=>{"function"==typeof V&&V({row:[{data:n?.original,id:n?.id}]})},children:n.cells.map(((e,t)=>e.isAggregated?e.render("Aggregated"):e.render("Cell",{index:t})))})}),[ge,fe]),Le=a((()=>fe.reduce(((e,t)=>(t?.original?._hidden||++e,e)),0)),[fe]),ke=a((()=>{if(!u||!A)return{min:"73.5vh",max:"73.5vh"};const e=e=>{const t=Array.isArray(N)&&N.length>0?`calc(${u?.[e]} - 48px)`:u?.[e];return t&&A?.[e]?`calc(${t} - ${A?.[e]})`:t};return{min:e("min"),max:e("max")}}),[N,u,A]),De=o(null),[Ie,Ue]=c({min:700,max:700});return l((()=>{if(!De.current)return;const e=()=>{const e=De.current,t=getComputedStyle(e),i=parseFloat(t.minHeight),r=parseFloat(t.maxHeight);Ue({min:i,max:r})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[fe,u,A]),i(p,{children:[i(ni,{style:{width:"100%",overflow:"hidden",marginBottom:"8px",display:k?"none":"inherit"},className:"not-printed",children:[i(si,{className:"static__report__header",variant:"dense",sx:{width:"100%",background:"var(--primary-bg)",...Y},children:[e(vt,{variant:"h5",color:"primary",children:m.trim()}),e("div",{style:{flexGrow:1}}),j?e(yg,{setQueryFilters:x,filterMeta:F,filterData:N,retrievalWindowOpen:L}):e(bg,{setQueryFilters:x,filterMeta:F,filterData:N,retrievalType:E,isOpenRetrievalDefault:L,retrievalComponent:_}),Fe.length>0&&e(ct,{onClick:()=>{ve([])},style:{marginRight:"8px",color:"white"},children:ae("ClearFilter")}),"function"==typeof U?e(C,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:()=>U(),color:"primary",children:e(qi,{})}):null,e(Ag,{setGlobalFilter:ye,globalFilter:Ne,rowCount:Le}),Boolean(S)?null:e(Fc,{}),fe?.length>0?e(t,{children:Ae.some((e=>e.headers.some((e=>!0===e.isGrouped))))?e(Ye,{control:e(Dt,{onChange:()=>we(!be),checked:be,name:"filters",size:"small",color:"primary"}),style:{color:"var(--white)"},label:ae("ExpandRows")}):e(Ye,{control:e(tl,{title:ae("Showexportoptions"),arrow:!0,children:i(ct,{onClick:()=>{se(!0)},style:{marginTop:"0px",color:"white"},children:[ae("Export")," ",e(Gi,{})]})}),style:{color:"var(--white)"},label:""})}):null,!b&&G?e(Ye,{control:e(tl,{title:ae("Open Pivot Table"),arrow:!0,children:i(ct,{onClick:()=>ie(!0),style:{marginTop:"0px",color:"white"},children:[ae("Pivot")," ",e(dr,{})]})}),style:{color:"var(--white)"},label:""}):null,W?.map(((t,i)=>e(za,{sx:{minWidth:"60px",...t.buttonStyle},disabled:b,onClick:e=>"function"==typeof t.callback&&t.callback(e,s,fe?.map((e=>e.values))),children:t.buttonName},i))),"function"==typeof B?e(tl,{title:ae("Close"),arrow:!0,children:e(C,{onClick:B,size:"small",children:e(Bt,{style:{color:"var(--white)"}})})}):null]}),I?null:e(fg,{dense:!0,setAllFilters:x,filters:N})]}),b&&e(gt,{color:"secondary"}),i(ni,{style:{width:"100%",overflow:"hidden"},tabIndex:0,children:[e(ai,{ref:De,sx:{position:"relative",maxHeight:ke.max,minHeight:ke.min},children:i(oi,{...de(),size:"small",component:"div",children:[e(li,{component:"div",children:Ae.map((t=>e(hi,{...t.getHeaderGroupProps(),component:"div",children:t.headers.map(((t,r)=>i(ci,{...t.getHeaderProps([{style:{display:"flex",padding:0===r?"0 10px":"0px 10px 0 0",alignItems:"center"}}]),component:"div",align:t.alignment,children:[t.render("Header"),t.canFilter&&e(Lg,{column:t,filters:Fe,enableEnterToFocus:$})]})))})))}),e(di,{...ue({}),component:"div",children:e(Ei,{height:(()=>{const e=Ie?.min??d;return ee?fe.length<=0?e-72:Z?e-110:e-72:Z&&fe.length?e-72:e-38})(),itemCount:fe.length,itemSize:35,width:me+10,overscanCount:10,children:Te})}),fe.length<=0&&!1===b?e("div",{style:{justifyContent:"center",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)",position:"absolute",left:"50%",top:"50%"},children:ae("Nodatafound")}):null,v?null:i(li,{component:"div",style:{boxShadow:"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)"},children:[e(Dg,{footerGroup:pe[0],loading:b}),e(Ig,{footerGroup:pe[0]})]})]})}),v?null:M?e(Qe,{sx:{display:"flex","& .MuiToolbar-root":{display:"flex",alignItems:"baseline"}},variant:"body",component:"div",rowsPerPageOptions:P,colSpan:3,count:O,rowsPerPage:Number(Ee),page:Number(Se),onPageChange:(e,t)=>{Ce(t)},onRowsPerPageChange:e=>{xe(Number(e.target.value))},ActionsComponent:Vl}):i(ci,{style:{display:"flex",color:"var(--theme-color1)",fontWeight:"bold",padding:"10px"},children:[ae("TotalNoofRecords"),": ",Le]})]}),re?e(hd,{globalFilter:Ne,filters:Fe,queryFilters:N,title:m.trim(),rows:fe,columns:r,onClose:()=>{se(!1)},enablePdfPrint:K,reportTemplateCode:q,enableEnterToFocus:$}):null,te?e(oe,{open:!0,fullScreen:!0,children:e(zd,{rows:fe,title:m.trim(),columns:r,onClose:()=>ie(!1)})}):null]})},Pg=(e,t,i)=>pr(e,i,{keys:[e=>e.values[t]]});Pg.autoRemove=e=>!e;const Og=(e,t,i)=>e.filter((e=>{const r=e.values[t];return void 0===r||String(r).toLowerCase().startsWith(String(i).toLowerCase())})),Rg=(e,t,i)=>e.filter((e=>e.values[t]>=i));Rg.autoRemove=e=>"number"!=typeof e;const Qg=(e,t,i)=>e.filter((e=>t.some((t=>{const r=e.values[t];return r&&r.length&&i.some((e=>r.includes(e)))}))));Qg.autoRemove=e=>!e||!e.length;const Hg=[{label:"starts with",value:"startsWith"},{label:"ends with",value:"endsWith"},{label:"equal",value:"equal"},{label:"contains",value:"contains"}],Mg=({filterValue:t,id:i,columnName:r,gridProps:n,dispatch:s})=>{const{t:a}=ne(),[o,l]=c(t?.value??""),[h,d]=c(t?.condition??"equal"),u=()=>{Boolean(o)?s({type:"setValue",payload:{condition:h,value:o,id:i,columnName:r}}):s({type:"removeValue",payload:{id:i}})};return e(ie,{item:!0,xs:12,sm:6,md:6,...n,children:e(to,{label:a(r),InputLabelProps:{shrink:!0},onChange:e=>l(e.target.value.trimStart()),onBlur:u,fullWidth:!0,value:o,InputProps:{endAdornment:e(Bo,{size:"small",style:{width:"50%"},touched:!0,error:"",multiple:!1,handleChange:e=>{d(e.target.value)},handleBlur:u,options:Hg,disableCaching:!1,value:h,selectVariant:"andornment"})}})})},_g=({filterValue:t,id:i,columnName:r,filterProps:n,gridProps:s,dispatch:a})=>{const{t:l}=ne(),[h,d]=c(t?.value??[]),u=o(null),[A,p]=c([]),{loadingOptions:f}=Ao(n?.options??[],p,n?._optionsKey??"",!1,{},!1,void 0);return e(ie,{item:!0,xs:12,sm:6,md:6,...s,children:e(Fo,{label:l(r),showCheckbox:!0,value:h,size:"small",fullWidth:!0,touched:!0,error:"",multiple:!0,handleChange:(e,t)=>{d(e.target.value),u.current=t},handleBlur:e=>{Array.isArray(h)&&h.length>0?a({type:"setValue",payload:{condition:"in",value:h,label:u.current,id:i,columnName:r}}):a({type:"removeValue",payload:{id:i}})},options:A,loadingOptions:f,selectVariant:"regular"})})},jg=({filterValue:t,id:r,columnName:n,gridProps:s,dispatch:a,filterProps:o})=>{const{t:h}=ne(),{dynamicAmountSymbol:d}=Ws(),[u,A]=c(Array.isArray(t?.value)?t?.value[0]:null),[p,f]=c(Array.isArray(t?.value)?t?.value[1]:null),[g,m]=c("");l((()=>{Number(u)>Number(p)&&p?.length>0?m("From Amount should be less To Amount"):m("")}),[u,p]);return e(ie,{item:!0,xs:12,sm:6,md:6,...s,children:i($e,{fullWidth:!0,error:Boolean(g),tabIndex:1,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(!isNaN(Number(u))&&!isNaN(Number(p))&&u?.length&&p?.length&&Number(u)<=Number(p)?a({type:"setValue",payload:{condition:"between",value:[u,p],id:r,columnName:n,type:o.type}}):a({type:"removeValue",payload:{id:r}}))},sx:{"& label.Mui-focused":{color:"var(--theme-color1)"}},children:[e(Io,{shrink:!0,sx:{fontSize:"0.875rem !important"},children:h(n)}),i("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[e(ul,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,placeholder:"From amount",isAllowed:e=>!(e?.value?.length>15),value:u,onValueChange:e=>{isNaN(Number(e.value))||A(String(e.value))}},enableGrid:!1,fieldKey:"FromAmount",name:"from-amount",StartAdornment:sl(d),className:"textInputFromRight",maxLength:15,showMaxLength:!1,style:{width:"48%"}}),e(ul,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,placeholder:"To amount",isAllowed:e=>!(e?.value?.length>15),value:p,onValueChange:e=>{isNaN(Number(e.value))||f(String(e.value))}},enableGrid:!1,fieldKey:"ToAmount",name:"to-amount",StartAdornment:sl(d),className:"textInputFromRight",maxLength:15,showMaxLength:!1,style:{width:"48%"}})]}),Boolean(g)?e(Ze,{children:g}):null]})})},zg=[{label:"All",value:"all"},{label:"Today",value:"today"},{label:"Last Week",value:"lastWeek"},{label:"Last Month",value:"lastMonth"},{label:"Custom",value:"custom"}],Vg=[{label:"Today",value:"today"},{label:"Last Week",value:"lastWeek"},{label:"Last Month",value:"lastMonth"},{label:"Custom",value:"custom"}],Kg=({filterValue:r,id:n,columnName:s,gridProps:a,dispatch:h,filterProps:d,isDefaultFilter:u})=>{const{t:A}=ne(),[p,f]=c({isError:!1,error:""}),[g,m]=c({isError:!1,error:""}),w=o(null),b=o(null),[v,y]=c(Array.isArray(r?.value)?new Date(r?.value[0])??null:new Date(r?.value)??null),[B,C]=c(Array.isArray(r?.value)?new Date(r?.value[1])??null:null),[x,F]=c(r?.option??(u?"today":"all")),N="custom"===x?{style:{width:"40%"}}:{fullWidth:!0};return l((()=>{v||y(new Date),B||C(new Date)}),[v,B]),e(ie,{item:!0,xs:12,...a,sm:"custom"===x?12:6,md:"custom"===x?12:6,children:i("div",{style:{width:"100%",display:"flex"},tabIndex:1,onBlur:e=>{let t=Q(new Date,"iii LLL dd yyyy HH:mm:ss xxxx"),i=Q(new Date,"iii LLL dd yyyy HH:mm:ss xxxx");v instanceof Date&&!isNaN(v)&&(t=Q(v,"iii LLL dd yyyy HH:mm:ss xxxx")),B instanceof Date&&!isNaN(B)&&(i=Q(B,"iii LLL dd yyyy HH:mm:ss xxxx")),"today"===x?Boolean(u)?h({type:"removeValue",payload:{id:n}}):h({type:"setValue",payload:{condition:"equal",value:t,id:n,option:x,columnName:s,type:d?.type}}):("lastWeek"===x||"lastMonth"===x||"custom"===x)&&v instanceof Date&&B instanceof Date&&!isNaN(v)&&!isNaN(B)&&v<=B?h({type:"setValue",payload:{condition:"between",value:[t,i],id:n,option:x,columnName:s,type:d?.type}}):h({type:"removeValue",payload:{id:n}})},children:[e(Bo,{label:A(s),value:x,size:"small",touched:!0,error:"",handleChange:(e,t)=>{let i=new Date;"today"===e.target.value?Boolean(u)?(y(null),C(null)):y(i):"lastWeek"===e.target.value?(C(i),y(Ii(i,7))):"lastMonth"===e.target.value?(C(i),y(Ii(i,30))):"all"!==e.target.value&&"custom"!==e.target.value||(y(null),C(null)),F(e.target.value)},handleBlur:()=>!0,options:Boolean(u)?Vg:zg,_optionsKey:"dateRangePicker",optionsProps:{},disableCaching:!1,selectVariant:"regular",...N}),"custom"===x?i(t,{children:[e("span",{style:{width:"1%",textAlign:"center",marginTop:"32px"}}),e(Eo,{format:"dd/MM/yyyy",label:A("FromDate"),maxDate:new Date,onChange:e=>{if(ca(e)){if(y(e),w.current=e,e>new Date)return void f({isError:!0,error:A("Futuredatesarenotallowed")});us(B,e)?(null!==w.current&&f({isError:!1,error:""}),null!==b.current&&m({isError:!1,error:""})):f({isError:!0,error:A("FromDateshouldbelessthanorequaltoToDate")})}else{if(!e)return f({isError:!0,error:A("ThisFieldisrequired")}),void(w.current=null);if(!V(e))return f({isError:!0,error:A("Mustbeavaliddate")}),void(w.current=null)}},value:v??new Date,sx:{width:"30%"},slots:{textField:to},slotProps:{textField:{placeholder:"Start Date","aria-label":"Select Date",InputLabelProps:{shrink:!0},error:p.isError,helperText:p.error},actionBar:{actions:["today","cancel"]}}}),e("span",{style:{width:"1%",textAlign:"center",marginTop:"32px"}}),e(Eo,{format:"dd/MM/yyyy",label:A("ToDate"),onChange:e=>{if(ca(e))C(e),b.current=e,us(e,v)?(null!==b.current&&m({isError:!1,error:""}),null!==w.current&&f({isError:!1,error:""})):m({isError:!0,error:A("ToDateshouldbegreaterthanorequaltoFromDate")});else{if(!e)return m({isError:!0,error:A("ThisFieldisrequired")}),void(b.current=null);if(!V(e))return m({isError:!0,error:A("Mustbeavaliddate")}),void(b.current=null)}},value:B??new Date,sx:{width:"30%"},slots:{textField:to},slotProps:{textField:{placeholder:"End Date","aria-label":"Select Date",InputLabelProps:{shrink:!0},error:g.isError,helperText:g.error},actionBar:{actions:["today","cancel"]}}})]}):null]})})},qg=({filterValue:t,id:r,columnName:n,gridProps:s,dispatch:a,filterProps:o})=>{const{t:h}=ne(),[d,u]=c(Array.isArray(t?.value)?t?.value[0]:null),[A,p]=c(Array.isArray(t?.value)?t?.value[1]:null),[f,g]=c("");l((()=>{Number(d)>Number(A)&&A?.length>0?g("Min value is greater than max"):g("")}),[d,A]);return e(ie,{item:!0,xs:12,sm:6,md:6,...s,children:i($e,{fullWidth:!0,error:Boolean(f),tabIndex:1,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(!isNaN(Number(d))&&!isNaN(Number(A))&&d?.length&&A?.length&&Number(d)<=Number(A)?a({type:"setValue",payload:{condition:"between",value:[d,A],id:r,columnName:n,type:o.type}}):a({type:"removeValue",payload:{id:r}}))},sx:{"& label.Mui-focused":{color:"var(--theme-color1)"}},children:[e(Io,{shrink:!0,sx:{fontSize:"0.875rem !important"},children:h(n)}),i("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[e(Ht,{thousandSeparator:!0,thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,value:d,customInput:to,placeholder:"Min",onValueChange:e=>{isNaN(Number(e.value))||u(String(e.value))},style:{width:"48%"}}),e(Ht,{thousandSeparator:!0,thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,value:A,customInput:to,placeholder:"Max",onValueChange:e=>{isNaN(Number(e.value))||p(String(e.value))},style:{width:"48%"}})]}),Boolean(f)?e(Ze,{children:f}):null]})})},Gg=({filterValue:t,id:r,columnName:n,gridProps:s,dispatch:a,filterProps:o})=>{const{t:h}=ne(),[d,u]=c(Array.isArray(t?.value)?t?.value[0]:null),[A,p]=c(Array.isArray(t?.value)?t?.value[1]:null),[f,g]=c("");l((()=>{Number(d)>Number(A)&&A?.length>0?g("Min value is greater than max"):g("")}),[d,A]);return e(ie,{item:!0,xs:12,sm:6,md:6,...s,children:i($e,{fullWidth:!0,error:Boolean(f),tabIndex:1,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(!isNaN(Number(d))&&!isNaN(Number(A))&&d?.length&&A?.length&&Number(d)<=Number(A)?a({type:"setValue",payload:{condition:"between",value:[d,A],id:r,columnName:n,type:o.type}}):a({type:"removeValue",payload:{id:r}}))},sx:{"& label.Mui-focused":{color:"var(--theme-color1)"}},children:[e(Io,{shrink:!0,sx:{fontSize:"0.875rem !important"},children:h(n)}),i("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[e(Uo,{style:{width:"45%"},placeholder:"min",value:d,onChange:e=>{isNaN(Number(e.target.value))||u(e.target.value.trim())}}),e(Uo,{style:{width:"45%"},placeholder:"max",value:A,onChange:e=>{isNaN(Number(e.target.value))||p(e.target.value.trim())}})]}),Boolean(f)?e(Ze,{children:f}):null]})})},Wg=t=>{const{filterProps:i}=t;return"date"===i?.type||"dateTime"===i?.type?e(Kg,{...t}):"value"===i?.type?e(Gg,{...t}):"number"===i?.type?e(qg,{...t}):"amount"===i?.type?e(jg,{...t}):e(ie,{item:!0,md:6,sm:6,xs:12,children:"Range Component Type not set"})},Jg=e=>({"data-tag-index":e,tabIndex:-1,key:e}),Xg=({filterValue:t,id:i,columnName:r,gridProps:n,dispatch:s})=>{const[a,l]=c(""),[d,u]=c(t?.value??[]),[A,p]=c(-1),f=o(null),g=o(null),m=(e,t)=>{let i=A;-1===A?""===a&&"previous"===t&&(i=d.length-1):(i+="next"===t?1:-1,i<0&&(i=0),i===d.length&&(i=-1)),p(i),w(i)},w=h((e=>{-1===e?g.current.focus():f.current.querySelector(`[data-tag-index="${e}"]`).focus()}),[]);let b=null;Array.isArray(d)&&d.length>0&&(b=d.map(((t,i)=>e(mi,{label:t,size:"small",onDelete:()=>u([...d.slice(i,i+1),...d.slice(i+1)]),style:{margin:"4px 2px"},...Jg(i)}))));return e(ie,{item:!0,xs:12,sm:6,md:6,...n,children:e(no,{inputRef:g,label:r,InputLabelProps:{shrink:!0},onChange:e=>l(e.target.value),onBlur:()=>{Array.isArray(d)&&d.length>0?s({type:"setValue",payload:{condition:"in",value:d,id:i,columnName:r}}):s({type:"removeValue",payload:{id:i}})},fullWidth:!0,value:a,InputProps:{startAdornment:b,ref:f},onKeyDown:e=>{if(-1!==A&&-1===["ArrowLeft","ArrowRight"].indexOf(e.key)&&(p(-1),w(-1)),299!==e.which)switch(e.key){case"Enter":Boolean(a)&&(u((e=>[...e,a])),l(""));break;case"Backspace":if(""===a&&d.length>0){const e=-1===A?d.length-1:A,t=d.slice();t.splice(e,1),u(t)}break;case"ArrowLeft":m(0,"previous");break;case"ArrowRight":m(0,"next")}}})})},Yg=({filterValue:t,id:i,columnName:r,gridProps:n,dispatch:s})=>{const[a,o]=c(t?.value??"");return e(ie,{item:!0,xs:12,sm:6,md:6,...n,children:e(Eo,{label:r,value:""===a?null:new Date(a),onChange:e=>{o(e),isNaN(e)?s({type:"removeValue",payload:{id:i}}):s({type:"setValue",payload:{condition:"equal",value:e,id:i,columnName:r}})},sx:{width:"100%"},slots:{textField:to},slotProps:{textField:{variant:"standard",InputLabelProps:{shrink:!0}},actionBar:{actions:["today","cancel"]}}})})},$g=e=>()=>(console.log(`no method found for options at ${e}`),[{label:"Oops error occured",value:""}]),Zg=e=>Array.isArray(e)?e.map((e=>{const{filterComponentType:t,filterProps:i,...r}=e;switch(t){case"valueDateFilter":return{...r,Filter:Yg,filterProps:i};case"valueFilter":return{...r,Filter:Mg,filterProps:i};case"multiValueFilter":return{...r,Filter:Xg,filterProps:i};case"optionsFilter":{const{options:e,...t}=i;if("string"==typeof e){const i=ss.getFn(e??"NOT_EXIST_OPTIONS_FN",$g);return{...r,Filter:_g,filterProps:{options:i,_optionsKey:e,...t}}}return{...r,Filter:_g,filterProps:i}}case"rangeFilter":return{...r,Filter:Wg,filterProps:i};default:return{...r}}})):[],em=e=>Array.isArray(e)?e.reduce(((e,t)=>(!0===t.isHiddenColumn&&e.push(t.accessor),e)),[]):[],tm=({metaData:t,maxHeight:r,initialState:n,title:s,options:d,hideFooter:u,showSerialNoColumn:A=!1,onClose:f=null,reportName:g,dataFetcher:m=()=>[],autoFetch:w=!0,hideAmountIn:b=!1,reportID:v,retrievalType:y,onClickActionEvent:B=()=>{},otherAPIRequestPara:C={},hideHeader:x=!1,hideShowFiltersSwitch:F=!1,defaultFilter:N=[],hideStatusBar:S=!1,retrievalComponent:E,openDrawerFilter:T=!1,onDoubleClickAction:L,enableCaching:k=!1,dataTransformer:D=e=>e,reportTemplateCode:I="",enablePivot:U,actions:P=[],getReportData:O,disableFilters:R,headerToolbarStyle:Q={},enableEnterToFocus:H,focusScopeId:M="enter-to-focus-static-report"})=>{const{t:_}=ne(),{defaultExportConfig:j,enableEnterToFocus:z}=Ws(),V=a((()=>({...t,columns:[{accessor:"SRNO",width:100,disableFilters:!0,type:"default",...t?.sequenceColumnConfig,columnName:t?.sequenceColumnConfig?.columnName??"SrNo"},...t.columns]})),[t]),K=em(V.columns),q=a((()=>({...V,hiddenColumns:K})),[K]),G=a((()=>{if(Array.isArray(q.columns))return q.columns.map((e=>({...e,columnName:_(e.columnName)})))}),[_,q]),W=a((()=>T?Zg(q?.filters):q.filters),[]),[J,X]=c(w),[Y,Z]=c([...N]),ee=h((e=>{$(Y,e)||(Z(e),X(!0))}),[X,Z,Y]),te=a((()=>({Header:Tc,Cell:wc,Footer:Nc,Footer1:Sc,Aggregated:wc})),[]),ie=a((()=>({fuzzyText:Pg,customText:Og,filterGreaterThan:Rg,customInclude:Qg})),[]),{data:re,isFetching:se,isLoading:ae,isError:oe,error:le,refetch:he}=zt([m,v,Y,C],(()=>m(v,Y,C)),{cacheTime:k?36e5:0,enabled:J}),ce=a((()=>re?.map(((e,t)=>({SRNO:String(t+1),...e})))),[re]),de=h(((e,t)=>{se||ae||oe||!J||B(e,t,re[e],Y)}),[re]),ue=o(null),Ae=H??z,pe=M&&Ae?{"data-scope-id":M}:{};return l((()=>{Ae&&ue.current&&ue.current.focus()}),[Ae]),i(p,{children:[oe?e(Va,{severity:"error",errorMsg:le?.error_msg??"Unknown Error occured",errorDetail:le?.error_detail}):null,e(Bc,{children:e("div",{ref:ue,tabIndex:0,style:{width:"100%",position:"relative"},onKeyDown:e=>{Ae&&ma(e,M)},...pe,children:e(Ug,{columns:G,defaultColumn:te,defaultHiddenColumns:q.hiddenColumns,data:D(ce)??[],maxHeight:r??450,containerHeight:q?.containerHeight,occupiedHeight:q?.occupiedHeight,initialState:n,filterTypes:ie,title:s+" ",options:d,loading:se||ae,hideFooter:"Y"===u||!0===u,showSerialNoColumn:"Y"===A||!0===A,onClose:f,setQueryFilters:ee,filterMeta:W,queryFilters:Y,hideStatusBar:"Y"===S||!0===S,hideAmountIn:"Y"===b||!0===b,retrievalType:y,onButtonActionHandel:de,isOpenRetrievalDefault:!w,hideHeader:"Y"===x||!0===x,hideShowFiltersSwitch:"Y"===F||!0===F,refetchData:()=>he(),retrievalComponent:E,openDrawerFilter:T,onDoubleClickAction:L,enablePdfPrint:q?.enablePdfPrint??j?.enablePdfPrint??!1,reportTemplateCode:ce?.find((e=>e?.REPORT_PERSONALIZATION_ID))?.REPORT_PERSONALIZATION_ID??I,enablePivot:U&&ce?.length>0,actions:P,getReportData:O,disableFilters:R,headerToolbarStyle:Q,enableEnterToFocus:Ae})})})]})},im=({column:{filterValue:t,preFilteredRows:i,setFilter:r}})=>{const n=i.length,{t:s}=ne();return e(_t,{value:t||"",onChange:e=>{e.target.value.length<=100&&r(e.target.value||void 0)},fullWidth:!0,size:"small",variant:"outlined",placeholder:`${s("Searched")} ${n} ${s("records")}`})};var rm=Object.freeze({__proto__:null,DefaultColumnFilter:im,NumberRangeColumnFilter:({column:{filterValue:t=[],preFilteredRows:r,setFilter:n,id:s}})=>{const[o,l]=a((()=>{let e=r.length?r[0].values[s]:0,t=r.length?r[0].values[s]:0;return r.forEach((i=>{e=Math.min(i.values[s],e),t=Math.max(i.values[s],t)})),[e,t]}),[s,r]);return i("div",{style:{display:"flex",alignItems:"baseline"},children:[e(_t,{value:t[0]||"",type:"number",onChange:e=>{const t=e.target.value;n(((e=[])=>[t?parseInt(t,10):void 0,e[1]]))},placeholder:`Min (${o})`,fullWidth:!0,size:"small",variant:"outlined"}),e("span",{children:"to"}),e(_t,{value:t[1]||"",type:"number",onChange:e=>{const t=e.target.value;n(((e=[])=>[e[0],t?parseInt(t,10):void 0]))},placeholder:`Max (${l})`,fullWidth:!0,size:"small",variant:"outlined"})]})},SelectColumnFilter:({column:{filterValue:t,setFilter:r,preFilteredRows:n,id:s,multiple:o}})=>{const{t:l}=ne(),h=a((()=>{const e=new Set;return n.forEach((t=>{e.add(t.values[s])})),[...e.values()]}),[s,n]);return o&&!Array.isArray(t)&&(t=[t]),i(_t,{value:t??"",onChange:e=>{r(e.target.value||void 0)},fullWidth:!0,variant:"outlined",size:"small",select:!0,SelectProps:{multiple:o},children:[e(te,{value:"",children:l("All")},"default"),h.map(((t,i)=>e(te,{value:t,children:t},i)))]})},SliderColumnFilter:({column:{filterValue:t,setFilter:i,preFilteredRows:r,id:n}})=>{const[s,o]=a((()=>{let e=r.length?r[0].values[n]:0,t=r.length?r[0].values[n]:0;return r.forEach((i=>{e=Math.min(i.values[n],e),t=Math.max(i.values[n],t)})),[e,t]}),[n,r]);return e(It,{min:s,max:o,value:t||s,onChange:(e,t)=>{i(parseInt(t))}})}});const nm=Ci((e=>({root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),background:"var(--theme-color1)"},title:{flex:"1 1 100%",color:"var(--white)",letterSpacing:"1px",fontSize:"2rem"}}))),sm=({footerGroup:t,loading:i})=>e(hi,{...t.getFooterGroupProps(),component:"div",children:t.headers.map((t=>e(ci,{...t.getFooterProps([{style:{textAlign:t?.alignment??"unset",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 20px 0px 10px",lineHeight:"34px",backgroundColor:"var(--theme-color2)"}}]),component:"div",children:t.render("Footer",{loading:i})})))}),am=({columns:r,defaultColumn:n,data:s,filterTypes:d,title:u,options:A,loading:f=!1,isError:g=!1,hideFooter:m=!1,showSerialNoColumn:w=!1,onClose:b=null,setQueryFilters:v,filterMeta:y,queryFilters:B,hideAmountIn:x,onButtonActionHandel:F,hideHeader:N=!1,pageSizes:S=[20,30,40],pageCount:E,totalRecords:T,onFetchData:L,defaultPageSize:k=20,defaultSortOrder:D=[],defaultHiddenColumns:I=[],enablePagination:U=!0,enablePdfPrint:P,onDoubleClickAction:O,defaultFilter:R,disableFilters:Q,containerHeight:H,occupiedHeight:M,headerToolbarStyle:_,enableEnterToFocus:j})=>{const z=nm(),[V,K]=c(!1),[q,G]=c(!1),{t:W}=ne(),{disableColumnFilters:J}=Ws(),X=a((()=>r.some((e=>e.isTotalWithCurrency||e.isTotalWithoutCurrency))),[r]),Y=a((()=>r.map((e=>({...e,disableFilters:e?.disableFilters??Q??J??!1,filter:Ng})))),[r,Q,J]),$=Gt({columns:Y,data:s,defaultColumn:n,filterTypes:d,onButtonActionHandel:F,autoResetGlobalFilter:!1,autoResetFilters:!1,autoResetGroupBy:!1,autoResetSortBy:!1,initialState:{pageIndex:0,pageSize:k,hiddenColumns:I,sortBy:D},...A,manualPagination:!0,pageCount:E,autoResetPage:!1},ri,Xt,Yt,$t,ti,ii,ug(w),F,Zt),{getTableProps:Z,getTableBodyProps:ee,headerGroups:te,footerGroups:ie,rows:re,page:se,prepareRow:oe,pageOptions:le,totalColumnsWidth:he,toggleAllRowsExpanded:ce,isAllRowsExpanded:de,setAllFilters:ue,gotoPage:pe,setPageSize:fe,setSortBy:ge,state:{filters:me,pageIndex:we,pageSize:be,sortBy:ve}}=$,ye=h((({index:t,style:i})=>{if(0===se.length)return;const r=se[t];return oe(r),e(hi,{...r.getRowProps({style:i}),id:r.id,tabIndex:0,onDoubleClick:()=>{"function"==typeof O&&O({row:[{data:r?.original,id:r?.id}]})},children:r.cells.map(((e,t)=>{const{key:i}=e.getCellProps();return e.render("Cell",{key:i,index:t})}))})}),[oe,se]),Be=qt(L,500),Ce=a((()=>re.reduce(((e,t)=>(t?.original?._hidden||++e,e)),0)),[re]);l((()=>{ue([])}),[B]),l((()=>{Be({pageIndex:we,pageSize:be,sortBy:ve,filters:B})}),[Be,we,be,ve,B]),l((()=>{if(0===B?.length&&R?.length>0)v(R);else if(R?.length>0){const e=R.filter((e=>!B.some((t=>e.id===t.id)))).concat(B);JSON.stringify(e)!==JSON.stringify(B)&&v(e)}}),[B,R,v]),l((()=>{R?.length>0&&G(R.some((e=>"date"===e?.value?.type||"dateTime"===e?.value?.type)))}),[R]);const xe=a((()=>{const e=e=>{const t=Array.isArray(B)&&B.length>0?`calc(${H?.[e]??"73.5vh"} - 48px)`:H?.[e]??"73.5vh";return t&&M?.[e]?`calc(${t} - ${M?.[e]})`:t};return{min:e("min"),max:e("max")}}),[B,H,M]),Fe=o(null),[Ne,Se]=c({});return l((()=>{if(!Fe.current)return;const e=()=>{const e=Fe.current,t=getComputedStyle(e),i=parseFloat(t.minHeight),r=parseFloat(t.maxHeight);Se({min:i,max:r})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[re]),i(p,{children:[i(ni,{style:{width:"100%",overflow:"hidden",marginBottom:"8px",display:N?"none":"inherit"},className:"not-printed",children:[i(si,{className:"server__report__header",variant:"dense",sx:{width:"100%",background:"var(--primary-bg)",..._},children:[e(vt,{variant:"h5",color:"primary",children:u.trim()}),e("div",{style:{flexGrow:1}}),me.length>0&&e(ae,{onClick:()=>{ue([])},style:{marginRight:"8px",color:"white"},children:W("ClearFilter")}),y&&y.length?e(Ul,{setAllFilters:v,filters:B,filterMeta:y,gotoPage:pe,setSortBy:ge,classes:z,isDefaultFilter:q}):null,e(C,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:()=>Be({pageIndex:we,pageSize:be,sortBy:ve,filters:B}),color:"primary",children:e(qi,{})}),Boolean(x)?null:e(Fc,{}),te.some((e=>e.headers.some((e=>!0===e.isGrouped))))?e(Ae,{control:e(He,{onChange:()=>ce(!de),checked:de,name:"filters",size:"small",color:"primary"}),style:{color:"var(--white)",marginLeft:0},label:W("ExpandRows")}):e(t,{children:!f&&!g&&se.length>0?e(Ae,{control:e(tl,{title:W("Showexportoptions"),arrow:!0,children:i(ae,{onClick:()=>{K(!0)},style:{marginTop:"0px",marginLeft:"10px",color:"white"},disabled:f,children:[W("Export")," ",e(Gi,{})]})}),style:{color:"var(--white)"},label:""}):null}),"function"==typeof b?e(tl,{title:W("Close"),arrow:!0,children:e(C,{onClick:b,size:"small",children:e(Bt,{style:{color:"var(--white)"}})})}):null]}),B.length?e(Xl,{dense:!0,setAllFilters:v,filters:B,gotoPage:pe,setSortBy:ge}):null]}),f&&e(gt,{color:"secondary"}),i(ni,{style:{width:"100%",overflow:"hidden"},tabIndex:0,children:[e(ai,{ref:Fe,sx:{position:"relative",maxHeight:xe.max,minHeight:xe.min},children:i(oi,{...Z(),size:"small",component:"table",children:[e(li,{component:"thead",children:te.map((t=>e(hi,{...t.getHeaderGroupProps(),component:"tr",children:t.headers.map(((t,r)=>i(ci,{...t.getHeaderProps([{style:{display:"flex",padding:0===r?"0 10px":"0px 10px 0 0",alignItems:"center"}}]),component:"th",align:t.alignment,children:[t.render("Header"),t.canFilter?e(Lg,{column:t,filters:me,enableEnterToFocus:j}):null]})))})))}),f||g?null:e(di,{...ee({}),component:"tbody",children:e(Ei,{height:(Ne?.min??300)-(X?72:38),itemCount:se.length,itemSize:35,width:he+10,overscanCount:10,children:ye})}),g?e("div",{style:{position:"absolute",left:"50%",top:"50%",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:W("Somethingwenttowrong")}):null,re.length<=0&&!1===f?e("div",{style:{position:"absolute",left:"50%",top:"50%",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:W("Nodatafound")}):null,f||m?null:e(li,{component:"div",children:e(sm,{footerGroup:ie[0],loading:f})})]})}),m?null:U?e(Qe,{sx:{display:"flex",overflowY:"hidden","& .MuiToolbar-root":{display:"flex",alignItems:"baseline",transform:"translateY(5.5px)"}},variant:"body",component:"div",rowsPerPageOptions:S,colSpan:3,count:g||f?0:Number(T),rowsPerPage:Number(be),page:g||f?0:Number(we),onPageChange:(e,t)=>{pe(t)},onRowsPerPageChange:e=>{fe(Number(e.target.value))},ActionsComponent:Kl}):i(ci,{style:{display:"flex",color:"var(--theme-color1)",fontWeight:"bold",padding:"10px"},children:[W("TotalNoofRecords"),": ",Ce]}),V?e(hd,{filters:me,queryFilters:B,title:u.trim(),rows:re,columns:r,pageNumber:we,totalPageCount:le.length,onClose:()=>{K(!1)},enablePdfPrint:P,enableEnterToFocus:j}):null]})]})},om=({metaData:t,maxHeight:r,containerHeight:n,occupiedHeight:s,initialState:d,title:u,options:A,hideFooter:f,showSerialNoColumn:g=!1,onClose:m=null,reportName:w,dataTransformer:b=e=>e,autoFetch:v=!0,hideAmountIn:y=!1,retrievalType:B,onClickActionEvent:C=()=>{},hideHeader:x=!1,hideShowFiltersSwitch:F=!1,defaultFilter:N=[],hideStatusBar:S=!1,data:E,loading:T,isError:L,error:k,pageCount:D,totalRecords:I,pageSizes:U,defaultPageSize:P,onFetchData:O,onDoubleClickAction:R,disableFilters:Q,headerToolbarStyle:H,enableEnterToFocus:M,focusScopeId:_})=>{const{t:j}=ne(),{defaultExportConfig:z,enableEnterToFocus:V}=Ws(),K=a((()=>{if(Array.isArray(t.columns))return t.columns.map((e=>({...e,columnName:j(e.columnName)})))}),[j]),q=a((()=>Zg(t.filters)),[t.filters]),[G,W]=c(v),[J,X]=c([]),Y=h((e=>{X(e),W(!0)}),[W,X]),$=a((()=>({Header:Tc,Cell:wc,Footer:Nc,Filter:im,Aggregated:wc})),[]),Z=a((()=>({fuzzyText:Pg,customText:Og,filterGreaterThan:Rg,customInclude:Qg})),[]),ee=h(((e,t)=>{T||L||!G||C(e,t,E[e])}),[E]),te=o(null),ie=M??V,re=_&&ie?{"data-scope-id":_}:{};return l((()=>{ie&&te.current&&te.current.focus()}),[ie]),i(p,{children:[L&&e(Va,{severity:"error",errorMsg:k?.error_msg??"Unknown Error occured",errorDetail:k?.error_detail}),e(Bc,{children:e("div",{ref:te,tabIndex:0,style:{width:"100%",position:"relative"},onKeyDown:e=>{ie&&ma(e,_)},...re,children:e(am,{columns:K,defaultColumn:$,defaultHiddenColumns:t.hiddenColumns,data:b(E)??[],maxHeight:r??450,containerHeight:n,occupiedHeight:s,filterTypes:Z,title:u+" ",options:A,loading:T,isError:L,hideFooter:("string"!=typeof f||"N"!==f)&&Boolean(f),showSerialNoColumn:g,onClose:m,setQueryFilters:Y,defaultFilter:N,filterMeta:q,queryFilters:J,hideStatusBar:S,hideAmountIn:y,onButtonActionHandel:ee,isOpenRetrievalDefault:!v,hideHeader:x,hideShowFiltersSwitch:F,onFetchData:O,totalRecords:I,pageSizes:U,pageCount:D,defaultPageSize:P,enablePdfPrint:t?.enablePdfPrint??z?.enablePdfPrint??!1,onDoubleClickAction:R,disableFilters:Q,headerToolbarStyle:H,enableEnterToFocus:ie})})})]})},lm=({reportID:t,reportName:i,metaData:r,getAPIFn:n,otherAPIRequestPara:s,maxHeight:l,onClickActionEvent:d,defaultFilter:u,onDoubleClickAction:A,disableFilters:p,options:f,headerToolbarStyle:g={},enableEnterToFocus:m,focusScopeId:w="enter-to-focus-server-report"})=>{const{t:b}=ne(),[v,y]=c([]),[B,C]=c(null),[x,F]=c(0),[N,S]=c(0),E=o(null),T=o(null),L=Vt(n,{onError:e=>{C(e)},onSuccess:e=>{y(e?.[0].REPORT_DATA),S(Math.ceil(Number(e?.[0].COUNT??1)/Number(E.current?.pageSize??20))),F(Number(e?.[0].COUNT??1))}}),k=h((({pageSize:e,pageIndex:i,filters:r,sortBy:n})=>{const a=Number(e)*Number(i)+1,o=Number(a)+Number(e)-1;let l=((e=[])=>(Array.isArray(e)||(e=[e]),e.map(((e,t)=>({ACCESSOR:e.id,CONDITION:e.value.condition,VALUE:e.value.value,TYPE:e.value?.type??""})))))(r),h=((e=[])=>e.map(((e,t)=>({ACCESSOR:e.id??"",VALUE:e?.desc?"desc":"asc"}))))(n);T.current&&T.current?.abort?.(),T.current=new AbortController;const c={reportID:t,APIRequestPara:{FROM_ROW:a,TO_ROW:o,FILTER_CONDITIONS:l,ORDERBY_COLUMNS:h,IS_PAGE:!0,...s},abortAPICall:T.current};E.current={pageSize:e},L.mutate(c)}),[F,y]),D=a((()=>({...r,columns:[{accessor:"ROW_SR_CD_",width:100,disableFilters:!0,type:"default",...r?.sequenceColumnConfig,columnName:r?.sequenceColumnConfig?.columnName??"SrNo"},...r.columns]})),[r]),I=em(D.columns),U=a((()=>({...D,hiddenColumns:I})),[I]);return e(om,{metaData:U,maxHeight:l,reportName:i,containerHeight:D?.containerHeight,occupiedHeight:D?.occupiedHeight,title:b(D.title),hideFooter:D.hideFooter,hideAmountIn:D.hideAmountIn,onClickActionEvent:d,options:f,autoFetch:!0,data:v,loading:L.isLoading,isError:L.isError,error:B,pageCount:N,totalRecords:x,pageSizes:D?.pageSize??[25,50,100,250,500,2500,5e3,1e4,5e4,1e5],defaultPageSize:D.defaultPageSize??25,onFetchData:k,defaultFilter:u,onDoubleClickAction:A,disableFilters:p,headerToolbarStyle:g,enableEnterToFocus:m,focusScopeId:w})};Ka(".ag-theme-alpine{--ag-header-background-color:var(--theme-color4)!important;--ag-header-foreground-color:var(--theme-color1)!important;--ag-row-hover-color:none;--ag-font-weight:600;--ag-font-family:Roboto,sans-serif;--ag-height:30px!important}.ag-header-cell-label{color:var(--theme-color1)!important;cursor:default;font-family:Roboto,Helvetica,Arial,sans-serif;font-size:.875rem;font-weight:600;opacity:1;overflow:hidden;text-transform:capitalize}.ag-header-cell{border-radius:8px}.ag-cell{border-right:1px solid #fff}.ag-cell.currency{text-align:right}.ag-row.ag-row-pinned{background:var(--theme-color4)!important;border:none!important;line-height:22px;pointer-events:none;text-align:center}.ag-floating-bottom{border-top:none!important;height:23px!important;min-height:23px!important}.ag-row.ag-row-pinned .ag-cell{border:none!important;color:var(--theme-color3);font-size:small;font-weight:700;height:23px!important;line-height:inherit;min-height:23px!important;overflow:hidden;padding:0 10px;text-overflow:ellipsis;white-space:nowrap}.error-border{border:1px solid #d32f2f!important;border-radius:2px}.cell-placeholder{color:var(--theme-color6)!important;cursor:default;font-family:Roboto,Helvetica,Arial,sans-serif;font-size:.875rem;height:15px;opacity:1;overflow:hidden;text-transform:capitalize}.main-container{padding:10px}.cell-value{color:#000;font-family:Roboto,Helvetica,Arial,sans-serif;font-size:.875rem;height:15px}.ag-cell .MuiAutocomplete-root .MuiOutlinedInput-root{padding:0!important}.ag-cell .MuiOutlinedInput-root .MuiAutocomplete-input{padding:4.5px 4px 4.5px 5px}.ag-cell .MuiOutlinedInput-notchedOutline{border:none!important}");const hm=({rowIndex:e,agGridReact:t,data:i,node:r,...n})=>r.rowPinned?"":r.rowIndex+1,cm=e=>{let t;return t="string"==typeof e?Number(e.replace(/,/g,"")):e,Number.isNaN(t)?0:parseFloat(t.toFixed(Number(process.env.SYSTEM_DECIMAL_LENGTH)||3))},dm=e=>{let t=e.values.reduce(((e,t)=>e+cm(t)),0);return cm(t)},um=e=>{if(!e)return null;const t="string"==typeof e?j(e,"dd/MM/yyyy",new Date):new Date(e);return V(t)?t:null},Am=(e,t)=>{if(e){const i=e.current.getAllDisplayedColumns().filter((e=>{const{editable:i}=e.colDef;return"function"==typeof i?i(t):!0===i}));if(!i.length)return;return i[i.length-1]}},pm=(e,t)=>{if(e){const i=e.current.getAllDisplayedColumns().filter((e=>{const{editable:i}=e.colDef;return"function"==typeof i?i(t):!0===i}));if(!i.length)return;return i[0]}},fm=e=>{if(!e.current)return[];const t=[];return e.current.forEachNode((e=>t.push(e.data))),t},gm=async e=>{const t=fm(e);t.length>0&&(await e.current.applyTransaction({remove:t}),await e.current.applyTransaction({add:[{}]}))},mm=(e,t)=>{X(e)?(t.api.getRowNode(t.node.id)?.setRowHeight(30),t.api.onRowHeightChanged()):(t.api.getRowNode(t.node.id)?.setRowHeight(45),t.api.onRowHeightChanged())},wm=e=>isNaN(e)?0:`₹ ${e.toFixed(2)}`,bm=(e,t,i)=>("string"==typeof e&&(e=j(e,"dd/MM/yyyy",new Date)),"string"==typeof t&&(t=j(t,"dd/MMM/yyyy",new Date)),i?.ignoreTime&&(e=new Date(e).setHours(0,0,0,0),t=new Date(t).setHours(0,0,0,0)),M(e,t)),vm=(e,t,i="")=>{const r=[...(e.data.errors||[]).filter((e=>e.field!==t)),{field:t,message:i}];e.setData({...e.data,errors:r})},ym=async e=>{const{context:t,node:i,api:r}=e,n=[];if(r.forEachNode((e=>n.push(e.data))),1===n.length)await t.MessageBox({messageTitle:"Delete Row",message:"You can not delete last row.",icon:"ERROR",buttonNames:["Ok"]});else{"Yes"===await t.MessageBox({messageTitle:"confirmation",message:"Are you sure want to delete row ?",buttonNames:["Yes","No"],defFocusBtnName:"Yes",icon:"CONFIRM"})&&(r.applyTransaction({remove:[i.data]}),t.updatePinnedBottomRow())}},Bm=d(((r,n)=>{const{value:s,colDef:{cellEditorParams:a,field:h,name:d},node:u,onValueChange:p,api:f,context:g}=r,{postValidationSetCrossAccessorValues:m=()=>{}}=a||{},w=o(null),b=o(-1),[v,y]=c(!1),[B,C]=c([]),[x,F]=c(!0);l((()=>{let e=r.context.state?.[h]||[];e?.length?(C(e),F(!1)):(async()=>{if("function"==typeof a?.options){F(!0);try{const e=await a.options();r.context.updateState(h,e),C(e||[])}catch(e){C([])}finally{F(!1)}}})()}),[]);const N=()=>!s||"object"==typeof s&&X(s)?null:B.find((e=>e.value===s?.value||e.value===s))||null,[S,E]=c(N());l((()=>{E(N())}),[B]);const T=(e,t)=>{if(t){E(t);const e={...u.data,[h]:t?.value,[d]:t?.label};u.setData(e),p(t?.value)}};A(n,(()=>({getValue:()=>S?S.value:null})));const L=async e=>{y(!1),"function"==typeof m&&await m(S,u,f,h,p,g),-1!==b.current&&B[b.current]&&(await T(0,B[b.current]),"function"==typeof m&&await m(B[b.current],u,f,h,p,g))},k=()=>{if(X(s)){const e={...u.data,[h]:void 0};u.setData(e),p(void 0),E(void 0)}y(!0)};if(l((()=>{w.current&&w.current.focus()}),[]),u?.rowPinned)return null;const D=u.data?.errors?.find((e=>e.field===h));return i(t,{children:[e(Le,{id:"item-cell-editor",value:S,onChange:T,options:B,loading:x,getOptionLabel:e=>e.label,isOptionEqualToValue:(e,t)=>e.value===t?.value,open:v,onOpen:()=>y(!0),onClose:()=>y(!1),onHighlightChange:(e,t)=>{b.current="mousemove"!==e?.type?B.indexOf(t):-1},sx:{padding:"0px"},renderInput:r=>e(Me,{...r,variant:"outlined",inputRef:w,onFocus:k,onClick:k,onBlur:L,placeholder:"Select an option",InputProps:{...r.InputProps,endAdornment:i(t,{children:[x?e(be,{color:"inherit",size:20}):null,r.InputProps.endAdornment]})}}),fullWidth:!0}),Z(u.data?.errors)&&D?e(pe,{title:G(D.message),arrow:!0,children:e(we,{style:{marginTop:"0px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},error:!0,children:G(D.message)})}):null]})})),Cm=d(((t,i)=>{const{value:r,node:n,colDef:s={},api:a,context:o={}}=t,{cellRendererParams:l={},shouldExclude:h}=s,{disabled:c=!1,handleButtonClick:d=()=>{},buttonName:u="Remove"}=l;A(i,(()=>({getValue:()=>r})));const p="function"==typeof c?c(t):c;if(n?.rowPinned)return null;const f="function"==typeof h&&h(t),g="function"==typeof u?u(t):u;return f?null:e(ae,{fullWidth:!0,variant:"contained",color:"secondary",style:{height:"23px",backgroundColor:p?"var(--theme-color7) !important":"var(--theme-color1) !important"},onClick:async()=>{await d(t)},disabled:p,children:g})})),xm=d(((r,n)=>{const{value:s,colDef:{field:a,cellEditorParams:h},node:d,api:u,onValueChange:p,context:f}=r,{postValidationSetCrossAccessorValues:g}=h||{},{commonDateFormat:m="dd/MM/yyyy"}=Ws(),[w,b]=c((()=>{const e=um(s);return V(e)?e:null})),v=o(null);A(n,(()=>({getValue:()=>w?z(w,m):""}))),l((()=>{v.current&&setTimeout((()=>{v.current?.focus()}),0)}),[]),l((()=>{if(!s){const e=new Date;b(e);const t=z(e,m),i={...d.data,[a]:t};d.setData(i),p?.(t)}}),[s]);if(d?.rowPinned)return null;const y=d.data?.errors?.find((e=>e.field===a));return i(t,{children:[e(tr,{dateAdapter:Qi,children:e(ir,{defaultValue:new Date,format:"dd/MM/yyyy",value:w,onChange:e=>{if(!e||!V(e)){const e=new Date;b(e);const t=z(e,m),i={...d.data,[a]:t};return d.setData(i),void p?.(t)}b(e);const t=z(e,m),i={...d.data,[a]:t};d.setData(i),p?.(t)},slotProps:{textField:{onBlur:async()=>{"function"==typeof g&&await g(w,d,u,a,p,f)},variant:"outlined",fullWidth:!0,size:"small",inputRef:v}},sx:{"& input":{border:"none",padding:"4px 4px",textAlign:"center"},"& fieldset":{border:"none"}}})}),Z(d.data?.errors)&&y?e(pe,{title:G(y.message),arrow:!0,children:e(we,{style:{marginTop:"0px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},error:!0,children:G(y.message)})}):null]})})),Fm=({fieldError:t})=>{const{i18n:i}=ne();return e(ki,{title:i.t(t.message),arrow:!0,children:e("span",{style:{display:"block",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",color:"#d32f2f",fontSize:"0.75rem",marginTop:"7px",cursor:"pointer"},children:i.t(t.message)})})},Nm=d(((r,n)=>{const{value:s="",colDef:{cellEditorParams:{postValidationSetCrossAccessorValues:a=()=>{},uppercase:h=!1,defaultValue:d="",isNumber:u=!1,inputProps:p={},allowNegative:f=!0,allowLeadingZeros:g=!0,isAllowed:m=()=>!0,allowAlphaNumeric:w=!1}={},field:b,alignment:v="left"},node:y,api:B,onValueChange:C,context:x}=r,[F,N]=c(s),S=o(null),[E,T]=c(!1);A(n,(()=>({getValue:()=>F}))),l((()=>{S.current&&setTimeout((()=>{S.current?.select()}),0)}),[]);const L=y.data?.errors?.find((e=>e.field===b));return i(t,{children:[e(Me,{defaultValue:d,variant:"outlined",fullWidth:!0,size:"small",value:F,inputRef:S,onFocus:()=>{S.current?.select(),y.setDataValue("disableChequeDate",void 0)},InputProps:{...p,endAdornment:E?e(be,{size:20,color:"secondary"}):null},sx:{"& input":{textAlign:v,border:"none",padding:"4px 4px"},"& fieldset":{border:"none"}},onChange:e=>{let t=e.target.value;if(u){if(t=t.replace(/[^0-9.\- ]/g,""),(t.match(/\./g)||[]).length>1)return;if(!f&&t.startsWith("-"))return;g||(t=t.replace(/^0+/,""))}else w||(t=t.replace(/[^a-zA-Z ]/g,""));if(h&&(t=t.toUpperCase()),m&&!m({value:t}))return;N(t);const i={...y.data,[b]:t};y.setData(i),C?.(t)},onBlur:async e=>{e.preventDefault(),"function"==typeof a&&await a(F,y,B,b,C,x)}}),Z(y.data?.errors)&&L?e(pe,{title:G(L.message),arrow:!0,children:e(we,{style:{marginTop:"0px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},error:!0,children:G(L.message)})}):null]})})),Sm={autocomplete:Bm,CustomButtonCellEditor:Cm,amountField:r=>{const{value:n=0,colDef:{cellEditorParams:{postValidationSetCrossAccessorValues:s,maxLength:a},field:h},node:d,api:u,onValueChange:A,context:p}=r,[f,g]=c(n),[m,w]=c(!1),{dynamicAmountSymbol:b}=Ws(),v=o(null);l((()=>{v.current&&setTimeout((()=>{v.current?.select()}),0)}),[]);if(d?.rowPinned)return null;const y=d.data?.errors?.find((e=>e.field===h));return i(t,{children:[e(Ht,{value:f,thousandSeparator:!0,decimalScale:2,fixedDecimalScale:!0,allowNegative:!1,customInput:Me,variant:"outlined",fullWidth:!0,size:"small",inputRef:v,onFocus:()=>{v.current&&v.current.select()},onValueChange:e=>{g(e.floatValue);const t={...d.data,[h]:e.floatValue};d.setData(t),A(e.floatValue)},onBlur:async()=>{"function"==typeof s&&await s(f,d,u,h,A,p)},sx:{"& input":{textAlign:"right",border:"none",padding:"4px 4px"},"& fieldset":{border:"none"}},InputProps:{style:{textAlign:"right"},startAdornment:e(ge,{position:"start",children:sl(b)}),endAdornment:e(ge,{position:"end",children:m&&e(be,{color:"secondary",size:20})})},valueIsNumericString:!1,isAllowed:e=>{const{value:t}=e;return void 0===t||(!a||t.length<=a)}}),Z(d.data?.errors)&&y?e(pe,{title:G(y.message),arrow:!0,children:e(we,{style:{marginTop:"0px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},error:!0,children:G(y.message)})}):null]})},NumberFormat:Nm,DatePickerCell:xm,DisplayCurrencyCell:t=>{const{dynamicAmountSymbol:r,decimalCount:n,currencyFormat:s}=Ws(),a=qd(isNaN(t.value)?0:parseFloat(t.value||"0"),sl(r),s,n),o="function"==typeof t.colDef.editable?t.colDef.editable(t):t.colDef.editable;if(l((()=>{t.eGridCell&&(t.eGridCell.style.backgroundColor=o?"transparent":"var(--theme-color7)")}),[o,t.eGridCell]),t.node?.rowPinned)return t.value??null;const h=t.node?.data?.errors||[],c=h.find((e=>e.field===t.colDef.field));h&&mm(h,t);return"function"==typeof t?.colDef?.shouldExclude&&t?.colDef?.shouldExclude(t)?null:e("div",{style:{display:"flex",flexDirection:"column"},children:e("span",{children:t.value||!X(c?.message)?i("div",{style:{display:"flex",flexDirection:"column"},children:[e("span",{className:"cell-value",children:t.value?a:""}),!X(c?.message)&&e(Fm,{fieldError:c})]}):e("span",{className:"cell-placeholder",children:"₹0.00"})})})},DisplayDateCell:t=>{const r=t.node?.data?.errors||[],n=r.find((e=>e.field===t.colDef.field));r&&mm(r,t);const s="function"==typeof t.colDef.editable?t.colDef.editable(t):t.colDef.editable;if(l((()=>{t.eGridCell&&(t.eGridCell.style.backgroundColor=s?"transparent":"var(--theme-color7)")}),[s,t.eGridCell]),t.node?.rowPinned)return t.value??null;return"function"==typeof t?.colDef?.shouldExclude&&t?.colDef?.shouldExclude(t)?null:e("div",{style:{display:"flex",flexDirection:"column"},children:e("span",{children:t.value||!X(n?.message)?i("div",{style:{display:"flex",flexDirection:"column"},children:[e("span",{className:"cell-value",children:t.value}),!X(n?.message)&&e(Fm,{fieldError:n})]}):e("span",{className:"cell-placeholder",children:t.colDef?.headerName})})})},DisplaySelectCell:t=>{const{value:r,colDef:{cellEditorParams:n,field:s,editable:a,headerName:o,name:h},node:c,context:d}=t,u=c?.data?.errors||[],A=u.find((e=>e.field===s));u&&mm(u,t);const p="function"==typeof a?a(t):a;if(l((()=>{let e=d.state?.[s]||[];if(X(e))(async()=>{if("function"==typeof n?.options){const e=await n.options();d.updateState(s,e);const t=e.find((e=>e?.value===r));t&&c.setData({...c.data,[h]:t?.label})}})();else{const t=e.find((e=>e?.value===r));t&&c.setData({...c.data,[h]:t?.label})}}),[]),l((()=>{t.eGridCell&&(t.eGridCell.style.backgroundColor=p?"transparent":"var(--theme-color7)")}),[p,t.eGridCell]),c?.rowPinned)return r||!1;return"function"==typeof t?.colDef?.shouldExclude&&t?.colDef?.shouldExclude(t)?null:e("div",{style:{display:"flex",flexDirection:"column"},children:e("span",{children:c.data?.[h]||r||!X(A?.message)?i("div",{style:{display:"flex",flexDirection:"column"},children:[e("span",{className:"cell-value",children:c.data?.[h]||r}),!X(A?.message)&&e(Fm,{fieldError:A})]}):e("span",{className:"cell-placeholder",children:o})})})},DisplayCell:t=>{const r=t.node?.data?.errors||[],n=r.find((e=>e.field===t.colDef.field));r&&mm(r,t);const s="function"==typeof t.colDef.editable?t.colDef.editable(t):t.colDef.editable;if(l((()=>{t.eGridCell&&(t.eGridCell.style.backgroundColor=s?"transparent":"var(--theme-color7)")}),[s,t.eGridCell]),t.node?.rowPinned)return t.value??null;return"function"==typeof t?.colDef?.shouldExclude&&t?.colDef?.shouldExclude(t)?null:e("div",{style:{display:"flex",flexDirection:"column"},children:e("span",{children:t.value||!X(n?.message)?i("div",{style:{display:"flex",flexDirection:"column"},children:[e("span",{className:"cell-value",children:t?.value}),!X(n?.message)&&e(Fm,{fieldError:n})]}):e("span",{className:"cell-placeholder",children:t.colDef?.headerName})})})}},Em={abortEarly:!1,strict:!1},Tm=(e,t,i)=>async(t,i,r)=>{try{await e.validate(t,Em);const n=(i.data.errors||[]).filter((e=>e.field!==r));i.setData({...i.data,errors:n})}catch(e){const t=[...(i.data.errors||[]).filter((e=>e.field!==r)),{field:r,message:e.message}];return i.setData({...i.data,errors:t}),e instanceof R.ValidationError?e.errors[0]:e.message}};const Lm=t=>{const{agGridProps:{columnDefs:i,rowData:n,id:d,onCellValueChanged:u=()=>{}},loading:A,defaultView:p,updatePinnedBottomRow:f=()=>{},handleCustomCellKeyDown:g,handleAddNewRow:m}=t,{i18n:w}=ne(),b=o(),[v,y]=c(d),B=a((()=>function(e,t){return e.map((e=>{const{accessor:i,columnName:r,componentType:n,FormatProps:s,className:a,hide:o,displayComponentType:l,headerTooltip:h,postValidationSetCrossAccessorValues:c,isVisible:d,options:u,isReadOnly:A,...p}=e;return{headerName:`${t.t(r)}`,headerTooltip:`${t.t(h)}`,headerValueGetter:()=>t.t(r),field:i,cellEditor:n||void 0,cellEditorParams:{postValidationSetCrossAccessorValues:c,...s,options:u},className:a,hide:!1===d&&!d,cellRenderer:l||"DisplayCell",cellStyle:t=>e.alignment?{textAlign:e.alignment}:{textAlign:"left"},..."agCheckboxCellEditor"===n&&{onCellValueChanged:async e=>{"function"==typeof c&&await c(e)}},editable:t=>{const i=t.context?.gridContext?.mode??"new",r={edit:e.__EDIT__,view:e.__VIEW__,new:e.__NEW__}[i.toLowerCase()];return"function"==typeof r?.isReadOnly?!r.isReadOnly(t):"function"==typeof A?!A(t):"boolean"==typeof r?.isReadOnly?!r.isReadOnly:"boolean"!=typeof A||!A},...p}}))}(i,w)),[i,w]),{MessageBox:C}=id(),{setGridData:x}=s(Dm),F=(e=>{const[t,i]=c({});return{...e,state:t,updateState:r.useCallback(((e,t)=>{i((i=>({...i,[e]:t})))}),[])}})({MessageBox:C,updatePinnedBottomRow:f,gridContext:t?.gridContext}),N=h((e=>{const{api:i}=e;b.current=i,i.autoSizeAllColumns(),t.getGridApi&&(t.getGridApi.current=i)}),[t.getGridApi]),S=h((e=>{const{api:i}=e;if(i.autoSizeAllColumns(),f(),t.autoSelectFirst){i.deselectAll();let e=i.getRowNode(0);e?.setSelected(!0,!0)}}),[t.autoSelectFirst]),E=a((()=>Sm),[]);return l((()=>{y(d||`table-${String(1e17*Math.random()).substring(0,15)}`)}),[d]),l((()=>{b.current&&(A?b.current.showLoadingOverlay():(b.current.hideOverlay(),n?.length||b.current.showNoRowsOverlay()))}),[A,b.current,n]),l((()=>{const e=()=>{b.current&&setTimeout((()=>{b?.current.sizeColumnsToFit()}),100)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[b]),l((()=>{b.current&&(b.current?.refreshHeader(),b.current.redrawRows())}),[w.language]),{gridApi:b,tableId:v,allColumns:B,gridContext:F,onGridReady:N,onFirstDataRendered:S,onCellKeyDown:async e=>{const{event:t,column:{colDef:i},api:r,node:n}=e;if("new"!==p)return;if("Tab"===t.key&&t.shiftKey)return;if("Tab"!==t.key&&"Enter"!==t.key)return;const s=Am(b,e),a=pm(b,e);if("function"==typeof g&&await g(e,s),"Enter"===t.key&&t.shiftKey)setTimeout((()=>{r.tabToPreviousCell()}),50);else if(i.field===s.colDef?.field){const e=r.getDisplayedRowCount(),t=!!r.getRowNode(e-1)?.data&&Object.values(r.getRowNode(e-1).data).every((e=>null==e||""===e)),i=n.rowIndex+1;t||e!==i||("function"==typeof m?m():b.current.applyTransaction({add:[{}]}),setTimeout((()=>{r.setFocusedCell(n.rowIndex+1,a?.colDef?.field),b.current.startEditingCell({rowIndex:n.rowIndex+1,colKey:a?.colDef?.field})}),50))}else setTimeout((()=>{"Enter"===t.key&&r.tabToNextCell()}),50)},onAddClick:()=>{"function"==typeof m?m():b.current.applyTransaction({add:[{}]});const e=[];b.current.forEachNode((t=>e.push(t.data)));const t={node:{data:e[e?.length-1]}},i=b.current.getAllDisplayedColumns().filter((e=>e.colDef?.cellEditorParams?.isFieldFocused))?.[0],r=pm(b,t);setTimeout((()=>{b.current.setFocusedCell(e.length-1,i?i?.colDef?.field:r?.colDef?.field),b.current.startEditingCell({rowIndex:e.length-1,colKey:i?i?.colDef?.field:r?.colDef?.field}),"function"==typeof f&&f()}),100)},components:E,onCellEditingStopped:async e=>{const{colDef:{field:t,schemaValidation:i,validate:r},node:n,api:s,value:a}=e,o=a??n?.data[t];if(x((e=>e.map(((e,i)=>i===n.rowIndex?{...e,[t]:o}:e)))),i){const e=(e=>{if(void 0===e)return;const{type:t,rules:i}=e;if(!R[t])return;if(!Array.isArray(i))return;let r=R[t]();return i.forEach((e=>{const{params:t,name:i}=e;r[i]&&(r=r[i](...t))})),Tm(r)})(i);e&&await e(o,n,t)}if(r){const i=r(e);if(i){const e=[...(n.data.errors||[]).filter((e=>e.field!==t)),{field:t,message:i}];n.setData({...n.data,errors:e})}else{const e=(n.data.errors||[]).filter((e=>e.field!==t));n.setData({...n.data,errors:e})}}},noDataComponent:()=>e("span",{style:{fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:w.t("NoDataFound")}),onCellValueChanged:u,i18n:w}},km=({buttons:i})=>i&&0!==i.length?e(t,{children:i.map(((t,i)=>e(za,{onClick:t.onClick,disabled:t.disabled,...t,children:t.label},i)))}):null;fr.registerModules([gr,mr,wr,br]);const Dm=n({gridData:[],setGridData:e=>{}}),Im=r.memo((t=>{const[r,n]=c(t.agGridProps.rowData||[]),{tableId:s,allColumns:a,gridContext:o,onGridReady:l,onFirstDataRendered:h,onCellKeyDown:d,onAddClick:u,components:A,onCellEditingStopped:p,noDataComponent:f,i18n:g,onCellValueChanged:m}=Lm({...t});t={...t,defaultColDef:{...t.defaultColDef,flex:1,suppressMovable:!0,unSortIcon:!0,resizable:!0,suppressSizeToFit:!0,onCellValueChanged:m}};const{hideHeader:w=!1,agGridProps:b={},defaultView:v="new",gridConfig:y={},buttons:B=[],isNewButtonVisible:C=!0,newButtonLabel:x}=t;return e(Dm.Provider,{value:{gridData:r,setGridData:n},children:i("div",{className:"main-container",children:[!w&&i(Ie,{style:{paddingLeft:"24px",paddingRight:"24px",background:"var(--primary-bg)",borderTopLeftRadius:"4px",borderTopRightRadius:"4px",minHeight:"48px",height:"48px",display:"flex",justifyContent:"space-between"},children:[i(fe,{style:{color:"var(--white)",fontWeight:"500",fontSize:"1.5rem !important",lineHeight:"1.6 !important",letterSpacing:"0.0075em !important"},color:"inherit",variant:"h6",children:[y.gridLabel," ",t.subLabel]}),i("div",{children:[C&&i(za,{onClick:u,children:[" ",x?g.t(x):g.t("new")]}),e(km,{buttons:B})]})]}),e("div",{className:"ag-theme-alpine custom-grid",style:{height:t.height||"400px",width:"100%"},children:e(vr,{onGridReady:l,...b,columnDefs:a,onFirstDataRendered:h,context:{...o,gridData:r,setGridData:n},rowData:X(r)?t.agGridProps?.rowData:r,rowHeight:30,headerHeight:35,onCellKeyDown:d,suppressClickEdit:!C,suppressCellFocus:!C,suppressHeaderFocus:!0,components:A,onCellEditingStopped:p,suppressMovableColumns:!0,noRowsOverlayComponent:f},s)})]})})})),Um=(e,t)=>isNaN(new Date(e)?.getTime())?e:z(new Date(e),t),Pm=(e,t,i)=>{if(!e||!Array.isArray(e))return"-";return qd(e.reduce(((e,i)=>{const r=Number(i[t.accessor]??0);return e+(isNaN(r)?0:r)}),0),t?.isVisibleCurrSymbol?sl(t?.currencySymbol??i.dynamicAmountSymbol):"",t?.currencyFormat??i.currencyFormat,t?.decimalCount??i.decimalCount,t?.symbolPosition??"start")},Om=(e,t)=>(e.data?e.data.reduce(((e,i)=>{const r=Number(i[t.accessor]||0);return e+(isNaN(r)?0:r)}),0):0)+(e.groups?e.groups.reduce(((e,i)=>e+Om(i,t)),0):0);Ka(".layout-report-parent td{padding:6px 10px!important}.layout-report-parent thead tr{background:var(--theme-color4)}.layout-report-parent .group-name{align-items:center;display:flex;white-space:nowrap}.layout-report-parent .footer-row{background-color:var(--theme-color4)}.layout-report-parent .footer-row td{color:var(--theme-color1);font-size:.875rem;font-weight:600!important;white-space:nowrap}.layout-report-parent .footer-row.p0 td{padding:0!important}");function Rm(e){return()=>e}function Qm(e){e()}function Hm(e,t){return i=>e(t(i))}function Mm(e,t){return()=>e(t)}function _m(e){return void 0!==e}function jm(){}function zm(e,t){return t(e),e}function Vm(e,t){return t(e)}function Km(...e){return e}function qm(e,t){return e(1,t)}function Gm(e,t){e(0,t)}function Wm(e){e(2)}function Jm(e){return e(4)}function Xm(e,t){return qm(e,function(e,t){return i=>e(t,i)}(t,0))}function Ym(e,t){const i=e(1,(e=>{i(),t(e)}));return i}function $m(e){let t,i;return r=>n=>{t=n,i&&clearTimeout(i),i=setTimeout((()=>{r(t)}),e)}}function Zm(e,t){return e===t}function ew(e=Zm){let t;return i=>r=>{e(t,r)||(t=r,i(r))}}function tw(e){return t=>i=>{e(i)&&t(i)}}function iw(e){return t=>Hm(t,e)}function rw(e){return t=>()=>{t(e)}}function nw(e,...t){const i=function(...e){return t=>e.reduceRight(Vm,t)}(...t);return(t,r)=>{switch(t){case 2:return void Wm(e);case 1:return qm(e,i(r))}}}function sw(e,t){return i=>r=>{i(t=e(t,r))}}function aw(e){return t=>i=>{e>0?e--:t(i)}}function ow(e){let t,i=null;return r=>n=>{i=n,!t&&(t=setTimeout((()=>{t=void 0,r(i)}),e))}}function lw(...e){const t=new Array(e.length);let i=0,r=null;const n=Math.pow(2,e.length)-1;return e.forEach(((e,s)=>{const a=Math.pow(2,s);qm(e,(e=>{const o=i;i|=a,t[s]=e,o!==n&&i===n&&r&&(r(),r=null)}))})),e=>s=>{const a=()=>{e([s].concat(t))};i===n?a():r=a}}function hw(e){let t=e;const i=dw();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return i(e,r)}}function cw(e,t){return zm(hw(t),(t=>Xm(e,t)))}function dw(){const e=[];return(t,i)=>{switch(t){case 0:return void e.slice().forEach((e=>{e(i)}));case 2:return void e.splice(0,e.length);case 1:return e.push(i),()=>{const t=e.indexOf(i);t>-1&&e.splice(t,1)}}}}function uw(e){return zm(dw(),(t=>Xm(e,t)))}function Aw(e,t=[],{singleton:i}={singleton:!0}){return{constructor:e,dependencies:t,id:pw(),singleton:i}}const pw=()=>Symbol();function fw(...e){const t=dw(),i=new Array(e.length);let r=0;const n=Math.pow(2,e.length)-1;return e.forEach(((e,s)=>{const a=Math.pow(2,s);qm(e,(e=>{i[s]=e,r|=a,r===n&&Gm(t,i)}))})),function(e,s){switch(e){case 2:return void Wm(t);case 1:return r===n&&s(i),qm(t,s)}}}function gw(e,t=Zm){return nw(e,ew(t))}function mw(...e){return function(t,i){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(Qm)}}(...e.map((e=>qm(e,i))))}}}var ww=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(ww||{});const bw={0:"debug",3:"error",1:"log",2:"warn"},vw=Aw((()=>{const e=hw(3);return{log:hw(((t,i,r=1)=>{var n;r>=(null!=(n=(typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL)?n:Jm(e))&&console[bw[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,i)})),logLevel:e}}),[],{singleton:!0});function yw(e,t,i){return Bw(e,t,i).callbackRef}function Bw(e,t,i){const n=r.useRef(null);let s=e=>{};const a=r.useMemo((()=>typeof ResizeObserver<"u"?new ResizeObserver((t=>{const r=()=>{const i=t[0].target;null!==i.offsetParent&&e(i)};i?r():requestAnimationFrame(r)})):null),[e,i]);return s=e=>{e&&t?(null==a||a.observe(e),n.current=e):(n.current&&(null==a||a.unobserve(n.current)),n.current=null)},{callbackRef:s,ref:n}}function Cw(e,t,i,n,s,a,o,l,h){const c=r.useCallback((i=>{const r=function(e,t,i,r){const n=e.length;if(0===n)return null;const s=[];for(let a=0;a<n;a++){const n=e.item(a);if(void 0===n.dataset.index)continue;const o=parseInt(n.dataset.index),l=parseFloat(n.dataset.knownSize),h=t(n,i);if(0===h&&r("Zero-sized element, this should not happen",{child:n},ww.ERROR),h===l)continue;const c=s[s.length-1];0===s.length||c.size!==h||c.endIndex!==o-1?s.push({endIndex:o,size:h,startIndex:o}):s[s.length-1].endIndex++}return s}(i.children,t,"offsetHeight",s);let a=i.parentElement;for(;!a.dataset.virtuosoScroller;)a=a.parentElement;const l="window"===a.lastElementChild.dataset.viewportType;let h;l&&(h=a.ownerDocument.defaultView);const c=o?o.scrollTop:l?h.scrollY||h.document.documentElement.scrollTop:a.scrollTop,d=o?o.scrollHeight:l?h.document.documentElement.scrollHeight:a.scrollHeight,u=o?o.offsetHeight:l?h.innerHeight:a.offsetHeight;n({scrollHeight:d,scrollTop:Math.max(c,0),viewportHeight:u}),null!==r&&e(r)}),[e,t,s,a,o,n,l]);return Bw(c,i,h)}function xw(e,t,i){const n=r.useRef(null),s=r.useCallback((i=>{if(null==i||!i.offsetParent)return;const r=i.getBoundingClientRect(),s=r.width;let a,l;if(t){const e=t.getBoundingClientRect(),i=r.top-e.top;l=e.height-Math.max(0,i),a=i+t.scrollTop}else{const e=o.current.ownerDocument.defaultView;l=e.innerHeight-Math.max(0,r.top),a=r.top+e.scrollY}n.current={offsetTop:a,visibleHeight:l,visibleWidth:s},e(n.current)}),[e,t]),{callbackRef:a,ref:o}=Bw(s,!0,i),l=r.useCallback((()=>{s(o.current)}),[s,o]);return r.useEffect((()=>{var e;if(t){t.addEventListener("scroll",l);const e=new ResizeObserver((()=>{requestAnimationFrame(l)}));return e.observe(t),()=>{t.removeEventListener("scroll",l),e.unobserve(t)}}{const t=null==(e=o.current)?void 0:e.ownerDocument.defaultView;return null==t||t.addEventListener("scroll",l),null==t||t.addEventListener("resize",l),()=>{null==t||t.removeEventListener("scroll",l),null==t||t.removeEventListener("resize",l)}}}),[l,t,o]),a}const Fw=Aw((()=>{const e=dw(),t=dw(),i=hw(0),r=dw(),n=hw(0),s=dw(),a=dw(),o=hw(0),l=hw(0),h=hw(0),c=hw(0),d=dw(),u=dw(),A=hw(!1),p=hw(!1),f=hw(!1);return Xm(nw(e,iw((({scrollTop:e})=>e))),t),Xm(nw(e,iw((({scrollHeight:e})=>e))),a),Xm(t,n),{deviation:i,fixedFooterHeight:h,fixedHeaderHeight:l,footerHeight:c,headerHeight:o,horizontalDirection:p,scrollBy:u,scrollContainerState:e,scrollHeight:a,scrollingInProgress:A,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:f,smoothScrollTargetReached:r,statefulScrollTop:n,viewportHeight:s}}),[],{singleton:!0}),Nw={lvl:0};function Sw(e,t){const i=e.length;if(0===i)return[];let{index:r,value:n}=t(e[0]);const s=[];for(let a=1;a<i;a++){const{index:i,value:o}=t(e[a]);s.push({end:i-1,start:r,value:n}),r=i,n=o}return s.push({end:1/0,start:r,value:n}),s}function Ew(e){return e===Nw}function Tw(e,t){if(!Ew(e))return t===e.k?e.v:t<e.k?Tw(e.l,t):Tw(e.r,t)}function Lw(e,t,i="k"){if(Ew(e))return[-1/0,void 0];if(Number(e[i])===t)return[e.k,e.v];if(Number(e[i])<t){const r=Lw(e.r,t,i);return r[0]===-1/0?[e.k,e.v]:r}return Lw(e.l,t,i)}function kw(e,t,i){return Ew(e)?jw(t,i,1):t===e.k?Qw(e,{k:t,v:i}):t<e.k?zw(Qw(e,{l:kw(e.l,t,i)})):zw(Qw(e,{r:kw(e.r,t,i)}))}function Dw(){return Nw}function Iw(e,t,i){if(Ew(e))return[];return function(e){return Sw(e,(({k:e,v:t})=>({index:e,value:t})))}(Ow(e,Lw(e,t)[0],i))}function Uw(e,t){if(Ew(e))return Nw;const{k:i,l:r,r:n}=e;if(t===i){if(Ew(r))return n;if(Ew(n))return r;{const[t,i]=_w(r);return Rw(Qw(e,{k:t,l:Hw(r),v:i}))}}return Rw(Qw(e,t<i?{l:Uw(r,t)}:{r:Uw(n,t)}))}function Pw(e){return Ew(e)?[]:[...Pw(e.l),{k:e.k,v:e.v},...Pw(e.r)]}function Ow(e,t,i){if(Ew(e))return[];const{k:r,l:n,r:s,v:a}=e;let o=[];return r>t&&(o=o.concat(Ow(n,t,i))),r>=t&&r<=i&&o.push({k:r,v:a}),r<=i&&(o=o.concat(Ow(s,t,i))),o}function Rw(e){const{l:t,lvl:i,r:r}=e;if(r.lvl>=i-1&&t.lvl>=i-1)return e;if(i>r.lvl+1){if(Mw(t))return Vw(Qw(e,{lvl:i-1}));if(!Ew(t)&&!Ew(t.r))return Qw(t.r,{l:Qw(t,{r:t.r.l}),lvl:i,r:Qw(e,{l:t.r.r,lvl:i-1})});throw new Error("Unexpected empty nodes")}if(Mw(e))return Kw(Qw(e,{lvl:i-1}));if(Ew(r)||Ew(r.l))throw new Error("Unexpected empty nodes");{const t=r.l,n=Mw(t)?r.lvl-1:r.lvl;return Qw(t,{l:Qw(e,{lvl:i-1,r:t.l}),lvl:t.lvl+1,r:Kw(Qw(r,{l:t.r,lvl:n}))})}}function Qw(e,t){return jw(void 0!==t.k?t.k:e.k,void 0!==t.v?t.v:e.v,void 0!==t.lvl?t.lvl:e.lvl,void 0!==t.l?t.l:e.l,void 0!==t.r?t.r:e.r)}function Hw(e){return Ew(e.r)?e.l:Rw(Qw(e,{r:Hw(e.r)}))}function Mw(e){return Ew(e)||e.lvl>e.r.lvl}function _w(e){return Ew(e.r)?[e.k,e.v]:_w(e.r)}function jw(e,t,i,r=Nw,n=Nw){return{k:e,l:r,lvl:i,r:n,v:t}}function zw(e){return Kw(Vw(e))}function Vw(e){const{l:t}=e;return Ew(t)||t.lvl!==e.lvl?e:Qw(t,{r:Qw(e,{l:t.r})})}function Kw(e){const{lvl:t,r:i}=e;return Ew(i)||Ew(i.r)||i.lvl!==t||i.r.lvl!==t?e:Qw(i,{l:Qw(e,{r:i.l}),lvl:t+1})}function qw(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function Gw(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}const Ww=Aw((()=>({recalcInProgress:hw(!1)})),[],{singleton:!0});function Jw(e,t,i){return e[Xw(e,t,i)]}function Xw(e,t,i,r=0){let n=e.length-1;for(;r<=n;){const s=Math.floor((r+n)/2),a=i(e[s],t);if(0===a)return s;if(-1===a){if(n-r<2)return s-1;n=s-1}else{if(n===r)return s;r=s+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function Yw(e,t){return Math.round(e.getBoundingClientRect()[t])}function $w(e){return!Ew(e.groupOffsetTree)}function Zw({index:e},t){return t===e?0:t<e?-1:1}function eb({offset:e},t){return t===e?0:t<e?-1:1}function tb(e,t,i){if(0===t.length)return 0;const{index:r,offset:n,size:s}=Jw(t,e,Zw),a=e-r,o=s*a+(a-1)*i+n;return o>0?o+i:o}function ib(e,t){if(!$w(t))return e;let i=0;for(;t.groupIndices[i]<=e+i;)i++;return e+i}function rb(e,t,i){if(function(e){return typeof e.groupIndex<"u"}(e))return t.groupIndices[e.groupIndex]+1;{let r=ib("LAST"===e.index?i:e.index,t);return r=Math.max(0,r,Math.min(i,r)),r}}function nb(e,t,i,r=0){return r>0&&(t=Math.max(t,Jw(e,r,Zw).offset)),Sw(function(e,t,i,r){const n=Xw(e,t,r),s=Xw(e,i,r,n);return e.slice(n,s+1)}(e,t,i,eb),lb)}function sb(e,[t,i,r,n]){t.length>0&&r("received item sizes",t,ww.DEBUG);const s=e.sizeTree;let a=s,o=0;if(i.length>0&&Ew(s)&&2===t.length){const e=t[0].size,r=t[1].size;a=i.reduce(((t,i)=>kw(kw(t,i,e),i+1,r)),a)}else[a,o]=function(e,t){let i=Ew(e)?0:1/0;for(const r of t){const{endIndex:t,size:n,startIndex:s}=r;if(i=Math.min(i,s),Ew(e)){e=kw(e,0,n);continue}const a=Iw(e,s-1,t+1);if(a.some(hb(r)))continue;let o=!1,l=!1;for(const{end:i,start:r,value:s}of a)o?(t>=r||n===s)&&(e=Uw(e,r)):(l=s!==n,o=!0),i>t&&t>=r&&s!==n&&(e=kw(e,t+1,s));l&&(e=kw(e,s,n))}return[e,i]}(a,t);if(a===s)return e;const{lastIndex:l,lastOffset:h,lastSize:c,offsetTree:d}=ob(e.offsetTree,o,a,n);return{groupIndices:i,groupOffsetTree:i.reduce(((e,t)=>kw(e,t,tb(t,d,n))),Dw()),lastIndex:l,lastOffset:h,lastSize:c,offsetTree:d,sizeTree:a}}function ab(e,t){let i=0,r=0;for(;i<e;)i+=t[r+1]-t[r]-1,r++;return r-(i===e?0:1)}function ob(e,t,i,r){let n=e,s=0,a=0,o=0,l=0;if(0!==t){l=Xw(n,t-1,Zw),o=n[l].offset;const e=Lw(i,t-1);s=e[0],a=e[1],n.length&&n[l].size===Lw(i,t)[1]&&(l-=1),n=n.slice(0,l+1)}else n=[];for(const{start:e,value:l}of Iw(i,t,1/0)){const t=e-s,i=t*a+o+t*r;n.push({index:e,offset:i,size:l}),s=e,o=i,a=l}return{lastIndex:s,lastOffset:o,lastSize:a,offsetTree:n}}function lb(e){return{index:e.index,value:e}}function hb(e){const{endIndex:t,size:i,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===i}const cb={offsetHeight:"height",offsetWidth:"width"},db=Aw((([{log:e},{recalcInProgress:t}])=>{const i=dw(),r=dw(),n=cw(r,0),s=dw(),a=dw(),o=hw(0),l=hw([]),h=hw(void 0),c=hw(void 0),d=hw(((e,t)=>Yw(e,cb[t]))),u=hw(void 0),A=hw(0),p={groupIndices:[],groupOffsetTree:Dw(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Dw()},f=cw(nw(i,lw(l,e,A),sw(sb,p),ew()),p),g=cw(nw(l,ew(),sw(((e,t)=>({current:t,prev:e.current})),{current:[],prev:[]}),iw((({prev:e})=>e))),[]);Xm(nw(l,tw((e=>e.length>0)),lw(f,A),iw((([e,t,i])=>{const r=e.reduce(((e,r,n)=>kw(e,r,tb(r,t.offsetTree,i)||n)),Dw());return{...t,groupIndices:e,groupOffsetTree:r}}))),f),Xm(nw(r,lw(f),tw((([e,{lastIndex:t}])=>e<t)),iw((([e,{lastIndex:t,lastSize:i}])=>[{endIndex:t,size:i,startIndex:e}]))),i),Xm(h,c);const m=cw(nw(h,iw((e=>void 0===e))),!0);Xm(nw(c,tw((e=>void 0!==e&&Ew(Jm(f).sizeTree))),iw((e=>[{endIndex:0,size:e,startIndex:0}]))),i);const w=uw(nw(i,lw(f),sw((({sizes:e},[t,i])=>({changed:i!==e,sizes:i})),{changed:!1,sizes:p}),iw((e=>e.changed))));qm(nw(o,sw(((e,t)=>({diff:e.prev-t,prev:t})),{diff:0,prev:0}),iw((e=>e.diff))),(e=>{const{groupIndices:i}=Jm(f);if(e>0)Gm(t,!0),Gm(s,e+ab(e,i));else if(e<0){const t=Jm(g);t.length>0&&(e-=ab(-e,t)),Gm(a,e)}})),qm(nw(o,lw(e)),(([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:o},ww.ERROR)}));const b=uw(s);Xm(nw(s,lw(f),iw((([e,t])=>{const i=t.groupIndices.length>0,r=[],n=t.lastSize;if(i){const i=Tw(t.sizeTree,0);let s=0,a=0;for(;s<e;){const e=t.groupIndices[a],o=t.groupIndices.length===a+1?1/0:t.groupIndices[a+1]-e-1;r.push({endIndex:e,size:i,startIndex:e}),r.push({endIndex:e+1+o-1,size:n,startIndex:e+1}),a++,s+=o+1}const o=Pw(t.sizeTree);return s!==e&&o.shift(),o.reduce(((t,{k:i,v:r})=>{let n=t.ranges;return 0!==t.prevSize&&(n=[...t.ranges,{endIndex:i+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:i+e,prevSize:r,ranges:n}}),{prevIndex:e,prevSize:0,ranges:r}).ranges}return Pw(t.sizeTree).reduce(((t,{k:i,v:r})=>({prevIndex:i+e,prevSize:r,ranges:[...t.ranges,{endIndex:i+e-1,size:t.prevSize,startIndex:t.prevIndex}]})),{prevIndex:0,prevSize:n,ranges:[]}).ranges}))),i);const v=uw(nw(a,lw(f,A),iw((([e,{offsetTree:t},i])=>tb(-e,t,i)))));return Xm(nw(a,lw(f,A),iw((([e,t,i])=>{if(t.groupIndices.length>0){if(Ew(t.sizeTree))return t;let r=Dw();const n=Jm(g);let s=0,a=0,o=0;for(;s<-e;){o=n[a];const e=n[a+1]-o-1;a++,s+=e+1}if(r=Pw(t.sizeTree).reduce(((t,{k:i,v:r})=>kw(t,Math.max(0,i+e),r)),r),s!==-e){r=kw(r,0,Tw(t.sizeTree,o));r=kw(r,1,Lw(t.sizeTree,1-e)[1])}return{...t,sizeTree:r,...ob(t.offsetTree,0,r,i)}}{const r=Pw(t.sizeTree).reduce(((t,{k:i,v:r})=>kw(t,Math.max(0,i+e),r)),Dw());return{...t,sizeTree:r,...ob(t.offsetTree,0,r,i)}}}))),f),{beforeUnshiftWith:b,data:u,defaultItemSize:c,firstItemIndex:o,fixedItemSize:h,gap:A,groupIndices:l,itemSize:d,listRefresh:w,shiftWith:a,shiftWithOffset:v,sizeRanges:i,sizes:f,statefulTotalCount:n,totalCount:r,trackItemSizes:m,unshiftWith:s}}),Km(vw,Ww),{singleton:!0});function ub(e){return e.reduce(((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e)),{groupIndices:[],totalCount:0})}const Ab=Aw((([{groupIndices:e,sizes:t,totalCount:i},{headerHeight:r,scrollTop:n}])=>{const s=dw(),a=dw(),o=uw(nw(s,iw(ub)));return Xm(nw(o,iw((e=>e.totalCount))),i),Xm(nw(o,iw((e=>e.groupIndices))),e),Xm(nw(fw(n,t,r),tw((([e,t])=>$w(t))),iw((([e,t,i])=>Lw(t.groupOffsetTree,Math.max(e-i,0),"v")[0])),ew(),iw((e=>[e]))),a),{groupCounts:s,topItemsIndexes:a}}),Km(db,Fw)),pb=Aw((([{log:e}])=>{const t=hw(!1),i=uw(nw(t,tw((e=>e)),ew()));return qm(t,(t=>{t&&Jm(e)("props updated",{},ww.DEBUG)})),{didMount:i,propsReady:t}}),Km(vw),{singleton:!0}),fb=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function gb(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!fb)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const mb=Aw((([{gap:e,listRefresh:t,sizes:i,totalCount:r},{fixedFooterHeight:n,fixedHeaderHeight:s,footerHeight:a,headerHeight:o,scrollingInProgress:l,scrollTo:h,smoothScrollTargetReached:c,viewportHeight:d},{log:u}])=>{const A=dw(),p=dw(),f=hw(0);let g=null,m=null,w=null;function b(){g&&(g(),g=null),w&&(w(),w=null),m&&(clearTimeout(m),m=null),Gm(l,!1)}return Xm(nw(A,lw(i,d,r,f,o,a,u),lw(e,s,n),iw((([[e,i,r,n,s,a,o,h],d,u,f])=>{const v=gb(e),{align:y,behavior:B,offset:C}=v,x=n-1,F=rb(v,i,x);let N=tb(F,i.offsetTree,d)+a;"end"===y?(N+=u+Lw(i.sizeTree,F)[1]-r+f,F===x&&(N+=o)):"center"===y?N+=(u+Lw(i.sizeTree,F)[1]-r+f)/2:N-=s,C&&(N+=C);const S=t=>{b(),t?(h("retrying to scroll to",{location:e},ww.DEBUG),Gm(A,e)):(Gm(p,!0),h("list did not change, scroll successful",{},ww.DEBUG))};if(b(),"smooth"===B){let e=!1;w=qm(t,(t=>{e=e||t})),g=Ym(c,(()=>{S(e)}))}else g=Ym(nw(t,function(e){return t=>{const i=setTimeout((()=>{t(!1)}),e);return e=>{e&&(t(!0),clearTimeout(i))}}}(150)),S);return m=setTimeout((()=>{b()}),1200),Gm(l,!0),h("scrolling from index to",{behavior:B,index:F,top:N},ww.DEBUG),{behavior:B,top:N}}))),h),{scrollTargetReached:p,scrollToIndex:A,topListHeight:f}}),Km(db,Fw,vw),{singleton:!0});function wb(e,t){0==e?t():requestAnimationFrame((()=>{wb(e-1,t)}))}function bb(e,t){const i=t-1;return"number"==typeof e?e:"LAST"===e.index?i:e.index}const vb=Aw((([{defaultItemSize:e,listRefresh:t,sizes:i},{scrollTop:r},{scrollTargetReached:n,scrollToIndex:s},{didMount:a}])=>{const o=hw(!0),l=hw(0),h=hw(!0);return Xm(nw(a,lw(l),tw((([e,t])=>!!t)),rw(!1)),o),Xm(nw(a,lw(l),tw((([e,t])=>!!t)),rw(!1)),h),qm(nw(fw(t,a),lw(o,i,e,h),tw((([[,e],t,{sizeTree:i},r,n])=>e&&(!Ew(i)||_m(r))&&!t&&!n)),lw(l)),(([,e])=>{Ym(n,(()=>{Gm(h,!0)})),wb(4,(()=>{Ym(r,(()=>{Gm(o,!0)})),Gm(s,e)}))})),{initialItemFinalLocationReached:h,initialTopMostItemIndex:l,scrolledToInitialItem:o}}),Km(db,Fw,mb,pb),{singleton:!0});function yb(e,t){return Math.abs(e-t)<1.01}const Bb="up",Cb="down",xb={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Fb=Aw((([{footerHeight:e,headerHeight:t,scrollBy:i,scrollContainerState:r,scrollTop:n,viewportHeight:s}])=>{const a=hw(!1),o=hw(!0),l=dw(),h=dw(),c=hw(4),d=hw(0),u=cw(nw(mw(nw(gw(n),aw(1),rw(!0)),nw(gw(n),aw(1),rw(!1),$m(100))),ew()),!1),A=cw(nw(mw(nw(i,rw(!0)),nw(i,rw(!1),$m(200))),ew()),!1);Xm(nw(fw(gw(n),gw(d)),iw((([e,t])=>e<=t)),ew()),o),Xm(nw(o,ow(50)),h);const p=uw(nw(fw(r,gw(s),gw(t),gw(e),gw(c)),sw(((e,[{scrollHeight:t,scrollTop:i},r,n,s,a])=>{const o={scrollHeight:t,scrollTop:i,viewportHeight:r};if(i+r-t>-a){let t,r;return i>e.state.scrollTop?(t="SCROLLED_DOWN",r=e.state.scrollTop-i):(t="SIZE_DECREASED",r=e.state.scrollTop-i||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:o}}let l;return l=o.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":i<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:l,state:o}}),xb),ew(((e,t)=>e&&e.atBottom===t.atBottom)))),f=cw(nw(r,sw(((e,{scrollHeight:t,scrollTop:i,viewportHeight:r})=>{if(yb(e.scrollHeight,t))return{changed:!1,jump:0,scrollHeight:t,scrollTop:i};{const n=t-(i+r)<1;return e.scrollTop!==i&&n?{changed:!0,jump:e.scrollTop-i,scrollHeight:t,scrollTop:i}:{changed:!0,jump:0,scrollHeight:t,scrollTop:i}}}),{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),tw((e=>e.changed)),iw((e=>e.jump))),0);Xm(nw(p,iw((e=>e.atBottom))),a),Xm(nw(a,ow(50)),l);const g=hw(Cb);Xm(nw(r,iw((({scrollTop:e})=>e)),ew(),sw(((e,t)=>Jm(A)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?Bb:Cb,prevScrollTop:t}),{direction:Cb,prevScrollTop:0}),iw((e=>e.direction))),g),Xm(nw(r,ow(50),rw("none")),g);const m=hw(0);return Xm(nw(u,tw((e=>!e)),rw(0)),m),Xm(nw(n,ow(100),lw(u),tw((([e,t])=>!!t)),sw((([e,t],[i])=>[t,i]),[0,0]),iw((([e,t])=>t-e))),m),{atBottomState:p,atBottomStateChange:l,atBottomThreshold:c,atTopStateChange:h,atTopThreshold:d,isAtBottom:a,isAtTop:o,isScrolling:u,lastJumpDueToItemResize:f,scrollDirection:g,scrollVelocity:m}}),Km(Fw)),Nb="top",Sb="bottom",Eb="none";function Tb(e,t,i){return"number"==typeof e?i===Bb&&t===Nb||i===Cb&&t===Sb?e:0:i===Bb?t===Nb?e.main:e.reverse:t===Sb?e.main:e.reverse}function Lb(e,t){var i;return"number"==typeof e?e:null!=(i=e[t])?i:0}const kb=Aw((([{deviation:e,fixedHeaderHeight:t,headerHeight:i,scrollTop:r,viewportHeight:n}])=>{const s=dw(),a=hw(0),o=hw(0),l=hw(0),h=cw(nw(fw(gw(r),gw(n),gw(i),gw(s,Gw),gw(l),gw(a),gw(t),gw(e),gw(o)),iw((([e,t,i,[r,n],s,a,o,l,h])=>{const c=e-l,d=a+o,u=Math.max(i-c,0);let A=Eb;const p=Lb(h,Nb),f=Lb(h,Sb);return r-=l,n+=i+o,(r+=i+o)>e+d-p&&(A=Bb),(n-=l)<e-u+t+f&&(A=Cb),A!==Eb?[Math.max(c-i-Tb(s,Nb,A)-p,0),c-u-o+t+Tb(s,Sb,A)+f]:null})),tw((e=>null!=e)),ew(Gw)),[0,0]);return{increaseViewportBy:o,listBoundary:s,overscan:l,topListHeight:a,visibleRange:h}}),Km(Fw),{singleton:!0});const Db={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Ib(e,t,i,r,n,s){const{lastIndex:a,lastOffset:o,lastSize:l}=n;let h=0,c=0;if(e.length>0){h=e[0].offset;const t=e[e.length-1];c=t.offset+t.size}const d=i-a,u=h,A=o+d*l+(d-1)*r-c;return{bottom:c,firstItemIndex:s,items:Pb(e,n,s),offsetBottom:A,offsetTop:h,top:u,topItems:Pb(t,n,s),topListHeight:t.reduce(((e,t)=>t.size+e),0),totalCount:i}}function Ub(e,t,i,r,n,s){let a=0;if(i.groupIndices.length>0)for(const t of i.groupIndices){if(t-a>=e)break;a++}const o=e+a,l=bb(t,o);return Ib(Array.from({length:o}).map(((e,t)=>({data:s[t+l],index:t+l,offset:0,size:0}))),[],o,n,i,r)}function Pb(e,t,i){if(0===e.length)return[];if(!$w(t))return e.map((e=>({...e,index:e.index+i,originalIndex:e.index})));const r=e[0].index,n=e[e.length-1].index,s=[],a=Iw(t.groupOffsetTree,r,n);let o,l=0;for(const r of e){let e;(!o||o.end<r.index)&&(o=a.shift(),l=t.groupIndices.indexOf(o.start)),e=r.index===o.start?{index:l,type:"group"}:{groupIndex:l,index:r.index-(l+1)+i},s.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return s}const Ob=Aw((([{data:e,firstItemIndex:t,gap:i,sizes:r,totalCount:n},s,{listBoundary:a,topListHeight:o,visibleRange:l},{initialTopMostItemIndex:h,scrolledToInitialItem:c},{topListHeight:d},u,{didMount:A},{recalcInProgress:p}])=>{const f=hw([]),g=hw(0),m=dw();Xm(s.topItemsIndexes,f);const w=cw(nw(fw(A,p,gw(l,Gw),gw(n),gw(r),gw(h),c,gw(f),gw(t),gw(i),e),tw((([e,t,,i,,,,,,,r])=>{const n=r&&r.length!==i;return e&&!t&&!n})),iw((([,,[e,t],i,r,n,s,a,o,l,h])=>{const c=r,{offsetTree:d,sizeTree:u}=c,A=Jm(g);if(0===i)return{...Db,totalCount:i};if(0===e&&0===t)return 0===A?{...Db,totalCount:i}:Ub(A,n,r,o,l,h||[]);if(Ew(u))return A>0?null:Ib(function(e,t,i){if($w(t)){const r=ib(e,t);return[{index:Lw(t.groupOffsetTree,r)[0],offset:0,size:0},{data:null==i?void 0:i[0],index:r,offset:0,size:0}]}return[{data:null==i?void 0:i[0],index:e,offset:0,size:0}]}(bb(n,i),c,h),[],i,l,c,o);const p=[];if(a.length>0){const e=a[0],t=a[a.length-1];let i=0;for(const r of Iw(u,e,t)){const n=r.value,s=Math.max(r.start,e),a=Math.min(r.end,t);for(let e=s;e<=a;e++)p.push({data:null==h?void 0:h[e],index:e,offset:i,size:n}),i+=n}}if(!s)return Ib([],p,i,l,c,o);const f=a.length>0?a[a.length-1]+1:0,m=nb(d,e,t,f);if(0===m.length)return null;const w=i-1;return Ib(zm([],(i=>{for(const r of m){const n=r.value;let s=n.offset,a=r.start;const o=n.size;if(n.offset<e){a+=Math.floor((e-n.offset+l)/(o+l));const t=a-r.start;s+=t*o+t*l}a<f&&(s+=(f-a)*o,a=f);const c=Math.min(r.end,w);for(let e=a;e<=c&&!(s>=t);e++)i.push({data:null==h?void 0:h[e],index:e,offset:s,size:o}),s+=o+l}})),p,i,l,c,o)})),tw((e=>null!==e)),ew()),Db);Xm(nw(e,tw(_m),iw((e=>null==e?void 0:e.length))),n),Xm(nw(w,iw((e=>e.topListHeight))),d),Xm(d,o),Xm(nw(w,iw((e=>[e.top,e.bottom]))),a),Xm(nw(w,iw((e=>e.items))),m);const b=uw(nw(w,tw((({items:e})=>e.length>0)),lw(n,e),tw((([{items:e},t])=>e[e.length-1].originalIndex===t-1)),iw((([,e,t])=>[e-1,t])),ew(Gw),iw((([e])=>e)))),v=uw(nw(w,ow(200),tw((({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length)),iw((({items:e})=>e[0].index)),ew())),y=uw(nw(w,tw((({items:e})=>e.length>0)),iw((({items:e})=>{let t=0,i=e.length-1;for(;"group"===e[t].type&&t<i;)t++;for(;"group"===e[i].type&&i>t;)i--;return{endIndex:e[i].index,startIndex:e[t].index}})),ew(qw)));return{endReached:b,initialItemCount:g,itemsRendered:m,listState:w,rangeChanged:y,startReached:v,topItemsIndexes:f,...u}}),Km(db,Ab,kb,vb,mb,Fb,pb,Ww),{singleton:!0}),Rb=Aw((([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:i,headerHeight:r},{listState:n}])=>{const s=dw(),a=cw(nw(fw(i,e,r,t,n),iw((([e,t,i,r,n])=>e+t+i+r+n.offsetBottom+n.bottom))),0);return Xm(gw(a),s),{totalListHeight:a,totalListHeightChanged:s}}),Km(Fw,Ob),{singleton:!0}),Qb=Aw((([{viewportHeight:e},{totalListHeight:t}])=>{const i=hw(!1);return{alignToBottom:i,paddingTopAddition:cw(nw(fw(i,e,t),tw((([e])=>e)),iw((([,e,t])=>Math.max(0,e-t))),ow(0),ew()),0)}}),Km(Fw,Rb),{singleton:!0});function Hb(e){return!!e&&("smooth"===e?"smooth":"auto")}const Mb=Aw((([{listRefresh:e,totalCount:t,fixedItemSize:i},{atBottomState:r,isAtBottom:n},{scrollToIndex:s},{scrolledToInitialItem:a},{didMount:o,propsReady:l},{log:h},{scrollingInProgress:c}])=>{const d=hw(!1),u=dw();let A=null;function p(e){Gm(s,{align:"end",behavior:e,index:"LAST"})}function f(e){const t=Ym(r,(t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&!A&&(Jm(h)("scrolling to bottom due to increased size",{},ww.DEBUG),p("auto"))}));setTimeout(t,100)}return qm(nw(fw(nw(gw(t),aw(1)),o),lw(gw(d),n,a,c),iw((([[e,t],i,r,n,s])=>{let a=t&&n,o="auto";return a&&(o=((e,t)=>"function"==typeof e?Hb(e(t)):t&&Hb(e))(i,r||s),a=a&&!!o),{followOutputBehavior:o,shouldFollow:a,totalCount:e}})),tw((({shouldFollow:e})=>e))),(({followOutputBehavior:t,totalCount:r})=>{A&&(A(),A=null),Jm(i)?requestAnimationFrame((()=>{Jm(h)("following output to ",{totalCount:r},ww.DEBUG),p(t)})):A=Ym(e,(()=>{Jm(h)("following output to ",{totalCount:r},ww.DEBUG),p(t),A=null}))})),qm(nw(fw(gw(d),t,l),tw((([e,,t])=>e&&t)),sw((({value:e},[,t])=>({refreshed:e===t,value:t})),{refreshed:!1,value:0}),tw((({refreshed:e})=>e)),lw(d,t)),(([,e])=>{Jm(a)&&f(!1!==e)})),qm(u,(()=>{f(!1!==Jm(d))})),qm(fw(gw(d),r),(([e,t])=>{e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&p("auto")})),{autoscrollToBottom:u,followOutput:d}}),Km(db,Fb,mb,vb,pb,vw,Fw)),_b=Aw((([{data:e,firstItemIndex:t,gap:i,sizes:r},{initialTopMostItemIndex:n},{initialItemCount:s,listState:a},{didMount:o}])=>(Xm(nw(o,lw(s),tw((([,e])=>0!==e)),lw(n,r,t,i,e),iw((([[,e],t,i,r,n,s=[]])=>Ub(e,t,i,r,n,s)))),a),{})),Km(db,vb,Ob,pb),{singleton:!0}),jb=Aw((([{didMount:e},{scrollTo:t},{listState:i}])=>{const r=hw(0);return qm(nw(e,lw(r),tw((([,e])=>0!==e)),iw((([,e])=>({top:e})))),(e=>{Ym(nw(i,aw(1),tw((e=>e.items.length>1))),(()=>{requestAnimationFrame((()=>{Gm(t,e)}))}))})),{initialScrollTop:r}}),Km(pb,Fw,Ob),{singleton:!0}),zb=({itemBottom:e,itemTop:t,locationParams:{align:i,behavior:r,...n},viewportBottom:s,viewportTop:a})=>t<a?{...n,align:null!=i?i:"start",behavior:r}:e>s?{...n,align:null!=i?i:"end",behavior:r}:null,Vb=Aw((([{gap:e,sizes:t,totalCount:i},{fixedFooterHeight:r,fixedHeaderHeight:n,headerHeight:s,scrollingInProgress:a,scrollTop:o,viewportHeight:l},{scrollToIndex:h}])=>{const c=dw();return Xm(nw(c,lw(t,l,i,s,n,r,o),lw(e),iw((([[e,t,i,r,n,s,o,l],h])=>{const{align:c,behavior:d,calculateViewLocation:u=zb,done:A,...p}=e,f=rb(e,t,r-1),g=tb(f,t.offsetTree,h)+n+s,m=u({itemBottom:g+Lw(t.sizeTree,f)[1],itemTop:g,locationParams:{align:c,behavior:d,...p},viewportBottom:l+i-o,viewportTop:l+s});return m?A&&Ym(nw(a,tw((e=>!e)),aw(Jm(a)?1:2)),A):A&&A(),m})),tw((e=>null!==e))),h),{scrollIntoView:c}}),Km(db,Fw,mb,Ob,vw),{singleton:!0}),Kb=Aw((([{scrollVelocity:e}])=>{const t=hw(!1),i=dw(),r=hw(!1);return Xm(nw(e,lw(r,t,i),tw((([e,t])=>!!t)),iw((([e,t,i,r])=>{const{enter:n,exit:s}=t;if(i){if(s(e,r))return!1}else if(n(e,r))return!0;return i})),ew()),t),qm(nw(fw(t,e,i),lw(r)),(([[e,t,i],r])=>{e&&r&&r.change&&r.change(t,i)})),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:i,scrollVelocity:e}}),Km(Fb),{singleton:!0}),qb=Aw((([{scrollContainerState:e,scrollTo:t}])=>{const i=dw(),r=dw(),n=dw(),s=hw(!1),a=hw(void 0);return Xm(nw(fw(i,r),iw((([{scrollHeight:e,scrollTop:t,viewportHeight:i},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:i})))),e),Xm(nw(t,lw(r),iw((([e,{offsetTop:t}])=>({...e,top:e.top+t})))),n),{customScrollParent:a,useWindowScroll:s,windowScrollContainerState:i,windowScrollTo:n,windowViewportRect:r}}),Km(Fw)),Gb=Aw((([{sizeRanges:e,sizes:t},{headerHeight:i,scrollTop:r},{initialTopMostItemIndex:n},{didMount:s},{useWindowScroll:a,windowScrollContainerState:o,windowViewportRect:l}])=>{const h=dw(),c=hw(void 0),d=hw(null),u=hw(null);return Xm(o,d),Xm(l,u),qm(nw(h,lw(t,r,a,d,u,i)),(([e,t,i,r,n,s,a])=>{const o=function(e){return Pw(e).map((({k:e,v:t},i,r)=>{const n=r[i+1];return{endIndex:n?n.k-1:1/0,size:t,startIndex:e}}))}(t.sizeTree);r&&null!==n&&null!==s&&(i=n.scrollTop-s.offsetTop),e({ranges:o,scrollTop:i-=a})})),Xm(nw(c,tw(_m),iw(Wb)),n),Xm(nw(s,lw(c),tw((([,e])=>void 0!==e)),ew(),iw((([,e])=>e.ranges))),e),{getState:h,restoreStateFrom:c}}),Km(db,Fw,vb,pb,qb));function Wb(e){return{align:"start",index:0,offset:e.scrollTop}}const Jb=Aw((([{topItemsIndexes:e}])=>{const t=hw(0);return Xm(nw(t,tw((e=>e>=0)),iw((e=>Array.from({length:e}).map(((e,t)=>t))))),e),{topItemCount:t}}),Km(Ob));function Xb(e){let t,i=!1;return()=>(i||(i=!0,t=e()),t)}const Yb=Xb((()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent))),$b=Aw((([{deviation:e,scrollBy:t,scrollingInProgress:i,scrollTop:r},{isAtBottom:n,isScrolling:s,lastJumpDueToItemResize:a,scrollDirection:o},{listState:l},{beforeUnshiftWith:h,gap:c,shiftWithOffset:d,sizes:u},{log:A},{recalcInProgress:p}])=>{const f=uw(nw(l,lw(a),sw((([,e,t,i],[{bottom:r,items:n,offsetBottom:s,totalCount:a},o])=>{const l=r+s;let h=0;return t===a&&e.length>0&&n.length>0&&(0===n[0].originalIndex&&0===e[0].originalIndex||(h=l-i,0!==h&&(h+=o))),[h,n,a,l]}),[0,[],0,0]),tw((([e])=>0!==e)),lw(r,o,i,n,A,p),tw((([,e,t,i,,,r])=>!r&&!i&&0!==e&&t===Bb)),iw((([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},ww.DEBUG),e)))));function g(i){i>0?(Gm(t,{behavior:"auto",top:-i}),Gm(e,0)):(Gm(e,0),Gm(t,{behavior:"auto",top:-i}))}return qm(nw(f,lw(e,s)),(([t,i,r])=>{r&&Yb()?Gm(e,i-t):g(-t)})),qm(nw(fw(cw(s,!1),e,p),tw((([e,t,i])=>!e&&!i&&0!==t)),iw((([e,t])=>t)),ow(1)),g),Xm(nw(d,iw((e=>({top:-e})))),t),qm(nw(h,lw(u,c),iw((([e,{groupIndices:t,lastSize:i,sizeTree:r},n])=>{function s(e){return e*(i+n)}if(0===t.length)return s(e);{let i=0;const n=Tw(r,0);let a=0,o=0;for(;a<e;){a++,i+=n;let r=t.length===o+1?1/0:t[o+1]-t[o]-1;a+r>e&&(i-=n,r=e-a+1),a+=r,i+=s(r),o++}return i}}))),(i=>{Gm(e,i),requestAnimationFrame((()=>{Gm(t,{top:i}),requestAnimationFrame((()=>{Gm(e,0),Gm(p,!1)}))}))})),{deviation:e}}),Km(Fw,Fb,Ob,db,vw,Ww)),Zb=Aw((([e,t,i,r,n,s,a,o,l,h])=>({...e,...t,...i,...r,...n,...s,...a,...o,...l,...h})),Km(kb,_b,pb,Kb,Rb,jb,Qb,qb,Vb,vw)),ev=Aw((([{data:e,defaultItemSize:t,firstItemIndex:i,fixedItemSize:r,gap:n,groupIndices:s,itemSize:a,sizeRanges:o,sizes:l,statefulTotalCount:h,totalCount:c,trackItemSizes:d},{initialItemFinalLocationReached:u,initialTopMostItemIndex:A,scrolledToInitialItem:p},f,g,m,{listState:w,topItemsIndexes:b,...v},{scrollToIndex:y},B,{topItemCount:C},{groupCounts:x},F])=>(Xm(v.rangeChanged,F.scrollSeekRangeChanged),Xm(nw(F.windowViewportRect,iw((e=>e.visibleHeight))),f.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:i,fixedItemHeight:r,gap:n,groupCounts:x,initialItemFinalLocationReached:u,initialTopMostItemIndex:A,scrolledToInitialItem:p,sizeRanges:o,topItemCount:C,topItemsIndexes:b,totalCount:c,...m,groupIndices:s,itemSize:a,listState:w,scrollToIndex:y,statefulTotalCount:h,trackItemSizes:d,...v,...F,...f,sizes:l,...g})),Km(db,vb,Fw,Gb,Mb,Ob,mb,$b,Jb,Ab,Zb));function tv(e,t){const i={},r={};let n=0;const s=e.length;for(;n<s;)r[e[n]]=1,n+=1;for(const e in t)Object.hasOwn(r,e)||(i[e]=t[e]);return i}const iv=typeof document<"u"?r.useLayoutEffect:r.useEffect;function rv(t,i,n){const s=Object.keys(i.required||{}),a=Object.keys(i.optional||{}),o=Object.keys(i.methods||{}),l=Object.keys(i.events||{}),h=r.createContext({});function c(e,t){e.propsReady&&Gm(e.propsReady,!1);for(const r of s){Gm(e[i.required[r]],t[r])}for(const r of a)if(r in t){Gm(e[i.optional[r]],t[r])}e.propsReady&&Gm(e.propsReady,!0)}function d(e){return l.reduce(((t,r)=>(t[r]=function(e){let t,i;const r=()=>null==t?void 0:t();return function(n,s){switch(n){case 1:return s?i===s?void 0:(r(),i=s,t=qm(e,s),t):(r(),jm);case 2:return r(),void(i=null)}}}(e[i.events[r]]),t)),{})}const u=r.forwardRef(((u,A)=>{const{children:p,...f}=u,[g]=r.useState((()=>zm(function(e){const t=new Map,i=({constructor:e,dependencies:r,id:n,singleton:s})=>{if(s&&t.has(n))return t.get(n);const a=e(r.map((e=>i(e))));return s&&t.set(n,a),a};return i(e)}(t),(e=>{c(e,f)})))),[m]=r.useState(Mm(d,g));iv((()=>{for(const e of l)e in f&&qm(m[e],f[e]);return()=>{Object.values(m).map(Wm)}}),[f,m,g]),iv((()=>{c(g,f)})),r.useImperativeHandle(A,Rm(function(e){return o.reduce(((t,r)=>(t[r]=t=>{Gm(e[i.methods[r]],t)},t)),{})}(g)));const w=n;return e(h.Provider,{value:g,children:n?e(w,{...tv([...s,...a,...l],f),children:p}):p})}));return{Component:u,useEmitter:(e,t)=>{const i=r.useContext(h)[e];iv((()=>qm(i,t)),[t,i])},useEmitterValue:r.version.startsWith("18")?e=>{const t=r.useContext(h)[e],i=r.useCallback((e=>qm(t,e)),[t]);return r.useSyncExternalStore(i,(()=>Jm(t)),(()=>Jm(t)))}:e=>{const t=r.useContext(h)[e],[i,n]=r.useState(Mm(Jm,t));return iv((()=>qm(t,(e=>{e!==i&&n(Rm(e))}))),[t,i]),i},usePublisher:e=>{const t=r.useContext(h);return r.useCallback((i=>{Gm(t[e],i)}),[t,e])}}}const nv=r.createContext(void 0),sv=r.createContext(void 0),av=typeof document<"u"?r.useLayoutEffect:r.useEffect;function ov(e){return"self"in e}function lv(e,t,i,n=jm,s,a){const o=r.useRef(null),l=r.useRef(null),h=r.useRef(null),c=r.useCallback((i=>{let r,n,s;const o=i.target;if(function(e){return"body"in e}(o)||ov(o)){const e=ov(o)?o:o.defaultView;s=a?e.scrollX:e.scrollY,r=a?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,n=a?e.innerWidth:e.innerHeight}else s=a?o.scrollLeft:o.scrollTop,r=a?o.scrollWidth:o.scrollHeight,n=a?o.offsetWidth:o.offsetHeight;const c=()=>{e({scrollHeight:r,scrollTop:Math.max(s,0),viewportHeight:n})};i.suppressFlushSync?c():yr.flushSync(c),null!==l.current&&(s===l.current||s<=0||s===r-n)&&(l.current=null,t(!0),h.current&&(clearTimeout(h.current),h.current=null))}),[e,t,a]);return r.useEffect((()=>{const e=s||o.current;return n(s||o.current),c({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",c,{passive:!0}),()=>{n(null),e.removeEventListener("scroll",c)}}),[o,c,i,n,s]),{scrollByCallback:function(e){a&&(e={behavior:e.behavior,left:e.top}),o.current.scrollBy(e)},scrollerRef:o,scrollToCallback:function(i){const r=o.current;if(!r||(a?"offsetWidth"in r&&0===r.offsetWidth:"offsetHeight"in r&&0===r.offsetHeight))return;const n="smooth"===i.behavior;let s,c,d;ov(r)?(c=Math.max(Yw(r.document.documentElement,a?"width":"height"),a?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),s=a?r.innerWidth:r.innerHeight,d=a?window.scrollX:window.scrollY):(c=r[a?"scrollWidth":"scrollHeight"],s=Yw(r,a?"width":"height"),d=r[a?"scrollLeft":"scrollTop"]);const u=c-s;if(i.top=Math.ceil(Math.max(Math.min(u,i.top),0)),yb(s,c)||i.top===d)return e({scrollHeight:c,scrollTop:d,viewportHeight:s}),void(n&&t(!0));n?(l.current=i.top,h.current&&clearTimeout(h.current),h.current=setTimeout((()=>{h.current=null,l.current=null,t(!0)}),1e3)):l.current=null,a&&(i={behavior:i.behavior,left:i.top}),r.scrollTo(i)}}}const hv="-webkit-sticky",cv="sticky",dv=Xb((()=>{if(typeof document>"u")return cv;const e=document.createElement("div");return e.style.position=hv,e.style.position===hv?hv:cv}));function uv(e){return e}const Av=Aw((()=>{const e=hw((e=>`Item ${e}`)),t=hw(null),i=hw((e=>`Group ${e}`)),r=hw({}),n=hw(uv),s=hw("div"),a=hw(jm),o=(e,t=null)=>cw(nw(r,iw((t=>t[e])),ew()),t);return{components:r,computeItemKey:n,context:t,EmptyPlaceholder:o("EmptyPlaceholder"),FooterComponent:o("Footer"),GroupComponent:o("Group","div"),groupContent:i,HeaderComponent:o("Header"),HeaderFooterTag:s,ItemComponent:o("Item","div"),itemContent:e,ListComponent:o("List","div"),ScrollerComponent:o("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:o("ScrollSeekPlaceholder"),TopItemListComponent:o("TopItemList")}}));Km(ev,Av),dv();const pv={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},fv={outline:"none",overflowX:"auto",position:"relative"};function gv(e,t){if("string"!=typeof e)return{context:t}}function mv(e,t){return{item:"string"==typeof e?void 0:t}}function wv({useEmitter:t,useEmitterValue:i,usePublisher:n}){return r.memo((function({children:r,style:s,...a}){const o=n("scrollContainerState"),l=i("ScrollerComponent"),h=n("smoothScrollTargetReached"),c=i("scrollerRef"),d=i("context"),u=i("horizontalDirection")||!1,{scrollByCallback:A,scrollerRef:p,scrollToCallback:f}=lv(o,h,l,c,void 0,u);return t("scrollTo",f),t("scrollBy",A),e(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:p,style:{...u?fv:pv,...s},tabIndex:0,...a,...gv(l,d),children:r})}))}function bv({useEmitter:t,useEmitterValue:i,usePublisher:n}){return r.memo((function({children:s,style:a,...o}){const l=n("windowScrollContainerState"),h=i("ScrollerComponent"),c=n("smoothScrollTargetReached"),d=i("totalListHeight"),u=i("deviation"),A=i("customScrollParent"),p=i("context"),f=r.useRef(null),g=i("scrollerRef"),{scrollByCallback:m,scrollerRef:w,scrollToCallback:b}=lv(l,c,h,g,A);return av((()=>{var e;return w.current=A||(null==(e=f.current)?void 0:e.ownerDocument.defaultView),()=>{w.current=null}}),[w,A]),t("windowScrollTo",b),t("scrollBy",m),e(h,{ref:f,"data-virtuoso-scroller":!0,style:{position:"relative",...a,...0!==d?{height:d+u}:{}},...o,...gv(h,p),children:s})}))}dv();const vv=Aw((()=>{const e=hw((e=>i("td",{children:["Item $",e]}))),t=hw(null),r=hw((e=>i("td",{colSpan:1e3,children:["Group ",e]}))),n=hw(null),s=hw(null),a=hw({}),o=hw(uv),l=hw(jm),h=(e,t=null)=>cw(nw(a,iw((t=>t[e])),ew()),t);return{components:a,computeItemKey:o,context:t,EmptyPlaceholder:h("EmptyPlaceholder"),FillerRow:h("FillerRow"),fixedFooterContent:s,fixedHeaderContent:n,itemContent:e,groupContent:r,ScrollerComponent:h("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:h("ScrollSeekPlaceholder"),TableBodyComponent:h("TableBody","tbody"),TableComponent:h("Table","table"),TableFooterComponent:h("TableFoot","tfoot"),TableHeadComponent:h("TableHead","thead"),TableRowComponent:h("TableRow","tr"),GroupComponent:h("Group","tr")}})),yv=Aw((([e,t])=>({...e,...t})),Km(ev,vv)),Bv=({height:t})=>e("tr",{children:e("td",{style:{height:t}})}),Cv=({height:t})=>e("tr",{children:e("td",{style:{border:0,height:t,padding:0}})}),xv={overflowAnchor:"none"},Fv={position:dv(),zIndex:2,overflowAnchor:"none"},Nv=r.memo((function({showTopList:i=!1}){const r=Iv("listState"),n=Iv("computeItemKey"),s=Iv("firstItemIndex"),a=Iv("context"),o=Iv("isSeeking"),l=Iv("fixedHeaderHeight"),h=Iv("groupIndices").length>0,c=Iv("itemContent"),d=Iv("groupContent"),A=Iv("ScrollSeekPlaceholder")||Bv,p=Iv("GroupComponent"),f=Iv("TableRowComponent"),g=(i?r.topItems:[]).reduce(((e,t,i)=>(0===i?e.push(t.size):e.push(e[i-1]+t.size),e)),[]),m=(i?r.topItems:r.items).map((e=>{const t=e.originalIndex,r=n(t+s,e.data,a),m=i?0===t?0:g[t-1]:0;return o?u(A,{...gv(A,a),height:e.size,index:e.index,key:r,type:e.type||"item"}):"group"===e.type?u(p,{...gv(p,a),"data-index":t,"data-item-index":e.index,"data-known-size":e.size,key:r,style:{...Fv,top:l}},d(e.index,a)):u(f,{...gv(f,a),...mv(f,e.data),"data-index":t,"data-item-index":e.index,"data-known-size":e.size,"data-item-group-index":e.groupIndex,key:r,style:i?{...Fv,top:l+m}:xv},h?c(e.index,e.groupIndex,e.data,a):c(e.index,e.data,a))}));return e(t,{children:m})})),Sv=r.memo((function(){const t=Iv("listState"),n=Iv("topItemsIndexes").length>0,s=Uv("sizeRanges"),a=Iv("useWindowScroll"),o=Iv("customScrollParent"),l=Uv("windowScrollContainerState"),h=Uv("scrollContainerState"),c=o||a?l:h,d=Iv("trackItemSizes"),u=Iv("itemSize"),A=Iv("log"),{callbackRef:p,ref:f}=Cw(s,u,d,c,A,void 0,o,!1,Iv("skipAnimationFrameInResizeObserver")),[g,m]=r.useState(0);Dv("deviation",(e=>{g!==e&&(f.current.style.marginTop=`${e}px`,m(e))}));const w=Iv("EmptyPlaceholder"),b=Iv("FillerRow")||Cv,v=Iv("TableBodyComponent"),y=Iv("paddingTopAddition"),B=Iv("statefulTotalCount"),C=Iv("context");if(0===B&&w)return e(w,{...gv(w,C)});const x=(n?t.topItems:[]).reduce(((e,t)=>e+t.size),0),F=t.offsetTop+y+g-x,N=t.offsetBottom,S=F>0?e(b,{context:C,height:F},"padding-top"):null,E=N>0?e(b,{context:C,height:N},"padding-bottom"):null;return i(v,{"data-testid":"virtuoso-item-list",ref:p,...gv(v,C),children:[S,n&&e(Nv,{showTopList:!0}),e(Nv,{}),E]})})),Ev=({children:t})=>{const i=r.useContext(nv),n=Uv("viewportHeight"),s=Uv("fixedItemHeight"),a=yw(r.useMemo((()=>Hm(n,(e=>Yw(e,"height")))),[n]),!0,Iv("skipAnimationFrameInResizeObserver"));return r.useEffect((()=>{i&&(n(i.viewportHeight),s(i.itemHeight))}),[i,n,s]),e("div",{"data-viewport-type":"element",ref:a,style:{height:"100%",position:"absolute",top:0,width:"100%"},children:t})},Tv=({children:t})=>{const i=r.useContext(nv),n=Uv("windowViewportRect"),s=Uv("fixedItemHeight"),a=Iv("customScrollParent"),o=xw(n,a,Iv("skipAnimationFrameInResizeObserver"));return r.useEffect((()=>{i&&(s(i.itemHeight),n({offsetTop:0,visibleHeight:i.viewportHeight,visibleWidth:100}))}),[i,n,s]),e("div",{"data-viewport-type":"window",ref:o,style:{height:"100%",position:"absolute",top:0,width:"100%"},children:t})},Lv=r.memo((function(t){const n=Iv("useWindowScroll"),s=Iv("customScrollParent"),a=Uv("fixedHeaderHeight"),o=Uv("fixedFooterHeight"),l=Iv("fixedHeaderContent"),h=Iv("fixedFooterContent"),c=Iv("context"),d=yw(r.useMemo((()=>Hm(a,(e=>Yw(e,"height")))),[a]),!0,Iv("skipAnimationFrameInResizeObserver")),u=yw(r.useMemo((()=>Hm(o,(e=>Yw(e,"height")))),[o]),!0,Iv("skipAnimationFrameInResizeObserver")),A=s||n?Ov:Pv,p=s||n?Tv:Ev,f=Iv("TableComponent"),g=Iv("TableHeadComponent"),m=Iv("TableFooterComponent"),w=l?e(g,{ref:d,style:{position:"sticky",top:0,zIndex:2},...gv(g,c),children:l()},"TableHead"):null,b=h?e(m,{ref:u,style:{bottom:0,position:"sticky",zIndex:1},...gv(m,c),children:h()},"TableFoot"):null;return e(A,{...t,...gv(A,c),children:e(p,{children:i(f,{style:{borderSpacing:0,overflowAnchor:"none"},...gv(f,c),children:[w,e(Sv,{},"TableBody"),b]})})})})),{Component:kv,useEmitter:Dv,useEmitterValue:Iv,usePublisher:Uv}=rv(yv,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Lv),Pv=wv({useEmitter:Dv,useEmitterValue:Iv,usePublisher:Uv}),Ov=bv({useEmitter:Dv,useEmitterValue:Iv,usePublisher:Uv}),Rv=kv,Qv={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Hv={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:Mv,floor:_v,max:jv,min:zv,round:Vv}=Math;function Kv(e,t,i){return Array.from({length:t-e+1}).map(((t,r)=>({data:null===i?null:i[r+e],index:r+e})))}function qv(e,t){return e&&e.width===t.width&&e.height===t.height}function Gv(e,t){return e&&e.column===t.column&&e.row===t.row}const Wv=Aw((([{increaseViewportBy:e,listBoundary:t,overscan:i,visibleRange:r},{footerHeight:n,headerHeight:s,scrollBy:a,scrollContainerState:o,scrollTo:l,scrollTop:h,smoothScrollTargetReached:c,viewportHeight:d},u,A,{didMount:p,propsReady:f},{customScrollParent:g,useWindowScroll:m,windowScrollContainerState:w,windowScrollTo:b,windowViewportRect:v},y])=>{const B=hw(0),C=hw(0),x=hw(Qv),F=hw({height:0,width:0}),N=hw({height:0,width:0}),S=dw(),E=dw(),T=hw(0),L=hw(null),k=hw({column:0,row:0}),D=dw(),I=dw(),U=hw(!1),P=hw(0),O=hw(!0),R=hw(!1),Q=hw(!1);qm(nw(p,lw(P),tw((([e,t])=>!!t))),(()=>{Gm(O,!1)})),qm(nw(fw(p,O,N,F,P,R),tw((([e,t,i,r,,n])=>e&&!t&&0!==i.height&&0!==r.height&&!n))),(([,,,,e])=>{Gm(R,!0),wb(1,(()=>{Gm(S,e)})),Ym(nw(h),(()=>{Gm(t,[0,0]),Gm(O,!0)}))})),Xm(nw(I,tw((e=>null!=e&&e.scrollTop>0)),rw(0)),C),qm(nw(p,lw(I),tw((([,e])=>null!=e))),(([,e])=>{e&&(Gm(F,e.viewport),Gm(N,e.item),Gm(k,e.gap),e.scrollTop>0&&(Gm(U,!0),Ym(nw(h,aw(1)),(e=>{Gm(U,!1)})),Gm(l,{top:e.scrollTop})))})),Xm(nw(F,iw((({height:e})=>e))),d),Xm(nw(fw(gw(F,qv),gw(N,qv),gw(k,((e,t)=>e&&e.column===t.column&&e.row===t.row)),gw(h)),iw((([e,t,i,r])=>({gap:i,item:t,scrollTop:r,viewport:e})))),D),Xm(nw(fw(gw(B),r,gw(k,Gv),gw(N,qv),gw(F,qv),gw(L),gw(C),gw(U),gw(O),gw(P)),tw((([,,,,,,,e])=>!e)),iw((([e,[t,i],r,n,s,a,o,,l,h])=>{const{column:c,row:d}=r,{height:u,width:A}=n,{width:p}=s;if(0===o&&(0===e||0===p))return Qv;if(0===A){const t=bb(h,e);return function(e){return{...Hv,items:e}}(Kv(t,t+Math.max(o-1,0),a))}const f=Jv(p,A,c);let g,m;l?0===t&&0===i&&o>0?(g=0,m=o-1):(g=f*_v((t+d)/(u+d)),m=f*Mv((i+d)/(u+d))-1,m=zv(e-1,jv(m,f-1)),g=zv(m,jv(0,g))):(g=0,m=-1);const w=Kv(g,m,a),{bottom:b,top:v}=Xv(s,r,n,w),y=Mv(e/f);return{bottom:b,itemHeight:u,items:w,itemWidth:A,offsetBottom:y*u+(y-1)*d-b,offsetTop:v,top:v}}))),x),Xm(nw(L,tw((e=>null!==e)),iw((e=>e.length))),B),Xm(nw(fw(F,N,x,k),tw((([e,t,{items:i}])=>i.length>0&&0!==t.height&&0!==e.height)),iw((([e,t,{items:i},r])=>{const{bottom:n,top:s}=Xv(e,r,t,i);return[s,n]})),ew(Gw)),t);const H=hw(!1);Xm(nw(h,lw(H),iw((([e,t])=>t||0!==e))),H);const M=uw(nw(fw(x,B),tw((([{items:e}])=>e.length>0)),lw(H),tw((([[e,t],i])=>{const r=e.items[e.items.length-1].index===t-1;return(i||e.bottom>0&&e.itemHeight>0&&0===e.offsetBottom&&e.items.length===t)&&r})),iw((([[,e]])=>e-1)),ew())),_=uw(nw(gw(x),tw((({items:e})=>e.length>0&&0===e[0].index)),rw(0),ew())),j=uw(nw(gw(x),lw(U),tw((([{items:e},t])=>e.length>0&&!t)),iw((([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index}))),ew(qw),ow(0)));Xm(j,A.scrollSeekRangeChanged),Xm(nw(S,lw(F,N,B,k),iw((([e,t,i,r,n])=>{const s=gb(e),{align:a,behavior:o,offset:l}=s;let h=s.index;"LAST"===h&&(h=r-1),h=jv(0,h,zv(r-1,h));let c=Yv(t,n,i,h);return"end"===a?c=Vv(c-t.height+i.height):"center"===a&&(c=Vv(c-t.height/2+i.height/2)),l&&(c+=l),{behavior:o,top:c}}))),l);const z=cw(nw(x,iw((e=>e.offsetBottom+e.bottom))),0);return Xm(nw(v,iw((e=>({height:e.visibleHeight,width:e.visibleWidth})))),F),{customScrollParent:g,data:L,deviation:T,footerHeight:n,gap:k,headerHeight:s,increaseViewportBy:e,initialItemCount:C,itemDimensions:N,overscan:i,restoreStateFrom:I,scrollBy:a,scrollContainerState:o,scrollHeight:E,scrollTo:l,scrollToIndex:S,scrollTop:h,smoothScrollTargetReached:c,totalCount:B,useWindowScroll:m,viewportDimensions:F,windowScrollContainerState:w,windowScrollTo:b,windowViewportRect:v,...A,gridState:x,horizontalDirection:Q,initialTopMostItemIndex:P,totalListHeight:z,...u,endReached:M,propsReady:f,rangeChanged:j,startReached:_,stateChanged:D,stateRestoreInProgress:U,...y}}),Km(kb,Fw,Fb,Kb,pb,qb,vw));function Jv(e,t,i){return jv(1,_v((e+i)/(_v(t)+i)))}function Xv(e,t,i,r){const{height:n}=i;if(void 0===n||0===r.length)return{bottom:0,top:0};const s=Yv(e,t,i,r[0].index);return{bottom:Yv(e,t,i,r[r.length-1].index)+n,top:s}}function Yv(e,t,i,r){const n=Jv(e.width,i.width,t.column),s=_v(r/n),a=s*i.height+jv(0,s-1)*t.row;return a>0?a+t.row:a}const $v=Aw((()=>{const e=hw((e=>`Item ${e}`)),t=hw({}),i=hw(null),r=hw("virtuoso-grid-item"),n=hw("virtuoso-grid-list"),s=hw(uv),a=hw("div"),o=hw(jm),l=(e,i=null)=>cw(nw(t,iw((t=>t[e])),ew()),i),h=hw(!1),c=hw(!1);return Xm(gw(c),h),{components:t,computeItemKey:s,context:i,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:l("Item","div"),itemContent:e,listClassName:n,ListComponent:l("List","div"),readyStateChanged:h,reportReadyState:c,ScrollerComponent:l("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}})),Zv=Aw((([e,t])=>({...e,...t})),Km(Wv,$v)),ey=r.memo((function(){const t=oy("gridState"),i=oy("listClassName"),n=oy("itemClassName"),s=oy("itemContent"),a=oy("computeItemKey"),o=oy("isSeeking"),l=ly("scrollHeight"),h=oy("ItemComponent"),c=oy("ListComponent"),d=oy("ScrollSeekPlaceholder"),A=oy("context"),p=ly("itemDimensions"),f=ly("gap"),g=oy("log"),m=oy("stateRestoreInProgress"),w=ly("reportReadyState"),b=yw(r.useMemo((()=>e=>{const t=e.parentElement.parentElement.scrollHeight;l(t);const i=e.firstChild;if(i){const{height:e,width:t}=i.getBoundingClientRect();p({height:e,width:t})}f({column:dy("column-gap",getComputedStyle(e).columnGap,g),row:dy("row-gap",getComputedStyle(e).rowGap,g)})}),[l,p,f,g]),!0,!1);return av((()=>{t.itemHeight>0&&t.itemWidth>0&&w(!0)}),[t]),m?null:e(c,{className:i,ref:b,...gv(c,A),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map((i=>{const r=a(i.index,i.data,A);return o?e(d,{...gv(d,A),height:t.itemHeight,index:i.index,width:t.itemWidth},r):u(h,{...gv(h,A),className:n,"data-index":i.index,key:r},s(i.index,i.data,A))}))})})),ty=r.memo((function(){const t=oy("HeaderComponent"),i=ly("headerHeight"),n=oy("headerFooterTag"),s=yw(r.useMemo((()=>e=>{i(Yw(e,"height"))}),[i]),!0,!1),a=oy("context");return t?e(n,{ref:s,children:e(t,{...gv(t,a)})}):null})),iy=r.memo((function(){const t=oy("FooterComponent"),i=ly("footerHeight"),n=oy("headerFooterTag"),s=yw(r.useMemo((()=>e=>{i(Yw(e,"height"))}),[i]),!0,!1),a=oy("context");return t?e(n,{ref:s,children:e(t,{...gv(t,a)})}):null})),ry=({children:t})=>{const i=r.useContext(sv),n=ly("itemDimensions"),s=ly("viewportDimensions"),a=yw(r.useMemo((()=>e=>{s(e.getBoundingClientRect())}),[s]),!0,!1);return r.useEffect((()=>{i&&(s({height:i.viewportHeight,width:i.viewportWidth}),n({height:i.itemHeight,width:i.itemWidth}))}),[i,s,n]),e("div",{ref:a,style:{height:"100%",position:"absolute",top:0,width:"100%"},children:t})},ny=({children:t})=>{const i=r.useContext(sv),n=ly("windowViewportRect"),s=ly("itemDimensions"),a=oy("customScrollParent"),o=xw(n,a,!1);return r.useEffect((()=>{i&&(s({height:i.itemHeight,width:i.itemWidth}),n({offsetTop:0,visibleHeight:i.viewportHeight,visibleWidth:i.viewportWidth}))}),[i,n,s]),e("div",{ref:o,style:{height:"100%",position:"absolute",top:0,width:"100%"},children:t})},sy=r.memo((function({...t}){const r=oy("useWindowScroll"),n=oy("customScrollParent"),s=n||r?cy:hy,a=n||r?ny:ry,o=oy("context");return e(s,{...t,...gv(s,o),children:i(a,{children:[e(ty,{}),e(ey,{}),e(iy,{})]})})})),{useEmitter:ay,useEmitterValue:oy,usePublisher:ly}=rv(Zv,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},sy),hy=wv({useEmitter:ay,useEmitterValue:oy,usePublisher:ly}),cy=bv({useEmitter:ay,useEmitterValue:oy,usePublisher:ly});function dy(e,t,i){return"normal"!==t&&!(null!=t&&t.endsWith("px"))&&i(`${e} was not resolved to pixel value correctly`,t,ww.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}const uy=xi((()=>({root:{borderRadius:"8px",overflow:"hidden","&>.MuiTableRow-root .MuiTableCell-head":{fontWeight:600,color:"var(--theme-color1)",background:"var(--theme-color4)",whiteSpace:"nowrap",textOverflow:"ellipsis",userSelect:"none",padding:"6px 10px",paddingRight:0,"&:first-child":{borderRadius:"8px 0 0 8px"},"&:last-child":{borderRadius:"0 8px 8px 0","&::before":{display:"none"}}}}})))(li),Ay={Scroller:r.forwardRef(((t,i)=>e(ze,{component:Ve,...t,ref:i}))),Table:t=>e(qe,{...t,size:"small",sx:{borderCollapse:"collapse",width:"100%",tableLayout:"fixed"}}),TableHead:r.forwardRef(((t,i)=>e(je,{...t,ref:i,sx:{background:"var(--theme-color4)"}}))),TableRow:Ke,TableBody:r.forwardRef(((t,i)=>e(_e,{...t,ref:i,sx:{"&>.MuiTableRow-root .MuiTableCell-body":{fontWeight:500}}}))),TableFoot:r.forwardRef(((t,i)=>e(ve,{...t,ref:i,sx:{background:"var(--theme-color4)"}})))},py=({level:t})=>e("span",{style:{paddingLeft:10*t+"px"}}),fy=r.memo((({group:r,level:n=0,columns:s,columnWidths:o,onDoubleClickAction:l})=>{const d=r?.data?.length,u=r?.groups?.length,A=Ws(),[p,f]=c(!0),g=h((()=>{r.data&&f((e=>!e))}),[]),m=a((()=>r?.data?s.reduce(((e,t)=>(t.isDisplayTotal&&"number"===t.componentType&&(e[t.accessor]=Pm(r.data,t,A)),e)),{}):{}),[r?.data,s,A]),w=a((()=>r.groups?s.reduce(((e,t)=>(t.isDisplayTotal&&"number"===t.componentType&&(e[t.accessor]=qd(Om(r,t),t?.isVisibleCurrSymbol?sl(t?.currencySymbol??A.dynamicAmountSymbol):"",t?.currencyFormat??A.currencyFormat,t?.decimalCount??A.decimalCount,t?.symbolPosition??"start")),e)),{}):{}),[r,s,A]),b=a((()=>p&&r?.data?r.data.map((t=>e(Ke,{onDoubleClick:()=>{"function"==typeof l&&l({row:[{data:t}]})},children:s.map((i=>{const r=i.accessor,n=((e,t,i)=>{const{commonDateFormat:r,commonDateTimeFormat:n,commonTimeFormat:s,currencyFormat:a,decimalCount:o,dynamicAmountSymbol:l}=i;if(!t.componentType)return e;switch(t.componentType){case"date":return Um(e,t?.dateFormat??r??"dd/MM/yyyy");case"dateTime":return Um(e,t?.dateFormat??n??"dd/MM/yyyy HH:mm:ss");case"time":return Um(e,t?.dateFormat??s??"HH:mm:ss");case"number":return isNaN(Number(e))?"-":qd(e,t?.isVisibleCurrSymbol?sl(t?.currencySymbol??l):"",t?.currencyFormat??a,t?.decimalCount??o,t?.symbolPosition??"start");default:return e}})(t[r],i,A);return e(Ge,{align:i.alignment??"left",sx:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",minWidth:o[r],maxWidth:o[r],color:"function"==typeof i.color?i.color(t[r],t):"#000"},children:i?.showTooltip?e(pe,{title:n,children:n}):n},r)}))},t.id))):null),[p,r?.data,s,o,A]),v=a((()=>r?.data?e(Ke,{className:se("footer-row",{p0:!s.some((e=>"number"===e.componentType&&e.isDisplayTotal))}),children:s.map((t=>e(Ge,{align:t.alignment??"left",children:"number"===t.componentType&&t.isDisplayTotal?m[t.accessor]:""},t.accessor)))}):null),[r?.data,s,m]);return i(t,{children:[e(Ke,{children:s.map(((t,s)=>{const a=0===s,l=t.isDisplayTotal?m[t.accessor]:"",h=t.isDisplayTotal?w[t.accessor]:"";return e(Ge,{align:a?"left":t.alignment??"left",sx:{fontSize:"0.9rem",cursor:a?"pointer":"auto",width:o[t.accessor],minWidth:o[t.accessor],maxWidth:o[t.accessor],overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:0!==s?r.data?"var(--theme-color3)":"var(--theme-color1)":"#000"},onClick:a?g:void 0,children:a?i("div",{style:{display:"flex",alignItems:"center"},children:[i("strong",{className:"group-name",style:{display:"flex",alignItems:"center",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:[e(py,{level:n}),i("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[r.groupName,i("em",{style:{fontSize:".8rem",color:"#707070",fontWeight:500,marginLeft:"5px"},children:[u?`(${u} Groups)`:"",d?`(${d} Records)`:""]})]})]}),e("span",{style:{marginLeft:"auto",height:"18px",flexShrink:0},children:r?.data?e(p?Cr:xr,{fontSize:"small"}):null})]}):t.isDisplayTotal&&r.data?e("strong",{children:l}):t.isDisplayTotal&&r.groups?e("strong",{children:h}):""},t.accessor)}))}),p&&i(t,{children:[b,v]}),r.groups?.map(((t,i)=>e(fy,{group:t,level:n+1,columns:s,columnWidths:o,onDoubleClickAction:l},t.groupName||i)))]})})),gy=({columns:r,data:n,originalData:s,loading:o,metaData:l,hideFooter:d,onDoubleClickAction:u})=>{const A=Ws(),[p,f]=c(r.reduce(((e,t)=>({...e,[t.accessor]:Number(t.width)||150})),{})),g=a((()=>p),[p]),m=h(((e,t)=>{f((i=>({...i,[e]:t})))}),[]),w=h(((e,t)=>{const i=e.clientX,r=g[t.accessor];let n;const s=e=>{n&&cancelAnimationFrame(n),n=requestAnimationFrame((()=>{const n=Math.min(Math.max(t.minWidth||50,r+(e.clientX-i)),t.maxWidth||600);n!==g[t.accessor]&&m(t.accessor,n)}))},a=()=>{n&&cancelAnimationFrame(n),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a)};document.addEventListener("mousemove",s),document.addEventListener("mouseup",a)}),[g,m]);return e(Rv,{components:Ay,data:n,fixedFooterContent:()=>e(t,{children:d?null:e(ve,{sx:{position:"sticky",bottom:0},children:e(Ke,{className:"footer-row",children:r.map(((e,t)=>i(Ge,{align:e.alignment??"left",sx:{borderTop:"1px solid #bbb",minWidth:g[e.accessor],maxWidth:g[e.accessor]},children:[0===t?`Grand Total ${s.length}`:"","number"===e.componentType&&e.isDisplayTotal?Pm(s,e,A):""]},e.accessor)))})})}),fixedHeaderContent:()=>e(uy,{sx:{position:"sticky",top:0,zIndex:100},children:e(Ke,{children:r.map((t=>e(Ge,{sx:{minWidth:g[t.accessor],maxWidth:g[t.accessor],fontWeight:"bold",paddingRight:0},children:i("div",{style:{display:"flex",alignItems:"center",width:"100%",minWidth:0},children:[e("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textAlign:t?.alignment??"left"},children:t.columnName}),e("div",{onMouseDown:e=>w(e,t),style:{cursor:"col-resize",paddingLeft:"10px",flexShrink:0,display:"flex",alignItems:"center"},children:e("div",{style:{width:"2px",height:"12px",background:"#ddd"}})})]})},t.accessor)))})}),itemContent:(t,i)=>e(fy,{group:i,level:0,columns:r,columnWidths:g,onDoubleClickAction:u},i.groupName??t),style:{height:l?.gridConfig?.maxHeight??"70vh"}})},my=({data:t,setGlobalFilterData:i,visibleKeys:r})=>{const{t:n}=ne(),[s,a]=c(""),o=((e,t=500)=>{const[i,r]=c(e);return l((()=>{const i=setTimeout((()=>r(e)),t);return()=>clearTimeout(i)}),[e,t]),i})(s,300);l((()=>{const e=o?t.filter((e=>r.some((t=>{const i=e[t];return i&&i.toString().toLowerCase().includes(o.toLowerCase())})))):t;i(e)}),[o,t,r,i]);return e(wl,{type:"text",value:s,onChange:e=>{a(e.target.value)},placeholder:`${n("profile.Searchin")} ${t.length||0} ${n("records")}`})},wy=r.memo((({title:t,columns:r,metaData:n,groups:s,hideHeader:o,hideFooter:l,dataFetcher:d,reportID:u,otherAPIRequestPara:A={},autoFetch:p=!0,retrievalComponent:f,retrievalType:g,onClose:m,allowRefetch:w=!0,onDoubleClickAction:b,headerToolbarStyle:v={}})=>{const{t:y}=ne(),[B,C]=c(p),[x,F]=c([]),N=h((e=>{F(e),C(!0)}),[C,F]),{data:S,isFetching:E,isLoading:T,isError:L,error:k,refetch:D}=zt([d,u,x,A],(()=>d(u,x,A)),{cacheTime:0,enabled:B}),I=a((()=>T||E),[E,T]),[U,P]=c([]),[O,R]=c(S??[]),Q=a((()=>r.filter((e=>!1!==e.isVisible))),[r]),H=a((()=>Array.isArray(Q)?Q.map((e=>({...e,columnName:y(e.columnName)}))):[]),[y,Q]),M=a((()=>H.map((e=>e.accessor))),[H]),_=a((()=>qo(U,S??[])),[U,S]),j=a((()=>qo(U,O)),[U,O]),z=a((()=>I?[]:((e,t)=>{if(!t.length)return[];const i=new Map;e.forEach((e=>{let r=i;t.forEach(((i,n)=>{const s=`${i.groupName??""} ${e[i.accessor]}`;r.has(s)||r.set(s,n===t.length-1?{groupName:s.trim(),data:[]}:new Map),n===t.length-1?r.get(s).data.push(e):r=r.get(s)}))}));const r=e=>Array.from(e,(([e,t])=>t instanceof Map?{groupName:e,groups:r(t)}:t));return r(i)})(j,s)),[j,s,I]),V=a((()=>Zg(n.filters?n.filters:[])),[n.filters]);return i(me,{className:"layout-report-parent",sx:{display:"flex",flexDirection:"column",padding:"1rem",overflow:"auto"},children:[L?e(Va,{severity:k?.severity??"error",errorMsg:k?.error_msg??"Error",errorDetail:k?.error_detail??""}):null,i(Ve,{style:{width:"100%",overflowX:"auto"},children:[i(Ve,{style:{width:"100%",overflow:"hidden",marginBottom:"8px",display:o?"none":"inherit"},children:[i(Ie,{className:"layout__report__header",variant:"dense",sx:{display:"flex",alignItems:"center",justifyContent:"space-between",...v},style:{background:"var(--primary-bg)"},children:[e(fe,{variant:"h5",color:"primary",children:t.trim()}),i(Ue,{direction:"row",alignItems:"center",className:"group-report-header-tools",children:[e(bg,{filterData:x,filterMeta:V,isOpenRetrievalDefault:!B,retrievalComponent:f,retrievalType:g,setAllFilters:P,setQueryFilters:N,setShowFilters:()=>{}}),V.length>0&&e(Ul,{setAllFilters:P,filters:U,filterMeta:V,gotoPage:()=>{},setSortBy:()=>{},classes:{}}),w?e(Be,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:()=>D(),color:"primary",children:e(qi,{})}):null,e(my,{data:_,setGlobalFilterData:R,visibleKeys:M}),"function"==typeof m?e(tl,{title:y("Close"),arrow:!0,children:e(Be,{onClick:m,size:"small",sx:{width:"35px",height:"35px",padding:0},children:e(Bt,{fontSize:"medium",style:{color:"var(--white)"}})})}):null]})]}),x.length?e(fg,{dense:!0,setAllFilters:F,filters:x}):null,U.length>0&&e(Xl,{dense:!0,setAllFilters:P,filters:U,gotoPage:()=>{},setSortBy:()=>{}}),I&&e(We,{color:"secondary"})]}),e(gy,{columns:H,data:z,originalData:j,metaData:n,loading:I,hideFooter:l,onDoubleClickAction:b})]})]})})),by=({name:t,validate:r,validationRun:n,postValidationSetCrossFieldValues:s,runValidationOnDependentFieldsChange:a,runPostValidationHookAlways:c,shouldExclude:d,isReadOnly:A,dependentFields:p,fieldKey:f,GridProps:g,CircularProgressProps:m,enableGrid:w,StartAdornment:b,EndAdornment:v,isFieldFocused:y,maxLength:C=-1,label:x,skipValueUpdateFromCrossFieldWhenReadOnly:F,...N})=>{const{value:S,error:E,touched:T,handleChange:L,handleBlur:k,isSubmitting:D,validationRunning:I,fieldKey:U,name:P,excluded:O,readOnly:R,incomingMessage:Q,whenToRunValidation:H,runValidation:M}=Js({name:t,fieldKey:f,dependentFields:p,validate:r,validationRun:n,runPostValidationHookAlways:c,postValidationSetCrossFieldValues:s,isReadOnly:A,shouldExclude:d,runValidationOnDependentFieldsChange:a,skipValueUpdateFromCrossFieldWhenReadOnly:F}),_=h((e=>{L(e,e.target?.formattedValue??void 0)}),[L]),j=o();if(l((()=>{y&&setTimeout((()=>{j?.current?.focus?.()}),1)}),[y]),l((()=>{if(null!==Q&&"object"==typeof Q){const{value:e}=Q;"DEFAULT_VALUE"!==e&&L(e),"onBlur"===H&&M({value:e},!0)}}),[Q,L,M,H]),O)return null;const z=T&&Boolean(E),V=i($e,{disabled:D,children:[e(Ut,{children:x}),u(Fr,{...N,key:U,id:U,name:P,value:S,InputProps:{endAdornment:I?e(B,{position:"end",children:e(re,{color:"primary",variant:"indeterminate",...m})}):Boolean(v)?v:null,startAdornment:Boolean(b)?e(B,{position:"start",children:b}):null},InputLabelProps:{shrink:!0},inputRef:j,onChange:e=>{(-1===C||e.target.value.length<=C)&&_(e)},inputProps:{readOnly:R,tabIndex:R?-1:void 0},onBlur:k,disabled:D}),e(Ze,{children:z?E:""})]});return Boolean(w)?e(ie,{...g,children:V}):V};var vy=Object.freeze({__proto__:null,TextareaAutosize:by,default:by});const yy=({name:e,fieldKey:t,setValueOnDependentFieldsChange:i,dependentFields:r,ignoreInSubmit:n=!1,postValidationSetCrossFieldValues:s,validationRun:a,runValidationOnDependentFieldsChange:o,AlwaysRunPostValidationSetCrossFieldValues:h,runExternalFunction:c,onFormDataChange:d,runPostValidationForInitValue:u})=>{const{handleBlur:A,handleChange:p,dependentValues:f,incomingMessage:g,setIgnoreInSubmit:m,runValidation:w,whenToRunValidation:b,formState:v}=Js({name:e,fieldKey:t,dependentFields:r,postValidationSetCrossFieldValues:s,validationRun:a,runValidationOnDependentFieldsChange:o,AlwaysRunPostValidationSetCrossFieldValues:h,runExternalFunction:c,onFormDataChange:d,runPostValidationForInitValue:u});return l((()=>{A()}),[A]),l((()=>{if(Boolean(n))if("function"==typeof n){let e=n(ta(f),v);m(e)}else m(n)}),[n,m,f]),l((()=>{if("function"==typeof i){let e=i(ta(f),v);void 0===e&&null===e||p(e)}}),[f,p,i]),l((()=>{if(null!==g&&"object"==typeof g){const{value:e}=g;(Boolean(e)||""===e)&&(p(e),"onBlur"===b&&w({value:e},!0))}}),[g,p,w,b]),null};var By=Object.freeze({__proto__:null,HiddenField:yy,default:yy}),Cy=Object.freeze({__proto__:null,Typography:Lp,default:Lp});const xy=Ci((e=>Fi({cardHeader:{padding:e.spacing(1,2)},list:{width:200,height:230,backgroundColor:e.palette.background.paper,overflow:"auto"},button:{margin:e.spacing(.5,0)}}))),Fy=(e,t)=>e.filter((e=>t.findIndex((t=>t?.value===e?.value))<0)),Ny=(e,t)=>e.filter((e=>t.findIndex((t=>t?.value===e))<0)),Sy=(e,t)=>e.filter((e=>t.findIndex((t=>t===e))<0)),Ey=(e,t)=>{let i=e.filter((e=>-1!==t.findIndex((t=>t?.value===e))));return t.filter((e=>i.indexOf(e?.value)>=0))},Ty=({label:t="",leftOptions:r,rightOptions:n,leftOptionsLabel:s,rightOptionsLabel:a,valueSide:o,disabled:h=!1,error:d=!1,readOnly:u=!1,helperText:A="",handleChange:f=()=>{},handleBlur:g=()=>{}})=>{const m=xy(),[w,b]=c([]),[v,y]=c(r??[]),[B,C]=c(n??[]),x=Ey(w,v),F=Ey(w,B);l((()=>{y(r),C(n),f("left"===o?r.map((e=>e.value)):n.map((e=>e.value)))}),[r,n]);const N=e=>Ey(w,e).length,S=e=>()=>{u||(N(e)===e.length?b(Ny(w,e)):b(((e,t)=>[...e,...Sy(t.map((e=>e?.value)),e)])(w,e)))},E=(t,r,n)=>i(st,{style:n?{borderBottom:"2px solid #f44336"}:void 0,children:[e(lt,{className:m.cardHeader,avatar:e(ui,{onClick:S(r),checked:N(r)===r.length&&0!==r.length,indeterminate:N(r)!==r.length&&0!==N(r),disabled:0===r.length||h,inputProps:{"aria-label":"all items selected"}}),title:t,subheader:`${N(r)}/${r.length} selected`}),e(nr,{}),i(Nr,{className:m.list,dense:!0,component:"div",role:"list",children:[r.map((t=>{return i(Sr,{role:"listitem",button:!0,onClick:(r=t.value,()=>{if(u)return;const e=w.indexOf(r),t=[...w];-1===e?t.push(r):t.splice(e,1),b(t)}),dense:!0,style:{padding:"0px 16px"},disabled:h,children:[e(Tr,{children:e(ui,{style:{padding:"0px 8px"},checked:-1!==w.indexOf(t.value),tabIndex:-1,disableRipple:!0,disabled:h})}),e(Er,{id:t.value,primary:t.label})]},t.value);var r})),e(Sr,{})]})]});return i(p,{children:[e(fe,{variant:"h6",children:t}),i(ie,{container:!0,spacing:2,justifyContent:"center",alignItems:"center",tabIndex:0,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||g(e)},children:[e(ie,{item:!0,xs:5,md:5,sm:5,children:E(s,v,d)}),e(ie,{item:!0,xs:2,md:2,sm:2,children:i(ie,{container:!0,direction:"column",alignItems:"center",children:[e(ct,{variant:"outlined",size:"small",className:m.button,onClick:()=>{if(u)return;let e=B.concat(x),t=Fy(v,x);b(Ny(w,x)),y(t),C(e),f("left"===o?t.map((e=>e.value)):e.map((e=>e.value)))},disabled:0===x.length||h,"aria-label":"move selected right",children:">"}),e(ct,{variant:"outlined",size:"small",className:m.button,onClick:()=>{if(u)return;let e=v.concat(F),t=Fy(B,F);b(Ny(w,F)),y(e),C(t),f("left"===o?e.map((e=>e.value)):t.map((e=>e.value)))},disabled:0===F.length||h,"aria-label":"move selected left",children:"<"})]})}),e(ie,{item:!0,xs:5,md:5,sm:5,children:E(a,B,d)})]}),e(Ze,{disabled:h,error:d,children:A})]})},Ly=({name:t,fieldKey:i,label:r,validate:n,validationRun:s,shouldExclude:a,isReadOnly:o,postValidationSetCrossFieldValues:l,runPostValidationHookAlways:h,dependentFields:d,leftOptions:u,rightOptions:A,GridProps:p,enableGrid:f,isFieldFocused:g,runValidationOnDependentFieldsChange:m,_leftOptionsKey:w,_rightOptionsKey:b,disableCaching:v,leftOptionsLabel:y,rightOptionsLabel:B,valueSide:C})=>{const{error:x,touched:F,handleChange:N,handleBlur:S,runValidation:E,isSubmitting:T,fieldKey:L,name:k,dependentValues:D,excluded:I,incomingMessage:U,whenToRunValidation:P,readOnly:O,formState:R,setIncomingMessage:Q}=Js({name:t,fieldKey:i,dependentFields:d,validate:n,validationRun:s,runPostValidationHookAlways:h,postValidationSetCrossFieldValues:l,isReadOnly:o,shouldExclude:a,runValidationOnDependentFieldsChange:m}),[H,M]=c([]),[_,j]=c([]),{loadingOptions:z}=co(R,u,M,N,D,U,E,P,w,v,Q,!0,"",!1),{loadingOptions:V}=co(R,A,j,N,D,U,E,P,b,v,Q,!0,"",!1);if(I)return null;const K=F&&""!==(x??""),q=z||V?e("span",{children:"loading..."}):e(Ty,{name:k,label:r,error:!T&&K,helperText:!T&&K?x:null,handleChange:N,handleBlur:S,disabled:T,readOnly:O,leftOptions:H,rightOptions:_,leftOptionsLabel:y,rightOptionsLabel:B,valueSide:C},L);return Boolean(f)?e(ie,{...p,children:q}):q};var ky=Object.freeze({__proto__:null,TransferList:Ly,default:Ly});const Dy=({name:t,validate:r,validationRun:n,postValidationSetCrossFieldValues:s,runValidationOnDependentFieldsChange:a,skipValueUpdateFromCrossFieldWhenReadOnly:d,runPostValidationHookAlways:A,shouldExclude:f,isReadOnly:g,dependentFields:m,fieldKey:w,GridProps:b,enableGrid:v,InputProps:y,inputProps:x,isFieldFocused:F,maxLength:N=-1,setColor:S,searchComponent:E=()=>e("span",{children:"No component found attached"}),...T})=>{const{value:L,error:k,touched:D,handleChange:I,handleBlur:U,isSubmitting:P,fieldKey:O,name:R,excluded:Q,readOnly:H,incomingMessage:M,whenToRunValidation:_,runValidation:j,validationAPIResult:z,setIncomingMessage:V}=Js({name:t,fieldKey:w,dependentFields:m,validate:r,validationRun:n,runPostValidationHookAlways:A,postValidationSetCrossFieldValues:s,isReadOnly:g,shouldExclude:f,runValidationOnDependentFieldsChange:a,skipValueUpdateFromCrossFieldWhenReadOnly:d}),[K,q]=c(!1),[G,W]=c("string"==typeof S?S:"");l((()=>{if("function"==typeof S){let e=S(L);W("string"!=typeof e?"":e)}}),[L,S]);const J=h((e=>{I(e,e.target?.formattedValue??void 0)}),[I]),X=h((e=>{"object"==typeof e?V(e):I(e,e),q(!1)}),[I]),Y=o();if(l((()=>{F&&setTimeout((()=>{Y?.current?.focus?.()}),1)}),[F]),l((()=>{if(null!==M&&"object"==typeof M){const{value:e}=M;(Boolean(e)||""===e)&&(I(e),"onBlur"===_&&j({value:e},!0))}}),[M,I,j,_]),Q)return null;y?.inputProps&&(y.inputProps={...y.inputProps,readOnly:H,tabIndex:H?-1:void 0});const $=D&&Boolean(k),Z=i(p,{children:[u(to,{...T,key:O,id:O,name:R,value:L,error:!P&&$,helperText:e("div",{style:{display:"flex"},children:e(Ze,{children:!P&&$?k:Boolean(z)?z:null})}),FormHelperTextProps:{component:"div"},InputProps:{style:!P&&Boolean(G)?{color:G,fontWeight:"bold"}:{},endAdornment:e(B,{position:"end",children:e(C,{"aria-label":"toggle password visibility",onClick:()=>q(!0),children:e(Lr,{})})}),...y},InputLabelProps:{shrink:!0},inputRef:Y,onChange:e=>{(-1===N||e.target.value.length<=N)&&J(e)},inputProps:{readOnly:H,tabIndex:H?-1:void 0,...x},onBlur:U,disabled:P}),e(dt,{open:K,onClose:()=>q(!1),maxWidth:"md",children:u(E,{onAccept:X,value:L},null)})]});return Boolean(v)?e(ie,{...b,children:Z}):Z};var Iy=Object.freeze({__proto__:null,SearchField:Dy,default:Dy});var Uy=Object.freeze({__proto__:null,default:({name:t,validate:i,validationRun:r,postValidationSetCrossFieldValues:n,runValidationOnDependentFieldsChange:s,runPostValidationHookAlways:a,shouldExclude:h,isReadOnly:c,dependentFields:d,fieldKey:A,isFieldFocused:f,setValueOnDependentFieldsChange:g,skipValueUpdateFromCrossFieldWhenReadOnly:m,label:w,enableGrid:b,GridProps:v,onFormButtonClickHandel:y,startsIcon:B,endsIcon:C,rotateIcon:x,iconStyle:F,tabIndex:N,ignoreInSubmit:S=!1,...E})=>{const{value:T,error:L,touched:k,handleChange:D,handleBlur:I,isSubmitting:U,validationRunning:P,fieldKey:O,name:R,excluded:Q,readOnly:H,incomingMessage:M,whenToRunValidation:_,runValidation:j,validationAPIResult:z,dependentValues:V,formState:K,setIgnoreInSubmit:q}=Js({name:t,fieldKey:A,dependentFields:d,validate:i,validationRun:r,runPostValidationHookAlways:a,postValidationSetCrossFieldValues:n,isReadOnly:c,shouldExclude:h,runValidationOnDependentFieldsChange:s,skipValueUpdateFromCrossFieldWhenReadOnly:m}),G=o();l((()=>{f&&W()}),[f,T]);const W=()=>{setTimeout((()=>{G?.current?.focus?.()}),1)};if(l((()=>{if("function"==typeof g){let e=g(ta(V),K);null!=e&&D(e)}}),[V,D,g]),l((()=>{if(null!==M&&"object"==typeof M){const{value:e,isFieldFocused:t}=M;(Boolean(e)||""===e)&&(D(e),t&&W(),"onBlur"===_&&j({value:e},!0))}}),[M,D,j,_]),l((()=>{if(Boolean(S))if("function"==typeof S){let e=S(ta(V),K,{isSubmitting:U,value:T});q(e)}else q(S)}),[S,q,V,T]),Q)return null;const J=e(p,{children:e(za,{color:"secondary",onClick:e=>{"function"==typeof y&&y(A,ta(V)),D(isNaN(T)||!Boolean(T)?"1":parseInt(T)+1)},disabled:H??!1,style:{width:"100%",paddingLeft:"10px",marginTop:"17px"},starticon:B,endicon:C,rotateIcon:x,ref:G,tabIndex:N,sx:{"& svg":{...F}},children:w})});return Boolean(b)?u(Se,{...v,key:A,container:!0,justifyContent:"center",alignItems:"center",alignSelf:"start",mt:"0.65rem"},J):J}});const Py=({name:t,label:i,shouldExclude:r,dependentFields:n,fieldKey:s,GridProps:a,setValueOnDependentFieldsChange:o,skipValueUpdateFromCrossFieldWhenReadOnly:h,DividerProps:c,componentType:d})=>{const{value:u,handleChange:A,excluded:p,incomingMessage:f,dependentValues:g}=Js({name:t,fieldKey:s,dependentFields:n,shouldExclude:r,componentType:d,skipValueUpdateFromCrossFieldWhenReadOnly:h}),{t:m}=ne();return l((()=>{if("function"==typeof o){let e=o(ta(g));null!=e&&A(e)}}),[g,A,o]),l((()=>{if(null!==f&&"object"==typeof f){const{value:e}=f;(Boolean(e)||""===e)&&A(e)}}),[f,A]),p?null:e(Se,{item:!0,...a,children:e(Ee,{textAlign:"left",...c,children:u&&u.length>0?u:m(i??"")})})};var Oy=Object.freeze({__proto__:null,Divider:Py,default:Py});const Ry=t=>{let{defaultValue:r,label:n,enableGrid:s,GridProps:a}=t;"object"==typeof r&&(r=Array.isArray(r)?r.join(","):r?.toDateString?.()??"Invalid Value"),"boolean"==typeof r&&(r=r?"Yes":"No");let o=i("div",{children:[e("b",{children:n}),e("br",{}),r]});return Boolean(s)?e(ie,{...a,children:o}):o};var Qy=Object.freeze({__proto__:null,default:Ry,valueField:Ry});export{Da as AddIDinResponseData,Im as AgGridTableWrapper,Va as Alert,zs as AuthContextProvider,Tl as AutoRefreshProvider,_p as CRUDContext,jp as CRUDContextProvider,La as CheckObjectAllKeyisEmpty,so as Checkbox,no as ChipTextField,oo as ClearCacheContext,lo as ClearCacheProvider,rA as ColorlibConnector,iA as ColorlibStepIconRoot,Ja as ConvertExcelToJSONData,Oa as CreateDetailsRequestData,Pa as CreateLanguageRequestData,Cu as CsvViewer,Gs as CustomPropertiesConfigurationProvider,pA as DataTableGridWrapper,Ua as DefaultErrorObject,hg as DetailsGridWithHeader,Vf as DocumentGridCRUD,Vc as EXPORT_WORKER_STATUS,Bu as ExcelViewer,_a as ExportCSVFileFromData,Ma as ExportExcelFileFromData,Eu as FileUploadControl,Lu as FileViewerGrid,Op as FormComponentView,_s as FormContext,Ac as FormWrapper,ad as FullScreenLoader,za as GradientButton,Xf as GridCRUD,Wa as GridDataExport,ku as GridDataImport,Xd as GridWrapper,Yd as GridWrapperStatic,il as HtmlTooltip,Fu as ImageViewer,Uo as Input,Io as InputLabel,Eo as KeyboardDatePicker,Lo as KeyboardDateTimePicker,To as KeyboardTimePicker,wy as LayoutReport,sd as LoaderPaperComponent,Ga as LoadingTextAnimation,Mp as MasterDetailsForm,wA as MessageBoxNavigateWrapper,mA as MessageBoxWrapper,Nu as NoPreview,Ra as ObjectMappingKeys,xu as PDFViewer,ed as PopupContext,td as PopupContextProvider,bA as PopupMessageAPIWrapper,Gc as PopupRequestWrapper,gA as PrintButton,Ha as ProcessDetailsData,nd as RemarksAPIWrapper,tm as ReportGrid,lm as ReportWrapper,wl as SearchBar,bl as SearchBar2,Fo as SelectWithoutOptions,eg as ServerGrid,Yf as ServerGridContext,$f as ServerGridContextProvider,tg as ServerGridWrapper,Gf as SimpleCRUD,og as SnackbarProviderWrapper,Qa as StringtoUnicode,rg as Tab,ng as Tabs,to as TextField,ro as TextField3,io as TextFieldForSelect,ya as TimeTravelObserver,PA as ToggleButtonGroup,tl as Tooltip,th as Transition,ka as UpdateRequestDataVisibleColumn,nu as UploadTarget,_c as WorkerContext,jc as WorkerContextProvider,xs as atomKeys,Fa as attachMethodsToMetaData,ho as cacheWrapperKeyGen,gu as cleanFileObj,Uc as components,au as computeFileFingerprint,ou as computeSize,wu as convertToFormData,mu as convertToJsonObject,nl as currencySymbol,dm as customCellAggFunc,Ta as deriveData,Ea as deriveFormData,lu as detectMimeType,wm as displayNumber,du as downloadFile,mm as dynamicRowHeight,Au as extractColumnsFromAdditionalMetaData,Sa as extractGridMetaData,Na as extractMetaData,Zd as fileColumns,rm as filters,pm as findFirstDisplayColumn,Am as findLastDisplayColumn,Qs as formArrayFieldRegisterSelector,Rs as formArrayFieldRegistryAtom,Os as formArrayFieldRowsAtom,Hs as formArrayFieldUnregisterSelector,Fs as formAtom,Ns as formFieldAtom,ks as formFieldExcludeAddSelector,Ds as formFieldExcludeRemoveSelector,Us as formFieldRegisterSelector,Is as formFieldRegistryAtom,Ps as formFieldUnregisterSelector,Es as formFieldsErrorWatcherAddSelector,Ss as formFieldsErrorWatcherAtom,Ts as formFieldsErrorWatcherRemoveSelector,Ls as formFieldsExcludedAtom,qd as formatCurrency,hm as getAgGridSRNo,sl as getCurrencySymbol,fm as getGridRowData,bs as getIn,ds as greaterThanDate,us as greaterThanInclusiveDate,ls as greaterThanInclusiveString,os as greaterThanString,Ia as groupBy,ym as handleDeleteButtonClick,su as hashCode,cu as isDuplicate,ws as isInteger,hu as isMimeTypeValid,ms as isObject,gs as isString,bm as lessThanDate,ps as lessThanInclusiveDate,cs as lessThanInclusiveString,hs as lessThanString,um as parseDate,ao as queryClient,gm as removeExistingRowData,fs as ruleEngine,Zf as serverGridContextGenerator,vm as setErrorMessage,vs as setIn,ss as singletonFunctionRegisrationFactory,as as singletonFunctionRegisrationFactoryForTableCells,Ms as subscribeToFormFieldsSelector,ta as transformDependentFieldsState,fu as transformFileObject,uu as transformMetaDataByMutating,kl as useAutoRefresh,Wf as useDialogStyles,lg as useDialogStylesDetailsGrid,Js as useField,va as useFieldArray,ba as useForm,id as usePopupContext,Ws as usePropertiesConfigContext,ag as useSnackbarProviderWrapper,ig as useTabStyles,zc as useWorkerContext,wa as utilFunction,pu as validateFilesAndAddToList,Cs as yupReachAndValidate,Bs as yupValidationHelper};
|
|
133
|
+
var s="undefined",a=null,o=!1,l=function(e,t){this.files={},this.root="",e&&this.load(e,t)};l.signature={LOCAL_FILE_HEADER:"PK",CENTRAL_FILE_HEADER:"PK",CENTRAL_DIRECTORY_END:"PK",ZIP64_CENTRAL_DIRECTORY_LOCATOR:"PK",ZIP64_CENTRAL_DIRECTORY_END:"PK",DATA_DESCRIPTOR:"PK\b"},l.defaults={base64:o,binary:o,dir:o,date:a,compression:a},l.support={arraybuffer:typeof ArrayBuffer!==s&&typeof Uint8Array!==s,nodebuffer:!0,uint8array:typeof Uint8Array!==s,blob:function(){if(typeof ArrayBuffer===s)return o;var e=new ArrayBuffer(0);try{return 0===new Blob([e],{type:"application/zip"}).size}catch(e){}try{var t=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);return t.append(e),0===t.getBlob("application/zip").size}catch(e){}return o}()},l.prototype=function(){var e,t;l.support.uint8array&&"function"==typeof TextEncoder&&"function"==typeof TextDecoder&&(e=new TextEncoder("utf-8"),t=new TextDecoder("utf-8"));var i=function(e){if(e._data instanceof l.CompressedObject&&(e._data=e._data.getContent(),e.options.binary=!0,e.options.base64=!1,"uint8array"===l.utils.getTypeOf(e._data))){var t=e._data;e._data=new Uint8Array(t.length),0!==t.length&&e._data.set(t,0)}return e._data},r=function(t){var r=i(t);if("string"===l.utils.getTypeOf(r)){if(!t.options.binary){if(e)return e.encode(r);if(l.support.nodebuffer)return new vn(r,"utf-8")}return t.asBinary()}return r},n=function(e){var t=i(this);return null==t?"":(this.options.base64&&(t=l.base64.decode(t)),t=e&&this.options.binary?l.prototype.utf8decode(t):l.utils.transformTo("string",t),e||this.options.binary||(t=l.prototype.utf8encode(t)),t)},s=function(e,t,i){this.name=e,this._data=t,this.options=i};s.prototype={asText:function(){return n.call(this,!0)},asBinary:function(){return n.call(this,!1)},asNodeBuffer:function(){var e=r(this);return l.utils.transformTo("nodebuffer",e)},asUint8Array:function(){var e=r(this);return l.utils.transformTo("uint8array",e)},asArrayBuffer:function(){return this.asUint8Array().buffer}};var a=function(e,t){var i,r="";for(i=0;i<t;i++)r+=String.fromCharCode(255&e),e>>>=8;return r},o=function(){var e,t,i={};for(e=0;e<arguments.length;e++)for(t in arguments[e])arguments[e].hasOwnProperty(t)&&void 0===i[t]&&(i[t]=arguments[e][t]);return i},h=function(e,t,i){var r=c(e),n=l.utils.getTypeOf(t);if(r&&d.call(this,r),i=function(e){return!0===(e=e||{}).base64&&null==e.binary&&(e.binary=!0),(e=o(e,l.defaults)).date=e.date||new Date,null!==e.compression&&(e.compression=e.compression.toUpperCase()),e}(i),i.dir||null==t)i.base64=!1,i.binary=!1,t=null;else if("string"===n)i.binary&&!i.base64&&!0!==i.optimizedBinaryString&&(t=l.utils.string2binary(t));else{if(i.base64=!1,i.binary=!0,!(n||t instanceof l.CompressedObject))throw new Error("The data of '"+e+"' is in an unsupported format !");"arraybuffer"===n&&(t=l.utils.transformTo("uint8array",t))}return this.files[e]=new s(e,t,i)},c=function(e){"/"==e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},d=function(e){return"/"!=e.slice(-1)&&(e+="/"),this.files[e]||h.call(this,e,null,{dir:!0}),this.files[e]},u=function(e,t){var i,n=new l.CompressedObject;return e._data instanceof l.CompressedObject?(n.uncompressedSize=e._data.uncompressedSize,n.crc32=e._data.crc32,0===n.uncompressedSize||e.options.dir?(t=l.compressions.STORE,n.compressedContent="",n.crc32=0):e._data.compressionMethod===t.magic?n.compressedContent=e._data.getCompressedContent():(i=e._data.getContent(),n.compressedContent=t.compress(l.utils.transformTo(t.compressInputType,i)))):((i=r(e))&&0!==i.length&&!e.options.dir||(t=l.compressions.STORE,i=""),n.uncompressedSize=i.length,n.crc32=this.crc32(i),n.compressedContent=t.compress(l.utils.transformTo(t.compressInputType,i))),n.compressedSize=n.compressedContent.length,n.compressionMethod=t.magic,n},A=function(e,t,i,r){i.compressedContent;var n,s,o=this.utf8encode(t.name),h=o!==t.name,c=t.options;n=c.date.getHours(),n<<=6,n|=c.date.getMinutes(),n<<=5,n|=c.date.getSeconds()/2,s=c.date.getFullYear()-1980,s<<=4,s|=c.date.getMonth()+1,s<<=5,s|=c.date.getDate();var d="";return d+="\n\0",d+=h?"\0\b":"\0\0",d+=i.compressionMethod,d+=a(n,2),d+=a(s,2),d+=a(i.crc32,4),d+=a(i.compressedSize,4),d+=a(i.uncompressedSize,4),d+=a(o.length,2),d+="\0\0",{fileRecord:l.signature.LOCAL_FILE_HEADER+d+o,dirRecord:l.signature.CENTRAL_FILE_HEADER+"\0"+d+"\0\0\0\0\0\0"+(!0===t.options.dir?"\0\0\0":"\0\0\0\0")+a(r,4)+o,compressedObject:i}},p=function(){this.data=[]};p.prototype={append:function(e){e=l.utils.transformTo("string",e),this.data.push(e)},finalize:function(){return this.data.join("")}};var f=function(e){this.data=new Uint8Array(e),this.index=0};return f.prototype={append:function(e){0!==e.length&&(e=l.utils.transformTo("uint8array",e),this.data.set(e,this.index),this.index+=e.length)},finalize:function(){return this.data}},{load:function(e,t){throw new Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(e){var t,i,r,n,a=[];for(t in this.files)this.files.hasOwnProperty(t)&&(r=this.files[t],n=new s(r.name,r._data,o(r.options)),i=t.slice(this.root.length,t.length),t.slice(0,this.root.length)===this.root&&e(i,n)&&a.push(n));return a},file:function(e,t,i){if(1===arguments.length){if(l.utils.isRegExp(e)){var r=e;return this.filter((function(e,t){return!t.options.dir&&r.test(e)}))}return this.filter((function(t,i){return!i.options.dir&&t===e}))[0]||null}return e=this.root+e,h.call(this,e,t,i),this},folder:function(e){if(!e)return this;if(l.utils.isRegExp(e))return this.filter((function(t,i){return i.options.dir&&e.test(t)}));var t=this.root+e,i=d.call(this,t),r=this.clone();return r.root=i.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!=e.slice(-1)&&(e+="/"),t=this.files[e]),t)if(t.options.dir)for(var i=this.filter((function(t,i){return i.name.slice(0,e.length)===e})),r=0;r<i.length;r++)delete this.files[i[r].name];else delete this.files[e];return this},generate:function(e){e=o(e||{},{base64:!0,compression:"STORE",type:"base64"}),l.utils.checkSupport(e.type);var t,i,r=[],n=0,s=0;for(var h in this.files)if(this.files.hasOwnProperty(h)){var c=this.files[h],d=c.options.compression||e.compression.toUpperCase(),g=l.compressions[d];if(!g)throw new Error(d+" is not a valid compression method !");var m=u.call(this,c,g),w=A.call(this,h,c,m,n);n+=w.fileRecord.length+m.compressedSize,s+=w.dirRecord.length,r.push(w)}var b;switch(b=l.signature.CENTRAL_DIRECTORY_END+"\0\0\0\0"+a(r.length,2)+a(r.length,2)+a(s,4)+a(n,4)+"\0\0",e.type.toLowerCase()){case"uint8array":case"arraybuffer":case"blob":case"nodebuffer":t=new f(n+s+b.length);break;default:t=new p(n+s+b.length)}for(i=0;i<r.length;i++)t.append(r[i].fileRecord),t.append(r[i].compressedObject.compressedContent);for(i=0;i<r.length;i++)t.append(r[i].dirRecord);t.append(b);var v=t.finalize();switch(e.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":return l.utils.transformTo(e.type.toLowerCase(),v);case"blob":return l.utils.arrayBuffer2Blob(l.utils.transformTo("arraybuffer",v));case"base64":return e.base64?l.base64.encode(v):v;default:return v}},crc32:function(e,t){if(void 0===e||!e.length)return 0;var i="string"!==l.utils.getTypeOf(e),r=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];void 0===t&&(t=0);t^=-1;for(var n=0,s=e.length;n<s;n++)t=t>>>8^r[255&(t^(i?e[n]:e.charCodeAt(n)))];return-1^t},clone:function(){var e=new l;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e},utf8encode:function(t){if(e){var i=e.encode(t);return l.utils.transformTo("string",i)}if(l.support.nodebuffer)return l.utils.transformTo("string",new vn(t,"utf-8"));for(var r=[],n=0,s=0;s<t.length;s++){var a=t.charCodeAt(s);a<128?r[n++]=String.fromCharCode(a):a>127&&a<2048?(r[n++]=String.fromCharCode(a>>6|192),r[n++]=String.fromCharCode(63&a|128)):(r[n++]=String.fromCharCode(a>>12|224),r[n++]=String.fromCharCode(a>>6&63|128),r[n++]=String.fromCharCode(63&a|128))}return r.join("")},utf8decode:function(e){var i=[],r=0,n="string"!==l.utils.getTypeOf(e),s=0,a=0,o=0,h=0;if(t)return t.decode(l.utils.transformTo("uint8array",e));if(l.support.nodebuffer)return l.utils.transformTo("nodebuffer",e).toString("utf-8");for(;s<e.length;)(a=n?e[s]:e.charCodeAt(s))<128?(i[r++]=String.fromCharCode(a),s++):a>191&&a<224?(o=n?e[s+1]:e.charCodeAt(s+1),i[r++]=String.fromCharCode((31&a)<<6|63&o),s+=2):(o=n?e[s+1]:e.charCodeAt(s+1),h=n?e[s+2]:e.charCodeAt(s+2),i[r++]=String.fromCharCode((15&a)<<12|(63&o)<<6|63&h),s+=3);return i.join("")}}}(),l.compressions={STORE:{magic:"\0\0",compress:function(e){return e},uncompress:function(e){return e},compressInputType:a,uncompressInputType:a}},function(){function e(e){return e}function t(e,t){for(var i=0;i<e.length;++i)t[i]=255&e.charCodeAt(i);return t}function i(e){var t=65536,i=[],r=e.length,n=l.utils.getTypeOf(e),s=0,a=!0;try{switch(n){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,new vn(0))}}catch(e){a=!1}if(!a){for(var o="",h=0;h<e.length;h++)o+=String.fromCharCode(e[h]);return o}for(;s<r&&t>1;)try{"array"===n||"nodebuffer"===n?i.push(String.fromCharCode.apply(null,e.slice(s,Math.min(s+t,r)))):i.push(String.fromCharCode.apply(null,e.subarray(s,Math.min(s+t,r)))),s+=t}catch(e){t=Math.floor(t/2)}return i.join("")}function r(e,t){for(var i=0;i<e.length;i++)t[i]=e[i];return t}l.utils={string2binary:function(e){for(var t="",i=0;i<e.length;i++)t+=String.fromCharCode(255&e.charCodeAt(i));return t},string2Uint8Array:function(e){return l.utils.transformTo("uint8array",e)},uint8Array2String:function(e){return l.utils.transformTo("string",e)},arrayBuffer2Blob:function(e){l.utils.checkSupport("blob");try{return new Blob([e],{type:"application/zip"})}catch(e){}try{var t=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);return t.append(e),t.getBlob("application/zip")}catch(e){}throw new Error("Bug : can't construct the Blob.")},string2Blob:function(e){var t=l.utils.transformTo("arraybuffer",e);return l.utils.arrayBuffer2Blob(t)}};var n={};n.string={string:e,array:function(e){return t(e,new Array(e.length))},arraybuffer:function(e){return n.string.uint8array(e).buffer},uint8array:function(e){return t(e,new Uint8Array(e.length))},nodebuffer:function(e){return t(e,new vn(e.length))}},n.array={string:i,array:e,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return new vn(e)}},n.arraybuffer={string:function(e){return i(new Uint8Array(e))},array:function(e){return r(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:e,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return new vn(new Uint8Array(e))}},n.uint8array={string:i,array:function(e){return r(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:e,nodebuffer:function(e){return new vn(e)}},n.nodebuffer={string:i,array:function(e){return r(e,new Array(e.length))},arraybuffer:function(e){return n.nodebuffer.uint8array(e).buffer},uint8array:function(e){return r(e,new Uint8Array(e.length))},nodebuffer:e},l.utils.transformTo=function(e,t){if(t||(t=""),!e)return t;l.utils.checkSupport(e);var i=l.utils.getTypeOf(t);return n[i][e](t)},l.utils.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":l.support.nodebuffer&&vn.isBuffer(e)?"nodebuffer":l.support.uint8array&&e instanceof Uint8Array?"uint8array":l.support.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},l.utils.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},l.utils.checkSupport=function(e){var t=!0;switch(e.toLowerCase()){case"uint8array":t=l.support.uint8array;break;case"arraybuffer":t=l.support.arraybuffer;break;case"nodebuffer":t=l.support.nodebuffer;break;case"blob":t=l.support.blob}if(!t)throw new Error(e+" is not supported by this browser")}}(),l.CompressedObject=function(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=a,this.compressedContent=a},l.CompressedObject.prototype={getContent:function(){return a},getCompressedContent:function(){return a}},l.base64=function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return{encode:function(t,i){for(var r,n,s,a,o,l,h,c="",d=0;d<t.length;)a=(r=t.charCodeAt(d++))>>2,o=(3&r)<<4|(n=t.charCodeAt(d++))>>4,l=(15&n)<<2|(s=t.charCodeAt(d++))>>6,h=63&s,isNaN(n)?l=h=64:isNaN(s)&&(h=64),c=c+e.charAt(a)+e.charAt(o)+e.charAt(l)+e.charAt(h);return c},decode:function(t,i){var r,n,s,a,o,l,h="",c=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<t.length;)r=e.indexOf(t.charAt(c++))<<2|(a=e.indexOf(t.charAt(c++)))>>4,n=(15&a)<<4|(o=e.indexOf(t.charAt(c++)))>>2,s=(3&o)<<6|(l=e.indexOf(t.charAt(c++))),h+=String.fromCharCode(r),64!=o&&(h+=String.fromCharCode(n)),64!=l&&(h+=String.fromCharCode(s));return h}}}(),void 0!==window.jQuery&&(window.jQuery.fn.webdatarocks=function(e){return(e=e||{}).container=this.get(0),e=window.WebDataRocks?window.WebDataRocks(e):window.PivotApi(e),this.data("webdatarocks",e),e}),void 0!==window.angular&&window.angular.module("webdatarocks",[]).directive("wbrPivot",(function(){return{restrict:"A",scope:{report:"=wbrReport",customizeCell:"&wbrCustomizeCell",cellclick:"&wbrCellClick",celldoubleclick:"&wbrCellDoubleClick",dataerror:"&wbrDataError",datafilecancelled:"&wbrDataFileCancelled",dataloaded:"&wbrDataLoaded",datachanged:"&wbrDataChanged",fieldslistclose:"&wbrFieldsListClose",fieldslistopen:"&wbrFieldsListOpen",filteropen:"&wbrFilteropen",fullscreen:"&wbrFullscreen",loadingdata:"&wbrLoadingData",loadinglocalization:"&wbrLoadingLocalization",loadingolapstructure:"&wbrLoadingOlapStructure",loadingreportfile:"&wbrLoadingReportFile",localizationerror:"&wbrLocalizationError",localizationloaded:"&wbrLocalizationLoaded",openingreportfile:"&wbrOpeningReportFile",querycomplete:"&wbrQueryComplete",queryerror:"&wbrQueryError",ready:"&wbrReady",reportchange:"&wbrReportChange",reportcomplete:"&wbrReportComplete",reportfilecancelled:"&wbrReportFileCancelled",reportfileerror:"&wbrReportFileError",reportfileloaded:"&wbrReportFileLoaded",runningquery:"&wbrRunningQuery",update:"&wbrUpdate",beforetoolbarcreated:"&wbrBeforeToolbarCreated"},link:function(e,t,i,r){(r={}).container=t[0],function(e,t){void 0!==e.wbrGlobal&&(t.global=e.wbrGlobal),void 0!==e.wbrWidth&&(t.width=e.wbrWidth),void 0!==e.wbrHeight&&(t.height=e.wbrHeight),void 0!==e.wbrToolbar&&(t.toolbar=!0===e.wbrToolbar||"true"==e.wbrToolbar||"on"==e.wbrToolbar)}(i,r),e.customizeCell&&(r.customizeCell=function(t,i){return e.customizeCell({html:t,data:i})}),e.cellclick&&(r.cellclick=function(t){e.cellclick({cell:t})}),e.celldoubleclick&&(r.celldoubleclick=function(t){e.celldoubleclick({cell:t})}),r.dataerror=e.dataerror,r.datafilecancelled=e.datafilecancelled,r.dataloaded=e.dataloaded,r.datachanged&&(r.datachanged=function(t){e.datachanged({event:t})}),r.fieldslistclose=e.fieldslistclose,r.fieldslistopen=e.fieldslistopen,r.filteropen&&(r.filteropen=function(t){e.filteropen({params:t})}),r.fullscreen&&(r.fullscreen=function(t){e.fullscreen({fullScreenMode:t})}),r.loadingdata=e.loadingdata,r.loadinglocalization=e.loadinglocalization,r.loadingolapstructure=e.loadingolapstructure,r.loadingreportfile=e.loadingreportfile,r.localizationerror=e.localizationerror,r.localizationloaded=e.localizationloaded,r.olapstructureerror=e.olapstructureerror,r.olapstructureloaded=e.olapstructureloaded,r.openingreportfile=e.openingreportfile,r.querycomplete=e.querycomplete,r.queryerror=e.queryerror,e.ready&&(r.ready=function(){e.ready({pivot:n})}),r.reportchange=e.reportchange,r.reportcomplete=e.reportcomplete,r.reportfilecancelled=e.reportfilecancelled,r.reportfileerror=e.reportfileerror,r.reportfileloaded=e.reportfileloaded,r.runningquery=e.runningquery,r.loadingdata=e.loadingdata,r.loadingdata=e.loadingdata,r.loadingdata=e.loadingdata,r.update=e.update,e.beforetoolbarcreated&&(r.beforetoolbarcreated=function(t){e.beforetoolbarcreated({toolbar:t})}),e.report&&(r.report=e.report),e.global&&(r.global=e.global);var n=new WebDataRocks(r)}}})),void 0!==window.React&&(window.WebDataRocksReact={Pivot:React.createClass({propTypes:{global:React.PropTypes.object,width:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.number]),height:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.number]),report:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.object]),toolbar:React.PropTypes.bool,customizeCell:React.PropTypes.func,cellclick:React.PropTypes.func,celldoubleclick:React.PropTypes.func,dataerror:React.PropTypes.func,datafilecancelled:React.PropTypes.func,dataloaded:React.PropTypes.func,datachanged:React.PropTypes.func,fieldslistclose:React.PropTypes.func,fieldslistopen:React.PropTypes.func,filteropen:React.PropTypes.func,fullscreen:React.PropTypes.func,loadingdata:React.PropTypes.func,loadinglocalization:React.PropTypes.func,loadingolapstructure:React.PropTypes.func,loadingreportfile:React.PropTypes.func,localizationerror:React.PropTypes.func,localizationloaded:React.PropTypes.func,olapstructureerror:React.PropTypes.func,olapstructureloaded:React.PropTypes.func,openingreportfile:React.PropTypes.func,querycomplete:React.PropTypes.func,queryerror:React.PropTypes.func,ready:React.PropTypes.func,reportchange:React.PropTypes.func,reportcomplete:React.PropTypes.func,reportfilecancelled:React.PropTypes.func,reportfileerror:React.PropTypes.func,reportfileloaded:React.PropTypes.func,runningquery:React.PropTypes.func,update:React.PropTypes.func,beforetoolbarcreated:React.PropTypes.func},render:function(){return React.DOM.div()},componentDidMount:function(){var e={};e.container=ReactDOM.findDOMNode(this),this.parseProps(e),this.webdatarocks=new window.WebDataRocks(e)},shouldComponentUpdate:function(){return!1},componentWillUnmount:function(){},parseProps:function(e){for(var t in this.props)e[t]=this.props[t]}})}),e.exports&&(e.exports=WebDataRocks)}(Md,Md.exports)),Md.exports}var jd=function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.Pivot=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},n=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),s=l(i(1)),a=l(i(2)),o=l(i(3));function l(e){return e&&e.__esModule?e:{default:e}}var h=t.Pivot=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return i.DOMNodeRef=a.default.createRef(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"componentDidMount",value:function(){var e=this.DOMNodeRef.current;this.webdatarocks=new o.default(r({},this.props,{container:e}))}},{key:"shouldComponentUpdate",value:function(){return!1}},{key:"componentWillUnmount",value:function(){this.webdatarocks.dispose()}},{key:"render",value:function(){return a.default.createElement("div",{ref:this.DOMNodeRef},"Pivot")}}]),t}(a.default.Component);h.propTypes={beforetoolbarcreated:s.default.func,cellclick:s.default.func,celldoubleclick:s.default.func,customizeCell:s.default.func,datachanged:s.default.func,dataerror:s.default.func,datafilecancelled:s.default.func,dataloaded:s.default.func,fieldslistclose:s.default.func,fieldslistopen:s.default.func,filteropen:s.default.func,fullscreen:s.default.func,global:s.default.object,height:s.default.oneOfType([s.default.string,s.default.number]),loadingdata:s.default.func,loadinglocalization:s.default.func,loadingreportfile:s.default.func,localizationerror:s.default.func,localizationloaded:s.default.func,openingreportfile:s.default.func,querycomplete:s.default.func,queryerror:s.default.func,ready:s.default.func,report:s.default.oneOfType([s.default.string,s.default.object]),reportchange:s.default.func,reportcomplete:s.default.func,reportfilecancelled:s.default.func,reportfileerror:s.default.func,reportfileloaded:s.default.func,runningquery:s.default.func,toolbar:s.default.bool,update:s.default.func,width:s.default.oneOfType([s.default.string,s.default.number])},t.default=h},function(e,t){e.exports=Qd()},function(e,t){e.exports=r},function(e,t){e.exports=_d()}]);const zd=({rows:t,columns:i,title:r="",onClose:n=()=>{}})=>{const s=o(null),{dynamicAmountSymbol:l,decimalCount:h}=Ws();const c=a((()=>i.filter((e=>!0!==e?.isAutoSequence&&"SRNO"!==e.accessor))),[i]),d=a((()=>{const e={};return c.forEach((t=>{"currency"===t.componentType||t.Cell===kc?e[t.columnName]={type:"number"}:"date"===t.componentType||t.Cell===mc||t.Cell===gc?e[t.columnName]={type:"datetime"}:e[t.columnName]={type:"string"}})),e}),[c]),u=a((()=>t&&t.length?t.map((e=>{const{SRNO:t,...i}=e.values;return i})):[]),[t]),A=a((()=>{if(!u||!u.length)return[];const e=u.map((e=>{const t={};return c.forEach((i=>{t[i.columnName]=e[i.accessor]})),t}));return[d,...e]}),[u,c,d]);return e("div",{children:e(jd.Pivot,{ref:s,toolbar:!0,beforetoolbarcreated:function(e){let t=e.getTabs();e.getTabs=function(){t=t.filter((e=>"wdr-tab-connect"!==e.id&&"wdr-tab-open"!==e.id&&"wdr-tab-save"!==e.id&&"wdr-tab-fullscreen"!==e.id)),t.push({id:"wdr-tab-fullscreen",title:"Fullscreen",rightGroup:!0,mobile:!1,handler:()=>{var e;document.fullscreenElement?document.exitFullscreen&&document.exitFullscreen():(e=document.documentElement).requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()},icon:e.icons.fullscreen},{id:"wdr-tab-close-modal tab",title:"Close",handler:n,rightGroup:!0,icon:'<svg fill="#000000" height="30px" width="30px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" \n viewBox="0 0 512 512" xml:space="preserve">\n <g>\n <g>\n <polygon points="512,59.076 452.922,0 256,196.922 59.076,0 0,59.076 196.922,256 0,452.922 59.076,512 256,315.076 452.922,512 \n 512,452.922 315.076,256"/>\n </g>\n </g>\n </svg>'});const i=t.map((e=>{if("wdr-tab-export"===e.id){e.menu=e.menu.filter((e=>"wdr-tab-export-print"!==e.id&&"wdr-tab-export-pdf"!==e.id));let t=e.menu.findIndex((e=>"wdr-tab-export-excel"===e.id)),i=e.menu.findIndex((e=>"wdr-tab-export-html"===e.id));-1!==t&&(e.menu[t].handler=()=>{s.current?.webdatarocks?.exportTo("excel",{filename:r||"pivot"})}),-1!==i&&(e.menu[i].handler=()=>{s.current?.webdatarocks?.exportTo("html",{filename:r||"pivot"})})}return e}));return i}},height:670,customizeCell:function(e,t){e.text="(blank)"===e.text?" ":e.text},report:{formats:[{name:"",decimalPlaces:h,currencySymbol:sl(l),thousandsSeparator:","}],dataSource:{data:A},options:{grid:{type:"flat",showTooltips:!1},drillThrough:!1}}})})};let Vd=[];const Kd=({label:r,dense:n,columns:s,data:h,loading:d,getRowId:u,defaultColumn:A,allowColumnReordering:p,disableSorting:f,defaultHiddenColumns:g,defaultSortOrder:m,defaultGroupBy:w,multipleActions:b,singleActions:v,doubleClickAction:y,alwaysAvailableAction:B,setGridAction:C,updateGridData:x,hideFooter:F,hideHeader:N,disableGlobalFilter:S,disableGroupBy:E,disableLoader:T,containerHeight:L,occupiedHeight:k,gridProps:D,pageSizes:I,defaultPageSize:U,enablePagination:P,allowRowSelection:O,hideNoDataFound:R,refetchData:Q,hiddenFlag:H,autoRefreshInterval:M,allowFilter:_,filterMeta:j,allowColumnHiding:V,defaultFilter:K,isCusrsorFocused:q,onButtonActionHandel:G,controlsAtBottom:W,actionContextAtBottom:J,headerToolbarStyle:X,disableMultipleRowSelect:Y,columnHeaderStyle:$,variant:Z,enablePaginationInput:ee,defaultSelectedRowId:te,footerNote:re,footerNoteStyles:se,paginationText:ae,searchPlaceholder:le,enableExport:he,subGridLabel:ce,hideActionBar:de,finalMetaData:ue,externalExportState:Ae,onExportModalClose:pe,enablePdfPrint:ge,reportTemplateCode:me,enablePivot:we,handleClickAction:be,RenderSubHeader:ye,subHeaderComponentProps:Be,gridPaperProps:Ce,enableEnterToFocus:xe})=>{const[Fe,Ne]=c(K);Vd=a((()=>qo(Fe,h)),[Fe,h]);const[Se,Ee]=c(te),{defaultGridConfig:Te}=Ws(),{getTableProps:Le,getTableBodyProps:ke,headerGroups:De,prepareRow:Ie,selectedFlatRows:Ue,rows:Pe,page:Oe,gotoPage:Re,footerGroups:Qe,setPageSize:He,state:Me,setGlobalFilter:_e,preGlobalFilteredRows:je,state:{pageIndex:ze,pageSize:Ve},setSortBy:Ke,columns:qe,toggleAllRowsSelected:Ge}=Gt({initialState:{pageIndex:0,pageSize:U,hiddenColumns:g,sortBy:m,groupBy:w},columns:s,defaultColumn:A,data:Vd,getRowId:u,allowColumnReordering:p,autoResetSortBy:!1,disableSortBy:Boolean(f),disableGlobalFilter:Boolean(S),disableGroupBy:Boolean(E),updateGridData:x,gridProps:D,singleActions:v,setGridAction:C,hiddenFlag:H,loading:d,onButtonActionHandel:G,autoResetGlobalFilter:!1,autoResetPage:!s?.some((e=>Boolean(e?.enableColumnSelection))),globalFilter:(e,t,i)=>((e,t,i,r)=>{const n=i.toLowerCase();return e.filter((e=>t.some((t=>{const i=r.find((e=>e.accessor===t)),s=e.values[t];return!ca(s)||"dateTime"!==i?.componentType&&"date"!==i?.componentType?String(s).toLowerCase().includes(n):z(new Date(s),i.dateFormat??"dd/MM/yyyy hh:mm a").toLowerCase().includes(n)}))))})(e,t,i,ue)},Wt,Jt,Xt,Yt,$t,Zt,ei,ti,ii,((t,i)=>r=>{Boolean(t)&&r.visibleColumns.push((t=>[{id:"selectionCheckbox",Header:t=>e(Cl,{...t,setContextMenuSelectedRowId:i}),Cell:t=>e(Bl,{...t,setContextMenuSelectedRowId:i}),minWidth:40,width:40,maxWidth:40},...t]))})(O&&!Y,Ee)),{authState:We}=Vs(),Je=eh(),[Xe,Ye]=c(!1),[$e,Ze]=c(!1),et=o(null),tt=o(null),it=o(null),rt=o(null),nt=P?Oe:Pe,{t:st}=ne(),at=a((()=>Pe.reduce(((e,t)=>(t?.original?._hidden||++e,e)),0)),[Pe]);v=Ko(v,at),b=Ko(b,at),v=Vo(v,Ue,We),b=Vo(b,Ue,We),B=Vo(B,Pe,We,!1,!0);const[ot,lt]=c(null),[ht,ct]=c(null),dt=o(0),ut=o(null),At=(e,t)=>{Re(t)},pt=e=>{He(Number(e.target.value))};l((()=>{const e=e=>{"Enter"===e.key&&it.current&&it?.current?.click?.()};return window.document.addEventListener("keypress",e),()=>{window.document.removeEventListener("keypress",e)}}),[]),l((()=>{const e=setTimeout((()=>{rt.current?.focus?.()}),200);return()=>{e&&clearTimeout(e)}}),[d]),l((()=>{Ue.length>0&&Y&&JSON.stringify(Ue[0]?.original)!==JSON.stringify(tt.current)&&(tt.current=Ue[0]?.original,C({name:"_rowChanged",rows:[{data:Ue[0]?.original}]}))}),[Ue[0]?.original]);const ft=a((()=>{const e=e=>{const t=Ue.length>0&&!J&&!de&&O?`calc(${L?.[e]} - 48px)`:L?.[e];return t&&k?.[e]?W||J&&Ue.length>0?Fe.length?`calc(${t} - ${k?.[e]} - 98px)`:`calc(${t} - ${k?.[e]} - 50px)`:Fe.length?`calc(${t} - ${k?.[e]} - 48px)`:`calc(${t} - ${k?.[e]})`:Fe.length>0?`calc(${t} - 48px)`:t};return{min:e("min"),max:e("max")}}),[Ue,J,de,L,k,Fe]);return i(t,{children:[i(ni,{style:{width:"100%"},...Ce,children:[Boolean(N)?null:e(Ql,{label:r,dense:n,preGlobalFilteredRows:je,globalFilter:Me.globalFilter,setGlobalFilter:_e,alwaysAvailableAction:W?[]:B,setGridAction:C,filteredRows:Pe,selectedFlatRows:Ue,disableGlobalFilter:Boolean(S),refetchData:Q,autoRefreshInterval:M,gotoPage:Re,setSortBy:Ke,allowFilter:_,filters:Fe,setAllFilters:Ne,filterMeta:j,visibleColumns:qe,defaultHiddenColumns:g,allowColumnHiding:V,loading:d,headerToolbarStyle:X,searchPlaceholder:le,enableExport:he&&nt?.length,setOpenExport:Ye,subGridLabel:ce,enablePivot:we&&nt?.length,setOpenPivot:Ze,RenderSubHeader:ye,subHeaderComponentProps:Be}),ye&&!Be.__showInHeader?e(ye,{...Be}):null,Boolean(J)||de||!O?null:e(Fl,{dense:n,selectedFlatRows:Ue,multipleActions:b,singleActions:v,setGridAction:C,submitButtonRef:it,loading:d}),e(Sl,{contextMenuRow:ht,selectedFlatRows:Ue,singleActions:v,multipleActions:b,setGridAction:C,mouseX:ot?.mouseX??null,mouseY:ot?.mouseY??null,handleClose:()=>{ct(null),lt(null),Ee(null)},authState:We}),e(Xl,{dense:n,setAllFilters:Ne,filters:Fe,gotoPage:Re,setSortBy:Ke}),T?null:d?e(gt,{color:"secondary"}):e(Gl,{}),i(ai,{style:{position:"relative",display:"inline-block",overflow:"auto",padding:"outlined"===Z?"0 .5rem":"",maxHeight:ft.max,minHeight:ft.min,borderBottom:F?"":"1px solid rgba(133, 130, 130, 0.8)"},children:[i(oi,{component:"div",...Le(),size:n?"small":"medium",children:[e(Hl,{component:"div",sx:{background:$?.background?$?.background:$?.backgroundColor?$?.backgroundColor:"standard"!==Z?"var(--theme-color4)":"white"},children:De.map((t=>e(hi,{component:"div",...t.getHeaderGroupProps(),children:t.headers.map((t=>e(jl,{variant:Z,column:t,rows:nt,children:t.render("Header")},t.getHeaderProps().key)))})))}),i(di,{component:"div",ref:et,...ke([{style:{display:"block"}}]),onContextMenu:e=>{at<=0&&(v.length>0||b.length>0)&&(e.preventDefault(),ct({}),Ee(""),lt(null===ot?{mouseX:e.clientX-2,mouseY:e.clientY-4}:null))},style:{height:`calc(${ft.min} - 62px)`},children:[nt.length<=0&&!1===R?e(ie,{container:!0,justifyContent:"center",children:e("div",{style:{position:"absolute",left:"50%",height:`calc(${ft.min} - 50px)`,display:"flex",alignItems:"center",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:st("Nodatafound")})}):null,nt.map(((t,i)=>{if(Boolean(t?.original?.[H]))return null;Ie(t);const r=(e=>t=>{t.preventDefault(),ct(e),lt(null===ot?{mouseX:t.clientX-2,mouseY:t.clientY-4}:null)})(t),n=(e=>t=>{t.preventDefault(),void 0!==Vo(y,[e],We,!0)&&C({name:y.actionName,rows:[{data:e?.original,id:e?.id}]})})(t),s=((e,t,i)=>r=>{if("INPUT"!==r?.target?.tagName&&"TEXTAREA"!==r?.target?.tagName){if("Enter"!==r.key&&"Tab"!==r.key&&r.preventDefault(),"Space"===r.code&&Boolean(y)&&Te?.enableDoubleSpaceAction)if(dt.current+=1,2===dt.current){if(void 0===Vo(y,[i],We,!0))return;C({name:y.actionName,rows:[{data:i?.original,id:i?.id}]}),dt.current=0}else ut.current&&clearTimeout(ut.current),ut.current=setTimeout((()=>{dt.current=0}),300);"ArrowUp"===r.key&&t>0?e[t-1]?.id&&(Ge(!1),e[t-1].toggleRowSelected(!0),Ee(e[t-1]?.id),r?.target?.previousElementSibling?.focus?.()):"ArrowDown"===r.key&&t<e.length-1&&e[t+1]?.id&&(Ge(!1),e[t+1].toggleRowSelected(!0),Ee(e[t+1].id),r?.target?.nextElementSibling?.focus?.())}})(nt,i,t);let a=[];return Boolean(t?.original?._rowColor)&&(a=[{style:{background:t?.original?._rowColor}}]),Boolean(t?.original?._style)&&(a=[{style:{...a[0]?.style,...t?.original?._style}}]),q&&(a.length>0?a[0].style.cursor="pointer":a=[{style:{cursor:"pointer"}}]),e(Ml,{...t.getRowProps(a),id:t.id,tabIndex:0,component:"div",ref:t.isSelected||Se===t.id?rt:null,selected:!!t.isSelected||Se===t.id&&t.toggleRowSelected(!0),onKeyDown:s,onContextMenu:r,onDoubleClick:Boolean(y)?n:void 0,onClick:e=>{Boolean(Y)&&(Ge(!1),t.toggleRowSelected(!0),Ee(t.id)),"function"==typeof be&&be(e,{data:t?.original,id:t?.id})},className:"outlined"===Z?Je.outlinedClass:null,sx:{"& > .MuiTableCell-root":{border:"outlined"===Z?"none !important":"auto"},background:t.isSelected?"rgba(0, 0, 0, 0.08)":""},children:t.cells.map((e=>{const{key:t}=e.getCellProps();return e.isAggregated?e.render("Aggregated",{key:t}):e.render("Cell",{key:t})}))})}))]}),e((({footerGroup:t})=>Array.isArray(t?.headers)&&t.headers.some((e=>e.isTotalWithCurrency||e.isTotalWithoutCurrency||e.isSelectedTotal))?e(ve,{component:"div",style:{color:"var(--theme-color2)",background:"var(--theme-color4)",position:"sticky",bottom:0},children:e(hi,{...t.getFooterGroupProps(),component:"div",children:t.headers.map((t=>e(ci,{...t.getFooterProps({style:{textAlign:t?.TableCellProps?.align||"unset",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 10px",lineHeight:"22px",fontWeight:700,fontSize:"small",color:"var(--theme-color3)"}}),component:"div",children:t.render("Footer")},t.id)))})}):null),{footerGroup:Qe[0]})]}),e(Wl,{open:Boolean(d)})]}),re&&e(fe,{component:"div",fontWeight:500,pl:"24px",sx:se,children:st(re)}),F?null:P&&Pe.length>U?e(Ki,{sx:{display:"flex","& .MuiToolbar-root":{display:"flex",alignItems:"baseline",minHeight:"44px"}},variant:"body",component:"div",rowsPerPageOptions:[...new Set([U,...I])]?.sort(((e,t)=>e-t)),colSpan:3,count:Pe.length,rowsPerPage:Number(Ve),page:Number(ze),onPageChange:At,onRowsPerPageChange:pt,ActionsComponent:ee?Kl:Vl}):i(ci,{style:{display:"flex",padding:"8px"},children:[st("TotalNoofRecords")," ",st(ae),": ",at]}),Boolean(W)||Boolean(J)?i("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:Ue.length>0||W?".5rem":0,paddingTop:0},children:[Boolean(W)&&e(Nl,{actions:B,setAction:C,selectedRows:Ue.map((e=>({data:e.original,id:e.id}))),filteredRows:Pe,buttonTextColor:"#fff",buttonBackground:"var(--theme-color1)",loading:d},"alwaysRender"),Boolean(J)&&1===Ue.length?e(Nl,{actions:v,setAction:C,selectedRows:Ue.map((e=>({data:e.original,id:e.id}))),buttonTextColor:"#fff",buttonBackground:"var(--theme-color1)",style:{border:"1px solid var(--theme-color3)",width:"8rem"},submitButtonRef:it,loading:d},"singleFilters"):null,Boolean(J)&&Ue.length>0?e(Nl,{actions:b,setAction:C,selectedRows:Ue.map((e=>({data:e.original,id:e.id}))),buttonTextColor:"#fff",buttonBackground:"var(--theme-color1)",submitButtonRef:it,loading:d},"multipleFilters"):null]}):null]}),$e?e(oe,{open:!0,fullScreen:!0,children:e(zd,{rows:Pe,title:r,columns:ue,onClose:()=>Ze(!1)})}):null,Xe||Ae?e(oe,{open:Xe||Ae,children:e(hd,{globalFilter:Me.globalFilter??"",filters:Fe,title:r,rows:Pe,columns:ue,onClose:()=>{Ye(!1),"function"==typeof pe&&pe()},enablePdfPrint:ge,reportTemplateCode:h?.find((e=>e?.REPORT_PERSONALIZATION_ID))?.REPORT_PERSONALIZATION_ID??me,enableEnterToFocus:xe})}):null]})};function qd(e,t,i="en-IN",r=0,n="start",s=" "){const a=new Intl.NumberFormat(i,{minimumFractionDigits:r}).format(e);return"end"===n?`${a} ${t} ${s}`:`${t} ${a} ${s}`}const Gd=t=>{const i=Ws(),{dynamicAmountSymbol:r,currencyFormat:n,decimalCount:s}=i,{value:a,row:o,column:{isCurrencyCode:l,currencyRefColumn:h,currencySymbolPosition:c}}=t;let d="";l?d=sl(h??r):o&&(d=sl(o?.original?.[h]||r));let u="";return null===a||""===a||isNaN(Number(a))||(u=`${qd(a,d,n,s,c)}`),e($a,{...t,children:u})},Wd=(e,t,i,r=0)=>`${i} ${new Intl.NumberFormat(t,{minimumFractionDigits:r}).format(e)}`,Jd=w((({rows:e,column:{id:r,isTotalWithoutCurrency:n=!1,isTotalWithCurrency:s=!1,totalDecimalCount:o,isSelectedTotal:l=!1,setFooterValue:h,footerLabel:c="",footerIsMultivalue:d=!1,currencyRefColumn:u,isCurrencyCode:A,Cell:p}})=>{const f=Ws();let g=c,m=e.filter((e=>!e.original.ignoreValue));const w=a((()=>m.reduce(((e,t)=>Number(t.values?.[r]??0)+e),0)),[m,r]),b=e.filter((e=>e.isSelected)),v=a((()=>b.reduce(((e,t)=>Number(t.values?.[r]??0)+e),0)),[b,r]);let y=n?"":sl(f.dynamicAmountSymbol);s&&(A?y=sl(u??f.dynamicAmountSymbol):e?.[0]?.original?.[u]&&(y=sl(e?.[0]?.original?.[u]??"")));const B=a((()=>{if(!h)return isNaN(w)?"":p===Gd?Wd(w,f.currencyFormat,y,o??f.decimalCount):w;if("function"==typeof h){const e=h(w,m,f);return d?(Array.isArray(e)&&e?.forEach(((e,t)=>{g=g.replace(`{${t}}`,e)})),g):isNaN(e)?0:e}}),[b,v,w,m]),C=isNaN(v)?"":p===Gd?Wd(v,f.currencyFormat,y,o??f.decimalCount):v;return i(t,{children:[(s||n)&&""!==B&&i("span",{style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:g.includes("\n")?"pre-line":"nowrap",textAlign:"center"},children:[`${Boolean(g)?g:""}`," ",!d&&B]}),l&&""!==C&&i("span",{style:{paddingLeft:"10px"},children:["Selected Total: ",C]})]})})),Xd=d(((t,i)=>e(Tl,{children:e(Yd,{...t,ref:i})}))),Yd=d((({finalMetaData:t,data:i,setData:r,actions:n,setAction:s,loading:c,gridProps:d,refetchData:u,defaultSortOrder:p=[],defaultGroupBy:f=[],defaultFilter:g=[],hideHeader:m=!1,hideFooter:w=!1,autoRefreshInterval:b=0,onClickActionEvent:v=()=>{},controlsAtBottom:y=!1,actionContextAtBottom:B=!1,headerToolbarStyle:C={},disableMultipleRowSelect:x=!1,columnHeaderStyle:F={},variant:N,defaultSelectedRowId:S="",enableExport:E=!1,fieldDataRef:T=null,externalExportState:L=!1,onExportModalClose:k,reportTemplateCode:D,enablePivot:I,handleClickAction:U,RenderSubHeader:P,subHeaderComponentProps:O={},focusScopeId:R="enter-to-focus-static-grid",enableEnterToFocus:Q},H)=>{const{authState:M}=Vs(),{defaultGridConfig:_,defaultExportConfig:j,enableEnterToFocus:z}=Ws(),{pause:V,resume:K}=Ll(),q=o(null),{t:G}=ne();null===q.current&&(q.current=$d({metaData:t,actions:n,setAction:s,authState:M,fieldDataRef:T}));let W=o(i);W.current=i;let J=q.current;const X=a((()=>Array.isArray(J.columns)?J.columns.map((e=>({...e,columnName:G(e.columnName)}))):J.columns??[]),[G]),Y=a((()=>Array.isArray(J.filters)?J.filters.map((e=>({...e,columnName:G(e.columnName)}))):J.filters??[]),[G]),$=a((()=>g),[g]),Z=a((()=>X.reduce(((e,t)=>(e[t.accessor]=t.validation,e)),{})),[X]),ee=a((()=>X.reduce(((e,t)=>(e[t.accessor]="",e)),{})),[X]),te=a((()=>({width:150,maxWidth:200,minWidth:50,Header:el,Footer:Jd,...J?.gridConfig?.defaultColumnConfig})),[J?.gridConfig?.defaultColumnConfig]),ie=h((e=>e[J?.gridConfig?.rowIdColumn]),[J?.gridConfig?.rowIdColumn]),re=a((()=>p),[]),se=a((()=>f),[]),ae=h(((e,t,i,n,s,a="S")=>{let o=0;r((r=>r?.map(((l,h)=>{if(!("A"===a||h===e))return Boolean(l?._hidden)||(o+=1),{...l,_displaySequence:o};let c=!0,d="";if(c=(!Boolean(r?.[h]?._oldData?.[t])||!Boolean(i)||r?.[h]?._oldData?.[t]!==i)&&(!!Boolean(r?.[h]?._isTouchedCol?.[t])||(!(!Boolean(r[h]?.[t])||Boolean(i))||(!(!Boolean(r[h]?.[t])||!Boolean(i)||r[h]?.[t]==i)||!(Boolean(r[h]?.[t])||!Boolean(i))))),c){let e=r?.[h]?._oldData?.[t];d=null==e?r?.[h]?.[t]??"":e}else d=r?.[h]?._oldData?.[t]??"";let u={...r[h],[t]:i,_touched:{...r?.[h]?._touched,[t]:n},_error:{...r?.[h]?._error,[t]:s},_isTouchedCol:{...r?.[h]?._isTouchedCol,[t]:c},_oldData:{...r?.[h]?._oldData}};return c&&(u={...u,_oldData:{...u._oldData,[t]:d}}),"_hidden"!==t&&(o+=1),{...u,_displaySequence:o}}))))}),[r]),oe=h((()=>Array.isArray(W.current)?W.current.map((e=>{const{_touched:t,_error:i,_rowColor:r,_style:n,...s}=e;return s})):[]),[]),le=h((async(e,t)=>{let i=!1,r=Object.keys(Z);if(!Array.isArray(e))return{isValid:i,data:[]};let n=e.map((async(n,s)=>{let a=J?.gridConfig?.hiddenFlag;if(Boolean(n?.[a]))return n;const o=n._touched??{},l=n._error??{};for(let h=0;h<r.length;h++){const c=o[r[h]],d=l[r[h]],u=n[r[h]],A=Z[r[h]];if(Boolean(c)&&!1===t){if(!Boolean(d))continue;i=!0}else if("function"==typeof A){let t=await A(u,n,e.slice(0,s).filter((e=>!0!==Boolean(e[a]))),e.slice(s+1).filter((e=>!0!==Boolean(e[a]))));Boolean(t)&&(i=!0),o[r[h]]=!0,l[r[h]]=t}}return{...n,_touched:o,_error:l}})),s=await Promise.all(n);return{hasError:i,data:s}}),[]),he=h((async e=>le(W.current,e)),[]),ce=h(((e,t)=>{v(e,t,i[e])}),[i]);A(H,(()=>({validate:(e=!1)=>he(e),validator:()=>le,cleanData:()=>oe(),columns:ee,pause:V,resume:K,refetch:u,updateGridData:ae})));const de=o(null),ue=Q??z,Ae=R&&ue?{"data-scope-id":R}:{};return l((()=>{ue&&de.current&&de.current.focus()}),[ue]),Array.isArray(i)?e("div",{ref:de,tabIndex:0,onKeyDown:e=>{ue&&ma(e,R)},style:{width:"100%",position:"relative"},...Ae,children:e(Kd,{label:J.gridConfig?.gridLabel?G(J.gridConfig.gridLabel):fa(window.location.pathname,M?.menulistdata??[],!0),dense:!0,getRowId:ie,columns:X,defaultColumn:te,data:i,loading:c,allowColumnReordering:J.gridConfig?.allowColumnReordering,disableSorting:J?.gridConfig?.disableSorting,defaultHiddenColumns:J.hiddenColumns,defaultSortOrder:re,defaultGroupBy:se,multipleActions:J?.multipleActions,singleActions:J?.singleActions,handleClickAction:U,doubleClickAction:J?.doubleClickAction,alwaysAvailableAction:J?.alwaysAvailableAction,setGridAction:J?.setAction,updateGridData:ae,hideFooter:J?.gridConfig?.hideFooter??w,hideHeader:J?.gridConfig?.hideHeader??m,containerHeight:J?.gridConfig?.containerHeight,occupiedHeight:J?.gridConfig?.occupiedHeight,allowRowSelection:J?.gridConfig?.allowRowSelection??!0,disableGlobalFilter:J?.gridConfig?.disableGlobalFilter,disableGroupBy:J?.gridConfig?.disableGroupBy,disableLoader:J?.gridConfig?.disableLoader,pageSizes:J?.gridConfig?.pageSizes??[5,10],defaultPageSize:J?.gridConfig?.defaultPageSize??10,enablePagination:J?.gridConfig?.enablePagination??!1,hideNoDataFound:J?.gridConfig?.hideNoDataFound??!1,hiddenFlag:J?.gridConfig?.hiddenFlag,gridProps:d,refetchData:u,autoRefreshInterval:b,allowFilter:J.gridConfig?.allowFilter??!1,filterMeta:Y,allowColumnHiding:J.gridConfig?.allowColumnHiding??!1,defaultFilter:$,isCusrsorFocused:J.gridConfig?.isCusrsorFocused??!1,onButtonActionHandel:ce,controlsAtBottom:y,actionContextAtBottom:B,headerToolbarStyle:C,disableMultipleRowSelect:x,columnHeaderStyle:F,variant:N??_?.variant??"standard",enablePaginationInput:J.gridConfig?.enablePaginationInput??_?.enablePaginationInput??!0,defaultSelectedRowId:S,searchPlaceholder:J.gridConfig?.searchPlaceholder??"records",paginationText:J.gridConfig?.paginationText??"records",enableExport:E,footerNote:J.gridConfig?.footerNote??"",footerNoteStyles:J.gridConfig?.footerNoteStyles??{},subGridLabel:G(J.gridConfig?.subGridLabel??""),hideActionBar:J.gridConfig.hideActionBar??!1,finalMetaData:t.columns.map((e=>({...e,columnName:G(e.columnName)}))),externalExportState:L,onExportModalClose:k,enablePdfPrint:J?.gridConfig?.enablePdfPrint??j?.enablePdfPrint??!1,reportTemplateCode:D,enablePivot:I,RenderSubHeader:P,subHeaderComponentProps:O,gridPaperProps:J?.gridConfig?.gridPaperProps??{},enableEnterToFocus:ue})}):e("div",{children:"Invalid data received"})}));Xd.displayName="GridWrapper";const $d=({metaData:e,actions:t,setAction:i,authState:r,fieldDataRef:n})=>{let s=O(e),a=(e=>Fa(e,ss,Wo,Jo))(s),o=a.columns;const l=_o(o);o=(e=>Array.isArray(e)?e.map((e=>{const{schemaValidation:t,...i}=e;return{...i,schemaValidation:Yo(t)}})):[])(o),o=eo(o),o=Xa(o),o=((e,t,i)=>Array.isArray(e)?e.map((e=>{const{schemaValidation:r,validation:n,...s}=e;return{...s,validation:Zo(r,n,t,i)}})):[])(o,r,n),o=jo(o);let h=s.filters;try{h=Mo(h)}catch(e){console.log(e)}const c=zo(t??null);return{hiddenColumns:l,columns:o,gridConfig:s.gridConfig,setAction:i,filters:h,...c}},Zd=e=>[{columnName:"FileName",componentType:e?"editableTextField":"default",accessor:"name",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Size",componentType:"default",accessor:"sizeStr",sequence:2,alignment:"left",width:100,maxWidth:100,minWidth:100},{columnName:"Type",componentType:"default",accessor:"fileExt",sequence:3,alignment:"left",width:100,maxWidth:100,minWidth:100}],eu={columns:[{columnName:"File ID",componentType:"default",accessor:"id",sequence:0,alignment:"left",isVisible:!1},...Zd(!1)],gridConfig:{dense:!0,gridLabel:"Files",rowIdColumn:"id",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,disableLoader:!0,hideHeader:!0,containerHeight:{min:"40vh",max:"50vh"}}},tu={columns:[{columnName:"File ID",componentType:"default",accessor:"id",sequence:0,alignment:"left",isVisible:!1},{columnName:"File Name",componentType:"default",accessor:"name",sequence:1,alignment:"left",width:400,maxWidth:400,minWidth:400},{columnName:"Size",componentType:"default",accessor:"sizeStr",sequence:2,alignment:"left",width:100,maxWidth:100,minWidth:100},{columnName:"Type",componentType:"default",accessor:"fileExt",sequence:3,alignment:"left",width:100,maxWidth:100,minWidth:100},{columnName:"Reason",componentType:"default",accessor:"failedReason",sequence:4,alignment:"left",width:300,maxWidth:300,minWidth:300}],gridConfig:{dense:!0,gridLabel:"Failed To Add These Files For Upload",rowIdColumn:"id",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,allowRowSelection:!1,disableGlobalFilter:!0,disableSorting:!0,disableGroupBy:!0,hideHeader:!0}},iu=Ci((e=>({uploadWrapper:{backgroundImage:"url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' stroke='%232538584A' stroke-width='4' stroke-dasharray='8' stroke-dashoffset='4' stroke-linecap='square'/%3e%3c/svg%3e\")",display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing(4)}}))),ru=({disabled:e})=>({pointerEvents:e?"none":"all",opacity:e?.5:1}),nu=r=>{const n=iu(),{onDrop:s,disabled:a,existingFiles:l,accept:h,multiple:c}=r,d=o(null),{t:u}=ne(),[{canDrop:A,isOver:p},f]=bt({accept:[mt.FILE],drop(e,t){if("function"==typeof s){const e=Array.from(t.getItem().files);s(e,l)}},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),g=A&&p;return e("div",{ref:f,style:ru({disabled:Boolean(a)}),className:n.uploadWrapper,children:g?e(vt,{children:u("DropFileshere")}):i(t,{children:[e(vt,{children:u("DragandDropor")}),e(ct,{color:"secondary",onClick:()=>d?.current?.click(),children:u("Browse")}),e("input",{type:"file",multiple:c,accept:Array.isArray(h)?h?.map((e=>`.${e}`)).join(","):`.${h}`,style:{display:"none"},ref:d,onChange:e=>{const t=e.target.files,i=Array.from(t);s(i,l)},onClick:e=>{e.target.value=""}})]})})};function su(e){var t=0;if(0===e.length)return t;for(var i=0;i<e.length;i++){t=(t<<5)-t+e.charCodeAt(i),t&=t}return t}function au(e){return su([e.name,e.type,e.size,e.lastModified].join("-"))}const ou=e=>{if(Number.isInteger(Number(e))){let t=`${e} bytes`;const i=["KB","MB","GB","TB","PB","EB","ZB","YB"];for(let r=0,n=e/1024;n>1;n/=1024,r++)t=`${n.toFixed(2)} ${i[r]}`;return t}return"cannot compute size"},lu=async e=>{var t;return await(t=e,new Promise(((e,i)=>{try{const r=new FileReader;r.onloadend=i=>{const r=new Uint8Array(i?.target?.result).subarray(0,4);let n,s="";for(let e=0;e<r.length;e++){let t=r[e].toString(16);t.length<2&&(t="0"+t),s+=t}switch(s=s.toUpperCase(),s){case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":n={ext:"jpg",mime:"image/jpeg"};break;case"89504E47":n={ext:"png",mime:"image/png"};break;case"47494638":n={ext:"gif",mime:"image/gif"};break;case"25504446":n={ext:"pdf",mime:"application/pdf"};break;case"504B0304":n={ext:t.name.split(".").pop()??"xlsx",mime:t.type??"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};break;case"494433":n={ext:"mp3",mime:"audio/mpeg"};break;case"66747970":n={ext:"mp4",mime:"video/mp4"};break;case"52494646":n={ext:"wav",mime:"audio/wav"};break;case"74657874":n={ext:"txt",mime:"text/plain"};break;default:return void e(void 0)}e(n)},r.onerror=i,r.readAsArrayBuffer(t.slice(0,4))}catch(e){i(void 0)}})))};const hu=(e,t)=>"all"===t||Array.isArray(t)&&t.indexOf(e)>-1,cu=(e,t)=>Array.isArray(t)&&t.indexOf(e.id)>-1;function du(e,t){const i="object"==typeof e&&URL.createObjectURL(e),r=document.createElement("a");r.href=String(i),r.download=t??e.name??`download-${(new Date).getUTCMilliseconds()}`;const n=()=>{setTimeout((()=>{URL.revokeObjectURL(String(i)),r.removeEventListener("click",n)}),150)};r.target="_blank",r.addEventListener("click",n,!1),r.click()}const uu=(e,t,i)=>{const r=O(e);if(Boolean(i))for(let e=0;e<r.columns.length;e++)"name"===r.columns[e].accessor&&(r.columns[e].componentType="editableTextField");return Array.isArray(t)&&(r.columns=[...e.columns,...t]),r},Au=e=>{if(Array.isArray(e)){return e.reduce(((e,t)=>(e[t.accessor]="",e)),{})}return{}},pu=(e,t,i)=>async(r,n)=>{let s=[],a=r.map((t=>e(t))),o=await Promise.all(a),l=[];Array.isArray(n)&&(l=n.map((e=>e.id)));let h=o.filter((e=>e.size>t?(s.push({...e,failedReason:"File Size exceed maximum size"}),!1):hu(e.fileExt,i)?!cu(e,l)||(s.push({...e,failedReason:"File already added for uploading"}),!1):(s.push({...e,failedReason:"File type is not allowed"}),!1)));return{failedFiles:s,filteredNewFilesObj:h}},fu=e=>async t=>{const i=await lu(t);return{...e,id:au(t),blob:t,name:t.name.split(".").slice(0,-1).join("."),sizeStr:ou(t.size),size:t.size,mimeType:t.type,_mimeType:i?.mime??t.type,ext:i?.ext??t.name.split(".").pop(),fileExt:t.name.split(".").pop()}},gu=e=>Array.isArray(e)?e.map((e=>{const{id:t,blob:i,name:r,sizeStr:n,size:s,mimeType:a,_mimeType:o,ext:l,fileExt:h,...c}=e;return{name:`${r}.${l}`,blob:i,ext:l,id:t,...c}})):[],mu=async e=>{let t=[];if(!Array.isArray(e)||0===e.length)return t;for(let i=0;i<e.length;i++){const{blob:r,...n}=e[i];let s=await na(r);t.push({...n,blob:s[1],blobtype:s[0]})}return t},wu=e=>{const t=new FormData;if(!Array.isArray(e)||0===e.length)return t;const i={};for(let r=0;r<e.length;r++){const{blob:n,id:s,...a}=e[r];t.append("blob",n,`${s}`),i[`${s}`]=a}return t.append("metaData",JSON.stringify(i)),t},bu=e=>{const t=e[0]?.map(((e,t)=>({accessor:e,columnName:e,sequence:t+1,componentType:"default",width:180,minWidth:120,maxWidth:600,showTooltip:!0})));let i=[];return t&&(i=[{columnName:"UNIQUE",accessor:"UNIQUE",componentType:"default",isVisible:!1},...t]),i},vu=e=>{const t=e.slice(1).map((t=>t.reduce(((t,i,r)=>({...t,[e[0][r]]:i})),{})));let i=[];return t&&(i=t.map(((e,t)=>({UNIQUE:t+1,...e})))),i},yu=e=>({gridConfig:{gridLabel:"",rowIdColumn:"UNIQUE",defaultColumnConfig:{width:400,maxWidth:450,minWidth:300},hideHeader:!0,disableGroupBy:!0,enablePagination:!0,pageSizes:[15,30,50],defaultPageSize:15,containerHeight:{min:"67vh",max:"70vh"},allowFilter:!1,allowColumnHiding:!1,allowRowSelection:!1},columns:bu(e)??[]}),Bu=({blob:t,fileName:r,onClose:n})=>{const[s,a]=c([]),[o,h]=c(!1);return l((()=>{(()=>{const e=new FileReader;h(!0),e.onload=e=>{const t=e.target.result,i=tt.read(t,{type:"binary",raw:!1}),r=i.SheetNames[0],n=i.Sheets[r],s=tt.utils.sheet_to_json(n,{header:1,raw:!1}).map((e=>e.map((e=>{const t=pa(e,!0);return t instanceof Date&&V(t)?t.toLocaleDateString("en-UK"):e}))));h(!1),a(s)},t?e.readAsBinaryString(t):a([])})()}),[]),i(p,{children:[i(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:r}),e("div",{style:{flexGrow:1}}),"function"==typeof n?e(C,{color:"secondary",onClick:n,children:e(Bt,{})}):null]}),i(pt,{children:[o?e(Ga,{}):null,s.length>0?e(Yd,{finalMetaData:yu(s??[]),data:vu(s)??[],setData:()=>null},"previewExcelFileData"):e("p",{style:{textAlign:"center",color:"#888"},children:e("em",{children:o?"File is Loading...":"Empty file found!!!"})})]})]})},Cu=({blob:t,fileName:r,onClose:n})=>{const[s,a]=c([]),[o,h]=c(!1);return l((()=>{(async()=>{h(!0),Ct.parse(t,{header:!1,skipEmptyLines:!0,complete:e=>{h(!1);const t=e.data.map((e=>e.map((e=>{const t=pa(e,!0);return t instanceof Date&&V(t)?t.toLocaleDateString("en-UK"):e}))));a(t)},error:e=>{h(!1),a([])}})})()}),[]),i(p,{children:[i(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:r}),e("div",{style:{flexGrow:1}}),"function"==typeof n?e(C,{color:"secondary",onClick:n,children:e(Bt,{})}):null]}),i(pt,{children:[o?e(Ga,{}):null,s.length>0?e(Yd,{finalMetaData:yu(s??[]),data:vu(s)??[],setData:()=>null},"previewCsvFileData"):e("p",{style:{textAlign:"center",color:"#888"},children:e("em",{children:o?"File is Loading...":"Empty file found!!!"})})]})]})},xu=({blob:r,fileName:n,onClose:s,optionalActionButton:a,hideDownloadBtn:o=!1,hideFilename:h=!1,contentStyle:d,actionStyle:u})=>{const{t:A}=ne(),[f,g]=c("object"==typeof r&&Boolean(r)?URL.createObjectURL(r):null);return l((()=>{let e=f??"";return()=>{URL.revokeObjectURL(e)}}),[]),l((()=>{g("object"==typeof r&&Boolean(r)?URL.createObjectURL(r):null)}),[r]),i(p,{children:[i(At,{style:{display:"flex",padding:"8px 24px",...u},children:[h?null:i(t,{children:[i(vt,{variant:"h6",color:"textSecondary",children:[A("File"),":"]}),e(vt,{variant:"h6",children:n})]}),e("div",{style:{flexGrow:1}}),Boolean(a)?e(za,{color:"primary",onClick:()=>{"function"==typeof a?.callback&&a.callback()},children:a?.label??"NO_LABEL"}):null,o&&e(C,{color:"secondary",onClick:()=>du(r,n),children:e(yt,{})}),"function"==typeof s?e(C,{color:"secondary",onClick:s,children:e(Bt,{})}):null]}),e(pt,{style:{...d},children:e("iframe",{title:"Document Preview",src:`${f}`,style:{height:"100%",width:"100%"},"aria-label":"PDF Preview"})})]})},Fu=({blob:r,fileName:n,onClose:s,hideFilename:a,canZoom:o=!0})=>{const[h,d]=c("object"==typeof r&&Boolean(r)?URL.createObjectURL(r):""),[u,A]=c(1);return l((()=>{let e=h??"";return()=>URL.revokeObjectURL(e)}),[]),l((()=>{d("object"==typeof r&&Boolean(r)?URL.createObjectURL(r):"")}),[r]),i(p,{children:[i(At,{style:{display:"flex",padding:"8px 24px"},children:[a?null:i(t,{children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:n})]}),e("div",{style:{flexGrow:1}}),o?i(t,{children:[e(C,{color:"secondary",onClick:()=>A((e=>Math.max(e-.25,.25))),children:e(Ft,{})}),e(C,{color:"secondary",onClick:()=>A(1),children:e(Nt,{})}),e(C,{color:"secondary",onClick:()=>A((e=>Math.min(e+.25,4))),children:e(xt,{})})]}):null,e(C,{color:"secondary",onClick:()=>du(r,n),children:e(yt,{})}),"function"==typeof s?e(C,{color:"secondary",onClick:s,children:e(Bt,{})}):null]}),e(pt,{children:e("img",{src:h,alt:"Preview",style:{transform:`scale(${u})`,transition:"transform 0.2s ease",transformOrigin:"top left",maxWidth:"100%",width:"60%",maxHeight:"80vh"}})})]})},Nu=({onClose:t,fileName:r,message:n})=>i(p,{children:[i(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:r}),e("div",{style:{flexGrow:1}}),"function"==typeof t?e(C,{color:"secondary",onClick:t,children:e(Bt,{})}):null]}),e(pt,{children:n})]}),Su=[{actionName:"Delete",actionLabel:"Delete",multiple:!0,rowDoubleClick:!1},{actionName:"View",actionLabel:"ViewFile",multiple:!1,rowDoubleClick:!1}],Eu=({additionalColumns:t,editableFileName:r,onClose:n,onUpload:s,dataChangedRef:d,allowedExtensions:u=["pdf"],maxAllowedSize:A=3145728,gridProps:f,defaultFileData:g=[],onUpdateFileData:m=e=>{},allowMultipleFilesSelection:w=!1})=>{const b=a((()=>uu(eu,t,r)),[]),v=a((()=>Au(t)),[]),y=h((e=>fu(v)(e)),[v]),[B,C]=c(g),[x,F]=c(""),[N,S]=c([]),[E,T]=c(!1),[L,k]=c(null),[D,I]=c(!1),[U,P]=c(1/0),O=o(null),{t:R}=ne(),Q=h((async(e,t)=>{let{filteredNewFilesObj:i,failedFiles:r}=await pu(y,A,u)(e,t);C((e=>w?[...e,...i]:i)),r.length>0&&(S(r),T(!0))}),[C,S,T,y,A,u]);l((()=>{if("Delete"===L?.name){const e=L?.rows?.map?.((e=>e.id)),t=B.filter((t=>e.indexOf(t.id)<0));C(t),k(null)}}),[L]),l((()=>{m(B)}),[B]);const H=h((async e=>{let{hasError:t,data:i}=await(O?.current?.validate?.(!0));if(!0===t)C(i);else{let t=O?.current?.cleanData?.(),i=gu(t),r=wu(i),s=await mu(t);I(!0),F(""),e(r,(e=>{P(e)}),(({status:e,data:t})=>{"success"===e?(d.current=!0,n()):F(t?.error_msg??"unknown error occured"),I(!1)}),s,t)}}),[I,F,C]);return i(p,{children:[D?e(gt,{variant:U===1/0?"indeterminate":"determinate",value:U,color:"secondary"}):null,i(st,{children:[e(lt,{title:R("FileUpload"),action:i(ot,{children:[e("div",{style:{flexGrow:2}}),"function"==typeof s?e(ct,{disabled:D||B.length<=0,size:"small",color:"secondary",onClick:()=>H(s),endIcon:D?e(re,{size:20,color:"secondary"}):null,children:R("Upload")}):null,e(ct,{disabled:D||B.length<=0,onClick:()=>C([]),size:"small",color:"secondary",children:R("ClearAll")}),"function"==typeof n?e(ct,{disabled:D,onClick:()=>{let e=O?.current?.cleanData?.();m(e),n()},size:"small",color:"secondary",children:R("Close")}):null]})}),Boolean(x)?e(ft,{severity:"error",children:x}):null,i(at,{children:[e(nu,{existingFiles:B,onDrop:Q,disabled:D,multiple:w,accept:u}),e(ht,{in:B.length>0,children:e(Xd,{finalMetaData:b,data:B,setData:C,actions:Su,setAction:k,loading:D,ref:O,gridProps:f})})]})]}),i(dt,{open:E,maxWidth:"lg",children:[e(ut,{children:R("FailedToAddFollowingFilesForUpload")}),e(pt,{children:e(Xd,{finalMetaData:tu,data:N,setData:e=>null})}),e(At,{children:e(ct,{color:"secondary",onClick:()=>{T(!1),S([])},children:R("Ok")})})]}),e(dt,{open:Boolean(L),maxWidth:"lg",onClose:()=>k(null),PaperProps:{style:{width:"100%",height:"100%"}},children:L?.rows[0]?.data?._mimeType?.includes("pdf")?e(xu,{blob:L?.rows[0]?.data?.blob,fileName:L?.rows[0]?.data?.name,onClose:()=>k(null)}):L?.rows[0]?.data?._mimeType?.includes("image")?e(Fu,{blob:L?.rows[0]?.data?.blob,fileName:L?.rows[0]?.data?.name,onClose:()=>k(null)}):"xlsx"===L?.rows[0]?.data?.ext||"xls"===L?.rows[0]?.data?.ext?e(Bu,{blob:L?.rows[0]?.data?.blob,fileName:L?.rows[0]?.data?.name,onClose:()=>k(null)}):"csv"===L?.rows[0]?.data?.ext?e(Cu,{blob:L?.rows[0]?.data?.blob,fileName:L?.rows[0]?.data?.name,onClose:()=>k(null)}):e(Nu,{fileName:L?.rows[0]?.data?.name,onClose:()=>k(null),message:"No preview available for this file"})})]})},Tu=[{actionName:"View",actionLabel:"ViewFile",multiple:!1,rowDoubleClick:!1}],Lu=({additionalColumns:t,editableFileName:r,fileData:n,onClose:s,gridProps:l})=>{const h=a((()=>uu(eu,t,r)),[]),[d,u]=c(n??[]),[A,f]=c(null),g=o(null),{t:m}=ne();return i(p,{children:[e(st,{children:i(at,{children:[e(lt,{title:m("FileViewer"),action:i(ot,{children:[e("div",{style:{flexGrow:2}}),"function"==typeof s?e(ct,{disabled:!1,onClick:()=>s(),size:"small",color:"secondary",children:m("Close")}):null]})}),e(Xd,{finalMetaData:h,data:d,setData:u,actions:Tu,setAction:f,loading:!1,ref:g,gridProps:l})]})}),e(dt,{open:Boolean(A),maxWidth:"lg",onClose:()=>f(null),PaperProps:{style:{width:"100%",height:"100%"}},children:A?.rows[0]?.data?._mimeType?.includes("pdf")?e(xu,{blob:A?.rows[0]?.data?.blob,fileName:A?.rows[0]?.data?.name,onClose:()=>f(null)}):A?.rows[0]?.data?._mimeType?.includes("image")?e(Fu,{blob:A?.rows[0]?.data?.blob,fileName:A?.rows[0]?.data?.name,onClose:()=>f(null)}):e(Nu,{fileName:A?.rows[0]?.data?.name})})]})},ku=({open:i,closeDialog:r,setImportedData:n})=>{const[s,a]=c(!0),[o,l]=c([]),h=()=>{r()};return e(t,{children:s?e(oe,{fullWidth:!0,maxWidth:"md",open:i,children:e(Eu,{onClose:()=>{h()},additionalColumns:[],editableFileName:!1,defaultFileData:[],onUpload:(e,t,i,r,s)=>{r.length>0?(t(10),setTimeout((async()=>{try{(async(e,t)=>{t(20);let i=80/(e.length>0?e.length:1),r=[];e.forEach(((e,n)=>{let s=Ja({data:e}),{blob:a,...o}=e,l=((e,t,i,r)=>(i(r-10),t))(0,s,t,10+i*(n+1));r=[...r??[],...l]})),t(95),t(100),l(r),n(r),setTimeout((()=>{a(!1),h()}),1e3),t(97),r=r.filter((e=>Boolean(e?._isNewRow))),t(99),r=r.map(((e,t)=>({...e,TRAN_CD:t+1})))})(r,t)}catch(e){i({status:"failed",data:{error_msg:"Error in file read "+String(e)}})}}),1e3)):i({status:"failed",data:{error_msg:"Error in file read"}})},gridProps:{},maxAllowedSize:12328960,allowedExtensions:["xlsx","csv"],onUpdateFileData:e=>{}},"GridFileUploadData")}):null})},Du=e=>{const{data:t,index:i,style:r}=e;return g(t[i],{style:{...r,whiteSpace:"pre",width:"max-content",minWidth:"100%",top:r.top+8}})},Iu=n({}),Uu=d(((t,i)=>{const r=s(Iu);return e("div",{ref:i,...t,...r})})),Pu=d(((t,i)=>{const{children:r,...n}=t,s=b.toArray(r),a=ue(),h=Ni(a.breakpoints.up("sm"),{noSsr:!0}),c=s.length,d=h?29.5:48,u=()=>d,A=(e=>{const t=o(null);return l((()=>{null!==t.current&&t.current.resetAfterIndex(0,!0)}),[e]),t})(c);return e("div",{ref:i,children:e(Iu.Provider,{value:n,children:e(Si,{itemData:s,height:(c>8?10*d:s.map(u).reduce(((e,t)=>e+t),0))+16,width:"100%",ref:A,outerElementType:Uu,innerElementType:"ul",itemSize:u,overscan:5,itemCount:c,children:Du})})})}));var Ou=Object.freeze({__proto__:null,ListBoxComponent:Pu});const Ru=[{actionName:"close",actionLabel:"Close",multiple:void 0,alwaysAvailable:!0},{actionName:"close-dbl",actionLabel:"Close",multiple:void 0,alwaysAvailable:!1,rowDoubleClick:!0}],Qu=(e=[],t={})=>({gridConfig:{dense:!0,gridLabel:"SelectAValue",rowIdColumn:"UNIQUE_ID",defaultColumnConfig:{width:440,maxWidth:450,minWidth:300},allowColumnReordering:!0,disableSorting:!1,hideHeader:!1,disableGroupBy:!0,enablePagination:!0,pageSizes:[10,20,30],defaultPageSize:10,containerHeight:{min:"53vh",max:"53vh"},allowFilter:!0,allowColumnHiding:!1,allowRowSelection:!1,isCusrsorFocused:!0},columns:[{accessor:"UNIQUE_ID",columnName:"SrNo",sequence:0,componentType:"default",width:70,minWidth:60,maxWidth:100},...e.length>0?Object.keys(e[0]).map(((e,i)=>({accessor:e,columnName:e,sequence:i+1,componentType:"default",width:150,minWidth:100,showTooltip:!0,...t[e]}))):[]],filters:e.length>0?Object.keys(e[0]).filter((e=>!1!==t[e]?.isVisible)).map((e=>({accessor:e,columnName:t[e]?.columnName??e,filterComponentType:"valueFilter",gridProps:{xs:12,md:12,sm:12}}))):[]}),Hu=({handleClose:t,options:i,optionsGridColDef:r})=>{const n=a((()=>i.map((e=>{const{label:t,value:i,REPORT_PERSONALIZATION_ID:r,...n}=e;return{label:t,value:i,...n}}))),[i]),s=h((e=>{if("close"===e?.name)t();else if("close-dbl"===e?.name){const i=e?.rows[0]?.data?.value??void 0;t(i)}}),[]),o=a((()=>n.map(((e,t)=>({...e,UNIQUE_ID:t+1})))),[n]);return l((()=>{const e=setTimeout((()=>{const e=document.querySelectorAll(".gridwrapper_global_search input");e.length>0&&e[e.length-1].focus()}),100);return()=>clearTimeout(e)}),[]),e(oe,{open:!0,className:"optionsGrid",PaperProps:{style:{width:"100%",padding:"8px"}},maxWidth:"md",onKeyUp:e=>{"Escape"===e.key&&t()},children:e(Xd,{finalMetaData:Qu(n,r),data:o??[],setData:()=>null,actions:Ru,setAction:s,enableExport:!0},"optionsGrid")})},Mu=vi(ye)({[`& .${fi.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}}),_u=Ci((e=>({root:{"& .MuiInputBase-root.MuiAutocomplete-inputRoot":{paddingRight:"0 !important"},"& .MuiInputBase-root > .MuiAutocomplete-endAdornment":{display:"none"}}}))),ju=e=>t=>Boolean(e)?t:t?.label??"",zu=({name:r,validate:n,validationRun:s,shouldExclude:d,isReadOnly:A,postValidationSetCrossFieldValues:f,skipValueUpdateFromCrossFieldWhenReadOnly:g,runPostValidationHookAlways:w,dependentFields:b,fieldKey:v,options:y,GridProps:B,enableGrid:C,multiple:x,disableClearable:F,freeSolo:N,TextFieldProps:S,CircularProgressProps:E,ChipProps:T,showCheckbox:L,CreateFilterOptionsConfig:k,runValidationOnDependentFieldsChange:D,label:I,placeholder:U,limitTags:P,required:O,enableVirtualized:R,isFieldFocused:Q,_optionsKey:H,disableCaching:M,disableAdornment:_,ignoreInSubmit:j=!1,textFieldStyle:z,setFieldLabel:V,defaultValueKey:K,listBoxMinWidth:q,listBoxMaxWidth:J,setValueOnDependentFieldsChange:X,runExternalFunction:Y,onFormDataChange:$,componentType:Z,optionsGridColDef:ee,runPostValidationForInitValue:te,className:ne,skipInitialDefaultValueKeyValidation:ae=!1,filterOptionsCb:oe,...le})=>{const{enableOptionsGridForAutocomplete:he}=Ws(),[ce,de]=c(B),[ue,Ae]=c(!1),[fe,ge]=c(!1),{formState:me,error:be,touched:ve,handleChange:ye,handleBlur:Be,runValidation:Ce,isSubmitting:xe,validationRunning:Fe,fieldKey:Ne,name:Se,dependentValues:Ee,readOnly:Te,excluded:Le,incomingMessage:ke,whenToRunValidation:De,value:Ie,prevValue:Ue,setIncomingMessage:Pe,setIgnoreInSubmit:Oe,handleOptionValueExtraData:Re,setErrorAsCB:Qe,setValue:He,setFilteredOptions:Me}=Js({name:r,fieldKey:v,dependentFields:b,validate:n,validationRun:s,runPostValidationHookAlways:w,postValidationSetCrossFieldValues:f,isReadOnly:A,shouldExclude:d,runValidationOnDependentFieldsChange:D,skipValueUpdateFromCrossFieldWhenReadOnly:g,runExternalFunction:Y,onFormDataChange:$,componentType:Z,runPostValidationForInitValue:te}),_e=o(),je=_u(),ze=o(-1),Ve=o(new Map),Ke=h(ju(N),[]),qe=h((e=>t=>Boolean(e)?t:t?.value??"")(N),[]),Ge=h(((e,t)=>{if(Array.isArray(e)||(e=[e]),t)return e;return e.map((e=>Ve.current.has(`${e}`)?Ve.current.get(`${e}`):{label:e,value:e}))}),[]);l((()=>{if(Boolean(j))if("function"==typeof j){let e=j(ta(Ee),me,{isSubmitting:xe,value:Ie});Oe(e)}else Oe(j)}),[j,Oe,Ee,Ie]);const We=()=>{setTimeout((()=>{_e?.current?.focus?.()}),50)};l((()=>{Q&&We()}),[Q]),l((()=>{const e=e=>{if(!fe)return;const t=document.querySelector(`.${fi.listbox}`),i=e.target;t&&(t===i||t.contains(i))||ge(!1)};return window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("scroll",e,!0)}}),[fe]);const[Je,Xe]=c([]),[Ye,$e]=c([]),Ze=h((e=>fo(Je)(e)),[Je]),et=h((e=>{if(Ve.current.clear(),"function"==typeof e)Xe((t=>{let i=e(t);return N&&Array.isArray(i)?i.map((e=>ju(!1)(e))):(Array.isArray(i)&&i.map((e=>{Ve.current.set(`${qe(e)}`,e)})),i)}));else{if(N&&Array.isArray(e)){let t=e.map((e=>ju(!1)(e)));return void Xe(t)}Array.isArray(e)&&e.map((e=>{Ve.current.set(`${qe(e)}`,e)})),$e(e),Me(e),Xe(e)}}),[$e,Xe,Ke,qe]),tt=h((()=>{let e=Ze(Ie);Re(e),Be()}),[Be,Ze,Re,Ie]),it=(e,t)=>{if(Te||xe)return;t||(ze.current=-1),Array.isArray(t)||(t=[t]),t=N?t.map((e=>Ke(e)??"")):t.map((e=>qe(e)??""));let i=Ze(t);Re(i),!Boolean(x)&&Array.isArray(t)?ye(t[0],void 0,!1,{optionData:i}):ye(t,void 0,!1,{optionData:i})},rt=h((e=>{"backspace"!==e.key.toLowerCase()&&"escape"!==e.key.toLowerCase()||(ze.current=-1),"tab"===e.key.toLowerCase()&&-1!==ze.current&&Je[ze.current]&&fe&&it(0,Je[ze.current]),"f9"===e.key.toLowerCase()&&he&&Je.length&&Ae(!0)}),[Ke,Je,it,ze.current]),{loadingOptions:nt}=co(me,y,et,ye,Ee,ke,Ce,De,H,M,Pe,!0,"",!1);l((()=>{let e=Ze(Ie);Re(e)}),[nt,Ze,Re]),l((()=>{if("function"!=typeof oe)return;const e=oe(Ye,ta(Ee),me)??Ye;Xe(e),Me(e)}),[Ee,me,Ye,oe,Me]),l((()=>{if(null!==ke&&"object"==typeof ke){const{error:e,isErrorBlank:t,isFieldFocused:i,GridProps:r}=ke;if("object"==typeof r){const e={...B,xs:r?.xs??B?.xs??"auto",md:r?.md??B?.md??"auto",xl:r?.xl??r?.md??B?.xl??"auto",sm:r?.sm??B?.sm??"auto",lg:r?.lg??r?.md??B?.lg??"auto"};de(e)}i&&We(),t?Qe(""):Boolean(e)&&Qe(e)}}),[ke,Qe]);const st=a((()=>{if("function"==typeof V)return V(ta(Ee),Ie)}),[V,Ee,Ie]);l((()=>{if(!K||Ie||nt)return;const e=Je.find((e=>e[K]===e.value));if(e){let t=e;Array.isArray(t)||(t=[t]),t=N?t.map((e=>Ke(e)??"")):t.map((e=>qe(e)??""));let i=Ze(t);Re(i),!Boolean(x)&&Array.isArray(t)?He(t[0],void 0):He(t,void 0),ae||setTimeout((()=>{tt()}),0)}}),[nt,Je]),l((()=>{(async()=>{if("function"==typeof X)try{let e=await X(ta(Ee),me,{value:Ie,isSubmitting:xe});if(null!=e){const t=Boolean(e)?Je?.find((t=>e===t.value)):null;it(0,t)}}catch(e){console.error("An error occurred:",e)}})()}),[Ee,ye,X]);const at=h((e=>po(Je)(e)),[Je]),ot=a((()=>Ge(Ie,N)),[Ie,N,Je]);if(Le)return null;const lt=ve&&""!==(be??""),ht=i(m,{fallback:"loading...",children:[u(Ai,{...le,className:_?je.root:"",key:Ne,id:Ne,defaultValue:[],limitTags:P??2,multiple:x,autoHighlight:!0,open:fe,onOpen:()=>ge(!0),onClose:()=>ge(!1),disableClearable:F,options:Je,freeSolo:N,getOptionLabel:Ke,value:nt?x?[]:null:x?ot:ot.length>0?ot[0]:null,isOptionEqualToValue:(e,t)=>N?e===t:e.value===t.value,PopperComponent:Mu,ListboxComponent:Boolean(R)?Pu:void 0,PaperComponent:({children:t})=>e("div",{style:{width:"fit-content",background:"white",boxShadow:"rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px",overflow:"hidden",maxWidth:J||"320px",minWidth:q?`max(${q}px, 100%)`:"max(120px, 100%)"},children:t}),onKeyDown:rt,onChange:it,onBlur:()=>{ze.current=-1,tt()},onHighlightChange:(e,t)=>{ze.current="mousemove"!==e?.type?Je.indexOf(t):-1},disabled:xe||Te,filterOptions:Boolean(k)&&"object"==typeof k?pi(k):(e,t)=>{const i=t.inputValue.toLowerCase();return e.filter((e=>e.label.toLowerCase().includes(i))).sort(((e,t)=>{const r=e.label.toLowerCase().startsWith(i),n=t.label.toLowerCase().startsWith(i);return r&&!n?-1:!r&&n?1:0}))},renderTags:(e,t)=>e.map(((e,i)=>u(mi,"string"==typeof e?{variant:"outlined",...T,label:e,...t({index:i}),key:e}:{variant:"outlined",...T,label:e.label,...t({index:i}),key:`${e.label}-${i}`}))),renderInput:r=>{const n=e(to,{...S,...r,name:Se,className:se(ne,{hasOldValue:void 0!==Ue&&void 0!==Ie&&!W.isEqual(Ue,Ie)}),inputRef:_e,label:st?.label?G(st.label):I,placeholder:Te?"":st?.placeholder?G(st.placeholder):U,autoComplete:"off",type:"text",error:!xe&<,required:O,helperText:e(we,{children:!xe&<?be:null}),sx:{"& .MuiInputBase-root":{background:Boolean(Te||xe)?"#f3f3f3 !important":""},...z},InputProps:{...r.InputProps,endAdornment:i(p,{children:[Fe||nt?e(re,{sx:{position:"absolute",right:_?"0.5rem":"1.5rem"},size:25,color:"secondary",variant:"indeterminate",...E}):null,r.InputProps.endAdornment]})},InputLabelProps:{shrink:!0},inputProps:{...r.inputProps,autoComplete:"off"}});return e(t,{children:void 0===Ue||void 0===Ie||W.isEqual(Ue,Ie)?n:e(il,{title:e(rl,{label:`${G("OldValueOf")} ${st?.label?G(st.label):I}`,value:Ue?at(Ue)??Ue:"(blank)"}),arrow:!0,followCursor:!0,children:n})})},renderOption:(t,r,n)=>{t.key=t.id;let{selected:s,inputValue:a}=n,o=Ke(r);const l=wi(o,a),h=bi(o,l).map(((t,i)=>e("span",{style:{fontWeight:t.highlight?700:400},children:t.text},i)));return R?i("li",{style:{whiteSpace:"pre",width:"max-content",minWidth:"100%"},...t,children:[L?e(so,{checked:s}):null,h]}):e(pe,{title:r.label,disableInteractive:!0,children:i("li",{style:{whiteSpace:"pre",width:"max-content",minWidth:"100%"},...t,children:[L?e(so,{checked:s}):null,h]})})}}),ue?e(Hu,{handleClose:e=>{if(e){const t=e?Je?.find((t=>e===t.value)):null;it(0,t)}Ae(!1)},options:Je,optionsGridColDef:ee}):null]});return Boolean(C)?e(ie,{...ce,children:ht}):ht},Vu=f((()=>Promise.resolve().then((function(){return Ou})).then((e=>({default:e.ListBoxComponent}))))),Ku=e=>t=>Boolean(e)?t:t?.label??"",qu=({options:t,optionsProps:r,multiple:n,disableClearable:s,freeSolo:a,CircularProgressProps:l,ChipProps:d,showCheckbox:A,CreateFilterOptionsConfig:f,placeholder:g="Select Option",limitTags:w,required:b,enableVirtualized:v,_optionsKey:y,disableCaching:B,error:C,handleChange:x,handleBlur:F,touched:N,value:S,fullWidth:E,disableAdornment:T,isAutoFocus:L,...k})=>{const D=o(-1),I=o(new Map),U=_u(),P=h(Ku(a),[]),O=h((e=>t=>Boolean(e)?t:t?.value??"")(a),[]),R=h(((e,t)=>{if(Array.isArray(e)||(e=[e]),t)return e;return e.map((e=>I.current.has(`${e}`)?I.current.get(`${e}`):{label:e,value:e}))}),[]),[Q,H]=c([]),M=(e,t)=>{t||(D.current=-1),Array.isArray(t)||(t=[t]),t=a?t.map((e=>P(e)??"")):t.map((e=>O(e)??"")),!Boolean(n)&&Array.isArray(t)?x(t[0]):x(t)},_=h((e=>{"backspace"!==e.key.toLowerCase()&&"escape"!==e.key.toLowerCase()||(D.current=-1),"tab"===e.key.toLowerCase()&&-1!==D.current&&Q[D.current]&&M(0,Q[D.current])}),[P,Q,M,D.current]),j=h((e=>{if(I.current.clear(),"function"==typeof e)H((t=>{let i=e(t);return a&&Array.isArray(i)?i.map((e=>Ku(!1)(e))):(Array.isArray(i)&&i.map((e=>{I.current.set(`${O(e)}`,e)})),i)}));else{if(a&&Array.isArray(e)){let t=e.map((e=>Ku(!1)(e)));return void H(t)}Array.isArray(e)&&e.map((e=>{I.current.set(`${O(e)}`,e)})),H(e)}}),[H,P,O]),{loadingOptions:z}=uo(t,j,y,B,r,!0,"",!1),V=N&&""!==(C??"");return e(m,{fallback:"loading...",children:e(Ai,{...k,className:T?U.root:"",defaultValue:[],limitTags:w??2,multiple:n,disableClearable:s,options:Q,autoHighlight:!0,freeSolo:a,getOptionLabel:P,value:z?[]:n?R(S,a):R(S,a)[0],isOptionEqualToValue:(e,t)=>a?e===t:e.value===t.value,PaperComponent:({children:t})=>e("div",{style:{width:"fit-content",background:"white",boxShadow:"rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px",overflow:"hidden",maxWidth:"320px",minWidth:"max(120px, 100%)"},children:t}),ListboxComponent:Boolean(v)?Vu:void 0,onKeyDown:_,onChange:M,onBlur:()=>{D.current=-1,F()},onHighlightChange:(e,t)=>{D.current="mousemove"!==e?.type?Q.indexOf(t):-1},filterOptions:Boolean(f)&&"object"==typeof f?pi(f):(e,t)=>{const i=t.inputValue.toLowerCase();return e.filter((e=>e.label.toLowerCase().includes(i))).sort(((e,t)=>{const r=e.label.toLowerCase().startsWith(i),n=t.label.toLowerCase().startsWith(i);return r&&!n?-1:!r&&n?1:0}))},renderTags:(e,t)=>e.map(((e,i)=>u(mi,"string"==typeof e?{variant:"outlined",...d,label:e,...t({index:i}),key:e}:{variant:"outlined",...d,label:e.label,...t({index:i}),key:`${e.label}-${i}`}))),renderInput:t=>e(gi,{...t,...t.InputProps,placeholder:g,autoComplete:"disabled",type:"text",error:V,required:b,fullWidth:E,autoFocus:L,disableUnderline:!0,endAdornment:i(p,{children:[z?e(re,{size:25,color:"secondary",variant:"indeterminate",...l}):null,t.InputProps.endAdornment]})}),renderOption:(t,r,n)=>{t.key=t.id;let{selected:s,inputValue:a}=n,o=P(r);const l=wi(o,a),h=bi(o,l).map(((t,i)=>e("span",{style:{fontWeight:t.highlight?700:400},children:t.text},i)));return e(pe,{title:o,children:i("li",{style:{whiteSpace:"pre",width:"max-content",minWidth:"100%"},...t,children:[A?e(so,{checked:s}):null,h]})})}})})},Gu=({options:t,MenuItemProps:i,SelectProps:r,multiple:n,showCheckbox:s,CircularProgressProps:a,handleBlur:o,handleChange:l,error:d,touched:A,value:p,loading:f,readOnly:g,_optionsKey:m,disableCaching:w,optionsProps:b,skipDefaultOption:v=!1,defaultOptionLabel:y,enableDefaultOption:C=!1,...x})=>{const[F,N]=c([]),S=Boolean(A)&&Boolean(d),{loadingOptions:E}=uo(t,N,m,w,b,v,y,C),T=h((e=>po(F)(e)),[F]),L=h((e=>{const t="object"==typeof e?e?.target?.value??"":e;let i=T(t);i=n?i:i[0],"00"===t&&(e.target.value=""),l(e,i)}),[l,T,n]),k=F.map(((t,r)=>u(te,{...i,key:t.value??r,value:t.value,disabled:t.disabled,style:{fontWeight:"00"===t.value?500:"inherit"}},s?e(so,{checked:Boolean(n)?Array.isArray(p)&&p.indexOf(t.value)>=0:p===t.value}):null,t.label)));return e(Ti,{...x,value:n&&!Array.isArray(p)?[p]:Boolean(p)?p:"string"==typeof p?"00":p,error:S,onChange:L,onBlur:o,native:!1,multiple:n,renderValue:n?po(F,!0):void 0,style:{fontWeight:"00"===(n&&!Array.isArray(p)?[p]:Boolean(p)?p:"string"==typeof p?"00":p)?"500":""},input:e(gi,{sx:{"& > .MuiSvgIcon-root.MuiSelect-icon":{right:"-0.5px"}},endAdornment:f||E?e(B,{position:"end",children:e(re,{color:"primary",variant:"indeterminate",...a})}):null,disableUnderline:!0}),readOnly:g,IconComponent:r?.IconComponent,children:k})};function Wu(t){const{inputRef:i,onChange:r,MaskProps:n,...s}=t;return e(Li,{...s,inputRef:i,onAccept:(e,t)=>{r({target:{value:t.unmaskedValue}})},...n})}function Ju(t){const{inputRef:i,onChange:r,FormatProps:n,...s}=t;return e(Ht,{...s,getInputRef:i,onValueChange:e=>{r({target:{name:t.name,value:e.value,formattedValue:e.formattedValue}},e.formattedValue)},valueIsNumericString:!1,...n})}const Xu=xi((e=>({tooltip:{backgroundColor:"#f5f5f9",color:"rgba(0, 0, 0, 0.87)",maxWidth:220,fontSize:e.typography.pxToRem(12),border:"1px solid #dadde9"}})))(ki),Yu=({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:s,postValidationSetCrossFieldValues:o,runPostValidationHookAlways:d,dependentFields:A,fieldKey:p,label:f,FormControlProps:g,FormHelperTextProps:m,FormControlLabelProps:w,GridProps:b,enableGrid:v,runValidationOnDependentFieldsChange:y,skipValueUpdateFromCrossFieldWhenReadOnly:B,ignoreInSubmit:C=!1,setFieldLabel:x,runPostValidationForInitValue:F,...N})=>{const[S,E]=c(b),{value:T,error:L,touched:k,handleChange:D,handleBlur:I,isSubmitting:U,fieldKey:P,name:O,excluded:R,readOnly:Q,whenToRunValidation:H,incomingMessage:M,runValidation:_,setIgnoreInSubmit:j,dependentValues:z,formState:V}=Js({name:t,fieldKey:p,dependentFields:A,validate:i,validationRun:r,runPostValidationHookAlways:d,postValidationSetCrossFieldValues:o,isReadOnly:s,shouldExclude:n,runValidationOnDependentFieldsChange:y,skipValueUpdateFromCrossFieldWhenReadOnly:B,runPostValidationForInitValue:F});l((()=>{if(Boolean(C))if("function"==typeof C){let e=C(ta(z),V,{isSubmitting:U,value:T});j(e)}else j(C)}),[C,j,z,T]),l((()=>{if(null!==M&&"object"==typeof M){const{value:e,ignoreUpdate:t,GridProps:i}=M;if("object"==typeof i){const e={...b,xs:i?.xs??b?.xs??"auto",md:i?.md??b?.md??"auto",xl:i?.xl??i?.md??b?.xl??"auto",sm:i?.sm??b?.sm??"auto",lg:i?.lg??i?.md??b?.lg??"auto"};E(e)}"boolean"==typeof e&&(D(e,void 0,!0),t||"onChange"!==H||_({value:e},!0))}}),[M,D,_,H]);const K=h((e=>{const{value:t,checked:i}=e.target;e.target.value="boolean"==typeof i&&i,D(e)}),[D]),q=a((()=>{if("function"==typeof x)return x(ta(z),T)}),[x,z,T]);if(R)return null;const W=k&&""!==(L??""),J=u($e,{...g,key:P,component:"fieldset",disabled:U||Q,error:!U&&W,onBlur:I},e(Ye,{...w,name:O,control:e(so,{...N,readOnly:Q,tabIndex:Q?-1:void 0}),onChange:K,label:q?.label?G(q.label):f,checked:Boolean("string"==typeof T?"Y"===T||"true"===T:T)}),!U&&W?e(Ze,{...m,children:L}):null);return Boolean(v)?u(ie,{style:{alignSelf:"center"},...S,key:P},J):J},$u=(e,t)=>Array.isArray(e)&&e.indexOf(t)>-1;var Zu=Object.freeze({__proto__:null,Checkbox:Yu,CheckboxGroup:({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:s,postValidationSetCrossFieldValues:a,runPostValidationHookAlways:o,dependentFields:l,fieldKey:d,label:A,options:p,FormControlProps:f,FormLabelProps:g,FormGroupProps:m,FormHelperTextProps:w,FormControlLabelProps:b,GridProps:v,enableGrid:y,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x,CircularProgressProps:F,_optionsKey:N,disableCaching:S,...E})=>{const{formState:T,value:L,error:k,touched:D,handleChange:I,handleBlur:U,isSubmitting:P,fieldKey:O,name:R,excluded:Q,readOnly:H,dependentValues:M,incomingMessage:_,runValidation:j,whenToRunValidation:z,setIncomingMessage:V}=Js({name:t,fieldKey:d,dependentFields:l,validate:i,validationRun:r,runPostValidationHookAlways:o,postValidationSetCrossFieldValues:a,isReadOnly:s,shouldExclude:n,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x}),[K,q]=c([]),G=h((e=>po(K)(e)),[K]),W=h((e=>{let t=G("object"==typeof e?e?.target?.value??"":e);I(e,t[0])}),[I,G]),{loadingOptions:J}=co(T,p,q,W,M,_,j,z,N,S,V,!0,"",!1);if(Q)return null;const X=D&&""!==(k??""),Y=K.map((t=>u(Ye,{...b,control:e(so,{...E,readOnly:H,tabIndex:H?-1:void 0}),key:t.value,name:R,onChange:W,label:t.label,value:t.value,checked:$u(L,t.value)}))),$=u($e,{...f,key:O,component:"fieldset",disabled:P,error:!P&&X,onBlur:U},e(Je,{...g,component:"label",children:A}),e(Xe,{...m,children:J?e(B,{position:"end",children:e(re,{color:"primary",variant:"indeterminate",...F})}):Y}),!P&&X?e(Ze,{...w,children:k}):null);return Boolean(y)?u(ie,{...v,key:O},$):$}});const eA=Ci((e=>({wrapperclass:{textAlign:"center","& div":{"& fieldset":{verticalAlign:"middle","& label":{marginLeft:0,marginRight:0}}}}}))),tA=Ci((()=>({wrapperclass:{textAlign:"center","& div":{"& fieldset":{verticalAlign:"middle","& label":{marginLeft:0,marginRight:0}}}}})));as.registerFn("currency",Gd),as.registerFn("date",(t=>{const{commonDateFormat:i}=Ws(),{value:r,column:{dateFormat:n,showTooltip:s,tooltipPlacement:a="bottom-start"}}=t;if(!Boolean(r))return e($a,{...t});const o=new Date(r);let l;try{const t=z(o,(Boolean(n)?n:i)||"dd/MM/yyyy hh:mm aaa");l=s?e(pe,{title:t,placement:a,children:e("span",{children:t})}):t}catch(e){l="-"}return e($a,{...t,children:l})})),as.registerFn("default",Za),as.registerFn("icondefault",(t=>{const{value:i,column:{showTooltip:r=!1,tooltipPlacement:n="bottom-start",transform:s=e=>e,isAutoSequence:o=!1,isImageURL:h=!1,shouldExclude:d},row:u}=t,[A,p]=c(null);let f;f=o?Number(u?.index??0)+1:s(i);const g=a((()=>"function"==typeof d&&d(f,u?.original)),[f,u.original]);if(l((()=>{if(Boolean(f)){let e="";if(h)e=f;else{let t=ra(f);e="object"==typeof t&&Boolean(t)?URL.createObjectURL(t):""}p(e)}}),[f]),g)return e($a,{showBorder:!0,...t});let m=r?e(ki,{title:f,placement:n,children:e("div",{children:e(Hi,{alt:"User",src:Boolean(A)?A:"",style:{width:"30px",height:"30px",borderRadius:0}})})}):e("div",{children:e(Hi,{alt:"User",src:Boolean(A)?A:"",style:{width:"30px",height:"30px",borderRadius:0}})});return e($a,{...t,children:m})})),as.registerFn("editableAutocomplete",(t=>{const{value:r,rows:n,row:{index:s,original:o},column:{id:h,options:d,validation:u,_optionsKey:A,disableCachingOptions:p,disableAdornment:f,placeholder:g,isReadOnly:m,isAutoFocus:w,__EDIT__:b},updateGridData:v,gridProps:y,loading:B,hiddenFlag:C,loading:x}=t,F=n.slice(0,s).map((e=>e?.original)).filter((e=>!0!==Boolean(e[C]))),N=n.slice(s+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[C]))),S=Boolean(o?._touched?.[h]),E=o?._error?.[h]??"",[T,L]=c(!1),[k,D]=c(r),{t:I}=ne(),U=e=>{D(e)},P=()=>{L(!0),u(k,o,F,N).then((e=>{L(!1),v(s,h,k,!0,e)}))};l((()=>{D(r)}),[r]);const O=a((()=>!0===o?._isReadOnly||!0!==o?._isNewRow&&(!!m||!1===o?._isNewRow&&!0===b?.isReadOnly)),[m,o,b]);return i($a,{showBorder:!0,...t,children:[e(qu,{value:k,onChange:U,onBlur:P,fullWidth:!0,error:E,touched:S,handleChange:U,handleBlur:P,options:d,loading:x,disabled:x||B,_optionsKey:A,optionsProps:y,disableCaching:p,showCheckbox:!1,renderInput:()=>null,placeholder:String(I(g)),disableAdornment:f,readOnly:O,isAutoFocus:w}),Boolean(S)&&Boolean(E)?e(we,{style:{whiteSpace:"break-spaces"},error:!0,children:I(E)}):null]})})),as.registerFn("editableSelect",(t=>{const{value:r,rows:n,row:{index:s,original:o},column:{id:h,options:d,validation:u,_optionsKey:A,disableCachingOptions:p,skipDefaultOption:f,defaultOptionLabel:g,requestProps:m,isReadOnly:w,__EDIT__:b,dependentOptionField:v,enableDefaultOption:y},updateGridData:B,gridProps:C,hiddenFlag:x,loading:F}=t,N=Boolean(o?._touched?.[h]),S=o?._error?.[h]??"",[E,T]=c(!1),[L,k]=c(r),D=a((()=>!0===o?._isReadOnly||!0!==o?._isNewRow&&(!!w||!1===o?._isNewRow&&!0===b?.isReadOnly)),[w,o,b]);let I=Boolean(v)?o[v]:m;const U=n.slice(0,s).map((e=>e?.original)).filter((e=>!0!==Boolean(e[x]))),P=n.slice(s+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[x]))),O=e=>{k(e.target.value)},R=()=>{T(!0),u(L,o,U,P).then((e=>{T(!1),B(s,h,L,!0,e)}))};return l((()=>{k(r)}),[r,S]),i($a,{showBorder:!0,...t,children:[e(Gu,{value:L,onChange:O,onBlur:R,fullWidth:!0,touched:N,error:S,handleChange:O,handleBlur:R,options:d,loading:E,disabled:E||F||D,_optionsKey:A,optionsProps:I,disableCaching:p,skipDefaultOption:f,defaultOptionLabel:g,enableDefaultOption:y,CircularProgressProps:{color:"secondary",size:20},SelectProps:E||F||D?{IconComponent:()=>null}:void 0}),Boolean(N)&&Boolean(S)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:S}):null]})})),as.registerFn("editableTextField",(t=>{const{value:r,rows:n,row:{index:s,original:h},column:{id:d,validation:u,isPassword:A,TableCellProps:p,isDisabledOnBlurEvent:f,maxLength:g,placeholder:m,autoComplete:w,isAutoFocus:b,multiline:x,minRows:F,maxRows:N,isReadOnly:S,__EDIT__:E},updateGridData:T,hiddenFlag:L,loading:k}=t,D=n.slice(0,s).map((e=>e?.original)).filter((e=>!0!==Boolean(e[L]))),I=n.slice(s+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[L]))),U=Boolean(h?._touched?.[d]),P=h?._error?.[d]??"",O=o(Boolean(A)),[R,Q]=c(Boolean(A)?"password":"text"),[H,M]=c(!1),[_,j]=c(r),z=o(null),{t:V}=ne(),K=a((()=>!0===h?._isReadOnly||!0!==h?._isNewRow&&(!!S||!1===h?._isNewRow&&!0===E?.isReadOnly)),[S,h,E]),q=()=>{M(!0),u(_,h,D,I).then((e=>{M(!1),T(s,d,_,!0,e)}))};return l((()=>{Boolean(f)&&q()}),[_]),l((()=>{!Boolean(_)&&Boolean(b)&&n.length===s+1&&z?.current?.firstChild?.focus?.()}),[s,b]),l((()=>{j(r)}),[r]),i($a,{showBorder:!0,...t,children:[e(gi,{name:d,value:"string"==typeof _?_.trimStart():_,onChange:e=>{e.target.value.length<=(g??200)&&j(e.target.value)},onFocus:e=>{e.target.select()},type:R,onBlur:()=>{Boolean(f)||q()},multiline:x,minRows:F??"",maxRows:N??"",margin:"none",fullWidth:!0,error:Boolean(U)&&Boolean(P),placeholder:String(V(m)),autoComplete:w,endAdornment:O.current?e(B,{position:"end",children:e(C,{"aria-label":"toggle password visibility",onClick:()=>Q((e=>"password"===e?"text":"password")),onMouseDown:e=>{e.preventDefault()},children:e("password"===R?v:y,{})})}):null,style:{marginTop:"0px",direction:"right"===p?.align?"rtl":"ltr"},disableUnderline:!0,disabled:k||H,readOnly:K,ref:z}),Boolean(U)&&Boolean(P)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:P}):null]})})),as.registerFn("editableMaskInputField",(t=>{const{value:r,rows:n,row:{index:s,original:a},column:{id:o,validation:l,MaskProps:h},updateGridData:d,hiddenFlag:u}=t,A=Boolean(a?._touched?.[o]),p=a?._error?.[o]??"",[f,g]=c(!1),[m,w]=c(r),b=n.slice(0,s).map((e=>e?.original)).filter((e=>!0!==Boolean(e[u]))),v=n.slice(s+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[u])));return i($a,{showBorder:!0,...t,children:[e(gi,{name:o,value:m,onChange:e=>{w(e.target.value)},onFocus:e=>{e.target.select()},onBlur:()=>{g(!0),l(m,a,b,v).then((e=>{g(!1),d(s,o,m,!0,e)}))},fullWidth:!0,margin:"none",disableUnderline:!0,error:Boolean(A)&&Boolean(p),inputComponent:Wu,inputProps:{MaskProps:h},disabled:f}),Boolean(A)&&Boolean(p)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:p}):null]})})),as.registerFn("editableNumberFormat",(t=>{const{value:r,rows:n,row:{index:s,original:h},column:{id:d,validation:u,FormatProps:A,placeholder:p="",enableNumWords:f,className:g,isReadOnly:m,__EDIT__:w,isDisabledOnBlurEvent:b,autoComplete:v,isAutoFocus:y},updateGridData:B,hiddenFlag:C,loading:x}=t,F=n.slice(0,s).map((e=>e?.original)).filter((e=>!0!==Boolean(e[C]))),N=n.slice(s+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[C]))),S=Boolean(h?._touched?.[d]),E=h?._error?.[d]??"",[T,L]=c(!1),[k,D]=c(r),I=o(null),{t:U}=ne(),P=a((()=>!0===h?._isReadOnly||!0!==h?._isNewRow&&(!!m||!1===h?._isNewRow&&!0===w?.isReadOnly)),[m,h,w]);let O=null;try{if(f&&Boolean(k)){let e=String(k).split("."),t=Number(e[0]);t<0?(t=Math.abs(Number(t)),O=`Negative ${yo(t)} Rupees`):O=`${yo(t)} Rupees`,2===e.length&&Boolean(e[1])&&(O=`${O} and ${yo(e[1])} paise`)}}catch(e){}const R=()=>{L(!0),u(k,h,F,N).then((e=>{L(!1),B(s,d,k,!0,e)}))};return l((()=>{Boolean(b)&&R()}),[k]),l((()=>{!Boolean(k)&&Boolean(y)&&n.length===s+1&&I?.current?.firstChild?.focus?.()}),[n,s,y]),i($a,{showBorder:!0,...t,children:[e(gi,{name:d,value:k,onChange:e=>{D(e.target.value)},onFocus:e=>{e.target.select()},onBlur:()=>{Boolean(b)||R()},placeholder:String(U(p)),fullWidth:!0,margin:"none",disableUnderline:!0,error:Boolean(S)&&Boolean(E),inputComponent:Ju,inputProps:{FormatProps:A},disabled:T||x,className:g,readOnly:x||P,autoComplete:v,ref:I}),Boolean(S)&&Boolean(E)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:E}):Boolean(f)?e(Ze,{style:{whiteSpace:"break-spaces"},children:O}):null]})})),as.registerFn("editableNumberFormatLessValidation",(t=>{const{value:r,rows:n,row:{index:s,original:a},column:{id:h,validation:d,FormatProps:u,placeholder:A="",enableNumWords:p,className:f,isDisabledOnBlurEvent:g},updateGridData:m,hiddenFlag:w,loading:b}=t,v=[],y=[],B=Boolean(a?._touched?.[h]),C=a?._error?.[h]??"",x=o(!0),[F,N]=c(!1),[S,E]=c(r),{t:T}=ne();const L=()=>{N(!0),d(S,a,v,y).then((e=>{N(!1),m(s,h,S,!0,e)}))};return l((()=>{Boolean(g)&&!x.current&&L(),x.current=!1}),[S]),i($a,{showBorder:!0,...t,children:[e(gi,{name:h,value:S,onChange:e=>{E(e.target.value)},onFocus:e=>{e.target.select()},onBlur:()=>{Boolean(g)||L()},placeholder:String(T(A)),fullWidth:!0,margin:"none",disableUnderline:!0,error:Boolean(B)&&Boolean(C),inputComponent:Ju,inputProps:{FormatProps:u},disabled:F,className:f,readOnly:b}),Boolean(B)&&Boolean(C)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:C}):Boolean(p)?e(Ze,{style:{whiteSpace:"break-spaces"},children:null}):null]})})),as.registerFn("action",(t=>{let{column:{actions:i},row:r,setGridAction:n,singleActions:s}=t;return Array.isArray(i)||(i=[i]),s=s.filter((e=>i.indexOf(e?.actionName)>=0)),s.length>0&&(s=Vo(s,[r],{},!1)),e($a,{...t,children:e(Ui,{size:"small","aria-label":"actions",children:s.map((t=>e(ct,{onClick:()=>{return e=t.actionName,void n({name:e,rows:[{data:r?.original,id:r?.id}]});var e},children:t.actionLabel})))})})})),as.registerFn("dateDiffere",(t=>{const i=t?.cell?.row?.original??"",r=(new Date).getTime(),n=new Date(i?.due_date).getTime(),s=new Date(i?.completion_date).getTime();let a,o="-";if(""!==n||""===s?a=K(r,n):""===n&&""===s||(a=K(n,s)),"Completed"===i?.status)o="-";else if(a>"0")o=`${a} days over due`;else if(a<"0")o=-1*a+" days left";else if("0"==a){let e=new Date(r-n);var l=Math.floor(e/1e3/60/60);e-=1e3*l*60*60;var h=Math.floor(e/1e3/60);e-=1e3*h*60,l<10&&(l=`0${l}`),h<10&&(h=`0${h}`),o=l+":"+h+" mins left"}return e($a,{...t,children:o})})),as.registerFn("chip",(t=>{const{value:i,column:{transform:r=e=>e}}=t;let n=r(i);return e($a,{...t,children:e(mi,{label:n,variant:"outlined"})})})),as.registerFn("multipleValuesCellRenderer",(t=>{const{row:{original:r},column:{_accessor:n}}=t;let s=r[n],a=Array.isArray(s),o=s.map(((t,i)=>e("li",{children:t},i)));return i($a,{positionRelative:!0,...t,children:[a?s[0]:"-",a&&s.length>1?e(Xu,{title:e("ul",{style:{padding:0,listStyle:"none",margin:"0px 0px"},children:o}),children:e(Pi,{style:{position:"absolute",right:"5px",top:"5px",color:"#8d868685"}})}):null]})})),as.registerFn("deleteRowCell",(t=>{const{value:i,row:{index:r,original:n},column:{id:s,shouldExclude:o,buttonLabel:l,showDeleteIconOnly:h=!1},updateGridData:c,data:d}=t,{t:u}=ne(),A=a((()=>"function"==typeof o&&o(i,n,d,r)),[i,n,d,r]),p=e=>{c(r,s,!0,!0,"")};return e($a,A?{showBorder:!0,...t}:{showBorder:!0,...t,children:h?e(Be,{onClick:p,sx:{width:"35px",height:"35px","&:hover":{background:"#fccfcf"},color:"#ff2626"},children:e(Oi,{})}):e(ct,{onClick:p,fullWidth:!0,variant:"contained",color:"secondary",style:{height:"28px"},children:Boolean(l)?u(l):u("Delete")})})})),as.registerFn("buttonRowCell",Ec),as.registerFn("percentageDiff",(t=>{const i=t?.cell?.row?.original??"";let r=0;const n=Number(i?.fromPercentage),s=Number(i?.toPercentage);return isNaN(n)||isNaN(s)||(r=s-n+"%"),e($a,{...t,children:r})})),as.registerFn("editableCheckbox",(t=>{const{value:r,rows:n,row:{index:s,original:o},column:{id:h,validation:d,isReadOnly:u,setValueFUNC:A,shouldExclude:p,__EDIT__:f},updateGridData:g,hiddenFlag:m,loading:w}=t,b=Boolean(o?._touched?.[h]),v=o?._error?.[h]??"",[y,B]=c(!1),C=eA(),[x,F]=c(r),N=n.slice(0,s).map((e=>e?.original)).filter((e=>!0!==Boolean(e[m]))),S=n.slice(s+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[m]))),E=a((()=>"function"==typeof p&&p(r,o,N,S)),[r,N,S,o]),T=a((()=>u?"function"!=typeof u||u(r,o,N,S):!0===o?._isReadOnly||!0!==o?._isNewRow&&(!1===o?._isNewRow&&!0===f?.isReadOnly)),[u,o,f]);return l((()=>{F(r)}),[r,v]),e($a,E?{showBorder:!0,...t}:{...t,children:i("div",{className:C.wrapperclass,children:[e(Yu,{checked:Boolean("string"==typeof x?"Y"===x||"true"===x||"N"!==x&&"false"!==x&&x:x),onChange:e=>{let t=e.target.checked;"function"==typeof A&&(t=A(t)),F(t)},onBlur:()=>{B(!0),d(x,o,N,S).then((e=>{B(!1);g(s,h,"Y"===x||!0===x?"Y":"N",!0,e)}))},disabled:y||w||T,enableGrid:!0,name:h,label:"",fieldKey:h}),Boolean(b)&&Boolean(v)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:v}):null]})})})),as.registerFn("editableDatetimePicker",(t=>{const{commonDateTimeFormat:r}=Ws(),{value:n,rows:s,row:{index:o,original:h},column:{id:d,validation:u,dateFormat:A,mindate:p,isReadOnly:f,__EDIT__:g},updateGridData:m,hiddenFlag:w,loading:b}=t,v=Boolean(h?._touched?.[d]),y=h?._error?.[d]??"",[B,C]=c(!1),[x,F]=c(n),N=a((()=>!!f||!1===h?._isNewRow&&!0===g?.isReadOnly),[f,h?._isNewRow,g]),S=s.slice(0,o).map((e=>e?.original)).filter((e=>!0!==Boolean(e[w]))),E=s.slice(o+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[w])));return l((()=>{F(n)}),[n]),i($a,{showBorder:!0,...t,children:[e(Ri,{dateAdapter:Qi,children:e(Lo,{format:(Boolean(A)?A:r)||"dd/MM/yyyy HH:mm:ss",onChange:e=>{F(e),u(e,h,S,E).then((t=>{const i=e?new Date(e):e;let r=ca(i)?z(i,"yyyy-MM-dd HH:mm:ss.S"):i;m(o,d,r,!0,t)}))},value:""===x||null===x?null:pa(x),disabled:B||b,readOnly:N,minDate:p||new Date("1900-01-01"),views:["year","month","day","hours","minutes","seconds"],slotProps:{textField:{onBlur:()=>{C(!0),u(x,h,S,E).then((e=>{C(!1);const t=x?new Date(x):x;let i=ca(t)?z(t,"yyyy-MM-dd HH:mm:ss.S"):t;m(o,d,i,!0,e)}))},name:d,"aria-label":"Select Date",autoComplete:"off",InputProps:{disableUnderline:!0},InputLabelProps:{shrink:!0}},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%"}})}),Boolean(v)&&Boolean(y)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:y}):null]})})),as.registerFn("editableDatePicker",(t=>{const{commonDateFormat:r}=Ws(),[n,s]=c(null),{authState:o}=Vs(),{value:h,rows:d,row:{index:u,original:A},column:{id:p,validation:f,dateFormat:g,mindate:m,maxdate:w,disablePast:b,disableFuture:v,disableToday:y,isReadOnly:B,__EDIT__:C},updateGridData:x,hiddenFlag:F,loading:N}=t,S=Boolean(A?._touched?.[p]),E=A?._error?.[p]??"",[T,L]=c(!1),[k,D]=c(h),I=a((()=>!0===A?._isReadOnly||!0!==A?._isNewRow&&(!!B||!1===A?._isNewRow&&!0===C?.isReadOnly)),[B,A,C]),U=d.slice(0,u).map((e=>e?.original)).filter((e=>!0!==Boolean(e[F]))),P=d.slice(u+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[F]))),O=e=>{D(e),f(e,A,U,P).then((t=>{const i=e?new Date(e):e;let r=ca(i)?z(i,"yyyy-MM-dd HH:mm:ss.S"):i;x(u,p,r,!0,t)}))};return l((()=>{D(h)}),[h]),i($a,{showBorder:!0,...t,children:[e(Ri,{dateAdapter:Qi,children:e(Eo,{format:(Boolean(g)?g:r)||"dd/MM/yyyy",onChange:O,value:""===k||null===k?null:pa(k),disabled:T||N,readOnly:I,minDate:m||new Date("1900-01-01"),maxDate:w||null,disablePast:b,disableFuture:v,onSelectedSectionsChange:e=>{s(e)},selectedSections:n,slotProps:{textField:{onBlur:()=>{L(!0),f(k,A,U,P).then((e=>{L(!1);const t=k?new Date(k):k;let i=ca(t)?z(t,"yyyy-MM-dd HH:mm:ss.S"):t;x(u,p,i,!0,e)}))},onKeyDown:e=>{const t=g??r;if(!o?.workingDate||"ArrowUp"!==e.key&&"ArrowDown"!==e.key){if("Home"===e.key)s(0);else if("End"===e.key){const e=t.includes("/")?"/":t.includes("-")?"-":null,i=e?t.split(e).length:1;s(i-1)}}else{const i=e.target.value;if(!V(k)&&i?.toLowerCase()===t?.toLowerCase()){const t=o?.workingDate;let i="";"ArrowUp"===e.key?i=(new Date).setDate(new Date(t).getDate()+1):"ArrowDown"===e.key&&(i=(new Date).setDate(new Date(t).getDate()-1)),setTimeout((()=>O(new Date(i))),0)}}},"aria-label":"Select Date",name:p,autoComplete:"off",InputLabelProps:{shrink:!0},InputProps:{disableUnderline:!0}},actionBar:{actions:y?["accept","cancel"]:["today","accept","cancel"]}}})}),Boolean(S)&&Boolean(E)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:E}):null]})})),as.registerFn("disableSelect",(t=>{const{value:r,rows:n,row:{index:s,original:a},column:{id:o,options:h,validation:d,_optionsKey:u,disableCachingOptions:A,defaultOptionLabel:p,requestProps:f},updateGridData:g,gridProps:m,hiddenFlag:w,loading:b}=t,v=Boolean(a?._touched?.[o]),y=a?._error?.[o]??"",[B,C]=c(!1),[x,F]=c(r);const N=n.slice(0,s).map((e=>e?.original)).filter((e=>!0!==Boolean(e[w]))),S=n.slice(s+1).map((e=>e?.original)).filter((e=>!0!==Boolean(e[w]))),E=e=>{F(e.target.value)},T=()=>{C(!0),d(x,a,N,S).then((e=>{C(!1),g(s,o,x,!0,e)}))};return l((()=>{F(r)}),[r,y]),i($a,{showBorder:!0,...t,children:[e(Gu,{value:x,onChange:E,onBlur:T,fullWidth:!0,touched:v,error:y,handleChange:E,handleBlur:T,options:h,loading:B,disabled:!0,_optionsKey:u,optionsProps:f,disableCaching:A,defaultOptionLabel:p,CircularProgressProps:{color:"secondary",size:20},readOnly:!0,SelectProps:{IconComponent:()=>null}}),Boolean(v)&&Boolean(y)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:y}):null]})})),as.registerFn("customIconCell",(t=>{const{value:r,row:{index:n,original:s},column:{id:a,isReadOnly:o,activeIcon:{icon:h,tooltip:d},inActiveIcon:{icon:u,tooltip:A}},loading:p,onButtonActionHandel:f}=t,g=Boolean(s?._touched?.[a]),m=s?._error?.[a]??"",w=tA(),[b,v]=c(r),y=()=>{"function"==typeof f&&f(n,a)};return l((()=>{v(r)}),[r,m]),e($a,{...t,children:i("div",{className:w.wrapperclass,children:[Boolean(b)?e(pe,{title:d,children:e(Be,{name:a,onClick:y,disabled:p||o,size:"small",children:h??""})}):e(pe,{title:A,children:e(Be,{onClick:y,disabled:p||o,size:"small",children:u??""})}),Boolean(g)&&Boolean(m)?e(we,{style:{whiteSpace:"break-spaces"},error:!0,children:m}):null]})})}));Ka(":root{--theme-color1:maroon;--theme-color2:#fedad8;--theme-color3:#fe0000;--theme-color4:#fcbab7;--theme-color5:#efe0e0;--white:#fff;--white-dim:#ffffff8a;--primary-bg:linear-gradient(45deg,maroon,#ff5a5a);--report-export-theme:maroon;--old-value-text-primary:#7b4f00;--old-value-bg-primary:#fff8dc}");const iA=Ce("div")((({theme:e,ownerState:t})=>({backgroundColor:"dark"===e.palette.mode?e.palette.grey[700]:"#ccc",zIndex:1,color:"#fff",width:30,height:30,display:"flex",borderRadius:"50%",justifyContent:"center",alignItems:"center",...t.active&&{background:"var(--theme-color1)",boxShadow:"0 4px 10px 0 rgba(0,0,0,.25)"},...t.completed&&{background:"var(--theme-color1)"}}))),rA=Ce(Mi)((({theme:e})=>({[`&.${_i.alternativeLabel}`]:{top:15,left:"calc(-50% + 10px)"},[`&.${_i.active}`]:{[`& .${_i.line}`]:{background:"var(--theme-color1)"}},[`&.${_i.completed}`]:{[`& .${_i.line}`]:{background:"var(--theme-color1)"}},[`& .${_i.line}`]:{height:3,border:0,backgroundColor:"dark"===e.palette.mode?e.palette.grey[800]:"#eaeaf0",borderRadius:1}}))),nA=n(null),sA=({gridCode:t,getGridData:i,children:r})=>"function"!=typeof i?e("div",{children:"Invalid Grid FNS passed"}):e(nA.Provider,{value:{getGridData:i,gridCode:t},children:r}),aA=({column:t,visibleColumns:r,setColumnOrder:n,allowColumnReordering:s})=>{const[{isDragging:a},l]=wt({type:"Column",collect:e=>({isDragging:!!e.isDragging()}),end:(e,i)=>{if(i.didDrop()){const{id:e}=i.getDropResult(),a=r.map((e=>e.id)),o=a.indexOf(e),l=a.indexOf(t.id);var s=a[o];a[o]=a[l],a[l]=s,n(a)}},canDrag:()=>s}),[{isOver:h},c]=bt({accept:"Column",drop:()=>({id:t.id}),collect:e=>({isOver:s&&!!e.isOver()}),canDrop:()=>s}),d=o(null);return l(c(d)),i(p,{children:[e(Vi,{active:t.isSorted,direction:t.isSortedDesc?"desc":"asc",hideSortIcon:!0,ref:d,...t.getSortByToggleProps([{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",color:"var(--theme-color1)",fontSize:"1 rem",fontWeight:"600",opacity:a||h?.5:1,cursor:a?"move":"default"}}]),children:e("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingRight:"10px"},children:t.columnName})}),e("div",{...t.getResizerProps([{style:{minHeight:"26px",opacity:1,color:"rgba(224, 224, 224, 1)",right:"0px",display:"flex",zIndex:100,position:"absolute",flexDirection:"column",justifyContent:"center"}}]),children:e("svg",{focusable:"false",viewBox:"0 0 24 24","aria-hidden":"true","data-testid":"SeparatorIcon",style:{color:"inherit",userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,transition:"fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",fontSize:"20px"},children:e("path",{d:"M11 19V5h2v14z"})})})]})},oA=xi((e=>({root:{"&.Mui-checked":{color:"var(--theme-color1)"},"&.MuiCheckbox-indeterminate":{color:e.palette.text.secondary}},checked:{}})))(ui),lA=({row:t,cell:i})=>e(ci,{component:"div",variant:"head",...i.getCellProps([{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 10px",lineHeight:"28px"}}]),children:e(oA,{size:"small",...t.getToggleRowSelectedProps([{style:{padding:0,position:"sticky",background:"white",left:0,zIndex:1}}])})}),hA=({getToggleAllPageRowsSelectedProps:t})=>e(oA,{size:"small",...t([{style:{padding:0,position:"sticky",left:0,zIndex:1}}])}),cA=Ci((e=>({root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),background:"var(--primary-bg)",borderTopLeftRadius:"4px",borderTopRightRadius:"4px"},title:{color:"var(--white)",letterSpacing:"1px",fontSize:"1.25rem"},refreshiconhover:{}}))),dA=d((({dense:t,label:r,visibleColumns:n,defaultHiddenColumns:s,allowColumnHiding:a,setGridAction:o,selectedFlatRows:l,alwaysAvailableAction:h,allowFilter:c,setAllFilters:d,gotoPage:u,setSortBy:A,filterMeta:p,filters:f,autoRefreshInterval:g,loading:m,enableExport:w,setOpenExport:b,headerToolbarStyle:v},y)=>{const B=cA(),{defaultGridConfig:x}=Ws(),{progress:F,enabled:N,intervalElapsed:S,pause:E,resume:T}=kl(y?.current?.fetchData,g);return i(si,{className:se(B.root,"server__grid__header"),variant:t?"dense":"regular",sx:v,children:[e(vt,{className:B.title,color:"inherit",variant:"h6",component:"div",children:r}),i("div",{style:{display:"flex",alignItems:"center",marginLeft:"auto"},children:[c?e(Ul,{setAllFilters:d,filters:f,filterMeta:p,gotoPage:u,setSortBy:A,classes:B}):null,e(C,{"aria-label":"refresh","aria-controls":"button","aria-haspopup":"false",onClick:()=>y?.current?.fetchData?.(),color:"primary",className:B.refreshiconhover,children:e(qi,{})}),N?e(Dl,{variant:"determinate",value:F,interval:S,pause:E,resume:T}):null,a?e(Ol,{visibleColumns:n,defaultHiddenColumns:s,classes:B}):null,!m&&w?e(Ae,{control:e(pe,{title:G("Showexportoptions"),children:i(ae,{onClick:()=>{b(!0)},style:{color:"white",background:x?.isContainedActionButton?"var(--primary-bg)":"inherit",boxShadow:x?.isContainedActionButton?"2px 2px 4px 0px rgba(0,0,0,.2)":"none"},children:[G("Export")," ",e(Gi,{})]})}),sx:{color:"var(--white)",margin:"0 !important"},label:""}):null,e(Nl,{actions:h??[],setAction:o,selectedRows:l},"alwaysRender")]})]})})),uA=d((({label:r,dense:n,columns:s,defaultColumn:h,setData:d,data:u,onFetchData:p,loading:f,getRowId:g,totalRecords:m,pageCount:w,pageSizes:b,defaultPageSize:v,defaultSortOrder:y,defaultFilter:B,defaultHiddenColumns:C,allowColumnReordering:x,allowColumnHiding:F,allowKeyboardNavigation:N,setGridAction:S,multipleActions:E,singleActions:T,doubleClickAction:L,alwaysAvailableAction:k,allowFilter:D,allowRowSelection:I,filterMeta:U,autoRefreshInterval:P,enablePaginationInput:O=!0,finalMetaData:R,enableExport:Q,enablePdfPrint:H,reportTemplateCode:M,variant:_,containerHeight:j,occupiedHeight:z,autoFetch:V,handleReset:K,headerToolbarStyle:q,enableEnterToFocus:G},W)=>{const[J,X]=c(V),{getTableProps:Y,getTableBodyProps:$,headerGroups:Z,prepareRow:ee,rows:te,page:ie,selectedFlatRows:re,gotoPage:se,setPageSize:ae,state:le,setSortBy:he,columns:ce}=Gt({columns:s,defaultColumn:h,data:u,getRowId:g,initialState:{pageIndex:0,pageSize:v,hiddenColumns:C,sortBy:y},manualPagination:!0,pageCount:w,autoResetPage:!1,manualSortBy:!0,autoResetSortBy:!1,manualFilters:!0,autoResetFilters:!1,allowColumnReordering:x,singleActions:T,setGridAction:S},Jt,ri,Yt,Zt,ei,ti,ii,(de=I,e=>{Boolean(de)&&e.visibleColumns.push((e=>[{id:"selectionCheckbox",Header:hA,Cell:lA,minWidth:40,width:40,maxWidth:40},...e]))}));var de;const{authState:ue}=Vs(),[Ae,pe]=c(B),[fe,ge]=c(!1),{t:me}=ne();T=Vo(T,re,ue),E=Vo(E,re,ue),k=Vo(k,ie,ue,!1,!0);const{pageIndex:we,pageSize:be,sortBy:ve}=le,ye=qt(p,500),Be=o(null),[Ce,xe]=c(null),[Fe,Ne]=c(null),[Se,Ee]=c(null),{resume:Te,pause:Le}=Ll();l((()=>{J&&ye({pageIndex:we,pageSize:be,sortBy:ve,filters:Ae})}),[ye,we,be,ve,Ae,J]),A(W,(()=>({fetchData:()=>{J||X(!0),ye({pageIndex:we,pageSize:be,sortBy:ve,filters:Ae})},setData:d,handleReset:()=>{pe([]),he([]),X(!1),se(0),K()},resume:Te,pause:Le})));const ke=a((()=>{const e=e=>{const t=re.length>0&&I?`calc(${j?.[e]} - 48px)`:j?.[e];return t&&z?.[e]?Ae.length?`calc(${t} - ${z?.[e]} - 48px)`:`calc(${t} - ${z?.[e]})`:Ae.length>0?`calc(${t} - 48px)`:t};return{min:e("min"),max:e("max")}}),[re,j,z,Ae]);return i(t,{children:[i(ni,{style:{width:"100%",background:"var(--white)"},children:[e(dA,{ref:W,label:r,dense:n,loading:f,visibleColumns:ce,defaultHiddenColumns:C,allowColumnHiding:F,alwaysAvailableAction:k,setGridAction:S,selectedFlatRows:re,allowFilter:D,setAllFilters:pe,gotoPage:se,setSortBy:he,filters:Ae,filterMeta:U,autoRefreshInterval:P,enableExport:Q&&ie?.length,setOpenExport:ge,headerToolbarStyle:q}),e(Fl,{dense:n,selectedFlatRows:re,multipleActions:E,singleActions:T,setGridAction:S}),e(Sl,{selectedFlatRows:re,contextMenuRow:Fe,multipleActions:E,singleActions:T,setGridAction:S,mouseX:Ce?.mouseX??null,mouseY:Ce?.mouseY??null,handleClose:()=>{Ne(null),xe(null),Ee(null)},authState:ue}),e(Xl,{dense:n,setAllFilters:pe,filters:Ae,gotoPage:se,setSortBy:he}),f?e(gt,{color:"secondary",style:{marginTop:"1px"}}):e(Gl,{}),i(ai,{style:{position:"relative",display:"inline-block",overflow:"auto",padding:"outlined"===_?"0 .5rem":"",maxHeight:ke.max,minHeight:ke.min,borderBottom:"1px solid rgba(133, 130, 130, 0.8)"},children:[i(oi,{component:"div",...Y(),size:n?"small":"medium",children:[e(Hl,{component:"div",sx:{background:"standard"!==_?"var(--theme-color4)":"white"},children:Z.map((t=>e(hi,{component:"div",...t.getHeaderGroupProps(),children:t.headers.map((t=>e(jl,{variant:_,column:t,children:t.render("Header")},t.getHeaderProps().key)))})))}),i(di,{component:"div",ref:Be,...$([{style:{display:"block"}}]),style:{height:`calc(${ke.min} - 62px)`},children:[ie.length<=0&&!1===f?e("div",{style:{position:"absolute",left:"50%",height:`calc(${ke.min} - 50px)`,display:"flex",alignItems:"center",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:me("Nodatafound")}):null,ie.map(((t,i)=>{ee(t);const r=(e=>t=>{t.preventDefault(),Ne(e),Ee(e?.id),xe(null===Ce?{mouseX:t.clientX-2,mouseY:t.clientY-4}:null)})(t),n=(e=>t=>{t.preventDefault(),void 0!==Vo(L,[e],ue,!0)&&S({name:L.actionName,rows:[{data:e?.original,id:e?.id}]})})(t);return e(Ml,{...t.getRowProps(),id:t.id,tabIndex:0,component:"div",selected:t.isSelected||Se===t.id,onKeyDown:N?e=>((e,t)=>{e.stopPropagation();const i=Be.current?.children.namedItem(t.id);let r;switch(e.keyCode){case 38:r=i?.previousElementSibling,null!==r&&(r?.focus(),e.preventDefault(),r.offsetTop>Be.current?.offsetHeight&&console.log("need to scroll here"));break;case 40:r=i?.nextElementSibling,null!==r&&(r?.focus(),e.preventDefault());break;case 32:t.toggleRowSelected(),e.preventDefault()}})(e,t):void 0,onContextMenu:r,onDoubleClick:Boolean(L)?n:void 0,children:t.cells.map((e=>{const{key:t}=e.getCellProps();return e.render("Cell",{key:t})}))})}))]})]}),e(Wl,{open:f})]}),e(Ki,{sx:{display:"flex","& .MuiToolbar-root":{display:"flex",alignItems:"baseline",minHeight:"44px"}},variant:"body",component:"div",rowsPerPageOptions:[...new Set([v,...b])]?.sort(((e,t)=>e-t)),colSpan:3,count:m,rowsPerPage:Number(be),page:Number(we),onPageChange:(e,t)=>{se(t)},onRowsPerPageChange:e=>{ae(Number(e.target.value))},ActionsComponent:O?Kl:Vl})]}),fe?e(oe,{open:fe,children:e(hd,{filters:Ae,title:r,rows:te,columns:R,onClose:()=>{ge(!1)},enablePdfPrint:H,reportTemplateCode:u?.find((e=>e?.REPORT_PERSONALIZATION_ID))?.REPORT_PERSONALIZATION_ID??M,enableEnterToFocus:G})}):null]})})),AA=d((({metaData:r,defaultFilter:n,defaultSortOrder:d,dataTransformer:u,autoRefreshInterval:A,enableExport:p,reportTemplateCode:f,variant:g,autoFetch:m,headerToolbarStyle:w,enableEnterToFocus:b,focusScopeId:v},y)=>{const{authState:B}=Vs(),{defaultGridConfig:C,defaultExportConfig:x}=Ws(),F=s(nA),{enqueueSnackbar:N}=ji(),{t:S}=ne(),E=a((()=>Array.isArray(r.columns)?r.columns.map((e=>({...e,columnName:S(e.columnName)}))):r.columns??[]),[S]),T=a((()=>Array.isArray(r.filters)?r.filters.map((e=>({...e,columnName:S(e.columnName)}))):r.filters??[]),[S]),L=a((()=>({width:150,maxWidth:400,minWidth:50,Header:aA})),[]),k=a((()=>n),[]),D=a((()=>d),[]),I=h((e=>e[r?.gridConfig?.rowIdColumn]),[r?.gridConfig?.rowIdColumn]),[U,P]=c(!1),[O,R]=c([]),[Q,H]=c(0),[M,_]=c(0),[j,z]=c(null),V=o(0),K=o(null),q=h((()=>{R([]),H(0),_(0),V.current=0}),[]),G=h((({pageSize:e,pageIndex:t,sortBy:i,filters:r})=>{P(!0),z(null);const n=++V.current,s=Number(e)*Number(t)+1,a=Number(s)+Number(e)-1;let o=((e=[])=>(Array.isArray(e)||(e=[e]),e.map(((e,t)=>({ACCESSOR:e.id,CONDITION:e.value.condition,VALUE:e.value.value,TYPE:e.value?.type??""})))))(r);K.current&&K.current?.abort?.(),K.current=new AbortController,F?.getGridData(s,a,((e=[])=>e.map(((e,t)=>({ACCESSOR:e.id??"",VALUE:e?.desc?"desc":"asc"}))))(i),o,K.current).then((t=>{n===V.current&&(R(u(t?.[0]?.REPORT_DATA??[])),_(Math.ceil(Number(t?.[0]?.COUNT??1)/Number(e))),H(Number(t?.[0]?.COUNT??1)),P(!1))})).catch((e=>{e?.error_msg?.includes("AbortError")||z(e),P(!1)}))}),[H,P,R,F]),W=o(null),J=v&&b?{"data-scope-id":v}:{};return l((()=>{b&&W.current&&W.current.focus()}),[b]),i(t,{children:[j&&e(Va,{severity:"error",errorMsg:j?.error_msg??"Unknown Error occured",errorDetail:j?.error_detail}),e("div",{ref:W,tabIndex:0,onKeyDown:e=>{b&&ma(e,v)},style:{width:"100%",position:"relative"},...J,children:e(uA,{ref:y,label:r.gridConfig?.gridLabel?S(r.gridConfig.gridLabel):S(fa(window.location.pathname,B?.menulistdata??[],!0)),dense:!0,multipleActions:r?.multipleActions,singleActions:r?.singleActions,doubleClickAction:r?.doubleClickAction,alwaysAvailableAction:r?.alwaysAvailableAction,setGridAction:r?.setAction,filterMeta:T,getRowId:I,columns:E,defaultColumn:L,defaultHiddenColumns:r.hiddenColumns,defaultFilter:k,defaultSortOrder:D,loading:U,data:O,setData:R,onFetchData:G,pageCount:M,totalRecords:Q,pageSizes:r.gridConfig?.pageSizes??[5,10],defaultPageSize:r.gridConfig?.defaultPageSize??10,allowColumnReordering:r.gridConfig?.allowColumnReordering??!1,allowColumnHiding:r.gridConfig?.allowColumnHiding??!1,allowKeyboardNavigation:r.gridConfig?.allowKeyboardNavigation??!1,allowFilter:r.gridConfig?.allowFilter??!0,filterAlwaysVisible:r.gridConfig?.filterAlwaysVisible??!1,containerHeight:r?.gridConfig?.containerHeight,occupiedHeight:r?.gridConfig?.occupiedHeight,allowRowSelection:r?.gridConfig?.allowRowSelection??!0,autoRefreshInterval:A,enablePaginationInput:r.gridConfig?.enablePaginationInput??C?.enablePaginationInput??!0,finalMetaData:r.columns.map((e=>({...e,columnName:S(e.columnName)}))),enableExport:p,enablePdfPrint:r?.gridConfig?.enablePdfPrint??x?.enablePdfPrint??!1,reportTemplateCode:f,variant:g??C?.variant??"standard",autoFetch:r?.gridConfig?.autoFetch??m??!0,handleReset:q,headerToolbarStyle:w,enableEnterToFocus:b})})]})})),pA=d((({gridCode:t,getGridData:i,metaData:r,actions:n,setAction:s,defaultFilter:a=[],defaultSortOrder:o=[],dataTransformer:l=e=>e,autoRefreshInterval:h,enableExport:c,reportTemplateCode:d,variant:u,autoFetch:A,headerToolbarStyle:p,enableEnterToFocus:f,focusScopeId:g},m)=>{let w=fA({metaData:r,actions:n,setAction:s});return e(sA,{gridCode:t,getGridData:i,children:e(Tl,{children:e(AA,{ref:m,metaData:w,defaultFilter:a,defaultSortOrder:o,dataTransformer:l,autoRefreshInterval:h,enableExport:c,reportTemplateCode:d,variant:u,autoFetch:A,headerToolbarStyle:p,enableEnterToFocus:f,focusScopeId:g})})})})),fA=({metaData:e,actions:t,setAction:i})=>{let r=O(e),n=r.columns,s=r.filters;s=Mo(s);const a=_o(n);n=eo(n),n=Xa(n),n=jo(n);const o=zo(t??null);return{columns:n,gridConfig:r.gridConfig,hiddenColumns:a,filters:s,setAction:i,...o}},gA=({content:i,buttonText:r="",...n})=>e(Wi,{...n,content:i,children:e(Ji,{children:({handlePrint:i})=>e(t,{children:Boolean(r)?e(za,{onClick:i,children:r}):e(tl,{title:G("Print"),arrow:!0,children:e(C,{onClick:i,size:"small",children:e(Xi,{style:{color:"var(--white)"}})})})})})}),mA=({isOpen:t=!1,validMessage:r,onActionYes:n,onActionNo:s,rows:a,isLoading:o=!1,isError:l=!1,error_msg:h="",error_detail:c="",loadingText:d="Loading..."})=>{const{t:u}=ne();return i(dt,{open:t,maxWidth:"sm",children:[e(ut,{children:r}),e(pt,{children:o?e(Ga,{text:d},"loaderforDeleteing"):l?e(Va,{severity:"error",errorMsg:h??"Unknown Error occured",errorDetail:c??""}):null}),i(At,{children:[e(ct,{onClick:()=>s(),color:"secondary",disabled:o,children:u("No")}),e(ct,{onClick:()=>n(a),color:"secondary",disabled:o,children:u("Yes")})]})]})},wA=({validMessage:t,onActionYes:i,onActionNo:r,isLoading:n=!1,isError:s=!1,error_msg:a="",error_detail:o="",loadingText:l="Loading..."})=>{const{state:h}=Yi();return e(mA,{isOpen:!0,validMessage:t,isLoading:n,onActionYes:i,onActionNo:r,isError:s,rows:h,error_msg:a,error_detail:o,loadingText:l})},bA=({MessageTitle:r,Message:n,onActionYes:s,onActionNo:a,rows:o,open:l=!1,loading:h=!1,enableEnterToFocus:c,focusScopeId:d="enter-to-focus-popup-msg"})=>{const u=qc(),{t:A}=ne(),{enableEnterToFocus:p}=Ws(),f=c??p;return e(t,{children:i(oe,{fullWidth:!1,open:l,className:"PopupMessageAPIWrapper__base",onKeyDown:e=>{f&&ma(e,d)},...d&&f?{"data-scope-id":d}:{},children:[e(le,{className:u.dialogTitleClass,children:A(r)}),e(he,{children:e(ce,{style:{color:"black",marginTop:"8px",marginBottom:"6px"},children:A(n)})}),i(de,{className:u.verifybutton,children:[e(za,{endIcon:h?e(be,{size:20}):null,onClick:()=>s(o),disabled:h,children:A("Yes")}),e(za,{onClick:()=>a(),disabled:h,children:A("No")})]})]})})},vA=Ci((e=>({arrayRowContainer:{position:"relative",boxShadow:e.shadows[3],marginBottom:e.spacing(1),paddingRight:"8px",paddingBottom:"8px"},newArrayRowContainer:{position:"relative",boxShadow:"",marginBottom:"0","& .MuiInputBase-root":{marginTop:"0px"},"& .css-1qlanbt-MuiInputBase-root-MuiFilledInput-root":{"&:after":{borderBottom:"none"},"&:hover":{"&:before":{borderBottom:"none"}}},"& .MuiGrid-item":{}},newSecondArrayRowContainer:{position:"relative",boxShadow:"",marginBottom:"0","& .css-1qlanbt-MuiInputBase-root-MuiFilledInput-root":{"&:after":{borderBottom:"none"},"&:hover":{"&:before":{borderBottom:"none"}}}},arrayRowRemoveBtn:{position:"absolute",top:-8,right:-8,color:"#f50057"},arrayRowCard:{width:"100%",position:"relative",overflow:"unset"},arrayRowCardContent:{paddingLeft:"25px"},arrayRowCount:{display:"flex",width:"100%",margin:"0px 0 6px -8px"},arrayRowCountCustomStyle:{display:"flex",width:"100%",margin:"2px 0 0px -8px"},arrayRowCountFixedRows:{display:"flex",width:"100%",margin:"2px 0 6px -8px"},arrayScreenRowCount:{display:"flex",width:"100%",margin:"2px 0 12px 0px"},newArrayRowCardContent:{paddingLeft:"32px","& .MuiInputBase-root":{marginTop:"0px"}},arrayFieldSelected:{padding:"8px 0px 0px 8px",background:"#eee",width:"100%"},arrayFieldUnselected:{width:"100%"}}))),yA=({row:r,getAllRowsValues:n,fieldKey:s,oneRow:a,classes:o,removeFn:l,rowIndex:d,removeRowFn:u,totalRows:A,isSubmitting:f,formState:g,formName:m,arrayFieldIDName:w,arrayFieldName:b,fixedRows:v,isDisplayCount:y=!0,isCustomStyle:B=!1,disagreeButtonName:C,agreeButtonName:x,errorTitle:F,displayCountName:N,isRemoveButton:S,selectedRowIndex:E,setSelectedRowIndex:T,hideRemoveIconOnSingleRecord:k,enableEnterToFocus:D})=>{const{messageBoxConfig:I}=id(),{t:U}=ne(),P=qc(),[O,R]=c(!1),[Q,H]=c(!1),[M,_]=c(""),[j,z]=c(!1),[V,K]=c({allow:!0,reason:""});L((({snapshot:e})=>async()=>{const t=e.getLoadable(Ns(`${m}/${s}`));if("hasValue"===t.state){const e=t.contents;if(Boolean(e.value))try{H(!0),await Promise.resolve(u({...g,[w]:e.value},b)),H(!1),_(""),z(!0)}catch(e){console.log(e),H(!1),_(e?.error_msg??"Unkown error occured")}else z(!0)}}),[_,z,H]);const q=h(((e=!1)=>{j||e?l(d):(R(!1),setTimeout((()=>{H(!1),_(""),z(!1)}),1))}),[R,H,_,z,j,l,d]),G=h((async()=>{let e=!0,t="Cannot remove a Row",i=!0;if("function"==typeof u){try{i=await u(g,b,n(),d)}catch(e){console.error("Remove row function error<<",e)}"boolean"==typeof i?e=i:"object"==typeof i&&(e=i?.allow??!1,t=i?.reason??"Cannot remove a Row")}e?R(!0):K({allow:e,reason:t})}),[R,d]);let W;W=Boolean(B)?0!==d?o.newArrayRowContainer:o.newSecondArrayRowContainer:Boolean(v)?o.newSecondArrayRowContainer:o.arrayRowContainer;const J=n()?.[b]?.[d]?._rowColor,X=()=>{T(d);const e=n(),t=Object.keys(r.cells).reduce(((t,i)=>{const n=(t=>{const i=t.replace(/\]/g,"").split(/\[|\./);let r=e;return i.forEach((e=>{r=r&&e in r?r[e]:void 0})),r})(r.cells[i].name);return t[i]=n,t}),{});"function"==typeof g?.onArrayFieldRowClickHandle&&g?.onArrayFieldRowClickHandle(t),"function"==typeof g?.onArrayFieldRowDoubleClickHandle&&g?.onArrayFieldRowDoubleClickHandle(t)},Y={INFO:I?.iconsConfig?.INFO?.color??"dodgerblue",SUCCESS:I?.iconsConfig?.SUCCESS?.color??"green",WARNING:I?.iconsConfig?.WARNING?.color??"orange",ERROR:I?.iconsConfig?.ERROR?.color??"#f44336",CONFIRM:I?.iconsConfig?.CONFIRM?.color??"#474e5b"},$=I?.iconsConfig?.SUCCESS?.icon??Lt,Z=I?.iconsConfig?.CONFIRM?.icon??Tt;return i(p,{children:[Boolean(y)?e(t,{children:e(fe,N?{gutterBottom:!0,className:(B?o.arrayRowCountCustomStyle:v?o.arrayRowCountFixedRows:o.arrayRowCount)+` ${b}-arrayField-firstrow`,children:`${N} ${d+1} of ${A}`}:{gutterBottom:!0,className:(B?o.arrayRowCountCustomStyle:v?o.arrayRowCountFixedRows:o.arrayRowCount)+` ${b}-arrayField-firstrow`,children:`${d+1} of ${A}`})}):null,e("div",{onClick:g?.onArrayFieldRowClickHandle&&X,onDoubleClick:g?.onArrayFieldRowDoubleClickHandle&&X,className:E===d?o?.arrayFieldSelected:o?.arrayFieldUnselected,children:i(Se,{container:!0,item:!0,xs:12,md:12,sm:12,spacing:1,className:W+` ${b}-array-field-row`,sx:{background:`${Boolean(J)&&"string"==typeof J?J:"none"}`},children:[a,"function"==typeof l&&!Boolean(v)||Boolean(S)?e(t,{children:A>1||!k?e(Be,{onClick:G,className:o.arrayRowRemoveBtn,disabled:f,children:e(Et,{})}):null}):null]})}),v&&d+1<A?e(Ee,{sx:{backgroundColor:"rgba(0, 0, 0, 0.6)",width:"100%"}}):null,i(oe,{open:O,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",className:"arrayfield__delete__dialog__base",onKeyDown:e=>{D&&ma(e)},children:[e(le,{className:P.dialogTitleClass,style:{background:j?Y.SUCCESS:Y.CONFIRM},children:U(j?"Success":"Confirmation")}),i(he,{sx:{padding:".75rem 10px 1.5rem 10px !important",display:"flex",alignItems:"center",gap:"0.5rem"},children:[e(me,{children:j?e($,{fontSize:"large",style:{color:Y.SUCCESS}}):e(Z,{fontSize:"large",style:{color:Y.CONFIRM}})}),e(ce,{children:e(fe,{color:"black",children:j?U("Recordsuccessfullydeleted"):Q?U("Pleasewaitdeletingrecord"):Boolean(M)?M:U(F||"AreyouSureyouwanttodeletethisrecord")})})]}),i(de,{children:[e(za,{onClick:()=>q(!0),sx:{background:Y.CONFIRM,"&:hover":{background:Y.CONFIRM}},children:U(x||"Yes")}),e(za,{onClick:()=>q(!1),sx:{background:Y.CONFIRM,"&:hover":{background:Y.CONFIRM}},children:U(C||"No")})]})]}),V.allow?null:e(BA,{open:!V.allow,className:"arrayfield__remove__error__dialog__base",icon:"ERROR",reason:V.reason,handleClick:()=>{K({allow:!0,reason:""})},enableEnterToFocus:D},"remove-error-dialog")]},r.fieldIndexKey)},BA=({open:t,icon:r="ERROR",className:n,reason:s,handleClick:a,enableEnterToFocus:h})=>{const c=qc(),d=o(null),{messageBoxConfig:u}=id(),A={INFO:u?.iconsConfig?.INFO?.color??"dodgerblue",SUCCESS:u?.iconsConfig?.SUCCESS?.color??"green",WARNING:u?.iconsConfig?.WARNING?.color??"orange",ERROR:u?.iconsConfig?.ERROR?.color??"#f44336",CONFIRM:u?.iconsConfig?.CONFIRM?.color??"#474e5b"},p=u?.iconsConfig?.[r]?.icon??kt;return l((()=>{setTimeout((()=>{d.current&&d.current.focus()}),100)}),[]),i(oe,{open:t,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",className:n,onKeyDown:e=>{h&&ma(e)},children:[e(le,{className:c.dialogTitleClass,style:{background:A[r]},children:G("Stop")}),i(he,{sx:{padding:".75rem 10px 1.5rem 10px !important",display:"flex",alignItems:"center",gap:"0.5rem"},children:[e(me,{children:e(p,{fontSize:"large",style:{color:A[r]}})}),e(ce,{children:e(fe,{color:"black",children:s})})]}),e(de,{children:e(za,{onClick:a,ref:d,sx:{background:A[r],"&:hover":{background:A[r]}},children:G("Ok")})})]})};var CA=Object.freeze({__proto__:null,ArrayField2:({name:t,label:r,_fields:n,GridProps:s,enableGrid:a,componentProps:l={},removeRowFn:d,addRowFn:A,arrayFieldIDName:f,dependentFields:m,shouldExclude:w,fixedRows:b,isDisplayCount:v,isCustomStyle:y,getFixedRowsCount:B,onFormButtonClickHandel:C,onFormDataChange:x,disagreeButtonName:F,agreeButtonName:N,errorTitle:S,displayCountName:E,isRemoveButton:T,changeRowOrder:L,noRecordMessage:k,hideRemoveIconOnSingleRecord:D=!0,enableEnterToFocus:I})=>{const{t:U}=ne(),P=Ws(),{authState:R}=Vs();let Q=O(n);const H=vA(),[M,_]=c(!1),[j,z]=c(""),[V,K]=c(null);let q={form:{},fields:Q};const G=o(null);null===G.current&&(G.current=((e,t,i,r)=>(e=Gh(e,uc,t,i,r),e=qh(e),Wh(e)))(q,U,R,P));const W=o(G?.current?.fields?.reduce(((e,t)=>(e[t.name]="",e)),{})),J=o(G?.current?.fields?.reduce(((e,t)=>(e[t.name]=t,e)),{})),{renderRows:X,getAllRowsValues:Y,unshift:$,isSubmitting:Z,formState:ee,formName:te,excluded:ie,push:re}=va({arrayFieldName:t,template:W.current,dependentFields:m,shouldExclude:w,getFixedRowsCount:B}),se=h((()=>{setTimeout((()=>{const e=document.querySelectorAll(`.${t}-arrayField-firstrow`)?.[0],i=document.querySelectorAll(`.${t}-array-field-row`),r=i[i.length-1];!L&&e?e.scrollIntoView({behavior:"smooth",block:"center"}):L&&r&&r.scrollIntoView({behavior:"smooth",block:"center"})}),50)}),[t,L]),ae=h((()=>{if("function"==typeof A){let e=A(Y(),t),i=!1,r="Cannot add a new Row";"boolean"==typeof e&&(i=e),"object"==typeof e&&(i=e?.allow??!1,r=e?.reason??"Cannot add a new Row"),i?(Boolean(L)?re():$(),se()):(_(!0),z(r))}else Boolean(L)?re():$(),se()}),[$,Y]);if(ie)return null;let oe=X((({row:i,removeFn:r,rowIndex:n,fields:s,totalRows:a})=>{const o=s.map((r=>{const s=J.current[r];if(!Boolean(s))return null;let a;s.onFormButtonClickHandel=C,s.onFormDataChange=x,a=0===n?{...s}:{...s,label:null};const o=kh(y?a:s,{},t,l);let h=g(o,{fieldKey:i.cells[r].key,name:i.cells[r].name,label:U(o?.props?.label),placeholder:U(o?.props?.placeholder)});return e(p,{children:h},i.cells[r].key)}));return e(yA,{fieldKey:i.cells[f??""]?.key??"",getAllRowsValues:Y,oneRow:o,classes:H,removeFn:r,rowIndex:n,removeRowFn:d,row:i,totalRows:a,isSubmitting:Z,formState:ee,formName:te,arrayFieldIDName:f,arrayFieldName:t,fixedRows:b,isDisplayCount:v,isCustomStyle:y,disagreeButtonName:F,agreeButtonName:N,errorTitle:S,displayCountName:E,isRemoveButton:T,selectedRowIndex:V,setSelectedRowIndex:K,hideRemoveIconOnSingleRecord:D,enableEnterToFocus:I??P.enableEnterToFocus},i.fieldIndexKey)}));let le=i(p,{children:[i(xe,{className:H.arrayRowCard,children:[e(Fe,{style:{paddingTop:0,paddingBottom:0,position:"sticky",top:0,zIndex:1},sx:{"& .MuiCardHeader-title":r?{background:"var(--theme-color5)",ml:1.5,mt:1,p:1,color:"var(--theme-color2)"}:null,"& .MuiCardHeader-action":{}},title:r,action:Boolean(b)?null:e(Be,{style:{background:"#fff",boxShadow:"0 1px 3px rgba(0,0,0,.2)"},onClick:ae,disabled:Z,size:"small",children:e(St,{})})}),e(Ne,{className:H.arrayRowCardContent,style:{paddingTop:"0px",paddingBottom:"16px"},children:i(Se,{container:!0,item:!0,spacing:1,xs:12,md:12,sm:12,style:{marginTop:"2px"},children:[oe,oe.length<=0?e(fe,{children:U(k||"NoRecordsFoundclicktheaddbuttontoaddone")}):null]})})]}),M?e(BA,{open:M,className:"arrayfield__add__error__dialog__base",icon:"ERROR",reason:j,handleClick:()=>{_(!1),z("")},enableEnterToFocus:I??P.enableEnterToFocus},"add-error-dialog"):null]});return Boolean(a)?u(Se,{container:!0,...s,key:t},le):e(p,{children:le},t)},ArrayFieldValues:({name:t,label:r,_fields:n,GridProps:s,enableGrid:a,defaultValue:o,componentProps:l={}})=>{let h=O(n);const c=vA();if(!Array.isArray(o))return e("div",{children:"Invalid data for arrayField"});const d=o.map(((i,r)=>{const n=(s=h,a=i,Array.isArray(s)?s.map((e=>{const{name:t,...i}=e;return{...i,name:t,defaultValue:a[t]??"N/A"}})):[]);var s,a;const o=n.map(((i,r)=>{const n=((t,i,r,n={})=>{const{render:s,schemaValidation:a,...o}=t;let l=null;switch(s.componentType){case"arrayField":l=Uh;break;case"spacer":l=Ih;break;case"typography":l=Oh;break;case"hidden":l=Ph;break;default:l=Dh}if(l===Ih||l===Oh)return e(l,{...o},`${r}/${o.name}`);{const e={...n[s.componentType],...o},t={...i?.gridConfig?.item,...o?.GridProps};return u(l,{...e,fieldKey:o.name,key:`${r}/${o.name}`,enableGrid:!0,GridProps:{item:!0,xs:t?.xs??"auto",md:t?.sm??"auto",xl:t?.xs??"auto"}})}})(i,{},t,l);return e(p,{children:n},`${i.name}-${r}`)}));return e(p,{children:e(ie,{container:!0,item:!0,xs:12,md:12,sm:12,spacing:2,className:c.arrayRowContainer,children:o})},r)}));let A=e(p,{children:i(st,{className:c.arrayRowCard,children:[e(lt,{title:r}),e(at,{className:c.arrayRowCardContent,children:e(ie,{container:!0,spacing:1,xs:12,md:12,sm:12,children:d})})]})});return Boolean(a)?u(ie,{container:!0,...s,key:t},A):e(p,{children:A},t)}});const xA=xi({root:{"& .MuiFormLabel-root":{fontWeight:600,textTransform:"capitalize",fontSize:"1rem","@media (max-width: 1200px)":{fontSize:"0.75rem"},"@media (max-width: 1440px)":{fontSize:"0.875rem"}},"& label.Mui-focused":{color:"var(--theme-color1)"},"& .MuiRadio-root.Mui-checked":{color:"var(--theme-color1) !important"}}})($e),FA=({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:s,postValidationSetCrossFieldValues:a,runPostValidationHookAlways:o,dependentFields:l,fieldKey:d,label:A,options:p,FormControlProps:f,FormLabelProps:g,RadioGroupProps:m,FormHelperTextProps:w,FormControlLabelProps:b,GridProps:v,enableGrid:y,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x,CircularProgressProps:F,_optionsKey:N,disableCaching:S,...E})=>{const{formState:T,value:L,error:k,touched:D,handleChange:I,handleBlur:U,isSubmitting:P,fieldKey:O,name:R,excluded:Q,readOnly:H,dependentValues:M,incomingMessage:_,runValidation:j,whenToRunValidation:z,setIncomingMessage:V}=Js({name:t,fieldKey:d,dependentFields:l,validate:i,validationRun:r,runPostValidationHookAlways:o,postValidationSetCrossFieldValues:a,isReadOnly:s,shouldExclude:n,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x}),[K,q]=c([]),G=h((e=>po(K)(e)),[K]),W=h((e=>{let t=G("object"==typeof e?e?.target?.value??"":e);I(e,t[0])}),[I,G]),{loadingOptions:J}=co(T,p,q,W,M,_,j,z,N,S,V,!0,"",!1);if(Q)return null;const X=D&&""!==(k??""),Y=K.map((t=>u(Ye,{...b,control:e(Zi,{...E,disabled:H,readOnly:H,tabIndex:H?-1:void 0}),key:t.value,label:t.label,value:t.value}))),$=u(xA,{...f,key:O,component:"fieldset",disabled:P,error:!P&&X,onBlur:U},e(Je,{...g,component:"label",children:A}),e($i,{...m,onChange:W,name:R,value:L,children:J?e(B,{position:"end",children:e(re,{color:"primary",variant:"indeterminate",...F})}):Y}),!P&&X?e(Ze,{...w,children:k}):null);return Boolean(y)?u(ie,{...v,key:O},$):$};var NA=Object.freeze({__proto__:null,Radio:FA,default:FA});const SA=(e,t)=>Array.isArray(e)&&e.indexOf(t)>-1;var EA=Object.freeze({__proto__:null,Switch:({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:s,postValidationSetCrossFieldValues:a,runPostValidationHookAlways:o,dependentFields:l,fieldKey:h,label:c,FormControlProps:d,FormHelperTextProps:A,FormControlLabelProps:p,GridProps:f,enableGrid:g,runValidationOnDependentFieldsChange:m,skipValueUpdateFromCrossFieldWhenReadOnly:w,...b})=>{const{value:v,error:y,touched:B,handleChange:C,handleBlur:x,isSubmitting:F,fieldKey:N,name:S,excluded:E,readOnly:T}=Js({name:t,fieldKey:h,dependentFields:l,validate:i,validationRun:r,runPostValidationHookAlways:o,postValidationSetCrossFieldValues:a,runValidationOnDependentFieldsChange:m,skipValueUpdateFromCrossFieldWhenReadOnly:w,isReadOnly:s,shouldExclude:n});if(E)return null;const L=B&&""!==(y??""),k=u($e,{...d,key:N,component:"fieldset",disabled:F,error:!F&&L,onBlur:x,tabIndex:T?-1:void 0},e(Ye,{...p,name:S,control:e(Dt,{...b,readOnly:T,tabIndex:T?-1:void 0}),onChange:C,label:c,checked:Boolean(v)}),!F&&L?e(Ze,{...A,children:y}):null);return Boolean(g)?e(ie,{...f,children:k}):k},SwitchGroup:({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:s,postValidationSetCrossFieldValues:a,runValidationOnDependentFieldsChange:o,runPostValidationHookAlways:l,dependentFields:d,fieldKey:A,label:p,options:f,FormControlProps:g,FormLabelProps:m,FormGroupProps:w,FormHelperTextProps:b,FormControlLabelProps:v,GridProps:y,enableGrid:C,CircularProgressProps:x,_optionsKey:F,disableCaching:N,skipValueUpdateFromCrossFieldWhenReadOnly:S,...E})=>{const{formState:T,value:L,error:k,touched:D,handleChange:I,handleBlur:U,isSubmitting:P,fieldKey:O,name:R,excluded:Q,readOnly:H,dependentValues:M,incomingMessage:_,runValidation:j,whenToRunValidation:z,setIncomingMessage:V}=Js({name:t,fieldKey:A,dependentFields:d,validate:i,validationRun:r,runPostValidationHookAlways:l,postValidationSetCrossFieldValues:a,isReadOnly:s,shouldExclude:n,runValidationOnDependentFieldsChange:o,skipValueUpdateFromCrossFieldWhenReadOnly:S}),[K,q]=c([]),G=h((e=>po(K)(e)),[K]),W=h((e=>{let t=G("object"==typeof e?e?.target?.value??"":e);I(e,t[0])}),[I,G]),{loadingOptions:J}=co(T,f,q,W,M,_,j,z,F,N,V,!0,"",!1);if(Q)return null;const X=D&&""!==(k??""),Y=K.map((t=>u(Ye,{...v,control:e(Dt,{...E,readOnly:H,tabIndex:H?-1:void 0}),key:t.value,name:R,onChange:W,label:t.label,value:t.value,checked:SA(L,t.value)}))),$=u($e,{...g,key:O,component:"fieldset",disabled:P,error:!P&&X,onBlur:U},e(Je,{...m,component:"label",children:p}),e(Xe,{...w,children:J?e(B,{position:"end",children:e(re,{color:"primary",variant:"indeterminate",...x})}):Y}),!P&&X?e(Ze,{...b,children:k}):null);return Boolean(C)?e(ie,{...y,children:$}):$}});const TA=({name:t,fieldKey:r,shouldExclude:n,isReadOnly:s,postValidationSetCrossFieldValues:a,runPostValidationHookAlways:o,dependentFields:d,validate:A,validationRun:f,label:g,InputLabelProps:m,GridProps:w,enableGrid:b,runValidationOnDependentFieldsChange:v,skipValueUpdateFromCrossFieldWhenReadOnly:y,...B})=>{const{handleChange:C,handleBlur:x,isSubmitting:F,fieldKey:N,name:S,value:E,excluded:T}=Js({name:t,fieldKey:r,dependentFields:d,validate:A,validationRun:f,runPostValidationHookAlways:o,postValidationSetCrossFieldValues:a,isReadOnly:s,shouldExclude:n,runValidationOnDependentFieldsChange:v,skipValueUpdateFromCrossFieldWhenReadOnly:y}),[L,k]=c(Number(E));l((()=>{k(Number(E))}),[E]);const[D,I]=c(!1),U=h(((e,t)=>{k(t)}),[k]),P=h(((e,t)=>{C(t)}),[C]),O=h((()=>{x(),I(!1)}),[x,I]),R=h((()=>{I(!0)}),[I]);if(T)return null;const Q=i(p,{children:[e(Ut,{...m,focused:D,disabled:F,children:g}),u(It,{...B,key:N,id:N,name:S,value:L,disabled:F,onFocus:R,onChange:U,onChangeCommitted:P,onBlur:O})]},N);return Boolean(b)?e(ie,{...w,children:Q}):Q};var LA=Object.freeze({__proto__:null,Slider:TA,default:TA});function kA(e,t,i,r=!1){const n={};return i&&ds(e,i,{ignoreTime:r})&&(n._maxDt=i),t&&As(e,t,{ignoreTime:r})&&(n._minDt=t),n}Ka(".MuiPickersDay-current.MuiPickersDay-day{color:var(--theme-color1)}.MuiPickersDay-daySelected.MuiPickersDay-day,.MuiPickersDay-daySelected.MuiPickersDay-day:hover{background-color:var(--theme-color1);color:var(--white)}.MuiPickersYear-root.MuiPickersYear-yearSelected{color:var(--theme-color1)}.MuiPickersLayout-contentWrapper .MuiButtonBase-root.Mui-selected{background-color:var(--theme-color1)!important;color:#fff}.MuiPickersLayout-contentWrapper .MuiButtonBase-root:hover{background-color:#8000000a}.MuiPickersSlideTransition-root{min-height:220px}");Ka(".MuiPickersClock-pin,.MuiPickersClockPointer-pointer,.MuiPickersToolbar-toolbar{background-color:var(--theme-color1)!important}.MuiPickersClockPointer-thumb{background-color:var(--white)!important;border:14px solid var(--theme-color1)!important}.MuiPickersClockPointer-noPoint{background-color:var(--theme-color1)!important;border:14px solid var(--theme-color1)!important}.MuiPickersClockNumber-clockNumberSelected,.MuiPickersToolbarText-toolbarBtnSelected{color:var(--white)!important}.MuiPickersToolbarText-toolbarTxt:not(.MuiPickersToolbarText-toolbarBtnSelected){color:var(--white-dim)!important}.MuiPickersLayout-root>.MuiDialogActions-root>button.MuiButton-textPrimary{color:var(--theme-color1)}");var DA=Object.freeze({__proto__:null,DatePicker:({name:i,validate:r,validationRun:n,shouldExclude:s,isReadOnly:d,postValidationSetCrossFieldValues:A,setValueOnDependentFieldsChange:p,runPostValidationHookAlways:f,dependentFields:g,fieldKey:m,type:w,GridProps:b,enableGrid:v,isFieldFocused:y,InputProps:B,inputProps:C,runValidationOnDependentFieldsChange:x,skipValueUpdateFromCrossFieldWhenReadOnly:F,required:N,disablePast:S,disableFuture:E,ignoreInSubmit:T=!1,label:L,setFieldLabel:k,placeholder:D,format:I,CircularProgressProps:U,componentType:P,runPostValidationForInitValue:O,className:R,...Q})=>{const[H,M]=c(null),{commonDateFormat:_}=Ws(),{authState:j}=Vs(),{value:K,prevValue:q,error:G,touched:W,handleChange:J,handleBlur:X,isSubmitting:Y,fieldKey:Z,name:ee,excluded:te,readOnly:re,setIgnoreInSubmit:ae,incomingMessage:oe,whenToRunValidation:le,runValidation:he,dependentValues:ce,validationRunning:de,setErrorAsCB:ue,formState:Ae}=Js({name:i,fieldKey:m,dependentFields:g,validate:r,componentType:P,validationRun:n,runPostValidationHookAlways:f,postValidationSetCrossFieldValues:A,isReadOnly:d,shouldExclude:s,runValidationOnDependentFieldsChange:x,skipValueUpdateFromCrossFieldWhenReadOnly:F,runPostValidationForInitValue:O});l((()=>{if(Boolean(T))if("function"==typeof T){let e=T(ta(ce),Ae,{isSubmitting:Y,value:K});ae(e)}else ae(T)}),[T,ae,ce,K]),l((()=>{if("string"==typeof K){let e=pa(K);if(!isNaN(e)){const t=kA(e,Q?.minDate,Q?.maxDate,!0);J(e,void 0,!1,t)}}}),[K,J]);const{t:pe}=ne(),fe=o();l((()=>{y&&setTimeout((()=>{fe?.current?.focus?.()}),1)}),[y]),l((()=>{if(null!==oe&&"object"==typeof oe){const{isFieldFocused:e,value:t,ignoreUpdate:i}=oe;if(e&&setTimeout((()=>{fe?.current?.focus?.()}),50),Boolean(t)||""===t){const e=kA(t,Q?.minDate,Q?.maxDate,!0);J(t,void 0,!1,e),i||"onBlur"!==le||he({value:t},!0)}}}),[oe,J,he,le]),l((()=>{if("function"==typeof p){let e=p(ta(ce),Ae,{value:K,isSubmitting:Y});if(null!=e){const t=kA(e,Q?.minDate,Q?.maxDate,!0);J(e,void 0,!1,t)}}}),[ce,J,p]);const me=a((()=>{if("function"==typeof k)return k(ta(ce),K)}),[k,ce,K]),ve=W&&""!==(G??""),ye=h((i=>e(t,{children:void 0===q||void 0===K||$(pa(q).toUTCString(),pa(K).toUTCString())?e(to,{...i}):e(il,{title:e(rl,{label:`${pe("OldValueOf")} ${me?.label?pe(me.label):L}`,value:(()=>{if(!q)return"(blank)";try{const e=pa(q);return z(e,(I??_)||"dd/MM/yyyy")}catch{return console.error("Invalid time provided while comparing old value!!!"),""}})()}),arrow:!0,followCursor:!0,children:e(to,{...i})})})),[q]);if(te)return null;const Be=u(Eo,{...Q,key:Z,label:me?.label?pe(me.label):L,format:(I??_)||"dd/MM/yyyy",value:""===K||null===K?null:pa(K),tabIndex:re?-1:void 0,onChange:e=>{const t=kA(e,Q?.minDate,Q?.maxDate,!0);J(e,void 0,!1,t)},onSelectedSectionsChange:e=>{M(e)},selectedSections:H,onClose:()=>{setTimeout((()=>X()),0)},disabled:Y||re,readOnly:re,disablePast:S,disableFuture:E,className:se(R,{hasOldValue:void 0!==q&&void 0!==K&&!$(pa(q).toUTCString(),pa(K).toUTCString())}),slots:{textField:ye},slotProps:{textField:{onBlur:e=>{const t=kA(K,Q?.minDate,Q?.maxDate,!0);X(e,t)},onKeyDown:e=>{const t=I??_;if(!j?.workingDate||"ArrowUp"!==e.key&&"ArrowDown"!==e.key){if("Home"===e.key)M(0);else if("End"===e.key){const e=t.includes("/")?"/":t.includes("-")?"-":null,i=e?t.split(e).length:1;M(i-1)}}else{const i=e.target.value;if(!V(K)&&i?.toLowerCase()===t?.toLowerCase()){const t=j?.workingDate;let i="";"ArrowUp"===e.key?i=(new Date).setDate(new Date(t).getDate()+1):"ArrowDown"===e.key&&(i=(new Date).setDate(new Date(t).getDate()-1)),setTimeout((()=>{const e=kA(new Date(i),Q?.minDate,Q?.maxDate,!0);J(new Date(i),void 0,!1,e)}),0)}}},id:Z,name:ee,placeholder:re?"":me?.placeholder?pe(me.placeholder):D,autoComplete:"off",required:N,error:!Y&&ve,helperText:e(we,{children:!Y&&ve?G:null}),inputProps:{tabIndex:re?-1:void 0,...C},InputProps:{style:{background:Boolean(re||Y)?"#f3f3f3":""},readOnly:re,startAdornment:de?e(ge,{position:"end",sx:{position:"absolute",right:"38px"},children:e(be,{color:"secondary",variant:"indeterminate",size:20,...U})}):null,...B},InputLabelProps:{shrink:!0},inputRef:fe},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%"},cancelLabel:e(ct,{color:"secondary",style:{border:"1px solid rgba(128, 0, 0, 0.23)"},disableElevation:!0,children:pe("Cancel")}),okLabel:e(ct,{color:"secondary",variant:"contained",disableElevation:!0,children:pe("Ok")})});return Boolean(v)?u(ie,{...b,key:Z},Be):Be},DateTimePicker:({name:i,validate:r,validationRun:n,shouldExclude:s,isReadOnly:c,postValidationSetCrossFieldValues:d,setValueOnDependentFieldsChange:A,runPostValidationHookAlways:p,dependentFields:f,fieldKey:g,type:m,GridProps:w,CircularProgressProps:b,enableGrid:v,isFieldFocused:y,InputProps:B,inputProps:C,runValidationOnDependentFieldsChange:x,skipValueUpdateFromCrossFieldWhenReadOnly:F,disablePast:N,disableFuture:S,ignoreInSubmit:E=!1,label:T,setFieldLabel:L,format:k,required:D,placeholder:I,runPostValidationForInitValue:U,componentType:P,className:O,...R})=>{const{commonDateTimeFormat:Q}=Ws(),{value:H,prevValue:M,error:_,touched:j,handleChange:V,handleBlur:K,isSubmitting:q,fieldKey:W,name:J,excluded:X,readOnly:Y,setIgnoreInSubmit:Z,incomingMessage:ee,whenToRunValidation:te,dependentValues:re,runValidation:ne,validationRunning:ae,formState:oe}=Js({name:i,fieldKey:g,dependentFields:f,validate:r,validationRun:n,runPostValidationHookAlways:p,postValidationSetCrossFieldValues:d,isReadOnly:c,shouldExclude:s,runValidationOnDependentFieldsChange:x,skipValueUpdateFromCrossFieldWhenReadOnly:F,runPostValidationForInitValue:U,componentType:P});l((()=>{if(Boolean(E))if("function"==typeof E){let e=E(ta(re),oe,{isSubmitting:q,value:H});Z(e)}else Z(E)}),[E,Z,re,H]),l((()=>{if("string"==typeof H){let e=pa(H);if(!isNaN(e)){const t=kA(e,R?.minDate,R?.maxDate);V(e,void 0,!1,t)}}}),[H,V]);const le=o();l((()=>{y&&setTimeout((()=>{le?.current?.focus?.()}),1)}),[y]),l((()=>{if(null!==ee&&"object"==typeof ee){const{value:e,ignoreUpdate:t}=ee;if(Boolean(e)||""===e){const i=kA(e,R?.minDate,R?.maxDate);V(e,void 0,!1,i),t||"onBlur"!==te||ne({value:e},!0)}}}),[ee,V,ne,te]),l((()=>{if("function"==typeof A){let e=A(ta(re),oe,{value:H,isSubmitting:q});if(null!=e){const t=kA(e,R?.minDate,R?.maxDate);V(e,void 0,!1,t)}}}),[re,V,A]);const he=a((()=>{if("function"==typeof L)return L(ta(re),H)}),[L,re,H]),ce=h((i=>e(t,{children:void 0===M||void 0===H||$(pa(M).toUTCString(),pa(H).toUTCString())?e(to,{...i}):e(il,{title:e(rl,{label:`${G("OldValueOf")} ${he?.label?G(he.label):T}`,value:(()=>{if(!M)return"(blank)";try{const e=pa(M);return z(e,(k??Q)||"dd/MM/yyyy HH:mm:ss aa")}catch{return console.error("Invalid time provided while comparing old value!!!"),""}})()}),arrow:!0,followCursor:!0,children:e(to,{...i})})})),[M]),de=j&&""!==(_??"");if(X)return null;const ue=u(Lo,{...R,key:W,label:he?.label?G(he.label):T,format:(k??Q)||"dd/MM/yyyy HH:mm:ss aa",value:""===H||null===H?null:pa(H),views:["year","month","day","hours","minutes","seconds"],disablePast:N,disableFuture:S,onChange:e=>{const t=kA(e,R?.minDate,R?.maxDate);V(e,void 0,!1,t)},onClose:()=>{setTimeout((()=>K()),0)},disabled:q||Y,readOnly:Y,className:se(O,{hasOldValue:void 0!==M&&void 0!==H&&!$(pa(M).toUTCString(),pa(H).toUTCString())}),slots:{textField:ce},slotProps:{textField:{name:J,id:W,onBlur:e=>{const t=kA(H,R?.minDate,R?.maxDate);K(e,t)},placeholder:Y?"":he?.placeholder?G(he.placeholder):I,required:D,error:!q&&de,helperText:e(we,{children:!q&&de?_:null}),inputProps:{tabIndex:Y?-1:void 0,...C},InputProps:{style:{background:Boolean(Y||q)?"#f3f3f3":""},readOnly:Y,startAdornment:ae?e(ge,{position:"end",sx:{position:"absolute",right:"38px"},children:e(be,{color:"secondary",variant:"indeterminate",size:20,...b})}):null,...B},InputLabelProps:{shrink:!0}},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%"}});return Boolean(v)?u(ie,{...w,key:W},ue):ue},TimePicker:({name:i,validate:r,validationRun:n,shouldExclude:s,isReadOnly:c,postValidationSetCrossFieldValues:d,runPostValidationHookAlways:A,dependentFields:p,fieldKey:f,type:g,GridProps:m,CircularProgressProps:w,enableGrid:b,isFieldFocused:v,InputProps:y,inputProps:B,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x,required:F,format:N,runPostValidationForInitValue:S,componentType:E,className:T,label:L,placeholder:k,setFieldLabel:D,...I})=>{const{commonTimeFormat:U}=Ws(),{value:P,prevValue:O,error:R,touched:Q,handleChange:H,handleBlur:M,isSubmitting:_,fieldKey:j,name:V,excluded:K,readOnly:q,validationRunning:W,dependentValues:J}=Js({name:i,fieldKey:f,dependentFields:p,validate:r,validationRun:"onChange",runPostValidationHookAlways:A,postValidationSetCrossFieldValues:d,isReadOnly:c,shouldExclude:s,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x,runPostValidationForInitValue:S,componentType:E});l((()=>{if("string"==typeof P){let e=new Date(P);isNaN(e)||H(e)}}),[P,H]);const X=o();l((()=>{v&&setTimeout((()=>{X?.current?.focus?.()}),1)}),[v]);const Y=Q&&""!==(R??""),Z=a((()=>{if("function"==typeof D)return D(ta(J),P)}),[D,J,P]),ee=h((i=>e(t,{children:void 0===O||void 0===P||$(pa(O).toUTCString(),pa(P).toUTCString())?e(to,{...i}):e(il,{title:e(rl,{label:`${G("OldValueOf")} ${Z?.label?G(Z.label):L}`,value:(()=>{if(!O)return"(blank)";try{const e=pa(O);return z(e,(N??U)||"HH:mm:ss aa")}catch{return console.error("Invalid time provided while comparing old value!!!"),""}})()}),arrow:!0,followCursor:!0,children:e(to,{...i})})})),[O]);if(K)return null;const te=u(To,{...I,key:j,id:j,name:V,label:Z?.label?G(Z.label):L,format:(N??U)||"HH:mm:ss aa",value:""===P?null:new Date(P),onChange:H,onClose:()=>{setTimeout((()=>M()),0)},disabled:_||q,readOnly:q,className:se(T,{hasOldValue:void 0!==O&&void 0!==P&&!$(pa(O).toUTCString(),pa(P).toUTCString())}),slots:{textField:ee},slotProps:{textField:{onBlur:M,placeholder:q?"":Z?.placeholder?G(Z.placeholder):k,error:!_&&Y,helperText:e(we,{children:!_&&Y?R:null}),inputProps:{tabIndex:q?-1:void 0,...B},InputLabelProps:{shrink:!0},InputProps:{style:{background:Boolean(q||_)?"#f3f3f3":""},readOnly:q,tabIndex:q?-1:void 0,startAdornment:W?e(ge,{position:"end",sx:{position:"absolute",right:"38px"},children:e(be,{color:"secondary",variant:"indeterminate",size:20,...w})}):null,...y},required:F}}});return Boolean(b)?u(ie,{...m,key:j},te):te}});const IA=({name:t,validate:r,validationRun:n,shouldExclude:s,postValidationSetCrossFieldValues:a,isReadOnly:o,runPostValidationHookAlways:l,dependentFields:d,fieldKey:A,label:f,InputLabelProps:g,GridProps:m,enableGrid:w,runValidationOnDependentFieldsChange:b,skipValueUpdateFromCrossFieldWhenReadOnly:v,...y})=>{const{value:B,handleChange:C,handleBlur:x,isSubmitting:F,fieldKey:N,name:S,excluded:E,readOnly:T}=Js({name:t,fieldKey:A,dependentFields:d,validate:r,validationRun:n,runPostValidationHookAlways:l,postValidationSetCrossFieldValues:a,isReadOnly:o,shouldExclude:s,runValidationOnDependentFieldsChange:b,skipValueUpdateFromCrossFieldWhenReadOnly:v}),[L,k]=c(!1),D=h((()=>{x(),k(!1)}),[x,k]),I=h((()=>{k(!0)}),[k]),U=h(((e,t)=>{C(t)}),[C]);if(E)return null;const P=i(p,{children:[e(Ut,{...g,focused:L,disabled:F,children:f}),u(Pt,{...y,key:N,id:N,name:S,value:""===B?0:B,onFocus:I,onChange:U,onBlur:D,disabled:F,readOnly:T,tabIndex:T?-1:void 0})]},N);return Boolean(w)?u(ie,{...m,key:N},P):P};var UA=Object.freeze({__proto__:null,Rating:IA,default:IA});const PA=xi((e=>({grouped:{marginRight:e.spacing(2),marginTop:e.spacing(1),borderColor:"#8C8C8C",transition:"border 0.3s ease-in",borderRadius:"8px",textTransform:"capitalize",color:"#727272",padding:"4px 10px",fontWeight:700,"&:not(:first-child)":{borderRadius:"8px",borderLeft:"1px solid #8C8C8C"},"&:first-child":{borderRadius:"8px"},"&.Mui-selected":{border:"1px solid #57D3C3",background:"linear-gradient(0deg, rgba(94,231,131,1) 0%, rgba(74,205,159,1) 10%, rgba(33,150,218,1) 100%)",color:"white"},"& label":{color:"#736f6f",fontWeight:"600",textTransform:"capitalize",fontSize:"1rem",marginBottom:"0.5 rem"},"& .MuiSvgIcon-root":{maxHeight:"20px"}}})))(er),OA=({name:t,validate:r,validationRun:n,shouldExclude:s,isReadOnly:a,postValidationSetCrossFieldValues:o,runValidationOnDependentFieldsChange:l,runPostValidationHookAlways:h,dependentFields:c,fieldKey:d,options:A,ToggleButtonProps:p,GridProps:f,enableGrid:g,label:m,isFieldFocused:w,skipValueUpdateFromCrossFieldWhenReadOnly:b,...v})=>{const{value:y,handleChange:B,handleBlur:C,isSubmitting:x,fieldKey:F,excluded:N}=Js({name:t,fieldKey:d,dependentFields:c,validate:r,validationRun:n,runPostValidationHookAlways:h,postValidationSetCrossFieldValues:o,runValidationOnDependentFieldsChange:l,isReadOnly:a,shouldExclude:s,skipValueUpdateFromCrossFieldWhenReadOnly:b});if(N)return null;const S=A.map((t=>u(Ot,{...p,key:t.value,value:t.value,disabled:x},"business"===t.iconName?e(Qt,{}):"person"===t.iconName?e(Rt,{}):null,e("span",{children:t.label})))),E=i($e,{disabled:x,children:[e(Je,{children:m}),e(PA,{...v,value:y,onChange:(e,t)=>{B(t)},onBlur:C,children:S})]});return Boolean(g)?u(ie,{...f,key:F},E):E};var RA=Object.freeze({__proto__:null,ToggleButtonGroup:OA,default:OA});const QA=({name:t,HiddenProps:i,GridProps:r,shouldExclude:n,fieldKey:s,dependentFields:a,componentType:o})=>{const{name:l,excluded:h}=Js({name:t,fieldKey:s,dependentFields:a,shouldExclude:n,componentType:o});return h?null:e(p,{children:e(Te,{...i,children:e(Se,{item:!0,...r})})},l)};var HA=Object.freeze({__proto__:null,Spacer:QA,default:QA});const MA=f((()=>Promise.resolve().then((function(){return Ou})).then((e=>({default:e.ListBoxComponent}))))),_A=e=>e?.label??"";var jA=Object.freeze({__proto__:null,AutoComplete:zu,AutocompleteRenderOnly:({label:t,showCheckbox:r,CircularProgressProps:n,TextFieldProps:s,ChipProps:a,CreateFilterOptionsConfig:h,placeholder:d,required:A,enableVirtualized:f,handleBlur:g,handleChange:w,freeSolo:b,multiple:v,options:y,error:B,touched:C,disableClearable:x,value:F,_optionsKey:N,disableCaching:S,optionsProps:E,...T})=>{const L=Boolean(C)&&Boolean(B),[k,D]=c([]),[I,U]=c((new Date).getTime()),P=o(!1),O=o(null),{loadingOptions:R}=uo(y,D,N,S,E,!0,"",!1);return l((()=>{let e=F;if(!P.current&&Boolean(e)&&k.length>0&&"00"!==k[0].value&&null!==k[0].value){Array.isArray(e)||(e=[F]);let t=[];for(let i=0;i<k.length&&e.length>0;i++){let r=e.findIndex((e=>e==k[i].value));if(r>-1){t.push(k[i]);const n=e.slice(0,r),s=e.slice(r+1);e=[...n,...s]}}P.current=!0,O.current=v?t:t[0],U((new Date).getTime())}}),[R,k,F,v]),e(m,{fallback:"loading...",children:u(Ai,{...T,key:`${I}`,multiple:v,disableClearable:x,freeSolo:b,options:k,getOptionLabel:_A,ListboxComponent:Boolean(f)?MA:void 0,onChange:(e,t)=>{Array.isArray(t)||(t=[t]),t=t.map((e=>{return"object"==typeof e?Boolean(b)?_A(e):(t=e,t?.value??""):e;var t})),!Boolean(v)&&Array.isArray(t)?w(t[0]):w(t)},onBlur:g,filterOptions:Boolean(h)&&"object"==typeof h?pi(h):void 0,renderTags:(e,t)=>e.map(((e,i)=>u(mi,"string"==typeof e?{variant:"outlined",...a,label:e,...t({index:i}),key:e}:{variant:"outlined",...a,label:e.label,...t({index:i}),key:`${e.label}-${i}`}))),renderInput:r=>e(to,{...s,...r,label:t,placeholder:d,autoComplete:"disabled",type:"text",error:L,required:A,helperText:L?B:null,InputProps:{...r.InputProps,endAdornment:i(p,{children:[R?e(re,{color:"primary",variant:"indeterminate",...n}):null,r.InputProps.endAdornment]})},InputLabelProps:{shrink:!0},inputProps:{...r.inputProps,autoComplete:"new-user-street-address"}}),renderOption:(t,n,s)=>{t.key=t.id;let{selected:a,inputValue:o}=s,l=_A(n);const h=wi(l,o),c=bi(l,h).map(((t,i)=>e("span",{style:{fontWeight:t.highlight?700:400},children:t.text},i)));return i("li",{style:{whiteSpace:"pre"},...t,children:[r?e(so,{checked:a}):null,c]})}})})},default:zu});function zA(t){const{inputRef:i,onChange:r,FormatProps:n,...s}=t;return e(Ht,{...s,getInputRef:i,onValueChange:e=>{r({target:{value:e.value,formattedValue:e.formattedValue}},e.formattedValue)},...n})}function VA(t){const{inputRef:i,onChange:r,FormatProps:n,...s}=t;return e(Ht,{...s,getInputRef:i,onValueChange:e=>{r({target:{value:e.value,formattedValue:e.formattedValue}},e.formattedValue)},...n})}const KA=({name:t,fieldKey:r,validate:n,leftName:s,rightName:a,leftLabel:h,rightLabel:c,leftTransform:d=e=>e,rightTransform:u=e=>e,GridProps:A,enableGrid:p,dependentFields:f,validationRun:g,runValidationOnDependentFieldsChange:m})=>{const{touched:w,value:b,error:v,setValue:y,handleBlur:B,isSubmitting:C,dependentValues:x}=Js({name:t,fieldKey:r,validate:n,validationRun:g,dependentFields:f,runValidationOnDependentFieldsChange:m}),F=b[s],N=b[a],S=o(F);S.current=F;const E=o(N);E.current=N,l((()=>{let e=ta(x),t=d(S.current,s,e),i=u(E.current,a,e);null===t&&null===i||y({[s]:t,[a]:i},{[s]:t,[a]:i},!0)}),[x]);const T=w&&""!==(v??"");let L=i("div",{style:{display:"flex"},tabIndex:0,onBlur:B,children:[e(to,{id:"left",name:s,value:F,label:h,onChange:e=>{let t=e.target.value,i=u(t,a,ta(x));y({[s]:t,[a]:i},{[s]:t,[a]:i},!0)},disabled:C,error:!C&&T,helperText:!C&&T?v:"",InputLabelProps:{shrink:!0},InputProps:{inputComponent:zA,inputProps:{FormatProps:{thousandSeparator:!0,prefix:"৳",thousandsGroupStyle:"lakh",allowNegative:!0,allowLeadingZeros:!1,decimalScale:2,isAllowed:e=>!(e?.value?.length>10)&&0!==e.floatValue}}}},"left"),e(to,{id:"right",name:a,label:c,value:N,onChange:e=>{let t=e.target.value,i=d(t,s,ta(x));y({[s]:i,[a]:t},{[s]:i,[a]:t},!0)},InputLabelProps:{shrink:!0},InputProps:{inputComponent:VA,inputProps:{FormatProps:{suffix:"%",decimalScale:2,fixedDecimalScale:!0,allowNegative:!0,allowEmptyFormatting:!0,isAllowed:e=>!(e.floatValue>=999.99)}}}},"right")]});return Boolean(p)?e(ie,{...A,children:L}):L};var qA=Object.freeze({__proto__:null,Visaversa:KA,default:KA});const GA=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR"}),WA=({rows:t,column:{id:i,footerRenderStyle:r}})=>{const n=a((()=>t.reduce(((e,t)=>Number(t.values?.[i]??0)+e),0)),[t,i]);let s=isNaN(n)?"":n;return"currency"===r&&(s=GA.format(n)),e("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s})},JA=({value:t})=>e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:t}),XA=n({}),YA=d((({currentRowError:t,currentRowObj:i,children:r,initialData:n,rowValidator:s,setFormError:o,prevRows:d,nextRows:u},p)=>{const f=a((()=>{let e={};for(const t in n)e[t]=!1;return e}),[]),[g,m]=c({}),[w,b]=c(!1),[v,y]=c(n),[B,C]=c(f),x=h((()=>{let e={};for(const t in f)e[t]=!0;C(e)}),[f]);A(p,(()=>({touchAll:x})));const F=h((e=>{y((t=>{let r={...t,...e};return i.current=r,r}))}),[]),N=h((e=>{C((t=>({...t,...e})))}),[]);return l((()=>{(async(e,i,r)=>{try{await s(e,i,r),m({}),b(!1),t.current={}}catch(e){m(e),b(!0),t.current=e}})(v,d,u)}),[v]),l((()=>{o(w?"has error":"")}),[w]),l((()=>()=>{o("")}),[]),e(XA.Provider,{value:{error:g,currentRow:v,setCellValue:F,touched:B,setCellTouched:N},children:r})})),$A=t=>{const{column:{id:i,type:r,clearFields:n,maxLength:s=NaN},row:{id:a},currentEditRow:o}=t;return o===a?e(ZA,{columnName:i,type:r??"text",clearFields:n,maxLength:s},i):e(JA,{...t})},ZA=({columnName:t,type:i,clearFields:r,maxLength:n})=>{const{error:a,setCellValue:o,currentRow:l,touched:h,setCellTouched:c}=s(XA);return e(_t,{type:i,value:l?.[t],size:"small",variant:"outlined",onChange:e=>{(n!=n||e.target.value.length<=n)&&o({[t]:e.target.value,...r})},helperText:h?.[t]&&a?.[t],error:Boolean(h?.[t])&&Boolean(a?.[t]),onBlur:()=>c({[t]:!0}),fullWidth:!0})};let ep=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR"});const tp=({value:t,displayStyle:i})=>{let r="-";if(!isNaN(t))switch(i){case"currency":r=ep.format(t);break;case"percentage":r=`${t}%`;break;case"squareFeet":r=(new Intl.NumberFormat).format(t);break;default:r=t}return e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:r})},ip=t=>{const{column:{id:i,FormatProps:r,formattedValue:n,displayStyle:s,clearFields:a,enableNumWords:o},row:{id:l},currentEditRow:h}=t;return h===l?e(rp,{columnName:i,FormatProps:r,formattedValue:n,clearFields:a,enableNumWords:o},i):e(tp,{...t,displayStyle:s})},rp=({columnName:t,FormatProps:i,formattedValue:r,clearFields:n,enableNumWords:a})=>{const{error:o,setCellValue:l,currentRow:h,touched:c,setCellTouched:d}=s(XA);let u=null;try{if(a&&Boolean(h?.[t])){let e=String(h?.[t]).split("."),i=Number(e[0]);i<0?(i=Math.abs(Number(i)),u=`Negative ${yo(i)} Rupees`):u=`${yo(i)} Rupees`,2===e.length&&Boolean(e[1])&&(u=`${u} and ${yo(e[1])} paise`)}}catch(e){}return e(io,{value:h?.[t],onChange:e=>l({[t]:e.target.value,...n}),helperText:Boolean(o?.[t])?o?.[t]:u,error:Boolean(c?.[t])&&Boolean(o?.[t]),onBlur:()=>d({[t]:!0}),InputLabelProps:{shrink:!0},size:"small",fullWidth:!0,margin:"none",InputProps:{inputComponent:dl,inputProps:{FormatProps:{...i,formattedValue:r}}}})},np=t=>{const{column:{id:i,options:r,_optionsKey:n,multiple:s,showCheckbox:a,clearFields:o},row:{id:l},currentEditRow:h}=t,[d,u]=c([]),{loadingOptions:A}=Ao(r,u,n,!1,{},!1,void 0);return h===l?e(sp,{columnName:i,options:d,loadingOptions:A,multiple:s,showCheckbox:a,clearFields:o},i):e(ap,{...t,options:d})},sp=({columnName:t,options:i,loadingOptions:r,multiple:n,showCheckbox:a,clearFields:o})=>{const{error:l,setCellValue:h,currentRow:c,setCellTouched:d,touched:u}=s(XA);let A=c?.[t];return e(Fo,{value:A,error:l?.[t],touched:u?.[t],size:"small",variant:"outlined",handleChange:e=>{h({[t]:e.target.value,...o})},handleBlur:()=>d({[t]:!0}),options:i,loadingOptions:r,multiple:n,showCheckbox:a,fullWidth:!0})},ap=({value:t,options:i})=>e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:po(i,!0)(t)});let op=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR"});function lp(t){const{inputRef:i,onChange:r,FormatProps:n,setChange:s,side:a,...o}=t;return e(Ht,{...o,getInputRef:i,onChange:e=>{s(a)},onValueChange:e=>{r({target:{value:e.value,formattedValue:e.formattedValue}},e.formattedValue)},...n})}const hp=({value:t})=>e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:op.format(t)}),cp=t=>{const{column:{id:i,ViceVersaProps:r,clearFields:n},row:{id:s},currentEditRow:a}=t;return a===s?e(up,{columnName:i,clearFields:n,...r}):e(hp,{...t,displayStyle:r.leftAdornment})},dp=(e,t)=>e,up=({columnName:t,rightTransform:r=dp,leftTransform:n=dp,dependentField:a,leftFormatProps:o,rightFormatProps:h})=>{const{error:d,setCellValue:u,currentRow:A,touched:p,setCellTouched:f}=s(XA),[g,m]=c(""),[w,b]=c("");l((()=>{let e=r(A?.[t],A?.[a]);m(e),f({[t]:!0})}),[]);let v=A?.[t];l((()=>{""===v&&m("")}),[v]);return i("div",{style:{display:"flex"},children:[e(_t,{value:A?.[t],onChange:e=>{let i=e?.target?.value??e;u({[t]:i})},onBlur:()=>{if("left"!==w)return;let e=r(A?.[t],A?.[a]);m(e)},helperText:p?.[t]&&d?.[t],error:Boolean(p?.[t])&&Boolean(d?.[t]),size:"small",variant:"outlined",InputProps:{inputComponent:lp,inputProps:{FormatProps:o,setChange:b,side:"left"}},fullWidth:!0},"left"),e("div",{style:{padding:"0px 4px"}}),e(_t,{value:g,onChange:e=>{m(e?.target?.value??e)},onBlur:()=>{if("right"!==w)return;let e=n(g,A?.[a]);u({[t]:e})},size:"small",variant:"outlined",InputProps:{inputComponent:lp,inputProps:{FormatProps:h,setChange:b,side:"right"}},fullWidth:!0},"right")]})},Ap=({value:t})=>e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:t}),pp=t=>{const{column:{id:i,MaskProps:r,formattedValue:n=!0,clearFields:s},row:{id:a},currentEditRow:o}=t;return o===a?e(fp,{columnName:i,MaskProps:r,formattedValue:n,clearFields:s},i):e(Ap,{...t})},fp=({columnName:t,MaskProps:i,formattedValue:r,clearFields:n})=>{const{error:a,setCellValue:o,currentRow:l,touched:h,setCellTouched:c}=s(XA);return e(io,{value:l?.[t],onChange:e=>o({[t]:e.target.value,...n}),helperText:h?.[t]?a?.[t]:"",error:Boolean(h?.[t])&&Boolean(a?.[t]),onBlur:()=>c({[t]:!0}),InputLabelProps:{shrink:!0},size:"small",fullWidth:!0,margin:"none",InputProps:{inputComponent:pl,inputProps:{MaskProps:{...i,formattedValue:r}}}})},gp={accessor:"action",alignment:"left",width:150,Cell:({requestRowEdit:t,currentEditRow:r,saveCurrentRow:n,cancelCurrentRowEdit:s,row:{id:a}})=>e("div",{style:{display:"flex",alignItems:"start"},children:r===a?i(p,{children:[e(ct,{onClick:()=>n(a),size:"small",variant:"outlined",disableRipple:!0,children:"Done"}),e(ct,{onClick:()=>s(a),size:"small",variant:"outlined",disableRipple:!0,children:"Cancel"})]}):e(ct,{onClick:()=>t(a),size:"small",variant:"outlined",disableRipple:!0,children:"Edit"})}),columnName:"Action"},mp=e=>(e=(e=>{if(Array.isArray(e)){let t=e;return t=t.map((e=>{if("string"==typeof e.options){let t=e.options,i=ss.getFn(t,(async()=>[{label:"Cannot fetch options",value:""}]));return{...e,_optionsKey:t,options:i}}return e})),t}return e})(e),e=(e=>{if(Array.isArray(e)){let t=e;return t=t.map((e=>{if("string"!=typeof e.Cell)return e;switch(e.Cell){case"textField":return{...e,Cell:$A};case"numberField":return{...e,Cell:ip};case"selectField":return{...e,Cell:np};case"visaversa":return{...e,Cell:cp};case"monthYear":return{...e,Cell:pp};default:return{...e,Cell:JA}}})),t}return e})(e=(e=>{if(Array.isArray(e)){let t=e;return t=t.map((e=>{if(Boolean(e.footer)){const{footer:t,...i}=e;return{...i,Footer:WA}}return e})),t}return e})(e=(e=>{if(Array.isArray(e))return[...e,gp];return e})(e)))),wp=({column:{columnName:r,getResizerProps:n}})=>i(t,{children:[e("span",{style:{whiteSpace:"nowrap"},children:r}),e("div",{...n([{style:{display:"inline-block",position:"absolute",right:"-5px",top:"0",padding:"0 5px",zIndex:1}}]),children:e("div",{style:{height:"35px",width:"6px",backgroundColor:"#888"}})})]}),bp=({row:t})=>e(ui,{size:"small",...t.getToggleRowSelectedProps([{style:{padding:0}}])}),vp=({getToggleAllRowsSelectedProps:t})=>e(ui,{size:"small",...t([{style:{padding:0}}])}),yp=async()=>{},Bp={},Cp=async()=>{throw{error_msg:"Fn not defined"}},xp=({columns:t,defaultColumn:r,data:n,setData:s,rowIDColumn:a,label:l,setFormError:d,disabled:u,maxHeight:A="200px",newRowObj:f=Bp,dataIdColumn:g="id",rowValidator:m=yp,deleteRowFn:w=Cp,disableFooter:b=!1})=>{const v=o(null),y=o(-1),B=o({}),C=o({}),[x,F]=c(-1),[N,S]=c(!1),[E,T]=c(!1),L=o(null),k=h((e=>e[a]),[]),{t:D}=ne(),I=h((()=>{T(!1)}),[T]),U=h((()=>{N||(s((e=>[...e,{...f,[a]:++y.current}])),S(!0),F(y.current),B.current={},setTimeout((()=>{let e=L.current;e?.scrollTo({behavior:"smooth",top:e.scrollHeight-e.offsetHeight,left:0})}),1))}),[s,S,F,N,n]),P=h((e=>{if(Object.keys(C.current).length>0)return v?.current?.touchAll?.(),!1;let t=n.map((t=>k(t)===e?{...t,...B.current}:t));return s(t),F(-1),S(!1),B.current={},!0}),[s,S,F,n,k]),O=h((e=>{N&&s((t=>t.filter((t=>!(k(t)===e))))),F(-1),S(!1),B.current={},C.current={}}),[s,F,S,N]),R=h((e=>{N||Object.keys(C.current).length>0||(-1===x||O(x),F(e),B.current={})}),[P,F,x,N]),Q=Gt({columns:t,data:n,defaultColumn:r,requestRowEdit:R,currentEditRow:x,getRowId:k,saveCurrentRow:P,cancelCurrentRowEdit:O},ei,ti,ii,(H=!0,t=>{Boolean(H)&&t.visibleColumns.push((t=>[{id:"selectionCheckbox",Header:vp,Cell:bp,minWidth:25,width:25,maxWidth:25,sticky:!0,Footer:()=>e("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingRight:"10px"},children:"Total"})},...t]))}));var H;const{getTableProps:M,getTableBodyProps:_,headerGroups:j,footerGroups:z,rows:V,prepareRow:K,selectedFlatRows:q}=Q;return i(p,{children:[i(ni,{style:{width:"90%",overflow:"hidden"},tabIndex:0,children:[i(si,{variant:"dense",style:{display:"flex",minHeight:"40px",paddingLeft:"16px",paddingRight:"16px"},children:[e(vt,{variant:"h6",children:l}),e("div",{style:{flexGrow:1}}),q.length>0?e(ct,{variant:"outlined",size:"small",onClick:()=>{T(!0)},children:D("Delete")}):null]}),e(ai,{style:u?{opacity:.5}:{},children:i(oi,{...M(),size:"small",component:"div",children:[e(li,{component:"div",children:j.map((t=>e(hi,{...t.getHeaderGroupProps(),component:"div",children:t.headers.map((t=>e(ci,{...t.getHeaderProps([{style:{overflow:"hidden",textOverflow:"ellipsis",textAlign:t?.alignment??"unset",pointerEvents:u?"none":"unset"}}]),component:"div",children:t.render("Header")})))})))}),e(di,{..._({}),component:"div",children:e("div",{style:{overflowY:"scroll",maxHeight:A,overflowX:"hidden"},ref:L,children:V.map(((t,i)=>{K(t);const r=t.getRowProps([{style:{pointerEvents:u?"none":"unset"}}]),n=e(hi,{...r,component:"div",children:t.cells.map((t=>e(ci,{...t.getCellProps([{style:{textOverflow:"ellipsis",overflow:"hidden",textAlign:t?.column?.alignment??"unset"}}]),component:"div",children:t.render("Cell")})))});if(x===t.id){let s=V.slice(0,i).map((e=>e?.original)),a=V.slice(i+1).map((e=>e?.original));return e(YA,{currentRowError:C,currentRowObj:B,initialData:t.original,rowValidator:m,prevRows:s,nextRows:a,setFormError:d,ref:v,children:n},`${r.key}_row_with_context`)}return n}))})}),b?null:e(li,{component:"div",children:z.map((t=>e(hi,{...t.getFooterGroupProps(),component:"div",children:t.headers.map((t=>e(ci,{...t.getFooterProps([{style:{textAlign:t?.alignment??"unset"}}]),component:"div",children:t.render("Footer")})))})))})]})}),e(ct,{onClick:U,disabled:u,children:D("AddRow")})]}),e(Fp,{selectedRows:q,dataIdColumn:g,open:E,closeDialog:I,deleteFn:w,setData:s})]})},Fp=({selectedRows:t,dataIdColumn:r,deleteFn:n,open:s,closeDialog:a,setData:o})=>{const{t:l}=ne(),h=()=>{c.reset(),a()},c=Vt((d=n,async({data:e})=>d(e)),{onSuccess:()=>{h()}});var d;return i(dt,{open:s,children:[c.isError?e(Va,{severity:"error",errorMsg:c.error?.error_msg??"Unknown error occured",errorDetail:c.error?.error_detail??""}):null,e(ut,{children:l("Wouldyouliketodeletetheselectedrecord")}),i(At,{children:[e(ct,{onClick:()=>{let e=t.map((e=>e?.original?.[r]??Number.MAX_SAFE_INTEGER)).filter((e=>e!==Number.MAX_SAFE_INTEGER));c.mutate({data:e}),o((t=>t.filter((t=>!(e.indexOf(t[r])>=0)))))},disabled:c.isLoading,children:l("Yes")}),e(ct,{onClick:h,disabled:c.isLoading,children:l("No")})]})]})},Np=e=>e,Sp="__id",Ep=({_columns:t,arrayFieldIDName:i,dataTransformer:r=Np,rowValidator:n,removeRowFn:s,name:d,fieldKey:u,GridProps:A,enableGrid:p,label:f,maxHeight:g,shouldExclude:m,dependentFields:w,disableFooter:b})=>{const v=a((()=>{let e=Mt(t);return mp(e)}),[]),y=a((()=>({Header:wp,Cell:JA})),[]),B=a((()=>{let e=(e=>{if(Array.isArray(e))return e.reduce(((e,t)=>(e[t.accessor]=t?.defaultValue??"",e)),{});return{}})(t);return e={[i]:"",...e},e}),[]),C=o(-1e3),[x,F]=c(!1),{value:N,setValueAsCB:S,setErrorAsCB:E,isSubmitting:T,fieldKey:L,excluded:k}=Js({name:d,fieldKey:u,shouldExclude:m,dependentFields:w}),D=h((e=>{S("function"==typeof e?t=>r(e(t)):r(e))}),[S,r]);if(l((()=>{if(!x&&Array.isArray(N)&&N.length>0){let e=N.map((e=>void 0===e[Sp]?{...e,[Sp]:C.current++}:e));D(e),F(!0)}})),k)return null;const I=e(xp,{columns:v,defaultColumn:y,dataIdColumn:i,newRowObj:B,rowValidator:n,setData:D,data:Array.isArray(N)?N:[],rowIDColumn:Sp,deleteRowFn:s,label:f,maxHeight:g,setFormError:E,disabled:T,disableFooter:b},L);return Boolean(p)?e(ie,{...A,children:I}):I};var Tp=Object.freeze({__proto__:null,DataTable:Ep,default:Ep});const Lp=({name:t,fieldKey:i,TypographyProps:r,GridProps:n,label:s,dependentFields:a,shouldExclude:o,setValueOnDependentFieldsChange:h,componentType:c})=>{const{value:d,handleChange:u,name:A,excluded:f,dependentValues:g,incomingMessage:m,formState:w}=Js({name:t,fieldKey:i,dependentFields:a,shouldExclude:o,componentType:c});return l((()=>{if("function"==typeof h){let e=h(ta(g),w);null!=e&&u(e)}}),[g,u,h]),l((()=>{if(null!==m&&"object"==typeof m){const{value:e}=m;(Boolean(e)||""===e)&&u(e)}}),[m,u]),f?null:e(p,{children:e(Se,{...n,children:e(fe,{variant:"h6",style:void 0,...r,children:d||s})})},A)},kp=Ci((e=>({root:{paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5),background:"var(--theme-color1)"},title:{flex:"1 1 100%",color:"var(--white)",letterSpacing:"1px",fontSize:"1.5rem"},refreshiconhover:{}})));let Dp=[];const Ip=d((({dense:t,title:r,allowColumnHiding:n,fields:s,initialDataValue:h,initialVisibleColumnData:d,submitButtonHide:u,submitButtonName:f,submitSecondButtonHide:g=!0,submitSecondButtonName:m="submit",submitSecondLoading:w=!1,submitSecondAction:b=(e,t)=>{},submitSecondValidtion:v=!0,hideHeader:y,isDisplayOnly:B,onAction:C,loading:x,onFieldAction:F=(e,t)=>{},propStyles:N,focusScopeId:S,enableEnterToFocus:E},T)=>{const L=kp(),k=o(null),[D,I]=c({}),[U,P]=c(h),[O,R]=c(s),{t:Q}=ne(),[H,M]=c(d),_=a((()=>{let e={};return s.forEach((t=>{Boolean(t.dependFields)&&Array.isArray(t.dependFields)&&t.dependFields.forEach((i=>{Boolean(e[i])?e[i].push(t.name):e[i]=[t.name]}))})),e}),[s]),j=a((()=>{let e={};return s.forEach((t=>{Boolean(t.dependFields)&&Array.isArray(t.dependFields)&&"function"==typeof t.dependFieldsonchange&&(e[t.name]=t.dependFieldsonchange)})),e}),[s]),z=(e,t="",i=!1)=>{const r=e.target.name,n=i?e.target.value.toUpperCase():e.target.value;P((e=>({...e,[r]:n}))),Boolean(n)&&D[r]?.isError&&I((e=>({...e,[r]:{isError:!1,ErrorMessage:" "}}))),Boolean(_[r])&&_[r].forEach((e=>{if("function"==typeof j[e]){let i=j[e](U,n,r,t);Boolean(i)&&R((t=>t.map((t=>{let r=t;return t.name===e&&"object"==typeof i&&(r={...r,...i},i.hasOwnProperty("isVisible")&&M((e=>({...e,[t.name]:Boolean(i?.isVisible)}))),i.hasOwnProperty("__DATA")&&P((e=>({...e,[t.name]:i.__DATA})))),r}))))}}))};l((()=>{P(h),Object.keys(h).forEach((e=>{let t={target:{name:e,value:h[e]}};z(t)}))}),[JSON.stringify(h)]);Dp=a((()=>O.map((e=>{let t=()=>{M((t=>({...t,[e.name]:!H[e.name]})))};return{id:e.name,isTableHidden:e?.isTableHidden??!1,columnName:e?.label??"",isColumnHidingDisabled:e?.isColumnHidingDisabled??!1,getToggleHiddenProps:()=>({checked:H[e.name]??!0,onChange:t,style:{cursor:"pointer"}})}}))),[O,H]);const V=async(e,t,i,r)=>{let n=!0,s={};for(const a of e)if(i[a.name]??1)if(a?.isRequired&&!Boolean(t[a.name]))s={...s,[a.name]:{isError:!0,ErrorMessage:Q("ThisFieldisrequired")}},n=!1;else{let e="";"function"==typeof a?.validate&&(e=await a.validate(t[a.name],t,r)),n=!Boolean(e)&&n,s={...s,[a.name]:{isError:Boolean(e),ErrorMessage:Boolean(e)?e:" "}}}else s={...s,[a.name]:{isError:!1,ErrorMessage:" "}};return I(s),n};A(T,(()=>({columnVal:U,onAction:C})));const{dynamicAmountSymbol:K}=Ws(),q=S&&E?{"data-scope-id":S}:{};return e(p,{children:i(ni,{style:{width:"100%"},sx:N.paperStyle,onKeyDown:e=>{E&&ma(e,S)},...q,children:[y?null:i(si,{className:L.root,variant:t?"dense":"regular",sx:N.toolbarStyles,children:[e(vt,{className:L.title,color:"inherit",variant:"h6",component:"div",sx:N.titleStyle,children:r}),n?e(Ol,{visibleColumns:Dp,defaultHiddenColumns:[],classes:L,IconButtonStyle:N.IconButtonStyle}):null]}),e("div",{style:{flexGrow:"1",margin:"15px"},children:i(ie,{container:!0,spacing:2,justifyContent:"flex-start",alignItems:"center",direction:"row",children:[e(ie,{item:!0,xs:u?12:10,container:!0,spacing:1,justifyContent:"flex-start",alignItems:"center",children:O.map((t=>H[t.name]??1?e(ie,{item:!0,xs:t?.gridconfig?.xs??6,sm:t?.gridconfig?.sm??3,children:"select"===(t?.type??"text").toLowerCase()?e(Bo,{name:t.name,options:t?.optiondata??[],_optionsKey:t?._optionsKey??"",handleChange:(e,i)=>{z(e,i),!Boolean(t?.externalFunctionCall)||"onChange"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value,i)},label:Q(t?.label??""),fullWidth:!0,value:U[t.name],selectVariant:"regular",enableDefaultOption:Boolean(t?.enableDefaultOption),defaultOptionLabel:t?.defaultOptionLabel??"Select Value",disabled:!!t?.isDisabled||(!!B||(x||w)),skipDefaultOption:t?.skipDefaultOption??!0,error:Boolean(D[t.name]?.isError)?D[t.name]?.ErrorMessage??"Error":"",touched:t?.touched??!0,defaultSpaceAdd:t?.defaultSpaceAdd??!0,required:t?.isRequired??!1,handleBlur:(e,i)=>{O.forEach((e=>{"function"==typeof e?.onBlurHandler&&e.onBlurHandler(U[e.name],U)})),!Boolean(t?.externalFunctionCall)||"onBlur"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value,i)}}):"spacer"===(t?.type??"text").toLowerCase()?e(QA,{...t},`${t.name}`):"typography"===(t?.type??"text").toLowerCase()?e(Lp,{fieldKey:t.name,name:t.name,label:Q(t?.label??""),TypographyProps:{color:"secondary"}}):"datetimepicker"===(t?.type??"text").toLowerCase()||"datepicker"===(t?.type??"text").toLowerCase()?e(tr,{dateAdapter:Qi,children:e(Lo,{format:t?.dateFormat?t?.dateFormat:"datepicker"===(t?.type??"text").toLowerCase()?"dd/MM/yyyy":"dd/MM/yyyy HH:mm:ss",value:""===U[t.name]||null===U[t.name]?null:new Date(U[t.name]),label:Q(t?.label??""),views:"datetimepicker"===(t?.type??"text").toLowerCase()?["year","month","day","hours","minutes","seconds"]:["year","month","day"],onChange:e=>{let i={target:{name:t.name,value:e}};z(i),!Boolean(t?.externalFunctionCall)||"onChange"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(i.target.name,i.target.value)},disabled:!!t?.isDisabled||(!!B||(x||w)),slots:{textField:to},slotProps:{textField:{name:t.name,error:Boolean(D[t.name]?.isError),InputLabelProps:{shrink:!0},onKeyDown:e=>{"Enter"===e.key&&t?.entertoSubmit&&k?.current?.click?.()}},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%",mb:3}})}):"amountfield"===(t?.type??"text").toLowerCase()||"numberfield"===(t?.type??"text").toLowerCase()?e(to,{sx:{mb:3},label:Q(t?.label??""),value:U[t.name],onChange:e=>{z(e),!Boolean(t?.externalFunctionCall)||"onChange"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value)},onBlur:e=>{!Boolean(t?.externalFunctionCall)||"onBlur"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value)},InputProps:{inputComponent:Up,inputProps:{FormatProps:{...t?.FormatProps,type:t?.type??"",name:t?.name??""}},startAdornment:"amountfield"===t?.type?e(ge,{position:"start",style:{padding:"0 0.6rem 0 0"},children:t?.StartAdornment?sl(t?.StartAdornment):sl(K)??"₹"}):null},InputLabelProps:{shrink:!0},onKeyDown:e=>{"Enter"===e.key&&t?.entertoSubmit&&k?.current?.click?.()},disabled:!!t?.isDisabled||(!!B||(x||w))}):"pancard"===(t?.type??"text").toLowerCase()?e(to,{label:Q(t?.label??""),value:U[t.name],placeholder:t.placeholder??"",fullWidth:!0,onChange:e=>{z(e),!Boolean(t?.externalFunctionCall)||"onChange"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value)},onBlur:e=>{!Boolean(t?.externalFunctionCall)||"onBlur"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value)},InputProps:{inputComponent:pl,inputProps:{MaskProps:{mask:"aaaaa0000a",prepare:function(e){return e.toUpperCase()},lazy:!0,...t?.MaskProps},name:t.name??""}},InputLabelProps:{shrink:!0},error:Boolean(D[t.name]?.isError),helperText:i("div",{style:{display:"flex"},children:[e(Ze,{children:Boolean(D[t.name]?.isError)?D[t.name]?.ErrorMessage??"Error":" "}),(t?.maxLength??0)>0&&Boolean(t?.showMaxLength??!1)?i(Ze,{error:!1,style:{flex:1,textAlign:"right",margin:"5px 15px 0 0"},children:[U[t.name].length,"/",t?.maxLength]}):null]}),onKeyDown:e=>{"Enter"===e.key&&t?.entertoSubmit&&k?.current?.click?.()},disabled:!!t?.isDisabled||(!!B||(x||w))}):"autocomplete"===(t?.type??"text").toLowerCase()?e(Pp,{name:t?.name??"",placeholder:Q(t?.placeholder??""),label:Q(t?.label??""),options:t?.optiondata,_optionsKey:t?._optionsKey,handleChange:(e,i)=>{z(e,i),!Boolean(t?.externalFunctionCall)||"onChange"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value,i)},columnValue:U,dependentField:_,disabled:!!t?.isDisabled||(!!B||(x||w))}):e(to,{autoFocus:t?.defaultfocus??!1,label:Q(t?.label??""),fullWidth:!0,placeholder:String(Q(t?.placeholder??"")),type:"text",name:t.name,value:U[t.name],InputProps:{style:{background:Boolean(t?.isDisabled)?"#f3f3f3":""}},onChange:e=>{if(-1===(t?.maxLength??-1)||e.target.value.length<=t?.maxLength){const i=/^[0-9\b]+$/,r=/^[a-zA-Z0-9\b]+$/;(""===e.target.value||("number"===(t?.type??"text")?i.test(e.target.value):"alphanumeric"!==(t?.type??"text")||r.test(e.target.value)))&&(z(e,"",Boolean(t?.toUpperCase)),!Boolean(t?.externalFunctionCall)||"onChange"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value))}},onBlur:e=>{!Boolean(t?.externalFunctionCall)||"onBlur"!==t?.externalFunctionCall&&"all"!==t?.externalFunctionCall||F(e.target.name,e.target.value)},InputLabelProps:{shrink:!0},required:t?.isRequired??!1,autoComplete:t?.autoComplete??"off",disabled:!!t?.isDisabled||(!!B||(x||w)),error:Boolean(D[t.name]?.isError),helperText:i("div",{style:{display:"flex"},children:[e(Ze,{children:Boolean(D[t.name]?.isError)?D[t.name]?.ErrorMessage??"Error":" "}),(t?.maxLength??0)>0&&Boolean(t?.showMaxLength??!1)?i(Ze,{error:!1,style:{flex:1,textAlign:"right",margin:"5px 15px 0 0"},children:[U[t.name].length,"/",t?.maxLength]}):null]}),onKeyDown:e=>{"Enter"===e.key&&t?.entertoSubmit&&k?.current?.click?.()}})},`gird${t.name}`):null))}),i(ie,{item:!0,xs:2,container:!0,justifyContent:"center",alignItems:"center",spacing:2,style:{maxWidth:"16%"},children:[e(ie,{item:!0,children:e(za,{sx:{display:u?"none":"auto"},disabled:x||w,endIcon:x?e(re,{size:20}):null,onClick:async()=>{await V(O,U,H,"FIRST")&&C(U,H)},ref:k,children:Q(f)})},`gird${f}`),g?null:e(ie,{item:!0,children:e(za,{disabled:x||w,endIcon:w?e(re,{size:20}):null,onClick:async()=>{v&&!await V(O,U,H,"SECOND")||b(U,H)},children:Q(m)})},`gird${m}`)]})]})})]})})})),Up=t=>{const{inputRef:i,onChange:r,FormatProps:n,...s}=t,{type:a,name:o,...l}=n,{decimalCount:h,dynamicAmountGroupStyle:c}=Ws();return e(Ht,{...s,getInputRef:i,onValueChange:e=>{r({target:{value:e.value,name:o}})},valueIsNumericString:!1,..."amountfield"===a?{thousandSeparator:!0,isNumericString:!0,decimalScale:n?.decimalScale?n?.decimalScale:h??2,fixedDecimalScale:!0,thousandsGroupStyle:n?.thousandsGroupStyle?n?.thousandsGroupStyle:c??"lakh"}:{},...l})},Pp=({name:t,label:r,placeholder:n,options:s,_optionsKey:a,handleChange:o,freeSolo:l=!1,disabled:c,columnValue:d,dependentField:u})=>{const A=h((e=>t=>Boolean(e)?t:t?.label??"")(l),[]),{t:f}=ne(),{authState:g}=Vs(),{data:m,status:w,isLoading:b,isFetching:v,error:y}=zt([a],(()=>s(d?.[t]??void 0,d,u,g)));return e(Le,{sx:{mb:3},options:m??[],onChange:(e,i)=>{o({target:{value:i?.value,name:t}},i?.label)},disabled:c,getOptionLabel:A,renderInput:s=>e(to,{...s,label:f(r??""),placeholder:String(f(n??"")),name:t,autoComplete:"disable",InputProps:{...s.InputProps,endAdornment:i(p,{children:[b||v?e(re,{size:25,color:"secondary",variant:"indeterminate"}):null,s.InputProps.endAdornment]})},InputLabelProps:{shrink:!0}}),renderOption:(t,i,r)=>{t.key=t.id;let{selected:n,inputValue:s}=r,a=A(i);const o=wi(a,s),l=bi(a,o).map(((t,i)=>e("span",{style:{fontWeight:t.highlight?700:400},children:t.text},i)));return e("li",{style:{whiteSpace:"pre"},...t,children:l})}})},Op=d((({finalMetaData:t,onAction:i,loading:r,data:n,submitSecondButtonHide:s=!0,submitSecondButtonName:a="submit",submitSecondLoading:o=!1,submitSecondAction:l=(e,t)=>{},submitSecondValidtion:h=!0,onFieldAction:c=(e,t,i)=>{},propStyles:d={titleStyle:{},toolbarStyles:{},IconButtonStyle:{},paperStyle:{}},enableEnterToFocus:u,focusScopeId:A="enter-to-focus-formComponentView"},p)=>{const{enableEnterToFocus:f}=Ws(),g=t.gridConfig?.isDisplayOnly??!1,{t:m}=ne();let w=Rp({metaData:t,isDisplayOnly:g,data:n});return e(Ip,{dense:w.gridConfig?.dense??!0,title:m(w.gridConfig?.title??"No Title"),fields:w.fields,allowColumnHiding:w.gridConfig?.allowColumnHiding??!1,initialDataValue:w.initialData,initialVisibleColumnData:w.initialVisibleColumnData,submitButtonHide:w.gridConfig?.submitButtonHide??!1,submitButtonName:w.gridConfig?.submitButtonName??"SUBMIT",hideHeader:w.gridConfig?.HideHeader??!1,isDisplayOnly:g,onAction:i,loading:r,submitSecondButtonHide:s,submitSecondButtonName:a,submitSecondLoading:o,submitSecondAction:l,submitSecondValidtion:h,onFieldAction:c,propStyles:d,enableEnterToFocus:u??f,focusScopeId:A,ref:p})})),Rp=({metaData:e,isDisplayOnly:t,data:i})=>{let r=O(e),n=r.fields.reduce(((e,r)=>e={...e,[r.name]:t||Boolean(i[r?.accessor])?i[r?.accessor]??"":r?.defaultValue??""}),{}),s=r.fields.reduce(((e,t)=>e={...e,[t.name]:t?.isVisible??!0}),{});return{gridConfig:r.gridConfig,fields:r.fields,initialData:n,initialVisibleColumnData:s}},Qp=R.object().shape({name:R.string().required(),label:R.string().required(),render:R.object().shape({ordering:R.string().required(),renderType:R.string().required(),groups:R.object().required()}),submitAction:R.string().required()}),Hp=R.array().of(R.object().shape({name:R.string().required(),label:R.string().required(),render:R.object().shape({componentType:R.string().required(),group:R.number().required()}),sequence:R.number(),GridProps:R.object().shape({xs:R.number().required(),md:R.number().required(),sm:R.number().required()})}));R.object().shape({form:Qp,fields:Hp});const Mp=d((({metaData:t,children:r=()=>{},actions:n=[],initialData:s={},isError:h=!1,errorObj:d={},handelActionEvent:u=()=>{},formStyle:f={background:"white",height:"calc(100vh - 650px)",overflowY:"auto",overflowX:"hidden"},isNewRow:g=null,isLoading:m=!1,onSubmitData:w=()=>{},displayMode:b=null,containerstyle:v={padding:"10px"},formName:y="",formNameMaster:B="",onFormButtonClickHandel:C=e=>{},onClickActionEvent:x=()=>{},hideHeader:F=!1,onFormDataChange:N=()=>{},isDetailHide:S=!1,formState:E={},setDataOnFieldChange:T,isDetailRowRequire:L=!0,subHeaderLabel:k,subHeaderLabelStyle:D,hideDisplayModeInTitle:I=!1,headerToolbarStyle:U={},refetchData:P,formHeaderStyle:O={},enableEnterToFocus:R,focusScopeId:Q="enter-to-focus-master-details-form"},H)=>{const{enableEnterToFocus:M}=Ws(),_=a((()=>{const{DETAILS_DATA:e=[],...t}=s;return e}),[s]),[j,z]=c(_),{t:V}=ne(),K=o(null),q=o(null),G=o(!1),[W,J]=c(""),X=a((()=>Na(t.masterForm,b)),[t,b,B]),Y=a((()=>Sa(t.detailsGrid,b)),[t,b,y]),$=a((()=>t?.detailsGrid?.gridConfig?.rowIdColumn||"id"),[t]),Z=a((()=>{const{DETAILS_DATA:e,...t}=s;return t}),[s]),ee=a((()=>Y.columns.reduce(((e,t)=>("deleteRowCell"===t?.componentType||(e[t?.accessor]=t?.defaultValue??""),e)),{})),[Y]),te=a((()=>{let e=Y.columns;return"view"===b&&(e=Y.columns.filter((e=>"_hidden"!==e.accessor))),{...Y,columns:e}}),[b,Y]);l((()=>{G.current=S,S&&Boolean(W)&&J("")}),[S,J]);const ie=()=>{q?.current?.handleFormReset({preventDefault:()=>{}}),z([])},re=()=>{q?.current?.handleFormClear({preventDefault:()=>{}}),z([])};return A(H,(()=>({addNewRow:(e=!1,t=ee)=>(async(e=!1,t=ee)=>{if(!m){if(Boolean(W)&&J(""),e){let{hasError:e,data:t}=await(K.current?.validate(!0));if(!0===e)return void(t&&z(t))}z((e=>{if(Array.isArray(e)){let i=ia(e,$);const r={...t,_isNewRow:!0,[$]:i};return[...e,r]}return[{...t,_isNewRow:!0,[$]:1}]}))}})(e,t),GetGirdData:()=>K?.current?.cleanData?.(),onSubmitHandler:(e,t="action",i=!0)=>{q.current?.handleSubmit(e,t,i)},setGridData:z,getFieldData:q?.current?.getFieldData,handleFormReset:ie,clearMasterDetailForm:re,handleFormClear:q?.current?.handleFormClear}))),e(p,{children:i("div",{style:{paddingBottom:"10px"},children:[h?e("div",{style:{padding:"10px 10px 0 10px"},children:e(sr,{position:"relative",color:"primary",children:e(Va,{severity:"error",errorMsg:d?.error_msg??"Unknow Error",errorDetail:d?.error_detail??"",color:"error"})})}):Boolean(W)?e("div",{style:{padding:"10px 10px 0 10px"},children:e(sr,{position:"relative",color:"primary",children:e(Va,{errorMsg:W,errorDetail:"",severity:"error"})})}):null,e(Ac,{metaData:X,initialValues:Z,formStyle:f,onSubmitHandler:async(e,t,i,r,n,s,a,o)=>{if(G.current){Boolean(W)&&J("");let l=ha(e,Z),h={_isNewRow:Boolean(g),...e,DETAILS_DATA:{isNewRow:[],isUpdatedRow:[],isDeleteRow:[]},...l};w({data:h,resultValueObj:e,resultDisplayValueObj:t,endSubmit:i,setFieldErrors:r,actionFlag:n,hasError:s,optionalData:a,errorFields:o})}else{let{hasError:s,data:l}=await(K.current?.validate(!0));if(Boolean(W)&&J(""),!0===s)i(!0),l&&z(l);else{let l=K?.current?.cleanData?.();if(Array.isArray(l)||(l=[l]),0===l.length&&L)i(!0),J(String(V("Atleastonerowmustbeindetail")));else{let h=l.filter((e=>Boolean(e?._hidden)));if("edit"===b&&h.length===l.length&&L)return i(!0),void J(String(V("Atleastonerowmustbeindetail")));let c=l.filter((e=>!(Boolean(e?._hidden)&&Boolean(e?._isNewRow))));if(0===c.length&&L)i(!0),J(String(V("Atleastonerowmustbeindetail")));else{c=Oa(c);let l=ha(e,Z),h={_isNewRow:Boolean(g),...e,DETAILS_DATA:c,...l};w({data:h,resultValueObj:e,resultDisplayValueObj:t,endSubmit:i,setFieldErrors:r,actionFlag:n,hasError:s,optionalData:a,errorFields:o})}}}}},displayMode:b,hideDisplayModeInTitle:I,containerstyle:v,onFormButtonClickHandel:C,onFormDataChange:N,hideHeader:F,formState:E,ref:q,setDataOnFieldChange:T,subHeaderLabel:k,subHeaderLabelStyle:D,formHeaderStyle:O,focusScopeId:Q,enableEnterToFocus:R??M,children:r},(Boolean(B),B)),e("div",{style:{paddingRight:"10px",paddingLeft:"10px",display:S?"none":"inherit"},children:e(Xd,{finalMetaData:te,data:j,setData:z,loading:m,actions:n,setAction:u,refetchData:P,ref:K,onClickActionEvent:x,fieldDataRef:q,headerToolbarStyle:U,focusScopeId:Q,enableEnterToFocus:R??M},(Boolean(y),y))})]})})})),_p=n({}),jp=({children:t,insertFormData:i,checkFormDataExist:r,deleteFormData:n,updateFormData:s,getFormData:a,getGridFormData:o,getFormMetaData:l,getGridFormMetaData:h,context:c})=>e(_p.Provider,{value:{context:c,insertFormData:i,checkFormDataExist:r,deleteFormData:n,updateFormData:s,getFormData:a,getGridFormData:o,getFormMetaData:l,getGridFormMetaData:h},children:t}),zp=({isDataChangedRef:r,successAction:n,cancelAction:a,formStyle:h})=>{const{insertFormData:c,getFormMetaData:d,context:u}=s(_p),{enqueueSnackbar:A}=ji(),{addEntry:p}=s(oo),f=o(null);null===f.current&&(f.current=ho(Object.values(c.args)));const g=Vt((e=>async({data:t})=>e(t))(c.fn(c.args)),{onError:(e,{endSubmit:t})=>{let i="Unknown Error occured";"object"==typeof e&&(i=e?.error_msg??i),t(!1,i,e?.error_detail??"")},onSuccess:(e,{endSubmit:t})=>{t(!0,""),r.current=!0,A("Data is successfully saved with",{variant:"success"}),"function"==typeof n&&n()}});l((()=>{p(["getFormMetaData",f.current,"new"])}),[p]);const m=zt(["getFormMetaData",f.current,"new"],(()=>d.fn(d.args)("new"))),w=m.dataUpdatedAt,b=m.isLoading||m.isFetching;let v=m.isError,y=`${m.error?.error_msg??"unknown error occured"}`,B={};m.isSuccess&&(B=O(m.data),B.form.formState={...u,formCode:B?.form?.name},B.form.name=`${B.form.name}-New`,"stepper"===B?.form?.render?.renderType&&(B.form.render.renderType="tabs")),!1===b&&!1===v&&(!1===v||(y="Error loading form"));return b?i(t,{children:[e(sd,{}),"function"==typeof a?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:a,children:e(ar,{})})}):null]}):!0===v?i(t,{children:[e("span",{children:y}),"function"==typeof a?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:a,children:e(ar,{})})}):null]}):e(Ac,{metaData:B,initialValues:{},onSubmitHandler:(e,t,i,r)=>{g.mutate({data:e,displayData:t,endSubmit:i,setFieldError:r})},displayMode:"new",formStyle:h,children:({isSubmitting:r,handleSubmit:n})=>i(t,{children:[e(ct,{onClick:n,disabled:r,endIcon:r?e(re,{size:20}):null,children:"Save"}),"function"==typeof a?e(ct,{onClick:a,disabled:r,children:"Cancel"}):null]})},`${f.current}-${w}-new`)},Vp=({isDataChangedRef:r,closeDialog:n,defaultView:a="view",serialNo:d="1",setEditFormStateFromInitValues:u,readOnly:A=!1,disableCache:p=!1,formStyle:f})=>{const{updateFormData:g,getFormData:m,getFormMetaData:w,context:b}=s(_p),{addEntry:v}=s(oo),[y,B]=c(a),{enqueueSnackbar:x}=ji(),F=h((()=>B("view")),[B]),N=h((()=>B("edit")),[B]),S=o(null);null===S.current&&(S.current=ho(Object.values(m.args)));const E=Vt((e=>async({data:t,serialNo:i})=>e(t,i))(g.fn(g.args)),{onError:(e,{endSubmit:t})=>{let i="Unknown Error occured";"object"==typeof e&&(i=e?.error_msg??i),t(!1,i,e?.error_detail??"")},onSuccess:(e,{serialNo:t})=>{ao.refetchQueries(["getFormData",S.current,t]),x("Data changes successfully saved",{variant:"success"}),r.current=!0,F(),"function"==typeof n&&n()}}),T=(e,t,i,r)=>{E.mutate({data:e,displayData:t,endSubmit:i,setFieldError:r,serialNo:d})};l((()=>{v(["getFormData",S.current,d]),v(["getFormMetaData",S.current,"view"]),v(["getFormMetaData",S.current,"edit"])}),[v,d]);const L=Kt([p?{queryKey:["getFormData",S.current,d],queryFn:()=>m.fn(m.args)(d),cacheTime:0}:{queryKey:["getFormData",S.current,d],queryFn:()=>m.fn(m.args)(d)},{queryKey:["getFormMetaData",S.current,"view"],queryFn:()=>w.fn(w.args)("view")},{queryKey:["getFormMetaData",S.current,"edit"],queryFn:()=>w.fn(w.args)("edit")}]),k=`${L[0].dataUpdatedAt}`,D=L[0].isLoading||L[1].isLoading||L[2].isLoading||L[0].isFetching||L[1].isFetching||L[2].isFetching;let I=L[0].isError||L[1].isError||L[2].isError,U=`${L[0].error?.error_msg} ${L[1].error?.error_msg} ${L[2].error?.error_msg}`;U=Boolean(U.trim())?U:"Unknown error occured";let P=L[0].data,R={},Q={};if(L[1].isSuccess&&L[2].isSuccess&&L[0].isSuccess){const e="function"==typeof u?u(L[0].data):void 0;Q=O(L[1].data),R=O(L[2].data),R.form.formState={...b,serialNo:d,formCode:R.form.name,...e},R.form.name=`${R.form.name}-edit`,"stepper"===R?.form?.render?.renderType&&(R.form.render.renderType="tabs"),Q.form.formState={...b,serialNo:d,formCode:Q.form.name,...e},Q.form.name=`${Q.form.name}-view`,"stepper"===Q?.form?.render?.renderType&&(Q.form.render.renderType="tabs")}return D?i(t,{children:[e(sd,{}),"function"==typeof n?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:n,children:e(ar,{})})}):null]}):!0===I?i(t,{children:[e("span",{children:U}),"function"==typeof n?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:n,children:e(ar,{})})}):null]}):"view"===y?i(Ac,{metaData:Q,initialValues:P,onSubmitHandler:T,displayMode:y,formStyle:f,children:[A?null:e(ct,{onClick:N,children:"Edit"}),"function"==typeof n?e(ct,{onClick:n,children:"Cancel"}):null]},`${S.current}-${k}-${y}`):"edit"===y?e(Ac,{metaData:R,initialValues:P,onSubmitHandler:T,displayMode:y,formStyle:f,children:({isSubmitting:r,handleSubmit:n})=>i(t,{children:[e(ct,{onClick:n,disabled:r,endIcon:r?e(re,{size:20}):null,children:"Save"}),e(ct,{onClick:F,disabled:r,children:"Cancel"})]})},`${S.current}-${k}-${y}`):null},Kp=({isDataChangedRef:t,closeDialog:r,serialNo:n})=>{const{deleteFormData:a}=s(_p),l=o(null),{t:h}=ne();null===l.current&&(l.current=ho(Object.values(a.args)));const c=Vt((e=>async({serialNo:t})=>e(t))(a.fn(a.args)),{onError:e=>{},onSuccess:e=>{t.current=!0,r()}});return i(p,{children:[e(ut,{id:"alert-dialog-title",children:h("AreyousureyouwanttodeletetheselectedRecords")}),c.isLoading?e(pt,{children:"Deleting..."}):c?.isError?e(pt,{children:e(Va,{severity:"error",errorMsg:c.error?.error_msg??"Unknown Error occured",errorDetail:c.error?.error_detail??""})}):c.isSuccess?e(pt,{children:h("AllRecordssuccessfullydeleted")}):null,c.isSuccess?e(At,{children:e(ct,{onClick:r,color:"primary",children:h("Close")})}):i(At,{children:[e(ct,{onClick:r,color:"primary",disabled:c.isLoading,children:h("Disagree")}),e(ct,{onClick:()=>c.mutate({serialNo:n}),color:"primary",disabled:c.isLoading,children:h("Agree")})]})]},l.current)},qp=d((({actions:t,setAction:i},r)=>{const{addEntry:n}=s(oo),{getGridFormData:a,getGridFormMetaData:h,context:c}=s(_p),d=o(null);null===d.current&&(d.current=ho(Object.values(a.args)));const u=Kt([{queryKey:["getGridFormMetaData",d.current],queryFn:()=>h.fn(h.args)()},{queryKey:["getStaticGridData",d.current],queryFn:()=>a.fn(a.args)()}]);l((()=>{n(["getGridFormMetaData",d.current]),n(["getStaticGridData",d.current])}),[n]),A(r,(()=>({refetch:()=>u[1].refetch()})));const p=u[0].isLoading||u[0].isFetching;let f=u[0].isError||u[1].isError,g=`${u[0].error?.error_msg} ${u[1].error?.error_msg}`.trimStart().trimEnd();g=Boolean(g)?g:"unknown error occured";return p?e(sd,{}):!0===f?e("span",{children:g}):e(Xd,{finalMetaData:u[0].data,data:u[1].data??[],setData:()=>null,actions:t,setAction:i,loading:u[1].isLoading||u[1].isFetching,gridProps:c},`staticGridData-${d.current}`)}));qp.displayName="MyGridWrapper";const Gp=[{label:"KYC",sequence:0,docType:[{label:"Add Documents",type:"kyc",primary:!0,categoryCD:"KYC_DOC_TYPE_CO"}]},{label:"Bank",sequence:1,docType:[{label:"Add Documents",type:"bank",primary:!0,categoryCD:"BANK_DOC_TYPE"}]},{label:"Financial",sequence:2,docType:[{label:"ITR",type:"itr",primary:!0,categoryCD:"ITR_DOC_TYPE"},{label:"Others",type:"itrOther",primary:!1,categoryCD:"ITR_DOC_TYPE_O"}]},{label:"GST",sequence:3,docType:[{label:"Analysis",type:"gst",primary:!0,categoryCD:"GST_DOC_TYPE"},{label:"Others",type:"gstOther",primary:!0,categoryCD:"GST_DOC_TYPE_O"}]},{label:"Others",sequence:4,docType:[{label:"Add Documents",type:"other",primary:!0,categoryCD:"OTHER_DOC_TYPE"}]}],Wp=[{label:"KYC",sequence:0,docType:[{label:"Add Documents",type:"kyc",primary:!0,categoryCD:"KYC_DOC_TYPE"}]},{label:"Bank",sequence:1,docType:[{label:"Add Documents",type:"bank",primary:!0,categoryCD:"BANK_DOC_TYPE"}]},{label:"Financial",sequence:2,docType:[{label:"ITR",type:"itr",primary:!0,categoryCD:"ITR_DOC_TYPE"},{label:"Others",type:"itrOther",primary:!1,categoryCD:"ITR_DOC_TYPE_O"}]},{label:"Others",sequence:3,docType:[{label:"Add Documents",type:"other",primary:!0,categoryCD:"OTHER_DOC_TYPE"}]}],Jp={gridConfig:{dense:!0,gridLabel:"Update Statement",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Bank",componentType:"editableSelect",accessor:"bankID",sequence:4,alignment:"left",options:"getBankListForLeadDocuments",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]},disableCachingOptions:!0},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getBankDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},Xp={gridConfig:{dense:!0,gridLabel:"Bank Statement",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Bank Name",componentType:"default",accessor:"bank",sequence:4,alignment:"left"},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},Yp=[{columnName:"Bank",componentType:"editableSelect",accessor:"bankLineID",sequence:4,alignment:"left",options:"getBankListForLeadDocuments",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]},disableCachingOptions:!0},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getBankDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],$p={gridConfig:{dense:!0,gridLabel:"GST Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getGSTDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},Zp={gridConfig:{dense:!0,gridLabel:"GST",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},ef=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getGSTDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],tf=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getGSTDocTypeOther",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],rf={gridConfig:{dense:!0,gridLabel:"GST Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getGSTDocTypeOther",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},nf={gridConfig:{dense:!0,gridLabel:"ITR Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Financial Year",componentType:"editableNumberFormat",accessor:"finYear",sequence:5,alignment:"left",FormatProps:{format:"####",placeholder:"YYYY",mask:["Y","Y","Y","Y"]},schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getITRDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},sf={gridConfig:{dense:!0,gridLabel:"ITR",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Financial Year",componentType:"default",accessor:"finYear",sequence:4,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},af=[{columnName:"Financial Year",componentType:"editableNumberFormat",accessor:"finYear",sequence:4,alignment:"left",FormatProps:{format:"####",placeholder:"YYYY",mask:["Y","Y","Y","Y"]},schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getITRDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],of={gridConfig:{dense:!0,gridLabel:"ITR Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getITRDocTypeOther",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},lf=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getITRDocTypeOther",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],hf={gridConfig:{dense:!0,gridLabel:"KYC Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getKYCDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},cf={gridConfig:{dense:!0,gridLabel:"KYC",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},df=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getKYCDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],uf={gridConfig:{dense:!0,gridLabel:"KYC Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getKYCDocTypeLegal",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},Af=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getKYCDocTypeLegal",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],pf={gridConfig:{dense:!0,gridLabel:"Others Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getOtherDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},ff={gridConfig:{dense:!0,gridLabel:"Others",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},gf=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getOtherDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],mf=({moduleType:e,productType:t,docCategory:i,categoryCD:r,refID:n,serialNo:s})=>async(e,t=()=>{},i=()=>{})=>{},wf=({moduleType:e,productType:t,refID:i,serialNo:r})=>async e=>{},bf=({moduleType:e,productType:t,refID:i,serialNo:r})=>async(e,t)=>{},vf=({moduleType:e,productType:t,refID:i,serialNo:r})=>async(e,t)=>{},yf=({moduleType:e,productType:t,refID:i,serialNo:r})=>async(e,t,i,r)=>{},Bf=({moduleType:e,productType:t})=>(e,t)=>(Array.isArray(t)||(t=[t]),t.join(","),new URL("").href),Cf=({moduleType:e,productType:t})=>async(e,t)=>{Array.isArray(t)||(t=[t]);const i=new URL("").href;try{let e=await fetch(i,{method:"POST",body:JSON.stringify({request_data:{docUUID:t}}),headers:new Headers({"Content-Type":"application/json"})});if("200"===String(e.status)){return await e.blob()}return new Error("Error getting file")}catch(e){return e}},xf=({moduleType:e,productType:t,metaDataType:i})=>async e=>{if("grid"===i)switch(e){case"bank":return Xp;case"itr":return sf;case"gst":return Zp;case"other":return ff;case"kyc":return cf;default:throw{error_msg:"Invalid docCategory"}}else if("upload"===i)switch(e){case"bank":return Yp;case"itr":return af;case"itrOther":return lf;case"gst":return ef;case"gstOther":return tf;case"other":return gf;case"kyc":return"management"===t?df:Af;default:throw{error_msg:"Invalid docCategory"}}else{if("edit"!==i)throw{error_msg:"Invalid MetaData Type requested"};switch(e){case"bank":return Jp;case"itr":return nf;case"itrOther":return of;case"gst":return $p;case"gstOther":return rf;case"other":return pf;case"kyc":return"management"===t?hf:uf;default:throw{error_msg:"Invalid docCategory"}}}},Ff=n({}),Nf=({children:t,uploadDocuments:i,deleteDocuments:r,updateDocument:n,verifyDocuments:s,getDocumentsGridData:a,getDocumentListingGridMetaData:o,getDocumentUploadAddtionalFieldsMetaData:l,getDocumentEditGridMetaData:h,generateDocumentDownloadURL:c,previewDocument:d,context:u})=>e(Ff.Provider,{value:{uploadDocuments:i,deleteDocuments:r,updateDocument:n,verifyDocuments:s,getDocumentsGridData:a,getDocumentListingGridMetaData:o,getDocumentUploadAddtionalFieldsMetaData:l,getDocumentEditGridMetaData:h,generateDocumentDownloadURL:c,previewDocument:d,context:u},children:t}),Sf=(e,t,i,r,n)=>({context:{moduleType:e,productType:t,docCategory:i,refID:r,serialNo:n},uploadDocuments:{fn:mf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},getDocumentsGridData:{fn:wf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},deleteDocuments:{fn:bf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},updateDocument:{fn:vf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},verifyDocuments:{fn:yf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},getDocumentListingGridMetaData:{fn:xf,args:{moduleType:e,productType:t,metaDataType:"grid"}},getDocumentUploadAddtionalFieldsMetaData:{fn:xf,args:{moduleType:e,productType:t,metaDataType:"upload"}},getDocumentEditGridMetaData:{fn:xf,args:{moduleType:e,productType:t,metaDataType:"edit"}},generateDocumentDownloadURL:{fn:Bf,args:{moduleType:e,productType:t}},previewDocument:{fn:Cf,args:{moduleType:e,productType:t}}}),Ef=d((({actions:t,setAction:r,transformData:n=e=>e,defaultSortOrder:a,defaultGroupBy:h},c)=>{const{addEntry:d}=s(oo),{getDocumentsGridData:u,getDocumentListingGridMetaData:f,context:g}=s(Ff),m=g.docCategory.filter((e=>!0===e.primary))[0].type,w=o(null);null===w.current&&(w.current=ho(Object.values(u.args))),l((()=>{d(["getDocumentListingGridMetaData",g.refID,m]),d(["getDocumentsGridData",w.current,m])}),[d,g,m]),A(c,(()=>({refetch:()=>b[0].refetch()})));const b=Kt([{queryKey:["getDocumentsGridData",w.current,m],queryFn:()=>u.fn(u.args)(m)},{queryKey:["getDocumentListingGridMetaData",g.refID,m],queryFn:()=>f.fn(f.args)(m)}]);return b[1].isLoading||b[1].isFetching?e(sd,{}):b[1].isError?e("span",{children:b[1]?.error?.error_msg??"Unknown Error occured"}):i(p,{children:[b[0].isError?e(ft,{severity:"error",children:b[0]?.error?.error_msg??"Unknown Error occured"}):null,e(Xd,{data:n(b[0].data??[]),finalMetaData:b[1].data,setData:()=>null,actions:t,setAction:r,loading:b[0].isFetching||b[0].isLoading,refetchData:()=>b[0].refetch(),defaultSortOrder:a,defaultGroupBy:h},"listingDocuments")]})}));Ef.displayName="MyGridWrapper";const Tf=({dataChangedRef:t,closeDialog:r,docUUID:n})=>{const{deleteDocuments:a,context:o}=s(Ff),l=o.docCategory.filter((e=>!0===e.primary))[0].type,{enqueueSnackbar:h}=ji(),c=Vt((e=>async({docType:t,docUUID:i})=>e(t,i))(a.fn(a.args)),{onError:e=>{},onSuccess:e=>{t.current=!0,h("Documents successful deleted",{variant:"success"}),r()}});return i(p,{children:[c.isError?e(ft,{severity:"error",children:c?.error?.error_msg??"Unknown Error occured"}):null,c.isLoading?e(gt,{variant:"indeterminate"}):null,e(ut,{id:"alert-dialog-title",children:"Are you sure you want to delete the selected Records"}),i(At,{children:[e(ct,{onClick:r,color:"primary",disabled:c.isLoading,children:"No"}),e(ct,{color:"primary",onClick:()=>c.mutate({docType:l,docUUID:n}),disabled:c.isLoading,children:"Yes"})]})]})},Lf=({dataChangedRef:t,closeDialog:r,docUUID:n})=>{const{verifyDocuments:a,context:o}=s(Ff),l=o.docCategory.filter((e=>!0===e.primary))[0].type,[h,d]=c(""),[u,A]=c(""),{enqueueSnackbar:f}=ji(),g=Vt((e=>async({docType:t,docUUID:i,remarks:r})=>e(t,i,r,"Verify"))(a.fn(a.args)),{onError:e=>{},onSuccess:e=>{t.current=!0,f("Documents Successfully verified",{variant:"success"}),r()}}),m=Vt((e=>async({docType:t,docUUID:i,remarks:r})=>e(t,i,r,"Rejected"))(a.fn(a.args)),{onError:e=>{},onSuccess:e=>{t.current=!0,f("Documents Successfully Rejected",{variant:"success"}),r()}}),w=m.isError||g.isError,b=m.isLoading||g.isLoading;let v=`${m?.error?.error_msg??""} ${g?.error?.error_msg??""}`;return v=Boolean(v.trimEnd().trimStart())?v:"unknown error occured",i(p,{children:[b?e(gt,{variant:"indeterminate"}):null,w?e(ft,{severity:"error",children:v}):null,e(ut,{id:"alert-dialog-title",children:"Document Verification"}),e(pt,{children:e(_t,{onChange:e=>d(e.target.value),multiline:!0,rows:4,maxRows:4,error:Boolean(u),helperText:u,fullWidth:!0,label:"Remarks",InputLabelProps:{shrink:!0}})}),i(At,{children:[e(ct,{onClick:r,color:"primary",children:"Cancel"}),e(ct,{color:"primary",onClick:()=>{Boolean(h)?g.mutate({docType:l,docUUID:n,remarks:h}):A("This is a required field")},disabled:b,children:"Verify"}),e(ct,{color:"primary",onClick:()=>{Boolean(h)?m.mutate({docType:l,docUUID:n,remarks:h}):A("This is a required filed")},disabled:b,children:"Reject"})]})]})},kf=({row:{data:r,id:n},closeDialog:a,dataChangedRef:h})=>{const[d,u]=c(Array.isArray(r)?r:[r]),{updateDocument:A,getDocumentEditGridMetaData:p,context:f}=s(Ff),g=f.docCategory.filter((e=>e.categoryCD===r.docCategory))[0].type,m=f.docCategory.filter((e=>!0===e.primary))[0].type,{addEntry:w}=s(oo),{enqueueSnackbar:b}=ji(),v=o(null);l((()=>{w(["getDocumentEditGridMetaData",f.moduleType,f.productType??"legal",g])}),[w,f,g]);const y=zt(["getDocumentEditGridMetaData",f.moduleType,f.productType??"legal",g],(()=>p.fn(p.args)(g))),B=Vt((e=>async({docType:t,data:i})=>e(t,i))(A.fn(A.args)),{onError:e=>{},onSuccess:e=>{h.current=!0,b("Document changes successful",{variant:"success"}),a()}});let C=`${y.error?.error_msg??"unknown message"}`;const x=y.isLoading?e(sd,{}):!0===y.isError?e("span",{children:C}):i(t,{children:[B.isError?e(ft,{severity:"error",children:B?.error?.error_msg??"Unknown Error occured"}):null,B.isLoading?e(gt,{variant:"indeterminate"}):null,e(ut,{id:"alert-dialog-title",children:"Update Documents"}),e(pt,{children:e(Xd,{data:d??[],finalMetaData:y.data,setData:u,gridProps:f,ref:v,loading:B.isLoading},"listingDocumentsForUpdate")}),i(At,{children:[e(ct,{onClick:a,color:"primary",disabled:B.isLoading,children:"Cancel"}),e(ct,{color:"primary",onClick:async()=>{let{hasError:e,data:t}=await(v?.current?.validate?.());if(!0===e)u(t);else{let e=v?.current?.cleanData?.();await B.mutate({docType:m,data:e})}},disabled:B.isLoading,children:"Update"})]})]});return x},Df=({onClose:t,editableFileName:i,dataChangedRef:r,currentAction:n})=>{const{uploadDocuments:a,getDocumentUploadAddtionalFieldsMetaData:o,context:h}=s(Ff),c=h.docCategory.filter((e=>e.type===n))[0],d=c.type,u=c.categoryCD,A=h.docCategory.filter((e=>!0===e.primary))[0].type,{addEntry:p}=s(oo),{enqueueSnackbar:f}=ji();l((()=>{p(["getDocumentUploadAddtionalFieldsMetaData",h.moduleType,h.productType,d])}),[h,p,d]);const g=zt(["getDocumentUploadAddtionalFieldsMetaData",h.moduleType,h.productType,d],(()=>o.fn(o.args)(d)));let m=`${g.error?.error_msg??"unknown error occured"}`;return g.isLoading?e(sd,{}):!0===g.isError?e("span",{children:m}):e(Eu,{onClose:()=>{!0===r.current&&f("Documents Successfully uploaded",{variant:"success"}),t()},additionalColumns:g.data,editableFileName:i,dataChangedRef:r,onUpload:a.fn({...a.args,docCategory:A,categoryCD:u}),gridProps:{...h,docCategory:d},maxAllowedSize:12328960,allowedExtensions:"partner"===h.productType||["kyc","other"].indexOf(d)>=0?["pdf","jpg","jpeg","png"]:["pdf"]})},If=(e,t)=>{const i=document.createElement("a");i.href=String(e),i.download=t;const r=()=>{setTimeout((()=>{URL.revokeObjectURL(String(e)),i.removeEventListener("click",r)}),150)};i.target="_blank",i.addEventListener("click",r,!1),i.click()},Uf=({docData:t,closeDialog:r,maxDownloadLimit:n=3})=>{const{generateDocumentDownloadURL:a,context:o}=s(Ff),h=o.docCategory.filter((e=>!0===e.primary))[0].type,[d,u]=c("");return l((()=>{if(t.length>Number(n))u(`Cannot download more than ${n} files at a time`);else{if(1===t.length){const e=a.fn(a.args)(h,t.map((e=>e.id)));If(e,t[0].name)}else if(t.length>1){const e=a.fn(a.args)(h,t.map((e=>e.id)));If(e,`download-${(new Date).getUTCMilliseconds()}`)}r()}}),[n,t,h,r,a]),Boolean(d)?i(p,{children:[e(ut,{children:d}),e(At,{children:e(ct,{onClick:()=>{u(""),r()},children:"Ok"})})]}):null},Pf=({fileType:t,fileName:i,docUUID:r,closeDialog:n})=>t.indexOf("pdf")>=0||t.indexOf("image")>=0?e(Of,{fileName:i,onClose:n,docUUID:r,fileType:t}):e(Rf,{onClose:n,fileName:i}),Of=({fileName:t,onClose:r,docUUID:n,fileType:s})=>{const{loading:a,blob:h,error:c,success:d}=Qf({docUUID:n,fileType:s}),u=o("");return d&&(u.current=URL.createObjectURL(h)),l((()=>{let e=u.current??"";return()=>{URL.revokeObjectURL(e)}}),[]),i(p,{children:[i(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:t}),e("div",{style:{flexGrow:1}}),d?e(C,{color:"primary",onClick:()=>du(h,t),children:e(yt,{})}):null,"function"==typeof r?e(C,{color:"primary",onClick:r,children:e(Bt,{})}):null]}),e(pt,{children:a?e(sd,{}):Boolean(c)?e("span",{children:c}):e("iframe",{src:`${u.current}`,title:"Document View",style:{height:"100%",width:"100%"},"aria-label":"File Preview"})})]})},Rf=({onClose:t,fileName:r,message:n})=>i(p,{children:[i(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:r}),e("div",{style:{flexGrow:1}}),"function"==typeof t?e(C,{color:"primary",onClick:t,children:e(Bt,{})}):null]}),e(pt,{children:n})]}),Qf=({docUUID:e,fileType:t})=>{const[i,r]=c(!0),[n,a]=c(!1),[o,h]=c(""),{previewDocument:d,context:u}=s(Ff),A=u.docCategory.filter((e=>!0===e.primary))[0].type,[p,f]=c(null);return l((()=>{d.fn(d.args)(A,e).then((e=>{if(e instanceof Error)h(e.message),r(!1),a(!1);else if("application/json"===e.type)e.text((e=>{h(e),r(!1),a(!1)}));else{const i=new Blob([e],{type:t});f(i),a(!0),h(""),r(!1)}})).catch((e=>{h(e.message),r(!0),a(!1)}))}),[h,r,a,f,e,t,d,A]),{success:n,loading:i,error:o,blob:p}},Hf=({closeDialog:e})=>(l((()=>{e()}),[e]),null),Mf=[{actionName:"Verify",actionLabel:"Verify",multiple:!0,shouldExclude:e=>{let t=!1;for(let i=0;i<e.length;i++)if("Pending"!==e[i].data?.status){t=!0;break}return t}},{actionName:"View",actionLabel:"View",multiple:!1,rowDoubleClick:!0},{actionName:"Download",actionLabel:"Download",multiple:!0},{actionName:"Delete",actionLabel:"Delete",multiple:!0},{actionName:"Update",actionLabel:"Update",multiple:!1}],_f=({disableActions:t})=>{const{context:r}=s(Ff),n=o(null);if(null===n.current){let e,i=r.docCategory.map((e=>({actionName:`Add_${e.type}`,actionLabel:e.label,multiple:void 0,alwaysAvailable:!0})));n.current=[...i,...Mf],e="string"==typeof t?[t]:Array.isArray(t)?t:[],Array.isArray(e)&&(n.current=n.current.filter((t=>!(e.indexOf("Add")>=0&&t.actionName?.indexOf("Add")>=0)&&!(e?.indexOf(t.actionName)>=0))))}const[a,d]=c(null),u=o(null),A=o(!1),f=h((()=>{d(null),!0===A.current&&(u.current?.refetch?.(),A.current=!1)}),[d]);l((()=>()=>{ao.removeQueries(["getBankListForLeadDocuments"],{exact:!1})}),[]);let g=a?.name??"";return i(p,{children:[e(Ef,{ref:u,actions:n.current,setAction:d},"documentListing"),e(dt,{open:Boolean(a),maxWidth:"xl",PaperProps:{style:g.indexOf("Add")>=0||"View"===g?{width:"100%",height:"100%"}:"Verify"===g?{width:"40%"}:{}},children:g.indexOf("Add")>=0?e(Df,{onClose:f,editableFileName:!1,dataChangedRef:A,currentAction:g.slice(g.indexOf("Add_")+4)}):"Update"===g?e(kf,{row:a?.rows[0],closeDialog:f,dataChangedRef:A}):"Delete"===g?e(Tf,{docUUID:a?.rows.map((e=>e.id)),closeDialog:f,dataChangedRef:A}):"Verify"===g?e(Lf,{docUUID:a?.rows.map((e=>e.id)),closeDialog:f,dataChangedRef:A}):"Download"===g?e(Uf,{closeDialog:f,docData:a?.rows.map((e=>({id:e.id,name:e.data?.fileName})))}):"View"===g?e(Pf,{closeDialog:f,docUUID:a?.rows[0]?.id,fileName:a?.rows[0]?.data?.fileName,fileType:a?.rows[0]?.data?.fileType}):e(Hf,{closeDialog:f})})]})},jf=Ci((e=>({tabPanel:{borderTop:"0",padding:`${e.spacing(2)},0`,backgroundColor:"#fff"}}))),zf=({value:e,index:t,children:i})=>Number(e)===Number(t)?i:null,Vf=({moduleType:t,productType:r,refID:n,serialNo:a,onClose:o,skipBankDetails:h=!1,readOnly:d})=>{const{addEntry:u}=s(oo),[A,f]=c(0),g=jf();l((()=>{u(["getDocumentCRUDTabsMetadata",t,r??"legal",n])}),[u,t,n]);const m=zt(["getDocumentCRUDTabsMetadata",t,r??"legal",n],(()=>(async({moduleType:e,productType:t,refID:i})=>Boolean(t)?Wp:Gp)({moduleType:t,productType:r,refID:n})));let w=m.data;m.isSuccess&&(Array.isArray(w)?(h&&(w=w.filter((e=>"Bank"!==e.label))),w=w.sort(((e,t)=>e.sequence>t.sequence?1:e.sequence<t.sequence?-1:0)),h&&(w=w.map(((e,t)=>({...e,sequence:t}))))):w=[]);return m.isLoading?e(sd,{}):m.isError?m.error?.error_msg??"unknown error occured":i(p,{children:[i("div",{style:{display:"flex"},children:[e(or,{value:A,onChange:(e,t)=>{f(t)},variant:"scrollable",children:w.map((t=>e(lr,{label:t.label,id:`${t.sequence}`},t.sequence)))}),"function"==typeof o?i(p,{children:[e("div",{style:{flexGrow:1}}),e(ct,{variant:"text",onClick:o,children:"Close"})]}):null]}),e("div",{className:g.tabPanel,children:w.map((i=>e(zf,{value:A,index:`${i.sequence}`,children:e(Nf,{...Sf(t,r,i.docType,n,a),children:e(_f,{disableActions:d?["Add","Verify","Delete","Update"]:[]})},i.docType.filter((e=>!0===e?.primary))[0].type)},i.sequence)))})]})},Kf=({isDataChangedRef:r,successAction:n,readOnly:a,closeDialog:c,formStyle:d})=>{const{addEntry:u}=s(oo),{checkFormDataExist:A}=s(_p),{insertFormData:p}=s(_p),f=o(null);null===f.current&&(f.current=ho(Object.values(p.args)));let g=zt(["checkFormDataExist",f.current],(()=>A.fn(A.args)()));l((()=>{u(["checkFormDataExist",f.current])}),[u]);const m=g.isFetching||g.isLoading,w=g.isError,b="YES"===g.data?.exists||(g.data,!1),v=h((()=>{"function"==typeof n&&(n(),g.refetch())}),[]);return l((()=>{b&&"function"==typeof n&&v()}),[b,v]),m?i(t,{children:[e(sd,{}),"function"==typeof c?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:c,children:e(ar,{})})}):null]}):w?i(t,{children:[i("div",{children:[g?.error?.error_msg??"Unknown error occured"," "]}),"function"==typeof c?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:c,children:e(ar,{})})}):null]}):b?null:e(qf,{successAction:v,isDataChangedRef:r,readOnly:a,closeDialog:c,formStyle:d})},qf=({successAction:t,isDataChangedRef:i,readOnly:r,closeDialog:n,formStyle:s})=>{const a=h((()=>{"function"==typeof n&&n()}),[]);return r?e(ft,{severity:"info",children:"No Details Found"}):e(zp,{isDataChangedRef:i,cancelAction:a,successAction:t,formStyle:s})},Gf=({isDataChangedRef:t,closeDialog:i,dataAlwaysExists:r,readOnly:n,disableCache:s,formStyle:a})=>{const[o,l]=c(Boolean(r));return o?e(Vp,{isDataChangedRef:t,closeDialog:i,readOnly:n,disableCache:s,formStyle:a}):e(Kf,{isDataChangedRef:t,successAction:()=>l(!0),readOnly:n,closeDialog:i,formStyle:a})},Wf=Ci({topScrollPaper:{alignItems:"flex-start"},topPaperScrollBody:{verticalAlign:"top"}}),Jf=[{actionName:"View",actionLabel:"View Details",multiple:!1,rowDoubleClick:!0},{actionName:"Delete",actionLabel:"Delete",multiple:!0,rowDoubleClick:!1},{actionName:"Add",actionLabel:"Add Detail",multiple:void 0,alwaysAvailable:!0}],Xf=({isDataChangedRef:t,showDocuments:r,disableActions:n,setEditFormStateFromInitValues:a,secondaryProduct:l,secondaryProductDataExist:h,secondaryProductDisableCache:d,maxWidth:u="xl",dialogAlignTop:A=!1,formStyle:f,readOnly:g,detailsContextGenerator:m})=>{let w=o(null);if(null===w.current){let e;w.current=[...Jf],Boolean(r)&&w.current.push({actionName:"Document",actionLabel:"Document Details",multiple:!1,rowDoubleClick:!1}),Boolean(l)&&w.current.push({actionName:"Detail",actionLabel:"Master",multiple:void 0,alwaysAvailable:!0}),e="string"==typeof n?[n]:Array.isArray(n)?n:[],Array.isArray(e)&&(w.current=w.current.filter((t=>!(e?.indexOf(t.actionName)>=0))))}const[b,v]=c(null),y=o(null),B=o(!1),{context:C}=s(_p),x=()=>{v(null),!0===B.current&&(t.current=!0,y.current?.refetch?.(),B.current=!1)},F=Wf(),N={scrollPaper:F.topScrollPaper,paperScrollBody:F.topPaperScrollBody};return i(p,{children:[e(qp,{ref:y,actions:w.current,setAction:v},"grid"),e(dt,{open:Boolean(b),maxWidth:u,PaperProps:"Delete"===b?.name?{}:{style:{width:"100%",height:A?void 0:"100%"}},classes:A?N:{},children:"Add"===(b?.name??"")?e(zp,{successAction:x,cancelAction:x,isDataChangedRef:B,formStyle:f}):"View"===(b?.name??"")?e(Vp,{isDataChangedRef:B,closeDialog:x,serialNo:b?.rows[0]?.id,setEditFormStateFromInitValues:a,formStyle:f,readOnly:g}):"Delete"===(b?.name??"")?e(Kp,{serialNo:b?.rows.map((e=>e.id)),closeDialog:x,isDataChangedRef:B}):"Document"===(b?.name??"")?e(Vf,{refID:C?.refID,productType:C?.productType,moduleType:C?.moduleType,serialNo:b?.rows[0]?.id,onClose:x}):"Detail"===(b?.name??"")?e(jp,{...m(C?.moduleType,l,C?.refID),children:e(Gf,{isDataChangedRef:B,dataAlwaysExists:h,closeDialog:x,readOnly:g,disableCache:d})}):e(Hf,{closeDialog:x})})]})},Yf=n({}),$f=({children:t,getGridMetaData:i,getGridData:r})=>e(Yf.Provider,{value:{getGridMetaData:i,getGridData:r},children:t}),Zf=(e,t,i)=>({getGridData:{fn:t,args:{reqPara:i}},getGridMetaData:{fn:e,args:{reqPara:i}}}),eg=d((({dataGridKey:t,getAPIReqPara:i,actions:r,setAction:n,defaultSortOrder:a,defaultFilter:o,dataTransformer:c,autoRefreshInterval:d,enableExport:u,reportTemplateCode:A,variant:p,autoFetch:f,headerToolbarStyle:g,enableEnterToFocus:m,focusScopeId:w},b)=>{const{getGridData:v,getGridMetaData:y}=s(Yf),B=h(v.fn(v.args),[i]);return l((()=>()=>{ao.removeQueries(["gridMetaData",i])}),[i]),e(pA,{ref:b,metaData:y.fn,gridCode:i,getGridData:B,actions:r,setAction:n,defaultSortOrder:a,defaultFilter:o,dataTransformer:c,autoRefreshInterval:d,enableExport:u,reportTemplateCode:A,variant:p,autoFetch:f,headerToolbarStyle:g,enableEnterToFocus:m,focusScopeId:w},t)})),tg=d((({dataGridKey:t,metaData:i,getAPIFn:r=()=>{},getAPIReqPara:n,actions:s,setAction:a,defaultFilter:o,defaultSortOrder:l,dataTransformer:h,autoRefreshInterval:c,enableExport:d=!1,reportTemplateCode:u,variant:A,autoFetch:p,headerToolbarStyle:f={},enableEnterToFocus:g,focusScopeId:m="enter-to-focus-server-grid"},w)=>e($f,{...Zf(i,r,n),children:e(eg,{dataGridKey:t,getAPIReqPara:n,actions:s,setAction:a,defaultFilter:o,defaultSortOrder:l,dataTransformer:h,ref:w,autoRefreshInterval:c,enableExport:d,reportTemplateCode:u,variant:A,autoFetch:p,headerToolbarStyle:f,enableEnterToFocus:g,focusScopeId:m})}))),ig=Ci((e=>({tabPanel:{border:"1px solid #e8e8e8",borderTop:"0",backgroundColor:"#fff",boxShadow:"0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12)"}}))),rg=xi((e=>({root:{textTransform:"none",minWidth:72,marginRight:e.spacing(4),opacity:1,color:e.palette.secondary.main,fontWeight:600,fontFamily:["Montserrat","Helvetica","Arial","Lucida","sans-serif"].join(","),"&:hover":{color:"#0063a3",opacity:1},"&$selected":{color:"#fff",fontWeight:"600",background:"var(--theme-color1)","&:active":{color:"#fff"}},"&:active":{color:"var(--theme-color1)"},"&:focus:not(:selected)":{color:"var(--theme-color1)"}},selected:{}})))(lr),ng=xi((e=>({root:{border:"2px solid #e8e8e8",background:"#fff",boxShadow:"0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12)"},indicator:{background:"var(--theme-color1)",top:0}})))(or),sg=n(null),ag=()=>{const e=s(sg);if(!e)throw new Error("useSnackbarProviderWrapper must be used within a SnackbarProviderWrapper");return e.snackbarProps},og=({children:t,...i})=>{const r=a((()=>({snackbarProps:i})),[i]);return e(sg.Provider,{value:r,children:e(zi,{...i,children:t})})},lg=Ci({topScrollPaper:{alignItems:"center"},topPaperScrollBody:{verticalAlign:"top"},title:{flex:"1 1 100%",color:"var(--white)",letterSpacing:"1px",fontSize:"1.5rem"}}),hg=({metadata:t,ClosedEventCall:r,data:n,HeaderMetaData:s,HeaderData:l,ClickEventManage:h,children:d,isLoading:u=!1,isError:A=!1,ErrorMessage:p="",actions:f=[],setData:g=e=>{},setCurrentAction:m=e=>{},mode:w="view",isEditableForm:b=!1,refID:v={},onSubmit:y=()=>{},submitSecondAction:B=()=>{},submitSecondButtonName:C="",submitSecondButtonHide:x=!0,submitSecondLoading:F=!1,onFieldAction:N=(e,t,i)=>{},formComponentPropStyles:S={},dialogProps:E={},enableEnterToFocus:T,focusScopeId:L="enter-to-focus-detailsGrid"})=>{const{enableEnterToFocus:k}=Ws(),D=lg(),I=o(null),{t:U}=ne(),[P,O]=c(""),R=()=>{r()},Q=a((()=>{let e=t.columns;return"view"===w&&(e=t.columns.filter((e=>"_hidden"!==e.accessor))),{...t,columns:e}}),[w,t]);return e(dt,{open:!0,TransitionComponent:th,PaperProps:{style:{width:"100%",minHeight:"20vh"}},maxWidth:"lg",classes:{scrollPaper:D.topScrollPaper,paperScrollBody:D.topPaperScrollBody},...E,children:i("div",{style:{padding:"10px"},children:[A?e(Va,{severity:"error",errorMsg:p,errorDetail:"",color:"error"}):Boolean(P)?e(Va,{errorMsg:P,errorDetail:"",severity:"error"}):null,Boolean(d)?"function"==typeof d?d({handelCloseEvent:R,handleSubmit:async()=>{let{hasError:e,data:t}=await(I.current?.validate());if(!0===e)g(t);else{let e=I?.current?.cleanData?.(),t=e.filter((e=>!(Boolean(e?._hidden)&&!Boolean(e?.lineNo)))),i={...v,config:t};y({data:i,mode:w,setServerError:O})}},classes:D}):d:e(sr,{position:"relative",color:"secondary",style:{marginBottom:"10px"},children:i(si,{variant:"dense",children:[e(vt,{className:D.title,color:"inherit",variant:"h6",component:"div",children:U(s?.gridConfig?.title??"")}),e(ct,{onClick:R,color:"primary",children:U("Close")})]})}),e(Op,{finalMetaData:s,onAction:h,loading:u,data:l??{},submitSecondAction:B,submitSecondButtonName:C,submitSecondButtonHide:x,submitSecondLoading:F,onFieldAction:N,propStyles:S,enableEnterToFocus:T??k,focusScopeId:L},"DetailsHeadersView"),e(Xd,{finalMetaData:Q,data:n,setData:g,loading:b?"view"===w:u,actions:f,setAction:async e=>{await m(e)},refetchData:null,enableEnterToFocus:T??k,focusScopeId:L,ref:I},"customerDetailsGrid")]})})},cg=t=>{const{row:i}=t;let r=`${Number(i.index)+1}`;return e(fc,{...t,children:r})},dg=t=>e("div",{children:"#"}),ug=e=>t=>{e&&t.visibleColumns.push((e=>[{id:"sequence",Header:dg,Cell:cg,width:5,maxWidth:5,minWidth:5},...e]))},Ag=({globalFilter:t,setGlobalFilter:i,rowCount:r})=>{const[,n]=c(t),{t:s}=ne(),a=qt((e=>i(e||void 0)),200);return e(wl,{type:"text",onChange:e=>{n(e.target.value),a(e.target.value)},placeholder:`${s("profile.Searchin")} ${r} ${s("records")}`})},pg=Ci((e=>({root:{display:"flex",justifyContent:"left",flexWrap:"wrap",listStyle:"none",paddingLeft:e.spacing(2),paddingRight:e.spacing(2),margin:0,overflowX:"auto"},chip:{margin:e.spacing(.5)}}))),fg=({dense:r,filters:n,setAllFilters:s})=>{const a=pg(),{t:o}=ne();return Array.isArray(n)&&n.length<=0?null:i(si,{component:"ul",className:a.root,variant:r?"dense":"regular",children:[e("li",{children:i(vt,{variant:"h6",children:[o("RetrievalParameters")," : "]})}),n.map((i=>e(t,{children:Boolean(i?.value?.value)?e("li",{children:e(mi,{label:gg(i?.value?.condition,o(i?.value?.columnName),i?.value?.value,o(i?.value?.label),i?.value?.displayValue),className:a.chip,variant:"outlined"})},i?.id):null})))]})},gg=(e,t,i,r,n)=>{let s=Boolean(r)?r:t;switch(e){case"equal":return`${s} = ${mg(n??i)}`;case"between":return`${s} between ${mg(i[0])} and ${mg(i[1])}`;case"in":return`${s} in ${wg(i,r)}`;case"contains":return`${s} like ${i}`;case"endsWith":return`${s} ends with ${i}`;case"startsWith":return`${s} starts with ${i}`;default:return`${s} : ${i}`}},mg=e=>{let t;return ca(e)&&(t=z(new Date(e),"dd/MM/yyyy")),isNaN(t)?e:t},wg=(e,t)=>Array.isArray(t)&&Array.isArray(e)&&e.length===t.length?JSON.stringify(t).replaceAll(/"/g," "):JSON.stringify(e).replaceAll(/"/g," "),bg=({setQueryFilters:r,filterMeta:n,filterData:s,retrievalType:a,isOpenRetrievalDefault:h,setShowFilters:d=e=>{},setAllFilters:A=e=>{},retrievalComponent:p})=>{const[f,g]=c(h),m=o(s),{t:w}=ne();l((()=>{document.addEventListener("keydown",(e=>{!e.ctrlKey||"R"!==e.key&&"r"!==e.key||(e.preventDefault(),g(!0))}))}),[]);return e(Ri,{dateAdapter:Qi,children:i(t,{children:[Boolean(a)&&"function"==typeof p?e(t,{children:"CUSTOM"===a&&n?.fields?.length>0||"CUSTOM"!==a?e(ct,{onClick:()=>{g(!0),d(!1),A([])},color:"primary",children:w("RetrieveData")}):null}):e(t,{}),f&&a&&p&&"function"==typeof p?u(p,{classes:{},open:f,handleClose:()=>{g(!1)},loginState:{},defaultData:m.current,retrievalParaValues:(e,t)=>{r(e),g(!1),t&&(m.current=t)},retrievalType:a,metaData:n}):null]})})},vg=(e=[],t={})=>{switch(t.type){case"setValue":{const{id:i,...r}=t.payload;let n=e.findIndex((e=>e.id===i));return n>=0?(e[n].value=r,[...e]):[...e,{id:i,value:r}]}case"removeValue":{const{id:i}=t.payload;return e.filter((e=>e.id!=i))}case"resetAll":return[];default:return e}},yg=({setQueryFilters:t,filterMeta:r,filterData:n,retrievalWindowOpen:s=!1})=>{const{t:a}=ne(),[l,d]=c(s),{filterState:A,dispatch:p}=(e=>{const t=o([]);return{dispatch:h((i=>{let r=e(t.current,i);t.current=r}),[]),filterState:t}})(vg),f=()=>{d(!1)};let g=[];return Array.isArray(r)&&(g=r.filter((e=>"function"==typeof e.Filter)),g=g.map((e=>{const{Filter:t,accessor:i,...r}=e;return u(t,{key:i,filterValue:n.filter((e=>e.id===i))?.[0]?.value,id:i,dispatch:p,...r})}))),i(Ri,{dateAdapter:Qi,children:[e(ae,{onClick:()=>{d(!0)},color:"primary",children:"Retrieve Data"}),i(ke,{anchor:"right",id:"columnVisibility",open:l,onClose:f,PaperProps:{style:{width:"520px"}},children:[e(De,{position:"relative",color:"secondary",children:i(Ie,{variant:"dense",children:[e(fe,{variant:"h6",children:a("Filter")}),e("div",{style:{flexGrow:1}}),e(ae,{onClick:()=>{t(A.current),d(!1)},color:"primary",children:a("Apply")}),e(ae,{onClick:()=>{t([]),d(!1)},color:"primary",children:a("Clear")}),e(ae,{onClick:f,color:"primary",children:a("Close")})]})}),e(Ne,{children:e(Se,{container:!0,spacing:2,children:g})})]})]})},Bg=({dateRange:t,setDateRange:r,columnFormat:n="dd/MM/yyyy HH:mm:ss",setIsError:s,isDate:a})=>{let o=a?Eo:Lo;const[l,h]=c({from:"",to:""}),d=(e,t)=>{let i=!1;const r={from:"",to:""};return e instanceof Date&&!isNaN(e?.getTime())||(r.from=G("Mustbeavaliddate"),i=!0),t instanceof Date&&!isNaN(t?.getTime())||(r.to=G("Mustbeavaliddate"),i=!0),e instanceof Date&&t instanceof Date&&e>t&&(r.from=G("FromDateshouldbelessthanorequaltoToDate"),r.to=G("ToDateshouldbegreaterthanorequaltoFromDate"),i=!0),h(r),s(i),!i};return i(Ue,{spacing:1,children:[e(o,{format:n,value:t.from??new Date,label:G("From")??"From",views:a?["year","month","day"]:["year","month","day","hours","minutes","seconds"],onChange:e=>{const i=e instanceof Date&&!isNaN(e?.getTime())?e:null,n={...t,from:i};d(i,t.to)&&r(n)},slots:{textField:to},slotProps:{textField:{error:!!l.from,helperText:l.from},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%",mb:1}}),e(o,{format:n,label:G("To")??"To",value:t.to??new Date,views:a?["year","month","day"]:["year","month","day","hours","minutes","seconds"],onChange:e=>{const i=e instanceof Date&&!isNaN(e?.getTime())?e:null,n={...t,to:i};d(t.from,i)&&r(n)},slots:{textField:to},slotProps:{textField:{error:!!l.to,helperText:l.to},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%"}})]})},Cg=({dateValue:t,setDateValue:i,columnFormat:r="dd/MM/yyyy HH:mm:ss",setIsError:n,isDate:s})=>{const[a,o]=c("");return e(s?Eo:Lo,{format:r??"dd/MM/yyyy HH:mm:ss",value:t??new Date,views:s?["year","month","day"]:["year","month","day","hours","minutes","seconds"],onChange:e=>{if(!V(e))return o(G("Mustbeavaliddate")??""),void n(!0);o(""),n(!1),i(e instanceof Date?e:new Date)},slots:{textField:to},slotProps:{textField:{error:Boolean(a),helperText:a,sx:{"& .MuiInputBase-root":{margin:"0 !important"}}},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%",mb:1}})},xg=(e,t)=>z(new Date(e),t??"dd/MM/yyyy HH:mm:ss"),Fg=e=>e instanceof Date&&!isNaN(e.getTime())?new Date(e.getFullYear(),e.getMonth(),e.getDate()):null,Ng=(e,t,i)=>{const{type:r,value:n}=i;return null==n||""===n||Array.isArray(n)&&0===n.length?e:e.filter((i=>{const s=""===i.values[t]?.trim()&&"multi-select"===r?"(Blanks)":i.values[t];if("multi-select"===r)return n.includes(s);if("Before"===r||"After"===r||"Equal (Date)"===r||"Equal (Date & Time)"===r||"Between (Date)"===r||"Between (Date & Time)"===r||"Today"===r||"Yesterday"===r||"This Week"===r||"Last Week"===r||"This Month"===r||"Last Month"===r){const e=new Date(s),t=Array.isArray(n)?[new Date(n[0]),new Date(n[1])]:new Date(n);if(isNaN(e.getTime())||(Array.isArray(t)?t.some((e=>isNaN(e.getTime()))):isNaN(t.getTime())))return!1;switch(r){case"Before":return e<t;case"After":return e>t;case"Equal (Date)":return!Array.isArray(t)&&Fg(e)?.toLocaleString()===Fg(t)?.toLocaleString();case"Equal (Date & Time)":return!Array.isArray(t)&&e.toLocaleString()===t.toLocaleString();case"Between (Date)":const[i,r]=Array.isArray(t)?t:[];return!(!i||!r)&&(Fg(e)>=Fg(i)&&Fg(e)<=Fg(r));case"Between (Date & Time)":const[n,s]=Array.isArray(t)?t:[];return!(!n||!s)&&(e>=n&&e<=s);case"Today":{const t=new Date;return Fg(e)?.getTime()===Fg(t)?.getTime()}case"Yesterday":{const t=new Date;return t.setDate(t.getDate()-1),Fg(e)?.getTime()===Fg(t)?.getTime()}case"This Week":{const t=new Date,i=Fg(new Date(t.setDate(t.getDate()-t.getDay()))),r=new Date(i);r.setDate(i.getDate()+6);const n=Fg(e);return!!n&&n>=i&&n<=Fg(r)}case"Last Week":{const t=new Date,i=Fg(new Date(t.setDate(t.getDate()-t.getDay()-7))),r=new Date(i);r.setDate(i.getDate()+6);const n=Fg(e);return!!n&&n>=i&&n<=Fg(r)}case"This Month":{const t=new Date,i=Fg(new Date(t.getFullYear(),t.getMonth(),1)),r=Fg(new Date(t.getFullYear(),t.getMonth()+1,0)),n=Fg(e);return!!n&&n>=i&&n<=r}case"Last Month":{const t=new Date,i=Fg(new Date(t.getFullYear(),t.getMonth()-1,1)),r=Fg(new Date(t.getFullYear(),t.getMonth(),0)),n=Fg(e);return!!n&&n>=i&&n<=r}default:return!0}}const a=s?.toString().toLowerCase(),o=n?.toString().toLowerCase();switch(r){case"Contains":return a.includes(o);case"Starts With":return a.startsWith(o);case"Ends With":return a.endsWith(o);case"Equal":return a===o;case"Not Equal":return a!==o;case"Empty":return""===a;case"Not Empty":return""!==a;case"Greater Than":return parseFloat(s)>parseFloat(n);case"Less Than":return parseFloat(s)<parseFloat(n);case"Greater Than or Equal To":return parseFloat(s)>=parseFloat(n);case"Less Than or Equal To":return parseFloat(s)<=parseFloat(n);case"Does not contain":return!a.includes(o);case"Between":const i=o.split(",")?.map((e=>parseFloat(e))),r=parseFloat(s);return r>=i[0]&&r<=i[1];case"Above Average":const l=e.reduce(((e,i)=>e+parseFloat(i.values[t])),0)/e.length;return parseFloat(s)>l;case"Below Average":const h=e.reduce(((e,i)=>e+parseFloat(i.values[t])),0)/e.length;return parseFloat(s)<h;default:return!0}}))},Sg=({amtRange:t,setAmtRange:r,setIsError:n})=>{const{dynamicAmountSymbol:s,decimalCount:a,dynamicAmountGroupStyle:o}=Ws(),[l,h]=c({from:"",to:""}),d=(e,t)=>{let i=!1;const r={from:"",to:""},s=parseFloat(e),a=parseFloat(t);isNaN(s)||isNaN(a)||s>a&&(r.from="'From' value must be less than 'To' value",r.to="'To' value must be greater than 'From' value",i=!0),h(r),n(i)};return i(Ue,{spacing:1.5,children:[i("div",{children:[e(ul,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:o,allowNegative:!0,allowLeadingZeros:!1,decimalScale:a,fixedDecimalScale:!0,placeholder:"From amount",isAllowed:e=>e?.value?.length<=15,value:t.from,onValueChange:e=>{if(!isNaN(Number(e.value))){const t=e.value;r((e=>{const i={...e,from:t};return d(t,e.to),i}))}}},enableGrid:!1,fieldKey:"FromAmount",name:"from-amount",StartAdornment:sl(s),className:"textInputFromRight",maxLength:15,showMaxLength:!1,textFieldStyle:{width:"100%","& .MuiInputBase-root":{margin:"0 !important"}}}),l.from?e(we,{error:!0,sx:{mt:0},children:l.from}):null]}),i("div",{children:[e(ul,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:o,allowNegative:!0,allowLeadingZeros:!1,decimalScale:a,fixedDecimalScale:!0,placeholder:"To amount",isAllowed:e=>e?.value?.length<=15,value:t.to,onValueChange:e=>{if(!isNaN(Number(e.value))){const t=e.value;r((e=>{const i={...e,to:t};return d(e.from,t),i}))}}},enableGrid:!1,fieldKey:"ToAmount",name:"to-amount",StartAdornment:sl(s),className:"textInputFromRight",maxLength:15,showMaxLength:!1,textFieldStyle:{width:"100%",".MuiInputBase-root":{margin:"0 !important"}}}),l.to?e(we,{error:!0,sx:{mt:0},children:l.to}):null]})]})},Eg=({inputValue:t,setInputValue:i})=>{const{dynamicAmountSymbol:r,decimalCount:n,dynamicAmountGroupStyle:s}=Ws();return e(ul,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:s,allowNegative:!0,allowLeadingZeros:!1,decimalScale:n,fixedDecimalScale:!0,placeholder:"Enter a value",isAllowed:e=>!(e?.value?.length>15),value:t,onValueChange:e=>{isNaN(Number(e.value))||i(String(e.value))}},enableGrid:!1,fieldKey:"Amount",name:"amount",StartAdornment:sl(r),className:"textInputFromRight",maxLength:15,showMaxLength:!1,textFieldStyle:{width:"100%",".MuiInputBase-root":{margin:"0 !important"}}})},Tg={text:["Contains","Starts With","Ends With","Equal","Not Equal","Does not contain"],number:["Equal","Greater Than","Greater Than or Equal To","Less Than","Less Than or Equal To","Not Equal","Between","Above Average","Below Average"],date:["Equal (Date)","Equal (Date & Time)","Before","After","Between (Date)","Between (Date & Time)","Yesterday","Today","This Week","Last Week","This Month","Last Month"],dropdown:["Equal","Not Equal"]},Lg=({column:r,filters:n,enableEnterToFocus:s})=>{const{id:d,columnName:u,columnFormat:A,filterType:p,Cell:f,options:g,filterValue:m,setFilter:w,preFilteredRows:b,alignment:v}=r,[y,B]=c(null),[C,x]=c(0),[F,N]=c((()=>(Tg[p||"text"]||[])[0])),[S,E]=c(!1),[T,L]=c(""),[k,D]=c(new Date),[I,U]=c({from:new Date,to:new Date}),[P,O]=c({from:"",to:""}),[R,Q]=c(""),[H,M]=c([]),_=o({dateValue:k,dateRange:I,amtRange:P,inputValue:T,selectedOption:F,selectedValues:H,search:R}),j=Boolean(y),z=f===gc||f===mc?"date":f===kc?"number":p||"text",V=Tg[z]||[],K=()=>{S&&(O({from:"",to:""}),E(!1)),B(null),M(_.current.selectedValues),D(_.current.dateValue),U(_.current.dateRange),O(_.current.amtRange),L(_.current.inputValue),N(_.current.selectedOption),Q(_.current.search)},q=a((()=>{const e=new Set;b?.forEach((t=>{e.add(""===t.values[d]?.trim()?"(Blanks)":t.values[d])}));const t=Array.from(e).filter((e=>e?.toString().toLowerCase().includes(R.toLowerCase())));return t.includes("(Blanks)")?[...t.filter((e=>"(Blanks)"!==e)),"(Blanks)"]:t}),[b,d,R]),W=a((()=>{const e={};return b?.forEach((t=>{const i=""===t.values[d]?.trim()?"(Blanks)":t.values[d],r=String(i??"");e[r]=(e[r]||0)+1})),e}),[b,d]);l((()=>{const e=(Tg[z]||[])[0];N(e)}),[z]),l((()=>{n.length||(_.current={dateValue:new Date,dateRange:{from:new Date,to:new Date},amtRange:{from:"",to:""},inputValue:"",selectedOption:(Tg[z]||[])[0],selectedValues:[],search:""},M([]),L(""),D(new Date),U({from:new Date,to:new Date}),O({from:"",to:""}),Q(""),N((Tg[z]||[])[0]))}),[n,z]);const J=h((()=>{if(!m)return"";if("multi-select"===m.type&&"date"===z&&Array.isArray(m.value)){const e=m.value.map((e=>xg(e,A)));return`${G("Filtered")}: ${e.join(", ")}`}return"multi-select"===m.type&&Array.isArray(m.value)?`${G("Filtered")}: ${m.value.join(", ")}`:"date"===z&&Array.isArray(m.value)?`${m.type}: ${xg(m.value[0],m.type.includes("Time")?A:A?.split(" ")[0]??"dd/MM/yyyy")} - ${xg(m.value[1],m.type.includes("Time")?A:A?.split(" ")[0]??"dd/MM/yyyy")}`:"date"===z&&m.value instanceof Date?`${m.type}: ${xg(m.value,m.type.includes("Time")?A:A?.split(" ")[0]??"dd/MM/yyyy")}`:"number"===z&&F.includes("Average")?m.type:`${m.type}: ${m.value}`}),[m,z,F,A]);return f===Ec?null:i(t,{children:[e(Be,{size:"small",onClick:e=>{m||"date"!==z||(D(new Date),U({from:new Date,to:new Date}),O({from:"",to:""})),B(e.currentTarget)},sx:{...r.canGroupBy?{}:{ml:"right"!==v?"auto":0,mr:"right"===v?"auto":0}},children:e(pe,m?{disableInteractive:!0,title:m?e(me,{sx:{p:.5},children:e(fe,{variant:"caption",sx:{fontWeight:600,color:"var(--theme-color1)",fontSize:"0.75rem"},children:J()})}):"",arrow:!0,disableHoverListener:!m,componentsProps:{tooltip:{sx:{backgroundColor:"var(--theme-color2)",color:"var(--theme-color1)",fontSize:"0.75rem",borderRadius:1.5,boxShadow:4,maxWidth:240,whiteSpace:"normal"}},arrow:{sx:{color:"var(--theme-color2)"}}},children:e(Ar,{fontSize:"small",style:{color:"var(--theme-color1)"}})}:{title:G("AdvanceFilter"),disableInteractive:!0,children:e(ur,{fontSize:"small"})})}),e(Pe,{open:j,anchorEl:y,onClose:K,onKeyDown:e=>{s&&ma(e)},children:i(me,{p:2,width:300,children:[e(fe,{variant:"subtitle2",mb:1,children:u}),i(ng,{value:C,onChange:(e,t)=>x(t),variant:"fullWidth",TabIndicatorProps:{style:{display:"none"}},sx:{border:"none !important",boxShadow:"none !important",backgroundColor:"transparent !important",minHeight:0,"& .MuiTabs-flexContainer":{gap:1},"& .MuiTab-root":{minHeight:30,padding:"4px 12px",borderRadius:"20px",fontSize:"0.75rem",fontWeight:600}},children:[e(rg,{label:G("FilterByValue"),style:{padding:0,margin:0,borderRadius:"10px"}}),e(rg,{label:G("FilterByCondition"),style:{padding:0,margin:0,borderRadius:"10px"}})]}),0===C&&i(Ue,{spacing:1,mt:2,children:[e(to,{size:"small",placeholder:G("Search")??"Search...",value:R,onChange:e=>Q(e.target.value),fullWidth:!0,InputProps:{sx:{marginTop:"0px !important"}}}),e(me,{sx:{maxHeight:200,overflowY:"auto",border:"1px solid #ccc",p:1,borderRadius:1},children:e(kg,{uniqueValues:q,selectedValues:H,setSelectedValues:M,valueCounts:W,Cell:f,column:r,type:z})})]}),1===C&&i(Ue,{spacing:2,mt:2,children:[e(Oe,{value:F,onChange:e=>N(e.target.value),size:"small",fullWidth:!0,children:V.map((t=>e(Re,{value:t,children:t},t)))}),"date"===z?e(tr,{dateAdapter:Qi,children:"Between (Date)"===F||"Between (Date & Time)"===F?e(Bg,{dateRange:I,setDateRange:U,columnFormat:"Between (Date)"===F?A?.split(" ")[0]??"dd/MM/yyyy":A,setIsError:E,isDate:"Between (Date)"===F}):["Equal (Date)","Equal (Date & Time)","Before","After"].includes(F)?e(Cg,{dateValue:k,setDateValue:D,columnFormat:"Equal (Date)"===F?A?.split(" ")[0]??"dd/MM/yyyy":A,setIsError:E,isDate:"Equal (Date)"===F}):null}):"dropdown"===z&&g?.length?e(Oe,{value:T,onChange:e=>L(e.target.value),size:"small",fullWidth:!0,children:g.map((t=>e(Re,{value:t,children:t},t)))}):e(t,{children:"number"===z?e(t,{children:"Between"===F?e(Sg,{amtRange:P,setAmtRange:O,setIsError:E}):e(t,{children:F.includes("Average")?null:e(Eg,{inputValue:T,setInputValue:L})})}):e(to,{size:"small",placeholder:"Enter value",value:T,type:"number"===z?"number":"text",onChange:e=>L(e.target.value),fullWidth:!0,InputProps:{sx:{marginTop:"0px !important"}}})})]}),i(Ue,{direction:"row",spacing:1,justifyContent:"flex-end",mt:2,children:[e(za,{variant:"contained",size:"small",onClick:()=>{_.current={dateValue:new Date,dateRange:{from:new Date,to:new Date},amtRange:{from:"",to:""},inputValue:"",selectedOption:(Tg[z]||[])[0],selectedValues:[],search:""},M([]),L(""),D(new Date),U({from:new Date,to:new Date}),O({from:"",to:""}),w(void 0),K()},children:G("Clear")}),e(za,{variant:"contained",size:"small",onClick:()=>{if(_.current={dateValue:k,dateRange:I,amtRange:P,inputValue:T,selectedOption:F,selectedValues:H,search:R},0===C)Array.isArray(H)&&H?.length>0&&w({type:"multi-select",value:H});else if(!S){let e;if("date"===z?"Between (Date)"===F||"Between (Date & Time)"===F?e=[I.from,I.to]:e=["Yesterday","Today","This Week","Last Week","This Month","Last Month"].includes(F)?(e=>{const t=new Date,i=new Date(t);i.setDate(t.getDate()-t.getDay());const r=new Date(i);r.setDate(i.getDate()+6);const n=new Date(i);n.setDate(n.getDate()-7);const s=new Date(n);s.setDate(n.getDate()+6);const a=new Date(t.getFullYear(),t.getMonth(),1),o=new Date(t.getFullYear(),t.getMonth()+1,0),l=new Date(t.getFullYear(),t.getMonth()-1,1),h=new Date(t.getFullYear(),t.getMonth(),0);switch(e){case"Yesterday":const e=new Date;return e.setDate(t.getDate()-1),e;case"Today":return t;case"This Week":return[i,r];case"Last Week":return[n,s];case"This Month":return[a,o];case"Last Month":return[l,h];default:return null}})(F):k:e="Between"===F?[P.from,P.to]:F.includes("Average")?F:T,Array.isArray(e)){const[t,i]=e;t&&i&&w({type:F,condition:F?.toLowerCase(),value:e})}else e&&w({type:F,condition:F?.toLowerCase(),value:e,showType:F.includes("Average")})}K()},children:G("Apply")})]})]})})]})},kg=({uniqueValues:t,selectedValues:r,setSelectedValues:n,valueCounts:s,Cell:a,column:o,type:l,height:h=144})=>{const c=t.length>0&&t.every((e=>r.includes(e)));return i(Ue,{direction:"column",spacing:1,children:[e(Ae,{control:e(so,{checked:c,indeterminate:r.length>0&&!c,color:"secondary",onChange:()=>{n(c?[]:[...t])}}),label:e(fe,{sx:{fontWeight:"bold"},children:G("SelectAll")}),sx:{mx:0,pb:1,borderBottom:"1px solid #eee"}}),e(Ei,{height:t.length?h:0,itemCount:t.length,itemSize:30,width:"100%",children:({index:h,style:c})=>{const d=t[h];return e("div",{style:c,children:e(Ae,{control:e(so,{checked:r.includes(d),onChange:()=>(e=>{r.includes(e)?n(r.filter((t=>t!==e))):n([...r,e])})(d),sx:{p:.5}}),sx:{width:"100%",alignItems:"center",mx:0,my:.5},label:i(me,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",pr:1},children:[e(fe,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.875rem"},children:"function"==typeof a&&"text"!==l?a({value:d,column:o,isAdvanceFilter:!0}):d?.toString()}),i(fe,{sx:{fontSize:"0.75rem",color:"#888",marginLeft:1,flexShrink:0},children:["(",s[String(d??"")]||0,")"]})]})})},d?.toString())}})]})},Dg=({footerGroup:t,loading:i})=>e(hi,{...t.getFooterGroupProps(),component:"div",children:t.headers.map((t=>e(ci,{...t.getFooterProps([{style:{textAlign:t?.alignment??"unset",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 20px 0px 10px",lineHeight:"34px",backgroundColor:"var(--theme-color2)"}}]),component:"div",children:t.render("Footer",{loading:i})})))}),Ig=({footerGroup:t})=>e("div",{style:{backgroundColor:"var(--theme-color2)"},children:e(hi,{...t.getFooterGroupProps(),children:e("div",{children:t.headers.map((t=>e("span",{style:{textAlign:t?.alignment??"unset",display:"flex",gap:"3rem",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:"34px",marginLeft:"10px",fontWeight:"500"},children:t.render("Footer1")},t.id)))})})}),Ug=({columns:r,defaultColumn:n,data:s,maxHeight:d=300,containerHeight:u,occupiedHeight:A,initialState:f={},filterTypes:g,title:m,options:w,loading:b=!1,hideFooter:v=!1,showSerialNoColumn:y=!1,onClose:B=null,setQueryFilters:x,filterMeta:F,queryFilters:N,hideAmountIn:S,retrievalType:E,onButtonActionHandel:T,isOpenRetrievalDefault:L,hideHeader:k=!1,hideShowFiltersSwitch:D,hideStatusBar:I,refetchData:U,pageSizes:P=[20,30,40],totalRecords:O=0,defaultPageSize:R=20,defaultSortOrder:Q=[],defaultHiddenColumns:H=[],enablePagination:M=!1,retrievalComponent:_,openDrawerFilter:j,onDoubleClickAction:V,enablePdfPrint:K,reportTemplateCode:q,enablePivot:G,actions:W,getReportData:J,disableFilters:X,headerToolbarStyle:Y,enableEnterToFocus:$})=>{const Z=a((()=>r.some((e=>e.isDisplayValueTotal))),[r]),ee=a((()=>r.some((e=>e.isTotalWithCurrency||e.isTotalWithoutCurrency))),[r]),[te,ie]=c(!1),[re,se]=c(!1),{t:ae}=ne(),{disableColumnFilters:le}=Ws(),he=a((()=>r.map((e=>({...e,disableFilters:e?.disableFilters??X??le??!1,filter:Ng})))),[r,X,le]),ce=Gt({columns:he,data:s,defaultColumn:n,filterTypes:g,onButtonActionHandel:T,autoResetGlobalFilter:!1,autoResetFilters:!1,autoResetGroupBy:!1,autoResetExpanded:!1,autoResetSortBy:!1,globalFilter:(e,t,i)=>((e,t,i,r)=>{const n=i.toLowerCase();return e.filter((e=>t.some((t=>{const i=r.find((e=>e.accessor===t)),s=e.values[t];return!ca(s)||i?.Cell!==gc&&i?.Cell!==mc&&i?.Cell!==Ic?String(s).toLowerCase().includes(n):z(new Date(s),i.format??"dd/MM/yyyy hh:mm:ss a").toLowerCase().includes(n)}))))})(e,t,i,r),initialState:{pageIndex:0,pageSize:R,hiddenColumns:H,sortBy:Q,...f},...w},Wt,ri,Xt,Yt,$t,ti,ii,ug(y),T),{getTableProps:de,getTableBodyProps:ue,headerGroups:Ae,footerGroups:pe,rows:fe,prepareRow:ge,totalColumnsWidth:me,toggleAllRowsExpanded:we,isAllRowsExpanded:be,setAllFilters:ve,setGlobalFilter:ye,preGlobalFilteredRows:Be,gotoPage:Ce,setPageSize:xe,state:{filters:Fe,globalFilter:Ne,pageIndex:Se,pageSize:Ee}}=ce;l((()=>{"function"==typeof J&&J(Fe,N,Ne,s,fe?.map((e=>e.values)))}),[Fe,N,Ne,s,fe]),l((()=>{ve([])}),[N]);const Te=h((t=>{let{index:i,style:r}=t;const n=fe[i];return ge(n),n?.isGrouped&&n?.isExpanded&&(r={...r,backgroundColor:"rgba(0, 0, 0, 0.04)"}),e(hi,{...n.getRowProps({style:r}),component:"div",onDoubleClick:()=>{"function"==typeof V&&V({row:[{data:n?.original,id:n?.id}]})},children:n.cells.map(((e,t)=>e.isAggregated?e.render("Aggregated"):e.render("Cell",{index:t})))})}),[ge,fe]),Le=a((()=>fe.reduce(((e,t)=>(t?.original?._hidden||++e,e)),0)),[fe]),ke=a((()=>{if(!u||!A)return{min:"73.5vh",max:"73.5vh"};const e=e=>{const t=Array.isArray(N)&&N.length>0?`calc(${u?.[e]} - 48px)`:u?.[e];return t&&A?.[e]?`calc(${t} - ${A?.[e]})`:t};return{min:e("min"),max:e("max")}}),[N,u,A]),De=o(null),[Ie,Ue]=c({min:700,max:700});return l((()=>{if(!De.current)return;const e=()=>{const e=De.current,t=getComputedStyle(e),i=parseFloat(t.minHeight),r=parseFloat(t.maxHeight);Ue({min:i,max:r})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[fe,u,A]),i(p,{children:[i(ni,{style:{width:"100%",overflow:"hidden",marginBottom:"8px",display:k?"none":"inherit"},className:"not-printed",children:[i(si,{className:"static__report__header",variant:"dense",sx:{width:"100%",background:"var(--primary-bg)",...Y},children:[e(vt,{variant:"h5",color:"primary",children:m.trim()}),e("div",{style:{flexGrow:1}}),j?e(yg,{setQueryFilters:x,filterMeta:F,filterData:N,retrievalWindowOpen:L}):e(bg,{setQueryFilters:x,filterMeta:F,filterData:N,retrievalType:E,isOpenRetrievalDefault:L,retrievalComponent:_}),Fe.length>0&&e(ct,{onClick:()=>{ve([])},style:{marginRight:"8px",color:"white"},children:ae("ClearFilter")}),"function"==typeof U?e(C,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:()=>U(),color:"primary",children:e(qi,{})}):null,e(Ag,{setGlobalFilter:ye,globalFilter:Ne,rowCount:Le}),Boolean(S)?null:e(Fc,{}),fe?.length>0?e(t,{children:Ae.some((e=>e.headers.some((e=>!0===e.isGrouped))))?e(Ye,{control:e(Dt,{onChange:()=>we(!be),checked:be,name:"filters",size:"small",color:"primary"}),style:{color:"var(--white)"},label:ae("ExpandRows")}):e(Ye,{control:e(tl,{title:ae("Showexportoptions"),arrow:!0,children:i(ct,{onClick:()=>{se(!0)},style:{marginTop:"0px",color:"white"},children:[ae("Export")," ",e(Gi,{})]})}),style:{color:"var(--white)"},label:""})}):null,!b&&G?e(Ye,{control:e(tl,{title:ae("Open Pivot Table"),arrow:!0,children:i(ct,{onClick:()=>ie(!0),style:{marginTop:"0px",color:"white"},children:[ae("Pivot")," ",e(dr,{})]})}),style:{color:"var(--white)"},label:""}):null,W?.map(((t,i)=>e(za,{sx:{minWidth:"60px",...t.buttonStyle},disabled:b,onClick:e=>"function"==typeof t.callback&&t.callback(e,s,fe?.map((e=>e.values))),children:t.buttonName},i))),"function"==typeof B?e(tl,{title:ae("Close"),arrow:!0,children:e(C,{onClick:B,size:"small",children:e(Bt,{style:{color:"var(--white)"}})})}):null]}),I?null:e(fg,{dense:!0,setAllFilters:x,filters:N})]}),b&&e(gt,{color:"secondary"}),i(ni,{style:{width:"100%",overflow:"hidden"},tabIndex:0,children:[e(ai,{ref:De,sx:{position:"relative",maxHeight:ke.max,minHeight:ke.min},children:i(oi,{...de(),size:"small",component:"div",children:[e(li,{component:"div",children:Ae.map((t=>e(hi,{...t.getHeaderGroupProps(),component:"div",children:t.headers.map(((t,r)=>i(ci,{...t.getHeaderProps([{style:{display:"flex",padding:0===r?"0 10px":"0px 10px 0 0",alignItems:"center"}}]),component:"div",align:t.alignment,children:[t.render("Header"),t.canFilter&&e(Lg,{column:t,filters:Fe,enableEnterToFocus:$})]})))})))}),e(di,{...ue({}),component:"div",children:e(Ei,{height:(()=>{const e=Ie?.min??d;return ee?fe.length<=0?e-72:Z?e-110:e-72:Z&&fe.length?e-72:e-38})(),itemCount:fe.length,itemSize:35,width:me+10,overscanCount:10,children:Te})}),fe.length<=0&&!1===b?e("div",{style:{justifyContent:"center",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)",position:"absolute",left:"50%",top:"50%"},children:ae("Nodatafound")}):null,v?null:i(li,{component:"div",style:{boxShadow:"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)"},children:[e(Dg,{footerGroup:pe[0],loading:b}),e(Ig,{footerGroup:pe[0]})]})]})}),v?null:M?e(Qe,{sx:{display:"flex","& .MuiToolbar-root":{display:"flex",alignItems:"baseline"}},variant:"body",component:"div",rowsPerPageOptions:P,colSpan:3,count:O,rowsPerPage:Number(Ee),page:Number(Se),onPageChange:(e,t)=>{Ce(t)},onRowsPerPageChange:e=>{xe(Number(e.target.value))},ActionsComponent:Vl}):i(ci,{style:{display:"flex",color:"var(--theme-color1)",fontWeight:"bold",padding:"10px"},children:[ae("TotalNoofRecords"),": ",Le]})]}),re?e(hd,{globalFilter:Ne,filters:Fe,queryFilters:N,title:m.trim(),rows:fe,columns:r,onClose:()=>{se(!1)},enablePdfPrint:K,reportTemplateCode:q,enableEnterToFocus:$}):null,te?e(oe,{open:!0,fullScreen:!0,children:e(zd,{rows:fe,title:m.trim(),columns:r,onClose:()=>ie(!1)})}):null]})},Pg=(e,t,i)=>pr(e,i,{keys:[e=>e.values[t]]});Pg.autoRemove=e=>!e;const Og=(e,t,i)=>e.filter((e=>{const r=e.values[t];return void 0===r||String(r).toLowerCase().startsWith(String(i).toLowerCase())})),Rg=(e,t,i)=>e.filter((e=>e.values[t]>=i));Rg.autoRemove=e=>"number"!=typeof e;const Qg=(e,t,i)=>e.filter((e=>t.some((t=>{const r=e.values[t];return r&&r.length&&i.some((e=>r.includes(e)))}))));Qg.autoRemove=e=>!e||!e.length;const Hg=[{label:"starts with",value:"startsWith"},{label:"ends with",value:"endsWith"},{label:"equal",value:"equal"},{label:"contains",value:"contains"}],Mg=({filterValue:t,id:i,columnName:r,gridProps:n,dispatch:s})=>{const{t:a}=ne(),[o,l]=c(t?.value??""),[h,d]=c(t?.condition??"equal"),u=()=>{Boolean(o)?s({type:"setValue",payload:{condition:h,value:o,id:i,columnName:r}}):s({type:"removeValue",payload:{id:i}})};return e(ie,{item:!0,xs:12,sm:6,md:6,...n,children:e(to,{label:a(r),InputLabelProps:{shrink:!0},onChange:e=>l(e.target.value.trimStart()),onBlur:u,fullWidth:!0,value:o,InputProps:{endAdornment:e(Bo,{size:"small",style:{width:"50%"},touched:!0,error:"",multiple:!1,handleChange:e=>{d(e.target.value)},handleBlur:u,options:Hg,disableCaching:!1,value:h,selectVariant:"andornment"})}})})},_g=({filterValue:t,id:i,columnName:r,filterProps:n,gridProps:s,dispatch:a})=>{const{t:l}=ne(),[h,d]=c(t?.value??[]),u=o(null),[A,p]=c([]),{loadingOptions:f}=Ao(n?.options??[],p,n?._optionsKey??"",!1,{},!1,void 0);return e(ie,{item:!0,xs:12,sm:6,md:6,...s,children:e(Fo,{label:l(r),showCheckbox:!0,value:h,size:"small",fullWidth:!0,touched:!0,error:"",multiple:!0,handleChange:(e,t)=>{d(e.target.value),u.current=t},handleBlur:e=>{Array.isArray(h)&&h.length>0?a({type:"setValue",payload:{condition:"in",value:h,label:u.current,id:i,columnName:r}}):a({type:"removeValue",payload:{id:i}})},options:A,loadingOptions:f,selectVariant:"regular"})})},jg=({filterValue:t,id:r,columnName:n,gridProps:s,dispatch:a,filterProps:o})=>{const{t:h}=ne(),{dynamicAmountSymbol:d}=Ws(),[u,A]=c(Array.isArray(t?.value)?t?.value[0]:null),[p,f]=c(Array.isArray(t?.value)?t?.value[1]:null),[g,m]=c("");l((()=>{Number(u)>Number(p)&&p?.length>0?m("From Amount should be less To Amount"):m("")}),[u,p]);return e(ie,{item:!0,xs:12,sm:6,md:6,...s,children:i($e,{fullWidth:!0,error:Boolean(g),tabIndex:1,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(!isNaN(Number(u))&&!isNaN(Number(p))&&u?.length&&p?.length&&Number(u)<=Number(p)?a({type:"setValue",payload:{condition:"between",value:[u,p],id:r,columnName:n,type:o.type}}):a({type:"removeValue",payload:{id:r}}))},sx:{"& label.Mui-focused":{color:"var(--theme-color1)"}},children:[e(Io,{shrink:!0,sx:{fontSize:"0.875rem !important"},children:h(n)}),i("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[e(ul,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,placeholder:"From amount",isAllowed:e=>!(e?.value?.length>15),value:u,onValueChange:e=>{isNaN(Number(e.value))||A(String(e.value))}},enableGrid:!1,fieldKey:"FromAmount",name:"from-amount",StartAdornment:sl(d),className:"textInputFromRight",maxLength:15,showMaxLength:!1,style:{width:"48%"}}),e(ul,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,placeholder:"To amount",isAllowed:e=>!(e?.value?.length>15),value:p,onValueChange:e=>{isNaN(Number(e.value))||f(String(e.value))}},enableGrid:!1,fieldKey:"ToAmount",name:"to-amount",StartAdornment:sl(d),className:"textInputFromRight",maxLength:15,showMaxLength:!1,style:{width:"48%"}})]}),Boolean(g)?e(Ze,{children:g}):null]})})},zg=[{label:"All",value:"all"},{label:"Today",value:"today"},{label:"Last Week",value:"lastWeek"},{label:"Last Month",value:"lastMonth"},{label:"Custom",value:"custom"}],Vg=[{label:"Today",value:"today"},{label:"Last Week",value:"lastWeek"},{label:"Last Month",value:"lastMonth"},{label:"Custom",value:"custom"}],Kg=({filterValue:r,id:n,columnName:s,gridProps:a,dispatch:h,filterProps:d,isDefaultFilter:u})=>{const{t:A}=ne(),[p,f]=c({isError:!1,error:""}),[g,m]=c({isError:!1,error:""}),w=o(null),b=o(null),[v,y]=c(Array.isArray(r?.value)?new Date(r?.value[0])??null:new Date(r?.value)??null),[B,C]=c(Array.isArray(r?.value)?new Date(r?.value[1])??null:null),[x,F]=c(r?.option??(u?"today":"all")),N="custom"===x?{style:{width:"40%"}}:{fullWidth:!0};return l((()=>{v||y(new Date),B||C(new Date)}),[v,B]),e(ie,{item:!0,xs:12,...a,sm:"custom"===x?12:6,md:"custom"===x?12:6,children:i("div",{style:{width:"100%",display:"flex"},tabIndex:1,onBlur:e=>{let t=Q(new Date,"iii LLL dd yyyy HH:mm:ss xxxx"),i=Q(new Date,"iii LLL dd yyyy HH:mm:ss xxxx");v instanceof Date&&!isNaN(v)&&(t=Q(v,"iii LLL dd yyyy HH:mm:ss xxxx")),B instanceof Date&&!isNaN(B)&&(i=Q(B,"iii LLL dd yyyy HH:mm:ss xxxx")),"today"===x?Boolean(u)?h({type:"removeValue",payload:{id:n}}):h({type:"setValue",payload:{condition:"equal",value:t,id:n,option:x,columnName:s,type:d?.type}}):("lastWeek"===x||"lastMonth"===x||"custom"===x)&&v instanceof Date&&B instanceof Date&&!isNaN(v)&&!isNaN(B)&&v<=B?h({type:"setValue",payload:{condition:"between",value:[t,i],id:n,option:x,columnName:s,type:d?.type}}):h({type:"removeValue",payload:{id:n}})},children:[e(Bo,{label:A(s),value:x,size:"small",touched:!0,error:"",handleChange:(e,t)=>{let i=new Date;"today"===e.target.value?Boolean(u)?(y(null),C(null)):y(i):"lastWeek"===e.target.value?(C(i),y(Ii(i,7))):"lastMonth"===e.target.value?(C(i),y(Ii(i,30))):"all"!==e.target.value&&"custom"!==e.target.value||(y(null),C(null)),F(e.target.value)},handleBlur:()=>!0,options:Boolean(u)?Vg:zg,_optionsKey:"dateRangePicker",optionsProps:{},disableCaching:!1,selectVariant:"regular",...N}),"custom"===x?i(t,{children:[e("span",{style:{width:"1%",textAlign:"center",marginTop:"32px"}}),e(Eo,{format:"dd/MM/yyyy",label:A("FromDate"),maxDate:new Date,onChange:e=>{if(ca(e)){if(y(e),w.current=e,e>new Date)return void f({isError:!0,error:A("Futuredatesarenotallowed")});us(B,e)?(null!==w.current&&f({isError:!1,error:""}),null!==b.current&&m({isError:!1,error:""})):f({isError:!0,error:A("FromDateshouldbelessthanorequaltoToDate")})}else{if(!e)return f({isError:!0,error:A("ThisFieldisrequired")}),void(w.current=null);if(!V(e))return f({isError:!0,error:A("Mustbeavaliddate")}),void(w.current=null)}},value:v??new Date,sx:{width:"30%"},slots:{textField:to},slotProps:{textField:{placeholder:"Start Date","aria-label":"Select Date",InputLabelProps:{shrink:!0},error:p.isError,helperText:p.error},actionBar:{actions:["today","cancel"]}}}),e("span",{style:{width:"1%",textAlign:"center",marginTop:"32px"}}),e(Eo,{format:"dd/MM/yyyy",label:A("ToDate"),onChange:e=>{if(ca(e))C(e),b.current=e,us(e,v)?(null!==b.current&&m({isError:!1,error:""}),null!==w.current&&f({isError:!1,error:""})):m({isError:!0,error:A("ToDateshouldbegreaterthanorequaltoFromDate")});else{if(!e)return m({isError:!0,error:A("ThisFieldisrequired")}),void(b.current=null);if(!V(e))return m({isError:!0,error:A("Mustbeavaliddate")}),void(b.current=null)}},value:B??new Date,sx:{width:"30%"},slots:{textField:to},slotProps:{textField:{placeholder:"End Date","aria-label":"Select Date",InputLabelProps:{shrink:!0},error:g.isError,helperText:g.error},actionBar:{actions:["today","cancel"]}}})]}):null]})})},qg=({filterValue:t,id:r,columnName:n,gridProps:s,dispatch:a,filterProps:o})=>{const{t:h}=ne(),[d,u]=c(Array.isArray(t?.value)?t?.value[0]:null),[A,p]=c(Array.isArray(t?.value)?t?.value[1]:null),[f,g]=c("");l((()=>{Number(d)>Number(A)&&A?.length>0?g("Min value is greater than max"):g("")}),[d,A]);return e(ie,{item:!0,xs:12,sm:6,md:6,...s,children:i($e,{fullWidth:!0,error:Boolean(f),tabIndex:1,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(!isNaN(Number(d))&&!isNaN(Number(A))&&d?.length&&A?.length&&Number(d)<=Number(A)?a({type:"setValue",payload:{condition:"between",value:[d,A],id:r,columnName:n,type:o.type}}):a({type:"removeValue",payload:{id:r}}))},sx:{"& label.Mui-focused":{color:"var(--theme-color1)"}},children:[e(Io,{shrink:!0,sx:{fontSize:"0.875rem !important"},children:h(n)}),i("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[e(Ht,{thousandSeparator:!0,thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,value:d,customInput:to,placeholder:"Min",onValueChange:e=>{isNaN(Number(e.value))||u(String(e.value))},style:{width:"48%"}}),e(Ht,{thousandSeparator:!0,thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,value:A,customInput:to,placeholder:"Max",onValueChange:e=>{isNaN(Number(e.value))||p(String(e.value))},style:{width:"48%"}})]}),Boolean(f)?e(Ze,{children:f}):null]})})},Gg=({filterValue:t,id:r,columnName:n,gridProps:s,dispatch:a,filterProps:o})=>{const{t:h}=ne(),[d,u]=c(Array.isArray(t?.value)?t?.value[0]:null),[A,p]=c(Array.isArray(t?.value)?t?.value[1]:null),[f,g]=c("");l((()=>{Number(d)>Number(A)&&A?.length>0?g("Min value is greater than max"):g("")}),[d,A]);return e(ie,{item:!0,xs:12,sm:6,md:6,...s,children:i($e,{fullWidth:!0,error:Boolean(f),tabIndex:1,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(!isNaN(Number(d))&&!isNaN(Number(A))&&d?.length&&A?.length&&Number(d)<=Number(A)?a({type:"setValue",payload:{condition:"between",value:[d,A],id:r,columnName:n,type:o.type}}):a({type:"removeValue",payload:{id:r}}))},sx:{"& label.Mui-focused":{color:"var(--theme-color1)"}},children:[e(Io,{shrink:!0,sx:{fontSize:"0.875rem !important"},children:h(n)}),i("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[e(Uo,{style:{width:"45%"},placeholder:"min",value:d,onChange:e=>{isNaN(Number(e.target.value))||u(e.target.value.trim())}}),e(Uo,{style:{width:"45%"},placeholder:"max",value:A,onChange:e=>{isNaN(Number(e.target.value))||p(e.target.value.trim())}})]}),Boolean(f)?e(Ze,{children:f}):null]})})},Wg=t=>{const{filterProps:i}=t;return"date"===i?.type||"dateTime"===i?.type?e(Kg,{...t}):"value"===i?.type?e(Gg,{...t}):"number"===i?.type?e(qg,{...t}):"amount"===i?.type?e(jg,{...t}):e(ie,{item:!0,md:6,sm:6,xs:12,children:"Range Component Type not set"})},Jg=e=>({"data-tag-index":e,tabIndex:-1,key:e}),Xg=({filterValue:t,id:i,columnName:r,gridProps:n,dispatch:s})=>{const[a,l]=c(""),[d,u]=c(t?.value??[]),[A,p]=c(-1),f=o(null),g=o(null),m=(e,t)=>{let i=A;-1===A?""===a&&"previous"===t&&(i=d.length-1):(i+="next"===t?1:-1,i<0&&(i=0),i===d.length&&(i=-1)),p(i),w(i)},w=h((e=>{-1===e?g.current.focus():f.current.querySelector(`[data-tag-index="${e}"]`).focus()}),[]);let b=null;Array.isArray(d)&&d.length>0&&(b=d.map(((t,i)=>e(mi,{label:t,size:"small",onDelete:()=>u([...d.slice(i,i+1),...d.slice(i+1)]),style:{margin:"4px 2px"},...Jg(i)}))));return e(ie,{item:!0,xs:12,sm:6,md:6,...n,children:e(no,{inputRef:g,label:r,InputLabelProps:{shrink:!0},onChange:e=>l(e.target.value),onBlur:()=>{Array.isArray(d)&&d.length>0?s({type:"setValue",payload:{condition:"in",value:d,id:i,columnName:r}}):s({type:"removeValue",payload:{id:i}})},fullWidth:!0,value:a,InputProps:{startAdornment:b,ref:f},onKeyDown:e=>{if(-1!==A&&-1===["ArrowLeft","ArrowRight"].indexOf(e.key)&&(p(-1),w(-1)),299!==e.which)switch(e.key){case"Enter":Boolean(a)&&(u((e=>[...e,a])),l(""));break;case"Backspace":if(""===a&&d.length>0){const e=-1===A?d.length-1:A,t=d.slice();t.splice(e,1),u(t)}break;case"ArrowLeft":m(0,"previous");break;case"ArrowRight":m(0,"next")}}})})},Yg=({filterValue:t,id:i,columnName:r,gridProps:n,dispatch:s})=>{const[a,o]=c(t?.value??"");return e(ie,{item:!0,xs:12,sm:6,md:6,...n,children:e(Eo,{label:r,value:""===a?null:new Date(a),onChange:e=>{o(e),isNaN(e)?s({type:"removeValue",payload:{id:i}}):s({type:"setValue",payload:{condition:"equal",value:e,id:i,columnName:r}})},sx:{width:"100%"},slots:{textField:to},slotProps:{textField:{variant:"standard",InputLabelProps:{shrink:!0}},actionBar:{actions:["today","cancel"]}}})})},$g=e=>()=>(console.log(`no method found for options at ${e}`),[{label:"Oops error occured",value:""}]),Zg=e=>Array.isArray(e)?e.map((e=>{const{filterComponentType:t,filterProps:i,...r}=e;switch(t){case"valueDateFilter":return{...r,Filter:Yg,filterProps:i};case"valueFilter":return{...r,Filter:Mg,filterProps:i};case"multiValueFilter":return{...r,Filter:Xg,filterProps:i};case"optionsFilter":{const{options:e,...t}=i;if("string"==typeof e){const i=ss.getFn(e??"NOT_EXIST_OPTIONS_FN",$g);return{...r,Filter:_g,filterProps:{options:i,_optionsKey:e,...t}}}return{...r,Filter:_g,filterProps:i}}case"rangeFilter":return{...r,Filter:Wg,filterProps:i};default:return{...r}}})):[],em=e=>Array.isArray(e)?e.reduce(((e,t)=>(!0===t.isHiddenColumn&&e.push(t.accessor),e)),[]):[],tm=({metaData:t,maxHeight:r,initialState:n,title:s,options:d,hideFooter:u,showSerialNoColumn:A=!1,onClose:f=null,reportName:g,dataFetcher:m=()=>[],autoFetch:w=!0,hideAmountIn:b=!1,reportID:v,retrievalType:y,onClickActionEvent:B=()=>{},otherAPIRequestPara:C={},hideHeader:x=!1,hideShowFiltersSwitch:F=!1,defaultFilter:N=[],hideStatusBar:S=!1,retrievalComponent:E,openDrawerFilter:T=!1,onDoubleClickAction:L,enableCaching:k=!1,dataTransformer:D=e=>e,reportTemplateCode:I="",enablePivot:U,actions:P=[],getReportData:O,disableFilters:R,headerToolbarStyle:Q={},enableEnterToFocus:H,focusScopeId:M="enter-to-focus-static-report"})=>{const{t:_}=ne(),{defaultExportConfig:j,enableEnterToFocus:z}=Ws(),V=a((()=>({...t,columns:[{accessor:"SRNO",width:100,disableFilters:!0,type:"default",...t?.sequenceColumnConfig,columnName:t?.sequenceColumnConfig?.columnName??"SrNo"},...t.columns]})),[t]),K=em(V.columns),q=a((()=>({...V,hiddenColumns:K})),[K]),G=a((()=>{if(Array.isArray(q.columns))return q.columns.map((e=>({...e,columnName:_(e.columnName)})))}),[_,q]),W=a((()=>T?Zg(q?.filters):q.filters),[]),[J,X]=c(w),[Y,Z]=c([...N]),ee=h((e=>{$(Y,e)||(Z(e),X(!0))}),[X,Z,Y]),te=a((()=>({Header:Tc,Cell:wc,Footer:Nc,Footer1:Sc,Aggregated:wc})),[]),ie=a((()=>({fuzzyText:Pg,customText:Og,filterGreaterThan:Rg,customInclude:Qg})),[]),{data:re,isFetching:se,isLoading:ae,isError:oe,error:le,refetch:he}=zt([m,v,Y,C],(()=>m(v,Y,C)),{cacheTime:k?36e5:0,enabled:J}),ce=a((()=>re?.map(((e,t)=>({SRNO:String(t+1),...e})))),[re]),de=h(((e,t)=>{se||ae||oe||!J||B(e,t,re[e],Y)}),[re]),ue=o(null),Ae=H??z,pe=M&&Ae?{"data-scope-id":M}:{};return l((()=>{Ae&&ue.current&&ue.current.focus()}),[Ae]),i(p,{children:[oe?e(Va,{severity:"error",errorMsg:le?.error_msg??"Unknown Error occured",errorDetail:le?.error_detail}):null,e(Bc,{children:e("div",{ref:ue,tabIndex:0,style:{width:"100%",position:"relative"},onKeyDown:e=>{Ae&&ma(e,M)},...pe,children:e(Ug,{columns:G,defaultColumn:te,defaultHiddenColumns:q.hiddenColumns,data:D(ce)??[],maxHeight:r??450,containerHeight:q?.containerHeight,occupiedHeight:q?.occupiedHeight,initialState:n,filterTypes:ie,title:s+" ",options:d,loading:se||ae,hideFooter:"Y"===u||!0===u,showSerialNoColumn:"Y"===A||!0===A,onClose:f,setQueryFilters:ee,filterMeta:W,queryFilters:Y,hideStatusBar:"Y"===S||!0===S,hideAmountIn:"Y"===b||!0===b,retrievalType:y,onButtonActionHandel:de,isOpenRetrievalDefault:!w,hideHeader:"Y"===x||!0===x,hideShowFiltersSwitch:"Y"===F||!0===F,refetchData:()=>he(),retrievalComponent:E,openDrawerFilter:T,onDoubleClickAction:L,enablePdfPrint:q?.enablePdfPrint??j?.enablePdfPrint??!1,reportTemplateCode:ce?.find((e=>e?.REPORT_PERSONALIZATION_ID))?.REPORT_PERSONALIZATION_ID??I,enablePivot:U&&ce?.length>0,actions:P,getReportData:O,disableFilters:R,headerToolbarStyle:Q,enableEnterToFocus:Ae})})})]})},im=({column:{filterValue:t,preFilteredRows:i,setFilter:r}})=>{const n=i.length,{t:s}=ne();return e(_t,{value:t||"",onChange:e=>{e.target.value.length<=100&&r(e.target.value||void 0)},fullWidth:!0,size:"small",variant:"outlined",placeholder:`${s("Searched")} ${n} ${s("records")}`})};var rm=Object.freeze({__proto__:null,DefaultColumnFilter:im,NumberRangeColumnFilter:({column:{filterValue:t=[],preFilteredRows:r,setFilter:n,id:s}})=>{const[o,l]=a((()=>{let e=r.length?r[0].values[s]:0,t=r.length?r[0].values[s]:0;return r.forEach((i=>{e=Math.min(i.values[s],e),t=Math.max(i.values[s],t)})),[e,t]}),[s,r]);return i("div",{style:{display:"flex",alignItems:"baseline"},children:[e(_t,{value:t[0]||"",type:"number",onChange:e=>{const t=e.target.value;n(((e=[])=>[t?parseInt(t,10):void 0,e[1]]))},placeholder:`Min (${o})`,fullWidth:!0,size:"small",variant:"outlined"}),e("span",{children:"to"}),e(_t,{value:t[1]||"",type:"number",onChange:e=>{const t=e.target.value;n(((e=[])=>[e[0],t?parseInt(t,10):void 0]))},placeholder:`Max (${l})`,fullWidth:!0,size:"small",variant:"outlined"})]})},SelectColumnFilter:({column:{filterValue:t,setFilter:r,preFilteredRows:n,id:s,multiple:o}})=>{const{t:l}=ne(),h=a((()=>{const e=new Set;return n.forEach((t=>{e.add(t.values[s])})),[...e.values()]}),[s,n]);return o&&!Array.isArray(t)&&(t=[t]),i(_t,{value:t??"",onChange:e=>{r(e.target.value||void 0)},fullWidth:!0,variant:"outlined",size:"small",select:!0,SelectProps:{multiple:o},children:[e(te,{value:"",children:l("All")},"default"),h.map(((t,i)=>e(te,{value:t,children:t},i)))]})},SliderColumnFilter:({column:{filterValue:t,setFilter:i,preFilteredRows:r,id:n}})=>{const[s,o]=a((()=>{let e=r.length?r[0].values[n]:0,t=r.length?r[0].values[n]:0;return r.forEach((i=>{e=Math.min(i.values[n],e),t=Math.max(i.values[n],t)})),[e,t]}),[n,r]);return e(It,{min:s,max:o,value:t||s,onChange:(e,t)=>{i(parseInt(t))}})}});const nm=Ci((e=>({root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),background:"var(--theme-color1)"},title:{flex:"1 1 100%",color:"var(--white)",letterSpacing:"1px",fontSize:"2rem"}}))),sm=({footerGroup:t,loading:i})=>e(hi,{...t.getFooterGroupProps(),component:"div",children:t.headers.map((t=>e(ci,{...t.getFooterProps([{style:{textAlign:t?.alignment??"unset",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 20px 0px 10px",lineHeight:"34px",backgroundColor:"var(--theme-color2)"}}]),component:"div",children:t.render("Footer",{loading:i})})))}),am=({columns:r,defaultColumn:n,data:s,filterTypes:d,title:u,options:A,loading:f=!1,isError:g=!1,hideFooter:m=!1,showSerialNoColumn:w=!1,onClose:b=null,setQueryFilters:v,filterMeta:y,queryFilters:B,hideAmountIn:x,onButtonActionHandel:F,hideHeader:N=!1,pageSizes:S=[20,30,40],pageCount:E,totalRecords:T,onFetchData:L,defaultPageSize:k=20,defaultSortOrder:D=[],defaultHiddenColumns:I=[],enablePagination:U=!0,enablePdfPrint:P,onDoubleClickAction:O,defaultFilter:R,disableFilters:Q,containerHeight:H,occupiedHeight:M,headerToolbarStyle:_,enableEnterToFocus:j})=>{const z=nm(),[V,K]=c(!1),[q,G]=c(!1),{t:W}=ne(),{disableColumnFilters:J}=Ws(),X=a((()=>r.some((e=>e.isTotalWithCurrency||e.isTotalWithoutCurrency))),[r]),Y=a((()=>r.map((e=>({...e,disableFilters:e?.disableFilters??Q??J??!1,filter:Ng})))),[r,Q,J]),$=Gt({columns:Y,data:s,defaultColumn:n,filterTypes:d,onButtonActionHandel:F,autoResetGlobalFilter:!1,autoResetFilters:!1,autoResetGroupBy:!1,autoResetSortBy:!1,initialState:{pageIndex:0,pageSize:k,hiddenColumns:I,sortBy:D},...A,manualPagination:!0,pageCount:E,autoResetPage:!1},ri,Xt,Yt,$t,ti,ii,ug(w),F,Zt),{getTableProps:Z,getTableBodyProps:ee,headerGroups:te,footerGroups:ie,rows:re,page:se,prepareRow:oe,pageOptions:le,totalColumnsWidth:he,toggleAllRowsExpanded:ce,isAllRowsExpanded:de,setAllFilters:ue,gotoPage:pe,setPageSize:fe,setSortBy:ge,state:{filters:me,pageIndex:we,pageSize:be,sortBy:ve}}=$,ye=h((({index:t,style:i})=>{if(0===se.length)return;const r=se[t];return oe(r),e(hi,{...r.getRowProps({style:i}),id:r.id,tabIndex:0,onDoubleClick:()=>{"function"==typeof O&&O({row:[{data:r?.original,id:r?.id}]})},children:r.cells.map(((e,t)=>{const{key:i}=e.getCellProps();return e.render("Cell",{key:i,index:t})}))})}),[oe,se]),Be=qt(L,500),Ce=a((()=>re.reduce(((e,t)=>(t?.original?._hidden||++e,e)),0)),[re]);l((()=>{ue([])}),[B]),l((()=>{Be({pageIndex:we,pageSize:be,sortBy:ve,filters:B})}),[Be,we,be,ve,B]),l((()=>{if(0===B?.length&&R?.length>0)v(R);else if(R?.length>0){const e=R.filter((e=>!B.some((t=>e.id===t.id)))).concat(B);JSON.stringify(e)!==JSON.stringify(B)&&v(e)}}),[B,R,v]),l((()=>{R?.length>0&&G(R.some((e=>"date"===e?.value?.type||"dateTime"===e?.value?.type)))}),[R]);const xe=a((()=>{const e=e=>{const t=Array.isArray(B)&&B.length>0?`calc(${H?.[e]??"73.5vh"} - 48px)`:H?.[e]??"73.5vh";return t&&M?.[e]?`calc(${t} - ${M?.[e]})`:t};return{min:e("min"),max:e("max")}}),[B,H,M]),Fe=o(null),[Ne,Se]=c({});return l((()=>{if(!Fe.current)return;const e=()=>{const e=Fe.current,t=getComputedStyle(e),i=parseFloat(t.minHeight),r=parseFloat(t.maxHeight);Se({min:i,max:r})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[re]),i(p,{children:[i(ni,{style:{width:"100%",overflow:"hidden",marginBottom:"8px",display:N?"none":"inherit"},className:"not-printed",children:[i(si,{className:"server__report__header",variant:"dense",sx:{width:"100%",background:"var(--primary-bg)",..._},children:[e(vt,{variant:"h5",color:"primary",children:u.trim()}),e("div",{style:{flexGrow:1}}),me.length>0&&e(ae,{onClick:()=>{ue([])},style:{marginRight:"8px",color:"white"},children:W("ClearFilter")}),y&&y.length?e(Ul,{setAllFilters:v,filters:B,filterMeta:y,gotoPage:pe,setSortBy:ge,classes:z,isDefaultFilter:q}):null,e(C,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:()=>Be({pageIndex:we,pageSize:be,sortBy:ve,filters:B}),color:"primary",children:e(qi,{})}),Boolean(x)?null:e(Fc,{}),te.some((e=>e.headers.some((e=>!0===e.isGrouped))))?e(Ae,{control:e(He,{onChange:()=>ce(!de),checked:de,name:"filters",size:"small",color:"primary"}),style:{color:"var(--white)",marginLeft:0},label:W("ExpandRows")}):e(t,{children:!f&&!g&&se.length>0?e(Ae,{control:e(tl,{title:W("Showexportoptions"),arrow:!0,children:i(ae,{onClick:()=>{K(!0)},style:{marginTop:"0px",marginLeft:"10px",color:"white"},disabled:f,children:[W("Export")," ",e(Gi,{})]})}),style:{color:"var(--white)"},label:""}):null}),"function"==typeof b?e(tl,{title:W("Close"),arrow:!0,children:e(C,{onClick:b,size:"small",children:e(Bt,{style:{color:"var(--white)"}})})}):null]}),B.length?e(Xl,{dense:!0,setAllFilters:v,filters:B,gotoPage:pe,setSortBy:ge}):null]}),f&&e(gt,{color:"secondary"}),i(ni,{style:{width:"100%",overflow:"hidden"},tabIndex:0,children:[e(ai,{ref:Fe,sx:{position:"relative",maxHeight:xe.max,minHeight:xe.min},children:i(oi,{...Z(),size:"small",component:"table",children:[e(li,{component:"thead",children:te.map((t=>e(hi,{...t.getHeaderGroupProps(),component:"tr",children:t.headers.map(((t,r)=>i(ci,{...t.getHeaderProps([{style:{display:"flex",padding:0===r?"0 10px":"0px 10px 0 0",alignItems:"center"}}]),component:"th",align:t.alignment,children:[t.render("Header"),t.canFilter?e(Lg,{column:t,filters:me,enableEnterToFocus:j}):null]})))})))}),f||g?null:e(di,{...ee({}),component:"tbody",children:e(Ei,{height:(Ne?.min??300)-(X?72:38),itemCount:se.length,itemSize:35,width:he+10,overscanCount:10,children:ye})}),g?e("div",{style:{position:"absolute",left:"50%",top:"50%",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:W("Somethingwenttowrong")}):null,re.length<=0&&!1===f?e("div",{style:{position:"absolute",left:"50%",top:"50%",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:W("Nodatafound")}):null,f||m?null:e(li,{component:"div",children:e(sm,{footerGroup:ie[0],loading:f})})]})}),m?null:U?e(Qe,{sx:{display:"flex",overflowY:"hidden","& .MuiToolbar-root":{display:"flex",alignItems:"baseline",transform:"translateY(5.5px)"}},variant:"body",component:"div",rowsPerPageOptions:S,colSpan:3,count:g||f?0:Number(T),rowsPerPage:Number(be),page:g||f?0:Number(we),onPageChange:(e,t)=>{pe(t)},onRowsPerPageChange:e=>{fe(Number(e.target.value))},ActionsComponent:Kl}):i(ci,{style:{display:"flex",color:"var(--theme-color1)",fontWeight:"bold",padding:"10px"},children:[W("TotalNoofRecords"),": ",Ce]}),V?e(hd,{filters:me,queryFilters:B,title:u.trim(),rows:re,columns:r,pageNumber:we,totalPageCount:le.length,onClose:()=>{K(!1)},enablePdfPrint:P,enableEnterToFocus:j}):null]})]})},om=({metaData:t,maxHeight:r,containerHeight:n,occupiedHeight:s,initialState:d,title:u,options:A,hideFooter:f,showSerialNoColumn:g=!1,onClose:m=null,reportName:w,dataTransformer:b=e=>e,autoFetch:v=!0,hideAmountIn:y=!1,retrievalType:B,onClickActionEvent:C=()=>{},hideHeader:x=!1,hideShowFiltersSwitch:F=!1,defaultFilter:N=[],hideStatusBar:S=!1,data:E,loading:T,isError:L,error:k,pageCount:D,totalRecords:I,pageSizes:U,defaultPageSize:P,onFetchData:O,onDoubleClickAction:R,disableFilters:Q,headerToolbarStyle:H,enableEnterToFocus:M,focusScopeId:_})=>{const{t:j}=ne(),{defaultExportConfig:z,enableEnterToFocus:V}=Ws(),K=a((()=>{if(Array.isArray(t.columns))return t.columns.map((e=>({...e,columnName:j(e.columnName)})))}),[j]),q=a((()=>Zg(t.filters)),[t.filters]),[G,W]=c(v),[J,X]=c([]),Y=h((e=>{X(e),W(!0)}),[W,X]),$=a((()=>({Header:Tc,Cell:wc,Footer:Nc,Filter:im,Aggregated:wc})),[]),Z=a((()=>({fuzzyText:Pg,customText:Og,filterGreaterThan:Rg,customInclude:Qg})),[]),ee=h(((e,t)=>{T||L||!G||C(e,t,E[e])}),[E]),te=o(null),ie=M??V,re=_&&ie?{"data-scope-id":_}:{};return l((()=>{ie&&te.current&&te.current.focus()}),[ie]),i(p,{children:[L&&e(Va,{severity:"error",errorMsg:k?.error_msg??"Unknown Error occured",errorDetail:k?.error_detail}),e(Bc,{children:e("div",{ref:te,tabIndex:0,style:{width:"100%",position:"relative"},onKeyDown:e=>{ie&&ma(e,_)},...re,children:e(am,{columns:K,defaultColumn:$,defaultHiddenColumns:t.hiddenColumns,data:b(E)??[],maxHeight:r??450,containerHeight:n,occupiedHeight:s,filterTypes:Z,title:u+" ",options:A,loading:T,isError:L,hideFooter:("string"!=typeof f||"N"!==f)&&Boolean(f),showSerialNoColumn:g,onClose:m,setQueryFilters:Y,defaultFilter:N,filterMeta:q,queryFilters:J,hideStatusBar:S,hideAmountIn:y,onButtonActionHandel:ee,isOpenRetrievalDefault:!v,hideHeader:x,hideShowFiltersSwitch:F,onFetchData:O,totalRecords:I,pageSizes:U,pageCount:D,defaultPageSize:P,enablePdfPrint:t?.enablePdfPrint??z?.enablePdfPrint??!1,onDoubleClickAction:R,disableFilters:Q,headerToolbarStyle:H,enableEnterToFocus:ie})})})]})},lm=({reportID:t,reportName:i,metaData:r,getAPIFn:n,otherAPIRequestPara:s,maxHeight:l,onClickActionEvent:d,defaultFilter:u,onDoubleClickAction:A,disableFilters:p,options:f,headerToolbarStyle:g={},enableEnterToFocus:m,focusScopeId:w="enter-to-focus-server-report"})=>{const{t:b}=ne(),[v,y]=c([]),[B,C]=c(null),[x,F]=c(0),[N,S]=c(0),E=o(null),T=o(null),L=Vt(n,{onError:e=>{C(e)},onSuccess:e=>{y(e?.[0].REPORT_DATA),S(Math.ceil(Number(e?.[0].COUNT??1)/Number(E.current?.pageSize??20))),F(Number(e?.[0].COUNT??1))}}),k=h((({pageSize:e,pageIndex:i,filters:r,sortBy:n})=>{const a=Number(e)*Number(i)+1,o=Number(a)+Number(e)-1;let l=((e=[])=>(Array.isArray(e)||(e=[e]),e.map(((e,t)=>({ACCESSOR:e.id,CONDITION:e.value.condition,VALUE:e.value.value,TYPE:e.value?.type??""})))))(r),h=((e=[])=>e.map(((e,t)=>({ACCESSOR:e.id??"",VALUE:e?.desc?"desc":"asc"}))))(n);T.current&&T.current?.abort?.(),T.current=new AbortController;const c={reportID:t,APIRequestPara:{FROM_ROW:a,TO_ROW:o,FILTER_CONDITIONS:l,ORDERBY_COLUMNS:h,IS_PAGE:!0,...s},abortAPICall:T.current};E.current={pageSize:e},L.mutate(c)}),[F,y]),D=a((()=>({...r,columns:[{accessor:"ROW_SR_CD_",width:100,disableFilters:!0,type:"default",...r?.sequenceColumnConfig,columnName:r?.sequenceColumnConfig?.columnName??"SrNo"},...r.columns]})),[r]),I=em(D.columns),U=a((()=>({...D,hiddenColumns:I})),[I]);return e(om,{metaData:U,maxHeight:l,reportName:i,containerHeight:D?.containerHeight,occupiedHeight:D?.occupiedHeight,title:b(D.title),hideFooter:D.hideFooter,hideAmountIn:D.hideAmountIn,onClickActionEvent:d,options:f,autoFetch:!0,data:v,loading:L.isLoading,isError:L.isError,error:B,pageCount:N,totalRecords:x,pageSizes:D?.pageSize??[25,50,100,250,500,2500,5e3,1e4,5e4,1e5],defaultPageSize:D.defaultPageSize??25,onFetchData:k,defaultFilter:u,onDoubleClickAction:A,disableFilters:p,headerToolbarStyle:g,enableEnterToFocus:m,focusScopeId:w})};Ka(".ag-theme-alpine{--ag-header-background-color:var(--theme-color4)!important;--ag-header-foreground-color:var(--theme-color1)!important;--ag-row-hover-color:none;--ag-font-weight:600;--ag-font-family:Roboto,sans-serif;--ag-height:30px!important}.ag-header-cell-label{color:var(--theme-color1)!important;cursor:default;font-family:Roboto,Helvetica,Arial,sans-serif;font-size:.875rem;font-weight:600;opacity:1;overflow:hidden;text-transform:capitalize}.ag-header-cell{border-radius:8px}.ag-cell{border-right:1px solid #fff}.ag-cell.currency{text-align:right}.ag-row.ag-row-pinned{background:var(--theme-color4)!important;border:none!important;line-height:22px;pointer-events:none;text-align:center}.ag-floating-bottom{border-top:none!important;height:23px!important;min-height:23px!important}.ag-row.ag-row-pinned .ag-cell{border:none!important;color:var(--theme-color3);font-size:small;font-weight:700;height:23px!important;line-height:inherit;min-height:23px!important;overflow:hidden;padding:0 10px;text-overflow:ellipsis;white-space:nowrap}.error-border{border:1px solid #d32f2f!important;border-radius:2px}.cell-placeholder{color:var(--theme-color6)!important;cursor:default;font-family:Roboto,Helvetica,Arial,sans-serif;font-size:.875rem;height:15px;opacity:1;overflow:hidden;text-transform:capitalize}.main-container{padding:10px}.cell-value{color:#000;font-family:Roboto,Helvetica,Arial,sans-serif;font-size:.875rem;height:15px}.ag-cell .MuiAutocomplete-root .MuiOutlinedInput-root{padding:0!important}.ag-cell .MuiOutlinedInput-root .MuiAutocomplete-input{padding:4.5px 4px 4.5px 5px}.ag-cell .MuiOutlinedInput-notchedOutline{border:none!important}");const hm=({rowIndex:e,agGridReact:t,data:i,node:r,...n})=>r.rowPinned?"":r.rowIndex+1,cm=e=>{let t;return t="string"==typeof e?Number(e.replace(/,/g,"")):e,Number.isNaN(t)?0:parseFloat(t.toFixed(Number(process.env.SYSTEM_DECIMAL_LENGTH)||3))},dm=e=>{let t=e.values.reduce(((e,t)=>e+cm(t)),0);return cm(t)},um=e=>{if(!e)return null;const t="string"==typeof e?j(e,"dd/MM/yyyy",new Date):new Date(e);return V(t)?t:null},Am=(e,t)=>{if(e){const i=e.current.getAllDisplayedColumns().filter((e=>{const{editable:i}=e.colDef;return"function"==typeof i?i(t):!0===i}));if(!i.length)return;return i[i.length-1]}},pm=(e,t)=>{if(e){const i=e.current.getAllDisplayedColumns().filter((e=>{const{editable:i}=e.colDef;return"function"==typeof i?i(t):!0===i}));if(!i.length)return;return i[0]}},fm=e=>{if(!e.current)return[];const t=[];return e.current.forEachNode((e=>t.push(e.data))),t},gm=async e=>{const t=fm(e);t.length>0&&(await e.current.applyTransaction({remove:t}),await e.current.applyTransaction({add:[{}]}))},mm=(e,t)=>{X(e)?(t.api.getRowNode(t.node.id)?.setRowHeight(30),t.api.onRowHeightChanged()):(t.api.getRowNode(t.node.id)?.setRowHeight(45),t.api.onRowHeightChanged())},wm=e=>isNaN(e)?0:`₹ ${e.toFixed(2)}`,bm=(e,t,i)=>("string"==typeof e&&(e=j(e,"dd/MM/yyyy",new Date)),"string"==typeof t&&(t=j(t,"dd/MMM/yyyy",new Date)),i?.ignoreTime&&(e=new Date(e).setHours(0,0,0,0),t=new Date(t).setHours(0,0,0,0)),M(e,t)),vm=(e,t,i="")=>{const r=[...(e.data.errors||[]).filter((e=>e.field!==t)),{field:t,message:i}];e.setData({...e.data,errors:r})},ym=async e=>{const{context:t,node:i,api:r}=e,n=[];if(r.forEachNode((e=>n.push(e.data))),1===n.length)await t.MessageBox({messageTitle:"Delete Row",message:"You can not delete last row.",icon:"ERROR",buttonNames:["Ok"]});else{"Yes"===await t.MessageBox({messageTitle:"confirmation",message:"Are you sure want to delete row ?",buttonNames:["Yes","No"],defFocusBtnName:"Yes",icon:"CONFIRM"})&&(r.applyTransaction({remove:[i.data]}),t.updatePinnedBottomRow())}},Bm=d(((r,n)=>{const{value:s,colDef:{cellEditorParams:a,field:h,name:d},node:u,onValueChange:p,api:f,context:g}=r,{postValidationSetCrossAccessorValues:m=()=>{}}=a||{},w=o(null),b=o(-1),[v,y]=c(!1),[B,C]=c([]),[x,F]=c(!0);l((()=>{let e=r.context.state?.[h]||[];e?.length?(C(e),F(!1)):(async()=>{if("function"==typeof a?.options){F(!0);try{const e=await a.options();r.context.updateState(h,e),C(e||[])}catch(e){C([])}finally{F(!1)}}})()}),[]);const N=()=>!s||"object"==typeof s&&X(s)?null:B.find((e=>e.value===s?.value||e.value===s))||null,[S,E]=c(N());l((()=>{E(N())}),[B]);const T=(e,t)=>{if(t){E(t);const e={...u.data,[h]:t?.value,[d]:t?.label};u.setData(e),p(t?.value)}};A(n,(()=>({getValue:()=>S?S.value:null})));const L=async e=>{y(!1),"function"==typeof m&&await m(S,u,f,h,p,g),-1!==b.current&&B[b.current]&&(await T(0,B[b.current]),"function"==typeof m&&await m(B[b.current],u,f,h,p,g))},k=()=>{if(X(s)){const e={...u.data,[h]:void 0};u.setData(e),p(void 0),E(void 0)}y(!0)};if(l((()=>{w.current&&w.current.focus()}),[]),u?.rowPinned)return null;const D=u.data?.errors?.find((e=>e.field===h));return i(t,{children:[e(Le,{id:"item-cell-editor",value:S,onChange:T,options:B,loading:x,getOptionLabel:e=>e.label,isOptionEqualToValue:(e,t)=>e.value===t?.value,open:v,onOpen:()=>y(!0),onClose:()=>y(!1),onHighlightChange:(e,t)=>{b.current="mousemove"!==e?.type?B.indexOf(t):-1},sx:{padding:"0px"},renderInput:r=>e(Me,{...r,variant:"outlined",inputRef:w,onFocus:k,onClick:k,onBlur:L,placeholder:"Select an option",InputProps:{...r.InputProps,endAdornment:i(t,{children:[x?e(be,{color:"inherit",size:20}):null,r.InputProps.endAdornment]})}}),fullWidth:!0}),Z(u.data?.errors)&&D?e(pe,{title:G(D.message),arrow:!0,children:e(we,{style:{marginTop:"0px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},error:!0,children:G(D.message)})}):null]})})),Cm=d(((t,i)=>{const{value:r,node:n,colDef:s={},api:a,context:o={}}=t,{cellRendererParams:l={},shouldExclude:h}=s,{disabled:c=!1,handleButtonClick:d=()=>{},buttonName:u="Remove"}=l;A(i,(()=>({getValue:()=>r})));const p="function"==typeof c?c(t):c;if(n?.rowPinned)return null;const f="function"==typeof h&&h(t),g="function"==typeof u?u(t):u;return f?null:e(ae,{fullWidth:!0,variant:"contained",color:"secondary",style:{height:"23px",backgroundColor:p?"var(--theme-color7) !important":"var(--theme-color1) !important"},onClick:async()=>{await d(t)},disabled:p,children:g})})),xm=d(((r,n)=>{const{value:s,colDef:{field:a,cellEditorParams:h},node:d,api:u,onValueChange:p,context:f}=r,{postValidationSetCrossAccessorValues:g}=h||{},{commonDateFormat:m="dd/MM/yyyy"}=Ws(),[w,b]=c((()=>{const e=um(s);return V(e)?e:null})),v=o(null);A(n,(()=>({getValue:()=>w?z(w,m):""}))),l((()=>{v.current&&setTimeout((()=>{v.current?.focus()}),0)}),[]),l((()=>{if(!s){const e=new Date;b(e);const t=z(e,m),i={...d.data,[a]:t};d.setData(i),p?.(t)}}),[s]);if(d?.rowPinned)return null;const y=d.data?.errors?.find((e=>e.field===a));return i(t,{children:[e(tr,{dateAdapter:Qi,children:e(ir,{defaultValue:new Date,format:"dd/MM/yyyy",value:w,onChange:e=>{if(!e||!V(e)){const e=new Date;b(e);const t=z(e,m),i={...d.data,[a]:t};return d.setData(i),void p?.(t)}b(e);const t=z(e,m),i={...d.data,[a]:t};d.setData(i),p?.(t)},slotProps:{textField:{onBlur:async()=>{"function"==typeof g&&await g(w,d,u,a,p,f)},variant:"outlined",fullWidth:!0,size:"small",inputRef:v}},sx:{"& input":{border:"none",padding:"4px 4px",textAlign:"center"},"& fieldset":{border:"none"}}})}),Z(d.data?.errors)&&y?e(pe,{title:G(y.message),arrow:!0,children:e(we,{style:{marginTop:"0px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},error:!0,children:G(y.message)})}):null]})})),Fm=({fieldError:t})=>{const{i18n:i}=ne();return e(ki,{title:i.t(t.message),arrow:!0,children:e("span",{style:{display:"block",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",color:"#d32f2f",fontSize:"0.75rem",marginTop:"7px",cursor:"pointer"},children:i.t(t.message)})})},Nm=d(((r,n)=>{const{value:s="",colDef:{cellEditorParams:{postValidationSetCrossAccessorValues:a=()=>{},uppercase:h=!1,defaultValue:d="",isNumber:u=!1,inputProps:p={},allowNegative:f=!0,allowLeadingZeros:g=!0,isAllowed:m=()=>!0,allowAlphaNumeric:w=!1}={},field:b,alignment:v="left"},node:y,api:B,onValueChange:C,context:x}=r,[F,N]=c(s),S=o(null),[E,T]=c(!1);A(n,(()=>({getValue:()=>F}))),l((()=>{S.current&&setTimeout((()=>{S.current?.select()}),0)}),[]);const L=y.data?.errors?.find((e=>e.field===b));return i(t,{children:[e(Me,{defaultValue:d,variant:"outlined",fullWidth:!0,size:"small",value:F,inputRef:S,onFocus:()=>{S.current?.select(),y.setDataValue("disableChequeDate",void 0)},InputProps:{...p,endAdornment:E?e(be,{size:20,color:"secondary"}):null},sx:{"& input":{textAlign:v,border:"none",padding:"4px 4px"},"& fieldset":{border:"none"}},onChange:e=>{let t=e.target.value;if(u){if(t=t.replace(/[^0-9.\- ]/g,""),(t.match(/\./g)||[]).length>1)return;if(!f&&t.startsWith("-"))return;g||(t=t.replace(/^0+/,""))}else w||(t=t.replace(/[^a-zA-Z ]/g,""));if(h&&(t=t.toUpperCase()),m&&!m({value:t}))return;N(t);const i={...y.data,[b]:t};y.setData(i),C?.(t)},onBlur:async e=>{e.preventDefault(),"function"==typeof a&&await a(F,y,B,b,C,x)}}),Z(y.data?.errors)&&L?e(pe,{title:G(L.message),arrow:!0,children:e(we,{style:{marginTop:"0px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},error:!0,children:G(L.message)})}):null]})})),Sm={autocomplete:Bm,CustomButtonCellEditor:Cm,amountField:r=>{const{value:n=0,colDef:{cellEditorParams:{postValidationSetCrossAccessorValues:s,maxLength:a},field:h},node:d,api:u,onValueChange:A,context:p}=r,[f,g]=c(n),[m,w]=c(!1),{dynamicAmountSymbol:b}=Ws(),v=o(null);l((()=>{v.current&&setTimeout((()=>{v.current?.select()}),0)}),[]);if(d?.rowPinned)return null;const y=d.data?.errors?.find((e=>e.field===h));return i(t,{children:[e(Ht,{value:f,thousandSeparator:!0,decimalScale:2,fixedDecimalScale:!0,allowNegative:!1,customInput:Me,variant:"outlined",fullWidth:!0,size:"small",inputRef:v,onFocus:()=>{v.current&&v.current.select()},onValueChange:e=>{g(e.floatValue);const t={...d.data,[h]:e.floatValue};d.setData(t),A(e.floatValue)},onBlur:async()=>{"function"==typeof s&&await s(f,d,u,h,A,p)},sx:{"& input":{textAlign:"right",border:"none",padding:"4px 4px"},"& fieldset":{border:"none"}},InputProps:{style:{textAlign:"right"},startAdornment:e(ge,{position:"start",children:sl(b)}),endAdornment:e(ge,{position:"end",children:m&&e(be,{color:"secondary",size:20})})},valueIsNumericString:!1,isAllowed:e=>{const{value:t}=e;return void 0===t||(!a||t.length<=a)}}),Z(d.data?.errors)&&y?e(pe,{title:G(y.message),arrow:!0,children:e(we,{style:{marginTop:"0px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},error:!0,children:G(y.message)})}):null]})},NumberFormat:Nm,DatePickerCell:xm,DisplayCurrencyCell:t=>{const{dynamicAmountSymbol:r,decimalCount:n,currencyFormat:s}=Ws(),a=qd(isNaN(t.value)?0:parseFloat(t.value||"0"),sl(r),s,n),o="function"==typeof t.colDef.editable?t.colDef.editable(t):t.colDef.editable;if(l((()=>{t.eGridCell&&(t.eGridCell.style.backgroundColor=o?"transparent":"var(--theme-color7)")}),[o,t.eGridCell]),t.node?.rowPinned)return t.value??null;const h=t.node?.data?.errors||[],c=h.find((e=>e.field===t.colDef.field));h&&mm(h,t);return"function"==typeof t?.colDef?.shouldExclude&&t?.colDef?.shouldExclude(t)?null:e("div",{style:{display:"flex",flexDirection:"column"},children:e("span",{children:t.value||!X(c?.message)?i("div",{style:{display:"flex",flexDirection:"column"},children:[e("span",{className:"cell-value",children:t.value?a:""}),!X(c?.message)&&e(Fm,{fieldError:c})]}):e("span",{className:"cell-placeholder",children:"₹0.00"})})})},DisplayDateCell:t=>{const r=t.node?.data?.errors||[],n=r.find((e=>e.field===t.colDef.field));r&&mm(r,t);const s="function"==typeof t.colDef.editable?t.colDef.editable(t):t.colDef.editable;if(l((()=>{t.eGridCell&&(t.eGridCell.style.backgroundColor=s?"transparent":"var(--theme-color7)")}),[s,t.eGridCell]),t.node?.rowPinned)return t.value??null;return"function"==typeof t?.colDef?.shouldExclude&&t?.colDef?.shouldExclude(t)?null:e("div",{style:{display:"flex",flexDirection:"column"},children:e("span",{children:t.value||!X(n?.message)?i("div",{style:{display:"flex",flexDirection:"column"},children:[e("span",{className:"cell-value",children:t.value}),!X(n?.message)&&e(Fm,{fieldError:n})]}):e("span",{className:"cell-placeholder",children:t.colDef?.headerName})})})},DisplaySelectCell:t=>{const{value:r,colDef:{cellEditorParams:n,field:s,editable:a,headerName:o,name:h},node:c,context:d}=t,u=c?.data?.errors||[],A=u.find((e=>e.field===s));u&&mm(u,t);const p="function"==typeof a?a(t):a;if(l((()=>{let e=d.state?.[s]||[];if(X(e))(async()=>{if("function"==typeof n?.options){const e=await n.options();d.updateState(s,e);const t=e.find((e=>e?.value===r));t&&c.setData({...c.data,[h]:t?.label})}})();else{const t=e.find((e=>e?.value===r));t&&c.setData({...c.data,[h]:t?.label})}}),[]),l((()=>{t.eGridCell&&(t.eGridCell.style.backgroundColor=p?"transparent":"var(--theme-color7)")}),[p,t.eGridCell]),c?.rowPinned)return r||!1;return"function"==typeof t?.colDef?.shouldExclude&&t?.colDef?.shouldExclude(t)?null:e("div",{style:{display:"flex",flexDirection:"column"},children:e("span",{children:c.data?.[h]||r||!X(A?.message)?i("div",{style:{display:"flex",flexDirection:"column"},children:[e("span",{className:"cell-value",children:c.data?.[h]||r}),!X(A?.message)&&e(Fm,{fieldError:A})]}):e("span",{className:"cell-placeholder",children:o})})})},DisplayCell:t=>{const r=t.node?.data?.errors||[],n=r.find((e=>e.field===t.colDef.field));r&&mm(r,t);const s="function"==typeof t.colDef.editable?t.colDef.editable(t):t.colDef.editable;if(l((()=>{t.eGridCell&&(t.eGridCell.style.backgroundColor=s?"transparent":"var(--theme-color7)")}),[s,t.eGridCell]),t.node?.rowPinned)return t.value??null;return"function"==typeof t?.colDef?.shouldExclude&&t?.colDef?.shouldExclude(t)?null:e("div",{style:{display:"flex",flexDirection:"column"},children:e("span",{children:t.value||!X(n?.message)?i("div",{style:{display:"flex",flexDirection:"column"},children:[e("span",{className:"cell-value",children:t?.value}),!X(n?.message)&&e(Fm,{fieldError:n})]}):e("span",{className:"cell-placeholder",children:t.colDef?.headerName})})})}},Em={abortEarly:!1,strict:!1},Tm=(e,t,i)=>async(t,i,r)=>{try{await e.validate(t,Em);const n=(i.data.errors||[]).filter((e=>e.field!==r));i.setData({...i.data,errors:n})}catch(e){const t=[...(i.data.errors||[]).filter((e=>e.field!==r)),{field:r,message:e.message}];return i.setData({...i.data,errors:t}),e instanceof R.ValidationError?e.errors[0]:e.message}};const Lm=t=>{const{agGridProps:{columnDefs:i,rowData:n,id:d,onCellValueChanged:u=()=>{}},loading:A,defaultView:p,updatePinnedBottomRow:f=()=>{},handleCustomCellKeyDown:g,handleAddNewRow:m}=t,{i18n:w}=ne(),b=o(),[v,y]=c(d),B=a((()=>function(e,t){return e.map((e=>{const{accessor:i,columnName:r,componentType:n,FormatProps:s,className:a,hide:o,displayComponentType:l,headerTooltip:h,postValidationSetCrossAccessorValues:c,isVisible:d,options:u,isReadOnly:A,...p}=e;return{headerName:`${t.t(r)}`,headerTooltip:`${t.t(h)}`,headerValueGetter:()=>t.t(r),field:i,cellEditor:n||void 0,cellEditorParams:{postValidationSetCrossAccessorValues:c,...s,options:u},className:a,hide:!1===d&&!d,cellRenderer:l||"DisplayCell",cellStyle:t=>e.alignment?{textAlign:e.alignment}:{textAlign:"left"},..."agCheckboxCellEditor"===n&&{onCellValueChanged:async e=>{"function"==typeof c&&await c(e)}},editable:t=>{const i=t.context?.gridContext?.mode??"new",r={edit:e.__EDIT__,view:e.__VIEW__,new:e.__NEW__}[i.toLowerCase()];return"function"==typeof r?.isReadOnly?!r.isReadOnly(t):"function"==typeof A?!A(t):"boolean"==typeof r?.isReadOnly?!r.isReadOnly:"boolean"!=typeof A||!A},...p}}))}(i,w)),[i,w]),{MessageBox:C}=id(),{setGridData:x}=s(Dm),F=(e=>{const[t,i]=c({});return{...e,state:t,updateState:r.useCallback(((e,t)=>{i((i=>({...i,[e]:t})))}),[])}})({MessageBox:C,updatePinnedBottomRow:f,gridContext:t?.gridContext}),N=h((e=>{const{api:i}=e;b.current=i,i.autoSizeAllColumns(),t.getGridApi&&(t.getGridApi.current=i)}),[t.getGridApi]),S=h((e=>{const{api:i}=e;if(i.autoSizeAllColumns(),f(),t.autoSelectFirst){i.deselectAll();let e=i.getRowNode(0);e?.setSelected(!0,!0)}}),[t.autoSelectFirst]),E=a((()=>Sm),[]);return l((()=>{y(d||`table-${String(1e17*Math.random()).substring(0,15)}`)}),[d]),l((()=>{b.current&&(A?b.current.showLoadingOverlay():(b.current.hideOverlay(),n?.length||b.current.showNoRowsOverlay()))}),[A,b.current,n]),l((()=>{const e=()=>{b.current&&setTimeout((()=>{b?.current.sizeColumnsToFit()}),100)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[b]),l((()=>{b.current&&(b.current?.refreshHeader(),b.current.redrawRows())}),[w.language]),{gridApi:b,tableId:v,allColumns:B,gridContext:F,onGridReady:N,onFirstDataRendered:S,onCellKeyDown:async e=>{const{event:t,column:{colDef:i},api:r,node:n}=e;if("new"!==p)return;if("Tab"===t.key&&t.shiftKey)return;if("Tab"!==t.key&&"Enter"!==t.key)return;const s=Am(b,e),a=pm(b,e);if("function"==typeof g&&await g(e,s),"Enter"===t.key&&t.shiftKey)setTimeout((()=>{r.tabToPreviousCell()}),50);else if(i.field===s.colDef?.field){const e=r.getDisplayedRowCount(),t=!!r.getRowNode(e-1)?.data&&Object.values(r.getRowNode(e-1).data).every((e=>null==e||""===e)),i=n.rowIndex+1;t||e!==i||("function"==typeof m?m():b.current.applyTransaction({add:[{}]}),setTimeout((()=>{r.setFocusedCell(n.rowIndex+1,a?.colDef?.field),b.current.startEditingCell({rowIndex:n.rowIndex+1,colKey:a?.colDef?.field})}),50))}else setTimeout((()=>{"Enter"===t.key&&r.tabToNextCell()}),50)},onAddClick:()=>{"function"==typeof m?m():b.current.applyTransaction({add:[{}]});const e=[];b.current.forEachNode((t=>e.push(t.data)));const t={node:{data:e[e?.length-1]}},i=b.current.getAllDisplayedColumns().filter((e=>e.colDef?.cellEditorParams?.isFieldFocused))?.[0],r=pm(b,t);setTimeout((()=>{b.current.setFocusedCell(e.length-1,i?i?.colDef?.field:r?.colDef?.field),b.current.startEditingCell({rowIndex:e.length-1,colKey:i?i?.colDef?.field:r?.colDef?.field}),"function"==typeof f&&f()}),100)},components:E,onCellEditingStopped:async e=>{const{colDef:{field:t,schemaValidation:i,validate:r},node:n,api:s,value:a}=e,o=a??n?.data[t];if(x((e=>e.map(((e,i)=>i===n.rowIndex?{...e,[t]:o}:e)))),i){const e=(e=>{if(void 0===e)return;const{type:t,rules:i}=e;if(!R[t])return;if(!Array.isArray(i))return;let r=R[t]();return i.forEach((e=>{const{params:t,name:i}=e;r[i]&&(r=r[i](...t))})),Tm(r)})(i);e&&await e(o,n,t)}if(r){const i=r(e);if(i){const e=[...(n.data.errors||[]).filter((e=>e.field!==t)),{field:t,message:i}];n.setData({...n.data,errors:e})}else{const e=(n.data.errors||[]).filter((e=>e.field!==t));n.setData({...n.data,errors:e})}}},noDataComponent:()=>e("span",{style:{fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:w.t("NoDataFound")}),onCellValueChanged:u,i18n:w}},km=({buttons:i})=>i&&0!==i.length?e(t,{children:i.map(((t,i)=>e(za,{onClick:t.onClick,disabled:t.disabled,...t,children:t.label},i)))}):null;fr.registerModules([gr,mr,wr,br]);const Dm=n({gridData:[],setGridData:e=>{}}),Im=r.memo((t=>{const[r,n]=c(t.agGridProps.rowData||[]),{tableId:s,allColumns:a,gridContext:o,onGridReady:l,onFirstDataRendered:h,onCellKeyDown:d,onAddClick:u,components:A,onCellEditingStopped:p,noDataComponent:f,i18n:g,onCellValueChanged:m}=Lm({...t});t={...t,defaultColDef:{...t.defaultColDef,flex:1,suppressMovable:!0,unSortIcon:!0,resizable:!0,suppressSizeToFit:!0,onCellValueChanged:m}};const{hideHeader:w=!1,agGridProps:b={},defaultView:v="new",gridConfig:y={},buttons:B=[],isNewButtonVisible:C=!0,newButtonLabel:x}=t;return e(Dm.Provider,{value:{gridData:r,setGridData:n},children:i("div",{className:"main-container",children:[!w&&i(Ie,{style:{paddingLeft:"24px",paddingRight:"24px",background:"var(--primary-bg)",borderTopLeftRadius:"4px",borderTopRightRadius:"4px",minHeight:"48px",height:"48px",display:"flex",justifyContent:"space-between"},children:[i(fe,{style:{color:"var(--white)",fontWeight:"500",fontSize:"1.5rem !important",lineHeight:"1.6 !important",letterSpacing:"0.0075em !important"},color:"inherit",variant:"h6",children:[y.gridLabel," ",t.subLabel]}),i("div",{children:[C&&i(za,{onClick:u,children:[" ",x?g.t(x):g.t("new")]}),e(km,{buttons:B})]})]}),e("div",{className:"ag-theme-alpine custom-grid",style:{height:t.height||"400px",width:"100%"},children:e(vr,{onGridReady:l,...b,columnDefs:a,onFirstDataRendered:h,context:{...o,gridData:r,setGridData:n},rowData:X(r)?t.agGridProps?.rowData:r,rowHeight:30,headerHeight:35,onCellKeyDown:d,suppressClickEdit:!C,suppressCellFocus:!C,suppressHeaderFocus:!0,components:A,onCellEditingStopped:p,suppressMovableColumns:!0,noRowsOverlayComponent:f},s)})]})})})),Um=(e,t)=>isNaN(new Date(e)?.getTime())?e:z(new Date(e),t),Pm=(e,t,i)=>{if(!e||!Array.isArray(e))return"-";return qd(e.reduce(((e,i)=>{const r=Number(i[t.accessor]??0);return e+(isNaN(r)?0:r)}),0),t?.isVisibleCurrSymbol?sl(t?.currencySymbol??i.dynamicAmountSymbol):"",t?.currencyFormat??i.currencyFormat,t?.decimalCount??i.decimalCount,t?.symbolPosition??"start")},Om=(e,t)=>(e.data?e.data.reduce(((e,i)=>{const r=Number(i[t.accessor]||0);return e+(isNaN(r)?0:r)}),0):0)+(e.groups?e.groups.reduce(((e,i)=>e+Om(i,t)),0):0);Ka(".layout-report-parent td{padding:6px 10px!important}.layout-report-parent thead tr{background:var(--theme-color4)}.layout-report-parent .group-name{align-items:center;display:flex;white-space:nowrap}.layout-report-parent .footer-row{background-color:var(--theme-color4)}.layout-report-parent .footer-row td{color:var(--theme-color1);font-size:.875rem;font-weight:600!important;white-space:nowrap}.layout-report-parent .footer-row.p0 td{padding:0!important}");function Rm(e){return()=>e}function Qm(e){e()}function Hm(e,t){return i=>e(t(i))}function Mm(e,t){return()=>e(t)}function _m(e){return void 0!==e}function jm(){}function zm(e,t){return t(e),e}function Vm(e,t){return t(e)}function Km(...e){return e}function qm(e,t){return e(1,t)}function Gm(e,t){e(0,t)}function Wm(e){e(2)}function Jm(e){return e(4)}function Xm(e,t){return qm(e,function(e,t){return i=>e(t,i)}(t,0))}function Ym(e,t){const i=e(1,(e=>{i(),t(e)}));return i}function $m(e){let t,i;return r=>n=>{t=n,i&&clearTimeout(i),i=setTimeout((()=>{r(t)}),e)}}function Zm(e,t){return e===t}function ew(e=Zm){let t;return i=>r=>{e(t,r)||(t=r,i(r))}}function tw(e){return t=>i=>{e(i)&&t(i)}}function iw(e){return t=>Hm(t,e)}function rw(e){return t=>()=>{t(e)}}function nw(e,...t){const i=function(...e){return t=>e.reduceRight(Vm,t)}(...t);return(t,r)=>{switch(t){case 2:return void Wm(e);case 1:return qm(e,i(r))}}}function sw(e,t){return i=>r=>{i(t=e(t,r))}}function aw(e){return t=>i=>{e>0?e--:t(i)}}function ow(e){let t,i=null;return r=>n=>{i=n,!t&&(t=setTimeout((()=>{t=void 0,r(i)}),e))}}function lw(...e){const t=new Array(e.length);let i=0,r=null;const n=Math.pow(2,e.length)-1;return e.forEach(((e,s)=>{const a=Math.pow(2,s);qm(e,(e=>{const o=i;i|=a,t[s]=e,o!==n&&i===n&&r&&(r(),r=null)}))})),e=>s=>{const a=()=>{e([s].concat(t))};i===n?a():r=a}}function hw(e){let t=e;const i=dw();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return i(e,r)}}function cw(e,t){return zm(hw(t),(t=>Xm(e,t)))}function dw(){const e=[];return(t,i)=>{switch(t){case 0:return void e.slice().forEach((e=>{e(i)}));case 2:return void e.splice(0,e.length);case 1:return e.push(i),()=>{const t=e.indexOf(i);t>-1&&e.splice(t,1)}}}}function uw(e){return zm(dw(),(t=>Xm(e,t)))}function Aw(e,t=[],{singleton:i}={singleton:!0}){return{constructor:e,dependencies:t,id:pw(),singleton:i}}const pw=()=>Symbol();function fw(...e){const t=dw(),i=new Array(e.length);let r=0;const n=Math.pow(2,e.length)-1;return e.forEach(((e,s)=>{const a=Math.pow(2,s);qm(e,(e=>{i[s]=e,r|=a,r===n&&Gm(t,i)}))})),function(e,s){switch(e){case 2:return void Wm(t);case 1:return r===n&&s(i),qm(t,s)}}}function gw(e,t=Zm){return nw(e,ew(t))}function mw(...e){return function(t,i){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(Qm)}}(...e.map((e=>qm(e,i))))}}}var ww=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(ww||{});const bw={0:"debug",3:"error",1:"log",2:"warn"},vw=Aw((()=>{const e=hw(3);return{log:hw(((t,i,r=1)=>{var n;r>=(null!=(n=(typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL)?n:Jm(e))&&console[bw[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,i)})),logLevel:e}}),[],{singleton:!0});function yw(e,t,i){return Bw(e,t,i).callbackRef}function Bw(e,t,i){const n=r.useRef(null);let s=e=>{};const a=r.useMemo((()=>typeof ResizeObserver<"u"?new ResizeObserver((t=>{const r=()=>{const i=t[0].target;null!==i.offsetParent&&e(i)};i?r():requestAnimationFrame(r)})):null),[e,i]);return s=e=>{e&&t?(null==a||a.observe(e),n.current=e):(n.current&&(null==a||a.unobserve(n.current)),n.current=null)},{callbackRef:s,ref:n}}function Cw(e,t,i,n,s,a,o,l,h){const c=r.useCallback((i=>{const r=function(e,t,i,r){const n=e.length;if(0===n)return null;const s=[];for(let a=0;a<n;a++){const n=e.item(a);if(void 0===n.dataset.index)continue;const o=parseInt(n.dataset.index),l=parseFloat(n.dataset.knownSize),h=t(n,i);if(0===h&&r("Zero-sized element, this should not happen",{child:n},ww.ERROR),h===l)continue;const c=s[s.length-1];0===s.length||c.size!==h||c.endIndex!==o-1?s.push({endIndex:o,size:h,startIndex:o}):s[s.length-1].endIndex++}return s}(i.children,t,"offsetHeight",s);let a=i.parentElement;for(;!a.dataset.virtuosoScroller;)a=a.parentElement;const l="window"===a.lastElementChild.dataset.viewportType;let h;l&&(h=a.ownerDocument.defaultView);const c=o?o.scrollTop:l?h.scrollY||h.document.documentElement.scrollTop:a.scrollTop,d=o?o.scrollHeight:l?h.document.documentElement.scrollHeight:a.scrollHeight,u=o?o.offsetHeight:l?h.innerHeight:a.offsetHeight;n({scrollHeight:d,scrollTop:Math.max(c,0),viewportHeight:u}),null!==r&&e(r)}),[e,t,s,a,o,n,l]);return Bw(c,i,h)}function xw(e,t,i){const n=r.useRef(null),s=r.useCallback((i=>{if(null==i||!i.offsetParent)return;const r=i.getBoundingClientRect(),s=r.width;let a,l;if(t){const e=t.getBoundingClientRect(),i=r.top-e.top;l=e.height-Math.max(0,i),a=i+t.scrollTop}else{const e=o.current.ownerDocument.defaultView;l=e.innerHeight-Math.max(0,r.top),a=r.top+e.scrollY}n.current={offsetTop:a,visibleHeight:l,visibleWidth:s},e(n.current)}),[e,t]),{callbackRef:a,ref:o}=Bw(s,!0,i),l=r.useCallback((()=>{s(o.current)}),[s,o]);return r.useEffect((()=>{var e;if(t){t.addEventListener("scroll",l);const e=new ResizeObserver((()=>{requestAnimationFrame(l)}));return e.observe(t),()=>{t.removeEventListener("scroll",l),e.unobserve(t)}}{const t=null==(e=o.current)?void 0:e.ownerDocument.defaultView;return null==t||t.addEventListener("scroll",l),null==t||t.addEventListener("resize",l),()=>{null==t||t.removeEventListener("scroll",l),null==t||t.removeEventListener("resize",l)}}}),[l,t,o]),a}const Fw=Aw((()=>{const e=dw(),t=dw(),i=hw(0),r=dw(),n=hw(0),s=dw(),a=dw(),o=hw(0),l=hw(0),h=hw(0),c=hw(0),d=dw(),u=dw(),A=hw(!1),p=hw(!1),f=hw(!1);return Xm(nw(e,iw((({scrollTop:e})=>e))),t),Xm(nw(e,iw((({scrollHeight:e})=>e))),a),Xm(t,n),{deviation:i,fixedFooterHeight:h,fixedHeaderHeight:l,footerHeight:c,headerHeight:o,horizontalDirection:p,scrollBy:u,scrollContainerState:e,scrollHeight:a,scrollingInProgress:A,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:f,smoothScrollTargetReached:r,statefulScrollTop:n,viewportHeight:s}}),[],{singleton:!0}),Nw={lvl:0};function Sw(e,t){const i=e.length;if(0===i)return[];let{index:r,value:n}=t(e[0]);const s=[];for(let a=1;a<i;a++){const{index:i,value:o}=t(e[a]);s.push({end:i-1,start:r,value:n}),r=i,n=o}return s.push({end:1/0,start:r,value:n}),s}function Ew(e){return e===Nw}function Tw(e,t){if(!Ew(e))return t===e.k?e.v:t<e.k?Tw(e.l,t):Tw(e.r,t)}function Lw(e,t,i="k"){if(Ew(e))return[-1/0,void 0];if(Number(e[i])===t)return[e.k,e.v];if(Number(e[i])<t){const r=Lw(e.r,t,i);return r[0]===-1/0?[e.k,e.v]:r}return Lw(e.l,t,i)}function kw(e,t,i){return Ew(e)?jw(t,i,1):t===e.k?Qw(e,{k:t,v:i}):t<e.k?zw(Qw(e,{l:kw(e.l,t,i)})):zw(Qw(e,{r:kw(e.r,t,i)}))}function Dw(){return Nw}function Iw(e,t,i){if(Ew(e))return[];return function(e){return Sw(e,(({k:e,v:t})=>({index:e,value:t})))}(Ow(e,Lw(e,t)[0],i))}function Uw(e,t){if(Ew(e))return Nw;const{k:i,l:r,r:n}=e;if(t===i){if(Ew(r))return n;if(Ew(n))return r;{const[t,i]=_w(r);return Rw(Qw(e,{k:t,l:Hw(r),v:i}))}}return Rw(Qw(e,t<i?{l:Uw(r,t)}:{r:Uw(n,t)}))}function Pw(e){return Ew(e)?[]:[...Pw(e.l),{k:e.k,v:e.v},...Pw(e.r)]}function Ow(e,t,i){if(Ew(e))return[];const{k:r,l:n,r:s,v:a}=e;let o=[];return r>t&&(o=o.concat(Ow(n,t,i))),r>=t&&r<=i&&o.push({k:r,v:a}),r<=i&&(o=o.concat(Ow(s,t,i))),o}function Rw(e){const{l:t,lvl:i,r:r}=e;if(r.lvl>=i-1&&t.lvl>=i-1)return e;if(i>r.lvl+1){if(Mw(t))return Vw(Qw(e,{lvl:i-1}));if(!Ew(t)&&!Ew(t.r))return Qw(t.r,{l:Qw(t,{r:t.r.l}),lvl:i,r:Qw(e,{l:t.r.r,lvl:i-1})});throw new Error("Unexpected empty nodes")}if(Mw(e))return Kw(Qw(e,{lvl:i-1}));if(Ew(r)||Ew(r.l))throw new Error("Unexpected empty nodes");{const t=r.l,n=Mw(t)?r.lvl-1:r.lvl;return Qw(t,{l:Qw(e,{lvl:i-1,r:t.l}),lvl:t.lvl+1,r:Kw(Qw(r,{l:t.r,lvl:n}))})}}function Qw(e,t){return jw(void 0!==t.k?t.k:e.k,void 0!==t.v?t.v:e.v,void 0!==t.lvl?t.lvl:e.lvl,void 0!==t.l?t.l:e.l,void 0!==t.r?t.r:e.r)}function Hw(e){return Ew(e.r)?e.l:Rw(Qw(e,{r:Hw(e.r)}))}function Mw(e){return Ew(e)||e.lvl>e.r.lvl}function _w(e){return Ew(e.r)?[e.k,e.v]:_w(e.r)}function jw(e,t,i,r=Nw,n=Nw){return{k:e,l:r,lvl:i,r:n,v:t}}function zw(e){return Kw(Vw(e))}function Vw(e){const{l:t}=e;return Ew(t)||t.lvl!==e.lvl?e:Qw(t,{r:Qw(e,{l:t.r})})}function Kw(e){const{lvl:t,r:i}=e;return Ew(i)||Ew(i.r)||i.lvl!==t||i.r.lvl!==t?e:Qw(i,{l:Qw(e,{r:i.l}),lvl:t+1})}function qw(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function Gw(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}const Ww=Aw((()=>({recalcInProgress:hw(!1)})),[],{singleton:!0});function Jw(e,t,i){return e[Xw(e,t,i)]}function Xw(e,t,i,r=0){let n=e.length-1;for(;r<=n;){const s=Math.floor((r+n)/2),a=i(e[s],t);if(0===a)return s;if(-1===a){if(n-r<2)return s-1;n=s-1}else{if(n===r)return s;r=s+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function Yw(e,t){return Math.round(e.getBoundingClientRect()[t])}function $w(e){return!Ew(e.groupOffsetTree)}function Zw({index:e},t){return t===e?0:t<e?-1:1}function eb({offset:e},t){return t===e?0:t<e?-1:1}function tb(e,t,i){if(0===t.length)return 0;const{index:r,offset:n,size:s}=Jw(t,e,Zw),a=e-r,o=s*a+(a-1)*i+n;return o>0?o+i:o}function ib(e,t){if(!$w(t))return e;let i=0;for(;t.groupIndices[i]<=e+i;)i++;return e+i}function rb(e,t,i){if(function(e){return typeof e.groupIndex<"u"}(e))return t.groupIndices[e.groupIndex]+1;{let r=ib("LAST"===e.index?i:e.index,t);return r=Math.max(0,r,Math.min(i,r)),r}}function nb(e,t,i,r=0){return r>0&&(t=Math.max(t,Jw(e,r,Zw).offset)),Sw(function(e,t,i,r){const n=Xw(e,t,r),s=Xw(e,i,r,n);return e.slice(n,s+1)}(e,t,i,eb),lb)}function sb(e,[t,i,r,n]){t.length>0&&r("received item sizes",t,ww.DEBUG);const s=e.sizeTree;let a=s,o=0;if(i.length>0&&Ew(s)&&2===t.length){const e=t[0].size,r=t[1].size;a=i.reduce(((t,i)=>kw(kw(t,i,e),i+1,r)),a)}else[a,o]=function(e,t){let i=Ew(e)?0:1/0;for(const r of t){const{endIndex:t,size:n,startIndex:s}=r;if(i=Math.min(i,s),Ew(e)){e=kw(e,0,n);continue}const a=Iw(e,s-1,t+1);if(a.some(hb(r)))continue;let o=!1,l=!1;for(const{end:i,start:r,value:s}of a)o?(t>=r||n===s)&&(e=Uw(e,r)):(l=s!==n,o=!0),i>t&&t>=r&&s!==n&&(e=kw(e,t+1,s));l&&(e=kw(e,s,n))}return[e,i]}(a,t);if(a===s)return e;const{lastIndex:l,lastOffset:h,lastSize:c,offsetTree:d}=ob(e.offsetTree,o,a,n);return{groupIndices:i,groupOffsetTree:i.reduce(((e,t)=>kw(e,t,tb(t,d,n))),Dw()),lastIndex:l,lastOffset:h,lastSize:c,offsetTree:d,sizeTree:a}}function ab(e,t){let i=0,r=0;for(;i<e;)i+=t[r+1]-t[r]-1,r++;return r-(i===e?0:1)}function ob(e,t,i,r){let n=e,s=0,a=0,o=0,l=0;if(0!==t){l=Xw(n,t-1,Zw),o=n[l].offset;const e=Lw(i,t-1);s=e[0],a=e[1],n.length&&n[l].size===Lw(i,t)[1]&&(l-=1),n=n.slice(0,l+1)}else n=[];for(const{start:e,value:l}of Iw(i,t,1/0)){const t=e-s,i=t*a+o+t*r;n.push({index:e,offset:i,size:l}),s=e,o=i,a=l}return{lastIndex:s,lastOffset:o,lastSize:a,offsetTree:n}}function lb(e){return{index:e.index,value:e}}function hb(e){const{endIndex:t,size:i,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===i}const cb={offsetHeight:"height",offsetWidth:"width"},db=Aw((([{log:e},{recalcInProgress:t}])=>{const i=dw(),r=dw(),n=cw(r,0),s=dw(),a=dw(),o=hw(0),l=hw([]),h=hw(void 0),c=hw(void 0),d=hw(((e,t)=>Yw(e,cb[t]))),u=hw(void 0),A=hw(0),p={groupIndices:[],groupOffsetTree:Dw(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Dw()},f=cw(nw(i,lw(l,e,A),sw(sb,p),ew()),p),g=cw(nw(l,ew(),sw(((e,t)=>({current:t,prev:e.current})),{current:[],prev:[]}),iw((({prev:e})=>e))),[]);Xm(nw(l,tw((e=>e.length>0)),lw(f,A),iw((([e,t,i])=>{const r=e.reduce(((e,r,n)=>kw(e,r,tb(r,t.offsetTree,i)||n)),Dw());return{...t,groupIndices:e,groupOffsetTree:r}}))),f),Xm(nw(r,lw(f),tw((([e,{lastIndex:t}])=>e<t)),iw((([e,{lastIndex:t,lastSize:i}])=>[{endIndex:t,size:i,startIndex:e}]))),i),Xm(h,c);const m=cw(nw(h,iw((e=>void 0===e))),!0);Xm(nw(c,tw((e=>void 0!==e&&Ew(Jm(f).sizeTree))),iw((e=>[{endIndex:0,size:e,startIndex:0}]))),i);const w=uw(nw(i,lw(f),sw((({sizes:e},[t,i])=>({changed:i!==e,sizes:i})),{changed:!1,sizes:p}),iw((e=>e.changed))));qm(nw(o,sw(((e,t)=>({diff:e.prev-t,prev:t})),{diff:0,prev:0}),iw((e=>e.diff))),(e=>{const{groupIndices:i}=Jm(f);if(e>0)Gm(t,!0),Gm(s,e+ab(e,i));else if(e<0){const t=Jm(g);t.length>0&&(e-=ab(-e,t)),Gm(a,e)}})),qm(nw(o,lw(e)),(([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:o},ww.ERROR)}));const b=uw(s);Xm(nw(s,lw(f),iw((([e,t])=>{const i=t.groupIndices.length>0,r=[],n=t.lastSize;if(i){const i=Tw(t.sizeTree,0);let s=0,a=0;for(;s<e;){const e=t.groupIndices[a],o=t.groupIndices.length===a+1?1/0:t.groupIndices[a+1]-e-1;r.push({endIndex:e,size:i,startIndex:e}),r.push({endIndex:e+1+o-1,size:n,startIndex:e+1}),a++,s+=o+1}const o=Pw(t.sizeTree);return s!==e&&o.shift(),o.reduce(((t,{k:i,v:r})=>{let n=t.ranges;return 0!==t.prevSize&&(n=[...t.ranges,{endIndex:i+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:i+e,prevSize:r,ranges:n}}),{prevIndex:e,prevSize:0,ranges:r}).ranges}return Pw(t.sizeTree).reduce(((t,{k:i,v:r})=>({prevIndex:i+e,prevSize:r,ranges:[...t.ranges,{endIndex:i+e-1,size:t.prevSize,startIndex:t.prevIndex}]})),{prevIndex:0,prevSize:n,ranges:[]}).ranges}))),i);const v=uw(nw(a,lw(f,A),iw((([e,{offsetTree:t},i])=>tb(-e,t,i)))));return Xm(nw(a,lw(f,A),iw((([e,t,i])=>{if(t.groupIndices.length>0){if(Ew(t.sizeTree))return t;let r=Dw();const n=Jm(g);let s=0,a=0,o=0;for(;s<-e;){o=n[a];const e=n[a+1]-o-1;a++,s+=e+1}if(r=Pw(t.sizeTree).reduce(((t,{k:i,v:r})=>kw(t,Math.max(0,i+e),r)),r),s!==-e){r=kw(r,0,Tw(t.sizeTree,o));r=kw(r,1,Lw(t.sizeTree,1-e)[1])}return{...t,sizeTree:r,...ob(t.offsetTree,0,r,i)}}{const r=Pw(t.sizeTree).reduce(((t,{k:i,v:r})=>kw(t,Math.max(0,i+e),r)),Dw());return{...t,sizeTree:r,...ob(t.offsetTree,0,r,i)}}}))),f),{beforeUnshiftWith:b,data:u,defaultItemSize:c,firstItemIndex:o,fixedItemSize:h,gap:A,groupIndices:l,itemSize:d,listRefresh:w,shiftWith:a,shiftWithOffset:v,sizeRanges:i,sizes:f,statefulTotalCount:n,totalCount:r,trackItemSizes:m,unshiftWith:s}}),Km(vw,Ww),{singleton:!0});function ub(e){return e.reduce(((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e)),{groupIndices:[],totalCount:0})}const Ab=Aw((([{groupIndices:e,sizes:t,totalCount:i},{headerHeight:r,scrollTop:n}])=>{const s=dw(),a=dw(),o=uw(nw(s,iw(ub)));return Xm(nw(o,iw((e=>e.totalCount))),i),Xm(nw(o,iw((e=>e.groupIndices))),e),Xm(nw(fw(n,t,r),tw((([e,t])=>$w(t))),iw((([e,t,i])=>Lw(t.groupOffsetTree,Math.max(e-i,0),"v")[0])),ew(),iw((e=>[e]))),a),{groupCounts:s,topItemsIndexes:a}}),Km(db,Fw)),pb=Aw((([{log:e}])=>{const t=hw(!1),i=uw(nw(t,tw((e=>e)),ew()));return qm(t,(t=>{t&&Jm(e)("props updated",{},ww.DEBUG)})),{didMount:i,propsReady:t}}),Km(vw),{singleton:!0}),fb=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function gb(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!fb)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const mb=Aw((([{gap:e,listRefresh:t,sizes:i,totalCount:r},{fixedFooterHeight:n,fixedHeaderHeight:s,footerHeight:a,headerHeight:o,scrollingInProgress:l,scrollTo:h,smoothScrollTargetReached:c,viewportHeight:d},{log:u}])=>{const A=dw(),p=dw(),f=hw(0);let g=null,m=null,w=null;function b(){g&&(g(),g=null),w&&(w(),w=null),m&&(clearTimeout(m),m=null),Gm(l,!1)}return Xm(nw(A,lw(i,d,r,f,o,a,u),lw(e,s,n),iw((([[e,i,r,n,s,a,o,h],d,u,f])=>{const v=gb(e),{align:y,behavior:B,offset:C}=v,x=n-1,F=rb(v,i,x);let N=tb(F,i.offsetTree,d)+a;"end"===y?(N+=u+Lw(i.sizeTree,F)[1]-r+f,F===x&&(N+=o)):"center"===y?N+=(u+Lw(i.sizeTree,F)[1]-r+f)/2:N-=s,C&&(N+=C);const S=t=>{b(),t?(h("retrying to scroll to",{location:e},ww.DEBUG),Gm(A,e)):(Gm(p,!0),h("list did not change, scroll successful",{},ww.DEBUG))};if(b(),"smooth"===B){let e=!1;w=qm(t,(t=>{e=e||t})),g=Ym(c,(()=>{S(e)}))}else g=Ym(nw(t,function(e){return t=>{const i=setTimeout((()=>{t(!1)}),e);return e=>{e&&(t(!0),clearTimeout(i))}}}(150)),S);return m=setTimeout((()=>{b()}),1200),Gm(l,!0),h("scrolling from index to",{behavior:B,index:F,top:N},ww.DEBUG),{behavior:B,top:N}}))),h),{scrollTargetReached:p,scrollToIndex:A,topListHeight:f}}),Km(db,Fw,vw),{singleton:!0});function wb(e,t){0==e?t():requestAnimationFrame((()=>{wb(e-1,t)}))}function bb(e,t){const i=t-1;return"number"==typeof e?e:"LAST"===e.index?i:e.index}const vb=Aw((([{defaultItemSize:e,listRefresh:t,sizes:i},{scrollTop:r},{scrollTargetReached:n,scrollToIndex:s},{didMount:a}])=>{const o=hw(!0),l=hw(0),h=hw(!0);return Xm(nw(a,lw(l),tw((([e,t])=>!!t)),rw(!1)),o),Xm(nw(a,lw(l),tw((([e,t])=>!!t)),rw(!1)),h),qm(nw(fw(t,a),lw(o,i,e,h),tw((([[,e],t,{sizeTree:i},r,n])=>e&&(!Ew(i)||_m(r))&&!t&&!n)),lw(l)),(([,e])=>{Ym(n,(()=>{Gm(h,!0)})),wb(4,(()=>{Ym(r,(()=>{Gm(o,!0)})),Gm(s,e)}))})),{initialItemFinalLocationReached:h,initialTopMostItemIndex:l,scrolledToInitialItem:o}}),Km(db,Fw,mb,pb),{singleton:!0});function yb(e,t){return Math.abs(e-t)<1.01}const Bb="up",Cb="down",xb={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Fb=Aw((([{footerHeight:e,headerHeight:t,scrollBy:i,scrollContainerState:r,scrollTop:n,viewportHeight:s}])=>{const a=hw(!1),o=hw(!0),l=dw(),h=dw(),c=hw(4),d=hw(0),u=cw(nw(mw(nw(gw(n),aw(1),rw(!0)),nw(gw(n),aw(1),rw(!1),$m(100))),ew()),!1),A=cw(nw(mw(nw(i,rw(!0)),nw(i,rw(!1),$m(200))),ew()),!1);Xm(nw(fw(gw(n),gw(d)),iw((([e,t])=>e<=t)),ew()),o),Xm(nw(o,ow(50)),h);const p=uw(nw(fw(r,gw(s),gw(t),gw(e),gw(c)),sw(((e,[{scrollHeight:t,scrollTop:i},r,n,s,a])=>{const o={scrollHeight:t,scrollTop:i,viewportHeight:r};if(i+r-t>-a){let t,r;return i>e.state.scrollTop?(t="SCROLLED_DOWN",r=e.state.scrollTop-i):(t="SIZE_DECREASED",r=e.state.scrollTop-i||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:o}}let l;return l=o.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":i<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:l,state:o}}),xb),ew(((e,t)=>e&&e.atBottom===t.atBottom)))),f=cw(nw(r,sw(((e,{scrollHeight:t,scrollTop:i,viewportHeight:r})=>{if(yb(e.scrollHeight,t))return{changed:!1,jump:0,scrollHeight:t,scrollTop:i};{const n=t-(i+r)<1;return e.scrollTop!==i&&n?{changed:!0,jump:e.scrollTop-i,scrollHeight:t,scrollTop:i}:{changed:!0,jump:0,scrollHeight:t,scrollTop:i}}}),{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),tw((e=>e.changed)),iw((e=>e.jump))),0);Xm(nw(p,iw((e=>e.atBottom))),a),Xm(nw(a,ow(50)),l);const g=hw(Cb);Xm(nw(r,iw((({scrollTop:e})=>e)),ew(),sw(((e,t)=>Jm(A)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?Bb:Cb,prevScrollTop:t}),{direction:Cb,prevScrollTop:0}),iw((e=>e.direction))),g),Xm(nw(r,ow(50),rw("none")),g);const m=hw(0);return Xm(nw(u,tw((e=>!e)),rw(0)),m),Xm(nw(n,ow(100),lw(u),tw((([e,t])=>!!t)),sw((([e,t],[i])=>[t,i]),[0,0]),iw((([e,t])=>t-e))),m),{atBottomState:p,atBottomStateChange:l,atBottomThreshold:c,atTopStateChange:h,atTopThreshold:d,isAtBottom:a,isAtTop:o,isScrolling:u,lastJumpDueToItemResize:f,scrollDirection:g,scrollVelocity:m}}),Km(Fw)),Nb="top",Sb="bottom",Eb="none";function Tb(e,t,i){return"number"==typeof e?i===Bb&&t===Nb||i===Cb&&t===Sb?e:0:i===Bb?t===Nb?e.main:e.reverse:t===Sb?e.main:e.reverse}function Lb(e,t){var i;return"number"==typeof e?e:null!=(i=e[t])?i:0}const kb=Aw((([{deviation:e,fixedHeaderHeight:t,headerHeight:i,scrollTop:r,viewportHeight:n}])=>{const s=dw(),a=hw(0),o=hw(0),l=hw(0),h=cw(nw(fw(gw(r),gw(n),gw(i),gw(s,Gw),gw(l),gw(a),gw(t),gw(e),gw(o)),iw((([e,t,i,[r,n],s,a,o,l,h])=>{const c=e-l,d=a+o,u=Math.max(i-c,0);let A=Eb;const p=Lb(h,Nb),f=Lb(h,Sb);return r-=l,n+=i+o,(r+=i+o)>e+d-p&&(A=Bb),(n-=l)<e-u+t+f&&(A=Cb),A!==Eb?[Math.max(c-i-Tb(s,Nb,A)-p,0),c-u-o+t+Tb(s,Sb,A)+f]:null})),tw((e=>null!=e)),ew(Gw)),[0,0]);return{increaseViewportBy:o,listBoundary:s,overscan:l,topListHeight:a,visibleRange:h}}),Km(Fw),{singleton:!0});const Db={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Ib(e,t,i,r,n,s){const{lastIndex:a,lastOffset:o,lastSize:l}=n;let h=0,c=0;if(e.length>0){h=e[0].offset;const t=e[e.length-1];c=t.offset+t.size}const d=i-a,u=h,A=o+d*l+(d-1)*r-c;return{bottom:c,firstItemIndex:s,items:Pb(e,n,s),offsetBottom:A,offsetTop:h,top:u,topItems:Pb(t,n,s),topListHeight:t.reduce(((e,t)=>t.size+e),0),totalCount:i}}function Ub(e,t,i,r,n,s){let a=0;if(i.groupIndices.length>0)for(const t of i.groupIndices){if(t-a>=e)break;a++}const o=e+a,l=bb(t,o);return Ib(Array.from({length:o}).map(((e,t)=>({data:s[t+l],index:t+l,offset:0,size:0}))),[],o,n,i,r)}function Pb(e,t,i){if(0===e.length)return[];if(!$w(t))return e.map((e=>({...e,index:e.index+i,originalIndex:e.index})));const r=e[0].index,n=e[e.length-1].index,s=[],a=Iw(t.groupOffsetTree,r,n);let o,l=0;for(const r of e){let e;(!o||o.end<r.index)&&(o=a.shift(),l=t.groupIndices.indexOf(o.start)),e=r.index===o.start?{index:l,type:"group"}:{groupIndex:l,index:r.index-(l+1)+i},s.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return s}const Ob=Aw((([{data:e,firstItemIndex:t,gap:i,sizes:r,totalCount:n},s,{listBoundary:a,topListHeight:o,visibleRange:l},{initialTopMostItemIndex:h,scrolledToInitialItem:c},{topListHeight:d},u,{didMount:A},{recalcInProgress:p}])=>{const f=hw([]),g=hw(0),m=dw();Xm(s.topItemsIndexes,f);const w=cw(nw(fw(A,p,gw(l,Gw),gw(n),gw(r),gw(h),c,gw(f),gw(t),gw(i),e),tw((([e,t,,i,,,,,,,r])=>{const n=r&&r.length!==i;return e&&!t&&!n})),iw((([,,[e,t],i,r,n,s,a,o,l,h])=>{const c=r,{offsetTree:d,sizeTree:u}=c,A=Jm(g);if(0===i)return{...Db,totalCount:i};if(0===e&&0===t)return 0===A?{...Db,totalCount:i}:Ub(A,n,r,o,l,h||[]);if(Ew(u))return A>0?null:Ib(function(e,t,i){if($w(t)){const r=ib(e,t);return[{index:Lw(t.groupOffsetTree,r)[0],offset:0,size:0},{data:null==i?void 0:i[0],index:r,offset:0,size:0}]}return[{data:null==i?void 0:i[0],index:e,offset:0,size:0}]}(bb(n,i),c,h),[],i,l,c,o);const p=[];if(a.length>0){const e=a[0],t=a[a.length-1];let i=0;for(const r of Iw(u,e,t)){const n=r.value,s=Math.max(r.start,e),a=Math.min(r.end,t);for(let e=s;e<=a;e++)p.push({data:null==h?void 0:h[e],index:e,offset:i,size:n}),i+=n}}if(!s)return Ib([],p,i,l,c,o);const f=a.length>0?a[a.length-1]+1:0,m=nb(d,e,t,f);if(0===m.length)return null;const w=i-1;return Ib(zm([],(i=>{for(const r of m){const n=r.value;let s=n.offset,a=r.start;const o=n.size;if(n.offset<e){a+=Math.floor((e-n.offset+l)/(o+l));const t=a-r.start;s+=t*o+t*l}a<f&&(s+=(f-a)*o,a=f);const c=Math.min(r.end,w);for(let e=a;e<=c&&!(s>=t);e++)i.push({data:null==h?void 0:h[e],index:e,offset:s,size:o}),s+=o+l}})),p,i,l,c,o)})),tw((e=>null!==e)),ew()),Db);Xm(nw(e,tw(_m),iw((e=>null==e?void 0:e.length))),n),Xm(nw(w,iw((e=>e.topListHeight))),d),Xm(d,o),Xm(nw(w,iw((e=>[e.top,e.bottom]))),a),Xm(nw(w,iw((e=>e.items))),m);const b=uw(nw(w,tw((({items:e})=>e.length>0)),lw(n,e),tw((([{items:e},t])=>e[e.length-1].originalIndex===t-1)),iw((([,e,t])=>[e-1,t])),ew(Gw),iw((([e])=>e)))),v=uw(nw(w,ow(200),tw((({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length)),iw((({items:e})=>e[0].index)),ew())),y=uw(nw(w,tw((({items:e})=>e.length>0)),iw((({items:e})=>{let t=0,i=e.length-1;for(;"group"===e[t].type&&t<i;)t++;for(;"group"===e[i].type&&i>t;)i--;return{endIndex:e[i].index,startIndex:e[t].index}})),ew(qw)));return{endReached:b,initialItemCount:g,itemsRendered:m,listState:w,rangeChanged:y,startReached:v,topItemsIndexes:f,...u}}),Km(db,Ab,kb,vb,mb,Fb,pb,Ww),{singleton:!0}),Rb=Aw((([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:i,headerHeight:r},{listState:n}])=>{const s=dw(),a=cw(nw(fw(i,e,r,t,n),iw((([e,t,i,r,n])=>e+t+i+r+n.offsetBottom+n.bottom))),0);return Xm(gw(a),s),{totalListHeight:a,totalListHeightChanged:s}}),Km(Fw,Ob),{singleton:!0}),Qb=Aw((([{viewportHeight:e},{totalListHeight:t}])=>{const i=hw(!1);return{alignToBottom:i,paddingTopAddition:cw(nw(fw(i,e,t),tw((([e])=>e)),iw((([,e,t])=>Math.max(0,e-t))),ow(0),ew()),0)}}),Km(Fw,Rb),{singleton:!0});function Hb(e){return!!e&&("smooth"===e?"smooth":"auto")}const Mb=Aw((([{listRefresh:e,totalCount:t,fixedItemSize:i},{atBottomState:r,isAtBottom:n},{scrollToIndex:s},{scrolledToInitialItem:a},{didMount:o,propsReady:l},{log:h},{scrollingInProgress:c}])=>{const d=hw(!1),u=dw();let A=null;function p(e){Gm(s,{align:"end",behavior:e,index:"LAST"})}function f(e){const t=Ym(r,(t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&!A&&(Jm(h)("scrolling to bottom due to increased size",{},ww.DEBUG),p("auto"))}));setTimeout(t,100)}return qm(nw(fw(nw(gw(t),aw(1)),o),lw(gw(d),n,a,c),iw((([[e,t],i,r,n,s])=>{let a=t&&n,o="auto";return a&&(o=((e,t)=>"function"==typeof e?Hb(e(t)):t&&Hb(e))(i,r||s),a=a&&!!o),{followOutputBehavior:o,shouldFollow:a,totalCount:e}})),tw((({shouldFollow:e})=>e))),(({followOutputBehavior:t,totalCount:r})=>{A&&(A(),A=null),Jm(i)?requestAnimationFrame((()=>{Jm(h)("following output to ",{totalCount:r},ww.DEBUG),p(t)})):A=Ym(e,(()=>{Jm(h)("following output to ",{totalCount:r},ww.DEBUG),p(t),A=null}))})),qm(nw(fw(gw(d),t,l),tw((([e,,t])=>e&&t)),sw((({value:e},[,t])=>({refreshed:e===t,value:t})),{refreshed:!1,value:0}),tw((({refreshed:e})=>e)),lw(d,t)),(([,e])=>{Jm(a)&&f(!1!==e)})),qm(u,(()=>{f(!1!==Jm(d))})),qm(fw(gw(d),r),(([e,t])=>{e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&p("auto")})),{autoscrollToBottom:u,followOutput:d}}),Km(db,Fb,mb,vb,pb,vw,Fw)),_b=Aw((([{data:e,firstItemIndex:t,gap:i,sizes:r},{initialTopMostItemIndex:n},{initialItemCount:s,listState:a},{didMount:o}])=>(Xm(nw(o,lw(s),tw((([,e])=>0!==e)),lw(n,r,t,i,e),iw((([[,e],t,i,r,n,s=[]])=>Ub(e,t,i,r,n,s)))),a),{})),Km(db,vb,Ob,pb),{singleton:!0}),jb=Aw((([{didMount:e},{scrollTo:t},{listState:i}])=>{const r=hw(0);return qm(nw(e,lw(r),tw((([,e])=>0!==e)),iw((([,e])=>({top:e})))),(e=>{Ym(nw(i,aw(1),tw((e=>e.items.length>1))),(()=>{requestAnimationFrame((()=>{Gm(t,e)}))}))})),{initialScrollTop:r}}),Km(pb,Fw,Ob),{singleton:!0}),zb=({itemBottom:e,itemTop:t,locationParams:{align:i,behavior:r,...n},viewportBottom:s,viewportTop:a})=>t<a?{...n,align:null!=i?i:"start",behavior:r}:e>s?{...n,align:null!=i?i:"end",behavior:r}:null,Vb=Aw((([{gap:e,sizes:t,totalCount:i},{fixedFooterHeight:r,fixedHeaderHeight:n,headerHeight:s,scrollingInProgress:a,scrollTop:o,viewportHeight:l},{scrollToIndex:h}])=>{const c=dw();return Xm(nw(c,lw(t,l,i,s,n,r,o),lw(e),iw((([[e,t,i,r,n,s,o,l],h])=>{const{align:c,behavior:d,calculateViewLocation:u=zb,done:A,...p}=e,f=rb(e,t,r-1),g=tb(f,t.offsetTree,h)+n+s,m=u({itemBottom:g+Lw(t.sizeTree,f)[1],itemTop:g,locationParams:{align:c,behavior:d,...p},viewportBottom:l+i-o,viewportTop:l+s});return m?A&&Ym(nw(a,tw((e=>!e)),aw(Jm(a)?1:2)),A):A&&A(),m})),tw((e=>null!==e))),h),{scrollIntoView:c}}),Km(db,Fw,mb,Ob,vw),{singleton:!0}),Kb=Aw((([{scrollVelocity:e}])=>{const t=hw(!1),i=dw(),r=hw(!1);return Xm(nw(e,lw(r,t,i),tw((([e,t])=>!!t)),iw((([e,t,i,r])=>{const{enter:n,exit:s}=t;if(i){if(s(e,r))return!1}else if(n(e,r))return!0;return i})),ew()),t),qm(nw(fw(t,e,i),lw(r)),(([[e,t,i],r])=>{e&&r&&r.change&&r.change(t,i)})),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:i,scrollVelocity:e}}),Km(Fb),{singleton:!0}),qb=Aw((([{scrollContainerState:e,scrollTo:t}])=>{const i=dw(),r=dw(),n=dw(),s=hw(!1),a=hw(void 0);return Xm(nw(fw(i,r),iw((([{scrollHeight:e,scrollTop:t,viewportHeight:i},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:i})))),e),Xm(nw(t,lw(r),iw((([e,{offsetTop:t}])=>({...e,top:e.top+t})))),n),{customScrollParent:a,useWindowScroll:s,windowScrollContainerState:i,windowScrollTo:n,windowViewportRect:r}}),Km(Fw)),Gb=Aw((([{sizeRanges:e,sizes:t},{headerHeight:i,scrollTop:r},{initialTopMostItemIndex:n},{didMount:s},{useWindowScroll:a,windowScrollContainerState:o,windowViewportRect:l}])=>{const h=dw(),c=hw(void 0),d=hw(null),u=hw(null);return Xm(o,d),Xm(l,u),qm(nw(h,lw(t,r,a,d,u,i)),(([e,t,i,r,n,s,a])=>{const o=function(e){return Pw(e).map((({k:e,v:t},i,r)=>{const n=r[i+1];return{endIndex:n?n.k-1:1/0,size:t,startIndex:e}}))}(t.sizeTree);r&&null!==n&&null!==s&&(i=n.scrollTop-s.offsetTop),e({ranges:o,scrollTop:i-=a})})),Xm(nw(c,tw(_m),iw(Wb)),n),Xm(nw(s,lw(c),tw((([,e])=>void 0!==e)),ew(),iw((([,e])=>e.ranges))),e),{getState:h,restoreStateFrom:c}}),Km(db,Fw,vb,pb,qb));function Wb(e){return{align:"start",index:0,offset:e.scrollTop}}const Jb=Aw((([{topItemsIndexes:e}])=>{const t=hw(0);return Xm(nw(t,tw((e=>e>=0)),iw((e=>Array.from({length:e}).map(((e,t)=>t))))),e),{topItemCount:t}}),Km(Ob));function Xb(e){let t,i=!1;return()=>(i||(i=!0,t=e()),t)}const Yb=Xb((()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent))),$b=Aw((([{deviation:e,scrollBy:t,scrollingInProgress:i,scrollTop:r},{isAtBottom:n,isScrolling:s,lastJumpDueToItemResize:a,scrollDirection:o},{listState:l},{beforeUnshiftWith:h,gap:c,shiftWithOffset:d,sizes:u},{log:A},{recalcInProgress:p}])=>{const f=uw(nw(l,lw(a),sw((([,e,t,i],[{bottom:r,items:n,offsetBottom:s,totalCount:a},o])=>{const l=r+s;let h=0;return t===a&&e.length>0&&n.length>0&&(0===n[0].originalIndex&&0===e[0].originalIndex||(h=l-i,0!==h&&(h+=o))),[h,n,a,l]}),[0,[],0,0]),tw((([e])=>0!==e)),lw(r,o,i,n,A,p),tw((([,e,t,i,,,r])=>!r&&!i&&0!==e&&t===Bb)),iw((([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},ww.DEBUG),e)))));function g(i){i>0?(Gm(t,{behavior:"auto",top:-i}),Gm(e,0)):(Gm(e,0),Gm(t,{behavior:"auto",top:-i}))}return qm(nw(f,lw(e,s)),(([t,i,r])=>{r&&Yb()?Gm(e,i-t):g(-t)})),qm(nw(fw(cw(s,!1),e,p),tw((([e,t,i])=>!e&&!i&&0!==t)),iw((([e,t])=>t)),ow(1)),g),Xm(nw(d,iw((e=>({top:-e})))),t),qm(nw(h,lw(u,c),iw((([e,{groupIndices:t,lastSize:i,sizeTree:r},n])=>{function s(e){return e*(i+n)}if(0===t.length)return s(e);{let i=0;const n=Tw(r,0);let a=0,o=0;for(;a<e;){a++,i+=n;let r=t.length===o+1?1/0:t[o+1]-t[o]-1;a+r>e&&(i-=n,r=e-a+1),a+=r,i+=s(r),o++}return i}}))),(i=>{Gm(e,i),requestAnimationFrame((()=>{Gm(t,{top:i}),requestAnimationFrame((()=>{Gm(e,0),Gm(p,!1)}))}))})),{deviation:e}}),Km(Fw,Fb,Ob,db,vw,Ww)),Zb=Aw((([e,t,i,r,n,s,a,o,l,h])=>({...e,...t,...i,...r,...n,...s,...a,...o,...l,...h})),Km(kb,_b,pb,Kb,Rb,jb,Qb,qb,Vb,vw)),ev=Aw((([{data:e,defaultItemSize:t,firstItemIndex:i,fixedItemSize:r,gap:n,groupIndices:s,itemSize:a,sizeRanges:o,sizes:l,statefulTotalCount:h,totalCount:c,trackItemSizes:d},{initialItemFinalLocationReached:u,initialTopMostItemIndex:A,scrolledToInitialItem:p},f,g,m,{listState:w,topItemsIndexes:b,...v},{scrollToIndex:y},B,{topItemCount:C},{groupCounts:x},F])=>(Xm(v.rangeChanged,F.scrollSeekRangeChanged),Xm(nw(F.windowViewportRect,iw((e=>e.visibleHeight))),f.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:i,fixedItemHeight:r,gap:n,groupCounts:x,initialItemFinalLocationReached:u,initialTopMostItemIndex:A,scrolledToInitialItem:p,sizeRanges:o,topItemCount:C,topItemsIndexes:b,totalCount:c,...m,groupIndices:s,itemSize:a,listState:w,scrollToIndex:y,statefulTotalCount:h,trackItemSizes:d,...v,...F,...f,sizes:l,...g})),Km(db,vb,Fw,Gb,Mb,Ob,mb,$b,Jb,Ab,Zb));function tv(e,t){const i={},r={};let n=0;const s=e.length;for(;n<s;)r[e[n]]=1,n+=1;for(const e in t)Object.hasOwn(r,e)||(i[e]=t[e]);return i}const iv=typeof document<"u"?r.useLayoutEffect:r.useEffect;function rv(t,i,n){const s=Object.keys(i.required||{}),a=Object.keys(i.optional||{}),o=Object.keys(i.methods||{}),l=Object.keys(i.events||{}),h=r.createContext({});function c(e,t){e.propsReady&&Gm(e.propsReady,!1);for(const r of s){Gm(e[i.required[r]],t[r])}for(const r of a)if(r in t){Gm(e[i.optional[r]],t[r])}e.propsReady&&Gm(e.propsReady,!0)}function d(e){return l.reduce(((t,r)=>(t[r]=function(e){let t,i;const r=()=>null==t?void 0:t();return function(n,s){switch(n){case 1:return s?i===s?void 0:(r(),i=s,t=qm(e,s),t):(r(),jm);case 2:return r(),void(i=null)}}}(e[i.events[r]]),t)),{})}const u=r.forwardRef(((u,A)=>{const{children:p,...f}=u,[g]=r.useState((()=>zm(function(e){const t=new Map,i=({constructor:e,dependencies:r,id:n,singleton:s})=>{if(s&&t.has(n))return t.get(n);const a=e(r.map((e=>i(e))));return s&&t.set(n,a),a};return i(e)}(t),(e=>{c(e,f)})))),[m]=r.useState(Mm(d,g));iv((()=>{for(const e of l)e in f&&qm(m[e],f[e]);return()=>{Object.values(m).map(Wm)}}),[f,m,g]),iv((()=>{c(g,f)})),r.useImperativeHandle(A,Rm(function(e){return o.reduce(((t,r)=>(t[r]=t=>{Gm(e[i.methods[r]],t)},t)),{})}(g)));const w=n;return e(h.Provider,{value:g,children:n?e(w,{...tv([...s,...a,...l],f),children:p}):p})}));return{Component:u,useEmitter:(e,t)=>{const i=r.useContext(h)[e];iv((()=>qm(i,t)),[t,i])},useEmitterValue:r.version.startsWith("18")?e=>{const t=r.useContext(h)[e],i=r.useCallback((e=>qm(t,e)),[t]);return r.useSyncExternalStore(i,(()=>Jm(t)),(()=>Jm(t)))}:e=>{const t=r.useContext(h)[e],[i,n]=r.useState(Mm(Jm,t));return iv((()=>qm(t,(e=>{e!==i&&n(Rm(e))}))),[t,i]),i},usePublisher:e=>{const t=r.useContext(h);return r.useCallback((i=>{Gm(t[e],i)}),[t,e])}}}const nv=r.createContext(void 0),sv=r.createContext(void 0),av=typeof document<"u"?r.useLayoutEffect:r.useEffect;function ov(e){return"self"in e}function lv(e,t,i,n=jm,s,a){const o=r.useRef(null),l=r.useRef(null),h=r.useRef(null),c=r.useCallback((i=>{let r,n,s;const o=i.target;if(function(e){return"body"in e}(o)||ov(o)){const e=ov(o)?o:o.defaultView;s=a?e.scrollX:e.scrollY,r=a?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,n=a?e.innerWidth:e.innerHeight}else s=a?o.scrollLeft:o.scrollTop,r=a?o.scrollWidth:o.scrollHeight,n=a?o.offsetWidth:o.offsetHeight;const c=()=>{e({scrollHeight:r,scrollTop:Math.max(s,0),viewportHeight:n})};i.suppressFlushSync?c():yr.flushSync(c),null!==l.current&&(s===l.current||s<=0||s===r-n)&&(l.current=null,t(!0),h.current&&(clearTimeout(h.current),h.current=null))}),[e,t,a]);return r.useEffect((()=>{const e=s||o.current;return n(s||o.current),c({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",c,{passive:!0}),()=>{n(null),e.removeEventListener("scroll",c)}}),[o,c,i,n,s]),{scrollByCallback:function(e){a&&(e={behavior:e.behavior,left:e.top}),o.current.scrollBy(e)},scrollerRef:o,scrollToCallback:function(i){const r=o.current;if(!r||(a?"offsetWidth"in r&&0===r.offsetWidth:"offsetHeight"in r&&0===r.offsetHeight))return;const n="smooth"===i.behavior;let s,c,d;ov(r)?(c=Math.max(Yw(r.document.documentElement,a?"width":"height"),a?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),s=a?r.innerWidth:r.innerHeight,d=a?window.scrollX:window.scrollY):(c=r[a?"scrollWidth":"scrollHeight"],s=Yw(r,a?"width":"height"),d=r[a?"scrollLeft":"scrollTop"]);const u=c-s;if(i.top=Math.ceil(Math.max(Math.min(u,i.top),0)),yb(s,c)||i.top===d)return e({scrollHeight:c,scrollTop:d,viewportHeight:s}),void(n&&t(!0));n?(l.current=i.top,h.current&&clearTimeout(h.current),h.current=setTimeout((()=>{h.current=null,l.current=null,t(!0)}),1e3)):l.current=null,a&&(i={behavior:i.behavior,left:i.top}),r.scrollTo(i)}}}const hv="-webkit-sticky",cv="sticky",dv=Xb((()=>{if(typeof document>"u")return cv;const e=document.createElement("div");return e.style.position=hv,e.style.position===hv?hv:cv}));function uv(e){return e}const Av=Aw((()=>{const e=hw((e=>`Item ${e}`)),t=hw(null),i=hw((e=>`Group ${e}`)),r=hw({}),n=hw(uv),s=hw("div"),a=hw(jm),o=(e,t=null)=>cw(nw(r,iw((t=>t[e])),ew()),t);return{components:r,computeItemKey:n,context:t,EmptyPlaceholder:o("EmptyPlaceholder"),FooterComponent:o("Footer"),GroupComponent:o("Group","div"),groupContent:i,HeaderComponent:o("Header"),HeaderFooterTag:s,ItemComponent:o("Item","div"),itemContent:e,ListComponent:o("List","div"),ScrollerComponent:o("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:o("ScrollSeekPlaceholder"),TopItemListComponent:o("TopItemList")}}));Km(ev,Av),dv();const pv={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},fv={outline:"none",overflowX:"auto",position:"relative"};function gv(e,t){if("string"!=typeof e)return{context:t}}function mv(e,t){return{item:"string"==typeof e?void 0:t}}function wv({useEmitter:t,useEmitterValue:i,usePublisher:n}){return r.memo((function({children:r,style:s,...a}){const o=n("scrollContainerState"),l=i("ScrollerComponent"),h=n("smoothScrollTargetReached"),c=i("scrollerRef"),d=i("context"),u=i("horizontalDirection")||!1,{scrollByCallback:A,scrollerRef:p,scrollToCallback:f}=lv(o,h,l,c,void 0,u);return t("scrollTo",f),t("scrollBy",A),e(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:p,style:{...u?fv:pv,...s},tabIndex:0,...a,...gv(l,d),children:r})}))}function bv({useEmitter:t,useEmitterValue:i,usePublisher:n}){return r.memo((function({children:s,style:a,...o}){const l=n("windowScrollContainerState"),h=i("ScrollerComponent"),c=n("smoothScrollTargetReached"),d=i("totalListHeight"),u=i("deviation"),A=i("customScrollParent"),p=i("context"),f=r.useRef(null),g=i("scrollerRef"),{scrollByCallback:m,scrollerRef:w,scrollToCallback:b}=lv(l,c,h,g,A);return av((()=>{var e;return w.current=A||(null==(e=f.current)?void 0:e.ownerDocument.defaultView),()=>{w.current=null}}),[w,A]),t("windowScrollTo",b),t("scrollBy",m),e(h,{ref:f,"data-virtuoso-scroller":!0,style:{position:"relative",...a,...0!==d?{height:d+u}:{}},...o,...gv(h,p),children:s})}))}dv();const vv=Aw((()=>{const e=hw((e=>i("td",{children:["Item $",e]}))),t=hw(null),r=hw((e=>i("td",{colSpan:1e3,children:["Group ",e]}))),n=hw(null),s=hw(null),a=hw({}),o=hw(uv),l=hw(jm),h=(e,t=null)=>cw(nw(a,iw((t=>t[e])),ew()),t);return{components:a,computeItemKey:o,context:t,EmptyPlaceholder:h("EmptyPlaceholder"),FillerRow:h("FillerRow"),fixedFooterContent:s,fixedHeaderContent:n,itemContent:e,groupContent:r,ScrollerComponent:h("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:h("ScrollSeekPlaceholder"),TableBodyComponent:h("TableBody","tbody"),TableComponent:h("Table","table"),TableFooterComponent:h("TableFoot","tfoot"),TableHeadComponent:h("TableHead","thead"),TableRowComponent:h("TableRow","tr"),GroupComponent:h("Group","tr")}})),yv=Aw((([e,t])=>({...e,...t})),Km(ev,vv)),Bv=({height:t})=>e("tr",{children:e("td",{style:{height:t}})}),Cv=({height:t})=>e("tr",{children:e("td",{style:{border:0,height:t,padding:0}})}),xv={overflowAnchor:"none"},Fv={position:dv(),zIndex:2,overflowAnchor:"none"},Nv=r.memo((function({showTopList:i=!1}){const r=Iv("listState"),n=Iv("computeItemKey"),s=Iv("firstItemIndex"),a=Iv("context"),o=Iv("isSeeking"),l=Iv("fixedHeaderHeight"),h=Iv("groupIndices").length>0,c=Iv("itemContent"),d=Iv("groupContent"),A=Iv("ScrollSeekPlaceholder")||Bv,p=Iv("GroupComponent"),f=Iv("TableRowComponent"),g=(i?r.topItems:[]).reduce(((e,t,i)=>(0===i?e.push(t.size):e.push(e[i-1]+t.size),e)),[]),m=(i?r.topItems:r.items).map((e=>{const t=e.originalIndex,r=n(t+s,e.data,a),m=i?0===t?0:g[t-1]:0;return o?u(A,{...gv(A,a),height:e.size,index:e.index,key:r,type:e.type||"item"}):"group"===e.type?u(p,{...gv(p,a),"data-index":t,"data-item-index":e.index,"data-known-size":e.size,key:r,style:{...Fv,top:l}},d(e.index,a)):u(f,{...gv(f,a),...mv(f,e.data),"data-index":t,"data-item-index":e.index,"data-known-size":e.size,"data-item-group-index":e.groupIndex,key:r,style:i?{...Fv,top:l+m}:xv},h?c(e.index,e.groupIndex,e.data,a):c(e.index,e.data,a))}));return e(t,{children:m})})),Sv=r.memo((function(){const t=Iv("listState"),n=Iv("topItemsIndexes").length>0,s=Uv("sizeRanges"),a=Iv("useWindowScroll"),o=Iv("customScrollParent"),l=Uv("windowScrollContainerState"),h=Uv("scrollContainerState"),c=o||a?l:h,d=Iv("trackItemSizes"),u=Iv("itemSize"),A=Iv("log"),{callbackRef:p,ref:f}=Cw(s,u,d,c,A,void 0,o,!1,Iv("skipAnimationFrameInResizeObserver")),[g,m]=r.useState(0);Dv("deviation",(e=>{g!==e&&(f.current.style.marginTop=`${e}px`,m(e))}));const w=Iv("EmptyPlaceholder"),b=Iv("FillerRow")||Cv,v=Iv("TableBodyComponent"),y=Iv("paddingTopAddition"),B=Iv("statefulTotalCount"),C=Iv("context");if(0===B&&w)return e(w,{...gv(w,C)});const x=(n?t.topItems:[]).reduce(((e,t)=>e+t.size),0),F=t.offsetTop+y+g-x,N=t.offsetBottom,S=F>0?e(b,{context:C,height:F},"padding-top"):null,E=N>0?e(b,{context:C,height:N},"padding-bottom"):null;return i(v,{"data-testid":"virtuoso-item-list",ref:p,...gv(v,C),children:[S,n&&e(Nv,{showTopList:!0}),e(Nv,{}),E]})})),Ev=({children:t})=>{const i=r.useContext(nv),n=Uv("viewportHeight"),s=Uv("fixedItemHeight"),a=yw(r.useMemo((()=>Hm(n,(e=>Yw(e,"height")))),[n]),!0,Iv("skipAnimationFrameInResizeObserver"));return r.useEffect((()=>{i&&(n(i.viewportHeight),s(i.itemHeight))}),[i,n,s]),e("div",{"data-viewport-type":"element",ref:a,style:{height:"100%",position:"absolute",top:0,width:"100%"},children:t})},Tv=({children:t})=>{const i=r.useContext(nv),n=Uv("windowViewportRect"),s=Uv("fixedItemHeight"),a=Iv("customScrollParent"),o=xw(n,a,Iv("skipAnimationFrameInResizeObserver"));return r.useEffect((()=>{i&&(s(i.itemHeight),n({offsetTop:0,visibleHeight:i.viewportHeight,visibleWidth:100}))}),[i,n,s]),e("div",{"data-viewport-type":"window",ref:o,style:{height:"100%",position:"absolute",top:0,width:"100%"},children:t})},Lv=r.memo((function(t){const n=Iv("useWindowScroll"),s=Iv("customScrollParent"),a=Uv("fixedHeaderHeight"),o=Uv("fixedFooterHeight"),l=Iv("fixedHeaderContent"),h=Iv("fixedFooterContent"),c=Iv("context"),d=yw(r.useMemo((()=>Hm(a,(e=>Yw(e,"height")))),[a]),!0,Iv("skipAnimationFrameInResizeObserver")),u=yw(r.useMemo((()=>Hm(o,(e=>Yw(e,"height")))),[o]),!0,Iv("skipAnimationFrameInResizeObserver")),A=s||n?Ov:Pv,p=s||n?Tv:Ev,f=Iv("TableComponent"),g=Iv("TableHeadComponent"),m=Iv("TableFooterComponent"),w=l?e(g,{ref:d,style:{position:"sticky",top:0,zIndex:2},...gv(g,c),children:l()},"TableHead"):null,b=h?e(m,{ref:u,style:{bottom:0,position:"sticky",zIndex:1},...gv(m,c),children:h()},"TableFoot"):null;return e(A,{...t,...gv(A,c),children:e(p,{children:i(f,{style:{borderSpacing:0,overflowAnchor:"none"},...gv(f,c),children:[w,e(Sv,{},"TableBody"),b]})})})})),{Component:kv,useEmitter:Dv,useEmitterValue:Iv,usePublisher:Uv}=rv(yv,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Lv),Pv=wv({useEmitter:Dv,useEmitterValue:Iv,usePublisher:Uv}),Ov=bv({useEmitter:Dv,useEmitterValue:Iv,usePublisher:Uv}),Rv=kv,Qv={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Hv={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:Mv,floor:_v,max:jv,min:zv,round:Vv}=Math;function Kv(e,t,i){return Array.from({length:t-e+1}).map(((t,r)=>({data:null===i?null:i[r+e],index:r+e})))}function qv(e,t){return e&&e.width===t.width&&e.height===t.height}function Gv(e,t){return e&&e.column===t.column&&e.row===t.row}const Wv=Aw((([{increaseViewportBy:e,listBoundary:t,overscan:i,visibleRange:r},{footerHeight:n,headerHeight:s,scrollBy:a,scrollContainerState:o,scrollTo:l,scrollTop:h,smoothScrollTargetReached:c,viewportHeight:d},u,A,{didMount:p,propsReady:f},{customScrollParent:g,useWindowScroll:m,windowScrollContainerState:w,windowScrollTo:b,windowViewportRect:v},y])=>{const B=hw(0),C=hw(0),x=hw(Qv),F=hw({height:0,width:0}),N=hw({height:0,width:0}),S=dw(),E=dw(),T=hw(0),L=hw(null),k=hw({column:0,row:0}),D=dw(),I=dw(),U=hw(!1),P=hw(0),O=hw(!0),R=hw(!1),Q=hw(!1);qm(nw(p,lw(P),tw((([e,t])=>!!t))),(()=>{Gm(O,!1)})),qm(nw(fw(p,O,N,F,P,R),tw((([e,t,i,r,,n])=>e&&!t&&0!==i.height&&0!==r.height&&!n))),(([,,,,e])=>{Gm(R,!0),wb(1,(()=>{Gm(S,e)})),Ym(nw(h),(()=>{Gm(t,[0,0]),Gm(O,!0)}))})),Xm(nw(I,tw((e=>null!=e&&e.scrollTop>0)),rw(0)),C),qm(nw(p,lw(I),tw((([,e])=>null!=e))),(([,e])=>{e&&(Gm(F,e.viewport),Gm(N,e.item),Gm(k,e.gap),e.scrollTop>0&&(Gm(U,!0),Ym(nw(h,aw(1)),(e=>{Gm(U,!1)})),Gm(l,{top:e.scrollTop})))})),Xm(nw(F,iw((({height:e})=>e))),d),Xm(nw(fw(gw(F,qv),gw(N,qv),gw(k,((e,t)=>e&&e.column===t.column&&e.row===t.row)),gw(h)),iw((([e,t,i,r])=>({gap:i,item:t,scrollTop:r,viewport:e})))),D),Xm(nw(fw(gw(B),r,gw(k,Gv),gw(N,qv),gw(F,qv),gw(L),gw(C),gw(U),gw(O),gw(P)),tw((([,,,,,,,e])=>!e)),iw((([e,[t,i],r,n,s,a,o,,l,h])=>{const{column:c,row:d}=r,{height:u,width:A}=n,{width:p}=s;if(0===o&&(0===e||0===p))return Qv;if(0===A){const t=bb(h,e);return function(e){return{...Hv,items:e}}(Kv(t,t+Math.max(o-1,0),a))}const f=Jv(p,A,c);let g,m;l?0===t&&0===i&&o>0?(g=0,m=o-1):(g=f*_v((t+d)/(u+d)),m=f*Mv((i+d)/(u+d))-1,m=zv(e-1,jv(m,f-1)),g=zv(m,jv(0,g))):(g=0,m=-1);const w=Kv(g,m,a),{bottom:b,top:v}=Xv(s,r,n,w),y=Mv(e/f);return{bottom:b,itemHeight:u,items:w,itemWidth:A,offsetBottom:y*u+(y-1)*d-b,offsetTop:v,top:v}}))),x),Xm(nw(L,tw((e=>null!==e)),iw((e=>e.length))),B),Xm(nw(fw(F,N,x,k),tw((([e,t,{items:i}])=>i.length>0&&0!==t.height&&0!==e.height)),iw((([e,t,{items:i},r])=>{const{bottom:n,top:s}=Xv(e,r,t,i);return[s,n]})),ew(Gw)),t);const H=hw(!1);Xm(nw(h,lw(H),iw((([e,t])=>t||0!==e))),H);const M=uw(nw(fw(x,B),tw((([{items:e}])=>e.length>0)),lw(H),tw((([[e,t],i])=>{const r=e.items[e.items.length-1].index===t-1;return(i||e.bottom>0&&e.itemHeight>0&&0===e.offsetBottom&&e.items.length===t)&&r})),iw((([[,e]])=>e-1)),ew())),_=uw(nw(gw(x),tw((({items:e})=>e.length>0&&0===e[0].index)),rw(0),ew())),j=uw(nw(gw(x),lw(U),tw((([{items:e},t])=>e.length>0&&!t)),iw((([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index}))),ew(qw),ow(0)));Xm(j,A.scrollSeekRangeChanged),Xm(nw(S,lw(F,N,B,k),iw((([e,t,i,r,n])=>{const s=gb(e),{align:a,behavior:o,offset:l}=s;let h=s.index;"LAST"===h&&(h=r-1),h=jv(0,h,zv(r-1,h));let c=Yv(t,n,i,h);return"end"===a?c=Vv(c-t.height+i.height):"center"===a&&(c=Vv(c-t.height/2+i.height/2)),l&&(c+=l),{behavior:o,top:c}}))),l);const z=cw(nw(x,iw((e=>e.offsetBottom+e.bottom))),0);return Xm(nw(v,iw((e=>({height:e.visibleHeight,width:e.visibleWidth})))),F),{customScrollParent:g,data:L,deviation:T,footerHeight:n,gap:k,headerHeight:s,increaseViewportBy:e,initialItemCount:C,itemDimensions:N,overscan:i,restoreStateFrom:I,scrollBy:a,scrollContainerState:o,scrollHeight:E,scrollTo:l,scrollToIndex:S,scrollTop:h,smoothScrollTargetReached:c,totalCount:B,useWindowScroll:m,viewportDimensions:F,windowScrollContainerState:w,windowScrollTo:b,windowViewportRect:v,...A,gridState:x,horizontalDirection:Q,initialTopMostItemIndex:P,totalListHeight:z,...u,endReached:M,propsReady:f,rangeChanged:j,startReached:_,stateChanged:D,stateRestoreInProgress:U,...y}}),Km(kb,Fw,Fb,Kb,pb,qb,vw));function Jv(e,t,i){return jv(1,_v((e+i)/(_v(t)+i)))}function Xv(e,t,i,r){const{height:n}=i;if(void 0===n||0===r.length)return{bottom:0,top:0};const s=Yv(e,t,i,r[0].index);return{bottom:Yv(e,t,i,r[r.length-1].index)+n,top:s}}function Yv(e,t,i,r){const n=Jv(e.width,i.width,t.column),s=_v(r/n),a=s*i.height+jv(0,s-1)*t.row;return a>0?a+t.row:a}const $v=Aw((()=>{const e=hw((e=>`Item ${e}`)),t=hw({}),i=hw(null),r=hw("virtuoso-grid-item"),n=hw("virtuoso-grid-list"),s=hw(uv),a=hw("div"),o=hw(jm),l=(e,i=null)=>cw(nw(t,iw((t=>t[e])),ew()),i),h=hw(!1),c=hw(!1);return Xm(gw(c),h),{components:t,computeItemKey:s,context:i,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:l("Item","div"),itemContent:e,listClassName:n,ListComponent:l("List","div"),readyStateChanged:h,reportReadyState:c,ScrollerComponent:l("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}})),Zv=Aw((([e,t])=>({...e,...t})),Km(Wv,$v)),ey=r.memo((function(){const t=oy("gridState"),i=oy("listClassName"),n=oy("itemClassName"),s=oy("itemContent"),a=oy("computeItemKey"),o=oy("isSeeking"),l=ly("scrollHeight"),h=oy("ItemComponent"),c=oy("ListComponent"),d=oy("ScrollSeekPlaceholder"),A=oy("context"),p=ly("itemDimensions"),f=ly("gap"),g=oy("log"),m=oy("stateRestoreInProgress"),w=ly("reportReadyState"),b=yw(r.useMemo((()=>e=>{const t=e.parentElement.parentElement.scrollHeight;l(t);const i=e.firstChild;if(i){const{height:e,width:t}=i.getBoundingClientRect();p({height:e,width:t})}f({column:dy("column-gap",getComputedStyle(e).columnGap,g),row:dy("row-gap",getComputedStyle(e).rowGap,g)})}),[l,p,f,g]),!0,!1);return av((()=>{t.itemHeight>0&&t.itemWidth>0&&w(!0)}),[t]),m?null:e(c,{className:i,ref:b,...gv(c,A),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map((i=>{const r=a(i.index,i.data,A);return o?e(d,{...gv(d,A),height:t.itemHeight,index:i.index,width:t.itemWidth},r):u(h,{...gv(h,A),className:n,"data-index":i.index,key:r},s(i.index,i.data,A))}))})})),ty=r.memo((function(){const t=oy("HeaderComponent"),i=ly("headerHeight"),n=oy("headerFooterTag"),s=yw(r.useMemo((()=>e=>{i(Yw(e,"height"))}),[i]),!0,!1),a=oy("context");return t?e(n,{ref:s,children:e(t,{...gv(t,a)})}):null})),iy=r.memo((function(){const t=oy("FooterComponent"),i=ly("footerHeight"),n=oy("headerFooterTag"),s=yw(r.useMemo((()=>e=>{i(Yw(e,"height"))}),[i]),!0,!1),a=oy("context");return t?e(n,{ref:s,children:e(t,{...gv(t,a)})}):null})),ry=({children:t})=>{const i=r.useContext(sv),n=ly("itemDimensions"),s=ly("viewportDimensions"),a=yw(r.useMemo((()=>e=>{s(e.getBoundingClientRect())}),[s]),!0,!1);return r.useEffect((()=>{i&&(s({height:i.viewportHeight,width:i.viewportWidth}),n({height:i.itemHeight,width:i.itemWidth}))}),[i,s,n]),e("div",{ref:a,style:{height:"100%",position:"absolute",top:0,width:"100%"},children:t})},ny=({children:t})=>{const i=r.useContext(sv),n=ly("windowViewportRect"),s=ly("itemDimensions"),a=oy("customScrollParent"),o=xw(n,a,!1);return r.useEffect((()=>{i&&(s({height:i.itemHeight,width:i.itemWidth}),n({offsetTop:0,visibleHeight:i.viewportHeight,visibleWidth:i.viewportWidth}))}),[i,n,s]),e("div",{ref:o,style:{height:"100%",position:"absolute",top:0,width:"100%"},children:t})},sy=r.memo((function({...t}){const r=oy("useWindowScroll"),n=oy("customScrollParent"),s=n||r?cy:hy,a=n||r?ny:ry,o=oy("context");return e(s,{...t,...gv(s,o),children:i(a,{children:[e(ty,{}),e(ey,{}),e(iy,{})]})})})),{useEmitter:ay,useEmitterValue:oy,usePublisher:ly}=rv(Zv,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},sy),hy=wv({useEmitter:ay,useEmitterValue:oy,usePublisher:ly}),cy=bv({useEmitter:ay,useEmitterValue:oy,usePublisher:ly});function dy(e,t,i){return"normal"!==t&&!(null!=t&&t.endsWith("px"))&&i(`${e} was not resolved to pixel value correctly`,t,ww.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}const uy=xi((()=>({root:{borderRadius:"8px",overflow:"hidden","&>.MuiTableRow-root .MuiTableCell-head":{fontWeight:600,color:"var(--theme-color1)",background:"var(--theme-color4)",whiteSpace:"nowrap",textOverflow:"ellipsis",userSelect:"none",padding:"6px 10px",paddingRight:0,"&:first-child":{borderRadius:"8px 0 0 8px"},"&:last-child":{borderRadius:"0 8px 8px 0","&::before":{display:"none"}}}}})))(li),Ay={Scroller:r.forwardRef(((t,i)=>e(ze,{component:Ve,...t,ref:i}))),Table:t=>e(qe,{...t,size:"small",sx:{borderCollapse:"collapse",width:"100%",tableLayout:"fixed"}}),TableHead:r.forwardRef(((t,i)=>e(je,{...t,ref:i,sx:{background:"var(--theme-color4)"}}))),TableRow:Ke,TableBody:r.forwardRef(((t,i)=>e(_e,{...t,ref:i,sx:{"&>.MuiTableRow-root .MuiTableCell-body":{fontWeight:500}}}))),TableFoot:r.forwardRef(((t,i)=>e(ve,{...t,ref:i,sx:{background:"var(--theme-color4)"}})))},py=({level:t})=>e("span",{style:{paddingLeft:10*t+"px"}}),fy=r.memo((({group:r,level:n=0,columns:s,columnWidths:o,onDoubleClickAction:l})=>{const d=r?.data?.length,u=r?.groups?.length,A=Ws(),[p,f]=c(!0),g=h((()=>{r.data&&f((e=>!e))}),[]),m=a((()=>r?.data?s.reduce(((e,t)=>(t.isDisplayTotal&&"number"===t.componentType&&(e[t.accessor]=Pm(r.data,t,A)),e)),{}):{}),[r?.data,s,A]),w=a((()=>r.groups?s.reduce(((e,t)=>(t.isDisplayTotal&&"number"===t.componentType&&(e[t.accessor]=qd(Om(r,t),t?.isVisibleCurrSymbol?sl(t?.currencySymbol??A.dynamicAmountSymbol):"",t?.currencyFormat??A.currencyFormat,t?.decimalCount??A.decimalCount,t?.symbolPosition??"start")),e)),{}):{}),[r,s,A]),b=a((()=>p&&r?.data?r.data.map((t=>e(Ke,{onDoubleClick:()=>{"function"==typeof l&&l({row:[{data:t}]})},children:s.map((i=>{const r=i.accessor,n=((e,t,i)=>{const{commonDateFormat:r,commonDateTimeFormat:n,commonTimeFormat:s,currencyFormat:a,decimalCount:o,dynamicAmountSymbol:l}=i;if(!t.componentType)return e;switch(t.componentType){case"date":return Um(e,t?.dateFormat??r??"dd/MM/yyyy");case"dateTime":return Um(e,t?.dateFormat??n??"dd/MM/yyyy HH:mm:ss");case"time":return Um(e,t?.dateFormat??s??"HH:mm:ss");case"number":return isNaN(Number(e))?"-":qd(e,t?.isVisibleCurrSymbol?sl(t?.currencySymbol??l):"",t?.currencyFormat??a,t?.decimalCount??o,t?.symbolPosition??"start");default:return e}})(t[r],i,A);return e(Ge,{align:i.alignment??"left",sx:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",minWidth:o[r],maxWidth:o[r],color:"function"==typeof i.color?i.color(t[r],t):"#000"},children:i?.showTooltip?e(pe,{title:n,children:n}):n},r)}))},t.id))):null),[p,r?.data,s,o,A]),v=a((()=>r?.data?e(Ke,{className:se("footer-row",{p0:!s.some((e=>"number"===e.componentType&&e.isDisplayTotal))}),children:s.map((t=>e(Ge,{align:t.alignment??"left",children:"number"===t.componentType&&t.isDisplayTotal?m[t.accessor]:""},t.accessor)))}):null),[r?.data,s,m]);return i(t,{children:[e(Ke,{children:s.map(((t,s)=>{const a=0===s,l=t.isDisplayTotal?m[t.accessor]:"",h=t.isDisplayTotal?w[t.accessor]:"";return e(Ge,{align:a?"left":t.alignment??"left",sx:{fontSize:"0.9rem",cursor:a?"pointer":"auto",width:o[t.accessor],minWidth:o[t.accessor],maxWidth:o[t.accessor],overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:0!==s?r.data?"var(--theme-color3)":"var(--theme-color1)":"#000"},onClick:a?g:void 0,children:a?i("div",{style:{display:"flex",alignItems:"center"},children:[i("strong",{className:"group-name",style:{display:"flex",alignItems:"center",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:[e(py,{level:n}),i("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[r.groupName,i("em",{style:{fontSize:".8rem",color:"#707070",fontWeight:500,marginLeft:"5px"},children:[u?`(${u} Groups)`:"",d?`(${d} Records)`:""]})]})]}),e("span",{style:{marginLeft:"auto",height:"18px",flexShrink:0},children:r?.data?e(p?Cr:xr,{fontSize:"small"}):null})]}):t.isDisplayTotal&&r.data?e("strong",{children:l}):t.isDisplayTotal&&r.groups?e("strong",{children:h}):""},t.accessor)}))}),p&&i(t,{children:[b,v]}),r.groups?.map(((t,i)=>e(fy,{group:t,level:n+1,columns:s,columnWidths:o,onDoubleClickAction:l},t.groupName||i)))]})})),gy=({columns:r,data:n,originalData:s,loading:o,metaData:l,hideFooter:d,onDoubleClickAction:u})=>{const A=Ws(),[p,f]=c(r.reduce(((e,t)=>({...e,[t.accessor]:Number(t.width)||150})),{})),g=a((()=>p),[p]),m=h(((e,t)=>{f((i=>({...i,[e]:t})))}),[]),w=h(((e,t)=>{const i=e.clientX,r=g[t.accessor];let n;const s=e=>{n&&cancelAnimationFrame(n),n=requestAnimationFrame((()=>{const n=Math.min(Math.max(t.minWidth||50,r+(e.clientX-i)),t.maxWidth||600);n!==g[t.accessor]&&m(t.accessor,n)}))},a=()=>{n&&cancelAnimationFrame(n),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a)};document.addEventListener("mousemove",s),document.addEventListener("mouseup",a)}),[g,m]);return e(Rv,{components:Ay,data:n,fixedFooterContent:()=>e(t,{children:d?null:e(ve,{sx:{position:"sticky",bottom:0},children:e(Ke,{className:"footer-row",children:r.map(((e,t)=>i(Ge,{align:e.alignment??"left",sx:{borderTop:"1px solid #bbb",minWidth:g[e.accessor],maxWidth:g[e.accessor]},children:[0===t?`Grand Total ${s.length}`:"","number"===e.componentType&&e.isDisplayTotal?Pm(s,e,A):""]},e.accessor)))})})}),fixedHeaderContent:()=>e(uy,{sx:{position:"sticky",top:0,zIndex:100},children:e(Ke,{children:r.map((t=>e(Ge,{sx:{minWidth:g[t.accessor],maxWidth:g[t.accessor],fontWeight:"bold",paddingRight:0},children:i("div",{style:{display:"flex",alignItems:"center",width:"100%",minWidth:0},children:[e("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textAlign:t?.alignment??"left"},children:t.columnName}),e("div",{onMouseDown:e=>w(e,t),style:{cursor:"col-resize",paddingLeft:"10px",flexShrink:0,display:"flex",alignItems:"center"},children:e("div",{style:{width:"2px",height:"12px",background:"#ddd"}})})]})},t.accessor)))})}),itemContent:(t,i)=>e(fy,{group:i,level:0,columns:r,columnWidths:g,onDoubleClickAction:u},i.groupName??t),style:{height:l?.gridConfig?.maxHeight??"70vh"}})},my=({data:t,setGlobalFilterData:i,visibleKeys:r})=>{const{t:n}=ne(),[s,a]=c(""),o=((e,t=500)=>{const[i,r]=c(e);return l((()=>{const i=setTimeout((()=>r(e)),t);return()=>clearTimeout(i)}),[e,t]),i})(s,300);l((()=>{const e=o?t.filter((e=>r.some((t=>{const i=e[t];return i&&i.toString().toLowerCase().includes(o.toLowerCase())})))):t;i(e)}),[o,t,r,i]);return e(wl,{type:"text",value:s,onChange:e=>{a(e.target.value)},placeholder:`${n("profile.Searchin")} ${t.length||0} ${n("records")}`})},wy=r.memo((({title:t,columns:r,metaData:n,groups:s,hideHeader:o,hideFooter:l,dataFetcher:d,reportID:u,otherAPIRequestPara:A={},autoFetch:p=!0,retrievalComponent:f,retrievalType:g,onClose:m,allowRefetch:w=!0,onDoubleClickAction:b,headerToolbarStyle:v={}})=>{const{t:y}=ne(),[B,C]=c(p),[x,F]=c([]),N=h((e=>{F(e),C(!0)}),[C,F]),{data:S,isFetching:E,isLoading:T,isError:L,error:k,refetch:D}=zt([d,u,x,A],(()=>d(u,x,A)),{cacheTime:0,enabled:B}),I=a((()=>T||E),[E,T]),[U,P]=c([]),[O,R]=c(S??[]),Q=a((()=>r.filter((e=>!1!==e.isVisible))),[r]),H=a((()=>Array.isArray(Q)?Q.map((e=>({...e,columnName:y(e.columnName)}))):[]),[y,Q]),M=a((()=>H.map((e=>e.accessor))),[H]),_=a((()=>qo(U,S??[])),[U,S]),j=a((()=>qo(U,O)),[U,O]),z=a((()=>I?[]:((e,t)=>{if(!t.length)return[];const i=new Map;e.forEach((e=>{let r=i;t.forEach(((i,n)=>{const s=`${i.groupName??""} ${e[i.accessor]}`;r.has(s)||r.set(s,n===t.length-1?{groupName:s.trim(),data:[]}:new Map),n===t.length-1?r.get(s).data.push(e):r=r.get(s)}))}));const r=e=>Array.from(e,(([e,t])=>t instanceof Map?{groupName:e,groups:r(t)}:t));return r(i)})(j,s)),[j,s,I]),V=a((()=>Zg(n.filters?n.filters:[])),[n.filters]);return i(me,{className:"layout-report-parent",sx:{display:"flex",flexDirection:"column",padding:"1rem",overflow:"auto"},children:[L?e(Va,{severity:k?.severity??"error",errorMsg:k?.error_msg??"Error",errorDetail:k?.error_detail??""}):null,i(Ve,{style:{width:"100%",overflowX:"auto"},children:[i(Ve,{style:{width:"100%",overflow:"hidden",marginBottom:"8px",display:o?"none":"inherit"},children:[i(Ie,{className:"layout__report__header",variant:"dense",sx:{display:"flex",alignItems:"center",justifyContent:"space-between",...v},style:{background:"var(--primary-bg)"},children:[e(fe,{variant:"h5",color:"primary",children:t.trim()}),i(Ue,{direction:"row",alignItems:"center",className:"group-report-header-tools",children:[e(bg,{filterData:x,filterMeta:V,isOpenRetrievalDefault:!B,retrievalComponent:f,retrievalType:g,setAllFilters:P,setQueryFilters:N,setShowFilters:()=>{}}),V.length>0&&e(Ul,{setAllFilters:P,filters:U,filterMeta:V,gotoPage:()=>{},setSortBy:()=>{},classes:{}}),w?e(Be,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:()=>D(),color:"primary",children:e(qi,{})}):null,e(my,{data:_,setGlobalFilterData:R,visibleKeys:M}),"function"==typeof m?e(tl,{title:y("Close"),arrow:!0,children:e(Be,{onClick:m,size:"small",sx:{width:"35px",height:"35px",padding:0},children:e(Bt,{fontSize:"medium",style:{color:"var(--white)"}})})}):null]})]}),x.length?e(fg,{dense:!0,setAllFilters:F,filters:x}):null,U.length>0&&e(Xl,{dense:!0,setAllFilters:P,filters:U,gotoPage:()=>{},setSortBy:()=>{}}),I&&e(We,{color:"secondary"})]}),e(gy,{columns:H,data:z,originalData:j,metaData:n,loading:I,hideFooter:l,onDoubleClickAction:b})]})]})})),by=({name:t,validate:r,validationRun:n,postValidationSetCrossFieldValues:s,runValidationOnDependentFieldsChange:a,runPostValidationHookAlways:c,shouldExclude:d,isReadOnly:A,dependentFields:p,fieldKey:f,GridProps:g,CircularProgressProps:m,enableGrid:w,StartAdornment:b,EndAdornment:v,isFieldFocused:y,maxLength:C=-1,label:x,skipValueUpdateFromCrossFieldWhenReadOnly:F,...N})=>{const{value:S,error:E,touched:T,handleChange:L,handleBlur:k,isSubmitting:D,validationRunning:I,fieldKey:U,name:P,excluded:O,readOnly:R,incomingMessage:Q,whenToRunValidation:H,runValidation:M}=Js({name:t,fieldKey:f,dependentFields:p,validate:r,validationRun:n,runPostValidationHookAlways:c,postValidationSetCrossFieldValues:s,isReadOnly:A,shouldExclude:d,runValidationOnDependentFieldsChange:a,skipValueUpdateFromCrossFieldWhenReadOnly:F}),_=h((e=>{L(e,e.target?.formattedValue??void 0)}),[L]),j=o();if(l((()=>{y&&setTimeout((()=>{j?.current?.focus?.()}),1)}),[y]),l((()=>{if(null!==Q&&"object"==typeof Q){const{value:e}=Q;"DEFAULT_VALUE"!==e&&L(e),"onBlur"===H&&M({value:e},!0)}}),[Q,L,M,H]),O)return null;const z=T&&Boolean(E),V=i($e,{disabled:D,children:[e(Ut,{children:x}),u(Fr,{...N,key:U,id:U,name:P,value:S,InputProps:{endAdornment:I?e(B,{position:"end",children:e(re,{color:"primary",variant:"indeterminate",...m})}):Boolean(v)?v:null,startAdornment:Boolean(b)?e(B,{position:"start",children:b}):null},InputLabelProps:{shrink:!0},inputRef:j,onChange:e=>{(-1===C||e.target.value.length<=C)&&_(e)},inputProps:{readOnly:R,tabIndex:R?-1:void 0},onBlur:k,disabled:D}),e(Ze,{children:z?E:""})]});return Boolean(w)?e(ie,{...g,children:V}):V};var vy=Object.freeze({__proto__:null,TextareaAutosize:by,default:by});const yy=({name:e,fieldKey:t,setValueOnDependentFieldsChange:i,dependentFields:r,ignoreInSubmit:n=!1,postValidationSetCrossFieldValues:s,validationRun:a,runValidationOnDependentFieldsChange:o,AlwaysRunPostValidationSetCrossFieldValues:h,runExternalFunction:c,onFormDataChange:d,runPostValidationForInitValue:u})=>{const{handleBlur:A,handleChange:p,dependentValues:f,incomingMessage:g,setIgnoreInSubmit:m,runValidation:w,whenToRunValidation:b,formState:v}=Js({name:e,fieldKey:t,dependentFields:r,postValidationSetCrossFieldValues:s,validationRun:a,runValidationOnDependentFieldsChange:o,AlwaysRunPostValidationSetCrossFieldValues:h,runExternalFunction:c,onFormDataChange:d,runPostValidationForInitValue:u});return l((()=>{A()}),[A]),l((()=>{if(Boolean(n))if("function"==typeof n){let e=n(ta(f),v);m(e)}else m(n)}),[n,m,f]),l((()=>{if("function"==typeof i){let e=i(ta(f),v);void 0===e&&null===e||p(e)}}),[f,p,i]),l((()=>{if(null!==g&&"object"==typeof g){const{value:e}=g;(Boolean(e)||""===e)&&(p(e),"onBlur"===b&&w({value:e},!0))}}),[g,p,w,b]),null};var By=Object.freeze({__proto__:null,HiddenField:yy,default:yy}),Cy=Object.freeze({__proto__:null,Typography:Lp,default:Lp});const xy=Ci((e=>Fi({cardHeader:{padding:e.spacing(1,2)},list:{width:200,height:230,backgroundColor:e.palette.background.paper,overflow:"auto"},button:{margin:e.spacing(.5,0)}}))),Fy=(e,t)=>e.filter((e=>t.findIndex((t=>t?.value===e?.value))<0)),Ny=(e,t)=>e.filter((e=>t.findIndex((t=>t?.value===e))<0)),Sy=(e,t)=>e.filter((e=>t.findIndex((t=>t===e))<0)),Ey=(e,t)=>{let i=e.filter((e=>-1!==t.findIndex((t=>t?.value===e))));return t.filter((e=>i.indexOf(e?.value)>=0))},Ty=({label:t="",leftOptions:r,rightOptions:n,leftOptionsLabel:s,rightOptionsLabel:a,valueSide:o,disabled:h=!1,error:d=!1,readOnly:u=!1,helperText:A="",handleChange:f=()=>{},handleBlur:g=()=>{}})=>{const m=xy(),[w,b]=c([]),[v,y]=c(r??[]),[B,C]=c(n??[]),x=Ey(w,v),F=Ey(w,B);l((()=>{y(r),C(n),f("left"===o?r.map((e=>e.value)):n.map((e=>e.value)))}),[r,n]);const N=e=>Ey(w,e).length,S=e=>()=>{u||(N(e)===e.length?b(Ny(w,e)):b(((e,t)=>[...e,...Sy(t.map((e=>e?.value)),e)])(w,e)))},E=(t,r,n)=>i(st,{style:n?{borderBottom:"2px solid #f44336"}:void 0,children:[e(lt,{className:m.cardHeader,avatar:e(ui,{onClick:S(r),checked:N(r)===r.length&&0!==r.length,indeterminate:N(r)!==r.length&&0!==N(r),disabled:0===r.length||h,inputProps:{"aria-label":"all items selected"}}),title:t,subheader:`${N(r)}/${r.length} selected`}),e(nr,{}),i(Nr,{className:m.list,dense:!0,component:"div",role:"list",children:[r.map((t=>{return i(Sr,{role:"listitem",button:!0,onClick:(r=t.value,()=>{if(u)return;const e=w.indexOf(r),t=[...w];-1===e?t.push(r):t.splice(e,1),b(t)}),dense:!0,style:{padding:"0px 16px"},disabled:h,children:[e(Tr,{children:e(ui,{style:{padding:"0px 8px"},checked:-1!==w.indexOf(t.value),tabIndex:-1,disableRipple:!0,disabled:h})}),e(Er,{id:t.value,primary:t.label})]},t.value);var r})),e(Sr,{})]})]});return i(p,{children:[e(fe,{variant:"h6",children:t}),i(ie,{container:!0,spacing:2,justifyContent:"center",alignItems:"center",tabIndex:0,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||g(e)},children:[e(ie,{item:!0,xs:5,md:5,sm:5,children:E(s,v,d)}),e(ie,{item:!0,xs:2,md:2,sm:2,children:i(ie,{container:!0,direction:"column",alignItems:"center",children:[e(ct,{variant:"outlined",size:"small",className:m.button,onClick:()=>{if(u)return;let e=B.concat(x),t=Fy(v,x);b(Ny(w,x)),y(t),C(e),f("left"===o?t.map((e=>e.value)):e.map((e=>e.value)))},disabled:0===x.length||h,"aria-label":"move selected right",children:">"}),e(ct,{variant:"outlined",size:"small",className:m.button,onClick:()=>{if(u)return;let e=v.concat(F),t=Fy(B,F);b(Ny(w,F)),y(e),C(t),f("left"===o?e.map((e=>e.value)):t.map((e=>e.value)))},disabled:0===F.length||h,"aria-label":"move selected left",children:"<"})]})}),e(ie,{item:!0,xs:5,md:5,sm:5,children:E(a,B,d)})]}),e(Ze,{disabled:h,error:d,children:A})]})},Ly=({name:t,fieldKey:i,label:r,validate:n,validationRun:s,shouldExclude:a,isReadOnly:o,postValidationSetCrossFieldValues:l,runPostValidationHookAlways:h,dependentFields:d,leftOptions:u,rightOptions:A,GridProps:p,enableGrid:f,isFieldFocused:g,runValidationOnDependentFieldsChange:m,_leftOptionsKey:w,_rightOptionsKey:b,disableCaching:v,leftOptionsLabel:y,rightOptionsLabel:B,valueSide:C})=>{const{error:x,touched:F,handleChange:N,handleBlur:S,runValidation:E,isSubmitting:T,fieldKey:L,name:k,dependentValues:D,excluded:I,incomingMessage:U,whenToRunValidation:P,readOnly:O,formState:R,setIncomingMessage:Q}=Js({name:t,fieldKey:i,dependentFields:d,validate:n,validationRun:s,runPostValidationHookAlways:h,postValidationSetCrossFieldValues:l,isReadOnly:o,shouldExclude:a,runValidationOnDependentFieldsChange:m}),[H,M]=c([]),[_,j]=c([]),{loadingOptions:z}=co(R,u,M,N,D,U,E,P,w,v,Q,!0,"",!1),{loadingOptions:V}=co(R,A,j,N,D,U,E,P,b,v,Q,!0,"",!1);if(I)return null;const K=F&&""!==(x??""),q=z||V?e("span",{children:"loading..."}):e(Ty,{name:k,label:r,error:!T&&K,helperText:!T&&K?x:null,handleChange:N,handleBlur:S,disabled:T,readOnly:O,leftOptions:H,rightOptions:_,leftOptionsLabel:y,rightOptionsLabel:B,valueSide:C},L);return Boolean(f)?e(ie,{...p,children:q}):q};var ky=Object.freeze({__proto__:null,TransferList:Ly,default:Ly});const Dy=({name:t,validate:r,validationRun:n,postValidationSetCrossFieldValues:s,runValidationOnDependentFieldsChange:a,skipValueUpdateFromCrossFieldWhenReadOnly:d,runPostValidationHookAlways:A,shouldExclude:f,isReadOnly:g,dependentFields:m,fieldKey:w,GridProps:b,enableGrid:v,InputProps:y,inputProps:x,isFieldFocused:F,maxLength:N=-1,setColor:S,searchComponent:E=()=>e("span",{children:"No component found attached"}),...T})=>{const{value:L,error:k,touched:D,handleChange:I,handleBlur:U,isSubmitting:P,fieldKey:O,name:R,excluded:Q,readOnly:H,incomingMessage:M,whenToRunValidation:_,runValidation:j,validationAPIResult:z,setIncomingMessage:V}=Js({name:t,fieldKey:w,dependentFields:m,validate:r,validationRun:n,runPostValidationHookAlways:A,postValidationSetCrossFieldValues:s,isReadOnly:g,shouldExclude:f,runValidationOnDependentFieldsChange:a,skipValueUpdateFromCrossFieldWhenReadOnly:d}),[K,q]=c(!1),[G,W]=c("string"==typeof S?S:"");l((()=>{if("function"==typeof S){let e=S(L);W("string"!=typeof e?"":e)}}),[L,S]);const J=h((e=>{I(e,e.target?.formattedValue??void 0)}),[I]),X=h((e=>{"object"==typeof e?V(e):I(e,e),q(!1)}),[I]),Y=o();if(l((()=>{F&&setTimeout((()=>{Y?.current?.focus?.()}),1)}),[F]),l((()=>{if(null!==M&&"object"==typeof M){const{value:e}=M;(Boolean(e)||""===e)&&(I(e),"onBlur"===_&&j({value:e},!0))}}),[M,I,j,_]),Q)return null;y?.inputProps&&(y.inputProps={...y.inputProps,readOnly:H,tabIndex:H?-1:void 0});const $=D&&Boolean(k),Z=i(p,{children:[u(to,{...T,key:O,id:O,name:R,value:L,error:!P&&$,helperText:e("div",{style:{display:"flex"},children:e(Ze,{children:!P&&$?k:Boolean(z)?z:null})}),FormHelperTextProps:{component:"div"},InputProps:{style:!P&&Boolean(G)?{color:G,fontWeight:"bold"}:{},endAdornment:e(B,{position:"end",children:e(C,{"aria-label":"toggle password visibility",onClick:()=>q(!0),children:e(Lr,{})})}),...y},InputLabelProps:{shrink:!0},inputRef:Y,onChange:e=>{(-1===N||e.target.value.length<=N)&&J(e)},inputProps:{readOnly:H,tabIndex:H?-1:void 0,...x},onBlur:U,disabled:P}),e(dt,{open:K,onClose:()=>q(!1),maxWidth:"md",children:u(E,{onAccept:X,value:L},null)})]});return Boolean(v)?e(ie,{...b,children:Z}):Z};var Iy=Object.freeze({__proto__:null,SearchField:Dy,default:Dy});var Uy=Object.freeze({__proto__:null,default:({name:t,validate:i,validationRun:r,postValidationSetCrossFieldValues:n,runValidationOnDependentFieldsChange:s,runPostValidationHookAlways:a,shouldExclude:h,isReadOnly:c,dependentFields:d,fieldKey:A,isFieldFocused:f,setValueOnDependentFieldsChange:g,skipValueUpdateFromCrossFieldWhenReadOnly:m,label:w,enableGrid:b,GridProps:v,onFormButtonClickHandel:y,startsIcon:B,endsIcon:C,rotateIcon:x,iconStyle:F,tabIndex:N,ignoreInSubmit:S=!1,...E})=>{const{value:T,error:L,touched:k,handleChange:D,handleBlur:I,isSubmitting:U,validationRunning:P,fieldKey:O,name:R,excluded:Q,readOnly:H,incomingMessage:M,whenToRunValidation:_,runValidation:j,validationAPIResult:z,dependentValues:V,formState:K,setIgnoreInSubmit:q}=Js({name:t,fieldKey:A,dependentFields:d,validate:i,validationRun:r,runPostValidationHookAlways:a,postValidationSetCrossFieldValues:n,isReadOnly:c,shouldExclude:h,runValidationOnDependentFieldsChange:s,skipValueUpdateFromCrossFieldWhenReadOnly:m}),G=o();l((()=>{f&&W()}),[f,T]);const W=()=>{setTimeout((()=>{G?.current?.focus?.()}),1)};if(l((()=>{if("function"==typeof g){let e=g(ta(V),K);null!=e&&D(e)}}),[V,D,g]),l((()=>{if(null!==M&&"object"==typeof M){const{value:e,isFieldFocused:t}=M;(Boolean(e)||""===e)&&(D(e),t&&W(),"onBlur"===_&&j({value:e},!0))}}),[M,D,j,_]),l((()=>{if(Boolean(S))if("function"==typeof S){let e=S(ta(V),K,{isSubmitting:U,value:T});q(e)}else q(S)}),[S,q,V,T]),Q)return null;const J=e(p,{children:e(za,{color:"secondary",onClick:e=>{"function"==typeof y&&y(A,ta(V)),D(isNaN(T)||!Boolean(T)?"1":parseInt(T)+1)},disabled:H??!1,style:{width:"100%",paddingLeft:"10px",marginTop:"17px"},starticon:B,endicon:C,rotateIcon:x,ref:G,tabIndex:N,sx:{"& svg":{...F}},children:w})});return Boolean(b)?u(Se,{...v,key:A,container:!0,justifyContent:"center",alignItems:"center",alignSelf:"start",mt:"0.65rem"},J):J}});const Py=({name:t,label:i,shouldExclude:r,dependentFields:n,fieldKey:s,GridProps:a,setValueOnDependentFieldsChange:o,skipValueUpdateFromCrossFieldWhenReadOnly:h,DividerProps:c,componentType:d})=>{const{value:u,handleChange:A,excluded:p,incomingMessage:f,dependentValues:g}=Js({name:t,fieldKey:s,dependentFields:n,shouldExclude:r,componentType:d,skipValueUpdateFromCrossFieldWhenReadOnly:h}),{t:m}=ne();return l((()=>{if("function"==typeof o){let e=o(ta(g));null!=e&&A(e)}}),[g,A,o]),l((()=>{if(null!==f&&"object"==typeof f){const{value:e}=f;(Boolean(e)||""===e)&&A(e)}}),[f,A]),p?null:e(Se,{item:!0,...a,children:e(Ee,{textAlign:"left",...c,children:u&&u.length>0?u:m(i??"")})})};var Oy=Object.freeze({__proto__:null,Divider:Py,default:Py});const Ry=t=>{let{defaultValue:r,label:n,enableGrid:s,GridProps:a}=t;"object"==typeof r&&(r=Array.isArray(r)?r.join(","):r?.toDateString?.()??"Invalid Value"),"boolean"==typeof r&&(r=r?"Yes":"No");let o=i("div",{children:[e("b",{children:n}),e("br",{}),r]});return Boolean(s)?e(ie,{...a,children:o}):o};var Qy=Object.freeze({__proto__:null,default:Ry,valueField:Ry});export{Da as AddIDinResponseData,Im as AgGridTableWrapper,Va as Alert,zs as AuthContextProvider,Tl as AutoRefreshProvider,_p as CRUDContext,jp as CRUDContextProvider,La as CheckObjectAllKeyisEmpty,so as Checkbox,no as ChipTextField,oo as ClearCacheContext,lo as ClearCacheProvider,rA as ColorlibConnector,iA as ColorlibStepIconRoot,Ja as ConvertExcelToJSONData,Oa as CreateDetailsRequestData,Pa as CreateLanguageRequestData,Cu as CsvViewer,Gs as CustomPropertiesConfigurationProvider,pA as DataTableGridWrapper,Ua as DefaultErrorObject,hg as DetailsGridWithHeader,Vf as DocumentGridCRUD,Vc as EXPORT_WORKER_STATUS,Bu as ExcelViewer,_a as ExportCSVFileFromData,Ma as ExportExcelFileFromData,Eu as FileUploadControl,Lu as FileViewerGrid,Op as FormComponentView,_s as FormContext,Ac as FormWrapper,ad as FullScreenLoader,za as GradientButton,Xf as GridCRUD,Wa as GridDataExport,ku as GridDataImport,Xd as GridWrapper,Yd as GridWrapperStatic,il as HtmlTooltip,Fu as ImageViewer,Uo as Input,Io as InputLabel,Eo as KeyboardDatePicker,Lo as KeyboardDateTimePicker,To as KeyboardTimePicker,wy as LayoutReport,sd as LoaderPaperComponent,Ga as LoadingTextAnimation,Mp as MasterDetailsForm,wA as MessageBoxNavigateWrapper,mA as MessageBoxWrapper,Nu as NoPreview,Ra as ObjectMappingKeys,xu as PDFViewer,ed as PopupContext,td as PopupContextProvider,bA as PopupMessageAPIWrapper,Gc as PopupRequestWrapper,gA as PrintButton,Ha as ProcessDetailsData,nd as RemarksAPIWrapper,tm as ReportGrid,lm as ReportWrapper,wl as SearchBar,bl as SearchBar2,Fo as SelectWithoutOptions,eg as ServerGrid,Yf as ServerGridContext,$f as ServerGridContextProvider,tg as ServerGridWrapper,Gf as SimpleCRUD,og as SnackbarProviderWrapper,Qa as StringtoUnicode,rg as Tab,ng as Tabs,to as TextField,ro as TextField3,io as TextFieldForSelect,ya as TimeTravelObserver,PA as ToggleButtonGroup,tl as Tooltip,th as Transition,ka as UpdateRequestDataVisibleColumn,nu as UploadTarget,_c as WorkerContext,jc as WorkerContextProvider,xs as atomKeys,Fa as attachMethodsToMetaData,ho as cacheWrapperKeyGen,gu as cleanFileObj,Uc as components,au as computeFileFingerprint,ou as computeSize,wu as convertToFormData,mu as convertToJsonObject,nl as currencySymbol,dm as customCellAggFunc,Ta as deriveData,Ea as deriveFormData,lu as detectMimeType,wm as displayNumber,du as downloadFile,mm as dynamicRowHeight,Au as extractColumnsFromAdditionalMetaData,Sa as extractGridMetaData,Na as extractMetaData,Zd as fileColumns,rm as filters,pm as findFirstDisplayColumn,Am as findLastDisplayColumn,Qs as formArrayFieldRegisterSelector,Rs as formArrayFieldRegistryAtom,Os as formArrayFieldRowsAtom,Hs as formArrayFieldUnregisterSelector,Fs as formAtom,Ns as formFieldAtom,ks as formFieldExcludeAddSelector,Ds as formFieldExcludeRemoveSelector,Us as formFieldRegisterSelector,Is as formFieldRegistryAtom,Ps as formFieldUnregisterSelector,Es as formFieldsErrorWatcherAddSelector,Ss as formFieldsErrorWatcherAtom,Ts as formFieldsErrorWatcherRemoveSelector,Ls as formFieldsExcludedAtom,qd as formatCurrency,hm as getAgGridSRNo,sl as getCurrencySymbol,fm as getGridRowData,bs as getIn,ds as greaterThanDate,us as greaterThanInclusiveDate,ls as greaterThanInclusiveString,os as greaterThanString,Ia as groupBy,ym as handleDeleteButtonClick,su as hashCode,cu as isDuplicate,ws as isInteger,hu as isMimeTypeValid,ms as isObject,gs as isString,bm as lessThanDate,ps as lessThanInclusiveDate,cs as lessThanInclusiveString,hs as lessThanString,um as parseDate,ao as queryClient,gm as removeExistingRowData,fs as ruleEngine,Zf as serverGridContextGenerator,vm as setErrorMessage,vs as setIn,ss as singletonFunctionRegisrationFactory,as as singletonFunctionRegisrationFactoryForTableCells,Ms as subscribeToFormFieldsSelector,ta as transformDependentFieldsState,fu as transformFileObject,uu as transformMetaDataByMutating,kl as useAutoRefresh,Wf as useDialogStyles,lg as useDialogStylesDetailsGrid,Js as useField,va as useFieldArray,ba as useForm,id as usePopupContext,Ws as usePropertiesConfigContext,ag as useSnackbarProviderWrapper,ig as useTabStyles,zc as useWorkerContext,wa as utilFunction,pu as validateFilesAndAddToList,Cs as yupReachAndValidate,Bs as yupValidationHelper};
|
|
134
134
|
//# sourceMappingURL=index.js.map
|