function hO(e,r){for(var t=0;tn[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))n(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(l){if(l.ep)return;l.ep=!0;const i=t(l);fetch(l.href,i)}})();var Jt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ws(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tx={exports:{}},Wu={},rx={exports:{}},Yt={};var e3;function mO(){if(e3)return Yt;e3=1;var e=Symbol.for("react.element"),r=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),s=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.iterator;function h(D){return D===null||typeof D!="object"?null:(D=f&&D[f]||D["@@iterator"],typeof D=="function"?D:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,x={};function g(D,B,Y){this.props=D,this.context=B,this.refs=x,this.updater=Y||m}g.prototype.isReactComponent={},g.prototype.setState=function(D,B){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,B,"setState")},g.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function y(){}y.prototype=g.prototype;function v(D,B,Y){this.props=D,this.context=B,this.refs=x,this.updater=Y||m}var _=v.prototype=new y;_.constructor=v,p(_,g.prototype),_.isPureReactComponent=!0;var C=Array.isArray,M=Object.prototype.hasOwnProperty,T={current:null},U={key:!0,ref:!0,__self:!0,__source:!0};function F(D,B,Y){var Z,ne={},q=null,ee=null;if(B!=null)for(Z in B.ref!==void 0&&(ee=B.ref),B.key!==void 0&&(q=""+B.key),B)M.call(B,Z)&&!U.hasOwnProperty(Z)&&(ne[Z]=B[Z]);var z=arguments.length-2;if(z===1)ne.children=Y;else if(1>>1,B=S[D];if(0>>1;Dl(ne,O))ql(ee,ne)?(S[D]=ee,S[q]=O,D=q):(S[D]=ne,S[Z]=O,D=Z);else if(ql(ee,O))S[D]=ee,S[q]=O,D=q;else break e}}return N}function l(S,N){var O=S.sortIndex-N.sortIndex;return O!==0?O:S.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var c=[],s=[],d=1,f=null,h=3,m=!1,p=!1,x=!1,g=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(S){for(var N=t(s);N!==null;){if(N.callback===null)n(s);else if(N.startTime<=S)n(s),N.sortIndex=N.expirationTime,r(c,N);else break;N=t(s)}}function C(S){if(x=!1,_(S),!p)if(t(c)!==null)p=!0,j(M);else{var N=t(s);N!==null&&k(C,N.startTime-S)}}function M(S,N){p=!1,x&&(x=!1,y(F),F=-1),m=!0;var O=h;try{for(_(N),f=t(c);f!==null&&(!(f.expirationTime>N)||S&&!K());){var D=f.callback;if(typeof D=="function"){f.callback=null,h=f.priorityLevel;var B=D(f.expirationTime<=N);N=e.unstable_now(),typeof B=="function"?f.callback=B:f===t(c)&&n(c),_(N)}else n(c);f=t(c)}if(f!==null)var Y=!0;else{var Z=t(s);Z!==null&&k(C,Z.startTime-N),Y=!1}return Y}finally{f=null,h=O,m=!1}}var T=!1,U=null,F=-1,H=5,W=-1;function K(){return!(e.unstable_now()-WS||125D?(S.sortIndex=O,r(s,S),t(c)===null&&S===t(s)&&(x?(y(F),F=-1):x=!0,k(C,O-D))):(S.sortIndex=B,r(c,S),p||m||(p=!0,j(M))),S},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(S){var N=h;return function(){var O=h;h=N;try{return S.apply(this,arguments)}finally{h=O}}}})(sx)),sx}var s3;function bO(){return s3||(s3=1,ix.exports=xO()),ix.exports}var a3;function yO(){if(a3)return di;a3=1;var e=$c(),r=bO();function t(b){for(var w="https://reactjs.org/docs/error-decoder.html?invariant="+b,A=1;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,s=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},f={};function h(b){return c.call(f,b)?!0:c.call(d,b)?!1:s.test(b)?f[b]=!0:(d[b]=!0,!1)}function m(b,w,A,V){if(A!==null&&A.type===0)return!1;switch(typeof w){case"function":case"symbol":return!0;case"boolean":return V?!1:A!==null?!A.acceptsBooleans:(b=b.toLowerCase().slice(0,5),b!=="data-"&&b!=="aria-");default:return!1}}function p(b,w,A,V){if(w===null||typeof w>"u"||m(b,w,A,V))return!0;if(V)return!1;if(A!==null)switch(A.type){case 3:return!w;case 4:return w===!1;case 5:return isNaN(w);case 6:return isNaN(w)||1>w}return!1}function x(b,w,A,V,G,J,oe){this.acceptsBooleans=w===2||w===3||w===4,this.attributeName=V,this.attributeNamespace=G,this.mustUseProperty=A,this.propertyName=b,this.type=w,this.sanitizeURL=J,this.removeEmptyString=oe}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(b){g[b]=new x(b,0,!1,b,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(b){var w=b[0];g[w]=new x(w,1,!1,b[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(b){g[b]=new x(b,2,!1,b.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(b){g[b]=new x(b,2,!1,b,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(b){g[b]=new x(b,3,!1,b.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(b){g[b]=new x(b,3,!0,b,null,!1,!1)}),["capture","download"].forEach(function(b){g[b]=new x(b,4,!1,b,null,!1,!1)}),["cols","rows","size","span"].forEach(function(b){g[b]=new x(b,6,!1,b,null,!1,!1)}),["rowSpan","start"].forEach(function(b){g[b]=new x(b,5,!1,b.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function v(b){return b[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(b){var w=b.replace(y,v);g[w]=new x(w,1,!1,b,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(b){var w=b.replace(y,v);g[w]=new x(w,1,!1,b,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(b){var w=b.replace(y,v);g[w]=new x(w,1,!1,b,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(b){g[b]=new x(b,1,!1,b.toLowerCase(),null,!1,!1)}),g.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(b){g[b]=new x(b,1,!1,b.toLowerCase(),null,!0,!0)});function _(b,w,A,V){var G=g.hasOwnProperty(w)?g[w]:null;(G!==null?G.type!==0:V||!(2pe||G[oe]!==J[pe]){var ve=` `+G[oe].replace(" at new "," at ");return b.displayName&&ve.includes("")&&(ve=ve.replace("",b.displayName)),ve}while(1<=oe&&0<=pe);break}}}finally{Y=!1,Error.prepareStackTrace=A}return(b=b?b.displayName||b.name:"")?B(b):""}function ne(b){switch(b.tag){case 5:return B(b.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return b=Z(b.type,!1),b;case 11:return b=Z(b.type.render,!1),b;case 1:return b=Z(b.type,!0),b;default:return""}}function q(b){if(b==null)return null;if(typeof b=="function")return b.displayName||b.name||null;if(typeof b=="string")return b;switch(b){case U:return"Fragment";case T:return"Portal";case H:return"Profiler";case F:return"StrictMode";case P:return"Suspense";case L:return"SuspenseList"}if(typeof b=="object")switch(b.$$typeof){case K:return(b.displayName||"Context")+".Consumer";case W:return(b._context.displayName||"Context")+".Provider";case $:var w=b.render;return b=b.displayName,b||(b=w.displayName||w.name||"",b=b!==""?"ForwardRef("+b+")":"ForwardRef"),b;case E:return w=b.displayName||null,w!==null?w:q(b.type)||"Memo";case j:w=b._payload,b=b._init;try{return q(b(w))}catch{}}return null}function ee(b){var w=b.type;switch(b.tag){case 24:return"Cache";case 9:return(w.displayName||"Context")+".Consumer";case 10:return(w._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return b=w.render,b=b.displayName||b.name||"",w.displayName||(b!==""?"ForwardRef("+b+")":"ForwardRef");case 7:return"Fragment";case 5:return w;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return q(w);case 8:return w===F?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof w=="function")return w.displayName||w.name||null;if(typeof w=="string")return w}return null}function z(b){switch(typeof b){case"boolean":case"number":case"string":case"undefined":return b;case"object":return b;default:return""}}function I(b){var w=b.type;return(b=b.nodeName)&&b.toLowerCase()==="input"&&(w==="checkbox"||w==="radio")}function X(b){var w=I(b)?"checked":"value",A=Object.getOwnPropertyDescriptor(b.constructor.prototype,w),V=""+b[w];if(!b.hasOwnProperty(w)&&typeof A<"u"&&typeof A.get=="function"&&typeof A.set=="function"){var G=A.get,J=A.set;return Object.defineProperty(b,w,{configurable:!0,get:function(){return G.call(this)},set:function(oe){V=""+oe,J.call(this,oe)}}),Object.defineProperty(b,w,{enumerable:A.enumerable}),{getValue:function(){return V},setValue:function(oe){V=""+oe},stopTracking:function(){b._valueTracker=null,delete b[w]}}}}function te(b){b._valueTracker||(b._valueTracker=X(b))}function se(b){if(!b)return!1;var w=b._valueTracker;if(!w)return!0;var A=w.getValue(),V="";return b&&(V=I(b)?b.checked?"true":"false":b.value),b=V,b!==A?(w.setValue(b),!0):!1}function Q(b){if(b=b||(typeof document<"u"?document:void 0),typeof b>"u")return null;try{return b.activeElement||b.body}catch{return b.body}}function re(b,w){var A=w.checked;return O({},w,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:A??b._wrapperState.initialChecked})}function ue(b,w){var A=w.defaultValue==null?"":w.defaultValue,V=w.checked!=null?w.checked:w.defaultChecked;A=z(w.value!=null?w.value:A),b._wrapperState={initialChecked:V,initialValue:A,controlled:w.type==="checkbox"||w.type==="radio"?w.checked!=null:w.value!=null}}function ae(b,w){w=w.checked,w!=null&&_(b,"checked",w,!1)}function ie(b,w){ae(b,w);var A=z(w.value),V=w.type;if(A!=null)V==="number"?(A===0&&b.value===""||b.value!=A)&&(b.value=""+A):b.value!==""+A&&(b.value=""+A);else if(V==="submit"||V==="reset"){b.removeAttribute("value");return}w.hasOwnProperty("value")?he(b,w.type,A):w.hasOwnProperty("defaultValue")&&he(b,w.type,z(w.defaultValue)),w.checked==null&&w.defaultChecked!=null&&(b.defaultChecked=!!w.defaultChecked)}function fe(b,w,A){if(w.hasOwnProperty("value")||w.hasOwnProperty("defaultValue")){var V=w.type;if(!(V!=="submit"&&V!=="reset"||w.value!==void 0&&w.value!==null))return;w=""+b._wrapperState.initialValue,A||w===b.value||(b.value=w),b.defaultValue=w}A=b.name,A!==""&&(b.name=""),b.defaultChecked=!!b._wrapperState.initialChecked,A!==""&&(b.name=A)}function he(b,w,A){(w!=="number"||Q(b.ownerDocument)!==b)&&(A==null?b.defaultValue=""+b._wrapperState.initialValue:b.defaultValue!==""+A&&(b.defaultValue=""+A))}var de=Array.isArray;function ge(b,w,A,V){if(b=b.options,w){w={};for(var G=0;G"+w.valueOf().toString()+"",w=Ie.firstChild;b.firstChild;)b.removeChild(b.firstChild);for(;w.firstChild;)b.appendChild(w.firstChild)}});function Ue(b,w){if(w){var A=b.firstChild;if(A&&A===b.lastChild&&A.nodeType===3){A.nodeValue=w;return}}b.textContent=w}var Ze={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tt=["Webkit","ms","Moz","O"];Object.keys(Ze).forEach(function(b){tt.forEach(function(w){w=w+b.charAt(0).toUpperCase()+b.substring(1),Ze[w]=Ze[b]})});function Ke(b,w,A){return w==null||typeof w=="boolean"||w===""?"":A||typeof w!="number"||w===0||Ze.hasOwnProperty(b)&&Ze[b]?(""+w).trim():w+"px"}function ze(b,w){b=b.style;for(var A in w)if(w.hasOwnProperty(A)){var V=A.indexOf("--")===0,G=Ke(A,w[A],V);A==="float"&&(A="cssFloat"),V?b.setProperty(A,G):b[A]=G}}var Qe=O({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function nt(b,w){if(w){if(Qe[b]&&(w.children!=null||w.dangerouslySetInnerHTML!=null))throw Error(t(137,b));if(w.dangerouslySetInnerHTML!=null){if(w.children!=null)throw Error(t(60));if(typeof w.dangerouslySetInnerHTML!="object"||!("__html"in w.dangerouslySetInnerHTML))throw Error(t(61))}if(w.style!=null&&typeof w.style!="object")throw Error(t(62))}}function Ae(b,w){if(b.indexOf("-")===-1)return typeof w.is=="string";switch(b){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ut=null;function zt(b){return b=b.target||b.srcElement||window,b.correspondingUseElement&&(b=b.correspondingUseElement),b.nodeType===3?b.parentNode:b}var ht=null,Tt=null,It=null;function Et(b){if(b=Ko(b)){if(typeof ht!="function")throw Error(t(280));var w=b.stateNode;w&&(w=rc(w),ht(b.stateNode,b.type,w))}}function $t(b){Tt?It?It.push(b):It=[b]:Tt=b}function qt(){if(Tt){var b=Tt,w=It;if(It=Tt=null,Et(b),w)for(b=0;b>>=0,b===0?32:31-(er(b)/Wt|0)|0}var tr=64,Lr=4194304;function wr(b){switch(b&-b){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return b&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return b&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return b}}function Mn(b,w){var A=b.pendingLanes;if(A===0)return 0;var V=0,G=b.suspendedLanes,J=b.pingedLanes,oe=A&268435455;if(oe!==0){var pe=oe&~G;pe!==0?V=wr(pe):(J&=oe,J!==0&&(V=wr(J)))}else oe=A&~G,oe!==0?V=wr(oe):J!==0&&(V=wr(J));if(V===0)return 0;if(w!==0&&w!==V&&(w&G)===0&&(G=V&-V,J=w&-w,G>=J||G===16&&(J&4194240)!==0))return w;if((V&4)!==0&&(V|=A&16),w=b.entangledLanes,w!==0)for(b=b.entanglements,w&=V;0A;A++)w.push(b);return w}function Mr(b,w,A){b.pendingLanes|=w,w!==536870912&&(b.suspendedLanes=0,b.pingedLanes=0),b=b.eventTimes,w=31-Mt(w),b[w]=A}function xi(b,w){var A=b.pendingLanes&~w;b.pendingLanes=w,b.suspendedLanes=0,b.pingedLanes=0,b.expiredLanes&=w,b.mutableReadLanes&=w,b.entangledLanes&=w,w=b.entanglements;var V=b.eventTimes;for(b=b.expirationTimes;0=yi),jf=" ",du=!1;function Sf(b,w){switch(b){case"keyup":return _f.indexOf(w.keyCode)!==-1;case"keydown":return w.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ys(b){return b=b.detail,typeof b=="object"&&"data"in b?b.data:null}var ts=!1;function z0(b,w){switch(b){case"compositionend":return Ys(w);case"keypress":return w.which!==32?null:(du=!0,jf);case"textInput":return b=w.data,b===jf&&du?null:b;default:return null}}function $0(b,w){if(ts)return b==="compositionend"||!uu&&Sf(b,w)?(b=iu(),Po=zl=Ji=null,ts=!1,b):null;switch(b){case"paste":return null;case"keypress":if(!(w.ctrlKey||w.altKey||w.metaKey)||w.ctrlKey&&w.altKey){if(w.char&&1=w)return{node:A,offset:w-b};b=V}e:{for(;A;){if(A.nextSibling){A=A.nextSibling;break e}A=A.parentNode}A=void 0}A=mu(A)}}function pu(b,w){return b&&w?b===w?!0:b&&b.nodeType===3?!1:w&&w.nodeType===3?pu(b,w.parentNode):"contains"in b?b.contains(w):b.compareDocumentPosition?!!(b.compareDocumentPosition(w)&16):!1:!1}function gu(){for(var b=window,w=Q();w instanceof b.HTMLIFrameElement;){try{var A=typeof w.contentWindow.location.href=="string"}catch{A=!1}if(A)b=w.contentWindow;else break;w=Q(b.document)}return w}function Gl(b){var w=b&&b.nodeName&&b.nodeName.toLowerCase();return w&&(w==="input"&&(b.type==="text"||b.type==="search"||b.type==="tel"||b.type==="url"||b.type==="password")||w==="textarea"||b.contentEditable==="true")}function Of(b){var w=gu(),A=b.focusedElem,V=b.selectionRange;if(w!==A&&A&&A.ownerDocument&&pu(A.ownerDocument.documentElement,A)){if(V!==null&&Gl(A)){if(w=V.start,b=V.end,b===void 0&&(b=w),"selectionStart"in A)A.selectionStart=w,A.selectionEnd=Math.min(b,A.value.length);else if(b=(w=A.ownerDocument||document)&&w.defaultView||window,b.getSelection){b=b.getSelection();var G=A.textContent.length,J=Math.min(V.start,G);V=V.end===void 0?J:Math.min(V.end,G),!b.extend&&J>V&&(G=V,V=J,J=G),G=Mf(A,J);var oe=Mf(A,V);G&&oe&&(b.rangeCount!==1||b.anchorNode!==G.node||b.anchorOffset!==G.offset||b.focusNode!==oe.node||b.focusOffset!==oe.offset)&&(w=w.createRange(),w.setStart(G.node,G.offset),b.removeAllRanges(),J>V?(b.addRange(w),b.extend(oe.node,oe.offset)):(w.setEnd(oe.node,oe.offset),b.addRange(w)))}}for(w=[],b=A;b=b.parentNode;)b.nodeType===1&&w.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A=document.documentMode,Zs=null,zo=null,Va=null,xu=!1;function Tf(b,w,A){var V=A.window===A?A.document:A.nodeType===9?A:A.ownerDocument;xu||Zs==null||Zs!==Q(V)||(V=Zs,"selectionStart"in V&&Gl(V)?V={start:V.selectionStart,end:V.selectionEnd}:(V=(V.ownerDocument&&V.ownerDocument.defaultView||window).getSelection(),V={anchorNode:V.anchorNode,anchorOffset:V.anchorOffset,focusNode:V.focusNode,focusOffset:V.focusOffset}),Va&&Bo(Va,V)||(Va=V,V=ec(zo,"onSelect"),0Xa||(b.current=Mu[Xa],Mu[Xa]=null,Xa--)}function lr(b,w){Xa++,Mu[Xa]=b.current,b.current=w}var ss={},Hr=As(ss),wn=As(!1),ea=ss;function Ga(b,w){var A=b.type.contextTypes;if(!A)return ss;var V=b.stateNode;if(V&&V.__reactInternalMemoizedUnmaskedChildContext===w)return V.__reactInternalMemoizedMaskedChildContext;var G={},J;for(J in A)G[J]=w[J];return V&&(b=b.stateNode,b.__reactInternalMemoizedUnmaskedChildContext=w,b.__reactInternalMemoizedMaskedChildContext=G),G}function Rn(b){return b=b.childContextTypes,b!=null}function nc(){xr(wn),xr(Hr)}function le(b,w,A){if(Hr.current!==ss)throw Error(t(168));lr(Hr,w),lr(wn,A)}function Se(b,w,A){var V=b.stateNode;if(w=w.childContextTypes,typeof V.getChildContext!="function")return A;V=V.getChildContext();for(var G in V)if(!(G in w))throw Error(t(108,ee(b)||"Unknown",G));return O({},A,V)}function We(b){return b=(b=b.stateNode)&&b.__reactInternalMemoizedMergedChildContext||ss,ea=Hr.current,lr(Hr,b),lr(wn,wn.current),!0}function rt(b,w,A){var V=b.stateNode;if(!V)throw Error(t(169));A?(b=Se(b,w,ea),V.__reactInternalMemoizedMergedChildContext=b,xr(wn),xr(Hr),lr(Hr,b)):xr(wn),lr(wn,A)}var Kt=null,Qt=!1,ta=!1;function Ou(b){Kt===null?Kt=[b]:Kt.push(b)}function PM(b){Qt=!0,Ou(b)}function Ya(){if(!ta&&Kt!==null){ta=!0;var b=0,w=jt;try{var A=Kt;for(jt=1;b>=oe,G-=oe,ra=1<<32-Mt(w)+G|A<Lt?(dn=Pt,Pt=null):dn=Pt.sibling;var ir=Ve(Ee,Pt,Me[Lt],Ye);if(ir===null){Pt===null&&(Pt=dn);break}b&&Pt&&ir.alternate===null&&w(Ee,Pt),_e=J(ir,_e,Lt),Ot===null?_t=ir:Ot.sibling=ir,Ot=ir,Pt=dn}if(Lt===Me.length)return A(Ee,Pt),Sr&&Go(Ee,Lt),_t;if(Pt===null){for(;LtLt?(dn=Pt,Pt=null):dn=Pt.sibling;var so=Ve(Ee,Pt,ir.value,Ye);if(so===null){Pt===null&&(Pt=dn);break}b&&Pt&&so.alternate===null&&w(Ee,Pt),_e=J(so,_e,Lt),Ot===null?_t=so:Ot.sibling=so,Ot=so,Pt=dn}if(ir.done)return A(Ee,Pt),Sr&&Go(Ee,Lt),_t;if(Pt===null){for(;!ir.done;Lt++,ir=Me.next())ir=He(Ee,ir.value,Ye),ir!==null&&(_e=J(ir,_e,Lt),Ot===null?_t=ir:Ot.sibling=ir,Ot=ir);return Sr&&Go(Ee,Lt),_t}for(Pt=V(Ee,Pt);!ir.done;Lt++,ir=Me.next())ir=lt(Pt,Ee,Lt,ir.value,Ye),ir!==null&&(b&&ir.alternate!==null&&Pt.delete(ir.key===null?Lt:ir.key),_e=J(ir,_e,Lt),Ot===null?_t=ir:Ot.sibling=ir,Ot=ir);return b&&Pt.forEach(function(fO){return w(Ee,fO)}),Sr&&Go(Ee,Lt),_t}function Ur(Ee,_e,Me,Ye){if(typeof Me=="object"&&Me!==null&&Me.type===U&&Me.key===null&&(Me=Me.props.children),typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case M:e:{for(var _t=Me.key,Ot=_e;Ot!==null;){if(Ot.key===_t){if(_t=Me.type,_t===U){if(Ot.tag===7){A(Ee,Ot.sibling),_e=G(Ot,Me.props.children),_e.return=Ee,Ee=_e;break e}}else if(Ot.elementType===_t||typeof _t=="object"&&_t!==null&&_t.$$typeof===j&&Ow(_t)===Ot.type){A(Ee,Ot.sibling),_e=G(Ot,Me.props),_e.ref=Pu(Ee,Ot,Me),_e.return=Ee,Ee=_e;break e}A(Ee,Ot);break}else w(Ee,Ot);Ot=Ot.sibling}Me.type===U?(_e=nl(Me.props.children,Ee.mode,Ye,Me.key),_e.return=Ee,Ee=_e):(Ye=gh(Me.type,Me.key,Me.props,null,Ee.mode,Ye),Ye.ref=Pu(Ee,_e,Me),Ye.return=Ee,Ee=Ye)}return oe(Ee);case T:e:{for(Ot=Me.key;_e!==null;){if(_e.key===Ot)if(_e.tag===4&&_e.stateNode.containerInfo===Me.containerInfo&&_e.stateNode.implementation===Me.implementation){A(Ee,_e.sibling),_e=G(_e,Me.children||[]),_e.return=Ee,Ee=_e;break e}else{A(Ee,_e);break}else w(Ee,_e);_e=_e.sibling}_e=Yg(Me,Ee.mode,Ye),_e.return=Ee,Ee=_e}return oe(Ee);case j:return Ot=Me._init,Ur(Ee,_e,Ot(Me._payload),Ye)}if(de(Me))return gt(Ee,_e,Me,Ye);if(N(Me))return bt(Ee,_e,Me,Ye);Wf(Ee,Me)}return typeof Me=="string"&&Me!==""||typeof Me=="number"?(Me=""+Me,_e!==null&&_e.tag===6?(A(Ee,_e.sibling),_e=G(_e,Me),_e.return=Ee,Ee=_e):(A(Ee,_e),_e=Gg(Me,Ee.mode,Ye),_e.return=Ee,Ee=_e),oe(Ee)):A(Ee,_e)}return Ur}var oc=Pw(!0),Tw=Pw(!1),Kf=As(null),Xf=null,lc=null,sg=null;function ag(){sg=lc=Xf=null}function og(b){var w=Kf.current;xr(Kf),b._currentValue=w}function lg(b,w,A){for(;b!==null;){var V=b.alternate;if((b.childLanes&w)!==w?(b.childLanes|=w,V!==null&&(V.childLanes|=w)):V!==null&&(V.childLanes&w)!==w&&(V.childLanes|=w),b===A)break;b=b.return}}function cc(b,w){Xf=b,sg=lc=null,b=b.dependencies,b!==null&&b.firstContext!==null&&((b.lanes&w)!==0&&(li=!0),b.firstContext=null)}function Ti(b){var w=b._currentValue;if(sg!==b)if(b={context:b,memoizedValue:w,next:null},lc===null){if(Xf===null)throw Error(t(308));lc=b,Xf.dependencies={lanes:0,firstContext:b}}else lc=lc.next=b;return w}var Yo=null;function cg(b){Yo===null?Yo=[b]:Yo.push(b)}function Iw(b,w,A,V){var G=w.interleaved;return G===null?(A.next=A,cg(w)):(A.next=G.next,G.next=A),w.interleaved=A,ia(b,V)}function ia(b,w){b.lanes|=w;var A=b.alternate;for(A!==null&&(A.lanes|=w),A=b,b=b.return;b!==null;)b.childLanes|=w,A=b.alternate,A!==null&&(A.childLanes|=w),A=b,b=b.return;return A.tag===3?A.stateNode:null}var Za=!1;function ug(b){b.updateQueue={baseState:b.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Rw(b,w){b=b.updateQueue,w.updateQueue===b&&(w.updateQueue={baseState:b.baseState,firstBaseUpdate:b.firstBaseUpdate,lastBaseUpdate:b.lastBaseUpdate,shared:b.shared,effects:b.effects})}function sa(b,w){return{eventTime:b,lane:w,tag:0,payload:null,callback:null,next:null}}function Qa(b,w,A){var V=b.updateQueue;if(V===null)return null;if(V=V.shared,(rr&2)!==0){var G=V.pending;return G===null?w.next=w:(w.next=G.next,G.next=w),V.pending=w,ia(b,A)}return G=V.interleaved,G===null?(w.next=w,cg(V)):(w.next=G.next,G.next=w),V.interleaved=w,ia(b,A)}function Gf(b,w,A){if(w=w.updateQueue,w!==null&&(w=w.shared,(A&4194240)!==0)){var V=w.lanes;V&=b.pendingLanes,A|=V,w.lanes=A,Ss(b,A)}}function Dw(b,w){var A=b.updateQueue,V=b.alternate;if(V!==null&&(V=V.updateQueue,A===V)){var G=null,J=null;if(A=A.firstBaseUpdate,A!==null){do{var oe={eventTime:A.eventTime,lane:A.lane,tag:A.tag,payload:A.payload,callback:A.callback,next:null};J===null?G=J=oe:J=J.next=oe,A=A.next}while(A!==null);J===null?G=J=w:J=J.next=w}else G=J=w;A={baseState:V.baseState,firstBaseUpdate:G,lastBaseUpdate:J,shared:V.shared,effects:V.effects},b.updateQueue=A;return}b=A.lastBaseUpdate,b===null?A.firstBaseUpdate=w:b.next=w,A.lastBaseUpdate=w}function Yf(b,w,A,V){var G=b.updateQueue;Za=!1;var J=G.firstBaseUpdate,oe=G.lastBaseUpdate,pe=G.shared.pending;if(pe!==null){G.shared.pending=null;var ve=pe,Pe=ve.next;ve.next=null,oe===null?J=Pe:oe.next=Pe,oe=ve;var qe=b.alternate;qe!==null&&(qe=qe.updateQueue,pe=qe.lastBaseUpdate,pe!==oe&&(pe===null?qe.firstBaseUpdate=Pe:pe.next=Pe,qe.lastBaseUpdate=ve))}if(J!==null){var He=G.baseState;oe=0,qe=Pe=ve=null,pe=J;do{var Ve=pe.lane,lt=pe.eventTime;if((V&Ve)===Ve){qe!==null&&(qe=qe.next={eventTime:lt,lane:0,tag:pe.tag,payload:pe.payload,callback:pe.callback,next:null});e:{var gt=b,bt=pe;switch(Ve=w,lt=A,bt.tag){case 1:if(gt=bt.payload,typeof gt=="function"){He=gt.call(lt,He,Ve);break e}He=gt;break e;case 3:gt.flags=gt.flags&-65537|128;case 0:if(gt=bt.payload,Ve=typeof gt=="function"?gt.call(lt,He,Ve):gt,Ve==null)break e;He=O({},He,Ve);break e;case 2:Za=!0}}pe.callback!==null&&pe.lane!==0&&(b.flags|=64,Ve=G.effects,Ve===null?G.effects=[pe]:Ve.push(pe))}else lt={eventTime:lt,lane:Ve,tag:pe.tag,payload:pe.payload,callback:pe.callback,next:null},qe===null?(Pe=qe=lt,ve=He):qe=qe.next=lt,oe|=Ve;if(pe=pe.next,pe===null){if(pe=G.shared.pending,pe===null)break;Ve=pe,pe=Ve.next,Ve.next=null,G.lastBaseUpdate=Ve,G.shared.pending=null}}while(!0);if(qe===null&&(ve=He),G.baseState=ve,G.firstBaseUpdate=Pe,G.lastBaseUpdate=qe,w=G.shared.interleaved,w!==null){G=w;do oe|=G.lane,G=G.next;while(G!==w)}else J===null&&(G.shared.lanes=0);Jo|=oe,b.lanes=oe,b.memoizedState=He}}function Lw(b,w,A){if(b=w.effects,w.effects=null,b!==null)for(w=0;wA?A:4,b(!0);var V=pg.transition;pg.transition={};try{b(!1),w()}finally{jt=A,pg.transition=V}}function r_(){return Ii().memoizedState}function DM(b,w,A){var V=ro(b);if(A={lane:V,action:A,hasEagerState:!1,eagerState:null,next:null},n_(b))i_(w,A);else if(A=Iw(b,w,A,V),A!==null){var G=Yn();us(A,b,V,G),s_(A,w,V)}}function LM(b,w,A){var V=ro(b),G={lane:V,action:A,hasEagerState:!1,eagerState:null,next:null};if(n_(b))i_(w,G);else{var J=b.alternate;if(b.lanes===0&&(J===null||J.lanes===0)&&(J=w.lastRenderedReducer,J!==null))try{var oe=w.lastRenderedState,pe=J(oe,A);if(G.hasEagerState=!0,G.eagerState=pe,Wn(pe,oe)){var ve=w.interleaved;ve===null?(G.next=G,cg(w)):(G.next=ve.next,ve.next=G),w.interleaved=G;return}}catch{}A=Iw(b,w,G,V),A!==null&&(G=Yn(),us(A,b,V,G),s_(A,w,V))}}function n_(b){var w=b.alternate;return b===Tr||w!==null&&w===Tr}function i_(b,w){Du=Jf=!0;var A=b.pending;A===null?w.next=w:(w.next=A.next,A.next=w),b.pending=w}function s_(b,w,A){if((A&4194240)!==0){var V=w.lanes;V&=b.pendingLanes,A|=V,w.lanes=A,Ss(b,A)}}var rh={readContext:Ti,useCallback:Dn,useContext:Dn,useEffect:Dn,useImperativeHandle:Dn,useInsertionEffect:Dn,useLayoutEffect:Dn,useMemo:Dn,useReducer:Dn,useRef:Dn,useState:Dn,useDebugValue:Dn,useDeferredValue:Dn,useTransition:Dn,useMutableSource:Dn,useSyncExternalStore:Dn,useId:Dn,unstable_isNewReconciler:!1},FM={readContext:Ti,useCallback:function(b,w){return Os().memoizedState=[b,w===void 0?null:w],b},useContext:Ti,useEffect:Xw,useImperativeHandle:function(b,w,A){return A=A!=null?A.concat([b]):null,eh(4194308,4,Zw.bind(null,w,b),A)},useLayoutEffect:function(b,w){return eh(4194308,4,b,w)},useInsertionEffect:function(b,w){return eh(4,2,b,w)},useMemo:function(b,w){var A=Os();return w=w===void 0?null:w,b=b(),A.memoizedState=[b,w],b},useReducer:function(b,w,A){var V=Os();return w=A!==void 0?A(w):w,V.memoizedState=V.baseState=w,b={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:b,lastRenderedState:w},V.queue=b,b=b.dispatch=DM.bind(null,Tr,b),[V.memoizedState,b]},useRef:function(b){var w=Os();return b={current:b},w.memoizedState=b},useState:Ww,useDebugValue:_g,useDeferredValue:function(b){return Os().memoizedState=b},useTransition:function(){var b=Ww(!1),w=b[0];return b=RM.bind(null,b[1]),Os().memoizedState=b,[w,b]},useMutableSource:function(){},useSyncExternalStore:function(b,w,A){var V=Tr,G=Os();if(Sr){if(A===void 0)throw Error(t(407));A=A()}else{if(A=w(),un===null)throw Error(t(349));(Qo&30)!==0||$w(V,w,A)}G.memoizedState=A;var J={value:A,getSnapshot:w};return G.queue=J,Xw(Vw.bind(null,V,J,b),[b]),V.flags|=2048,Bu(9,Uw.bind(null,V,J,A,w),void 0,null),A},useId:function(){var b=Os(),w=un.identifierPrefix;if(Sr){var A=na,V=ra;A=(V&~(1<<32-Mt(V)-1)).toString(32)+A,w=":"+w+"R"+A,A=Lu++,0<\/script>",b=b.removeChild(b.firstChild)):typeof V.is=="string"?b=oe.createElement(A,{is:V.is}):(b=oe.createElement(A),A==="select"&&(oe=b,V.multiple?oe.multiple=!0:V.size&&(oe.size=V.size))):b=oe.createElementNS(b,A),b[Mi]=w,b[Wo]=V,k_(b,w,!1,!1),w.stateNode=b;e:{switch(oe=Ae(A,V),A){case"dialog":gr("cancel",b),gr("close",b),G=V;break;case"iframe":case"object":case"embed":gr("load",b),G=V;break;case"video":case"audio":for(G=0;Gmc&&(w.flags|=128,V=!0,zu(J,!1),w.lanes=4194304)}else{if(!V)if(b=Zf(oe),b!==null){if(w.flags|=128,V=!0,A=b.updateQueue,A!==null&&(w.updateQueue=A,w.flags|=4),zu(J,!0),J.tail===null&&J.tailMode==="hidden"&&!oe.alternate&&!Sr)return Ln(w),null}else 2*we()-J.renderingStartTime>mc&&A!==1073741824&&(w.flags|=128,V=!0,zu(J,!1),w.lanes=4194304);J.isBackwards?(oe.sibling=w.child,w.child=oe):(A=J.last,A!==null?A.sibling=oe:w.child=oe,J.last=oe)}return J.tail!==null?(w=J.tail,J.rendering=w,J.tail=w.sibling,J.renderingStartTime=we(),w.sibling=null,A=Pr.current,lr(Pr,V?A&1|2:A&1),w):(Ln(w),null);case 22:case 23:return Wg(),V=w.memoizedState!==null,b!==null&&b.memoizedState!==null!==V&&(w.flags|=8192),V&&(w.mode&1)!==0?(_i&1073741824)!==0&&(Ln(w),w.subtreeFlags&6&&(w.flags|=8192)):Ln(w),null;case 24:return null;case 25:return null}throw Error(t(156,w.tag))}function WM(b,w){switch(tg(w),w.tag){case 1:return Rn(w.type)&&nc(),b=w.flags,b&65536?(w.flags=b&-65537|128,w):null;case 3:return uc(),xr(wn),xr(Hr),mg(),b=w.flags,(b&65536)!==0&&(b&128)===0?(w.flags=b&-65537|128,w):null;case 5:return fg(w),null;case 13:if(xr(Pr),b=w.memoizedState,b!==null&&b.dehydrated!==null){if(w.alternate===null)throw Error(t(340));ac()}return b=w.flags,b&65536?(w.flags=b&-65537|128,w):null;case 19:return xr(Pr),null;case 4:return uc(),null;case 10:return og(w.type._context),null;case 22:case 23:return Wg(),null;case 24:return null;default:return null}}var ah=!1,Fn=!1,KM=typeof WeakSet=="function"?WeakSet:Set,mt=null;function fc(b,w){var A=b.ref;if(A!==null)if(typeof A=="function")try{A(null)}catch(V){Fr(b,w,V)}else A.current=null}function Ig(b,w,A){try{A()}catch(V){Fr(b,w,V)}}var E_=!1;function XM(b,w){if(ju=Ll,b=gu(),Gl(b)){if("selectionStart"in b)var A={start:b.selectionStart,end:b.selectionEnd};else e:{A=(A=b.ownerDocument)&&A.defaultView||window;var V=A.getSelection&&A.getSelection();if(V&&V.rangeCount!==0){A=V.anchorNode;var G=V.anchorOffset,J=V.focusNode;V=V.focusOffset;try{A.nodeType,J.nodeType}catch{A=null;break e}var oe=0,pe=-1,ve=-1,Pe=0,qe=0,He=b,Ve=null;t:for(;;){for(var lt;He!==A||G!==0&&He.nodeType!==3||(pe=oe+G),He!==J||V!==0&&He.nodeType!==3||(ve=oe+V),He.nodeType===3&&(oe+=He.nodeValue.length),(lt=He.firstChild)!==null;)Ve=He,He=lt;for(;;){if(He===b)break t;if(Ve===A&&++Pe===G&&(pe=oe),Ve===J&&++qe===V&&(ve=oe),(lt=He.nextSibling)!==null)break;He=Ve,Ve=He.parentNode}He=lt}A=pe===-1||ve===-1?null:{start:pe,end:ve}}else A=null}A=A||{start:0,end:0}}else A=null;for(Su={focusedElem:b,selectionRange:A},Ll=!1,mt=w;mt!==null;)if(w=mt,b=w.child,(w.subtreeFlags&1028)!==0&&b!==null)b.return=w,mt=b;else for(;mt!==null;){w=mt;try{var gt=w.alternate;if((w.flags&1024)!==0)switch(w.tag){case 0:case 11:case 15:break;case 1:if(gt!==null){var bt=gt.memoizedProps,Ur=gt.memoizedState,Ee=w.stateNode,_e=Ee.getSnapshotBeforeUpdate(w.elementType===w.type?bt:os(w.type,bt),Ur);Ee.__reactInternalSnapshotBeforeUpdate=_e}break;case 3:var Me=w.stateNode.containerInfo;Me.nodeType===1?Me.textContent="":Me.nodeType===9&&Me.documentElement&&Me.removeChild(Me.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Ye){Fr(w,w.return,Ye)}if(b=w.sibling,b!==null){b.return=w.return,mt=b;break}mt=w.return}return gt=E_,E_=!1,gt}function $u(b,w,A){var V=w.updateQueue;if(V=V!==null?V.lastEffect:null,V!==null){var G=V=V.next;do{if((G.tag&b)===b){var J=G.destroy;G.destroy=void 0,J!==void 0&&Ig(w,A,J)}G=G.next}while(G!==V)}}function oh(b,w){if(w=w.updateQueue,w=w!==null?w.lastEffect:null,w!==null){var A=w=w.next;do{if((A.tag&b)===b){var V=A.create;A.destroy=V()}A=A.next}while(A!==w)}}function Rg(b){var w=b.ref;if(w!==null){var A=b.stateNode;b.tag,b=A,typeof w=="function"?w(b):w.current=b}}function A_(b){var w=b.alternate;w!==null&&(b.alternate=null,A_(w)),b.child=null,b.deletions=null,b.sibling=null,b.tag===5&&(w=b.stateNode,w!==null&&(delete w[Mi],delete w[Wo],delete w[Au],delete w[Q0],delete w[J0])),b.stateNode=null,b.return=null,b.dependencies=null,b.memoizedProps=null,b.memoizedState=null,b.pendingProps=null,b.stateNode=null,b.updateQueue=null}function M_(b){return b.tag===5||b.tag===3||b.tag===4}function O_(b){e:for(;;){for(;b.sibling===null;){if(b.return===null||M_(b.return))return null;b=b.return}for(b.sibling.return=b.return,b=b.sibling;b.tag!==5&&b.tag!==6&&b.tag!==18;){if(b.flags&2||b.child===null||b.tag===4)continue e;b.child.return=b,b=b.child}if(!(b.flags&2))return b.stateNode}}function Dg(b,w,A){var V=b.tag;if(V===5||V===6)b=b.stateNode,w?A.nodeType===8?A.parentNode.insertBefore(b,w):A.insertBefore(b,w):(A.nodeType===8?(w=A.parentNode,w.insertBefore(b,A)):(w=A,w.appendChild(b)),A=A._reactRootContainer,A!=null||w.onclick!==null||(w.onclick=tc));else if(V!==4&&(b=b.child,b!==null))for(Dg(b,w,A),b=b.sibling;b!==null;)Dg(b,w,A),b=b.sibling}function Lg(b,w,A){var V=b.tag;if(V===5||V===6)b=b.stateNode,w?A.insertBefore(b,w):A.appendChild(b);else if(V!==4&&(b=b.child,b!==null))for(Lg(b,w,A),b=b.sibling;b!==null;)Lg(b,w,A),b=b.sibling}var _n=null,ls=!1;function Ja(b,w,A){for(A=A.child;A!==null;)P_(b,w,A),A=A.sibling}function P_(b,w,A){if(st&&typeof st.onCommitFiberUnmount=="function")try{st.onCommitFiberUnmount(it,A)}catch{}switch(A.tag){case 5:Fn||fc(A,w);case 6:var V=_n,G=ls;_n=null,Ja(b,w,A),_n=V,ls=G,_n!==null&&(ls?(b=_n,A=A.stateNode,b.nodeType===8?b.parentNode.removeChild(A):b.removeChild(A)):_n.removeChild(A.stateNode));break;case 18:_n!==null&&(ls?(b=_n,A=A.stateNode,b.nodeType===8?Eu(b.parentNode,A):b.nodeType===1&&Eu(b,A),Oo(b)):Eu(_n,A.stateNode));break;case 4:V=_n,G=ls,_n=A.stateNode.containerInfo,ls=!0,Ja(b,w,A),_n=V,ls=G;break;case 0:case 11:case 14:case 15:if(!Fn&&(V=A.updateQueue,V!==null&&(V=V.lastEffect,V!==null))){G=V=V.next;do{var J=G,oe=J.destroy;J=J.tag,oe!==void 0&&((J&2)!==0||(J&4)!==0)&&Ig(A,w,oe),G=G.next}while(G!==V)}Ja(b,w,A);break;case 1:if(!Fn&&(fc(A,w),V=A.stateNode,typeof V.componentWillUnmount=="function"))try{V.props=A.memoizedProps,V.state=A.memoizedState,V.componentWillUnmount()}catch(pe){Fr(A,w,pe)}Ja(b,w,A);break;case 21:Ja(b,w,A);break;case 22:A.mode&1?(Fn=(V=Fn)||A.memoizedState!==null,Ja(b,w,A),Fn=V):Ja(b,w,A);break;default:Ja(b,w,A)}}function T_(b){var w=b.updateQueue;if(w!==null){b.updateQueue=null;var A=b.stateNode;A===null&&(A=b.stateNode=new KM),w.forEach(function(V){var G=nO.bind(null,b,V);A.has(V)||(A.add(V),V.then(G,G))})}}function cs(b,w){var A=w.deletions;if(A!==null)for(var V=0;VG&&(G=oe),V&=~J}if(V=G,V=we()-V,V=(120>V?120:480>V?480:1080>V?1080:1920>V?1920:3e3>V?3e3:4320>V?4320:1960*YM(V/1960))-V,10b?16:b,to===null)var V=!1;else{if(b=to,to=null,fh=0,(rr&6)!==0)throw Error(t(331));var G=rr;for(rr|=4,mt=b.current;mt!==null;){var J=mt,oe=J.child;if((mt.flags&16)!==0){var pe=J.deletions;if(pe!==null){for(var ve=0;vewe()-zg?tl(b,0):Bg|=A),ui(b,w)}function W_(b,w){w===0&&((b.mode&1)===0?w=1:(w=Lr,Lr<<=1,(Lr&130023424)===0&&(Lr=4194304)));var A=Yn();b=ia(b,w),b!==null&&(Mr(b,w,A),ui(b,A))}function rO(b){var w=b.memoizedState,A=0;w!==null&&(A=w.retryLane),W_(b,A)}function nO(b,w){var A=0;switch(b.tag){case 13:var V=b.stateNode,G=b.memoizedState;G!==null&&(A=G.retryLane);break;case 19:V=b.stateNode;break;default:throw Error(t(314))}V!==null&&V.delete(w),W_(b,A)}var K_;K_=function(b,w,A){if(b!==null)if(b.memoizedProps!==w.pendingProps||wn.current)li=!0;else{if((b.lanes&A)===0&&(w.flags&128)===0)return li=!1,qM(b,w,A);li=(b.flags&131072)!==0}else li=!1,Sr&&(w.flags&1048576)!==0&&Nw(w,qf,w.index);switch(w.lanes=0,w.tag){case 2:var V=w.type;sh(b,w),b=w.pendingProps;var G=Ga(w,Hr.current);cc(w,A),G=xg(null,w,V,b,G,A);var J=bg();return w.flags|=1,typeof G=="object"&&G!==null&&typeof G.render=="function"&&G.$$typeof===void 0?(w.tag=1,w.memoizedState=null,w.updateQueue=null,Rn(V)?(J=!0,We(w)):J=!1,w.memoizedState=G.state!==null&&G.state!==void 0?G.state:null,ug(w),G.updater=nh,w.stateNode=G,G._reactInternals=w,Sg(w,V,b,A),w=Eg(null,w,V,!0,J,A)):(w.tag=0,Sr&&J&&eg(w),Gn(null,w,G,A),w=w.child),w;case 16:V=w.elementType;e:{switch(sh(b,w),b=w.pendingProps,G=V._init,V=G(V._payload),w.type=V,G=w.tag=sO(V),b=os(V,b),G){case 0:w=Cg(null,w,V,b,A);break e;case 1:w=y_(null,w,V,b,A);break e;case 11:w=m_(null,w,V,b,A);break e;case 14:w=p_(null,w,V,os(V.type,b),A);break e}throw Error(t(306,V,""))}return w;case 0:return V=w.type,G=w.pendingProps,G=w.elementType===V?G:os(V,G),Cg(b,w,V,G,A);case 1:return V=w.type,G=w.pendingProps,G=w.elementType===V?G:os(V,G),y_(b,w,V,G,A);case 3:e:{if(v_(w),b===null)throw Error(t(387));V=w.pendingProps,J=w.memoizedState,G=J.element,Rw(b,w),Yf(w,V,null,A);var oe=w.memoizedState;if(V=oe.element,J.isDehydrated)if(J={element:V,isDehydrated:!1,cache:oe.cache,pendingSuspenseBoundaries:oe.pendingSuspenseBoundaries,transitions:oe.transitions},w.updateQueue.baseState=J,w.memoizedState=J,w.flags&256){G=dc(Error(t(423)),w),w=w_(b,w,V,A,G);break e}else if(V!==G){G=dc(Error(t(424)),w),w=w_(b,w,V,A,G);break e}else for(wi=Es(w.stateNode.containerInfo.firstChild),vi=w,Sr=!0,as=null,A=Tw(w,null,V,A),w.child=A;A;)A.flags=A.flags&-3|4096,A=A.sibling;else{if(ac(),V===G){w=aa(b,w,A);break e}Gn(b,w,V,A)}w=w.child}return w;case 5:return Fw(w),b===null&&ng(w),V=w.type,G=w.pendingProps,J=b!==null?b.memoizedProps:null,oe=G.children,ku(V,G)?oe=null:J!==null&&ku(V,J)&&(w.flags|=32),b_(b,w),Gn(b,w,oe,A),w.child;case 6:return b===null&&ng(w),null;case 13:return __(b,w,A);case 4:return dg(w,w.stateNode.containerInfo),V=w.pendingProps,b===null?w.child=oc(w,null,V,A):Gn(b,w,V,A),w.child;case 11:return V=w.type,G=w.pendingProps,G=w.elementType===V?G:os(V,G),m_(b,w,V,G,A);case 7:return Gn(b,w,w.pendingProps,A),w.child;case 8:return Gn(b,w,w.pendingProps.children,A),w.child;case 12:return Gn(b,w,w.pendingProps.children,A),w.child;case 10:e:{if(V=w.type._context,G=w.pendingProps,J=w.memoizedProps,oe=G.value,lr(Kf,V._currentValue),V._currentValue=oe,J!==null)if(Wn(J.value,oe)){if(J.children===G.children&&!wn.current){w=aa(b,w,A);break e}}else for(J=w.child,J!==null&&(J.return=w);J!==null;){var pe=J.dependencies;if(pe!==null){oe=J.child;for(var ve=pe.firstContext;ve!==null;){if(ve.context===V){if(J.tag===1){ve=sa(-1,A&-A),ve.tag=2;var Pe=J.updateQueue;if(Pe!==null){Pe=Pe.shared;var qe=Pe.pending;qe===null?ve.next=ve:(ve.next=qe.next,qe.next=ve),Pe.pending=ve}}J.lanes|=A,ve=J.alternate,ve!==null&&(ve.lanes|=A),lg(J.return,A,w),pe.lanes|=A;break}ve=ve.next}}else if(J.tag===10)oe=J.type===w.type?null:J.child;else if(J.tag===18){if(oe=J.return,oe===null)throw Error(t(341));oe.lanes|=A,pe=oe.alternate,pe!==null&&(pe.lanes|=A),lg(oe,A,w),oe=J.sibling}else oe=J.child;if(oe!==null)oe.return=J;else for(oe=J;oe!==null;){if(oe===w){oe=null;break}if(J=oe.sibling,J!==null){J.return=oe.return,oe=J;break}oe=oe.return}J=oe}Gn(b,w,G.children,A),w=w.child}return w;case 9:return G=w.type,V=w.pendingProps.children,cc(w,A),G=Ti(G),V=V(G),w.flags|=1,Gn(b,w,V,A),w.child;case 14:return V=w.type,G=os(V,w.pendingProps),G=os(V.type,G),p_(b,w,V,G,A);case 15:return g_(b,w,w.type,w.pendingProps,A);case 17:return V=w.type,G=w.pendingProps,G=w.elementType===V?G:os(V,G),sh(b,w),w.tag=1,Rn(V)?(b=!0,We(w)):b=!1,cc(w,A),o_(w,V,G),Sg(w,V,G,A),Eg(null,w,V,!0,b,A);case 19:return S_(b,w,A);case 22:return x_(b,w,A)}throw Error(t(156,w.tag))};function X_(b,w){return nr(b,w)}function iO(b,w,A,V){this.tag=b,this.key=A,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=w,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=V,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Di(b,w,A,V){return new iO(b,w,A,V)}function Xg(b){return b=b.prototype,!(!b||!b.isReactComponent)}function sO(b){if(typeof b=="function")return Xg(b)?1:0;if(b!=null){if(b=b.$$typeof,b===$)return 11;if(b===E)return 14}return 2}function io(b,w){var A=b.alternate;return A===null?(A=Di(b.tag,w,b.key,b.mode),A.elementType=b.elementType,A.type=b.type,A.stateNode=b.stateNode,A.alternate=b,b.alternate=A):(A.pendingProps=w,A.type=b.type,A.flags=0,A.subtreeFlags=0,A.deletions=null),A.flags=b.flags&14680064,A.childLanes=b.childLanes,A.lanes=b.lanes,A.child=b.child,A.memoizedProps=b.memoizedProps,A.memoizedState=b.memoizedState,A.updateQueue=b.updateQueue,w=b.dependencies,A.dependencies=w===null?null:{lanes:w.lanes,firstContext:w.firstContext},A.sibling=b.sibling,A.index=b.index,A.ref=b.ref,A}function gh(b,w,A,V,G,J){var oe=2;if(V=b,typeof b=="function")Xg(b)&&(oe=1);else if(typeof b=="string")oe=5;else e:switch(b){case U:return nl(A.children,G,J,w);case F:oe=8,G|=8;break;case H:return b=Di(12,A,w,G|2),b.elementType=H,b.lanes=J,b;case P:return b=Di(13,A,w,G),b.elementType=P,b.lanes=J,b;case L:return b=Di(19,A,w,G),b.elementType=L,b.lanes=J,b;case k:return xh(A,G,J,w);default:if(typeof b=="object"&&b!==null)switch(b.$$typeof){case W:oe=10;break e;case K:oe=9;break e;case $:oe=11;break e;case E:oe=14;break e;case j:oe=16,V=null;break e}throw Error(t(130,b==null?b:typeof b,""))}return w=Di(oe,A,w,G),w.elementType=b,w.type=V,w.lanes=J,w}function nl(b,w,A,V){return b=Di(7,b,V,w),b.lanes=A,b}function xh(b,w,A,V){return b=Di(22,b,V,w),b.elementType=k,b.lanes=A,b.stateNode={isHidden:!1},b}function Gg(b,w,A){return b=Di(6,b,null,w),b.lanes=A,b}function Yg(b,w,A){return w=Di(4,b.children!==null?b.children:[],b.key,w),w.lanes=A,w.stateNode={containerInfo:b.containerInfo,pendingChildren:null,implementation:b.implementation},w}function aO(b,w,A,V,G){this.tag=w,this.containerInfo=b,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ut(0),this.expirationTimes=Ut(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ut(0),this.identifierPrefix=V,this.onRecoverableError=G,this.mutableSourceEagerHydrationData=null}function Zg(b,w,A,V,G,J,oe,pe,ve){return b=new aO(b,w,A,pe,ve),w===1?(w=1,J===!0&&(w|=8)):w=0,J=Di(3,null,null,w),b.current=J,J.stateNode=b,J.memoizedState={element:V,isDehydrated:A,cache:null,transitions:null,pendingSuspenseBoundaries:null},ug(J),b}function oO(b,w,A){var V=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),nx.exports=yO(),nx.exports}var l3;function vO(){if(l3)return Sh;l3=1;var e=fN();return Sh.createRoot=e.createRoot,Sh.hydrateRoot=e.hydrateRoot,Sh}var wO=vO();const _O=ws(wO);var jp=fN();function xd(){return xd=Object.assign?Object.assign.bind():function(e){for(var r=1;r"u")throw new Error(r)}function e1(e,r){if(!e){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function SO(){return Math.random().toString(36).substr(2,8)}function u3(e,r){return{usr:e.state,key:e.key,idx:r}}function py(e,r,t,n){return t===void 0&&(t=null),xd({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof r=="string"?Uc(r):r,{state:t,key:r&&r.key||n||SO()})}function gm(e){let{pathname:r="/",search:t="",hash:n=""}=e;return t&&t!=="?"&&(r+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(r+=n.charAt(0)==="#"?n:"#"+n),r}function Uc(e){let r={};if(e){let t=e.indexOf("#");t>=0&&(r.hash=e.substr(t),e=e.substr(0,t));let n=e.indexOf("?");n>=0&&(r.search=e.substr(n),e=e.substr(0,n)),e&&(r.pathname=e)}return r}function kO(e,r,t,n){n===void 0&&(n={});let{window:l=document.defaultView,v5Compat:i=!1}=n,o=l.history,u=fo.Pop,c=null,s=d();s==null&&(s=0,o.replaceState(xd({},o.state,{idx:s}),""));function d(){return(o.state||{idx:null}).idx}function f(){u=fo.Pop;let g=d(),y=g==null?null:g-s;s=g,c&&c({action:u,location:x.location,delta:y})}function h(g,y){u=fo.Push;let v=py(x.location,g,y);s=d()+1;let _=u3(v,s),C=x.createHref(v);try{o.pushState(_,"",C)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;l.location.assign(C)}i&&c&&c({action:u,location:x.location,delta:1})}function m(g,y){u=fo.Replace;let v=py(x.location,g,y);s=d();let _=u3(v,s),C=x.createHref(v);o.replaceState(_,"",C),i&&c&&c({action:u,location:x.location,delta:0})}function p(g){let y=l.location.origin!=="null"?l.location.origin:l.location.href,v=typeof g=="string"?g:gm(g);return v=v.replace(/ $/,"%20"),qr(y,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,y)}let x={get action(){return u},get location(){return e(l,o)},listen(g){if(c)throw new Error("A history only accepts one active listener");return l.addEventListener(c3,f),c=g,()=>{l.removeEventListener(c3,f),c=null}},createHref(g){return r(l,g)},createURL:p,encodeLocation(g){let y=p(g);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:m,go(g){return o.go(g)}};return x}var d3;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(d3||(d3={}));function NO(e,r,t){return t===void 0&&(t="/"),CO(e,r,t)}function CO(e,r,t,n){let l=typeof r=="string"?Uc(r):r,i=t1(l.pathname||"/",t);if(i==null)return null;let o=hN(e);EO(o);let u=null;for(let c=0;u==null&&c{let c={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(qr(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let s=go([n,c.relativePath]),d=t.concat(c);i.children&&i.children.length>0&&(qr(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+s+'".')),hN(i.children,r,d,s)),!(i.path==null&&!i.index)&&r.push({path:s,score:RO(s,i.index),routesMeta:d})};return e.forEach((i,o)=>{var u;if(i.path===""||!((u=i.path)!=null&&u.includes("?")))l(i,o);else for(let c of mN(i.path))l(i,o,c)}),r}function mN(e){let r=e.split("/");if(r.length===0)return[];let[t,...n]=r,l=t.endsWith("?"),i=t.replace(/\?$/,"");if(n.length===0)return l?[i,""]:[i];let o=mN(n.join("/")),u=[];return u.push(...o.map(c=>c===""?i:[i,c].join("/"))),l&&u.push(...o),u.map(c=>e.startsWith("/")&&c===""?"/":c)}function EO(e){e.sort((r,t)=>r.score!==t.score?t.score-r.score:DO(r.routesMeta.map(n=>n.childrenIndex),t.routesMeta.map(n=>n.childrenIndex)))}const AO=/^:[\w-]+$/,MO=3,OO=2,PO=1,TO=10,IO=-2,f3=e=>e==="*";function RO(e,r){let t=e.split("/"),n=t.length;return t.some(f3)&&(n+=IO),r&&(n+=OO),t.filter(l=>!f3(l)).reduce((l,i)=>l+(AO.test(i)?MO:i===""?PO:TO),n)}function DO(e,r){return e.length===r.length&&e.slice(0,-1).every((n,l)=>n===r[l])?e[e.length-1]-r[r.length-1]:0}function LO(e,r,t){let{routesMeta:n}=e,l={},i="/",o=[];for(let u=0;u{let{paramName:h,isOptional:m}=d;if(h==="*"){let x=u[f]||"";o=i.slice(0,i.length-x.length).replace(/(.)\/+$/,"$1")}const p=u[f];return m&&!p?s[h]=void 0:s[h]=(p||"").replace(/%2F/g,"/"),s},{}),pathname:i,pathnameBase:o,pattern:e}}function BO(e,r,t){r===void 0&&(r=!1),t===void 0&&(t=!0),e1(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,u,c)=>(n.push({paramName:u,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,r?void 0:"i"),n]}function zO(e){try{return e.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return e1(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+r+").")),e}}function t1(e,r){if(r==="/")return e;if(!e.toLowerCase().startsWith(r.toLowerCase()))return null;let t=r.endsWith("/")?r.length-1:r.length,n=e.charAt(t);return n&&n!=="/"?null:e.slice(t)||"/"}const $O=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,UO=e=>$O.test(e);function VO(e,r){r===void 0&&(r="/");let{pathname:t,search:n="",hash:l=""}=typeof e=="string"?Uc(e):e,i;if(t)if(UO(t))i=t;else{if(t.includes("//")){let o=t;t=t.replace(/\/\/+/g,"/"),e1(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+t))}t.startsWith("/")?i=h3(t.substring(1),"/"):i=h3(t,r)}else i=r;return{pathname:i,search:WO(n),hash:KO(l)}}function h3(e,r){let t=r.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?t.length>1&&t.pop():l!=="."&&t.push(l)}),t.length>1?t.join("/"):"/"}function ax(e,r,t,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+r+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function qO(e){return e.filter((r,t)=>t===0||r.route.path&&r.route.path.length>0)}function r1(e,r){let t=qO(e);return r?t.map((n,l)=>l===t.length-1?n.pathname:n.pathnameBase):t.map(n=>n.pathnameBase)}function n1(e,r,t,n){n===void 0&&(n=!1);let l;typeof e=="string"?l=Uc(e):(l=xd({},e),qr(!l.pathname||!l.pathname.includes("?"),ax("?","pathname","search",l)),qr(!l.pathname||!l.pathname.includes("#"),ax("#","pathname","hash",l)),qr(!l.search||!l.search.includes("#"),ax("#","search","hash",l)));let i=e===""||l.pathname==="",o=i?"/":l.pathname,u;if(o==null)u=t;else{let f=r.length-1;if(!n&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;l.pathname=h.join("/")}u=f>=0?r[f]:"/"}let c=VO(l,u),s=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&t.endsWith("/");return!c.pathname.endsWith("/")&&(s||d)&&(c.pathname+="/"),c}const go=e=>e.join("/").replace(/\/\/+/g,"/"),HO=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),WO=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,KO=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function XO(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const pN=["post","put","patch","delete"];new Set(pN);const GO=["get",...pN];new Set(GO);function bd(){return bd=Object.assign?Object.assign.bind():function(e){for(var r=1;r{u.current=!0}),R.useCallback(function(s,d){if(d===void 0&&(d={}),!u.current)return;if(typeof s=="number"){n.go(s);return}let f=n1(s,JSON.parse(o),i,d.relative==="path");e==null&&r!=="/"&&(f.pathname=f.pathname==="/"?r:go([r,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[r,n,o,i,e])}function JO(){let{matches:e}=R.useContext(Ma),r=e[e.length-1];return r?r.params:{}}function bN(e,r){let{relative:t}=r===void 0?{}:r,{future:n}=R.useContext(ko),{matches:l}=R.useContext(Ma),{pathname:i}=Vs(),o=JSON.stringify(r1(l,n.v7_relativeSplatPath));return R.useMemo(()=>n1(e,JSON.parse(o),i,t==="path"),[e,o,i,t])}function eP(e,r){return tP(e,r)}function tP(e,r,t,n){Vc()||qr(!1);let{navigator:l}=R.useContext(ko),{matches:i}=R.useContext(Ma),o=i[i.length-1],u=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let s=Vs(),d;if(r){var f;let g=typeof r=="string"?Uc(r):r;c==="/"||(f=g.pathname)!=null&&f.startsWith(c)||qr(!1),d=g}else d=s;let h=d.pathname||"/",m=h;if(c!=="/"){let g=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(g.length).join("/")}let p=NO(e,{pathname:m}),x=aP(p&&p.map(g=>Object.assign({},g,{params:Object.assign({},u,g.params),pathname:go([c,l.encodeLocation?l.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?c:go([c,l.encodeLocation?l.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),i,t,n);return r&&x?R.createElement(Sp.Provider,{value:{location:bd({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:fo.Pop}},x):x}function rP(){let e=uP(),r=XO(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),t=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return R.createElement(R.Fragment,null,R.createElement("h2",null,"Unexpected Application Error!"),R.createElement("h3",{style:{fontStyle:"italic"}},r),t?R.createElement("pre",{style:l},t):null,null)}const nP=R.createElement(rP,null);class iP extends R.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,t){return t.location!==r.location||t.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:t.error,location:t.location,revalidation:r.revalidation||t.revalidation}}componentDidCatch(r,t){console.error("React Router caught the following error during render",r,t)}render(){return this.state.error!==void 0?R.createElement(Ma.Provider,{value:this.props.routeContext},R.createElement(gN.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function sP(e){let{routeContext:r,match:t,children:n}=e,l=R.useContext(i1);return l&&l.static&&l.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=t.route.id),R.createElement(Ma.Provider,{value:r},n)}function aP(e,r,t,n){var l;if(r===void 0&&(r=[]),t===void 0&&(t=null),n===void 0&&(n=null),e==null){var i;if(!t)return null;if(t.errors)e=t.matches;else if((i=n)!=null&&i.v7_partialHydration&&r.length===0&&!t.initialized&&t.matches.length>0)e=t.matches;else return null}let o=e,u=(l=t)==null?void 0:l.errors;if(u!=null){let d=o.findIndex(f=>f.route.id&&u?.[f.route.id]!==void 0);d>=0||qr(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,s=-1;if(t&&n&&n.v7_partialHydration)for(let d=0;d=0?o=o.slice(0,s+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let m,p=!1,x=null,g=null;t&&(m=u&&f.route.id?u[f.route.id]:void 0,x=f.route.errorElement||nP,c&&(s<0&&h===0?(fP("route-fallback"),p=!0,g=null):s===h&&(p=!0,g=f.route.hydrateFallbackElement||null)));let y=r.concat(o.slice(0,h+1)),v=()=>{let _;return m?_=x:p?_=g:f.route.Component?_=R.createElement(f.route.Component,null):f.route.element?_=f.route.element:_=d,R.createElement(sP,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:t!=null},children:_})};return t&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?R.createElement(iP,{location:t.location,revalidation:t.revalidation,component:x,error:m,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):v()},null)}var yN=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(yN||{}),vN=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(vN||{});function oP(e){let r=R.useContext(i1);return r||qr(!1),r}function lP(e){let r=R.useContext(YO);return r||qr(!1),r}function cP(e){let r=R.useContext(Ma);return r||qr(!1),r}function wN(e){let r=cP(),t=r.matches[r.matches.length-1];return t.route.id||qr(!1),t.route.id}function uP(){var e;let r=R.useContext(gN),t=lP(),n=wN();return r!==void 0?r:(e=t.errors)==null?void 0:e[n]}function dP(){let{router:e}=oP(yN.UseNavigateStable),r=wN(vN.UseNavigateStable),t=R.useRef(!1);return xN(()=>{t.current=!0}),R.useCallback(function(l,i){i===void 0&&(i={}),t.current&&(typeof l=="number"?e.navigate(l):e.navigate(l,bd({fromRouteId:r},i)))},[e,r])}const m3={};function fP(e,r,t){m3[e]||(m3[e]=!0)}function hP(e,r){e?.v7_startTransition,e?.v7_relativeSplatPath}function mi(e){let{to:r,replace:t,state:n,relative:l}=e;Vc()||qr(!1);let{future:i,static:o}=R.useContext(ko),{matches:u}=R.useContext(Ma),{pathname:c}=Vs(),s=_s(),d=n1(r,r1(u,i.v7_relativeSplatPath),c,l==="path"),f=JSON.stringify(d);return R.useEffect(()=>s(JSON.parse(f),{replace:t,state:n,relative:l}),[s,f,l,t,n]),null}function Zn(e){qr(!1)}function mP(e){let{basename:r="/",children:t=null,location:n,navigationType:l=fo.Pop,navigator:i,static:o=!1,future:u}=e;Vc()&&qr(!1);let c=r.replace(/^\/*/,"/"),s=R.useMemo(()=>({basename:c,navigator:i,static:o,future:bd({v7_relativeSplatPath:!1},u)}),[c,u,i,o]);typeof n=="string"&&(n=Uc(n));let{pathname:d="/",search:f="",hash:h="",state:m=null,key:p="default"}=n,x=R.useMemo(()=>{let g=t1(d,c);return g==null?null:{location:{pathname:g,search:f,hash:h,state:m,key:p},navigationType:l}},[c,d,f,h,m,p,l]);return x==null?null:R.createElement(ko.Provider,{value:s},R.createElement(Sp.Provider,{children:t,value:x}))}function pP(e){let{children:r,location:t}=e;return eP(gy(r),t)}new Promise(()=>{});function gy(e,r){r===void 0&&(r=[]);let t=[];return R.Children.forEach(e,(n,l)=>{if(!R.isValidElement(n))return;let i=[...r,l];if(n.type===R.Fragment){t.push.apply(t,gy(n.props.children,i));return}n.type!==Zn&&qr(!1),!n.props.index||!n.props.children||qr(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=gy(n.props.children,i)),t.push(o)}),t}function xy(){return xy=Object.assign?Object.assign.bind():function(e){for(var r=1;r=0)&&(t[l]=e[l]);return t}function xP(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function bP(e,r){return e.button===0&&(!r||r==="_self")&&!xP(e)}function by(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((r,t)=>{let n=e[t];return r.concat(Array.isArray(n)?n.map(l=>[t,l]):[[t,n]])},[]))}function yP(e,r){let t=by(e);return r&&r.forEach((n,l)=>{t.has(l)||r.getAll(l).forEach(i=>{t.append(l,i)})}),t}const vP=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],wP="6";try{window.__reactRouterVersion=wP}catch{}const _P="startTransition",p3=dN[_P];function jP(e){let{basename:r,children:t,future:n,window:l}=e,i=R.useRef();i.current==null&&(i.current=jO({window:l,v5Compat:!0}));let o=i.current,[u,c]=R.useState({action:o.action,location:o.location}),{v7_startTransition:s}=n||{},d=R.useCallback(f=>{s&&p3?p3(()=>c(f)):c(f)},[c,s]);return R.useLayoutEffect(()=>o.listen(d),[o,d]),R.useEffect(()=>hP(n),[n]),R.createElement(mP,{basename:r,children:t,location:u.location,navigationType:u.action,navigator:o,future:n})}const SP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",kP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kr=R.forwardRef(function(r,t){let{onClick:n,relative:l,reloadDocument:i,replace:o,state:u,target:c,to:s,preventScrollReset:d,viewTransition:f}=r,h=gP(r,vP),{basename:m}=R.useContext(ko),p,x=!1;if(typeof s=="string"&&kP.test(s)&&(p=s,SP))try{let _=new URL(window.location.href),C=s.startsWith("//")?new URL(_.protocol+s):new URL(s),M=t1(C.pathname,m);C.origin===_.origin&&M!=null?s=M+C.search+C.hash:x=!0}catch{}let g=ZO(s,{relative:l}),y=NP(s,{replace:o,state:u,target:c,preventScrollReset:d,relative:l,viewTransition:f});function v(_){n&&n(_),_.defaultPrevented||y(_)}return R.createElement("a",xy({},h,{href:p||g,onClick:x||i?n:v,ref:t,target:c}))});var g3;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(g3||(g3={}));var x3;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(x3||(x3={}));function NP(e,r){let{target:t,replace:n,state:l,preventScrollReset:i,relative:o,viewTransition:u}=r===void 0?{}:r,c=_s(),s=Vs(),d=bN(e,{relative:o});return R.useCallback(f=>{if(bP(f,t)){f.preventDefault();let h=n!==void 0?n:gm(s)===gm(d);c(e,{replace:h,state:l,preventScrollReset:i,relative:o,viewTransition:u})}},[s,c,d,n,l,t,e,i,o,u])}function kp(e){let r=R.useRef(by(e)),t=R.useRef(!1),n=Vs(),l=R.useMemo(()=>yP(n.search,t.current?null:r.current),[n.search]),i=_s(),o=R.useCallback((u,c)=>{const s=by(typeof u=="function"?u(l):u);t.current=!0,i("?"+s,c)},[i,l]);return[l,o]}const s1=R.createContext({});function a1(e){const r=R.useRef(null);return r.current===null&&(r.current=e()),r.current}const _N=typeof window<"u",jN=_N?R.useLayoutEffect:R.useEffect,Np=R.createContext(null);function o1(e,r){e.indexOf(r)===-1&&e.push(r)}function l1(e,r){const t=e.indexOf(r);t>-1&&e.splice(t,1)}const Bs=(e,r,t)=>t>r?r:t{};const va={},SN=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function kN(e){return typeof e=="object"&&e!==null}const NN=e=>/^0[^.\s]+$/u.test(e);function u1(e){let r;return()=>(r===void 0&&(r=e()),r)}const Hi=e=>e,CP=(e,r)=>t=>r(e(t)),Ud=(...e)=>e.reduce(CP),yd=(e,r,t)=>{const n=r-e;return n===0?1:(t-e)/n};class d1{constructor(){this.subscriptions=[]}add(r){return o1(this.subscriptions,r),()=>l1(this.subscriptions,r)}notify(r,t,n){const l=this.subscriptions.length;if(l)if(l===1)this.subscriptions[0](r,t,n);else for(let i=0;ie*1e3,Ui=e=>e/1e3;function CN(e,r){return r?e*(1e3/r):0}const EN=(e,r,t)=>(((1-3*t+3*r)*e+(3*t-6*r))*e+3*r)*e,EP=1e-7,AP=12;function MP(e,r,t,n,l){let i,o,u=0;do o=r+(t-r)/2,i=EN(o,n,l)-e,i>0?t=o:r=o;while(Math.abs(i)>EP&&++uMP(i,0,1,e,t);return i=>i===0||i===1?i:EN(l(i),r,n)}const AN=e=>r=>r<=.5?e(2*r)/2:(2-e(2*(1-r)))/2,MN=e=>r=>1-e(1-r),ON=Vd(.33,1.53,.69,.99),f1=MN(ON),PN=AN(f1),TN=e=>(e*=2)<1?.5*f1(e):.5*(2-Math.pow(2,-10*(e-1))),h1=e=>1-Math.sin(Math.acos(e)),IN=MN(h1),RN=AN(h1),OP=Vd(.42,0,1,1),PP=Vd(0,0,.58,1),DN=Vd(.42,0,.58,1),TP=e=>Array.isArray(e)&&typeof e[0]!="number",LN=e=>Array.isArray(e)&&typeof e[0]=="number",IP={linear:Hi,easeIn:OP,easeInOut:DN,easeOut:PP,circIn:h1,circInOut:RN,circOut:IN,backIn:f1,backInOut:PN,backOut:ON,anticipate:TN},RP=e=>typeof e=="string",b3=e=>{if(LN(e)){c1(e.length===4);const[r,t,n,l]=e;return Vd(r,t,n,l)}else if(RP(e))return IP[e];return e},kh=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function DP(e,r){let t=new Set,n=new Set,l=!1,i=!1;const o=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function c(d){o.has(d)&&(s.schedule(d),e()),d(u)}const s={schedule:(d,f=!1,h=!1)=>{const p=h&&l?t:n;return f&&o.add(d),p.has(d)||p.add(d),d},cancel:d=>{n.delete(d),o.delete(d)},process:d=>{if(u=d,l){i=!0;return}l=!0,[t,n]=[n,t],t.forEach(c),t.clear(),l=!1,i&&(i=!1,s.process(d))}};return s}const LP=40;function FN(e,r){let t=!1,n=!0;const l={delta:0,timestamp:0,isProcessing:!1},i=()=>t=!0,o=kh.reduce((_,C)=>(_[C]=DP(i),_),{}),{setup:u,read:c,resolveKeyframes:s,preUpdate:d,update:f,preRender:h,render:m,postRender:p}=o,x=()=>{const _=va.useManualTiming?l.timestamp:performance.now();t=!1,va.useManualTiming||(l.delta=n?1e3/60:Math.max(Math.min(_-l.timestamp,LP),1)),l.timestamp=_,l.isProcessing=!0,u.process(l),c.process(l),s.process(l),d.process(l),f.process(l),h.process(l),m.process(l),p.process(l),l.isProcessing=!1,t&&r&&(n=!1,e(x))},g=()=>{t=!0,n=!0,l.isProcessing||e(x)};return{schedule:kh.reduce((_,C)=>{const M=o[C];return _[C]=(T,U=!1,F=!1)=>(t||g(),M.schedule(T,U,F)),_},{}),cancel:_=>{for(let C=0;C(tm===void 0&&Jn.set(kn.isProcessing||va.useManualTiming?kn.timestamp:performance.now()),tm),set:e=>{tm=e,queueMicrotask(FP)}},BN=e=>r=>typeof r=="string"&&r.startsWith(e),zN=BN("--"),BP=BN("var(--"),m1=e=>BP(e)?zP.test(e.split("/*")[0].trim()):!1,zP=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function y3(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const qc={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},vd={...qc,transform:e=>Bs(0,1,e)},Nh={...qc,default:1},ud=e=>Math.round(e*1e5)/1e5,p1=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function $P(e){return e==null}const UP=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,g1=(e,r)=>t=>!!(typeof t=="string"&&UP.test(t)&&t.startsWith(e)||r&&!$P(t)&&Object.prototype.hasOwnProperty.call(t,r)),$N=(e,r,t)=>n=>{if(typeof n!="string")return n;const[l,i,o,u]=n.match(p1);return{[e]:parseFloat(l),[r]:parseFloat(i),[t]:parseFloat(o),alpha:u!==void 0?parseFloat(u):1}},VP=e=>Bs(0,255,e),lx={...qc,transform:e=>Math.round(VP(e))},dl={test:g1("rgb","red"),parse:$N("red","green","blue"),transform:({red:e,green:r,blue:t,alpha:n=1})=>"rgba("+lx.transform(e)+", "+lx.transform(r)+", "+lx.transform(t)+", "+ud(vd.transform(n))+")"};function qP(e){let r="",t="",n="",l="";return e.length>5?(r=e.substring(1,3),t=e.substring(3,5),n=e.substring(5,7),l=e.substring(7,9)):(r=e.substring(1,2),t=e.substring(2,3),n=e.substring(3,4),l=e.substring(4,5),r+=r,t+=t,n+=n,l+=l),{red:parseInt(r,16),green:parseInt(t,16),blue:parseInt(n,16),alpha:l?parseInt(l,16)/255:1}}const yy={test:g1("#"),parse:qP,transform:dl.transform},qd=e=>({test:r=>typeof r=="string"&&r.endsWith(e)&&r.split(" ").length===1,parse:parseFloat,transform:r=>`${r}${e}`}),oo=qd("deg"),Ls=qd("%"),ft=qd("px"),HP=qd("vh"),WP=qd("vw"),v3={...Ls,parse:e=>Ls.parse(e)/100,transform:e=>Ls.transform(e*100)},_c={test:g1("hsl","hue"),parse:$N("hue","saturation","lightness"),transform:({hue:e,saturation:r,lightness:t,alpha:n=1})=>"hsla("+Math.round(e)+", "+Ls.transform(ud(r))+", "+Ls.transform(ud(t))+", "+ud(vd.transform(n))+")"},Xr={test:e=>dl.test(e)||yy.test(e)||_c.test(e),parse:e=>dl.test(e)?dl.parse(e):_c.test(e)?_c.parse(e):yy.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?dl.transform(e):_c.transform(e),getAnimatableNone:e=>{const r=Xr.parse(e);return r.alpha=0,Xr.transform(r)}},KP=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function XP(e){return isNaN(e)&&typeof e=="string"&&(e.match(p1)?.length||0)+(e.match(KP)?.length||0)>0}const UN="number",VN="color",GP="var",YP="var(",w3="${}",ZP=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function wd(e){const r=e.toString(),t=[],n={color:[],number:[],var:[]},l=[];let i=0;const u=r.replace(ZP,c=>(Xr.test(c)?(n.color.push(i),l.push(VN),t.push(Xr.parse(c))):c.startsWith(YP)?(n.var.push(i),l.push(GP),t.push(c)):(n.number.push(i),l.push(UN),t.push(parseFloat(c))),++i,w3)).split(w3);return{values:t,split:u,indexes:n,types:l}}function qN(e){return wd(e).values}function HN(e){const{split:r,types:t}=wd(e),n=r.length;return l=>{let i="";for(let o=0;otypeof e=="number"?0:Xr.test(e)?Xr.getAnimatableNone(e):e;function JP(e){const r=qN(e);return HN(e)(r.map(QP))}const vo={test:XP,parse:qN,createTransformer:HN,getAnimatableNone:JP};function cx(e,r,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?e+(r-e)*6*t:t<1/2?r:t<2/3?e+(r-e)*(2/3-t)*6:e}function eT({hue:e,saturation:r,lightness:t,alpha:n}){e/=360,r/=100,t/=100;let l=0,i=0,o=0;if(!r)l=i=o=t;else{const u=t<.5?t*(1+r):t+r-t*r,c=2*t-u;l=cx(c,u,e+1/3),i=cx(c,u,e),o=cx(c,u,e-1/3)}return{red:Math.round(l*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:n}}function xm(e,r){return t=>t>0?r:e}const Ir=(e,r,t)=>e+(r-e)*t,ux=(e,r,t)=>{const n=e*e,l=t*(r*r-n)+n;return l<0?0:Math.sqrt(l)},tT=[yy,dl,_c],rT=e=>tT.find(r=>r.test(e));function _3(e){const r=rT(e);if(!r)return!1;let t=r.parse(e);return r===_c&&(t=eT(t)),t}const j3=(e,r)=>{const t=_3(e),n=_3(r);if(!t||!n)return xm(e,r);const l={...t};return i=>(l.red=ux(t.red,n.red,i),l.green=ux(t.green,n.green,i),l.blue=ux(t.blue,n.blue,i),l.alpha=Ir(t.alpha,n.alpha,i),dl.transform(l))},vy=new Set(["none","hidden"]);function nT(e,r){return vy.has(e)?t=>t<=0?e:r:t=>t>=1?r:e}function iT(e,r){return t=>Ir(e,r,t)}function x1(e){return typeof e=="number"?iT:typeof e=="string"?m1(e)?xm:Xr.test(e)?j3:oT:Array.isArray(e)?WN:typeof e=="object"?Xr.test(e)?j3:sT:xm}function WN(e,r){const t=[...e],n=t.length,l=e.map((i,o)=>x1(i)(i,r[o]));return i=>{for(let o=0;o{for(const i in n)t[i]=n[i](l);return t}}function aT(e,r){const t=[],n={color:0,var:0,number:0};for(let l=0;l{const t=vo.createTransformer(r),n=wd(e),l=wd(r);return n.indexes.var.length===l.indexes.var.length&&n.indexes.color.length===l.indexes.color.length&&n.indexes.number.length>=l.indexes.number.length?vy.has(e)&&!l.values.length||vy.has(r)&&!n.values.length?nT(e,r):Ud(WN(aT(n,l),l.values),t):xm(e,r)};function KN(e,r,t){return typeof e=="number"&&typeof r=="number"&&typeof t=="number"?Ir(e,r,t):x1(e)(e,r)}const lT=e=>{const r=({timestamp:t})=>e(t);return{start:(t=!0)=>jr.update(r,t),stop:()=>yo(r),now:()=>kn.isProcessing?kn.timestamp:Jn.now()}},XN=(e,r,t=10)=>{let n="";const l=Math.max(Math.round(r/t),2);for(let i=0;i=bm?1/0:r}function cT(e,r=100,t){const n=t({...e,keyframes:[0,r]}),l=Math.min(b1(n),bm);return{type:"keyframes",ease:i=>n.next(l*i).value/r,duration:Ui(l)}}const uT=5;function GN(e,r,t){const n=Math.max(r-uT,0);return CN(t-e(n),r-n)}const Br={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},dx=.001;function dT({duration:e=Br.duration,bounce:r=Br.bounce,velocity:t=Br.velocity,mass:n=Br.mass}){let l,i,o=1-r;o=Bs(Br.minDamping,Br.maxDamping,o),e=Bs(Br.minDuration,Br.maxDuration,Ui(e)),o<1?(l=s=>{const d=s*o,f=d*e,h=d-t,m=wy(s,o),p=Math.exp(-f);return dx-h/m*p},i=s=>{const f=s*o*e,h=f*t+t,m=Math.pow(o,2)*Math.pow(s,2)*e,p=Math.exp(-f),x=wy(Math.pow(s,2),o);return(-l(s)+dx>0?-1:1)*((h-m)*p)/x}):(l=s=>{const d=Math.exp(-s*e),f=(s-t)*e+1;return-dx+d*f},i=s=>{const d=Math.exp(-s*e),f=(t-s)*(e*e);return d*f});const u=5/e,c=hT(l,i,u);if(e=ga(e),isNaN(c))return{stiffness:Br.stiffness,damping:Br.damping,duration:e};{const s=Math.pow(c,2)*n;return{stiffness:s,damping:o*2*Math.sqrt(n*s),duration:e}}}const fT=12;function hT(e,r,t){let n=t;for(let l=1;le[t]!==void 0)}function gT(e){let r={velocity:Br.velocity,stiffness:Br.stiffness,damping:Br.damping,mass:Br.mass,isResolvedFromDuration:!1,...e};if(!S3(e,pT)&&S3(e,mT))if(e.visualDuration){const t=e.visualDuration,n=2*Math.PI/(t*1.2),l=n*n,i=2*Bs(.05,1,1-(e.bounce||0))*Math.sqrt(l);r={...r,mass:Br.mass,stiffness:l,damping:i}}else{const t=dT(e);r={...r,...t,mass:Br.mass},r.isResolvedFromDuration=!0}return r}function ym(e=Br.visualDuration,r=Br.bounce){const t=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:r}:e;let{restSpeed:n,restDelta:l}=t;const i=t.keyframes[0],o=t.keyframes[t.keyframes.length-1],u={done:!1,value:i},{stiffness:c,damping:s,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=gT({...t,velocity:-Ui(t.velocity||0)}),p=h||0,x=s/(2*Math.sqrt(c*d)),g=o-i,y=Ui(Math.sqrt(c/d)),v=Math.abs(g)<5;n||(n=v?Br.restSpeed.granular:Br.restSpeed.default),l||(l=v?Br.restDelta.granular:Br.restDelta.default);let _;if(x<1){const M=wy(y,x);_=T=>{const U=Math.exp(-x*y*T);return o-U*((p+x*y*g)/M*Math.sin(M*T)+g*Math.cos(M*T))}}else if(x===1)_=M=>o-Math.exp(-y*M)*(g+(p+y*g)*M);else{const M=y*Math.sqrt(x*x-1);_=T=>{const U=Math.exp(-x*y*T),F=Math.min(M*T,300);return o-U*((p+x*y*g)*Math.sinh(F)+M*g*Math.cosh(F))/M}}const C={calculatedDuration:m&&f||null,next:M=>{const T=_(M);if(m)u.done=M>=f;else{let U=M===0?p:0;x<1&&(U=M===0?ga(p):GN(_,M,T));const F=Math.abs(U)<=n,H=Math.abs(o-T)<=l;u.done=F&&H}return u.value=u.done?o:T,u},toString:()=>{const M=Math.min(b1(C),bm),T=XN(U=>C.next(M*U).value,M,30);return M+"ms "+T},toTransition:()=>{}};return C}ym.applyToOptions=e=>{const r=cT(e,100,ym);return e.ease=r.ease,e.duration=ga(r.duration),e.type="keyframes",e};function _y({keyframes:e,velocity:r=0,power:t=.8,timeConstant:n=325,bounceDamping:l=10,bounceStiffness:i=500,modifyTarget:o,min:u,max:c,restDelta:s=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},m=F=>u!==void 0&&Fc,p=F=>u===void 0?c:c===void 0||Math.abs(u-F)-x*Math.exp(-F/n),_=F=>y+v(F),C=F=>{const H=v(F),W=_(F);h.done=Math.abs(H)<=s,h.value=h.done?y:W};let M,T;const U=F=>{m(h.value)&&(M=F,T=ym({keyframes:[h.value,p(h.value)],velocity:GN(_,F,h.value),damping:l,stiffness:i,restDelta:s,restSpeed:d}))};return U(0),{calculatedDuration:null,next:F=>{let H=!1;return!T&&M===void 0&&(H=!0,C(F),U(F)),M!==void 0&&F>=M?T.next(F-M):(!H&&C(F),h)}}}function xT(e,r,t){const n=[],l=t||va.mix||KN,i=e.length-1;for(let o=0;or[0];if(i===2&&r[0]===r[1])return()=>r[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),r=[...r].reverse());const u=xT(r,n,l),c=u.length,s=d=>{if(o&&d1)for(;fs(Bs(e[0],e[i-1],d)):s}function yT(e,r){const t=e[e.length-1];for(let n=1;n<=r;n++){const l=yd(0,r,n);e.push(Ir(t,1,l))}}function vT(e){const r=[0];return yT(r,e.length-1),r}function wT(e,r){return e.map(t=>t*r)}function _T(e,r){return e.map(()=>r||DN).splice(0,e.length-1)}function dd({duration:e=300,keyframes:r,times:t,ease:n="easeInOut"}){const l=TP(n)?n.map(b3):b3(n),i={done:!1,value:r[0]},o=wT(t&&t.length===r.length?t:vT(r),e),u=bT(o,r,{ease:Array.isArray(l)?l:_T(r,l)});return{calculatedDuration:e,next:c=>(i.value=u(c),i.done=c>=e,i)}}const jT=e=>e!==null;function y1(e,{repeat:r,repeatType:t="loop"},n,l=1){const i=e.filter(jT),u=l<0||r&&t!=="loop"&&r%2===1?0:i.length-1;return!u||n===void 0?i[u]:n}const ST={decay:_y,inertia:_y,tween:dd,keyframes:dd,spring:ym};function YN(e){typeof e.type=="string"&&(e.type=ST[e.type])}class v1{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(r=>{this.resolve=r})}notifyFinished(){this.resolve()}then(r,t){return this.finished.then(r,t)}}const kT=e=>e/100;class w1 extends v1{constructor(r){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==Jn.now()&&this.tick(Jn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=r,this.initAnimation(),this.play(),r.autoplay===!1&&this.pause()}initAnimation(){const{options:r}=this;YN(r);const{type:t=dd,repeat:n=0,repeatDelay:l=0,repeatType:i,velocity:o=0}=r;let{keyframes:u}=r;const c=t||dd;c!==dd&&typeof u[0]!="number"&&(this.mixKeyframes=Ud(kT,KN(u[0],u[1])),u=[0,100]);const s=c({...r,keyframes:u});i==="mirror"&&(this.mirroredGenerator=c({...r,keyframes:[...u].reverse(),velocity:-o})),s.calculatedDuration===null&&(s.calculatedDuration=b1(s));const{calculatedDuration:d}=s;this.calculatedDuration=d,this.resolvedDuration=d+l,this.totalDuration=this.resolvedDuration*(n+1)-l,this.generator=s}updateTime(r){const t=Math.round(r-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t}tick(r,t=!1){const{generator:n,totalDuration:l,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:u,calculatedDuration:c}=this;if(this.startTime===null)return n.next(0);const{delay:s=0,keyframes:d,repeat:f,repeatType:h,repeatDelay:m,type:p,onUpdate:x,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,r):this.speed<0&&(this.startTime=Math.min(r-l/this.speed,this.startTime)),t?this.currentTime=r:this.updateTime(r);const y=this.currentTime-s*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>l;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=l);let _=this.currentTime,C=n;if(f){const F=Math.min(this.currentTime,l)/u;let H=Math.floor(F),W=F%1;!W&&F>=1&&(W=1),W===1&&H--,H=Math.min(H,f+1),H%2&&(h==="reverse"?(W=1-W,m&&(W-=m/u)):h==="mirror"&&(C=o)),_=Bs(0,1,W)*u}const M=v?{done:!1,value:d[0]}:C.next(_);i&&(M.value=i(M.value));let{done:T}=M;!v&&c!==null&&(T=this.playbackSpeed>=0?this.currentTime>=l:this.currentTime<=0);const U=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return U&&p!==_y&&(M.value=y1(d,this.options,g,this.speed)),x&&x(M.value),U&&this.finish(),M}then(r,t){return this.finished.then(r,t)}get duration(){return Ui(this.calculatedDuration)}get iterationDuration(){const{delay:r=0}=this.options||{};return this.duration+Ui(r)}get time(){return Ui(this.currentTime)}set time(r){r=ga(r),this.currentTime=r,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=r:this.driver&&(this.startTime=this.driver.now()-r/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(r){this.updateTime(Jn.now());const t=this.playbackSpeed!==r;this.playbackSpeed=r,t&&(this.time=Ui(this.currentTime))}play(){if(this.isStopped)return;const{driver:r=lT,startTime:t}=this.options;this.driver||(this.driver=r(l=>this.tick(l))),this.options.onPlay?.();const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=t??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Jn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(r){return this.startTime=0,this.tick(r,!0)}attachTimeline(r){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),r.observe(this)}}function NT(e){for(let r=1;re*180/Math.PI,jy=e=>{const r=fl(Math.atan2(e[1],e[0]));return Sy(r)},CT={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:jy,rotateZ:jy,skewX:e=>fl(Math.atan(e[1])),skewY:e=>fl(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Sy=e=>(e=e%360,e<0&&(e+=360),e),k3=jy,N3=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),C3=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),ET={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:N3,scaleY:C3,scale:e=>(N3(e)+C3(e))/2,rotateX:e=>Sy(fl(Math.atan2(e[6],e[5]))),rotateY:e=>Sy(fl(Math.atan2(-e[2],e[0]))),rotateZ:k3,rotate:k3,skewX:e=>fl(Math.atan(e[4])),skewY:e=>fl(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ky(e){return e.includes("scale")?1:0}function Ny(e,r){if(!e||e==="none")return ky(r);const t=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,l;if(t)n=ET,l=t;else{const u=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=CT,l=u}if(!l)return ky(r);const i=n[r],o=l[1].split(",").map(MT);return typeof i=="function"?i(o):o[i]}const AT=(e,r)=>{const{transform:t="none"}=getComputedStyle(e);return Ny(t,r)};function MT(e){return parseFloat(e.trim())}const Hc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Wc=new Set(Hc),E3=e=>e===qc||e===ft,OT=new Set(["x","y","z"]),PT=Hc.filter(e=>!OT.has(e));function TT(e){const r=[];return PT.forEach(t=>{const n=e.getValue(t);n!==void 0&&(r.push([t,n.get()]),n.set(t.startsWith("scale")?1:0))}),r}const ho={width:({x:e},{paddingLeft:r="0",paddingRight:t="0"})=>e.max-e.min-parseFloat(r)-parseFloat(t),height:({y:e},{paddingTop:r="0",paddingBottom:t="0"})=>e.max-e.min-parseFloat(r)-parseFloat(t),top:(e,{top:r})=>parseFloat(r),left:(e,{left:r})=>parseFloat(r),bottom:({y:e},{top:r})=>parseFloat(r)+(e.max-e.min),right:({x:e},{left:r})=>parseFloat(r)+(e.max-e.min),x:(e,{transform:r})=>Ny(r,"x"),y:(e,{transform:r})=>Ny(r,"y")};ho.translateX=ho.x;ho.translateY=ho.y;const bl=new Set;let Cy=!1,Ey=!1,Ay=!1;function ZN(){if(Ey){const e=Array.from(bl).filter(n=>n.needsMeasurement),r=new Set(e.map(n=>n.element)),t=new Map;r.forEach(n=>{const l=TT(n);l.length&&(t.set(n,l),n.render())}),e.forEach(n=>n.measureInitialState()),r.forEach(n=>{n.render();const l=t.get(n);l&&l.forEach(([i,o])=>{n.getValue(i)?.set(o)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Ey=!1,Cy=!1,bl.forEach(e=>e.complete(Ay)),bl.clear()}function QN(){bl.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ey=!0)})}function IT(){Ay=!0,QN(),ZN(),Ay=!1}class _1{constructor(r,t,n,l,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...r],this.onComplete=t,this.name=n,this.motionValue=l,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(bl.add(this),Cy||(Cy=!0,jr.read(QN),jr.resolveKeyframes(ZN))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:r,name:t,element:n,motionValue:l}=this;if(r[0]===null){const i=l?.get(),o=r[r.length-1];if(i!==void 0)r[0]=i;else if(n&&t){const u=n.readValue(t,o);u!=null&&(r[0]=u)}r[0]===void 0&&(r[0]=o),l&&i===void 0&&l.set(r[0])}NT(r)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(r=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,r),bl.delete(this)}cancel(){this.state==="scheduled"&&(bl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const RT=e=>e.startsWith("--");function DT(e,r,t){RT(r)?e.style.setProperty(r,t):e.style[r]=t}const LT=u1(()=>window.ScrollTimeline!==void 0),FT={};function BT(e,r){const t=u1(e);return()=>FT[r]??t()}const JN=BT(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),sd=([e,r,t,n])=>`cubic-bezier(${e}, ${r}, ${t}, ${n})`,A3={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:sd([0,.65,.55,1]),circOut:sd([.55,0,1,.45]),backIn:sd([.31,.01,.66,-.59]),backOut:sd([.33,1.53,.69,.99])};function e8(e,r){if(e)return typeof e=="function"?JN()?XN(e,r):"ease-out":LN(e)?sd(e):Array.isArray(e)?e.map(t=>e8(t,r)||A3.easeOut):A3[e]}function zT(e,r,t,{delay:n=0,duration:l=300,repeat:i=0,repeatType:o="loop",ease:u="easeOut",times:c}={},s=void 0){const d={[r]:t};c&&(d.offset=c);const f=e8(u,l);Array.isArray(f)&&(d.easing=f);const h={delay:n,duration:l,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return s&&(h.pseudoElement=s),e.animate(d,h)}function t8(e){return typeof e=="function"&&"applyToOptions"in e}function $T({type:e,...r}){return t8(e)&&JN()?e.applyToOptions(r):(r.duration??(r.duration=300),r.ease??(r.ease="easeOut"),r)}class UT extends v1{constructor(r){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!r)return;const{element:t,name:n,keyframes:l,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:u,onComplete:c}=r;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=r,c1(typeof r.type!="string");const s=$T(r);this.animation=zT(t,n,l,s,i),s.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=y1(l,this.options,u,this.speed);this.updateMotionValue?this.updateMotionValue(d):DT(t,n,d),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:r}=this;r==="idle"||r==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const r=this.animation.effect?.getComputedTiming?.().duration||0;return Ui(Number(r))}get iterationDuration(){const{delay:r=0}=this.options||{};return this.duration+Ui(r)}get time(){return Ui(Number(this.animation.currentTime)||0)}set time(r){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ga(r)}get speed(){return this.animation.playbackRate}set speed(r){r<0&&(this.finishedTime=null),this.animation.playbackRate=r}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(r){this.manualStartTime=this.animation.startTime=r}attachTimeline({timeline:r,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,r&<()?(this.animation.timeline=r,Hi):t(this)}}const r8={anticipate:TN,backInOut:PN,circInOut:RN};function VT(e){return e in r8}function qT(e){typeof e.ease=="string"&&VT(e.ease)&&(e.ease=r8[e.ease])}const fx=10;class HT extends UT{constructor(r){qT(r),YN(r),super(r),r.startTime!==void 0&&(this.startTime=r.startTime),this.options=r}updateMotionValue(r){const{motionValue:t,onUpdate:n,onComplete:l,element:i,...o}=this.options;if(!t)return;if(r!==void 0){t.set(r);return}const u=new w1({...o,autoplay:!1}),c=Math.max(fx,Jn.now()-this.startTime),s=Bs(0,fx,c-fx);t.setWithVelocity(u.sample(Math.max(0,c-s)).value,u.sample(c).value,s),u.stop()}}const M3=(e,r)=>r==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(vo.test(e)||e==="0")&&!e.startsWith("url("));function WT(e){const r=e[0];if(e.length===1)return!0;for(let t=0;tObject.hasOwnProperty.call(Element.prototype,"animate"));function YT(e){const{motionValue:r,name:t,repeatDelay:n,repeatType:l,damping:i,type:o}=e;if(!(r?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:s}=r.owner.getProps();return GT()&&t&&XT.has(t)&&(t!=="transform"||!s)&&!c&&!n&&l!=="mirror"&&i!==0&&o!=="inertia"}const ZT=40;class QT extends v1{constructor({autoplay:r=!0,delay:t=0,type:n="keyframes",repeat:l=0,repeatDelay:i=0,repeatType:o="loop",keyframes:u,name:c,motionValue:s,element:d,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Jn.now();const h={autoplay:r,delay:t,type:n,repeat:l,repeatDelay:i,repeatType:o,name:c,motionValue:s,element:d,...f},m=d?.KeyframeResolver||_1;this.keyframeResolver=new m(u,(p,x,g)=>this.onKeyframesResolved(p,x,h,!g),c,s,d),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(r,t,n,l){this.keyframeResolver=void 0;const{name:i,type:o,velocity:u,delay:c,isHandoff:s,onUpdate:d}=n;this.resolvedAt=Jn.now(),KT(r,i,o,u)||((va.instantAnimations||!c)&&d?.(y1(r,n,t)),r[0]=r[r.length-1],My(n),n.repeat=0);const h={startTime:l?this.resolvedAt?this.resolvedAt-this.createdAt>ZT?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:r},m=!s&&YT(h),p=h.motionValue?.owner?.current,x=m?new HT({...h,element:p}):new w1(h);x.finished.then(()=>{this.notifyFinished()}).catch(Hi),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(r,t){return this.finished.finally(r).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),IT()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(r){this.animation.time=r}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(r){this.animation.speed=r}get startTime(){return this.animation.startTime}attachTimeline(r){return this._animation?this.stopTimeline=this.animation.attachTimeline(r):this.pendingTimeline=r,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function n8(e,r,t,n=0,l=1){const i=Array.from(e).sort((s,d)=>s.sortNodePosition(d)).indexOf(r),o=e.size,u=(o-1)*n;return typeof t=="function"?t(i,o):l===1?i*n:u-i*n}const JT=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function eI(e){const r=JT.exec(e);if(!r)return[,];const[,t,n,l]=r;return[`--${t??n}`,l]}function i8(e,r,t=1){const[n,l]=eI(e);if(!n)return;const i=window.getComputedStyle(r).getPropertyValue(n);if(i){const o=i.trim();return SN(o)?parseFloat(o):o}return m1(l)?i8(l,r,t+1):l}const tI={type:"spring",stiffness:500,damping:25,restSpeed:10},rI=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),nI={type:"keyframes",duration:.8},iI={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},sI=(e,{keyframes:r})=>r.length>2?nI:Wc.has(e)?e.startsWith("scale")?rI(r[1]):tI:iI,aI=e=>e!==null;function oI(e,{repeat:r,repeatType:t="loop"},n){const l=e.filter(aI),i=r&&t!=="loop"&&r%2===1?0:l.length-1;return l[i]}function j1(e,r){return e?.[r]??e?.default??e}function lI({when:e,delay:r,delayChildren:t,staggerChildren:n,staggerDirection:l,repeat:i,repeatType:o,repeatDelay:u,from:c,elapsed:s,...d}){return!!Object.keys(d).length}const S1=(e,r,t,n={},l,i)=>o=>{const u=j1(n,e)||{},c=u.delay||n.delay||0;let{elapsed:s=0}=n;s=s-ga(c);const d={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:r.getVelocity(),...u,delay:-s,onUpdate:h=>{r.set(h),u.onUpdate&&u.onUpdate(h)},onComplete:()=>{o(),u.onComplete&&u.onComplete()},name:e,motionValue:r,element:i?void 0:l};lI(u)||Object.assign(d,sI(e,d)),d.duration&&(d.duration=ga(d.duration)),d.repeatDelay&&(d.repeatDelay=ga(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(My(d),d.delay===0&&(f=!0)),(va.instantAnimations||va.skipAnimations)&&(f=!0,My(d),d.delay=0),d.allowFlatten=!u.type&&!u.ease,f&&!i&&r.get()!==void 0){const h=oI(d.keyframes,u);if(h!==void 0){jr.update(()=>{d.onUpdate(h),d.onComplete()});return}}return u.isSync?new w1(d):new QT(d)};function O3(e){const r=[{},{}];return e?.values.forEach((t,n)=>{r[0][n]=t.get(),r[1][n]=t.getVelocity()}),r}function k1(e,r,t,n){if(typeof r=="function"){const[l,i]=O3(n);r=r(t!==void 0?t:e.custom,l,i)}if(typeof r=="string"&&(r=e.variants&&e.variants[r]),typeof r=="function"){const[l,i]=O3(n);r=r(t!==void 0?t:e.custom,l,i)}return r}function Ec(e,r,t){const n=e.getProps();return k1(n,r,t!==void 0?t:n.custom,e)}const s8=new Set(["width","height","top","left","right","bottom",...Hc]),P3=30,cI=e=>!isNaN(parseFloat(e));class uI{constructor(r,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{const l=Jn.now();if(this.updatedAt!==l&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(r),this.owner=t.owner}setCurrent(r){this.current=r,this.updatedAt=Jn.now(),this.canTrackVelocity===null&&r!==void 0&&(this.canTrackVelocity=cI(this.current))}setPrevFrameValue(r=this.current){this.prevFrameValue=r,this.prevUpdatedAt=this.updatedAt}onChange(r){return this.on("change",r)}on(r,t){this.events[r]||(this.events[r]=new d1);const n=this.events[r].add(t);return r==="change"?()=>{n(),jr.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const r in this.events)this.events[r].clear()}attach(r,t){this.passiveEffect=r,this.stopPassiveEffect=t}set(r){this.passiveEffect?this.passiveEffect(r,this.updateAndNotify):this.updateAndNotify(r)}setWithVelocity(r,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=r,this.prevUpdatedAt=this.updatedAt-n}jump(r,t=!0){this.updateAndNotify(r),this.prev=r,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(r){this.dependents||(this.dependents=new Set),this.dependents.add(r)}removeDependent(r){this.dependents&&this.dependents.delete(r)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const r=Jn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||r-this.updatedAt>P3)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,P3);return CN(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(r){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=r(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Oc(e,r){return new uI(e,r)}const Oy=e=>Array.isArray(e);function dI(e,r,t){e.hasValue(r)?e.getValue(r).set(t):e.addValue(r,Oc(t))}function fI(e){return Oy(e)?e[e.length-1]||0:e}function hI(e,r){const t=Ec(e,r);let{transitionEnd:n={},transition:l={},...i}=t||{};i={...i,...n};for(const o in i){const u=fI(i[o]);dI(e,o,u)}}const $n=e=>!!(e&&e.getVelocity);function mI(e){return!!($n(e)&&e.add)}function Py(e,r){const t=e.getValue("willChange");if(mI(t))return t.add(r);if(!t&&va.WillChange){const n=new va.WillChange("auto");e.addValue("willChange",n),n.add(r)}}function N1(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}const pI="framerAppearId",a8="data-"+N1(pI);function o8(e){return e.props[a8]}function gI({protectedKeys:e,needsAnimating:r},t){const n=e.hasOwnProperty(t)&&r[t]!==!0;return r[t]=!1,n}function l8(e,r,{delay:t=0,transitionOverride:n,type:l}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:o,...u}=r;n&&(i=n);const c=[],s=l&&e.animationState&&e.animationState.getState()[l];for(const d in u){const f=e.getValue(d,e.latestValues[d]??null),h=u[d];if(h===void 0||s&&gI(s,d))continue;const m={delay:t,...j1(i||{},d)},p=f.get();if(p!==void 0&&!f.isAnimating&&!Array.isArray(h)&&h===p&&!m.velocity)continue;let x=!1;if(window.MotionHandoffAnimation){const y=o8(e);if(y){const v=window.MotionHandoffAnimation(y,d,jr);v!==null&&(m.startTime=v,x=!0)}}Py(e,d),f.start(S1(d,f,h,e.shouldReduceMotion&&s8.has(d)?{type:!1}:m,e,x));const g=f.animation;g&&c.push(g)}return o&&Promise.all(c).then(()=>{jr.update(()=>{o&&hI(e,o)})}),c}function Ty(e,r,t={}){const n=Ec(e,r,t.type==="exit"?e.presenceContext?.custom:void 0);let{transition:l=e.getDefaultTransition()||{}}=n||{};t.transitionOverride&&(l=t.transitionOverride);const i=n?()=>Promise.all(l8(e,n,t)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:s=0,staggerChildren:d,staggerDirection:f}=l;return xI(e,r,c,s,d,f,t)}:()=>Promise.resolve(),{when:u}=l;if(u){const[c,s]=u==="beforeChildren"?[i,o]:[o,i];return c().then(()=>s())}else return Promise.all([i(),o(t.delay)])}function xI(e,r,t=0,n=0,l=0,i=1,o){const u=[];for(const c of e.variantChildren)c.notify("AnimationStart",r),u.push(Ty(c,r,{...o,delay:t+(typeof n=="function"?0:n)+n8(e.variantChildren,c,n,l,i)}).then(()=>c.notify("AnimationComplete",r)));return Promise.all(u)}function bI(e,r,t={}){e.notify("AnimationStart",r);let n;if(Array.isArray(r)){const l=r.map(i=>Ty(e,i,t));n=Promise.all(l)}else if(typeof r=="string")n=Ty(e,r,t);else{const l=typeof r=="function"?Ec(e,r,t.custom):r;n=Promise.all(l8(e,l,t))}return n.then(()=>{e.notify("AnimationComplete",r)})}const yI={test:e=>e==="auto",parse:e=>e},c8=e=>r=>r.test(e),u8=[qc,ft,Ls,oo,WP,HP,yI],T3=e=>u8.find(c8(e));function vI(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||NN(e):!0}const wI=new Set(["brightness","contrast","saturate","opacity"]);function _I(e){const[r,t]=e.slice(0,-1).split("(");if(r==="drop-shadow")return e;const[n]=t.match(p1)||[];if(!n)return e;const l=t.replace(n,"");let i=wI.has(r)?1:0;return n!==t&&(i*=100),r+"("+i+l+")"}const jI=/\b([a-z-]*)\(.*?\)/gu,Iy={...vo,getAnimatableNone:e=>{const r=e.match(jI);return r?r.map(_I).join(" "):e}},I3={...qc,transform:Math.round},SI={rotate:oo,rotateX:oo,rotateY:oo,rotateZ:oo,scale:Nh,scaleX:Nh,scaleY:Nh,scaleZ:Nh,skew:oo,skewX:oo,skewY:oo,distance:ft,translateX:ft,translateY:ft,translateZ:ft,x:ft,y:ft,z:ft,perspective:ft,transformPerspective:ft,opacity:vd,originX:v3,originY:v3,originZ:ft},C1={borderWidth:ft,borderTopWidth:ft,borderRightWidth:ft,borderBottomWidth:ft,borderLeftWidth:ft,borderRadius:ft,radius:ft,borderTopLeftRadius:ft,borderTopRightRadius:ft,borderBottomRightRadius:ft,borderBottomLeftRadius:ft,width:ft,maxWidth:ft,height:ft,maxHeight:ft,top:ft,right:ft,bottom:ft,left:ft,inset:ft,insetBlock:ft,insetBlockStart:ft,insetBlockEnd:ft,insetInline:ft,insetInlineStart:ft,insetInlineEnd:ft,padding:ft,paddingTop:ft,paddingRight:ft,paddingBottom:ft,paddingLeft:ft,paddingBlock:ft,paddingBlockStart:ft,paddingBlockEnd:ft,paddingInline:ft,paddingInlineStart:ft,paddingInlineEnd:ft,margin:ft,marginTop:ft,marginRight:ft,marginBottom:ft,marginLeft:ft,marginBlock:ft,marginBlockStart:ft,marginBlockEnd:ft,marginInline:ft,marginInlineStart:ft,marginInlineEnd:ft,backgroundPositionX:ft,backgroundPositionY:ft,...SI,zIndex:I3,fillOpacity:vd,strokeOpacity:vd,numOctaves:I3},kI={...C1,color:Xr,backgroundColor:Xr,outlineColor:Xr,fill:Xr,stroke:Xr,borderColor:Xr,borderTopColor:Xr,borderRightColor:Xr,borderBottomColor:Xr,borderLeftColor:Xr,filter:Iy,WebkitFilter:Iy},d8=e=>kI[e];function f8(e,r){let t=d8(e);return t!==Iy&&(t=vo),t.getAnimatableNone?t.getAnimatableNone(r):void 0}const NI=new Set(["auto","none","0"]);function CI(e,r,t){let n=0,l;for(;n{r.getValue(u).set(c)}),this.resolveNoneKeyframes()}}function AI(e,r,t){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;const l=t?.[e]??n.querySelectorAll(e);return l?Array.from(l):[]}return Array.from(e)}const h8=(e,r)=>r&&typeof e=="number"?r.transform(e):e;function m8(e){return kN(e)&&"offsetHeight"in e}const{schedule:E1}=FN(queueMicrotask,!1),fs={x:!1,y:!1};function p8(){return fs.x||fs.y}function MI(e){return e==="x"||e==="y"?fs[e]?null:(fs[e]=!0,()=>{fs[e]=!1}):fs.x||fs.y?null:(fs.x=fs.y=!0,()=>{fs.x=fs.y=!1})}function g8(e,r){const t=AI(e),n=new AbortController,l={passive:!0,...r,signal:n.signal};return[t,l,()=>n.abort()]}function R3(e){return!(e.pointerType==="touch"||p8())}function OI(e,r,t={}){const[n,l,i]=g8(e,t),o=u=>{if(!R3(u))return;const{target:c}=u,s=r(c,u);if(typeof s!="function"||!c)return;const d=f=>{R3(f)&&(s(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,l)};return n.forEach(u=>{u.addEventListener("pointerenter",o,l)}),i}const x8=(e,r)=>r?e===r?!0:x8(e,r.parentElement):!1,A1=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,PI=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function b8(e){return PI.has(e.tagName)||e.isContentEditable===!0}const rm=new WeakSet;function D3(e){return r=>{r.key==="Enter"&&e(r)}}function hx(e,r){e.dispatchEvent(new PointerEvent("pointer"+r,{isPrimary:!0,bubbles:!0}))}const TI=(e,r)=>{const t=e.currentTarget;if(!t)return;const n=D3(()=>{if(rm.has(t))return;hx(t,"down");const l=D3(()=>{hx(t,"up")}),i=()=>hx(t,"cancel");t.addEventListener("keyup",l,r),t.addEventListener("blur",i,r)});t.addEventListener("keydown",n,r),t.addEventListener("blur",()=>t.removeEventListener("keydown",n),r)};function L3(e){return A1(e)&&!p8()}function II(e,r,t={}){const[n,l,i]=g8(e,t),o=u=>{const c=u.currentTarget;if(!L3(u))return;rm.add(c);const s=r(c,u),d=(m,p)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),rm.has(c)&&rm.delete(c),L3(m)&&typeof s=="function"&&s(m,{success:p})},f=m=>{d(m,c===window||c===document||t.useGlobalTarget||x8(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,l),window.addEventListener("pointercancel",h,l)};return n.forEach(u=>{(t.useGlobalTarget?window:u).addEventListener("pointerdown",o,l),m8(u)&&(u.addEventListener("focus",s=>TI(s,l)),!b8(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),i}function y8(e){return kN(e)&&"ownerSVGElement"in e}function RI(e){return y8(e)&&e.tagName==="svg"}const DI=[...u8,Xr,vo],LI=e=>DI.find(c8(e)),F3=()=>({translate:0,scale:1,origin:0,originPoint:0}),jc=()=>({x:F3(),y:F3()}),B3=()=>({min:0,max:0}),en=()=>({x:B3(),y:B3()}),Ry={current:null},v8={current:!1},FI=typeof window<"u";function BI(){if(v8.current=!0,!!FI)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),r=()=>Ry.current=e.matches;e.addEventListener("change",r),r()}else Ry.current=!1}const zI=new WeakMap;function Cp(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function _d(e){return typeof e=="string"||Array.isArray(e)}const M1=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],O1=["initial",...M1];function Ep(e){return Cp(e.animate)||O1.some(r=>_d(e[r]))}function w8(e){return!!(Ep(e)||e.variants)}function $I(e,r,t){for(const n in r){const l=r[n],i=t[n];if($n(l))e.addValue(n,l);else if($n(i))e.addValue(n,Oc(l,{owner:e}));else if(i!==l)if(e.hasValue(n)){const o=e.getValue(n);o.liveStyle===!0?o.jump(l):o.hasAnimated||o.set(l)}else{const o=e.getStaticValue(n);e.addValue(n,Oc(o!==void 0?o:l,{owner:e}))}}for(const n in t)r[n]===void 0&&e.removeValue(n);return r}const z3=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let vm={};function _8(e){vm=e}function UI(){return vm}class VI{scrapeMotionValuesFromProps(r,t,n){return{}}constructor({parent:r,props:t,presenceContext:n,reducedMotionConfig:l,blockInitialAnimation:i,visualState:o},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=_1,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=Jn.now();this.renderScheduledAtthis.bindToMotionValue(n,t)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(v8.current||BI(),this.shouldReduceMotion=Ry.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),yo(this.notifyUpdate),yo(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const r in this.events)this.events[r].clear();for(const r in this.features){const t=this.features[r];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(r){this.children.add(r),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(r)}removeChild(r){this.children.delete(r),this.enteringChildren&&this.enteringChildren.delete(r)}bindToMotionValue(r,t){this.valueSubscriptions.has(r)&&this.valueSubscriptions.get(r)();const n=Wc.has(r);n&&this.onBindTransform&&this.onBindTransform();const l=t.on("change",o=>{this.latestValues[r]=o,this.props.onUpdate&&jr.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,r,t)),this.valueSubscriptions.set(r,()=>{l(),i&&i(),t.owner&&t.stop()})}sortNodePosition(r){return!this.current||!this.sortInstanceNodePosition||this.type!==r.type?0:this.sortInstanceNodePosition(this.current,r.current)}updateFeatures(){let r="animation";for(r in vm){const t=vm[r];if(!t)continue;const{isEnabled:n,Feature:l}=t;if(!this.features[r]&&l&&n(this.props)&&(this.features[r]=new l(this)),this.features[r]){const i=this.features[r];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):en()}getStaticValue(r){return this.latestValues[r]}setStaticValue(r,t){this.latestValues[r]=t}update(r,t){(r.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=r,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let n=0;nt.variantChildren.delete(r)}addValue(r,t){const n=this.values.get(r);t!==n&&(n&&this.removeValue(r),this.bindToMotionValue(r,t),this.values.set(r,t),this.latestValues[r]=t.get())}removeValue(r){this.values.delete(r);const t=this.valueSubscriptions.get(r);t&&(t(),this.valueSubscriptions.delete(r)),delete this.latestValues[r],this.removeValueFromRenderState(r,this.renderState)}hasValue(r){return this.values.has(r)}getValue(r,t){if(this.props.values&&this.props.values[r])return this.props.values[r];let n=this.values.get(r);return n===void 0&&t!==void 0&&(n=Oc(t===null?void 0:t,{owner:this}),this.addValue(r,n)),n}readValue(r,t){let n=this.latestValues[r]!==void 0||!this.current?this.latestValues[r]:this.getBaseTargetFromProps(this.props,r)??this.readValueFromInstance(this.current,r,this.options);return n!=null&&(typeof n=="string"&&(SN(n)||NN(n))?n=parseFloat(n):!LI(n)&&vo.test(t)&&(n=f8(r,t)),this.setBaseTarget(r,$n(n)?n.get():n)),$n(n)?n.get():n}setBaseTarget(r,t){this.baseTarget[r]=t}getBaseTarget(r){const{initial:t}=this.props;let n;if(typeof t=="string"||typeof t=="object"){const i=k1(this.props,t,this.presenceContext?.custom);i&&(n=i[r])}if(t&&n!==void 0)return n;const l=this.getBaseTargetFromProps(this.props,r);return l!==void 0&&!$n(l)?l:this.initialValues[r]!==void 0&&n===void 0?void 0:this.baseTarget[r]}on(r,t){return this.events[r]||(this.events[r]=new d1),this.events[r].add(t)}notify(r,...t){this.events[r]&&this.events[r].notify(...t)}scheduleRenderMicrotask(){E1.render(this.render)}}class j8 extends VI{constructor(){super(...arguments),this.KeyframeResolver=EI}sortInstanceNodePosition(r,t){return r.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(r,t){const n=r.style;return n?n[t]:void 0}removeValueFromRenderState(r,{vars:t,style:n}){delete t[r],delete n[r]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:r}=this.props;$n(r)&&(this.childSubscription=r.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class No{constructor(r){this.isMounted=!1,this.node=r}update(){}}function S8({top:e,left:r,right:t,bottom:n}){return{x:{min:r,max:t},y:{min:e,max:n}}}function qI({x:e,y:r}){return{top:r.min,right:e.max,bottom:r.max,left:e.min}}function HI(e,r){if(!r)return e;const t=r({x:e.left,y:e.top}),n=r({x:e.right,y:e.bottom});return{top:t.y,left:t.x,bottom:n.y,right:n.x}}function mx(e){return e===void 0||e===1}function Dy({scale:e,scaleX:r,scaleY:t}){return!mx(e)||!mx(r)||!mx(t)}function al(e){return Dy(e)||k8(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function k8(e){return $3(e.x)||$3(e.y)}function $3(e){return e&&e!=="0%"}function wm(e,r,t){const n=e-t,l=r*n;return t+l}function U3(e,r,t,n,l){return l!==void 0&&(e=wm(e,l,n)),wm(e,t,n)+r}function Ly(e,r=0,t=1,n,l){e.min=U3(e.min,r,t,n,l),e.max=U3(e.max,r,t,n,l)}function N8(e,{x:r,y:t}){Ly(e.x,r.translate,r.scale,r.originPoint),Ly(e.y,t.translate,t.scale,t.originPoint)}const V3=.999999999999,q3=1.0000000000001;function WI(e,r,t,n=!1){const l=t.length;if(!l)return;r.x=r.y=1;let i,o;for(let u=0;uV3&&(r.x=1),r.yV3&&(r.y=1)}function Sc(e,r){e.min=e.min+r,e.max=e.max+r}function H3(e,r,t,n,l=.5){const i=Ir(e.min,e.max,l);Ly(e,r,t,i,n)}function kc(e,r){H3(e.x,r.x,r.scaleX,r.scale,r.originX),H3(e.y,r.y,r.scaleY,r.scale,r.originY)}function C8(e,r){return S8(HI(e.getBoundingClientRect(),r))}function KI(e,r,t){const n=C8(e,t),{scroll:l}=r;return l&&(Sc(n.x,l.offset.x),Sc(n.y,l.offset.y)),n}const XI={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},GI=Hc.length;function YI(e,r,t){let n="",l=!0;for(let i=0;i{if(!r.target)return e;if(typeof e=="string")if(ft.test(e))e=parseFloat(e);else return e;const t=W3(e,r.target.x),n=W3(e,r.target.y);return`${t}% ${n}%`}},ZI={correct:(e,{treeScale:r,projectionDelta:t})=>{const n=e,l=vo.parse(e);if(l.length>5)return n;const i=vo.createTransformer(e),o=typeof l[0]!="number"?1:0,u=t.x.scale*r.x,c=t.y.scale*r.y;l[0+o]/=u,l[1+o]/=c;const s=Ir(u,c,.5);return typeof l[2+o]=="number"&&(l[2+o]/=s),typeof l[3+o]=="number"&&(l[3+o]/=s),i(l)}},Fy={borderRadius:{...Ku,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ku,borderTopRightRadius:Ku,borderBottomLeftRadius:Ku,borderBottomRightRadius:Ku,boxShadow:ZI};function A8(e,{layout:r,layoutId:t}){return Wc.has(e)||e.startsWith("origin")||(r||t!==void 0)&&(!!Fy[e]||e==="opacity")}function T1(e,r,t){const n=e.style,l=r?.style,i={};if(!n)return i;for(const o in n)($n(n[o])||l&&$n(l[o])||A8(o,e)||t?.getValue(o)?.liveStyle!==void 0)&&(i[o]=n[o]);return i}function QI(e){return window.getComputedStyle(e)}class JI extends j8{constructor(){super(...arguments),this.type="html",this.renderInstance=E8}readValueFromInstance(r,t){if(Wc.has(t))return this.projection?.isProjecting?ky(t):AT(r,t);{const n=QI(r),l=(zN(t)?n.getPropertyValue(t):n[t])||0;return typeof l=="string"?l.trim():l}}measureInstanceViewportBox(r,{transformPagePoint:t}){return C8(r,t)}build(r,t,n){P1(r,t,n.transformTemplate)}scrapeMotionValuesFromProps(r,t,n){return T1(r,t,n)}}const eR={offset:"stroke-dashoffset",array:"stroke-dasharray"},tR={offset:"strokeDashoffset",array:"strokeDasharray"};function rR(e,r,t=1,n=0,l=!0){e.pathLength=1;const i=l?eR:tR;e[i.offset]=ft.transform(-n);const o=ft.transform(r),u=ft.transform(t);e[i.array]=`${o} ${u}`}const nR=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function M8(e,{attrX:r,attrY:t,attrScale:n,pathLength:l,pathSpacing:i=1,pathOffset:o=0,...u},c,s,d){if(P1(e,u,s),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=d?.transformBox??"fill-box",delete f.transformBox);for(const m of nR)f[m]!==void 0&&(h[m]=f[m],delete f[m]);r!==void 0&&(f.x=r),t!==void 0&&(f.y=t),n!==void 0&&(f.scale=n),l!==void 0&&rR(f,l,i,o,!1)}const O8=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),P8=e=>typeof e=="string"&&e.toLowerCase()==="svg";function iR(e,r,t,n){E8(e,r,void 0,n);for(const l in r.attrs)e.setAttribute(O8.has(l)?l:N1(l),r.attrs[l])}function T8(e,r,t){const n=T1(e,r,t);for(const l in e)if($n(e[l])||$n(r[l])){const i=Hc.indexOf(l)!==-1?"attr"+l.charAt(0).toUpperCase()+l.substring(1):l;n[i]=e[l]}return n}class sR extends j8{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=en}getBaseTargetFromProps(r,t){return r[t]}readValueFromInstance(r,t){if(Wc.has(t)){const n=d8(t);return n&&n.default||0}return t=O8.has(t)?t:N1(t),r.getAttribute(t)}scrapeMotionValuesFromProps(r,t,n){return T8(r,t,n)}build(r,t,n){M8(r,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(r,t,n,l){iR(r,t,n,l)}mount(r){this.isSVGTag=P8(r.tagName),super.mount(r)}}const aR=O1.length;function I8(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent?I8(e.parent)||{}:{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}const r={};for(let t=0;tPromise.all(r.map(({animation:t,options:n})=>bI(e,t,n)))}function uR(e){let r=cR(e),t=K3(),n=!0;const l=c=>(s,d)=>{const f=Ec(e,d,c==="exit"?e.presenceContext?.custom:void 0);if(f){const{transition:h,transitionEnd:m,...p}=f;s={...s,...p,...m}}return s};function i(c){r=c(e)}function o(c){const{props:s}=e,d=I8(e.parent)||{},f=[],h=new Set;let m={},p=1/0;for(let g=0;gp&&C,H=!1;const W=Array.isArray(_)?_:[_];let K=W.reduce(l(y),{});M===!1&&(K={});const{prevResolvedValues:$={}}=v,P={...$,...K},L=k=>{F=!0,h.has(k)&&(H=!0,h.delete(k)),v.needsAnimating[k]=!0;const S=e.getValue(k);S&&(S.liveStyle=!1)};for(const k in P){const S=K[k],N=$[k];if(m.hasOwnProperty(k))continue;let O=!1;Oy(S)&&Oy(N)?O=!R8(S,N):O=S!==N,O?S!=null?L(k):h.add(k):S!==void 0&&h.has(k)?L(k):v.protectedKeys[k]=!0}v.prevProp=_,v.prevResolvedValues=K,v.isActive&&(m={...m,...K}),n&&e.blockInitialAnimation&&(F=!1);const E=T&&U;F&&(!E||H)&&f.push(...W.map(k=>{const S={type:y};if(typeof k=="string"&&n&&!E&&e.manuallyAnimateOnMount&&e.parent){const{parent:N}=e,O=Ec(N,k);if(N.enteringChildren&&O){const{delayChildren:D}=O.transition||{};S.delay=n8(N.enteringChildren,e,D)}}return{animation:k,options:S}}))}if(h.size){const g={};if(typeof s.initial!="boolean"){const y=Ec(e,Array.isArray(s.initial)?s.initial[0]:s.initial);y&&y.transition&&(g.transition=y.transition)}h.forEach(y=>{const v=e.getBaseTarget(y),_=e.getValue(y);_&&(_.liveStyle=!0),g[y]=v??null}),f.push({animation:g})}let x=!!f.length;return n&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(x=!1),n=!1,x?r(f):Promise.resolve()}function u(c,s){if(t[c].isActive===s)return Promise.resolve();e.variantChildren?.forEach(f=>f.animationState?.setActive(c,s)),t[c].isActive=s;const d=o(c);for(const f in t)t[f].protectedKeys={};return d}return{animateChanges:o,setActive:u,setAnimateFunction:i,getState:()=>t,reset:()=>{t=K3()}}}function dR(e,r){return typeof r=="string"?r!==e:Array.isArray(r)?!R8(r,e):!1}function il(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function K3(){return{animate:il(!0),whileInView:il(),whileHover:il(),whileTap:il(),whileDrag:il(),whileFocus:il(),exit:il()}}function X3(e,r){e.min=r.min,e.max=r.max}function ds(e,r){X3(e.x,r.x),X3(e.y,r.y)}function G3(e,r){e.translate=r.translate,e.scale=r.scale,e.originPoint=r.originPoint,e.origin=r.origin}const D8=1e-4,fR=1-D8,hR=1+D8,L8=.01,mR=0-L8,pR=0+L8;function ei(e){return e.max-e.min}function gR(e,r,t){return Math.abs(e-r)<=t}function Y3(e,r,t,n=.5){e.origin=n,e.originPoint=Ir(r.min,r.max,e.origin),e.scale=ei(t)/ei(r),e.translate=Ir(t.min,t.max,e.origin)-e.originPoint,(e.scale>=fR&&e.scale<=hR||isNaN(e.scale))&&(e.scale=1),(e.translate>=mR&&e.translate<=pR||isNaN(e.translate))&&(e.translate=0)}function fd(e,r,t,n){Y3(e.x,r.x,t.x,n?n.originX:void 0),Y3(e.y,r.y,t.y,n?n.originY:void 0)}function Z3(e,r,t){e.min=t.min+r.min,e.max=e.min+ei(r)}function xR(e,r,t){Z3(e.x,r.x,t.x),Z3(e.y,r.y,t.y)}function Q3(e,r,t){e.min=r.min-t.min,e.max=e.min+ei(r)}function _m(e,r,t){Q3(e.x,r.x,t.x),Q3(e.y,r.y,t.y)}function J3(e,r,t,n,l){return e-=r,e=wm(e,1/t,n),l!==void 0&&(e=wm(e,1/l,n)),e}function bR(e,r=0,t=1,n=.5,l,i=e,o=e){if(Ls.test(r)&&(r=parseFloat(r),r=Ir(o.min,o.max,r/100)-o.min),typeof r!="number")return;let u=Ir(i.min,i.max,n);e===i&&(u-=r),e.min=J3(e.min,r,t,u,l),e.max=J3(e.max,r,t,u,l)}function e4(e,r,[t,n,l],i,o){bR(e,r[t],r[n],r[l],r.scale,i,o)}const yR=["x","scaleX","originX"],vR=["y","scaleY","originY"];function t4(e,r,t,n){e4(e.x,r,yR,t?t.x:void 0,n?n.x:void 0),e4(e.y,r,vR,t?t.y:void 0,n?n.y:void 0)}function r4(e){return e.translate===0&&e.scale===1}function F8(e){return r4(e.x)&&r4(e.y)}function n4(e,r){return e.min===r.min&&e.max===r.max}function wR(e,r){return n4(e.x,r.x)&&n4(e.y,r.y)}function i4(e,r){return Math.round(e.min)===Math.round(r.min)&&Math.round(e.max)===Math.round(r.max)}function B8(e,r){return i4(e.x,r.x)&&i4(e.y,r.y)}function s4(e){return ei(e.x)/ei(e.y)}function a4(e,r){return e.translate===r.translate&&e.scale===r.scale&&e.originPoint===r.originPoint}function zi(e){return[e("x"),e("y")]}function _R(e,r,t){let n="";const l=e.x.translate/r.x,i=e.y.translate/r.y,o=t?.z||0;if((l||i||o)&&(n=`translate3d(${l}px, ${i}px, ${o}px) `),(r.x!==1||r.y!==1)&&(n+=`scale(${1/r.x}, ${1/r.y}) `),t){const{transformPerspective:s,rotate:d,rotateX:f,rotateY:h,skewX:m,skewY:p}=t;s&&(n=`perspective(${s}px) ${n}`),d&&(n+=`rotate(${d}deg) `),f&&(n+=`rotateX(${f}deg) `),h&&(n+=`rotateY(${h}deg) `),m&&(n+=`skewX(${m}deg) `),p&&(n+=`skewY(${p}deg) `)}const u=e.x.scale*r.x,c=e.y.scale*r.y;return(u!==1||c!==1)&&(n+=`scale(${u}, ${c})`),n||"none"}const z8=["TopLeft","TopRight","BottomLeft","BottomRight"],jR=z8.length,o4=e=>typeof e=="string"?parseFloat(e):e,l4=e=>typeof e=="number"||ft.test(e);function SR(e,r,t,n,l,i){l?(e.opacity=Ir(0,t.opacity??1,kR(n)),e.opacityExit=Ir(r.opacity??1,0,NR(n))):i&&(e.opacity=Ir(r.opacity??1,t.opacity??1,n));for(let o=0;onr?1:t(yd(e,r,n))}function CR(e,r,t){const n=$n(e)?e:Oc(e);return n.start(S1("",n,r,t)),n.animation}function jd(e,r,t,n={passive:!0}){return e.addEventListener(r,t,n),()=>e.removeEventListener(r,t)}const ER=(e,r)=>e.depth-r.depth;class AR{constructor(){this.children=[],this.isDirty=!1}add(r){o1(this.children,r),this.isDirty=!0}remove(r){l1(this.children,r),this.isDirty=!0}forEach(r){this.isDirty&&this.children.sort(ER),this.isDirty=!1,this.children.forEach(r)}}function MR(e,r){const t=Jn.now(),n=({timestamp:l})=>{const i=l-t;i>=r&&(yo(n),e(i-r))};return jr.setup(n,!0),()=>yo(n)}function nm(e){return $n(e)?e.get():e}class OR{constructor(){this.members=[]}add(r){o1(this.members,r),r.scheduleRender()}remove(r){if(l1(this.members,r),r===this.prevLead&&(this.prevLead=void 0),r===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(r){const t=this.members.findIndex(l=>r===l);if(t===0)return!1;let n;for(let l=t;l>=0;l--){const i=this.members[l];if(i.isPresent!==!1){n=i;break}}return n?(this.promote(n),!0):!1}promote(r,t){const n=this.lead;if(r!==n&&(this.prevLead=n,this.lead=r,r.show(),n)){n.instance&&n.scheduleRender(),r.scheduleRender(),r.resumeFrom=n,t&&(r.resumeFrom.preserveOpacity=!0),n.snapshot&&(r.snapshot=n.snapshot,r.snapshot.latestValues=n.animationValues||n.latestValues),r.root&&r.root.isUpdating&&(r.isLayoutDirty=!0);const{crossfade:l}=r.options;l===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(r=>{const{options:t,resumingFrom:n}=r;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(r=>{r.instance&&r.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const im={hasAnimatedSinceResize:!0,hasEverUpdated:!1},px=["","X","Y","Z"],PR=1e3;let TR=0;function gx(e,r,t,n){const{latestValues:l}=r;l[e]&&(t[e]=l[e],r.setStaticValue(e,0),n&&(n[e]=0))}function U8(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:r}=e.options;if(!r)return;const t=o8(r);if(window.MotionHasOptimisedAnimation(t,"transform")){const{layout:l,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(t,"transform",jr,!(l||i))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&U8(n)}function V8({attachResizeListener:e,defaultParent:r,measureScroll:t,checkIsScrollRoot:n,resetTransform:l}){return class{constructor(o={},u=r?.()){this.id=TR++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(DR),this.nodes.forEach(zR),this.nodes.forEach($R),this.nodes.forEach(LR)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;jr.read(()=>{f=window.innerWidth}),e(o,()=>{const m=window.innerWidth;m!==f&&(f=m,this.root.updateBlockedByResize=!0,d&&d(),d=MR(h,250),im.hasAnimatedSinceResize&&(im.hasAnimatedSinceResize=!1,this.nodes.forEach(f4)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&s&&(u||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||s.getDefaultTransition()||WR,{onLayoutAnimationStart:x,onLayoutAnimationComplete:g}=s.getProps(),y=!this.targetLayout||!B8(this.targetLayout,m),v=!f&&h;if(this.options.layoutRoot||this.resumeFrom||v||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const _={...j1(p,"layout"),onPlay:x,onComplete:g};(s.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_),this.setAnimationOrigin(d,v)}else f||f4(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),yo(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(UR),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&U8(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ei(this.snapshot.measuredBox.x)&&!ei(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const M=C/1e3;h4(f.x,o.x,M),h4(f.y,o.y,M),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(_m(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),qR(this.relativeTarget,this.relativeTargetOrigin,h,M),_&&wR(this.relativeTarget,_)&&(this.isProjectionDirty=!1),_||(_=en()),ds(_,this.relativeTarget)),x&&(this.animationValues=d,SR(d,s,this.latestValues,M,v,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(yo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=jr.update(()=>{im.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Oc(0)),this.currentAnimation=CR(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(PR),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:u,target:c,layout:s,latestValues:d}=o;if(!(!u||!c||!s)){if(this!==o&&this.layout&&s&&q8(this.options.animationType,this.layout.layoutBox,s.layoutBox)){c=this.target||en();const f=ei(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const h=ei(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+h}ds(u,c),kc(u,d),fd(this.projectionDeltaWithTransform,this.layoutCorrected,u,d)}}registerSharedNode(o,u){this.sharedNodes.has(o)||this.sharedNodes.set(o,new OR),this.sharedNodes.get(o).add(u);const s=u.options.initialPromotionConfig;u.promote({transition:s?s.transition:void 0,preserveFollowOpacity:s&&s.shouldPreserveFollowOpacity?s.shouldPreserveFollowOpacity(u):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:u,preserveFollowOpacity:c}={}){const s=this.getStack();s&&s.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let u=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(u=!0),!u)return;const s={};c.z&&gx("z",o,s,this.animationValues);for(let d=0;do.currentAnimation?.stop()),this.root.nodes.forEach(u4),this.root.sharedNodes.clear()}}}function IR(e){e.updateLayout()}function RR(e){const r=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:n}=e.layout,{animationType:l}=e.options,i=r.source!==e.layout.source;l==="size"?zi(d=>{const f=i?r.measuredBox[d]:r.layoutBox[d],h=ei(f);f.min=t[d].min,f.max=f.min+h}):q8(l,r.layoutBox,t)&&zi(d=>{const f=i?r.measuredBox[d]:r.layoutBox[d],h=ei(t[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});const o=jc();fd(o,t,r.layoutBox);const u=jc();i?fd(u,e.applyTransform(n,!0),r.measuredBox):fd(u,t,r.layoutBox);const c=!F8(o);let s=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const m=en();_m(m,r.layoutBox,f.layoutBox);const p=en();_m(p,t,h.layoutBox),B8(m,p)||(s=!0),d.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=m,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:r,delta:u,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:s})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function DR(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function LR(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function FR(e){e.clearSnapshot()}function u4(e){e.clearMeasurements()}function d4(e){e.isLayoutDirty=!1}function BR(e){const{visualElement:r}=e.options;r&&r.getProps().onBeforeLayoutMeasure&&r.notify("BeforeLayoutMeasure"),e.resetTransform()}function f4(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function zR(e){e.resolveTargetDelta()}function $R(e){e.calcProjection()}function UR(e){e.resetSkewAndRotation()}function VR(e){e.removeLeadSnapshot()}function h4(e,r,t){e.translate=Ir(r.translate,0,t),e.scale=Ir(r.scale,1,t),e.origin=r.origin,e.originPoint=r.originPoint}function m4(e,r,t,n){e.min=Ir(r.min,t.min,n),e.max=Ir(r.max,t.max,n)}function qR(e,r,t,n){m4(e.x,r.x,t.x,n),m4(e.y,r.y,t.y,n)}function HR(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const WR={duration:.45,ease:[.4,0,.1,1]},p4=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),g4=p4("applewebkit/")&&!p4("chrome/")?Math.round:Hi;function x4(e){e.min=g4(e.min),e.max=g4(e.max)}function KR(e){x4(e.x),x4(e.y)}function q8(e,r,t){return e==="position"||e==="preserve-aspect"&&!gR(s4(r),s4(t),.2)}function XR(e){return e!==e.root&&e.scroll?.wasRoot}const GR=V8({attachResizeListener:(e,r)=>jd(e,"resize",r),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),xx={current:void 0},H8=V8({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!xx.current){const e=new GR({});e.mount(window),e.setOptions({layoutScroll:!0}),xx.current=e}return xx.current},resetTransform:(e,r)=>{e.style.transform=r!==void 0?r:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),I1=R.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function b4(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function YR(...e){return r=>{let t=!1;const n=e.map(l=>{const i=b4(l,r);return!t&&typeof i=="function"&&(t=!0),i});if(t)return()=>{for(let l=0;l{const{width:d,height:f,top:h,left:m,right:p}=o.current;if(r||!i.current||!d||!f)return;const x=t==="left"?`left: ${m}`:`right: ${p}`;i.current.dataset.motionPopId=l;const g=document.createElement("style");u&&(g.nonce=u);const y=n??document.head;return y.appendChild(g),g.sheet&&g.sheet.insertRule(` [data-motion-pop-id="${l}"] { position: absolute !important; width: ${d}px !important; height: ${f}px !important; ${x}px !important; top: ${h}px !important; } `),()=>{y.contains(g)&&y.removeChild(g)}},[r]),a.jsx(QR,{isPresent:r,childRef:i,sizeRef:o,children:R.cloneElement(e,{ref:s})})}const eD=({children:e,initial:r,isPresent:t,onExitComplete:n,custom:l,presenceAffectsLayout:i,mode:o,anchorX:u,root:c})=>{const s=a1(tD),d=R.useId();let f=!0,h=R.useMemo(()=>(f=!1,{id:d,initial:r,isPresent:t,custom:l,onExitComplete:m=>{s.set(m,!0);for(const p of s.values())if(!p)return;n&&n()},register:m=>(s.set(m,!1),()=>s.delete(m))}),[t,s,n]);return i&&f&&(h={...h}),R.useMemo(()=>{s.forEach((m,p)=>s.set(p,!1))},[t]),R.useEffect(()=>{!t&&!s.size&&n&&n()},[t]),o==="popLayout"&&(e=a.jsx(JR,{isPresent:t,anchorX:u,root:c,children:e})),a.jsx(Np.Provider,{value:h,children:e})};function tD(){return new Map}function W8(e=!0){const r=R.useContext(Np);if(r===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:l}=r,i=R.useId();R.useEffect(()=>{if(e)return l(i)},[e]);const o=R.useCallback(()=>e&&n&&n(i),[i,n,e]);return!t&&n?[!1,o]:[!0]}const Ch=e=>e.key||"";function y4(e){const r=[];return R.Children.forEach(e,t=>{R.isValidElement(t)&&r.push(t)}),r}const rD=({children:e,custom:r,initial:t=!0,onExitComplete:n,presenceAffectsLayout:l=!0,mode:i="sync",propagate:o=!1,anchorX:u="left",root:c})=>{const[s,d]=W8(o),f=R.useMemo(()=>y4(e),[e]),h=o&&!s?[]:f.map(Ch),m=R.useRef(!0),p=R.useRef(f),x=a1(()=>new Map),g=R.useRef(new Set),[y,v]=R.useState(f),[_,C]=R.useState(f);jN(()=>{m.current=!1,p.current=f;for(let U=0;U<_.length;U++){const F=Ch(_[U]);h.includes(F)?(x.delete(F),g.current.delete(F)):x.get(F)!==!0&&x.set(F,!1)}},[_,h.length,h.join("-")]);const M=[];if(f!==y){let U=[...f];for(let F=0;F<_.length;F++){const H=_[F],W=Ch(H);h.includes(W)||(U.splice(F,0,H),M.push(H))}return i==="wait"&&M.length&&(U=M),C(y4(U)),v(f),null}const{forceRender:T}=R.useContext(s1);return a.jsx(a.Fragment,{children:_.map(U=>{const F=Ch(U),H=o&&!s?!1:f===_||h.includes(F),W=()=>{if(g.current.has(F))return;if(g.current.add(F),x.has(F))x.set(F,!0);else return;let K=!0;x.forEach($=>{$||(K=!1)}),K&&(T?.(),C(p.current),o&&d?.(),n&&n())};return a.jsx(eD,{isPresent:H,initial:!m.current||t?void 0:!1,custom:r,presenceAffectsLayout:l,mode:i,root:c,onExitComplete:H?void 0:W,anchorX:u,children:U},F)})})},K8=R.createContext({strict:!1}),v4={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let w4=!1;function nD(){if(w4)return;const e={};for(const r in v4)e[r]={isEnabled:t=>v4[r].some(n=>!!t[n])};_8(e),w4=!0}function X8(){return nD(),UI()}function iD(e){const r=X8();for(const t in e)r[t]={...r[t],...e[t]};_8(r)}const sD=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function jm(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||sD.has(e)}let G8=e=>!jm(e);function aD(e){typeof e=="function"&&(G8=r=>r.startsWith("on")?!jm(r):e(r))}try{aD(require("@emotion/is-prop-valid").default)}catch{}function oD(e,r,t){const n={};for(const l in e)l==="values"&&typeof e.values=="object"||(G8(l)||t===!0&&jm(l)||!r&&!jm(l)||e.draggable&&l.startsWith("onDrag"))&&(n[l]=e[l]);return n}const Ap=R.createContext({});function lD(e,r){if(Ep(e)){const{initial:t,animate:n}=e;return{initial:t===!1||_d(t)?t:void 0,animate:_d(n)?n:void 0}}return e.inherit!==!1?r:{}}function cD(e){const{initial:r,animate:t}=lD(e,R.useContext(Ap));return R.useMemo(()=>({initial:r,animate:t}),[_4(r),_4(t)])}function _4(e){return Array.isArray(e)?e.join(" "):e}const R1=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Y8(e,r,t){for(const n in r)!$n(r[n])&&!A8(n,t)&&(e[n]=r[n])}function uD({transformTemplate:e},r){return R.useMemo(()=>{const t=R1();return P1(t,r,e),Object.assign({},t.vars,t.style)},[r])}function dD(e,r){const t=e.style||{},n={};return Y8(n,t,e),Object.assign(n,uD(e,r)),n}function fD(e,r){const t={},n=dD(e,r);return e.drag&&e.dragListener!==!1&&(t.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(t.tabIndex=0),t.style=n,t}const Z8=()=>({...R1(),attrs:{}});function hD(e,r,t,n){const l=R.useMemo(()=>{const i=Z8();return M8(i,r,P8(n),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[r]);if(e.style){const i={};Y8(i,e.style,e),l.style={...i,...l.style}}return l}const mD=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function D1(e){return typeof e!="string"||e.includes("-")?!1:!!(mD.indexOf(e)>-1||/[A-Z]/u.test(e))}function pD(e,r,t,{latestValues:n},l,i=!1,o){const c=(o??D1(e)?hD:fD)(r,n,l,e),s=oD(r,typeof e=="string",i),d=e!==R.Fragment?{...s,...c,ref:t}:{},{children:f}=r,h=R.useMemo(()=>$n(f)?f.get():f,[f]);return R.createElement(e,{...d,children:h})}function gD({scrapeMotionValuesFromProps:e,createRenderState:r},t,n,l){return{latestValues:xD(t,n,l,e),renderState:r()}}function xD(e,r,t,n){const l={},i=n(e,{});for(const h in i)l[h]=nm(i[h]);let{initial:o,animate:u}=e;const c=Ep(e),s=w8(e);r&&s&&!c&&e.inherit!==!1&&(o===void 0&&(o=r.initial),u===void 0&&(u=r.animate));let d=t?t.initial===!1:!1;d=d||o===!1;const f=d?u:o;if(f&&typeof f!="boolean"&&!Cp(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m(r,t)=>{const n=R.useContext(Ap),l=R.useContext(Np),i=()=>gD(e,r,n,l);return t?i():a1(i)},bD=Q8({scrapeMotionValuesFromProps:T1,createRenderState:R1}),yD=Q8({scrapeMotionValuesFromProps:T8,createRenderState:Z8}),vD=Symbol.for("motionComponentSymbol");function wD(e,r,t){const n=R.useRef(t);R.useInsertionEffect(()=>{n.current=t});const l=R.useRef(null);return R.useCallback(i=>{i&&e.onMount?.(i),r&&(i?r.mount(i):r.unmount());const o=n.current;if(typeof o=="function")if(i){const u=o(i);typeof u=="function"&&(l.current=u)}else l.current?(l.current(),l.current=null):o(i);else o&&(o.current=i)},[r])}const J8=R.createContext({});function ad(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function _D(e,r,t,n,l,i){const{visualElement:o}=R.useContext(Ap),u=R.useContext(K8),c=R.useContext(Np),s=R.useContext(I1).reducedMotion,d=R.useRef(null);n=n||u.renderer,!d.current&&n&&(d.current=n(e,{visualState:r,parent:o,props:t,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:s,isSVG:i}));const f=d.current,h=R.useContext(J8);f&&!f.projection&&l&&(f.type==="html"||f.type==="svg")&&jD(d.current,t,l,h);const m=R.useRef(!1);R.useInsertionEffect(()=>{f&&m.current&&f.update(t,c)});const p=t[a8],x=R.useRef(!!p&&!window.MotionHandoffIsComplete?.(p)&&window.MotionHasOptimisedAnimation?.(p));return jN(()=>{f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),x.current&&f.animationState&&f.animationState.animateChanges())}),R.useEffect(()=>{f&&(!x.current&&f.animationState&&f.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(p)}),x.current=!1),f.enteringChildren=void 0)}),f}function jD(e,r,t,n){const{layoutId:l,layout:i,drag:o,dragConstraints:u,layoutScroll:c,layoutRoot:s,layoutCrossfade:d}=r;e.projection=new t(e.latestValues,r["data-framer-portal-id"]?void 0:eC(e.parent)),e.projection.setOptions({layoutId:l,layout:i,alwaysMeasureLayout:!!o||u&&ad(u),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:n,crossfade:d,layoutScroll:c,layoutRoot:s})}function eC(e){if(e)return e.options.allowProjection!==!1?e.projection:eC(e.parent)}function bx(e,{forwardMotionProps:r=!1,type:t}={},n,l){n&&iD(n);const i=t?t==="svg":D1(e),o=i?yD:bD;function u(s,d){let f;const h={...R.useContext(I1),...s,layoutId:SD(s)},{isStatic:m}=h,p=cD(s),x=o(s,m);if(!m&&_N){kD();const g=ND(h);f=g.MeasureLayout,p.visualElement=_D(e,x,h,l,g.ProjectionNode,i)}return a.jsxs(Ap.Provider,{value:p,children:[f&&p.visualElement?a.jsx(f,{visualElement:p.visualElement,...h}):null,pD(e,s,wD(x,p.visualElement,d),x,m,r,i)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=R.forwardRef(u);return c[vD]=e,c}function SD({layoutId:e}){const r=R.useContext(s1).id;return r&&e!==void 0?r+"-"+e:e}function kD(e,r){R.useContext(K8).strict}function ND(e){const r=X8(),{drag:t,layout:n}=r;if(!t&&!n)return{};const l={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?l.MeasureLayout:void 0,ProjectionNode:l.ProjectionNode}}function CD(e,r){if(typeof Proxy>"u")return bx;const t=new Map,n=(i,o)=>bx(i,o,e,r),l=(i,o)=>n(i,o);return new Proxy(l,{get:(i,o)=>o==="create"?n:(t.has(o)||t.set(o,bx(o,void 0,e,r)),t.get(o))})}const ED=(e,r)=>r.isSVG??D1(e)?new sR(r):new JI(r,{allowProjection:e!==R.Fragment});class AD extends No{constructor(r){super(r),r.animationState||(r.animationState=uR(r))}updateAnimationControlsSubscription(){const{animate:r}=this.node.getProps();Cp(r)&&(this.unmountControls=r.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:r}=this.node.getProps(),{animate:t}=this.node.prevProps||{};r!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let MD=0;class OD extends No{constructor(){super(...arguments),this.id=MD++}update(){if(!this.node.presenceContext)return;const{isPresent:r,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||r===n)return;const l=this.node.animationState.setActive("exit",!r);t&&!r&&l.then(()=>{t(this.id)})}mount(){const{register:r,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),r&&(this.unmount=r(this.id))}unmount(){}}const PD={animation:{Feature:AD},exit:{Feature:OD}};function Hd(e){return{point:{x:e.pageX,y:e.pageY}}}const TD=e=>r=>A1(r)&&e(r,Hd(r));function hd(e,r,t,n){return jd(e,r,TD(t),n)}const tC=({current:e})=>e?e.ownerDocument.defaultView:null,j4=(e,r)=>Math.abs(e-r);function ID(e,r){const t=j4(e.x,r.x),n=j4(e.y,r.y);return Math.sqrt(t**2+n**2)}const S4=new Set(["auto","scroll"]);class rC{constructor(r,t,{transformPagePoint:n,contextWindow:l=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:u}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const m=vx(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,x=ID(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!x)return;const{point:g}=m,{timestamp:y}=kn;this.history.push({...g,timestamp:y});const{onStart:v,onMove:_}=this.handlers;p||(v&&v(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),_&&_(this.lastMoveEvent,m)},this.handlePointerMove=(m,p)=>{this.lastMoveEvent=m,this.lastMoveEventInfo=yx(p,this.transformPagePoint),jr.update(this.updatePoint,!0)},this.handlePointerUp=(m,p)=>{this.end();const{onEnd:x,onSessionEnd:g,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=vx(m.type==="pointercancel"?this.lastMoveEventInfo:yx(p,this.transformPagePoint),this.history);this.startEvent&&x&&x(m,v),g&&g(m,v)},!A1(r))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=l||window;const c=Hd(r),s=yx(c,this.transformPagePoint),{point:d}=s,{timestamp:f}=kn;this.history=[{...d,timestamp:f}];const{onSessionStart:h}=t;h&&h(r,vx(s,this.history)),this.removeListeners=Ud(hd(this.contextWindow,"pointermove",this.handlePointerMove),hd(this.contextWindow,"pointerup",this.handlePointerUp),hd(this.contextWindow,"pointercancel",this.handlePointerUp)),u&&this.startScrollTracking(u)}startScrollTracking(r){let t=r.parentElement;for(;t;){const n=getComputedStyle(t);(S4.has(n.overflowX)||S4.has(n.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(r){const t=this.scrollPositions.get(r);if(!t)return;const n=r===window,l=n?{x:window.scrollX,y:window.scrollY}:{x:r.scrollLeft,y:r.scrollTop},i={x:l.x-t.x,y:l.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(r,l),jr.update(this.updatePoint,!0))}updateHandlers(r){this.handlers=r}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),yo(this.updatePoint)}}function yx(e,r){return r?{point:r(e.point)}:e}function k4(e,r){return{x:e.x-r.x,y:e.y-r.y}}function vx({point:e},r){return{point:e,delta:k4(e,nC(r)),offset:k4(e,RD(r)),velocity:DD(r,.1)}}function RD(e){return e[0]}function nC(e){return e[e.length-1]}function DD(e,r){if(e.length<2)return{x:0,y:0};let t=e.length-1,n=null;const l=nC(e);for(;t>=0&&(n=e[t],!(l.timestamp-n.timestamp>ga(r)));)t--;if(!n)return{x:0,y:0};const i=Ui(l.timestamp-n.timestamp);if(i===0)return{x:0,y:0};const o={x:(l.x-n.x)/i,y:(l.y-n.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function LD(e,{min:r,max:t},n){return r!==void 0&&et&&(e=n?Ir(t,e,n.max):Math.min(e,t)),e}function N4(e,r,t){return{min:r!==void 0?e.min+r:void 0,max:t!==void 0?e.max+t-(e.max-e.min):void 0}}function FD(e,{top:r,left:t,bottom:n,right:l}){return{x:N4(e.x,t,l),y:N4(e.y,r,n)}}function C4(e,r){let t=r.min-e.min,n=r.max-e.max;return r.max-r.minn?t=yd(r.min,r.max-n,e.min):n>l&&(t=yd(e.min,e.max-l,r.min)),Bs(0,1,t)}function $D(e,r){const t={};return r.min!==void 0&&(t.min=r.min-e.min),r.max!==void 0&&(t.max=r.max-e.min),t}const By=.35;function UD(e=By){return e===!1?e=0:e===!0&&(e=By),{x:E4(e,"left","right"),y:E4(e,"top","bottom")}}function E4(e,r,t){return{min:A4(e,r),max:A4(e,t)}}function A4(e,r){return typeof e=="number"?e:e[r]||0}const VD=new WeakMap;class qD{constructor(r){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=en(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=r}start(r,{snapToCursor:t=!1,distanceThreshold:n}={}){const{presenceContext:l}=this.visualElement;if(l&&l.isPresent===!1)return;const i=f=>{t?(this.stopAnimation(),this.snapToCursor(Hd(f).point)):this.pauseAnimation()},o=(f,h)=>{this.stopAnimation();const{drag:m,dragPropagation:p,onDragStart:x}=this.getProps();if(m&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=MI(m),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),zi(y=>{let v=this.getAxisMotionValue(y).get()||0;if(Ls.test(v)){const{projection:_}=this.visualElement;if(_&&_.layout){const C=_.layout.layoutBox[y];C&&(v=ei(C)*(parseFloat(v)/100))}}this.originPoint[y]=v}),x&&jr.postRender(()=>x(f,h)),Py(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},u=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:m,dragDirectionLock:p,onDirectionLock:x,onDrag:g}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:y}=h;if(p&&this.currentDirection===null){this.currentDirection=HD(y),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),g&&g(f,h)},c=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},s=()=>zi(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:d}=this.getProps();this.panSession=new rC(r,{onSessionStart:i,onStart:o,onMove:u,onSessionEnd:c,resumeAnimation:s},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:n,contextWindow:tC(this.visualElement),element:this.visualElement.current})}stop(r,t){const n=r||this.latestPointerEvent,l=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!l||!n)return;const{velocity:o}=l;this.startAnimation(o);const{onDragEnd:u}=this.getProps();u&&jr.postRender(()=>u(n,l))}cancel(){this.isDragging=!1;const{projection:r,animationState:t}=this.visualElement;r&&(r.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(r,t,n){const{drag:l}=this.getProps();if(!n||!Eh(r,l,this.currentDirection))return;const i=this.getAxisMotionValue(r);let o=this.originPoint[r]+n[r];this.constraints&&this.constraints[r]&&(o=LD(o,this.constraints[r],this.elastic[r])),i.set(o)}resolveConstraints(){const{dragConstraints:r,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,l=this.constraints;r&&ad(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&n?this.constraints=FD(n.layoutBox,r):this.constraints=!1,this.elastic=UD(t),l!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&zi(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=$D(n.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:r,onMeasureDragConstraints:t}=this.getProps();if(!r||!ad(r))return!1;const n=r.current,{projection:l}=this.visualElement;if(!l||!l.layout)return!1;const i=KI(n,l.root,this.visualElement.getTransformPagePoint());let o=BD(l.layout.layoutBox,i);if(t){const u=t(qI(o));this.hasMutatedConstraints=!!u,u&&(o=S8(u))}return o}startAnimation(r){const{drag:t,dragMomentum:n,dragElastic:l,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:u}=this.getProps(),c=this.constraints||{},s=zi(d=>{if(!Eh(d,t,this.currentDirection))return;let f=c&&c[d]||{};o&&(f={min:0,max:0});const h=l?200:1e6,m=l?40:1e7,p={type:"inertia",velocity:n?r[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,p)});return Promise.all(s).then(u)}startAxisValueAnimation(r,t){const n=this.getAxisMotionValue(r);return Py(this.visualElement,r),n.start(S1(r,n,0,t,this.visualElement,!1))}stopAnimation(){zi(r=>this.getAxisMotionValue(r).stop())}pauseAnimation(){zi(r=>this.getAxisMotionValue(r).animation?.pause())}getAnimationState(r){return this.getAxisMotionValue(r).animation?.state}getAxisMotionValue(r){const t=`_drag${r.toUpperCase()}`,n=this.visualElement.getProps(),l=n[t];return l||this.visualElement.getValue(r,(n.initial?n.initial[r]:void 0)||0)}snapToCursor(r){zi(t=>{const{drag:n}=this.getProps();if(!Eh(t,n,this.currentDirection))return;const{projection:l}=this.visualElement,i=this.getAxisMotionValue(t);if(l&&l.layout){const{min:o,max:u}=l.layout.layoutBox[t],c=i.get()||0;i.set(r[t]-Ir(o,u,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:r,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!ad(t)||!n||!this.constraints)return;this.stopAnimation();const l={x:0,y:0};zi(o=>{const u=this.getAxisMotionValue(o);if(u&&this.constraints!==!1){const c=u.get();l[o]=zD({min:c,max:c},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),zi(o=>{if(!Eh(o,r,null))return;const u=this.getAxisMotionValue(o),{min:c,max:s}=this.constraints[o];u.set(Ir(c,s,l[o]))})}addListeners(){if(!this.visualElement.current)return;VD.set(this.visualElement,this);const r=this.visualElement.current,t=hd(r,"pointerdown",c=>{const{drag:s,dragListener:d=!0}=this.getProps();s&&d&&!b8(c.target)&&this.start(c)}),n=()=>{const{dragConstraints:c}=this.getProps();ad(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:l}=this.visualElement,i=l.addEventListener("measure",n);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),jr.read(n);const o=jd(window,"resize",()=>this.scalePositionWithinConstraints()),u=l.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:s})=>{this.isDragging&&s&&(zi(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())}));return()=>{o(),t(),i(),u&&u()}}getProps(){const r=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:l=!1,dragConstraints:i=!1,dragElastic:o=By,dragMomentum:u=!0}=r;return{...r,drag:t,dragDirectionLock:n,dragPropagation:l,dragConstraints:i,dragElastic:o,dragMomentum:u}}}function Eh(e,r,t){return(r===!0||r===e)&&(t===null||t===e)}function HD(e,r=10){let t=null;return Math.abs(e.y)>r?t="y":Math.abs(e.x)>r&&(t="x"),t}class WD extends No{constructor(r){super(r),this.removeGroupControls=Hi,this.removeListeners=Hi,this.controls=new qD(r)}mount(){const{dragControls:r}=this.node.getProps();r&&(this.removeGroupControls=r.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Hi}update(){const{dragControls:r}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};r!==t&&(this.removeGroupControls(),r&&(this.removeGroupControls=r.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}}const M4=e=>(r,t)=>{e&&jr.postRender(()=>e(r,t))};class KD extends No{constructor(){super(...arguments),this.removePointerDownListener=Hi}onPointerDown(r){this.session=new rC(r,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tC(this.node)})}createPanHandlers(){const{onPanSessionStart:r,onPanStart:t,onPan:n,onPanEnd:l}=this.node.getProps();return{onSessionStart:M4(r),onStart:M4(t),onMove:n,onEnd:(i,o)=>{delete this.session,l&&jr.postRender(()=>l(i,o))}}}mount(){this.removePointerDownListener=hd(this.node.current,"pointerdown",r=>this.onPointerDown(r))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let wx=!1;class XD extends R.Component{componentDidMount(){const{visualElement:r,layoutGroup:t,switchLayoutGroup:n,layoutId:l}=this.props,{projection:i}=r;i&&(t.group&&t.group.add(i),n&&n.register&&l&&n.register(i),wx&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),im.hasEverUpdated=!0}getSnapshotBeforeUpdate(r){const{layoutDependency:t,visualElement:n,drag:l,isPresent:i}=this.props,{projection:o}=n;return o&&(o.isPresent=i,wx=!0,l||r.layoutDependency!==t||t===void 0||r.isPresent!==i?o.willUpdate():this.safeToRemove(),r.isPresent!==i&&(i?o.promote():o.relegate()||jr.postRender(()=>{const u=o.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:r}=this.props.visualElement;r&&(r.root.didUpdate(),E1.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:r,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:l}=r;wx=!0,l&&(l.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(l),n&&n.deregister&&n.deregister(l))}safeToRemove(){const{safeToRemove:r}=this.props;r&&r()}render(){return null}}function iC(e){const[r,t]=W8(),n=R.useContext(s1);return a.jsx(XD,{...e,layoutGroup:n,switchLayoutGroup:R.useContext(J8),isPresent:r,safeToRemove:t})}const GD={pan:{Feature:KD},drag:{Feature:WD,ProjectionNode:H8,MeasureLayout:iC}};function O4(e,r,t){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",t==="Start");const l="onHover"+t,i=n[l];i&&jr.postRender(()=>i(r,Hd(r)))}class YD extends No{mount(){const{current:r}=this.node;r&&(this.unmount=OI(r,(t,n)=>(O4(this.node,n,"Start"),l=>O4(this.node,l,"End"))))}unmount(){}}class ZD extends No{constructor(){super(...arguments),this.isActive=!1}onFocus(){let r=!1;try{r=this.node.current.matches(":focus-visible")}catch{r=!0}!r||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ud(jd(this.node.current,"focus",()=>this.onFocus()),jd(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function P4(e,r,t){const{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",t==="Start");const l="onTap"+(t==="End"?"":t),i=n[l];i&&jr.postRender(()=>i(r,Hd(r)))}class QD extends No{mount(){const{current:r}=this.node;r&&(this.unmount=II(r,(t,n)=>(P4(this.node,n,"Start"),(l,{success:i})=>P4(this.node,l,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const zy=new WeakMap,_x=new WeakMap,JD=e=>{const r=zy.get(e.target);r&&r(e)},eL=e=>{e.forEach(JD)};function tL({root:e,...r}){const t=e||document;_x.has(t)||_x.set(t,{});const n=_x.get(t),l=JSON.stringify(r);return n[l]||(n[l]=new IntersectionObserver(eL,{root:e,...r})),n[l]}function rL(e,r,t){const n=tL(r);return zy.set(e,t),n.observe(e),()=>{zy.delete(e),n.unobserve(e)}}const nL={some:0,all:1};class iL extends No{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:r={}}=this.node.getProps(),{root:t,margin:n,amount:l="some",once:i}=r,o={root:t?t.current:void 0,rootMargin:n,threshold:typeof l=="number"?l:nL[l]},u=c=>{const{isIntersecting:s}=c;if(this.isInView===s||(this.isInView=s,i&&!s&&this.hasEnteredView))return;s&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",s);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=s?d:f;h&&h(c)};return rL(this.node.current,o,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:r,prevProps:t}=this.node;["amount","margin","root"].some(sL(r,t))&&this.startObserver()}unmount(){}}function sL({viewport:e={}},{viewport:r={}}={}){return t=>e[t]!==r[t]}const aL={inView:{Feature:iL},tap:{Feature:QD},focus:{Feature:ZD},hover:{Feature:YD}},oL={layout:{ProjectionNode:H8,MeasureLayout:iC}},lL={...PD,...aL,...GD,...oL},T4=CD(lL,ED);const cL=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),uL=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,t,n)=>n?n.toUpperCase():t.toLowerCase()),I4=e=>{const r=uL(e);return r.charAt(0).toUpperCase()+r.slice(1)},sC=(...e)=>e.filter((r,t,n)=>!!r&&r.trim()!==""&&n.indexOf(r)===t).join(" ").trim(),dL=e=>{for(const r in e)if(r.startsWith("aria-")||r==="role"||r==="title")return!0};var fL={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const hL=R.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:t=2,absoluteStrokeWidth:n,className:l="",children:i,iconNode:o,...u},c)=>R.createElement("svg",{ref:c,...fL,width:r,height:r,stroke:e,strokeWidth:n?Number(t)*24/Number(r):t,className:sC("lucide",l),...!i&&!dL(u)&&{"aria-hidden":"true"},...u},[...o.map(([s,d])=>R.createElement(s,d)),...Array.isArray(i)?i:[i]]));const Bt=(e,r)=>{const t=R.forwardRef(({className:n,...l},i)=>R.createElement(hL,{ref:i,iconNode:r,className:sC(`lucide-${cL(I4(e))}`,`lucide-${e}`,n),...l}));return t.displayName=I4(e),t};const mL=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],pL=Bt("arrow-left-right",mL);const gL=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],$y=Bt("arrow-right",gL);const xL=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],bL=Bt("calendar-days",xL);const yL=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],vL=Bt("camera",yL);const wL=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],R4=Bt("check",wL);const _L=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Uy=Bt("chevron-down",_L);const jL=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],SL=Bt("chevron-left",jL);const kL=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],NL=Bt("chevron-right",kL);const CL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Vy=Bt("circle-alert",CL);const EL=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],AL=Bt("circle-check-big",EL);const ML=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],D4=Bt("circle-user",ML);const OL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],PL=Bt("circle-x",OL);const TL=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],IL=Bt("credit-card",TL);const RL=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],qy=Bt("dollar-sign",RL);const DL=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],LL=Bt("download",DL);const FL=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],BL=Bt("ellipsis-vertical",FL);const zL=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],wa=Bt("file-down",zL);const $L=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],L4=Bt("file-spreadsheet",$L);const UL=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Sm=Bt("file-text",UL);const VL=[["path",{d:"M11 12h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 14",key:"1j4xps"}],["path",{d:"m7 18 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9",key:"uospg8"}],["path",{d:"m2 13 6 6",key:"16e5sb"}]],qL=Bt("hand-helping",VL);const HL=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],L1=Bt("heart",HL);const WL=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Hy=Bt("house",WL);const KL=[["path",{d:"M10 18v-7",key:"wt116b"}],["path",{d:"M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z",key:"1m329m"}],["path",{d:"M14 18v-7",key:"vav6t3"}],["path",{d:"M18 18v-7",key:"aexdmj"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M6 18v-7",key:"1ivflk"}]],XL=Bt("landmark",KL);const GL=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],F4=Bt("layout-dashboard",GL);const YL=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ZL=Bt("loader-circle",YL);const QL=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],JL=Bt("log-out",QL);const eF=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],mo=Bt("mail",eF);const tF=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],rF=Bt("map-pin",tF);const nF=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],B4=Bt("message-square",nF);const iF=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],aC=Bt("paperclip",iF);const sF=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],od=Bt("phone",sF);const aF=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],sm=Bt("plus",aF);const oF=[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]],lF=Bt("receipt",oF);const cF=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],F1=Bt("refresh-cw",cF);const uF=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]],dF=Bt("scale",uF);const fF=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],oC=Bt("search",fF);const hF=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Wy=Bt("settings",hF);const mF=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],pF=Bt("tags",mF);const gF=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],xF=Bt("trash-2",gF);const bF=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],yF=Bt("trending-up",bF);const vF=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],wF=Bt("triangle-alert",vF);const _F=[["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m14.305 16.53.923-.382",key:"1itpsq"}],["path",{d:"m15.228 13.852-.923-.383",key:"eplpkm"}],["path",{d:"m16.852 12.228-.383-.923",key:"13v3q0"}],["path",{d:"m16.852 17.772-.383.924",key:"1i8mnm"}],["path",{d:"m19.148 12.228.383-.923",key:"1q8j1v"}],["path",{d:"m19.53 18.696-.382-.924",key:"vk1qj3"}],["path",{d:"m20.772 13.852.924-.383",key:"n880s0"}],["path",{d:"m20.772 16.148.924.383",key:"1g6xey"}],["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],km=Bt("user-cog",_F);const jF=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Nm=Bt("users",jF);const SF=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],lC=Bt("wallet",SF);const kF=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],mr=Bt("x",kF),jx="/logoHaggai.avif",NF="/seminaireregional.webp",Xu=["/slideshow/slide1.webp","/slideshow/slide2.webp","/slideshow/slide3.avif","/slideshow/slide4.webp","/slideshow/slide5.avif","/slideshow/slide6.avif","/slideshow/slide7.avif","/slideshow/slide8.webp"],CF=[{title:"Séminaire Régional Hybride",dateLocation:"Du 22 au 30 oct : Session en ligne • Du 15 au 19 nov : Présentiel au Burkina Faso",imageUrl:NF,imageAlt:"Participants au Séminaire Régional Hybride",buttonLabel:"S'inscrire"}],EF=[{name:"Sundar Sangma",title:"Vice Président chargé du développement international du ministère",img:"/intervenants/1-Sundar_Sangma.png"},{name:"Bastian Babu",title:"Directeur Exécutif chargé des ministères nationaux",img:"/intervenants/2-Bastian_Babu.png"},{name:"Lucky Shabangu",title:"Directeur Afrique",img:"/intervenants/3-Lucky_Shabangu.png"},{name:"Aboua Omer Liacet",title:"Représentant régional Afrique Francophone",img:"/intervenants/4.Aboua_Omer_Liacet.png"}];function cC(...e){return e.filter(Boolean).join(" ")}function z4({children:e,className:r="",...t}){return a.jsxs("a",{className:cC("inline-flex items-center justify-center gap-2 rounded-none px-4 py-2 sm:px-6 sm:py-3 text-sm sm:text-base font-medium border-2 border-brand-900","bg-brand-700 text-white","hover:bg-brand-900 focus:outline-none focus:ring-2 focus:ring-brand-600 focus:ring-offset-2 focus:ring-offset-ink-900","transition uppercase tracking-wider",r),...t,children:[e,a.jsx($y,{className:"h-4 w-4"})]})}function AF({children:e,className:r="",...t}){return a.jsx("a",{className:cC("inline-flex items-center justify-center rounded-none px-4 py-2 sm:px-6 sm:py-3 text-sm sm:text-base font-medium border-2 border-white bg-transparent text-surface-0","hover:bg-white/10 focus:outline-none focus:ring-2 focus:ring-white/40 focus:ring-offset-2 focus:ring-offset-ink-900","transition uppercase tracking-wider",r),...t,children:e})}function MF(){const[e,r]=R.useState(0),[t,n]=R.useState(!1);R.useEffect(()=>{const c=setInterval(()=>{r(s=>(s+1)%Xu.length)},5e3);return()=>clearInterval(c)},[]);const l=()=>{r(c=>(c-1+Xu.length)%Xu.length)},i=()=>{r(c=>(c+1)%Xu.length)},o=c=>{c.preventDefault();const s=document.getElementById("events");s&&s.scrollIntoView({behavior:"smooth"})},u=c=>{c.preventDefault();const s=document.getElementById("speakers");s&&s.scrollIntoView({behavior:"smooth"})};return a.jsxs("div",{className:"min-h-screen bg-surface-0 font-sans",children:[a.jsxs("header",{className:"sticky top-0 z-50 border-b border-ink-500/20 bg-brand-700 shadow-soft",children:[a.jsxs("div",{className:"mx-auto flex items-center justify-between px-[10%] py-1 sm:py-1.5",children:[a.jsxs("a",{href:"/",className:"flex items-center gap-2 hover:opacity-80 transition-opacity flex-shrink-0 min-w-0",children:[a.jsx("img",{src:jx,alt:"Sommet Francophone",className:"h-6 sm:h-7 md:h-8 w-auto flex-shrink-0 brightness-0 invert"}),a.jsx("span",{className:"text-xs sm:text-sm md:text-base lg:text-lg font-heading font-medium tracking-wide text-surface-0 uppercase truncate",children:"Sommet Francophone"})]}),a.jsxs("nav",{className:"hidden items-center gap-4 sm:gap-6 text-xs sm:text-sm font-light text-surface-0/80 md:flex",children:[a.jsx("a",{className:"hover:text-surface-0 transition-colors uppercase",href:"#events",onClick:o,children:"Événements"}),a.jsx("a",{className:"hover:text-surface-0 transition-colors uppercase",href:"#speakers",onClick:u,children:"Intervenants"})]}),a.jsxs("div",{className:"hidden md:flex items-center gap-2 sm:gap-3",children:[a.jsx("a",{href:"/inscription",className:"inline-flex items-center justify-center rounded-pill px-3 py-1.5 text-xs sm:text-sm font-medium text-ink-900 bg-gold-500 shadow-soft hover:bg-gold-600 transition-all uppercase",children:"Inscription"}),a.jsx("a",{href:"/soutenir",className:"inline-flex items-center justify-center rounded-pill px-3 py-1.5 text-xs sm:text-sm font-medium bg-brand-900 text-surface-0 shadow-soft hover:bg-ink-900 transition-all uppercase",children:"Soutenir"}),a.jsx("div",{className:"h-6 w-px bg-surface-0/30 mx-1"}),a.jsx("a",{href:"/login",className:"inline-flex items-center justify-center rounded-pill px-3 py-1.5 text-xs sm:text-sm font-medium text-surface-0 hover:text-gold-500 transition-colors uppercase",children:"Connexion"})]}),a.jsx("div",{className:"md:hidden",children:a.jsx("button",{onClick:()=>n(!t),className:"text-surface-0 hover:text-gold-500 focus:outline-none","aria-label":"Toggle menu",children:a.jsx("svg",{className:"h-6 w-6",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:t?a.jsx("path",{d:"M6 18L18 6M6 6l12 12"}):a.jsx("path",{d:"M4 6h16M4 12h16M4 18h16"})})})})]}),t&&a.jsxs("div",{className:"md:hidden py-4 px-[10%] space-y-2 border-t border-surface-0/20",children:[a.jsx("a",{href:"#events",className:"block py-2 text-sm font-light text-surface-0/80 hover:text-surface-0 transition-colors uppercase",onClick:c=>{n(!1),o(c)},children:"Événements"}),a.jsx("a",{href:"#speakers",className:"block py-2 text-sm font-light text-surface-0/80 hover:text-surface-0 transition-colors uppercase",onClick:c=>{n(!1),u(c)},children:"Intervenants"}),a.jsx("a",{href:"/inscription",className:"block py-2 text-sm font-light text-surface-0/80 hover:text-surface-0 transition-colors uppercase",onClick:()=>n(!1),children:"Inscription"}),a.jsx("a",{href:"/soutenir",className:"block py-2 text-sm font-light text-surface-0/80 hover:text-surface-0 transition-colors uppercase",onClick:()=>n(!1),children:"Soutenir"}),a.jsx("div",{className:"h-px bg-surface-0/20 my-2"}),a.jsx("a",{href:"/login",className:"block py-2 text-sm font-light text-surface-0/80 hover:text-surface-0 transition-colors uppercase",onClick:()=>n(!1),children:"Connexion"})]})]}),a.jsxs("section",{className:"relative overflow-hidden text-surface-0",children:[a.jsxs("div",{className:"absolute inset-0",children:[a.jsx(rD,{mode:"wait",children:a.jsx(T4.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:1},className:"absolute inset-0 h-full w-full bg-cover bg-center",style:{backgroundImage:`url(${Xu[e]})`}},e)}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-brand-900/40 via-brand-900/60 to-brand-900/80"}),a.jsx("div",{className:"absolute -left-40 -top-40 h-96 w-96 rounded-full bg-brand-700/15 blur-3xl"}),a.jsx("div",{className:"absolute -right-40 top-10 h-96 w-96 rounded-full bg-brand-700/10 blur-3xl"})]}),a.jsx("button",{onClick:l,className:"absolute left-4 sm:left-6 md:left-8 top-1/2 -translate-y-1/2 z-20 p-2 rounded-full bg-white/10 backdrop-blur-sm hover:bg-white/20 transition-all opacity-60 hover:opacity-100","aria-label":"Image précédente",children:a.jsx(SL,{className:"w-5 h-5 sm:w-6 sm:h-6 text-white"})}),a.jsx("button",{onClick:i,className:"absolute right-4 sm:right-6 md:right-8 top-1/2 -translate-y-1/2 z-20 p-2 rounded-full bg-white/10 backdrop-blur-sm hover:bg-white/20 transition-all opacity-60 hover:opacity-100","aria-label":"Image suivante",children:a.jsx(NL,{className:"w-5 h-5 sm:w-6 sm:h-6 text-white"})}),a.jsx("div",{className:"relative mx-auto max-w-container px-3 sm:px-4 md:px-6 lg:px-8 pt-14 sm:pt-20 w-full min-h-[calc(100vh-100px)] sm:min-h-[calc(100vh-110px)] md:min-h-[calc(100vh-120px)] flex items-center justify-center pb-20 sm:pb-24",children:a.jsxs(T4.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.6},className:"max-w-4xl text-center",children:[a.jsx("p",{className:"text-xl sm:text-2xl md:text-3xl lg:text-4xl font-heading font-medium leading-relaxed text-surface-0 uppercase tracking-wide",children:"Mettre fin à la pauvreté de l'Évangile en Afrique."}),a.jsx("p",{className:"mt-4 text-lg sm:text-xl md:text-2xl lg:text-3xl font-heading font-normal leading-relaxed text-surface-0/90",children:"Sommet Haggai Afrique Francophone Ouaga 2026"}),a.jsx("div",{className:"mt-8 sm:mt-10 flex justify-center",children:a.jsxs("a",{href:"/inscription",className:"inline-flex items-center justify-center gap-2 rounded-lg border-2 border-white bg-white/10 px-6 py-3 sm:px-8 sm:py-3.5 text-sm sm:text-base font-medium text-white uppercase tracking-wider hover:bg-white/20 transition-all focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-transparent",children:["S'inscrire",a.jsx($y,{className:"h-4 w-4 sm:h-5 sm:w-5"})]})})]})})]}),a.jsx("div",{className:"sticky top-[36px] sm:top-[40px] md:top-[44px] z-40 bg-brand-900 w-full py-2 sm:py-2.5 shadow-soft -mt-0",children:a.jsxs("div",{className:"mx-auto max-w-container px-4 sm:px-6 lg:px-8 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[a.jsx("img",{src:jx,alt:"Sommet Francophone",className:"h-7 sm:h-8 md:h-9 w-auto brightness-0 invert"}),a.jsx("span",{className:"text-surface-0 text-xs sm:text-sm md:text-base font-body font-light tracking-wide",children:"Sommet Francophone"}),a.jsx("div",{className:"flex items-center justify-center w-6 h-6 sm:w-7 sm:h-7 md:w-8 md:h-8 rounded-full bg-surface-0",children:a.jsx("span",{className:"text-brand-900 text-[10px] sm:text-xs md:text-sm font-semibold",children:"26"})})]}),a.jsx("a",{href:"/inscription",className:"text-surface-0 uppercase text-xs sm:text-sm md:text-base font-medium tracking-wider hover:opacity-90 transition-opacity",children:"S'inscrire"})]})}),a.jsx("section",{className:"bg-surface-0 py-14 md:py-18 lg:py-24",children:a.jsx("div",{className:"max-w-6xl mx-auto px-4 md:px-6",children:a.jsxs("div",{className:"max-w-4xl",children:[a.jsxs("h2",{className:"text-4xl sm:text-5xl md:text-6xl lg:text-7xl font-heading font-medium text-ink-900 leading-tight mb-8 sm:mb-12 tracking-wide",children:["Sommet Haggai",a.jsx("br",{}),"Francophone",a.jsx("br",{}),"2026"]}),a.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 mb-4 sm:mb-6",children:[a.jsx(bL,{className:"text-brand-900 flex-shrink-0 w-6 h-6 sm:w-7 sm:h-7 md:w-8 md:h-8 lg:w-9 lg:h-9"}),a.jsx("p",{className:"text-3xl sm:text-4xl md:text-5xl lg:text-6xl font-body font-light text-ink-900 leading-tight",children:"19-22 novembre 2026"})]}),a.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 mb-12 sm:mb-16",children:[a.jsx(rF,{className:"text-brand-900 flex-shrink-0 w-5 h-5 sm:w-6 sm:h-6 md:w-7 md:h-7 lg:w-8 lg:h-8"}),a.jsx("p",{className:"text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-body font-light text-ink-900 leading-tight",children:"Sopatel Silmande Hôtel, Ouagadougou"})]}),a.jsx("div",{className:"flex flex-col sm:flex-row gap-4 sm:gap-6",children:a.jsx("a",{href:"/inscription",className:"inline-flex items-center justify-center rounded-none border-2 border-white bg-brand-700 px-6 py-3 text-sm sm:text-base font-semibold text-white uppercase tracking-wider hover:bg-brand-900 transition-all",children:"Inscrivez-vous"})})]})})}),a.jsx("section",{className:"bg-brand-900 text-surface-0",children:a.jsx("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-14 md:py-18 lg:py-24",children:a.jsxs("div",{className:"mx-auto max-w-3xl text-center",children:[a.jsx("p",{className:"text-xs sm:text-sm md:text-base font-body font-bold uppercase tracking-wider text-brand-700",children:"Thèmes et contenu"}),a.jsx("h2",{className:"mt-3 text-2xl sm:text-3xl md:text-4xl font-heading font-normal tracking-tight",children:"« L'autonomisation des ministères nationaux comme facteur clé pour mettre fin à la pauvreté de l'exposition à l'Évangile en Afrique francophone. »"}),a.jsx("p",{className:"mt-4 text-base sm:text-lg md:text-xl font-body font-extralight leading-relaxed text-surface-0/80",children:"Des ateliers de réflexion, des partages de meilleures pratiques, réseautage et renforcement des collaborations régionales."})]})})}),a.jsx("section",{id:"speakers",className:"bg-brand-50 py-14 md:py-18 lg:py-24",children:a.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6",children:[a.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-heading font-medium text-ink-900 leading-tight mb-10 sm:mb-12 tracking-wide uppercase",children:"INTERVENANTS"}),a.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 sm:gap-4 md:gap-5",children:EF.slice(0,4).map((c,s)=>a.jsxs("div",{className:"flex flex-col items-center text-center",children:[a.jsx("div",{className:"relative aspect-[3/4] w-full mb-3 sm:mb-4 overflow-hidden rounded-xl2 shadow-soft",children:a.jsx("img",{src:c.img,alt:c.name,className:"h-full w-full object-cover transition duration-500 hover:scale-[1.05]",style:{filter:"contrast(1.1) saturate(1.2) brightness(0.95)"},loading:"lazy"})}),a.jsx("h3",{className:"text-sm sm:text-base md:text-lg font-body font-semibold text-ink-900 mb-1 leading-tight",children:c.name}),a.jsx("p",{className:"text-xs sm:text-sm font-body font-extralight text-ink-500 leading-relaxed",children:c.title})]},s))}),a.jsx("div",{className:"mt-10 flex justify-center",children:a.jsxs("a",{href:"#",className:"inline-flex items-center gap-2 rounded-none border-2 border-ink-900 bg-brand-900 px-6 py-3 text-sm sm:text-base font-medium text-surface-0 hover:bg-ink-900 transition-all uppercase tracking-wider",children:["Voir tous les intervenants ",a.jsx($y,{className:"h-4 w-4"})]})})]})}),a.jsx("section",{id:"events",className:"bg-surface-0",children:a.jsxs("div",{className:"bg-brand-900 w-full",style:{width:"100vw",marginLeft:"calc(50% - 50vw)",marginRight:"calc(50% - 50vw)"},children:[a.jsx("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-10 sm:py-12",children:a.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-heading font-medium text-surface-0 leading-tight uppercase tracking-wide",children:"AUTRES EVENEMENTS"})}),a.jsx("div",{className:"space-y-0",children:CF.map((c,s)=>a.jsx("div",{className:"group overflow-hidden",children:a.jsxs("div",{className:"relative aspect-video overflow-hidden bg-ink-500 bg-opacity-10",children:[a.jsx("img",{src:c.imageUrl,alt:c.imageAlt,className:"h-full w-full object-cover transition duration-500 group-hover:scale-[1.02] brightness-110",loading:"lazy"}),a.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-1/2 md:h-2/5 bg-gradient-to-t from-brand-900/90 via-brand-900/75 to-brand-900/30 md:via-brand-900/70 md:to-brand-900/40"}),a.jsx("div",{className:"absolute bottom-0 left-0 right-0 flex flex-col justify-end text-surface-0 w-full md:w-[90%] md:left-[5%] p-6 md:p-12",children:a.jsxs("div",{className:"space-y-3 w-full",children:[a.jsx("h3",{className:"text-2xl sm:text-3xl md:text-4xl font-heading font-medium mb-2 drop-shadow-lg",children:c.title}),a.jsx("div",{className:"text-base sm:text-lg md:text-xl font-body font-medium drop-shadow-md space-y-1",children:c.title==="Séminaire Régional Hybride"?a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"Du 22 au 30 oct : Session en ligne"}),a.jsx("p",{children:"Du 15 au 19 nov : Présentiel au Burkina Faso"})]}):a.jsx("p",{children:c.dateLocation})}),a.jsxs("div",{className:"pt-4 flex flex-wrap gap-3",children:[a.jsx(z4,{href:"/inscription",className:"px-4 py-2",children:c.buttonLabel}),c.title==="Séminaire Régional Hybride"&&a.jsx(AF,{href:"/inscription?preselect=recommend",className:"px-4 py-2",children:"Recommander"})]})]})})]})},s))})]})}),a.jsx("section",{id:"register",className:"bg-surface-0 py-14 md:py-18 lg:py-24",children:a.jsx("div",{className:"max-w-6xl mx-auto px-4 md:px-6",children:a.jsxs("div",{className:"relative overflow-hidden rounded-xl2 bg-brand-900 p-10 shadow-soft ring-1 ring-ink-900/5 sm:p-12",children:[a.jsx("div",{className:"absolute -left-24 -top-24 h-72 w-72 rounded-full bg-brand-700/22 blur-3xl"}),a.jsx("div",{className:"absolute -right-24 -bottom-24 h-72 w-72 rounded-full bg-brand-700/16 blur-3xl"}),a.jsxs("div",{className:"relative mx-auto max-w-2xl text-center text-surface-0",children:[a.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-heading font-normal tracking-tight",children:"Prêt à faire accroître votre impact pour la transformation de l'Afrique ?"}),a.jsx("p",{className:"mt-4 text-base sm:text-lg md:text-xl font-body font-extralight leading-relaxed text-surface-0/80",children:"Réservez votre place. Recevez les informations pratiques. Rejoignez la communauté régionale de leaders Haggai pour cet effort commun."}),a.jsxs("div",{className:"mt-7 flex flex-col justify-center gap-3 sm:flex-row",children:[a.jsx(z4,{href:"/inscription",children:"S'inscrire maintenant"}),a.jsx("a",{href:"/soutenir",className:"inline-flex items-center justify-center rounded-none border-2 border-surface-0 px-4 py-2 sm:px-6 sm:py-3 text-sm sm:text-base font-medium bg-transparent text-surface-0 hover:bg-surface-0/10 transition-all uppercase tracking-wider",children:"Soutenir"}),a.jsx("a",{href:"#",className:"inline-flex items-center justify-center rounded-none border-2 border-surface-0 px-4 py-2 sm:px-6 sm:py-3 text-sm sm:text-base font-medium bg-transparent text-surface-0 hover:bg-surface-0/10 transition-all uppercase tracking-wider",children:"Télécharger la brochure"})]}),a.jsxs("div",{className:"mt-8 grid gap-3 sm:grid-cols-[1fr_auto]",children:[a.jsx("input",{type:"email",placeholder:"Votre email pour recevoir les infos",className:"h-12 w-full rounded-none border-2 border-surface-0/30 bg-surface-0/10 px-4 text-sm sm:text-base font-body font-normal text-surface-0 placeholder:text-surface-0/55 focus:outline-none focus:ring-2 focus:ring-brand-700/60 focus:border-brand-700/50"}),a.jsx("a",{href:"#",className:"inline-flex h-12 items-center justify-center rounded-none border-2 border-ink-900 bg-surface-0 px-4 sm:px-5 text-sm sm:text-base font-medium text-ink-900 hover:bg-brand-50 transition-all uppercase tracking-wider",children:"Recevoir"})]})]})]})})}),a.jsx("footer",{className:"border-t border-ink-500/20 bg-brand-900 text-surface-0",children:a.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-10",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 mb-8",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[a.jsx("img",{src:jx,alt:"Sommet Francophone",className:"h-10 md:h-12 w-auto brightness-0 invert"}),a.jsx("h3",{className:"text-xl font-heading font-medium text-surface-0",children:"Sommet Francophone"})]}),a.jsx("p",{className:"text-surface-0/80 text-sm sm:text-base font-body font-medium leading-relaxed",children:"Equiper et inspirer des leaders bien placés pour la transformation de l'Afrique"})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-base sm:text-lg font-body font-semibold mb-4 text-surface-0",children:"Liens rapides"}),a.jsxs("ul",{className:"space-y-2 text-sm sm:text-base text-surface-0/70",children:[a.jsx("li",{children:a.jsx("a",{href:"#events",onClick:o,className:"hover:text-surface-0 transition-colors",children:"Événements"})}),a.jsx("li",{children:a.jsx("a",{href:"#speakers",onClick:u,className:"hover:text-surface-0 transition-colors",children:"Intervenants"})}),a.jsx("li",{children:a.jsx("a",{href:"/inscription",className:"hover:text-surface-0 transition-colors",children:"Inscription"})}),a.jsx("li",{children:a.jsx("a",{href:"#",className:"hover:text-surface-0 transition-colors",children:"Contributions"})})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-base sm:text-lg font-body font-semibold mb-4 text-surface-0",children:"Contact"}),a.jsxs("p",{className:"text-sm sm:text-base text-surface-0/70",children:["Pour toute question, contactez-nous à"," ",a.jsx("a",{href:"mailto:communication@sommetfrancophone.org",className:"hover:text-surface-0 transition-colors",children:"communication@sommetfrancophone.org"})]})]})]}),a.jsx("div",{className:"pt-8 border-t border-surface-0/20 text-center text-sm sm:text-base text-surface-0/60",children:a.jsxs("p",{children:["© ",new Date().getFullYear()," Sommet Francophone. Tous droits réservés."]})})]})})]})}function OF(){const[e,r]=R.useState(!1);return a.jsxs("nav",{className:"bg-brand-700 shadow-soft sticky top-0 z-50",children:[a.jsxs("div",{className:"mx-auto flex items-center justify-between px-[10%] py-1 sm:py-1.5",children:[a.jsxs(kr,{to:"/",className:"flex items-center gap-2 hover:opacity-80 transition-opacity flex-shrink-0 min-w-0",children:[a.jsx("img",{src:"/logoHaggai.avif",alt:"Sommet Francophone",className:"h-6 sm:h-7 md:h-8 w-auto flex-shrink-0 brightness-0 invert"}),a.jsx("span",{className:"text-xs sm:text-sm md:text-base lg:text-lg font-heading font-medium tracking-wide text-surface-0 uppercase truncate",children:"SOMMET FRANCOPHONE"})]}),a.jsxs("nav",{className:"hidden items-center gap-4 sm:gap-6 text-xs sm:text-sm font-light text-surface-0 md:flex",children:[a.jsx(kr,{to:"/#events",className:"hover:opacity-80 transition-opacity uppercase",children:"Événements"}),a.jsx(kr,{to:"/#speakers",className:"hover:opacity-80 transition-opacity uppercase",children:"Intervenants"})]}),a.jsxs("div",{className:"hidden md:flex items-center gap-2 sm:gap-3",children:[a.jsx(kr,{to:"/inscription",className:"inline-flex items-center justify-center rounded-pill px-4 py-2 text-xs sm:text-sm font-semibold text-ink-900 bg-gold-500 shadow-soft hover:bg-gold-600 transition-all uppercase",children:"Inscription"}),a.jsx(kr,{to:"/soutenir",className:"inline-flex items-center justify-center rounded-pill px-4 py-2 text-xs sm:text-sm font-medium bg-brand-900 text-surface-0 shadow-soft hover:bg-ink-900 transition-all uppercase",children:"Soutenir"}),a.jsx("div",{className:"h-6 w-px bg-surface-0/30 mx-1"}),a.jsx(kr,{to:"/login",className:"inline-flex items-center justify-center rounded-pill px-4 py-2 text-xs sm:text-sm font-medium text-surface-0 hover:opacity-80 transition-opacity uppercase",children:"Connexion"})]}),a.jsx("div",{className:"md:hidden",children:a.jsx("button",{onClick:()=>r(!e),className:"text-surface-0 hover:opacity-80 focus:outline-none","aria-label":"Toggle menu",children:a.jsx("svg",{className:"h-6 w-6",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e?a.jsx("path",{d:"M6 18L18 6M6 6l12 12"}):a.jsx("path",{d:"M4 6h16M4 12h16M4 18h16"})})})})]}),e&&a.jsxs("div",{className:"md:hidden py-4 px-[10%] space-y-2 border-t border-surface-0/20 bg-brand-700",children:[a.jsx(kr,{to:"/#events",className:"block py-2 text-sm font-light text-surface-0 hover:opacity-80 transition-opacity uppercase",onClick:()=>r(!1),children:"Événements"}),a.jsx(kr,{to:"/#speakers",className:"block py-2 text-sm font-light text-surface-0 hover:opacity-80 transition-opacity uppercase",onClick:()=>r(!1),children:"Intervenants"}),a.jsx(kr,{to:"/inscription",className:"block py-2 text-sm font-light text-surface-0 hover:opacity-80 transition-opacity uppercase",onClick:()=>r(!1),children:"Inscription"}),a.jsx(kr,{to:"/soutenir",className:"block py-2 text-sm font-light text-surface-0 hover:opacity-80 transition-opacity uppercase",onClick:()=>r(!1),children:"Soutenir"}),a.jsx("div",{className:"h-px bg-surface-0/20 my-2"}),a.jsx(kr,{to:"/login",className:"block py-2 text-sm font-light text-surface-0 hover:opacity-80 transition-opacity uppercase",onClick:()=>r(!1),children:"Connexion"})]})]})}function PF(){return a.jsx("footer",{className:"bg-brand-900 text-white mt-auto",children:a.jsxs("div",{className:"max-w-container mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[a.jsx("img",{src:"/logoHaggai.avif",alt:"Sommet Francophone",className:"h-10 md:h-12 w-auto"}),a.jsx("h3",{className:"text-xl font-heading font-medium text-white",children:"Sommet Francophone"})]}),a.jsx("p",{className:"text-gray-200 text-sm font-medium leading-relaxed",children:"Former et équiper des leaders pour transformer l'Afrique."})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold mb-4",children:"Liens rapides"}),a.jsxs("ul",{className:"space-y-2 text-sm text-gray-300",children:[a.jsx("li",{children:a.jsx("a",{href:"#",className:"hover:text-white transition-colors",children:"Événements"})}),a.jsx("li",{children:a.jsx("a",{href:"#",className:"hover:text-white transition-colors",children:"Inscription"})}),a.jsx("li",{children:a.jsx("a",{href:"#",className:"hover:text-white transition-colors",children:"Contributions"})})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold mb-4",children:"Contact"}),a.jsxs("p",{className:"text-sm text-gray-300 space-y-2",children:[a.jsxs("span",{className:"block",children:["Pour toute question :"," ",a.jsx("a",{href:"mailto:contact@sommetfrancophone.org",className:"hover:text-white transition-colors",children:"contact@sommetfrancophone.org"})]}),a.jsxs("span",{className:"block",children:["Support / communication :"," ",a.jsx("a",{href:"mailto:communication@sommetfrancophone.org",className:"hover:text-white transition-colors",children:"communication@sommetfrancophone.org"})," ","(+225 05 5427 5725 WhatsApp)"]}),a.jsxs("span",{className:"block",children:["Questions finance :"," ",a.jsx("a",{href:"mailto:finance@sommetfrancophone.org",className:"hover:text-white transition-colors",children:"finance@sommetfrancophone.org"})]})]})]})]}),a.jsx("div",{className:"mt-8 pt-8 border-t border-gray-700 text-center text-sm text-gray-400",children:a.jsxs("p",{children:["© ",new Date().getFullYear()," Sommet Francophone. Tous droits réservés."]})})]})})}function ul({children:e}){return a.jsxs("div",{className:"min-h-screen flex flex-col bg-brand-50",children:[a.jsx(OF,{}),a.jsx("main",{className:"flex-1 pt-0",children:e}),a.jsx(PF,{})]})}const TF="https://api.sommetfrancophone.org/api";class Vt extends Error{constructor(r,t,n){super(n||t.message||"Une erreur est survenue"),this.status=r,this.data=t,this.name="ApiClientError"}}class IF{baseUrl;authToken=null;constructor(r=TF){this.baseUrl=r,typeof window<"u"&&(this.authToken=localStorage.getItem("auth_token"))}setAuthToken(r){this.authToken=r,r&&typeof window<"u"?localStorage.setItem("auth_token",r):typeof window<"u"&&localStorage.removeItem("auth_token")}getAuthToken(){if(this.authToken)return this.authToken;if(typeof window<"u"){const r=localStorage.getItem("auth_token");return r&&(this.authToken=r),r}return null}buildUrl(r,t){let n;if(this.baseUrl.startsWith("/")){const l=this.baseUrl.endsWith("/")?this.baseUrl.slice(0,-1):this.baseUrl,i=r.startsWith("/")?r:`/${r}`;n=`${l}${i}`}else{const l=this.baseUrl.endsWith("/")?this.baseUrl.slice(0,-1):this.baseUrl;r.startsWith("/")?n=`${l}${r}`:n=new URL(r,`${l}/`).toString()}if(t&&Object.keys(t).length>0){const l=[];if(Object.entries(t).forEach(([i,o])=>{o!=null&&(Array.isArray(o)?o.forEach(u=>{l.push(`${encodeURIComponent(i)}[]=${encodeURIComponent(String(u))}`)}):l.push(`${encodeURIComponent(i)}=${encodeURIComponent(String(o))}`))}),l.length>0){const i=n.includes("?")?"&":"?";n=`${n}${i}${l.join("&")}`}}return n}async request(r,t={}){const{params:n,requireAuth:l=!1,unwrapResponse:i=!0,headers:o={},...u}=t,c=this.buildUrl(r,n),s=u.body instanceof FormData,d={Accept:"application/json"};if(s||(d["Content-Type"]="application/json"),typeof crypto<"u"&&crypto.randomUUID&&(d["X-Request-ID"]=crypto.randomUUID()),l){const h=this.getAuthToken();h&&(d.Authorization=`Bearer ${h}`)}const f={...d,...o};s&&"Content-Type"in f&&delete f["Content-Type"];try{const h=u.body,m=Array.isArray(f)?f.find(v=>v[0]==="Content-Type")?.[1]:f["Content-Type"];if(h&&typeof h=="string"&&m?.includes("application/json"))try{JSON.parse(h)}catch{console.error("Body JSON invalide:",h)}const p=await fetch(c,{...u,body:h,headers:f});if(p.status===204)return null;const x=p.headers.get("content-type"),g=x&&x.includes("application/json");let y;if(g)try{const v=await p.text();!v||v.trim()===""?y={}:y=JSON.parse(v)}catch{throw new Vt(p.status,{message:"Réponse invalide du serveur"},"Le serveur a retourné une réponse invalide")}else y={message:await p.text()||`HTTP ${p.status}: ${p.statusText}`};if(!p.ok){const v=y.error,_=typeof y.message=="string"&&y.message||(v&&typeof v=="object"&&v!==null&&"message"in v&&typeof v.message=="string"?v.message:"")||`HTTP ${p.status}: ${p.statusText}`,C=typeof y.error=="object"&&y.error!==null&&"code"in y.error?y.error:void 0,M={message:_,errors:y.errors!==void 0&&y.errors!==null&&typeof y.errors=="object"?y.errors:void 0};throw typeof y.existing_registration_id=="number"&&(M.existing_registration_id=y.existing_registration_id),typeof y.status=="string"&&(M.status=y.status),C!==void 0&&(M.error=C),new Vt(p.status,M,M.message)}return r.includes("/auth/login")||r.includes("/auth/register")||r.includes("/auth/activate")?y:r.includes("/auth/me")?y.user??y:(r.includes("/admin/registrations")||r.includes("/admin/recommendations")||r.includes("/admin/users")||r.includes("/admin/audit-logs")||r.includes("/finance/debtors")||r.includes("/finance/confirmed-payments"))&&(y.meta!==void 0||y.data!==void 0)||!i?y:y.data!==void 0?y.data:y}catch(h){throw h instanceof Vt?h:h instanceof TypeError&&h.message.includes("fetch")?new Vt(0,{message:"Erreur de connexion au serveur"},"Impossible de se connecter au serveur"):new Vt(500,{message:"Une erreur inattendue est survenue"},h instanceof Error?h.message:"Erreur inconnue")}}async get(r,t){return this.request(r,{...t,method:"GET"})}async getAsBlob(r,t){const n=this.buildUrl(r,t?.params),l={Accept:"text/csv"};t?.requireAuth!==!1&&this.getAuthToken()&&(l.Authorization=`Bearer ${this.getAuthToken()}`);const i=await fetch(n,{method:"GET",headers:l});if(!i.ok){const o=await i.text();let u;try{u=JSON.parse(o)}catch{u={message:o||`HTTP ${i.status}`}}throw new Vt(i.status,u,u.message)}return i.blob()}async post(r,t,n){return this.request(r,{...n,method:"POST",body:t?JSON.stringify(t):void 0})}async postForm(r,t,n){return this.request(r,{...n,method:"POST",body:t})}async put(r,t,n){return this.request(r,{...n,method:"PUT",body:t?JSON.stringify(t):void 0})}async patch(r,t,n){return this.request(r,{...n,method:"PATCH",body:t?JSON.stringify(t):void 0})}async delete(r,t){return this.request(r,{...t,method:"DELETE"})}}const Be=new IF,B1={async list(e){const r=await Be.get("/events",{params:e});return Array.isArray(r)?r:r?.data&&Array.isArray(r.data)?r.data:[]},async getBySlug(e){return Be.get(`/events/${e}`)},async getPricingPlans(e){return Be.get(`/events/${e}/plans`)},async getSettings(e){return(await Be.get(`/events/${e}/settings`)).settings||{}}},z1={async create(e,r){try{return await Be.post(`/public/events/${e}/registrations`,r)}catch(t){throw t instanceof Vt&&t.status===409,t}},async verify(e){return Be.get(`/public/registrations/verify/${e}`)},async resendVerification(e){const r={};return typeof e=="number"?r.registration_id=e:r.email=e,Be.post("/public/registrations/resend-verification",r)}},$4={async create(e){return await Be.post("/public/recommendations",e)}},Vi={async login(e){const r=await Be.post("/auth/login",e);return r&&r.token&&Be.setAuthToken(r.token),r},async register(e){const r=await Be.post("/auth/register",e);return r.token&&Be.setAuthToken(r.token),r},async logout(){try{await Be.post("/auth/logout",void 0,{requireAuth:!0})}catch(e){if(!(e instanceof Vt&&e.status===401))throw e}finally{Be.setAuthToken(null)}},async me(){try{return await Be.get("/auth/me",{requireAuth:!0})}catch(e){throw e instanceof Vt&&e.status===401&&Be.setAuthToken(null),e}},async checkActivation(e){return Be.get("/auth/activate/check",{params:{token:e.trim()}})},async activate(e){const r=await Be.post("/auth/activate",e);return r?.token&&Be.setAuthToken(r.token),r},isAuthenticated(){return Be.getAuthToken()!==null}};function Ky(e){return e.status==="draft"?!1:!!e.user?.id}const _a={async list(e={}){const r={};return e.event_id&&(r.event_id=e.event_id),e.event_type&&(r.event_type=e.event_type),e.status&&(Array.isArray(e.status)?r.status=e.status:r.status=[e.status]),e.q&&(r.q=e.q),e.country&&(r.country=e.country),e.created_from&&(r.created_from=e.created_from),e.created_to&&(r.created_to=e.created_to),e.page&&(r.page=e.page),e.per_page&&(r.per_page=e.per_page),Be.get("/admin/registrations",{params:r,requireAuth:!0})},async get(e){return Be.get(`/admin/registrations/${e}`,{requireAuth:!0})},async getStats(e={}){const r={};return e.event_id&&(r.event_id=e.event_id),e.event_type&&(r.event_type=e.event_type),e.created_from&&(r.created_from=e.created_from),e.created_to&&(r.created_to=e.created_to),Be.get("/admin/registrations/stats",{params:r,requireAuth:!0})},async registrationCountries(e={}){const r={};return e.event_id&&(r.event_id=e.event_id),e.event_type&&(r.event_type=e.event_type),e.created_from&&(r.created_from=e.created_from),e.created_to&&(r.created_to=e.created_to),Be.get("/admin/registrations/countries",{params:r,requireAuth:!0})},async updateStatus(e,r){return Be.patch(`/admin/registrations/${e}/status`,r,{requireAuth:!0})},async update(e,r){return Be.put(`/admin/registrations/${e}`,r,{requireAuth:!0})},async delete(e){return Be.delete(`/admin/registrations/${e}`,{requireAuth:!0})},async resendActivationEmail(e){return Be.post(`/admin/registrations/${e}/resend-activation-email`,{},{requireAuth:!0})},async resetParticipantPassword(e,r){return Be.post(`/admin/registrations/${e}/reset-participant-password`,r,{requireAuth:!0})}},Sd={async list(e={}){return await Be.get("/admin/recommendations",{params:e,requireAuth:!0})},async show(e){return await Be.get(`/admin/recommendations/${e}`,{requireAuth:!0})},async updateStatus(e,r){return await Be.patch(`/admin/recommendations/${e}/status`,r,{requireAuth:!0})},async sendEmail(e,r){return await Be.post(`/admin/recommendations/${e}/send-email`,r,{requireAuth:!0})},async delete(e){await Be.delete(`/admin/recommendations/${e}`,{requireAuth:!0})}},uC={async changePassword(e){return Be.post("/account/change-password",e,{requireAuth:!0})}},Xy=["SUPER_ADMIN","COMMISSION_ADMINISTRATION","COMMISSION_FINANCE","COMMISSION_COMMUNICATION","COMMISSION_SEMINAIRE_REGIONAL","COMMISSARIAT_GENERAL"],am=[...Xy,"participant","guest"],RF=am,Gy={SUPER_ADMIN:"Super Admin",COMMISSION_ADMINISTRATION:"Commission Administration",COMMISSION_FINANCE:"Commission Finance",COMMISSION_COMMUNICATION:"Commission Communication",COMMISSION_SEMINAIRE_REGIONAL:"Commission Séminaire régional",COMMISSARIAT_GENERAL:"Commissariat général",participant:"Participant",guest:"Invité"},DF={COMMISSION_FINANCE_SOMMET:Gy.COMMISSION_FINANCE,COMMISSION_FINANCE_SEMINAIRE:"Commission Finance Séminaire",COMMISSION_ADMINISTRATION_SOMMET:Gy.COMMISSION_ADMINISTRATION,COMMISSION_ADMINISTRATION_SEMINAIRE:"Commission Administration Séminaire"};function Cm(e){return Gy[e]??DF[e]??e}const LF={COMMISSION_FINANCE_SOMMET:"COMMISSION_FINANCE",COMMISSION_FINANCE_SEMINAIRE:"COMMISSION_SEMINAIRE_REGIONAL",COMMISSION_ADMINISTRATION_SOMMET:"COMMISSION_ADMINISTRATION",COMMISSION_ADMINISTRATION_SEMINAIRE:"COMMISSION_SEMINAIRE_REGIONAL"};function U4(e){return LF[e]??e}const wo={async list(e={}){const r={};return e.page!=null&&(r.page=e.page),e.per_page!=null&&(r.per_page=e.per_page),e.role&&(r.role=e.role),e.q&&(r.q=e.q),Be.get("/admin/users",{params:r,requireAuth:!0})},async get(e){return Be.get(`/admin/users/${e}`,{requireAuth:!0})},async create(e){return Be.post("/admin/users",e,{requireAuth:!0})},async update(e,r){return Be.put(`/admin/users/${e}`,r,{requireAuth:!0})},async delete(e){return Be.delete(`/admin/users/${e}`,{requireAuth:!0})},async setDeactivated(e,r){return Be.patch(`/admin/users/${e}/deactivated`,{deactivated:r},{requireAuth:!0})},async sendActivation(e){return Be.post(`/admin/users/${e}/send-activation`,void 0,{requireAuth:!0})},async resetPassword(e,r){return Be.post(`/admin/users/${e}/reset-password`,r,{requireAuth:!0})}},Sx="https://api.sommetfrancophone.org/api";async function FF(){const e=await Be.get("/registrations/me",{requireAuth:!0});return Array.isArray(e)?e:e?.data??[]}async function BF(e,r){return Be.post(`/registrations/${e}/payments/sycapay/init`,r,{requireAuth:!0,unwrapResponse:!1})}async function zF(e,r){return Be.post(`/registrations/${e}/payments/sycapay/open-amount/init`,r,{requireAuth:!0,unwrapResponse:!1})}function dC(e,r){const t=[];return e.error==="provider_refused"?t.push("Le prestataire a refusé le paiement."):e.error==="technical_or_incomplete"?t.push("Le paiement n’a pas pu être finalisé côté prestataire."):e.error==="internal_exception"&&t.push("Une erreur technique est survenue."),e.technical_error&&t.push(`(${e.technical_error})`),t.length>0?t.join(" "):r}function $F(e){const r=e.data?.code,t=e.data?.message;return r==="open_amount_exceeds_balance"?t??"Le montant dépasse le solde restant.":r==="open_amount_registration_blocked"?t??"Un autre paiement est en cours ou en vérification pour cette inscription.":r==="amount_invalid"?t??"Montant invalide.":r==="nothing_to_pay"?t??"Aucun solde à payer.":t??e.message}async function V4(e,r,t){return Be.get(`/registrations/${e}/payments/${r}/status`,{requireAuth:!0,params:t?.refresh?{refresh:1}:void 0})}async function UF(e,r){const n=`${Sx.endsWith("/")?Sx.slice(0,-1):Sx}/receipts/${e}/download`,l=typeof window<"u"?localStorage.getItem("auth_token"):null,i=await fetch(n,{headers:{Accept:"application/pdf",...l&&{Authorization:`Bearer ${l}`}}});if(!i.ok){const c=await i.json().catch(()=>({message:i.statusText}));throw{status:i.status,data:c}}const o=await i.blob(),u=document.createElement("a");u.href=URL.createObjectURL(o),u.download=r||`receipt-${e}.pdf`,u.click(),URL.revokeObjectURL(u.href)}const Rs={async list(e={}){const r={};return e.event_id!==void 0&&e.event_id!==""&&(r.event_id=e.event_id),Be.get("/admin/treasury-accounts",{params:r,requireAuth:!0})},async create(e){return Be.post("/admin/treasury-accounts",e,{requireAuth:!0})},async update(e,r){return Be.put(`/admin/treasury-accounts/${e}`,r,{requireAuth:!0})},async delete(e){return Be.delete(`/admin/treasury-accounts/${e}`,{requireAuth:!0})}},Em={async list(e){const r=await Be.get("/admin/event-sycapay-transit-map",{params:e?.event_id!=null?{event_id:e.event_id}:void 0,requireAuth:!0});return Array.isArray(r)?r:r&&typeof r=="object"&&"data"in r&&Array.isArray(r.data)?r.data:[]},async create(e){return Be.post("/admin/event-sycapay-transit-map",e,{requireAuth:!0})},async update(e,r){return Be.put(`/admin/event-sycapay-transit-map/${e}`,r,{requireAuth:!0})},async delete(e){await Be.delete(`/admin/event-sycapay-transit-map/${e}`,{requireAuth:!0})}},xo={async list(e={}){const r={};e.event_type&&(r.event_type=e.event_type);const t=await Be.get("/admin/budget-categories",{params:r,requireAuth:!0});return Array.isArray(t)?t:t?.data??[]},async create(e){const r=await Be.post("/admin/budget-categories",e,{requireAuth:!0});return r?.data??r},async update(e,r){const t=await Be.put(`/admin/budget-categories/${e}`,r,{requireAuth:!0});return t?.data??t},async delete(e){await Be.delete(`/admin/budget-categories/${e}`,{requireAuth:!0})}},Yy={list(e={}){return Be.get("/admin/audit-logs",{requireAuth:!0,params:e})},async exportCsv(e={}){const r={};e.date_from&&(r.date_from=e.date_from),e.date_to&&(r.date_to=e.date_to),e.action&&(r.action=e.action),e.subject_type&&(r.subject_type=e.subject_type),e.user_id!=null&&(r.user_id=e.user_id);const t=await Be.getAsBlob("/admin/audit-logs/export",{params:r,requireAuth:!0}),n=URL.createObjectURL(t),l=document.createElement("a");l.href=n,l.download=`audit-logs-${new Date().toISOString().slice(0,10)}.csv`,l.click(),URL.revokeObjectURL(n)},async purge(e){return await Be.post("/admin/audit-logs/purge",{before:e},{requireAuth:!0})}},sl={async list(e){const r=await Be.get(`/finance/events/${e}/budget-lines`,{requireAuth:!0}),t=r?.data??r;return Array.isArray(t)?t:[]},async create(e,r){const t=await Be.post(`/finance/events/${e}/budget-lines`,r,{requireAuth:!0});return t?.data??t},async update(e,r){const t=await Be.put(`/finance/budget-lines/${e}`,r,{requireAuth:!0});return t?.data??t},async delete(e){await Be.delete(`/finance/budget-lines/${e}`,{requireAuth:!0})},async moveUp(e){await Be.post(`/finance/budget-lines/${e}/move-up`,{},{requireAuth:!0})},async moveDown(e){await Be.post(`/finance/budget-lines/${e}/move-down`,{},{requireAuth:!0})}},kx="https://api.sommetfrancophone.org/api",Ah={async list(e){const r=await Be.get("/finance/expenses",{params:{event_id:e},requireAuth:!0}),t=r?.data??r;return Array.isArray(t)?t:[]},async create(e){const{proof:r,...t}=e,n=new FormData;n.append("event_id",String(t.event_id)),n.append("treasury_account_id",String(t.treasury_account_id)),n.append("amount",String(t.amount)),n.append("paid_at",t.paid_at),n.append("label",t.label),t.event_budget_line_id!=null&&n.append("event_budget_line_id",String(t.event_budget_line_id)),t.reference?.trim()&&n.append("reference",t.reference.trim()),t.notes?.trim()&&n.append("notes",t.notes.trim()),n.append("proof",r);const l=await Be.postForm("/finance/expenses",n,{requireAuth:!0});return l?.data??l},async openExpenseProofInNewTab(e){const t=`${kx.endsWith("/")?kx.slice(0,-1):kx}/finance/expenses/${e}/proof`,n=typeof window<"u"?localStorage.getItem("auth_token"):null,l=await fetch(t,{headers:{...n&&{Authorization:`Bearer ${n}`}}});if(!l.ok){const u=await l.json().catch(()=>({message:l.statusText}));throw{status:l.status,data:u}}const i=await l.blob(),o=URL.createObjectURL(i);window.open(o,"_blank","noopener,noreferrer"),window.setTimeout(()=>URL.revokeObjectURL(o),12e4)},async update(e,r){const t=await Be.put(`/finance/expenses/${e}`,r,{requireAuth:!0});return t?.data??t},async delete(e){await Be.delete(`/finance/expenses/${e}`,{requireAuth:!0})}},Nx="https://api.sommetfrancophone.org/api",Mh={async list(e){const r=await Be.get("/finance/treasury-movements",{params:{event_id:e},requireAuth:!0}),t=r?.data??r;return Array.isArray(t)?t:[]},async create(e){const r=new FormData;r.append("event_id",String(e.event_id)),r.append("movement_type",e.movement_type),r.append("amount",String(e.amount)),r.append("label",e.label),e.notes?.trim()&&r.append("notes",e.notes.trim()),r.append("proof",e.proof),e.movement_type==="transfer"?(r.append("from_treasury_account_id",String(e.from_treasury_account_id)),r.append("to_treasury_account_id",String(e.to_treasury_account_id))):(r.append("treasury_account_id",String(e.treasury_account_id)),r.append("adjustment_direction",e.adjustment_direction));const t=await Be.postForm("/finance/treasury-movements",r,{requireAuth:!0});return t?.data??t},async openMovementProofInNewTab(e){const t=`${Nx.endsWith("/")?Nx.slice(0,-1):Nx}/finance/treasury-movements/${e}/proof`,n=typeof window<"u"?localStorage.getItem("auth_token"):null,l=await fetch(t,{headers:{...n&&{Authorization:`Bearer ${n}`}}});if(!l.ok){const u=await l.json().catch(()=>({message:l.statusText}));throw{status:l.status,data:u}}const i=await l.blob(),o=URL.createObjectURL(i);window.open(o,"_blank","noopener,noreferrer"),window.setTimeout(()=>URL.revokeObjectURL(o),12e4)}},vc={async get(e){return await Be.get("/finance/treasury-balances",{params:{event_id:e},requireAuth:!0})},async downloadCsv(e,r){const t=await Be.getAsBlob("/finance/treasury-balances/export",{params:{event_id:e},requireAuth:!0}),n=URL.createObjectURL(t),l=document.createElement("a");l.href=n,l.download=`tresorerie_${r}_${new Date().toISOString().slice(0,10)}.csv`,l.rel="noopener",document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(n)},async upsertOpeningBalances(e){const r=await Be.put("/finance/treasury-opening-balances",e,{requireAuth:!0});return r?.data??r},async listSnapshots(e){const t=await Be.get("/finance/treasury-snapshots",{params:{event_id:e,limit:15},requireAuth:!0}),n=Array.isArray(t)?t:t?.data;return Array.isArray(n)?n:[]},async captureSnapshot(e){const r=await Be.post("/finance/treasury-snapshots",{event_id:e},{requireAuth:!0});return r?.data??r}},Cx={async storePublic(e){return Be.post("/public/donations",e,{requireAuth:!1})},async store(e){return Be.post("/donations",e,{requireAuth:!0})},async initPublicSycaPay(e,r){return Be.post(`/public/donations/${e}/sycapay/init`,r,{requireAuth:!1,unwrapResponse:!1})},async initAuthenticatedSycaPay(e,r){return Be.post(`/donations/${e}/sycapay/init`,r,{requireAuth:!0,unwrapResponse:!1})}};async function VF(e,r,t){const n={};return t?.refresh&&(n.refresh=1),t?.donorEmail&&(n.donor_email=t.donorEmail),Be.get(`/public/donations/${e}/payments/${r}/status`,{requireAuth:!1,params:Object.keys(n).length?n:void 0})}const Ex="https://api.sommetfrancophone.org/api";async function qF(e,r){const t=Ex.endsWith("/")?Ex.slice(0,-1):Ex,n=r?`?donor_email=${encodeURIComponent(r)}`:"",l=`${t}/public/donations/${e}/receipt/download${n}`,i=await fetch(l,{method:"GET",headers:{Accept:"application/pdf"}});if(!i.ok){let f={};try{f=await i.json()}catch{}throw new Vt(i.status,{message:f.message||i.statusText})}const o=i.headers.get("Content-Disposition");let u=`recu-don-${e}.pdf`;const c=o?.match(/filename="?([^";]+)"?/i);c?.[1]&&(u=c[1]);const s=await i.blob(),d=document.createElement("a");d.href=URL.createObjectURL(s),d.download=u,d.click(),URL.revokeObjectURL(d.href)}function HF(e){if(!(e instanceof Vt))return e instanceof Error&&e.message?e.message:"Une erreur est survenue.";const r=e.data?.code,t=e.data?.message??e.message;return r==="donation_not_awaiting_payment"?t||"Ce don n’est pas en attente de paiement en ligne.":r==="donation_gateway_active_duplicate"?t||"Un paiement est déjà en cours pour ce don.":r==="donor_email_mismatch"?t||"L’email ne correspond pas au don.":r==="idempotency_key_conflict"||r==="idempotency_key_reused"?t||"Conflit de clé d’idempotence.":t}async function fC(){return Be.get("/public/sycapay/availability")}const gc={async listSessions(e={}){const r={};return e.event_id!=null&&(r.event_id=e.event_id),e.channel&&(r.channel=e.channel),e.status&&(r.status=e.status),Be.get("/finance/reconciliation/sessions",{params:r,requireAuth:!0})},async createSession(e){return Be.post("/finance/reconciliation/sessions",e,{requireAuth:!0})},async updateSession(e,r){return Be.patch(`/finance/reconciliation/sessions/${e}`,r,{requireAuth:!0})},async submitReview(e){return Be.post(`/finance/reconciliation/sessions/${e}/submit-review`,{},{requireAuth:!0})},async validateSession(e){return Be.post(`/finance/reconciliation/sessions/${e}/validate`,{},{requireAuth:!0})},async closeSession(e,r={}){return Be.post(`/finance/reconciliation/sessions/${e}/close`,r,{requireAuth:!0})},async reopenSession(e,r){return Be.post(`/finance/reconciliation/sessions/${e}/reopen`,r,{requireAuth:!0})}};function Mp(e){const[r,t]=R.useState([]),[n,l]=R.useState(!0),[i,o]=R.useState(null),u=R.useCallback(async()=>{l(!0),o(null);try{const c=await B1.list(e);t(c)}catch(c){o(c)}finally{l(!1)}},[e]);return R.useEffect(()=>{u()},[u]),{events:r,loading:n,error:i,refetch:u}}function hC(e){const[r,t]=R.useState([]),[n,l]=R.useState(!0),[i,o]=R.useState(null),u=R.useCallback(async()=>{if(!e){l(!1);return}l(!0),o(null);try{const c=await B1.getPricingPlans(e);t(c)}catch(c){o(c)}finally{l(!1)}},[e]);return R.useEffect(()=>{u()},[u]),{plans:r,loading:n,error:i,refetch:u}}function WF(e={},r=!0){const[t,n]=R.useState(null),[l,i]=R.useState(!0),[o,u]=R.useState(null),c=R.useCallback(async()=>{if(!r){i(!1);return}i(!0),u(null);try{const s=await _a.list(e);n(s)}catch(s){u(s)}finally{i(!1)}},[e,r]);return R.useEffect(()=>{c()},[c]),{data:t,loading:l,error:o,refetch:c}}function KF(e={},r=!0){const[t,n]=R.useState(null),[l,i]=R.useState(!0),[o,u]=R.useState(null),c=R.useCallback(async()=>{if(!r){i(!1);return}i(!0),u(null);try{const s=await _a.getStats(e);n(s)}catch(s){u(s)}finally{i(!1)}},[e,r]);return R.useEffect(()=>{c()},[c]),{data:t,loading:l,error:o,refetch:c}}function XF(e={},r=!0){const[t,n]=R.useState([]),[l,i]=R.useState(!0),[o,u]=R.useState(null),c=R.useCallback(async()=>{if(!r){i(!1);return}i(!0),u(null);try{const s=await _a.registrationCountries(e);n(s.data??[])}catch(s){u(s),n([])}finally{i(!1)}},[e,r]);return R.useEffect(()=>{c()},[c]),{data:t,loading:l,error:o,refetch:c}}function GF(e={},r=!0){const[t,n]=R.useState(null),[l,i]=R.useState(r),[o,u]=R.useState(null),c=R.useCallback(async()=>{if(!r){i(!1);return}i(!0),u(null);try{const s=await Sd.list(e);n(s)}catch(s){s instanceof Vt?u(s):u(new Vt(500,{message:"Une erreur inattendue est survenue"},"Erreur inconnue")),n(null)}finally{i(!1)}},[r,e]);return R.useEffect(()=>{c()},[c]),{data:t,loading:l,error:o,refetch:c}}function YF(e={},r=!0){const[t,n]=R.useState(null),[l,i]=R.useState(!0),[o,u]=R.useState(null),c=R.useCallback(async()=>{if(!r){i(!1);return}i(!0),u(null);try{const s=await wo.list(e);n(s)}catch(s){u(s)}finally{i(!1)}},[e,r]);return R.useEffect(()=>{c()},[c]),{data:t,loading:l,error:o,refetch:c}}function ZF(e,r){const[t,n]=R.useState(null),[l,i]=R.useState(!1),[o,u]=R.useState(null),c=R.useCallback(()=>{i(!0),u(null),Yy.list(e).then(n).catch(s=>u(s?.data?.message??"Erreur lors du chargement du journal d'audit.")).finally(()=>i(!1))},[r,e]);return R.useEffect(()=>{c()},[c]),{data:t,loading:l,error:o,refetch:c}}const QF=new Set(["SUPER_ADMIN","COMMISSION_ADMINISTRATION","COMMISSION_ADMINISTRATION_SEMINAIRE","COMMISSION_ADMINISTRATION_SOMMET","COMMISSION_FINANCE","COMMISSION_FINANCE_SOMMET","COMMISSION_FINANCE_SEMINAIRE","COMMISSION_COMMUNICATION","COMMISSION_SEMINAIRE_REGIONAL","COMMISSARIAT_GENERAL"]);function JF(e){return typeof e=="string"?e:e.name}function eB(e){return typeof e=="string"?e:e.name}function qs(){const[e,r]=R.useState(null),[t,n]=R.useState(!0),[l,i]=R.useState(null),o=async()=>{if(!Vi.isAuthenticated())return r(null),n(!1),null;n(!0),i(null);try{const p=await Vi.me();return r(p),p}catch(p){return i(p),r(null),null}finally{n(!1)}};R.useEffect(()=>{o()},[]),R.useEffect(()=>{const p=()=>{Vi.isAuthenticated()?o():(r(null),n(!1))};window.addEventListener("storage",p);const x=setInterval(()=>{!Vi.isAuthenticated()&&e&&(r(null),n(!1))},1e3);return()=>{window.removeEventListener("storage",p),clearInterval(x)}},[e]);const u=R.useMemo(()=>(e?.roles??[]).map(JF),[e?.roles]),c=R.useMemo(()=>(e?.permissions??[]).map(eB),[e?.permissions]),s=R.useMemo(()=>u.some(p=>QF.has(p)),[u]),d=R.useMemo(()=>u.includes("participant")&&!s,[u,s]),f=R.useMemo(()=>p=>u.includes("SUPER_ADMIN")?!0:c.includes(p),[u,c]),h=s,m=f("payments.read")||f("batches.read");return{user:e,loading:t,error:l,isAuthenticated:!!e,isAdmin:h,isTreasurer:m,roles:u,permissions:c,canAccessAdmin:s,isParticipant:d,can:f,refetch:o}}const De=R.forwardRef(function({variant:r="primary",children:t,className:n="",...l},i){const o="px-6 py-3 rounded-none font-medium transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed uppercase tracking-wider border-2",u={primary:"bg-brand-700 text-white border-2 border-brand-900 hover:bg-brand-900 font-semibold",secondary:"border-white bg-transparent text-surface-0 hover:bg-white/10",outline:"border-2 border-brand-900 text-brand-900 bg-transparent hover:bg-brand-900 hover:text-surface-0",ghost:"border-transparent text-ink-900 hover:bg-brand-50"};return a.jsx("button",{ref:i,className:`${o} ${u[r]} ${n}`,...l,children:t})}),tB=[{name:"Afghanistan",code:"AF",dialCode:"+93"},{name:"Afrique du Sud",code:"ZA",dialCode:"+27"},{name:"Albanie",code:"AL",dialCode:"+355"},{name:"Algérie",code:"DZ",dialCode:"+213"},{name:"Allemagne",code:"DE",dialCode:"+49"},{name:"Andorre",code:"AD",dialCode:"+376"},{name:"Angola",code:"AO",dialCode:"+244"},{name:"Antigua-et-Barbuda",code:"AG",dialCode:"+1-268"},{name:"Arabie saoudite",code:"SA",dialCode:"+966"},{name:"Argentine",code:"AR",dialCode:"+54"},{name:"Arménie",code:"AM",dialCode:"+374"},{name:"Australie",code:"AU",dialCode:"+61"},{name:"Autriche",code:"AT",dialCode:"+43"},{name:"Azerbaïdjan",code:"AZ",dialCode:"+994"},{name:"Bahamas",code:"BS",dialCode:"+1-242"},{name:"Bahreïn",code:"BH",dialCode:"+973"},{name:"Bangladesh",code:"BD",dialCode:"+880"},{name:"Barbade",code:"BB",dialCode:"+1-246"},{name:"Belgique",code:"BE",dialCode:"+32"},{name:"Belize",code:"BZ",dialCode:"+501"},{name:"Bénin",code:"BJ",dialCode:"+229"},{name:"Bhoutan",code:"BT",dialCode:"+975"},{name:"Biélorussie",code:"BY",dialCode:"+375"},{name:"Birmanie",code:"MM",dialCode:"+95"},{name:"Bolivie",code:"BO",dialCode:"+591"},{name:"Bosnie-Herzégovine",code:"BA",dialCode:"+387"},{name:"Botswana",code:"BW",dialCode:"+267"},{name:"Brésil",code:"BR",dialCode:"+55"},{name:"Brunei",code:"BN",dialCode:"+673"},{name:"Bulgarie",code:"BG",dialCode:"+359"},{name:"Burkina Faso",code:"BF",dialCode:"+226"},{name:"Burundi",code:"BI",dialCode:"+257"},{name:"Cambodge",code:"KH",dialCode:"+855"},{name:"Cameroun",code:"CM",dialCode:"+237"},{name:"Canada",code:"CA",dialCode:"+1"},{name:"Cap-Vert",code:"CV",dialCode:"+238"},{name:"Chili",code:"CL",dialCode:"+56"},{name:"Chine",code:"CN",dialCode:"+86"},{name:"Chypre",code:"CY",dialCode:"+357"},{name:"Colombie",code:"CO",dialCode:"+57"},{name:"Comores",code:"KM",dialCode:"+269"},{name:"Congo",code:"CG",dialCode:"+242"},{name:"Corée du Nord",code:"KP",dialCode:"+850"},{name:"Corée du Sud",code:"KR",dialCode:"+82"},{name:"Costa Rica",code:"CR",dialCode:"+506"},{name:"Côte d'Ivoire",code:"CI",dialCode:"+225"},{name:"Croatie",code:"HR",dialCode:"+385"},{name:"Cuba",code:"CU",dialCode:"+53"},{name:"Danemark",code:"DK",dialCode:"+45"},{name:"Djibouti",code:"DJ",dialCode:"+253"},{name:"Dominique",code:"DM",dialCode:"+1-767"},{name:"Égypte",code:"EG",dialCode:"+20"},{name:"Émirats arabes unis",code:"AE",dialCode:"+971"},{name:"Équateur",code:"EC",dialCode:"+593"},{name:"Érythrée",code:"ER",dialCode:"+291"},{name:"Espagne",code:"ES",dialCode:"+34"},{name:"Estonie",code:"EE",dialCode:"+372"},{name:"États-Unis",code:"US",dialCode:"+1"},{name:"Éthiopie",code:"ET",dialCode:"+251"},{name:"Fidji",code:"FJ",dialCode:"+679"},{name:"Finlande",code:"FI",dialCode:"+358"},{name:"France",code:"FR",dialCode:"+33"},{name:"Gabon",code:"GA",dialCode:"+241"},{name:"Gambie",code:"GM",dialCode:"+220"},{name:"Géorgie",code:"GE",dialCode:"+995"},{name:"Ghana",code:"GH",dialCode:"+233"},{name:"Grèce",code:"GR",dialCode:"+30"},{name:"Grenade",code:"GD",dialCode:"+1-473"},{name:"Guatemala",code:"GT",dialCode:"+502"},{name:"Guinée",code:"GN",dialCode:"+224"},{name:"Guinée-Bissau",code:"GW",dialCode:"+245"},{name:"Guinée équatoriale",code:"GQ",dialCode:"+240"},{name:"Guyana",code:"GY",dialCode:"+592"},{name:"Haïti",code:"HT",dialCode:"+509"},{name:"Honduras",code:"HN",dialCode:"+504"},{name:"Hongrie",code:"HU",dialCode:"+36"},{name:"Inde",code:"IN",dialCode:"+91"},{name:"Indonésie",code:"ID",dialCode:"+62"},{name:"Irak",code:"IQ",dialCode:"+964"},{name:"Iran",code:"IR",dialCode:"+98"},{name:"Irlande",code:"IE",dialCode:"+353"},{name:"Islande",code:"IS",dialCode:"+354"},{name:"Israël",code:"IL",dialCode:"+972"},{name:"Italie",code:"IT",dialCode:"+39"},{name:"Jamaïque",code:"JM",dialCode:"+1-876"},{name:"Japon",code:"JP",dialCode:"+81"},{name:"Jordanie",code:"JO",dialCode:"+962"},{name:"Kazakhstan",code:"KZ",dialCode:"+7"},{name:"Kenya",code:"KE",dialCode:"+254"},{name:"Kirghizistan",code:"KG",dialCode:"+996"},{name:"Kiribati",code:"KI",dialCode:"+686"},{name:"Koweït",code:"KW",dialCode:"+965"},{name:"Laos",code:"LA",dialCode:"+856"},{name:"Lesotho",code:"LS",dialCode:"+266"},{name:"Lettonie",code:"LV",dialCode:"+371"},{name:"Liban",code:"LB",dialCode:"+961"},{name:"Liberia",code:"LR",dialCode:"+231"},{name:"Libye",code:"LY",dialCode:"+218"},{name:"Liechtenstein",code:"LI",dialCode:"+423"},{name:"Lituanie",code:"LT",dialCode:"+370"},{name:"Luxembourg",code:"LU",dialCode:"+352"},{name:"Macédoine du Nord",code:"MK",dialCode:"+389"},{name:"Madagascar",code:"MG",dialCode:"+261"},{name:"Malaisie",code:"MY",dialCode:"+60"},{name:"Malawi",code:"MW",dialCode:"+265"},{name:"Maldives",code:"MV",dialCode:"+960"},{name:"Mali",code:"ML",dialCode:"+223"},{name:"Malte",code:"MT",dialCode:"+356"},{name:"Maroc",code:"MA",dialCode:"+212"},{name:"Marshall",code:"MH",dialCode:"+692"},{name:"Maurice",code:"MU",dialCode:"+230"},{name:"Mauritanie",code:"MR",dialCode:"+222"},{name:"Mexique",code:"MX",dialCode:"+52"},{name:"Micronésie",code:"FM",dialCode:"+691"},{name:"Moldavie",code:"MD",dialCode:"+373"},{name:"Monaco",code:"MC",dialCode:"+377"},{name:"Mongolie",code:"MN",dialCode:"+976"},{name:"Monténégro",code:"ME",dialCode:"+382"},{name:"Mozambique",code:"MZ",dialCode:"+258"},{name:"Namibie",code:"NA",dialCode:"+264"},{name:"Nauru",code:"NR",dialCode:"+674"},{name:"Népal",code:"NP",dialCode:"+977"},{name:"Nicaragua",code:"NI",dialCode:"+505"},{name:"Niger",code:"NE",dialCode:"+227"},{name:"Nigeria",code:"NG",dialCode:"+234"},{name:"Norvège",code:"NO",dialCode:"+47"},{name:"Nouvelle-Zélande",code:"NZ",dialCode:"+64"},{name:"Oman",code:"OM",dialCode:"+968"},{name:"Ouganda",code:"UG",dialCode:"+256"},{name:"Ouzbékistan",code:"UZ",dialCode:"+998"},{name:"Pakistan",code:"PK",dialCode:"+92"},{name:"Palaos",code:"PW",dialCode:"+680"},{name:"Palestine",code:"PS",dialCode:"+970"},{name:"Panama",code:"PA",dialCode:"+507"},{name:"Papouasie-Nouvelle-Guinée",code:"PG",dialCode:"+675"},{name:"Paraguay",code:"PY",dialCode:"+595"},{name:"Pays-Bas",code:"NL",dialCode:"+31"},{name:"Pérou",code:"PE",dialCode:"+51"},{name:"Philippines",code:"PH",dialCode:"+63"},{name:"Pologne",code:"PL",dialCode:"+48"},{name:"Portugal",code:"PT",dialCode:"+351"},{name:"Qatar",code:"QA",dialCode:"+974"},{name:"RDC",code:"CD",dialCode:"+243"},{name:"République centrafricaine",code:"CF",dialCode:"+236"},{name:"République dominicaine",code:"DO",dialCode:"+1-809"},{name:"République tchèque",code:"CZ",dialCode:"+420"},{name:"Roumanie",code:"RO",dialCode:"+40"},{name:"Royaume-Uni",code:"GB",dialCode:"+44"},{name:"Russie",code:"RU",dialCode:"+7"},{name:"Rwanda",code:"RW",dialCode:"+250"},{name:"Saint-Kitts-et-Nevis",code:"KN",dialCode:"+1-869"},{name:"Saint-Marin",code:"SM",dialCode:"+378"},{name:"Saint-Vincent-et-les-Grenadines",code:"VC",dialCode:"+1-784"},{name:"Sainte-Lucie",code:"LC",dialCode:"+1-758"},{name:"Salomon",code:"SB",dialCode:"+677"},{name:"Salvador",code:"SV",dialCode:"+503"},{name:"Samoa",code:"WS",dialCode:"+685"},{name:"São Tomé-et-Príncipe",code:"ST",dialCode:"+239"},{name:"Sénégal",code:"SN",dialCode:"+221"},{name:"Serbie",code:"RS",dialCode:"+381"},{name:"Seychelles",code:"SC",dialCode:"+248"},{name:"Sierra Leone",code:"SL",dialCode:"+232"},{name:"Singapour",code:"SG",dialCode:"+65"},{name:"Slovaquie",code:"SK",dialCode:"+421"},{name:"Slovénie",code:"SI",dialCode:"+386"},{name:"Somalie",code:"SO",dialCode:"+252"},{name:"Soudan",code:"SD",dialCode:"+249"},{name:"Soudan du Sud",code:"SS",dialCode:"+211"},{name:"Sri Lanka",code:"LK",dialCode:"+94"},{name:"Suède",code:"SE",dialCode:"+46"},{name:"Suisse",code:"CH",dialCode:"+41"},{name:"Suriname",code:"SR",dialCode:"+597"},{name:"Syrie",code:"SY",dialCode:"+963"},{name:"Tadjikistan",code:"TJ",dialCode:"+992"},{name:"Tanzanie",code:"TZ",dialCode:"+255"},{name:"Tchad",code:"TD",dialCode:"+235"},{name:"Thaïlande",code:"TH",dialCode:"+66"},{name:"Timor oriental",code:"TL",dialCode:"+670"},{name:"Togo",code:"TG",dialCode:"+228"},{name:"Tonga",code:"TO",dialCode:"+676"},{name:"Trinité-et-Tobago",code:"TT",dialCode:"+1-868"},{name:"Tunisie",code:"TN",dialCode:"+216"},{name:"Turkménistan",code:"TM",dialCode:"+993"},{name:"Turquie",code:"TR",dialCode:"+90"},{name:"Tuvalu",code:"TV",dialCode:"+688"},{name:"Ukraine",code:"UA",dialCode:"+380"},{name:"Uruguay",code:"UY",dialCode:"+598"},{name:"Vanuatu",code:"VU",dialCode:"+678"},{name:"Vatican",code:"VA",dialCode:"+39"},{name:"Venezuela",code:"VE",dialCode:"+58"},{name:"Viêt Nam",code:"VN",dialCode:"+84"},{name:"Yémen",code:"YE",dialCode:"+967"},{name:"Zambie",code:"ZM",dialCode:"+260"},{name:"Zimbabwe",code:"ZW",dialCode:"+263"}].sort((e,r)=>e.name.localeCompare(r.name)),q4="sommet-haggai-franco-2026",Ax="seminaire-regional-hybride-2026",rB=e=>{if(!e||e==="XX")return"";try{const r=e.toUpperCase().split("").map(t=>127397+t.charCodeAt(0));return String.fromCodePoint(...r)}catch{return""}},Oh=tB,H4=[{value:"medecine_para_medical",label:"Médecine & Para-médical"},{value:"education",label:"Education"},{value:"droit_barreau_magistrature",label:"Droit - barreau - Magistrature"},{value:"journalisme_communication",label:"Journalisme et Communication"},{value:"gestion_finances_comptabilite",label:"Gestion - Finances & Comptabilité"},{value:"theologie_etudes_pastorales",label:"Théologie & Etudes pastorales"},{value:"sciences_sociales",label:"Sciences sociales"},{value:"mathematiques_physique_chimie",label:"Mathématiques - Physique - Chimie"},{value:"administration_commerce_marketing",label:"Administration - Commerce - Marketing"},{value:"agriculture",label:"Agriculture"},{value:"travaux_publiques_architecture_ingenierie",label:"Travaux publics - Architecture - Ingénierie"},{value:"sciences_politiques",label:"Sciences politiques"},{value:"humanitaire",label:"Humanitaire"},{value:"autre",label:"Autre"}],W4=[{value:"ordinateur_sessions_en_ligne",label:"J'aurai à ma disposition un ordinateur pour suivre les sessions en ligne (phase 1)"},{value:"bon_debit_internet",label:"Je prendrai toutes les dispositions pour avoir accès à un bon débit d'internet pour toutes les sessions en ligne"},{value:"present_sessions",label:"Je serai présent à toutes les sessions en ligne et en présentiel"},{value:"payer_frais_350k",label:"Je m'engage à payer les frais de participation de 350.000 F.CFA / 534 € dans les délais requis"},{value:"autre",label:"Autre"}],K4=[{value:"musulmane",label:"Musulmane"},{value:"catholique",label:"Catholique"},{value:"protestante",label:"Protestante"},{value:"pentecotiste",label:"Pentecôtiste"},{value:"evangelique",label:"Évangélique"},{value:"autre",label:"Autre"}];function nB(e){if(!e?.trim())return null;const r=new Date(`${e.trim()}T12:00:00`);if(Number.isNaN(r.getTime()))return null;const t=new Date;let n=t.getFullYear()-r.getFullYear();const l=t.getMonth()-r.getMonth();return(l<0||l===0&&t.getDate()120?null:n}function X4(){return a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"text-xl font-heading font-medium text-ink-900 mb-3 text-center uppercase",children:"Frais de participation"}),a.jsx("p",{className:"text-sm text-ink-500 text-center leading-relaxed max-w-2xl mx-auto",children:"Les frais de participation s'élèvent à 350 000 FCFA / 535 €. Ils contribuent aux frais du séjour à l'hôtel et aux frais liés à la formation. Une fois votre candidature acceptée, le paiement de ces frais est nécessaire pour valider votre inscription."})]})}function iB({preselectedEvents:e,onSuccess:r,onConflict:t,onError:n,onFormLayoutChange:l}){const i=()=>p.selectedEvents.length===0?1:p.selectedEvents.length===1?2:p.selectedEvents.length===2?3:p.selectedEvents.length===3?4:1,[o,u]=R.useState(1),[c,s]=R.useState(!1),[d,f]=R.useState({}),[h,m]=R.useState(!1);R.useEffect(()=>{window.scrollTo({top:0,behavior:"smooth"})},[o]);const[p,x]=R.useState({selectedEvents:e&&e.length>0?[...e]:[],first_name:"",last_name:"",email:"",phone:"",country:"",city:"",organization:"",position:"",nationality:"",participated_haggai_seminar:"",hle_vhle_number:"",payment_method_selected:"mobile_money",installment_method:void 0,installment_count:1,installment_months:[""],package_code:"",spouse_fullname:"",spouse_email:"",spouse_haggai_id:"",ouaga_resident_confirmed:!1,seminar_intent:"",seminar_want_to_participate:"oui",seminar_church_organization:"",seminar_role_ministry:"",seminar_marital_status:"",seminar_gender:"",seminar_question_or_concern:"",recommended_contacted_before:"",recommended_first_name:"",recommended_last_name:"",recommended_profession:"",recommended_residence_country:"",recommended_phone_whatsapp:"",recommended_email:"",recommended_gender:"",seminar_date_naissance:"",seminar_contact_urgence_nom_lien:"",seminar_niveau_etudes:"",seminar_domaines_etude:[],seminar_domaine_etude_autre:"",seminar_niveau_francais:"",seminar_besoin_lettre_absence:"",seminar_besoin_lettre_details:"",seminar_sante_details:"",seminar_regime_sans_sel:"",seminar_confession_religieuse:"",seminar_confession_religieuse_autre:"",seminar_fardeau_transformation:"",seminar_recommande_par:"",seminar_engagements:[],seminar_engagements_autre:""});R.useEffect(()=>{m(p.package_code==="A")},[p.package_code]),R.useEffect(()=>{p.selectedEvents.includes("seminar")&&x(re=>re.seminar_want_to_participate==="oui"?re:{...re,seminar_want_to_participate:"oui"})},[p.selectedEvents]),R.useEffect(()=>{l?.({step:o,selectedEvents:p.selectedEvents})},[o,p.selectedEvents,l]);const g=p.selectedEvents.includes("summit")?q4:null,{plans:y,loading:v}=hC(g),_=35e4,C=535,M=()=>{if(!p.package_code||!y.length)return null;const re=y.find(ue=>ue.code===p.package_code);return re?p.payment_method_selected==="card_visa"?re.price_eur:re.price_xof:null},T=(re,ue)=>ue==="EUR"?`${re.toLocaleString("fr-FR")} €`:`${re.toLocaleString("fr-FR")} FCFA`,U=()=>{if(!(p.selectedEvents.includes("summit")&&p.selectedEvents.includes("seminar")))return null;const ue=M();if(ue===null)return null;const ae=p.payment_method_selected==="card_visa"?"EUR":"XOF",fe=ue+(ae==="EUR"?C:_);return{total:fe,currency:ae,formatted:T(fe,ae)}},F=()=>[{value:"2026-02",label:"Février 2026"},{value:"2026-03",label:"Mars 2026"},{value:"2026-04",label:"Avril 2026"},{value:"2026-05",label:"Mai 2026"},{value:"2026-06",label:"Juin 2026"},{value:"2026-07",label:"Juillet 2026"},{value:"2026-08",label:"Août 2026"}],H=re=>{for(const fe of re){if(!fe)continue;const[he,de]=fe.split("-").map(Number);if(de<2||de>8||he>2026||he===2026&&de>9)return!1}return!0},W=re=>{const ue=[...p.installment_months];re===1?$("installment_months",[ue[0]||""]):re===2?$("installment_months",[ue[0]||"",ue[1]||""]):$("installment_months",[ue[0]||"",ue[1]||"",ue[2]||""]),$("installment_count",re)},K=(re,ue)=>{const ae=[...p.installment_months];ae[re]=ue,$("installment_months",ae)},$=(re,ue)=>{x(ae=>({...ae,[re]:ue})),d[re]&&f(ae=>{const ie={...ae};return delete ie[re],ie})},P=re=>{x(ue=>({...ue,seminar_confession_religieuse:re,seminar_confession_religieuse_autre:re==="autre"?ue.seminar_confession_religieuse_autre:""})),f(ue=>{const ae={...ue};return delete ae.seminar_confession_religieuse,delete ae.seminar_confession_religieuse_autre,ae})},L=re=>{x(ue=>{const ae=ue.seminar_domaines_etude||[],ie=ae.includes(re)?ae.filter(fe=>fe!==re):[...ae,re];return{...ue,seminar_domaines_etude:ie}}),f(ue=>{const ae={...ue};return delete ae.seminar_domaines_etude,delete ae.seminar_domaine_etude_autre,ae})},E=re=>{x(ue=>{const ae=ue.seminar_engagements||[],ie=ae.includes(re)?ae.filter(fe=>fe!==re):[...ae,re];return{...ue,seminar_engagements:ie}}),f(ue=>{const ae={...ue};return delete ae.seminar_engagements,delete ae.seminar_engagements_autre,ae})},j=re=>{const ue=Oh.find(ae=>ae.name===re);if($("country",re),ue&&ue.dialCode!=="+"){const ae=p.phone.trim(),ie=ue.dialCode+" ";if(!ae||ae===""){$("phone",ie);return}const fe=Oh.find(he=>he.dialCode!=="+"&&(ae.startsWith(he.dialCode)||ae.startsWith(he.dialCode+" ")));if(fe){let he=ae;he.startsWith(fe.dialCode+" ")?he=he.substring(fe.dialCode.length+1):he.startsWith(fe.dialCode)&&(he=he.substring(fe.dialCode.length)),he=he.trim(),$("phone",ie+he)}else if(!ae.startsWith("+"))$("phone",ie+ae);else if(ae.match(/^\+\s*(\d+)/)){const de=ae.replace(/^\+\s*/,"").trim();$("phone",ie+de)}else $("phone",ie)}},k=re=>{const ue=re.trim(),ae=Oh.find(ie=>ie.name===p.country);if(ae&&ae.dialCode!=="+"&&ue.startsWith(ae.dialCode)&&ue.length>ae.dialCode.length){const ie=ue.substring(ae.dialCode.length);if(ie&&!ie.startsWith(" ")){$("phone",ae.dialCode+" "+ie);return}}$("phone",re)},S=re=>{x(ue=>({...ue,selectedEvents:[re]})),d.selectedEvents&&f(ue=>{const ae={...ue};return delete ae.selectedEvents,ae})},N=()=>p.selectedEvents.length===0?(f({selectedEvents:["Veuillez choisir une option"]}),!1):!0,O=()=>{const re={};p.first_name.trim()||(re.first_name=["Le prénom est requis"]),p.last_name.trim()||(re.last_name=["Le nom est requis"]),p.email.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p.email)||(re.email=["Format d'email invalide"]):re.email=["L'email est requis"],p.phone.trim()||(re.phone=["Le téléphone est requis"]);const ue=p.selectedEvents.includes("seminar");return p.country.trim()||(re.country=[ue?"Le pays de résidence est requis":"Le pays est requis"]),f(re),Object.keys(re).length===0},D=()=>{const re={};return p.package_code||(re.package_code=["Veuillez sélectionner une formule pour le Sommet"]),p.package_code==="A"&&!p.ouaga_resident_confirmed&&(re.ouaga_resident_confirmed=["Champ requis : veuillez cocher cette case pour confirmer que vous êtes résident de Ouagadougou (Formule A)."]),p.package_code==="D"&&!p.spouse_fullname.trim()&&(re.spouse_fullname=["Le nom du conjoint est requis pour la formule D"]),p.participated_haggai_seminar!=="oui"&&p.participated_haggai_seminar!=="non"&&(re.participated_haggai_seminar=["Veuillez indiquer si vous avez déjà participé à un séminaire Haggai (International, Régional ou National)."]),p.participated_haggai_seminar==="oui"&&!p.hle_vhle_number.trim()&&(re.hle_vhle_number=["Le HAGGAI ID ou l'année du séminaire est requis lorsque vous avez déjà participé à un séminaire Haggai."]),f(re),Object.keys(re).length===0},B=()=>{const re={};return p.seminar_church_organization.trim()||(re.seminar_church_organization=["L'église ou organisation est requise"]),p.seminar_role_ministry.trim()||(re.seminar_role_ministry=["Le rôle dans le ministère est requis"]),p.seminar_marital_status||(re.seminar_marital_status=["La situation matrimoniale est requise"]),p.seminar_gender||(re.seminar_gender=["Le genre est requis"]),p.seminar_question_or_concern.trim()||(re.seminar_question_or_concern=["La question ou préoccupation est requise"]),p.seminar_date_naissance?.trim()||(re.seminar_date_naissance=["La date de naissance est requise"]),p.seminar_contact_urgence_nom_lien.trim()||(re.seminar_contact_urgence_nom_lien=["Le contact d'urgence (nom et lien) est requis"]),p.seminar_niveau_etudes||(re.seminar_niveau_etudes=["Le niveau d'études est requis"]),!p.seminar_domaines_etude?.length&&!p.seminar_domaine_etude_autre?.trim()&&(re.seminar_domaines_etude=["Sélectionnez au moins un domaine d'étude ou précisez dans « Autre »"]),p.seminar_niveau_francais||(re.seminar_niveau_francais=["Le niveau de français est requis"]),p.seminar_besoin_lettre_absence||(re.seminar_besoin_lettre_absence=["Indiquez si vous avez besoin d'une lettre d'absence"]),p.seminar_besoin_lettre_absence==="oui"&&!p.seminar_besoin_lettre_details?.trim()&&(re.seminar_besoin_lettre_details=["Les détails pour la lettre d'absence sont requis"]),p.seminar_sante_details?.trim()||(re.seminar_sante_details=["Les informations de santé sont requises (indiquez « Aucun » si applicable)"]),p.seminar_regime_sans_sel||(re.seminar_regime_sans_sel=["Indiquez si vous suivez un régime sans sel"]),p.seminar_confession_religieuse||(re.seminar_confession_religieuse=["La confession religieuse est requise"]),p.seminar_confession_religieuse==="autre"&&!p.seminar_confession_religieuse_autre?.trim()&&(re.seminar_confession_religieuse_autre=["Veuillez préciser votre confession religieuse"]),p.seminar_fardeau_transformation?.trim()||(re.seminar_fardeau_transformation=["Veuillez indiquer vos attentes"]),p.seminar_recommande_par?.trim()||(re.seminar_recommande_par=["Indiquez par qui vous êtes recommandé(e)"]),!p.seminar_engagements?.length&&!p.seminar_engagements_autre?.trim()&&(re.seminar_engagements=["Sélectionnez au moins un engagement ou précisez dans « Autre »"]),f(re),Object.keys(re).length===0},Y=()=>{const re={};for(let ae=0;aeae&&ae.trim());return ue.length>0&&!H(ue)&&(re.installment_months=["Toutes les échéances doivent être au plus tard 2 mois avant l'événement (août 2026 au plus tard)"]),f(re),Object.keys(re).length===0},Z=()=>!(!p.first_name.trim()||!p.last_name.trim()||!p.email.trim()||!p.phone.trim()||!p.country.trim()||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p.email)||!p.recommended_first_name.trim()||!p.recommended_last_name.trim()||!p.recommended_profession.trim()||!p.recommended_residence_country.trim()||!p.recommended_phone_whatsapp.trim()||!p.recommended_email.trim()||!p.recommended_gender||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p.recommended_email)),ne=()=>{if(!p.first_name.trim()||!p.last_name.trim()||!p.email.trim()||!p.phone.trim()||!p.country.trim()||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p.email))return!1;const re=p.selectedEvents.includes("summit");return!(re&&!p.package_code||re&&p.package_code==="A"&&!p.ouaga_resident_confirmed||re&&p.package_code==="D"&&!p.spouse_fullname.trim()||re&&p.participated_haggai_seminar!=="oui"&&p.participated_haggai_seminar!=="non"||re&&p.participated_haggai_seminar==="oui"&&!p.hle_vhle_number.trim())},q=()=>{const re={};return p.recommended_first_name.trim()||(re.recommended_first_name=["Le prénom de la personne recommandée est requis"]),p.recommended_last_name.trim()||(re.recommended_last_name=["Le nom de la personne recommandée est requis"]),p.recommended_profession.trim()||(re.recommended_profession=["La profession est requise"]),p.recommended_residence_country.trim()||(re.recommended_residence_country=["Le pays de résidence est requis"]),p.recommended_phone_whatsapp.trim()||(re.recommended_phone_whatsapp=["Le téléphone WhatsApp est requis"]),p.recommended_email.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p.recommended_email)||(re.recommended_email=["Format d'email invalide"]):re.recommended_email=["L'email de la personne recommandée est requis"],p.recommended_gender||(re.recommended_gender=["Le genre de la personne recommandée est requis"]),f(re),Object.keys(re).length===0},ee=()=>{N()&&u(2)},z=()=>{const re=i();if(!O())return;const ue=p.selectedEvents.includes("summit"),ae=p.selectedEvents.includes("seminar"),ie=p.selectedEvents.includes("recommend"),fe=ie&&!ue&&!ae?!0:Y();re===4?D()&&fe&&u(3):re===3?ue&&ae||ue&&ie?D()&&fe&&u(3):ae&&ie&&B()&&fe&&u(3):re===2&&(ue?D()&&fe&&se():ae?B()&&fe&&se():ie&&q()&&se())},I=()=>{u(1)},X=()=>{u(2)},te=()=>{const re=i();if(!O())return;const ue=p.selectedEvents.includes("summit"),ae=p.selectedEvents.includes("seminar"),ie=p.selectedEvents.includes("recommend");re===4?B()&&u(4):re===3&&(ue&&ae?D()&&B()&&se():ue&&ie?D()&&q()&&se():ae&&ie&&q()&&se())},se=async re=>{const ue=p.selectedEvents.includes("summit"),ae=p.selectedEvents.includes("seminar"),ie=p.selectedEvents.includes("recommend"),fe=ie&&p.selectedEvents.length===1;if(O()&&!(ue&&!D())&&!(ae&&!B())&&!(fe&&!q())&&!(!fe&&!Y())){s(!0),f({});try{const he=[],de=[],ge=[],ye=[];if(fe)try{const xe={website:"",event:Ax,recommender_first_name:p.first_name.trim(),recommender_last_name:p.last_name.trim(),recommender_email:p.email.trim().toLowerCase(),recommender_phone:p.phone.trim(),recommender_country:p.country.trim()||void 0,recommended_full_name:[p.recommended_first_name.trim(),p.recommended_last_name.trim()].filter(Boolean).join(" "),recommended_profession:p.recommended_profession.trim(),recommended_residence_country:p.recommended_residence_country.trim(),recommended_phone_whatsapp:p.recommended_phone_whatsapp.trim(),recommended_email:p.recommended_email.trim()?p.recommended_email.trim().toLowerCase():void 0,recommended_gender:p.recommended_gender,...p.recommended_contacted_before==="oui"||p.recommended_contacted_before==="non"?{recommender_contacted_person:p.recommended_contacted_before}:{}},ce=await $4.create(xe);de.push(ce.recommendation_id),r&&r({id:ce.recommendation_id,type:"recommendation"}),s(!1);return}catch(xe){if(xe instanceof Vt)if(xe.status===422){const ce=xe.data.errors||{};f(ce),ge.push("Erreurs de validation pour la recommandation.")}else ge.push(`Erreur lors de la création de la recommandation: ${xe.data.message||"Une erreur est survenue."}`);else ge.push("Erreur inattendue lors de la création de la recommandation.");ge.length>0&&n&&n(ge.join(" ")),s(!1);return}for(const xe of p.selectedEvents){if(xe==="recommend")continue;const ce=xe==="summit"?q4:Ax;let Ce=0;if(xe==="summit"){if(!p.package_code){ge.push("Veuillez sélectionner une formule pour le Sommet");continue}if(v){ge.push("Chargement des formules du Sommet en cours...");continue}if(y.length===0){ge.push("Aucune formule disponible pour le Sommet. Veuillez réessayer.");continue}const je=y.find(Ie=>Ie.code===p.package_code);if(!je){ge.push("La formule sélectionnée n'existe pas pour le Sommet");continue}Ce=je.id}else xe==="seminar"&&(Ce=0);const Oe={website:"",...xe==="summit"&&{pricing_plan_id:Ce},first_name:p.first_name.trim(),last_name:p.last_name.trim(),email:p.email.trim().toLowerCase(),phone:p.phone.trim(),country:p.country.trim(),city:p.city.trim()||void 0,organization:p.organization.trim()||void 0,position:p.position.trim()||void 0,nationality:p.nationality.trim()||void 0,is_haggai_leader:p.participated_haggai_seminar==="oui",haggai_id:p.participated_haggai_seminar==="oui"&&p.hle_vhle_number.trim()||void 0,payment_method_selected:p.payment_method_selected};if(p.installment_months.some(je=>je&&je.trim())&&(Oe.installment_config={method:p.payment_method_selected,number_of_installments:p.installment_count,installments:p.installment_months.filter(je=>je&&je.trim()).map(je=>({month:je.trim()}))}),xe==="summit"&&(Oe.ouaga_resident_confirmed=p.ouaga_resident_confirmed||!1,p.package_code==="D"&&p.spouse_fullname.trim()&&(Oe.spouse_fullname=p.spouse_fullname.trim()),p.package_code==="D"&&p.spouse_email?.trim()&&(Oe.spouse_email=p.spouse_email.trim().toLowerCase()),p.package_code==="D"&&p.spouse_haggai_id?.trim()&&(Oe.spouse_haggai_id=p.spouse_haggai_id.trim())),xe==="seminar"){let je="participate";p.selectedEvents.includes("seminar")||(je="na"),Oe.seminar_intent=je,Oe.seminar_want_to_participate="oui",Oe.seminar_marital_status=p.seminar_marital_status&&(p.seminar_marital_status==="marie"||p.seminar_marital_status==="non_marie")?p.seminar_marital_status:"non_marie";const Ie=nB(p.seminar_date_naissance??"");Oe.seminar_age=Ie!=null&&Ie>=1?Ie>120?120:Ie:25,Oe.seminar_gender=p.seminar_gender&&(p.seminar_gender==="homme"||p.seminar_gender==="femme")?p.seminar_gender:"homme",Oe.seminar_church_organization=p.seminar_church_organization.trim(),Oe.seminar_role_ministry=p.seminar_role_ministry.trim(),Oe.seminar_question_or_concern=p.seminar_question_or_concern.trim(),Oe.seminar_date_naissance=p.seminar_date_naissance?.trim()||void 0,Oe.seminar_contact_urgence_nom_lien=p.seminar_contact_urgence_nom_lien?.trim()||void 0,Oe.seminar_niveau_etudes=p.seminar_niveau_etudes&&["primaire","secondaire_2","universitaire"].includes(p.seminar_niveau_etudes)?p.seminar_niveau_etudes:void 0,Oe.seminar_domaines_etude=p.seminar_domaines_etude?.length?p.seminar_domaines_etude:void 0,Oe.seminar_domaine_etude_autre=p.seminar_domaine_etude_autre?.trim()||void 0,Oe.seminar_niveau_francais=p.seminar_niveau_francais&&["natif","avance","intermediaire","faible"].includes(p.seminar_niveau_francais)?p.seminar_niveau_francais:void 0,Oe.seminar_besoin_lettre_absence=p.seminar_besoin_lettre_absence==="oui"||p.seminar_besoin_lettre_absence==="non"?p.seminar_besoin_lettre_absence:void 0,Oe.seminar_besoin_lettre_details=p.seminar_besoin_lettre_details?.trim()||void 0,Oe.seminar_sante_details=p.seminar_sante_details?.trim()||void 0,Oe.seminar_regime_sans_sel=p.seminar_regime_sans_sel==="oui"||p.seminar_regime_sans_sel==="non"?p.seminar_regime_sans_sel:void 0,Oe.seminar_confession_religieuse=p.seminar_confession_religieuse&&["musulmane","catholique","protestante","pentecotiste","evangelique","autre"].includes(p.seminar_confession_religieuse)?p.seminar_confession_religieuse:void 0,p.seminar_confession_religieuse==="autre"&&(Oe.seminar_confession_religieuse_autre=p.seminar_confession_religieuse_autre.trim()||void 0),Oe.seminar_fardeau_transformation=p.seminar_fardeau_transformation?.trim()||void 0,Oe.seminar_recommande_par=p.seminar_recommande_par?.trim()||void 0,Oe.seminar_engagements=p.seminar_engagements?.length?p.seminar_engagements:void 0,Oe.seminar_engagements_autre=p.seminar_engagements_autre?.trim()||void 0}try{const je=await z1.create(ce,Oe);je&&je.registration_id?he.push(je.registration_id):(console.error("Réponse invalide pour",xe,je),ge.push(`Réponse invalide lors de l'inscription à ${xe==="summit"?"le Sommet":"le Séminaire"}.`))}catch(je){if(console.error("Erreur lors de l'inscription à",xe,je),je instanceof Vt)if(je.status===409){const Ie=je.data;Ie?.existing_registration_id?ye.push({eventType:xe==="summit"?"Sommet":"Séminaire",existingId:Ie.existing_registration_id}):ge.push(`Erreur lors de l'inscription à ${xe==="summit"?"le Sommet":"le Séminaire"}: ${je.data.message||"Une erreur est survenue."}`)}else if(je.status===422){const Ie=je.data?.errors||{};Object.keys(Ie).length>0&&console.error("Validation 422 (inscription)",Ie);const et=[],Ue={};Object.keys(Ie).forEach(Ze=>{const tt=Array.isArray(Ie[Ze])?Ie[Ze]:[Ie[Ze]];tt.forEach(Ke=>et.push(Ke)),Ue[`${Ze}_${xe}`]=tt,xe==="summit"&&Ze==="pricing_plan_id"&&(Ue.package_code=tt),Ze==="payment_method_selected"&&(Ue.payment_method_selected=tt),Ze==="ouaga_resident_confirmed"&&(Ue.ouaga_resident_confirmed=tt),Ze==="spouse_fullname"&&(Ue.spouse_fullname=tt)}),et.length>0&&(Ue._general=et),f(Ze=>({...Ze,...Ue})),ge.push(`Erreurs de validation pour ${xe==="summit"?"le Sommet":"le Séminaire"}.`)}else je.status===404?ge.push(`Les inscriptions publiques ne sont pas disponibles pour ${xe==="summit"?"le Sommet":"le Séminaire"}.`):ge.push(`Erreur lors de l'inscription à ${xe==="summit"?"le Sommet":"le Séminaire"}: ${je.data.message||"Une erreur est survenue."}`);else ge.push(`Erreur inattendue lors de l'inscription à ${xe==="summit"?"le Sommet":"le Séminaire"}.`)}}if(ie&&!fe)try{const xe={website:"",event:Ax,recommender_first_name:p.first_name.trim(),recommender_last_name:p.last_name.trim(),recommender_email:p.email.trim().toLowerCase(),recommender_phone:p.phone.trim(),recommender_country:p.country.trim()||void 0,recommended_full_name:[p.recommended_first_name.trim(),p.recommended_last_name.trim()].filter(Boolean).join(" "),recommended_profession:p.recommended_profession.trim(),recommended_residence_country:p.recommended_residence_country.trim(),recommended_phone_whatsapp:p.recommended_phone_whatsapp.trim(),recommended_email:p.recommended_email.trim()?p.recommended_email.trim().toLowerCase():void 0,recommended_gender:p.recommended_gender,...p.recommended_contacted_before==="oui"||p.recommended_contacted_before==="non"?{recommender_contacted_person:p.recommended_contacted_before}:{}},ce=await $4.create(xe);de.push(ce.recommendation_id)}catch(xe){if(xe instanceof Vt)if(xe.status===422){const ce=xe.data.errors||{};f(Ce=>({...Ce,...ce})),ge.push("Erreurs de validation pour la recommandation.")}else ge.push(`Erreur lors de la création de la recommandation: ${xe.data.message||"Une erreur est survenue."}`);else ge.push("Erreur inattendue lors de la création de la recommandation.")}if(he.length>0||de.length>0){if(r&&(he.length>0?r({id:he[0],type:"registration"}):de.length>0&&r({id:de[0],type:"recommendation"})),ye.length>0&&t&&t(ye[0].existingId),ge.length>0&&n){const xe=ge.join(" "),ce=ye.length>0?` Note: ${ye.length} inscription(s) existante(s) détectée(s) pour ${ye.map(Ce=>Ce.eventType).join(" et ")}.`:"";n(`Inscription(s) et/ou recommandation(s) créée(s) avec succès, mais certaines erreurs sont survenues: ${xe}${ce}`)}else if(ye.length>0&&!t){const xe=`${ye.length} inscription(s) existante(s) détectée(s) pour ${ye.map(ce=>ce.eventType).join(" et ")}.`;n&&n(xe)}}else if(ye.length>0&&ge.length===0){const xe=ye.map(Ce=>`${Ce.eventType} (ID: ${Ce.existingId})`).join(" et "),ce=`Vous avez déjà une inscription pour ${ye.length>1?"les événements suivants":"cet événement"}: ${xe}.`;f({_general:[ce]}),t?t(ye[0].existingId):n&&n(ce)}else if(ge.length>0){if(f(xe=>Object.keys(xe).some(Ce=>Ce!=="_general"&&Array.isArray(xe[Ce])&&xe[Ce].length>0)&&xe._general&&xe._general.length>0?xe:{...xe,_general:ge}),n){const xe=ye.length>0?` Note: ${ye.length} inscription(s) existante(s) détectée(s) pour ${ye.map(ce=>ce.eventType).join(" et ")}.`:"";n(ge.join(" ")+xe)}}else f({_general:["Aucune inscription ni recommandation n'a pu être créée."]}),n&&n("Aucune inscription ni recommandation n'a pu être créée.")}catch{f({_general:["Une erreur inattendue est survenue."]}),n&&n("Une erreur inattendue est survenue.")}finally{s(!1)}}},Q=re=>{const ue=d[re];return ue&&ue.length>0?ue[0]:void 0};if(c)return a.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[320px] w-full py-16 px-6 bg-white rounded-xl border border-gray-200 shadow-soft",children:[a.jsx(ZL,{className:"w-14 h-14 text-brand-600 animate-spin mb-6","aria-hidden":!0}),a.jsx("h3",{className:"text-xl font-heading font-semibold text-ink-900 mb-2 text-center",children:"Soumission en cours…"}),a.jsx("p",{className:"text-ink-600 text-center max-w-md",children:"Enregistrement de votre inscription ou recommandation et envoi des notifications par email. Merci de ne pas quitter cette page."})]});if(o===1){const re=e?.length===1?e[0]:null,ue=!re||re==="summit",ae=!re||re==="seminar",ie=!re||re==="recommend";return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-xl font-heading font-medium text-ink-900 mb-4 text-center",children:"Quel est votre choix ? (une seule option possible)"}),a.jsx("div",{className:re?"max-w-sm mx-auto":"",children:a.jsxs("div",{className:`grid gap-6 mb-6 items-stretch ${re?"grid-cols-1":"grid-cols-1 md:grid-cols-3"}`,children:[ue&&a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{onClick:()=>S("summit"),className:`bg-white rounded-xl shadow-soft overflow-hidden border transition-all flex flex-col flex-1 cursor-pointer ${p.selectedEvents.includes("summit")?"border-brand-700 border-2 shadow-lg":"border-gray-200 hover:shadow-lg"}`,children:[a.jsx("div",{className:"relative h-48 overflow-hidden bg-gray-100 flex-shrink-0",children:a.jsx("img",{src:"/sommet1.webp",alt:"Sommet Francophone",className:"w-full h-full object-cover"})}),a.jsx("div",{className:"p-4 text-center flex-1 flex items-center justify-center",children:a.jsx("h4",{className:"text-lg font-heading font-medium text-ink-900",children:"Sommet Francophone"})})]}),a.jsxs("label",{className:"flex items-center justify-center space-x-2 cursor-pointer mt-4 p-2 rounded-lg hover:bg-gray-50 transition-colors h-12",children:[a.jsx("input",{type:"radio",name:"selectedEvent",value:"summit",checked:p.selectedEvents.includes("summit"),onChange:()=>S("summit"),className:"w-5 h-5 border-gray-300 text-brand-700 focus:ring-brand-600"}),a.jsx("span",{className:"text-ink-500 font-light text-sm",children:"Choisir"})]})]}),ae&&a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{onClick:()=>S("seminar"),className:`bg-white rounded-xl shadow-soft overflow-hidden border transition-all flex flex-col flex-1 cursor-pointer ${p.selectedEvents.includes("seminar")?"border-brand-700 border-2 shadow-lg":"border-gray-200 hover:shadow-lg"}`,children:[a.jsx("div",{className:"relative h-48 overflow-hidden bg-gray-100 flex-shrink-0",children:a.jsx("img",{src:"/seminaireregional.webp",alt:"Séminaire Régional",className:"w-full h-full object-cover"})}),a.jsx("div",{className:"p-4 text-center flex-1 flex items-center justify-center",children:a.jsx("h4",{className:"text-lg font-heading font-medium text-ink-900",children:"Séminaire Régional"})})]}),a.jsxs("label",{className:"flex items-center justify-center space-x-2 cursor-pointer mt-4 p-2 rounded-lg hover:bg-gray-50 transition-colors h-12",children:[a.jsx("input",{type:"radio",name:"selectedEvent",value:"seminar",checked:p.selectedEvents.includes("seminar"),onChange:()=>S("seminar"),className:"w-5 h-5 border-gray-300 text-brand-700 focus:ring-brand-600"}),a.jsx("span",{className:"text-ink-500 font-light text-sm",children:"Choisir"})]})]}),ie&&a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{onClick:()=>S("recommend"),className:`bg-white rounded-xl shadow-soft overflow-hidden border transition-all flex flex-col flex-1 cursor-pointer ${p.selectedEvents.includes("recommend")?"border-brand-700 border-2 shadow-lg":"border-gray-200 hover:shadow-lg"}`,children:[a.jsx("div",{className:"relative h-48 overflow-hidden bg-gray-100 flex-shrink-0",children:a.jsx("img",{src:"/recommandation.webp",alt:"Recommander des participants",className:"w-full h-full object-cover"})}),a.jsx("div",{className:"p-4 text-center flex-1 flex items-center justify-center",children:a.jsx("h4",{className:"text-lg font-heading font-medium text-ink-900",children:"Recommander des participants"})})]}),a.jsxs("label",{className:"flex items-center justify-center space-x-2 cursor-pointer mt-4 p-2 rounded-lg hover:bg-gray-50 transition-colors h-12",children:[a.jsx("input",{type:"radio",name:"selectedEvent",value:"recommend",checked:p.selectedEvents.includes("recommend"),onChange:()=>S("recommend"),className:"w-5 h-5 border-gray-300 text-brand-700 focus:ring-brand-600"}),a.jsx("span",{className:"text-ink-500 font-light text-sm",children:"Choisir"})]})]})]})}),Q("selectedEvents")&&a.jsx("p",{className:"mt-2 text-sm text-red-600 text-center",children:Q("selectedEvents")})]}),p.selectedEvents.includes("summit")&&a.jsxs("div",{className:"mt-6 p-6 bg-brand-50 border border-brand-700 rounded-xl",children:[a.jsx("h4",{className:"text-lg font-heading font-medium text-ink-900 mb-4",children:"Voulez-vous participer au sommet de la Région Afrique francophone - Ouaga 2026?"}),a.jsxs("div",{className:"space-y-4 text-sm font-light text-ink-500",children:[a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Dates et horaire (GMT) général du sommet:"}),a.jsx("p",{children:"Du 19 au 22 novembre 2026, à Ouagadougou - Burkina Faso"}),a.jsxs("ul",{className:"list-disc list-inside space-y-1 ml-2 mt-2",children:[a.jsx("li",{children:"Check-in dans les Hotels: 12h00-15h00, jeudi 19 novembre 2026"}),a.jsx("li",{children:"Enregistrement des participants au sommet: 15h00-17h00, jeudi 19 novembre 2026"}),a.jsx("li",{children:"Début du sommet: 17h00, jeudi 19 novembre 2026"}),a.jsx("li",{children:"Fin du sommet: 21h30, samedi 21 novembre 2026"}),a.jsx("li",{children:"Check-out/Culte/Visite-détente/départ: 8.30-15.00, dimanche 22 novembre 2026"})]})]}),a.jsxs("div",{className:"pt-4 border-t border-brand-700/30",children:[a.jsx("p",{className:"font-medium mb-2",children:"Les formules d'inscription au sommet:"}),a.jsxs("ul",{className:"list-disc list-inside space-y-1 ml-2",children:[a.jsx("li",{children:"Formule A 150 000 FCFA / 230 € par personne (pour les leaders résidant à Ouaga, pas de chambre d'hôtel)"}),a.jsx("li",{children:"Formule B 350 000 FCFA / 535 € par personne (deux délégués par chambre double en pension complète)"}),a.jsx("li",{children:"Formule C 450 000 FCFA / 690 € (un délégué par chambre en pension complète)"}),a.jsx("li",{children:"Formule D 550 000 FCFA / 840 € (pour les couples mariés par chambre en pension complète)"})]})]})]})]}),(p.selectedEvents.includes("seminar")||p.selectedEvents.includes("recommend"))&&a.jsxs("div",{className:"mt-6 p-6 bg-brand-50 border border-brand-700 rounded-xl",children:[a.jsx("h4",{className:"text-lg font-heading font-medium text-ink-900 mb-4",children:"Séminaire spécial régional hybride"}),a.jsx("div",{className:"space-y-4 text-sm font-light text-ink-500 mb-4",children:a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Dates du séminaire:"}),a.jsx("p",{children:"1ère partie en ligne : Du 22 au 30 octobre 2026"}),a.jsx("p",{children:"2ème partie présentielle : Du 15 au 19 novembre 2026, au Burkina Faso"})]})}),a.jsx("h5",{className:"text-base font-heading font-medium text-ink-900 mb-3 mt-4",children:"Profil des participants au séminaire spécial régional francophone:"}),a.jsxs("ol",{className:"space-y-3 text-sm font-light text-ink-500 list-decimal list-inside",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Âge:"})," de 25 à 60 ans"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Éducation:"})," niveau Bac+3, exemption faite aux leaders chrétiens reconnus"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Durée:"})," être disponible pour la formation entière qui dure 12 jours subdivisés comme suit: première partie, du 22 au 30 octobre 2026 (18 h en ligne en 8 jours) / deuxième partie, du 15 au 19 novembre 2026 (38h en résidentiel en 4 jours)"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Leadership:"})," être un leader chrétien laïc ou ecclésiastique"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Niveau de langue:"})," être capable de communiquer clairement en français parlé & écrit"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Coût:"})," être en mesure de payer les frais de participation de 350.000 FCFA (534 Euros) /N.B: les frais de voyage incombent au participant."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Ordinateur:"})," disposer d'un ordinateur portable ou d'un IPAD équivalent sur 12 jrs et de la connexion internet sur 8 jrs (pour la première partie en ligne)"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Évangélisation:"})," s'engager à évangéliser et à former d'autres chrétiens et leaders après la formation"]})]})]}),a.jsx(De,{type:"button",onClick:ee,className:"w-full mt-6",children:"Continuer"})]})}if(o===2){const re=p.selectedEvents.includes("summit"),ue=p.selectedEvents.includes("seminar"),ae=p.selectedEvents.includes("recommend"),ie=p.selectedEvents.length===1&&re,fe=p.selectedEvents.length===1&&ue,he=p.selectedEvents.length===1&&ae,de=p.selectedEvents.length===2&&!ae,ge=re&&ue&&ae,ye=ue&&ae&&!re,xe=re&&ae&&!ue;return a.jsxs("form",{onSubmit:ce=>{ce.preventDefault(),z()},className:"space-y-6",children:[d._general&&d._general.length>0&&a.jsxs("div",{className:"p-4 rounded-xl bg-red-50 border border-red-200 text-red-800 text-sm",children:[a.jsx("p",{className:"font-medium mb-1",children:"Erreur(s) de validation :"}),a.jsx("ul",{className:"list-disc list-inside space-y-0.5",children:d._general.map((ce,Ce)=>a.jsx("li",{children:ce},Ce))})]}),a.jsxs("div",{"aria-hidden":"true",className:"absolute -left-[9999px] top-0 opacity-0 h-0 overflow-hidden",children:[a.jsx("label",{htmlFor:"website-hp",children:"Site web"}),a.jsx("input",{type:"text",id:"website-hp",name:"website",tabIndex:-1,autoComplete:"off"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-xl font-heading font-medium text-ink-900 mb-4 text-center uppercase",children:ae?"INFORMATIONS SUR LE LEADER QUI RECOMMANDE":"INFORMATIONS PERSONNELLES"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Prénom ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.first_name,onChange:ce=>$("first_name",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("first_name")?"border-red-500":"border-gray-300"}`}),Q("first_name")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("first_name")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Nom ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.last_name,onChange:ce=>$("last_name",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("last_name")?"border-red-500":"border-gray-300"}`}),Q("last_name")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("last_name")})]})]}),a.jsx("p",{className:"text-xs text-ink-500 mt-1",children:"Indiquez le prénom et le nom tels qu'ils figurent sur le passeport ou la pièce d'identité."}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Email ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"email",value:p.email,onChange:ce=>$("email",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("email")?"border-red-500":"border-gray-300"}`}),Q("email")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("email")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:[ue?"Pays de résidence":"Pays"," ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsxs("select",{value:p.country,onChange:ce=>j(ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("country")?"border-red-500":"border-gray-300"}`,children:[a.jsx("option",{value:"",children:ue?"Sélectionner votre pays de résidence":"Sélectionner un pays"}),Oh.map(ce=>{const Ce=rB(ce.code);return a.jsxs("option",{value:ce.name,children:[Ce?`${Ce} ${ce.name}`:ce.name," ",ce.dialCode]},ce.code)})]}),Q("country")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("country")})]}),!he&&a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Ville"}),a.jsx("input",{type:"text",value:p.city,onChange:ce=>$("city",ce.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Téléphone (WhatsApp) ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"tel",value:p.phone,onChange:ce=>k(ce.target.value),placeholder:"+226 70123456",className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("phone")?"border-red-500":"border-gray-300"}`}),Q("phone")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("phone")})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:!he&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Nationalité"}),a.jsx("input",{type:"text",value:p.nationality,onChange:ce=>$("nationality",ce.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Organisation"}),a.jsx("input",{type:"text",value:p.organization,onChange:ce=>$("organization",ce.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Poste / Fonction"}),a.jsx("input",{type:"text",value:p.position,onChange:ce=>$("position",ce.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600"})]})]}),re&&a.jsxs("div",{children:[a.jsxs("p",{className:"block text-sm font-light text-ink-500 mb-2",children:["J'ai déjà participé à un séminaire Haggai (International, Régional ou National). ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsxs("div",{className:"flex flex-wrap gap-6",children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"participated_haggai_seminar",checked:p.participated_haggai_seminar==="oui",onChange:()=>$("participated_haggai_seminar","oui"),className:"rounded"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Oui"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"participated_haggai_seminar",checked:p.participated_haggai_seminar==="non",onChange:()=>$("participated_haggai_seminar","non"),className:"rounded"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Non"})]})]}),Q("participated_haggai_seminar")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("participated_haggai_seminar")}),p.participated_haggai_seminar==="oui"&&a.jsxs("div",{className:"mt-4 flex-1",children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["HAGGAI ID ou Année du séminaire ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.hle_vhle_number,onChange:ce=>$("hle_vhle_number",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("hle_vhle_number")?"border-red-500":"border-gray-300"}`}),Q("hle_vhle_number")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("hle_vhle_number")})]})]})]})})]}),(de||ie||ge||xe)&&a.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[a.jsx("h3",{className:"text-xl font-heading font-medium text-ink-900 mb-6 text-center",children:"CHOIX DE LA FORMULE D'HEBERGEMENT"}),a.jsxs("div",{children:[v?a.jsx("div",{className:"text-center py-8 text-ink-500",children:"Chargement des formules..."}):y.length===0?a.jsx("div",{className:"text-center py-8 text-ink-500",children:"Aucune formule disponible"}):a.jsx("div",{className:"grid grid-cols-2 gap-4",children:y.sort((ce,Ce)=>ce.sort_order-Ce.sort_order).map(ce=>{const Oe={A:{price:"150 000 FCFA / 230 €",description:"par personne (pour les leaders résidant à Ouaga, pas de chambre d'hôtel)"},B:{price:"350 000 FCFA / 535 €",description:"par personne (deux délégués par chambre double en pension complète)"},C:{price:"450 000 FCFA / 690 €",description:"(un délégué par chambre en pension complète)"},D:{price:"550 000 FCFA / 840 €",description:"(pour les couples mariés par chambre en pension complète)"}}[ce.code]||{price:ce.currency_primary==="XOF"?`${ce.price_xof.toLocaleString("fr-FR")} XOF`:`${ce.price_eur.toLocaleString("fr-FR")} EUR`,description:ce.description||""},Ie={A:"/formules/formule-a.jpg",B:"/formules/formule-b.jpg",C:"/formules/formule-c.jpg",D:"/formules/formule-d.jpg"}[ce.code]||"/formules/default.jpg";return a.jsxs("label",{className:`relative flex flex-col cursor-pointer rounded-xl overflow-hidden border-2 transition-all ${p.package_code===ce.code?"border-brand-700 shadow-lg":"border-gray-200 hover:border-brand-700 hover:shadow-md"}`,children:[a.jsx("input",{type:"radio",name:"package_code",value:ce.code,checked:p.package_code===ce.code,onChange:()=>$("package_code",ce.code),className:"sr-only"}),a.jsxs("div",{className:"relative h-48 overflow-hidden bg-gray-100",children:[a.jsx("img",{src:Ie,alt:ce.title,className:"w-full h-full object-cover",onError:et=>{et.target.src="/sommet1.webp"}}),p.package_code===ce.code&&a.jsx("div",{className:"absolute top-2 right-2 bg-brand-700 text-white rounded-full w-8 h-8 flex items-center justify-center",children:a.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:a.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]}),a.jsxs("div",{className:"p-4 bg-white",children:[a.jsx("h4",{className:"text-lg font-heading font-medium text-ink-900 mb-2",children:ce.title}),a.jsx("p",{className:"text-sm text-ink-500 font-light mb-2",children:Oe.description}),a.jsx("p",{className:"text-lg font-semibold text-brand-700",children:Oe.price})]})]},ce.id)})}),Q("package_code")&&a.jsx("p",{className:"mt-2 text-sm text-red-600 text-center",children:Q("package_code")}),h&&a.jsxs("div",{className:`mt-4 p-4 rounded-xl border-2 transition-colors ${Q("ouaga_resident_confirmed")?"border-red-500 bg-red-50":"border-gray-200 bg-gray-50"}`,children:[a.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[a.jsx("input",{type:"checkbox",checked:p.ouaga_resident_confirmed,onChange:ce=>$("ouaga_resident_confirmed",ce.target.checked),className:`mt-1 h-4 w-4 rounded focus:ring-2 focus:ring-offset-0 ${Q("ouaga_resident_confirmed")?"border-red-500 text-red-600 focus:ring-red-500":"border-gray-300 text-brand-600 focus:ring-brand-600"}`}),a.jsx("span",{className:"text-sm text-ink-700",children:"Je confirme être résident de Ouagadougou (obligatoire pour la Formule A — pas de chambre d'hôtel incluse)."})]}),Q("ouaga_resident_confirmed")&&a.jsx("p",{className:"mt-2 text-sm font-medium text-red-600",role:"alert",children:Q("ouaga_resident_confirmed")})]})]}),p.package_code==="D"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Nom du conjoint / de la conjointe ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.spouse_fullname,onChange:ce=>$("spouse_fullname",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("spouse_fullname")?"border-red-500":"border-gray-300"}`}),Q("spouse_fullname")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("spouse_fullname")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Email du conjoint / de la conjointe"}),a.jsx("input",{type:"email",value:p.spouse_email,onChange:ce=>$("spouse_email",ce.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"HAGGAI ID ou Année du séminaire (conjoint / conjointe)"}),a.jsx("input",{type:"text",value:p.spouse_haggai_id,onChange:ce=>$("spouse_haggai_id",ce.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600"})]})]})]}),(fe||ye)&&a.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Église ou organisation"}),a.jsx("input",{type:"text",value:p.seminar_church_organization,onChange:ce=>$("seminar_church_organization",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("seminar_church_organization")?"border-red-500":"border-gray-300"}`}),Q("seminar_church_organization")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_church_organization")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Rôle/Ministère"}),a.jsx("input",{type:"text",value:p.seminar_role_ministry,onChange:ce=>$("seminar_role_ministry",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("seminar_role_ministry")?"border-red-500":"border-gray-300"}`}),Q("seminar_role_ministry")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_role_ministry")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-2",children:["Situation matrimoniale ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_marital_status",value:"marie",checked:p.seminar_marital_status==="marie",onChange:()=>$("seminar_marital_status","marie"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Marié(e)"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_marital_status",value:"non_marie",checked:p.seminar_marital_status==="non_marie",onChange:()=>$("seminar_marital_status","non_marie"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Non marié(e)"})]})]}),Q("seminar_marital_status")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_marital_status")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-2",children:["Genre ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_gender",value:"homme",checked:p.seminar_gender==="homme",onChange:()=>$("seminar_gender","homme"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Homme"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_gender",value:"femme",checked:p.seminar_gender==="femme",onChange:()=>$("seminar_gender","femme"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Femme"})]})]}),Q("seminar_gender")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_gender")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Question ou préoccupation"}),a.jsx("textarea",{value:p.seminar_question_or_concern,onChange:ce=>$("seminar_question_or_concern",ce.target.value),rows:3,className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600"})]}),a.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[a.jsx("h4",{className:"text-base font-heading font-medium text-ink-800 mb-3",children:"Compléments d'information pour le séminaire"}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Date de naissance"}),a.jsx("input",{type:"date",value:p.seminar_date_naissance,onChange:ce=>$("seminar_date_naissance",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("seminar_date_naissance")?"border-red-500":"border-gray-300"}`}),Q("seminar_date_naissance")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_date_naissance")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Personne à contacter en cas de besoin + lien de parenté"}),a.jsx("input",{type:"text",value:p.seminar_contact_urgence_nom_lien,onChange:ce=>$("seminar_contact_urgence_nom_lien",ce.target.value),placeholder:"Nom et lien (ex. époux, parent)",className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("seminar_contact_urgence_nom_lien")?"border-red-500":"border-gray-300"}`}),Q("seminar_contact_urgence_nom_lien")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_contact_urgence_nom_lien")})]}),a.jsx("h5",{className:"text-sm font-medium text-ink-700 mt-4 mb-2",children:"Éducation"}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-2",children:"Niveau d'études"}),a.jsx("div",{className:"space-y-2",children:["primaire","secondaire_2","universitaire"].map(ce=>a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_niveau_etudes_1",value:ce,checked:p.seminar_niveau_etudes===ce,onChange:()=>$("seminar_niveau_etudes",ce),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:ce==="primaire"?"Primaire":ce==="secondaire_2"?"Secondaire 2":"Universitaire"})]},ce))}),Q("seminar_niveau_etudes")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_niveau_etudes")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-2",children:"Domaine(s) d'études / formation"}),a.jsx("div",{className:"space-y-2",children:H4.map(({value:ce,label:Ce})=>a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",checked:p.seminar_domaines_etude?.includes(ce)??!1,onChange:()=>L(ce),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:Ce})]},ce))}),p.seminar_domaines_etude?.includes("autre")&&a.jsx("input",{type:"text",value:p.seminar_domaine_etude_autre,onChange:ce=>$("seminar_domaine_etude_autre",ce.target.value),placeholder:"Précisez",className:"mt-2 w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600"}),Q("seminar_domaines_etude")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_domaines_etude")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-2",children:"Niveau de français (écrit et parlé)"}),a.jsx("div",{className:"space-y-2",children:["natif","avance","intermediaire","faible"].map(ce=>a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_niveau_francais_1",value:ce,checked:p.seminar_niveau_francais===ce,onChange:()=>$("seminar_niveau_francais",ce),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:ce==="natif"?"Natif/Native":ce==="avance"?"Avancé":ce==="intermediaire"?"Intermédiaire":"Faible"})]},ce))}),Q("seminar_niveau_francais")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_niveau_francais")})]}),a.jsx("h5",{className:"text-sm font-medium text-ink-700 mt-4 mb-2",children:"Infos complémentaires"}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-2",children:"Besoin d'une lettre pour autorisation d'absence ?"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_besoin_lettre_1",value:"oui",checked:p.seminar_besoin_lettre_absence==="oui",onChange:()=>$("seminar_besoin_lettre_absence","oui"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Oui"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_besoin_lettre_1",value:"non",checked:p.seminar_besoin_lettre_absence==="non",onChange:()=>$("seminar_besoin_lettre_absence","non"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Non"})]})]}),p.seminar_besoin_lettre_absence==="oui"&&a.jsx("input",{type:"text",value:p.seminar_besoin_lettre_details,onChange:ce=>$("seminar_besoin_lettre_details",ce.target.value),placeholder:"Détails",className:"mt-2 w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600"}),Q("seminar_besoin_lettre_absence")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_besoin_lettre_absence")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Problème de santé / maladie chronique nécessitant attention ?"}),a.jsx("input",{type:"text",value:p.seminar_sante_details,onChange:ce=>$("seminar_sante_details",ce.target.value),placeholder:"Indiquez « Aucun » si applicable",className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("seminar_sante_details")?"border-red-500":"border-gray-300"}`}),Q("seminar_sante_details")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_sante_details")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-2",children:"Régime sans sel ?"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_regime_1",value:"oui",checked:p.seminar_regime_sans_sel==="oui",onChange:()=>$("seminar_regime_sans_sel","oui"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Oui"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_regime_1",value:"non",checked:p.seminar_regime_sans_sel==="non",onChange:()=>$("seminar_regime_sans_sel","non"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Non"})]})]}),Q("seminar_regime_sans_sel")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_regime_sans_sel")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-2",children:"Confession religieuse :"}),a.jsx("div",{className:"space-y-2",children:K4.map(({value:ce,label:Ce})=>a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_confession_1",value:ce,checked:p.seminar_confession_religieuse===ce,onChange:()=>P(ce),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:Ce})]},ce))}),Q("seminar_confession_religieuse")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_confession_religieuse")}),p.seminar_confession_religieuse==="autre"&&a.jsxs("div",{className:"mt-2",children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Spécifiez :"}),a.jsx("input",{type:"text",value:p.seminar_confession_religieuse_autre,onChange:ce=>$("seminar_confession_religieuse_autre",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("seminar_confession_religieuse_autre")?"border-red-500":"border-gray-300"}`}),Q("seminar_confession_religieuse_autre")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_confession_religieuse_autre")})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Quelles sont vos attentes ?"}),a.jsx("textarea",{value:p.seminar_fardeau_transformation,onChange:ce=>$("seminar_fardeau_transformation",ce.target.value),rows:2,className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("seminar_fardeau_transformation")?"border-red-500":"border-gray-300"}`}),Q("seminar_fardeau_transformation")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_fardeau_transformation")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Qui vous a recommandé ?"}),a.jsx("input",{type:"text",value:p.seminar_recommande_par,onChange:ce=>$("seminar_recommande_par",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("seminar_recommande_par")?"border-red-500":"border-gray-300"}`}),Q("seminar_recommande_par")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_recommande_par")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-2",children:"Engagements"}),a.jsx("div",{className:"space-y-2",children:W4.map(({value:ce,label:Ce})=>a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",checked:p.seminar_engagements?.includes(ce)??!1,onChange:()=>E(ce),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:Ce})]},ce))}),p.seminar_engagements?.includes("autre")&&a.jsx("input",{type:"text",value:p.seminar_engagements_autre,onChange:ce=>$("seminar_engagements_autre",ce.target.value),placeholder:"Précisez",className:"mt-2 w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600"}),Q("seminar_engagements")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_engagements")})]})]}),p.selectedEvents.includes("recommend")&&a.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[a.jsx("h4",{className:"text-lg font-heading font-medium text-ink-900 mb-4 text-center uppercase",children:"INFORMATIONS SUR LA PERSONNE RECOMMANDÉE"}),a.jsxs("div",{className:"mb-4",children:[a.jsx("p",{className:"block text-sm font-medium text-ink-900 mb-2",children:"Avez-vous déjà contacté la personne à propos de cette recommandation? (Il est fortement recommandé de contacter la personne avant que l'invitation officielle de Haggai lui soit envoyée.)"}),a.jsxs("div",{className:"flex flex-wrap gap-4",children:[a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[a.jsx("input",{type:"radio",name:"recommended_contacted_before",value:"oui",checked:p.recommended_contacted_before==="oui",onChange:()=>$("recommended_contacted_before","oui"),className:"w-4 h-4 border-gray-300 text-brand-700 focus:ring-brand-600"}),a.jsx("span",{className:"text-sm text-ink-700",children:"Oui"})]}),a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[a.jsx("input",{type:"radio",name:"recommended_contacted_before",value:"non",checked:p.recommended_contacted_before==="non",onChange:()=>$("recommended_contacted_before","non"),className:"w-4 h-4 border-gray-300 text-brand-700 focus:ring-brand-600"}),a.jsx("span",{className:"text-sm text-ink-700",children:"Non"})]})]}),p.recommended_contacted_before==="non"&&a.jsx("p",{className:"mt-2 text-sm text-red-600 font-medium",children:"Veuillez d'abord contacter la personne que vous voulez recommander pour la prévenir de l'invitation que Haggai va lui envoyer."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Prénom ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_first_name,onChange:ce=>$("recommended_first_name",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_first_name")?"border-red-500":"border-gray-300"}`}),Q("recommended_first_name")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_first_name")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Nom ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_last_name,onChange:ce=>$("recommended_last_name",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_last_name")?"border-red-500":"border-gray-300"}`}),Q("recommended_last_name")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_last_name")})]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Profession ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_profession,onChange:ce=>$("recommended_profession",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_profession")?"border-red-500":"border-gray-300"}`}),Q("recommended_profession")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_profession")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Pays de résidence ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_residence_country,onChange:ce=>$("recommended_residence_country",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_residence_country")?"border-red-500":"border-gray-300"}`}),Q("recommended_residence_country")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_residence_country")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Téléphone WhatsApp ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"tel",value:p.recommended_phone_whatsapp,onChange:ce=>$("recommended_phone_whatsapp",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_phone_whatsapp")?"border-red-500":"border-gray-300"}`}),Q("recommended_phone_whatsapp")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_phone_whatsapp")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Email ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"email",value:p.recommended_email,onChange:ce=>$("recommended_email",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_email")?"border-red-500":"border-gray-300"}`}),Q("recommended_email")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_email")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-2",children:["Genre ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"recommended_gender",value:"homme",checked:p.recommended_gender==="homme",onChange:()=>$("recommended_gender","homme"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Homme"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"recommended_gender",value:"femme",checked:p.recommended_gender==="femme",onChange:()=>$("recommended_gender","femme"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Femme"})]})]}),Q("recommended_gender")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_gender")})]})]})]}),he&&a.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[a.jsx("h3",{className:"text-xl font-heading font-medium text-ink-900 mb-4 text-center uppercase",children:"INFORMATIONS SUR LA PERSONNE RECOMMANDÉE"}),a.jsxs("div",{className:"mb-4",children:[a.jsx("p",{className:"block text-sm font-medium text-ink-900 mb-2",children:"Avez-vous déjà contacté la personne à propos de cette recommandation? (Il est fortement recommandé de contacter la personne avant que l'invitation officielle de Haggai lui soit envoyée.)"}),a.jsxs("div",{className:"flex flex-wrap gap-4",children:[a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[a.jsx("input",{type:"radio",name:"recommended_contacted_before",value:"oui",checked:p.recommended_contacted_before==="oui",onChange:()=>$("recommended_contacted_before","oui"),className:"w-4 h-4 border-gray-300 text-brand-700 focus:ring-brand-600"}),a.jsx("span",{className:"text-sm text-ink-700",children:"Oui"})]}),a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[a.jsx("input",{type:"radio",name:"recommended_contacted_before",value:"non",checked:p.recommended_contacted_before==="non",onChange:()=>$("recommended_contacted_before","non"),className:"w-4 h-4 border-gray-300 text-brand-700 focus:ring-brand-600"}),a.jsx("span",{className:"text-sm text-ink-700",children:"Non"})]})]}),p.recommended_contacted_before==="non"&&a.jsx("p",{className:"mt-2 text-sm text-red-600 font-medium",children:"Veuillez d'abord contacter la personne que vous voulez recommander pour la prévenir de l'invitation que Haggai va lui envoyer."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Prénom ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_first_name,onChange:ce=>$("recommended_first_name",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_first_name")?"border-red-500":"border-gray-300"}`}),Q("recommended_first_name")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_first_name")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Nom ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_last_name,onChange:ce=>$("recommended_last_name",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_last_name")?"border-red-500":"border-gray-300"}`}),Q("recommended_last_name")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_last_name")})]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Profession ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_profession,onChange:ce=>$("recommended_profession",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_profession")?"border-red-500":"border-gray-300"}`}),Q("recommended_profession")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_profession")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Pays de résidence ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_residence_country,onChange:ce=>$("recommended_residence_country",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_residence_country")?"border-red-500":"border-gray-300"}`}),Q("recommended_residence_country")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_residence_country")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Téléphone WhatsApp ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"tel",value:p.recommended_phone_whatsapp,onChange:ce=>$("recommended_phone_whatsapp",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_phone_whatsapp")?"border-red-500":"border-gray-300"}`}),Q("recommended_phone_whatsapp")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_phone_whatsapp")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Email ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"email",value:p.recommended_email,onChange:ce=>$("recommended_email",ce.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_email")?"border-red-500":"border-gray-300"}`}),Q("recommended_email")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_email")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-2",children:["Genre ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"recommended_gender",value:"homme",checked:p.recommended_gender==="homme",onChange:()=>$("recommended_gender","homme"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Homme"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"recommended_gender",value:"femme",checked:p.recommended_gender==="femme",onChange:()=>$("recommended_gender","femme"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Femme"})]})]}),Q("recommended_gender")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_gender")})]})]}),(!de||de&&p.selectedEvents.includes("summit")&&p.selectedEvents.includes("seminar"))&&!he&&a.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[p.selectedEvents.includes("seminar")&&a.jsx(X4,{}),a.jsx("h3",{className:"text-xl font-heading font-medium text-ink-900 mb-2 text-center uppercase",children:"MÉTHODE DE PAIEMENT"}),a.jsx("p",{className:"text-sm text-ink-500 mb-6 text-center",children:"Veuillez indiquer votre préférence de mode de paiement et le nombre d'échéances ci-dessous."}),(()=>{const ce=U();if(!(p.selectedEvents.includes("summit")&&p.selectedEvents.includes("seminar"))||!ce)return null;const Oe=y.find(Ie=>Ie.code===p.package_code),je=Oe?ce.currency==="EUR"?Oe.price_eur:Oe.price_xof:0;return a.jsxs("div",{className:"mb-6 bg-brand-50 rounded-xl p-6 space-y-4",children:[a.jsx("h4",{className:"text-lg font-heading font-medium text-ink-900 mb-4 text-center",children:"Récapitulatif des frais"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("p",{className:"text-sm font-medium text-ink-900",children:["Sommet - ",Oe?.title||"Formule sélectionnée"]}),a.jsx("p",{className:"text-xs text-ink-500",children:Oe?.code||""})]}),a.jsx("p",{className:"text-base font-semibold text-ink-900",children:T(je,ce.currency)})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-ink-900",children:"Séminaire - Résidentiel"}),a.jsx("p",{className:"text-xs text-ink-500",children:"Formule obligatoire"})]}),a.jsx("p",{className:"text-base font-semibold text-ink-900",children:T(ce.currency==="EUR"?C:_,ce.currency)})]}),a.jsxs("div",{className:"pt-4 border-t border-brand-700/30",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"text-lg font-heading font-semibold text-ink-900",children:"Total à payer"}),a.jsx("p",{className:"text-2xl font-bold text-brand-700",children:ce.formatted})]}),a.jsx("p",{className:"text-xs text-ink-500 mt-2 text-right",children:"Note : Les paiements peuvent être effectués séparément pour chaque événement."})]})]})]})})(),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("label",{className:`relative flex flex-col cursor-pointer rounded-xl overflow-hidden border-2 transition-all ${p.payment_method_selected==="mobile_money"?"border-brand-700 shadow-lg bg-brand-50":"border-gray-200 hover:border-brand-700 hover:shadow-md bg-white"}`,children:[a.jsx("input",{type:"radio",name:"payment_method",value:"mobile_money",checked:p.payment_method_selected==="mobile_money",onChange:()=>$("payment_method_selected","mobile_money"),className:"sr-only"}),a.jsxs("div",{className:"p-6 text-center",children:[a.jsx("div",{className:"mb-3 flex justify-center",children:a.jsx("div",{className:"w-12 h-12 rounded-full bg-brand-700/20 flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-brand-700",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"})})})}),a.jsx("h4",{className:"text-base font-heading font-medium text-ink-900 mb-1",children:"Mobile Money"}),p.payment_method_selected==="mobile_money"&&a.jsx("div",{className:"absolute top-2 right-2 bg-brand-700 text-white rounded-full w-6 h-6 flex items-center justify-center",children:a.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:a.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]})]}),a.jsxs("label",{className:`relative flex flex-col cursor-pointer rounded-xl overflow-hidden border-2 transition-all ${p.payment_method_selected==="card_visa"?"border-brand-700 shadow-lg bg-brand-50":"border-gray-200 hover:border-brand-700 hover:shadow-md bg-white"}`,children:[a.jsx("input",{type:"radio",name:"payment_method",value:"card_visa",checked:p.payment_method_selected==="card_visa",onChange:()=>$("payment_method_selected","card_visa"),className:"sr-only"}),a.jsxs("div",{className:"p-6 text-center",children:[a.jsx("div",{className:"mb-3 flex justify-center",children:a.jsx("div",{className:"w-12 h-12 rounded-full bg-brand-700/20 flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-brand-700",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})})})}),a.jsx("h4",{className:"text-base font-heading font-medium text-ink-900 mb-1",children:"Carte de crédit (Visa)"}),p.payment_method_selected==="card_visa"&&a.jsx("div",{className:"absolute top-2 right-2 bg-brand-700 text-white rounded-full w-6 h-6 flex items-center justify-center",children:a.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:a.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]})]}),a.jsxs("label",{className:`relative flex flex-col cursor-pointer rounded-xl overflow-hidden border-2 transition-all ${p.payment_method_selected==="national_office"?"border-brand-700 shadow-lg bg-brand-50":"border-gray-200 hover:border-brand-700 hover:shadow-md bg-white"}`,children:[a.jsx("input",{type:"radio",name:"payment_method",value:"national_office",checked:p.payment_method_selected==="national_office",onChange:()=>$("payment_method_selected","national_office"),className:"sr-only"}),a.jsxs("div",{className:"p-6 text-center",children:[a.jsx("div",{className:"mb-3 flex justify-center",children:a.jsx("div",{className:"w-12 h-12 rounded-full bg-brand-700/20 flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-brand-700",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"})})})}),a.jsx("h4",{className:"text-base font-heading font-medium text-ink-900 mb-1",children:"Bureau national"}),p.payment_method_selected==="national_office"&&a.jsx("div",{className:"absolute top-2 right-2 bg-brand-700 text-white rounded-full w-6 h-6 flex items-center justify-center",children:a.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:a.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]})]})]}),a.jsxs("div",{className:"mt-6 pt-6 border-t border-gray-200",children:[a.jsx("h4",{className:"text-lg font-heading font-medium text-ink-900 mb-4 text-center uppercase",children:"CONFIGURATION DES ÉCHÉANCES"}),a.jsxs("div",{className:"mb-6",children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-2",children:["Nombre d'échéances ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("div",{className:"flex gap-3",children:[1,2,3].map(ce=>a.jsxs("button",{type:"button",onClick:()=>W(ce),className:`flex-1 py-3 px-4 rounded-xl border-2 transition-all ${p.installment_count===ce?"border-brand-700 bg-brand-700 text-white":"border-gray-200 hover:border-brand-700 text-ink-500"}`,children:[ce," ",ce===1?"échéance":"échéances"]},ce))})]}),a.jsx("div",{className:"space-y-4",children:Array.from({length:p.installment_count}).map((ce,Ce)=>{const Oe=p.installment_months[Ce]||"",je=!Oe||H([Oe]),Ie=d[`installment_month_${Ce}`],et=!!Ie||!je&&!!Oe;return a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-2",children:["Échéance ",Ce+1," ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsxs("select",{value:Oe,onChange:Ue=>K(Ce,Ue.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${et?"border-red-500":"border-gray-300"}`,children:[a.jsx("option",{value:"",children:"Sélectionner un mois"}),F().map(Ue=>a.jsx("option",{value:Ue.value,children:Ue.label},Ue.value))]}),Ie&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Ie[0]}),!Ie&&!je&&Oe&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:"L'échéance doit être au plus tard 2 mois avant l'événement (septembre 2026 au plus tard)"})]},Ce)})}),d.installment_months&&a.jsx("p",{className:"mt-2 text-sm text-red-600",children:d.installment_months[0]})]})]}),a.jsxs("div",{className:"flex space-x-4 pt-4",children:[a.jsx(De,{type:"button",variant:"secondary",onClick:I,className:"flex-1",children:"Retour"}),de||ge||re&&ae&&!ue?a.jsx(De,{type:"button",onClick:z,disabled:!ne(),className:"flex-1",children:"Valider et passer au suivant"}):a.jsx(De,{type:"submit",disabled:c||he&&!Z(),className:"flex-1",children:c?"Envoi en cours...":"Envoyer"})]})]})}if(o===3){const re=p.selectedEvents.includes("summit"),ue=p.selectedEvents.includes("seminar"),ae=p.selectedEvents.includes("recommend"),ie=re&&ae&&!ue,fe=ue&&ae&&!re,he=re&&ue&&ae;return fe?a.jsx("form",{onSubmit:de=>{de.preventDefault(),te()},className:"space-y-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-xl font-heading font-medium text-ink-900 mb-4",children:"Recommander quelqu'un au Séminaire"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Prénom ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_first_name,onChange:de=>$("recommended_first_name",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_first_name")?"border-red-500":"border-gray-300"}`}),Q("recommended_first_name")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_first_name")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Nom ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_last_name,onChange:de=>$("recommended_last_name",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_last_name")?"border-red-500":"border-gray-300"}`}),Q("recommended_last_name")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_last_name")})]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Profession ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_profession,onChange:de=>$("recommended_profession",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_profession")?"border-red-500":"border-gray-300"}`}),Q("recommended_profession")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_profession")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Pays de résidence ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_residence_country,onChange:de=>$("recommended_residence_country",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_residence_country")?"border-red-500":"border-gray-300"}`}),Q("recommended_residence_country")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_residence_country")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Téléphone WhatsApp ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"tel",value:p.recommended_phone_whatsapp,onChange:de=>$("recommended_phone_whatsapp",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_phone_whatsapp")?"border-red-500":"border-gray-300"}`}),Q("recommended_phone_whatsapp")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_phone_whatsapp")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Email ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"email",value:p.recommended_email,onChange:de=>$("recommended_email",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_email")?"border-red-500":"border-gray-300"}`}),Q("recommended_email")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_email")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-2",children:["Genre ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"recommended_gender",value:"homme",checked:p.recommended_gender==="homme",onChange:()=>$("recommended_gender","homme"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Homme"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"recommended_gender",value:"femme",checked:p.recommended_gender==="femme",onChange:()=>$("recommended_gender","femme"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Femme"})]})]}),Q("recommended_gender")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_gender")})]}),a.jsxs("div",{className:"flex space-x-4 pt-4",children:[a.jsx(De,{type:"button",variant:"secondary",onClick:X,className:"flex-1",children:"Retour"}),a.jsx(De,{type:"submit",disabled:c,className:"flex-1",children:c?"Envoi en cours...":"Envoyer"})]})]})}):ie?a.jsx("form",{onSubmit:de=>{de.preventDefault(),te()},className:"space-y-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-xl font-heading font-medium text-ink-900 mb-4 text-center uppercase",children:"INFORMATIONS SUR LA PERSONNE RECOMMANDÉE"}),a.jsxs("div",{className:"mb-4",children:[a.jsx("p",{className:"block text-sm font-medium text-ink-900 mb-2",children:"Avez-vous déjà contacté la personne à propos de cette recommandation? (Il est fortement recommandé de contacter la personne avant que l'invitation officielle de Haggai lui soit envoyée.)"}),a.jsxs("div",{className:"flex flex-wrap gap-4",children:[a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[a.jsx("input",{type:"radio",name:"recommended_contacted_before",value:"oui",checked:p.recommended_contacted_before==="oui",onChange:()=>$("recommended_contacted_before","oui"),className:"w-4 h-4 border-gray-300 text-brand-700 focus:ring-brand-600"}),a.jsx("span",{className:"text-sm text-ink-700",children:"Oui"})]}),a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[a.jsx("input",{type:"radio",name:"recommended_contacted_before",value:"non",checked:p.recommended_contacted_before==="non",onChange:()=>$("recommended_contacted_before","non"),className:"w-4 h-4 border-gray-300 text-brand-700 focus:ring-brand-600"}),a.jsx("span",{className:"text-sm text-ink-700",children:"Non"})]})]}),p.recommended_contacted_before==="non"&&a.jsx("p",{className:"mt-2 text-sm text-red-600 font-medium",children:"Veuillez d'abord contacter la personne que vous voulez recommander pour la prévenir de l'invitation que Haggai va lui envoyer."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Prénom ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_first_name,onChange:de=>$("recommended_first_name",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_first_name")?"border-red-500":"border-gray-300"}`}),Q("recommended_first_name")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_first_name")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Nom ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_last_name,onChange:de=>$("recommended_last_name",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_last_name")?"border-red-500":"border-gray-300"}`}),Q("recommended_last_name")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_last_name")})]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Profession ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_profession,onChange:de=>$("recommended_profession",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_profession")?"border-red-500":"border-gray-300"}`}),Q("recommended_profession")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_profession")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Pays de résidence ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_residence_country,onChange:de=>$("recommended_residence_country",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_residence_country")?"border-red-500":"border-gray-300"}`}),Q("recommended_residence_country")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_residence_country")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Téléphone WhatsApp ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"tel",value:p.recommended_phone_whatsapp,onChange:de=>$("recommended_phone_whatsapp",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_phone_whatsapp")?"border-red-500":"border-gray-300"}`}),Q("recommended_phone_whatsapp")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_phone_whatsapp")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Email ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"email",value:p.recommended_email,onChange:de=>$("recommended_email",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_email")?"border-red-500":"border-gray-300"}`}),Q("recommended_email")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_email")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-2",children:["Genre ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"recommended_gender",value:"homme",checked:p.recommended_gender==="homme",onChange:()=>$("recommended_gender","homme"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Homme"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"recommended_gender",value:"femme",checked:p.recommended_gender==="femme",onChange:()=>$("recommended_gender","femme"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Femme"})]})]}),Q("recommended_gender")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_gender")})]}),a.jsxs("div",{className:"flex space-x-4 pt-4",children:[a.jsx(De,{type:"button",variant:"secondary",onClick:X,className:"flex-1",children:"Retour"}),a.jsx(De,{type:"submit",disabled:c,className:"flex-1",children:c?"Envoi en cours...":"Envoyer"})]})]})}):a.jsx("form",{onSubmit:de=>{de.preventDefault(),te()},className:"space-y-6",children:a.jsxs("div",{className:"space-y-4",children:[he&&a.jsx("div",{className:"mb-4 p-3 bg-blue-50 border border-blue-200 rounded-lg",children:a.jsx("p",{className:"text-sm text-blue-800",children:`Vous avez également sélectionné "Recommander quelqu'un". Vous pourrez renseigner les informations de la personne recommandée sur la page suivante.`})}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Église ou organisation"}),a.jsx("input",{type:"text",value:p.seminar_church_organization,onChange:de=>$("seminar_church_organization",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("seminar_church_organization")?"border-red-500":"border-gray-300"}`}),Q("seminar_church_organization")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_church_organization")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Rôle/Ministère"}),a.jsx("input",{type:"text",value:p.seminar_role_ministry,onChange:de=>$("seminar_role_ministry",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("seminar_role_ministry")?"border-red-500":"border-gray-300"}`}),Q("seminar_role_ministry")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_role_ministry")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-2",children:["Situation matrimoniale ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_marital_status",value:"marie",checked:p.seminar_marital_status==="marie",onChange:()=>$("seminar_marital_status","marie"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Marié(e)"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_marital_status",value:"non_marie",checked:p.seminar_marital_status==="non_marie",onChange:()=>$("seminar_marital_status","non_marie"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Non marié(e)"})]})]}),Q("seminar_marital_status")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_marital_status")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-2",children:["Genre ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_gender",value:"homme",checked:p.seminar_gender==="homme",onChange:()=>$("seminar_gender","homme"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Homme"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_gender",value:"femme",checked:p.seminar_gender==="femme",onChange:()=>$("seminar_gender","femme"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Femme"})]})]}),Q("seminar_gender")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_gender")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Question ou préoccupation"}),a.jsx("textarea",{value:p.seminar_question_or_concern,onChange:de=>$("seminar_question_or_concern",de.target.value),rows:3,className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600"})]}),a.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[a.jsx("h4",{className:"text-base font-heading font-medium text-ink-800 mb-3",children:"Compléments d'information pour le séminaire"}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Date de naissance"}),a.jsx("input",{type:"date",value:p.seminar_date_naissance,onChange:de=>$("seminar_date_naissance",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("seminar_date_naissance")?"border-red-500":"border-gray-300"}`}),Q("seminar_date_naissance")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_date_naissance")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Personne à contacter en cas de besoin + lien de parenté"}),a.jsx("input",{type:"text",value:p.seminar_contact_urgence_nom_lien,onChange:de=>$("seminar_contact_urgence_nom_lien",de.target.value),placeholder:"Nom et lien (ex. époux, parent)",className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("seminar_contact_urgence_nom_lien")?"border-red-500":"border-gray-300"}`}),Q("seminar_contact_urgence_nom_lien")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_contact_urgence_nom_lien")})]}),a.jsx("h5",{className:"text-sm font-medium text-ink-700 mt-4 mb-2",children:"Éducation"}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-2",children:"Niveau d'études"}),a.jsx("div",{className:"space-y-2",children:["primaire","secondaire_2","universitaire"].map(de=>a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_niveau_etudes_2",value:de,checked:p.seminar_niveau_etudes===de,onChange:()=>$("seminar_niveau_etudes",de),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:de==="primaire"?"Primaire":de==="secondaire_2"?"Secondaire 2":"Universitaire"})]},de))}),Q("seminar_niveau_etudes")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_niveau_etudes")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-2",children:"Domaine(s) d'études / formation"}),a.jsx("div",{className:"space-y-2",children:H4.map(({value:de,label:ge})=>a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",checked:p.seminar_domaines_etude?.includes(de)??!1,onChange:()=>L(de),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:ge})]},de))}),p.seminar_domaines_etude?.includes("autre")&&a.jsx("input",{type:"text",value:p.seminar_domaine_etude_autre,onChange:de=>$("seminar_domaine_etude_autre",de.target.value),placeholder:"Précisez",className:"mt-2 w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600"}),Q("seminar_domaines_etude")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_domaines_etude")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-2",children:"Niveau de français (écrit et parlé)"}),a.jsx("div",{className:"space-y-2",children:["natif","avance","intermediaire","faible"].map(de=>a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_niveau_francais_2",value:de,checked:p.seminar_niveau_francais===de,onChange:()=>$("seminar_niveau_francais",de),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:de==="natif"?"Natif/Native":de==="avance"?"Avancé":de==="intermediaire"?"Intermédiaire":"Faible"})]},de))}),Q("seminar_niveau_francais")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_niveau_francais")})]}),a.jsx("h5",{className:"text-sm font-medium text-ink-700 mt-4 mb-2",children:"Infos complémentaires"}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-2",children:"Besoin d'une lettre pour autorisation d'absence ?"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_besoin_lettre_2",value:"oui",checked:p.seminar_besoin_lettre_absence==="oui",onChange:()=>$("seminar_besoin_lettre_absence","oui"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Oui"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_besoin_lettre_2",value:"non",checked:p.seminar_besoin_lettre_absence==="non",onChange:()=>$("seminar_besoin_lettre_absence","non"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Non"})]})]}),p.seminar_besoin_lettre_absence==="oui"&&a.jsx("input",{type:"text",value:p.seminar_besoin_lettre_details,onChange:de=>$("seminar_besoin_lettre_details",de.target.value),placeholder:"Détails",className:"mt-2 w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600"}),Q("seminar_besoin_lettre_absence")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_besoin_lettre_absence")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Problème de santé / maladie chronique nécessitant attention ?"}),a.jsx("input",{type:"text",value:p.seminar_sante_details,onChange:de=>$("seminar_sante_details",de.target.value),placeholder:"Indiquez « Aucun » si applicable",className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("seminar_sante_details")?"border-red-500":"border-gray-300"}`}),Q("seminar_sante_details")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_sante_details")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-2",children:"Régime sans sel ?"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_regime_2",value:"oui",checked:p.seminar_regime_sans_sel==="oui",onChange:()=>$("seminar_regime_sans_sel","oui"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Oui"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_regime_2",value:"non",checked:p.seminar_regime_sans_sel==="non",onChange:()=>$("seminar_regime_sans_sel","non"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Non"})]})]}),Q("seminar_regime_sans_sel")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_regime_sans_sel")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-2",children:"Confession religieuse :"}),a.jsx("div",{className:"space-y-2",children:K4.map(({value:de,label:ge})=>a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"seminar_confession_2",value:de,checked:p.seminar_confession_religieuse===de,onChange:()=>P(de),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:ge})]},de))}),Q("seminar_confession_religieuse")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_confession_religieuse")}),p.seminar_confession_religieuse==="autre"&&a.jsxs("div",{className:"mt-2",children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Spécifiez :"}),a.jsx("input",{type:"text",value:p.seminar_confession_religieuse_autre,onChange:de=>$("seminar_confession_religieuse_autre",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("seminar_confession_religieuse_autre")?"border-red-500":"border-gray-300"}`}),Q("seminar_confession_religieuse_autre")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_confession_religieuse_autre")})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Quelles sont vos attentes ?"}),a.jsx("textarea",{value:p.seminar_fardeau_transformation,onChange:de=>$("seminar_fardeau_transformation",de.target.value),rows:2,className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("seminar_fardeau_transformation")?"border-red-500":"border-gray-300"}`}),Q("seminar_fardeau_transformation")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_fardeau_transformation")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Qui vous a recommandé ?"}),a.jsx("input",{type:"text",value:p.seminar_recommande_par,onChange:de=>$("seminar_recommande_par",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("seminar_recommande_par")?"border-red-500":"border-gray-300"}`}),Q("seminar_recommande_par")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_recommande_par")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-2",children:"Engagements"}),a.jsx("div",{className:"space-y-2",children:W4.map(({value:de,label:ge})=>a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",checked:p.seminar_engagements?.includes(de)??!1,onChange:()=>E(de),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:ge})]},de))}),p.seminar_engagements?.includes("autre")&&a.jsx("input",{type:"text",value:p.seminar_engagements_autre,onChange:de=>$("seminar_engagements_autre",de.target.value),placeholder:"Précisez",className:"mt-2 w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600"}),Q("seminar_engagements")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("seminar_engagements")})]})]}),p.seminar_intent==="recommend"&&!he&&a.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[a.jsx("h4",{className:"text-lg font-heading font-medium text-ink-900 mb-4 text-center uppercase",children:"INFORMATIONS SUR LA PERSONNE RECOMMANDÉE"}),a.jsxs("div",{className:"mb-4",children:[a.jsx("p",{className:"block text-sm font-medium text-ink-900 mb-2",children:"Avez-vous déjà contacté la personne à propos de cette recommandation? (Il est fortement recommandé de contacter la personne avant que l'invitation officielle de Haggai lui soit envoyée.)"}),a.jsxs("div",{className:"flex flex-wrap gap-4",children:[a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[a.jsx("input",{type:"radio",name:"recommended_contacted_before",value:"oui",checked:p.recommended_contacted_before==="oui",onChange:()=>$("recommended_contacted_before","oui"),className:"w-4 h-4 border-gray-300 text-brand-700 focus:ring-brand-600"}),a.jsx("span",{className:"text-sm text-ink-700",children:"Oui"})]}),a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[a.jsx("input",{type:"radio",name:"recommended_contacted_before",value:"non",checked:p.recommended_contacted_before==="non",onChange:()=>$("recommended_contacted_before","non"),className:"w-4 h-4 border-gray-300 text-brand-700 focus:ring-brand-600"}),a.jsx("span",{className:"text-sm text-ink-700",children:"Non"})]})]}),p.recommended_contacted_before==="non"&&a.jsx("p",{className:"mt-2 text-sm text-red-600 font-medium",children:"Veuillez d'abord contacter la personne que vous voulez recommander pour la prévenir de l'invitation que Haggai va lui envoyer."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Prénom ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_first_name,onChange:de=>$("recommended_first_name",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_first_name")?"border-red-500":"border-gray-300"}`}),Q("recommended_first_name")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_first_name")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Nom ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_last_name,onChange:de=>$("recommended_last_name",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_last_name")?"border-red-500":"border-gray-300"}`}),Q("recommended_last_name")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_last_name")})]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Profession ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_profession,onChange:de=>$("recommended_profession",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_profession")?"border-red-500":"border-gray-300"}`}),Q("recommended_profession")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_profession")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Pays de résidence ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_residence_country,onChange:de=>$("recommended_residence_country",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_residence_country")?"border-red-500":"border-gray-300"}`}),Q("recommended_residence_country")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_residence_country")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Téléphone WhatsApp ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"tel",value:p.recommended_phone_whatsapp,onChange:de=>$("recommended_phone_whatsapp",de.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_phone_whatsapp")?"border-red-500":"border-gray-300"}`}),Q("recommended_phone_whatsapp")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_phone_whatsapp")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-light text-ink-500 mb-1",children:"Email (optionnel)"}),a.jsx("input",{type:"email",value:p.recommended_email,onChange:de=>$("recommended_email",de.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-2",children:["Genre ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"recommended_gender_4",value:"homme",checked:p.recommended_gender==="homme",onChange:()=>$("recommended_gender","homme"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Homme"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"recommended_gender_4",value:"femme",checked:p.recommended_gender==="femme",onChange:()=>$("recommended_gender","femme"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Femme"})]})]}),Q("recommended_gender")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_gender")})]})]}),a.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[p.selectedEvents.includes("seminar")&&a.jsx(X4,{}),a.jsx("h3",{className:"text-xl font-heading font-medium text-ink-900 mb-2 text-center uppercase",children:"MÉTHODE DE PAIEMENT"}),a.jsx("p",{className:"text-sm text-ink-500 mb-6 text-center",children:"Veuillez indiquer votre préférence de mode de paiement et le nombre d'échéances ci-dessous."}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("label",{className:`relative flex flex-col cursor-pointer rounded-xl overflow-hidden border-2 transition-all ${p.payment_method_selected==="mobile_money"?"border-brand-700 shadow-lg bg-brand-50":"border-gray-200 hover:border-brand-700 hover:shadow-md bg-white"}`,children:[a.jsx("input",{type:"radio",name:"payment_method",value:"mobile_money",checked:p.payment_method_selected==="mobile_money",onChange:()=>$("payment_method_selected","mobile_money"),className:"sr-only"}),a.jsxs("div",{className:"p-6 text-center",children:[a.jsx("div",{className:"mb-3 flex justify-center",children:a.jsx("div",{className:"w-12 h-12 rounded-full bg-brand-700/20 flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-brand-700",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"})})})}),a.jsx("h4",{className:"text-base font-heading font-medium text-ink-900 mb-1",children:"Mobile Money"}),p.payment_method_selected==="mobile_money"&&a.jsx("div",{className:"absolute top-2 right-2 bg-brand-700 text-white rounded-full w-6 h-6 flex items-center justify-center",children:a.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:a.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]})]}),a.jsxs("label",{className:`relative flex flex-col cursor-pointer rounded-xl overflow-hidden border-2 transition-all ${p.payment_method_selected==="card_visa"?"border-brand-700 shadow-lg bg-brand-50":"border-gray-200 hover:border-brand-700 hover:shadow-md bg-white"}`,children:[a.jsx("input",{type:"radio",name:"payment_method",value:"card_visa",checked:p.payment_method_selected==="card_visa",onChange:()=>$("payment_method_selected","card_visa"),className:"sr-only"}),a.jsxs("div",{className:"p-6 text-center",children:[a.jsx("div",{className:"mb-3 flex justify-center",children:a.jsx("div",{className:"w-12 h-12 rounded-full bg-brand-700/20 flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-brand-700",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})})})}),a.jsx("h4",{className:"text-base font-heading font-medium text-ink-900 mb-1",children:"Carte de crédit (Visa)"}),p.payment_method_selected==="card_visa"&&a.jsx("div",{className:"absolute top-2 right-2 bg-brand-700 text-white rounded-full w-6 h-6 flex items-center justify-center",children:a.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:a.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]})]}),a.jsxs("label",{className:`relative flex flex-col cursor-pointer rounded-xl overflow-hidden border-2 transition-all ${p.payment_method_selected==="national_office"?"border-brand-700 shadow-lg bg-brand-50":"border-gray-200 hover:border-brand-700 hover:shadow-md bg-white"}`,children:[a.jsx("input",{type:"radio",name:"payment_method",value:"national_office",checked:p.payment_method_selected==="national_office",onChange:()=>$("payment_method_selected","national_office"),className:"sr-only"}),a.jsxs("div",{className:"p-6 text-center",children:[a.jsx("div",{className:"mb-3 flex justify-center",children:a.jsx("div",{className:"w-12 h-12 rounded-full bg-brand-700/20 flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-brand-700",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"})})})}),a.jsx("h4",{className:"text-base font-heading font-medium text-ink-900 mb-1",children:"Bureau national"}),p.payment_method_selected==="national_office"&&a.jsx("div",{className:"absolute top-2 right-2 bg-brand-700 text-white rounded-full w-6 h-6 flex items-center justify-center",children:a.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:a.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]})]})]}),a.jsxs("div",{className:"mt-6 pt-6 border-t border-gray-200",children:[a.jsx("h4",{className:"text-lg font-heading font-medium text-ink-900 mb-4 text-center uppercase",children:"CONFIGURATION DES ÉCHÉANCES"}),a.jsxs("div",{className:"mb-6",children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-2",children:["Nombre d'échéances ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("div",{className:"flex gap-3",children:[1,2,3].map(de=>a.jsxs("button",{type:"button",onClick:()=>W(de),className:`flex-1 py-3 px-4 rounded-xl border-2 transition-all ${p.installment_count===de?"border-brand-700 bg-brand-700 text-white":"border-gray-200 hover:border-brand-700 text-ink-500"}`,children:[de," ",de===1?"échéance":"échéances"]},de))})]}),a.jsx("div",{className:"space-y-4",children:Array.from({length:p.installment_count}).map((de,ge)=>{const ye=p.installment_months[ge]||"",xe=!ye||H([ye]),ce=d[`installment_month_${ge}`],Ce=!!ce||!xe&&!!ye;return a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-2",children:["Échéance ",ge+1," ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsxs("select",{value:ye,onChange:Oe=>K(ge,Oe.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Ce?"border-red-500":"border-gray-300"}`,children:[a.jsx("option",{value:"",children:"Sélectionner un mois"}),F().map(Oe=>a.jsx("option",{value:Oe.value,children:Oe.label},Oe.value))]}),ce&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:ce[0]}),!ce&&!xe&&ye&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:"L'échéance doit être au plus tard 2 mois avant l'événement (septembre 2026 au plus tard)"})]},ge)})}),d.installment_months&&a.jsx("p",{className:"mt-2 text-sm text-red-600",children:d.installment_months[0]})]})]}),a.jsxs("div",{className:"flex space-x-4 pt-4",children:[a.jsx(De,{type:"button",variant:"secondary",onClick:X,className:"flex-1",children:"Retour"}),he?a.jsx(De,{type:"button",onClick:te,className:"flex-1",children:"Valider et passer au suivant"}):a.jsx(De,{type:"submit",disabled:c,className:"flex-1",children:c?"Envoi en cours...":"Envoyer"})]})]})})}if(o===4){const re=p.selectedEvents.includes("summit"),ue=p.selectedEvents.includes("seminar"),ae=p.selectedEvents.includes("recommend");return re&&ue&&ae?a.jsx("form",{onSubmit:fe=>{fe.preventDefault(),se()},className:"space-y-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-xl font-heading font-medium text-ink-900 mb-4",children:"Recommander quelqu'un au Séminaire"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Prénom ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_first_name,onChange:fe=>$("recommended_first_name",fe.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_first_name")?"border-red-500":"border-gray-300"}`}),Q("recommended_first_name")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_first_name")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Nom ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_last_name,onChange:fe=>$("recommended_last_name",fe.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_last_name")?"border-red-500":"border-gray-300"}`}),Q("recommended_last_name")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_last_name")})]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Profession ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_profession,onChange:fe=>$("recommended_profession",fe.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_profession")?"border-red-500":"border-gray-300"}`}),Q("recommended_profession")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_profession")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Pays de résidence ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:p.recommended_residence_country,onChange:fe=>$("recommended_residence_country",fe.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_residence_country")?"border-red-500":"border-gray-300"}`}),Q("recommended_residence_country")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_residence_country")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Téléphone WhatsApp ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"tel",value:p.recommended_phone_whatsapp,onChange:fe=>$("recommended_phone_whatsapp",fe.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_phone_whatsapp")?"border-red-500":"border-gray-300"}`}),Q("recommended_phone_whatsapp")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_phone_whatsapp")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-1",children:["Email ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"email",value:p.recommended_email,onChange:fe=>$("recommended_email",fe.target.value),className:`w-full px-4 py-2 border rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600 ${Q("recommended_email")?"border-red-500":"border-gray-300"}`}),Q("recommended_email")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_email")})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-light text-ink-500 mb-2",children:["Genre ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"recommended_gender",value:"homme",checked:p.recommended_gender==="homme",onChange:()=>$("recommended_gender","homme"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Homme"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"radio",name:"recommended_gender",value:"femme",checked:p.recommended_gender==="femme",onChange:()=>$("recommended_gender","femme"),className:"mr-2"}),a.jsx("span",{className:"text-sm font-light text-ink-500",children:"Femme"})]})]}),Q("recommended_gender")&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:Q("recommended_gender")})]}),a.jsxs("div",{className:"flex space-x-4 pt-4",children:[a.jsx(De,{type:"button",variant:"secondary",onClick:()=>u(3),className:"flex-1",children:"Retour"}),a.jsx(De,{type:"submit",disabled:c,className:"flex-1",children:c?"Envoi en cours...":"Envoyer"})]})]})}):null}return null}const ao="communication@sommetfrancophone.org",Ph="+225 05 5427 5725 (WhatsApp)";function sB(e,r){return e===1?"PREINSCRIPTIONS & RECOMMANDATIONS":r.length===1&&r[0]==="summit"?"PREINSCRIPTION AU SOMMET":r.length===1&&r[0]==="seminar"?"PREINSCRIPTION AU SEMINAIRE":r.length===1&&r[0]==="recommend"?"RECOMMANDATION AU SEMINAIRE":"PREINSCRIPTIONS & RECOMMANDATIONS"}function aB(e){return e===1?"Sélectionner une option ci-dessous. Vous pourrez revenir pour un autre choix.":"Complétez le formulaire ci-dessous."}function oB(){const[e]=kp(),r=e.get("preselect"),t=r==="summit"?["summit"]:r==="seminar"?["seminar"]:r==="recommend"?["recommend"]:void 0,[n,l]=R.useState("form"),[i,o]=R.useState({}),[u,c]=R.useState(!1),[s,d]=R.useState(null),[f,h]=R.useState({step:1,selectedEvents:[]}),m=v=>{v.type==="recommendation"?o({recommendationId:v.id,type:"recommendation"}):o({registrationId:v.id,type:"registration"}),l("success")},p=v=>{o(_=>_.registrationId||_.recommendationId||n==="success"?{..._,existingRegistrationId:v,hasConflict:!0}:(l("conflict"),{existingRegistrationId:v}))},x=v=>{o({errorMessage:v}),v.includes("indisponibles")?l("unavailable"):l("error")},g=()=>{l("form"),o({}),d(null)};R.useEffect(()=>{n!=="form"&&window.scrollTo({top:0,behavior:"smooth"})},[n]);const y=async()=>{if(i.existingRegistrationId){c(!0),d(null);try{await z1.resendVerification(i.existingRegistrationId),d("Email de vérification renvoyé avec succès. Vérifiez votre boîte de réception.")}catch(v){v instanceof Vt?v.status===422?d(v.data.errors?.registration?.[0]||v.message):d(v.message||"Erreur lors du renvoi de l'email."):d("Une erreur est survenue lors du renvoi de l'email.")}finally{c(!1)}}};return n==="success"?a.jsx(ul,{children:a.jsx("div",{className:"min-h-screen bg-brand-50 py-20",children:a.jsx("div",{className:"max-w-2xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"bg-white rounded-xl shadow-soft p-8 text-center",children:[a.jsx("div",{className:"flex justify-center mb-6",children:a.jsx(AL,{className:"w-16 h-16 text-green-600"})}),a.jsx("h1",{className:"text-3xl font-heading font-medium text-ink-900 mb-4",children:i.type==="recommendation"?"Recommandation reçue":"Inscription reçue"}),a.jsx("p",{className:"text-ink-500 font-light mb-6",children:i.type==="recommendation"?"Votre recommandation a été enregistrée avec succès.":"Votre inscription a été enregistrée avec succès."}),i.type==="registration"&&a.jsx("p",{className:"text-ink-500 font-light mb-8",children:"Veuillez vérifier votre email pour confirmer votre inscription. Un email de vérification vous a été envoyé."}),i.type==="recommendation"&&a.jsx("p",{className:"text-ink-500 font-light mb-8",children:"Merci pour votre recommandation. L'équipe examinera la candidature et contactera la personne recommandée si nécessaire."}),i.registrationId&&a.jsxs("p",{className:"text-sm text-ink-500 mb-8",children:["Numéro d'inscription : ",a.jsxs("strong",{children:["#",i.registrationId]})]}),i.recommendationId&&a.jsxs("p",{className:"text-sm text-ink-500 mb-8",children:["Numéro de recommandation : ",a.jsxs("strong",{children:["#",i.recommendationId]})]}),i.hasConflict&&i.existingRegistrationId&&a.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4 mb-8",children:a.jsxs("p",{className:"text-sm text-yellow-800",children:[a.jsx("strong",{children:"Note :"})," Une inscription existe déjà pour un autre événement (numéro #",i.existingRegistrationId,")."]})}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(De,{onClick:g,variant:"secondary",children:"Nouvelle inscription"}),a.jsxs("div",{className:"space-y-2 text-sm text-ink-500",children:[a.jsx("p",{className:"font-light",children:"Pour toute question :"}),a.jsxs("div",{className:"flex items-center justify-center gap-4 flex-wrap",children:[a.jsxs("a",{href:`mailto:${ao}`,className:"hover:text-brand-9002 inline-flex items-center gap-1",children:[a.jsx(mo,{className:"w-4 h-4"}),ao]}),a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsx(od,{className:"w-4 h-4"}),Ph]})]})]}),a.jsx("div",{children:a.jsx("a",{href:"/",className:"text-brand-9002 hover:text-brand-900 font-light text-sm",children:"Retour à l'accueil"})})]})]})})})}):n==="conflict"?a.jsx(ul,{children:a.jsx("div",{className:"min-h-screen bg-brand-50 py-20",children:a.jsx("div",{className:"max-w-2xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"bg-white rounded-xl shadow-soft p-8 text-center",children:[a.jsx("div",{className:"flex justify-center mb-6",children:a.jsx(Vy,{className:"w-16 h-16 text-yellow-600"})}),a.jsx("h1",{className:"text-3xl font-heading font-medium text-ink-900 mb-4",children:"Inscription déjà existante"}),a.jsx("p",{className:"text-ink-500 font-light mb-6",children:"Un utilisateur existe déjà avec le même email ou le même numéro de téléphone pour cet événement."}),i.existingRegistrationId&&a.jsxs("p",{className:"text-sm text-ink-500 mb-8",children:["Numéro d'inscription existante : ",a.jsxs("strong",{children:["#",i.existingRegistrationId]})]}),a.jsx("div",{className:"space-y-4 mb-8",children:a.jsx("p",{className:"text-ink-500 font-light",children:"Si vous avez des questions ou souhaitez modifier votre inscription, veuillez contacter l'équipe."})}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(De,{onClick:y,variant:"secondary",disabled:u,children:u?"Envoi en cours...":"Renvoyer l'email de vérification"}),s&&a.jsx("p",{className:`text-sm ${s.includes("succès")?"text-green-600":"text-red-600"}`,children:s}),a.jsxs("div",{className:"space-y-2 text-sm text-ink-500",children:[a.jsx("p",{className:"font-light",children:"Ou contactez-nous :"}),a.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[a.jsx(mo,{className:"w-4 h-4"}),a.jsx("a",{href:`mailto:${ao}`,className:"hover:text-brand-9002",children:ao})]}),a.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[a.jsx(od,{className:"w-4 h-4"}),a.jsx("span",{children:Ph})]})]}),a.jsx(De,{onClick:g,variant:"outline",children:"Nouvelle inscription"}),a.jsx("div",{children:a.jsx("a",{href:"/",className:"text-brand-9002 hover:text-brand-900 font-light text-sm",children:"Retour à l'accueil"})})]})]})})})}):n==="error"?a.jsx(ul,{children:a.jsx("div",{className:"min-h-screen bg-brand-50 py-20",children:a.jsx("div",{className:"max-w-2xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"bg-white rounded-xl shadow-soft p-8 text-center",children:[a.jsx("div",{className:"flex justify-center mb-6",children:a.jsx(PL,{className:"w-16 h-16 text-red-600"})}),a.jsx("h1",{className:"text-3xl font-heading font-medium text-ink-900 mb-4",children:"Erreur"}),a.jsx("p",{className:"text-ink-500 font-light mb-8",children:i.errorMessage||"Une erreur est survenue lors de l'inscription."}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(De,{onClick:g,children:"Réessayer"}),a.jsxs("div",{className:"space-y-2 text-sm text-ink-500",children:[a.jsx("p",{className:"font-light",children:"Ou contactez-nous :"}),a.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[a.jsx(mo,{className:"w-4 h-4"}),a.jsx("a",{href:`mailto:${ao}`,className:"hover:text-brand-9002",children:ao})]}),a.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[a.jsx(od,{className:"w-4 h-4"}),a.jsx("span",{children:Ph})]})]}),a.jsx("div",{children:a.jsx("a",{href:"/",className:"text-brand-9002 hover:text-brand-900 font-light text-sm",children:"Retour à l'accueil"})})]})]})})})}):n==="unavailable"?a.jsx(ul,{children:a.jsx("div",{className:"min-h-screen bg-brand-50 py-20",children:a.jsx("div",{className:"max-w-2xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"bg-white rounded-xl shadow-soft p-8 text-center",children:[a.jsx("div",{className:"flex justify-center mb-6",children:a.jsx(Vy,{className:"w-16 h-16 text-yellow-600"})}),a.jsx("h1",{className:"text-3xl font-heading font-medium text-ink-900 mb-4",children:"Inscriptions publiques indisponibles"}),a.jsx("p",{className:"text-ink-500 font-light mb-8",children:"Les inscriptions publiques ne sont pas disponibles pour le moment. Veuillez réessayer plus tard ou contacter l'équipe pour plus d'informations."}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"text-sm text-ink-500",children:[a.jsxs("div",{className:"flex items-center justify-center space-x-2 mb-2",children:[a.jsx(mo,{className:"w-4 h-4"}),a.jsx("a",{href:`mailto:${ao}`,className:"hover:text-brand-9002",children:ao})]}),a.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[a.jsx(od,{className:"w-4 h-4"}),a.jsx("span",{children:Ph})]})]}),a.jsx("div",{children:a.jsx("a",{href:"/",className:"text-brand-9002 hover:text-brand-900 font-light text-sm",children:"Retour à l'accueil"})})]})]})})})}):a.jsx(ul,{children:a.jsx("div",{className:"min-h-screen bg-brand-50 py-20",children:a.jsxs("div",{className:"w-full mx-auto",children:[a.jsxs("div",{className:"text-center mb-12 px-4 sm:px-6 lg:px-8",children:[a.jsx("h1",{className:"text-4xl font-heading font-medium text-ink-900 mb-4 uppercase",children:sB(f.step,f.selectedEvents)}),a.jsx("p",{className:"text-ink-500 font-light text-lg",children:aB(f.step)})]}),a.jsx("div",{className:"bg-white rounded-xl shadow-soft p-4 sm:p-6 md:p-8 mx-4 sm:mx-6 md:mx-[20%]",children:a.jsx(iB,{preselectedEvents:t,onSuccess:m,onConflict:p,onError:x,onFormLayoutChange:h})})]})})})}function ti({children:e,className:r=""}){return a.jsx("div",{className:`bg-surface-0 rounded-xl2 shadow-soft p-6 ${r}`,children:e})}function lB(){const e=_s(),{isAuthenticated:r,canAccessAdmin:t,loading:n,refetch:l,roles:i}=qs(),[o,u]=R.useState(""),[c,s]=R.useState(""),[d,f]=R.useState(!1),[h,m]=R.useState(null);if(n)return a.jsx("div",{className:"min-h-screen bg-brand-50 flex items-center justify-center",children:a.jsx("div",{className:"text-ink-500",children:"Chargement..."})});if(r){const g=t&&!i.includes("SUPER_ADMIN")&&!i.includes("COMMISSION_ADMINISTRATION")&&!i.includes("COMMISSION_ADMINISTRATION_SOMMET")&&(i.includes("COMMISSION_FINANCE")||i.includes("COMMISSION_FINANCE_SEMINAIRE")||i.includes("COMMISSION_FINANCE_SOMMET"))?"/admin/finance":"/admin/registrations";return a.jsx(mi,{to:t?g:"/account",replace:!0})}const p=async x=>{x.preventDefault(),f(!0),m(null);try{const g=await Vi.login({email:o.trim(),password:c});if(!g||!g.token){m("Réponse invalide du serveur.");return}let y=g.user??null;if(y||(y=await l()),!y){m("Connexion réussie mais impossible de charger le profil. Réessayez ou rechargez la page.");return}const v=["SUPER_ADMIN","COMMISSION_ADMINISTRATION","COMMISSION_ADMINISTRATION_SEMINAIRE","COMMISSION_ADMINISTRATION_SOMMET","COMMISSION_FINANCE","COMMISSION_FINANCE_SOMMET","COMMISSION_FINANCE_SEMINAIRE","COMMISSION_COMMUNICATION","COMMISSION_SEMINAIRE_REGIONAL"],_=(y.roles??[]).map(U=>typeof U=="string"?U:U.name).filter(U=>typeof U=="string"),C=_.some(U=>v.includes(U)),T=!_.includes("SUPER_ADMIN")&&(_.includes("COMMISSION_FINANCE")||_.includes("COMMISSION_FINANCE_SEMINAIRE")||_.includes("COMMISSION_FINANCE_SOMMET"))?"/admin/finance":"/admin/registrations";e(C?T:"/account",{replace:!0})}catch(g){if(console.error("Erreur de connexion complète:",g),g instanceof Vt)if(console.error("Détails de l'erreur API:",{status:g.status,data:g.data,message:g.message}),g.status===422&&g.data.errors){const y=Object.values(g.data.errors).flat();m(y.join(". ")||"Erreur de validation.")}else g.status===401||g.status===422?g.data.errors&&g.data.errors.email?m(g.data.errors.email[0]||"Email ou mot de passe incorrect."):m(g.data.message||"Email ou mot de passe incorrect."):g.status===403?m("Votre compte n'a pas les permissions nécessaires."):g.status===0?m("Impossible de joindre l’API (réseau ou serveur arrêté). Vérifiez que Laravel tourne et, si besoin, `VITE_API_PROXY_TARGET` dans `.env.development`."):m(g.data?.message||"Une erreur est survenue lors de la connexion.");else m("Une erreur inattendue est survenue.")}finally{f(!1)}};return a.jsx("div",{className:"min-h-screen bg-brand-50 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"max-w-md w-full",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("h1",{className:"text-3xl font-bold text-ink-900 mb-2",children:"Connexion"}),a.jsx("p",{className:"text-ink-500",children:"Connectez-vous à votre espace"})]}),a.jsx(ti,{children:a.jsxs("form",{onSubmit:p,className:"space-y-6",children:[h&&a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:a.jsx("p",{className:"text-sm text-red-700",children:h})}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-ink-500 mb-2",children:"Email"}),a.jsx("input",{id:"email",type:"email",value:o,onChange:x=>u(x.target.value),required:!0,autoComplete:"email",className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent transition-all",placeholder:"votre-email@example.com"})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-ink-500 mb-2",children:"Mot de passe"}),a.jsx("input",{id:"password",type:"password",value:c,onChange:x=>s(x.target.value),required:!0,autoComplete:"current-password",className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent transition-all",placeholder:"••••••••"})]}),a.jsx(De,{type:"submit",variant:"primary",className:"w-full",disabled:d,children:d?"Connexion...":"Se connecter"})]})}),a.jsx("div",{className:"mt-6 text-center",children:a.jsx("a",{href:"/",className:"text-sm text-brand-700 hover:text-brand-900 hover:underline",children:"← Retour à l'accueil"})})]})})}function cB(){const[e]=kp(),r=_s(),t=e.get("token")??"",[n,l]=R.useState(t?"initial":"error"),[i,o]=R.useState(!!t),[u,c]=R.useState(!1),[s,d]=R.useState(""),[f,h]=R.useState(""),[m,p]=R.useState(!1),[x,g]=R.useState(""),[y,v]=R.useState({});R.useEffect(()=>{if(!t){g("Lien d'activation invalide ou manquant.");return}let M=!1;return Vi.checkActivation(t).then(T=>{M||(c(T.already_active),o(!1))}).catch(T=>{M||(o(!1),l("error"),g(T instanceof Vt?T.data?.errors?.token?.[0]??T.data?.message??"Le lien d'activation est invalide ou a expiré.":"Une erreur est survenue."))}),()=>{M=!0}},[t]);const _=async M=>{if(M.preventDefault(),!!t){v({}),p(!0),g("");try{const T={token:t.trim()};u||(T.password=s,T.password_confirmation=f);const U=await Vi.activate(T);l("success");const F=u?"Inscription confirmée.":"Votre compte est activé. Vous pouvez maintenant accéder à votre espace.";g(U?.message??F)}catch(T){if(l("error"),T instanceof Vt)if(T.status===422&&T.data.errors){const U={};Object.entries(T.data.errors).forEach(([F,H])=>{Array.isArray(H)&&H[0]&&(U[F]=H[0])}),v(U),g(T.data.errors?.token?.[0]??T.data.errors?.password?.[0]??"Vérifiez votre mot de passe (8 caractères minimum) et la confirmation.")}else g(T.data?.message??"Le lien d'activation est invalide ou a expiré. Utilisez le lien le plus récent reçu par email.");else g("Une erreur est survenue. Veuillez réessayer plus tard.")}finally{p(!1)}}},C=()=>{_({preventDefault:()=>{}})};return a.jsx("div",{className:"min-h-screen bg-brand-50 flex items-center justify-center py-12 px-4",children:a.jsxs("div",{className:"max-w-md w-full",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("h1",{className:"text-3xl font-bold text-ink-900 mb-2",children:"Activation de compte"}),a.jsx("p",{className:"text-ink-500",children:u?"Confirmez cette inscription pour votre espace participant":"Définissez votre mot de passe pour accéder à votre espace participant"})]}),a.jsxs(ti,{children:[n==="error"&&!t&&a.jsxs("div",{className:"mb-6",children:[a.jsx("p",{className:"text-red-600",children:x}),a.jsx(De,{variant:"primary",className:"mt-4",onClick:()=>r("/"),children:"Retour à l'accueil"})]}),i&&a.jsx("div",{className:"py-8 text-center text-ink-500",children:"Vérification du lien en cours..."}),!i&&u&&(n==="initial"||n==="error")&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("p",{className:"text-ink-700",children:"Vous avez déjà un compte actif (par exemple suite à une inscription au Sommet). Cliquez ci-dessous pour confirmer cette nouvelle inscription sans modifier votre mot de passe."}),x&&a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:a.jsx("p",{className:"text-sm text-red-700",children:x})}),a.jsx(De,{variant:"primary",className:"w-full",onClick:C,disabled:m,children:m?"Confirmation en cours...":"Confirmer cette inscription"})]}),!i&&!u&&(n==="initial"||n==="loading"||n==="error"&&t)&&a.jsxs("form",{onSubmit:_,className:"space-y-6",children:[x&&a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:a.jsx("p",{className:"text-sm text-red-700",children:x})}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-ink-700 mb-2",children:"Mot de passe"}),a.jsx("input",{id:"password",type:"password",value:s,onChange:M=>d(M.target.value),required:!0,minLength:8,autoComplete:"new-password",className:`w-full px-4 py-3 border rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent ${y.password?"border-red-500":"border-gray-300"}`,placeholder:"••••••••"}),y.password&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:y.password})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"password_confirmation",className:"block text-sm font-medium text-ink-700 mb-2",children:"Confirmer le mot de passe"}),a.jsx("input",{id:"password_confirmation",type:"password",value:f,onChange:M=>h(M.target.value),required:!0,minLength:8,autoComplete:"new-password",className:`w-full px-4 py-3 border rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent ${y.password_confirmation?"border-red-500":"border-gray-300"}`,placeholder:"••••••••"}),y.password_confirmation&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:y.password_confirmation})]}),a.jsx(De,{type:"submit",variant:"primary",className:"w-full",disabled:m,children:m?"Activation en cours...":"Activer mon compte"})]}),n==="success"&&a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-green-100 mb-6",children:a.jsx("svg",{className:"w-8 h-8 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),a.jsx("h2",{className:"text-xl font-semibold text-ink-900 mb-2",children:"Compte activé"}),a.jsx("p",{className:"text-ink-500 mb-6",children:x}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(De,{variant:"primary",className:"w-full",onClick:()=>r("/account"),children:"Aller à mon espace"}),a.jsx(De,{variant:"outline",className:"w-full",onClick:()=>r("/"),children:"Retour à l'accueil"})]})]})]}),a.jsx("div",{className:"mt-6 text-center",children:a.jsx("a",{href:"/",className:"text-sm text-brand-700 hover:text-brand-900 hover:underline",children:"← Retour à l'accueil"})})]})})}const ki={CI:{label:"Côte d'Ivoire",phonePlaceholder:"0709000001",operators:[{apiValue:"Orange",label:"Orange"}]},BF:{label:"Burkina Faso",phonePlaceholder:"22670123456",operators:[{apiValue:"Moov",label:"Moov"}]}},Op=Object.keys(ki);function Pc(e){if(e==null)return"BF";const r=e.trim();if(r.length===0)return"BF";const t=r.toUpperCase();return t.includes("COTE")||t.includes("IVOIRE")?"CI":t.includes("BURKINA")||t.includes("FASO")?"BF":/^[A-Z]{2}$/.test(t)?t==="BU"?"BF":Op.includes(t)?t:"BF":"BF"}function Pp(e,r){const t=e.replace(/\D/g,"");if(r==="CI"){let n=t;return n.length>=12&&n.startsWith("225")&&(n=n.slice(3)),n.length===9&&!n.startsWith("0")&&(n=`0${n}`),n}return t}function kd(e,r){const t=Pp(e,r);return r==="CI"?/^[0-9]{10}$/.test(t):t.length>=8&&t.length<=16&&/^[0-9]+$/.test(t)}function uB({open:e,registrationId:r,installmentIndex:t,defaultCountry:n="CI",onClose:l,onInitiated:i}){const[o,u]=R.useState(()=>Pc(n)),[c,s]=R.useState(""),[d,f]=R.useState(""),[h,m]=R.useState(!1),[p,x]=R.useState(null),[g,y]=R.useState(!1),v=ki[o]??ki.CI;R.useEffect(()=>{e&&(u(Pc(n)),s(""),f(""),x(null),y(!1))},[e,n]),R.useEffect(()=>{s(U=>{const F=ki[o];return F&&F.operators.some(H=>H.apiValue===U)?U:""})},[o]);const _=R.useMemo(()=>c?d.replace(/\s/g,"")?kd(d,o)?null:o==="CI"?"Numéro invalide : 10 chiffres pour la CI (ex. 07… ou +225 07…).":"Numéro de téléphone invalide (8 à 16 chiffres).":"Indiquez votre numéro Mobile Money.":"Choisissez un opérateur Mobile Money.",[c,d,o]),C=_===null&&!h;if(!e)return null;const M=()=>{if(y(!0),x(null),_){x(_);return}m(!0);const U={operator:c,phone:Pp(d,o),country:o,idempotency_key:typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():void 0};t!==null&&(U.installment_index=t),BF(r,U).then(F=>{i(F),l()}).catch(F=>{F instanceof Vt?x(F.data?.message??F.message):x("Une erreur est survenue.")}).finally(()=>m(!1))},T=g||p!==null;return a.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:a.jsxs("div",{className:"flex min-h-screen items-center justify-center px-4 pt-4 pb-20 text-center sm:block sm:p-0",children:[a.jsx("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",onClick:()=>!h&&l(),"aria-hidden":!0}),a.jsxs("div",{className:"inline-block max-h-[90vh] overflow-y-auto w-full max-w-md transform rounded-lg bg-white p-6 text-left align-middle shadow-xl transition-all sm:my-8",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg font-semibold text-ink-900",children:"Paiement Mobile Money (SycaPay)"}),a.jsx("button",{type:"button",onClick:()=>!h&&l(),className:"text-gray-400 hover:text-gray-600 p-1","aria-label":"Fermer",children:a.jsx(mr,{size:22})})]}),a.jsx("p",{className:"text-sm text-ink-600 mb-4",children:"Après validation, vous serez redirigé vers la page sécurisée du prestataire si nécessaire. Le statut réel du paiement sera mis à jour sur cette page après votre retour."}),p&&a.jsx("div",{className:"mb-4 rounded-lg border border-red-200 bg-red-50 p-3",children:a.jsx("p",{className:"text-sm text-red-700",children:p})}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-ink-700",htmlFor:"sycapay-country",children:"Pays"}),a.jsx("select",{id:"sycapay-country",value:o,onChange:U=>u(U.target.value),className:"w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm focus:ring-2 focus:ring-brand-700",disabled:h,children:Op.map(U=>a.jsxs("option",{value:U,children:[ki[U].label," (",U,")"]},U))})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"mb-1 block text-sm font-medium text-ink-700",htmlFor:"sycapay-operator",children:["Opérateur ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsxs("select",{id:"sycapay-operator",value:c,onChange:U=>s(U.target.value),className:"w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm focus:ring-2 focus:ring-brand-700",disabled:h,children:[a.jsx("option",{value:"",children:"— Choisir —"}),v.operators.map(U=>a.jsx("option",{value:U.apiValue,children:U.label},U.apiValue))]}),T&&!c&&a.jsx("p",{className:"mt-1 text-xs text-red-600",children:"Veuillez sélectionner un opérateur."})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"mb-1 block text-sm font-medium text-ink-700",htmlFor:"sycapay-phone",children:["Numéro Mobile Money ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{id:"sycapay-phone",type:"tel",value:d,onChange:U=>f(U.target.value),className:"w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:ring-2 focus:ring-brand-700",disabled:h,placeholder:`Ex. ${v.phonePlaceholder}`,autoComplete:"tel"}),T&&d.replace(/\s/g,"").length>0&&!kd(d,o)&&a.jsx("p",{className:"mt-1 text-xs text-red-600",children:"Format invalide : utilisez des chiffres (éventuellement + en tête)."})]})]}),a.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[a.jsx(De,{variant:"ghost",onClick:l,disabled:h,children:"Annuler"}),a.jsx(De,{variant:"primary",onClick:M,disabled:!C,children:h?"Préparation…":"Continuer vers le paiement"})]})]})]})})}const dB=["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"];function fB(e){const[r,t]=e.split("-").map(Number);if(Number.isNaN(r)||Number.isNaN(t))return e;const l=new Date(r,t,0).getDate(),i=dB[t-1]??String(t);return`${l} ${i} ${r}`}function hB(e,r){const t=e?.[r];return t?.month?`Échéance — date limite le ${fB(t.month)}`:r===0?"Solde unique":`Échéance ${r+1}`}function mB({open:e,registrationId:r,defaultCountry:t="CI",remainingDue:n,currencyLabel:l,installments:i,onClose:o,onInitSuccess:u}){const[c,s]=R.useState(()=>Pc(t)),[d,f]=R.useState(""),[h,m]=R.useState(""),[p,x]=R.useState(""),[g,y]=R.useState(!1),[v,_]=R.useState(null),[C,M]=R.useState(!1),[T,U]=R.useState("form"),[F,H]=R.useState(null),W=ki[c]??ki.CI;R.useEffect(()=>{e&&(s(Pc(t)),f(""),m(""),x(""),_(null),M(!1),U("form"),H(null))},[e,t]),R.useEffect(()=>{f(S=>{const N=ki[c];return N&&N.operators.some(O=>O.apiValue===S)?S:""})},[c]);const K=R.useMemo(()=>{const S=parseInt(p.replace(/\s/g,""),10);return Number.isFinite(S)?S:NaN},[p]),$=R.useMemo(()=>d?h.replace(/\s/g,"")?kd(h,c)?!Number.isFinite(K)||K<=0?"Indiquez un montant strictement positif.":K>n?`Le montant ne peut pas dépasser le solde restant (${n.toLocaleString("fr-FR")} ${l}).`:null:c==="CI"?"Numéro invalide : 10 chiffres pour la CI (ex. 07… ou +225 07…).":"Numéro de téléphone invalide (8 à 16 chiffres).":"Indiquez votre numéro Mobile Money.":"Choisissez un opérateur Mobile Money.",[d,h,c,K,n,l]),P=$===null&&!g&&T==="form";if(!e)return null;const L=()=>{if(M(!0),_(null),$){_($);return}y(!0);const S={amount:K,operator:d,phone:Pp(h,c),country:c,idempotency_key:typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():void 0};zF(r,S).then(N=>{const O=N.data;if(O.status==="failed"||O.error){_(dC(O,N.message));return}H(N),U("afterInit"),u()}).catch(N=>{N instanceof Vt?_($F(N)):_("Une erreur est survenue.")}).finally(()=>y(!1))},E=()=>{const S=F?.data.redirect_url;if(S){window.location.assign(S);return}o()},j=C||v!==null,k=F?.data.allocation_preview;return a.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:a.jsxs("div",{className:"flex min-h-screen items-center justify-center px-4 pt-4 pb-20 text-center sm:block sm:p-0",children:[a.jsx("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",onClick:()=>!g&&T==="form"&&o(),"aria-hidden":!0}),a.jsxs("div",{className:"inline-block max-h-[90vh] overflow-y-auto w-full max-w-md transform rounded-lg bg-white p-6 text-left align-middle shadow-xl transition-all sm:my-8",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg font-semibold text-ink-900",children:"Payer un montant libre"}),a.jsx("button",{type:"button",onClick:()=>!g&&o(),className:"text-gray-400 hover:text-gray-600 p-1","aria-label":"Fermer",children:a.jsx(mr,{size:22})})]}),T==="form"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"rounded-lg border border-amber-100 bg-amber-50/80 px-3 py-2.5 mb-4 space-y-2 text-sm text-ink-700",children:[a.jsxs("p",{children:["Le montant sera ",a.jsx("strong",{children:"automatiquement imputé"})," à vos échéances encore dues, de la"," ",a.jsx("strong",{children:"plus ancienne à la plus récente"}),"."]}),a.jsxs("p",{className:"text-ink-600",children:["Il ne peut pas dépasser votre solde restant (",n.toLocaleString("fr-FR")," ",l,"). Le montant définitif est validé par le serveur."]})]}),v&&a.jsx("div",{className:"mb-4 rounded-lg border border-red-200 bg-red-50 p-3",children:a.jsx("p",{className:"text-sm text-red-700",children:v})}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"mb-1 block text-sm font-medium text-ink-700",htmlFor:"open-amt-amount",children:["Montant ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{id:"open-amt-amount",type:"text",inputMode:"numeric",value:p,onChange:S=>x(S.target.value.replace(/[^\d\s]/g,"")),className:"w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:ring-2 focus:ring-brand-700",disabled:g,placeholder:`Max. ${n.toLocaleString("fr-FR")}`,autoComplete:"off"}),j&&Number.isFinite(K)&&K>n&&a.jsx("p",{className:"mt-1 text-xs text-red-600",children:"Montant supérieur au solde restant."})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-ink-700",htmlFor:"open-amt-country",children:"Pays"}),a.jsx("select",{id:"open-amt-country",value:c,onChange:S=>s(S.target.value),className:"w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm focus:ring-2 focus:ring-brand-700",disabled:g,children:Op.map(S=>a.jsxs("option",{value:S,children:[ki[S].label," (",S,")"]},S))})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"mb-1 block text-sm font-medium text-ink-700",htmlFor:"open-amt-operator",children:["Opérateur ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsxs("select",{id:"open-amt-operator",value:d,onChange:S=>f(S.target.value),className:"w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm focus:ring-2 focus:ring-brand-700",disabled:g,children:[a.jsx("option",{value:"",children:"— Choisir —"}),W.operators.map(S=>a.jsx("option",{value:S.apiValue,children:S.label},S.apiValue))]}),j&&!d&&a.jsx("p",{className:"mt-1 text-xs text-red-600",children:"Veuillez sélectionner un opérateur."})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"mb-1 block text-sm font-medium text-ink-700",htmlFor:"open-amt-phone",children:["Numéro Mobile Money ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{id:"open-amt-phone",type:"tel",value:h,onChange:S=>m(S.target.value),className:"w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:ring-2 focus:ring-brand-700",disabled:g,placeholder:`Ex. ${W.phonePlaceholder}`,autoComplete:"tel"}),j&&h.replace(/\s/g,"").length>0&&!kd(h,c)&&a.jsx("p",{className:"mt-1 text-xs text-red-600",children:"Format invalide : utilisez des chiffres (éventuellement + en tête)."})]})]}),a.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[a.jsx(De,{variant:"ghost",onClick:o,disabled:g,children:"Annuler"}),a.jsx(De,{variant:"primary",onClick:L,disabled:!P,children:g?"Préparation…":"Valider et continuer"})]})]}),T==="afterInit"&&F&&a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"text-sm text-ink-700 mb-3",children:["La demande de paiement est enregistrée. Le paiement n’est ",a.jsx("strong",{children:"pas encore confirmé"})," tant que le prestataire n’a pas validé l’opération."]}),a.jsxs("div",{className:"rounded-lg border border-sky-200 bg-sky-50/60 px-3 py-2.5 mb-4",children:[a.jsxs("p",{className:"text-sm font-medium text-ink-800",children:["Montant retenu : ",F.data.amount?.toLocaleString("fr-FR")," ",l]}),a.jsx("p",{className:"text-xs text-ink-600 mt-1",children:"Type : paiement libre"})]}),k&&k.length>0&&a.jsxs("div",{className:"mb-4",children:[a.jsx("p",{className:"text-sm font-medium text-ink-800 mb-2",children:"Répartition prévue (indicatif)"}),a.jsx("ul",{className:"text-sm text-ink-700 space-y-1 border border-gray-100 rounded-lg p-3 bg-gray-50/80",children:k.map((S,N)=>a.jsxs("li",{className:"flex justify-between gap-2",children:[a.jsx("span",{children:hB(i??null,S.installment_index)}),a.jsxs("span",{className:"font-medium tabular-nums",children:[S.amount.toLocaleString("fr-FR")," ",l]})]},`${S.installment_index}-${N}`))}),a.jsx("p",{className:"text-xs text-ink-500 mt-2",children:"La répartition définitive sera enregistrée après confirmation du paiement."})]}),a.jsx("p",{className:"text-xs text-ink-500 mb-4",children:"Après validation chez le prestataire, le statut se mettra à jour sur cette page (actualisez si besoin)."}),a.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[a.jsx(De,{variant:"ghost",onClick:o,children:"Fermer"}),F.data.redirect_url?a.jsx(De,{variant:"primary",onClick:E,children:"Continuer vers le paiement"}):null]})]})]})]})})}const pB={not_sycapay:"Actualisation automatique disponible uniquement pour les paiements en ligne.",terminal:"Ce paiement est déjà terminé.",missing_provider_ref:"Référence de paiement incomplète. Contactez le support si le problème persiste.",invalid_status:"Statut incompatible avec une actualisation en ligne.",payment_too_recent:"Le serveur attend encore quelques secondes après l’init avant la première interrogation du prestataire.",sync_too_recent:"Une vérification vient d’être faite ; courte pause avant la prochaine interrogation."},Th=52e3,G4=14;function Mx({registrationId:e,paymentId:r,summaryHint:t,onUpdated:n}){const[l,i]=R.useState(!1),[o,u]=R.useState(null),[c,s]=R.useState(null),d=R.useRef(n);d.current=n,R.useEffect(()=>{let x=!1;const g=[],y=async v=>V4(e,r,v?{refresh:!0}:void 0);return(async()=>{try{const v=await y(!1);if(x||(s(v),v.is_terminal))return;let _=0,C=v.status;const M=()=>{const U=v.refresh_earliest_at;if(!U)return Th;const F=Date.parse(U);return Number.isNaN(F)?Th:Math.max(4e3,F-Date.now()+1500)},T=U=>{if(x||_>=G4)return;const F=window.setTimeout(async()=>{if(!x){_+=1;try{const H=await y(!0);if(x)return;s(H);const W=H.status!==C;if(W&&(C=H.status),(W||H.is_terminal)&&d.current(),H.is_terminal)return}catch{}T(Th)}},U);g.push(F)};T(M())}catch{}})(),()=>{x=!0,g.forEach(v=>window.clearTimeout(v))}},[e,r]);const f=()=>{u(null),i(!0),V4(e,r,{refresh:!0}).then(x=>{s(x),n()}).catch(x=>{x instanceof Vt?u(x.data?.message??x.message):u("Impossible d’actualiser le statut.")}).finally(()=>i(!1))},h=c&&!c.refresh_attempted&&c.refresh_skipped_reason?pB[c.refresh_skipped_reason]??"Actualisation momentanément indisponible.":null,m=c===null||c.can_retry_refresh===!0,p=c!==null&&!c.is_terminal;return a.jsxs("div",{className:"mt-2 space-y-2 rounded-md border border-amber-100 bg-amber-50/60 px-3 py-2",children:[t&&a.jsx("p",{className:"text-xs text-ink-600",children:t}),p&&a.jsxs("p",{className:"text-xs text-ink-500",children:["Vérification automatique côté serveur (jusqu’à ",G4," tentatives, environ toutes les"," ",Math.round(Th/1e3)," s, dans la limite des garde-fous API) tant que le paiement n’est pas terminé. Vous pouvez aussi actualiser manuellement."]}),c?.message&&a.jsx("p",{className:"text-xs font-medium text-ink-800",role:"status",children:c.message}),o&&a.jsx("p",{className:"text-xs text-red-700",children:o}),h&&a.jsx("p",{className:"text-xs text-amber-800",children:h}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs(De,{type:"button",variant:"outline",className:"text-sm py-1.5 h-auto",onClick:f,disabled:l||!m,children:[a.jsx(F1,{size:14,className:`mr-1.5 inline ${l?"animate-spin":""}`}),l?"Vérification…":"Actualiser le statut"]}),!m&&!l&&!h&&a.jsx("span",{className:"text-xs text-ink-500",children:"Actualisation non disponible pour le moment."})]})]})}const gB={draft:"Brouillon",submitted:"Soumise",pending_payment:"En attente de paiement",correction:"Dossier en correction",paid:"Payée",cancelled:"Annulée"},xB={initiated:"Paiement en cours (agrégateur)",pending:"En attente de confirmation",pending_review:"En attente de validation",confirmed:"Validé",rejected:"Rejeté",failed:"Échoué ou refusé",refunded:"Remboursé"},hl="sycapay",mC=["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"];function bB(e){const[r,t]=e.split("-").map(Number);return Number.isNaN(r)||Number.isNaN(t)?e:`${mC[t-1]??e} ${r}`}function yB(e){const[r,t]=e.split("-").map(Number);if(Number.isNaN(r)||Number.isNaN(t))return e;const l=new Date(r,t,0).getDate(),i=mC[t-1]??String(t);return`${l} ${i} ${r}`}function vB(e){return(e.currency_selected??"XOF")==="EUR"&&e.amount_due_eur!=null?e.amount_due_eur:e.amount_due_xof!=null?e.amount_due_xof:e.amount_due_eur??0}function Y4(e,r){return e.find(t=>t.payment_gateway!==hl||!["pending","initiated"].includes(t.status)?!1:r===null?t.installment_index==null:t.installment_index===r)}function wB(e){return e.some(r=>r.payment_gateway===hl&&["pending","initiated"].includes(r.status))}function _B(e){return e.some(r=>r.status==="pending_review")}function $1(e,r){return e.filter(t=>r===null?t.installment_index===null||t.installment_index===void 0:t.installment_index===r)}function Zy(e,r){return $1(e,r).some(t=>t.status==="confirmed")}function jB(e,r){const t=$1(e,r),n=t.find(l=>l.status==="confirmed");return n||[...t].sort((l,i)=>i.id-l.id)[0]}function Z4(e,r){return Zy(e,r)?!1:$1(e,r).some(t=>t.payment_gateway===hl&&t.status==="failed")}function SB(e){return e==="confirmed"?"bg-green-100 text-green-800":e==="rejected"||e==="failed"?"bg-red-100 text-red-800":e==="refunded"?"bg-gray-200 text-gray-800":e==="pending_review"?"bg-amber-100 text-amber-800":"bg-sky-100 text-sky-900"}function kB(){const e=_s(),{user:r,isAuthenticated:t,canAccessAdmin:n,loading:l,refetch:i,roles:o}=qs(),[u,c]=R.useState([]),[s,d]=R.useState(!0),[f,h]=R.useState(null),[m,p]=R.useState(""),[x,g]=R.useState(""),[y,v]=R.useState(null),[_,C]=R.useState(!1),[M,T]=R.useState(null),[U,F]=R.useState(null),[H,W]=R.useState(null),[K,$]=R.useState(null),[P,L]=R.useState(!1),E=!P||K?.registration_payments_enabled!==!1,j=R.useCallback(O=>{const D=O?.silent===!0;D||d(!0),h(null),FF().then(c).catch(B=>{if(B instanceof Vt){if(B.status===401){Vi.logout().catch(()=>{}),e("/login",{replace:!0});return}h(B.data?.message??"Une erreur est survenue.")}else h("Une erreur est survenue.")}).finally(()=>{D||d(!1)})},[e]);R.useEffect(()=>{!t||!Vi.isAuthenticated()||r?.must_change_password||j()},[t,r?.must_change_password,j]),R.useEffect(()=>{!t||!Vi.isAuthenticated()||r?.must_change_password||fC().then(O=>{$(O),L(!0)}).catch(()=>{$({registration_payments_enabled:!0,donation_payments_enabled:!0,disabled_message:""}),L(!0)})},[t,r?.must_change_password]);const k=O=>{j();const D=O.data.redirect_url;D&&window.location.assign(D)},S=()=>{const O=m.trim(),D=x.trim();if(v(null),O.length<8){v("Le mot de passe doit contenir au moins 8 caractères.");return}if(O!==D){v("Les deux mots de passe ne correspondent pas.");return}C(!0),uC.changePassword({new_password:O,new_password_confirmation:D}).then(()=>{p(""),g(""),i()}).catch(B=>{const Y=B?.data?.message??B?.message??"Erreur lors du changement de mot de passe.",Z=B?.data?.errors;v(Z?Object.values(Z).flat().join(" "):Y)}).finally(()=>C(!1))},N=(O,D)=>{T(O),UF(O,`${D}.pdf`).catch(()=>{}).finally(()=>T(null))};return l?a.jsx("div",{className:"min-h-screen bg-brand-50 flex items-center justify-center",children:a.jsx("div",{className:"text-ink-500",children:"Chargement..."})}):t?n&&!r?.must_change_password?a.jsx(mi,{to:"/admin/registrations",replace:!0}):a.jsxs("div",{className:"min-h-screen bg-brand-50 py-12 px-4 sm:px-6 lg:px-8",children:[a.jsxs("div",{className:"max-w-3xl mx-auto",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx("h1",{className:"text-3xl font-bold text-ink-900 mb-2",children:"Mon espace participant"}),a.jsx("p",{className:"text-ink-500",children:"Consultez vos inscriptions, échéances et paiements"})]}),a.jsxs(ti,{className:"mb-8",children:[a.jsx("h2",{className:"text-lg font-semibold text-ink-900 mb-4",children:"Mes informations"}),a.jsxs("p",{className:"text-ink-700",children:[a.jsx("span",{className:"font-medium",children:"Nom :"})," ",r?.name??"—"]}),a.jsxs("p",{className:"text-ink-700 mt-1",children:[a.jsx("span",{className:"font-medium",children:"Email :"})," ",r?.email??"—"]})]}),r?.must_change_password&&a.jsxs(ti,{className:"mb-8 border-amber-200 bg-amber-50/50",children:[a.jsx("h2",{className:"text-lg font-semibold text-ink-900 mb-2",children:"Changer votre mot de passe"}),a.jsx("p",{className:"text-sm text-ink-600 mb-4",children:"Votre mot de passe a été réinitialisé. Veuillez définir un nouveau mot de passe pour continuer."}),y&&a.jsx("div",{className:"mb-4 bg-red-50 border border-red-200 rounded-lg p-3",children:a.jsx("p",{className:"text-sm text-red-700",children:y})}),a.jsxs("div",{className:"space-y-4 max-w-md",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-ink-700 mb-1",children:["Nouveau mot de passe ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"password",value:m,onChange:O=>p(O.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700",placeholder:"Au moins 8 caractères",disabled:!!_,autoComplete:"new-password"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-ink-700 mb-1",children:["Confirmer le mot de passe ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"password",value:x,onChange:O=>g(O.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700",placeholder:"Reproduire le mot de passe",disabled:!!_,autoComplete:"new-password"})]}),a.jsx(De,{variant:"primary",onClick:S,disabled:!!_,children:_?"Enregistrement...":"Enregistrer le mot de passe"})]})]}),!r?.must_change_password&&a.jsxs(ti,{children:[a.jsx("h2",{className:"text-lg font-semibold text-ink-900 mb-4",children:"Mes inscriptions"}),s&&a.jsx("div",{className:"py-8 text-center text-ink-500",children:"Chargement..."}),f&&a.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4 mb-4",children:[a.jsx("p",{className:"text-sm text-red-700",children:f}),a.jsx(De,{variant:"outline",className:"mt-2",onClick:()=>j(),children:"Réessayer"})]}),!s&&!f&&u.length===0&&a.jsxs("div",{className:"py-8 text-center text-ink-500",children:[a.jsx("p",{className:"mb-4",children:"Vous n'avez pas encore d'inscription."}),a.jsx(De,{variant:"primary",onClick:()=>e("/inscription"),children:"S'inscrire à un événement"})]}),!s&&!f&&u.length>0&&a.jsx("div",{className:"space-y-6",children:u.map(O=>{const D=vB(O),B=O.currency_selected==="EUR"?"€":"FCFA",Y=O.installment_config?.installments??[],Z=Y.length>0,ne=O.payments??[],q=ne.filter(te=>te.status==="confirmed").reduce((te,se)=>te+se.amount,0),ee=Math.max(0,D-q),z=Y4(ne,null),I=Z4(ne,null),X=ne.some(te=>(te.installment_index===null||te.installment_index===void 0)&&te.payment_gateway!==hl&&te.status!=="confirmed"&&te.status!=="failed");return a.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 hover:bg-gray-50/50 transition-colors",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-ink-900",children:O.event?.name??`Inscription #${O.id}`}),a.jsxs("p",{className:"text-sm text-ink-500",children:[O.first_name," ",O.last_name," · ",O.email]})]}),a.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${O.status==="paid"?"bg-green-100 text-green-800":O.status==="submitted"||O.status==="pending_payment"?"bg-amber-100 text-amber-800":"bg-gray-100 text-gray-800"}`,children:gB[O.status]??O.status})]}),O.pricing_plan&&a.jsxs("p",{className:"text-sm text-ink-500 mt-1",children:["Formule : ",O.pricing_plan.title," (",O.pricing_plan.code,")"]}),(O.amount_due_eur!=null||O.amount_due_xof!=null)&&!Z&&a.jsxs("p",{className:"text-sm text-ink-500 mt-1",children:["Montant dû :"," ",O.amount_due_eur!=null&&`${O.amount_due_eur} €`,O.amount_due_eur!=null&&O.amount_due_xof!=null&&" / ",O.amount_due_xof!=null&&`${O.amount_due_xof.toLocaleString("fr-FR")} FCFA`]}),Z?a.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100",children:[a.jsxs("p",{className:"text-sm text-ink-600 mb-1",children:["Montant total :"," ",a.jsxs("span",{className:"font-semibold text-ink-900",children:[D.toLocaleString("fr-FR")," ",B]})]}),a.jsx("h3",{className:"text-sm font-semibold text-ink-700 mb-3 mt-3",children:"Échéances de paiement"}),a.jsx("div",{className:"space-y-3",children:Y.map((te,se)=>{const Q=te.currency==="EUR"?"€":"FCFA",re=yB(te.month),ue=O.installment_balances?.find(ce=>ce.installment_index===se),ae=ue?.nominal??(typeof te.amount=="number"?te.amount:typeof te.amount=="string"&&te.amount!==""?Number(te.amount):null),ie=ue?.remaining,fe=typeof ie=="number"?ie<=0:Zy(ne,se),he=jB(ne,se),de=Zy(ne,se),ge=!!he&&he.status!=="confirmed"&&he.payment_gateway!==hl,ye=Y4(ne,se),xe=Z4(ne,se);return a.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border border-gray-200 bg-gray-50/50 px-4 py-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsxs("p",{className:"font-medium text-ink-900",children:["Échéance ",se+1," — ",bB(te.month)]}),a.jsxs("p",{className:"text-sm text-ink-500 mt-0.5",children:["Date limite : ",a.jsx("span",{className:"font-medium text-ink-700",children:re})]})]}),a.jsxs("div",{className:"text-right",children:[fe?a.jsx("p",{className:"text-lg font-semibold text-green-800",children:"Soldée"}):a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"text-lg font-semibold text-ink-900",children:[(typeof ie=="number"?ie:ae!=null&&!Number.isNaN(ae)?ae:null)?.toLocaleString("fr-FR")??"—"," ",Q]}),typeof ie=="number"&&ie>0&&typeof ae=="number"&&!Number.isNaN(ae)&&ie0&&!fe&&a.jsxs("p",{className:"text-xs text-green-700 mt-1",children:["Déjà versé : ",ue.paid_confirmed.toLocaleString("fr-FR")," ",Q]})]})]}),a.jsx("div",{className:"flex flex-wrap items-center gap-2",children:fe&&de&&he?.receipt?a.jsxs("span",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:"px-1.5 py-0.5 rounded text-xs bg-green-100 text-green-800",children:"Validé"}),a.jsxs("button",{type:"button",onClick:()=>N(he.receipt.id,he.receipt.receipt_number),disabled:M===he.receipt?.id,className:"inline-flex items-center gap-1.5 px-2 py-1 rounded text-sm text-brand-700 hover:bg-brand-50 font-medium transition-colors disabled:opacity-50",children:[a.jsx(wa,{size:14}),M===he.receipt?.id?"Téléchargement...":"Télécharger le reçu"]})]}):fe?a.jsxs("span",{className:"flex flex-col gap-1 sm:flex-row sm:items-center sm:flex-wrap",children:[a.jsx("span",{className:"px-1.5 py-0.5 rounded text-xs bg-green-100 text-green-800 w-fit",children:"Soldée"}),a.jsx("span",{className:"text-xs text-ink-600",children:"Montant couvert par vos paiements (y compris paiement libre). Le reçu correspondant figure dans la liste « Paiements »."})]}):ge&&!ye?a.jsx("span",{className:`px-1.5 py-0.5 rounded text-xs ${he.status==="rejected"?"bg-red-100 text-red-800":"bg-amber-100 text-amber-800"}`,children:he.status==="rejected"?"Rejeté":"Déclaré — En attente de validation"}):null}),ye&&a.jsxs("div",{className:"rounded-md border border-sky-200 bg-white px-3 py-2",children:[a.jsx("p",{className:"text-sm font-medium text-ink-800",children:"Paiement en ligne en cours"}),a.jsx("p",{className:"text-xs text-ink-600 mt-1",children:"Le statut affiché provient de nos serveurs après l’initiation. La confirmation finale peut prendre un court délai."}),a.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:ye.action_url?a.jsx(De,{type:"button",variant:"primary",className:"text-sm py-1.5 h-auto",onClick:()=>window.location.assign(ye.action_url),children:"Continuer vers le paiement"}):null}),a.jsx(Mx,{registrationId:O.id,paymentId:ye.id,summaryHint:"La confirmation finale vient de nos serveurs (prestataire), pas seulement de l’écran du téléphone.",onUpdated:()=>j({silent:!0})})]}),D>0&&!fe&&!ye&&!ge&&(E?a.jsx(De,{type:"button",variant:"primary",className:"text-sm py-2 h-auto w-full sm:w-auto",onClick:()=>F({registrationId:O.id,installmentIndex:se,defaultCountry:O.country||"CI"}),children:xe?"Réessayer le paiement en ligne":"Payer cette échéance"}):a.jsx("p",{className:"text-sm text-amber-900 rounded-md border border-amber-200 bg-amber-50/60 px-3 py-2",children:K?.disabled_message?.trim()||"Les paiements en ligne (SycaPay) ne sont pas encore ouverts."}))]},se)})}),ee>0&&!wB(ne)&&!_B(ne)&&a.jsxs("div",{className:"mt-4 pt-4 border-t border-dashed border-gray-200",children:[a.jsxs("p",{className:"text-sm text-ink-600 mb-2",children:["Vous pouvez aussi régler ",a.jsx("strong",{children:"un montant au choix"})," (dans la limite du solde restant) : il sera imputé automatiquement aux échéances les plus anciennes d’abord."]}),E?a.jsx(De,{type:"button",variant:"outline",className:"text-sm py-2 h-auto w-full sm:w-auto",onClick:()=>W({registrationId:O.id,defaultCountry:O.country||"CI",remainingDue:ee,currencyLabel:B,installments:Y}),children:"Payer un montant libre"}):a.jsx("p",{className:"text-sm text-amber-900 rounded-md border border-amber-200 bg-amber-50/60 px-3 py-2",children:K?.disabled_message?.trim()||"Les paiements en ligne (SycaPay) ne sont pas encore ouverts."})]})]}):D>0&&a.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100",children:[a.jsx("h3",{className:"text-sm font-semibold text-ink-700 mb-2",children:"Montant dû"}),a.jsxs("div",{className:"rounded-lg border border-gray-200 bg-gray-50/50 px-4 py-3 space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("p",{className:"text-sm text-ink-600",children:"Total à régler"}),a.jsxs("p",{className:"text-lg font-semibold text-ink-900",children:[D.toLocaleString("fr-FR")," ",B]})]}),z&&a.jsxs("div",{className:"rounded-md border border-sky-200 bg-white px-3 py-2",children:[a.jsx("p",{className:"text-sm font-medium text-ink-800",children:"Paiement en ligne en cours"}),a.jsx("p",{className:"text-xs text-ink-600 mt-1",children:"La confirmation sur cette page est mise à jour depuis nos serveurs, pas depuis l’écran du téléphone seul."}),a.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:z.action_url?a.jsx(De,{type:"button",variant:"primary",className:"text-sm py-1.5 h-auto",onClick:()=>window.location.assign(z.action_url),children:"Continuer vers le paiement"}):null}),a.jsx(Mx,{registrationId:O.id,paymentId:z.id,summaryHint:"La confirmation finale vient de nos serveurs (prestataire), pas seulement de l’écran du téléphone.",onUpdated:()=>j({silent:!0})})]}),!z&&ee>0&&(!X||I)&&(E?a.jsx(De,{type:"button",variant:"primary",className:"text-sm py-2 h-auto",onClick:()=>F({registrationId:O.id,installmentIndex:null,defaultCountry:O.country||"CI"}),children:I?"Réessayer le paiement en ligne":"Payer le solde"}):a.jsx("p",{className:"text-sm text-amber-900 rounded-md border border-amber-200 bg-amber-50/60 px-3 py-2",children:K?.disabled_message?.trim()||"Les paiements en ligne (SycaPay) ne sont pas encore ouverts."}))]})]}),D>0&&a.jsxs("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-2 rounded-lg px-4 py-2 border border-[#722F37]/25 bg-[#F5E8EA]",children:[a.jsx("span",{className:"text-sm font-medium text-[#5C262D]",children:"Restant à payer"}),a.jsxs("span",{className:`text-sm font-semibold ${ee>0?"text-[#722F37]":"text-green-700"}`,children:[ee.toLocaleString("fr-FR")," ",B,ee===0&&D>0&&" — Soldé"]})]}),a.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100",children:[a.jsx("h3",{className:"text-sm font-semibold text-ink-700 mb-2",children:"Paiements"}),ne.length===0?a.jsx("p",{className:"text-sm text-ink-500",children:"Aucun paiement enregistré."}):a.jsx("ul",{className:"space-y-2",children:ne.map(te=>a.jsxs("li",{className:"text-sm py-1.5 border-b border-gray-50 last:border-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsxs("span",{children:[te.amount.toLocaleString("fr-FR")," ",te.currency," — ",te.paid_at?new Date(te.paid_at).toLocaleDateString("fr-FR"):"—",te.reference&&` (${te.reference})`,te.payment_gateway===hl&&a.jsx("span",{className:"ml-1 text-xs text-ink-400",children:"· en ligne"})]}),a.jsxs("span",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:`px-1.5 py-0.5 rounded text-xs ${SB(te.status)}`,children:xB[te.status]??te.status}),te.status==="confirmed"&&(te.receipt?a.jsxs("button",{type:"button",onClick:()=>N(te.receipt.id,te.receipt.receipt_number),disabled:M===te.receipt.id,title:"Télécharger le reçu PDF",className:"inline-flex items-center gap-1.5 text-brand-700 hover:text-brand-900 hover:underline font-medium disabled:opacity-50 disabled:no-underline",children:[a.jsx(wa,{size:14}),M===te.receipt.id?"Téléchargement...":"Télécharger le reçu"]}):a.jsx("span",{className:"text-ink-500 text-xs",children:"Reçu à venir"}))]})]}),te.payment_gateway===hl&&(te.status==="pending"||te.status==="initiated")&&a.jsx("div",{className:"mt-2 rounded-md border border-sky-100 bg-sky-50/40 px-2 py-2",children:a.jsx(Mx,{registrationId:O.id,paymentId:te.id,summaryHint:"Le prestataire peut confirmer avant l’affichage ici : actualisez ou attendez quelques secondes.",onUpdated:()=>j({silent:!0})})})]},te.id))})]})]},O.id)})})]}),a.jsxs("div",{className:"mt-8 flex flex-wrap gap-4",children:[a.jsx(De,{variant:"outline",onClick:()=>Vi.logout().then(()=>e("/login",{replace:!0})),children:"Déconnexion"}),n&&a.jsx("a",{href:o?.includes("COMMISSION_FINANCE")||o?.includes("COMMISSION_FINANCE_SOMMET")||o?.includes("COMMISSION_FINANCE_SEMINAIRE")||o?.includes("COMMISSARIAT_GENERAL")?"/admin/finance":"/admin/registrations",className:"text-sm text-brand-700 hover:text-brand-900 hover:underline self-center",children:"Accéder à l'administration"}),a.jsx("a",{href:"/",className:"text-sm text-brand-700 hover:text-brand-900 hover:underline self-center",children:"Retour à l'accueil"})]})]}),U&&a.jsx(uB,{open:!0,registrationId:U.registrationId,installmentIndex:U.installmentIndex,defaultCountry:U.defaultCountry,onClose:()=>F(null),onInitiated:k}),H&&a.jsx(mB,{open:!0,registrationId:H.registrationId,defaultCountry:H.defaultCountry,remainingDue:H.remainingDue,currencyLabel:H.currencyLabel,installments:H.installments,onClose:()=>W(null),onInitSuccess:()=>j({silent:!0})})]}):a.jsx(mi,{to:"/login",replace:!0})}function NB(){const e=_s();return R.useEffect(()=>{const r=window.setTimeout(()=>{e("/account",{replace:!0})},5e3);return()=>window.clearTimeout(r)},[e]),a.jsx("div",{className:"min-h-screen bg-brand-50 py-12 px-4 sm:px-6",children:a.jsx("div",{className:"mx-auto max-w-md",children:a.jsxs(ti,{className:"text-center",children:[a.jsx("h1",{className:"text-xl font-semibold text-ink-900 mb-3",children:"Retour de paiement"}),a.jsx("p",{className:"text-sm text-ink-600 mb-6",children:"Si vous venez de finaliser une opération sur le site du prestataire, la confirmation peut prendre quelques instants. Retrouvez l’état à jour de votre paiement dans votre espace participant."}),a.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:justify-center",children:[a.jsx(De,{variant:"primary",onClick:()=>e("/account",{replace:!0}),children:"Voir mon espace participant"}),a.jsx(De,{variant:"outline",onClick:()=>e("/",{replace:!0}),children:"Accueil"})]}),a.jsx("p",{className:"mt-6 text-xs text-ink-400",children:"Redirection automatique vers votre espace dans quelques secondes…"})]})})})}function Tp({showRefresh:e=!1,refreshing:r=!1,onRefresh:t}){const n=_s(),{user:l}=qs(),i=async()=>{try{await Vi.logout(),n("/login",{replace:!0})}catch{n("/login",{replace:!0})}};return a.jsx("header",{className:"sticky top-0 z-50 w-full border-b border-gray-200 bg-white shadow-soft",children:a.jsx("div",{className:"w-full min-w-0 max-w-full px-3 py-2.5 sm:px-6 sm:py-3 lg:px-8 lg:py-4",children:a.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2 sm:gap-3",children:[a.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 sm:gap-3 md:flex-none",children:[a.jsx("img",{src:"/logoHaggai.avif",alt:"Sommet Haggai Francophone",className:"h-8 w-auto shrink-0 sm:h-10 lg:h-12"}),a.jsx("h1",{className:"min-w-0 truncate text-base font-heading font-medium uppercase tracking-wide text-ink-900 sm:text-lg lg:text-2xl",children:"Sommet Haggai Francophone"})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 sm:gap-4",children:[l&&a.jsxs("div",{className:"text-right hidden sm:block",children:[a.jsx("p",{className:"text-sm font-medium text-ink-900",children:l.name}),a.jsx("p",{className:"text-xs text-ink-500",children:l.email}),l.roles&&l.roles.length>0&&a.jsx("p",{className:"text-xs text-ink-500",children:typeof l.roles[0]=="string"?l.roles[0]:l.roles[0].name})]}),e&&t&&a.jsxs(De,{variant:"outline",onClick:t,disabled:r,className:"flex items-center gap-1 !px-2 !py-2 sm:!px-6 sm:!py-3 sm:gap-2",title:"Rafraîchir les données",children:[a.jsx(F1,{size:17,className:r?"animate-spin":""}),a.jsx("span",{className:"hidden sm:inline",children:r?"Rafraîchissement...":"Rafraîchir"})]}),a.jsxs(De,{variant:"outline",onClick:i,className:"flex items-center gap-1 !px-2 !py-2 sm:!px-6 sm:!py-3 sm:gap-2",children:[a.jsx(JL,{size:17}),a.jsx("span",{className:"hidden sm:inline",children:"Déconnexion"})]})]})]})})})}const cr=' fill="none" stroke="#374151" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"';function CB(e){const r=`${e}`;return`data:image/svg+xml,${encodeURIComponent(r)}`}const EB={layoutDashboard:[``,``,``,``].join(""),users:[``,``,``,``].join(""),messageSquare:[``].join(""),userCog:[``,``,``,``,``,``,``,``,``,``,``].join(""),userCircle:[``,``,``].join(""),dollarSign:[``,``].join(""),settings:[``,``].join(""),home:[``,``].join("")},pC={};for(const[e,r]of Object.entries(EB))pC[e]=CB(r);function AB(){if(typeof navigator>"u")return!1;const e=navigator.userAgent;return/iPhone|iPad/i.test(e)||/Mac/i.test(e)&&navigator.maxTouchPoints>1}function MB(e){return pC[e]??""}function Ip({currentSection:e,registrationView:r="summit",showSommet:t=!0,showSeminar:n=!1,showRecommendations:l=!0,showUsers:i=!1,showFinance:o=!1,showSettings:u=!1}){const c=e==="registrations",s=e==="users",d=e==="account",f=e==="finance",h=e==="settings",m=y=>`w-full flex items-center justify-start gap-2 px-3 py-2 rounded-lg transition-all duration-200 mb-1 text-left text-sm font-medium ${y?"bg-brand-700 text-white shadow-soft":"text-ink-500 hover:bg-brand-50 hover:text-ink-900"}`,p=a.jsxs("aside",{className:"hidden lg:flex fixed left-0 top-[73px] h-[calc(100vh-73px)] w-48 bg-white border-r border-gray-200 flex-col z-30",children:[a.jsx("div",{className:"p-4 border-b border-gray-200",children:a.jsx("h2",{className:"text-sm font-semibold text-ink-900",children:"Menu"})}),a.jsxs("nav",{className:"flex-1 p-2 overflow-y-auto",children:[t&&a.jsxs(kr,{to:"/admin/registrations?view=summit",className:m(c&&r==="summit"),children:[a.jsx(F4,{size:18}),"Sommet Francophone"]}),n&&a.jsxs(kr,{to:"/admin/registrations?view=seminar",className:m(c&&r==="seminar"),children:[a.jsx(Nm,{size:18}),"Séminaire régional"]}),l&&a.jsxs(kr,{to:"/admin/registrations?view=recommendations",className:m(c&&r==="recommendations"),children:[a.jsx(B4,{size:18}),"Recommandations"]}),i&&a.jsxs(kr,{to:"/admin/users",className:m(s),children:[a.jsx(km,{size:18}),"Utilisateurs"]}),o&&a.jsxs(kr,{to:"/admin/finance",className:m(f),children:[a.jsx(qy,{size:18}),"Finance"]}),u&&a.jsxs(kr,{to:"/admin/settings",className:m(h),children:[a.jsx(Wy,{size:18}),"Paramétrage"]}),a.jsxs(kr,{to:"/admin/account",className:m(d),children:[a.jsx(D4,{size:18}),"Mon compte"]}),a.jsxs(kr,{to:"/account",className:m(!1),children:[a.jsx(Hy,{size:18}),"Ma page personnelle"]})]})]}),x=AB(),g=[t&&{to:"/admin/registrations?view=summit",label:"Sommet",icon:F4,iconKey:"layoutDashboard",active:c&&r==="summit"},n&&{to:"/admin/registrations?view=seminar",label:"Séminaire",icon:Nm,iconKey:"users",active:c&&r==="seminar"},l&&{to:"/admin/registrations?view=recommendations",label:"Recommandations",icon:B4,iconKey:"messageSquare",active:c&&r==="recommendations"},i&&{to:"/admin/users",label:"Utilisateurs",icon:km,iconKey:"userCog",active:s},o&&{to:"/admin/finance",label:"Finance",icon:qy,iconKey:"dollarSign",active:f},u&&{to:"/admin/settings",label:"Paramétrage",icon:Wy,iconKey:"settings",active:h},{to:"/admin/account",label:"Mon compte",icon:D4,iconKey:"userCircle",active:d},{to:"/account",label:"Ma page",icon:Hy,iconKey:"home",active:!1}].filter(Boolean);return a.jsxs(a.Fragment,{children:[p,a.jsx("nav",{className:"lg:hidden fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 z-50 shadow-lg","aria-label":"Menu principal",style:{paddingBottom:"env(safe-area-inset-bottom)"},children:a.jsx("div",{className:"grid h-14 min-h-[56px] items-center justify-items-center py-2",style:{gridTemplateColumns:`repeat(${g.length}, minmax(0, 1fr))`},children:g.map(y=>{const v=y.icon;return a.jsxs(kr,{to:y.to,className:`flex flex-col items-center justify-center gap-0.5 w-full h-full min-h-[52px] transition-colors ${y.active?"text-brand-700":"text-ink-500 hover:text-ink-700"}`,title:y.label,"aria-label":y.label,children:[a.jsx("span",{className:"mobile-nav-icon-cell shrink-0 flex items-center justify-center","aria-hidden":!0,children:x?a.jsx("img",{src:MB(y.iconKey),alt:"",width:22,height:22,className:"block"}):a.jsx(v,{size:22,strokeWidth:2,stroke:"currentColor",fill:"none"})}),a.jsx("span",{className:"text-[10px] font-medium leading-tight max-w-full truncate px-0.5",children:y.label})]},y.to)})})})]})}const Qy=[{value:"draft",label:"Brouillon",badgeClass:"bg-gray-100 text-gray-700"},{value:"submitted",label:"Soumis",badgeClass:"bg-blue-100 text-blue-700"},{value:"pending_payment",label:"En attente",badgeClass:"bg-yellow-100 text-yellow-700"},{value:"correction",label:"Dossier en correction",badgeClass:"bg-amber-100 text-amber-800"},{value:"paid",label:"Payé",badgeClass:"bg-green-100 text-green-700"},{value:"rejected",label:"Rejeté",badgeClass:"bg-red-100 text-red-700"},{value:"cancelled",label:"Annulé",badgeClass:"bg-gray-100 text-gray-600"},{value:"refunded",label:"Remboursé",badgeClass:"bg-orange-100 text-orange-700"}];function U1(e){return e?Qy.find(t=>t.value===e)??{label:String(e),badgeClass:"bg-gray-100 text-gray-700"}:{label:"-",badgeClass:"bg-gray-100 text-gray-700"}}function OB({filters:e,onFiltersChange:r,hideEventFilter:t=!1,showCountryFilter:n=!1,countryShortcuts:l=[]}){const{events:i,loading:o}=Mp(),[u,c]=R.useState(e),s=R.useMemo(()=>{const C=new Set(l),M=u.country?.trim();return M&&C.add(M),Array.from(C).sort((T,U)=>T.localeCompare(U,"fr"))},[l,u.country]),[d,f]=R.useState(null),[h,m]=R.useState(!1);R.useEffect(()=>{c(e)},[e]);const p=(C,M)=>{const T={...u,[C]:M};if(c(T),C==="q"){d&&clearTimeout(d);const U=setTimeout(()=>{r(T)},400);f(U)}else r(T)},x=C=>{const M=u.status||[],T=M.includes(C)?M.filter(U=>U!==C):[...M,C];p("status",T.length>0?T:void 0)},g=C=>{const M=u.country===C?void 0:C;p("country",M)},y=()=>{const C={event_id:void 0,status:void 0,q:void 0,created_from:void 0,created_to:void 0,country:void 0};c(C),r(C),m(!1)},v="w-full min-w-0 px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent",_="w-full min-w-0 rounded-lg border border-gray-300 px-2.5 py-2 text-sm focus:ring-2 focus:ring-brand-700 focus:border-transparent";return a.jsxs("div",{className:"min-w-0 max-w-full",children:[a.jsxs("div",{className:"rounded-xl bg-white px-2 py-2 shadow-soft lg:hidden",children:[a.jsxs("div",{className:"flex min-w-0 gap-2",children:[a.jsx("label",{htmlFor:"registration-search-mobile",className:"sr-only",children:"Recherche"}),a.jsx("input",{id:"registration-search-mobile",type:"text",value:u.q||"",onChange:C=>p("q",C.target.value||void 0),placeholder:"Rechercher…",className:_+" min-w-0 flex-1"}),a.jsxs("button",{type:"button",id:"registration-filters-toggle","aria-expanded":h,"aria-controls":"registration-filters-panel",className:"flex shrink-0 items-center gap-1 rounded-lg border-2 border-brand-700 bg-white px-2.5 py-2 text-xs font-semibold uppercase tracking-wide text-brand-700",onClick:()=>m(C=>!C),children:["Filtres",a.jsx(Uy,{className:`h-4 w-4 transition-transform ${h?"rotate-180":""}`,"aria-hidden":!0})]})]}),h?a.jsxs("div",{id:"registration-filters-panel",role:"region","aria-labelledby":"registration-filters-toggle",className:"mt-2 space-y-3 border-t border-gray-100 pt-3",children:[t?a.jsxs("div",{className:"grid min-w-0 grid-cols-1 gap-2 sm:grid-cols-2",children:[n?a.jsxs("div",{className:"min-w-0 sm:col-span-2",children:[a.jsx("label",{className:"mb-0.5 block text-xs font-medium text-ink-500",children:"Pays"}),a.jsxs("select",{value:u.country||"",onChange:C=>p("country",C.target.value?C.target.value:void 0),className:_,children:[a.jsx("option",{value:"",children:"Tous les pays"}),s.map(C=>a.jsx("option",{value:C,children:C},C))]})]}):null,a.jsxs("div",{className:"min-w-0",children:[a.jsx("label",{className:"mb-0.5 block text-xs font-medium text-ink-500",children:"Date début"}),a.jsx("input",{type:"date",value:u.created_from||"",onChange:C=>p("created_from",C.target.value||void 0),className:_})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("label",{className:"mb-0.5 block text-xs font-medium text-ink-500",children:"Date fin"}),a.jsx("input",{type:"date",value:u.created_to||"",onChange:C=>p("created_to",C.target.value||void 0),className:_})]})]}):a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("label",{className:"mb-0.5 block text-xs font-medium text-ink-500",children:"Événement"}),a.jsxs("select",{value:u.event_id||"",onChange:C=>p("event_id",C.target.value?Number(C.target.value):void 0),className:_,disabled:o,children:[a.jsx("option",{value:"",children:"Tous les événements"}),i.map(C=>a.jsx("option",{value:C.id,children:C.name},C.id))]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("label",{className:"mb-0.5 block text-xs font-medium text-ink-500",children:"Date début"}),a.jsx("input",{type:"date",value:u.created_from||"",onChange:C=>p("created_from",C.target.value||void 0),className:_})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("label",{className:"mb-0.5 block text-xs font-medium text-ink-500",children:"Date fin"}),a.jsx("input",{type:"date",value:u.created_to||"",onChange:C=>p("created_to",C.target.value||void 0),className:_})]})]})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-500",children:"Statuts"}),a.jsx("div",{className:"flex min-w-0 flex-wrap gap-1",children:Qy.map(C=>{const M=u.status?.includes(C.value);return a.jsx("button",{type:"button",onClick:()=>x(C.value),className:M?`rounded-full border border-transparent px-2 py-0.5 text-[11px] font-medium ring-2 ring-brand-700/35 ring-offset-1 ${C.badgeClass}`:"rounded-full bg-gray-100 px-2 py-0.5 text-[11px] font-medium text-gray-700",children:C.label},C.value)})})]}),n&&l.length>0?a.jsxs("div",{className:"min-w-0",children:[a.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-500",children:"Pays (raccourcis)"}),a.jsx("div",{className:"flex min-w-0 flex-wrap gap-1",children:l.map(C=>{const M=u.country===C;return a.jsx("button",{type:"button",onClick:()=>g(C),className:M?"rounded-full border border-transparent bg-brand-50 px-2 py-0.5 text-[11px] font-medium text-brand-900 ring-2 ring-brand-700/35 ring-offset-1":"rounded-full bg-gray-100 px-2 py-0.5 text-[11px] font-medium text-gray-700",children:C},C)})})]}):null,a.jsx("div",{className:"flex justify-end border-t border-gray-100 pt-2",children:a.jsx("button",{type:"button",className:"text-sm font-medium text-brand-700 underline-offset-2 hover:underline",onClick:y,children:"Réinitialiser"})})]}):null]}),a.jsxs("div",{className:"hidden min-w-0 max-w-full space-y-2 rounded-xl bg-white px-3 py-3 shadow-soft sm:px-4 lg:block",children:[a.jsxs("div",{className:"mb-1 flex min-w-0 flex-wrap items-center justify-between gap-2",children:[a.jsx("h3",{className:"text-sm font-semibold text-ink-900 sm:text-base",children:"Filtres"}),a.jsx(De,{variant:"ghost",onClick:y,className:"shrink-0 text-sm !px-3 !py-1.5 !normal-case",children:"Réinitialiser"})]}),t?a.jsxs("div",{className:"grid min-w-0 grid-cols-1 gap-x-3 gap-y-2 sm:grid-cols-2 lg:grid-cols-4",children:[a.jsxs("div",{className:"min-w-0 sm:col-span-2 lg:col-span-1",children:[a.jsx("label",{className:"mb-1 block text-xs font-medium text-ink-500 sm:text-sm",children:"Recherche"}),a.jsx("input",{type:"text",value:u.q||"",onChange:C=>p("q",C.target.value||void 0),placeholder:"Nom, email, téléphone...",className:v})]}),n?a.jsxs("div",{className:"min-w-0 sm:col-span-2 lg:col-span-1",children:[a.jsx("label",{className:"mb-1 block text-xs font-medium text-ink-500 sm:text-sm",children:"Pays"}),a.jsxs("select",{value:u.country||"",onChange:C=>p("country",C.target.value?C.target.value:void 0),className:v,children:[a.jsx("option",{value:"",children:"Tous les pays"}),s.map(C=>a.jsx("option",{value:C,children:C},C))]})]}):null,a.jsxs("div",{className:"min-w-0",children:[a.jsx("label",{className:"mb-1 block text-xs font-medium text-ink-500 sm:text-sm",children:"Date début"}),a.jsx("input",{type:"date",value:u.created_from||"",onChange:C=>p("created_from",C.target.value||void 0),className:v})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("label",{className:"mb-1 block text-xs font-medium text-ink-500 sm:text-sm",children:"Date fin"}),a.jsx("input",{type:"date",value:u.created_to||"",onChange:C=>p("created_to",C.target.value||void 0),className:v})]})]}):a.jsxs("div",{className:"grid min-w-0 grid-cols-1 gap-x-3 gap-y-2 sm:grid-cols-2 xl:grid-cols-4",children:[a.jsxs("div",{className:"min-w-0 sm:col-span-2 xl:col-span-1",children:[a.jsx("label",{className:"mb-1 block text-xs font-medium text-ink-500 sm:text-sm",children:"Recherche"}),a.jsx("input",{type:"text",value:u.q||"",onChange:C=>p("q",C.target.value||void 0),placeholder:"Nom, email, téléphone...",className:v})]}),a.jsxs("div",{className:"min-w-0 sm:col-span-2 xl:col-span-1",children:[a.jsx("label",{className:"mb-1 block text-xs font-medium text-ink-500 sm:text-sm",children:"Événement"}),a.jsxs("select",{value:u.event_id||"",onChange:C=>p("event_id",C.target.value?Number(C.target.value):void 0),className:v,disabled:o,children:[a.jsx("option",{value:"",children:"Tous les événements"}),i.map(C=>a.jsx("option",{value:C.id,children:C.name},C.id))]})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("label",{className:"mb-1 block text-xs font-medium text-ink-500 sm:text-sm",children:"Date début"}),a.jsx("input",{type:"date",value:u.created_from||"",onChange:C=>p("created_from",C.target.value||void 0),className:v})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("label",{className:"mb-1 block text-xs font-medium text-ink-500 sm:text-sm",children:"Date fin"}),a.jsx("input",{type:"date",value:u.created_to||"",onChange:C=>p("created_to",C.target.value||void 0),className:v})]})]}),a.jsxs("div",{className:"min-w-0 pt-0.5",children:[a.jsx("label",{className:"mb-1 block text-xs font-medium text-ink-500 sm:text-sm",children:"Statuts"}),a.jsx("div",{className:"flex min-w-0 flex-wrap gap-1.5",children:Qy.map(C=>{const M=u.status?.includes(C.value);return a.jsx("button",{type:"button",onClick:()=>x(C.value),className:M?`rounded-full border border-transparent px-2.5 py-1 text-xs font-medium ring-2 ring-brand-700/35 ring-offset-1 transition-all sm:text-sm ${C.badgeClass}`:"rounded-full border border-transparent bg-gray-100 px-2.5 py-1 text-xs font-medium text-gray-700 transition-all hover:bg-gray-200 sm:text-sm",children:C.label},C.value)})})]}),n&&l.length>0?a.jsxs("div",{className:"min-w-0 pt-1",children:[a.jsx("label",{className:"mb-1 block text-xs font-medium text-ink-500 sm:text-sm",children:"Pays (raccourcis)"}),a.jsx("div",{className:"flex min-w-0 flex-wrap gap-1.5",children:l.map(C=>{const M=u.country===C;return a.jsx("button",{type:"button",onClick:()=>g(C),className:M?"rounded-full border border-transparent bg-brand-50 px-2.5 py-1 text-xs font-medium text-brand-900 ring-2 ring-brand-700/35 ring-offset-1 transition-all sm:text-sm":"rounded-full border border-transparent bg-gray-100 px-2.5 py-1 text-xs font-medium text-gray-700 transition-all hover:bg-gray-200 sm:text-sm",children:C},C)})})]}):null]})]})}function PB({title:e,subtitle:r,subtitleDesktopOnly:t=!0,actions:n}){const l=t?"hidden lg:block lg:text-base":"text-sm lg:text-base";return a.jsxs("div",{className:"mb-2 flex min-w-0 flex-col gap-2 sm:mb-5 sm:gap-3 lg:flex-row lg:items-start lg:justify-between",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("h2",{className:"mb-0.5 text-xl font-bold text-ink-900 sm:mb-2 sm:text-2xl lg:text-3xl",children:e}),r?a.jsx("p",{className:`text-ink-500 ${l}`,children:r}):null]}),n?a.jsx("div",{className:"relative shrink-0 sm:mt-0.5",children:n}):null]})}function TB({children:e}){return a.jsx("div",{className:"sticky top-14 z-40 mb-2 w-full min-w-0 border-b border-gray-200/90 bg-brand-50/95 py-1.5 backdrop-blur-sm sm:mb-3 sm:py-2 lg:top-[4.5rem] lg:mb-4",children:e})}const mn="px-2 py-2 text-left text-[10px] font-medium uppercase leading-tight tracking-wider text-ink-500 sm:px-3 sm:py-2.5 sm:text-xs",gC="min-w-0 max-w-full rounded-xl bg-white shadow-soft",xC=`${gC} p-8 text-center`;function bC({children:e,className:r=""}){return a.jsx("div",{className:`${gC} ${r}`.trim(),children:e})}function yC({children:e,className:r=""}){return a.jsx("div",{className:`space-y-2 overflow-visible p-2 lg:hidden ${r}`.trim(),children:e})}function vC({children:e,className:r="",variant:t="desktop"}){const n=t==="all"?"":"hidden lg:block";return a.jsx("div",{className:`min-w-0 overflow-x-auto ${n} ${r}`.trim(),children:e})}function wC({message:e="Chargement..."}){return a.jsx("div",{className:xC,children:a.jsx("p",{className:"text-ink-500",children:e})})}function _C({message:e}){return a.jsx("div",{className:xC,children:a.jsx("p",{className:"text-ink-500",children:e})})}function IB({children:e,className:r=""}){return a.jsx("div",{className:`mb-2 min-w-0 sm:mb-4 ${r}`.trim(),children:e})}function xa({rowId:e,openMenuId:r,setOpenMenuId:t,compact:n=!1,className:l="",stopPropagation:i=!0,onView:o,viewLabel:u="Voir",viewDisabled:c=!1,onEdit:s,editLabel:d="Modifier",editDisabled:f=!1,primaryOutlineAction:h,menuItems:m}){const p=R.useRef(null),x=R.useRef(null),g=R.useRef(!1),y=r===e,[v,_]=R.useState(null),C=m.length>0,M=h&&!o&&!s;R.useLayoutEffect(()=>{if(!y||!p.current){_(null),g.current=!1;return}const W=p.current,K=W.getBoundingClientRect(),$=window.getComputedStyle(W);if(K.width<1||K.height<1||$.display==="none"||$.visibility==="hidden"){_(null);return}const P=window.innerWidth,L=window.innerHeight,E=6,j=Math.min(224,P-16),k=Math.min(240,L*.45);let S=K.bottom+E;S+k>L-8&&(S=Math.max(8,K.top-k-E));const N=P-8;let D=Math.min(K.right,N);D-j<8&&(D=Math.min(8+j,N)),_({top:S,left:D,transform:"translateX(-100%)"}),g.current=!1},[y]),R.useLayoutEffect(()=>{if(!y||!v||!p.current||!x.current||g.current)return;const K=p.current.getBoundingClientRect(),$=x.current,P=$.offsetWidth,L=$.offsetHeight,E=window.innerWidth,j=window.innerHeight,k=6;let S=K.bottom+k;S+L>j-8&&(S=Math.max(8,K.top-L-k));const N=E-8;let D=Math.min(K.right,N);D-P<8&&(D=Math.min(8+P,N)),g.current=!0,_(B=>!B||B.top===S&&B.left===D?B:{top:S,left:D,transform:"translateX(-100%)"})},[y,v]),R.useEffect(()=>{if(!y||v===null)return;const W=$=>{const P=$.target;p.current?.contains(P)||x.current?.contains(P)||t(null)},K=()=>t(null);return document.addEventListener("mousedown",W,!0),window.addEventListener("scroll",K,!0),window.addEventListener("resize",K),()=>{document.removeEventListener("mousedown",W,!0),window.removeEventListener("scroll",K,!0),window.removeEventListener("resize",K)}},[y,v,t]),R.useEffect(()=>{if(!y||v===null)return;const W=K=>{K.key==="Escape"&&t(null)};return window.addEventListener("keydown",W),()=>window.removeEventListener("keydown",W)},[y,v,t]);const T=n?"rounded px-1 py-0.5 text-[11px] font-medium text-brand-700 hover:bg-brand-50 hover:underline":"rounded px-1 py-0.5 text-[11px] font-medium text-brand-700 hover:bg-brand-50 hover:underline sm:text-xs",U=n?"rounded border border-gray-300 bg-white px-1 py-0.5 text-[10px] font-medium leading-tight text-ink-800 hover:bg-gray-50":"rounded border border-gray-300 bg-white px-1 py-0.5 text-[10px] font-medium leading-tight text-ink-800 hover:bg-gray-50 sm:px-1.5 sm:text-xs",F=i?W=>W.stopPropagation():void 0,H=y&&v!=null&&C&&jp.createPortal(a.jsx("div",{ref:x,role:"menu",className:"fixed z-[200] max-h-[min(50vh,20rem)] min-w-[11rem] max-w-[min(calc(100vw-1rem),14rem)] overflow-y-auto rounded-lg border border-gray-200 bg-white py-1 shadow-lg",style:{top:v.top,left:v.left,transform:v.transform},children:m.map(W=>a.jsx("button",{type:"button",role:"menuitem",disabled:W.disabled,title:W.title,className:`block w-full px-3 py-2 text-left text-sm hover:bg-brand-50 disabled:opacity-50 ${W.danger?"text-red-600 hover:bg-red-50":"text-ink-900"}`,onClick:K=>{K.stopPropagation(),!W.disabled&&(t(null),W.onSelect())},children:W.label},W.id))}),document.body);return a.jsxs("div",{className:`flex shrink-0 items-center justify-end gap-0.5 ${l}`,onClick:F,children:[o?a.jsx("button",{type:"button",className:`${T} disabled:cursor-not-allowed disabled:opacity-50`,disabled:c,onClick:o,children:u}):null,s?a.jsx("button",{type:"button",className:`${U} disabled:cursor-not-allowed disabled:opacity-50`,disabled:f,onClick:s,children:d}):null,M&&h?a.jsx("button",{type:"button",className:U,disabled:h.disabled,title:h.title,onClick:h.onClick,children:h.label}):null,C?a.jsxs(a.Fragment,{children:[a.jsx("button",{ref:p,type:"button","aria-expanded":y,"aria-haspopup":"menu","aria-label":"Autres actions",className:n?"inline-flex h-7 w-7 items-center justify-center rounded text-ink-600 hover:bg-gray-100":"inline-flex h-7 w-7 items-center justify-center rounded text-ink-600 hover:bg-gray-100 sm:h-8 sm:w-8",onClick:W=>{W.stopPropagation(),t(K=>K===e?null:e)},children:a.jsx(BL,{className:"h-4 w-4","aria-hidden":!0})}),H]}):null]})}const Q4={pending:{label:"En attente",className:"bg-yellow-100 text-yellow-700"},contacted:{label:"Contacté",className:"bg-blue-100 text-blue-700"},accepted:{label:"Accepté",className:"bg-green-100 text-green-700"},rejected:{label:"Rejeté",className:"bg-red-100 text-red-700"}},RB=new Set(["draft","submitted","pending_payment","correction","paid","rejected","cancelled","refunded"]);function _l({status:e,compact:r}){const t=r?"max-w-full whitespace-normal break-words px-2 py-0.5 text-[10px] font-medium leading-snug sm:text-xs":"px-3 py-1 text-sm font-medium";if(!e)return a.jsx("span",{className:`inline-flex items-center rounded-full bg-gray-100 text-gray-700 ${t}`,children:"-"});if(RB.has(e)){const{label:l,badgeClass:i}=U1(e);return a.jsx("span",{className:`inline-flex items-center rounded-full ${i} ${t}`,children:l})}const n=Q4[e]||Q4.pending;return a.jsx("span",{className:`inline-flex items-center rounded-full ${n.className} ${t}`,children:n.label})}function DB(e){return e.amount_due_xof!=null&&e.amount_due_xof>0?`${Number(e.amount_due_xof).toLocaleString("fr-FR")} XOF`:e.amount_due_eur!=null&&e.amount_due_eur>0?`${e.amount_due_eur} EUR`:"-"}function LB(e,r){const t=[];return r.canUpdateStatus&&r.onUpdateStatus&&t.push({id:"status",label:"Changer statut",onSelect:()=>r.onUpdateStatus(e)}),r.canResendActivation&&r.onResendActivation&&e.status==="draft"&&t.push({id:"resend",label:r.resendingActivationId===e.id?"Envoi…":"Renvoyer activation",onSelect:()=>r.onResendActivation(e),disabled:r.resendingActivationId===e.id,title:"Renvoyer l’email avec le lien pour activer le compte et choisir un mot de passe"}),r.canResetParticipantPassword&&r.onResetParticipantPassword&&Ky(e)&&t.push({id:"reset-participant-password",label:"Initialiser le mot de passe",title:"Définir un mot de passe provisoire : le participant devra en choisir un nouveau à la prochaine connexion.",onSelect:()=>r.onResetParticipantPassword(e)}),r.canDelete&&r.onDelete&&t.push({id:"delete",label:"Supprimer",danger:!0,onSelect:()=>r.onDelete(e)}),t}function J4({registration:e,openMenuId:r,setOpenMenuId:t,onViewDetails:n,onUpdateStatus:l,onEdit:i,onDelete:o,onResendActivation:u,onResetParticipantPassword:c,canUpdateStatus:s,canEdit:d,canDelete:f,canResendActivation:h,canResetParticipantPassword:m,resendingActivationId:p,compact:x}){const g=LB(e,{onUpdateStatus:l,onDelete:o,onResendActivation:u,onResetParticipantPassword:c,canUpdateStatus:s,canDelete:f,canResendActivation:h,canResetParticipantPassword:m,resendingActivationId:p});return a.jsx(xa,{rowId:e.id,openMenuId:r,setOpenMenuId:t,compact:x,onView:()=>n(e),onEdit:d&&i?()=>i(e):void 0,editLabel:"Modifier",menuItems:g})}function FB({registrations:e,loading:r,eventType:t,onViewDetails:n,onUpdateStatus:l,onEdit:i,onDelete:o,onResendActivation:u,onResetParticipantPassword:c,canUpdateStatus:s=!1,canEdit:d=!1,canDelete:f=!1,canResendActivation:h=!1,canResetParticipantPassword:m=!1,resendingActivationId:p=null}){const[x,g]=R.useState(null);return r?a.jsx(wC,{}):e.length===0?a.jsx(_C,{message:"Aucune inscription trouvée"}):a.jsxs(bC,{children:[a.jsx(yC,{children:e.map(y=>{const v=`${y.first_name} ${y.last_name}`.trim(),_=new Date(y.created_at).toLocaleDateString("fr-FR");return a.jsxs("div",{role:"button",tabIndex:0,className:"overflow-visible rounded-lg border border-gray-200 bg-white p-3 shadow-sm outline-none ring-brand-700 focus-visible:ring-2",onClick:()=>n(y),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),n(y))},children:[a.jsxs("div",{className:"flex min-w-0 gap-2 overflow-visible",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"truncate text-sm font-semibold text-ink-900",title:v||void 0,children:v||"—"}),a.jsx("p",{className:"truncate text-xs text-ink-500",title:y.email||void 0,children:y.email}),a.jsx("p",{className:"mt-0.5 truncate text-xs text-ink-500",title:y.country||void 0,children:y.country||"—"})]}),a.jsx(J4,{registration:y,openMenuId:x,setOpenMenuId:g,onViewDetails:n,onUpdateStatus:l,onEdit:i,onDelete:o,onResendActivation:u,onResetParticipantPassword:c,canUpdateStatus:s,canEdit:d,canDelete:f,canResendActivation:h,canResetParticipantPassword:m,resendingActivationId:p,compact:!0})]}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[a.jsx(_l,{status:y.status,compact:!0}),a.jsx("span",{className:"text-xs text-ink-500",children:_})]})]},y.id)})}),a.jsx(vC,{children:a.jsxs("table",{className:"w-full min-w-0 table-fixed border-collapse",children:[a.jsxs("colgroup",{children:[a.jsx("col",{style:{width:"12%"}}),a.jsx("col",{style:{width:"15%"}}),a.jsx("col",{style:{width:"8%"}}),a.jsx("col",{style:{width:"10%"}}),a.jsx("col",{style:{width:"13%"}}),a.jsx("col",{style:{width:"9%"}}),a.jsx("col",{style:{width:"11%"}}),a.jsx("col",{style:{width:"7%"}}),a.jsx("col",{style:{width:"15%"}})]}),a.jsx("thead",{className:"bg-brand-50",children:a.jsxs("tr",{children:[a.jsx("th",{className:mn,children:"Nom"}),a.jsx("th",{className:mn,children:"Email"}),a.jsx("th",{className:mn,children:"Tél."}),a.jsx("th",{className:mn,children:"Pays"}),a.jsx("th",{className:mn,children:"Événement"}),a.jsx("th",{className:mn,children:t==="seminar"?a.jsx("span",{className:"block normal-case",children:"Frais part."}):"Formule"}),a.jsx("th",{className:mn,children:"Statut"}),a.jsx("th",{className:mn,children:"Créé"}),a.jsx("th",{className:`${mn} text-right`,children:"Actions"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-200 bg-white",children:e.map(y=>{const v=`${y.first_name} ${y.last_name}`.trim(),_=t==="seminar"?DB(y):y.pricing_plan?.code||"-";return a.jsxs("tr",{className:"cursor-pointer hover:bg-brand-50",onClick:()=>n(y),children:[a.jsx("td",{className:"min-w-0 px-2 py-2 align-middle sm:px-3 sm:py-2.5",children:a.jsx("div",{className:"truncate text-xs font-medium text-ink-900 sm:text-sm",title:v||void 0,children:v||"—"})}),a.jsx("td",{className:"min-w-0 px-2 py-2 align-middle sm:px-3 sm:py-2.5",children:a.jsx("div",{className:"truncate text-xs text-ink-500 sm:text-sm",title:y.email||void 0,children:y.email})}),a.jsx("td",{className:"min-w-0 px-2 py-2 align-middle sm:px-3 sm:py-2.5",children:a.jsx("div",{className:"truncate text-xs text-ink-500 sm:text-sm",title:y.phone||void 0,children:y.phone||"-"})}),a.jsx("td",{className:"min-w-0 px-2 py-2 align-middle sm:px-3 sm:py-2.5",children:a.jsx("div",{className:"truncate text-xs text-ink-500 sm:text-sm",title:y.country||void 0,children:y.country||"—"})}),a.jsx("td",{className:"min-w-0 px-2 py-2 align-middle sm:px-3 sm:py-2.5",children:a.jsx("div",{className:"truncate text-xs text-ink-500 sm:text-sm",title:y.event?.name||void 0,children:y.event?.name||"-"})}),a.jsx("td",{className:"min-w-0 px-2 py-2 align-middle sm:px-3 sm:py-2.5",children:a.jsx("div",{className:"truncate text-xs text-ink-500 sm:text-sm",title:_,children:_})}),a.jsx("td",{className:"min-w-0 px-2 py-2 align-middle sm:px-3 sm:py-2.5",children:a.jsx(_l,{status:y.status,compact:!0})}),a.jsx("td",{className:"min-w-0 whitespace-nowrap px-2 py-2 align-middle text-xs text-ink-500 sm:px-3 sm:py-2.5 sm:text-sm",children:new Date(y.created_at).toLocaleDateString("fr-FR")}),a.jsx("td",{className:"min-w-0 whitespace-nowrap px-1 py-2 text-right align-middle sm:px-2 sm:py-2.5",children:a.jsx(J4,{registration:y,openMenuId:x,setOpenMenuId:g,onViewDetails:n,onUpdateStatus:l,onEdit:i,onDelete:o,onResendActivation:u,onResetParticipantPassword:c,canUpdateStatus:s,canEdit:d,canDelete:f,canResendActivation:h,canResetParticipantPassword:m,resendingActivationId:p})})]},y.id)})})]})})]})}function BB({registrations:e,loading:r}){return r?a.jsx("div",{className:"min-w-0 max-w-full rounded-xl bg-white p-6 text-center shadow-soft lg:p-8",children:a.jsx("p",{className:"text-sm text-ink-500",children:"Chargement..."})}):e.length===0?a.jsx("div",{className:"min-w-0 max-w-full rounded-xl bg-white p-6 text-center shadow-soft lg:p-8",children:a.jsx("p",{className:"text-sm text-ink-500",children:"Aucune inscription trouvée"})}):a.jsxs("div",{className:"min-w-0 max-w-full overflow-hidden rounded-xl bg-white shadow-soft",children:[a.jsx("div",{className:"space-y-2 p-2 lg:hidden",children:e.map(t=>a.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-3 shadow-sm",children:[a.jsx("p",{className:"truncate text-sm font-medium text-ink-900",title:t.email||void 0,children:t.email}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[a.jsx(_l,{status:t.status,compact:!0}),a.jsx("span",{className:"text-xs text-ink-500",children:t.country||"—"})]})]},t.id))}),a.jsx("div",{className:"hidden overflow-x-auto lg:block",children:a.jsxs("table",{className:"w-full min-w-0",children:[a.jsx("thead",{className:"bg-brand-50",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium uppercase tracking-wider text-ink-500 lg:px-6 lg:py-3",children:"Email"}),a.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium uppercase tracking-wider text-ink-500 lg:px-6 lg:py-3",children:"Pays"}),a.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium uppercase tracking-wider text-ink-500 lg:px-6 lg:py-3",children:"Statut"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-200 bg-white",children:e.map(t=>a.jsxs("tr",{className:"hover:bg-brand-50",children:[a.jsx("td",{className:"whitespace-nowrap px-4 py-3 lg:px-6 lg:py-4",children:a.jsx("div",{className:"text-sm text-ink-900",children:t.email})}),a.jsx("td",{className:"whitespace-nowrap px-4 py-3 lg:px-6 lg:py-4",children:a.jsx("div",{className:"text-sm text-ink-500",children:t.country||"—"})}),a.jsx("td",{className:"whitespace-nowrap px-4 py-3 lg:px-6 lg:py-4",children:a.jsx(_l,{status:t.status})})]},t.id))})]})})]})}const la="min-w-0 px-2 py-2 align-middle sm:px-3 sm:py-2.5";function ej({recommendation:e,openMenuId:r,setOpenMenuId:t,onViewDetails:n,onTreat:l,onDelete:i,canDelete:o,compact:u}){const c=[];return o&&i&&c.push({id:"delete",label:"Supprimer",danger:!0,onSelect:()=>i(e)}),a.jsx(xa,{rowId:e.id,openMenuId:r,setOpenMenuId:t,compact:u,onView:()=>n(e),onEdit:l?()=>l(e):void 0,editLabel:"Traiter",menuItems:c})}function zB({recommendations:e,loading:r,onViewDetails:t,onTreat:n,onDelete:l,canDelete:i}){const[o,u]=R.useState(null);return r?a.jsx(wC,{}):e.length===0?a.jsx(_C,{message:"Aucune recommandation trouvée"}):a.jsxs(bC,{children:[a.jsx(yC,{children:e.map(c=>{const s=new Date(c.created_at).toLocaleDateString("fr-FR"),d=`${c.recommender_first_name} ${c.recommender_last_name}`.trim();return a.jsxs("div",{role:"button",tabIndex:0,className:"overflow-visible rounded-lg border border-gray-200 bg-white p-3 shadow-sm outline-none ring-brand-700 focus-visible:ring-2",onClick:()=>t(c),onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),t(c))},children:[a.jsxs("div",{className:"flex min-w-0 gap-2 overflow-visible",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"truncate text-sm font-semibold text-ink-900",title:c.recommended_full_name||void 0,children:c.recommended_full_name||"—"}),a.jsx("p",{className:"truncate text-xs text-ink-500",title:c.recommended_email||void 0,children:c.recommended_email||"—"})]}),a.jsx(ej,{recommendation:c,openMenuId:o,setOpenMenuId:u,onViewDetails:t,onTreat:n,onDelete:l,canDelete:i,compact:!0})]}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[a.jsx(_l,{status:c.status,compact:!0}),a.jsx("span",{className:"text-xs text-ink-500",children:s})]}),d?a.jsxs("p",{className:"mt-1 truncate text-xs text-ink-500",title:d,children:["Par ",d]}):null]},c.id)})}),a.jsx(vC,{children:a.jsxs("table",{className:"w-full min-w-0 table-fixed border-collapse",children:[a.jsxs("colgroup",{children:[a.jsx("col",{style:{width:"13%"}}),a.jsx("col",{style:{width:"16%"}}),a.jsx("col",{style:{width:"10%"}}),a.jsx("col",{style:{width:"8%"}}),a.jsx("col",{style:{width:"12%"}}),a.jsx("col",{style:{width:"13%"}}),a.jsx("col",{style:{width:"10%"}}),a.jsx("col",{style:{width:"9%"}}),a.jsx("col",{style:{width:"9%"}})]}),a.jsx("thead",{className:"bg-brand-50",children:a.jsxs("tr",{children:[a.jsx("th",{className:mn,children:"Recommandé"}),a.jsx("th",{className:mn,children:"Email"}),a.jsx("th",{className:mn,children:"Profession"}),a.jsx("th",{className:mn,children:"Pays"}),a.jsx("th",{className:mn,children:"Recommandeur"}),a.jsx("th",{className:mn,children:"Événement"}),a.jsx("th",{className:mn,children:"Statut"}),a.jsx("th",{className:mn,children:"Créé"}),a.jsx("th",{className:`${mn} text-right`,children:"Actions"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-200 bg-white",children:e.map(c=>{const s=`${c.recommender_first_name} ${c.recommender_last_name}`.trim();return a.jsxs("tr",{className:"cursor-pointer hover:bg-brand-50",onClick:()=>t(c),children:[a.jsxs("td",{className:la,children:[a.jsx("div",{className:"truncate text-xs font-medium text-ink-900 sm:text-sm",title:c.recommended_full_name||void 0,children:c.recommended_full_name||"—"}),a.jsx("div",{className:"truncate text-[10px] text-ink-500 sm:text-xs",children:c.recommended_gender==="homme"?"Homme":"Femme"})]}),a.jsx("td",{className:la,children:a.jsx("div",{className:"truncate text-xs text-ink-500 sm:text-sm",title:c.recommended_email||void 0,children:c.recommended_email||"-"})}),a.jsx("td",{className:la,children:a.jsx("div",{className:"truncate text-xs text-ink-500 sm:text-sm",title:c.recommended_profession||void 0,children:c.recommended_profession||"-"})}),a.jsx("td",{className:la,children:a.jsx("div",{className:"truncate text-xs text-ink-500 sm:text-sm",title:c.recommended_residence_country||void 0,children:c.recommended_residence_country||"-"})}),a.jsx("td",{className:la,children:a.jsx("div",{className:"truncate text-xs text-ink-500 sm:text-sm",title:s||void 0,children:s||"-"})}),a.jsx("td",{className:la,children:a.jsx("div",{className:"truncate text-xs text-ink-500 sm:text-sm",title:c.event?.name||void 0,children:c.event?.name||"-"})}),a.jsx("td",{className:la,children:a.jsx(_l,{status:c.status,compact:!0})}),a.jsx("td",{className:`${la} whitespace-nowrap text-xs text-ink-500 sm:text-sm`,children:new Date(c.created_at).toLocaleDateString("fr-FR")}),a.jsx("td",{className:`${la} whitespace-nowrap px-1 text-right sm:px-2`,children:a.jsx(ej,{recommendation:c,openMenuId:o,setOpenMenuId:u,onViewDetails:t,onTreat:n,onDelete:l,canDelete:i})})]},c.id)})})]})})]})}function $B({registration:e,isOpen:r,onClose:t,onUpdateStatus:n,canUpdateStatus:l=!1,onResetParticipantPassword:i}){return!r||!e?null:a.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:a.jsxs("div",{className:"flex items-center justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:block sm:p-0",children:[a.jsx("div",{className:"fixed inset-0 transition-opacity bg-gray-500 bg-opacity-75",onClick:t}),a.jsxs("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-4xl sm:w-full",children:[a.jsxs("div",{className:"bg-white px-6 pt-6 pb-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("h3",{className:"text-2xl font-semibold text-ink-900",children:["Inscription #",e.id]}),a.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 transition-colors",children:a.jsx(mr,{size:24})})]}),l&&n||i&&Ky(e)?a.jsxs("div",{className:"mb-4 flex flex-wrap gap-2",children:[l&&n&&a.jsx(De,{variant:"primary",onClick:()=>{n(e)},children:"Changer le statut"}),i&&Ky(e)&&a.jsx(De,{variant:"outline",onClick:()=>i(e),children:"Initialiser le mot de passe participant"})]}):null,a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-lg font-semibold text-ink-900 mb-3",children:"Informations personnelles"}),a.jsxs("dl",{className:"space-y-2",children:[a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Nom complet"}),a.jsxs("dd",{className:"text-sm text-ink-900",children:[e.first_name," ",e.last_name]})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Email"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.email})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Téléphone"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.phone||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Pays"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.country||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Ville"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.city||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Nationalité"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.nationality||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Organisation"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.organization||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Poste"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.position||"-"})]})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-lg font-semibold text-ink-900 mb-3",children:"Informations inscription"}),a.jsxs("dl",{className:"space-y-2",children:[a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Statut"}),a.jsx("dd",{className:"text-sm",children:a.jsx(_l,{status:e.status})})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Événement"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.event?.name||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Formule"}),a.jsxs("dd",{className:"text-sm text-ink-900",children:[e.pricing_plan?.code," - ",e.pricing_plan?.title||"-"]})]}),e.pricing_plan?.code==="D"&&(e.spouse_fullname||e.spouse_email||e.spouse_haggai_id)&&a.jsxs(a.Fragment,{children:[e.spouse_fullname&&a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Nom du conjoint / de la conjointe"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.spouse_fullname})]}),e.spouse_email&&a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Email du conjoint / de la conjointe"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.spouse_email})]}),e.spouse_haggai_id&&a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Haggai ID / Année de HLE (conjoint)"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.spouse_haggai_id})]})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Montant dû (XOF)"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.amount_due_xof?.toLocaleString("fr-FR")||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Montant dû (EUR)"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.amount_due_eur?.toLocaleString("fr-FR")||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Date de création"}),a.jsx("dd",{className:"text-sm text-ink-900",children:new Date(e.created_at).toLocaleString("fr-FR")})]}),e.submitted_at&&a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Date de soumission"}),a.jsx("dd",{className:"text-sm text-ink-900",children:new Date(e.submitted_at).toLocaleString("fr-FR")})]}),e.paid_at&&a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Date de paiement"}),a.jsx("dd",{className:"text-sm text-ink-900",children:new Date(e.paid_at).toLocaleString("fr-FR")})]}),e.is_public_registration&&a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Type"}),a.jsx("dd",{className:"text-sm text-ink-900",children:a.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded bg-blue-100 text-blue-700 text-xs",children:"Inscription publique"})})]})]})]}),e.event?.event_type==="seminar"&&a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("h4",{className:"text-lg font-semibold text-ink-900 mb-3",children:"Informations Séminaire"}),a.jsxs("dl",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-2",children:[a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Souhaite participer"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_want_to_participate==="oui"?"Oui":e.seminar_want_to_participate==="non"?"Non":"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Église ou organisation"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_church_organization||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Rôle/Ministère"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_role_ministry||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Situation matrimoniale"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_marital_status==="marie"?"Marié(e)":e.seminar_marital_status==="non_marie"?"Non marié(e)":"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Âge"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_age??"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Genre"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_gender==="homme"?"Homme":e.seminar_gender==="femme"?"Femme":"-"})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Question ou préoccupation"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_question_or_concern||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Date de naissance"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_date_naissance?new Date(e.seminar_date_naissance).toLocaleDateString("fr-FR"):"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Contact d'urgence (nom et lien)"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_contact_urgence_nom_lien||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Niveau d'études"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_niveau_etudes==="primaire"?"Primaire":e.seminar_niveau_etudes==="secondaire_2"?"Secondaire 2e cycle":e.seminar_niveau_etudes==="universitaire"?"Universitaire":e.seminar_niveau_etudes||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Domaines d'étude"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_domaines_etude?.length?e.seminar_domaines_etude.join(", "):"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Domaine d'étude (autre)"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_domaine_etude_autre||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Niveau de français"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_niveau_francais==="natif"?"Natif":e.seminar_niveau_francais==="avance"?"Avancé":e.seminar_niveau_francais==="intermediaire"?"Intermédiaire":e.seminar_niveau_francais==="faible"?"Faible":e.seminar_niveau_francais||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Besoin lettre d'absence"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_besoin_lettre_absence==="oui"?"Oui":e.seminar_besoin_lettre_absence==="non"?"Non":"-"})]}),e.seminar_besoin_lettre_absence==="oui"&&a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Détails lettre d'absence"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_besoin_lettre_details||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Informations santé"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_sante_details||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Régime sans sel"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_regime_sans_sel==="oui"?"Oui":e.seminar_regime_sans_sel==="non"?"Non":"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Confession religieuse"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_confession_religieuse==="musulmane"?"Musulmane":e.seminar_confession_religieuse==="catholique"?"Catholique":e.seminar_confession_religieuse==="protestante"?"Protestante":e.seminar_confession_religieuse==="pentecotiste"?"Pentecôtiste":e.seminar_confession_religieuse==="evangelique"?"Évangélique":e.seminar_confession_religieuse==="autre"?"Autre":e.seminar_confession_religieuse||"-"})]}),e.seminar_confession_religieuse_autre?a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Spécification (confession)"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_confession_religieuse_autre})]}):null,a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Attentes"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_fardeau_transformation||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Recommandé par"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_recommande_par||"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Engagements"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_engagements?.length?e.seminar_engagements.join(", "):"-"})]}),a.jsxs("div",{children:[a.jsx("dt",{className:"text-sm font-medium text-ink-500",children:"Engagements (autre)"}),a.jsx("dd",{className:"text-sm text-ink-900",children:e.seminar_engagements_autre||"-"})]})]})]})]}),e.status_changes&&e.status_changes.length>0&&a.jsxs("div",{className:"mt-6",children:[a.jsx("h4",{className:"text-lg font-semibold text-ink-900 mb-3",children:"Historique des changements"}),a.jsx("div",{className:"space-y-2",children:e.status_changes.map(o=>a.jsx("div",{className:"bg-brand-50 rounded-lg p-4 border-l-4 border-brand-700",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("span",{className:"text-sm font-medium text-ink-900",children:[o.from_status," → ",o.to_status]}),o.notes&&a.jsx("p",{className:"text-sm text-ink-500 mt-1",children:o.notes})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-xs text-ink-500",children:o.actor?.name||"Système"}),a.jsx("p",{className:"text-xs text-ink-500",children:new Date(o.created_at).toLocaleString("fr-FR")})]})]})},o.id))})]})]}),a.jsx("div",{className:"bg-gray-50 px-6 py-4 flex justify-end",children:a.jsx(De,{variant:"secondary",onClick:t,children:"Fermer"})})]})]})})}function UB({registration:e,onClose:r,onSuccess:t}){const[n,l]=R.useState(""),[i,o]=R.useState(""),[u,c]=R.useState(!1),[s,d]=R.useState(null),[f,h]=R.useState({}),m=`${e.first_name} ${e.last_name}`.trim()||e.email,p=async x=>{if(x.preventDefault(),d(null),h({}),n.length<8){h({password:"Le mot de passe doit contenir au moins 8 caractères."});return}if(n!==i){h({password_confirmation:"Les deux mots de passe ne correspondent pas."});return}c(!0);try{await _a.resetParticipantPassword(e.id,{password:n,password_confirmation:i}),t()}catch(g){const y=g;if(d(y.data?.message??"Erreur lors de l’initialisation du mot de passe."),y.data?.errors){const v={};for(const[_,C]of Object.entries(y.data.errors))v[_]=Array.isArray(C)?C[0]:String(C);h(v)}}finally{c(!1)}};return a.jsx("div",{className:"fixed inset-0 z-[210] flex items-center justify-center p-4 bg-black/50",children:a.jsxs("div",{className:"bg-white rounded-xl shadow-xl max-w-md w-full p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg font-semibold text-ink-900",children:"Initialiser le mot de passe participant"}),a.jsx("button",{type:"button",onClick:r,className:"p-1 rounded hover:bg-gray-100","aria-label":"Fermer",children:a.jsx(mr,{size:20})})]}),a.jsxs("p",{className:"text-ink-600 text-sm mb-4",children:["Définir un mot de passe provisoire pour ",a.jsx("strong",{children:m})," (",e.email,"). Les sessions actives seront déconnectées ; à la ",a.jsx("strong",{children:"première"})," connexion suivante, le participant devra"," ",a.jsx("strong",{children:"obligatoirement"})," choisir un nouveau mot de passe."]}),a.jsxs("form",{onSubmit:p,children:[s&&a.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg text-sm text-red-700",children:s}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{htmlFor:"reset-participant-password",className:"block text-sm font-medium text-ink-700 mb-1",children:"Nouveau mot de passe"}),a.jsx("input",{id:"reset-participant-password",type:"password",value:n,onChange:x=>l(x.target.value),minLength:8,autoComplete:"new-password",className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm",placeholder:"Min. 8 caractères"}),f.password&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:f.password})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{htmlFor:"reset-participant-password-confirm",className:"block text-sm font-medium text-ink-700 mb-1",children:"Confirmer le mot de passe"}),a.jsx("input",{id:"reset-participant-password-confirm",type:"password",value:i,onChange:x=>o(x.target.value),autoComplete:"new-password",className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm",placeholder:"Confirmer"}),f.password_confirmation&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:f.password_confirmation})]}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(De,{type:"button",variant:"outline",onClick:r,disabled:u,children:"Annuler"}),a.jsx(De,{type:"submit",variant:"primary",disabled:u,children:u?"Enregistrement…":"Initialiser"})]})]})]})})}const Ih=[{value:"draft",label:"Brouillon"},{value:"submitted",label:"Soumis"},{value:"pending_payment",label:"En attente de paiement"},{value:"correction",label:"Dossier en correction"},{value:"paid",label:"Payé"},{value:"rejected",label:"Rejeté"},{value:"cancelled",label:"Annulé"},{value:"refunded",label:"Remboursé"}];function VB({registration:e,isOpen:r,onClose:t,onSuccess:n,canSendToCorrection:l=!1}){const[i,o]=R.useState("draft"),[u,c]=R.useState(""),[s,d]=R.useState(!1),[f,h]=R.useState(null),m=R.useMemo(()=>e?e.status==="correction"?Ih.filter(_=>_.value==="pending_payment"):e.status==="pending_payment"?Ih.filter(_=>_.value!=="submitted"&&(_.value!=="correction"||l)):Ih:Ih,[e,l]),x=i==="correction",g=10;R.useEffect(()=>{e&&(o(e.status),c(""),h(null))},[e,r]),R.useEffect(()=>{e&&m.length>0&&!m.some(_=>_.value===i)&&o(m[0].value)},[m,e,i]);const y=async _=>{if(_.preventDefault(),!!e){if(x&&(!u.trim()||u.trim().lengtho(_.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent",required:!0,children:m.map(_=>a.jsx("option",{value:_.value,children:_.label},_.value))})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-2",children:x?a.jsxs(a.Fragment,{children:["Raison de la mise en correction ",a.jsx("span",{className:"text-red-500",children:"*"})," (min. 10 caractères)"]}):"Notes (optionnel)"}),a.jsx("textarea",{value:u,onChange:_=>c(_.target.value),rows:4,maxLength:1e3,required:x,minLength:x?g:void 0,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent",placeholder:x?"Indiquez la raison de la mise en correction...":"Ajouter des notes sur ce changement de statut..."}),a.jsxs("p",{className:"text-xs text-ink-500 mt-1",children:[u.length,"/1000 caractères",x&&u.trim().length>0&&u.trim().length{if(e){const g=e,y=g.seminar_date_naissance,v=y&&typeof y=="string"&&y.includes("T")?y.split("T")[0]:y?String(y).slice(0,10):"",_=g.seminar_domaines_etude,C=g.seminar_engagements;s({first_name:e.first_name||"",last_name:e.last_name||"",email:e.email||"",phone:e.phone||"",country:e.country||"",city:e.city||"",organization:e.organization||"",position:e.position||"",nationality:e.nationality||"",is_haggai_leader:e.is_haggai_leader||!1,haggai_id:typeof g.haggai_id=="string"?g.haggai_id:"",payment_method_selected:e.payment_method_selected||"",currency_selected:e.currency_selected||"",amount_due_xof:e.amount_due_xof?.toString()||"",amount_due_eur:e.amount_due_eur?.toString()||"",pricing_plan_id:(typeof g.pricing_plan_id=="number"?String(g.pricing_plan_id):"")||(e.pricing_plan?.id!=null?String(e.pricing_plan.id):""),ouaga_resident_confirmed:e.ouaga_resident_confirmed||!1,spouse_fullname:e.spouse_fullname||"",spouse_email:typeof g.spouse_email=="string"?g.spouse_email:"",spouse_haggai_id:typeof g.spouse_haggai_id=="string"?g.spouse_haggai_id:"",seminar_intent:e.seminar_intent||"",seminar_want_to_participate:typeof g.seminar_want_to_participate=="string"?g.seminar_want_to_participate:"",seminar_church_organization:typeof g.seminar_church_organization=="string"?g.seminar_church_organization:"",seminar_role_ministry:typeof g.seminar_role_ministry=="string"?g.seminar_role_ministry:"",seminar_marital_status:typeof g.seminar_marital_status=="string"?g.seminar_marital_status:"",seminar_age:g.seminar_age!=null?String(g.seminar_age):"",seminar_gender:typeof g.seminar_gender=="string"?g.seminar_gender:"",seminar_question_or_concern:e.seminar_question_or_concern||"",seminar_date_naissance:v,seminar_contact_urgence_nom_lien:typeof g.seminar_contact_urgence_nom_lien=="string"?g.seminar_contact_urgence_nom_lien:"",seminar_niveau_etudes:typeof g.seminar_niveau_etudes=="string"?g.seminar_niveau_etudes:"",seminar_domaines_etude:Array.isArray(_)?_.join(", "):"",seminar_domaine_etude_autre:typeof g.seminar_domaine_etude_autre=="string"?g.seminar_domaine_etude_autre:"",seminar_niveau_francais:typeof g.seminar_niveau_francais=="string"?g.seminar_niveau_francais:"",seminar_besoin_lettre_absence:typeof g.seminar_besoin_lettre_absence=="string"?g.seminar_besoin_lettre_absence:"",seminar_besoin_lettre_details:typeof g.seminar_besoin_lettre_details=="string"?g.seminar_besoin_lettre_details:"",seminar_sante_details:typeof g.seminar_sante_details=="string"?g.seminar_sante_details:"",seminar_regime_sans_sel:typeof g.seminar_regime_sans_sel=="string"?g.seminar_regime_sans_sel:"",seminar_confession_religieuse:typeof g.seminar_confession_religieuse=="string"?g.seminar_confession_religieuse:"",seminar_confession_religieuse_autre:typeof g.seminar_confession_religieuse_autre=="string"?g.seminar_confession_religieuse_autre:"",seminar_fardeau_transformation:typeof g.seminar_fardeau_transformation=="string"?g.seminar_fardeau_transformation:"",seminar_recommande_par:typeof g.seminar_recommande_par=="string"?g.seminar_recommande_par:"",seminar_engagements:Array.isArray(C)?C.join(", "):"",seminar_engagements_autre:typeof g.seminar_engagements_autre=="string"?g.seminar_engagements_autre:""}),u(null)}},[e,r]);const d=e?.event?.event_type==="summit",f=e?.event?.event_type==="seminar",h=e?.status==="correction",m=e?.event?.slug??null,{plans:p}=hC(d&&h?m:null),x=async g=>{if(g.preventDefault(),!!e){i(!0),u(null);try{const y={first_name:c.first_name.trim(),last_name:c.last_name.trim(),email:c.email.trim().toLowerCase(),phone:c.phone.trim(),country:c.country.trim(),city:c.city.trim()||void 0,organization:c.organization.trim()||void 0,position:c.position.trim()||void 0,nationality:c.nationality.trim()||void 0,is_haggai_leader:c.is_haggai_leader,haggai_id:c.haggai_id.trim()||void 0,payment_method_selected:c.payment_method_selected||void 0};h&&(c.pricing_plan_id&&(y.pricing_plan_id=Number(c.pricing_plan_id)),y.currency_selected=c.currency_selected||void 0,y.amount_due_xof=c.amount_due_xof?parseFloat(c.amount_due_xof):void 0,y.amount_due_eur=c.amount_due_eur?parseFloat(c.amount_due_eur):void 0),d&&(y.ouaga_resident_confirmed=c.ouaga_resident_confirmed,y.spouse_fullname=c.spouse_fullname.trim()||void 0,y.spouse_email=c.spouse_email.trim()||void 0,y.spouse_haggai_id=c.spouse_haggai_id.trim()||void 0),f&&(y.seminar_intent=c.seminar_intent||void 0,y.seminar_want_to_participate=c.seminar_want_to_participate||void 0,y.seminar_church_organization=c.seminar_church_organization.trim()||void 0,y.seminar_role_ministry=c.seminar_role_ministry.trim()||void 0,y.seminar_marital_status=c.seminar_marital_status||void 0,y.seminar_age=c.seminar_age?parseInt(c.seminar_age):void 0,y.seminar_gender=c.seminar_gender||void 0,y.seminar_question_or_concern=c.seminar_question_or_concern.trim()||void 0,y.seminar_date_naissance=c.seminar_date_naissance?.trim()||void 0,y.seminar_contact_urgence_nom_lien=c.seminar_contact_urgence_nom_lien.trim()||void 0,y.seminar_niveau_etudes=c.seminar_niveau_etudes||void 0,y.seminar_domaines_etude=c.seminar_domaines_etude?.trim()?c.seminar_domaines_etude.split(",").map(v=>v.trim()).filter(Boolean):void 0,y.seminar_domaine_etude_autre=c.seminar_domaine_etude_autre.trim()||void 0,y.seminar_niveau_francais=c.seminar_niveau_francais||void 0,y.seminar_besoin_lettre_absence=c.seminar_besoin_lettre_absence||void 0,y.seminar_besoin_lettre_details=c.seminar_besoin_lettre_details.trim()||void 0,y.seminar_sante_details=c.seminar_sante_details.trim()||void 0,y.seminar_regime_sans_sel=c.seminar_regime_sans_sel||void 0,y.seminar_confession_religieuse=c.seminar_confession_religieuse||void 0,y.seminar_confession_religieuse_autre=c.seminar_confession_religieuse==="autre"?c.seminar_confession_religieuse_autre.trim()||void 0:null,y.seminar_fardeau_transformation=c.seminar_fardeau_transformation.trim()||void 0,y.seminar_recommande_par=c.seminar_recommande_par.trim()||void 0,y.seminar_engagements=c.seminar_engagements?.trim()?c.seminar_engagements.split(",").map(v=>v.trim()).filter(Boolean):void 0,y.seminar_engagements_autre=c.seminar_engagements_autre.trim()||void 0),await _a.update(e.id,y),n(),t()}catch(y){if(y instanceof Vt)if(y.status===422&&y.data.errors){const v=Object.values(y.data.errors).flat();u(v.join(", "))}else y.status===403?u("Vous n'avez pas la permission de modifier cette inscription"):u(y.data.message||"Une erreur est survenue");else u("Une erreur inattendue est survenue")}finally{i(!1)}}};return!r||!e?null:a.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:a.jsxs("div",{className:"flex items-center justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:block sm:p-0",children:[a.jsx("div",{className:"fixed inset-0 transition-opacity bg-gray-500 bg-opacity-75",onClick:t}),a.jsx("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-4xl sm:w-full max-h-[90vh] overflow-y-auto",children:a.jsxs("div",{className:"bg-white px-6 pt-6 pb-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("h3",{className:"text-xl font-semibold text-ink-900",children:["Modifier l'inscription #",e.id]}),a.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 transition-colors",children:a.jsx(mr,{size:24})})]}),a.jsxs("form",{onSubmit:x,className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-lg font-semibold text-ink-900 mb-3",children:"Informations personnelles"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:["Prénom ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:c.first_name,onChange:g=>s({...c,first_name:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:["Nom ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:c.last_name,onChange:g=>s({...c,last_name:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:["Email ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"email",value:c.email,onChange:g=>s({...c,email:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Téléphone"}),a.jsx("input",{type:"text",value:c.phone,onChange:g=>s({...c,phone:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Pays"}),a.jsx("input",{type:"text",value:c.country,onChange:g=>s({...c,country:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Ville"}),a.jsx("input",{type:"text",value:c.city,onChange:g=>s({...c,city:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Organisation"}),a.jsx("input",{type:"text",value:c.organization,onChange:g=>s({...c,organization:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Poste"}),a.jsx("input",{type:"text",value:c.position,onChange:g=>s({...c,position:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Nationalité"}),a.jsx("input",{type:"text",value:c.nationality,onChange:g=>s({...c,nationality:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"flex items-center gap-2 mt-6",children:[a.jsx("input",{type:"checkbox",checked:c.is_haggai_leader,onChange:g=>s({...c,is_haggai_leader:g.target.checked}),className:"rounded"}),a.jsx("span",{className:"text-sm font-medium text-ink-500",children:"Leader Haggai"})]}),c.is_haggai_leader&&a.jsx("input",{type:"text",value:c.haggai_id,onChange:g=>s({...c,haggai_id:g.target.value}),placeholder:"Haggai ID ou Année de HLE",className:"w-full mt-2 px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-lg font-semibold text-ink-900 mb-3",children:"Informations paiement"}),!h&&a.jsx("p",{className:"text-sm text-ink-500 mb-3",children:"La formule, la devise et le montant ne peuvent être modifiés que lorsque le dossier est en statut « Dossier en correction »."}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[d&&a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Formule (solo/couple)"}),a.jsxs("select",{value:c.pricing_plan_id,onChange:g=>s({...c,pricing_plan_id:g.target.value}),disabled:!h,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent disabled:bg-gray-100 disabled:cursor-not-allowed",children:[a.jsx("option",{value:"",children:"Sélectionner..."}),p.map(g=>a.jsxs("option",{value:g.id,children:[g.code," - ",g.title," (",g.price_xof," XOF / ",g.price_eur," EUR)"]},g.id))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Méthode de paiement"}),a.jsxs("select",{value:c.payment_method_selected,onChange:g=>s({...c,payment_method_selected:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent",children:[a.jsx("option",{value:"",children:"Sélectionner..."}),a.jsx("option",{value:"card_visa",children:"Carte de crédit (Visa)"}),a.jsx("option",{value:"paypal",children:"PayPal"}),a.jsx("option",{value:"mobile_money",children:"Mobile Money"}),a.jsx("option",{value:"national_office",children:"Bureau National"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Devise"}),a.jsxs("select",{value:c.currency_selected,onChange:g=>s({...c,currency_selected:g.target.value}),disabled:!h,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent disabled:bg-gray-100 disabled:cursor-not-allowed",children:[a.jsx("option",{value:"",children:"Sélectionner..."}),a.jsx("option",{value:"XOF",children:"XOF"}),a.jsx("option",{value:"EUR",children:"EUR"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Montant dû (XOF)"}),a.jsx("input",{type:"number",step:"0.01",value:c.amount_due_xof,onChange:g=>s({...c,amount_due_xof:g.target.value}),disabled:!h,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent disabled:bg-gray-100 disabled:cursor-not-allowed"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Montant dû (EUR)"}),a.jsx("input",{type:"number",step:"0.01",value:c.amount_due_eur,onChange:g=>s({...c,amount_due_eur:g.target.value}),disabled:!h,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent disabled:bg-gray-100 disabled:cursor-not-allowed"})]})]})]}),d&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-lg font-semibold text-ink-900 mb-3",children:"Informations Sommet"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsx("div",{children:a.jsxs("label",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"checkbox",checked:c.ouaga_resident_confirmed,onChange:g=>s({...c,ouaga_resident_confirmed:g.target.checked}),className:"rounded"}),a.jsx("span",{className:"text-sm font-medium text-ink-500",children:"Résident à Ouaga"})]})}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Nom du conjoint / de la conjointe"}),a.jsx("input",{type:"text",value:c.spouse_fullname,onChange:g=>s({...c,spouse_fullname:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Email du conjoint / de la conjointe"}),a.jsx("input",{type:"email",value:c.spouse_email,onChange:g=>s({...c,spouse_email:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Haggai ID / Année de HLE (conjoint / conjointe)"}),a.jsx("input",{type:"text",value:c.spouse_haggai_id,onChange:g=>s({...c,spouse_haggai_id:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]})]})]}),f&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-lg font-semibold text-ink-900 mb-3",children:"Informations Séminaire"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Veut participer"}),a.jsxs("select",{value:c.seminar_want_to_participate,onChange:g=>s({...c,seminar_want_to_participate:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent",children:[a.jsx("option",{value:"",children:"Sélectionner..."}),a.jsx("option",{value:"oui",children:"Oui"}),a.jsx("option",{value:"non",children:"Non"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Église/Organisation"}),a.jsx("input",{type:"text",value:c.seminar_church_organization,onChange:g=>s({...c,seminar_church_organization:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Rôle/Ministère"}),a.jsx("input",{type:"text",value:c.seminar_role_ministry,onChange:g=>s({...c,seminar_role_ministry:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Situation matrimoniale"}),a.jsxs("select",{value:c.seminar_marital_status,onChange:g=>s({...c,seminar_marital_status:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent",children:[a.jsx("option",{value:"",children:"Sélectionner..."}),a.jsx("option",{value:"marie",children:"Marié(e)"}),a.jsx("option",{value:"non_marie",children:"Non marié(e)"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Âge"}),a.jsx("input",{type:"number",min:"1",max:"120",value:c.seminar_age,onChange:g=>s({...c,seminar_age:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Genre"}),a.jsxs("select",{value:c.seminar_gender,onChange:g=>s({...c,seminar_gender:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent",children:[a.jsx("option",{value:"",children:"Sélectionner..."}),a.jsx("option",{value:"homme",children:"Homme"}),a.jsx("option",{value:"femme",children:"Femme"})]})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Question ou préoccupation"}),a.jsx("textarea",{value:c.seminar_question_or_concern,onChange:g=>s({...c,seminar_question_or_concern:g.target.value}),rows:3,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Date de naissance"}),a.jsx("input",{type:"date",value:c.seminar_date_naissance,onChange:g=>s({...c,seminar_date_naissance:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Contact d'urgence (nom et lien)"}),a.jsx("input",{type:"text",value:c.seminar_contact_urgence_nom_lien,onChange:g=>s({...c,seminar_contact_urgence_nom_lien:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Niveau d'études"}),a.jsxs("select",{value:c.seminar_niveau_etudes,onChange:g=>s({...c,seminar_niveau_etudes:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent",children:[a.jsx("option",{value:"",children:"Sélectionner..."}),a.jsx("option",{value:"primaire",children:"Primaire"}),a.jsx("option",{value:"secondaire_2",children:"Secondaire 2e cycle"}),a.jsx("option",{value:"universitaire",children:"Universitaire"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Domaines d'étude (séparés par des virgules)"}),a.jsx("input",{type:"text",value:c.seminar_domaines_etude,onChange:g=>s({...c,seminar_domaines_etude:g.target.value}),placeholder:"ex. Théologie, Éducation",className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Domaine d'étude (autre)"}),a.jsx("input",{type:"text",value:c.seminar_domaine_etude_autre,onChange:g=>s({...c,seminar_domaine_etude_autre:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Niveau de français"}),a.jsxs("select",{value:c.seminar_niveau_francais,onChange:g=>s({...c,seminar_niveau_francais:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent",children:[a.jsx("option",{value:"",children:"Sélectionner..."}),a.jsx("option",{value:"natif",children:"Natif"}),a.jsx("option",{value:"avance",children:"Avancé"}),a.jsx("option",{value:"intermediaire",children:"Intermédiaire"}),a.jsx("option",{value:"faible",children:"Faible"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Besoin lettre d'absence"}),a.jsxs("select",{value:c.seminar_besoin_lettre_absence,onChange:g=>s({...c,seminar_besoin_lettre_absence:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent",children:[a.jsx("option",{value:"",children:"Sélectionner..."}),a.jsx("option",{value:"oui",children:"Oui"}),a.jsx("option",{value:"non",children:"Non"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Détails lettre d'absence"}),a.jsx("input",{type:"text",value:c.seminar_besoin_lettre_details,onChange:g=>s({...c,seminar_besoin_lettre_details:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Informations santé"}),a.jsx("input",{type:"text",value:c.seminar_sante_details,onChange:g=>s({...c,seminar_sante_details:g.target.value}),placeholder:"Indiquez « Aucun » si applicable",className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Régime sans sel"}),a.jsxs("select",{value:c.seminar_regime_sans_sel,onChange:g=>s({...c,seminar_regime_sans_sel:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent",children:[a.jsx("option",{value:"",children:"Sélectionner..."}),a.jsx("option",{value:"oui",children:"Oui"}),a.jsx("option",{value:"non",children:"Non"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Confession religieuse"}),a.jsxs("select",{value:c.seminar_confession_religieuse,onChange:g=>{const y=g.target.value;s({...c,seminar_confession_religieuse:y,seminar_confession_religieuse_autre:y==="autre"?c.seminar_confession_religieuse_autre:""})},className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent",children:[a.jsx("option",{value:"",children:"Sélectionner..."}),a.jsx("option",{value:"musulmane",children:"Musulmane"}),a.jsx("option",{value:"catholique",children:"Catholique"}),a.jsx("option",{value:"protestante",children:"Protestante"}),a.jsx("option",{value:"pentecotiste",children:"Pentecôtiste"}),a.jsx("option",{value:"evangelique",children:"Évangélique"}),a.jsx("option",{value:"autre",children:"Autre"})]})]}),c.seminar_confession_religieuse==="autre"&&a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Spécifiez :"}),a.jsx("input",{type:"text",value:c.seminar_confession_religieuse_autre,onChange:g=>s({...c,seminar_confession_religieuse_autre:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Attentes"}),a.jsx("textarea",{value:c.seminar_fardeau_transformation,onChange:g=>s({...c,seminar_fardeau_transformation:g.target.value}),rows:2,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Recommandé par"}),a.jsx("input",{type:"text",value:c.seminar_recommande_par,onChange:g=>s({...c,seminar_recommande_par:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Engagements (séparés par des virgules)"}),a.jsx("input",{type:"text",value:c.seminar_engagements,onChange:g=>s({...c,seminar_engagements:g.target.value}),placeholder:"ex. Église locale, Évangélisation",className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-1",children:"Engagements (autre)"}),a.jsx("input",{type:"text",value:c.seminar_engagements_autre,onChange:g=>s({...c,seminar_engagements_autre:g.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-700 focus:border-transparent"})]})]})]}),o&&a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:a.jsx("p",{className:"text-sm text-red-700",children:o})}),a.jsxs("div",{className:"flex items-center justify-end gap-3 pt-4 border-t",children:[a.jsx(De,{type:"button",variant:"ghost",onClick:t,disabled:l,children:"Annuler"}),a.jsx(De,{type:"submit",variant:"primary",disabled:l,children:l?"Enregistrement...":"Enregistrer"})]})]})]})})]})})}function HB({registration:e,isOpen:r,onClose:t,onSuccess:n}){const[l,i]=R.useState(!1),[o,u]=R.useState(null),c=async()=>{if(e){i(!0),u(null);try{await _a.delete(e.id),n(),t()}catch(s){s instanceof Vt?s.status===403?u("Vous n'avez pas la permission de supprimer cette inscription"):u(s.data.message||"Une erreur est survenue lors de la suppression"):u("Une erreur inattendue est survenue")}finally{i(!1)}}};return!r||!e?null:a.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:a.jsxs("div",{className:"flex items-center justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:block sm:p-0",children:[a.jsx("div",{className:"fixed inset-0 transition-opacity bg-gray-500 bg-opacity-75",onClick:t}),a.jsx("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:a.jsxs("div",{className:"bg-white px-6 pt-6 pb-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-xl font-semibold text-ink-900",children:"Supprimer l'inscription"}),a.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 transition-colors",children:a.jsx(mr,{size:24})})]}),a.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx("div",{className:"flex items-center justify-center w-12 h-12 rounded-full bg-red-100",children:a.jsx(wF,{className:"w-6 h-6 text-red-600"})})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-lg font-medium text-ink-900 mb-2",children:"Êtes-vous sûr de vouloir supprimer cette inscription ?"}),a.jsxs("p",{className:"text-sm text-ink-500 mb-2",children:["Cette action est irréversible. L'inscription #",e.id," de"," ",a.jsxs("strong",{children:[e.first_name," ",e.last_name]})," sera définitivement supprimée."]}),e.event&&a.jsxs("p",{className:"text-sm text-ink-500",children:["Événement: ",a.jsx("strong",{children:e.event.name})]})]})]}),o&&a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3 mb-4",children:a.jsx("p",{className:"text-sm text-red-700",children:o})}),a.jsxs("div",{className:"flex items-center justify-end gap-3 pt-4 border-t",children:[a.jsx(De,{type:"button",variant:"ghost",onClick:t,disabled:l,children:"Annuler"}),a.jsx(De,{type:"button",variant:"primary",onClick:c,disabled:l,className:"bg-red-600 hover:bg-red-700 text-white",children:l?"Suppression...":"Supprimer"})]})]})})]})})}const WB=[{value:"pending",label:"En attente"},{value:"contacted",label:"Contacté"},{value:"accepted",label:"Accepté"},{value:"rejected",label:"Rejeté"}];function KB({recommendation:e,isOpen:r,onClose:t,onSuccess:n}){const[l,i]=R.useState("pending"),[o,u]=R.useState(""),[c,s]=R.useState(""),[d,f]=R.useState(""),[h,m]=R.useState(!1),[p,x]=R.useState(!1),[g,y]=R.useState("status"),[v,_]=R.useState(!1),[C,M]=R.useState(null),[T,U]=R.useState(null);R.useEffect(()=>{e&&(i(e.status),u(e.notes||""),s(""),f(""),m(!1),x(!1),M(null),U(null),y("status"))},[e,r]);const F=async W=>{if(W.preventDefault(),!!e){_(!0),M(null),U(null);try{await Sd.updateStatus(e.id,{status:l,notes:o.trim()||void 0}),U("Statut mis à jour avec succès"),setTimeout(()=>{n(),t()},1e3)}catch(K){if(K instanceof Vt)if(K.status===422&&K.data.errors){const $=K.data.errors.status?.[0];M($||K.data.message||"Erreur de validation")}else K.status===403?M("Vous n'avez pas la permission de modifier le statut"):M(K.data.message||"Une erreur est survenue");else M("Une erreur inattendue est survenue")}finally{_(!1)}}},H=async W=>{if(W.preventDefault(),!!e){if(!h&&!p){M("Veuillez sélectionner au moins un destinataire");return}_(!0),M(null),U(null);try{const K=await Sd.sendEmail(e.id,{subject:c.trim(),message:d.trim(),send_to_recommender:h,send_to_recommended:p});U(`Email(s) envoyé(s) à: ${K.data.emails_sent.join(", ")}`),setTimeout(()=>{n(),t()},2e3)}catch(K){if(K instanceof Vt)if(K.status===422&&K.data.errors){const $=K.data.errors.subject?.[0],P=K.data.errors.message?.[0];M($||P||K.data.message||"Erreur de validation")}else M(K.data.message||"Une erreur est survenue lors de l'envoi de l'email");else M("Une erreur inattendue est survenue")}finally{_(!1)}}};return!r||!e?null:a.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:a.jsxs("div",{className:"flex items-center justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:block sm:p-0",children:[a.jsx("div",{className:"fixed inset-0 transition-opacity bg-gray-500 bg-opacity-75",onClick:t}),a.jsx("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full",children:a.jsxs("div",{className:"bg-white px-6 pt-6 pb-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("h3",{className:"text-xl font-semibold text-ink-900",children:["Traiter la recommandation #",e.id]}),a.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600 transition-colors",children:a.jsx(mr,{size:24})})]}),a.jsxs("div",{className:"mb-4 p-4 bg-brand-50 rounded-lg",children:[a.jsxs("p",{className:"text-sm text-ink-500 mb-2",children:[a.jsx("strong",{children:"Recommandé:"})," ",e.recommended_full_name]}),a.jsxs("p",{className:"text-sm text-ink-500 mb-2",children:[a.jsx("strong",{children:"Email recommandé:"})," ",e.recommended_email||"-"]}),a.jsxs("p",{className:"text-sm text-ink-500",children:[a.jsx("strong",{children:"Recommandeur:"})," ",e.recommender_first_name," ",e.recommender_last_name," (",e.recommender_email,")"]})]}),a.jsxs("div",{className:"flex border-b border-gray-200 mb-4",children:[a.jsx("button",{type:"button",onClick:()=>y("status"),className:`px-4 py-2 text-sm font-medium ${g==="status"?"text-ink-900 border-b-2 border-brand-700":"text-ink-500 hover:text-ink-900"}`,children:"Mettre à jour le statut"}),a.jsxs("button",{type:"button",onClick:()=>y("email"),className:`px-4 py-2 text-sm font-medium flex items-center gap-2 ${g==="email"?"text-ink-900 border-b-2 border-brand-700":"text-ink-500 hover:text-ink-900"}`,children:[a.jsx(mo,{size:16}),"Envoyer un email"]})]}),C&&a.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg",children:a.jsx("p",{className:"text-sm text-red-800",children:C})}),T&&a.jsx("div",{className:"mb-4 p-3 bg-green-50 border border-green-200 rounded-lg",children:a.jsx("p",{className:"text-sm text-green-800",children:T})}),g==="status"&&a.jsxs("form",{onSubmit:F,className:"space-y-4",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-ink-500 mb-2",children:["Nouveau statut ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("select",{value:l,onChange:W=>i(W.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600",required:!0,children:WB.map(W=>a.jsx("option",{value:W.value,children:W.label},W.value))})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-ink-500 mb-2",children:"Notes (optionnel)"}),a.jsx("textarea",{value:o,onChange:W=>u(W.target.value),rows:4,className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600",placeholder:"Ajouter des notes sur cette recommandation..."})]}),a.jsxs("div",{className:"flex items-center justify-end gap-3 pt-4",children:[a.jsx(De,{type:"button",variant:"outline",onClick:t,disabled:v,children:"Annuler"}),a.jsx(De,{type:"submit",disabled:v,children:v?"Mise à jour...":"Mettre à jour le statut"})]})]}),g==="email"&&a.jsxs("form",{onSubmit:H,className:"space-y-4",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-ink-500 mb-2",children:["Destinataires ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsxs("div",{className:"space-y-2",children:[e.recommended_email?a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",checked:p,onChange:W=>x(W.target.checked),className:"rounded border-gray-300 text-brand-700 focus:ring-brand-600"}),a.jsxs("span",{className:"text-sm text-ink-500",children:["Recommandé (",e.recommended_email,")"]})]}):a.jsx("p",{className:"text-xs text-ink-500 italic",children:"Aucun email disponible pour le recommandé"}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",checked:h,onChange:W=>m(W.target.checked),className:"rounded border-gray-300 text-brand-700 focus:ring-brand-600"}),a.jsxs("span",{className:"text-sm text-ink-500",children:["Recommandeur (",e.recommender_email,")"]})]})]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-ink-500 mb-2",children:["Sujet ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("input",{type:"text",value:c,onChange:W=>s(W.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600",placeholder:"Sujet de l'email",required:!0})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-ink-500 mb-2",children:["Message ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("textarea",{value:d,onChange:W=>f(W.target.value),rows:6,className:"w-full px-4 py-2 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-brand-600",placeholder:"Votre message...",required:!0}),a.jsx("p",{className:"mt-1 text-xs text-ink-500",children:"Le message sera envoyé avec les informations de la recommandation."})]}),a.jsxs("div",{className:"flex items-center justify-end gap-3 pt-4",children:[a.jsx(De,{type:"button",variant:"outline",onClick:t,disabled:v,children:"Annuler"}),a.jsx(De,{type:"submit",disabled:v||!h&&!p,children:v?"Envoi...":"Envoyer l'email"})]})]})]})})]})})}function jC(e){var r,t,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(r=0;r{var{children:t,width:n,height:l,viewBox:i,className:o,style:u,title:c,desc:s}=e,d=JB(e,QB),f=i||{width:n,height:l,x:0,y:0},h=fr("recharts-surface",o);return R.createElement("svg",Jy({},ni(d),{className:h,width:n,height:l,style:u,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:r}),R.createElement("title",null,c),R.createElement("desc",null,s),t)}),tz=["children","className"];function ev(){return ev=Object.assign?Object.assign.bind():function(e){for(var r=1;r{var{children:t,className:n}=e,l=rz(e,tz),i=fr("recharts-layer",n);return R.createElement("g",ev({className:i},ni(l),{ref:r}),t)}),NC=R.createContext(null),iz=()=>R.useContext(NC);function yr(e){return function(){return e}}const CC=Math.cos,Am=Math.sin,js=Math.sqrt,Mm=Math.PI,Rp=2*Mm,tv=Math.PI,rv=2*tv,ol=1e-6,sz=rv-ol;function EC(e){this._+=e[0];for(let r=1,t=e.length;r=0))throw new Error(`invalid digits: ${e}`);if(r>15)return EC;const t=10**r;return function(n){this._+=n[0];for(let l=1,i=n.length;lol)if(!(Math.abs(f*c-s*d)>ol)||!i)this._append`L${this._x1=r},${this._y1=t}`;else{let m=n-o,p=l-u,x=c*c+s*s,g=m*m+p*p,y=Math.sqrt(x),v=Math.sqrt(h),_=i*Math.tan((tv-Math.acos((x+h-g)/(2*y*v)))/2),C=_/v,M=_/y;Math.abs(C-1)>ol&&this._append`L${r+C*d},${t+C*f}`,this._append`A${i},${i},0,0,${+(f*m>d*p)},${this._x1=r+M*c},${this._y1=t+M*s}`}}arc(r,t,n,l,i,o){if(r=+r,t=+t,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(l),c=n*Math.sin(l),s=r+u,d=t+c,f=1^o,h=o?l-i:i-l;this._x1===null?this._append`M${s},${d}`:(Math.abs(this._x1-s)>ol||Math.abs(this._y1-d)>ol)&&this._append`L${s},${d}`,n&&(h<0&&(h=h%rv+rv),h>sz?this._append`A${n},${n},0,1,${f},${r-u},${t-c}A${n},${n},0,1,${f},${this._x1=s},${this._y1=d}`:h>ol&&this._append`A${n},${n},0,${+(h>=tv)},${f},${this._x1=r+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(r,t,n,l){this._append`M${this._x0=this._x1=+r},${this._y0=this._y1=+t}h${n=+n}v${+l}h${-n}Z`}toString(){return this._}}function H1(e){let r=3;return e.digits=function(t){if(!arguments.length)return r;if(t==null)r=null;else{const n=Math.floor(t);if(!(n>=0))throw new RangeError(`invalid digits: ${t}`);r=n}return e},()=>new oz(r)}function W1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function AC(e){this._context=e}AC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,r){switch(e=+e,r=+r,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 1:this._point=2;default:this._context.lineTo(e,r);break}}};function Dp(e){return new AC(e)}function MC(e){return e[0]}function OC(e){return e[1]}function PC(e,r){var t=yr(!0),n=null,l=Dp,i=null,o=H1(u);e=typeof e=="function"?e:e===void 0?MC:yr(e),r=typeof r=="function"?r:r===void 0?OC:yr(r);function u(c){var s,d=(c=W1(c)).length,f,h=!1,m;for(n==null&&(i=l(m=o())),s=0;s<=d;++s)!(s=m;--p)u.point(_[p],C[p]);u.lineEnd(),u.areaEnd()}y&&(_[h]=+e(g,h,f),C[h]=+r(g,h,f),u.point(n?+n(g,h,f):_[h],t?+t(g,h,f):C[h]))}if(v)return u=null,v+""||null}function d(){return PC().defined(l).curve(o).context(i)}return s.x=function(f){return arguments.length?(e=typeof f=="function"?f:yr(+f),n=null,s):e},s.x0=function(f){return arguments.length?(e=typeof f=="function"?f:yr(+f),s):e},s.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:yr(+f),s):n},s.y=function(f){return arguments.length?(r=typeof f=="function"?f:yr(+f),t=null,s):r},s.y0=function(f){return arguments.length?(r=typeof f=="function"?f:yr(+f),s):r},s.y1=function(f){return arguments.length?(t=f==null?null:typeof f=="function"?f:yr(+f),s):t},s.lineX0=s.lineY0=function(){return d().x(e).y(r)},s.lineY1=function(){return d().x(e).y(t)},s.lineX1=function(){return d().x(n).y(r)},s.defined=function(f){return arguments.length?(l=typeof f=="function"?f:yr(!!f),s):l},s.curve=function(f){return arguments.length?(o=f,i!=null&&(u=o(i)),s):o},s.context=function(f){return arguments.length?(f==null?i=u=null:u=o(i=f),s):i},s}class TC{constructor(r,t){this._context=r,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(r,t){switch(r=+r,t=+t,this._point){case 0:{this._point=1,this._line?this._context.lineTo(r,t):this._context.moveTo(r,t);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+r)/2,this._y0,this._x0,t,r,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,r,this._y0,r,t);break}}this._x0=r,this._y0=t}}function lz(e){return new TC(e,!0)}function cz(e){return new TC(e,!1)}const K1={draw(e,r){const t=js(r/Mm);e.moveTo(t,0),e.arc(0,0,t,0,Rp)}},uz={draw(e,r){const t=js(r/5)/2;e.moveTo(-3*t,-t),e.lineTo(-t,-t),e.lineTo(-t,-3*t),e.lineTo(t,-3*t),e.lineTo(t,-t),e.lineTo(3*t,-t),e.lineTo(3*t,t),e.lineTo(t,t),e.lineTo(t,3*t),e.lineTo(-t,3*t),e.lineTo(-t,t),e.lineTo(-3*t,t),e.closePath()}},IC=js(1/3),dz=IC*2,fz={draw(e,r){const t=js(r/dz),n=t*IC;e.moveTo(0,-t),e.lineTo(n,0),e.lineTo(0,t),e.lineTo(-n,0),e.closePath()}},hz={draw(e,r){const t=js(r),n=-t/2;e.rect(n,n,t,t)}},mz=.8908130915292852,RC=Am(Mm/10)/Am(7*Mm/10),pz=Am(Rp/10)*RC,gz=-CC(Rp/10)*RC,xz={draw(e,r){const t=js(r*mz),n=pz*t,l=gz*t;e.moveTo(0,-t),e.lineTo(n,l);for(let i=1;i<5;++i){const o=Rp*i/5,u=CC(o),c=Am(o);e.lineTo(c*t,-u*t),e.lineTo(u*n-c*l,c*n+u*l)}e.closePath()}},Ox=js(3),bz={draw(e,r){const t=-js(r/(Ox*3));e.moveTo(0,t*2),e.lineTo(-Ox*t,-t),e.lineTo(Ox*t,-t),e.closePath()}},Li=-.5,Fi=js(3)/2,nv=1/js(12),yz=(nv/2+1)*3,vz={draw(e,r){const t=js(r/yz),n=t/2,l=t*nv,i=n,o=t*nv+t,u=-i,c=o;e.moveTo(n,l),e.lineTo(i,o),e.lineTo(u,c),e.lineTo(Li*n-Fi*l,Fi*n+Li*l),e.lineTo(Li*i-Fi*o,Fi*i+Li*o),e.lineTo(Li*u-Fi*c,Fi*u+Li*c),e.lineTo(Li*n+Fi*l,Li*l-Fi*n),e.lineTo(Li*i+Fi*o,Li*o-Fi*i),e.lineTo(Li*u+Fi*c,Li*c-Fi*u),e.closePath()}};function wz(e,r){let t=null,n=H1(l);e=typeof e=="function"?e:yr(e||K1),r=typeof r=="function"?r:yr(r===void 0?64:+r);function l(){let i;if(t||(t=i=n()),e.apply(this,arguments).draw(t,+r.apply(this,arguments)),i)return t=null,i+""||null}return l.type=function(i){return arguments.length?(e=typeof i=="function"?i:yr(i),l):e},l.size=function(i){return arguments.length?(r=typeof i=="function"?i:yr(+i),l):r},l.context=function(i){return arguments.length?(t=i??null,l):t},l}function Om(){}function Pm(e,r,t){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+r)/6,(e._y0+4*e._y1+t)/6)}function DC(e){this._context=e}DC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Pm(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,r){switch(e=+e,r=+r,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Pm(this,e,r);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=r}};function _z(e){return new DC(e)}function LC(e){this._context=e}LC.prototype={areaStart:Om,areaEnd:Om,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,r){switch(e=+e,r=+r,this._point){case 0:this._point=1,this._x2=e,this._y2=r;break;case 1:this._point=2,this._x3=e,this._y3=r;break;case 2:this._point=3,this._x4=e,this._y4=r,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+r)/6);break;default:Pm(this,e,r);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=r}};function jz(e){return new LC(e)}function FC(e){this._context=e}FC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,r){switch(e=+e,r=+r,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var t=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+r)/6;this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 3:this._point=4;default:Pm(this,e,r);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=r}};function Sz(e){return new FC(e)}function BC(e){this._context=e}BC.prototype={areaStart:Om,areaEnd:Om,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,r){e=+e,r=+r,this._point?this._context.lineTo(e,r):(this._point=1,this._context.moveTo(e,r))}};function kz(e){return new BC(e)}function tj(e){return e<0?-1:1}function rj(e,r,t){var n=e._x1-e._x0,l=r-e._x1,i=(e._y1-e._y0)/(n||l<0&&-0),o=(t-e._y1)/(l||n<0&&-0),u=(i*l+o*n)/(n+l);return(tj(i)+tj(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(u))||0}function nj(e,r){var t=e._x1-e._x0;return t?(3*(e._y1-e._y0)/t-r)/2:r}function Px(e,r,t){var n=e._x0,l=e._y0,i=e._x1,o=e._y1,u=(i-n)/3;e._context.bezierCurveTo(n+u,l+u*r,i-u,o-u*t,i,o)}function Tm(e){this._context=e}Tm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Px(this,this._t0,nj(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,r){var t=NaN;if(e=+e,r=+r,!(e===this._x1&&r===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 1:this._point=2;break;case 2:this._point=3,Px(this,nj(this,t=rj(this,e,r)),t);break;default:Px(this,this._t0,t=rj(this,e,r));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=r,this._t0=t}}};function zC(e){this._context=new $C(e)}(zC.prototype=Object.create(Tm.prototype)).point=function(e,r){Tm.prototype.point.call(this,r,e)};function $C(e){this._context=e}$C.prototype={moveTo:function(e,r){this._context.moveTo(r,e)},closePath:function(){this._context.closePath()},lineTo:function(e,r){this._context.lineTo(r,e)},bezierCurveTo:function(e,r,t,n,l,i){this._context.bezierCurveTo(r,e,n,t,i,l)}};function Nz(e){return new Tm(e)}function Cz(e){return new zC(e)}function UC(e){this._context=e}UC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,r=this._y,t=e.length;if(t)if(this._line?this._context.lineTo(e[0],r[0]):this._context.moveTo(e[0],r[0]),t===2)this._context.lineTo(e[1],r[1]);else for(var n=ij(e),l=ij(r),i=0,o=1;o=0;--r)l[r]=(o[r]-l[r+1])/i[r];for(i[t-1]=(e[t]+l[t-1])/2,r=0;r=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,r){switch(e=+e,r=+r,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,r),this._context.lineTo(e,r);else{var t=this._x*(1-this._t)+e*this._t;this._context.lineTo(t,this._y),this._context.lineTo(t,r)}break}}this._x=e,this._y=r}};function Az(e){return new Lp(e,.5)}function Mz(e){return new Lp(e,0)}function Oz(e){return new Lp(e,1)}function jl(e,r){if((o=e.length)>1)for(var t=1,n,l,i=e[r[0]],o,u=i.length;t=0;)t[r]=r;return t}function Pz(e,r){return e[r]}function Tz(e){const r=[];return r.key=e,r}function Iz(){var e=yr([]),r=iv,t=jl,n=Pz;function l(i){var o=Array.from(e.apply(this,arguments),Tz),u,c=o.length,s=-1,d;for(const f of i)for(u=0,++s;u0){for(var t,n,l=0,i=e[0].length,o;l0){for(var t=0,n=e[r[0]],l,i=n.length;t0)||!((i=(l=e[r[0]]).length)>0))){for(var t=0,n=1,l,i,o;n1&&arguments[1]!==void 0?arguments[1]:Uz,t=10**r,n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function zr(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n{var u=t[o-1];return typeof u=="string"?l+u+i:u!==void 0?l+po(u)+i:l+i},"")}var fi=e=>e===0?0:e>0?1:-1,bs=e=>typeof e=="number"&&e!=+e,ja=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,xt=e=>(typeof e=="number"||e instanceof Number)&&!bs(e),zs=e=>xt(e)||typeof e=="string",Vz=0,Nd=e=>{var r=++Vz;return"".concat(e||"").concat(r)},ys=function(r,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!xt(r)&&typeof r!="string")return n;var i;if(ja(r)){if(t==null)return n;var o=r.indexOf("%");i=t*parseFloat(r.slice(0,o))/100}else i=+r;return bs(i)&&(i=n),l&&t!=null&&i>t&&(i=t),i},qC=e=>{if(!Array.isArray(e))return!1;for(var r=e.length,t={},n=0;nn&&(typeof r=="function"?r(n):Tc(n,r))===t)}var Er=e=>e===null||typeof e>"u",Kd=e=>Er(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function qz(e){return e!=null}function Xd(){}var Hz=["type","size","sizeType"];function sv(){return sv=Object.assign?Object.assign.bind():function(e){for(var r=1;r{var r="symbol".concat(Kd(e));return WC[r]||K1},Jz=(e,r,t)=>{if(r==="area")return e;switch(t){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*Zz;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.tan(n)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},e$=(e,r)=>{WC["symbol".concat(Kd(e))]=r},Z1=e=>{var{type:r="circle",size:t=64,sizeType:n="area"}=e,l=Gz(e,Hz),i=hj(hj({},l),{},{type:r,size:t,sizeType:n}),o="circle";typeof r=="string"&&(o=r);var u=()=>{var h=Qz(o),m=wz().type(h).size(Jz(t,n,o)),p=m();if(p!==null)return p},{className:c,cx:s,cy:d}=i,f=ni(i);return xt(s)&&xt(d)&&xt(t)?R.createElement("path",sv({},f,{className:fr("recharts-symbols",c),transform:"translate(".concat(s,", ").concat(d,")"),d:u()})):null};Z1.registerSymbol=e$;var KC=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,Q1=(e,r)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var t=e;if(R.isValidElement(e)&&(t=e.props),typeof t!="object"&&typeof t!="function")return null;var n={};return Object.keys(t).forEach(l=>{V1(l)&&(n[l]=(i=>t[l](t,i)))}),n},t$=(e,r,t)=>n=>(e(r,t,n),null),Fp=(e,r,t)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(l=>{var i=e[l];V1(l)&&typeof i=="function"&&(n||(n={}),n[l]=t$(i,r,t))}),n};function mj(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function r$(e){for(var r=1;r(o[u]===void 0&&n[u]!==void 0&&(o[u]=n[u]),o),t);return i}function Im(){return Im=Object.assign?Object.assign.bind():function(e){for(var r=1;r{var h=d.formatter||l,m=fr({"recharts-legend-item":!0,["legend-item-".concat(f)]:!0,inactive:d.inactive});if(d.type==="none")return null;var p=d.inactive?i:d.color,x=h?h(d.value,d,f):d.value;return R.createElement("li",Im({className:m,style:c,key:"legend-item-".concat(f)},Fp(e,d,f)),R.createElement(q1,{width:t,height:t,viewBox:u,style:s,"aria-label":"".concat(x," legend icon")},R.createElement(d$,{data:d,iconType:o,inactiveColor:i})),R.createElement("span",{className:"recharts-legend-item-text",style:{color:p}},x))})}var h$=e=>{var r=An(e,u$),{payload:t,layout:n,align:l}=r;if(!t||!t.length)return null;var i={padding:0,margin:0,textAlign:n==="horizontal"?l:"left"};return R.createElement("ul",{className:"recharts-default-legend",style:i},R.createElement(f$,Im({},r,{payload:t})))},zx={},$x={},gj;function m$(){return gj||(gj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function r(t,n){const l=new Map;for(let i=0;i=0}e.isLength=r})(Wx)),Wx}var vj;function J1(){return vj||(vj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const r=g$();function t(n){return n!=null&&typeof n!="function"&&r.isLength(n.length)}e.isArrayLike=t})(Hx)),Hx}var Kx={},wj;function x$(){return wj||(wj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function r(t){return typeof t=="object"&&t!==null}e.isObjectLike=r})(Kx)),Kx}var _j;function b$(){return _j||(_j=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const r=J1(),t=x$();function n(l){return t.isObjectLike(l)&&r.isArrayLike(l)}e.isArrayLikeObject=n})(qx)),qx}var Xx={},Gx={},jj;function y$(){return jj||(jj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const r=Y1();function t(n){return function(l){return r.get(l,n)}}e.property=t})(Gx)),Gx}var Yx={},Zx={},Qx={},Jx={},Sj;function GC(){return Sj||(Sj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function r(t){return t!==null&&(typeof t=="object"||typeof t=="function")}e.isObject=r})(Jx)),Jx}var eb={},kj;function YC(){return kj||(kj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function r(t){return t==null||typeof t!="object"&&typeof t!="function"}e.isPrimitive=r})(eb)),eb}var tb={},Nj;function ZC(){return Nj||(Nj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function r(t,n){return t===n||Number.isNaN(t)&&Number.isNaN(n)}e.isEqualsSameValueZero=r})(tb)),tb}var Cj;function v$(){return Cj||(Cj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const r=GC(),t=YC(),n=ZC();function l(d,f,h){return typeof h!="function"?l(d,f,()=>{}):i(d,f,function m(p,x,g,y,v,_){const C=h(p,x,g,y,v,_);return C!==void 0?!!C:i(p,x,m,_)},new Map)}function i(d,f,h,m){if(f===d)return!0;switch(typeof f){case"object":return o(d,f,h,m);case"function":return Object.keys(f).length>0?i(d,{...f},h,m):n.isEqualsSameValueZero(d,f);default:return r.isObject(d)?typeof f=="string"?f==="":!0:n.isEqualsSameValueZero(d,f)}}function o(d,f,h,m){if(f==null)return!0;if(Array.isArray(f))return c(d,f,h,m);if(f instanceof Map)return u(d,f,h,m);if(f instanceof Set)return s(d,f,h,m);const p=Object.keys(f);if(d==null||t.isPrimitive(d))return p.length===0;if(p.length===0)return!0;if(m?.has(f))return m.get(f)===d;m?.set(f,d);try{for(let x=0;x{})}e.isMatch=t})(Zx)),Zx}var rb={},nb={},ib={},Aj;function w$(){return Aj||(Aj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function r(t){return Object.getOwnPropertySymbols(t).filter(n=>Object.prototype.propertyIsEnumerable.call(t,n))}e.getSymbols=r})(ib)),ib}var sb={},Mj;function e2(){return Mj||(Mj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function r(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}e.getTag=r})(sb)),sb}var ab={},Oj;function JC(){return Oj||(Oj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const r="[object RegExp]",t="[object String]",n="[object Number]",l="[object Boolean]",i="[object Arguments]",o="[object Symbol]",u="[object Date]",c="[object Map]",s="[object Set]",d="[object Array]",f="[object Function]",h="[object ArrayBuffer]",m="[object Object]",p="[object Error]",x="[object DataView]",g="[object Uint8Array]",y="[object Uint8ClampedArray]",v="[object Uint16Array]",_="[object Uint32Array]",C="[object BigUint64Array]",M="[object Int8Array]",T="[object Int16Array]",U="[object Int32Array]",F="[object BigInt64Array]",H="[object Float32Array]",W="[object Float64Array]";e.argumentsTag=i,e.arrayBufferTag=h,e.arrayTag=d,e.bigInt64ArrayTag=F,e.bigUint64ArrayTag=C,e.booleanTag=l,e.dataViewTag=x,e.dateTag=u,e.errorTag=p,e.float32ArrayTag=H,e.float64ArrayTag=W,e.functionTag=f,e.int16ArrayTag=T,e.int32ArrayTag=U,e.int8ArrayTag=M,e.mapTag=c,e.numberTag=n,e.objectTag=m,e.regexpTag=r,e.setTag=s,e.stringTag=t,e.symbolTag=o,e.uint16ArrayTag=v,e.uint32ArrayTag=_,e.uint8ArrayTag=g,e.uint8ClampedArrayTag=y})(ab)),ab}var ob={},Pj;function _$(){return Pj||(Pj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function r(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}e.isTypedArray=r})(ob)),ob}var Tj;function e7(){return Tj||(Tj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const r=w$(),t=e2(),n=JC(),l=YC(),i=_$();function o(d,f){return u(d,void 0,d,new Map,f)}function u(d,f,h,m=new Map,p=void 0){const x=p?.(d,f,h,m);if(x!==void 0)return x;if(l.isPrimitive(d))return d;if(m.has(d))return m.get(d);if(Array.isArray(d)){const g=new Array(d.length);m.set(d,g);for(let y=0;yr.isMatch(i,l)}e.matches=n})(Yx)),Yx}var lb={},cb={},ub={},Dj;function k$(){return Dj||(Dj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const r=e7(),t=e2(),n=JC();function l(i,o){return r.cloneDeepWith(i,(u,c,s,d)=>{const f=o?.(u,c,s,d);if(f!==void 0)return f;if(typeof i=="object"){if(t.getTag(i)===n.objectTag&&typeof i.constructor!="function"){const h={};return d.set(i,h),r.copyProperties(h,i,s,d),h}switch(Object.prototype.toString.call(i)){case n.numberTag:case n.stringTag:case n.booleanTag:{const h=new i.constructor(i?.valueOf());return r.copyProperties(h,i),h}case n.argumentsTag:{const h={};return r.copyProperties(h,i),h.length=i.length,h[Symbol.iterator]=i[Symbol.iterator],h}default:return}}})}e.cloneDeepWith=l})(ub)),ub}var Lj;function N$(){return Lj||(Lj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const r=k$();function t(n){return r.cloneDeepWith(n)}e.cloneDeep=t})(cb)),cb}var db={},fb={},Fj;function t7(){return Fj||(Fj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const r=/^(?:0|[1-9]\d*)$/;function t(n,l=Number.MAX_SAFE_INTEGER){switch(typeof n){case"number":return Number.isInteger(n)&&n>=0&&n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:u;return bb.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,bb}var Kj;function R$(){return Kj||(Kj=1,xb.exports=I$()),xb.exports}var Xj;function D$(){if(Xj)return gb;Xj=1;var e=$c(),r=R$();function t(s,d){return s===d&&(s!==0||1/s===1/d)||s!==s&&d!==d}var n=typeof Object.is=="function"?Object.is:t,l=r.useSyncExternalStore,i=e.useRef,o=e.useEffect,u=e.useMemo,c=e.useDebugValue;return gb.useSyncExternalStoreWithSelector=function(s,d,f,h,m){var p=i(null);if(p.current===null){var x={hasValue:!1,value:null};p.current=x}else x=p.current;p=u(function(){function y(T){if(!v){if(v=!0,_=T,T=h(T),m!==void 0&&x.hasValue){var U=x.value;if(m(U,T))return C=U}return C=T}if(U=C,n(_,T))return U;var F=h(T);return m!==void 0&&m(U,F)?(_=T,U):(_=T,C=F)}var v=!1,_,C,M=f===void 0?null:f;return[function(){return y(d())},M===null?void 0:function(){return y(M())}]},[d,f,h,m]);var g=l(s,p[0],p[1]);return o(function(){x.hasValue=!0,x.value=g},[g]),c(g),g},gb}var Gj;function L$(){return Gj||(Gj=1,pb.exports=D$()),pb.exports}var F$=L$(),t2=R.createContext(null),B$=e=>e,Dr=()=>{var e=R.useContext(t2);return e?e.store.dispatch:B$},om=()=>{},z$=()=>om,$$=(e,r)=>e===r;function kt(e){var r=R.useContext(t2);return F$.useSyncExternalStoreWithSelector(r?r.subscription.addNestedSub:z$,r?r.store.getState:om,r?r.store.getState:om,r?e:om,$$)}function U$(e,r=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(r)}function V$(e,r=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(r)}function q$(e,r="expected all items to be functions, instead received the following types: "){if(!e.every(t=>typeof t=="function")){const t=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${r}[${t}]`)}}var Yj=e=>Array.isArray(e)?e:[e];function H$(e){const r=Array.isArray(e[0])?e[0]:e;return q$(r,"createSelector expects all input-selectors to be functions, but received the following types: "),r}function W$(e,r){const t=[],{length:n}=e;for(let l=0;l{t=Dh(),o.resetResultsCount()},o.resultsCount=()=>i,o.resetResultsCount=()=>{i=0},o}function Y$(e,...r){const t=typeof e=="function"?{memoize:e,memoizeOptions:r}:e,n=(...l)=>{let i=0,o=0,u,c={},s=l.pop();typeof s=="object"&&(c=s,s=l.pop()),U$(s,`createSelector expects an output function after the inputs, but received: [${typeof s}]`);const d={...t,...c},{memoize:f,memoizeOptions:h=[],argsMemoize:m=n7,argsMemoizeOptions:p=[]}=d,x=Yj(h),g=Yj(p),y=H$(l),v=f(function(){return i++,s.apply(null,arguments)},...x),_=m(function(){o++;const M=W$(y,arguments);return u=v.apply(null,M),u},...g);return Object.assign(_,{resultFunc:s,memoizedResultFunc:v,dependencies:y,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>u,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:f,argsMemoize:m})};return Object.assign(n,{withTypes:()=>n}),n}var Te=Y$(n7),Z$=Object.assign((e,r=Te)=>{V$(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const t=Object.keys(e),n=t.map(i=>e[i]);return r(n,(...i)=>i.reduce((o,u,c)=>(o[t[c]]=u,o),{}))},{withTypes:()=>Z$}),yb={},vb={},wb={},Qj;function Q$(){return Qj||(Qj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function r(n){return typeof n=="symbol"?1:n===null?2:n===void 0?3:n!==n?4:0}const t=(n,l,i)=>{if(n!==l){const o=r(n),u=r(l);if(o===u&&o===0){if(nl)return i==="desc"?-1:1}return i==="desc"?u-o:o-u}return 0};e.compareValues=t})(wb)),wb}var _b={},jb={},Jj;function i7(){return Jj||(Jj=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function r(t){return typeof t=="symbol"||t instanceof Symbol}e.isSymbol=r})(jb)),jb}var e5;function J$(){return e5||(e5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const r=i7(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function l(i,o){return Array.isArray(i)?!1:typeof i=="number"||typeof i=="boolean"||i==null||r.isSymbol(i)?!0:typeof i=="string"&&(n.test(i)||!t.test(i))||o!=null&&Object.hasOwn(o,i)}e.isKey=l})(_b)),_b}var t5;function eU(){return t5||(t5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const r=Q$(),t=J$(),n=G1();function l(i,o,u,c){if(i==null)return[];u=c?void 0:u,Array.isArray(i)||(i=Object.values(i)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(u)||(u=u==null?[]:[u]),u=u.map(m=>String(m));const s=(m,p)=>{let x=m;for(let g=0;gp==null||m==null?p:typeof m=="object"&&"key"in m?Object.hasOwn(p,m.key)?p[m.key]:s(p,m.path):typeof m=="function"?m(p):Array.isArray(m)?s(p,m):typeof p=="object"?p[m]:p,f=o.map(m=>(Array.isArray(m)&&m.length===1&&(m=m[0]),m==null||typeof m=="function"||Array.isArray(m)||t.isKey(m)?m:{key:m,path:n.toPath(m)}));return i.map(m=>({original:m,criteria:f.map(p=>d(p,m))})).slice().sort((m,p)=>{for(let x=0;xm.original)}e.orderBy=l})(vb)),vb}var Sb={},r5;function tU(){return r5||(r5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function r(t,n=1){const l=[],i=Math.floor(n),o=(u,c)=>{for(let s=0;s1&&n.isIterateeCall(i,o[0],o[1])?o=[]:u>2&&n.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),r.orderBy(i,t.flatten(o),["asc"])}e.sortBy=l})(yb)),yb}var Nb,s5;function nU(){return s5||(s5=1,Nb=rU().sortBy),Nb}var iU=nU();const Bp=ws(iU);var a7=e=>e.legend.settings,sU=e=>e.legend.size,aU=e=>e.legend.payload,oU=Te([aU,a7],(e,r)=>{var{itemSorter:t}=r,n=e.flat(1);return t?Bp(n,t):n});function lU(){return kt(oU)}var Lh=1;function o7(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[r,t]=R.useState({height:0,left:0,top:0,width:0}),n=R.useCallback(l=>{if(l!=null){var i=l.getBoundingClientRect(),o={height:i.height,left:i.left,top:i.top,width:i.width};(Math.abs(o.height-r.height)>Lh||Math.abs(o.left-r.left)>Lh||Math.abs(o.top-r.top)>Lh||Math.abs(o.width-r.width)>Lh)&&t({height:o.height,left:o.left,top:o.top,width:o.width})}},[r.width,r.height,r.top,r.left,...e]);return[r,n]}function Sn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var cU=typeof Symbol=="function"&&Symbol.observable||"@@observable",a5=cU,Cb=()=>Math.random().toString(36).substring(7).split("").join("."),uU={INIT:`@@redux/INIT${Cb()}`,REPLACE:`@@redux/REPLACE${Cb()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Cb()}`},Rm=uU;function r2(e){if(typeof e!="object"||e===null)return!1;let r=e;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r||Object.getPrototypeOf(e)===null}function l7(e,r,t){if(typeof e!="function")throw new Error(Sn(2));if(typeof r=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(Sn(0));if(typeof r=="function"&&typeof t>"u"&&(t=r,r=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(Sn(1));return t(l7)(e,r)}let n=e,l=r,i=new Map,o=i,u=0,c=!1;function s(){o===i&&(o=new Map,i.forEach((g,y)=>{o.set(y,g)}))}function d(){if(c)throw new Error(Sn(3));return l}function f(g){if(typeof g!="function")throw new Error(Sn(4));if(c)throw new Error(Sn(5));let y=!0;s();const v=u++;return o.set(v,g),function(){if(y){if(c)throw new Error(Sn(6));y=!1,s(),o.delete(v),i=null}}}function h(g){if(!r2(g))throw new Error(Sn(7));if(typeof g.type>"u")throw new Error(Sn(8));if(typeof g.type!="string")throw new Error(Sn(17));if(c)throw new Error(Sn(9));try{c=!0,l=n(l,g)}finally{c=!1}return(i=o).forEach(v=>{v()}),g}function m(g){if(typeof g!="function")throw new Error(Sn(10));n=g,h({type:Rm.REPLACE})}function p(){const g=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(Sn(11));function v(){const C=y;C.next&&C.next(d())}return v(),{unsubscribe:g(v)}},[a5](){return this}}}return h({type:Rm.INIT}),{dispatch:h,subscribe:f,getState:d,replaceReducer:m,[a5]:p}}function dU(e){Object.keys(e).forEach(r=>{const t=e[r];if(typeof t(void 0,{type:Rm.INIT})>"u")throw new Error(Sn(12));if(typeof t(void 0,{type:Rm.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Sn(13))})}function c7(e){const r=Object.keys(e),t={};for(let i=0;i"u")throw u&&u.type,new Error(Sn(14));s[f]=p,c=c||p!==m}return c=c||n.length!==Object.keys(o).length,c?s:o}}function Dm(...e){return e.length===0?r=>r:e.length===1?e[0]:e.reduce((r,t)=>(...n)=>r(t(...n)))}function fU(...e){return r=>(t,n)=>{const l=r(t,n);let i=()=>{throw new Error(Sn(15))};const o={getState:l.getState,dispatch:(c,...s)=>i(c,...s)},u=e.map(c=>c(o));return i=Dm(...u)(l.dispatch),{...l,dispatch:i}}}function u7(e){return r2(e)&&"type"in e&&typeof e.type=="string"}var d7=Symbol.for("immer-nothing"),o5=Symbol.for("immer-draftable"),ii=Symbol.for("immer-state");function hs(e,...r){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ni=Object,Ic=Ni.getPrototypeOf,Lm="constructor",zp="prototype",av="configurable",Fm="enumerable",lm="writable",Cd="value",Sa=e=>!!e&&!!e[ii];function vs(e){return e?f7(e)||Up(e)||!!e[o5]||!!e[Lm]?.[o5]||Vp(e)||qp(e):!1}var hU=Ni[zp][Lm].toString(),l5=new WeakMap;function f7(e){if(!e||!n2(e))return!1;const r=Ic(e);if(r===null||r===Ni[zp])return!0;const t=Ni.hasOwnProperty.call(r,Lm)&&r[Lm];if(t===Object)return!0;if(!wc(t))return!1;let n=l5.get(t);return n===void 0&&(n=Function.toString.call(t),l5.set(t,n)),n===hU}function $p(e,r,t=!0){Gd(e)===0?(t?Reflect.ownKeys(e):Ni.keys(e)).forEach(l=>{r(l,e[l],e)}):e.forEach((n,l)=>r(l,n,e))}function Gd(e){const r=e[ii];return r?r.type_:Up(e)?1:Vp(e)?2:qp(e)?3:0}var c5=(e,r,t=Gd(e))=>t===2?e.has(r):Ni[zp].hasOwnProperty.call(e,r),ov=(e,r,t=Gd(e))=>t===2?e.get(r):e[r],Bm=(e,r,t,n=Gd(e))=>{n===2?e.set(r,t):n===3?e.add(t):e[r]=t};function mU(e,r){return e===r?e!==0||1/e===1/r:e!==e&&r!==r}var Up=Array.isArray,Vp=e=>e instanceof Map,qp=e=>e instanceof Set,n2=e=>typeof e=="object",wc=e=>typeof e=="function",Eb=e=>typeof e=="boolean";function pU(e){const r=+e;return Number.isInteger(r)&&String(r)===e}var da=e=>e.copy_||e.base_,i2=e=>e.modified_?e.copy_:e.base_;function lv(e,r){if(Vp(e))return new Map(e);if(qp(e))return new Set(e);if(Up(e))return Array[zp].slice.call(e);const t=f7(e);if(r===!0||r==="class_only"&&!t){const n=Ni.getOwnPropertyDescriptors(e);delete n[ii];let l=Reflect.ownKeys(n);for(let i=0;i1&&Ni.defineProperties(e,{set:Fh,add:Fh,clear:Fh,delete:Fh}),Ni.freeze(e),r&&$p(e,(t,n)=>{s2(n,!0)},!1)),e}function gU(){hs(2)}var Fh={[Cd]:gU};function Hp(e){return e===null||!n2(e)?!0:Ni.isFrozen(e)}var zm="MapSet",cv="Patches",u5="ArrayMethods",h7={};function Sl(e){const r=h7[e];return r||hs(0,e),r}var d5=e=>!!h7[e],Ed,m7=()=>Ed,xU=(e,r)=>({drafts_:[],parent_:e,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:d5(zm)?Sl(zm):void 0,arrayMethodsPlugin_:d5(u5)?Sl(u5):void 0});function f5(e,r){r&&(e.patchPlugin_=Sl(cv),e.patches_=[],e.inversePatches_=[],e.patchListener_=r)}function uv(e){dv(e),e.drafts_.forEach(bU),e.drafts_=null}function dv(e){e===Ed&&(Ed=e.parent_)}var h5=e=>Ed=xU(Ed,e);function bU(e){const r=e[ii];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function m5(e,r){r.unfinalizedDrafts_=r.drafts_.length;const t=r.drafts_[0];if(e!==void 0&&e!==t){t[ii].modified_&&(uv(r),hs(4)),vs(e)&&(e=p5(r,e));const{patchPlugin_:l}=r;l&&l.generateReplacementPatches_(t[ii].base_,e,r)}else e=p5(r,t);return yU(r,e,!0),uv(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),e!==d7?e:void 0}function p5(e,r){if(Hp(r))return r;const t=r[ii];if(!t)return $m(r,e.handledSet_,e);if(!Wp(t,e))return r;if(!t.modified_)return t.base_;if(!t.finalized_){const{callbacks_:n}=t;if(n)for(;n.length>0;)n.pop()(e);x7(t,e)}return t.copy_}function yU(e,r,t=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&s2(r,t)}function p7(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Wp=(e,r)=>e.scope_===r,vU=[];function g7(e,r,t,n){const l=da(e),i=e.type_;if(n!==void 0&&ov(l,n,i)===r){Bm(l,n,t,i);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;$p(l,(c,s)=>{if(Sa(s)){const d=u.get(s)||[];d.push(c),u.set(s,d)}})}const o=e.draftLocations_.get(r)??vU;for(const u of o)Bm(l,u,t,i)}function wU(e,r,t){e.callbacks_.push(function(l){const i=r;if(!i||!Wp(i,l))return;l.mapSetPlugin_?.fixSetContents(i);const o=i2(i);g7(e,i.draft_??i,o,t),x7(i,l)})}function x7(e,r){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:n}=r;if(n){const l=n.getPath(e);l&&n.generatePatches_(e,l,r)}p7(e)}}function _U(e,r,t){const{scope_:n}=e;if(Sa(t)){const l=t[ii];Wp(l,n)&&l.callbacks_.push(function(){cm(e);const o=i2(l);g7(e,t,o,r)})}else vs(t)&&e.callbacks_.push(function(){const i=da(e);e.type_===3?i.has(t)&&$m(t,n.handledSet_,n):ov(i,r,e.type_)===t&&n.drafts_.length>1&&(e.assigned_.get(r)??!1)===!0&&e.copy_&&$m(ov(e.copy_,r,e.type_),n.handledSet_,n)})}function $m(e,r,t){return!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1||Sa(e)||r.has(e)||!vs(e)||Hp(e)||(r.add(e),$p(e,(n,l)=>{if(Sa(l)){const i=l[ii];if(Wp(i,t)){const o=i2(i);Bm(e,n,o,e.type_),p7(i)}}else vs(l)&&$m(l,r,t)})),e}function jU(e,r){const t=Up(e),n={type_:t?1:0,scope_:r?r.scope_:m7(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:r,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let l=n,i=Um;t&&(l=[n],i=Ad);const{revoke:o,proxy:u}=Proxy.revocable(l,i);return n.draft_=u,n.revoke_=o,[u,n]}var Um={get(e,r){if(r===ii)return e;let t=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof r=="string";if(n&&t?.isArrayOperationMethod(r))return t.createMethodInterceptor(e,r);const l=da(e);if(!c5(l,r,e.type_))return SU(e,l,r);const i=l[r];if(e.finalized_||!vs(i)||n&&e.operationMethod&&t?.isMutatingArrayMethod(e.operationMethod)&&pU(r))return i;if(i===Ab(e.base_,r)){cm(e);const o=e.type_===1?+r:r,u=hv(e.scope_,i,e,o);return e.copy_[o]=u}return i},has(e,r){return r in da(e)},ownKeys(e){return Reflect.ownKeys(da(e))},set(e,r,t){const n=b7(da(e),r);if(n?.set)return n.set.call(e.draft_,t),!0;if(!e.modified_){const l=Ab(da(e),r),i=l?.[ii];if(i&&i.base_===t)return e.copy_[r]=t,e.assigned_.set(r,!1),!0;if(mU(t,l)&&(t!==void 0||c5(e.base_,r,e.type_)))return!0;cm(e),fv(e)}return e.copy_[r]===t&&(t!==void 0||r in e.copy_)||Number.isNaN(t)&&Number.isNaN(e.copy_[r])||(e.copy_[r]=t,e.assigned_.set(r,!0),_U(e,r,t)),!0},deleteProperty(e,r){return cm(e),Ab(e.base_,r)!==void 0||r in e.base_?(e.assigned_.set(r,!1),fv(e)):e.assigned_.delete(r),e.copy_&&delete e.copy_[r],!0},getOwnPropertyDescriptor(e,r){const t=da(e),n=Reflect.getOwnPropertyDescriptor(t,r);return n&&{[lm]:!0,[av]:e.type_!==1||r!=="length",[Fm]:n[Fm],[Cd]:t[r]}},defineProperty(){hs(11)},getPrototypeOf(e){return Ic(e.base_)},setPrototypeOf(){hs(12)}},Ad={};for(let e in Um){let r=Um[e];Ad[e]=function(){const t=arguments;return t[0]=t[0][0],r.apply(this,t)}}Ad.deleteProperty=function(e,r){return Ad.set.call(this,e,r,void 0)};Ad.set=function(e,r,t){return Um.set.call(this,e[0],r,t,e[0])};function Ab(e,r){const t=e[ii];return(t?da(t):e)[r]}function SU(e,r,t){const n=b7(r,t);return n?Cd in n?n[Cd]:n.get?.call(e.draft_):void 0}function b7(e,r){if(!(r in e))return;let t=Ic(e);for(;t;){const n=Object.getOwnPropertyDescriptor(t,r);if(n)return n;t=Ic(t)}}function fv(e){e.modified_||(e.modified_=!0,e.parent_&&fv(e.parent_))}function cm(e){e.copy_||(e.assigned_=new Map,e.copy_=lv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var kU=class{constructor(r){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,l)=>{if(wc(t)&&!wc(n)){const o=n;n=t;const u=this;return function(s=o,...d){return u.produce(s,f=>n.call(this,f,...d))}}wc(n)||hs(6),l!==void 0&&!wc(l)&&hs(7);let i;if(vs(t)){const o=h5(this),u=hv(o,t,void 0);let c=!0;try{i=n(u),c=!1}finally{c?uv(o):dv(o)}return f5(o,l),m5(i,o)}else if(!t||!n2(t)){if(i=n(t),i===void 0&&(i=t),i===d7&&(i=void 0),this.autoFreeze_&&s2(i,!0),l){const o=[],u=[];Sl(cv).generateReplacementPatches_(t,i,{patches_:o,inversePatches_:u}),l(o,u)}return i}else hs(1,t)},this.produceWithPatches=(t,n)=>{if(wc(t))return(u,...c)=>this.produceWithPatches(u,s=>t(s,...c));let l,i;return[this.produce(t,n,(u,c)=>{l=u,i=c}),l,i]},Eb(r?.autoFreeze)&&this.setAutoFreeze(r.autoFreeze),Eb(r?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(r.useStrictShallowCopy),Eb(r?.useStrictIteration)&&this.setUseStrictIteration(r.useStrictIteration)}createDraft(r){vs(r)||hs(8),Sa(r)&&(r=gs(r));const t=h5(this),n=hv(t,r,void 0);return n[ii].isManual_=!0,dv(t),n}finishDraft(r,t){const n=r&&r[ii];(!n||!n.isManual_)&&hs(9);const{scope_:l}=n;return f5(l,t),m5(void 0,l)}setAutoFreeze(r){this.autoFreeze_=r}setUseStrictShallowCopy(r){this.useStrictShallowCopy_=r}setUseStrictIteration(r){this.useStrictIteration_=r}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(r,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){r=i.value;break}}n>-1&&(t=t.slice(n+1));const l=Sl(cv).applyPatches_;return Sa(r)?l(r,t):this.produce(r,i=>l(i,t))}};function hv(e,r,t,n){const[l,i]=Vp(r)?Sl(zm).proxyMap_(r,t):qp(r)?Sl(zm).proxySet_(r,t):jU(r,t);return(t?.scope_??m7()).drafts_.push(l),i.callbacks_=t?.callbacks_??[],i.key_=n,t&&n!==void 0?wU(t,i,n):i.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(i);const{patchPlugin_:s}=c;i.modified_&&s&&s.generatePatches_(i,[],c)}),l}function gs(e){return Sa(e)||hs(10,e),y7(e)}function y7(e){if(!vs(e)||Hp(e))return e;const r=e[ii];let t,n=!0;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,t=lv(e,r.scope_.immer_.useStrictShallowCopy_),n=r.scope_.immer_.shouldUseStrictIteration()}else t=lv(e,!0);return $p(t,(l,i)=>{Bm(t,l,y7(i))},n),r&&(r.finalized_=!1),t}var NU=new kU,v7=NU.produce;function w7(e){return({dispatch:t,getState:n})=>l=>i=>typeof i=="function"?i(t,n,e):l(i)}var CU=w7(),EU=w7,AU=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Dm:Dm.apply(null,arguments)};function Ki(e,r){function t(...n){if(r){let l=r(...n);if(!l)throw new Error(Ci(0));return{type:e,payload:l.payload,..."meta"in l&&{meta:l.meta},..."error"in l&&{error:l.error}}}return{type:e,payload:n[0]}}return t.toString=()=>`${e}`,t.type=e,t.match=n=>u7(n)&&n.type===e,t}var _7=class ld extends Array{constructor(...r){super(...r),Object.setPrototypeOf(this,ld.prototype)}static get[Symbol.species](){return ld}concat(...r){return super.concat.apply(this,r)}prepend(...r){return r.length===1&&Array.isArray(r[0])?new ld(...r[0].concat(this)):new ld(...r.concat(this))}};function g5(e){return vs(e)?v7(e,()=>{}):e}function Bh(e,r,t){return e.has(r)?e.get(r):e.set(r,t(r)).get(r)}function MU(e){return typeof e=="boolean"}var OU=()=>function(r){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:l=!0,actionCreatorCheck:i=!0}=r??{};let o=new _7;return t&&(MU(t)?o.push(CU):o.push(EU(t.extraArgument))),o},j7="RTK_autoBatch",Nr=()=>e=>({payload:e,meta:{[j7]:!0}}),x5=e=>r=>{setTimeout(r,e)},S7=(e={type:"raf"})=>r=>(...t)=>{const n=r(...t);let l=!0,i=!1,o=!1;const u=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:x5(10):e.type==="callback"?e.queueNotification:x5(e.timeout),s=()=>{o=!1,i&&(i=!1,u.forEach(d=>d()))};return Object.assign({},n,{subscribe(d){const f=()=>l&&d(),h=n.subscribe(f);return u.add(d),()=>{h(),u.delete(d)}},dispatch(d){try{return l=!d?.meta?.[j7],i=!l,i&&(o||(o=!0,c(s))),n.dispatch(d)}finally{l=!0}}})},PU=e=>function(t){const{autoBatch:n=!0}=t??{};let l=new _7(e);return n&&l.push(S7(typeof n=="object"?n:void 0)),l};function TU(e){const r=OU(),{reducer:t=void 0,middleware:n,devTools:l=!0,preloadedState:i=void 0,enhancers:o=void 0}=e||{};let u;if(typeof t=="function")u=t;else if(r2(t))u=c7(t);else throw new Error(Ci(1));let c;typeof n=="function"?c=n(r):c=r();let s=Dm;l&&(s=AU({trace:!1,...typeof l=="object"&&l}));const d=fU(...c),f=PU(d);let h=typeof o=="function"?o(f):f();const m=s(...h);return l7(u,i,m)}function k7(e){const r={},t=[];let n;const l={addCase(i,o){const u=typeof i=="string"?i:i.type;if(!u)throw new Error(Ci(28));if(u in r)throw new Error(Ci(29));return r[u]=o,l},addAsyncThunk(i,o){return o.pending&&(r[i.pending.type]=o.pending),o.rejected&&(r[i.rejected.type]=o.rejected),o.fulfilled&&(r[i.fulfilled.type]=o.fulfilled),o.settled&&t.push({matcher:i.settled,reducer:o.settled}),l},addMatcher(i,o){return t.push({matcher:i,reducer:o}),l},addDefaultCase(i){return n=i,l}};return e(l),[r,t,n]}function IU(e){return typeof e=="function"}function RU(e,r){let[t,n,l]=k7(r),i;if(IU(e))i=()=>g5(e());else{const u=g5(e);i=()=>u}function o(u=i(),c){let s=[t[c.type],...n.filter(({matcher:d})=>d(c)).map(({reducer:d})=>d)];return s.filter(d=>!!d).length===0&&(s=[l]),s.reduce((d,f)=>{if(f)if(Sa(d)){const m=f(d,c);return m===void 0?d:m}else{if(vs(d))return v7(d,h=>f(h,c));{const h=f(d,c);if(h===void 0){if(d===null)return d;throw Error("A case reducer on a non-draftable value must not return undefined")}return h}}return d},u)}return o.getInitialState=i,o}var DU="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",LU=(e=21)=>{let r="",t=e;for(;t--;)r+=DU[Math.random()*64|0];return r},FU=Symbol.for("rtk-slice-createasyncthunk");function BU(e,r){return`${e}/${r}`}function zU({creators:e}={}){const r=e?.asyncThunk?.[FU];return function(n){const{name:l,reducerPath:i=l}=n;if(!l)throw new Error(Ci(11));const o=(typeof n.reducers=="function"?n.reducers(UU()):n.reducers)||{},u=Object.keys(o),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(_,C){const M=typeof _=="string"?_:_.type;if(!M)throw new Error(Ci(12));if(M in c.sliceCaseReducersByType)throw new Error(Ci(13));return c.sliceCaseReducersByType[M]=C,s},addMatcher(_,C){return c.sliceMatchers.push({matcher:_,reducer:C}),s},exposeAction(_,C){return c.actionCreators[_]=C,s},exposeCaseReducer(_,C){return c.sliceCaseReducersByName[_]=C,s}};u.forEach(_=>{const C=o[_],M={reducerName:_,type:BU(l,_),createNotation:typeof n.reducers=="function"};qU(C)?WU(M,C,s,r):VU(M,C,s)});function d(){const[_={},C=[],M=void 0]=typeof n.extraReducers=="function"?k7(n.extraReducers):[n.extraReducers],T={..._,...c.sliceCaseReducersByType};return RU(n.initialState,U=>{for(let F in T)U.addCase(F,T[F]);for(let F of c.sliceMatchers)U.addMatcher(F.matcher,F.reducer);for(let F of C)U.addMatcher(F.matcher,F.reducer);M&&U.addDefaultCase(M)})}const f=_=>_,h=new Map,m=new WeakMap;let p;function x(_,C){return p||(p=d()),p(_,C)}function g(){return p||(p=d()),p.getInitialState()}function y(_,C=!1){function M(U){let F=U[_];return typeof F>"u"&&C&&(F=Bh(m,M,g)),F}function T(U=f){const F=Bh(h,C,()=>new WeakMap);return Bh(F,U,()=>{const H={};for(const[W,K]of Object.entries(n.selectors??{}))H[W]=$U(K,U,()=>Bh(m,U,g),C);return H})}return{reducerPath:_,getSelectors:T,get selectors(){return T(M)},selectSlice:M}}const v={name:l,reducer:x,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:g,...y(i),injectInto(_,{reducerPath:C,...M}={}){const T=C??i;return _.inject({reducerPath:T,reducer:x},M),{...v,...y(T,!0)}}};return v}}function $U(e,r,t,n){function l(i,...o){let u=r(i);return typeof u>"u"&&n&&(u=t()),e(u,...o)}return l.unwrapped=e,l}var pi=zU();function UU(){function e(r,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:r,...t}}return e.withTypes=()=>e,{reducer(r){return Object.assign({[r.name](...t){return r(...t)}}[r.name],{_reducerDefinitionType:"reducer"})},preparedReducer(r,t){return{_reducerDefinitionType:"reducerWithPrepare",prepare:r,reducer:t}},asyncThunk:e}}function VU({type:e,reducerName:r,createNotation:t},n,l){let i,o;if("reducer"in n){if(t&&!HU(n))throw new Error(Ci(17));i=n.reducer,o=n.prepare}else i=n;l.addCase(e,i).exposeCaseReducer(r,i).exposeAction(r,o?Ki(e,o):Ki(e))}function qU(e){return e._reducerDefinitionType==="asyncThunk"}function HU(e){return e._reducerDefinitionType==="reducerWithPrepare"}function WU({type:e,reducerName:r},t,n,l){if(!l)throw new Error(Ci(18));const{payloadCreator:i,fulfilled:o,pending:u,rejected:c,settled:s,options:d}=t,f=l(e,i,d);n.exposeAction(r,f),o&&n.addCase(f.fulfilled,o),u&&n.addCase(f.pending,u),c&&n.addCase(f.rejected,c),s&&n.addMatcher(f.settled,s),n.exposeCaseReducer(r,{fulfilled:o||zh,pending:u||zh,rejected:c||zh,settled:s||zh})}function zh(){}var KU="task",N7="listener",C7="completed",a2="cancelled",XU=`task-${a2}`,GU=`task-${C7}`,mv=`${N7}-${a2}`,YU=`${N7}-${C7}`,Kp=class{constructor(e){this.code=e,this.message=`${KU} ${a2} (reason: ${e})`}name="TaskAbortError";message},o2=(e,r)=>{if(typeof e!="function")throw new TypeError(Ci(32))},Vm=()=>{},E7=(e,r=Vm)=>(e.catch(r),e),A7=(e,r)=>(e.addEventListener("abort",r,{once:!0}),()=>e.removeEventListener("abort",r)),yl=e=>{if(e.aborted)throw new Kp(e.reason)};function M7(e,r){let t=Vm;return new Promise((n,l)=>{const i=()=>l(new Kp(e.reason));if(e.aborted){i();return}t=A7(e,i),r.finally(()=>t()).then(n,l)}).finally(()=>{t=Vm})}var ZU=async(e,r)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(t){return{status:t instanceof Kp?"cancelled":"rejected",error:t}}finally{r?.()}},qm=e=>r=>E7(M7(e,r).then(t=>(yl(e),t))),O7=e=>{const r=qm(e);return t=>r(new Promise(n=>setTimeout(n,t)))},{assign:Ac}=Object,b5={},Xp="listenerMiddleware",QU=(e,r)=>{const t=n=>A7(e,()=>n.abort(e.reason));return(n,l)=>{o2(n);const i=new AbortController;t(i);const o=ZU(async()=>{yl(e),yl(i.signal);const u=await n({pause:qm(i.signal),delay:O7(i.signal),signal:i.signal});return yl(i.signal),u},()=>i.abort(GU));return l?.autoJoin&&r.push(o.catch(Vm)),{result:qm(e)(o),cancel(){i.abort(XU)}}}},JU=(e,r)=>{const t=async(n,l)=>{yl(r);let i=()=>{};const u=[new Promise((c,s)=>{let d=e({predicate:n,effect:(f,h)=>{h.unsubscribe(),c([f,h.getState(),h.getOriginalState()])}});i=()=>{d(),s()}})];l!=null&&u.push(new Promise(c=>setTimeout(c,l,null)));try{const c=await M7(r,Promise.race(u));return yl(r),c}finally{i()}};return(n,l)=>E7(t(n,l))},P7=e=>{let{type:r,actionCreator:t,matcher:n,predicate:l,effect:i}=e;if(r)l=Ki(r).match;else if(t)r=t.type,l=t.match;else if(n)l=n;else if(!l)throw new Error(Ci(21));return o2(i),{predicate:l,type:r,effect:i}},T7=Ac(e=>{const{type:r,predicate:t,effect:n}=P7(e);return{id:LU(),effect:n,type:r,predicate:t,pending:new Set,unsubscribe:()=>{throw new Error(Ci(22))}}},{withTypes:()=>T7}),y5=(e,r)=>{const{type:t,effect:n,predicate:l}=P7(r);return Array.from(e.values()).find(i=>(typeof t=="string"?i.type===t:i.predicate===l)&&i.effect===n)},pv=e=>{e.pending.forEach(r=>{r.abort(mv)})},eV=(e,r)=>()=>{for(const t of r.keys())pv(t);e.clear()},v5=(e,r,t)=>{try{e(r,t)}catch(n){setTimeout(()=>{throw n},0)}},I7=Ac(Ki(`${Xp}/add`),{withTypes:()=>I7}),tV=Ki(`${Xp}/removeAll`),R7=Ac(Ki(`${Xp}/remove`),{withTypes:()=>R7}),rV=(...e)=>{console.error(`${Xp}/error`,...e)},Yd=(e={})=>{const r=new Map,t=new Map,n=m=>{const p=t.get(m)??0;t.set(m,p+1)},l=m=>{const p=t.get(m)??1;p===1?t.delete(m):t.set(m,p-1)},{extra:i,onError:o=rV}=e;o2(o);const u=m=>(m.unsubscribe=()=>r.delete(m.id),r.set(m.id,m),p=>{m.unsubscribe(),p?.cancelActive&&pv(m)}),c=m=>{const p=y5(r,m)??T7(m);return u(p)};Ac(c,{withTypes:()=>c});const s=m=>{const p=y5(r,m);return p&&(p.unsubscribe(),m.cancelActive&&pv(p)),!!p};Ac(s,{withTypes:()=>s});const d=async(m,p,x,g)=>{const y=new AbortController,v=JU(c,y.signal),_=[];try{m.pending.add(y),n(m),await Promise.resolve(m.effect(p,Ac({},x,{getOriginalState:g,condition:(C,M)=>v(C,M).then(Boolean),take:v,delay:O7(y.signal),pause:qm(y.signal),extra:i,signal:y.signal,fork:QU(y.signal,_),unsubscribe:m.unsubscribe,subscribe:()=>{r.set(m.id,m)},cancelActiveListeners:()=>{m.pending.forEach((C,M,T)=>{C!==y&&(C.abort(mv),T.delete(C))})},cancel:()=>{y.abort(mv),m.pending.delete(y)},throwIfCancelled:()=>{yl(y.signal)}})))}catch(C){C instanceof Kp||v5(o,C,{raisedBy:"effect"})}finally{await Promise.all(_),y.abort(YU),l(m),m.pending.delete(y)}},f=eV(r,t);return{middleware:m=>p=>x=>{if(!u7(x))return p(x);if(I7.match(x))return c(x.payload);if(tV.match(x)){f();return}if(R7.match(x))return s(x.payload);let g=m.getState();const y=()=>{if(g===b5)throw new Error(Ci(23));return g};let v;try{if(v=p(x),r.size>0){const _=m.getState(),C=Array.from(r.values());for(const M of C){let T=!1;try{T=M.predicate(x,_,g)}catch(U){T=!1,v5(o,U,{raisedBy:"predicate"})}T&&d(M,x,m,y)}}}finally{g=b5}return v},startListening:c,stopListening:s,clearListeners:f}};function Ci(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var nV={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},D7=pi({name:"chartLayout",initialState:nV,reducers:{setLayout(e,r){e.layoutType=r.payload},setChartSize(e,r){e.width=r.payload.width,e.height=r.payload.height},setMargin(e,r){var t,n,l,i;e.margin.top=(t=r.payload.top)!==null&&t!==void 0?t:0,e.margin.right=(n=r.payload.right)!==null&&n!==void 0?n:0,e.margin.bottom=(l=r.payload.bottom)!==null&&l!==void 0?l:0,e.margin.left=(i=r.payload.left)!==null&&i!==void 0?i:0},setScale(e,r){e.scale=r.payload}}}),{setMargin:iV,setLayout:sV,setChartSize:aV,setScale:oV}=D7.actions,lV=D7.reducer;function L7(e,r,t){return Array.isArray(e)&&e&&r+t!==0?e.slice(r,t+1):e}function Rr(e){return Number.isFinite(e)}function $s(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function w5(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function Nc(e){for(var r=1;r{if(r&&t){var{width:n,height:l}=t,{align:i,verticalAlign:o,layout:u}=r;if((u==="vertical"||u==="horizontal"&&o==="middle")&&i!=="center"&&xt(e[i]))return Nc(Nc({},e),{},{[i]:e[i]+(n||0)});if((u==="horizontal"||u==="vertical"&&i==="center")&&o!=="middle"&&xt(e[o]))return Nc(Nc({},e),{},{[o]:e[o]+(l||0)})}return e},Co=(e,r)=>e==="horizontal"&&r==="xAxis"||e==="vertical"&&r==="yAxis"||e==="centric"&&r==="angleAxis"||e==="radial"&&r==="radiusAxis",F7=(e,r,t,n)=>{if(n)return e.map(u=>u.coordinate);var l,i,o=e.map(u=>(u.coordinate===r&&(l=!0),u.coordinate===t&&(i=!0),u.coordinate));return l||o.push(r),i||o.push(t),o},B7=(e,r,t)=>{if(!e)return null;var{duplicateDomain:n,type:l,range:i,scale:o,realScaleType:u,isCategorical:c,categoricalDomain:s,tickCount:d,ticks:f,niceTicks:h,axisType:m}=e;if(!o)return null;var p=u==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,x=l==="category"&&o.bandwidth?o.bandwidth()/p:0;if(x=m==="angleAxis"&&i&&i.length>=2?fi(i[0]-i[1])*2*x:x,f||h){var g=(f||h||[]).map((y,v)=>{var _=n?n.indexOf(y):y;return{coordinate:o(_)+x,value:y,offset:x,index:v}});return g.filter(y=>!bs(y.coordinate))}return c&&s?s.map((y,v)=>({coordinate:o(y)+x,value:y,index:v,offset:x})):o.ticks&&d!=null?o.ticks(d).map((y,v)=>({coordinate:o(y)+x,value:y,offset:x,index:v})):o.domain().map((y,v)=>({coordinate:o(y)+x,value:n?n[y]:y,index:v,offset:x}))},_5=1e-4,hV=e=>{var r=e.domain();if(!(!r||r.length<=2)){var t=r.length,n=e.range(),l=Math.min(n[0],n[1])-_5,i=Math.max(n[0],n[1])+_5,o=e(r[0]),u=e(r[t-1]);(oi||ui)&&e.domain([r[0],r[t-1]])}},mV=(e,r)=>{if(!r||r.length!==2||!xt(r[0])||!xt(r[1]))return e;var t=Math.min(r[0],r[1]),n=Math.max(r[0],r[1]),l=[e[0],e[1]];return(!xt(e[0])||e[0]n)&&(l[1]=n),l[0]>n&&(l[0]=n),l[1]{var r,t=e.length;if(!(t<=0)){var n=(r=e[0])===null||r===void 0?void 0:r.length;if(!(n==null||n<=0))for(var l=0;l=0?(s[0]=i,s[1]=i+h,i=d):(s[0]=o,s[1]=o+h,o=d)}}}},gV=e=>{var r,t=e.length;if(!(t<=0)){var n=(r=e[0])===null||r===void 0?void 0:r.length;if(!(n==null||n<=0))for(var l=0;l=0?(c[0]=i,c[1]=i+s,i=c[1]):(c[0]=0,c[1]=0)}}}},xV={sign:pV,expand:Rz,none:jl,silhouette:Dz,wiggle:Lz,positive:gV},bV=(e,r,t)=>{var n,l=(n=xV[t])!==null&&n!==void 0?n:jl,i=Iz().keys(r).value((u,c)=>Number(Yr(u,c,0))).order(iv).offset(l),o=i(e);return o.forEach((u,c)=>{u.forEach((s,d)=>{var f=Yr(e[d],r[c],0);Array.isArray(f)&&f.length===2&&xt(f[0])&&xt(f[1])&&(s[0]=f[0],s[1]=f[1])})}),o};function yV(e){return e==null?void 0:String(e)}function j5(e){var{axis:r,ticks:t,bandSize:n,entry:l,index:i,dataKey:o}=e;if(r.type==="category"){if(!r.allowDuplicatedCategory&&r.dataKey&&!Er(l[r.dataKey])){var u=HC(t,"value",l[r.dataKey]);if(u)return u.coordinate+n/2}return t[i]?t[i].coordinate+n/2:null}var c=Yr(l,Er(o)?r.dataKey:o);return Er(c)?null:r.scale(c)}var S5=e=>{var{axis:r,ticks:t,offset:n,bandSize:l,entry:i,index:o}=e;if(r.type==="category")return t[o]?t[o].coordinate+n:null;var u=Yr(i,r.dataKey,r.scale.domain()[o]);return Er(u)?null:r.scale(u)-l/2+n},vV=e=>{var{numericAxis:r}=e,t=r.scale.domain();if(r.type==="number"){var n=Math.min(t[0],t[1]),l=Math.max(t[0],t[1]);return n<=0&&l>=0?0:l<0?l:n}return t[0]},wV=e=>{var r=e.flat(2).filter(xt);return[Math.min(...r),Math.max(...r)]},_V=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],jV=(e,r,t)=>{if(e!=null)return _V(Object.keys(e).reduce((n,l)=>{var i=e[l];if(!i)return n;var{stackedData:o}=i,u=o.reduce((c,s)=>{var d=L7(s,r,t),f=wV(d);return!Rr(f[0])||!Rr(f[1])?c:[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(u[0],n[0]),Math.max(u[1],n[1])]},[1/0,-1/0]))},k5=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,N5=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Rc=(e,r,t)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!t||n>0)return n}if(e&&r&&r.length>=2){for(var l=Bp(r,d=>d.coordinate),i=1/0,o=1,u=l.length;o{if(r==="horizontal")return e.chartX;if(r==="vertical")return e.chartY},kV=(e,r)=>r==="centric"?e.angle:e.radius,Oa=e=>e.layout.width,Pa=e=>e.layout.height,NV=e=>e.layout.scale,z7=e=>e.layout.margin,Yp=Te(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Zp=Te(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),CV="data-recharts-item-index",EV="data-recharts-item-id",Zd=60;function E5(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function $h(e){for(var r=1;re.brush.height;function TV(e){var r=Zp(e);return r.reduce((t,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var l=typeof n.width=="number"?n.width:Zd;return t+l}return t},0)}function IV(e){var r=Zp(e);return r.reduce((t,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var l=typeof n.width=="number"?n.width:Zd;return t+l}return t},0)}function RV(e){var r=Yp(e);return r.reduce((t,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?t+n.height:t,0)}function DV(e){var r=Yp(e);return r.reduce((t,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?t+n.height:t,0)}var xn=Te([Oa,Pa,z7,PV,TV,IV,RV,DV,a7,sU],(e,r,t,n,l,i,o,u,c,s)=>{var d={left:(t.left||0)+l,right:(t.right||0)+i},f={top:(t.top||0)+o,bottom:(t.bottom||0)+u},h=$h($h({},f),d),m=h.bottom;h.bottom+=n,h=fV(h,c,s);var p=e-h.left-h.right,x=r-h.top-h.bottom;return $h($h({brushBottom:m},h),{},{width:Math.max(p,0),height:Math.max(x,0)})}),LV=Te(xn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),l2=Te(Oa,Pa,(e,r)=>({x:0,y:0,width:e,height:r})),FV=R.createContext(null),Un=()=>R.useContext(FV)!=null,Qp=e=>e.brush,Jp=Te([Qp,xn,z7],(e,r,t)=>({height:e.height,x:xt(e.x)?e.x:r.left,y:xt(e.y)?e.y:r.top+r.height+r.brushBottom-(t?.bottom||0),width:xt(e.width)?e.width:r.width})),Mb={},Ob={},Pb={},A5;function BV(){return A5||(A5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function r(t,n,{signal:l,edges:i}={}){let o,u=null;const c=i!=null&&i.includes("leading"),s=i==null||i.includes("trailing"),d=()=>{u!==null&&(t.apply(o,u),o=void 0,u=null)},f=()=>{s&&d(),x()};let h=null;const m=()=>{h!=null&&clearTimeout(h),h=setTimeout(()=>{h=null,f()},n)},p=()=>{h!==null&&(clearTimeout(h),h=null)},x=()=>{p(),o=void 0,u=null},g=()=>{d()},y=function(...v){if(l?.aborted)return;o=this,u=v;const _=h==null;m(),c&&_&&d()};return y.schedule=m,y.cancel=x,y.flush=g,l?.addEventListener("abort",x,{once:!0}),y}e.debounce=r})(Pb)),Pb}var M5;function zV(){return M5||(M5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const r=BV();function t(n,l=0,i={}){typeof i!="object"&&(i={});const{leading:o=!1,trailing:u=!0,maxWait:c}=i,s=Array(2);o&&(s[0]="leading"),u&&(s[1]="trailing");let d,f=null;const h=r.debounce(function(...x){d=n.apply(this,x),f=null},l,{edges:s}),m=function(...x){return c!=null&&(f===null&&(f=Date.now()),Date.now()-f>=c)?(d=n.apply(this,x),f=Date.now(),h.cancel(),h.schedule(),d):(h.apply(this,x),d)},p=()=>(h.flush(),d);return m.cancel=h.cancel,m.flush=p,m}e.debounce=t})(Ob)),Ob}var O5;function $V(){return O5||(O5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const r=zV();function t(n,l=0,i={}){const{leading:o=!0,trailing:u=!0}=i;return r.debounce(n,l,{leading:o,maxWait:l,trailing:u})}e.throttle=t})(Mb)),Mb}var Tb,P5;function UV(){return P5||(P5=1,Tb=$V().throttle),Tb}var VV=UV();const qV=ws(VV);var Hm=function(r,t){for(var n=arguments.length,l=new Array(n>2?n-2:0),i=2;il[o++]))}},$7=(e,r,t)=>{var{width:n="100%",height:l="100%",aspect:i,maxHeight:o}=t,u=ja(n)?e:Number(n),c=ja(l)?r:Number(l);return i&&i>0&&(u?c=u/i:c&&(u=c*i),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:u,calculatedHeight:c}},HV={width:0,height:0,overflow:"visible"},WV={width:0,overflowX:"visible"},KV={height:0,overflowY:"visible"},XV={},GV=e=>{var{width:r,height:t}=e,n=ja(r),l=ja(t);return n&&l?HV:n?WV:l?KV:XV};function YV(e){var{width:r,height:t,aspect:n}=e,l=r,i=t;return l===void 0&&i===void 0?(l="100%",i="100%"):l===void 0?l=n&&n>0?void 0:"100%":i===void 0&&(i=n&&n>0?void 0:"100%"),{width:l,height:i}}function gv(){return gv=Object.assign?Object.assign.bind():function(e){for(var r=1;r({width:t,height:n}),[t,n]);return eq(l)?R.createElement(U7.Provider,{value:l},r):null}var c2=()=>R.useContext(U7),tq=R.forwardRef((e,r)=>{var{aspect:t,initialDimension:n={width:-1,height:-1},width:l,height:i,minWidth:o=0,minHeight:u,maxHeight:c,children:s,debounce:d=0,id:f,className:h,onResize:m,style:p={}}=e,x=R.useRef(null),g=R.useRef();g.current=m,R.useImperativeHandle(r,()=>x.current);var[y,v]=R.useState({containerWidth:n.width,containerHeight:n.height}),_=R.useCallback((F,H)=>{v(W=>{var K=Math.round(F),$=Math.round(H);return W.containerWidth===K&&W.containerHeight===$?W:{containerWidth:K,containerHeight:$}})},[]);R.useEffect(()=>{if(x.current==null||typeof ResizeObserver>"u")return Xd;var F=$=>{var P,{width:L,height:E}=$[0].contentRect;_(L,E),(P=g.current)===null||P===void 0||P.call(g,L,E)};d>0&&(F=qV(F,d,{trailing:!0,leading:!1}));var H=new ResizeObserver(F),{width:W,height:K}=x.current.getBoundingClientRect();return _(W,K),H.observe(x.current),()=>{H.disconnect()}},[_,d]);var{containerWidth:C,containerHeight:M}=y;Hm(!t||t>0,"The aspect(%s) must be greater than zero.",t);var{calculatedWidth:T,calculatedHeight:U}=$7(C,M,{width:l,height:i,aspect:t,maxHeight:c});return Hm(T!=null&&T>0||U!=null&&U>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the height and width.`,T,U,l,i,o,u,t),R.createElement("div",{id:f?"".concat(f):void 0,className:fr("recharts-responsive-container",h),style:I5(I5({},p),{},{width:l,height:i,minWidth:o,minHeight:u,maxHeight:c}),ref:x},R.createElement("div",{style:GV({width:l,height:i})},R.createElement(V7,{width:T,height:U},s)))}),Ib=R.forwardRef((e,r)=>{var t=c2();if($s(t.width)&&$s(t.height))return e.children;var{width:n,height:l}=YV({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:i,calculatedHeight:o}=$7(void 0,void 0,{width:n,height:l,aspect:e.aspect,maxHeight:e.maxHeight});return xt(i)&&xt(o)?R.createElement(V7,{width:i,height:o},e.children):R.createElement(tq,gv({},e,{width:n,height:l,ref:r}))});function q7(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var e0=()=>{var e,r=Un(),t=kt(LV),n=kt(Jp),l=(e=kt(Qp))===null||e===void 0?void 0:e.padding;return!r||!n||!l?t:{width:n.width-l.left-l.right,height:n.height-l.top-l.bottom,x:l.left,y:l.top}},rq={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},H7=()=>{var e;return(e=kt(xn))!==null&&e!==void 0?e:rq},u2=()=>kt(Oa),d2=()=>kt(Pa),nq=()=>kt(e=>e.layout.margin),ar=e=>e.layout.layoutType,Kc=()=>kt(ar),iq=()=>{var e=Kc();return e!==void 0},t0=e=>{var r=Dr(),t=Un(),{width:n,height:l}=e,i=c2(),o=n,u=l;return i&&(o=i.width>0?i.width:n,u=i.height>0?i.height:l),R.useEffect(()=>{!t&&$s(o)&&$s(u)&&r(aV({width:o,height:u}))},[r,t,o,u]),null},W7=Symbol.for("immer-nothing"),R5=Symbol.for("immer-draftable"),Ei=Symbol.for("immer-state");function ms(e,...r){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Md=Object.getPrototypeOf;function Dc(e){return!!e&&!!e[Ei]}function kl(e){return e?K7(e)||Array.isArray(e)||!!e[R5]||!!e.constructor?.[R5]||Qd(e)||n0(e):!1}var sq=Object.prototype.constructor.toString(),D5=new WeakMap;function K7(e){if(!e||typeof e!="object")return!1;const r=Object.getPrototypeOf(e);if(r===null||r===Object.prototype)return!0;const t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;if(t===Object)return!0;if(typeof t!="function")return!1;let n=D5.get(t);return n===void 0&&(n=Function.toString.call(t),D5.set(t,n)),n===sq}function Wm(e,r,t=!0){r0(e)===0?(t?Reflect.ownKeys(e):Object.keys(e)).forEach(l=>{r(l,e[l],e)}):e.forEach((n,l)=>r(l,n,e))}function r0(e){const r=e[Ei];return r?r.type_:Array.isArray(e)?1:Qd(e)?2:n0(e)?3:0}function xv(e,r){return r0(e)===2?e.has(r):Object.prototype.hasOwnProperty.call(e,r)}function X7(e,r,t){const n=r0(e);n===2?e.set(r,t):n===3?e.add(t):e[r]=t}function aq(e,r){return e===r?e!==0||1/e===1/r:e!==e&&r!==r}function Qd(e){return e instanceof Map}function n0(e){return e instanceof Set}function ll(e){return e.copy_||e.base_}function bv(e,r){if(Qd(e))return new Map(e);if(n0(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const t=K7(e);if(r===!0||r==="class_only"&&!t){const n=Object.getOwnPropertyDescriptors(e);delete n[Ei];let l=Reflect.ownKeys(n);for(let i=0;i1&&Object.defineProperties(e,{set:Uh,add:Uh,clear:Uh,delete:Uh}),Object.freeze(e),r&&Object.values(e).forEach(t=>f2(t,!0))),e}function oq(){ms(2)}var Uh={value:oq};function i0(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var lq={};function Nl(e){const r=lq[e];return r||ms(0,e),r}var Od;function G7(){return Od}function cq(e,r){return{drafts_:[],parent_:e,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function L5(e,r){r&&(Nl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=r)}function yv(e){vv(e),e.drafts_.forEach(uq),e.drafts_=null}function vv(e){e===Od&&(Od=e.parent_)}function F5(e){return Od=cq(Od,e)}function uq(e){const r=e[Ei];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function B5(e,r){r.unfinalizedDrafts_=r.drafts_.length;const t=r.drafts_[0];return e!==void 0&&e!==t?(t[Ei].modified_&&(yv(r),ms(4)),kl(e)&&(e=Km(r,e),r.parent_||Xm(r,e)),r.patches_&&Nl("Patches").generateReplacementPatches_(t[Ei].base_,e,r.patches_,r.inversePatches_)):e=Km(r,t,[]),yv(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),e!==W7?e:void 0}function Km(e,r,t){if(i0(r))return r;const n=e.immer_.shouldUseStrictIteration(),l=r[Ei];if(!l)return Wm(r,(i,o)=>z5(e,l,r,i,o,t),n),r;if(l.scope_!==e)return r;if(!l.modified_)return Xm(e,l.base_,!0),l.base_;if(!l.finalized_){l.finalized_=!0,l.scope_.unfinalizedDrafts_--;const i=l.copy_;let o=i,u=!1;l.type_===3&&(o=new Set(i),i.clear(),u=!0),Wm(o,(c,s)=>z5(e,l,i,c,s,t,u),n),Xm(e,i,!1),t&&e.patches_&&Nl("Patches").generatePatches_(l,t,e.patches_,e.inversePatches_)}return l.copy_}function z5(e,r,t,n,l,i,o){if(l==null||typeof l!="object"&&!o)return;const u=i0(l);if(!(u&&!o)){if(Dc(l)){const c=i&&r&&r.type_!==3&&!xv(r.assigned_,n)?i.concat(n):void 0,s=Km(e,l,c);if(X7(t,n,s),Dc(s))e.canAutoFreeze_=!1;else return}else o&&t.add(l);if(kl(l)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||r&&r.base_&&r.base_[n]===l&&u)return;Km(e,l),(!r||!r.scope_.parent_)&&typeof n!="symbol"&&(Qd(t)?t.has(n):Object.prototype.propertyIsEnumerable.call(t,n))&&Xm(e,l)}}}function Xm(e,r,t=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&f2(r,t)}function dq(e,r){const t=Array.isArray(e),n={type_:t?1:0,scope_:r?r.scope_:G7(),modified_:!1,finalized_:!1,assigned_:{},parent_:r,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let l=n,i=h2;t&&(l=[n],i=Pd);const{revoke:o,proxy:u}=Proxy.revocable(l,i);return n.draft_=u,n.revoke_=o,u}var h2={get(e,r){if(r===Ei)return e;const t=ll(e);if(!xv(t,r))return fq(e,t,r);const n=t[r];return e.finalized_||!kl(n)?n:n===Rb(e.base_,r)?(Db(e),e.copy_[r]=_v(n,e)):n},has(e,r){return r in ll(e)},ownKeys(e){return Reflect.ownKeys(ll(e))},set(e,r,t){const n=Y7(ll(e),r);if(n?.set)return n.set.call(e.draft_,t),!0;if(!e.modified_){const l=Rb(ll(e),r),i=l?.[Ei];if(i&&i.base_===t)return e.copy_[r]=t,e.assigned_[r]=!1,!0;if(aq(t,l)&&(t!==void 0||xv(e.base_,r)))return!0;Db(e),wv(e)}return e.copy_[r]===t&&(t!==void 0||r in e.copy_)||Number.isNaN(t)&&Number.isNaN(e.copy_[r])||(e.copy_[r]=t,e.assigned_[r]=!0),!0},deleteProperty(e,r){return Rb(e.base_,r)!==void 0||r in e.base_?(e.assigned_[r]=!1,Db(e),wv(e)):delete e.assigned_[r],e.copy_&&delete e.copy_[r],!0},getOwnPropertyDescriptor(e,r){const t=ll(e),n=Reflect.getOwnPropertyDescriptor(t,r);return n&&{writable:!0,configurable:e.type_!==1||r!=="length",enumerable:n.enumerable,value:t[r]}},defineProperty(){ms(11)},getPrototypeOf(e){return Md(e.base_)},setPrototypeOf(){ms(12)}},Pd={};Wm(h2,(e,r)=>{Pd[e]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}});Pd.deleteProperty=function(e,r){return Pd.set.call(this,e,r,void 0)};Pd.set=function(e,r,t){return h2.set.call(this,e[0],r,t,e[0])};function Rb(e,r){const t=e[Ei];return(t?ll(t):e)[r]}function fq(e,r,t){const n=Y7(r,t);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}function Y7(e,r){if(!(r in e))return;let t=Md(e);for(;t;){const n=Object.getOwnPropertyDescriptor(t,r);if(n)return n;t=Md(t)}}function wv(e){e.modified_||(e.modified_=!0,e.parent_&&wv(e.parent_))}function Db(e){e.copy_||(e.copy_=bv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var hq=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(r,t,n)=>{if(typeof r=="function"&&typeof t!="function"){const i=t;t=r;const o=this;return function(c=i,...s){return o.produce(c,d=>t.call(this,d,...s))}}typeof t!="function"&&ms(6),n!==void 0&&typeof n!="function"&&ms(7);let l;if(kl(r)){const i=F5(this),o=_v(r,void 0);let u=!0;try{l=t(o),u=!1}finally{u?yv(i):vv(i)}return L5(i,n),B5(l,i)}else if(!r||typeof r!="object"){if(l=t(r),l===void 0&&(l=r),l===W7&&(l=void 0),this.autoFreeze_&&f2(l,!0),n){const i=[],o=[];Nl("Patches").generateReplacementPatches_(r,l,i,o),n(i,o)}return l}else ms(1,r)},this.produceWithPatches=(r,t)=>{if(typeof r=="function")return(o,...u)=>this.produceWithPatches(o,c=>r(c,...u));let n,l;return[this.produce(r,t,(o,u)=>{n=o,l=u}),n,l]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){kl(e)||ms(8),Dc(e)&&(e=mq(e));const r=F5(this),t=_v(e,void 0);return t[Ei].isManual_=!0,vv(r),t}finishDraft(e,r){const t=e&&e[Ei];(!t||!t.isManual_)&&ms(9);const{scope_:n}=t;return L5(n,r),B5(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,r){let t;for(t=r.length-1;t>=0;t--){const l=r[t];if(l.path.length===0&&l.op==="replace"){e=l.value;break}}t>-1&&(r=r.slice(t+1));const n=Nl("Patches").applyPatches_;return Dc(e)?n(e,r):this.produce(e,l=>n(l,r))}};function _v(e,r){const t=Qd(e)?Nl("MapSet").proxyMap_(e,r):n0(e)?Nl("MapSet").proxySet_(e,r):dq(e,r);return(r?r.scope_:G7()).drafts_.push(t),t}function mq(e){return Dc(e)||ms(10,e),Z7(e)}function Z7(e){if(!kl(e)||i0(e))return e;const r=e[Ei];let t,n=!0;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,t=bv(e,r.scope_.immer_.useStrictShallowCopy_),n=r.scope_.immer_.shouldUseStrictIteration()}else t=bv(e,!0);return Wm(t,(l,i)=>{X7(t,l,Z7(i))},n),r&&(r.finalized_=!1),t}var pq=new hq;pq.produce;var gq={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},Q7=pi({name:"legend",initialState:gq,reducers:{setLegendSize(e,r){e.size.width=r.payload.width,e.size.height=r.payload.height},setLegendSettings(e,r){e.settings.align=r.payload.align,e.settings.layout=r.payload.layout,e.settings.verticalAlign=r.payload.verticalAlign,e.settings.itemSorter=r.payload.itemSorter},addLegendPayload:{reducer(e,r){e.payload.push(r.payload)},prepare:Nr()},replaceLegendPayload:{reducer(e,r){var{prev:t,next:n}=r.payload,l=gs(e).payload.indexOf(t);l>-1&&(e.payload[l]=n)},prepare:Nr()},removeLegendPayload:{reducer(e,r){var t=gs(e).payload.indexOf(r.payload);t>-1&&e.payload.splice(t,1)},prepare:Nr()}}}),{setLegendSize:$5,setLegendSettings:xq,addLegendPayload:bq,replaceLegendPayload:yq,removeLegendPayload:vq}=Q7.actions,wq=Q7.reducer,_q=["contextPayload"];function jv(){return jv=Object.assign?Object.assign.bind():function(e){for(var r=1;r{r(xq(e))},[r,e]),null}function Pq(e){var r=Dr();return R.useEffect(()=>(r($5(e)),()=>{r($5({width:0,height:0}))}),[r,e]),null}function Tq(e,r,t,n){return e==="vertical"&&xt(r)?{height:r}:e==="horizontal"?{width:t||n}:null}var Iq={align:"center",iconSize:14,itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function um(e){var r=An(e,Iq),t=lU(),n=iz(),l=nq(),{width:i,height:o,wrapperStyle:u,portal:c}=r,[s,d]=o7([t]),f=u2(),h=d2();if(f==null||h==null)return null;var m=f-(l?.left||0)-(l?.right||0),p=Tq(r.layout,o,i,m),x=c?u:Lc(Lc({position:"absolute",width:p?.width||i||"auto",height:p?.height||o||"auto"},Mq(u,r,l,f,h,s)),u),g=c??n;if(g==null||t==null)return null;var y=R.createElement("div",{className:"recharts-legend-wrapper",style:x,ref:d},R.createElement(Oq,{layout:r.layout,align:r.align,verticalAlign:r.verticalAlign,itemSorter:r.itemSorter}),!c&&R.createElement(Pq,{width:s.width,height:s.height}),R.createElement(Aq,jv({},r,p,{margin:l,chartWidth:f,chartHeight:h,contextPayload:t})));return jp.createPortal(y,g)}um.displayName="Legend";function Sv(){return Sv=Object.assign?Object.assign.bind():function(e){for(var r=1;r{var{separator:r=" : ",contentStyle:t={},itemStyle:n={},labelStyle:l={},payload:i,formatter:o,itemSorter:u,wrapperClassName:c,labelClassName:s,label:d,labelFormatter:f,accessibilityLayer:h=!1}=e,m=()=>{if(i&&i.length){var M={padding:0,margin:0},T=(u?Bp(i,u):i).map((U,F)=>{if(U.type==="none")return null;var H=U.formatter||o||Fq,{value:W,name:K}=U,$=W,P=K;if(H){var L=H(W,K,U,F,i);if(Array.isArray(L))[$,P]=L;else if(L!=null)$=L;else return null}var E=Lb({display:"block",paddingTop:4,paddingBottom:4,color:U.color||"#000"},n);return R.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(F),style:E},zs(P)?R.createElement("span",{className:"recharts-tooltip-item-name"},P):null,zs(P)?R.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,R.createElement("span",{className:"recharts-tooltip-item-value"},$),R.createElement("span",{className:"recharts-tooltip-item-unit"},U.unit||""))});return R.createElement("ul",{className:"recharts-tooltip-item-list",style:M},T)}return null},p=Lb({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},t),x=Lb({margin:0},l),g=!Er(d),y=g?d:"",v=fr("recharts-default-tooltip",c),_=fr("recharts-tooltip-label",s);g&&f&&i!==void 0&&i!==null&&(y=f(d,i));var C=h?{role:"status","aria-live":"assertive"}:{};return R.createElement("div",Sv({className:v,style:p},C),R.createElement("p",{className:_,style:x},R.isValidElement(y)?y:"".concat(y)),m())},Gu="recharts-tooltip-wrapper",zq={visibility:"hidden"};function $q(e){var{coordinate:r,translateX:t,translateY:n}=e;return fr(Gu,{["".concat(Gu,"-right")]:xt(t)&&r&&xt(r.x)&&t>=r.x,["".concat(Gu,"-left")]:xt(t)&&r&&xt(r.x)&&t=r.y,["".concat(Gu,"-top")]:xt(n)&&r&&xt(r.y)&&n0?l:0),f=t[n]+l;if(r[n])return o[n]?d:f;var h=c[n];if(h==null)return 0;if(o[n]){var m=d,p=h;return mg?Math.max(d,h):Math.max(f,h)}function Uq(e){var{translateX:r,translateY:t,useTranslate3d:n}=e;return{transform:n?"translate3d(".concat(r,"px, ").concat(t,"px, 0)"):"translate(".concat(r,"px, ").concat(t,"px)")}}function Vq(e){var{allowEscapeViewBox:r,coordinate:t,offsetTopLeft:n,position:l,reverseDirection:i,tooltipBox:o,useTranslate3d:u,viewBox:c}=e,s,d,f;return o.height>0&&o.width>0&&t?(d=q5({allowEscapeViewBox:r,coordinate:t,key:"x",offsetTopLeft:n,position:l,reverseDirection:i,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=q5({allowEscapeViewBox:r,coordinate:t,key:"y",offsetTopLeft:n,position:l,reverseDirection:i,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),s=Uq({translateX:d,translateY:f,useTranslate3d:u})):s=zq,{cssProperties:s,cssClasses:$q({translateX:d,translateY:f,coordinate:t})}}function H5(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function Vh(e){for(var r=1;r{if(r.key==="Escape"){var t,n,l,i;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(t=(n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==null&&t!==void 0?t:0,y:(l=(i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==null&&l!==void 0?l:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var r,t;this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((t=this.props.coordinate)===null||t===void 0?void 0:t.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:r,allowEscapeViewBox:t,animationDuration:n,animationEasing:l,children:i,coordinate:o,hasPayload:u,isAnimationActive:c,offset:s,position:d,reverseDirection:f,useTranslate3d:h,viewBox:m,wrapperStyle:p,lastBoundingBox:x,innerRef:g,hasPortalFromProps:y}=this.props,{cssClasses:v,cssProperties:_}=Vq({allowEscapeViewBox:t,coordinate:o,offsetTopLeft:s,position:d,reverseDirection:f,tooltipBox:{height:x.height,width:x.width},useTranslate3d:h,viewBox:m}),C=y?{}:Vh(Vh({transition:c&&r?"transform ".concat(n,"ms ").concat(l):void 0},_),{},{pointerEvents:"none",visibility:!this.state.dismissed&&r&&u?"visible":"hidden",position:"absolute",top:0,left:0}),M=Vh(Vh({},C),{},{visibility:!this.state.dismissed&&r&&u?"visible":"hidden"},p);return R.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:v,style:M,ref:g},i)}}var J7=()=>{var e;return(e=kt(r=>r.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function Nv(){return Nv=Object.assign?Object.assign.bind():function(e){for(var r=1;rRr(e.x)&&Rr(e.y),G5=e=>e.base!=null&&Gm(e.base)&&Gm(e),Yu=e=>e.x,Zu=e=>e.y,Yq=(e,r)=>{if(typeof e=="function")return e;var t="curve".concat(Kd(e));return(t==="curveMonotone"||t==="curveBump")&&r?X5["".concat(t).concat(r==="vertical"?"Y":"X")]:X5[t]||Dp},Zq=e=>{var{type:r="linear",points:t=[],baseLine:n,layout:l,connectNulls:i=!1}=e,o=Yq(r,l),u=i?t.filter(Gm):t,c;if(Array.isArray(n)){var s=t.map((m,p)=>K5(K5({},m),{},{base:n[p]}));l==="vertical"?c=Rh().y(Zu).x1(Yu).x0(m=>m.base.x):c=Rh().x(Yu).y1(Zu).y0(m=>m.base.y);var d=c.defined(G5).curve(o),f=i?s.filter(G5):s;return d(f)}l==="vertical"&&xt(n)?c=Rh().y(Zu).x1(Yu).x0(n):xt(n)?c=Rh().x(Yu).y1(Zu).y0(n):c=PC().x(Yu).y(Zu);var h=c.defined(Gm).curve(o);return h(u)},eE=e=>{var{className:r,points:t,path:n,pathRef:l}=e,i=Kc();if((!t||!t.length)&&!n)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||i,connectNulls:e.connectNulls},u=t&&t.length?Zq(o):n;return R.createElement("path",Nv({},xs(e),Q1(e),{className:fr("recharts-curve",r),d:u===null?void 0:u,ref:l}))},Qq=["x","y","top","left","width","height","className"];function Cv(){return Cv=Object.assign?Object.assign.bind():function(e){for(var r=1;r"M".concat(e,",").concat(l,"v").concat(n,"M").concat(i,",").concat(r,"h").concat(t),aH=e=>{var{x:r=0,y:t=0,top:n=0,left:l=0,width:i=0,height:o=0,className:u}=e,c=nH(e,Qq),s=Jq({x:r,y:t,top:n,left:l,width:i,height:o},c);return!xt(r)||!xt(t)||!xt(i)||!xt(o)||!xt(n)||!xt(l)?null:R.createElement("path",Cv({},ni(s),{className:fr("recharts-cross",u),d:sH(r,t,i,o,n,l)}))};function oH(e,r,t,n){var l=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?r.x-l:t.left+.5,y:e==="horizontal"?t.top+.5:r.y-l,width:e==="horizontal"?n:t.width-1,height:e==="horizontal"?t.height-1:n}}function Z5(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function Q5(e){for(var r=1;re.replace(/([A-Z])/g,r=>"-".concat(r.toLowerCase())),tE=(e,r,t)=>e.map(n=>"".concat(dH(n)," ").concat(r,"ms ").concat(t)).join(","),fH=(e,r)=>[Object.keys(e),Object.keys(r)].reduce((t,n)=>t.filter(l=>n.includes(l))),Td=(e,r)=>Object.keys(r).reduce((t,n)=>Q5(Q5({},t),{},{[n]:e(n,r[n])}),{});function J5(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function tn(e){for(var r=1;re+(r-e)*t,Ev=e=>{var{from:r,to:t}=e;return r!==t},rE=(e,r,t)=>{var n=Td((l,i)=>{if(Ev(i)){var[o,u]=e(i.from,i.to,i.velocity);return tn(tn({},i),{},{from:o,velocity:u})}return i},r);return t<1?Td((l,i)=>Ev(i)&&n[l]!=null?tn(tn({},i),{},{velocity:Ym(i.velocity,n[l].velocity,t),from:Ym(i.from,n[l].from,t)}):i,r):rE(e,n,t-1)};function gH(e,r,t,n,l,i){var o,u=n.reduce((h,m)=>tn(tn({},h),{},{[m]:{from:e[m],velocity:0,to:r[m]}}),{}),c=()=>Td((h,m)=>m.from,u),s=()=>!Object.values(u).filter(Ev).length,d=null,f=h=>{o||(o=h);var m=h-o,p=m/t.dt;u=rE(t,u,p),l(tn(tn(tn({},e),r),c())),o=h,s()||(d=i.setTimeout(f))};return()=>(d=i.setTimeout(f),()=>{var h;(h=d)===null||h===void 0||h()})}function xH(e,r,t,n,l,i,o){var u=null,c=l.reduce((f,h)=>{var m=e[h],p=r[h];return m==null||p==null?f:tn(tn({},f),{},{[h]:[m,p]})},{}),s,d=f=>{s||(s=f);var h=(f-s)/n,m=Td((x,g)=>Ym(...g,t(h)),c);if(i(tn(tn(tn({},e),r),m)),h<1)u=o.setTimeout(d);else{var p=Td((x,g)=>Ym(...g,t(1)),c);i(tn(tn(tn({},e),r),p))}};return()=>(u=o.setTimeout(d),()=>{var f;(f=u)===null||f===void 0||f()})}const bH=(e,r,t,n,l,i)=>{var o=fH(e,r);return t==null?()=>(l(tn(tn({},e),r)),()=>{}):t.isStepper===!0?gH(e,r,t,o,l,i):xH(e,r,t,n,o,l,i)};var Zm=1e-4,nE=(e,r)=>[0,3*e,3*r-6*e,3*e-3*r+1],iE=(e,r)=>e.map((t,n)=>t*r**n).reduce((t,n)=>t+n),e6=(e,r)=>t=>{var n=nE(e,r);return iE(n,t)},yH=(e,r)=>t=>{var n=nE(e,r),l=[...n.map((i,o)=>i*o).slice(1),0];return iE(l,t)},vH=e=>{var r,t=e.split("(");if(t.length!==2||t[0]!=="cubic-bezier")return null;var n=(r=t[1])===null||r===void 0||(r=r.split(")")[0])===null||r===void 0?void 0:r.split(",");if(n==null||n.length!==4)return null;var l=n.map(i=>parseFloat(i));return[l[0],l[1],l[2],l[3]]},wH=function(){for(var r=arguments.length,t=new Array(r),n=0;n{var l=e6(e,t),i=e6(r,n),o=yH(e,t),u=s=>s>1?1:s<0?0:s,c=s=>{for(var d=s>1?1:s,f=d,h=0;h<8;++h){var m=l(f)-d,p=o(f);if(Math.abs(m-d)0&&arguments[0]!==void 0?arguments[0]:{},{stiff:t=100,damping:n=8,dt:l=17}=r,i=(o,u,c)=>{var s=-(o-u)*t,d=c*n,f=c+(s-d)*l/1e3,h=c*l/1e3+o;return Math.abs(h-u){if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return t6(e);case"spring":return jH();default:if(e.split("(")[0]==="cubic-bezier")return t6(e)}return typeof e=="function"?e:null};function kH(e){var r,t=()=>null,n=!1,l=null,i=o=>{if(!n){if(Array.isArray(o)){if(!o.length)return;var u=o,[c,...s]=u;if(typeof c=="number"){l=e.setTimeout(i.bind(null,s),c);return}i(c),l=e.setTimeout(i.bind(null,s));return}typeof o=="string"&&(r=o,t(r)),typeof o=="object"&&(r=o,t(r)),typeof o=="function"&&o()}};return{stop:()=>{n=!0},start:o=>{n=!1,l&&(l(),l=null),i(o)},subscribe:o=>(t=o,()=>{t=()=>null}),getTimeoutController:()=>e}}class NH{setTimeout(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),l=null,i=o=>{o-n>=t?r(o):typeof requestAnimationFrame=="function"&&(l=requestAnimationFrame(i))};return l=requestAnimationFrame(i),()=>{l!=null&&cancelAnimationFrame(l)}}}function CH(){return kH(new NH)}var EH=R.createContext(CH);function AH(e,r){var t=R.useContext(EH);return R.useMemo(()=>r??t(e),[e,r,t])}var MH=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),s0={isSsr:MH()},OH={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},r6={t:0},Fb={t:1};function a0(e){var r=An(e,OH),{isActive:t,canBegin:n,duration:l,easing:i,begin:o,onAnimationEnd:u,onAnimationStart:c,children:s}=r,d=t==="auto"?!s0.isSsr:t,f=AH(r.animationId,r.animationManager),[h,m]=R.useState(d?r6:Fb),p=R.useRef(null);return R.useEffect(()=>{d||m(Fb)},[d]),R.useEffect(()=>{if(!d||!n)return Xd;var x=bH(r6,Fb,SH(i),l,m,f.getTimeoutController()),g=()=>{p.current=x()};return f.start([c,o,g,l,u]),()=>{f.stop(),p.current&&p.current(),u()}},[d,n,l,i,o,c,u,f]),s(h.t)}function o0(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",t=R.useRef(Nd(r)),n=R.useRef(e);return n.current!==e&&(t.current=Nd(r),n.current=e),t.current}var PH=["radius"],TH=["radius"],n6,i6,s6,a6,o6,l6,c6,u6,d6,f6;function h6(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function m6(e){for(var r=1;r{var i=po(t),o=po(n),u=Math.min(Math.abs(i)/2,Math.abs(o)/2),c=o>=0?1:-1,s=i>=0?1:-1,d=o>=0&&i>=0||o<0&&i<0?1:0,f;if(u>0&&l instanceof Array){for(var h=[0,0,0,0],m=0,p=4;mu?u:l[m];f=zr(n6||(n6=Ts(["M",",",""])),e,r+c*h[0]),h[0]>0&&(f+=zr(i6||(i6=Ts(["A ",",",",0,0,",",",",",""])),h[0],h[0],d,e+s*h[0],r)),f+=zr(s6||(s6=Ts(["L ",",",""])),e+t-s*h[1],r),h[1]>0&&(f+=zr(a6||(a6=Ts(["A ",",",",0,0,",`, `,",",""])),h[1],h[1],d,e+t,r+c*h[1])),f+=zr(o6||(o6=Ts(["L ",",",""])),e+t,r+n-c*h[2]),h[2]>0&&(f+=zr(l6||(l6=Ts(["A ",",",",0,0,",`, `,",",""])),h[2],h[2],d,e+t-s*h[2],r+n)),f+=zr(c6||(c6=Ts(["L ",",",""])),e+s*h[3],r+n),h[3]>0&&(f+=zr(u6||(u6=Ts(["A ",",",",0,0,",`, `,",",""])),h[3],h[3],d,e,r+n-c*h[3])),f+="Z"}else if(u>0&&l===+l&&l>0){var x=Math.min(u,l);f=zr(d6||(d6=Ts(["M ",",",` A `,",",",0,0,",",",",",` L `,",",` A `,",",",0,0,",",",",",` L `,",",` A `,",",",0,0,",",",",",` L `,",",` A `,",",",0,0,",",",","," Z"])),e,r+c*x,x,x,d,e+s*x,r,e+t-s*x,r,x,x,d,e+t,r+c*x,e+t,r+n-c*x,x,x,d,e+t-s*x,r+n,e+s*x,r+n,x,x,d,e,r+n-c*x)}else f=zr(f6||(f6=Ts(["M ",","," h "," v "," h "," Z"])),e,r,t,n,-t);return f},x6={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},sE=e=>{var r=An(e,x6),t=R.useRef(null),[n,l]=R.useState(-1);R.useEffect(()=>{if(t.current&&t.current.getTotalLength)try{var k=t.current.getTotalLength();k&&l(k)}catch{}},[]);var{x:i,y:o,width:u,height:c,radius:s,className:d}=r,{animationEasing:f,animationDuration:h,animationBegin:m,isAnimationActive:p,isUpdateAnimationActive:x}=r,g=R.useRef(u),y=R.useRef(c),v=R.useRef(i),_=R.useRef(o),C=R.useMemo(()=>({x:i,y:o,width:u,height:c,radius:s}),[i,o,u,c,s]),M=o0(C,"rectangle-");if(i!==+i||o!==+o||u!==+u||c!==+c||u===0||c===0)return null;var T=fr("recharts-rectangle",d);if(!x){var U=ni(r),{radius:F}=U,H=p6(U,PH);return R.createElement("path",Qm({},H,{x:po(i),y:po(o),width:po(u),height:po(c),radius:typeof s=="number"?s:void 0,className:T,d:g6(i,o,u,c,s)}))}var W=g.current,K=y.current,$=v.current,P=_.current,L="0px ".concat(n===-1?1:n,"px"),E="".concat(n,"px 0px"),j=tE(["strokeDasharray"],h,typeof f=="string"?f:x6.animationEasing);return R.createElement(a0,{animationId:M,key:M,canBegin:n>0,duration:h,easing:f,isActive:x,begin:m},k=>{var S=$r(W,u,k),N=$r(K,c,k),O=$r($,i,k),D=$r(P,o,k);t.current&&(g.current=S,y.current=N,v.current=O,_.current=D);var B;p?k>0?B={transition:j,strokeDasharray:E}:B={strokeDasharray:L}:B={strokeDasharray:E};var Y=ni(r),{radius:Z}=Y,ne=p6(Y,TH);return R.createElement("path",Qm({},ne,{radius:typeof s=="number"?s:void 0,className:T,d:g6(O,D,S,N,s),ref:t,style:m6(m6({},B),r.style)}))})};function b6(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function y6(e){for(var r=1;re*180/Math.PI,En=(e,r,t,n)=>({x:e+Math.cos(-Jm*n)*t,y:r+Math.sin(-Jm*n)*t}),UH=function(r,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(r-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},VH=(e,r)=>{var{x:t,y:n}=e,{x:l,y:i}=r;return Math.sqrt((t-l)**2+(n-i)**2)},qH=(e,r)=>{var{x:t,y:n}=e,{cx:l,cy:i}=r,o=VH({x:t,y:n},{x:l,y:i});if(o<=0)return{radius:o,angle:0};var u=(t-l)/o,c=Math.acos(u);return n>i&&(c=2*Math.PI-c),{radius:o,angle:$H(c),angleInRadian:c}},HH=e=>{var{startAngle:r,endAngle:t}=e,n=Math.floor(r/360),l=Math.floor(t/360),i=Math.min(n,l);return{startAngle:r-i*360,endAngle:t-i*360}},WH=(e,r)=>{var{startAngle:t,endAngle:n}=r,l=Math.floor(t/360),i=Math.floor(n/360),o=Math.min(l,i);return e+o*360},KH=(e,r)=>{var{chartX:t,chartY:n}=e,{radius:l,angle:i}=qH({x:t,y:n},r),{innerRadius:o,outerRadius:u}=r;if(lu||l===0)return null;var{startAngle:c,endAngle:s}=HH(r),d=i,f;if(c<=s){for(;d>s;)d-=360;for(;d=c&&d<=s}else{for(;d>c;)d-=360;for(;d=s&&d<=c}return f?y6(y6({},r),{},{radius:l,angle:WH(d,r)}):null};function aE(e){var{cx:r,cy:t,radius:n,startAngle:l,endAngle:i}=e,o=En(r,t,n,l),u=En(r,t,n,i);return{points:[o,u],cx:r,cy:t,radius:n,startAngle:l,endAngle:i}}var v6,w6,_6,j6,S6,k6,N6;function Av(){return Av=Object.assign?Object.assign.bind():function(e){for(var r=1;r{var t=fi(r-e),n=Math.min(Math.abs(r-e),359.999);return t*n},qh=e=>{var{cx:r,cy:t,radius:n,angle:l,sign:i,isExternal:o,cornerRadius:u,cornerIsExternal:c}=e,s=u*(o?1:-1)+n,d=Math.asin(u/s)/Jm,f=c?l:l+i*d,h=En(r,t,s,f),m=En(r,t,n,f),p=c?l-i*d:l,x=En(r,t,s*Math.cos(d*Jm),p);return{center:h,circleTangency:m,lineTangency:x,theta:d}},oE=e=>{var{cx:r,cy:t,innerRadius:n,outerRadius:l,startAngle:i,endAngle:o}=e,u=XH(i,o),c=i+u,s=En(r,t,l,i),d=En(r,t,l,c),f=zr(v6||(v6=ml(["M ",",",` A `,",",`,0, `,",",`, `,",",` `])),s.x,s.y,l,l,+(Math.abs(u)>180),+(i>c),d.x,d.y);if(n>0){var h=En(r,t,n,i),m=En(r,t,n,c);f+=zr(w6||(w6=ml(["L ",",",` A `,",",`,0, `,",",`, `,","," Z"])),m.x,m.y,n,n,+(Math.abs(u)>180),+(i<=c),h.x,h.y)}else f+=zr(_6||(_6=ml(["L ",","," Z"])),r,t);return f},GH=e=>{var{cx:r,cy:t,innerRadius:n,outerRadius:l,cornerRadius:i,forceCornerRadius:o,cornerIsExternal:u,startAngle:c,endAngle:s}=e,d=fi(s-c),{circleTangency:f,lineTangency:h,theta:m}=qh({cx:r,cy:t,radius:l,angle:c,sign:d,cornerRadius:i,cornerIsExternal:u}),{circleTangency:p,lineTangency:x,theta:g}=qh({cx:r,cy:t,radius:l,angle:s,sign:-d,cornerRadius:i,cornerIsExternal:u}),y=u?Math.abs(c-s):Math.abs(c-s)-m-g;if(y<0)return o?zr(j6||(j6=ml(["M ",",",` a`,",",",0,0,1,",`,0 a`,",",",0,0,1,",`,0 `])),h.x,h.y,i,i,i*2,i,i,-i*2):oE({cx:r,cy:t,innerRadius:n,outerRadius:l,startAngle:c,endAngle:s});var v=zr(S6||(S6=ml(["M ",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` A`,",",",0,0,",",",",",` `])),h.x,h.y,i,i,+(d<0),f.x,f.y,l,l,+(y>180),+(d<0),p.x,p.y,i,i,+(d<0),x.x,x.y);if(n>0){var{circleTangency:_,lineTangency:C,theta:M}=qh({cx:r,cy:t,radius:n,angle:c,sign:d,isExternal:!0,cornerRadius:i,cornerIsExternal:u}),{circleTangency:T,lineTangency:U,theta:F}=qh({cx:r,cy:t,radius:n,angle:s,sign:-d,isExternal:!0,cornerRadius:i,cornerIsExternal:u}),H=u?Math.abs(c-s):Math.abs(c-s)-M-F;if(H<0&&i===0)return"".concat(v,"L").concat(r,",").concat(t,"Z");v+=zr(k6||(k6=ml(["L",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` A`,",",",0,0,",",",",","Z"])),U.x,U.y,i,i,+(d<0),T.x,T.y,n,n,+(H>180),+(d>0),_.x,_.y,i,i,+(d<0),C.x,C.y)}else v+=zr(N6||(N6=ml(["L",",","Z"])),r,t);return v},YH={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},lE=e=>{var r=An(e,YH),{cx:t,cy:n,innerRadius:l,outerRadius:i,cornerRadius:o,forceCornerRadius:u,cornerIsExternal:c,startAngle:s,endAngle:d,className:f}=r;if(i0&&Math.abs(s-d)<360?x=GH({cx:t,cy:n,innerRadius:l,outerRadius:i,cornerRadius:Math.min(p,m/2),forceCornerRadius:u,cornerIsExternal:c,startAngle:s,endAngle:d}):x=oE({cx:t,cy:n,innerRadius:l,outerRadius:i,startAngle:s,endAngle:d}),R.createElement("path",Av({},ni(r),{className:h,d:x}))};function ZH(e,r,t){if(e==="horizontal")return[{x:r.x,y:t.top},{x:r.x,y:t.top+t.height}];if(e==="vertical")return[{x:t.left,y:r.y},{x:t.left+t.width,y:r.y}];if(KC(r)){if(e==="centric"){var{cx:n,cy:l,innerRadius:i,outerRadius:o,angle:u}=r,c=En(n,l,i,u),s=En(n,l,o,u);return[{x:c.x,y:c.y},{x:s.x,y:s.y}]}return aE(r)}}var Bb={},zb={},$b={},C6;function QH(){return C6||(C6=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const r=i7();function t(n){return r.isSymbol(n)?NaN:Number(n)}e.toNumber=t})($b)),$b}var E6;function JH(){return E6||(E6=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const r=QH();function t(n){return n?(n=r.toNumber(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}e.toFinite=t})(zb)),zb}var A6;function eW(){return A6||(A6=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const r=s7(),t=JH();function n(l,i,o){o&&typeof o!="number"&&r.isIterateeCall(l,i,o)&&(i=o=void 0),l=t.toFinite(l),i===void 0?(i=l,l=0):i=t.toFinite(i),o=o===void 0?lr?1:e>=r?0:NaN}function nW(e,r){return e==null||r==null?NaN:re?1:r>=e?0:NaN}function m2(e){let r,t,n;e.length!==2?(r=bo,t=(u,c)=>bo(e(u),c),n=(u,c)=>e(u)-c):(r=e===bo||e===nW?e:iW,t=e,n=e);function l(u,c,s=0,d=u.length){if(s>>1;t(u[f],c)<0?s=f+1:d=f}while(s>>1;t(u[f],c)<=0?s=f+1:d=f}while(ss&&n(u[f-1],c)>-n(u[f],c)?f-1:f}return{left:l,center:o,right:i}}function iW(){return 0}function uE(e){return e===null?NaN:+e}function*sW(e,r){for(let t of e)t!=null&&(t=+t)>=t&&(yield t)}const aW=m2(bo),Jd=aW.right;m2(uE).center;class O6 extends Map{constructor(r,t=cW){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),r!=null)for(const[n,l]of r)this.set(n,l)}get(r){return super.get(P6(this,r))}has(r){return super.has(P6(this,r))}set(r,t){return super.set(oW(this,r),t)}delete(r){return super.delete(lW(this,r))}}function P6({_intern:e,_key:r},t){const n=r(t);return e.has(n)?e.get(n):t}function oW({_intern:e,_key:r},t){const n=r(t);return e.has(n)?e.get(n):(e.set(n,t),t)}function lW({_intern:e,_key:r},t){const n=r(t);return e.has(n)&&(t=e.get(n),e.delete(n)),t}function cW(e){return e!==null&&typeof e=="object"?e.valueOf():e}function uW(e=bo){if(e===bo)return dE;if(typeof e!="function")throw new TypeError("compare is not a function");return(r,t)=>{const n=e(r,t);return n||n===0?n:(e(t,t)===0)-(e(r,r)===0)}}function dE(e,r){return(e==null||!(e>=e))-(r==null||!(r>=r))||(er?1:0)}const dW=Math.sqrt(50),fW=Math.sqrt(10),hW=Math.sqrt(2);function ep(e,r,t){const n=(r-e)/Math.max(0,t),l=Math.floor(Math.log10(n)),i=n/Math.pow(10,l),o=i>=dW?10:i>=fW?5:i>=hW?2:1;let u,c,s;return l<0?(s=Math.pow(10,-l)/o,u=Math.round(e*s),c=Math.round(r*s),u/sr&&--c,s=-s):(s=Math.pow(10,l)*o,u=Math.round(e/s),c=Math.round(r/s),u*sr&&--c),c0))return[];if(e===r)return[e];const n=r=l))return[];const u=i-l+1,c=new Array(u);if(n)if(o<0)for(let s=0;s=n)&&(t=n);return t}function I6(e,r){let t;for(const n of e)n!=null&&(t>n||t===void 0&&n>=n)&&(t=n);return t}function fE(e,r,t=0,n=1/0,l){if(r=Math.floor(r),t=Math.floor(Math.max(0,t)),n=Math.floor(Math.min(e.length-1,n)),!(t<=r&&r<=n))return e;for(l=l===void 0?dE:uW(l);n>t;){if(n-t>600){const c=n-t+1,s=r-t+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(s-c/2<0?-1:1),m=Math.max(t,Math.floor(r-s*f/c+h)),p=Math.min(n,Math.floor(r+(c-s)*f/c+h));fE(e,r,m,p,l)}const i=e[r];let o=t,u=n;for(Qu(e,t,r),l(e[n],i)>0&&Qu(e,t,n);o0;)--u}l(e[t],i)===0?Qu(e,t,u):(++u,Qu(e,u,n)),u<=r&&(t=u+1),r<=u&&(n=u-1)}return e}function Qu(e,r,t){const n=e[r];e[r]=e[t],e[t]=n}function mW(e,r,t){if(e=Float64Array.from(sW(e)),!(!(n=e.length)||isNaN(r=+r))){if(r<=0||n<2)return I6(e);if(r>=1)return T6(e);var n,l=(n-1)*r,i=Math.floor(l),o=T6(fE(e,i).subarray(0,i+1)),u=I6(e.subarray(i+1));return o+(u-o)*(l-i)}}function pW(e,r,t=uE){if(!(!(n=e.length)||isNaN(r=+r))){if(r<=0||n<2)return+t(e[0],0,e);if(r>=1)return+t(e[n-1],n-1,e);var n,l=(n-1)*r,i=Math.floor(l),o=+t(e[i],i,e),u=+t(e[i+1],i+1,e);return o+(u-o)*(l-i)}}function gW(e,r,t){e=+e,r=+r,t=(l=arguments.length)<2?(r=e,e=0,1):l<3?1:+t;for(var n=-1,l=Math.max(0,Math.ceil((r-e)/t))|0,i=new Array(l);++n>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):t===8?Hh(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):t===4?Hh(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=yW.exec(e))?new hi(r[1],r[2],r[3],1):(r=vW.exec(e))?new hi(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=wW.exec(e))?Hh(r[1],r[2],r[3],r[4]):(r=_W.exec(e))?Hh(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=jW.exec(e))?$6(r[1],r[2]/100,r[3]/100,1):(r=SW.exec(e))?$6(r[1],r[2]/100,r[3]/100,r[4]):R6.hasOwnProperty(e)?F6(R6[e]):e==="transparent"?new hi(NaN,NaN,NaN,0):null}function F6(e){return new hi(e>>16&255,e>>8&255,e&255,1)}function Hh(e,r,t,n){return n<=0&&(e=r=t=NaN),new hi(e,r,t,n)}function CW(e){return e instanceof ef||(e=Dd(e)),e?(e=e.rgb(),new hi(e.r,e.g,e.b,e.opacity)):new hi}function Iv(e,r,t,n){return arguments.length===1?CW(e):new hi(e,r,t,n??1)}function hi(e,r,t,n){this.r=+e,this.g=+r,this.b=+t,this.opacity=+n}x2(hi,Iv,mE(ef,{brighter(e){return e=e==null?tp:Math.pow(tp,e),new hi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Id:Math.pow(Id,e),new hi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new hi(vl(this.r),vl(this.g),vl(this.b),rp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:B6,formatHex:B6,formatHex8:EW,formatRgb:z6,toString:z6}));function B6(){return`#${pl(this.r)}${pl(this.g)}${pl(this.b)}`}function EW(){return`#${pl(this.r)}${pl(this.g)}${pl(this.b)}${pl((isNaN(this.opacity)?1:this.opacity)*255)}`}function z6(){const e=rp(this.opacity);return`${e===1?"rgb(":"rgba("}${vl(this.r)}, ${vl(this.g)}, ${vl(this.b)}${e===1?")":`, ${e})`}`}function rp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function vl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function pl(e){return e=vl(e),(e<16?"0":"")+e.toString(16)}function $6(e,r,t,n){return n<=0?e=r=t=NaN:t<=0||t>=1?e=r=NaN:r<=0&&(e=NaN),new ps(e,r,t,n)}function pE(e){if(e instanceof ps)return new ps(e.h,e.s,e.l,e.opacity);if(e instanceof ef||(e=Dd(e)),!e)return new ps;if(e instanceof ps)return e;e=e.rgb();var r=e.r/255,t=e.g/255,n=e.b/255,l=Math.min(r,t,n),i=Math.max(r,t,n),o=NaN,u=i-l,c=(i+l)/2;return u?(r===i?o=(t-n)/u+(t0&&c<1?0:o,new ps(o,u,c,e.opacity)}function AW(e,r,t,n){return arguments.length===1?pE(e):new ps(e,r,t,n??1)}function ps(e,r,t,n){this.h=+e,this.s=+r,this.l=+t,this.opacity=+n}x2(ps,AW,mE(ef,{brighter(e){return e=e==null?tp:Math.pow(tp,e),new ps(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Id:Math.pow(Id,e),new ps(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*r,l=2*t-n;return new hi(Vb(e>=240?e-240:e+120,l,n),Vb(e,l,n),Vb(e<120?e+240:e-120,l,n),this.opacity)},clamp(){return new ps(U6(this.h),Wh(this.s),Wh(this.l),rp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=rp(this.opacity);return`${e===1?"hsl(":"hsla("}${U6(this.h)}, ${Wh(this.s)*100}%, ${Wh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function U6(e){return e=(e||0)%360,e<0?e+360:e}function Wh(e){return Math.max(0,Math.min(1,e||0))}function Vb(e,r,t){return(e<60?r+(t-r)*e/60:e<180?t:e<240?r+(t-r)*(240-e)/60:r)*255}const b2=e=>()=>e;function MW(e,r){return function(t){return e+t*r}}function OW(e,r,t){return e=Math.pow(e,t),r=Math.pow(r,t)-e,t=1/t,function(n){return Math.pow(e+n*r,t)}}function PW(e){return(e=+e)==1?gE:function(r,t){return t-r?OW(r,t,e):b2(isNaN(r)?t:r)}}function gE(e,r){var t=r-e;return t?MW(e,t):b2(isNaN(e)?r:e)}const V6=(function e(r){var t=PW(r);function n(l,i){var o=t((l=Iv(l)).r,(i=Iv(i)).r),u=t(l.g,i.g),c=t(l.b,i.b),s=gE(l.opacity,i.opacity);return function(d){return l.r=o(d),l.g=u(d),l.b=c(d),l.opacity=s(d),l+""}}return n.gamma=e,n})(1);function TW(e,r){r||(r=[]);var t=e?Math.min(r.length,e.length):0,n=r.slice(),l;return function(i){for(l=0;lt&&(i=r.slice(t,i),u[o]?u[o]+=i:u[++o]=i),(n=n[0])===(l=l[0])?u[o]?u[o]+=l:u[++o]=l:(u[++o]=null,c.push({i:o,x:np(n,l)})),t=qb.lastIndex;return tr&&(t=e,e=r,r=t),function(n){return Math.max(e,Math.min(r,n))}}function qW(e,r,t){var n=e[0],l=e[1],i=r[0],o=r[1];return l2?HW:qW,c=s=null,f}function f(h){return h==null||isNaN(h=+h)?i:(c||(c=u(e.map(n),r,t)))(n(o(h)))}return f.invert=function(h){return o(l((s||(s=u(r,e.map(n),np)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,ip),d()):e.slice()},f.range=function(h){return arguments.length?(r=Array.from(h),d()):r.slice()},f.rangeRound=function(h){return r=Array.from(h),t=y2,d()},f.clamp=function(h){return arguments.length?(o=h?!0:ri,d()):o!==ri},f.interpolate=function(h){return arguments.length?(t=h,d()):t},f.unknown=function(h){return arguments.length?(i=h,f):i},function(h,m){return n=h,l=m,d()}}function v2(){return l0()(ri,ri)}function WW(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function sp(e,r){if(!isFinite(e)||e===0)return null;var t=(e=r?e.toExponential(r-1):e.toExponential()).indexOf("e"),n=e.slice(0,t);return[n.length>1?n[0]+n.slice(2):n,+e.slice(t+1)]}function Fc(e){return e=sp(Math.abs(e)),e?e[1]:NaN}function KW(e,r){return function(t,n){for(var l=t.length,i=[],o=0,u=e[0],c=0;l>0&&u>0&&(c+u+1>n&&(u=Math.max(1,n-c)),i.push(t.substring(l-=u,l+u)),!((c+=u+1)>n));)u=e[o=(o+1)%e.length];return i.reverse().join(r)}}function XW(e){return function(r){return r.replace(/[0-9]/g,function(t){return e[+t]})}}var GW=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ld(e){if(!(r=GW.exec(e)))throw new Error("invalid format: "+e);var r;return new w2({fill:r[1],align:r[2],sign:r[3],symbol:r[4],zero:r[5],width:r[6],comma:r[7],precision:r[8]&&r[8].slice(1),trim:r[9],type:r[10]})}Ld.prototype=w2.prototype;function w2(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}w2.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function YW(e){e:for(var r=e.length,t=1,n=-1,l;t0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(l+1):e}var ap;function ZW(e,r){var t=sp(e,r);if(!t)return ap=void 0,e.toPrecision(r);var n=t[0],l=t[1],i=l-(ap=Math.max(-8,Math.min(8,Math.floor(l/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+sp(e,Math.max(0,r+i-1))[0]}function H6(e,r){var t=sp(e,r);if(!t)return e+"";var n=t[0],l=t[1];return l<0?"0."+new Array(-l).join("0")+n:n.length>l+1?n.slice(0,l+1)+"."+n.slice(l+1):n+new Array(l-n.length+2).join("0")}const W6={"%":(e,r)=>(e*100).toFixed(r),b:e=>Math.round(e).toString(2),c:e=>e+"",d:WW,e:(e,r)=>e.toExponential(r),f:(e,r)=>e.toFixed(r),g:(e,r)=>e.toPrecision(r),o:e=>Math.round(e).toString(8),p:(e,r)=>H6(e*100,r),r:H6,s:ZW,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function K6(e){return e}var X6=Array.prototype.map,G6=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function QW(e){var r=e.grouping===void 0||e.thousands===void 0?K6:KW(X6.call(e.grouping,Number),e.thousands+""),t=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",l=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?K6:XW(X6.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function s(f,h){f=Ld(f);var m=f.fill,p=f.align,x=f.sign,g=f.symbol,y=f.zero,v=f.width,_=f.comma,C=f.precision,M=f.trim,T=f.type;T==="n"?(_=!0,T="g"):W6[T]||(C===void 0&&(C=12),M=!0,T="g"),(y||m==="0"&&p==="=")&&(y=!0,m="0",p="=");var U=(h&&h.prefix!==void 0?h.prefix:"")+(g==="$"?t:g==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():""),F=(g==="$"?n:/[%p]/.test(T)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),H=W6[T],W=/[defgprs%]/.test(T);C=C===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function K($){var P=U,L=F,E,j,k;if(T==="c")L=H($)+L,$="";else{$=+$;var S=$<0||1/$<0;if($=isNaN($)?c:H(Math.abs($),C),M&&($=YW($)),S&&+$==0&&x!=="+"&&(S=!1),P=(S?x==="("?x:u:x==="-"||x==="("?"":x)+P,L=(T==="s"&&!isNaN($)&&ap!==void 0?G6[8+ap/3]:"")+L+(S&&x==="("?")":""),W){for(E=-1,j=$.length;++Ek||k>57){L=(k===46?l+$.slice(E+1):$.slice(E))+L,$=$.slice(0,E);break}}}_&&!y&&($=r($,1/0));var N=P.length+$.length+L.length,O=N>1)+P+$+L+O.slice(N);break;default:$=O+P+$+L;break}return i($)}return K.toString=function(){return f+""},K}function d(f,h){var m=Math.max(-8,Math.min(8,Math.floor(Fc(h)/3)))*3,p=Math.pow(10,-m),x=s((f=Ld(f),f.type="f",f),{suffix:G6[8+m/3]});return function(g){return x(p*g)}}return{format:s,formatPrefix:d}}var Kh,_2,xE;JW({thousands:",",grouping:[3],currency:["$",""]});function JW(e){return Kh=QW(e),_2=Kh.format,xE=Kh.formatPrefix,Kh}function eK(e){return Math.max(0,-Fc(Math.abs(e)))}function tK(e,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Fc(r)/3)))*3-Fc(Math.abs(e)))}function rK(e,r){return e=Math.abs(e),r=Math.abs(r)-e,Math.max(0,Fc(r)-Fc(e))+1}function bE(e,r,t,n){var l=Pv(e,r,t),i;switch(n=Ld(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(r));return n.precision==null&&!isNaN(i=tK(l,o))&&(n.precision=i),xE(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=rK(l,Math.max(Math.abs(e),Math.abs(r))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=eK(l))&&(n.precision=i-(n.type==="%")*2);break}}return _2(n)}function Eo(e){var r=e.domain;return e.ticks=function(t){var n=r();return Mv(n[0],n[n.length-1],t??10)},e.tickFormat=function(t,n){var l=r();return bE(l[0],l[l.length-1],t??10,n)},e.nice=function(t){t==null&&(t=10);var n=r(),l=0,i=n.length-1,o=n[l],u=n[i],c,s,d=10;for(u0;){if(s=Ov(o,u,t),s===c)return n[l]=o,n[i]=u,r(n);if(s>0)o=Math.floor(o/s)*s,u=Math.ceil(u/s)*s;else if(s<0)o=Math.ceil(o*s)/s,u=Math.floor(u*s)/s;else break;c=s}return e},e}function yE(){var e=v2();return e.copy=function(){return tf(e,yE())},Gi.apply(e,arguments),Eo(e)}function vE(e){var r;function t(n){return n==null||isNaN(n=+n)?r:n}return t.invert=t,t.domain=t.range=function(n){return arguments.length?(e=Array.from(n,ip),t):e.slice()},t.unknown=function(n){return arguments.length?(r=n,t):r},t.copy=function(){return vE(e).unknown(r)},e=arguments.length?Array.from(e,ip):[0,1],Eo(t)}function wE(e,r){e=e.slice();var t=0,n=e.length-1,l=e[t],i=e[n],o;return iMath.pow(e,r)}function oK(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),r=>Math.log(r)/e)}function Q6(e){return(r,t)=>-e(-r,t)}function j2(e){const r=e(Y6,Z6),t=r.domain;let n=10,l,i;function o(){return l=oK(n),i=aK(n),t()[0]<0?(l=Q6(l),i=Q6(i),e(nK,iK)):e(Y6,Z6),r}return r.base=function(u){return arguments.length?(n=+u,o()):n},r.domain=function(u){return arguments.length?(t(u),o()):t()},r.ticks=u=>{const c=t();let s=c[0],d=c[c.length-1];const f=d0){for(;h<=m;++h)for(p=1;pd)break;y.push(x)}}else for(;h<=m;++h)for(p=n-1;p>=1;--p)if(x=h>0?p/i(-h):p*i(h),!(xd)break;y.push(x)}y.length*2{if(u==null&&(u=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=Ld(c)).precision==null&&(c.trim=!0),c=_2(c)),u===1/0)return c;const s=Math.max(1,n*u/r.ticks().length);return d=>{let f=d/i(Math.round(l(d)));return f*nt(wE(t(),{floor:u=>i(Math.floor(l(u))),ceil:u=>i(Math.ceil(l(u)))})),r}function _E(){const e=j2(l0()).domain([1,10]);return e.copy=()=>tf(e,_E()).base(e.base()),Gi.apply(e,arguments),e}function J6(e){return function(r){return Math.sign(r)*Math.log1p(Math.abs(r/e))}}function eS(e){return function(r){return Math.sign(r)*Math.expm1(Math.abs(r))*e}}function S2(e){var r=1,t=e(J6(r),eS(r));return t.constant=function(n){return arguments.length?e(J6(r=+n),eS(r)):r},Eo(t)}function jE(){var e=S2(l0());return e.copy=function(){return tf(e,jE()).constant(e.constant())},Gi.apply(e,arguments)}function tS(e){return function(r){return r<0?-Math.pow(-r,e):Math.pow(r,e)}}function lK(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function cK(e){return e<0?-e*e:e*e}function k2(e){var r=e(ri,ri),t=1;function n(){return t===1?e(ri,ri):t===.5?e(lK,cK):e(tS(t),tS(1/t))}return r.exponent=function(l){return arguments.length?(t=+l,n()):t},Eo(r)}function N2(){var e=k2(l0());return e.copy=function(){return tf(e,N2()).exponent(e.exponent())},Gi.apply(e,arguments),e}function uK(){return N2.apply(null,arguments).exponent(.5)}function rS(e){return Math.sign(e)*e*e}function dK(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function SE(){var e=v2(),r=[0,1],t=!1,n;function l(i){var o=dK(e(i));return isNaN(o)?n:t?Math.round(o):o}return l.invert=function(i){return e.invert(rS(i))},l.domain=function(i){return arguments.length?(e.domain(i),l):e.domain()},l.range=function(i){return arguments.length?(e.range((r=Array.from(i,ip)).map(rS)),l):r.slice()},l.rangeRound=function(i){return l.range(i).round(!0)},l.round=function(i){return arguments.length?(t=!!i,l):t},l.clamp=function(i){return arguments.length?(e.clamp(i),l):e.clamp()},l.unknown=function(i){return arguments.length?(n=i,l):n},l.copy=function(){return SE(e.domain(),r).round(t).clamp(e.clamp()).unknown(n)},Gi.apply(l,arguments),Eo(l)}function kE(){var e=[],r=[],t=[],n;function l(){var o=0,u=Math.max(1,r.length);for(t=new Array(u-1);++o0?t[u-1]:e[0],u=t?[n[t-1],r]:[n[s-1],n[s]]},o.unknown=function(c){return arguments.length&&(i=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return NE().domain([e,r]).range(l).unknown(i)},Gi.apply(Eo(o),arguments)}function CE(){var e=[.5],r=[0,1],t,n=1;function l(i){return i!=null&&i<=i?r[Jd(e,i,0,n)]:t}return l.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,r.length-1),l):e.slice()},l.range=function(i){return arguments.length?(r=Array.from(i),n=Math.min(e.length,r.length-1),l):r.slice()},l.invertExtent=function(i){var o=r.indexOf(i);return[e[o-1],e[o]]},l.unknown=function(i){return arguments.length?(t=i,l):t},l.copy=function(){return CE().domain(e).range(r).unknown(t)},Gi.apply(l,arguments)}const Hb=new Date,Wb=new Date;function rn(e,r,t,n){function l(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return l.floor=i=>(e(i=new Date(+i)),i),l.ceil=i=>(e(i=new Date(i-1)),r(i,1),e(i),i),l.round=i=>{const o=l(i),u=l.ceil(i);return i-o(r(i=new Date(+i),o==null?1:Math.floor(o)),i),l.range=(i,o,u)=>{const c=[];if(i=l.ceil(i),u=u==null?1:Math.floor(u),!(i0))return c;let s;do c.push(s=new Date(+i)),r(i,u),e(i);while(srn(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;r(o,-1),!i(o););else for(;--u>=0;)for(;r(o,1),!i(o););}),t&&(l.count=(i,o)=>(Hb.setTime(+i),Wb.setTime(+o),e(Hb),e(Wb),Math.floor(t(Hb,Wb))),l.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?l.filter(n?o=>n(o)%i===0:o=>l.count(0,o)%i===0):l)),l}const op=rn(()=>{},(e,r)=>{e.setTime(+e+r)},(e,r)=>r-e);op.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?rn(r=>{r.setTime(Math.floor(r/e)*e)},(r,t)=>{r.setTime(+r+t*e)},(r,t)=>(t-r)/e):op);op.range;const ma=1e3,qi=ma*60,pa=qi*60,ka=pa*24,C2=ka*7,nS=ka*30,Kb=ka*365,gl=rn(e=>{e.setTime(e-e.getMilliseconds())},(e,r)=>{e.setTime(+e+r*ma)},(e,r)=>(r-e)/ma,e=>e.getUTCSeconds());gl.range;const E2=rn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ma)},(e,r)=>{e.setTime(+e+r*qi)},(e,r)=>(r-e)/qi,e=>e.getMinutes());E2.range;const A2=rn(e=>{e.setUTCSeconds(0,0)},(e,r)=>{e.setTime(+e+r*qi)},(e,r)=>(r-e)/qi,e=>e.getUTCMinutes());A2.range;const M2=rn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ma-e.getMinutes()*qi)},(e,r)=>{e.setTime(+e+r*pa)},(e,r)=>(r-e)/pa,e=>e.getHours());M2.range;const O2=rn(e=>{e.setUTCMinutes(0,0,0)},(e,r)=>{e.setTime(+e+r*pa)},(e,r)=>(r-e)/pa,e=>e.getUTCHours());O2.range;const rf=rn(e=>e.setHours(0,0,0,0),(e,r)=>e.setDate(e.getDate()+r),(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*qi)/ka,e=>e.getDate()-1);rf.range;const c0=rn(e=>{e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r)},(e,r)=>(r-e)/ka,e=>e.getUTCDate()-1);c0.range;const EE=rn(e=>{e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r)},(e,r)=>(r-e)/ka,e=>Math.floor(e/ka));EE.range;function Ol(e){return rn(r=>{r.setDate(r.getDate()-(r.getDay()+7-e)%7),r.setHours(0,0,0,0)},(r,t)=>{r.setDate(r.getDate()+t*7)},(r,t)=>(t-r-(t.getTimezoneOffset()-r.getTimezoneOffset())*qi)/C2)}const u0=Ol(0),lp=Ol(1),fK=Ol(2),hK=Ol(3),Bc=Ol(4),mK=Ol(5),pK=Ol(6);u0.range;lp.range;fK.range;hK.range;Bc.range;mK.range;pK.range;function Pl(e){return rn(r=>{r.setUTCDate(r.getUTCDate()-(r.getUTCDay()+7-e)%7),r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCDate(r.getUTCDate()+t*7)},(r,t)=>(t-r)/C2)}const d0=Pl(0),cp=Pl(1),gK=Pl(2),xK=Pl(3),zc=Pl(4),bK=Pl(5),yK=Pl(6);d0.range;cp.range;gK.range;xK.range;zc.range;bK.range;yK.range;const P2=rn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,r)=>{e.setMonth(e.getMonth()+r)},(e,r)=>r.getMonth()-e.getMonth()+(r.getFullYear()-e.getFullYear())*12,e=>e.getMonth());P2.range;const T2=rn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCMonth(e.getUTCMonth()+r)},(e,r)=>r.getUTCMonth()-e.getUTCMonth()+(r.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());T2.range;const Na=rn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r)},(e,r)=>r.getFullYear()-e.getFullYear(),e=>e.getFullYear());Na.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:rn(r=>{r.setFullYear(Math.floor(r.getFullYear()/e)*e),r.setMonth(0,1),r.setHours(0,0,0,0)},(r,t)=>{r.setFullYear(r.getFullYear()+t*e)});Na.range;const Ca=rn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r)},(e,r)=>r.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ca.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:rn(r=>{r.setUTCFullYear(Math.floor(r.getUTCFullYear()/e)*e),r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCFullYear(r.getUTCFullYear()+t*e)});Ca.range;function AE(e,r,t,n,l,i){const o=[[gl,1,ma],[gl,5,5*ma],[gl,15,15*ma],[gl,30,30*ma],[i,1,qi],[i,5,5*qi],[i,15,15*qi],[i,30,30*qi],[l,1,pa],[l,3,3*pa],[l,6,6*pa],[l,12,12*pa],[n,1,ka],[n,2,2*ka],[t,1,C2],[r,1,nS],[r,3,3*nS],[e,1,Kb]];function u(s,d,f){const h=dg).right(o,h);if(m===o.length)return e.every(Pv(s/Kb,d/Kb,f));if(m===0)return op.every(Math.max(Pv(s,d,f),1));const[p,x]=o[h/o[m-1][2]53)return null;"w"in se||(se.w=1),"Z"in se?(re=Gb(Ju(se.y,0,1)),ue=re.getUTCDay(),re=ue>4||ue===0?cp.ceil(re):cp(re),re=c0.offset(re,(se.V-1)*7),se.y=re.getUTCFullYear(),se.m=re.getUTCMonth(),se.d=re.getUTCDate()+(se.w+6)%7):(re=Xb(Ju(se.y,0,1)),ue=re.getDay(),re=ue>4||ue===0?lp.ceil(re):lp(re),re=rf.offset(re,(se.V-1)*7),se.y=re.getFullYear(),se.m=re.getMonth(),se.d=re.getDate()+(se.w+6)%7)}else("W"in se||"U"in se)&&("w"in se||(se.w="u"in se?se.u%7:"W"in se?1:0),ue="Z"in se?Gb(Ju(se.y,0,1)).getUTCDay():Xb(Ju(se.y,0,1)).getDay(),se.m=0,se.d="W"in se?(se.w+6)%7+se.W*7-(ue+5)%7:se.w+se.U*7-(ue+6)%7);return"Z"in se?(se.H+=se.Z/100|0,se.M+=se.Z%100,Gb(se)):Xb(se)}}function F(I,X,te,se){for(var Q=0,re=X.length,ue=te.length,ae,ie;Q=ue)return-1;if(ae=X.charCodeAt(Q++),ae===37){if(ae=X.charAt(Q++),ie=M[ae in iS?X.charAt(Q++):ae],!ie||(se=ie(I,te,se))<0)return-1}else if(ae!=te.charCodeAt(se++))return-1}return se}function H(I,X,te){var se=s.exec(X.slice(te));return se?(I.p=d.get(se[0].toLowerCase()),te+se[0].length):-1}function W(I,X,te){var se=m.exec(X.slice(te));return se?(I.w=p.get(se[0].toLowerCase()),te+se[0].length):-1}function K(I,X,te){var se=f.exec(X.slice(te));return se?(I.w=h.get(se[0].toLowerCase()),te+se[0].length):-1}function $(I,X,te){var se=y.exec(X.slice(te));return se?(I.m=v.get(se[0].toLowerCase()),te+se[0].length):-1}function P(I,X,te){var se=x.exec(X.slice(te));return se?(I.m=g.get(se[0].toLowerCase()),te+se[0].length):-1}function L(I,X,te){return F(I,r,X,te)}function E(I,X,te){return F(I,t,X,te)}function j(I,X,te){return F(I,n,X,te)}function k(I){return o[I.getDay()]}function S(I){return i[I.getDay()]}function N(I){return c[I.getMonth()]}function O(I){return u[I.getMonth()]}function D(I){return l[+(I.getHours()>=12)]}function B(I){return 1+~~(I.getMonth()/3)}function Y(I){return o[I.getUTCDay()]}function Z(I){return i[I.getUTCDay()]}function ne(I){return c[I.getUTCMonth()]}function q(I){return u[I.getUTCMonth()]}function ee(I){return l[+(I.getUTCHours()>=12)]}function z(I){return 1+~~(I.getUTCMonth()/3)}return{format:function(I){var X=T(I+="",_);return X.toString=function(){return I},X},parse:function(I){var X=U(I+="",!1);return X.toString=function(){return I},X},utcFormat:function(I){var X=T(I+="",C);return X.toString=function(){return I},X},utcParse:function(I){var X=U(I+="",!0);return X.toString=function(){return I},X}}}var iS={"-":"",_:" ",0:"0"},bn=/^\s*\d+/,kK=/^%/,NK=/[\\^$*+?|[\]().{}]/g;function sr(e,r,t){var n=e<0?"-":"",l=(n?-e:e)+"",i=l.length;return n+(i[r.toLowerCase(),t]))}function EK(e,r,t){var n=bn.exec(r.slice(t,t+1));return n?(e.w=+n[0],t+n[0].length):-1}function AK(e,r,t){var n=bn.exec(r.slice(t,t+1));return n?(e.u=+n[0],t+n[0].length):-1}function MK(e,r,t){var n=bn.exec(r.slice(t,t+2));return n?(e.U=+n[0],t+n[0].length):-1}function OK(e,r,t){var n=bn.exec(r.slice(t,t+2));return n?(e.V=+n[0],t+n[0].length):-1}function PK(e,r,t){var n=bn.exec(r.slice(t,t+2));return n?(e.W=+n[0],t+n[0].length):-1}function sS(e,r,t){var n=bn.exec(r.slice(t,t+4));return n?(e.y=+n[0],t+n[0].length):-1}function aS(e,r,t){var n=bn.exec(r.slice(t,t+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),t+n[0].length):-1}function TK(e,r,t){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(r.slice(t,t+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),t+n[0].length):-1}function IK(e,r,t){var n=bn.exec(r.slice(t,t+1));return n?(e.q=n[0]*3-3,t+n[0].length):-1}function RK(e,r,t){var n=bn.exec(r.slice(t,t+2));return n?(e.m=n[0]-1,t+n[0].length):-1}function oS(e,r,t){var n=bn.exec(r.slice(t,t+2));return n?(e.d=+n[0],t+n[0].length):-1}function DK(e,r,t){var n=bn.exec(r.slice(t,t+3));return n?(e.m=0,e.d=+n[0],t+n[0].length):-1}function lS(e,r,t){var n=bn.exec(r.slice(t,t+2));return n?(e.H=+n[0],t+n[0].length):-1}function LK(e,r,t){var n=bn.exec(r.slice(t,t+2));return n?(e.M=+n[0],t+n[0].length):-1}function FK(e,r,t){var n=bn.exec(r.slice(t,t+2));return n?(e.S=+n[0],t+n[0].length):-1}function BK(e,r,t){var n=bn.exec(r.slice(t,t+3));return n?(e.L=+n[0],t+n[0].length):-1}function zK(e,r,t){var n=bn.exec(r.slice(t,t+6));return n?(e.L=Math.floor(n[0]/1e3),t+n[0].length):-1}function $K(e,r,t){var n=kK.exec(r.slice(t,t+1));return n?t+n[0].length:-1}function UK(e,r,t){var n=bn.exec(r.slice(t));return n?(e.Q=+n[0],t+n[0].length):-1}function VK(e,r,t){var n=bn.exec(r.slice(t));return n?(e.s=+n[0],t+n[0].length):-1}function cS(e,r){return sr(e.getDate(),r,2)}function qK(e,r){return sr(e.getHours(),r,2)}function HK(e,r){return sr(e.getHours()%12||12,r,2)}function WK(e,r){return sr(1+rf.count(Na(e),e),r,3)}function ME(e,r){return sr(e.getMilliseconds(),r,3)}function KK(e,r){return ME(e,r)+"000"}function XK(e,r){return sr(e.getMonth()+1,r,2)}function GK(e,r){return sr(e.getMinutes(),r,2)}function YK(e,r){return sr(e.getSeconds(),r,2)}function ZK(e){var r=e.getDay();return r===0?7:r}function QK(e,r){return sr(u0.count(Na(e)-1,e),r,2)}function OE(e){var r=e.getDay();return r>=4||r===0?Bc(e):Bc.ceil(e)}function JK(e,r){return e=OE(e),sr(Bc.count(Na(e),e)+(Na(e).getDay()===4),r,2)}function eX(e){return e.getDay()}function tX(e,r){return sr(lp.count(Na(e)-1,e),r,2)}function rX(e,r){return sr(e.getFullYear()%100,r,2)}function nX(e,r){return e=OE(e),sr(e.getFullYear()%100,r,2)}function iX(e,r){return sr(e.getFullYear()%1e4,r,4)}function sX(e,r){var t=e.getDay();return e=t>=4||t===0?Bc(e):Bc.ceil(e),sr(e.getFullYear()%1e4,r,4)}function aX(e){var r=e.getTimezoneOffset();return(r>0?"-":(r*=-1,"+"))+sr(r/60|0,"0",2)+sr(r%60,"0",2)}function uS(e,r){return sr(e.getUTCDate(),r,2)}function oX(e,r){return sr(e.getUTCHours(),r,2)}function lX(e,r){return sr(e.getUTCHours()%12||12,r,2)}function cX(e,r){return sr(1+c0.count(Ca(e),e),r,3)}function PE(e,r){return sr(e.getUTCMilliseconds(),r,3)}function uX(e,r){return PE(e,r)+"000"}function dX(e,r){return sr(e.getUTCMonth()+1,r,2)}function fX(e,r){return sr(e.getUTCMinutes(),r,2)}function hX(e,r){return sr(e.getUTCSeconds(),r,2)}function mX(e){var r=e.getUTCDay();return r===0?7:r}function pX(e,r){return sr(d0.count(Ca(e)-1,e),r,2)}function TE(e){var r=e.getUTCDay();return r>=4||r===0?zc(e):zc.ceil(e)}function gX(e,r){return e=TE(e),sr(zc.count(Ca(e),e)+(Ca(e).getUTCDay()===4),r,2)}function xX(e){return e.getUTCDay()}function bX(e,r){return sr(cp.count(Ca(e)-1,e),r,2)}function yX(e,r){return sr(e.getUTCFullYear()%100,r,2)}function vX(e,r){return e=TE(e),sr(e.getUTCFullYear()%100,r,2)}function wX(e,r){return sr(e.getUTCFullYear()%1e4,r,4)}function _X(e,r){var t=e.getUTCDay();return e=t>=4||t===0?zc(e):zc.ceil(e),sr(e.getUTCFullYear()%1e4,r,4)}function jX(){return"+0000"}function dS(){return"%"}function fS(e){return+e}function hS(e){return Math.floor(+e/1e3)}var xc,IE,RE;SX({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function SX(e){return xc=SK(e),IE=xc.format,xc.parse,RE=xc.utcFormat,xc.utcParse,xc}function kX(e){return new Date(e)}function NX(e){return e instanceof Date?+e:+new Date(+e)}function I2(e,r,t,n,l,i,o,u,c,s){var d=v2(),f=d.invert,h=d.domain,m=s(".%L"),p=s(":%S"),x=s("%I:%M"),g=s("%I %p"),y=s("%a %d"),v=s("%b %d"),_=s("%B"),C=s("%Y");function M(T){return(c(T)r(l/(e.length-1)))},t.quantiles=function(n){return Array.from({length:n+1},(l,i)=>mW(e,i/n))},t.copy=function(){return BE(r).domain(e)},Ta.apply(t,arguments)}function h0(){var e=0,r=.5,t=1,n=1,l,i,o,u,c,s=ri,d,f=!1,h;function m(x){return isNaN(x=+x)?h:(x=.5+((x=+d(x))-i)*(n*xe.chartData,VE=Te([Ia],e=>{var r=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:r,dataStartIndex:0}}),L2=(e,r,t,n)=>n?VE(e):Ia(e),OX=(e,r,t)=>t?VE(e):Ia(e);function _o(e){if(Array.isArray(e)&&e.length===2){var[r,t]=e;if(Rr(r)&&Rr(t))return!0}return!1}function mS(e,r,t){return t?e:[Math.min(e[0],r[0]),Math.max(e[1],r[1])]}function qE(e,r){if(r&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[t,n]=e,l,i;if(Rr(t))l=t;else if(typeof t=="function")return;if(Rr(n))i=n;else if(typeof n=="function")return;var o=[l,i];if(_o(o))return o}}function PX(e,r,t){if(!(!t&&r==null)){if(typeof e=="function"&&r!=null)try{var n=e(r,t);if(_o(n))return mS(n,r,t)}catch{}if(Array.isArray(e)&&e.length===2){var[l,i]=e,o,u;if(l==="auto")r!=null&&(o=Math.min(...r));else if(xt(l))o=l;else if(typeof l=="function")try{r!=null&&(o=l(r?.[0]))}catch{}else if(typeof l=="string"&&k5.test(l)){var c=k5.exec(l);if(c==null||c[1]==null||r==null)o=void 0;else{var s=+c[1];o=r[0]-s}}else o=r?.[0];if(i==="auto")r!=null&&(u=Math.max(...r));else if(xt(i))u=i;else if(typeof i=="function")try{r!=null&&(u=i(r?.[1]))}catch{}else if(typeof i=="string"&&N5.test(i)){var d=N5.exec(i);if(d==null||d[1]==null||r==null)u=void 0;else{var f=+d[1];u=r[1]+f}}else u=r?.[1];var h=[o,u];if(_o(h))return r==null?h:mS(h,r,t)}}}var Gc=1e9,TX={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},B2,Cr=!0,Xi="[DecimalError] ",wl=Xi+"Invalid argument: ",F2=Xi+"Exponent out of range: ",Yc=Math.floor,cl=Math.pow,IX=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Si,pn=1e7,_r=7,HE=9007199254740991,up=Yc(HE/_r),pt={};pt.absoluteValue=pt.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};pt.comparedTo=pt.cmp=function(e){var r,t,n,l,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,l=e.d.length,r=0,t=ne.d[r]^i.s<0?1:-1;return n===l?0:n>l^i.s<0?1:-1};pt.decimalPlaces=pt.dp=function(){var e=this,r=e.d.length-1,t=(r-e.e)*_r;if(r=e.d[r],r)for(;r%10==0;r/=10)t--;return t<0?0:t};pt.dividedBy=pt.div=function(e){return ba(this,new this.constructor(e))};pt.dividedToIntegerBy=pt.idiv=function(e){var r=this,t=r.constructor;return br(ba(r,new t(e),0,1),t.precision)};pt.equals=pt.eq=function(e){return!this.cmp(e)};pt.exponent=function(){return Zr(this)};pt.greaterThan=pt.gt=function(e){return this.cmp(e)>0};pt.greaterThanOrEqualTo=pt.gte=function(e){return this.cmp(e)>=0};pt.isInteger=pt.isint=function(){return this.e>this.d.length-2};pt.isNegative=pt.isneg=function(){return this.s<0};pt.isPositive=pt.ispos=function(){return this.s>0};pt.isZero=function(){return this.s===0};pt.lessThan=pt.lt=function(e){return this.cmp(e)<0};pt.lessThanOrEqualTo=pt.lte=function(e){return this.cmp(e)<1};pt.logarithm=pt.log=function(e){var r,t=this,n=t.constructor,l=n.precision,i=l+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Si))throw Error(Xi+"NaN");if(t.s<1)throw Error(Xi+(t.s?"NaN":"-Infinity"));return t.eq(Si)?new n(0):(Cr=!1,r=ba(Fd(t,i),Fd(e,i),i),Cr=!0,br(r,l))};pt.minus=pt.sub=function(e){var r=this;return e=new r.constructor(e),r.s==e.s?XE(r,e):WE(r,(e.s=-e.s,e))};pt.modulo=pt.mod=function(e){var r,t=this,n=t.constructor,l=n.precision;if(e=new n(e),!e.s)throw Error(Xi+"NaN");return t.s?(Cr=!1,r=ba(t,e,0,1).times(e),Cr=!0,t.minus(r)):br(new n(t),l)};pt.naturalExponential=pt.exp=function(){return KE(this)};pt.naturalLogarithm=pt.ln=function(){return Fd(this)};pt.negated=pt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};pt.plus=pt.add=function(e){var r=this;return e=new r.constructor(e),r.s==e.s?WE(r,e):XE(r,(e.s=-e.s,e))};pt.precision=pt.sd=function(e){var r,t,n,l=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(wl+e);if(r=Zr(l)+1,n=l.d.length-1,t=n*_r+1,n=l.d[n],n){for(;n%10==0;n/=10)t--;for(n=l.d[0];n>=10;n/=10)t++}return e&&r>t?r:t};pt.squareRoot=pt.sqrt=function(){var e,r,t,n,l,i,o,u=this,c=u.constructor;if(u.s<1){if(!u.s)return new c(0);throw Error(Xi+"NaN")}for(e=Zr(u),Cr=!1,l=Math.sqrt(+u),l==0||l==1/0?(r=Ds(u.d),(r.length+e)%2==0&&(r+="0"),l=Math.sqrt(r),e=Yc((e+1)/2)-(e<0||e%2),l==1/0?r="5e"+e:(r=l.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new c(r)):n=new c(l.toString()),t=c.precision,l=o=t+3;;)if(i=n,n=i.plus(ba(u,i,o+2)).times(.5),Ds(i.d).slice(0,o)===(r=Ds(n.d)).slice(0,o)){if(r=r.slice(o-3,o+1),l==o&&r=="4999"){if(br(i,t+1,0),i.times(i).eq(u)){n=i;break}}else if(r!="9999")break;o+=4}return Cr=!0,br(n,t)};pt.times=pt.mul=function(e){var r,t,n,l,i,o,u,c,s,d=this,f=d.constructor,h=d.d,m=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,t=d.e+e.e,c=h.length,s=m.length,c=0;){for(r=0,l=c+n;l>n;)u=i[l]+m[n]*h[l-n-1]+r,i[l--]=u%pn|0,r=u/pn|0;i[l]=(i[l]+r)%pn|0}for(;!i[--o];)i.pop();return r?++t:i.shift(),e.d=i,e.e=t,Cr?br(e,f.precision):e};pt.toDecimalPlaces=pt.todp=function(e,r){var t=this,n=t.constructor;return t=new n(t),e===void 0?t:(Us(e,0,Gc),r===void 0?r=n.rounding:Us(r,0,8),br(t,e+Zr(t)+1,r))};pt.toExponential=function(e,r){var t,n=this,l=n.constructor;return e===void 0?t=Cl(n,!0):(Us(e,0,Gc),r===void 0?r=l.rounding:Us(r,0,8),n=br(new l(n),e+1,r),t=Cl(n,!0,e+1)),t};pt.toFixed=function(e,r){var t,n,l=this,i=l.constructor;return e===void 0?Cl(l):(Us(e,0,Gc),r===void 0?r=i.rounding:Us(r,0,8),n=br(new i(l),e+Zr(l)+1,r),t=Cl(n.abs(),!1,e+Zr(n)+1),l.isneg()&&!l.isZero()?"-"+t:t)};pt.toInteger=pt.toint=function(){var e=this,r=e.constructor;return br(new r(e),Zr(e)+1,r.rounding)};pt.toNumber=function(){return+this};pt.toPower=pt.pow=function(e){var r,t,n,l,i,o,u=this,c=u.constructor,s=12,d=+(e=new c(e));if(!e.s)return new c(Si);if(u=new c(u),!u.s){if(e.s<1)throw Error(Xi+"Infinity");return u}if(u.eq(Si))return u;if(n=c.precision,e.eq(Si))return br(u,n);if(r=e.e,t=e.d.length-1,o=r>=t,i=u.s,o){if((t=d<0?-d:d)<=HE){for(l=new c(Si),r=Math.ceil(n/_r+4),Cr=!1;t%2&&(l=l.times(u),gS(l.d,r)),t=Yc(t/2),t!==0;)u=u.times(u),gS(u.d,r);return Cr=!0,e.s<0?new c(Si).div(l):br(l,n)}}else if(i<0)throw Error(Xi+"NaN");return i=i<0&&e.d[Math.max(r,t)]&1?-1:1,u.s=1,Cr=!1,l=e.times(Fd(u,n+s)),Cr=!0,l=KE(l),l.s=i,l};pt.toPrecision=function(e,r){var t,n,l=this,i=l.constructor;return e===void 0?(t=Zr(l),n=Cl(l,t<=i.toExpNeg||t>=i.toExpPos)):(Us(e,1,Gc),r===void 0?r=i.rounding:Us(r,0,8),l=br(new i(l),e,r),t=Zr(l),n=Cl(l,e<=t||t<=i.toExpNeg,e)),n};pt.toSignificantDigits=pt.tosd=function(e,r){var t=this,n=t.constructor;return e===void 0?(e=n.precision,r=n.rounding):(Us(e,1,Gc),r===void 0?r=n.rounding:Us(r,0,8)),br(new n(t),e,r)};pt.toString=pt.valueOf=pt.val=pt.toJSON=pt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,r=Zr(e),t=e.constructor;return Cl(e,r<=t.toExpNeg||r>=t.toExpPos)};function WE(e,r){var t,n,l,i,o,u,c,s,d=e.constructor,f=d.precision;if(!e.s||!r.s)return r.s||(r=new d(e)),Cr?br(r,f):r;if(c=e.d,s=r.d,o=e.e,l=r.e,c=c.slice(),i=o-l,i){for(i<0?(n=c,i=-i,u=s.length):(n=s,l=o,u=c.length),o=Math.ceil(f/_r),u=o>u?o+1:u+1,i>u&&(i=u,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(u=c.length,i=s.length,u-i<0&&(i=u,n=s,s=c,c=n),t=0;i;)t=(c[--i]=c[i]+s[i]+t)/pn|0,c[i]%=pn;for(t&&(c.unshift(t),++l),u=c.length;c[--u]==0;)c.pop();return r.d=c,r.e=l,Cr?br(r,f):r}function Us(e,r,t){if(e!==~~e||et)throw Error(wl+e)}function Ds(e){var r,t,n,l=e.length-1,i="",o=e[0];if(l>0){for(i+=o,r=1;ro?1:-1;else for(u=c=0;ul[u]?1:-1;break}return c}function t(n,l,i){for(var o=0;i--;)n[i]-=o,o=n[i]1;)n.shift()}return function(n,l,i,o){var u,c,s,d,f,h,m,p,x,g,y,v,_,C,M,T,U,F,H=n.constructor,W=n.s==l.s?1:-1,K=n.d,$=l.d;if(!n.s)return new H(n);if(!l.s)throw Error(Xi+"Division by zero");for(c=n.e-l.e,U=$.length,M=K.length,m=new H(W),p=m.d=[],s=0;$[s]==(K[s]||0);)++s;if($[s]>(K[s]||0)&&--c,i==null?v=i=H.precision:o?v=i+(Zr(n)-Zr(l))+1:v=i,v<0)return new H(0);if(v=v/_r+2|0,s=0,U==1)for(d=0,$=$[0],v++;(s1&&($=e($,d),K=e(K,d),U=$.length,M=K.length),C=U,x=K.slice(0,U),g=x.length;g=pn/2&&++T;do d=0,u=r($,x,U,g),u<0?(y=x[0],U!=g&&(y=y*pn+(x[1]||0)),d=y/T|0,d>1?(d>=pn&&(d=pn-1),f=e($,d),h=f.length,g=x.length,u=r(f,x,h,g),u==1&&(d--,t(f,U16)throw Error(F2+Zr(e));if(!e.s)return new d(Si);for(Cr=!1,u=f,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),s+=5;for(n=Math.log(cl(2,s))/Math.LN10*2+5|0,u+=n,t=l=i=new d(Si),d.precision=u;;){if(l=br(l.times(e),u),t=t.times(++c),o=i.plus(ba(l,t,u)),Ds(o.d).slice(0,u)===Ds(i.d).slice(0,u)){for(;s--;)i=br(i.times(i),u);return d.precision=f,r==null?(Cr=!0,br(i,f)):i}i=o}}function Zr(e){for(var r=e.e*_r,t=e.d[0];t>=10;t/=10)r++;return r}function Yb(e,r,t){if(r>e.LN10.sd())throw Cr=!0,t&&(e.precision=t),Error(Xi+"LN10 precision limit exceeded");return br(new e(e.LN10),r)}function lo(e){for(var r="";e--;)r+="0";return r}function Fd(e,r){var t,n,l,i,o,u,c,s,d,f=1,h=10,m=e,p=m.d,x=m.constructor,g=x.precision;if(m.s<1)throw Error(Xi+(m.s?"NaN":"-Infinity"));if(m.eq(Si))return new x(0);if(r==null?(Cr=!1,s=g):s=r,m.eq(10))return r==null&&(Cr=!0),Yb(x,s);if(s+=h,x.precision=s,t=Ds(p),n=t.charAt(0),i=Zr(m),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)m=m.times(e),t=Ds(m.d),n=t.charAt(0),f++;i=Zr(m),n>1?(m=new x("0."+t),i++):m=new x(n+"."+t.slice(1))}else return c=Yb(x,s+2,g).times(i+""),m=Fd(new x(n+"."+t.slice(1)),s-h).plus(c),x.precision=g,r==null?(Cr=!0,br(m,g)):m;for(u=o=m=ba(m.minus(Si),m.plus(Si),s),d=br(m.times(m),s),l=3;;){if(o=br(o.times(d),s),c=u.plus(ba(o,new x(l),s)),Ds(c.d).slice(0,s)===Ds(u.d).slice(0,s))return u=u.times(2),i!==0&&(u=u.plus(Yb(x,s+2,g).times(i+""))),u=ba(u,new x(f),s),x.precision=g,r==null?(Cr=!0,br(u,g)):u;u=c,l+=2}}function pS(e,r){var t,n,l;for((t=r.indexOf("."))>-1&&(r=r.replace(".","")),(n=r.search(/e/i))>0?(t<0&&(t=n),t+=+r.slice(n+1),r=r.substring(0,n)):t<0&&(t=r.length),n=0;r.charCodeAt(n)===48;)++n;for(l=r.length;r.charCodeAt(l-1)===48;)--l;if(r=r.slice(n,l),r){if(l-=n,t=t-n-1,e.e=Yc(t/_r),e.d=[],n=(t+1)%_r,t<0&&(n+=_r),nup||e.e<-up))throw Error(F2+t)}else e.s=0,e.e=0,e.d=[0];return e}function br(e,r,t){var n,l,i,o,u,c,s,d,f=e.d;for(o=1,i=f[0];i>=10;i/=10)o++;if(n=r-o,n<0)n+=_r,l=r,s=f[d=0];else{if(d=Math.ceil((n+1)/_r),i=f.length,d>=i)return e;for(s=i=f[d],o=1;i>=10;i/=10)o++;n%=_r,l=n-_r+o}if(t!==void 0&&(i=cl(10,o-l-1),u=s/i%10|0,c=r<0||f[d+1]!==void 0||s%i,c=t<4?(u||c)&&(t==0||t==(e.s<0?3:2)):u>5||u==5&&(t==4||c||t==6&&(n>0?l>0?s/cl(10,o-l):0:f[d-1])%10&1||t==(e.s<0?8:7))),r<1||!f[0])return c?(i=Zr(e),f.length=1,r=r-i-1,f[0]=cl(10,(_r-r%_r)%_r),e.e=Yc(-r/_r)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=d,i=1,d--):(f.length=d+1,i=cl(10,_r-n),f[d]=l>0?(s/cl(10,o-l)%cl(10,l)|0)*i:0),c)for(;;)if(d==0){(f[0]+=i)==pn&&(f[0]=1,++e.e);break}else{if(f[d]+=i,f[d]!=pn)break;f[d--]=0,i=1}for(n=f.length;f[--n]===0;)f.pop();if(Cr&&(e.e>up||e.e<-up))throw Error(F2+Zr(e));return e}function XE(e,r){var t,n,l,i,o,u,c,s,d,f,h=e.constructor,m=h.precision;if(!e.s||!r.s)return r.s?r.s=-r.s:r=new h(e),Cr?br(r,m):r;if(c=e.d,f=r.d,n=r.e,s=e.e,c=c.slice(),o=s-n,o){for(d=o<0,d?(t=c,o=-o,u=f.length):(t=f,n=s,u=c.length),l=Math.max(Math.ceil(m/_r),u)+2,o>l&&(o=l,t.length=1),t.reverse(),l=o;l--;)t.push(0);t.reverse()}else{for(l=c.length,u=f.length,d=l0;--l)c[u++]=0;for(l=f.length;l>o;){if(c[--l]0?i=i.charAt(0)+"."+i.slice(1)+lo(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(l<0?"e":"e+")+l):l<0?(i="0."+lo(-l-1)+i,t&&(n=t-o)>0&&(i+=lo(n))):l>=o?(i+=lo(l+1-o),t&&(n=t-l-1)>0&&(i=i+"."+lo(n))):((n=l+1)0&&(l+1===o&&(i+="."),i+=lo(n))),e.s<0?"-"+i:i}function gS(e,r){if(e.length>r)return e.length=r,!0}function GE(e){var r,t,n;function l(i){var o=this;if(!(o instanceof l))return new l(i);if(o.constructor=l,i instanceof l){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(wl+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return pS(o,i.toString())}else if(typeof i!="string")throw Error(wl+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,IX.test(i))pS(o,i);else throw Error(wl+i)}if(l.prototype=pt,l.ROUND_UP=0,l.ROUND_DOWN=1,l.ROUND_CEIL=2,l.ROUND_FLOOR=3,l.ROUND_HALF_UP=4,l.ROUND_HALF_DOWN=5,l.ROUND_HALF_EVEN=6,l.ROUND_HALF_CEIL=7,l.ROUND_HALF_FLOOR=8,l.clone=GE,l.config=l.set=RX,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],r=0;r=l[r+1]&&n<=l[r+2])this[t]=n;else throw Error(wl+t+": "+n);if((n=e[t="LN10"])!==void 0)if(n==Math.LN10)this[t]=new this(n);else throw Error(wl+t+": "+n);return this}var B2=GE(TX);Si=new B2(1);const dr=B2;var DX=e=>e,YE={},ZE=e=>e===YE,xS=e=>function r(){return arguments.length===0||arguments.length===1&&ZE(arguments.length<=0?void 0:arguments[0])?r:e(...arguments)},QE=(e,r)=>e===1?r:xS(function(){for(var t=arguments.length,n=new Array(t),l=0;lo!==YE).length;return i>=e?r(...n):QE(e-i,xS(function(){for(var o=arguments.length,u=new Array(o),c=0;cZE(d)?u.shift():d);return r(...s,...u)}))}),LX=e=>QE(e.length,e),Lv=(e,r)=>{for(var t=[],n=e;nArray.isArray(r)?r.map(e):Object.keys(r).map(t=>r[t]).map(e)),BX=function(){for(var r=arguments.length,t=new Array(r),n=0;nc(u),i(...arguments))}};function JE(e){var r;return e===0?r=1:r=Math.floor(new dr(e).abs().log(10).toNumber())+1,r}function e9(e,r,t){for(var n=new dr(e),l=0,i=[];n.lt(r)&&l<1e5;)i.push(n.toNumber()),n=n.add(t),l++;return i}var t9=e=>{var[r,t]=e,[n,l]=[r,t];return r>t&&([n,l]=[t,r]),[n,l]},r9=(e,r,t)=>{if(e.lte(0))return new dr(0);var n=JE(e.toNumber()),l=new dr(10).pow(n),i=e.div(l),o=n!==1?.05:.1,u=new dr(Math.ceil(i.div(o).toNumber())).add(t).mul(o),c=u.mul(l);return r?new dr(c.toNumber()):new dr(Math.ceil(c.toNumber()))},zX=(e,r,t)=>{var n=new dr(1),l=new dr(e);if(!l.isint()&&t){var i=Math.abs(e);i<1?(n=new dr(10).pow(JE(e)-1),l=new dr(Math.floor(l.div(n).toNumber())).mul(n)):i>1&&(l=new dr(Math.floor(e)))}else e===0?l=new dr(Math.floor((r-1)/2)):t||(l=new dr(Math.floor(e)));var o=Math.floor((r-1)/2),u=BX(FX(c=>l.add(new dr(c-o).mul(n)).toNumber()),Lv);return u(0,r)},n9=function(r,t,n,l){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-r)/(n-1)))return{step:new dr(0),tickMin:new dr(0),tickMax:new dr(0)};var o=r9(new dr(t).sub(r).div(n-1),l,i),u;r<=0&&t>=0?u=new dr(0):(u=new dr(r).add(t).div(2),u=u.sub(new dr(u).mod(o)));var c=Math.ceil(u.sub(r).div(o).toNumber()),s=Math.ceil(new dr(t).sub(u).div(o).toNumber()),d=c+s+1;return d>n?n9(r,t,n,l,i+1):(d0?s+(n-d):s,c=t>0?c:c+(n-d)),{step:o,tickMin:u.sub(new dr(c).mul(o)),tickMax:u.add(new dr(s).mul(o))})},$X=function(r){var[t,n]=r,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(l,2),[u,c]=t9([t,n]);if(u===-1/0||c===1/0){var s=c===1/0?[u,...Lv(0,l-1).map(()=>1/0)]:[...Lv(0,l-1).map(()=>-1/0),c];return t>n?s.reverse():s}if(u===c)return zX(u,l,i);var{step:d,tickMin:f,tickMax:h}=n9(u,c,o,i,0),m=e9(f,h.add(new dr(.1).mul(d)),d);return t>n?m.reverse():m},UX=function(r,t){var[n,l]=r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[o,u]=t9([n,l]);if(o===-1/0||u===1/0)return[n,l];if(o===u)return[o];var c=Math.max(t,2),s=r9(new dr(u).sub(o).div(c-1),i,0),d=[...e9(new dr(o),new dr(u),s),u];return i===!1&&(d=d.map(f=>Math.round(f))),n>l?d.reverse():d},i9=e=>e.rootProps.maxBarSize,VX=e=>e.rootProps.barGap,s9=e=>e.rootProps.barCategoryGap,qX=e=>e.rootProps.barSize,m0=e=>e.rootProps.stackOffset,a9=e=>e.rootProps.reverseStackOrder,z2=e=>e.options.chartName,$2=e=>e.rootProps.syncId,o9=e=>e.rootProps.syncMethod,U2=e=>e.options.eventEmitter,gn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},fa={allowDuplicatedCategory:!0,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"category"},ji={allowDataOverflow:!1,allowDuplicatedCategory:!0,radiusAxisId:0,scale:"auto",tick:!0,tickCount:5,type:"number"},p0=(e,r)=>{if(!(!e||!r))return e!=null&&e.reversed?[r[1],r[0]]:r},HX={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:fa.angleAxisId,includeHidden:!1,name:void 0,reversed:fa.reversed,scale:fa.scale,tick:fa.tick,tickCount:void 0,ticks:void 0,type:fa.type,unit:void 0},WX={allowDataOverflow:ji.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:ji.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:ji.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:ji.scale,tick:ji.tick,tickCount:ji.tickCount,ticks:void 0,type:ji.type,unit:void 0},KX={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:fa.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:fa.angleAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:fa.scale,tick:fa.tick,tickCount:void 0,ticks:void 0,type:"number",unit:void 0},XX={allowDataOverflow:ji.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:ji.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:ji.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:ji.scale,tick:ji.tick,tickCount:ji.tickCount,ticks:void 0,type:"category",unit:void 0},V2=(e,r)=>e.polarAxis.angleAxis[r]!=null?e.polarAxis.angleAxis[r]:e.layout.layoutType==="radial"?KX:HX,q2=(e,r)=>e.polarAxis.radiusAxis[r]!=null?e.polarAxis.radiusAxis[r]:e.layout.layoutType==="radial"?XX:WX,g0=e=>e.polarOptions,H2=Te([Oa,Pa,xn],UH),l9=Te([g0,H2],(e,r)=>{if(e!=null)return ys(e.innerRadius,r,0)}),c9=Te([g0,H2],(e,r)=>{if(e!=null)return ys(e.outerRadius,r,r*.8)}),GX=e=>{if(e==null)return[0,0];var{startAngle:r,endAngle:t}=e;return[r,t]},u9=Te([g0],GX);Te([V2,u9],p0);var d9=Te([H2,l9,c9],(e,r,t)=>{if(!(e==null||r==null||t==null))return[r,t]});Te([q2,d9],p0);var f9=Te([ar,g0,l9,c9,Oa,Pa],(e,r,t,n,l,i)=>{if(!(e!=="centric"&&e!=="radial"||r==null||t==null||n==null)){var{cx:o,cy:u,startAngle:c,endAngle:s}=r;return{cx:ys(o,l,l/2),cy:ys(u,i,i/2),innerRadius:t,outerRadius:n,startAngle:c,endAngle:s,clockWise:!1}}}),nn=(e,r)=>r,x0=(e,r,t)=>t;function W2(e){return e?.id}function h9(e,r,t){var{chartData:n=[]}=r,{allowDuplicatedCategory:l,dataKey:i}=t,o=new Map;return e.forEach(u=>{var c,s=(c=u.data)!==null&&c!==void 0?c:n;if(!(s==null||s.length===0)){var d=W2(u);s.forEach((f,h)=>{var m=i==null||l?h:String(Yr(f,i,null)),p=Yr(f,u.dataKey,0),x;o.has(m)?x=o.get(m):x={},Object.assign(x,{[d]:p}),o.set(m,x)})}}),Array.from(o.values())}function b0(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var y0=(e,r)=>e===r?!0:e==null||r==null?!1:e[0]===r[0]&&e[1]===r[1];function v0(e,r){return Array.isArray(e)&&Array.isArray(r)&&e.length===0&&r.length===0?!0:e===r}function YX(e,r){if(e.length===r.length){for(var t=0;t{var r=ar(e);return r==="horizontal"?"xAxis":r==="vertical"?"yAxis":r==="centric"?"angleAxis":"radiusAxis"},Zc=e=>e.tooltip.settings.axisId;function bS(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function dp(e){for(var r=1;re.cartesianAxis.xAxis[r],Ra=(e,r)=>{var t=m9(e,r);return t??fn},hn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Fv,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:Zd},p9=(e,r)=>e.cartesianAxis.yAxis[r],Da=(e,r)=>{var t=p9(e,r);return t??hn},eG={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},K2=(e,r)=>{var t=e.cartesianAxis.zAxis[r];return t??eG},si=(e,r,t)=>{switch(r){case"xAxis":return Ra(e,t);case"yAxis":return Da(e,t);case"zAxis":return K2(e,t);case"angleAxis":return V2(e,t);case"radiusAxis":return q2(e,t);default:throw new Error("Unexpected axis type: ".concat(r))}},tG=(e,r,t)=>{switch(r){case"xAxis":return Ra(e,t);case"yAxis":return Da(e,t);default:throw new Error("Unexpected axis type: ".concat(r))}},nf=(e,r,t)=>{switch(r){case"xAxis":return Ra(e,t);case"yAxis":return Da(e,t);case"angleAxis":return V2(e,t);case"radiusAxis":return q2(e,t);default:throw new Error("Unexpected axis type: ".concat(r))}},g9=e=>e.graphicalItems.cartesianItems.some(r=>r.type==="bar")||e.graphicalItems.polarItems.some(r=>r.type==="radialBar");function x9(e,r){return t=>{switch(e){case"xAxis":return"xAxisId"in t&&t.xAxisId===r;case"yAxis":return"yAxisId"in t&&t.yAxisId===r;case"zAxis":return"zAxisId"in t&&t.zAxisId===r;case"angleAxis":return"angleAxisId"in t&&t.angleAxisId===r;case"radiusAxis":return"radiusAxisId"in t&&t.radiusAxisId===r;default:return!1}}}var w0=e=>e.graphicalItems.cartesianItems,rG=Te([nn,x0],x9),b9=(e,r,t)=>e.filter(t).filter(n=>r?.includeHidden===!0?!0:!n.hide),sf=Te([w0,si,rG],b9,{memoizeOptions:{resultEqualityCheck:v0}}),y9=Te([sf],e=>e.filter(r=>r.type==="area"||r.type==="bar").filter(b0)),v9=e=>e.filter(r=>!("stackId"in r)||r.stackId===void 0),nG=Te([sf],v9),w9=e=>e.map(r=>r.data).filter(Boolean).flat(1),iG=Te([sf],w9,{memoizeOptions:{resultEqualityCheck:v0}}),_9=(e,r)=>{var{chartData:t=[],dataStartIndex:n,dataEndIndex:l}=r;return e.length>0?e:t.slice(n,l+1)},X2=Te([iG,L2],_9),j9=(e,r,t)=>r?.dataKey!=null?e.map(n=>({value:Yr(n,r.dataKey)})):t.length>0?t.map(n=>n.dataKey).flatMap(n=>e.map(l=>({value:Yr(l,n)}))):e.map(n=>({value:n})),_0=Te([X2,si,sf],j9);function S9(e,r){switch(e){case"xAxis":return r.direction==="x";case"yAxis":return r.direction==="y";default:return!1}}function dm(e){if(zs(e)||e instanceof Date){var r=Number(e);if(Rr(r))return r}}function yS(e){if(Array.isArray(e)){var r=[dm(e[0]),dm(e[1])];return _o(r)?r:void 0}var t=dm(e);if(t!=null)return[t,t]}function Ea(e){return e.map(dm).filter(qz)}function sG(e,r,t){return!t||typeof r!="number"||bs(r)?[]:t.length?Ea(t.flatMap(n=>{var l=Yr(e,n.dataKey),i,o;if(Array.isArray(l)?[i,o]=l:i=o=l,!(!Rr(i)||!Rr(o)))return[r-i,r+o]})):[]}var an=e=>{var r=sn(e),t=Zc(e);return nf(e,r,t)},af=Te([an],e=>e?.dataKey),aG=Te([y9,L2,an],h9),k9=(e,r,t,n)=>{var l={},i=r.reduce((o,u)=>{if(u.stackId==null)return o;var c=o[u.stackId];return c==null&&(c=[]),c.push(u),o[u.stackId]=c,o},l);return Object.fromEntries(Object.entries(i).map(o=>{var[u,c]=o,s=n?[...c].reverse():c,d=s.map(W2);return[u,{stackedData:bV(e,d,t),graphicalItems:s}]}))},Bv=Te([aG,y9,m0,a9],k9),N9=(e,r,t,n)=>{var{dataStartIndex:l,dataEndIndex:i}=r;if(n==null&&t!=="zAxis"){var o=jV(e,l,i);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},oG=Te([si],e=>e.allowDataOverflow),G2=e=>{var r;if(e==null||!("domain"in e))return Fv;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var t=Ea(e.ticks);return[Math.min(...t),Math.max(...t)]}if(e.type==="category")return e.ticks.map(String)}return(r=e?.domain)!==null&&r!==void 0?r:Fv},C9=Te([si],G2),E9=Te([C9,oG],qE),lG=Te([Bv,Ia,nn,E9],N9,{memoizeOptions:{resultEqualityCheck:y0}}),Y2=e=>e.errorBars,cG=(e,r,t)=>e.flatMap(n=>r[n.id]).filter(Boolean).filter(n=>S9(t,n)),fp=function(){for(var r=arguments.length,t=new Array(r),n=0;n{var i,o;if(t.length>0&&e.forEach(u=>{t.forEach(c=>{var s,d,f=(s=n[c.id])===null||s===void 0?void 0:s.filter(y=>S9(l,y)),h=Yr(u,(d=r.dataKey)!==null&&d!==void 0?d:c.dataKey),m=sG(u,h,f);if(m.length>=2){var p=Math.min(...m),x=Math.max(...m);(i==null||po)&&(o=x)}var g=yS(h);g!=null&&(i=i==null?g[0]:Math.min(i,g[0]),o=o==null?g[1]:Math.max(o,g[1]))})}),r?.dataKey!=null&&e.forEach(u=>{var c=yS(Yr(u,r.dataKey));c!=null&&(i=i==null?c[0]:Math.min(i,c[0]),o=o==null?c[1]:Math.max(o,c[1]))}),Rr(i)&&Rr(o))return[i,o]},uG=Te([X2,si,nG,Y2,nn],A9,{memoizeOptions:{resultEqualityCheck:y0}});function dG(e){var{value:r}=e;if(zs(r)||r instanceof Date)return r}var fG=(e,r,t)=>{var n=e.map(dG).filter(l=>l!=null);return t&&(r.dataKey==null||r.allowDuplicatedCategory&&qC(n))?cE(0,e.length):r.allowDuplicatedCategory?n:Array.from(new Set(n))},M9=e=>e.referenceElements.dots,Qc=(e,r,t)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>r==="xAxis"?n.xAxisId===t:n.yAxisId===t),hG=Te([M9,nn,x0],Qc),O9=e=>e.referenceElements.areas,mG=Te([O9,nn,x0],Qc),P9=e=>e.referenceElements.lines,pG=Te([P9,nn,x0],Qc),T9=(e,r)=>{if(e!=null){var t=Ea(e.map(n=>r==="xAxis"?n.x:n.y));if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},gG=Te(hG,nn,T9),I9=(e,r)=>{if(e!=null){var t=Ea(e.flatMap(n=>[r==="xAxis"?n.x1:n.y1,r==="xAxis"?n.x2:n.y2]));if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},xG=Te([mG,nn],I9);function bG(e){var r;if(e.x!=null)return Ea([e.x]);var t=(r=e.segment)===null||r===void 0?void 0:r.map(n=>n.x);return t==null||t.length===0?[]:Ea(t)}function yG(e){var r;if(e.y!=null)return Ea([e.y]);var t=(r=e.segment)===null||r===void 0?void 0:r.map(n=>n.y);return t==null||t.length===0?[]:Ea(t)}var R9=(e,r)=>{if(e!=null){var t=e.flatMap(n=>r==="xAxis"?bG(n):yG(n));if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},vG=Te([pG,nn],R9),wG=Te(gG,vG,xG,(e,r,t)=>fp(e,t,r)),D9=(e,r,t,n,l,i,o,u)=>{if(t!=null)return t;var c=o==="vertical"&&u==="xAxis"||o==="horizontal"&&u==="yAxis",s=c?fp(n,i,l):fp(i,l);return PX(r,s,e.allowDataOverflow)},_G=Te([si,C9,E9,lG,uG,wG,ar,nn],D9,{memoizeOptions:{resultEqualityCheck:y0}}),jG=[0,1],L9=(e,r,t,n,l,i,o)=>{if(!((e==null||t==null||t.length===0)&&o===void 0)){var{dataKey:u,type:c}=e,s=Co(r,i);if(s&&u==null){var d;return cE(0,(d=t?.length)!==null&&d!==void 0?d:0)}return c==="category"?fG(n,e,s):l==="expand"?jG:o}},Z2=Te([si,ar,X2,_0,m0,nn,_G],L9),F9=(e,r,t,n,l)=>{if(e!=null){var{scale:i,type:o}=e;if(i==="auto")return r==="radial"&&l==="radiusAxis"?"band":r==="radial"&&l==="angleAxis"?"linear":o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":o==="category"?"band":"linear";if(typeof i=="string"){var u="scale".concat(Kd(i));return u in cd?u:"point"}}},of=Te([si,ar,g9,z2,nn],F9);function SG(e){if(e!=null){if(e in cd)return cd[e]();var r="scale".concat(Kd(e));if(r in cd)return cd[r]()}}function Q2(e,r,t,n){if(!(t==null||n==null)){if(typeof e.scale=="function")return e.scale.copy().domain(t).range(n);var l=SG(r);if(l!=null){var i=l.domain(t).range(n);return hV(i),i}}}var B9=(e,r,t)=>{var n=G2(r);if(!(t!=="auto"&&t!=="linear")){if(r!=null&&r.tickCount&&Array.isArray(n)&&(n[0]==="auto"||n[1]==="auto")&&_o(e))return $X(e,r.tickCount,r.allowDecimals);if(r!=null&&r.tickCount&&r.type==="number"&&_o(e))return UX(e,r.tickCount,r.allowDecimals)}},J2=Te([Z2,nf,of],B9),z9=(e,r,t,n)=>{if(n!=="angleAxis"&&e?.type==="number"&&_o(r)&&Array.isArray(t)&&t.length>0){var l=r[0],i=t[0],o=r[1],u=t[t.length-1];return[Math.min(l,i),Math.max(o,u)]}return r},kG=Te([si,Z2,J2,nn],z9),NG=Te(_0,si,(e,r)=>{if(!(!r||r.type!=="number")){var t=1/0,n=Array.from(Ea(e.map(f=>f.value))).sort((f,h)=>f-h),l=n[0],i=n[n.length-1];if(l==null||i==null)return 1/0;var o=i-l;if(o===0)return 1/0;for(var u=0;ul,(e,r,t,n,l)=>{if(!Rr(e))return 0;var i=r==="vertical"?n.height:n.width;if(l==="gap")return e*i/2;if(l==="no-gap"){var o=ys(t,e*i),u=e*i/2;return u-o-(u-o)/i*o}return 0}),CG=(e,r,t)=>{var n=Ra(e,r);return n==null||typeof n.padding!="string"?0:$9(e,"xAxis",r,t,n.padding)},EG=(e,r,t)=>{var n=Da(e,r);return n==null||typeof n.padding!="string"?0:$9(e,"yAxis",r,t,n.padding)},AG=Te(Ra,CG,(e,r)=>{var t,n;if(e==null)return{left:0,right:0};var{padding:l}=e;return typeof l=="string"?{left:r,right:r}:{left:((t=l.left)!==null&&t!==void 0?t:0)+r,right:((n=l.right)!==null&&n!==void 0?n:0)+r}}),MG=Te(Da,EG,(e,r)=>{var t,n;if(e==null)return{top:0,bottom:0};var{padding:l}=e;return typeof l=="string"?{top:r,bottom:r}:{top:((t=l.top)!==null&&t!==void 0?t:0)+r,bottom:((n=l.bottom)!==null&&n!==void 0?n:0)+r}}),OG=Te([xn,AG,Jp,Qp,(e,r,t)=>t],(e,r,t,n,l)=>{var{padding:i}=n;return l?[i.left,t.width-i.right]:[e.left+r.left,e.left+e.width-r.right]}),PG=Te([xn,ar,MG,Jp,Qp,(e,r,t)=>t],(e,r,t,n,l,i)=>{var{padding:o}=l;return i?[n.height-o.bottom,o.top]:r==="horizontal"?[e.top+e.height-t.bottom,e.top+t.top]:[e.top+t.top,e.top+e.height-t.bottom]}),lf=(e,r,t,n)=>{var l;switch(r){case"xAxis":return OG(e,t,n);case"yAxis":return PG(e,t,n);case"zAxis":return(l=K2(e,t))===null||l===void 0?void 0:l.range;case"angleAxis":return u9(e);case"radiusAxis":return d9(e,t);default:return}},U9=Te([si,lf],p0),j0=Te([si,of,kG,U9],Q2);Te([sf,Y2,nn],cG);function V9(e,r){return e.idr.id?1:0}var S0=(e,r)=>r,k0=(e,r,t)=>t,TG=Te(Yp,S0,k0,(e,r,t)=>e.filter(n=>n.orientation===r).filter(n=>n.mirror===t).sort(V9)),IG=Te(Zp,S0,k0,(e,r,t)=>e.filter(n=>n.orientation===r).filter(n=>n.mirror===t).sort(V9)),q9=(e,r)=>({width:e.width,height:r.height}),RG=(e,r)=>{var t=typeof r.width=="number"?r.width:Zd;return{width:t,height:e.height}},H9=Te(xn,Ra,q9),DG=(e,r,t)=>{switch(r){case"top":return e.top;case"bottom":return t-e.bottom;default:return 0}},LG=(e,r,t)=>{switch(r){case"left":return e.left;case"right":return t-e.right;default:return 0}},FG=Te(Pa,xn,TG,S0,k0,(e,r,t,n,l)=>{var i={},o;return t.forEach(u=>{var c=q9(r,u);o==null&&(o=DG(r,n,e));var s=n==="top"&&!l||n==="bottom"&&l;i[u.id]=o-Number(s)*c.height,o+=(s?-1:1)*c.height}),i}),BG=Te(Oa,xn,IG,S0,k0,(e,r,t,n,l)=>{var i={},o;return t.forEach(u=>{var c=RG(r,u);o==null&&(o=LG(r,n,e));var s=n==="left"&&!l||n==="right"&&l;i[u.id]=o-Number(s)*c.width,o+=(s?-1:1)*c.width}),i}),zG=(e,r)=>{var t=Ra(e,r);if(t!=null)return FG(e,t.orientation,t.mirror)},$G=Te([xn,Ra,zG,(e,r)=>r],(e,r,t,n)=>{if(r!=null){var l=t?.[n];return l==null?{x:e.left,y:0}:{x:e.left,y:l}}}),UG=(e,r)=>{var t=Da(e,r);if(t!=null)return BG(e,t.orientation,t.mirror)},VG=Te([xn,Da,UG,(e,r)=>r],(e,r,t,n)=>{if(r!=null){var l=t?.[n];return l==null?{x:0,y:e.top}:{x:l,y:e.top}}}),W9=Te(xn,Da,(e,r)=>{var t=typeof r.width=="number"?r.width:Zd;return{width:t,height:e.height}}),vS=(e,r,t)=>{switch(r){case"xAxis":return H9(e,t).width;case"yAxis":return W9(e,t).height;default:return}},K9=(e,r,t,n)=>{if(t!=null){var{allowDuplicatedCategory:l,type:i,dataKey:o}=t,u=Co(e,n),c=r.map(s=>s.value);if(o&&u&&i==="category"&&l&&qC(c))return c}},ew=Te([ar,_0,si,nn],K9),X9=(e,r,t,n)=>{if(!(t==null||t.dataKey==null)){var{type:l,scale:i}=t,o=Co(e,n);if(o&&(l==="number"||i!=="auto"))return r.map(u=>u.value)}},tw=Te([ar,_0,nf,nn],X9),wS=Te([ar,tG,of,j0,ew,tw,lf,J2,nn],(e,r,t,n,l,i,o,u,c)=>{if(r!=null){var s=Co(e,c);return{angle:r.angle,interval:r.interval,minTickGap:r.minTickGap,orientation:r.orientation,tick:r.tick,tickCount:r.tickCount,tickFormatter:r.tickFormatter,ticks:r.ticks,type:r.type,unit:r.unit,axisType:c,categoricalDomain:i,duplicateDomain:l,isCategorical:s,niceTicks:u,range:o,realScaleType:t,scale:n}}}),qG=(e,r,t,n,l,i,o,u,c)=>{if(!(r==null||n==null)){var s=Co(e,c),{type:d,ticks:f,tickCount:h}=r,m=t==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,p=d==="category"&&n.bandwidth?n.bandwidth()/m:0;p=c==="angleAxis"&&i!=null&&i.length>=2?fi(i[0]-i[1])*2*p:p;var x=f||l;if(x){var g=x.map((y,v)=>{var _=o?o.indexOf(y):y;return{index:v,coordinate:n(_)+p,value:y,offset:p}});return g.filter(y=>Rr(y.coordinate))}return s&&u?u.map((y,v)=>({coordinate:n(y)+p,value:y,index:v,offset:p})).filter(y=>Rr(y.coordinate)):n.ticks?n.ticks(h).map(y=>({coordinate:n(y)+p,value:y,offset:p})):n.domain().map((y,v)=>({coordinate:n(y)+p,value:o?o[y]:y,index:v,offset:p}))}},G9=Te([ar,nf,of,j0,J2,lf,ew,tw,nn],qG),HG=(e,r,t,n,l,i,o)=>{if(!(r==null||t==null||n==null||n[0]===n[1])){var u=Co(e,o),{tickCount:c}=r,s=0;return s=o==="angleAxis"&&n?.length>=2?fi(n[0]-n[1])*2*s:s,u&&i?i.map((d,f)=>({coordinate:t(d)+s,value:d,index:f,offset:s})):t.ticks?t.ticks(c).map(d=>({coordinate:t(d)+s,value:d,offset:s})):t.domain().map((d,f)=>({coordinate:t(d)+s,value:l?l[d]:d,index:f,offset:s}))}},jo=Te([ar,nf,j0,lf,ew,tw,nn],HG),So=Te(si,j0,(e,r)=>{if(!(e==null||r==null))return dp(dp({},e),{},{scale:r})}),WG=Te([si,of,Z2,U9],Q2);Te((e,r,t)=>K2(e,t),WG,(e,r)=>{if(!(e==null||r==null))return dp(dp({},e),{},{scale:r})});var KG=Te([ar,Yp,Zp],(e,r,t)=>{switch(e){case"horizontal":return r.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return t.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),Y9=e=>e.options.defaultTooltipEventType,Z9=e=>e.options.validateTooltipEventTypes;function Q9(e,r,t){if(e==null)return r;var n=e?"axis":"item";return t==null?r:t.includes(n)?n:r}function rw(e,r){var t=Y9(e),n=Z9(e);return Q9(r,t,n)}function XG(e){return kt(r=>rw(r,e))}var J9=(e,r)=>{var t,n=Number(r);if(!(bs(n)||r==null))return n>=0?e==null||(t=e[n])===null||t===void 0?void 0:t.value:void 0},GG=e=>e.tooltip.settings,uo={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},YG={itemInteraction:{click:uo,hover:uo},axisInteraction:{click:uo,hover:uo},keyboardInteraction:uo,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},eA=pi({name:"tooltip",initialState:YG,reducers:{addTooltipEntrySettings:{reducer(e,r){e.tooltipItemPayloads.push(r.payload)},prepare:Nr()},replaceTooltipEntrySettings:{reducer(e,r){var{prev:t,next:n}=r.payload,l=gs(e).tooltipItemPayloads.indexOf(t);l>-1&&(e.tooltipItemPayloads[l]=n)},prepare:Nr()},removeTooltipEntrySettings:{reducer(e,r){var t=gs(e).tooltipItemPayloads.indexOf(r.payload);t>-1&&e.tooltipItemPayloads.splice(t,1)},prepare:Nr()},setTooltipSettingsState(e,r){e.settings=r.payload},setActiveMouseOverItemIndex(e,r){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=r.payload.activeIndex,e.itemInteraction.hover.dataKey=r.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=r.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=r.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,r){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=r.payload.activeIndex,e.itemInteraction.click.dataKey=r.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=r.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=r.payload.activeCoordinate},setMouseOverAxisIndex(e,r){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=r.payload.activeIndex,e.axisInteraction.hover.dataKey=r.payload.activeDataKey,e.axisInteraction.hover.coordinate=r.payload.activeCoordinate},setMouseClickAxisIndex(e,r){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=r.payload.activeIndex,e.axisInteraction.click.dataKey=r.payload.activeDataKey,e.axisInteraction.click.coordinate=r.payload.activeCoordinate},setSyncInteraction(e,r){e.syncInteraction=r.payload},setKeyboardInteraction(e,r){e.keyboardInteraction.active=r.payload.active,e.keyboardInteraction.index=r.payload.activeIndex,e.keyboardInteraction.coordinate=r.payload.activeCoordinate}}}),{addTooltipEntrySettings:ZG,replaceTooltipEntrySettings:QG,removeTooltipEntrySettings:JG,setTooltipSettingsState:eY,setActiveMouseOverItemIndex:tA,mouseLeaveItem:tY,mouseLeaveChart:rA,setActiveClickItemIndex:rY,setMouseOverAxisIndex:nA,setMouseClickAxisIndex:nY,setSyncInteraction:zv,setKeyboardInteraction:$v}=eA.actions,iY=eA.reducer;function _S(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function Xh(e){for(var r=1;r{if(r==null)return uo;var l=lY(e,r,t);if(l==null)return uo;if(l.active)return l;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var i=e.settings.active===!0;if(cY(l)){if(i)return Xh(Xh({},l),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return Xh(Xh({},uo),{},{coordinate:l.coordinate})};function uY(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var r=e.valueOf();return Number.isFinite(r)?r:void 0}var t=Number(e);return Number.isFinite(t)?t:void 0}function dY(e,r){var t=uY(e),n=r[0],l=r[1];if(t===void 0)return!1;var i=Math.min(n,l),o=Math.max(n,l);return t>=i&&t<=o}function fY(e,r,t){if(t==null||r==null)return!0;var n=Yr(e,r);return n==null||!_o(t)?!0:dY(n,t)}var nw=(e,r,t,n)=>{var l=e?.index;if(l==null)return null;var i=Number(l);if(!Rr(i))return l;var o=0,u=1/0;r.length>0&&(u=r.length-1);var c=Math.max(o,Math.min(i,u)),s=r[c];return s==null||fY(s,t,n)?String(c):null},sA=(e,r,t,n,l,i,o,u)=>{if(!(i==null||u==null)){var c=o[0],s=c==null?void 0:u(c.positions,i);if(s!=null)return s;var d=l?.[Number(i)];if(d)return t==="horizontal"?{x:d.coordinate,y:(n.top+r)/2}:{x:(n.left+e)/2,y:d.coordinate}}},aA=(e,r,t,n)=>{if(r==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var l;if(t==="hover"?l=e.itemInteraction.hover.graphicalItemId:l=e.itemInteraction.click.graphicalItemId,l==null&&n!=null){var i=e.tooltipItemPayloads[0];return i!=null?[i]:[]}return e.tooltipItemPayloads.filter(o=>{var u;return((u=o.settings)===null||u===void 0?void 0:u.graphicalItemId)===l})},cf=e=>e.options.tooltipPayloadSearcher,Jc=e=>e.tooltip;function jS(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function SS(e){for(var r=1;r{if(!(r==null||i==null)){var{chartData:u,computedData:c,dataStartIndex:s,dataEndIndex:d}=t,f=[];return e.reduce((h,m)=>{var p,{dataDefinedOnItem:x,settings:g}=m,y=gY(x,u),v=Array.isArray(y)?L7(y,s,d):y,_=(p=g?.dataKey)!==null&&p!==void 0?p:n,C=g?.nameKey,M;if(n&&Array.isArray(v)&&!Array.isArray(v[0])&&o==="axis"?M=HC(v,n,l):M=i(v,r,c,C),Array.isArray(M))M.forEach(U=>{var F=SS(SS({},g),{},{name:U.name,unit:U.unit,color:void 0,fill:void 0});h.push(C5({tooltipEntrySettings:F,dataKey:U.dataKey,payload:U.payload,value:Yr(U.payload,U.dataKey),name:U.name}))});else{var T;h.push(C5({tooltipEntrySettings:g,dataKey:_,payload:M,value:Yr(M,_),name:(T=Yr(M,C))!==null&&T!==void 0?T:g?.name}))}return h},f)}},iw=Te([an,ar,g9,z2,sn],F9),xY=Te([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,r)=>[...e,...r]),bY=Te([sn,Zc],x9),eu=Te([xY,an,bY],b9,{memoizeOptions:{resultEqualityCheck:v0}}),yY=Te([eu],e=>e.filter(b0)),vY=Te([eu],w9,{memoizeOptions:{resultEqualityCheck:v0}}),tu=Te([vY,Ia],_9),wY=Te([yY,Ia,an],h9),sw=Te([tu,an,eu],j9),lA=Te([an],G2),_Y=Te([an],e=>e.allowDataOverflow),cA=Te([lA,_Y],qE),jY=Te([eu],e=>e.filter(b0)),SY=Te([wY,jY,m0,a9],k9),kY=Te([SY,Ia,sn,cA],N9),NY=Te([eu],v9),CY=Te([tu,an,NY,Y2,sn],A9,{memoizeOptions:{resultEqualityCheck:y0}}),EY=Te([M9,sn,Zc],Qc),AY=Te([EY,sn],T9),MY=Te([O9,sn,Zc],Qc),OY=Te([MY,sn],I9),PY=Te([P9,sn,Zc],Qc),TY=Te([PY,sn],R9),IY=Te([AY,TY,OY],fp),RY=Te([an,lA,cA,kY,CY,IY,ar,sn],D9),uf=Te([an,ar,tu,sw,m0,sn,RY],L9),DY=Te([uf,an,iw],B9),LY=Te([an,uf,DY,sn],z9),uA=e=>{var r=sn(e),t=Zc(e),n=!1;return lf(e,r,t,n)},dA=Te([an,uA],p0),fA=Te([an,iw,LY,dA],Q2),FY=Te([ar,sw,an,sn],K9),BY=Te([ar,sw,an,sn],X9),zY=(e,r,t,n,l,i,o,u)=>{if(r){var{type:c}=r,s=Co(e,u);if(n){var d=t==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,f=c==="category"&&n.bandwidth?n.bandwidth()/d:0;return f=u==="angleAxis"&&l!=null&&l?.length>=2?fi(l[0]-l[1])*2*f:f,s&&o?o.map((h,m)=>({coordinate:n(h)+f,value:h,index:m,offset:f})):n.domain().map((h,m)=>({coordinate:n(h)+f,value:i?i[h]:h,index:m,offset:f}))}}},La=Te([ar,an,iw,fA,uA,FY,BY,sn],zY),aw=Te([Y9,Z9,GG],(e,r,t)=>Q9(t.shared,e,r)),hA=e=>e.tooltip.settings.trigger,ow=e=>e.tooltip.settings.defaultIndex,df=Te([Jc,aw,hA,ow],iA),El=Te([df,tu,af,uf],nw),mA=Te([La,El],J9),pA=Te([df],e=>{if(e)return e.dataKey});Te([df],e=>{if(e)return e.graphicalItemId});var gA=Te([Jc,aw,hA,ow],aA),$Y=Te([Oa,Pa,ar,xn,La,ow,gA,cf],sA),UY=Te([df,$Y],(e,r)=>e!=null&&e.coordinate?e.coordinate:r),VY=Te([df],e=>{var r;return(r=e?.active)!==null&&r!==void 0?r:!1}),qY=Te([gA,El,Ia,af,mA,cf,aw],oA),HY=Te([qY],e=>{if(e!=null){var r=e.map(t=>t.payload).filter(t=>t!=null);return Array.from(new Set(r))}});function kS(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function NS(e){for(var r=1;rkt(an),YY=()=>{var e=GY(),r=kt(La),t=kt(fA);return Rc(!e||!t?void 0:NS(NS({},e),{},{scale:t}),r)};function CS(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function bc(e){for(var r=1;r{var l=r.find(i=>i&&i.index===t);if(l){if(e==="horizontal")return{x:l.coordinate,y:n.chartY};if(e==="vertical")return{x:n.chartX,y:l.coordinate}}return{x:0,y:0}},tZ=(e,r,t,n)=>{var l=r.find(s=>s&&s.index===t);if(l){if(e==="centric"){var i=l.coordinate,{radius:o}=n;return bc(bc(bc({},n),En(n.cx,n.cy,o,i)),{},{angle:i,radius:o})}var u=l.coordinate,{angle:c}=n;return bc(bc(bc({},n),En(n.cx,n.cy,u,c)),{},{angle:c,radius:u})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function rZ(e,r){var{chartX:t,chartY:n}=e;return t>=r.left&&t<=r.left+r.width&&n>=r.top&&n<=r.top+r.height}var xA=(e,r,t,n,l)=>{var i,o=(i=r?.length)!==null&&i!==void 0?i:0;if(o<=1||e==null)return 0;if(n==="angleAxis"&&l!=null&&Math.abs(Math.abs(l[1]-l[0])-360)<=1e-6)for(var u=0;u0?(c=t[u-1])===null||c===void 0?void 0:c.coordinate:(s=t[o-1])===null||s===void 0?void 0:s.coordinate,p=(d=t[u])===null||d===void 0?void 0:d.coordinate,x=u>=o-1?(f=t[0])===null||f===void 0?void 0:f.coordinate:(h=t[u+1])===null||h===void 0?void 0:h.coordinate,g=void 0;if(!(m==null||p==null||x==null))if(fi(p-m)!==fi(x-p)){var y=[];if(fi(x-p)===fi(l[1]-l[0])){g=x;var v=p+l[1]-l[0];y[0]=Math.min(v,(v+m)/2),y[1]=Math.max(v,(v+m)/2)}else{g=m;var _=x+l[1]-l[0];y[0]=Math.min(p,(_+p)/2),y[1]=Math.max(p,(_+p)/2)}var C=[Math.min(p,(g+p)/2),Math.max(p,(g+p)/2)];if(e>C[0]&&e<=C[1]||e>=y[0]&&e<=y[1]){var M;return(M=t[u])===null||M===void 0?void 0:M.index}}else{var T=Math.min(m,x),U=Math.max(m,x);if(e>(T+p)/2&&e<=(U+p)/2){var F;return(F=t[u])===null||F===void 0?void 0:F.index}}}else if(r)for(var H=0;H(W.coordinate+$.coordinate)/2||H>0&&H(W.coordinate+$.coordinate)/2&&e<=(W.coordinate+K.coordinate)/2)return W.index}}return-1},nZ=()=>kt(z2),lw=(e,r)=>r,bA=(e,r,t)=>t,cw=(e,r,t,n)=>n,iZ=Te(La,e=>Bp(e,r=>r.coordinate)),uw=Te([Jc,lw,bA,cw],iA),dw=Te([uw,tu,af,uf],nw),sZ=(e,r,t)=>{if(r!=null){var n=Jc(e);return r==="axis"?t==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:t==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},yA=Te([Jc,lw,bA,cw],aA),hp=Te([Oa,Pa,ar,xn,La,cw,yA,cf],sA),aZ=Te([uw,hp],(e,r)=>{var t;return(t=e.coordinate)!==null&&t!==void 0?t:r}),vA=Te([La,dw],J9),oZ=Te([yA,dw,Ia,af,vA,cf,lw],oA),lZ=Te([uw,dw],(e,r)=>({isActive:e.active&&r!=null,activeIndex:r})),cZ=(e,r,t,n,l,i,o)=>{if(!(!e||!t||!n||!l)&&rZ(e,o)){var u=SV(e,r),c=xA(u,i,l,t,n),s=eZ(r,l,c,e);return{activeIndex:String(c),activeCoordinate:s}}},uZ=(e,r,t,n,l,i,o)=>{if(!(!e||!n||!l||!i||!t)){var u=KH(e,t);if(u){var c=kV(u,r),s=xA(c,o,i,n,l),d=tZ(r,i,s,u);return{activeIndex:String(s),activeCoordinate:d}}}},dZ=(e,r,t,n,l,i,o,u)=>{if(!(!e||!r||!n||!l||!i))return r==="horizontal"||r==="vertical"?cZ(e,r,n,l,i,o,u):uZ(e,r,t,n,l,i,o)},fZ=Te(e=>e.zIndex.zIndexMap,(e,r)=>r,(e,r,t)=>t,(e,r,t)=>{if(r!=null){var n=e[r];if(n!=null)return t?n.panoramaElement:n.element}}),hZ=Te(e=>e.zIndex.zIndexMap,e=>{var r=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(gn)),t=Array.from(new Set(r));return t.sort((n,l)=>n-l)},{memoizeOptions:{resultEqualityCheck:YX}});function ES(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function AS(e){for(var r=1;rAS(AS({},e),{},{[r]:{element:void 0,panoramaElement:void 0,consumers:0}}),xZ)},yZ=new Set(Object.values(gn));function vZ(e){return yZ.has(e)}var wA=pi({name:"zIndex",initialState:bZ,reducers:{registerZIndexPortal:{reducer:(e,r)=>{var{zIndex:t}=r.payload;e.zIndexMap[t]?e.zIndexMap[t].consumers+=1:e.zIndexMap[t]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:Nr()},unregisterZIndexPortal:{reducer:(e,r)=>{var{zIndex:t}=r.payload;e.zIndexMap[t]&&(e.zIndexMap[t].consumers-=1,e.zIndexMap[t].consumers<=0&&!vZ(t)&&delete e.zIndexMap[t])},prepare:Nr()},registerZIndexPortalElement:{reducer:(e,r)=>{var{zIndex:t,element:n,isPanorama:l}=r.payload;e.zIndexMap[t]?l?e.zIndexMap[t].panoramaElement=n:e.zIndexMap[t].element=n:e.zIndexMap[t]={consumers:0,element:l?void 0:n,panoramaElement:l?n:void 0}},prepare:Nr()},unregisterZIndexPortalElement:{reducer:(e,r)=>{var{zIndex:t}=r.payload;e.zIndexMap[t]&&(r.payload.isPanorama?e.zIndexMap[t].panoramaElement=void 0:e.zIndexMap[t].element=void 0)},prepare:Nr()}}}),{registerZIndexPortal:wZ,unregisterZIndexPortal:_Z,registerZIndexPortalElement:jZ,unregisterZIndexPortalElement:SZ}=wA.actions,kZ=wA.reducer;function Yi(e){var{zIndex:r,children:t}=e,n=iq(),l=n&&r!==void 0&&r!==0,i=Un(),o=Dr();R.useLayoutEffect(()=>l?(o(wZ({zIndex:r})),()=>{o(_Z({zIndex:r}))}):Xd,[o,r,l]);var u=kt(c=>fZ(c,r,i));return l?u?jp.createPortal(t,u):null:t}function Uv(){return Uv=Object.assign?Object.assign.bind():function(e){for(var r=1;rR.useContext(_A),Zb={exports:{}},OS;function TZ(){return OS||(OS=1,(function(e){var r=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function l(c,s,d){this.fn=c,this.context=s,this.once=d||!1}function i(c,s,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var m=new l(d,f||c,h),p=t?t+s:s;return c._events[p]?c._events[p].fn?c._events[p]=[c._events[p],m]:c._events[p].push(m):(c._events[p]=m,c._eventsCount++),c}function o(c,s){--c._eventsCount===0?c._events=new n:delete c._events[s]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var s=[],d,f;if(this._eventsCount===0)return s;for(f in d=this._events)r.call(d,f)&&s.push(t?f.slice(1):f);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(d)):s},u.prototype.listeners=function(s){var d=t?t+s:s,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,m=f.length,p=new Array(m);h{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),LZ=SA.reducer,{createEventEmitter:FZ}=SA.actions;function BZ(e){return e.tooltip.syncInteraction}var zZ={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},kA=pi({name:"chartData",initialState:zZ,reducers:{setChartData(e,r){if(e.chartData=r.payload,r.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}r.payload.length>0&&e.dataEndIndex!==r.payload.length-1&&(e.dataEndIndex=r.payload.length-1)},setComputedData(e,r){e.computedData=r.payload},setDataStartEndIndexes(e,r){var{startIndex:t,endIndex:n}=r.payload;t!=null&&(e.dataStartIndex=t),n!=null&&(e.dataEndIndex=n)}}}),{setChartData:TS,setDataStartEndIndexes:$Z,setComputedData:Ose}=kA.actions,UZ=kA.reducer,VZ=["x","y"];function IS(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function yc(e){for(var r=1;rc.rootProps.className);R.useEffect(()=>{if(e==null)return Xd;var c=(s,d,f)=>{if(r!==f&&e===s){if(n==="index"){var h;if(o&&d!==null&&d!==void 0&&(h=d.payload)!==null&&h!==void 0&&h.coordinate&&d.payload.sourceViewBox){var m=d.payload.coordinate,{x:p,y:x}=m,g=KZ(m,VZ),{x:y,y:v,width:_,height:C}=d.payload.sourceViewBox,M=yc(yc({},g),{},{x:o.x+(_?(p-y)/_:0)*o.width,y:o.y+(C?(x-v)/C:0)*o.height});t(yc(yc({},d),{},{payload:yc(yc({},d.payload),{},{coordinate:M})}))}else t(d);return}if(l!=null){var T;if(typeof n=="function"){var U={activeTooltipIndex:d.payload.index==null?void 0:Number(d.payload.index),isTooltipActive:d.payload.active,activeIndex:d.payload.index==null?void 0:Number(d.payload.index),activeLabel:d.payload.label,activeDataKey:d.payload.dataKey,activeCoordinate:d.payload.coordinate},F=n(l,U);T=l[F]}else n==="value"&&(T=l.find(j=>String(j.value)===d.payload.label));var{coordinate:H}=d.payload;if(T==null||d.payload.active===!1||H==null||o==null){t(zv({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:W,y:K}=H,$=Math.min(W,o.x+o.width),P=Math.min(K,o.y+o.height),L={x:i==="horizontal"?T.coordinate:$,y:i==="horizontal"?P:T.coordinate},E=zv({active:d.payload.active,coordinate:L,dataKey:d.payload.dataKey,index:String(T.index),label:d.payload.label,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:d.payload.graphicalItemId});t(E)}}};return Bd.on(Vv,c),()=>{Bd.off(Vv,c)}},[u,t,r,e,n,l,i,o])}function YZ(){var e=kt($2),r=kt(U2),t=Dr();R.useEffect(()=>{if(e==null)return Xd;var n=(l,i,o)=>{r!==o&&e===l&&t($Z(i))};return Bd.on(PS,n),()=>{Bd.off(PS,n)}},[t,r,e])}function ZZ(){var e=Dr();R.useEffect(()=>{e(FZ())},[e]),GZ(),YZ()}function QZ(e,r,t,n,l,i){var o=kt(m=>sZ(m,e,r)),u=kt(U2),c=kt($2),s=kt(o9),d=kt(BZ),f=d?.active,h=e0();R.useEffect(()=>{if(!f&&c!=null&&u!=null){var m=zv({active:i,coordinate:t,dataKey:o,index:l,label:typeof n=="number"?String(n):n,sourceViewBox:h,graphicalItemId:void 0});Bd.emit(Vv,c,m,u)}},[f,t,o,l,n,u,c,s,i,h])}function RS(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function DS(e){for(var r=1;r{U(eY({shared:v,trigger:_,axisId:T,active:l,defaultIndex:F}))},[U,v,_,T,l,F]);var H=e0(),W=J7(),K=XG(v),{activeIndex:$,isActive:P}=(r=kt(ee=>lZ(ee,K,_,F)))!==null&&r!==void 0?r:{},L=kt(ee=>oZ(ee,K,_,F)),E=kt(ee=>vA(ee,K,_,F)),j=kt(ee=>aZ(ee,K,_,F)),k=L,S=PZ(),N=(t=l??P)!==null&&t!==void 0?t:!1,[O,D]=o7([k,N]),B=K==="axis"?E:void 0;QZ(K,_,j,B,$,N);var Y=M??S;if(Y==null||H==null||K==null)return null;var Z=k??LS;N||(Z=LS),s&&Z.length&&(Z=r7(Z.filter(ee=>ee.value!=null&&(ee.hide!==!0||n.includeHidden)),h,rQ));var ne=Z.length>0,q=R.createElement(Wq,{allowEscapeViewBox:i,animationDuration:o,animationEasing:u,isAnimationActive:d,active:N,coordinate:j,hasPayload:ne,offset:f,position:m,reverseDirection:p,useTranslate3d:x,viewBox:H,wrapperStyle:g,lastBoundingBox:O,innerRef:D,hasPortalFromProps:!!M},nQ(c,DS(DS({},n),{},{payload:Z,label:B,active:N,activeIndex:$,coordinate:j,accessibilityLayer:W})));return R.createElement(R.Fragment,null,jp.createPortal(q,Y),N&&R.createElement(OZ,{cursor:y,tooltipEventType:K,coordinate:j,payload:Z,index:$}))}var NA=e=>null;NA.displayName="Cell";function sQ(e,r,t){return(r=aQ(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function aQ(e){var r=oQ(e,"string");return typeof r=="symbol"?r:r+""}function oQ(e,r){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}class lQ{constructor(r){sQ(this,"cache",new Map),this.maxSize=r}get(r){var t=this.cache.get(r);return t!==void 0&&(this.cache.delete(r),this.cache.set(r,t)),t}set(r,t){if(this.cache.has(r))this.cache.delete(r);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(r,t)}clear(){this.cache.clear()}size(){return this.cache.size}}function FS(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function cQ(e){for(var r=1;r{try{var t=document.getElementById(zS);t||(t=document.createElement("span"),t.setAttribute("id",zS),t.setAttribute("aria-hidden","true"),document.body.appendChild(t)),Object.assign(t.style,mQ,r),t.textContent="".concat(e);var n=t.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},md=function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(r==null||s0.isSsr)return{width:0,height:0};if(!CA.enableCache)return $S(r,t);var n=pQ(r,t),l=BS.get(n);if(l)return l;var i=$S(r,t);return BS.set(n,i),i},EA;function gQ(e,r,t){return(r=xQ(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function xQ(e){var r=bQ(e,"string");return typeof r=="symbol"?r:r+""}function bQ(e,r){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}var US=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,VS=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,yQ=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,vQ=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,wQ={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},_Q=["cm","mm","pt","pc","in","Q","px"];function jQ(e){return _Q.includes(e)}var Cc="NaN";function SQ(e,r){return e*wQ[r]}class Nn{static parse(r){var t,[,n,l]=(t=vQ.exec(r))!==null&&t!==void 0?t:[];return n==null?Nn.NaN:new Nn(parseFloat(n),l??"")}constructor(r,t){this.num=r,this.unit=t,this.num=r,this.unit=t,bs(r)&&(this.unit=""),t!==""&&!yQ.test(t)&&(this.num=NaN,this.unit=""),jQ(t)&&(this.num=SQ(r,t),this.unit="px")}add(r){return this.unit!==r.unit?new Nn(NaN,""):new Nn(this.num+r.num,this.unit)}subtract(r){return this.unit!==r.unit?new Nn(NaN,""):new Nn(this.num-r.num,this.unit)}multiply(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new Nn(NaN,""):new Nn(this.num*r.num,this.unit||r.unit)}divide(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new Nn(NaN,""):new Nn(this.num/r.num,this.unit||r.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return bs(this.num)}}EA=Nn;gQ(Nn,"NaN",new EA(NaN,""));function AA(e){if(e==null||e.includes(Cc))return Cc;for(var r=e;r.includes("*")||r.includes("/");){var t,[,n,l,i]=(t=US.exec(r))!==null&&t!==void 0?t:[],o=Nn.parse(n??""),u=Nn.parse(i??""),c=l==="*"?o.multiply(u):o.divide(u);if(c.isNaN())return Cc;r=r.replace(US,c.toString())}for(;r.includes("+")||/.-\d+(?:\.\d+)?/.test(r);){var s,[,d,f,h]=(s=VS.exec(r))!==null&&s!==void 0?s:[],m=Nn.parse(d??""),p=Nn.parse(h??""),x=f==="+"?m.add(p):m.subtract(p);if(x.isNaN())return Cc;r=r.replace(VS,x.toString())}return r}var qS=/\(([^()]*)\)/;function kQ(e){for(var r=e,t;(t=qS.exec(r))!=null;){var[,n]=t;r=r.replace(qS,AA(n))}return r}function NQ(e){var r=e.replace(/\s+/g,"");return r=kQ(r),r=AA(r),r}function CQ(e){try{return NQ(e)}catch{return Cc}}function Jb(e){var r=CQ(e.slice(5,-1));return r===Cc?"":r}var EQ=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],AQ=["dx","dy","angle","className","breakAll"];function qv(){return qv=Object.assign?Object.assign.bind():function(e){for(var r=1;r{var{children:r,breakAll:t,style:n}=e;try{var l=[];Er(r)||(t?l=r.toString().split(""):l=r.toString().split(MA));var i=l.map(u=>({word:u,width:md(u,n).width})),o=t?0:md(" ",n).width;return{wordsWithComputedWidth:i,spaceWidth:o}}catch{return null}};function OQ(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var PA=(e,r,t,n)=>e.reduce((l,i)=>{var{word:o,width:u}=i,c=l[l.length-1];if(c&&u!=null&&(r==null||n||c.width+u+te.reduce((r,t)=>r.width>t.width?r:t),PQ="…",WS=(e,r,t,n,l,i,o,u)=>{var c=e.slice(0,r),s=OA({breakAll:t,style:n,children:c+PQ});if(!s)return[!1,[]];var d=PA(s.wordsWithComputedWidth,i,o,u),f=d.length>l||TA(d).width>Number(i);return[f,d]},TQ=(e,r,t,n,l)=>{var{maxLines:i,children:o,style:u,breakAll:c}=e,s=xt(i),d=String(o),f=PA(r,n,t,l);if(!s||l)return f;var h=f.length>i||TA(f).width>Number(n);if(!h)return f;for(var m=0,p=d.length-1,x=0,g;m<=p&&x<=d.length-1;){var y=Math.floor((m+p)/2),v=y-1,[_,C]=WS(d,v,c,u,i,n,t,l),[M]=WS(d,y,c,u,i,n,t,l);if(!_&&!M&&(m=y+1),_&&M&&(p=y-1),!_&&M){g=C;break}x++}return g||f},KS=e=>{var r=Er(e)?[]:e.toString().split(MA);return[{words:r,width:void 0}]},IQ=e=>{var{width:r,scaleToFit:t,children:n,style:l,breakAll:i,maxLines:o}=e;if((r||t)&&!s0.isSsr){var u,c,s=OA({breakAll:i,children:n,style:l});if(s){var{wordsWithComputedWidth:d,spaceWidth:f}=s;u=d,c=f}else return KS(n);return TQ({breakAll:i,children:n,maxLines:o,style:l},u,c,r,!!t)}return KS(n)},IA="#808080",RQ={angle:0,breakAll:!1,capHeight:"0.71em",fill:IA,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},fw=R.forwardRef((e,r)=>{var t=An(e,RQ),{x:n,y:l,lineHeight:i,capHeight:o,fill:u,scaleToFit:c,textAnchor:s,verticalAnchor:d}=t,f=HS(t,EQ),h=R.useMemo(()=>IQ({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:c,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,c,f.style,f.width]),{dx:m,dy:p,angle:x,className:g,breakAll:y}=f,v=HS(f,AQ);if(!zs(n)||!zs(l)||h.length===0)return null;var _=Number(n)+(xt(m)?m:0),C=Number(l)+(xt(p)?p:0);if(!Rr(_)||!Rr(C))return null;var M;switch(d){case"start":M=Jb("calc(".concat(o,")"));break;case"middle":M=Jb("calc(".concat((h.length-1)/2," * -").concat(i," + (").concat(o," / 2))"));break;default:M=Jb("calc(".concat(h.length-1," * -").concat(i,")"));break}var T=[];if(c){var U=h[0].width,{width:F}=f;T.push("scale(".concat(xt(F)&&xt(U)?F/U:1,")"))}return x&&T.push("rotate(".concat(x,", ").concat(_,", ").concat(C,")")),T.length&&(v.transform=T.join(" ")),R.createElement("text",qv({},ni(v),{ref:r,x:_,y:C,className:fr("recharts-text",g),textAnchor:s,fill:u.includes("url")?IA:u}),h.map((H,W)=>{var K=H.words.join(y?"":" ");return R.createElement("tspan",{x:_,dy:W===0?M:i,key:"".concat(K,"-").concat(W)},K)}))});fw.displayName="Text";var DQ=["labelRef"],LQ=["content"];function XS(e,r){if(e==null)return{};var t,n,l=FQ(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n{var{x:r,y:t,upperWidth:n,lowerWidth:l,width:i,height:o,children:u}=e,c=R.useMemo(()=>({x:r,y:t,upperWidth:n,lowerWidth:l,width:i,height:o}),[r,t,n,l,i,o]);return R.createElement(RA.Provider,{value:c},u)},DA=()=>{var e=R.useContext(RA),r=e0();return e||q7(r)},VQ=R.createContext(null),qQ=()=>{var e=R.useContext(VQ),r=kt(f9);return e||r},HQ=e=>{var{value:r,formatter:t}=e,n=Er(e.children)?r:e.children;return typeof t=="function"?t(n):n},hw=e=>e!=null&&typeof e=="function",WQ=(e,r)=>{var t=fi(r-e),n=Math.min(Math.abs(r-e),360);return t*n},KQ=(e,r,t,n,l)=>{var{offset:i,className:o}=e,{cx:u,cy:c,innerRadius:s,outerRadius:d,startAngle:f,endAngle:h,clockWise:m}=l,p=(s+d)/2,x=WQ(f,h),g=x>=0?1:-1,y,v;switch(r){case"insideStart":y=f+g*i,v=m;break;case"insideEnd":y=h-g*i,v=!m;break;case"end":y=h+g*i,v=m;break;default:throw new Error("Unsupported position ".concat(r))}v=x<=0?v:!v;var _=En(u,c,p,y),C=En(u,c,p,y+(v?1:-1)*359),M="M".concat(_.x,",").concat(_.y,` A`).concat(p,",").concat(p,",0,1,").concat(v?0:1,`, `).concat(C.x,",").concat(C.y),T=Er(e.id)?Nd("recharts-radial-line-"):e.id;return R.createElement("text",ha({},n,{dominantBaseline:"central",className:fr("recharts-radial-bar-label",o)}),R.createElement("defs",null,R.createElement("path",{id:T,d:M})),R.createElement("textPath",{xlinkHref:"#".concat(T)},t))},XQ=(e,r,t)=>{var{cx:n,cy:l,innerRadius:i,outerRadius:o,startAngle:u,endAngle:c}=e,s=(u+c)/2;if(t==="outside"){var{x:d,y:f}=En(n,l,o+r,s);return{x:d,y:f,textAnchor:d>=n?"start":"end",verticalAnchor:"middle"}}if(t==="center")return{x:n,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(t==="centerTop")return{x:n,y:l,textAnchor:"middle",verticalAnchor:"start"};if(t==="centerBottom")return{x:n,y:l,textAnchor:"middle",verticalAnchor:"end"};var h=(i+o)/2,{x:m,y:p}=En(n,l,h,s);return{x:m,y:p,textAnchor:"middle",verticalAnchor:"middle"}},Hv=e=>"cx"in e&&xt(e.cx),GQ=(e,r)=>{var{parentViewBox:t,offset:n,position:l}=e,i;t!=null&&!Hv(t)&&(i=t);var{x:o,y:u,upperWidth:c,lowerWidth:s,height:d}=r,f=o,h=o+(c-s)/2,m=(f+h)/2,p=(c+s)/2,x=f+c/2,g=d>=0?1:-1,y=g*n,v=g>0?"end":"start",_=g>0?"start":"end",C=c>=0?1:-1,M=C*n,T=C>0?"end":"start",U=C>0?"start":"end";if(l==="top"){var F={x:f+c/2,y:u-y,textAnchor:"middle",verticalAnchor:v};return Vr(Vr({},F),i?{height:Math.max(u-i.y,0),width:c}:{})}if(l==="bottom"){var H={x:h+s/2,y:u+d+y,textAnchor:"middle",verticalAnchor:_};return Vr(Vr({},H),i?{height:Math.max(i.y+i.height-(u+d),0),width:s}:{})}if(l==="left"){var W={x:m-M,y:u+d/2,textAnchor:T,verticalAnchor:"middle"};return Vr(Vr({},W),i?{width:Math.max(W.x-i.x,0),height:d}:{})}if(l==="right"){var K={x:m+p+M,y:u+d/2,textAnchor:U,verticalAnchor:"middle"};return Vr(Vr({},K),i?{width:Math.max(i.x+i.width-K.x,0),height:d}:{})}var $=i?{width:p,height:d}:{};return l==="insideLeft"?Vr({x:m+M,y:u+d/2,textAnchor:U,verticalAnchor:"middle"},$):l==="insideRight"?Vr({x:m+p-M,y:u+d/2,textAnchor:T,verticalAnchor:"middle"},$):l==="insideTop"?Vr({x:f+c/2,y:u+y,textAnchor:"middle",verticalAnchor:_},$):l==="insideBottom"?Vr({x:h+s/2,y:u+d-y,textAnchor:"middle",verticalAnchor:v},$):l==="insideTopLeft"?Vr({x:f+M,y:u+y,textAnchor:U,verticalAnchor:_},$):l==="insideTopRight"?Vr({x:f+c-M,y:u+y,textAnchor:T,verticalAnchor:_},$):l==="insideBottomLeft"?Vr({x:h+M,y:u+d-y,textAnchor:U,verticalAnchor:v},$):l==="insideBottomRight"?Vr({x:h+s-M,y:u+d-y,textAnchor:T,verticalAnchor:v},$):l&&typeof l=="object"&&(xt(l.x)||ja(l.x))&&(xt(l.y)||ja(l.y))?Vr({x:o+ys(l.x,p),y:u+ys(l.y,d),textAnchor:"end",verticalAnchor:"end"},$):Vr({x,y:u+d/2,textAnchor:"middle",verticalAnchor:"middle"},$)},YQ={angle:0,offset:5,zIndex:gn.label,position:"middle",textBreakAll:!1};function co(e){var r=An(e,YQ),{viewBox:t,position:n,value:l,children:i,content:o,className:u="",textBreakAll:c,labelRef:s}=r,d=qQ(),f=DA(),h=n==="center"?f:d??f,m,p,x;if(t==null?m=h:Hv(t)?m=t:m=q7(t),!m||Er(l)&&Er(i)&&!R.isValidElement(o)&&typeof o!="function")return null;var g=Vr(Vr({},r),{},{viewBox:m});if(R.isValidElement(o)){var{labelRef:y}=g,v=XS(g,DQ);return R.cloneElement(o,v)}if(typeof o=="function"){var{content:_}=g,C=XS(g,LQ);if(p=R.createElement(o,C),R.isValidElement(p))return p}else p=HQ(r);var M=ni(r);if(Hv(m)){if(n==="insideStart"||n==="insideEnd"||n==="end")return KQ(r,n,p,M,m);x=XQ(m,r.offset,r.position)}else x=GQ(r,m);return R.createElement(Yi,{zIndex:r.zIndex},R.createElement(fw,ha({ref:s,className:fr("recharts-label",u)},M,x,{textAnchor:OQ(M.textAnchor)?M.textAnchor:x.textAnchor,breakAll:c}),p))}co.displayName="Label";var ZQ=(e,r,t)=>{if(!e)return null;var n={viewBox:r,labelRef:t};return e===!0?R.createElement(co,ha({key:"label-implicit"},n)):zs(e)?R.createElement(co,ha({key:"label-implicit",value:e},n)):R.isValidElement(e)?e.type===co?R.cloneElement(e,Vr({key:"label-implicit"},n)):R.createElement(co,ha({key:"label-implicit",content:e},n)):hw(e)?R.createElement(co,ha({key:"label-implicit",content:e},n)):e&&typeof e=="object"?R.createElement(co,ha({},e,{key:"label-implicit"},n)):null};function QQ(e){var{label:r,labelRef:t}=e,n=DA();return ZQ(r,n,t)||null}var ey={},ty={},YS;function JQ(){return YS||(YS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function r(t){return t[t.length-1]}e.last=r})(ty)),ty}var ry={},ZS;function eJ(){return ZS||(ZS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function r(t){return Array.isArray(t)?t:Array.from(t)}e.toArray=r})(ry)),ry}var QS;function tJ(){return QS||(QS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const r=JQ(),t=eJ(),n=J1();function l(i){if(n.isArrayLike(i))return r.last(t.toArray(i))}e.last=l})(ey)),ey}var ny,JS;function rJ(){return JS||(JS=1,ny=tJ().last),ny}var nJ=rJ();const iJ=ws(nJ);var sJ=["valueAccessor"],aJ=["dataKey","clockWise","id","textBreakAll","zIndex"];function mp(){return mp=Object.assign?Object.assign.bind():function(e){for(var r=1;rArray.isArray(e.value)?iJ(e.value):e.value,LA=R.createContext(void 0),FA=LA.Provider,BA=R.createContext(void 0);BA.Provider;function cJ(){return R.useContext(LA)}function uJ(){return R.useContext(BA)}function fm(e){var{valueAccessor:r=lJ}=e,t=ek(e,sJ),{dataKey:n,clockWise:l,id:i,textBreakAll:o,zIndex:u}=t,c=ek(t,aJ),s=cJ(),d=uJ(),f=s||d;return!f||!f.length?null:R.createElement(Yi,{zIndex:u??gn.label},R.createElement(Wi,{className:"recharts-label-list"},f.map((h,m)=>{var p,x=Er(n)?r(h,m):Yr(h&&h.payload,n),g=Er(i)?{}:{id:"".concat(i,"-").concat(m)};return R.createElement(co,mp({key:"label-".concat(m)},ni(h),c,g,{fill:(p=t.fill)!==null&&p!==void 0?p:h.fill,parentViewBox:h.parentViewBox,value:x,textBreakAll:o,viewBox:h.viewBox,index:m,zIndex:0}))})))}fm.displayName="LabelList";function zA(e){var{label:r}=e;return r?r===!0?R.createElement(fm,{key:"labelList-implicit"}):R.isValidElement(r)||hw(r)?R.createElement(fm,{key:"labelList-implicit",content:r}):typeof r=="object"?R.createElement(fm,mp({key:"labelList-implicit"},r,{type:String(r.type)})):null:null}function Wv(){return Wv=Object.assign?Object.assign.bind():function(e){for(var r=1;r{var{cx:r,cy:t,r:n,className:l}=e,i=fr("recharts-dot",l);return xt(r)&&xt(t)&&xt(n)?R.createElement("circle",Wv({},xs(e),Q1(e),{className:i,cx:r,cy:t,r:n})):null},dJ={radiusAxis:{},angleAxis:{}},UA=pi({name:"polarAxis",initialState:dJ,reducers:{addRadiusAxis(e,r){e.radiusAxis[r.payload.id]=r.payload},removeRadiusAxis(e,r){delete e.radiusAxis[r.payload.id]},addAngleAxis(e,r){e.angleAxis[r.payload.id]=r.payload},removeAngleAxis(e,r){delete e.angleAxis[r.payload.id]}}}),{addRadiusAxis:Pse,removeRadiusAxis:Tse,addAngleAxis:Ise,removeAngleAxis:Rse}=UA.actions,fJ=UA.reducer,iy={exports:{}},hr={};var tk;function hJ(){if(tk)return hr;tk=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),o=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),s=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),m=Symbol.for("react.client.reference");function p(x){if(typeof x=="object"&&x!==null){var g=x.$$typeof;switch(g){case e:switch(x=x.type,x){case t:case l:case n:case c:case s:case h:return x;default:switch(x=x&&x.$$typeof,x){case o:case u:case f:case d:return x;case i:return x;default:return g}}case r:return g}}}return hr.ContextConsumer=i,hr.ContextProvider=o,hr.Element=e,hr.ForwardRef=u,hr.Fragment=t,hr.Lazy=f,hr.Memo=d,hr.Portal=r,hr.Profiler=l,hr.StrictMode=n,hr.Suspense=c,hr.SuspenseList=s,hr.isContextConsumer=function(x){return p(x)===i},hr.isContextProvider=function(x){return p(x)===o},hr.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},hr.isForwardRef=function(x){return p(x)===u},hr.isFragment=function(x){return p(x)===t},hr.isLazy=function(x){return p(x)===f},hr.isMemo=function(x){return p(x)===d},hr.isPortal=function(x){return p(x)===r},hr.isProfiler=function(x){return p(x)===l},hr.isStrictMode=function(x){return p(x)===n},hr.isSuspense=function(x){return p(x)===c},hr.isSuspenseList=function(x){return p(x)===s},hr.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===t||x===l||x===n||x===c||x===s||typeof x=="object"&&x!==null&&(x.$$typeof===f||x.$$typeof===d||x.$$typeof===o||x.$$typeof===i||x.$$typeof===u||x.$$typeof===m||x.getModuleId!==void 0)},hr.typeOf=p,hr}var rk;function mJ(){return rk||(rk=1,iy.exports=hJ()),iy.exports}var pJ=mJ(),nk=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",ik=null,sy=null,VA=e=>{if(e===ik&&Array.isArray(sy))return sy;var r=[];return R.Children.forEach(e,t=>{Er(t)||(pJ.isFragment(t)?r=r.concat(VA(t.props.children)):r.push(t))}),sy=r,ik=e,r};function gJ(e,r){var t=[],n=[];return Array.isArray(r)?n=r.map(l=>nk(l)):n=[nk(r)],VA(e).forEach(l=>{var i=Tc(l,"type.displayName")||Tc(l,"type.name");i&&n.indexOf(i)!==-1&&t.push(l)}),t}var qA=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,ay={},sk;function xJ(){return sk||(sk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function r(t){if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const l=t[Symbol.toStringTag];return l==null||!Object.getOwnPropertyDescriptor(t,Symbol.toStringTag)?.writable?!1:t.toString()===`[object ${l}]`}let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n}e.isPlainObject=r})(ay)),ay}var oy,ak;function bJ(){return ak||(ak=1,oy=xJ().isPlainObject),oy}var yJ=bJ();const vJ=ws(yJ);var ok,lk,ck,uk,dk;function fk(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function hk(e){for(var r=1;r{var i=t-n,o;return o=zr(ok||(ok=rd(["M ",",",""])),e,r),o+=zr(lk||(lk=rd(["L ",",",""])),e+t,r),o+=zr(ck||(ck=rd(["L ",",",""])),e+t-i/2,r+l),o+=zr(uk||(uk=rd(["L ",",",""])),e+t-i/2-n,r+l),o+=zr(dk||(dk=rd(["L ",","," Z"])),e,r),o},SJ={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},kJ=e=>{var r=An(e,SJ),{x:t,y:n,upperWidth:l,lowerWidth:i,height:o,className:u}=r,{animationEasing:c,animationDuration:s,animationBegin:d,isUpdateAnimationActive:f}=r,h=R.useRef(null),[m,p]=R.useState(-1),x=R.useRef(l),g=R.useRef(i),y=R.useRef(o),v=R.useRef(t),_=R.useRef(n),C=o0(e,"trapezoid-");if(R.useEffect(()=>{if(h.current&&h.current.getTotalLength)try{var L=h.current.getTotalLength();L&&p(L)}catch{}},[]),t!==+t||n!==+n||l!==+l||i!==+i||o!==+o||l===0&&i===0||o===0)return null;var M=fr("recharts-trapezoid",u);if(!f)return R.createElement("g",null,R.createElement("path",pp({},ni(r),{className:M,d:mk(t,n,l,i,o)})));var T=x.current,U=g.current,F=y.current,H=v.current,W=_.current,K="0px ".concat(m===-1?1:m,"px"),$="".concat(m,"px 0px"),P=tE(["strokeDasharray"],s,c);return R.createElement(a0,{animationId:C,key:C,canBegin:m>0,duration:s,easing:c,isActive:f,begin:d},L=>{var E=$r(T,l,L),j=$r(U,i,L),k=$r(F,o,L),S=$r(H,t,L),N=$r(W,n,L);h.current&&(x.current=E,g.current=j,y.current=k,v.current=S,_.current=N);var O=L>0?{transition:P,strokeDasharray:$}:{strokeDasharray:K};return R.createElement("path",pp({},ni(r),{className:M,d:mk(S,N,E,j,k),ref:h,style:hk(hk({},O),r.style)}))})},NJ=["option","shapeType","activeClassName"];function CJ(e,r){if(e==null)return{};var t,n,l=EJ(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n{var n=Dr();return(l,i)=>o=>{e?.(l,i,o),n(tA({activeIndex:String(i),activeDataKey:r,activeCoordinate:l.tooltipPosition,activeGraphicalItemId:t}))}},KA=e=>{var r=Dr();return(t,n)=>l=>{e?.(t,n,l),r(tY())}},XA=(e,r,t)=>{var n=Dr();return(l,i)=>o=>{e?.(l,i,o),n(rY({activeIndex:String(i),activeDataKey:r,activeCoordinate:l.tooltipPosition,activeGraphicalItemId:t}))}};function GA(e){var{tooltipEntrySettings:r}=e,t=Dr(),n=Un(),l=R.useRef(null);return R.useLayoutEffect(()=>{n||(l.current===null?t(ZG(r)):l.current!==r&&t(QG({prev:l.current,next:r})),l.current=r)},[r,t,n]),R.useLayoutEffect(()=>()=>{l.current&&(t(JG(l.current)),l.current=null)},[t]),null}function YA(e){var{legendPayload:r}=e,t=Dr(),n=Un(),l=R.useRef(null);return R.useLayoutEffect(()=>{n||(l.current===null?t(bq(r)):l.current!==r&&t(yq({prev:l.current,next:r})),l.current=r)},[t,n,r]),R.useLayoutEffect(()=>()=>{l.current&&(t(vq(l.current)),l.current=null)},[t]),null}var ly,RJ=()=>{var[e]=R.useState(()=>Nd("uid-"));return e},DJ=(ly=dN.useId)!==null&&ly!==void 0?ly:RJ;function LJ(e,r){var t=DJ();return r||(e?"".concat(e,"-").concat(t):t)}var FJ=R.createContext(void 0),ZA=e=>{var{id:r,type:t,children:n}=e,l=LJ("recharts-".concat(t),r);return R.createElement(FJ.Provider,{value:l},n(l))},BJ={cartesianItems:[],polarItems:[]},QA=pi({name:"graphicalItems",initialState:BJ,reducers:{addCartesianGraphicalItem:{reducer(e,r){e.cartesianItems.push(r.payload)},prepare:Nr()},replaceCartesianGraphicalItem:{reducer(e,r){var{prev:t,next:n}=r.payload,l=gs(e).cartesianItems.indexOf(t);l>-1&&(e.cartesianItems[l]=n)},prepare:Nr()},removeCartesianGraphicalItem:{reducer(e,r){var t=gs(e).cartesianItems.indexOf(r.payload);t>-1&&e.cartesianItems.splice(t,1)},prepare:Nr()},addPolarGraphicalItem:{reducer(e,r){e.polarItems.push(r.payload)},prepare:Nr()},removePolarGraphicalItem:{reducer(e,r){var t=gs(e).polarItems.indexOf(r.payload);t>-1&&e.polarItems.splice(t,1)},prepare:Nr()}}}),{addCartesianGraphicalItem:zJ,replaceCartesianGraphicalItem:$J,removeCartesianGraphicalItem:UJ,addPolarGraphicalItem:Dse,removePolarGraphicalItem:Lse}=QA.actions,VJ=QA.reducer,qJ=e=>{var r=Dr(),t=R.useRef(null);return R.useLayoutEffect(()=>{t.current===null?r(zJ(e)):t.current!==e&&r($J({prev:t.current,next:e})),t.current=e},[r,e]),R.useLayoutEffect(()=>()=>{t.current&&(r(UJ(t.current)),t.current=null)},[r]),null},JA=R.memo(qJ),HJ=["points"];function xk(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function cy(e){for(var r=1;r{var g,y,v=cy(cy(cy({r:3},o),f),{},{index:x,cx:(g=p.x)!==null&&g!==void 0?g:void 0,cy:(y=p.y)!==null&&y!==void 0?y:void 0,dataKey:i,value:p.value,payload:p.payload,points:r});return R.createElement(ZJ,{key:"dot-".concat(x),option:t,dotProps:v,className:l})}),m={};return u&&c!=null&&(m.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),R.createElement(Yi,{zIndex:s},R.createElement(Wi,xp({className:n},m),h))}function bk(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function yk(e){for(var r=1;r({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),hee=Te([fee,Oa,Pa],(e,r,t)=>{if(!(!e||r==null||t==null))return{x:e.left,y:e.top,width:Math.max(0,r-e.left-e.right),height:Math.max(0,t-e.top-e.bottom)}}),mw=()=>kt(hee),mee=()=>kt(HY);function vk(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function uy(e){for(var r=1;r{var{point:r,childIndex:t,mainColor:n,activeDot:l,dataKey:i,clipPath:o}=e;if(l===!1||r.x==null||r.y==null)return null;var u={index:t,dataKey:i,cx:r.x,cy:r.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:r.payload,value:r.value},c=uy(uy(uy({},u),Wd(l)),Q1(l)),s;return R.isValidElement(l)?s=R.cloneElement(l,c):typeof l=="function"?s=l(c):s=R.createElement($A,c),R.createElement(Wi,{className:"recharts-active-dot",clipPath:o},s)};function yee(e){var{points:r,mainColor:t,activeDot:n,itemDataKey:l,clipPath:i,zIndex:o=gn.activeDot}=e,u=kt(El),c=mee();if(r==null||c==null)return null;var s=r.find(d=>c.includes(d.payload));return Er(s)?null:R.createElement(Yi,{zIndex:o},R.createElement(bee,{point:s,childIndex:Number(u),mainColor:t,dataKey:l,activeDot:n,clipPath:i}))}var wk=(e,r,t)=>{var n=t??e;if(!Er(n))return ys(n,r,0)},vee=(e,r,t)=>{var n={},l=e.filter(b0),i=e.filter(s=>s.stackId==null),o=l.reduce((s,d)=>(s[d.stackId]||(s[d.stackId]=[]),s[d.stackId].push(d),s),n),u=Object.entries(o).map(s=>{var[d,f]=s,h=f.map(p=>p.dataKey),m=wk(r,t,f[0].barSize);return{stackId:d,dataKeys:h,barSize:m}}),c=i.map(s=>{var d=[s.dataKey].filter(h=>h!=null),f=wk(r,t,s.barSize);return{stackId:void 0,dataKeys:d,barSize:f}});return[...u,...c]};function _k(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function Yh(e){for(var r=1;ry+(v.barSize||0),0);f+=(i-1)*o,f>=t&&(f-=(i-1)*o,o=0),f>=t&&d>0&&(s=!0,d*=.9,f=i*d);var h=(t-f)/2>>0,m={offset:h-o,size:0};u=n.reduce((y,v)=>{var _,C={stackId:v.stackId,dataKeys:v.dataKeys,position:{offset:m.offset+m.size+o,size:s?d:(_=v.barSize)!==null&&_!==void 0?_:0}},M=[...y,C];return m=M[M.length-1].position,M},c)}else{var p=ys(r,t,0,!0);t-2*p-(i-1)*o<=0&&(o=0);var x=(t-2*p-(i-1)*o)/i;x>1&&(x>>=0);var g=Rr(l)?Math.min(x,l):x;u=n.reduce((y,v,_)=>[...y,{stackId:v.stackId,dataKeys:v.dataKeys,position:{offset:p+(x+o)*_+(x-g)/2,size:g}}],c)}return u}}var kee=(e,r,t,n,l,i,o)=>{var u=Er(o)?r:o,c=See(t,n,l!==i?l:i,e,u);return l!==i&&c!=null&&(c=c.map(s=>Yh(Yh({},s),{},{position:Yh(Yh({},s.position),{},{offset:s.position.offset-l/2})}))),c},Nee=(e,r)=>{var t=W2(r);if(!(!e||t==null||r==null)){var{stackId:n}=r;if(n!=null){var l=e[n];if(l){var{stackedData:i}=l;if(i)return i.find(o=>o.key===t)}}}};function Cee(e,r){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Rr(e.zIndex)?e.zIndex:r}var Eee=e=>{var{chartData:r}=e,t=Dr(),n=Un();return R.useEffect(()=>n?()=>{}:(t(TS(r)),()=>{t(TS(void 0))}),[r,t,n]),null},jk={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},rM=pi({name:"brush",initialState:jk,reducers:{setBrushSettings(e,r){return r.payload==null?jk:r.payload}}}),{setBrushSettings:$se}=rM.actions,Aee=rM.reducer;function Mee(e,r,t){return(r=Oee(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Oee(e){var r=Pee(e,"string");return typeof r=="symbol"?r:r+""}function Pee(e,r){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}class pw{static create(r){return new pw(r)}constructor(r){this.scale=r}get domain(){return this.scale.domain}get range(){return this.scale.range}get rangeMin(){return this.range()[0]}get rangeMax(){return this.range()[1]}get bandwidth(){return this.scale.bandwidth}apply(r){var{bandAware:t,position:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(r!==void 0){if(n)switch(n){case"start":return this.scale(r);case"middle":{var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}case"end":{var i=this.bandwidth?this.bandwidth():0;return this.scale(r)+i}default:return this.scale(r)}if(t){var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}return this.scale(r)}}isInRange(r){var t=this.range(),n=t[0],l=t[t.length-1];return n<=l?r>=n&&r<=l:r>=l&&r<=n}}Mee(pw,"EPS",1e-4);function Tee(e){return(e%180+180)%180}var Iee=function(r){var{width:t,height:n}=r,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Tee(l),o=i*Math.PI/180,u=Math.atan(n/t),c=o>u&&o{e.dots.push(r.payload)},removeDot:(e,r)=>{var t=gs(e).dots.findIndex(n=>n===r.payload);t!==-1&&e.dots.splice(t,1)},addArea:(e,r)=>{e.areas.push(r.payload)},removeArea:(e,r)=>{var t=gs(e).areas.findIndex(n=>n===r.payload);t!==-1&&e.areas.splice(t,1)},addLine:(e,r)=>{e.lines.push(r.payload)},removeLine:(e,r)=>{var t=gs(e).lines.findIndex(n=>n===r.payload);t!==-1&&e.lines.splice(t,1)}}}),{addDot:Use,removeDot:Vse,addArea:qse,removeArea:Hse,addLine:Wse,removeLine:Kse}=nM.actions,Dee=nM.reducer,Lee=R.createContext(void 0),Fee=e=>{var{children:r}=e,[t]=R.useState("".concat(Nd("recharts"),"-clip")),n=mw();if(n==null)return null;var{x:l,y:i,width:o,height:u}=n;return R.createElement(Lee.Provider,{value:t},R.createElement("defs",null,R.createElement("clipPath",{id:t},R.createElement("rect",{x:l,y:i,height:u,width:o}))),r)};function iM(e,r){if(r<1)return[];if(r===1)return e;for(var t=[],n=0;ne*l)return!1;var i=t();return e*(r-e*i/2-n)>=0&&e*(r+e*i/2-l)<=0}function $ee(e,r){return iM(e,r+1)}function Uee(e,r,t,n,l){for(var i=(n||[]).slice(),{start:o,end:u}=r,c=0,s=1,d=o,f=function(){var p=n?.[c];if(p===void 0)return{v:iM(n,s)};var x=c,g,y=()=>(g===void 0&&(g=t(p,x)),g),v=p.coordinate,_=c===0||zd(e,v,y,d,u);_||(c=0,d=o,s+=1),_&&(d=v+e*(y()/2+l),c+=s)},h;s<=i.length;)if(h=f(),h)return h.v;return[]}function Vee(e,r,t,n,l){var i=(n||[]).slice(),o=i.length;if(o===0)return[];for(var{start:u,end:c}=r,s=1;s<=o;s++){for(var d=(o-1)%s,f=u,h=!0,m=function(){var v=n[p],_=p,C,M=()=>(C===void 0&&(C=t(v,_)),C),T=v.coordinate,U=p===d||zd(e,T,M,f,c);if(!U)return h=!1,1;U&&(f=T+e*(M()/2+l))},p=d;p(p===void 0&&(p=t(m,h)),p);if(h===o-1){var g=e*(m.coordinate+e*x()/2-c);i[h]=m=Bn(Bn({},m),{},{tickCoord:g>0?m.coordinate-g*e:m.coordinate})}else i[h]=m=Bn(Bn({},m),{},{tickCoord:m.coordinate});if(m.tickCoord!=null){var y=zd(e,m.tickCoord,x,u,c);y&&(c=m.tickCoord-e*(x()/2+l),i[h]=Bn(Bn({},m),{},{isShow:!0}))}},d=o-1;d>=0;d--)s(d);return i}function Xee(e,r,t,n,l,i){var o=(n||[]).slice(),u=o.length,{start:c,end:s}=r;if(i){var d=n[u-1],f=t(d,u-1),h=e*(d.coordinate+e*f/2-s);if(o[u-1]=d=Bn(Bn({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),d.tickCoord!=null){var m=zd(e,d.tickCoord,()=>f,c,s);m&&(s=d.tickCoord-e*(f/2+l),o[u-1]=Bn(Bn({},d),{},{isShow:!0}))}}for(var p=i?u-1:u,x=function(v){var _=o[v],C,M=()=>(C===void 0&&(C=t(_,v)),C);if(v===0){var T=e*(_.coordinate-e*M()/2-c);o[v]=_=Bn(Bn({},_),{},{tickCoord:T<0?_.coordinate-T*e:_.coordinate})}else o[v]=_=Bn(Bn({},_),{},{tickCoord:_.coordinate});if(_.tickCoord!=null){var U=zd(e,_.tickCoord,M,c,s);U&&(c=_.tickCoord+e*(M()/2+l),o[v]=Bn(Bn({},_),{},{isShow:!0}))}},g=0;g{var M=typeof s=="function"?s(_.value,C):_.value;return p==="width"?Bee(md(M,{fontSize:r,letterSpacing:t}),x,f):md(M,{fontSize:r,letterSpacing:t})[p]},y=l.length>=2?fi(l[1].coordinate-l[0].coordinate):1,v=zee(i,y,p);return c==="equidistantPreserveStart"?Uee(y,v,g,l,o):c==="equidistantPreserveEnd"?Vee(y,v,g,l,o):(c==="preserveStart"||c==="preserveStartEnd"?m=Xee(y,v,g,l,o,c==="preserveStartEnd"):m=Kee(y,v,g,l,o),m.filter(_=>_.isShow))}var Gee=e=>{var{ticks:r,label:t,labelGapWithTick:n=5,tickSize:l=0,tickMargin:i=0}=e,o=0;if(r){Array.from(r).forEach(d=>{if(d){var f=d.getBoundingClientRect();f.width>o&&(o=f.width)}});var u=t?t.getBoundingClientRect().width:0,c=l+i,s=o+c+u+(t?n:0);return Math.round(s)}return 0},Yee=["axisLine","width","height","className","hide","ticks","axisType"];function Zee(e,r){if(e==null)return{};var t,n,l=Qee(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n{var{ticks:t=[],tick:n,tickLine:l,stroke:i,tickFormatter:o,unit:u,padding:c,tickTextProps:s,orientation:d,mirror:f,x:h,y:m,width:p,height:x,tickSize:g,tickMargin:y,fontSize:v,letterSpacing:_,getTicksConfig:C,events:M,axisType:T}=e,U=gw(Gr(Gr({},C),{},{ticks:t}),v,_),F=ite(d,f),H=ste(d,f),W=xs(C),K=Wd(n),$={};typeof l=="object"&&($=l);var P=Gr(Gr({},W),{},{fill:"none"},$),L=U.map(k=>Gr({entry:k},nte(k,h,m,p,x,d,g,f,y))),E=L.map(k=>{var{entry:S,line:N}=k;return R.createElement(Wi,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(S.value,"-").concat(S.coordinate,"-").concat(S.tickCoord)},l&&R.createElement("line",Al({},P,N,{className:fr("recharts-cartesian-axis-tick-line",Tc(l,"className"))})))}),j=L.map((k,S)=>{var{entry:N,tick:O}=k,D=Gr(Gr(Gr(Gr({textAnchor:F,verticalAnchor:H},W),{},{stroke:"none",fill:i},K),O),{},{index:S,payload:N,visibleTicksCount:U.length,tickFormatter:o,padding:c},s);return R.createElement(Wi,Al({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(N.value,"-").concat(N.coordinate,"-").concat(N.tickCoord)},Fp(M,N,S)),n&&R.createElement(ate,{option:n,tickProps:D,value:"".concat(typeof o=="function"?o(N.value,S):N.value).concat(u||"")}))});return R.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(T,"-ticks")},j.length>0&&R.createElement(Yi,{zIndex:gn.label},R.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(T,"-tick-labels"),ref:r},j)),E.length>0&&R.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(T,"-tick-lines")},E))}),lte=R.forwardRef((e,r)=>{var{axisLine:t,width:n,height:l,className:i,hide:o,ticks:u,axisType:c}=e,s=Zee(e,Yee),[d,f]=R.useState(""),[h,m]=R.useState(""),p=R.useRef(null);R.useImperativeHandle(r,()=>({getCalculatedWidth:()=>{var g;return Gee({ticks:p.current,label:(g=e.labelRef)===null||g===void 0?void 0:g.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var x=R.useCallback(g=>{if(g){var y=g.getElementsByClassName("recharts-cartesian-axis-tick-value");p.current=y;var v=y[0];if(v){var _=window.getComputedStyle(v),C=_.fontSize,M=_.letterSpacing;(C!==d||M!==h)&&(f(C),m(M))}}},[d,h]);return o||n!=null&&n<=0||l!=null&&l<=0?null:R.createElement(Yi,{zIndex:e.zIndex},R.createElement(Wi,{className:fr("recharts-cartesian-axis",i)},R.createElement(rte,{x:e.x,y:e.y,width:n,height:l,orientation:e.orientation,mirror:e.mirror,axisLine:t,otherSvgProps:xs(e)}),R.createElement(ote,{ref:x,axisType:c,events:s,fontSize:d,getTicksConfig:e,height:e.height,letterSpacing:h,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:u,unit:e.unit,width:e.width,x:e.x,y:e.y}),R.createElement(UQ,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},R.createElement(QQ,{label:e.label,labelRef:e.labelRef}),e.children)))}),xw=R.forwardRef((e,r)=>{var t=An(e,ya);return R.createElement(lte,Al({},t,{ref:r}))});xw.displayName="CartesianAxis";var cte=["x1","y1","x2","y2","key"],ute=["offset"],dte=["xAxisId","yAxisId"],fte=["xAxisId","yAxisId"];function Nk(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function zn(e){for(var r=1;r{var{fill:r}=e;if(!r||r==="none")return null;var{fillOpacity:t,x:n,y:l,width:i,height:o,ry:u}=e;return R.createElement("rect",{x:n,y:l,ry:u,width:i,height:o,stroke:"none",fill:r,fillOpacity:t,className:"recharts-cartesian-grid-bg"})};function sM(e){var{option:r,lineItemProps:t}=e,n;if(R.isValidElement(r))n=R.cloneElement(r,t);else if(typeof r=="function")n=r(t);else{var l,{x1:i,y1:o,x2:u,y2:c,key:s}=t,d=bp(t,cte),f=(l=xs(d))!==null&&l!==void 0?l:{},{offset:h}=f,m=bp(f,ute);n=R.createElement("line",xl({},m,{x1:i,y1:o,x2:u,y2:c,fill:"none",key:s}))}return n}function bte(e){var{x:r,width:t,horizontal:n=!0,horizontalPoints:l}=e;if(!n||!l||!l.length)return null;var{xAxisId:i,yAxisId:o}=e,u=bp(e,dte),c=l.map((s,d)=>{var f=zn(zn({},u),{},{x1:r,y1:s,x2:r+t,y2:s,key:"line-".concat(d),index:d});return R.createElement(sM,{key:"line-".concat(d),option:n,lineItemProps:f})});return R.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function yte(e){var{y:r,height:t,vertical:n=!0,verticalPoints:l}=e;if(!n||!l||!l.length)return null;var{xAxisId:i,yAxisId:o}=e,u=bp(e,fte),c=l.map((s,d)=>{var f=zn(zn({},u),{},{x1:s,y1:r,x2:s,y2:r+t,key:"line-".concat(d),index:d});return R.createElement(sM,{option:n,lineItemProps:f,key:"line-".concat(d)})});return R.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function vte(e){var{horizontalFill:r,fillOpacity:t,x:n,y:l,width:i,height:o,horizontalPoints:u,horizontal:c=!0}=e;if(!c||!r||!r.length||u==null)return null;var s=u.map(f=>Math.round(f+l-l)).sort((f,h)=>f-h);l!==s[0]&&s.unshift(0);var d=s.map((f,h)=>{var m=!s[h+1],p=m?l+o-f:s[h+1]-f;if(p<=0)return null;var x=h%r.length;return R.createElement("rect",{key:"react-".concat(h),y:f,x:n,height:p,width:i,stroke:"none",fill:r[x],fillOpacity:t,className:"recharts-cartesian-grid-bg"})});return R.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function wte(e){var{vertical:r=!0,verticalFill:t,fillOpacity:n,x:l,y:i,width:o,height:u,verticalPoints:c}=e;if(!r||!t||!t.length)return null;var s=c.map(f=>Math.round(f+l-l)).sort((f,h)=>f-h);l!==s[0]&&s.unshift(0);var d=s.map((f,h)=>{var m=!s[h+1],p=m?l+o-f:s[h+1]-f;if(p<=0)return null;var x=h%t.length;return R.createElement("rect",{key:"react-".concat(h),x:f,y:i,width:p,height:u,stroke:"none",fill:t[x],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return R.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var _te=(e,r)=>{var{xAxis:t,width:n,height:l,offset:i}=e;return F7(gw(zn(zn(zn({},ya),t),{},{ticks:B7(t),viewBox:{x:0,y:0,width:n,height:l}})),i.left,i.left+i.width,r)},jte=(e,r)=>{var{yAxis:t,width:n,height:l,offset:i}=e;return F7(gw(zn(zn(zn({},ya),t),{},{ticks:B7(t),viewBox:{x:0,y:0,width:n,height:l}})),i.top,i.top+i.height,r)},Ste={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:gn.grid};function hm(e){var r=u2(),t=d2(),n=H7(),l=zn(zn({},An(e,Ste)),{},{x:xt(e.x)?e.x:n.left,y:xt(e.y)?e.y:n.top,width:xt(e.width)?e.width:n.width,height:xt(e.height)?e.height:n.height}),{xAxisId:i,yAxisId:o,x:u,y:c,width:s,height:d,syncWithTicks:f,horizontalValues:h,verticalValues:m}=l,p=Un(),x=kt(H=>wS(H,"xAxis",i,p)),g=kt(H=>wS(H,"yAxis",o,p));if(!$s(s)||!$s(d)||!xt(u)||!xt(c))return null;var y=l.verticalCoordinatesGenerator||_te,v=l.horizontalCoordinatesGenerator||jte,{horizontalPoints:_,verticalPoints:C}=l;if((!_||!_.length)&&typeof v=="function"){var M=h&&h.length,T=v({yAxis:g?zn(zn({},g),{},{ticks:M?h:g.ticks}):void 0,width:r??s,height:t??d,offset:n},M?!0:f);Hm(Array.isArray(T),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof T,"]")),Array.isArray(T)&&(_=T)}if((!C||!C.length)&&typeof y=="function"){var U=m&&m.length,F=y({xAxis:x?zn(zn({},x),{},{ticks:U?m:x.ticks}):void 0,width:r??s,height:t??d,offset:n},U?!0:f);Hm(Array.isArray(F),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof F,"]")),Array.isArray(F)&&(C=F)}return R.createElement(Yi,{zIndex:l.zIndex},R.createElement("g",{className:"recharts-cartesian-grid"},R.createElement(xte,{fill:l.fill,fillOpacity:l.fillOpacity,x:l.x,y:l.y,width:l.width,height:l.height,ry:l.ry}),R.createElement(vte,xl({},l,{horizontalPoints:_})),R.createElement(wte,xl({},l,{verticalPoints:C})),R.createElement(bte,xl({},l,{offset:n,horizontalPoints:_,xAxis:x,yAxis:g})),R.createElement(yte,xl({},l,{offset:n,verticalPoints:C,xAxis:x,yAxis:g}))))}hm.displayName="CartesianGrid";var kte={},aM=pi({name:"errorBars",initialState:kte,reducers:{addErrorBar:(e,r)=>{var{itemId:t,errorBar:n}=r.payload;e[t]||(e[t]=[]),e[t].push(n)},replaceErrorBar:(e,r)=>{var{itemId:t,prev:n,next:l}=r.payload;e[t]&&(e[t]=e[t].map(i=>i.dataKey===n.dataKey&&i.direction===n.direction?l:i))},removeErrorBar:(e,r)=>{var{itemId:t,errorBar:n}=r.payload;e[t]&&(e[t]=e[t].filter(l=>l.dataKey!==n.dataKey||l.direction!==n.direction))}}}),{addErrorBar:Xse,replaceErrorBar:Gse,removeErrorBar:Yse}=aM.actions,Nte=aM.reducer,Cte=["children"];function Ete(e,r){if(e==null)return{};var t,n,l=Ate(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n({x:0,y:0,value:0}),errorBarOffset:0},Ote=R.createContext(Mte);function oM(e){var{children:r}=e,t=Ete(e,Cte);return R.createElement(Ote.Provider,{value:t},r)}function bw(e,r){var t,n,l=kt(s=>Ra(s,e)),i=kt(s=>Da(s,r)),o=(t=l?.allowDataOverflow)!==null&&t!==void 0?t:fn.allowDataOverflow,u=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:hn.allowDataOverflow,c=o||u;return{needClip:c,needClipX:o,needClipY:u}}function lM(e){var{xAxisId:r,yAxisId:t,clipPathId:n}=e,l=mw(),{needClipX:i,needClipY:o,needClip:u}=bw(r,t);if(!u||!l)return null;var{x:c,y:s,width:d,height:f}=l;return R.createElement("clipPath",{id:"clipPath-".concat(n)},R.createElement("rect",{x:i?c:c-d/2,y:o?s:s-f/2,width:i?d:d*2,height:o?f:f*2}))}var cM=(e,r,t,n)=>So(e,"xAxis",r,n),uM=(e,r,t,n)=>jo(e,"xAxis",r,n),dM=(e,r,t,n)=>So(e,"yAxis",t,n),fM=(e,r,t,n)=>jo(e,"yAxis",t,n),Pte=Te([ar,cM,dM,uM,fM],(e,r,t,n,l)=>Co(e,"xAxis")?Rc(r,n,!1):Rc(t,l,!1)),Tte=(e,r,t,n,l)=>l;function Ite(e){return e.type==="line"}var Rte=Te([w0,Tte],(e,r)=>e.filter(Ite).find(t=>t.id===r)),Dte=Te([ar,cM,dM,uM,fM,Rte,Pte,L2],(e,r,t,n,l,i,o,u)=>{var{chartData:c,dataStartIndex:s,dataEndIndex:d}=u;if(!(i==null||r==null||t==null||n==null||l==null||n.length===0||l.length===0||o==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:f,data:h}=i,m;if(h!=null&&h.length>0?m=h:m=c?.slice(s,d+1),m!=null)return jre({layout:e,xAxis:r,yAxis:t,xAxisTicks:n,yAxisTicks:l,dataKey:f,bandSize:o,displayedData:m})}});function Lte(e){var r=Wd(e),t=3,n=2;if(r!=null){var{r:l,strokeWidth:i}=r,o=Number(l),u=Number(i);return(Number.isNaN(o)||o<0)&&(o=t),(Number.isNaN(u)||u<0)&&(u=n),{r:o,strokeWidth:u}}return{r:t,strokeWidth:n}}var dy={exports:{}},fy={};var Ck;function Fte(){if(Ck)return fy;Ck=1;var e=$c();function r(c,s){return c===s&&(c!==0||1/c===1/s)||c!==c&&s!==s}var t=typeof Object.is=="function"?Object.is:r,n=e.useSyncExternalStore,l=e.useRef,i=e.useEffect,o=e.useMemo,u=e.useDebugValue;return fy.useSyncExternalStoreWithSelector=function(c,s,d,f,h){var m=l(null);if(m.current===null){var p={hasValue:!1,value:null};m.current=p}else p=m.current;m=o(function(){function g(M){if(!y){if(y=!0,v=M,M=f(M),h!==void 0&&p.hasValue){var T=p.value;if(h(T,M))return _=T}return _=M}if(T=_,t(v,M))return T;var U=f(M);return h!==void 0&&h(T,U)?(v=M,T):(v=M,_=U)}var y=!1,v,_,C=d===void 0?null:d;return[function(){return g(s())},C===null?void 0:function(){return g(C())}]},[s,d,f,h]);var x=n(c,m[0],m[1]);return i(function(){p.hasValue=!0,p.value=x},[x]),u(x),x},fy}var Ek;function Bte(){return Ek||(Ek=1,dy.exports=Fte()),dy.exports}Bte();function zte(e){e()}function $te(){let e=null,r=null;return{clear(){e=null,r=null},notify(){zte(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){const t=[];let n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(t){let n=!0;const l=r={callback:t,next:null,prev:r};return l.prev?l.prev.next=l:e=l,function(){!n||e===null||(n=!1,l.next?l.next.prev=l.prev:r=l.prev,l.prev?l.prev.next=l.next:e=l.next)}}}}var Ak={notify(){},get:()=>[]};function Ute(e,r){let t,n=Ak,l=0,i=!1;function o(x){d();const g=n.subscribe(x);let y=!1;return()=>{y||(y=!0,g(),f())}}function u(){n.notify()}function c(){p.onStateChange&&p.onStateChange()}function s(){return i}function d(){l++,t||(t=e.subscribe(c),n=$te())}function f(){l--,t&&l===0&&(t(),t=void 0,n.clear(),n=Ak)}function h(){i||(i=!0,d())}function m(){i&&(i=!1,f())}const p={addNestedSub:o,notifyNestedSubs:u,handleChangeWrapper:c,isSubscribed:s,trySubscribe:h,tryUnsubscribe:m,getListeners:()=>n};return p}var Vte=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",qte=Vte(),Hte=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Wte=Hte(),Kte=()=>qte||Wte?R.useLayoutEffect:R.useEffect,Xte=Kte();function Mk(e,r){return e===r?e!==0||r!==0||1/e===1/r:e!==e&&r!==r}function Gte(e,r){if(Mk(e,r))return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;const t=Object.keys(e),n=Object.keys(r);if(t.length!==n.length)return!1;for(let l=0;l{const c=Ute(l);return{store:l,subscription:c,getServerState:n?()=>n:void 0}},[l,n]),o=R.useMemo(()=>l.getState(),[l]);Xte(()=>{const{subscription:c}=i;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==l.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[i,o]);const u=t||Jte;return R.createElement(u.Provider,{value:i},r)}var tre=ere,rre=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function nre(e,r){return e==null&&r==null?!0:typeof e=="number"&&typeof r=="number"?e===r||e!==e&&r!==r:e===r}function N0(e,r){var t=new Set([...Object.keys(e),...Object.keys(r)]);for(var n of t)if(rre.has(n)){if(e[n]==null&&r[n]==null)continue;if(!Gte(e[n],r[n]))return!1}else if(!nre(e[n],r[n]))return!1;return!0}var ire=["id"],sre=["type","layout","connectNulls","needClip","shape"],are=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function $d(){return $d=Object.assign?Object.assign.bind():function(e){for(var r=1;r{var{dataKey:r,name:t,stroke:n,legendType:l,hide:i}=e;return[{inactive:i,dataKey:r,type:l,color:n,value:Gp(t,r),payload:e}]},fre=R.memo(e=>{var{dataKey:r,data:t,stroke:n,strokeWidth:l,fill:i,name:o,hide:u,unit:c,tooltipType:s,id:d}=e,f={dataDefinedOnItem:t,positions:void 0,settings:{stroke:n,strokeWidth:l,fill:i,dataKey:r,nameKey:void 0,name:Gp(o,r),hide:u,type:s,color:n,unit:c,graphicalItemId:d}};return R.createElement(GA,{tooltipEntrySettings:f})}),hM=(e,r)=>"".concat(r,"px ").concat(e-r,"px");function hre(e,r){for(var t=e.length%2!==0?[...e,0]:e,n=[],l=0;l{var n=t.reduce((f,h)=>f+h);if(!n)return hM(r,e);for(var l=Math.floor(e/n),i=e%n,o=r-e,u=[],c=0,s=0;ci){u=[...t.slice(0,c),i-s];break}var d=u.length%2===0?[0,o]:[o];return[...hre(t,l),...u,...d].map(f=>"".concat(f,"px")).join(", ")};function pre(e){var{clipPathId:r,points:t,props:n}=e,{dot:l,dataKey:i,needClip:o}=n,{id:u}=n,c=yw(n,ire),s=xs(c);return R.createElement(JJ,{points:t,dot:l,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:i,baseProps:s,needClip:o,clipPathId:r})}function gre(e){var{showLabels:r,children:t,points:n}=e,l=R.useMemo(()=>n?.map(i=>{var o,u,c={x:(o=i.x)!==null&&o!==void 0?o:0,y:(u=i.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Is(Is({},c),{},{value:i.value,payload:i.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[n]);return R.createElement(FA,{value:r?l:void 0},t)}function Pk(e){var{clipPathId:r,pathRef:t,points:n,strokeDasharray:l,props:i}=e,{type:o,layout:u,connectNulls:c,needClip:s,shape:d}=i,f=yw(i,sre),h=Is(Is({},ni(f)),{},{fill:"none",className:"recharts-line-curve",clipPath:s?"url(#clipPath-".concat(r,")"):void 0,points:n,type:o,layout:u,connectNulls:c,strokeDasharray:l??i.strokeDasharray});return R.createElement(R.Fragment,null,n?.length>1&&R.createElement(HA,$d({shapeType:"curve",option:d},h,{pathRef:t})),R.createElement(pre,{points:n,clipPathId:r,props:i}))}function xre(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function bre(e){var{clipPathId:r,props:t,pathRef:n,previousPointsRef:l,longestAnimatedLengthRef:i}=e,{points:o,strokeDasharray:u,isAnimationActive:c,animationBegin:s,animationDuration:d,animationEasing:f,animateNewValues:h,width:m,height:p,onAnimationEnd:x,onAnimationStart:g}=t,y=l.current,v=o0(o,"recharts-line-"),_=R.useRef(v),[C,M]=R.useState(!1),T=!C,U=R.useCallback(()=>{typeof x=="function"&&x(),M(!1)},[x]),F=R.useCallback(()=>{typeof g=="function"&&g(),M(!0)},[g]),H=xre(n.current),W=R.useRef(0);_.current!==v&&(W.current=i.current,_.current=v);var K=W.current;return R.createElement(gre,{points:o,showLabels:T},t.children,R.createElement(a0,{animationId:v,begin:s,duration:d,isActive:c,easing:f,onAnimationEnd:U,onAnimationStart:F,key:v},$=>{var P=$r(K,H+K,$),L=Math.min(P,H),E;if(c)if(u){var j="".concat(u).split(/[,\s]+/gim).map(N=>parseFloat(N));E=mre(L,H,j)}else E=hM(H,L);else E=u==null?void 0:String(u);if($>0&&H>0&&(l.current=o,i.current=Math.max(i.current,L)),y){var k=y.length/o.length,S=$===1?o:o.map((N,O)=>{var D=Math.floor(O*k);if(y[D]){var B=y[D];return Is(Is({},N),{},{x:$r(B.x,N.x,$),y:$r(B.y,N.y,$)})}return h?Is(Is({},N),{},{x:$r(m*2,N.x,$),y:$r(p/2,N.y,$)}):Is(Is({},N),{},{x:N.x,y:N.y})});return l.current=S,R.createElement(Pk,{props:t,points:S,clipPathId:r,pathRef:n,strokeDasharray:E})}return R.createElement(Pk,{props:t,points:o,clipPathId:r,pathRef:n,strokeDasharray:E})}),R.createElement(zA,{label:t.label}))}function yre(e){var{clipPathId:r,props:t}=e,n=R.useRef(null),l=R.useRef(0),i=R.useRef(null);return R.createElement(bre,{props:t,clipPathId:r,previousPointsRef:n,longestAnimatedLengthRef:l,pathRef:i})}var vre=(e,r)=>{var t,n;return{x:(t=e.x)!==null&&t!==void 0?t:void 0,y:(n=e.y)!==null&&n!==void 0?n:void 0,value:e.value,errorVal:Yr(e.payload,r)}};class wre extends R.Component{render(){var{hide:r,dot:t,points:n,className:l,xAxisId:i,yAxisId:o,top:u,left:c,width:s,height:d,id:f,needClip:h,zIndex:m}=this.props;if(r)return null;var p=fr("recharts-line",l),x=f,{r:g,strokeWidth:y}=Lte(t),v=qA(t),_=g*2+y,C=h?"url(#clipPath-".concat(v?"":"dots-").concat(x,")"):void 0;return R.createElement(Yi,{zIndex:m},R.createElement(Wi,{className:p},h&&R.createElement("defs",null,R.createElement(lM,{clipPathId:x,xAxisId:i,yAxisId:o}),!v&&R.createElement("clipPath",{id:"clipPath-dots-".concat(x)},R.createElement("rect",{x:c-_/2,y:u-_/2,width:s+_,height:d+_}))),R.createElement(oM,{xAxisId:i,yAxisId:o,data:n,dataPointFormatter:vre,errorBarOffset:0},R.createElement(yre,{props:this.props,clipPathId:x}))),R.createElement(yee,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:C}))}}var mM={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:gn.line,type:"linear"};function _re(e){var r=An(e,mM),{activeDot:t,animateNewValues:n,animationBegin:l,animationDuration:i,animationEasing:o,connectNulls:u,dot:c,hide:s,isAnimationActive:d,label:f,legendType:h,xAxisId:m,yAxisId:p,id:x}=r,g=yw(r,are),{needClip:y}=bw(m,p),v=mw(),_=Kc(),C=Un(),M=kt(W=>Dte(W,m,p,C,x));if(_!=="horizontal"&&_!=="vertical"||M==null||v==null)return null;var{height:T,width:U,x:F,y:H}=v;return R.createElement(wre,$d({},g,{id:x,connectNulls:u,dot:c,activeDot:t,animateNewValues:n,animationBegin:l,animationDuration:i,animationEasing:o,isAnimationActive:d,hide:s,label:f,legendType:h,xAxisId:m,yAxisId:p,points:M,layout:_,height:T,width:U,left:F,top:H,needClip:y}))}function jre(e){var{layout:r,xAxis:t,yAxis:n,xAxisTicks:l,yAxisTicks:i,dataKey:o,bandSize:u,displayedData:c}=e;return c.map((s,d)=>{var f=Yr(s,o);if(r==="horizontal"){var h=j5({axis:t,ticks:l,bandSize:u,entry:s,index:d}),m=Er(f)?null:n.scale(f);return{x:h,y:m,value:f,payload:s}}var p=Er(f)?null:t.scale(f),x=j5({axis:n,ticks:i,bandSize:u,entry:s,index:d});return p==null||x==null?null:{x:p,y:x,value:f,payload:s}}).filter(Boolean)}function Sre(e){var r=An(e,mM),t=Un();return R.createElement(ZA,{id:r.id,type:"line"},n=>R.createElement(R.Fragment,null,R.createElement(YA,{legendPayload:dre(r)}),R.createElement(fre,{dataKey:r.dataKey,data:r.data,stroke:r.stroke,strokeWidth:r.strokeWidth,fill:r.fill,name:r.name,hide:r.hide,unit:r.unit,tooltipType:r.tooltipType,id:n}),R.createElement(JA,{type:"line",id:n,data:r.data,xAxisId:r.xAxisId,yAxisId:r.yAxisId,zAxisId:0,dataKey:r.dataKey,hide:r.hide,isPanorama:t}),R.createElement(_re,$d({},r,{id:n}))))}var pM=R.memo(Sre,N0);pM.displayName="Line";function Tl(e,r){var t,n;return(t=(n=e.graphicalItems.cartesianItems.find(l=>l.id===r))===null||n===void 0?void 0:n.xAxisId)!==null&&t!==void 0?t:eM}function Il(e,r){var t,n;return(t=(n=e.graphicalItems.cartesianItems.find(l=>l.id===r))===null||n===void 0?void 0:n.yAxisId)!==null&&t!==void 0?t:eM}var kre="Invariant failed";function Nre(e,r){throw new Error(kre)}function Kv(){return Kv=Object.assign?Object.assign.bind():function(e){for(var r=1;r1&&arguments[1]!==void 0?arguments[1]:0;return(n,l)=>{if(xt(r))return r;var i=xt(n)||Er(n);return i?r(n,l):(i||Nre(),t)}},Ere=(e,r,t)=>t,Are=(e,r)=>r,ff=Te([w0,Are],(e,r)=>e.filter(t=>t.type==="bar").find(t=>t.id===r)),Mre=Te([ff],e=>e?.maxBarSize),Ore=(e,r,t,n)=>n,Pre=Te([ar,w0,Tl,Il,Ere],(e,r,t,n,l)=>r.filter(i=>e==="horizontal"?i.xAxisId===t:i.yAxisId===n).filter(i=>i.isPanorama===l).filter(i=>i.hide===!1).filter(i=>i.type==="bar")),Tre=(e,r,t)=>{var n=ar(e),l=Tl(e,r),i=Il(e,r);if(!(l==null||i==null))return n==="horizontal"?Bv(e,"yAxis",i,t):Bv(e,"xAxis",l,t)},Ire=(e,r)=>{var t=ar(e),n=Tl(e,r),l=Il(e,r);if(!(n==null||l==null))return t==="horizontal"?vS(e,"xAxis",n):vS(e,"yAxis",l)},Rre=Te([Pre,qX,Ire],vee),Dre=(e,r,t)=>{var n,l,i=ff(e,r);if(i!=null){var o=Tl(e,r),u=Il(e,r);if(!(o==null||u==null)){var c=ar(e),s=i9(e),{maxBarSize:d}=i,f=Er(d)?s:d,h,m;return c==="horizontal"?(h=So(e,"xAxis",o,t),m=jo(e,"xAxis",o,t)):(h=So(e,"yAxis",u,t),m=jo(e,"yAxis",u,t)),(n=(l=Rc(h,m,!0))!==null&&l!==void 0?l:f)!==null&&n!==void 0?n:0}}},gM=(e,r,t)=>{var n=ar(e),l=Tl(e,r),i=Il(e,r);if(!(l==null||i==null)){var o,u;return n==="horizontal"?(o=So(e,"xAxis",l,t),u=jo(e,"xAxis",l,t)):(o=So(e,"yAxis",i,t),u=jo(e,"yAxis",i,t)),Rc(o,u)}},Lre=Te([Rre,i9,VX,s9,Dre,gM,Mre],kee),Fre=(e,r,t)=>{var n=Tl(e,r);if(n!=null)return So(e,"xAxis",n,t)},Bre=(e,r,t)=>{var n=Il(e,r);if(n!=null)return So(e,"yAxis",n,t)},zre=(e,r,t)=>{var n=Tl(e,r);if(n!=null)return jo(e,"xAxis",n,t)},$re=(e,r,t)=>{var n=Il(e,r);if(n!=null)return jo(e,"yAxis",n,t)},Ure=Te([Lre,ff],(e,r)=>{if(!(e==null||r==null)){var t=e.find(n=>n.stackId===r.stackId&&r.dataKey!=null&&n.dataKeys.includes(r.dataKey));if(t!=null)return t.position}}),Vre=Te([Tre,ff],Nee),qre=Te([xn,l2,Fre,Bre,zre,$re,Ure,ar,OX,gM,Vre,ff,Ore],(e,r,t,n,l,i,o,u,c,s,d,f,h)=>{var{chartData:m,dataStartIndex:p,dataEndIndex:x}=c;if(!(f==null||o==null||r==null||u!=="horizontal"&&u!=="vertical"||t==null||n==null||l==null||i==null||s==null)){var{data:g}=f,y;if(g!=null&&g.length>0?y=g:y=m?.slice(p,x+1),y!=null)return yne({layout:u,barSettings:f,pos:o,parentViewBox:r,bandSize:s,xAxis:t,yAxis:n,xAxisTicks:l,yAxisTicks:i,stackedData:d,displayedData:y,offset:e,cells:h,dataStartIndex:p})}}),Hre=["index"];function Xv(){return Xv=Object.assign?Object.assign.bind():function(e){for(var r=1;r{var r=R.useContext(xM);if(r!=null)return r.stackId;if(e!=null)return yV(e)},Gre=(e,r)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(r),Yre=e=>{var r=R.useContext(xM);if(r!=null){var{stackId:t}=r;return"url(#".concat(Gre(t,e),")")}},Zre=e=>{var{index:r}=e,t=Wre(e,Hre),n=Yre(r);return R.createElement(Wi,Xv({className:"recharts-bar-stack-layer",clipPath:n},t))},Qre=["onMouseEnter","onMouseLeave","onClick"],Jre=["value","background","tooltipPosition"],ene=["id"],tne=["onMouseEnter","onClick","onMouseLeave"];function Aa(){return Aa=Object.assign?Object.assign.bind():function(e){for(var r=1;r{var{dataKey:r,name:t,fill:n,legendType:l,hide:i}=e;return[{inactive:i,dataKey:r,type:l,color:n,value:Gp(t,r),payload:e}]},one=R.memo(e=>{var{dataKey:r,stroke:t,strokeWidth:n,fill:l,name:i,hide:o,unit:u,tooltipType:c,id:s}=e,d={dataDefinedOnItem:void 0,positions:void 0,settings:{stroke:t,strokeWidth:n,fill:l,dataKey:r,nameKey:void 0,name:Gp(i,r),hide:o,type:c,color:l,unit:u,graphicalItemId:s}};return R.createElement(GA,{tooltipEntrySettings:d})});function lne(e){var r=kt(El),{data:t,dataKey:n,background:l,allOtherBarProps:i}=e,{onMouseEnter:o,onMouseLeave:u,onClick:c}=i,s=vp(i,Qre),d=WA(o,n,i.id),f=KA(u),h=XA(c,n,i.id);if(!l||t==null)return null;var m=Wd(l);return R.createElement(Yi,{zIndex:Cee(l,gn.barBackground)},t.map((p,x)=>{var{value:g,background:y,tooltipPosition:v}=p,_=vp(p,Jre);if(!y)return null;var C=d(p,x),M=f(p,x),T=h(p,x),U=Qn(Qn(Qn(Qn(Qn({option:l,isActive:String(x)===r},_),{},{fill:"#eee"},y),m),Fp(s,p,x)),{},{onMouseEnter:C,onMouseLeave:M,onClick:T,dataKey:n,index:x,className:"recharts-bar-background-rectangle"});return R.createElement(yp,Aa({key:"background-bar-".concat(x)},U))}))}function cne(e){var{showLabels:r,children:t,rects:n}=e,l=n?.map(i=>{var o={x:i.x,y:i.y,width:i.width,lowerWidth:i.width,upperWidth:i.width,height:i.height};return Qn(Qn({},o),{},{value:i.value,payload:i.payload,parentViewBox:i.parentViewBox,viewBox:o,fill:i.fill})});return R.createElement(FA,{value:r?l:void 0},t)}function une(e){var{shape:r,activeBar:t,baseProps:n,entry:l,index:i,dataKey:o}=e,u=kt(El),c=kt(pA),s=t&&String(i)===u&&(c==null||o===c),d=s?t:r;return s?R.createElement(Yi,{zIndex:gn.activeBar},R.createElement(yp,Aa({},n,{name:String(n.name)},l,{isActive:s,option:d,index:i,dataKey:o}))):R.createElement(yp,Aa({},n,{name:String(n.name)},l,{isActive:s,option:d,index:i,dataKey:o}))}function dne(e){var{shape:r,baseProps:t,entry:n,index:l,dataKey:i}=e;return R.createElement(yp,Aa({},t,{name:String(t.name)},n,{isActive:!1,option:r,index:l,dataKey:i}))}function fne(e){var r,{data:t,props:n}=e,l=(r=xs(n))!==null&&r!==void 0?r:{},{id:i}=l,o=vp(l,ene),{shape:u,dataKey:c,activeBar:s}=n,{onMouseEnter:d,onClick:f,onMouseLeave:h}=n,m=vp(n,tne),p=WA(d,c,i),x=KA(h),g=XA(f,c,i);return t?R.createElement(R.Fragment,null,t.map((y,v)=>R.createElement(Zre,Aa({index:v,key:"rectangle-".concat(y?.x,"-").concat(y?.y,"-").concat(y?.value,"-").concat(v),className:"recharts-bar-rectangle"},Fp(m,y,v),{onMouseEnter:p(y,v),onMouseLeave:x(y,v),onClick:g(y,v)}),s?R.createElement(une,{shape:u,activeBar:s,baseProps:o,entry:y,index:v,dataKey:c}):R.createElement(dne,{shape:u,baseProps:o,entry:y,index:v,dataKey:c})))):null}function hne(e){var{props:r,previousRectanglesRef:t}=e,{data:n,layout:l,isAnimationActive:i,animationBegin:o,animationDuration:u,animationEasing:c,onAnimationEnd:s,onAnimationStart:d}=r,f=t.current,h=o0(r,"recharts-bar-"),[m,p]=R.useState(!1),x=!m,g=R.useCallback(()=>{typeof s=="function"&&s(),p(!1)},[s]),y=R.useCallback(()=>{typeof d=="function"&&d(),p(!0)},[d]);return R.createElement(cne,{showLabels:x,rects:n},R.createElement(a0,{animationId:h,begin:o,duration:u,isActive:i,easing:c,onAnimationEnd:g,onAnimationStart:y,key:h},v=>{var _=v===1?n:n?.map((C,M)=>{var T=f&&f[M];if(T)return Qn(Qn({},C),{},{x:$r(T.x,C.x,v),y:$r(T.y,C.y,v),width:$r(T.width,C.width,v),height:$r(T.height,C.height,v)});if(l==="horizontal"){var U=$r(0,C.height,v),F=$r(C.stackedBarStart,C.y,v);return Qn(Qn({},C),{},{y:F,height:U})}var H=$r(0,C.width,v),W=$r(C.stackedBarStart,C.x,v);return Qn(Qn({},C),{},{width:H,x:W})});return v>0&&(t.current=_??null),_==null?null:R.createElement(Wi,null,R.createElement(fne,{props:r,data:_}))}),R.createElement(zA,{label:r.label}),r.children)}function mne(e){var r=R.useRef(null);return R.createElement(hne,{previousRectanglesRef:r,props:e})}var bM=0,pne=(e,r)=>{var t=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:t,errorVal:Yr(e,r)}};class gne extends R.PureComponent{render(){var{hide:r,data:t,dataKey:n,className:l,xAxisId:i,yAxisId:o,needClip:u,background:c,id:s}=this.props;if(r||t==null)return null;var d=fr("recharts-bar",l),f=s;return R.createElement(Wi,{className:d,id:s},u&&R.createElement("defs",null,R.createElement(lM,{clipPathId:f,xAxisId:i,yAxisId:o})),R.createElement(Wi,{className:"recharts-bar-rectangles",clipPath:u?"url(#clipPath-".concat(f,")"):void 0},R.createElement(lne,{data:t,dataKey:n,background:c,allOtherBarProps:this.props}),R.createElement(mne,this.props)))}}var xne={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:bM,xAxisId:0,yAxisId:0,zIndex:gn.bar};function bne(e){var{xAxisId:r,yAxisId:t,hide:n,legendType:l,minPointSize:i,activeBar:o,animationBegin:u,animationDuration:c,animationEasing:s,isAnimationActive:d}=e,{needClip:f}=bw(r,t),h=Kc(),m=Un(),p=gJ(e.children,NA),x=kt(v=>qre(v,e.id,m,p));if(h!=="vertical"&&h!=="horizontal")return null;var g,y=x?.[0];return y==null||y.height==null||y.width==null?g=0:g=h==="vertical"?y.height/2:y.width/2,R.createElement(oM,{xAxisId:r,yAxisId:t,data:x,dataPointFormatter:pne,errorBarOffset:g},R.createElement(gne,Aa({},e,{layout:h,needClip:f,data:x,xAxisId:r,yAxisId:t,hide:n,legendType:l,minPointSize:i,activeBar:o,animationBegin:u,animationDuration:c,animationEasing:s,isAnimationActive:d})))}function yne(e){var{layout:r,barSettings:{dataKey:t,minPointSize:n},pos:l,bandSize:i,xAxis:o,yAxis:u,xAxisTicks:c,yAxisTicks:s,stackedData:d,displayedData:f,offset:h,cells:m,parentViewBox:p,dataStartIndex:x}=e,g=r==="horizontal"?u:o,y=d?g.scale.domain():null,v=vV({numericAxis:g}),_=g.scale(v);return f.map((C,M)=>{var T,U,F,H,W,K;if(d){var $=d[M+x];if($==null)return null;T=mV($,y)}else T=Yr(C,t),Array.isArray(T)||(T=[v,T]);var P=Cre(n,bM)(T[1],M);if(r==="horizontal"){var L,[E,j]=[u.scale(T[0]),u.scale(T[1])];U=S5({axis:o,ticks:c,bandSize:i,offset:l.offset,entry:C,index:M}),F=(L=j??E)!==null&&L!==void 0?L:void 0,H=l.size;var k=E-j;if(W=bs(k)?0:k,K={x:U,y:h.top,width:H,height:h.height},Math.abs(P)>0&&Math.abs(W)0&&Math.abs(H)R.createElement(R.Fragment,null,R.createElement(YA,{legendPayload:ane(r)}),R.createElement(one,{dataKey:r.dataKey,stroke:r.stroke,strokeWidth:r.strokeWidth,fill:r.fill,name:r.name,hide:r.hide,unit:r.unit,tooltipType:r.tooltipType,id:l}),R.createElement(JA,{type:"bar",id:l,data:void 0,xAxisId:r.xAxisId,yAxisId:r.yAxisId,zAxisId:0,dataKey:r.dataKey,stackId:t,hide:r.hide,barSize:r.barSize,minPointSize:r.minPointSize,maxBarSize:r.maxBarSize,isPanorama:n}),R.createElement(Yi,{zIndex:r.zIndex},R.createElement(bne,Aa({},r,{id:l})))))}var Gv=R.memo(vne,N0);Gv.displayName="Bar";var wne=["domain","range"],_ne=["domain","range"];function Ik(e,r){if(e==null)return{};var t,n,l=jne(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n{t.current===null?r(iee(e)):t.current!==e&&r(see({prev:t.current,next:e})),t.current=e},[e,r]),R.useLayoutEffect(()=>()=>{t.current&&(r(aee(t.current)),t.current=null)},[r]),null}var Ene=e=>{var{xAxisId:r,className:t}=e,n=kt(l2),l=Un(),i="xAxis",o=kt(y=>G9(y,i,r,l)),u=kt(y=>H9(y,r)),c=kt(y=>$G(y,r)),s=kt(y=>m9(y,r));if(u==null||c==null||s==null)return null;var{dangerouslySetInnerHTML:d,ticks:f,scale:h}=e,m=Dk(e,Sne),{id:p,scale:x}=s,g=Dk(s,kne);return R.createElement(xw,Yv({},m,g,{x:c.x,y:c.y,width:u.width,height:u.height,className:fr("recharts-".concat(i," ").concat(i),t),viewBox:n,ticks:o,axisType:i}))},Ane={allowDataOverflow:fn.allowDataOverflow,allowDecimals:fn.allowDecimals,allowDuplicatedCategory:fn.allowDuplicatedCategory,angle:fn.angle,axisLine:ya.axisLine,height:fn.height,hide:!1,includeHidden:fn.includeHidden,interval:fn.interval,minTickGap:fn.minTickGap,mirror:fn.mirror,orientation:fn.orientation,padding:fn.padding,reversed:fn.reversed,scale:fn.scale,tick:fn.tick,tickCount:fn.tickCount,tickLine:ya.tickLine,tickSize:ya.tickSize,type:fn.type,xAxisId:0},Mne=e=>{var r=An(e,Ane);return R.createElement(R.Fragment,null,R.createElement(Cne,{allowDataOverflow:r.allowDataOverflow,allowDecimals:r.allowDecimals,allowDuplicatedCategory:r.allowDuplicatedCategory,angle:r.angle,dataKey:r.dataKey,domain:r.domain,height:r.height,hide:r.hide,id:r.xAxisId,includeHidden:r.includeHidden,interval:r.interval,minTickGap:r.minTickGap,mirror:r.mirror,name:r.name,orientation:r.orientation,padding:r.padding,reversed:r.reversed,scale:r.scale,tick:r.tick,tickCount:r.tickCount,tickFormatter:r.tickFormatter,ticks:r.ticks,type:r.type,unit:r.unit}),R.createElement(Ene,r))},mm=R.memo(Mne,yM);mm.displayName="XAxis";var One=["dangerouslySetInnerHTML","ticks","scale"],Pne=["id","scale"];function Zv(){return Zv=Object.assign?Object.assign.bind():function(e){for(var r=1;r{t.current===null?r(oee(e)):t.current!==e&&r(lee({prev:t.current,next:e})),t.current=e},[e,r]),R.useLayoutEffect(()=>()=>{t.current&&(r(cee(t.current)),t.current=null)},[r]),null}var Rne=e=>{var{yAxisId:r,className:t,width:n,label:l}=e,i=R.useRef(null),o=R.useRef(null),u=kt(l2),c=Un(),s=Dr(),d="yAxis",f=kt(T=>W9(T,r)),h=kt(T=>VG(T,r)),m=kt(T=>G9(T,d,r,c)),p=kt(T=>p9(T,r));if(R.useLayoutEffect(()=>{if(!(n!=="auto"||!f||hw(l)||R.isValidElement(l)||p==null)){var T=i.current;if(T){var U=T.getCalculatedWidth();Math.round(f.width)!==Math.round(U)&&s(uee({id:r,width:U}))}}},[m,f,s,l,r,n,p]),f==null||h==null||p==null)return null;var{dangerouslySetInnerHTML:x,ticks:g,scale:y}=e,v=Lk(e,One),{id:_,scale:C}=p,M=Lk(p,Pne);return R.createElement(xw,Zv({},v,M,{ref:i,labelRef:o,x:h.x,y:h.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:fr("recharts-".concat(d," ").concat(d),t),viewBox:u,ticks:m,axisType:d}))},Dne={allowDataOverflow:hn.allowDataOverflow,allowDecimals:hn.allowDecimals,allowDuplicatedCategory:hn.allowDuplicatedCategory,angle:hn.angle,axisLine:ya.axisLine,hide:!1,includeHidden:hn.includeHidden,interval:hn.interval,minTickGap:hn.minTickGap,mirror:hn.mirror,orientation:hn.orientation,padding:hn.padding,reversed:hn.reversed,scale:hn.scale,tick:hn.tick,tickCount:hn.tickCount,tickLine:ya.tickLine,tickSize:ya.tickSize,type:hn.type,width:hn.width,yAxisId:0},Lne=e=>{var r=An(e,Dne);return R.createElement(R.Fragment,null,R.createElement(Ine,{interval:r.interval,id:r.yAxisId,scale:r.scale,type:r.type,domain:r.domain,allowDataOverflow:r.allowDataOverflow,dataKey:r.dataKey,allowDuplicatedCategory:r.allowDuplicatedCategory,allowDecimals:r.allowDecimals,tickCount:r.tickCount,padding:r.padding,includeHidden:r.includeHidden,reversed:r.reversed,ticks:r.ticks,width:r.width,orientation:r.orientation,mirror:r.mirror,hide:r.hide,unit:r.unit,name:r.name,angle:r.angle,minTickGap:r.minTickGap,tick:r.tick,tickFormatter:r.tickFormatter}),R.createElement(Rne,r))},pm=R.memo(Lne,yM);pm.displayName="YAxis";var Fne=(e,r)=>r,vw=Te([Fne,ar,f9,sn,dA,La,iZ,xn],dZ),ww=e=>{var r=e.currentTarget.getBoundingClientRect(),t=r.width/e.currentTarget.offsetWidth,n=r.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-r.left)/t),chartY:Math.round((e.clientY-r.top)/n)}},vM=Ki("mouseClick"),wM=Yd();wM.startListening({actionCreator:vM,effect:(e,r)=>{var t=e.payload,n=vw(r.getState(),ww(t));n?.activeIndex!=null&&r.dispatch(nY({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Qv=Ki("mouseMove"),_M=Yd(),Zh=null;_M.startListening({actionCreator:Qv,effect:(e,r)=>{var t=e.payload;Zh!==null&&cancelAnimationFrame(Zh);var n=ww(t);Zh=requestAnimationFrame(()=>{var l=r.getState(),i=rw(l,l.tooltip.settings.shared);if(i==="axis"){var o=vw(l,n);o?.activeIndex!=null?r.dispatch(nA({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate})):r.dispatch(rA())}Zh=null})}});function Bne(e,r){return r instanceof HTMLElement?"HTMLElement <".concat(r.tagName,' class="').concat(r.className,'">'):r===window?"global.window":e==="children"&&typeof r=="object"&&r!==null?"<>":r}var Fk={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},jM=pi({name:"rootProps",initialState:Fk,reducers:{updateOptions:(e,r)=>{var t;e.accessibilityLayer=r.payload.accessibilityLayer,e.barCategoryGap=r.payload.barCategoryGap,e.barGap=(t=r.payload.barGap)!==null&&t!==void 0?t:Fk.barGap,e.barSize=r.payload.barSize,e.maxBarSize=r.payload.maxBarSize,e.stackOffset=r.payload.stackOffset,e.syncId=r.payload.syncId,e.syncMethod=r.payload.syncMethod,e.className=r.payload.className,e.baseValue=r.payload.baseValue,e.reverseStackOrder=r.payload.reverseStackOrder}}}),zne=jM.reducer,{updateOptions:$ne}=jM.actions,SM=pi({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,r)=>r.payload}}),{updatePolarOptions:Zse}=SM.actions,Une=SM.reducer,kM=Ki("keyDown"),NM=Ki("focus"),_w=Yd();_w.startListening({actionCreator:kM,effect:(e,r)=>{var t=r.getState(),n=t.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:l}=t.tooltip,i=e.payload;if(!(i!=="ArrowRight"&&i!=="ArrowLeft"&&i!=="Enter")){var o=nw(l,tu(t),af(t),uf(t)),u=o==null?-1:Number(o);if(!(!Number.isFinite(u)||u<0)){var c=La(t);if(i==="Enter"){var s=hp(t,"axis","hover",String(l.index));r.dispatch($v({active:!l.active,activeIndex:l.index,activeCoordinate:s}));return}var d=KG(t),f=d==="left-to-right"?1:-1,h=i==="ArrowRight"?1:-1,m=u+h*f;if(!(c==null||m>=c.length||m<0)){var p=hp(t,"axis","hover",String(m));r.dispatch($v({active:!0,activeIndex:m.toString(),activeCoordinate:p}))}}}}}});_w.startListening({actionCreator:NM,effect:(e,r)=>{var t=r.getState(),n=t.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:l}=t.tooltip;if(!l.active&&l.index==null){var i="0",o=hp(t,"axis","hover",String(i));r.dispatch($v({active:!0,activeIndex:i,activeCoordinate:o}))}}}});var Bi=Ki("externalEvent"),CM=Yd(),hy=new Map;CM.startListening({actionCreator:Bi,effect:(e,r)=>{var{handler:t,reactEvent:n}=e.payload;if(t!=null){n.persist();var l=n.type,i=hy.get(l);i!==void 0&&cancelAnimationFrame(i);var o=requestAnimationFrame(()=>{try{var u=r.getState(),c={activeCoordinate:UY(u),activeDataKey:pA(u),activeIndex:El(u),activeLabel:mA(u),activeTooltipIndex:El(u),isTooltipActive:VY(u)};t(c,n)}finally{hy.delete(l)}});hy.set(l,o)}}});var Vne=Te([Jc],e=>e.tooltipItemPayloads),qne=Te([Vne,cf,(e,r)=>r,(e,r,t)=>t],(e,r,t,n)=>{var l=e.find(u=>u.settings.graphicalItemId===n);if(l!=null){var{positions:i}=l;if(i!=null){var o=r(i,t);return o}}}),EM=Ki("touchMove"),AM=Yd();AM.startListening({actionCreator:EM,effect:(e,r)=>{var t=e.payload;if(!(t.touches==null||t.touches.length===0)){var n=r.getState(),l=rw(n,n.tooltip.settings.shared);if(l==="axis"){var i=t.touches[0];if(i==null)return;var o=vw(n,ww({clientX:i.clientX,clientY:i.clientY,currentTarget:t.currentTarget}));o?.activeIndex!=null&&r.dispatch(nA({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate}))}else if(l==="item"){var u,c=t.touches[0];if(document.elementFromPoint==null||c==null)return;var s=document.elementFromPoint(c.clientX,c.clientY);if(!s||!s.getAttribute)return;var d=s.getAttribute(CV),f=(u=s.getAttribute(EV))!==null&&u!==void 0?u:void 0,h=eu(n).find(x=>x.id===f);if(d==null||h==null||f==null)return;var{dataKey:m}=h,p=qne(n,d,f);r.dispatch(tA({activeDataKey:m,activeIndex:d,activeCoordinate:p,activeGraphicalItemId:f}))}}}});var Hne=c7({brush:Aee,cartesianAxis:dee,chartData:UZ,errorBars:Nte,graphicalItems:VJ,layout:lV,legend:wq,options:LZ,polarAxis:fJ,polarOptions:Une,referenceElements:Dee,rootProps:zne,tooltip:iY,zIndex:kZ}),Wne=function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return TU({reducer:Hne,preloadedState:r,middleware:n=>{var l;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((l="es6")!==null&&l!==void 0?l:"")}).concat([wM.middleware,_M.middleware,_w.middleware,CM.middleware,AM.middleware])},enhancers:n=>{var l=n;return typeof n=="function"&&(l=n()),l.concat(S7({type:"raf"}))},devTools:{serialize:{replacer:Bne},name:"recharts-".concat(t)}})};function Kne(e){var{preloadedState:r,children:t,reduxStoreName:n}=e,l=Un(),i=R.useRef(null);if(l)return t;i.current==null&&(i.current=Wne(r,n));var o=t2;return R.createElement(tre,{context:o,store:i.current},t)}function Xne(e){var{layout:r,margin:t}=e,n=Dr(),l=Un();return R.useEffect(()=>{l||(n(sV(r)),n(iV(t)))},[n,l,r,t]),null}var Gne=R.memo(Xne,N0);function Yne(e){var r=Dr();return R.useEffect(()=>{r($ne(e))},[r,e]),null}function Bk(e){var{zIndex:r,isPanorama:t}=e,n=R.useRef(null),l=Dr();return R.useLayoutEffect(()=>(n.current&&l(jZ({zIndex:r,element:n.current,isPanorama:t})),()=>{l(SZ({zIndex:r,isPanorama:t}))}),[l,r,t]),R.createElement("g",{tabIndex:-1,ref:n})}function zk(e){var{children:r,isPanorama:t}=e,n=kt(hZ);if(!n||n.length===0)return r;var l=n.filter(o=>o<0),i=n.filter(o=>o>0);return R.createElement(R.Fragment,null,l.map(o=>R.createElement(Bk,{key:o,zIndex:o,isPanorama:t})),r,i.map(o=>R.createElement(Bk,{key:o,zIndex:o,isPanorama:t})))}var Zne=["children"];function Qne(e,r){if(e==null)return{};var t,n,l=Jne(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n{var t=u2(),n=d2(),l=J7();if(!$s(t)||!$s(n))return null;var{children:i,otherAttributes:o,title:u,desc:c}=e,s,d;return o!=null&&(typeof o.tabIndex=="number"?s=o.tabIndex:s=l?0:void 0,typeof o.role=="string"?d=o.role:d=l?"application":void 0),R.createElement(q1,wp({},o,{title:u,desc:c,role:d,tabIndex:s,width:t,height:n,style:eie,ref:r}),i)}),rie=e=>{var{children:r}=e,t=kt(Jp);if(!t)return null;var{width:n,height:l,y:i,x:o}=t;return R.createElement(q1,{width:n,height:l,x:o,y:i},r)},$k=R.forwardRef((e,r)=>{var{children:t}=e,n=Qne(e,Zne),l=Un();return l?R.createElement(rie,null,R.createElement(zk,{isPanorama:!0},t)):R.createElement(tie,wp({ref:r},n),R.createElement(zk,{isPanorama:!1},t))});function nie(){var e=Dr(),[r,t]=R.useState(null),n=kt(NV);return R.useEffect(()=>{if(r!=null){var l=r.getBoundingClientRect(),i=l.width/r.offsetWidth;Rr(i)&&i!==n&&e(oV(i))}},[r,e,n]),t}function Uk(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,n)}return t}function iie(e){for(var r=1;r(ZZ(),null);function _p(e){if(typeof e=="number")return e;if(typeof e=="string"){var r=parseFloat(e);if(!Number.isNaN(r))return r}return 0}var cie=R.forwardRef((e,r)=>{var t,n,l=R.useRef(null),[i,o]=R.useState({containerWidth:_p((t=e.style)===null||t===void 0?void 0:t.width),containerHeight:_p((n=e.style)===null||n===void 0?void 0:n.height)}),u=R.useCallback((s,d)=>{o(f=>{var h=Math.round(s),m=Math.round(d);return f.containerWidth===h&&f.containerHeight===m?f:{containerWidth:h,containerHeight:m}})},[]),c=R.useCallback(s=>{if(typeof r=="function"&&r(s),s!=null&&typeof ResizeObserver<"u"){var{width:d,height:f}=s.getBoundingClientRect();u(d,f);var h=p=>{var{width:x,height:g}=p[0].contentRect;u(x,g)},m=new ResizeObserver(h);m.observe(s),l.current=m}},[r,u]);return R.useEffect(()=>()=>{var s=l.current;s?.disconnect()},[u]),R.createElement(R.Fragment,null,R.createElement(t0,{width:i.containerWidth,height:i.containerHeight}),R.createElement("div",Ml({ref:c},e)))}),uie=R.forwardRef((e,r)=>{var{width:t,height:n}=e,[l,i]=R.useState({containerWidth:_p(t),containerHeight:_p(n)}),o=R.useCallback((c,s)=>{i(d=>{var f=Math.round(c),h=Math.round(s);return d.containerWidth===f&&d.containerHeight===h?d:{containerWidth:f,containerHeight:h}})},[]),u=R.useCallback(c=>{if(typeof r=="function"&&r(c),c!=null){var{width:s,height:d}=c.getBoundingClientRect();o(s,d)}},[r,o]);return R.createElement(R.Fragment,null,R.createElement(t0,{width:l.containerWidth,height:l.containerHeight}),R.createElement("div",Ml({ref:u},e)))}),die=R.forwardRef((e,r)=>{var{width:t,height:n}=e;return R.createElement(R.Fragment,null,R.createElement(t0,{width:t,height:n}),R.createElement("div",Ml({ref:r},e)))}),fie=R.forwardRef((e,r)=>{var{width:t,height:n}=e;return ja(t)||ja(n)?R.createElement(uie,Ml({},e,{ref:r})):R.createElement(die,Ml({},e,{ref:r}))});function hie(e){return e===!0?cie:fie}var mie=R.forwardRef((e,r)=>{var{children:t,className:n,height:l,onClick:i,onContextMenu:o,onDoubleClick:u,onMouseDown:c,onMouseEnter:s,onMouseLeave:d,onMouseMove:f,onMouseUp:h,onTouchEnd:m,onTouchMove:p,onTouchStart:x,style:g,width:y,responsive:v,dispatchTouchEvents:_=!0}=e,C=R.useRef(null),M=Dr(),[T,U]=R.useState(null),[F,H]=R.useState(null),W=nie(),K=c2(),$=K?.width>0?K.width:y,P=K?.height>0?K.height:l,L=R.useCallback(I=>{W(I),typeof r=="function"&&r(I),U(I),H(I),I!=null&&(C.current=I)},[W,r,U,H]),E=R.useCallback(I=>{M(vM(I)),M(Bi({handler:i,reactEvent:I}))},[M,i]),j=R.useCallback(I=>{M(Qv(I)),M(Bi({handler:s,reactEvent:I}))},[M,s]),k=R.useCallback(I=>{M(rA()),M(Bi({handler:d,reactEvent:I}))},[M,d]),S=R.useCallback(I=>{M(Qv(I)),M(Bi({handler:f,reactEvent:I}))},[M,f]),N=R.useCallback(()=>{M(NM())},[M]),O=R.useCallback(I=>{M(kM(I.key))},[M]),D=R.useCallback(I=>{M(Bi({handler:o,reactEvent:I}))},[M,o]),B=R.useCallback(I=>{M(Bi({handler:u,reactEvent:I}))},[M,u]),Y=R.useCallback(I=>{M(Bi({handler:c,reactEvent:I}))},[M,c]),Z=R.useCallback(I=>{M(Bi({handler:h,reactEvent:I}))},[M,h]),ne=R.useCallback(I=>{M(Bi({handler:x,reactEvent:I}))},[M,x]),q=R.useCallback(I=>{_&&M(EM(I)),M(Bi({handler:p,reactEvent:I}))},[M,_,p]),ee=R.useCallback(I=>{M(Bi({handler:m,reactEvent:I}))},[M,m]),z=hie(v);return R.createElement(_A.Provider,{value:T},R.createElement(NC.Provider,{value:F},R.createElement(z,{width:$??g?.width,height:P??g?.height,className:fr("recharts-wrapper",n),style:iie({position:"relative",cursor:"default",width:$,height:P},g),onClick:E,onContextMenu:D,onDoubleClick:B,onFocus:N,onKeyDown:O,onMouseDown:Y,onMouseEnter:j,onMouseLeave:k,onMouseMove:S,onMouseUp:Z,onTouchEnd:ee,onTouchMove:q,onTouchStart:ne,ref:L},R.createElement(lie,null),t)))}),pie=["width","height","responsive","children","className","style","compact","title","desc"];function gie(e,r){if(e==null)return{};var t,n,l=xie(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n{var{width:t,height:n,responsive:l,children:i,className:o,style:u,compact:c,title:s,desc:d}=e,f=gie(e,pie),h=xs(f);return c?R.createElement(R.Fragment,null,R.createElement(t0,{width:t,height:n}),R.createElement($k,{otherAttributes:h,title:s,desc:d},i)):R.createElement(mie,{className:o,style:u,width:t,height:n,responsive:l??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},R.createElement($k,{otherAttributes:h,title:s,desc:d,ref:r},R.createElement(Fee,null,i)))});function Jv(){return Jv=Object.assign?Object.assign.bind():function(e){for(var r=1;rR.createElement(MM,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:wie,tooltipPayloadSearcher:jA,categoricalChartProps:e,ref:r})),jie=["axis","item"],Vk=R.forwardRef((e,r)=>R.createElement(MM,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:jie,tooltipPayloadSearcher:jA,categoricalChartProps:e,ref:r}));const Sie=2,qk=1;function kie({stats:e,loading:r}){if(r)return a.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[1,2].map(f=>a.jsx(ti,{className:"animate-pulse",children:a.jsx("div",{className:"h-[220px] bg-gray-200 rounded"})},f))});if(!e)return a.jsx("p",{className:"text-sm text-ink-500 py-4 text-center",children:"Aucune statistique disponible pour les graphiques."});const t=(e.timeline||[]).map(f=>({date:new Date(f.date).toLocaleDateString("fr-FR",{day:"2-digit",month:"2-digit"}),count:f.count})),n=Object.entries(e.by_status||{}).filter(([,f])=>f>0).map(([f,h])=>({status:U1(f).label,count:h})),l=(e.by_plan||[]).slice(0,5).map(f=>({name:f.pricing_plan_code||f.pricing_plan_name||"-",count:f.count})),i=t.reduce((f,h)=>f+h.count,0),o=n.reduce((f,h)=>f+h.count,0),u=t.length>=Sie&&i>=qk,c=n.length>=1&&o>=qk,s=l.length>=1&&l.some(f=>f.count>0);return!u&&!c&&!s?a.jsx("div",{className:"rounded-lg border border-dashed border-gray-200 bg-gray-50/80 px-4 py-8 text-center",children:a.jsx("p",{className:"text-sm text-ink-600",children:"Pas assez de données pour afficher les graphiques. Les statistiques apparaîtront lorsque plus d'inscriptions seront enregistrées."})}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[u?a.jsxs(ti,{children:[a.jsx("h3",{className:"text-base font-semibold text-ink-900 mb-3",children:"Évolution dans le temps"}),a.jsx(Ib,{width:"100%",height:220,children:a.jsxs(_ie,{data:t,children:[a.jsx(hm,{strokeDasharray:"3 3"}),a.jsx(mm,{dataKey:"date",tick:{fontSize:11}}),a.jsx(pm,{tick:{fontSize:11}}),a.jsx(Qb,{}),a.jsx(um,{}),a.jsx(pM,{type:"monotone",dataKey:"count",stroke:"#0B4A6F",strokeWidth:2,name:"Inscriptions"})]})})]}):null,c?a.jsxs(ti,{children:[a.jsx("h3",{className:"text-base font-semibold text-ink-900 mb-3",children:"Répartition par statut"}),a.jsx(Ib,{width:"100%",height:220,children:a.jsxs(Vk,{data:n,children:[a.jsx(hm,{strokeDasharray:"3 3"}),a.jsx(mm,{dataKey:"status",tick:{fontSize:10},interval:0,angle:-25,textAnchor:"end",height:60}),a.jsx(pm,{tick:{fontSize:11}}),a.jsx(Qb,{}),a.jsx(um,{}),a.jsx(Gv,{dataKey:"count",fill:"#0B4A6F",name:"Nombre"})]})})]}):null]}),s?a.jsxs(ti,{children:[a.jsx("h3",{className:"text-base font-semibold text-ink-900 mb-3",children:"Répartition par formule"}),a.jsx(Ib,{width:"100%",height:220,children:a.jsxs(Vk,{data:l,children:[a.jsx(hm,{strokeDasharray:"3 3"}),a.jsx(mm,{dataKey:"name",tick:{fontSize:11}}),a.jsx(pm,{tick:{fontSize:11}}),a.jsx(Qb,{}),a.jsx(um,{}),a.jsx(Gv,{dataKey:"count",fill:"#1F6F8B",name:"Nombre"})]})})]}):null]})}const Hk=["total","draft","submitted","pending_payment","paid"];function Nie({counts:e,loading:r,activeSingleStatus:t,onKpiClick:n}){return r?a.jsx("div",{className:"flex min-w-0 flex-wrap gap-1.5",children:Hk.map(l=>a.jsx("div",{className:"h-12 min-w-0 flex-[1_1_5rem] max-w-[9rem] animate-pulse rounded-lg bg-gray-200 sm:h-14 sm:flex-[1_1_5.5rem]","aria-hidden":!0},l))}):a.jsx("div",{className:"flex min-w-0 flex-wrap gap-1.5",role:"group","aria-label":"Indicateurs par statut",children:Hk.map(l=>{const i=l==="total",o=i?Object.values(e).reduce((s,d)=>s+d,0):e[l]??0,u=i?"Total":U1(l).label,c=i?t===null:t===l;return a.jsxs("button",{type:"button",onClick:()=>n(l),className:`min-w-0 max-w-[9rem] flex-[1_1_5rem] rounded-lg border px-2 py-1.5 text-left transition-colors sm:max-w-[10rem] sm:flex-[1_1_5.5rem] sm:px-2.5 sm:py-2 ${c?"border-brand-700 bg-brand-50 ring-1 ring-brand-700/20":"border-gray-200 bg-white hover:bg-gray-50"}`,children:[a.jsx("div",{className:"line-clamp-2 text-[9px] font-medium uppercase leading-tight tracking-wide text-ink-500 sm:text-[10px]",children:u}),a.jsx("div",{className:"text-base font-semibold tabular-nums sm:text-lg",children:o})]},l)})})}function Qh(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var my={exports:{}};var Wk;function Cie(){return Wk||(Wk=1,(function(e,r){(function(t){e.exports=t()})((function(){return(function t(n,l,i){function o(s,d){if(!l[s]){if(!n[s]){var f=typeof Qh=="function"&&Qh;if(!d&&f)return f(s,!0);if(u)return u(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var m=l[s]={exports:{}};n[s][0].call(m.exports,(function(p){return o(n[s][1][p]||p)}),m,m.exports,t,n,l,i)}return l[s].exports}for(var u=typeof Qh=="function"&&Qh,c=0;c{const y=this.workbook.addWorksheet(p.sheetName),v=p.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],_=p.map||function(M){if(M==="")return null;const T=Number(M);if(!Number.isNaN(T)&&T!==1/0)return T;const U=v.reduce((H,W)=>{if(H)return H;const K=s(M,W,!0);return K.isValid()?K:null},null);if(U)return new Date(U.valueOf());const F=h[M];return F!==void 0?F:M},C=o.parse(p.parserOptions).on("data",M=>{y.addRow(M.map(_))}).on("end",()=>{C.emit("worksheet",y)});C.on("worksheet",x).on("error",g),m.pipe(C)})}createInputStream(){throw new Error("`CSV#createInputStream` is deprecated. You should use `CSV#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}write(m,p){return new Promise((x,g)=>{p=p||{};const y=this.workbook.getWorksheet(p.sheetName||p.sheetId),v=o.format(p.formatterOptions);m.on("finish",()=>{x()}),v.on("error",g),v.pipe(m);const{dateFormat:_,dateUTC:C}=p,M=p.map||(F=>{if(F){if(F.text||F.hyperlink)return F.hyperlink||F.text||"";if(F.formula||F.result)return F.result||"";if(F instanceof Date)return _?C?s.utc(F).format(_):s(F).format(_):C?s.utc(F).format():s(F).format();if(F.error)return F.error;if(typeof F=="object")return JSON.stringify(F)}return F}),T=p.includeEmptyRows===void 0||p.includeEmptyRows;let U=1;y&&y.eachRow((F,H)=>{if(T)for(;U++2&&arguments[2]!==void 0?arguments[2]:0;if(this.worksheet=c,s)if(typeof s=="string"){const f=i.decodeAddress(s);this.nativeCol=f.col+d,this.nativeColOff=0,this.nativeRow=f.row+d,this.nativeRowOff=0}else s.nativeCol!==void 0?(this.nativeCol=s.nativeCol||0,this.nativeColOff=s.nativeColOff||0,this.nativeRow=s.nativeRow||0,this.nativeRowOff=s.nativeRowOff||0):s.col!==void 0?(this.col=s.col+d,this.row=s.row+d):(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0);else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance(c){return c instanceof o||c==null?c:new o(c)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(c){this.nativeCol=Math.floor(c),this.nativeColOff=Math.floor((c-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(c){this.nativeRow=Math.floor(c),this.nativeRowOff=Math.floor((c-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(1e4*this.worksheet.getColumn(this.nativeCol+1).width):64e4}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(1e4*this.worksheet.getRow(this.nativeRow+1).height):18e4}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model(c){this.nativeCol=c.nativeCol,this.nativeColOff=c.nativeColOff,this.nativeRow=c.nativeRow,this.nativeRowOff=c.nativeRowOff}}n.exports=o},{"../utils/col-cache":19}],3:[function(t,n,l){const i=t("../utils/col-cache"),o=t("../utils/under-dash"),u=t("./enums"),{slideFormula:c}=t("../utils/shared-formula"),s=t("./note");class d{constructor(m,p,x){if(!m||!p)throw new Error("A Cell needs a Row");this._row=m,this._column=p,i.validateAddress(x),this._address=x,this._value=f.create(d.Types.Null,this),this.style=this._mergeStyle(m.style,p.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){delete this.style,delete this._value,delete this._row,delete this._column,delete this._address}get numFmt(){return this.style.numFmt}set numFmt(m){this.style.numFmt=m}get font(){return this.style.font}set font(m){this.style.font=m}get alignment(){return this.style.alignment}set alignment(m){this.style.alignment=m}get border(){return this.style.border}set border(m){this.style.border=m}get fill(){return this.style.fill}set fill(m){this.style.fill=m}get protection(){return this.style.protection}set protection(m){this.style.protection=m}_mergeStyle(m,p,x){const g=m&&m.numFmt||p&&p.numFmt;g&&(x.numFmt=g);const y=m&&m.font||p&&p.font;y&&(x.font=y);const v=m&&m.alignment||p&&p.alignment;v&&(x.alignment=v);const _=m&&m.border||p&&p.border;_&&(x.border=_);const C=m&&m.fill||p&&p.fill;C&&(x.fill=C);const M=m&&m.protection||p&&p.protection;return M&&(x.protection=M),x}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===d.Types.Merge}merge(m,p){this._value.release(),this._value=f.create(d.Types.Merge,this,m),p||(this.style=m.style)}unmerge(){this.type===d.Types.Merge&&(this._value.release(),this._value=f.create(d.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(m){return this._value.type===d.Types.Merge&&this._value.isMergedTo(m)}get master(){return this.type===d.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===d.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(m){this.type!==d.Types.Merge?(this._value.release(),this._value=f.create(f.getType(m),this,m)):this._value.master.value=m}get note(){return this._comment&&this._comment.note}set note(m){this._comment=new s(m)}get text(){return this._value.toString()}get html(){return o.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(m){this.type===d.Types.String&&(this._value=f.create(d.Types.Hyperlink,this,{text:this._value.value,hyperlink:m}))}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){const{worksheet:m}=this._row;return{sheetName:m.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(m){this.names=[m]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(m){const{definedNames:p}=this.workbook;p.removeAllNames(this.fullAddress),m.forEach(x=>{p.addEx(this.fullAddress,x)})}addName(m){this.workbook.definedNames.addEx(this.fullAddress,m)}removeName(m){this.workbook.definedNames.removeEx(this.fullAddress,m)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(m){this._dataValidations.add(this.address,m)}get model(){const{model:m}=this._value;return m.style=this.style,this._comment&&(m.comment=this._comment.model),m}set model(m){this._value.release(),this._value=f.create(m.type,this),this._value.model=m,m.comment&&m.comment.type==="note"&&(this._comment=s.fromModel(m.comment)),m.style?this.style=m.style:this.style={}}}d.Types=u.ValueType;const f={getType:h=>h==null?d.Types.Null:h instanceof String||typeof h=="string"?d.Types.String:typeof h=="number"?d.Types.Number:typeof h=="boolean"?d.Types.Boolean:h instanceof Date?d.Types.Date:h.text&&h.hyperlink?d.Types.Hyperlink:h.formula||h.sharedFormula?d.Types.Formula:h.richText?d.Types.RichText:h.sharedString?d.Types.SharedString:h.error?d.Types.Error:d.Types.JSON,types:[{t:d.Types.Null,f:class{constructor(h){this.model={address:h.address,type:d.Types.Null}}get value(){return null}set value(h){}get type(){return d.Types.Null}get effectiveType(){return d.Types.Null}get address(){return this.model.address}set address(h){this.model.address=h}toCsvString(){return""}release(){}toString(){return""}}},{t:d.Types.Number,f:class{constructor(h,m){this.model={address:h.address,type:d.Types.Number,value:m}}get value(){return this.model.value}set value(h){this.model.value=h}get type(){return d.Types.Number}get effectiveType(){return d.Types.Number}get address(){return this.model.address}set address(h){this.model.address=h}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:d.Types.String,f:class{constructor(h,m){this.model={address:h.address,type:d.Types.String,value:m}}get value(){return this.model.value}set value(h){this.model.value=h}get type(){return d.Types.String}get effectiveType(){return d.Types.String}get address(){return this.model.address}set address(h){this.model.address=h}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}},{t:d.Types.Date,f:class{constructor(h,m){this.model={address:h.address,type:d.Types.Date,value:m}}get value(){return this.model.value}set value(h){this.model.value=h}get type(){return d.Types.Date}get effectiveType(){return d.Types.Date}get address(){return this.model.address}set address(h){this.model.address=h}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:d.Types.Hyperlink,f:class{constructor(h,m){this.model={address:h.address,type:d.Types.Hyperlink,text:m?m.text:void 0,hyperlink:m?m.hyperlink:void 0},m&&m.tooltip&&(this.model.tooltip=m.tooltip)}get value(){const h={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(h.tooltip=this.model.tooltip),h}set value(h){this.model={text:h.text,hyperlink:h.hyperlink},h.tooltip&&(this.model.tooltip=h.tooltip)}get text(){return this.model.text}set text(h){this.model.text=h}get hyperlink(){return this.model.hyperlink}set hyperlink(h){this.model.hyperlink=h}get type(){return d.Types.Hyperlink}get effectiveType(){return d.Types.Hyperlink}get address(){return this.model.address}set address(h){this.model.address=h}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:d.Types.Formula,f:class{constructor(h,m){this.cell=h,this.model={address:h.address,type:d.Types.Formula,shareType:m?m.shareType:void 0,ref:m?m.ref:void 0,formula:m?m.formula:void 0,sharedFormula:m?m.sharedFormula:void 0,result:m?m.result:void 0}}_copyModel(h){const m={},p=x=>{const g=h[x];g&&(m[x]=g)};return p("formula"),p("result"),p("ref"),p("shareType"),p("sharedFormula"),m}get value(){return this._copyModel(this.model)}set value(h){this.model=this._copyModel(h)}validate(h){switch(f.getType(h)){case d.Types.Null:case d.Types.String:case d.Types.Number:case d.Types.Date:break;case d.Types.Hyperlink:case d.Types.Formula:default:throw new Error("Cannot process that type of result value")}}get dependencies(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula(h){this.model.formula=h}get formulaType(){return this.model.formula?u.FormulaType.Master:this.model.sharedFormula?u.FormulaType.Shared:u.FormulaType.None}get result(){return this.model.result}set result(h){this.model.result=h}get type(){return d.Types.Formula}get effectiveType(){const h=this.model.result;return h==null?u.ValueType.Null:h instanceof String||typeof h=="string"?u.ValueType.String:typeof h=="number"?u.ValueType.Number:h instanceof Date?u.ValueType.Date:h.text&&h.hyperlink?u.ValueType.Hyperlink:h.formula?u.ValueType.Formula:u.ValueType.Null}get address(){return this.model.address}set address(h){this.model.address=h}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){const{worksheet:h}=this.cell,m=h.findCell(this.model.sharedFormula);this._translatedFormula=m&&c(m.formula,m.address,this.model.address)}return this._translatedFormula}toCsvString(){return""+(this.model.result||"")}release(){}toString(){return this.model.result?this.model.result.toString():""}}},{t:d.Types.Merge,f:class{constructor(h,m){this.model={address:h.address,type:d.Types.Merge,master:m?m.address:void 0},this._master=m,m&&m.addMergeRef()}get value(){return this._master.value}set value(h){h instanceof d?(this._master&&this._master.releaseMergeRef(),h.addMergeRef(),this._master=h):this._master.value=h}isMergedTo(h){return h===this._master}get master(){return this._master}get type(){return d.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(h){this.model.address=h}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:d.Types.JSON,f:class{constructor(h,m){this.model={address:h.address,type:d.Types.String,value:JSON.stringify(m),rawValue:m}}get value(){return this.model.rawValue}set value(h){this.model.rawValue=h,this.model.value=JSON.stringify(h)}get type(){return d.Types.String}get effectiveType(){return d.Types.String}get address(){return this.model.address}set address(h){this.model.address=h}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:d.Types.SharedString,f:class{constructor(h,m){this.model={address:h.address,type:d.Types.SharedString,value:m}}get value(){return this.model.value}set value(h){this.model.value=h}get type(){return d.Types.SharedString}get effectiveType(){return d.Types.SharedString}get address(){return this.model.address}set address(h){this.model.address=h}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:d.Types.RichText,f:class{constructor(h,m){this.model={address:h.address,type:d.Types.String,value:m}}get value(){return this.model.value}set value(h){this.model.value=h}toString(){return this.model.value.richText.map(h=>h.text).join("")}get type(){return d.Types.RichText}get effectiveType(){return d.Types.RichText}get address(){return this.model.address}set address(h){this.model.address=h}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}},{t:d.Types.Boolean,f:class{constructor(h,m){this.model={address:h.address,type:d.Types.Boolean,value:m}}get value(){return this.model.value}set value(h){this.model.value=h}get type(){return d.Types.Boolean}get effectiveType(){return d.Types.Boolean}get address(){return this.model.address}set address(h){this.model.address=h}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}},{t:d.Types.Error,f:class{constructor(h,m){this.model={address:h.address,type:d.Types.Error,value:m}}get value(){return this.model.value}set value(h){this.model.value=h}get type(){return d.Types.Error}get effectiveType(){return d.Types.Error}get address(){return this.model.address}set address(h){this.model.address=h}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce((h,m)=>(h[m.t]=m.f,h),[]),create(h,m,p){const x=this.types[h];if(!x)throw new Error("Could not create Value of type "+h);return new x(m,p)}};n.exports=d},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(t,n,l){const i=t("../utils/under-dash"),o=t("./enums"),u=t("../utils/col-cache");class c{constructor(d,f,h){this._worksheet=d,this._number=f,h!==!1&&(this.defn=h)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return u.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn(d){d?(this.key=d.key,this.width=d.width!==void 0?d.width:9,this.outlineLevel=d.outlineLevel,d.style?this.style=d.style:this.style={},this.header=d.header,this._hidden=!!d.hidden):(delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0)}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header(d){d!==void 0?(this._header=d,this.headers.forEach((f,h)=>{this._worksheet.getCell(h+1,this.number).value=f})):this._header=void 0}get key(){return this._key}set key(d){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=d,d&&this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden(d){this._hidden=d}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(d){this._outlineLevel=d}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(d){return this.width===d.width&&this.hidden===d.hidden&&this.outlineLevel===d.outlineLevel&&i.isEqual(this.style,d.style)}get isDefault(){if(this.isCustomWidth||this.hidden||this.outlineLevel)return!1;const d=this.style;return!d||!(d.font||d.numFmt||d.alignment||d.border||d.fill||d.protection)}get headerCount(){return this.headers.length}eachCell(d,f){const h=this.number;f||(f=d,d=null),this._worksheet.eachRow(d,(m,p)=>{f(m.getCell(h),p)})}get values(){const d=[];return this.eachCell((f,h)=>{f&&f.type!==o.ValueType.Null&&(d[h]=f.value)}),d}set values(d){if(!d)return;const f=this.number;let h=0;d.hasOwnProperty("0")&&(h=1),d.forEach((m,p)=>{this._worksheet.getCell(p+h,f).value=m})}_applyStyle(d,f){return this.style[d]=f,this.eachCell(h=>{h[d]=f}),f}get numFmt(){return this.style.numFmt}set numFmt(d){this._applyStyle("numFmt",d)}get font(){return this.style.font}set font(d){this._applyStyle("font",d)}get alignment(){return this.style.alignment}set alignment(d){this._applyStyle("alignment",d)}get protection(){return this.style.protection}set protection(d){this._applyStyle("protection",d)}get border(){return this.style.border}set border(d){this._applyStyle("border",d)}get fill(){return this.style.fill}set fill(d){this._applyStyle("fill",d)}static toModel(d){const f=[];let h=null;return d&&d.forEach((m,p)=>{m.isDefault?h&&(h=null):h&&m.equivalentTo(h)?h.max=p+1:(h={min:p+1,max:p+1,width:m.width!==void 0?m.width:9,style:m.style,isCustomWidth:m.isCustomWidth,hidden:m.hidden,outlineLevel:m.outlineLevel,collapsed:m.collapsed},f.push(h))}),f.length?f:void 0}static fromModel(d,f){const h=[];let m=1,p=0;for(f=(f=f||[]).sort((function(x,g){return x.min-g.min}));p{f.removeCellEx(d)})}forEach(d){i.each(this.matrixMap,(f,h)=>{f.forEach(m=>{d(h,m)})})}getNames(d){return this.getNamesEx(o.decodeEx(d))}getNamesEx(d){return i.map(this.matrixMap,(f,h)=>f.findCellEx(d)&&h).filter(Boolean)}_explore(d,f){f.mark=!1;const{sheetName:h}=f,m=new c(f.row,f.col,f.row,f.col,h);let p,x;function g(v,_){const C=d.findCellAt(h,v,f.col);return!(!C||!C.mark)&&(m[_]=v,C.mark=!1,!0)}for(x=f.row-1;g(x,"top");x--);for(x=f.row+1;g(x,"bottom");x++);function y(v,_){const C=[];for(x=m.top;x<=m.bottom;x++){const M=d.findCellAt(h,x,v);if(!M||!M.mark)return!1;C.push(M)}m[_]=v;for(let M=0;M{h.mark=!0}),{name:d,ranges:f.map(h=>h.mark&&this._explore(f,h)).filter(Boolean).map(h=>h.$shortRange)}):{name:d,ranges:[]}}normaliseMatrix(d,f){d.forEachInSheet(f,(h,m,p)=>{h&&(h.row===m&&h.col===p||(h.row=m,h.col=p,h.address=o.n2l(p)+m))})}spliceRows(d,f,h,m){i.each(this.matrixMap,p=>{p.spliceRows(d,f,h,m),this.normaliseMatrix(p,d)})}spliceColumns(d,f,h,m){i.each(this.matrixMap,p=>{p.spliceColumns(d,f,h,m),this.normaliseMatrix(p,d)})}get model(){return i.map(this.matrixMap,(d,f)=>this.getRanges(f,d)).filter(d=>d.ranges.length)}set model(d){const f=this.matrixMap={};d.forEach(h=>{const m=f[h.name]=new u;h.ranges.forEach(p=>{s.test(p.split("!").pop()||"")&&m.addCell(p)})})}}},{"../utils/cell-matrix":18,"../utils/col-cache":19,"../utils/under-dash":26,"./range":10}],7:[function(t,n,l){n.exports={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:"#N/A",Ref:"#REF!",Name:"#NAME?",DivZero:"#DIV/0!",Null:"#NULL!",Value:"#VALUE!",Num:"#NUM!"}}},{}],8:[function(t,n,l){const i=t("../utils/col-cache"),o=t("./anchor");n.exports=class{constructor(u,c){this.worksheet=u,this.model=c}get model(){switch(this.type){case"background":return{type:this.type,imageId:this.imageId};case"image":return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw new Error("Invalid Image Type")}}set model(u){let{type:c,imageId:s,range:d,hyperlinks:f}=u;if(this.type=c,this.imageId=s,c==="image")if(typeof d=="string"){const h=i.decode(d);this.range={tl:new o(this.worksheet,{col:h.left,row:h.top},-1),br:new o(this.worksheet,{col:h.right,row:h.bottom},0),editAs:"oneCell"}}else this.range={tl:new o(this.worksheet,d.tl,0),br:d.br&&new o(this.worksheet,d.br,0),ext:d.ext,editAs:d.editAs,hyperlinks:f||d.hyperlinks}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(t,n,l){const i=t("../utils/under-dash");class o{constructor(c){this.note=c}get model(){let c=null;return typeof this.note==="string"?c={type:"note",note:{texts:[{text:this.note}]}}:c={type:"note",note:this.note},i.deepMerge({},o.DEFAULT_CONFIGS,c)}set model(c){const{note:s}=c,{texts:d}=s;d.length===1&&Object.keys(d[0]).length===1?this.note=d[0].text:this.note=s}static fromModel(c){const s=new o;return s.model=c,s}}o.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}},n.exports=o},{"../utils/under-dash":26}],10:[function(t,n,l){const i=t("../utils/col-cache");class o{constructor(){this.decode(arguments)}setTLBR(c,s,d,f,h){if(arguments.length<4){const m=i.decodeAddress(c),p=i.decodeAddress(s);this.model={top:Math.min(m.row,p.row),left:Math.min(m.col,p.col),bottom:Math.max(m.row,p.row),right:Math.max(m.col,p.col),sheetName:d},this.setTLBR(m.row,m.col,p.row,p.col,h)}else this.model={top:Math.min(c,d),left:Math.min(s,f),bottom:Math.max(c,d),right:Math.max(s,f),sheetName:h}}decode(c){switch(c.length){case 5:this.setTLBR(c[0],c[1],c[2],c[3],c[4]);break;case 4:this.setTLBR(c[0],c[1],c[2],c[3]);break;case 3:this.setTLBR(c[0],c[1],c[2]);break;case 2:this.setTLBR(c[0],c[1]);break;case 1:{const s=c[0];if(s instanceof o)this.model={top:s.model.top,left:s.model.left,bottom:s.model.bottom,right:s.model.right,sheetName:s.sheetName};else if(s instanceof Array)this.decode(s);else if(s.top&&s.left&&s.bottom&&s.right)this.model={top:s.top,left:s.left,bottom:s.bottom,right:s.right,sheetName:s.sheetName};else{const d=i.decodeEx(s);d.top?this.model={top:d.top,left:d.left,bottom:d.bottom,right:d.right,sheetName:d.sheetName}:this.model={top:d.row,left:d.col,bottom:d.row,right:d.col,sheetName:d.sheetName}}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw new Error("Invalid number of arguments to _getDimensions() - "+c.length)}}get top(){return this.model.top||1}set top(c){this.model.top=c}get left(){return this.model.left||1}set left(c){this.model.left=c}get bottom(){return this.model.bottom||1}set bottom(c){this.model.bottom=c}get right(){return this.model.right||1}set right(c){this.model.right=c}get sheetName(){return this.model.sheetName}set sheetName(c){this.model.sheetName=c}get _serialisedSheetName(){const{sheetName:c}=this.model;return c?/^[a-zA-Z0-9]*$/.test(c)?c+"!":`'${c}'!`:""}expand(c,s,d,f){(!this.model.top||cthis.bottom)&&(this.bottom=d),(!this.model.right||f>this.right)&&(this.right=f)}expandRow(c){if(c){const{dimensions:s,number:d}=c;s&&this.expand(d,s.min,d,s.max)}}expandToAddress(c){const s=i.decodeEx(c);this.expand(s.row,s.col,s.row,s.col)}get tl(){return i.n2l(this.left)+this.top}get $t$l(){return`$${i.n2l(this.left)}$${this.top}`}get br(){return i.n2l(this.right)+this.bottom}get $b$r(){return`$${i.n2l(this.right)}$${this.bottom}`}get range(){return`${this._serialisedSheetName+this.tl}:${this.br}`}get $range(){return`${this._serialisedSheetName+this.$t$l}:${this.$b$r}`}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects(c){return(!c.sheetName||!this.sheetName||c.sheetName===this.sheetName)&&!(c.bottomthis.bottom)&&!(c.rightthis.right)}contains(c){const s=i.decodeEx(c);return this.containsEx(s)}containsEx(c){return(!c.sheetName||!this.sheetName||c.sheetName===this.sheetName)&&c.row>=this.top&&c.row<=this.bottom&&c.col>=this.left&&c.col<=this.right}forEachAddress(c){for(let s=this.left;s<=this.right;s++)for(let d=this.top;d<=this.bottom;d++)c(i.encodeAddress(d,s),d,s)}}n.exports=o},{"../utils/col-cache":19}],11:[function(t,n,l){const i=t("../utils/under-dash"),o=t("./enums"),u=t("../utils/col-cache"),c=t("./cell");n.exports=class{constructor(s,d){this._worksheet=s,this._number=d,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell(s){return this._cells[s-1]}getCellEx(s){let d=this._cells[s.col-1];if(!d){const f=this._worksheet.getColumn(s.col);d=new c(this,f,s.address),this._cells[s.col-1]=d}return d}getCell(s){if(typeof s=="string"){const d=this._worksheet.getColumnKey(s);s=d?d.number:u.l2n(s)}return this._cells[s-1]||this.getCellEx({address:u.encodeAddress(this._number,s),row:this._number,col:s})}splice(s,d){const f=s+d;for(var h=arguments.length,m=new Array(h>2?h-2:0),p=2;p0)for(y=g;y>=f;y--)v=this._cells[y-1],v?(_=this.getCell(y+x),_.value=v.value,_.style=v.style,_._comment=v._comment):this._cells[y+x-1]=void 0;for(y=0;y{f&&f.type!==o.ValueType.Null&&d(f,h+1)})}addPageBreak(s,d){const f=this._worksheet,h=Math.max(0,s-1)||0,m=Math.max(0,d-1)||16838,p={id:this._number,max:m,man:1};h&&(p.min=h),f.rowBreaks.push(p)}get values(){const s=[];return this._cells.forEach(d=>{d&&d.type!==o.ValueType.Null&&(s[d.col]=d.value)}),s}set values(s){if(this._cells=[],s)if(s instanceof Array){let d=0;s.hasOwnProperty("0")&&(d=1),s.forEach((f,h)=>{f!==void 0&&(this.getCellEx({address:u.encodeAddress(this._number,h+d),row:this._number,col:h+d}).value=f)})}else this._worksheet.eachColumnKey((d,f)=>{s[f]!==void 0&&(this.getCellEx({address:u.encodeAddress(this._number,d.number),row:this._number,col:d.number}).value=s[f])})}get hasValues(){return i.some(this._cells,s=>s&&s.type!==o.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let s=0;return this.eachCell(()=>{s++}),s}get dimensions(){let s=0,d=0;return this._cells.forEach(f=>{f&&f.type!==o.ValueType.Null&&((!s||s>f.col)&&(s=f.col),d0?{min:s,max:d}:null}_applyStyle(s,d){return this.style[s]=d,this._cells.forEach(f=>{f&&(f[s]=d)}),d}get numFmt(){return this.style.numFmt}set numFmt(s){this._applyStyle("numFmt",s)}get font(){return this.style.font}set font(s){this._applyStyle("font",s)}get alignment(){return this.style.alignment}set alignment(s){this._applyStyle("alignment",s)}get protection(){return this.style.protection}set protection(s){this._applyStyle("protection",s)}get border(){return this.style.border}set border(s){this._applyStyle("border",s)}get fill(){return this.style.fill}set fill(s){this._applyStyle("fill",s)}get hidden(){return!!this._hidden}set hidden(s){this._hidden=s}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(s){this._outlineLevel=s}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){const s=[];let d=0,f=0;return this._cells.forEach(h=>{if(h){const m=h.model;m&&((!d||d>h.col)&&(d=h.col),f{switch(f.type){case c.Types.Merge:break;default:{let h;if(f.address)h=u.decodeAddress(f.address);else if(d){const{row:m}=d,p=d.col+1;h={row:m,col:p,address:u.encodeAddress(m,p),$col$row:`$${u.n2l(p)}$${m}`}}d=h,this.getCellEx(h).model=f;break}}}),s.height?this.height=s.height:delete this.height,this.hidden=s.hidden,this.outlineLevel=s.outlineLevel||0,this.style=s.style&&JSON.parse(JSON.stringify(s.style))||{}}}},{"../utils/col-cache":19,"../utils/under-dash":26,"./cell":3,"./enums":7}],12:[function(t,n,l){const i=t("../utils/col-cache");class o{constructor(c,s,d){this.table=c,this.column=s,this.index=d}_set(c,s){this.table.cacheState(),this.column[c]=s}get name(){return this.column.name}set name(c){this._set("name",c)}get filterButton(){return this.column.filterButton}set filterButton(c){this.column.filterButton=c}get style(){return this.column.style}set style(c){this.column.style=c}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(c){this._set("totalsRowLabel",c)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(c){this._set("totalsRowFunction",c)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(c){this._set("totalsRowResult",c)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(c){this._set("totalsRowFormula",c)}}n.exports=class{constructor(u,c){this.worksheet=u,c&&(this.table=c,this.validate(),this.store())}getFormula(u){switch(u.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${u.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${u.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${u.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${u.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${u.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${u.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${u.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${u.name}])`;case"custom":return u.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+u.totalsRowFunction)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+(this.table.headerRow?1:0)}get tableHeight(){return this.filterHeight+(this.table.totalsRow?1:0)}validate(){const{table:u}=this,c=(x,g,y)=>{x[g]===void 0&&(x[g]=y)};c(u,"headerRow",!0),c(u,"totalsRow",!1),c(u,"style",{}),c(u.style,"theme","TableStyleMedium2"),c(u.style,"showFirstColumn",!1),c(u.style,"showLastColumn",!1),c(u.style,"showRowStripes",!1),c(u.style,"showColumnStripes",!1);const s=(x,g)=>{if(!x)throw new Error(g)};s(u.ref,"Table must have ref"),s(u.columns,"Table must have column definitions"),s(u.rows,"Table must have row definitions"),u.tl=i.decodeAddress(u.ref);const{row:d,col:f}=u.tl;s(d>0,"Table must be on valid row"),s(f>0,"Table must be on valid col");const{width:h,filterHeight:m,tableHeight:p}=this;u.autoFilterRef=i.encode(d,f,d+m-1,f+h-1),u.tableRef=i.encode(d,f,d+p-1,f+h-1),u.columns.forEach((x,g)=>{s(x.name,`Column ${g} must have a name`),g===0?c(x,"totalsRowLabel","Total"):(c(x,"totalsRowFunction","none"),x.totalsRowFormula=this.getFormula(x))})}store(){const u=(m,p)=>{p&&Object.keys(p).forEach(x=>{m[x]=p[x]})},{worksheet:c,table:s}=this,{row:d,col:f}=s.tl;let h=0;if(s.headerRow){const m=c.getRow(d+h++);s.columns.forEach((p,x)=>{const{style:g,name:y}=p,v=m.getCell(f+x);v.value=y,u(v,g)})}if(s.rows.forEach(m=>{const p=c.getRow(d+h++);m.forEach((x,g)=>{const y=p.getCell(f+g);y.value=x,u(y,s.columns[g].style)})}),s.totalsRow){const m=c.getRow(d+h++);s.columns.forEach((p,x)=>{const g=m.getCell(f+x);if(x===0)g.value=p.totalsRowLabel;else{const y=this.getFormula(p);g.value=y?{formula:p.totalsRowFormula,result:p.totalsRowResult}:null}u(g,p.style)})}}load(u){const{table:c}=this,{row:s,col:d}=c.tl;let f=0;if(c.headerRow){const h=u.getRow(s+f++);c.columns.forEach((m,p)=>{h.getCell(d+p).value=m.name})}if(c.rows.forEach(h=>{const m=u.getRow(s+f++);h.forEach((p,x)=>{m.getCell(d+x).value=p})}),c.totalsRow){const h=u.getRow(s+f++);c.columns.forEach((m,p)=>{const x=h.getCell(d+p);p===0?x.value=m.totalsRowLabel:this.getFormula(m)&&(x.value={formula:m.totalsRowFormula,result:m.totalsRowResult})})}}get model(){return this.table}set model(u){this.table=u}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();const u=i.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let c=0;c1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(u,c)}getColumn(u){const c=this.table.columns[u];return new o(this,c,u)}addColumn(u,c,s){this.cacheState(),s===void 0?(this.table.columns.push(u),this.table.rows.forEach((d,f)=>{d.push(c[f])})):(this.table.columns.splice(s,0,u),this.table.rows.forEach((d,f)=>{d.splice(s,0,c[f])}))}removeColumns(u){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(u,c),this.table.rows.forEach(s=>{s.splice(u,c)})}_assign(u,c,s){this.cacheState(),u[c]=s}get ref(){return this.table.ref}set ref(u){this._assign(this.table,"ref",u)}get name(){return this.table.name}set name(u){this.table.name=u}get displayName(){return this.table.displyName||this.table.name}set displayNamename(u){this.table.displayName=u}get headerRow(){return this.table.headerRow}set headerRow(u){this._assign(this.table,"headerRow",u)}get totalsRow(){return this.table.totalsRow}set totalsRow(u){this._assign(this.table,"totalsRow",u)}get theme(){return this.table.style.name}set theme(u){this.table.style.name=u}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(u){this.table.style.showFirstColumn=u}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(u){this.table.style.showLastColumn=u}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(u){this.table.style.showRowStripes=u}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(u){this.table.style.showColumnStripes=u}}},{"../utils/col-cache":19}],13:[function(t,n,l){const i=t("./worksheet"),o=t("./defined-names"),u=t("../xlsx/xlsx"),c=t("../csv/csv");n.exports=class{constructor(){this.category="",this.company="",this.created=new Date,this.description="",this.keywords="",this.manager="",this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject="",this.title="",this.views=[],this.media=[],this._definedNames=new o}get xlsx(){return this._xlsx||(this._xlsx=new u(this)),this._xlsx}get csv(){return this._csv||(this._csv=new c(this)),this._csv}get nextId(){for(let s=1;s(g&&g.orderNo)>x?g.orderNo:x,0),m=Object.assign({},d,{id:f,name:s,orderNo:h+1,workbook:this}),p=new i(m);return this._worksheets[f]=p,p}removeWorksheetEx(s){delete this._worksheets[s.id]}removeWorksheet(s){const d=this.getWorksheet(s);d&&d.destroy()}getWorksheet(s){return s===void 0?this._worksheets.find(Boolean):typeof s=="number"?this._worksheets[s]:typeof s=="string"?this._worksheets.find(d=>d&&d.name===s):void 0}get worksheets(){return this._worksheets.slice(1).sort((s,d)=>s.orderNo-d.orderNo).filter(Boolean)}eachSheet(s){this.worksheets.forEach(d=>{s(d,d.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(s){const d=this.media.length;return this.media.push(Object.assign({},s,{type:"image"})),d}getImage(s){return this.media[s]}get model(){return{creator:this.creator||"Unknown",lastModifiedBy:this.lastModifiedBy||"Unknown",lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map(s=>s.model),sheets:this.worksheets.map(s=>s.model).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,calcProperties:this.calcProperties}}set model(s){this.creator=s.creator,this.lastModifiedBy=s.lastModifiedBy,this.lastPrinted=s.lastPrinted,this.created=s.created,this.modified=s.modified,this.company=s.company,this.manager=s.manager,this.title=s.title,this.subject=s.subject,this.keywords=s.keywords,this.category=s.category,this.description=s.description,this.language=s.language,this.revision=s.revision,this.contentStatus=s.contentStatus,this.properties=s.properties,this.calcProperties=s.calcProperties,this._worksheets=[],s.worksheets.forEach(d=>{const{id:f,name:h,state:m}=d,p=s.sheets&&s.sheets.findIndex(x=>x.id===f);(this._worksheets[f]=new i({id:f,name:h,orderNo:p,state:m,workbook:this})).model=d}),this._definedNames.model=s.definedNames,this.views=s.views,this._themes=s.themes,this.media=s.media||[]}}},{"../csv/csv":1,"../xlsx/xlsx":144,"./defined-names":6,"./worksheet":14}],14:[function(t,n,l){const i=t("../utils/under-dash"),o=t("../utils/col-cache"),u=t("./range"),c=t("./row"),s=t("./column"),d=t("./enums"),f=t("./image"),h=t("./table"),m=t("./data-validations"),p=t("../utils/encryptor"),{copyStyle:x}=t("../utils/copy-style");n.exports=class{constructor(g){g=g||{},this._workbook=g.workbook,this.id=g.id,this.orderNo=g.orderNo,this.name=g.name,this.state=g.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},g.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!(!g.pageSetup||!g.pageSetup.fitToWidth&&!g.pageSetup.fitToHeight||g.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},g.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},g.headerFooter),this.dataValidations=new m,this.views=g.views||[],this.autoFilter=g.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name(g){if(g===void 0&&(g="sheet"+this.id),this._name!==g){if(typeof g!="string")throw new Error("The name has to be a string.");if(g==="")throw new Error("The name can't be empty.");if(g==="History")throw new Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test(g))throw new Error(`Worksheet name ${g} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(g))throw new Error("The first or last character of worksheet name cannot be a single quotation mark: "+g);if(g&&g.length>31&&(console.warn(`Worksheet name ${g} exceeds 31 chars. This will be truncated`),g=g.substring(0,31)),this._workbook._worksheets.find(y=>y&&y.name.toLowerCase()===g.toLowerCase()))throw new Error("Worksheet name already exists: "+g);this._name=g}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){const g=new u;return this._rows.forEach(y=>{if(y){const v=y.dimensions;v&&g.expand(y.number,v.min,y.number,v.max)}}),g}get columns(){return this._columns}set columns(g){this._headerRowCount=g.reduce((_,C)=>{const M=(C.header?1:C.headers&&C.headers.length)||0;return Math.max(_,M)},0);let y=1;const v=this._columns=[];g.forEach(_=>{const C=new s(this,y++,!1);v.push(C),C.defn=_})}getColumnKey(g){return this._keys[g]}setColumnKey(g,y){this._keys[g]=y}deleteColumnKey(g){delete this._keys[g]}eachColumnKey(g){i.each(this._keys,g)}getColumn(g){if(typeof g=="string"){const y=this._keys[g];if(y)return y;g=o.l2n(g)}if(this._columns||(this._columns=[]),g>this._columns.length){let y=this._columns.length+1;for(;y<=g;)this._columns.push(new s(this,y++))}return this._columns[g-1]}spliceColumns(g,y){const v=this._rows.length;for(var _=arguments.length,C=new Array(_>2?_-2:0),M=2;M<_;M++)C[M-2]=arguments[M];if(C.length>0)for(let H=0;H{W.push($[H]||null)});const K=this.getRow(H+1);K.splice.apply(K,W)}else this._rows.forEach(H=>{H&&H.splice(g,y)});const T=C.length-y,U=g+y,F=this._columns.length;if(T<0)for(let H=g+C.length;H<=F;H++)this.getColumn(H).defn=this.getColumn(H-T).defn;else if(T>0)for(let H=F;H>=U;H--)this.getColumn(H+T).defn=this.getColumn(H).defn;for(let H=g;H{g=Math.max(g,y.cellCount)}),g}get actualColumnCount(){const g=[];let y=0;return this.eachRow(v=>{v.eachCell(_=>{let{col:C}=_;g[C]||(g[C]=!0,y++)})}),y}_commitRow(){}get _lastRowNumber(){const g=this._rows;let y=g.length;for(;y>0&&g[y-1]===void 0;)y--;return y}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(g){return this._rows[g-1]}findRows(g,y){return this._rows.slice(g-1,g-1+y)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let g=0;return this.eachRow(()=>{g++}),g}getRow(g){let y=this._rows[g-1];return y||(y=this._rows[g-1]=new c(this,g)),y}getRows(g,y){if(y<1)return;const v=[];for(let _=g;_1&&arguments[1]!==void 0?arguments[1]:"n";const v=this._nextRow,_=this.getRow(v);return _.values=g,this._setStyleOption(v,y[0]==="i"?y:"n"),_}addRows(g){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";const v=[];return g.forEach(_=>{v.push(this.addRow(_,y))}),v}insertRow(g,y){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";return this.spliceRows(g,0,y),this._setStyleOption(g,v),this.getRow(g)}insertRows(g,y){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";if(this.spliceRows(g,0,...y),v!=="n")for(let _=0;_1&&arguments[1]!==void 0?arguments[1]:"n";y[0]==="o"&&this.findRow(g+1)!==void 0?this._copyStyle(g+1,g,y[1]==="+"):y[0]==="i"&&this.findRow(g-1)!==void 0&&this._copyStyle(g-1,g,y[1]==="+")}_copyStyle(g,y){let v=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const _=this.getRow(g),C=this.getRow(y);C.style=x(_.style),_.eachCell({includeEmpty:v},(M,T)=>{C.getCell(T).style=x(M.style)}),C.height=_.height}duplicateRow(g,y){let v=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const _=this._rows[g-1],C=new Array(y).fill(_.values);this.spliceRows(g+1,v?0:y,...C);for(let M=0;M{T.getCell(F).style=U.style})}}spliceRows(g,y){const v=g+y;for(var _=arguments.length,C=new Array(_>2?_-2:0),M=2;M<_;M++)C[M-2]=arguments[M];const T=C.length,U=T-y,F=this._rows.length;let H,W;if(U<0)for(g===F&&(this._rows[F-1]=void 0),H=v;H<=F;H++)if(W=this._rows[H-1],W){const K=this.getRow(H+U);K.values=W.values,K.style=W.style,K.height=W.height,W.eachCell({includeEmpty:!0},($,P)=>{K.getCell(P).style=$.style}),this._rows[H-1]=void 0}else this._rows[H+U-1]=void 0;else if(U>0)for(H=F;H>=v;H--)if(W=this._rows[H-1],W){const K=this.getRow(H+U);K.values=W.values,K.style=W.style,K.height=W.height,W.eachCell({includeEmpty:!0},($,P)=>{if(K.getCell(P).style=$.style,$._value.constructor.name==="MergeValue"){const L=this.getRow($._row._number+T).getCell(P),E=$._value._master,j=this.getRow(E._row._number+T).getCell(E._column._number);L.merge(j)}})}else this._rows[H+U-1]=void 0;for(H=0;H{v&&v.hasValues&&y(v,v.number)})}getSheetValues(){const g=[];return this._rows.forEach(y=>{y&&(g[y.number]=y.values)}),g}findCell(g,y){const v=o.getAddress(g,y),_=this._rows[v.row-1];return _?_.findCell(v.col):void 0}getCell(g,y){const v=o.getAddress(g,y);return this.getRow(v.row).getCellEx(v)}mergeCells(){for(var g=arguments.length,y=new Array(g),v=0;v{if(_.intersects(g))throw new Error("Cannot merge already merged cells")});const v=this.getCell(g.top,g.left);for(let _=g.top;_<=g.bottom;_++)for(let C=g.left;C<=g.right;C++)(_>g.top||C>g.left)&&this.getCell(_,C).merge(v,y);this._merges[v.address]=g}_unMergeMaster(g){const y=this._merges[g.address];if(y){for(let v=y.top;v<=y.bottom;v++)for(let _=y.left;_<=y.right;_++)this.getCell(v,_).unmerge();delete this._merges[g.address]}}get hasMerges(){return i.some(this._merges,Boolean)}unMergeCells(){for(var g=arguments.length,y=new Array(g),v=0;v3&&arguments[3]!==void 0?arguments[3]:"shared";const C=o.decode(g),{top:M,left:T,bottom:U,right:F}=C,H=F-T+1,W=o.encodeAddress(M,T),K=_==="shared";let $;$=typeof v=="function"?v:Array.isArray(v)?Array.isArray(v[0])?(L,E)=>v[L-M][E-T]:(L,E)=>v[(L-M)*H+(E-T)]:()=>{};let P=!0;for(let L=M;L<=U;L++)for(let E=T;E<=F;E++)P?(this.getCell(L,E).value={shareType:_,formula:y,ref:g,result:$(L,E)},P=!1):this.getCell(L,E).value=K?{sharedFormula:W,result:$(L,E)}:$(L,E)}addImage(g,y){const v={type:"image",imageId:g,range:y};this._media.push(new f(this,v))}getImages(){return this._media.filter(g=>g.type==="image")}addBackgroundImage(g){const y={type:"background",imageId:g};this._media.push(new f(this,y))}getBackgroundImageId(){const g=this._media.find(y=>y.type==="background");return g&&g.imageId}protect(g,y){return new Promise(v=>{this.sheetProtection={sheet:!0},y&&"spinCount"in y&&(y.spinCount=Number.isFinite(y.spinCount)?Math.round(Math.max(0,y.spinCount)):1e5),g&&(this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=p.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=y&&"spinCount"in y?y.spinCount:1e5,this.sheetProtection.hashValue=p.convertPasswordToHash(g,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount)),y&&(this.sheetProtection=Object.assign(this.sheetProtection,y),!g&&"spinCount"in y&&delete this.sheetProtection.spinCount),v()})}unprotect(){this.sheetProtection=null}addTable(g){const y=new h(this,g);return this.tables[g.name]=y,y}getTable(g){return this.tables[g]}removeTable(g){delete this.tables[g]}getTables(){return Object.values(this.tables)}addConditionalFormatting(g){this.conditionalFormattings.push(g)}removeConditionalFormatting(g){typeof g=="number"?this.conditionalFormattings.splice(g,1):this.conditionalFormattings=g instanceof Function?this.conditionalFormattings.filter(g):[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor(g){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=g}get model(){const g={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map(_=>_.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(_=>_.model),conditionalFormattings:this.conditionalFormattings};g.cols=s.toModel(this.columns);const y=g.rows=[],v=g.dimensions=new u;return this._rows.forEach(_=>{const C=_&&_.model;C&&(v.expand(C.number,C.min,C.number,C.max),y.push(C))}),g.merges=[],i.each(this._merges,_=>{g.merges.push(_.range)}),g}_parseRows(g){this._rows=[],g.rows.forEach(y=>{const v=new c(this,y.number);this._rows[v.number-1]=v,v.model=y})}_parseMergeCells(g){i.each(g.mergeCells,y=>{this.mergeCellsWithoutStyle(y)})}set model(g){this.name=g.name,this._columns=s.fromModel(this,g.cols),this._parseRows(g),this._parseMergeCells(g),this.dataValidations=new m(g.dataValidations),this.properties=g.properties,this.pageSetup=g.pageSetup,this.headerFooter=g.headerFooter,this.views=g.views,this.autoFilter=g.autoFilter,this._media=g.media.map(y=>new f(this,y)),this.sheetProtection=g.sheetProtection,this.tables=g.tables.reduce((y,v)=>{const _=new h;return _.model=v,y[v.name]=_,y},{}),this.conditionalFormattings=g.conditionalFormattings}}},{"../utils/col-cache":19,"../utils/copy-style":20,"../utils/encryptor":21,"../utils/under-dash":26,"./column":4,"./data-validations":5,"./enums":7,"./image":8,"./range":10,"./row":11,"./table":12}],15:[function(t,n,l){t("core-js/modules/es.promise"),t("core-js/modules/es.promise.finally"),t("core-js/modules/es.object.assign"),t("core-js/modules/es.object.keys"),t("core-js/modules/es.object.values"),t("core-js/modules/es.symbol"),t("core-js/modules/es.symbol.async-iterator"),t("core-js/modules/es.array.iterator"),t("core-js/modules/es.array.includes"),t("core-js/modules/es.array.find-index"),t("core-js/modules/es.array.find"),t("core-js/modules/es.string.from-code-point"),t("core-js/modules/es.string.includes"),t("core-js/modules/es.number.is-nan"),t("regenerator-runtime/runtime");const i={Workbook:t("./doc/workbook")},o=t("./doc/enums");Object.keys(o).forEach(u=>{i[u]=o[u]}),n.exports=i},{"./doc/enums":7,"./doc/workbook":13,"core-js/modules/es.array.find":359,"core-js/modules/es.array.find-index":358,"core-js/modules/es.array.includes":360,"core-js/modules/es.array.iterator":361,"core-js/modules/es.number.is-nan":363,"core-js/modules/es.object.assign":364,"core-js/modules/es.object.keys":366,"core-js/modules/es.object.values":367,"core-js/modules/es.promise":372,"core-js/modules/es.promise.finally":371,"core-js/modules/es.string.from-code-point":376,"core-js/modules/es.string.includes":377,"core-js/modules/es.symbol":381,"core-js/modules/es.symbol.async-iterator":378,"regenerator-runtime/runtime":492}],16:[function(t,n,l){const i=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");l.bufferToString=function(o){return typeof o=="string"?o:i?i.decode(o):o.toString()}},{}],17:[function(t,n,l){const i=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:o}=t("buffer");l.stringToBuffer=function(u){return typeof u!="string"?u:i?o.from(i.encode(u).buffer):o.from(u)}},{buffer:220}],18:[function(t,n,l){const i=t("./under-dash"),o=t("./col-cache");n.exports=class{constructor(u){this.template=u,this.sheets={}}addCell(u){this.addCellEx(o.decodeEx(u))}getCell(u){return this.findCellEx(o.decodeEx(u),!0)}findCell(u){return this.findCellEx(o.decodeEx(u),!1)}findCellAt(u,c,s){const d=this.sheets[u],f=d&&d[c];return f&&f[s]}addCellEx(u){if(u.top)for(let c=u.top;c<=u.bottom;c++)for(let s=u.left;s<=u.right;s++)this.getCellAt(u.sheetName,c,s);else this.findCellEx(u,!0)}getCellEx(u){return this.findCellEx(u,!0)}findCellEx(u,c){const s=this.findSheet(u,c),d=this.findSheetRow(s,u,c);return this.findRowCell(d,u,c)}getCellAt(u,c,s){const d=this.sheets[u]||(this.sheets[u]=[]),f=d[c]||(d[c]=[]);return f[s]||(f[s]={sheetName:u,address:o.n2l(s)+c,row:c,col:s})}removeCellEx(u){const c=this.findSheet(u);if(!c)return;const s=this.findSheetRow(c,u);s&&delete s[u.col]}forEachInSheet(u,c){const s=this.sheets[u];s&&s.forEach((d,f)=>{d&&d.forEach((h,m)=>{h&&c(h,f,m)})})}forEach(u){i.each(this.sheets,(c,s)=>{this.forEachInSheet(s,u)})}map(u){const c=[];return this.forEach(s=>{c.push(u(s))}),c}findSheet(u,c){const s=u.sheetName;return this.sheets[s]?this.sheets[s]:c?this.sheets[s]=[]:void 0}findSheetRow(u,c,s){const{row:d}=c;return u&&u[d]?u[d]:s?u[d]=[]:void 0}findRowCell(u,c,s){const{col:d}=c;return u&&u[d]?u[d]:s?u[d]=this.template?Object.assign(c,JSON.parse(JSON.stringify(this.template))):c:void 0}spliceRows(u,c,s,d){const f=this.sheets[u];if(f){const h=[];for(let m=0;m{m.splice(c,s,...h)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(t,n,l){const i=/^[A-Z]+\d+$/,o={_dictionary:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_l2nFill:0,_l2n:{},_n2l:[],_level:u=>u<=26?1:u<=676?2:3,_fill(u){let c,s,d,f,h,m=1;if(u>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&u>=1){for(;m<=26;)c=this._dictionary[m-1],this._n2l[m]=c,this._l2n[c]=m,m++;this._l2nFill=1}if(this._l2nFill<2&&u>=2){for(m=27;m<=702;)s=m-27,d=s%26,f=Math.floor(s/26),c=this._dictionary[f]+this._dictionary[d],this._n2l[m]=c,this._l2n[c]=m,m++;this._l2nFill=2}if(this._l2nFill<3&&u>=3){for(m=703;m<=16384;)s=m-703,d=s%26,f=Math.floor(s/26)%26,h=Math.floor(s/676),c=this._dictionary[h]+this._dictionary[f]+this._dictionary[d],this._n2l[m]=c,this._l2n[c]=m,m++;this._l2nFill=3}},l2n(u){if(this._l2n[u]||this._fill(u.length),!this._l2n[u])throw new Error("Out of bounds. Invalid column letter: "+u);return this._l2n[u]},n2l(u){if(u<1||u>16384)throw new Error(u+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[u]||this._fill(this._level(u)),this._n2l[u]},_hash:{},validateAddress(u){if(!i.test(u))throw new Error("Invalid Address: "+u);return!0},decodeAddress(u){const c=u.length<5&&this._hash[u];if(c)return c;let s=!1,d="",f=0,h=!1,m="",p=0;for(let g,y=0;y=65&&g<=90)s=!0,d+=u[y],f=26*f+g-64;else if(g>=48&&g<=57)h=!0,m+=u[y],p=10*p+g-48;else if(h&&s&&g!==36)break;if(s){if(f>16384)throw new Error("Out of bounds. Invalid column letter: "+d)}else f=void 0;h||(p=void 0);const x={address:u=d+m,col:f,row:p,$col$row:`$${d}$${m}`};return f<=100&&p<=100&&(this._hash[u]=x,this._hash[x.$col$row]=x),x},getAddress(u,c){if(c){const s=this.n2l(c)+u;return this.decodeAddress(s)}return this.decodeAddress(u)},decode(u){const c=u.split(":");if(c.length===2){const s=this.decodeAddress(c[0]),d=this.decodeAddress(c[1]),f={top:Math.min(s.row,d.row),left:Math.min(s.col,d.col),bottom:Math.max(s.row,d.row),right:Math.max(s.col,d.col)};return f.tl=this.n2l(f.left)+f.top,f.br=this.n2l(f.right)+f.bottom,f.dimensions=`${f.tl}:${f.br}`,f}return this.decodeAddress(u)},decodeEx(u){const c=u.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),s=c[1]||c[2],d=c[3],f=d.split(":");if(f.length>1){let m=this.decodeAddress(f[0]),p=this.decodeAddress(f[1]);const x=Math.min(m.row,p.row),g=Math.min(m.col,p.col),y=Math.max(m.row,p.row),v=Math.max(m.col,p.col);return m=this.n2l(g)+x,p=this.n2l(v)+y,{top:x,left:g,bottom:y,right:v,sheetName:s,tl:{address:m,col:g,row:x,$col$row:`$${this.n2l(g)}$${x}`,sheetName:s},br:{address:p,col:v,row:y,$col$row:`$${this.n2l(v)}$${y}`,sheetName:s},dimensions:`${m}:${p}`}}if(d.startsWith("#"))return s?{sheetName:s,error:d}:{error:d};const h=this.decodeAddress(d);return s?{sheetName:s,...h}:h},encodeAddress:(u,c)=>o.n2l(c)+u,encode(){switch(arguments.length){case 2:return o.encodeAddress(arguments[0],arguments[1]);case 4:return`${o.encodeAddress(arguments[0],arguments[1])}:${o.encodeAddress(arguments[2],arguments[3])}`;default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(u,c){const[s,d,,f,h]=u,[m,p]=c;return m>=s&&m<=f&&p>=d&&p<=h}};n.exports=o},{}],20:[function(t,n,l){const i=(u,c)=>({...u,...c.reduce((s,d)=>(u[d]&&(s[d]={...u[d]}),s),{})}),o=function(u,c,s){let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];u[s]&&(c[s]=i(u[s],d))};l.copyStyle=u=>{if(!u)return u;if(c=u,Object.keys(c).length===0)return{};var c;const s={...u};return o(u,s,"font",["color"]),o(u,s,"alignment"),o(u,s,"protection"),u.border&&(o(u,s,"border"),o(u.border,s.border,"top",["color"]),o(u.border,s.border,"left",["color"]),o(u.border,s.border,"bottom",["color"]),o(u.border,s.border,"right",["color"]),o(u.border,s.border,"diagonal",["color"])),u.fill&&(o(u,s,"fill",["fgColor","bgColor","center"]),u.fill.stops&&(s.fill.stops=u.fill.stops.map(d=>i(d,["color"])))),s}},{}],21:[function(t,n,l){(function(i){(function(){const o=t("crypto"),u={hash(c){const s=o.createHash(c);for(var d=arguments.length,f=new Array(d>1?d-1:0),h=1;ho.randomBytes(c)};n.exports=u}).call(this)}).call(this,t("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(t,n,l){const{SaxesParser:i}=t("saxes"),{PassThrough:o}=t("readable-stream"),{bufferToString:u}=t("./browser-buffer-decode");n.exports=async function*(c){c.pipe&&!c[Symbol.asyncIterator]&&(c=c.pipe(new o));const s=new i;let d;s.on("error",h=>{d=h});let f=[];s.on("opentag",h=>f.push({eventType:"opentag",value:h})),s.on("text",h=>f.push({eventType:"text",value:h})),s.on("closetag",h=>f.push({eventType:"closetag",value:h}));for await(const h of c){if(s.write(u(h)),d)throw d;yield f,f=[]}}},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(t,n,l){const i=t("./col-cache"),o=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,u=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;n.exports={slideFormula:function(c,s,d){const f=i.decode(s),h=i.decode(d);return c.replace(o,(m,p,x,g,y)=>{if(y)return m;const v=u.exec(g);if(v){const _=v[1],C=v[2].toUpperCase(),M=v[3],T=v[4];if(C.length>3||C.length===3&&C>"XFD")return m;let U=i.l2n(C),F=parseInt(T,10);return _||(U+=h.col-f.col),M||(F+=h.row-f.row),(p||"")+(_||"")+i.n2l(U)+(M||"")+F}return m})}}},{"./col-cache":19}],24:[function(t,n,l){(function(i,o){(function(){const u=t("readable-stream"),c=t("./utils"),s=t("./string-buf");class d{constructor(g,y){this._data=g,this._encoding=y}get length(){return this.toBuffer().length}copy(g,y,v,_){return this.toBuffer().copy(g,y,v,_)}toBuffer(){return this._buffer||(this._buffer=o.from(this._data,this._encoding)),this._buffer}}class f{constructor(g){this._data=g}get length(){return this._data.length}copy(g,y,v,_){return this._data._buf.copy(g,y,v,_)}toBuffer(){return this._data.toBuffer()}}class h{constructor(g){this._data=g}get length(){return this._data.length}copy(g,y,v,_){this._data.copy(g,y,v,_)}toBuffer(){return this._data}}class m{constructor(g){this.size=g,this.buffer=o.alloc(g),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;const g=o.alloc(this.iWrite-this.iRead);return this.buffer.copy(g,0,this.iRead,this.iWrite),g}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(g){let y;return g===0?null:g===void 0||g>=this.length?(y=this.toBuffer(),this.iRead=this.iWrite,y):(y=o.alloc(g),this.buffer.copy(y,0,this.iRead,g),this.iRead+=g,y)}write(g,y,v){const _=Math.min(v,this.size-this.iWrite);return g.copy(this.buffer,this.iWrite,y,y+_),this.iWrite+=_,_}}const p=function(x){x=x||{},this.bufSize=x.bufSize||1048576,this.buffers=[],this.batch=x.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};c.inherits(p,u.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return o.concat(this.buffers.map(x=>x.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){const g=this.buffers[this.buffers.length-1];if(!g.full)return g}const x=new m(this.bufSize);return this.buffers.push(x),x},async _pipe(x){await Promise.all(this.pipes.map((function(g){return new Promise(y=>{g.write(x.toBuffer(),()=>{y()})})})))},_writeToBuffers(x){let g=0;const y=x.length;for(;g1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(v),i.nextTick(y)):(await this._pipe(v),y());else this.paused||this.emit("data",v.toBuffer()),this._writeToBuffers(v),this.emit("readable");return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end(x,g,y){const v=_=>{_?y(_):(this._flush(),this.pipes.forEach(C=>{C.end()}),this.emit("finish"))};x?this.write(x,g,v):v()},read(x){let g;if(x){for(g=[];x&&this.buffers.length&&!this.buffers[0].eod;){const y=this.buffers[0],v=y.read(x);x-=v.length,g.push(v),y.eod&&y.full&&this.buffers.shift()}return o.concat(g)}return g=this.buffers.map(y=>y.toBuffer()).filter(Boolean),this.buffers=[],o.concat(g)},setEncoding(x){this.encoding=x},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(x){this.pipes.push(x),!this.paused&&this.buffers.length&&this.end()},unpipe(x){this.pipes=this.pipes.filter(g=>g!==x)},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),n.exports=p}).call(this)}).call(this,t("_process"),t("buffer").Buffer)},{"./string-buf":25,"./utils":27,_process:467,buffer:220,"readable-stream":491}],25:[function(t,n,l){(function(i){(function(){n.exports=class{constructor(o){this._buf=i.alloc(o&&o.size||16384),this._encoding=o&&o.encoding||"utf8",this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){return this._buffer||(this._buffer=i.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(o){o=o||0,this._buffer=void 0,this._inPos=o}_grow(o){let u=2*this._buf.length;for(;u=this._buf.length-4;)this._grow(this._inPos+o.length),u=this._inPos+this._buf.write(o,this._inPos,this._encoding);this._inPos=u}addStringBuf(o){o.length&&(this._buffer=void 0,this.length+o.length>this.capacity&&this._grow(this.length+o.length),o._buf.copy(this._buf,this._inPos,0,o.length),this._inPos+=o.length)}}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:220}],26:[function(t,n,l){const{toString:i}=Object.prototype,o=/["&<>]/,u={each:function(c,s){c&&(Array.isArray(c)?c.forEach(s):Object.keys(c).forEach(d=>{s(c[d],d)}))},some:function(c,s){return!!c&&(Array.isArray(c)?c.some(s):Object.keys(c).some(d=>s(c[d],d)))},every:function(c,s){return!c||(Array.isArray(c)?c.every(s):Object.keys(c).every(d=>s(c[d],d)))},map:function(c,s){return c?Array.isArray(c)?c.map(s):Object.keys(c).map(d=>s(c[d],d)):[]},keyBy:(c,s)=>c.reduce((d,f)=>(d[f[s]]=f,d),{}),isEqual:function(c,s){const d=typeof c,f=typeof s,h=Array.isArray(c),m=Array.isArray(s);let p;if(d!==f)return!1;switch(typeof c){case"object":if(h||m)return!(!h||!m)&&c.length===s.length&&c.every((x,g)=>{const y=s[g];return u.isEqual(x,y)});if(c===null||s===null)return c===s;if(p=Object.keys(c),Object.keys(s).length!==p.length)return!1;for(const x of p)if(!s.hasOwnProperty(x))return!1;return u.every(c,(x,g)=>{const y=s[g];return u.isEqual(x,y)});default:return c===s}},escapeHtml(c){const s=o.exec(c);if(!s)return c;let d="",f="",h=0,m=s.index;for(;m":f=">";break;default:continue}h!==m&&(d+=c.substring(h,m)),h=m+1,d+=f}return h!==m?d+c.substring(h,m):d},strcmp:(c,s)=>cs?1:0,isUndefined:c=>i.call(c)==="[object Undefined]",isObject:c=>i.call(c)==="[object Object]",deepMerge(){const c=arguments[0]||{},{length:s}=arguments;let d,f,h;function m(p,x){d=c[x],h=Array.isArray(p),u.isObject(p)||h?(h?(h=!1,f=d&&Array.isArray(d)?d:[]):f=d&&u.isObject(d)?d:{},c[x]=u.deepMerge(f,p)):u.isUndefined(p)||(c[x]=p)}for(let p=0;p&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,s={nop(){},promiseImmediate:d=>new Promise(f=>{i.setImmediate?o(()=>{f(d)}):setTimeout(()=>{f(d)},1)}),inherits:function(d,f,h,m){d.super_=f,m||(m=h,h=null),h&&Object.keys(h).forEach(x=>{Object.defineProperty(d,x,Object.getOwnPropertyDescriptor(h,x))});const p={constructor:{value:d,enumerable:!1,writable:!1,configurable:!0}};m&&Object.keys(m).forEach(x=>{p[x]=Object.getOwnPropertyDescriptor(m,x)}),d.prototype=Object.create(f.prototype,p)},dateToExcel:(d,f)=>25569+d.getTime()/864e5-(f?1462:0),excelToDate(d,f){const h=Math.round(24*(d-25569+(f?1462:0))*3600*1e3);return new Date(h)},parsePath(d){const f=d.lastIndexOf("/");return{path:d.substring(0,f),name:d.substring(f+1)}},getRelsPath(d){const f=s.parsePath(d);return`${f.path}/_rels/${f.name}.rels`},xmlEncode(d){const f=c.exec(d);if(!f)return d;let h="",m="",p=0,x=f.index;for(;x=11&&g!==13)){m="";break}continue}p!==x&&(h+=d.substring(p,x)),p=x+1,m&&(h+=m)}return p!==x?h+d.substring(p,x):h},xmlDecode:d=>d.replace(/&([a-z]*);/g,f=>{switch(f){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case""":return'"';default:return f}}),validInt(d){const f=parseInt(d,10);return Number.isNaN(f)?0:f},isDateFmt(d){return d?(d=(d=d.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/)!==null:!1},fs:{exists:d=>new Promise(f=>{u.access(d,u.constants.F_OK,h=>{f(!h)})})},toIsoDateString:d=>d.toIsoString().subsstr(0,10),parseBoolean:d=>d===!0||d==="true"||d===1||d==="1"};n.exports=s}).call(this)}).call(this,typeof Jt<"u"?Jt:typeof self<"u"?self:typeof window<"u"?window:{},t("timers").setImmediate)},{fs:216,timers:523}],28:[function(t,n,l){const i=t("./under-dash"),o=t("./utils");function u(d,f,h){d.push(` ${f}="${o.xmlEncode(h.toString())}"`)}function c(d,f){if(f){const h=[];i.each(f,(m,p)=>{m!==void 0&&u(h,p,m)}),d.push(h.join(""))}}class s{constructor(){this._xml=[],this._stack=[],this._rollbacks=[]}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._xml.length}openXml(f){const h=this._xml;h.push(" `)}openNode(f,h){const m=this.tos,p=this._xml;m&&this.open&&p.push(">"),this._stack.push(f),p.push("<"),p.push(f),c(p,h),this.leaf=!0,this.open=!0}addAttribute(f,h){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");h!==void 0&&u(this._xml,f,h)}addAttributes(f){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");c(this._xml,f)}writeText(f){const h=this._xml;this.open&&(h.push(">"),this.open=!1),this.leaf=!1,h.push(o.xmlEncode(f.toString()))}writeXml(f){this.open&&(this._xml.push(">"),this.open=!1),this.leaf=!1,this._xml.push(f)}closeNode(){const f=this._stack.pop(),h=this._xml;this.leaf?h.push("/>"):(h.push("")),this.open=!1,this.leaf=!1}leafNode(f,h,m){this.openNode(f,h),m!==void 0&&this.writeText(m),this.closeNode()}closeAll(){for(;this._stack.length;)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){const f=this._rollbacks.pop();this._xml.length>f.xml&&this._xml.splice(f.xml,this._xml.length-f.xml),this._stack.length>f.stack&&this._stack.splice(f.stack,this._stack.length-f.stack),this.leaf=f.leaf,this.open=f.open}get xml(){return this.closeAll(),this._xml.join("")}}s.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"},n.exports=s},{"./under-dash":26,"./utils":27}],29:[function(t,n,l){(function(i){(function(){const o=t("events"),u=t("jszip"),c=t("./stream-buf"),{stringToBuffer:s}=t("./browser-buffer-encode");class d extends o.EventEmitter{constructor(h){super(),this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},h),this.zip=new u,this.stream=new c}append(h,m){m.hasOwnProperty("base64")&&m.base64?this.zip.file(m.name,h,{base64:!0}):(i.browser&&typeof h=="string"&&(h=s(h)),this.zip.file(m.name,h))}async finalize(){const h=await this.zip.generateAsync(this.options);this.stream.end(h),this.emit("finish")}read(h){return this.stream.read(h)}setEncoding(h){return this.stream.setEncoding(h)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(h,m){return this.stream.pipe(h,m)}unpipe(h){return this.stream.unpipe(h)}unshift(h){return this.stream.unshift(h)}wrap(h){return this.stream.wrap(h)}}n.exports={ZipWriter:d}}).call(this)}).call(this,t("_process"))},{"./browser-buffer-encode":17,"./stream-buf":24,_process:467,events:422,jszip:441}],30:[function(t,n,l){n.exports={0:{f:"General"},1:{f:"0"},2:{f:"0.00"},3:{f:"#,##0"},4:{f:"#,##0.00"},9:{f:"0%"},10:{f:"0.00%"},11:{f:"0.00E+00"},12:{f:"# ?/?"},13:{f:"# ??/??"},14:{f:"mm-dd-yy"},15:{f:"d-mmm-yy"},16:{f:"d-mmm"},17:{f:"mmm-yy"},18:{f:"h:mm AM/PM"},19:{f:"h:mm:ss AM/PM"},20:{f:"h:mm"},21:{f:"h:mm:ss"},22:{f:'m/d/yy "h":mm'},27:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},28:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},29:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},30:{"zh-tw":"m/d/yy ","zh-cn":"m-d-yy","ja-jp":"m/d/yy","ko-kr":"mm-dd-yy"},31:{"zh-tw":'yyyy"年"m"月"d"日"',"zh-cn":'yyyy"年"m"月"d"日"',"ja-jp":'yyyy"年"m"月"d"日"',"ko-kr":'yyyy"년" mm"월" dd"일"'},32:{"zh-tw":'hh"時"mm"分"',"zh-cn":'h"时"mm"分"',"ja-jp":'h"時"mm"分"',"ko-kr":'h"시" mm"분"'},33:{"zh-tw":'hh"時"mm"分"ss"秒"',"zh-cn":'h"时"mm"分"ss"秒"',"ja-jp":'h"時"mm"分"ss"秒"',"ko-kr":'h"시" mm"분" ss"초"'},34:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},35:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},36:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},37:{f:"#,##0 ;(#,##0)"},38:{f:"#,##0 ;[Red](#,##0)"},39:{f:"#,##0.00 ;(#,##0.00)"},40:{f:"#,##0.00 ;[Red](#,##0.00)"},45:{f:"mm:ss"},46:{f:"[h]:mm:ss"},47:{f:"mmss.0"},48:{f:"##0.0E+0"},49:{f:"@"},50:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},51:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},52:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'yyyy"年"m"月"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},53:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'m"月"d"日"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},54:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},55:{"zh-tw":'上午/下午 hh"時"mm"分"',"zh-cn":'上午/下午 h"时"mm"分"',"ja-jp":'yyyy"年"m"月"',"ko-kr":"yyyy-mm-dd"},56:{"zh-tw":'上午/下午 hh"時"mm"分"ss"秒"',"zh-cn":'上午/下午 h"时"mm"分"ss"秒"',"ja-jp":'m"月"d"日"',"ko-kr":"yyyy-mm-dd"},57:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"年"m"月"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"年" mm"月" dd"日"'},58:{"zh-tw":'[$-404]e"年"m"月"d"日"',"zh-cn":'m"月"d"日"',"ja-jp":'[$-411]ggge"年"m"月"d"日"',"ko-kr":"mm-dd"},59:{"th-th":"t0"},60:{"th-th":"t0.00"},61:{"th-th":"t#,##0"},62:{"th-th":"t#,##0.00"},67:{"th-th":"t0%"},68:{"th-th":"t0.00%"},69:{"th-th":"t# ?/?"},70:{"th-th":"t# ??/??"},81:{"th-th":"d/m/bb"}}},{}],31:[function(t,n,l){n.exports={OfficeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Worksheet:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",CalcChain:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain",SharedStrings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",Image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",CoreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",ExtenderProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",Comments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",VmlDrawing:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Table:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"}},{}],32:[function(t,n,l){const i=t("../../utils/parse-sax"),o=t("../../utils/xml-stream");class u{prepare(){}render(){}parseOpen(s){}parseText(s){}parseClose(s){}reconcile(s,d){}reset(){this.model=null,this.map&&Object.values(this.map).forEach(s=>{s instanceof u?s.reset():s.xform&&s.xform.reset()})}mergeModel(s){this.model=Object.assign(this.model||{},s)}async parse(s){for await(const d of s)for(const{eventType:f,value:h}of d)if(f==="opentag")this.parseOpen(h);else if(f==="text")this.parseText(h);else if(f==="closetag"&&!this.parseClose(h.name))return this.model;return this.model}async parseStream(s){return this.parse(i(s))}get xml(){return this.toXml(this.model)}toXml(s){const d=new o;return this.render(d,s),d.xml}static toAttribute(s,d){let f=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(s===void 0){if(f)return d}else if(f||s!==d)return s.toString()}static toStringAttribute(s,d){let f=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return u.toAttribute(s,d,f)}static toStringValue(s,d){return s===void 0?d:s}static toBoolAttribute(s,d){let f=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(s===void 0){if(f)return d}else if(f||s!==d)return s?"1":"0"}static toBoolValue(s,d){return s===void 0?d:s==="1"}static toIntAttribute(s,d){let f=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return u.toAttribute(s,d,f)}static toIntValue(s,d){return s===void 0?d:parseInt(s,10)}static toFloatAttribute(s,d){let f=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return u.toAttribute(s,d,f)}static toFloatValue(s,d){return s===void 0?d:parseFloat(s)}}n.exports=u},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(t,n,l){const i=t("../base-xform"),o=t("../../../utils/col-cache");function u(s){try{return o.decodeEx(s),!0}catch{return!1}}function c(s){const d=[];let f=!1,h="";return s.split(",").forEach(m=>{if(!m)return;const p=(m.match(/'/g)||[]).length;if(!p)return void(f?h+=m+",":u(m)&&d.push(m));const x=p%2==0;!f&&x&&u(m)?d.push(m):f&&!x?(f=!1,u(h+m)&&d.push(h+m),h=""):(f=!0,h+=m+",")}),d}n.exports=class extends i{render(s,d){s.openNode("definedName",{name:d.name,localSheetId:d.localSheetId}),s.writeText(d.ranges.join(",")),s.closeNode()}parseOpen(s){return s.name==="definedName"?(this._parsedName=s.attributes.name,this._parsedLocalSheetId=s.attributes.localSheetId,this._parsedText=[],!0):!1}parseText(s){this._parsedText.push(s)}parseClose(){return this.model={name:this._parsedName,ranges:c(this._parsedText.join(""))},this._parsedLocalSheetId!==void 0&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}}},{"../../../utils/col-cache":19,"../base-xform":32}],34:[function(t,n,l){const i=t("../../../utils/utils"),o=t("../base-xform");n.exports=class extends o{render(u,c){u.leafNode("sheet",{sheetId:c.id,name:c.name,state:c.state,"r:id":c.rId})}parseOpen(u){return u.name==="sheet"&&(this.model={name:i.xmlDecode(u.attributes.name),id:parseInt(u.attributes.sheetId,10),state:u.attributes.state,rId:u.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/utils":27,"../base-xform":32}],35:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{render(o,u){o.leafNode("calcPr",{calcId:171027,fullCalcOnLoad:u.fullCalcOnLoad?1:void 0})}parseOpen(o){return o.name==="calcPr"&&(this.model={},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],36:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{render(o,u){o.leafNode("workbookPr",{date1904:u.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(o){return o.name==="workbookPr"&&(this.model={date1904:o.attributes.date1904==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],37:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{render(o,u){const c={xWindow:u.x||0,yWindow:u.y||0,windowWidth:u.width||12e3,windowHeight:u.height||24e3,firstSheet:u.firstSheet,activeTab:u.activeTab};u.visibility&&u.visibility!=="visible"&&(c.visibility=u.visibility),o.leafNode("workbookView",c)}parseOpen(o){if(o.name==="workbookView"){const u=this.model={},c=function(d,f,h){const m=f!==void 0?u[d]=f:h;m!==void 0&&(u[d]=m)},s=function(d,f,h){const m=f!==void 0?u[d]=parseInt(f,10):h;m!==void 0&&(u[d]=m)};return s("x",o.attributes.xWindow,0),s("y",o.attributes.yWindow,0),s("width",o.attributes.windowWidth,25e3),s("height",o.attributes.windowHeight,1e4),c("visibility",o.attributes.visibility,"visible"),s("activeTab",o.attributes.activeTab,void 0),s("firstSheet",o.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],38:[function(t,n,l){const i=t("../../../utils/under-dash"),o=t("../../../utils/col-cache"),u=t("../../../utils/xml-stream"),c=t("../base-xform"),s=t("../static-xform"),d=t("../list-xform"),f=t("./defined-name-xform"),h=t("./sheet-xform"),m=t("./workbook-view-xform"),p=t("./workbook-properties-xform"),x=t("./workbook-calc-properties-xform");class g extends c{constructor(){super(),this.map={fileVersion:g.STATIC_XFORMS.fileVersion,workbookPr:new p,bookViews:new d({tag:"bookViews",count:!1,childXform:new m}),sheets:new d({tag:"sheets",count:!1,childXform:new h}),definedNames:new d({tag:"definedNames",count:!1,childXform:new f}),calcPr:new x}}prepare(v){v.sheets=v.worksheets;const _=[];let C=0;v.sheets.forEach(M=>{if(M.pageSetup&&M.pageSetup.printArea&&M.pageSetup.printArea.split("&&").forEach(T=>{const U=T.split(":"),F={name:"_xlnm.Print_Area",ranges:[`'${M.name}'!$${U[0]}:$${U[1]}`],localSheetId:C};_.push(F)}),M.pageSetup&&(M.pageSetup.printTitlesRow||M.pageSetup.printTitlesColumn)){const T=[];if(M.pageSetup.printTitlesColumn){const F=M.pageSetup.printTitlesColumn.split(":");T.push(`'${M.name}'!$${F[0]}:$${F[1]}`)}if(M.pageSetup.printTitlesRow){const F=M.pageSetup.printTitlesRow.split(":");T.push(`'${M.name}'!$${F[0]}:$${F[1]}`)}const U={name:"_xlnm.Print_Titles",ranges:T,localSheetId:C};_.push(U)}C++}),_.length&&(v.definedNames=v.definedNames.concat(_)),(v.media||[]).forEach((M,T)=>{M.name=M.type+(T+1)})}render(v,_){v.openXml(u.StdDocAttributes),v.openNode("workbook",g.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(v),this.map.workbookPr.render(v,_.properties),this.map.bookViews.render(v,_.views),this.map.sheets.render(v,_.sheets),this.map.definedNames.render(v,_.definedNames),this.map.calcPr.render(v,_.calcProperties),v.closeNode()}parseOpen(v){return this.parser?(this.parser.parseOpen(v),!0):(v.name==="workbook"||(this.parser=this.map[v.name],this.parser&&this.parser.parseOpen(v)),!0)}parseText(v){this.parser&&this.parser.parseText(v)}parseClose(v){return this.parser?(this.parser.parseClose(v)||(this.parser=void 0),!0):v==="workbook"?(this.model={sheets:this.map.sheets.model,properties:this.map.workbookPr.model||{},views:this.map.bookViews.model,calcProperties:{}},this.map.definedNames.model&&(this.model.definedNames=this.map.definedNames.model),!1):!0}reconcile(v){const _=(v.workbookRels||[]).reduce((F,H)=>(F[H.Id]=H,F),{}),C=[];let M,T=0;(v.sheets||[]).forEach(F=>{const H=_[F.rId];H&&(M=v.worksheetHash["xl/"+H.Target.replace(/^(\s|\/xl\/)+/,"")],M&&(M.name=F.name,M.id=F.id,M.state=F.state,C[T++]=M))});const U=[];i.each(v.definedNames,F=>{if(F.name==="_xlnm.Print_Area"){if(M=C[F.localSheetId],M){M.pageSetup||(M.pageSetup={});const H=o.decodeEx(F.ranges[0]);M.pageSetup.printArea=M.pageSetup.printArea?`${M.pageSetup.printArea}&&${H.dimensions}`:H.dimensions}}else if(F.name==="_xlnm.Print_Titles"){if(M=C[F.localSheetId],M){M.pageSetup||(M.pageSetup={});const H=F.ranges.join(","),W=/\$/g,K=/\$\d+:\$\d+/,$=H.match(K);if($&&$.length){const E=$[0];M.pageSetup.printTitlesRow=E.replace(W,"")}const P=/\$[A-Z]+:\$[A-Z]+/,L=H.match(P);if(L&&L.length){const E=L[0];M.pageSetup.printTitlesColumn=E.replace(W,"")}}}else U.push(F)}),v.definedNames=U,v.media.forEach((F,H)=>{F.index=H})}}g.WORKBOOK_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x15","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},g.STATIC_XFORMS={fileVersion:new s({tag:"fileVersion",$:{appName:"xl",lastEdited:5,lowestEdited:5,rupBuild:9303}})},n.exports=g},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./defined-name-xform":33,"./sheet-xform":34,"./workbook-calc-properties-xform":35,"./workbook-properties-xform":36,"./workbook-view-xform":37}],39:[function(t,n,l){const i=t("../strings/rich-text-xform"),o=t("../../../utils/utils"),u=t("../base-xform"),c=n.exports=function(s){this.model=s};o.inherits(c,u,{get tag(){return"r"},get richTextXform(){return this._richTextXform||(this._richTextXform=new i),this._richTextXform},render(s,d){d=d||this.model,s.openNode("comment",{ref:d.ref,authorId:0}),s.openNode("text"),d&&d.note&&d.note.texts&&d.note.texts.forEach(f=>{this.richTextXform.render(s,f)}),s.closeNode(),s.closeNode()},parseOpen(s){if(this.parser)return this.parser.parseOpen(s),!0;switch(s.name){case"comment":return this.model={type:"note",note:{texts:[]},...s.attributes},!0;case"r":return this.parser=this.richTextXform,this.parser.parseOpen(s),!0;default:return!1}},parseText(s){this.parser&&this.parser.parseText(s)},parseClose(s){switch(s){case"comment":return!1;case"r":return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(s),!0}}})},{"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],40:[function(t,n,l){const i=t("../../../utils/xml-stream"),o=t("../../../utils/utils"),u=t("../base-xform"),c=t("./comment-xform"),s=n.exports=function(){this.map={comment:new c}};o.inherits(s,u,{COMMENTS_ATTRIBUTES:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},{render(d,f){f=f||this.model,d.openXml(i.StdDocAttributes),d.openNode("comments",s.COMMENTS_ATTRIBUTES),d.openNode("authors"),d.leafNode("author",null,"Author"),d.closeNode(),d.openNode("commentList"),f.comments.forEach(h=>{this.map.comment.render(d,h)}),d.closeNode(),d.closeNode()},parseOpen(d){if(this.parser)return this.parser.parseOpen(d),!0;switch(d.name){case"commentList":return this.model={comments:[]},!0;case"comment":return this.parser=this.map.comment,this.parser.parseOpen(d),!0;default:return!1}},parseText(d){this.parser&&this.parser.parseText(d)},parseClose(d){switch(d){case"commentList":return!1;case"comment":return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(d),!0}}})},{"../../../utils/utils":27,"../../../utils/xml-stream":28,"../base-xform":32,"./comment-xform":39}],41:[function(t,n,l){const i=t("../../base-xform");n.exports=class extends i{constructor(o){super(),this._model=o}get tag(){return this._model&&this._model.tag}render(o,u,c){(u===c[2]||this.tag==="x:SizeWithCells"&&u===c[1])&&o.leafNode(this.tag)}parseOpen(o){return o.name===this.tag?(this.model={},this.model[this.tag]=!0,!0):!1}parseText(){}parseClose(){return!1}}},{"../../base-xform":32}],42:[function(t,n,l){const i=t("../../base-xform");n.exports=class extends i{constructor(o){super(),this._model=o}get tag(){return this._model&&this._model.tag}render(o,u){o.leafNode(this.tag,null,u)}parseOpen(o){return o.name===this.tag?(this.text="",!0):!1}parseText(o){this.text=o}parseClose(){return!1}}},{"../../base-xform":32}],43:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"x:Anchor"}getAnchorRect(o){const u=Math.floor(o.left),c=Math.floor(68*(o.left-u)),s=Math.floor(o.top),d=Math.floor(18*(o.top-s)),f=Math.floor(o.right),h=Math.floor(68*(o.right-f)),m=Math.floor(o.bottom);return[u,c,s,d,f,h,m,Math.floor(18*(o.bottom-m))]}getDefaultRect(o){const u=o.col,c=Math.max(o.row-2,0);return[u,6,c,14,u+2,2,c+4,16]}render(o,u){const c=u.anchor?this.getAnchorRect(u.anchor):this.getDefaultRect(u.refAddress);o.leafNode("x:Anchor",null,c.join(", "))}parseOpen(o){return o.name===this.tag?(this.text="",!0):!1}parseText(o){this.text=o}parseClose(){return!1}}},{"../base-xform":32}],44:[function(t,n,l){const i=t("../base-xform"),o=t("./vml-anchor-xform"),u=t("./style/vml-protection-xform"),c=t("./style/vml-position-xform"),s=["twoCells","oneCells","absolute"];n.exports=class extends i{constructor(){super(),this.map={"x:Anchor":new o,"x:Locked":new u({tag:"x:Locked"}),"x:LockText":new u({tag:"x:LockText"}),"x:SizeWithCells":new c({tag:"x:SizeWithCells"}),"x:MoveWithCells":new c({tag:"x:MoveWithCells"})}}get tag(){return"x:ClientData"}render(d,f){const{protection:h,editAs:m}=f.note;d.openNode(this.tag,{ObjectType:"Note"}),this.map["x:MoveWithCells"].render(d,m,s),this.map["x:SizeWithCells"].render(d,m,s),this.map["x:Anchor"].render(d,f),this.map["x:Locked"].render(d,h.locked),d.leafNode("x:AutoFill",null,"False"),this.map["x:LockText"].render(d,h.lockText),d.leafNode("x:Row",null,f.refAddress.row-1),d.leafNode("x:Column",null,f.refAddress.col-1),d.closeNode()}parseOpen(d){return d.name===this.tag?(this.reset(),this.model={anchor:[],protection:{},editAs:""}):(this.parser=this.map[d.name],this.parser&&this.parser.parseOpen(d)),!0}parseText(d){this.parser&&this.parser.parseText(d)}parseClose(d){return this.parser?(this.parser.parseClose(d)||(this.parser=void 0),!0):d===this.tag?(this.normalizeModel(),!1):!0}normalizeModel(){const d=Object.assign({},this.map["x:MoveWithCells"].model,this.map["x:SizeWithCells"].model),f=Object.keys(d).length;this.model.editAs=s[f],this.model.anchor=this.map["x:Anchor"].text,this.model.protection.locked=this.map["x:Locked"].text,this.model.protection.lockText=this.map["x:LockText"].text}}},{"../base-xform":32,"./style/vml-position-xform":41,"./style/vml-protection-xform":42,"./vml-anchor-xform":43}],45:[function(t,n,l){const i=t("../../../utils/xml-stream"),o=t("../base-xform"),u=t("./vml-shape-xform");class c extends o{constructor(){super(),this.map={"v:shape":new u}}get tag(){return"xml"}render(d,f){d.openXml(i.StdDocAttributes),d.openNode(this.tag,c.DRAWING_ATTRIBUTES),d.openNode("o:shapelayout",{"v:ext":"edit"}),d.leafNode("o:idmap",{"v:ext":"edit",data:1}),d.closeNode(),d.openNode("v:shapetype",{id:"_x0000_t202",coordsize:"21600,21600","o:spt":202,path:"m,l,21600r21600,l21600,xe"}),d.leafNode("v:stroke",{joinstyle:"miter"}),d.leafNode("v:path",{gradientshapeok:"t","o:connecttype":"rect"}),d.closeNode(),f.comments.forEach((h,m)=>{this.map["v:shape"].render(d,h,m)}),d.closeNode()}parseOpen(d){return this.parser?(this.parser.parseOpen(d),!0):(d.name===this.tag?(this.reset(),this.model={comments:[]}):(this.parser=this.map[d.name],this.parser&&this.parser.parseOpen(d)),!0)}parseText(d){this.parser&&this.parser.parseText(d)}parseClose(d){return this.parser?(this.parser.parseClose(d)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0):d!==this.tag}reconcile(d,f){d.anchors.forEach(h=>{h.br?this.map["xdr:twoCellAnchor"].reconcile(h,f):this.map["xdr:oneCellAnchor"].reconcile(h,f)})}}c.DRAWING_ATTRIBUTES={"xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:x":"urn:schemas-microsoft-com:office:excel"},n.exports=c},{"../../../utils/xml-stream":28,"../base-xform":32,"./vml-shape-xform":46}],46:[function(t,n,l){const i=t("../base-xform"),o=t("./vml-textbox-xform"),u=t("./vml-client-data-xform");class c extends i{constructor(){super(),this.map={"v:textbox":new o,"x:ClientData":new u}}get tag(){return"v:shape"}render(d,f,h){d.openNode("v:shape",c.V_SHAPE_ATTRIBUTES(f,h)),d.leafNode("v:fill",{color2:"infoBackground [80]"}),d.leafNode("v:shadow",{color:"none [81]",obscured:"t"}),d.leafNode("v:path",{"o:connecttype":"none"}),this.map["v:textbox"].render(d,f),this.map["x:ClientData"].render(d,f),d.closeNode()}parseOpen(d){return this.parser?(this.parser.parseOpen(d),!0):(d.name===this.tag?(this.reset(),this.model={margins:{insetmode:d.attributes["o:insetmode"]},anchor:"",editAs:"",protection:{}}):(this.parser=this.map[d.name],this.parser&&this.parser.parseOpen(d)),!0)}parseText(d){this.parser&&this.parser.parseText(d)}parseClose(d){return this.parser?(this.parser.parseClose(d)||(this.parser=void 0),!0):d===this.tag?(this.model.margins.inset=this.map["v:textbox"].model&&this.map["v:textbox"].model.inset,this.model.protection=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.protection,this.model.anchor=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.anchor,this.model.editAs=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.editAs,!1):!0}}c.V_SHAPE_ATTRIBUTES=(s,d)=>({id:"_x0000_s"+(1025+d),type:"#_x0000_t202",style:"position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden",fillcolor:"infoBackground [80]",strokecolor:"none [81]","o:insetmode":s.note.margins&&s.note.margins.insetmode}),n.exports=c},{"../base-xform":32,"./vml-client-data-xform":44,"./vml-textbox-xform":47}],47:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"v:textbox"}conversionUnit(o,u,c){return`${parseFloat(o)*u.toFixed(2)}${c}`}reverseConversionUnit(o){return(o||"").split(",").map(u=>Number(parseFloat(this.conversionUnit(parseFloat(u),.1,"")).toFixed(2)))}render(o,u){const c={style:"mso-direction-alt:auto"};if(u&&u.note){let{inset:s}=u.note&&u.note.margins;Array.isArray(s)&&(s=s.map(d=>this.conversionUnit(d,10,"mm")).join(",")),s&&(c.inset=s)}o.openNode("v:textbox",c),o.leafNode("div",{style:"text-align:left"}),o.closeNode()}parseOpen(o){return o.name===this.tag&&(this.model={inset:this.reverseConversionUnit(o.attributes.inset)}),!0}parseText(){}parseClose(o){return o!==this.tag}}},{"../base-xform":32}],48:[function(t,n,l){const i=t("./base-xform");n.exports=class extends i{createNewModel(o){return{}}parseOpen(o){return this.parser=this.parser||this.map[o.name],this.parser?(this.parser.parseOpen(o),!0):o.name===this.tag&&(this.model=this.createNewModel(o),!0)}parseText(o){this.parser&&this.parser.parseText(o)}onParserClose(o,u){this.model[o]=u.model}parseClose(o){return this.parser?(this.parser.parseClose(o)||(this.onParserClose(o,this.parser),this.parser=void 0),!0):o!==this.tag}}},{"./base-xform":32}],49:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{render(o,u){o.openNode("HeadingPairs"),o.openNode("vt:vector",{size:2,baseType:"variant"}),o.openNode("vt:variant"),o.leafNode("vt:lpstr",void 0,"Worksheets"),o.closeNode(),o.openNode("vt:variant"),o.leafNode("vt:i4",void 0,u.length),o.closeNode(),o.closeNode(),o.closeNode()}parseOpen(o){return o.name==="HeadingPairs"}parseText(){}parseClose(o){return o!=="HeadingPairs"}}},{"../base-xform":32}],50:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{render(o,u){o.openNode("TitlesOfParts"),o.openNode("vt:vector",{size:u.length,baseType:"lpstr"}),u.forEach(c=>{o.leafNode("vt:lpstr",void 0,c.name)}),o.closeNode(),o.closeNode()}parseOpen(o){return o.name==="TitlesOfParts"}parseText(){}parseClose(o){return o!=="TitlesOfParts"}}},{"../base-xform":32}],51:[function(t,n,l){const i=t("../../../utils/xml-stream"),o=t("../base-xform"),u=t("../simple/string-xform"),c=t("./app-heading-pairs-xform"),s=t("./app-titles-of-parts-xform");class d extends o{constructor(){super(),this.map={Company:new u({tag:"Company"}),Manager:new u({tag:"Manager"}),HeadingPairs:new c,TitleOfParts:new s}}render(h,m){h.openXml(i.StdDocAttributes),h.openNode("Properties",d.PROPERTY_ATTRIBUTES),h.leafNode("Application",void 0,"Microsoft Excel"),h.leafNode("DocSecurity",void 0,"0"),h.leafNode("ScaleCrop",void 0,"false"),this.map.HeadingPairs.render(h,m.worksheets),this.map.TitleOfParts.render(h,m.worksheets),this.map.Company.render(h,m.company||""),this.map.Manager.render(h,m.manager),h.leafNode("LinksUpToDate",void 0,"false"),h.leafNode("SharedDoc",void 0,"false"),h.leafNode("HyperlinksChanged",void 0,"false"),h.leafNode("AppVersion",void 0,"16.0300"),h.closeNode()}parseOpen(h){return this.parser?(this.parser.parseOpen(h),!0):h.name==="Properties"?!0:(this.parser=this.map[h.name],!!this.parser&&(this.parser.parseOpen(h),!0))}parseText(h){this.parser&&this.parser.parseText(h)}parseClose(h){return this.parser?(this.parser.parseClose(h)||(this.parser=void 0),!0):h==="Properties"?(this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1):!0}}d.DateFormat=function(f){return f.toISOString().replace(/[.]\d{3,6}/,"")},d.DateAttrs={"xsi:type":"dcterms:W3CDTF"},d.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},n.exports=d},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/string-xform":119,"./app-heading-pairs-xform":49,"./app-titles-of-parts-xform":50}],52:[function(t,n,l){const i=t("../../../utils/xml-stream"),o=t("../base-xform");class u extends o{render(s,d){s.openXml(i.StdDocAttributes),s.openNode("Types",u.PROPERTY_ATTRIBUTES);const f={};(d.media||[]).forEach(h=>{if(h.type==="image"){const m=h.extension;f[m]||(f[m]=!0,s.leafNode("Default",{Extension:m,ContentType:"image/"+m}))}}),s.leafNode("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),s.leafNode("Default",{Extension:"xml",ContentType:"application/xml"}),s.leafNode("Override",{PartName:"/xl/workbook.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}),d.worksheets.forEach(h=>{const m=`/xl/worksheets/sheet${h.id}.xml`;s.leafNode("Override",{PartName:m,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"})}),s.leafNode("Override",{PartName:"/xl/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"}),s.leafNode("Override",{PartName:"/xl/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"}),d.sharedStrings&&d.sharedStrings.count&&s.leafNode("Override",{PartName:"/xl/sharedStrings.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"}),d.tables&&d.tables.forEach(h=>{s.leafNode("Override",{PartName:"/xl/tables/"+h.target,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"})}),d.drawings&&d.drawings.forEach(h=>{s.leafNode("Override",{PartName:`/xl/drawings/${h.name}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"})}),d.commentRefs&&(s.leafNode("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),d.commentRefs.forEach(h=>{let{commentName:m}=h;s.leafNode("Override",{PartName:`/xl/${m}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"})})),s.leafNode("Override",{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"}),s.leafNode("Override",{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"}),s.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}}u.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},n.exports=u},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(t,n,l){const i=t("../../../utils/xml-stream"),o=t("../base-xform"),u=t("../simple/date-xform"),c=t("../simple/string-xform"),s=t("../simple/integer-xform");class d extends o{constructor(){super(),this.map={"dc:creator":new c({tag:"dc:creator"}),"dc:title":new c({tag:"dc:title"}),"dc:subject":new c({tag:"dc:subject"}),"dc:description":new c({tag:"dc:description"}),"dc:identifier":new c({tag:"dc:identifier"}),"dc:language":new c({tag:"dc:language"}),"cp:keywords":new c({tag:"cp:keywords"}),"cp:category":new c({tag:"cp:category"}),"cp:lastModifiedBy":new c({tag:"cp:lastModifiedBy"}),"cp:lastPrinted":new u({tag:"cp:lastPrinted",format:d.DateFormat}),"cp:revision":new s({tag:"cp:revision"}),"cp:version":new c({tag:"cp:version"}),"cp:contentStatus":new c({tag:"cp:contentStatus"}),"cp:contentType":new c({tag:"cp:contentType"}),"dcterms:created":new u({tag:"dcterms:created",attrs:d.DateAttrs,format:d.DateFormat}),"dcterms:modified":new u({tag:"dcterms:modified",attrs:d.DateAttrs,format:d.DateFormat})}}render(h,m){h.openXml(i.StdDocAttributes),h.openNode("cp:coreProperties",d.CORE_PROPERTY_ATTRIBUTES),this.map["dc:creator"].render(h,m.creator),this.map["dc:title"].render(h,m.title),this.map["dc:subject"].render(h,m.subject),this.map["dc:description"].render(h,m.description),this.map["dc:identifier"].render(h,m.identifier),this.map["dc:language"].render(h,m.language),this.map["cp:keywords"].render(h,m.keywords),this.map["cp:category"].render(h,m.category),this.map["cp:lastModifiedBy"].render(h,m.lastModifiedBy),this.map["cp:lastPrinted"].render(h,m.lastPrinted),this.map["cp:revision"].render(h,m.revision),this.map["cp:version"].render(h,m.version),this.map["cp:contentStatus"].render(h,m.contentStatus),this.map["cp:contentType"].render(h,m.contentType),this.map["dcterms:created"].render(h,m.created),this.map["dcterms:modified"].render(h,m.modified),h.closeNode()}parseOpen(h){if(this.parser)return this.parser.parseOpen(h),!0;switch(h.name){case"cp:coreProperties":case"coreProperties":return!0;default:if(this.parser=this.map[h.name],this.parser)return this.parser.parseOpen(h),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(h))}}parseText(h){this.parser&&this.parser.parseText(h)}parseClose(h){if(this.parser)return this.parser.parseClose(h)||(this.parser=void 0),!0;switch(h){case"cp:coreProperties":case"coreProperties":return this.model={creator:this.map["dc:creator"].model,title:this.map["dc:title"].model,subject:this.map["dc:subject"].model,description:this.map["dc:description"].model,identifier:this.map["dc:identifier"].model,language:this.map["dc:language"].model,keywords:this.map["cp:keywords"].model,category:this.map["cp:category"].model,lastModifiedBy:this.map["cp:lastModifiedBy"].model,lastPrinted:this.map["cp:lastPrinted"].model,revision:this.map["cp:revision"].model,contentStatus:this.map["cp:contentStatus"].model,contentType:this.map["cp:contentType"].model,created:this.map["dcterms:created"].model,modified:this.map["dcterms:modified"].model},!1;default:throw new Error("Unexpected xml node in parseClose: "+h)}}}d.DateFormat=function(f){return f.toISOString().replace(/[.]\d{3}/,"")},d.DateAttrs={"xsi:type":"dcterms:W3CDTF"},d.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:dcterms":"http://purl.org/dc/terms/","xmlns:dcmitype":"http://purl.org/dc/dcmitype/","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance"},n.exports=d},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/date-xform":117,"../simple/integer-xform":118,"../simple/string-xform":119}],54:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{render(o,u){o.leafNode("Relationship",u)}parseOpen(o){return o.name==="Relationship"?(this.model=o.attributes,!0):!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],55:[function(t,n,l){const i=t("../../../utils/xml-stream"),o=t("../base-xform"),u=t("./relationship-xform");class c extends o{constructor(){super(),this.map={Relationship:new u}}render(d,f){f=f||this._values,d.openXml(i.StdDocAttributes),d.openNode("Relationships",c.RELATIONSHIPS_ATTRIBUTES),f.forEach(h=>{this.map.Relationship.render(d,h)}),d.closeNode()}parseOpen(d){if(this.parser)return this.parser.parseOpen(d),!0;switch(d.name){case"Relationships":return this.model=[],!0;default:if(this.parser=this.map[d.name],this.parser)return this.parser.parseOpen(d),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(d))}}parseText(d){this.parser&&this.parser.parseText(d)}parseClose(d){if(this.parser)return this.parser.parseClose(d)||(this.model.push(this.parser.model),this.parser=void 0),!0;if(d==="Relationships")return!1;throw new Error("Unexpected xml node in parseClose: "+d)}}c.RELATIONSHIPS_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},n.exports=c},{"../../../utils/xml-stream":28,"../base-xform":32,"./relationship-xform":54}],56:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{parseOpen(o){return this.parser?(this.parser.parseOpen(o),!0):(o.name===this.tag?(this.reset(),this.model={range:{editAs:o.attributes.editAs||"oneCell"}}):(this.parser=this.map[o.name],this.parser&&this.parser.parseOpen(o)),!0)}parseText(o){this.parser&&this.parser.parseText(o)}reconcilePicture(o,u){if(o&&o.rId){const c=u.rels[o.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(c){const s=c[1],d=u.mediaIndex[s];return u.media[d]}}}}},{"../base-xform":32}],57:[function(t,n,l){const i=t("../base-xform"),o=t("./blip-xform");n.exports=class extends i{constructor(){super(),this.map={"a:blip":new o}}get tag(){return"xdr:blipFill"}render(u,c){u.openNode(this.tag),this.map["a:blip"].render(u,c),u.openNode("a:stretch"),u.leafNode("a:fillRect"),u.closeNode(),u.closeNode()}parseOpen(u){return this.parser?(this.parser.parseOpen(u),!0):(u.name===this.tag?this.reset():(this.parser=this.map[u.name],this.parser&&this.parser.parseOpen(u)),!0)}parseText(){}parseClose(u){return this.parser?(this.parser.parseClose(u)||(this.parser=void 0),!0):u===this.tag?(this.model=this.map["a:blip"].model,!1):!0}}},{"../base-xform":32,"./blip-xform":58}],58:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"a:blip"}render(o,u){o.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:embed":u.rId,cstate:"print"})}parseOpen(o){return o.name===this.tag&&(this.model={rId:o.attributes["r:embed"]}),!0}parseText(){}parseClose(o){return o!==this.tag}}},{"../base-xform":32}],59:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"xdr:cNvPicPr"}render(o){o.openNode(this.tag),o.leafNode("a:picLocks",{noChangeAspect:"1"}),o.closeNode()}parseOpen(o){switch(o.name){case this.tag:default:return!0}}parseText(){}parseClose(o){return o!==this.tag}}},{"../base-xform":32}],60:[function(t,n,l){const i=t("../base-xform"),o=t("./hlink-click-xform"),u=t("./ext-lst-xform");n.exports=class extends i{constructor(){super(),this.map={"a:hlinkClick":new o,"a:extLst":new u}}get tag(){return"xdr:cNvPr"}render(c,s){c.openNode(this.tag,{id:s.index,name:"Picture "+s.index}),this.map["a:hlinkClick"].render(c,s),this.map["a:extLst"].render(c,s),c.closeNode()}parseOpen(c){return this.parser?(this.parser.parseOpen(c),!0):(c.name===this.tag?this.reset():(this.parser=this.map[c.name],this.parser&&this.parser.parseOpen(c)),!0)}parseText(){}parseClose(c){return this.parser?(this.parser.parseClose(c)||(this.parser=void 0),!0):c===this.tag?(this.model=this.map["a:hlinkClick"].model,!1):!0}}},{"../base-xform":32,"./ext-lst-xform":63,"./hlink-click-xform":65}],61:[function(t,n,l){const i=t("../base-xform"),o=t("../simple/integer-xform");n.exports=class extends i{constructor(u){super(),this.tag=u.tag,this.map={"xdr:col":new o({tag:"xdr:col",zero:!0}),"xdr:colOff":new o({tag:"xdr:colOff",zero:!0}),"xdr:row":new o({tag:"xdr:row",zero:!0}),"xdr:rowOff":new o({tag:"xdr:rowOff",zero:!0})}}render(u,c){u.openNode(this.tag),this.map["xdr:col"].render(u,c.nativeCol),this.map["xdr:colOff"].render(u,c.nativeColOff),this.map["xdr:row"].render(u,c.nativeRow),this.map["xdr:rowOff"].render(u,c.nativeRowOff),u.closeNode()}parseOpen(u){return this.parser?(this.parser.parseOpen(u),!0):(u.name===this.tag?this.reset():(this.parser=this.map[u.name],this.parser&&this.parser.parseOpen(u)),!0)}parseText(u){this.parser&&this.parser.parseText(u)}parseClose(u){return this.parser?(this.parser.parseClose(u)||(this.parser=void 0),!0):u===this.tag?(this.model={nativeCol:this.map["xdr:col"].model,nativeColOff:this.map["xdr:colOff"].model,nativeRow:this.map["xdr:row"].model,nativeRowOff:this.map["xdr:rowOff"].model},!1):!0}}},{"../base-xform":32,"../simple/integer-xform":118}],62:[function(t,n,l){const i=t("../../../utils/col-cache"),o=t("../../../utils/xml-stream"),u=t("../base-xform"),c=t("./two-cell-anchor-xform"),s=t("./one-cell-anchor-xform");class d extends u{constructor(){super(),this.map={"xdr:twoCellAnchor":new c,"xdr:oneCellAnchor":new s}}prepare(h){h.anchors.forEach((m,p)=>{m.anchorType=(function(x){return(typeof x.range=="string"?i.decode(x.range):x.range).br?"xdr:twoCellAnchor":"xdr:oneCellAnchor"})(m),this.map[m.anchorType].prepare(m,{index:p})})}get tag(){return"xdr:wsDr"}render(h,m){h.openXml(o.StdDocAttributes),h.openNode(this.tag,d.DRAWING_ATTRIBUTES),m.anchors.forEach(p=>{this.map[p.anchorType].render(h,p)}),h.closeNode()}parseOpen(h){return this.parser?(this.parser.parseOpen(h),!0):(h.name===this.tag?(this.reset(),this.model={anchors:[]}):(this.parser=this.map[h.name],this.parser&&this.parser.parseOpen(h)),!0)}parseText(h){this.parser&&this.parser.parseText(h)}parseClose(h){return this.parser?(this.parser.parseClose(h)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0):h!==this.tag}reconcile(h,m){h.anchors.forEach(p=>{p.br?this.map["xdr:twoCellAnchor"].reconcile(p,m):this.map["xdr:oneCellAnchor"].reconcile(p,m)})}}d.DRAWING_ATTRIBUTES={"xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main"},n.exports=d},{"../../../utils/col-cache":19,"../../../utils/xml-stream":28,"../base-xform":32,"./one-cell-anchor-xform":67,"./two-cell-anchor-xform":70}],63:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"a:extLst"}render(o){o.openNode(this.tag),o.openNode("a:ext",{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}),o.leafNode("a16:creationId",{"xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main",id:"{00000000-0008-0000-0000-000002000000}"}),o.closeNode(),o.closeNode()}parseOpen(o){switch(o.name){case this.tag:default:return!0}}parseText(){}parseClose(o){return o!==this.tag}}},{"../base-xform":32}],64:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{constructor(o){super(),this.tag=o.tag,this.map={}}render(o,u){o.openNode(this.tag);const c=Math.floor(9525*u.width),s=Math.floor(9525*u.height);o.addAttribute("cx",c),o.addAttribute("cy",s),o.closeNode()}parseOpen(o){return o.name===this.tag&&(this.model={width:parseInt(o.attributes.cx||"0",10)/9525,height:parseInt(o.attributes.cy||"0",10)/9525},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],65:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"a:hlinkClick"}render(o,u){u.hyperlinks&&u.hyperlinks.rId&&o.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:id":u.hyperlinks.rId,tooltip:u.hyperlinks.tooltip})}parseOpen(o){return o.name===this.tag&&(this.model={hyperlinks:{rId:o.attributes["r:id"],tooltip:o.attributes.tooltip}}),!0}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],66:[function(t,n,l){const i=t("../base-xform"),o=t("./c-nv-pr-xform"),u=t("./c-nv-pic-pr-xform");n.exports=class extends i{constructor(){super(),this.map={"xdr:cNvPr":new o,"xdr:cNvPicPr":new u}}get tag(){return"xdr:nvPicPr"}render(c,s){c.openNode(this.tag),this.map["xdr:cNvPr"].render(c,s),this.map["xdr:cNvPicPr"].render(c,s),c.closeNode()}parseOpen(c){return this.parser?(this.parser.parseOpen(c),!0):(c.name===this.tag?this.reset():(this.parser=this.map[c.name],this.parser&&this.parser.parseOpen(c)),!0)}parseText(){}parseClose(c){return this.parser?(this.parser.parseClose(c)||(this.parser=void 0),!0):c===this.tag?(this.model=this.map["xdr:cNvPr"].model,!1):!0}}},{"../base-xform":32,"./c-nv-pic-pr-xform":59,"./c-nv-pr-xform":60}],67:[function(t,n,l){const i=t("./base-cell-anchor-xform"),o=t("../static-xform"),u=t("./cell-position-xform"),c=t("./ext-xform"),s=t("./pic-xform");n.exports=class extends i{constructor(){super(),this.map={"xdr:from":new u({tag:"xdr:from"}),"xdr:ext":new c({tag:"xdr:ext"}),"xdr:pic":new s,"xdr:clientData":new o({tag:"xdr:clientData"})}}get tag(){return"xdr:oneCellAnchor"}prepare(d,f){this.map["xdr:pic"].prepare(d.picture,f)}render(d,f){d.openNode(this.tag,{editAs:f.range.editAs||"oneCell"}),this.map["xdr:from"].render(d,f.range.tl),this.map["xdr:ext"].render(d,f.range.ext),this.map["xdr:pic"].render(d,f.picture),this.map["xdr:clientData"].render(d,{}),d.closeNode()}parseClose(d){return this.parser?(this.parser.parseClose(d)||(this.parser=void 0),!0):d===this.tag?(this.model.range.tl=this.map["xdr:from"].model,this.model.range.ext=this.map["xdr:ext"].model,this.model.picture=this.map["xdr:pic"].model,!1):!0}reconcile(d,f){d.medium=this.reconcilePicture(d.picture,f)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./ext-xform":64,"./pic-xform":68}],68:[function(t,n,l){const i=t("../base-xform"),o=t("../static-xform"),u=t("./blip-fill-xform"),c=t("./nv-pic-pr-xform"),s=t("./sp-pr");n.exports=class extends i{constructor(){super(),this.map={"xdr:nvPicPr":new c,"xdr:blipFill":new u,"xdr:spPr":new o(s)}}get tag(){return"xdr:pic"}prepare(d,f){d.index=f.index+1}render(d,f){d.openNode(this.tag),this.map["xdr:nvPicPr"].render(d,f),this.map["xdr:blipFill"].render(d,f),this.map["xdr:spPr"].render(d,f),d.closeNode()}parseOpen(d){return this.parser?(this.parser.parseOpen(d),!0):(d.name===this.tag?this.reset():(this.parser=this.map[d.name],this.parser&&this.parser.parseOpen(d)),!0)}parseText(){}parseClose(d){return this.parser?(this.parser.parseClose(d)||(this.mergeModel(this.parser.model),this.parser=void 0),!0):d!==this.tag}}},{"../base-xform":32,"../static-xform":120,"./blip-fill-xform":57,"./nv-pic-pr-xform":66,"./sp-pr":69}],69:[function(t,n,l){n.exports={tag:"xdr:spPr",c:[{tag:"a:xfrm",c:[{tag:"a:off",$:{x:"0",y:"0"}},{tag:"a:ext",$:{cx:"0",cy:"0"}}]},{tag:"a:prstGeom",$:{prst:"rect"},c:[{tag:"a:avLst"}]}]}},{}],70:[function(t,n,l){const i=t("./base-cell-anchor-xform"),o=t("../static-xform"),u=t("./cell-position-xform"),c=t("./pic-xform");n.exports=class extends i{constructor(){super(),this.map={"xdr:from":new u({tag:"xdr:from"}),"xdr:to":new u({tag:"xdr:to"}),"xdr:pic":new c,"xdr:clientData":new o({tag:"xdr:clientData"})}}get tag(){return"xdr:twoCellAnchor"}prepare(s,d){this.map["xdr:pic"].prepare(s.picture,d)}render(s,d){s.openNode(this.tag,{editAs:d.range.editAs||"oneCell"}),this.map["xdr:from"].render(s,d.range.tl),this.map["xdr:to"].render(s,d.range.br),this.map["xdr:pic"].render(s,d.picture),this.map["xdr:clientData"].render(s,{}),s.closeNode()}parseClose(s){return this.parser?(this.parser.parseClose(s)||(this.parser=void 0),!0):s===this.tag?(this.model.range.tl=this.map["xdr:from"].model,this.model.range.br=this.map["xdr:to"].model,this.model.picture=this.map["xdr:pic"].model,!1):!0}reconcile(s,d){s.medium=this.reconcilePicture(s.picture,d)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./pic-xform":68}],71:[function(t,n,l){const i=t("./base-xform");n.exports=class extends i{constructor(o){super(),this.tag=o.tag,this.always=!!o.always,this.count=o.count,this.empty=o.empty,this.$count=o.$count||"count",this.$=o.$,this.childXform=o.childXform,this.maxItems=o.maxItems}prepare(o,u){const{childXform:c}=this;o&&o.forEach((s,d)=>{u.index=d,c.prepare(s,u)})}render(o,u){if(this.always||u&&u.length){o.openNode(this.tag,this.$),this.count&&o.addAttribute(this.$count,u&&u.length||0);const{childXform:c}=this;(u||[]).forEach((s,d)=>{c.render(o,s,d)}),o.closeNode()}else this.empty&&o.leafNode(this.tag)}parseOpen(o){return this.parser?(this.parser.parseOpen(o),!0):o.name===this.tag?(this.model=[],!0):!!this.childXform.parseOpen(o)&&(this.parser=this.childXform,!0)}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){if(this.parser){if(!this.parser.parseClose(o)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw new Error(`Max ${this.childXform.tag} count (${this.maxItems}) exceeded`);return!0}return!1}reconcile(o,u){if(o){const{childXform:c}=this;o.forEach(s=>{c.reconcile(s,u)})}}}},{"./base-xform":32}],72:[function(t,n,l){const i=t("../../../utils/col-cache"),o=t("../base-xform");n.exports=class extends o{get tag(){return"autoFilter"}render(u,c){if(c)if(typeof c=="string")u.leafNode("autoFilter",{ref:c});else{const s=function(h){return typeof h=="string"?h:i.getAddress(h.row,h.column).address},d=s(c.from),f=s(c.to);d&&f&&u.leafNode("autoFilter",{ref:`${d}:${f}`})}}parseOpen(u){u.name==="autoFilter"&&(this.model=u.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(t,n,l){const i=t("../../../utils/utils"),o=t("../base-xform"),u=t("../../../doc/range"),c=t("../../../doc/enums"),s=t("../strings/rich-text-xform");function d(f){if(f==null)return c.ValueType.Null;if(f instanceof String||typeof f=="string")return c.ValueType.String;if(typeof f=="number")return c.ValueType.Number;if(typeof f=="boolean")return c.ValueType.Boolean;if(f instanceof Date)return c.ValueType.Date;if(f.text&&f.hyperlink)return c.ValueType.Hyperlink;if(f.formula)return c.ValueType.Formula;if(f.error)return c.ValueType.Error;throw new Error("I could not understand type of value")}n.exports=class extends o{constructor(){super(),this.richTextXForm=new s}get tag(){return"c"}prepare(f,h){const m=h.styles.addStyleModel(f.style||{},(function(p){return p.type===c.ValueType.Formula?d(p.result):p.type})(f));switch(m&&(f.styleId=m),f.comment&&h.comments.push({...f.comment,ref:f.address}),f.type){case c.ValueType.String:case c.ValueType.RichText:h.sharedStrings&&(f.ssId=h.sharedStrings.add(f.value));break;case c.ValueType.Date:h.date1904&&(f.date1904=!0);break;case c.ValueType.Hyperlink:h.sharedStrings&&f.text!==void 0&&f.text!==null&&(f.ssId=h.sharedStrings.add(f.text)),h.hyperlinks.push({address:f.address,target:f.hyperlink,tooltip:f.tooltip});break;case c.ValueType.Merge:h.merges.add(f);break;case c.ValueType.Formula:if(h.date1904&&(f.date1904=!0),f.shareType==="shared"&&(f.si=h.siFormulae++),f.formula)h.formulae[f.address]=f;else if(f.sharedFormula){const p=h.formulae[f.sharedFormula];if(!p)throw new Error("Shared Formula master must exist above and or left of clone for cell "+f.address);p.si===void 0?(p.shareType="shared",p.si=h.siFormulae++,p.range=new u(p.address,f.address)):p.range&&p.range.expandToAddress(f.address),f.si=p.si}}}renderFormula(f,h){let m=null;switch(h.shareType){case"shared":m={t:"shared",ref:h.ref||h.range.range,si:h.si};break;case"array":m={t:"array",ref:h.ref};break;default:h.si!==void 0&&(m={t:"shared",si:h.si})}switch(d(h.result)){case c.ValueType.Null:f.leafNode("f",m,h.formula);break;case c.ValueType.String:f.addAttribute("t","str"),f.leafNode("f",m,h.formula),f.leafNode("v",null,h.result);break;case c.ValueType.Number:f.leafNode("f",m,h.formula),f.leafNode("v",null,h.result);break;case c.ValueType.Boolean:f.addAttribute("t","b"),f.leafNode("f",m,h.formula),f.leafNode("v",null,h.result?1:0);break;case c.ValueType.Error:f.addAttribute("t","e"),f.leafNode("f",m,h.formula),f.leafNode("v",null,h.result.error);break;case c.ValueType.Date:f.leafNode("f",m,h.formula),f.leafNode("v",null,i.dateToExcel(h.result,h.date1904));break;default:throw new Error("I could not understand type of value")}}render(f,h){if(h.type!==c.ValueType.Null||h.styleId){switch(f.openNode("c"),f.addAttribute("r",h.address),h.styleId&&f.addAttribute("s",h.styleId),h.type){case c.ValueType.Null:break;case c.ValueType.Number:f.leafNode("v",null,h.value);break;case c.ValueType.Boolean:f.addAttribute("t","b"),f.leafNode("v",null,h.value?"1":"0");break;case c.ValueType.Error:f.addAttribute("t","e"),f.leafNode("v",null,h.value.error);break;case c.ValueType.String:case c.ValueType.RichText:h.ssId!==void 0?(f.addAttribute("t","s"),f.leafNode("v",null,h.ssId)):h.value&&h.value.richText?(f.addAttribute("t","inlineStr"),f.openNode("is"),h.value.richText.forEach(m=>{this.richTextXForm.render(f,m)}),f.closeNode("is")):(f.addAttribute("t","str"),f.leafNode("v",null,h.value));break;case c.ValueType.Date:f.leafNode("v",null,i.dateToExcel(h.value,h.date1904));break;case c.ValueType.Hyperlink:h.ssId!==void 0?(f.addAttribute("t","s"),f.leafNode("v",null,h.ssId)):(f.addAttribute("t","str"),f.leafNode("v",null,h.text));break;case c.ValueType.Formula:this.renderFormula(f,h);break;case c.ValueType.Merge:}f.closeNode()}}parseOpen(f){if(this.parser)return this.parser.parseOpen(f),!0;switch(f.name){case"c":return this.model={address:f.attributes.r},this.t=f.attributes.t,f.attributes.s&&(this.model.styleId=parseInt(f.attributes.s,10)),!0;case"f":return this.currentNode="f",this.model.si=f.attributes.si,this.model.shareType=f.attributes.t,this.model.ref=f.attributes.ref,!0;case"v":return this.currentNode="v",!0;case"t":return this.currentNode="t",!0;case"r":return this.parser=this.richTextXForm,this.parser.parseOpen(f),!0;default:return!1}}parseText(f){if(this.parser)this.parser.parseText(f);else switch(this.currentNode){case"f":this.model.formula=this.model.formula?this.model.formula+f:f;break;case"v":case"t":this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+f:f:this.model.value=this.model.value?this.model.value+f:f}}parseClose(f){switch(f){case"c":{const{model:h}=this;if(h.formula||h.shareType)h.type=c.ValueType.Formula,h.value&&(this.t==="str"?h.result=i.xmlDecode(h.value):this.t==="b"?h.result=parseInt(h.value,10)!==0:this.t==="e"?h.result={error:h.value}:h.result=parseFloat(h.value),h.value=void 0);else if(h.value!==void 0)switch(this.t){case"s":h.type=c.ValueType.String,h.value=parseInt(h.value,10);break;case"str":h.type=c.ValueType.String,h.value=i.xmlDecode(h.value);break;case"inlineStr":h.type=c.ValueType.String;break;case"b":h.type=c.ValueType.Boolean,h.value=parseInt(h.value,10)!==0;break;case"e":h.type=c.ValueType.Error,h.value={error:h.value};break;default:h.type=c.ValueType.Number,h.value=parseFloat(h.value)}else h.styleId?h.type=c.ValueType.Null:h.type=c.ValueType.Merge;return!1}case"f":case"v":case"is":return this.currentNode=void 0,!0;case"t":return this.parser?(this.parser.parseClose(f),!0):(this.currentNode=void 0,!0);case"r":return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText||[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return!!this.parser&&(this.parser.parseClose(f),!0)}}reconcile(f,h){const m=f.styleId&&h.styles&&h.styles.getStyleModel(f.styleId);switch(m&&(f.style=m),f.styleId!==void 0&&(f.styleId=void 0),f.type){case c.ValueType.String:typeof f.value=="number"&&h.sharedStrings&&(f.value=h.sharedStrings.getString(f.value)),f.value.richText&&(f.type=c.ValueType.RichText);break;case c.ValueType.Number:m&&i.isDateFmt(m.numFmt)&&(f.type=c.ValueType.Date,f.value=i.excelToDate(f.value,h.date1904));break;case c.ValueType.Formula:f.result!==void 0&&m&&i.isDateFmt(m.numFmt)&&(f.result=i.excelToDate(f.result,h.date1904)),f.shareType==="shared"&&(f.ref?h.formulae[f.si]=f.address:(f.sharedFormula=h.formulae[f.si],delete f.shareType),delete f.si)}const p=h.hyperlinkMap[f.address];p&&(f.type===c.ValueType.Formula?(f.text=f.result,f.result=void 0):(f.text=f.value,f.value=void 0),f.type=c.ValueType.Hyperlink,f.hyperlink=p);const x=h.commentsMap&&h.commentsMap[f.address];x&&(f.comment=x)}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],74:[function(t,n,l){const i=t("../../base-xform");n.exports=class extends i{get tag(){return"x14:cfIcon"}render(o,u){o.leafNode(this.tag,{iconSet:u.iconSet,iconId:u.iconId})}parseOpen(o){let{attributes:u}=o;this.model={iconSet:u.iconSet,iconId:i.toIntValue(u.iconId)}}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],75:[function(t,n,l){const{v4:i}=t("uuid"),o=t("../../base-xform"),u=t("../../composite-xform"),c=t("./databar-ext-xform"),s=t("./icon-set-ext-xform"),d={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class f extends u{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new c,"x14:iconSet":this.iconSetXform=new s}}get tag(){return"x14:cfRule"}static isExt(m){return m.type==="dataBar"?c.isExt(m):!(m.type!=="iconSet"||!m.custom&&!d[m.iconSet])}prepare(m){f.isExt(m)&&(m.x14Id=`{${i()}}`.toUpperCase())}render(m,p){if(f.isExt(p))switch(p.type){case"dataBar":this.renderDataBar(m,p);break;case"iconSet":this.renderIconSet(m,p)}}renderDataBar(m,p){m.openNode(this.tag,{type:"dataBar",id:p.x14Id}),this.databarXform.render(m,p),m.closeNode()}renderIconSet(m,p){m.openNode(this.tag,{type:"iconSet",priority:p.priority,id:p.x14Id||`{${i()}}`}),this.iconSetXform.render(m,p),m.closeNode()}createNewModel(m){let{attributes:p}=m;return{type:p.type,x14Id:p.id,priority:o.toIntValue(p.priority)}}onParserClose(m,p){Object.assign(this.model,p.model)}}n.exports=f},{"../../base-xform":32,"../../composite-xform":48,"./databar-ext-xform":79,"./icon-set-ext-xform":81,uuid:528}],76:[function(t,n,l){const i=t("../../composite-xform"),o=t("./f-ext-xform");n.exports=class extends i{constructor(){super(),this.map={"xm:f":this.fExtXform=new o}}get tag(){return"x14:cfvo"}render(u,c){u.openNode(this.tag,{type:c.type}),c.value!==void 0&&this.fExtXform.render(u,c.value),u.closeNode()}createNewModel(u){return{type:u.attributes.type}}onParserClose(u,c){u==="xm:f"&&(this.model.value=c.model?parseFloat(c.model):0)}}},{"../../composite-xform":48,"./f-ext-xform":80}],77:[function(t,n,l){const i=t("../../composite-xform"),o=t("./sqref-ext-xform"),u=t("./cf-rule-ext-xform");n.exports=class extends i{constructor(){super(),this.map={"xm:sqref":this.sqRef=new o,"x14:cfRule":this.cfRule=new u}}get tag(){return"x14:conditionalFormatting"}prepare(c,s){c.rules.forEach(d=>{this.cfRule.prepare(d,s)})}render(c,s){s.rules.some(u.isExt)&&(c.openNode(this.tag,{"xmlns:xm":"http://schemas.microsoft.com/office/excel/2006/main"}),s.rules.filter(u.isExt).forEach(d=>this.cfRule.render(c,d)),this.sqRef.render(c,s.ref),c.closeNode())}createNewModel(){return{rules:[]}}onParserClose(c,s){switch(c){case"xm:sqref":this.model.ref=s.model;break;case"x14:cfRule":this.model.rules.push(s.model)}}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./sqref-ext-xform":82}],78:[function(t,n,l){const i=t("../../composite-xform"),o=t("./cf-rule-ext-xform"),u=t("./conditional-formatting-ext-xform");n.exports=class extends i{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new u}}get tag(){return"x14:conditionalFormattings"}hasContent(c){return c.hasExtContent===void 0&&(c.hasExtContent=c.some(s=>s.rules.some(o.isExt))),c.hasExtContent}prepare(c,s){c.forEach(d=>{this.cfXform.prepare(d,s)})}render(c,s){this.hasContent(s)&&(c.openNode(this.tag),s.forEach(d=>this.cfXform.render(c,d)),c.closeNode())}createNewModel(){return[]}onParserClose(c,s){this.model.push(s.model)}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./conditional-formatting-ext-xform":77}],79:[function(t,n,l){const i=t("../../base-xform"),o=t("../../composite-xform"),u=t("../../style/color-xform"),c=t("./cfvo-ext-xform");n.exports=class extends o{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new c,"x14:borderColor":this.borderColorXform=new u("x14:borderColor"),"x14:negativeBorderColor":this.negativeBorderColorXform=new u("x14:negativeBorderColor"),"x14:negativeFillColor":this.negativeFillColorXform=new u("x14:negativeFillColor"),"x14:axisColor":this.axisColorXform=new u("x14:axisColor")}}static isExt(s){return!s.gradient}get tag(){return"x14:dataBar"}render(s,d){s.openNode(this.tag,{minLength:i.toIntAttribute(d.minLength,0,!0),maxLength:i.toIntAttribute(d.maxLength,100,!0),border:i.toBoolAttribute(d.border,!1),gradient:i.toBoolAttribute(d.gradient,!0),negativeBarColorSameAsPositive:i.toBoolAttribute(d.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:i.toBoolAttribute(d.negativeBarBorderColorSameAsPositive,!0),axisPosition:i.toAttribute(d.axisPosition,"auto"),direction:i.toAttribute(d.direction,"leftToRight")}),d.cfvo.forEach(f=>{this.cfvoXform.render(s,f)}),this.borderColorXform.render(s,d.borderColor),this.negativeBorderColorXform.render(s,d.negativeBorderColor),this.negativeFillColorXform.render(s,d.negativeFillColor),this.axisColorXform.render(s,d.axisColor),s.closeNode()}createNewModel(s){let{attributes:d}=s;return{cfvo:[],minLength:i.toIntValue(d.minLength,0),maxLength:i.toIntValue(d.maxLength,100),border:i.toBoolValue(d.border,!1),gradient:i.toBoolValue(d.gradient,!0),negativeBarColorSameAsPositive:i.toBoolValue(d.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:i.toBoolValue(d.negativeBarBorderColorSameAsPositive,!0),axisPosition:i.toStringValue(d.axisPosition,"auto"),direction:i.toStringValue(d.direction,"leftToRight")}}onParserClose(s,d){const[,f]=s.split(":");f==="cfvo"?this.model.cfvo.push(d.model):this.model[f]=d.model}}},{"../../base-xform":32,"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-ext-xform":76}],80:[function(t,n,l){const i=t("../../base-xform");n.exports=class extends i{get tag(){return"xm:f"}render(o,u){o.leafNode(this.tag,null,u)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],81:[function(t,n,l){const i=t("../../base-xform"),o=t("../../composite-xform"),u=t("./cfvo-ext-xform"),c=t("./cf-icon-ext-xform");n.exports=class extends o{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new u,"x14:cfIcon":this.cfIconXform=new c}}get tag(){return"x14:iconSet"}render(s,d){s.openNode(this.tag,{iconSet:i.toStringAttribute(d.iconSet),reverse:i.toBoolAttribute(d.reverse,!1),showValue:i.toBoolAttribute(d.showValue,!0),custom:i.toBoolAttribute(d.icons,!1)}),d.cfvo.forEach(f=>{this.cfvoXform.render(s,f)}),d.icons&&d.icons.forEach((f,h)=>{f.iconId=h,this.cfIconXform.render(s,f)}),s.closeNode()}createNewModel(s){let{attributes:d}=s;return{cfvo:[],iconSet:i.toStringValue(d.iconSet,"3TrafficLights"),reverse:i.toBoolValue(d.reverse,!1),showValue:i.toBoolValue(d.showValue,!0)}}onParserClose(s,d){const[,f]=s.split(":");switch(f){case"cfvo":this.model.cfvo.push(d.model);break;case"cfIcon":this.model.icons||(this.model.icons=[]),this.model.icons.push(d.model);break;default:this.model[f]=d.model}}}},{"../../base-xform":32,"../../composite-xform":48,"./cf-icon-ext-xform":74,"./cfvo-ext-xform":76}],82:[function(t,n,l){const i=t("../../base-xform");n.exports=class extends i{get tag(){return"xm:sqref"}render(o,u){o.leafNode(this.tag,null,u)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],83:[function(t,n,l){const i=t("../../base-xform"),o=t("../../composite-xform"),u=t("../../../../doc/range"),c=t("./databar-xform"),s=t("./ext-lst-ref-xform"),d=t("./formula-xform"),f=t("./color-scale-xform"),h=t("./icon-set-xform"),m={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},p=g=>{const{type:y,operator:v}=g;switch(y){case"containsText":case"containsBlanks":case"notContainsBlanks":case"containsErrors":case"notContainsErrors":return{type:"containsText",operator:y};default:return{type:y,operator:v}}};class x extends o{constructor(){super(),this.map={dataBar:this.databarXform=new c,extLst:this.extLstRefXform=new s,formula:this.formulaXform=new d,colorScale:this.colorScaleXform=new f,iconSet:this.iconSetXform=new h}}get tag(){return"cfRule"}static isPrimitive(y){return y.type!=="iconSet"||!y.custom&&!m[y.iconSet]}render(y,v){switch(v.type){case"expression":this.renderExpression(y,v);break;case"cellIs":this.renderCellIs(y,v);break;case"top10":this.renderTop10(y,v);break;case"aboveAverage":this.renderAboveAverage(y,v);break;case"dataBar":this.renderDataBar(y,v);break;case"colorScale":this.renderColorScale(y,v);break;case"iconSet":this.renderIconSet(y,v);break;case"containsText":this.renderText(y,v);break;case"timePeriod":this.renderTimePeriod(y,v)}}renderExpression(y,v){y.openNode(this.tag,{type:"expression",dxfId:v.dxfId,priority:v.priority}),this.formulaXform.render(y,v.formulae[0]),y.closeNode()}renderCellIs(y,v){y.openNode(this.tag,{type:"cellIs",dxfId:v.dxfId,priority:v.priority,operator:v.operator}),v.formulae.forEach(_=>{this.formulaXform.render(y,_)}),y.closeNode()}renderTop10(y,v){y.leafNode(this.tag,{type:"top10",dxfId:v.dxfId,priority:v.priority,percent:i.toBoolAttribute(v.percent,!1),bottom:i.toBoolAttribute(v.bottom,!1),rank:i.toIntValue(v.rank,10,!0)})}renderAboveAverage(y,v){y.leafNode(this.tag,{type:"aboveAverage",dxfId:v.dxfId,priority:v.priority,aboveAverage:i.toBoolAttribute(v.aboveAverage,!0)})}renderDataBar(y,v){y.openNode(this.tag,{type:"dataBar",priority:v.priority}),this.databarXform.render(y,v),this.extLstRefXform.render(y,v),y.closeNode()}renderColorScale(y,v){y.openNode(this.tag,{type:"colorScale",priority:v.priority}),this.colorScaleXform.render(y,v),y.closeNode()}renderIconSet(y,v){x.isPrimitive(v)&&(y.openNode(this.tag,{type:"iconSet",priority:v.priority}),this.iconSetXform.render(y,v),y.closeNode())}renderText(y,v){y.openNode(this.tag,{type:v.operator,dxfId:v.dxfId,priority:v.priority,operator:i.toStringAttribute(v.operator,"containsText")});const _=(C=>{if(C.formulae&&C.formulae[0])return C.formulae[0];const M=new u(C.ref),{tl:T}=M;switch(C.operator){case"containsText":return`NOT(ISERROR(SEARCH("${C.text}",${T})))`;case"containsBlanks":return`LEN(TRIM(${T}))=0`;case"notContainsBlanks":return`LEN(TRIM(${T}))>0`;case"containsErrors":return`ISERROR(${T})`;case"notContainsErrors":return`NOT(ISERROR(${T}))`;default:return}})(v);_&&this.formulaXform.render(y,_),y.closeNode()}renderTimePeriod(y,v){y.openNode(this.tag,{type:"timePeriod",dxfId:v.dxfId,priority:v.priority,timePeriod:v.timePeriod});const _=(C=>{if(C.formulae&&C.formulae[0])return C.formulae[0];const M=new u(C.ref),{tl:T}=M;switch(C.timePeriod){case"thisWeek":return`AND(TODAY()-ROUNDDOWN(${T},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${T},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case"lastWeek":return`AND(TODAY()-ROUNDDOWN(${T},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${T},0)<(WEEKDAY(TODAY())+7))`;case"nextWeek":return`AND(ROUNDDOWN(${T},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${T},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case"yesterday":return`FLOOR(${T},1)=TODAY()-1`;case"today":return`FLOOR(${T},1)=TODAY()`;case"tomorrow":return`FLOOR(${T},1)=TODAY()+1`;case"last7Days":return`AND(TODAY()-FLOOR(${T},1)<=6,FLOOR(${T},1)<=TODAY())`;case"lastMonth":return`AND(MONTH(${T})=MONTH(EDATE(TODAY(),0-1)),YEAR(${T})=YEAR(EDATE(TODAY(),0-1)))`;case"thisMonth":return`AND(MONTH(${T})=MONTH(TODAY()),YEAR(${T})=YEAR(TODAY()))`;case"nextMonth":return`AND(MONTH(${T})=MONTH(EDATE(TODAY(),0+1)),YEAR(${T})=YEAR(EDATE(TODAY(),0+1)))`;default:return}})(v);_&&this.formulaXform.render(y,_),y.closeNode()}createNewModel(y){let{attributes:v}=y;return{...p(v),dxfId:i.toIntValue(v.dxfId),priority:i.toIntValue(v.priority),timePeriod:v.timePeriod,percent:i.toBoolValue(v.percent),bottom:i.toBoolValue(v.bottom),rank:i.toIntValue(v.rank),aboveAverage:i.toBoolValue(v.aboveAverage)}}onParserClose(y,v){switch(y){case"dataBar":case"extLst":case"colorScale":case"iconSet":Object.assign(this.model,v.model);break;case"formula":this.model.formulae=this.model.formulae||[],this.model.formulae.push(v.model)}}}n.exports=x},{"../../../../doc/range":10,"../../base-xform":32,"../../composite-xform":48,"./color-scale-xform":85,"./databar-xform":88,"./ext-lst-ref-xform":89,"./formula-xform":90,"./icon-set-xform":91}],84:[function(t,n,l){const i=t("../../base-xform");n.exports=class extends i{get tag(){return"cfvo"}render(o,u){o.leafNode(this.tag,{type:u.type,val:u.value})}parseOpen(o){this.model={type:o.attributes.type,value:i.toFloatValue(o.attributes.val)}}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],85:[function(t,n,l){const i=t("../../composite-xform"),o=t("../../style/color-xform"),u=t("./cfvo-xform");n.exports=class extends i{constructor(){super(),this.map={cfvo:this.cfvoXform=new u,color:this.colorXform=new o}}get tag(){return"colorScale"}render(c,s){c.openNode(this.tag),s.cfvo.forEach(d=>{this.cfvoXform.render(c,d)}),s.color.forEach(d=>{this.colorXform.render(c,d)}),c.closeNode()}createNewModel(c){return{cfvo:[],color:[]}}onParserClose(c,s){this.model[c].push(s.model)}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],86:[function(t,n,l){const i=t("../../composite-xform"),o=t("./cf-rule-xform");n.exports=class extends i{constructor(){super(),this.map={cfRule:new o}}get tag(){return"conditionalFormatting"}render(u,c){c.rules.some(o.isPrimitive)&&(u.openNode(this.tag,{sqref:c.ref}),c.rules.forEach(s=>{o.isPrimitive(s)&&(s.ref=c.ref,this.map.cfRule.render(u,s))}),u.closeNode())}createNewModel(u){let{attributes:c}=u;return{ref:c.sqref,rules:[]}}onParserClose(u,c){this.model.rules.push(c.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(t,n,l){const i=t("../../base-xform"),o=t("./conditional-formatting-xform");n.exports=class extends i{constructor(){super(),this.cfXform=new o}get tag(){return"conditionalFormatting"}reset(){this.model=[]}prepare(u,c){let s=u.reduce((d,f)=>Math.max(d,...f.rules.map(h=>h.priority||0)),1);u.forEach(d=>{d.rules.forEach(f=>{f.priority||(f.priority=s++),f.style&&(f.dxfId=c.styles.addDxfStyle(f.style))})})}render(u,c){c.forEach(s=>{this.cfXform.render(u,s)})}parseOpen(u){return this.parser?(this.parser.parseOpen(u),!0):u.name==="conditionalFormatting"?(this.parser=this.cfXform,this.parser.parseOpen(u),!0):!1}parseText(u){this.parser&&this.parser.parseText(u)}parseClose(u){return!!this.parser&&(!!this.parser.parseClose(u)||(this.model.push(this.parser.model),this.parser=void 0,!1))}reconcile(u,c){u.forEach(s=>{s.rules.forEach(d=>{d.dxfId!==void 0&&(d.style=c.styles.getDxfStyle(d.dxfId),delete d.dxfId)})})}}},{"../../base-xform":32,"./conditional-formatting-xform":86}],88:[function(t,n,l){const i=t("../../composite-xform"),o=t("../../style/color-xform"),u=t("./cfvo-xform");n.exports=class extends i{constructor(){super(),this.map={cfvo:this.cfvoXform=new u,color:this.colorXform=new o}}get tag(){return"dataBar"}render(c,s){c.openNode(this.tag),s.cfvo.forEach(d=>{this.cfvoXform.render(c,d)}),this.colorXform.render(c,s.color),c.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(c,s){switch(c){case"cfvo":this.model.cfvo.push(s.model);break;case"color":this.model.color=s.model}}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],89:[function(t,n,l){const i=t("../../base-xform"),o=t("../../composite-xform");class u extends i{get tag(){return"x14:id"}render(d,f){d.leafNode(this.tag,null,f)}parseOpen(){this.model=""}parseText(d){this.model+=d}parseClose(d){return d!==this.tag}}class c extends o{constructor(){super(),this.map={"x14:id":this.idXform=new u}}get tag(){return"ext"}render(d,f){d.openNode(this.tag,{uri:"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.idXform.render(d,f.x14Id),d.closeNode()}createNewModel(){return{}}onParserClose(d,f){this.model.x14Id=f.model}}n.exports=class extends o{constructor(){super(),this.map={ext:new c}}get tag(){return"extLst"}render(s,d){s.openNode(this.tag),this.map.ext.render(s,d),s.closeNode()}createNewModel(){return{}}onParserClose(s,d){Object.assign(this.model,d.model)}}},{"../../base-xform":32,"../../composite-xform":48}],90:[function(t,n,l){const i=t("../../base-xform");n.exports=class extends i{get tag(){return"formula"}render(o,u){o.leafNode(this.tag,null,u)}parseOpen(){this.model=""}parseText(o){this.model+=o}parseClose(o){return o!==this.tag}}},{"../../base-xform":32}],91:[function(t,n,l){const i=t("../../base-xform"),o=t("../../composite-xform"),u=t("./cfvo-xform");n.exports=class extends o{constructor(){super(),this.map={cfvo:this.cfvoXform=new u}}get tag(){return"iconSet"}render(c,s){c.openNode(this.tag,{iconSet:i.toStringAttribute(s.iconSet,"3TrafficLights"),reverse:i.toBoolAttribute(s.reverse,!1),showValue:i.toBoolAttribute(s.showValue,!0)}),s.cfvo.forEach(d=>{this.cfvoXform.render(c,d)}),c.closeNode()}createNewModel(c){let{attributes:s}=c;return{iconSet:i.toStringValue(s.iconSet,"3TrafficLights"),reverse:i.toBoolValue(s.reverse),showValue:i.toBoolValue(s.showValue),cfvo:[]}}onParserClose(c,s){this.model[c].push(s.model)}}},{"../../base-xform":32,"../../composite-xform":48,"./cfvo-xform":84}],92:[function(t,n,l){const i=t("../../../utils/utils"),o=t("../base-xform");n.exports=class extends o{get tag(){return"col"}prepare(u,c){const s=c.styles.addStyleModel(u.style||{});s&&(u.styleId=s)}render(u,c){u.openNode("col"),u.addAttribute("min",c.min),u.addAttribute("max",c.max),c.width&&u.addAttribute("width",c.width),c.styleId&&u.addAttribute("style",c.styleId),c.hidden&&u.addAttribute("hidden","1"),c.bestFit&&u.addAttribute("bestFit","1"),c.outlineLevel&&u.addAttribute("outlineLevel",c.outlineLevel),c.collapsed&&u.addAttribute("collapsed","1"),u.addAttribute("customWidth","1"),u.closeNode()}parseOpen(u){if(u.name==="col"){const c=this.model={min:parseInt(u.attributes.min||"0",10),max:parseInt(u.attributes.max||"0",10),width:u.attributes.width===void 0?void 0:parseFloat(u.attributes.width||"0")};return u.attributes.style&&(c.styleId=parseInt(u.attributes.style,10)),i.parseBoolean(u.attributes.hidden)&&(c.hidden=!0),i.parseBoolean(u.attributes.bestFit)&&(c.bestFit=!0),u.attributes.outlineLevel&&(c.outlineLevel=parseInt(u.attributes.outlineLevel,10)),i.parseBoolean(u.attributes.collapsed)&&(c.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(u,c){u.styleId&&(u.style=c.styles.getStyleModel(u.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(t,n,l){const i=t("../../../utils/under-dash"),o=t("../../../utils/utils"),u=t("../../../utils/col-cache"),c=t("../base-xform"),s=t("../../../doc/range");function d(h,m,p,x){const g=m[p];g!==void 0?h[p]=g:x!==void 0&&(h[p]=x)}function f(h,m,p,x){const g=m[p];g!==void 0&&(h[p]=o.parseBoolean(g))}n.exports=class extends c{get tag(){return"dataValidations"}render(h,m){const p=(function(x){const g=i.map(x,(_,C)=>({address:C,dataValidation:_,marked:!1})).sort((_,C)=>i.strcmp(_.address,C.address)),y=i.keyBy(g,"address"),v=(_,C,M)=>{for(let T=0;T{if(!_.marked){const C=u.decodeEx(_.address);if(C.dimensions)return y[C.dimensions].marked=!0,{..._.dataValidation,sqref:_.address};let M=1,T=u.encodeAddress(C.row+M,C.col);for(;x[T]&&i.isEqual(_.dataValidation,x[T]);)M++,T=u.encodeAddress(C.row+M,C.col);let U=1;for(;v(C,M,C.col+U);)U++;for(let F=0;F1||U>1){const F=C.row+(M-1),H=C.col+(U-1);return{..._.dataValidation,sqref:`${_.address}:${u.encodeAddress(F,H)}`}}return{..._.dataValidation,sqref:_.address}}return null}).filter(Boolean)})(m);p.length&&(h.openNode("dataValidations",{count:p.length}),p.forEach(x=>{h.openNode("dataValidation"),x.type!=="any"&&(h.addAttribute("type",x.type),x.operator&&x.type!=="list"&&x.operator!=="between"&&h.addAttribute("operator",x.operator),x.allowBlank&&h.addAttribute("allowBlank","1")),x.showInputMessage&&h.addAttribute("showInputMessage","1"),x.promptTitle&&h.addAttribute("promptTitle",x.promptTitle),x.prompt&&h.addAttribute("prompt",x.prompt),x.showErrorMessage&&h.addAttribute("showErrorMessage","1"),x.errorStyle&&h.addAttribute("errorStyle",x.errorStyle),x.errorTitle&&h.addAttribute("errorTitle",x.errorTitle),x.error&&h.addAttribute("error",x.error),h.addAttribute("sqref",x.sqref),(x.formulae||[]).forEach((g,y)=>{h.openNode("formula"+(y+1)),x.type==="date"?h.writeText(o.dateToExcel(new Date(g))):h.writeText(g),h.closeNode()}),h.closeNode()}),h.closeNode())}parseOpen(h){switch(h.name){case"dataValidations":return this.model={},!0;case"dataValidation":{this._address=h.attributes.sqref;const m={type:h.attributes.type||"any",formulae:[]};switch(h.attributes.type&&f(m,h.attributes,"allowBlank"),f(m,h.attributes,"showInputMessage"),f(m,h.attributes,"showErrorMessage"),m.type){case"any":case"list":case"custom":break;default:d(m,h.attributes,"operator","between")}return d(m,h.attributes,"promptTitle"),d(m,h.attributes,"prompt"),d(m,h.attributes,"errorStyle"),d(m,h.attributes,"errorTitle"),d(m,h.attributes,"error"),this._dataValidation=m,!0}case"formula1":case"formula2":return this._formula=[],!0;default:return!1}}parseText(h){this._formula&&this._formula.push(h)}parseClose(h){switch(h){case"dataValidations":return!1;case"dataValidation":return this._dataValidation.formulae&&this._dataValidation.formulae.length||(delete this._dataValidation.formulae,delete this._dataValidation.operator),(this._address.split(/\s+/g)||[]).forEach(m=>{m.includes(":")?new s(m).forEachAddress(p=>{this.model[p]=this._dataValidation}):this.model[m]=this._dataValidation}),!0;case"formula1":case"formula2":{let m=this._formula.join("");switch(this._dataValidation.type){case"whole":case"textLength":m=parseInt(m,10);break;case"decimal":m=parseFloat(m);break;case"date":m=o.excelToDate(parseFloat(m))}return this._dataValidation.formulae.push(m),this._formula=void 0,!0}default:return!0}}}},{"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/utils":27,"../base-xform":32}],94:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"dimension"}render(o,u){u&&o.leafNode("dimension",{ref:u})}parseOpen(o){return o.name==="dimension"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],95:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"drawing"}render(o,u){u&&o.leafNode(this.tag,{"r:id":u.rId})}parseOpen(o){return o.name===this.tag?(this.model={rId:o.attributes["r:id"]},!0):!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],96:[function(t,n,l){const i=t("../composite-xform"),o=t("./cf-ext/conditional-formattings-ext-xform");class u extends i{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new o}}get tag(){return"ext"}hasContent(s){return this.conditionalFormattings.hasContent(s.conditionalFormattings)}prepare(s,d){this.conditionalFormattings.prepare(s.conditionalFormattings,d)}render(s,d){s.openNode("ext",{uri:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.conditionalFormattings.render(s,d.conditionalFormattings),s.closeNode()}createNewModel(){return{}}onParserClose(s,d){this.model[s]=d.model}}n.exports=class extends i{constructor(){super(),this.map={ext:this.ext=new u}}get tag(){return"extLst"}prepare(c,s){this.ext.prepare(c,s)}hasContent(c){return this.ext.hasContent(c)}render(c,s){this.hasContent(s)&&(c.openNode("extLst"),this.ext.render(c,s),c.closeNode())}createNewModel(){return{}}onParserClose(c,s){Object.assign(this.model,s.model)}}},{"../composite-xform":48,"./cf-ext/conditional-formattings-ext-xform":78}],97:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"headerFooter"}render(o,u){if(u){o.addRollback();let c=!1;o.openNode("headerFooter"),u.differentFirst&&(o.addAttribute("differentFirst","1"),c=!0),u.differentOddEven&&(o.addAttribute("differentOddEven","1"),c=!0),u.oddHeader&&typeof u.oddHeader=="string"&&(o.leafNode("oddHeader",null,u.oddHeader),c=!0),u.oddFooter&&typeof u.oddFooter=="string"&&(o.leafNode("oddFooter",null,u.oddFooter),c=!0),u.evenHeader&&typeof u.evenHeader=="string"&&(o.leafNode("evenHeader",null,u.evenHeader),c=!0),u.evenFooter&&typeof u.evenFooter=="string"&&(o.leafNode("evenFooter",null,u.evenFooter),c=!0),u.firstHeader&&typeof u.firstHeader=="string"&&(o.leafNode("firstHeader",null,u.firstHeader),c=!0),u.firstFooter&&typeof u.firstFooter=="string"&&(o.leafNode("firstFooter",null,u.firstFooter),c=!0),c?(o.closeNode(),o.commit()):o.rollback()}}parseOpen(o){switch(o.name){case"headerFooter":return this.model={},o.attributes.differentFirst&&(this.model.differentFirst=parseInt(o.attributes.differentFirst,0)===1),o.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(o.attributes.differentOddEven,0)===1),!0;case"oddHeader":return this.currentNode="oddHeader",!0;case"oddFooter":return this.currentNode="oddFooter",!0;case"evenHeader":return this.currentNode="evenHeader",!0;case"evenFooter":return this.currentNode="evenFooter",!0;case"firstHeader":return this.currentNode="firstHeader",!0;case"firstFooter":return this.currentNode="firstFooter",!0;default:return!1}}parseText(o){switch(this.currentNode){case"oddHeader":this.model.oddHeader=o;break;case"oddFooter":this.model.oddFooter=o;break;case"evenHeader":this.model.evenHeader=o;break;case"evenFooter":this.model.evenFooter=o;break;case"firstHeader":this.model.firstHeader=o;break;case"firstFooter":this.model.firstFooter=o}}parseClose(){switch(this.currentNode){case"oddHeader":case"oddFooter":case"evenHeader":case"evenFooter":case"firstHeader":case"firstFooter":return this.currentNode=void 0,!0;default:return!1}}}},{"../base-xform":32}],98:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"hyperlink"}render(o,u){this.isInternalLink(u)?o.leafNode("hyperlink",{ref:u.address,"r:id":u.rId,tooltip:u.tooltip,location:u.target}):o.leafNode("hyperlink",{ref:u.address,"r:id":u.rId,tooltip:u.tooltip})}parseOpen(o){return o.name==="hyperlink"&&(this.model={address:o.attributes.ref,rId:o.attributes["r:id"],tooltip:o.attributes.tooltip},o.attributes.location&&(this.model.target=o.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(o){return o.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(o.target)}}},{"../base-xform":32}],99:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"mergeCell"}render(o,u){o.leafNode("mergeCell",{ref:u})}parseOpen(o){return o.name==="mergeCell"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(t,n,l){const i=t("../../../utils/under-dash"),o=t("../../../doc/range"),u=t("../../../utils/col-cache"),c=t("../../../doc/enums");n.exports=class{constructor(){this.merges={}}add(s){if(this.merges[s.master])this.merges[s.master].expandToAddress(s.address);else{const d=`${s.master}:${s.address}`;this.merges[s.master]=new o(d)}}get mergeCells(){return i.map(this.merges,s=>s.range)}reconcile(s,d){i.each(s,f=>{const h=u.decode(f);for(let m=h.top;m<=h.bottom;m++){const p=d[m-1];for(let x=h.left;x<=h.right;x++){const g=p.cells[x-1];g?g.type===c.ValueType.Merge&&(g.master=h.tl):p.cells[x]={type:c.ValueType.Null,address:u.encodeAddress(m,x)}}}})}getMasterAddress(s){const d=this.hash[s];return d&&d.tl}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26}],101:[function(t,n,l){const i=t("../base-xform"),o=u=>u!==void 0;n.exports=class extends i{get tag(){return"outlinePr"}render(u,c){return!(!c||!o(c.summaryBelow)&&!o(c.summaryRight))&&(u.leafNode(this.tag,{summaryBelow:o(c.summaryBelow)?Number(c.summaryBelow):void 0,summaryRight:o(c.summaryRight)?Number(c.summaryRight):void 0}),!0)}parseOpen(u){return u.name===this.tag&&(this.model={summaryBelow:o(u.attributes.summaryBelow)?!!Number(u.attributes.summaryBelow):void 0,summaryRight:o(u.attributes.summaryRight)?!!Number(u.attributes.summaryRight):void 0},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],102:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"brk"}render(o,u){o.leafNode("brk",u)}parseOpen(o){return o.name==="brk"&&(this.model=o.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(t,n,l){const i=t("../../../utils/under-dash"),o=t("../base-xform");n.exports=class extends o{get tag(){return"pageMargins"}render(u,c){if(c){const s={left:c.left,right:c.right,top:c.top,bottom:c.bottom,header:c.header,footer:c.footer};i.some(s,d=>d!==void 0)&&u.leafNode(this.tag,s)}}parseOpen(u){return u.name===this.tag?(this.model={left:parseFloat(u.attributes.left||.7),right:parseFloat(u.attributes.right||.7),top:parseFloat(u.attributes.top||.75),bottom:parseFloat(u.attributes.bottom||.75),header:parseFloat(u.attributes.header||.3),footer:parseFloat(u.attributes.footer||.3)},!0):!1}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],104:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"pageSetUpPr"}render(o,u){return!(!u||!u.fitToPage)&&(o.leafNode(this.tag,{fitToPage:u.fitToPage?"1":void 0}),!0)}parseOpen(o){return o.name===this.tag&&(this.model={fitToPage:o.attributes.fitToPage==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],105:[function(t,n,l){const i=t("../../../utils/under-dash"),o=t("../base-xform");function u(f){return f?"1":void 0}function c(f){if(f==="overThenDown")return f}function s(f){switch(f){case"atEnd":case"asDisplyed":return f;default:return}}function d(f){switch(f){case"dash":case"blank":case"NA":return f;default:return}}n.exports=class extends o{get tag(){return"pageSetup"}render(f,h){if(h){const m={paperSize:h.paperSize,orientation:h.orientation,horizontalDpi:h.horizontalDpi,verticalDpi:h.verticalDpi,pageOrder:c(h.pageOrder),blackAndWhite:u(h.blackAndWhite),draft:u(h.draft),cellComments:s(h.cellComments),errors:d(h.errors),scale:h.scale,fitToWidth:h.fitToWidth,fitToHeight:h.fitToHeight,firstPageNumber:h.firstPageNumber,useFirstPageNumber:u(h.firstPageNumber),usePrinterDefaults:u(h.usePrinterDefaults),copies:h.copies};i.some(m,p=>p!==void 0)&&f.leafNode(this.tag,m)}}parseOpen(f){if(f.name===this.tag)return this.model={paperSize:(h=f.attributes.paperSize,h!==void 0?parseInt(h,10):void 0),orientation:f.attributes.orientation||"portrait",horizontalDpi:parseInt(f.attributes.horizontalDpi||"4294967295",10),verticalDpi:parseInt(f.attributes.verticalDpi||"4294967295",10),pageOrder:f.attributes.pageOrder||"downThenOver",blackAndWhite:f.attributes.blackAndWhite==="1",draft:f.attributes.draft==="1",cellComments:f.attributes.cellComments||"None",errors:f.attributes.errors||"displayed",scale:parseInt(f.attributes.scale||"100",10),fitToWidth:parseInt(f.attributes.fitToWidth||"1",10),fitToHeight:parseInt(f.attributes.fitToHeight||"1",10),firstPageNumber:parseInt(f.attributes.firstPageNumber||"1",10),useFirstPageNumber:f.attributes.useFirstPageNumber==="1",usePrinterDefaults:f.attributes.usePrinterDefaults==="1",copies:parseInt(f.attributes.copies||"1",10)},!0;return!1;var h}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],106:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"picture"}render(o,u){u&&o.leafNode(this.tag,{"r:id":u.rId})}parseOpen(o){return o.name===this.tag?(this.model={rId:o.attributes["r:id"]},!0):!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],107:[function(t,n,l){const i=t("../../../utils/under-dash"),o=t("../base-xform");function u(c){return c?"1":void 0}n.exports=class extends o{get tag(){return"printOptions"}render(c,s){if(s){const d={headings:u(s.showRowColHeaders),gridLines:u(s.showGridLines),horizontalCentered:u(s.horizontalCentered),verticalCentered:u(s.verticalCentered)};i.some(d,f=>f!==void 0)&&c.leafNode(this.tag,d)}}parseOpen(c){return c.name===this.tag?(this.model={showRowColHeaders:c.attributes.headings==="1",showGridLines:c.attributes.gridLines==="1",horizontalCentered:c.attributes.horizontalCentered==="1",verticalCentered:c.attributes.verticalCentered==="1"},!0):!1}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],108:[function(t,n,l){const i=t("./page-breaks-xform"),o=t("../list-xform");n.exports=class extends o{constructor(){super({tag:"rowBreaks",count:!0,childXform:new i})}render(u,c){if(c&&c.length){u.openNode(this.tag,this.$),this.count&&(u.addAttribute(this.$count,c.length),u.addAttribute("manualBreakCount",c.length));const{childXform:s}=this;c.forEach(d=>{s.render(u,d)}),u.closeNode()}else this.empty&&u.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(t,n,l){const i=t("../base-xform"),o=t("../../../utils/utils"),u=t("./cell-xform");n.exports=class extends i{constructor(c){super(),this.maxItems=c&&c.maxItems,this.map={c:new u}}get tag(){return"row"}prepare(c,s){const d=s.styles.addStyleModel(c.style);d&&(c.styleId=d);const f=this.map.c;c.cells.forEach(h=>{f.prepare(h,s)})}render(c,s,d){c.openNode("row"),c.addAttribute("r",s.number),s.height&&(c.addAttribute("ht",s.height),c.addAttribute("customHeight","1")),s.hidden&&c.addAttribute("hidden","1"),s.min>0&&s.max>0&&s.min<=s.max&&c.addAttribute("spans",`${s.min}:${s.max}`),s.styleId&&(c.addAttribute("s",s.styleId),c.addAttribute("customFormat","1")),c.addAttribute("x14ac:dyDescent","0.25"),s.outlineLevel&&c.addAttribute("outlineLevel",s.outlineLevel),s.collapsed&&c.addAttribute("collapsed","1");const f=this.map.c;s.cells.forEach(h=>{f.render(c,h,d)}),c.closeNode()}parseOpen(c){if(this.parser)return this.parser.parseOpen(c),!0;if(c.name==="row"){this.numRowsSeen+=1;const s=c.attributes.spans?c.attributes.spans.split(":").map(f=>parseInt(f,10)):[void 0,void 0],d=this.model={number:parseInt(c.attributes.r,10),min:s[0],max:s[1],cells:[]};return c.attributes.s&&(d.styleId=parseInt(c.attributes.s,10)),o.parseBoolean(c.attributes.hidden)&&(d.hidden=!0),o.parseBoolean(c.attributes.bestFit)&&(d.bestFit=!0),c.attributes.ht&&(d.height=parseFloat(c.attributes.ht)),c.attributes.outlineLevel&&(d.outlineLevel=parseInt(c.attributes.outlineLevel,10)),o.parseBoolean(c.attributes.collapsed)&&(d.collapsed=!0),!0}return this.parser=this.map[c.name],!!this.parser&&(this.parser.parseOpen(c),!0)}parseText(c){this.parser&&this.parser.parseText(c)}parseClose(c){if(this.parser){if(!this.parser.parseClose(c)){if(this.model.cells.push(this.parser.model),this.maxItems&&this.model.cells.length>this.maxItems)throw new Error(`Max column count (${this.maxItems}) exceeded`);this.parser=void 0}return!0}return!1}reconcile(c,s){c.style=c.styleId?s.styles.getStyleModel(c.styleId):{},c.styleId!==void 0&&(c.styleId=void 0);const d=this.map.c;c.cells.forEach(f=>{d.reconcile(f,s)})}}},{"../../../utils/utils":27,"../base-xform":32,"./cell-xform":73}],110:[function(t,n,l){const i=t("../../../utils/under-dash"),o=t("../base-xform");n.exports=class extends o{get tag(){return"sheetFormatPr"}render(u,c){if(c){const s={defaultRowHeight:c.defaultRowHeight,outlineLevelRow:c.outlineLevelRow,outlineLevelCol:c.outlineLevelCol,"x14ac:dyDescent":c.dyDescent};c.defaultColWidth&&(s.defaultColWidth=c.defaultColWidth),c.defaultRowHeight&&c.defaultRowHeight===15||(s.customHeight="1"),i.some(s,d=>d!==void 0)&&u.leafNode("sheetFormatPr",s)}}parseOpen(u){return u.name==="sheetFormatPr"&&(this.model={defaultRowHeight:parseFloat(u.attributes.defaultRowHeight||"0"),dyDescent:parseFloat(u.attributes["x14ac:dyDescent"]||"0"),outlineLevelRow:parseInt(u.attributes.outlineLevelRow||"0",10),outlineLevelCol:parseInt(u.attributes.outlineLevelCol||"0",10)},u.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(u.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(t,n,l){const i=t("../base-xform"),o=t("../style/color-xform"),u=t("./page-setup-properties-xform"),c=t("./outline-properties-xform");n.exports=class extends i{constructor(){super(),this.map={tabColor:new o("tabColor"),pageSetUpPr:new u,outlinePr:new c}}get tag(){return"sheetPr"}render(s,d){if(d){s.addRollback(),s.openNode("sheetPr");let f=!1;f=this.map.tabColor.render(s,d.tabColor)||f,f=this.map.pageSetUpPr.render(s,d.pageSetup)||f,f=this.map.outlinePr.render(s,d.outlineProperties)||f,f?(s.closeNode(),s.commit()):s.rollback()}}parseOpen(s){return this.parser?(this.parser.parseOpen(s),!0):s.name===this.tag?(this.reset(),!0):!!this.map[s.name]&&(this.parser=this.map[s.name],this.parser.parseOpen(s),!0)}parseText(s){return!!this.parser&&(this.parser.parseText(s),!0)}parseClose(s){return this.parser?(this.parser.parseClose(s)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}}},{"../base-xform":32,"../style/color-xform":128,"./outline-properties-xform":101,"./page-setup-properties-xform":104}],112:[function(t,n,l){const i=t("../../../utils/under-dash"),o=t("../base-xform");function u(s,d){return s?d:void 0}function c(s,d){return s===d||void 0}n.exports=class extends o{get tag(){return"sheetProtection"}render(s,d){if(d){const f={sheet:u(d.sheet,"1"),selectLockedCells:d.selectLockedCells===!1?"1":void 0,selectUnlockedCells:d.selectUnlockedCells===!1?"1":void 0,formatCells:u(d.formatCells,"0"),formatColumns:u(d.formatColumns,"0"),formatRows:u(d.formatRows,"0"),insertColumns:u(d.insertColumns,"0"),insertRows:u(d.insertRows,"0"),insertHyperlinks:u(d.insertHyperlinks,"0"),deleteColumns:u(d.deleteColumns,"0"),deleteRows:u(d.deleteRows,"0"),sort:u(d.sort,"0"),autoFilter:u(d.autoFilter,"0"),pivotTables:u(d.pivotTables,"0")};d.sheet&&(f.algorithmName=d.algorithmName,f.hashValue=d.hashValue,f.saltValue=d.saltValue,f.spinCount=d.spinCount,f.objects=u(d.objects===!1,"1"),f.scenarios=u(d.scenarios===!1,"1")),i.some(f,h=>h!==void 0)&&s.leafNode(this.tag,f)}}parseOpen(s){return s.name===this.tag?(this.model={sheet:c(s.attributes.sheet,"1"),objects:s.attributes.objects!=="1"&&void 0,scenarios:s.attributes.scenarios!=="1"&&void 0,selectLockedCells:s.attributes.selectLockedCells!=="1"&&void 0,selectUnlockedCells:s.attributes.selectUnlockedCells!=="1"&&void 0,formatCells:c(s.attributes.formatCells,"0"),formatColumns:c(s.attributes.formatColumns,"0"),formatRows:c(s.attributes.formatRows,"0"),insertColumns:c(s.attributes.insertColumns,"0"),insertRows:c(s.attributes.insertRows,"0"),insertHyperlinks:c(s.attributes.insertHyperlinks,"0"),deleteColumns:c(s.attributes.deleteColumns,"0"),deleteRows:c(s.attributes.deleteRows,"0"),sort:c(s.attributes.sort,"0"),autoFilter:c(s.attributes.autoFilter,"0"),pivotTables:c(s.attributes.pivotTables,"0")},s.attributes.algorithmName&&(this.model.algorithmName=s.attributes.algorithmName,this.model.hashValue=s.attributes.hashValue,this.model.saltValue=s.attributes.saltValue,this.model.spinCount=parseInt(s.attributes.spinCount,10)),!0):!1}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],113:[function(t,n,l){const i=t("../../../utils/col-cache"),o=t("../base-xform"),u={frozen:"frozen",frozenSplit:"frozen",split:"split"};n.exports=class extends o{get tag(){return"sheetView"}prepare(c){switch(c.state){case"frozen":case"split":break;default:c.state="normal"}}render(c,s){c.openNode("sheetView",{workbookViewId:s.workbookViewId||0});const d=function(x,g,y){y&&c.addAttribute(x,g)};let f,h,m,p;switch(d("rightToLeft","1",s.rightToLeft===!0),d("tabSelected","1",s.tabSelected),d("showRuler","0",s.showRuler===!1),d("showRowColHeaders","0",s.showRowColHeaders===!1),d("showGridLines","0",s.showGridLines===!1),d("zoomScale",s.zoomScale,s.zoomScale),d("zoomScaleNormal",s.zoomScaleNormal,s.zoomScaleNormal),d("view",s.style,s.style),s.state){case"frozen":h=s.xSplit||0,m=s.ySplit||0,f=s.topLeftCell||i.getAddress(m+1,h+1).address,p=(s.xSplit&&s.ySplit?"bottomRight":s.xSplit&&"topRight")||"bottomLeft",c.leafNode("pane",{xSplit:s.xSplit||void 0,ySplit:s.ySplit||void 0,topLeftCell:f,activePane:p,state:"frozen"}),c.leafNode("selection",{pane:p,activeCell:s.activeCell,sqref:s.activeCell});break;case"split":s.activePane==="topLeft"&&(s.activePane=void 0),c.leafNode("pane",{xSplit:s.xSplit||void 0,ySplit:s.ySplit||void 0,topLeftCell:s.topLeftCell,activePane:s.activePane}),c.leafNode("selection",{pane:s.activePane,activeCell:s.activeCell,sqref:s.activeCell});break;case"normal":s.activeCell&&c.leafNode("selection",{activeCell:s.activeCell,sqref:s.activeCell})}c.closeNode()}parseOpen(c){switch(c.name){case"sheetView":return this.sheetView={workbookViewId:parseInt(c.attributes.workbookViewId,10),rightToLeft:c.attributes.rightToLeft==="1",tabSelected:c.attributes.tabSelected==="1",showRuler:c.attributes.showRuler!=="0",showRowColHeaders:c.attributes.showRowColHeaders!=="0",showGridLines:c.attributes.showGridLines!=="0",zoomScale:parseInt(c.attributes.zoomScale||"100",10),zoomScaleNormal:parseInt(c.attributes.zoomScaleNormal||"100",10),style:c.attributes.view},this.pane=void 0,this.selections={},!0;case"pane":return this.pane={xSplit:parseInt(c.attributes.xSplit||"0",10),ySplit:parseInt(c.attributes.ySplit||"0",10),topLeftCell:c.attributes.topLeftCell,activePane:c.attributes.activePane||"topLeft",state:c.attributes.state},!0;case"selection":{const s=c.attributes.pane||"topLeft";return this.selections[s]={pane:s,activeCell:c.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(c){let s,d;return c==="sheetView"?(this.sheetView&&this.pane?(s=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:u[this.pane.state]||"split",xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},this.model.state==="split"&&(s.activePane=this.pane.activePane),d=this.selections[this.pane.activePane],d&&d.activeCell&&(s.activeCell=d.activeCell),this.sheetView.style&&(s.style=this.sheetView.style)):(s=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:"normal",showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},d=this.selections.topLeft,d&&d.activeCell&&(s.activeCell=d.activeCell),this.sheetView.style&&(s.style=this.sheetView.style)),!1):!0}reconcile(){}}},{"../../../utils/col-cache":19,"../base-xform":32}],114:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"tablePart"}render(o,u){u&&o.leafNode(this.tag,{"r:id":u.rId})}parseOpen(o){return o.name===this.tag?(this.model={rId:o.attributes["r:id"]},!0):!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],115:[function(t,n,l){const i=t("../../../utils/under-dash"),o=t("../../../utils/col-cache"),u=t("../../../utils/xml-stream"),c=t("../../rel-type"),s=t("./merges"),d=t("../base-xform"),f=t("../list-xform"),h=t("./row-xform"),m=t("./col-xform"),p=t("./dimension-xform"),x=t("./hyperlink-xform"),g=t("./merge-cell-xform"),y=t("./data-validations-xform"),v=t("./sheet-properties-xform"),_=t("./sheet-format-properties-xform"),C=t("./sheet-view-xform"),M=t("./sheet-protection-xform"),T=t("./page-margins-xform"),U=t("./page-setup-xform"),F=t("./print-options-xform"),H=t("./auto-filter-xform"),W=t("./picture-xform"),K=t("./drawing-xform"),$=t("./table-part-xform"),P=t("./row-breaks-xform"),L=t("./header-footer-xform"),E=t("./cf/conditional-formattings-xform"),j=t("./ext-lst-xform"),k=(N,O)=>{if(!O||!O.length)return N;if(!N||!N.length)return O;const D={},B={};return N.forEach(Y=>{D[Y.ref]=Y,Y.rules.forEach(Z=>{const{x14Id:ne}=Z;ne&&(B[ne]=Z)})}),O.forEach(Y=>{Y.rules.forEach(Z=>{const ne=B[Z.x14Id];ne?((q,ee)=>{Object.keys(ee).forEach(z=>{const I=q[z],X=ee[z];I===void 0&&X!==void 0&&(q[z]=X)})})(ne,Z):D[Y.ref]?D[Y.ref].rules.push(Z):N.push({ref:Y.ref,rules:[Z]})})}),N};class S extends d{constructor(O){super();const{maxRows:D,maxCols:B,ignoreNodes:Y}=O||{};this.ignoreNodes=Y||[],this.map={sheetPr:new v,dimension:new p,sheetViews:new f({tag:"sheetViews",count:!1,childXform:new C}),sheetFormatPr:new _,cols:new f({tag:"cols",count:!1,childXform:new m}),sheetData:new f({tag:"sheetData",count:!1,empty:!0,childXform:new h({maxItems:B}),maxItems:D}),autoFilter:new H,mergeCells:new f({tag:"mergeCells",count:!0,childXform:new g}),rowBreaks:new P,hyperlinks:new f({tag:"hyperlinks",count:!1,childXform:new x}),pageMargins:new T,dataValidations:new y,pageSetup:new U,headerFooter:new L,printOptions:new F,picture:new W,drawing:new K,sheetProtection:new M,tableParts:new f({tag:"tableParts",count:!0,childXform:new $}),conditionalFormatting:new E,extLst:new j}}prepare(O,D){D.merges=new s,O.hyperlinks=D.hyperlinks=[],O.comments=D.comments=[],D.formulae={},D.siFormulae=0,this.map.cols.prepare(O.cols,D),this.map.sheetData.prepare(O.rows,D),this.map.conditionalFormatting.prepare(O.conditionalFormattings,D),O.mergeCells=D.merges.mergeCells;const B=O.rels=[];function Y(q){return"rId"+(q.length+1)}if(O.hyperlinks.forEach(q=>{const ee=Y(B);q.rId=ee,B.push({Id:ee,Type:c.Hyperlink,Target:q.target,TargetMode:"External"})}),O.comments.length>0){const q={Id:Y(B),Type:c.Comments,Target:`../comments${O.id}.xml`};B.push(q);const ee={Id:Y(B),Type:c.VmlDrawing,Target:`../drawings/vmlDrawing${O.id}.vml`};B.push(ee),O.comments.forEach(z=>{z.refAddress=o.decodeAddress(z.ref)}),D.commentRefs.push({commentName:"comments"+O.id,vmlDrawing:"vmlDrawing"+O.id})}const Z=[];let ne;O.media.forEach(q=>{if(q.type==="background"){const ee=Y(B);ne=D.media[q.imageId],B.push({Id:ee,Type:c.Image,Target:`../media/${ne.name}.${ne.extension}`}),O.background={rId:ee},O.image=D.media[q.imageId]}else if(q.type==="image"){let{drawing:ee}=O;ne=D.media[q.imageId],ee||(ee=O.drawing={rId:Y(B),name:"drawing"+ ++D.drawingsCount,anchors:[],rels:[]},D.drawings.push(ee),B.push({Id:ee.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/${ee.name}.xml`}));let z=this.preImageId===q.imageId?Z[q.imageId]:Z[ee.rels.length];z||(z=Y(ee.rels),Z[ee.rels.length]=z,ee.rels.push({Id:z,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/${ne.name}.${ne.extension}`}));const I={picture:{rId:z},range:q.range};if(q.hyperlinks&&q.hyperlinks.hyperlink){const X=Y(ee.rels);Z[ee.rels.length]=X,I.picture.hyperlinks={tooltip:q.hyperlinks.tooltip,rId:X},ee.rels.push({Id:X,Type:c.Hyperlink,Target:q.hyperlinks.hyperlink,TargetMode:"External"})}this.preImageId=q.imageId,ee.anchors.push(I)}}),O.tables.forEach(q=>{const ee=Y(B);q.rId=ee,B.push({Id:ee,Type:c.Table,Target:"../tables/"+q.target}),q.columns.forEach(z=>{const{style:I}=z;I&&(z.dxfId=D.styles.addDxfStyle(I))})}),this.map.extLst.prepare(O,D)}render(O,D){O.openXml(u.StdDocAttributes),O.openNode("worksheet",S.WORKSHEET_ATTRIBUTES);const B=D.properties?{defaultRowHeight:D.properties.defaultRowHeight,dyDescent:D.properties.dyDescent,outlineLevelCol:D.properties.outlineLevelCol,outlineLevelRow:D.properties.outlineLevelRow}:void 0;D.properties&&D.properties.defaultColWidth&&(B.defaultColWidth=D.properties.defaultColWidth);const Y={outlineProperties:D.properties&&D.properties.outlineProperties,tabColor:D.properties&&D.properties.tabColor,pageSetup:D.pageSetup&&D.pageSetup.fitToPage?{fitToPage:D.pageSetup.fitToPage}:void 0},Z=D.pageSetup&&D.pageSetup.margins,ne={showRowColHeaders:D.pageSetup&&D.pageSetup.showRowColHeaders,showGridLines:D.pageSetup&&D.pageSetup.showGridLines,horizontalCentered:D.pageSetup&&D.pageSetup.horizontalCentered,verticalCentered:D.pageSetup&&D.pageSetup.verticalCentered},q=D.sheetProtection;this.map.sheetPr.render(O,Y),this.map.dimension.render(O,D.dimensions),this.map.sheetViews.render(O,D.views),this.map.sheetFormatPr.render(O,B),this.map.cols.render(O,D.cols),this.map.sheetData.render(O,D.rows),this.map.sheetProtection.render(O,q),this.map.autoFilter.render(O,D.autoFilter),this.map.mergeCells.render(O,D.mergeCells),this.map.conditionalFormatting.render(O,D.conditionalFormattings),this.map.dataValidations.render(O,D.dataValidations),this.map.hyperlinks.render(O,D.hyperlinks),this.map.printOptions.render(O,ne),this.map.pageMargins.render(O,Z),this.map.pageSetup.render(O,D.pageSetup),this.map.headerFooter.render(O,D.headerFooter),this.map.rowBreaks.render(O,D.rowBreaks),this.map.drawing.render(O,D.drawing),this.map.picture.render(O,D.background),this.map.tableParts.render(O,D.tables),this.map.extLst.render(O,D),D.rels&&D.rels.forEach(ee=>{ee.Type===c.VmlDrawing&&O.leafNode("legacyDrawing",{"r:id":ee.Id})}),O.closeNode()}parseOpen(O){return this.parser?(this.parser.parseOpen(O),!0):O.name==="worksheet"?(i.each(this.map,D=>{D.reset()}),!0):(this.map[O.name]&&!this.ignoreNodes.includes(O.name)&&(this.parser=this.map[O.name],this.parser.parseOpen(O)),!0)}parseText(O){this.parser&&this.parser.parseText(O)}parseClose(O){if(this.parser)return this.parser.parseClose(O)||(this.parser=void 0),!0;if(O==="worksheet"){const D=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(D.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(D.outlineProperties=this.map.sheetPr.model.outlineProperties);const B={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},Y=Object.assign(B,this.map.pageSetup.model,this.map.printOptions.model),Z=k(this.map.conditionalFormatting.model,this.map.extLst.model&&this.map.extLst.model["x14:conditionalFormattings"]);return this.model={dimensions:this.map.dimension.model,cols:this.map.cols.model,rows:this.map.sheetData.model,mergeCells:this.map.mergeCells.model,hyperlinks:this.map.hyperlinks.model,dataValidations:this.map.dataValidations.model,properties:D,views:this.map.sheetViews.model,pageSetup:Y,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:Z},this.map.autoFilter.model&&(this.model.autoFilter=this.map.autoFilter.model),this.map.sheetProtection.model&&(this.model.sheetProtection=this.map.sheetProtection.model),!1}else return!0}reconcile(O,D){const B=(O.relationships||[]).reduce((Z,ne)=>{if(Z[ne.Id]=ne,ne.Type===c.Comments&&(O.comments=D.comments[ne.Target].comments),ne.Type===c.VmlDrawing&&O.comments&&O.comments.length){const q=D.vmlDrawings[ne.Target].comments;O.comments.forEach((ee,z)=>{ee.note=Object.assign({},ee.note,q[z])})}return Z},{});if(D.commentsMap=(O.comments||[]).reduce((Z,ne)=>(ne.ref&&(Z[ne.ref]=ne),Z),{}),D.hyperlinkMap=(O.hyperlinks||[]).reduce((Z,ne)=>(ne.rId&&(Z[ne.address]=B[ne.rId].Target),Z),{}),D.formulae={},O.rows=O.rows&&O.rows.filter(Boolean)||[],O.rows.forEach(Z=>{Z.cells=Z.cells&&Z.cells.filter(Boolean)||[]}),this.map.cols.reconcile(O.cols,D),this.map.sheetData.reconcile(O.rows,D),this.map.conditionalFormatting.reconcile(O.conditionalFormattings,D),O.media=[],O.drawing){const Z=B[O.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(Z){const ne=Z[1];D.drawings[ne].anchors.forEach(q=>{if(q.medium){const ee={type:"image",imageId:q.medium.index,range:q.range,hyperlinks:q.picture.hyperlinks};O.media.push(ee)}})}}const Y=O.background&&B[O.background.rId];if(Y){const Z=Y.Target.split("/media/")[1],ne=D.mediaIndex&&D.mediaIndex[Z];ne!==void 0&&O.media.push({type:"background",imageId:ne})}O.tables=(O.tables||[]).map(Z=>{const ne=B[Z.rId];return D.tables[ne.Target]}),delete O.relationships,delete O.hyperlinks,delete O.comments}}S.WORKSHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"},n.exports=S},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../../rel-type":31,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":72,"./cf/conditional-formattings-xform":87,"./col-xform":92,"./data-validations-xform":93,"./dimension-xform":94,"./drawing-xform":95,"./ext-lst-xform":96,"./header-footer-xform":97,"./hyperlink-xform":98,"./merge-cell-xform":99,"./merges":100,"./page-margins-xform":103,"./page-setup-xform":105,"./picture-xform":106,"./print-options-xform":107,"./row-breaks-xform":108,"./row-xform":109,"./sheet-format-properties-xform":110,"./sheet-properties-xform":111,"./sheet-protection-xform":112,"./sheet-view-xform":113,"./table-part-xform":114}],116:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{constructor(o){super(),this.tag=o.tag,this.attr=o.attr}render(o,u){u&&(o.openNode(this.tag),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],117:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs,this._format=o.format||function(u){try{return Number.isNaN(u.getTime())?"":u.toISOString()}catch{return""}},this._parse=o.parse||function(u){return new Date(u)}}render(o,u){u&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,this._format(u)):o.writeText(this._format(u)),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.attr?this.model=this._parse(o.attributes[this.attr]):this.text=[])}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(""))),!1}}},{"../base-xform":32}],118:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs,this.zero=o.zero}render(o,u){(u||this.zero)&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,u):o.writeText(u),o.closeNode())}parseOpen(o){return o.name===this.tag&&(this.attr?this.model=parseInt(o.attributes[this.attr],10):this.text=[],!0)}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=parseInt(this.text.join("")||0,10)),!1}}},{"../base-xform":32}],119:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{constructor(o){super(),this.tag=o.tag,this.attr=o.attr,this.attrs=o.attrs}render(o,u){u!==void 0&&(o.openNode(this.tag),this.attrs&&o.addAttributes(this.attrs),this.attr?o.addAttribute(this.attr,u):o.writeText(u),o.closeNode())}parseOpen(o){o.name===this.tag&&(this.attr?this.model=o.attributes[this.attr]:this.text=[])}parseText(o){this.attr||this.text.push(o)}parseClose(){return this.attr||(this.model=this.text.join("")),!1}}},{"../base-xform":32}],120:[function(t,n,l){const i=t("./base-xform"),o=t("../../utils/xml-stream");n.exports=class extends i{constructor(u){super(),this._model=u}render(u){if(!this._xml){const c=new o;(function s(d,f){d.openNode(f.tag,f.$),f.c&&f.c.forEach(h=>{s(d,h)}),f.t&&d.writeText(f.t),d.closeNode()})(c,this._model),this._xml=c.xml}u.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(u){return u!==this._model.tag}}},{"../../utils/xml-stream":28,"./base-xform":32}],121:[function(t,n,l){const i=t("./text-xform"),o=t("./rich-text-xform"),u=t("../base-xform");n.exports=class extends u{constructor(){super(),this.map={r:new o,t:new i}}get tag(){return"rPh"}render(c,s){if(c.openNode(this.tag,{sb:s.sb||0,eb:s.eb||0}),s&&s.hasOwnProperty("richText")&&s.richText){const{r:d}=this.map;s.richText.forEach(f=>{d.render(c,f)})}else s&&this.map.t.render(c,s.text);c.closeNode()}parseOpen(c){const{name:s}=c;return this.parser?(this.parser.parseOpen(c),!0):s===this.tag?(this.model={sb:parseInt(c.attributes.sb,10),eb:parseInt(c.attributes.eb,10)},!0):(this.parser=this.map[s],!!this.parser&&(this.parser.parseOpen(c),!0))}parseText(c){this.parser&&this.parser.parseText(c)}parseClose(c){if(this.parser){if(!this.parser.parseClose(c)){switch(c){case"r":{let s=this.model.richText;s||(s=this.model.richText=[]),s.push(this.parser.model);break}case"t":this.model.text=this.parser.model}this.parser=void 0}return!0}return c!==this.tag}}},{"../base-xform":32,"./rich-text-xform":122,"./text-xform":125}],122:[function(t,n,l){const i=t("./text-xform"),o=t("../style/font-xform"),u=t("../base-xform");class c extends u{constructor(d){super(),this.model=d}get tag(){return"r"}get textXform(){return this._textXform||(this._textXform=new i)}get fontXform(){return this._fontXform||(this._fontXform=new o(c.FONT_OPTIONS))}render(d,f){f=f||this.model,d.openNode("r"),f.font&&this.fontXform.render(d,f.font),this.textXform.render(d,f.text),d.closeNode()}parseOpen(d){if(this.parser)return this.parser.parseOpen(d),!0;switch(d.name){case"r":return this.model={},!0;case"t":return this.parser=this.textXform,this.parser.parseOpen(d),!0;case"rPr":return this.parser=this.fontXform,this.parser.parseOpen(d),!0;default:return!1}}parseText(d){this.parser&&this.parser.parseText(d)}parseClose(d){switch(d){case"r":return!1;case"t":return this.model.text=this.parser.model,this.parser=void 0,!0;case"rPr":return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(d),!0}}}c.FONT_OPTIONS={tagName:"rPr",fontNameTag:"rFont"},n.exports=c},{"../base-xform":32,"../style/font-xform":131,"./text-xform":125}],123:[function(t,n,l){const i=t("./text-xform"),o=t("./rich-text-xform"),u=t("./phonetic-text-xform"),c=t("../base-xform");n.exports=class extends c{constructor(s){super(),this.model=s,this.map={r:new o,t:new i,rPh:new u}}get tag(){return"si"}render(s,d){s.openNode(this.tag),d&&d.hasOwnProperty("richText")&&d.richText?d.richText.length?d.richText.forEach(f=>{this.map.r.render(s,f)}):this.map.t.render(s,""):d!=null&&this.map.t.render(s,d),s.closeNode()}parseOpen(s){const{name:d}=s;return this.parser?(this.parser.parseOpen(s),!0):d===this.tag?(this.model={},!0):(this.parser=this.map[d],!!this.parser&&(this.parser.parseOpen(s),!0))}parseText(s){this.parser&&this.parser.parseText(s)}parseClose(s){if(this.parser){if(!this.parser.parseClose(s)){switch(s){case"r":{let d=this.model.richText;d||(d=this.model.richText=[]),d.push(this.parser.model);break}case"t":this.model=this.parser.model}this.parser=void 0}return!0}return s!==this.tag}}},{"../base-xform":32,"./phonetic-text-xform":121,"./rich-text-xform":122,"./text-xform":125}],124:[function(t,n,l){const i=t("../../../utils/xml-stream"),o=t("../base-xform"),u=t("./shared-string-xform");n.exports=class extends o{constructor(c){super(),this.model=c||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||(this._sharedStringXform=new u)}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(c){return this.model.values[c]}add(c){return c.richText?this.addRichText(c):this.addText(c)}addText(c){let s=this.hash[c];return s===void 0&&(s=this.hash[c]=this.model.values.length,this.model.values.push(c)),this.model.count++,s}addRichText(c){const s=this.sharedStringXform.toXml(c);let d=this.rich[s];return d===void 0&&(d=this.rich[s]=this.model.values.length,this.model.values.push(c)),this.model.count++,d}render(c,s){s=s||this._values,c.openXml(i.StdDocAttributes),c.openNode("sst",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:s.count,uniqueCount:s.values.length});const d=this.sharedStringXform;s.values.forEach(f=>{d.render(c,f)}),c.closeNode()}parseOpen(c){if(this.parser)return this.parser.parseOpen(c),!0;switch(c.name){case"sst":return!0;case"si":return this.parser=this.sharedStringXform,this.parser.parseOpen(c),!0;default:throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(c))}}parseText(c){this.parser&&this.parser.parseText(c)}parseClose(c){if(this.parser)return this.parser.parseClose(c)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;if(c==="sst")return!1;throw new Error("Unexpected xml node in parseClose: "+c)}}},{"../../../utils/xml-stream":28,"../base-xform":32,"./shared-string-xform":123}],125:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"t"}render(o,u){o.openNode("t"),/^\s|\n|\s$/.test(u)&&o.addAttribute("xml:space","preserve"),o.writeText(u),o.closeNode()}get model(){return this._text.join("").replace(/_x([0-9A-F]{4})_/g,(o,u)=>String.fromCharCode(parseInt(u,16)))}parseOpen(o){return o.name==="t"?(this._text=[],!0):!1}parseText(o){this._text.push(o)}parseClose(){return!1}}},{"../base-xform":32}],126:[function(t,n,l){const i=t("../../../doc/enums"),o=t("../../../utils/utils"),u=t("../base-xform"),c={horizontalValues:["left","center","right","fill","centerContinuous","distributed","justify"].reduce((d,f)=>(d[f]=!0,d),{}),horizontal(d){return this.horizontalValues[d]?d:void 0},verticalValues:["top","middle","bottom","distributed","justify"].reduce((d,f)=>(d[f]=!0,d),{}),vertical(d){return d==="middle"?"center":this.verticalValues[d]?d:void 0},wrapText:d=>!!d||void 0,shrinkToFit:d=>!!d||void 0,textRotation(d){return d==="vertical"||(d=o.validInt(d))>=-90&&d<=90?d:void 0},indent:d=>(d=o.validInt(d),Math.max(0,d)),readingOrder(d){switch(d){case"ltr":return i.ReadingOrder.LeftToRight;case"rtl":return i.ReadingOrder.RightToLeft;default:return}}},s={toXml(d){if(d=c.textRotation(d)){if(d==="vertical")return 255;const f=Math.round(d);if(f>=0&&f<=90)return f;if(f<0&&f>=-90)return 90-f}},toModel(d){const f=o.validInt(d);if(f!==void 0){if(f===255)return"vertical";if(f>=0&&f<=90)return f;if(f>90&&f<=180)return 90-f}}};n.exports=class extends u{get tag(){return"alignment"}render(d,f){d.addRollback(),d.openNode("alignment");let h=!1;function m(p,x){x&&(d.addAttribute(p,x),h=!0)}m("horizontal",c.horizontal(f.horizontal)),m("vertical",c.vertical(f.vertical)),m("wrapText",!!c.wrapText(f.wrapText)&&"1"),m("shrinkToFit",!!c.shrinkToFit(f.shrinkToFit)&&"1"),m("indent",c.indent(f.indent)),m("textRotation",s.toXml(f.textRotation)),m("readingOrder",c.readingOrder(f.readingOrder)),d.closeNode(),h?d.commit():d.rollback()}parseOpen(d){const f={};let h=!1;function m(p,x,g){p&&(f[x]=g,h=!0)}m(d.attributes.horizontal,"horizontal",d.attributes.horizontal),m(d.attributes.vertical,"vertical",d.attributes.vertical==="center"?"middle":d.attributes.vertical),m(d.attributes.wrapText,"wrapText",o.parseBoolean(d.attributes.wrapText)),m(d.attributes.shrinkToFit,"shrinkToFit",o.parseBoolean(d.attributes.shrinkToFit)),m(d.attributes.indent,"indent",parseInt(d.attributes.indent,10)),m(d.attributes.textRotation,"textRotation",s.toModel(d.attributes.textRotation)),m(d.attributes.readingOrder,"readingOrder",d.attributes.readingOrder==="2"?"rtl":"ltr"),this.model=h?f:null}parseText(){}parseClose(){return!1}}},{"../../../doc/enums":7,"../../../utils/utils":27,"../base-xform":32}],127:[function(t,n,l){const i=t("../base-xform"),o=t("../../../utils/utils"),u=t("./color-xform");class c extends i{constructor(d){super(),this.name=d,this.map={color:new u}}get tag(){return this.name}render(d,f,h){const m=f&&f.color||h||this.defaultColor;d.openNode(this.name),f&&f.style&&(d.addAttribute("style",f.style),m&&this.map.color.render(d,m)),d.closeNode()}parseOpen(d){if(this.parser)return this.parser.parseOpen(d),!0;switch(d.name){case this.name:{const{style:f}=d.attributes;return this.model=f?{style:f}:void 0,!0}case"color":return this.parser=this.map.color,this.parser.parseOpen(d),!0;default:return!1}}parseText(d){this.parser&&this.parser.parseText(d)}parseClose(d){return this.parser?(this.parser.parseClose(d)||(this.parser=void 0),!0):(d===this.name&&this.map.color.model&&(this.model||(this.model={}),this.model.color=this.map.color.model),!1)}validStyle(d){return c.validStyleValues[d]}}c.validStyleValues=["thin","dashed","dotted","dashDot","hair","dashDotDot","slantDashDot","mediumDashed","mediumDashDotDot","mediumDashDot","medium","double","thick"].reduce((s,d)=>(s[d]=!0,s),{}),n.exports=class extends i{constructor(){super(),this.map={top:new c("top"),left:new c("left"),bottom:new c("bottom"),right:new c("right"),diagonal:new c("diagonal")}}render(s,d){const{color:f}=d;function h(m,p){m&&!m.color&&d.color&&(m={...m,color:d.color}),p.render(s,m,f)}s.openNode("border"),d.diagonal&&d.diagonal.style&&(d.diagonal.up&&s.addAttribute("diagonalUp","1"),d.diagonal.down&&s.addAttribute("diagonalDown","1")),h(d.left,this.map.left),h(d.right,this.map.right),h(d.top,this.map.top),h(d.bottom,this.map.bottom),h(d.diagonal,this.map.diagonal),s.closeNode()}parseOpen(s){return this.parser?(this.parser.parseOpen(s),!0):s.name==="border"?(this.reset(),this.diagonalUp=o.parseBoolean(s.attributes.diagonalUp),this.diagonalDown=o.parseBoolean(s.attributes.diagonalDown),!0):(this.parser=this.map[s.name],!!this.parser&&(this.parser.parseOpen(s),!0))}parseText(s){this.parser&&this.parser.parseText(s)}parseClose(s){if(this.parser)return this.parser.parseClose(s)||(this.parser=void 0),!0;if(s==="border"){const d=this.model={},f=function(h,m,p){m&&(p&&Object.assign(m,p),d[h]=m)};f("left",this.map.left.model),f("right",this.map.right.model),f("top",this.map.top.model),f("bottom",this.map.bottom.model),f("diagonal",this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}}},{"../../../utils/utils":27,"../base-xform":32,"./color-xform":128}],128:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{constructor(o){super(),this.name=o||"color"}get tag(){return this.name}render(o,u){return!!u&&(o.openNode(this.name),u.argb?o.addAttribute("rgb",u.argb):u.theme!==void 0?(o.addAttribute("theme",u.theme),u.tint!==void 0&&o.addAttribute("tint",u.tint)):u.indexed!==void 0?o.addAttribute("indexed",u.indexed):o.addAttribute("auto","1"),o.closeNode(),!0)}parseOpen(o){return o.name===this.name&&(o.attributes.rgb?this.model={argb:o.attributes.rgb}:o.attributes.theme?(this.model={theme:parseInt(o.attributes.theme,10)},o.attributes.tint&&(this.model.tint=parseFloat(o.attributes.tint))):o.attributes.indexed?this.model={indexed:parseInt(o.attributes.indexed,10)}:this.model=void 0,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],129:[function(t,n,l){const i=t("../base-xform"),o=t("./alignment-xform"),u=t("./border-xform"),c=t("./fill-xform"),s=t("./font-xform"),d=t("./numfmt-xform"),f=t("./protection-xform");n.exports=class extends i{constructor(){super(),this.map={alignment:new o,border:new u,fill:new c,font:new s,numFmt:new d,protection:new f}}get tag(){return"dxf"}render(h,m){if(h.openNode(this.tag),m.font&&this.map.font.render(h,m.font),m.numFmt&&m.numFmtId){const p={id:m.numFmtId,formatCode:m.numFmt};this.map.numFmt.render(h,p)}m.fill&&this.map.fill.render(h,m.fill),m.alignment&&this.map.alignment.render(h,m.alignment),m.border&&this.map.border.render(h,m.border),m.protection&&this.map.protection.render(h,m.protection),h.closeNode()}parseOpen(h){return this.parser?(this.parser.parseOpen(h),!0):h.name===this.tag?(this.reset(),!0):(this.parser=this.map[h.name],this.parser&&this.parser.parseOpen(h),!0)}parseText(h){this.parser&&this.parser.parseText(h)}parseClose(h){return this.parser?(this.parser.parseClose(h)||(this.parser=void 0),!0):h!==this.tag||(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1)}}},{"../base-xform":32,"./alignment-xform":126,"./border-xform":127,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./protection-xform":133}],130:[function(t,n,l){const i=t("../base-xform"),o=t("./color-xform");class u extends i{constructor(){super(),this.map={color:new o}}get tag(){return"stop"}render(h,m){h.openNode("stop"),h.addAttribute("position",m.position),this.map.color.render(h,m.color),h.closeNode()}parseOpen(h){if(this.parser)return this.parser.parseOpen(h),!0;switch(h.name){case"stop":return this.model={position:parseFloat(h.attributes.position)},!0;case"color":return this.parser=this.map.color,this.parser.parseOpen(h),!0;default:return!1}}parseText(){}parseClose(h){return!!this.parser&&(this.parser.parseClose(h)||(this.model.color=this.parser.model,this.parser=void 0),!0)}}class c extends i{constructor(){super(),this.map={fgColor:new o("fgColor"),bgColor:new o("bgColor")}}get name(){return"pattern"}get tag(){return"patternFill"}render(h,m){h.openNode("patternFill"),h.addAttribute("patternType",m.pattern),m.fgColor&&this.map.fgColor.render(h,m.fgColor),m.bgColor&&this.map.bgColor.render(h,m.bgColor),h.closeNode()}parseOpen(h){return this.parser?(this.parser.parseOpen(h),!0):h.name==="patternFill"?(this.model={type:"pattern",pattern:h.attributes.patternType},!0):(this.parser=this.map[h.name],!!this.parser&&(this.parser.parseOpen(h),!0))}parseText(h){this.parser&&this.parser.parseText(h)}parseClose(h){return!!this.parser&&(this.parser.parseClose(h)||(this.parser.model&&(this.model[h]=this.parser.model),this.parser=void 0),!0)}}class s extends i{constructor(){super(),this.map={stop:new u}}get name(){return"gradient"}get tag(){return"gradientFill"}render(h,m){switch(h.openNode("gradientFill"),m.gradient){case"angle":h.addAttribute("degree",m.degree);break;case"path":h.addAttribute("type","path"),m.center.left&&(h.addAttribute("left",m.center.left),m.center.right===void 0&&h.addAttribute("right",m.center.left)),m.center.right&&h.addAttribute("right",m.center.right),m.center.top&&(h.addAttribute("top",m.center.top),m.center.bottom===void 0&&h.addAttribute("bottom",m.center.top)),m.center.bottom&&h.addAttribute("bottom",m.center.bottom)}const p=this.map.stop;m.stops.forEach(x=>{p.render(h,x)}),h.closeNode()}parseOpen(h){if(this.parser)return this.parser.parseOpen(h),!0;switch(h.name){case"gradientFill":{const m=this.model={stops:[]};return h.attributes.degree?(m.gradient="angle",m.degree=parseInt(h.attributes.degree,10)):h.attributes.type==="path"&&(m.gradient="path",m.center={left:h.attributes.left?parseFloat(h.attributes.left):0,top:h.attributes.top?parseFloat(h.attributes.top):0},h.attributes.right!==h.attributes.left&&(m.center.right=h.attributes.right?parseFloat(h.attributes.right):0),h.attributes.bottom!==h.attributes.top&&(m.center.bottom=h.attributes.bottom?parseFloat(h.attributes.bottom):0)),!0}case"stop":return this.parser=this.map.stop,this.parser.parseOpen(h),!0;default:return!1}}parseText(h){this.parser&&this.parser.parseText(h)}parseClose(h){return!!this.parser&&(this.parser.parseClose(h)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0)}}class d extends i{constructor(){super(),this.map={patternFill:new c,gradientFill:new s}}get tag(){return"fill"}render(h,m){switch(h.addRollback(),h.openNode("fill"),m.type){case"pattern":this.map.patternFill.render(h,m);break;case"gradient":this.map.gradientFill.render(h,m);break;default:return void h.rollback()}h.closeNode(),h.commit()}parseOpen(h){return this.parser?(this.parser.parseOpen(h),!0):h.name==="fill"?(this.model={},!0):(this.parser=this.map[h.name],!!this.parser&&(this.parser.parseOpen(h),!0))}parseText(h){this.parser&&this.parser.parseText(h)}parseClose(h){return!!this.parser&&(this.parser.parseClose(h)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0)}validStyle(h){return d.validPatternValues[h]}}d.validPatternValues=["none","solid","darkVertical","darkGray","mediumGray","lightGray","gray125","gray0625","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","lightGrid"].reduce((f,h)=>(f[h]=!0,f),{}),d.StopXform=u,d.PatternFillXform=c,d.GradientFillXform=s,n.exports=d},{"../base-xform":32,"./color-xform":128}],131:[function(t,n,l){const i=t("./color-xform"),o=t("../simple/boolean-xform"),u=t("../simple/integer-xform"),c=t("../simple/string-xform"),s=t("./underline-xform"),d=t("../../../utils/under-dash"),f=t("../base-xform");class h extends f{constructor(p){super(),this.options=p||h.OPTIONS,this.map={b:{prop:"bold",xform:new o({tag:"b",attr:"val"})},i:{prop:"italic",xform:new o({tag:"i",attr:"val"})},u:{prop:"underline",xform:new s},charset:{prop:"charset",xform:new u({tag:"charset",attr:"val"})},color:{prop:"color",xform:new i},condense:{prop:"condense",xform:new o({tag:"condense",attr:"val"})},extend:{prop:"extend",xform:new o({tag:"extend",attr:"val"})},family:{prop:"family",xform:new u({tag:"family",attr:"val"})},outline:{prop:"outline",xform:new o({tag:"outline",attr:"val"})},vertAlign:{prop:"vertAlign",xform:new c({tag:"vertAlign",attr:"val"})},scheme:{prop:"scheme",xform:new c({tag:"scheme",attr:"val"})},shadow:{prop:"shadow",xform:new o({tag:"shadow",attr:"val"})},strike:{prop:"strike",xform:new o({tag:"strike",attr:"val"})},sz:{prop:"size",xform:new u({tag:"sz",attr:"val"})}},this.map[this.options.fontNameTag]={prop:"name",xform:new c({tag:this.options.fontNameTag,attr:"val"})}}get tag(){return this.options.tagName}render(p,x){const{map:g}=this;p.openNode(this.options.tagName),d.each(this.map,(y,v)=>{g[v].xform.render(p,x[y.prop])}),p.closeNode()}parseOpen(p){return this.parser?(this.parser.parseOpen(p),!0):this.map[p.name]?(this.parser=this.map[p.name].xform,this.parser.parseOpen(p)):p.name===this.options.tagName?(this.model={},!0):!1}parseText(p){this.parser&&this.parser.parseText(p)}parseClose(p){if(this.parser&&!this.parser.parseClose(p)){const x=this.map[p];return this.parser.model&&(this.model[x.prop]=this.parser.model),this.parser=void 0,!0}return p!==this.options.tagName}}h.OPTIONS={tagName:"font",fontNameTag:"name"},n.exports=h},{"../../../utils/under-dash":26,"../base-xform":32,"../simple/boolean-xform":116,"../simple/integer-xform":118,"../simple/string-xform":119,"./color-xform":128,"./underline-xform":136}],132:[function(t,n,l){const i=t("../../../utils/under-dash"),o=t("../../defaultnumformats"),u=t("../base-xform"),c=(function(){const d={};return i.each(o,(f,h)=>{f.f&&(d[f.f]=parseInt(h,10))}),d})();class s extends u{constructor(f,h){super(),this.id=f,this.formatCode=h}get tag(){return"numFmt"}render(f,h){f.leafNode("numFmt",{numFmtId:h.id,formatCode:h.formatCode})}parseOpen(f){return f.name==="numFmt"?(this.model={id:parseInt(f.attributes.numFmtId,10),formatCode:f.attributes.formatCode.replace(/[\\](.)/g,"$1")},!0):!1}parseText(){}parseClose(){return!1}}s.getDefaultFmtId=function(d){return c[d]},s.getDefaultFmtCode=function(d){return o[d]&&o[d].f},n.exports=s},{"../../../utils/under-dash":26,"../../defaultnumformats":30,"../base-xform":32}],133:[function(t,n,l){const i=t("../base-xform"),o={boolean:(u,c)=>u===void 0?c:u};n.exports=class extends i{get tag(){return"protection"}render(u,c){u.addRollback(),u.openNode("protection");let s=!1;function d(f,h){h!==void 0&&(u.addAttribute(f,h),s=!0)}d("locked",o.boolean(c.locked,!0)?void 0:"0"),d("hidden",o.boolean(c.hidden,!1)?"1":void 0),u.closeNode(),s?u.commit():u.rollback()}parseOpen(u){const c={locked:u.attributes.locked!=="0",hidden:u.attributes.hidden==="1"},s=!c.locked||c.hidden;this.model=s?c:null}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],134:[function(t,n,l){const i=t("../base-xform"),o=t("./alignment-xform"),u=t("./protection-xform");n.exports=class extends i{constructor(c){super(),this.xfId=!(!c||!c.xfId),this.map={alignment:new o,protection:new u}}get tag(){return"xf"}render(c,s){c.openNode("xf",{numFmtId:s.numFmtId||0,fontId:s.fontId||0,fillId:s.fillId||0,borderId:s.borderId||0}),this.xfId&&c.addAttribute("xfId",s.xfId||0),s.numFmtId&&c.addAttribute("applyNumberFormat","1"),s.fontId&&c.addAttribute("applyFont","1"),s.fillId&&c.addAttribute("applyFill","1"),s.borderId&&c.addAttribute("applyBorder","1"),s.alignment&&c.addAttribute("applyAlignment","1"),s.protection&&c.addAttribute("applyProtection","1"),s.alignment&&this.map.alignment.render(c,s.alignment),s.protection&&this.map.protection.render(c,s.protection),c.closeNode()}parseOpen(c){if(this.parser)return this.parser.parseOpen(c),!0;switch(c.name){case"xf":return this.model={numFmtId:parseInt(c.attributes.numFmtId,10),fontId:parseInt(c.attributes.fontId,10),fillId:parseInt(c.attributes.fillId,10),borderId:parseInt(c.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(c.attributes.xfId,10)),!0;case"alignment":return this.parser=this.map.alignment,this.parser.parseOpen(c),!0;case"protection":return this.parser=this.map.protection,this.parser.parseOpen(c),!0;default:return!1}}parseText(c){this.parser&&this.parser.parseText(c)}parseClose(c){return this.parser?(this.parser.parseClose(c)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):c!=="xf"}}},{"../base-xform":32,"./alignment-xform":126,"./protection-xform":133}],135:[function(t,n,l){const i=t("../../../doc/enums"),o=t("../../../utils/xml-stream"),u=t("../base-xform"),c=t("../static-xform"),s=t("../list-xform"),d=t("./font-xform"),f=t("./fill-xform"),h=t("./border-xform"),m=t("./numfmt-xform"),p=t("./style-xform"),x=t("./dxf-xform");class g extends u{constructor(v){super(),this.map={numFmts:new s({tag:"numFmts",count:!0,childXform:new m}),fonts:new s({tag:"fonts",count:!0,childXform:new d,$:{"x14ac:knownFonts":1}}),fills:new s({tag:"fills",count:!0,childXform:new f}),borders:new s({tag:"borders",count:!0,childXform:new h}),cellStyleXfs:new s({tag:"cellStyleXfs",count:!0,childXform:new p}),cellXfs:new s({tag:"cellXfs",count:!0,childXform:new p({xfId:!0})}),dxfs:new s({tag:"dxfs",always:!0,count:!0,childXform:new x}),numFmt:new m,font:new d,fill:new f,border:new h,style:new p({xfId:!0}),cellStyles:g.STATIC_XFORMS.cellStyles,tableStyles:g.STATIC_XFORMS.tableStyles,extLst:g.STATIC_XFORMS.extLst},v&&this.init()}initIndex(){this.index={style:{},numFmt:{},numFmtNextId:164,font:{},border:{},fill:{}}}init(){this.model={styles:[],numFmts:[],fonts:[],borders:[],fills:[],dxfs:[]},this.initIndex(),this._addBorder({}),this._addStyle({numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}),this._addFill({type:"pattern",pattern:"none"}),this._addFill({type:"pattern",pattern:"gray125"}),this.weakMap=new WeakMap}render(v,_){_=_||this.model,v.openXml(o.StdDocAttributes),v.openNode("styleSheet",g.STYLESHEET_ATTRIBUTES),this.index?(_.numFmts&&_.numFmts.length&&(v.openNode("numFmts",{count:_.numFmts.length}),_.numFmts.forEach(C=>{v.writeXml(C)}),v.closeNode()),_.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),v.openNode("fonts",{count:_.fonts.length,"x14ac:knownFonts":1}),_.fonts.forEach(C=>{v.writeXml(C)}),v.closeNode(),v.openNode("fills",{count:_.fills.length}),_.fills.forEach(C=>{v.writeXml(C)}),v.closeNode(),v.openNode("borders",{count:_.borders.length}),_.borders.forEach(C=>{v.writeXml(C)}),v.closeNode(),this.map.cellStyleXfs.render(v,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),v.openNode("cellXfs",{count:_.styles.length}),_.styles.forEach(C=>{v.writeXml(C)}),v.closeNode()):(this.map.numFmts.render(v,_.numFmts),this.map.fonts.render(v,_.fonts),this.map.fills.render(v,_.fills),this.map.borders.render(v,_.borders),this.map.cellStyleXfs.render(v,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(v,_.styles)),g.STATIC_XFORMS.cellStyles.render(v),this.map.dxfs.render(v,_.dxfs),g.STATIC_XFORMS.tableStyles.render(v),g.STATIC_XFORMS.extLst.render(v),v.closeNode()}parseOpen(v){return this.parser?(this.parser.parseOpen(v),!0):v.name==="styleSheet"?(this.initIndex(),!0):(this.parser=this.map[v.name],this.parser&&this.parser.parseOpen(v),!0)}parseText(v){this.parser&&this.parser.parseText(v)}parseClose(v){if(this.parser)return this.parser.parseClose(v)||(this.parser=void 0),!0;switch(v){case"styleSheet":{this.model={};const _=(C,M)=>{M.model&&M.model.length&&(this.model[C]=M.model)};if(_("numFmts",this.map.numFmts),_("fonts",this.map.fonts),_("fills",this.map.fills),_("borders",this.map.borders),_("styles",this.map.cellXfs),_("dxfs",this.map.dxfs),this.index={model:[],numFmt:[]},this.model.numFmts){const C=this.index.numFmt;this.model.numFmts.forEach(M=>{C[M.id]=M.formatCode})}return!1}default:return!0}}addStyleModel(v,_){if(!v)return 0;if(this.model.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),this.weakMap&&this.weakMap.has(v))return this.weakMap.get(v);const C={};if(_=_||i.ValueType.Number,v.numFmt)C.numFmtId=this._addNumFmtStr(v.numFmt);else switch(_){case i.ValueType.Number:C.numFmtId=this._addNumFmtStr("General");break;case i.ValueType.Date:C.numFmtId=this._addNumFmtStr("mm-dd-yy")}v.font&&(C.fontId=this._addFont(v.font)),v.border&&(C.borderId=this._addBorder(v.border)),v.fill&&(C.fillId=this._addFill(v.fill)),v.alignment&&(C.alignment=v.alignment),v.protection&&(C.protection=v.protection);const M=this._addStyle(C);return this.weakMap&&this.weakMap.set(v,M),M}getStyleModel(v){const _=this.model.styles[v];if(!_)return null;let C=this.index.model[v];if(C)return C;if(C=this.index.model[v]={},_.numFmtId){const T=this.index.numFmt[_.numFmtId]||m.getDefaultFmtCode(_.numFmtId);T&&(C.numFmt=T)}function M(T,U,F){if(F||F===0){const H=U[F];H&&(C[T]=H)}}return M("font",this.model.fonts,_.fontId),M("border",this.model.borders,_.borderId),M("fill",this.model.fills,_.fillId),_.alignment&&(C.alignment=_.alignment),_.protection&&(C.protection=_.protection),C}addDxfStyle(v){return v.numFmt&&(v.numFmtId=this._addNumFmtStr(v.numFmt)),this.model.dxfs.push(v),this.model.dxfs.length-1}getDxfStyle(v){return this.model.dxfs[v]}_addStyle(v){const _=this.map.style.toXml(v);let C=this.index.style[_];return C===void 0&&(C=this.index.style[_]=this.model.styles.length,this.model.styles.push(_)),C}_addNumFmtStr(v){let _=m.getDefaultFmtId(v);if(_!==void 0||(_=this.index.numFmt[v],_!==void 0))return _;_=this.index.numFmt[v]=164+this.model.numFmts.length;const C=this.map.numFmt.toXml({id:_,formatCode:v});return this.model.numFmts.push(C),_}_addFont(v){const _=this.map.font.toXml(v);let C=this.index.font[_];return C===void 0&&(C=this.index.font[_]=this.model.fonts.length,this.model.fonts.push(_)),C}_addBorder(v){const _=this.map.border.toXml(v);let C=this.index.border[_];return C===void 0&&(C=this.index.border[_]=this.model.borders.length,this.model.borders.push(_)),C}_addFill(v){const _=this.map.fill.toXml(v);let C=this.index.fill[_];return C===void 0&&(C=this.index.fill[_]=this.model.fills.length,this.model.fills.push(_)),C}}g.STYLESHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac x16r2","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main"},g.STATIC_XFORMS={cellStyles:new c({tag:"cellStyles",$:{count:1},c:[{tag:"cellStyle",$:{name:"Normal",xfId:0,builtinId:0}}]}),dxfs:new c({tag:"dxfs",$:{count:0}}),tableStyles:new c({tag:"tableStyles",$:{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}}),extLst:new c({tag:"extLst",c:[{tag:"ext",$:{uri:"{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"},c:[{tag:"x14:slicerStyles",$:{defaultSlicerStyle:"SlicerStyleLight1"}}]},{tag:"ext",$:{uri:"{9260A510-F301-46a8-8635-F512D64BE5F5}","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},c:[{tag:"x15:timelineStyles",$:{defaultTimelineStyle:"TimeSlicerStyleLight1"}}]}]})},g.Mock=class extends g{constructor(){super(),this.model={styles:[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}],numFmts:[],fonts:[{size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}],borders:[{}],fills:[{type:"pattern",pattern:"none"},{type:"pattern",pattern:"gray125"}]}}parseStream(y){return y.autodrain(),Promise.resolve()}addStyleModel(y,v){return v===i.ValueType.Date?this.dateStyleId:0}get dateStyleId(){if(!this._dateStyleId){const y={numFmtId:m.getDefaultFmtId("mm-dd-yy")};this._dateStyleId=this.model.styles.length,this.model.styles.push(y)}return this._dateStyleId}getStyleModel(){return{}}},n.exports=g},{"../../../doc/enums":7,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./border-xform":127,"./dxf-xform":129,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./style-xform":134}],136:[function(t,n,l){const i=t("../base-xform");class o extends i{constructor(c){super(),this.model=c}get tag(){return"u"}render(c,s){if((s=s||this.model)===!0)c.leafNode("u");else{const d=o.Attributes[s];d&&c.leafNode("u",d)}}parseOpen(c){c.name==="u"&&(this.model=c.attributes.val||!0)}parseText(){}parseClose(){return!1}}o.Attributes={single:{},double:{val:"double"},singleAccounting:{val:"singleAccounting"},doubleAccounting:{val:"doubleAccounting"}},n.exports=o},{"../base-xform":32}],137:[function(t,n,l){const i=t("../base-xform"),o=t("./filter-column-xform");n.exports=class extends i{constructor(){super(),this.map={filterColumn:new o}}get tag(){return"autoFilter"}prepare(u){u.columns.forEach((c,s)=>{this.map.filterColumn.prepare(c,{index:s})})}render(u,c){return u.openNode(this.tag,{ref:c.autoFilterRef}),c.columns.forEach(s=>{this.map.filterColumn.render(u,s)}),u.closeNode(),!0}parseOpen(u){if(this.parser)return this.parser.parseOpen(u),!0;switch(u.name){case this.tag:return this.model={autoFilterRef:u.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[u.name],this.parser)return this.parseOpen(u),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(u))}}parseText(u){this.parser&&this.parser.parseText(u)}parseClose(u){if(this.parser)return this.parser.parseClose(u)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;if(u===this.tag)return!1;throw new Error("Unexpected xml node in parseClose: "+u)}}},{"../base-xform":32,"./filter-column-xform":139}],138:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"customFilter"}render(o,u){o.leafNode(this.tag,{val:u.val,operator:u.operator})}parseOpen(o){return o.name===this.tag&&(this.model={val:o.attributes.val,operator:o.attributes.operator},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],139:[function(t,n,l){const i=t("../base-xform"),o=t("../list-xform"),u=t("./custom-filter-xform"),c=t("./filter-xform");n.exports=class extends i{constructor(){super(),this.map={customFilters:new o({tag:"customFilters",count:!1,empty:!0,childXform:new u}),filters:new o({tag:"filters",count:!1,empty:!0,childXform:new c})}}get tag(){return"filterColumn"}prepare(s,d){s.colId=d.index.toString()}render(s,d){return d.customFilters?(s.openNode(this.tag,{colId:d.colId,hiddenButton:d.filterButton?"0":"1"}),this.map.customFilters.render(s,d.customFilters),s.closeNode(),!0):(s.leafNode(this.tag,{colId:d.colId,hiddenButton:d.filterButton?"0":"1"}),!0)}parseOpen(s){if(this.parser)return this.parser.parseOpen(s),!0;const{attributes:d}=s;switch(s.name){case this.tag:return this.model={filterButton:d.hiddenButton==="0"},!0;default:if(this.parser=this.map[s.name],this.parser)return this.parseOpen(s),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(s))}}parseText(){}parseClose(s){return this.parser?(this.parser.parseClose(s)||(this.parser=void 0),!0):s===this.tag?(this.model.customFilters=this.map.customFilters.model,!1):!0}}},{"../base-xform":32,"../list-xform":71,"./custom-filter-xform":138,"./filter-xform":140}],140:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"filter"}render(o,u){o.leafNode(this.tag,{val:u.val})}parseOpen(o){return o.name===this.tag&&(this.model={val:o.attributes.val},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],141:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"tableColumn"}prepare(o,u){o.id=u.index+1}render(o,u){return o.leafNode(this.tag,{id:u.id.toString(),name:u.name,totalsRowLabel:u.totalsRowLabel,totalsRowFunction:u.totalsRowFunction,dxfId:u.dxfId}),!0}parseOpen(o){if(o.name===this.tag){const{attributes:u}=o;return this.model={name:u.name,totalsRowLabel:u.totalsRowLabel,totalsRowFunction:u.totalsRowFunction,dxfId:u.dxfId},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],142:[function(t,n,l){const i=t("../base-xform");n.exports=class extends i{get tag(){return"tableStyleInfo"}render(o,u){return o.leafNode(this.tag,{name:u.theme?u.theme:void 0,showFirstColumn:u.showFirstColumn?"1":"0",showLastColumn:u.showLastColumn?"1":"0",showRowStripes:u.showRowStripes?"1":"0",showColumnStripes:u.showColumnStripes?"1":"0"}),!0}parseOpen(o){if(o.name===this.tag){const{attributes:u}=o;return this.model={theme:u.name?u.name:null,showFirstColumn:u.showFirstColumn==="1",showLastColumn:u.showLastColumn==="1",showRowStripes:u.showRowStripes==="1",showColumnStripes:u.showColumnStripes==="1"},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(t,n,l){const i=t("../../../utils/xml-stream"),o=t("../base-xform"),u=t("../list-xform"),c=t("./auto-filter-xform"),s=t("./table-column-xform"),d=t("./table-style-info-xform");class f extends o{constructor(){super(),this.map={autoFilter:new c,tableColumns:new u({tag:"tableColumns",count:!0,empty:!0,childXform:new s}),tableStyleInfo:new d}}prepare(m,p){this.map.autoFilter.prepare(m),this.map.tableColumns.prepare(m.columns,p)}get tag(){return"table"}render(m,p){m.openXml(i.StdDocAttributes),m.openNode(this.tag,{...f.TABLE_ATTRIBUTES,id:p.id,name:p.name,displayName:p.displayName||p.name,ref:p.tableRef,totalsRowCount:p.totalsRow?"1":void 0,totalsRowShown:p.totalsRow?void 0:"1",headerRowCount:p.headerRow?"1":"0"}),this.map.autoFilter.render(m,p),this.map.tableColumns.render(m,p.columns),this.map.tableStyleInfo.render(m,p.style),m.closeNode()}parseOpen(m){if(this.parser)return this.parser.parseOpen(m),!0;const{name:p,attributes:x}=m;return p===this.tag?(this.reset(),this.model={name:x.name,displayName:x.displayName||x.name,tableRef:x.ref,totalsRow:x.totalsRowCount==="1",headerRow:x.headerRowCount==="1"}):(this.parser=this.map[m.name],this.parser&&this.parser.parseOpen(m)),!0}parseText(m){this.parser&&this.parser.parseText(m)}parseClose(m){return this.parser?(this.parser.parseClose(m)||(this.parser=void 0),!0):m===this.tag?(this.model.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach((p,x)=>{this.model.columns[x].filterButton=p.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1):!0}reconcile(m,p){m.columns.forEach(x=>{x.dxfId!==void 0&&(x.style=p.styles.getDxfStyle(x.dxfId))})}}f.TABLE_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"},n.exports=f},{"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":137,"./table-column-xform":141,"./table-style-info-xform":142}],144:[function(t,n,l){(function(i,o){(function(){const u=t("fs"),c=t("jszip"),{PassThrough:s}=t("readable-stream"),d=t("../utils/zip-stream"),f=t("../utils/stream-buf"),h=t("../utils/utils"),m=t("../utils/xml-stream"),{bufferToString:p}=t("../utils/browser-buffer-decode"),x=t("./xform/style/styles-xform"),g=t("./xform/core/core-xform"),y=t("./xform/strings/shared-strings-xform"),v=t("./xform/core/relationships-xform"),_=t("./xform/core/content-types-xform"),C=t("./xform/core/app-xform"),M=t("./xform/book/workbook-xform"),T=t("./xform/sheet/worksheet-xform"),U=t("./xform/drawing/drawing-xform"),F=t("./xform/table/table-xform"),H=t("./xform/comment/comments-xform"),W=t("./xform/comment/vml-notes-xform"),K=t("./xml/theme1");class ${constructor(L){this.workbook=L}async readFile(L,E){if(!await h.fs.exists(L))throw new Error("File not found: "+L);const j=u.createReadStream(L);try{const k=await this.read(j,E);return j.close(),k}catch(k){throw j.close(),k}}parseRels(L){return new v().parseStream(L)}parseWorkbook(L){return new M().parseStream(L)}parseSharedStrings(L){return new y().parseStream(L)}reconcile(L,E){const j=new M,k=new T(E),S=new U,N=new F;j.reconcile(L);const O={media:L.media,mediaIndex:L.mediaIndex};Object.keys(L.drawings).forEach(Y=>{const Z=L.drawings[Y],ne=L.drawingRels[Y];ne&&(O.rels=ne.reduce((q,ee)=>(q[ee.Id]=ee,q),{}),(Z.anchors||[]).forEach(q=>{const ee=q.picture&&q.picture.hyperlinks;ee&&O.rels[ee.rId]&&(ee.hyperlink=O.rels[ee.rId].Target,delete ee.rId)}),S.reconcile(Z,O))});const D={styles:L.styles};Object.values(L.tables).forEach(Y=>{N.reconcile(Y,D)});const B={styles:L.styles,sharedStrings:L.sharedStrings,media:L.media,mediaIndex:L.mediaIndex,date1904:L.properties&&L.properties.date1904,drawings:L.drawings,comments:L.comments,tables:L.tables,vmlDrawings:L.vmlDrawings};L.worksheets.forEach(Y=>{Y.relationships=L.worksheetRels[Y.sheetNo],k.reconcile(Y,B)}),delete L.worksheetHash,delete L.worksheetRels,delete L.globalRels,delete L.sharedStrings,delete L.workbookRels,delete L.sheetDefs,delete L.styles,delete L.mediaIndex,delete L.drawings,delete L.drawingRels,delete L.vmlDrawings}async _processWorksheetEntry(L,E,j,k,S){const N=new T(k),O=await N.parseStream(L);O.sheetNo=j,E.worksheetHash[S]=O,E.worksheets.push(O)}async _processCommentEntry(L,E,j){const k=new H,S=await k.parseStream(L);E.comments[`../${j}.xml`]=S}async _processTableEntry(L,E,j){const k=new F,S=await k.parseStream(L);E.tables[`../tables/${j}.xml`]=S}async _processWorksheetRelsEntry(L,E,j){const k=new v,S=await k.parseStream(L);E.worksheetRels[j]=S}async _processMediaEntry(L,E,j){const k=j.lastIndexOf(".");if(k>=1){const S=j.substr(k+1),N=j.substr(0,k);await new Promise((O,D)=>{const B=new f;B.on("finish",()=>{E.mediaIndex[j]=E.media.length,E.mediaIndex[N]=E.media.length;const Y={type:"image",name:N,extension:S,buffer:B.toBuffer()};E.media.push(Y),O()}),L.on("error",Y=>{D(Y)}),L.pipe(B)})}}async _processDrawingEntry(L,E,j){const k=new U,S=await k.parseStream(L);E.drawings[j]=S}async _processDrawingRelsEntry(L,E,j){const k=new v,S=await k.parseStream(L);E.drawingRels[j]=S}async _processVmlDrawingEntry(L,E,j){const k=new W,S=await k.parseStream(L);E.vmlDrawings[`../drawings/${j}.vml`]=S}async _processThemeEntry(L,E,j){await new Promise((k,S)=>{const N=new f;L.on("error",S),N.on("error",S),N.on("finish",()=>{E.themes[j]=N.read().toString(),k()}),L.pipe(N)})}createInputStream(){throw new Error("`XLSX#createInputStream` is deprecated. You should use `XLSX#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}async read(L,E){!L[Symbol.asyncIterator]&&L.pipe&&(L=L.pipe(new s));const j=[];for await(const k of L)j.push(k);return this.load(o.concat(j),E)}async load(L,E){let j;j=E&&E.base64?o.from(L.toString(),"base64"):L;const k={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},S=await c.loadAsync(j);for(const N of Object.values(S.files))if(!N.dir){let O,D=N.name;if(D[0]==="/"&&(D=D.substr(1)),D.match(/xl\/media\//)||D.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))O=new s,O.write(await N.async("nodebuffer"));else{let B;O=new s({writableObjectMode:!0,readableObjectMode:!0}),B=i.browser?p(await N.async("nodebuffer")):await N.async("string");const Y=16384;for(let Z=0;Z{if(j.type==="image"){const k=`xl/media/${j.name}.${j.extension}`;if(j.filename){const S=await(function(N,O){return new Promise((D,B)=>{u.readFile(N,O,(Y,Z)=>{Y?B(Y):D(Z)})})})(j.filename);return L.append(S,{name:k})}if(j.buffer)return L.append(j.buffer,{name:k});if(j.base64){const S=j.base64,N=S.substring(S.indexOf(",")+1);return L.append(N,{name:k,base64:!0})}}throw new Error("Unsupported media")}))}addDrawings(L,E){const j=new U,k=new v;E.worksheets.forEach(S=>{const{drawing:N}=S;if(N){j.prepare(N,{});let O=j.toXml(N);L.append(O,{name:`xl/drawings/${N.name}.xml`}),O=k.toXml(N.rels),L.append(O,{name:`xl/drawings/_rels/${N.name}.xml.rels`})}})}addTables(L,E){const j=new F;E.worksheets.forEach(k=>{const{tables:S}=k;S.forEach(N=>{j.prepare(N,{});const O=j.toXml(N);L.append(O,{name:"xl/tables/"+N.target})})})}async addContentTypes(L,E){const j=new _().toXml(E);L.append(j,{name:"[Content_Types].xml"})}async addApp(L,E){const j=new C().toXml(E);L.append(j,{name:"docProps/app.xml"})}async addCore(L,E){const j=new g;L.append(j.toXml(E),{name:"docProps/core.xml"})}async addThemes(L,E){const j=E.themes||{theme1:K};Object.keys(j).forEach(k=>{const S=j[k],N=`xl/theme/${k}.xml`;L.append(S,{name:N})})}async addOfficeRels(L){const E=new v().toXml([{Id:"rId1",Type:$.RelType.OfficeDocument,Target:"xl/workbook.xml"},{Id:"rId2",Type:$.RelType.CoreProperties,Target:"docProps/core.xml"},{Id:"rId3",Type:$.RelType.ExtenderProperties,Target:"docProps/app.xml"}]);L.append(E,{name:"_rels/.rels"})}async addWorkbookRels(L,E){let j=1;const k=[{Id:"rId"+j++,Type:$.RelType.Styles,Target:"styles.xml"},{Id:"rId"+j++,Type:$.RelType.Theme,Target:"theme/theme1.xml"}];E.sharedStrings.count&&k.push({Id:"rId"+j++,Type:$.RelType.SharedStrings,Target:"sharedStrings.xml"}),E.worksheets.forEach(N=>{N.rId="rId"+j++,k.push({Id:N.rId,Type:$.RelType.Worksheet,Target:`worksheets/sheet${N.id}.xml`})});const S=new v().toXml(k);L.append(S,{name:"xl/_rels/workbook.xml.rels"})}async addSharedStrings(L,E){E.sharedStrings&&E.sharedStrings.count&&L.append(E.sharedStrings.xml,{name:"xl/sharedStrings.xml"})}async addStyles(L,E){const{xml:j}=E.styles;j&&L.append(j,{name:"xl/styles.xml"})}async addWorkbook(L,E){const j=new M;L.append(j.toXml(E),{name:"xl/workbook.xml"})}async addWorksheets(L,E){const j=new T,k=new v,S=new H,N=new W;E.worksheets.forEach(O=>{let D=new m;j.render(D,O),L.append(D.xml,{name:`xl/worksheets/sheet${O.id}.xml`}),O.rels&&O.rels.length&&(D=new m,k.render(D,O.rels),L.append(D.xml,{name:`xl/worksheets/_rels/sheet${O.id}.xml.rels`})),O.comments.length>0&&(D=new m,S.render(D,O),L.append(D.xml,{name:`xl/comments${O.id}.xml`}),D=new m,N.render(D,O),L.append(D.xml,{name:`xl/drawings/vmlDrawing${O.id}.vml`}))})}_finalize(L){return new Promise((E,j)=>{L.on("finish",()=>{E(this)}),L.on("error",j),L.finalize()})}prepareModel(L,E){L.creator=L.creator||"ExcelJS",L.lastModifiedBy=L.lastModifiedBy||"ExcelJS",L.created=L.created||new Date,L.modified=L.modified||new Date,L.useSharedStrings=E.useSharedStrings===void 0||E.useSharedStrings,L.useStyles=E.useStyles===void 0||E.useStyles,L.sharedStrings=new y,L.styles=L.useStyles?new x(!0):new x.Mock;const j=new M,k=new T;j.prepare(L);const S={sharedStrings:L.sharedStrings,styles:L.styles,date1904:L.properties.date1904,drawingsCount:0,media:L.media};S.drawings=L.drawings=[],S.commentRefs=L.commentRefs=[];let N=0;L.tables=[],L.worksheets.forEach(O=>{O.tables.forEach(D=>{N++,D.target=`table${N}.xml`,D.id=N,L.tables.push(D)}),k.prepare(O,S)})}async write(L,E){E=E||{};const{model:j}=this.workbook,k=new d.ZipWriter(E.zip);return k.pipe(L),this.prepareModel(j,E),await this.addContentTypes(k,j),await this.addOfficeRels(k,j),await this.addWorkbookRels(k,j),await this.addWorksheets(k,j),await this.addSharedStrings(k,j),await this.addDrawings(k,j),await this.addTables(k,j),await Promise.all([this.addThemes(k,j),this.addStyles(k,j)]),await this.addMedia(k,j),await Promise.all([this.addApp(k,j),this.addCore(k,j)]),await this.addWorkbook(k,j),this._finalize(k)}writeFile(L,E){const j=u.createWriteStream(L);return new Promise((k,S)=>{j.on("finish",()=>{k()}),j.on("error",N=>{S(N)}),this.write(j,E).then(()=>{j.end()}).catch(N=>{S(N)})})}async writeBuffer(L){const E=new f;return await this.write(E,L),E.read()}}$.RelType=t("./rel-type"),n.exports=$}).call(this)}).call(this,t("_process"),t("buffer").Buffer)},{"../utils/browser-buffer-decode":16,"../utils/stream-buf":24,"../utils/utils":27,"../utils/xml-stream":28,"../utils/zip-stream":29,"./rel-type":31,"./xform/book/workbook-xform":38,"./xform/comment/comments-xform":40,"./xform/comment/vml-notes-xform":45,"./xform/core/app-xform":51,"./xform/core/content-types-xform":52,"./xform/core/core-xform":53,"./xform/core/relationships-xform":55,"./xform/drawing/drawing-xform":62,"./xform/sheet/worksheet-xform":115,"./xform/strings/shared-strings-xform":124,"./xform/style/styles-xform":135,"./xform/table/table-xform":143,"./xml/theme1":145,_process:467,buffer:220,fs:216,jszip:441,"readable-stream":491}],145:[function(t,n,l){n.exports=` `},{}],146:[function(t,n,l){(function(i){(function(){Object.defineProperty(l,"__esModule",{value:!0}),l.CsvFormatterStream=void 0;const o=t("stream"),u=t("./formatter");class c extends o.Transform{constructor(d){super({writableObjectMode:d.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=d,this.rowFormatter=new u.RowFormatter(d),this.hasWrittenBOM=!d.writeBOM}transform(d){return this.rowFormatter.rowTransform=d,this}_transform(d,f,h){let m=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(d,(p,x)=>p?(m=!0,h(p)):(x&&x.forEach(g=>{this.push(i.from(g,"utf8"))}),m=!0,h()))}catch(p){if(m)throw p;h(p)}}_flush(d){this.rowFormatter.finish((f,h)=>f?d(f):(h&&h.forEach(m=>{this.push(i.from(m,"utf8"))}),d()))}}l.CsvFormatterStream=c}).call(this)}).call(this,t("buffer").Buffer)},{"./formatter":150,buffer:220,stream:505}],147:[function(t,n,l){Object.defineProperty(l,"__esModule",{value:!0}),l.FormatterOptions=void 0,l.FormatterOptions=class{constructor(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var o;this.objectMode=!0,this.delimiter=",",this.rowDelimiter=` `,this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\uFEFF",this.alwaysWriteHeaders=!1,Object.assign(this,i||{}),i?.quoteHeaders===void 0&&(this.quoteHeaders=this.quoteColumns),i?.quote===!0?this.quote='"':i?.quote===!1&&(this.quote=""),typeof i?.escape!="string"&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&((o=i.writeHeaders)===null||o===void 0||o),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}},{}],148:[function(t,n,l){var i=function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(l,"__esModule",{value:!0}),l.FieldFormatter=void 0;const o=i(t("lodash.isboolean")),u=i(t("lodash.isnil")),c=i(t("lodash.escaperegexp"));l.FieldFormatter=class{constructor(s){this._headers=null,this.formatterOptions=s,s.headers!==null&&(this.headers=s.headers),this.REPLACE_REGEXP=new RegExp(s.quote,"g");const d=`[${s.delimiter}${c.default(s.rowDelimiter)}|\r| ]`;this.ESCAPE_REGEXP=new RegExp(d)}set headers(s){this._headers=s}shouldQuote(s,d){const f=d?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return o.default(f)?f:Array.isArray(f)?f[s]:this._headers!==null&&f[this._headers[s]]}format(s,d,f){const h=(""+(u.default(s)?"":s)).replace(/\0/g,""),{formatterOptions:m}=this;return m.quote!==""&&h.indexOf(m.quote)!==-1?this.quoteField(h.replace(this.REPLACE_REGEXP,m.escapedQuote)):h.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(d,f)?this.quoteField(h):h}quoteField(s){const{quote:d}=this.formatterOptions;return`${d}${s}${d}`}}},{"lodash.escaperegexp":442,"lodash.isboolean":444,"lodash.isnil":447}],149:[function(t,n,l){var i=function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(l,"__esModule",{value:!0}),l.RowFormatter=void 0;const o=i(t("lodash.isfunction")),u=i(t("lodash.isequal")),c=t("./FieldFormatter"),s=t("../types");class d{constructor(h){this.rowCount=0,this.formatterOptions=h,this.fieldFormatter=new c.FieldFormatter(h),this.headers=h.headers,this.shouldWriteHeaders=h.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null&&(this.fieldFormatter.headers=this.headers),h.transform&&(this.rowTransform=h.transform)}static isRowHashArray(h){return!!Array.isArray(h)&&Array.isArray(h[0])&&h[0].length===2}static isRowArray(h){return Array.isArray(h)&&!this.isRowHashArray(h)}static gatherHeaders(h){return d.isRowHashArray(h)?h.map(m=>m[0]):Array.isArray(h)?h:Object.keys(h)}static createTransform(h){return s.isSyncTransform(h)?(m,p)=>{let x=null;try{x=h(m)}catch(g){return p(g)}return p(null,x)}:(m,p)=>{h(m,p)}}set rowTransform(h){if(!o.default(h))throw new TypeError("The transform should be a function");this._rowTransform=d.createTransform(h)}format(h,m){this.callTransformer(h,(p,x)=>{if(p)return m(p);if(!h)return m(null);const g=[];if(x){const{shouldFormatColumns:y,headers:v}=this.checkHeaders(x);if(this.shouldWriteHeaders&&v&&!this.hasWrittenHeaders&&(g.push(this.formatColumns(v,!0)),this.hasWrittenHeaders=!0),y){const _=this.gatherColumns(x);g.push(this.formatColumns(_,!1))}}return m(null,g)})}finish(h){const m=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return h(new Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));m.push(this.formatColumns(this.headers,!0))}return this.formatterOptions.includeEndRowDelimiter&&m.push(this.formatterOptions.rowDelimiter),h(null,m)}checkHeaders(h){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};const m=d.gatherHeaders(h);return this.headers=m,this.fieldFormatter.headers=m,this.shouldWriteHeaders?{shouldFormatColumns:!u.default(m,h),headers:m}:{shouldFormatColumns:!0,headers:null}}gatherColumns(h){if(this.headers===null)throw new Error("Headers is currently null");return Array.isArray(h)?d.isRowHashArray(h)?this.headers.map((m,p)=>{const x=h[p];return x?x[1]:""}):d.isRowArray(h)&&!this.shouldWriteHeaders?h:this.headers.map((m,p)=>h[p]):this.headers.map(m=>h[m])}callTransformer(h,m){return this._rowTransform?this._rowTransform(h,m):m(null,h)}formatColumns(h,m){const p=h.map((g,y)=>this.fieldFormatter.format(g,y,m)).join(this.formatterOptions.delimiter),{rowCount:x}=this;return this.rowCount+=1,x?[this.formatterOptions.rowDelimiter,p].join(""):p}}l.RowFormatter=d},{"../types":152,"./FieldFormatter":148,"lodash.isequal":445,"lodash.isfunction":446}],150:[function(t,n,l){Object.defineProperty(l,"__esModule",{value:!0}),l.FieldFormatter=l.RowFormatter=void 0;var i=t("./RowFormatter");Object.defineProperty(l,"RowFormatter",{enumerable:!0,get:function(){return i.RowFormatter}});var o=t("./FieldFormatter");Object.defineProperty(l,"FieldFormatter",{enumerable:!0,get:function(){return o.FieldFormatter}})},{"./FieldFormatter":148,"./RowFormatter":149}],151:[function(t,n,l){(function(i){(function(){var o=Object.create?function(y,v,_,C){C===void 0&&(C=_),Object.defineProperty(y,C,{enumerable:!0,get:function(){return v[_]}})}:function(y,v,_,C){C===void 0&&(C=_),y[C]=v[_]},u=Object.create?function(y,v){Object.defineProperty(y,"default",{enumerable:!0,value:v})}:function(y,v){y.default=v},c=function(y){if(y&&y.__esModule)return y;var v={};if(y!=null)for(var _ in y)_!=="default"&&Object.prototype.hasOwnProperty.call(y,_)&&o(v,y,_);return u(v,y),v},s=function(y,v){for(var _ in y)_==="default"||Object.prototype.hasOwnProperty.call(v,_)||o(v,y,_)};Object.defineProperty(l,"__esModule",{value:!0}),l.writeToPath=l.writeToString=l.writeToBuffer=l.writeToStream=l.write=l.format=l.FormatterOptions=l.CsvFormatterStream=void 0;const d=t("util"),f=t("stream"),h=c(t("fs")),m=t("./FormatterOptions"),p=t("./CsvFormatterStream");s(t("./types"),l);var x=t("./CsvFormatterStream");Object.defineProperty(l,"CsvFormatterStream",{enumerable:!0,get:function(){return x.CsvFormatterStream}});var g=t("./FormatterOptions");Object.defineProperty(l,"FormatterOptions",{enumerable:!0,get:function(){return g.FormatterOptions}}),l.format=y=>new p.CsvFormatterStream(new m.FormatterOptions(y)),l.write=(y,v)=>{const _=l.format(v),C=d.promisify((M,T)=>{_.write(M,void 0,T)});return y.reduce((M,T)=>M.then(()=>C(T)),Promise.resolve()).then(()=>_.end()).catch(M=>{_.emit("error",M)}),_},l.writeToStream=(y,v,_)=>l.write(v,_).pipe(y),l.writeToBuffer=function(y){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const _=[],C=new f.Writable({write(M,T,U){_.push(M),U()}});return new Promise((M,T)=>{C.on("error",T).on("finish",()=>M(i.concat(_))),l.write(y,v).pipe(C)})},l.writeToString=(y,v)=>l.writeToBuffer(y,v).then(_=>_.toString()),l.writeToPath=(y,v,_)=>{const C=h.createWriteStream(y,{encoding:"utf8"});return l.write(v,_).pipe(C)}}).call(this)}).call(this,t("buffer").Buffer)},{"./CsvFormatterStream":146,"./FormatterOptions":147,"./types":152,buffer:220,fs:216,stream:505,util:527}],152:[function(t,n,l){Object.defineProperty(l,"__esModule",{value:!0}),l.isSyncTransform=void 0,l.isSyncTransform=i=>i.length===1},{}],153:[function(t,n,l){(function(i){(function(){Object.defineProperty(l,"__esModule",{value:!0}),l.CsvParserStream=void 0;const o=t("string_decoder"),u=t("stream"),c=t("./transforms"),s=t("./parser");class d extends u.Transform{constructor(h){super({objectMode:h.objectMode}),this.lines="",this.rowCount=0,this.parsedRowCount=0,this.parsedLineCount=0,this.endEmitted=!1,this.headersEmitted=!1,this.parserOptions=h,this.parser=new s.Parser(h),this.headerTransformer=new c.HeaderTransformer(h),this.decoder=new o.StringDecoder(h.encoding),this.rowTransformerValidator=new c.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(h){return this.rowTransformerValidator.rowTransform=h,this}validate(h){return this.rowTransformerValidator.rowValidator=h,this}emit(h){if(h==="end")return this.endEmitted||(this.endEmitted=!0,super.emit("end",this.rowCount)),!1;for(var m=arguments.length,p=new Array(m>1?m-1:0),x=1;x{const y=C=>C?m(C):g%100!=0?x(g+1):void i(()=>x(g+1));if(this.checkAndEmitHeaders(),g>=p||this.hasHitRowLimit)return m();if(this.parsedLineCount+=1,this.shouldSkipLine)return y();const v=h[g];this.rowCount+=1,this.parsedRowCount+=1;const _=this.rowCount;return this.transformRow(v,(C,M)=>{if(C)return this.rowCount-=1,y(C);if(!M)return y(new Error("expected transform result"));if(M.isValid){if(M.row)return this.pushRow(M.row,y)}else this.emit("data-invalid",M.row,_,M.reason);return y()})};x(0)}transformRow(h,m){try{this.headerTransformer.transform(h,(p,x)=>p?m(p):x?x.isValid?x.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(x.row,m):this.skipRow(m):(this.rowCount-=1,this.parsedRowCount-=1,m(null,{row:null,isValid:!0})):this.shouldEmitRows?m(null,{isValid:!1,row:h}):this.skipRow(m):m(new Error("Expected result from header transform")))}catch(p){m(p)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit("headers",this.headerTransformer.headers))}skipRow(h){return this.rowCount-=1,h(null,{row:null,isValid:!0})}pushRow(h,m){try{this.parserOptions.objectMode?this.push(h):this.push(JSON.stringify(h)),m()}catch(p){m(p)}}static wrapDoneCallback(h){let m=!1;return function(p){if(p){if(m)throw p;return m=!0,void h(p)}for(var x=arguments.length,g=new Array(x>1?x-1:0),y=1;y1)throw new Error("delimiter option must be one character long");this.escapedDelimiter=o.default(this.delimiter),this.escapeChar=(s=this.escape)!==null&&s!==void 0?s:this.quote,this.supportsComments=!u.default(this.comment),this.NEXT_TOKEN_REGEXP=new RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`),this.maxRows>0&&(this.limitRows=!0)}}},{"lodash.escaperegexp":442,"lodash.isnil":447}],155:[function(t,n,l){var i=Object.create?function(x,g,y,v){v===void 0&&(v=y),Object.defineProperty(x,v,{enumerable:!0,get:function(){return g[y]}})}:function(x,g,y,v){v===void 0&&(v=y),x[v]=g[y]},o=Object.create?function(x,g){Object.defineProperty(x,"default",{enumerable:!0,value:g})}:function(x,g){x.default=g},u=function(x){if(x&&x.__esModule)return x;var g={};if(x!=null)for(var y in x)y!=="default"&&Object.prototype.hasOwnProperty.call(x,y)&&i(g,x,y);return o(g,x),g},c=function(x,g){for(var y in x)y==="default"||Object.prototype.hasOwnProperty.call(g,y)||i(g,x,y)};Object.defineProperty(l,"__esModule",{value:!0}),l.parseString=l.parseFile=l.parseStream=l.parse=l.ParserOptions=l.CsvParserStream=void 0;const s=u(t("fs")),d=t("stream"),f=t("./ParserOptions"),h=t("./CsvParserStream");c(t("./types"),l);var m=t("./CsvParserStream");Object.defineProperty(l,"CsvParserStream",{enumerable:!0,get:function(){return m.CsvParserStream}});var p=t("./ParserOptions");Object.defineProperty(l,"ParserOptions",{enumerable:!0,get:function(){return p.ParserOptions}}),l.parse=x=>new h.CsvParserStream(new f.ParserOptions(x)),l.parseStream=(x,g)=>x.pipe(new h.CsvParserStream(new f.ParserOptions(g))),l.parseFile=function(x){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return s.createReadStream(x).pipe(new h.CsvParserStream(new f.ParserOptions(g)))},l.parseString=(x,g)=>{const y=new d.Readable;return y.push(x),y.push(null),y.pipe(new h.CsvParserStream(new f.ParserOptions(g)))}},{"./CsvParserStream":153,"./ParserOptions":154,"./types":169,fs:216,stream:505}],156:[function(t,n,l){Object.defineProperty(l,"__esModule",{value:!0}),l.Parser=void 0;const i=t("./Scanner"),o=t("./RowParser"),u=t("./Token");class c{constructor(d){this.parserOptions=d,this.rowParser=new o.RowParser(this.parserOptions)}static removeBOM(d){return d&&d.charCodeAt(0)===65279?d.slice(1):d}parse(d,f){const h=new i.Scanner({line:c.removeBOM(d),parserOptions:this.parserOptions,hasMoreData:f});return this.parserOptions.supportsComments?this.parseWithComments(h):this.parseWithoutComments(h)}parseWithoutComments(d){const f=[];let h=!0;for(;h;)h=this.parseRow(d,f);return{line:d.line,rows:f}}parseWithComments(d){const{parserOptions:f}=this,h=[];for(let m=d.nextCharacterToken;m!==null;m=d.nextCharacterToken)if(u.Token.isTokenComment(m,f)){if(d.advancePastLine()===null)return{line:d.lineFromCursor,rows:h};if(!d.hasMoreCharacters)return{line:d.lineFromCursor,rows:h};d.truncateToCursor()}else if(!this.parseRow(d,h))break;return{line:d.line,rows:h}}parseRow(d,f){if(!d.nextNonSpaceToken)return!1;const h=this.rowParser.parse(d);return h!==null&&(this.parserOptions.ignoreEmpty&&o.RowParser.isEmptyRow(h)||f.push(h),!0)}}l.Parser=c},{"./RowParser":157,"./Scanner":158,"./Token":159}],157:[function(t,n,l){Object.defineProperty(l,"__esModule",{value:!0}),l.RowParser=void 0;const i=t("./column"),o=t("./Token");l.RowParser=class{constructor(u){this.parserOptions=u,this.columnParser=new i.ColumnParser(u)}static isEmptyRow(u){return u.join("").replace(/\s+/g,"")===""}parse(u){const{parserOptions:c}=this,{hasMoreData:s}=u,d=u,f=[];let h=this.getStartToken(d,f);for(;h;){if(o.Token.isTokenRowDelimiter(h))return d.advancePastToken(h),!d.hasMoreCharacters&&o.Token.isTokenCarriageReturn(h,c)&&s?null:(d.truncateToCursor(),f);if(!this.shouldSkipColumnParse(d,h,f)){const m=this.columnParser.parse(d);if(m===null)return null;f.push(m)}h=d.nextNonSpaceToken}return s?null:(d.truncateToCursor(),f)}getStartToken(u,c){const s=u.nextNonSpaceToken;return s!==null&&o.Token.isTokenDelimiter(s,this.parserOptions)?(c.push(""),u.nextNonSpaceToken):s}shouldSkipColumnParse(u,c,s){const{parserOptions:d}=this;if(o.Token.isTokenDelimiter(c,d)){u.advancePastToken(c);const f=u.nextCharacterToken;if(!u.hasMoreCharacters||f!==null&&o.Token.isTokenRowDelimiter(f)||f!==null&&o.Token.isTokenDelimiter(f,d))return s.push(""),!0}return!1}}},{"./Token":159,"./column":164}],158:[function(t,n,l){Object.defineProperty(l,"__esModule",{value:!0}),l.Scanner=void 0;const i=t("./Token"),o=/((?:\r\n)|\n|\r)/;l.Scanner=class{constructor(u){this.cursor=0,this.line=u.line,this.lineLength=this.line.length,this.parserOptions=u.parserOptions,this.hasMoreData=u.hasMoreData,this.cursor=u.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){const{lineFromCursor:u}=this,c=this.parserOptions.NEXT_TOKEN_REGEXP;if(u.search(c)===-1)return null;const s=c.exec(u);if(s==null)return null;const d=s[1],f=this.cursor+(s.index||0);return new i.Token({token:d,startCursor:f,endCursor:f+d.length-1})}get nextCharacterToken(){const{cursor:u,lineLength:c}=this;return c<=u?null:new i.Token({token:this.line[u],startCursor:u,endCursor:u})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){const u=o.exec(this.lineFromCursor);return u?(this.cursor+=(u.index||0)+u[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(u){return this.cursor=u,this}advanceToToken(u){return this.cursor=u.startCursor,this}advancePastToken(u){return this.cursor=u.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}},{"./Token":159}],159:[function(t,n,l){Object.defineProperty(l,"__esModule",{value:!0}),l.Token=void 0,l.Token=class{constructor(i){this.token=i.token,this.startCursor=i.startCursor,this.endCursor=i.endCursor}static isTokenRowDelimiter(i){const o=i.token;return o==="\r"||o===` `||o===`\r `}static isTokenCarriageReturn(i,o){return i.token===o.carriageReturn}static isTokenComment(i,o){return o.supportsComments&&!!i&&i.token===o.comment}static isTokenEscapeCharacter(i,o){return i.token===o.escapeChar}static isTokenQuote(i,o){return i.token===o.quote}static isTokenDelimiter(i,o){return i.token===o.delimiter}}},{}],160:[function(t,n,l){Object.defineProperty(l,"__esModule",{value:!0}),l.ColumnFormatter=void 0,l.ColumnFormatter=class{constructor(i){i.trim?this.format=o=>o.trim():i.ltrim?this.format=o=>o.trimLeft():i.rtrim?this.format=o=>o.trimRight():this.format=o=>o}}},{}],161:[function(t,n,l){Object.defineProperty(l,"__esModule",{value:!0}),l.ColumnParser=void 0;const i=t("./NonQuotedColumnParser"),o=t("./QuotedColumnParser"),u=t("../Token");l.ColumnParser=class{constructor(c){this.parserOptions=c,this.quotedColumnParser=new o.QuotedColumnParser(c),this.nonQuotedColumnParser=new i.NonQuotedColumnParser(c)}parse(c){const{nextNonSpaceToken:s}=c;return s!==null&&u.Token.isTokenQuote(s,this.parserOptions)?(c.advanceToToken(s),this.quotedColumnParser.parse(c)):this.nonQuotedColumnParser.parse(c)}}},{"../Token":159,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],162:[function(t,n,l){Object.defineProperty(l,"__esModule",{value:!0}),l.NonQuotedColumnParser=void 0;const i=t("./ColumnFormatter"),o=t("../Token");l.NonQuotedColumnParser=class{constructor(u){this.parserOptions=u,this.columnFormatter=new i.ColumnFormatter(u)}parse(u){if(!u.hasMoreCharacters)return null;const{parserOptions:c}=this,s=[];let d=u.nextCharacterToken;for(;d&&!o.Token.isTokenDelimiter(d,c)&&!o.Token.isTokenRowDelimiter(d);d=u.nextCharacterToken)s.push(d.token),u.advancePastToken(d);return this.columnFormatter.format(s.join(""))}}},{"../Token":159,"./ColumnFormatter":160}],163:[function(t,n,l){Object.defineProperty(l,"__esModule",{value:!0}),l.QuotedColumnParser=void 0;const i=t("./ColumnFormatter"),o=t("../Token");l.QuotedColumnParser=class{constructor(u){this.parserOptions=u,this.columnFormatter=new i.ColumnFormatter(u)}parse(u){if(!u.hasMoreCharacters)return null;const c=u.cursor,{foundClosingQuote:s,col:d}=this.gatherDataBetweenQuotes(u);if(!s){if(u.advanceTo(c),!u.hasMoreData)throw new Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${u.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn(u),d}gatherDataBetweenQuotes(u){const{parserOptions:c}=this;let s=!1,d=!1;const f=[];let h=u.nextCharacterToken;for(;!d&&h!==null;h=u.nextCharacterToken){const m=o.Token.isTokenQuote(h,c);if(!s&&m)s=!0;else if(s)if(o.Token.isTokenEscapeCharacter(h,c)){u.advancePastToken(h);const p=u.nextCharacterToken;p!==null&&(o.Token.isTokenQuote(p,c)||o.Token.isTokenEscapeCharacter(p,c))?(f.push(p.token),h=p):m?d=!0:f.push(h.token)}else m?d=!0:f.push(h.token);u.advancePastToken(h)}return{col:this.columnFormatter.format(f.join("")),foundClosingQuote:d}}checkForMalformedColumn(u){const{parserOptions:c}=this,{nextNonSpaceToken:s}=u;if(s){const d=o.Token.isTokenDelimiter(s,c),f=o.Token.isTokenRowDelimiter(s);if(!d&&!f){const h=u.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw new Error(`Parse Error: expected: '${c.escapedDelimiter}' OR new line got: '${s.token}'. at '${h}`)}u.advanceToToken(s)}else u.hasMoreData||u.advancePastLine()}}},{"../Token":159,"./ColumnFormatter":160}],164:[function(t,n,l){Object.defineProperty(l,"__esModule",{value:!0}),l.ColumnFormatter=l.QuotedColumnParser=l.NonQuotedColumnParser=l.ColumnParser=void 0;var i=t("./ColumnParser");Object.defineProperty(l,"ColumnParser",{enumerable:!0,get:function(){return i.ColumnParser}});var o=t("./NonQuotedColumnParser");Object.defineProperty(l,"NonQuotedColumnParser",{enumerable:!0,get:function(){return o.NonQuotedColumnParser}});var u=t("./QuotedColumnParser");Object.defineProperty(l,"QuotedColumnParser",{enumerable:!0,get:function(){return u.QuotedColumnParser}});var c=t("./ColumnFormatter");Object.defineProperty(l,"ColumnFormatter",{enumerable:!0,get:function(){return c.ColumnFormatter}})},{"./ColumnFormatter":160,"./ColumnParser":161,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],165:[function(t,n,l){Object.defineProperty(l,"__esModule",{value:!0}),l.QuotedColumnParser=l.NonQuotedColumnParser=l.ColumnParser=l.Token=l.Scanner=l.RowParser=l.Parser=void 0;var i=t("./Parser");Object.defineProperty(l,"Parser",{enumerable:!0,get:function(){return i.Parser}});var o=t("./RowParser");Object.defineProperty(l,"RowParser",{enumerable:!0,get:function(){return o.RowParser}});var u=t("./Scanner");Object.defineProperty(l,"Scanner",{enumerable:!0,get:function(){return u.Scanner}});var c=t("./Token");Object.defineProperty(l,"Token",{enumerable:!0,get:function(){return c.Token}});var s=t("./column");Object.defineProperty(l,"ColumnParser",{enumerable:!0,get:function(){return s.ColumnParser}}),Object.defineProperty(l,"NonQuotedColumnParser",{enumerable:!0,get:function(){return s.NonQuotedColumnParser}}),Object.defineProperty(l,"QuotedColumnParser",{enumerable:!0,get:function(){return s.QuotedColumnParser}})},{"./Parser":156,"./RowParser":157,"./Scanner":158,"./Token":159,"./column":164}],166:[function(t,n,l){var i=function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(l,"__esModule",{value:!0}),l.HeaderTransformer=void 0;const o=i(t("lodash.isundefined")),u=i(t("lodash.isfunction")),c=i(t("lodash.uniq")),s=i(t("lodash.groupby"));l.HeaderTransformer=class{constructor(d){this.headers=null,this.receivedHeaders=!1,this.shouldUseFirstRow=!1,this.processedFirstRow=!1,this.headersLength=0,this.parserOptions=d,d.headers===!0?this.shouldUseFirstRow=!0:Array.isArray(d.headers)?this.setHeaders(d.headers):u.default(d.headers)&&(this.headersTransform=d.headers)}transform(d,f){return this.shouldMapRow(d)?f(null,this.processRow(d)):f(null,{row:null,isValid:!0})}shouldMapRow(d){const{parserOptions:f}=this;if(!this.headersTransform&&f.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw new Error("Error renaming headers: new headers must be provided in an array");return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(d)){if(this.headersTransform)this.setHeaders(this.headersTransform(d));else{if(!this.shouldUseFirstRow)return!0;this.setHeaders(d)}return!1}return!0}processRow(d){if(!this.headers)return{row:d,isValid:!0};const{parserOptions:f}=this;if(!f.discardUnmappedColumns&&d.length>this.headersLength){if(!f.strictColumnHandling)throw new Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${d.length}`);return{row:d,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${d.length}`}}return f.strictColumnHandling&&d.length!!m);if(c.default(h).length!==h.length){const m=s.default(h),p=Object.keys(m).filter(x=>m[x].length>1);throw new Error("Duplicate headers found "+JSON.stringify(p))}this.headers=d,this.receivedHeaders=!0,this.headersLength=((f=this.headers)===null||f===void 0?void 0:f.length)||0}}},{"lodash.groupby":443,"lodash.isfunction":446,"lodash.isundefined":448,"lodash.uniq":449}],167:[function(t,n,l){var i=function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(l,"__esModule",{value:!0}),l.RowTransformerValidator=void 0;const o=i(t("lodash.isfunction")),u=t("../types");class c{constructor(){this._rowTransform=null,this._rowValidator=null}static createTransform(d){return u.isSyncTransform(d)?(f,h)=>{let m=null;try{m=d(f)}catch(p){return h(p)}return h(null,m)}:d}static createValidator(d){return u.isSyncValidate(d)?(f,h)=>{h(null,{row:f,isValid:d(f)})}:(f,h)=>{d(f,(m,p,x)=>m?h(m):h(null,p?{row:f,isValid:p,reason:x}:{row:f,isValid:!1,reason:x}))}}set rowTransform(d){if(!o.default(d))throw new TypeError("The transform should be a function");this._rowTransform=c.createTransform(d)}set rowValidator(d){if(!o.default(d))throw new TypeError("The validate should be a function");this._rowValidator=c.createValidator(d)}transformAndValidate(d,f){return this.callTransformer(d,(h,m)=>h?f(h):m?this.callValidator(m,(p,x)=>p?f(p):x&&!x.isValid?f(null,{row:m,isValid:!1,reason:x.reason}):f(null,{row:m,isValid:!0})):f(null,{row:null,isValid:!0}))}callTransformer(d,f){return this._rowTransform?this._rowTransform(d,f):f(null,d)}callValidator(d,f){return this._rowValidator?this._rowValidator(d,f):f(null,{row:d,isValid:!0})}}l.RowTransformerValidator=c},{"../types":169,"lodash.isfunction":446}],168:[function(t,n,l){Object.defineProperty(l,"__esModule",{value:!0}),l.HeaderTransformer=l.RowTransformerValidator=void 0;var i=t("./RowTransformerValidator");Object.defineProperty(l,"RowTransformerValidator",{enumerable:!0,get:function(){return i.RowTransformerValidator}});var o=t("./HeaderTransformer");Object.defineProperty(l,"HeaderTransformer",{enumerable:!0,get:function(){return o.HeaderTransformer}})},{"./HeaderTransformer":166,"./RowTransformerValidator":167}],169:[function(t,n,l){Object.defineProperty(l,"__esModule",{value:!0}),l.isSyncValidate=l.isSyncTransform=void 0,l.isSyncTransform=i=>i.length===1,l.isSyncValidate=i=>i.length===1},{}],170:[function(t,n,l){const i=l;i.bignum=t("bn.js"),i.define=t("./asn1/api").define,i.base=t("./asn1/base"),i.constants=t("./asn1/constants"),i.decoders=t("./asn1/decoders"),i.encoders=t("./asn1/encoders")},{"./asn1/api":171,"./asn1/base":173,"./asn1/constants":177,"./asn1/decoders":179,"./asn1/encoders":182,"bn.js":184}],171:[function(t,n,l){const i=t("./encoders"),o=t("./decoders"),u=t("inherits");function c(s,d){this.name=s,this.body=d,this.decoders={},this.encoders={}}l.define=function(s,d){return new c(s,d)},c.prototype._createNamed=function(s){const d=this.name;function f(h){this._initNamed(h,d)}return u(f,s),f.prototype._initNamed=function(h,m){s.call(this,h,m)},new f(this)},c.prototype._getDecoder=function(s){return s=s||"der",this.decoders.hasOwnProperty(s)||(this.decoders[s]=this._createNamed(o[s])),this.decoders[s]},c.prototype.decode=function(s,d,f){return this._getDecoder(d).decode(s,f)},c.prototype._getEncoder=function(s){return s=s||"der",this.encoders.hasOwnProperty(s)||(this.encoders[s]=this._createNamed(i[s])),this.encoders[s]},c.prototype.encode=function(s,d,f){return this._getEncoder(d).encode(s,f)}},{"./decoders":179,"./encoders":182,inherits:440}],172:[function(t,n,l){const i=t("inherits"),o=t("../base/reporter").Reporter,u=t("safer-buffer").Buffer;function c(d,f){o.call(this,f),u.isBuffer(d)?(this.base=d,this.offset=0,this.length=d.length):this.error("Input not Buffer")}function s(d,f){if(Array.isArray(d))this.length=0,this.value=d.map((function(h){return s.isEncoderBuffer(h)||(h=new s(h,f)),this.length+=h.length,h}),this);else if(typeof d=="number"){if(!(0<=d&&d<=255))return f.error("non-byte EncoderBuffer value");this.value=d,this.length=1}else if(typeof d=="string")this.value=d,this.length=u.byteLength(d);else{if(!u.isBuffer(d))return f.error("Unsupported type: "+typeof d);this.value=d,this.length=d.length}}i(c,o),l.DecoderBuffer=c,c.isDecoderBuffer=function(d){return d instanceof c?!0:typeof d=="object"&&u.isBuffer(d.base)&&d.constructor.name==="DecoderBuffer"&&typeof d.offset=="number"&&typeof d.length=="number"&&typeof d.save=="function"&&typeof d.restore=="function"&&typeof d.isEmpty=="function"&&typeof d.readUInt8=="function"&&typeof d.skip=="function"&&typeof d.raw=="function"},c.prototype.save=function(){return{offset:this.offset,reporter:o.prototype.save.call(this)}},c.prototype.restore=function(d){const f=new c(this.base);return f.offset=d.offset,f.length=this.offset,this.offset=d.offset,o.prototype.restore.call(this,d.reporter),f},c.prototype.isEmpty=function(){return this.offset===this.length},c.prototype.readUInt8=function(d){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(d||"DecoderBuffer overrun")},c.prototype.skip=function(d,f){if(!(this.offset+d<=this.length))return this.error(f||"DecoderBuffer overrun");const h=new c(this.base);return h._reporterState=this._reporterState,h.offset=this.offset,h.length=this.offset+d,this.offset+=d,h},c.prototype.raw=function(d){return this.base.slice(d?d.offset:this.offset,this.length)},l.EncoderBuffer=s,s.isEncoderBuffer=function(d){return d instanceof s?!0:typeof d=="object"&&d.constructor.name==="EncoderBuffer"&&typeof d.length=="number"&&typeof d.join=="function"},s.prototype.join=function(d,f){return d||(d=u.alloc(this.length)),f||(f=0),this.length===0||(Array.isArray(this.value)?this.value.forEach((function(h){h.join(d,f),f+=h.length})):(typeof this.value=="number"?d[f]=this.value:typeof this.value=="string"?d.write(this.value,f):u.isBuffer(this.value)&&this.value.copy(d,f),f+=this.length)),d}},{"../base/reporter":175,inherits:440,"safer-buffer":495}],173:[function(t,n,l){const i=l;i.Reporter=t("./reporter").Reporter,i.DecoderBuffer=t("./buffer").DecoderBuffer,i.EncoderBuffer=t("./buffer").EncoderBuffer,i.Node=t("./node")},{"./buffer":172,"./node":174,"./reporter":175}],174:[function(t,n,l){const i=t("../base/reporter").Reporter,o=t("../base/buffer").EncoderBuffer,u=t("../base/buffer").DecoderBuffer,c=t("minimalistic-assert"),s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],d=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function f(m,p,x){const g={};this._baseState=g,g.name=x,g.enc=m,g.parent=p||null,g.children=null,g.tag=null,g.args=null,g.reverseArgs=null,g.choice=null,g.optional=!1,g.any=!1,g.obj=!1,g.use=null,g.useDecoder=null,g.key=null,g.default=null,g.explicit=null,g.implicit=null,g.contains=null,g.parent||(g.children=[],this._wrap())}n.exports=f;const h=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];f.prototype.clone=function(){const m=this._baseState,p={};h.forEach((function(g){p[g]=m[g]}));const x=new this.constructor(p.parent);return x._baseState=p,x},f.prototype._wrap=function(){const m=this._baseState;d.forEach((function(p){this[p]=function(){const x=new this.constructor(this);return m.children.push(x),x[p].apply(x,arguments)}}),this)},f.prototype._init=function(m){const p=this._baseState;c(p.parent===null),m.call(this),p.children=p.children.filter((function(x){return x._baseState.parent===this}),this),c.equal(p.children.length,1,"Root node can have only one child")},f.prototype._useArgs=function(m){const p=this._baseState,x=m.filter((function(g){return g instanceof this.constructor}),this);m=m.filter((function(g){return!(g instanceof this.constructor)}),this),x.length!==0&&(c(p.children===null),p.children=x,x.forEach((function(g){g._baseState.parent=this}),this)),m.length!==0&&(c(p.args===null),p.args=m,p.reverseArgs=m.map((function(g){if(typeof g!="object"||g.constructor!==Object)return g;const y={};return Object.keys(g).forEach((function(v){v==(0|v)&&(v|=0);const _=g[v];y[_]=v})),y})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(m){f.prototype[m]=function(){const p=this._baseState;throw new Error(m+" not implemented for encoding: "+p.enc)}})),s.forEach((function(m){f.prototype[m]=function(){const p=this._baseState,x=Array.prototype.slice.call(arguments);return c(p.tag===null),p.tag=m,this._useArgs(x),this}})),f.prototype.use=function(m){c(m);const p=this._baseState;return c(p.use===null),p.use=m,this},f.prototype.optional=function(){return this._baseState.optional=!0,this},f.prototype.def=function(m){const p=this._baseState;return c(p.default===null),p.default=m,p.optional=!0,this},f.prototype.explicit=function(m){const p=this._baseState;return c(p.explicit===null&&p.implicit===null),p.explicit=m,this},f.prototype.implicit=function(m){const p=this._baseState;return c(p.explicit===null&&p.implicit===null),p.implicit=m,this},f.prototype.obj=function(){const m=this._baseState,p=Array.prototype.slice.call(arguments);return m.obj=!0,p.length!==0&&this._useArgs(p),this},f.prototype.key=function(m){const p=this._baseState;return c(p.key===null),p.key=m,this},f.prototype.any=function(){return this._baseState.any=!0,this},f.prototype.choice=function(m){const p=this._baseState;return c(p.choice===null),p.choice=m,this._useArgs(Object.keys(m).map((function(x){return m[x]}))),this},f.prototype.contains=function(m){const p=this._baseState;return c(p.use===null),p.contains=m,this},f.prototype._decode=function(m,p){const x=this._baseState;if(x.parent===null)return m.wrapResult(x.children[0]._decode(m,p));let g,y=x.default,v=!0,_=null;if(x.key!==null&&(_=m.enterKey(x.key)),x.optional){let C=null;if(x.explicit!==null?C=x.explicit:x.implicit!==null?C=x.implicit:x.tag!==null&&(C=x.tag),C!==null||x.any){if(v=this._peekTag(m,C,x.any),m.isError(v))return v}else{const M=m.save();try{x.choice===null?this._decodeGeneric(x.tag,m,p):this._decodeChoice(m,p),v=!0}catch{v=!1}m.restore(M)}}if(x.obj&&v&&(g=m.enterObject()),v){if(x.explicit!==null){const M=this._decodeTag(m,x.explicit);if(m.isError(M))return M;m=M}const C=m.offset;if(x.use===null&&x.choice===null){let M;x.any&&(M=m.save());const T=this._decodeTag(m,x.implicit!==null?x.implicit:x.tag,x.any);if(m.isError(T))return T;x.any?y=m.raw(M):m=T}if(p&&p.track&&x.tag!==null&&p.track(m.path(),C,m.length,"tagged"),p&&p.track&&x.tag!==null&&p.track(m.path(),m.offset,m.length,"content"),x.any||(y=x.choice===null?this._decodeGeneric(x.tag,m,p):this._decodeChoice(m,p)),m.isError(y))return y;if(x.any||x.choice!==null||x.children===null||x.children.forEach((function(M){M._decode(m,p)})),x.contains&&(x.tag==="octstr"||x.tag==="bitstr")){const M=new u(y);y=this._getUse(x.contains,m._reporterState.obj)._decode(M,p)}}return x.obj&&v&&(y=m.leaveObject(g)),x.key===null||y===null&&v!==!0?_!==null&&m.exitKey(_):m.leaveKey(_,x.key,y),y},f.prototype._decodeGeneric=function(m,p,x){const g=this._baseState;return m==="seq"||m==="set"?null:m==="seqof"||m==="setof"?this._decodeList(p,m,g.args[0],x):/str$/.test(m)?this._decodeStr(p,m,x):m==="objid"&&g.args?this._decodeObjid(p,g.args[0],g.args[1],x):m==="objid"?this._decodeObjid(p,null,null,x):m==="gentime"||m==="utctime"?this._decodeTime(p,m,x):m==="null_"?this._decodeNull(p,x):m==="bool"?this._decodeBool(p,x):m==="objDesc"?this._decodeStr(p,m,x):m==="int"||m==="enum"?this._decodeInt(p,g.args&&g.args[0],x):g.use!==null?this._getUse(g.use,p._reporterState.obj)._decode(p,x):p.error("unknown tag: "+m)},f.prototype._getUse=function(m,p){const x=this._baseState;return x.useDecoder=this._use(m,p),c(x.useDecoder._baseState.parent===null),x.useDecoder=x.useDecoder._baseState.children[0],x.implicit!==x.useDecoder._baseState.implicit&&(x.useDecoder=x.useDecoder.clone(),x.useDecoder._baseState.implicit=x.implicit),x.useDecoder},f.prototype._decodeChoice=function(m,p){const x=this._baseState;let g=null,y=!1;return Object.keys(x.choice).some((function(v){const _=m.save(),C=x.choice[v];try{const M=C._decode(m,p);if(m.isError(M))return!1;g={type:v,value:M},y=!0}catch{return m.restore(_),!1}return!0}),this),y?g:m.error("Choice not matched")},f.prototype._createEncoderBuffer=function(m){return new o(m,this.reporter)},f.prototype._encode=function(m,p,x){const g=this._baseState;if(g.default!==null&&g.default===m)return;const y=this._encodeValue(m,p,x);return y===void 0||this._skipDefault(y,p,x)?void 0:y},f.prototype._encodeValue=function(m,p,x){const g=this._baseState;if(g.parent===null)return g.children[0]._encode(m,p||new i);let y=null;if(this.reporter=p,g.optional&&m===void 0){if(g.default===null)return;m=g.default}let v=null,_=!1;if(g.any)y=this._createEncoderBuffer(m);else if(g.choice)y=this._encodeChoice(m,p);else if(g.contains)v=this._getUse(g.contains,x)._encode(m,p),_=!0;else if(g.children)v=g.children.map((function(C){if(C._baseState.tag==="null_")return C._encode(null,p,m);if(C._baseState.key===null)return p.error("Child should have a key");const M=p.enterKey(C._baseState.key);if(typeof m!="object")return p.error("Child expected, but input is not object");const T=C._encode(m[C._baseState.key],p,m);return p.leaveKey(M),T}),this).filter((function(C){return C})),v=this._createEncoderBuffer(v);else if(g.tag==="seqof"||g.tag==="setof"){if(!g.args||g.args.length!==1)return p.error("Too many args for : "+g.tag);if(!Array.isArray(m))return p.error("seqof/setof, but data is not Array");const C=this.clone();C._baseState.implicit=null,v=this._createEncoderBuffer(m.map((function(M){const T=this._baseState;return this._getUse(T.args[0],m)._encode(M,p)}),C))}else g.use!==null?y=this._getUse(g.use,x)._encode(m,p):(v=this._encodePrimitive(g.tag,m),_=!0);if(!g.any&&g.choice===null){const C=g.implicit!==null?g.implicit:g.tag,M=g.implicit===null?"universal":"context";C===null?g.use===null&&p.error("Tag could be omitted only for .use()"):g.use===null&&(y=this._encodeComposite(C,_,M,v))}return g.explicit!==null&&(y=this._encodeComposite(g.explicit,!1,"context",y)),y},f.prototype._encodeChoice=function(m,p){const x=this._baseState,g=x.choice[m.type];return g||c(!1,m.type+" not found in "+JSON.stringify(Object.keys(x.choice))),g._encode(m.value,p)},f.prototype._encodePrimitive=function(m,p){const x=this._baseState;if(/str$/.test(m))return this._encodeStr(p,m);if(m==="objid"&&x.args)return this._encodeObjid(p,x.reverseArgs[0],x.args[1]);if(m==="objid")return this._encodeObjid(p,null,null);if(m==="gentime"||m==="utctime")return this._encodeTime(p,m);if(m==="null_")return this._encodeNull();if(m==="int"||m==="enum")return this._encodeInt(p,x.args&&x.reverseArgs[0]);if(m==="bool")return this._encodeBool(p);if(m==="objDesc")return this._encodeStr(p,m);throw new Error("Unsupported tag: "+m)},f.prototype._isNumstr=function(m){return/^[0-9 ]*$/.test(m)},f.prototype._isPrintstr=function(m){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(m)}},{"../base/buffer":172,"../base/reporter":175,"minimalistic-assert":453}],175:[function(t,n,l){const i=t("inherits");function o(c){this._reporterState={obj:null,path:[],options:c||{},errors:[]}}function u(c,s){this.path=c,this.rethrow(s)}l.Reporter=o,o.prototype.isError=function(c){return c instanceof u},o.prototype.save=function(){const c=this._reporterState;return{obj:c.obj,pathLen:c.path.length}},o.prototype.restore=function(c){const s=this._reporterState;s.obj=c.obj,s.path=s.path.slice(0,c.pathLen)},o.prototype.enterKey=function(c){return this._reporterState.path.push(c)},o.prototype.exitKey=function(c){const s=this._reporterState;s.path=s.path.slice(0,c-1)},o.prototype.leaveKey=function(c,s,d){const f=this._reporterState;this.exitKey(c),f.obj!==null&&(f.obj[s]=d)},o.prototype.path=function(){return this._reporterState.path.join("/")},o.prototype.enterObject=function(){const c=this._reporterState,s=c.obj;return c.obj={},s},o.prototype.leaveObject=function(c){const s=this._reporterState,d=s.obj;return s.obj=c,d},o.prototype.error=function(c){let s;const d=this._reporterState,f=c instanceof u;if(s=f?c:new u(d.path.map((function(h){return"["+JSON.stringify(h)+"]"})).join(""),c.message||c,c.stack),!d.options.partial)throw s;return f||d.errors.push(s),s},o.prototype.wrapResult=function(c){const s=this._reporterState;return s.options.partial?{result:this.isError(c)?null:c,errors:s.errors}:c},i(u,Error),u.prototype.rethrow=function(c){if(this.message=c+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,u),!this.stack)try{throw new Error(this.message)}catch(s){this.stack=s.stack}return this}},{inherits:440}],176:[function(t,n,l){function i(o){const u={};return Object.keys(o).forEach((function(c){(0|c)==c&&(c|=0);const s=o[c];u[s]=c})),u}l.tagClass={0:"universal",1:"application",2:"context",3:"private"},l.tagClassByName=i(l.tagClass),l.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},l.tagByName=i(l.tag)},{}],177:[function(t,n,l){const i=l;i._reverse=function(o){const u={};return Object.keys(o).forEach((function(c){(0|c)==c&&(c|=0);const s=o[c];u[s]=c})),u},i.der=t("./der")},{"./der":176}],178:[function(t,n,l){const i=t("inherits"),o=t("bn.js"),u=t("../base/buffer").DecoderBuffer,c=t("../base/node"),s=t("../constants/der");function d(p){this.enc="der",this.name=p.name,this.entity=p,this.tree=new f,this.tree._init(p.body)}function f(p){c.call(this,"der",p)}function h(p,x){let g=p.readUInt8(x);if(p.isError(g))return g;const y=s.tagClass[g>>6],v=(32&g)==0;if((31&g)==31){let _=g;for(g=0;(128&_)==128;){if(_=p.readUInt8(x),p.isError(_))return _;g<<=7,g|=127&_}}else g&=31;return{cls:y,primitive:v,tag:g,tagStr:s.tag[g]}}function m(p,x,g){let y=p.readUInt8(g);if(p.isError(y))return y;if(!x&&y===128)return null;if((128&y)==0)return y;const v=127&y;if(v>4)return p.error("length octect is too long");y=0;for(let _=0;_=31?T.error("Multi-octet tag encoding unsupported"):(C||(U|=32),U|=c.tagClassByName[M||"universal"]<<6,U)})(h,m,p,this.reporter);if(x.length<128){const _=o.alloc(2);return _[0]=g,_[1]=x.length,this._createEncoderBuffer([_,x])}let y=1;for(let _=x.length;_>=256;_>>=8)y++;const v=o.alloc(2+y);v[0]=g,v[1]=128|y;for(let _=1+y,C=x.length;C>0;_--,C>>=8)v[_]=255&C;return this._createEncoderBuffer([v,x])},d.prototype._encodeStr=function(h,m){if(m==="bitstr")return this._createEncoderBuffer([0|h.unused,h.data]);if(m==="bmpstr"){const p=o.alloc(2*h.length);for(let x=0;x=40)return this.reporter.error("Second objid identifier OOB");h.splice(0,2,40*h[0]+h[1])}let x=0;for(let v=0;v=128;_>>=7)x++}const g=o.alloc(x);let y=g.length-1;for(let v=h.length-1;v>=0;v--){let _=h[v];for(g[y--]=127&_;(_>>=7)>0;)g[y--]=128|127&_}return this._createEncoderBuffer(g)},d.prototype._encodeTime=function(h,m){let p;const x=new Date(h);return m==="gentime"?p=[f(x.getUTCFullYear()),f(x.getUTCMonth()+1),f(x.getUTCDate()),f(x.getUTCHours()),f(x.getUTCMinutes()),f(x.getUTCSeconds()),"Z"].join(""):m==="utctime"?p=[f(x.getUTCFullYear()%100),f(x.getUTCMonth()+1),f(x.getUTCDate()),f(x.getUTCHours()),f(x.getUTCMinutes()),f(x.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+m+" time is not supported yet"),this._encodeStr(p,"octstr")},d.prototype._encodeNull=function(){return this._createEncoderBuffer("")},d.prototype._encodeInt=function(h,m){if(typeof h=="string"){if(!m)return this.reporter.error("String int or enum given, but no values map");if(!m.hasOwnProperty(h))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(h));h=m[h]}if(typeof h!="number"&&!o.isBuffer(h)){const g=h.toArray();!h.sign&&128&g[0]&&g.unshift(0),h=o.from(g)}if(o.isBuffer(h)){let g=h.length;h.length===0&&g++;const y=o.alloc(g);return h.copy(y),h.length===0&&(y[0]=0),this._createEncoderBuffer(y)}if(h<128)return this._createEncoderBuffer(h);if(h<256)return this._createEncoderBuffer([0,h]);let p=1;for(let g=h;g>=256;g>>=8)p++;const x=new Array(p);for(let g=x.length-1;g>=0;g--)x[g]=255&h,h>>=8;return 128&x[0]&&x.unshift(0),this._createEncoderBuffer(o.from(x))},d.prototype._encodeBool=function(h){return this._createEncoderBuffer(h?255:0)},d.prototype._use=function(h,m){return typeof h=="function"&&(h=h(m)),h._getEncoder("der").tree},d.prototype._skipDefault=function(h,m,p){const x=this._baseState;let g;if(x.default===null)return!1;const y=h.join();if(x.defaultBuffer===void 0&&(x.defaultBuffer=this._encodeValue(x.default,m,p).join()),y.length!==x.defaultBuffer.length)return!1;for(g=0;g=65&&E<=70?E-55:E>=97&&E<=102?E-87:E-48&15}function h(P,L,E){var j=f(P,E);return E-1>=L&&(j|=f(P,E-1)<<4),j}function m(P,L,E,j){for(var k=0,S=Math.min(P.length,E),N=L;N=49?O-49+10:O>=17?O-17+10:O}return k}s.isBN=function(P){return P instanceof s||P!==null&&typeof P=="object"&&P.constructor.wordSize===s.wordSize&&Array.isArray(P.words)},s.max=function(P,L){return P.cmp(L)>0?P:L},s.min=function(P,L){return P.cmp(L)<0?P:L},s.prototype._init=function(P,L,E){if(typeof P=="number")return this._initNumber(P,L,E);if(typeof P=="object")return this._initArray(P,L,E);L==="hex"&&(L=16),u(L===(0|L)&&L>=2&&L<=36);var j=0;(P=P.toString().replace(/\s+/g,""))[0]==="-"&&(j++,this.negative=1),j=0;j-=3)S=P[j]|P[j-1]<<8|P[j-2]<<16,this.words[k]|=S<>>26-N&67108863,(N+=24)>=26&&(N-=26,k++);else if(E==="le")for(j=0,k=0;j>>26-N&67108863,(N+=24)>=26&&(N-=26,k++);return this.strip()},s.prototype._parseHex=function(P,L,E){this.length=Math.ceil((P.length-L)/6),this.words=new Array(this.length);for(var j=0;j=L;j-=2)k=h(P,L,j)<=18?(S-=18,N+=1,this.words[N]|=k>>>26):S+=8;else for(j=(P.length-L)%2==0?L+1:L;j=18?(S-=18,N+=1,this.words[N]|=k>>>26):S+=8;this.strip()},s.prototype._parseBase=function(P,L,E){this.words=[0],this.length=1;for(var j=0,k=1;k<=67108863;k*=L)j++;j--,k=k/L|0;for(var S=P.length-E,N=S%j,O=Math.min(S,S-N)+E,D=0,B=E;B1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function y(P,L,E){E.negative=L.negative^P.negative;var j=P.length+L.length|0;E.length=j,j=j-1|0;var k=0|P.words[0],S=0|L.words[0],N=k*S,O=67108863&N,D=N/67108864|0;E.words[0]=O;for(var B=1;B>>26,Z=67108863&D,ne=Math.min(B,L.length-1),q=Math.max(0,B-P.length+1);q<=ne;q++){var ee=B-q|0;Y+=(N=(k=0|P.words[ee])*(S=0|L.words[q])+Z)/67108864|0,Z=67108863&N}E.words[B]=0|Z,D=0|Y}return D!==0?E.words[B]=0|D:E.length--,E.strip()}s.prototype.toString=function(P,L){var E;if(L=0|L||1,(P=P||10)===16||P==="hex"){E="";for(var j=0,k=0,S=0;S>>24-j&16777215)!==0||S!==this.length-1?p[6-O.length]+O+E:O+E,(j+=2)>=26&&(j-=26,S--)}for(k!==0&&(E=k.toString(16)+E);E.length%L!=0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}if(P===(0|P)&&P>=2&&P<=36){var D=x[P],B=g[P];E="";var Y=this.clone();for(Y.negative=0;!Y.isZero();){var Z=Y.modn(B).toString(P);E=(Y=Y.idivn(B)).isZero()?Z+E:p[D-Z.length]+Z+E}for(this.isZero()&&(E="0"+E);E.length%L!=0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}u(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var P=this.words[0];return this.length===2?P+=67108864*this.words[1]:this.length===3&&this.words[2]===1?P+=4503599627370496+67108864*this.words[1]:this.length>2&&u(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-P:P},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(P,L){return u(d!==void 0),this.toArrayLike(d,P,L)},s.prototype.toArray=function(P,L){return this.toArrayLike(Array,P,L)},s.prototype.toArrayLike=function(P,L,E){var j=this.byteLength(),k=E||Math.max(1,j);u(j<=k,"byte array longer than desired length"),u(k>0,"Requested array length <= 0"),this.strip();var S,N,O=L==="le",D=new P(k),B=this.clone();if(O){for(N=0;!B.isZero();N++)S=B.andln(255),B.iushrn(8),D[N]=S;for(;N=4096&&(E+=13,L>>>=13),L>=64&&(E+=7,L>>>=7),L>=8&&(E+=4,L>>>=4),L>=2&&(E+=2,L>>>=2),E+L},s.prototype._zeroBits=function(P){if(P===0)return 26;var L=P,E=0;return(8191&L)==0&&(E+=13,L>>>=13),(127&L)==0&&(E+=7,L>>>=7),(15&L)==0&&(E+=4,L>>>=4),(3&L)==0&&(E+=2,L>>>=2),(1&L)==0&&E++,E},s.prototype.bitLength=function(){var P=this.words[this.length-1],L=this._countBits(P);return 26*(this.length-1)+L},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var P=0,L=0;LP.length?this.clone().ior(P):P.clone().ior(this)},s.prototype.uor=function(P){return this.length>P.length?this.clone().iuor(P):P.clone().iuor(this)},s.prototype.iuand=function(P){var L;L=this.length>P.length?P:this;for(var E=0;EP.length?this.clone().iand(P):P.clone().iand(this)},s.prototype.uand=function(P){return this.length>P.length?this.clone().iuand(P):P.clone().iuand(this)},s.prototype.iuxor=function(P){var L,E;this.length>P.length?(L=this,E=P):(L=P,E=this);for(var j=0;jP.length?this.clone().ixor(P):P.clone().ixor(this)},s.prototype.uxor=function(P){return this.length>P.length?this.clone().iuxor(P):P.clone().iuxor(this)},s.prototype.inotn=function(P){u(typeof P=="number"&&P>=0);var L=0|Math.ceil(P/26),E=P%26;this._expand(L),E>0&&L--;for(var j=0;j0&&(this.words[j]=~this.words[j]&67108863>>26-E),this.strip()},s.prototype.notn=function(P){return this.clone().inotn(P)},s.prototype.setn=function(P,L){u(typeof P=="number"&&P>=0);var E=P/26|0,j=P%26;return this._expand(E+1),this.words[E]=L?this.words[E]|1<P.length?(E=this,j=P):(E=P,j=this);for(var k=0,S=0;S>>26;for(;k!==0&&S>>26;if(this.length=E.length,k!==0)this.words[this.length]=k,this.length++;else if(E!==this)for(;SP.length?this.clone().iadd(P):P.clone().iadd(this)},s.prototype.isub=function(P){if(P.negative!==0){P.negative=0;var L=this.iadd(P);return P.negative=1,L._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(P),this.negative=1,this._normSign();var E,j,k=this.cmp(P);if(k===0)return this.negative=0,this.length=1,this.words[0]=0,this;k>0?(E=this,j=P):(E=P,j=this);for(var S=0,N=0;N>26,this.words[N]=67108863&L;for(;S!==0&&N>26,this.words[N]=67108863&L;if(S===0&&N>>13,q=0|N[1],ee=8191&q,z=q>>>13,I=0|N[2],X=8191&I,te=I>>>13,se=0|N[3],Q=8191&se,re=se>>>13,ue=0|N[4],ae=8191&ue,ie=ue>>>13,fe=0|N[5],he=8191&fe,de=fe>>>13,ge=0|N[6],ye=8191&ge,xe=ge>>>13,ce=0|N[7],Ce=8191&ce,Oe=ce>>>13,je=0|N[8],Ie=8191&je,et=je>>>13,Ue=0|N[9],Ze=8191&Ue,tt=Ue>>>13,Ke=0|O[0],ze=8191&Ke,Qe=Ke>>>13,nt=0|O[1],Ae=8191&nt,ut=nt>>>13,zt=0|O[2],ht=8191&zt,Tt=zt>>>13,It=0|O[3],Et=8191&It,$t=It>>>13,qt=0|O[4],yt=8191&qt,Rt=qt>>>13,Xt=0|O[5],dt=8191&Xt,Ft=Xt>>>13,Ht=0|O[6],Nt=8191&Ht,be=Ht>>>13,ke=0|O[7],Re=8191&ke,Xe=ke>>>13,vt=0|O[8],Je=8191&vt,St=vt>>>13,wt=0|O[9],ot=8191&wt,At=wt>>>13;E.negative=P.negative^L.negative,E.length=19;var Ct=(B+(j=Math.imul(Z,ze))|0)+((8191&(k=(k=Math.imul(Z,Qe))+Math.imul(ne,ze)|0))<<13)|0;B=((S=Math.imul(ne,Qe))+(k>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,j=Math.imul(ee,ze),k=(k=Math.imul(ee,Qe))+Math.imul(z,ze)|0,S=Math.imul(z,Qe);var Dt=(B+(j=j+Math.imul(Z,Ae)|0)|0)+((8191&(k=(k=k+Math.imul(Z,ut)|0)+Math.imul(ne,Ae)|0))<<13)|0;B=((S=S+Math.imul(ne,ut)|0)+(k>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,j=Math.imul(X,ze),k=(k=Math.imul(X,Qe))+Math.imul(te,ze)|0,S=Math.imul(te,Qe),j=j+Math.imul(ee,Ae)|0,k=(k=k+Math.imul(ee,ut)|0)+Math.imul(z,Ae)|0,S=S+Math.imul(z,ut)|0;var or=(B+(j=j+Math.imul(Z,ht)|0)|0)+((8191&(k=(k=k+Math.imul(Z,Tt)|0)+Math.imul(ne,ht)|0))<<13)|0;B=((S=S+Math.imul(ne,Tt)|0)+(k>>>13)|0)+(or>>>26)|0,or&=67108863,j=Math.imul(Q,ze),k=(k=Math.imul(Q,Qe))+Math.imul(re,ze)|0,S=Math.imul(re,Qe),j=j+Math.imul(X,Ae)|0,k=(k=k+Math.imul(X,ut)|0)+Math.imul(te,Ae)|0,S=S+Math.imul(te,ut)|0,j=j+Math.imul(ee,ht)|0,k=(k=k+Math.imul(ee,Tt)|0)+Math.imul(z,ht)|0,S=S+Math.imul(z,Tt)|0;var Gt=(B+(j=j+Math.imul(Z,Et)|0)|0)+((8191&(k=(k=k+Math.imul(Z,$t)|0)+Math.imul(ne,Et)|0))<<13)|0;B=((S=S+Math.imul(ne,$t)|0)+(k>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,j=Math.imul(ae,ze),k=(k=Math.imul(ae,Qe))+Math.imul(ie,ze)|0,S=Math.imul(ie,Qe),j=j+Math.imul(Q,Ae)|0,k=(k=k+Math.imul(Q,ut)|0)+Math.imul(re,Ae)|0,S=S+Math.imul(re,ut)|0,j=j+Math.imul(X,ht)|0,k=(k=k+Math.imul(X,Tt)|0)+Math.imul(te,ht)|0,S=S+Math.imul(te,Tt)|0,j=j+Math.imul(ee,Et)|0,k=(k=k+Math.imul(ee,$t)|0)+Math.imul(z,Et)|0,S=S+Math.imul(z,$t)|0;var nr=(B+(j=j+Math.imul(Z,yt)|0)|0)+((8191&(k=(k=k+Math.imul(Z,Rt)|0)+Math.imul(ne,yt)|0))<<13)|0;B=((S=S+Math.imul(ne,Rt)|0)+(k>>>13)|0)+(nr>>>26)|0,nr&=67108863,j=Math.imul(he,ze),k=(k=Math.imul(he,Qe))+Math.imul(de,ze)|0,S=Math.imul(de,Qe),j=j+Math.imul(ae,Ae)|0,k=(k=k+Math.imul(ae,ut)|0)+Math.imul(ie,Ae)|0,S=S+Math.imul(ie,ut)|0,j=j+Math.imul(Q,ht)|0,k=(k=k+Math.imul(Q,Tt)|0)+Math.imul(re,ht)|0,S=S+Math.imul(re,Tt)|0,j=j+Math.imul(X,Et)|0,k=(k=k+Math.imul(X,$t)|0)+Math.imul(te,Et)|0,S=S+Math.imul(te,$t)|0,j=j+Math.imul(ee,yt)|0,k=(k=k+Math.imul(ee,Rt)|0)+Math.imul(z,yt)|0,S=S+Math.imul(z,Rt)|0;var ur=(B+(j=j+Math.imul(Z,dt)|0)|0)+((8191&(k=(k=k+Math.imul(Z,Ft)|0)+Math.imul(ne,dt)|0))<<13)|0;B=((S=S+Math.imul(ne,Ft)|0)+(k>>>13)|0)+(ur>>>26)|0,ur&=67108863,j=Math.imul(ye,ze),k=(k=Math.imul(ye,Qe))+Math.imul(xe,ze)|0,S=Math.imul(xe,Qe),j=j+Math.imul(he,Ae)|0,k=(k=k+Math.imul(he,ut)|0)+Math.imul(de,Ae)|0,S=S+Math.imul(de,ut)|0,j=j+Math.imul(ae,ht)|0,k=(k=k+Math.imul(ae,Tt)|0)+Math.imul(ie,ht)|0,S=S+Math.imul(ie,Tt)|0,j=j+Math.imul(Q,Et)|0,k=(k=k+Math.imul(Q,$t)|0)+Math.imul(re,Et)|0,S=S+Math.imul(re,$t)|0,j=j+Math.imul(X,yt)|0,k=(k=k+Math.imul(X,Rt)|0)+Math.imul(te,yt)|0,S=S+Math.imul(te,Rt)|0,j=j+Math.imul(ee,dt)|0,k=(k=k+Math.imul(ee,Ft)|0)+Math.imul(z,dt)|0,S=S+Math.imul(z,Ft)|0;var Ar=(B+(j=j+Math.imul(Z,Nt)|0)|0)+((8191&(k=(k=k+Math.imul(Z,be)|0)+Math.imul(ne,Nt)|0))<<13)|0;B=((S=S+Math.imul(ne,be)|0)+(k>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,j=Math.imul(Ce,ze),k=(k=Math.imul(Ce,Qe))+Math.imul(Oe,ze)|0,S=Math.imul(Oe,Qe),j=j+Math.imul(ye,Ae)|0,k=(k=k+Math.imul(ye,ut)|0)+Math.imul(xe,Ae)|0,S=S+Math.imul(xe,ut)|0,j=j+Math.imul(he,ht)|0,k=(k=k+Math.imul(he,Tt)|0)+Math.imul(de,ht)|0,S=S+Math.imul(de,Tt)|0,j=j+Math.imul(ae,Et)|0,k=(k=k+Math.imul(ae,$t)|0)+Math.imul(ie,Et)|0,S=S+Math.imul(ie,$t)|0,j=j+Math.imul(Q,yt)|0,k=(k=k+Math.imul(Q,Rt)|0)+Math.imul(re,yt)|0,S=S+Math.imul(re,Rt)|0,j=j+Math.imul(X,dt)|0,k=(k=k+Math.imul(X,Ft)|0)+Math.imul(te,dt)|0,S=S+Math.imul(te,Ft)|0,j=j+Math.imul(ee,Nt)|0,k=(k=k+Math.imul(ee,be)|0)+Math.imul(z,Nt)|0,S=S+Math.imul(z,be)|0;var me=(B+(j=j+Math.imul(Z,Re)|0)|0)+((8191&(k=(k=k+Math.imul(Z,Xe)|0)+Math.imul(ne,Re)|0))<<13)|0;B=((S=S+Math.imul(ne,Xe)|0)+(k>>>13)|0)+(me>>>26)|0,me&=67108863,j=Math.imul(Ie,ze),k=(k=Math.imul(Ie,Qe))+Math.imul(et,ze)|0,S=Math.imul(et,Qe),j=j+Math.imul(Ce,Ae)|0,k=(k=k+Math.imul(Ce,ut)|0)+Math.imul(Oe,Ae)|0,S=S+Math.imul(Oe,ut)|0,j=j+Math.imul(ye,ht)|0,k=(k=k+Math.imul(ye,Tt)|0)+Math.imul(xe,ht)|0,S=S+Math.imul(xe,Tt)|0,j=j+Math.imul(he,Et)|0,k=(k=k+Math.imul(he,$t)|0)+Math.imul(de,Et)|0,S=S+Math.imul(de,$t)|0,j=j+Math.imul(ae,yt)|0,k=(k=k+Math.imul(ae,Rt)|0)+Math.imul(ie,yt)|0,S=S+Math.imul(ie,Rt)|0,j=j+Math.imul(Q,dt)|0,k=(k=k+Math.imul(Q,Ft)|0)+Math.imul(re,dt)|0,S=S+Math.imul(re,Ft)|0,j=j+Math.imul(X,Nt)|0,k=(k=k+Math.imul(X,be)|0)+Math.imul(te,Nt)|0,S=S+Math.imul(te,be)|0,j=j+Math.imul(ee,Re)|0,k=(k=k+Math.imul(ee,Xe)|0)+Math.imul(z,Re)|0,S=S+Math.imul(z,Xe)|0;var we=(B+(j=j+Math.imul(Z,Je)|0)|0)+((8191&(k=(k=k+Math.imul(Z,St)|0)+Math.imul(ne,Je)|0))<<13)|0;B=((S=S+Math.imul(ne,St)|0)+(k>>>13)|0)+(we>>>26)|0,we&=67108863,j=Math.imul(Ze,ze),k=(k=Math.imul(Ze,Qe))+Math.imul(tt,ze)|0,S=Math.imul(tt,Qe),j=j+Math.imul(Ie,Ae)|0,k=(k=k+Math.imul(Ie,ut)|0)+Math.imul(et,Ae)|0,S=S+Math.imul(et,ut)|0,j=j+Math.imul(Ce,ht)|0,k=(k=k+Math.imul(Ce,Tt)|0)+Math.imul(Oe,ht)|0,S=S+Math.imul(Oe,Tt)|0,j=j+Math.imul(ye,Et)|0,k=(k=k+Math.imul(ye,$t)|0)+Math.imul(xe,Et)|0,S=S+Math.imul(xe,$t)|0,j=j+Math.imul(he,yt)|0,k=(k=k+Math.imul(he,Rt)|0)+Math.imul(de,yt)|0,S=S+Math.imul(de,Rt)|0,j=j+Math.imul(ae,dt)|0,k=(k=k+Math.imul(ae,Ft)|0)+Math.imul(ie,dt)|0,S=S+Math.imul(ie,Ft)|0,j=j+Math.imul(Q,Nt)|0,k=(k=k+Math.imul(Q,be)|0)+Math.imul(re,Nt)|0,S=S+Math.imul(re,be)|0,j=j+Math.imul(X,Re)|0,k=(k=k+Math.imul(X,Xe)|0)+Math.imul(te,Re)|0,S=S+Math.imul(te,Xe)|0,j=j+Math.imul(ee,Je)|0,k=(k=k+Math.imul(ee,St)|0)+Math.imul(z,Je)|0,S=S+Math.imul(z,St)|0;var Le=(B+(j=j+Math.imul(Z,ot)|0)|0)+((8191&(k=(k=k+Math.imul(Z,At)|0)+Math.imul(ne,ot)|0))<<13)|0;B=((S=S+Math.imul(ne,At)|0)+(k>>>13)|0)+(Le>>>26)|0,Le&=67108863,j=Math.imul(Ze,Ae),k=(k=Math.imul(Ze,ut))+Math.imul(tt,Ae)|0,S=Math.imul(tt,ut),j=j+Math.imul(Ie,ht)|0,k=(k=k+Math.imul(Ie,Tt)|0)+Math.imul(et,ht)|0,S=S+Math.imul(et,Tt)|0,j=j+Math.imul(Ce,Et)|0,k=(k=k+Math.imul(Ce,$t)|0)+Math.imul(Oe,Et)|0,S=S+Math.imul(Oe,$t)|0,j=j+Math.imul(ye,yt)|0,k=(k=k+Math.imul(ye,Rt)|0)+Math.imul(xe,yt)|0,S=S+Math.imul(xe,Rt)|0,j=j+Math.imul(he,dt)|0,k=(k=k+Math.imul(he,Ft)|0)+Math.imul(de,dt)|0,S=S+Math.imul(de,Ft)|0,j=j+Math.imul(ae,Nt)|0,k=(k=k+Math.imul(ae,be)|0)+Math.imul(ie,Nt)|0,S=S+Math.imul(ie,be)|0,j=j+Math.imul(Q,Re)|0,k=(k=k+Math.imul(Q,Xe)|0)+Math.imul(re,Re)|0,S=S+Math.imul(re,Xe)|0,j=j+Math.imul(X,Je)|0,k=(k=k+Math.imul(X,St)|0)+Math.imul(te,Je)|0,S=S+Math.imul(te,St)|0;var $e=(B+(j=j+Math.imul(ee,ot)|0)|0)+((8191&(k=(k=k+Math.imul(ee,At)|0)+Math.imul(z,ot)|0))<<13)|0;B=((S=S+Math.imul(z,At)|0)+(k>>>13)|0)+($e>>>26)|0,$e&=67108863,j=Math.imul(Ze,ht),k=(k=Math.imul(Ze,Tt))+Math.imul(tt,ht)|0,S=Math.imul(tt,Tt),j=j+Math.imul(Ie,Et)|0,k=(k=k+Math.imul(Ie,$t)|0)+Math.imul(et,Et)|0,S=S+Math.imul(et,$t)|0,j=j+Math.imul(Ce,yt)|0,k=(k=k+Math.imul(Ce,Rt)|0)+Math.imul(Oe,yt)|0,S=S+Math.imul(Oe,Rt)|0,j=j+Math.imul(ye,dt)|0,k=(k=k+Math.imul(ye,Ft)|0)+Math.imul(xe,dt)|0,S=S+Math.imul(xe,Ft)|0,j=j+Math.imul(he,Nt)|0,k=(k=k+Math.imul(he,be)|0)+Math.imul(de,Nt)|0,S=S+Math.imul(de,be)|0,j=j+Math.imul(ae,Re)|0,k=(k=k+Math.imul(ae,Xe)|0)+Math.imul(ie,Re)|0,S=S+Math.imul(ie,Xe)|0,j=j+Math.imul(Q,Je)|0,k=(k=k+Math.imul(Q,St)|0)+Math.imul(re,Je)|0,S=S+Math.imul(re,St)|0;var ct=(B+(j=j+Math.imul(X,ot)|0)|0)+((8191&(k=(k=k+Math.imul(X,At)|0)+Math.imul(te,ot)|0))<<13)|0;B=((S=S+Math.imul(te,At)|0)+(k>>>13)|0)+(ct>>>26)|0,ct&=67108863,j=Math.imul(Ze,Et),k=(k=Math.imul(Ze,$t))+Math.imul(tt,Et)|0,S=Math.imul(tt,$t),j=j+Math.imul(Ie,yt)|0,k=(k=k+Math.imul(Ie,Rt)|0)+Math.imul(et,yt)|0,S=S+Math.imul(et,Rt)|0,j=j+Math.imul(Ce,dt)|0,k=(k=k+Math.imul(Ce,Ft)|0)+Math.imul(Oe,dt)|0,S=S+Math.imul(Oe,Ft)|0,j=j+Math.imul(ye,Nt)|0,k=(k=k+Math.imul(ye,be)|0)+Math.imul(xe,Nt)|0,S=S+Math.imul(xe,be)|0,j=j+Math.imul(he,Re)|0,k=(k=k+Math.imul(he,Xe)|0)+Math.imul(de,Re)|0,S=S+Math.imul(de,Xe)|0,j=j+Math.imul(ae,Je)|0,k=(k=k+Math.imul(ae,St)|0)+Math.imul(ie,Je)|0,S=S+Math.imul(ie,St)|0;var Fe=(B+(j=j+Math.imul(Q,ot)|0)|0)+((8191&(k=(k=k+Math.imul(Q,At)|0)+Math.imul(re,ot)|0))<<13)|0;B=((S=S+Math.imul(re,At)|0)+(k>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,j=Math.imul(Ze,yt),k=(k=Math.imul(Ze,Rt))+Math.imul(tt,yt)|0,S=Math.imul(tt,Rt),j=j+Math.imul(Ie,dt)|0,k=(k=k+Math.imul(Ie,Ft)|0)+Math.imul(et,dt)|0,S=S+Math.imul(et,Ft)|0,j=j+Math.imul(Ce,Nt)|0,k=(k=k+Math.imul(Ce,be)|0)+Math.imul(Oe,Nt)|0,S=S+Math.imul(Oe,be)|0,j=j+Math.imul(ye,Re)|0,k=(k=k+Math.imul(ye,Xe)|0)+Math.imul(xe,Re)|0,S=S+Math.imul(xe,Xe)|0,j=j+Math.imul(he,Je)|0,k=(k=k+Math.imul(he,St)|0)+Math.imul(de,Je)|0,S=S+Math.imul(de,St)|0;var Ge=(B+(j=j+Math.imul(ae,ot)|0)|0)+((8191&(k=(k=k+Math.imul(ae,At)|0)+Math.imul(ie,ot)|0))<<13)|0;B=((S=S+Math.imul(ie,At)|0)+(k>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,j=Math.imul(Ze,dt),k=(k=Math.imul(Ze,Ft))+Math.imul(tt,dt)|0,S=Math.imul(tt,Ft),j=j+Math.imul(Ie,Nt)|0,k=(k=k+Math.imul(Ie,be)|0)+Math.imul(et,Nt)|0,S=S+Math.imul(et,be)|0,j=j+Math.imul(Ce,Re)|0,k=(k=k+Math.imul(Ce,Xe)|0)+Math.imul(Oe,Re)|0,S=S+Math.imul(Oe,Xe)|0,j=j+Math.imul(ye,Je)|0,k=(k=k+Math.imul(ye,St)|0)+Math.imul(xe,Je)|0,S=S+Math.imul(xe,St)|0;var Ne=(B+(j=j+Math.imul(he,ot)|0)|0)+((8191&(k=(k=k+Math.imul(he,At)|0)+Math.imul(de,ot)|0))<<13)|0;B=((S=S+Math.imul(de,At)|0)+(k>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,j=Math.imul(Ze,Nt),k=(k=Math.imul(Ze,be))+Math.imul(tt,Nt)|0,S=Math.imul(tt,be),j=j+Math.imul(Ie,Re)|0,k=(k=k+Math.imul(Ie,Xe)|0)+Math.imul(et,Re)|0,S=S+Math.imul(et,Xe)|0,j=j+Math.imul(Ce,Je)|0,k=(k=k+Math.imul(Ce,St)|0)+Math.imul(Oe,Je)|0,S=S+Math.imul(Oe,St)|0;var it=(B+(j=j+Math.imul(ye,ot)|0)|0)+((8191&(k=(k=k+Math.imul(ye,At)|0)+Math.imul(xe,ot)|0))<<13)|0;B=((S=S+Math.imul(xe,At)|0)+(k>>>13)|0)+(it>>>26)|0,it&=67108863,j=Math.imul(Ze,Re),k=(k=Math.imul(Ze,Xe))+Math.imul(tt,Re)|0,S=Math.imul(tt,Xe),j=j+Math.imul(Ie,Je)|0,k=(k=k+Math.imul(Ie,St)|0)+Math.imul(et,Je)|0,S=S+Math.imul(et,St)|0;var st=(B+(j=j+Math.imul(Ce,ot)|0)|0)+((8191&(k=(k=k+Math.imul(Ce,At)|0)+Math.imul(Oe,ot)|0))<<13)|0;B=((S=S+Math.imul(Oe,At)|0)+(k>>>13)|0)+(st>>>26)|0,st&=67108863,j=Math.imul(Ze,Je),k=(k=Math.imul(Ze,St))+Math.imul(tt,Je)|0,S=Math.imul(tt,St);var at=(B+(j=j+Math.imul(Ie,ot)|0)|0)+((8191&(k=(k=k+Math.imul(Ie,At)|0)+Math.imul(et,ot)|0))<<13)|0;B=((S=S+Math.imul(et,At)|0)+(k>>>13)|0)+(at>>>26)|0,at&=67108863;var Mt=(B+(j=Math.imul(Ze,ot))|0)+((8191&(k=(k=Math.imul(Ze,At))+Math.imul(tt,ot)|0))<<13)|0;return B=((S=Math.imul(tt,At))+(k>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,D[0]=Ct,D[1]=Dt,D[2]=or,D[3]=Gt,D[4]=nr,D[5]=ur,D[6]=Ar,D[7]=me,D[8]=we,D[9]=Le,D[10]=$e,D[11]=ct,D[12]=Fe,D[13]=Ge,D[14]=Ne,D[15]=it,D[16]=st,D[17]=at,D[18]=Mt,B!==0&&(D[19]=B,E.length++),E};function _(P,L,E){return new C().mulp(P,L,E)}function C(P,L){this.x=P,this.y=L}Math.imul||(v=y),s.prototype.mulTo=function(P,L){var E=this.length+P.length;return this.length===10&&P.length===10?v(this,P,L):E<63?y(this,P,L):E<1024?(function(j,k,S){S.negative=k.negative^j.negative,S.length=j.length+k.length;for(var N=0,O=0,D=0;D>>26)|0)>>>26,B&=67108863}S.words[D]=Y,N=B,B=O}return N!==0?S.words[D]=N:S.length--,S.strip()})(this,P,L):_(this,P,L)},C.prototype.makeRBT=function(P){for(var L=new Array(P),E=s.prototype._countBits(P)-1,j=0;j>=1;return j},C.prototype.permute=function(P,L,E,j,k,S){for(var N=0;N>>=1)k++;return 1<>>=13,E[2*S+1]=8191&k,k>>>=13;for(S=2*L;S>=26,L+=j/67108864|0,L+=k>>>26,this.words[E]=67108863&k}return L!==0&&(this.words[E]=L,this.length++),this},s.prototype.muln=function(P){return this.clone().imuln(P)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(P){var L=(function(S){for(var N=new Array(S.bitLength()),O=0;O>>B}return N})(P);if(L.length===0)return new s(1);for(var E=this,j=0;j=0);var L,E=P%26,j=(P-E)/26,k=67108863>>>26-E<<26-E;if(E!==0){var S=0;for(L=0;L>>26-E}S&&(this.words[L]=S,this.length++)}if(j!==0){for(L=this.length-1;L>=0;L--)this.words[L+j]=this.words[L];for(L=0;L=0),j=L?(L-L%26)/26:0;var k=P%26,S=Math.min((P-k)/26,this.length),N=67108863^67108863>>>k<S)for(this.length-=S,D=0;D=0&&(B!==0||D>=j);D--){var Y=0|this.words[D];this.words[D]=B<<26-k|Y>>>k,B=Y&N}return O&&B!==0&&(O.words[O.length++]=B),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(P,L,E){return u(this.negative===0),this.iushrn(P,L,E)},s.prototype.shln=function(P){return this.clone().ishln(P)},s.prototype.ushln=function(P){return this.clone().iushln(P)},s.prototype.shrn=function(P){return this.clone().ishrn(P)},s.prototype.ushrn=function(P){return this.clone().iushrn(P)},s.prototype.testn=function(P){u(typeof P=="number"&&P>=0);var L=P%26,E=(P-L)/26,j=1<=0);var L=P%26,E=(P-L)/26;if(u(this.negative===0,"imaskn works only with positive numbers"),this.length<=E)return this;if(L!==0&&E++,this.length=Math.min(E,this.length),L!==0){var j=67108863^67108863>>>L<=67108864;L++)this.words[L]-=67108864,L===this.length-1?this.words[L+1]=1:this.words[L+1]++;return this.length=Math.max(this.length,L+1),this},s.prototype.isubn=function(P){if(u(typeof P=="number"),u(P<67108864),P<0)return this.iaddn(-P);if(this.negative!==0)return this.negative=0,this.iaddn(P),this.negative=1,this;if(this.words[0]-=P,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var L=0;L>26)-(O/67108864|0),this.words[j+E]=67108863&k}for(;j>26,this.words[j+E]=67108863&k;if(N===0)return this.strip();for(u(N===-1),N=0,j=0;j>26,this.words[j]=67108863&k;return this.negative=1,this.strip()},s.prototype._wordDiv=function(P,L){var E=(this.length,P.length),j=this.clone(),k=P,S=0|k.words[k.length-1];(E=26-this._countBits(S))!==0&&(k=k.ushln(E),j.iushln(E),S=0|k.words[k.length-1]);var N,O=j.length-k.length;if(L!=="mod"){(N=new s(null)).length=O+1,N.words=new Array(N.length);for(var D=0;D=0;Y--){var Z=67108864*(0|j.words[k.length+Y])+(0|j.words[k.length+Y-1]);for(Z=Math.min(Z/S|0,67108863),j._ishlnsubmul(k,Z,Y);j.negative!==0;)Z--,j.negative=0,j._ishlnsubmul(k,1,Y),j.isZero()||(j.negative^=1);N&&(N.words[Y]=Z)}return N&&N.strip(),j.strip(),L!=="div"&&E!==0&&j.iushrn(E),{div:N||null,mod:j}},s.prototype.divmod=function(P,L,E){return u(!P.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:this.negative!==0&&P.negative===0?(S=this.neg().divmod(P,L),L!=="mod"&&(j=S.div.neg()),L!=="div"&&(k=S.mod.neg(),E&&k.negative!==0&&k.iadd(P)),{div:j,mod:k}):this.negative===0&&P.negative!==0?(S=this.divmod(P.neg(),L),L!=="mod"&&(j=S.div.neg()),{div:j,mod:S.mod}):(this.negative&P.negative)!=0?(S=this.neg().divmod(P.neg(),L),L!=="div"&&(k=S.mod.neg(),E&&k.negative!==0&&k.isub(P)),{div:S.div,mod:k}):P.length>this.length||this.cmp(P)<0?{div:new s(0),mod:this}:P.length===1?L==="div"?{div:this.divn(P.words[0]),mod:null}:L==="mod"?{div:null,mod:new s(this.modn(P.words[0]))}:{div:this.divn(P.words[0]),mod:new s(this.modn(P.words[0]))}:this._wordDiv(P,L);var j,k,S},s.prototype.div=function(P){return this.divmod(P,"div",!1).div},s.prototype.mod=function(P){return this.divmod(P,"mod",!1).mod},s.prototype.umod=function(P){return this.divmod(P,"mod",!0).mod},s.prototype.divRound=function(P){var L=this.divmod(P);if(L.mod.isZero())return L.div;var E=L.div.negative!==0?L.mod.isub(P):L.mod,j=P.ushrn(1),k=P.andln(1),S=E.cmp(j);return S<0||k===1&&S===0?L.div:L.div.negative!==0?L.div.isubn(1):L.div.iaddn(1)},s.prototype.modn=function(P){u(P<=67108863);for(var L=(1<<26)%P,E=0,j=this.length-1;j>=0;j--)E=(L*E+(0|this.words[j]))%P;return E},s.prototype.idivn=function(P){u(P<=67108863);for(var L=0,E=this.length-1;E>=0;E--){var j=(0|this.words[E])+67108864*L;this.words[E]=j/P|0,L=j%P}return this.strip()},s.prototype.divn=function(P){return this.clone().idivn(P)},s.prototype.egcd=function(P){u(P.negative===0),u(!P.isZero());var L=this,E=P.clone();L=L.negative!==0?L.umod(P):L.clone();for(var j=new s(1),k=new s(0),S=new s(0),N=new s(1),O=0;L.isEven()&&E.isEven();)L.iushrn(1),E.iushrn(1),++O;for(var D=E.clone(),B=L.clone();!L.isZero();){for(var Y=0,Z=1;(L.words[0]&Z)==0&&Y<26;++Y,Z<<=1);if(Y>0)for(L.iushrn(Y);Y-- >0;)(j.isOdd()||k.isOdd())&&(j.iadd(D),k.isub(B)),j.iushrn(1),k.iushrn(1);for(var ne=0,q=1;(E.words[0]&q)==0&&ne<26;++ne,q<<=1);if(ne>0)for(E.iushrn(ne);ne-- >0;)(S.isOdd()||N.isOdd())&&(S.iadd(D),N.isub(B)),S.iushrn(1),N.iushrn(1);L.cmp(E)>=0?(L.isub(E),j.isub(S),k.isub(N)):(E.isub(L),S.isub(j),N.isub(k))}return{a:S,b:N,gcd:E.iushln(O)}},s.prototype._invmp=function(P){u(P.negative===0),u(!P.isZero());var L=this,E=P.clone();L=L.negative!==0?L.umod(P):L.clone();for(var j,k=new s(1),S=new s(0),N=E.clone();L.cmpn(1)>0&&E.cmpn(1)>0;){for(var O=0,D=1;(L.words[0]&D)==0&&O<26;++O,D<<=1);if(O>0)for(L.iushrn(O);O-- >0;)k.isOdd()&&k.iadd(N),k.iushrn(1);for(var B=0,Y=1;(E.words[0]&Y)==0&&B<26;++B,Y<<=1);if(B>0)for(E.iushrn(B);B-- >0;)S.isOdd()&&S.iadd(N),S.iushrn(1);L.cmp(E)>=0?(L.isub(E),k.isub(S)):(E.isub(L),S.isub(k))}return(j=L.cmpn(1)===0?k:S).cmpn(0)<0&&j.iadd(P),j},s.prototype.gcd=function(P){if(this.isZero())return P.abs();if(P.isZero())return this.abs();var L=this.clone(),E=P.clone();L.negative=0,E.negative=0;for(var j=0;L.isEven()&&E.isEven();j++)L.iushrn(1),E.iushrn(1);for(;;){for(;L.isEven();)L.iushrn(1);for(;E.isEven();)E.iushrn(1);var k=L.cmp(E);if(k<0){var S=L;L=E,E=S}else if(k===0||E.cmpn(1)===0)break;L.isub(E)}return E.iushln(j)},s.prototype.invm=function(P){return this.egcd(P).a.umod(P)},s.prototype.isEven=function(){return(1&this.words[0])==0},s.prototype.isOdd=function(){return(1&this.words[0])==1},s.prototype.andln=function(P){return this.words[0]&P},s.prototype.bincn=function(P){u(typeof P=="number");var L=P%26,E=(P-L)/26,j=1<>>26,N&=67108863,this.words[S]=N}return k!==0&&(this.words[S]=k,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(P){var L,E=P<0;if(this.negative!==0&&!E)return-1;if(this.negative===0&&E)return 1;if(this.strip(),this.length>1)L=1;else{E&&(P=-P),u(P<=67108863,"Number is too big");var j=0|this.words[0];L=j===P?0:jP.length)return 1;if(this.length=0;E--){var j=0|this.words[E],k=0|P.words[E];if(j!==k){jk&&(L=1);break}}return L},s.prototype.gtn=function(P){return this.cmpn(P)===1},s.prototype.gt=function(P){return this.cmp(P)===1},s.prototype.gten=function(P){return this.cmpn(P)>=0},s.prototype.gte=function(P){return this.cmp(P)>=0},s.prototype.ltn=function(P){return this.cmpn(P)===-1},s.prototype.lt=function(P){return this.cmp(P)===-1},s.prototype.lten=function(P){return this.cmpn(P)<=0},s.prototype.lte=function(P){return this.cmp(P)<=0},s.prototype.eqn=function(P){return this.cmpn(P)===0},s.prototype.eq=function(P){return this.cmp(P)===0},s.red=function(P){return new K(P)},s.prototype.toRed=function(P){return u(!this.red,"Already a number in reduction context"),u(this.negative===0,"red works only with positives"),P.convertTo(this)._forceRed(P)},s.prototype.fromRed=function(){return u(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(P){return this.red=P,this},s.prototype.forceRed=function(P){return u(!this.red,"Already a number in reduction context"),this._forceRed(P)},s.prototype.redAdd=function(P){return u(this.red,"redAdd works only with red numbers"),this.red.add(this,P)},s.prototype.redIAdd=function(P){return u(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,P)},s.prototype.redSub=function(P){return u(this.red,"redSub works only with red numbers"),this.red.sub(this,P)},s.prototype.redISub=function(P){return u(this.red,"redISub works only with red numbers"),this.red.isub(this,P)},s.prototype.redShl=function(P){return u(this.red,"redShl works only with red numbers"),this.red.shl(this,P)},s.prototype.redMul=function(P){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,P),this.red.mul(this,P)},s.prototype.redIMul=function(P){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,P),this.red.imul(this,P)},s.prototype.redSqr=function(){return u(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return u(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return u(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return u(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return u(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(P){return u(this.red&&!P.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,P)};var M={k256:null,p224:null,p192:null,p25519:null};function T(P,L){this.name=P,this.p=new s(L,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function U(){T.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function F(){T.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function H(){T.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function W(){T.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function K(P){if(typeof P=="string"){var L=s._prime(P);this.m=L.p,this.prime=L}else u(P.gtn(1),"modulus must be greater than 1"),this.m=P,this.prime=null}function $(P){K.call(this,P),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}T.prototype._tmp=function(){var P=new s(null);return P.words=new Array(Math.ceil(this.n/13)),P},T.prototype.ireduce=function(P){var L,E=P;do this.split(E,this.tmp),L=(E=(E=this.imulK(E)).iadd(this.tmp)).bitLength();while(L>this.n);var j=L0?E.isub(this.p):E.strip!==void 0?E.strip():E._strip(),E},T.prototype.split=function(P,L){P.iushrn(this.n,0,L)},T.prototype.imulK=function(P){return P.imul(this.k)},c(U,T),U.prototype.split=function(P,L){for(var E=Math.min(P.length,9),j=0;j>>22,k=S}k>>>=22,P.words[j-10]=k,k===0&&P.length>10?P.length-=10:P.length-=9},U.prototype.imulK=function(P){P.words[P.length]=0,P.words[P.length+1]=0,P.length+=2;for(var L=0,E=0;E>>=26,P.words[E]=k,L=j}return L!==0&&(P.words[P.length++]=L),P},s._prime=function(P){if(M[P])return M[P];var L;if(P==="k256")L=new U;else if(P==="p224")L=new F;else if(P==="p192")L=new H;else{if(P!=="p25519")throw new Error("Unknown prime "+P);L=new W}return M[P]=L,L},K.prototype._verify1=function(P){u(P.negative===0,"red works only with positives"),u(P.red,"red works only with red numbers")},K.prototype._verify2=function(P,L){u((P.negative|L.negative)==0,"red works only with positives"),u(P.red&&P.red===L.red,"red works only with red numbers")},K.prototype.imod=function(P){return this.prime?this.prime.ireduce(P)._forceRed(this):P.umod(this.m)._forceRed(this)},K.prototype.neg=function(P){return P.isZero()?P.clone():this.m.sub(P)._forceRed(this)},K.prototype.add=function(P,L){this._verify2(P,L);var E=P.add(L);return E.cmp(this.m)>=0&&E.isub(this.m),E._forceRed(this)},K.prototype.iadd=function(P,L){this._verify2(P,L);var E=P.iadd(L);return E.cmp(this.m)>=0&&E.isub(this.m),E},K.prototype.sub=function(P,L){this._verify2(P,L);var E=P.sub(L);return E.cmpn(0)<0&&E.iadd(this.m),E._forceRed(this)},K.prototype.isub=function(P,L){this._verify2(P,L);var E=P.isub(L);return E.cmpn(0)<0&&E.iadd(this.m),E},K.prototype.shl=function(P,L){return this._verify1(P),this.imod(P.ushln(L))},K.prototype.imul=function(P,L){return this._verify2(P,L),this.imod(P.imul(L))},K.prototype.mul=function(P,L){return this._verify2(P,L),this.imod(P.mul(L))},K.prototype.isqr=function(P){return this.imul(P,P.clone())},K.prototype.sqr=function(P){return this.mul(P,P)},K.prototype.sqrt=function(P){if(P.isZero())return P.clone();var L=this.m.andln(3);if(u(L%2==1),L===3){var E=this.m.add(new s(1)).iushrn(2);return this.pow(P,E)}for(var j=this.m.subn(1),k=0;!j.isZero()&&j.andln(1)===0;)k++,j.iushrn(1);u(!j.isZero());var S=new s(1).toRed(this),N=S.redNeg(),O=this.m.subn(1).iushrn(1),D=this.m.bitLength();for(D=new s(2*D*D).toRed(this);this.pow(D,O).cmp(N)!==0;)D.redIAdd(N);for(var B=this.pow(D,j),Y=this.pow(P,j.addn(1).iushrn(1)),Z=this.pow(P,j),ne=k;Z.cmp(S)!==0;){for(var q=Z,ee=0;q.cmp(S)!==0;ee++)q=q.redSqr();u(ee=0;j--){for(var D=L.words[j],B=O-1;B>=0;B--){var Y=D>>B&1;k!==E[0]&&(k=this.sqr(k)),Y!==0||S!==0?(S<<=1,S|=Y,(++N===4||j===0&&B===0)&&(k=this.mul(k,E[S]),N=0,S=0)):N=0}O=26}return k},K.prototype.convertTo=function(P){var L=P.umod(this.m);return L===P?L.clone():L},K.prototype.convertFrom=function(P){var L=P.clone();return L.red=null,L},s.mont=function(P){return new $(P)},c($,K),$.prototype.convertTo=function(P){return this.imod(P.ushln(this.shift))},$.prototype.convertFrom=function(P){var L=this.imod(P.mul(this.rinv));return L.red=null,L},$.prototype.imul=function(P,L){if(P.isZero()||L.isZero())return P.words[0]=0,P.length=1,P;var E=P.imul(L),j=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),k=E.isub(j).iushrn(this.shift),S=k;return k.cmp(this.m)>=0?S=k.isub(this.m):k.cmpn(0)<0&&(S=k.iadd(this.m)),S._forceRed(this)},$.prototype.mul=function(P,L){if(P.isZero()||L.isZero())return new s(0)._forceRed(this);var E=P.mul(L),j=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),k=E.isub(j).iushrn(this.shift),S=k;return k.cmp(this.m)>=0?S=k.isub(this.m):k.cmpn(0)<0&&(S=k.iadd(this.m)),S._forceRed(this)},$.prototype.invm=function(P){return this.imod(P._invmp(this.m).mul(this.r2))._forceRed(this)}})(n===void 0||n)},{buffer:188}],185:[function(t,n,l){l.byteLength=function(m){var p=f(m),x=p[0],g=p[1];return 3*(x+g)/4-g},l.toByteArray=function(m){var p,x,g=f(m),y=g[0],v=g[1],_=new u((function(T,U,F){return 3*(U+F)/4-F})(0,y,v)),C=0,M=v>0?y-4:y;for(x=0;x>16&255,_[C++]=p>>8&255,_[C++]=255&p;return v===2&&(p=o[m.charCodeAt(x)]<<2|o[m.charCodeAt(x+1)]>>4,_[C++]=255&p),v===1&&(p=o[m.charCodeAt(x)]<<10|o[m.charCodeAt(x+1)]<<4|o[m.charCodeAt(x+2)]>>2,_[C++]=p>>8&255,_[C++]=255&p),_},l.fromByteArray=function(m){for(var p,x=m.length,g=x%3,y=[],v=0,_=x-g;v<_;v+=16383)y.push(h(m,v,v+16383>_?_:v+16383));return g===1?(p=m[x-1],y.push(i[p>>2]+i[p<<4&63]+"==")):g===2&&(p=(m[x-2]<<8)+m[x-1],y.push(i[p>>10]+i[p>>4&63]+i[p<<2&63]+"=")),y.join("")};for(var i=[],o=[],u=typeof Uint8Array<"u"?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,d=c.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var x=m.indexOf("=");return x===-1&&(x=p),[x,x===p?0:4-x%4]}function h(m,p,x){for(var g,y,v=[],_=p;_>18&63]+i[y>>12&63]+i[y>>6&63]+i[63&y]);return v.join("")}o[45]=62,o[95]=63},{}],186:[function(t,n,l){(function(i,o){function u(E,j){if(!E)throw new Error(j||"Assertion failed")}function c(E,j){E.super_=j;var k=function(){};k.prototype=j.prototype,E.prototype=new k,E.prototype.constructor=E}function s(E,j,k){if(s.isBN(E))return E;this.negative=0,this.words=null,this.length=0,this.red=null,E!==null&&(j!=="le"&&j!=="be"||(k=j,j=10),this._init(E||0,j||10,k||"be"))}var d;typeof i=="object"?i.exports=s:(void 0).BN=s,s.BN=s,s.wordSize=26;try{d=typeof window<"u"&&window.Buffer!==void 0?window.Buffer:t("buffer").Buffer}catch{}function f(E,j){var k=E.charCodeAt(j);return k>=48&&k<=57?k-48:k>=65&&k<=70?k-55:k>=97&&k<=102?k-87:void u(!1,"Invalid character in "+E)}function h(E,j,k){var S=f(E,k);return k-1>=j&&(S|=f(E,k-1)<<4),S}function m(E,j,k,S){for(var N=0,O=0,D=Math.min(E.length,k),B=j;B=49?Y-49+10:Y>=17?Y-17+10:Y,u(Y>=0&&O0?E:j},s.min=function(E,j){return E.cmp(j)<0?E:j},s.prototype._init=function(E,j,k){if(typeof E=="number")return this._initNumber(E,j,k);if(typeof E=="object")return this._initArray(E,j,k);j==="hex"&&(j=16),u(j===(0|j)&&j>=2&&j<=36);var S=0;(E=E.toString().replace(/\s+/g,""))[0]==="-"&&(S++,this.negative=1),S=0;S-=3)O=E[S]|E[S-1]<<8|E[S-2]<<16,this.words[N]|=O<>>26-D&67108863,(D+=24)>=26&&(D-=26,N++);else if(k==="le")for(S=0,N=0;S>>26-D&67108863,(D+=24)>=26&&(D-=26,N++);return this._strip()},s.prototype._parseHex=function(E,j,k){this.length=Math.ceil((E.length-j)/6),this.words=new Array(this.length);for(var S=0;S=j;S-=2)N=h(E,j,S)<=18?(O-=18,D+=1,this.words[D]|=N>>>26):O+=8;else for(S=(E.length-j)%2==0?j+1:j;S=18?(O-=18,D+=1,this.words[D]|=N>>>26):O+=8;this._strip()},s.prototype._parseBase=function(E,j,k){this.words=[0],this.length=1;for(var S=0,N=1;N<=67108863;N*=j)S++;S--,N=N/j|0;for(var O=E.length-k,D=O%S,B=Math.min(O,O-D)+k,Y=0,Z=k;Z1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=x}catch{s.prototype.inspect=x}else s.prototype.inspect=x;function x(){return(this.red?""}var g=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],y=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],v=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(E,j){var k;if(j=0|j||1,(E=E||10)===16||E==="hex"){k="";for(var S=0,N=0,O=0;O>>24-S&16777215,(S+=2)>=26&&(S-=26,O--),k=N!==0||O!==this.length-1?g[6-B.length]+B+k:B+k}for(N!==0&&(k=N.toString(16)+k);k.length%j!=0;)k="0"+k;return this.negative!==0&&(k="-"+k),k}if(E===(0|E)&&E>=2&&E<=36){var Y=y[E],Z=v[E];k="";var ne=this.clone();for(ne.negative=0;!ne.isZero();){var q=ne.modrn(Z).toString(E);k=(ne=ne.idivn(Z)).isZero()?q+k:g[Y-q.length]+q+k}for(this.isZero()&&(k="0"+k);k.length%j!=0;)k="0"+k;return this.negative!==0&&(k="-"+k),k}u(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var E=this.words[0];return this.length===2?E+=67108864*this.words[1]:this.length===3&&this.words[2]===1?E+=4503599627370496+67108864*this.words[1]:this.length>2&&u(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-E:E},s.prototype.toJSON=function(){return this.toString(16,2)},d&&(s.prototype.toBuffer=function(E,j){return this.toArrayLike(d,E,j)}),s.prototype.toArray=function(E,j){return this.toArrayLike(Array,E,j)};function _(E,j,k){k.negative=j.negative^E.negative;var S=E.length+j.length|0;k.length=S,S=S-1|0;var N=0|E.words[0],O=0|j.words[0],D=N*O,B=67108863&D,Y=D/67108864|0;k.words[0]=B;for(var Z=1;Z>>26,q=67108863&Y,ee=Math.min(Z,j.length-1),z=Math.max(0,Z-E.length+1);z<=ee;z++){var I=Z-z|0;ne+=(D=(N=0|E.words[I])*(O=0|j.words[z])+q)/67108864|0,q=67108863&D}k.words[Z]=0|q,Y=0|ne}return Y!==0?k.words[Z]=0|Y:k.length--,k._strip()}s.prototype.toArrayLike=function(E,j,k){this._strip();var S=this.byteLength(),N=k||Math.max(1,S);u(S<=N,"byte array longer than desired length"),u(N>0,"Requested array length <= 0");var O=(function(D,B){return D.allocUnsafe?D.allocUnsafe(B):new D(B)})(E,N);return this["_toArrayLike"+(j==="le"?"LE":"BE")](O,S),O},s.prototype._toArrayLikeLE=function(E,j){for(var k=0,S=0,N=0,O=0;N>8&255),k>16&255),O===6?(k>24&255),S=0,O=0):(S=D>>>24,O+=2)}if(k=0&&(E[k--]=D>>8&255),k>=0&&(E[k--]=D>>16&255),O===6?(k>=0&&(E[k--]=D>>24&255),S=0,O=0):(S=D>>>24,O+=2)}if(k>=0)for(E[k--]=S;k>=0;)E[k--]=0},Math.clz32?s.prototype._countBits=function(E){return 32-Math.clz32(E)}:s.prototype._countBits=function(E){var j=E,k=0;return j>=4096&&(k+=13,j>>>=13),j>=64&&(k+=7,j>>>=7),j>=8&&(k+=4,j>>>=4),j>=2&&(k+=2,j>>>=2),k+j},s.prototype._zeroBits=function(E){if(E===0)return 26;var j=E,k=0;return(8191&j)==0&&(k+=13,j>>>=13),(127&j)==0&&(k+=7,j>>>=7),(15&j)==0&&(k+=4,j>>>=4),(3&j)==0&&(k+=2,j>>>=2),(1&j)==0&&k++,k},s.prototype.bitLength=function(){var E=this.words[this.length-1],j=this._countBits(E);return 26*(this.length-1)+j},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var E=0,j=0;jE.length?this.clone().ior(E):E.clone().ior(this)},s.prototype.uor=function(E){return this.length>E.length?this.clone().iuor(E):E.clone().iuor(this)},s.prototype.iuand=function(E){var j;j=this.length>E.length?E:this;for(var k=0;kE.length?this.clone().iand(E):E.clone().iand(this)},s.prototype.uand=function(E){return this.length>E.length?this.clone().iuand(E):E.clone().iuand(this)},s.prototype.iuxor=function(E){var j,k;this.length>E.length?(j=this,k=E):(j=E,k=this);for(var S=0;SE.length?this.clone().ixor(E):E.clone().ixor(this)},s.prototype.uxor=function(E){return this.length>E.length?this.clone().iuxor(E):E.clone().iuxor(this)},s.prototype.inotn=function(E){u(typeof E=="number"&&E>=0);var j=0|Math.ceil(E/26),k=E%26;this._expand(j),k>0&&j--;for(var S=0;S0&&(this.words[S]=~this.words[S]&67108863>>26-k),this._strip()},s.prototype.notn=function(E){return this.clone().inotn(E)},s.prototype.setn=function(E,j){u(typeof E=="number"&&E>=0);var k=E/26|0,S=E%26;return this._expand(k+1),this.words[k]=j?this.words[k]|1<E.length?(k=this,S=E):(k=E,S=this);for(var N=0,O=0;O>>26;for(;N!==0&&O>>26;if(this.length=k.length,N!==0)this.words[this.length]=N,this.length++;else if(k!==this)for(;OE.length?this.clone().iadd(E):E.clone().iadd(this)},s.prototype.isub=function(E){if(E.negative!==0){E.negative=0;var j=this.iadd(E);return E.negative=1,j._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(E),this.negative=1,this._normSign();var k,S,N=this.cmp(E);if(N===0)return this.negative=0,this.length=1,this.words[0]=0,this;N>0?(k=this,S=E):(k=E,S=this);for(var O=0,D=0;D>26,this.words[D]=67108863&j;for(;O!==0&&D>26,this.words[D]=67108863&j;if(O===0&&D>>13,z=0|D[1],I=8191&z,X=z>>>13,te=0|D[2],se=8191&te,Q=te>>>13,re=0|D[3],ue=8191&re,ae=re>>>13,ie=0|D[4],fe=8191&ie,he=ie>>>13,de=0|D[5],ge=8191&de,ye=de>>>13,xe=0|D[6],ce=8191&xe,Ce=xe>>>13,Oe=0|D[7],je=8191&Oe,Ie=Oe>>>13,et=0|D[8],Ue=8191&et,Ze=et>>>13,tt=0|D[9],Ke=8191&tt,ze=tt>>>13,Qe=0|B[0],nt=8191&Qe,Ae=Qe>>>13,ut=0|B[1],zt=8191&ut,ht=ut>>>13,Tt=0|B[2],It=8191&Tt,Et=Tt>>>13,$t=0|B[3],qt=8191&$t,yt=$t>>>13,Rt=0|B[4],Xt=8191&Rt,dt=Rt>>>13,Ft=0|B[5],Ht=8191&Ft,Nt=Ft>>>13,be=0|B[6],ke=8191&be,Re=be>>>13,Xe=0|B[7],vt=8191&Xe,Je=Xe>>>13,St=0|B[8],wt=8191&St,ot=St>>>13,At=0|B[9],Ct=8191&At,Dt=At>>>13;k.negative=E.negative^j.negative,k.length=19;var or=(Z+(S=Math.imul(q,nt))|0)+((8191&(N=(N=Math.imul(q,Ae))+Math.imul(ee,nt)|0))<<13)|0;Z=((O=Math.imul(ee,Ae))+(N>>>13)|0)+(or>>>26)|0,or&=67108863,S=Math.imul(I,nt),N=(N=Math.imul(I,Ae))+Math.imul(X,nt)|0,O=Math.imul(X,Ae);var Gt=(Z+(S=S+Math.imul(q,zt)|0)|0)+((8191&(N=(N=N+Math.imul(q,ht)|0)+Math.imul(ee,zt)|0))<<13)|0;Z=((O=O+Math.imul(ee,ht)|0)+(N>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,S=Math.imul(se,nt),N=(N=Math.imul(se,Ae))+Math.imul(Q,nt)|0,O=Math.imul(Q,Ae),S=S+Math.imul(I,zt)|0,N=(N=N+Math.imul(I,ht)|0)+Math.imul(X,zt)|0,O=O+Math.imul(X,ht)|0;var nr=(Z+(S=S+Math.imul(q,It)|0)|0)+((8191&(N=(N=N+Math.imul(q,Et)|0)+Math.imul(ee,It)|0))<<13)|0;Z=((O=O+Math.imul(ee,Et)|0)+(N>>>13)|0)+(nr>>>26)|0,nr&=67108863,S=Math.imul(ue,nt),N=(N=Math.imul(ue,Ae))+Math.imul(ae,nt)|0,O=Math.imul(ae,Ae),S=S+Math.imul(se,zt)|0,N=(N=N+Math.imul(se,ht)|0)+Math.imul(Q,zt)|0,O=O+Math.imul(Q,ht)|0,S=S+Math.imul(I,It)|0,N=(N=N+Math.imul(I,Et)|0)+Math.imul(X,It)|0,O=O+Math.imul(X,Et)|0;var ur=(Z+(S=S+Math.imul(q,qt)|0)|0)+((8191&(N=(N=N+Math.imul(q,yt)|0)+Math.imul(ee,qt)|0))<<13)|0;Z=((O=O+Math.imul(ee,yt)|0)+(N>>>13)|0)+(ur>>>26)|0,ur&=67108863,S=Math.imul(fe,nt),N=(N=Math.imul(fe,Ae))+Math.imul(he,nt)|0,O=Math.imul(he,Ae),S=S+Math.imul(ue,zt)|0,N=(N=N+Math.imul(ue,ht)|0)+Math.imul(ae,zt)|0,O=O+Math.imul(ae,ht)|0,S=S+Math.imul(se,It)|0,N=(N=N+Math.imul(se,Et)|0)+Math.imul(Q,It)|0,O=O+Math.imul(Q,Et)|0,S=S+Math.imul(I,qt)|0,N=(N=N+Math.imul(I,yt)|0)+Math.imul(X,qt)|0,O=O+Math.imul(X,yt)|0;var Ar=(Z+(S=S+Math.imul(q,Xt)|0)|0)+((8191&(N=(N=N+Math.imul(q,dt)|0)+Math.imul(ee,Xt)|0))<<13)|0;Z=((O=O+Math.imul(ee,dt)|0)+(N>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,S=Math.imul(ge,nt),N=(N=Math.imul(ge,Ae))+Math.imul(ye,nt)|0,O=Math.imul(ye,Ae),S=S+Math.imul(fe,zt)|0,N=(N=N+Math.imul(fe,ht)|0)+Math.imul(he,zt)|0,O=O+Math.imul(he,ht)|0,S=S+Math.imul(ue,It)|0,N=(N=N+Math.imul(ue,Et)|0)+Math.imul(ae,It)|0,O=O+Math.imul(ae,Et)|0,S=S+Math.imul(se,qt)|0,N=(N=N+Math.imul(se,yt)|0)+Math.imul(Q,qt)|0,O=O+Math.imul(Q,yt)|0,S=S+Math.imul(I,Xt)|0,N=(N=N+Math.imul(I,dt)|0)+Math.imul(X,Xt)|0,O=O+Math.imul(X,dt)|0;var me=(Z+(S=S+Math.imul(q,Ht)|0)|0)+((8191&(N=(N=N+Math.imul(q,Nt)|0)+Math.imul(ee,Ht)|0))<<13)|0;Z=((O=O+Math.imul(ee,Nt)|0)+(N>>>13)|0)+(me>>>26)|0,me&=67108863,S=Math.imul(ce,nt),N=(N=Math.imul(ce,Ae))+Math.imul(Ce,nt)|0,O=Math.imul(Ce,Ae),S=S+Math.imul(ge,zt)|0,N=(N=N+Math.imul(ge,ht)|0)+Math.imul(ye,zt)|0,O=O+Math.imul(ye,ht)|0,S=S+Math.imul(fe,It)|0,N=(N=N+Math.imul(fe,Et)|0)+Math.imul(he,It)|0,O=O+Math.imul(he,Et)|0,S=S+Math.imul(ue,qt)|0,N=(N=N+Math.imul(ue,yt)|0)+Math.imul(ae,qt)|0,O=O+Math.imul(ae,yt)|0,S=S+Math.imul(se,Xt)|0,N=(N=N+Math.imul(se,dt)|0)+Math.imul(Q,Xt)|0,O=O+Math.imul(Q,dt)|0,S=S+Math.imul(I,Ht)|0,N=(N=N+Math.imul(I,Nt)|0)+Math.imul(X,Ht)|0,O=O+Math.imul(X,Nt)|0;var we=(Z+(S=S+Math.imul(q,ke)|0)|0)+((8191&(N=(N=N+Math.imul(q,Re)|0)+Math.imul(ee,ke)|0))<<13)|0;Z=((O=O+Math.imul(ee,Re)|0)+(N>>>13)|0)+(we>>>26)|0,we&=67108863,S=Math.imul(je,nt),N=(N=Math.imul(je,Ae))+Math.imul(Ie,nt)|0,O=Math.imul(Ie,Ae),S=S+Math.imul(ce,zt)|0,N=(N=N+Math.imul(ce,ht)|0)+Math.imul(Ce,zt)|0,O=O+Math.imul(Ce,ht)|0,S=S+Math.imul(ge,It)|0,N=(N=N+Math.imul(ge,Et)|0)+Math.imul(ye,It)|0,O=O+Math.imul(ye,Et)|0,S=S+Math.imul(fe,qt)|0,N=(N=N+Math.imul(fe,yt)|0)+Math.imul(he,qt)|0,O=O+Math.imul(he,yt)|0,S=S+Math.imul(ue,Xt)|0,N=(N=N+Math.imul(ue,dt)|0)+Math.imul(ae,Xt)|0,O=O+Math.imul(ae,dt)|0,S=S+Math.imul(se,Ht)|0,N=(N=N+Math.imul(se,Nt)|0)+Math.imul(Q,Ht)|0,O=O+Math.imul(Q,Nt)|0,S=S+Math.imul(I,ke)|0,N=(N=N+Math.imul(I,Re)|0)+Math.imul(X,ke)|0,O=O+Math.imul(X,Re)|0;var Le=(Z+(S=S+Math.imul(q,vt)|0)|0)+((8191&(N=(N=N+Math.imul(q,Je)|0)+Math.imul(ee,vt)|0))<<13)|0;Z=((O=O+Math.imul(ee,Je)|0)+(N>>>13)|0)+(Le>>>26)|0,Le&=67108863,S=Math.imul(Ue,nt),N=(N=Math.imul(Ue,Ae))+Math.imul(Ze,nt)|0,O=Math.imul(Ze,Ae),S=S+Math.imul(je,zt)|0,N=(N=N+Math.imul(je,ht)|0)+Math.imul(Ie,zt)|0,O=O+Math.imul(Ie,ht)|0,S=S+Math.imul(ce,It)|0,N=(N=N+Math.imul(ce,Et)|0)+Math.imul(Ce,It)|0,O=O+Math.imul(Ce,Et)|0,S=S+Math.imul(ge,qt)|0,N=(N=N+Math.imul(ge,yt)|0)+Math.imul(ye,qt)|0,O=O+Math.imul(ye,yt)|0,S=S+Math.imul(fe,Xt)|0,N=(N=N+Math.imul(fe,dt)|0)+Math.imul(he,Xt)|0,O=O+Math.imul(he,dt)|0,S=S+Math.imul(ue,Ht)|0,N=(N=N+Math.imul(ue,Nt)|0)+Math.imul(ae,Ht)|0,O=O+Math.imul(ae,Nt)|0,S=S+Math.imul(se,ke)|0,N=(N=N+Math.imul(se,Re)|0)+Math.imul(Q,ke)|0,O=O+Math.imul(Q,Re)|0,S=S+Math.imul(I,vt)|0,N=(N=N+Math.imul(I,Je)|0)+Math.imul(X,vt)|0,O=O+Math.imul(X,Je)|0;var $e=(Z+(S=S+Math.imul(q,wt)|0)|0)+((8191&(N=(N=N+Math.imul(q,ot)|0)+Math.imul(ee,wt)|0))<<13)|0;Z=((O=O+Math.imul(ee,ot)|0)+(N>>>13)|0)+($e>>>26)|0,$e&=67108863,S=Math.imul(Ke,nt),N=(N=Math.imul(Ke,Ae))+Math.imul(ze,nt)|0,O=Math.imul(ze,Ae),S=S+Math.imul(Ue,zt)|0,N=(N=N+Math.imul(Ue,ht)|0)+Math.imul(Ze,zt)|0,O=O+Math.imul(Ze,ht)|0,S=S+Math.imul(je,It)|0,N=(N=N+Math.imul(je,Et)|0)+Math.imul(Ie,It)|0,O=O+Math.imul(Ie,Et)|0,S=S+Math.imul(ce,qt)|0,N=(N=N+Math.imul(ce,yt)|0)+Math.imul(Ce,qt)|0,O=O+Math.imul(Ce,yt)|0,S=S+Math.imul(ge,Xt)|0,N=(N=N+Math.imul(ge,dt)|0)+Math.imul(ye,Xt)|0,O=O+Math.imul(ye,dt)|0,S=S+Math.imul(fe,Ht)|0,N=(N=N+Math.imul(fe,Nt)|0)+Math.imul(he,Ht)|0,O=O+Math.imul(he,Nt)|0,S=S+Math.imul(ue,ke)|0,N=(N=N+Math.imul(ue,Re)|0)+Math.imul(ae,ke)|0,O=O+Math.imul(ae,Re)|0,S=S+Math.imul(se,vt)|0,N=(N=N+Math.imul(se,Je)|0)+Math.imul(Q,vt)|0,O=O+Math.imul(Q,Je)|0,S=S+Math.imul(I,wt)|0,N=(N=N+Math.imul(I,ot)|0)+Math.imul(X,wt)|0,O=O+Math.imul(X,ot)|0;var ct=(Z+(S=S+Math.imul(q,Ct)|0)|0)+((8191&(N=(N=N+Math.imul(q,Dt)|0)+Math.imul(ee,Ct)|0))<<13)|0;Z=((O=O+Math.imul(ee,Dt)|0)+(N>>>13)|0)+(ct>>>26)|0,ct&=67108863,S=Math.imul(Ke,zt),N=(N=Math.imul(Ke,ht))+Math.imul(ze,zt)|0,O=Math.imul(ze,ht),S=S+Math.imul(Ue,It)|0,N=(N=N+Math.imul(Ue,Et)|0)+Math.imul(Ze,It)|0,O=O+Math.imul(Ze,Et)|0,S=S+Math.imul(je,qt)|0,N=(N=N+Math.imul(je,yt)|0)+Math.imul(Ie,qt)|0,O=O+Math.imul(Ie,yt)|0,S=S+Math.imul(ce,Xt)|0,N=(N=N+Math.imul(ce,dt)|0)+Math.imul(Ce,Xt)|0,O=O+Math.imul(Ce,dt)|0,S=S+Math.imul(ge,Ht)|0,N=(N=N+Math.imul(ge,Nt)|0)+Math.imul(ye,Ht)|0,O=O+Math.imul(ye,Nt)|0,S=S+Math.imul(fe,ke)|0,N=(N=N+Math.imul(fe,Re)|0)+Math.imul(he,ke)|0,O=O+Math.imul(he,Re)|0,S=S+Math.imul(ue,vt)|0,N=(N=N+Math.imul(ue,Je)|0)+Math.imul(ae,vt)|0,O=O+Math.imul(ae,Je)|0,S=S+Math.imul(se,wt)|0,N=(N=N+Math.imul(se,ot)|0)+Math.imul(Q,wt)|0,O=O+Math.imul(Q,ot)|0;var Fe=(Z+(S=S+Math.imul(I,Ct)|0)|0)+((8191&(N=(N=N+Math.imul(I,Dt)|0)+Math.imul(X,Ct)|0))<<13)|0;Z=((O=O+Math.imul(X,Dt)|0)+(N>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,S=Math.imul(Ke,It),N=(N=Math.imul(Ke,Et))+Math.imul(ze,It)|0,O=Math.imul(ze,Et),S=S+Math.imul(Ue,qt)|0,N=(N=N+Math.imul(Ue,yt)|0)+Math.imul(Ze,qt)|0,O=O+Math.imul(Ze,yt)|0,S=S+Math.imul(je,Xt)|0,N=(N=N+Math.imul(je,dt)|0)+Math.imul(Ie,Xt)|0,O=O+Math.imul(Ie,dt)|0,S=S+Math.imul(ce,Ht)|0,N=(N=N+Math.imul(ce,Nt)|0)+Math.imul(Ce,Ht)|0,O=O+Math.imul(Ce,Nt)|0,S=S+Math.imul(ge,ke)|0,N=(N=N+Math.imul(ge,Re)|0)+Math.imul(ye,ke)|0,O=O+Math.imul(ye,Re)|0,S=S+Math.imul(fe,vt)|0,N=(N=N+Math.imul(fe,Je)|0)+Math.imul(he,vt)|0,O=O+Math.imul(he,Je)|0,S=S+Math.imul(ue,wt)|0,N=(N=N+Math.imul(ue,ot)|0)+Math.imul(ae,wt)|0,O=O+Math.imul(ae,ot)|0;var Ge=(Z+(S=S+Math.imul(se,Ct)|0)|0)+((8191&(N=(N=N+Math.imul(se,Dt)|0)+Math.imul(Q,Ct)|0))<<13)|0;Z=((O=O+Math.imul(Q,Dt)|0)+(N>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,S=Math.imul(Ke,qt),N=(N=Math.imul(Ke,yt))+Math.imul(ze,qt)|0,O=Math.imul(ze,yt),S=S+Math.imul(Ue,Xt)|0,N=(N=N+Math.imul(Ue,dt)|0)+Math.imul(Ze,Xt)|0,O=O+Math.imul(Ze,dt)|0,S=S+Math.imul(je,Ht)|0,N=(N=N+Math.imul(je,Nt)|0)+Math.imul(Ie,Ht)|0,O=O+Math.imul(Ie,Nt)|0,S=S+Math.imul(ce,ke)|0,N=(N=N+Math.imul(ce,Re)|0)+Math.imul(Ce,ke)|0,O=O+Math.imul(Ce,Re)|0,S=S+Math.imul(ge,vt)|0,N=(N=N+Math.imul(ge,Je)|0)+Math.imul(ye,vt)|0,O=O+Math.imul(ye,Je)|0,S=S+Math.imul(fe,wt)|0,N=(N=N+Math.imul(fe,ot)|0)+Math.imul(he,wt)|0,O=O+Math.imul(he,ot)|0;var Ne=(Z+(S=S+Math.imul(ue,Ct)|0)|0)+((8191&(N=(N=N+Math.imul(ue,Dt)|0)+Math.imul(ae,Ct)|0))<<13)|0;Z=((O=O+Math.imul(ae,Dt)|0)+(N>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,S=Math.imul(Ke,Xt),N=(N=Math.imul(Ke,dt))+Math.imul(ze,Xt)|0,O=Math.imul(ze,dt),S=S+Math.imul(Ue,Ht)|0,N=(N=N+Math.imul(Ue,Nt)|0)+Math.imul(Ze,Ht)|0,O=O+Math.imul(Ze,Nt)|0,S=S+Math.imul(je,ke)|0,N=(N=N+Math.imul(je,Re)|0)+Math.imul(Ie,ke)|0,O=O+Math.imul(Ie,Re)|0,S=S+Math.imul(ce,vt)|0,N=(N=N+Math.imul(ce,Je)|0)+Math.imul(Ce,vt)|0,O=O+Math.imul(Ce,Je)|0,S=S+Math.imul(ge,wt)|0,N=(N=N+Math.imul(ge,ot)|0)+Math.imul(ye,wt)|0,O=O+Math.imul(ye,ot)|0;var it=(Z+(S=S+Math.imul(fe,Ct)|0)|0)+((8191&(N=(N=N+Math.imul(fe,Dt)|0)+Math.imul(he,Ct)|0))<<13)|0;Z=((O=O+Math.imul(he,Dt)|0)+(N>>>13)|0)+(it>>>26)|0,it&=67108863,S=Math.imul(Ke,Ht),N=(N=Math.imul(Ke,Nt))+Math.imul(ze,Ht)|0,O=Math.imul(ze,Nt),S=S+Math.imul(Ue,ke)|0,N=(N=N+Math.imul(Ue,Re)|0)+Math.imul(Ze,ke)|0,O=O+Math.imul(Ze,Re)|0,S=S+Math.imul(je,vt)|0,N=(N=N+Math.imul(je,Je)|0)+Math.imul(Ie,vt)|0,O=O+Math.imul(Ie,Je)|0,S=S+Math.imul(ce,wt)|0,N=(N=N+Math.imul(ce,ot)|0)+Math.imul(Ce,wt)|0,O=O+Math.imul(Ce,ot)|0;var st=(Z+(S=S+Math.imul(ge,Ct)|0)|0)+((8191&(N=(N=N+Math.imul(ge,Dt)|0)+Math.imul(ye,Ct)|0))<<13)|0;Z=((O=O+Math.imul(ye,Dt)|0)+(N>>>13)|0)+(st>>>26)|0,st&=67108863,S=Math.imul(Ke,ke),N=(N=Math.imul(Ke,Re))+Math.imul(ze,ke)|0,O=Math.imul(ze,Re),S=S+Math.imul(Ue,vt)|0,N=(N=N+Math.imul(Ue,Je)|0)+Math.imul(Ze,vt)|0,O=O+Math.imul(Ze,Je)|0,S=S+Math.imul(je,wt)|0,N=(N=N+Math.imul(je,ot)|0)+Math.imul(Ie,wt)|0,O=O+Math.imul(Ie,ot)|0;var at=(Z+(S=S+Math.imul(ce,Ct)|0)|0)+((8191&(N=(N=N+Math.imul(ce,Dt)|0)+Math.imul(Ce,Ct)|0))<<13)|0;Z=((O=O+Math.imul(Ce,Dt)|0)+(N>>>13)|0)+(at>>>26)|0,at&=67108863,S=Math.imul(Ke,vt),N=(N=Math.imul(Ke,Je))+Math.imul(ze,vt)|0,O=Math.imul(ze,Je),S=S+Math.imul(Ue,wt)|0,N=(N=N+Math.imul(Ue,ot)|0)+Math.imul(Ze,wt)|0,O=O+Math.imul(Ze,ot)|0;var Mt=(Z+(S=S+Math.imul(je,Ct)|0)|0)+((8191&(N=(N=N+Math.imul(je,Dt)|0)+Math.imul(Ie,Ct)|0))<<13)|0;Z=((O=O+Math.imul(Ie,Dt)|0)+(N>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,S=Math.imul(Ke,wt),N=(N=Math.imul(Ke,ot))+Math.imul(ze,wt)|0,O=Math.imul(ze,ot);var er=(Z+(S=S+Math.imul(Ue,Ct)|0)|0)+((8191&(N=(N=N+Math.imul(Ue,Dt)|0)+Math.imul(Ze,Ct)|0))<<13)|0;Z=((O=O+Math.imul(Ze,Dt)|0)+(N>>>13)|0)+(er>>>26)|0,er&=67108863;var Wt=(Z+(S=Math.imul(Ke,Ct))|0)+((8191&(N=(N=Math.imul(Ke,Dt))+Math.imul(ze,Ct)|0))<<13)|0;return Z=((O=Math.imul(ze,Dt))+(N>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,Y[0]=or,Y[1]=Gt,Y[2]=nr,Y[3]=ur,Y[4]=Ar,Y[5]=me,Y[6]=we,Y[7]=Le,Y[8]=$e,Y[9]=ct,Y[10]=Fe,Y[11]=Ge,Y[12]=Ne,Y[13]=it,Y[14]=st,Y[15]=at,Y[16]=Mt,Y[17]=er,Y[18]=Wt,Z!==0&&(Y[19]=Z,k.length++),k};function M(E,j,k){k.negative=j.negative^E.negative,k.length=E.length+j.length;for(var S=0,N=0,O=0;O>>26)|0)>>>26,D&=67108863}k.words[O]=B,S=D,D=N}return S!==0?k.words[O]=S:k.length--,k._strip()}function T(E,j,k){return M(E,j,k)}Math.imul||(C=_),s.prototype.mulTo=function(E,j){var k=this.length+E.length;return this.length===10&&E.length===10?C(this,E,j):k<63?_(this,E,j):k<1024?M(this,E,j):T(this,E,j)},s.prototype.mul=function(E){var j=new s(null);return j.words=new Array(this.length+E.length),this.mulTo(E,j)},s.prototype.mulf=function(E){var j=new s(null);return j.words=new Array(this.length+E.length),T(this,E,j)},s.prototype.imul=function(E){return this.clone().mulTo(E,this)},s.prototype.imuln=function(E){var j=E<0;j&&(E=-E),u(typeof E=="number"),u(E<67108864);for(var k=0,S=0;S>=26,k+=N/67108864|0,k+=O>>>26,this.words[S]=67108863&O}return k!==0&&(this.words[S]=k,this.length++),j?this.ineg():this},s.prototype.muln=function(E){return this.clone().imuln(E)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(E){var j=(function(O){for(var D=new Array(O.bitLength()),B=0;B>>Z&1}return D})(E);if(j.length===0)return new s(1);for(var k=this,S=0;S=0);var j,k=E%26,S=(E-k)/26,N=67108863>>>26-k<<26-k;if(k!==0){var O=0;for(j=0;j>>26-k}O&&(this.words[j]=O,this.length++)}if(S!==0){for(j=this.length-1;j>=0;j--)this.words[j+S]=this.words[j];for(j=0;j=0),S=j?(j-j%26)/26:0;var N=E%26,O=Math.min((E-N)/26,this.length),D=67108863^67108863>>>N<O)for(this.length-=O,Y=0;Y=0&&(Z!==0||Y>=S);Y--){var ne=0|this.words[Y];this.words[Y]=Z<<26-N|ne>>>N,Z=ne&D}return B&&Z!==0&&(B.words[B.length++]=Z),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(E,j,k){return u(this.negative===0),this.iushrn(E,j,k)},s.prototype.shln=function(E){return this.clone().ishln(E)},s.prototype.ushln=function(E){return this.clone().iushln(E)},s.prototype.shrn=function(E){return this.clone().ishrn(E)},s.prototype.ushrn=function(E){return this.clone().iushrn(E)},s.prototype.testn=function(E){u(typeof E=="number"&&E>=0);var j=E%26,k=(E-j)/26,S=1<=0);var j=E%26,k=(E-j)/26;if(u(this.negative===0,"imaskn works only with positive numbers"),this.length<=k)return this;if(j!==0&&k++,this.length=Math.min(k,this.length),j!==0){var S=67108863^67108863>>>j<=67108864;j++)this.words[j]-=67108864,j===this.length-1?this.words[j+1]=1:this.words[j+1]++;return this.length=Math.max(this.length,j+1),this},s.prototype.isubn=function(E){if(u(typeof E=="number"),u(E<67108864),E<0)return this.iaddn(-E);if(this.negative!==0)return this.negative=0,this.iaddn(E),this.negative=1,this;if(this.words[0]-=E,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var j=0;j>26)-(B/67108864|0),this.words[S+k]=67108863&N}for(;S>26,this.words[S+k]=67108863&N;if(D===0)return this._strip();for(u(D===-1),D=0,S=0;S>26,this.words[S]=67108863&N;return this.negative=1,this._strip()},s.prototype._wordDiv=function(E,j){var k=(this.length,E.length),S=this.clone(),N=E,O=0|N.words[N.length-1];(k=26-this._countBits(O))!==0&&(N=N.ushln(k),S.iushln(k),O=0|N.words[N.length-1]);var D,B=S.length-N.length;if(j!=="mod"){(D=new s(null)).length=B+1,D.words=new Array(D.length);for(var Y=0;Y=0;ne--){var q=67108864*(0|S.words[N.length+ne])+(0|S.words[N.length+ne-1]);for(q=Math.min(q/O|0,67108863),S._ishlnsubmul(N,q,ne);S.negative!==0;)q--,S.negative=0,S._ishlnsubmul(N,1,ne),S.isZero()||(S.negative^=1);D&&(D.words[ne]=q)}return D&&D._strip(),S._strip(),j!=="div"&&k!==0&&S.iushrn(k),{div:D||null,mod:S}},s.prototype.divmod=function(E,j,k){return u(!E.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:this.negative!==0&&E.negative===0?(O=this.neg().divmod(E,j),j!=="mod"&&(S=O.div.neg()),j!=="div"&&(N=O.mod.neg(),k&&N.negative!==0&&N.iadd(E)),{div:S,mod:N}):this.negative===0&&E.negative!==0?(O=this.divmod(E.neg(),j),j!=="mod"&&(S=O.div.neg()),{div:S,mod:O.mod}):(this.negative&E.negative)!=0?(O=this.neg().divmod(E.neg(),j),j!=="div"&&(N=O.mod.neg(),k&&N.negative!==0&&N.isub(E)),{div:O.div,mod:N}):E.length>this.length||this.cmp(E)<0?{div:new s(0),mod:this}:E.length===1?j==="div"?{div:this.divn(E.words[0]),mod:null}:j==="mod"?{div:null,mod:new s(this.modrn(E.words[0]))}:{div:this.divn(E.words[0]),mod:new s(this.modrn(E.words[0]))}:this._wordDiv(E,j);var S,N,O},s.prototype.div=function(E){return this.divmod(E,"div",!1).div},s.prototype.mod=function(E){return this.divmod(E,"mod",!1).mod},s.prototype.umod=function(E){return this.divmod(E,"mod",!0).mod},s.prototype.divRound=function(E){var j=this.divmod(E);if(j.mod.isZero())return j.div;var k=j.div.negative!==0?j.mod.isub(E):j.mod,S=E.ushrn(1),N=E.andln(1),O=k.cmp(S);return O<0||N===1&&O===0?j.div:j.div.negative!==0?j.div.isubn(1):j.div.iaddn(1)},s.prototype.modrn=function(E){var j=E<0;j&&(E=-E),u(E<=67108863);for(var k=(1<<26)%E,S=0,N=this.length-1;N>=0;N--)S=(k*S+(0|this.words[N]))%E;return j?-S:S},s.prototype.modn=function(E){return this.modrn(E)},s.prototype.idivn=function(E){var j=E<0;j&&(E=-E),u(E<=67108863);for(var k=0,S=this.length-1;S>=0;S--){var N=(0|this.words[S])+67108864*k;this.words[S]=N/E|0,k=N%E}return this._strip(),j?this.ineg():this},s.prototype.divn=function(E){return this.clone().idivn(E)},s.prototype.egcd=function(E){u(E.negative===0),u(!E.isZero());var j=this,k=E.clone();j=j.negative!==0?j.umod(E):j.clone();for(var S=new s(1),N=new s(0),O=new s(0),D=new s(1),B=0;j.isEven()&&k.isEven();)j.iushrn(1),k.iushrn(1),++B;for(var Y=k.clone(),Z=j.clone();!j.isZero();){for(var ne=0,q=1;(j.words[0]&q)==0&&ne<26;++ne,q<<=1);if(ne>0)for(j.iushrn(ne);ne-- >0;)(S.isOdd()||N.isOdd())&&(S.iadd(Y),N.isub(Z)),S.iushrn(1),N.iushrn(1);for(var ee=0,z=1;(k.words[0]&z)==0&&ee<26;++ee,z<<=1);if(ee>0)for(k.iushrn(ee);ee-- >0;)(O.isOdd()||D.isOdd())&&(O.iadd(Y),D.isub(Z)),O.iushrn(1),D.iushrn(1);j.cmp(k)>=0?(j.isub(k),S.isub(O),N.isub(D)):(k.isub(j),O.isub(S),D.isub(N))}return{a:O,b:D,gcd:k.iushln(B)}},s.prototype._invmp=function(E){u(E.negative===0),u(!E.isZero());var j=this,k=E.clone();j=j.negative!==0?j.umod(E):j.clone();for(var S,N=new s(1),O=new s(0),D=k.clone();j.cmpn(1)>0&&k.cmpn(1)>0;){for(var B=0,Y=1;(j.words[0]&Y)==0&&B<26;++B,Y<<=1);if(B>0)for(j.iushrn(B);B-- >0;)N.isOdd()&&N.iadd(D),N.iushrn(1);for(var Z=0,ne=1;(k.words[0]&ne)==0&&Z<26;++Z,ne<<=1);if(Z>0)for(k.iushrn(Z);Z-- >0;)O.isOdd()&&O.iadd(D),O.iushrn(1);j.cmp(k)>=0?(j.isub(k),N.isub(O)):(k.isub(j),O.isub(N))}return(S=j.cmpn(1)===0?N:O).cmpn(0)<0&&S.iadd(E),S},s.prototype.gcd=function(E){if(this.isZero())return E.abs();if(E.isZero())return this.abs();var j=this.clone(),k=E.clone();j.negative=0,k.negative=0;for(var S=0;j.isEven()&&k.isEven();S++)j.iushrn(1),k.iushrn(1);for(;;){for(;j.isEven();)j.iushrn(1);for(;k.isEven();)k.iushrn(1);var N=j.cmp(k);if(N<0){var O=j;j=k,k=O}else if(N===0||k.cmpn(1)===0)break;j.isub(k)}return k.iushln(S)},s.prototype.invm=function(E){return this.egcd(E).a.umod(E)},s.prototype.isEven=function(){return(1&this.words[0])==0},s.prototype.isOdd=function(){return(1&this.words[0])==1},s.prototype.andln=function(E){return this.words[0]&E},s.prototype.bincn=function(E){u(typeof E=="number");var j=E%26,k=(E-j)/26,S=1<>>26,D&=67108863,this.words[O]=D}return N!==0&&(this.words[O]=N,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(E){var j,k=E<0;if(this.negative!==0&&!k)return-1;if(this.negative===0&&k)return 1;if(this._strip(),this.length>1)j=1;else{k&&(E=-E),u(E<=67108863,"Number is too big");var S=0|this.words[0];j=S===E?0:SE.length)return 1;if(this.length=0;k--){var S=0|this.words[k],N=0|E.words[k];if(S!==N){SN&&(j=1);break}}return j},s.prototype.gtn=function(E){return this.cmpn(E)===1},s.prototype.gt=function(E){return this.cmp(E)===1},s.prototype.gten=function(E){return this.cmpn(E)>=0},s.prototype.gte=function(E){return this.cmp(E)>=0},s.prototype.ltn=function(E){return this.cmpn(E)===-1},s.prototype.lt=function(E){return this.cmp(E)===-1},s.prototype.lten=function(E){return this.cmpn(E)<=0},s.prototype.lte=function(E){return this.cmp(E)<=0},s.prototype.eqn=function(E){return this.cmpn(E)===0},s.prototype.eq=function(E){return this.cmp(E)===0},s.red=function(E){return new P(E)},s.prototype.toRed=function(E){return u(!this.red,"Already a number in reduction context"),u(this.negative===0,"red works only with positives"),E.convertTo(this)._forceRed(E)},s.prototype.fromRed=function(){return u(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(E){return this.red=E,this},s.prototype.forceRed=function(E){return u(!this.red,"Already a number in reduction context"),this._forceRed(E)},s.prototype.redAdd=function(E){return u(this.red,"redAdd works only with red numbers"),this.red.add(this,E)},s.prototype.redIAdd=function(E){return u(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,E)},s.prototype.redSub=function(E){return u(this.red,"redSub works only with red numbers"),this.red.sub(this,E)},s.prototype.redISub=function(E){return u(this.red,"redISub works only with red numbers"),this.red.isub(this,E)},s.prototype.redShl=function(E){return u(this.red,"redShl works only with red numbers"),this.red.shl(this,E)},s.prototype.redMul=function(E){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,E),this.red.mul(this,E)},s.prototype.redIMul=function(E){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,E),this.red.imul(this,E)},s.prototype.redSqr=function(){return u(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return u(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return u(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return u(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return u(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(E){return u(this.red&&!E.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,E)};var U={k256:null,p224:null,p192:null,p25519:null};function F(E,j){this.name=E,this.p=new s(j,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function H(){F.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function W(){F.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function K(){F.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function $(){F.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function P(E){if(typeof E=="string"){var j=s._prime(E);this.m=j.p,this.prime=j}else u(E.gtn(1),"modulus must be greater than 1"),this.m=E,this.prime=null}function L(E){P.call(this,E),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}F.prototype._tmp=function(){var E=new s(null);return E.words=new Array(Math.ceil(this.n/13)),E},F.prototype.ireduce=function(E){var j,k=E;do this.split(k,this.tmp),j=(k=(k=this.imulK(k)).iadd(this.tmp)).bitLength();while(j>this.n);var S=j0?k.isub(this.p):k.strip!==void 0?k.strip():k._strip(),k},F.prototype.split=function(E,j){E.iushrn(this.n,0,j)},F.prototype.imulK=function(E){return E.imul(this.k)},c(H,F),H.prototype.split=function(E,j){for(var k=Math.min(E.length,9),S=0;S>>22,N=O}N>>>=22,E.words[S-10]=N,N===0&&E.length>10?E.length-=10:E.length-=9},H.prototype.imulK=function(E){E.words[E.length]=0,E.words[E.length+1]=0,E.length+=2;for(var j=0,k=0;k>>=26,E.words[k]=N,j=S}return j!==0&&(E.words[E.length++]=j),E},s._prime=function(E){if(U[E])return U[E];var j;if(E==="k256")j=new H;else if(E==="p224")j=new W;else if(E==="p192")j=new K;else{if(E!=="p25519")throw new Error("Unknown prime "+E);j=new $}return U[E]=j,j},P.prototype._verify1=function(E){u(E.negative===0,"red works only with positives"),u(E.red,"red works only with red numbers")},P.prototype._verify2=function(E,j){u((E.negative|j.negative)==0,"red works only with positives"),u(E.red&&E.red===j.red,"red works only with red numbers")},P.prototype.imod=function(E){return this.prime?this.prime.ireduce(E)._forceRed(this):(p(E,E.umod(this.m)._forceRed(this)),E)},P.prototype.neg=function(E){return E.isZero()?E.clone():this.m.sub(E)._forceRed(this)},P.prototype.add=function(E,j){this._verify2(E,j);var k=E.add(j);return k.cmp(this.m)>=0&&k.isub(this.m),k._forceRed(this)},P.prototype.iadd=function(E,j){this._verify2(E,j);var k=E.iadd(j);return k.cmp(this.m)>=0&&k.isub(this.m),k},P.prototype.sub=function(E,j){this._verify2(E,j);var k=E.sub(j);return k.cmpn(0)<0&&k.iadd(this.m),k._forceRed(this)},P.prototype.isub=function(E,j){this._verify2(E,j);var k=E.isub(j);return k.cmpn(0)<0&&k.iadd(this.m),k},P.prototype.shl=function(E,j){return this._verify1(E),this.imod(E.ushln(j))},P.prototype.imul=function(E,j){return this._verify2(E,j),this.imod(E.imul(j))},P.prototype.mul=function(E,j){return this._verify2(E,j),this.imod(E.mul(j))},P.prototype.isqr=function(E){return this.imul(E,E.clone())},P.prototype.sqr=function(E){return this.mul(E,E)},P.prototype.sqrt=function(E){if(E.isZero())return E.clone();var j=this.m.andln(3);if(u(j%2==1),j===3){var k=this.m.add(new s(1)).iushrn(2);return this.pow(E,k)}for(var S=this.m.subn(1),N=0;!S.isZero()&&S.andln(1)===0;)N++,S.iushrn(1);u(!S.isZero());var O=new s(1).toRed(this),D=O.redNeg(),B=this.m.subn(1).iushrn(1),Y=this.m.bitLength();for(Y=new s(2*Y*Y).toRed(this);this.pow(Y,B).cmp(D)!==0;)Y.redIAdd(D);for(var Z=this.pow(Y,S),ne=this.pow(E,S.addn(1).iushrn(1)),q=this.pow(E,S),ee=N;q.cmp(O)!==0;){for(var z=q,I=0;z.cmp(O)!==0;I++)z=z.redSqr();u(I=0;S--){for(var Y=j.words[S],Z=B-1;Z>=0;Z--){var ne=Y>>Z&1;N!==k[0]&&(N=this.sqr(N)),ne!==0||O!==0?(O<<=1,O|=ne,(++D===4||S===0&&Z===0)&&(N=this.mul(N,k[O]),D=0,O=0)):D=0}B=26}return N},P.prototype.convertTo=function(E){var j=E.umod(this.m);return j===E?j.clone():j},P.prototype.convertFrom=function(E){var j=E.clone();return j.red=null,j},s.mont=function(E){return new L(E)},c(L,P),L.prototype.convertTo=function(E){return this.imod(E.ushln(this.shift))},L.prototype.convertFrom=function(E){var j=this.imod(E.mul(this.rinv));return j.red=null,j},L.prototype.imul=function(E,j){if(E.isZero()||j.isZero())return E.words[0]=0,E.length=1,E;var k=E.imul(j),S=k.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),N=k.isub(S).iushrn(this.shift),O=N;return N.cmp(this.m)>=0?O=N.isub(this.m):N.cmpn(0)<0&&(O=N.iadd(this.m)),O._forceRed(this)},L.prototype.mul=function(E,j){if(E.isZero()||j.isZero())return new s(0)._forceRed(this);var k=E.mul(j),S=k.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),N=k.isub(S).iushrn(this.shift),O=N;return N.cmp(this.m)>=0?O=N.isub(this.m):N.cmpn(0)<0&&(O=N.iadd(this.m)),O._forceRed(this)},L.prototype.invm=function(E){return this.imod(E._invmp(this.m).mul(this.r2))._forceRed(this)}})(n===void 0||n)},{buffer:188}],187:[function(t,n,l){var i;function o(c){this.rand=c}if(n.exports=function(c){return i||(i=new o(null)),i.generate(c)},n.exports.Rand=o,o.prototype.generate=function(c){return this._rand(c)},o.prototype._rand=function(c){if(this.rand.getBytes)return this.rand.getBytes(c);for(var s=new Uint8Array(c),d=0;d>>24]^T[W>>>16&255]^U[K>>>8&255]^F[255&$]^m[P++],v=M[W>>>24]^T[K>>>16&255]^U[$>>>8&255]^F[255&H]^m[P++],_=M[K>>>24]^T[$>>>16&255]^U[H>>>8&255]^F[255&W]^m[P++],C=M[$>>>24]^T[H>>>16&255]^U[W>>>8&255]^F[255&K]^m[P++],H=y,W=v,K=_,$=C;return y=(x[H>>>24]<<24|x[W>>>16&255]<<16|x[K>>>8&255]<<8|x[255&$])^m[P++],v=(x[W>>>24]<<24|x[K>>>16&255]<<16|x[$>>>8&255]<<8|x[255&H])^m[P++],_=(x[K>>>24]<<24|x[$>>>16&255]<<16|x[H>>>8&255]<<8|x[255&W])^m[P++],C=(x[$>>>24]<<24|x[H>>>16&255]<<16|x[W>>>8&255]<<8|x[255&K])^m[P++],[y>>>=0,v>>>=0,_>>>=0,C>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],d=(function(){for(var h=new Array(256),m=0;m<256;m++)h[m]=m<128?m<<1:m<<1^283;for(var p=[],x=[],g=[[],[],[],[]],y=[[],[],[],[]],v=0,_=0,C=0;C<256;++C){var M=_^_<<1^_<<2^_<<3^_<<4;M=M>>>8^255&M^99,p[v]=M,x[M]=v;var T=h[v],U=h[T],F=h[U],H=257*h[M]^16843008*M;g[0][v]=H<<24|H>>>8,g[1][v]=H<<16|H>>>16,g[2][v]=H<<8|H>>>24,g[3][v]=H,H=16843009*F^65537*U^257*T^16843008*v,y[0][M]=H<<24|H>>>8,y[1][M]=H<<16|H>>>16,y[2][M]=H<<8|H>>>24,y[3][M]=H,v===0?v=_=1:(v=T^h[h[h[F^T]]],_^=h[h[_]])}return{SBOX:p,INV_SBOX:x,SUB_MIX:g,INV_SUB_MIX:y}})();function f(h){this._key=o(h),this._reset()}f.blockSize=16,f.keySize=32,f.prototype.blockSize=f.blockSize,f.prototype.keySize=f.keySize,f.prototype._reset=function(){for(var h=this._key,m=h.length,p=m+6,x=4*(p+1),g=[],y=0;y>>24,v=d.SBOX[v>>>24]<<24|d.SBOX[v>>>16&255]<<16|d.SBOX[v>>>8&255]<<8|d.SBOX[255&v],v^=s[y/m|0]<<24):m>6&&y%m==4&&(v=d.SBOX[v>>>24]<<24|d.SBOX[v>>>16&255]<<16|d.SBOX[v>>>8&255]<<8|d.SBOX[255&v]),g[y]=g[y-m]^v}for(var _=[],C=0;C>>24]]^d.INV_SUB_MIX[1][d.SBOX[T>>>16&255]]^d.INV_SUB_MIX[2][d.SBOX[T>>>8&255]]^d.INV_SUB_MIX[3][d.SBOX[255&T]]}this._nRounds=p,this._keySchedule=g,this._invKeySchedule=_},f.prototype.encryptBlockRaw=function(h){return c(h=o(h),this._keySchedule,d.SUB_MIX,d.SBOX,this._nRounds)},f.prototype.encryptBlock=function(h){var m=this.encryptBlockRaw(h),p=i.allocUnsafe(16);return p.writeUInt32BE(m[0],0),p.writeUInt32BE(m[1],4),p.writeUInt32BE(m[2],8),p.writeUInt32BE(m[3],12),p},f.prototype.decryptBlock=function(h){var m=(h=o(h))[1];h[1]=h[3],h[3]=m;var p=c(h,this._invKeySchedule,d.INV_SUB_MIX,d.INV_SBOX,this._nRounds),x=i.allocUnsafe(16);return x.writeUInt32BE(p[0],0),x.writeUInt32BE(p[3],4),x.writeUInt32BE(p[2],8),x.writeUInt32BE(p[1],12),x},f.prototype.scrub=function(){u(this._keySchedule),u(this._invKeySchedule),u(this._key)},n.exports.AES=f},{"safe-buffer":494}],190:[function(t,n,l){var i=t("./aes"),o=t("safe-buffer").Buffer,u=t("cipher-base"),c=t("inherits"),s=t("./ghash"),d=t("buffer-xor"),f=t("./incr32");function h(m,p,x,g){u.call(this);var y=o.alloc(4,0);this._cipher=new i.AES(p);var v=this._cipher.encryptBlock(y);this._ghash=new s(v),x=(function(_,C,M){if(C.length===12)return _._finID=o.concat([C,o.from([0,0,0,1])]),o.concat([C,o.from([0,0,0,2])]);var T=new s(M),U=C.length,F=U%16;T.update(C),F&&(F=16-F,T.update(o.alloc(F,0))),T.update(o.alloc(8,0));var H=8*U,W=o.alloc(8);W.writeUIntBE(H,0,8),T.update(W),_._finID=T.state;var K=o.from(_._finID);return f(K),K})(this,x,v),this._prev=o.from(x),this._cache=o.allocUnsafe(0),this._secCache=o.allocUnsafe(0),this._decrypt=g,this._alen=0,this._len=0,this._mode=m,this._authTag=null,this._called=!1}c(h,u),h.prototype._update=function(m){if(!this._called&&this._alen){var p=16-this._alen%16;p<16&&(p=o.alloc(p,0),this._ghash.update(p))}this._called=!0;var x=this._mode.encrypt(this,m);return this._decrypt?this._ghash.update(m):this._ghash.update(x),this._len+=m.length,x},h.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var m=d(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&(function(p,x){var g=0;p.length!==x.length&&g++;for(var y=Math.min(p.length,x.length),v=0;v16)throw new Error("unable to decrypt data");for(var v=-1;++v16)return g=this.cache.slice(0,16),this.cache=this.cache.slice(16),g}else if(this.cache.length>=16)return g=this.cache.slice(0,16),this.cache=this.cache.slice(16),g;return null},m.prototype.flush=function(){if(this.cache.length)return this.cache},l.createDecipher=function(x,g){var y=u[x.toLowerCase()];if(!y)throw new TypeError("invalid suite type");var v=f(g,!1,y.key,y.iv);return p(x,v.key,v.iv)},l.createDecipheriv=p},{"./aes":189,"./authCipher":190,"./modes":202,"./streamCipher":205,"cipher-base":221,evp_bytestokey:423,inherits:440,"safe-buffer":494}],193:[function(t,n,l){var i=t("./modes"),o=t("./authCipher"),u=t("safe-buffer").Buffer,c=t("./streamCipher"),s=t("cipher-base"),d=t("./aes"),f=t("evp_bytestokey");function h(g,y,v){s.call(this),this._cache=new p,this._cipher=new d.AES(y),this._prev=u.from(v),this._mode=g,this._autopadding=!0}t("inherits")(h,s),h.prototype._update=function(g){var y,v;this._cache.add(g);for(var _=[];y=this._cache.get();)v=this._mode.encrypt(this,y),_.push(v);return u.concat(_)};var m=u.alloc(16,16);function p(){this.cache=u.allocUnsafe(0)}function x(g,y,v){var _=i[g.toLowerCase()];if(!_)throw new TypeError("invalid suite type");if(typeof y=="string"&&(y=u.from(y)),y.length!==_.key/8)throw new TypeError("invalid key length "+y.length);if(typeof v=="string"&&(v=u.from(v)),_.mode!=="GCM"&&v.length!==_.iv)throw new TypeError("invalid iv length "+v.length);return _.type==="stream"?new c(_.module,y,v):_.type==="auth"?new o(_.module,y,v):new h(_.module,y,v)}h.prototype._final=function(){var g=this._cache.flush();if(this._autopadding)return g=this._mode.encrypt(this,g),this._cipher.scrub(),g;if(!g.equals(m))throw this._cipher.scrub(),new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(g){return this._autopadding=!!g,this},p.prototype.add=function(g){this.cache=u.concat([this.cache,g])},p.prototype.get=function(){if(this.cache.length>15){var g=this.cache.slice(0,16);return this.cache=this.cache.slice(16),g}return null},p.prototype.flush=function(){for(var g=16-this.cache.length,y=u.allocUnsafe(g),v=-1;++v>>0,0),d.writeUInt32BE(s[1]>>>0,4),d.writeUInt32BE(s[2]>>>0,8),d.writeUInt32BE(s[3]>>>0,12),d}function c(s){this.h=s,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}c.prototype.ghash=function(s){for(var d=-1;++d0;d--)h[d]=h[d]>>>1|(1&h[d-1])<<31;h[0]=h[0]>>>1,f&&(h[0]=h[0]^225<<24)}this.state=u(m)},c.prototype.update=function(s){var d;for(this.cache=i.concat([this.cache,s]);this.cache.length>=16;)d=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(d)},c.prototype.final=function(s,d){return this.cache.length&&this.ghash(i.concat([this.cache,o],16)),this.ghash(u([0,s,0,d])),this.state},n.exports=c},{"safe-buffer":494}],195:[function(t,n,l){n.exports=function(i){for(var o,u=i.length;u--;){if((o=i.readUInt8(u))!==255){o++,i.writeUInt8(o,u);break}i.writeUInt8(0,u)}}},{}],196:[function(t,n,l){var i=t("buffer-xor");l.encrypt=function(o,u){var c=i(u,o._prev);return o._prev=o._cipher.encryptBlock(c),o._prev},l.decrypt=function(o,u){var c=o._prev;o._prev=u;var s=o._cipher.decryptBlock(u);return i(s,c)}},{"buffer-xor":219}],197:[function(t,n,l){var i=t("safe-buffer").Buffer,o=t("buffer-xor");function u(c,s,d){var f=s.length,h=o(s,c._cache);return c._cache=c._cache.slice(f),c._prev=i.concat([c._prev,d?s:h]),h}l.encrypt=function(c,s,d){for(var f,h=i.allocUnsafe(0);s.length;){if(c._cache.length===0&&(c._cache=c._cipher.encryptBlock(c._prev),c._prev=i.allocUnsafe(0)),!(c._cache.length<=s.length)){h=i.concat([h,u(c,s,d)]);break}f=c._cache.length,h=i.concat([h,u(c,s.slice(0,f),d)]),s=s.slice(f)}return h}},{"buffer-xor":219,"safe-buffer":494}],198:[function(t,n,l){var i=t("safe-buffer").Buffer;function o(c,s,d){for(var f,h,m=-1,p=0;++m<8;)f=s&1<<7-m?128:0,p+=(128&(h=c._cipher.encryptBlock(c._prev)[0]^f))>>m%8,c._prev=u(c._prev,d?f:h);return p}function u(c,s){var d=c.length,f=-1,h=i.allocUnsafe(c.length);for(c=i.concat([c,i.from([s])]);++f>7;return h}l.encrypt=function(c,s,d){for(var f=s.length,h=i.allocUnsafe(f),m=-1;++m=0||!f.umod(d.prime1)||!f.umod(d.prime2));return f}function s(d,f){var h=(function(U){var F=c(U);return{blinder:F.toRed(o.mont(U.modulus)).redPow(new o(U.publicExponent)).fromRed(),unblinder:F.invm(U.modulus)}})(f),m=f.modulus.byteLength(),p=new o(d).mul(h.blinder).umod(f.modulus),x=p.toRed(o.mont(f.prime1)),g=p.toRed(o.mont(f.prime2)),y=f.coefficient,v=f.prime1,_=f.prime2,C=x.redPow(f.exponent1).fromRed(),M=g.redPow(f.exponent2).fromRed(),T=C.isub(M).imul(y).umod(v).imul(_);return M.iadd(T).imul(h.unblinder).umod(f.modulus).toArrayLike(i,"be",m)}s.getr=c,n.exports=s}).call(this)}).call(this,t("buffer").Buffer)},{"bn.js":186,buffer:220,randombytes:475}],210:[function(t,n,l){n.exports=t("./browser/algorithms.json")},{"./browser/algorithms.json":211}],211:[function(t,n,l){n.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],212:[function(t,n,l){n.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],213:[function(t,n,l){var i=t("safe-buffer").Buffer,o=t("create-hash"),u=t("readable-stream"),c=t("inherits"),s=t("./sign"),d=t("./verify"),f=t("./algorithms.json");function h(g){u.Writable.call(this);var y=f[g];if(!y)throw new Error("Unknown message digest");this._hashType=y.hash,this._hash=o(y.hash),this._tag=y.id,this._signType=y.sign}function m(g){u.Writable.call(this);var y=f[g];if(!y)throw new Error("Unknown message digest");this._hash=o(y.hash),this._tag=y.id,this._signType=y.sign}function p(g){return new h(g)}function x(g){return new m(g)}Object.keys(f).forEach((function(g){f[g].id=i.from(f[g].id,"hex"),f[g.toLowerCase()]=f[g]})),c(h,u.Writable),h.prototype._write=function(g,y,v){this._hash.update(g),v()},h.prototype.update=function(g,y){return typeof g=="string"&&(g=i.from(g,y)),this._hash.update(g),this},h.prototype.sign=function(g,y){this.end();var v=this._hash.digest(),_=s(v,g,this._hashType,this._signType,this._tag);return y?_.toString(y):_},c(m,u.Writable),m.prototype._write=function(g,y,v){this._hash.update(g),v()},m.prototype.update=function(g,y){return typeof g=="string"&&(g=i.from(g,y)),this._hash.update(g),this},m.prototype.verify=function(g,y,v){typeof y=="string"&&(y=i.from(y,v)),this.end();var _=this._hash.digest();return d(y,_,g,this._signType,this._tag)},n.exports={Sign:p,Verify:x,createSign:p,createVerify:x}},{"./algorithms.json":211,"./sign":214,"./verify":215,"create-hash":386,inherits:440,"readable-stream":491,"safe-buffer":494}],214:[function(t,n,l){var i=t("safe-buffer").Buffer,o=t("create-hmac"),u=t("browserify-rsa"),c=t("elliptic").ec,s=t("bn.js"),d=t("parse-asn1"),f=t("./curves.json");function h(g,y,v,_){if((g=i.from(g.toArray())).length0&&v.ishrn(_),v}function p(g,y,v){var _,C;do{for(_=i.alloc(0);8*_.length=h)throw new Error("invalid sig")}n.exports=function(f,h,m,p,x){var g=c(m);if(g.type==="ec"){if(p!=="ecdsa"&&p!=="ecdsa/rsa")throw new Error("wrong public key type");return(function(U,F,H){var W=s[H.data.algorithm.curve.join(".")];if(!W)throw new Error("unknown curve "+H.data.algorithm.curve.join("."));var K=new u(W),$=H.data.subjectPrivateKey.data;return K.verify(F,U,$)})(f,h,g)}if(g.type==="dsa"){if(p!=="dsa")throw new Error("wrong public key type");return(function(U,F,H){var W=H.data.p,K=H.data.q,$=H.data.g,P=H.data.pub_key,L=c.signature.decode(U,"der"),E=L.s,j=L.r;d(E,K),d(j,K);var k=o.mont(W),S=E.invm(K);return $.toRed(k).redPow(new o(F).mul(S).mod(K)).fromRed().mul(P.toRed(k).redPow(j.mul(S).mod(K)).fromRed()).mod(W).mod(K).cmp(j)===0})(f,h,g)}if(p!=="rsa"&&p!=="ecdsa/rsa")throw new Error("wrong public key type");h=i.concat([x,h]);for(var y=g.modulus.byteLength(),v=[1],_=0;h.length+v.length+2>5==6?2:g>>4==14?3:g>>3==30?4:g>>6==2?-1:-2}function s(g){var y=this.lastTotal-this.lastNeed,v=(function(_,C,M){if((192&C[0])!=128)return _.lastNeed=0,"�";if(_.lastNeed>1&&C.length>1){if((192&C[1])!=128)return _.lastNeed=1,"�";if(_.lastNeed>2&&C.length>2&&(192&C[2])!=128)return _.lastNeed=2,"�"}})(this,g);return v!==void 0?v:this.lastNeed<=g.length?(g.copy(this.lastChar,y,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(g.copy(this.lastChar,y,0,g.length),void(this.lastNeed-=g.length))}function d(g,y){if((g.length-y)%2==0){var v=g.toString("utf16le",y);if(v){var _=v.charCodeAt(v.length-1);if(_>=55296&&_<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1],v.slice(0,-1)}return v}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=g[g.length-1],g.toString("utf16le",y,g.length-1)}function f(g){var y=g&&g.length?this.write(g):"";if(this.lastNeed){var v=this.lastTotal-this.lastNeed;return y+this.lastChar.toString("utf16le",0,v)}return y}function h(g,y){var v=(g.length-y)%3;return v===0?g.toString("base64",y):(this.lastNeed=3-v,this.lastTotal=3,v===1?this.lastChar[0]=g[g.length-1]:(this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1]),g.toString("base64",y,g.length-v))}function m(g){var y=g&&g.length?this.write(g):"";return this.lastNeed?y+this.lastChar.toString("base64",0,3-this.lastNeed):y}function p(g){return g.toString(this.encoding)}function x(g){return g&&g.length?this.write(g):""}l.StringDecoder=u,u.prototype.write=function(g){if(g.length===0)return"";var y,v;if(this.lastNeed){if((y=this.fillLast(g))===void 0)return"";v=this.lastNeed,this.lastNeed=0}else v=0;return v=0?(F>0&&(C.lastNeed=F-1),F):--U=0?(F>0&&(C.lastNeed=F-2),F):--U=0?(F>0&&(F===2?F=0:C.lastNeed=F-3),F):0})(this,g,y);if(!this.lastNeed)return g.toString("utf8",y);this.lastTotal=v;var _=g.length-(v-this.lastNeed);return g.copy(this.lastChar,0,_),g.toString("utf8",y,_)},u.prototype.fillLast=function(g){if(this.lastNeed<=g.length)return g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,g.length),this.lastNeed-=g.length}},{"safe-buffer":217}],219:[function(t,n,l){(function(i){(function(){n.exports=function(o,u){for(var c=Math.min(o.length,u.length),s=new i(c),d=0;d2147483647)throw new RangeError('The value "'+z+'" is invalid for option "size"');var I=new Uint8Array(z);return I.__proto__=s.prototype,I}function s(z,I,X){if(typeof z=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(z)}return d(z,I,X)}function d(z,I,X){if(typeof z=="string")return(function(Q,re){if(typeof re=="string"&&re!==""||(re="utf8"),!s.isEncoding(re))throw new TypeError("Unknown encoding: "+re);var ue=0|x(Q,re),ae=c(ue),ie=ae.write(Q,re);return ie!==ue&&(ae=ae.slice(0,ie)),ae})(z,I);if(ArrayBuffer.isView(z))return m(z);if(z==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z);if(q(z,ArrayBuffer)||z&&q(z.buffer,ArrayBuffer))return(function(Q,re,ue){if(re<0||Q.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|z}function x(z,I){if(s.isBuffer(z))return z.length;if(ArrayBuffer.isView(z)||q(z,ArrayBuffer))return z.byteLength;if(typeof z!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof z);var X=z.length,te=arguments.length>2&&arguments[2]===!0;if(!te&&X===0)return 0;for(var se=!1;;)switch(I){case"ascii":case"latin1":case"binary":return X;case"utf8":case"utf-8":return Y(z).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*X;case"hex":return X>>>1;case"base64":return Z(z).length;default:if(se)return te?-1:Y(z).length;I=(""+I).toLowerCase(),se=!0}}function g(z,I,X){var te=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((X===void 0||X>this.length)&&(X=this.length),X<=0)||(X>>>=0)<=(I>>>=0))return"";for(z||(z="utf8");;)switch(z){case"hex":return L(this,I,X);case"utf8":case"utf-8":return K(this,I,X);case"ascii":return $(this,I,X);case"latin1":case"binary":return P(this,I,X);case"base64":return W(this,I,X);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,I,X);default:if(te)throw new TypeError("Unknown encoding: "+z);z=(z+"").toLowerCase(),te=!0}}function y(z,I,X){var te=z[I];z[I]=z[X],z[X]=te}function v(z,I,X,te,se){if(z.length===0)return-1;if(typeof X=="string"?(te=X,X=0):X>2147483647?X=2147483647:X<-2147483648&&(X=-2147483648),ee(X=+X)&&(X=se?0:z.length-1),X<0&&(X=z.length+X),X>=z.length){if(se)return-1;X=z.length-1}else if(X<0){if(!se)return-1;X=0}if(typeof I=="string"&&(I=s.from(I,te)),s.isBuffer(I))return I.length===0?-1:_(z,I,X,te,se);if(typeof I=="number")return I&=255,typeof Uint8Array.prototype.indexOf=="function"?se?Uint8Array.prototype.indexOf.call(z,I,X):Uint8Array.prototype.lastIndexOf.call(z,I,X):_(z,[I],X,te,se);throw new TypeError("val must be string, number or Buffer")}function _(z,I,X,te,se){var Q,re=1,ue=z.length,ae=I.length;if(te!==void 0&&((te=String(te).toLowerCase())==="ucs2"||te==="ucs-2"||te==="utf16le"||te==="utf-16le")){if(z.length<2||I.length<2)return-1;re=2,ue/=2,ae/=2,X/=2}function ie(ge,ye){return re===1?ge[ye]:ge.readUInt16BE(ye*re)}if(se){var fe=-1;for(Q=X;Que&&(X=ue-ae),Q=X;Q>=0;Q--){for(var he=!0,de=0;dese&&(te=se):te=se;var Q=I.length;te>Q/2&&(te=Q/2);for(var re=0;re>8,ae=re%256,ie.push(ae),ie.push(ue);return ie})(I,z.length-X),z,X,te)}function W(z,I,X){return I===0&&X===z.length?o.fromByteArray(z):o.fromByteArray(z.slice(I,X))}function K(z,I,X){X=Math.min(z.length,X);for(var te=[],se=I;se239?4:ie>223?3:ie>191?2:1;if(se+he<=X)switch(he){case 1:ie<128&&(fe=ie);break;case 2:(192&(Q=z[se+1]))==128&&(ae=(31&ie)<<6|63&Q)>127&&(fe=ae);break;case 3:Q=z[se+1],re=z[se+2],(192&Q)==128&&(192&re)==128&&(ae=(15&ie)<<12|(63&Q)<<6|63&re)>2047&&(ae<55296||ae>57343)&&(fe=ae);break;case 4:Q=z[se+1],re=z[se+2],ue=z[se+3],(192&Q)==128&&(192&re)==128&&(192&ue)==128&&(ae=(15&ie)<<18|(63&Q)<<12|(63&re)<<6|63&ue)>65535&&ae<1114112&&(fe=ae)}fe===null?(fe=65533,he=1):fe>65535&&(fe-=65536,te.push(fe>>>10&1023|55296),fe=56320|1023&fe),te.push(fe),se+=he}return(function(de){var ge=de.length;if(ge<=4096)return String.fromCharCode.apply(String,de);for(var ye="",xe=0;xe"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),typeof Symbol<"u"&&Symbol.species!=null&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),s.poolSize=8192,s.from=function(z,I,X){return d(z,I,X)},s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,s.alloc=function(z,I,X){return(function(te,se,Q){return f(te),te<=0?c(te):se!==void 0?typeof Q=="string"?c(te).fill(se,Q):c(te).fill(se):c(te)})(z,I,X)},s.allocUnsafe=function(z){return h(z)},s.allocUnsafeSlow=function(z){return h(z)},s.isBuffer=function(z){return z!=null&&z._isBuffer===!0&&z!==s.prototype},s.compare=function(z,I){if(q(z,Uint8Array)&&(z=s.from(z,z.offset,z.byteLength)),q(I,Uint8Array)&&(I=s.from(I,I.offset,I.byteLength)),!s.isBuffer(z)||!s.isBuffer(I))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(z===I)return 0;for(var X=z.length,te=I.length,se=0,Q=Math.min(X,te);seI&&(z+=" ... "),""},s.prototype.compare=function(z,I,X,te,se){if(q(z,Uint8Array)&&(z=s.from(z,z.offset,z.byteLength)),!s.isBuffer(z))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof z);if(I===void 0&&(I=0),X===void 0&&(X=z?z.length:0),te===void 0&&(te=0),se===void 0&&(se=this.length),I<0||X>z.length||te<0||se>this.length)throw new RangeError("out of range index");if(te>=se&&I>=X)return 0;if(te>=se)return-1;if(I>=X)return 1;if(this===z)return 0;for(var Q=(se>>>=0)-(te>>>=0),re=(X>>>=0)-(I>>>=0),ue=Math.min(Q,re),ae=this.slice(te,se),ie=z.slice(I,X),fe=0;fe>>=0,isFinite(X)?(X>>>=0,te===void 0&&(te="utf8")):(te=X,X=void 0)}var se=this.length-I;if((X===void 0||X>se)&&(X=se),z.length>0&&(X<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");te||(te="utf8");for(var Q=!1;;)switch(te){case"hex":return C(this,z,I,X);case"utf8":case"utf-8":return M(this,z,I,X);case"ascii":return T(this,z,I,X);case"latin1":case"binary":return U(this,z,I,X);case"base64":return F(this,z,I,X);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,z,I,X);default:if(Q)throw new TypeError("Unknown encoding: "+te);te=(""+te).toLowerCase(),Q=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(z,I,X){var te="";X=Math.min(z.length,X);for(var se=I;sete)&&(X=te);for(var se="",Q=I;QX)throw new RangeError("Trying to access beyond buffer length")}function k(z,I,X,te,se,Q){if(!s.isBuffer(z))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>se||Iz.length)throw new RangeError("Index out of range")}function S(z,I,X,te,se,Q){if(X+te>z.length)throw new RangeError("Index out of range");if(X<0)throw new RangeError("Index out of range")}function N(z,I,X,te,se){return I=+I,X>>>=0,se||S(z,0,X,4),u.write(z,I,X,te,23,4),X+4}function O(z,I,X,te,se){return I=+I,X>>>=0,se||S(z,0,X,8),u.write(z,I,X,te,52,8),X+8}s.prototype.slice=function(z,I){var X=this.length;(z=~~z)<0?(z+=X)<0&&(z=0):z>X&&(z=X),(I=I===void 0?X:~~I)<0?(I+=X)<0&&(I=0):I>X&&(I=X),I>>=0,I>>>=0,X||j(z,I,this.length);for(var te=this[z],se=1,Q=0;++Q>>=0,I>>>=0,X||j(z,I,this.length);for(var te=this[z+--I],se=1;I>0&&(se*=256);)te+=this[z+--I]*se;return te},s.prototype.readUInt8=function(z,I){return z>>>=0,I||j(z,1,this.length),this[z]},s.prototype.readUInt16LE=function(z,I){return z>>>=0,I||j(z,2,this.length),this[z]|this[z+1]<<8},s.prototype.readUInt16BE=function(z,I){return z>>>=0,I||j(z,2,this.length),this[z]<<8|this[z+1]},s.prototype.readUInt32LE=function(z,I){return z>>>=0,I||j(z,4,this.length),(this[z]|this[z+1]<<8|this[z+2]<<16)+16777216*this[z+3]},s.prototype.readUInt32BE=function(z,I){return z>>>=0,I||j(z,4,this.length),16777216*this[z]+(this[z+1]<<16|this[z+2]<<8|this[z+3])},s.prototype.readIntLE=function(z,I,X){z>>>=0,I>>>=0,X||j(z,I,this.length);for(var te=this[z],se=1,Q=0;++Q=(se*=128)&&(te-=Math.pow(2,8*I)),te},s.prototype.readIntBE=function(z,I,X){z>>>=0,I>>>=0,X||j(z,I,this.length);for(var te=I,se=1,Q=this[z+--te];te>0&&(se*=256);)Q+=this[z+--te]*se;return Q>=(se*=128)&&(Q-=Math.pow(2,8*I)),Q},s.prototype.readInt8=function(z,I){return z>>>=0,I||j(z,1,this.length),128&this[z]?-1*(255-this[z]+1):this[z]},s.prototype.readInt16LE=function(z,I){z>>>=0,I||j(z,2,this.length);var X=this[z]|this[z+1]<<8;return 32768&X?4294901760|X:X},s.prototype.readInt16BE=function(z,I){z>>>=0,I||j(z,2,this.length);var X=this[z+1]|this[z]<<8;return 32768&X?4294901760|X:X},s.prototype.readInt32LE=function(z,I){return z>>>=0,I||j(z,4,this.length),this[z]|this[z+1]<<8|this[z+2]<<16|this[z+3]<<24},s.prototype.readInt32BE=function(z,I){return z>>>=0,I||j(z,4,this.length),this[z]<<24|this[z+1]<<16|this[z+2]<<8|this[z+3]},s.prototype.readFloatLE=function(z,I){return z>>>=0,I||j(z,4,this.length),u.read(this,z,!0,23,4)},s.prototype.readFloatBE=function(z,I){return z>>>=0,I||j(z,4,this.length),u.read(this,z,!1,23,4)},s.prototype.readDoubleLE=function(z,I){return z>>>=0,I||j(z,8,this.length),u.read(this,z,!0,52,8)},s.prototype.readDoubleBE=function(z,I){return z>>>=0,I||j(z,8,this.length),u.read(this,z,!1,52,8)},s.prototype.writeUIntLE=function(z,I,X,te){z=+z,I>>>=0,X>>>=0,te||k(this,z,I,X,Math.pow(2,8*X)-1,0);var se=1,Q=0;for(this[I]=255&z;++Q>>=0,X>>>=0,te||k(this,z,I,X,Math.pow(2,8*X)-1,0);var se=X-1,Q=1;for(this[I+se]=255&z;--se>=0&&(Q*=256);)this[I+se]=z/Q&255;return I+X},s.prototype.writeUInt8=function(z,I,X){return z=+z,I>>>=0,X||k(this,z,I,1,255,0),this[I]=255&z,I+1},s.prototype.writeUInt16LE=function(z,I,X){return z=+z,I>>>=0,X||k(this,z,I,2,65535,0),this[I]=255&z,this[I+1]=z>>>8,I+2},s.prototype.writeUInt16BE=function(z,I,X){return z=+z,I>>>=0,X||k(this,z,I,2,65535,0),this[I]=z>>>8,this[I+1]=255&z,I+2},s.prototype.writeUInt32LE=function(z,I,X){return z=+z,I>>>=0,X||k(this,z,I,4,4294967295,0),this[I+3]=z>>>24,this[I+2]=z>>>16,this[I+1]=z>>>8,this[I]=255&z,I+4},s.prototype.writeUInt32BE=function(z,I,X){return z=+z,I>>>=0,X||k(this,z,I,4,4294967295,0),this[I]=z>>>24,this[I+1]=z>>>16,this[I+2]=z>>>8,this[I+3]=255&z,I+4},s.prototype.writeIntLE=function(z,I,X,te){if(z=+z,I>>>=0,!te){var se=Math.pow(2,8*X-1);k(this,z,I,X,se-1,-se)}var Q=0,re=1,ue=0;for(this[I]=255&z;++Q>0)-ue&255;return I+X},s.prototype.writeIntBE=function(z,I,X,te){if(z=+z,I>>>=0,!te){var se=Math.pow(2,8*X-1);k(this,z,I,X,se-1,-se)}var Q=X-1,re=1,ue=0;for(this[I+Q]=255&z;--Q>=0&&(re*=256);)z<0&&ue===0&&this[I+Q+1]!==0&&(ue=1),this[I+Q]=(z/re>>0)-ue&255;return I+X},s.prototype.writeInt8=function(z,I,X){return z=+z,I>>>=0,X||k(this,z,I,1,127,-128),z<0&&(z=255+z+1),this[I]=255&z,I+1},s.prototype.writeInt16LE=function(z,I,X){return z=+z,I>>>=0,X||k(this,z,I,2,32767,-32768),this[I]=255&z,this[I+1]=z>>>8,I+2},s.prototype.writeInt16BE=function(z,I,X){return z=+z,I>>>=0,X||k(this,z,I,2,32767,-32768),this[I]=z>>>8,this[I+1]=255&z,I+2},s.prototype.writeInt32LE=function(z,I,X){return z=+z,I>>>=0,X||k(this,z,I,4,2147483647,-2147483648),this[I]=255&z,this[I+1]=z>>>8,this[I+2]=z>>>16,this[I+3]=z>>>24,I+4},s.prototype.writeInt32BE=function(z,I,X){return z=+z,I>>>=0,X||k(this,z,I,4,2147483647,-2147483648),z<0&&(z=4294967295+z+1),this[I]=z>>>24,this[I+1]=z>>>16,this[I+2]=z>>>8,this[I+3]=255&z,I+4},s.prototype.writeFloatLE=function(z,I,X){return N(this,z,I,!0,X)},s.prototype.writeFloatBE=function(z,I,X){return N(this,z,I,!1,X)},s.prototype.writeDoubleLE=function(z,I,X){return O(this,z,I,!0,X)},s.prototype.writeDoubleBE=function(z,I,X){return O(this,z,I,!1,X)},s.prototype.copy=function(z,I,X,te){if(!s.isBuffer(z))throw new TypeError("argument should be a Buffer");if(X||(X=0),te||te===0||(te=this.length),I>=z.length&&(I=z.length),I||(I=0),te>0&&te=this.length)throw new RangeError("Index out of range");if(te<0)throw new RangeError("sourceEnd out of bounds");te>this.length&&(te=this.length),z.length-I=0;--Q)z[Q+I]=this[Q+X];else Uint8Array.prototype.set.call(z,this.subarray(X,te),I);return se},s.prototype.fill=function(z,I,X,te){if(typeof z=="string"){if(typeof I=="string"?(te=I,I=0,X=this.length):typeof X=="string"&&(te=X,X=this.length),te!==void 0&&typeof te!="string")throw new TypeError("encoding must be a string");if(typeof te=="string"&&!s.isEncoding(te))throw new TypeError("Unknown encoding: "+te);if(z.length===1){var se=z.charCodeAt(0);(te==="utf8"&&se<128||te==="latin1")&&(z=se)}}else typeof z=="number"&&(z&=255);if(I<0||this.length>>=0,X=X===void 0?this.length:X>>>0,z||(z=0),typeof z=="number")for(Q=I;Q55295&&X<57344){if(!se){if(X>56319){(I-=3)>-1&&Q.push(239,191,189);continue}if(re+1===te){(I-=3)>-1&&Q.push(239,191,189);continue}se=X;continue}if(X<56320){(I-=3)>-1&&Q.push(239,191,189),se=X;continue}X=65536+(se-55296<<10|X-56320)}else se&&(I-=3)>-1&&Q.push(239,191,189);if(se=null,X<128){if((I-=1)<0)break;Q.push(X)}else if(X<2048){if((I-=2)<0)break;Q.push(X>>6|192,63&X|128)}else if(X<65536){if((I-=3)<0)break;Q.push(X>>12|224,X>>6&63|128,63&X|128)}else{if(!(X<1114112))throw new Error("Invalid code point");if((I-=4)<0)break;Q.push(X>>18|240,X>>12&63|128,X>>6&63|128,63&X|128)}}return Q}function Z(z){return o.toByteArray((function(I){if((I=(I=I.split("=")[0]).trim().replace(D,"")).length<2)return"";for(;I.length%4!=0;)I+="=";return I})(z))}function ne(z,I,X,te){for(var se=0;se=I.length||se>=z.length);++se)I[se+X]=z[se];return se}function q(z,I){return z instanceof I||z!=null&&z.constructor!=null&&z.constructor.name!=null&&z.constructor.name===I.name}function ee(z){return z!=z}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":185,buffer:220,ieee754:439}],221:[function(t,n,l){var i=t("safe-buffer").Buffer,o=t("stream").Transform,u=t("string_decoder").StringDecoder;function c(s){o.call(this),this.hashMode=typeof s=="string",this.hashMode?this[s]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}t("inherits")(c,o),c.prototype.update=function(s,d,f){typeof s=="string"&&(s=i.from(s,d));var h=this._update(s);return this.hashMode?this:(f&&(h=this._toString(h,f)),h)},c.prototype.setAutoPadding=function(){},c.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},c.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},c.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},c.prototype._transform=function(s,d,f){var h;try{this.hashMode?this._update(s):this.push(this._update(s))}catch(m){h=m}finally{f(h)}},c.prototype._flush=function(s){var d;try{this.push(this.__final())}catch(f){d=f}s(d)},c.prototype._finalOrDigest=function(s){var d=this.__final()||i.alloc(0);return s&&(d=this._toString(d,s,!0)),d},c.prototype._toString=function(s,d,f){if(this._decoder||(this._decoder=new u(d),this._encoding=d),this._encoding!==d)throw new Error("can't switch encodings");var h=this._decoder.write(s);return f&&(h+=this._decoder.end()),h},n.exports=c},{inherits:440,"safe-buffer":494,stream:505,string_decoder:218}],222:[function(t,n,l){var i=t("../internals/is-callable"),o=t("../internals/try-to-string"),u=TypeError;n.exports=function(c){if(i(c))return c;throw new u(o(c)+" is not a function")}},{"../internals/is-callable":285,"../internals/try-to-string":349}],223:[function(t,n,l){var i=t("../internals/is-constructor"),o=t("../internals/try-to-string"),u=TypeError;n.exports=function(c){if(i(c))return c;throw new u(o(c)+" is not a constructor")}},{"../internals/is-constructor":286,"../internals/try-to-string":349}],224:[function(t,n,l){var i=t("../internals/is-callable"),o=String,u=TypeError;n.exports=function(c){if(typeof c=="object"||i(c))return c;throw new u("Can't set "+o(c)+" as a prototype")}},{"../internals/is-callable":285}],225:[function(t,n,l){var i=t("../internals/well-known-symbol"),o=t("../internals/object-create"),u=t("../internals/object-define-property").f,c=i("unscopables"),s=Array.prototype;s[c]===void 0&&u(s,c,{configurable:!0,value:o(null)}),n.exports=function(d){s[c][d]=!0}},{"../internals/object-create":306,"../internals/object-define-property":308,"../internals/well-known-symbol":357}],226:[function(t,n,l){var i=t("../internals/object-is-prototype-of"),o=TypeError;n.exports=function(u,c){if(i(c,u))return u;throw new o("Incorrect invocation")}},{"../internals/object-is-prototype-of":314}],227:[function(t,n,l){var i=t("../internals/is-object"),o=String,u=TypeError;n.exports=function(c){if(i(c))return c;throw new u(o(c)+" is not an object")}},{"../internals/is-object":289}],228:[function(t,n,l){var i=t("../internals/to-indexed-object"),o=t("../internals/to-absolute-index"),u=t("../internals/length-of-array-like"),c=function(s){return function(d,f,h){var m,p=i(d),x=u(p),g=o(h,x);if(s&&f!=f){for(;x>g;)if((m=p[g++])!=m)return!0}else for(;x>g;g++)if((s||g in p)&&p[g]===f)return s||g||0;return!s&&-1}};n.exports={includes:c(!0),indexOf:c(!1)}},{"../internals/length-of-array-like":299,"../internals/to-absolute-index":340,"../internals/to-indexed-object":341}],229:[function(t,n,l){var i=t("../internals/function-bind-context"),o=t("../internals/function-uncurry-this"),u=t("../internals/indexed-object"),c=t("../internals/to-object"),s=t("../internals/length-of-array-like"),d=t("../internals/array-species-create"),f=o([].push),h=function(m){var p=m===1,x=m===2,g=m===3,y=m===4,v=m===6,_=m===7,C=m===5||v;return function(M,T,U,F){for(var H,W,K=c(M),$=u(K),P=i(T,U),L=s($),E=0,j=F||d,k=p?j(M,L):x||_?j(M,0):void 0;L>E;E++)if((C||E in $)&&(W=P(H=$[E],E,K),m))if(p)k[E]=W;else if(W)switch(m){case 3:return!0;case 5:return H;case 6:return E;case 2:f(k,H)}else switch(m){case 4:return!1;case 7:f(k,H)}return v?-1:g||y?y:k}};n.exports={forEach:h(0),map:h(1),filter:h(2),some:h(3),every:h(4),find:h(5),findIndex:h(6),filterReject:h(7)}},{"../internals/array-species-create":233,"../internals/function-bind-context":262,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/length-of-array-like":299,"../internals/to-object":344}],230:[function(t,n,l){var i=t("../internals/to-absolute-index"),o=t("../internals/length-of-array-like"),u=t("../internals/create-property"),c=Array,s=Math.max;n.exports=function(d,f,h){for(var m=o(d),p=i(f,m),x=i(h===void 0?m:h,m),g=c(s(x-p,0)),y=0;p0&&i[0]<4?1:+(i[0]+i[1])),!o&&c&&(!(i=c.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=c.match(/Chrome\/(\d+)/))&&(o=+i[1]),n.exports=o},{"../internals/engine-user-agent":256,"../internals/global":274}],258:[function(t,n,l){n.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],259:[function(t,n,l){var i=t("../internals/global"),o=t("../internals/object-get-own-property-descriptor").f,u=t("../internals/create-non-enumerable-property"),c=t("../internals/define-built-in"),s=t("../internals/define-global-property"),d=t("../internals/copy-constructor-properties"),f=t("../internals/is-forced");n.exports=function(h,m){var p,x,g,y,v,_=h.target,C=h.global,M=h.stat;if(p=C?i:M?i[_]||s(_,{}):(i[_]||{}).prototype)for(x in m){if(y=m[x],g=h.dontCallGetSet?(v=o(p,x))&&v.value:p[x],!f(C?x:_+(M?".":"#")+x,h.forced)&&g!==void 0){if(typeof y==typeof g)continue;d(y,g)}(h.sham||g&&g.sham)&&u(y,"sham",!0),c(p,x,y,h)}}},{"../internals/copy-constructor-properties":237,"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/define-global-property":246,"../internals/global":274,"../internals/is-forced":287,"../internals/object-get-own-property-descriptor":309}],260:[function(t,n,l){n.exports=function(i){try{return!!i()}catch{return!0}}},{}],261:[function(t,n,l){var i=t("../internals/function-bind-native"),o=Function.prototype,u=o.apply,c=o.call;n.exports=typeof Reflect=="object"&&Reflect.apply||(i?c.bind(u):function(){return c.apply(u,arguments)})},{"../internals/function-bind-native":263}],262:[function(t,n,l){var i=t("../internals/function-uncurry-this-clause"),o=t("../internals/a-callable"),u=t("../internals/function-bind-native"),c=i(i.bind);n.exports=function(s,d){return o(s),d===void 0?s:u?c(s,d):function(){return s.apply(d,arguments)}}},{"../internals/a-callable":222,"../internals/function-bind-native":263,"../internals/function-uncurry-this-clause":267}],263:[function(t,n,l){var i=t("../internals/fails");n.exports=!i((function(){var o=(function(){}).bind();return typeof o!="function"||o.hasOwnProperty("prototype")}))},{"../internals/fails":260}],264:[function(t,n,l){var i=t("../internals/function-bind-native"),o=Function.prototype.call;n.exports=i?o.bind(o):function(){return o.apply(o,arguments)}},{"../internals/function-bind-native":263}],265:[function(t,n,l){var i=t("../internals/descriptors"),o=t("../internals/has-own-property"),u=Function.prototype,c=i&&Object.getOwnPropertyDescriptor,s=o(u,"name"),d=s&&(function(){}).name==="something",f=s&&(!i||i&&c(u,"name").configurable);n.exports={EXISTS:s,PROPER:d,CONFIGURABLE:f}},{"../internals/descriptors":247,"../internals/has-own-property":275}],266:[function(t,n,l){var i=t("../internals/function-uncurry-this"),o=t("../internals/a-callable");n.exports=function(u,c,s){try{return i(o(Object.getOwnPropertyDescriptor(u,c)[s]))}catch{}}},{"../internals/a-callable":222,"../internals/function-uncurry-this":268}],267:[function(t,n,l){var i=t("../internals/classof-raw"),o=t("../internals/function-uncurry-this");n.exports=function(u){if(i(u)==="Function")return o(u)}},{"../internals/classof-raw":235,"../internals/function-uncurry-this":268}],268:[function(t,n,l){var i=t("../internals/function-bind-native"),o=Function.prototype,u=o.call,c=i&&o.bind.bind(u,u);n.exports=i?c:function(s){return function(){return u.apply(s,arguments)}}},{"../internals/function-bind-native":263}],269:[function(t,n,l){var i=t("../internals/global"),o=t("../internals/is-callable"),u=function(c){return o(c)?c:void 0};n.exports=function(c,s){return arguments.length<2?u(i[c]):i[c]&&i[c][s]}},{"../internals/global":274,"../internals/is-callable":285}],270:[function(t,n,l){var i=t("../internals/classof"),o=t("../internals/get-method"),u=t("../internals/is-null-or-undefined"),c=t("../internals/iterators"),s=t("../internals/well-known-symbol")("iterator");n.exports=function(d){if(!u(d))return o(d,s)||o(d,"@@iterator")||c[i(d)]}},{"../internals/classof":236,"../internals/get-method":273,"../internals/is-null-or-undefined":288,"../internals/iterators":298,"../internals/well-known-symbol":357}],271:[function(t,n,l){var i=t("../internals/function-call"),o=t("../internals/a-callable"),u=t("../internals/an-object"),c=t("../internals/try-to-string"),s=t("../internals/get-iterator-method"),d=TypeError;n.exports=function(f,h){var m=arguments.length<2?s(f):h;if(o(m))return u(i(m,f));throw new d(c(f)+" is not iterable")}},{"../internals/a-callable":222,"../internals/an-object":227,"../internals/function-call":264,"../internals/get-iterator-method":270,"../internals/try-to-string":349}],272:[function(t,n,l){var i=t("../internals/function-uncurry-this"),o=t("../internals/is-array"),u=t("../internals/is-callable"),c=t("../internals/classof-raw"),s=t("../internals/to-string"),d=i([].push);n.exports=function(f){if(u(f))return f;if(o(f)){for(var h=f.length,m=[],p=0;pU;U++)if((H=N(v[U]))&&f(y,H))return H;return new g(!1)}M=h(v,T)}for(W=L?v.next:M.next;!(K=o(W,M)).done;){try{H=N(K.value)}catch(O){p(M,"throw",O)}if(typeof H=="object"&&H&&f(y,H))return H}return new g(!1)}},{"../internals/an-object":227,"../internals/function-bind-context":262,"../internals/function-call":264,"../internals/get-iterator":271,"../internals/get-iterator-method":270,"../internals/is-array-iterator-method":283,"../internals/iterator-close":294,"../internals/length-of-array-like":299,"../internals/object-is-prototype-of":314,"../internals/try-to-string":349}],294:[function(t,n,l){var i=t("../internals/function-call"),o=t("../internals/an-object"),u=t("../internals/get-method");n.exports=function(c,s,d){var f,h;o(c);try{if(!(f=u(c,"return"))){if(s==="throw")throw d;return d}f=i(f,c)}catch(m){h=!0,f=m}if(s==="throw")throw d;if(h)throw f;return o(f),d}},{"../internals/an-object":227,"../internals/function-call":264,"../internals/get-method":273}],295:[function(t,n,l){var i=t("../internals/iterators-core").IteratorPrototype,o=t("../internals/object-create"),u=t("../internals/create-property-descriptor"),c=t("../internals/set-to-string-tag"),s=t("../internals/iterators"),d=function(){return this};n.exports=function(f,h,m,p){var x=h+" Iterator";return f.prototype=o(i,{next:u(+!p,m)}),c(f,x,!1,!0),s[x]=d,f}},{"../internals/create-property-descriptor":242,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-create":306,"../internals/set-to-string-tag":331}],296:[function(t,n,l){var i=t("../internals/export"),o=t("../internals/function-call"),u=t("../internals/is-pure"),c=t("../internals/function-name"),s=t("../internals/is-callable"),d=t("../internals/iterator-create-constructor"),f=t("../internals/object-get-prototype-of"),h=t("../internals/object-set-prototype-of"),m=t("../internals/set-to-string-tag"),p=t("../internals/create-non-enumerable-property"),x=t("../internals/define-built-in"),g=t("../internals/well-known-symbol"),y=t("../internals/iterators"),v=t("../internals/iterators-core"),_=c.PROPER,C=c.CONFIGURABLE,M=v.IteratorPrototype,T=v.BUGGY_SAFARI_ITERATORS,U=g("iterator"),F=function(){return this};n.exports=function(H,W,K,$,P,L,E){d(K,W,$);var j,k,S,N=function(q){if(q===P&&Z)return Z;if(!T&&q&&q in B)return B[q];switch(q){case"keys":case"values":case"entries":return function(){return new K(this,q)}}return function(){return new K(this)}},O=W+" Iterator",D=!1,B=H.prototype,Y=B[U]||B["@@iterator"]||P&&B[P],Z=!T&&Y||N(P),ne=W==="Array"&&B.entries||Y;if(ne&&(j=f(ne.call(new H)))!==Object.prototype&&j.next&&(u||f(j)===M||(h?h(j,M):s(j[U])||x(j,U,F)),m(j,O,!0,!0),u&&(y[O]=F)),_&&P==="values"&&Y&&Y.name!=="values"&&(!u&&C?p(B,"name","values"):(D=!0,Z=function(){return o(Y,this)})),P)if(k={values:N("values"),keys:L?Z:N("keys"),entries:N("entries")},E)for(S in k)(T||D||!(S in B))&&x(B,S,k[S]);else i({target:W,proto:!0,forced:T||D},k);return u&&!E||B[U]===Z||x(B,U,Z,{name:P}),y[W]=Z,k}},{"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/export":259,"../internals/function-call":264,"../internals/function-name":265,"../internals/is-callable":285,"../internals/is-pure":290,"../internals/iterator-create-constructor":295,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-get-prototype-of":313,"../internals/object-set-prototype-of":318,"../internals/set-to-string-tag":331,"../internals/well-known-symbol":357}],297:[function(t,n,l){var i,o,u,c=t("../internals/fails"),s=t("../internals/is-callable"),d=t("../internals/is-object"),f=t("../internals/object-create"),h=t("../internals/object-get-prototype-of"),m=t("../internals/define-built-in"),p=t("../internals/well-known-symbol"),x=t("../internals/is-pure"),g=p("iterator"),y=!1;[].keys&&("next"in(u=[].keys())?(o=h(h(u)))!==Object.prototype&&(i=o):y=!0),!d(i)||c((function(){var v={};return i[g].call(v)!==v}))?i={}:x&&(i=f(i)),s(i[g])||m(i,g,(function(){return this})),n.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:y}},{"../internals/define-built-in":245,"../internals/fails":260,"../internals/is-callable":285,"../internals/is-object":289,"../internals/is-pure":290,"../internals/object-create":306,"../internals/object-get-prototype-of":313,"../internals/well-known-symbol":357}],298:[function(t,n,l){arguments[4][276][0].apply(l,arguments)},{dup:276}],299:[function(t,n,l){var i=t("../internals/to-length");n.exports=function(o){return i(o.length)}},{"../internals/to-length":343}],300:[function(t,n,l){var i=t("../internals/function-uncurry-this"),o=t("../internals/fails"),u=t("../internals/is-callable"),c=t("../internals/has-own-property"),s=t("../internals/descriptors"),d=t("../internals/function-name").CONFIGURABLE,f=t("../internals/inspect-source"),h=t("../internals/internal-state"),m=h.enforce,p=h.get,x=String,g=Object.defineProperty,y=i("".slice),v=i("".replace),_=i([].join),C=s&&!o((function(){return g((function(){}),"length",{value:8}).length!==8})),M=String(String).split("String"),T=n.exports=function(U,F,H){y(x(F),0,7)==="Symbol("&&(F="["+v(x(F),/^Symbol\(([^)]*)\)/,"$1")+"]"),H&&H.getter&&(F="get "+F),H&&H.setter&&(F="set "+F),(!c(U,"name")||d&&U.name!==F)&&(s?g(U,"name",{value:F,configurable:!0}):U.name=F),C&&H&&c(H,"arity")&&U.length!==H.arity&&g(U,"length",{value:H.arity});try{H&&c(H,"constructor")&&H.constructor?s&&g(U,"prototype",{writable:!1}):U.prototype&&(U.prototype=void 0)}catch{}var W=m(U);return c(W,"source")||(W.source=_(M,typeof F=="string"?F:"")),U};Function.prototype.toString=T((function(){return u(this)&&p(this).source||f(this)}),"toString")},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-name":265,"../internals/function-uncurry-this":268,"../internals/has-own-property":275,"../internals/inspect-source":281,"../internals/internal-state":282,"../internals/is-callable":285}],301:[function(t,n,l){var i=Math.ceil,o=Math.floor;n.exports=Math.trunc||function(u){var c=+u;return(c>0?o:i)(c)}},{}],302:[function(t,n,l){var i,o,u,c,s,d=t("../internals/global"),f=t("../internals/function-bind-context"),h=t("../internals/object-get-own-property-descriptor").f,m=t("../internals/task").set,p=t("../internals/queue"),x=t("../internals/engine-is-ios"),g=t("../internals/engine-is-ios-pebble"),y=t("../internals/engine-is-webos-webkit"),v=t("../internals/engine-is-node"),_=d.MutationObserver||d.WebKitMutationObserver,C=d.document,M=d.process,T=d.Promise,U=h(d,"queueMicrotask"),F=U&&U.value;if(!F){var H=new p,W=function(){var K,$;for(v&&(K=M.domain)&&K.exit();$=H.get();)try{$()}catch(P){throw H.head&&i(),P}K&&K.enter()};x||v||y||!_||!C?!g&&T&&T.resolve?((c=T.resolve(void 0)).constructor=T,s=f(c.then,c),i=function(){s(W)}):v?i=function(){M.nextTick(W)}:(m=f(m,d),i=function(){m(W)}):(o=!0,u=C.createTextNode(""),new _(W).observe(u,{characterData:!0}),i=function(){u.data=o=!o}),F=function(K){H.head||i(),H.add(K)}}n.exports=F},{"../internals/engine-is-ios":253,"../internals/engine-is-ios-pebble":252,"../internals/engine-is-node":254,"../internals/engine-is-webos-webkit":255,"../internals/function-bind-context":262,"../internals/global":274,"../internals/object-get-own-property-descriptor":309,"../internals/queue":328,"../internals/task":339}],303:[function(t,n,l){var i=t("../internals/a-callable"),o=TypeError,u=function(c){var s,d;this.promise=new c((function(f,h){if(s!==void 0||d!==void 0)throw new o("Bad Promise constructor");s=f,d=h})),this.resolve=i(s),this.reject=i(d)};n.exports.f=function(c){return new u(c)}},{"../internals/a-callable":222}],304:[function(t,n,l){var i=t("../internals/is-regexp"),o=TypeError;n.exports=function(u){if(i(u))throw new o("The method doesn't accept regular expressions");return u}},{"../internals/is-regexp":291}],305:[function(t,n,l){var i=t("../internals/descriptors"),o=t("../internals/function-uncurry-this"),u=t("../internals/function-call"),c=t("../internals/fails"),s=t("../internals/object-keys"),d=t("../internals/object-get-own-property-symbols"),f=t("../internals/object-property-is-enumerable"),h=t("../internals/to-object"),m=t("../internals/indexed-object"),p=Object.assign,x=Object.defineProperty,g=o([].concat);n.exports=!p||c((function(){if(i&&p({b:1},p(x({},"a",{enumerable:!0,get:function(){x(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var y={},v={},_=Symbol("assign detection");return y[_]=7,"abcdefghijklmnopqrst".split("").forEach((function(C){v[C]=C})),p({},y)[_]!==7||s(p({},v)).join("")!=="abcdefghijklmnopqrst"}))?function(y,v){for(var _=h(y),C=arguments.length,M=1,T=d.f,U=f.f;C>M;)for(var F,H=m(arguments[M++]),W=T?g(s(H),T(H)):s(H),K=W.length,$=0;K>$;)F=W[$++],i&&!u(U,H,F)||(_[F]=H[F]);return _}:p},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-call":264,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/object-get-own-property-symbols":312,"../internals/object-keys":316,"../internals/object-property-is-enumerable":317,"../internals/to-object":344}],306:[function(t,n,l){var i,o=t("../internals/an-object"),u=t("../internals/object-define-properties"),c=t("../internals/enum-bug-keys"),s=t("../internals/hidden-keys"),d=t("../internals/html"),f=t("../internals/document-create-element"),h=t("../internals/shared-key"),m=h("IE_PROTO"),p=function(){},x=function(v){return"