react-luminus-components 1.4.9 → 1.4.10
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/.vite/manifest.json +26 -26
- package/dist/{FormDisabledProvider-9pkx7OEo.js → FormDisabledProvider-D2Y7_FZZ.js} +1 -1
- package/dist/{FormDisabledProvider-DnGcyr3r.cjs → FormDisabledProvider-HJk0UuUU.cjs} +1 -1
- package/dist/{ShortcutLinksContext-Bq4H1MkL.js → ShortcutLinksContext-BL9lT-6r.js} +2 -2
- package/dist/{ShortcutLinksContext-CGa1-dSM.cjs → ShortcutLinksContext-DRnS-vdU.cjs} +7 -7
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +5 -5
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +3 -3
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +2 -2
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +4 -4
- package/dist/style.css +1 -1
- package/dist/{useGetApiData-C4iKFWdn.js → useGetApiData-CxmOULAD.js} +1 -1
- package/dist/{useGetApiData-CpggLyHY.cjs → useGetApiData-lj7lg-03.cjs} +1 -1
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +2 -2
- package/package.json +1 -1
|
@@ -226,17 +226,17 @@ to {
|
|
|
226
226
|
> * {
|
|
227
227
|
pointer-events: auto;
|
|
228
228
|
}
|
|
229
|
-
`,Qs=16,HE=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:a,containerClassName:o})=>{let{toasts:s,handlers:c}=bE(n);return ie.createElement("div",{style:{position:"fixed",zIndex:9999,top:Qs,left:Qs,right:Qs,bottom:Qs,pointerEvents:"none",...a},className:o,onMouseEnter:c.startPause,onMouseLeave:c.endPause},s.map(l=>{let u=l.position||t,d=c.calculateOffset(l,{reverseOrder:e,gutter:r,defaultPosition:t}),f=UE(u,d);return ie.createElement(WE,{id:l.id,key:l.id,onHeightUpdate:c.updateHeight,className:l.visible?zE:"",style:f},l.type==="custom"?Uc(l.message,l):i?i(l):ie.createElement(BE,{toast:l,position:u}))}))},Zi=Tn;const Bl=m.createContext({isLoading:!1,startLoading:e=>{},stopLoading:e=>{}});var $f;(function(e){e[e.LOGGING_IN=0]="LOGGING_IN",e[e.LOGGED_IN=1]="LOGGED_IN",e[e.LOGGED_OUT=2]="LOGGED_OUT",e[e.LOGIN_FAILED=3]="LOGIN_FAILED"})($f||($f={}));const gx=$f;var Rf;(function(e){e[e.Odebrano=-2]="Odebrano",e[e.Zamitnuto=-1]="Zamitnuto",e[e.Nevyrizeno=0]="Nevyrizeno",e[e.Schvaleno=1]="Schvaleno"})(Rf||(Rf={}));const VE=Rf,vx=m.createContext({user:null,userLoginState:{state:gx.LOGGED_OUT,user:null},loginUser:()=>Promise.resolve(!0),logoutUser:()=>{}}),zc=e=>e==null?!0:!(typeof e=="object"||typeof e=="function"),bx=e=>{zc(e)||Object.keys(e).forEach(t=>{const n=e[t];if(zc(n))return;const r=Object.keys(n);r.includes("id")&&r.length===1&&n.id===null?e[t]=null:bx(n)})},yx=e=>Object.values(e).every(t=>t===null),qE=e=>{const t={};return Object.entries(e).forEach(([n,r])=>{r&&typeof r=="object"&&yx(r)?t[n]=null:t[n]=r}),t},fp=e=>{var n;const t=(n=e.response)==null?void 0:n.data;return t&&t.errorFields&&t.errorFields.length>0?t.errorFields.map(r=>({name:r.name.split(".").map(a=>`${a.charAt(0).toLowerCase()}${a.slice(1)}`).join("."),errors:r.errors})):[]},YE=(e,t)=>{fp(t).forEach(r=>{e.setError(r.name,{message:r.errors,type:"server"},{shouldFocus:!0}),zc(e.getValues(r.name))||e.setError(`${r.name}.id`,{message:r.errors,type:"server"},{shouldFocus:!0})})},xx=e=>{var n;const t=(n=e.response)==null?void 0:n.data;return t!=null&&t.permissions&&t.permissions.length>0?t.permissions:null},_x=({heading:e,content:t,placement:n,children:r,trigger:i=["hover"],popoverClassName:a,small:o,delay:s,...c})=>{const l=i.includes("hover")&&!i.includes("focus")?[...i,"focus"]:i;return b.jsx(ix,{placement:n,overlay:b.jsxs(yc,{className:Q("luminus-popover",{"luminus-popover-sm":o},a),onClick:u=>u.stopPropagation(),children:[e&&b.jsx(yc.Header,{children:typeof e=="string"?b.jsx(dn,{variant:"h6",className:"text-primary",children:e}):e}),b.jsx(yc.Body,{children:t})]}),trigger:l,rootClose:!0,show:c.controlled?c.isOpen:void 0,onToggle:c.controlled?u=>c.setIsOpen(u):void 0,delay:s,children:r})},GE="_h1_14r4v_1",ZE="_h3_14r4v_8",KE="_h6_14r4v_15",XE="_subtitle_14r4v_22",QE="_body_14r4v_29",JE="_body2_14r4v_36",e6="_caption_14r4v_43",t6="_form-label_14r4v_50",Mr={h1:GE,h3:ZE,h6:KE,subtitle:XE,body:QE,body2:JE,caption:e6,"form-label":"_form-label_14r4v_50",formLabel:t6},n6=({variant:e,className:t,children:n})=>{switch(e){case"h1":return b.jsx("h1",{className:Q("luminus-text-primary luminus-h1",Mr.h1,t),children:n});case"h3":return b.jsx("h3",{className:Q("luminus-text luminus-h3",Mr.h3,t),children:n});case"h6":return b.jsx("h6",{className:Q("luminus-text luminus-h6",Mr.h6,t),children:n});case"subtitle":return b.jsx("div",{className:Q("luminus-text luminus-subtitle",Mr.subtitle,t),children:n});case"body":return b.jsx("div",{className:Q("luminus-text luminus-body",Mr.body,t),children:n});case"body2":return b.jsx("div",{className:Q("luminus-text luminus-body2",Mr.body2,t),children:n});case"caption":return b.jsx("div",{className:Q("luminus-text-muted luminus-caption",Mr.caption,t),children:n});case"form-label":return b.jsx("div",{className:Q("luminus-text luminus-form-label",Mr.formLabel,t),children:n});default:return b.jsx(b.Fragment,{children:n})}},dn=({variant:e,className:t,children:n})=>b.jsx(n6,{variant:e,className:t,children:n}),hp=({text:e,placement:t,children:n,delay:r})=>b.jsx(_x,{content:b.jsx(dn,{variant:"body2",className:"text-center",children:e}),placement:t,delay:r,small:!0,children:n}),wx=e=>e.length<300?e:e.substring(0,300)+"...",xa=e=>e<1024?`${e.toFixed(2)} bytes`:e>=1024&&e<1048576?`${(e/1024).toFixed(1)} kB`:`${(e/1048576).toFixed(1)} MB`;function Bo(e=" ",...t){return t.filter(n=>n!=null&&n.length>0).join(e)}const Af=(e,t)=>e.map(n=>`&${t}=${n}`).join("").substring(1),r6=(e,t)=>e===null?null:e.length<=t?e:e.slice(0,t)+"…";function i6(e){return e==null?"":Ih(Ol(e),"dd.MM.yyyy")}function Wl(e){return(e==null?void 0:e.toString().split("T")[0])??""}function a6(e){return e==null?"":Ih(Ol(e),"dd.MM.yyyy HH:mm")}function o6(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}const s6=(e,t)=>Bo(" ",e?`${e},`:void 0,t),c6=(e,t)=>`${t}${e!=null?` (${e})`:""}`,l6=(e,t)=>`[${e??""}] ${t??""}`,Cx=e=>decodeURIComponent(atob(e).split("").map(t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join("")),Tx=e=>{const t=Ol(e);return!Number.isNaN(t.getTime())};function u6(){const e=new Date,t=new Date(e);return t.setHours(24,0,0,0),t.getTime()-e.getTime()}function d6(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function f6(e,t){const n=new Date(e),r=new Date(t);return n.setHours(0,0,0,0),r.setHours(0,0,0,0),n.getTime()-r.getTime()}function h6(e,t){const n=new Date(e),r=new Date(t);return n.getTime()-r.getTime()}function p6(e=Date.now(),t=Date.now()){const n=new Date(e),r=new Date(t);n.setHours(10,0,0,0),r.setHours(0,0,0,0);const i=n.getTime()-r.getTime();return Math.floor(i/(1e3*3600*24))}function kx(e=new Date){const t=new Date(e);return t.setUTCDate(1),t}function Sx(e=new Date){return tk(e)}function m6(e){const t=new Date;return t.setUTCMonth(t.getUTCMonth()+e),kx(t)}function g6(e){const t=new Date;return t.setUTCMonth(t.getUTCMonth()+e),Sx(t)}function v6(e){const t=e??new Date().getFullYear(),n=new Date(t,0,1);return n.setMinutes(n.getMinutes()-n.getTimezoneOffset()),n}function b6(e){const t=e??new Date().getFullYear(),n=new Date(t,11,31);return n.setMinutes(n.getMinutes()-n.getTimezoneOffset()),n}function y6(e){return Wl(e.toISOString())}function Ox(e){const t=/filename\*?=(?:UTF-8''|")?(.*?)(?:''|")?(?:;|$)/i,n=e.match(t);if(n&&n[1]){let r=n[1];const i=/=\?([^?]+)\?([BbQq])\?([^?]+)\?=/,a=r.match(i);if(a){const o=a[2].toUpperCase(),s=a[3];try{return o==="B"?r=Cx(s):o==="Q"&&(r=s.replace(/_/g," ").replace(/=([A-Fa-f0-9]{2})/g,(c,l)=>String.fromCharCode(parseInt(l,16)))),decodeURIComponent(r)}catch(c){return console.error("Error decoding MIME encoded filename:",c),r}}try{return decodeURIComponent(r)}catch(o){return console.error("Error decoding filename:",o),r}}return null}function Hc(e,t,n){const r=URL.createObjectURL(e),i=document.createElement("a");i.href=r,i.setAttribute("download",t),i.setAttribute("style","display: none"),n&&i.setAttribute("target","_blank"),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}function x6(e,t){let n=(t==null?void 0:t.forcedName)??(t==null?void 0:t.fallbackName)??"file";if((t==null?void 0:t.forcedName)===void 0&&typeof e.headers.get=="function"){const r=e.headers.get("Content-disposition");typeof r=="string"&&r.length>0&&(n=Ox(e.headers.get("Content-disposition"))??n)}Hc(e.data,n,t==null?void 0:t.tryToOpen)}function _6(e){const t=URL.createObjectURL(e.data);window.open(t,"_blank")}function _a(e,t=_a.characters){return e.replace(/[^A-Za-z0-9]/g,function(n){return t[n]||n})}_a.characters={Á:"A",Ă:"A",Ắ:"A",Ặ:"A",Ằ:"A",Ẳ:"A",Ẵ:"A",Ǎ:"A",Â:"A",Ấ:"A",Ậ:"A",Ầ:"A",Ẩ:"A",Ẫ:"A",Ä:"A",Ǟ:"A",Ȧ:"A",Ǡ:"A",Ạ:"A",Ȁ:"A",À:"A",Ả:"A",Ȃ:"A",Ā:"A",Ą:"A",Å:"A",Ǻ:"A",Ḁ:"A","Ⱥ":"A",Ã:"A","Ꜳ":"AA",Æ:"AE",Ǽ:"AE",Ǣ:"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY",Ḃ:"B",Ḅ:"B",Ɓ:"B",Ḇ:"B","Ƀ":"B",Ƃ:"B",Ć:"C",Č:"C",Ç:"C",Ḉ:"C",Ĉ:"C",Ċ:"C",Ƈ:"C","Ȼ":"C",Ď:"D",Ḑ:"D",Ḓ:"D",Ḋ:"D",Ḍ:"D",Ɗ:"D",Ḏ:"D",Dz:"D",Dž:"D",Đ:"D",Ð:"D",Ƌ:"D",DZ:"DZ",DŽ:"DZ",É:"E",Ĕ:"E",Ě:"E",Ȩ:"E",Ḝ:"E",Ê:"E",Ế:"E",Ệ:"E",Ề:"E",Ể:"E",Ễ:"E",Ḙ:"E",Ë:"E",Ė:"E",Ẹ:"E",Ȅ:"E",È:"E",Ẻ:"E",Ȇ:"E",Ē:"E",Ḗ:"E",Ḕ:"E",Ę:"E","Ɇ":"E",Ẽ:"E",Ḛ:"E","Ꝫ":"ET",Ḟ:"F",Ƒ:"F",Ǵ:"G",Ğ:"G",Ǧ:"G",Ģ:"G",Ĝ:"G",Ġ:"G",Ɠ:"G",Ḡ:"G",Ǥ:"G",Ḫ:"H",Ȟ:"H",Ḩ:"H",Ĥ:"H","Ⱨ":"H",Ḧ:"H",Ḣ:"H",Ḥ:"H",Ħ:"H",Í:"I",Ĭ:"I",Ǐ:"I",Î:"I",Ï:"I",Ḯ:"I",İ:"I",Ị:"I",Ȉ:"I",Ì:"I",Ỉ:"I",Ȋ:"I",Ī:"I",Į:"I",Ɨ:"I",Ĩ:"I",Ḭ:"I",І:"I","Ꝺ":"D","Ꝼ":"F","Ᵹ":"G","Ꞃ":"R","Ꞅ":"S","Ꞇ":"T","Ꝭ":"IS",Ĵ:"J","Ɉ":"J",Ḱ:"K",Ǩ:"K",Ķ:"K","Ⱪ":"K","Ꝃ":"K",Ḳ:"K",Ƙ:"K",Ḵ:"K","Ꝁ":"K","Ꝅ":"K",Ĺ:"L","Ƚ":"L",Ľ:"L",Ļ:"L",Ḽ:"L",Ḷ:"L",Ḹ:"L","Ⱡ":"L","Ꝉ":"L",Ḻ:"L",Ŀ:"L","Ɫ":"L",Lj:"L",Ł:"L",LJ:"LJ",Ḿ:"M",Ṁ:"M",Ṃ:"M","Ɱ":"M",Ń:"N",Ň:"N",Ņ:"N",Ṋ:"N",Ṅ:"N",Ṇ:"N",Ǹ:"N",Ɲ:"N",Ṉ:"N","Ƞ":"N",Nj:"N",Ñ:"N",NJ:"NJ",Ó:"O",Ŏ:"O",Ǒ:"O",Ô:"O",Ố:"O",Ộ:"O",Ồ:"O",Ổ:"O",Ỗ:"O",Ö:"O",Ȫ:"O",Ȯ:"O",Ȱ:"O",Ọ:"O",Ő:"O",Ȍ:"O",Ò:"O",Ỏ:"O",Ơ:"O",Ớ:"O",Ợ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ȏ:"O","Ꝋ":"O","Ꝍ":"O",Ō:"O",Ṓ:"O",Ṑ:"O",Ɵ:"O",Ǫ:"O",Ǭ:"O",Ø:"O",Ǿ:"O",Õ:"O",Ṍ:"O",Ṏ:"O",Ȭ:"O",Ƣ:"OI","Ꝏ":"OO",Ɛ:"E",Ɔ:"O",Ȣ:"OU",Ṕ:"P",Ṗ:"P","Ꝓ":"P",Ƥ:"P","Ꝕ":"P","Ᵽ":"P","Ꝑ":"P","Ꝙ":"Q","Ꝗ":"Q",Ŕ:"R",Ř:"R",Ŗ:"R",Ṙ:"R",Ṛ:"R",Ṝ:"R",Ȑ:"R",Ȓ:"R",Ṟ:"R","Ɍ":"R","Ɽ":"R","Ꜿ":"C",Ǝ:"E",Ś:"S",Ṥ:"S",Š:"S",Ṧ:"S",Ş:"S",Ŝ:"S",Ș:"S",Ṡ:"S",Ṣ:"S",Ṩ:"S",ß:"ss",Ť:"T",Ţ:"T",Ṱ:"T",Ț:"T","Ⱦ":"T",Ṫ:"T",Ṭ:"T",Ƭ:"T",Ṯ:"T",Ʈ:"T",Ŧ:"T","Ɐ":"A","Ꞁ":"L",Ɯ:"M","Ʌ":"V","Ꜩ":"TZ",Ú:"U",Ŭ:"U",Ǔ:"U",Û:"U",Ṷ:"U",Ü:"U",Ǘ:"U",Ǚ:"U",Ǜ:"U",Ǖ:"U",Ṳ:"U",Ụ:"U",Ű:"U",Ȕ:"U",Ù:"U",Ủ:"U",Ư:"U",Ứ:"U",Ự:"U",Ừ:"U",Ử:"U",Ữ:"U",Ȗ:"U",Ū:"U",Ṻ:"U",Ų:"U",Ů:"U",Ũ:"U",Ṹ:"U",Ṵ:"U","Ꝟ":"V",Ṿ:"V",Ʋ:"V",Ṽ:"V","Ꝡ":"VY",Ẃ:"W",Ŵ:"W",Ẅ:"W",Ẇ:"W",Ẉ:"W",Ẁ:"W","Ⱳ":"W",Ẍ:"X",Ẋ:"X",Ý:"Y",Ŷ:"Y",Ÿ:"Y",Ẏ:"Y",Ỵ:"Y",Ỳ:"Y",Ƴ:"Y",Ỷ:"Y","Ỿ":"Y",Ȳ:"Y","Ɏ":"Y",Ỹ:"Y",Ї:"YI",Ź:"Z",Ž:"Z",Ẑ:"Z","Ⱬ":"Z",Ż:"Z",Ẓ:"Z",Ȥ:"Z",Ẕ:"Z",Ƶ:"Z",Þ:"TH",IJ:"IJ",Œ:"OE","ᴀ":"A","ᴁ":"AE",ʙ:"B","ᴃ":"B","ᴄ":"C","ᴅ":"D","ᴇ":"E","ꜰ":"F",ɢ:"G",ʛ:"G",ʜ:"H",ɪ:"I",ʁ:"R","ᴊ":"J","ᴋ":"K",ʟ:"L","ᴌ":"L","ᴍ":"M",ɴ:"N","ᴏ":"O",ɶ:"OE","ᴐ":"O","ᴕ":"OU","ᴘ":"P",ʀ:"R","ᴎ":"N","ᴙ":"R","ꜱ":"S","ᴛ":"T","ⱻ":"E","ᴚ":"R","ᴜ":"U","ᴠ":"V","ᴡ":"W",ʏ:"Y","ᴢ":"Z",á:"a",ă:"a",ắ:"a",ặ:"a",ằ:"a",ẳ:"a",ẵ:"a",ǎ:"a",â:"a",ấ:"a",ậ:"a",ầ:"a",ẩ:"a",ẫ:"a",ä:"a",ǟ:"a",ȧ:"a",ǡ:"a",ạ:"a",ȁ:"a",à:"a",ả:"a",ȃ:"a",ā:"a",ą:"a","ᶏ":"a",ẚ:"a",å:"a",ǻ:"a",ḁ:"a","ⱥ":"a",ã:"a","ꜳ":"aa",æ:"ae",ǽ:"ae",ǣ:"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay",ḃ:"b",ḅ:"b",ɓ:"b",ḇ:"b","ᵬ":"b","ᶀ":"b",ƀ:"b",ƃ:"b",ɵ:"o",ć:"c",č:"c",ç:"c",ḉ:"c",ĉ:"c",ɕ:"c",ċ:"c",ƈ:"c","ȼ":"c",ď:"d",ḑ:"d",ḓ:"d","ȡ":"d",ḋ:"d",ḍ:"d",ɗ:"d","ᶑ":"d",ḏ:"d","ᵭ":"d","ᶁ":"d",đ:"d",ɖ:"d",ƌ:"d",ð:"d",ı:"i","ȷ":"j",ɟ:"j",ʄ:"j",dz:"dz",dž:"dz",é:"e",ĕ:"e",ě:"e",ȩ:"e",ḝ:"e",ê:"e",ế:"e",ệ:"e",ề:"e",ể:"e",ễ:"e",ḙ:"e",ë:"e",ė:"e",ẹ:"e",ȅ:"e",è:"e",ẻ:"e",ȇ:"e",ē:"e",ḗ:"e",ḕ:"e","ⱸ":"e",ę:"e","ᶒ":"e","ɇ":"e",ẽ:"e",ḛ:"e","ꝫ":"et",ḟ:"f",ƒ:"f","ᵮ":"f","ᶂ":"f",ǵ:"g",ğ:"g",ǧ:"g",ģ:"g",ĝ:"g",ġ:"g",ɠ:"g",ḡ:"g","ᶃ":"g",ǥ:"g",ḫ:"h",ȟ:"h",ḩ:"h",ĥ:"h","ⱨ":"h",ḧ:"h",ḣ:"h",ḥ:"h",ɦ:"h",ẖ:"h",ħ:"h",ƕ:"hv",í:"i",ĭ:"i",ǐ:"i",î:"i",ï:"i",ḯ:"i",ị:"i",ȉ:"i",ì:"i",ỉ:"i",ȋ:"i",ī:"i",į:"i","ᶖ":"i",ɨ:"i",ĩ:"i",ḭ:"i",і:"i","ꝺ":"d","ꝼ":"f","ᵹ":"g","ꞃ":"r","ꞅ":"s","ꞇ":"t","ꝭ":"is",ǰ:"j",ĵ:"j",ʝ:"j","ɉ":"j",ḱ:"k",ǩ:"k",ķ:"k","ⱪ":"k","ꝃ":"k",ḳ:"k",ƙ:"k",ḵ:"k","ᶄ":"k","ꝁ":"k","ꝅ":"k",ĺ:"l",ƚ:"l",ɬ:"l",ľ:"l",ļ:"l",ḽ:"l","ȴ":"l",ḷ:"l",ḹ:"l","ⱡ":"l","ꝉ":"l",ḻ:"l",ŀ:"l",ɫ:"l","ᶅ":"l",ɭ:"l",ł:"l",lj:"lj",ſ:"s","ẜ":"s",ẛ:"s","ẝ":"s",ḿ:"m",ṁ:"m",ṃ:"m",ɱ:"m","ᵯ":"m","ᶆ":"m",ń:"n",ň:"n",ņ:"n",ṋ:"n","ȵ":"n",ṅ:"n",ṇ:"n",ǹ:"n",ɲ:"n",ṉ:"n",ƞ:"n","ᵰ":"n","ᶇ":"n",ɳ:"n",ñ:"n",nj:"nj",ó:"o",ŏ:"o",ǒ:"o",ô:"o",ố:"o",ộ:"o",ồ:"o",ổ:"o",ỗ:"o",ö:"o",ȫ:"o",ȯ:"o",ȱ:"o",ọ:"o",ő:"o",ȍ:"o",ò:"o",ỏ:"o",ơ:"o",ớ:"o",ợ:"o",ờ:"o",ở:"o",ỡ:"o",ȏ:"o","ꝋ":"o","ꝍ":"o","ⱺ":"o",ō:"o",ṓ:"o",ṑ:"o",ǫ:"o",ǭ:"o",ø:"o",ǿ:"o",õ:"o",ṍ:"o",ṏ:"o",ȭ:"o",ƣ:"oi","ꝏ":"oo",ɛ:"e","ᶓ":"e",ɔ:"o","ᶗ":"o",ȣ:"ou",ṕ:"p",ṗ:"p","ꝓ":"p",ƥ:"p","ᵱ":"p","ᶈ":"p","ꝕ":"p","ᵽ":"p","ꝑ":"p","ꝙ":"q",ʠ:"q","ɋ":"q","ꝗ":"q",ŕ:"r",ř:"r",ŗ:"r",ṙ:"r",ṛ:"r",ṝ:"r",ȑ:"r",ɾ:"r","ᵳ":"r",ȓ:"r",ṟ:"r",ɼ:"r","ᵲ":"r","ᶉ":"r","ɍ":"r",ɽ:"r","ↄ":"c","ꜿ":"c",ɘ:"e",ɿ:"r",ś:"s",ṥ:"s",š:"s",ṧ:"s",ş:"s",ŝ:"s",ș:"s",ṡ:"s",ṣ:"s",ṩ:"s",ʂ:"s","ᵴ":"s","ᶊ":"s","ȿ":"s",ɡ:"g","ᴑ":"o","ᴓ":"o","ᴝ":"u",ť:"t",ţ:"t",ṱ:"t",ț:"t","ȶ":"t",ẗ:"t","ⱦ":"t",ṫ:"t",ṭ:"t",ƭ:"t",ṯ:"t","ᵵ":"t",ƫ:"t",ʈ:"t",ŧ:"t","ᵺ":"th",ɐ:"a","ᴂ":"ae",ǝ:"e","ᵷ":"g",ɥ:"h","ʮ":"h","ʯ":"h","ᴉ":"i",ʞ:"k","ꞁ":"l",ɯ:"m",ɰ:"m","ᴔ":"oe",ɹ:"r",ɻ:"r",ɺ:"r","ⱹ":"r",ʇ:"t",ʌ:"v",ʍ:"w",ʎ:"y","ꜩ":"tz",ú:"u",ŭ:"u",ǔ:"u",û:"u",ṷ:"u",ü:"u",ǘ:"u",ǚ:"u",ǜ:"u",ǖ:"u",ṳ:"u",ụ:"u",ű:"u",ȕ:"u",ù:"u",ủ:"u",ư:"u",ứ:"u",ự:"u",ừ:"u",ử:"u",ữ:"u",ȗ:"u",ū:"u",ṻ:"u",ų:"u","ᶙ":"u",ů:"u",ũ:"u",ṹ:"u",ṵ:"u","ᵫ":"ue","ꝸ":"um","ⱴ":"v","ꝟ":"v",ṿ:"v",ʋ:"v","ᶌ":"v","ⱱ":"v",ṽ:"v","ꝡ":"vy",ẃ:"w",ŵ:"w",ẅ:"w",ẇ:"w",ẉ:"w",ẁ:"w","ⱳ":"w",ẘ:"w",ẍ:"x",ẋ:"x","ᶍ":"x",ý:"y",ŷ:"y",ÿ:"y",ẏ:"y",ỵ:"y",ỳ:"y",ƴ:"y",ỷ:"y","ỿ":"y",ȳ:"y",ẙ:"y","ɏ":"y",ỹ:"y",ї:"yi",ź:"z",ž:"z",ẑ:"z",ʑ:"z","ⱬ":"z",ż:"z",ẓ:"z",ȥ:"z",ẕ:"z","ᵶ":"z","ᶎ":"z",ʐ:"z",ƶ:"z","ɀ":"z",þ:"th",ff:"ff",ffi:"ffi",ffl:"ffl",fi:"fi",fl:"fl",ij:"ij",œ:"oe",st:"st","ₐ":"a","ₑ":"e","ᵢ":"i","ⱼ":"j","ₒ":"o","ᵣ":"r","ᵤ":"u","ᵥ":"v","ₓ":"x",Ё:"YO",Й:"I",Ц:"TS",У:"U",К:"K",Е:"E",Н:"N",Г:"G",Ґ:"G",Ш:"SH",Щ:"SCH",З:"Z",Х:"H",Ъ:"'",ё:"yo",й:"i",ц:"ts",у:"u",к:"k",е:"e",н:"n",г:"g",ґ:"g",ш:"sh",щ:"sch",з:"z",х:"h",ъ:"'",Ф:"F",Ы:"I",В:"V",А:"a",П:"P",Р:"R",О:"O",Л:"L",Д:"D",Ж:"ZH",Э:"E",ф:"f",ы:"i",в:"v",а:"a",п:"p",р:"r",о:"o",л:"l",д:"d",ж:"zh",э:"e",Я:"Ya",Ч:"CH",С:"S",М:"M",И:"I",Т:"T",Ь:"'",Б:"B",Ю:"YU",я:"ya",ч:"ch",с:"s",м:"m",и:"i",т:"t",ь:"'",б:"b",ю:"yu"};const Ex=(e,t)=>t?e?_a(e).toLowerCase().includes(_a(t.toLowerCase())):!1:!0,Mx=(e,t)=>t?e?_a(e).toLowerCase().startsWith(_a(t.toLowerCase())):!1:!0,pp=(e,t,n)=>{const r=n!=null&&n.trimSpaces?t==null?void 0:t.replaceAll(" ",""):t,i=n!=null&&n.trimSpaces?e==null?void 0:e.replaceAll(" ",""):e;return r?r.startsWith("*")?Ex(i,r.substring(1)):Mx(i,r):!0};function $x(e,t){return function(){return e.apply(t,arguments)}}const{toString:w6}=Object.prototype,{getPrototypeOf:mp}=Object,Ul=(e=>t=>{const n=w6.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),qn=e=>(e=e.toLowerCase(),t=>Ul(t)===e),zl=e=>t=>typeof t===e,{isArray:Ia}=Array,Wo=zl("undefined");function C6(e){return e!==null&&!Wo(e)&&e.constructor!==null&&!Wo(e.constructor)&&kn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Rx=qn("ArrayBuffer");function T6(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Rx(e.buffer),t}const k6=zl("string"),kn=zl("function"),Ax=zl("number"),Hl=e=>e!==null&&typeof e=="object",S6=e=>e===!0||e===!1,Cc=e=>{if(Ul(e)!=="object")return!1;const t=mp(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},O6=qn("Date"),E6=qn("File"),M6=qn("Blob"),$6=qn("FileList"),R6=e=>Hl(e)&&kn(e.pipe),A6=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||kn(e.append)&&((t=Ul(e))==="formdata"||t==="object"&&kn(e.toString)&&e.toString()==="[object FormData]"))},j6=qn("URLSearchParams"),[P6,I6,D6,N6]=["ReadableStream","Request","Response","Headers"].map(qn),F6=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Os(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Ia(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const a=n?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let s;for(r=0;r<o;r++)s=a[r],t.call(null,e[s],s,e)}}function jx(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const di=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Px=e=>!Wo(e)&&e!==di;function jf(){const{caseless:e}=Px(this)&&this||{},t={},n=(r,i)=>{const a=e&&jx(t,i)||i;Cc(t[a])&&Cc(r)?t[a]=jf(t[a],r):Cc(r)?t[a]=jf({},r):Ia(r)?t[a]=r.slice():t[a]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Os(arguments[r],n);return t}const L6=(e,t,n,{allOwnKeys:r}={})=>(Os(t,(i,a)=>{n&&kn(i)?e[a]=$x(i,n):e[a]=i},{allOwnKeys:r}),e),B6=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),W6=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},U6=(e,t,n,r)=>{let i,a,o;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&mp(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},z6=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},H6=e=>{if(!e)return null;if(Ia(e))return e;let t=e.length;if(!Ax(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},V6=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&mp(Uint8Array)),q6=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const a=i.value;t.call(e,a[0],a[1])}},Y6=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},G6=qn("HTMLFormElement"),Z6=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),i0=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),K6=qn("RegExp"),Ix=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Os(n,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(r[a]=o||i)}),Object.defineProperties(e,r)},X6=e=>{Ix(e,(t,n)=>{if(kn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(kn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Q6=(e,t)=>{const n={},r=i=>{i.forEach(a=>{n[a]=!0})};return Ia(e)?r(e):r(String(e).split(t)),n},J6=()=>{},eM=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Ed="abcdefghijklmnopqrstuvwxyz",a0="0123456789",Dx={DIGIT:a0,ALPHA:Ed,ALPHA_DIGIT:Ed+Ed.toUpperCase()+a0},tM=(e=16,t=Dx.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function nM(e){return!!(e&&kn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const rM=e=>{const t=new Array(10),n=(r,i)=>{if(Hl(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const a=Ia(r)?[]:{};return Os(r,(o,s)=>{const c=n(o,i+1);!Wo(c)&&(a[s]=c)}),t[i]=void 0,a}}return r};return n(e,0)},iM=qn("AsyncFunction"),aM=e=>e&&(Hl(e)||kn(e))&&kn(e.then)&&kn(e.catch),Nx=((e,t)=>e?setImmediate:t?((n,r)=>(di.addEventListener("message",({source:i,data:a})=>{i===di&&a===n&&r.length&&r.shift()()},!1),i=>{r.push(i),di.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",kn(di.postMessage)),oM=typeof queueMicrotask<"u"?queueMicrotask.bind(di):typeof process<"u"&&process.nextTick||Nx,Y={isArray:Ia,isArrayBuffer:Rx,isBuffer:C6,isFormData:A6,isArrayBufferView:T6,isString:k6,isNumber:Ax,isBoolean:S6,isObject:Hl,isPlainObject:Cc,isReadableStream:P6,isRequest:I6,isResponse:D6,isHeaders:N6,isUndefined:Wo,isDate:O6,isFile:E6,isBlob:M6,isRegExp:K6,isFunction:kn,isStream:R6,isURLSearchParams:j6,isTypedArray:V6,isFileList:$6,forEach:Os,merge:jf,extend:L6,trim:F6,stripBOM:B6,inherits:W6,toFlatObject:U6,kindOf:Ul,kindOfTest:qn,endsWith:z6,toArray:H6,forEachEntry:q6,matchAll:Y6,isHTMLForm:G6,hasOwnProperty:i0,hasOwnProp:i0,reduceDescriptors:Ix,freezeMethods:X6,toObjectSet:Q6,toCamelCase:Z6,noop:J6,toFiniteNumber:eM,findKey:jx,global:di,isContextDefined:Px,ALPHABET:Dx,generateString:tM,isSpecCompliantForm:nM,toJSONObject:rM,isAsyncFn:iM,isThenable:aM,setImmediate:Nx,asap:oM};function Fe(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}Y.inherits(Fe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Y.toJSONObject(this.config),code:this.code,status:this.status}}});const Fx=Fe.prototype,Lx={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Lx[e]={value:e}});Object.defineProperties(Fe,Lx);Object.defineProperty(Fx,"isAxiosError",{value:!0});Fe.from=(e,t,n,r,i,a)=>{const o=Object.create(Fx);return Y.toFlatObject(e,o,function(c){return c!==Error.prototype},s=>s!=="isAxiosError"),Fe.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const sM=null;function Pf(e){return Y.isPlainObject(e)||Y.isArray(e)}function Bx(e){return Y.endsWith(e,"[]")?e.slice(0,-2):e}function o0(e,t,n){return e?e.concat(t).map(function(i,a){return i=Bx(i),!n&&a?"["+i+"]":i}).join(n?".":""):t}function cM(e){return Y.isArray(e)&&!e.some(Pf)}const lM=Y.toFlatObject(Y,{},null,function(t){return/^is[A-Z]/.test(t)});function Vl(e,t,n){if(!Y.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Y.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,v){return!Y.isUndefined(v[p])});const r=n.metaTokens,i=n.visitor||u,a=n.dots,o=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&Y.isSpecCompliantForm(t);if(!Y.isFunction(i))throw new TypeError("visitor must be a function");function l(g){if(g===null)return"";if(Y.isDate(g))return g.toISOString();if(!c&&Y.isBlob(g))throw new Fe("Blob is not supported. Use a Buffer instead.");return Y.isArrayBuffer(g)||Y.isTypedArray(g)?c&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function u(g,p,v){let x=g;if(g&&!v&&typeof g=="object"){if(Y.endsWith(p,"{}"))p=r?p:p.slice(0,-2),g=JSON.stringify(g);else if(Y.isArray(g)&&cM(g)||(Y.isFileList(g)||Y.endsWith(p,"[]"))&&(x=Y.toArray(g)))return p=Bx(p),x.forEach(function(y,C){!(Y.isUndefined(y)||y===null)&&t.append(o===!0?o0([p],C,a):o===null?p:p+"[]",l(y))}),!1}return Pf(g)?!0:(t.append(o0(v,p,a),l(g)),!1)}const d=[],f=Object.assign(lM,{defaultVisitor:u,convertValue:l,isVisitable:Pf});function h(g,p){if(!Y.isUndefined(g)){if(d.indexOf(g)!==-1)throw Error("Circular reference detected in "+p.join("."));d.push(g),Y.forEach(g,function(x,_){(!(Y.isUndefined(x)||x===null)&&i.call(t,x,Y.isString(_)?_.trim():_,p,f))===!0&&h(x,p?p.concat(_):[_])}),d.pop()}}if(!Y.isObject(e))throw new TypeError("data must be an object");return h(e),t}function s0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function gp(e,t){this._pairs=[],e&&Vl(e,this,t)}const Wx=gp.prototype;Wx.append=function(t,n){this._pairs.push([t,n])};Wx.toString=function(t){const n=t?function(r){return t.call(this,r,s0)}:s0;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function uM(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ux(e,t,n){if(!t)return e;const r=n&&n.encode||uM,i=n&&n.serialize;let a;if(i?a=i(t,n):a=Y.isURLSearchParams(t)?t.toString():new gp(t,n).toString(r),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class c0{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Y.forEach(this.handlers,function(r){r!==null&&t(r)})}}const zx={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dM=typeof URLSearchParams<"u"?URLSearchParams:gp,fM=typeof FormData<"u"?FormData:null,hM=typeof Blob<"u"?Blob:null,pM={isBrowser:!0,classes:{URLSearchParams:dM,FormData:fM,Blob:hM},protocols:["http","https","file","blob","url","data"]},vp=typeof window<"u"&&typeof document<"u",If=typeof navigator=="object"&&navigator||void 0,mM=vp&&(!If||["ReactNative","NativeScript","NS"].indexOf(If.product)<0),gM=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",vM=vp&&window.location.href||"http://localhost",bM=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:vp,hasStandardBrowserEnv:mM,hasStandardBrowserWebWorkerEnv:gM,navigator:If,origin:vM},Symbol.toStringTag,{value:"Module"})),_n={...bM,...pM};function yM(e,t){return Vl(e,new _n.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,a){return _n.isNode&&Y.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function xM(e){return Y.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function _M(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function Hx(e){function t(n,r,i,a){let o=n[a++];if(o==="__proto__")return!0;const s=Number.isFinite(+o),c=a>=n.length;return o=!o&&Y.isArray(i)?i.length:o,c?(Y.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!s):((!i[o]||!Y.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],a)&&Y.isArray(i[o])&&(i[o]=_M(i[o])),!s)}if(Y.isFormData(e)&&Y.isFunction(e.entries)){const n={};return Y.forEachEntry(e,(r,i)=>{t(xM(r),i,n,0)}),n}return null}function wM(e,t,n){if(Y.isString(e))try{return(t||JSON.parse)(e),Y.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Es={transitional:zx,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,a=Y.isObject(t);if(a&&Y.isHTMLForm(t)&&(t=new FormData(t)),Y.isFormData(t))return i?JSON.stringify(Hx(t)):t;if(Y.isArrayBuffer(t)||Y.isBuffer(t)||Y.isStream(t)||Y.isFile(t)||Y.isBlob(t)||Y.isReadableStream(t))return t;if(Y.isArrayBufferView(t))return t.buffer;if(Y.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return yM(t,this.formSerializer).toString();if((s=Y.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Vl(s?{"files[]":t}:t,c&&new c,this.formSerializer)}}return a||i?(n.setContentType("application/json",!1),wM(t)):t}],transformResponse:[function(t){const n=this.transitional||Es.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(Y.isResponse(t)||Y.isReadableStream(t))return t;if(t&&Y.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(s){if(o)throw s.name==="SyntaxError"?Fe.from(s,Fe.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_n.classes.FormData,Blob:_n.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Y.forEach(["delete","get","head","post","put","patch"],e=>{Es.headers[e]={}});const CM=Y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),TM=e=>{const t={};let n,r,i;return e&&e.split(`
|
|
230
|
-
`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&
|
|
231
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[l0]=this[l0]={accessors:{}}).accessors,i=this.prototype;function a(o){const s=ao(o);r[s]||(EM(i,o),r[s]=!0)}return Y.isArray(t)?t.forEach(a):a(t),this}}wn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Y.reduceDescriptors(wn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});Y.freezeMethods(wn);function $d(e,t){const n=this||Es,r=t||n,i=wn.from(r.headers);let a=r.data;return Y.forEach(e,function(s){a=s.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Vx(e){return!!(e&&e.__CANCEL__)}function Da(e,t,n){Fe.call(this,e??"canceled",Fe.ERR_CANCELED,t,n),this.name="CanceledError"}Y.inherits(Da,Fe,{__CANCEL__:!0});function qx(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Fe("Request failed with status code "+n.status,[Fe.ERR_BAD_REQUEST,Fe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function MM(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function $M(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,a=0,o;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=r[a];o||(o=l),n[i]=c,r[i]=l;let d=a,f=0;for(;d!==i;)f+=n[d++],d=d%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),l-o<t)return;const h=u&&l-u;return h?Math.round(f*1e3/h):void 0}}function RM(e,t){let n=0,r=1e3/t,i,a;const o=(l,u=Date.now())=>{n=u,i=null,a&&(clearTimeout(a),a=null),e.apply(null,l)};return[(...l)=>{const u=Date.now(),d=u-n;d>=r?o(l,u):(i=l,a||(a=setTimeout(()=>{a=null,o(i)},r-d)))},()=>i&&o(i)]}const Vc=(e,t,n=3)=>{let r=0;const i=$M(50,250);return RM(a=>{const o=a.loaded,s=a.lengthComputable?a.total:void 0,c=o-r,l=i(c),u=o<=s;r=o;const d={loaded:o,total:s,progress:s?o/s:void 0,bytes:c,rate:l||void 0,estimated:l&&s&&u?(s-o)/l:void 0,event:a,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(d)},n)},u0=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},d0=e=>(...t)=>Y.asap(()=>e(...t)),AM=_n.hasStandardBrowserEnv?function(){const t=_n.navigator&&/(msie|trident)/i.test(_n.navigator.userAgent),n=document.createElement("a");let r;function i(a){let o=a;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(o){const s=Y.isString(o)?i(o):o;return s.protocol===r.protocol&&s.host===r.host}}():function(){return function(){return!0}}(),jM=_n.hasStandardBrowserEnv?{write(e,t,n,r,i,a){const o=[e+"="+encodeURIComponent(t)];Y.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),Y.isString(r)&&o.push("path="+r),Y.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function PM(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function IM(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Yx(e,t){return e&&!PM(t)?IM(e,t):t}const f0=e=>e instanceof wn?{...e}:e;function Si(e,t){t=t||{};const n={};function r(l,u,d){return Y.isPlainObject(l)&&Y.isPlainObject(u)?Y.merge.call({caseless:d},l,u):Y.isPlainObject(u)?Y.merge({},u):Y.isArray(u)?u.slice():u}function i(l,u,d){if(Y.isUndefined(u)){if(!Y.isUndefined(l))return r(void 0,l,d)}else return r(l,u,d)}function a(l,u){if(!Y.isUndefined(u))return r(void 0,u)}function o(l,u){if(Y.isUndefined(u)){if(!Y.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function s(l,u,d){if(d in t)return r(l,u);if(d in e)return r(void 0,l)}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(l,u)=>i(f0(l),f0(u),!0)};return Y.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=c[u]||i,f=d(e[u],t[u],u);Y.isUndefined(f)&&d!==s||(n[u]=f)}),n}const Gx=e=>{const t=Si({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;t.headers=o=wn.from(o),t.url=Ux(Yx(t.baseURL,t.url),e.params,e.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let c;if(Y.isFormData(n)){if(_n.hasStandardBrowserEnv||_n.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[l,...u]=c?c.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...u].join("; "))}}if(_n.hasStandardBrowserEnv&&(r&&Y.isFunction(r)&&(r=r(t)),r||r!==!1&&AM(t.url))){const l=i&&a&&jM.read(a);l&&o.set(i,l)}return t},DM=typeof XMLHttpRequest<"u",NM=DM&&function(e){return new Promise(function(n,r){const i=Gx(e);let a=i.data;const o=wn.from(i.headers).normalize();let{responseType:s,onUploadProgress:c,onDownloadProgress:l}=i,u,d,f,h,g;function p(){h&&h(),g&&g(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(i.method.toUpperCase(),i.url,!0),v.timeout=i.timeout;function x(){if(!v)return;const y=wn.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),w={data:!s||s==="text"||s==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:y,config:e,request:v};qx(function($){n($),p()},function($){r($),p()},w),v=null}"onloadend"in v?v.onloadend=x:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(x)},v.onabort=function(){v&&(r(new Fe("Request aborted",Fe.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new Fe("Network Error",Fe.ERR_NETWORK,e,v)),v=null},v.ontimeout=function(){let C=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||zx;i.timeoutErrorMessage&&(C=i.timeoutErrorMessage),r(new Fe(C,w.clarifyTimeoutError?Fe.ETIMEDOUT:Fe.ECONNABORTED,e,v)),v=null},a===void 0&&o.setContentType(null),"setRequestHeader"in v&&Y.forEach(o.toJSON(),function(C,w){v.setRequestHeader(w,C)}),Y.isUndefined(i.withCredentials)||(v.withCredentials=!!i.withCredentials),s&&s!=="json"&&(v.responseType=i.responseType),l&&([f,g]=Vc(l,!0),v.addEventListener("progress",f)),c&&v.upload&&([d,h]=Vc(c),v.upload.addEventListener("progress",d),v.upload.addEventListener("loadend",h)),(i.cancelToken||i.signal)&&(u=y=>{v&&(r(!y||y.type?new Da(null,e,v):y),v.abort(),v=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const _=MM(i.url);if(_&&_n.protocols.indexOf(_)===-1){r(new Fe("Unsupported protocol "+_+":",Fe.ERR_BAD_REQUEST,e));return}v.send(a||null)})},FM=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const a=function(l){if(!i){i=!0,s();const u=l instanceof Error?l:this.reason;r.abort(u instanceof Fe?u:new Da(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,a(new Fe(`timeout ${t} of ms exceeded`,Fe.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(a):l.removeEventListener("abort",a)}),e=null)};e.forEach(l=>l.addEventListener("abort",a));const{signal:c}=r;return c.unsubscribe=()=>Y.asap(s),c}},LM=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},BM=async function*(e,t){for await(const n of WM(e))yield*LM(n,t)},WM=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},h0=(e,t,n,r)=>{const i=BM(e,t);let a=0,o,s=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:l,value:u}=await i.next();if(l){s(),c.close();return}let d=u.byteLength;if(n){let f=a+=d;n(f)}c.enqueue(new Uint8Array(u))}catch(l){throw s(l),l}},cancel(c){return s(c),i.return()}},{highWaterMark:2})},ql=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Zx=ql&&typeof ReadableStream=="function",UM=ql&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Kx=(e,...t)=>{try{return!!e(...t)}catch{return!1}},zM=Zx&&Kx(()=>{let e=!1;const t=new Request(_n.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),p0=64*1024,Df=Zx&&Kx(()=>Y.isReadableStream(new Response("").body)),qc={stream:Df&&(e=>e.body)};ql&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!qc[t]&&(qc[t]=Y.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Fe(`Response type '${t}' is not supported`,Fe.ERR_NOT_SUPPORT,r)})})})(new Response);const HM=async e=>{if(e==null)return 0;if(Y.isBlob(e))return e.size;if(Y.isSpecCompliantForm(e))return(await new Request(_n.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Y.isArrayBufferView(e)||Y.isArrayBuffer(e))return e.byteLength;if(Y.isURLSearchParams(e)&&(e=e+""),Y.isString(e))return(await UM(e)).byteLength},VM=async(e,t)=>{const n=Y.toFiniteNumber(e.getContentLength());return n??HM(t)},qM=ql&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:a,timeout:o,onDownloadProgress:s,onUploadProgress:c,responseType:l,headers:u,withCredentials:d="same-origin",fetchOptions:f}=Gx(e);l=l?(l+"").toLowerCase():"text";let h=FM([i,a&&a.toAbortSignal()],o),g;const p=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let v;try{if(c&&zM&&n!=="get"&&n!=="head"&&(v=await VM(u,r))!==0){let w=new Request(t,{method:"POST",body:r,duplex:"half"}),T;if(Y.isFormData(r)&&(T=w.headers.get("content-type"))&&u.setContentType(T),w.body){const[$,R]=u0(v,Vc(d0(c)));r=h0(w.body,p0,$,R)}}Y.isString(d)||(d=d?"include":"omit");const x="credentials"in Request.prototype;g=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:x?d:void 0});let _=await fetch(g);const y=Df&&(l==="stream"||l==="response");if(Df&&(s||y&&p)){const w={};["status","statusText","headers"].forEach(S=>{w[S]=_[S]});const T=Y.toFiniteNumber(_.headers.get("content-length")),[$,R]=s&&u0(T,Vc(d0(s),!0))||[];_=new Response(h0(_.body,p0,$,()=>{R&&R(),p&&p()}),w)}l=l||"text";let C=await qc[Y.findKey(qc,l)||"text"](_,e);return!y&&p&&p(),await new Promise((w,T)=>{qx(w,T,{data:C,headers:wn.from(_.headers),status:_.status,statusText:_.statusText,config:e,request:g})})}catch(x){throw p&&p(),x&&x.name==="TypeError"&&/fetch/i.test(x.message)?Object.assign(new Fe("Network Error",Fe.ERR_NETWORK,e,g),{cause:x.cause||x}):Fe.from(x,x&&x.code,e,g)}}),Nf={http:sM,xhr:NM,fetch:qM};Y.forEach(Nf,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const m0=e=>`- ${e}`,YM=e=>Y.isFunction(e)||e===null||e===!1,Xx={getAdapter:e=>{e=Y.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let a=0;a<t;a++){n=e[a];let o;if(r=n,!YM(n)&&(r=Nf[(o=String(n)).toLowerCase()],r===void 0))throw new Fe(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+a]=r}if(!r){const a=Object.entries(i).map(([s,c])=>`adapter ${s} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since :
|
|
229
|
+
`,Qs=16,HE=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:a,containerClassName:o})=>{let{toasts:s,handlers:c}=bE(n);return ie.createElement("div",{style:{position:"fixed",zIndex:9999,top:Qs,left:Qs,right:Qs,bottom:Qs,pointerEvents:"none",...a},className:o,onMouseEnter:c.startPause,onMouseLeave:c.endPause},s.map(l=>{let u=l.position||t,d=c.calculateOffset(l,{reverseOrder:e,gutter:r,defaultPosition:t}),f=UE(u,d);return ie.createElement(WE,{id:l.id,key:l.id,onHeightUpdate:c.updateHeight,className:l.visible?zE:"",style:f},l.type==="custom"?Uc(l.message,l):i?i(l):ie.createElement(BE,{toast:l,position:u}))}))},Zi=Tn;const Bl=m.createContext({isLoading:!1,startLoading:e=>{},stopLoading:e=>{}});var $f;(function(e){e[e.LOGGING_IN=0]="LOGGING_IN",e[e.LOGGED_IN=1]="LOGGED_IN",e[e.LOGGED_OUT=2]="LOGGED_OUT",e[e.LOGIN_FAILED=3]="LOGIN_FAILED"})($f||($f={}));const gx=$f;var Rf;(function(e){e[e.Odebrano=-2]="Odebrano",e[e.Zamitnuto=-1]="Zamitnuto",e[e.Nevyrizeno=0]="Nevyrizeno",e[e.Schvaleno=1]="Schvaleno"})(Rf||(Rf={}));const VE=Rf,vx=m.createContext({user:null,userLoginState:{state:gx.LOGGED_OUT,user:null},loginUser:()=>Promise.resolve(!0),logoutUser:()=>{}}),zc=e=>e==null?!0:!(typeof e=="object"||typeof e=="function"),bx=e=>{zc(e)||Object.keys(e).forEach(t=>{const n=e[t];if(zc(n))return;const r=Object.keys(n);r.includes("id")&&r.length===1&&n.id===null?e[t]=null:bx(n)})},yx=e=>Object.values(e).every(t=>t===null),qE=e=>{const t={};return Object.entries(e).forEach(([n,r])=>{r&&typeof r=="object"&&yx(r)?t[n]=null:t[n]=r}),t},fp=e=>{var n;const t=(n=e.response)==null?void 0:n.data;return t&&t.errorFields&&t.errorFields.length>0?t.errorFields.map(r=>({name:r.name.split(".").map(a=>`${a.charAt(0).toLowerCase()}${a.slice(1)}`).join("."),errors:r.errors})):[]},YE=(e,t)=>{fp(t).forEach(r=>{e.setError(r.name,{message:r.errors,type:"server"},{shouldFocus:!0}),zc(e.getValues(r.name))||e.setError(`${r.name}.id`,{message:r.errors,type:"server"},{shouldFocus:!0})})},xx=e=>{var n;const t=(n=e.response)==null?void 0:n.data;return t!=null&&t.permissions&&t.permissions.length>0?t.permissions:null},_x=({heading:e,content:t,placement:n,children:r,trigger:i=["hover"],popoverClassName:a,small:o,delay:s,...c})=>{const l=i.includes("hover")&&!i.includes("focus")?[...i,"focus"]:i;return b.jsx(ix,{placement:n,overlay:b.jsxs(yc,{className:Q("luminus-popover",{"luminus-popover-sm":o},a),onClick:u=>u.stopPropagation(),children:[e&&b.jsx(yc.Header,{children:typeof e=="string"?b.jsx(dn,{variant:"h6",className:"text-primary",children:e}):e}),b.jsx(yc.Body,{children:t})]}),trigger:l,rootClose:!0,show:c.controlled?c.isOpen:void 0,onToggle:c.controlled?u=>c.setIsOpen(u):void 0,delay:s,children:r})},GE="_h1_14r4v_1",ZE="_h3_14r4v_8",KE="_h6_14r4v_15",XE="_subtitle_14r4v_22",QE="_body_14r4v_29",JE="_body2_14r4v_36",eM="_caption_14r4v_43",tM="_form-label_14r4v_50",Mr={h1:GE,h3:ZE,h6:KE,subtitle:XE,body:QE,body2:JE,caption:eM,"form-label":"_form-label_14r4v_50",formLabel:tM},nM=({variant:e,className:t,children:n})=>{switch(e){case"h1":return b.jsx("h1",{className:Q("luminus-text-primary luminus-h1",Mr.h1,t),children:n});case"h3":return b.jsx("h3",{className:Q("luminus-text luminus-h3",Mr.h3,t),children:n});case"h6":return b.jsx("h6",{className:Q("luminus-text luminus-h6",Mr.h6,t),children:n});case"subtitle":return b.jsx("div",{className:Q("luminus-text luminus-subtitle",Mr.subtitle,t),children:n});case"body":return b.jsx("div",{className:Q("luminus-text luminus-body",Mr.body,t),children:n});case"body2":return b.jsx("div",{className:Q("luminus-text luminus-body2",Mr.body2,t),children:n});case"caption":return b.jsx("div",{className:Q("luminus-text-muted luminus-caption",Mr.caption,t),children:n});case"form-label":return b.jsx("div",{className:Q("luminus-text luminus-form-label",Mr.formLabel,t),children:n});default:return b.jsx(b.Fragment,{children:n})}},dn=({variant:e,className:t,children:n})=>b.jsx(nM,{variant:e,className:t,children:n}),hp=({text:e,placement:t,children:n,delay:r})=>b.jsx(_x,{content:b.jsx(dn,{variant:"body2",className:"text-center",children:e}),placement:t,delay:r,small:!0,children:n}),wx=e=>e.length<300?e:e.substring(0,300)+"...",xa=e=>e<1024?`${e.toFixed(2)} bytes`:e>=1024&&e<1048576?`${(e/1024).toFixed(1)} kB`:`${(e/1048576).toFixed(1)} MB`;function Bo(e=" ",...t){return t.filter(n=>n!=null&&n.length>0).join(e)}const Af=(e,t)=>e.map(n=>`&${t}=${n}`).join("").substring(1),rM=(e,t)=>e===null?null:e.length<=t?e:e.slice(0,t)+"…";function iM(e){return e==null?"":Ih(Ol(e),"dd.MM.yyyy")}function Wl(e){return(e==null?void 0:e.toString().split("T")[0])??""}function aM(e){return e==null?"":Ih(Ol(e),"dd.MM.yyyy HH:mm")}function oM(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}const sM=(e,t)=>Bo(" ",e?`${e},`:void 0,t),cM=(e,t)=>`${t}${e!=null?` (${e})`:""}`,lM=(e,t)=>`[${e??""}] ${t??""}`,Cx=e=>decodeURIComponent(atob(e).split("").map(t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join("")),Tx=e=>{const t=Ol(e);return!Number.isNaN(t.getTime())};function uM(){const e=new Date,t=new Date(e);return t.setHours(24,0,0,0),t.getTime()-e.getTime()}function dM(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function fM(e,t){const n=new Date(e),r=new Date(t);return n.setHours(0,0,0,0),r.setHours(0,0,0,0),n.getTime()-r.getTime()}function hM(e,t){const n=new Date(e),r=new Date(t);return n.getTime()-r.getTime()}function pM(e=Date.now(),t=Date.now()){const n=new Date(e),r=new Date(t);n.setHours(10,0,0,0),r.setHours(0,0,0,0);const i=n.getTime()-r.getTime();return Math.floor(i/(1e3*3600*24))}function kx(e=new Date){const t=new Date(e);return t.setUTCDate(1),t}function Sx(e=new Date){return tk(e)}function mM(e){const t=new Date;return t.setUTCMonth(t.getUTCMonth()+e),kx(t)}function gM(e){const t=new Date;return t.setUTCMonth(t.getUTCMonth()+e),Sx(t)}function vM(e){const t=e??new Date().getFullYear(),n=new Date(t,0,1);return n.setMinutes(n.getMinutes()-n.getTimezoneOffset()),n}function bM(e){const t=e??new Date().getFullYear(),n=new Date(t,11,31);return n.setMinutes(n.getMinutes()-n.getTimezoneOffset()),n}function yM(e){return Wl(e.toISOString())}function Ox(e){const t=/filename\*?=(?:UTF-8''|")?(.*?)(?:''|")?(?:;|$)/i,n=e.match(t);if(n&&n[1]){let r=n[1];const i=/=\?([^?]+)\?([BbQq])\?([^?]+)\?=/,a=r.match(i);if(a){const o=a[2].toUpperCase(),s=a[3];try{return o==="B"?r=Cx(s):o==="Q"&&(r=s.replace(/_/g," ").replace(/=([A-Fa-f0-9]{2})/g,(c,l)=>String.fromCharCode(parseInt(l,16)))),decodeURIComponent(r)}catch(c){return console.error("Error decoding MIME encoded filename:",c),r}}try{return decodeURIComponent(r)}catch(o){return console.error("Error decoding filename:",o),r}}return null}function Hc(e,t,n){const r=URL.createObjectURL(e),i=document.createElement("a");i.href=r,i.setAttribute("download",t),i.setAttribute("style","display: none"),n&&i.setAttribute("target","_blank"),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}function xM(e,t){let n=(t==null?void 0:t.forcedName)??(t==null?void 0:t.fallbackName)??"file";if((t==null?void 0:t.forcedName)===void 0&&typeof e.headers.get=="function"){const r=e.headers.get("Content-disposition");typeof r=="string"&&r.length>0&&(n=Ox(e.headers.get("Content-disposition"))??n)}Hc(e.data,n,t==null?void 0:t.tryToOpen)}function _M(e){const t=URL.createObjectURL(e.data);window.open(t,"_blank")}function _a(e,t=_a.characters){return e.replace(/[^A-Za-z0-9]/g,function(n){return t[n]||n})}_a.characters={Á:"A",Ă:"A",Ắ:"A",Ặ:"A",Ằ:"A",Ẳ:"A",Ẵ:"A",Ǎ:"A",Â:"A",Ấ:"A",Ậ:"A",Ầ:"A",Ẩ:"A",Ẫ:"A",Ä:"A",Ǟ:"A",Ȧ:"A",Ǡ:"A",Ạ:"A",Ȁ:"A",À:"A",Ả:"A",Ȃ:"A",Ā:"A",Ą:"A",Å:"A",Ǻ:"A",Ḁ:"A","Ⱥ":"A",Ã:"A","Ꜳ":"AA",Æ:"AE",Ǽ:"AE",Ǣ:"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY",Ḃ:"B",Ḅ:"B",Ɓ:"B",Ḇ:"B","Ƀ":"B",Ƃ:"B",Ć:"C",Č:"C",Ç:"C",Ḉ:"C",Ĉ:"C",Ċ:"C",Ƈ:"C","Ȼ":"C",Ď:"D",Ḑ:"D",Ḓ:"D",Ḋ:"D",Ḍ:"D",Ɗ:"D",Ḏ:"D",Dz:"D",Dž:"D",Đ:"D",Ð:"D",Ƌ:"D",DZ:"DZ",DŽ:"DZ",É:"E",Ĕ:"E",Ě:"E",Ȩ:"E",Ḝ:"E",Ê:"E",Ế:"E",Ệ:"E",Ề:"E",Ể:"E",Ễ:"E",Ḙ:"E",Ë:"E",Ė:"E",Ẹ:"E",Ȅ:"E",È:"E",Ẻ:"E",Ȇ:"E",Ē:"E",Ḗ:"E",Ḕ:"E",Ę:"E","Ɇ":"E",Ẽ:"E",Ḛ:"E","Ꝫ":"ET",Ḟ:"F",Ƒ:"F",Ǵ:"G",Ğ:"G",Ǧ:"G",Ģ:"G",Ĝ:"G",Ġ:"G",Ɠ:"G",Ḡ:"G",Ǥ:"G",Ḫ:"H",Ȟ:"H",Ḩ:"H",Ĥ:"H","Ⱨ":"H",Ḧ:"H",Ḣ:"H",Ḥ:"H",Ħ:"H",Í:"I",Ĭ:"I",Ǐ:"I",Î:"I",Ï:"I",Ḯ:"I",İ:"I",Ị:"I",Ȉ:"I",Ì:"I",Ỉ:"I",Ȋ:"I",Ī:"I",Į:"I",Ɨ:"I",Ĩ:"I",Ḭ:"I",І:"I","Ꝺ":"D","Ꝼ":"F","Ᵹ":"G","Ꞃ":"R","Ꞅ":"S","Ꞇ":"T","Ꝭ":"IS",Ĵ:"J","Ɉ":"J",Ḱ:"K",Ǩ:"K",Ķ:"K","Ⱪ":"K","Ꝃ":"K",Ḳ:"K",Ƙ:"K",Ḵ:"K","Ꝁ":"K","Ꝅ":"K",Ĺ:"L","Ƚ":"L",Ľ:"L",Ļ:"L",Ḽ:"L",Ḷ:"L",Ḹ:"L","Ⱡ":"L","Ꝉ":"L",Ḻ:"L",Ŀ:"L","Ɫ":"L",Lj:"L",Ł:"L",LJ:"LJ",Ḿ:"M",Ṁ:"M",Ṃ:"M","Ɱ":"M",Ń:"N",Ň:"N",Ņ:"N",Ṋ:"N",Ṅ:"N",Ṇ:"N",Ǹ:"N",Ɲ:"N",Ṉ:"N","Ƞ":"N",Nj:"N",Ñ:"N",NJ:"NJ",Ó:"O",Ŏ:"O",Ǒ:"O",Ô:"O",Ố:"O",Ộ:"O",Ồ:"O",Ổ:"O",Ỗ:"O",Ö:"O",Ȫ:"O",Ȯ:"O",Ȱ:"O",Ọ:"O",Ő:"O",Ȍ:"O",Ò:"O",Ỏ:"O",Ơ:"O",Ớ:"O",Ợ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ȏ:"O","Ꝋ":"O","Ꝍ":"O",Ō:"O",Ṓ:"O",Ṑ:"O",Ɵ:"O",Ǫ:"O",Ǭ:"O",Ø:"O",Ǿ:"O",Õ:"O",Ṍ:"O",Ṏ:"O",Ȭ:"O",Ƣ:"OI","Ꝏ":"OO",Ɛ:"E",Ɔ:"O",Ȣ:"OU",Ṕ:"P",Ṗ:"P","Ꝓ":"P",Ƥ:"P","Ꝕ":"P","Ᵽ":"P","Ꝑ":"P","Ꝙ":"Q","Ꝗ":"Q",Ŕ:"R",Ř:"R",Ŗ:"R",Ṙ:"R",Ṛ:"R",Ṝ:"R",Ȑ:"R",Ȓ:"R",Ṟ:"R","Ɍ":"R","Ɽ":"R","Ꜿ":"C",Ǝ:"E",Ś:"S",Ṥ:"S",Š:"S",Ṧ:"S",Ş:"S",Ŝ:"S",Ș:"S",Ṡ:"S",Ṣ:"S",Ṩ:"S",ß:"ss",Ť:"T",Ţ:"T",Ṱ:"T",Ț:"T","Ⱦ":"T",Ṫ:"T",Ṭ:"T",Ƭ:"T",Ṯ:"T",Ʈ:"T",Ŧ:"T","Ɐ":"A","Ꞁ":"L",Ɯ:"M","Ʌ":"V","Ꜩ":"TZ",Ú:"U",Ŭ:"U",Ǔ:"U",Û:"U",Ṷ:"U",Ü:"U",Ǘ:"U",Ǚ:"U",Ǜ:"U",Ǖ:"U",Ṳ:"U",Ụ:"U",Ű:"U",Ȕ:"U",Ù:"U",Ủ:"U",Ư:"U",Ứ:"U",Ự:"U",Ừ:"U",Ử:"U",Ữ:"U",Ȗ:"U",Ū:"U",Ṻ:"U",Ų:"U",Ů:"U",Ũ:"U",Ṹ:"U",Ṵ:"U","Ꝟ":"V",Ṿ:"V",Ʋ:"V",Ṽ:"V","Ꝡ":"VY",Ẃ:"W",Ŵ:"W",Ẅ:"W",Ẇ:"W",Ẉ:"W",Ẁ:"W","Ⱳ":"W",Ẍ:"X",Ẋ:"X",Ý:"Y",Ŷ:"Y",Ÿ:"Y",Ẏ:"Y",Ỵ:"Y",Ỳ:"Y",Ƴ:"Y",Ỷ:"Y","Ỿ":"Y",Ȳ:"Y","Ɏ":"Y",Ỹ:"Y",Ї:"YI",Ź:"Z",Ž:"Z",Ẑ:"Z","Ⱬ":"Z",Ż:"Z",Ẓ:"Z",Ȥ:"Z",Ẕ:"Z",Ƶ:"Z",Þ:"TH",IJ:"IJ",Œ:"OE","ᴀ":"A","ᴁ":"AE",ʙ:"B","ᴃ":"B","ᴄ":"C","ᴅ":"D","ᴇ":"E","ꜰ":"F",ɢ:"G",ʛ:"G",ʜ:"H",ɪ:"I",ʁ:"R","ᴊ":"J","ᴋ":"K",ʟ:"L","ᴌ":"L","ᴍ":"M",ɴ:"N","ᴏ":"O",ɶ:"OE","ᴐ":"O","ᴕ":"OU","ᴘ":"P",ʀ:"R","ᴎ":"N","ᴙ":"R","ꜱ":"S","ᴛ":"T","ⱻ":"E","ᴚ":"R","ᴜ":"U","ᴠ":"V","ᴡ":"W",ʏ:"Y","ᴢ":"Z",á:"a",ă:"a",ắ:"a",ặ:"a",ằ:"a",ẳ:"a",ẵ:"a",ǎ:"a",â:"a",ấ:"a",ậ:"a",ầ:"a",ẩ:"a",ẫ:"a",ä:"a",ǟ:"a",ȧ:"a",ǡ:"a",ạ:"a",ȁ:"a",à:"a",ả:"a",ȃ:"a",ā:"a",ą:"a","ᶏ":"a",ẚ:"a",å:"a",ǻ:"a",ḁ:"a","ⱥ":"a",ã:"a","ꜳ":"aa",æ:"ae",ǽ:"ae",ǣ:"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay",ḃ:"b",ḅ:"b",ɓ:"b",ḇ:"b","ᵬ":"b","ᶀ":"b",ƀ:"b",ƃ:"b",ɵ:"o",ć:"c",č:"c",ç:"c",ḉ:"c",ĉ:"c",ɕ:"c",ċ:"c",ƈ:"c","ȼ":"c",ď:"d",ḑ:"d",ḓ:"d","ȡ":"d",ḋ:"d",ḍ:"d",ɗ:"d","ᶑ":"d",ḏ:"d","ᵭ":"d","ᶁ":"d",đ:"d",ɖ:"d",ƌ:"d",ð:"d",ı:"i","ȷ":"j",ɟ:"j",ʄ:"j",dz:"dz",dž:"dz",é:"e",ĕ:"e",ě:"e",ȩ:"e",ḝ:"e",ê:"e",ế:"e",ệ:"e",ề:"e",ể:"e",ễ:"e",ḙ:"e",ë:"e",ė:"e",ẹ:"e",ȅ:"e",è:"e",ẻ:"e",ȇ:"e",ē:"e",ḗ:"e",ḕ:"e","ⱸ":"e",ę:"e","ᶒ":"e","ɇ":"e",ẽ:"e",ḛ:"e","ꝫ":"et",ḟ:"f",ƒ:"f","ᵮ":"f","ᶂ":"f",ǵ:"g",ğ:"g",ǧ:"g",ģ:"g",ĝ:"g",ġ:"g",ɠ:"g",ḡ:"g","ᶃ":"g",ǥ:"g",ḫ:"h",ȟ:"h",ḩ:"h",ĥ:"h","ⱨ":"h",ḧ:"h",ḣ:"h",ḥ:"h",ɦ:"h",ẖ:"h",ħ:"h",ƕ:"hv",í:"i",ĭ:"i",ǐ:"i",î:"i",ï:"i",ḯ:"i",ị:"i",ȉ:"i",ì:"i",ỉ:"i",ȋ:"i",ī:"i",į:"i","ᶖ":"i",ɨ:"i",ĩ:"i",ḭ:"i",і:"i","ꝺ":"d","ꝼ":"f","ᵹ":"g","ꞃ":"r","ꞅ":"s","ꞇ":"t","ꝭ":"is",ǰ:"j",ĵ:"j",ʝ:"j","ɉ":"j",ḱ:"k",ǩ:"k",ķ:"k","ⱪ":"k","ꝃ":"k",ḳ:"k",ƙ:"k",ḵ:"k","ᶄ":"k","ꝁ":"k","ꝅ":"k",ĺ:"l",ƚ:"l",ɬ:"l",ľ:"l",ļ:"l",ḽ:"l","ȴ":"l",ḷ:"l",ḹ:"l","ⱡ":"l","ꝉ":"l",ḻ:"l",ŀ:"l",ɫ:"l","ᶅ":"l",ɭ:"l",ł:"l",lj:"lj",ſ:"s","ẜ":"s",ẛ:"s","ẝ":"s",ḿ:"m",ṁ:"m",ṃ:"m",ɱ:"m","ᵯ":"m","ᶆ":"m",ń:"n",ň:"n",ņ:"n",ṋ:"n","ȵ":"n",ṅ:"n",ṇ:"n",ǹ:"n",ɲ:"n",ṉ:"n",ƞ:"n","ᵰ":"n","ᶇ":"n",ɳ:"n",ñ:"n",nj:"nj",ó:"o",ŏ:"o",ǒ:"o",ô:"o",ố:"o",ộ:"o",ồ:"o",ổ:"o",ỗ:"o",ö:"o",ȫ:"o",ȯ:"o",ȱ:"o",ọ:"o",ő:"o",ȍ:"o",ò:"o",ỏ:"o",ơ:"o",ớ:"o",ợ:"o",ờ:"o",ở:"o",ỡ:"o",ȏ:"o","ꝋ":"o","ꝍ":"o","ⱺ":"o",ō:"o",ṓ:"o",ṑ:"o",ǫ:"o",ǭ:"o",ø:"o",ǿ:"o",õ:"o",ṍ:"o",ṏ:"o",ȭ:"o",ƣ:"oi","ꝏ":"oo",ɛ:"e","ᶓ":"e",ɔ:"o","ᶗ":"o",ȣ:"ou",ṕ:"p",ṗ:"p","ꝓ":"p",ƥ:"p","ᵱ":"p","ᶈ":"p","ꝕ":"p","ᵽ":"p","ꝑ":"p","ꝙ":"q",ʠ:"q","ɋ":"q","ꝗ":"q",ŕ:"r",ř:"r",ŗ:"r",ṙ:"r",ṛ:"r",ṝ:"r",ȑ:"r",ɾ:"r","ᵳ":"r",ȓ:"r",ṟ:"r",ɼ:"r","ᵲ":"r","ᶉ":"r","ɍ":"r",ɽ:"r","ↄ":"c","ꜿ":"c",ɘ:"e",ɿ:"r",ś:"s",ṥ:"s",š:"s",ṧ:"s",ş:"s",ŝ:"s",ș:"s",ṡ:"s",ṣ:"s",ṩ:"s",ʂ:"s","ᵴ":"s","ᶊ":"s","ȿ":"s",ɡ:"g","ᴑ":"o","ᴓ":"o","ᴝ":"u",ť:"t",ţ:"t",ṱ:"t",ț:"t","ȶ":"t",ẗ:"t","ⱦ":"t",ṫ:"t",ṭ:"t",ƭ:"t",ṯ:"t","ᵵ":"t",ƫ:"t",ʈ:"t",ŧ:"t","ᵺ":"th",ɐ:"a","ᴂ":"ae",ǝ:"e","ᵷ":"g",ɥ:"h","ʮ":"h","ʯ":"h","ᴉ":"i",ʞ:"k","ꞁ":"l",ɯ:"m",ɰ:"m","ᴔ":"oe",ɹ:"r",ɻ:"r",ɺ:"r","ⱹ":"r",ʇ:"t",ʌ:"v",ʍ:"w",ʎ:"y","ꜩ":"tz",ú:"u",ŭ:"u",ǔ:"u",û:"u",ṷ:"u",ü:"u",ǘ:"u",ǚ:"u",ǜ:"u",ǖ:"u",ṳ:"u",ụ:"u",ű:"u",ȕ:"u",ù:"u",ủ:"u",ư:"u",ứ:"u",ự:"u",ừ:"u",ử:"u",ữ:"u",ȗ:"u",ū:"u",ṻ:"u",ų:"u","ᶙ":"u",ů:"u",ũ:"u",ṹ:"u",ṵ:"u","ᵫ":"ue","ꝸ":"um","ⱴ":"v","ꝟ":"v",ṿ:"v",ʋ:"v","ᶌ":"v","ⱱ":"v",ṽ:"v","ꝡ":"vy",ẃ:"w",ŵ:"w",ẅ:"w",ẇ:"w",ẉ:"w",ẁ:"w","ⱳ":"w",ẘ:"w",ẍ:"x",ẋ:"x","ᶍ":"x",ý:"y",ŷ:"y",ÿ:"y",ẏ:"y",ỵ:"y",ỳ:"y",ƴ:"y",ỷ:"y","ỿ":"y",ȳ:"y",ẙ:"y","ɏ":"y",ỹ:"y",ї:"yi",ź:"z",ž:"z",ẑ:"z",ʑ:"z","ⱬ":"z",ż:"z",ẓ:"z",ȥ:"z",ẕ:"z","ᵶ":"z","ᶎ":"z",ʐ:"z",ƶ:"z","ɀ":"z",þ:"th",ff:"ff",ffi:"ffi",ffl:"ffl",fi:"fi",fl:"fl",ij:"ij",œ:"oe",st:"st","ₐ":"a","ₑ":"e","ᵢ":"i","ⱼ":"j","ₒ":"o","ᵣ":"r","ᵤ":"u","ᵥ":"v","ₓ":"x",Ё:"YO",Й:"I",Ц:"TS",У:"U",К:"K",Е:"E",Н:"N",Г:"G",Ґ:"G",Ш:"SH",Щ:"SCH",З:"Z",Х:"H",Ъ:"'",ё:"yo",й:"i",ц:"ts",у:"u",к:"k",е:"e",н:"n",г:"g",ґ:"g",ш:"sh",щ:"sch",з:"z",х:"h",ъ:"'",Ф:"F",Ы:"I",В:"V",А:"a",П:"P",Р:"R",О:"O",Л:"L",Д:"D",Ж:"ZH",Э:"E",ф:"f",ы:"i",в:"v",а:"a",п:"p",р:"r",о:"o",л:"l",д:"d",ж:"zh",э:"e",Я:"Ya",Ч:"CH",С:"S",М:"M",И:"I",Т:"T",Ь:"'",Б:"B",Ю:"YU",я:"ya",ч:"ch",с:"s",м:"m",и:"i",т:"t",ь:"'",б:"b",ю:"yu"};const Ex=(e,t)=>t?e?_a(e).toLowerCase().includes(_a(t.toLowerCase())):!1:!0,Mx=(e,t)=>t?e?_a(e).toLowerCase().startsWith(_a(t.toLowerCase())):!1:!0,pp=(e,t,n)=>{const r=n!=null&&n.trimSpaces?t==null?void 0:t.replaceAll(" ",""):t,i=n!=null&&n.trimSpaces?e==null?void 0:e.replaceAll(" ",""):e;return r?r.startsWith("*")?Ex(i,r.substring(1)):Mx(i,r):!0};function $x(e,t){return function(){return e.apply(t,arguments)}}const{toString:wM}=Object.prototype,{getPrototypeOf:mp}=Object,Ul=(e=>t=>{const n=wM.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),qn=e=>(e=e.toLowerCase(),t=>Ul(t)===e),zl=e=>t=>typeof t===e,{isArray:Ia}=Array,Wo=zl("undefined");function CM(e){return e!==null&&!Wo(e)&&e.constructor!==null&&!Wo(e.constructor)&&kn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Rx=qn("ArrayBuffer");function TM(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Rx(e.buffer),t}const kM=zl("string"),kn=zl("function"),Ax=zl("number"),Hl=e=>e!==null&&typeof e=="object",SM=e=>e===!0||e===!1,Cc=e=>{if(Ul(e)!=="object")return!1;const t=mp(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},OM=qn("Date"),EM=qn("File"),MM=qn("Blob"),$M=qn("FileList"),RM=e=>Hl(e)&&kn(e.pipe),AM=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||kn(e.append)&&((t=Ul(e))==="formdata"||t==="object"&&kn(e.toString)&&e.toString()==="[object FormData]"))},jM=qn("URLSearchParams"),[PM,IM,DM,NM]=["ReadableStream","Request","Response","Headers"].map(qn),FM=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Os(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Ia(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const a=n?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let s;for(r=0;r<o;r++)s=a[r],t.call(null,e[s],s,e)}}function jx(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const di=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Px=e=>!Wo(e)&&e!==di;function jf(){const{caseless:e}=Px(this)&&this||{},t={},n=(r,i)=>{const a=e&&jx(t,i)||i;Cc(t[a])&&Cc(r)?t[a]=jf(t[a],r):Cc(r)?t[a]=jf({},r):Ia(r)?t[a]=r.slice():t[a]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Os(arguments[r],n);return t}const LM=(e,t,n,{allOwnKeys:r}={})=>(Os(t,(i,a)=>{n&&kn(i)?e[a]=$x(i,n):e[a]=i},{allOwnKeys:r}),e),BM=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),WM=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},UM=(e,t,n,r)=>{let i,a,o;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&mp(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},zM=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},HM=e=>{if(!e)return null;if(Ia(e))return e;let t=e.length;if(!Ax(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},VM=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&mp(Uint8Array)),qM=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const a=i.value;t.call(e,a[0],a[1])}},YM=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},GM=qn("HTMLFormElement"),ZM=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),i0=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),KM=qn("RegExp"),Ix=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Os(n,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(r[a]=o||i)}),Object.defineProperties(e,r)},XM=e=>{Ix(e,(t,n)=>{if(kn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(kn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},QM=(e,t)=>{const n={},r=i=>{i.forEach(a=>{n[a]=!0})};return Ia(e)?r(e):r(String(e).split(t)),n},JM=()=>{},e6=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Ed="abcdefghijklmnopqrstuvwxyz",a0="0123456789",Dx={DIGIT:a0,ALPHA:Ed,ALPHA_DIGIT:Ed+Ed.toUpperCase()+a0},t6=(e=16,t=Dx.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function n6(e){return!!(e&&kn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const r6=e=>{const t=new Array(10),n=(r,i)=>{if(Hl(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const a=Ia(r)?[]:{};return Os(r,(o,s)=>{const c=n(o,i+1);!Wo(c)&&(a[s]=c)}),t[i]=void 0,a}}return r};return n(e,0)},i6=qn("AsyncFunction"),a6=e=>e&&(Hl(e)||kn(e))&&kn(e.then)&&kn(e.catch),Nx=((e,t)=>e?setImmediate:t?((n,r)=>(di.addEventListener("message",({source:i,data:a})=>{i===di&&a===n&&r.length&&r.shift()()},!1),i=>{r.push(i),di.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",kn(di.postMessage)),o6=typeof queueMicrotask<"u"?queueMicrotask.bind(di):typeof process<"u"&&process.nextTick||Nx,Y={isArray:Ia,isArrayBuffer:Rx,isBuffer:CM,isFormData:AM,isArrayBufferView:TM,isString:kM,isNumber:Ax,isBoolean:SM,isObject:Hl,isPlainObject:Cc,isReadableStream:PM,isRequest:IM,isResponse:DM,isHeaders:NM,isUndefined:Wo,isDate:OM,isFile:EM,isBlob:MM,isRegExp:KM,isFunction:kn,isStream:RM,isURLSearchParams:jM,isTypedArray:VM,isFileList:$M,forEach:Os,merge:jf,extend:LM,trim:FM,stripBOM:BM,inherits:WM,toFlatObject:UM,kindOf:Ul,kindOfTest:qn,endsWith:zM,toArray:HM,forEachEntry:qM,matchAll:YM,isHTMLForm:GM,hasOwnProperty:i0,hasOwnProp:i0,reduceDescriptors:Ix,freezeMethods:XM,toObjectSet:QM,toCamelCase:ZM,noop:JM,toFiniteNumber:e6,findKey:jx,global:di,isContextDefined:Px,ALPHABET:Dx,generateString:t6,isSpecCompliantForm:n6,toJSONObject:r6,isAsyncFn:i6,isThenable:a6,setImmediate:Nx,asap:o6};function Fe(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}Y.inherits(Fe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Y.toJSONObject(this.config),code:this.code,status:this.status}}});const Fx=Fe.prototype,Lx={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Lx[e]={value:e}});Object.defineProperties(Fe,Lx);Object.defineProperty(Fx,"isAxiosError",{value:!0});Fe.from=(e,t,n,r,i,a)=>{const o=Object.create(Fx);return Y.toFlatObject(e,o,function(c){return c!==Error.prototype},s=>s!=="isAxiosError"),Fe.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const s6=null;function Pf(e){return Y.isPlainObject(e)||Y.isArray(e)}function Bx(e){return Y.endsWith(e,"[]")?e.slice(0,-2):e}function o0(e,t,n){return e?e.concat(t).map(function(i,a){return i=Bx(i),!n&&a?"["+i+"]":i}).join(n?".":""):t}function c6(e){return Y.isArray(e)&&!e.some(Pf)}const l6=Y.toFlatObject(Y,{},null,function(t){return/^is[A-Z]/.test(t)});function Vl(e,t,n){if(!Y.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Y.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,v){return!Y.isUndefined(v[p])});const r=n.metaTokens,i=n.visitor||u,a=n.dots,o=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&Y.isSpecCompliantForm(t);if(!Y.isFunction(i))throw new TypeError("visitor must be a function");function l(g){if(g===null)return"";if(Y.isDate(g))return g.toISOString();if(!c&&Y.isBlob(g))throw new Fe("Blob is not supported. Use a Buffer instead.");return Y.isArrayBuffer(g)||Y.isTypedArray(g)?c&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function u(g,p,v){let x=g;if(g&&!v&&typeof g=="object"){if(Y.endsWith(p,"{}"))p=r?p:p.slice(0,-2),g=JSON.stringify(g);else if(Y.isArray(g)&&c6(g)||(Y.isFileList(g)||Y.endsWith(p,"[]"))&&(x=Y.toArray(g)))return p=Bx(p),x.forEach(function(y,C){!(Y.isUndefined(y)||y===null)&&t.append(o===!0?o0([p],C,a):o===null?p:p+"[]",l(y))}),!1}return Pf(g)?!0:(t.append(o0(v,p,a),l(g)),!1)}const d=[],f=Object.assign(l6,{defaultVisitor:u,convertValue:l,isVisitable:Pf});function h(g,p){if(!Y.isUndefined(g)){if(d.indexOf(g)!==-1)throw Error("Circular reference detected in "+p.join("."));d.push(g),Y.forEach(g,function(x,_){(!(Y.isUndefined(x)||x===null)&&i.call(t,x,Y.isString(_)?_.trim():_,p,f))===!0&&h(x,p?p.concat(_):[_])}),d.pop()}}if(!Y.isObject(e))throw new TypeError("data must be an object");return h(e),t}function s0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function gp(e,t){this._pairs=[],e&&Vl(e,this,t)}const Wx=gp.prototype;Wx.append=function(t,n){this._pairs.push([t,n])};Wx.toString=function(t){const n=t?function(r){return t.call(this,r,s0)}:s0;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function u6(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ux(e,t,n){if(!t)return e;const r=n&&n.encode||u6,i=n&&n.serialize;let a;if(i?a=i(t,n):a=Y.isURLSearchParams(t)?t.toString():new gp(t,n).toString(r),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class c0{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Y.forEach(this.handlers,function(r){r!==null&&t(r)})}}const zx={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},d6=typeof URLSearchParams<"u"?URLSearchParams:gp,f6=typeof FormData<"u"?FormData:null,h6=typeof Blob<"u"?Blob:null,p6={isBrowser:!0,classes:{URLSearchParams:d6,FormData:f6,Blob:h6},protocols:["http","https","file","blob","url","data"]},vp=typeof window<"u"&&typeof document<"u",If=typeof navigator=="object"&&navigator||void 0,m6=vp&&(!If||["ReactNative","NativeScript","NS"].indexOf(If.product)<0),g6=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",v6=vp&&window.location.href||"http://localhost",b6=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:vp,hasStandardBrowserEnv:m6,hasStandardBrowserWebWorkerEnv:g6,navigator:If,origin:v6},Symbol.toStringTag,{value:"Module"})),_n={...b6,...p6};function y6(e,t){return Vl(e,new _n.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,a){return _n.isNode&&Y.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function x6(e){return Y.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function _6(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function Hx(e){function t(n,r,i,a){let o=n[a++];if(o==="__proto__")return!0;const s=Number.isFinite(+o),c=a>=n.length;return o=!o&&Y.isArray(i)?i.length:o,c?(Y.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!s):((!i[o]||!Y.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],a)&&Y.isArray(i[o])&&(i[o]=_6(i[o])),!s)}if(Y.isFormData(e)&&Y.isFunction(e.entries)){const n={};return Y.forEachEntry(e,(r,i)=>{t(x6(r),i,n,0)}),n}return null}function w6(e,t,n){if(Y.isString(e))try{return(t||JSON.parse)(e),Y.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Es={transitional:zx,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,a=Y.isObject(t);if(a&&Y.isHTMLForm(t)&&(t=new FormData(t)),Y.isFormData(t))return i?JSON.stringify(Hx(t)):t;if(Y.isArrayBuffer(t)||Y.isBuffer(t)||Y.isStream(t)||Y.isFile(t)||Y.isBlob(t)||Y.isReadableStream(t))return t;if(Y.isArrayBufferView(t))return t.buffer;if(Y.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return y6(t,this.formSerializer).toString();if((s=Y.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Vl(s?{"files[]":t}:t,c&&new c,this.formSerializer)}}return a||i?(n.setContentType("application/json",!1),w6(t)):t}],transformResponse:[function(t){const n=this.transitional||Es.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(Y.isResponse(t)||Y.isReadableStream(t))return t;if(t&&Y.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(s){if(o)throw s.name==="SyntaxError"?Fe.from(s,Fe.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_n.classes.FormData,Blob:_n.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Y.forEach(["delete","get","head","post","put","patch"],e=>{Es.headers[e]={}});const C6=Y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),T6=e=>{const t={};let n,r,i;return e&&e.split(`
|
|
230
|
+
`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&C6[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},l0=Symbol("internals");function ao(e){return e&&String(e).trim().toLowerCase()}function Tc(e){return e===!1||e==null?e:Y.isArray(e)?e.map(Tc):String(e)}function k6(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const S6=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Md(e,t,n,r,i){if(Y.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!Y.isString(t)){if(Y.isString(r))return t.indexOf(r)!==-1;if(Y.isRegExp(r))return r.test(t)}}function O6(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function E6(e,t){const n=Y.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,a,o){return this[r].call(this,t,i,a,o)},configurable:!0})})}class wn{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function a(s,c,l){const u=ao(c);if(!u)throw new Error("header name must be a non-empty string");const d=Y.findKey(i,u);(!d||i[d]===void 0||l===!0||l===void 0&&i[d]!==!1)&&(i[d||c]=Tc(s))}const o=(s,c)=>Y.forEach(s,(l,u)=>a(l,u,c));if(Y.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(Y.isString(t)&&(t=t.trim())&&!S6(t))o(T6(t),n);else if(Y.isHeaders(t))for(const[s,c]of t.entries())a(c,s,r);else t!=null&&a(n,t,r);return this}get(t,n){if(t=ao(t),t){const r=Y.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return k6(i);if(Y.isFunction(n))return n.call(this,i,r);if(Y.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ao(t),t){const r=Y.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Md(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function a(o){if(o=ao(o),o){const s=Y.findKey(r,o);s&&(!n||Md(r,r[s],s,n))&&(delete r[s],i=!0)}}return Y.isArray(t)?t.forEach(a):a(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const a=n[r];(!t||Md(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){const n=this,r={};return Y.forEach(this,(i,a)=>{const o=Y.findKey(r,a);if(o){n[o]=Tc(i),delete n[a];return}const s=t?O6(a):String(a).trim();s!==a&&delete n[a],n[s]=Tc(i),r[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Y.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&Y.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
231
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[l0]=this[l0]={accessors:{}}).accessors,i=this.prototype;function a(o){const s=ao(o);r[s]||(E6(i,o),r[s]=!0)}return Y.isArray(t)?t.forEach(a):a(t),this}}wn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Y.reduceDescriptors(wn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});Y.freezeMethods(wn);function $d(e,t){const n=this||Es,r=t||n,i=wn.from(r.headers);let a=r.data;return Y.forEach(e,function(s){a=s.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Vx(e){return!!(e&&e.__CANCEL__)}function Da(e,t,n){Fe.call(this,e??"canceled",Fe.ERR_CANCELED,t,n),this.name="CanceledError"}Y.inherits(Da,Fe,{__CANCEL__:!0});function qx(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Fe("Request failed with status code "+n.status,[Fe.ERR_BAD_REQUEST,Fe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function M6(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function $6(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,a=0,o;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=r[a];o||(o=l),n[i]=c,r[i]=l;let d=a,f=0;for(;d!==i;)f+=n[d++],d=d%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),l-o<t)return;const h=u&&l-u;return h?Math.round(f*1e3/h):void 0}}function R6(e,t){let n=0,r=1e3/t,i,a;const o=(l,u=Date.now())=>{n=u,i=null,a&&(clearTimeout(a),a=null),e.apply(null,l)};return[(...l)=>{const u=Date.now(),d=u-n;d>=r?o(l,u):(i=l,a||(a=setTimeout(()=>{a=null,o(i)},r-d)))},()=>i&&o(i)]}const Vc=(e,t,n=3)=>{let r=0;const i=$6(50,250);return R6(a=>{const o=a.loaded,s=a.lengthComputable?a.total:void 0,c=o-r,l=i(c),u=o<=s;r=o;const d={loaded:o,total:s,progress:s?o/s:void 0,bytes:c,rate:l||void 0,estimated:l&&s&&u?(s-o)/l:void 0,event:a,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(d)},n)},u0=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},d0=e=>(...t)=>Y.asap(()=>e(...t)),A6=_n.hasStandardBrowserEnv?function(){const t=_n.navigator&&/(msie|trident)/i.test(_n.navigator.userAgent),n=document.createElement("a");let r;function i(a){let o=a;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(o){const s=Y.isString(o)?i(o):o;return s.protocol===r.protocol&&s.host===r.host}}():function(){return function(){return!0}}(),j6=_n.hasStandardBrowserEnv?{write(e,t,n,r,i,a){const o=[e+"="+encodeURIComponent(t)];Y.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),Y.isString(r)&&o.push("path="+r),Y.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function P6(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function I6(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Yx(e,t){return e&&!P6(t)?I6(e,t):t}const f0=e=>e instanceof wn?{...e}:e;function Si(e,t){t=t||{};const n={};function r(l,u,d){return Y.isPlainObject(l)&&Y.isPlainObject(u)?Y.merge.call({caseless:d},l,u):Y.isPlainObject(u)?Y.merge({},u):Y.isArray(u)?u.slice():u}function i(l,u,d){if(Y.isUndefined(u)){if(!Y.isUndefined(l))return r(void 0,l,d)}else return r(l,u,d)}function a(l,u){if(!Y.isUndefined(u))return r(void 0,u)}function o(l,u){if(Y.isUndefined(u)){if(!Y.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function s(l,u,d){if(d in t)return r(l,u);if(d in e)return r(void 0,l)}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(l,u)=>i(f0(l),f0(u),!0)};return Y.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=c[u]||i,f=d(e[u],t[u],u);Y.isUndefined(f)&&d!==s||(n[u]=f)}),n}const Gx=e=>{const t=Si({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;t.headers=o=wn.from(o),t.url=Ux(Yx(t.baseURL,t.url),e.params,e.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let c;if(Y.isFormData(n)){if(_n.hasStandardBrowserEnv||_n.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[l,...u]=c?c.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...u].join("; "))}}if(_n.hasStandardBrowserEnv&&(r&&Y.isFunction(r)&&(r=r(t)),r||r!==!1&&A6(t.url))){const l=i&&a&&j6.read(a);l&&o.set(i,l)}return t},D6=typeof XMLHttpRequest<"u",N6=D6&&function(e){return new Promise(function(n,r){const i=Gx(e);let a=i.data;const o=wn.from(i.headers).normalize();let{responseType:s,onUploadProgress:c,onDownloadProgress:l}=i,u,d,f,h,g;function p(){h&&h(),g&&g(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(i.method.toUpperCase(),i.url,!0),v.timeout=i.timeout;function x(){if(!v)return;const y=wn.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),w={data:!s||s==="text"||s==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:y,config:e,request:v};qx(function($){n($),p()},function($){r($),p()},w),v=null}"onloadend"in v?v.onloadend=x:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(x)},v.onabort=function(){v&&(r(new Fe("Request aborted",Fe.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new Fe("Network Error",Fe.ERR_NETWORK,e,v)),v=null},v.ontimeout=function(){let C=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||zx;i.timeoutErrorMessage&&(C=i.timeoutErrorMessage),r(new Fe(C,w.clarifyTimeoutError?Fe.ETIMEDOUT:Fe.ECONNABORTED,e,v)),v=null},a===void 0&&o.setContentType(null),"setRequestHeader"in v&&Y.forEach(o.toJSON(),function(C,w){v.setRequestHeader(w,C)}),Y.isUndefined(i.withCredentials)||(v.withCredentials=!!i.withCredentials),s&&s!=="json"&&(v.responseType=i.responseType),l&&([f,g]=Vc(l,!0),v.addEventListener("progress",f)),c&&v.upload&&([d,h]=Vc(c),v.upload.addEventListener("progress",d),v.upload.addEventListener("loadend",h)),(i.cancelToken||i.signal)&&(u=y=>{v&&(r(!y||y.type?new Da(null,e,v):y),v.abort(),v=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const _=M6(i.url);if(_&&_n.protocols.indexOf(_)===-1){r(new Fe("Unsupported protocol "+_+":",Fe.ERR_BAD_REQUEST,e));return}v.send(a||null)})},F6=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const a=function(l){if(!i){i=!0,s();const u=l instanceof Error?l:this.reason;r.abort(u instanceof Fe?u:new Da(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,a(new Fe(`timeout ${t} of ms exceeded`,Fe.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(a):l.removeEventListener("abort",a)}),e=null)};e.forEach(l=>l.addEventListener("abort",a));const{signal:c}=r;return c.unsubscribe=()=>Y.asap(s),c}},L6=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},B6=async function*(e,t){for await(const n of W6(e))yield*L6(n,t)},W6=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},h0=(e,t,n,r)=>{const i=B6(e,t);let a=0,o,s=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:l,value:u}=await i.next();if(l){s(),c.close();return}let d=u.byteLength;if(n){let f=a+=d;n(f)}c.enqueue(new Uint8Array(u))}catch(l){throw s(l),l}},cancel(c){return s(c),i.return()}},{highWaterMark:2})},ql=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Zx=ql&&typeof ReadableStream=="function",U6=ql&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Kx=(e,...t)=>{try{return!!e(...t)}catch{return!1}},z6=Zx&&Kx(()=>{let e=!1;const t=new Request(_n.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),p0=64*1024,Df=Zx&&Kx(()=>Y.isReadableStream(new Response("").body)),qc={stream:Df&&(e=>e.body)};ql&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!qc[t]&&(qc[t]=Y.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Fe(`Response type '${t}' is not supported`,Fe.ERR_NOT_SUPPORT,r)})})})(new Response);const H6=async e=>{if(e==null)return 0;if(Y.isBlob(e))return e.size;if(Y.isSpecCompliantForm(e))return(await new Request(_n.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Y.isArrayBufferView(e)||Y.isArrayBuffer(e))return e.byteLength;if(Y.isURLSearchParams(e)&&(e=e+""),Y.isString(e))return(await U6(e)).byteLength},V6=async(e,t)=>{const n=Y.toFiniteNumber(e.getContentLength());return n??H6(t)},q6=ql&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:a,timeout:o,onDownloadProgress:s,onUploadProgress:c,responseType:l,headers:u,withCredentials:d="same-origin",fetchOptions:f}=Gx(e);l=l?(l+"").toLowerCase():"text";let h=F6([i,a&&a.toAbortSignal()],o),g;const p=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let v;try{if(c&&z6&&n!=="get"&&n!=="head"&&(v=await V6(u,r))!==0){let w=new Request(t,{method:"POST",body:r,duplex:"half"}),T;if(Y.isFormData(r)&&(T=w.headers.get("content-type"))&&u.setContentType(T),w.body){const[$,R]=u0(v,Vc(d0(c)));r=h0(w.body,p0,$,R)}}Y.isString(d)||(d=d?"include":"omit");const x="credentials"in Request.prototype;g=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:x?d:void 0});let _=await fetch(g);const y=Df&&(l==="stream"||l==="response");if(Df&&(s||y&&p)){const w={};["status","statusText","headers"].forEach(S=>{w[S]=_[S]});const T=Y.toFiniteNumber(_.headers.get("content-length")),[$,R]=s&&u0(T,Vc(d0(s),!0))||[];_=new Response(h0(_.body,p0,$,()=>{R&&R(),p&&p()}),w)}l=l||"text";let C=await qc[Y.findKey(qc,l)||"text"](_,e);return!y&&p&&p(),await new Promise((w,T)=>{qx(w,T,{data:C,headers:wn.from(_.headers),status:_.status,statusText:_.statusText,config:e,request:g})})}catch(x){throw p&&p(),x&&x.name==="TypeError"&&/fetch/i.test(x.message)?Object.assign(new Fe("Network Error",Fe.ERR_NETWORK,e,g),{cause:x.cause||x}):Fe.from(x,x&&x.code,e,g)}}),Nf={http:s6,xhr:N6,fetch:q6};Y.forEach(Nf,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const m0=e=>`- ${e}`,Y6=e=>Y.isFunction(e)||e===null||e===!1,Xx={getAdapter:e=>{e=Y.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let a=0;a<t;a++){n=e[a];let o;if(r=n,!Y6(n)&&(r=Nf[(o=String(n)).toLowerCase()],r===void 0))throw new Fe(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+a]=r}if(!r){const a=Object.entries(i).map(([s,c])=>`adapter ${s} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since :
|
|
232
232
|
`+a.map(m0).join(`
|
|
233
|
-
`):" "+m0(a[0]):"as no adapter specified";throw new Fe("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:Nf};function Rd(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Da(null,e)}function g0(e){return Rd(e),e.headers=wn.from(e.headers),e.data=$d.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xx.getAdapter(e.adapter||Es.adapter)(e).then(function(r){return Rd(e),r.data=$d.call(e,e.transformResponse,r),r.headers=wn.from(r.headers),r},function(r){return Vx(r)||(Rd(e),r&&r.response&&(r.response.data=$d.call(e,e.transformResponse,r.response),r.response.headers=wn.from(r.response.headers))),Promise.reject(r)})}const Qx="1.7.7",bp={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{bp[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const v0={};bp.transitional=function(t,n,r){function i(a,o){return"[Axios v"+Qx+"] Transitional option '"+a+"'"+o+(r?". "+r:"")}return(a,o,s)=>{if(t===!1)throw new Fe(i(o," has been removed"+(n?" in "+n:"")),Fe.ERR_DEPRECATED);return n&&!v0[o]&&(v0[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,o,s):!0}};function
|
|
234
|
-
`+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Si(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:a}=n;r!==void 0&&Ff.assertOptions(r,{silentJSONParsing:$r.transitional($r.boolean),forcedJSONParsing:$r.transitional($r.boolean),clarifyTimeoutError:$r.transitional($r.boolean)},!1),i!=null&&(Y.isFunction(i)?n.paramsSerializer={serialize:i}:Ff.assertOptions(i,{encode:$r.function,serialize:$r.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&Y.merge(a.common,a[n.method]);a&&Y.forEach(["delete","get","head","post","put","patch","common"],g=>{delete a[g]}),n.headers=wn.concat(o,a);const s=[];let c=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(n)===!1||(c=c&&p.synchronous,s.unshift(p.fulfilled,p.rejected))});const l=[];this.interceptors.response.forEach(function(p){l.push(p.fulfilled,p.rejected)});let u,d=0,f;if(!c){const g=[g0.bind(this),void 0];for(g.unshift.apply(g,s),g.push.apply(g,l),f=g.length,u=Promise.resolve(n);d<f;)u=u.then(g[d++],g[d++]);return u}f=s.length;let h=n;for(d=0;d<f;){const g=s[d++],p=s[d++];try{h=g(h)}catch(v){p.call(this,v);break}}try{u=g0.call(this,h)}catch(g){return Promise.reject(g)}for(d=0,f=l.length;d<f;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=Si(this.defaults,t);const n=Yx(t.baseURL,t.url);return Ux(n,t.params,t.paramsSerializer)}}Y.forEach(["delete","get","head","options"],function(t){yi.prototype[t]=function(n,r){return this.request(Si(r||{},{method:t,url:n,data:(r||{}).data}))}});Y.forEach(["post","put","patch"],function(t){function n(r){return function(a,o,s){return this.request(Si(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}yi.prototype[t]=n(),yi.prototype[t+"Form"]=n(!0)});class yp{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(i=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](i);r._listeners=null}),this.promise.then=i=>{let a;const o=new Promise(s=>{r.subscribe(s),a=s}).then(i);return o.cancel=function(){r.unsubscribe(a)},o},t(function(a,o,s){r.reason||(r.reason=new Da(a,o,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new yp(function(i){t=i}),cancel:t}}}function
|
|
233
|
+
`):" "+m0(a[0]):"as no adapter specified";throw new Fe("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:Nf};function Rd(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Da(null,e)}function g0(e){return Rd(e),e.headers=wn.from(e.headers),e.data=$d.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xx.getAdapter(e.adapter||Es.adapter)(e).then(function(r){return Rd(e),r.data=$d.call(e,e.transformResponse,r),r.headers=wn.from(r.headers),r},function(r){return Vx(r)||(Rd(e),r&&r.response&&(r.response.data=$d.call(e,e.transformResponse,r.response),r.response.headers=wn.from(r.response.headers))),Promise.reject(r)})}const Qx="1.7.7",bp={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{bp[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const v0={};bp.transitional=function(t,n,r){function i(a,o){return"[Axios v"+Qx+"] Transitional option '"+a+"'"+o+(r?". "+r:"")}return(a,o,s)=>{if(t===!1)throw new Fe(i(o," has been removed"+(n?" in "+n:"")),Fe.ERR_DEPRECATED);return n&&!v0[o]&&(v0[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,o,s):!0}};function G6(e,t,n){if(typeof e!="object")throw new Fe("options must be an object",Fe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],o=t[a];if(o){const s=e[a],c=s===void 0||o(s,a,e);if(c!==!0)throw new Fe("option "+a+" must be "+c,Fe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Fe("Unknown option "+a,Fe.ERR_BAD_OPTION)}}const Ff={assertOptions:G6,validators:bp},$r=Ff.validators;class yi{constructor(t){this.defaults=t,this.interceptors={request:new c0,response:new c0}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
234
|
+
`+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Si(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:a}=n;r!==void 0&&Ff.assertOptions(r,{silentJSONParsing:$r.transitional($r.boolean),forcedJSONParsing:$r.transitional($r.boolean),clarifyTimeoutError:$r.transitional($r.boolean)},!1),i!=null&&(Y.isFunction(i)?n.paramsSerializer={serialize:i}:Ff.assertOptions(i,{encode:$r.function,serialize:$r.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&Y.merge(a.common,a[n.method]);a&&Y.forEach(["delete","get","head","post","put","patch","common"],g=>{delete a[g]}),n.headers=wn.concat(o,a);const s=[];let c=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(n)===!1||(c=c&&p.synchronous,s.unshift(p.fulfilled,p.rejected))});const l=[];this.interceptors.response.forEach(function(p){l.push(p.fulfilled,p.rejected)});let u,d=0,f;if(!c){const g=[g0.bind(this),void 0];for(g.unshift.apply(g,s),g.push.apply(g,l),f=g.length,u=Promise.resolve(n);d<f;)u=u.then(g[d++],g[d++]);return u}f=s.length;let h=n;for(d=0;d<f;){const g=s[d++],p=s[d++];try{h=g(h)}catch(v){p.call(this,v);break}}try{u=g0.call(this,h)}catch(g){return Promise.reject(g)}for(d=0,f=l.length;d<f;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=Si(this.defaults,t);const n=Yx(t.baseURL,t.url);return Ux(n,t.params,t.paramsSerializer)}}Y.forEach(["delete","get","head","options"],function(t){yi.prototype[t]=function(n,r){return this.request(Si(r||{},{method:t,url:n,data:(r||{}).data}))}});Y.forEach(["post","put","patch"],function(t){function n(r){return function(a,o,s){return this.request(Si(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}yi.prototype[t]=n(),yi.prototype[t+"Form"]=n(!0)});class yp{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(i=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](i);r._listeners=null}),this.promise.then=i=>{let a;const o=new Promise(s=>{r.subscribe(s),a=s}).then(i);return o.cancel=function(){r.unsubscribe(a)},o},t(function(a,o,s){r.reason||(r.reason=new Da(a,o,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new yp(function(i){t=i}),cancel:t}}}function Z6(e){return function(n){return e.apply(null,n)}}function K6(e){return Y.isObject(e)&&e.isAxiosError===!0}const Lf={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Lf).forEach(([e,t])=>{Lf[t]=e});function Jx(e){const t=new yi(e),n=$x(yi.prototype.request,t);return Y.extend(n,yi.prototype,t,{allOwnKeys:!0}),Y.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Jx(Si(e,i))},n}const $t=Jx(Es);$t.Axios=yi;$t.CanceledError=Da;$t.CancelToken=yp;$t.isCancel=Vx;$t.VERSION=Qx;$t.toFormData=Vl;$t.AxiosError=Fe;$t.Cancel=$t.CanceledError;$t.all=function(t){return Promise.all(t)};$t.spread=Z6;$t.isAxiosError=K6;$t.mergeConfig=Si;$t.AxiosHeaders=wn;$t.formToJSON=e=>Hx(Y.isHTMLForm(e)?new FormData(e):e);$t.getAdapter=Xx.getAdapter;$t.HttpStatusCode=Lf;$t.default=$t;var Js={};/*!
|
|
235
235
|
* cookie
|
|
236
236
|
* Copyright(c) 2012-2014 Roman Shtylman
|
|
237
237
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
238
238
|
* MIT Licensed
|
|
239
|
-
*/var b0;function
|
|
239
|
+
*/var b0;function X6(){if(b0)return Js;b0=1,Js.parse=o,Js.serialize=l;var e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,n=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,r=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,i=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,a=/^[\u0020-\u003A\u003D-\u007E]*$/;function o(h,g){if(typeof h!="string")throw new TypeError("argument str must be a string");var p={},v=h.length;if(v<2)return p;var x=g&&g.decode||u,_=0,y=0,C=0;do{if(y=h.indexOf("=",_),y===-1)break;if(C=h.indexOf(";",_),C===-1)C=v;else if(y>C){_=h.lastIndexOf(";",y-1)+1;continue}var w=s(h,_,y),T=c(h,y,w),$=h.slice(w,T);if(!t.call(p,$)){var R=s(h,y+1,C),S=c(h,C,R);h.charCodeAt(R)===34&&h.charCodeAt(S-1)===34&&(R++,S--);var k=h.slice(R,S);p[$]=f(k,x)}_=C+1}while(_<v);return p}function s(h,g,p){do{var v=h.charCodeAt(g);if(v!==32&&v!==9)return g}while(++g<p);return p}function c(h,g,p){for(;g>p;){var v=h.charCodeAt(--g);if(v!==32&&v!==9)return g+1}return p}function l(h,g,p){var v=p&&p.encode||encodeURIComponent;if(typeof v!="function")throw new TypeError("option encode is invalid");if(!n.test(h))throw new TypeError("argument name is invalid");var x=v(g);if(!r.test(x))throw new TypeError("argument val is invalid");var _=h+"="+x;if(!p)return _;if(p.maxAge!=null){var y=Math.floor(p.maxAge);if(!isFinite(y))throw new TypeError("option maxAge is invalid");_+="; Max-Age="+y}if(p.domain){if(!i.test(p.domain))throw new TypeError("option domain is invalid");_+="; Domain="+p.domain}if(p.path){if(!a.test(p.path))throw new TypeError("option path is invalid");_+="; Path="+p.path}if(p.expires){var C=p.expires;if(!d(C)||isNaN(C.valueOf()))throw new TypeError("option expires is invalid");_+="; Expires="+C.toUTCString()}if(p.httpOnly&&(_+="; HttpOnly"),p.secure&&(_+="; Secure"),p.partitioned&&(_+="; Partitioned"),p.priority){var w=typeof p.priority=="string"?p.priority.toLowerCase():p.priority;switch(w){case"low":_+="; Priority=Low";break;case"medium":_+="; Priority=Medium";break;case"high":_+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(p.sameSite){var T=typeof p.sameSite=="string"?p.sameSite.toLowerCase():p.sameSite;switch(T){case!0:_+="; SameSite=Strict";break;case"lax":_+="; SameSite=Lax";break;case"strict":_+="; SameSite=Strict";break;case"none":_+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return _}function u(h){return h.indexOf("%")!==-1?decodeURIComponent(h):h}function d(h){return e.call(h)==="[object Date]"}function f(h,g){try{return g(h)}catch{return h}}return Js}var kc=X6();function Q6(){const e=typeof global>"u"?void 0:global.TEST_HAS_DOCUMENT_COOKIE;return typeof e=="boolean"?e:typeof document=="object"&&typeof document.cookie=="string"}function J6(e){return typeof e=="string"?kc.parse(e):typeof e=="object"&&e!==null?e:{}}function Ad(e,t={}){const n=e$(e);if(!t.doNotParse)try{return JSON.parse(n)}catch{}return e}function e$(e){return e&&e[0]==="j"&&e[1]===":"?e.substr(2):e}class t${constructor(t,n={}){this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.update=()=>{if(!this.HAS_DOCUMENT_COOKIE)return;const i=this.cookies;this.cookies=kc.parse(document.cookie),this._checkChanges(i)};const r=typeof document>"u"?"":document.cookie;this.cookies=J6(t||r),this.defaultSetOptions=n,this.HAS_DOCUMENT_COOKIE=Q6()}_emitChange(t){for(let n=0;n<this.changeListeners.length;++n)this.changeListeners[n](t)}_checkChanges(t){new Set(Object.keys(t).concat(Object.keys(this.cookies))).forEach(r=>{t[r]!==this.cookies[r]&&this._emitChange({name:r,value:Ad(this.cookies[r])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(t,n={}){return n.doNotUpdate||this.update(),Ad(this.cookies[t],n)}getAll(t={}){t.doNotUpdate||this.update();const n={};for(let r in this.cookies)n[r]=Ad(this.cookies[r],t);return n}set(t,n,r){r?r=Object.assign(Object.assign({},this.defaultSetOptions),r):r=this.defaultSetOptions;const i=typeof n=="string"?n:JSON.stringify(n);this.cookies=Object.assign(Object.assign({},this.cookies),{[t]:i}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=kc.serialize(t,i,r)),this._emitChange({name:t,value:n,options:r})}remove(t,n){const r=n=Object.assign(Object.assign(Object.assign({},this.defaultSetOptions),n),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[t],this.HAS_DOCUMENT_COOKIE&&(document.cookie=kc.serialize(t,"",r)),this._emitChange({name:t,value:void 0,options:n})}addChangeListener(t){this.changeListeners.push(t),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===1&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(t){const n=this.changeListeners.indexOf(t);n>=0&&this.changeListeners.splice(n,1),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===0&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}}const n$=ie.createContext(new t$);var ec={exports:{}},lt={};/** @license React v16.13.1
|
|
240
240
|
* react-is.production.min.js
|
|
241
241
|
*
|
|
242
242
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -276,4 +276,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
276
276
|
L`+r+" "+r+`
|
|
277
277
|
L0 `+r+`
|
|
278
278
|
L`+r/2+` 0
|
|
279
|
-
`,fill:i,opacity:o,strokeWidth:c,stroke:l===void 0?"transparent":l,style:{pointerEvents:"none"}})})};function gi(){return gi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gi.apply(this,arguments)}var Oq={top:0,right:0,bottom:0,left:0},Qm=function(e){var t,n=e.direction,r=e.itemsSpacing,i=e.padding,a=e.itemCount,o=e.itemWidth,s=e.itemHeight;if(typeof i!="number"&&(typeof(t=i)!="object"||Array.isArray(t)||t===null))throw new Error("Invalid property padding, must be one of: number, object");var c=typeof i=="number"?{top:i,right:i,bottom:i,left:i}:gi({},Oq,i),l=c.left+c.right,u=c.top+c.bottom,d=o+l,f=s+u,h=(a-1)*r;return n==="row"?d=o*a+h+l:n==="column"&&(f=s*a+h+u),{width:d,height:f,padding:c}},VC=function(e){var t=e.anchor,n=e.translateX,r=e.translateY,i=e.containerWidth,a=e.containerHeight,o=e.width,s=e.height,c=n,l=r;switch(t){case"top":c+=(i-o)/2;break;case"top-right":c+=i-o;break;case"right":c+=i-o,l+=(a-s)/2;break;case"bottom-right":c+=i-o,l+=a-s;break;case"bottom":c+=(i-o)/2,l+=a-s;break;case"bottom-left":l+=a-s;break;case"left":l+=(a-s)/2;break;case"center":c+=(i-o)/2,l+=(a-s)/2}return{x:c,y:l}},qC=function(e){var t,n,r,i,a,o,s=e.direction,c=e.justify,l=e.symbolSize,u=e.symbolSpacing,d=e.width,f=e.height;switch(s){case"left-to-right":t=0,n=(f-l)/2,i=f/2,o="central",c?(r=d,a="end"):(r=l+u,a="start");break;case"right-to-left":t=d-l,n=(f-l)/2,i=f/2,o="central",c?(r=0,a="start"):(r=d-l-u,a="end");break;case"top-to-bottom":t=(d-l)/2,n=0,r=d/2,a="middle",c?(i=f,o="alphabetic"):(i=l+u,o="text-before-edge");break;case"bottom-to-top":t=(d-l)/2,n=f-l,r=d/2,a="middle",c?(i=0,o="text-before-edge"):(i=f-l-u,o="alphabetic")}return{symbolX:t,symbolY:n,labelX:r,labelY:i,labelAnchor:a,labelAlignment:o}},Eq={circle:Cq,diamond:Tq,square:kq,triangle:Sq},Mq=function(e){var t,n,r,i,a,o,s,c,l,u,d,f=e.x,h=e.y,g=e.width,p=e.height,v=e.data,x=e.direction,_=x===void 0?"left-to-right":x,y=e.justify,C=y!==void 0&&y,w=e.textColor,T=e.background,$=T===void 0?"transparent":T,R=e.opacity,S=R===void 0?1:R,k=e.symbolShape,O=k===void 0?"square":k,D=e.symbolSize,E=D===void 0?16:D,M=e.symbolSpacing,j=M===void 0?8:M,F=e.symbolBorderWidth,W=F===void 0?0:F,B=e.symbolBorderColor,U=B===void 0?"transparent":B,N=e.onClick,V=e.onMouseEnter,X=e.onMouseLeave,ne=e.toggleSerie,K=e.effects,J=m.useState({}),q=J[0],G=J[1],z=ht(),L=m.useCallback(function(Be){if(K){var Ke=K.filter(function(Ye){return Ye.on==="hover"}).reduce(function(Ye,de){return gi({},Ye,de.style)},{});G(Ke)}V==null||V(v,Be)},[V,v,K]),H=m.useCallback(function(Be){if(K){var Ke=K.filter(function(Ye){return Ye.on!=="hover"}).reduce(function(Ye,de){return gi({},Ye,de.style)},{});G(Ke)}X==null||X(v,Be)},[X,v,K]),ee=qC({direction:_,justify:C,symbolSize:(t=q.symbolSize)!=null?t:E,symbolSpacing:j,width:g,height:p}),A=ee.symbolX,se=ee.symbolY,ce=ee.labelX,ue=ee.labelY,we=ee.labelAnchor,Te=ee.labelAlignment,at=[N,V,X,ne].some(function(Be){return Be!==void 0}),tt=typeof O=="function"?O:Eq[O];return b.jsxs("g",{transform:"translate("+f+","+h+")",style:{opacity:(n=q.itemOpacity)!=null?n:S},children:[b.jsx("rect",{width:g,height:p,fill:(r=q.itemBackground)!=null?r:$,style:{cursor:at?"pointer":"auto"},onClick:function(Be){N==null||N(v,Be),ne==null||ne(v.id)},onMouseEnter:L,onMouseLeave:H}),ie.createElement(tt,gi({id:v.id,x:A,y:se,size:(i=q.symbolSize)!=null?i:E,fill:(a=(o=v.fill)!=null?o:v.color)!=null?a:"black",borderWidth:(s=q.symbolBorderWidth)!=null?s:W,borderColor:(c=q.symbolBorderColor)!=null?c:U},v.hidden?z.legends.hidden.symbol:void 0)),b.jsx("text",{textAnchor:we,style:gi({},Zm(z.legends.text),{fill:(l=(u=(d=q.itemTextColor)!=null?d:w)!=null?u:z.legends.text.fill)!=null?l:"black",dominantBaseline:Te,pointerEvents:"none",userSelect:"none"},v.hidden?z.legends.hidden.text:void 0),x:ce,y:ue,children:v.label})]})},$q=function(e){var t=e.data,n=e.x,r=e.y,i=e.direction,a=e.padding,o=a===void 0?0:a,s=e.justify,c=e.effects,l=e.itemWidth,u=e.itemHeight,d=e.itemDirection,f=d===void 0?"left-to-right":d,h=e.itemsSpacing,g=h===void 0?0:h,p=e.itemTextColor,v=e.itemBackground,x=v===void 0?"transparent":v,_=e.itemOpacity,y=_===void 0?1:_,C=e.symbolShape,w=e.symbolSize,T=e.symbolSpacing,$=e.symbolBorderWidth,R=e.symbolBorderColor,S=e.onClick,k=e.onMouseEnter,O=e.onMouseLeave,D=e.toggleSerie,E=Qm({itemCount:t.length,itemWidth:l,itemHeight:u,itemsSpacing:g,direction:i,padding:o}).padding,M=i==="row"?l+g:0,j=i==="column"?u+g:0;return b.jsx("g",{transform:"translate("+n+","+r+")",children:t.map(function(F,W){return b.jsx(Mq,{data:F,x:W*M+E.left,y:W*j+E.top,width:l,height:u,direction:f,justify:s,effects:c,textColor:p,background:x,opacity:y,symbolShape:C,symbolSize:w,symbolSpacing:T,symbolBorderWidth:$,symbolBorderColor:R,onClick:S,onMouseEnter:k,onMouseLeave:O,toggleSerie:D},W)})})},Jm=function(e){var t=e.data,n=e.containerWidth,r=e.containerHeight,i=e.translateX,a=i===void 0?0:i,o=e.translateY,s=o===void 0?0:o,c=e.anchor,l=e.direction,u=e.padding,d=u===void 0?0:u,f=e.justify,h=e.itemsSpacing,g=h===void 0?0:h,p=e.itemWidth,v=e.itemHeight,x=e.itemDirection,_=e.itemTextColor,y=e.itemBackground,C=e.itemOpacity,w=e.symbolShape,T=e.symbolSize,$=e.symbolSpacing,R=e.symbolBorderWidth,S=e.symbolBorderColor,k=e.onClick,O=e.onMouseEnter,D=e.onMouseLeave,E=e.toggleSerie,M=e.effects,j=Qm({itemCount:t.length,itemsSpacing:g,itemWidth:p,itemHeight:v,direction:l,padding:d}),F=j.width,W=j.height,B=VC({anchor:c,translateX:a,translateY:s,containerWidth:n,containerHeight:r,width:F,height:W}),U=B.x,N=B.y;return b.jsx($q,{data:t,x:U,y:N,direction:l,padding:d,justify:f,effects:M,itemsSpacing:g,itemWidth:p,itemHeight:v,itemDirection:x,itemTextColor:_,itemBackground:y,itemOpacity:C,symbolShape:w,symbolSize:T,symbolSpacing:$,symbolBorderWidth:R,symbolBorderColor:S,onClick:k,onMouseEnter:O,onMouseLeave:D,toggleSerie:typeof E=="boolean"?void 0:E})},Rq={start:"left",middle:"center",end:"right"},YC=function(e,t){var n=t.data,r=t.containerWidth,i=t.containerHeight,a=t.translateX,o=a===void 0?0:a,s=t.translateY,c=s===void 0?0:s,l=t.anchor,u=t.direction,d=t.padding,f=d===void 0?0:d,h=t.justify,g=h!==void 0&&h,p=t.itemsSpacing,v=p===void 0?0:p,x=t.itemWidth,_=t.itemHeight,y=t.itemDirection,C=y===void 0?"left-to-right":y,w=t.itemTextColor,T=t.symbolSize,$=T===void 0?16:T,R=t.symbolSpacing,S=R===void 0?8:R,k=t.theme,O=Qm({itemCount:n.length,itemWidth:x,itemHeight:_,itemsSpacing:v,direction:u,padding:f}),D=O.width,E=O.height,M=O.padding,j=VC({anchor:l,translateX:o,translateY:c,containerWidth:r,containerHeight:i,width:D,height:E}),F=j.x,W=j.y,B=u==="row"?x+v:0,U=u==="column"?_+v:0;e.save(),e.translate(F,W),e.font=k.legends.text.fontSize+"px "+(k.legends.text.fontFamily||"sans-serif"),n.forEach(function(N,V){var X,ne,K=V*B+M.left,J=V*U+M.top,q=qC({direction:C,justify:g,symbolSize:$,symbolSpacing:S,width:x,height:_}),G=q.symbolX,z=q.symbolY,L=q.labelX,H=q.labelY,ee=q.labelAnchor,A=q.labelAlignment;e.fillStyle=(X=N.color)!=null?X:"black",e.fillRect(K+G,J+z,$,$),e.textAlign=Rq[ee],A==="central"&&(e.textBaseline="middle"),e.fillStyle=(ne=w??k.legends.text.fill)!=null?ne:"black",e.fillText(String(N.label),K+L,J+H)}),e.restore()};function Jr(){return Jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jr.apply(this,arguments)}function GC(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var Lb,Aq=function(e){var t=e.width,n=e.height,r=e.legends,i=e.data,a=e.toggleSerie;return b.jsx(b.Fragment,{children:r.map(function(o,s){var c;return b.jsx(Jm,Jr({},o,{containerWidth:t,containerHeight:n,data:(c=o.data)!=null?c:i,toggleSerie:o.toggleSerie?a:void 0}),s)})})},Se={id:"id",value:"value",sortByValue:!1,innerRadius:0,padAngle:0,cornerRadius:0,layers:["arcs","arcLinkLabels","arcLabels","legends"],startAngle:0,endAngle:360,fit:!0,activeInnerRadiusOffset:0,activeOuterRadiusOffset:0,borderWidth:0,borderColor:{from:"color",modifiers:[["darker",1]]},enableArcLabels:!0,arcLabel:"formattedValue",arcLabelsSkipAngle:0,arcLabelsRadiusOffset:.5,arcLabelsTextColor:{theme:"labels.text.fill"},enableArcLinkLabels:!0,arcLinkLabel:"id",arcLinkLabelsSkipAngle:0,arcLinkLabelsOffset:0,arcLinkLabelsDiagonalLength:16,arcLinkLabelsStraightLength:24,arcLinkLabelsThickness:1,arcLinkLabelsTextOffset:6,arcLinkLabelsTextColor:{theme:"labels.text.fill"},arcLinkLabelsColor:{theme:"axis.ticks.line.stroke"},colors:{scheme:"nivo"},defs:[],fill:[],isInteractive:!0,animate:!0,motionConfig:"gentle",transitionMode:"innerRadius",tooltip:function(e){var t=e.datum;return b.jsx(Zp,{id:t.id,value:t.formattedValue,enableChip:!0,color:t.color})},legends:[],role:"img",pixelRatio:typeof window<"u"&&(Lb=window.devicePixelRatio)!=null?Lb:1},jq=["points"],Pq=function(e){var t=e.data,n=e.id,r=n===void 0?Se.id:n,i=e.value,a=i===void 0?Se.value:i,o=e.valueFormat,s=e.colors,c=s===void 0?Se.colors:s,l=Ti(r),u=Ti(a),d=Ma(o),f=Xm(c,"id");return m.useMemo(function(){return t.map(function(h){var g,p=l(h),v=u(h),x={id:p,label:(g=h.label)!=null?g:p,hidden:!1,value:v,formattedValue:d(v),data:h};return Jr({},x,{color:f(x)})})},[t,l,u,d,f])},Iq=function(e){var t=e.data,n=e.startAngle,r=e.endAngle,i=e.innerRadius,a=e.outerRadius,o=e.padAngle,s=e.sortByValue,c=e.activeId,l=e.activeInnerRadiusOffset,u=e.activeOuterRadiusOffset,d=e.hiddenIds,f=e.forwardLegendData,h=m.useMemo(function(){var x=yU().value(function(_){return _.value}).startAngle(An(n)).endAngle(An(r)).padAngle(An(o));return s||x.sortValues(null),x},[n,r,o,s]),g=m.useMemo(function(){var x=t.filter(function(_){return!d.includes(_.id)});return{dataWithArc:h(x).map(function(_){var y=Math.abs(_.endAngle-_.startAngle);return Jr({},_.data,{arc:{index:_.index,startAngle:_.startAngle,endAngle:_.endAngle,innerRadius:c===_.data.id?i-l:i,outerRadius:c===_.data.id?a+u:a,thickness:a-i,padAngle:_.padAngle,angle:y,angleDeg:cd(y)}})}),legendData:t.map(function(_){return{id:_.id,label:_.label,color:_.color,hidden:d.includes(_.id),data:_}})}},[h,t,d,c,i,l,a,u]),p=g.legendData,v=m.useRef(f);return m.useEffect(function(){typeof v.current=="function"&&v.current(p)},[v,p]),g},Dq=function(e){var t=e.activeId,n=e.onActiveIdChange,r=e.defaultActiveId,i=t!==void 0,a=m.useState(i||r===void 0?null:r),o=a[0],s=a[1];return{activeId:i?t:o,setActiveId:m.useCallback(function(c){n&&n(c),i||s(c)},[i,n,s])}},Nq=function(e){var t=e.data,n=e.width,r=e.height,i=e.innerRadius,a=i===void 0?Se.innerRadius:i,o=e.startAngle,s=o===void 0?Se.startAngle:o,c=e.endAngle,l=c===void 0?Se.endAngle:c,u=e.padAngle,d=u===void 0?Se.padAngle:u,f=e.sortByValue,h=f===void 0?Se.sortByValue:f,g=e.cornerRadius,p=g===void 0?Se.cornerRadius:g,v=e.fit,x=v===void 0?Se.fit:v,_=e.activeInnerRadiusOffset,y=_===void 0?Se.activeInnerRadiusOffset:_,C=e.activeOuterRadiusOffset,w=C===void 0?Se.activeOuterRadiusOffset:C,T=e.activeId,$=e.onActiveIdChange,R=e.defaultActiveId,S=e.forwardLegendData,k=Dq({activeId:T,onActiveIdChange:$,defaultActiveId:R}),O=k.activeId,D=k.setActiveId,E=m.useState([]),M=E[0],j=E[1],F=m.useMemo(function(){var U,N=Math.min(n,r)/2,V=N*Math.min(a,1),X=n/2,ne=r/2;if(x){var K=_q(X,ne,N,s-90,l-90),J=K.points,q=GC(K,jq),G=Math.min(n/q.width,r/q.height),z={width:q.width*G,height:q.height*G};z.x=(n-z.width)/2,z.y=(r-z.height)/2,X=(X-q.x)/q.width*q.width*G+z.x,ne=(ne-q.y)/q.height*q.height*G+z.y,U={box:q,ratio:G,points:J},N*=G,V*=G}return{centerX:X,centerY:ne,radius:N,innerRadius:V,debug:U}},[n,r,a,s,l,x]),W=Iq({data:t,startAngle:s,endAngle:l,innerRadius:F.innerRadius,outerRadius:F.radius,padAngle:d,sortByValue:h,activeId:O,activeInnerRadiusOffset:y,activeOuterRadiusOffset:w,hiddenIds:M,forwardLegendData:S}),B=m.useCallback(function(U){j(function(N){return N.indexOf(U)>-1?N.filter(function(V){return V!==U}):[].concat(N,[U])})},[]);return Jr({arcGenerator:wq({cornerRadius:p,padAngle:An(d)}),activeId:O,setActiveId:D,toggleSerie:B},W,F)},Fq=function(e){var t=e.dataWithArc,n=e.arcGenerator,r=e.centerX,i=e.centerY,a=e.radius,o=e.innerRadius;return m.useMemo(function(){return{dataWithArc:t,arcGenerator:n,centerX:r,centerY:i,radius:a,innerRadius:o}},[t,n,r,i,a,o])},Lq=function(e){var t=e.center,n=e.data,r=e.arcGenerator,i=e.borderWidth,a=e.borderColor,o=e.isInteractive,s=e.onClick,c=e.onMouseEnter,l=e.onMouseMove,u=e.onMouseLeave,d=e.setActiveId,f=e.tooltip,h=e.transitionMode,g=Li(),p=g.showTooltipFromEvent,v=g.hideTooltip,x=m.useMemo(function(){if(o)return function(w,T){s==null||s(w,T)}},[o,s]),_=m.useMemo(function(){if(o)return function(w,T){p(m.createElement(f,{datum:w}),T),d(w.id),c==null||c(w,T)}},[o,p,d,c,f]),y=m.useMemo(function(){if(o)return function(w,T){p(m.createElement(f,{datum:w}),T),l==null||l(w,T)}},[o,p,l,f]),C=m.useMemo(function(){if(o)return function(w,T){v(),d(null),u==null||u(w,T)}},[o,v,d,u]);return b.jsx(xq,{center:t,data:n,arcGenerator:r,borderWidth:i,borderColor:a,transitionMode:h,onClick:x,onMouseEnter:_,onMouseMove:y,onMouseLeave:C})},Bq=["isInteractive","animate","motionConfig","theme","renderWrapper"],Wq=function(e){var t=e.data,n=e.id,r=n===void 0?Se.id:n,i=e.value,a=i===void 0?Se.value:i,o=e.valueFormat,s=e.sortByValue,c=s===void 0?Se.sortByValue:s,l=e.layers,u=l===void 0?Se.layers:l,d=e.startAngle,f=d===void 0?Se.startAngle:d,h=e.endAngle,g=h===void 0?Se.endAngle:h,p=e.padAngle,v=p===void 0?Se.padAngle:p,x=e.fit,_=x===void 0?Se.fit:x,y=e.innerRadius,C=y===void 0?Se.innerRadius:y,w=e.cornerRadius,T=w===void 0?Se.cornerRadius:w,$=e.activeInnerRadiusOffset,R=$===void 0?Se.activeInnerRadiusOffset:$,S=e.activeOuterRadiusOffset,k=S===void 0?Se.activeOuterRadiusOffset:S,O=e.width,D=e.height,E=e.margin,M=e.colors,j=M===void 0?Se.colors:M,F=e.borderWidth,W=F===void 0?Se.borderWidth:F,B=e.borderColor,U=B===void 0?Se.borderColor:B,N=e.enableArcLabels,V=N===void 0?Se.enableArcLabels:N,X=e.arcLabel,ne=X===void 0?Se.arcLabel:X,K=e.arcLabelsSkipAngle,J=K===void 0?Se.arcLabelsSkipAngle:K,q=e.arcLabelsTextColor,G=q===void 0?Se.arcLabelsTextColor:q,z=e.arcLabelsRadiusOffset,L=z===void 0?Se.arcLabelsRadiusOffset:z,H=e.arcLabelsComponent,ee=e.enableArcLinkLabels,A=ee===void 0?Se.enableArcLinkLabels:ee,se=e.arcLinkLabel,ce=se===void 0?Se.arcLinkLabel:se,ue=e.arcLinkLabelsSkipAngle,we=ue===void 0?Se.arcLinkLabelsSkipAngle:ue,Te=e.arcLinkLabelsOffset,at=Te===void 0?Se.arcLinkLabelsOffset:Te,tt=e.arcLinkLabelsDiagonalLength,Be=tt===void 0?Se.arcLinkLabelsDiagonalLength:tt,Ke=e.arcLinkLabelsStraightLength,Ye=Ke===void 0?Se.arcLinkLabelsStraightLength:Ke,de=e.arcLinkLabelsThickness,ke=de===void 0?Se.arcLinkLabelsThickness:de,Oe=e.arcLinkLabelsTextOffset,ve=Oe===void 0?Se.arcLinkLabelsTextOffset:Oe,Ie=e.arcLinkLabelsTextColor,Xe=Ie===void 0?Se.arcLinkLabelsTextColor:Ie,It=e.arcLinkLabelsColor,mt=It===void 0?Se.arcLinkLabelsColor:It,Je=e.arcLinkLabelComponent,bt=e.defs,At=bt===void 0?Se.defs:bt,it=e.fill,gt=it===void 0?Se.fill:it,yt=e.isInteractive,Lt=yt===void 0?Se.isInteractive:yt,$e=e.onClick,Pe=e.onMouseEnter,ze=e.onMouseMove,nt=e.onMouseLeave,vt=e.tooltip,kt=vt===void 0?Se.tooltip:vt,Xt=e.activeId,Dt=e.onActiveIdChange,Bt=e.defaultActiveId,Ht=e.transitionMode,Mt=Ht===void 0?Se.transitionMode:Ht,Wt=e.legends,Jt=Wt===void 0?Se.legends:Wt,Vt=e.forwardLegendData,fe=e.role,ye=fe===void 0?Se.role:fe,Ee=Us(O,D,E),qe=Ee.outerWidth,Ge=Ee.outerHeight,ot=Ee.margin,P=Ee.innerWidth,re=Ee.innerHeight,Z=Pq({data:t,id:r,value:a,valueFormat:o,colors:j}),te=Nq({data:Z,width:P,height:re,fit:_,innerRadius:C,startAngle:f,endAngle:g,padAngle:v,sortByValue:c,cornerRadius:T,activeInnerRadiusOffset:R,activeOuterRadiusOffset:k,activeId:Xt,onActiveIdChange:Dt,defaultActiveId:Bt,forwardLegendData:Vt}),ge=te.dataWithArc,Ce=te.legendData,pe=te.arcGenerator,be=te.centerX,Ae=te.centerY,Me=te.radius,et=te.innerRadius,Nt=te.setActiveId,wt=te.toggleSerie,Ut=Km(At,ge,gt),le={arcs:null,arcLinkLabels:null,arcLabels:null,legends:null};u.includes("arcs")&&(le.arcs=b.jsx(Lq,{center:[be,Ae],data:ge,arcGenerator:pe,borderWidth:W,borderColor:U,isInteractive:Lt,onClick:$e,onMouseEnter:Pe,onMouseMove:ze,onMouseLeave:nt,setActiveId:Nt,tooltip:kt,transitionMode:Mt},"arcs")),A&&u.includes("arcLinkLabels")&&(le.arcLinkLabels=b.jsx(gq,{center:[be,Ae],data:ge,label:ce,skipAngle:we,offset:at,diagonalLength:Be,straightLength:Ye,strokeWidth:ke,textOffset:ve,textColor:Xe,linkColor:mt,component:Je},"arcLinkLabels")),V&&u.includes("arcLabels")&&(le.arcLabels=b.jsx(cq,{center:[be,Ae],data:ge,label:ne,radiusOffset:L,skipAngle:J,textColor:G,transitionMode:Mt,component:H},"arcLabels")),Jt.length>0&&u.includes("legends")&&(le.legends=b.jsx(Aq,{width:P,height:re,data:Ce,legends:Jt,toggleSerie:wt},"legends"));var cn=Fq({dataWithArc:ge,arcGenerator:pe,centerX:be,centerY:Ae,radius:Me,innerRadius:et});return b.jsx(ld,{width:qe,height:Ge,margin:ot,defs:Ut,role:ye,children:u.map(function(Ft,dr){return le[Ft]!==void 0?le[Ft]:typeof Ft=="function"?b.jsx(m.Fragment,{children:m.createElement(Ft,cn)},dr):null})})},Uq=function(e){var t=e.isInteractive,n=t===void 0?Se.isInteractive:t,r=e.animate,i=r===void 0?Se.animate:r,a=e.motionConfig,o=a===void 0?Se.motionConfig:a,s=e.theme,c=e.renderWrapper,l=GC(e,Bq);return b.jsx(zs,{animate:i,isInteractive:n,motionConfig:o,renderWrapper:c,theme:s,children:b.jsx(Wq,Jr({isInteractive:n},l))})},zq=function(e){return b.jsx(Ka,{children:function(t){var n=t.width,r=t.height;return b.jsx(Uq,Jr({width:n,height:r},e))}})};function Hq(){}var Vq=Hq,of=gC,qq=Vq,Yq=Hm,Gq=1/0,Zq=of&&1/Yq(new of([,-0]))[1]==Gq?function(e){return new of(e)}:qq,Kq=Zq,Xq=Pm,Qq=Hw,Jq=Vw,eY=Im,tY=Kq,nY=Hm,rY=200;function iY(e,t,n){var r=-1,i=Qq,a=e.length,o=!0,s=[],c=s;if(n)o=!1,i=Jq;else if(a>=rY){var l=t?null:tY(e);if(l)return nY(l);o=!1,i=eY,c=new Xq}else c=t?[]:s;e:for(;++r<a;){var u=e[r],d=t?t(u):u;if(u=n||u!==0?u:0,o&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue e;t&&c.push(d),s.push(u)}else i(c,d,n)||(c!==s&&c.push(d),s.push(u))}return s}var ZC=iY,aY=ZC;function oY(e){return e&&e.length?aY(e):[]}var sY=oY;const Bb=Rt(sY);var cY=pu,lY=qm,uY=1,dY=2;function fY(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new cY;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?lY(u,l,uY|dY,r,d):f))return!1}}return!0}var hY=fY,pY=ur;function mY(e){return e===e&&!pY(e)}var KC=mY,gY=KC,vY=Ws;function bY(e){for(var t=vY(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,gY(i)]}return t}var yY=bY;function xY(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var XC=xY,_Y=hY,wY=yY,CY=XC;function TY(e){var t=wY(e);return t.length==1&&t[0][2]?CY(t[0][0],t[0][1]):function(n){return n===e||_Y(n,e,t)}}var kY=TY,SY=qm,OY=q_,EY=sC,MY=lm,$Y=KC,RY=XC,AY=Ya,jY=1,PY=2;function IY(e,t){return MY(e)&&$Y(t)?RY(AY(e),t):function(n){var r=OY(n,e);return r===void 0&&r===t?EY(n,e):SY(t,r,jY|PY)}}var DY=IY;function NY(e){return function(t){return t==null?void 0:t[e]}}var FY=NY,LY=Ls;function BY(e){return function(t){return LY(t,e)}}var WY=BY,UY=FY,zY=WY,HY=lm,VY=Ya;function qY(e){return HY(e)?UY(VY(e)):zY(e)}var YY=qY,GY=kY,ZY=DY,KY=yu,XY=Cn,QY=YY;function JY(e){return typeof e=="function"?e:e==null?KY:typeof e=="object"?XY(e)?ZY(e[0],e[1]):GY(e):QY(e)}var eg=JY,eG=eg,tG=ZC;function nG(e,t){return e&&e.length?tG(e,eG(t)):[]}var rG=nG;const Oh=Rt(rG);var iG=O_,aG=Ws;function oG(e,t){return e&&iG(e,t,aG)}var sG=oG,cG=za;function lG(e,t){return function(n,r){if(n==null)return n;if(!cG(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var uG=lG,dG=sG,fG=uG,hG=fG(dG),QC=hG,pG=QC,mG=za;function gG(e,t){var n=-1,r=mG(e)?Array(e.length):[];return pG(e,function(i,a,o){r[++n]=t(i,a,o)}),r}var vG=gG;function bG(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var yG=bG,Wb=xu;function xG(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=Wb(e),o=t!==void 0,s=t===null,c=t===t,l=Wb(t);if(!s&&!l&&!a&&e>t||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}var _G=xG,wG=_G;function CG(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=wG(i[r],a[r]);if(c){if(r>=s)return c;var l=n[r];return c*(l=="desc"?-1:1)}}return e.index-t.index}var TG=CG,sf=_u,kG=Ls,SG=eg,OG=vG,EG=yG,MG=Ha,$G=TG,RG=yu,AG=Cn;function jG(e,t,n){t.length?t=sf(t,function(a){return AG(a)?function(o){return kG(o,a.length===1?a[0]:a)}:a}):t=[RG];var r=-1;t=sf(t,MG(SG));var i=OG(e,function(a,o,s){var c=sf(t,function(l){return l(a)});return{criteria:c,index:++r,value:a}});return EG(i,function(a,o){return $G(a,o,n)})}var PG=jG,IG=lC,DG=PG,NG=cm,Ub=U_,FG=NG(function(e,t){if(e==null)return[];var n=t.length;return n>1&&Ub(e,t[0],t[1])?t=[]:n>2&&Ub(t[0],t[1],t[2])&&(t=[t[0]]),DG(e,IG(t,1),[])}),LG=FG;const BG=Rt(LG);var WG=Or,UG=Nn,zG="[object Date]";function HG(e){return UG(e)&&WG(e)==zG}var VG=HG,qG=VG,YG=Ha,zb=vu,Hb=zb&&zb.isDate,GG=Hb?YG(Hb):qG,ZG=GG;const KG=Rt(ZG);function ui(){return ui=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ui.apply(this,arguments)}var Ji=[function(e){return e.setMilliseconds(0)},function(e){return e.setSeconds(0)},function(e){return e.setMinutes(0)},function(e){return e.setHours(0)},function(e){return e.setDate(1)},function(e){return e.setMonth(0)}],XG={millisecond:[],second:Ji.slice(0,1),minute:Ji.slice(0,2),hour:Ji.slice(0,3),day:Ji.slice(0,4),month:Ji.slice(0,5),year:Ji.slice(0,6)},QG=function(e){return function(t){return XG[e].forEach(function(n){n(t)}),t}},JC=function(e){var t=e.format,n=t===void 0?"native":t,r=e.precision,i=r===void 0?"millisecond":r,a=e.useUTC,o=a===void 0||a,s=QG(i);return function(c){if(c===void 0)return c;if(n==="native"||c instanceof Date)return s(c);var l=o?Iw(n):jw(n);return s(l(c))}},JG=function(e,t,n,r){var i,a,o,s,c=e.min,l=c===void 0?0:c,u=e.max,d=u===void 0?"auto":u,f=e.stacked,h=f!==void 0&&f,g=e.reverse,p=g!==void 0&&g,v=e.clamp,x=v!==void 0&&v,_=e.nice,y=_!==void 0&&_;l==="auto"?i=h===!0?(a=t.minStacked)!=null?a:0:t.min:i=l,d==="auto"?o=h===!0?(s=t.maxStacked)!=null?s:0:t.max:o=d;var C=ow().rangeRound(r==="x"?[0,n]:[n,0]).domain(p?[o,i]:[i,o]).clamp(x);return y===!0?C.nice():typeof y=="number"&&C.nice(y),eZ(C,h)},eZ=function(e,t){t===void 0&&(t=!1);var n=e;return n.type="linear",n.stacked=t,n},tZ=function(e,t,n){var r=UF().range([0,n]).domain(t.all);return r.type="point",r},nZ=function(e,t,n,r){var i=e.round,a=i===void 0||i,o=vm().range(r==="x"?[0,n]:[n,0]).domain(t.all).round(a);return rZ(o)},rZ=function(e){var t=e;return t.type="band",t},iZ=function(e,t,n){var r,i,a=e.format,o=a===void 0?"native":a,s=e.precision,c=s===void 0?"millisecond":s,l=e.min,u=l===void 0?"auto":l,d=e.max,f=d===void 0?"auto":d,h=e.useUTC,g=h===void 0||h,p=e.nice,v=p!==void 0&&p,x=JC({format:o,precision:c,useUTC:g});r=u==="auto"?x(t.min):o!=="native"?x(u):u,i=f==="auto"?x(t.max):o!=="native"?x(f):f;var _=g?jB():AB();_.range([0,n]),r&&i&&_.domain([r,i]),v===!0?_.nice():typeof v!="object"&&typeof v!="number"||_.nice(v);var y=_;return y.type="time",y.useUTC=g,y},aZ=function(e,t,n,r){var i,a=e.base,o=a===void 0?10:a,s=e.min,c=s===void 0?"auto":s,l=e.max,u=l===void 0?"auto":l;if(t.all.some(function(p){return p===0}))throw new Error("a log scale domain must not include or cross zero");var d,f,h=!1;if(t.all.filter(function(p){return p!=null}).forEach(function(p){h||(i===void 0?i=Math.sign(p):Math.sign(p)!==i&&(h=!0))}),h)throw new Error("a log scale domain must be strictly-positive or strictly-negative");d=c==="auto"?t.min:c,f=u==="auto"?t.max:u;var g=cw().domain([d,f]).rangeRound(r==="x"?[0,n]:[n,0]).base(o).nice();return g.type="log",g},oZ=function(e,t,n,r){var i,a,o=e.constant,s=o===void 0?1:o,c=e.min,l=c===void 0?"auto":c,u=e.max,d=u===void 0?"auto":u,f=e.reverse,h=f!==void 0&&f;i=l==="auto"?t.min:l,a=d==="auto"?t.max:d;var g=lw().constant(s).rangeRound(r==="x"?[0,n]:[n,0]).nice();h===!0?g.domain([a,i]):g.domain([i,a]);var p=g;return p.type="symlog",p},sZ=function(e){return e==="x"?"y":"x"},cZ=function(e,t){return e===t},lZ=function(e,t){return e.getTime()===t.getTime()};function ys(e,t,n,r){switch(e.type){case"linear":return JG(e,t,n,r);case"point":return tZ(e,t,n);case"band":return nZ(e,t,n,r);case"time":return iZ(e,t,n);case"log":return aZ(e,t,n,r);case"symlog":return oZ(e,t,n,r);default:throw new Error("invalid scale spec")}}var Vb=function(e,t,n){var r;if("stacked"in n&&n.stacked){var i=e.data[t==="x"?"xStacked":"yStacked"];return i==null?null:n(i)}return(r=n(e.data[t]))!=null?r:null},uZ=function(e,t,n,r,i){var a=e.map(function(u){return function(d){return ui({},d,{data:d.data.map(function(f){return{data:ui({},f)}})})}(u)}),o=dZ(a,t,n);"stacked"in t&&t.stacked===!0&&fZ(o,a),"stacked"in n&&n.stacked===!0&&hZ(o,a);var s=ys(t,o.x,r,"x"),c=ys(n,o.y,i,"y"),l=a.map(function(u){return ui({},u,{data:u.data.map(function(d){return ui({},d,{position:{x:Vb(d,"x",s),y:Vb(d,"y",c)}})})})});return ui({},o,{series:l,xScale:s,yScale:c})},dZ=function(e,t,n){return{x:qb(e,"x",t),y:qb(e,"y",n)}},qb=function(e,t,n,r){var i={},a=i.getValue,o=a===void 0?function(g){return g.data[t]}:a,s=i.setValue,c=s===void 0?function(g,p){g.data[t]=p}:s;if(n.type==="linear")e.forEach(function(g){g.data.forEach(function(p){var v=o(p);v&&c(p,parseFloat(String(v)))})});else if(n.type==="time"&&n.format!=="native"){var l=JC(n);e.forEach(function(g){g.data.forEach(function(p){var v=o(p);v&&c(p,l(v))})})}var u=[];switch(e.forEach(function(g){g.data.forEach(function(p){u.push(o(p))})}),n.type){case"linear":var d=BG(Bb(u).filter(function(g){return g!==null}),function(g){return g});return{all:d,min:Math.min.apply(Math,d),max:Math.max.apply(Math,d)};case"time":var f=Oh(u,function(g){return g.getTime()}).slice(0).sort(function(g,p){return p.getTime()-g.getTime()}).reverse();return{all:f,min:f[0],max:xe(f)};default:var h=Bb(u);return{all:h,min:h[0],max:xe(h)}}},eT=function(e,t,n){var r=sZ(e),i=[];t[r].all.forEach(function(a){var o=KG(a)?lZ:cZ,s=[];n.forEach(function(c){var l=c.data.find(function(h){return o(h.data[r],a)}),u=null,d=null;if(l!==void 0){if((u=l.data[e])!==null){var f=xe(s);f===void 0?d=u:f!==null&&(d=f+u)}l.data[e==="x"?"xStacked":"yStacked"]=d}s.push(d),d!==null&&i.push(d)})}),t[e].minStacked=Math.min.apply(Math,i),t[e].maxStacked=Math.max.apply(Math,i)},fZ=function(e,t){return eT("x",e,t)},hZ=function(e,t){return eT("y",e,t)},tT=function(e){var t=e.bandwidth();if(t===0)return e;var n=t/2;return e.round()&&(n=Math.round(n)),function(r){var i;return((i=e(r))!=null?i:0)+n}},nT={millisecond:[ms,ms],second:[hh,hh],minute:[mw,ww],hour:[gw,Cw],day:[zt(function(e){return e.setHours(0,0,0,0)},function(e,t){return e.setDate(e.getDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)}),zt(function(e){return e.setUTCHours(0,0,0,0)},function(e,t){return e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)})],week:[ml,gl],sunday:[ml,gl],monday:[gs,vs],tuesday:[vw,Tw],wednesday:[bw,kw],thursday:[Pi,Ii],friday:[yw,Sw],saturday:[xw,Ow],month:[_w,Ew],year:[Kr,Xr]},pZ=Object.keys(nT),mZ=new RegExp("^every\\s*(\\d+)?\\s*("+pZ.join("|")+")s?$","i"),rT=function(e,t){if(Array.isArray(t))return t;if(typeof t=="string"&&"useUTC"in e){var n=t.match(mZ);if(n){var r=n[1],i=n[2],a=nT[i][e.useUTC?1:0];if(i==="day"){var o,s,c=e.domain(),l=c[0],u=c[1],d=new Date(u);return d.setDate(d.getDate()+1),(o=(s=a.every(Number(r??1)))==null?void 0:s.range(l,d))!=null?o:[]}if(r===void 0)return e.ticks(a);var f=a.every(Number(r));if(f)return e.ticks(f)}throw new Error("Invalid tickValues: "+t)}if("ticks"in e){if(t===void 0)return e.ticks();if(typeof(h=t)=="number"&&isFinite(h)&&Math.floor(h)===h)return e.ticks(t)}var h;return e.domain()};function jn(){return jn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jn.apply(this,arguments)}var iT=function(e){var t,n=e.axis,r=e.scale,i=e.ticksPosition,a=e.tickValues,o=e.tickSize,s=e.tickPadding,c=e.tickRotation,l=e.truncateTickAt,u=e.engine,d=u===void 0?"svg":u,f=rT(r,a),h=RV[d],g="bandwidth"in r?tT(r):r,p={lineX:0,lineY:0},v={textX:0,textY:0},x=typeof document=="object"&&document.dir==="rtl",_=h.align.center,y=h.baseline.center;return n==="x"?(t=function(C){var w;return{x:(w=g(C))!=null?w:0,y:0}},p.lineY=o*(i==="after"?1:-1),v.textY=(o+s)*(i==="after"?1:-1),y=i==="after"?h.baseline.top:h.baseline.bottom,c===0?_=h.align.center:i==="after"&&c<0||i==="before"&&c>0?(_=h.align[x?"left":"right"],y=h.baseline.center):(i==="after"&&c>0||i==="before"&&c<0)&&(_=h.align[x?"right":"left"],y=h.baseline.center)):(t=function(C){var w;return{x:0,y:(w=g(C))!=null?w:0}},p.lineX=o*(i==="after"?1:-1),v.textX=(o+s)*(i==="after"?1:-1),_=i==="after"?h.align.left:h.align.right),{ticks:f.map(function(C){var w=typeof C=="string"?function(T){var $=String(T).length;return l&&l>0&&$>l?""+String(T).slice(0,l).concat("..."):""+T}(C):C;return jn({key:C instanceof Date?""+C.valueOf():""+C,value:w},t(C),p,v)}),textAlign:_,textBaseline:y}},aT=function(e,t){if(e===void 0||typeof e=="function")return e;if(t.type==="time"){var n=Eu(e);return function(r){return n(r instanceof Date?r:new Date(r))}}return Bs(e)},Eh=function(e){var t,n=e.width,r=e.height,i=e.scale,a=e.axis,o=e.values,s=(t=o,(Array.isArray(t)?o:void 0)||rT(i,o)),c="bandwidth"in i?tT(i):i,l=a==="x"?s.map(function(u){var d,f;return{key:u instanceof Date?""+u.valueOf():""+u,x1:(d=c(u))!=null?d:0,x2:(f=c(u))!=null?f:0,y1:0,y2:r}}):s.map(function(u){var d,f;return{key:u instanceof Date?""+u.valueOf():""+u,x1:0,x2:n,y1:(d=c(u))!=null?d:0,y2:(f=c(u))!=null?f:0}});return l},gZ=m.memo(function(e){var t,n=e.value,r=e.format,i=e.lineX,a=e.lineY,o=e.onClick,s=e.textBaseline,c=e.textAnchor,l=e.animatedProps,u=ht(),d=u.axis.ticks.line,f=u.axis.ticks.text,h=(t=r==null?void 0:r(n))!=null?t:n,g=m.useMemo(function(){var p={opacity:l.opacity};return o?{style:jn({},p,{cursor:"pointer"}),onClick:function(v){return o(v,h)}}:{style:p}},[l.opacity,o,h]);return b.jsxs(ft.g,jn({transform:l.transform},g,{children:[b.jsx("line",{x1:0,x2:i,y1:0,y2:a,style:d}),f.outlineWidth>0&&b.jsx(ft.text,{dominantBaseline:s,textAnchor:c,transform:l.textTransform,style:f,strokeWidth:2*f.outlineWidth,stroke:f.outlineColor,strokeLinejoin:"round",children:""+h}),b.jsx(ft.text,{dominantBaseline:s,textAnchor:c,transform:l.textTransform,style:Zm(f),children:""+h})]}))}),vZ=function(e){var t=e.axis,n=e.scale,r=e.x,i=r===void 0?0:r,a=e.y,o=a===void 0?0:a,s=e.length,c=e.ticksPosition,l=e.tickValues,u=e.tickSize,d=u===void 0?5:u,f=e.tickPadding,h=f===void 0?5:f,g=e.tickRotation,p=g===void 0?0:g,v=e.format,x=e.renderTick,_=x===void 0?gZ:x,y=e.truncateTickAt,C=e.legend,w=e.legendPosition,T=w===void 0?"end":w,$=e.legendOffset,R=$===void 0?0:$,S=e.onClick,k=e.ariaHidden,O=ht(),D=O.axis.legend.text,E=m.useMemo(function(){return aT(v,n)},[v,n]),M=iT({axis:t,scale:n,ticksPosition:c,tickValues:l,tickSize:d,tickPadding:h,tickRotation:p,truncateTickAt:y}),j=M.ticks,F=M.textAlign,W=M.textBaseline,B=null;if(C!==void 0){var U,N=0,V=0,X=0;t==="y"?(X=-90,N=R,T==="start"?(U="start",V=s):T==="middle"?(U="middle",V=s/2):T==="end"&&(U="end")):(V=R,T==="start"?U="start":T==="middle"?(U="middle",N=s/2):T==="end"&&(U="end",N=s)),B=b.jsxs(b.Fragment,{children:[D.outlineWidth>0&&b.jsx("text",{transform:"translate("+N+", "+V+") rotate("+X+")",textAnchor:U,style:jn({dominantBaseline:"central"},D),strokeWidth:2*D.outlineWidth,stroke:D.outlineColor,strokeLinejoin:"round",children:C}),b.jsx("text",{transform:"translate("+N+", "+V+") rotate("+X+")",textAnchor:U,style:jn({dominantBaseline:"central"},D),children:C})]})}var ne=mn(),K=ne.animate,J=ne.config,q=cr({transform:"translate("+i+","+o+")",lineX2:t==="x"?s:0,lineY2:t==="x"?0:s,config:J,immediate:!K}),G=m.useCallback(function(H){return{opacity:1,transform:"translate("+H.x+","+H.y+")",textTransform:"translate("+H.textX+","+H.textY+") rotate("+p+")"}},[p]),z=m.useCallback(function(H){return{opacity:0,transform:"translate("+H.x+","+H.y+")",textTransform:"translate("+H.textX+","+H.textY+") rotate("+p+")"}},[p]),L=Fi(j,{keys:function(H){return H.key},initial:G,from:z,enter:G,update:G,leave:{opacity:0},config:J,immediate:!K});return b.jsxs(ft.g,{transform:q.transform,"aria-hidden":k,children:[L(function(H,ee,A,se){return ie.createElement(_,jn({tickIndex:se,format:E,rotate:p,textBaseline:W,textAnchor:F,truncateTickAt:y,animatedProps:H},ee,S?{onClick:S}:{}))}),b.jsx(ft.line,{style:O.axis.domain.line,x1:0,x2:q.lineX2,y1:0,y2:q.lineY2}),B]})},bZ=m.memo(vZ),oT=["top","right","bottom","left"],sT=m.memo(function(e){var t=e.xScale,n=e.yScale,r=e.width,i=e.height,a={top:e.top,right:e.right,bottom:e.bottom,left:e.left};return b.jsx(b.Fragment,{children:oT.map(function(o){var s=a[o];if(!s)return null;var c=o==="top"||o==="bottom";return b.jsx(bZ,jn({},s,{axis:c?"x":"y",x:o==="right"?r:0,y:o==="bottom"?i:0,scale:c?t:n,length:c?r:i,ticksPosition:o==="top"||o==="left"?"before":"after",truncateTickAt:s.truncateTickAt}),o)})})}),yZ=m.memo(function(e){var t=e.animatedProps,n=ht();return b.jsx(ft.line,jn({},t,n.grid.line))}),Yb=m.memo(function(e){var t=e.lines,n=mn(),r=n.animate,i=n.config,a=Fi(t,{keys:function(o){return o.key},initial:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},from:function(o){return{opacity:0,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},enter:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},update:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},leave:{opacity:0},config:i,immediate:!r});return b.jsx("g",{children:a(function(o,s){return m.createElement(yZ,jn({},s,{key:s.key,animatedProps:o}))})})}),cT=m.memo(function(e){var t=e.width,n=e.height,r=e.xScale,i=e.yScale,a=e.xValues,o=e.yValues,s=m.useMemo(function(){return!!r&&Eh({width:t,height:n,scale:r,axis:"x",values:a})},[r,a,t,n]),c=m.useMemo(function(){return!!i&&Eh({width:t,height:n,scale:i,axis:"y",values:o})},[n,t,i,o]);return b.jsxs(b.Fragment,{children:[s&&b.jsx(Yb,{lines:s}),c&&b.jsx(Yb,{lines:c})]})}),xZ=function(e,t){var n,r=t.axis,i=t.scale,a=t.x,o=a===void 0?0:a,s=t.y,c=s===void 0?0:s,l=t.length,u=t.ticksPosition,d=t.tickValues,f=t.tickSize,h=f===void 0?5:f,g=t.tickPadding,p=g===void 0?5:g,v=t.tickRotation,x=v===void 0?0:v,_=t.format,y=t.legend,C=t.legendPosition,w=C===void 0?"end":C,T=t.legendOffset,$=T===void 0?0:T,R=t.theme,S=iT({axis:r,scale:i,ticksPosition:u,tickValues:d,tickSize:h,tickPadding:p,tickRotation:x,engine:"canvas"}),k=S.ticks,O=S.textAlign,D=S.textBaseline;e.save(),e.translate(o,c),e.textAlign=O,e.textBaseline=D;var E=R.axis.ticks.text;e.font=(E.fontWeight?E.fontWeight+" ":"")+E.fontSize+"px "+E.fontFamily,((n=R.axis.domain.line.strokeWidth)!=null?n:0)>0&&(e.lineWidth=Number(R.axis.domain.line.strokeWidth),e.lineCap="square",R.axis.domain.line.stroke&&(e.strokeStyle=R.axis.domain.line.stroke),e.beginPath(),e.moveTo(0,0),e.lineTo(r==="x"?l:0,r==="x"?0:l),e.stroke());var M=typeof _=="function"?_:function(U){return""+U};if(k.forEach(function(U){var N;((N=R.axis.ticks.line.strokeWidth)!=null?N:0)>0&&(e.lineWidth=Number(R.axis.ticks.line.strokeWidth),e.lineCap="square",R.axis.ticks.line.stroke&&(e.strokeStyle=R.axis.ticks.line.stroke),e.beginPath(),e.moveTo(U.x,U.y),e.lineTo(U.x+U.lineX,U.y+U.lineY),e.stroke());var V=M(U.value);e.save(),e.translate(U.x+U.textX,U.y+U.textY),e.rotate(An(x)),E.outlineWidth>0&&(e.strokeStyle=E.outlineColor,e.lineWidth=2*E.outlineWidth,e.lineJoin="round",e.strokeText(""+V,0,0)),R.axis.ticks.text.fill&&(e.fillStyle=E.fill),e.fillText(""+V,0,0),e.restore()}),y!==void 0){var j=0,F=0,W=0,B="center";r==="y"?(W=-90,j=$,w==="start"?(B="start",F=l):w==="middle"?(B="center",F=l/2):w==="end"&&(B="end")):(F=$,w==="start"?B="start":w==="middle"?(B="center",j=l/2):w==="end"&&(B="end",j=l)),e.translate(j,F),e.rotate(An(W)),e.font=(R.axis.legend.text.fontWeight?R.axis.legend.text.fontWeight+" ":"")+R.axis.legend.text.fontSize+"px "+R.axis.legend.text.fontFamily,R.axis.legend.text.fill&&(e.fillStyle=R.axis.legend.text.fill),e.textAlign=B,e.textBaseline="middle",e.fillText(y,0,0)}e.restore()},lT=function(e,t){var n=t.xScale,r=t.yScale,i=t.width,a=t.height,o=t.top,s=t.right,c=t.bottom,l=t.left,u=t.theme,d={top:o,right:s,bottom:c,left:l};oT.forEach(function(f){var h=d[f];if(!h)return null;var g=f==="top"||f==="bottom",p=f==="top"||f==="left"?"before":"after",v=g?n:r,x=aT(h.format,v);xZ(e,jn({},h,{axis:g?"x":"y",x:f==="right"?i:0,y:f==="bottom"?a:0,scale:v,format:x,length:g?i:a,ticksPosition:p,theme:u}))})},Cl=function(e,t){var n=t.width,r=t.height,i=t.scale,a=t.axis,o=t.values;Eh({width:n,height:r,scale:i,axis:a,values:o}).forEach(function(s){e.beginPath(),e.moveTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.stroke()})},_Z=V_,wZ=0;function CZ(e){var t=++wZ;return _Z(e)+t}var TZ=CZ;const kZ=Rt(TZ),xr=11102230246251565e-32,tn=134217729,SZ=(3+8*xr)*xr;function cf(e,t,n,r,i){let a,o,s,c,l=t[0],u=r[0],d=0,f=0;u>l==u>-l?(a=l,l=t[++d]):(a=u,u=r[++f]);let h=0;if(d<e&&f<n)for(u>l==u>-l?(o=l+a,s=a-(o-l),l=t[++d]):(o=u+a,s=a-(o-u),u=r[++f]),a=o,s!==0&&(i[h++]=s);d<e&&f<n;)u>l==u>-l?(o=a+l,c=o-a,s=a-(o-c)+(l-c),l=t[++d]):(o=a+u,c=o-a,s=a-(o-c)+(u-c),u=r[++f]),a=o,s!==0&&(i[h++]=s);for(;d<e;)o=a+l,c=o-a,s=a-(o-c)+(l-c),l=t[++d],a=o,s!==0&&(i[h++]=s);for(;f<n;)o=a+u,c=o-a,s=a-(o-c)+(u-c),u=r[++f],a=o,s!==0&&(i[h++]=s);return(a!==0||h===0)&&(i[h++]=a),h}function OZ(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function Hs(e){return new Float64Array(e)}const EZ=(3+16*xr)*xr,MZ=(2+12*xr)*xr,$Z=(9+64*xr)*xr*xr,ea=Hs(4),Gb=Hs(8),Zb=Hs(12),Kb=Hs(16),ln=Hs(4);function RZ(e,t,n,r,i,a,o){let s,c,l,u,d,f,h,g,p,v,x,_,y,C,w,T,$,R;const S=e-i,k=n-i,O=t-a,D=r-a;C=S*D,f=tn*S,h=f-(f-S),g=S-h,f=tn*D,p=f-(f-D),v=D-p,w=g*v-(C-h*p-g*p-h*v),T=O*k,f=tn*O,h=f-(f-O),g=O-h,f=tn*k,p=f-(f-k),v=k-p,$=g*v-(T-h*p-g*p-h*v),x=w-$,d=w-x,ea[0]=w-(x+d)+(d-$),_=C+x,d=_-C,y=C-(_-d)+(x-d),x=y-T,d=y-x,ea[1]=y-(x+d)+(d-T),R=_+x,d=R-_,ea[2]=_-(R-d)+(x-d),ea[3]=R;let E=OZ(4,ea),M=MZ*o;if(E>=M||-E>=M||(d=e-S,s=e-(S+d)+(d-i),d=n-k,l=n-(k+d)+(d-i),d=t-O,c=t-(O+d)+(d-a),d=r-D,u=r-(D+d)+(d-a),s===0&&c===0&&l===0&&u===0)||(M=$Z*o+SZ*Math.abs(E),E+=S*u+D*s-(O*l+k*c),E>=M||-E>=M))return E;C=s*D,f=tn*s,h=f-(f-s),g=s-h,f=tn*D,p=f-(f-D),v=D-p,w=g*v-(C-h*p-g*p-h*v),T=c*k,f=tn*c,h=f-(f-c),g=c-h,f=tn*k,p=f-(f-k),v=k-p,$=g*v-(T-h*p-g*p-h*v),x=w-$,d=w-x,ln[0]=w-(x+d)+(d-$),_=C+x,d=_-C,y=C-(_-d)+(x-d),x=y-T,d=y-x,ln[1]=y-(x+d)+(d-T),R=_+x,d=R-_,ln[2]=_-(R-d)+(x-d),ln[3]=R;const j=cf(4,ea,4,ln,Gb);C=S*u,f=tn*S,h=f-(f-S),g=S-h,f=tn*u,p=f-(f-u),v=u-p,w=g*v-(C-h*p-g*p-h*v),T=O*l,f=tn*O,h=f-(f-O),g=O-h,f=tn*l,p=f-(f-l),v=l-p,$=g*v-(T-h*p-g*p-h*v),x=w-$,d=w-x,ln[0]=w-(x+d)+(d-$),_=C+x,d=_-C,y=C-(_-d)+(x-d),x=y-T,d=y-x,ln[1]=y-(x+d)+(d-T),R=_+x,d=R-_,ln[2]=_-(R-d)+(x-d),ln[3]=R;const F=cf(j,Gb,4,ln,Zb);C=s*u,f=tn*s,h=f-(f-s),g=s-h,f=tn*u,p=f-(f-u),v=u-p,w=g*v-(C-h*p-g*p-h*v),T=c*l,f=tn*c,h=f-(f-c),g=c-h,f=tn*l,p=f-(f-l),v=l-p,$=g*v-(T-h*p-g*p-h*v),x=w-$,d=w-x,ln[0]=w-(x+d)+(d-$),_=C+x,d=_-C,y=C-(_-d)+(x-d),x=y-T,d=y-x,ln[1]=y-(x+d)+(d-T),R=_+x,d=R-_,ln[2]=_-(R-d)+(x-d),ln[3]=R;const W=cf(F,Zb,4,ln,Kb);return Kb[W-1]}function fc(e,t,n,r,i,a){const o=(t-a)*(n-i),s=(e-i)*(r-a),c=o-s,l=Math.abs(o+s);return Math.abs(c)>=EZ*l?c:-RZ(e,t,n,r,i,a,l)}const Xb=Math.pow(2,-52),hc=new Uint32Array(512);class Tl{static from(t,n=DZ,r=NZ){const i=t.length,a=new Float64Array(i*2);for(let o=0;o<i;o++){const s=t[o];a[2*o]=n(s),a[2*o+1]=r(s)}return new Tl(a)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:a}=this,o=t.length>>1;let s=1/0,c=1/0,l=-1/0,u=-1/0;for(let S=0;S<o;S++){const k=t[2*S],O=t[2*S+1];k<s&&(s=k),O<c&&(c=O),k>l&&(l=k),O>u&&(u=O),this._ids[S]=S}const d=(s+l)/2,f=(c+u)/2;let h,g,p;for(let S=0,k=1/0;S<o;S++){const O=lf(d,f,t[2*S],t[2*S+1]);O<k&&(h=S,k=O)}const v=t[2*h],x=t[2*h+1];for(let S=0,k=1/0;S<o;S++){if(S===h)continue;const O=lf(v,x,t[2*S],t[2*S+1]);O<k&&O>0&&(g=S,k=O)}let _=t[2*g],y=t[2*g+1],C=1/0;for(let S=0;S<o;S++){if(S===h||S===g)continue;const k=PZ(v,x,_,y,t[2*S],t[2*S+1]);k<C&&(p=S,C=k)}let w=t[2*p],T=t[2*p+1];if(C===1/0){for(let O=0;O<o;O++)this._dists[O]=t[2*O]-t[0]||t[2*O+1]-t[1];sa(this._ids,this._dists,0,o-1);const S=new Uint32Array(o);let k=0;for(let O=0,D=-1/0;O<o;O++){const E=this._ids[O],M=this._dists[E];M>D&&(S[k++]=E,D=M)}this.hull=S.subarray(0,k),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(fc(v,x,_,y,w,T)<0){const S=g,k=_,O=y;g=p,_=w,y=T,p=S,w=k,T=O}const $=IZ(v,x,_,y,w,T);this._cx=$.x,this._cy=$.y;for(let S=0;S<o;S++)this._dists[S]=lf(t[2*S],t[2*S+1],$.x,$.y);sa(this._ids,this._dists,0,o-1),this._hullStart=h;let R=3;r[h]=n[p]=g,r[g]=n[h]=p,r[p]=n[g]=h,i[h]=0,i[g]=1,i[p]=2,a.fill(-1),a[this._hashKey(v,x)]=h,a[this._hashKey(_,y)]=g,a[this._hashKey(w,T)]=p,this.trianglesLen=0,this._addTriangle(h,g,p,-1,-1,-1);for(let S=0,k,O;S<this._ids.length;S++){const D=this._ids[S],E=t[2*D],M=t[2*D+1];if(S>0&&Math.abs(E-k)<=Xb&&Math.abs(M-O)<=Xb||(k=E,O=M,D===h||D===g||D===p))continue;let j=0;for(let N=0,V=this._hashKey(E,M);N<this._hashSize&&(j=a[(V+N)%this._hashSize],!(j!==-1&&j!==r[j]));N++);j=n[j];let F=j,W;for(;W=r[F],fc(E,M,t[2*F],t[2*F+1],t[2*W],t[2*W+1])>=0;)if(F=W,F===j){F=-1;break}if(F===-1)continue;let B=this._addTriangle(F,D,r[F],-1,-1,i[F]);i[D]=this._legalize(B+2),i[F]=B,R++;let U=r[F];for(;W=r[U],fc(E,M,t[2*U],t[2*U+1],t[2*W],t[2*W+1])<0;)B=this._addTriangle(U,D,W,i[D],-1,i[U]),i[D]=this._legalize(B+2),r[U]=U,R--,U=W;if(F===j)for(;W=n[F],fc(E,M,t[2*W],t[2*W+1],t[2*F],t[2*F+1])<0;)B=this._addTriangle(W,D,F,-1,i[F],i[W]),this._legalize(B+2),i[W]=B,r[F]=F,R--,F=W;this._hullStart=n[D]=F,r[F]=n[U]=D,r[D]=U,a[this._hashKey(E,M)]=D,a[this._hashKey(t[2*F],t[2*F+1])]=F}this.hull=new Uint32Array(R);for(let S=0,k=this._hullStart;S<R;S++)this.hull[S]=k,k=r[k];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(AZ(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:r,coords:i}=this;let a=0,o=0;for(;;){const s=r[t],c=t-t%3;if(o=c+(t+2)%3,s===-1){if(a===0)break;t=hc[--a];continue}const l=s-s%3,u=c+(t+1)%3,d=l+(s+2)%3,f=n[o],h=n[t],g=n[u],p=n[d];if(jZ(i[2*f],i[2*f+1],i[2*h],i[2*h+1],i[2*g],i[2*g+1],i[2*p],i[2*p+1])){n[t]=p,n[s]=f;const x=r[d];if(x===-1){let y=this._hullStart;do{if(this._hullTri[y]===d){this._hullTri[y]=t;break}y=this._hullPrev[y]}while(y!==this._hullStart)}this._link(t,x),this._link(s,r[o]),this._link(o,d);const _=l+(s+1)%3;a<hc.length&&(hc[a++]=_)}else{if(a===0)break;t=hc[--a]}}return o}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,r,i,a,o){const s=this.trianglesLen;return this._triangles[s]=t,this._triangles[s+1]=n,this._triangles[s+2]=r,this._link(s,i),this._link(s+1,a),this._link(s+2,o),this.trianglesLen+=3,s}}function AZ(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function lf(e,t,n,r){const i=e-n,a=t-r;return i*i+a*a}function jZ(e,t,n,r,i,a,o,s){const c=e-o,l=t-s,u=n-o,d=r-s,f=i-o,h=a-s,g=c*c+l*l,p=u*u+d*d,v=f*f+h*h;return c*(d*v-p*h)-l*(u*v-p*f)+g*(u*h-d*f)<0}function PZ(e,t,n,r,i,a){const o=n-e,s=r-t,c=i-e,l=a-t,u=o*o+s*s,d=c*c+l*l,f=.5/(o*l-s*c),h=(l*u-s*d)*f,g=(o*d-c*u)*f;return h*h+g*g}function IZ(e,t,n,r,i,a){const o=n-e,s=r-t,c=i-e,l=a-t,u=o*o+s*s,d=c*c+l*l,f=.5/(o*l-s*c),h=e+(l*u-s*d)*f,g=t+(o*d-c*u)*f;return{x:h,y:g}}function sa(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const a=e[i],o=t[a];let s=i-1;for(;s>=n&&t[e[s]]>o;)e[s+1]=e[s--];e[s+1]=a}else{const i=n+r>>1;let a=n+1,o=r;xo(e,i,a),t[e[n]]>t[e[r]]&&xo(e,n,r),t[e[a]]>t[e[r]]&&xo(e,a,r),t[e[n]]>t[e[a]]&&xo(e,n,a);const s=e[a],c=t[s];for(;;){do a++;while(t[e[a]]<c);do o--;while(t[e[o]]>c);if(o<a)break;xo(e,a,o)}e[n+1]=e[o],e[o]=s,r-a+1>=o-n?(sa(e,t,a,r),sa(e,t,n,o-1)):(sa(e,t,n,o-1),sa(e,t,a,r))}}function xo(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function DZ(e){return e[0]}function NZ(e){return e[1]}const Qb=1e-6;class vi{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,r){t=+t,n=+n,r=+r;const i=t+r,a=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${a}`:(Math.abs(this._x1-i)>Qb||Math.abs(this._y1-a)>Qb)&&(this._+="L"+i+","+a),r&&(this._+=`A${r},${r},0,1,1,${t-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=a}`)}rect(t,n,r,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class Mh{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}class FZ{constructor(t,[n,r,i,a]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((a=+a)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=i,this.xmin=n,this.ymax=a,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:r},vectors:i}=this;let a,o;const s=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let p=0,v=0,x=r.length,_,y;p<x;p+=3,v+=2){const C=r[p]*2,w=r[p+1]*2,T=r[p+2]*2,$=t[C],R=t[C+1],S=t[w],k=t[w+1],O=t[T],D=t[T+1],E=S-$,M=k-R,j=O-$,F=D-R,W=(E*F-M*j)*2;if(Math.abs(W)<1e-9){if(a===void 0){a=o=0;for(const U of n)a+=t[U*2],o+=t[U*2+1];a/=n.length,o/=n.length}const B=1e9*Math.sign((a-$)*F-(o-R)*j);_=($+O)/2-B*F,y=(R+D)/2+B*j}else{const B=1/W,U=E*E+M*M,N=j*j+F*F;_=$+(F*U-M*N)*B,y=R+(E*N-j*U)*B}s[v]=_,s[v+1]=y}let c=n[n.length-1],l,u=c*4,d,f=t[2*c],h,g=t[2*c+1];i.fill(0);for(let p=0;p<n.length;++p)c=n[p],l=u,d=f,h=g,u=c*4,f=t[2*c],g=t[2*c+1],i[l+2]=i[u]=h-g,i[l+3]=i[u+1]=f-d}render(t){const n=t==null?t=new vi:void 0,{delaunay:{halfedges:r,inedges:i,hull:a},circumcenters:o,vectors:s}=this;if(a.length<=1)return null;for(let u=0,d=r.length;u<d;++u){const f=r[u];if(f<u)continue;const h=Math.floor(u/3)*2,g=Math.floor(f/3)*2,p=o[h],v=o[h+1],x=o[g],_=o[g+1];this._renderSegment(p,v,x,_,t)}let c,l=a[a.length-1];for(let u=0;u<a.length;++u){c=l,l=a[u];const d=Math.floor(i[l]/3)*2,f=o[d],h=o[d+1],g=c*4,p=this._project(f,h,s[g+2],s[g+3]);p&&this._renderSegment(f,h,p[0],p[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new vi:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const r=n==null?n=new vi:void 0,i=this._clip(t);if(i===null||!i.length)return;n.moveTo(i[0],i[1]);let a=i.length;for(;i[0]===i[a-2]&&i[1]===i[a-1]&&a>1;)a-=2;for(let o=2;o<a;o+=2)(i[o]!==i[o-2]||i[o+1]!==i[o-1])&&n.lineTo(i[o],i[o+1]);return n.closePath(),r&&r.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,r=t.length/2;n<r;++n){const i=this.cellPolygon(n);i&&(i.index=n,yield i)}}cellPolygon(t){const n=new Mh;return this.renderCell(t,n),n.value()}_renderSegment(t,n,r,i,a){let o;const s=this._regioncode(t,n),c=this._regioncode(r,i);s===0&&c===0?(a.moveTo(t,n),a.lineTo(r,i)):(o=this._clipSegment(t,n,r,i,s,c))&&(a.moveTo(o[0],o[1]),a.lineTo(o[2],o[3]))}contains(t,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(t,n,r)===t}*neighbors(t){const n=this._clip(t);if(n)for(const r of this.delaunay.neighbors(t)){const i=this._clip(r);if(i){e:for(let a=0,o=n.length;a<o;a+=2)for(let s=0,c=i.length;s<c;s+=2)if(n[a]===i[s]&&n[a+1]===i[s+1]&&n[(a+2)%o]===i[(s+c-2)%c]&&n[(a+3)%o]===i[(s+c-1)%c]){yield r;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:a}}=this,o=r[t];if(o===-1)return null;const s=[];let c=o;do{const l=Math.floor(c/3);if(s.push(n[l*2],n[l*2+1]),c=c%3===2?c-2:c+1,a[c]!==t)break;c=i[c]}while(c!==o&&c!==-1);return s}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:r}=this,i=t*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(t,n,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(t,n))}_clipFinite(t,n){const r=n.length;let i=null,a,o,s=n[r-2],c=n[r-1],l,u=this._regioncode(s,c),d,f=0;for(let h=0;h<r;h+=2)if(a=s,o=c,s=n[h],c=n[h+1],l=u,u=this._regioncode(s,c),l===0&&u===0)d=f,f=0,i?i.push(s,c):i=[s,c];else{let g,p,v,x,_;if(l===0){if((g=this._clipSegment(a,o,s,c,l,u))===null)continue;[p,v,x,_]=g}else{if((g=this._clipSegment(s,c,a,o,u,l))===null)continue;[x,_,p,v]=g,d=f,f=this._edgecode(p,v),d&&f&&this._edge(t,d,f,i,i.length),i?i.push(p,v):i=[p,v]}d=f,f=this._edgecode(x,_),d&&f&&this._edge(t,d,f,i,i.length),i?i.push(x,_):i=[x,_]}if(i)d=f,f=this._edgecode(i[0],i[1]),d&&f&&this._edge(t,d,f,i,i.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return i}_clipSegment(t,n,r,i,a,o){const s=a<o;for(s&&([t,n,r,i,a,o]=[r,i,t,n,o,a]);;){if(a===0&&o===0)return s?[r,i,t,n]:[t,n,r,i];if(a&o)return null;let c,l,u=a||o;u&8?(c=t+(r-t)*(this.ymax-n)/(i-n),l=this.ymax):u&4?(c=t+(r-t)*(this.ymin-n)/(i-n),l=this.ymin):u&2?(l=n+(i-n)*(this.xmax-t)/(r-t),c=this.xmax):(l=n+(i-n)*(this.xmin-t)/(r-t),c=this.xmin),a?(t=c,n=l,a=this._regioncode(t,n)):(r=c,i=l,o=this._regioncode(r,i))}}_clipInfinite(t,n,r,i,a,o){let s=Array.from(n),c;if((c=this._project(s[0],s[1],r,i))&&s.unshift(c[0],c[1]),(c=this._project(s[s.length-2],s[s.length-1],a,o))&&s.push(c[0],c[1]),s=this._clipFinite(t,s))for(let l=0,u=s.length,d,f=this._edgecode(s[u-2],s[u-1]);l<u;l+=2)d=f,f=this._edgecode(s[l],s[l+1]),d&&f&&(l=this._edge(t,d,f,s,l),u=s.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(t,n,r,i,a){for(;n!==r;){let o,s;switch(n){case 5:n=4;continue;case 4:n=6,o=this.xmax,s=this.ymin;break;case 6:n=2;continue;case 2:n=10,o=this.xmax,s=this.ymax;break;case 10:n=8;continue;case 8:n=9,o=this.xmin,s=this.ymax;break;case 9:n=1;continue;case 1:n=5,o=this.xmin,s=this.ymin;break}(i[a]!==o||i[a+1]!==s)&&this.contains(t,o,s)&&(i.splice(a,0,o,s),a+=2)}return a}_project(t,n,r,i){let a=1/0,o,s,c;if(i<0){if(n<=this.ymin)return null;(o=(this.ymin-n)/i)<a&&(c=this.ymin,s=t+(a=o)*r)}else if(i>0){if(n>=this.ymax)return null;(o=(this.ymax-n)/i)<a&&(c=this.ymax,s=t+(a=o)*r)}if(r>0){if(t>=this.xmax)return null;(o=(this.xmax-t)/r)<a&&(s=this.xmax,c=n+(a=o)*i)}else if(r<0){if(t<=this.xmin)return null;(o=(this.xmin-t)/r)<a&&(s=this.xmin,c=n+(a=o)*i)}return[s,c]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const r=(n+2)%t.length,i=(n+4)%t.length;(t[n]===t[r]&&t[r]===t[i]||t[n+1]===t[r+1]&&t[r+1]===t[i+1])&&(t.splice(r,2),n-=2)}t.length||(t=null)}return t}}const LZ=2*Math.PI,ta=Math.pow;function BZ(e){return e[0]}function WZ(e){return e[1]}function UZ(e){const{triangles:t,coords:n}=e;for(let r=0;r<t.length;r+=3){const i=2*t[r],a=2*t[r+1],o=2*t[r+2];if((n[o]-n[i])*(n[a+1]-n[i+1])-(n[a]-n[i])*(n[o+1]-n[i+1])>1e-10)return!1}return!0}function zZ(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class tg{static from(t,n=BZ,r=WZ,i){return new tg("length"in t?HZ(t,n,r,i):Float64Array.from(VZ(t,n,r,i)))}constructor(t){this._delaunator=new Tl(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&UZ(t)){this.collinear=Int32Array.from({length:n.length/2},(f,h)=>h).sort((f,h)=>n[2*f]-n[2*h]||n[2*f+1]-n[2*h+1]);const c=this.collinear[0],l=this.collinear[this.collinear.length-1],u=[n[2*c],n[2*c+1],n[2*l],n[2*l+1]],d=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let f=0,h=n.length/2;f<h;++f){const g=zZ(n[2*f],n[2*f+1],d);n[2*f]=g[0],n[2*f+1]=g[1]}this._delaunator=new Tl(n)}else delete this.collinear;const r=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,a=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),s=this._hullIndex.fill(-1);for(let c=0,l=r.length;c<l;++c){const u=a[c%3===2?c-2:c+1];(r[c]===-1||o[u]===-1)&&(o[u]=c)}for(let c=0,l=i.length;c<l;++c)s[i[c]]=c;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],o[i[0]]=1,i.length===2&&(o[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new FZ(this,t)}*neighbors(t){const{inedges:n,hull:r,_hullIndex:i,halfedges:a,triangles:o,collinear:s}=this;if(s){const d=s.indexOf(t);d>0&&(yield s[d-1]),d<s.length-1&&(yield s[d+1]);return}const c=n[t];if(c===-1)return;let l=c,u=-1;do{if(yield u=o[l],l=l%3===2?l-2:l+1,o[l]!==t)return;if(l=a[l],l===-1){const d=r[(i[t]+1)%r.length];d!==u&&(yield d);return}}while(l!==c)}find(t,n,r=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const i=r;let a;for(;(a=this._step(r,t,n))>=0&&a!==r&&a!==i;)r=a;return a}_step(t,n,r){const{inedges:i,hull:a,_hullIndex:o,halfedges:s,triangles:c,points:l}=this;if(i[t]===-1||!l.length)return(t+1)%(l.length>>1);let u=t,d=ta(n-l[t*2],2)+ta(r-l[t*2+1],2);const f=i[t];let h=f;do{let g=c[h];const p=ta(n-l[g*2],2)+ta(r-l[g*2+1],2);if(p<d&&(d=p,u=g),h=h%3===2?h-2:h+1,c[h]!==t)break;if(h=s[h],h===-1){if(h=a[(o[t]+1)%a.length],h!==g&&ta(n-l[h*2],2)+ta(r-l[h*2+1],2)<d)return h;break}}while(h!==f);return u}render(t){const n=t==null?t=new vi:void 0,{points:r,halfedges:i,triangles:a}=this;for(let o=0,s=i.length;o<s;++o){const c=i[o];if(c<o)continue;const l=a[o]*2,u=a[c]*2;t.moveTo(r[l],r[l+1]),t.lineTo(r[u],r[u+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const r=t==null?t=new vi:void 0,{points:i}=this;for(let a=0,o=i.length;a<o;a+=2){const s=i[a],c=i[a+1];t.moveTo(s+n,c),t.arc(s,c,n,0,LZ)}return r&&r.value()}renderHull(t){const n=t==null?t=new vi:void 0,{hull:r,points:i}=this,a=r[0]*2,o=r.length;t.moveTo(i[a],i[a+1]);for(let s=1;s<o;++s){const c=2*r[s];t.lineTo(i[c],i[c+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new Mh;return this.renderHull(t),t.value()}renderTriangle(t,n){const r=n==null?n=new vi:void 0,{points:i,triangles:a}=this,o=a[t*=3]*2,s=a[t+1]*2,c=a[t+2]*2;return n.moveTo(i[o],i[o+1]),n.lineTo(i[s],i[s+1]),n.lineTo(i[c],i[c+1]),n.closePath(),r&&r.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,r=t.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new Mh;return this.renderTriangle(t,n),n.value()}}function HZ(e,t,n,r){const i=e.length,a=new Float64Array(i*2);for(let o=0;o<i;++o){const s=e[o];a[o*2]=t.call(r,s,o,e),a[o*2+1]=n.call(r,s,o,e)}return a}function*VZ(e,t,n,r){let i=0;for(const a of e)yield t.call(r,a,i,e),yield n.call(r,a,i,e),++i}var ng=function(e){return[e.x,e.y]},Vs=wC,uT="cursor",dT="top",qZ=function(e){var t=e.points,n=e.getNodePosition,r=n===void 0?ng:n,i=e.margin,a=i===void 0?Vs:i;return t.map(function(o){var s=r(o),c=s[0],l=s[1];return[c+a.left,l+a.top]})},YZ=function(e){var t=e.points,n=e.width,r=e.height,i=e.margin,a=i===void 0?Vs:i,o=e.debug,s=tg.from(t),c=o?s.voronoi([0,0,a.left+n+a.right,a.top+r+a.bottom]):void 0;return{points:t,delaunay:s,voronoi:c}},fT=function(e){var t=e.points,n=e.getNodePosition,r=n===void 0?ng:n,i=e.width,a=e.height,o=e.margin,s=o===void 0?Vs:o,c=e.debug;return m.useMemo(function(){return YZ({points:qZ({points:t,margin:s,getNodePosition:r}),width:i,height:a,margin:s,debug:c})},[t,i,a,s,c])},GZ=function(e){var t=e.elementRef,n=e.nodes,r=e.getNodePosition,i=r===void 0?ng:r,a=e.delaunay,o=e.setCurrent,s=e.margin,c=s===void 0?Vs:s,l=e.detectionRadius,u=l===void 0?1/0:l,d=e.isInteractive,f=d===void 0||d,h=e.onMouseEnter,g=e.onMouseMove,p=e.onMouseLeave,v=e.onClick,x=e.onTouchStart,_=e.onTouchMove,y=e.onTouchEnd,C=e.enableTouchCrosshair,w=C!==void 0&&C,T=e.tooltip,$=e.tooltipPosition,R=$===void 0?uT:$,S=e.tooltipAnchor,k=S===void 0?dT:S,O=m.useState(null),D=O[0],E=O[1],M=m.useRef(null);m.useEffect(function(){M.current=D},[M,D]);var j=m.useCallback(function(z){if(!t.current)return null;var L=jo(t.current,z),H=L[0],ee=L[1],A=a.find(H,ee),se=A!==void 0?n[A]:null;if(se&&u!==1/0){var ce=i(se),ue=ce[0],we=ce[1];LV(H,ee,ue+c.left,we+c.top)>u&&(A=null,se=null)}return A===null||se===null?null:[A,se]},[t,a,n,i,c,u]),F=Li(),W=F.showTooltipAt,B=F.showTooltipFromEvent,U=F.hideTooltip,N=m.useMemo(function(){if(T)return R==="cursor"?function(z,L){B(T(z),L,k)}:function(z){var L=i(z),H=L[0],ee=L[1];W(T(z),[H+c.left,ee+c.top],k)}},[W,B,T,R,k,i,c]),V=m.useCallback(function(z){var L=j(z);if(E(L),o==null||o(L?L[1]:null),L){var H=L[1];N==null||N(H,z),h==null||h(L[1],z)}},[j,E,o,N,h]),X=m.useCallback(function(z){var L=j(z);if(E(L),L){var H=L[0],ee=L[1];if(o==null||o(ee),N==null||N(ee,z),M.current){var A=M.current,se=A[0],ce=A[1];H!==se?p==null||p(ce,z):g==null||g(ee,z)}else h==null||h(ee,z)}else o==null||o(null),U==null||U(),M.current&&(p==null||p(M.current[1],z))},[j,E,M,h,g,p,N,U]),ne=m.useCallback(function(z){E(null),o==null||o(null),U(),p&&M.current&&p(M.current[1],z)},[E,o,M,U,p]),K=m.useCallback(function(z){var L=j(z);E(L),L&&(v==null||v(L[1],z))},[j,E,v]),J=m.useCallback(function(z){var L=j(z);w&&(E(L),o==null||o(L?L[1]:null)),L&&(x==null||x(L[1],z))},[j,E,o,w,x]),q=m.useCallback(function(z){var L=j(z);w&&(E(L),o==null||o(L?L[1]:null)),L&&(_==null||_(L[1],z))},[j,E,o,w,_]),G=m.useCallback(function(z){w&&(E(null),o==null||o(null)),y&&M.current&&y(M.current[1],z)},[w,E,o,y,M]);return{current:D,handleMouseEnter:f?V:void 0,handleMouseMove:f?X:void 0,handleMouseLeave:f?ne:void 0,handleClick:f?K:void 0,handleTouchStart:f?J:void 0,handleTouchMove:f?q:void 0,handleTouchEnd:f?G:void 0}},ZZ=function(e){var t=e.nodes,n=e.width,r=e.height,i=e.margin,a=i===void 0?Vs:i,o=e.getNodePosition,s=e.setCurrent,c=e.onMouseEnter,l=e.onMouseMove,u=e.onMouseLeave,d=e.onClick,f=e.onTouchStart,h=e.onTouchMove,g=e.onTouchEnd,p=e.enableTouchCrosshair,v=p!==void 0&&p,x=e.detectionRadius,_=x===void 0?1/0:x,y=e.tooltip,C=e.tooltipPosition,w=C===void 0?uT:C,T=e.tooltipAnchor,$=T===void 0?dT:T,R=e.debug,S=m.useRef(null),k=fT({points:t,getNodePosition:o,width:n,height:r,margin:a,debug:R}),O=k.delaunay,D=k.voronoi,E=GZ({elementRef:S,nodes:t,delaunay:O,margin:a,detectionRadius:_,setCurrent:s,onMouseEnter:c,onMouseMove:l,onMouseLeave:u,onClick:d,onTouchStart:f,onTouchMove:h,onTouchEnd:g,enableTouchCrosshair:v,tooltip:y,tooltipPosition:w,tooltipAnchor:$}),M=E.current,j=E.handleMouseEnter,F=E.handleMouseMove,W=E.handleMouseLeave,B=E.handleClick,U=E.handleTouchStart,N=E.handleTouchMove,V=E.handleTouchEnd,X=m.useMemo(function(){if(R&&D)return D.render()},[R,D]);return b.jsxs("g",{ref:S,transform:"translate("+-a.left+","+-a.top+")",children:[R&&D&&b.jsxs(b.Fragment,{children:[b.jsx("path",{d:X,stroke:"red",strokeWidth:1,opacity:.75}),_<1/0&&b.jsx("path",{stroke:"red",strokeWidth:.35,fill:"none",d:O.renderPoints(void 0,_)}),M&&b.jsx("path",{fill:"pink",opacity:.35,d:D.renderCell(M[0])})]}),b.jsx("rect",{"data-ref":"mesh-interceptor",width:a.left+n+a.right,height:a.top+r+a.bottom,fill:"red",opacity:0,style:{cursor:"auto"},onMouseEnter:j,onMouseMove:F,onMouseLeave:W,onTouchStart:U,onTouchMove:N,onTouchEnd:V,onClick:B})]})},KZ=function(e,t){e.save(),e.globalAlpha=.75,e.beginPath(),t.render(e),e.strokeStyle="red",e.lineWidth=1,e.stroke(),e.restore()},XZ=function(e,t,n){e.save(),e.globalAlpha=.35,e.beginPath(),t.renderCell(n,e),e.fillStyle="pink",e.fill(),e.restore()};function hn(){return hn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hn.apply(this,arguments)}var rg=m.memo(function(e){var t=e.point;return b.jsx(Zp,{id:b.jsxs("span",{children:["x: ",b.jsx("strong",{children:t.data.xFormatted}),", y:"," ",b.jsx("strong",{children:t.data.yFormatted})]}),enableChip:!0,color:t.serieColor})}),hT=m.memo(function(e){var t=e.slice,n=e.axis,r=ht(),i=n==="x"?"y":"x";return b.jsx(y_,{rows:t.points.map(function(a){return[b.jsx(b_,{color:a.serieColor,style:r.tooltip.chip},"chip"),a.serieId,b.jsx("span",{style:r.tooltip.tableCellValue,children:a.data[i+"Formatted"]},"value")]})})}),pT={curve:"linear",xScale:{type:"point"},yScale:{type:"linear",min:0,max:"auto"},layers:["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"],axisBottom:{},axisLeft:{},enableGridX:!0,enableGridY:!0,enablePoints:!0,pointSize:6,pointColor:{from:"color"},pointBorderWidth:0,pointBorderColor:{theme:"background"},enablePointLabel:!1,pointLabel:"yFormatted",colors:{scheme:"nivo"},enableArea:!1,areaBaselineValue:0,areaOpacity:.2,areaBlendMode:"normal",lineWidth:2,legends:[],isInteractive:!0,tooltip:rg,enableSlices:!1,debugSlices:!1,sliceTooltip:hT,debugMesh:!1,enableCrosshair:!0,crosshairType:"bottom-left"},Ar=hn({},pT,{enablePointLabel:!1,useMesh:!1,enableTouchCrosshair:!1,animate:!0,motionConfig:"gentle",defs:[],fill:[],role:"img"});hn({},pT,{pixelRatio:typeof window<"u"&&window.devicePixelRatio||1});var QZ=function(e){var t=e.curve;return m.useMemo(function(){return Fm().defined(function(n){return n.x!==null&&n.y!==null}).x(function(n){return n.x}).y(function(n){return n.y}).curve(_C(t))},[t])},JZ=function(e){var t=e.curve,n=e.yScale,r=e.areaBaselineValue;return m.useMemo(function(){return gU().defined(function(i){return i.x!==null&&i.y!==null}).x(function(i){return i.x}).y1(function(i){return i.y}).curve(_C(t)).y0(n(r))},[t,n,r])},eK=function(e){var t=e.componentId,n=e.enableSlices,r=e.points,i=e.width,a=e.height;return m.useMemo(function(){if(n===!1)return[];if(n==="x"){var o=new Map;return r.forEach(function(c){c.data.x!==null&&c.data.y!==null&&(o.has(c.x)?o.get(c.x).push(c):o.set(c.x,[c]))}),Array.from(o.entries()).sort(function(c,l){return c[0]-l[0]}).map(function(c,l,u){var d,f,h=c[0],g=c[1],p=u[l-1],v=u[l+1];return d=p?h-(h-p[0])/2:h,f=v?h-d+(v[0]-h)/2:i-d,{id:"slice:"+t+":"+h,x0:d,x:h,y0:0,y:0,width:f,height:a,points:g.reverse()}})}if(n==="y"){var s=new Map;return r.forEach(function(c){c.data.x!==null&&c.data.y!==null&&(s.has(c.y)?s.get(c.y).push(c):s.set(c.y,[c]))}),Array.from(s.entries()).sort(function(c,l){return c[0]-l[0]}).map(function(c,l,u){var d,f,h=c[0],g=c[1],p=u[l-1],v=u[l+1];return d=p?h-(h-p[0])/2:h,f=v?h-d+(v[0]-h)/2:a-d,{id:h,x0:0,x:0,y0:d,y:h,width:i,height:f,points:g.reverse()}})}},[t,n,a,r,i])},tK="line",mT=function(e){var t=e.data,n=e.xScale,r=n===void 0?Ar.xScale:n,i=e.xFormat,a=e.yScale,o=a===void 0?Ar.yScale:a,s=e.yFormat,c=e.width,l=e.height,u=e.colors,d=u===void 0?Ar.colors:u,f=e.curve,h=f===void 0?Ar.curve:f,g=e.areaBaselineValue,p=g===void 0?Ar.areaBaselineValue:g,v=e.pointColor,x=v===void 0?Ar.pointColor:v,_=e.pointBorderColor,y=_===void 0?Ar.pointBorderColor:_,C=e.enableSlices,w=C===void 0?Ar.enableSlicesTooltip:C,T=m.useState(kZ(tK))[0],$=Ma(i),R=Ma(s),S=Xm(d,"id"),k=ht(),O=ar(x,k),D=ar(y,k),E=m.useState([]),M=E[0],j=E[1],F=m.useMemo(function(){return uZ(t.filter(function(q){return M.indexOf(q.id)===-1}),r,o,c,l)},[t,M,r,o,c,l]),W=F.xScale,B=F.yScale,U=F.series,N=m.useMemo(function(){var q=t.map(function(z){return{id:z.id,label:z.id,color:S(z)}}),G=q.map(function(z){return hn({},U.find(function(L){return L.id===z.id}),{color:z.color})}).filter(function(z){return!!z.id});return{legendData:q.map(function(z){return hn({},z,{hidden:!G.find(function(L){return L.id===z.id})})}).reverse(),series:G}},[t,U,S]),V=N.legendData,X=N.series,ne=m.useCallback(function(q){j(function(G){return G.indexOf(q)>-1?G.filter(function(z){return z!==q}):[].concat(G,[q])})},[]),K=function(q){var G=q.series,z=q.getPointColor,L=q.getPointBorderColor,H=q.formatX,ee=q.formatY;return m.useMemo(function(){return G.reduce(function(A,se){return[].concat(A,se.data.filter(function(ce){return ce.position.x!==null&&ce.position.y!==null}).map(function(ce,ue){var we={id:se.id+"."+ue,index:A.length+ue,serieId:se.id,serieColor:se.color,x:ce.position.x,y:ce.position.y};return we.color=z(se),we.borderColor=L(we),we.data=hn({},ce.data,{xFormatted:H(ce.data.x),yFormatted:ee(ce.data.y)}),we}))},[])},[G,z,L,H,ee])}({series:X,getPointColor:O,getPointBorderColor:D,formatX:$,formatY:R}),J=eK({componentId:T,enableSlices:w,points:K,width:c,height:l});return{legendData:V,toggleSerie:ne,lineGenerator:QZ({curve:h}),areaGenerator:JZ({curve:h,yScale:B,areaBaselineValue:p}),getColor:S,series:X,xScale:W,yScale:B,slices:J,points:K}},nK=function(e){var t=e.areaBlendMode,n=e.areaOpacity,r=e.color,i=e.fill,a=e.path,o=mn(),s=o.animate,c=o.config,l=Ym(a),u=cr({color:r,config:c,immediate:!s});return b.jsx(ft.path,{d:l,fill:i||u.color,fillOpacity:n,strokeWidth:0,style:{mixBlendMode:t}})},rK=m.memo(function(e){var t=e.areaGenerator,n=e.areaOpacity,r=e.areaBlendMode,i=e.lines.slice(0).reverse();return b.jsx("g",{children:i.map(function(a){return b.jsx(nK,hn({path:t(a.data.map(function(o){return o.position}))},hn({areaOpacity:n,areaBlendMode:r},a)),a.id)})})}),iK=m.memo(function(e){var t=e.lineGenerator,n=e.points,r=e.color,i=e.thickness,a=m.useMemo(function(){return t(n)},[t,n]),o=Ym(a);return b.jsx(ft.path,{d:o,fill:"none",strokeWidth:i,stroke:r})}),aK=m.memo(function(e){var t=e.lines,n=e.lineGenerator,r=e.lineWidth;return t.slice(0).reverse().map(function(i){var a=i.id,o=i.data,s=i.color;return b.jsx(iK,{id:a,points:o.map(function(c){return c.position}),lineGenerator:n,color:s,thickness:r},a)})}),oK=m.memo(function(e){var t=e.slice,n=e.slices,r=e.axis,i=e.debug,a=e.tooltip,o=e.isCurrent,s=e.setCurrent,c=e.onMouseEnter,l=e.onMouseMove,u=e.onMouseLeave,d=e.onClick,f=e.onTouchStart,h=e.onTouchMove,g=e.onTouchEnd,p=Li(),v=p.showTooltipFromEvent,x=p.hideTooltip,_=m.useCallback(function(S){v(m.createElement(a,{slice:t,axis:r}),S,"right"),s(t),c&&c(t,S)},[v,a,t,r,s,c]),y=m.useCallback(function(S){v(m.createElement(a,{slice:t,axis:r}),S,"right"),l&&l(t,S)},[v,a,t,r,l]),C=m.useCallback(function(S){x(),s(null),u&&u(t,S)},[x,s,u,t]),w=m.useCallback(function(S){d&&d(t,S)},[t,d]),T=m.useCallback(function(S){v(m.createElement(a,{slice:t,axis:r}),S,"right"),s(t),f&&f(t,S)},[r,f,s,v,t,a]),$=m.useCallback(function(S){var k=S.touches[0],O=document.elementFromPoint(k.clientX,k.clientY),D=O==null?void 0:O.getAttribute("data-ref");if(D){var E=n.find(function(M){return M.id===D});E&&(v(m.createElement(a,{slice:E,axis:r}),S,"right"),s(E))}h&&h(t,S)},[r,h,s,v,t,n,a]),R=m.useCallback(function(S){x(),s(null),g&&g(t,S)},[x,s,g,t]);return b.jsx("rect",{x:t.x0,y:t.y0,width:t.width,height:t.height,stroke:"red",strokeWidth:i?1:0,strokeOpacity:.75,fill:"red",fillOpacity:o&&i?.35:0,onMouseEnter:_,onMouseMove:y,onMouseLeave:C,onClick:w,onTouchStart:T,onTouchMove:$,onTouchEnd:R,"data-ref":t.id})}),sK=m.memo(function(e){var t=e.slices,n=e.axis,r=e.debug,i=e.height,a=e.tooltip,o=e.current,s=e.setCurrent,c=e.onMouseEnter,l=e.onMouseMove,u=e.onMouseLeave,d=e.onClick,f=e.onTouchStart,h=e.onTouchMove,g=e.onTouchEnd;return t.map(function(p){return b.jsx(oK,{slice:p,slices:t,axis:n,debug:r,height:i,tooltip:a,setCurrent:s,isCurrent:o!==null&&o.id===p.id,onMouseEnter:c,onMouseMove:l,onMouseLeave:u,onClick:d,onTouchStart:f,onTouchMove:h,onTouchEnd:g},p.id)})}),cK=m.memo(function(e){var t=e.points,n=e.symbol,r=e.size,i=e.borderWidth,a=e.enableLabel,o=e.label,s=e.labelYOffset,c=ht(),l=FV(o),u=t.slice(0).reverse().map(function(d){return{id:d.id,x:d.x,y:d.y,datum:d.data,fill:d.color,stroke:d.borderColor,label:a?l(d):null}});return b.jsx("g",{children:u.map(function(d){return b.jsx(IV,{x:d.x,y:d.y,datum:d.datum,symbol:n,size:r,color:d.fill,borderWidth:i,borderColor:d.stroke,label:d.label,labelYOffset:s,theme:c},d.id)})})}),lK=m.memo(function(e){var t=e.points,n=e.width,r=e.height,i=e.margin,a=e.setCurrent,o=e.onMouseEnter,s=e.onMouseMove,c=e.onMouseLeave,l=e.onClick,u=e.onTouchStart,d=e.onTouchMove,f=e.onTouchEnd,h=e.tooltip,g=e.debug,p=e.enableTouchCrosshair,v=Li(),x=v.showTooltipAt,_=v.hideTooltip,y=m.useCallback(function(k,O){x(m.createElement(h,{point:k}),[k.x+i.left,k.y+i.top],"top"),o&&o(k,O)},[x,h,o,i]),C=m.useCallback(function(k,O){x(m.createElement(h,{point:k}),[k.x+i.left,k.y+i.top],"top"),s&&s(k,O)},[x,h,i.left,i.top,s]),w=m.useCallback(function(k,O){_(),c&&c(k,O)},[_,c]),T=m.useCallback(function(k,O){l&&l(k,O)},[l]),$=m.useCallback(function(k,O){x(m.createElement(h,{point:k}),[k.x+i.left,k.y+i.top],"top"),u&&u(k,O)},[i.left,i.top,u,x,h]),R=m.useCallback(function(k,O){x(m.createElement(h,{point:k}),[k.x+i.left,k.y+i.top],"top"),d&&d(k,O)},[i.left,i.top,d,x,h]),S=m.useCallback(function(k,O){_(),f&&f(k,O)},[f,_]);return b.jsx(ZZ,{nodes:t,width:n,height:r,setCurrent:a,onMouseEnter:y,onMouseMove:C,onMouseLeave:w,onClick:T,onTouchStart:$,onTouchMove:R,onTouchEnd:S,enableTouchCrosshair:p,debug:g})}),uK=DC(function(e){var t=e.data,n=e.xScale,r=n===void 0?{type:"point"}:n,i=e.xFormat,a=e.yScale,o=a===void 0?{type:"linear",min:0,max:"auto"}:a,s=e.yFormat,c=e.layers,l=c===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:c,u=e.curve,d=u===void 0?"linear":u,f=e.areaBaselineValue,h=f===void 0?0:f,g=e.colors,p=g===void 0?{scheme:"nivo"}:g,v=e.margin,x=e.width,_=e.height,y=e.axisTop,C=e.axisRight,w=e.axisBottom,T=w===void 0?{}:w,$=e.axisLeft,R=$===void 0?{}:$,S=e.enableGridX,k=S===void 0||S,O=e.enableGridY,D=O===void 0||O,E=e.gridXValues,M=e.gridYValues,j=e.lineWidth,F=j===void 0?2:j,W=e.enableArea,B=W!==void 0&&W,U=e.areaOpacity,N=U===void 0?.2:U,V=e.areaBlendMode,X=V===void 0?"normal":V,ne=e.enablePoints,K=ne===void 0||ne,J=e.pointSymbol,q=e.pointSize,G=q===void 0?6:q,z=e.pointColor,L=z===void 0?{from:"color"}:z,H=e.pointBorderWidth,ee=H===void 0?0:H,A=e.pointBorderColor,se=A===void 0?{theme:"background"}:A,ce=e.enablePointLabel,ue=ce!==void 0&&ce,we=e.pointLabel,Te=we===void 0?"data.yFormatted":we,at=e.pointLabelYOffset,tt=e.defs,Be=tt===void 0?[]:tt,Ke=e.fill,Ye=Ke===void 0?[]:Ke,de=e.markers,ke=e.legends,Oe=ke===void 0?[]:ke,ve=e.isInteractive,Ie=ve===void 0||ve,Xe=e.useMesh,It=Xe!==void 0&&Xe,mt=e.debugMesh,Je=mt!==void 0&&mt,bt=e.onMouseEnter,At=e.onMouseMove,it=e.onMouseLeave,gt=e.onClick,yt=e.onTouchStart,Lt=e.onTouchMove,$e=e.onTouchEnd,Pe=e.tooltip,ze=Pe===void 0?rg:Pe,nt=e.enableSlices,vt=nt!==void 0&&nt,kt=e.debugSlices,Xt=kt!==void 0&&kt,Dt=e.sliceTooltip,Bt=Dt===void 0?hT:Dt,Ht=e.enableCrosshair,Mt=Ht===void 0||Ht,Wt=e.crosshairType,Jt=Wt===void 0?"bottom-left":Wt,Vt=e.enableTouchCrosshair,fe=Vt!==void 0&&Vt,ye=e.role,Ee=ye===void 0?"img":ye,qe=Us(x,_,v),Ge=qe.margin,ot=qe.innerWidth,P=qe.innerHeight,re=qe.outerWidth,Z=qe.outerHeight,te=mT({data:t,xScale:r,xFormat:i,yScale:o,yFormat:s,width:ot,height:P,colors:p,curve:d,areaBaselineValue:h,pointColor:L,pointBorderColor:se,enableSlices:vt}),ge=te.legendData,Ce=te.toggleSerie,pe=te.lineGenerator,be=te.areaGenerator,Ae=te.series,Me=te.xScale,et=te.yScale,Nt=te.slices,wt=te.points,Ut=ht(),le=ar(L,Ut),cn=ar(se,Ut),Ft=m.useState(null),dr=Ft[0],lg=Ft[1],ug=m.useState(null),Qa=ug[0],dg=ug[1],ni={grid:b.jsx(cT,{theme:Ut,width:ot,height:P,xScale:k?Me:null,yScale:D?et:null,xValues:E,yValues:M},"grid"),markers:b.jsx(IC,{markers:de,width:ot,height:P,xScale:Me,yScale:et,theme:Ut},"markers"),axes:b.jsx(sT,{xScale:Me,yScale:et,width:ot,height:P,theme:Ut,top:y,right:C,bottom:T,left:R},"axes"),areas:null,lines:b.jsx(aK,{lines:Ae,lineGenerator:pe,lineWidth:F},"lines"),slices:null,points:null,crosshair:null,mesh:null,legends:Oe.map(function(ri,hd){return b.jsx(Jm,hn({},ri,{containerWidth:ot,containerHeight:P,data:ri.data||ge,theme:Ut,toggleSerie:ri.toggleSerie?Ce:void 0}),"legend."+hd)})},BT=Km(Be,Ae,Ye);return B&&(ni.areas=b.jsx(rK,{areaGenerator:be,areaOpacity:N,areaBlendMode:X,lines:Ae},"areas")),Ie&&vt!==!1&&(ni.slices=b.jsx(sK,{slices:Nt,axis:vt,debug:Xt,height:P,tooltip:Bt,current:Qa,setCurrent:dg,onMouseEnter:bt,onMouseMove:At,onMouseLeave:it,onClick:gt,onTouchStart:yt,onTouchMove:Lt,onTouchEnd:$e},"slices")),K&&(ni.points=b.jsx(cK,{points:wt,symbol:J,size:G,color:le,borderWidth:ee,borderColor:cn,enableLabel:ue,label:Te,labelYOffset:at},"points")),Ie&&Mt&&(dr!==null&&(ni.crosshair=b.jsx(oh,{width:ot,height:P,x:dr.x,y:dr.y,type:Jt},"crosshair")),Qa!==null&&(ni.crosshair=b.jsx(oh,{width:ot,height:P,x:Qa.x,y:Qa.y,type:vt},"crosshair"))),Ie&&It&&vt===!1&&(ni.mesh=b.jsx(lK,{points:wt,width:ot,height:P,margin:Ge,current:dr,setCurrent:lg,onMouseEnter:bt,onMouseMove:At,onMouseLeave:it,onClick:gt,onTouchStart:yt,onTouchMove:Lt,onTouchEnd:$e,tooltip:ze,enableTouchCrosshair:fe,debug:Je},"mesh")),b.jsx(ld,{defs:BT,width:re,height:Z,margin:Ge,role:Ee,children:l.map(function(ri,hd){return typeof ri=="function"?b.jsx(m.Fragment,{children:ri(hn({},e,{innerWidth:ot,innerHeight:P,series:Ae,slices:Nt,points:wt,xScale:Me,yScale:et,lineGenerator:pe,areaGenerator:be,currentPoint:dr,setCurrentPoint:lg,currentSlice:Qa,setCurrentSlice:dg}))},hd):ni[ri]})})}),dK=function(e){return b.jsx(Ka,{children:function(t){var n=t.width,r=t.height;return b.jsx(uK,hn({width:n,height:r},e))}})},fK=DC(function(e){var t=m.useRef(null),n=e.width,r=e.height,i=e.margin,a=e.pixelRatio,o=a===void 0?typeof window<"u"&&window.devicePixelRatio||1:a,s=e.data,c=e.xScale,l=c===void 0?{type:"point"}:c,u=e.xFormat,d=e.yScale,f=d===void 0?{type:"linear",min:0,max:"auto"}:d,h=e.yFormat,g=e.curve,p=g===void 0?"linear":g,v=e.layers,x=v===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:v,_=e.colors,y=_===void 0?{scheme:"nivo"}:_,C=e.lineWidth,w=C===void 0?2:C,T=e.enableArea,$=T!==void 0&&T,R=e.areaBaselineValue,S=R===void 0?0:R,k=e.areaOpacity,O=k===void 0?.2:k,D=e.enablePoints,E=D===void 0||D,M=e.pointSize,j=M===void 0?6:M,F=e.pointColor,W=F===void 0?{from:"color"}:F,B=e.pointBorderWidth,U=B===void 0?0:B,N=e.pointBorderColor,V=N===void 0?{theme:"background"}:N,X=e.enableGridX,ne=X===void 0||X,K=e.gridXValues,J=e.enableGridY,q=J===void 0||J,G=e.gridYValues,z=e.axisTop,L=e.axisRight,H=e.axisBottom,ee=H===void 0?{}:H,A=e.axisLeft,se=A===void 0?{}:A,ce=e.legends,ue=ce===void 0?[]:ce,we=e.isInteractive,Te=we===void 0||we,at=e.debugMesh,tt=at!==void 0&&at,Be=e.onMouseLeave,Ke=e.onClick,Ye=e.tooltip,de=Ye===void 0?rg:Ye,ke=e.canvasRef,Oe=Us(n,r,i),ve=Oe.margin,Ie=Oe.innerWidth,Xe=Oe.innerHeight,It=Oe.outerWidth,mt=Oe.outerHeight,Je=ht(),bt=m.useState(null),At=bt[0],it=bt[1],gt=mT({data:s,xScale:l,xFormat:u,yScale:f,yFormat:h,width:Ie,height:Xe,colors:y,curve:p,areaBaselineValue:S,pointColor:W,pointBorderColor:V}),yt=gt.lineGenerator,Lt=gt.areaGenerator,$e=gt.series,Pe=gt.xScale,ze=gt.yScale,nt=gt.points,vt=fT({points:nt,width:Ie,height:Xe,debug:tt}),kt=vt.delaunay,Xt=vt.voronoi;m.useEffect(function(){ke&&(ke.current=t.current),t.current.width=It*o,t.current.height=mt*o;var fe=t.current.getContext("2d");fe.scale(o,o),fe.fillStyle=Je.background,fe.fillRect(0,0,It,mt),fe.translate(ve.left,ve.top),x.forEach(function(ye){if(typeof ye=="function"&&ye({ctx:fe,innerWidth:Ie,innerHeight:Xe,series:$e,points:nt,xScale:Pe,yScale:ze,lineWidth:w,lineGenerator:yt,areaGenerator:Lt,currentPoint:At,setCurrentPoint:it}),ye==="grid"&&Je.grid.line.strokeWidth>0&&(fe.lineWidth=Je.grid.line.strokeWidth,fe.strokeStyle=Je.grid.line.stroke,ne&&Cl(fe,{width:Ie,height:Xe,scale:Pe,axis:"x",values:K}),q&&Cl(fe,{width:Ie,height:Xe,scale:ze,axis:"y",values:G})),ye==="axes"&&lT(fe,{xScale:Pe,yScale:ze,width:Ie,height:Xe,top:z,right:L,bottom:ee,left:se,theme:Je}),ye==="areas"&&$===!0){fe.save(),fe.globalAlpha=O,Lt.context(fe);for(var Ee=$e.length-1;Ee>=0;Ee--)fe.fillStyle=$e[Ee].color,fe.beginPath(),Lt($e[Ee].data.map(function(Ge){return Ge.position})),fe.fill();fe.restore()}if(ye==="lines"&&(yt.context(fe),$e.forEach(function(Ge){fe.strokeStyle=Ge.color,fe.lineWidth=w,fe.beginPath(),yt(Ge.data.map(function(ot){return ot.position})),fe.stroke()})),ye==="points"&&E===!0&&j>0&&nt.forEach(function(Ge){fe.fillStyle=Ge.color,fe.beginPath(),fe.arc(Ge.x,Ge.y,j/2,0,2*Math.PI),fe.fill(),U>0&&(fe.strokeStyle=Ge.borderColor,fe.lineWidth=U,fe.stroke())}),ye==="mesh"&&tt===!0&&(KZ(fe,Xt),At&&XZ(fe,Xt,At.index)),ye==="legends"){var qe=$e.map(function(Ge){return{id:Ge.id,label:Ge.id,color:Ge.color}}).reverse();ue.forEach(function(Ge){YC(fe,hn({},Ge,{data:Ge.data||qe,containerWidth:Ie,containerHeight:Xe,theme:Je}))})}})},[t,It,mt,x,Je,yt,$e,Pe,ze,ne,K,q,G,z,L,ee,se,ue,nt,E,j,At]);var Dt=m.useCallback(function(fe){var ye=jo(t.current,fe),Ee=ye[0],qe=ye[1];if(!FC(ve.left,ve.top,Ie,Xe,Ee,qe))return null;var Ge=kt.find(Ee-ve.left,qe-ve.top);return nt[Ge]},[t,ve,Ie,Xe,kt]),Bt=Li(),Ht=Bt.showTooltipFromEvent,Mt=Bt.hideTooltip,Wt=m.useCallback(function(fe){var ye=Dt(fe);it(ye),ye?Ht(m.createElement(de,{point:ye}),fe):Mt()},[Dt,it,Ht,Mt,de]),Jt=m.useCallback(function(fe){Mt(),it(null),At&&Be&&Be(At,fe)},[Mt,it,Be]),Vt=m.useCallback(function(fe){if(Ke){var ye=Dt(fe);ye&&Ke(ye,fe)}},[Dt,Ke]);return b.jsx("canvas",{ref:t,width:It*o,height:mt*o,style:{width:It,height:mt,cursor:Te?"auto":"normal"},onMouseEnter:Te?Wt:void 0,onMouseMove:Te?Wt:void 0,onMouseLeave:Te?Jt:void 0,onClick:Te?Vt:void 0})}),hK=m.forwardRef(function(e,t){return b.jsx(fK,hn({},e,{canvasRef:t}))});m.forwardRef(function(e,t){return b.jsx(Ka,{children:function(n){var r=n.width,i=n.height;return b.jsx(hK,hn({width:r,height:i},e,{ref:t}))}})});var pK=QC;function mK(e,t){var n=[];return pK(e,function(r,i,a){t(r,i,a)&&n.push(r)}),n}var gK=mK,vK=hC,bK=gK,yK=eg,xK=Cn;function _K(e,t){var n=xK(e)?vK:bK;return n(e,yK(t))}var wK=_K;const CK=Rt(wK);var TK=Or,kK=Nn,SK="[object Number]";function OK(e){return typeof e=="number"||kK(e)&&TK(e)==SK}var EK=OK;const Jb=Rt(EK);function MK(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var $K=MK,RK=Va,AK=Ws;function jK(e,t){return e&&RK(t,AK(t),e)}var PK=jK,IK=Va,DK=Fs;function NK(e,t){return e&&IK(t,DK(t),e)}var FK=NK,LK=Va,BK=Vm;function WK(e,t){return LK(e,BK(e),t)}var UK=WK,zK=zm,HK=tm,VK=Vm,qK=pC,YK=Object.getOwnPropertySymbols,GK=YK?function(e){for(var t=[];e;)zK(t,VK(e)),e=HK(e);return t}:qK,gT=GK,ZK=Va,KK=gT;function XK(e,t){return ZK(e,KK(e),t)}var QK=XK,JK=fC,eX=gT,tX=Fs;function nX(e){return JK(e,tX,eX)}var vT=nX,rX=Object.prototype,iX=rX.hasOwnProperty;function aX(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&iX.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var oX=aX,sX=em;function cX(e,t){var n=t?sX(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var lX=cX,uX=/\w*$/;function dX(e){var t=new e.constructor(e.source,uX.exec(e));return t.lastIndex=e.lastIndex,t}var fX=dX,ey=La,ty=ey?ey.prototype:void 0,ny=ty?ty.valueOf:void 0;function hX(e){return ny?Object(ny.call(e)):{}}var pX=hX,mX=em,gX=lX,vX=fX,bX=pX,yX=$_,xX="[object Boolean]",_X="[object Date]",wX="[object Map]",CX="[object Number]",TX="[object RegExp]",kX="[object Set]",SX="[object String]",OX="[object Symbol]",EX="[object ArrayBuffer]",MX="[object DataView]",$X="[object Float32Array]",RX="[object Float64Array]",AX="[object Int8Array]",jX="[object Int16Array]",PX="[object Int32Array]",IX="[object Uint8Array]",DX="[object Uint8ClampedArray]",NX="[object Uint16Array]",FX="[object Uint32Array]";function LX(e,t,n){var r=e.constructor;switch(t){case EX:return mX(e);case xX:case _X:return new r(+e);case MX:return gX(e,n);case $X:case RX:case AX:case jX:case PX:case IX:case DX:case NX:case FX:return yX(e,n);case wX:return new r;case CX:case SX:return new r(e);case TX:return vX(e);case kX:return new r;case OX:return bX(e)}}var BX=LX,WX=od,UX=Nn,zX="[object Map]";function HX(e){return UX(e)&&WX(e)==zX}var VX=HX,qX=VX,YX=Ha,ry=vu,iy=ry&&ry.isMap,GX=iy?YX(iy):qX,ZX=GX,KX=od,XX=Nn,QX="[object Set]";function JX(e){return XX(e)&&KX(e)==QX}var eQ=JX,tQ=eQ,nQ=Ha,ay=vu,oy=ay&&ay.isSet,rQ=oy?nQ(oy):tQ,iQ=rQ,aQ=pu,oQ=$K,sQ=sm,cQ=PK,lQ=FK,uQ=E_,dQ=R_,fQ=UK,hQ=QK,pQ=mC,mQ=vT,gQ=od,vQ=oX,bQ=BX,yQ=j_,xQ=Cn,_Q=gu,wQ=ZX,CQ=ur,TQ=iQ,kQ=Ws,SQ=Fs,OQ=1,EQ=2,MQ=4,bT="[object Arguments]",$Q="[object Array]",RQ="[object Boolean]",AQ="[object Date]",jQ="[object Error]",yT="[object Function]",PQ="[object GeneratorFunction]",IQ="[object Map]",DQ="[object Number]",xT="[object Object]",NQ="[object RegExp]",FQ="[object Set]",LQ="[object String]",BQ="[object Symbol]",WQ="[object WeakMap]",UQ="[object ArrayBuffer]",zQ="[object DataView]",HQ="[object Float32Array]",VQ="[object Float64Array]",qQ="[object Int8Array]",YQ="[object Int16Array]",GQ="[object Int32Array]",ZQ="[object Uint8Array]",KQ="[object Uint8ClampedArray]",XQ="[object Uint16Array]",QQ="[object Uint32Array]",Ct={};Ct[bT]=Ct[$Q]=Ct[UQ]=Ct[zQ]=Ct[RQ]=Ct[AQ]=Ct[HQ]=Ct[VQ]=Ct[qQ]=Ct[YQ]=Ct[GQ]=Ct[IQ]=Ct[DQ]=Ct[xT]=Ct[NQ]=Ct[FQ]=Ct[LQ]=Ct[BQ]=Ct[ZQ]=Ct[KQ]=Ct[XQ]=Ct[QQ]=!0;Ct[jQ]=Ct[yT]=Ct[WQ]=!1;function $c(e,t,n,r,i,a){var o,s=t&OQ,c=t&EQ,l=t&MQ;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!CQ(e))return e;var u=xQ(e);if(u){if(o=vQ(e),!s)return dQ(e,o)}else{var d=gQ(e),f=d==yT||d==PQ;if(_Q(e))return uQ(e,s);if(d==xT||d==bT||f&&!i){if(o=c||f?{}:yQ(e),!s)return c?hQ(e,lQ(o,e)):fQ(e,cQ(o,e))}else{if(!Ct[d])return i?e:{};o=bQ(e,d,s)}}a||(a=new aQ);var h=a.get(e);if(h)return h;a.set(e,o),TQ(e)?e.forEach(function(v){o.add($c(v,t,n,v,e,a))}):wQ(e)&&e.forEach(function(v,x){o.set(x,$c(v,t,n,x,e,a))});var g=l?c?mQ:pQ:c?SQ:kQ,p=u?void 0:g(e);return oQ(p||e,function(v,x){p&&(x=v,v=e[x]),sQ(o,x,$c(v,t,n,x,e,a))}),o}var JQ=$c;function eJ(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}var tJ=eJ,nJ=Ls,rJ=tJ;function iJ(e,t){return t.length<2?e:nJ(e,rJ(t,0,-1))}var aJ=iJ,oJ=qa,sJ=ew,cJ=aJ,lJ=Ya;function uJ(e,t){return t=oJ(t,e),e=cJ(e,t),e==null||delete e[lJ(sJ(t))]}var dJ=uJ,fJ=im;function hJ(e){return fJ(e)?void 0:e}var pJ=hJ,mJ=_u,gJ=JQ,vJ=dJ,bJ=qa,yJ=Va,xJ=pJ,_J=uC,wJ=vT,CJ=1,TJ=2,kJ=4,SJ=_J(function(e,t){var n={};if(e==null)return n;var r=!1;t=mJ(t,function(a){return a=bJ(a,e),r||(r=a.length>1),a}),yJ(e,wJ(e),n),r&&(n=gJ(n,CJ|TJ|kJ,xJ));for(var i=t.length;i--;)vJ(n,t[i]);return n}),OJ=SJ;const _T=Rt(OJ);function or(){return or=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},or.apply(this,arguments)}var $h={dotSize:4,noteWidth:120,noteTextOffset:8,animate:!0},EJ=function(e){var t=typeof e;return m.isValidElement(e)||t==="string"||t==="function"||t==="object"},MJ=function(e){var t=typeof e;return t==="string"||t==="function"},xs=function(e){return e.type==="circle"},Rh=function(e){return e.type==="dot"},_s=function(e){return e.type==="rect"},$J=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return n.reduce(function(a,o){var s=o.offset||0;return[].concat(a,CK(t,o.match).map(function(c){var l=r(c),u=i(c);return(xs(o)||_s(o))&&(u.size=u.size+2*s,u.width=u.width+2*s,u.height=u.height+2*s),or({},_T(o,["match","offset"]),l,u,{size:o.size||u.size,datum:c})}))},[])},RJ=function(e,t,n,r){var i=Math.atan2(r-t,n-e);return $V(cd(i))},wT=function(e){var t,n,r=e.x,i=e.y,a=e.noteX,o=e.noteY,s=e.noteWidth,c=s===void 0?$h.noteWidth:s,l=e.noteTextOffset,u=l===void 0?$h.noteTextOffset:l;if(Jb(a))t=r+a;else{if(a.abs===void 0)throw new Error("noteX should be either a number or an object containing an 'abs' property");t=a.abs}if(Jb(o))n=i+o;else{if(o.abs===void 0)throw new Error("noteY should be either a number or an object containing an 'abs' property");n=o.abs}var d=r,f=i,h=RJ(r,i,t,n);if(xs(e)){var g=Ci(An(h),e.size/2);d+=g.x,f+=g.y}if(_s(e)){var p=Math.round((h+90)/45)%8;p===0&&(f-=e.height/2),p===1&&(d+=e.width/2,f-=e.height/2),p===2&&(d+=e.width/2),p===3&&(d+=e.width/2,f+=e.height/2),p===4&&(f+=e.height/2),p===5&&(d-=e.width/2,f+=e.height/2),p===6&&(d-=e.width/2),p===7&&(d-=e.width/2,f-=e.height/2)}var v=t,x=t;return(h+90)%360>180?(v-=c,x-=c):x+=c,{points:[[d,f],[t,n],[x,n]],text:[v,n-u],angle:h+90}},CT=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return m.useMemo(function(){return $J({data:t,annotations:n,getPosition:r,getDimensions:i})},[t,n,r,i])},AJ=function(e){var t=e.annotations;return m.useMemo(function(){return t.map(function(n){return or({},n,{computed:wT(or({},n))})})},[t])},jJ=function(e){return m.useMemo(function(){return wT(e)},[e])},PJ=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,a=ht(),o=mn(),s=o.animate,c=o.config,l=cr({x:n,y:r,config:c,immediate:!s});return typeof i=="function"?m.createElement(i,{x:n,y:r,datum:t}):b.jsxs(b.Fragment,{children:[a.annotations.text.outlineWidth>0&&b.jsx(ft.text,{x:l.x,y:l.y,style:or({},a.annotations.text,{strokeLinejoin:"round",strokeWidth:2*a.annotations.text.outlineWidth,stroke:a.annotations.text.outlineColor}),children:i}),b.jsx(ft.text,{x:l.x,y:l.y,style:_T(a.annotations.text,["outlineWidth","outlineColor"]),children:i})]})},sy=function(e){var t=e.points,n=e.isOutline,r=n!==void 0&&n,i=ht(),a=m.useMemo(function(){var c=t[0];return t.slice(1).reduce(function(l,u){return l+" L"+u[0]+","+u[1]},"M"+c[0]+","+c[1])},[t]),o=Ym(a);if(r&&i.annotations.link.outlineWidth<=0)return null;var s=or({},i.annotations.link);return r&&(s.strokeLinecap="square",s.strokeWidth=i.annotations.link.strokeWidth+2*i.annotations.link.outlineWidth,s.stroke=i.annotations.link.outlineColor,s.opacity=i.annotations.link.outlineOpacity),b.jsx(ft.path,{fill:"none",d:o,style:s})},IJ=function(e){var t=e.x,n=e.y,r=e.size,i=ht(),a=mn(),o=a.animate,s=a.config,c=cr({x:t,y:n,radius:r/2,config:s,immediate:!o});return b.jsxs(b.Fragment,{children:[i.annotations.outline.outlineWidth>0&&b.jsx(ft.circle,{cx:c.x,cy:c.y,r:c.radius,style:or({},i.annotations.outline,{fill:"none",strokeWidth:i.annotations.outline.strokeWidth+2*i.annotations.outline.outlineWidth,stroke:i.annotations.outline.outlineColor,opacity:i.annotations.outline.outlineOpacity})}),b.jsx(ft.circle,{cx:c.x,cy:c.y,r:c.radius,style:i.annotations.outline})]})},DJ=function(e){var t=e.x,n=e.y,r=e.size,i=r===void 0?$h.dotSize:r,a=ht(),o=mn(),s=o.animate,c=o.config,l=cr({x:t,y:n,radius:i/2,config:c,immediate:!s});return b.jsxs(b.Fragment,{children:[a.annotations.outline.outlineWidth>0&&b.jsx(ft.circle,{cx:l.x,cy:l.y,r:l.radius,style:or({},a.annotations.outline,{fill:"none",strokeWidth:2*a.annotations.outline.outlineWidth,stroke:a.annotations.outline.outlineColor,opacity:a.annotations.outline.outlineOpacity})}),b.jsx(ft.circle,{cx:l.x,cy:l.y,r:l.radius,style:a.annotations.symbol})]})},NJ=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.borderRadius,o=a===void 0?6:a,s=ht(),c=mn(),l=c.animate,u=c.config,d=cr({x:t-r/2,y:n-i/2,width:r,height:i,config:u,immediate:!l});return b.jsxs(b.Fragment,{children:[s.annotations.outline.outlineWidth>0&&b.jsx(ft.rect,{x:d.x,y:d.y,rx:o,ry:o,width:d.width,height:d.height,style:or({},s.annotations.outline,{fill:"none",strokeWidth:s.annotations.outline.strokeWidth+2*s.annotations.outline.outlineWidth,stroke:s.annotations.outline.outlineColor,opacity:s.annotations.outline.outlineOpacity})}),b.jsx(ft.rect,{x:d.x,y:d.y,rx:o,ry:o,width:d.width,height:d.height,style:s.annotations.outline})]})},FJ=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,a=jJ(e);if(!EJ(i))throw new Error("note should be a valid react element");return b.jsxs(b.Fragment,{children:[b.jsx(sy,{points:a.points,isOutline:!0}),xs(e)&&b.jsx(IJ,{x:n,y:r,size:e.size}),Rh(e)&&b.jsx(DJ,{x:n,y:r,size:e.size}),_s(e)&&b.jsx(NJ,{x:n,y:r,width:e.width,height:e.height,borderRadius:e.borderRadius}),b.jsx(sy,{points:a.points}),b.jsx(PJ,{datum:t,x:a.text[0],y:a.text[1],note:i})]})},cy=function(e,t){t.forEach(function(n,r){var i=n[0],a=n[1];r===0?e.moveTo(i,a):e.lineTo(i,a)})},LJ=function(e,t){var n=t.annotations,r=t.theme;n.length!==0&&(e.save(),n.forEach(function(i){if(!MJ(i.note))throw new Error("note is invalid for canvas implementation");r.annotations.link.outlineWidth>0&&(e.lineCap="square",e.strokeStyle=r.annotations.link.outlineColor,e.lineWidth=r.annotations.link.strokeWidth+2*r.annotations.link.outlineWidth,e.beginPath(),cy(e,i.computed.points),e.stroke(),e.lineCap="butt"),xs(i)&&r.annotations.outline.outlineWidth>0&&(e.strokeStyle=r.annotations.outline.outlineColor,e.lineWidth=r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),Rh(i)&&r.annotations.symbol.outlineWidth>0&&(e.strokeStyle=r.annotations.symbol.outlineColor,e.lineWidth=2*r.annotations.symbol.outlineWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),_s(i)&&r.annotations.outline.outlineWidth>0&&(e.strokeStyle=r.annotations.outline.outlineColor,e.lineWidth=r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,e.beginPath(),e.rect(i.x-i.width/2,i.y-i.height/2,i.width,i.height),e.stroke()),e.strokeStyle=r.annotations.link.stroke,e.lineWidth=r.annotations.link.strokeWidth,e.beginPath(),cy(e,i.computed.points),e.stroke(),xs(i)&&(e.strokeStyle=r.annotations.outline.stroke,e.lineWidth=r.annotations.outline.strokeWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),Rh(i)&&(e.fillStyle=r.annotations.symbol.fill,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.fill()),_s(i)&&(e.strokeStyle=r.annotations.outline.stroke,e.lineWidth=r.annotations.outline.strokeWidth,e.beginPath(),e.rect(i.x-i.width/2,i.y-i.height/2,i.width,i.height),e.stroke()),typeof i.note=="function"?i.note(e,{datum:i.datum,x:i.computed.text[0],y:i.computed.text[1],theme:r}):(e.font=r.annotations.text.fontSize+"px "+r.annotations.text.fontFamily,e.textAlign="left",e.textBaseline="alphabetic",e.fillStyle=r.annotations.text.fill,e.strokeStyle=r.annotations.text.outlineColor,e.lineWidth=2*r.annotations.text.outlineWidth,r.annotations.text.outlineWidth>0&&(e.lineJoin="round",e.strokeText(i.note,i.computed.text[0],i.computed.text[1]),e.lineJoin="miter"),e.fillText(i.note,i.computed.text[0],i.computed.text[1]))}),e.restore())};function pt(){return pt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pt.apply(this,arguments)}function Xa(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var ly,BJ=function(e){var t=e.bars,n=e.annotations,r=CT({data:t,annotations:n,getPosition:function(i){return{x:i.x+i.width/2,y:i.y+i.height/2}},getDimensions:function(i){var a=i.height,o=i.width;return{width:o,height:a,size:Math.max(o,a)}}});return b.jsx(b.Fragment,{children:r.map(function(i,a){return b.jsx(FJ,pt({},i),a)})})},WJ=function(e){var t=e.width,n=e.height,r=e.legends,i=e.toggleSerie;return b.jsx(b.Fragment,{children:r.map(function(a,o){var s,c=a[0],l=a[1];return b.jsx(Jm,pt({},c,{containerWidth:t,containerHeight:n,data:(s=c.data)!=null?s:l,toggleSerie:c.toggleSerie&&c.dataFrom==="keys"?i:void 0}),o)})})},UJ=["data"],zJ=function(e){var t,n=e.bar,r=n.data,i=Xa(n,UJ),a=e.style,o=a.borderColor,s=a.color,c=a.height,l=a.labelColor,u=a.labelOpacity,d=a.labelX,f=a.labelY,h=a.transform,g=a.width,p=e.borderRadius,v=e.borderWidth,x=e.label,_=e.shouldRenderLabel,y=e.isInteractive,C=e.onClick,w=e.onMouseEnter,T=e.onMouseLeave,$=e.tooltip,R=e.isFocusable,S=e.ariaLabel,k=e.ariaLabelledBy,O=e.ariaDescribedBy,D=ht(),E=Li(),M=E.showTooltipFromEvent,j=E.showTooltipAt,F=E.hideTooltip,W=m.useMemo(function(){return function(){return m.createElement($,pt({},i,r))}},[$,i,r]),B=m.useCallback(function(K){C==null||C(pt({color:i.color},r),K)},[i,r,C]),U=m.useCallback(function(K){return M(W(),K)},[M,W]),N=m.useCallback(function(K){w==null||w(r,K),M(W(),K)},[r,w,M,W]),V=m.useCallback(function(K){T==null||T(r,K),F()},[r,F,T]),X=m.useCallback(function(){j(W(),[i.absX+i.width/2,i.absY])},[j,W,i]),ne=m.useCallback(function(){F()},[F]);return b.jsxs(ft.g,{transform:h,children:[b.jsx(ft.rect,{width:Zr(g,function(K){return Math.max(K,0)}),height:Zr(c,function(K){return Math.max(K,0)}),rx:p,ry:p,fill:(t=r.fill)!=null?t:s,strokeWidth:v,stroke:o,focusable:R,tabIndex:R?0:void 0,"aria-label":S?S(r):void 0,"aria-labelledby":k?k(r):void 0,"aria-describedby":O?O(r):void 0,onMouseEnter:y?N:void 0,onMouseMove:y?U:void 0,onMouseLeave:y?V:void 0,onClick:y?B:void 0,onFocus:y&&R?X:void 0,onBlur:y&&R?ne:void 0}),_&&b.jsx(ft.text,{x:d,y:f,textAnchor:"middle",dominantBaseline:"central",fillOpacity:u,style:pt({},D.labels.text,{pointerEvents:"none",fill:l}),children:x})]})},HJ=["color","label"],VJ=function(e){var t=e.color,n=e.label,r=Xa(e,HJ);return b.jsx(Zp,{id:n,value:r.formattedValue,enableChip:!0,color:t})},xt={indexBy:"id",keys:["value"],groupMode:"stacked",layout:"vertical",reverse:!1,minValue:"auto",maxValue:"auto",valueScale:{type:"linear"},indexScale:{type:"band",round:!0},padding:.1,innerPadding:0,axisBottom:{},axisLeft:{},enableGridX:!1,enableGridY:!0,enableLabel:!0,label:"formattedValue",labelSkipWidth:0,labelSkipHeight:0,labelTextColor:{from:"theme",theme:"labels.text.fill"},colorBy:"id",colors:{scheme:"nivo"},borderRadius:0,borderWidth:0,borderColor:{from:"color"},isInteractive:!0,tooltip:VJ,tooltipLabel:function(e){return e.id+" - "+e.indexValue},legends:[],initialHiddenIds:[],annotations:[],markers:[],enableTotals:!1,totalsOffset:10},St=pt({},xt,{layers:["grid","axes","bars","totals","markers","legends","annotations"],barComponent:zJ,defs:[],fill:[],animate:!0,motionConfig:"default",role:"img",isFocusable:!1}),Qt=pt({},xt,{layers:["grid","axes","bars","totals","legends","annotations"],pixelRatio:typeof window<"u"&&(ly=window.devicePixelRatio)!=null?ly:1}),TT=function(e,t,n,r,i,a){return ys(r,{all:e.map(t),min:0,max:0},i,a).padding(n)},kT=function(e,t){return e.map(function(n){return pt({},t.reduce(function(r,i){return r[i]=null,r},{}),n)})},ud=function(e){return Object.keys(e).reduce(function(t,n){return e[n]&&(t[n]=e[n]),t},{})},dd=function(e){return[e,Number(e)]},qJ=["layout","minValue","maxValue","reverse","width","height","padding","innerPadding","valueScale","indexScale","hiddenIds"],ig=function(e,t){return e>t},ST=function(e,t){return e<t},OT=function(e,t){return Array.from(" ".repeat(t-e),function(n,r){return e+r})},YJ=function(e){return ig(e,0)?0:e},GJ=function(e,t,n,r){var i=e.data,a=e.formatValue,o=e.getColor,s=e.getIndex,c=e.getTooltipLabel,l=e.innerPadding,u=l===void 0?0:l,d=e.keys,f=e.xScale,h=e.yScale,g=e.margin,p=n?ST:ig,v=i.map(ud),x=[];return d.forEach(function(_,y){return OT(0,f.domain().length).forEach(function(C){var w,T,$,R=dd(i[C][_]),S=R[0],k=R[1],O=s(i[C]),D=((w=f(O))!=null?w:0)+t*y+u*y,E=p(T=k,0)?($=h(T))!=null?$:0:r,M=function(F,W){var B;return p(F,0)?r-W:((B=h(F))!=null?B:0)-r}(k,E),j={id:_,value:S===null?S:k,formattedValue:a(k),hidden:!1,index:C,indexValue:O,data:v[C]};x.push({key:_+"."+j.indexValue,index:x.length,data:j,x:D,y:E,absX:g.left+D,absY:g.top+E,width:t,height:M,color:o(j),label:c(j)})})}),x},ZJ=function(e,t,n,r){var i=e.data,a=e.formatValue,o=e.getIndex,s=e.getColor,c=e.getTooltipLabel,l=e.keys,u=e.innerPadding,d=u===void 0?0:u,f=e.xScale,h=e.yScale,g=e.margin,p=n?ST:ig,v=i.map(ud),x=[];return l.forEach(function(_,y){return OT(0,h.domain().length).forEach(function(C){var w,T,$,R=dd(i[C][_]),S=R[0],k=R[1],O=o(i[C]),D=p(T=k,0)?r:($=f(T))!=null?$:0,E=((w=h(O))!=null?w:0)+t*y+d*y,M=function(F,W){var B;return p(F,0)?((B=f(F))!=null?B:0)-r:r-W}(k,D),j={id:_,value:S===null?S:k,formattedValue:a(k),hidden:!1,index:C,indexValue:O,data:v[C]};x.push({key:_+"."+j.indexValue,index:x.length,data:j,x:D,y:E,absX:g.left+D,absY:g.top+E,width:M,height:t,color:s(j),label:c(j)})})}),x},KJ=function(e){var t,n,r=e.layout,i=e.minValue,a=e.maxValue,o=e.reverse,s=e.width,c=e.height,l=e.padding,u=l===void 0?0:l,d=e.innerPadding,f=d===void 0?0:d,h=e.valueScale,g=e.indexScale,p=e.hiddenIds,v=p===void 0?[]:p,x=Xa(e,qJ),_=x.keys.filter(function(N){return!v.includes(N)}),y=kT(x.data,_),C=r==="vertical"?["y","x",s]:["x","y",c],w=C[0],T=C[1],$=C[2],R=TT(y,x.getIndex,u,g,$,T),S=pt({max:a,min:i,reverse:o},h),k=S.min==="auto"?YJ:function(N){return N},O=y.reduce(function(N,V){return[].concat(N,_.map(function(X){return V[X]}))},[]).filter(Boolean),D=k(Math.min.apply(Math,O)),E=(n=Math.max.apply(Math,O),isFinite(n)?n:0),M=ys(S,{all:O,min:D,max:E},w==="x"?s:c,w),j=r==="vertical"?[R,M]:[M,R],F=j[0],W=j[1],B=(R.bandwidth()-f*(_.length-1))/_.length,U=[pt({},x,{data:y,keys:_,innerPadding:f,xScale:F,yScale:W}),B,S.reverse,(t=M(0))!=null?t:0];return{xScale:F,yScale:W,bars:B>0?r==="vertical"?GJ.apply(void 0,U):ZJ.apply(void 0,U):[]}},XJ=["data","layout","minValue","maxValue","reverse","width","height","padding","valueScale","indexScale","hiddenIds"],QJ=function e(t){var n;return t.some(Array.isArray)?e((n=[]).concat.apply(n,t)):t},JJ=function(e,t,n){var r=e.formatValue,i=e.getColor,a=e.getIndex,o=e.getTooltipLabel,s=e.innerPadding,c=e.stackedData,l=e.xScale,u=e.yScale,d=e.margin,f=[];return c.forEach(function(h){return l.domain().forEach(function(g,p){var v,x,_=h[p],y=(v=l(a(_.data)))!=null?v:0,C=((x=function(k){return u(k[n?0:1])}(_))!=null?x:0)+.5*s,w=function(k,O){var D;return((D=u(k[n?1:0]))!=null?D:0)-O}(_,C)-s,T=dd(_.data[h.key]),$=T[0],R=T[1],S={id:h.key,value:$===null?$:R,formattedValue:r(R),hidden:!1,index:p,indexValue:g,data:ud(_.data)};f.push({key:h.key+"."+g,index:f.length,data:S,x:y,y:C,absX:d.left+y,absY:d.top+C,width:t,height:w,color:i(S),label:o(S)})})}),f},eee=function(e,t,n){var r=e.formatValue,i=e.getColor,a=e.getIndex,o=e.getTooltipLabel,s=e.innerPadding,c=e.stackedData,l=e.xScale,u=e.yScale,d=e.margin,f=[];return c.forEach(function(h){return u.domain().forEach(function(g,p){var v,x,_=h[p],y=(v=u(a(_.data)))!=null?v:0,C=((x=function(k){return l(k[n?1:0])}(_))!=null?x:0)+.5*s,w=function(k,O){var D;return((D=l(k[n?0:1]))!=null?D:0)-O}(_,C)-s,T=dd(_.data[h.key]),$=T[0],R=T[1],S={id:h.key,value:$===null?$:R,formattedValue:r(R),hidden:!1,index:p,indexValue:g,data:ud(_.data)};f.push({key:h.key+"."+g,index:f.length,data:S,x:C,y,absX:d.left+C,absY:d.top+y,width:w,height:t,color:i(S),label:o(S)})})}),f},tee=function(e){var t,n=e.data,r=e.layout,i=e.minValue,a=e.maxValue,o=e.reverse,s=e.width,c=e.height,l=e.padding,u=l===void 0?0:l,d=e.valueScale,f=e.indexScale,h=e.hiddenIds,g=h===void 0?[]:h,p=Xa(e,XJ),v=p.keys.filter(function(B){return!g.includes(B)}),x=LU().keys(v).offset(BU)(kT(n,v)),_=r==="vertical"?["y","x",s]:["x","y",c],y=_[0],C=_[1],w=_[2],T=TT(n,p.getIndex,u,f,w,C),$=pt({max:a,min:i,reverse:o},d),R=(t=QJ(x),d.type==="log"?t.filter(function(B){return B!==0}):t),S=Math.min.apply(Math,R),k=Math.max.apply(Math,R),O=ys($,{all:R,min:S,max:k},y==="x"?s:c,y),D=r==="vertical"?[T,O]:[O,T],E=D[0],M=D[1],j=p.innerPadding>0?p.innerPadding:0,F=T.bandwidth(),W=[pt({},p,{innerPadding:j,stackedData:x,xScale:E,yScale:M}),F,$.reverse];return{xScale:E,yScale:M,bars:F>0?r==="vertical"?JJ.apply(void 0,W):eee.apply(void 0,W):[]}},nee=function(e){var t=e.bars,n=e.direction,r=e.from,i=e.groupMode,a=e.layout,o=e.legendLabel,s=e.reverse,c=NC(o??(r==="indexes"?"indexValue":"id"));return r==="indexes"?function(l,u,d){var f=Oh(l.map(function(h){var g,p;return{id:(g=h.data.indexValue)!=null?g:"",label:d(h.data),hidden:h.data.hidden,color:(p=h.color)!=null?p:"#000"}}),function(h){return h.id});return u==="horizontal"&&f.reverse(),f}(t,a,c):function(l,u,d,f,h,g){var p=Oh(l.map(function(v){var x;return{id:v.data.id,label:g(v.data),hidden:v.data.hidden,color:(x=v.color)!=null?x:"#000"}}),function(v){return v.id});return(u==="vertical"&&f==="stacked"&&d==="column"&&h!==!0||u==="horizontal"&&f==="stacked"&&h===!0)&&p.reverse(),p}(t,a,n,i,s,c)},uy=function(e,t,n){var r=e.get(t)||0;e.set(t,r+n)},ree=function(e,t,n){var r=e.get(t)||0;e.set(t,r+(n>0?n:0))},iee=function(e,t,n){var r=e.get(t)||0;e.set(t,Math.max(r,Number(n)))},aee=function(e,t){var n=e.get(t)||0;e.set(t,n+1)},ET=function(e){var t=e.indexBy,n=t===void 0?xt.indexBy:t,r=e.keys,i=r===void 0?xt.keys:r,a=e.label,o=a===void 0?xt.label:a,s=e.tooltipLabel,c=s===void 0?xt.tooltipLabel:s,l=e.valueFormat,u=e.colors,d=u===void 0?xt.colors:u,f=e.colorBy,h=f===void 0?xt.colorBy:f,g=e.borderColor,p=g===void 0?xt.borderColor:g,v=e.labelTextColor,x=v===void 0?xt.labelTextColor:v,_=e.groupMode,y=_===void 0?xt.groupMode:_,C=e.layout,w=C===void 0?xt.layout:C,T=e.reverse,$=T===void 0?xt.reverse:T,R=e.data,S=e.minValue,k=S===void 0?xt.minValue:S,O=e.maxValue,D=O===void 0?xt.maxValue:O,E=e.margin,M=e.width,j=e.height,F=e.padding,W=F===void 0?xt.padding:F,B=e.innerPadding,U=B===void 0?xt.innerPadding:B,N=e.valueScale,V=N===void 0?xt.valueScale:N,X=e.indexScale,ne=X===void 0?xt.indexScale:X,K=e.initialHiddenIds,J=K===void 0?xt.initialHiddenIds:K,q=e.enableLabel,G=q===void 0?xt.enableLabel:q,z=e.labelSkipWidth,L=z===void 0?xt.labelSkipWidth:z,H=e.labelSkipHeight,ee=H===void 0?xt.labelSkipHeight:H,A=e.legends,se=A===void 0?xt.legends:A,ce=e.legendLabel,ue=e.totalsOffset,we=ue===void 0?xt.totalsOffset:ue,Te=m.useState(J??[]),at=Te[0],tt=Te[1],Be=m.useCallback(function($e){tt(function(Pe){return Pe.indexOf($e)>-1?Pe.filter(function(ze){return ze!==$e}):[].concat(Pe,[$e])})},[]),Ke=Ti(n),Ye=Ti(o),de=Ti(c),ke=Ma(l),Oe=ht(),ve=Xm(d,h),Ie=ar(p,Oe),Xe=ar(x,Oe),It=(y==="grouped"?KJ:tee)({layout:w,reverse:$,data:R,getIndex:Ke,keys:i,minValue:k,maxValue:D,width:M,height:j,getColor:ve,padding:W,innerPadding:U,valueScale:V,indexScale:ne,hiddenIds:at,formatValue:ke,getTooltipLabel:de,margin:E}),mt=It.bars,Je=It.xScale,bt=It.yScale,At=m.useMemo(function(){return mt.filter(function($e){return $e.data.value!==null}).map(function($e,Pe){return pt({},$e,{index:Pe})})},[mt]),it=m.useCallback(function($e){var Pe=$e.width,ze=$e.height;return!!G&&!(L>0&&Pe<L)&&!(ee>0&&ze<ee)},[G,L,ee]),gt=m.useMemo(function(){return i.map(function($e){var Pe=mt.find(function(ze){return ze.data.id===$e});return pt({},Pe,{data:pt({id:$e},Pe==null?void 0:Pe.data,{hidden:at.includes($e)})})})},[at,i,mt]),yt=m.useMemo(function(){return se.map(function($e){return[$e,nee({bars:$e.dataFrom==="keys"?gt:mt,direction:$e.direction,from:$e.dataFrom,groupMode:y,layout:w,legendLabel:ce,reverse:$})]})},[se,gt,mt,y,w,ce,$]),Lt=m.useMemo(function(){return function($e,Pe,ze,nt,vt,kt,Xt){nt===void 0&&(nt=xt.layout),vt===void 0&&(vt=xt.groupMode);var Dt=[];if($e.length===0)return Dt;var Bt=new Map,Ht=$e[0].width,Mt=$e[0].height;if(vt==="stacked"){var Wt=new Map;$e.forEach(function(fe){var ye=fe.data,Ee=ye.indexValue,qe=ye.value;uy(Bt,Ee,Number(qe)),ree(Wt,Ee,Number(qe))}),Wt.forEach(function(fe,ye){var Ee,qe,Ge,ot=Bt.get(ye)||0;nt==="vertical"?(Ee=Pe(ye),qe=ze(fe),Ge=ze(fe/2)):(Ee=Pe(fe),qe=ze(ye),Ge=Pe(fe/2)),Ee+=nt==="vertical"?Ht/2:kt,qe+=nt==="vertical"?-kt:Mt/2,Dt.push({key:"total_"+ye,x:Ee,y:qe,value:ot,formattedValue:Xt(ot),animationOffset:Ge})})}else if(vt==="grouped"){var Jt=new Map,Vt=new Map;$e.forEach(function(fe){var ye=fe.data,Ee=ye.indexValue,qe=ye.value;uy(Bt,Ee,Number(qe)),iee(Jt,Ee,Number(qe)),aee(Vt,Ee)}),Jt.forEach(function(fe,ye){var Ee,qe,Ge,ot=Bt.get(ye)||0,P=Vt.get(ye);nt==="vertical"?(Ee=Pe(ye),qe=ze(fe),Ge=ze(fe/2)):(Ee=Pe(fe),qe=ze(ye),Ge=Pe(fe/2)),Ee+=nt==="vertical"?P*Ht/2:kt,qe+=nt==="vertical"?-kt:P*Mt/2,Dt.push({key:"total_"+ye,x:Ee,y:qe,value:ot,formattedValue:Xt(ot),animationOffset:Ge})})}return Dt}(mt,Je,bt,w,y,we,ke)},[mt,Je,bt,w,y,we,ke]);return{bars:mt,barsWithValue:At,xScale:Je,yScale:bt,getIndex:Ke,getLabel:Ye,getTooltipLabel:de,formatValue:ke,getColor:ve,getBorderColor:Ie,getLabelColor:Xe,shouldRenderBarLabel:it,hiddenIds:at,toggleSerie:Be,legendsWithData:yt,barTotals:Lt}},oee=function(e){var t=e.data,n=e.springConfig,r=e.animate,i=e.layout,a=i===void 0?St.layout:i,o=ht();return Fi(t,{keys:function(s){return s.key},from:function(s){return{x:a==="vertical"?s.x:s.animationOffset,y:a==="vertical"?s.animationOffset:s.y,labelOpacity:0}},enter:function(s){return{x:s.x,y:s.y,labelOpacity:1}},update:function(s){return{x:s.x,y:s.y,labelOpacity:1}},leave:function(s){return{x:a==="vertical"?s.x:s.animationOffset,y:a==="vertical"?s.animationOffset:s.y,labelOpacity:0}},config:n,immediate:!r,initial:r?void 0:null})(function(s,c){return b.jsx(ft.text,{x:s.x,y:s.y,fillOpacity:s.labelOpacity,style:pt({},o.labels.text,{pointerEvents:"none",fill:o.text.fill}),fontWeight:"bold",fontSize:o.labels.text.fontSize,fontFamily:o.labels.text.fontFamily,textAnchor:a==="vertical"?"middle":"start",alignmentBaseline:a==="vertical"?"alphabetic":"middle",children:c.formattedValue},c.key)})},see=["isInteractive","animate","motionConfig","theme","renderWrapper"],cee=function(e){var t=e.data,n=e.indexBy,r=e.keys,i=e.margin,a=e.width,o=e.height,s=e.groupMode,c=e.layout,l=e.reverse,u=e.minValue,d=e.maxValue,f=e.valueScale,h=e.indexScale,g=e.padding,p=e.innerPadding,v=e.axisTop,x=e.axisRight,_=e.axisBottom,y=_===void 0?St.axisBottom:_,C=e.axisLeft,w=C===void 0?St.axisLeft:C,T=e.enableGridX,$=T===void 0?St.enableGridX:T,R=e.enableGridY,S=R===void 0?St.enableGridY:R,k=e.gridXValues,O=e.gridYValues,D=e.layers,E=D===void 0?St.layers:D,M=e.barComponent,j=M===void 0?St.barComponent:M,F=e.enableLabel,W=F===void 0?St.enableLabel:F,B=e.label,U=e.labelSkipWidth,N=U===void 0?St.labelSkipWidth:U,V=e.labelSkipHeight,X=V===void 0?St.labelSkipHeight:V,ne=e.labelTextColor,K=e.markers,J=K===void 0?St.markers:K,q=e.colorBy,G=e.colors,z=e.defs,L=z===void 0?St.defs:z,H=e.fill,ee=H===void 0?St.fill:H,A=e.borderRadius,se=A===void 0?St.borderRadius:A,ce=e.borderWidth,ue=ce===void 0?St.borderWidth:ce,we=e.borderColor,Te=e.annotations,at=Te===void 0?St.annotations:Te,tt=e.legendLabel,Be=e.tooltipLabel,Ke=e.valueFormat,Ye=e.isInteractive,de=Ye===void 0?St.isInteractive:Ye,ke=e.tooltip,Oe=ke===void 0?St.tooltip:ke,ve=e.onClick,Ie=e.onMouseEnter,Xe=e.onMouseLeave,It=e.legends,mt=e.role,Je=mt===void 0?St.role:mt,bt=e.ariaLabel,At=e.ariaLabelledBy,it=e.ariaDescribedBy,gt=e.isFocusable,yt=gt===void 0?St.isFocusable:gt,Lt=e.barAriaLabel,$e=e.barAriaLabelledBy,Pe=e.barAriaDescribedBy,ze=e.initialHiddenIds,nt=e.enableTotals,vt=nt===void 0?St.enableTotals:nt,kt=e.totalsOffset,Xt=kt===void 0?St.totalsOffset:kt,Dt=mn(),Bt=Dt.animate,Ht=Dt.config,Mt=Us(a,o,i),Wt=Mt.outerWidth,Jt=Mt.outerHeight,Vt=Mt.margin,fe=Mt.innerWidth,ye=Mt.innerHeight,Ee=ET({indexBy:n,label:B,tooltipLabel:Be,valueFormat:Ke,colors:G,colorBy:q,borderColor:we,labelTextColor:ne,groupMode:s,layout:c,reverse:l,data:t,keys:r,minValue:u,maxValue:d,margin:Vt,width:fe,height:ye,padding:g,innerPadding:p,valueScale:f,indexScale:h,enableLabel:W,labelSkipWidth:N,labelSkipHeight:X,legends:It,legendLabel:tt,initialHiddenIds:ze,totalsOffset:Xt}),qe=Ee.bars,Ge=Ee.barsWithValue,ot=Ee.xScale,P=Ee.yScale,re=Ee.getLabel,Z=Ee.getTooltipLabel,te=Ee.getBorderColor,ge=Ee.getLabelColor,Ce=Ee.shouldRenderBarLabel,pe=Ee.toggleSerie,be=Ee.legendsWithData,Ae=Ee.barTotals,Me=Fi(Ge,{keys:function(le){return le.key},from:function(le){return pt({borderColor:te(le),color:le.color,height:0,labelColor:ge(le),labelOpacity:0,labelX:le.width/2,labelY:le.height/2,transform:"translate("+le.x+", "+(le.y+le.height)+")",width:le.width},c==="vertical"?{}:{height:le.height,transform:"translate("+le.x+", "+le.y+")",width:0})},enter:function(le){return{borderColor:te(le),color:le.color,height:le.height,labelColor:ge(le),labelOpacity:1,labelX:le.width/2,labelY:le.height/2,transform:"translate("+le.x+", "+le.y+")",width:le.width}},update:function(le){return{borderColor:te(le),color:le.color,height:le.height,labelColor:ge(le),labelOpacity:1,labelX:le.width/2,labelY:le.height/2,transform:"translate("+le.x+", "+le.y+")",width:le.width}},leave:function(le){return pt({borderColor:te(le),color:le.color,height:0,labelColor:ge(le),labelOpacity:0,labelX:le.width/2,labelY:0,transform:"translate("+le.x+", "+(le.y+le.height)+")",width:le.width},c==="vertical"?{}:{labelX:0,labelY:le.height/2,height:le.height,transform:"translate("+le.x+", "+le.y+")",width:0})},config:Ht,immediate:!Bt,initial:Bt?void 0:null}),et=m.useMemo(function(){return{borderRadius:se,borderWidth:ue,enableLabel:W,isInteractive:de,labelSkipWidth:N,labelSkipHeight:X,onClick:ve,onMouseEnter:Ie,onMouseLeave:Xe,getTooltipLabel:Z,tooltip:Oe,isFocusable:yt,ariaLabel:Lt,ariaLabelledBy:$e,ariaDescribedBy:Pe}},[se,ue,W,Z,de,X,N,ve,Ie,Xe,Oe,yt,Lt,$e,Pe]),Nt=Km(L,qe,ee,{dataKey:"data",targetKey:"data.fill"}),wt={annotations:null,axes:null,bars:null,grid:null,legends:null,markers:null,totals:null};E.includes("annotations")&&(wt.annotations=b.jsx(BJ,{bars:qe,annotations:at},"annotations")),E.includes("axes")&&(wt.axes=b.jsx(sT,{xScale:ot,yScale:P,width:fe,height:ye,top:v,right:x,bottom:y,left:w},"axes")),E.includes("bars")&&(wt.bars=b.jsx(m.Fragment,{children:Me(function(le,cn){return m.createElement(j,pt({},et,{bar:cn,style:le,shouldRenderLabel:Ce(cn),label:re(cn.data)}))})},"bars")),E.includes("grid")&&(wt.grid=b.jsx(cT,{width:fe,height:ye,xScale:$?ot:null,yScale:S?P:null,xValues:k,yValues:O},"grid")),E.includes("legends")&&(wt.legends=b.jsx(WJ,{width:fe,height:ye,legends:be,toggleSerie:pe},"legends")),E.includes("markers")&&(wt.markers=b.jsx(IC,{markers:J,width:fe,height:ye,xScale:ot,yScale:P},"markers")),E.includes("totals")&&vt&&(wt.totals=b.jsx(oee,{data:Ae,springConfig:Ht,animate:Bt,layout:c},"totals"));var Ut=m.useMemo(function(){return pt({},et,{margin:Vt,width:a,height:o,innerWidth:fe,innerHeight:ye,bars:qe,legendData:be,enableLabel:W,xScale:ot,yScale:P,tooltip:Oe,getTooltipLabel:Z,onClick:ve,onMouseEnter:Ie,onMouseLeave:Xe})},[et,Vt,a,o,fe,ye,qe,be,W,ot,P,Oe,Z,ve,Ie,Xe]);return b.jsx(ld,{width:Wt,height:Jt,margin:Vt,defs:Nt,role:Je,ariaLabel:bt,ariaLabelledBy:At,ariaDescribedBy:it,isFocusable:yt,children:E.map(function(le,cn){var Ft;return typeof le=="function"?b.jsx(m.Fragment,{children:m.createElement(le,Ut)},cn):(Ft=wt==null?void 0:wt[le])!=null?Ft:null})})},lee=function(e){var t=e.isInteractive,n=t===void 0?St.isInteractive:t,r=e.animate,i=r===void 0?St.animate:r,a=e.motionConfig,o=a===void 0?St.motionConfig:a,s=e.theme,c=e.renderWrapper,l=Xa(e,see);return b.jsx(zs,{animate:i,isInteractive:n,motionConfig:o,renderWrapper:c,theme:s,children:b.jsx(cee,pt({isInteractive:n},l))})},uee=["isInteractive","renderWrapper","theme"],uf=function(e,t,n,r){return e.find(function(i){return FC(i.x+t.left,i.y+t.top,i.width,i.height,n,r)})},dee=function(e){var t=e.data,n=e.indexBy,r=e.keys,i=e.margin,a=e.width,o=e.height,s=e.groupMode,c=e.layout,l=e.reverse,u=e.minValue,d=e.maxValue,f=e.valueScale,h=e.indexScale,g=e.padding,p=e.innerPadding,v=e.axisTop,x=e.axisRight,_=e.axisBottom,y=_===void 0?Qt.axisBottom:_,C=e.axisLeft,w=C===void 0?Qt.axisLeft:C,T=e.enableGridX,$=T===void 0?Qt.enableGridX:T,R=e.enableGridY,S=R===void 0?Qt.enableGridY:R,k=e.gridXValues,O=e.gridYValues,D=e.layers,E=D===void 0?Qt.layers:D,M=e.renderBar,j=M===void 0?function(Z,te){var ge=te.bar,Ce=ge.color,pe=ge.height,be=ge.width,Ae=ge.x,Me=ge.y,et=te.borderColor,Nt=te.borderRadius,wt=te.borderWidth,Ut=te.label,le=te.labelColor,cn=te.shouldRenderLabel;if(Z.fillStyle=Ce,wt>0&&(Z.strokeStyle=et,Z.lineWidth=wt),Z.beginPath(),Nt>0){var Ft=Math.min(Nt,pe);Z.moveTo(Ae+Ft,Me),Z.lineTo(Ae+be-Ft,Me),Z.quadraticCurveTo(Ae+be,Me,Ae+be,Me+Ft),Z.lineTo(Ae+be,Me+pe-Ft),Z.quadraticCurveTo(Ae+be,Me+pe,Ae+be-Ft,Me+pe),Z.lineTo(Ae+Ft,Me+pe),Z.quadraticCurveTo(Ae,Me+pe,Ae,Me+pe-Ft),Z.lineTo(Ae,Me+Ft),Z.quadraticCurveTo(Ae,Me,Ae+Ft,Me),Z.closePath()}else Z.rect(Ae,Me,be,pe);Z.fill(),wt>0&&Z.stroke(),cn&&(Z.textBaseline="middle",Z.textAlign="center",Z.fillStyle=le,Z.fillText(Ut,Ae+be/2,Me+pe/2))}:M,F=e.enableLabel,W=F===void 0?Qt.enableLabel:F,B=e.label,U=e.labelSkipWidth,N=U===void 0?Qt.labelSkipWidth:U,V=e.labelSkipHeight,X=V===void 0?Qt.labelSkipHeight:V,ne=e.labelTextColor,K=e.colorBy,J=e.colors,q=e.borderRadius,G=q===void 0?Qt.borderRadius:q,z=e.borderWidth,L=z===void 0?Qt.borderWidth:z,H=e.borderColor,ee=e.annotations,A=ee===void 0?Qt.annotations:ee,se=e.legendLabel,ce=e.tooltipLabel,ue=e.valueFormat,we=e.isInteractive,Te=we===void 0?Qt.isInteractive:we,at=e.tooltip,tt=at===void 0?Qt.tooltip:at,Be=e.onClick,Ke=e.onMouseEnter,Ye=e.onMouseLeave,de=e.legends,ke=e.pixelRatio,Oe=ke===void 0?Qt.pixelRatio:ke,ve=e.canvasRef,Ie=e.enableTotals,Xe=Ie===void 0?Qt.enableTotals:Ie,It=e.totalsOffset,mt=It===void 0?Qt.totalsOffset:It,Je=m.useRef(null),bt=ht(),At=Us(a,o,i),it=At.margin,gt=At.innerWidth,yt=At.innerHeight,Lt=At.outerWidth,$e=At.outerHeight,Pe=ET({indexBy:n,label:B,tooltipLabel:ce,valueFormat:ue,colors:J,colorBy:K,borderColor:H,labelTextColor:ne,groupMode:s,layout:c,reverse:l,data:t,keys:r,minValue:u,maxValue:d,margin:it,width:gt,height:yt,padding:g,innerPadding:p,valueScale:f,indexScale:h,enableLabel:W,labelSkipWidth:N,labelSkipHeight:X,legends:de,legendLabel:se,totalsOffset:mt}),ze=Pe.bars,nt=Pe.barsWithValue,vt=Pe.xScale,kt=Pe.yScale,Xt=Pe.getLabel,Dt=Pe.getTooltipLabel,Bt=Pe.getBorderColor,Ht=Pe.getLabelColor,Mt=Pe.shouldRenderBarLabel,Wt=Pe.legendsWithData,Jt=Pe.barTotals,Vt=Li(),fe=Vt.showTooltipFromEvent,ye=Vt.hideTooltip,Ee=AJ({annotations:CT({data:ze,annotations:A,getPosition:function(Z){return{x:Z.x,y:Z.y}},getDimensions:function(Z){var te=Z.width,ge=Z.height;return{width:te,height:ge,size:Math.max(te,ge)}}})}),qe=m.useMemo(function(){return{borderRadius:G,borderWidth:L,isInteractive:Te,isFocusable:!1,labelSkipWidth:N,labelSkipHeight:X,margin:it,width:a,height:o,innerWidth:gt,innerHeight:yt,bars:ze,legendData:Wt,enableLabel:W,xScale:vt,yScale:kt,tooltip:tt,getTooltipLabel:Dt,onClick:Be,onMouseEnter:Ke,onMouseLeave:Ye}},[G,L,Te,N,X,it,a,o,gt,yt,ze,Wt,W,vt,kt,tt,Dt,Be,Ke,Ye]),Ge=Ma(ue);m.useEffect(function(){var Z,te=(Z=Je.current)==null?void 0:Z.getContext("2d");Je.current&&te&&(Je.current.width=Lt*Oe,Je.current.height=$e*Oe,te.scale(Oe,Oe),te.fillStyle=bt.background,te.fillRect(0,0,Lt,$e),te.translate(it.left,it.top),E.forEach(function(ge){ge==="grid"?typeof bt.grid.line.strokeWidth=="number"&&bt.grid.line.strokeWidth>0&&(te.lineWidth=bt.grid.line.strokeWidth,te.strokeStyle=bt.grid.line.stroke,$&&Cl(te,{width:gt,height:yt,scale:vt,axis:"x",values:k}),S&&Cl(te,{width:gt,height:yt,scale:kt,axis:"y",values:O})):ge==="axes"?lT(te,{xScale:vt,yScale:kt,width:gt,height:yt,top:v,right:x,bottom:y,left:w,theme:bt}):ge==="bars"?nt.forEach(function(Ce){j(te,{bar:Ce,borderColor:Bt(Ce),borderRadius:G,borderWidth:L,label:Xt(Ce.data),labelColor:Ht(Ce),shouldRenderLabel:Mt(Ce)})}):ge==="legends"?Wt.forEach(function(Ce){var pe=Ce[0],be=Ce[1];YC(te,pt({},pe,{data:be,containerWidth:gt,containerHeight:yt,theme:bt}))}):ge==="annotations"?LJ(te,{annotations:Ee,theme:bt}):ge==="totals"&&Xe?function(Ce,pe,be,Ae){Ae===void 0&&(Ae=Qt.layout),Ce.fillStyle=be.text.fill,Ce.font="bold "+be.labels.text.fontSize+"px "+be.labels.text.fontFamily,Ce.textBaseline=Ae==="vertical"?"alphabetic":"middle",Ce.textAlign=Ae==="vertical"?"center":"start",pe.forEach(function(Me){Ce.fillText(Me.formattedValue,Me.x,Me.y)})}(te,Jt,bt,c):typeof ge=="function"&&ge(te,qe)}),te.save())},[y,w,x,v,nt,G,L,Ee,$,S,Bt,Xt,Ht,k,O,s,o,yt,gt,qe,E,c,Wt,it.left,it.top,$e,Lt,Oe,j,vt,kt,l,Mt,bt,a,Jt,Xe,Ge]);var ot=m.useCallback(function(Z){if(ze&&Je.current){var te=jo(Je.current,Z),ge=te[0],Ce=te[1],pe=uf(ze,it,ge,Ce);pe!==void 0?(fe(m.createElement(tt,pt({},pe.data,{color:pe.color,label:pe.label,value:Number(pe.data.value)})),Z),Z.type==="mouseenter"&&(Ke==null||Ke(pe.data,Z))):ye()}},[ye,it,Ke,ze,fe,tt]),P=m.useCallback(function(Z){if(ze&&Je.current){ye();var te=jo(Je.current,Z),ge=te[0],Ce=te[1],pe=uf(ze,it,ge,Ce);pe&&(Ye==null||Ye(pe.data,Z))}},[ye,it,Ye,ze]),re=m.useCallback(function(Z){if(ze&&Je.current){var te=jo(Je.current,Z),ge=te[0],Ce=te[1],pe=uf(ze,it,ge,Ce);pe!==void 0&&(Be==null||Be(pt({},pe.data,{color:pe.color}),Z))}},[it,Be,ze]);return b.jsx("canvas",{ref:function(Z){Je.current=Z,ve&&"current"in ve&&(ve.current=Z)},width:Lt*Oe,height:$e*Oe,style:{width:Lt,height:$e,cursor:Te?"auto":"normal"},onMouseEnter:Te?ot:void 0,onMouseMove:Te?ot:void 0,onMouseLeave:Te?P:void 0,onClick:Te?re:void 0})},fee=m.forwardRef(function(e,t){var n=e.isInteractive,r=e.renderWrapper,i=e.theme,a=Xa(e,uee);return b.jsx(zs,{isInteractive:n,renderWrapper:r,theme:i,animate:!1,children:b.jsx(dee,pt({},a,{canvasRef:t}))})}),hee=function(e){return b.jsx(Ka,{children:function(t){var n=t.width,r=t.height;return b.jsx(lee,pt({width:n,height:r},e))}})};m.forwardRef(function(e,t){return b.jsx(Ka,{children:function(n){var r=n.width,i=n.height;return b.jsx(fee,pt({width:r,height:i},e,{ref:t}))}})});const pee="_side-content-bar_1ka0p_1",mee="_mobile_1ka0p_12",gee="_expanded_1ka0p_20",vee="_resizer_1ka0p_23",bee="_expander_1ka0p_37",yee="_icon_1ka0p_56",jr={"side-content-bar":"_side-content-bar_1ka0p_1",sideContentBar:pee,mobile:mee,expanded:gee,resizer:vee,expander:bee,icon:yee},MT=({width:e,children:t,isExpandedOnMobileState:[n,r],onResize:i})=>{const{ProjectIconComponent:a}=m.useContext(Pt),{isMobile:o}=$s(),s=Rp({onSwipedRight:u=>{u.velocity>.8&&r(!1)},delta:100}),[c,l]=m.useState(null);return b.jsxs(b.Fragment,{children:[b.jsxs("section",{className:Q("luminus-side-content-bar shadow",jr.sideContentBar,{[jr.mobile]:o},{[jr.expanded]:n}),style:{width:`${e}px`},...s,children:[o?null:b.jsx("div",{role:"button",className:Q(jr.resizer,"luminus-side-content-bar-resizer","shadow"),draggable:!0,onDragStart:u=>l({startX:u.clientX,widthStart:e}),onDrag:u=>i(((c==null?void 0:c.widthStart)??0)+(((c==null?void 0:c.startX)??0)-u.clientX)),onDragEnd:()=>l(null),children:b.jsx(a,{className:jr.icon,icon:"resizer-horizontal"})}),t]}),o?b.jsx("div",{role:"button",onClick:()=>r(!n),className:Q(jr.expander,{[jr.expanded]:n},"luminus-side-content-bar-expander","shadow"),children:b.jsx(a,{className:jr.icon,icon:"chevron-left"})}):null]})},xee=({title:e})=>b.jsx("div",{className:"mb-3",children:typeof e=="string"?b.jsx(dn,{variant:"h3",children:e}):e}),_ee="_full-screen-container_1rm4r_1",$T={"full-screen-container":"_full-screen-container_1rm4r_1",fullScreenContainer:_ee},wee=Q("overflow-hidden luminus-full-screen-container",$T.fullScreenContainer),Cee="container-fluid",Tee=({title:e,children:t,sideContent:n,sideContentWidth:r=250,noPadding:i,className:a,variant:o="main",helmet:s,unavailableOnMobile:c})=>{const{addHelmet:l,removeHelmet:u}=m.useContext(g2),{texts:{container:d}}=m.useContext(Pt),[f,h]=m.useState(r),[g,p]=m.useState(!1),v=m.useMemo(()=>{switch(o){case"fullScreen":return wee;case"main":return Cee;default:throw new Error(`PageContainer got incorrect variant type: ${o}`)}},[o]);m.useEffect(()=>(s?l(s):typeof e=="string"&&e&&l(e),()=>u()),[s,l,u,e]);const x=Rp({onSwipedLeft:C=>{C.velocity>.8&&p(!0)},delta:100}),{isMobile:_}=$s(),y=m.useMemo(()=>_&&c,[_,c]);return m.useEffect(()=>{h(r)},[r]),b.jsxs(b.Fragment,{children:[b.jsx("div",{className:Q(v,i?"p-0":"p-3",a),style:o==="fullScreen"?{width:n?`calc(100% - ${f}px)`:"100%"}:void 0,...x,children:b.jsx("div",{className:o==="fullScreen"?$T.fullScreenContainer:void 0,style:o==="main"?{paddingRight:n?`${f}px`:void 0}:{height:"100%",width:"100%"},children:y?b.jsx(Ap,{variant:"warning",children:d.unavailableOnMobile}):b.jsxs(b.Fragment,{children:[e?b.jsx(xee,{title:e}):null,t]})})}),n&&!y?b.jsx(MT,{width:f,isExpandedOnMobileState:[g,p],onResize:C=>h(C),children:n}):null]})},ag=({InputContainer:e=As,formField:t,label:n,resetsFields:r,options:i,isNumber:a,size:o,showClearIcon:s,clearValue:c,noSortOptions:l,required:u,hidden:d,disabled:f,withoutLabel:h,hint:g,className:p})=>{const{register:v,formState:x,getValues:_,setValue:y,watch:C}=rn.useFormContext(),w=Xl({falseIfNotInit:!0});console.log("disabled ",f),console.log("formDisabled ",w);const[T,$]=m.useState(void 0),[R,S]=m.useState(!1),k=m.useMemo(()=>i.toSorted((M,j)=>l?0:(M.name??"").localeCompare(j.name??"")),[i,l]),O=m.useCallback(()=>{const M=c??null;a?y(t,M===null?null:Number(M),{shouldDirty:!0,shouldValidate:R}):y(t,(M==null?void 0:M.toString())??"",{shouldDirty:!0,shouldValidate:R})},[c,a,y,t,R]);m.useEffect(()=>{const M=t.split(".");let j=x.errors;M.forEach(F=>{j!==void 0&&(j=j[F])}),$(j)},[x,t]);const D=m.useMemo(()=>f||w,[f,w]);console.log(D),m.useEffect(()=>{y(t,_(t))},[k,t,_,y]),m.useEffect(()=>{x.isSubmitted&&S(!0)},[x]);const E=T!==void 0;return b.jsx(b.Fragment,{children:b.jsxs(e,{label:n??"",required:u,disabled:D,hidden:d,withoutLabel:h,isInvalid:E,hint:g,className:p,children:[b.jsxs(sr.Select,{size:o,...v(t,{setValueAs:M=>a?M==null||M===""?null:parseInt(M,10):M==null||M===""?null:M,onChange:()=>{r&&r.forEach(M=>y(M,null,{shouldDirty:!0,shouldValidate:R}))}}),isInvalid:E,hidden:d,disabled:D,className:"w-100",children:[b.jsx("option",{value:""}),k.map(M=>b.jsx("option",{value:M.id??"",children:M.name},M.id))]}),s&&C(t)&&b.jsx("div",{className:"luminus-input-remove-icon inset",children:b.jsx(Rs,{color:"secondary",size:"sm",onClick:O,children:b.jsx(ks,{})})}),T&&b.jsx(Jl,{message:T.message})]})})},og=({InputContainer:e=As,formField:t,label:n,resetsFields:r,size:i,showClearIcon:a,clearValue:o,required:s,hidden:c,disabled:l,rows:u,withoutLabel:d,customFormControlProps:f,minLength:h,maxLength:g,hint:p,onChange:v,className:x})=>{const{register:_,formState:y,setValue:C,watch:w}=rn.useFormContext(),T=Xl({falseIfNotInit:!0}),[$,R]=m.useState(void 0),[S,k]=m.useState(!1),O=m.useCallback(()=>{const j=o??null;C(t,(j==null?void 0:j.toString())??"",{shouldDirty:!0,shouldValidate:S})},[o,C,t,S]),D=m.useCallback(()=>{const j=t.split(".");let F=y.errors;j.forEach(W=>{F!==void 0&&(F=F[W])}),R(F)},[y,t]),E=m.useMemo(()=>l||T,[l,T]);m.useEffect(()=>{D()},[D]),m.useEffect(()=>{y.isSubmitted&&k(!0)},[y]);const M=$!==void 0;return b.jsxs(e,{label:n??"",required:s,disabled:E,hidden:c,withoutLabel:d,isInvalid:M,className:x,hint:p,isForTextAreaInput:!0,children:[b.jsx(sr.Control,{as:"textarea",size:i,..._(t,{setValueAs:j=>j==null||j===""?null:j,onChange:j=>{var F;r&&r.forEach(W=>C(W,null,{shouldDirty:!0,shouldValidate:S})),v&&v((F=j.target)!=null&&F.value?j.target.value.toString():null)}}),isInvalid:M,hidden:c,disabled:E,rows:u??2,className:"w-100",minLength:h,maxLength:g,...f}),a&&w(t)&&b.jsx("div",{className:"luminus-input-remove-icon",children:b.jsx(Rs,{color:"secondary",size:"sm",onClick:O,children:b.jsx(ks,{})})}),$&&b.jsx(Jl,{message:$.message})]})},$a=m.forwardRef(({InputContainer:e=As,type:t,formField:n,label:r,placeholder:i,size:a,resetsFields:o,showClearIcon:s,clearValue:c,required:l,hidden:u,disabled:d,withoutLabel:f,list:h,step:g,CustomOnChangeComponent:p,noSelectOnFocus:v,minLength:x,maxLength:_,hint:y,onChange:C,className:w,autoComplete:T},$)=>{const{register:R,formState:S,setValue:k,watch:O}=rn.useFormContext(),D=Xl({falseIfNotInit:!0}),[E,M]=m.useState(void 0),[j,F]=m.useState(!1),W=m.useCallback(()=>{const z=c??null;t==="number"?k(n,z!==null?Number(z):null,{shouldDirty:!0,shouldValidate:j}):k(n,(z==null?void 0:z.toString())??"",{shouldDirty:!0,shouldValidate:j})},[c,t,k,n,j]),B=m.useCallback(()=>{const z=n.split(".");let L=S.errors;z.forEach(H=>{L!==void 0&&(L=L[H])}),M(L)},[S,n]),U=m.useMemo(()=>d||D,[d,D]);m.useEffect(()=>{B()},[B]),m.useEffect(()=>{S.isSubmitted&&F(!0)},[S]);const N=E!==void 0,[V,X]=m.useState(!1),ne=O(n),K=Cp(t,ne??null,V),{ref:J,...q}=R(n,{setValueAs:z=>t==="number"?z==null||z===""?null:Number(z):z==null||z===""?null:z,onChange:z=>{var L;o&&o.forEach(H=>k(H,null,{shouldDirty:!0,shouldValidate:j})),C&&C((L=z.target)!=null&&L.value?t==="number"?Number(z.target.value)??null:z.target.value.toString():null)},onBlur:()=>X(!1)}),G=m.useRef(null);return m.useImperativeHandle($,()=>G.current,[G]),b.jsxs(e,{label:r??"",required:l,disabled:U,hidden:u,withoutLabel:f,isInvalid:N,hint:y,className:w,children:[b.jsxs("div",{className:"luminus-input-container position-relative w-100",children:[b.jsx(sr.Control,{type:K,placeholder:i??r,size:a,onFocus:z=>{X(!0),!v&&z.target.select()},...q,ref:z=>{J(z),G.current=z},isInvalid:N,hidden:u,disabled:U,list:h,className:"w-100",step:g,minLength:x,maxLength:_,autoComplete:T}),p&&b.jsx("div",{className:"custom-picker-button",children:p})]}),s&&O(n)&&b.jsx("div",{className:`luminus-input-remove-icon ${t!=="text"?"inset":""}`,children:b.jsx(Rs,{color:"secondary",size:"sm",onClick:W,children:b.jsx(ks,{})})}),E&&b.jsx(Jl,{message:E.message})]})}),dy=(e,t,n)=>{if(e&&"reportValidity"in e){const r=rn.get(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},RT=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?dy(r.ref,n,e):r.refs&&r.refs.forEach(i=>dy(i,n,e))}},kee=(e,t)=>{t.shouldUseNativeValidation&&RT(e,t);const n={};for(const r in e){const i=rn.get(t.fields,r),a=Object.assign(e[r]||{},{ref:i&&i.ref});if(See(t.names||Object.keys(e),r)){const o=Object.assign({},rn.get(n,r));rn.set(o,"root",a),rn.set(n,r,o)}else rn.set(n,r,a)}return n},See=(e,t)=>e.some(n=>n.startsWith(t+"."));var Oee=function(e,t){for(var n={};e.length;){var r=e[0],i=r.code,a=r.message,o=r.path.join(".");if(!n[o])if("unionErrors"in r){var s=r.unionErrors[0].errors[0];n[o]={message:s.message,type:s.code}}else n[o]={message:a,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(d){return e.push(d)})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=rn.appendErrors(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n},fd=function(e,t,n){return n===void 0&&(n={}),function(r,i,a){try{return Promise.resolve(function(o,s){try{var c=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(l){return a.shouldUseNativeValidation&&RT({},a),{errors:{},values:n.raw?r:l}})}catch(l){return s(l)}return c&&c.then?c.then(void 0,s):c}(0,function(o){if(function(s){return Array.isArray(s==null?void 0:s.errors)}(o))return{values:{},errors:kee(Oee(o.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}}};const Eee="_wrapper_9omw0_1",Mee="_controls_9omw0_16",$ee="_explorerWindow_9omw0_20",Ree="_folderList_9omw0_28",Aee="_fileList_9omw0_35",jee="_dndText_9omw0_61",ai={wrapper:Eee,controls:Mee,explorerWindow:$ee,folderList:Ree,fileList:Aee,dndText:jee},qt=m.createContext({apiActions:{},loadDocuments(){throw new Error("DocumentsContext was not initialized.")},reducer:[{},{}],entityType:"",entityId:-1}),Pee="_folderIcon_vxg2z_1",Iee="_defaultFolder_vxg2z_5",Dee="_names_vxg2z_9",Nee="_folderType_vxg2z_13",pc={folderIcon:Pee,defaultFolder:Iee,names:Dee,folderType:Nee},AT=({isActive:e,isDefault:t,folderName:n,typeName:r})=>{const{ProjectIconComponent:i}=m.useContext(Pt);return b.jsxs("div",{className:"d-flex gap-2 align-items-center",children:[b.jsx(i,{icon:`folder${e?"-filled":""}`,className:Q("d-inline-block",t?pc.defaultFolder:"text-primary"),iconProps:{className:pc.folderIcon}}),b.jsxs("div",{className:Q("d-flex flex-column gap-0 align-items-start",pc.names),children:[b.jsx("span",{className:e?"fw-bold":"",children:n}),r?b.jsxs("span",{className:pc.folderType,children:["(",r,")"]}):null]})]})},Fee=({customText:e})=>{const{reducer:[t,n]}=m.useContext(qt),r=m.useCallback(()=>{n({type:"select-folder",folderId:"root"})},[n]);return b.jsx("li",{children:b.jsx("button",{onClick:r,type:"button",className:Q("border-0 bg-transparent"),children:b.jsx(AT,{folderName:e??"root",isActive:t.activeFolder==="root",typeName:"",isDefault:!0})})})};function Lee(e){if(e.state!=="openned-modal")throw new Error('Not in "openned-modal" state!')}const jT=()=>{const e=Gl(),{startLoading:t,stopLoading:n}=m.useContext(Bl),{reducer:[,r]}=m.useContext(qt),i=m.useCallback(async(o,s)=>{t("documents-renameFolder");try{await e.put("/documents/folder/rename",{folderId:o,name:s}),r({type:"update-folders",folderIds:[o],newProperties:{name:s}})}finally{n("documents-renameFolder")}},[e,r,t,n]),a=m.useCallback(async o=>{t("documentsFolderCreate");try{const s=await e.post("/documents/folder",o);r({type:"create-folder",folderData:o,folderId:s.data.id,isOnlyRead:s.data.onlyRead})}finally{n("documentsFolderCreate")}},[e,r,t,n]);return{renameFolder:i,createFolder:a}},Bee=()=>{const{reducer:[e],entityId:t,entityType:n}=m.useContext(qt),{zNumberRequired:r,zStringRequired:i}=Kl(),{createFolder:a}=jT(),o=Zt.object({name:i(),documentTypeId:r()}),s=rn.useForm({resolver:fd(o)}),c=m.useCallback(async l=>{const u={...l,dbObjectId:t.toString(),entity:n,parentFolderId:e.activeFolder==="root"?null:e.activeFolder};await a(u)},[a,t,n,e.activeFolder]);return{formMethods:s,onSubmit:c}},Wee=({handleClose:e})=>{var o;const{texts:{documents:t}}=m.useContext(Pt),{reducer:[n],entityType:r}=m.useContext(qt);if(Lee(n),n.modalType!=="create-folder")throw new Error("Tried to render CreateFolderModal without create-folder modal type reducer state.");const{onSubmit:i,formMethods:a}=Bee();return b.jsx(b.Fragment,{children:b.jsx(rn.FormProvider,{...a,children:b.jsxs(sr,{onSubmit:a.handleSubmit(i),children:[b.jsx(bn.Header,{closeButton:!0,children:b.jsx(bn.Title,{children:t.createFolderInFolder(((o=n.foldersMap.get(n.chosenFolderId))==null?void 0:o.name)??r)})}),b.jsxs(bn.Body,{children:[b.jsx($a,{formField:"name",type:"text",label:t.name,required:!0}),b.jsx(ag,{options:n.documentTypes,formField:"documentTypeId",label:t.folderType,isNumber:!0,required:!0})]}),b.jsxs(bn.Footer,{children:[b.jsx(Mi,{onClick:e,variant:"outlined",color:"secondary",children:t.cancel}),b.jsx(Mi,{type:"submit",children:t.createFolder})]})]})})})},PT=100,Uee=(e,t)=>{const n=Gl(),{startLoading:r,stopLoading:i}=m.useContext(Bl),{loadDocuments:a}=m.useContext(qt),{zStringRequired:o,zString:s,zNumberRequired:c,zDateRequired:l}=Kl(),u=Zt.object({name:o(),description:s(),validToDate:l(),documentTypeId:c()}),d=rn.useForm({resolver:fd(u),defaultValues:{...e,validToDate:Wl(e.validToDate)}}),f=m.useCallback(async h=>{r("documents-updateProperties");try{await n.put(`/documents/${e.id}/update-info`,h),await a(),t()}finally{i("documents-updateProperties")}},[n,e.id,t,a,r,i]);return{formMethods:d,onSubmit:f}},zee=({handleClose:e,file:t})=>{const{texts:{documents:n}}=m.useContext(Pt),{reducer:[r]}=m.useContext(qt),{formMethods:i,onSubmit:a}=Uee(t,e);return b.jsxs(b.Fragment,{children:[b.jsx(bn.Header,{closeButton:!0,children:b.jsx(bn.Title,{children:n.editFileProperties})}),b.jsx(rn.FormProvider,{...i,children:b.jsxs(sr,{onSubmit:i.handleSubmit(a),children:[b.jsxs(bn.Body,{children:[b.jsx($a,{formField:"name",type:"text",label:n.name,required:!0}),b.jsx($a,{formField:"validToDate",type:"date",label:n.validSince,required:!0}),b.jsx(ag,{formField:"documentTypeId",label:n.category,options:r.documentTypes,isNumber:!0,required:!0}),b.jsx(og,{formField:"description",label:n.description,customFormControlProps:{maxLength:PT}})]}),b.jsxs(bn.Footer,{children:[b.jsx(Mi,{onClick:e,color:"secondary",variant:"outlined",children:n.cancel}),b.jsx(Mi,{type:"submit",children:n.save})]})]})})]})},Hee=({handleClose:e})=>{const{reducer:[t]}=m.useContext(qt),n=m.useMemo(()=>{if(t.markedFiles.length===1)return t.constantFiles.find(r=>r.id===t.markedFiles[0])},[t.constantFiles,t.markedFiles]);return n===void 0?(e(),b.jsx(b.Fragment,{})):b.jsx(zee,{file:n,handleClose:e})},Vee=()=>{const{reducer:[e,t]}=m.useContext(qt),n=m.useCallback(()=>{t({type:"close-modal"})},[t]),r=m.useMemo(()=>{if(e.state!=="openned-modal")return null;switch(e.modalType){case"create-folder":return b.jsx(Wee,{handleClose:n});case"edit-file-properties":return b.jsx(Hee,{handleClose:n});default:return null}},[e.state,e.modalType]);return b.jsx(bn,{show:e.state==="openned-modal",onHide:n,children:r})},fy="documents_drag_image_element",mc="drop-container-highlight-class",hy="data-drop-container-id",py="data-draggable-id",qee=()=>{const e=document.getElementById(fy);if(e!==null)return e;const t=document.createElement("div");return t.id=fy,t.style.position="absolute",t.style.top=`${-window.outerHeight}px`,t.style.left=`${-window.outerWidth}px`,t.style.width="50px",t.style.height="50px",t.style.backgroundColor="rgba(0, 0, 0, 0.5)",t.style.color="white",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.fontSize="16px",t.style.borderRadius="5px",document.body.appendChild(t),t},sg=()=>{const{apiActions:{moveDocuments:e},reducer:[t]}=m.useContext(qt),n=m.useCallback(l=>{var u;if(t.markedFiles.length>0){const d=qee();d.innerHTML=t.markedFiles.length.toString(),l.dataTransfer.setDragImage(d,0,0),l.dataTransfer.clearData(),l.dataTransfer.setData("application/json",JSON.stringify(t.markedFiles)),l.dataTransfer.dropEffect="none",l.dataTransfer.effectAllowed="move"}else l.dataTransfer.setData("application/json",JSON.stringify([parseInt(((u=l.currentTarget.attributes.getNamedItem(py))==null?void 0:u.nodeValue)??"",10)])),l.dataTransfer.dropEffect="none",l.dataTransfer.effectAllowed="move"},[t.markedFiles]),r=m.useCallback(l=>({[py]:l,draggable:t.markedFiles.length===0||t.markedFiles.includes(l),onDragStart:n}),[n,t.markedFiles]),i=m.useCallback(l=>u=>{var h;u.preventDefault(),u.stopPropagation(),u.currentTarget.classList.remove(mc);const d=u.dataTransfer.files;if(l&&d&&d.length>0){l(d);return}const f=u.dataTransfer.getData("application/json");if(f){const g=JSON.parse(f),p=parseInt(((h=u.currentTarget.attributes.getNamedItem(hy))==null?void 0:h.value)??"",10);e(p,g)}},[e]),a=m.useCallback(()=>l=>{l.preventDefault(),l.stopPropagation()},[]),o=m.useCallback(l=>u=>{u.preventDefault(),u.stopPropagation(),u.dataTransfer.types.includes("Files")?(u.dataTransfer.dropEffect="copy",u.currentTarget.classList.add(mc)):!l&&u.dataTransfer.types.includes("application/json")?(u.dataTransfer.dropEffect="move",u.currentTarget.classList.add(mc)):u.dataTransfer.dropEffect="none"},[]),s=m.useCallback(l=>{l.preventDefault(),l.stopPropagation(),l.target===l.currentTarget&&(l.dataTransfer.dropEffect="none",l.currentTarget.classList.remove(mc))},[]),c=m.useCallback((l,u)=>({onDrop:i(u==null?void 0:u.onFilesDrop),onDragOver:a(),onDragEnter:o(u==null?void 0:u.ignoreInner),onDragLeave:s,[hy]:l}),[i,a,o,s]);return{getDraggableProps:r,getDropProps:c}};function IT(e,t,n){for(let r=0;r<e.childrenIds.length;r++){const i=e.childrenIds[r];if(i===t)return!0;const a=n.get(i);if(a&&IT(a,t,n))return!0}return!1}function Yee(e){if(e.activeFolder==="root")return!1;const t=e.foldersMap.get(e.activeFolder);return!(t!=null&&t.onlyRead)}function DT(e,t){const n=t.get(e);return n===void 0?"":n.parentId===null?n.name:`${DT(n.parentId,t)}/${n.name}`}const Gee=()=>{const{zString:e,zStringRequired:t,zNumberRequired:n}=Kl();return{formSchema:m.useMemo(()=>Zt.object({validTo:t(),description:e(),name:e(),documentTypeId:n()}),[n,e,t])}},cg=({handleClose:e,files:t,targetFolderId:n})=>{var f;const{texts:{documents:r}}=m.useContext(Pt),{reducer:[i],apiActions:{uploadFiles:a}}=m.useContext(qt),o=m.useMemo(()=>[...t],[t]),s=m.useMemo(()=>n??i.activeFolder,[i.activeFolder,n]),c=m.useMemo(()=>s==="root"?void 0:i.foldersMap.get(s),[s,i.foldersMap]),{formSchema:l}=Gee(),u=rn.useForm({resolver:fd(l),defaultValues:{validTo:Wl(new Date().toISOString()),documentTypeId:(f=i.documentTypes.find(h=>{var g;return h.name===((g=i.foldersMap.get(s))==null?void 0:g.defaultDocType)}))==null?void 0:f.id}}),d=m.useCallback(async h=>{s!=="root"&&(await a(t,{folderId:s,...h}),e())},[t,e,s,a]);return b.jsxs(bn,{show:!0,onHide:e,children:[b.jsx(bn.Header,{closeButton:!0,children:b.jsxs("div",{children:[r.uploadFilesPrompt(t.length,c.name),b.jsx("ul",{children:o.map((h,g)=>b.jsxs("li",{children:[h.name," - ",xa(h.size)]},`${h.name}-${g}`))})]})}),b.jsx(rn.FormProvider,{...u,children:b.jsxs(sr,{onSubmit:u.handleSubmit(d),children:[b.jsxs(bn.Body,{children:[b.jsx(ag,{formField:"documentTypeId",label:r.documentType,options:i.documentTypes,isNumber:!0,required:!0}),b.jsx($a,{formField:"validTo",label:r.validSince,type:"date",required:!0}),o.length===1?b.jsx($a,{formField:"name",label:r.name,type:"text"}):null,b.jsx(og,{formField:"description",label:r.description,customFormControlProps:{maxLength:PT}})]}),b.jsxs(bn.Footer,{children:[b.jsx(Mi,{variant:"outlined",color:"secondary",onClick:e,children:r.cancel}),b.jsx(Mi,{type:"submit",children:r.upload})]})]})})]})},Zee="_folder_1cktt_1",Kee="_collapseArrowDiv_1cktt_8",Xee="_button_1cktt_20",Qee="_nestedList_1cktt_24",Jee="_numberOfFiles_1cktt_31",ete="_collapseArrow_1cktt_8",oi={folder:Zee,collapseArrowDiv:Kee,button:Xee,nestedList:Qee,numberOfFiles:Jee,collapseArrow:ete},NT=({dirId:e,writePermissions:t})=>{const{ProjectIconComponent:n}=m.useContext(Pt),{reducer:[r,i]}=m.useContext(qt),{getDropProps:a}=sg(),[o,s]=m.useState(null),[c,l]=m.useState(!0),u=m.useMemo(()=>{const p=r.foldersMap.get(e);if(p===void 0)throw new Error(`tried to get dir with id ${e}`);return p},[e,r.foldersMap]),d=m.useCallback(()=>{r.activeFolder!=="root"&&IT(u,r.activeFolder,r.foldersMap)&&i({type:"select-folder",folderId:e}),l(!0)},[e,u,i,r.activeFolder,r.foldersMap]),f=m.useMemo(()=>u.childrenIds.length>0,[u.childrenIds.length]),h=m.useCallback(()=>{i({type:"select-folder",folderId:e})},[e,i]),g=m.useMemo(()=>r.filteredFiles.filter(p=>p.folderId===e&&p.archive===!1).length,[e,r.filteredFiles]);return b.jsxs(b.Fragment,{children:[b.jsxs("li",{className:oi.folder,children:[b.jsx("div",{className:oi.collapseArrowDiv,children:f?c?b.jsx("button",{onClick:()=>l(!1),type:"button",children:b.jsx(n,{icon:"chevron-right",iconProps:{className:oi.collapseArrow}})}):b.jsx("button",{onClick:d,type:"button",children:b.jsx(n,{icon:"chevron-down",iconProps:{className:oi.collapseArrow}})}):null}),b.jsx("button",{className:Q(oi.button),onClick:h,type:"button",...t&&!u.onlyRead?a(e,{onFilesDrop:p=>s(p)}):{},children:b.jsxs("div",{className:"d-flex align-items-center gap-2",children:[b.jsx(AT,{isDefault:u.isDefault,folderName:u.name,typeName:u.defaultDocType??"",isActive:e===r.activeFolder}),g>0?b.jsxs("span",{className:oi.numberOfFiles,children:["[",g,"]"]}):void 0]})}),f?c?null:b.jsx("ul",{className:oi.nestedList,children:u==null?void 0:u.childrenIds.map(p=>b.jsx(NT,{dirId:p,writePermissions:t},p))}):void 0]}),o!==null?b.jsx(cg,{files:o,handleClose:()=>s(null),targetFolderId:e}):null]})},tte="_wrapper_1th2u_1",nte="_downloadButton_1th2u_9",FT={wrapper:tte,downloadButton:nte};function rte(e){return Ve({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M320 464c8.8 0 16-7.2 16-16V160H256c-17.7 0-32-14.3-32-32V48H64c-8.8 0-16 7.2-16 16V448c0 8.8 7.2 16 16 16H320zM0 64C0 28.7 28.7 0 64 0H229.5c17 0 33.3 6.7 45.3 18.7l90.5 90.5c12 12 18.7 28.3 18.7 45.3V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64z"},child:[]}]})(e)}function ite(e){return Ve({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M448 80c8.8 0 16 7.2 16 16V415.8l-5-6.5-136-176c-4.5-5.9-11.6-9.3-19-9.3s-14.4 3.4-19 9.3L202 340.7l-30.5-42.7C167 291.7 159.8 288 152 288s-15 3.7-19.5 10.1l-80 112L48 416.3l0-.3V96c0-8.8 7.2-16 16-16H448zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm80 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"},child:[]}]})(e)}function ate(e){return Ve({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M23 1.5q.41 0 .7.3.3.29.3.7v19q0 .41-.3.7-.29.3-.7.3H7q-.41 0-.7-.3-.3-.29-.3-.7V18H1q-.41 0-.7-.3-.3-.29-.3-.7V7q0-.41.3-.7Q.58 6 1 6h5V2.5q0-.41.3-.7.29-.3.7-.3zM6 13.28l1.42 2.66h2.14l-2.38-3.87 2.34-3.8H7.46l-1.3 2.4-.05.08-.04.09-.64-1.28-.66-1.29H2.59l2.27 3.82-2.48 3.85h2.16zM14.25 21v-3H7.5v3zm0-4.5v-3.75H12v3.75zm0-5.25V7.5H12v3.75zm0-5.25V3H7.5v3zm8.25 15v-3h-6.75v3zm0-4.5v-3.75h-6.75v3.75zm0-5.25V7.5h-6.75v3.75zm0-5.25V3h-6.75v3Z"},child:[]}]})(e)}function ote(e){return Ve({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M23.004 1.5q.41 0 .703.293t.293.703v19.008q0 .41-.293.703t-.703.293H6.996q-.41 0-.703-.293T6 21.504V18H.996q-.41 0-.703-.293T0 17.004V6.996q0-.41.293-.703T.996 6H6V2.496q0-.41.293-.703t.703-.293zM6.035 11.203l1.442 4.735h1.64l1.57-7.876H9.036l-.937 4.653-1.325-4.5H5.38l-1.406 4.523-.938-4.675H1.312l1.57 7.874h1.641zM22.5 21v-3h-15v3zm0-4.5v-3.75H12v3.75zm0-5.25V7.5H12v3.75zm0-5.25V3h-15v3Z"},child:[]}]})(e)}const ste="_excel_18ggp_1",cte="_word_18ggp_5",lte="_pdf_18ggp_9",ute="_image_18ggp_13",gc={excel:ste,word:cte,pdf:lte,image:ute},LT=({fileExtension:e,className:t,...n})=>{switch(e==null?void 0:e.toUpperCase()){case"JPG":case"JPEG":case"BMP":case"PNG":return b.jsx("span",{className:Q(t,gc.image),children:b.jsx(ite,{...n})});case"XLS":case"XLSX":case"CSV":return b.jsx(ate,{className:Q(t,gc.excel),...n});case"DOC":case"DOCM":case"DOCX":return b.jsx(ote,{className:Q(t,gc.word),...n});case"PDF":return b.jsx(a8,{className:Q(t,gc.pdf),...n});default:return b.jsx(rte,{})}},dte=()=>{const{ProjectIconComponent:e,texts:{documents:t}}=m.useContext(Pt),{apiActions:{downloadFile:n},reducer:[r]}=m.useContext(qt),i=m.useMemo(()=>r.activeFolder==="root",[r.activeFolder]);return{columns:m.useMemo(()=>[{fieldName:"id",caption:"id",type:"number",isVisible:!1},...i?[{fieldName:"folderName",caption:t.folder,type:"string"}]:[],{fieldName:"--icon",caption:"",type:"string",valueFormat:o=>b.jsx(LT,{fileExtension:o.row.original.fileExtension}),width:36,align:"center",filterType:"none",noSort:!0},{fieldName:"name",caption:t.name,type:"string"},{fieldName:"description",caption:t.description,type:"string"},{fieldName:"fileExtension",caption:t.fileExtension,type:"string",filterType:"select",width:50},{fieldName:"--downloadButton",caption:"",type:"number",filterType:"none",width:38,align:"center",noSort:!0,valueFormat:o=>b.jsx(Ql,{className:FT.downloadButton,onClick:()=>n(o.row.original.id,!0),children:b.jsx(e,{icon:"file-download"})})},{fieldName:"documentTypeName",caption:t.documentType,type:"string",filterType:"select"},{fieldName:"validToDate",caption:t.validSince,type:"date"},{fieldName:"size",caption:t.size,type:"number",valueFormat:({cell:{value:o}})=>o!==void 0?xa(o*1024*1024):"",filterType:"none"},{fieldName:"archive",caption:t.archived,type:"boolean",filterType:"select",valueFormat:({cell:{value:o}})=>o?t.yes[0]:t.no[0]}],[e,t.archived,t.description,t.documentType,t.fileExtension,t.folder,t.name,t.no,t.size,t.validSince,t.yes,n,i])}},fte=({BnfTableComponent:e,tableIdentifier:t,writePermissions:n})=>{const{reducer:[r,i]}=m.useContext(qt),{columns:a}=dte(),o=m.useCallback(h=>{i({type:"mark-files-by-action",setStateAction:h})},[i]),s=m.useMemo(()=>r.activeFolder==="root",[r.activeFolder]),c=m.useMemo(()=>{var h;return r.activeFolder==="root"?!1:((h=r.foldersMap.get(r.activeFolder))==null?void 0:h.onlyRead)??!1},[r.activeFolder,r.foldersMap]),l=m.useMemo(()=>({enabled:n&&!s,idField:"id",selectedRows:r.markedFiles,setSelectedRows:o}),[s,o,r.markedFiles,n]),u=m.useMemo(()=>r.activeFolder==="root"?r.filteredFiles:r.filteredFiles.filter(h=>h.folderId===r.activeFolder),[r.activeFolder,r.filteredFiles]),{getDraggableProps:d}=sg(),f=m.useCallback(h=>n===!1||c?{}:d(h.id),[d,c,n]);return b.jsx("div",{className:Q(FT.wrapper),children:b.jsx(e,{data:u,columnsDef:a,rowSelection:l,useScrollableContainer:!0,getRowProps:f,defaultConfig:{defaultFilters:[{id:"archive",value:"false"}]},tableId:t,searchStatePrefix:"docs",useSearchState:!0,hideBottomBar:!0},r.activeFolder)})},hte="_wrapper_1q562_1",pte="_divButtons_1q562_10",df={wrapper:hte,divButtons:pte},mte="_wrapper_1bpdd_1",gte="_fileInput_1bpdd_5",my={wrapper:mte,fileInput:gte},vte=({entityId:e,entityType:t,children:n,disabled:r})=>{const i=m.useRef(null),[a,o]=m.useState(null),{reducer:[s]}=m.useContext(qt),c=f=>{var h;(((h=f.target.files)==null?void 0:h.length)??0)>0&&o(f.target.files)},l=m.useCallback(()=>{o(null),i.current&&(i.current.value="")},[]),u=m.useMemo(()=>`documents-upload-${t}-${e}`,[e,t]),d=m.useMemo(()=>r||s.activeFolder==="root",[r,s.activeFolder]);return b.jsxs("div",{className:my.wrapper,children:[b.jsx("label",{htmlFor:u,className:Q("btn btn-context luminus-context-button",d?"disabled":void 0),children:n}),b.jsx("input",{id:u,type:"file",multiple:!0,onChange:c,className:my.fileInput,ref:i,disabled:d}),a!==null?b.jsx(cg,{handleClose:l,files:a}):void 0]})},Gn=({children:e,onClick:t,className:n,disabled:r=!1})=>b.jsx(Ql,{onClick:t,className:n,disabled:r,children:e}),bte=({className:e,entityId:t,entityType:n})=>{var $,R;const{texts:{documents:r}}=m.useContext(Pt),{prompt:i}=fx(),{confirm:a}=_p(),{apiActions:o,reducer:[s,c]}=m.useContext(qt),{deleteFiles:l,renameFiles:u,downloadAsZip:d,archivateFiles:f,deleteDirectory:h}=o,{renameFolder:g}=jT(),p=m.useMemo(()=>s.markedFiles.length===0,[s.markedFiles.length]),v=m.useMemo(()=>s.markedFiles.length===1,[s.markedFiles.length]),x=m.useCallback(async()=>{if(s.activeFolder==="root")return;const S=await i(r.enterNewFolderName,{input:"input"});S!==null&&g(s.activeFolder,S)},[r.enterNewFolderName,i,g,s.activeFolder]),_=m.useCallback(async()=>{if(s.activeFolder==="root")return;const S=await i(r.enterNewFileName,{input:"input"});S!==null&&u(S)},[r.enterNewFileName,i,u,s.activeFolder]),y=m.useMemo(()=>s.activeFolder==="root",[s.activeFolder]),C=m.useMemo(()=>{var S;return s.activeFolder==="root"?!1:((S=s.foldersMap.get(s.activeFolder))==null?void 0:S.onlyRead)??!1},[s.activeFolder,s.foldersMap]),w=m.useMemo(()=>s.markedFiles.every(S=>{var k;return((k=s.constantFiles.find(O=>O.id===S))==null?void 0:k.archive)===!1}),[s.constantFiles,s.markedFiles]),T=m.useMemo(()=>s.markedFiles.every(S=>{var k;return((k=s.constantFiles.find(O=>O.id===S))==null?void 0:k.archive)===!0}),[s.constantFiles,s.markedFiles]);return b.jsx("div",{className:Q(e,df.wrapper,s.state==="folder-choosing"?"ignore-dim":void 0,"d-flex justify-content-between"),children:s.state!=="folder-choosing"?b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:df.divButtons,children:[b.jsx(vte,{entityId:t,entityType:n,disabled:C,children:r.uploadFiles}),b.jsx(Gn,{onClick:()=>{c({type:"open-modal",modalType:"create-folder",chosenFolderId:s.activeFolder??"root"})},disabled:C,children:r.createFolder}),b.jsx(Gn,{disabled:s.activeFolder==="root"||(($=s.foldersMap.get(s.activeFolder))==null?void 0:$.isDefault),onClick:async()=>{var k;await a(`${r.deleteFolder} ${(k=s.foldersMap.get(s.activeFolder))==null?void 0:k.name}?`)&&h(s.activeFolder)},children:r.deleteFolder}),b.jsx(Gn,{disabled:s.activeFolder==="root"||((R=s.foldersMap.get(s.activeFolder))==null?void 0:R.isDefault),onClick:x,children:r.renameFolder})]}),!y&&!C?b.jsxs("div",{className:df.divButtons,children:[b.jsx(Gn,{onClick:()=>{c({type:"open-modal",modalType:"edit-file-properties"})},disabled:!v,children:r.editFileProperties}),b.jsx(Gn,{onClick:async()=>{await a(r.confirmDeleteFile(s.markedFiles.length))&&l(s.markedFiles)},disabled:p,children:r.delete}),T?b.jsx(Gn,{onClick:async()=>{await a(r.confirmDearchiveFile(s.markedFiles.length))&&await f(!0)},disabled:p,children:r.dearchivate}):b.jsx(Gn,{onClick:async()=>{await a(r.confirmArchiveFile(s.markedFiles.length))&&await f()},disabled:p||!w,children:r.archivate}),b.jsx(Gn,{onClick:_,disabled:p,children:r.rename}),b.jsx(Gn,{onClick:d,disabled:p,children:r.downloadZip})]}):null]}):s.state==="folder-choosing"?b.jsx(b.Fragment,{children:b.jsx(Gn,{onClick:()=>c({type:"return-from-folder-choosing"}),className:Q("ignore-dim","body-background-color"),children:r.back})}):void 0})},yte=({file:e})=>{const{confirm:t}=_p(),{reducer:[n],apiActions:{downloadFile:r}}=m.useContext(qt),{texts:{documents:i}}=m.useContext(Pt),a=m.useCallback(async()=>{await t(i.confirmFileDownload(e.name,e.size==null?void 0:xa(e.size*1024*1024)))&&r(e.id)},[t,i,r,e.id,e.name,e.size]);return b.jsxs(Fl,{action:!0,onClick:a,children:[b.jsx(dn,{variant:"body",className:"text-muted",children:DT(e.folderId,n.foldersMap)}),b.jsxs("div",{className:"d-flex justify-content-between gap-2",children:[b.jsx(dn,{variant:"body",children:e.name}),b.jsx(dn,{variant:"body",children:e.size==null?null:xa(e.size*1024*1024)})]})]})},xte="_typeSelect_m3myk_1",_te={typeSelect:xte},wte=()=>{const{reducer:[e]}=m.useContext(qt),{texts:{documents:t}}=m.useContext(Pt),[n,r]=m.useState(""),[i,a]=m.useState(null),o=m.useMemo(()=>{const c=new Map;return e.filteredFiles.forEach(u=>{c.get(u.documentTypeId)===void 0&&c.set(u.documentTypeId,u.documentTypeName)}),[{id:null,name:t.all},...Array.from(c).map(u=>({id:u[0],name:u[1]}))]},[t.all,e.filteredFiles]),s=m.useMemo(()=>e.filteredFiles.filter(c=>pp(c.name,n)&&(i===null||c.documentTypeId===i)),[n,i,e.filteredFiles]);return b.jsxs("div",{className:"d-flex h-100 flex-column",children:[b.jsxs("div",{className:"d-flex gap-1 mb-1",children:[b.jsx(D2,{options:o,label:t.documentType,value:i,onChange:a,isNumber:!0,size:"sm",className:_te.typeSelect}),b.jsx(P2,{label:t.search,type:"text",value:n,onChange:c=>r(c===null?"":c),className:"flex-grow-1",size:"sm"})]}),b.jsx(B1,{className:"overflow-y-auto",children:s.map(c=>b.jsx(yte,{file:c},c.id))})]})};function Cte(e){return{name:e.name,defaultDocType:e.defaultDocType,childrenIds:[],parentId:e.parentId??null,isDefault:e.isDefault,onlyRead:e.onlyRead}}function Tte(e){const t=[],n=new Map,r=new Map;return e.forEach(i=>{n.set(i.id,Cte(i)),i.parentId===null?t.push(i.id):r.set(i.id,i.parentId)}),r.forEach((i,a)=>{const o=n.get(i);if(o===void 0)throw new Error(`Did not get folder with ID ${i}, which is supposed to be parent directory of folder with ID ${a}`);o.childrenIds.push(a)}),{dirsMap:n,rootIds:t}}function gy(e,t){const n=t.toUpperCase();return e.filter(r=>{var a;const i=(a=r.name)==null?void 0:a.toUpperCase();return i==null?void 0:i.includes(n)})}function kte(e,t){return e.map(n=>{var r;return{...n,folderName:((r=t.get(n.folderId))==null?void 0:r.name)??""}})}const Ste=([e,t],n,r)=>{const{texts:{documents:i}}=m.useContext(Pt),{startLoading:a,stopLoading:o}=m.useContext(Bl),{addNotification:s}=Yl(),c=Gl(),l=m.useCallback(async y=>{a("documentList");try{const w=(await c.get(`/documents/${n}/${r}`)).data,{dirsMap:T,rootIds:$}=Tte(w.folders),R=kte(w.documents,T);t({type:"load-data",files:R,foldersMap:T,rootFolderIds:$,setActiveFolder:y})}finally{o("documentList")}},[c,t,r,n,a,o]);m.useEffect(()=>{l(!0)},[l]);const u=m.useCallback(async()=>{a("documents-types");try{const y=await c.get(`/documents/types/${n}`);if(y.status!==200)throw new Error(`Unexpected status code: ${y.status}`);t({type:"load-document-types",documentTypes:y.data})}finally{o("documents-types")}},[c,t,n,a,o]);m.useEffect(()=>{u()},[u]);const d=m.useCallback(async(y,C)=>{const w=C??e.markedFiles;a("documentsMove");try{await c.put(`/documents/move-to-folder?folderId=${y}`,w),t({type:"update-files",fileIds:w,newProperties:{folderId:y}}),s(i.fileMoveSuccessful(w.length,e.foldersMap.get(y).name),"success")}finally{o("documentsMove")}},[e.markedFiles,e.foldersMap,a,c,t,s,i,o]),f=m.useCallback(async y=>{const C=y??e.markedFiles;a("documentsFilesDelete");try{const w=await c.delete(`/documents/delete?${Af(C,"documentIds")}`);if(w.status!==200)throw new Error(`Unexpected status code: ${w.status}`);t({type:"delete-files",fileIds:C}),s(i.fileDeleteSuccessful(C.length),"success")}finally{o("documentsFilesDelete")}},[e.markedFiles,a,c,t,s,i,o]),h=m.useCallback(async y=>{var C;if(!(y==="root"||(C=e.foldersMap.get(y))!=null&&C.isDefault)){a("documentsFolderDelete");try{const w=await c.delete(`/documents/folder/${y}`);if(w.status!==200)throw new Error(`Unexpected status code: ${w.status}`);t({type:"delete-folder",folderId:y}),s(i.folderDeleteSuccessful(e.foldersMap.get(y).name),"success")}finally{o("documentsFolderDelete")}}},[e.foldersMap,a,c,t,s,i,o]),g=m.useCallback(async y=>{a("documentsRename");try{const C=await c.put("/documents/update-name",{documentIds:e.markedFiles,name:y});if(C.status!==200)throw new Error(`Unexpected status code: ${C.status}`);l()}finally{o("documentsRename")}},[a,c,e.markedFiles,l,o]),p=m.useCallback(async y=>{a("documents-archivate");try{const C=await c.put(`/documents/${y?"dearchive":"archive"}`,e.markedFiles);if(C.status!==200)throw new Error(`Unexpected status code: ${C.status}`);t({type:"update-files",fileIds:e.markedFiles,newProperties:{archive:!y}}),s((y?i.dearchivateSuccessful:i.archivateSuccessful)(e.markedFiles.length),"success")}finally{o("documents-archivate")}},[a,c,e.markedFiles,t,s,i.archivateSuccessful,i.dearchivateSuccessful,o]),v=m.useCallback(async()=>{var C;if(e.activeFolder==="root")return;const y=e.markedFiles.length;s(i.downloadAsZip(y),"info"),a("documents-ZIP_download");try{const w=await c.get(`/documents/download-zip?${Af(e.markedFiles,"documentIds")}`,{responseType:"blob"});Hc(w.data,(((C=e.foldersMap.get(e.activeFolder))==null?void 0:C.name)??"")+"_files")}finally{o("documents-ZIP_download")}},[e.activeFolder,e.markedFiles,e.foldersMap,s,i,a,c,o]),x=m.useCallback(async(y,C)=>{s(i.downloadingFile,"info"),a("documents-downloading_file");try{const w=await c.get(`/documents/${y}?isSmall=true`,{responseType:"blob"}),T=e.constantFiles.find(R=>R.id===y),$=`${(T==null?void 0:T.name)??y.toString()}.${T!=null&&T.fileExtension?T==null?void 0:T.fileExtension.toLowerCase():"unknown"}`;Hc(w.data,$,C)}finally{o("documents-downloading_file")}},[s,i.downloadingFile,a,c,e.constantFiles,o]),_=m.useCallback(async(y,C)=>{a("documents-upload"),s(i.uploadingDocuments,"info");try{await c.postForm("/documents/upload",{files:y,...C}),await l()}finally{o("documents-upload")}},[a,s,i.uploadingDocuments,c,l,o]);return{loadDocuments:l,moveDocuments:d,deleteFiles:f,deleteDirectory:h,renameFiles:g,archivateFiles:p,downloadAsZip:v,downloadFile:x,uploadFiles:_}},Ote=(e,t)=>{var n,r;switch(t.type){case"load-data":{const i={...e,constantFiles:t.files,filteredFiles:gy(t.files,e.searchString),foldersMap:t.foldersMap,rootFolderIds:t.rootFolderIds};if(t.setActiveFolder){const a=t.rootFolderIds.find(o=>t.files.some(s=>s.archive===!1&&s.folderId===o))??"root";i.activeFolder=a}return i}case"load-document-types":return{...e,documentTypes:t.documentTypes};case"select-folder":return{...e,activeFolder:t.folderId,markedFiles:[]};case"mark-file":{const i=e.markedFiles.includes(t.fileId)?[...e.markedFiles.filter(a=>a!==t.fileId)]:[...e.markedFiles,t.fileId];return{...e,state:i.length>0?"selection-file":"explorer",markedFiles:i}}case"mark-files-by-action":{const i=typeof t.setStateAction=="function"?t.setStateAction(e.markedFiles):t.setStateAction;return{...e,state:i.length>0?"selection-file":"explorer",markedFiles:i}}case"mark-all-files":return e.markedFiles.length<e.filteredFiles.filter(i=>i.folderId===e.activeFolder).length?{...e,markedFiles:e.filteredFiles.filter(i=>i.folderId===e.activeFolder).map(i=>i.id),state:"explorer"}:{...e,markedFiles:[],state:"explorer"};case"enter-folder-choosing":return e.state==="folder-choosing"||e.state==="openned-modal"?e:{...e,state:"folder-choosing",canTargetRoot:t.canTargetRoot??!1,previousState:e.state,choosingType:t.choosingType};case"return-from-folder-choosing":return e.state!=="folder-choosing"?e:{...e,state:e.previousState};case"update-files":return{...e,filteredFiles:[...e.filteredFiles.map(i=>t.fileIds.includes(i.id)?{...i,...t.newProperties}:i)],constantFiles:[...e.constantFiles.map(i=>t.fileIds.includes(i.id)?{...i,...t.newProperties}:i)],markedFiles:[],state:"explorer"};case"update-folders":{const i=new Map(e.foldersMap);return t.folderIds.forEach(a=>{i.set(a,{...e.foldersMap.get(a),...t.newProperties})}),{...e,foldersMap:i}}case"delete-files":return{...e,filteredFiles:[...e.filteredFiles.filter(i=>!t.fileIds.includes(i.id))],constantFiles:[...e.constantFiles.filter(i=>!t.fileIds.includes(i.id))],markedFiles:e.markedFiles.filter(i=>!t.fileIds.includes(i)),state:"explorer"};case"open-modal":switch(t.modalType){case"create-folder":return{...e,state:"openned-modal",modalType:t.modalType,chosenFolderId:t.chosenFolderId};default:return{...e,state:"openned-modal",modalType:t.modalType}}case"close-modal":return{...e,state:"explorer"};case"delete-folder":{const i=new Map(e.foldersMap),a=(n=i.get(t.folderId))==null?void 0:n.parentId;let o=[...e.rootFolderIds];if(a){const s=JSON.parse(JSON.stringify(i.get(a)));s.childrenIds=s.childrenIds.filter(c=>c!==t.folderId),i.set(a,s)}else o=o.filter(s=>s!==t.folderId);return i.delete(t.folderId),{...e,rootFolderIds:o,foldersMap:i,activeFolder:"root"}}case"create-folder":{const i=new Map(e.foldersMap);i.set(t.folderId,{name:t.folderData.name,defaultDocType:(r=e.documentTypes.find(o=>o.id===t.folderData.documentTypeId))==null?void 0:r.name,childrenIds:[],parentId:t.folderData.parentFolderId,isDefault:!1,onlyRead:t.isOnlyRead});const a=[...e.rootFolderIds];if(t.folderData.parentFolderId===null)a.push(t.folderId);else{const o=i.get(t.folderData.parentFolderId),s=JSON.parse(JSON.stringify(o));s.childrenIds.push(t.folderId),i.set(t.folderData.parentFolderId,s)}return{...e,state:"explorer",rootFolderIds:a,foldersMap:i}}case"search-files":{const i=gy(e.constantFiles,t.searchString);return{...e,searchString:t.searchString,filteredFiles:i,markedFiles:e.markedFiles.filter(a=>i.map(o=>o.id).includes(a))}}default:throw new Error("Wrong action.type specified.")}},Ete=()=>{const e={state:"explorer",activeFolder:"root",searchString:"",filteredFiles:[],constantFiles:[],foldersMap:new Map,rootFolderIds:[],markedFiles:[],documentTypes:[]},[t,n]=m.useReducer(Ote,e);return[t,n]},Mte=m.memo(({entityType:e,entityId:t,className:n,BnfTableComponent:r,tableIdentifier:i,customRootFolderName:a,writePermissions:o=!0,...s})=>{const{isMobile:c}=$s(),{ProjectIconComponent:l,texts:{documents:u}}=m.useContext(Pt),[d,f]=Ete(),[h,g]=m.useState(null),{loadDocuments:p,...v}=Ste([d,f],e,t),x=m.useMemo(()=>({entityId:t,entityType:e,apiActions:v,loadDocuments:p,reducer:[d,f]}),[t,e,v,p,d,f]),{getDropProps:_}=sg();return c?b.jsx(qt.Provider,{value:x,children:b.jsx(wte,{})}):b.jsx("div",{...s,className:Q(ai.wrapper,n),onDragOver:y=>{y.dataTransfer.dropEffect="none",y.stopPropagation(),y.preventDefault()},onDragEnter:y=>{y.dataTransfer.dropEffect="none",y.stopPropagation(),y.preventDefault()},children:b.jsxs(qt.Provider,{value:x,children:[b.jsx("div",{className:Q(d.state==="folder-choosing"?"dim-others":void 0,ai.explorerWindow),children:b.jsxs("ul",{className:ai.folderList,children:[b.jsx(Fee,{customText:a??e}),d.rootFolderIds.map(y=>b.jsx(NT,{dirId:y,writePermissions:o},y))]})}),b.jsxs("div",{className:Q(ai.explorerWindow,ai.fileList),...o&&Yee(d)?_(d.activeFolder,{onFilesDrop:y=>g(y),ignoreInner:!0}):{},children:[b.jsxs("div",{className:ai.dndText,children:[b.jsx(l,{icon:"file-upload",iconProps:{style:{marginRight:0}}}),b.jsx("span",{children:u.dropToUpload})]}),b.jsx(fte,{tableIdentifier:i,BnfTableComponent:r,writePermissions:o},(d.activeFolder==="root").toString())]}),o?b.jsx(bte,{className:ai.controls,entityType:e,entityId:t}):null,b.jsx(Vee,{}),h!==null?b.jsx(cg,{files:h,handleClose:()=>g(null),targetFolderId:d.activeFolder==="root"?void 0:d.activeFolder}):null]})})}),$te=m.createContext(void 0);exports.AbstractModalHeader=Y1;exports.Alert=Ap;exports.ApprovalState=VE;exports.AuthContext=Tp;exports.AvatarIcon=y2;exports.Backdrop=R2;exports.BaseModal=U1;exports.BootstrapModalManager=z1;exports.Button=qh;exports.Col=Gh;exports.ConfirmContext=ux;exports.ContextButton=Ql;exports.CustomSelectInput=D2;exports.DelegationContext=m2;exports.Documents=Mte;exports.Dropdown=Op;exports.DropdownDivider=x2;exports.DropdownItem=la;exports.DropdownToggle=Sp;exports.ENTERED=Ir;exports.ENTERING=mr;exports.EXITED=Pr;exports.EXITING=jc;exports.FaMinus=n8;exports.FaPlus=r8;exports.FaSearch=i8;exports.Fade=zr;exports.FileExtensionIcon=LT;exports.FloatingLabelInput=eu;exports.Form=sr;exports.FormCheckInput=Nl;exports.FormControl=M1;exports.FormDisabledContext=v2;exports.FormSelect=ip;exports.FromToDatePickerDropdownToggle=l7;exports.HelmetContext=g2;exports.HookFormTextAreaInput=og;exports.HookFormTextInput=$a;exports.HtmlTooltip=_x;exports.IconButton=Rs;exports.Ie=HE;exports.InputAnchorContainer=j2;exports.InvalidFeedback=Jl;exports.ListGroup=B1;exports.ListGroupItem=Fl;exports.LoadingContext=Bl;exports.LoginState=gx;exports.LuminusComponentsContext=Pt;exports.MdArrowRight=AO;exports.MdCheck=jO;exports.MdCircle=RO;exports.MdClear=ks;exports.MdOutlineAddCircleOutline=BO;exports.MdOutlineArrowOutward=PO;exports.MdOutlineCameraAlt=YO;exports.MdOutlineChevronRight=XO;exports.MdOutlineClose=cx;exports.MdOutlineDelete=sx;exports.MdOutlineEdit=GO;exports.MdOutlineExpand=DO;exports.MdOutlineFileUpload=zO;exports.MdOutlineKeyboardArrowLeft=HO;exports.MdOutlineKeyboardArrowRight=VO;exports.MdOutlineKeyboardDoubleArrowLeft=qO;exports.MdOutlineMenu=QO;exports.MdOutlinePhotoLibrary=ZO;exports.MdOutlineStar=eE;exports.MdSave=$O;exports.MdSaveAs=MO;exports.MdSearch=EO;exports.MiniDetailWrapper=I2;exports.Modal=bn;exports.ModalContext=cp;exports.NoInputContainer=A2;exports.Oe=I;exports.PageContainer=Tee;exports.PrimaryButton=Mi;exports.PromptContext=dx;exports.Re=hee;exports.ResponsiveContextDropdown=$2;exports.ResponsiveContextDropdownItem=$p;exports.RowLabelInput=As;exports.ShortcutLinksContext=$te;exports.SideContentBar=MT;exports.SimpleDropdownToggle=kp;exports.SimplePicker=w2;exports.SimpleTooltip=hp;exports.Spinner=dp;exports.TextInput=P2;exports.TransitionWrapper=Fy;exports.Typography=dn;exports.UserAvatarToggle=j5;exports.UserContext=vx;exports._=zq;exports._extends=Ac;exports._inheritsLoose=$y;exports._objectWithoutPropertiesLoose=Dh;exports.a=_2;exports.addLeadingZeros=dt;exports.addMonths=by;exports.addYears=ky;exports.atobUtf8=Cx;exports.buildEmployeeNameString=c6;exports.buildOrgUnitString=l6;exports.buildVehicleNameString=s6;exports.cancelToken=h$;exports.capitalizeFirstLetter=o6;exports.classNames=Q;exports.classes=Hf;exports.classes$1=b2;exports.compareDate=f6;exports.compareDateTime=h6;exports.constructFrom=zn;exports.context=Il;exports.differenceInCalendarDays=Ty;exports.divWithClassName=Wh;exports.extractErrorsFromResponse=fp;exports.extractFilename=Ox;exports.extractPermissionsFromResponse=xx;exports.fixNameIdNulls=bx;exports.format=Ih;exports.formatDate=i6;exports.formatDateTime=a6;exports.formatFileSize=xa;exports.getDateString=y6;exports.getDaysDifference=p6;exports.getDefaultExportFromCjs=Rt;exports.getFirstDayOfMonth=kx;exports.getFirstDayOfOffsetMonth=m6;exports.getFirstDayOfYear=v6;exports.getLastDayOfMonth=Sx;exports.getLastDayOfOffsetMonth=g6;exports.getLastDayOfYear=b6;exports.getSharedManager=H1;exports.getTimezoneOffsetInMilliseconds=pf;exports.hasOnlyNullValues=yx;exports.hookFormSetServerErrors=YE;exports.invariant=mf;exports.isISODate=Tx;exports.isPrimitive=zc;exports.isValidDate=d6;exports.joinStrings=Bo;exports.jsxRuntimeExports=b;exports.millisecondsInHour=kl;exports.millisecondsInMinute=jh;exports.millisecondsInWeek=Ah;exports.msToStartOfNextDay=u6;exports.openFileFromResponse=_6;exports.parseISO=Ol;exports.pe=dK;exports.replaceNullValuesOnlyObjectsWithNulls=qE;exports.requireReactIs=Fh;exports.saveFile=Hc;exports.saveFileFromResponse=x6;exports.secondsInDay=Ph;exports.secondsInHour=yy;exports.secondsInMinute=GT;exports.secondsInMonth=_y;exports.secondsInQuarter=KT;exports.secondsInWeek=ZT;exports.secondsInYear=xy;exports.shortenText=r6;exports.startOfDay=hf;exports.startOfWeek=pa;exports.stringContains=Ex;exports.stringSearchWithin=pp;exports.stringStartsWith=Mx;exports.style=Wr;exports.t=fd;exports.toDate=sn;exports.transitionEndListener=Dy;exports.triggerBrowserReflow=Ny;exports.trimIsoDate=Wl;exports.truncateText=wx;exports.urlfyArray=Af;exports.useAuth=e2;exports.useAxios=Gl;exports.useBootstrapBreakpoints=Ry;exports.useBootstrapMinBreakpoint=Ay;exports.useBootstrapPrefix=He;exports.useClickOutside=d2;exports.useClipboard=p2;exports.useCol=Yy;exports.useConfirm=_p;exports.useCookies=xp;exports.useEventCallback=Et;exports.useFormControlType=Cp;exports.useFormDisabledContext=Xl;exports.useIsomorphicEffect=Po;exports.useKeyPress=h2;exports.useNotifications=Yl;exports.usePermissions=f2;exports.usePrompt=fx;exports.useSwipeable=Rp;exports.useWindowSize=$s;exports.useZodSchemaTypes=Kl;exports.z=Zt;
|
|
279
|
+
`,fill:i,opacity:o,strokeWidth:c,stroke:l===void 0?"transparent":l,style:{pointerEvents:"none"}})})};function gi(){return gi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gi.apply(this,arguments)}var Oq={top:0,right:0,bottom:0,left:0},Qm=function(e){var t,n=e.direction,r=e.itemsSpacing,i=e.padding,a=e.itemCount,o=e.itemWidth,s=e.itemHeight;if(typeof i!="number"&&(typeof(t=i)!="object"||Array.isArray(t)||t===null))throw new Error("Invalid property padding, must be one of: number, object");var c=typeof i=="number"?{top:i,right:i,bottom:i,left:i}:gi({},Oq,i),l=c.left+c.right,u=c.top+c.bottom,d=o+l,f=s+u,h=(a-1)*r;return n==="row"?d=o*a+h+l:n==="column"&&(f=s*a+h+u),{width:d,height:f,padding:c}},VC=function(e){var t=e.anchor,n=e.translateX,r=e.translateY,i=e.containerWidth,a=e.containerHeight,o=e.width,s=e.height,c=n,l=r;switch(t){case"top":c+=(i-o)/2;break;case"top-right":c+=i-o;break;case"right":c+=i-o,l+=(a-s)/2;break;case"bottom-right":c+=i-o,l+=a-s;break;case"bottom":c+=(i-o)/2,l+=a-s;break;case"bottom-left":l+=a-s;break;case"left":l+=(a-s)/2;break;case"center":c+=(i-o)/2,l+=(a-s)/2}return{x:c,y:l}},qC=function(e){var t,n,r,i,a,o,s=e.direction,c=e.justify,l=e.symbolSize,u=e.symbolSpacing,d=e.width,f=e.height;switch(s){case"left-to-right":t=0,n=(f-l)/2,i=f/2,o="central",c?(r=d,a="end"):(r=l+u,a="start");break;case"right-to-left":t=d-l,n=(f-l)/2,i=f/2,o="central",c?(r=0,a="start"):(r=d-l-u,a="end");break;case"top-to-bottom":t=(d-l)/2,n=0,r=d/2,a="middle",c?(i=f,o="alphabetic"):(i=l+u,o="text-before-edge");break;case"bottom-to-top":t=(d-l)/2,n=f-l,r=d/2,a="middle",c?(i=0,o="text-before-edge"):(i=f-l-u,o="alphabetic")}return{symbolX:t,symbolY:n,labelX:r,labelY:i,labelAnchor:a,labelAlignment:o}},Eq={circle:Cq,diamond:Tq,square:kq,triangle:Sq},Mq=function(e){var t,n,r,i,a,o,s,c,l,u,d,f=e.x,h=e.y,g=e.width,p=e.height,v=e.data,x=e.direction,_=x===void 0?"left-to-right":x,y=e.justify,C=y!==void 0&&y,w=e.textColor,T=e.background,$=T===void 0?"transparent":T,R=e.opacity,S=R===void 0?1:R,k=e.symbolShape,O=k===void 0?"square":k,D=e.symbolSize,E=D===void 0?16:D,M=e.symbolSpacing,j=M===void 0?8:M,F=e.symbolBorderWidth,W=F===void 0?0:F,B=e.symbolBorderColor,U=B===void 0?"transparent":B,N=e.onClick,V=e.onMouseEnter,X=e.onMouseLeave,ne=e.toggleSerie,K=e.effects,J=m.useState({}),q=J[0],G=J[1],z=ht(),L=m.useCallback(function(Be){if(K){var Ke=K.filter(function(Ye){return Ye.on==="hover"}).reduce(function(Ye,de){return gi({},Ye,de.style)},{});G(Ke)}V==null||V(v,Be)},[V,v,K]),H=m.useCallback(function(Be){if(K){var Ke=K.filter(function(Ye){return Ye.on!=="hover"}).reduce(function(Ye,de){return gi({},Ye,de.style)},{});G(Ke)}X==null||X(v,Be)},[X,v,K]),ee=qC({direction:_,justify:C,symbolSize:(t=q.symbolSize)!=null?t:E,symbolSpacing:j,width:g,height:p}),A=ee.symbolX,se=ee.symbolY,ce=ee.labelX,ue=ee.labelY,we=ee.labelAnchor,Te=ee.labelAlignment,at=[N,V,X,ne].some(function(Be){return Be!==void 0}),tt=typeof O=="function"?O:Eq[O];return b.jsxs("g",{transform:"translate("+f+","+h+")",style:{opacity:(n=q.itemOpacity)!=null?n:S},children:[b.jsx("rect",{width:g,height:p,fill:(r=q.itemBackground)!=null?r:$,style:{cursor:at?"pointer":"auto"},onClick:function(Be){N==null||N(v,Be),ne==null||ne(v.id)},onMouseEnter:L,onMouseLeave:H}),ie.createElement(tt,gi({id:v.id,x:A,y:se,size:(i=q.symbolSize)!=null?i:E,fill:(a=(o=v.fill)!=null?o:v.color)!=null?a:"black",borderWidth:(s=q.symbolBorderWidth)!=null?s:W,borderColor:(c=q.symbolBorderColor)!=null?c:U},v.hidden?z.legends.hidden.symbol:void 0)),b.jsx("text",{textAnchor:we,style:gi({},Zm(z.legends.text),{fill:(l=(u=(d=q.itemTextColor)!=null?d:w)!=null?u:z.legends.text.fill)!=null?l:"black",dominantBaseline:Te,pointerEvents:"none",userSelect:"none"},v.hidden?z.legends.hidden.text:void 0),x:ce,y:ue,children:v.label})]})},$q=function(e){var t=e.data,n=e.x,r=e.y,i=e.direction,a=e.padding,o=a===void 0?0:a,s=e.justify,c=e.effects,l=e.itemWidth,u=e.itemHeight,d=e.itemDirection,f=d===void 0?"left-to-right":d,h=e.itemsSpacing,g=h===void 0?0:h,p=e.itemTextColor,v=e.itemBackground,x=v===void 0?"transparent":v,_=e.itemOpacity,y=_===void 0?1:_,C=e.symbolShape,w=e.symbolSize,T=e.symbolSpacing,$=e.symbolBorderWidth,R=e.symbolBorderColor,S=e.onClick,k=e.onMouseEnter,O=e.onMouseLeave,D=e.toggleSerie,E=Qm({itemCount:t.length,itemWidth:l,itemHeight:u,itemsSpacing:g,direction:i,padding:o}).padding,M=i==="row"?l+g:0,j=i==="column"?u+g:0;return b.jsx("g",{transform:"translate("+n+","+r+")",children:t.map(function(F,W){return b.jsx(Mq,{data:F,x:W*M+E.left,y:W*j+E.top,width:l,height:u,direction:f,justify:s,effects:c,textColor:p,background:x,opacity:y,symbolShape:C,symbolSize:w,symbolSpacing:T,symbolBorderWidth:$,symbolBorderColor:R,onClick:S,onMouseEnter:k,onMouseLeave:O,toggleSerie:D},W)})})},Jm=function(e){var t=e.data,n=e.containerWidth,r=e.containerHeight,i=e.translateX,a=i===void 0?0:i,o=e.translateY,s=o===void 0?0:o,c=e.anchor,l=e.direction,u=e.padding,d=u===void 0?0:u,f=e.justify,h=e.itemsSpacing,g=h===void 0?0:h,p=e.itemWidth,v=e.itemHeight,x=e.itemDirection,_=e.itemTextColor,y=e.itemBackground,C=e.itemOpacity,w=e.symbolShape,T=e.symbolSize,$=e.symbolSpacing,R=e.symbolBorderWidth,S=e.symbolBorderColor,k=e.onClick,O=e.onMouseEnter,D=e.onMouseLeave,E=e.toggleSerie,M=e.effects,j=Qm({itemCount:t.length,itemsSpacing:g,itemWidth:p,itemHeight:v,direction:l,padding:d}),F=j.width,W=j.height,B=VC({anchor:c,translateX:a,translateY:s,containerWidth:n,containerHeight:r,width:F,height:W}),U=B.x,N=B.y;return b.jsx($q,{data:t,x:U,y:N,direction:l,padding:d,justify:f,effects:M,itemsSpacing:g,itemWidth:p,itemHeight:v,itemDirection:x,itemTextColor:_,itemBackground:y,itemOpacity:C,symbolShape:w,symbolSize:T,symbolSpacing:$,symbolBorderWidth:R,symbolBorderColor:S,onClick:k,onMouseEnter:O,onMouseLeave:D,toggleSerie:typeof E=="boolean"?void 0:E})},Rq={start:"left",middle:"center",end:"right"},YC=function(e,t){var n=t.data,r=t.containerWidth,i=t.containerHeight,a=t.translateX,o=a===void 0?0:a,s=t.translateY,c=s===void 0?0:s,l=t.anchor,u=t.direction,d=t.padding,f=d===void 0?0:d,h=t.justify,g=h!==void 0&&h,p=t.itemsSpacing,v=p===void 0?0:p,x=t.itemWidth,_=t.itemHeight,y=t.itemDirection,C=y===void 0?"left-to-right":y,w=t.itemTextColor,T=t.symbolSize,$=T===void 0?16:T,R=t.symbolSpacing,S=R===void 0?8:R,k=t.theme,O=Qm({itemCount:n.length,itemWidth:x,itemHeight:_,itemsSpacing:v,direction:u,padding:f}),D=O.width,E=O.height,M=O.padding,j=VC({anchor:l,translateX:o,translateY:c,containerWidth:r,containerHeight:i,width:D,height:E}),F=j.x,W=j.y,B=u==="row"?x+v:0,U=u==="column"?_+v:0;e.save(),e.translate(F,W),e.font=k.legends.text.fontSize+"px "+(k.legends.text.fontFamily||"sans-serif"),n.forEach(function(N,V){var X,ne,K=V*B+M.left,J=V*U+M.top,q=qC({direction:C,justify:g,symbolSize:$,symbolSpacing:S,width:x,height:_}),G=q.symbolX,z=q.symbolY,L=q.labelX,H=q.labelY,ee=q.labelAnchor,A=q.labelAlignment;e.fillStyle=(X=N.color)!=null?X:"black",e.fillRect(K+G,J+z,$,$),e.textAlign=Rq[ee],A==="central"&&(e.textBaseline="middle"),e.fillStyle=(ne=w??k.legends.text.fill)!=null?ne:"black",e.fillText(String(N.label),K+L,J+H)}),e.restore()};function Jr(){return Jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jr.apply(this,arguments)}function GC(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var Lb,Aq=function(e){var t=e.width,n=e.height,r=e.legends,i=e.data,a=e.toggleSerie;return b.jsx(b.Fragment,{children:r.map(function(o,s){var c;return b.jsx(Jm,Jr({},o,{containerWidth:t,containerHeight:n,data:(c=o.data)!=null?c:i,toggleSerie:o.toggleSerie?a:void 0}),s)})})},Se={id:"id",value:"value",sortByValue:!1,innerRadius:0,padAngle:0,cornerRadius:0,layers:["arcs","arcLinkLabels","arcLabels","legends"],startAngle:0,endAngle:360,fit:!0,activeInnerRadiusOffset:0,activeOuterRadiusOffset:0,borderWidth:0,borderColor:{from:"color",modifiers:[["darker",1]]},enableArcLabels:!0,arcLabel:"formattedValue",arcLabelsSkipAngle:0,arcLabelsRadiusOffset:.5,arcLabelsTextColor:{theme:"labels.text.fill"},enableArcLinkLabels:!0,arcLinkLabel:"id",arcLinkLabelsSkipAngle:0,arcLinkLabelsOffset:0,arcLinkLabelsDiagonalLength:16,arcLinkLabelsStraightLength:24,arcLinkLabelsThickness:1,arcLinkLabelsTextOffset:6,arcLinkLabelsTextColor:{theme:"labels.text.fill"},arcLinkLabelsColor:{theme:"axis.ticks.line.stroke"},colors:{scheme:"nivo"},defs:[],fill:[],isInteractive:!0,animate:!0,motionConfig:"gentle",transitionMode:"innerRadius",tooltip:function(e){var t=e.datum;return b.jsx(Zp,{id:t.id,value:t.formattedValue,enableChip:!0,color:t.color})},legends:[],role:"img",pixelRatio:typeof window<"u"&&(Lb=window.devicePixelRatio)!=null?Lb:1},jq=["points"],Pq=function(e){var t=e.data,n=e.id,r=n===void 0?Se.id:n,i=e.value,a=i===void 0?Se.value:i,o=e.valueFormat,s=e.colors,c=s===void 0?Se.colors:s,l=Ti(r),u=Ti(a),d=Ma(o),f=Xm(c,"id");return m.useMemo(function(){return t.map(function(h){var g,p=l(h),v=u(h),x={id:p,label:(g=h.label)!=null?g:p,hidden:!1,value:v,formattedValue:d(v),data:h};return Jr({},x,{color:f(x)})})},[t,l,u,d,f])},Iq=function(e){var t=e.data,n=e.startAngle,r=e.endAngle,i=e.innerRadius,a=e.outerRadius,o=e.padAngle,s=e.sortByValue,c=e.activeId,l=e.activeInnerRadiusOffset,u=e.activeOuterRadiusOffset,d=e.hiddenIds,f=e.forwardLegendData,h=m.useMemo(function(){var x=yU().value(function(_){return _.value}).startAngle(An(n)).endAngle(An(r)).padAngle(An(o));return s||x.sortValues(null),x},[n,r,o,s]),g=m.useMemo(function(){var x=t.filter(function(_){return!d.includes(_.id)});return{dataWithArc:h(x).map(function(_){var y=Math.abs(_.endAngle-_.startAngle);return Jr({},_.data,{arc:{index:_.index,startAngle:_.startAngle,endAngle:_.endAngle,innerRadius:c===_.data.id?i-l:i,outerRadius:c===_.data.id?a+u:a,thickness:a-i,padAngle:_.padAngle,angle:y,angleDeg:cd(y)}})}),legendData:t.map(function(_){return{id:_.id,label:_.label,color:_.color,hidden:d.includes(_.id),data:_}})}},[h,t,d,c,i,l,a,u]),p=g.legendData,v=m.useRef(f);return m.useEffect(function(){typeof v.current=="function"&&v.current(p)},[v,p]),g},Dq=function(e){var t=e.activeId,n=e.onActiveIdChange,r=e.defaultActiveId,i=t!==void 0,a=m.useState(i||r===void 0?null:r),o=a[0],s=a[1];return{activeId:i?t:o,setActiveId:m.useCallback(function(c){n&&n(c),i||s(c)},[i,n,s])}},Nq=function(e){var t=e.data,n=e.width,r=e.height,i=e.innerRadius,a=i===void 0?Se.innerRadius:i,o=e.startAngle,s=o===void 0?Se.startAngle:o,c=e.endAngle,l=c===void 0?Se.endAngle:c,u=e.padAngle,d=u===void 0?Se.padAngle:u,f=e.sortByValue,h=f===void 0?Se.sortByValue:f,g=e.cornerRadius,p=g===void 0?Se.cornerRadius:g,v=e.fit,x=v===void 0?Se.fit:v,_=e.activeInnerRadiusOffset,y=_===void 0?Se.activeInnerRadiusOffset:_,C=e.activeOuterRadiusOffset,w=C===void 0?Se.activeOuterRadiusOffset:C,T=e.activeId,$=e.onActiveIdChange,R=e.defaultActiveId,S=e.forwardLegendData,k=Dq({activeId:T,onActiveIdChange:$,defaultActiveId:R}),O=k.activeId,D=k.setActiveId,E=m.useState([]),M=E[0],j=E[1],F=m.useMemo(function(){var U,N=Math.min(n,r)/2,V=N*Math.min(a,1),X=n/2,ne=r/2;if(x){var K=_q(X,ne,N,s-90,l-90),J=K.points,q=GC(K,jq),G=Math.min(n/q.width,r/q.height),z={width:q.width*G,height:q.height*G};z.x=(n-z.width)/2,z.y=(r-z.height)/2,X=(X-q.x)/q.width*q.width*G+z.x,ne=(ne-q.y)/q.height*q.height*G+z.y,U={box:q,ratio:G,points:J},N*=G,V*=G}return{centerX:X,centerY:ne,radius:N,innerRadius:V,debug:U}},[n,r,a,s,l,x]),W=Iq({data:t,startAngle:s,endAngle:l,innerRadius:F.innerRadius,outerRadius:F.radius,padAngle:d,sortByValue:h,activeId:O,activeInnerRadiusOffset:y,activeOuterRadiusOffset:w,hiddenIds:M,forwardLegendData:S}),B=m.useCallback(function(U){j(function(N){return N.indexOf(U)>-1?N.filter(function(V){return V!==U}):[].concat(N,[U])})},[]);return Jr({arcGenerator:wq({cornerRadius:p,padAngle:An(d)}),activeId:O,setActiveId:D,toggleSerie:B},W,F)},Fq=function(e){var t=e.dataWithArc,n=e.arcGenerator,r=e.centerX,i=e.centerY,a=e.radius,o=e.innerRadius;return m.useMemo(function(){return{dataWithArc:t,arcGenerator:n,centerX:r,centerY:i,radius:a,innerRadius:o}},[t,n,r,i,a,o])},Lq=function(e){var t=e.center,n=e.data,r=e.arcGenerator,i=e.borderWidth,a=e.borderColor,o=e.isInteractive,s=e.onClick,c=e.onMouseEnter,l=e.onMouseMove,u=e.onMouseLeave,d=e.setActiveId,f=e.tooltip,h=e.transitionMode,g=Li(),p=g.showTooltipFromEvent,v=g.hideTooltip,x=m.useMemo(function(){if(o)return function(w,T){s==null||s(w,T)}},[o,s]),_=m.useMemo(function(){if(o)return function(w,T){p(m.createElement(f,{datum:w}),T),d(w.id),c==null||c(w,T)}},[o,p,d,c,f]),y=m.useMemo(function(){if(o)return function(w,T){p(m.createElement(f,{datum:w}),T),l==null||l(w,T)}},[o,p,l,f]),C=m.useMemo(function(){if(o)return function(w,T){v(),d(null),u==null||u(w,T)}},[o,v,d,u]);return b.jsx(xq,{center:t,data:n,arcGenerator:r,borderWidth:i,borderColor:a,transitionMode:h,onClick:x,onMouseEnter:_,onMouseMove:y,onMouseLeave:C})},Bq=["isInteractive","animate","motionConfig","theme","renderWrapper"],Wq=function(e){var t=e.data,n=e.id,r=n===void 0?Se.id:n,i=e.value,a=i===void 0?Se.value:i,o=e.valueFormat,s=e.sortByValue,c=s===void 0?Se.sortByValue:s,l=e.layers,u=l===void 0?Se.layers:l,d=e.startAngle,f=d===void 0?Se.startAngle:d,h=e.endAngle,g=h===void 0?Se.endAngle:h,p=e.padAngle,v=p===void 0?Se.padAngle:p,x=e.fit,_=x===void 0?Se.fit:x,y=e.innerRadius,C=y===void 0?Se.innerRadius:y,w=e.cornerRadius,T=w===void 0?Se.cornerRadius:w,$=e.activeInnerRadiusOffset,R=$===void 0?Se.activeInnerRadiusOffset:$,S=e.activeOuterRadiusOffset,k=S===void 0?Se.activeOuterRadiusOffset:S,O=e.width,D=e.height,E=e.margin,M=e.colors,j=M===void 0?Se.colors:M,F=e.borderWidth,W=F===void 0?Se.borderWidth:F,B=e.borderColor,U=B===void 0?Se.borderColor:B,N=e.enableArcLabels,V=N===void 0?Se.enableArcLabels:N,X=e.arcLabel,ne=X===void 0?Se.arcLabel:X,K=e.arcLabelsSkipAngle,J=K===void 0?Se.arcLabelsSkipAngle:K,q=e.arcLabelsTextColor,G=q===void 0?Se.arcLabelsTextColor:q,z=e.arcLabelsRadiusOffset,L=z===void 0?Se.arcLabelsRadiusOffset:z,H=e.arcLabelsComponent,ee=e.enableArcLinkLabels,A=ee===void 0?Se.enableArcLinkLabels:ee,se=e.arcLinkLabel,ce=se===void 0?Se.arcLinkLabel:se,ue=e.arcLinkLabelsSkipAngle,we=ue===void 0?Se.arcLinkLabelsSkipAngle:ue,Te=e.arcLinkLabelsOffset,at=Te===void 0?Se.arcLinkLabelsOffset:Te,tt=e.arcLinkLabelsDiagonalLength,Be=tt===void 0?Se.arcLinkLabelsDiagonalLength:tt,Ke=e.arcLinkLabelsStraightLength,Ye=Ke===void 0?Se.arcLinkLabelsStraightLength:Ke,de=e.arcLinkLabelsThickness,ke=de===void 0?Se.arcLinkLabelsThickness:de,Oe=e.arcLinkLabelsTextOffset,ve=Oe===void 0?Se.arcLinkLabelsTextOffset:Oe,Ie=e.arcLinkLabelsTextColor,Xe=Ie===void 0?Se.arcLinkLabelsTextColor:Ie,It=e.arcLinkLabelsColor,mt=It===void 0?Se.arcLinkLabelsColor:It,Je=e.arcLinkLabelComponent,bt=e.defs,At=bt===void 0?Se.defs:bt,it=e.fill,gt=it===void 0?Se.fill:it,yt=e.isInteractive,Lt=yt===void 0?Se.isInteractive:yt,$e=e.onClick,Pe=e.onMouseEnter,ze=e.onMouseMove,nt=e.onMouseLeave,vt=e.tooltip,kt=vt===void 0?Se.tooltip:vt,Xt=e.activeId,Dt=e.onActiveIdChange,Bt=e.defaultActiveId,Ht=e.transitionMode,Mt=Ht===void 0?Se.transitionMode:Ht,Wt=e.legends,Jt=Wt===void 0?Se.legends:Wt,Vt=e.forwardLegendData,fe=e.role,ye=fe===void 0?Se.role:fe,Ee=Us(O,D,E),qe=Ee.outerWidth,Ge=Ee.outerHeight,ot=Ee.margin,P=Ee.innerWidth,re=Ee.innerHeight,Z=Pq({data:t,id:r,value:a,valueFormat:o,colors:j}),te=Nq({data:Z,width:P,height:re,fit:_,innerRadius:C,startAngle:f,endAngle:g,padAngle:v,sortByValue:c,cornerRadius:T,activeInnerRadiusOffset:R,activeOuterRadiusOffset:k,activeId:Xt,onActiveIdChange:Dt,defaultActiveId:Bt,forwardLegendData:Vt}),ge=te.dataWithArc,Ce=te.legendData,pe=te.arcGenerator,be=te.centerX,Ae=te.centerY,Me=te.radius,et=te.innerRadius,Nt=te.setActiveId,wt=te.toggleSerie,Ut=Km(At,ge,gt),le={arcs:null,arcLinkLabels:null,arcLabels:null,legends:null};u.includes("arcs")&&(le.arcs=b.jsx(Lq,{center:[be,Ae],data:ge,arcGenerator:pe,borderWidth:W,borderColor:U,isInteractive:Lt,onClick:$e,onMouseEnter:Pe,onMouseMove:ze,onMouseLeave:nt,setActiveId:Nt,tooltip:kt,transitionMode:Mt},"arcs")),A&&u.includes("arcLinkLabels")&&(le.arcLinkLabels=b.jsx(gq,{center:[be,Ae],data:ge,label:ce,skipAngle:we,offset:at,diagonalLength:Be,straightLength:Ye,strokeWidth:ke,textOffset:ve,textColor:Xe,linkColor:mt,component:Je},"arcLinkLabels")),V&&u.includes("arcLabels")&&(le.arcLabels=b.jsx(cq,{center:[be,Ae],data:ge,label:ne,radiusOffset:L,skipAngle:J,textColor:G,transitionMode:Mt,component:H},"arcLabels")),Jt.length>0&&u.includes("legends")&&(le.legends=b.jsx(Aq,{width:P,height:re,data:Ce,legends:Jt,toggleSerie:wt},"legends"));var cn=Fq({dataWithArc:ge,arcGenerator:pe,centerX:be,centerY:Ae,radius:Me,innerRadius:et});return b.jsx(ld,{width:qe,height:Ge,margin:ot,defs:Ut,role:ye,children:u.map(function(Ft,dr){return le[Ft]!==void 0?le[Ft]:typeof Ft=="function"?b.jsx(m.Fragment,{children:m.createElement(Ft,cn)},dr):null})})},Uq=function(e){var t=e.isInteractive,n=t===void 0?Se.isInteractive:t,r=e.animate,i=r===void 0?Se.animate:r,a=e.motionConfig,o=a===void 0?Se.motionConfig:a,s=e.theme,c=e.renderWrapper,l=GC(e,Bq);return b.jsx(zs,{animate:i,isInteractive:n,motionConfig:o,renderWrapper:c,theme:s,children:b.jsx(Wq,Jr({isInteractive:n},l))})},zq=function(e){return b.jsx(Ka,{children:function(t){var n=t.width,r=t.height;return b.jsx(Uq,Jr({width:n,height:r},e))}})};function Hq(){}var Vq=Hq,of=gC,qq=Vq,Yq=Hm,Gq=1/0,Zq=of&&1/Yq(new of([,-0]))[1]==Gq?function(e){return new of(e)}:qq,Kq=Zq,Xq=Pm,Qq=Hw,Jq=Vw,eY=Im,tY=Kq,nY=Hm,rY=200;function iY(e,t,n){var r=-1,i=Qq,a=e.length,o=!0,s=[],c=s;if(n)o=!1,i=Jq;else if(a>=rY){var l=t?null:tY(e);if(l)return nY(l);o=!1,i=eY,c=new Xq}else c=t?[]:s;e:for(;++r<a;){var u=e[r],d=t?t(u):u;if(u=n||u!==0?u:0,o&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue e;t&&c.push(d),s.push(u)}else i(c,d,n)||(c!==s&&c.push(d),s.push(u))}return s}var ZC=iY,aY=ZC;function oY(e){return e&&e.length?aY(e):[]}var sY=oY;const Bb=Rt(sY);var cY=pu,lY=qm,uY=1,dY=2;function fY(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new cY;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?lY(u,l,uY|dY,r,d):f))return!1}}return!0}var hY=fY,pY=ur;function mY(e){return e===e&&!pY(e)}var KC=mY,gY=KC,vY=Ws;function bY(e){for(var t=vY(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,gY(i)]}return t}var yY=bY;function xY(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var XC=xY,_Y=hY,wY=yY,CY=XC;function TY(e){var t=wY(e);return t.length==1&&t[0][2]?CY(t[0][0],t[0][1]):function(n){return n===e||_Y(n,e,t)}}var kY=TY,SY=qm,OY=q_,EY=sC,MY=lm,$Y=KC,RY=XC,AY=Ya,jY=1,PY=2;function IY(e,t){return MY(e)&&$Y(t)?RY(AY(e),t):function(n){var r=OY(n,e);return r===void 0&&r===t?EY(n,e):SY(t,r,jY|PY)}}var DY=IY;function NY(e){return function(t){return t==null?void 0:t[e]}}var FY=NY,LY=Ls;function BY(e){return function(t){return LY(t,e)}}var WY=BY,UY=FY,zY=WY,HY=lm,VY=Ya;function qY(e){return HY(e)?UY(VY(e)):zY(e)}var YY=qY,GY=kY,ZY=DY,KY=yu,XY=Cn,QY=YY;function JY(e){return typeof e=="function"?e:e==null?KY:typeof e=="object"?XY(e)?ZY(e[0],e[1]):GY(e):QY(e)}var eg=JY,eG=eg,tG=ZC;function nG(e,t){return e&&e.length?tG(e,eG(t)):[]}var rG=nG;const Oh=Rt(rG);var iG=O_,aG=Ws;function oG(e,t){return e&&iG(e,t,aG)}var sG=oG,cG=za;function lG(e,t){return function(n,r){if(n==null)return n;if(!cG(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var uG=lG,dG=sG,fG=uG,hG=fG(dG),QC=hG,pG=QC,mG=za;function gG(e,t){var n=-1,r=mG(e)?Array(e.length):[];return pG(e,function(i,a,o){r[++n]=t(i,a,o)}),r}var vG=gG;function bG(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var yG=bG,Wb=xu;function xG(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=Wb(e),o=t!==void 0,s=t===null,c=t===t,l=Wb(t);if(!s&&!l&&!a&&e>t||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}var _G=xG,wG=_G;function CG(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=wG(i[r],a[r]);if(c){if(r>=s)return c;var l=n[r];return c*(l=="desc"?-1:1)}}return e.index-t.index}var TG=CG,sf=_u,kG=Ls,SG=eg,OG=vG,EG=yG,MG=Ha,$G=TG,RG=yu,AG=Cn;function jG(e,t,n){t.length?t=sf(t,function(a){return AG(a)?function(o){return kG(o,a.length===1?a[0]:a)}:a}):t=[RG];var r=-1;t=sf(t,MG(SG));var i=OG(e,function(a,o,s){var c=sf(t,function(l){return l(a)});return{criteria:c,index:++r,value:a}});return EG(i,function(a,o){return $G(a,o,n)})}var PG=jG,IG=lC,DG=PG,NG=cm,Ub=U_,FG=NG(function(e,t){if(e==null)return[];var n=t.length;return n>1&&Ub(e,t[0],t[1])?t=[]:n>2&&Ub(t[0],t[1],t[2])&&(t=[t[0]]),DG(e,IG(t,1),[])}),LG=FG;const BG=Rt(LG);var WG=Or,UG=Nn,zG="[object Date]";function HG(e){return UG(e)&&WG(e)==zG}var VG=HG,qG=VG,YG=Ha,zb=vu,Hb=zb&&zb.isDate,GG=Hb?YG(Hb):qG,ZG=GG;const KG=Rt(ZG);function ui(){return ui=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ui.apply(this,arguments)}var Ji=[function(e){return e.setMilliseconds(0)},function(e){return e.setSeconds(0)},function(e){return e.setMinutes(0)},function(e){return e.setHours(0)},function(e){return e.setDate(1)},function(e){return e.setMonth(0)}],XG={millisecond:[],second:Ji.slice(0,1),minute:Ji.slice(0,2),hour:Ji.slice(0,3),day:Ji.slice(0,4),month:Ji.slice(0,5),year:Ji.slice(0,6)},QG=function(e){return function(t){return XG[e].forEach(function(n){n(t)}),t}},JC=function(e){var t=e.format,n=t===void 0?"native":t,r=e.precision,i=r===void 0?"millisecond":r,a=e.useUTC,o=a===void 0||a,s=QG(i);return function(c){if(c===void 0)return c;if(n==="native"||c instanceof Date)return s(c);var l=o?Iw(n):jw(n);return s(l(c))}},JG=function(e,t,n,r){var i,a,o,s,c=e.min,l=c===void 0?0:c,u=e.max,d=u===void 0?"auto":u,f=e.stacked,h=f!==void 0&&f,g=e.reverse,p=g!==void 0&&g,v=e.clamp,x=v!==void 0&&v,_=e.nice,y=_!==void 0&&_;l==="auto"?i=h===!0?(a=t.minStacked)!=null?a:0:t.min:i=l,d==="auto"?o=h===!0?(s=t.maxStacked)!=null?s:0:t.max:o=d;var C=ow().rangeRound(r==="x"?[0,n]:[n,0]).domain(p?[o,i]:[i,o]).clamp(x);return y===!0?C.nice():typeof y=="number"&&C.nice(y),eZ(C,h)},eZ=function(e,t){t===void 0&&(t=!1);var n=e;return n.type="linear",n.stacked=t,n},tZ=function(e,t,n){var r=UF().range([0,n]).domain(t.all);return r.type="point",r},nZ=function(e,t,n,r){var i=e.round,a=i===void 0||i,o=vm().range(r==="x"?[0,n]:[n,0]).domain(t.all).round(a);return rZ(o)},rZ=function(e){var t=e;return t.type="band",t},iZ=function(e,t,n){var r,i,a=e.format,o=a===void 0?"native":a,s=e.precision,c=s===void 0?"millisecond":s,l=e.min,u=l===void 0?"auto":l,d=e.max,f=d===void 0?"auto":d,h=e.useUTC,g=h===void 0||h,p=e.nice,v=p!==void 0&&p,x=JC({format:o,precision:c,useUTC:g});r=u==="auto"?x(t.min):o!=="native"?x(u):u,i=f==="auto"?x(t.max):o!=="native"?x(f):f;var _=g?jB():AB();_.range([0,n]),r&&i&&_.domain([r,i]),v===!0?_.nice():typeof v!="object"&&typeof v!="number"||_.nice(v);var y=_;return y.type="time",y.useUTC=g,y},aZ=function(e,t,n,r){var i,a=e.base,o=a===void 0?10:a,s=e.min,c=s===void 0?"auto":s,l=e.max,u=l===void 0?"auto":l;if(t.all.some(function(p){return p===0}))throw new Error("a log scale domain must not include or cross zero");var d,f,h=!1;if(t.all.filter(function(p){return p!=null}).forEach(function(p){h||(i===void 0?i=Math.sign(p):Math.sign(p)!==i&&(h=!0))}),h)throw new Error("a log scale domain must be strictly-positive or strictly-negative");d=c==="auto"?t.min:c,f=u==="auto"?t.max:u;var g=cw().domain([d,f]).rangeRound(r==="x"?[0,n]:[n,0]).base(o).nice();return g.type="log",g},oZ=function(e,t,n,r){var i,a,o=e.constant,s=o===void 0?1:o,c=e.min,l=c===void 0?"auto":c,u=e.max,d=u===void 0?"auto":u,f=e.reverse,h=f!==void 0&&f;i=l==="auto"?t.min:l,a=d==="auto"?t.max:d;var g=lw().constant(s).rangeRound(r==="x"?[0,n]:[n,0]).nice();h===!0?g.domain([a,i]):g.domain([i,a]);var p=g;return p.type="symlog",p},sZ=function(e){return e==="x"?"y":"x"},cZ=function(e,t){return e===t},lZ=function(e,t){return e.getTime()===t.getTime()};function ys(e,t,n,r){switch(e.type){case"linear":return JG(e,t,n,r);case"point":return tZ(e,t,n);case"band":return nZ(e,t,n,r);case"time":return iZ(e,t,n);case"log":return aZ(e,t,n,r);case"symlog":return oZ(e,t,n,r);default:throw new Error("invalid scale spec")}}var Vb=function(e,t,n){var r;if("stacked"in n&&n.stacked){var i=e.data[t==="x"?"xStacked":"yStacked"];return i==null?null:n(i)}return(r=n(e.data[t]))!=null?r:null},uZ=function(e,t,n,r,i){var a=e.map(function(u){return function(d){return ui({},d,{data:d.data.map(function(f){return{data:ui({},f)}})})}(u)}),o=dZ(a,t,n);"stacked"in t&&t.stacked===!0&&fZ(o,a),"stacked"in n&&n.stacked===!0&&hZ(o,a);var s=ys(t,o.x,r,"x"),c=ys(n,o.y,i,"y"),l=a.map(function(u){return ui({},u,{data:u.data.map(function(d){return ui({},d,{position:{x:Vb(d,"x",s),y:Vb(d,"y",c)}})})})});return ui({},o,{series:l,xScale:s,yScale:c})},dZ=function(e,t,n){return{x:qb(e,"x",t),y:qb(e,"y",n)}},qb=function(e,t,n,r){var i={},a=i.getValue,o=a===void 0?function(g){return g.data[t]}:a,s=i.setValue,c=s===void 0?function(g,p){g.data[t]=p}:s;if(n.type==="linear")e.forEach(function(g){g.data.forEach(function(p){var v=o(p);v&&c(p,parseFloat(String(v)))})});else if(n.type==="time"&&n.format!=="native"){var l=JC(n);e.forEach(function(g){g.data.forEach(function(p){var v=o(p);v&&c(p,l(v))})})}var u=[];switch(e.forEach(function(g){g.data.forEach(function(p){u.push(o(p))})}),n.type){case"linear":var d=BG(Bb(u).filter(function(g){return g!==null}),function(g){return g});return{all:d,min:Math.min.apply(Math,d),max:Math.max.apply(Math,d)};case"time":var f=Oh(u,function(g){return g.getTime()}).slice(0).sort(function(g,p){return p.getTime()-g.getTime()}).reverse();return{all:f,min:f[0],max:xe(f)};default:var h=Bb(u);return{all:h,min:h[0],max:xe(h)}}},eT=function(e,t,n){var r=sZ(e),i=[];t[r].all.forEach(function(a){var o=KG(a)?lZ:cZ,s=[];n.forEach(function(c){var l=c.data.find(function(h){return o(h.data[r],a)}),u=null,d=null;if(l!==void 0){if((u=l.data[e])!==null){var f=xe(s);f===void 0?d=u:f!==null&&(d=f+u)}l.data[e==="x"?"xStacked":"yStacked"]=d}s.push(d),d!==null&&i.push(d)})}),t[e].minStacked=Math.min.apply(Math,i),t[e].maxStacked=Math.max.apply(Math,i)},fZ=function(e,t){return eT("x",e,t)},hZ=function(e,t){return eT("y",e,t)},tT=function(e){var t=e.bandwidth();if(t===0)return e;var n=t/2;return e.round()&&(n=Math.round(n)),function(r){var i;return((i=e(r))!=null?i:0)+n}},nT={millisecond:[ms,ms],second:[hh,hh],minute:[mw,ww],hour:[gw,Cw],day:[zt(function(e){return e.setHours(0,0,0,0)},function(e,t){return e.setDate(e.getDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)}),zt(function(e){return e.setUTCHours(0,0,0,0)},function(e,t){return e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)})],week:[ml,gl],sunday:[ml,gl],monday:[gs,vs],tuesday:[vw,Tw],wednesday:[bw,kw],thursday:[Pi,Ii],friday:[yw,Sw],saturday:[xw,Ow],month:[_w,Ew],year:[Kr,Xr]},pZ=Object.keys(nT),mZ=new RegExp("^every\\s*(\\d+)?\\s*("+pZ.join("|")+")s?$","i"),rT=function(e,t){if(Array.isArray(t))return t;if(typeof t=="string"&&"useUTC"in e){var n=t.match(mZ);if(n){var r=n[1],i=n[2],a=nT[i][e.useUTC?1:0];if(i==="day"){var o,s,c=e.domain(),l=c[0],u=c[1],d=new Date(u);return d.setDate(d.getDate()+1),(o=(s=a.every(Number(r??1)))==null?void 0:s.range(l,d))!=null?o:[]}if(r===void 0)return e.ticks(a);var f=a.every(Number(r));if(f)return e.ticks(f)}throw new Error("Invalid tickValues: "+t)}if("ticks"in e){if(t===void 0)return e.ticks();if(typeof(h=t)=="number"&&isFinite(h)&&Math.floor(h)===h)return e.ticks(t)}var h;return e.domain()};function jn(){return jn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jn.apply(this,arguments)}var iT=function(e){var t,n=e.axis,r=e.scale,i=e.ticksPosition,a=e.tickValues,o=e.tickSize,s=e.tickPadding,c=e.tickRotation,l=e.truncateTickAt,u=e.engine,d=u===void 0?"svg":u,f=rT(r,a),h=RV[d],g="bandwidth"in r?tT(r):r,p={lineX:0,lineY:0},v={textX:0,textY:0},x=typeof document=="object"&&document.dir==="rtl",_=h.align.center,y=h.baseline.center;return n==="x"?(t=function(C){var w;return{x:(w=g(C))!=null?w:0,y:0}},p.lineY=o*(i==="after"?1:-1),v.textY=(o+s)*(i==="after"?1:-1),y=i==="after"?h.baseline.top:h.baseline.bottom,c===0?_=h.align.center:i==="after"&&c<0||i==="before"&&c>0?(_=h.align[x?"left":"right"],y=h.baseline.center):(i==="after"&&c>0||i==="before"&&c<0)&&(_=h.align[x?"right":"left"],y=h.baseline.center)):(t=function(C){var w;return{x:0,y:(w=g(C))!=null?w:0}},p.lineX=o*(i==="after"?1:-1),v.textX=(o+s)*(i==="after"?1:-1),_=i==="after"?h.align.left:h.align.right),{ticks:f.map(function(C){var w=typeof C=="string"?function(T){var $=String(T).length;return l&&l>0&&$>l?""+String(T).slice(0,l).concat("..."):""+T}(C):C;return jn({key:C instanceof Date?""+C.valueOf():""+C,value:w},t(C),p,v)}),textAlign:_,textBaseline:y}},aT=function(e,t){if(e===void 0||typeof e=="function")return e;if(t.type==="time"){var n=Eu(e);return function(r){return n(r instanceof Date?r:new Date(r))}}return Bs(e)},Eh=function(e){var t,n=e.width,r=e.height,i=e.scale,a=e.axis,o=e.values,s=(t=o,(Array.isArray(t)?o:void 0)||rT(i,o)),c="bandwidth"in i?tT(i):i,l=a==="x"?s.map(function(u){var d,f;return{key:u instanceof Date?""+u.valueOf():""+u,x1:(d=c(u))!=null?d:0,x2:(f=c(u))!=null?f:0,y1:0,y2:r}}):s.map(function(u){var d,f;return{key:u instanceof Date?""+u.valueOf():""+u,x1:0,x2:n,y1:(d=c(u))!=null?d:0,y2:(f=c(u))!=null?f:0}});return l},gZ=m.memo(function(e){var t,n=e.value,r=e.format,i=e.lineX,a=e.lineY,o=e.onClick,s=e.textBaseline,c=e.textAnchor,l=e.animatedProps,u=ht(),d=u.axis.ticks.line,f=u.axis.ticks.text,h=(t=r==null?void 0:r(n))!=null?t:n,g=m.useMemo(function(){var p={opacity:l.opacity};return o?{style:jn({},p,{cursor:"pointer"}),onClick:function(v){return o(v,h)}}:{style:p}},[l.opacity,o,h]);return b.jsxs(ft.g,jn({transform:l.transform},g,{children:[b.jsx("line",{x1:0,x2:i,y1:0,y2:a,style:d}),f.outlineWidth>0&&b.jsx(ft.text,{dominantBaseline:s,textAnchor:c,transform:l.textTransform,style:f,strokeWidth:2*f.outlineWidth,stroke:f.outlineColor,strokeLinejoin:"round",children:""+h}),b.jsx(ft.text,{dominantBaseline:s,textAnchor:c,transform:l.textTransform,style:Zm(f),children:""+h})]}))}),vZ=function(e){var t=e.axis,n=e.scale,r=e.x,i=r===void 0?0:r,a=e.y,o=a===void 0?0:a,s=e.length,c=e.ticksPosition,l=e.tickValues,u=e.tickSize,d=u===void 0?5:u,f=e.tickPadding,h=f===void 0?5:f,g=e.tickRotation,p=g===void 0?0:g,v=e.format,x=e.renderTick,_=x===void 0?gZ:x,y=e.truncateTickAt,C=e.legend,w=e.legendPosition,T=w===void 0?"end":w,$=e.legendOffset,R=$===void 0?0:$,S=e.onClick,k=e.ariaHidden,O=ht(),D=O.axis.legend.text,E=m.useMemo(function(){return aT(v,n)},[v,n]),M=iT({axis:t,scale:n,ticksPosition:c,tickValues:l,tickSize:d,tickPadding:h,tickRotation:p,truncateTickAt:y}),j=M.ticks,F=M.textAlign,W=M.textBaseline,B=null;if(C!==void 0){var U,N=0,V=0,X=0;t==="y"?(X=-90,N=R,T==="start"?(U="start",V=s):T==="middle"?(U="middle",V=s/2):T==="end"&&(U="end")):(V=R,T==="start"?U="start":T==="middle"?(U="middle",N=s/2):T==="end"&&(U="end",N=s)),B=b.jsxs(b.Fragment,{children:[D.outlineWidth>0&&b.jsx("text",{transform:"translate("+N+", "+V+") rotate("+X+")",textAnchor:U,style:jn({dominantBaseline:"central"},D),strokeWidth:2*D.outlineWidth,stroke:D.outlineColor,strokeLinejoin:"round",children:C}),b.jsx("text",{transform:"translate("+N+", "+V+") rotate("+X+")",textAnchor:U,style:jn({dominantBaseline:"central"},D),children:C})]})}var ne=mn(),K=ne.animate,J=ne.config,q=cr({transform:"translate("+i+","+o+")",lineX2:t==="x"?s:0,lineY2:t==="x"?0:s,config:J,immediate:!K}),G=m.useCallback(function(H){return{opacity:1,transform:"translate("+H.x+","+H.y+")",textTransform:"translate("+H.textX+","+H.textY+") rotate("+p+")"}},[p]),z=m.useCallback(function(H){return{opacity:0,transform:"translate("+H.x+","+H.y+")",textTransform:"translate("+H.textX+","+H.textY+") rotate("+p+")"}},[p]),L=Fi(j,{keys:function(H){return H.key},initial:G,from:z,enter:G,update:G,leave:{opacity:0},config:J,immediate:!K});return b.jsxs(ft.g,{transform:q.transform,"aria-hidden":k,children:[L(function(H,ee,A,se){return ie.createElement(_,jn({tickIndex:se,format:E,rotate:p,textBaseline:W,textAnchor:F,truncateTickAt:y,animatedProps:H},ee,S?{onClick:S}:{}))}),b.jsx(ft.line,{style:O.axis.domain.line,x1:0,x2:q.lineX2,y1:0,y2:q.lineY2}),B]})},bZ=m.memo(vZ),oT=["top","right","bottom","left"],sT=m.memo(function(e){var t=e.xScale,n=e.yScale,r=e.width,i=e.height,a={top:e.top,right:e.right,bottom:e.bottom,left:e.left};return b.jsx(b.Fragment,{children:oT.map(function(o){var s=a[o];if(!s)return null;var c=o==="top"||o==="bottom";return b.jsx(bZ,jn({},s,{axis:c?"x":"y",x:o==="right"?r:0,y:o==="bottom"?i:0,scale:c?t:n,length:c?r:i,ticksPosition:o==="top"||o==="left"?"before":"after",truncateTickAt:s.truncateTickAt}),o)})})}),yZ=m.memo(function(e){var t=e.animatedProps,n=ht();return b.jsx(ft.line,jn({},t,n.grid.line))}),Yb=m.memo(function(e){var t=e.lines,n=mn(),r=n.animate,i=n.config,a=Fi(t,{keys:function(o){return o.key},initial:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},from:function(o){return{opacity:0,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},enter:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},update:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},leave:{opacity:0},config:i,immediate:!r});return b.jsx("g",{children:a(function(o,s){return m.createElement(yZ,jn({},s,{key:s.key,animatedProps:o}))})})}),cT=m.memo(function(e){var t=e.width,n=e.height,r=e.xScale,i=e.yScale,a=e.xValues,o=e.yValues,s=m.useMemo(function(){return!!r&&Eh({width:t,height:n,scale:r,axis:"x",values:a})},[r,a,t,n]),c=m.useMemo(function(){return!!i&&Eh({width:t,height:n,scale:i,axis:"y",values:o})},[n,t,i,o]);return b.jsxs(b.Fragment,{children:[s&&b.jsx(Yb,{lines:s}),c&&b.jsx(Yb,{lines:c})]})}),xZ=function(e,t){var n,r=t.axis,i=t.scale,a=t.x,o=a===void 0?0:a,s=t.y,c=s===void 0?0:s,l=t.length,u=t.ticksPosition,d=t.tickValues,f=t.tickSize,h=f===void 0?5:f,g=t.tickPadding,p=g===void 0?5:g,v=t.tickRotation,x=v===void 0?0:v,_=t.format,y=t.legend,C=t.legendPosition,w=C===void 0?"end":C,T=t.legendOffset,$=T===void 0?0:T,R=t.theme,S=iT({axis:r,scale:i,ticksPosition:u,tickValues:d,tickSize:h,tickPadding:p,tickRotation:x,engine:"canvas"}),k=S.ticks,O=S.textAlign,D=S.textBaseline;e.save(),e.translate(o,c),e.textAlign=O,e.textBaseline=D;var E=R.axis.ticks.text;e.font=(E.fontWeight?E.fontWeight+" ":"")+E.fontSize+"px "+E.fontFamily,((n=R.axis.domain.line.strokeWidth)!=null?n:0)>0&&(e.lineWidth=Number(R.axis.domain.line.strokeWidth),e.lineCap="square",R.axis.domain.line.stroke&&(e.strokeStyle=R.axis.domain.line.stroke),e.beginPath(),e.moveTo(0,0),e.lineTo(r==="x"?l:0,r==="x"?0:l),e.stroke());var M=typeof _=="function"?_:function(U){return""+U};if(k.forEach(function(U){var N;((N=R.axis.ticks.line.strokeWidth)!=null?N:0)>0&&(e.lineWidth=Number(R.axis.ticks.line.strokeWidth),e.lineCap="square",R.axis.ticks.line.stroke&&(e.strokeStyle=R.axis.ticks.line.stroke),e.beginPath(),e.moveTo(U.x,U.y),e.lineTo(U.x+U.lineX,U.y+U.lineY),e.stroke());var V=M(U.value);e.save(),e.translate(U.x+U.textX,U.y+U.textY),e.rotate(An(x)),E.outlineWidth>0&&(e.strokeStyle=E.outlineColor,e.lineWidth=2*E.outlineWidth,e.lineJoin="round",e.strokeText(""+V,0,0)),R.axis.ticks.text.fill&&(e.fillStyle=E.fill),e.fillText(""+V,0,0),e.restore()}),y!==void 0){var j=0,F=0,W=0,B="center";r==="y"?(W=-90,j=$,w==="start"?(B="start",F=l):w==="middle"?(B="center",F=l/2):w==="end"&&(B="end")):(F=$,w==="start"?B="start":w==="middle"?(B="center",j=l/2):w==="end"&&(B="end",j=l)),e.translate(j,F),e.rotate(An(W)),e.font=(R.axis.legend.text.fontWeight?R.axis.legend.text.fontWeight+" ":"")+R.axis.legend.text.fontSize+"px "+R.axis.legend.text.fontFamily,R.axis.legend.text.fill&&(e.fillStyle=R.axis.legend.text.fill),e.textAlign=B,e.textBaseline="middle",e.fillText(y,0,0)}e.restore()},lT=function(e,t){var n=t.xScale,r=t.yScale,i=t.width,a=t.height,o=t.top,s=t.right,c=t.bottom,l=t.left,u=t.theme,d={top:o,right:s,bottom:c,left:l};oT.forEach(function(f){var h=d[f];if(!h)return null;var g=f==="top"||f==="bottom",p=f==="top"||f==="left"?"before":"after",v=g?n:r,x=aT(h.format,v);xZ(e,jn({},h,{axis:g?"x":"y",x:f==="right"?i:0,y:f==="bottom"?a:0,scale:v,format:x,length:g?i:a,ticksPosition:p,theme:u}))})},Cl=function(e,t){var n=t.width,r=t.height,i=t.scale,a=t.axis,o=t.values;Eh({width:n,height:r,scale:i,axis:a,values:o}).forEach(function(s){e.beginPath(),e.moveTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.stroke()})},_Z=V_,wZ=0;function CZ(e){var t=++wZ;return _Z(e)+t}var TZ=CZ;const kZ=Rt(TZ),xr=11102230246251565e-32,tn=134217729,SZ=(3+8*xr)*xr;function cf(e,t,n,r,i){let a,o,s,c,l=t[0],u=r[0],d=0,f=0;u>l==u>-l?(a=l,l=t[++d]):(a=u,u=r[++f]);let h=0;if(d<e&&f<n)for(u>l==u>-l?(o=l+a,s=a-(o-l),l=t[++d]):(o=u+a,s=a-(o-u),u=r[++f]),a=o,s!==0&&(i[h++]=s);d<e&&f<n;)u>l==u>-l?(o=a+l,c=o-a,s=a-(o-c)+(l-c),l=t[++d]):(o=a+u,c=o-a,s=a-(o-c)+(u-c),u=r[++f]),a=o,s!==0&&(i[h++]=s);for(;d<e;)o=a+l,c=o-a,s=a-(o-c)+(l-c),l=t[++d],a=o,s!==0&&(i[h++]=s);for(;f<n;)o=a+u,c=o-a,s=a-(o-c)+(u-c),u=r[++f],a=o,s!==0&&(i[h++]=s);return(a!==0||h===0)&&(i[h++]=a),h}function OZ(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function Hs(e){return new Float64Array(e)}const EZ=(3+16*xr)*xr,MZ=(2+12*xr)*xr,$Z=(9+64*xr)*xr*xr,ea=Hs(4),Gb=Hs(8),Zb=Hs(12),Kb=Hs(16),ln=Hs(4);function RZ(e,t,n,r,i,a,o){let s,c,l,u,d,f,h,g,p,v,x,_,y,C,w,T,$,R;const S=e-i,k=n-i,O=t-a,D=r-a;C=S*D,f=tn*S,h=f-(f-S),g=S-h,f=tn*D,p=f-(f-D),v=D-p,w=g*v-(C-h*p-g*p-h*v),T=O*k,f=tn*O,h=f-(f-O),g=O-h,f=tn*k,p=f-(f-k),v=k-p,$=g*v-(T-h*p-g*p-h*v),x=w-$,d=w-x,ea[0]=w-(x+d)+(d-$),_=C+x,d=_-C,y=C-(_-d)+(x-d),x=y-T,d=y-x,ea[1]=y-(x+d)+(d-T),R=_+x,d=R-_,ea[2]=_-(R-d)+(x-d),ea[3]=R;let E=OZ(4,ea),M=MZ*o;if(E>=M||-E>=M||(d=e-S,s=e-(S+d)+(d-i),d=n-k,l=n-(k+d)+(d-i),d=t-O,c=t-(O+d)+(d-a),d=r-D,u=r-(D+d)+(d-a),s===0&&c===0&&l===0&&u===0)||(M=$Z*o+SZ*Math.abs(E),E+=S*u+D*s-(O*l+k*c),E>=M||-E>=M))return E;C=s*D,f=tn*s,h=f-(f-s),g=s-h,f=tn*D,p=f-(f-D),v=D-p,w=g*v-(C-h*p-g*p-h*v),T=c*k,f=tn*c,h=f-(f-c),g=c-h,f=tn*k,p=f-(f-k),v=k-p,$=g*v-(T-h*p-g*p-h*v),x=w-$,d=w-x,ln[0]=w-(x+d)+(d-$),_=C+x,d=_-C,y=C-(_-d)+(x-d),x=y-T,d=y-x,ln[1]=y-(x+d)+(d-T),R=_+x,d=R-_,ln[2]=_-(R-d)+(x-d),ln[3]=R;const j=cf(4,ea,4,ln,Gb);C=S*u,f=tn*S,h=f-(f-S),g=S-h,f=tn*u,p=f-(f-u),v=u-p,w=g*v-(C-h*p-g*p-h*v),T=O*l,f=tn*O,h=f-(f-O),g=O-h,f=tn*l,p=f-(f-l),v=l-p,$=g*v-(T-h*p-g*p-h*v),x=w-$,d=w-x,ln[0]=w-(x+d)+(d-$),_=C+x,d=_-C,y=C-(_-d)+(x-d),x=y-T,d=y-x,ln[1]=y-(x+d)+(d-T),R=_+x,d=R-_,ln[2]=_-(R-d)+(x-d),ln[3]=R;const F=cf(j,Gb,4,ln,Zb);C=s*u,f=tn*s,h=f-(f-s),g=s-h,f=tn*u,p=f-(f-u),v=u-p,w=g*v-(C-h*p-g*p-h*v),T=c*l,f=tn*c,h=f-(f-c),g=c-h,f=tn*l,p=f-(f-l),v=l-p,$=g*v-(T-h*p-g*p-h*v),x=w-$,d=w-x,ln[0]=w-(x+d)+(d-$),_=C+x,d=_-C,y=C-(_-d)+(x-d),x=y-T,d=y-x,ln[1]=y-(x+d)+(d-T),R=_+x,d=R-_,ln[2]=_-(R-d)+(x-d),ln[3]=R;const W=cf(F,Zb,4,ln,Kb);return Kb[W-1]}function fc(e,t,n,r,i,a){const o=(t-a)*(n-i),s=(e-i)*(r-a),c=o-s,l=Math.abs(o+s);return Math.abs(c)>=EZ*l?c:-RZ(e,t,n,r,i,a,l)}const Xb=Math.pow(2,-52),hc=new Uint32Array(512);class Tl{static from(t,n=DZ,r=NZ){const i=t.length,a=new Float64Array(i*2);for(let o=0;o<i;o++){const s=t[o];a[2*o]=n(s),a[2*o+1]=r(s)}return new Tl(a)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:a}=this,o=t.length>>1;let s=1/0,c=1/0,l=-1/0,u=-1/0;for(let S=0;S<o;S++){const k=t[2*S],O=t[2*S+1];k<s&&(s=k),O<c&&(c=O),k>l&&(l=k),O>u&&(u=O),this._ids[S]=S}const d=(s+l)/2,f=(c+u)/2;let h,g,p;for(let S=0,k=1/0;S<o;S++){const O=lf(d,f,t[2*S],t[2*S+1]);O<k&&(h=S,k=O)}const v=t[2*h],x=t[2*h+1];for(let S=0,k=1/0;S<o;S++){if(S===h)continue;const O=lf(v,x,t[2*S],t[2*S+1]);O<k&&O>0&&(g=S,k=O)}let _=t[2*g],y=t[2*g+1],C=1/0;for(let S=0;S<o;S++){if(S===h||S===g)continue;const k=PZ(v,x,_,y,t[2*S],t[2*S+1]);k<C&&(p=S,C=k)}let w=t[2*p],T=t[2*p+1];if(C===1/0){for(let O=0;O<o;O++)this._dists[O]=t[2*O]-t[0]||t[2*O+1]-t[1];sa(this._ids,this._dists,0,o-1);const S=new Uint32Array(o);let k=0;for(let O=0,D=-1/0;O<o;O++){const E=this._ids[O],M=this._dists[E];M>D&&(S[k++]=E,D=M)}this.hull=S.subarray(0,k),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(fc(v,x,_,y,w,T)<0){const S=g,k=_,O=y;g=p,_=w,y=T,p=S,w=k,T=O}const $=IZ(v,x,_,y,w,T);this._cx=$.x,this._cy=$.y;for(let S=0;S<o;S++)this._dists[S]=lf(t[2*S],t[2*S+1],$.x,$.y);sa(this._ids,this._dists,0,o-1),this._hullStart=h;let R=3;r[h]=n[p]=g,r[g]=n[h]=p,r[p]=n[g]=h,i[h]=0,i[g]=1,i[p]=2,a.fill(-1),a[this._hashKey(v,x)]=h,a[this._hashKey(_,y)]=g,a[this._hashKey(w,T)]=p,this.trianglesLen=0,this._addTriangle(h,g,p,-1,-1,-1);for(let S=0,k,O;S<this._ids.length;S++){const D=this._ids[S],E=t[2*D],M=t[2*D+1];if(S>0&&Math.abs(E-k)<=Xb&&Math.abs(M-O)<=Xb||(k=E,O=M,D===h||D===g||D===p))continue;let j=0;for(let N=0,V=this._hashKey(E,M);N<this._hashSize&&(j=a[(V+N)%this._hashSize],!(j!==-1&&j!==r[j]));N++);j=n[j];let F=j,W;for(;W=r[F],fc(E,M,t[2*F],t[2*F+1],t[2*W],t[2*W+1])>=0;)if(F=W,F===j){F=-1;break}if(F===-1)continue;let B=this._addTriangle(F,D,r[F],-1,-1,i[F]);i[D]=this._legalize(B+2),i[F]=B,R++;let U=r[F];for(;W=r[U],fc(E,M,t[2*U],t[2*U+1],t[2*W],t[2*W+1])<0;)B=this._addTriangle(U,D,W,i[D],-1,i[U]),i[D]=this._legalize(B+2),r[U]=U,R--,U=W;if(F===j)for(;W=n[F],fc(E,M,t[2*W],t[2*W+1],t[2*F],t[2*F+1])<0;)B=this._addTriangle(W,D,F,-1,i[F],i[W]),this._legalize(B+2),i[W]=B,r[F]=F,R--,F=W;this._hullStart=n[D]=F,r[F]=n[U]=D,r[D]=U,a[this._hashKey(E,M)]=D,a[this._hashKey(t[2*F],t[2*F+1])]=F}this.hull=new Uint32Array(R);for(let S=0,k=this._hullStart;S<R;S++)this.hull[S]=k,k=r[k];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(AZ(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:r,coords:i}=this;let a=0,o=0;for(;;){const s=r[t],c=t-t%3;if(o=c+(t+2)%3,s===-1){if(a===0)break;t=hc[--a];continue}const l=s-s%3,u=c+(t+1)%3,d=l+(s+2)%3,f=n[o],h=n[t],g=n[u],p=n[d];if(jZ(i[2*f],i[2*f+1],i[2*h],i[2*h+1],i[2*g],i[2*g+1],i[2*p],i[2*p+1])){n[t]=p,n[s]=f;const x=r[d];if(x===-1){let y=this._hullStart;do{if(this._hullTri[y]===d){this._hullTri[y]=t;break}y=this._hullPrev[y]}while(y!==this._hullStart)}this._link(t,x),this._link(s,r[o]),this._link(o,d);const _=l+(s+1)%3;a<hc.length&&(hc[a++]=_)}else{if(a===0)break;t=hc[--a]}}return o}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,r,i,a,o){const s=this.trianglesLen;return this._triangles[s]=t,this._triangles[s+1]=n,this._triangles[s+2]=r,this._link(s,i),this._link(s+1,a),this._link(s+2,o),this.trianglesLen+=3,s}}function AZ(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function lf(e,t,n,r){const i=e-n,a=t-r;return i*i+a*a}function jZ(e,t,n,r,i,a,o,s){const c=e-o,l=t-s,u=n-o,d=r-s,f=i-o,h=a-s,g=c*c+l*l,p=u*u+d*d,v=f*f+h*h;return c*(d*v-p*h)-l*(u*v-p*f)+g*(u*h-d*f)<0}function PZ(e,t,n,r,i,a){const o=n-e,s=r-t,c=i-e,l=a-t,u=o*o+s*s,d=c*c+l*l,f=.5/(o*l-s*c),h=(l*u-s*d)*f,g=(o*d-c*u)*f;return h*h+g*g}function IZ(e,t,n,r,i,a){const o=n-e,s=r-t,c=i-e,l=a-t,u=o*o+s*s,d=c*c+l*l,f=.5/(o*l-s*c),h=e+(l*u-s*d)*f,g=t+(o*d-c*u)*f;return{x:h,y:g}}function sa(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const a=e[i],o=t[a];let s=i-1;for(;s>=n&&t[e[s]]>o;)e[s+1]=e[s--];e[s+1]=a}else{const i=n+r>>1;let a=n+1,o=r;xo(e,i,a),t[e[n]]>t[e[r]]&&xo(e,n,r),t[e[a]]>t[e[r]]&&xo(e,a,r),t[e[n]]>t[e[a]]&&xo(e,n,a);const s=e[a],c=t[s];for(;;){do a++;while(t[e[a]]<c);do o--;while(t[e[o]]>c);if(o<a)break;xo(e,a,o)}e[n+1]=e[o],e[o]=s,r-a+1>=o-n?(sa(e,t,a,r),sa(e,t,n,o-1)):(sa(e,t,n,o-1),sa(e,t,a,r))}}function xo(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function DZ(e){return e[0]}function NZ(e){return e[1]}const Qb=1e-6;class vi{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,r){t=+t,n=+n,r=+r;const i=t+r,a=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${a}`:(Math.abs(this._x1-i)>Qb||Math.abs(this._y1-a)>Qb)&&(this._+="L"+i+","+a),r&&(this._+=`A${r},${r},0,1,1,${t-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=a}`)}rect(t,n,r,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class Mh{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}class FZ{constructor(t,[n,r,i,a]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((a=+a)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=i,this.xmin=n,this.ymax=a,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:r},vectors:i}=this;let a,o;const s=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let p=0,v=0,x=r.length,_,y;p<x;p+=3,v+=2){const C=r[p]*2,w=r[p+1]*2,T=r[p+2]*2,$=t[C],R=t[C+1],S=t[w],k=t[w+1],O=t[T],D=t[T+1],E=S-$,M=k-R,j=O-$,F=D-R,W=(E*F-M*j)*2;if(Math.abs(W)<1e-9){if(a===void 0){a=o=0;for(const U of n)a+=t[U*2],o+=t[U*2+1];a/=n.length,o/=n.length}const B=1e9*Math.sign((a-$)*F-(o-R)*j);_=($+O)/2-B*F,y=(R+D)/2+B*j}else{const B=1/W,U=E*E+M*M,N=j*j+F*F;_=$+(F*U-M*N)*B,y=R+(E*N-j*U)*B}s[v]=_,s[v+1]=y}let c=n[n.length-1],l,u=c*4,d,f=t[2*c],h,g=t[2*c+1];i.fill(0);for(let p=0;p<n.length;++p)c=n[p],l=u,d=f,h=g,u=c*4,f=t[2*c],g=t[2*c+1],i[l+2]=i[u]=h-g,i[l+3]=i[u+1]=f-d}render(t){const n=t==null?t=new vi:void 0,{delaunay:{halfedges:r,inedges:i,hull:a},circumcenters:o,vectors:s}=this;if(a.length<=1)return null;for(let u=0,d=r.length;u<d;++u){const f=r[u];if(f<u)continue;const h=Math.floor(u/3)*2,g=Math.floor(f/3)*2,p=o[h],v=o[h+1],x=o[g],_=o[g+1];this._renderSegment(p,v,x,_,t)}let c,l=a[a.length-1];for(let u=0;u<a.length;++u){c=l,l=a[u];const d=Math.floor(i[l]/3)*2,f=o[d],h=o[d+1],g=c*4,p=this._project(f,h,s[g+2],s[g+3]);p&&this._renderSegment(f,h,p[0],p[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new vi:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const r=n==null?n=new vi:void 0,i=this._clip(t);if(i===null||!i.length)return;n.moveTo(i[0],i[1]);let a=i.length;for(;i[0]===i[a-2]&&i[1]===i[a-1]&&a>1;)a-=2;for(let o=2;o<a;o+=2)(i[o]!==i[o-2]||i[o+1]!==i[o-1])&&n.lineTo(i[o],i[o+1]);return n.closePath(),r&&r.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,r=t.length/2;n<r;++n){const i=this.cellPolygon(n);i&&(i.index=n,yield i)}}cellPolygon(t){const n=new Mh;return this.renderCell(t,n),n.value()}_renderSegment(t,n,r,i,a){let o;const s=this._regioncode(t,n),c=this._regioncode(r,i);s===0&&c===0?(a.moveTo(t,n),a.lineTo(r,i)):(o=this._clipSegment(t,n,r,i,s,c))&&(a.moveTo(o[0],o[1]),a.lineTo(o[2],o[3]))}contains(t,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(t,n,r)===t}*neighbors(t){const n=this._clip(t);if(n)for(const r of this.delaunay.neighbors(t)){const i=this._clip(r);if(i){e:for(let a=0,o=n.length;a<o;a+=2)for(let s=0,c=i.length;s<c;s+=2)if(n[a]===i[s]&&n[a+1]===i[s+1]&&n[(a+2)%o]===i[(s+c-2)%c]&&n[(a+3)%o]===i[(s+c-1)%c]){yield r;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:a}}=this,o=r[t];if(o===-1)return null;const s=[];let c=o;do{const l=Math.floor(c/3);if(s.push(n[l*2],n[l*2+1]),c=c%3===2?c-2:c+1,a[c]!==t)break;c=i[c]}while(c!==o&&c!==-1);return s}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:r}=this,i=t*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(t,n,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(t,n))}_clipFinite(t,n){const r=n.length;let i=null,a,o,s=n[r-2],c=n[r-1],l,u=this._regioncode(s,c),d,f=0;for(let h=0;h<r;h+=2)if(a=s,o=c,s=n[h],c=n[h+1],l=u,u=this._regioncode(s,c),l===0&&u===0)d=f,f=0,i?i.push(s,c):i=[s,c];else{let g,p,v,x,_;if(l===0){if((g=this._clipSegment(a,o,s,c,l,u))===null)continue;[p,v,x,_]=g}else{if((g=this._clipSegment(s,c,a,o,u,l))===null)continue;[x,_,p,v]=g,d=f,f=this._edgecode(p,v),d&&f&&this._edge(t,d,f,i,i.length),i?i.push(p,v):i=[p,v]}d=f,f=this._edgecode(x,_),d&&f&&this._edge(t,d,f,i,i.length),i?i.push(x,_):i=[x,_]}if(i)d=f,f=this._edgecode(i[0],i[1]),d&&f&&this._edge(t,d,f,i,i.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return i}_clipSegment(t,n,r,i,a,o){const s=a<o;for(s&&([t,n,r,i,a,o]=[r,i,t,n,o,a]);;){if(a===0&&o===0)return s?[r,i,t,n]:[t,n,r,i];if(a&o)return null;let c,l,u=a||o;u&8?(c=t+(r-t)*(this.ymax-n)/(i-n),l=this.ymax):u&4?(c=t+(r-t)*(this.ymin-n)/(i-n),l=this.ymin):u&2?(l=n+(i-n)*(this.xmax-t)/(r-t),c=this.xmax):(l=n+(i-n)*(this.xmin-t)/(r-t),c=this.xmin),a?(t=c,n=l,a=this._regioncode(t,n)):(r=c,i=l,o=this._regioncode(r,i))}}_clipInfinite(t,n,r,i,a,o){let s=Array.from(n),c;if((c=this._project(s[0],s[1],r,i))&&s.unshift(c[0],c[1]),(c=this._project(s[s.length-2],s[s.length-1],a,o))&&s.push(c[0],c[1]),s=this._clipFinite(t,s))for(let l=0,u=s.length,d,f=this._edgecode(s[u-2],s[u-1]);l<u;l+=2)d=f,f=this._edgecode(s[l],s[l+1]),d&&f&&(l=this._edge(t,d,f,s,l),u=s.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(t,n,r,i,a){for(;n!==r;){let o,s;switch(n){case 5:n=4;continue;case 4:n=6,o=this.xmax,s=this.ymin;break;case 6:n=2;continue;case 2:n=10,o=this.xmax,s=this.ymax;break;case 10:n=8;continue;case 8:n=9,o=this.xmin,s=this.ymax;break;case 9:n=1;continue;case 1:n=5,o=this.xmin,s=this.ymin;break}(i[a]!==o||i[a+1]!==s)&&this.contains(t,o,s)&&(i.splice(a,0,o,s),a+=2)}return a}_project(t,n,r,i){let a=1/0,o,s,c;if(i<0){if(n<=this.ymin)return null;(o=(this.ymin-n)/i)<a&&(c=this.ymin,s=t+(a=o)*r)}else if(i>0){if(n>=this.ymax)return null;(o=(this.ymax-n)/i)<a&&(c=this.ymax,s=t+(a=o)*r)}if(r>0){if(t>=this.xmax)return null;(o=(this.xmax-t)/r)<a&&(s=this.xmax,c=n+(a=o)*i)}else if(r<0){if(t<=this.xmin)return null;(o=(this.xmin-t)/r)<a&&(s=this.xmin,c=n+(a=o)*i)}return[s,c]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const r=(n+2)%t.length,i=(n+4)%t.length;(t[n]===t[r]&&t[r]===t[i]||t[n+1]===t[r+1]&&t[r+1]===t[i+1])&&(t.splice(r,2),n-=2)}t.length||(t=null)}return t}}const LZ=2*Math.PI,ta=Math.pow;function BZ(e){return e[0]}function WZ(e){return e[1]}function UZ(e){const{triangles:t,coords:n}=e;for(let r=0;r<t.length;r+=3){const i=2*t[r],a=2*t[r+1],o=2*t[r+2];if((n[o]-n[i])*(n[a+1]-n[i+1])-(n[a]-n[i])*(n[o+1]-n[i+1])>1e-10)return!1}return!0}function zZ(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class tg{static from(t,n=BZ,r=WZ,i){return new tg("length"in t?HZ(t,n,r,i):Float64Array.from(VZ(t,n,r,i)))}constructor(t){this._delaunator=new Tl(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&UZ(t)){this.collinear=Int32Array.from({length:n.length/2},(f,h)=>h).sort((f,h)=>n[2*f]-n[2*h]||n[2*f+1]-n[2*h+1]);const c=this.collinear[0],l=this.collinear[this.collinear.length-1],u=[n[2*c],n[2*c+1],n[2*l],n[2*l+1]],d=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let f=0,h=n.length/2;f<h;++f){const g=zZ(n[2*f],n[2*f+1],d);n[2*f]=g[0],n[2*f+1]=g[1]}this._delaunator=new Tl(n)}else delete this.collinear;const r=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,a=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),s=this._hullIndex.fill(-1);for(let c=0,l=r.length;c<l;++c){const u=a[c%3===2?c-2:c+1];(r[c]===-1||o[u]===-1)&&(o[u]=c)}for(let c=0,l=i.length;c<l;++c)s[i[c]]=c;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],o[i[0]]=1,i.length===2&&(o[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new FZ(this,t)}*neighbors(t){const{inedges:n,hull:r,_hullIndex:i,halfedges:a,triangles:o,collinear:s}=this;if(s){const d=s.indexOf(t);d>0&&(yield s[d-1]),d<s.length-1&&(yield s[d+1]);return}const c=n[t];if(c===-1)return;let l=c,u=-1;do{if(yield u=o[l],l=l%3===2?l-2:l+1,o[l]!==t)return;if(l=a[l],l===-1){const d=r[(i[t]+1)%r.length];d!==u&&(yield d);return}}while(l!==c)}find(t,n,r=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const i=r;let a;for(;(a=this._step(r,t,n))>=0&&a!==r&&a!==i;)r=a;return a}_step(t,n,r){const{inedges:i,hull:a,_hullIndex:o,halfedges:s,triangles:c,points:l}=this;if(i[t]===-1||!l.length)return(t+1)%(l.length>>1);let u=t,d=ta(n-l[t*2],2)+ta(r-l[t*2+1],2);const f=i[t];let h=f;do{let g=c[h];const p=ta(n-l[g*2],2)+ta(r-l[g*2+1],2);if(p<d&&(d=p,u=g),h=h%3===2?h-2:h+1,c[h]!==t)break;if(h=s[h],h===-1){if(h=a[(o[t]+1)%a.length],h!==g&&ta(n-l[h*2],2)+ta(r-l[h*2+1],2)<d)return h;break}}while(h!==f);return u}render(t){const n=t==null?t=new vi:void 0,{points:r,halfedges:i,triangles:a}=this;for(let o=0,s=i.length;o<s;++o){const c=i[o];if(c<o)continue;const l=a[o]*2,u=a[c]*2;t.moveTo(r[l],r[l+1]),t.lineTo(r[u],r[u+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const r=t==null?t=new vi:void 0,{points:i}=this;for(let a=0,o=i.length;a<o;a+=2){const s=i[a],c=i[a+1];t.moveTo(s+n,c),t.arc(s,c,n,0,LZ)}return r&&r.value()}renderHull(t){const n=t==null?t=new vi:void 0,{hull:r,points:i}=this,a=r[0]*2,o=r.length;t.moveTo(i[a],i[a+1]);for(let s=1;s<o;++s){const c=2*r[s];t.lineTo(i[c],i[c+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new Mh;return this.renderHull(t),t.value()}renderTriangle(t,n){const r=n==null?n=new vi:void 0,{points:i,triangles:a}=this,o=a[t*=3]*2,s=a[t+1]*2,c=a[t+2]*2;return n.moveTo(i[o],i[o+1]),n.lineTo(i[s],i[s+1]),n.lineTo(i[c],i[c+1]),n.closePath(),r&&r.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,r=t.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new Mh;return this.renderTriangle(t,n),n.value()}}function HZ(e,t,n,r){const i=e.length,a=new Float64Array(i*2);for(let o=0;o<i;++o){const s=e[o];a[o*2]=t.call(r,s,o,e),a[o*2+1]=n.call(r,s,o,e)}return a}function*VZ(e,t,n,r){let i=0;for(const a of e)yield t.call(r,a,i,e),yield n.call(r,a,i,e),++i}var ng=function(e){return[e.x,e.y]},Vs=wC,uT="cursor",dT="top",qZ=function(e){var t=e.points,n=e.getNodePosition,r=n===void 0?ng:n,i=e.margin,a=i===void 0?Vs:i;return t.map(function(o){var s=r(o),c=s[0],l=s[1];return[c+a.left,l+a.top]})},YZ=function(e){var t=e.points,n=e.width,r=e.height,i=e.margin,a=i===void 0?Vs:i,o=e.debug,s=tg.from(t),c=o?s.voronoi([0,0,a.left+n+a.right,a.top+r+a.bottom]):void 0;return{points:t,delaunay:s,voronoi:c}},fT=function(e){var t=e.points,n=e.getNodePosition,r=n===void 0?ng:n,i=e.width,a=e.height,o=e.margin,s=o===void 0?Vs:o,c=e.debug;return m.useMemo(function(){return YZ({points:qZ({points:t,margin:s,getNodePosition:r}),width:i,height:a,margin:s,debug:c})},[t,i,a,s,c])},GZ=function(e){var t=e.elementRef,n=e.nodes,r=e.getNodePosition,i=r===void 0?ng:r,a=e.delaunay,o=e.setCurrent,s=e.margin,c=s===void 0?Vs:s,l=e.detectionRadius,u=l===void 0?1/0:l,d=e.isInteractive,f=d===void 0||d,h=e.onMouseEnter,g=e.onMouseMove,p=e.onMouseLeave,v=e.onClick,x=e.onTouchStart,_=e.onTouchMove,y=e.onTouchEnd,C=e.enableTouchCrosshair,w=C!==void 0&&C,T=e.tooltip,$=e.tooltipPosition,R=$===void 0?uT:$,S=e.tooltipAnchor,k=S===void 0?dT:S,O=m.useState(null),D=O[0],E=O[1],M=m.useRef(null);m.useEffect(function(){M.current=D},[M,D]);var j=m.useCallback(function(z){if(!t.current)return null;var L=jo(t.current,z),H=L[0],ee=L[1],A=a.find(H,ee),se=A!==void 0?n[A]:null;if(se&&u!==1/0){var ce=i(se),ue=ce[0],we=ce[1];LV(H,ee,ue+c.left,we+c.top)>u&&(A=null,se=null)}return A===null||se===null?null:[A,se]},[t,a,n,i,c,u]),F=Li(),W=F.showTooltipAt,B=F.showTooltipFromEvent,U=F.hideTooltip,N=m.useMemo(function(){if(T)return R==="cursor"?function(z,L){B(T(z),L,k)}:function(z){var L=i(z),H=L[0],ee=L[1];W(T(z),[H+c.left,ee+c.top],k)}},[W,B,T,R,k,i,c]),V=m.useCallback(function(z){var L=j(z);if(E(L),o==null||o(L?L[1]:null),L){var H=L[1];N==null||N(H,z),h==null||h(L[1],z)}},[j,E,o,N,h]),X=m.useCallback(function(z){var L=j(z);if(E(L),L){var H=L[0],ee=L[1];if(o==null||o(ee),N==null||N(ee,z),M.current){var A=M.current,se=A[0],ce=A[1];H!==se?p==null||p(ce,z):g==null||g(ee,z)}else h==null||h(ee,z)}else o==null||o(null),U==null||U(),M.current&&(p==null||p(M.current[1],z))},[j,E,M,h,g,p,N,U]),ne=m.useCallback(function(z){E(null),o==null||o(null),U(),p&&M.current&&p(M.current[1],z)},[E,o,M,U,p]),K=m.useCallback(function(z){var L=j(z);E(L),L&&(v==null||v(L[1],z))},[j,E,v]),J=m.useCallback(function(z){var L=j(z);w&&(E(L),o==null||o(L?L[1]:null)),L&&(x==null||x(L[1],z))},[j,E,o,w,x]),q=m.useCallback(function(z){var L=j(z);w&&(E(L),o==null||o(L?L[1]:null)),L&&(_==null||_(L[1],z))},[j,E,o,w,_]),G=m.useCallback(function(z){w&&(E(null),o==null||o(null)),y&&M.current&&y(M.current[1],z)},[w,E,o,y,M]);return{current:D,handleMouseEnter:f?V:void 0,handleMouseMove:f?X:void 0,handleMouseLeave:f?ne:void 0,handleClick:f?K:void 0,handleTouchStart:f?J:void 0,handleTouchMove:f?q:void 0,handleTouchEnd:f?G:void 0}},ZZ=function(e){var t=e.nodes,n=e.width,r=e.height,i=e.margin,a=i===void 0?Vs:i,o=e.getNodePosition,s=e.setCurrent,c=e.onMouseEnter,l=e.onMouseMove,u=e.onMouseLeave,d=e.onClick,f=e.onTouchStart,h=e.onTouchMove,g=e.onTouchEnd,p=e.enableTouchCrosshair,v=p!==void 0&&p,x=e.detectionRadius,_=x===void 0?1/0:x,y=e.tooltip,C=e.tooltipPosition,w=C===void 0?uT:C,T=e.tooltipAnchor,$=T===void 0?dT:T,R=e.debug,S=m.useRef(null),k=fT({points:t,getNodePosition:o,width:n,height:r,margin:a,debug:R}),O=k.delaunay,D=k.voronoi,E=GZ({elementRef:S,nodes:t,delaunay:O,margin:a,detectionRadius:_,setCurrent:s,onMouseEnter:c,onMouseMove:l,onMouseLeave:u,onClick:d,onTouchStart:f,onTouchMove:h,onTouchEnd:g,enableTouchCrosshair:v,tooltip:y,tooltipPosition:w,tooltipAnchor:$}),M=E.current,j=E.handleMouseEnter,F=E.handleMouseMove,W=E.handleMouseLeave,B=E.handleClick,U=E.handleTouchStart,N=E.handleTouchMove,V=E.handleTouchEnd,X=m.useMemo(function(){if(R&&D)return D.render()},[R,D]);return b.jsxs("g",{ref:S,transform:"translate("+-a.left+","+-a.top+")",children:[R&&D&&b.jsxs(b.Fragment,{children:[b.jsx("path",{d:X,stroke:"red",strokeWidth:1,opacity:.75}),_<1/0&&b.jsx("path",{stroke:"red",strokeWidth:.35,fill:"none",d:O.renderPoints(void 0,_)}),M&&b.jsx("path",{fill:"pink",opacity:.35,d:D.renderCell(M[0])})]}),b.jsx("rect",{"data-ref":"mesh-interceptor",width:a.left+n+a.right,height:a.top+r+a.bottom,fill:"red",opacity:0,style:{cursor:"auto"},onMouseEnter:j,onMouseMove:F,onMouseLeave:W,onTouchStart:U,onTouchMove:N,onTouchEnd:V,onClick:B})]})},KZ=function(e,t){e.save(),e.globalAlpha=.75,e.beginPath(),t.render(e),e.strokeStyle="red",e.lineWidth=1,e.stroke(),e.restore()},XZ=function(e,t,n){e.save(),e.globalAlpha=.35,e.beginPath(),t.renderCell(n,e),e.fillStyle="pink",e.fill(),e.restore()};function hn(){return hn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hn.apply(this,arguments)}var rg=m.memo(function(e){var t=e.point;return b.jsx(Zp,{id:b.jsxs("span",{children:["x: ",b.jsx("strong",{children:t.data.xFormatted}),", y:"," ",b.jsx("strong",{children:t.data.yFormatted})]}),enableChip:!0,color:t.serieColor})}),hT=m.memo(function(e){var t=e.slice,n=e.axis,r=ht(),i=n==="x"?"y":"x";return b.jsx(y_,{rows:t.points.map(function(a){return[b.jsx(b_,{color:a.serieColor,style:r.tooltip.chip},"chip"),a.serieId,b.jsx("span",{style:r.tooltip.tableCellValue,children:a.data[i+"Formatted"]},"value")]})})}),pT={curve:"linear",xScale:{type:"point"},yScale:{type:"linear",min:0,max:"auto"},layers:["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"],axisBottom:{},axisLeft:{},enableGridX:!0,enableGridY:!0,enablePoints:!0,pointSize:6,pointColor:{from:"color"},pointBorderWidth:0,pointBorderColor:{theme:"background"},enablePointLabel:!1,pointLabel:"yFormatted",colors:{scheme:"nivo"},enableArea:!1,areaBaselineValue:0,areaOpacity:.2,areaBlendMode:"normal",lineWidth:2,legends:[],isInteractive:!0,tooltip:rg,enableSlices:!1,debugSlices:!1,sliceTooltip:hT,debugMesh:!1,enableCrosshair:!0,crosshairType:"bottom-left"},Ar=hn({},pT,{enablePointLabel:!1,useMesh:!1,enableTouchCrosshair:!1,animate:!0,motionConfig:"gentle",defs:[],fill:[],role:"img"});hn({},pT,{pixelRatio:typeof window<"u"&&window.devicePixelRatio||1});var QZ=function(e){var t=e.curve;return m.useMemo(function(){return Fm().defined(function(n){return n.x!==null&&n.y!==null}).x(function(n){return n.x}).y(function(n){return n.y}).curve(_C(t))},[t])},JZ=function(e){var t=e.curve,n=e.yScale,r=e.areaBaselineValue;return m.useMemo(function(){return gU().defined(function(i){return i.x!==null&&i.y!==null}).x(function(i){return i.x}).y1(function(i){return i.y}).curve(_C(t)).y0(n(r))},[t,n,r])},eK=function(e){var t=e.componentId,n=e.enableSlices,r=e.points,i=e.width,a=e.height;return m.useMemo(function(){if(n===!1)return[];if(n==="x"){var o=new Map;return r.forEach(function(c){c.data.x!==null&&c.data.y!==null&&(o.has(c.x)?o.get(c.x).push(c):o.set(c.x,[c]))}),Array.from(o.entries()).sort(function(c,l){return c[0]-l[0]}).map(function(c,l,u){var d,f,h=c[0],g=c[1],p=u[l-1],v=u[l+1];return d=p?h-(h-p[0])/2:h,f=v?h-d+(v[0]-h)/2:i-d,{id:"slice:"+t+":"+h,x0:d,x:h,y0:0,y:0,width:f,height:a,points:g.reverse()}})}if(n==="y"){var s=new Map;return r.forEach(function(c){c.data.x!==null&&c.data.y!==null&&(s.has(c.y)?s.get(c.y).push(c):s.set(c.y,[c]))}),Array.from(s.entries()).sort(function(c,l){return c[0]-l[0]}).map(function(c,l,u){var d,f,h=c[0],g=c[1],p=u[l-1],v=u[l+1];return d=p?h-(h-p[0])/2:h,f=v?h-d+(v[0]-h)/2:a-d,{id:h,x0:0,x:0,y0:d,y:h,width:i,height:f,points:g.reverse()}})}},[t,n,a,r,i])},tK="line",mT=function(e){var t=e.data,n=e.xScale,r=n===void 0?Ar.xScale:n,i=e.xFormat,a=e.yScale,o=a===void 0?Ar.yScale:a,s=e.yFormat,c=e.width,l=e.height,u=e.colors,d=u===void 0?Ar.colors:u,f=e.curve,h=f===void 0?Ar.curve:f,g=e.areaBaselineValue,p=g===void 0?Ar.areaBaselineValue:g,v=e.pointColor,x=v===void 0?Ar.pointColor:v,_=e.pointBorderColor,y=_===void 0?Ar.pointBorderColor:_,C=e.enableSlices,w=C===void 0?Ar.enableSlicesTooltip:C,T=m.useState(kZ(tK))[0],$=Ma(i),R=Ma(s),S=Xm(d,"id"),k=ht(),O=ar(x,k),D=ar(y,k),E=m.useState([]),M=E[0],j=E[1],F=m.useMemo(function(){return uZ(t.filter(function(q){return M.indexOf(q.id)===-1}),r,o,c,l)},[t,M,r,o,c,l]),W=F.xScale,B=F.yScale,U=F.series,N=m.useMemo(function(){var q=t.map(function(z){return{id:z.id,label:z.id,color:S(z)}}),G=q.map(function(z){return hn({},U.find(function(L){return L.id===z.id}),{color:z.color})}).filter(function(z){return!!z.id});return{legendData:q.map(function(z){return hn({},z,{hidden:!G.find(function(L){return L.id===z.id})})}).reverse(),series:G}},[t,U,S]),V=N.legendData,X=N.series,ne=m.useCallback(function(q){j(function(G){return G.indexOf(q)>-1?G.filter(function(z){return z!==q}):[].concat(G,[q])})},[]),K=function(q){var G=q.series,z=q.getPointColor,L=q.getPointBorderColor,H=q.formatX,ee=q.formatY;return m.useMemo(function(){return G.reduce(function(A,se){return[].concat(A,se.data.filter(function(ce){return ce.position.x!==null&&ce.position.y!==null}).map(function(ce,ue){var we={id:se.id+"."+ue,index:A.length+ue,serieId:se.id,serieColor:se.color,x:ce.position.x,y:ce.position.y};return we.color=z(se),we.borderColor=L(we),we.data=hn({},ce.data,{xFormatted:H(ce.data.x),yFormatted:ee(ce.data.y)}),we}))},[])},[G,z,L,H,ee])}({series:X,getPointColor:O,getPointBorderColor:D,formatX:$,formatY:R}),J=eK({componentId:T,enableSlices:w,points:K,width:c,height:l});return{legendData:V,toggleSerie:ne,lineGenerator:QZ({curve:h}),areaGenerator:JZ({curve:h,yScale:B,areaBaselineValue:p}),getColor:S,series:X,xScale:W,yScale:B,slices:J,points:K}},nK=function(e){var t=e.areaBlendMode,n=e.areaOpacity,r=e.color,i=e.fill,a=e.path,o=mn(),s=o.animate,c=o.config,l=Ym(a),u=cr({color:r,config:c,immediate:!s});return b.jsx(ft.path,{d:l,fill:i||u.color,fillOpacity:n,strokeWidth:0,style:{mixBlendMode:t}})},rK=m.memo(function(e){var t=e.areaGenerator,n=e.areaOpacity,r=e.areaBlendMode,i=e.lines.slice(0).reverse();return b.jsx("g",{children:i.map(function(a){return b.jsx(nK,hn({path:t(a.data.map(function(o){return o.position}))},hn({areaOpacity:n,areaBlendMode:r},a)),a.id)})})}),iK=m.memo(function(e){var t=e.lineGenerator,n=e.points,r=e.color,i=e.thickness,a=m.useMemo(function(){return t(n)},[t,n]),o=Ym(a);return b.jsx(ft.path,{d:o,fill:"none",strokeWidth:i,stroke:r})}),aK=m.memo(function(e){var t=e.lines,n=e.lineGenerator,r=e.lineWidth;return t.slice(0).reverse().map(function(i){var a=i.id,o=i.data,s=i.color;return b.jsx(iK,{id:a,points:o.map(function(c){return c.position}),lineGenerator:n,color:s,thickness:r},a)})}),oK=m.memo(function(e){var t=e.slice,n=e.slices,r=e.axis,i=e.debug,a=e.tooltip,o=e.isCurrent,s=e.setCurrent,c=e.onMouseEnter,l=e.onMouseMove,u=e.onMouseLeave,d=e.onClick,f=e.onTouchStart,h=e.onTouchMove,g=e.onTouchEnd,p=Li(),v=p.showTooltipFromEvent,x=p.hideTooltip,_=m.useCallback(function(S){v(m.createElement(a,{slice:t,axis:r}),S,"right"),s(t),c&&c(t,S)},[v,a,t,r,s,c]),y=m.useCallback(function(S){v(m.createElement(a,{slice:t,axis:r}),S,"right"),l&&l(t,S)},[v,a,t,r,l]),C=m.useCallback(function(S){x(),s(null),u&&u(t,S)},[x,s,u,t]),w=m.useCallback(function(S){d&&d(t,S)},[t,d]),T=m.useCallback(function(S){v(m.createElement(a,{slice:t,axis:r}),S,"right"),s(t),f&&f(t,S)},[r,f,s,v,t,a]),$=m.useCallback(function(S){var k=S.touches[0],O=document.elementFromPoint(k.clientX,k.clientY),D=O==null?void 0:O.getAttribute("data-ref");if(D){var E=n.find(function(M){return M.id===D});E&&(v(m.createElement(a,{slice:E,axis:r}),S,"right"),s(E))}h&&h(t,S)},[r,h,s,v,t,n,a]),R=m.useCallback(function(S){x(),s(null),g&&g(t,S)},[x,s,g,t]);return b.jsx("rect",{x:t.x0,y:t.y0,width:t.width,height:t.height,stroke:"red",strokeWidth:i?1:0,strokeOpacity:.75,fill:"red",fillOpacity:o&&i?.35:0,onMouseEnter:_,onMouseMove:y,onMouseLeave:C,onClick:w,onTouchStart:T,onTouchMove:$,onTouchEnd:R,"data-ref":t.id})}),sK=m.memo(function(e){var t=e.slices,n=e.axis,r=e.debug,i=e.height,a=e.tooltip,o=e.current,s=e.setCurrent,c=e.onMouseEnter,l=e.onMouseMove,u=e.onMouseLeave,d=e.onClick,f=e.onTouchStart,h=e.onTouchMove,g=e.onTouchEnd;return t.map(function(p){return b.jsx(oK,{slice:p,slices:t,axis:n,debug:r,height:i,tooltip:a,setCurrent:s,isCurrent:o!==null&&o.id===p.id,onMouseEnter:c,onMouseMove:l,onMouseLeave:u,onClick:d,onTouchStart:f,onTouchMove:h,onTouchEnd:g},p.id)})}),cK=m.memo(function(e){var t=e.points,n=e.symbol,r=e.size,i=e.borderWidth,a=e.enableLabel,o=e.label,s=e.labelYOffset,c=ht(),l=FV(o),u=t.slice(0).reverse().map(function(d){return{id:d.id,x:d.x,y:d.y,datum:d.data,fill:d.color,stroke:d.borderColor,label:a?l(d):null}});return b.jsx("g",{children:u.map(function(d){return b.jsx(IV,{x:d.x,y:d.y,datum:d.datum,symbol:n,size:r,color:d.fill,borderWidth:i,borderColor:d.stroke,label:d.label,labelYOffset:s,theme:c},d.id)})})}),lK=m.memo(function(e){var t=e.points,n=e.width,r=e.height,i=e.margin,a=e.setCurrent,o=e.onMouseEnter,s=e.onMouseMove,c=e.onMouseLeave,l=e.onClick,u=e.onTouchStart,d=e.onTouchMove,f=e.onTouchEnd,h=e.tooltip,g=e.debug,p=e.enableTouchCrosshair,v=Li(),x=v.showTooltipAt,_=v.hideTooltip,y=m.useCallback(function(k,O){x(m.createElement(h,{point:k}),[k.x+i.left,k.y+i.top],"top"),o&&o(k,O)},[x,h,o,i]),C=m.useCallback(function(k,O){x(m.createElement(h,{point:k}),[k.x+i.left,k.y+i.top],"top"),s&&s(k,O)},[x,h,i.left,i.top,s]),w=m.useCallback(function(k,O){_(),c&&c(k,O)},[_,c]),T=m.useCallback(function(k,O){l&&l(k,O)},[l]),$=m.useCallback(function(k,O){x(m.createElement(h,{point:k}),[k.x+i.left,k.y+i.top],"top"),u&&u(k,O)},[i.left,i.top,u,x,h]),R=m.useCallback(function(k,O){x(m.createElement(h,{point:k}),[k.x+i.left,k.y+i.top],"top"),d&&d(k,O)},[i.left,i.top,d,x,h]),S=m.useCallback(function(k,O){_(),f&&f(k,O)},[f,_]);return b.jsx(ZZ,{nodes:t,width:n,height:r,setCurrent:a,onMouseEnter:y,onMouseMove:C,onMouseLeave:w,onClick:T,onTouchStart:$,onTouchMove:R,onTouchEnd:S,enableTouchCrosshair:p,debug:g})}),uK=DC(function(e){var t=e.data,n=e.xScale,r=n===void 0?{type:"point"}:n,i=e.xFormat,a=e.yScale,o=a===void 0?{type:"linear",min:0,max:"auto"}:a,s=e.yFormat,c=e.layers,l=c===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:c,u=e.curve,d=u===void 0?"linear":u,f=e.areaBaselineValue,h=f===void 0?0:f,g=e.colors,p=g===void 0?{scheme:"nivo"}:g,v=e.margin,x=e.width,_=e.height,y=e.axisTop,C=e.axisRight,w=e.axisBottom,T=w===void 0?{}:w,$=e.axisLeft,R=$===void 0?{}:$,S=e.enableGridX,k=S===void 0||S,O=e.enableGridY,D=O===void 0||O,E=e.gridXValues,M=e.gridYValues,j=e.lineWidth,F=j===void 0?2:j,W=e.enableArea,B=W!==void 0&&W,U=e.areaOpacity,N=U===void 0?.2:U,V=e.areaBlendMode,X=V===void 0?"normal":V,ne=e.enablePoints,K=ne===void 0||ne,J=e.pointSymbol,q=e.pointSize,G=q===void 0?6:q,z=e.pointColor,L=z===void 0?{from:"color"}:z,H=e.pointBorderWidth,ee=H===void 0?0:H,A=e.pointBorderColor,se=A===void 0?{theme:"background"}:A,ce=e.enablePointLabel,ue=ce!==void 0&&ce,we=e.pointLabel,Te=we===void 0?"data.yFormatted":we,at=e.pointLabelYOffset,tt=e.defs,Be=tt===void 0?[]:tt,Ke=e.fill,Ye=Ke===void 0?[]:Ke,de=e.markers,ke=e.legends,Oe=ke===void 0?[]:ke,ve=e.isInteractive,Ie=ve===void 0||ve,Xe=e.useMesh,It=Xe!==void 0&&Xe,mt=e.debugMesh,Je=mt!==void 0&&mt,bt=e.onMouseEnter,At=e.onMouseMove,it=e.onMouseLeave,gt=e.onClick,yt=e.onTouchStart,Lt=e.onTouchMove,$e=e.onTouchEnd,Pe=e.tooltip,ze=Pe===void 0?rg:Pe,nt=e.enableSlices,vt=nt!==void 0&&nt,kt=e.debugSlices,Xt=kt!==void 0&&kt,Dt=e.sliceTooltip,Bt=Dt===void 0?hT:Dt,Ht=e.enableCrosshair,Mt=Ht===void 0||Ht,Wt=e.crosshairType,Jt=Wt===void 0?"bottom-left":Wt,Vt=e.enableTouchCrosshair,fe=Vt!==void 0&&Vt,ye=e.role,Ee=ye===void 0?"img":ye,qe=Us(x,_,v),Ge=qe.margin,ot=qe.innerWidth,P=qe.innerHeight,re=qe.outerWidth,Z=qe.outerHeight,te=mT({data:t,xScale:r,xFormat:i,yScale:o,yFormat:s,width:ot,height:P,colors:p,curve:d,areaBaselineValue:h,pointColor:L,pointBorderColor:se,enableSlices:vt}),ge=te.legendData,Ce=te.toggleSerie,pe=te.lineGenerator,be=te.areaGenerator,Ae=te.series,Me=te.xScale,et=te.yScale,Nt=te.slices,wt=te.points,Ut=ht(),le=ar(L,Ut),cn=ar(se,Ut),Ft=m.useState(null),dr=Ft[0],lg=Ft[1],ug=m.useState(null),Qa=ug[0],dg=ug[1],ni={grid:b.jsx(cT,{theme:Ut,width:ot,height:P,xScale:k?Me:null,yScale:D?et:null,xValues:E,yValues:M},"grid"),markers:b.jsx(IC,{markers:de,width:ot,height:P,xScale:Me,yScale:et,theme:Ut},"markers"),axes:b.jsx(sT,{xScale:Me,yScale:et,width:ot,height:P,theme:Ut,top:y,right:C,bottom:T,left:R},"axes"),areas:null,lines:b.jsx(aK,{lines:Ae,lineGenerator:pe,lineWidth:F},"lines"),slices:null,points:null,crosshair:null,mesh:null,legends:Oe.map(function(ri,hd){return b.jsx(Jm,hn({},ri,{containerWidth:ot,containerHeight:P,data:ri.data||ge,theme:Ut,toggleSerie:ri.toggleSerie?Ce:void 0}),"legend."+hd)})},BT=Km(Be,Ae,Ye);return B&&(ni.areas=b.jsx(rK,{areaGenerator:be,areaOpacity:N,areaBlendMode:X,lines:Ae},"areas")),Ie&&vt!==!1&&(ni.slices=b.jsx(sK,{slices:Nt,axis:vt,debug:Xt,height:P,tooltip:Bt,current:Qa,setCurrent:dg,onMouseEnter:bt,onMouseMove:At,onMouseLeave:it,onClick:gt,onTouchStart:yt,onTouchMove:Lt,onTouchEnd:$e},"slices")),K&&(ni.points=b.jsx(cK,{points:wt,symbol:J,size:G,color:le,borderWidth:ee,borderColor:cn,enableLabel:ue,label:Te,labelYOffset:at},"points")),Ie&&Mt&&(dr!==null&&(ni.crosshair=b.jsx(oh,{width:ot,height:P,x:dr.x,y:dr.y,type:Jt},"crosshair")),Qa!==null&&(ni.crosshair=b.jsx(oh,{width:ot,height:P,x:Qa.x,y:Qa.y,type:vt},"crosshair"))),Ie&&It&&vt===!1&&(ni.mesh=b.jsx(lK,{points:wt,width:ot,height:P,margin:Ge,current:dr,setCurrent:lg,onMouseEnter:bt,onMouseMove:At,onMouseLeave:it,onClick:gt,onTouchStart:yt,onTouchMove:Lt,onTouchEnd:$e,tooltip:ze,enableTouchCrosshair:fe,debug:Je},"mesh")),b.jsx(ld,{defs:BT,width:re,height:Z,margin:Ge,role:Ee,children:l.map(function(ri,hd){return typeof ri=="function"?b.jsx(m.Fragment,{children:ri(hn({},e,{innerWidth:ot,innerHeight:P,series:Ae,slices:Nt,points:wt,xScale:Me,yScale:et,lineGenerator:pe,areaGenerator:be,currentPoint:dr,setCurrentPoint:lg,currentSlice:Qa,setCurrentSlice:dg}))},hd):ni[ri]})})}),dK=function(e){return b.jsx(Ka,{children:function(t){var n=t.width,r=t.height;return b.jsx(uK,hn({width:n,height:r},e))}})},fK=DC(function(e){var t=m.useRef(null),n=e.width,r=e.height,i=e.margin,a=e.pixelRatio,o=a===void 0?typeof window<"u"&&window.devicePixelRatio||1:a,s=e.data,c=e.xScale,l=c===void 0?{type:"point"}:c,u=e.xFormat,d=e.yScale,f=d===void 0?{type:"linear",min:0,max:"auto"}:d,h=e.yFormat,g=e.curve,p=g===void 0?"linear":g,v=e.layers,x=v===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:v,_=e.colors,y=_===void 0?{scheme:"nivo"}:_,C=e.lineWidth,w=C===void 0?2:C,T=e.enableArea,$=T!==void 0&&T,R=e.areaBaselineValue,S=R===void 0?0:R,k=e.areaOpacity,O=k===void 0?.2:k,D=e.enablePoints,E=D===void 0||D,M=e.pointSize,j=M===void 0?6:M,F=e.pointColor,W=F===void 0?{from:"color"}:F,B=e.pointBorderWidth,U=B===void 0?0:B,N=e.pointBorderColor,V=N===void 0?{theme:"background"}:N,X=e.enableGridX,ne=X===void 0||X,K=e.gridXValues,J=e.enableGridY,q=J===void 0||J,G=e.gridYValues,z=e.axisTop,L=e.axisRight,H=e.axisBottom,ee=H===void 0?{}:H,A=e.axisLeft,se=A===void 0?{}:A,ce=e.legends,ue=ce===void 0?[]:ce,we=e.isInteractive,Te=we===void 0||we,at=e.debugMesh,tt=at!==void 0&&at,Be=e.onMouseLeave,Ke=e.onClick,Ye=e.tooltip,de=Ye===void 0?rg:Ye,ke=e.canvasRef,Oe=Us(n,r,i),ve=Oe.margin,Ie=Oe.innerWidth,Xe=Oe.innerHeight,It=Oe.outerWidth,mt=Oe.outerHeight,Je=ht(),bt=m.useState(null),At=bt[0],it=bt[1],gt=mT({data:s,xScale:l,xFormat:u,yScale:f,yFormat:h,width:Ie,height:Xe,colors:y,curve:p,areaBaselineValue:S,pointColor:W,pointBorderColor:V}),yt=gt.lineGenerator,Lt=gt.areaGenerator,$e=gt.series,Pe=gt.xScale,ze=gt.yScale,nt=gt.points,vt=fT({points:nt,width:Ie,height:Xe,debug:tt}),kt=vt.delaunay,Xt=vt.voronoi;m.useEffect(function(){ke&&(ke.current=t.current),t.current.width=It*o,t.current.height=mt*o;var fe=t.current.getContext("2d");fe.scale(o,o),fe.fillStyle=Je.background,fe.fillRect(0,0,It,mt),fe.translate(ve.left,ve.top),x.forEach(function(ye){if(typeof ye=="function"&&ye({ctx:fe,innerWidth:Ie,innerHeight:Xe,series:$e,points:nt,xScale:Pe,yScale:ze,lineWidth:w,lineGenerator:yt,areaGenerator:Lt,currentPoint:At,setCurrentPoint:it}),ye==="grid"&&Je.grid.line.strokeWidth>0&&(fe.lineWidth=Je.grid.line.strokeWidth,fe.strokeStyle=Je.grid.line.stroke,ne&&Cl(fe,{width:Ie,height:Xe,scale:Pe,axis:"x",values:K}),q&&Cl(fe,{width:Ie,height:Xe,scale:ze,axis:"y",values:G})),ye==="axes"&&lT(fe,{xScale:Pe,yScale:ze,width:Ie,height:Xe,top:z,right:L,bottom:ee,left:se,theme:Je}),ye==="areas"&&$===!0){fe.save(),fe.globalAlpha=O,Lt.context(fe);for(var Ee=$e.length-1;Ee>=0;Ee--)fe.fillStyle=$e[Ee].color,fe.beginPath(),Lt($e[Ee].data.map(function(Ge){return Ge.position})),fe.fill();fe.restore()}if(ye==="lines"&&(yt.context(fe),$e.forEach(function(Ge){fe.strokeStyle=Ge.color,fe.lineWidth=w,fe.beginPath(),yt(Ge.data.map(function(ot){return ot.position})),fe.stroke()})),ye==="points"&&E===!0&&j>0&&nt.forEach(function(Ge){fe.fillStyle=Ge.color,fe.beginPath(),fe.arc(Ge.x,Ge.y,j/2,0,2*Math.PI),fe.fill(),U>0&&(fe.strokeStyle=Ge.borderColor,fe.lineWidth=U,fe.stroke())}),ye==="mesh"&&tt===!0&&(KZ(fe,Xt),At&&XZ(fe,Xt,At.index)),ye==="legends"){var qe=$e.map(function(Ge){return{id:Ge.id,label:Ge.id,color:Ge.color}}).reverse();ue.forEach(function(Ge){YC(fe,hn({},Ge,{data:Ge.data||qe,containerWidth:Ie,containerHeight:Xe,theme:Je}))})}})},[t,It,mt,x,Je,yt,$e,Pe,ze,ne,K,q,G,z,L,ee,se,ue,nt,E,j,At]);var Dt=m.useCallback(function(fe){var ye=jo(t.current,fe),Ee=ye[0],qe=ye[1];if(!FC(ve.left,ve.top,Ie,Xe,Ee,qe))return null;var Ge=kt.find(Ee-ve.left,qe-ve.top);return nt[Ge]},[t,ve,Ie,Xe,kt]),Bt=Li(),Ht=Bt.showTooltipFromEvent,Mt=Bt.hideTooltip,Wt=m.useCallback(function(fe){var ye=Dt(fe);it(ye),ye?Ht(m.createElement(de,{point:ye}),fe):Mt()},[Dt,it,Ht,Mt,de]),Jt=m.useCallback(function(fe){Mt(),it(null),At&&Be&&Be(At,fe)},[Mt,it,Be]),Vt=m.useCallback(function(fe){if(Ke){var ye=Dt(fe);ye&&Ke(ye,fe)}},[Dt,Ke]);return b.jsx("canvas",{ref:t,width:It*o,height:mt*o,style:{width:It,height:mt,cursor:Te?"auto":"normal"},onMouseEnter:Te?Wt:void 0,onMouseMove:Te?Wt:void 0,onMouseLeave:Te?Jt:void 0,onClick:Te?Vt:void 0})}),hK=m.forwardRef(function(e,t){return b.jsx(fK,hn({},e,{canvasRef:t}))});m.forwardRef(function(e,t){return b.jsx(Ka,{children:function(n){var r=n.width,i=n.height;return b.jsx(hK,hn({width:r,height:i},e,{ref:t}))}})});var pK=QC;function mK(e,t){var n=[];return pK(e,function(r,i,a){t(r,i,a)&&n.push(r)}),n}var gK=mK,vK=hC,bK=gK,yK=eg,xK=Cn;function _K(e,t){var n=xK(e)?vK:bK;return n(e,yK(t))}var wK=_K;const CK=Rt(wK);var TK=Or,kK=Nn,SK="[object Number]";function OK(e){return typeof e=="number"||kK(e)&&TK(e)==SK}var EK=OK;const Jb=Rt(EK);function MK(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var $K=MK,RK=Va,AK=Ws;function jK(e,t){return e&&RK(t,AK(t),e)}var PK=jK,IK=Va,DK=Fs;function NK(e,t){return e&&IK(t,DK(t),e)}var FK=NK,LK=Va,BK=Vm;function WK(e,t){return LK(e,BK(e),t)}var UK=WK,zK=zm,HK=tm,VK=Vm,qK=pC,YK=Object.getOwnPropertySymbols,GK=YK?function(e){for(var t=[];e;)zK(t,VK(e)),e=HK(e);return t}:qK,gT=GK,ZK=Va,KK=gT;function XK(e,t){return ZK(e,KK(e),t)}var QK=XK,JK=fC,eX=gT,tX=Fs;function nX(e){return JK(e,tX,eX)}var vT=nX,rX=Object.prototype,iX=rX.hasOwnProperty;function aX(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&iX.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var oX=aX,sX=em;function cX(e,t){var n=t?sX(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var lX=cX,uX=/\w*$/;function dX(e){var t=new e.constructor(e.source,uX.exec(e));return t.lastIndex=e.lastIndex,t}var fX=dX,ey=La,ty=ey?ey.prototype:void 0,ny=ty?ty.valueOf:void 0;function hX(e){return ny?Object(ny.call(e)):{}}var pX=hX,mX=em,gX=lX,vX=fX,bX=pX,yX=$_,xX="[object Boolean]",_X="[object Date]",wX="[object Map]",CX="[object Number]",TX="[object RegExp]",kX="[object Set]",SX="[object String]",OX="[object Symbol]",EX="[object ArrayBuffer]",MX="[object DataView]",$X="[object Float32Array]",RX="[object Float64Array]",AX="[object Int8Array]",jX="[object Int16Array]",PX="[object Int32Array]",IX="[object Uint8Array]",DX="[object Uint8ClampedArray]",NX="[object Uint16Array]",FX="[object Uint32Array]";function LX(e,t,n){var r=e.constructor;switch(t){case EX:return mX(e);case xX:case _X:return new r(+e);case MX:return gX(e,n);case $X:case RX:case AX:case jX:case PX:case IX:case DX:case NX:case FX:return yX(e,n);case wX:return new r;case CX:case SX:return new r(e);case TX:return vX(e);case kX:return new r;case OX:return bX(e)}}var BX=LX,WX=od,UX=Nn,zX="[object Map]";function HX(e){return UX(e)&&WX(e)==zX}var VX=HX,qX=VX,YX=Ha,ry=vu,iy=ry&&ry.isMap,GX=iy?YX(iy):qX,ZX=GX,KX=od,XX=Nn,QX="[object Set]";function JX(e){return XX(e)&&KX(e)==QX}var eQ=JX,tQ=eQ,nQ=Ha,ay=vu,oy=ay&&ay.isSet,rQ=oy?nQ(oy):tQ,iQ=rQ,aQ=pu,oQ=$K,sQ=sm,cQ=PK,lQ=FK,uQ=E_,dQ=R_,fQ=UK,hQ=QK,pQ=mC,mQ=vT,gQ=od,vQ=oX,bQ=BX,yQ=j_,xQ=Cn,_Q=gu,wQ=ZX,CQ=ur,TQ=iQ,kQ=Ws,SQ=Fs,OQ=1,EQ=2,MQ=4,bT="[object Arguments]",$Q="[object Array]",RQ="[object Boolean]",AQ="[object Date]",jQ="[object Error]",yT="[object Function]",PQ="[object GeneratorFunction]",IQ="[object Map]",DQ="[object Number]",xT="[object Object]",NQ="[object RegExp]",FQ="[object Set]",LQ="[object String]",BQ="[object Symbol]",WQ="[object WeakMap]",UQ="[object ArrayBuffer]",zQ="[object DataView]",HQ="[object Float32Array]",VQ="[object Float64Array]",qQ="[object Int8Array]",YQ="[object Int16Array]",GQ="[object Int32Array]",ZQ="[object Uint8Array]",KQ="[object Uint8ClampedArray]",XQ="[object Uint16Array]",QQ="[object Uint32Array]",Ct={};Ct[bT]=Ct[$Q]=Ct[UQ]=Ct[zQ]=Ct[RQ]=Ct[AQ]=Ct[HQ]=Ct[VQ]=Ct[qQ]=Ct[YQ]=Ct[GQ]=Ct[IQ]=Ct[DQ]=Ct[xT]=Ct[NQ]=Ct[FQ]=Ct[LQ]=Ct[BQ]=Ct[ZQ]=Ct[KQ]=Ct[XQ]=Ct[QQ]=!0;Ct[jQ]=Ct[yT]=Ct[WQ]=!1;function $c(e,t,n,r,i,a){var o,s=t&OQ,c=t&EQ,l=t&MQ;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!CQ(e))return e;var u=xQ(e);if(u){if(o=vQ(e),!s)return dQ(e,o)}else{var d=gQ(e),f=d==yT||d==PQ;if(_Q(e))return uQ(e,s);if(d==xT||d==bT||f&&!i){if(o=c||f?{}:yQ(e),!s)return c?hQ(e,lQ(o,e)):fQ(e,cQ(o,e))}else{if(!Ct[d])return i?e:{};o=bQ(e,d,s)}}a||(a=new aQ);var h=a.get(e);if(h)return h;a.set(e,o),TQ(e)?e.forEach(function(v){o.add($c(v,t,n,v,e,a))}):wQ(e)&&e.forEach(function(v,x){o.set(x,$c(v,t,n,x,e,a))});var g=l?c?mQ:pQ:c?SQ:kQ,p=u?void 0:g(e);return oQ(p||e,function(v,x){p&&(x=v,v=e[x]),sQ(o,x,$c(v,t,n,x,e,a))}),o}var JQ=$c;function eJ(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}var tJ=eJ,nJ=Ls,rJ=tJ;function iJ(e,t){return t.length<2?e:nJ(e,rJ(t,0,-1))}var aJ=iJ,oJ=qa,sJ=ew,cJ=aJ,lJ=Ya;function uJ(e,t){return t=oJ(t,e),e=cJ(e,t),e==null||delete e[lJ(sJ(t))]}var dJ=uJ,fJ=im;function hJ(e){return fJ(e)?void 0:e}var pJ=hJ,mJ=_u,gJ=JQ,vJ=dJ,bJ=qa,yJ=Va,xJ=pJ,_J=uC,wJ=vT,CJ=1,TJ=2,kJ=4,SJ=_J(function(e,t){var n={};if(e==null)return n;var r=!1;t=mJ(t,function(a){return a=bJ(a,e),r||(r=a.length>1),a}),yJ(e,wJ(e),n),r&&(n=gJ(n,CJ|TJ|kJ,xJ));for(var i=t.length;i--;)vJ(n,t[i]);return n}),OJ=SJ;const _T=Rt(OJ);function or(){return or=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},or.apply(this,arguments)}var $h={dotSize:4,noteWidth:120,noteTextOffset:8,animate:!0},EJ=function(e){var t=typeof e;return m.isValidElement(e)||t==="string"||t==="function"||t==="object"},MJ=function(e){var t=typeof e;return t==="string"||t==="function"},xs=function(e){return e.type==="circle"},Rh=function(e){return e.type==="dot"},_s=function(e){return e.type==="rect"},$J=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return n.reduce(function(a,o){var s=o.offset||0;return[].concat(a,CK(t,o.match).map(function(c){var l=r(c),u=i(c);return(xs(o)||_s(o))&&(u.size=u.size+2*s,u.width=u.width+2*s,u.height=u.height+2*s),or({},_T(o,["match","offset"]),l,u,{size:o.size||u.size,datum:c})}))},[])},RJ=function(e,t,n,r){var i=Math.atan2(r-t,n-e);return $V(cd(i))},wT=function(e){var t,n,r=e.x,i=e.y,a=e.noteX,o=e.noteY,s=e.noteWidth,c=s===void 0?$h.noteWidth:s,l=e.noteTextOffset,u=l===void 0?$h.noteTextOffset:l;if(Jb(a))t=r+a;else{if(a.abs===void 0)throw new Error("noteX should be either a number or an object containing an 'abs' property");t=a.abs}if(Jb(o))n=i+o;else{if(o.abs===void 0)throw new Error("noteY should be either a number or an object containing an 'abs' property");n=o.abs}var d=r,f=i,h=RJ(r,i,t,n);if(xs(e)){var g=Ci(An(h),e.size/2);d+=g.x,f+=g.y}if(_s(e)){var p=Math.round((h+90)/45)%8;p===0&&(f-=e.height/2),p===1&&(d+=e.width/2,f-=e.height/2),p===2&&(d+=e.width/2),p===3&&(d+=e.width/2,f+=e.height/2),p===4&&(f+=e.height/2),p===5&&(d-=e.width/2,f+=e.height/2),p===6&&(d-=e.width/2),p===7&&(d-=e.width/2,f-=e.height/2)}var v=t,x=t;return(h+90)%360>180?(v-=c,x-=c):x+=c,{points:[[d,f],[t,n],[x,n]],text:[v,n-u],angle:h+90}},CT=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return m.useMemo(function(){return $J({data:t,annotations:n,getPosition:r,getDimensions:i})},[t,n,r,i])},AJ=function(e){var t=e.annotations;return m.useMemo(function(){return t.map(function(n){return or({},n,{computed:wT(or({},n))})})},[t])},jJ=function(e){return m.useMemo(function(){return wT(e)},[e])},PJ=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,a=ht(),o=mn(),s=o.animate,c=o.config,l=cr({x:n,y:r,config:c,immediate:!s});return typeof i=="function"?m.createElement(i,{x:n,y:r,datum:t}):b.jsxs(b.Fragment,{children:[a.annotations.text.outlineWidth>0&&b.jsx(ft.text,{x:l.x,y:l.y,style:or({},a.annotations.text,{strokeLinejoin:"round",strokeWidth:2*a.annotations.text.outlineWidth,stroke:a.annotations.text.outlineColor}),children:i}),b.jsx(ft.text,{x:l.x,y:l.y,style:_T(a.annotations.text,["outlineWidth","outlineColor"]),children:i})]})},sy=function(e){var t=e.points,n=e.isOutline,r=n!==void 0&&n,i=ht(),a=m.useMemo(function(){var c=t[0];return t.slice(1).reduce(function(l,u){return l+" L"+u[0]+","+u[1]},"M"+c[0]+","+c[1])},[t]),o=Ym(a);if(r&&i.annotations.link.outlineWidth<=0)return null;var s=or({},i.annotations.link);return r&&(s.strokeLinecap="square",s.strokeWidth=i.annotations.link.strokeWidth+2*i.annotations.link.outlineWidth,s.stroke=i.annotations.link.outlineColor,s.opacity=i.annotations.link.outlineOpacity),b.jsx(ft.path,{fill:"none",d:o,style:s})},IJ=function(e){var t=e.x,n=e.y,r=e.size,i=ht(),a=mn(),o=a.animate,s=a.config,c=cr({x:t,y:n,radius:r/2,config:s,immediate:!o});return b.jsxs(b.Fragment,{children:[i.annotations.outline.outlineWidth>0&&b.jsx(ft.circle,{cx:c.x,cy:c.y,r:c.radius,style:or({},i.annotations.outline,{fill:"none",strokeWidth:i.annotations.outline.strokeWidth+2*i.annotations.outline.outlineWidth,stroke:i.annotations.outline.outlineColor,opacity:i.annotations.outline.outlineOpacity})}),b.jsx(ft.circle,{cx:c.x,cy:c.y,r:c.radius,style:i.annotations.outline})]})},DJ=function(e){var t=e.x,n=e.y,r=e.size,i=r===void 0?$h.dotSize:r,a=ht(),o=mn(),s=o.animate,c=o.config,l=cr({x:t,y:n,radius:i/2,config:c,immediate:!s});return b.jsxs(b.Fragment,{children:[a.annotations.outline.outlineWidth>0&&b.jsx(ft.circle,{cx:l.x,cy:l.y,r:l.radius,style:or({},a.annotations.outline,{fill:"none",strokeWidth:2*a.annotations.outline.outlineWidth,stroke:a.annotations.outline.outlineColor,opacity:a.annotations.outline.outlineOpacity})}),b.jsx(ft.circle,{cx:l.x,cy:l.y,r:l.radius,style:a.annotations.symbol})]})},NJ=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.borderRadius,o=a===void 0?6:a,s=ht(),c=mn(),l=c.animate,u=c.config,d=cr({x:t-r/2,y:n-i/2,width:r,height:i,config:u,immediate:!l});return b.jsxs(b.Fragment,{children:[s.annotations.outline.outlineWidth>0&&b.jsx(ft.rect,{x:d.x,y:d.y,rx:o,ry:o,width:d.width,height:d.height,style:or({},s.annotations.outline,{fill:"none",strokeWidth:s.annotations.outline.strokeWidth+2*s.annotations.outline.outlineWidth,stroke:s.annotations.outline.outlineColor,opacity:s.annotations.outline.outlineOpacity})}),b.jsx(ft.rect,{x:d.x,y:d.y,rx:o,ry:o,width:d.width,height:d.height,style:s.annotations.outline})]})},FJ=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,a=jJ(e);if(!EJ(i))throw new Error("note should be a valid react element");return b.jsxs(b.Fragment,{children:[b.jsx(sy,{points:a.points,isOutline:!0}),xs(e)&&b.jsx(IJ,{x:n,y:r,size:e.size}),Rh(e)&&b.jsx(DJ,{x:n,y:r,size:e.size}),_s(e)&&b.jsx(NJ,{x:n,y:r,width:e.width,height:e.height,borderRadius:e.borderRadius}),b.jsx(sy,{points:a.points}),b.jsx(PJ,{datum:t,x:a.text[0],y:a.text[1],note:i})]})},cy=function(e,t){t.forEach(function(n,r){var i=n[0],a=n[1];r===0?e.moveTo(i,a):e.lineTo(i,a)})},LJ=function(e,t){var n=t.annotations,r=t.theme;n.length!==0&&(e.save(),n.forEach(function(i){if(!MJ(i.note))throw new Error("note is invalid for canvas implementation");r.annotations.link.outlineWidth>0&&(e.lineCap="square",e.strokeStyle=r.annotations.link.outlineColor,e.lineWidth=r.annotations.link.strokeWidth+2*r.annotations.link.outlineWidth,e.beginPath(),cy(e,i.computed.points),e.stroke(),e.lineCap="butt"),xs(i)&&r.annotations.outline.outlineWidth>0&&(e.strokeStyle=r.annotations.outline.outlineColor,e.lineWidth=r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),Rh(i)&&r.annotations.symbol.outlineWidth>0&&(e.strokeStyle=r.annotations.symbol.outlineColor,e.lineWidth=2*r.annotations.symbol.outlineWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),_s(i)&&r.annotations.outline.outlineWidth>0&&(e.strokeStyle=r.annotations.outline.outlineColor,e.lineWidth=r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,e.beginPath(),e.rect(i.x-i.width/2,i.y-i.height/2,i.width,i.height),e.stroke()),e.strokeStyle=r.annotations.link.stroke,e.lineWidth=r.annotations.link.strokeWidth,e.beginPath(),cy(e,i.computed.points),e.stroke(),xs(i)&&(e.strokeStyle=r.annotations.outline.stroke,e.lineWidth=r.annotations.outline.strokeWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),Rh(i)&&(e.fillStyle=r.annotations.symbol.fill,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.fill()),_s(i)&&(e.strokeStyle=r.annotations.outline.stroke,e.lineWidth=r.annotations.outline.strokeWidth,e.beginPath(),e.rect(i.x-i.width/2,i.y-i.height/2,i.width,i.height),e.stroke()),typeof i.note=="function"?i.note(e,{datum:i.datum,x:i.computed.text[0],y:i.computed.text[1],theme:r}):(e.font=r.annotations.text.fontSize+"px "+r.annotations.text.fontFamily,e.textAlign="left",e.textBaseline="alphabetic",e.fillStyle=r.annotations.text.fill,e.strokeStyle=r.annotations.text.outlineColor,e.lineWidth=2*r.annotations.text.outlineWidth,r.annotations.text.outlineWidth>0&&(e.lineJoin="round",e.strokeText(i.note,i.computed.text[0],i.computed.text[1]),e.lineJoin="miter"),e.fillText(i.note,i.computed.text[0],i.computed.text[1]))}),e.restore())};function pt(){return pt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pt.apply(this,arguments)}function Xa(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var ly,BJ=function(e){var t=e.bars,n=e.annotations,r=CT({data:t,annotations:n,getPosition:function(i){return{x:i.x+i.width/2,y:i.y+i.height/2}},getDimensions:function(i){var a=i.height,o=i.width;return{width:o,height:a,size:Math.max(o,a)}}});return b.jsx(b.Fragment,{children:r.map(function(i,a){return b.jsx(FJ,pt({},i),a)})})},WJ=function(e){var t=e.width,n=e.height,r=e.legends,i=e.toggleSerie;return b.jsx(b.Fragment,{children:r.map(function(a,o){var s,c=a[0],l=a[1];return b.jsx(Jm,pt({},c,{containerWidth:t,containerHeight:n,data:(s=c.data)!=null?s:l,toggleSerie:c.toggleSerie&&c.dataFrom==="keys"?i:void 0}),o)})})},UJ=["data"],zJ=function(e){var t,n=e.bar,r=n.data,i=Xa(n,UJ),a=e.style,o=a.borderColor,s=a.color,c=a.height,l=a.labelColor,u=a.labelOpacity,d=a.labelX,f=a.labelY,h=a.transform,g=a.width,p=e.borderRadius,v=e.borderWidth,x=e.label,_=e.shouldRenderLabel,y=e.isInteractive,C=e.onClick,w=e.onMouseEnter,T=e.onMouseLeave,$=e.tooltip,R=e.isFocusable,S=e.ariaLabel,k=e.ariaLabelledBy,O=e.ariaDescribedBy,D=ht(),E=Li(),M=E.showTooltipFromEvent,j=E.showTooltipAt,F=E.hideTooltip,W=m.useMemo(function(){return function(){return m.createElement($,pt({},i,r))}},[$,i,r]),B=m.useCallback(function(K){C==null||C(pt({color:i.color},r),K)},[i,r,C]),U=m.useCallback(function(K){return M(W(),K)},[M,W]),N=m.useCallback(function(K){w==null||w(r,K),M(W(),K)},[r,w,M,W]),V=m.useCallback(function(K){T==null||T(r,K),F()},[r,F,T]),X=m.useCallback(function(){j(W(),[i.absX+i.width/2,i.absY])},[j,W,i]),ne=m.useCallback(function(){F()},[F]);return b.jsxs(ft.g,{transform:h,children:[b.jsx(ft.rect,{width:Zr(g,function(K){return Math.max(K,0)}),height:Zr(c,function(K){return Math.max(K,0)}),rx:p,ry:p,fill:(t=r.fill)!=null?t:s,strokeWidth:v,stroke:o,focusable:R,tabIndex:R?0:void 0,"aria-label":S?S(r):void 0,"aria-labelledby":k?k(r):void 0,"aria-describedby":O?O(r):void 0,onMouseEnter:y?N:void 0,onMouseMove:y?U:void 0,onMouseLeave:y?V:void 0,onClick:y?B:void 0,onFocus:y&&R?X:void 0,onBlur:y&&R?ne:void 0}),_&&b.jsx(ft.text,{x:d,y:f,textAnchor:"middle",dominantBaseline:"central",fillOpacity:u,style:pt({},D.labels.text,{pointerEvents:"none",fill:l}),children:x})]})},HJ=["color","label"],VJ=function(e){var t=e.color,n=e.label,r=Xa(e,HJ);return b.jsx(Zp,{id:n,value:r.formattedValue,enableChip:!0,color:t})},xt={indexBy:"id",keys:["value"],groupMode:"stacked",layout:"vertical",reverse:!1,minValue:"auto",maxValue:"auto",valueScale:{type:"linear"},indexScale:{type:"band",round:!0},padding:.1,innerPadding:0,axisBottom:{},axisLeft:{},enableGridX:!1,enableGridY:!0,enableLabel:!0,label:"formattedValue",labelSkipWidth:0,labelSkipHeight:0,labelTextColor:{from:"theme",theme:"labels.text.fill"},colorBy:"id",colors:{scheme:"nivo"},borderRadius:0,borderWidth:0,borderColor:{from:"color"},isInteractive:!0,tooltip:VJ,tooltipLabel:function(e){return e.id+" - "+e.indexValue},legends:[],initialHiddenIds:[],annotations:[],markers:[],enableTotals:!1,totalsOffset:10},St=pt({},xt,{layers:["grid","axes","bars","totals","markers","legends","annotations"],barComponent:zJ,defs:[],fill:[],animate:!0,motionConfig:"default",role:"img",isFocusable:!1}),Qt=pt({},xt,{layers:["grid","axes","bars","totals","legends","annotations"],pixelRatio:typeof window<"u"&&(ly=window.devicePixelRatio)!=null?ly:1}),TT=function(e,t,n,r,i,a){return ys(r,{all:e.map(t),min:0,max:0},i,a).padding(n)},kT=function(e,t){return e.map(function(n){return pt({},t.reduce(function(r,i){return r[i]=null,r},{}),n)})},ud=function(e){return Object.keys(e).reduce(function(t,n){return e[n]&&(t[n]=e[n]),t},{})},dd=function(e){return[e,Number(e)]},qJ=["layout","minValue","maxValue","reverse","width","height","padding","innerPadding","valueScale","indexScale","hiddenIds"],ig=function(e,t){return e>t},ST=function(e,t){return e<t},OT=function(e,t){return Array.from(" ".repeat(t-e),function(n,r){return e+r})},YJ=function(e){return ig(e,0)?0:e},GJ=function(e,t,n,r){var i=e.data,a=e.formatValue,o=e.getColor,s=e.getIndex,c=e.getTooltipLabel,l=e.innerPadding,u=l===void 0?0:l,d=e.keys,f=e.xScale,h=e.yScale,g=e.margin,p=n?ST:ig,v=i.map(ud),x=[];return d.forEach(function(_,y){return OT(0,f.domain().length).forEach(function(C){var w,T,$,R=dd(i[C][_]),S=R[0],k=R[1],O=s(i[C]),D=((w=f(O))!=null?w:0)+t*y+u*y,E=p(T=k,0)?($=h(T))!=null?$:0:r,M=function(F,W){var B;return p(F,0)?r-W:((B=h(F))!=null?B:0)-r}(k,E),j={id:_,value:S===null?S:k,formattedValue:a(k),hidden:!1,index:C,indexValue:O,data:v[C]};x.push({key:_+"."+j.indexValue,index:x.length,data:j,x:D,y:E,absX:g.left+D,absY:g.top+E,width:t,height:M,color:o(j),label:c(j)})})}),x},ZJ=function(e,t,n,r){var i=e.data,a=e.formatValue,o=e.getIndex,s=e.getColor,c=e.getTooltipLabel,l=e.keys,u=e.innerPadding,d=u===void 0?0:u,f=e.xScale,h=e.yScale,g=e.margin,p=n?ST:ig,v=i.map(ud),x=[];return l.forEach(function(_,y){return OT(0,h.domain().length).forEach(function(C){var w,T,$,R=dd(i[C][_]),S=R[0],k=R[1],O=o(i[C]),D=p(T=k,0)?r:($=f(T))!=null?$:0,E=((w=h(O))!=null?w:0)+t*y+d*y,M=function(F,W){var B;return p(F,0)?((B=f(F))!=null?B:0)-r:r-W}(k,D),j={id:_,value:S===null?S:k,formattedValue:a(k),hidden:!1,index:C,indexValue:O,data:v[C]};x.push({key:_+"."+j.indexValue,index:x.length,data:j,x:D,y:E,absX:g.left+D,absY:g.top+E,width:M,height:t,color:s(j),label:c(j)})})}),x},KJ=function(e){var t,n,r=e.layout,i=e.minValue,a=e.maxValue,o=e.reverse,s=e.width,c=e.height,l=e.padding,u=l===void 0?0:l,d=e.innerPadding,f=d===void 0?0:d,h=e.valueScale,g=e.indexScale,p=e.hiddenIds,v=p===void 0?[]:p,x=Xa(e,qJ),_=x.keys.filter(function(N){return!v.includes(N)}),y=kT(x.data,_),C=r==="vertical"?["y","x",s]:["x","y",c],w=C[0],T=C[1],$=C[2],R=TT(y,x.getIndex,u,g,$,T),S=pt({max:a,min:i,reverse:o},h),k=S.min==="auto"?YJ:function(N){return N},O=y.reduce(function(N,V){return[].concat(N,_.map(function(X){return V[X]}))},[]).filter(Boolean),D=k(Math.min.apply(Math,O)),E=(n=Math.max.apply(Math,O),isFinite(n)?n:0),M=ys(S,{all:O,min:D,max:E},w==="x"?s:c,w),j=r==="vertical"?[R,M]:[M,R],F=j[0],W=j[1],B=(R.bandwidth()-f*(_.length-1))/_.length,U=[pt({},x,{data:y,keys:_,innerPadding:f,xScale:F,yScale:W}),B,S.reverse,(t=M(0))!=null?t:0];return{xScale:F,yScale:W,bars:B>0?r==="vertical"?GJ.apply(void 0,U):ZJ.apply(void 0,U):[]}},XJ=["data","layout","minValue","maxValue","reverse","width","height","padding","valueScale","indexScale","hiddenIds"],QJ=function e(t){var n;return t.some(Array.isArray)?e((n=[]).concat.apply(n,t)):t},JJ=function(e,t,n){var r=e.formatValue,i=e.getColor,a=e.getIndex,o=e.getTooltipLabel,s=e.innerPadding,c=e.stackedData,l=e.xScale,u=e.yScale,d=e.margin,f=[];return c.forEach(function(h){return l.domain().forEach(function(g,p){var v,x,_=h[p],y=(v=l(a(_.data)))!=null?v:0,C=((x=function(k){return u(k[n?0:1])}(_))!=null?x:0)+.5*s,w=function(k,O){var D;return((D=u(k[n?1:0]))!=null?D:0)-O}(_,C)-s,T=dd(_.data[h.key]),$=T[0],R=T[1],S={id:h.key,value:$===null?$:R,formattedValue:r(R),hidden:!1,index:p,indexValue:g,data:ud(_.data)};f.push({key:h.key+"."+g,index:f.length,data:S,x:y,y:C,absX:d.left+y,absY:d.top+C,width:t,height:w,color:i(S),label:o(S)})})}),f},eee=function(e,t,n){var r=e.formatValue,i=e.getColor,a=e.getIndex,o=e.getTooltipLabel,s=e.innerPadding,c=e.stackedData,l=e.xScale,u=e.yScale,d=e.margin,f=[];return c.forEach(function(h){return u.domain().forEach(function(g,p){var v,x,_=h[p],y=(v=u(a(_.data)))!=null?v:0,C=((x=function(k){return l(k[n?1:0])}(_))!=null?x:0)+.5*s,w=function(k,O){var D;return((D=l(k[n?0:1]))!=null?D:0)-O}(_,C)-s,T=dd(_.data[h.key]),$=T[0],R=T[1],S={id:h.key,value:$===null?$:R,formattedValue:r(R),hidden:!1,index:p,indexValue:g,data:ud(_.data)};f.push({key:h.key+"."+g,index:f.length,data:S,x:C,y,absX:d.left+C,absY:d.top+y,width:w,height:t,color:i(S),label:o(S)})})}),f},tee=function(e){var t,n=e.data,r=e.layout,i=e.minValue,a=e.maxValue,o=e.reverse,s=e.width,c=e.height,l=e.padding,u=l===void 0?0:l,d=e.valueScale,f=e.indexScale,h=e.hiddenIds,g=h===void 0?[]:h,p=Xa(e,XJ),v=p.keys.filter(function(B){return!g.includes(B)}),x=LU().keys(v).offset(BU)(kT(n,v)),_=r==="vertical"?["y","x",s]:["x","y",c],y=_[0],C=_[1],w=_[2],T=TT(n,p.getIndex,u,f,w,C),$=pt({max:a,min:i,reverse:o},d),R=(t=QJ(x),d.type==="log"?t.filter(function(B){return B!==0}):t),S=Math.min.apply(Math,R),k=Math.max.apply(Math,R),O=ys($,{all:R,min:S,max:k},y==="x"?s:c,y),D=r==="vertical"?[T,O]:[O,T],E=D[0],M=D[1],j=p.innerPadding>0?p.innerPadding:0,F=T.bandwidth(),W=[pt({},p,{innerPadding:j,stackedData:x,xScale:E,yScale:M}),F,$.reverse];return{xScale:E,yScale:M,bars:F>0?r==="vertical"?JJ.apply(void 0,W):eee.apply(void 0,W):[]}},nee=function(e){var t=e.bars,n=e.direction,r=e.from,i=e.groupMode,a=e.layout,o=e.legendLabel,s=e.reverse,c=NC(o??(r==="indexes"?"indexValue":"id"));return r==="indexes"?function(l,u,d){var f=Oh(l.map(function(h){var g,p;return{id:(g=h.data.indexValue)!=null?g:"",label:d(h.data),hidden:h.data.hidden,color:(p=h.color)!=null?p:"#000"}}),function(h){return h.id});return u==="horizontal"&&f.reverse(),f}(t,a,c):function(l,u,d,f,h,g){var p=Oh(l.map(function(v){var x;return{id:v.data.id,label:g(v.data),hidden:v.data.hidden,color:(x=v.color)!=null?x:"#000"}}),function(v){return v.id});return(u==="vertical"&&f==="stacked"&&d==="column"&&h!==!0||u==="horizontal"&&f==="stacked"&&h===!0)&&p.reverse(),p}(t,a,n,i,s,c)},uy=function(e,t,n){var r=e.get(t)||0;e.set(t,r+n)},ree=function(e,t,n){var r=e.get(t)||0;e.set(t,r+(n>0?n:0))},iee=function(e,t,n){var r=e.get(t)||0;e.set(t,Math.max(r,Number(n)))},aee=function(e,t){var n=e.get(t)||0;e.set(t,n+1)},ET=function(e){var t=e.indexBy,n=t===void 0?xt.indexBy:t,r=e.keys,i=r===void 0?xt.keys:r,a=e.label,o=a===void 0?xt.label:a,s=e.tooltipLabel,c=s===void 0?xt.tooltipLabel:s,l=e.valueFormat,u=e.colors,d=u===void 0?xt.colors:u,f=e.colorBy,h=f===void 0?xt.colorBy:f,g=e.borderColor,p=g===void 0?xt.borderColor:g,v=e.labelTextColor,x=v===void 0?xt.labelTextColor:v,_=e.groupMode,y=_===void 0?xt.groupMode:_,C=e.layout,w=C===void 0?xt.layout:C,T=e.reverse,$=T===void 0?xt.reverse:T,R=e.data,S=e.minValue,k=S===void 0?xt.minValue:S,O=e.maxValue,D=O===void 0?xt.maxValue:O,E=e.margin,M=e.width,j=e.height,F=e.padding,W=F===void 0?xt.padding:F,B=e.innerPadding,U=B===void 0?xt.innerPadding:B,N=e.valueScale,V=N===void 0?xt.valueScale:N,X=e.indexScale,ne=X===void 0?xt.indexScale:X,K=e.initialHiddenIds,J=K===void 0?xt.initialHiddenIds:K,q=e.enableLabel,G=q===void 0?xt.enableLabel:q,z=e.labelSkipWidth,L=z===void 0?xt.labelSkipWidth:z,H=e.labelSkipHeight,ee=H===void 0?xt.labelSkipHeight:H,A=e.legends,se=A===void 0?xt.legends:A,ce=e.legendLabel,ue=e.totalsOffset,we=ue===void 0?xt.totalsOffset:ue,Te=m.useState(J??[]),at=Te[0],tt=Te[1],Be=m.useCallback(function($e){tt(function(Pe){return Pe.indexOf($e)>-1?Pe.filter(function(ze){return ze!==$e}):[].concat(Pe,[$e])})},[]),Ke=Ti(n),Ye=Ti(o),de=Ti(c),ke=Ma(l),Oe=ht(),ve=Xm(d,h),Ie=ar(p,Oe),Xe=ar(x,Oe),It=(y==="grouped"?KJ:tee)({layout:w,reverse:$,data:R,getIndex:Ke,keys:i,minValue:k,maxValue:D,width:M,height:j,getColor:ve,padding:W,innerPadding:U,valueScale:V,indexScale:ne,hiddenIds:at,formatValue:ke,getTooltipLabel:de,margin:E}),mt=It.bars,Je=It.xScale,bt=It.yScale,At=m.useMemo(function(){return mt.filter(function($e){return $e.data.value!==null}).map(function($e,Pe){return pt({},$e,{index:Pe})})},[mt]),it=m.useCallback(function($e){var Pe=$e.width,ze=$e.height;return!!G&&!(L>0&&Pe<L)&&!(ee>0&&ze<ee)},[G,L,ee]),gt=m.useMemo(function(){return i.map(function($e){var Pe=mt.find(function(ze){return ze.data.id===$e});return pt({},Pe,{data:pt({id:$e},Pe==null?void 0:Pe.data,{hidden:at.includes($e)})})})},[at,i,mt]),yt=m.useMemo(function(){return se.map(function($e){return[$e,nee({bars:$e.dataFrom==="keys"?gt:mt,direction:$e.direction,from:$e.dataFrom,groupMode:y,layout:w,legendLabel:ce,reverse:$})]})},[se,gt,mt,y,w,ce,$]),Lt=m.useMemo(function(){return function($e,Pe,ze,nt,vt,kt,Xt){nt===void 0&&(nt=xt.layout),vt===void 0&&(vt=xt.groupMode);var Dt=[];if($e.length===0)return Dt;var Bt=new Map,Ht=$e[0].width,Mt=$e[0].height;if(vt==="stacked"){var Wt=new Map;$e.forEach(function(fe){var ye=fe.data,Ee=ye.indexValue,qe=ye.value;uy(Bt,Ee,Number(qe)),ree(Wt,Ee,Number(qe))}),Wt.forEach(function(fe,ye){var Ee,qe,Ge,ot=Bt.get(ye)||0;nt==="vertical"?(Ee=Pe(ye),qe=ze(fe),Ge=ze(fe/2)):(Ee=Pe(fe),qe=ze(ye),Ge=Pe(fe/2)),Ee+=nt==="vertical"?Ht/2:kt,qe+=nt==="vertical"?-kt:Mt/2,Dt.push({key:"total_"+ye,x:Ee,y:qe,value:ot,formattedValue:Xt(ot),animationOffset:Ge})})}else if(vt==="grouped"){var Jt=new Map,Vt=new Map;$e.forEach(function(fe){var ye=fe.data,Ee=ye.indexValue,qe=ye.value;uy(Bt,Ee,Number(qe)),iee(Jt,Ee,Number(qe)),aee(Vt,Ee)}),Jt.forEach(function(fe,ye){var Ee,qe,Ge,ot=Bt.get(ye)||0,P=Vt.get(ye);nt==="vertical"?(Ee=Pe(ye),qe=ze(fe),Ge=ze(fe/2)):(Ee=Pe(fe),qe=ze(ye),Ge=Pe(fe/2)),Ee+=nt==="vertical"?P*Ht/2:kt,qe+=nt==="vertical"?-kt:P*Mt/2,Dt.push({key:"total_"+ye,x:Ee,y:qe,value:ot,formattedValue:Xt(ot),animationOffset:Ge})})}return Dt}(mt,Je,bt,w,y,we,ke)},[mt,Je,bt,w,y,we,ke]);return{bars:mt,barsWithValue:At,xScale:Je,yScale:bt,getIndex:Ke,getLabel:Ye,getTooltipLabel:de,formatValue:ke,getColor:ve,getBorderColor:Ie,getLabelColor:Xe,shouldRenderBarLabel:it,hiddenIds:at,toggleSerie:Be,legendsWithData:yt,barTotals:Lt}},oee=function(e){var t=e.data,n=e.springConfig,r=e.animate,i=e.layout,a=i===void 0?St.layout:i,o=ht();return Fi(t,{keys:function(s){return s.key},from:function(s){return{x:a==="vertical"?s.x:s.animationOffset,y:a==="vertical"?s.animationOffset:s.y,labelOpacity:0}},enter:function(s){return{x:s.x,y:s.y,labelOpacity:1}},update:function(s){return{x:s.x,y:s.y,labelOpacity:1}},leave:function(s){return{x:a==="vertical"?s.x:s.animationOffset,y:a==="vertical"?s.animationOffset:s.y,labelOpacity:0}},config:n,immediate:!r,initial:r?void 0:null})(function(s,c){return b.jsx(ft.text,{x:s.x,y:s.y,fillOpacity:s.labelOpacity,style:pt({},o.labels.text,{pointerEvents:"none",fill:o.text.fill}),fontWeight:"bold",fontSize:o.labels.text.fontSize,fontFamily:o.labels.text.fontFamily,textAnchor:a==="vertical"?"middle":"start",alignmentBaseline:a==="vertical"?"alphabetic":"middle",children:c.formattedValue},c.key)})},see=["isInteractive","animate","motionConfig","theme","renderWrapper"],cee=function(e){var t=e.data,n=e.indexBy,r=e.keys,i=e.margin,a=e.width,o=e.height,s=e.groupMode,c=e.layout,l=e.reverse,u=e.minValue,d=e.maxValue,f=e.valueScale,h=e.indexScale,g=e.padding,p=e.innerPadding,v=e.axisTop,x=e.axisRight,_=e.axisBottom,y=_===void 0?St.axisBottom:_,C=e.axisLeft,w=C===void 0?St.axisLeft:C,T=e.enableGridX,$=T===void 0?St.enableGridX:T,R=e.enableGridY,S=R===void 0?St.enableGridY:R,k=e.gridXValues,O=e.gridYValues,D=e.layers,E=D===void 0?St.layers:D,M=e.barComponent,j=M===void 0?St.barComponent:M,F=e.enableLabel,W=F===void 0?St.enableLabel:F,B=e.label,U=e.labelSkipWidth,N=U===void 0?St.labelSkipWidth:U,V=e.labelSkipHeight,X=V===void 0?St.labelSkipHeight:V,ne=e.labelTextColor,K=e.markers,J=K===void 0?St.markers:K,q=e.colorBy,G=e.colors,z=e.defs,L=z===void 0?St.defs:z,H=e.fill,ee=H===void 0?St.fill:H,A=e.borderRadius,se=A===void 0?St.borderRadius:A,ce=e.borderWidth,ue=ce===void 0?St.borderWidth:ce,we=e.borderColor,Te=e.annotations,at=Te===void 0?St.annotations:Te,tt=e.legendLabel,Be=e.tooltipLabel,Ke=e.valueFormat,Ye=e.isInteractive,de=Ye===void 0?St.isInteractive:Ye,ke=e.tooltip,Oe=ke===void 0?St.tooltip:ke,ve=e.onClick,Ie=e.onMouseEnter,Xe=e.onMouseLeave,It=e.legends,mt=e.role,Je=mt===void 0?St.role:mt,bt=e.ariaLabel,At=e.ariaLabelledBy,it=e.ariaDescribedBy,gt=e.isFocusable,yt=gt===void 0?St.isFocusable:gt,Lt=e.barAriaLabel,$e=e.barAriaLabelledBy,Pe=e.barAriaDescribedBy,ze=e.initialHiddenIds,nt=e.enableTotals,vt=nt===void 0?St.enableTotals:nt,kt=e.totalsOffset,Xt=kt===void 0?St.totalsOffset:kt,Dt=mn(),Bt=Dt.animate,Ht=Dt.config,Mt=Us(a,o,i),Wt=Mt.outerWidth,Jt=Mt.outerHeight,Vt=Mt.margin,fe=Mt.innerWidth,ye=Mt.innerHeight,Ee=ET({indexBy:n,label:B,tooltipLabel:Be,valueFormat:Ke,colors:G,colorBy:q,borderColor:we,labelTextColor:ne,groupMode:s,layout:c,reverse:l,data:t,keys:r,minValue:u,maxValue:d,margin:Vt,width:fe,height:ye,padding:g,innerPadding:p,valueScale:f,indexScale:h,enableLabel:W,labelSkipWidth:N,labelSkipHeight:X,legends:It,legendLabel:tt,initialHiddenIds:ze,totalsOffset:Xt}),qe=Ee.bars,Ge=Ee.barsWithValue,ot=Ee.xScale,P=Ee.yScale,re=Ee.getLabel,Z=Ee.getTooltipLabel,te=Ee.getBorderColor,ge=Ee.getLabelColor,Ce=Ee.shouldRenderBarLabel,pe=Ee.toggleSerie,be=Ee.legendsWithData,Ae=Ee.barTotals,Me=Fi(Ge,{keys:function(le){return le.key},from:function(le){return pt({borderColor:te(le),color:le.color,height:0,labelColor:ge(le),labelOpacity:0,labelX:le.width/2,labelY:le.height/2,transform:"translate("+le.x+", "+(le.y+le.height)+")",width:le.width},c==="vertical"?{}:{height:le.height,transform:"translate("+le.x+", "+le.y+")",width:0})},enter:function(le){return{borderColor:te(le),color:le.color,height:le.height,labelColor:ge(le),labelOpacity:1,labelX:le.width/2,labelY:le.height/2,transform:"translate("+le.x+", "+le.y+")",width:le.width}},update:function(le){return{borderColor:te(le),color:le.color,height:le.height,labelColor:ge(le),labelOpacity:1,labelX:le.width/2,labelY:le.height/2,transform:"translate("+le.x+", "+le.y+")",width:le.width}},leave:function(le){return pt({borderColor:te(le),color:le.color,height:0,labelColor:ge(le),labelOpacity:0,labelX:le.width/2,labelY:0,transform:"translate("+le.x+", "+(le.y+le.height)+")",width:le.width},c==="vertical"?{}:{labelX:0,labelY:le.height/2,height:le.height,transform:"translate("+le.x+", "+le.y+")",width:0})},config:Ht,immediate:!Bt,initial:Bt?void 0:null}),et=m.useMemo(function(){return{borderRadius:se,borderWidth:ue,enableLabel:W,isInteractive:de,labelSkipWidth:N,labelSkipHeight:X,onClick:ve,onMouseEnter:Ie,onMouseLeave:Xe,getTooltipLabel:Z,tooltip:Oe,isFocusable:yt,ariaLabel:Lt,ariaLabelledBy:$e,ariaDescribedBy:Pe}},[se,ue,W,Z,de,X,N,ve,Ie,Xe,Oe,yt,Lt,$e,Pe]),Nt=Km(L,qe,ee,{dataKey:"data",targetKey:"data.fill"}),wt={annotations:null,axes:null,bars:null,grid:null,legends:null,markers:null,totals:null};E.includes("annotations")&&(wt.annotations=b.jsx(BJ,{bars:qe,annotations:at},"annotations")),E.includes("axes")&&(wt.axes=b.jsx(sT,{xScale:ot,yScale:P,width:fe,height:ye,top:v,right:x,bottom:y,left:w},"axes")),E.includes("bars")&&(wt.bars=b.jsx(m.Fragment,{children:Me(function(le,cn){return m.createElement(j,pt({},et,{bar:cn,style:le,shouldRenderLabel:Ce(cn),label:re(cn.data)}))})},"bars")),E.includes("grid")&&(wt.grid=b.jsx(cT,{width:fe,height:ye,xScale:$?ot:null,yScale:S?P:null,xValues:k,yValues:O},"grid")),E.includes("legends")&&(wt.legends=b.jsx(WJ,{width:fe,height:ye,legends:be,toggleSerie:pe},"legends")),E.includes("markers")&&(wt.markers=b.jsx(IC,{markers:J,width:fe,height:ye,xScale:ot,yScale:P},"markers")),E.includes("totals")&&vt&&(wt.totals=b.jsx(oee,{data:Ae,springConfig:Ht,animate:Bt,layout:c},"totals"));var Ut=m.useMemo(function(){return pt({},et,{margin:Vt,width:a,height:o,innerWidth:fe,innerHeight:ye,bars:qe,legendData:be,enableLabel:W,xScale:ot,yScale:P,tooltip:Oe,getTooltipLabel:Z,onClick:ve,onMouseEnter:Ie,onMouseLeave:Xe})},[et,Vt,a,o,fe,ye,qe,be,W,ot,P,Oe,Z,ve,Ie,Xe]);return b.jsx(ld,{width:Wt,height:Jt,margin:Vt,defs:Nt,role:Je,ariaLabel:bt,ariaLabelledBy:At,ariaDescribedBy:it,isFocusable:yt,children:E.map(function(le,cn){var Ft;return typeof le=="function"?b.jsx(m.Fragment,{children:m.createElement(le,Ut)},cn):(Ft=wt==null?void 0:wt[le])!=null?Ft:null})})},lee=function(e){var t=e.isInteractive,n=t===void 0?St.isInteractive:t,r=e.animate,i=r===void 0?St.animate:r,a=e.motionConfig,o=a===void 0?St.motionConfig:a,s=e.theme,c=e.renderWrapper,l=Xa(e,see);return b.jsx(zs,{animate:i,isInteractive:n,motionConfig:o,renderWrapper:c,theme:s,children:b.jsx(cee,pt({isInteractive:n},l))})},uee=["isInteractive","renderWrapper","theme"],uf=function(e,t,n,r){return e.find(function(i){return FC(i.x+t.left,i.y+t.top,i.width,i.height,n,r)})},dee=function(e){var t=e.data,n=e.indexBy,r=e.keys,i=e.margin,a=e.width,o=e.height,s=e.groupMode,c=e.layout,l=e.reverse,u=e.minValue,d=e.maxValue,f=e.valueScale,h=e.indexScale,g=e.padding,p=e.innerPadding,v=e.axisTop,x=e.axisRight,_=e.axisBottom,y=_===void 0?Qt.axisBottom:_,C=e.axisLeft,w=C===void 0?Qt.axisLeft:C,T=e.enableGridX,$=T===void 0?Qt.enableGridX:T,R=e.enableGridY,S=R===void 0?Qt.enableGridY:R,k=e.gridXValues,O=e.gridYValues,D=e.layers,E=D===void 0?Qt.layers:D,M=e.renderBar,j=M===void 0?function(Z,te){var ge=te.bar,Ce=ge.color,pe=ge.height,be=ge.width,Ae=ge.x,Me=ge.y,et=te.borderColor,Nt=te.borderRadius,wt=te.borderWidth,Ut=te.label,le=te.labelColor,cn=te.shouldRenderLabel;if(Z.fillStyle=Ce,wt>0&&(Z.strokeStyle=et,Z.lineWidth=wt),Z.beginPath(),Nt>0){var Ft=Math.min(Nt,pe);Z.moveTo(Ae+Ft,Me),Z.lineTo(Ae+be-Ft,Me),Z.quadraticCurveTo(Ae+be,Me,Ae+be,Me+Ft),Z.lineTo(Ae+be,Me+pe-Ft),Z.quadraticCurveTo(Ae+be,Me+pe,Ae+be-Ft,Me+pe),Z.lineTo(Ae+Ft,Me+pe),Z.quadraticCurveTo(Ae,Me+pe,Ae,Me+pe-Ft),Z.lineTo(Ae,Me+Ft),Z.quadraticCurveTo(Ae,Me,Ae+Ft,Me),Z.closePath()}else Z.rect(Ae,Me,be,pe);Z.fill(),wt>0&&Z.stroke(),cn&&(Z.textBaseline="middle",Z.textAlign="center",Z.fillStyle=le,Z.fillText(Ut,Ae+be/2,Me+pe/2))}:M,F=e.enableLabel,W=F===void 0?Qt.enableLabel:F,B=e.label,U=e.labelSkipWidth,N=U===void 0?Qt.labelSkipWidth:U,V=e.labelSkipHeight,X=V===void 0?Qt.labelSkipHeight:V,ne=e.labelTextColor,K=e.colorBy,J=e.colors,q=e.borderRadius,G=q===void 0?Qt.borderRadius:q,z=e.borderWidth,L=z===void 0?Qt.borderWidth:z,H=e.borderColor,ee=e.annotations,A=ee===void 0?Qt.annotations:ee,se=e.legendLabel,ce=e.tooltipLabel,ue=e.valueFormat,we=e.isInteractive,Te=we===void 0?Qt.isInteractive:we,at=e.tooltip,tt=at===void 0?Qt.tooltip:at,Be=e.onClick,Ke=e.onMouseEnter,Ye=e.onMouseLeave,de=e.legends,ke=e.pixelRatio,Oe=ke===void 0?Qt.pixelRatio:ke,ve=e.canvasRef,Ie=e.enableTotals,Xe=Ie===void 0?Qt.enableTotals:Ie,It=e.totalsOffset,mt=It===void 0?Qt.totalsOffset:It,Je=m.useRef(null),bt=ht(),At=Us(a,o,i),it=At.margin,gt=At.innerWidth,yt=At.innerHeight,Lt=At.outerWidth,$e=At.outerHeight,Pe=ET({indexBy:n,label:B,tooltipLabel:ce,valueFormat:ue,colors:J,colorBy:K,borderColor:H,labelTextColor:ne,groupMode:s,layout:c,reverse:l,data:t,keys:r,minValue:u,maxValue:d,margin:it,width:gt,height:yt,padding:g,innerPadding:p,valueScale:f,indexScale:h,enableLabel:W,labelSkipWidth:N,labelSkipHeight:X,legends:de,legendLabel:se,totalsOffset:mt}),ze=Pe.bars,nt=Pe.barsWithValue,vt=Pe.xScale,kt=Pe.yScale,Xt=Pe.getLabel,Dt=Pe.getTooltipLabel,Bt=Pe.getBorderColor,Ht=Pe.getLabelColor,Mt=Pe.shouldRenderBarLabel,Wt=Pe.legendsWithData,Jt=Pe.barTotals,Vt=Li(),fe=Vt.showTooltipFromEvent,ye=Vt.hideTooltip,Ee=AJ({annotations:CT({data:ze,annotations:A,getPosition:function(Z){return{x:Z.x,y:Z.y}},getDimensions:function(Z){var te=Z.width,ge=Z.height;return{width:te,height:ge,size:Math.max(te,ge)}}})}),qe=m.useMemo(function(){return{borderRadius:G,borderWidth:L,isInteractive:Te,isFocusable:!1,labelSkipWidth:N,labelSkipHeight:X,margin:it,width:a,height:o,innerWidth:gt,innerHeight:yt,bars:ze,legendData:Wt,enableLabel:W,xScale:vt,yScale:kt,tooltip:tt,getTooltipLabel:Dt,onClick:Be,onMouseEnter:Ke,onMouseLeave:Ye}},[G,L,Te,N,X,it,a,o,gt,yt,ze,Wt,W,vt,kt,tt,Dt,Be,Ke,Ye]),Ge=Ma(ue);m.useEffect(function(){var Z,te=(Z=Je.current)==null?void 0:Z.getContext("2d");Je.current&&te&&(Je.current.width=Lt*Oe,Je.current.height=$e*Oe,te.scale(Oe,Oe),te.fillStyle=bt.background,te.fillRect(0,0,Lt,$e),te.translate(it.left,it.top),E.forEach(function(ge){ge==="grid"?typeof bt.grid.line.strokeWidth=="number"&&bt.grid.line.strokeWidth>0&&(te.lineWidth=bt.grid.line.strokeWidth,te.strokeStyle=bt.grid.line.stroke,$&&Cl(te,{width:gt,height:yt,scale:vt,axis:"x",values:k}),S&&Cl(te,{width:gt,height:yt,scale:kt,axis:"y",values:O})):ge==="axes"?lT(te,{xScale:vt,yScale:kt,width:gt,height:yt,top:v,right:x,bottom:y,left:w,theme:bt}):ge==="bars"?nt.forEach(function(Ce){j(te,{bar:Ce,borderColor:Bt(Ce),borderRadius:G,borderWidth:L,label:Xt(Ce.data),labelColor:Ht(Ce),shouldRenderLabel:Mt(Ce)})}):ge==="legends"?Wt.forEach(function(Ce){var pe=Ce[0],be=Ce[1];YC(te,pt({},pe,{data:be,containerWidth:gt,containerHeight:yt,theme:bt}))}):ge==="annotations"?LJ(te,{annotations:Ee,theme:bt}):ge==="totals"&&Xe?function(Ce,pe,be,Ae){Ae===void 0&&(Ae=Qt.layout),Ce.fillStyle=be.text.fill,Ce.font="bold "+be.labels.text.fontSize+"px "+be.labels.text.fontFamily,Ce.textBaseline=Ae==="vertical"?"alphabetic":"middle",Ce.textAlign=Ae==="vertical"?"center":"start",pe.forEach(function(Me){Ce.fillText(Me.formattedValue,Me.x,Me.y)})}(te,Jt,bt,c):typeof ge=="function"&&ge(te,qe)}),te.save())},[y,w,x,v,nt,G,L,Ee,$,S,Bt,Xt,Ht,k,O,s,o,yt,gt,qe,E,c,Wt,it.left,it.top,$e,Lt,Oe,j,vt,kt,l,Mt,bt,a,Jt,Xe,Ge]);var ot=m.useCallback(function(Z){if(ze&&Je.current){var te=jo(Je.current,Z),ge=te[0],Ce=te[1],pe=uf(ze,it,ge,Ce);pe!==void 0?(fe(m.createElement(tt,pt({},pe.data,{color:pe.color,label:pe.label,value:Number(pe.data.value)})),Z),Z.type==="mouseenter"&&(Ke==null||Ke(pe.data,Z))):ye()}},[ye,it,Ke,ze,fe,tt]),P=m.useCallback(function(Z){if(ze&&Je.current){ye();var te=jo(Je.current,Z),ge=te[0],Ce=te[1],pe=uf(ze,it,ge,Ce);pe&&(Ye==null||Ye(pe.data,Z))}},[ye,it,Ye,ze]),re=m.useCallback(function(Z){if(ze&&Je.current){var te=jo(Je.current,Z),ge=te[0],Ce=te[1],pe=uf(ze,it,ge,Ce);pe!==void 0&&(Be==null||Be(pt({},pe.data,{color:pe.color}),Z))}},[it,Be,ze]);return b.jsx("canvas",{ref:function(Z){Je.current=Z,ve&&"current"in ve&&(ve.current=Z)},width:Lt*Oe,height:$e*Oe,style:{width:Lt,height:$e,cursor:Te?"auto":"normal"},onMouseEnter:Te?ot:void 0,onMouseMove:Te?ot:void 0,onMouseLeave:Te?P:void 0,onClick:Te?re:void 0})},fee=m.forwardRef(function(e,t){var n=e.isInteractive,r=e.renderWrapper,i=e.theme,a=Xa(e,uee);return b.jsx(zs,{isInteractive:n,renderWrapper:r,theme:i,animate:!1,children:b.jsx(dee,pt({},a,{canvasRef:t}))})}),hee=function(e){return b.jsx(Ka,{children:function(t){var n=t.width,r=t.height;return b.jsx(lee,pt({width:n,height:r},e))}})};m.forwardRef(function(e,t){return b.jsx(Ka,{children:function(n){var r=n.width,i=n.height;return b.jsx(fee,pt({width:r,height:i},e,{ref:t}))}})});const pee="_side-content-bar_7crz7_1",mee="_mobile_7crz7_12",gee="_expanded_7crz7_20",vee="_resizer_7crz7_23",bee="_expander_7crz7_38",yee="_icon_7crz7_57",jr={"side-content-bar":"_side-content-bar_7crz7_1",sideContentBar:pee,mobile:mee,expanded:gee,resizer:vee,expander:bee,icon:yee},MT=({width:e,children:t,isExpandedOnMobileState:[n,r],onResize:i})=>{const{ProjectIconComponent:a}=m.useContext(Pt),{isMobile:o}=$s(),s=Rp({onSwipedRight:u=>{u.velocity>.8&&r(!1)},delta:100}),[c,l]=m.useState(null);return b.jsxs(b.Fragment,{children:[b.jsxs("section",{className:Q("luminus-side-content-bar shadow",jr.sideContentBar,{[jr.mobile]:o},{[jr.expanded]:n}),style:{width:`${e}px`},...s,children:[o?null:b.jsx("div",{role:"button",className:Q(jr.resizer,"luminus-side-content-bar-resizer","shadow"),draggable:!0,onDragStart:u=>l({startX:u.clientX,widthStart:e}),onDrag:u=>i(((c==null?void 0:c.widthStart)??0)+(((c==null?void 0:c.startX)??0)-u.clientX)),onDragEnd:()=>l(null),children:b.jsx(a,{className:jr.icon,icon:"resizer-horizontal"})}),t]}),o?b.jsx("div",{role:"button",onClick:()=>r(!n),className:Q(jr.expander,{[jr.expanded]:n},"luminus-side-content-bar-expander","shadow"),children:b.jsx(a,{className:jr.icon,icon:"chevron-left"})}):null]})},xee=({title:e})=>b.jsx("div",{className:"mb-3",children:typeof e=="string"?b.jsx(dn,{variant:"h3",children:e}):e}),_ee="_full-screen-container_1rm4r_1",$T={"full-screen-container":"_full-screen-container_1rm4r_1",fullScreenContainer:_ee},wee=Q("overflow-hidden luminus-full-screen-container",$T.fullScreenContainer),Cee="container-fluid",Tee=({title:e,children:t,sideContent:n,sideContentWidth:r=250,noPadding:i,className:a,variant:o="main",helmet:s,unavailableOnMobile:c})=>{const{addHelmet:l,removeHelmet:u}=m.useContext(g2),{texts:{container:d}}=m.useContext(Pt),[f,h]=m.useState(r),[g,p]=m.useState(!1),v=m.useMemo(()=>{switch(o){case"fullScreen":return wee;case"main":return Cee;default:throw new Error(`PageContainer got incorrect variant type: ${o}`)}},[o]);m.useEffect(()=>(s?l(s):typeof e=="string"&&e&&l(e),()=>u()),[s,l,u,e]);const x=Rp({onSwipedLeft:C=>{C.velocity>.8&&p(!0)},delta:100}),{isMobile:_}=$s(),y=m.useMemo(()=>_&&c,[_,c]);return m.useEffect(()=>{h(r)},[r]),b.jsxs(b.Fragment,{children:[b.jsx("div",{className:Q(v,i?"p-0":"p-3",a),style:o==="fullScreen"?{width:n?`calc(100% - ${f}px)`:"100%"}:void 0,...x,children:b.jsx("div",{className:o==="fullScreen"?$T.fullScreenContainer:void 0,style:o==="main"?{paddingRight:n?`${f}px`:void 0}:{height:"100%",width:"100%"},children:y?b.jsx(Ap,{variant:"warning",children:d.unavailableOnMobile}):b.jsxs(b.Fragment,{children:[e?b.jsx(xee,{title:e}):null,t]})})}),n&&!y?b.jsx(MT,{width:f,isExpandedOnMobileState:[g,p],onResize:C=>h(C),children:n}):null]})},ag=({InputContainer:e=As,formField:t,label:n,resetsFields:r,options:i,isNumber:a,size:o,showClearIcon:s,clearValue:c,noSortOptions:l,required:u,hidden:d,disabled:f,withoutLabel:h,hint:g,className:p})=>{const{register:v,formState:x,getValues:_,setValue:y,watch:C}=rn.useFormContext(),w=Xl({falseIfNotInit:!0});console.log("disabled ",f),console.log("formDisabled ",w);const[T,$]=m.useState(void 0),[R,S]=m.useState(!1),k=m.useMemo(()=>i.toSorted((M,j)=>l?0:(M.name??"").localeCompare(j.name??"")),[i,l]),O=m.useCallback(()=>{const M=c??null;a?y(t,M===null?null:Number(M),{shouldDirty:!0,shouldValidate:R}):y(t,(M==null?void 0:M.toString())??"",{shouldDirty:!0,shouldValidate:R})},[c,a,y,t,R]);m.useEffect(()=>{const M=t.split(".");let j=x.errors;M.forEach(F=>{j!==void 0&&(j=j[F])}),$(j)},[x,t]);const D=m.useMemo(()=>f||w,[f,w]);console.log(D),m.useEffect(()=>{y(t,_(t))},[k,t,_,y]),m.useEffect(()=>{x.isSubmitted&&S(!0)},[x]);const E=T!==void 0;return b.jsx(b.Fragment,{children:b.jsxs(e,{label:n??"",required:u,disabled:D,hidden:d,withoutLabel:h,isInvalid:E,hint:g,className:p,children:[b.jsxs(sr.Select,{size:o,...v(t,{setValueAs:M=>a?M==null||M===""?null:parseInt(M,10):M==null||M===""?null:M,onChange:()=>{r&&r.forEach(M=>y(M,null,{shouldDirty:!0,shouldValidate:R}))}}),isInvalid:E,hidden:d,disabled:D,className:"w-100",children:[b.jsx("option",{value:""}),k.map(M=>b.jsx("option",{value:M.id??"",children:M.name},M.id))]}),s&&C(t)&&b.jsx("div",{className:"luminus-input-remove-icon inset",children:b.jsx(Rs,{color:"secondary",size:"sm",onClick:O,children:b.jsx(ks,{})})}),T&&b.jsx(Jl,{message:T.message})]})})},og=({InputContainer:e=As,formField:t,label:n,resetsFields:r,size:i,showClearIcon:a,clearValue:o,required:s,hidden:c,disabled:l,rows:u,withoutLabel:d,customFormControlProps:f,minLength:h,maxLength:g,hint:p,onChange:v,className:x})=>{const{register:_,formState:y,setValue:C,watch:w}=rn.useFormContext(),T=Xl({falseIfNotInit:!0}),[$,R]=m.useState(void 0),[S,k]=m.useState(!1),O=m.useCallback(()=>{const j=o??null;C(t,(j==null?void 0:j.toString())??"",{shouldDirty:!0,shouldValidate:S})},[o,C,t,S]),D=m.useCallback(()=>{const j=t.split(".");let F=y.errors;j.forEach(W=>{F!==void 0&&(F=F[W])}),R(F)},[y,t]),E=m.useMemo(()=>l||T,[l,T]);m.useEffect(()=>{D()},[D]),m.useEffect(()=>{y.isSubmitted&&k(!0)},[y]);const M=$!==void 0;return b.jsxs(e,{label:n??"",required:s,disabled:E,hidden:c,withoutLabel:d,isInvalid:M,className:x,hint:p,isForTextAreaInput:!0,children:[b.jsx(sr.Control,{as:"textarea",size:i,..._(t,{setValueAs:j=>j==null||j===""?null:j,onChange:j=>{var F;r&&r.forEach(W=>C(W,null,{shouldDirty:!0,shouldValidate:S})),v&&v((F=j.target)!=null&&F.value?j.target.value.toString():null)}}),isInvalid:M,hidden:c,disabled:E,rows:u??2,className:"w-100",minLength:h,maxLength:g,...f}),a&&w(t)&&b.jsx("div",{className:"luminus-input-remove-icon",children:b.jsx(Rs,{color:"secondary",size:"sm",onClick:O,children:b.jsx(ks,{})})}),$&&b.jsx(Jl,{message:$.message})]})},$a=m.forwardRef(({InputContainer:e=As,type:t,formField:n,label:r,placeholder:i,size:a,resetsFields:o,showClearIcon:s,clearValue:c,required:l,hidden:u,disabled:d,withoutLabel:f,list:h,step:g,CustomOnChangeComponent:p,noSelectOnFocus:v,minLength:x,maxLength:_,hint:y,onChange:C,className:w,autoComplete:T},$)=>{const{register:R,formState:S,setValue:k,watch:O}=rn.useFormContext(),D=Xl({falseIfNotInit:!0}),[E,M]=m.useState(void 0),[j,F]=m.useState(!1),W=m.useCallback(()=>{const z=c??null;t==="number"?k(n,z!==null?Number(z):null,{shouldDirty:!0,shouldValidate:j}):k(n,(z==null?void 0:z.toString())??"",{shouldDirty:!0,shouldValidate:j})},[c,t,k,n,j]),B=m.useCallback(()=>{const z=n.split(".");let L=S.errors;z.forEach(H=>{L!==void 0&&(L=L[H])}),M(L)},[S,n]),U=m.useMemo(()=>d||D,[d,D]);m.useEffect(()=>{B()},[B]),m.useEffect(()=>{S.isSubmitted&&F(!0)},[S]);const N=E!==void 0,[V,X]=m.useState(!1),ne=O(n),K=Cp(t,ne??null,V),{ref:J,...q}=R(n,{setValueAs:z=>t==="number"?z==null||z===""?null:Number(z):z==null||z===""?null:z,onChange:z=>{var L;o&&o.forEach(H=>k(H,null,{shouldDirty:!0,shouldValidate:j})),C&&C((L=z.target)!=null&&L.value?t==="number"?Number(z.target.value)??null:z.target.value.toString():null)},onBlur:()=>X(!1)}),G=m.useRef(null);return m.useImperativeHandle($,()=>G.current,[G]),b.jsxs(e,{label:r??"",required:l,disabled:U,hidden:u,withoutLabel:f,isInvalid:N,hint:y,className:w,children:[b.jsxs("div",{className:"luminus-input-container position-relative w-100",children:[b.jsx(sr.Control,{type:K,placeholder:i??r,size:a,onFocus:z=>{X(!0),!v&&z.target.select()},...q,ref:z=>{J(z),G.current=z},isInvalid:N,hidden:u,disabled:U,list:h,className:"w-100",step:g,minLength:x,maxLength:_,autoComplete:T}),p&&b.jsx("div",{className:"custom-picker-button",children:p})]}),s&&O(n)&&b.jsx("div",{className:`luminus-input-remove-icon ${t!=="text"?"inset":""}`,children:b.jsx(Rs,{color:"secondary",size:"sm",onClick:W,children:b.jsx(ks,{})})}),E&&b.jsx(Jl,{message:E.message})]})}),dy=(e,t,n)=>{if(e&&"reportValidity"in e){const r=rn.get(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},RT=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?dy(r.ref,n,e):r.refs&&r.refs.forEach(i=>dy(i,n,e))}},kee=(e,t)=>{t.shouldUseNativeValidation&&RT(e,t);const n={};for(const r in e){const i=rn.get(t.fields,r),a=Object.assign(e[r]||{},{ref:i&&i.ref});if(See(t.names||Object.keys(e),r)){const o=Object.assign({},rn.get(n,r));rn.set(o,"root",a),rn.set(n,r,o)}else rn.set(n,r,a)}return n},See=(e,t)=>e.some(n=>n.startsWith(t+"."));var Oee=function(e,t){for(var n={};e.length;){var r=e[0],i=r.code,a=r.message,o=r.path.join(".");if(!n[o])if("unionErrors"in r){var s=r.unionErrors[0].errors[0];n[o]={message:s.message,type:s.code}}else n[o]={message:a,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(d){return e.push(d)})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=rn.appendErrors(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n},fd=function(e,t,n){return n===void 0&&(n={}),function(r,i,a){try{return Promise.resolve(function(o,s){try{var c=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(l){return a.shouldUseNativeValidation&&RT({},a),{errors:{},values:n.raw?r:l}})}catch(l){return s(l)}return c&&c.then?c.then(void 0,s):c}(0,function(o){if(function(s){return Array.isArray(s==null?void 0:s.errors)}(o))return{values:{},errors:kee(Oee(o.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}}};const Eee="_wrapper_9omw0_1",Mee="_controls_9omw0_16",$ee="_explorerWindow_9omw0_20",Ree="_folderList_9omw0_28",Aee="_fileList_9omw0_35",jee="_dndText_9omw0_61",ai={wrapper:Eee,controls:Mee,explorerWindow:$ee,folderList:Ree,fileList:Aee,dndText:jee},qt=m.createContext({apiActions:{},loadDocuments(){throw new Error("DocumentsContext was not initialized.")},reducer:[{},{}],entityType:"",entityId:-1}),Pee="_folderIcon_vxg2z_1",Iee="_defaultFolder_vxg2z_5",Dee="_names_vxg2z_9",Nee="_folderType_vxg2z_13",pc={folderIcon:Pee,defaultFolder:Iee,names:Dee,folderType:Nee},AT=({isActive:e,isDefault:t,folderName:n,typeName:r})=>{const{ProjectIconComponent:i}=m.useContext(Pt);return b.jsxs("div",{className:"d-flex gap-2 align-items-center",children:[b.jsx(i,{icon:`folder${e?"-filled":""}`,className:Q("d-inline-block",t?pc.defaultFolder:"text-primary"),iconProps:{className:pc.folderIcon}}),b.jsxs("div",{className:Q("d-flex flex-column gap-0 align-items-start",pc.names),children:[b.jsx("span",{className:e?"fw-bold":"",children:n}),r?b.jsxs("span",{className:pc.folderType,children:["(",r,")"]}):null]})]})},Fee=({customText:e})=>{const{reducer:[t,n]}=m.useContext(qt),r=m.useCallback(()=>{n({type:"select-folder",folderId:"root"})},[n]);return b.jsx("li",{children:b.jsx("button",{onClick:r,type:"button",className:Q("border-0 bg-transparent"),children:b.jsx(AT,{folderName:e??"root",isActive:t.activeFolder==="root",typeName:"",isDefault:!0})})})};function Lee(e){if(e.state!=="openned-modal")throw new Error('Not in "openned-modal" state!')}const jT=()=>{const e=Gl(),{startLoading:t,stopLoading:n}=m.useContext(Bl),{reducer:[,r]}=m.useContext(qt),i=m.useCallback(async(o,s)=>{t("documents-renameFolder");try{await e.put("/documents/folder/rename",{folderId:o,name:s}),r({type:"update-folders",folderIds:[o],newProperties:{name:s}})}finally{n("documents-renameFolder")}},[e,r,t,n]),a=m.useCallback(async o=>{t("documentsFolderCreate");try{const s=await e.post("/documents/folder",o);r({type:"create-folder",folderData:o,folderId:s.data.id,isOnlyRead:s.data.onlyRead})}finally{n("documentsFolderCreate")}},[e,r,t,n]);return{renameFolder:i,createFolder:a}},Bee=()=>{const{reducer:[e],entityId:t,entityType:n}=m.useContext(qt),{zNumberRequired:r,zStringRequired:i}=Kl(),{createFolder:a}=jT(),o=Zt.object({name:i(),documentTypeId:r()}),s=rn.useForm({resolver:fd(o)}),c=m.useCallback(async l=>{const u={...l,dbObjectId:t.toString(),entity:n,parentFolderId:e.activeFolder==="root"?null:e.activeFolder};await a(u)},[a,t,n,e.activeFolder]);return{formMethods:s,onSubmit:c}},Wee=({handleClose:e})=>{var o;const{texts:{documents:t}}=m.useContext(Pt),{reducer:[n],entityType:r}=m.useContext(qt);if(Lee(n),n.modalType!=="create-folder")throw new Error("Tried to render CreateFolderModal without create-folder modal type reducer state.");const{onSubmit:i,formMethods:a}=Bee();return b.jsx(b.Fragment,{children:b.jsx(rn.FormProvider,{...a,children:b.jsxs(sr,{onSubmit:a.handleSubmit(i),children:[b.jsx(bn.Header,{closeButton:!0,children:b.jsx(bn.Title,{children:t.createFolderInFolder(((o=n.foldersMap.get(n.chosenFolderId))==null?void 0:o.name)??r)})}),b.jsxs(bn.Body,{children:[b.jsx($a,{formField:"name",type:"text",label:t.name,required:!0}),b.jsx(ag,{options:n.documentTypes,formField:"documentTypeId",label:t.folderType,isNumber:!0,required:!0})]}),b.jsxs(bn.Footer,{children:[b.jsx(Mi,{onClick:e,variant:"outlined",color:"secondary",children:t.cancel}),b.jsx(Mi,{type:"submit",children:t.createFolder})]})]})})})},PT=100,Uee=(e,t)=>{const n=Gl(),{startLoading:r,stopLoading:i}=m.useContext(Bl),{loadDocuments:a}=m.useContext(qt),{zStringRequired:o,zString:s,zNumberRequired:c,zDateRequired:l}=Kl(),u=Zt.object({name:o(),description:s(),validToDate:l(),documentTypeId:c()}),d=rn.useForm({resolver:fd(u),defaultValues:{...e,validToDate:Wl(e.validToDate)}}),f=m.useCallback(async h=>{r("documents-updateProperties");try{await n.put(`/documents/${e.id}/update-info`,h),await a(),t()}finally{i("documents-updateProperties")}},[n,e.id,t,a,r,i]);return{formMethods:d,onSubmit:f}},zee=({handleClose:e,file:t})=>{const{texts:{documents:n}}=m.useContext(Pt),{reducer:[r]}=m.useContext(qt),{formMethods:i,onSubmit:a}=Uee(t,e);return b.jsxs(b.Fragment,{children:[b.jsx(bn.Header,{closeButton:!0,children:b.jsx(bn.Title,{children:n.editFileProperties})}),b.jsx(rn.FormProvider,{...i,children:b.jsxs(sr,{onSubmit:i.handleSubmit(a),children:[b.jsxs(bn.Body,{children:[b.jsx($a,{formField:"name",type:"text",label:n.name,required:!0}),b.jsx($a,{formField:"validToDate",type:"date",label:n.validSince,required:!0}),b.jsx(ag,{formField:"documentTypeId",label:n.category,options:r.documentTypes,isNumber:!0,required:!0}),b.jsx(og,{formField:"description",label:n.description,customFormControlProps:{maxLength:PT}})]}),b.jsxs(bn.Footer,{children:[b.jsx(Mi,{onClick:e,color:"secondary",variant:"outlined",children:n.cancel}),b.jsx(Mi,{type:"submit",children:n.save})]})]})})]})},Hee=({handleClose:e})=>{const{reducer:[t]}=m.useContext(qt),n=m.useMemo(()=>{if(t.markedFiles.length===1)return t.constantFiles.find(r=>r.id===t.markedFiles[0])},[t.constantFiles,t.markedFiles]);return n===void 0?(e(),b.jsx(b.Fragment,{})):b.jsx(zee,{file:n,handleClose:e})},Vee=()=>{const{reducer:[e,t]}=m.useContext(qt),n=m.useCallback(()=>{t({type:"close-modal"})},[t]),r=m.useMemo(()=>{if(e.state!=="openned-modal")return null;switch(e.modalType){case"create-folder":return b.jsx(Wee,{handleClose:n});case"edit-file-properties":return b.jsx(Hee,{handleClose:n});default:return null}},[e.state,e.modalType]);return b.jsx(bn,{show:e.state==="openned-modal",onHide:n,children:r})},fy="documents_drag_image_element",mc="drop-container-highlight-class",hy="data-drop-container-id",py="data-draggable-id",qee=()=>{const e=document.getElementById(fy);if(e!==null)return e;const t=document.createElement("div");return t.id=fy,t.style.position="absolute",t.style.top=`${-window.outerHeight}px`,t.style.left=`${-window.outerWidth}px`,t.style.width="50px",t.style.height="50px",t.style.backgroundColor="rgba(0, 0, 0, 0.5)",t.style.color="white",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.fontSize="16px",t.style.borderRadius="5px",document.body.appendChild(t),t},sg=()=>{const{apiActions:{moveDocuments:e},reducer:[t]}=m.useContext(qt),n=m.useCallback(l=>{var u;if(t.markedFiles.length>0){const d=qee();d.innerHTML=t.markedFiles.length.toString(),l.dataTransfer.setDragImage(d,0,0),l.dataTransfer.clearData(),l.dataTransfer.setData("application/json",JSON.stringify(t.markedFiles)),l.dataTransfer.dropEffect="none",l.dataTransfer.effectAllowed="move"}else l.dataTransfer.setData("application/json",JSON.stringify([parseInt(((u=l.currentTarget.attributes.getNamedItem(py))==null?void 0:u.nodeValue)??"",10)])),l.dataTransfer.dropEffect="none",l.dataTransfer.effectAllowed="move"},[t.markedFiles]),r=m.useCallback(l=>({[py]:l,draggable:t.markedFiles.length===0||t.markedFiles.includes(l),onDragStart:n}),[n,t.markedFiles]),i=m.useCallback(l=>u=>{var h;u.preventDefault(),u.stopPropagation(),u.currentTarget.classList.remove(mc);const d=u.dataTransfer.files;if(l&&d&&d.length>0){l(d);return}const f=u.dataTransfer.getData("application/json");if(f){const g=JSON.parse(f),p=parseInt(((h=u.currentTarget.attributes.getNamedItem(hy))==null?void 0:h.value)??"",10);e(p,g)}},[e]),a=m.useCallback(()=>l=>{l.preventDefault(),l.stopPropagation()},[]),o=m.useCallback(l=>u=>{u.preventDefault(),u.stopPropagation(),u.dataTransfer.types.includes("Files")?(u.dataTransfer.dropEffect="copy",u.currentTarget.classList.add(mc)):!l&&u.dataTransfer.types.includes("application/json")?(u.dataTransfer.dropEffect="move",u.currentTarget.classList.add(mc)):u.dataTransfer.dropEffect="none"},[]),s=m.useCallback(l=>{l.preventDefault(),l.stopPropagation(),l.target===l.currentTarget&&(l.dataTransfer.dropEffect="none",l.currentTarget.classList.remove(mc))},[]),c=m.useCallback((l,u)=>({onDrop:i(u==null?void 0:u.onFilesDrop),onDragOver:a(),onDragEnter:o(u==null?void 0:u.ignoreInner),onDragLeave:s,[hy]:l}),[i,a,o,s]);return{getDraggableProps:r,getDropProps:c}};function IT(e,t,n){for(let r=0;r<e.childrenIds.length;r++){const i=e.childrenIds[r];if(i===t)return!0;const a=n.get(i);if(a&&IT(a,t,n))return!0}return!1}function Yee(e){if(e.activeFolder==="root")return!1;const t=e.foldersMap.get(e.activeFolder);return!(t!=null&&t.onlyRead)}function DT(e,t){const n=t.get(e);return n===void 0?"":n.parentId===null?n.name:`${DT(n.parentId,t)}/${n.name}`}const Gee=()=>{const{zString:e,zStringRequired:t,zNumberRequired:n}=Kl();return{formSchema:m.useMemo(()=>Zt.object({validTo:t(),description:e(),name:e(),documentTypeId:n()}),[n,e,t])}},cg=({handleClose:e,files:t,targetFolderId:n})=>{var f;const{texts:{documents:r}}=m.useContext(Pt),{reducer:[i],apiActions:{uploadFiles:a}}=m.useContext(qt),o=m.useMemo(()=>[...t],[t]),s=m.useMemo(()=>n??i.activeFolder,[i.activeFolder,n]),c=m.useMemo(()=>s==="root"?void 0:i.foldersMap.get(s),[s,i.foldersMap]),{formSchema:l}=Gee(),u=rn.useForm({resolver:fd(l),defaultValues:{validTo:Wl(new Date().toISOString()),documentTypeId:(f=i.documentTypes.find(h=>{var g;return h.name===((g=i.foldersMap.get(s))==null?void 0:g.defaultDocType)}))==null?void 0:f.id}}),d=m.useCallback(async h=>{s!=="root"&&(await a(t,{folderId:s,...h}),e())},[t,e,s,a]);return b.jsxs(bn,{show:!0,onHide:e,children:[b.jsx(bn.Header,{closeButton:!0,children:b.jsxs("div",{children:[r.uploadFilesPrompt(t.length,c.name),b.jsx("ul",{children:o.map((h,g)=>b.jsxs("li",{children:[h.name," - ",xa(h.size)]},`${h.name}-${g}`))})]})}),b.jsx(rn.FormProvider,{...u,children:b.jsxs(sr,{onSubmit:u.handleSubmit(d),children:[b.jsxs(bn.Body,{children:[b.jsx(ag,{formField:"documentTypeId",label:r.documentType,options:i.documentTypes,isNumber:!0,required:!0}),b.jsx($a,{formField:"validTo",label:r.validSince,type:"date",required:!0}),o.length===1?b.jsx($a,{formField:"name",label:r.name,type:"text"}):null,b.jsx(og,{formField:"description",label:r.description,customFormControlProps:{maxLength:PT}})]}),b.jsxs(bn.Footer,{children:[b.jsx(Mi,{variant:"outlined",color:"secondary",onClick:e,children:r.cancel}),b.jsx(Mi,{type:"submit",children:r.upload})]})]})})]})},Zee="_folder_1cktt_1",Kee="_collapseArrowDiv_1cktt_8",Xee="_button_1cktt_20",Qee="_nestedList_1cktt_24",Jee="_numberOfFiles_1cktt_31",ete="_collapseArrow_1cktt_8",oi={folder:Zee,collapseArrowDiv:Kee,button:Xee,nestedList:Qee,numberOfFiles:Jee,collapseArrow:ete},NT=({dirId:e,writePermissions:t})=>{const{ProjectIconComponent:n}=m.useContext(Pt),{reducer:[r,i]}=m.useContext(qt),{getDropProps:a}=sg(),[o,s]=m.useState(null),[c,l]=m.useState(!0),u=m.useMemo(()=>{const p=r.foldersMap.get(e);if(p===void 0)throw new Error(`tried to get dir with id ${e}`);return p},[e,r.foldersMap]),d=m.useCallback(()=>{r.activeFolder!=="root"&&IT(u,r.activeFolder,r.foldersMap)&&i({type:"select-folder",folderId:e}),l(!0)},[e,u,i,r.activeFolder,r.foldersMap]),f=m.useMemo(()=>u.childrenIds.length>0,[u.childrenIds.length]),h=m.useCallback(()=>{i({type:"select-folder",folderId:e})},[e,i]),g=m.useMemo(()=>r.filteredFiles.filter(p=>p.folderId===e&&p.archive===!1).length,[e,r.filteredFiles]);return b.jsxs(b.Fragment,{children:[b.jsxs("li",{className:oi.folder,children:[b.jsx("div",{className:oi.collapseArrowDiv,children:f?c?b.jsx("button",{onClick:()=>l(!1),type:"button",children:b.jsx(n,{icon:"chevron-right",iconProps:{className:oi.collapseArrow}})}):b.jsx("button",{onClick:d,type:"button",children:b.jsx(n,{icon:"chevron-down",iconProps:{className:oi.collapseArrow}})}):null}),b.jsx("button",{className:Q(oi.button),onClick:h,type:"button",...t&&!u.onlyRead?a(e,{onFilesDrop:p=>s(p)}):{},children:b.jsxs("div",{className:"d-flex align-items-center gap-2",children:[b.jsx(AT,{isDefault:u.isDefault,folderName:u.name,typeName:u.defaultDocType??"",isActive:e===r.activeFolder}),g>0?b.jsxs("span",{className:oi.numberOfFiles,children:["[",g,"]"]}):void 0]})}),f?c?null:b.jsx("ul",{className:oi.nestedList,children:u==null?void 0:u.childrenIds.map(p=>b.jsx(NT,{dirId:p,writePermissions:t},p))}):void 0]}),o!==null?b.jsx(cg,{files:o,handleClose:()=>s(null),targetFolderId:e}):null]})},tte="_wrapper_1th2u_1",nte="_downloadButton_1th2u_9",FT={wrapper:tte,downloadButton:nte};function rte(e){return Ve({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M320 464c8.8 0 16-7.2 16-16V160H256c-17.7 0-32-14.3-32-32V48H64c-8.8 0-16 7.2-16 16V448c0 8.8 7.2 16 16 16H320zM0 64C0 28.7 28.7 0 64 0H229.5c17 0 33.3 6.7 45.3 18.7l90.5 90.5c12 12 18.7 28.3 18.7 45.3V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64z"},child:[]}]})(e)}function ite(e){return Ve({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M448 80c8.8 0 16 7.2 16 16V415.8l-5-6.5-136-176c-4.5-5.9-11.6-9.3-19-9.3s-14.4 3.4-19 9.3L202 340.7l-30.5-42.7C167 291.7 159.8 288 152 288s-15 3.7-19.5 10.1l-80 112L48 416.3l0-.3V96c0-8.8 7.2-16 16-16H448zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm80 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"},child:[]}]})(e)}function ate(e){return Ve({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M23 1.5q.41 0 .7.3.3.29.3.7v19q0 .41-.3.7-.29.3-.7.3H7q-.41 0-.7-.3-.3-.29-.3-.7V18H1q-.41 0-.7-.3-.3-.29-.3-.7V7q0-.41.3-.7Q.58 6 1 6h5V2.5q0-.41.3-.7.29-.3.7-.3zM6 13.28l1.42 2.66h2.14l-2.38-3.87 2.34-3.8H7.46l-1.3 2.4-.05.08-.04.09-.64-1.28-.66-1.29H2.59l2.27 3.82-2.48 3.85h2.16zM14.25 21v-3H7.5v3zm0-4.5v-3.75H12v3.75zm0-5.25V7.5H12v3.75zm0-5.25V3H7.5v3zm8.25 15v-3h-6.75v3zm0-4.5v-3.75h-6.75v3.75zm0-5.25V7.5h-6.75v3.75zm0-5.25V3h-6.75v3Z"},child:[]}]})(e)}function ote(e){return Ve({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M23.004 1.5q.41 0 .703.293t.293.703v19.008q0 .41-.293.703t-.703.293H6.996q-.41 0-.703-.293T6 21.504V18H.996q-.41 0-.703-.293T0 17.004V6.996q0-.41.293-.703T.996 6H6V2.496q0-.41.293-.703t.703-.293zM6.035 11.203l1.442 4.735h1.64l1.57-7.876H9.036l-.937 4.653-1.325-4.5H5.38l-1.406 4.523-.938-4.675H1.312l1.57 7.874h1.641zM22.5 21v-3h-15v3zm0-4.5v-3.75H12v3.75zm0-5.25V7.5H12v3.75zm0-5.25V3h-15v3Z"},child:[]}]})(e)}const ste="_excel_18ggp_1",cte="_word_18ggp_5",lte="_pdf_18ggp_9",ute="_image_18ggp_13",gc={excel:ste,word:cte,pdf:lte,image:ute},LT=({fileExtension:e,className:t,...n})=>{switch(e==null?void 0:e.toUpperCase()){case"JPG":case"JPEG":case"BMP":case"PNG":return b.jsx("span",{className:Q(t,gc.image),children:b.jsx(ite,{...n})});case"XLS":case"XLSX":case"CSV":return b.jsx(ate,{className:Q(t,gc.excel),...n});case"DOC":case"DOCM":case"DOCX":return b.jsx(ote,{className:Q(t,gc.word),...n});case"PDF":return b.jsx(a8,{className:Q(t,gc.pdf),...n});default:return b.jsx(rte,{})}},dte=()=>{const{ProjectIconComponent:e,texts:{documents:t}}=m.useContext(Pt),{apiActions:{downloadFile:n},reducer:[r]}=m.useContext(qt),i=m.useMemo(()=>r.activeFolder==="root",[r.activeFolder]);return{columns:m.useMemo(()=>[{fieldName:"id",caption:"id",type:"number",isVisible:!1},...i?[{fieldName:"folderName",caption:t.folder,type:"string"}]:[],{fieldName:"--icon",caption:"",type:"string",valueFormat:o=>b.jsx(LT,{fileExtension:o.row.original.fileExtension}),width:36,align:"center",filterType:"none",noSort:!0},{fieldName:"name",caption:t.name,type:"string"},{fieldName:"description",caption:t.description,type:"string"},{fieldName:"fileExtension",caption:t.fileExtension,type:"string",filterType:"select",width:50},{fieldName:"--downloadButton",caption:"",type:"number",filterType:"none",width:38,align:"center",noSort:!0,valueFormat:o=>b.jsx(Ql,{className:FT.downloadButton,onClick:()=>n(o.row.original.id,!0),children:b.jsx(e,{icon:"file-download"})})},{fieldName:"documentTypeName",caption:t.documentType,type:"string",filterType:"select"},{fieldName:"validToDate",caption:t.validSince,type:"date"},{fieldName:"size",caption:t.size,type:"number",valueFormat:({cell:{value:o}})=>o!==void 0?xa(o*1024*1024):"",filterType:"none"},{fieldName:"archive",caption:t.archived,type:"boolean",filterType:"select",valueFormat:({cell:{value:o}})=>o?t.yes[0]:t.no[0]}],[e,t.archived,t.description,t.documentType,t.fileExtension,t.folder,t.name,t.no,t.size,t.validSince,t.yes,n,i])}},fte=({BnfTableComponent:e,tableIdentifier:t,writePermissions:n})=>{const{reducer:[r,i]}=m.useContext(qt),{columns:a}=dte(),o=m.useCallback(h=>{i({type:"mark-files-by-action",setStateAction:h})},[i]),s=m.useMemo(()=>r.activeFolder==="root",[r.activeFolder]),c=m.useMemo(()=>{var h;return r.activeFolder==="root"?!1:((h=r.foldersMap.get(r.activeFolder))==null?void 0:h.onlyRead)??!1},[r.activeFolder,r.foldersMap]),l=m.useMemo(()=>({enabled:n&&!s,idField:"id",selectedRows:r.markedFiles,setSelectedRows:o}),[s,o,r.markedFiles,n]),u=m.useMemo(()=>r.activeFolder==="root"?r.filteredFiles:r.filteredFiles.filter(h=>h.folderId===r.activeFolder),[r.activeFolder,r.filteredFiles]),{getDraggableProps:d}=sg(),f=m.useCallback(h=>n===!1||c?{}:d(h.id),[d,c,n]);return b.jsx("div",{className:Q(FT.wrapper),children:b.jsx(e,{data:u,columnsDef:a,rowSelection:l,useScrollableContainer:!0,getRowProps:f,defaultConfig:{defaultFilters:[{id:"archive",value:"false"}]},tableId:t,searchStatePrefix:"docs",useSearchState:!0,hideBottomBar:!0},r.activeFolder)})},hte="_wrapper_1q562_1",pte="_divButtons_1q562_10",df={wrapper:hte,divButtons:pte},mte="_wrapper_1bpdd_1",gte="_fileInput_1bpdd_5",my={wrapper:mte,fileInput:gte},vte=({entityId:e,entityType:t,children:n,disabled:r})=>{const i=m.useRef(null),[a,o]=m.useState(null),{reducer:[s]}=m.useContext(qt),c=f=>{var h;(((h=f.target.files)==null?void 0:h.length)??0)>0&&o(f.target.files)},l=m.useCallback(()=>{o(null),i.current&&(i.current.value="")},[]),u=m.useMemo(()=>`documents-upload-${t}-${e}`,[e,t]),d=m.useMemo(()=>r||s.activeFolder==="root",[r,s.activeFolder]);return b.jsxs("div",{className:my.wrapper,children:[b.jsx("label",{htmlFor:u,className:Q("btn btn-context luminus-context-button",d?"disabled":void 0),children:n}),b.jsx("input",{id:u,type:"file",multiple:!0,onChange:c,className:my.fileInput,ref:i,disabled:d}),a!==null?b.jsx(cg,{handleClose:l,files:a}):void 0]})},Gn=({children:e,onClick:t,className:n,disabled:r=!1})=>b.jsx(Ql,{onClick:t,className:n,disabled:r,children:e}),bte=({className:e,entityId:t,entityType:n})=>{var $,R;const{texts:{documents:r}}=m.useContext(Pt),{prompt:i}=fx(),{confirm:a}=_p(),{apiActions:o,reducer:[s,c]}=m.useContext(qt),{deleteFiles:l,renameFiles:u,downloadAsZip:d,archivateFiles:f,deleteDirectory:h}=o,{renameFolder:g}=jT(),p=m.useMemo(()=>s.markedFiles.length===0,[s.markedFiles.length]),v=m.useMemo(()=>s.markedFiles.length===1,[s.markedFiles.length]),x=m.useCallback(async()=>{if(s.activeFolder==="root")return;const S=await i(r.enterNewFolderName,{input:"input"});S!==null&&g(s.activeFolder,S)},[r.enterNewFolderName,i,g,s.activeFolder]),_=m.useCallback(async()=>{if(s.activeFolder==="root")return;const S=await i(r.enterNewFileName,{input:"input"});S!==null&&u(S)},[r.enterNewFileName,i,u,s.activeFolder]),y=m.useMemo(()=>s.activeFolder==="root",[s.activeFolder]),C=m.useMemo(()=>{var S;return s.activeFolder==="root"?!1:((S=s.foldersMap.get(s.activeFolder))==null?void 0:S.onlyRead)??!1},[s.activeFolder,s.foldersMap]),w=m.useMemo(()=>s.markedFiles.every(S=>{var k;return((k=s.constantFiles.find(O=>O.id===S))==null?void 0:k.archive)===!1}),[s.constantFiles,s.markedFiles]),T=m.useMemo(()=>s.markedFiles.every(S=>{var k;return((k=s.constantFiles.find(O=>O.id===S))==null?void 0:k.archive)===!0}),[s.constantFiles,s.markedFiles]);return b.jsx("div",{className:Q(e,df.wrapper,s.state==="folder-choosing"?"ignore-dim":void 0,"d-flex justify-content-between"),children:s.state!=="folder-choosing"?b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:df.divButtons,children:[b.jsx(vte,{entityId:t,entityType:n,disabled:C,children:r.uploadFiles}),b.jsx(Gn,{onClick:()=>{c({type:"open-modal",modalType:"create-folder",chosenFolderId:s.activeFolder??"root"})},disabled:C,children:r.createFolder}),b.jsx(Gn,{disabled:s.activeFolder==="root"||(($=s.foldersMap.get(s.activeFolder))==null?void 0:$.isDefault),onClick:async()=>{var k;await a(`${r.deleteFolder} ${(k=s.foldersMap.get(s.activeFolder))==null?void 0:k.name}?`)&&h(s.activeFolder)},children:r.deleteFolder}),b.jsx(Gn,{disabled:s.activeFolder==="root"||((R=s.foldersMap.get(s.activeFolder))==null?void 0:R.isDefault),onClick:x,children:r.renameFolder})]}),!y&&!C?b.jsxs("div",{className:df.divButtons,children:[b.jsx(Gn,{onClick:()=>{c({type:"open-modal",modalType:"edit-file-properties"})},disabled:!v,children:r.editFileProperties}),b.jsx(Gn,{onClick:async()=>{await a(r.confirmDeleteFile(s.markedFiles.length))&&l(s.markedFiles)},disabled:p,children:r.delete}),T?b.jsx(Gn,{onClick:async()=>{await a(r.confirmDearchiveFile(s.markedFiles.length))&&await f(!0)},disabled:p,children:r.dearchivate}):b.jsx(Gn,{onClick:async()=>{await a(r.confirmArchiveFile(s.markedFiles.length))&&await f()},disabled:p||!w,children:r.archivate}),b.jsx(Gn,{onClick:_,disabled:p,children:r.rename}),b.jsx(Gn,{onClick:d,disabled:p,children:r.downloadZip})]}):null]}):s.state==="folder-choosing"?b.jsx(b.Fragment,{children:b.jsx(Gn,{onClick:()=>c({type:"return-from-folder-choosing"}),className:Q("ignore-dim","body-background-color"),children:r.back})}):void 0})},yte=({file:e})=>{const{confirm:t}=_p(),{reducer:[n],apiActions:{downloadFile:r}}=m.useContext(qt),{texts:{documents:i}}=m.useContext(Pt),a=m.useCallback(async()=>{await t(i.confirmFileDownload(e.name,e.size==null?void 0:xa(e.size*1024*1024)))&&r(e.id)},[t,i,r,e.id,e.name,e.size]);return b.jsxs(Fl,{action:!0,onClick:a,children:[b.jsx(dn,{variant:"body",className:"text-muted",children:DT(e.folderId,n.foldersMap)}),b.jsxs("div",{className:"d-flex justify-content-between gap-2",children:[b.jsx(dn,{variant:"body",children:e.name}),b.jsx(dn,{variant:"body",children:e.size==null?null:xa(e.size*1024*1024)})]})]})},xte="_typeSelect_m3myk_1",_te={typeSelect:xte},wte=()=>{const{reducer:[e]}=m.useContext(qt),{texts:{documents:t}}=m.useContext(Pt),[n,r]=m.useState(""),[i,a]=m.useState(null),o=m.useMemo(()=>{const c=new Map;return e.filteredFiles.forEach(u=>{c.get(u.documentTypeId)===void 0&&c.set(u.documentTypeId,u.documentTypeName)}),[{id:null,name:t.all},...Array.from(c).map(u=>({id:u[0],name:u[1]}))]},[t.all,e.filteredFiles]),s=m.useMemo(()=>e.filteredFiles.filter(c=>pp(c.name,n)&&(i===null||c.documentTypeId===i)),[n,i,e.filteredFiles]);return b.jsxs("div",{className:"d-flex h-100 flex-column",children:[b.jsxs("div",{className:"d-flex gap-1 mb-1",children:[b.jsx(D2,{options:o,label:t.documentType,value:i,onChange:a,isNumber:!0,size:"sm",className:_te.typeSelect}),b.jsx(P2,{label:t.search,type:"text",value:n,onChange:c=>r(c===null?"":c),className:"flex-grow-1",size:"sm"})]}),b.jsx(B1,{className:"overflow-y-auto",children:s.map(c=>b.jsx(yte,{file:c},c.id))})]})};function Cte(e){return{name:e.name,defaultDocType:e.defaultDocType,childrenIds:[],parentId:e.parentId??null,isDefault:e.isDefault,onlyRead:e.onlyRead}}function Tte(e){const t=[],n=new Map,r=new Map;return e.forEach(i=>{n.set(i.id,Cte(i)),i.parentId===null?t.push(i.id):r.set(i.id,i.parentId)}),r.forEach((i,a)=>{const o=n.get(i);if(o===void 0)throw new Error(`Did not get folder with ID ${i}, which is supposed to be parent directory of folder with ID ${a}`);o.childrenIds.push(a)}),{dirsMap:n,rootIds:t}}function gy(e,t){const n=t.toUpperCase();return e.filter(r=>{var a;const i=(a=r.name)==null?void 0:a.toUpperCase();return i==null?void 0:i.includes(n)})}function kte(e,t){return e.map(n=>{var r;return{...n,folderName:((r=t.get(n.folderId))==null?void 0:r.name)??""}})}const Ste=([e,t],n,r)=>{const{texts:{documents:i}}=m.useContext(Pt),{startLoading:a,stopLoading:o}=m.useContext(Bl),{addNotification:s}=Yl(),c=Gl(),l=m.useCallback(async y=>{a("documentList");try{const w=(await c.get(`/documents/${n}/${r}`)).data,{dirsMap:T,rootIds:$}=Tte(w.folders),R=kte(w.documents,T);t({type:"load-data",files:R,foldersMap:T,rootFolderIds:$,setActiveFolder:y})}finally{o("documentList")}},[c,t,r,n,a,o]);m.useEffect(()=>{l(!0)},[l]);const u=m.useCallback(async()=>{a("documents-types");try{const y=await c.get(`/documents/types/${n}`);if(y.status!==200)throw new Error(`Unexpected status code: ${y.status}`);t({type:"load-document-types",documentTypes:y.data})}finally{o("documents-types")}},[c,t,n,a,o]);m.useEffect(()=>{u()},[u]);const d=m.useCallback(async(y,C)=>{const w=C??e.markedFiles;a("documentsMove");try{await c.put(`/documents/move-to-folder?folderId=${y}`,w),t({type:"update-files",fileIds:w,newProperties:{folderId:y}}),s(i.fileMoveSuccessful(w.length,e.foldersMap.get(y).name),"success")}finally{o("documentsMove")}},[e.markedFiles,e.foldersMap,a,c,t,s,i,o]),f=m.useCallback(async y=>{const C=y??e.markedFiles;a("documentsFilesDelete");try{const w=await c.delete(`/documents/delete?${Af(C,"documentIds")}`);if(w.status!==200)throw new Error(`Unexpected status code: ${w.status}`);t({type:"delete-files",fileIds:C}),s(i.fileDeleteSuccessful(C.length),"success")}finally{o("documentsFilesDelete")}},[e.markedFiles,a,c,t,s,i,o]),h=m.useCallback(async y=>{var C;if(!(y==="root"||(C=e.foldersMap.get(y))!=null&&C.isDefault)){a("documentsFolderDelete");try{const w=await c.delete(`/documents/folder/${y}`);if(w.status!==200)throw new Error(`Unexpected status code: ${w.status}`);t({type:"delete-folder",folderId:y}),s(i.folderDeleteSuccessful(e.foldersMap.get(y).name),"success")}finally{o("documentsFolderDelete")}}},[e.foldersMap,a,c,t,s,i,o]),g=m.useCallback(async y=>{a("documentsRename");try{const C=await c.put("/documents/update-name",{documentIds:e.markedFiles,name:y});if(C.status!==200)throw new Error(`Unexpected status code: ${C.status}`);l()}finally{o("documentsRename")}},[a,c,e.markedFiles,l,o]),p=m.useCallback(async y=>{a("documents-archivate");try{const C=await c.put(`/documents/${y?"dearchive":"archive"}`,e.markedFiles);if(C.status!==200)throw new Error(`Unexpected status code: ${C.status}`);t({type:"update-files",fileIds:e.markedFiles,newProperties:{archive:!y}}),s((y?i.dearchivateSuccessful:i.archivateSuccessful)(e.markedFiles.length),"success")}finally{o("documents-archivate")}},[a,c,e.markedFiles,t,s,i.archivateSuccessful,i.dearchivateSuccessful,o]),v=m.useCallback(async()=>{var C;if(e.activeFolder==="root")return;const y=e.markedFiles.length;s(i.downloadAsZip(y),"info"),a("documents-ZIP_download");try{const w=await c.get(`/documents/download-zip?${Af(e.markedFiles,"documentIds")}`,{responseType:"blob"});Hc(w.data,(((C=e.foldersMap.get(e.activeFolder))==null?void 0:C.name)??"")+"_files")}finally{o("documents-ZIP_download")}},[e.activeFolder,e.markedFiles,e.foldersMap,s,i,a,c,o]),x=m.useCallback(async(y,C)=>{s(i.downloadingFile,"info"),a("documents-downloading_file");try{const w=await c.get(`/documents/${y}?isSmall=true`,{responseType:"blob"}),T=e.constantFiles.find(R=>R.id===y),$=`${(T==null?void 0:T.name)??y.toString()}.${T!=null&&T.fileExtension?T==null?void 0:T.fileExtension.toLowerCase():"unknown"}`;Hc(w.data,$,C)}finally{o("documents-downloading_file")}},[s,i.downloadingFile,a,c,e.constantFiles,o]),_=m.useCallback(async(y,C)=>{a("documents-upload"),s(i.uploadingDocuments,"info");try{await c.postForm("/documents/upload",{files:y,...C}),await l()}finally{o("documents-upload")}},[a,s,i.uploadingDocuments,c,l,o]);return{loadDocuments:l,moveDocuments:d,deleteFiles:f,deleteDirectory:h,renameFiles:g,archivateFiles:p,downloadAsZip:v,downloadFile:x,uploadFiles:_}},Ote=(e,t)=>{var n,r;switch(t.type){case"load-data":{const i={...e,constantFiles:t.files,filteredFiles:gy(t.files,e.searchString),foldersMap:t.foldersMap,rootFolderIds:t.rootFolderIds};if(t.setActiveFolder){const a=t.rootFolderIds.find(o=>t.files.some(s=>s.archive===!1&&s.folderId===o))??"root";i.activeFolder=a}return i}case"load-document-types":return{...e,documentTypes:t.documentTypes};case"select-folder":return{...e,activeFolder:t.folderId,markedFiles:[]};case"mark-file":{const i=e.markedFiles.includes(t.fileId)?[...e.markedFiles.filter(a=>a!==t.fileId)]:[...e.markedFiles,t.fileId];return{...e,state:i.length>0?"selection-file":"explorer",markedFiles:i}}case"mark-files-by-action":{const i=typeof t.setStateAction=="function"?t.setStateAction(e.markedFiles):t.setStateAction;return{...e,state:i.length>0?"selection-file":"explorer",markedFiles:i}}case"mark-all-files":return e.markedFiles.length<e.filteredFiles.filter(i=>i.folderId===e.activeFolder).length?{...e,markedFiles:e.filteredFiles.filter(i=>i.folderId===e.activeFolder).map(i=>i.id),state:"explorer"}:{...e,markedFiles:[],state:"explorer"};case"enter-folder-choosing":return e.state==="folder-choosing"||e.state==="openned-modal"?e:{...e,state:"folder-choosing",canTargetRoot:t.canTargetRoot??!1,previousState:e.state,choosingType:t.choosingType};case"return-from-folder-choosing":return e.state!=="folder-choosing"?e:{...e,state:e.previousState};case"update-files":return{...e,filteredFiles:[...e.filteredFiles.map(i=>t.fileIds.includes(i.id)?{...i,...t.newProperties}:i)],constantFiles:[...e.constantFiles.map(i=>t.fileIds.includes(i.id)?{...i,...t.newProperties}:i)],markedFiles:[],state:"explorer"};case"update-folders":{const i=new Map(e.foldersMap);return t.folderIds.forEach(a=>{i.set(a,{...e.foldersMap.get(a),...t.newProperties})}),{...e,foldersMap:i}}case"delete-files":return{...e,filteredFiles:[...e.filteredFiles.filter(i=>!t.fileIds.includes(i.id))],constantFiles:[...e.constantFiles.filter(i=>!t.fileIds.includes(i.id))],markedFiles:e.markedFiles.filter(i=>!t.fileIds.includes(i)),state:"explorer"};case"open-modal":switch(t.modalType){case"create-folder":return{...e,state:"openned-modal",modalType:t.modalType,chosenFolderId:t.chosenFolderId};default:return{...e,state:"openned-modal",modalType:t.modalType}}case"close-modal":return{...e,state:"explorer"};case"delete-folder":{const i=new Map(e.foldersMap),a=(n=i.get(t.folderId))==null?void 0:n.parentId;let o=[...e.rootFolderIds];if(a){const s=JSON.parse(JSON.stringify(i.get(a)));s.childrenIds=s.childrenIds.filter(c=>c!==t.folderId),i.set(a,s)}else o=o.filter(s=>s!==t.folderId);return i.delete(t.folderId),{...e,rootFolderIds:o,foldersMap:i,activeFolder:"root"}}case"create-folder":{const i=new Map(e.foldersMap);i.set(t.folderId,{name:t.folderData.name,defaultDocType:(r=e.documentTypes.find(o=>o.id===t.folderData.documentTypeId))==null?void 0:r.name,childrenIds:[],parentId:t.folderData.parentFolderId,isDefault:!1,onlyRead:t.isOnlyRead});const a=[...e.rootFolderIds];if(t.folderData.parentFolderId===null)a.push(t.folderId);else{const o=i.get(t.folderData.parentFolderId),s=JSON.parse(JSON.stringify(o));s.childrenIds.push(t.folderId),i.set(t.folderData.parentFolderId,s)}return{...e,state:"explorer",rootFolderIds:a,foldersMap:i}}case"search-files":{const i=gy(e.constantFiles,t.searchString);return{...e,searchString:t.searchString,filteredFiles:i,markedFiles:e.markedFiles.filter(a=>i.map(o=>o.id).includes(a))}}default:throw new Error("Wrong action.type specified.")}},Ete=()=>{const e={state:"explorer",activeFolder:"root",searchString:"",filteredFiles:[],constantFiles:[],foldersMap:new Map,rootFolderIds:[],markedFiles:[],documentTypes:[]},[t,n]=m.useReducer(Ote,e);return[t,n]},Mte=m.memo(({entityType:e,entityId:t,className:n,BnfTableComponent:r,tableIdentifier:i,customRootFolderName:a,writePermissions:o=!0,...s})=>{const{isMobile:c}=$s(),{ProjectIconComponent:l,texts:{documents:u}}=m.useContext(Pt),[d,f]=Ete(),[h,g]=m.useState(null),{loadDocuments:p,...v}=Ste([d,f],e,t),x=m.useMemo(()=>({entityId:t,entityType:e,apiActions:v,loadDocuments:p,reducer:[d,f]}),[t,e,v,p,d,f]),{getDropProps:_}=sg();return c?b.jsx(qt.Provider,{value:x,children:b.jsx(wte,{})}):b.jsx("div",{...s,className:Q(ai.wrapper,n),onDragOver:y=>{y.dataTransfer.dropEffect="none",y.stopPropagation(),y.preventDefault()},onDragEnter:y=>{y.dataTransfer.dropEffect="none",y.stopPropagation(),y.preventDefault()},children:b.jsxs(qt.Provider,{value:x,children:[b.jsx("div",{className:Q(d.state==="folder-choosing"?"dim-others":void 0,ai.explorerWindow),children:b.jsxs("ul",{className:ai.folderList,children:[b.jsx(Fee,{customText:a??e}),d.rootFolderIds.map(y=>b.jsx(NT,{dirId:y,writePermissions:o},y))]})}),b.jsxs("div",{className:Q(ai.explorerWindow,ai.fileList),...o&&Yee(d)?_(d.activeFolder,{onFilesDrop:y=>g(y),ignoreInner:!0}):{},children:[b.jsxs("div",{className:ai.dndText,children:[b.jsx(l,{icon:"file-upload",iconProps:{style:{marginRight:0}}}),b.jsx("span",{children:u.dropToUpload})]}),b.jsx(fte,{tableIdentifier:i,BnfTableComponent:r,writePermissions:o},(d.activeFolder==="root").toString())]}),o?b.jsx(bte,{className:ai.controls,entityType:e,entityId:t}):null,b.jsx(Vee,{}),h!==null?b.jsx(cg,{files:h,handleClose:()=>g(null),targetFolderId:d.activeFolder==="root"?void 0:d.activeFolder}):null]})})}),$te=m.createContext(void 0);exports.AbstractModalHeader=Y1;exports.Alert=Ap;exports.ApprovalState=VE;exports.AuthContext=Tp;exports.AvatarIcon=y2;exports.Backdrop=R2;exports.BaseModal=U1;exports.BootstrapModalManager=z1;exports.Button=qh;exports.Col=Gh;exports.ConfirmContext=ux;exports.ContextButton=Ql;exports.CustomSelectInput=D2;exports.DelegationContext=m2;exports.Documents=Mte;exports.Dropdown=Op;exports.DropdownDivider=x2;exports.DropdownItem=la;exports.DropdownToggle=Sp;exports.ENTERED=Ir;exports.ENTERING=mr;exports.EXITED=Pr;exports.EXITING=jc;exports.FaMinus=n8;exports.FaPlus=r8;exports.FaSearch=i8;exports.Fade=zr;exports.FileExtensionIcon=LT;exports.FloatingLabelInput=eu;exports.Form=sr;exports.FormCheckInput=Nl;exports.FormControl=M1;exports.FormDisabledContext=v2;exports.FormSelect=ip;exports.FromToDatePickerDropdownToggle=l7;exports.HelmetContext=g2;exports.HookFormTextAreaInput=og;exports.HookFormTextInput=$a;exports.HtmlTooltip=_x;exports.IconButton=Rs;exports.Ie=HE;exports.InputAnchorContainer=j2;exports.InvalidFeedback=Jl;exports.ListGroup=B1;exports.ListGroupItem=Fl;exports.LoadingContext=Bl;exports.LoginState=gx;exports.LuminusComponentsContext=Pt;exports.MdArrowRight=AO;exports.MdCheck=jO;exports.MdCircle=RO;exports.MdClear=ks;exports.MdOutlineAddCircleOutline=BO;exports.MdOutlineArrowOutward=PO;exports.MdOutlineCameraAlt=YO;exports.MdOutlineChevronRight=XO;exports.MdOutlineClose=cx;exports.MdOutlineDelete=sx;exports.MdOutlineEdit=GO;exports.MdOutlineExpand=DO;exports.MdOutlineFileUpload=zO;exports.MdOutlineKeyboardArrowLeft=HO;exports.MdOutlineKeyboardArrowRight=VO;exports.MdOutlineKeyboardDoubleArrowLeft=qO;exports.MdOutlineMenu=QO;exports.MdOutlinePhotoLibrary=ZO;exports.MdOutlineStar=eE;exports.MdSave=$O;exports.MdSaveAs=MO;exports.MdSearch=EO;exports.MiniDetailWrapper=I2;exports.Modal=bn;exports.ModalContext=cp;exports.NoInputContainer=A2;exports.Oe=I;exports.PageContainer=Tee;exports.PrimaryButton=Mi;exports.PromptContext=dx;exports.Re=hee;exports.ResponsiveContextDropdown=$2;exports.ResponsiveContextDropdownItem=$p;exports.RowLabelInput=As;exports.ShortcutLinksContext=$te;exports.SideContentBar=MT;exports.SimpleDropdownToggle=kp;exports.SimplePicker=w2;exports.SimpleTooltip=hp;exports.Spinner=dp;exports.TextInput=P2;exports.TransitionWrapper=Fy;exports.Typography=dn;exports.UserAvatarToggle=j5;exports.UserContext=vx;exports._=zq;exports._extends=Ac;exports._inheritsLoose=$y;exports._objectWithoutPropertiesLoose=Dh;exports.a=_2;exports.addLeadingZeros=dt;exports.addMonths=by;exports.addYears=ky;exports.atobUtf8=Cx;exports.buildEmployeeNameString=cM;exports.buildOrgUnitString=lM;exports.buildVehicleNameString=sM;exports.cancelToken=h$;exports.capitalizeFirstLetter=oM;exports.classNames=Q;exports.classes=Hf;exports.classes$1=b2;exports.compareDate=fM;exports.compareDateTime=hM;exports.constructFrom=zn;exports.context=Il;exports.differenceInCalendarDays=Ty;exports.divWithClassName=Wh;exports.extractErrorsFromResponse=fp;exports.extractFilename=Ox;exports.extractPermissionsFromResponse=xx;exports.fixNameIdNulls=bx;exports.format=Ih;exports.formatDate=iM;exports.formatDateTime=aM;exports.formatFileSize=xa;exports.getDateString=yM;exports.getDaysDifference=pM;exports.getDefaultExportFromCjs=Rt;exports.getFirstDayOfMonth=kx;exports.getFirstDayOfOffsetMonth=mM;exports.getFirstDayOfYear=vM;exports.getLastDayOfMonth=Sx;exports.getLastDayOfOffsetMonth=gM;exports.getLastDayOfYear=bM;exports.getSharedManager=H1;exports.getTimezoneOffsetInMilliseconds=pf;exports.hasOnlyNullValues=yx;exports.hookFormSetServerErrors=YE;exports.invariant=mf;exports.isISODate=Tx;exports.isPrimitive=zc;exports.isValidDate=dM;exports.joinStrings=Bo;exports.jsxRuntimeExports=b;exports.millisecondsInHour=kl;exports.millisecondsInMinute=jh;exports.millisecondsInWeek=Ah;exports.msToStartOfNextDay=uM;exports.openFileFromResponse=_M;exports.parseISO=Ol;exports.pe=dK;exports.replaceNullValuesOnlyObjectsWithNulls=qE;exports.requireReactIs=Fh;exports.saveFile=Hc;exports.saveFileFromResponse=xM;exports.secondsInDay=Ph;exports.secondsInHour=yy;exports.secondsInMinute=GT;exports.secondsInMonth=_y;exports.secondsInQuarter=KT;exports.secondsInWeek=ZT;exports.secondsInYear=xy;exports.shortenText=rM;exports.startOfDay=hf;exports.startOfWeek=pa;exports.stringContains=Ex;exports.stringSearchWithin=pp;exports.stringStartsWith=Mx;exports.style=Wr;exports.t=fd;exports.toDate=sn;exports.transitionEndListener=Dy;exports.triggerBrowserReflow=Ny;exports.trimIsoDate=Wl;exports.truncateText=wx;exports.urlfyArray=Af;exports.useAuth=e2;exports.useAxios=Gl;exports.useBootstrapBreakpoints=Ry;exports.useBootstrapMinBreakpoint=Ay;exports.useBootstrapPrefix=He;exports.useClickOutside=d2;exports.useClipboard=p2;exports.useCol=Yy;exports.useConfirm=_p;exports.useCookies=xp;exports.useEventCallback=Et;exports.useFormControlType=Cp;exports.useFormDisabledContext=Xl;exports.useIsomorphicEffect=Po;exports.useKeyPress=h2;exports.useNotifications=Yl;exports.usePermissions=f2;exports.usePrompt=fx;exports.useSwipeable=Rp;exports.useWindowSize=$s;exports.useZodSchemaTypes=Kl;exports.z=Zt;
|