UNPKG

knoxui-react

Version:

KnoxUI is a corporate-focused React component library.

26 lines 73.1 kB
import*as e from"react";import t,{forwardRef as n,createElement as r,useState as o,useRef as a,useMemo as l,useEffect as i,useCallback as s}from"react";import{utils as c,writeFile as u}from"xlsx";import d from"jspdf";var h=function(){return h=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},h.apply(this,arguments)};function f(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function p(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var m={xs:"px-2 py-0.5 text-xs",sm:"px-3 py-1 text-sm",md:"px-4 py-1.5 text-base",lg:"px-5 py-2 text-lg",xl:"px-6 py-2.5 text-xl"},g={primary:"bg-primary border-primary hover:bg-primary/50 text-white",secondary:"bg-secondary border-secondary hover:bg-secondary-600 text-white",success:"bg-success border-success hover:bg-success-600 text-white",warning:"bg-warning border-warning hover:bg-warning-600 text-white",error:"bg-error border-error hover:bg-error-600 text-white",ghost:"bg-ghost border-ghost hover:bg-gray-100 text-gray-800 dark:text-gray-100 dark:hover:bg-gray-800/50"},y={ripple:"overflow-hidden relative",push:"transform active:scale-90 transition-transform",none:""},v=function(e){var n=e.children,r=e.size,o=void 0===r?"md":r,a=e.variant,l=void 0===a?"primary":a,i=e.clickEffect,s=void 0===i?"ripple":i,c=e.isLoading,u=void 0!==c&&c,d=e.className,p=void 0===d?"":d,v=e.disabled,b=void 0!==v&&v,w=e.onClick,x=f(e,["children","size","variant","clickEffect","isLoading","className","disabled","onClick"]),C="font-semibold rounded-md transition-colors duration-400 h-min select-none border duration-200 transition-all hover:shadow-lg ".concat("ghost"!==l?"focus:shadow-lg":""," ").concat(b&&"opacity-90 cursor-not-allowed"," ").concat(p),E=m[o],S=g[l],k=y[s],P="".concat(C," ").concat(E," ").concat(S," ").concat(k," ").concat(u?"opacity-90 cursor-progress":"");return t.createElement("button",h({className:P,onClick:function(e){if("ripple"===s&&!u&&!b){var t=e.currentTarget,n=document.createElement("span");n.className="absolute bg-white opacity-25 rounded-full animate-ripple";var r=t.getBoundingClientRect(),o=Math.max(r.width,r.height),a=e.clientX-r.left-o/2,l=e.clientY-r.top-o/2;n.style.width=n.style.height="".concat(o,"px"),n.style.left="".concat(a,"px"),n.style.top="".concat(l,"px"),t.appendChild(n),setTimeout((function(){n.remove()}),600)}!w||u||b||w(e)},disabled:b||u},x),u?t.createElement("span",{className:"flex items-center justify-center"},t.createElement("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},t.createElement("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.createElement("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})),"Loading..."):n)},b={xs:"p-0.5 text-xs",sm:"p-1 text-sm",md:"p-1.5 pl-2 text-base",lg:"p-2 pl-2.5 text-lg",xl:"p-3 pl-4 text-xl"},w={primary:"border-primary outline-primary accent-primary",secondary:"border-secondary outline-secondary accent-secondary",success:"border-success outline-success accent-success",warning:"border-warning outline-warning accent-warning",error:"border-error outline-error accent-error",ghost:"focus:outline-none"},x={primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",warning:"bg-warning",error:"bg-error",ghost:"bg-base-300"},C="w-full border rounded-md transition-all duration-200 focus:shadow-lg bg-base-200 border-base-300 flex items-center",E=function(e){var n=e.checked,r=void 0!==n&&n,o=e.size,a=void 0===o?"md":o,l=e.variant,i=void 0===l?"primary":l,s=e.label,c=e.onChange,u=e.className,d=void 0===u?"":u,p=e.wrapperClass,m=void 0===p?"":p,g=e.sx,y=e.isButton,v=void 0!==y&&y,E=f(e,["checked","size","variant","label","onChange","className","wrapperClass","sx","isButton"]),S=function(e){c&&c(e)},k=w[i];return v?t.createElement("label",{className:"".concat(C," ").concat(b[a]," ").concat(k," ").concat(r&&"ghost"!==i?x[i]:"!bg-transparent"," ").concat(d," cursor-pointer"),style:g},t.createElement("input",h({type:"radio",checked:r,onChange:S,className:"sr-only"},E)),t.createElement("span",{className:"w-full text-center ".concat(r&&"ghost"!==i?"text-white":"")},s)):s?t.createElement("div",{className:m,style:g},t.createElement("label",{className:"".concat(C," ").concat(b[a]," ").concat(r&&"ghost"!==i?x[i]:"")},t.createElement("input",h({type:"radio",checked:r,onChange:S,className:"".concat(k," ").concat(d," ").concat(r&&"ghost"!==i?x[i]:"")},E)),t.createElement("span",{className:"ml-2 ".concat(r?"text-white":"")},s))):t.createElement("input",h({type:"radio",className:"".concat(k," ").concat(d," ").concat(r&&"ghost"!==i?x[i]:""),checked:r,onChange:S,style:g},E))},S={xs:"p-0.5 text-xs",sm:"p-1 text-sm",md:"p-1.5 text-base",lg:"p-2 text-lg",xl:"p-3 text-xl"},k={primary:"border-primary outline-primary accent-primary",secondary:"border-secondary outline-secondary accent-secondary",success:"border-success outline-success accent-success",warning:"border-warning outline-warning accent-warning",error:"border-error outline-error accent-error",ghost:"border-ghost focus:border-base-300 outline-none"},P={xs:"h-3 w-3 text-xs",sm:"h-4 w-4 text-sm",md:"h-5 w-5 text-base",lg:"h-6 w-6 text-lg",xl:"h-7 w-7 text-xl"},D=function(e){var n=e.checked,r=void 0!==n&&n,o=e.size,a=void 0===o?"md":o,l=e.variant,i=void 0===l?"primary":l,s=e.label,c=e.onChange,u=e.className,d=void 0===u?"":u,p=e.wrapperClass,m=void 0===p?"":p,g=e.sx,y=f(e,["checked","size","variant","label","onChange","className","wrapperClass","sx"]),v=function(e){c&&c(e)};return s?t.createElement("div",{className:m,style:g},t.createElement("label",{className:"".concat("w-full border rounded-md transition-all duration-200 focus:shadow-lg bg-base-200 border-base-300 flex items-center gap-2"," ").concat(d," ").concat(S[a]," cursor-pointer")},t.createElement("input",h({type:"checkbox",checked:r,onChange:v,className:"".concat(k[i]," ").concat(P[a])},y)),t.createElement("span",{className:"".concat(P[a].split(" ").slice(-1)[0])},s))):t.createElement("input",h({type:"checkbox",checked:r,onChange:v,className:"".concat(k[i]," ").concat(d," ").concat(P[a]),style:g},y))},N={xs:"p-0.5 text-xs",sm:"p-1 text-sm",md:"p-1.5 text-base",lg:"p-2 text-lg",xl:"p-3 text-xl"},W={primary:"border-primary outline-primary",secondary:"border-secondary outline-secondary",success:"border-success outline-success",warning:"border-warning outline-warning",error:"border-error outline-error",ghost:"border-ghost focus:border-base-300 outline-none"},T=function(e){var n=e.label,r=e.size,o=void 0===r?"md":r,a=e.variant,l=void 0===a?"primary":a,i=e.type,s=void 0===i?"text":i,c=e.required,u=e.className,d=void 0===u?"":u,p=e.wrapperClass,m=void 0===p?"":p,g=e.labelClass,y=void 0===g?"":g,v=e.labelTextClass,b=void 0===v?"":v,w=e.sx,x=f(e,["label","size","variant","type","required","className","wrapperClass","labelClass","labelTextClass","sx"]);return t.createElement("div",{className:m,style:w},t.createElement("label",{className:"flex flex-col items-start ".concat(y)},n&&t.createElement("span",{className:"text-sm px-0.5 ".concat(b)},n," ",c&&t.createElement("span",{className:"text-error"},"*")),t.createElement("input",h({type:s,className:"".concat("w-full border rounded-md transition-all duration-200 focus:shadow-lg bg-base-200 border-base-300"," ").concat(N[o]," ").concat(W[l]," ").concat(d),required:c},x))))},H={xs:"p-0.5 text-xs",sm:"p-1 text-sm",md:"p-1.5 text-base",lg:"p-2 text-lg",xl:"p-3 text-xl"},F={primary:"border-primary outline-primary",secondary:"border-secondary outline-secondary",success:"border-success outline-success",warning:"border-warning outline-warning",error:"border-error outline-error",ghost:"border-ghost focus:border-base-300 outline-none"},j=function(e){var n=e.label,r=e.size,o=void 0===r?"md":r,a=e.variant,l=void 0===a?"primary":a,i=e.required,s=e.className,c=void 0===s?"":s,u=e.wrapperClass,d=void 0===u?"":u,p=e.labelClass,m=void 0===p?"":p,g=e.labelTextClass,y=void 0===g?"":g,v=e.sx,b=e.rows,w=void 0===b?3:b,x=f(e,["label","size","variant","required","className","wrapperClass","labelClass","labelTextClass","sx","rows"]);return t.createElement("div",{className:d,style:v},t.createElement("label",{className:"flex flex-col items-start ".concat(m)},n&&t.createElement("span",{className:"text-sm ".concat(y)},n," ",i&&t.createElement("span",{className:"text-error"},"*")),t.createElement("textarea",h({className:"".concat("w-full border rounded-md transition-all duration-200 focus:shadow-lg bg-base-200 border-base-300"," ").concat(H[o]," ").concat(F[l]," ").concat(c),required:i,rows:w},x))))},_={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg",xl:"text-xl"},z={primary:"border-primary focus:border-primary",secondary:"border-secondary focus:border-secondary",success:"border-success focus:border-success",warning:"border-warning focus:border-warning",error:"border-error focus:border-error",ghost:"border-ghost focus:border-base-300"}; /** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const A=(...e)=>e.filter(((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t)).join(" ").trim() /** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */;var O={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}; /** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const M=n((({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:a="",children:l,iconNode:i,...s},c)=>r("svg",{ref:c,...O,width:t,height:t,stroke:e,strokeWidth:o?24*Number(n)/Number(t):n,className:A("lucide",a),...s},[...i.map((([e,t])=>r(e,t))),...Array.isArray(l)?l:[l]]))),L=(e,t)=>{const o=n((({className:n,...o},a)=>{return r(M,{ref:a,iconNode:t,className:A(`lucide-${l=e,l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...o});var l}));return o.displayName=`${e}`,o},R=L("ArrowDownToLine",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]),I=L("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),B=L("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]),U=L("Printer",[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]),Y=L("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]); /** * @license lucide-react v0.469.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var q,K=function(e){var n=e.options,r=void 0===n?[]:n,s=e.placeholder,c=void 0===s?"Select an option":s,u=e.multiple,d=void 0!==u&&u,h=e.onChange,f=e.label,m=e.size,g=void 0===m?"md":m,y=e.variant,v=void 0===y?"primary":y,b=e.required,w=e.className,x=void 0===w?"":w,C=e.wrapperClass,E=void 0===C?"":C,S=e.labelClass,k=void 0===S?"":S,P=e.labelTextClass,D=void 0===P?"":P,N=e.sx,W=e.renderOption,T=e.hideSearch,H=void 0!==T&&T,F=o(!1),j=F[0],A=F[1],O=o([]),M=O[0],L=O[1],R=o(""),B=R[0],U=R[1],q=o(-1),K=q[0],V=q[1],$=a(null),G=l((function(){return r.filter((function(e){return e.label.toLowerCase().includes(B.toLowerCase())}))}),[r,B]),J=function(e){if(d){var t=M.includes(e)?M.filter((function(t){return t!==e})):p(p([],M,!0),[e],!1);L(t),h&&h(t)}else L([e]),A(!1),h&&h(e)};i((function(){var e=function(e){$.current&&!$.current.contains(e.target)&&A(!1)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}}),[]);return i((function(){j&&V(-1)}),[j]),t.createElement("div",{className:E,style:N},t.createElement("label",{className:"flex flex-col items-start ".concat(k)},f&&t.createElement("span",{className:"text-sm ".concat(D)},f," ",b&&t.createElement("span",{className:"text-error"},"*")),t.createElement("div",{className:"relative w-full ".concat("w-full border rounded-md transition-all duration-200 focus:shadow-lg bg-base-200 border-base-300"," ").concat(_[g]," ").concat(z[v]," ").concat(x),ref:$,onKeyDown:function(e){j&&("ArrowDown"===e.key?V((function(e){return Math.min(e+1,G.length-1)})):"ArrowUp"===e.key?V((function(e){return Math.max(e-1,0)})):"Enter"===e.key&&K>=0?J(G[K]):"Escape"===e.key&&A(!1))},tabIndex:0},t.createElement("div",{className:"flex items-center justify-between w-full p-2 cursor-pointer",onClick:function(){return A(!j)}},t.createElement("div",{className:"flex flex-wrap gap-1"},M.length>0?d?M.map((function(e){return t.createElement("span",{key:e.value.toString(),className:"px-2 py-1 text-sm bg-base-100 rounded-md flex items-center"},e.label,t.createElement(Y,{size:14,className:"ml-1 cursor-pointer",onClick:function(t){t.stopPropagation(),function(e){var t=M.filter((function(t){return t!==e}));L(t),h&&h(t)}(e)}}))})):t.createElement("span",null,M[0].label):t.createElement("span",{className:"text-gray-400"},c)),t.createElement(I,{size:20})),j&&t.createElement("div",{className:"absolute z-10 w-full mt-1 bg-base-100 border rounded-md shadow-lg"},!H&&t.createElement("div",{className:"p-1"},t.createElement("input",{type:"text",className:"w-full p-2 border-b bg-base-200",placeholder:"Search...",value:B,onChange:function(e){return U(e.target.value)}})),t.createElement("ul",{className:"max-h-60 overflow-auto"},G.map((function(e,n){return t.createElement("li",{key:e.value.toString(),className:"p-2 cursor-pointer hover:bg-base-200 ".concat(M.includes(e)?"bg-base-300":""," ").concat(K===n?"bg-base-300":""),onClick:function(){return J(e)}},W?W(e):e.label)})))))))},V=function(e){var n=e.tabs,r=o(0),l=r[0],s=r[1],c=o({}),u=c[0],d=c[1],h=a([]);return i((function(){var e=function(){var e=h.current[l];e&&d({left:"".concat(e.offsetLeft,"px"),width:"".concat(e.offsetWidth,"px")})};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[l]),t.createElement("div",{className:"w-full max-w-3xl mx-auto"},t.createElement("div",{className:"relative"},t.createElement("div",{className:"flex border-b border-gray-200",role:"tablist"},n.map((function(e,n){return t.createElement("button",{key:n,ref:function(e){h.current[n]=e},className:"py-2 px-4 text-sm font-medium transition-colors duration-200 ".concat(l===n?"text-blue-600":"text-gray-500 hover:text-gray-700"),onClick:function(){return s(n)},role:"tab","aria-selected":l===n,"aria-controls":"tabpanel-".concat(n),id:"tab-".concat(n)},e.label)}))),t.createElement("div",{className:"absolute bottom-0 h-0.5 bg-blue-600 transition-all duration-300 ease-in-out",style:u})),t.createElement("div",{className:"mt-4 relative"},n.map((function(e,n){return t.createElement("div",{key:n,className:"transition-opacity duration-300 absolute top-0 left-0 w-full ".concat(l===n?"opacity-100 z-10":"opacity-0 z-0"),role:"tabpanel","aria-labelledby":"tab-".concat(n),id:"tabpanel-".concat(n)},e.content)}))))},$="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};"undefined"!=typeof globalThis?globalThis:void 0!==$||("undefined"!=typeof window?window:"undefined"!=typeof self&&self),q=function(e){return function(){var t={172:function(e,t){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CellHookData=t.HookData=void 0;var o=function(e,t,n){this.table=t,this.pageNumber=t.pageNumber,this.pageCount=this.pageNumber,this.settings=t.settings,this.cursor=n,this.doc=e.getDocument()};t.HookData=o;var a=function(e){function t(t,n,r,o,a,l){var i=e.call(this,t,n,l)||this;return i.cell=r,i.row=o,i.column=a,i.section=o.section,i}return r(t,e),t}(o);t.CellHookData=a},340:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(136),a=n(744),l=n(776),i=n(664),s=n(972);t.default=function(e){e.API.autoTable=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];1===t.length?e=t[0]:(console.error("Use of deprecated autoTable initiation"),(e=t[2]||{}).columns=t[0],e.body=t[1]);var r=(0,l.parseInput)(this,e),o=(0,s.createTable)(this,r);return(0,i.drawTable)(this,o),this},e.API.lastAutoTable=!1,e.API.previousAutoTable=!1,e.API.autoTable.previous=!1,e.API.autoTableText=function(e,t,n,r){(0,o.default)(e,t,n,r,this)},e.API.autoTableSetDefaults=function(e){return a.DocHandler.setDefaults(e,this),this},e.autoTableSetDefaults=function(e,t){a.DocHandler.setDefaults(e,t)},e.API.autoTableHtmlToJson=function(e,t){var n;if(void 0===t&&(t=!1),"undefined"==typeof window)return console.error("Cannot run autoTableHtmlToJson in non browser environment"),null;var o=new a.DocHandler(this),l=(0,r.parseHtml)(o,e,window,t,!1),i=l.head,s=l.body;return{columns:(null===(n=i[0])||void 0===n?void 0:n.map((function(e){return e.content})))||[],rows:s,data:s}},e.API.autoTableEndPosY=function(){console.error("Use of deprecated function: autoTableEndPosY. Use doc.lastAutoTable.finalY instead.");var e=this.lastAutoTable;return e&&e.finalY?e.finalY:0},e.API.autoTableAddPageContent=function(t){return console.error("Use of deprecated function: autoTableAddPageContent. Use jsPDF.autoTableSetDefaults({didDrawPage: () => {}}) instead."),e.API.autoTable.globalDefaults||(e.API.autoTable.globalDefaults={}),e.API.autoTable.globalDefaults.addPageContent=t,this},e.API.autoTableAddPage=function(){return console.error("Use of deprecated function: autoTableAddPage. Use doc.addPage()"),this.addPage(),this}}},136:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r,o){r=r||{};var a=o.internal.scaleFactor,l=o.internal.getFontSize()/a,i=l*(o.getLineHeightFactor?o.getLineHeightFactor():1.15),s="",c=1;if("middle"!==r.valign&&"bottom"!==r.valign&&"center"!==r.halign&&"right"!==r.halign||(c=(s="string"==typeof e?e.split(/\r\n|\r|\n/g):e).length||1),n+=l*(2-1.15),"middle"===r.valign?n-=c/2*i:"bottom"===r.valign&&(n-=c*i),"center"===r.halign||"right"===r.halign){var u=l;if("center"===r.halign&&(u*=.5),s&&c>=1){for(var d=0;d<s.length;d++)o.text(s[d],t-o.getStringUnitWidth(s[d])*u,n),n+=i;return o}t-=o.getStringUnitWidth(e)*u}return"justify"===r.halign?o.text(e,t,n,{maxWidth:r.maxWidth||100,align:"justify"}):o.text(e,t,n),o}},420:function(e,t){function n(e,t){var n=e>0,r=t||0===t;return n&&r?"DF":n?"S":r?"F":null}function r(e,t){var n,r,o,a;if(e=e||t,Array.isArray(e)){if(e.length>=4)return{top:e[0],right:e[1],bottom:e[2],left:e[3]};if(3===e.length)return{top:e[0],right:e[1],bottom:e[2],left:e[1]};if(2===e.length)return{top:e[0],right:e[1],bottom:e[0],left:e[1]};e=1===e.length?e[0]:t}return"object"==typeof e?("number"==typeof e.vertical&&(e.top=e.vertical,e.bottom=e.vertical),"number"==typeof e.horizontal&&(e.right=e.horizontal,e.left=e.horizontal),{left:null!==(n=e.left)&&void 0!==n?n:t,top:null!==(r=e.top)&&void 0!==r?r:t,right:null!==(o=e.right)&&void 0!==o?o:t,bottom:null!==(a=e.bottom)&&void 0!==a?a:t}):("number"!=typeof e&&(e=t),{top:e,right:e,bottom:e,left:e})}Object.defineProperty(t,"__esModule",{value:!0}),t.getPageAvailableWidth=t.parseSpacing=t.getFillStyle=t.addTableBorder=t.getStringWidth=void 0,t.getStringWidth=function(e,t,n){return n.applyStyles(t,!0),(Array.isArray(e)?e:[e]).map((function(e){return n.getTextWidth(e)})).reduce((function(e,t){return Math.max(e,t)}),0)},t.addTableBorder=function(e,t,r,o){var a=t.settings.tableLineWidth,l=t.settings.tableLineColor;e.applyStyles({lineWidth:a,lineColor:l});var i=n(a,!1);i&&e.rect(r.x,r.y,t.getWidth(e.pageSize().width),o.y-r.y,i)},t.getFillStyle=n,t.parseSpacing=r,t.getPageAvailableWidth=function(e,t){var n=r(t.settings.margin,0);return e.pageSize().width-(n.left+n.right)}},796:function(e,t){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.getTheme=t.defaultStyles=t.HtmlRowInput=void 0;var o=function(e){function t(t){var n=e.call(this)||this;return n._element=t,n}return r(t,e),t}(Array);t.HtmlRowInput=o,t.defaultStyles=function(e){return{font:"helvetica",fontStyle:"normal",overflow:"linebreak",fillColor:!1,textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5/e,lineColor:200,lineWidth:0,cellWidth:"auto",minCellHeight:0,minCellWidth:0}},t.getTheme=function(e){return{striped:{table:{fillColor:255,textColor:80,fontStyle:"normal"},head:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:"bold"},foot:{fontStyle:"bold"}}}[e]}},903:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseCss=void 0;var r=n(420);function o(e,t){var n=a(e,t);if(!n)return null;var r=n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!r||!Array.isArray(r))return null;var o=[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])];return 0===parseInt(r[4])||isNaN(o[0])||isNaN(o[1])||isNaN(o[2])?null:o}function a(e,t){var n=t(e);return"rgba(0, 0, 0, 0)"===n||"transparent"===n||"initial"===n||"inherit"===n?null==e.parentElement?null:a(e.parentElement,t):n}t.parseCss=function(e,t,n,a,l){var i={},s=96/72,c=o(t,(function(e){return l.getComputedStyle(e).backgroundColor}));null!=c&&(i.fillColor=c);var u=o(t,(function(e){return l.getComputedStyle(e).color}));null!=u&&(i.textColor=u);var d=function(e,t){var n=[e.paddingTop,e.paddingRight,e.paddingBottom,e.paddingLeft],o=96/(72/t),a=(parseInt(e.lineHeight)-parseInt(e.fontSize))/t/2,l=n.map((function(e){return parseInt(e||"0")/o})),i=(0,r.parseSpacing)(l,0);return a>i.top&&(i.top=a),a>i.bottom&&(i.bottom=a),i}(a,n);d&&(i.cellPadding=d);var h="borderTopColor",f=s*n,p=a.borderTopWidth;if(a.borderBottomWidth===p&&a.borderRightWidth===p&&a.borderLeftWidth===p){var m=(parseFloat(p)||0)/f;m&&(i.lineWidth=m)}else i.lineWidth={top:(parseFloat(a.borderTopWidth)||0)/f,right:(parseFloat(a.borderRightWidth)||0)/f,bottom:(parseFloat(a.borderBottomWidth)||0)/f,left:(parseFloat(a.borderLeftWidth)||0)/f},i.lineWidth.top||(i.lineWidth.right?h="borderRightColor":i.lineWidth.bottom?h="borderBottomColor":i.lineWidth.left&&(h="borderLeftColor"));var g=o(t,(function(e){return l.getComputedStyle(e)[h]}));null!=g&&(i.lineColor=g);var y=["left","right","center","justify"];-1!==y.indexOf(a.textAlign)&&(i.halign=a.textAlign),-1!==(y=["middle","bottom","top"]).indexOf(a.verticalAlign)&&(i.valign=a.verticalAlign);var v=parseInt(a.fontSize||"");isNaN(v)||(i.fontSize=v/s);var b=function(e){var t="";return("bold"===e.fontWeight||"bolder"===e.fontWeight||parseInt(e.fontWeight)>=700)&&(t="bold"),"italic"!==e.fontStyle&&"oblique"!==e.fontStyle||(t+="italic"),t}(a);b&&(i.fontStyle=b);var w=(a.fontFamily||"").toLowerCase();return-1!==e.indexOf(w)&&(i.font=w),i}},744:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.DocHandler=void 0;var n={},r=function(){function e(e){this.jsPDFDocument=e,this.userStyles={textColor:e.getTextColor?this.jsPDFDocument.getTextColor():0,fontSize:e.internal.getFontSize(),fontStyle:e.internal.getFont().fontStyle,font:e.internal.getFont().fontName,lineWidth:e.getLineWidth?this.jsPDFDocument.getLineWidth():0,lineColor:e.getDrawColor?this.jsPDFDocument.getDrawColor():0}}return e.setDefaults=function(e,t){void 0===t&&(t=null),t?t.__autoTableDocumentDefaults=e:n=e},e.unifyColor=function(e){return Array.isArray(e)?e:"number"==typeof e?[e,e,e]:"string"==typeof e?[e]:null},e.prototype.applyStyles=function(t,n){var r,o,a;void 0===n&&(n=!1),t.fontStyle&&this.jsPDFDocument.setFontStyle&&this.jsPDFDocument.setFontStyle(t.fontStyle);var l=this.jsPDFDocument.internal.getFont(),i=l.fontStyle,s=l.fontName;if(t.font&&(s=t.font),t.fontStyle){i=t.fontStyle;var c=this.getFontList()[s];c&&-1===c.indexOf(i)&&(this.jsPDFDocument.setFontStyle&&this.jsPDFDocument.setFontStyle(c[0]),i=c[0])}if(this.jsPDFDocument.setFont(s,i),t.fontSize&&this.jsPDFDocument.setFontSize(t.fontSize),!n){var u=e.unifyColor(t.fillColor);u&&(r=this.jsPDFDocument).setFillColor.apply(r,u),(u=e.unifyColor(t.textColor))&&(o=this.jsPDFDocument).setTextColor.apply(o,u),(u=e.unifyColor(t.lineColor))&&(a=this.jsPDFDocument).setDrawColor.apply(a,u),"number"==typeof t.lineWidth&&this.jsPDFDocument.setLineWidth(t.lineWidth)}},e.prototype.splitTextToSize=function(e,t,n){return this.jsPDFDocument.splitTextToSize(e,t,n)},e.prototype.rect=function(e,t,n,r,o){return this.jsPDFDocument.rect(e,t,n,r,o)},e.prototype.getLastAutoTable=function(){return this.jsPDFDocument.lastAutoTable||null},e.prototype.getTextWidth=function(e){return this.jsPDFDocument.getTextWidth(e)},e.prototype.getDocument=function(){return this.jsPDFDocument},e.prototype.setPage=function(e){this.jsPDFDocument.setPage(e)},e.prototype.addPage=function(){return this.jsPDFDocument.addPage()},e.prototype.getFontList=function(){return this.jsPDFDocument.getFontList()},e.prototype.getGlobalOptions=function(){return n||{}},e.prototype.getDocumentOptions=function(){return this.jsPDFDocument.__autoTableDocumentDefaults||{}},e.prototype.pageSize=function(){var e=this.jsPDFDocument.internal.pageSize;return null==e.width&&(e={width:e.getWidth(),height:e.getHeight()}),e},e.prototype.scaleFactor=function(){return this.jsPDFDocument.internal.scaleFactor},e.prototype.getLineHeightFactor=function(){var e=this.jsPDFDocument;return e.getLineHeightFactor?e.getLineHeightFactor():1.15},e.prototype.getLineHeight=function(e){return e/this.scaleFactor()*this.getLineHeightFactor()},e.prototype.pageNumber=function(){var e=this.jsPDFDocument.internal.getCurrentPageInfo();return e?e.pageNumber:this.jsPDFDocument.internal.getNumberOfPages()},e}();t.DocHandler=r},4:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseHtml=void 0;var r=n(903),o=n(796);function a(e,t,n,a,i,s){for(var c=new o.HtmlRowInput(a),u=0;u<a.cells.length;u++){var d=a.cells[u],h=n.getComputedStyle(d);if(i||"none"!==h.display){var f=void 0;s&&(f=(0,r.parseCss)(e,d,t,h,n)),c.push({rowSpan:d.rowSpan,colSpan:d.colSpan,styles:f,_element:d,content:l(d)})}}var p=n.getComputedStyle(a);if(c.length>0&&(i||"none"!==p.display))return c}function l(e){var t=e.cloneNode(!0);return t.innerHTML=t.innerHTML.replace(/\n/g,"").replace(/ +/g," "),t.innerHTML=t.innerHTML.split(/<br.*?>/).map((function(e){return e.trim()})).join("\n"),t.innerText||t.textContent||""}t.parseHtml=function(e,t,n,r,o){var l,i,s;void 0===r&&(r=!1),void 0===o&&(o=!1),s="string"==typeof t?n.document.querySelector(t):t;var c=Object.keys(e.getFontList()),u=e.scaleFactor(),d=[],h=[],f=[];if(!s)return console.error("Html table could not be found with input: ",t),{head:d,body:h,foot:f};for(var p=0;p<s.rows.length;p++){var m=s.rows[p],g=null===(i=null===(l=null==m?void 0:m.parentElement)||void 0===l?void 0:l.tagName)||void 0===i?void 0:i.toLowerCase(),y=a(c,u,n,m,r,o);y&&("thead"===g?d.push(y):"tfoot"===g?f.push(y):h.push(y))}return{head:d,body:h,foot:f}}},776:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseInput=void 0;var r=n(4),o=n(356),a=n(420),l=n(744),i=n(792);t.parseInput=function(e,t){var n=new l.DocHandler(e),s=n.getDocumentOptions(),c=n.getGlobalOptions();(0,i.default)(n,c,s,t);var u,d=(0,o.assign)({},c,s,t);"undefined"!=typeof window&&(u=window);var h=function(e,t,n){for(var r={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},a=function(a){if("columnStyles"===a){var l=e[a],i=t[a],s=n[a];r.columnStyles=(0,o.assign)({},l,i,s)}else{var c=[e,t,n].map((function(e){return e[a]||{}}));r[a]=(0,o.assign)({},c[0],c[1],c[2])}},l=0,i=Object.keys(r);l<i.length;l++)a(i[l]);return r}(c,s,t),f=function(e,t,n){for(var r={didParseCell:[],willDrawCell:[],didDrawCell:[],willDrawPage:[],didDrawPage:[]},o=0,a=[e,t,n];o<a.length;o++){var l=a[o];l.didParseCell&&r.didParseCell.push(l.didParseCell),l.willDrawCell&&r.willDrawCell.push(l.willDrawCell),l.didDrawCell&&r.didDrawCell.push(l.didDrawCell),l.willDrawPage&&r.willDrawPage.push(l.willDrawPage),l.didDrawPage&&r.didDrawPage.push(l.didDrawPage)}return r}(c,s,t),p=function(e,t){var n,r,o,l,i,s,c,u,d,h,f,p,m,g,y=(0,a.parseSpacing)(t.margin,40/e.scaleFactor()),v=null!==(n=function(e,t){var n=e.getLastAutoTable(),r=e.scaleFactor(),o=e.pageNumber(),a=!1;return n&&n.startPageNumber&&(a=n.startPageNumber+n.pageNumber-1===o),"number"==typeof t?t:null!=t&&!1!==t||!a||null==(null==n?void 0:n.finalY)?null:n.finalY+20/r}(e,t.startY))&&void 0!==n?n:y.top;m=!0===t.showFoot?"everyPage":!1===t.showFoot?"never":null!==(r=t.showFoot)&&void 0!==r?r:"everyPage",g=!0===t.showHead?"everyPage":!1===t.showHead?"never":null!==(o=t.showHead)&&void 0!==o?o:"everyPage";var b=null!==(l=t.useCss)&&void 0!==l&&l,w=t.theme||(b?"plain":"striped"),x=!!t.horizontalPageBreak,C=null!==(i=t.horizontalPageBreakRepeat)&&void 0!==i?i:null;return{includeHiddenHtml:null!==(s=t.includeHiddenHtml)&&void 0!==s&&s,useCss:b,theme:w,startY:v,margin:y,pageBreak:null!==(c=t.pageBreak)&&void 0!==c?c:"auto",rowPageBreak:null!==(u=t.rowPageBreak)&&void 0!==u?u:"auto",tableWidth:null!==(d=t.tableWidth)&&void 0!==d?d:"auto",showHead:g,showFoot:m,tableLineWidth:null!==(h=t.tableLineWidth)&&void 0!==h?h:0,tableLineColor:null!==(f=t.tableLineColor)&&void 0!==f?f:200,horizontalPageBreak:x,horizontalPageBreakRepeat:C,horizontalPageBreakBehaviour:null!==(p=t.horizontalPageBreakBehaviour)&&void 0!==p?p:"afterAllRows"}}(n,d),m=function(e,t,n){var o=t.head||[],a=t.body||[],l=t.foot||[];if(t.html){var i=t.includeHiddenHtml;if(n){var s=(0,r.parseHtml)(e,t.html,n,i,t.useCss)||{};o=s.head||o,a=s.body||o,l=s.foot||o}else console.error("Cannot parse html in non browser environment")}var c=t.columns||function(e,t,n){var r=e[0]||t[0]||n[0]||[],o=[];return Object.keys(r).filter((function(e){return"_element"!==e})).forEach((function(e){var t,n=1;"object"!=typeof(t=Array.isArray(r)?r[parseInt(e)]:r[e])||Array.isArray(t)||(n=(null==t?void 0:t.colSpan)||1);for(var a=0;a<n;a++){var l={dataKey:Array.isArray(r)?o.length:e+(a>0?"_".concat(a):"")};o.push(l)}})),o}(o,a,l);return{columns:c,head:o,body:a,foot:l}}(n,d,u);return{id:t.tableId,content:m,hooks:f,styles:h,settings:p}}},792:function(e,t){function n(e){e.rowHeight?(console.error("Use of deprecated style rowHeight. It is renamed to minCellHeight."),e.minCellHeight||(e.minCellHeight=e.rowHeight)):e.columnWidth&&(console.error("Use of deprecated style columnWidth. It is renamed to cellWidth."),e.cellWidth||(e.cellWidth=e.columnWidth))}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,o){for(var a=function(t){t&&"object"!=typeof t&&console.error("The options parameter should be of type object, is: "+typeof t),void 0!==t.extendWidth&&(t.tableWidth=t.extendWidth?"auto":"wrap",console.error("Use of deprecated option: extendWidth, use tableWidth instead.")),void 0!==t.margins&&(void 0===t.margin&&(t.margin=t.margins),console.error("Use of deprecated option: margins, use margin instead.")),t.startY&&"number"!=typeof t.startY&&(console.error("Invalid value for startY option",t.startY),delete t.startY),!t.didDrawPage&&(t.afterPageContent||t.beforePageContent||t.afterPageAdd)&&(console.error("The afterPageContent, beforePageContent and afterPageAdd hooks are deprecated. Use didDrawPage instead"),t.didDrawPage=function(n){e.applyStyles(e.userStyles),t.beforePageContent&&t.beforePageContent(n),e.applyStyles(e.userStyles),t.afterPageContent&&t.afterPageContent(n),e.applyStyles(e.userStyles),t.afterPageAdd&&n.pageNumber>1&&n.afterPageAdd(n),e.applyStyles(e.userStyles)}),["createdHeaderCell","drawHeaderRow","drawRow","drawHeaderCell"].forEach((function(e){t[e]&&console.error('The "'.concat(e,'" hook has changed in version 3.0, check the changelog for how to migrate.'))})),[["showFoot","showFooter"],["showHead","showHeader"],["didDrawPage","addPageContent"],["didParseCell","createdCell"],["headStyles","headerStyles"]].forEach((function(e){var n=e[0],r=e[1];t[r]&&(console.error("Use of deprecated option ".concat(r,". Use ").concat(n," instead")),t[n]=t[r])})),[["padding","cellPadding"],["lineHeight","rowHeight"],"fontSize","overflow"].forEach((function(e){var n="string"==typeof e?e:e[0],r="string"==typeof e?e:e[1];void 0!==t[n]&&(void 0===t.styles[r]&&(t.styles[r]=t[n]),console.error("Use of deprecated option: "+n+", use the style "+r+" instead."))}));for(var r=0,o=["styles","bodyStyles","headStyles","footStyles"];r<o.length;r++)n(t[o[r]]||{});for(var a=t.columnStyles||{},l=0,i=Object.keys(a);l<i.length;l++)n(a[i[l]]||{})},l=0,i=[t,r,o];l<i.length;l++)a(i[l])}},260:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.Column=t.Cell=t.Row=t.Table=void 0;var r=n(796),o=n(172),a=n(420),l=function(){function e(e,t){this.pageNumber=1,this.pageCount=1,this.id=e.id,this.settings=e.settings,this.styles=e.styles,this.hooks=e.hooks,this.columns=t.columns,this.head=t.head,this.body=t.body,this.foot=t.foot}return e.prototype.getHeadHeight=function(e){return this.head.reduce((function(t,n){return t+n.getMaxCellHeight(e)}),0)},e.prototype.getFootHeight=function(e){return this.foot.reduce((function(t,n){return t+n.getMaxCellHeight(e)}),0)},e.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},e.prototype.callCellHooks=function(e,t,n,r,a,l){for(var i=0,s=t;i<s.length;i++){var c=!1===(0,s[i])(new o.CellHookData(e,this,n,r,a,l));if(n.text=Array.isArray(n.text)?n.text:[n.text],c)return!1}return!0},e.prototype.callEndPageHooks=function(e,t){e.applyStyles(e.userStyles);for(var n=0,r=this.hooks.didDrawPage;n<r.length;n++)(0,r[n])(new o.HookData(e,this,t))},e.prototype.callWillDrawPageHooks=function(e,t){for(var n=0,r=this.hooks.willDrawPage;n<r.length;n++)(0,r[n])(new o.HookData(e,this,t))},e.prototype.getWidth=function(e){if("number"==typeof this.settings.tableWidth)return this.settings.tableWidth;if("wrap"===this.settings.tableWidth)return this.columns.reduce((function(e,t){return e+t.wrappedWidth}),0);var t=this.settings.margin;return e-t.left-t.right},e}();t.Table=l;var i=function(){function e(e,t,n,o,a){void 0===a&&(a=!1),this.height=0,this.raw=e,e instanceof r.HtmlRowInput&&(this.raw=e._element,this.element=e._element),this.index=t,this.section=n,this.cells=o,this.spansMultiplePages=a}return e.prototype.getMaxCellHeight=function(e){var t=this;return e.reduce((function(e,n){var r;return Math.max(e,(null===(r=t.cells[n.index])||void 0===r?void 0:r.height)||0)}),0)},e.prototype.hasRowSpan=function(e){var t=this;return e.filter((function(e){var n=t.cells[e.index];return!!n&&n.rowSpan>1})).length>0},e.prototype.canEntireRowFit=function(e,t){return this.getMaxCellHeight(t)<=e},e.prototype.getMinimumRowHeight=function(e,t){var n=this;return e.reduce((function(e,r){var o=n.cells[r.index];if(!o)return 0;var a=t.getLineHeight(o.styles.fontSize),l=o.padding("vertical")+a;return l>e?l:e}),0)},e}();t.Row=i;var s=function(){function e(e,t,n){var r,o;this.contentHeight=0,this.contentWidth=0,this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.height=0,this.x=0,this.y=0,this.styles=t,this.section=n,this.raw=e;var a=e;null==e||"object"!=typeof e||Array.isArray(e)?(this.rowSpan=1,this.colSpan=1):(this.rowSpan=e.rowSpan||1,this.colSpan=e.colSpan||1,a=null!==(o=null!==(r=e.content)&&void 0!==r?r:e.title)&&void 0!==o?o:e,e._element&&(this.raw=e._element));var l=null!=a?""+a:"";this.text=l.split(/\r\n|\r|\n/g)}return e.prototype.getTextPos=function(){var e,t;if("top"===this.styles.valign)e=this.y+this.padding("top");else if("bottom"===this.styles.valign)e=this.y+this.height-this.padding("bottom");else{var n=this.height-this.padding("vertical");e=this.y+n/2+this.padding("top")}if("right"===this.styles.halign)t=this.x+this.width-this.padding("right");else if("center"===this.styles.halign){var r=this.width-this.padding("horizontal");t=this.x+r/2+this.padding("left")}else t=this.x+this.padding("left");return{x:t,y:e}},e.prototype.getContentHeight=function(e,t){void 0===t&&(t=1.15);var n=(Array.isArray(this.text)?this.text.length:1)*(this.styles.fontSize/e*t)+this.padding("vertical");return Math.max(n,this.styles.minCellHeight)},e.prototype.padding=function(e){var t=(0,a.parseSpacing)(this.styles.cellPadding,0);return"vertical"===e?t.top+t.bottom:"horizontal"===e?t.left+t.right:t[e]},e}();t.Cell=s;var c=function(){function e(e,t,n){this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.dataKey=e,this.raw=t,this.index=n}return e.prototype.getMaxCustomCellWidth=function(e){for(var t=0,n=0,r=e.allRows();n<r.length;n++){var o=r[n].cells[this.index];o&&"number"==typeof o.styles.cellWidth&&(t=Math.max(t,o.styles.cellWidth))}return t},e}();t.Column=c},356:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.assign=void 0,t.assign=function(e,t,n,r,o){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var a=Object(e),l=1;l<arguments.length;l++){var i=arguments[l];if(null!=i)for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(a[s]=i[s])}return a}},972:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createTable=void 0;var r=n(744),o=n(260),a=n(324),l=n(796),i=n(356);function s(e,t,n,r,a,l){var i={};return t.map((function(t,s){for(var c=0,d={},h=0,f=0,p=0,m=n;p<m.length;p++){var g=m[p];if(null==i[g.index]||0===i[g.index].left)if(0===f){var y=void 0,v={};"object"!=typeof(y=Array.isArray(t)?t[g.index-h-c]:t[g.dataKey])||Array.isArray(y)||(v=(null==y?void 0:y.styles)||{});var b=u(e,g,s,a,r,l,v),w=new o.Cell(y,b,e);d[g.dataKey]=w,d[g.index]=w,f=w.colSpan-1,i[g.index]={left:w.rowSpan-1,times:f}}else f--,h++;else i[g.index].left--,f=i[g.index].times,c++}return new o.Row(t,s,e,d)}))}function c(e,t){var n={};return e.forEach((function(e){if(null!=e.raw){var r=function(e,t){if("head"===e){if("object"==typeof t)return t.header||t.title||null;if("string"==typeof t||"number"==typeof t)return t}else if("foot"===e&&"object"==typeof t)return t.footer;return null}(t,e.raw);null!=r&&(n[e.dataKey]=r)}})),Object.keys(n).length>0?n:null}function u(e,t,n,r,o,a,s){var c,u=(0,l.getTheme)(r);"head"===e?c=o.headStyles:"body"===e?c=o.bodyStyles:"foot"===e&&(c=o.footStyles);var d=(0,i.assign)({},u.table,u[e],o.styles,c),h=o.columnStyles[t.dataKey]||o.columnStyles[t.index]||{},f="body"===e?h:{},p="body"===e&&n%2==0?(0,i.assign)({},u.alternateRow,o.alternateRowStyles):{},m=(0,l.defaultStyles)(a),g=(0,i.assign)({},m,d,p,f);return(0,i.assign)(g,s)}t.createTable=function(e,t){var n=new r.DocHandler(e),l=function(e,t){var n,r=e.content,a=function(e){return e.map((function(e,t){var n,r,a;return a="object"==typeof e&&null!==(r=null!==(n=e.dataKey)&&void 0!==n?n:e.key)&&void 0!==r?r:t,new o.Column(a,e,t)}))}(r.columns);0===r.head.length&&(n=c(a,"head"))&&r.head.push(n),0===r.foot.length&&(n=c(a,"foot"))&&r.foot.push(n);var l=e.settings.theme,i=e.styles;return{columns:a,head:s("head",r.head,a,i,l,t),body:s("body",r.body,a,i,l,t),foot:s("foot",r.foot,a,i,l,t)}}(t,n.scaleFactor()),i=new o.Table(t,l);return(0,a.calculateWidths)(n,i),n.applyStyles(n.userStyles),i}},664:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.addPage=t.drawTable=void 0;var r=n(420),o=n(260),a=n(744),l=n(356),i=n(136),s=n(224);function c(e,t,n,r){var o=t.settings;e.applyStyles(e.userStyles),"firstPage"!==o.showHead&&"everyPage"!==o.showHead||t.head.forEach((function(o){return p(e,t,o,n,r)}))}function u(e,t,n,r,o,a){e.applyStyles(e.userStyles),a=null!=a?a:t.body.length;var l=Math.min(n+a,t.body.length),i=-1;return t.body.slice(n,l).forEach((function(a,l){var s=n+l===t.body.length-1,c=g(e,t,s,r);a.canEntireRowFit(c,o)&&(p(e,t,a,r,o),i=n+l)})),i}function d(e,t,n,r){var o=t.settings;e.applyStyles(e.userStyles),"lastPage"!==o.showFoot&&"everyPage"!==o.showFoot||t.foot.forEach((function(o){return p(e,t,o,n,r)}))}function h(e,t,n){var r=n.getLineHeight(e.styles.fontSize),o=e.padding("vertical"),a=Math.floor((t-o)/r);return Math.max(0,a)}function f(e,t,n,r,a,i,s){var c=g(e,t,r,i);if(n.canEntireRowFit(c,s))p(e,t,n,i,s);else if(function(e,t,n,r){var o=e.pageSize().height,a=r.settings.margin,l=o-(a.top+a.bottom);"body"===t.section&&(l-=r.getHeadHeight(r.columns)+r.getFootHeight(r.columns));var i=t.getMinimumRowHeight(r.columns,e),s=i<n;if(i>l)return console.error("Will not be able to print row ".concat(t.index," correctly since it's minimum height is larger than page height")),!0;if(!s)return!1;var c=t.hasRowSpan(r.columns);return t.getMaxCellHeight(r.columns)>l?(c&&console.error("The content of row ".concat(t.index," will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported.")),!0):!c&&"avoid"!==r.settings.rowPageBreak}(e,n,c,t)){var u=function(e,t,n,r){var a={};e.spansMultiplePages=!0,e.height=0;for(var i=0,s=0,c=n.columns;s<c.length;s++){var u=c[s];if(b=e.cells[u.index]){Array.isArray(b.text)||(b.text=[b.text]);var d=new o.Cell(b.raw,b.styles,b.section);(d=(0,l.assign)(d,b)).text=[];var f=h(b,t,r);b.text.length>f&&(d.text=b.text.splice(f,b.text.length));var p=r.scaleFactor(),m=r.getLineHeightFactor();b.contentHeight=b.getContentHeight(p,m),b.contentHeight>=t&&(b.contentHeight=t,d.styles.minCellHeight-=t),b.contentHeight>e.height&&(e.height=b.contentHeight),d.contentHeight=d.getContentHeight(p,m),d.contentHeight>i&&(i=d.contentHeight),a[u.index]=d}}var g=new o.Row(e.raw,-1,e.section,a,!0);g.height=i;for(var y=0,v=n.columns;y<v.length;y++){var b;u=v[y],(d=g.cells[u.index])&&(d.height=g.height),(b=e.cells[u.index])&&(b.height=e.height)}return g}(n,c,t,e);p(e,t,n,i,s),y(e,t,a,i,s),f(e,t,u,r,a,i,s)}else y(e,t,a,i,s),f(e,t,n,r,a,i,s)}function p(e,t,n,r,o){r.x=t.settings.margin.left;for(var a=0,l=o;a<l.length;a++){var s=l[a],c=n.cells[s.index];if(c)if(e.applyStyles(c.styles),c.x=r.x,c.y=r.y,!1!==t.callCellHooks(e,t.hooks.willDrawCell,c,n,s,r)){m(e,c,r);var u=c.getTextPos();(0,i.default)(c.text,u.x,u.y,{halign:c.styles.halign,valign:c.styles.valign,maxWidth:Math.ceil(c.width-c.padding("left")-c.padding("right"))},e.getDocument()),t.callCellHooks(e,t.hooks.didDrawCell,c,n,s,r),r.x+=s.width}else r.x+=s.width;else r.x+=s.width}r.y+=n.height}function m(e,t,n){var o=t.styles;if(e.getDocument().setFillColor(e.getDocument().getFillColor()),"number"==typeof o.lineWidth){var a=(0,r.getFillStyle)(o.lineWidth,o.fillColor);a&&e.rect(t.x,n.y,t.width,t.height,a)}else"object"==typeof o.lineWidth&&(o.fillColor&&e.rect(t.x,n.y,t.width,t.height,"F"),function(e,t,n,r){var o,a,l,i;function s(t,n,r,o,a){e.getDocument().setLineWidth(t),e.getDocument().line(n,r,o,a,"S")}r.top&&(o=n.x,a=n.y,l=n.x+t.width,i=n.y,r.right&&(l+=.5*r.right),r.left&&(o-=.5*r.left),s(r.top,o,a,l,i)),r.bottom&&(o=n.x,a=n.y+t.height,l=n.x+t.width,i=n.y+t.height,r.right&&(l+=.5*r.right),r.left&&(o-=.5*r.left),s(r.bottom,o,a,l,i)),r.left&&(o=n.x,a=n.y,l=n.x,i=n.y+t.height,r.top&&(a-=.5*r.top),r.bottom&&(i+=.5*r.bottom),s(r.left,o,a,l,i)),r.right&&(o=n.x+t.width,a=n.y,l=n.x+t.width,i=n.y+t.height,r.top&&(a-=.5*r.top),r.bottom&&(i+=.5*r.bottom),s(r.right,o,a,l,i))}(e,t,n,o.lineWidth))}function g(e,t,n,r){var o=t.settings.margin.bottom,a=t.settings.showFoot;return("everyPage"===a||"lastPage"===a&&n)&&(o+=t.getFootHeight(t.columns)),e.pageSize().height-r.y-o}function y(e,t,n,o,a,l){void 0===a&&(a=[]),void 0===l&&(l=!1),e.applyStyles(e.userStyles),"everyPage"!==t.settings.showFoot||l||t.foot.forEach((function(n){return p(e,t,n,o,a)})),t.callEndPageHooks(e,o);var i=t.settings.margin;(0,r.addTableBorder)(e,t,n,o),v(e),t.pageNumber++,t.pageCount++,o.x=i.left,o.y=i.top,n.y=i.top,t.callWillDrawPageHooks(e,o),"everyPage"===t.settings.showHead&&(t.head.forEach((function(n){return p(e,t,n,o,a)})),e.applyStyles(e.userStyles))}function v(e){var t=e.pageNumber();return e.setPage(t+1),e.pageNumber()===t&&(e.addPage(),!0)}t.drawTable=function(e,t){var n=t.settings,o=n.startY,i=n.margin,h={x:i.left,y:o},m=t.getHeadHeight(t.columns)+t.getFootHeight(t.columns),g=o+i.bottom+m;"avoid"===n.pageBreak&&(g+=t.body.reduce((function(e,t){return e+t.height}),0));var b=new a.DocHandler(e);("always"===n.pageBreak||null!=n.startY&&g>b.pageSize().height)&&(v(b),h.y=i.top),t.callWillDrawPageHooks(b,h);var w=(0,l.assign)({},h);t.startPageNumber=b.pageNumber(),n.horizontalPageBreak?function(e,t,n,r){var o=(0,s.calculateAllColumnsCanFitInPage)(e,t),a=t.settings;if("afterAllRows"===a.horizontalPageBreakBehaviour)o.forEach((function(o,a){e.applyStyles(e.userStyles),a>0?y(e,t,n,r,o.columns,!0):c(e,t,r,o.columns),function(e,t,n,r,o){e.applyStyles(e.userStyles),t.body.forEach((function(a,l){var i=l===t.body.length-1;f(e,t,a,i,n,r,o)}))}(e,t,n,r,o.columns),d(e,t,r,o.columns)}));else for(var l=-1,i=o[0],h=function(){var a=l;if(i){e.applyStyles(e.userStyles);var s=i.columns;l>=0?y(e,t,n,r,s,!0):c(e,t,r,s),a=u(e,t,l+1,r,s),d(e,t,r,s)}var h=a-l;o.slice(1).forEach((function(o){e.applyStyles(e.userStyles),y(e,t,n,r,o.columns,!0),u(e,t,l+1,r,o.columns,h),d(e,t,r,o.columns)})),l=a};l<t.body.length-1;)h()}(b,t,w,h):(b.applyStyles(b.userStyles),"firstPage"!==n.showHead&&"everyPage"!==n.showHead||t.head.forEach((function(e){return p(b,t,e,h,t.columns)})),b.applyStyles(b.userStyles),t.body.forEach((function(e,n){var r=n===t.body.length-1;f(b,t,e,r,w,h,t.columns)})),b.applyStyles(b.userStyles),"lastPage"!==n.showFoot&&"everyPage"!==n.showFoot||t.foot.forEach((function(e){return p(b,t,e,h,t.columns)}))),(0,r.addTableBorder)(b,t,w,h),t.callEndPageHooks(b,h),t.finalY=h.y,e.lastAutoTable=t,e.previousAutoTable=t,e.autoTable&&(e.autoTable.previous=t),b.applyStyles(b.userStyles)},t.addPage=y},224:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateAllColumnsCanFitInPage=void 0;var r=n(420);function o(e,t,n){var o;void 0===n&&(n={});var a=(0,r.getPageAvailableWidth)(e,t),l=new Map,i=[],s=[],c=[];t.settings.horizontalPageBreakRepeat,Array.isArray(t.settings.horizontalPageBreakRepeat)?c=t.settings.horizontalPageBreakRepeat:"string"!=typeof t.settings.horizontalPageBreakRepeat&&"number"!=typeof t.settings.horizontalPageBreakRepeat||(c=[t.settings.horizontalPageBreakRepeat]),c.forEach((function(e){var n=t.columns.find((function(t){return t.dataKey===e||t.index===e}));n&&!l.has(n.index)&&(l.set(n.index,!0),i.push(n.index),s.push(t.columns[n.index]),a-=n.wrappedWidth)}));for(var u=!0,d=null!==(o=null==n?void 0:n.start)&&void 0!==o?o:0;d<t.columns.length;)if(l.has(d))d++;else{var h=t.columns[d].wrappedWidth;if(!(u||a>=h))break;u=!1,i.push(d),s.push(t.columns[d]),a-=h,d++}return{colIndexes:i,columns:s,lastIndex:d-1}}t.calculateAllColumnsCanFitInPage=function(e,t){for(var n=[],r=0;r<t.columns.length;r++){var a=o(e,t,{start:r});a.columns.length&&(n.push(a),r=a.lastIndex)}return n}},324:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ellipsize=t.resizeColumns=t.calculateWidths=void 0;var r=n(420);function o(e,t,n){for(var r=t,a=e.reduce((function(e,t){return e+t.wrappedWidth}),0),l=0;l<e.length;l++){var i=e[l],s=r*(i.wrappedWidth/a),c=i.width+s,u=n(i),d=c<u?u:c;t-=d-i.width,i.width=d}if(t=Math.round(1e10*t)/1e10){var h=e.filter((function(e){return!(t<0)||e.width>n(e)}));h.length&&(t=o(h,t,n))}return t}function a(e,t,n,o,a){return e.map((function(e){return function(e,t,n,o,a){var l=1e4*o.scaleFactor();if((t=Math.ceil(t*l)/l)>=(0,r.getStringWidth)(e,n,o))return e;for(;t<(0,r.getStringWidth)(e+a,n,o)&&!(e.length<=1);)e=e.substring(0,e.length-1);return e.trim()+a}(e,t,n,o,a)}))}t.calculateWidths=function(e,t){!function(e,t){var n=e.scaleFactor(),o=t.settings.horizontalPageBreak,a=(0,r.getPageAvailableWidth)(e,t);t.allRows().forEach((function(l){for(var i=0,s=t.columns;i<s.length;i++){var c=s[i],u=l.cells[c.index];if(u){var d=t.hooks.didParseCell;t.callCellHooks(e,d,u,l,c,null);var h=u.padding("horizontal");u.contentWidth=(0,r.getStringWidth)(u.text,u.styles,e)+h;var f=(