(function(){"use strict";var Fi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ys={exports:{}},Pa={},ws={exports:{}},Xe={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var qc;function th(){if(qc)return Xe;qc=1;var e=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.iterator;function w(P){return P===null||typeof P!="object"?null:(P=g&&P[g]||P["@@iterator"],typeof P=="function"?P:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,y={};function k(P,T,Z){this.props=P,this.context=T,this.refs=y,this.updater=Z||v}k.prototype.isReactComponent={},k.prototype.setState=function(P,T){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,T,"setState")},k.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function C(){}C.prototype=k.prototype;function E(P,T,Z){this.props=P,this.context=T,this.refs=y,this.updater=Z||v}var _=E.prototype=new C;_.constructor=E,b(_,k.prototype),_.isPureReactComponent=!0;var N=Array.isArray,I=Object.prototype.hasOwnProperty,G={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function O(P,T,Z){var se,re={},ye=null,Pe=null;if(T!=null)for(se in T.ref!==void 0&&(Pe=T.ref),T.key!==void 0&&(ye=""+T.key),T)I.call(T,se)&&!M.hasOwnProperty(se)&&(re[se]=T[se]);var ge=arguments.length-2;if(ge===1)re.children=Z;else if(1>>1,T=W[P];if(0>>1;Po(re,ae))yeo(Pe,re)?(W[P]=Pe,W[ye]=ae,P=ye):(W[P]=re,W[se]=ae,P=se);else if(yeo(Pe,ae))W[P]=Pe,W[ye]=ae,P=ye;else break e}}return V}function o(W,V){var ae=W.sortIndex-V.sortIndex;return ae!==0?ae:W.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var d=[],l=[],h=1,g=null,w=3,v=!1,b=!1,y=!1,k=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(W){for(var V=n(l);V!==null;){if(V.callback===null)i(l);else if(V.startTime<=W)i(l),V.sortIndex=V.expirationTime,r(d,V);else break;V=n(l)}}function N(W){if(y=!1,_(W),!b)if(n(d)!==null)b=!0,Ce(I);else{var V=n(l);V!==null&&ie(N,V.startTime-W)}}function I(W,V){b=!1,y&&(y=!1,C(O),O=-1),v=!0;var ae=w;try{for(_(V),g=n(d);g!==null&&(!(g.expirationTime>V)||W&&!me());){var P=g.callback;if(typeof P=="function"){g.callback=null,w=g.priorityLevel;var T=P(g.expirationTime<=V);V=e.unstable_now(),typeof T=="function"?g.callback=T:g===n(d)&&i(d),_(V)}else i(d);g=n(d)}if(g!==null)var Z=!0;else{var se=n(l);se!==null&&ie(N,se.startTime-V),Z=!1}return Z}finally{g=null,w=ae,v=!1}}var G=!1,M=null,O=-1,z=5,Y=-1;function me(){return!(e.unstable_now()-YW||125P?(W.sortIndex=ae,r(l,W),n(d)===null&&W===n(l)&&(y?(C(O),O=-1):y=!0,ie(N,ae-P))):(W.sortIndex=T,r(d,W),b||v||(b=!0,Ce(I))),W},e.unstable_shouldYield=me,e.unstable_wrapCallback=function(W){var V=w;return function(){var ae=w;w=V;try{return W.apply(this,arguments)}finally{w=ae}}}})(ks)),ks}var $c;function ih(){return $c||($c=1,xs.exports=ah()),xs.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var eu;function oh(){if(eu)return Nt;eu=1;var e=bs(),r=ih();function n(t){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+t,s=1;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,l=/^[: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]*$/,h={},g={};function w(t){return d.call(g,t)?!0:d.call(h,t)?!1:l.test(t)?g[t]=!0:(h[t]=!0,!1)}function v(t,a,s,A){if(s!==null&&s.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return A?!1:s!==null?!s.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function b(t,a,s,A){if(a===null||typeof a>"u"||v(t,a,s,A))return!0;if(A)return!1;if(s!==null)switch(s.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function y(t,a,s,A,p,m,L){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=A,this.attributeNamespace=p,this.mustUseProperty=s,this.propertyName=t,this.type=a,this.sanitizeURL=m,this.removeEmptyString=L}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){k[t]=new y(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var a=t[0];k[a]=new y(a,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){k[t]=new y(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){k[t]=new y(t,2,!1,t,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(t){k[t]=new y(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){k[t]=new y(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){k[t]=new y(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){k[t]=new y(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){k[t]=new y(t,5,!1,t.toLowerCase(),null,!1,!1)});var C=/[\-:]([a-z])/g;function E(t){return t[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(t){var a=t.replace(C,E);k[a]=new y(a,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var a=t.replace(C,E);k[a]=new y(a,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var a=t.replace(C,E);k[a]=new y(a,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){k[t]=new y(t,1,!1,t.toLowerCase(),null,!1,!1)}),k.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){k[t]=new y(t,1,!1,t.toLowerCase(),null,!0,!0)});function _(t,a,s,A){var p=k.hasOwnProperty(a)?k[a]:null;(p!==null?p.type!==0:A||!(2D||p[L]!==m[D]){var U=` `+p[L].replace(" at new "," at ");return t.displayName&&U.includes("")&&(U=U.replace("",t.displayName)),U}while(1<=L&&0<=D);break}}}finally{Z=!1,Error.prepareStackTrace=s}return(t=t?t.displayName||t.name:"")?T(t):""}function re(t){switch(t.tag){case 5:return T(t.type);case 16:return T("Lazy");case 13:return T("Suspense");case 19:return T("SuspenseList");case 0:case 2:case 15:return t=se(t.type,!1),t;case 11:return t=se(t.type.render,!1),t;case 1:return t=se(t.type,!0),t;default:return""}}function ye(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case M:return"Fragment";case G:return"Portal";case z:return"Profiler";case O:return"StrictMode";case J:return"Suspense";case S:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case me:return(t.displayName||"Context")+".Consumer";case Y:return(t._context.displayName||"Context")+".Provider";case F:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ee:return a=t.displayName||null,a!==null?a:ye(t.type)||"Memo";case Ce:a=t._payload,t=t._init;try{return ye(t(a))}catch{}}return null}function Pe(t){var a=t.type;switch(t.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=a.render,t=t.displayName||t.name||"",a.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ye(a);case 8:return a===O?"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 a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function ge(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ve(t){var a=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Ue(t){var a=ve(t)?"checked":"value",s=Object.getOwnPropertyDescriptor(t.constructor.prototype,a),A=""+t[a];if(!t.hasOwnProperty(a)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var p=s.get,m=s.set;return Object.defineProperty(t,a,{configurable:!0,get:function(){return p.call(this)},set:function(L){A=""+L,m.call(this,L)}}),Object.defineProperty(t,a,{enumerable:s.enumerable}),{getValue:function(){return A},setValue:function(L){A=""+L},stopTracking:function(){t._valueTracker=null,delete t[a]}}}}function Qe(t){t._valueTracker||(t._valueTracker=Ue(t))}function Ve(t){if(!t)return!1;var a=t._valueTracker;if(!a)return!0;var s=a.getValue(),A="";return t&&(A=ve(t)?t.checked?"true":"false":t.value),t=A,t!==s?(a.setValue(t),!0):!1}function ot(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function x(t,a){var s=a.checked;return ae({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??t._wrapperState.initialChecked})}function te(t,a){var s=a.defaultValue==null?"":a.defaultValue,A=a.checked!=null?a.checked:a.defaultChecked;s=ge(a.value!=null?a.value:s),t._wrapperState={initialChecked:A,initialValue:s,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function $(t,a){a=a.checked,a!=null&&_(t,"checked",a,!1)}function R(t,a){$(t,a);var s=ge(a.value),A=a.type;if(s!=null)A==="number"?(s===0&&t.value===""||t.value!=s)&&(t.value=""+s):t.value!==""+s&&(t.value=""+s);else if(A==="submit"||A==="reset"){t.removeAttribute("value");return}a.hasOwnProperty("value")?j(t,a.type,s):a.hasOwnProperty("defaultValue")&&j(t,a.type,ge(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(t.defaultChecked=!!a.defaultChecked)}function B(t,a,s){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var A=a.type;if(!(A!=="submit"&&A!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+t._wrapperState.initialValue,s||a===t.value||(t.value=a),t.defaultValue=a}s=t.name,s!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,s!==""&&(t.name=s)}function j(t,a,s){(a!=="number"||ot(t.ownerDocument)!==t)&&(s==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+s&&(t.defaultValue=""+s))}var le=Array.isArray;function ne(t,a,s,A){if(t=t.options,a){a={};for(var p=0;p"+a.valueOf().toString()+"",a=je.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;a.firstChild;)t.appendChild(a.firstChild)}});function lr(t,a){if(a){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=a;return}}t.textContent=a}var Et={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},wn=["Webkit","ms","Moz","O"];Object.keys(Et).forEach(function(t){wn.forEach(function(a){a=a+t.charAt(0).toUpperCase()+t.substring(1),Et[a]=Et[t]})});function nt(t,a,s){return a==null||typeof a=="boolean"||a===""?"":s||typeof a!="number"||a===0||Et.hasOwnProperty(t)&&Et[t]?(""+a).trim():a+"px"}function bn(t,a){t=t.style;for(var s in a)if(a.hasOwnProperty(s)){var A=s.indexOf("--")===0,p=nt(s,a[s],A);s==="float"&&(s="cssFloat"),A?t.setProperty(s,p):t[s]=p}}var qa=ae({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 Vt(t,a){if(a){if(qa[t]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(n(137,t));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(n(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(n(61))}if(a.style!=null&&typeof a.style!="object")throw Error(n(62))}}function ia(t,a){if(t.indexOf("-")===-1)return typeof a.is=="string";switch(t){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 Ja=null;function Ya(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ka=null,Tr=null,$t=null;function Cn(t){if(t=yi(t)){if(typeof Ka!="function")throw Error(n(280));var a=t.stateNode;a&&(a=No(a),Ka(t.stateNode,t.type,a))}}function mA(t){Tr?$t?$t.push(t):$t=[t]:Tr=t}function vA(){if(Tr){var t=Tr,a=$t;if($t=Tr=null,Cn(t),a)for(t=0;t>>=0,t===0?32:31-(Pv(t)/_v|0)|0}var go=64,mo=4194304;function ti(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function vo(t,a){var s=t.pendingLanes;if(s===0)return 0;var A=0,p=t.suspendedLanes,m=t.pingedLanes,L=s&268435455;if(L!==0){var D=L&~p;D!==0?A=ti(D):(m&=L,m!==0&&(A=ti(m)))}else L=s&~p,L!==0?A=ti(L):m!==0&&(A=ti(m));if(A===0)return 0;if(a!==0&&a!==A&&(a&p)===0&&(p=A&-A,m=a&-a,p>=m||p===16&&(m&4194240)!==0))return a;if((A&4)!==0&&(A|=s&16),a=t.entangledLanes,a!==0)for(t=t.entanglements,a&=A;0s;s++)a.push(t);return a}function ri(t,a,s){t.pendingLanes|=a,a!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,a=31-cr(a),t[a]=s}function Dv(t,a){var s=t.pendingLanes&~a;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=a,t.mutableReadLanes&=a,t.entangledLanes&=a,a=t.entanglements;var A=t.eventTimes;for(t=t.expirationTimes;0=ui),VA=" ",HA=!1;function qA(t,a){switch(t){case"keyup":return s0.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function JA(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var la=!1;function c0(t,a){switch(t){case"compositionend":return JA(a);case"keypress":return a.which!==32?null:(HA=!0,VA);case"textInput":return t=a.data,t===VA&&HA?null:t;default:return null}}function u0(t,a){if(la)return t==="compositionend"||!Ll&&qA(t,a)?(t=UA(),xo=bl=qr=null,la=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1=a)return{node:s,offset:a-t};t=A}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=rd(s)}}function ad(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?ad(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function id(){for(var t=window,a=ot();a instanceof t.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)t=a.contentWindow;else break;a=ot(t.document)}return a}function Bl(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a&&(a==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||a==="textarea"||t.contentEditable==="true")}function y0(t){var a=id(),s=t.focusedElem,A=t.selectionRange;if(a!==s&&s&&s.ownerDocument&&ad(s.ownerDocument.documentElement,s)){if(A!==null&&Bl(s)){if(a=A.start,t=A.end,t===void 0&&(t=a),"selectionStart"in s)s.selectionStart=a,s.selectionEnd=Math.min(t,s.value.length);else if(t=(a=s.ownerDocument||document)&&a.defaultView||window,t.getSelection){t=t.getSelection();var p=s.textContent.length,m=Math.min(A.start,p);A=A.end===void 0?m:Math.min(A.end,p),!t.extend&&m>A&&(p=A,A=m,m=p),p=nd(s,m);var L=nd(s,A);p&&L&&(t.rangeCount!==1||t.anchorNode!==p.node||t.anchorOffset!==p.offset||t.focusNode!==L.node||t.focusOffset!==L.offset)&&(a=a.createRange(),a.setStart(p.node,p.offset),t.removeAllRanges(),m>A?(t.addRange(a),t.extend(L.node,L.offset)):(a.setEnd(L.node,L.offset),t.addRange(a)))}}for(a=[],t=s;t=t.parentNode;)t.nodeType===1&&a.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,ca=null,Tl=null,hi=null,Rl=!1;function od(t,a,s){var A=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Rl||ca==null||ca!==ot(A)||(A=ca,"selectionStart"in A&&Bl(A)?A={start:A.selectionStart,end:A.selectionEnd}:(A=(A.ownerDocument&&A.ownerDocument.defaultView||window).getSelection(),A={anchorNode:A.anchorNode,anchorOffset:A.anchorOffset,focusNode:A.focusNode,focusOffset:A.focusOffset}),hi&&fi(hi,A)||(hi=A,A=To(Tl,"onSelect"),0ha||(t.current=Ql[ha],Ql[ha]=null,ha--)}function et(t,a){ha++,Ql[ha]=t.current,t.current=a}var Zr={},Lt=Kr(Zr),Ot=Kr(!1),Sn=Zr;function pa(t,a){var s=t.type.contextTypes;if(!s)return Zr;var A=t.stateNode;if(A&&A.__reactInternalMemoizedUnmaskedChildContext===a)return A.__reactInternalMemoizedMaskedChildContext;var p={},m;for(m in s)p[m]=a[m];return A&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=a,t.__reactInternalMemoizedMaskedChildContext=p),p}function Mt(t){return t=t.childContextTypes,t!=null}function Fo(){rt(Ot),rt(Lt)}function bd(t,a,s){if(Lt.current!==Zr)throw Error(n(168));et(Lt,a),et(Ot,s)}function Cd(t,a,s){var A=t.stateNode;if(a=a.childContextTypes,typeof A.getChildContext!="function")return s;A=A.getChildContext();for(var p in A)if(!(p in a))throw Error(n(108,Pe(t)||"Unknown",p));return ae({},s,A)}function Io(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Zr,Sn=Lt.current,et(Lt,t),et(Ot,Ot.current),!0}function xd(t,a,s){var A=t.stateNode;if(!A)throw Error(n(169));s?(t=Cd(t,a,Sn),A.__reactInternalMemoizedMergedChildContext=t,rt(Ot),rt(Lt),et(Lt,t)):rt(Ot),et(Ot,s)}var Dr=null,Oo=!1,Wl=!1;function kd(t){Dr===null?Dr=[t]:Dr.push(t)}function T0(t){Oo=!0,kd(t)}function $r(){if(!Wl&&Dr!==null){Wl=!0;var t=0,a=Ze;try{var s=Dr;for(Ze=1;t>=L,p-=L,Nr=1<<32-cr(a)+p|s<Me?(bt=Ne,Ne=null):bt=Ne.sibling;var qe=ce(Q,Ne,q[Me],he);if(qe===null){Ne===null&&(Ne=bt);break}t&&Ne&&qe.alternate===null&&a(Q,Ne),X=m(qe,X,Me),De===null?Le=qe:De.sibling=qe,De=qe,Ne=bt}if(Me===q.length)return s(Q,Ne),at&&Ln(Q,Me),Le;if(Ne===null){for(;MeMe?(bt=Ne,Ne=null):bt=Ne.sibling;var cn=ce(Q,Ne,qe.value,he);if(cn===null){Ne===null&&(Ne=bt);break}t&&Ne&&cn.alternate===null&&a(Q,Ne),X=m(cn,X,Me),De===null?Le=cn:De.sibling=cn,De=cn,Ne=bt}if(qe.done)return s(Q,Ne),at&&Ln(Q,Me),Le;if(Ne===null){for(;!qe.done;Me++,qe=q.next())qe=de(Q,qe.value,he),qe!==null&&(X=m(qe,X,Me),De===null?Le=qe:De.sibling=qe,De=qe);return at&&Ln(Q,Me),Le}for(Ne=A(Q,Ne);!qe.done;Me++,qe=q.next())qe=we(Ne,Q,Me,qe.value,he),qe!==null&&(t&&qe.alternate!==null&&Ne.delete(qe.key===null?Me:qe.key),X=m(qe,X,Me),De===null?Le=qe:De.sibling=qe,De=qe);return t&&Ne.forEach(function(Ay){return a(Q,Ay)}),at&&Ln(Q,Me),Le}function ft(Q,X,q,he){if(typeof q=="object"&&q!==null&&q.type===M&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case I:e:{for(var Le=q.key,De=X;De!==null;){if(De.key===Le){if(Le=q.type,Le===M){if(De.tag===7){s(Q,De.sibling),X=p(De,q.props.children),X.return=Q,Q=X;break e}}else if(De.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===Ce&&Bd(Le)===De.type){s(Q,De.sibling),X=p(De,q.props),X.ref=wi(Q,De,q),X.return=Q,Q=X;break e}s(Q,De);break}else a(Q,De);De=De.sibling}q.type===M?(X=Fn(q.props.children,Q.mode,he,q.key),X.return=Q,Q=X):(he=As(q.type,q.key,q.props,null,Q.mode,he),he.ref=wi(Q,X,q),he.return=Q,Q=he)}return L(Q);case G:e:{for(De=q.key;X!==null;){if(X.key===De)if(X.tag===4&&X.stateNode.containerInfo===q.containerInfo&&X.stateNode.implementation===q.implementation){s(Q,X.sibling),X=p(X,q.children||[]),X.return=Q,Q=X;break e}else{s(Q,X);break}else a(Q,X);X=X.sibling}X=Xc(q,Q.mode,he),X.return=Q,Q=X}return L(Q);case Ce:return De=q._init,ft(Q,X,De(q._payload),he)}if(le(q))return Se(Q,X,q,he);if(V(q))return Ee(Q,X,q,he);jo(Q,q)}return typeof q=="string"&&q!==""||typeof q=="number"?(q=""+q,X!==null&&X.tag===6?(s(Q,X.sibling),X=p(X,q),X.return=Q,Q=X):(s(Q,X),X=jc(q,Q.mode,he),X.return=Q,Q=X),L(Q)):s(Q,X)}return ft}var ya=Td(!0),Rd=Td(!1),Xo=Kr(null),Go=null,wa=null,Kl=null;function Zl(){Kl=wa=Go=null}function $l(t){var a=Xo.current;rt(Xo),t._currentValue=a}function ec(t,a,s){for(;t!==null;){var A=t.alternate;if((t.childLanes&a)!==a?(t.childLanes|=a,A!==null&&(A.childLanes|=a)):A!==null&&(A.childLanes&a)!==a&&(A.childLanes|=a),t===s)break;t=t.return}}function ba(t,a){Go=t,Kl=wa=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&a)!==0&&(zt=!0),t.firstContext=null)}function rr(t){var a=t._currentValue;if(Kl!==t)if(t={context:t,memoizedValue:a,next:null},wa===null){if(Go===null)throw Error(n(308));wa=t,Go.dependencies={lanes:0,firstContext:t}}else wa=wa.next=t;return a}var Pn=null;function tc(t){Pn===null?Pn=[t]:Pn.push(t)}function Dd(t,a,s,A){var p=a.interleaved;return p===null?(s.next=s,tc(a)):(s.next=p.next,p.next=s),a.interleaved=s,Ir(t,A)}function Ir(t,a){t.lanes|=a;var s=t.alternate;for(s!==null&&(s.lanes|=a),s=t,t=t.return;t!==null;)t.childLanes|=a,s=t.alternate,s!==null&&(s.childLanes|=a),s=t,t=t.return;return s.tag===3?s.stateNode:null}var en=!1;function rc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Nd(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Or(t,a){return{eventTime:t,lane:a,tag:0,payload:null,callback:null,next:null}}function tn(t,a,s){var A=t.updateQueue;if(A===null)return null;if(A=A.shared,(He&2)!==0){var p=A.pending;return p===null?a.next=a:(a.next=p.next,p.next=a),A.pending=a,Ir(t,s)}return p=A.interleaved,p===null?(a.next=a,tc(A)):(a.next=p.next,p.next=a),A.interleaved=a,Ir(t,s)}function Qo(t,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194240)!==0)){var A=a.lanes;A&=t.pendingLanes,s|=A,a.lanes=s,gl(t,s)}}function Fd(t,a){var s=t.updateQueue,A=t.alternate;if(A!==null&&(A=A.updateQueue,s===A)){var p=null,m=null;if(s=s.firstBaseUpdate,s!==null){do{var L={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};m===null?p=m=L:m=m.next=L,s=s.next}while(s!==null);m===null?p=m=a:m=m.next=a}else p=m=a;s={baseState:A.baseState,firstBaseUpdate:p,lastBaseUpdate:m,shared:A.shared,effects:A.effects},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=a:t.next=a,s.lastBaseUpdate=a}function Wo(t,a,s,A){var p=t.updateQueue;en=!1;var m=p.firstBaseUpdate,L=p.lastBaseUpdate,D=p.shared.pending;if(D!==null){p.shared.pending=null;var U=D,K=U.next;U.next=null,L===null?m=K:L.next=K,L=U;var ue=t.alternate;ue!==null&&(ue=ue.updateQueue,D=ue.lastBaseUpdate,D!==L&&(D===null?ue.firstBaseUpdate=K:D.next=K,ue.lastBaseUpdate=U))}if(m!==null){var de=p.baseState;L=0,ue=K=U=null,D=m;do{var ce=D.lane,we=D.eventTime;if((A&ce)===ce){ue!==null&&(ue=ue.next={eventTime:we,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var Se=t,Ee=D;switch(ce=a,we=s,Ee.tag){case 1:if(Se=Ee.payload,typeof Se=="function"){de=Se.call(we,de,ce);break e}de=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Ee.payload,ce=typeof Se=="function"?Se.call(we,de,ce):Se,ce==null)break e;de=ae({},de,ce);break e;case 2:en=!0}}D.callback!==null&&D.lane!==0&&(t.flags|=64,ce=p.effects,ce===null?p.effects=[D]:ce.push(D))}else we={eventTime:we,lane:ce,tag:D.tag,payload:D.payload,callback:D.callback,next:null},ue===null?(K=ue=we,U=de):ue=ue.next=we,L|=ce;if(D=D.next,D===null){if(D=p.shared.pending,D===null)break;ce=D,D=ce.next,ce.next=null,p.lastBaseUpdate=ce,p.shared.pending=null}}while(!0);if(ue===null&&(U=de),p.baseState=U,p.firstBaseUpdate=K,p.lastBaseUpdate=ue,a=p.shared.interleaved,a!==null){p=a;do L|=p.lane,p=p.next;while(p!==a)}else m===null&&(p.shared.lanes=0);Tn|=L,t.lanes=L,t.memoizedState=de}}function Id(t,a,s){if(t=a.effects,a.effects=null,t!==null)for(a=0;as?s:4,t(!0);var A=sc.transition;sc.transition={};try{t(!1),a()}finally{Ze=s,sc.transition=A}}function tf(){return nr().memoizedState}function F0(t,a,s){var A=on(t);if(s={lane:A,action:s,hasEagerState:!1,eagerState:null,next:null},rf(t))nf(a,s);else if(s=Dd(t,a,s,A),s!==null){var p=Dt();pr(s,t,A,p),af(s,a,A)}}function I0(t,a,s){var A=on(t),p={lane:A,action:s,hasEagerState:!1,eagerState:null,next:null};if(rf(t))nf(a,p);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=a.lastRenderedReducer,m!==null))try{var L=a.lastRenderedState,D=m(L,s);if(p.hasEagerState=!0,p.eagerState=D,ur(D,L)){var U=a.interleaved;U===null?(p.next=p,tc(a)):(p.next=U.next,U.next=p),a.interleaved=p;return}}catch{}finally{}s=Dd(t,a,p,A),s!==null&&(p=Dt(),pr(s,t,A,p),af(s,a,A))}}function rf(t){var a=t.alternate;return t===lt||a!==null&&a===lt}function nf(t,a){ki=qo=!0;var s=t.pending;s===null?a.next=a:(a.next=s.next,s.next=a),t.pending=a}function af(t,a,s){if((s&4194240)!==0){var A=a.lanes;A&=t.pendingLanes,s|=A,a.lanes=s,gl(t,s)}}var Ko={readContext:rr,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useInsertionEffect:Pt,useLayoutEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useMutableSource:Pt,useSyncExternalStore:Pt,useId:Pt,unstable_isNewReconciler:!1},O0={readContext:rr,useCallback:function(t,a){return kr().memoizedState=[t,a===void 0?null:a],t},useContext:rr,useEffect:Hd,useImperativeHandle:function(t,a,s){return s=s!=null?s.concat([t]):null,Jo(4194308,4,Yd.bind(null,a,t),s)},useLayoutEffect:function(t,a){return Jo(4194308,4,t,a)},useInsertionEffect:function(t,a){return Jo(4,2,t,a)},useMemo:function(t,a){var s=kr();return a=a===void 0?null:a,t=t(),s.memoizedState=[t,a],t},useReducer:function(t,a,s){var A=kr();return a=s!==void 0?s(a):a,A.memoizedState=A.baseState=a,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:a},A.queue=t,t=t.dispatch=F0.bind(null,lt,t),[A.memoizedState,t]},useRef:function(t){var a=kr();return t={current:t},a.memoizedState=t},useState:Wd,useDebugValue:hc,useDeferredValue:function(t){return kr().memoizedState=t},useTransition:function(){var t=Wd(!1),a=t[0];return t=N0.bind(null,t[1]),kr().memoizedState=t,[a,t]},useMutableSource:function(){},useSyncExternalStore:function(t,a,s){var A=lt,p=kr();if(at){if(s===void 0)throw Error(n(407));s=s()}else{if(s=a(),wt===null)throw Error(n(349));(Bn&30)!==0||Ud(A,a,s)}p.memoizedState=s;var m={value:s,getSnapshot:a};return p.queue=m,Hd(Xd.bind(null,A,m,t),[t]),A.flags|=2048,Li(9,jd.bind(null,A,m,s,a),void 0,null),s},useId:function(){var t=kr(),a=wt.identifierPrefix;if(at){var s=Fr,A=Nr;s=(A&~(1<<32-cr(A)-1)).toString(32)+s,a=":"+a+"R"+s,s=Si++,0<\/script>",t=t.removeChild(t.firstChild)):typeof A.is=="string"?t=L.createElement(s,{is:A.is}):(t=L.createElement(s),s==="select"&&(L=t,A.multiple?L.multiple=!0:A.size&&(L.size=A.size))):t=L.createElementNS(t,s),t[Cr]=a,t[vi]=A,Sf(t,a,!1,!1),a.stateNode=t;e:{switch(L=ia(s,A),s){case"dialog":tt("cancel",t),tt("close",t),p=A;break;case"iframe":case"object":case"embed":tt("load",t),p=A;break;case"video":case"audio":for(p=0;pEa&&(a.flags|=128,A=!0,Pi(m,!1),a.lanes=4194304)}else{if(!A)if(t=Vo(L),t!==null){if(a.flags|=128,A=!0,s=t.updateQueue,s!==null&&(a.updateQueue=s,a.flags|=4),Pi(m,!0),m.tail===null&&m.tailMode==="hidden"&&!L.alternate&&!at)return _t(a),null}else 2*dt()-m.renderingStartTime>Ea&&s!==1073741824&&(a.flags|=128,A=!0,Pi(m,!1),a.lanes=4194304);m.isBackwards?(L.sibling=a.child,a.child=L):(s=m.last,s!==null?s.sibling=L:a.child=L,m.last=L)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=dt(),a.sibling=null,s=st.current,et(st,A?s&1|2:s&1),a):(_t(a),null);case 22:case 23:return Mc(),A=a.memoizedState!==null,t!==null&&t.memoizedState!==null!==A&&(a.flags|=8192),A&&(a.mode&1)!==0?(Yt&1073741824)!==0&&(_t(a),a.subtreeFlags&6&&(a.flags|=8192)):_t(a),null;case 24:return null;case 25:return null}throw Error(n(156,a.tag))}function W0(t,a){switch(Hl(a),a.tag){case 1:return Mt(a.type)&&Fo(),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return Ca(),rt(Ot),rt(Lt),oc(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 5:return ac(a),null;case 13:if(rt(st),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(n(340));va()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return rt(st),null;case 4:return Ca(),null;case 10:return $l(a.type._context),null;case 22:case 23:return Mc(),null;case 24:return null;default:return null}}var ts=!1,Bt=!1,V0=typeof WeakSet=="function"?WeakSet:Set,xe=null;function ka(t,a){var s=t.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(A){ut(t,a,A)}else s.current=null}function Ec(t,a,s){try{s()}catch(A){ut(t,a,A)}}var Pf=!1;function H0(t,a){if(Ml=bo,t=id(),Bl(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var A=s.getSelection&&s.getSelection();if(A&&A.rangeCount!==0){s=A.anchorNode;var p=A.anchorOffset,m=A.focusNode;A=A.focusOffset;try{s.nodeType,m.nodeType}catch{s=null;break e}var L=0,D=-1,U=-1,K=0,ue=0,de=t,ce=null;t:for(;;){for(var we;de!==s||p!==0&&de.nodeType!==3||(D=L+p),de!==m||A!==0&&de.nodeType!==3||(U=L+A),de.nodeType===3&&(L+=de.nodeValue.length),(we=de.firstChild)!==null;)ce=de,de=we;for(;;){if(de===t)break t;if(ce===s&&++K===p&&(D=L),ce===m&&++ue===A&&(U=L),(we=de.nextSibling)!==null)break;de=ce,ce=de.parentNode}de=we}s=D===-1||U===-1?null:{start:D,end:U}}else s=null}s=s||{start:0,end:0}}else s=null;for(zl={focusedElem:t,selectionRange:s},bo=!1,xe=a;xe!==null;)if(a=xe,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,xe=t;else for(;xe!==null;){a=xe;try{var Se=a.alternate;if((a.flags&1024)!==0)switch(a.tag){case 0:case 11:case 15:break;case 1:if(Se!==null){var Ee=Se.memoizedProps,ft=Se.memoizedState,Q=a.stateNode,X=Q.getSnapshotBeforeUpdate(a.elementType===a.type?Ee:dr(a.type,Ee),ft);Q.__reactInternalSnapshotBeforeUpdate=X}break;case 3:var q=a.stateNode.containerInfo;q.nodeType===1?q.textContent="":q.nodeType===9&&q.documentElement&&q.removeChild(q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(he){ut(a,a.return,he)}if(t=a.sibling,t!==null){t.return=a.return,xe=t;break}xe=a.return}return Se=Pf,Pf=!1,Se}function _i(t,a,s){var A=a.updateQueue;if(A=A!==null?A.lastEffect:null,A!==null){var p=A=A.next;do{if((p.tag&t)===t){var m=p.destroy;p.destroy=void 0,m!==void 0&&Ec(a,s,m)}p=p.next}while(p!==A)}}function rs(t,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var s=a=a.next;do{if((s.tag&t)===t){var A=s.create;s.destroy=A()}s=s.next}while(s!==a)}}function Lc(t){var a=t.ref;if(a!==null){var s=t.stateNode;switch(t.tag){case 5:t=s;break;default:t=s}typeof a=="function"?a(t):a.current=t}}function _f(t){var a=t.alternate;a!==null&&(t.alternate=null,_f(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&(delete a[Cr],delete a[vi],delete a[Gl],delete a[_0],delete a[B0])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Bf(t){return t.tag===5||t.tag===3||t.tag===4}function Tf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Bf(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Pc(t,a,s){var A=t.tag;if(A===5||A===6)t=t.stateNode,a?s.nodeType===8?s.parentNode.insertBefore(t,a):s.insertBefore(t,a):(s.nodeType===8?(a=s.parentNode,a.insertBefore(t,s)):(a=s,a.appendChild(t)),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=Do));else if(A!==4&&(t=t.child,t!==null))for(Pc(t,a,s),t=t.sibling;t!==null;)Pc(t,a,s),t=t.sibling}function _c(t,a,s){var A=t.tag;if(A===5||A===6)t=t.stateNode,a?s.insertBefore(t,a):s.appendChild(t);else if(A!==4&&(t=t.child,t!==null))for(_c(t,a,s),t=t.sibling;t!==null;)_c(t,a,s),t=t.sibling}var kt=null,fr=!1;function rn(t,a,s){for(s=s.child;s!==null;)Rf(t,a,s),s=s.sibling}function Rf(t,a,s){if(br&&typeof br.onCommitFiberUnmount=="function")try{br.onCommitFiberUnmount(po,s)}catch{}switch(s.tag){case 5:Bt||ka(s,a);case 6:var A=kt,p=fr;kt=null,rn(t,a,s),kt=A,fr=p,kt!==null&&(fr?(t=kt,s=s.stateNode,t.nodeType===8?t.parentNode.removeChild(s):t.removeChild(s)):kt.removeChild(s.stateNode));break;case 18:kt!==null&&(fr?(t=kt,s=s.stateNode,t.nodeType===8?Xl(t.parentNode,s):t.nodeType===1&&Xl(t,s),si(t)):Xl(kt,s.stateNode));break;case 4:A=kt,p=fr,kt=s.stateNode.containerInfo,fr=!0,rn(t,a,s),kt=A,fr=p;break;case 0:case 11:case 14:case 15:if(!Bt&&(A=s.updateQueue,A!==null&&(A=A.lastEffect,A!==null))){p=A=A.next;do{var m=p,L=m.destroy;m=m.tag,L!==void 0&&((m&2)!==0||(m&4)!==0)&&Ec(s,a,L),p=p.next}while(p!==A)}rn(t,a,s);break;case 1:if(!Bt&&(ka(s,a),A=s.stateNode,typeof A.componentWillUnmount=="function"))try{A.props=s.memoizedProps,A.state=s.memoizedState,A.componentWillUnmount()}catch(D){ut(s,a,D)}rn(t,a,s);break;case 21:rn(t,a,s);break;case 22:s.mode&1?(Bt=(A=Bt)||s.memoizedState!==null,rn(t,a,s),Bt=A):rn(t,a,s);break;default:rn(t,a,s)}}function Df(t){var a=t.updateQueue;if(a!==null){t.updateQueue=null;var s=t.stateNode;s===null&&(s=t.stateNode=new V0),a.forEach(function(A){var p=ry.bind(null,t,A);s.has(A)||(s.add(A),A.then(p,p))})}}function hr(t,a){var s=a.deletions;if(s!==null)for(var A=0;Ap&&(p=L),A&=~m}if(A=p,A=dt()-A,A=(120>A?120:480>A?480:1080>A?1080:1920>A?1920:3e3>A?3e3:4320>A?4320:1960*J0(A/1960))-A,10t?16:t,an===null)var A=!1;else{if(t=an,an=null,ss=0,(He&6)!==0)throw Error(n(331));var p=He;for(He|=4,xe=t.current;xe!==null;){var m=xe,L=m.child;if((xe.flags&16)!==0){var D=m.deletions;if(D!==null){for(var U=0;Udt()-Rc?Dn(t,0):Tc|=s),jt(t,a)}function Vf(t,a){a===0&&((t.mode&1)===0?a=1:(a=mo,mo<<=1,(mo&130023424)===0&&(mo=4194304)));var s=Dt();t=Ir(t,a),t!==null&&(ri(t,a,s),jt(t,s))}function ty(t){var a=t.memoizedState,s=0;a!==null&&(s=a.retryLane),Vf(t,s)}function ry(t,a){var s=0;switch(t.tag){case 13:var A=t.stateNode,p=t.memoizedState;p!==null&&(s=p.retryLane);break;case 19:A=t.stateNode;break;default:throw Error(n(314))}A!==null&&A.delete(a),Vf(t,s)}var Hf;Hf=function(t,a,s){if(t!==null)if(t.memoizedProps!==a.pendingProps||Ot.current)zt=!0;else{if((t.lanes&s)===0&&(a.flags&128)===0)return zt=!1,G0(t,a,s);zt=(t.flags&131072)!==0}else zt=!1,at&&(a.flags&1048576)!==0&&Sd(a,zo,a.index);switch(a.lanes=0,a.tag){case 2:var A=a.type;es(t,a),t=a.pendingProps;var p=pa(a,Lt.current);ba(a,s),p=cc(null,a,A,t,p,s);var m=uc();return a.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,Mt(A)?(m=!0,Io(a)):m=!1,a.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,rc(a),p.updater=Zo,a.stateNode=p,p._reactInternals=a,gc(a,A,t,s),a=wc(null,a,A,!0,m,s)):(a.tag=0,at&&m&&Vl(a),Rt(null,a,p,s),a=a.child),a;case 16:A=a.elementType;e:{switch(es(t,a),t=a.pendingProps,p=A._init,A=p(A._payload),a.type=A,p=a.tag=ay(A),t=dr(A,t),p){case 0:a=yc(null,a,A,t,s);break e;case 1:a=yf(null,a,A,t,s);break e;case 11:a=hf(null,a,A,t,s);break e;case 14:a=pf(null,a,A,dr(A.type,t),s);break e}throw Error(n(306,A,""))}return a;case 0:return A=a.type,p=a.pendingProps,p=a.elementType===A?p:dr(A,p),yc(t,a,A,p,s);case 1:return A=a.type,p=a.pendingProps,p=a.elementType===A?p:dr(A,p),yf(t,a,A,p,s);case 3:e:{if(wf(a),t===null)throw Error(n(387));A=a.pendingProps,m=a.memoizedState,p=m.element,Nd(t,a),Wo(a,A,null,s);var L=a.memoizedState;if(A=L.element,m.isDehydrated)if(m={element:A,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},a.updateQueue.baseState=m,a.memoizedState=m,a.flags&256){p=xa(Error(n(423)),a),a=bf(t,a,A,s,p);break e}else if(A!==p){p=xa(Error(n(424)),a),a=bf(t,a,A,s,p);break e}else for(Jt=Yr(a.stateNode.containerInfo.firstChild),qt=a,at=!0,Ar=null,s=Rd(a,null,A,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(va(),A===p){a=Mr(t,a,s);break e}Rt(t,a,A,s)}a=a.child}return a;case 5:return Od(a),t===null&&Jl(a),A=a.type,p=a.pendingProps,m=t!==null?t.memoizedProps:null,L=p.children,Ul(A,p)?L=null:m!==null&&Ul(A,m)&&(a.flags|=32),vf(t,a),Rt(t,a,L,s),a.child;case 6:return t===null&&Jl(a),null;case 13:return Cf(t,a,s);case 4:return nc(a,a.stateNode.containerInfo),A=a.pendingProps,t===null?a.child=ya(a,null,A,s):Rt(t,a,A,s),a.child;case 11:return A=a.type,p=a.pendingProps,p=a.elementType===A?p:dr(A,p),hf(t,a,A,p,s);case 7:return Rt(t,a,a.pendingProps,s),a.child;case 8:return Rt(t,a,a.pendingProps.children,s),a.child;case 12:return Rt(t,a,a.pendingProps.children,s),a.child;case 10:e:{if(A=a.type._context,p=a.pendingProps,m=a.memoizedProps,L=p.value,et(Xo,A._currentValue),A._currentValue=L,m!==null)if(ur(m.value,L)){if(m.children===p.children&&!Ot.current){a=Mr(t,a,s);break e}}else for(m=a.child,m!==null&&(m.return=a);m!==null;){var D=m.dependencies;if(D!==null){L=m.child;for(var U=D.firstContext;U!==null;){if(U.context===A){if(m.tag===1){U=Or(-1,s&-s),U.tag=2;var K=m.updateQueue;if(K!==null){K=K.shared;var ue=K.pending;ue===null?U.next=U:(U.next=ue.next,ue.next=U),K.pending=U}}m.lanes|=s,U=m.alternate,U!==null&&(U.lanes|=s),ec(m.return,s,a),D.lanes|=s;break}U=U.next}}else if(m.tag===10)L=m.type===a.type?null:m.child;else if(m.tag===18){if(L=m.return,L===null)throw Error(n(341));L.lanes|=s,D=L.alternate,D!==null&&(D.lanes|=s),ec(L,s,a),L=m.sibling}else L=m.child;if(L!==null)L.return=m;else for(L=m;L!==null;){if(L===a){L=null;break}if(m=L.sibling,m!==null){m.return=L.return,L=m;break}L=L.return}m=L}Rt(t,a,p.children,s),a=a.child}return a;case 9:return p=a.type,A=a.pendingProps.children,ba(a,s),p=rr(p),A=A(p),a.flags|=1,Rt(t,a,A,s),a.child;case 14:return A=a.type,p=dr(A,a.pendingProps),p=dr(A.type,p),pf(t,a,A,p,s);case 15:return gf(t,a,a.type,a.pendingProps,s);case 17:return A=a.type,p=a.pendingProps,p=a.elementType===A?p:dr(A,p),es(t,a),a.tag=1,Mt(A)?(t=!0,Io(a)):t=!1,ba(a,s),sf(a,A,p),gc(a,A,p,s),wc(null,a,A,!0,t,s);case 19:return kf(t,a,s);case 22:return mf(t,a,s)}throw Error(n(156,a.tag))};function qf(t,a){return EA(t,a)}function ny(t,a,s,A){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=A,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ir(t,a,s,A){return new ny(t,a,s,A)}function Uc(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ay(t){if(typeof t=="function")return Uc(t)?1:0;if(t!=null){if(t=t.$$typeof,t===F)return 11;if(t===ee)return 14}return 2}function ln(t,a){var s=t.alternate;return s===null?(s=ir(t.tag,a,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=a,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&14680064,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,a=t.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s}function As(t,a,s,A,p,m){var L=2;if(A=t,typeof t=="function")Uc(t)&&(L=1);else if(typeof t=="string")L=5;else e:switch(t){case M:return Fn(s.children,p,m,a);case O:L=8,p|=8;break;case z:return t=ir(12,s,a,p|2),t.elementType=z,t.lanes=m,t;case J:return t=ir(13,s,a,p),t.elementType=J,t.lanes=m,t;case S:return t=ir(19,s,a,p),t.elementType=S,t.lanes=m,t;case ie:return ds(s,p,m,a);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Y:L=10;break e;case me:L=9;break e;case F:L=11;break e;case ee:L=14;break e;case Ce:L=16,A=null;break e}throw Error(n(130,t==null?t:typeof t,""))}return a=ir(L,s,a,p),a.elementType=t,a.type=A,a.lanes=m,a}function Fn(t,a,s,A){return t=ir(7,t,A,a),t.lanes=s,t}function ds(t,a,s,A){return t=ir(22,t,A,a),t.elementType=ie,t.lanes=s,t.stateNode={isHidden:!1},t}function jc(t,a,s){return t=ir(6,t,null,a),t.lanes=s,t}function Xc(t,a,s){return a=ir(4,t.children!==null?t.children:[],t.key,a),a.lanes=s,a.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},a}function iy(t,a,s,A,p){this.tag=a,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pl(0),this.expirationTimes=pl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pl(0),this.identifierPrefix=A,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Gc(t,a,s,A,p,m,L,D,U){return t=new iy(t,a,s,D,U),a===1?(a=1,m===!0&&(a|=8)):a=0,m=ir(3,null,null,a),t.current=m,m.stateNode=t,m.memoizedState={element:A,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},rc(m),t}function oy(t,a,s){var A=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),Cs.exports=oh(),Cs.exports}var ru;function lh(){if(ru)return Oi;ru=1;var e=sh();return Oi.createRoot=e.createRoot,Oi.hydrateRoot=e.hydrateRoot,Oi}var ch=lh();const In={wrapper:{display:"flex",flexDirection:"column",gap:6,marginBottom:20},label:{fontSize:14,fontWeight:600,color:"#1A1A29",fontFamily:"'Poppins', Arial, sans-serif"},input:{height:44,padding:"0 14px",border:"1.5px solid #E2E2EA",borderRadius:8,fontSize:15,color:"#1A1A29",backgroundColor:"#FFFFFF",fontFamily:"'Poppins', Arial, sans-serif",outline:"none",transition:"border-color 0.15s",width:"100%",boxSizing:"border-box"},inputFocus:{borderColor:"#7572FF"},helper:{fontSize:12,color:"#56557E",fontFamily:"'Poppins', Arial, sans-serif",marginTop:-2},error:{fontSize:12,color:"#FF6F57",fontFamily:"'Poppins', Arial, sans-serif",marginTop:-2}};function un({label:e,value:r,onChange:n,placeholder:i,helper:o,error:c,type:u="text",prefix:f,...d}){const[l,h]=Ii.useState(!1);return oe.jsxs("div",{style:In.wrapper,children:[e&&oe.jsx("label",{style:In.label,children:e}),oe.jsxs("div",{style:{position:"relative"},children:[f&&oe.jsx("span",{style:{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)",color:"#56557E",fontSize:15,fontFamily:"'Poppins', Arial, sans-serif",pointerEvents:"none"},children:f}),oe.jsx("input",{type:u,value:r,onChange:g=>n(g.target.value),placeholder:i,onFocus:()=>h(!0),onBlur:()=>h(!1),style:{...In.input,...l?In.inputFocus:{},...c?{borderColor:"#FF6F57"}:{},...f?{paddingLeft:28}:{}},...d})]}),o&&!c&&oe.jsx("span",{style:In.helper,children:o}),c&&oe.jsx("span",{style:In.error,children:c})]})}const On={wrapper:{display:"flex",flexDirection:"column",gap:6,marginBottom:20},label:{fontSize:14,fontWeight:600,color:"#1A1A29",fontFamily:"'Poppins', Arial, sans-serif"},selectWrapper:{position:"relative"},select:{height:44,padding:"0 36px 0 14px",border:"1.5px solid #E2E2EA",borderRadius:8,fontSize:15,color:"#1A1A29",backgroundColor:"#FFFFFF",fontFamily:"'Poppins', Arial, sans-serif",outline:"none",appearance:"none",cursor:"pointer",width:"100%",boxSizing:"border-box",transition:"border-color 0.15s"},chevron:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",width:16,height:16,color:"#56557E"},helper:{fontSize:12,color:"#56557E",fontFamily:"'Poppins', Arial, sans-serif",marginTop:-2}};function nu({label:e,value:r,onChange:n,options:i=[],placeholder:o,helper:c}){const[u,f]=Ii.useState(!1);return oe.jsxs("div",{style:On.wrapper,children:[e&&oe.jsx("label",{style:On.label,children:e}),oe.jsxs("div",{style:On.selectWrapper,children:[oe.jsxs("select",{value:r,onChange:d=>n(d.target.value),onFocus:()=>f(!0),onBlur:()=>f(!1),style:{...On.select,...u?{borderColor:"#7572FF"}:{},...r===""?{color:"#56557E"}:{}},children:[o&&oe.jsx("option",{value:"",disabled:!0,children:o}),i.map(d=>typeof d=="string"?oe.jsx("option",{value:d,children:d},d):oe.jsx("option",{value:d.value,children:d.label},d.value))]}),oe.jsx("svg",{style:On.chevron,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:oe.jsx("path",{d:"M4 6l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),c&&oe.jsx("span",{style:On.helper,children:c})]})}function uh({onClick:e,loading:r=!1,disabled:n=!1,children:i="Calculate"}){const[o,c]=Ii.useState(!1);return oe.jsxs("button",{onClick:e,disabled:n||r,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,height:48,padding:"0 32px",backgroundColor:n||r?"#D2D1E8":o?"#5e5bdd":"#7572FF",color:"#FFFFFF",border:"none",borderRadius:8,fontSize:15,fontWeight:600,fontFamily:"'Poppins', Arial, sans-serif",cursor:n||r?"not-allowed":"pointer",transition:"background-color 0.15s",width:"100%",boxSizing:"border-box",letterSpacing:"0.01em"},children:[r&&oe.jsx("span",{style:{display:"inline-block",width:16,height:16,border:"2px solid rgba(255,255,255,0.4)",borderTopColor:"#fff",borderRadius:"50%",animation:"hrbench-spin 0.7s linear infinite"}}),i]})}function Ss({value:e,label:r,sublabel:n,accent:i=!1,large:o=!1}){return oe.jsxs("div",{style:{backgroundColor:"#FFFFFF",border:"1.5px solid #E2E2EA",borderRadius:12,borderTop:`4px solid ${i?"#7572FF":"#E2E2EA"}`,padding:"20px 24px 18px",display:"flex",flexDirection:"column",gap:4,flex:1,minWidth:0},children:[oe.jsx("div",{style:{fontSize:o?40:28,fontWeight:700,color:"#1A1A29",fontFamily:"'Poppins', Arial, sans-serif",lineHeight:1.1,letterSpacing:"-0.02em"},children:e}),oe.jsx("div",{style:{fontSize:13,fontWeight:600,color:"#1A1A29",fontFamily:"'Poppins', Arial, sans-serif",marginTop:4},children:r}),n&&oe.jsx("div",{style:{fontSize:12,color:"#56557E",fontFamily:"'Poppins', Arial, sans-serif",lineHeight:1.4,marginTop:2},children:n})]})}const Ah="50111797",dh="//js.hsforms.net/forms/embed/v2.js";let au=!1,Mi=null;function fh(){return au?Promise.resolve():Mi||(Mi=new Promise((e,r)=>{const n=document.createElement("script");n.src=dh,n.async=!0,n.onload=()=>{au=!0,e()},n.onerror=()=>r(new Error("Failed to load HubSpot forms script")),document.head.appendChild(n)}),Mi)}async function hh({formId:e,targetId:r,getHiddenFields:n,onSubmitted:i}){if(await fh(),!window.hbspt)throw new Error("hbspt not available after script load");window.hbspt.forms.create({portalId:Ah,formId:e,target:`#${r}`,onFormSubmit:function(o){const c=n?n():{},u=o&&o[0]?o[0]:o instanceof Element?o:null;Object.entries(c).forEach(([f,d])=>{if(u){let l=u.querySelector(`input[name="${f}"]`);l||(l=document.createElement("input"),l.type="hidden",l.name=f,u.appendChild(l)),l.value=String(d)}})},onFormSubmitted:function(){i&&i()}})}function ph({formId:e,unlocked:r,onUnlock:n,getHiddenFields:i,children:o,headline:c="See How You Stack Up Against Industry Benchmarks",body:u="Enter your details to unlock your personalized benchmark comparison and download your results."}){const d=`hs-form-${it.useId().replace(/:/g,"")}`;return it.useEffect(()=>{r||!e||hh({formId:e,targetId:d,getHiddenFields:i,onSubmitted:n}).catch(l=>{console.warn("[HRBench] HubSpot form failed to load:",l.message)})},[]),oe.jsx("div",{style:{backgroundColor:"#F3D9FF",borderRadius:16,padding:"32px 36px",marginTop:32},children:r?oe.jsxs("div",{children:[oe.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:20},children:[oe.jsx("div",{style:{width:24,height:24,backgroundColor:"#7572FF",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:oe.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:oe.jsx("path",{d:"M2 6l3 3 5-5",stroke:"#fff",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}),oe.jsx("div",{style:{fontSize:15,fontWeight:700,color:"#1A1A29",fontFamily:"'Poppins', Arial, sans-serif"},children:"Your Benchmark Comparison"})]}),o]}):oe.jsxs(oe.Fragment,{children:[oe.jsx("div",{style:{fontSize:18,fontWeight:700,color:"#1A1A29",fontFamily:"'Poppins', Arial, sans-serif",marginBottom:10,lineHeight:1.3},children:c}),oe.jsx("div",{style:{fontSize:14,color:"#56557E",fontFamily:"'Poppins', Arial, sans-serif",marginBottom:24,lineHeight:1.6},children:u}),oe.jsx("div",{id:d,style:{"--hs-input-border":"1.5px solid #E2E2EA","--hs-input-radius":"8px"}}),!e&&oe.jsx("button",{onClick:n,style:{padding:"12px 28px",backgroundColor:"#7572FF",color:"#FFFFFF",border:"none",borderRadius:8,fontSize:14,fontWeight:600,fontFamily:"'Poppins', Arial, sans-serif",cursor:"pointer",marginTop:8},children:"Unlock Results (Dev Mode)"})]})})}function gh({userValue:e,p25:r,p50:n,p75:i,label:o="Your Benchmark",unit:c,industry:u,companySizeBand:f}){const d=[e,r,n,i],l=Math.min(...d),h=Math.max(...d),g=(h-l)*.15||h*.1||1,w=l-g,b=h+g-w,y=C=>`${(C-w)/b*100}%`,k=C=>c==="currency"?`$${Number(C).toLocaleString(void 0,{maximumFractionDigits:0})}`:c==="percentage"?`${Number(C).toFixed(1)}%`:c==="days"?`${Number(C).toFixed(1)}d`:Number(C).toFixed(1);return oe.jsxs("div",{style:{padding:"24px 0 8px"},children:[oe.jsxs("div",{style:{fontSize:13,fontWeight:700,color:"#1A1A29",fontFamily:"'Poppins', Arial, sans-serif",marginBottom:6},children:[o," vs. Industry Benchmarks"]}),u&&oe.jsxs("div",{style:{fontSize:12,color:"#56557E",fontFamily:"'Poppins', Arial, sans-serif",marginBottom:20},children:[u," · ",f," employees"]}),oe.jsxs("div",{style:{position:"relative",height:56,marginBottom:28},children:[oe.jsx("div",{style:{position:"absolute",left:0,right:0,top:"50%",transform:"translateY(-50%)",height:8,backgroundColor:"#EFEFEF",borderRadius:4}}),oe.jsx("div",{style:{position:"absolute",left:y(r),width:`${(i-r)/b*100}%`,top:"50%",transform:"translateY(-50%)",height:8,backgroundColor:"#D2D1E8",borderRadius:2}}),oe.jsx("div",{style:{position:"absolute",left:y(n),transform:"translateX(-50%)",top:"50%",marginTop:-10,width:2,height:20,backgroundColor:"#56557E",borderRadius:1}}),oe.jsx("div",{style:{position:"absolute",left:y(e),transform:"translateX(-50%)",top:"50%",marginTop:-10,width:20,height:20,backgroundColor:"#7572FF",borderRadius:"50%",boxShadow:"0 2px 6px rgba(117,114,255,0.45)",zIndex:2}}),oe.jsxs("div",{style:{position:"absolute",left:y(e),transform:"translateX(-50%)",top:0,fontSize:11,fontWeight:700,color:"#7572FF",fontFamily:"'Poppins', Arial, sans-serif",whiteSpace:"nowrap"},children:["You · ",k(e)]})]}),oe.jsx("div",{style:{position:"relative",height:32},children:[{v:r,lbl:"P25"},{v:n,lbl:"P50"},{v:i,lbl:"P75"}].map(({v:C,lbl:E})=>oe.jsxs("div",{style:{position:"absolute",left:y(C),transform:"translateX(-50%)",textAlign:"center",fontSize:11,color:"#56557E",fontFamily:"'Poppins', Arial, sans-serif"},children:[oe.jsx("div",{style:{fontWeight:600},children:E}),oe.jsx("div",{children:k(C)})]},E))})]})}function mh({onClick:e,loading:r=!1,children:n="Export as PowerPoint"}){const[i,o]=Ii.useState(!1);return oe.jsxs("button",{onClick:e,disabled:r,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,height:44,padding:"0 24px",backgroundColor:r?"#D2D1E8":i?"#e05a44":"#FF6F57",color:"#FFFFFF",border:"none",borderRadius:8,fontSize:14,fontWeight:600,fontFamily:"'Poppins', Arial, sans-serif",cursor:r?"not-allowed":"pointer",transition:"background-color 0.15s",letterSpacing:"0.01em"},children:[oe.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:[oe.jsx("rect",{x:"1",y:"2",width:"14",height:"10",rx:"1.5",stroke:"white",strokeWidth:"1.5"}),oe.jsx("path",{d:"M5 14h6",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),oe.jsx("path",{d:"M8 12v2",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"})]}),r?"Generating…":n]})}function zi(e,r){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&r.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(e);oe?(...r)=>e(...r):(...r)=>fetch(...r);class Es extends Error{constructor(r,n="FunctionsError",i){super(r),this.name=n,this.context=i}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class wh extends Es{constructor(r){super("Failed to send a request to the Edge Function","FunctionsFetchError",r)}}class iu extends Es{constructor(r){super("Relay Error invoking the Edge Function","FunctionsRelayError",r)}}class ou extends Es{constructor(r){super("Edge Function returned a non-2xx status code","FunctionsHttpError",r)}}var Ls;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(Ls||(Ls={}));class bh{constructor(r,{headers:n={},customFetch:i,region:o=Ls.Any}={}){this.url=r,this.headers=n,this.region=o,this.fetch=yh(i)}setAuth(r){this.headers.Authorization=`Bearer ${r}`}invoke(r){return vh(this,arguments,void 0,function*(n,i={}){var o;let c,u;try{const{headers:f,method:d,body:l,signal:h,timeout:g}=i;let w={},{region:v}=i;v||(v=this.region);const b=new URL(`${this.url}/${n}`);v&&v!=="any"&&(w["x-region"]=v,b.searchParams.set("forceFunctionRegion",v));let y;l&&(f&&!Object.prototype.hasOwnProperty.call(f,"Content-Type")||!f)?typeof Blob<"u"&&l instanceof Blob||l instanceof ArrayBuffer?(w["Content-Type"]="application/octet-stream",y=l):typeof l=="string"?(w["Content-Type"]="text/plain",y=l):typeof FormData<"u"&&l instanceof FormData?y=l:(w["Content-Type"]="application/json",y=JSON.stringify(l)):l&&typeof l!="string"&&!(typeof Blob<"u"&&l instanceof Blob)&&!(l instanceof ArrayBuffer)&&!(typeof FormData<"u"&&l instanceof FormData)?y=JSON.stringify(l):y=l;let k=h;g&&(u=new AbortController,c=setTimeout(()=>u.abort(),g),h?(k=u.signal,h.addEventListener("abort",()=>u.abort())):k=u.signal);const C=yield this.fetch(b.toString(),{method:d||"POST",headers:Object.assign(Object.assign(Object.assign({},w),this.headers),f),body:y,signal:k}).catch(I=>{throw new wh(I)}),E=C.headers.get("x-relay-error");if(E&&E==="true")throw new iu(C);if(!C.ok)throw new ou(C);let _=((o=C.headers.get("Content-Type"))!==null&&o!==void 0?o:"text/plain").split(";")[0].trim(),N;return _==="application/json"?N=yield C.json():_==="application/octet-stream"||_==="application/pdf"?N=yield C.blob():_==="text/event-stream"?N=C:_==="multipart/form-data"?N=yield C.formData():N=yield C.text(),{data:N,error:null,response:C}}catch(f){return{data:null,error:f,response:f instanceof ou||f instanceof iu?f.context:void 0}}finally{c&&clearTimeout(c)}})}}const su=3,lu=e=>Math.min(1e3*2**e,3e4),Ch=[520,503],cu=["GET","HEAD","OPTIONS"];var xh=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function uu(e,r){return new Promise(n=>{if(r!=null&&r.aborted){n();return}const i=setTimeout(()=>{r==null||r.removeEventListener("abort",o),n()},e);function o(){clearTimeout(i),n()}r==null||r.addEventListener("abort",o)})}function kh(e,r,n,i){return!(!i||n>=su||!cu.includes(e)||!Ch.includes(r))}var Sh=class{constructor(e){var r,n,i,o,c;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(r=e.shouldThrowOnError)!==null&&r!==void 0?r:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,this.shouldStripNulls=(i=e.shouldStripNulls)!==null&&i!==void 0?i:!1,this.urlLengthLimit=(o=e.urlLengthLimit)!==null&&o!==void 0?o:8e3,this.retryEnabled=(c=e.retry)!==null&&c!==void 0?c:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,r){return this.headers=new Headers(this.headers),this.headers.set(e,r),this}retry(e){return this.retryEnabled=e,this}then(e,r){var n=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const u=this.headers.get("Accept");u==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!u||u==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const i=this.fetch;let c=(async()=>{let u=0;for(;;){const l=new Headers(n.headers);u>0&&l.set("X-Retry-Count",String(u));let h;try{h=await i(n.url.toString(),{method:n.method,headers:l,body:JSON.stringify(n.body,(g,w)=>typeof w=="bigint"?w.toString():w),signal:n.signal})}catch(g){if((g==null?void 0:g.name)==="AbortError"||(g==null?void 0:g.code)==="ABORT_ERR"||!cu.includes(n.method))throw g;if(n.retryEnabled&&u{var f;let d="",l="",h="";const g=u==null?void 0:u.cause;if(g){var w,v,b,y;const E=(w=g==null?void 0:g.message)!==null&&w!==void 0?w:"",_=(v=g==null?void 0:g.code)!==null&&v!==void 0?v:"";d=`${(b=u==null?void 0:u.name)!==null&&b!==void 0?b:"FetchError"}: ${u==null?void 0:u.message}`,d+=` Caused by: ${(y=g==null?void 0:g.name)!==null&&y!==void 0?y:"Error"}: ${E}`,_&&(d+=` (${_})`),g!=null&&g.stack&&(d+=` ${g.stack}`)}else{var k;d=(k=u==null?void 0:u.stack)!==null&&k!==void 0?k:""}const C=this.url.toString().length;return(u==null?void 0:u.name)==="AbortError"||(u==null?void 0:u.code)==="ABORT_ERR"?(h="",l="Request was aborted (timeout or manual cancellation)",C>this.urlLengthLimit&&(l+=`. Note: Your request URL is ${C} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((g==null?void 0:g.name)==="HeadersOverflowError"||(g==null?void 0:g.code)==="UND_ERR_HEADERS_OVERFLOW")&&(h="",l="HTTP headers exceeded server limits (typically 16KB)",C>this.urlLengthLimit&&(l+=`. Your request URL is ${C} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(f=u==null?void 0:u.name)!==null&&f!==void 0?f:"FetchError"}: ${u==null?void 0:u.message}`,details:d,hint:l,code:h},data:null,count:null,status:0,statusText:""}})),c.then(e,r)}async processResponse(e){var r=this;let n=null,i=null,o=null,c=e.status,u=e.statusText;if(e.ok){var f,d;if(r.method!=="HEAD"){var l;const w=await e.text();w===""||(r.headers.get("Accept")==="text/csv"||r.headers.get("Accept")&&(!((l=r.headers.get("Accept"))===null||l===void 0)&&l.includes("application/vnd.pgrst.plan+text"))?i=w:i=JSON.parse(w))}const h=(f=r.headers.get("Prefer"))===null||f===void 0?void 0:f.match(/count=(exact|planned|estimated)/),g=(d=e.headers.get("content-range"))===null||d===void 0?void 0:d.split("/");h&&g&&g.length>1&&(o=parseInt(g[1])),r.isMaybeSingle&&Array.isArray(i)&&(i.length>1?(n={code:"PGRST116",details:`Results contain ${i.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},i=null,o=null,c=406,u="Not Acceptable"):i.length===1?i=i[0]:i=null)}else{const h=await e.text();try{n=JSON.parse(h),Array.isArray(n)&&e.status===404&&(i=[],n=null,c=200,u="OK")}catch{e.status===404&&h===""?(c=204,u="No Content"):n={message:h}}if(n&&r.shouldThrowOnError)throw new xh(n)}return{success:n===null,error:n,data:i,count:o,status:c,statusText:u}}returns(){return this}overrideTypes(){return this}},Eh=class extends Sh{select(e){let r=!1;const n=(e??"*").split("").map(i=>/\s/.test(i)&&!r?"":(i==='"'&&(r=!r),i)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:r=!0,nullsFirst:n,foreignTable:i,referencedTable:o=i}={}){const c=o?`${o}.order`:"order",u=this.url.searchParams.get(c);return this.url.searchParams.set(c,`${u?`${u},`:""}${e}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:r,referencedTable:n=r}={}){const i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this}range(e,r,{foreignTable:n,referencedTable:i=n}={}){const o=typeof i>"u"?"offset":`${i}.offset`,c=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(c,`${r-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:r=!1,settings:n=!1,buffers:i=!1,wal:o=!1,format:c="text"}={}){var u;const f=[e?"analyze":null,r?"verbose":null,n?"settings":null,i?"buffers":null,o?"wal":null].filter(Boolean).join("|"),d=(u=this.headers.get("Accept"))!==null&&u!==void 0?u:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${c}; for="${d}"; options=${f};`),c==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const Au=new RegExp("[,()]");var Mn=class extends Eh{eq(e,r){return this.url.searchParams.append(e,`eq.${r}`),this}neq(e,r){return this.url.searchParams.append(e,`neq.${r}`),this}gt(e,r){return this.url.searchParams.append(e,`gt.${r}`),this}gte(e,r){return this.url.searchParams.append(e,`gte.${r}`),this}lt(e,r){return this.url.searchParams.append(e,`lt.${r}`),this}lte(e,r){return this.url.searchParams.append(e,`lte.${r}`),this}like(e,r){return this.url.searchParams.append(e,`like.${r}`),this}likeAllOf(e,r){return this.url.searchParams.append(e,`like(all).{${r.join(",")}}`),this}likeAnyOf(e,r){return this.url.searchParams.append(e,`like(any).{${r.join(",")}}`),this}ilike(e,r){return this.url.searchParams.append(e,`ilike.${r}`),this}ilikeAllOf(e,r){return this.url.searchParams.append(e,`ilike(all).{${r.join(",")}}`),this}ilikeAnyOf(e,r){return this.url.searchParams.append(e,`ilike(any).{${r.join(",")}}`),this}regexMatch(e,r){return this.url.searchParams.append(e,`match.${r}`),this}regexIMatch(e,r){return this.url.searchParams.append(e,`imatch.${r}`),this}is(e,r){return this.url.searchParams.append(e,`is.${r}`),this}isDistinct(e,r){return this.url.searchParams.append(e,`isdistinct.${r}`),this}in(e,r){const n=Array.from(new Set(r)).map(i=>typeof i=="string"&&Au.test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,r){const n=Array.from(new Set(r)).map(i=>typeof i=="string"&&Au.test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cs.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cs.{${r.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(r)}`),this}containedBy(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cd.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cd.{${r.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(r)}`),this}rangeGt(e,r){return this.url.searchParams.append(e,`sr.${r}`),this}rangeGte(e,r){return this.url.searchParams.append(e,`nxl.${r}`),this}rangeLt(e,r){return this.url.searchParams.append(e,`sl.${r}`),this}rangeLte(e,r){return this.url.searchParams.append(e,`nxr.${r}`),this}rangeAdjacent(e,r){return this.url.searchParams.append(e,`adj.${r}`),this}overlaps(e,r){return typeof r=="string"?this.url.searchParams.append(e,`ov.${r}`):this.url.searchParams.append(e,`ov.{${r.join(",")}}`),this}textSearch(e,r,{config:n,type:i}={}){let o="";i==="plain"?o="pl":i==="phrase"?o="ph":i==="websearch"&&(o="w");const c=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${o}fts${c}.${r}`),this}match(e){return Object.entries(e).filter(([r,n])=>n!==void 0).forEach(([r,n])=>{this.url.searchParams.append(r,`eq.${n}`)}),this}not(e,r,n){return this.url.searchParams.append(e,`not.${r}.${n}`),this}or(e,{foreignTable:r,referencedTable:n=r}={}){const i=n?`${n}.or`:"or";return this.url.searchParams.append(i,`(${e})`),this}filter(e,r,n){return this.url.searchParams.append(e,`${r}.${n}`),this}},Lh=class{constructor(e,{headers:r={},schema:n,fetch:i,urlLengthLimit:o=8e3,retry:c}){this.url=e,this.headers=new Headers(r),this.schema=n,this.fetch=i,this.urlLengthLimit=o,this.retry=c}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,r){const{head:n=!1,count:i}=r??{},o=n?"HEAD":"GET";let c=!1;const u=(e??"*").split("").map(l=>/\s/.test(l)&&!c?"":(l==='"'&&(c=!c),l)).join(""),{url:f,headers:d}=this.cloneRequestState();return f.searchParams.set("select",u),i&&d.append("Prefer",`count=${i}`),new Mn({method:o,url:f,headers:d,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:r,defaultToNull:n=!0}={}){var i;const o="POST",{url:c,headers:u}=this.cloneRequestState();if(r&&u.append("Prefer",`count=${r}`),n||u.append("Prefer","missing=default"),Array.isArray(e)){const f=e.reduce((d,l)=>d.concat(Object.keys(l)),[]);if(f.length>0){const d=[...new Set(f)].map(l=>`"${l}"`);c.searchParams.set("columns",d.join(","))}}return new Mn({method:o,url:c,headers:u,schema:this.schema,body:e,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:r,ignoreDuplicates:n=!1,count:i,defaultToNull:o=!0}={}){var c;const u="POST",{url:f,headers:d}=this.cloneRequestState();if(d.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),r!==void 0&&f.searchParams.set("on_conflict",r),i&&d.append("Prefer",`count=${i}`),o||d.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((h,g)=>h.concat(Object.keys(g)),[]);if(l.length>0){const h=[...new Set(l)].map(g=>`"${g}"`);f.searchParams.set("columns",h.join(","))}}return new Mn({method:u,url:f,headers:d,schema:this.schema,body:e,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:r}={}){var n;const i="PATCH",{url:o,headers:c}=this.cloneRequestState();return r&&c.append("Prefer",`count=${r}`),new Mn({method:i,url:o,headers:c,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var r;const n="DELETE",{url:i,headers:o}=this.cloneRequestState();return e&&o.append("Prefer",`count=${e}`),new Mn({method:n,url:i,headers:o,schema:this.schema,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function _a(e){"@babel/helpers - typeof";return _a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_a(e)}function Ph(e,r){if(_a(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(_a(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function _h(e){var r=Ph(e,"string");return _a(r)=="symbol"?r:r+""}function Bh(e,r,n){return(r=_h(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function du(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,i)}return n}function Ui(e){for(var r=1;r0?this.fetch=(l,h)=>{const g=new AbortController,w=setTimeout(()=>g.abort(),c),v=h==null?void 0:h.signal;if(v){if(v.aborted)return clearTimeout(w),d(l,h);const b=()=>{clearTimeout(w),g.abort()};return v.addEventListener("abort",b,{once:!0}),d(l,Ui(Ui({},h),{},{signal:g.signal})).finally(()=>{clearTimeout(w),v.removeEventListener("abort",b)})}return d(l,Ui(Ui({},h),{},{signal:g.signal})).finally(()=>clearTimeout(w))}:this.fetch=d,this.retry=f}from(r){if(!r||typeof r!="string"||r.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new Lh(new URL(`${this.url}/${r}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(r){return new eh(this.url,{headers:this.headers,schema:r,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(r,n={},{head:i=!1,get:o=!1,count:c}={}){var u;let f;const d=new URL(`${this.url}/rpc/${r}`);let l;const h=v=>v!==null&&typeof v=="object"&&(!Array.isArray(v)||v.some(h)),g=i&&Object.values(n).some(h);g?(f="POST",l=n):i||o?(f=i?"HEAD":"GET",Object.entries(n).filter(([v,b])=>b!==void 0).map(([v,b])=>[v,Array.isArray(b)?`{${b.join(",")}}`:`${b}`]).forEach(([v,b])=>{d.searchParams.append(v,b)})):(f="POST",l=n);const w=new Headers(this.headers);return g?w.set("Prefer",c?`count=${c},return=minimal`:"return=minimal"):c&&w.set("Prefer",`count=${c}`),new Mn({method:f,url:d,headers:w,schema:this.schemaName,body:l,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class Rh{constructor(){}static detectEnvironment(){var r;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((r=navigator.userAgent)===null||r===void 0)&&r.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const n=globalThis.process;if(n){const i=n.versions;if(i&&i.node){const o=i.node,c=parseInt(o.replace(/^v/,"").split(".")[0]);return c>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${c} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${c} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: import ws from "ws" new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const r=this.detectEnvironment();if(r.constructor)return r.constructor;let n=r.error||"WebSocket not supported in this environment.";throw r.workaround&&(n+=` Suggested solution: ${r.workaround}`),new Error(n)}static isWebSocketSupported(){try{const r=this.detectEnvironment();return r.type==="native"||r.type==="ws"}catch{return!1}}}const Dh="realtime-js/2.103.2",Nh="1.0.0",fu="2.0.0",Fh=fu,Ih=1e4,Oh=100,Ur={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},hu={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Ps={connecting:"connecting",closing:"closing",closed:"closed"};class Mh{constructor(r){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=r??[]}encode(r,n){if(r.event===this.BROADCAST_EVENT&&!(r.payload instanceof ArrayBuffer)&&typeof r.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(r));let i=[r.join_ref,r.ref,r.topic,r.event,r.payload];return n(JSON.stringify(i))}_binaryEncodeUserBroadcastPush(r){var n;return this._isArrayBuffer((n=r.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(r):this._encodeJsonUserBroadcastPush(r)}_encodeBinaryUserBroadcastPush(r){var n,i;const o=(i=(n=r.payload)===null||n===void 0?void 0:n.payload)!==null&&i!==void 0?i:new ArrayBuffer(0);return this._encodeUserBroadcastPush(r,this.BINARY_ENCODING,o)}_encodeJsonUserBroadcastPush(r){var n,i;const o=(i=(n=r.payload)===null||n===void 0?void 0:n.payload)!==null&&i!==void 0?i:{},u=new TextEncoder().encode(JSON.stringify(o)).buffer;return this._encodeUserBroadcastPush(r,this.JSON_ENCODING,u)}_encodeUserBroadcastPush(r,n,i){var o,c;const u=r.topic,f=(o=r.ref)!==null&&o!==void 0?o:"",d=(c=r.join_ref)!==null&&c!==void 0?c:"",l=r.payload.event,h=this.allowedMetadataKeys?this._pick(r.payload,this.allowedMetadataKeys):{},g=Object.keys(h).length===0?"":JSON.stringify(h);if(d.length>255)throw new Error(`joinRef length ${d.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`ref length ${f.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`topic length ${u.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`userEvent length ${l.length} exceeds maximum of 255`);if(g.length>255)throw new Error(`metadata length ${g.length} exceeds maximum of 255`);const w=this.USER_BROADCAST_PUSH_META_LENGTH+d.length+f.length+u.length+l.length+g.length,v=new ArrayBuffer(this.HEADER_LENGTH+w);let b=new DataView(v),y=0;b.setUint8(y++,this.KINDS.userBroadcastPush),b.setUint8(y++,d.length),b.setUint8(y++,f.length),b.setUint8(y++,u.length),b.setUint8(y++,l.length),b.setUint8(y++,g.length),b.setUint8(y++,n),Array.from(d,C=>b.setUint8(y++,C.charCodeAt(0))),Array.from(f,C=>b.setUint8(y++,C.charCodeAt(0))),Array.from(u,C=>b.setUint8(y++,C.charCodeAt(0))),Array.from(l,C=>b.setUint8(y++,C.charCodeAt(0))),Array.from(g,C=>b.setUint8(y++,C.charCodeAt(0)));var k=new Uint8Array(v.byteLength+i.byteLength);return k.set(new Uint8Array(v),0),k.set(new Uint8Array(i),v.byteLength),k.buffer}decode(r,n){if(this._isArrayBuffer(r)){let i=this._binaryDecode(r);return n(i)}if(typeof r=="string"){const i=JSON.parse(r),[o,c,u,f,d]=i;return n({join_ref:o,ref:c,topic:u,event:f,payload:d})}return n({})}_binaryDecode(r){const n=new DataView(r),i=n.getUint8(0),o=new TextDecoder;switch(i){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(r,n,o)}}_decodeUserBroadcast(r,n,i){const o=n.getUint8(1),c=n.getUint8(2),u=n.getUint8(3),f=n.getUint8(4);let d=this.HEADER_LENGTH+4;const l=i.decode(r.slice(d,d+o));d=d+o;const h=i.decode(r.slice(d,d+c));d=d+c;const g=i.decode(r.slice(d,d+u));d=d+u;const w=r.slice(d,r.byteLength),v=f===this.JSON_ENCODING?JSON.parse(i.decode(w)):w,b={type:this.BROADCAST_EVENT,event:h,payload:v};return u>0&&(b.meta=JSON.parse(g)),{join_ref:null,ref:null,topic:l,event:this.BROADCAST_EVENT,payload:b}}_isArrayBuffer(r){var n;return r instanceof ArrayBuffer||((n=r==null?void 0:r.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(r,n){return!r||typeof r!="object"?{}:Object.fromEntries(Object.entries(r).filter(([i])=>n.includes(i)))}}var $e;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})($e||($e={}));const pu=(e,r,n={})=>{var i;const o=(i=n.skipTypes)!==null&&i!==void 0?i:[];return r?Object.keys(r).reduce((c,u)=>(c[u]=zh(u,e,r,o),c),{}):{}},zh=(e,r,n,i)=>{const o=r.find(f=>f.name===e),c=o==null?void 0:o.type,u=n[e];return c&&!i.includes(c)?gu(c,u):_s(u)},gu=(e,r)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return Gh(r,n)}switch(e){case $e.bool:return Uh(r);case $e.float4:case $e.float8:case $e.int2:case $e.int4:case $e.int8:case $e.numeric:case $e.oid:return jh(r);case $e.json:case $e.jsonb:return Xh(r);case $e.timestamp:return Qh(r);case $e.abstime:case $e.date:case $e.daterange:case $e.int4range:case $e.int8range:case $e.money:case $e.reltime:case $e.text:case $e.time:case $e.timestamptz:case $e.timetz:case $e.tsrange:case $e.tstzrange:return _s(r);default:return _s(r)}},_s=e=>e,Uh=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},jh=e=>{if(typeof e=="string"){const r=parseFloat(e);if(!Number.isNaN(r))return r}return e},Xh=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},Gh=(e,r)=>{if(typeof e!="string")return e;const n=e.length-1,i=e[n];if(e[0]==="{"&&i==="}"){let c;const u=e.slice(1,n);try{c=JSON.parse("["+u+"]")}catch{c=u?u.split(","):[]}return c.map(f=>gu(r,f))}return e},Qh=e=>typeof e=="string"?e.replace(" ","T"):e,mu=e=>{const r=new URL(e);return r.protocol=r.protocol.replace(/^ws/i,"http"),r.pathname=r.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),r.pathname===""||r.pathname==="/"?r.pathname="/api/broadcast":r.pathname=r.pathname+"/api/broadcast",r.href};var Ba=e=>typeof e=="function"?e:function(){return e},Wh=typeof self<"u"?self:null,zn=typeof window<"u"?window:null,gr=Wh||zn||globalThis,Vh="2.0.0",Hh=1e4,qh=1e3,mr={connecting:0,open:1,closing:2,closed:3},Ft={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Er={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Bs={longpoll:"longpoll",websocket:"websocket"},Jh={complete:4},Ts="base64url.bearer.phx.",ji=class{constructor(e,r,n,i){this.channel=e,this.event=r,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=i,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,r){return this.hasReceived(e)&&r(this.receivedResp.response),this.recHooks.push({status:e,callback:r}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:r,_ref:n}){this.recHooks.filter(i=>i.status===e).forEach(i=>i.callback(r))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,r){this.channel.trigger(this.refEvent,{status:e,response:r})}},vu=class{constructor(e,r){this.callback=e,this.timerCalc=r,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},Yh=class{constructor(e,r,n){this.state=Ft.closed,this.topic=e,this.params=Ba(r||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new ji(this,Er.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new vu(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Ft.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(i=>i.send()),this.pushBuffer=[]}),this.joinPush.receive("error",i=>{this.state=Ft.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,i),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Ft.closed,this.socket.remove(this)}),this.onError(i=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,i),this.isJoining()&&this.joinPush.reset(),this.state=Ft.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new ji(this,Er.leave,Ba({}),this.timeout).send(),this.state=Ft.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Er.reply,(i,o)=>{this.trigger(this.replyEventName(o),i)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Ft.closed,this.bindings=[]}onClose(e){this.on(Er.close,e)}onError(e){return this.on(Er.error,r=>e(r))}on(e,r){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:r}),n}off(e,r){this.bindings=this.bindings.filter(n=>!(n.event===e&&(typeof r>"u"||r===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,r,n=this.timeout){if(r=r||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let i=new ji(this,e,function(){return r},n);return this.canPush()?i.send():(i.startTimeout(),this.pushBuffer.push(i)),i}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Ft.leaving;let r=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Er.close,"leave")},n=new ji(this,Er.leave,Ba({}),e);return n.receive("ok",()=>r()).receive("timeout",()=>r()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,r,n){return r}filterBindings(e,r,n){return!0}isMember(e,r,n,i){return this.topic!==e?!1:i&&i!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:r,payload:n,joinRef:i}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Ft.joining,this.joinPush.resend(e))}trigger(e,r,n,i){let o=this.onMessage(e,r,n,i);if(r&&!o)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let c=this.bindings.filter(u=>u.event===e&&this.filterBindings(u,r,n));for(let u=0;ud.abort(),o),f.signal=d.signal),gr.fetch(r,f).then(l=>l.text()).then(l=>this.parseJSON(l)).then(l=>u&&u(l)).catch(l=>{l.name==="AbortError"&&c?c():u&&u(null)}),d}static xdomainRequest(e,r,n,i,o,c,u){return e.timeout=o,e.open(r,n),e.onload=()=>{let f=this.parseJSON(e.responseText);u&&u(f)},c&&(e.ontimeout=c),e.onprogress=()=>{},e.send(i),e}static xhrRequest(e,r,n,i,o,c,u,f){e.open(r,n,!0),e.timeout=c;for(let[d,l]of Object.entries(i))e.setRequestHeader(d,l);return e.onerror=()=>f&&f(null),e.onreadystatechange=()=>{if(e.readyState===Jh.complete&&f){let d=this.parseJSON(e.responseText);f(d)}},u&&(e.ontimeout=u),e.send(o),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,r){let n=[];for(var i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let o=r?`${r}[${i}]`:i,c=e[i];typeof c=="object"?n.push(this.serialize(c,o)):n.push(encodeURIComponent(o)+"="+encodeURIComponent(c))}return n.join("&")}static appendParams(e,r){if(Object.keys(r).length===0)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(r)}`}},Kh=e=>{let r="",n=new Uint8Array(e),i=n.byteLength;for(let o=0;othis.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Bs.websocket),"$1/"+Bs.longpoll)}endpointURL(){return Xi.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,r,n){this.close(e,r,n),this.readyState=mr.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===mr.open||this.readyState===mr.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),r=>{if(r){var{status:n,token:i,messages:o}=r;if(n===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=i}else n=0;switch(n){case 200:o.forEach(c=>{setTimeout(()=>this.onmessage({data:c}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=mr.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${n}`)}})}send(e){typeof e!="string"&&(e=Kh(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(` `),()=>this.onerror("timeout"),r=>{this.awaitingBatchAck=!1,!r||r.status!==200?(this.onerror(r&&r.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,r,n){for(let o of this.reqs)o.abort();this.readyState=mr.closed;let i=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:r,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",i)):this.onclose(i)}ajax(e,r,n,i,o){let c,u=()=>{this.reqs.delete(c),i()};c=Xi.request(e,this.endpointURL(),r,n,this.timeout,u,f=>{this.reqs.delete(c),this.isActive()&&o(f)}),this.reqs.add(c)}},Zh=class Ni{constructor(r,n={}){let i=n.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=r,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(i.state,o=>{let{onJoin:c,onLeave:u,onSync:f}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Ni.syncState(this.state,o,c,u),this.pendingDiffs.forEach(d=>{this.state=Ni.syncDiff(this.state,d,c,u)}),this.pendingDiffs=[],f()}),this.channel.on(i.diff,o=>{let{onJoin:c,onLeave:u,onSync:f}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=Ni.syncDiff(this.state,o,c,u),f())})}onJoin(r){this.caller.onJoin=r}onLeave(r){this.caller.onLeave=r}onSync(r){this.caller.onSync=r}list(r){return Ni.list(this.state,r)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(r,n,i,o){let c=this.clone(r),u={},f={};return this.map(c,(d,l)=>{n[d]||(f[d]=l)}),this.map(n,(d,l)=>{let h=c[d];if(h){let g=l.metas.map(y=>y.phx_ref),w=h.metas.map(y=>y.phx_ref),v=l.metas.filter(y=>w.indexOf(y.phx_ref)<0),b=h.metas.filter(y=>g.indexOf(y.phx_ref)<0);v.length>0&&(u[d]=l,u[d].metas=v),b.length>0&&(f[d]=this.clone(h),f[d].metas=b)}else u[d]=l}),this.syncDiff(c,{joins:u,leaves:f},i,o)}static syncDiff(r,n,i,o){let{joins:c,leaves:u}=this.clone(n);return i||(i=function(){}),o||(o=function(){}),this.map(c,(f,d)=>{let l=r[f];if(r[f]=this.clone(d),l){let h=r[f].metas.map(w=>w.phx_ref),g=l.metas.filter(w=>h.indexOf(w.phx_ref)<0);r[f].metas.unshift(...g)}i(f,l,d)}),this.map(u,(f,d)=>{let l=r[f];if(!l)return;let h=d.metas.map(g=>g.phx_ref);l.metas=l.metas.filter(g=>h.indexOf(g.phx_ref)<0),o(f,l,d),l.metas.length===0&&delete r[f]}),r}static list(r,n){return n||(n=function(i,o){return o}),this.map(r,(i,o)=>n(i,o))}static map(r,n){return Object.getOwnPropertyNames(r).map(i=>n(i,r[i]))}static clone(r){return JSON.parse(JSON.stringify(r))}},Gi={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,r){if(e.payload.constructor===ArrayBuffer)return r(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return r(JSON.stringify(n))}},decode(e,r){if(e.constructor===ArrayBuffer)return r(this.binaryDecode(e));{let[n,i,o,c,u]=JSON.parse(e);return r({join_ref:n,ref:i,topic:o,event:c,payload:u})}},binaryEncode(e){let{join_ref:r,ref:n,event:i,topic:o,payload:c}=e,u=this.META_LENGTH+r.length+n.length+o.length+i.length,f=new ArrayBuffer(this.HEADER_LENGTH+u),d=new DataView(f),l=0;d.setUint8(l++,this.KINDS.push),d.setUint8(l++,r.length),d.setUint8(l++,n.length),d.setUint8(l++,o.length),d.setUint8(l++,i.length),Array.from(r,g=>d.setUint8(l++,g.charCodeAt(0))),Array.from(n,g=>d.setUint8(l++,g.charCodeAt(0))),Array.from(o,g=>d.setUint8(l++,g.charCodeAt(0))),Array.from(i,g=>d.setUint8(l++,g.charCodeAt(0)));var h=new Uint8Array(f.byteLength+c.byteLength);return h.set(new Uint8Array(f),0),h.set(new Uint8Array(c),f.byteLength),h.buffer},binaryDecode(e){let r=new DataView(e),n=r.getUint8(0),i=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,r,i);case this.KINDS.reply:return this.decodeReply(e,r,i);case this.KINDS.broadcast:return this.decodeBroadcast(e,r,i)}},decodePush(e,r,n){let i=r.getUint8(1),o=r.getUint8(2),c=r.getUint8(3),u=this.HEADER_LENGTH+this.META_LENGTH-1,f=n.decode(e.slice(u,u+i));u=u+i;let d=n.decode(e.slice(u,u+o));u=u+o;let l=n.decode(e.slice(u,u+c));u=u+c;let h=e.slice(u,e.byteLength);return{join_ref:f,ref:null,topic:d,event:l,payload:h}},decodeReply(e,r,n){let i=r.getUint8(1),o=r.getUint8(2),c=r.getUint8(3),u=r.getUint8(4),f=this.HEADER_LENGTH+this.META_LENGTH,d=n.decode(e.slice(f,f+i));f=f+i;let l=n.decode(e.slice(f,f+o));f=f+o;let h=n.decode(e.slice(f,f+c));f=f+c;let g=n.decode(e.slice(f,f+u));f=f+u;let w=e.slice(f,e.byteLength),v={status:g,response:w};return{join_ref:d,ref:l,topic:h,event:Er.reply,payload:v}},decodeBroadcast(e,r,n){let i=r.getUint8(1),o=r.getUint8(2),c=this.HEADER_LENGTH+2,u=n.decode(e.slice(c,c+i));c=c+i;let f=n.decode(e.slice(c,c+o));c=c+o;let d=e.slice(c,e.byteLength);return{join_ref:null,ref:null,topic:u,event:f,payload:d}}},$h=class{constructor(e,r={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=r.timeout||Hh,this.transport=r.transport||gr.WebSocket||Un,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=r.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=r.sessionStorage||gr&&gr.sessionStorage,this.establishedConnections=0,this.defaultEncoder=Gi.encode.bind(Gi),this.defaultDecoder=Gi.decode.bind(Gi),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=r.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Un?(this.encode=r.encode||this.defaultEncoder,this.decode=r.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;zn&&zn.addEventListener&&(zn.addEventListener("pagehide",i=>{this.conn&&(this.disconnect(),n=this.connectClock)}),zn.addEventListener("pageshow",i=>{n===this.connectClock&&(n=null,this.connect())}),zn.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=r.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=r.autoSendHeartbeat??!0,this.heartbeatCallback=r.heartbeatCallback??(()=>{}),this.rejoinAfterMs=i=>r.rejoinAfterMs?r.rejoinAfterMs(i):[1e3,2e3,5e3][i-1]||1e4,this.reconnectAfterMs=i=>r.reconnectAfterMs?r.reconnectAfterMs(i):[10,50,100,150,200,250,500,1e3,2e3][i-1]||5e3,this.logger=r.logger||null,!this.logger&&r.debug&&(this.logger=(i,o,c)=>{console.log(`${i}: ${o}`,c)}),this.longpollerTimeout=r.longpollerTimeout||2e4,this.params=Ba(r.params||{}),this.endPoint=`${e}/${Bs.websocket}`,this.vsn=r.vsn||Vh,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new vu(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{r.beforeReconnect&&await r.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=r.authToken}getLongPollTransport(){return Un}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=Xi.appendParams(Xi.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,r,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},r,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Ba(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Un?this.connectWithFallback(Un,this.longPollFallbackMs):this.transportConnect())}log(e,r,n){this.logger&&this.logger(e,r,n)}hasLogger(){return this.logger!==null}onOpen(e){let r=this.makeRef();return this.stateChangeCallbacks.open.push([r,e]),r}onClose(e){let r=this.makeRef();return this.stateChangeCallbacks.close.push([r,e]),r}onError(e){let r=this.makeRef();return this.stateChangeCallbacks.error.push([r,e]),r}onMessage(e){let r=this.makeRef();return this.stateChangeCallbacks.message.push([r,e]),r}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let r=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:r});let i=this.onMessage(o=>{o.ref===r&&(this.off([i]),e(Date.now()-n))});return!0}transportName(e){switch(e){case Un:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${Ts}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=r=>this.onConnError(r),this.conn.onmessage=r=>this.onConnMessage(r),this.conn.onclose=r=>this.onConnClose(r)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,r){this.sessionStore&&this.sessionStore.setItem(e,r)}connectWithFallback(e,r=2500){clearTimeout(this.fallbackTimer);let n=!1,i=!0,o,c,u=this.transportName(e),f=d=>{this.log("transport",`falling back to ${u}...`,d),this.off([o,c]),i=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${u}`))return f("memorized");this.fallbackTimer=setTimeout(f,r),c=this.onError(d=>{this.log("transport","error",d),i&&!n&&(clearTimeout(this.fallbackTimer),f(d))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!i){let d=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${d}`,"true"),this.log("transport",`established ${d} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(f,r),this.ping(d=>{this.log("transport","connected to primary after",d),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),qh,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,r,n){if(!this.conn)return e&&e();const i=this.conn;this.waitForBufferDone(i,()=>{r?i.close(r,n||""):i.close(),this.waitForSocketClosed(i,()=>{this.conn===i&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,r,n=1){if(n===5||!e.bufferedAmount){r();return}setTimeout(()=>{this.waitForBufferDone(e,r,n+1)},150*n)}waitForSocketClosed(e,r,n=1){if(n===5||e.readyState===mr.closed){r();return}setTimeout(()=>{this.waitForSocketClosed(e,r,n+1)},150*n)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport",e);let r=this.transport,n=this.establishedConnections;this.triggerStateCallbacks("error",e,r,n),(r===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(Er.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case mr.connecting:return"connecting";case mr.open:return"open";case mr.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(r=>r!==e)}off(e){for(let r in this.stateChangeCallbacks)this.stateChangeCallbacks[r]=this.stateChangeCallbacks[r].filter(([n])=>e.indexOf(n)===-1)}channel(e,r={}){let n=new Yh(e,r,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:r,event:n,payload:i,ref:o,join_ref:c}=e;this.log("push",`${r} ${n} (${c}, ${o})`,i)}this.isConnected()?this.encode(e,r=>this.conn.send(r)):this.sendBuffer.push(()=>this.encode(e,r=>this.conn.send(r)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,r=>{let{topic:n,event:i,payload:o,ref:c,join_ref:u}=r;if(c&&c===this.pendingHeartbeatRef){const f=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(o.status==="ok"?"ok":"error",f)}catch(d){this.log("error","error in heartbeat callback",d)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${o.status||""} ${n} ${i} ${c&&"("+c+")"||""}`.trim(),o);for(let f=0;f{try{i(...r)}catch(o){this.log("error",`error in ${e} callback`,o)}})}catch(n){this.log("error",`error triggering ${e} callbacks`,n)}}leaveOpenTopic(e){let r=this.channels.find(n=>n.topic===e&&(n.isJoined()||n.isJoining()));r&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),r.leave())}};class Ta{constructor(r,n){const i=tp(n);this.presence=new Zh(r.getChannel(),i),this.presence.onJoin((o,c,u)=>{const f=Ta.onJoinPayload(o,c,u);r.getChannel().trigger("presence",f)}),this.presence.onLeave((o,c,u)=>{const f=Ta.onLeavePayload(o,c,u);r.getChannel().trigger("presence",f)}),this.presence.onSync(()=>{r.getChannel().trigger("presence",{event:"sync"})})}get state(){return Ta.transformState(this.presence.state)}static transformState(r){return r=ep(r),Object.getOwnPropertyNames(r).reduce((n,i)=>{const o=r[i];return n[i]=Qi(o),n},{})}static onJoinPayload(r,n,i){const o=yu(n),c=Qi(i);return{event:"join",key:r,currentPresences:o,newPresences:c}}static onLeavePayload(r,n,i){const o=yu(n),c=Qi(i);return{event:"leave",key:r,currentPresences:o,leftPresences:c}}}function Qi(e){return e.metas.map(r=>(r.presence_ref=r.phx_ref,delete r.phx_ref,delete r.phx_ref_prev,r))}function ep(e){return JSON.parse(JSON.stringify(e))}function tp(e){return(e==null?void 0:e.events)&&{events:e.events}}function yu(e){return e!=null&&e.metas?Qi(e):[]}var wu;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(wu||(wu={}));class rp{get state(){return this.presenceAdapter.state}constructor(r,n){this.channel=r,this.presenceAdapter=new Ta(this.channel.channelAdapter,n)}}class np{constructor(r,n,i){const o=ap(i);this.channel=r.getSocket().channel(n,o),this.socket=r}get state(){return this.channel.state}set state(r){this.channel.state=r}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(r,n){return this.channel.on(r,n)}off(r,n){this.channel.off(r,n)}subscribe(r){return this.channel.join(r)}unsubscribe(r){return this.channel.leave(r)}teardown(){this.channel.teardown()}onClose(r){this.channel.onClose(r)}onError(r){return this.channel.onError(r)}push(r,n,i){let o;try{o=this.channel.push(r,n,i)}catch{throw`tried to push '${r}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`}if(this.channel.pushBuffer.length>Oh){const c=this.channel.pushBuffer.shift();c.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${c.event}`,c.payload())}return o}updateJoinPayload(r){const n=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},n),r)}canPush(){return this.socket.isConnected()&&this.state===Ur.joined}isJoined(){return this.state===Ur.joined}isJoining(){return this.state===Ur.joining}isClosed(){return this.state===Ur.closed}isLeaving(){return this.state===Ur.leaving}updateFilterBindings(r){this.channel.filterBindings=r}updatePayloadTransform(r){this.channel.onMessage=r}getChannel(){return this.channel}}function ap(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var bu;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(bu||(bu={}));var jn;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(jn||(jn={}));var Lr;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Lr||(Lr={}));class Ra{get state(){return this.channelAdapter.state}set state(r){this.channelAdapter.state=r}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(r,n={config:{}},i){var o,c;if(this.topic=r,this.params=n,this.socket=i,this.bindings={},this.subTopic=r.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.channelAdapter=new np(this.socket.socketAdapter,r,this.params),this.presence=new rp(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=mu(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((c=(o=this.params.config)===null||o===void 0?void 0:o.broadcast)===null||c===void 0)&&c.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(r,n=this.timeout){var i,o,c;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:u,presence:f,private:d}}=this.params,l=(o=(i=this.bindings.postgres_changes)===null||i===void 0?void 0:i.map(v=>v.filter))!==null&&o!==void 0?o:[],h=!!this.bindings[jn.PRESENCE]&&this.bindings[jn.PRESENCE].length>0||((c=this.params.config.presence)===null||c===void 0?void 0:c.enabled)===!0,g={},w={broadcast:u,presence:Object.assign(Object.assign({},f),{enabled:h}),postgres_changes:l,private:d};this.socket.accessTokenValue&&(g.access_token=this.socket.accessTokenValue),this._onError(v=>{r==null||r(Lr.CHANNEL_ERROR,v)}),this._onClose(()=>r==null?void 0:r(Lr.CLOSED)),this.updateJoinPayload(Object.assign({config:w},g)),this._updateFilterMessage(),this.channelAdapter.subscribe(n).receive("ok",async({postgres_changes:v})=>{if(this.socket._isManualToken()||this.socket.setAuth(),v===void 0){r==null||r(Lr.SUBSCRIBED);return}this._updatePostgresBindings(v,r)}).receive("error",v=>{this.state=Ur.errored,r==null||r(Lr.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(v).join(", ")||"error")))}).receive("timeout",()=>{r==null||r(Lr.TIMED_OUT)})}return this}_updatePostgresBindings(r,n){var i;const o=this.bindings.postgres_changes,c=(i=o==null?void 0:o.length)!==null&&i!==void 0?i:0,u=[];for(let f=0;f{var u,f,d;const l=this.channelAdapter.push(r.type,r,n.timeout||this.timeout);r.type==="broadcast"&&!(!((d=(f=(u=this.params)===null||u===void 0?void 0:u.config)===null||f===void 0?void 0:f.broadcast)===null||d===void 0)&&d.ack)&&c("ok"),l.receive("ok",()=>c("ok")),l.receive("error",()=>c("error")),l.receive("timeout",()=>c("timed out"))})}updateJoinPayload(r){this.channelAdapter.updateJoinPayload(r)}async unsubscribe(r=this.timeout){return new Promise(n=>{this.channelAdapter.unsubscribe(r).receive("ok",()=>n("ok")).receive("timeout",()=>n("timed out")).receive("error",()=>n("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(r,n,i){const o=new AbortController,c=setTimeout(()=>o.abort(),i),u=await this.socket.fetch(r,Object.assign(Object.assign({},n),{signal:o.signal}));return clearTimeout(c),u}_on(r,n,i){const o=r.toLocaleLowerCase(),c=this.channelAdapter.on(r,i),u={type:o,filter:n,callback:i,ref:c};return this.bindings[o]?this.bindings[o].push(u):this.bindings[o]=[u],this._updateFilterMessage(),this}_onClose(r){this.channelAdapter.onClose(r)}_onError(r){this.channelAdapter.onError(r)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((r,n,i)=>{var o,c,u,f,d,l,h;const g=r.event.toLocaleLowerCase();if(this._notThisChannelEvent(g,i))return!1;const w=(o=this.bindings[g])===null||o===void 0?void 0:o.find(v=>v.ref===r.ref);if(!w)return!0;if(["broadcast","presence","postgres_changes"].includes(g))if("id"in w){const v=w.id,b=(c=w.filter)===null||c===void 0?void 0:c.event;return v&&((u=n.ids)===null||u===void 0?void 0:u.includes(v))&&(b==="*"||(b==null?void 0:b.toLocaleLowerCase())===((f=n.data)===null||f===void 0?void 0:f.type.toLocaleLowerCase()))}else{const v=(l=(d=w==null?void 0:w.filter)===null||d===void 0?void 0:d.event)===null||l===void 0?void 0:l.toLocaleLowerCase();return v==="*"||v===((h=n==null?void 0:n.event)===null||h===void 0?void 0:h.toLocaleLowerCase())}else return w.type.toLocaleLowerCase()===g})}_notThisChannelEvent(r,n){const{close:i,error:o,leave:c,join:u}=hu;return n&&[i,o,c,u].includes(r)&&n!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((r,n,i)=>{if(typeof n=="object"&&"ids"in n){const o=n.data,{schema:c,table:u,commit_timestamp:f,type:d,errors:l}=o;return Object.assign(Object.assign({},{schema:c,table:u,commit_timestamp:f,eventType:d,new:{},old:{},errors:l}),this._getPayloadRecords(o))}return n})}copyBindings(r){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const n in r.bindings)for(const i of r.bindings[n])this._on(i.type,i.filter,i.callback)}static isFilterValueEqual(r,n){return(r??void 0)===(n??void 0)}_getPayloadRecords(r){const n={new:{},old:{}};return(r.type==="INSERT"||r.type==="UPDATE")&&(n.new=pu(r.columns,r.record)),(r.type==="UPDATE"||r.type==="DELETE")&&(n.old=pu(r.columns,r.old_record)),n}}class ip{constructor(r,n){this.socket=new $h(r,n)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(r){this.socket.heartbeatCallback=r}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(r,n,i,o=1e4){return new Promise(c=>{setTimeout(()=>c("timeout"),o),this.socket.disconnect(()=>{r(),c("ok")},n,i)})}push(r){this.socket.push(r)}log(r,n,i){this.socket.log(r,n,i)}makeRef(){return this.socket.makeRef()}onOpen(r){this.socket.onOpen(r)}onClose(r){this.socket.onClose(r)}onError(r){this.socket.onError(r)}onMessage(r){this.socket.onMessage(r)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Ps.connecting}isDisconnecting(){return this.socket.connectionState()==Ps.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const op={HEARTBEAT_INTERVAL:25e3},sp=[1e3,2e3,5e3,1e4],lp=1e4,cp=` addEventListener("message", (e) => { if (e.data.event === "start") { setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); } });`;class up{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(r,n){var i;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new Mh,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=c=>c?(...u)=>c(...u):(...u)=>fetch(...u),!(!((i=n==null?void 0:n.params)===null||i===void 0)&&i.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey;const o=this._initializeOptions(n);this.socketAdapter=new ip(r,o),this.httpEndpoint=mu(r),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(r){const n=r.message;throw n.includes("Node.js")?new Error(`${n} To use Realtime in Node.js, you need to provide a WebSocket implementation: Option 1: Use Node.js 22+ which has native WebSocket support Option 2: Install and provide the "ws" package: npm install ws import ws from "ws" const client = new RealtimeClient(url, { ...options, transport: ws })`):new Error(`WebSocket not available: ${n}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(r,n){return this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},r,n)}getChannels(){return this.channels}async removeChannel(r){const n=await r.unsubscribe();return n==="ok"&&r.teardown(),this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const r=this.channels.map(async i=>{const o=await i.unsubscribe();return i.teardown(),o}),n=await Promise.all(r);return this.disconnect(),n}log(r,n,i){this.socketAdapter.log(r,n,i)}connectionState(){return this.socketAdapter.connectionState()||Ps.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(r,n={config:{}}){const i=`realtime:${r}`,o=this.getChannels().find(c=>c.topic===i);if(o)return o;{const c=new Ra(`realtime:${r}`,n,this);return this.channels.push(c),c}}push(r){this.socketAdapter.push(r)}async setAuth(r=null){this._authPromise=this._performAuth(r);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(r){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(r)}_makeRef(){return this.socketAdapter.makeRef()}_remove(r){this.channels=this.channels.filter(n=>n.topic!==r.topic)}async _performAuth(r=null){let n,i=!1;if(r)n=r,i=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(o){this.log("error","Error fetching access token from callback",o),n=this.accessTokenValue}else n=this.accessTokenValue;i?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(o=>{const c={access_token:n,version:Dh};n&&o.updateJoinPayload(c),o.joinedOnce&&o.channelAdapter.isJoined()&&o.channelAdapter.push(hu.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(r="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${r}`,n)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(n=>{this.log("error","error waiting for auth on connect",n)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(r=>{r.ref&&r.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(r){return(n,i)=>{n=="sent"&&this._setAuthSafely(),r&&r(n,i)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const r=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(r),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(r){let n;if(r)n=r;else{const i=new Blob([cp],{type:"application/javascript"});n=URL.createObjectURL(i)}return n}_initializeOptions(r){var n,i,o,c,u,f,d,l,h;this.worker=(n=r==null?void 0:r.worker)!==null&&n!==void 0?n:!1,this.accessToken=(i=r==null?void 0:r.accessToken)!==null&&i!==void 0?i:null;const g={};g.timeout=(o=r==null?void 0:r.timeout)!==null&&o!==void 0?o:Ih,g.heartbeatIntervalMs=(c=r==null?void 0:r.heartbeatIntervalMs)!==null&&c!==void 0?c:op.HEARTBEAT_INTERVAL,g.transport=(u=r==null?void 0:r.transport)!==null&&u!==void 0?u:Rh.getWebSocketConstructor(),g.params=r==null?void 0:r.params,g.logger=r==null?void 0:r.logger,g.heartbeatCallback=this._wrapHeartbeatCallback(r==null?void 0:r.heartbeatCallback),g.reconnectAfterMs=(f=r==null?void 0:r.reconnectAfterMs)!==null&&f!==void 0?f:(y=>sp[y-1]||lp);let w,v;const b=(d=r==null?void 0:r.vsn)!==null&&d!==void 0?d:Fh;switch(b){case Nh:w=(y,k)=>k(JSON.stringify(y)),v=(y,k)=>k(JSON.parse(y));break;case fu:w=this.serializer.encode.bind(this.serializer),v=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${g.vsn}`)}if(g.vsn=b,g.encode=(l=r==null?void 0:r.encode)!==null&&l!==void 0?l:w,g.decode=(h=r==null?void 0:r.decode)!==null&&h!==void 0?h:v,g.beforeReconnect=this._reconnectAuth.bind(this),(r!=null&&r.logLevel||r!=null&&r.log_level)&&(this.logLevel=r.logLevel||r.log_level,g.params=Object.assign(Object.assign({},g.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=r==null?void 0:r.workerUrl,g.autoSendHeartbeat=!this.worker}return g}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var Da=class extends Error{constructor(e,r){var n;super(e),this.name="IcebergError",this.status=r.status,this.icebergType=r.icebergType,this.icebergCode=r.icebergCode,this.details=r.details,this.isCommitStateUnknown=r.icebergType==="CommitStateUnknownException"||[500,502,504].includes(r.status)&&((n=r.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function Ap(e,r,n){const i=new URL(r,e);if(n)for(const[o,c]of Object.entries(n))c!==void 0&&i.searchParams.set(o,c);return i.toString()}async function dp(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function fp(e){const r=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:i,query:o,body:c,headers:u}){const f=Ap(e.baseUrl,i,o),d=await dp(e.auth),l=await r(f,{method:n,headers:{...c?{"Content-Type":"application/json"}:{},...d,...u},body:c?JSON.stringify(c):void 0}),h=await l.text(),g=(l.headers.get("content-type")||"").includes("application/json"),w=g&&h?JSON.parse(h):h;if(!l.ok){const v=g?w:void 0,b=v==null?void 0:v.error;throw new Da((b==null?void 0:b.message)??`Request failed with status ${l.status}`,{status:l.status,icebergType:b==null?void 0:b.type,icebergCode:b==null?void 0:b.code,details:v})}return{status:l.status,headers:l.headers,data:w}}}}function Wi(e){return e.join("")}var hp=class{constructor(e,r=""){this.client=e,this.prefix=r}async listNamespaces(e){const r=e?{parent:Wi(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:r})).data.namespaces.map(i=>({namespace:i}))}async createNamespace(e,r){const n={namespace:e.namespace,properties:r==null?void 0:r.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Wi(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Wi(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Wi(e.namespace)}`}),!0}catch(r){if(r instanceof Da&&r.status===404)return!1;throw r}}async createNamespaceIfNotExists(e,r){try{return await this.createNamespace(e,r)}catch(n){if(n instanceof Da&&n.status===409)return;throw n}}};function Xn(e){return e.join("")}var pp=class{constructor(e,r="",n){this.client=e,this.prefix=r,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Xn(e.namespace)}/tables`})).data.identifiers}async createTable(e,r){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Xn(e.namespace)}/tables`,body:r,headers:n})).data.metadata}async updateTable(e,r){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Xn(e.namespace)}/tables/${e.name}`,body:r});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,r){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Xn(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((r==null?void 0:r.purge)??!1)}})}async loadTable(e){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Xn(e.namespace)}/tables/${e.name}`,headers:r})).data.metadata}async tableExists(e){const r={};this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Xn(e.namespace)}/tables/${e.name}`,headers:r}),!0}catch(n){if(n instanceof Da&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,r){try{return await this.createTable(e,r)}catch(n){if(n instanceof Da&&n.status===409)return await this.loadTable({namespace:e.namespace,name:r.name});throw n}}},gp=class{constructor(e){var i;let r="v1";e.catalogName&&(r+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=fp({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(i=e.accessDelegation)==null?void 0:i.join(","),this.namespaceOps=new hp(this.client,r),this.tableOps=new pp(this.client,r,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,r){return this.namespaceOps.createNamespace(e,r)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,r){return this.tableOps.createTable(e,r)}async updateTable(e,r){return this.tableOps.updateTable(e,r)}async dropTable(e,r){await this.tableOps.dropTable(e,r)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,r){return this.namespaceOps.createNamespaceIfNotExists(e,r)}async createTableIfNotExists(e,r){return this.tableOps.createTableIfNotExists(e,r)}};function Na(e){"@babel/helpers - typeof";return Na=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Na(e)}function mp(e,r){if(Na(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(Na(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function vp(e){var r=mp(e,"string");return Na(r)=="symbol"?r:r+""}function yp(e,r,n){return(r=vp(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Cu(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,i)}return n}function Te(e){for(var r=1;re?(...r)=>e(...r):(...r)=>fetch(...r),bp=e=>{if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Ds=e=>{if(Array.isArray(e))return e.map(n=>Ds(n));if(typeof e=="function"||e!==Object(e))return e;const r={};return Object.entries(e).forEach(([n,i])=>{const o=n.replace(/([-_][a-z])/gi,c=>c.toUpperCase().replace(/[-_]/g,""));r[o]=Ds(i)}),r},Cp=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),ku=e=>{var r;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(r=e.error)===null||r===void 0?void 0:r.message)||JSON.stringify(e)},xp=async(e,r,n,i)=>{if(e!==null&&typeof e=="object"&&typeof e.json=="function"){const o=e;let c=parseInt(o.status,10);Number.isFinite(c)||(c=500),o.json().then(u=>{const f=(u==null?void 0:u.statusCode)||(u==null?void 0:u.code)||c+"";r(new Rs(ku(u),c,f,i))}).catch(()=>{const u=c+"";r(new Rs(o.statusText||`HTTP ${c} error`,c,u,i))})}else r(new xu(ku(e),e,i))},kp=(e,r,n,i)=>{const o={method:e,headers:(r==null?void 0:r.headers)||{}};if(e==="GET"||e==="HEAD"||!i)return Te(Te({},o),n);if(bp(i)){var c;const u=(r==null?void 0:r.headers)||{};let f;for(const[d,l]of Object.entries(u))d.toLowerCase()==="content-type"&&(f=l);o.headers=Sp(u,"Content-Type",(c=f)!==null&&c!==void 0?c:"application/json"),o.body=JSON.stringify(i)}else o.body=i;return r!=null&&r.duplex&&(o.duplex=r.duplex),Te(Te({},o),n)};function Sp(e,r,n){const i=Te({},e);for(const o of Object.keys(i))o.toLowerCase()===r.toLowerCase()&&delete i[o];return i[r]=n,i}async function Fa(e,r,n,i,o,c,u){return new Promise((f,d)=>{e(n,kp(r,i,o,c)).then(l=>{if(!l.ok)throw l;if(i!=null&&i.noResolveJson)return l;if(u==="vectors"){const h=l.headers.get("content-type");if(l.headers.get("content-length")==="0"||l.status===204)return{};if(!h||!h.includes("application/json"))return{}}return l.json()}).then(l=>f(l)).catch(l=>xp(l,d,i,u))})}function Su(e="storage"){return{get:async(r,n,i,o)=>Fa(r,"GET",n,i,o,void 0,e),post:async(r,n,i,o,c)=>Fa(r,"POST",n,o,c,i,e),put:async(r,n,i,o,c)=>Fa(r,"PUT",n,o,c,i,e),head:async(r,n,i,o)=>Fa(r,"HEAD",n,Te(Te({},i),{},{noResolveJson:!0}),o,void 0,e),remove:async(r,n,i,o,c)=>Fa(r,"DELETE",n,o,c,i,e)}}const Ep=Su("storage"),{get:Ia,post:or,put:Ns,head:Lp,remove:Fs}=Ep,Xt=Su("vectors");var Gn=class{constructor(e,r={},n,i="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=Object.fromEntries(Object.entries(r).map(([o,c])=>[o.toLowerCase(),c])),this.fetch=wp(n),this.namespace=i}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,r){return this.headers=Te(Te({},this.headers),{},{[e.toLowerCase()]:r}),this}async handleOperation(e){var r=this;try{return{data:await e(),error:null}}catch(n){if(r.shouldThrowOnError)throw n;if(Hi(n))return{data:null,error:n};throw n}}},Pp=class{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r}then(e,r){return this.execute().then(e,r)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(Hi(r))return{data:null,error:r};throw r}}};let Eu;Eu=Symbol.toStringTag;var _p=class{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r,this[Eu]="BlobDownloadBuilder",this.promise=null}asStream(){return new Pp(this.downloadFn,this.shouldThrowOnError)}then(e,r){return this.getPromise().then(e,r)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(Hi(r))return{data:null,error:r};throw r}}};const Bp={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Lu={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var Tp=class extends Gn{constructor(e,r={},n,i){super(e,r,i,"storage"),this.bucketId=n}async uploadOrUpdate(e,r,n,i){var o=this;return o.handleOperation(async()=>{let c;const u=Te(Te({},Lu),i);let f=Te(Te({},o.headers),e==="POST"&&{"x-upsert":String(u.upsert)});const d=u.metadata;typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),d&&c.append("metadata",o.encodeMetadata(d)),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.has("cacheControl")||c.append("cacheControl",u.cacheControl),d&&!c.has("metadata")&&c.append("metadata",o.encodeMetadata(d))):(c=n,f["cache-control"]=`max-age=${u.cacheControl}`,f["content-type"]=u.contentType,d&&(f["x-metadata"]=o.toBase64(o.encodeMetadata(d))),(typeof ReadableStream<"u"&&c instanceof ReadableStream||c&&typeof c=="object"&&"pipe"in c&&typeof c.pipe=="function")&&!u.duplex&&(u.duplex="half")),i!=null&&i.headers&&(f=Te(Te({},f),i.headers));const l=o._removeEmptyFolders(r),h=o._getFinalPath(l),g=await(e=="PUT"?Ns:or)(o.fetch,`${o.url}/object/${h}`,c,Te({headers:f},u!=null&&u.duplex?{duplex:u.duplex}:{}));return{path:l,id:g.Id,fullPath:g.Key}})}async upload(e,r,n){return this.uploadOrUpdate("POST",e,r,n)}async uploadToSignedUrl(e,r,n,i){var o=this;const c=o._removeEmptyFolders(e),u=o._getFinalPath(c),f=new URL(o.url+`/object/upload/sign/${u}`);return f.searchParams.set("token",r),o.handleOperation(async()=>{let d;const l=Te(Te({},Lu),i),h=Te(Te({},o.headers),{"x-upsert":String(l.upsert)});return typeof Blob<"u"&&n instanceof Blob?(d=new FormData,d.append("cacheControl",l.cacheControl),d.append("",n)):typeof FormData<"u"&&n instanceof FormData?(d=n,d.append("cacheControl",l.cacheControl)):(d=n,h["cache-control"]=`max-age=${l.cacheControl}`,h["content-type"]=l.contentType),{path:c,fullPath:(await Ns(o.fetch,f.toString(),d,{headers:h})).Key}})}async createSignedUploadUrl(e,r){var n=this;return n.handleOperation(async()=>{let i=n._getFinalPath(e);const o=Te({},n.headers);r!=null&&r.upsert&&(o["x-upsert"]="true");const c=await or(n.fetch,`${n.url}/object/upload/sign/${i}`,{},{headers:o}),u=new URL(n.url+c.url),f=u.searchParams.get("token");if(!f)throw new Vi("No token returned by API");return{signedUrl:u.toString(),path:e,token:f}})}async update(e,r,n){return this.uploadOrUpdate("PUT",e,r,n)}async move(e,r,n){var i=this;return i.handleOperation(async()=>await or(i.fetch,`${i.url}/object/move`,{bucketId:i.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:i.headers}))}async copy(e,r,n){var i=this;return i.handleOperation(async()=>({path:(await or(i.fetch,`${i.url}/object/copy`,{bucketId:i.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:i.headers})).Key}))}async createSignedUrl(e,r,n){var i=this;return i.handleOperation(async()=>{let o=i._getFinalPath(e);const c=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0;let u=await or(i.fetch,`${i.url}/object/sign/${o}`,Te({expiresIn:r},c?{transform:n.transform}:{}),{headers:i.headers});const f=new URLSearchParams;n!=null&&n.download&&f.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&f.set("cacheNonce",String(n.cacheNonce));const d=f.toString();return{signedUrl:encodeURI(`${i.url}${u.signedURL}${d?`&${d}`:""}`)}})}async createSignedUrls(e,r,n){var i=this;return i.handleOperation(async()=>{const o=await or(i.fetch,`${i.url}/object/sign/${i.bucketId}`,{expiresIn:r,paths:e},{headers:i.headers}),c=new URLSearchParams;n!=null&&n.download&&c.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&c.set("cacheNonce",String(n.cacheNonce));const u=c.toString();return o.map(f=>Te(Te({},f),{},{signedUrl:f.signedURL?encodeURI(`${i.url}${f.signedURL}${u?`&${u}`:""}`):null}))})}download(e,r,n){const i=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0?"render/image/authenticated":"object",o=new URLSearchParams;r!=null&&r.transform&&this.applyTransformOptsToQuery(o,r.transform),(r==null?void 0:r.cacheNonce)!=null&&o.set("cacheNonce",String(r.cacheNonce));const c=o.toString(),u=this._getFinalPath(e),f=()=>Ia(this.fetch,`${this.url}/${i}/${u}${c?`?${c}`:""}`,{headers:this.headers,noResolveJson:!0},n);return new _p(f,this.shouldThrowOnError)}async info(e){var r=this;const n=r._getFinalPath(e);return r.handleOperation(async()=>Ds(await Ia(r.fetch,`${r.url}/object/info/${n}`,{headers:r.headers})))}async exists(e){var r=this;const n=r._getFinalPath(e);try{return await Lp(r.fetch,`${r.url}/object/${n}`,{headers:r.headers}),{data:!0,error:null}}catch(o){if(r.shouldThrowOnError)throw o;if(Hi(o)){var i;const c=o instanceof Rs?o.status:o instanceof xu?(i=o.originalError)===null||i===void 0?void 0:i.status:void 0;if(c!==void 0&&[400,404].includes(c))return{data:!1,error:o}}throw o}}getPublicUrl(e,r){const n=this._getFinalPath(e),i=new URLSearchParams;r!=null&&r.download&&i.set("download",r.download===!0?"":r.download),r!=null&&r.transform&&this.applyTransformOptsToQuery(i,r.transform),(r==null?void 0:r.cacheNonce)!=null&&i.set("cacheNonce",String(r.cacheNonce));const o=i.toString(),c=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${c}/public/${n}`)+(o?`?${o}`:"")}}}async remove(e){var r=this;return r.handleOperation(async()=>await Fs(r.fetch,`${r.url}/object/${r.bucketId}`,{prefixes:e},{headers:r.headers}))}async list(e,r,n){var i=this;return i.handleOperation(async()=>{const o=Te(Te(Te({},Bp),r),{},{prefix:e||""});return await or(i.fetch,`${i.url}/object/list/${i.bucketId}`,o,{headers:i.headers},n)})}async listV2(e,r){var n=this;return n.handleOperation(async()=>{const i=Te({},e);return await or(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,i,{headers:n.headers},r)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,r){return r.width&&e.set("width",r.width.toString()),r.height&&e.set("height",r.height.toString()),r.resize&&e.set("resize",r.resize),r.format&&e.set("format",r.format),r.quality&&e.set("quality",r.quality.toString()),e}};const Oa={"X-Client-Info":"storage-js/2.103.2"};var Rp=class extends Gn{constructor(e,r={},n,i){const o=new URL(e);i!=null&&i.useNewHostname&&/supabase\.(co|in|red)$/.test(o.hostname)&&!o.hostname.includes("storage.supabase.")&&(o.hostname=o.hostname.replace("supabase.","storage.supabase."));const c=o.href.replace(/\/$/,""),u=Te(Te({},Oa),r);super(c,u,n,"storage")}async listBuckets(e){var r=this;return r.handleOperation(async()=>{const n=r.listBucketOptionsToQueryString(e);return await Ia(r.fetch,`${r.url}/bucket${n}`,{headers:r.headers})})}async getBucket(e){var r=this;return r.handleOperation(async()=>await Ia(r.fetch,`${r.url}/bucket/${e}`,{headers:r.headers}))}async createBucket(e,r={public:!1}){var n=this;return n.handleOperation(async()=>await or(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:r.type,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,r){var n=this;return n.handleOperation(async()=>await Ns(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var r=this;return r.handleOperation(async()=>await or(r.fetch,`${r.url}/bucket/${e}/empty`,{},{headers:r.headers}))}async deleteBucket(e){var r=this;return r.handleOperation(async()=>await Fs(r.fetch,`${r.url}/bucket/${e}`,{},{headers:r.headers}))}listBucketOptionsToQueryString(e){const r={};return e&&("limit"in e&&(r.limit=String(e.limit)),"offset"in e&&(r.offset=String(e.offset)),e.search&&(r.search=e.search),e.sortColumn&&(r.sortColumn=e.sortColumn),e.sortOrder&&(r.sortOrder=e.sortOrder)),Object.keys(r).length>0?"?"+new URLSearchParams(r).toString():""}},Dp=class extends Gn{constructor(e,r={},n){const i=e.replace(/\/$/,""),o=Te(Te({},Oa),r);super(i,o,n,"storage")}async createBucket(e){var r=this;return r.handleOperation(async()=>await or(r.fetch,`${r.url}/bucket`,{name:e},{headers:r.headers}))}async listBuckets(e){var r=this;return r.handleOperation(async()=>{const n=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&n.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&n.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&n.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&n.set("sortOrder",e.sortOrder),e!=null&&e.search&&n.set("search",e.search);const i=n.toString(),o=i?`${r.url}/bucket?${i}`:`${r.url}/bucket`;return await Ia(r.fetch,o,{headers:r.headers})})}async deleteBucket(e){var r=this;return r.handleOperation(async()=>await Fs(r.fetch,`${r.url}/bucket/${e}`,{},{headers:r.headers}))}from(e){var r=this;if(!Cp(e))throw new Vi("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new gp({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>r.headers},fetch:this.fetch}),i=this.shouldThrowOnError;return new Proxy(n,{get(o,c){const u=o[c];return typeof u!="function"?u:async(...f)=>{try{return{data:await u.apply(o,f),error:null}}catch(d){if(i)throw d;return{data:null,error:d}}}}})}},Np=class extends Gn{constructor(e,r={},n){const i=e.replace(/\/$/,""),o=Te(Te({},Oa),{},{"Content-Type":"application/json"},r);super(i,o,n,"vectors")}async createIndex(e){var r=this;return r.handleOperation(async()=>await Xt.post(r.fetch,`${r.url}/CreateIndex`,e,{headers:r.headers})||{})}async getIndex(e,r){var n=this;return n.handleOperation(async()=>await Xt.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:r},{headers:n.headers}))}async listIndexes(e){var r=this;return r.handleOperation(async()=>await Xt.post(r.fetch,`${r.url}/ListIndexes`,e,{headers:r.headers}))}async deleteIndex(e,r){var n=this;return n.handleOperation(async()=>await Xt.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:r},{headers:n.headers})||{})}},Fp=class extends Gn{constructor(e,r={},n){const i=e.replace(/\/$/,""),o=Te(Te({},Oa),{},{"Content-Type":"application/json"},r);super(i,o,n,"vectors")}async putVectors(e){var r=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return r.handleOperation(async()=>await Xt.post(r.fetch,`${r.url}/PutVectors`,e,{headers:r.headers})||{})}async getVectors(e){var r=this;return r.handleOperation(async()=>await Xt.post(r.fetch,`${r.url}/GetVectors`,e,{headers:r.headers}))}async listVectors(e){var r=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return r.handleOperation(async()=>await Xt.post(r.fetch,`${r.url}/ListVectors`,e,{headers:r.headers}))}async queryVectors(e){var r=this;return r.handleOperation(async()=>await Xt.post(r.fetch,`${r.url}/QueryVectors`,e,{headers:r.headers}))}async deleteVectors(e){var r=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return r.handleOperation(async()=>await Xt.post(r.fetch,`${r.url}/DeleteVectors`,e,{headers:r.headers})||{})}},Ip=class extends Gn{constructor(e,r={},n){const i=e.replace(/\/$/,""),o=Te(Te({},Oa),{},{"Content-Type":"application/json"},r);super(i,o,n,"vectors")}async createBucket(e){var r=this;return r.handleOperation(async()=>await Xt.post(r.fetch,`${r.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:r.headers})||{})}async getBucket(e){var r=this;return r.handleOperation(async()=>await Xt.post(r.fetch,`${r.url}/GetVectorBucket`,{vectorBucketName:e},{headers:r.headers}))}async listBuckets(e={}){var r=this;return r.handleOperation(async()=>await Xt.post(r.fetch,`${r.url}/ListVectorBuckets`,e,{headers:r.headers}))}async deleteBucket(e){var r=this;return r.handleOperation(async()=>await Xt.post(r.fetch,`${r.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:r.headers})||{})}},Op=class extends Ip{constructor(e,r={}){super(e,r.headers||{},r.fetch)}from(e){return new Mp(this.url,this.headers,e,this.fetch)}async createBucket(e){var r=()=>super.createBucket,n=this;return r().call(n,e)}async getBucket(e){var r=()=>super.getBucket,n=this;return r().call(n,e)}async listBuckets(e={}){var r=()=>super.listBuckets,n=this;return r().call(n,e)}async deleteBucket(e){var r=()=>super.deleteBucket,n=this;return r().call(n,e)}},Mp=class extends Np{constructor(e,r,n,i){super(e,r,i),this.vectorBucketName=n}async createIndex(e){var r=()=>super.createIndex,n=this;return r().call(n,Te(Te({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var r=()=>super.listIndexes,n=this;return r().call(n,Te(Te({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var r=()=>super.getIndex,n=this;return r().call(n,n.vectorBucketName,e)}async deleteIndex(e){var r=()=>super.deleteIndex,n=this;return r().call(n,n.vectorBucketName,e)}index(e){return new zp(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},zp=class extends Fp{constructor(e,r,n,i,o){super(e,r,o),this.vectorBucketName=n,this.indexName=i}async putVectors(e){var r=()=>super.putVectors,n=this;return r().call(n,Te(Te({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var r=()=>super.getVectors,n=this;return r().call(n,Te(Te({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var r=()=>super.listVectors,n=this;return r().call(n,Te(Te({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var r=()=>super.queryVectors,n=this;return r().call(n,Te(Te({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var r=()=>super.deleteVectors,n=this;return r().call(n,Te(Te({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},Up=class extends Rp{constructor(e,r={},n,i){super(e,r,n,i)}from(e){return new Tp(this.url,this.headers,e,this.fetch)}get vectors(){return new Op(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new Dp(this.url+"/iceberg",this.headers,this.fetch)}};const Pu="2.103.2",Qn=30*1e3,Is=3,Os=Is*Qn,jp="http://localhost:9999",Xp="supabase.auth.token",Gp={"X-Client-Info":`gotrue-js/${Pu}`},Ms="X-Supabase-Api-Version",_u={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},Qp=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Wp=600*1e3;class Ma extends Error{constructor(r,n,i){super(r),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=i}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function ke(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class Vp extends Ma{constructor(r,n,i){super(r,n,i),this.name="AuthApiError",this.status=n,this.code=i}}function Hp(e){return ke(e)&&e.name==="AuthApiError"}class An extends Ma{constructor(r,n){super(r),this.name="AuthUnknownError",this.originalError=n}}class Pr extends Ma{constructor(r,n,i,o){super(r,i,o),this.name=n,this.status=i}}class Gt extends Pr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function qi(e){return ke(e)&&e.name==="AuthSessionMissingError"}class Wn extends Pr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Ji extends Pr{constructor(r){super(r,"AuthInvalidCredentialsError",400,void 0)}}class Yi extends Pr{constructor(r,n=null){super(r,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function qp(e){return ke(e)&&e.name==="AuthImplicitGrantRedirectError"}class Bu extends Pr{constructor(r,n=null){super(r,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class Jp extends Pr{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class zs extends Pr{constructor(r,n){super(r,"AuthRetryableFetchError",n,void 0)}}function Us(e){return ke(e)&&e.name==="AuthRetryableFetchError"}class Tu extends Pr{constructor(r,n,i){super(r,"AuthWeakPasswordError",n,"weak_password"),this.reasons=i}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class js extends Pr{constructor(r){super(r,"AuthInvalidJwtError",400,"invalid_jwt")}}const Ki="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Ru=` \r=`.split(""),Yp=(()=>{const e=new Array(128);for(let r=0;r=6;){const i=r.queue>>r.queuedBits-6&63;n(Ki[i]),r.queuedBits-=6}else if(r.queuedBits>0)for(r.queue=r.queue<<6-r.queuedBits,r.queuedBits=6;r.queuedBits>=6;){const i=r.queue>>r.queuedBits-6&63;n(Ki[i]),r.queuedBits-=6}}function Nu(e,r,n){const i=Yp[e];if(i>-1)for(r.queue=r.queue<<6|i,r.queuedBits+=6;r.queuedBits>=8;)n(r.queue>>r.queuedBits-8&255),r.queuedBits-=8;else{if(i===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function Fu(e){const r=[],n=u=>{r.push(String.fromCodePoint(u))},i={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},c=u=>{$p(u,i,n)};for(let u=0;u>6),r(128|e&63);return}else if(e<=65535){r(224|e>>12),r(128|e>>6&63),r(128|e&63);return}else if(e<=1114111){r(240|e>>18),r(128|e>>12&63),r(128|e>>6&63),r(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function Zp(e,r){for(let n=0;n55295&&i<=56319){const o=(i-55296)*1024&65535;i=(e.charCodeAt(n+1)-56320&65535|o)+65536,n+=1}Kp(i,r)}}function $p(e,r,n){if(r.utf8seq===0){if(e<=127){n(e);return}for(let i=1;i<6;i+=1)if((e>>7-i&1)===0){r.utf8seq=i;break}if(r.utf8seq===2)r.codepoint=e&31;else if(r.utf8seq===3)r.codepoint=e&15;else if(r.utf8seq===4)r.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");r.utf8seq-=1}else if(r.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");r.codepoint=r.codepoint<<6|e&63,r.utf8seq-=1,r.utf8seq===0&&n(r.codepoint)}}function Vn(e){const r=[],n={queue:0,queuedBits:0},i=o=>{r.push(o)};for(let o=0;or.push(n)),new Uint8Array(r)}function dn(e){const r=[],n={queue:0,queuedBits:0},i=o=>{r.push(o)};return e.forEach(o=>Du(o,n,i)),Du(null,n,i),r.join("")}function tg(e){return Math.round(Date.now()/1e3)+e}function rg(){return Symbol("auth-callback")}const Ct=()=>typeof window<"u"&&typeof document<"u",fn={tested:!1,writable:!1},Iu=()=>{if(!Ct())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(fn.tested)return fn.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),fn.tested=!0,fn.writable=!0}catch{fn.tested=!0,fn.writable=!1}return fn.writable};function ng(e){const r={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((o,c)=>{r[c]=o})}catch{}return n.searchParams.forEach((i,o)=>{r[o]=i}),r}const Ou=e=>e?(...r)=>e(...r):(...r)=>fetch(...r),ag=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Hn=async(e,r,n)=>{await e.setItem(r,JSON.stringify(n))},hn=async(e,r)=>{const n=await e.getItem(r);if(!n)return null;try{return JSON.parse(n)}catch{return n}},xt=async(e,r)=>{await e.removeItem(r)};class Zi{constructor(){this.promise=new Zi.promiseConstructor((r,n)=>{this.resolve=r,this.reject=n})}}Zi.promiseConstructor=Promise;function $i(e){const r=e.split(".");if(r.length!==3)throw new js("Invalid JWT structure");for(let i=0;i{setTimeout(()=>r(null),e)})}function og(e,r){return new Promise((i,o)=>{(async()=>{for(let c=0;c<1/0;c++)try{const u=await e(c);if(!r(c,null,u)){i(u);return}}catch(u){if(!r(c,u)){o(u);return}}})()})}function sg(e){return("0"+e.toString(16)).substr(-2)}function lg(){const r=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",i=n.length;let o="";for(let c=0;c<56;c++)o+=n.charAt(Math.floor(Math.random()*i));return o}return crypto.getRandomValues(r),Array.from(r,sg).join("")}async function cg(e){const n=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",n),o=new Uint8Array(i);return Array.from(o).map(c=>String.fromCharCode(c)).join("")}async function ug(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const n=await cg(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function qn(e,r,n=!1){const i=lg();let o=i;n&&(o+="/PASSWORD_RECOVERY"),await Hn(e,`${r}-code-verifier`,o);const c=await ug(i);return[c,i===c?"plain":"s256"]}const Ag=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function dg(e){const r=e.headers.get(Ms);if(!r||!r.match(Ag))return null;try{return new Date(`${r}T00:00:00.0Z`)}catch{return null}}function fg(e){if(!e)throw new Error("Missing exp claim");const r=Math.floor(Date.now()/1e3);if(e<=r)throw new Error("JWT has expired")}function hg(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const pg=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Jn(e){if(!pg.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Xs(){const e={};return new Proxy(e,{get:(r,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const i=n.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(r,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(r,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function gg(e,r){return new Proxy(e,{get:(n,i,o)=>{if(i==="__isInsecureUserWarningProxy")return!0;if(typeof i=="symbol"){const c=i.toString();if(c==="Symbol(Symbol.toPrimitive)"||c==="Symbol(Symbol.toStringTag)"||c==="Symbol(util.inspect.custom)"||c==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,i,o)}return!r.value&&typeof i=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),r.value=!0),Reflect.get(n,i,o)}})}function Mu(e){return JSON.parse(JSON.stringify(e))}const pn=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),mg=[502,503,504,520,521,522,523,524,530];async function zu(e){var r;if(!ag(e))throw new zs(pn(e),0);if(mg.includes(e.status))throw new zs(pn(e),e.status);let n;try{n=await e.json()}catch(c){throw new An(pn(c),c)}let i;const o=dg(e);if(o&&o.getTime()>=_u["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?i=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(i=n.error_code),i){if(i==="weak_password")throw new Tu(pn(n),e.status,((r=n.weak_password)===null||r===void 0?void 0:r.reasons)||[]);if(i==="session_not_found")throw new Gt}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((c,u)=>c&&typeof u=="string",!0))throw new Tu(pn(n),e.status,n.weak_password.reasons);throw new Vp(pn(n),e.status||500,i)}const vg=(e,r,n,i)=>{const o={method:e,headers:(r==null?void 0:r.headers)||{}};return e==="GET"?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},r==null?void 0:r.headers),o.body=JSON.stringify(i),Object.assign(Object.assign({},o),n))};async function _e(e,r,n,i){var o;const c=Object.assign({},i==null?void 0:i.headers);c[Ms]||(c[Ms]=_u["2024-01-01"].name),i!=null&&i.jwt&&(c.Authorization=`Bearer ${i.jwt}`);const u=(o=i==null?void 0:i.query)!==null&&o!==void 0?o:{};i!=null&&i.redirectTo&&(u.redirect_to=i.redirectTo);const f=Object.keys(u).length?"?"+new URLSearchParams(u).toString():"",d=await yg(e,r,n+f,{headers:c,noResolveJson:i==null?void 0:i.noResolveJson},{},i==null?void 0:i.body);return i!=null&&i.xform?i==null?void 0:i.xform(d):{data:Object.assign({},d),error:null}}async function yg(e,r,n,i,o,c){const u=vg(r,i,o,c);let f;try{f=await e(n,Object.assign({},u))}catch(d){throw console.error(d),new zs(pn(d),0)}if(f.ok||await zu(f),i!=null&&i.noResolveJson)return f;try{return await f.json()}catch(d){await zu(d)}}function sr(e){var r;let n=null;Cg(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=tg(e.expires_in)));const i=(r=e.user)!==null&&r!==void 0?r:e;return{data:{session:n,user:i},error:null}}function Uu(e){const r=sr(e);return!r.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,i)=>n&&typeof i=="string",!0)&&(r.data.weak_password=e.weak_password),r}function jr(e){var r;return{data:{user:(r=e.user)!==null&&r!==void 0?r:e},error:null}}function wg(e){return{data:e,error:null}}function bg(e){const{action_link:r,email_otp:n,hashed_token:i,redirect_to:o,verification_type:c}=e,u=zi(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),f={action_link:r,email_otp:n,hashed_token:i,redirect_to:o,verification_type:c},d=Object.assign({},u);return{data:{properties:f,user:d},error:null}}function ju(e){return e}function Cg(e){return e.access_token&&e.refresh_token&&e.expires_in}const Gs=["global","local","others"];class xg{constructor({url:r="",headers:n={},fetch:i}){this.url=r,this.headers=n,this.fetch=Ou(i),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)}}async signOut(r,n=Gs[0]){if(Gs.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Gs.join(", ")}`);try{return await _e(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:r,noResolveJson:!0}),{data:null,error:null}}catch(i){if(ke(i))return{data:null,error:i};throw i}}async inviteUserByEmail(r,n={}){try{return await _e(this.fetch,"POST",`${this.url}/invite`,{body:{email:r,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:jr})}catch(i){if(ke(i))return{data:{user:null},error:i};throw i}}async generateLink(r){try{const{options:n}=r,i=zi(r,["options"]),o=Object.assign(Object.assign({},i),n);return"newEmail"in i&&(o.new_email=i==null?void 0:i.newEmail,delete o.newEmail),await _e(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:bg,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(ke(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(r){try{return await _e(this.fetch,"POST",`${this.url}/admin/users`,{body:r,headers:this.headers,xform:jr})}catch(n){if(ke(n))return{data:{user:null},error:n};throw n}}async listUsers(r){var n,i,o,c,u,f,d;try{const l={nextPage:null,lastPage:0,total:0},h=await _e(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(i=(n=r==null?void 0:r.page)===null||n===void 0?void 0:n.toString())!==null&&i!==void 0?i:"",per_page:(c=(o=r==null?void 0:r.perPage)===null||o===void 0?void 0:o.toString())!==null&&c!==void 0?c:""},xform:ju});if(h.error)throw h.error;const g=await h.json(),w=(u=h.headers.get("x-total-count"))!==null&&u!==void 0?u:0,v=(d=(f=h.headers.get("link"))===null||f===void 0?void 0:f.split(","))!==null&&d!==void 0?d:[];return v.length>0&&(v.forEach(b=>{const y=parseInt(b.split(";")[0].split("=")[1].substring(0,1)),k=JSON.parse(b.split(";")[1].split("=")[1]);l[`${k}Page`]=y}),l.total=parseInt(w)),{data:Object.assign(Object.assign({},g),l),error:null}}catch(l){if(ke(l))return{data:{users:[]},error:l};throw l}}async getUserById(r){Jn(r);try{return await _e(this.fetch,"GET",`${this.url}/admin/users/${r}`,{headers:this.headers,xform:jr})}catch(n){if(ke(n))return{data:{user:null},error:n};throw n}}async updateUserById(r,n){Jn(r);try{return await _e(this.fetch,"PUT",`${this.url}/admin/users/${r}`,{body:n,headers:this.headers,xform:jr})}catch(i){if(ke(i))return{data:{user:null},error:i};throw i}}async deleteUser(r,n=!1){Jn(r);try{return await _e(this.fetch,"DELETE",`${this.url}/admin/users/${r}`,{headers:this.headers,body:{should_soft_delete:n},xform:jr})}catch(i){if(ke(i))return{data:{user:null},error:i};throw i}}async _listFactors(r){Jn(r.userId);try{const{data:n,error:i}=await _e(this.fetch,"GET",`${this.url}/admin/users/${r.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:n,error:i}}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _deleteFactor(r){Jn(r.userId),Jn(r.id);try{return{data:await _e(this.fetch,"DELETE",`${this.url}/admin/users/${r.userId}/factors/${r.id}`,{headers:this.headers}),error:null}}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _listOAuthClients(r){var n,i,o,c,u,f,d;try{const l={nextPage:null,lastPage:0,total:0},h=await _e(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(i=(n=r==null?void 0:r.page)===null||n===void 0?void 0:n.toString())!==null&&i!==void 0?i:"",per_page:(c=(o=r==null?void 0:r.perPage)===null||o===void 0?void 0:o.toString())!==null&&c!==void 0?c:""},xform:ju});if(h.error)throw h.error;const g=await h.json(),w=(u=h.headers.get("x-total-count"))!==null&&u!==void 0?u:0,v=(d=(f=h.headers.get("link"))===null||f===void 0?void 0:f.split(","))!==null&&d!==void 0?d:[];return v.length>0&&(v.forEach(b=>{const y=parseInt(b.split(";")[0].split("=")[1].substring(0,1)),k=JSON.parse(b.split(";")[1].split("=")[1]);l[`${k}Page`]=y}),l.total=parseInt(w)),{data:Object.assign(Object.assign({},g),l),error:null}}catch(l){if(ke(l))return{data:{clients:[]},error:l};throw l}}async _createOAuthClient(r){try{return await _e(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _getOAuthClient(r){try{return await _e(this.fetch,"GET",`${this.url}/admin/oauth/clients/${r}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _updateOAuthClient(r,n){try{return await _e(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${r}`,{body:n,headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if(ke(i))return{data:null,error:i};throw i}}async _deleteOAuthClient(r){try{return await _e(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${r}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(r){try{return await _e(this.fetch,"POST",`${this.url}/admin/oauth/clients/${r}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _listCustomProviders(r){try{const n={};return r!=null&&r.type&&(n.type=r.type),await _e(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:n,xform:i=>{var o;return{data:{providers:(o=i==null?void 0:i.providers)!==null&&o!==void 0?o:[]},error:null}}})}catch(n){if(ke(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(r){try{return await _e(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _getCustomProvider(r){try{return await _e(this.fetch,"GET",`${this.url}/admin/custom-providers/${r}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ke(n))return{data:null,error:n};throw n}}async _updateCustomProvider(r,n){try{return await _e(this.fetch,"PUT",`${this.url}/admin/custom-providers/${r}`,{body:n,headers:this.headers,xform:i=>({data:i,error:null})})}catch(i){if(ke(i))return{data:null,error:i};throw i}}async _deleteCustomProvider(r){try{return await _e(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${r}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ke(n))return{data:null,error:n};throw n}}}function Xu(e={}){return{getItem:r=>e[r]||null,setItem:(r,n)=>{e[r]=n},removeItem:r=>{delete e[r]}}}const vr={debug:!!(globalThis&&Iu()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Gu extends Error{constructor(r){super(r),this.isAcquireTimeout=!0}}class Qu extends Gu{}async function kg(e,r,n){vr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,r);const i=new globalThis.AbortController;let o;r>0&&(o=setTimeout(()=>{i.abort(),vr.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},r)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,r===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:i.signal},async c=>{if(c){clearTimeout(o),vr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,c.name);try{return await n()}finally{vr.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,c.name)}}else{if(r===0)throw vr.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new Qu(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(vr.debug)try{const u=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(u,null," "))}catch(u){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",u)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(o),await n()}})}catch(c){if(r>0&&clearTimeout(o),(c==null?void 0:c.name)==="AbortError"&&r>0){if(i.signal.aborted)return vr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${r}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async u=>{if(u){vr.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,u.name);try{return await n()}finally{vr.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,u.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await n()}));throw vr.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new Qu(`Lock "${e}" was released because another request stole it`)}throw c}}function Sg(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function Wu(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function Eg(e){return parseInt(e,16)}function Lg(e){const r=new TextEncoder().encode(e);return"0x"+Array.from(r,i=>i.toString(16).padStart(2,"0")).join("")}function Pg(e){var r;const{chainId:n,domain:i,expirationTime:o,issuedAt:c=new Date,nonce:u,notBefore:f,requestId:d,resources:l,scheme:h,uri:g,version:w}=e;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!i)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(u&&u.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${u}`);if(!g)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(w!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${w}`);if(!((r=e.statement)===null||r===void 0)&&r.includes(` `))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const v=Wu(e.address),b=h?`${h}://${i}`:i,y=e.statement?`${e.statement} `:"",k=`${b} wants you to sign in with your Ethereum account: ${v} ${y}`;let C=`URI: ${g} Version: ${w} Chain ID: ${n}${u?` Nonce: ${u}`:""} Issued At: ${c.toISOString()}`;if(o&&(C+=` Expiration Time: ${o.toISOString()}`),f&&(C+=` Not Before: ${f.toISOString()}`),d&&(C+=` Request ID: ${d}`),l){let E=` Resources:`;for(const _ of l){if(!_||typeof _!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${_}`);E+=` - ${_}`}C+=E}return`${k} ${C}`}class ht extends Error{constructor({message:r,code:n,cause:i,name:o}){var c;super(r,{cause:i}),this.__isWebAuthnError=!0,this.name=(c=o??(i instanceof Error?i.name:void 0))!==null&&c!==void 0?c:"Unknown Error",this.code=n}}class eo extends ht{constructor(r,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:r}),this.name="WebAuthnUnknownError",this.originalError=n}}function _g({error:e,options:r}){var n,i,o;const{publicKey:c}=r;if(!c)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(r.signal instanceof AbortSignal)return new ht({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((n=c.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new ht({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(r.mediation==="conditional"&&((i=c.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new ht({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((o=c.authenticatorSelection)===null||o===void 0?void 0:o.userVerification)==="required")return new ht({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new ht({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new ht({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return c.pubKeyCredParams.filter(f=>f.type==="public-key").length===0?new ht({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new ht({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const u=window.location.hostname;if(Vu(u)){if(c.rp.id!==u)return new ht({message:`The RP ID "${c.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new ht({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(c.user.id.byteLength<1||c.user.id.byteLength>64)return new ht({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new ht({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new ht({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function Bg({error:e,options:r}){const{publicKey:n}=r;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(r.signal instanceof AbortSignal)return new ht({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new ht({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const i=window.location.hostname;if(Vu(i)){if(n.rpId!==i)return new ht({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new ht({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new ht({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new ht({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class Tg{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const r=new AbortController;return this.controller=r,r.signal}cancelCeremony(){if(this.controller){const r=new Error("Manually cancelling existing WebAuthn API call");r.name="AbortError",this.controller.abort(r),this.controller=void 0}}}const Rg=new Tg;function Dg(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:r,user:n,excludeCredentials:i}=e,o=zi(e,["challenge","user","excludeCredentials"]),c=Vn(r).buffer,u=Object.assign(Object.assign({},n),{id:Vn(n.id).buffer}),f=Object.assign(Object.assign({},o),{challenge:c,user:u});if(i&&i.length>0){f.excludeCredentials=new Array(i.length);for(let d=0;d0){c.allowCredentials=new Array(n.length);for(let u=0;uo!==null&&typeof o=="object"&&!Array.isArray(o),n=o=>o instanceof ArrayBuffer||ArrayBuffer.isView(o),i={};for(const o of e)if(o)for(const c in o){const u=o[c];if(u!==void 0)if(Array.isArray(u))i[c]=u;else if(n(u))i[c]=u;else if(r(u)){const f=i[c];r(f)?i[c]=to(f,u):i[c]=to(u)}else i[c]=u}return i}function jg(e,r){return to(zg,e,r||{})}function Xg(e,r){return to(Ug,e,r||{})}class Gg{constructor(r){this.client=r,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(r){return this.client.mfa.enroll(Object.assign(Object.assign({},r),{factorType:"webauthn"}))}async _challenge({factorId:r,webauthn:n,friendlyName:i,signal:o},c){var u;try{const{data:f,error:d}=await this.client.mfa.challenge({factorId:r,webauthn:n});if(!f)return{data:null,error:d};const l=o??Rg.createNewAbortSignal();if(f.webauthn.type==="create"){const{user:h}=f.webauthn.credential_options.publicKey;if(!h.name){const g=i;if(g)h.name=`${h.id}:${g}`;else{const v=(await this.client.getUser()).data.user,b=((u=v==null?void 0:v.user_metadata)===null||u===void 0?void 0:u.name)||(v==null?void 0:v.email)||(v==null?void 0:v.id)||"User";h.name=`${h.id}:${b}`}}h.displayName||(h.displayName=h.name)}switch(f.webauthn.type){case"create":{const h=jg(f.webauthn.credential_options.publicKey,c==null?void 0:c.create),{data:g,error:w}=await Og({publicKey:h,signal:l});return g?{data:{factorId:r,challengeId:f.id,webauthn:{type:f.webauthn.type,credential_response:g}},error:null}:{data:null,error:w}}case"request":{const h=Xg(f.webauthn.credential_options.publicKey,c==null?void 0:c.request),{data:g,error:w}=await Mg(Object.assign(Object.assign({},f.webauthn.credential_options),{publicKey:h,signal:l}));return g?{data:{factorId:r,challengeId:f.id,webauthn:{type:f.webauthn.type,credential_response:g}},error:null}:{data:null,error:w}}}}catch(f){return ke(f)?{data:null,error:f}:{data:null,error:new An("Unexpected error in challenge",f)}}}async _verify({challengeId:r,factorId:n,webauthn:i}){return this.client.mfa.verify({factorId:n,challengeId:r,webauthn:i})}async _authenticate({factorId:r,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:i=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},c){if(!n)return{data:null,error:new Ma("rpId is required for WebAuthn authentication")};try{if(!Hu())return{data:null,error:new An("Browser does not support WebAuthn",null)};const{data:u,error:f}=await this.challenge({factorId:r,webauthn:{rpId:n,rpOrigins:i},signal:o},{request:c});if(!u)return{data:null,error:f};const{webauthn:d}=u;return this._verify({factorId:r,challengeId:u.challengeId,webauthn:{type:d.type,rpId:n,rpOrigins:i,credential_response:d.credential_response}})}catch(u){return ke(u)?{data:null,error:u}:{data:null,error:new An("Unexpected error in authenticate",u)}}}async _register({friendlyName:r,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:i=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},c){if(!n)return{data:null,error:new Ma("rpId is required for WebAuthn registration")};try{if(!Hu())return{data:null,error:new An("Browser does not support WebAuthn",null)};const{data:u,error:f}=await this._enroll({friendlyName:r});if(!u)return await this.client.mfa.listFactors().then(h=>{var g;return(g=h.data)===null||g===void 0?void 0:g.all.find(w=>w.factor_type==="webauthn"&&w.friendly_name===r&&w.status!=="unverified")}).then(h=>h?this.client.mfa.unenroll({factorId:h==null?void 0:h.id}):void 0),{data:null,error:f};const{data:d,error:l}=await this._challenge({factorId:u.id,friendlyName:u.friendly_name,webauthn:{rpId:n,rpOrigins:i},signal:o},{create:c});return d?this._verify({factorId:u.id,challengeId:d.challengeId,webauthn:{rpId:n,rpOrigins:i,type:d.webauthn.type,credential_response:d.webauthn.credential_response}}):{data:null,error:l}}catch(u){return ke(u)?{data:null,error:u}:{data:null,error:new An("Unexpected error in register",u)}}}}Sg();const Qg={url:jp,storageKey:Xp,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Gp,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function qu(e,r,n){return await n()}const Yn={};class za{get jwks(){var r,n;return(n=(r=Yn[this.storageKey])===null||r===void 0?void 0:r.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(r){Yn[this.storageKey]=Object.assign(Object.assign({},Yn[this.storageKey]),{jwks:r})}get jwks_cached_at(){var r,n;return(n=(r=Yn[this.storageKey])===null||r===void 0?void 0:r.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(r){Yn[this.storageKey]=Object.assign(Object.assign({},Yn[this.storageKey]),{cachedAt:r})}constructor(r){var n,i,o;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const c=Object.assign(Object.assign({},Qg),r);if(this.storageKey=c.storageKey,this.instanceID=(n=za.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,za.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!c.debug,typeof c.debug=="function"&&(this.logger=c.debug),this.instanceID>0&&Ct()){const u=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(u),this.logDebugMessages&&console.trace(u)}if(this.persistSession=c.persistSession,this.autoRefreshToken=c.autoRefreshToken,this.admin=new xg({url:c.url,headers:c.headers,fetch:c.fetch}),this.url=c.url,this.headers=c.headers,this.fetch=Ou(c.fetch),this.lock=c.lock||qu,this.detectSessionInUrl=c.detectSessionInUrl,this.flowType=c.flowType,this.hasCustomAuthorizationHeader=c.hasCustomAuthorizationHeader,this.throwOnError=c.throwOnError,this.lockAcquireTimeout=c.lockAcquireTimeout,c.lock?this.lock=c.lock:this.persistSession&&Ct()&&(!((i=globalThis==null?void 0:globalThis.navigator)===null||i===void 0)&&i.locks)?this.lock=kg:this.lock=qu,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new Gg(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(c.storage?this.storage=c.storage:Iu()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Xu(this.memoryStorage)),c.userStorage&&(this.userStorage=c.userStorage)):(this.memoryStorage={},this.storage=Xu(this.memoryStorage)),Ct()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(u){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",u)}(o=this.broadcastChannel)===null||o===void 0||o.addEventListener("message",async u=>{this._debug("received broadcast notification from other tab or client",u);try{await this._notifyAllSubscribers(u.data.event,u.data.session,!1)}catch(f){this._debug("#broadcastChannel","error",f)}})}c.skipAutoInitialize||this.initialize().catch(u=>{this._debug("#initialize()","error",u)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(r){if(this.throwOnError&&r&&r.error)throw r.error;return r}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Pu}) ${new Date().toISOString()}`}_debug(...r){return this.logDebugMessages&&this.logger(this._logPrefix(),...r),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var r;try{let n={},i="none";if(Ct()&&(n=ng(window.location.href),this._isImplicitGrantCallback(n)?i="implicit":await this._isPKCECallback(n)&&(i="pkce")),Ct()&&this.detectSessionInUrl&&i!=="none"){const{data:o,error:c}=await this._getSessionFromURL(n,i);if(c){if(this._debug("#_initialize()","error detecting session from URL",c),qp(c)){const d=(r=c.details)===null||r===void 0?void 0:r.code;if(d==="identity_already_exists"||d==="identity_not_found"||d==="single_identity_not_deletable")return{error:c}}return{error:c}}const{session:u,redirectType:f}=o;return this._debug("#_initialize()","detected session in URL",u,"redirect type",f),await this._saveSession(u),setTimeout(async()=>{f==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",u):await this._notifyAllSubscribers("SIGNED_IN",u)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return ke(n)?this._returnResult({error:n}):this._returnResult({error:new An("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(r){var n,i,o;try{const c=await _e(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(i=(n=r==null?void 0:r.options)===null||n===void 0?void 0:n.data)!==null&&i!==void 0?i:{},gotrue_meta_security:{captcha_token:(o=r==null?void 0:r.options)===null||o===void 0?void 0:o.captchaToken}},xform:sr}),{data:u,error:f}=c;if(f||!u)return this._returnResult({data:{user:null,session:null},error:f});const d=u.session,l=u.user;return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",d)),this._returnResult({data:{user:l,session:d},error:null})}catch(c){if(ke(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}}async signUp(r){var n,i,o;try{let c;if("email"in r){const{email:h,password:g,options:w}=r;let v=null,b=null;this.flowType==="pkce"&&([v,b]=await qn(this.storage,this.storageKey)),c=await _e(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:w==null?void 0:w.emailRedirectTo,body:{email:h,password:g,data:(n=w==null?void 0:w.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:w==null?void 0:w.captchaToken},code_challenge:v,code_challenge_method:b},xform:sr})}else if("phone"in r){const{phone:h,password:g,options:w}=r;c=await _e(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:h,password:g,data:(i=w==null?void 0:w.data)!==null&&i!==void 0?i:{},channel:(o=w==null?void 0:w.channel)!==null&&o!==void 0?o:"sms",gotrue_meta_security:{captcha_token:w==null?void 0:w.captchaToken}},xform:sr})}else throw new Ji("You must provide either an email or phone number and a password");const{data:u,error:f}=c;if(f||!u)return await xt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:f});const d=u.session,l=u.user;return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",d)),this._returnResult({data:{user:l,session:d},error:null})}catch(c){if(await xt(this.storage,`${this.storageKey}-code-verifier`),ke(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}}async signInWithPassword(r){try{let n;if("email"in r){const{email:c,password:u,options:f}=r;n=await _e(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:c,password:u,gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:Uu})}else if("phone"in r){const{phone:c,password:u,options:f}=r;n=await _e(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:c,password:u,gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:Uu})}else throw new Ji("You must provide either an email or phone number and a password");const{data:i,error:o}=n;if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!i||!i.session||!i.user){const c=new Wn;return this._returnResult({data:{user:null,session:null},error:c})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),this._returnResult({data:Object.assign({user:i.user,session:i.session},i.weak_password?{weakPassword:i.weak_password}:null),error:o})}catch(n){if(ke(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(r){var n,i,o,c;return await this._handleProviderSignIn(r.provider,{redirectTo:(n=r.options)===null||n===void 0?void 0:n.redirectTo,scopes:(i=r.options)===null||i===void 0?void 0:i.scopes,queryParams:(o=r.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(c=r.options)===null||c===void 0?void 0:c.skipBrowserRedirect})}async exchangeCodeForSession(r){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(r))}async signInWithWeb3(r){const{chain:n}=r;switch(n){case"ethereum":return await this.signInWithEthereum(r);case"solana":return await this.signInWithSolana(r);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(r){var n,i,o,c,u,f,d,l,h,g,w;let v,b;if("message"in r)v=r.message,b=r.signature;else{const{chain:y,wallet:k,statement:C,options:E}=r;let _;if(Ct())if(typeof k=="object")_=k;else{const z=window;if("ethereum"in z&&typeof z.ethereum=="object"&&"request"in z.ethereum&&typeof z.ethereum.request=="function")_=z.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof k!="object"||!(E!=null&&E.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");_=k}const N=new URL((n=E==null?void 0:E.url)!==null&&n!==void 0?n:window.location.href),I=await _.request({method:"eth_requestAccounts"}).then(z=>z).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!I||I.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const G=Wu(I[0]);let M=(i=E==null?void 0:E.signInWithEthereum)===null||i===void 0?void 0:i.chainId;if(!M){const z=await _.request({method:"eth_chainId"});M=Eg(z)}const O={domain:N.host,address:G,statement:C,uri:N.href,version:"1",chainId:M,nonce:(o=E==null?void 0:E.signInWithEthereum)===null||o===void 0?void 0:o.nonce,issuedAt:(u=(c=E==null?void 0:E.signInWithEthereum)===null||c===void 0?void 0:c.issuedAt)!==null&&u!==void 0?u:new Date,expirationTime:(f=E==null?void 0:E.signInWithEthereum)===null||f===void 0?void 0:f.expirationTime,notBefore:(d=E==null?void 0:E.signInWithEthereum)===null||d===void 0?void 0:d.notBefore,requestId:(l=E==null?void 0:E.signInWithEthereum)===null||l===void 0?void 0:l.requestId,resources:(h=E==null?void 0:E.signInWithEthereum)===null||h===void 0?void 0:h.resources};v=Pg(O),b=await _.request({method:"personal_sign",params:[Lg(v),G]})}try{const{data:y,error:k}=await _e(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:v,signature:b},!((g=r.options)===null||g===void 0)&&g.captchaToken?{gotrue_meta_security:{captcha_token:(w=r.options)===null||w===void 0?void 0:w.captchaToken}}:null),xform:sr});if(k)throw k;if(!y||!y.session||!y.user){const C=new Wn;return this._returnResult({data:{user:null,session:null},error:C})}return y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("SIGNED_IN",y.session)),this._returnResult({data:Object.assign({},y),error:k})}catch(y){if(ke(y))return this._returnResult({data:{user:null,session:null},error:y});throw y}}async signInWithSolana(r){var n,i,o,c,u,f,d,l,h,g,w,v;let b,y;if("message"in r)b=r.message,y=r.signature;else{const{chain:k,wallet:C,statement:E,options:_}=r;let N;if(Ct())if(typeof C=="object")N=C;else{const G=window;if("solana"in G&&typeof G.solana=="object"&&("signIn"in G.solana&&typeof G.solana.signIn=="function"||"signMessage"in G.solana&&typeof G.solana.signMessage=="function"))N=G.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof C!="object"||!(_!=null&&_.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");N=C}const I=new URL((n=_==null?void 0:_.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in N&&N.signIn){const G=await N.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},_==null?void 0:_.signInWithSolana),{version:"1",domain:I.host,uri:I.href}),E?{statement:E}:null));let M;if(Array.isArray(G)&&G[0]&&typeof G[0]=="object")M=G[0];else if(G&&typeof G=="object"&&"signedMessage"in G&&"signature"in G)M=G;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in M&&"signature"in M&&(typeof M.signedMessage=="string"||M.signedMessage instanceof Uint8Array)&&M.signature instanceof Uint8Array)b=typeof M.signedMessage=="string"?M.signedMessage:new TextDecoder().decode(M.signedMessage),y=M.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in N)||typeof N.signMessage!="function"||!("publicKey"in N)||typeof N!="object"||!N.publicKey||!("toBase58"in N.publicKey)||typeof N.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");b=[`${I.host} wants you to sign in with your Solana account:`,N.publicKey.toBase58(),...E?["",E,""]:[""],"Version: 1",`URI: ${I.href}`,`Issued At: ${(o=(i=_==null?void 0:_.signInWithSolana)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((c=_==null?void 0:_.signInWithSolana)===null||c===void 0)&&c.notBefore?[`Not Before: ${_.signInWithSolana.notBefore}`]:[],...!((u=_==null?void 0:_.signInWithSolana)===null||u===void 0)&&u.expirationTime?[`Expiration Time: ${_.signInWithSolana.expirationTime}`]:[],...!((f=_==null?void 0:_.signInWithSolana)===null||f===void 0)&&f.chainId?[`Chain ID: ${_.signInWithSolana.chainId}`]:[],...!((d=_==null?void 0:_.signInWithSolana)===null||d===void 0)&&d.nonce?[`Nonce: ${_.signInWithSolana.nonce}`]:[],...!((l=_==null?void 0:_.signInWithSolana)===null||l===void 0)&&l.requestId?[`Request ID: ${_.signInWithSolana.requestId}`]:[],...!((g=(h=_==null?void 0:_.signInWithSolana)===null||h===void 0?void 0:h.resources)===null||g===void 0)&&g.length?["Resources",..._.signInWithSolana.resources.map(M=>`- ${M}`)]:[]].join(` `);const G=await N.signMessage(new TextEncoder().encode(b),"utf8");if(!G||!(G instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");y=G}}try{const{data:k,error:C}=await _e(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:b,signature:dn(y)},!((w=r.options)===null||w===void 0)&&w.captchaToken?{gotrue_meta_security:{captcha_token:(v=r.options)===null||v===void 0?void 0:v.captchaToken}}:null),xform:sr});if(C)throw C;if(!k||!k.session||!k.user){const E=new Wn;return this._returnResult({data:{user:null,session:null},error:E})}return k.session&&(await this._saveSession(k.session),await this._notifyAllSubscribers("SIGNED_IN",k.session)),this._returnResult({data:Object.assign({},k),error:C})}catch(k){if(ke(k))return this._returnResult({data:{user:null,session:null},error:k});throw k}}async _exchangeCodeForSession(r){const n=await hn(this.storage,`${this.storageKey}-code-verifier`),[i,o]=(n??"").split("/");try{if(!i&&this.flowType==="pkce")throw new Jp;const{data:c,error:u}=await _e(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:r,code_verifier:i},xform:sr});if(await xt(this.storage,`${this.storageKey}-code-verifier`),u)throw u;if(!c||!c.session||!c.user){const f=new Wn;return this._returnResult({data:{user:null,session:null,redirectType:null},error:f})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:Object.assign(Object.assign({},c),{redirectType:o??null}),error:u})}catch(c){if(await xt(this.storage,`${this.storageKey}-code-verifier`),ke(c))return this._returnResult({data:{user:null,session:null,redirectType:null},error:c});throw c}}async signInWithIdToken(r){try{const{options:n,provider:i,token:o,access_token:c,nonce:u}=r,f=await _e(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:i,id_token:o,access_token:c,nonce:u,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:sr}),{data:d,error:l}=f;if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!d||!d.session||!d.user){const h=new Wn;return this._returnResult({data:{user:null,session:null},error:h})}return d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("SIGNED_IN",d.session)),this._returnResult({data:d,error:l})}catch(n){if(ke(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(r){var n,i,o,c,u;try{if("email"in r){const{email:f,options:d}=r;let l=null,h=null;this.flowType==="pkce"&&([l,h]=await qn(this.storage,this.storageKey));const{error:g}=await _e(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:f,data:(n=d==null?void 0:d.data)!==null&&n!==void 0?n:{},create_user:(i=d==null?void 0:d.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken},code_challenge:l,code_challenge_method:h},redirectTo:d==null?void 0:d.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:g})}if("phone"in r){const{phone:f,options:d}=r,{data:l,error:h}=await _e(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:f,data:(o=d==null?void 0:d.data)!==null&&o!==void 0?o:{},create_user:(c=d==null?void 0:d.shouldCreateUser)!==null&&c!==void 0?c:!0,gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken},channel:(u=d==null?void 0:d.channel)!==null&&u!==void 0?u:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:l==null?void 0:l.message_id},error:h})}throw new Ji("You must provide either an email or phone number.")}catch(f){if(await xt(this.storage,`${this.storageKey}-code-verifier`),ke(f))return this._returnResult({data:{user:null,session:null},error:f});throw f}}async verifyOtp(r){var n,i;try{let o,c;"options"in r&&(o=(n=r.options)===null||n===void 0?void 0:n.redirectTo,c=(i=r.options)===null||i===void 0?void 0:i.captchaToken);const{data:u,error:f}=await _e(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},r),{gotrue_meta_security:{captcha_token:c}}),redirectTo:o,xform:sr});if(f)throw f;if(!u)throw new Error("An error occurred on token verification.");const d=u.session,l=u.user;return d!=null&&d.access_token&&(await this._saveSession(d),await this._notifyAllSubscribers(r.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",d)),this._returnResult({data:{user:l,session:d},error:null})}catch(o){if(ke(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithSSO(r){var n,i,o,c,u;try{let f=null,d=null;this.flowType==="pkce"&&([f,d]=await qn(this.storage,this.storageKey));const l=await _e(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in r?{provider_id:r.providerId}:null),"domain"in r?{domain:r.domain}:null),{redirect_to:(i=(n=r.options)===null||n===void 0?void 0:n.redirectTo)!==null&&i!==void 0?i:void 0}),!((o=r==null?void 0:r.options)===null||o===void 0)&&o.captchaToken?{gotrue_meta_security:{captcha_token:r.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:f,code_challenge_method:d}),headers:this.headers,xform:wg});return!((c=l.data)===null||c===void 0)&&c.url&&Ct()&&!(!((u=r.options)===null||u===void 0)&&u.skipBrowserRedirect)&&window.location.assign(l.data.url),this._returnResult(l)}catch(f){if(await xt(this.storage,`${this.storageKey}-code-verifier`),ke(f))return this._returnResult({data:null,error:f});throw f}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;if(i)throw i;if(!n)throw new Gt;const{error:o}=await _e(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:o})})}catch(r){if(ke(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async resend(r){try{const n=`${this.url}/resend`;if("email"in r){const{email:i,type:o,options:c}=r,{error:u}=await _e(this.fetch,"POST",n,{headers:this.headers,body:{email:i,type:o,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken}},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:u})}else if("phone"in r){const{phone:i,type:o,options:c}=r,{data:u,error:f}=await _e(this.fetch,"POST",n,{headers:this.headers,body:{phone:i,type:o,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:f})}throw new Ji("You must provide either an email or phone number and a type")}catch(n){if(ke(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n))}async _acquireLock(r,n){this._debug("#_acquireLock","begin",r);try{if(this.lockAcquired){const i=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await i,await n()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.storageKey}`,r,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const i=n();for(this.pendingInLock.push((async()=>{try{await i}catch{}})()),await i;this.pendingInLock.length;){const o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await i}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(r){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await r(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let r=null;const n=await hn(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?r=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!r)return{data:{session:null},error:null};const i=r.expires_at?r.expires_at*1e3-Date.now()await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(r){try{return r?await _e(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:r,xform:jr}):await this._useSession(async n=>{var i,o,c;const{data:u,error:f}=n;if(f)throw f;return!(!((i=u.session)===null||i===void 0)&&i.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Gt}:await _e(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(c=(o=u.session)===null||o===void 0?void 0:o.access_token)!==null&&c!==void 0?c:void 0,xform:jr})})}catch(n){if(ke(n))return qi(n)&&(await this._removeSession(),await xt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(r,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(r,n))}async _updateUser(r,n={}){try{return await this._useSession(async i=>{const{data:o,error:c}=i;if(c)throw c;if(!o.session)throw new Gt;const u=o.session;let f=null,d=null;this.flowType==="pkce"&&r.email!=null&&([f,d]=await qn(this.storage,this.storageKey));const{data:l,error:h}=await _e(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},r),{code_challenge:f,code_challenge_method:d}),jwt:u.access_token,xform:jr});if(h)throw h;return u.user=l.user,await this._saveSession(u),await this._notifyAllSubscribers("USER_UPDATED",u),this._returnResult({data:{user:u.user},error:null})})}catch(i){if(await xt(this.storage,`${this.storageKey}-code-verifier`),ke(i))return this._returnResult({data:{user:null},error:i});throw i}}async setSession(r){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(r))}async _setSession(r){try{if(!r.access_token||!r.refresh_token)throw new Gt;const n=Date.now()/1e3;let i=n,o=!0,c=null;const{payload:u}=$i(r.access_token);if(u.exp&&(i=u.exp,o=i<=n),o){const{data:f,error:d}=await this._callRefreshToken(r.refresh_token);if(d)return this._returnResult({data:{user:null,session:null},error:d});if(!f)return{data:{user:null,session:null},error:null};c=f}else{const{data:f,error:d}=await this._getUser(r.access_token);if(d)return this._returnResult({data:{user:null,session:null},error:d});c={access_token:r.access_token,refresh_token:r.refresh_token,user:f.user,token_type:"bearer",expires_in:i-n,expires_at:i},await this._saveSession(c),await this._notifyAllSubscribers("SIGNED_IN",c)}return this._returnResult({data:{user:c.user,session:c},error:null})}catch(n){if(ke(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(r){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(r))}async _refreshSession(r){try{return await this._useSession(async n=>{var i;if(!r){const{data:u,error:f}=n;if(f)throw f;r=(i=u.session)!==null&&i!==void 0?i:void 0}if(!(r!=null&&r.refresh_token))throw new Gt;const{data:o,error:c}=await this._callRefreshToken(r.refresh_token);return c?this._returnResult({data:{user:null,session:null},error:c}):o?this._returnResult({data:{user:o.user,session:o},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(ke(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(r,n){try{if(!Ct())throw new Yi("No browser detected.");if(r.error||r.error_description||r.error_code)throw new Yi(r.error_description||"Error in URL with unspecified error_description",{error:r.error||"unspecified_error",code:r.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new Bu("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Yi("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!r.code)throw new Bu("No code detected.");const{data:E,error:_}=await this._exchangeCodeForSession(r.code);if(_)throw _;const N=new URL(window.location.href);return N.searchParams.delete("code"),window.history.replaceState(window.history.state,"",N.toString()),{data:{session:E.session,redirectType:null},error:null}}const{provider_token:i,provider_refresh_token:o,access_token:c,refresh_token:u,expires_in:f,expires_at:d,token_type:l}=r;if(!c||!f||!u||!l)throw new Yi("No session defined in URL");const h=Math.round(Date.now()/1e3),g=parseInt(f);let w=h+g;d&&(w=parseInt(d));const v=w-h;v*1e3<=Qn&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${v}s, should have been closer to ${g}s`);const b=w-g;h-b>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",b,w,h):h-b<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",b,w,h);const{data:y,error:k}=await this._getUser(c);if(k)throw k;const C={provider_token:i,provider_refresh_token:o,access_token:c,expires_in:g,expires_at:w,refresh_token:u,token_type:l,user:y.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:C,redirectType:r.type},error:null})}catch(i){if(ke(i))return this._returnResult({data:{session:null,redirectType:null},error:i});throw i}}_isImplicitGrantCallback(r){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),r):!!(r.access_token||r.error_description)}async _isPKCECallback(r){const n=await hn(this.storage,`${this.storageKey}-code-verifier`);return!!(r.code&&n)}async signOut(r={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(r))}async _signOut({scope:r}={scope:"global"}){return await this._useSession(async n=>{var i;const{data:o,error:c}=n;if(c&&!qi(c))return this._returnResult({error:c});const u=(i=o.session)===null||i===void 0?void 0:i.access_token;if(u){const{error:f}=await this.admin.signOut(u,r);if(f&&!(Hp(f)&&(f.status===404||f.status===401||f.status===403)||qi(f)))return this._returnResult({error:f})}return r!=="others"&&(await this._removeSession(),await xt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(r){const n=rg(),i={id:n,callback:r,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,i),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:i}}}async _emitInitialSession(r){return await this._useSession(async n=>{var i,o;try{const{data:{session:c},error:u}=n;if(u)throw u;await((i=this.stateChangeEmitters.get(r))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",c)),this._debug("INITIAL_SESSION","callback id",r,"session",c)}catch(c){await((o=this.stateChangeEmitters.get(r))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",r,"error",c),qi(c)?console.warn(c):console.error(c)}})}async resetPasswordForEmail(r,n={}){let i=null,o=null;this.flowType==="pkce"&&([i,o]=await qn(this.storage,this.storageKey,!0));try{return await _e(this.fetch,"POST",`${this.url}/recover`,{body:{email:r,code_challenge:i,code_challenge_method:o,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(c){if(await xt(this.storage,`${this.storageKey}-code-verifier`),ke(c))return this._returnResult({data:null,error:c});throw c}}async getUserIdentities(){var r;try{const{data:n,error:i}=await this.getUser();if(i)throw i;return this._returnResult({data:{identities:(r=n.user.identities)!==null&&r!==void 0?r:[]},error:null})}catch(n){if(ke(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(r){return"token"in r?this.linkIdentityIdToken(r):this.linkIdentityOAuth(r)}async linkIdentityOAuth(r){var n;try{const{data:i,error:o}=await this._useSession(async c=>{var u,f,d,l,h;const{data:g,error:w}=c;if(w)throw w;const v=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,r.provider,{redirectTo:(u=r.options)===null||u===void 0?void 0:u.redirectTo,scopes:(f=r.options)===null||f===void 0?void 0:f.scopes,queryParams:(d=r.options)===null||d===void 0?void 0:d.queryParams,skipBrowserRedirect:!0});return await _e(this.fetch,"GET",v,{headers:this.headers,jwt:(h=(l=g.session)===null||l===void 0?void 0:l.access_token)!==null&&h!==void 0?h:void 0})});if(o)throw o;return Ct()&&!(!((n=r.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(i==null?void 0:i.url),this._returnResult({data:{provider:r.provider,url:i==null?void 0:i.url},error:null})}catch(i){if(ke(i))return this._returnResult({data:{provider:r.provider,url:null},error:i});throw i}}async linkIdentityIdToken(r){return await this._useSession(async n=>{var i;try{const{error:o,data:{session:c}}=n;if(o)throw o;const{options:u,provider:f,token:d,access_token:l,nonce:h}=r,g=await _e(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(i=c==null?void 0:c.access_token)!==null&&i!==void 0?i:void 0,body:{provider:f,id_token:d,access_token:l,nonce:h,link_identity:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken}},xform:sr}),{data:w,error:v}=g;return v?this._returnResult({data:{user:null,session:null},error:v}):!w||!w.session||!w.user?this._returnResult({data:{user:null,session:null},error:new Wn}):(w.session&&(await this._saveSession(w.session),await this._notifyAllSubscribers("USER_UPDATED",w.session)),this._returnResult({data:w,error:v}))}catch(o){if(await xt(this.storage,`${this.storageKey}-code-verifier`),ke(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}})}async unlinkIdentity(r){try{return await this._useSession(async n=>{var i,o;const{data:c,error:u}=n;if(u)throw u;return await _e(this.fetch,"DELETE",`${this.url}/user/identities/${r.identity_id}`,{headers:this.headers,jwt:(o=(i=c.session)===null||i===void 0?void 0:i.access_token)!==null&&o!==void 0?o:void 0})})}catch(n){if(ke(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(r){const n=`#_refreshAccessToken(${r.substring(0,5)}...)`;this._debug(n,"begin");try{const i=Date.now();return await og(async o=>(o>0&&await ig(200*Math.pow(2,o-1)),this._debug(n,"refreshing attempt",o),await _e(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:r},headers:this.headers,xform:sr})),(o,c)=>{const u=200*Math.pow(2,o);return c&&Us(c)&&Date.now()+u-i{try{await f.callback(r,n)}catch(d){c.push(d)}});if(await Promise.all(u),c.length>0){for(let f=0;fthis._autoRefreshTokenTick(),Qn);this.autoRefreshTicker=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const r=this.autoRefreshTicker;this.autoRefreshTicker=null,r&&clearInterval(r);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const r=Date.now();try{return await this._useSession(async n=>{const{data:{session:i}}=n;if(!i||!i.refresh_token||!i.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const o=Math.floor((i.expires_at*1e3-r)/Qn);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${Qn}ms, refresh threshold is ${Is} ticks`),o<=Is&&await this._callRefreshToken(i.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(r){if(r.isAcquireTimeout||r instanceof Gu)this._debug("auto refresh token tick lock not available");else throw r}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Ct()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(r){this._debug("#visibilityChangedCallback","error",r)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(r){console.error("_handleVisibilityChange",r)}}async _onVisibilityChanged(r){const n=`#_onVisibilityChanged(${r})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),r||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(r,n,i){const o=[`provider=${encodeURIComponent(n)}`];if(i!=null&&i.redirectTo&&o.push(`redirect_to=${encodeURIComponent(i.redirectTo)}`),i!=null&&i.scopes&&o.push(`scopes=${encodeURIComponent(i.scopes)}`),this.flowType==="pkce"){const[c,u]=await qn(this.storage,this.storageKey),f=new URLSearchParams({code_challenge:`${encodeURIComponent(c)}`,code_challenge_method:`${encodeURIComponent(u)}`});o.push(f.toString())}if(i!=null&&i.queryParams){const c=new URLSearchParams(i.queryParams);o.push(c.toString())}return i!=null&&i.skipBrowserRedirect&&o.push(`skip_http_redirect=${i.skipBrowserRedirect}`),`${r}?${o.join("&")}`}async _unenroll(r){try{return await this._useSession(async n=>{var i;const{data:o,error:c}=n;return c?this._returnResult({data:null,error:c}):await _e(this.fetch,"DELETE",`${this.url}/factors/${r.factorId}`,{headers:this.headers,jwt:(i=o==null?void 0:o.session)===null||i===void 0?void 0:i.access_token})})}catch(n){if(ke(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(r){try{return await this._useSession(async n=>{var i,o;const{data:c,error:u}=n;if(u)return this._returnResult({data:null,error:u});const f=Object.assign({friendly_name:r.friendlyName,factor_type:r.factorType},r.factorType==="phone"?{phone:r.phone}:r.factorType==="totp"?{issuer:r.issuer}:{}),{data:d,error:l}=await _e(this.fetch,"POST",`${this.url}/factors`,{body:f,headers:this.headers,jwt:(i=c==null?void 0:c.session)===null||i===void 0?void 0:i.access_token});return l?this._returnResult({data:null,error:l}):(r.factorType==="totp"&&d.type==="totp"&&(!((o=d==null?void 0:d.totp)===null||o===void 0)&&o.qr_code)&&(d.totp.qr_code=`data:image/svg+xml;utf-8,${d.totp.qr_code}`),this._returnResult({data:d,error:null}))})}catch(n){if(ke(n))return this._returnResult({data:null,error:n});throw n}}async _verify(r){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var i;const{data:o,error:c}=n;if(c)return this._returnResult({data:null,error:c});const u=Object.assign({challenge_id:r.challengeId},"webauthn"in r?{webauthn:Object.assign(Object.assign({},r.webauthn),{credential_response:r.webauthn.type==="create"?Fg(r.webauthn.credential_response):Ig(r.webauthn.credential_response)})}:{code:r.code}),{data:f,error:d}=await _e(this.fetch,"POST",`${this.url}/factors/${r.factorId}/verify`,{body:u,headers:this.headers,jwt:(i=o==null?void 0:o.session)===null||i===void 0?void 0:i.access_token});return d?this._returnResult({data:null,error:d}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+f.expires_in},f)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",f),this._returnResult({data:f,error:d}))})}catch(n){if(ke(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(r){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var i;const{data:o,error:c}=n;if(c)return this._returnResult({data:null,error:c});const u=await _e(this.fetch,"POST",`${this.url}/factors/${r.factorId}/challenge`,{body:r,headers:this.headers,jwt:(i=o==null?void 0:o.session)===null||i===void 0?void 0:i.access_token});if(u.error)return u;const{data:f}=u;if(f.type!=="webauthn")return{data:f,error:null};switch(f.webauthn.type){case"create":return{data:Object.assign(Object.assign({},f),{webauthn:Object.assign(Object.assign({},f.webauthn),{credential_options:Object.assign(Object.assign({},f.webauthn.credential_options),{publicKey:Dg(f.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},f),{webauthn:Object.assign(Object.assign({},f.webauthn),{credential_options:Object.assign(Object.assign({},f.webauthn.credential_options),{publicKey:Ng(f.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(ke(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(r){const{data:n,error:i}=await this._challenge({factorId:r.factorId});return i?this._returnResult({data:null,error:i}):await this._verify({factorId:r.factorId,challengeId:n.id,code:r.code})}async _listFactors(){var r;const{data:{user:n},error:i}=await this.getUser();if(i)return{data:null,error:i};const o={all:[],phone:[],totp:[],webauthn:[]};for(const c of(r=n==null?void 0:n.factors)!==null&&r!==void 0?r:[])o.all.push(c),c.status==="verified"&&o[c.factor_type].push(c);return{data:o,error:null}}async _getAuthenticatorAssuranceLevel(r){var n,i,o,c;if(r)try{const{payload:v}=$i(r);let b=null;v.aal&&(b=v.aal);let y=b;const{data:{user:k},error:C}=await this.getUser(r);if(C)return this._returnResult({data:null,error:C});((i=(n=k==null?void 0:k.factors)===null||n===void 0?void 0:n.filter(N=>N.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(y="aal2");const _=v.amr||[];return{data:{currentLevel:b,nextLevel:y,currentAuthenticationMethods:_},error:null}}catch(v){if(ke(v))return this._returnResult({data:null,error:v});throw v}const{data:{session:u},error:f}=await this.getSession();if(f)return this._returnResult({data:null,error:f});if(!u)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:d}=$i(u.access_token);let l=null;d.aal&&(l=d.aal);let h=l;((c=(o=u.user.factors)===null||o===void 0?void 0:o.filter(v=>v.status==="verified"))!==null&&c!==void 0?c:[]).length>0&&(h="aal2");const w=d.amr||[];return{data:{currentLevel:l,nextLevel:h,currentAuthenticationMethods:w},error:null}}async _getAuthorizationDetails(r){try{return await this._useSession(async n=>{const{data:{session:i},error:o}=n;return o?this._returnResult({data:null,error:o}):i?await _e(this.fetch,"GET",`${this.url}/oauth/authorizations/${r}`,{headers:this.headers,jwt:i.access_token,xform:c=>({data:c,error:null})}):this._returnResult({data:null,error:new Gt})})}catch(n){if(ke(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(r,n){try{return await this._useSession(async i=>{const{data:{session:o},error:c}=i;if(c)return this._returnResult({data:null,error:c});if(!o)return this._returnResult({data:null,error:new Gt});const u=await _e(this.fetch,"POST",`${this.url}/oauth/authorizations/${r}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"approve"},xform:f=>({data:f,error:null})});return u.data&&u.data.redirect_url&&Ct()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(u.data.redirect_url),u})}catch(i){if(ke(i))return this._returnResult({data:null,error:i});throw i}}async _denyAuthorization(r,n){try{return await this._useSession(async i=>{const{data:{session:o},error:c}=i;if(c)return this._returnResult({data:null,error:c});if(!o)return this._returnResult({data:null,error:new Gt});const u=await _e(this.fetch,"POST",`${this.url}/oauth/authorizations/${r}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"deny"},xform:f=>({data:f,error:null})});return u.data&&u.data.redirect_url&&Ct()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(u.data.redirect_url),u})}catch(i){if(ke(i))return this._returnResult({data:null,error:i});throw i}}async _listOAuthGrants(){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;return i?this._returnResult({data:null,error:i}):n?await _e(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new Gt})})}catch(r){if(ke(r))return this._returnResult({data:null,error:r});throw r}}async _revokeOAuthGrant(r){try{return await this._useSession(async n=>{const{data:{session:i},error:o}=n;return o?this._returnResult({data:null,error:o}):i?(await _e(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:i.access_token,query:{client_id:r.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Gt})})}catch(n){if(ke(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(r,n={keys:[]}){let i=n.keys.find(f=>f.kid===r);if(i)return i;const o=Date.now();if(i=this.jwks.keys.find(f=>f.kid===r),i&&this.jwks_cached_at+Wp>o)return i;const{data:c,error:u}=await _e(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(u)throw u;return!c.keys||c.keys.length===0||(this.jwks=c,this.jwks_cached_at=o,i=c.keys.find(f=>f.kid===r),!i)?null:i}async getClaims(r,n={}){try{let i=r;if(!i){const{data:v,error:b}=await this.getSession();if(b||!v.session)return this._returnResult({data:null,error:b});i=v.session.access_token}const{header:o,payload:c,signature:u,raw:{header:f,payload:d}}=$i(i);n!=null&&n.allowExpired||fg(c.exp);const l=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!l){const{error:v}=await this.getUser(i);if(v)throw v;return{data:{claims:c,header:o,signature:u},error:null}}const h=hg(o.alg),g=await crypto.subtle.importKey("jwk",l,h,!0,["verify"]);if(!await crypto.subtle.verify(h,g,u,eg(`${f}.${d}`)))throw new js("Invalid JWT signature");return{data:{claims:c,header:o,signature:u},error:null}}catch(i){if(ke(i))return this._returnResult({data:null,error:i});throw i}}}za.nextInstanceID={};const Wg=za,Vg="2.103.2";let Ua="";typeof Deno<"u"?Ua="deno":typeof document<"u"?Ua="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Ua="react-native":Ua="node";const Hg={headers:{"X-Client-Info":`supabase-js-${Ua}/${Vg}`}},qg={schema:"public"},Jg={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Yg={};function ja(e){"@babel/helpers - typeof";return ja=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ja(e)}function Kg(e,r){if(ja(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(ja(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Zg(e){var r=Kg(e,"string");return ja(r)=="symbol"?r:r+""}function $g(e,r,n){return(r=Zg(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Ju(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,i)}return n}function ct(e){for(var r=1;re?(...r)=>e(...r):(...r)=>fetch(...r),tm=()=>Headers,rm=(e,r,n)=>{const i=em(n),o=tm();return async(c,u)=>{var f;const d=(f=await r())!==null&&f!==void 0?f:e;let l=new o(u==null?void 0:u.headers);return l.has("apikey")||l.set("apikey",e),l.has("Authorization")||l.set("Authorization",`Bearer ${d}`),i(c,ct(ct({},u),{},{headers:l}))}};function nm(e){return e.endsWith("/")?e:e+"/"}function am(e,r){var n,i;const{db:o,auth:c,realtime:u,global:f}=e,{db:d,auth:l,realtime:h,global:g}=r,w={db:ct(ct({},d),o),auth:ct(ct({},l),c),realtime:ct(ct({},h),u),storage:{},global:ct(ct(ct({},g),f),{},{headers:ct(ct({},(n=g==null?void 0:g.headers)!==null&&n!==void 0?n:{}),(i=f==null?void 0:f.headers)!==null&&i!==void 0?i:{})}),accessToken:async()=>""};return e.accessToken?w.accessToken=e.accessToken:delete w.accessToken,w}function im(e){const r=e==null?void 0:e.trim();if(!r)throw new Error("supabaseUrl is required.");if(!r.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(nm(r))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var om=class extends Wg{constructor(e){super(e)}},sm=class{constructor(e,r,n){var i,o;this.supabaseUrl=e,this.supabaseKey=r;const c=im(e);if(!r)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",c),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",c),this.storageUrl=new URL("storage/v1",c),this.functionsUrl=new URL("functions/v1",c);const u=`sb-${c.hostname.split(".")[0]}-auth-token`,f={db:qg,realtime:Yg,auth:ct(ct({},Jg),{},{storageKey:u}),global:Hg},d=am(n??{},f);if(this.storageKey=(i=d.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(o=d.global.headers)!==null&&o!==void 0?o:{},d.accessToken)this.accessToken=d.accessToken,this.auth=new Proxy({},{get:(h,g)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(g)} is not possible`)}});else{var l;this.auth=this._initSupabaseAuthClient((l=d.auth)!==null&&l!==void 0?l:{},this.headers,d.global.fetch)}this.fetch=rm(r,this._getAccessToken.bind(this),d.global.fetch),this.realtime=this._initRealtimeClient(ct({headers:this.headers,accessToken:this._getAccessToken.bind(this)},d.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(h=>this.realtime.setAuth(h)).catch(h=>console.warn("Failed to set initial Realtime auth token:",h)),this.rest=new Th(new URL("rest/v1",c).href,{headers:this.headers,schema:d.db.schema,fetch:this.fetch,timeout:d.db.timeout,urlLengthLimit:d.db.urlLengthLimit}),this.storage=new Up(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),d.accessToken||this._listenForAuthEvents()}get functions(){return new bh(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,r,n)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,r,n;if(e.accessToken)return await e.accessToken();const{data:i}=await e.auth.getSession();return(r=(n=i.session)===null||n===void 0?void 0:n.access_token)!==null&&r!==void 0?r:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,userStorage:o,storageKey:c,flowType:u,lock:f,debug:d,throwOnError:l},h,g){const w={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new om({url:this.authUrl.href,headers:ct(ct({},w),h),storageKey:c,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,userStorage:o,flowType:u,lock:f,debug:d,throwOnError:l,fetch:g,hasCustomAuthorizationHeader:Object.keys(this.headers).some(v=>v.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new up(this.realtimeUrl.href,ct(ct({},e),{},{params:ct(ct({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,r)=>{this._handleTokenChanged(e,"CLIENT",r==null?void 0:r.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const lm=(e,r,n)=>new sm(e,r,n);function cm(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const r=e.version;if(r==null)return!1;const n=r.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}cm()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const um=lm("https://pddwxrgdbaqbkfpbglyw.supabase.co","sb_secret_cnnA5_MOeJ82TIgAU10NNw_WLmU3dAd");async function Yu(e,r,n){const{data:i,error:o}=await um.from("calculator_benchmarks").select("p25, p50, p75").eq("metric_key",e).eq("industry",r).eq("company_size_band",n).maybeSingle();if(o)throw new Error(`Benchmark fetch failed: ${o.message}`);if(!i)throw new Error(`No benchmark found for ${e} / ${r} / ${n}`);return i}function ro(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 Qs={exports:{}};/*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files (c) 2009-2016 Stuart Knightley Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/main/LICENSE */var Ku;function Am(){return Ku||(Ku=1,(function(e,r){(function(n){e.exports=n()})(function(){return(function n(i,o,c){function u(l,h){if(!o[l]){if(!i[l]){var g=typeof ro=="function"&&ro;if(!h&&g)return g(l,!0);if(f)return f(l,!0);var w=new Error("Cannot find module '"+l+"'");throw w.code="MODULE_NOT_FOUND",w}var v=o[l]={exports:{}};i[l][0].call(v.exports,function(b){var y=i[l][1][b];return u(y||b)},v,v.exports,n,i,o,c)}return o[l].exports}for(var f=typeof ro=="function"&&ro,d=0;d>2,v=(3&l)<<4|h>>4,b=1<_?(15&h)<<2|g>>6:64,y=2<_?63&g:64,k.push(f.charAt(w)+f.charAt(v)+f.charAt(b)+f.charAt(y));return k.join("")},o.decode=function(d){var l,h,g,w,v,b,y=0,k=0,C="data:";if(d.substr(0,C.length)===C)throw new Error("Invalid base64 input, it looks like a data url.");var E,_=3*(d=d.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(d.charAt(d.length-1)===f.charAt(64)&&_--,d.charAt(d.length-2)===f.charAt(64)&&_--,_%1!=0)throw new Error("Invalid base64 input, bad content length.");for(E=u.uint8array?new Uint8Array(0|_):new Array(0|_);y>4,h=(15&w)<<4|(v=f.indexOf(d.charAt(y++)))>>2,g=(3&v)<<6|(b=f.indexOf(d.charAt(y++))),E[k++]=l,v!==64&&(E[k++]=h),b!==64&&(E[k++]=g);return E}},{"./support":30,"./utils":32}],2:[function(n,i,o){var c=n("./external"),u=n("./stream/DataWorker"),f=n("./stream/Crc32Probe"),d=n("./stream/DataLengthProbe");function l(h,g,w,v,b){this.compressedSize=h,this.uncompressedSize=g,this.crc32=w,this.compression=v,this.compressedContent=b}l.prototype={getContentWorker:function(){var h=new u(c.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new d("data_length")),g=this;return h.on("end",function(){if(this.streamInfo.data_length!==g.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),h},getCompressedWorker:function(){return new u(c.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},l.createWorkerFrom=function(h,g,w){return h.pipe(new f).pipe(new d("uncompressedSize")).pipe(g.compressWorker(w)).pipe(new d("compressedSize")).withStreamInfo("compression",g)},i.exports=l},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,i,o){var c=n("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new c("STORE compression")},uncompressWorker:function(){return new c("STORE decompression")}},o.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,i,o){var c=n("./utils"),u=(function(){for(var f,d=[],l=0;l<256;l++){f=l;for(var h=0;h<8;h++)f=1&f?3988292384^f>>>1:f>>>1;d[l]=f}return d})();i.exports=function(f,d){return f!==void 0&&f.length?c.getTypeOf(f)!=="string"?(function(l,h,g,w){var v=u,b=w+g;l^=-1;for(var y=w;y>>8^v[255&(l^h[y])];return-1^l})(0|d,f,f.length,0):(function(l,h,g,w){var v=u,b=w+g;l^=-1;for(var y=w;y>>8^v[255&(l^h.charCodeAt(y))];return-1^l})(0|d,f,f.length,0):0}},{"./utils":32}],5:[function(n,i,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(n,i,o){var c=null;c=typeof Promise<"u"?Promise:n("lie"),i.exports={Promise:c}},{lie:37}],7:[function(n,i,o){var c=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",u=n("pako"),f=n("./utils"),d=n("./stream/GenericWorker"),l=c?"uint8array":"array";function h(g,w){d.call(this,"FlateWorker/"+g),this._pako=null,this._pakoAction=g,this._pakoOptions=w,this.meta={}}o.magic="\b\0",f.inherits(h,d),h.prototype.processChunk=function(g){this.meta=g.meta,this._pako===null&&this._createPako(),this._pako.push(f.transformTo(l,g.data),!1)},h.prototype.flush=function(){d.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){d.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new u[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var g=this;this._pako.onData=function(w){g.push({data:w,meta:g.meta})}},o.compressWorker=function(g){return new h("Deflate",g)},o.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,i,o){function c(v,b){var y,k="";for(y=0;y>>=8;return k}function u(v,b,y,k,C,E){var _,N,I=v.file,G=v.compression,M=E!==l.utf8encode,O=f.transformTo("string",E(I.name)),z=f.transformTo("string",l.utf8encode(I.name)),Y=I.comment,me=f.transformTo("string",E(Y)),F=f.transformTo("string",l.utf8encode(Y)),J=z.length!==I.name.length,S=F.length!==Y.length,ee="",Ce="",ie="",W=I.dir,V=I.date,ae={crc32:0,compressedSize:0,uncompressedSize:0};b&&!y||(ae.crc32=v.crc32,ae.compressedSize=v.compressedSize,ae.uncompressedSize=v.uncompressedSize);var P=0;b&&(P|=8),M||!J&&!S||(P|=2048);var T=0,Z=0;W&&(T|=16),C==="UNIX"?(Z=798,T|=(function(re,ye){var Pe=re;return re||(Pe=ye?16893:33204),(65535&Pe)<<16})(I.unixPermissions,W)):(Z=20,T|=(function(re){return 63&(re||0)})(I.dosPermissions)),_=V.getUTCHours(),_<<=6,_|=V.getUTCMinutes(),_<<=5,_|=V.getUTCSeconds()/2,N=V.getUTCFullYear()-1980,N<<=4,N|=V.getUTCMonth()+1,N<<=5,N|=V.getUTCDate(),J&&(Ce=c(1,1)+c(h(O),4)+z,ee+="up"+c(Ce.length,2)+Ce),S&&(ie=c(1,1)+c(h(me),4)+F,ee+="uc"+c(ie.length,2)+ie);var se="";return se+=` \0`,se+=c(P,2),se+=G.magic,se+=c(_,2),se+=c(N,2),se+=c(ae.crc32,4),se+=c(ae.compressedSize,4),se+=c(ae.uncompressedSize,4),se+=c(O.length,2),se+=c(ee.length,2),{fileRecord:g.LOCAL_FILE_HEADER+se+O+ee,dirRecord:g.CENTRAL_FILE_HEADER+c(Z,2)+se+c(me.length,2)+"\0\0\0\0"+c(T,4)+c(k,4)+O+ee+me}}var f=n("../utils"),d=n("../stream/GenericWorker"),l=n("../utf8"),h=n("../crc32"),g=n("../signature");function w(v,b,y,k){d.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=b,this.zipPlatform=y,this.encodeFileName=k,this.streamFiles=v,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}f.inherits(w,d),w.prototype.push=function(v){var b=v.meta.percent||0,y=this.entriesCount,k=this._sources.length;this.accumulate?this.contentBuffer.push(v):(this.bytesWritten+=v.data.length,d.prototype.push.call(this,{data:v.data,meta:{currentFile:this.currentFile,percent:y?(b+100*(y-k-1))/y:100}}))},w.prototype.openedSource=function(v){this.currentSourceOffset=this.bytesWritten,this.currentFile=v.file.name;var b=this.streamFiles&&!v.file.dir;if(b){var y=u(v,b,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:y.fileRecord,meta:{percent:0}})}else this.accumulate=!0},w.prototype.closedSource=function(v){this.accumulate=!1;var b=this.streamFiles&&!v.file.dir,y=u(v,b,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(y.dirRecord),b)this.push({data:(function(k){return g.DATA_DESCRIPTOR+c(k.crc32,4)+c(k.compressedSize,4)+c(k.uncompressedSize,4)})(v),meta:{percent:100}});else for(this.push({data:y.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},w.prototype.flush=function(){for(var v=this.bytesWritten,b=0;b=this.index;d--)l=(l<<8)+this.byteAt(d);return this.index+=f,l},readString:function(f){return c.transformTo("string",this.readData(f))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var f=this.readInt(4);return new Date(Date.UTC(1980+(f>>25&127),(f>>21&15)-1,f>>16&31,f>>11&31,f>>5&63,(31&f)<<1))}},i.exports=u},{"../utils":32}],19:[function(n,i,o){var c=n("./Uint8ArrayReader");function u(f){c.call(this,f)}n("../utils").inherits(u,c),u.prototype.readData=function(f){this.checkOffset(f);var d=this.data.slice(this.zero+this.index,this.zero+this.index+f);return this.index+=f,d},i.exports=u},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,i,o){var c=n("./DataReader");function u(f){c.call(this,f)}n("../utils").inherits(u,c),u.prototype.byteAt=function(f){return this.data.charCodeAt(this.zero+f)},u.prototype.lastIndexOfSignature=function(f){return this.data.lastIndexOf(f)-this.zero},u.prototype.readAndCheckSignature=function(f){return f===this.readData(4)},u.prototype.readData=function(f){this.checkOffset(f);var d=this.data.slice(this.zero+this.index,this.zero+this.index+f);return this.index+=f,d},i.exports=u},{"../utils":32,"./DataReader":18}],21:[function(n,i,o){var c=n("./ArrayReader");function u(f){c.call(this,f)}n("../utils").inherits(u,c),u.prototype.readData=function(f){if(this.checkOffset(f),f===0)return new Uint8Array(0);var d=this.data.subarray(this.zero+this.index,this.zero+this.index+f);return this.index+=f,d},i.exports=u},{"../utils":32,"./ArrayReader":17}],22:[function(n,i,o){var c=n("../utils"),u=n("../support"),f=n("./ArrayReader"),d=n("./StringReader"),l=n("./NodeBufferReader"),h=n("./Uint8ArrayReader");i.exports=function(g){var w=c.getTypeOf(g);return c.checkSupport(w),w!=="string"||u.uint8array?w==="nodebuffer"?new l(g):u.uint8array?new h(c.transformTo("uint8array",g)):new f(c.transformTo("array",g)):new d(g)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,i,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,i,o){var c=n("./GenericWorker"),u=n("../utils");function f(d){c.call(this,"ConvertWorker to "+d),this.destType=d}u.inherits(f,c),f.prototype.processChunk=function(d){this.push({data:u.transformTo(this.destType,d.data),meta:d.meta})},i.exports=f},{"../utils":32,"./GenericWorker":28}],25:[function(n,i,o){var c=n("./GenericWorker"),u=n("../crc32");function f(){c.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(f,c),f.prototype.processChunk=function(d){this.streamInfo.crc32=u(d.data,this.streamInfo.crc32||0),this.push(d)},i.exports=f},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,i,o){var c=n("../utils"),u=n("./GenericWorker");function f(d){u.call(this,"DataLengthProbe for "+d),this.propName=d,this.withStreamInfo(d,0)}c.inherits(f,u),f.prototype.processChunk=function(d){if(d){var l=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=l+d.data.length}u.prototype.processChunk.call(this,d)},i.exports=f},{"../utils":32,"./GenericWorker":28}],27:[function(n,i,o){var c=n("../utils"),u=n("./GenericWorker");function f(d){u.call(this,"DataWorker");var l=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,d.then(function(h){l.dataIsReady=!0,l.data=h,l.max=h&&h.length||0,l.type=c.getTypeOf(h),l.isPaused||l._tickAndRepeat()},function(h){l.error(h)})}c.inherits(f,u),f.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this.data=null},f.prototype.resume=function(){return!!u.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,c.delay(this._tickAndRepeat,[],this)),!0)},f.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(c.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},f.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var d=null,l=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":d=this.data.substring(this.index,l);break;case"uint8array":d=this.data.subarray(this.index,l);break;case"array":case"nodebuffer":d=this.data.slice(this.index,l)}return this.index=l,this.push({data:d,meta:{percent:this.max?this.index/this.max*100:0}})},i.exports=f},{"../utils":32,"./GenericWorker":28}],28:[function(n,i,o){function c(u){this.name=u||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}c.prototype={push:function(u){this.emit("data",u)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(u){this.emit("error",u)}return!0},error:function(u){return!this.isFinished&&(this.isPaused?this.generatedError=u:(this.isFinished=!0,this.emit("error",u),this.previous&&this.previous.error(u),this.cleanUp()),!0)},on:function(u,f){return this._listeners[u].push(f),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(u,f){if(this._listeners[u])for(var d=0;d "+u:u}},i.exports=c},{}],29:[function(n,i,o){var c=n("../utils"),u=n("./ConvertWorker"),f=n("./GenericWorker"),d=n("../base64"),l=n("../support"),h=n("../external"),g=null;if(l.nodestream)try{g=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function w(b,y){return new h.Promise(function(k,C){var E=[],_=b._internalType,N=b._outputType,I=b._mimeType;b.on("data",function(G,M){E.push(G),y&&y(M)}).on("error",function(G){E=[],C(G)}).on("end",function(){try{var G=(function(M,O,z){switch(M){case"blob":return c.newBlob(c.transformTo("arraybuffer",O),z);case"base64":return d.encode(O);default:return c.transformTo(M,O)}})(N,(function(M,O){var z,Y=0,me=null,F=0;for(z=0;z"u")o.blob=!1;else{var c=new ArrayBuffer(0);try{o.blob=new Blob([c],{type:"application/zip"}).size===0}catch{try{var u=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);u.append(c),o.blob=u.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!n("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(n,i,o){for(var c=n("./utils"),u=n("./support"),f=n("./nodejsUtils"),d=n("./stream/GenericWorker"),l=new Array(256),h=0;h<256;h++)l[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;l[254]=l[254]=1;function g(){d.call(this,"utf-8 decode"),this.leftOver=null}function w(){d.call(this,"utf-8 encode")}o.utf8encode=function(v){return u.nodebuffer?f.newBufferFrom(v,"utf-8"):(function(b){var y,k,C,E,_,N=b.length,I=0;for(E=0;E>>6:(k<65536?y[_++]=224|k>>>12:(y[_++]=240|k>>>18,y[_++]=128|k>>>12&63),y[_++]=128|k>>>6&63),y[_++]=128|63&k);return y})(v)},o.utf8decode=function(v){return u.nodebuffer?c.transformTo("nodebuffer",v).toString("utf-8"):(function(b){var y,k,C,E,_=b.length,N=new Array(2*_);for(y=k=0;y<_;)if((C=b[y++])<128)N[k++]=C;else if(4<(E=l[C]))N[k++]=65533,y+=E-1;else{for(C&=E===2?31:E===3?15:7;1>10&1023,N[k++]=56320|1023&C)}return N.length!==k&&(N.subarray?N=N.subarray(0,k):N.length=k),c.applyFromCharCode(N)})(v=c.transformTo(u.uint8array?"uint8array":"array",v))},c.inherits(g,d),g.prototype.processChunk=function(v){var b=c.transformTo(u.uint8array?"uint8array":"array",v.data);if(this.leftOver&&this.leftOver.length){if(u.uint8array){var y=b;(b=new Uint8Array(y.length+this.leftOver.length)).set(this.leftOver,0),b.set(y,this.leftOver.length)}else b=this.leftOver.concat(b);this.leftOver=null}var k=(function(E,_){var N;for((_=_||E.length)>E.length&&(_=E.length),N=_-1;0<=N&&(192&E[N])==128;)N--;return N<0||N===0?_:N+l[E[N]]>_?N:_})(b),C=b;k!==b.length&&(u.uint8array?(C=b.subarray(0,k),this.leftOver=b.subarray(k,b.length)):(C=b.slice(0,k),this.leftOver=b.slice(k,b.length))),this.push({data:o.utf8decode(C),meta:v.meta})},g.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=g,c.inherits(w,d),w.prototype.processChunk=function(v){this.push({data:o.utf8encode(v.data),meta:v.meta})},o.Utf8EncodeWorker=w},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,i,o){var c=n("./support"),u=n("./base64"),f=n("./nodejsUtils"),d=n("./external");function l(y){return y}function h(y,k){for(var C=0;C>8;this.dir=!!(16&this.externalFileAttributes),v==0&&(this.dosPermissions=63&this.externalFileAttributes),v==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var v=c(this.extraFields[1].value);this.uncompressedSize===u.MAX_VALUE_32BITS&&(this.uncompressedSize=v.readInt(8)),this.compressedSize===u.MAX_VALUE_32BITS&&(this.compressedSize=v.readInt(8)),this.localHeaderOffset===u.MAX_VALUE_32BITS&&(this.localHeaderOffset=v.readInt(8)),this.diskNumberStart===u.MAX_VALUE_32BITS&&(this.diskNumberStart=v.readInt(4))}},readExtraFields:function(v){var b,y,k,C=v.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});v.index+4>>6:(v<65536?w[k++]=224|v>>>12:(w[k++]=240|v>>>18,w[k++]=128|v>>>12&63),w[k++]=128|v>>>6&63),w[k++]=128|63&v);return w},o.buf2binstring=function(g){return h(g,g.length)},o.binstring2buf=function(g){for(var w=new c.Buf8(g.length),v=0,b=w.length;v>10&1023,E[b++]=56320|1023&y)}return h(E,b)},o.utf8border=function(g,w){var v;for((w=w||g.length)>g.length&&(w=g.length),v=w-1;0<=v&&(192&g[v])==128;)v--;return v<0||v===0?w:v+d[g[v]]>w?v:w}},{"./common":41}],43:[function(n,i,o){i.exports=function(c,u,f,d){for(var l=65535&c|0,h=c>>>16&65535|0,g=0;f!==0;){for(f-=g=2e3>>1:u>>>1;f[d]=u}return f})();i.exports=function(u,f,d,l){var h=c,g=l+d;u^=-1;for(var w=l;w>>8^h[255&(u^f[w])];return-1^u}},{}],46:[function(n,i,o){var c,u=n("../utils/common"),f=n("./trees"),d=n("./adler32"),l=n("./crc32"),h=n("./messages"),g=0,w=4,v=0,b=-2,y=-1,k=4,C=2,E=8,_=9,N=286,I=30,G=19,M=2*N+1,O=15,z=3,Y=258,me=Y+z+1,F=42,J=113,S=1,ee=2,Ce=3,ie=4;function W(x,te){return x.msg=h[te],te}function V(x){return(x<<1)-(4x.avail_out&&($=x.avail_out),$!==0&&(u.arraySet(x.output,te.pending_buf,te.pending_out,$,x.next_out),x.next_out+=$,te.pending_out+=$,x.total_out+=$,x.avail_out-=$,te.pending-=$,te.pending===0&&(te.pending_out=0))}function T(x,te){f._tr_flush_block(x,0<=x.block_start?x.block_start:-1,x.strstart-x.block_start,te),x.block_start=x.strstart,P(x.strm)}function Z(x,te){x.pending_buf[x.pending++]=te}function se(x,te){x.pending_buf[x.pending++]=te>>>8&255,x.pending_buf[x.pending++]=255&te}function re(x,te){var $,R,B=x.max_chain_length,j=x.strstart,le=x.prev_length,ne=x.nice_match,H=x.strstart>x.w_size-me?x.strstart-(x.w_size-me):0,fe=x.window,be=x.w_mask,pe=x.prev,Be=x.strstart+Y,Ye=fe[j+le-1],je=fe[j+le];x.prev_length>=x.good_match&&(B>>=2),ne>x.lookahead&&(ne=x.lookahead);do if(fe[($=te)+le]===je&&fe[$+le-1]===Ye&&fe[$]===fe[j]&&fe[++$]===fe[j+1]){j+=2,$++;do;while(fe[++j]===fe[++$]&&fe[++j]===fe[++$]&&fe[++j]===fe[++$]&&fe[++j]===fe[++$]&&fe[++j]===fe[++$]&&fe[++j]===fe[++$]&&fe[++j]===fe[++$]&&fe[++j]===fe[++$]&&jH&&--B!=0);return le<=x.lookahead?le:x.lookahead}function ye(x){var te,$,R,B,j,le,ne,H,fe,be,pe=x.w_size;do{if(B=x.window_size-x.lookahead-x.strstart,x.strstart>=pe+(pe-me)){for(u.arraySet(x.window,x.window,pe,pe,0),x.match_start-=pe,x.strstart-=pe,x.block_start-=pe,te=$=x.hash_size;R=x.head[--te],x.head[te]=pe<=R?R-pe:0,--$;);for(te=$=pe;R=x.prev[--te],x.prev[te]=pe<=R?R-pe:0,--$;);B+=pe}if(x.strm.avail_in===0)break;if(le=x.strm,ne=x.window,H=x.strstart+x.lookahead,fe=B,be=void 0,be=le.avail_in,fe=z)for(j=x.strstart-x.insert,x.ins_h=x.window[j],x.ins_h=(x.ins_h<=z&&(x.ins_h=(x.ins_h<=z)if(R=f._tr_tally(x,x.strstart-x.match_start,x.match_length-z),x.lookahead-=x.match_length,x.match_length<=x.max_lazy_match&&x.lookahead>=z){for(x.match_length--;x.strstart++,x.ins_h=(x.ins_h<=z&&(x.ins_h=(x.ins_h<=z&&x.match_length<=x.prev_length){for(B=x.strstart+x.lookahead-z,R=f._tr_tally(x,x.strstart-1-x.prev_match,x.prev_length-z),x.lookahead-=x.prev_length-1,x.prev_length-=2;++x.strstart<=B&&(x.ins_h=(x.ins_h<x.pending_buf_size-5&&($=x.pending_buf_size-5);;){if(x.lookahead<=1){if(ye(x),x.lookahead===0&&te===g)return S;if(x.lookahead===0)break}x.strstart+=x.lookahead,x.lookahead=0;var R=x.block_start+$;if((x.strstart===0||x.strstart>=R)&&(x.lookahead=x.strstart-R,x.strstart=R,T(x,!1),x.strm.avail_out===0)||x.strstart-x.block_start>=x.w_size-me&&(T(x,!1),x.strm.avail_out===0))return S}return x.insert=0,te===w?(T(x,!0),x.strm.avail_out===0?Ce:ie):(x.strstart>x.block_start&&(T(x,!1),x.strm.avail_out),S)}),new ve(4,4,8,4,Pe),new ve(4,5,16,8,Pe),new ve(4,6,32,32,Pe),new ve(4,4,16,16,ge),new ve(8,16,32,32,ge),new ve(8,16,128,128,ge),new ve(8,32,128,256,ge),new ve(32,128,258,1024,ge),new ve(32,258,258,4096,ge)],o.deflateInit=function(x,te){return ot(x,te,E,15,8,0)},o.deflateInit2=ot,o.deflateReset=Ve,o.deflateResetKeep=Qe,o.deflateSetHeader=function(x,te){return x&&x.state?x.state.wrap!==2?b:(x.state.gzhead=te,v):b},o.deflate=function(x,te){var $,R,B,j;if(!x||!x.state||5>8&255),Z(R,R.gzhead.time>>16&255),Z(R,R.gzhead.time>>24&255),Z(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),Z(R,255&R.gzhead.os),R.gzhead.extra&&R.gzhead.extra.length&&(Z(R,255&R.gzhead.extra.length),Z(R,R.gzhead.extra.length>>8&255)),R.gzhead.hcrc&&(x.adler=l(x.adler,R.pending_buf,R.pending,0)),R.gzindex=0,R.status=69):(Z(R,0),Z(R,0),Z(R,0),Z(R,0),Z(R,0),Z(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),Z(R,3),R.status=J);else{var le=E+(R.w_bits-8<<4)<<8;le|=(2<=R.strategy||R.level<2?0:R.level<6?1:R.level===6?2:3)<<6,R.strstart!==0&&(le|=32),le+=31-le%31,R.status=J,se(R,le),R.strstart!==0&&(se(R,x.adler>>>16),se(R,65535&x.adler)),x.adler=1}if(R.status===69)if(R.gzhead.extra){for(B=R.pending;R.gzindex<(65535&R.gzhead.extra.length)&&(R.pending!==R.pending_buf_size||(R.gzhead.hcrc&&R.pending>B&&(x.adler=l(x.adler,R.pending_buf,R.pending-B,B)),P(x),B=R.pending,R.pending!==R.pending_buf_size));)Z(R,255&R.gzhead.extra[R.gzindex]),R.gzindex++;R.gzhead.hcrc&&R.pending>B&&(x.adler=l(x.adler,R.pending_buf,R.pending-B,B)),R.gzindex===R.gzhead.extra.length&&(R.gzindex=0,R.status=73)}else R.status=73;if(R.status===73)if(R.gzhead.name){B=R.pending;do{if(R.pending===R.pending_buf_size&&(R.gzhead.hcrc&&R.pending>B&&(x.adler=l(x.adler,R.pending_buf,R.pending-B,B)),P(x),B=R.pending,R.pending===R.pending_buf_size)){j=1;break}j=R.gzindexB&&(x.adler=l(x.adler,R.pending_buf,R.pending-B,B)),j===0&&(R.gzindex=0,R.status=91)}else R.status=91;if(R.status===91)if(R.gzhead.comment){B=R.pending;do{if(R.pending===R.pending_buf_size&&(R.gzhead.hcrc&&R.pending>B&&(x.adler=l(x.adler,R.pending_buf,R.pending-B,B)),P(x),B=R.pending,R.pending===R.pending_buf_size)){j=1;break}j=R.gzindexB&&(x.adler=l(x.adler,R.pending_buf,R.pending-B,B)),j===0&&(R.status=103)}else R.status=103;if(R.status===103&&(R.gzhead.hcrc?(R.pending+2>R.pending_buf_size&&P(x),R.pending+2<=R.pending_buf_size&&(Z(R,255&x.adler),Z(R,x.adler>>8&255),x.adler=0,R.status=J)):R.status=J),R.pending!==0){if(P(x),x.avail_out===0)return R.last_flush=-1,v}else if(x.avail_in===0&&V(te)<=V($)&&te!==w)return W(x,-5);if(R.status===666&&x.avail_in!==0)return W(x,-5);if(x.avail_in!==0||R.lookahead!==0||te!==g&&R.status!==666){var ne=R.strategy===2?(function(H,fe){for(var be;;){if(H.lookahead===0&&(ye(H),H.lookahead===0)){if(fe===g)return S;break}if(H.match_length=0,be=f._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++,be&&(T(H,!1),H.strm.avail_out===0))return S}return H.insert=0,fe===w?(T(H,!0),H.strm.avail_out===0?Ce:ie):H.last_lit&&(T(H,!1),H.strm.avail_out===0)?S:ee})(R,te):R.strategy===3?(function(H,fe){for(var be,pe,Be,Ye,je=H.window;;){if(H.lookahead<=Y){if(ye(H),H.lookahead<=Y&&fe===g)return S;if(H.lookahead===0)break}if(H.match_length=0,H.lookahead>=z&&0H.lookahead&&(H.match_length=H.lookahead)}if(H.match_length>=z?(be=f._tr_tally(H,1,H.match_length-z),H.lookahead-=H.match_length,H.strstart+=H.match_length,H.match_length=0):(be=f._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++),be&&(T(H,!1),H.strm.avail_out===0))return S}return H.insert=0,fe===w?(T(H,!0),H.strm.avail_out===0?Ce:ie):H.last_lit&&(T(H,!1),H.strm.avail_out===0)?S:ee})(R,te):c[R.level].func(R,te);if(ne!==Ce&&ne!==ie||(R.status=666),ne===S||ne===Ce)return x.avail_out===0&&(R.last_flush=-1),v;if(ne===ee&&(te===1?f._tr_align(R):te!==5&&(f._tr_stored_block(R,0,0,!1),te===3&&(ae(R.head),R.lookahead===0&&(R.strstart=0,R.block_start=0,R.insert=0))),P(x),x.avail_out===0))return R.last_flush=-1,v}return te!==w?v:R.wrap<=0?1:(R.wrap===2?(Z(R,255&x.adler),Z(R,x.adler>>8&255),Z(R,x.adler>>16&255),Z(R,x.adler>>24&255),Z(R,255&x.total_in),Z(R,x.total_in>>8&255),Z(R,x.total_in>>16&255),Z(R,x.total_in>>24&255)):(se(R,x.adler>>>16),se(R,65535&x.adler)),P(x),0=$.w_size&&(j===0&&(ae($.head),$.strstart=0,$.block_start=0,$.insert=0),fe=new u.Buf8($.w_size),u.arraySet(fe,te,be-$.w_size,$.w_size,0),te=fe,be=$.w_size),le=x.avail_in,ne=x.next_in,H=x.input,x.avail_in=be,x.next_in=0,x.input=te,ye($);$.lookahead>=z;){for(R=$.strstart,B=$.lookahead-(z-1);$.ins_h=($.ins_h<<$.hash_shift^$.window[R+z-1])&$.hash_mask,$.prev[R&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=R,R++,--B;);$.strstart=R,$.lookahead=z-1,ye($)}return $.strstart+=$.lookahead,$.block_start=$.strstart,$.insert=$.lookahead,$.lookahead=0,$.match_length=$.prev_length=z-1,$.match_available=0,x.next_in=ne,x.input=H,x.avail_in=le,$.wrap=j,v},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,i,o){i.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,i,o){i.exports=function(c,u){var f,d,l,h,g,w,v,b,y,k,C,E,_,N,I,G,M,O,z,Y,me,F,J,S,ee;f=c.state,d=c.next_in,S=c.input,l=d+(c.avail_in-5),h=c.next_out,ee=c.output,g=h-(u-c.avail_out),w=h+(c.avail_out-257),v=f.dmax,b=f.wsize,y=f.whave,k=f.wnext,C=f.window,E=f.hold,_=f.bits,N=f.lencode,I=f.distcode,G=(1<>>=z=O>>>24,_-=z,(z=O>>>16&255)===0)ee[h++]=65535&O;else{if(!(16&z)){if((64&z)==0){O=N[(65535&O)+(E&(1<>>=z,_-=z),_<15&&(E+=S[d++]<<_,_+=8,E+=S[d++]<<_,_+=8),O=I[E&M];r:for(;;){if(E>>>=z=O>>>24,_-=z,!(16&(z=O>>>16&255))){if((64&z)==0){O=I[(65535&O)+(E&(1<>>=z,_-=z,(z=h-g)>3,E&=(1<<(_-=Y<<3))-1,c.next_in=d,c.next_out=h,c.avail_in=d>>24&255)+(F>>>8&65280)+((65280&F)<<8)+((255&F)<<24)}function E(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new c.Buf16(320),this.work=new c.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(F){var J;return F&&F.state?(J=F.state,F.total_in=F.total_out=J.total=0,F.msg="",J.wrap&&(F.adler=1&J.wrap),J.mode=b,J.last=0,J.havedict=0,J.dmax=32768,J.head=null,J.hold=0,J.bits=0,J.lencode=J.lendyn=new c.Buf32(y),J.distcode=J.distdyn=new c.Buf32(k),J.sane=1,J.back=-1,w):v}function N(F){var J;return F&&F.state?((J=F.state).wsize=0,J.whave=0,J.wnext=0,_(F)):v}function I(F,J){var S,ee;return F&&F.state?(ee=F.state,J<0?(S=0,J=-J):(S=1+(J>>4),J<48&&(J&=15)),J&&(J<8||15=ie.wsize?(c.arraySet(ie.window,J,S-ie.wsize,ie.wsize,0),ie.wnext=0,ie.whave=ie.wsize):(ee<(Ce=ie.wsize-ie.wnext)&&(Ce=ee),c.arraySet(ie.window,J,S-ee,Ce,ie.wnext),(ee-=Ce)?(c.arraySet(ie.window,J,S-ee,ee,0),ie.wnext=ee,ie.whave=ie.wsize):(ie.wnext+=Ce,ie.wnext===ie.wsize&&(ie.wnext=0),ie.whave>>8&255,S.check=f(S.check,j,2,0),T=P=0,S.mode=2;break}if(S.flags=0,S.head&&(S.head.done=!1),!(1&S.wrap)||(((255&P)<<8)+(P>>8))%31){F.msg="incorrect header check",S.mode=30;break}if((15&P)!=8){F.msg="unknown compression method",S.mode=30;break}if(T-=4,x=8+(15&(P>>>=4)),S.wbits===0)S.wbits=x;else if(x>S.wbits){F.msg="invalid window size",S.mode=30;break}S.dmax=1<>8&1),512&S.flags&&(j[0]=255&P,j[1]=P>>>8&255,S.check=f(S.check,j,2,0)),T=P=0,S.mode=3;case 3:for(;T<32;){if(V===0)break e;V--,P+=ee[ie++]<>>8&255,j[2]=P>>>16&255,j[3]=P>>>24&255,S.check=f(S.check,j,4,0)),T=P=0,S.mode=4;case 4:for(;T<16;){if(V===0)break e;V--,P+=ee[ie++]<>8),512&S.flags&&(j[0]=255&P,j[1]=P>>>8&255,S.check=f(S.check,j,2,0)),T=P=0,S.mode=5;case 5:if(1024&S.flags){for(;T<16;){if(V===0)break e;V--,P+=ee[ie++]<>>8&255,S.check=f(S.check,j,2,0)),T=P=0}else S.head&&(S.head.extra=null);S.mode=6;case 6:if(1024&S.flags&&(V<(re=S.length)&&(re=V),re&&(S.head&&(x=S.head.extra_len-S.length,S.head.extra||(S.head.extra=new Array(S.head.extra_len)),c.arraySet(S.head.extra,ee,ie,re,x)),512&S.flags&&(S.check=f(S.check,ee,re,ie)),V-=re,ie+=re,S.length-=re),S.length))break e;S.length=0,S.mode=7;case 7:if(2048&S.flags){if(V===0)break e;for(re=0;x=ee[ie+re++],S.head&&x&&S.length<65536&&(S.head.name+=String.fromCharCode(x)),x&&re>9&1,S.head.done=!0),F.adler=S.check=0,S.mode=12;break;case 10:for(;T<32;){if(V===0)break e;V--,P+=ee[ie++]<>>=7&T,T-=7&T,S.mode=27;break}for(;T<3;){if(V===0)break e;V--,P+=ee[ie++]<>>=1)){case 0:S.mode=14;break;case 1:if(Y(S),S.mode=20,J!==6)break;P>>>=2,T-=2;break e;case 2:S.mode=17;break;case 3:F.msg="invalid block type",S.mode=30}P>>>=2,T-=2;break;case 14:for(P>>>=7&T,T-=7&T;T<32;){if(V===0)break e;V--,P+=ee[ie++]<>>16^65535)){F.msg="invalid stored block lengths",S.mode=30;break}if(S.length=65535&P,T=P=0,S.mode=15,J===6)break e;case 15:S.mode=16;case 16:if(re=S.length){if(V>>=5,T-=5,S.ndist=1+(31&P),P>>>=5,T-=5,S.ncode=4+(15&P),P>>>=4,T-=4,286>>=3,T-=3}for(;S.have<19;)S.lens[le[S.have++]]=0;if(S.lencode=S.lendyn,S.lenbits=7,$={bits:S.lenbits},te=l(0,S.lens,0,19,S.lencode,0,S.work,$),S.lenbits=$.bits,te){F.msg="invalid code lengths set",S.mode=30;break}S.have=0,S.mode=19;case 19:for(;S.have>>16&255,Ue=65535&B,!((ge=B>>>24)<=T);){if(V===0)break e;V--,P+=ee[ie++]<>>=ge,T-=ge,S.lens[S.have++]=Ue;else{if(Ue===16){for(R=ge+2;T>>=ge,T-=ge,S.have===0){F.msg="invalid bit length repeat",S.mode=30;break}x=S.lens[S.have-1],re=3+(3&P),P>>>=2,T-=2}else if(Ue===17){for(R=ge+3;T>>=ge)),P>>>=3,T-=3}else{for(R=ge+7;T>>=ge)),P>>>=7,T-=7}if(S.have+re>S.nlen+S.ndist){F.msg="invalid bit length repeat",S.mode=30;break}for(;re--;)S.lens[S.have++]=x}}if(S.mode===30)break;if(S.lens[256]===0){F.msg="invalid code -- missing end-of-block",S.mode=30;break}if(S.lenbits=9,$={bits:S.lenbits},te=l(h,S.lens,0,S.nlen,S.lencode,0,S.work,$),S.lenbits=$.bits,te){F.msg="invalid literal/lengths set",S.mode=30;break}if(S.distbits=6,S.distcode=S.distdyn,$={bits:S.distbits},te=l(g,S.lens,S.nlen,S.ndist,S.distcode,0,S.work,$),S.distbits=$.bits,te){F.msg="invalid distances set",S.mode=30;break}if(S.mode=20,J===6)break e;case 20:S.mode=21;case 21:if(6<=V&&258<=ae){F.next_out=W,F.avail_out=ae,F.next_in=ie,F.avail_in=V,S.hold=P,S.bits=T,d(F,se),W=F.next_out,Ce=F.output,ae=F.avail_out,ie=F.next_in,ee=F.input,V=F.avail_in,P=S.hold,T=S.bits,S.mode===12&&(S.back=-1);break}for(S.back=0;ve=(B=S.lencode[P&(1<>>16&255,Ue=65535&B,!((ge=B>>>24)<=T);){if(V===0)break e;V--,P+=ee[ie++]<>Qe)])>>>16&255,Ue=65535&B,!(Qe+(ge=B>>>24)<=T);){if(V===0)break e;V--,P+=ee[ie++]<>>=Qe,T-=Qe,S.back+=Qe}if(P>>>=ge,T-=ge,S.back+=ge,S.length=Ue,ve===0){S.mode=26;break}if(32&ve){S.back=-1,S.mode=12;break}if(64&ve){F.msg="invalid literal/length code",S.mode=30;break}S.extra=15&ve,S.mode=22;case 22:if(S.extra){for(R=S.extra;T>>=S.extra,T-=S.extra,S.back+=S.extra}S.was=S.length,S.mode=23;case 23:for(;ve=(B=S.distcode[P&(1<>>16&255,Ue=65535&B,!((ge=B>>>24)<=T);){if(V===0)break e;V--,P+=ee[ie++]<>Qe)])>>>16&255,Ue=65535&B,!(Qe+(ge=B>>>24)<=T);){if(V===0)break e;V--,P+=ee[ie++]<>>=Qe,T-=Qe,S.back+=Qe}if(P>>>=ge,T-=ge,S.back+=ge,64&ve){F.msg="invalid distance code",S.mode=30;break}S.offset=Ue,S.extra=15&ve,S.mode=24;case 24:if(S.extra){for(R=S.extra;T>>=S.extra,T-=S.extra,S.back+=S.extra}if(S.offset>S.dmax){F.msg="invalid distance too far back",S.mode=30;break}S.mode=25;case 25:if(ae===0)break e;if(re=se-ae,S.offset>re){if((re=S.offset-re)>S.whave&&S.sane){F.msg="invalid distance too far back",S.mode=30;break}ye=re>S.wnext?(re-=S.wnext,S.wsize-re):S.wnext-re,re>S.length&&(re=S.length),Pe=S.window}else Pe=Ce,ye=W-S.offset,re=S.length;for(aeM?(z=ye[Pe+k[J]],T[Z+k[J]]):(z=96,0),E=1<>W)+(_-=E)]=O<<24|z<<16|Y|0,_!==0;);for(E=1<>=1;if(E!==0?(P&=E-1,P+=E):P=0,J++,--se[F]==0){if(F===ee)break;F=g[w+k[J]]}if(Ce>>7)]}function Z(B,j){B.pending_buf[B.pending++]=255&j,B.pending_buf[B.pending++]=j>>>8&255}function se(B,j,le){B.bi_valid>C-le?(B.bi_buf|=j<>C-B.bi_valid,B.bi_valid+=le-C):(B.bi_buf|=j<>>=1,le<<=1,0<--j;);return le>>>1}function Pe(B,j,le){var ne,H,fe=new Array(k+1),be=0;for(ne=1;ne<=k;ne++)fe[ne]=be=be+le[ne-1]<<1;for(H=0;H<=j;H++){var pe=B[2*H+1];pe!==0&&(B[2*H]=ye(fe[pe]++,pe))}}function ge(B){var j;for(j=0;j>1;1<=le;le--)Qe(B,fe,le);for(H=Be;le=B.heap[1],B.heap[1]=B.heap[B.heap_len--],Qe(B,fe,1),ne=B.heap[1],B.heap[--B.heap_max]=le,B.heap[--B.heap_max]=ne,fe[2*H]=fe[2*le]+fe[2*ne],B.depth[H]=(B.depth[le]>=B.depth[ne]?B.depth[le]:B.depth[ne])+1,fe[2*le+1]=fe[2*ne+1]=H,B.heap[1]=H++,Qe(B,fe,1),2<=B.heap_len;);B.heap[--B.heap_max]=B.heap[1],(function(je,Tt){var lr,Et,wn,nt,bn,qa,Vt=Tt.dyn_tree,ia=Tt.max_code,Ja=Tt.stat_desc.static_tree,Ya=Tt.stat_desc.has_stree,Ka=Tt.stat_desc.extra_bits,Tr=Tt.stat_desc.extra_base,$t=Tt.stat_desc.max_length,Cn=0;for(nt=0;nt<=k;nt++)je.bl_count[nt]=0;for(Vt[2*je.heap[je.heap_max]+1]=0,lr=je.heap_max+1;lr>=7;H>>=1)if(1&Ye&&pe.dyn_ltree[2*Be]!==0)return u;if(pe.dyn_ltree[18]!==0||pe.dyn_ltree[20]!==0||pe.dyn_ltree[26]!==0)return f;for(Be=32;Be>>3,(fe=B.static_len+3+7>>>3)<=H&&(H=fe)):H=fe=le+5,le+4<=H&&j!==-1?R(B,j,le,ne):B.strategy===4||fe===H?(se(B,2+(ne?1:0),3),Ve(B,me,F)):(se(B,4+(ne?1:0),3),(function(pe,Be,Ye,je){var Tt;for(se(pe,Be-257,5),se(pe,Ye-1,5),se(pe,je-4,4),Tt=0;Tt>>8&255,B.pending_buf[B.d_buf+2*B.last_lit+1]=255&j,B.pending_buf[B.l_buf+B.last_lit]=255&le,B.last_lit++,j===0?B.dyn_ltree[2*le]++:(B.matches++,j--,B.dyn_ltree[2*(S[le]+g+1)]++,B.dyn_dtree[2*T(j)]++),B.last_lit===B.lit_bufsize-1},o._tr_align=function(B){se(B,2,3),re(B,_,me),(function(j){j.bi_valid===16?(Z(j,j.bi_buf),j.bi_buf=0,j.bi_valid=0):8<=j.bi_valid&&(j.pending_buf[j.pending++]=255&j.bi_buf,j.bi_buf>>=8,j.bi_valid-=8)})(B)}},{"../utils/common":41}],53:[function(n,i,o){i.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,i,o){(function(c){(function(u,f){if(!u.setImmediate){var d,l,h,g,w=1,v={},b=!1,y=u.document,k=Object.getPrototypeOf&&Object.getPrototypeOf(u);k=k&&k.setTimeout?k:u,d={}.toString.call(u.process)==="[object process]"?function(N){process.nextTick(function(){E(N)})}:(function(){if(u.postMessage&&!u.importScripts){var N=!0,I=u.onmessage;return u.onmessage=function(){N=!1},u.postMessage("","*"),u.onmessage=I,N}})()?(g="setImmediate$"+Math.random()+"$",u.addEventListener?u.addEventListener("message",_,!1):u.attachEvent("onmessage",_),function(N){u.postMessage(g+N,"*")}):u.MessageChannel?((h=new MessageChannel).port1.onmessage=function(N){E(N.data)},function(N){h.port2.postMessage(N)}):y&&"onreadystatechange"in y.createElement("script")?(l=y.documentElement,function(N){var I=y.createElement("script");I.onreadystatechange=function(){E(N),I.onreadystatechange=null,l.removeChild(I),I=null},l.appendChild(I)}):function(N){setTimeout(E,0,N)},k.setImmediate=function(N){typeof N!="function"&&(N=new Function(""+N));for(var I=new Array(arguments.length-1),G=0;G"u"?c===void 0?this:c:self)}).call(this,typeof Fi<"u"?Fi:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Qs)),Qs.exports}var dm=Am();const Zu=Hc(dm);var At=function(){return At=Object.assign||function(r){for(var n,i=1,o=arguments.length;i0&&c[c.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!c||l[1]>c[0]&&l[1]=100?e:typeof e=="string"&&e.includes("%")?Math.round(r&&r==="X"?parseFloat(e)/100*n.width:r&&r==="Y"?parseFloat(e)/100*n.height:parseFloat(e)/100*n.width):0}function io(e){return e.replace(/[xy]/g,function(r){var n=Math.random()*16|0,i=r==="x"?n:n&3|8;return i.toString(16)})}function Oe(e){return typeof e>"u"||e==null?"":e.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Ge(e){return typeof e=="number"&&e>100?e:(typeof e=="string"&&(e=Number(e.replace(/in*/gi,""))),Math.round(Fe*e))}function Re(e){var r=Number(e)||0;return isNaN(r)?0:Math.round(r*Xa)}function vn(e){return e=e||0,Math.round((e>360?e-360:e)*6e4)}function el(e){var r=e.toString(16);return r.length===1?"0"+r:r}function tl(e,r,n){return(el(e)+el(r)+el(n)).toUpperCase()}function We(e,r){var n=(e||"").replace("#","");!Ws.test(n)&&n!==Qt.background1&&n!==Qt.background2&&n!==Qt.text1&&n!==Qt.text2&&n!==Qt.accent1&&n!==Qt.accent2&&n!==Qt.accent3&&n!==Qt.accent4&&n!==Qt.accent5&&n!==Qt.accent6&&(console.warn('"'.concat(n,'" is not a valid scheme color or hex RGB! "').concat(It,`" used instead. Only provide 6-digit RGB or 'pptx.SchemeColor' values!`)),n=It);var i=Ws.test(n)?"srgbClr":"schemeClr",o='val="'+(Ws.test(n)?n.toUpperCase():n)+'"';return r?"").concat(r,""):"")}function wm(e,r){var n="",i=At(At({},r),e),o=Math.round(i.size*Xa),c=i.color,u=Math.round(i.opacity*1e5);return n+=''),n+=We(c,'')),n+="",n}function Wt(e){var r="solid",n="",i="",o="";if(e)switch(typeof e=="string"?n=e:(e.type&&(r=e.type),e.color&&(n=e.color),e.alpha&&(i+='')),e.transparency&&(i+=''))),r){case"solid":o+="".concat(We(n,i),"");break;default:o+="";break}return o}function Br(e){return e._rels.length+e._relsChart.length+e._relsMedia.length+1}function rl(e){if(!(!e||typeof e!="object"))return e.type!=="outer"&&e.type!=="inner"&&e.type!=="none"&&(console.warn("Warning: shadow.type options are `outer`, `inner` or `none`."),e.type="outer"),e.angle&&((isNaN(Number(e.angle))||e.angle<0||e.angle>359)&&(console.warn("Warning: shadow.angle can only be 0-359"),e.angle=270),e.angle=Math.round(Number(e.angle))),e.opacity&&((isNaN(Number(e.opacity))||e.opacity<0||e.opacity>1)&&(console.warn("Warning: shadow.opacity can only be 0-1"),e.opacity=.75),e.opacity=Number(e.opacity)),e.color&&e.color.startsWith("#")&&(console.warn('Warning: shadow.color should not include hash (#) character, , e.g. "FF0000"'),e.color=e.color.replace("#","")),e}function bm(e,r,n){var i,o,c=2.3+(!((i=e.options)===null||i===void 0)&&i.autoPageCharWeight?e.options.autoPageCharWeight:0),u=Math.floor(r/Xa*Fe)/((!((o=e.options)===null||o===void 0)&&o.fontSize?e.options.fontSize:Kt)/c),f=[],d=[],l=[],h=[];e.text&&e.text.toString().trim().length===0?d.push({_type:Ie.tablecell,text:" "}):typeof e.text=="number"||typeof e.text=="string"?d.push({_type:Ie.tablecell,text:(e.text||"").toString().trim()}):Array.isArray(e.text)&&(d=e.text);var g=[];return d.forEach(function(w){var v;typeof w.text=="string"&&(w.text.split(` `).length>1?w.text.split(` `).forEach(function(b){g.push({_type:Ie.tablecell,text:b,options:At(At({},w.options),{breakLine:!0})})}):g.push({_type:Ie.tablecell,text:w.text.trim(),options:w.options}),!((v=w.options)===null||v===void 0)&&v.breakLine&&(l.push(g),g=[])),g.length>0&&(l.push(g),g=[])}),l.forEach(function(w){w.forEach(function(v){var b=[],y=String(v.text),k=y.split(" ");k.forEach(function(C,E){var _=At({},v.options);_!=null&&_.breakLine&&(_.breakLine=E+1===k.length),b.push({_type:Ie.tablecell,text:C+(E+1u&&(f.push(v),v=[],b=""),v.push(y),b+=y.text.toString()}),v.length>0&&f.push(v)}),f}function aA(e,r,n,i){e===void 0&&(e=[]),r===void 0&&(r={});var o=Ga,c=Fe*1,u=Fe*1,f=0,d=0,l=[],h=ze(r.x,"X",n),g=ze(r.y,"Y",n),w=ze(r.w,"X",n),v=ze(r.h,"Y",n),b=w;function y(){var N=0;l.length===0&&(N=g||Ge(o[0])),l.length>0&&(N=Ge(r.autoPageSlideStartY||r.newSlideStartY||o[0])),u=(v||n.height)-N-Ge(o[2]),l.length>1&&(typeof r.autoPageSlideStartY=="number"?u=(v||n.height)-Ge(r.autoPageSlideStartY+o[2]):typeof r.newSlideStartY=="number"?u=(v||n.height)-Ge(r.newSlideStartY+o[2]):g&&(u=(v||n.height)-Ge((g/Fe=V&&se=me&&(me=W._lineHeight)}),f+me>u){r.verbose&&(console.log(` |-----------------------------------------------------------------------|`),console.log("|-- NEW SLIDE CREATED (currTabH+currLineH > maxH) => ".concat((f/Fe).toFixed(2)," + ").concat((J._lineHeight/Fe).toFixed(2)," > ").concat(u/Fe)),console.log(`|-----------------------------------------------------------------------| `)),z.length>0&&z.map(function(W){return W.text.length}).reduce(function(W,V){return W+V})>0&&_.rows.push(z),l.push(_);var ee=[];_={rows:ee},z=[],N.forEach(function(W){return z.push({_type:Ie.tablecell,text:[],options:W.options})}),y(),f+=M+O,r.verbose&&console.log("| SLIDE [".concat(l.length,"]: emuSlideTabH ...... = ").concat((u/Fe).toFixed(1)," ")),f=0,(r.addHeaderToEach||r.autoPageRepeatHeader)&&r._arrObjTabHeadRows&&r._arrObjTabHeadRows.forEach(function(W){var V=[],ae=0;W.forEach(function(P){V.push(P),P._lineHeight>ae&&(ae=P._lineHeight)}),_.rows.push(V),f+=ae}),S=z[Y]}var Ce=J._lines.shift();Array.isArray(S.text)&&(Ce?S.text=S.text.concat(Ce):S.text.length===0&&(S.text=S.text.concat({_type:Ie.tablecell,text:""}))),Y===G.length-1&&(f+=me),Y=Y0&&_.rows.push(z),r.verbose&&console.log("- SLIDE [".concat(l.length,"]: ROW [").concat(I,"]: ...COMPLETE ...... emuTabCurrH = ").concat((f/Fe).toFixed(2)," ( emuSlideTabH = ").concat((u/Fe).toFixed(2)," )"))}),l.push(_),r.verbose&&(console.log(` |================================================|`),console.log("| FINAL: tableRowSlides.length = ".concat(l.length)),l.forEach(function(N){return console.log(N)}),console.log(`|================================================| `)),l}function Cm(e,r,n,i){n===void 0&&(n={});var o=n||{};o.slideMargin=o.slideMargin||o.slideMargin===0?o.slideMargin:.5;var c=o.w||e.presLayout.width,u=[],f=[],d=[],l=[],h=[],g=[.5,.5,.5,.5],w=0;if(!document.getElementById(r))throw new Error('tableToSlides: Table ID "'+r+'" does not exist!');i!=null&&i._margin?(Array.isArray(i._margin)?g=i._margin:isNaN(i._margin)||(g=[i._margin,i._margin,i._margin,i._margin]),o.slideMargin=g):o!=null&&o.slideMargin&&(Array.isArray(o.slideMargin)?g=o.slideMargin:isNaN(o.slideMargin)||(g=[o.slideMargin,o.slideMargin,o.slideMargin,o.slideMargin])),c=(o.w?Ge(o.w):e.presLayout.width)-Ge(g[1]+g[3]),o.verbose&&(console.log("[[VERBOSE MODE]]"),console.log("|-- `tableToSlides` ----------------------------------------------------|"),console.log("| tableProps.h .................................... = ".concat(o.h)),console.log("| tableProps.w .................................... = ".concat(o.w)),console.log("| pptx.presLayout.width ........................... = ".concat((e.presLayout.width/Fe).toFixed(1))),console.log("| pptx.presLayout.height .......................... = ".concat((e.presLayout.height/Fe).toFixed(1))),console.log("| emuSlideTabW .................................... = ".concat((c/Fe).toFixed(1))));var v=document.querySelectorAll("#".concat(r," tr:first-child th"));v.length===0&&(v=document.querySelectorAll("#".concat(r," tr:first-child td"))),v.forEach(function(y){if(y.getAttribute("colspan"))for(var k=0;kC?E:C)}),o.verbose&&console.log("| arrColW ......................................... = [".concat(l.join(", "),"]"));var b=["thead","tbody","tfoot"];b.forEach(function(y){document.querySelectorAll("#".concat(r," ").concat(y," tr")).forEach(function(k){var C=[];switch(Array.from(k.cells).forEach(function(E){var _=window.getComputedStyle(E).getPropertyValue("color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(","),N=window.getComputedStyle(E).getPropertyValue("background-color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(",");(window.getComputedStyle(E).getPropertyValue("background-color")==="rgba(0, 0, 0, 0)"||window.getComputedStyle(E).getPropertyValue("transparent"))&&(N=["255","255","255"]);var I={align:null,bold:window.getComputedStyle(E).getPropertyValue("font-weight")==="bold"||Number(window.getComputedStyle(E).getPropertyValue("font-weight"))>=500,border:null,color:tl(Number(_[0]),Number(_[1]),Number(_[2])),fill:{color:tl(Number(N[0]),Number(N[1]),Number(N[2]))},fontFace:(window.getComputedStyle(E).getPropertyValue("font-family")||"").split(",")[0].replace(/"/g,"").replace("inherit","").replace("initial","")||null,fontSize:Number(window.getComputedStyle(E).getPropertyValue("font-size").replace(/[a-z]/gi,"")),margin:null,colspan:Number(E.getAttribute("colspan"))||null,rowspan:Number(E.getAttribute("rowspan"))||null,valign:null};if(["left","center","right","start","end"].includes(window.getComputedStyle(E).getPropertyValue("text-align"))){var G=window.getComputedStyle(E).getPropertyValue("text-align").replace("start","left").replace("end","right");I.align=G==="center"?"center":G==="left"?"left":G==="right"?"right":null}if(["top","middle","bottom"].includes(window.getComputedStyle(E).getPropertyValue("vertical-align"))){var M=window.getComputedStyle(E).getPropertyValue("vertical-align");I.valign=M==="top"?"top":M==="middle"?"middle":M==="bottom"?"bottom":null}if(window.getComputedStyle(E).getPropertyValue("padding-left")){I.margin=[0,0,0,0];var O=["padding-top","padding-right","padding-bottom","padding-left"];O.forEach(function(Y,me){I.margin[me]=Math.round(Number(window.getComputedStyle(E).getPropertyValue(Y).replace(/\D/gi,"")))})}if(window.getComputedStyle(E).getPropertyValue("border-top-width")||window.getComputedStyle(E).getPropertyValue("border-right-width")||window.getComputedStyle(E).getPropertyValue("border-bottom-width")||window.getComputedStyle(E).getPropertyValue("border-left-width")){I.border=[null,null,null,null];var z=["top","right","bottom","left"];z.forEach(function(Y,me){var F=Math.round(Number(window.getComputedStyle(E).getPropertyValue("border-"+Y+"-width").replace("px",""))),J=[];J=window.getComputedStyle(E).getPropertyValue("border-"+Y+"-color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(",");var S=tl(Number(J[0]),Number(J[1]),Number(J[2]));I.border[me]={pt:F,color:S}})}C.push({_type:Ie.tablecell,text:E.innerText,options:I})}),y){case"thead":u.push(C);break;case"tbody":f.push(C);break;case"tfoot":d.push(C);break;default:console.log("table parsing: unexpected table part: ".concat(y));break}})}),o._arrObjTabHeadRows=u||null,o.colW=l,aA(no(no(no([],u,!0),f,!0),d,!0),o,e.presLayout,i).forEach(function(y,k){var C=e.addSlide({masterName:o.masterSlideName||null});k===0&&(o.y=o.y||g[0]),k>0&&(o.y=o.autoPageSlideStartY||o.newSlideStartY||g[0]),o.verbose&&console.log("| opts.autoPageSlideStartY: ".concat(o.autoPageSlideStartY," / arrInchMargins[0]: ").concat(g[0]," => opts.y = ").concat(o.y)),C.addTable(y.rows,{x:o.x||g[3],y:o.y,w:Number(c)/Fe,colW:l,autoPage:!1}),o.addImage&&(o.addImage.options=o.addImage.options||{},!o.addImage.image||!o.addImage.image.path&&!o.addImage.image.data?console.warn("Warning: tableToSlides.addImage requires either `path` or `data`"):C.addImage({path:o.addImage.image.path,data:o.addImage.image.data,x:o.addImage.options.x,y:o.addImage.options.y,w:o.addImage.options.w,h:o.addImage.options.h})),o.addShape&&C.addShape(o.addShape.shapeName,o.addShape.options||{}),o.addTable&&C.addTable(o.addTable.rows,o.addTable.options||{}),o.addText&&C.addText(o.addText.text,o.addText.options||{})})}var xm=0;function km(e,r){e.bkgd&&(r.bkgd=e.bkgd),e.objects&&Array.isArray(e.objects)&&e.objects.length>0&&e.objects.forEach(function(n,i){var o=Object.keys(n)[0],c=r;Gr[o]&&o==="chart"?iA(c,n[o].type,n[o].data,n[o].opts):Gr[o]&&o==="image"?oA(c,n[o]):Gr[o]&&o==="line"?nl(c,Xr.LINE,n[o]):Gr[o]&&o==="rect"?nl(c,Xr.RECTANGLE,n[o]):Gr[o]&&o==="text"?oo(c,[{text:n[o].text}],n[o].options,!1):Gr[o]&&o==="placeholder"&&(n[o].options.placeholder=n[o].options.name,delete n[o].options.name,n[o].options._placeholderType=n[o].options.type,delete n[o].options.type,n[o].options._placeholderIdx=100+i,oo(c,[{text:n[o].text}],n[o].options,!0))}),e.slideNumber&&typeof e.slideNumber=="object"&&(r._slideNumberProps=e.slideNumber)}function iA(e,r,n,i){var o;function c(g){!g||g.style==="none"||(g.size!==void 0&&(isNaN(Number(g.size))||g.size<=0)&&(console.warn("Warning: chart.gridLine.size must be greater than 0."),delete g.size),g.style&&!["solid","dash","dot"].includes(g.style)&&(console.warn("Warning: chart.gridLine.style options: `solid`, `dash`, `dot`."),delete g.style),g.cap&&!["flat","square","round"].includes(g.cap)&&(console.warn("Warning: chart.gridLine.cap options: `flat`, `square`, `round`."),delete g.cap))}var u=++xm,f={_type:null,text:null,options:null,chartRid:null},d=null,l=[];Array.isArray(r)?(r.forEach(function(g){l=l.concat(g.data)}),d=n||i):(l=n,d=i),l.forEach(function(g,w){g._dataIndex=w,g.labels!==void 0&&!Array.isArray(g.labels[0])&&(g.labels=[g.labels])});var h=d&&typeof d=="object"?d:{};return h._type=r,h.x=typeof h.x<"u"&&h.x!=null&&!isNaN(Number(h.x))?h.x:1,h.y=typeof h.y<"u"&&h.y!=null&&!isNaN(Number(h.y))?h.y:1,h.w=h.w||"50%",h.h=h.h||"50%",h.objectName=h.objectName?Oe(h.objectName):"Chart ".concat(e._slideObjects.filter(function(g){return g._type===Ie.chart}).length),["bar","col"].includes(h.barDir||"")||(h.barDir="col"),h._type===Ae.AREA&&(["stacked","standard","percentStacked"].includes(h.barGrouping||"")||(h.barGrouping="standard")),h._type===Ae.BAR&&(["clustered","stacked","percentStacked"].includes(h.barGrouping||"")||(h.barGrouping="clustered")),h._type===Ae.BAR3D&&(["clustered","stacked","standard","percentStacked"].includes(h.barGrouping||"")||(h.barGrouping="standard")),!((o=h.barGrouping)===null||o===void 0)&&o.includes("tacked")&&(h.barGapWidthPct||(h.barGapWidthPct=50)),h.dataLabelPosition&&((h._type===Ae.AREA||h._type===Ae.BAR3D||h._type===Ae.DOUGHNUT||h._type===Ae.RADAR)&&delete h.dataLabelPosition,h._type===Ae.PIE&&(["bestFit","ctr","inEnd","outEnd"].includes(h.dataLabelPosition)||delete h.dataLabelPosition),(h._type===Ae.BUBBLE||h._type===Ae.BUBBLE3D||h._type===Ae.LINE||h._type===Ae.SCATTER)&&(["b","ctr","l","r","t"].includes(h.dataLabelPosition)||delete h.dataLabelPosition),h._type===Ae.BAR&&(["stacked","percentStacked"].includes(h.barGrouping||"")||["ctr","inBase","inEnd"].includes(h.dataLabelPosition)||delete h.dataLabelPosition,["clustered"].includes(h.barGrouping||"")||["ctr","inBase","inEnd","outEnd"].includes(h.dataLabelPosition)||delete h.dataLabelPosition)),h.dataLabelBkgrdColors=h.dataLabelBkgrdColors||!h.dataLabelBkgrdColors?h.dataLabelBkgrdColors:!1,["b","l","r","t","tr"].includes(h.legendPos||"")||(h.legendPos="r"),["cone","coneToMax","box","cylinder","pyramid","pyramidToMax"].includes(h.bar3DShape||"")||(h.bar3DShape="box"),["circle","dash","diamond","dot","none","square","triangle"].includes(h.lineDataSymbol||"")||(h.lineDataSymbol="circle"),["gap","span"].includes(h.displayBlanksAs||"")||(h.displayBlanksAs="span"),["standard","marker","filled"].includes(h.radarStyle||"")||(h.radarStyle="standard"),h.lineDataSymbolSize=h.lineDataSymbolSize&&!isNaN(h.lineDataSymbolSize)?h.lineDataSymbolSize:6,h.lineDataSymbolLineSize=h.lineDataSymbolLineSize&&!isNaN(h.lineDataSymbolLineSize)?Re(h.lineDataSymbolLineSize):Re(.75),h.layout&&["x","y","w","h"].forEach(function(g){var w=h.layout[g];(isNaN(Number(w))||w<0||w>1)&&(console.warn("Warning: chart.layout."+g+" can only be 0-1"),delete h.layout[g])}),h.catGridLine=h.catGridLine||(h._type===Ae.SCATTER?{color:"D9D9D9",size:1}:{style:"none"}),h.valGridLine=h.valGridLine||(h._type===Ae.SCATTER?{color:"D9D9D9",size:1}:{}),h.serGridLine=h.serGridLine||(h._type===Ae.SCATTER?{color:"D9D9D9",size:1}:{style:"none"}),c(h.catGridLine),c(h.valGridLine),c(h.serGridLine),rl(h.shadow),h.showDataTable=h.showDataTable||!h.showDataTable?h.showDataTable:!1,h.showDataTableHorzBorder=h.showDataTableHorzBorder||!h.showDataTableHorzBorder?h.showDataTableHorzBorder:!0,h.showDataTableVertBorder=h.showDataTableVertBorder||!h.showDataTableVertBorder?h.showDataTableVertBorder:!0,h.showDataTableOutline=h.showDataTableOutline||!h.showDataTableOutline?h.showDataTableOutline:!0,h.showDataTableKeys=h.showDataTableKeys||!h.showDataTableKeys?h.showDataTableKeys:!0,h.showLabel=h.showLabel||!h.showLabel?h.showLabel:!1,h.showLegend=h.showLegend||!h.showLegend?h.showLegend:!1,h.showPercent=h.showPercent||!h.showPercent?h.showPercent:!0,h.showTitle=h.showTitle||!h.showTitle?h.showTitle:!1,h.showValue=h.showValue||!h.showValue?h.showValue:!1,h.showLeaderLines=h.showLeaderLines||!h.showLeaderLines?h.showLeaderLines:!1,h.catAxisLineShow=typeof h.catAxisLineShow<"u"?h.catAxisLineShow:!0,h.valAxisLineShow=typeof h.valAxisLineShow<"u"?h.valAxisLineShow:!0,h.serAxisLineShow=typeof h.serAxisLineShow<"u"?h.serAxisLineShow:!0,h.v3DRotX=!isNaN(h.v3DRotX)&&h.v3DRotX>=-90&&h.v3DRotX<=90?h.v3DRotX:30,h.v3DRotY=!isNaN(h.v3DRotY)&&h.v3DRotY>=0&&h.v3DRotY<=360?h.v3DRotY:30,h.v3DRAngAx=h.v3DRAngAx||!h.v3DRAngAx?h.v3DRAngAx:!0,h.v3DPerspective=!isNaN(h.v3DPerspective)&&h.v3DPerspective>=0&&h.v3DPerspective<=240?h.v3DPerspective:30,h.barGapWidthPct=!isNaN(h.barGapWidthPct)&&h.barGapWidthPct>=0&&h.barGapWidthPct<=1e3?h.barGapWidthPct:150,h.barGapDepthPct=!isNaN(h.barGapDepthPct)&&h.barGapDepthPct>=0&&h.barGapDepthPct<=1e3?h.barGapDepthPct:150,h.chartColors=Array.isArray(h.chartColors)?h.chartColors:h._type===Ae.PIE||h._type===Ae.DOUGHNUT?vm:Va,h.chartColorsOpacity=h.chartColorsOpacity&&!isNaN(h.chartColorsOpacity)?h.chartColorsOpacity:null,h.border=h.border&&typeof h.border=="object"?h.border:null,h.border&&(!h.border.pt||isNaN(h.border.pt))&&(h.border.pt=Zn.pt),h.border&&(!h.border.color||typeof h.border.color!="string")&&(h.border.color=Zn.color),h.plotArea=h.plotArea||{},h.plotArea.border=h.plotArea.border&&typeof h.plotArea.border=="object"?h.plotArea.border:null,h.plotArea.border&&(!h.plotArea.border.pt||isNaN(h.plotArea.border.pt))&&(h.plotArea.border.pt=Zn.pt),h.plotArea.border&&(!h.plotArea.border.color||typeof h.plotArea.border.color!="string")&&(h.plotArea.border.color=Zn.color),h.border&&(h.plotArea.border=h.border),h.plotArea.fill=h.plotArea.fill||{color:null,transparency:null},h.fill&&(h.plotArea.fill.color=h.fill),h.chartArea=h.chartArea||{},h.chartArea.border=h.chartArea.border&&typeof h.chartArea.border=="object"?h.chartArea.border:null,h.chartArea.border&&(h.chartArea.border={color:h.chartArea.border.color||Zn.color,pt:h.chartArea.border.pt||Zn.pt}),h.chartArea.roundedCorners=typeof h.chartArea.roundedCorners=="boolean"?h.chartArea.roundedCorners:!0,h.dataBorder=h.dataBorder&&typeof h.dataBorder=="object"?h.dataBorder:null,h.dataBorder&&(!h.dataBorder.pt||isNaN(h.dataBorder.pt))&&(h.dataBorder.pt=.75),h.dataBorder&&(!h.dataBorder.color||typeof h.dataBorder.color!="string"||h.dataBorder.color.length!==6)&&(h.dataBorder.color="F9F9F9"),!h.dataLabelFormatCode&&h._type===Ae.SCATTER&&(h.dataLabelFormatCode="General"),!h.dataLabelFormatCode&&(h._type===Ae.PIE||h._type===Ae.DOUGHNUT)&&(h.dataLabelFormatCode=h.showPercent?"0%":"General"),h.dataLabelFormatCode=h.dataLabelFormatCode&&typeof h.dataLabelFormatCode=="string"?h.dataLabelFormatCode:"#,##0",!h.dataLabelFormatScatter&&h._type===Ae.SCATTER&&(h.dataLabelFormatScatter="custom"),h.lineSize=typeof h.lineSize=="number"?h.lineSize:2,h.valAxisMajorUnit=typeof h.valAxisMajorUnit=="number"?h.valAxisMajorUnit:null,h._type===Ae.AREA||h._type===Ae.BAR||h._type===Ae.BAR3D||h._type===Ae.LINE?h.catAxisMultiLevelLabels=!!h.catAxisMultiLevelLabels:delete h.catAxisMultiLevelLabels,f._type="chart",f.options=h,f.chartRid=Br(e),e._relsChart.push({rId:Br(e),data:l,opts:h,type:h._type,globalId:u,fileName:"chart".concat(u,".xml"),Target:"/ppt/charts/chart".concat(u,".xml")}),e._slideObjects.push(f),f}function oA(e,r){var n={_type:null,text:null,options:null,image:null,imageRid:null,hyperlink:null},i=r.x||0,o=r.y||0,c=r.w||0,u=r.h||0,f=r.sizing||null,d=r.hyperlink||"",l=r.data||"",h=r.path||"",g=Br(e),w=r.objectName?Oe(r.objectName):"Image ".concat(e._slideObjects.filter(function(y){return y._type===Ie.image}).length);if(!h&&!l)return console.error("ERROR: addImage() requires either 'data' or 'path' parameter!"),null;if(h&&typeof h!="string")return console.error("ERROR: addImage() 'path' should be a string, ex: {path:'/img/sample.png'} - you sent ".concat(String(h))),null;if(l&&typeof l!="string")return console.error("ERROR: addImage() 'data' should be a string, ex: {data:'image/png;base64,NMP[...]'} - you sent ".concat(String(l))),null;if(l&&typeof l=="string"&&!l.toLowerCase().includes("base64,"))return console.error("ERROR: Image `data` value lacks a base64 header! Ex: 'image/png;base64,NMP[...]')"),null;var v=(h.substring(h.lastIndexOf("/")+1).split("?")[0].split(".").pop().split("#")[0]||"png").toLowerCase();if(l&&/image\/(\w+);/.exec(l)&&/image\/(\w+);/.exec(l).length>0?v=/image\/(\w+);/.exec(l)[1]:l!=null&&l.toLowerCase().includes("image/svg+xml")&&(v="svg"),n._type=Ie.image,n.image=h||"preencoded.png",n.options={x:i||0,y:o||0,w:c||1,h:u||1,altText:r.altText||"",rounding:typeof r.rounding=="boolean"?r.rounding:!1,sizing:f,placeholder:r.placeholder,rotate:r.rotate||0,flipV:r.flipV||!1,flipH:r.flipH||!1,transparency:r.transparency||0,objectName:w,shadow:rl(r.shadow)},v==="svg")e._relsMedia.push({path:h||l+"png",type:"image/png",extn:"png",data:l||"",rId:g,Target:"../media/image-".concat(e._slideNum,"-").concat(e._relsMedia.length+1,".png"),isSvgPng:!0,svgSize:{w:ze(n.options.w,"X",e._presLayout),h:ze(n.options.h,"Y",e._presLayout)}}),n.imageRid=g,e._relsMedia.push({path:h||l,type:"image/svg+xml",extn:v,data:l||"",rId:g+1,Target:"../media/image-".concat(e._slideNum,"-").concat(e._relsMedia.length+1,".").concat(v)}),n.imageRid=g+1;else{var b=e._relsMedia.filter(function(y){return y.path&&y.path===h&&y.type==="image/"+v&&!y.isDuplicate})[0];e._relsMedia.push({path:h||"preencoded."+v,type:"image/"+v,extn:v,data:l||"",rId:g,isDuplicate:!!(b!=null&&b.Target),Target:b!=null&&b.Target?b.Target:"../media/image-".concat(e._slideNum,"-").concat(e._relsMedia.length+1,".").concat(v)}),n.imageRid=g}if(typeof d=="object"){if(!d.url&&!d.slide)throw new Error("ERROR: `hyperlink` option requires either: `url` or `slide`");g++,e._rels.push({type:Ie.hyperlink,data:d.slide?"slide":"dummy",rId:g,Target:d.url||d.slide.toString()}),d._rId=g,n.hyperlink=d}e._slideObjects.push(n)}function Sm(e,r){var n=r.x||0,i=r.y||0,o=r.w||2,c=r.h||2,u=r.data||"",f=r.link||"",d=r.path||"",l=r.type||"audio",h="",g=r.cover||ym,w=r.objectName?Oe(r.objectName):"Media ".concat(e._slideObjects.filter(function(k){return k._type===Ie.media}).length),v={_type:Ie.media};if(!d&&!u&&l!=="online")throw new Error("addMedia() error: either `data` or `path` are required!");if(u&&!u.toLowerCase().includes("base64,"))throw new Error("addMedia() error: `data` value lacks a base64 header! Ex: 'video/mpeg;base64,NMP[...]')");if(!g.toLowerCase().includes("base64,"))throw new Error("addMedia() error: `cover` value lacks a base64 header! Ex: 'data:image/png;base64,iV[...]')");if(l==="online"&&!f)throw new Error("addMedia() error: online videos require `link` value");if(h=r.extn||(u?u.split(";")[0].split("/")[1]:d.split(".").pop())||"mp3",v.mtype=l,v.media=d||"preencoded.mov",v.options={},v.options.x=n,v.options.y=i,v.options.w=o,v.options.h=c,v.options.objectName=w,l==="online"){var b=Br(e);e._relsMedia.push({path:d||"preencoded"+h,data:"dummy",type:"online",extn:h,rId:b,Target:f}),v.mediaRid=b,e._relsMedia.push({path:"preencoded.png",data:g,type:"image/png",extn:"png",rId:Br(e),Target:"../media/image-".concat(e._slideNum,"-").concat(e._relsMedia.length+1,".png")})}else{var y=e._relsMedia.filter(function(C){return C.path&&C.path===d&&C.type===l+"/"+h&&!C.isDuplicate})[0],b=Br(e);e._relsMedia.push({path:d||"preencoded"+h,type:l+"/"+h,extn:h,data:u||"",rId:b,isDuplicate:!!(y!=null&&y.Target),Target:y!=null&&y.Target?y.Target:"../media/media-".concat(e._slideNum,"-").concat(e._relsMedia.length+1,".").concat(h)}),v.mediaRid=b,e._relsMedia.push({path:d||"preencoded"+h,type:l+"/"+h,extn:h,data:u||"",rId:Br(e),isDuplicate:!!(y!=null&&y.Target),Target:y!=null&&y.Target?y.Target:"../media/media-".concat(e._slideNum,"-").concat(e._relsMedia.length+0,".").concat(h)}),e._relsMedia.push({path:"preencoded.png",type:"image/png",extn:"png",data:g,rId:Br(e),Target:"../media/image-".concat(e._slideNum,"-").concat(e._relsMedia.length+1,".png")})}e._slideObjects.push(v)}function Em(e,r){e._slideObjects.push({_type:Ie.notes,text:[{text:r}]})}function nl(e,r,n){var i=typeof n=="object"?n:{};i.line=i.line||{type:"none"};var o={_type:Ie.text,shape:r||Xr.RECTANGLE,options:i,text:null};if(!r)throw new Error("Missing/Invalid shape parameter! Example: `addShape(pptxgen.shapes.LINE, {x:1, y:1, w:1, h:1});`");var c={type:i.line.type||"solid",color:i.line.color||eA,transparency:i.line.transparency||0,width:i.line.width||1,dashType:i.line.dashType||"solid",beginArrowType:i.line.beginArrowType||null,endArrowType:i.line.endArrowType||null};if(typeof i.line=="object"&&i.line.type!=="none"&&(i.line=c),i.x=i.x||(i.x===0?0:1),i.y=i.y||(i.y===0?0:1),i.w=i.w||(i.w===0?0:1),i.h=i.h||(i.h===0?0:1),i.objectName=i.objectName?Oe(i.objectName):"Shape ".concat(e._slideObjects.filter(function(f){return f._type===Ie.text}).length),typeof i.line=="string"){var u=c;u.color=String(i.line),i.line=u}typeof i.lineSize=="number"&&(i.line.width=i.lineSize),typeof i.lineDash=="string"&&(i.line.dashType=i.lineDash),typeof i.lineHead=="string"&&(i.line.beginArrowType=i.lineHead),typeof i.lineTail=="string"&&(i.line.endArrowType=i.lineTail),aa(e,o),e._slideObjects.push(o)}function Lm(e,r,n,i,o,c,u){var f=[e],d=n&&typeof n=="object"?n:{};d.objectName=d.objectName?Oe(d.objectName):"Table ".concat(e._slideObjects.filter(function(v){return v._type===Ie.table}).length);{if(r===null||r.length===0||!Array.isArray(r))throw new Error("addTable: Array expected! EX: 'slide.addTable( [rows], {options} );' (https://gitbrent.github.io/PptxGenJS/docs/api-tables.html)");if(!r[0]||!Array.isArray(r[0]))throw new Error("addTable: 'rows' should be an array of cells! EX: 'slide.addTable( [ ['A'], ['B'], {text:'C',options:{align:'center'}} ] );' (https://gitbrent.github.io/PptxGenJS/docs/api-tables.html)")}var l=[];r.forEach(function(v){var b=[];Array.isArray(v)?v.forEach(function(y){var k={_type:Ie.tablecell,text:"",options:typeof y=="object"&&y.options?y.options:{}};typeof y=="string"||typeof y=="number"?k.text=y.toString():y.text&&(typeof y.text=="string"||typeof y.text=="number"?k.text=y.text.toString():y.text&&(k.text=y.text),y.options&&typeof y.options=="object"&&(k.options=y.options)),k.options.border=k.options.border||d.border||[{type:"none"},{type:"none"},{type:"none"},{type:"none"}];var C=k.options.border;!Array.isArray(C)&&typeof C=="object"&&(k.options.border=[C,C,C,C]),k.options.border[0]||(k.options.border[0]={type:"none"}),k.options.border[1]||(k.options.border[1]={type:"none"}),k.options.border[2]||(k.options.border[2]={type:"none"}),k.options.border[3]||(k.options.border[3]={type:"none"});var E=[0,1,2,3];E.forEach(function(_){k.options.border[_]={type:k.options.border[_].type||Kn.type,color:k.options.border[_].color||Kn.color,pt:typeof k.options.border[_].pt=="number"?k.options.border[_].pt:Kn.pt}}),b.push(k)}):(console.log("addTable: tableRows has a bad row. A row should be an array of cells. You provided:"),console.log(v)),l.push(b)}),d.x=ze(d.x||(d.x===0?0:Fe/2),"X",o),d.y=ze(d.y||(d.y===0?0:Fe/2),"Y",o),d.h&&(d.h=ze(d.h,"Y",o)),d.fontSize=d.fontSize||Kt,d.margin=d.margin===0||d.margin?d.margin:$u,typeof d.margin=="number"&&(d.margin=[Number(d.margin),Number(d.margin),Number(d.margin),Number(d.margin)]),d.color||(d.color=d.color||It),typeof d.border=="string"?(console.warn("addTable `border` option must be an object. Ex: `{border: {type:'none'}}`"),d.border=null):Array.isArray(d.border)&&[0,1,2,3].forEach(function(v){d.border[v]=d.border[v]?{type:d.border[v].type||Kn.type,color:d.border[v].color||Kn.color,pt:d.border[v].pt||Kn.pt}:{type:"none"}}),d.autoPage=typeof d.autoPage=="boolean"?d.autoPage:!1,d.autoPageRepeatHeader=typeof d.autoPageRepeatHeader=="boolean"?d.autoPageRepeatHeader:!1,d.autoPageHeaderRows=typeof d.autoPageHeaderRows<"u"&&!isNaN(Number(d.autoPageHeaderRows))?Number(d.autoPageHeaderRows):1,d.autoPageLineWeight=typeof d.autoPageLineWeight<"u"&&!isNaN(Number(d.autoPageLineWeight))?Number(d.autoPageLineWeight):0,d.autoPageLineWeight&&(d.autoPageLineWeight>1?d.autoPageLineWeight=1:d.autoPageLineWeight<-1&&(d.autoPageLineWeight=-1));var h=Ga;if(i&&typeof i._margin<"u"&&(Array.isArray(i._margin)?h=i._margin:isNaN(Number(i._margin))||(h=[Number(i._margin),Number(i._margin),Number(i._margin),Number(i._margin)])),d.colW){var g=l[0].reduce(function(v,b){var y;return!((y=b==null?void 0:b.options)===null||y===void 0)&&y.colspan&&typeof b.options.colspan=="number"?v+=b.options.colspan:v+=1,v},0);typeof d.colW=="string"||typeof d.colW=="number"||d.colW&&Array.isArray(d.colW)&&d.colW.length===1&&g>1?(d.w=Math.floor(Number(d.colW)*g),d.colW=null):d.colW&&Array.isArray(d.colW)&&d.colW.length!==g&&(console.warn("addTable: mismatch: (colW.length != data.length) Therefore, defaulting to evenly distributed col widths."),d.colW=null)}else d.w?d.w=ze(d.w,"X",o):d.w=Math.floor(o._sizeW/Fe-h[1]-h[3]);d.x&&d.x<20&&(d.x=Ge(d.x)),d.y&&d.y<20&&(d.y=Ge(d.y)),d.w&&d.w<20&&(d.w=Ge(d.w)),d.h&&d.h<20&&(d.h=Ge(d.h)),l.forEach(function(v){v.forEach(function(b,y){typeof b=="number"||typeof b=="string"?v[y]={_type:Ie.tablecell,text:String(v[y]),options:d}:typeof b=="object"&&(typeof b.text=="number"?v[y].text=v[y].text.toString():(typeof b.text>"u"||b.text===null)&&(v[y].text=""),v[y].options=b.options||{},v[y]._type=Ie.tablecell)})});var w=[];return d&&!d.autoPage?(aa(e,l),e._slideObjects.push({_type:Ie.table,arrTabRows:l,options:Object.assign({},d)})):(d.autoPageRepeatHeader&&(d._arrObjTabHeadRows=l.filter(function(v,b){return b0&&(d.y=Ge(d.autoPageSlideStartY||d.newSlideStartY||h[0]));{var y=u(e._slideNum+b);d.autoPage=!1,aa(y,v.rows),y.addTable(v.rows,Object.assign({},d)),b>0&&w.push(y)}})),w}function oo(e,r,n,i){var o={_type:i?Ie.placeholder:Ie.text,shape:(n==null?void 0:n.shape)||Xr.RECTANGLE,text:!r||r.length===0?[{text:"",options:null}]:r,options:n||{}};function c(u){{if(u.placeholder||(u.color=u.color||o.options.color||e.color||It),(u.placeholder||i)&&(u.bullet=u.bullet||!1),u.placeholder&&e._slideLayout&&e._slideLayout._slideObjects){var f=e._slideLayout._slideObjects.filter(function(h){return h._type==="placeholder"&&h.options&&h.options.placeholder&&h.options.placeholder===u.placeholder})[0];f!=null&&f.options&&(u=At(At({},u),f.options))}if(u.objectName=u.objectName?Oe(u.objectName):"Text ".concat(e._slideObjects.filter(function(h){return h._type===Ie.text}).length),u.shape===Xr.LINE){var d={type:u.line.type||"solid",color:u.line.color||eA,transparency:u.line.transparency||0,width:u.line.width||1,dashType:u.line.dashType||"solid",beginArrowType:u.line.beginArrowType||null,endArrowType:u.line.endArrowType||null};if(typeof u.line=="object"&&(u.line=d),typeof u.line=="string"){var l=d;typeof u.line=="string"&&(l.color=u.line),u.line=l}typeof u.lineSize=="number"&&(u.line.width=u.lineSize),typeof u.lineDash=="string"&&(u.line.dashType=u.lineDash),typeof u.lineHead=="string"&&(u.line.beginArrowType=u.lineHead),typeof u.lineTail=="string"&&(u.line.endArrowType=u.lineTail)}u.line=u.line||{},u.lineSpacing=u.lineSpacing&&!isNaN(u.lineSpacing)?u.lineSpacing:null,u.lineSpacingMultiple=u.lineSpacingMultiple&&!isNaN(u.lineSpacingMultiple)?u.lineSpacingMultiple:null,u._bodyProp=u._bodyProp||{},u._bodyProp.autoFit=u.autoFit||!1,u._bodyProp.anchor=u.placeholder?null:ta.ctr,u._bodyProp.vert=u.vert||null,u._bodyProp.wrap=typeof u.wrap=="boolean"?u.wrap:!0,(u.inset&&!isNaN(Number(u.inset))||u.inset===0)&&(u._bodyProp.lIns=Ge(u.inset),u._bodyProp.rIns=Ge(u.inset),u._bodyProp.tIns=Ge(u.inset),u._bodyProp.bIns=Ge(u.inset)),typeof u.underline=="boolean"&&u.underline===!0&&(u.underline={style:"sng"})}return(u.align||"").toLowerCase().indexOf("c")===0?u._bodyProp.align=ea.center:(u.align||"").toLowerCase().indexOf("l")===0?u._bodyProp.align=ea.left:(u.align||"").toLowerCase().indexOf("r")===0?u._bodyProp.align=ea.right:(u.align||"").toLowerCase().indexOf("j")===0&&(u._bodyProp.align=ea.justify),(u.valign||"").toLowerCase().indexOf("b")===0?u._bodyProp.anchor=ta.b:(u.valign||"").toLowerCase().indexOf("m")===0?u._bodyProp.anchor=ta.ctr:(u.valign||"").toLowerCase().indexOf("t")===0&&(u._bodyProp.anchor=ta.t),rl(u.shadow),u}o.options=c(o.options),o.text.forEach(function(u){return u.options=c(u.options||{})}),aa(e,o.text||""),e._slideObjects.push(o)}function Pm(e){(e._slideLayout._slideObjects||[]).forEach(function(r){r._type===Ie.placeholder&&e._slideObjects.filter(function(n){return n.options&&n.options.placeholder===r.options.placeholder}).length===0&&oo(e,[{text:""}],r.options,!1)})}function sA(e,r){var n;if(r.bkgd&&(r.background||(r.background={}),typeof r.bkgd=="string"?r.background.color=r.bkgd:(r.bkgd.data&&(r.background.data=r.bkgd.data),r.bkgd.path&&(r.background.path=r.bkgd.path),r.bkgd.src&&(r.background.path=r.bkgd.src))),!((n=r.background)===null||n===void 0)&&n.fill&&(r.background.color=r.background.fill),e&&(e.path||e.data)){e.path=e.path||"preencoded.png";var i=(e.path.split(".").pop()||"png").split("?")[0];i==="jpg"&&(i="jpeg"),r._relsMedia=r._relsMedia||[];var o=r._relsMedia.length+1;r._relsMedia.push({path:e.path,type:Ie.image,extn:i,data:e.data||null,rId:o,Target:"../media/".concat((r._name||"").replace(/\s+/gi,"-"),"-image-").concat(r._relsMedia.length+1,".").concat(i)}),r._bkgdImgRid=o}}function aa(e,r){var n=[];typeof r=="string"||typeof r=="number"||(Array.isArray(r)?n=r:typeof r=="object"&&(n=[r]),n.forEach(function(i){if(Array.isArray(i))aa(e,i);else if(Array.isArray(i.text))aa(e,i.text);else if(i&&typeof i=="object"&&i.options&&i.options.hyperlink&&!i.options.hyperlink._rId)if(typeof i.options.hyperlink!="object")console.log("ERROR: text `hyperlink` option should be an object. Ex: `hyperlink: {url:'https://github.com'}` ");else if(!i.options.hyperlink.url&&!i.options.hyperlink.slide)console.log("ERROR: 'hyperlink requires either: `url` or `slide`'");else{var o=Br(e);e._rels.push({type:Ie.hyperlink,data:i.options.hyperlink.slide?"slide":"dummy",rId:o,Target:Oe(i.options.hyperlink.url)||i.options.hyperlink.slide.toString()}),i.options.hyperlink._rId=o}}))}var _m=(function(){function e(r){var n;this.addSlide=r.addSlide,this.getSlide=r.getSlide,this._name="Slide ".concat(r.slideNumber),this._presLayout=r.presLayout,this._rId=r.slideRId,this._rels=[],this._relsChart=[],this._relsMedia=[],this._setSlideNum=r.setSlideNum,this._slideId=r.slideId,this._slideLayout=r.slideLayout||null,this._slideNum=r.slideNumber,this._slideObjects=[],this._slideNumberProps=!((n=this._slideLayout)===null||n===void 0)&&n._slideNumberProps?this._slideLayout._slideNumberProps:null}return Object.defineProperty(e.prototype,"bkgd",{get:function(){return this._bkgd},set:function(r){this._bkgd=r,(!this._background||!this._background.color)&&(this._background||(this._background={}),typeof r=="string"&&(this._background.color=r))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"background",{get:function(){return this._background},set:function(r){this._background=r,r&&sA(r,this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(r){this._color=r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return this._hidden},set:function(r){this._hidden=r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"slideNumber",{get:function(){return this._slideNumberProps},set:function(r){this._slideNumberProps=r,this._setSlideNum(r)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"newAutoPagedSlides",{get:function(){return this._newAutoPagedSlides},enumerable:!1,configurable:!0}),e.prototype.addChart=function(r,n,i){var o=i||{};return o._type=r,iA(this,r,n,i),this},e.prototype.addImage=function(r){return oA(this,r),this},e.prototype.addMedia=function(r){return Sm(this,r),this},e.prototype.addNotes=function(r){return Em(this,r),this},e.prototype.addShape=function(r,n){return nl(this,r,n),this},e.prototype.addTable=function(r,n){return this._newAutoPagedSlides=Lm(this,r,n,this._slideLayout,this._presLayout,this.addSlide,this.getSlide),this},e.prototype.addText=function(r,n){var i=typeof r=="string"||typeof r=="number"?[{text:r,options:n}]:r;return oo(this,i,n,!1),this},e})();function Bm(e,r){return yr(this,void 0,void 0,function(){var n;return wr(this,function(i){switch(i.label){case 0:return n=e.data,[4,new Promise(function(o,c){var u,f,d=new Zu,l=(n.length-1)*2+1,h=((f=(u=n[0])===null||u===void 0?void 0:u.labels)===null||f===void 0?void 0:f.length)>1;d.folder("_rels"),d.folder("docProps"),d.folder("xl/_rels"),d.folder("xl/tables"),d.folder("xl/theme"),d.folder("xl/worksheets"),d.folder("xl/worksheets/_rels"),d.file("[Content_Types].xml",` `),d.file("_rels/.rels",` `),d.file("docProps/app.xml",`Microsoft Macintosh Excel0falseWorksheets1Sheet1falsefalsefalse16.0300 `),d.file("docProps/core.xml",'PptxGenJSPptxGenJS'+new Date().toISOString()+''+new Date().toISOString()+""),d.file("xl/_rels/workbook.xml.rels",''),d.file("xl/styles.xml",` `),d.file("xl/theme/theme1.xml",''),d.file("xl/workbook.xml",` `),d.file("xl/worksheets/_rels/sheet1.xml.rels",` `);{var g='';if(e.opts._type===Ae.BUBBLE||e.opts._type===Ae.BUBBLE3D)g+='');else if(e.opts._type===Ae.SCATTER)g+='');else if(h){var w=n.length;n[0].labels.forEach(function(M){return w+=M.filter(function(O){return O&&O!==""}).length}),g+=''),g+=""}else{var v=n.length+n[0].labels.length*n[0].labels[0].length+n[0].labels.length,b=n.length+n[0].labels.length*n[0].labels[0].length+1;g+=''),g+=''}e.opts._type===Ae.BUBBLE||e.opts._type===Ae.BUBBLE3D?n.forEach(function(M,O){O===0?g+="X-Axis":(g+="".concat(Oe(M.name||"Y-Axis".concat(O)),""),g+="".concat(Oe("Size".concat(O)),""))}):n.forEach(function(M){g+="".concat(Oe((M.name||" ").replace("X-Axis","X-Values")),"")}),e.opts._type!==Ae.BUBBLE&&e.opts._type!==Ae.BUBBLE3D&&e.opts._type!==Ae.SCATTER&&n[0].labels.slice().reverse().forEach(function(M){M.filter(function(O){return O&&O!==""}).forEach(function(O){g+="".concat(Oe(O),"")})}),g+=` `,d.file("xl/sharedStrings.xml",g)}{var y='';if(e.opts._type===Ae.BUBBLE||e.opts._type===Ae.BUBBLE3D){y+=''),y+='');var k=1;n.forEach(function(M,O){O===0?y+=''):(y+=''),k++,y+=''))})}else e.opts._type===Ae.SCATTER?(y+='
'),y+=''),n.forEach(function(M,O){y+='')})):(y+='
`),y+=''),n[0].labels.forEach(function(M,O){y+='')}),n.forEach(function(M,O){y+='')}));y+="",y+='',y+="
",d.file("xl/tables/table1.xml",y)}{var C='';if(C+='',e.opts._type===Ae.BUBBLE||e.opts._type===Ae.BUBBLE3D?C+=''):e.opts._type===Ae.SCATTER?C+=''):C+=''),C+='',C+='',e.opts._type===Ae.BUBBLE||e.opts._type===Ae.BUBBLE3D){C+="",C+=''),C+='0';for(var E=1;E').concat(E,"");C+="",n[0].values.forEach(function(M,O){C+=''),C+='').concat(M,"");for(var z=2,Y=1;Y').concat(n[Y].values[O]||"",""),z++,C+='').concat(n[Y].sizes[O]||"",""),z++;C+=""})}else if(e.opts._type===Ae.SCATTER){C+="",C+='');for(var E=0;E').concat(E,"");C+="",n[0].values.forEach(function(M,O){C+=''),C+='').concat(M,"");for(var z=1;z').concat(n[z].values[O]||n[z].values[O]===0?n[z].values[O]:"","");C+=""})}else if(C+="",h){C+='');for(var E=0;E0');for(var E=n[0].labels.length-1;E').concat(E,"");C+="";for(var _=n.length,N=n[0].labels[0].length,I=n[0].labels.length,G=function(M){C+='');var O=_,z=n[0].labels.slice().reverse();z.forEach(function(me,F){var J=me[M];if(J){var S=F===0?1:z[F-1].filter(function(ee){return ee&&ee!==""}).length;O+=S,C+='').concat(O,"")}});for(var Y=0;Y<_;Y++)C+='').concat(n[Y].values[M]||0,"");C+=""},E=0;E'),n[0].labels.forEach(function(M,O){C+='0')});for(var E=0;E').concat(E+1,"");C+="",n[0].labels[0].forEach(function(M,O){C+='');for(var z=n[0].labels.length-1;z>=0;z--)C+=''),C+="".concat(n.length+O+1,""),C+="";for(var Y=0;Y').concat(n[Y].values[O]||"","");C+=""})}C+="",C+='',C+=` `,d.file("xl/worksheets/sheet1.xml",C)}d.generateAsync({type:"base64"}).then(function(M){r.file("ppt/embeddings/Microsoft_Excel_Worksheet".concat(e.globalId,".xlsx"),M,{base64:!0}),r.file("ppt/charts/_rels/"+e.fileName+".rels",''+'')+""),r.file("ppt/charts/".concat(e.fileName),Tm(e)),o("")}).catch(function(M){c(M)})})];case 1:return[2,i.sent()]}})})}function Tm(e){var r,n,i,o,c='',u=!1;if(c+='',c+='',c+=''),c+="",e.opts.showTitle?(c+=so({title:e.opts.title||"Chart Title",color:e.opts.titleColor,fontFace:e.opts.titleFontFace,fontSize:e.opts.titleFontSize||gm,titleAlign:e.opts.titleAlign,titleBold:e.opts.titleBold,titlePos:e.opts.titlePos,titleRotate:e.opts.titleRotate},e.opts.x,e.opts.y),c+=''):c+='',e.opts._type===Ae.BAR3D&&(c+='')),c+="",e.opts.layout?(c+="",c+=" ",c+=' ',c+=' ',c+=' ',c+=' ',c+=' ',c+=' ',c+=' ',c+=" ",c+=""):c+="",Array.isArray(e.opts._type)?e.opts._type.forEach(function(f){var d=At(At({},e.opts),f.options),l=d.secondaryValAxis?ao:_r,h=d.secondaryCatAxis?Hs:Qa;u=u||d.secondaryValAxis,c+=lA(f.type,f.data,d,l,h)}):c+=lA(e.opts._type,e.data,e.opts,_r,Qa),e.opts._type!==Ae.PIE&&e.opts._type!==Ae.DOUGHNUT){if(e.opts.valAxes&&e.opts.valAxes.length>1&&!u)throw new Error("Secondary axis must be used by one of the multiple charts");if(e.opts.catAxes){if(!e.opts.valAxes||e.opts.valAxes.length!==e.opts.catAxes.length)throw new Error("There must be the same number of value and category axes.");c+=al(At(At({},e.opts),e.opts.catAxes[0]),Qa,_r)}else c+=al(e.opts,Qa,_r);e.opts.valAxes?(c+=il(At(At({},e.opts),e.opts.valAxes[0]),_r),e.opts.valAxes[1]&&(c+=il(At(At({},e.opts),e.opts.valAxes[1]),ao))):(c+=il(e.opts,_r),e.opts._type===Ae.BAR3D&&(c+=Rm(e.opts,rA,_r))),!((r=e.opts)===null||r===void 0)&&r.catAxes&&(!((n=e.opts)===null||n===void 0)&&n.catAxes[1])&&(c+=al(At(At({},e.opts),e.opts.catAxes[1]),Hs,ao))}return e.opts.showDataTable&&(c+="",c+=' '),c+=' '),c+=' '),c+=' '),c+=" ",c+=" ",c+=' ',c+=" ",c+=" ",c+=" ",c+=' ',c+=" ",c+=" ",c+=' ',c+=' '),c+=' ',c+=' ',c+=' ',c+=' ',c+=" ",c+=" ",c+=' ',c+=" ",c+=" ",c+=""),c+=" ",c+=!((i=e.opts.plotArea.fill)===null||i===void 0)&&i.color?Wt(e.opts.plotArea.fill):"",c+=e.opts.plotArea.border?'').concat(Wt(e.opts.plotArea.border.color),""):"",c+=" ",c+=" ",c+="",e.opts.showLegend&&(c+="",c+='',c+='',(e.opts.legendFontFace||e.opts.legendFontSize||e.opts.legendColor)&&(c+="",c+=" ",c+=" ",c+=" ",c+=" ",c+=e.opts.legendFontSize?''):"",e.opts.legendColor&&(c+=Wt(e.opts.legendColor)),e.opts.legendFontFace&&(c+=''),e.opts.legendFontFace&&(c+=''),c+=" ",c+=" ",c+=' ',c+=" ",c+=""),c+=""),c+=' ',c+=' ',e.opts._type===Ae.SCATTER&&(c+=''),c+="",c+="",c+=!((o=e.opts.chartArea.fill)===null||o===void 0)&&o.color?Wt(e.opts.chartArea.fill):"",c+=e.opts.chartArea.border?'').concat(Wt(e.opts.chartArea.border.color),""):"",c+=" ",c+="",c+='',c+="",c}function lA(e,r,n,i,o,c){var u=-1,f=1,d=null,l="";switch(e){case Ae.AREA:case Ae.BAR:case Ae.BAR3D:case Ae.LINE:case Ae.RADAR:l+=""),e===Ae.AREA&&n.barGrouping==="stacked"&&(l+=''),(e===Ae.BAR||e===Ae.BAR3D)&&(l+='',l+=''),e===Ae.RADAR&&(l+=''),l+='',r.forEach(function(h){var g;u++,l+="",l+=' '),l+=" ",l+=" ",l+=" Sheet1!$"+Je(h._dataIndex+h.labels.length+1)+"$1",l+=' '+Oe(h.name)+"",l+=" ",l+=" ";var w=n.chartColors?n.chartColors[u%n.chartColors.length]:null;l+=" ",w==="transparent"?l+="":n.chartColorsOpacity?l+=""+We(w,''))+"":l+=""+We(w)+"",e===Ae.LINE||e===Ae.RADAR?n.lineSize===0?l+="":(l+='').concat(We(w),""),l+=''):n.dataBorder&&(l+='').concat(We(n.dataBorder.color),'')),l+=yn(n.shadow,mn),l+=" ",l+=' ',e!==Ae.RADAR&&(l+="",l+=''),n.dataLabelBkgrdColors&&(l+="".concat(We(w),"")),l+="",l+=''),l+="".concat(We(n.dataLabelColor||It),""),l+=''),l+="",n.dataLabelPosition&&(l+='')),l+='',l+=''),l+=''),l+=''),l+=""),(e===Ae.LINE||e===Ae.RADAR)&&(l+="",l+=' ',n.lineDataSymbolSize&&(l+='')),l+=" ",l+=" ".concat(We(n.chartColors[h._dataIndex+1>n.chartColors.length?Math.floor(Math.random()*n.chartColors.length):h._dataIndex]),""),l+=' ').concat(We(n.lineDataSymbolLineColor||w),''),l+=" ",l+=" ",l+=""),(e===Ae.BAR||e===Ae.BAR3D)&&r.length===1&&(n.chartColors&&n.chartColors!==Va&&n.chartColors.length>1||!((g=n.invertedColors)===null||g===void 0)&&g.length)&&h.values.forEach(function(v,b){var y=v<0?n.invertedColors||n.chartColors||Va:n.chartColors||[];l+=" ",l+=' '),l+=' ',l+=' ',l+=" ",n.lineSize===0?l+="":e===Ae.BAR?(l+="",l+=' ',l+=""):(l+="",l+=" ",l+=' ',l+=" ",l+=""),l+=yn(n.shadow,mn),l+=" ",l+=" "}),l+="",n.catLabelFormatCode?(l+=" ",l+=" Sheet1!$A$2:$A$".concat(h.labels[0].length+1,""),l+=" ",l+=" "+(n.catLabelFormatCode||"General")+"",l+=' '),h.labels[0].forEach(function(v,b){return l+='').concat(Oe(v),"")}),l+=" ",l+=" "):(l+=" ",l+=" Sheet1!$A$2:$".concat(Je(h.labels.length),"$").concat(h.labels[0].length+1,""),l+=" ",l+=' '),h.labels.forEach(function(v){l+="",v.forEach(function(b,y){return l+='').concat(Oe(b),"")}),l+=""}),l+=" ",l+=" "),l+="",l+="",l+=" ",l+="Sheet1!$".concat(Je(h._dataIndex+h.labels.length+1),"$2:$").concat(Je(h._dataIndex+h.labels.length+1),"$").concat(h.labels[0].length+1,""),l+=" ",l+=" "+(n.valLabelFormatCode||n.dataTableFormatCode||"General")+"",l+=' '),h.values.forEach(function(v,b){return l+='').concat(v||v===0?v:"","")}),l+=" ",l+=" ",l+="",e===Ae.LINE&&(l+=''),l+=""}),l+=" ",l+=' '),l+=" ",l+=" ",l+=" ",l+=" ",l+=' '),l+=" "+We(n.dataLabelColor||It)+"",l+=' ',l+=" ",l+=" ",l+=" ",n.dataLabelPosition&&(l+=' '),l+=' ',l+=' ',l+=' ',l+=' ',l+=' ',l+=' ',l+=' '),l+=" ",e===Ae.BAR?(l+=' '),l+=' ')):e===Ae.BAR3D?(l+=' '),l+=' '),l+=' '):e===Ae.LINE&&(l+=' '),l+=''),l+="");break;case Ae.SCATTER:l+="",l+='',l+='',u=-1,r.filter(function(h,g){return g>0}).forEach(function(h,g){u++,l+="",l+=' '),l+=' '),l+=" ",l+=" ",l+=" Sheet1!$".concat(Je(g+2),"$1"),l+=' '+Oe(h.name)+"",l+=" ",l+=" ",l+=" ";{var w=n.chartColors[u%n.chartColors.length];w==="transparent"?l+="":n.chartColorsOpacity?l+=""+We(w,'')+"":l+=""+We(w)+"",n.lineSize===0?l+="":(l+='').concat(We(w),""),l+='')),l+=yn(n.shadow,mn)}if(l+=" ",l+="",l+=' ',n.lineDataSymbolSize&&(l+='')),l+="",l+="".concat(We(n.chartColors[g+1>n.chartColors.length?Math.floor(Math.random()*n.chartColors.length):g]),""),l+='').concat(We(n.lineDataSymbolLineColor||n.chartColors[u%n.chartColors.length]),''),l+="",l+="",l+="",n.showLabel){var v=io("-xxxx-xxxx-xxxx-xxxxxxxxxxxx");h.labels[0]&&(n.dataLabelFormatScatter==="custom"||n.dataLabelFormatScatter==="customXY")&&(l+="",h.labels[0].forEach(function(b,y){(n.dataLabelFormatScatter==="custom"||n.dataLabelFormatScatter==="customXY")&&(l+=" ",l+=' '),l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=' ',l+=" "+Oe(b)+"",l+=" ",n.dataLabelFormatScatter==="customXY"&&!/^ *$/.test(b)&&(l+=" ",l+=' ',l+=" (",l+=" ",l+=' ',l+=' ',l+=" ",l+=" ",l+=" ",l+=" ["+Oe(h.name)+"",l+=" ",l+=" ",l+=' ',l+=" , ",l+=" ",l+=' ',l+=' ',l+=" ",l+=" ",l+=" ",l+=" ["+Oe(h.name)+"]",l+=" ",l+=" ",l+=' ',l+=" )",l+=" ",l+=' '),l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",n.dataLabelPosition&&(l+=' '),l+=' ',l+=' ',l+=' ',l+=' ',l+=' ',l+=' ',l+=' ',l+=" ",l+=' ',l+=' ',l+=' '),l+=" ",l+=" ",l+="")}),l+=""),n.dataLabelFormatScatter==="XY"&&(l+="",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=' ',l+=" ",l+=" ",n.dataLabelPosition&&(l+=' '),l+=' ',l+=' '),l+=' '),l+=' '),l+=' ',l+=' ',l+=" ",l+=' ',l+=' ',l+=" ",l+=" ",l+="")}r.length===1&&n.chartColors!==Va&&h.values.forEach(function(b,y){var k=b<0?n.invertedColors||n.chartColors||Va:n.chartColors||[];l+=" ",l+=' '),l+=' ',l+=' ',l+=" ",n.lineSize===0?l+="":(l+="",l+=' ',l+=""),l+=yn(n.shadow,mn),l+=" ",l+=" "}),l+="",l+=" ",l+=" Sheet1!$A$2:$A$".concat(r[0].values.length+1,""),l+=" ",l+=" General",l+=' '),r[0].values.forEach(function(b,y){l+='').concat(b||b===0?b:"","")}),l+=" ",l+=" ",l+="",l+="",l+=" ",l+=" Sheet1!$".concat(Je(g+2),"$2:$").concat(Je(g+2),"$").concat(r[0].values.length+1,""),l+=" ",l+=" General",l+=' '),r[0].values.forEach(function(b,y){l+='').concat(h.values[y]||h.values[y]===0?h.values[y]:"","")}),l+=" ",l+=" ",l+="",l+='',l+=""}),l+=" ",l+=' '),l+=" ",l+=" ",l+=" ",l+=" ",l+=' '),l+=" "+We(n.dataLabelColor||It)+"",l+=' ',l+=" ",l+=" ",l+=" ",n.dataLabelPosition&&(l+=' '),l+=' ',l+=' ',l+=' ',l+=' ',l+=' ',l+=' ',l+=" ",l+=''),l+="";break;case Ae.BUBBLE:case Ae.BUBBLE3D:l+="",l+='',u=-1,r.filter(function(h,g){return g>0}).forEach(function(h,g){u++,l+="",l+=' '),l+=' '),l+=" ",l+=" ",l+=" Sheet1!$"+Je(f+1)+"$1",l+=' '+Oe(h.name)+"",l+=" ",l+=" ";{l+="";var w=n.chartColors[u%n.chartColors.length];w==="transparent"?l+="":n.chartColorsOpacity?l+="".concat(We(w,''),""):l+=""+We(w)+"",n.lineSize===0?l+="":n.dataBorder?l+='').concat(We(n.dataBorder.color),''):(l+='').concat(We(w),""),l+='')),l+=yn(n.shadow,mn),l+=""}l+="",l+=" ",l+=" Sheet1!$A$2:$A$".concat(r[0].values.length+1,""),l+=" ",l+=" General",l+=' '),r[0].values.forEach(function(v,b){l+='').concat(v||v===0?v:"","")}),l+=" ",l+=" ",l+="",l+="",l+=" ",l+="Sheet1!$".concat(Je(f+1),"$2:$").concat(Je(f+1),"$").concat(r[0].values.length+1,""),f++,l+=" ",l+=" General",l+=' '),r[0].values.forEach(function(v,b){l+='').concat(h.values[b]||h.values[b]===0?h.values[b]:"","")}),l+=" ",l+=" ",l+="",l+=" ",l+=" ",l+="Sheet1!$".concat(Je(f+1),"$2:$").concat(Je(f+1),"$").concat(h.sizes.length+1,""),f++,l+=" ",l+=" General",l+=' '),h.sizes.forEach(function(v,b){l+='').concat(v||"","")}),l+=" ",l+=" ",l+=" ",l+=' ',l+=""}),l+="",l+=''),l+="",l+=''),l+="".concat(We(n.dataLabelColor||It),""),l+=''),l+="",n.dataLabelPosition&&(l+='')),l+='',l+=''),l+=''),l+="",l+=' ',l+=' ',l+=" ",l+="",l+="",l+=''),l+="";break;case Ae.DOUGHNUT:case Ae.PIE:d=r[0],l+="",l+=' ',l+="",l+=' ',l+=' ',l+=" ",l+=" ",l+=" Sheet1!$B$1",l+=" ",l+=' ',l+=' '+Oe(d.name)+"",l+=" ",l+=" ",l+=" ",l+=" ",l+=' ',l+=' ',n.dataNoEffects?l+="":l+=yn(n.shadow,mn),l+=" ",d.labels[0].forEach(function(h,g){l+="",l+=' '),l+=' ',l+=" ",l+="".concat(We(n.chartColors[g+1>n.chartColors.length?Math.floor(Math.random()*n.chartColors.length):g]),""),n.dataBorder&&(l+='').concat(We(n.dataBorder.color),'')),l+=yn(n.shadow,mn),l+=" ",l+=""}),l+="",d.labels[0].forEach(function(h,g){l+="",l+=' '),l+=' '),l+=" ",l+=" ",l+=" ",l+=' '),l+=" "+We(n.dataLabelColor||It)+"",l+=' '),l+=" ",l+=" ",l+=" ",e===Ae.PIE&&n.dataLabelPosition&&(l+='')),l+=' ',l+=' ',l+=' ',l+=' ',l+=' ',l+=' ',l+=" "}),l+=' '),l+=" ",l+=" ",l+=" ",l+=" ",l+=" ",l+=' '),l+=' ',l+=" ",l+=" ",l+=" ",l+=" ",l+=e===Ae.PIE?'':"",l+=' ',l+=' ',l+=' ',l+=' ',l+=' ',l+=' ',l+=' '),l+="",l+="",l+=" ",l+=" Sheet1!$A$2:$A$".concat(d.labels[0].length+1,""),l+=" ",l+=' '),d.labels[0].forEach(function(h,g){l+='').concat(Oe(h),"")}),l+=" ",l+=" ",l+="",l+=" ",l+=" ",l+=" Sheet1!$B$2:$B$".concat(d.labels[0].length+1,""),l+=" ",l+=' '),d.values.forEach(function(h,g){l+='').concat(h||h===0?h:"","")}),l+=" ",l+=" ",l+=" ",l+=" ",l+=' '),e===Ae.DOUGHNUT&&(l+='')),l+="";break;default:l+="";break}return l}function al(e,r,n){var i="";return e._type===Ae.SCATTER||e._type===Ae.BUBBLE||e._type===Ae.BUBBLE3D?i+="":i+="",i+=' ',i+=" ",i+='',(e.catAxisMaxVal||e.catAxisMaxVal===0)&&(i+='')),(e.catAxisMinVal||e.catAxisMinVal===0)&&(i+='')),i+="",i+=' ',i+=' ',i+=e.catGridLine.style!=="none"?ol(e.catGridLine):"",e.showCatAxisTitle&&(i+=so({color:e.catAxisTitleColor,fontFace:e.catAxisTitleFontFace,fontSize:e.catAxisTitleFontSize,titleRotate:e.catAxisTitleRotate,title:e.catAxisTitle||"Axis Title"})),e._type===Ae.SCATTER||e._type===Ae.BUBBLE||e._type===Ae.BUBBLE3D?i+=' ':i+=' ',e._type===Ae.SCATTER?(i+=' ',i+=' ',i+=' '):(i+=' ',i+=' ',i+=' '),i+=" ",i+=' '),i+=e.catAxisLineShow?""+We(e.catAxisLineColor||gn.color)+"":"",i+=' ',i+=" ",i+=" ",i+=" ",i+=" ",e.catAxisLabelRotate?i+=''):i+="",i+=" ",i+=" ",i+=" ",i+=' '),i+=" "+We(e.catAxisLabelColor||It)+"",i+=' ',i+=" ",i+=" ",i+=' ',i+=" ",i+=" ",i+=' ',i+=" '),i+=' ',i+=' ',i+=' '),e.catAxisLabelFrequency&&(i+=' '),(e.catLabelFormatCode||e._type===Ae.SCATTER||e._type===Ae.BUBBLE||e._type===Ae.BUBBLE3D)&&(e.catLabelFormatCode&&(["catAxisBaseTimeUnit","catAxisMajorTimeUnit","catAxisMinorTimeUnit"].forEach(function(o){e[o]&&(typeof e[o]!="string"||!["days","months","years"].includes(e[o].toLowerCase()))&&(console.warn('"'.concat(o,`" must be one of: 'days','months','years' !`)),e[o]=null)}),e.catAxisBaseTimeUnit&&(i+=''),e.catAxisMajorTimeUnit&&(i+=''),e.catAxisMinorTimeUnit&&(i+='')),e.catAxisMajorUnit&&(i+='')),e.catAxisMinorUnit&&(i+=''))),e._type===Ae.SCATTER||e._type===Ae.BUBBLE||e._type===Ae.BUBBLE3D?i+="":i+="",i}function il(e,r){var n=r===_r?e.barDir==="col"?"l":"b":e.barDir!=="col"?"r":"t";r===ao&&(n="r");var i=r===_r?Qa:Hs,o="";if(o+="",o+=' ',o+=" ",e.valAxisLogScaleBase&&(o+='')),o+='',(e.valAxisMaxVal||e.valAxisMaxVal===0)&&(o+='')),(e.valAxisMinVal||e.valAxisMinVal===0)&&(o+='')),o+=" ",o+=' '),o+=' ',e.valGridLine.style!=="none"&&(o+=ol(e.valGridLine)),e.showValAxisTitle&&(o+=so({color:e.valAxisTitleColor,fontFace:e.valAxisTitleFontFace,fontSize:e.valAxisTitleFontSize,titleRotate:e.valAxisTitleRotate,title:e.valAxisTitle||"Axis Title"})),o+=''),e._type===Ae.SCATTER?(o+=' ',o+=' ',o+=' '):(o+=' ',o+=' ',o+=' '),o+=" ",o+=' '),o+=e.valAxisLineShow?""+We(e.valAxisLineColor||gn.color)+"":"",o+=' ',o+=" ",o+=" ",o+=" ",o+=" ",o+=" "),o+=" ",o+=" ",o+=" ",o+=' '),o+=" "+We(e.valAxisLabelColor||It)+"",o+=' ',o+=" ",o+=" ",o+=' ',o+=" ",o+=" ",o+=' ',typeof e.catAxisCrossesAt=="number")o+=' ');else if(typeof e.catAxisCrossesAt=="string")o+=' ';else{var c=n==="r"||n==="t",u=c?"max":"autoZero";o+=' '}return o+=' ',e.valAxisMajorUnit&&(o+=' ')),e.valAxisDisplayUnit&&(o+='').concat(e.valAxisDisplayUnitLabel?"":"","")),o+="",o}function Rm(e,r,n){var i="";return i+="",i+=' ',i+=' ',i+=' ',i+=' ',i+=e.serGridLine.style!=="none"?ol(e.serGridLine):"",e.showSerAxisTitle&&(i+=so({color:e.serAxisTitleColor,fontFace:e.serAxisTitleFontFace,fontSize:e.serAxisTitleFontSize,titleRotate:e.serAxisTitleRotate,title:e.serAxisTitle||"Axis Title"})),i+=' '),i+=' ',i+=' ',i+=' '),i+=" ",i+=' ',i+=e.serAxisLineShow?"".concat(We(e.serAxisLineColor||gn.color),""):"",i+=' ',i+=" ",i+=" ",i+=" ",i+=" ",i+=" ",i+=" ",i+=" ",i+=" ",i+=' '),i+=" ".concat(We(e.serAxisLabelColor||It),""),i+=' '),i+=" ",i+=" ",i+=' ',i+=" ",i+=" ",i+=' ',i+=' ',e.serAxisLabelFrequency&&(i+=' '),e.serLabelFormatCode&&(["serAxisBaseTimeUnit","serAxisMajorTimeUnit","serAxisMinorTimeUnit"].forEach(function(o){e[o]&&(typeof e[o]!="string"||!["days","months","years"].includes(o.toLowerCase()))&&(console.warn('"'.concat(o,`" must be one of: 'days','months','years' !`)),e[o]=null)}),e.serAxisBaseTimeUnit&&(i+=' ')),e.serAxisMajorTimeUnit&&(i+=' ')),e.serAxisMinorTimeUnit&&(i+=' ')),e.serAxisMajorUnit&&(i+=' ')),e.serAxisMinorUnit&&(i+=' '))),i+="",i}function so(e,r,n){var i=e.titleAlign==="left"||e.titleAlign==="right"?''):"",o=e.titleRotate?''):"",c=e.fontSize?'sz="'.concat(Math.round(e.fontSize*100),'"'):"",u=e.titleBold?1:0,f="";if(e.titlePos&&typeof e.titlePos.x=="number"&&typeof e.titlePos.y=="number"){var d=e.titlePos.x+r,l=e.titlePos.y+n,h=d===0?0:d*(d/5)/10;h>=1&&(h=h/10),h>=.1&&(h=h/10);var g=l===0?0:l*(l/5)/10;g>=1&&(g=g/10),g>=.1&&(g=g/10),f='')}return` `.concat(o,` `).concat(i,` `).concat(We(e.color||It),` `).concat(We(e.color||It),` `).concat(Oe(e.title)||"",` `).concat(f,` `)}function Je(e){var r="",n=e-1;return n<=25?r=Wa[n]:r="".concat(Wa[Math.floor(n/Wa.length-1)]).concat(Wa[n%Wa.length]),r}function yn(e,r){if(e){if(typeof e!="object")return console.warn("`shadow` options must be an object. Ex: `{shadow: {type:'none'}}`"),""}else return"";var n="",i=At(At({},r),e),o=i.type||"outer",c=Re(i.blur),u=Re(i.offset),f=Math.round(i.angle*6e4),d=i.color,l=Math.round(i.opacity*1e5),h=i.rotateWithShape?1:0;return n+="'),n+=''),n+=''),n+=""),n+="",n}function ol(e){var r="";return r+=" ",r+=' '),r+=' ',r+=' ',r+=" ",r+=" ",r+="",r}function lo(e){if(!e||e==="flat")return"flat";if(e==="square")return"sq";if(e==="round")return"rnd";var r=e;throw new Error("Invalid chart line cap: ".concat(r))}function sl(e){var r=typeof require<"u"&&typeof window>"u"?require("fs"):null,n=typeof require<"u"&&typeof window>"u"?require("https"):null,i=[],o=e._relsMedia.filter(function(u){return u.type!=="online"&&!u.data&&(!u.path||u.path&&!u.path.includes("preencoded"))}),c=[];return o.forEach(function(u){c.includes(u.path)?u.isDuplicate=!0:(u.isDuplicate=!1,c.push(u.path))}),o.filter(function(u){return!u.isDuplicate}).forEach(function(u){i.push(new Promise(function(f,d){if(r&&u.path.indexOf("http")!==0)try{var l=r.readFileSync(u.path);u.data=Buffer.from(l).toString("base64"),o.filter(function(g){return g.isDuplicate&&g.path===u.path}).forEach(function(g){return g.data=u.data}),f("done")}catch(g){u.data=na,o.filter(function(w){return w.isDuplicate&&w.path===u.path}).forEach(function(w){return w.data=u.data}),d(new Error('ERROR: Unable to read media: "'.concat(u.path,`" `).concat(String(g))))}else if(r&&n&&u.path.indexOf("http")===0)n.get(u.path,function(g){var w="";g.setEncoding("binary"),g.on("data",function(v){return w+=v}),g.on("end",function(){u.data=Buffer.from(w,"binary").toString("base64"),o.filter(function(v){return v.isDuplicate&&v.path===u.path}).forEach(function(v){return v.data=u.data}),f("done")}),g.on("error",function(v){u.data=na,o.filter(function(b){return b.isDuplicate&&b.path===u.path}).forEach(function(b){return b.data=u.data}),d(new Error("ERROR! Unable to load image (https.get): ".concat(u.path)))})});else{var h=new XMLHttpRequest;h.onload=function(){var g=new FileReader;g.onloadend=function(){u.data=g.result,o.filter(function(w){return w.isDuplicate&&w.path===u.path}).forEach(function(w){return w.data=u.data}),u.isSvgPng?cA(u).then(function(){f("done")}).catch(function(w){d(w)}):f("done")},g.readAsDataURL(h.response)},h.onerror=function(g){u.data=na,o.filter(function(w){return w.isDuplicate&&w.path===u.path}).forEach(function(w){return w.data=u.data}),d(new Error("ERROR! Unable to load image (xhr.onerror): ".concat(u.path)))},h.open("GET",u.path),h.responseType="blob",h.send()}}))}),e._relsMedia.filter(function(u){return u.isSvgPng&&u.data}).forEach(function(u){r?(u.data=na,i.push(Promise.resolve().then(function(){return"done"}))):i.push(cA(u))}),i}function cA(e){return yr(this,void 0,void 0,function(){return wr(this,function(r){switch(r.label){case 0:return[4,new Promise(function(n,i){var o=new Image;o.onload=function(){o.width+o.height===0&&o.onerror("h/w=0");var c=document.createElement("CANVAS"),u=c.getContext("2d");c.width=o.width,c.height=o.height,u.drawImage(o,0,0);try{e.data=c.toDataURL(e.type),n("done")}catch(f){o.onerror(f)}c=null},o.onerror=function(c){e.data=na,i(new Error("ERROR! Unable to load image (image.onerror): ".concat(e.path)))},o.src=typeof e.data=="string"?e.data:na})];case 1:return[2,r.sent()]}})})}var Dm={cover:function(e,r){var n=e.h/e.w,i=r.h/r.w,o=i>n,c=o?r.h/n:r.w,u=o?r.h:r.w*n,f=Math.round(1e5*.5*(1-r.w/c)),d=Math.round(1e5*.5*(1-r.h/u));return'')},contain:function(e,r){var n=e.h/e.w,i=r.h/r.w,o=i>n,c=o?r.w:r.h/n,u=o?r.w*n:r.h,f=Math.round(1e5*.5*(1-r.w/c)),d=Math.round(1e5*.5*(1-r.h/u));return'')},crop:function(e,r){var n=r.x,i=e.w-(r.x+r.w),o=r.y,c=e.h-(r.y+r.h),u=Math.round(1e5*(n/e.w)),f=Math.round(1e5*(i/e.w)),d=Math.round(1e5*(o/e.h)),l=Math.round(1e5*(c/e.h));return'')}};function ll(e){var r,n=e._name?'':"",i=1;return e._bkgdImgRid?n+=''):!((r=e.background)===null||r===void 0)&&r.color?n+="".concat(Wt(e.background),""):!e.bkgd&&e._name&&e._name===Vs&&(n+=''),n+="",n+='',n+='',n+='',e._slideObjects.forEach(function(o,c){var u,f,d,l,h,g,w,v,b=0,y=0,k=ze("75%","X",e._presLayout),C=0,E,_="",N=null,I=null,G=0,M=0,O=null,z=null,Y=(u=o.options)===null||u===void 0?void 0:u.sizing,me=(f=o.options)===null||f===void 0?void 0:f.rounding;e._slideLayout!==void 0&&e._slideLayout._slideObjects!==void 0&&o.options&&o.options.placeholder&&(E=e._slideLayout._slideObjects.filter(function(Z){return Z.options.placeholder===o.options.placeholder})[0]),o.options=o.options||{},typeof o.options.x<"u"&&(b=ze(o.options.x,"X",e._presLayout)),typeof o.options.y<"u"&&(y=ze(o.options.y,"Y",e._presLayout)),typeof o.options.w<"u"&&(k=ze(o.options.w,"X",e._presLayout)),typeof o.options.h<"u"&&(C=ze(o.options.h,"Y",e._presLayout));var F=k,J=C;switch(E&&((E.options.x||E.options.x===0)&&(b=ze(E.options.x,"X",e._presLayout)),(E.options.y||E.options.y===0)&&(y=ze(E.options.y,"Y",e._presLayout)),(E.options.w||E.options.w===0)&&(k=ze(E.options.w,"X",e._presLayout)),(E.options.h||E.options.h===0)&&(C=ze(E.options.h,"Y",e._presLayout))),o.options.flipH&&(_+=' flipH="1"'),o.options.flipV&&(_+=' flipV="1"'),o.options.rotate&&(_+=' rot="'.concat(vn(o.options.rotate),'"')),o._type){case Ie.table:if(N=o.arrTabRows,I=o.options,G=0,M=0,N[0].forEach(function(Z){O=Z.options||null,G+=O!=null&&O.colspan?Number(O.colspan):1}),z=''),z+=' ',z+=''),z+='',Array.isArray(I.colW)){z+="";for(var S=0;S')}z+=""}else{M=I.colW?I.colW:Fe,o.options.w&&!I.colW&&(M=Math.round((typeof o.options.w=="number"?o.options.w:1)/G)),z+="";for(var Ce=0;Ce');z+=""}N.forEach(function(Z){for(var se,re,ye=function(ve){var Ue=Z[ve],Qe=(se=Ue.options)===null||se===void 0?void 0:se.colspan,Ve=(re=Ue.options)===null||re===void 0?void 0:re.rowspan;if(Qe&&Qe>1){var ot=new Array(Qe-1).fill(void 0).map(function(x){return{_type:Ie.tablecell,options:{rowspan:Ve},_hmerge:!0}});Z.splice.apply(Z,no([ve+1,0],ot,!1)),ve+=Qe}else ve+=1;Pe=ve},Pe,ge=0;ge1){var ot={_type:Ie.tablecell,options:{colspan:Qe},_rowContinue:Ue-1,_vmerge:!0,_hmerge:Ve};re.splice(Pe,0,ot)}})}),N.forEach(function(Z,se){var re=0;Array.isArray(I.rowH)&&I.rowH[se]?re=Ge(Number(I.rowH[se])):I.rowH&&!isNaN(Number(I.rowH))?re=Ge(Number(I.rowH)):(o.options.cy||o.options.h)&&(re=Math.round((o.options.h?Ge(o.options.h):typeof o.options.cy=="number"?o.options.cy:1)/N.length)),z+=''),Z.forEach(function(ye){var Pe,ge,ve,Ue,Qe,Ve=ye,ot={rowSpan:((Pe=Ve.options)===null||Pe===void 0?void 0:Pe.rowspan)>1?Ve.options.rowspan:void 0,gridSpan:((ge=Ve.options)===null||ge===void 0?void 0:ge.colspan)>1?Ve.options.colspan:void 0,vMerge:Ve._vmerge?1:void 0,hMerge:Ve._hmerge?1:void 0},x=Object.keys(ot).map(function(ne){return[ne,ot[ne]]}).filter(function(ne){ne[0];var H=ne[1];return!!H}).map(function(ne){var H=ne[0],fe=ne[1];return"".concat(String(H),'="').concat(String(fe),'"')}).join(" ");if(x&&(x=" "+x),Ve._hmerge||Ve._vmerge){z+="");return}var te=Ve.options||{};Ve.options=te,["align","bold","border","color","fill","fontFace","fontSize","margin","underline","valign"].forEach(function(ne){I[ne]&&!te[ne]&&te[ne]!==0&&(te[ne]=I[ne])});var $=te.valign?' anchor="'.concat(te.valign.replace(/^c$/i,"ctr").replace(/^m$/i,"ctr").replace("center","ctr").replace("middle","ctr").replace("top","t").replace("btm","b").replace("bottom","b"),'"'):"",R=!((Ue=(ve=Ve._optImp)===null||ve===void 0?void 0:ve.fill)===null||Ue===void 0)&&Ue.color?Ve._optImp.fill.color:!((Qe=Ve._optImp)===null||Qe===void 0)&&Qe.fill&&typeof Ve._optImp.fill=="string"?Ve._optImp.fill:"";R=R||te.fill?te.fill:"";var B=R?Wt(R):"",j=te.margin===0||te.margin?te.margin:$u;!Array.isArray(j)&&typeof j=="number"&&(j=[j,j,j,j]);var le="";j[0]>=1?le=' marL="'.concat(Re(j[3]),'" marR="').concat(Re(j[1]),'" marT="').concat(Re(j[0]),'" marB="').concat(Re(j[2]),'"'):le=' marL="'.concat(Ge(j[3]),'" marR="').concat(Ge(j[1]),'" marT="').concat(Ge(j[0]),'" marB="').concat(Ge(j[2]),'"'),z+="").concat(dA(Ve),""),te.border&&Array.isArray(te.border)&&[{idx:3,name:"lnL"},{idx:1,name:"lnR"},{idx:0,name:"lnT"},{idx:2,name:"lnB"}].forEach(function(ne){te.border[ne.idx].type!=="none"?(z+="'),z+="".concat(We(te.border[ne.idx].color),""),z+=''),z+="")):z+="")}),z+=B,z+=" ",z+=" "}),z+=""}),z+=" ",z+=" ",z+=" ",z+="",n+=z,i++;break;case Ie.text:case Ie.placeholder:if(!o.options.line&&C===0&&(C=Fe*.3),o.options._bodyProp||(o.options._bodyProp={}),o.options.margin&&Array.isArray(o.options.margin)?(o.options._bodyProp.lIns=Re(o.options.margin[0]||0),o.options._bodyProp.rIns=Re(o.options.margin[1]||0),o.options._bodyProp.bIns=Re(o.options.margin[2]||0),o.options._bodyProp.tIns=Re(o.options.margin[3]||0)):typeof o.options.margin=="number"&&(o.options._bodyProp.lIns=Re(o.options.margin),o.options._bodyProp.rIns=Re(o.options.margin),o.options._bodyProp.bIns=Re(o.options.margin),o.options._bodyProp.tIns=Re(o.options.margin)),n+="",n+=''),!((d=o.options.hyperlink)===null||d===void 0)&&d.url&&(n+='')),!((l=o.options.hyperlink)===null||l===void 0)&&l.slide&&(n+='')),n+="",n+="':"/>"),n+="".concat(o._type==="placeholder"?co(o):co(E),""),n+="",n+=""),n+=''),n+=''),o.shape==="custGeom")n+="",n+="",n+="",n+="",n+="",n+="",n+='',n+="",n+=''),(g=o.options.points)===null||g===void 0||g.forEach(function(Z,se){if("curve"in Z)switch(Z.curve.type){case"arc":n+='');break;case"cubic":n+=` `);break;case"quadratic":n+=` `);break}else"close"in Z?n+="":Z.moveTo||se===0?n+=''):n+='')}),n+="",n+="",n+="";else{if(n+='',o.options.rectRadius)n+='');else if(o.options.angleRange){for(var ie=0;ie<2;ie++){var W=o.options.angleRange[ie];n+='')}o.options.arcThicknessRatio&&(n+=''))}n+=""}n+=o.options.fill?Wt(o.options.fill):"",o.options.line&&(n+=o.options.line.width?''):"",o.options.line.color&&(n+=Wt(o.options.line)),o.options.line.dashType&&(n+='')),o.options.line.beginArrowType&&(n+='')),o.options.line.endArrowType&&(n+='')),n+=""),o.options.shadow&&o.options.shadow.type!=="none"&&(o.options.shadow.type=o.options.shadow.type||"outer",o.options.shadow.blur=Re(o.options.shadow.blur||8),o.options.shadow.offset=Re(o.options.shadow.offset||4),o.options.shadow.angle=Math.round((o.options.shadow.angle||270)*6e4),o.options.shadow.opacity=Math.round((o.options.shadow.opacity||.75)*1e5),o.options.shadow.color=o.options.shadow.color||tA.color,n+="",n+=" '),n+=' '),n+=' '),n+=" ",n+=""),n+="",n+=dA(o),n+="";break;case Ie.image:if(n+="",n+=" ",n+=''),!((w=o.hyperlink)===null||w===void 0)&&w.url&&(n+='')),!((v=o.hyperlink)===null||v===void 0)&&v.slide&&(n+='')),n+=" ",n+=' ',n+=" "+co(E)+"",n+=" ",n+="",(e._relsMedia||[]).filter(function(Z){return Z.rId===o.imageRid})[0]&&(e._relsMedia||[]).filter(function(Z){return Z.rId===o.imageRid})[0].extn==="svg"?(n+=''),n+=o.options.transparency?' '):"",n+=" ",n+=' ',n+=' '),n+=" ",n+=" ",n+=""):(n+=''),n+=o.options.transparency?''):"",n+=""),Y!=null&&Y.type){var V=Y.w?ze(Y.w,"X",e._presLayout):k,ae=Y.h?ze(Y.h,"Y",e._presLayout):C,P=ze(Y.x||0,"X",e._presLayout),T=ze(Y.y||0,"Y",e._presLayout);n+=Dm[Y.type]({w:F,h:J},{w:V,h:ae,x:P,y:T}),F=V,J=ae}else n+=" ";n+="",n+="",n+=" ",n+=' '),n+=' '),n+=" ",n+=' '),o.options.shadow&&o.options.shadow.type!=="none"&&(o.options.shadow.type=o.options.shadow.type||"outer",o.options.shadow.blur=Re(o.options.shadow.blur||8),o.options.shadow.offset=Re(o.options.shadow.offset||4),o.options.shadow.angle=Math.round((o.options.shadow.angle||270)*6e4),o.options.shadow.opacity=Math.round((o.options.shadow.opacity||.75)*1e5),o.options.shadow.color=o.options.shadow.color||tA.color,n+="",n+="'),n+=''),n+=''),n+=""),n+=""),n+="",n+="";break;case Ie.media:o.mtype==="online"?(n+="",n+=" ",n+=''),n+=" ",n+=" ",n+=' '),n+=" ",n+=" ",n+=' '),n+=" ",n+=" '),n+=' ',n+=" ",n+=""):(n+="",n+=" ",n+=''),n+=' ',n+=" ",n+=' '),n+=" ",n+=' ',n+=' '),n+=" ",n+=" ",n+=" ",n+=" ",n+=' '),n+=" ",n+=" '),n+=' ',n+=" ",n+="");break;case Ie.chart:n+="",n+=" ",n+=' '),n+=" ",n+=" ".concat(co(E),""),n+=" ",n+=' '),n+=' ',n+=' ',n+=' '),n+=" ",n+=" ",n+="";break;default:n+="";break}}),e._slideNumberProps&&(e._slideNumberProps.align||(e._slideNumberProps.align="left"),n+="",n+=" ",n+=' ',n+=' ',n+=" ",n+=" ",n+=""+'')+'')+' ',n+="",n+="'),e._slideNumberProps.color&&(n+=Wt(e._slideNumberProps.color)),e._slideNumberProps.fontFace&&(n+='')),n+=""),n+="",n+="",e._slideNumberProps.align.startsWith("l")?n+='':e._slideNumberProps.align.startsWith("c")?n+='':e._slideNumberProps.align.startsWith("r")?n+='':n+='',n+=''),n+="".concat(e._slideNum,''),n+=""),n+="",n+="",n}function cl(e,r){var n=0,i=''+vt+'';return e._rels.forEach(function(o){n=Math.max(n,o.rId),o.type.toLowerCase().includes("hyperlink")?o.data==="slide"?i+=''):i+=''):o.type.toLowerCase().includes("notesSlide")&&(i+=''))}),(e._relsChart||[]).forEach(function(o){n=Math.max(n,o.rId),i+='')}),(e._relsMedia||[]).forEach(function(o){var c=o.rId.toString();n=Math.max(n,o.rId),o.type.toLowerCase().includes("image")?i+='':o.type.toLowerCase().includes("audio")?i.includes(' Target="'+o.Target+'"')?i+='':i+='':o.type.toLowerCase().includes("video")?i.includes(' Target="'+o.Target+'"')?i+='':i+='':o.type.toLowerCase().includes("online")&&(i.includes(' Target="'+o.Target+'"')?i+='':i+='')}),r.forEach(function(o,c){i+='')}),i+="",i}function uA(e,r){var n,i,o="",c="",u="",f="",d=r?"a:lvl1pPr":"a:pPr",l=Re(pm),h="<".concat(d).concat(e.options.rtlMode?' rtl="1" ':"");{if(e.options.align)switch(e.options.align){case"left":h+=' algn="l"';break;case"right":h+=' algn="r"';break;case"center":h+=' algn="ctr"';break;case"justify":h+=' algn="just"';break;default:h+="";break}if(e.options.lineSpacing?c=''):e.options.lineSpacingMultiple&&(c='')),e.options.indentLevel&&!isNaN(Number(e.options.indentLevel))&&e.options.indentLevel>0&&(h+=' lvl="'.concat(e.options.indentLevel,'"')),e.options.paraSpaceBefore&&!isNaN(Number(e.options.paraSpaceBefore))&&e.options.paraSpaceBefore>0&&(u+='')),e.options.paraSpaceAfter&&!isNaN(Number(e.options.paraSpaceAfter))&&e.options.paraSpaceAfter>0&&(u+='')),typeof e.options.bullet=="object")if(!((i=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.bullet)===null||i===void 0)&&i.indent&&(l=Re(e.options.bullet.indent)),e.options.bullet.type)e.options.bullet.type.toString().toLowerCase()==="number"&&(h+=' marL="'.concat(e.options.indentLevel&&e.options.indentLevel>0?l+l*e.options.indentLevel:l,'" indent="-').concat(l,'"'),o=''));else if(e.options.bullet.characterCode){var g="&#x".concat(e.options.bullet.characterCode,";");/^[0-9A-Fa-f]{4}$/.test(e.options.bullet.characterCode)||(console.warn("Warning: `bullet.characterCode should be a 4-digit unicode charatcer (ex: 22AB)`!"),g=ra.DEFAULT),h+=' marL="'.concat(e.options.indentLevel&&e.options.indentLevel>0?l+l*e.options.indentLevel:l,'" indent="-').concat(l,'"'),o=''}else if(e.options.bullet.code){var g="&#x".concat(e.options.bullet.code,";");/^[0-9A-Fa-f]{4}$/.test(e.options.bullet.code)||(console.warn("Warning: `bullet.code should be a 4-digit hex code (ex: 22AB)`!"),g=ra.DEFAULT),h+=' marL="'.concat(e.options.indentLevel&&e.options.indentLevel>0?l+l*e.options.indentLevel:l,'" indent="-').concat(l,'"'),o=''}else h+=' marL="'.concat(e.options.indentLevel&&e.options.indentLevel>0?l+l*e.options.indentLevel:l,'" indent="-').concat(l,'"'),o='');else e.options.bullet?(h+=' marL="'.concat(e.options.indentLevel&&e.options.indentLevel>0?l+l*e.options.indentLevel:l,'" indent="-').concat(l,'"'),o='')):e.options.bullet||(h+=' indent="0" marL="0"',o="");if(e.options.tabStops&&Array.isArray(e.options.tabStops)){var w=e.options.tabStops.map(function(v){return'')}).join("");f="".concat(w,"")}h+=">"+c+u+o+f,r&&(h+=AA(e.options,!0)),h+=""}return h}function AA(e,r){var n,i="",o=r?"a:defRPr":"a:rPr";if(i+="<"+o+' lang="'+(e.lang?e.lang:"en-US")+'"'+(e.lang?' altLang="en-US"':""),i+=e.fontSize?' sz="'.concat(Math.round(e.fontSize*100),'"'):"",i+=e!=null&&e.bold?' b="'.concat(e.bold?"1":"0",'"'):"",i+=e!=null&&e.italic?' i="'.concat(e.italic?"1":"0",'"'):"",i+=e!=null&&e.strike?' strike="'.concat(typeof e.strike=="string"?e.strike:"sngStrike",'"'):"",typeof e.underline=="object"&&(!((n=e.underline)===null||n===void 0)&&n.style)?i+=' u="'.concat(e.underline.style,'"'):typeof e.underline=="string"?i+=' u="'.concat(String(e.underline),'"'):e.hyperlink&&(i+=' u="sng"'),e.baseline?i+=' baseline="'.concat(Math.round(e.baseline*50),'"'):e.subscript?i+=' baseline="-40000"':e.superscript&&(i+=' baseline="30000"'),i+=e.charSpacing?' spc="'.concat(Math.round(e.charSpacing*100),'" kern="0"'):"",i+=' dirty="0">',(e.color||e.fontFace||e.outline||typeof e.underline=="object"&&e.underline.color)&&(e.outline&&typeof e.outline=="object"&&(i+='').concat(Wt(e.outline.color||"FFFFFF"),"")),e.color&&(i+=Wt({color:e.color,transparency:e.transparency})),e.highlight&&(i+="".concat(We(e.highlight),"")),typeof e.underline=="object"&&e.underline.color&&(i+="".concat(Wt(e.underline.color),"")),e.glow&&(i+="".concat(wm(e.glow,mm),"")),e.fontFace&&(i+=''))),e.hyperlink){if(typeof e.hyperlink!="object")throw new Error("ERROR: text `hyperlink` option should be an object. Ex: `hyperlink:{url:'https://github.com'}` ");if(!e.hyperlink.url&&!e.hyperlink.slide)throw new Error("ERROR: 'hyperlink requires either `url` or `slide`'");e.hyperlink.url?i+='":"/>"):e.hyperlink.slide&&(i+='":"/>")),e.color&&(i+=" ",i+=' ',i+=' ',i+=" ",i+=" ",i+="")}return i+=""),i}function Nm(e){return e.text?"".concat(AA(e.options,!1),"").concat(Oe(e.text),""):""}function Fm(e){var r="":e.options.fit==="resize"&&(r+="")),e.options.shrinkText&&(r+=""),r+=e.options._bodyProp.autoFit?"":"",r+=""):(r+=' wrap="square" rtlCol="0">',r+=""),e._type===Ie.tablecell?"":r}function dA(e){var r=e.options||{},n=[],i=[];if(r&&e._type!==Ie.tablecell&&(typeof e.text>"u"||e.text===null))return"";var o=e._type===Ie.tablecell?"":"";o+=Fm(e),r.h===0&&r.line&&r.align?o+='':e._type==="placeholder"?o+="".concat(uA(e,!0),""):o+="",typeof e.text=="string"||typeof e.text=="number"?n.push({text:e.text.toString(),options:r||{}}):e.text&&!Array.isArray(e.text)&&typeof e.text=="object"&&Object.keys(e.text).includes("text")?n.push({text:e.text||"",options:e.options||{}}):Array.isArray(e.text)&&(n=e.text.map(function(f){return{text:f.text,options:f.options}})),n.forEach(function(f,d){f.text||(f.text=""),f.options=f.options||r||{},d===0&&f.options&&!f.options.bullet&&r.bullet&&(f.options.bullet=r.bullet),(typeof f.text=="string"||typeof f.text=="number")&&(f.text=f.text.toString().replace(/\r*\n/g,vt)),f.text.includes(vt)&&f.text.match(/\n$/g)===null?f.text.split(vt).forEach(function(l){f.options.breakLine=!0,i.push({text:l,options:f.options})}):i.push(f)});var c=[],u=[];return i.forEach(function(f,d){u.length>0&&(f.options.align||r.align)?f.options.align!==i[d-1].options.align&&(c.push(u),u=[]):u.length>0&&f.options.bullet&&u.length>0&&(c.push(u),u=[],f.options.breakLine=!1),u.push(f),u.length>0&&f.options.breakLine&&d+1";var h="0&&g.options.softBreakBefore&&(o+=""),g.options.align=g.options.align||r.align,g.options.lineSpacing=g.options.lineSpacing||r.lineSpacing,g.options.lineSpacingMultiple=g.options.lineSpacingMultiple||r.lineSpacingMultiple,g.options.indentLevel=g.options.indentLevel||r.indentLevel,g.options.paraSpaceBefore=g.options.paraSpaceBefore||r.paraSpaceBefore,g.options.paraSpaceAfter=g.options.paraSpaceAfter||r.paraSpaceAfter,h=uA(g,!1),o+=h.replace("",""),Object.entries(r).filter(function(v){var b=v[0];return v[1],!(g.options.hyperlink&&b==="color")}).forEach(function(v){var b=v[0],y=v[1];b!=="bullet"&&!g.options[b]&&(g.options[b]=y)}),o+=Nm(g),(!g.text&&r.fontSize||g.options.fontSize)&&(l=!0,r.fontSize=r.fontSize||g.options.fontSize)}),e._type===Ie.tablecell&&(r.fontSize||r.fontFace)?r.fontFace?(o+='',o+=''),o+=''),o+=''),o+=""):o+='':l?o+='':o+=''),o+=""}),o+=e._type===Ie.tablecell?"":"",o}function co(e){var r,n;if(!e)return"";var i=!((r=e.options)===null||r===void 0)&&r._placeholderIdx?e.options._placeholderIdx:"",o=!((n=e.options)===null||n===void 0)&&n._placeholderType?e.options._placeholderType:"",c=o&&Ha[o]?Ha[o].toString():"";return`0?' hasCustomPrompt="1"':"",` />`)}function Im(e,r,n){var i=''+vt;return i+='',i+='',i+='',i+='',i+='',i+='',i+='',i+='',i+='',i+='',e.forEach(function(o){(o._relsMedia||[]).forEach(function(c){c.type!=="image"&&c.type!=="online"&&c.type!=="chart"&&c.extn!=="m4v"&&!i.includes(c.type)&&(i+='')})}),i+='',i+='',i+='',i+='',e.forEach(function(o,c){i+=''),i+=''),o._relsChart.forEach(function(u){i+='')})}),i+='',i+='',i+='',i+='',r.forEach(function(o,c){i+=''),(o._relsChart||[]).forEach(function(u){i+=' '})}),e.forEach(function(o,c){i+='')}),n._relsChart.forEach(function(o){i+=' '}),n._relsMedia.forEach(function(o){o.type!=="image"&&o.type!=="online"&&o.type!=="chart"&&o.extn!=="m4v"&&!i.includes(o.type)&&(i+=' ')}),i+=' ',i+=' ',i+="",i}function Om(){return''.concat(vt,` `)}function Mm(e,r){return''.concat(vt,` 0 0 Microsoft Office PowerPoint On-screen Show (16:9) 0 `).concat(e.length,` `).concat(e.length,` 0 0 false Fonts Used 2 Theme 1 Slide Titles `).concat(e.length,` Arial Calibri Office Theme `).concat(e.map(function(n,i){return"Slide ".concat(i+1,"")}).join(""),` `).concat(r,` false false false 16.0000 `)}function zm(e,r,n,i){return` `.concat(Oe(e),` `).concat(Oe(r),` `).concat(Oe(n),` `).concat(Oe(n),` `).concat(i,` `).concat(new Date().toISOString().replace(/\.\d\d\dZ/,"Z"),` `).concat(new Date().toISOString().replace(/\.\d\d\dZ/,"Z"),` `)}function Um(e){var r=1,n=''+vt;n+='',n+='';for(var i=1;i<=e.length;i++)n+='');return r++,n+='')+'')+'')+'')+'')+"",n}function jm(e){return''.concat(vt)+'")+"".concat(ll(e))+""}function Xm(e){var r="";return e._slideObjects.forEach(function(n){n._type===Ie.notes&&(r+=n!=null&&n.text&&n.text[0]?n.text[0].text:"")}),r.replace(/\r*\n/g,vt)}function Gm(){return''.concat(vt,'7/23/19Click to edit Master text stylesSecond levelThird levelFourth levelFifth level‹#›')}function Qm(e){return''.concat(vt,'').concat(Oe(Xm(e)),'').concat(e._slideNum,'')}function Wm(e){return` `.concat(ll(e),` `)}function Vm(e,r){var n=r.map(function(o,c){return'')}),i=''+vt;return i+='',i+=ll(e),i+='',i+=""+n.join("")+"",i+='',i+=' ',i+="",i}function Hm(e,r){return cl(r[e-1],[{target:"../slideMasters/slideMaster1.xml",type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster"}])}function qm(e,r,n){return cl(e[n-1],[{target:"../slideLayouts/slideLayout".concat(Zm(e,r,n),".xml"),type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"},{target:"../notesSlides/notesSlide".concat(n,".xml"),type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide"}])}function Jm(e){return` `)}function Ym(e,r){var n=r.map(function(i,o){return{target:"../slideLayouts/slideLayout".concat(o+1,".xml"),type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"}});return n.push({target:"../theme/theme1.xml",type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"}),cl(e,n)}function Km(){return''.concat(vt,` `)}function Zm(e,r,n){for(var i=0;i'):'',u=!((i=e.theme)===null||i===void 0)&&i.bodyFontFace?''):'';return''.concat(c,'').concat(u,'')}function ev(e){var r=''.concat(vt)+'');r+='',r+="",e.slides.forEach(function(i){return r+='')}),r+="",r+=''),r+=''),r+=''),r+="";for(var n=1;n<10;n++)r+="')+''+"");return r+="",e.sections&&e.sections.length>0&&(r+='',r+='',e.sections.forEach(function(i){r+=''),i._slides.forEach(function(o){return r+='')}),r+=""}),r+="",r+='',r+=""),r+="",r}function tv(){return''.concat(vt,'')}function rv(){return''.concat(vt,'')}function nv(){return''.concat(vt,'')}var av="3.12.0",iv=(function(){function e(){var r=this;this._version=av,this._alignH=Ks,this._alignV=Zs,this._chartType=Js,this._outputType=qs,this._schemeColor=Qt,this._shapeType=Ys,this._charts=Ae,this._colors=$s,this._shapes=Xr,this.addNewSlide=function(u){var f=r.sections.length>0&&r.sections[r.sections.length-1]._slides.filter(function(d){return d._slideNum===r.slides[r.slides.length-1]._slideNum}).length>0;return u.sectionTitle=f?r.sections[r.sections.length-1].title:null,r.addSlide(u)},this.getSlide=function(u){return r.slides.filter(function(f){return f._slideNum===u})[0]},this.setSlideNumber=function(u){r.masterSlide._slideNumberProps=u,r.slideLayouts.filter(function(f){return f._name===Vs})[0]._slideNumberProps=u},this.createChartMediaRels=function(u,f,d){u._relsChart.forEach(function(l){return d.push(Bm(l,f))}),u._relsMedia.forEach(function(l){if(l.type!=="online"&&l.type!=="hyperlink"){var h=l.data&&typeof l.data=="string"?l.data:"";!h.includes(",")&&!h.includes(";")?h="image/png;base64,"+h:h.includes(",")?h.includes(";")||(h="image/png;"+h):h="image/png;base64,"+h,f.file(l.Target.replace("..","ppt"),h.split(",").pop(),{base64:!0})}})},this.writeFileToBrowser=function(u,f){return yr(r,void 0,void 0,function(){var d,l;return wr(this,function(h){switch(h.label){case 0:return d=document.createElement("a"),d.setAttribute("style","display:none;"),d.dataset.interception="off",document.body.appendChild(d),window.URL.createObjectURL?(l=window.URL.createObjectURL(new Blob([f],{type:"application/vnd.openxmlformats-officedocument.presentationml.presentation"})),d.href=l,d.download=u,d.click(),setTimeout(function(){window.URL.revokeObjectURL(l),document.body.removeChild(d)},100),[4,Promise.resolve(u)]):[3,2];case 1:return[2,h.sent()];case 2:return[2]}})})},this.exportPresentation=function(u){return yr(r,void 0,void 0,function(){var f,d,l,h=this;return wr(this,function(g){switch(g.label){case 0:return f=[],d=[],l=new Zu,this.slides.forEach(function(w){d=d.concat(sl(w))}),this.slideLayouts.forEach(function(w){d=d.concat(sl(w))}),d=d.concat(sl(this.masterSlide)),[4,Promise.all(d).then(function(){return yr(h,void 0,void 0,function(){var w=this;return wr(this,function(v){switch(v.label){case 0:return this.slides.forEach(function(b){b._slideLayout&&Pm(b)}),l.folder("_rels"),l.folder("docProps"),l.folder("ppt").folder("_rels"),l.folder("ppt/charts").folder("_rels"),l.folder("ppt/embeddings"),l.folder("ppt/media"),l.folder("ppt/slideLayouts").folder("_rels"),l.folder("ppt/slideMasters").folder("_rels"),l.folder("ppt/slides").folder("_rels"),l.folder("ppt/theme"),l.folder("ppt/notesMasters").folder("_rels"),l.folder("ppt/notesSlides").folder("_rels"),l.file("[Content_Types].xml",Im(this.slides,this.slideLayouts,this.masterSlide)),l.file("_rels/.rels",Om()),l.file("docProps/app.xml",Mm(this.slides,this.company)),l.file("docProps/core.xml",zm(this.title,this.subject,this.author,this.revision)),l.file("ppt/_rels/presentation.xml.rels",Um(this.slides)),l.file("ppt/theme/theme1.xml",$m(this)),l.file("ppt/presentation.xml",ev(this)),l.file("ppt/presProps.xml",tv()),l.file("ppt/tableStyles.xml",rv()),l.file("ppt/viewProps.xml",nv()),this.slideLayouts.forEach(function(b,y){l.file("ppt/slideLayouts/slideLayout".concat(y+1,".xml"),Wm(b)),l.file("ppt/slideLayouts/_rels/slideLayout".concat(y+1,".xml.rels"),Hm(y+1,w.slideLayouts))}),this.slides.forEach(function(b,y){l.file("ppt/slides/slide".concat(y+1,".xml"),jm(b)),l.file("ppt/slides/_rels/slide".concat(y+1,".xml.rels"),qm(w.slides,w.slideLayouts,y+1)),l.file("ppt/notesSlides/notesSlide".concat(y+1,".xml"),Qm(b)),l.file("ppt/notesSlides/_rels/notesSlide".concat(y+1,".xml.rels"),Jm(y+1))}),l.file("ppt/slideMasters/slideMaster1.xml",Vm(this.masterSlide,this.slideLayouts)),l.file("ppt/slideMasters/_rels/slideMaster1.xml.rels",Ym(this.masterSlide,this.slideLayouts)),l.file("ppt/notesMasters/notesMaster1.xml",Gm()),l.file("ppt/notesMasters/_rels/notesMaster1.xml.rels",Km()),this.slideLayouts.forEach(function(b){w.createChartMediaRels(b,l,f)}),this.slides.forEach(function(b){w.createChartMediaRels(b,l,f)}),this.createChartMediaRels(this.masterSlide,l,f),[4,Promise.all(f).then(function(){return yr(w,void 0,void 0,function(){return wr(this,function(b){switch(b.label){case 0:return u.outputType!=="STREAM"?[3,2]:[4,l.generateAsync({type:"nodebuffer",compression:u.compression?"DEFLATE":"STORE"})];case 1:return[2,b.sent()];case 2:return u.outputType?[4,l.generateAsync({type:u.outputType})]:[3,4];case 3:return[2,b.sent()];case 4:return[4,l.generateAsync({type:"blob",compression:u.compression?"DEFLATE":"STORE"})];case 5:return[2,b.sent()]}})})})];case 1:return[2,v.sent()]}})})})];case 1:return[2,g.sent()]}})})};var n={name:"screen4x3",width:9144e3,height:6858e3},i={name:"screen16x9",width:9144e3,height:5143500},o={name:"screen16x10",width:9144e3,height:5715e3},c={name:"custom",width:12192e3,height:6858e3};this.LAYOUTS={LAYOUT_4x3:n,LAYOUT_16x9:i,LAYOUT_16x10:o,LAYOUT_WIDE:c},this._author="PptxGenJS",this._company="PptxGenJS",this._revision="1",this._subject="PptxGenJS Presentation",this._title="PptxGenJS Presentation",this._presLayout={name:this.LAYOUTS[$n].name,_sizeW:this.LAYOUTS[$n].width,_sizeH:this.LAYOUTS[$n].height,width:this.LAYOUTS[$n].width,height:this.LAYOUTS[$n].height},this._rtlMode=!1,this._slideLayouts=[{_margin:Ga,_name:Vs,_presLayout:this._presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slide:null,_slideNum:1e3,_slideNumberProps:null,_slideObjects:[]}],this._slides=[],this._sections=[],this._masterSlide={addChart:null,addImage:null,addMedia:null,addNotes:null,addShape:null,addTable:null,addText:null,_name:null,_presLayout:this._presLayout,_rId:null,_rels:[],_relsChart:[],_relsMedia:[],_slideId:null,_slideLayout:null,_slideNum:null,_slideNumberProps:null,_slideObjects:[]}}return Object.defineProperty(e.prototype,"layout",{get:function(){return this._layout},set:function(r){var n=this.LAYOUTS[r];if(n)this._layout=r,this._presLayout=n;else throw new Error("UNKNOWN-LAYOUT")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"author",{get:function(){return this._author},set:function(r){this._author=r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"company",{get:function(){return this._company},set:function(r){this._company=r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"revision",{get:function(){return this._revision},set:function(r){this._revision=r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subject",{get:function(){return this._subject},set:function(r){this._subject=r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"theme",{get:function(){return this._theme},set:function(r){this._theme=r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this._title},set:function(r){this._title=r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtlMode",{get:function(){return this._rtlMode},set:function(r){this._rtlMode=r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"masterSlide",{get:function(){return this._masterSlide},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"slides",{get:function(){return this._slides},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sections",{get:function(){return this._sections},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"slideLayouts",{get:function(){return this._slideLayouts},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"AlignH",{get:function(){return this._alignH},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"AlignV",{get:function(){return this._alignV},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ChartType",{get:function(){return this._chartType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OutputType",{get:function(){return this._outputType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"presLayout",{get:function(){return this._presLayout},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SchemeColor",{get:function(){return this._schemeColor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ShapeType",{get:function(){return this._shapeType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"charts",{get:function(){return this._charts},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"colors",{get:function(){return this._colors},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shapes",{get:function(){return this._shapes},enumerable:!1,configurable:!0}),e.prototype.stream=function(r){return yr(this,void 0,void 0,function(){return wr(this,function(n){switch(n.label){case 0:return[4,this.exportPresentation({compression:r==null?void 0:r.compression,outputType:"STREAM"})];case 1:return[2,n.sent()]}})})},e.prototype.write=function(r){return yr(this,void 0,void 0,function(){var n,i;return wr(this,function(o){switch(o.label){case 0:return n=typeof r=="object"&&(r!=null&&r.outputType)?r.outputType:r||null,i=typeof r=="object"&&(r!=null&&r.compression)?r.compression:!1,[4,this.exportPresentation({compression:i,outputType:n})];case 1:return[2,o.sent()]}})})},e.prototype.writeFile=function(r){return yr(this,void 0,void 0,function(){var n,i,o,c,u=this;return wr(this,function(f){switch(f.label){case 0:return n=typeof require<"u"&&typeof window>"u"?require("fs"):null,typeof r=="string"&&console.log("Warning: `writeFile(filename)` is deprecated - please use `WriteFileProps` argument (v3.5.0)"),i=typeof r=="object"&&(r!=null&&r.fileName)?r.fileName:typeof r=="string"?r:"",o=typeof r=="object"&&(r!=null&&r.compression)?r.compression:!1,c=i?i.toString().toLowerCase().endsWith(".pptx")?i:i+".pptx":"Presentation.pptx",[4,this.exportPresentation({compression:o,outputType:n?"nodebuffer":null}).then(function(d){return yr(u,void 0,void 0,function(){return wr(this,function(l){switch(l.label){case 0:return n?[4,new Promise(function(h,g){n.writeFile(c,d,function(w){w?g(w):h(c)})})]:[3,2];case 1:return[2,l.sent()];case 2:return[4,this.writeFileToBrowser(c,d)];case 3:return[2,l.sent()]}})})})];case 1:return[2,f.sent()]}})})},e.prototype.addSection=function(r){r?r.title||console.warn("addSection requires a title"):console.warn("addSection requires an argument");var n={_type:"user",_slides:[],title:r.title};r.order?this.sections.splice(r.order,0,n):this._sections.push(n)},e.prototype.addSlide=function(r){var n=typeof r=="string"?r:r!=null&&r.masterName?r.masterName:"",i={_name:this.LAYOUTS[$n].name,_presLayout:this.presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slideNum:this.slides.length+1};if(n){var o=this.slideLayouts.filter(function(d){return d._name===n})[0];o&&(i=o)}var c=new _m({addSlide:this.addNewSlide,getSlide:this.getSlide,presLayout:this.presLayout,setSlideNum:this.setSlideNumber,slideId:this.slides.length+256,slideRId:this.slides.length+2,slideNumber:this.slides.length+1,slideLayout:i});if(this._slides.push(c),r!=null&&r.sectionTitle){var u=this.sections.filter(function(d){return d.title===r.sectionTitle})[0];u?u._slides.push(c):console.warn('addSlide: unable to find section with title: "'.concat(r.sectionTitle,'"'))}else if(this.sections&&this.sections.length>0&&!(r!=null&&r.sectionTitle)){var f=this._sections[this.sections.length-1];f._type==="default"?f._slides.push(c):this._sections.push({title:"Default-".concat(this.sections.filter(function(d){return d._type==="default"}).length+1),_type:"default",_slides:[c]})}return c},e.prototype.defineLayout=function(r){r?r.name?r.width?r.height?typeof r.height!="number"?console.warn("defineLayout `height` should be a number (inches)"):typeof r.width!="number"&&console.warn("defineLayout `width` should be a number (inches)"):console.warn("defineLayout requires `height`"):console.warn("defineLayout requires `width`"):console.warn("defineLayout requires `name`"):console.warn("defineLayout requires `{name, width, height}`"),this.LAYOUTS[r.name]={name:r.name,_sizeW:Math.round(Number(r.width)*Fe),_sizeH:Math.round(Number(r.height)*Fe),width:Math.round(Number(r.width)*Fe),height:Math.round(Number(r.height)*Fe)}},e.prototype.defineSlideMaster=function(r){if(!r.title)throw new Error("defineSlideMaster() object argument requires a `title` value. (https://gitbrent.github.io/PptxGenJS/docs/masters.html)");var n={_margin:r.margin||Ga,_name:r.title,_presLayout:this.presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slide:null,_slideNum:1e3+this.slideLayouts.length+1,_slideNumberProps:r.slideNumber||null,_slideObjects:[],background:r.background||null,bkgd:r.bkgd||null};km(r,n),this.slideLayouts.push(n),(r.background||r.bkgd)&&sA(r.background,n),n._slideNumberProps&&!this.masterSlide._slideNumberProps&&(this.masterSlide._slideNumberProps=n._slideNumberProps)},e.prototype.tableToSlides=function(r,n){n===void 0&&(n={}),Cm(this,r,n,n!=null&&n.masterSlideName?this.slideLayouts.filter(function(i){return i._name===n.masterSlideName})[0]:null)},e})();const Ke={harmonyBlue:"7572FF",deepNoir:"1A1A29",grey800:"56557E",grey500:"D2D1E8",grey200:"E2E2EA",grey100:"EFEFEF",white:"FFFFFF"},ov="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACXsAAAFICAYAAAALE79NAAAACXBIWXMAAC4jAAAuIwF4pT92AAAgAElEQVR4nOzdz3XbyLb+/ef2OnP6T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HNDLp2ob3V3sWr7vLA2rCd7OxfScrbm+wA/s9N9P3dLwl4AAAAAAAAAAIxA7OQx0d1I4W2I2OpA9yb+s9HdqFgO6AAAMLZz0WiiH58bJkoXIN926ZLuuuQ14sITANDZCwAAAAAAAACAsbt3y33336W7A97naH7yP3NACwBAAe51gXqoC/VTtkHvXYS+AWAP/w/0Ky7mXP8FtQAAAABJRU5ErkJggg==";function sv(e){const{calculatorSlug:r,headlineLabel:n,headlineValue:i,metrics:o=[],benchmarkData:c,industry:u,companySizeBand:f}=e,d=new iv;d.layout="LAYOUT_WIDE",d.defineFontFace&&d.defineFontFace("Poppins",[]);const l=d.addSlide();l.background={color:Ke.white},l.addImage({data:ov,x:.4,y:.25,w:1.6,h:.45});const h=new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});l.addText(`Generated ${h}`,{x:9.5,y:.25,w:3.43,h:.3,fontSize:10,color:Ke.grey800,align:"right",fontFace:"Arial"}),l.addShape(d.ShapeType.rect,{x:.4,y:.8,w:12.53,h:.03,fill:{color:Ke.harmonyBlue},line:{color:Ke.harmonyBlue}}),l.addText(n,{x:.4,y:1,w:12.53,h:.4,fontSize:13,color:Ke.grey800,align:"center",fontFace:"Arial"}),l.addText(i,{x:.4,y:1.35,w:12.53,h:.85,fontSize:52,bold:!0,color:Ke.deepNoir,align:"center",fontFace:"Arial"});const g=3.6,w=1.35,v=2.35,b=.37,y=(13.33-(o.length*g+(o.length-1)*b))/2;if(o.slice(0,3).forEach((k,C)=>{const E=y+C*(g+b);l.addShape(d.ShapeType.rect,{x:E,y:v,w:g,h:w,fill:{color:Ke.grey100},line:{color:Ke.grey200,pt:1}}),l.addShape(d.ShapeType.rect,{x:E,y:v,w:g,h:.05,fill:{color:Ke.harmonyBlue},line:{color:Ke.harmonyBlue}}),l.addText(k.value,{x:E+.15,y:v+.15,w:g-.3,h:.5,fontSize:26,bold:!0,color:Ke.deepNoir,align:"center",fontFace:"Arial"}),l.addText(k.label,{x:E+.15,y:v+.65,w:g-.3,h:.3,fontSize:11,color:Ke.grey800,align:"center",fontFace:"Arial"}),k.sublabel&&l.addText(k.sublabel,{x:E+.15,y:v+.95,w:g-.3,h:.28,fontSize:9,color:Ke.grey800,align:"center",italic:!0,fontFace:"Arial"})}),c){const{userValue:k,p25:C,p50:E,p75:_,label:N="vs. Industry Benchmarks",unit:I=""}=c,G=3.95,M=1,O=11.33,z=.35;l.addText(N,{x:M,y:G-.35,w:O,h:.3,fontSize:11,bold:!0,color:Ke.grey800,fontFace:"Arial"});const Y=[k,C,E,_].filter(W=>W!=null),me=Math.min(...Y)*.9,J=Math.max(...Y)*1.1-me||1,S=W=>M+(W-me)/J*O;l.addShape(d.ShapeType.rect,{x:M,y:G+.1,w:O,h:z*.4,fill:{color:Ke.grey200},line:{color:Ke.grey200}});const ee=S(C),Ce=S(_)-S(C);l.addShape(d.ShapeType.rect,{x:ee,y:G+.1,w:Ce,h:z*.4,fill:{color:Ke.grey500},line:{color:Ke.grey500}}),l.addShape(d.ShapeType.rect,{x:S(E)-.01,y:G+.05,w:.03,h:z*.55,fill:{color:Ke.grey800},line:{color:Ke.grey800}}),l.addShape(d.ShapeType.ellipse,{x:S(k)-.1,y:G+.03,w:.2,h:.2+z*.3,fill:{color:Ke.harmonyBlue},line:{color:Ke.harmonyBlue}});const ie=G+z+.05;[{v:C,text:`P25 ${uo(C,I)}`},{v:E,text:`P50 ${uo(E,I)}`},{v:_,text:`P75 ${uo(_,I)}`}].forEach(({v:W,text:V})=>{l.addText(V,{x:S(W)-.3,y:ie,w:.6,h:.45,fontSize:8,color:Ke.grey800,align:"center",fontFace:"Arial"})}),l.addText(`Your Value ${uo(k,I)}`,{x:S(k)-.35,y:G-.55,w:.7,h:.45,fontSize:8,bold:!0,color:Ke.harmonyBlue,align:"center",fontFace:"Arial"}),l.addText(`Industry: ${u} · Company Size: ${f} employees`,{x:M,y:ie+.5,w:O,h:.25,fontSize:9,color:Ke.grey800,italic:!0,fontFace:"Arial"})}l.addShape(d.ShapeType.rect,{x:.4,y:7.1,w:12.53,h:.03,fill:{color:Ke.grey200},line:{color:Ke.grey200}}),l.addText("Source: HRBench 2026 Benchmark Data",{x:.4,y:7.15,w:6,h:.25,fontSize:8,color:Ke.grey800,fontFace:"Arial"}),l.addText(`hrbench.com/resources/tools/${r}`,{x:6.93,y:7.15,w:6,h:.25,fontSize:8,color:Ke.grey800,align:"right",fontFace:"Arial"}),d.writeFile({fileName:`${r}-results.pptx`})}function uo(e,r){return r==="currency"?`$${Number(e).toLocaleString()}`:r==="percentage"?`${Number(e).toFixed(1)}%`:r==="days"?`${Number(e).toFixed(1)}d`:String(e)}const lv="08719f63-05c4-4e57-8bc1-e6a06c94ed8a",cv=["Banking","Biotechnology","Business Services","Construction","Construction & Engineering","Consumer Services","Education","Energy","Financial Services","Financial Technology","Food, Beverage, Health and Nutrition","Health & Wellness","Healthcare","Healthcare Equipment","Healthcare Services","Hospitality","Insurance","Insurance Agencies","Life Sciences","Machinery","Manufacturing","Media","Non-Profit","Professional Services","Real Estate Investment Trusts (REITs)","Retail","Software as a Service","Technology","Transportation","Utilities","Other"],uv=[{value:"50-100",label:"50–100 employees"},{value:"100-200",label:"100–200 employees"},{value:"200-500",label:"200–500 employees"},{value:"500-1000",label:"500–1,000 employees"},{value:"1000-3000",label:"1,000–3,000 employees"},{value:"3000-7500",label:"3,000–7,500 employees"}];function Av({headcount:e,avgSalary:r,turnoverRate:n,recruitingCost:i,timeToFill:o,rampUpDays:c,trainingPct:u}){const f=r/260,d=i>0?i:r*.3,l=o>0?o:42,h=c>0?c:90,g=u>0?u:10,w=f*l*.5,v=f*h*.25,b=r*(g/100),y=d+w+v+b,k=e*(n/100),C=k*y,E=e*r,_=E>0?C/E*100:0;return{annualCost:C,departures:k,costPerDeparture:y,payrollPct:_,breakdown:{recruiting:d,lostProductivity:w,rampUp:v,training:b},effectiveInputs:{recruitingCost:d,timeToFill:l,rampUpDays:h,trainingPct:g},turnoverRate:n,headcount:e,avgSalary:r}}function Zt(e){return e>=1e6?`$${(e/1e6).toFixed(1)}M`:e>=1e3?`$${(e/1e3).toFixed(0)}K`:`$${Math.round(e).toLocaleString()}`}function dv(e){return`$${Math.round(e).toLocaleString()}`}function fA(e){return Math.round(e).toLocaleString()}function fv({headcount:e,avgSalary:r,turnoverRate:n,industry:i,companySizeBand:o}){const c={};return(!e||isNaN(e)||Number(e)<=0)&&(c.headcount="Enter a valid headcount"),(!r||isNaN(r)||Number(r)<=0)&&(c.avgSalary="Enter a valid salary"),(!n||isNaN(n)||Number(n)<=0||Number(n)>100)&&(c.turnoverRate="Enter a rate between 0 and 100"),i||(c.industry="Select an industry"),o||(c.companySizeBand="Select a company size"),c}function hv(e,r,n){const{p25:i,p50:o,p75:c}=r,u=Number(e).toFixed(1);return e>c?`Your ${u}% turnover rate is above the 75th percentile for ${n}. You're likely spending significantly more on replacement than your peers, making this a high-priority area.`:e>o?`Your ${u}% turnover rate is above the industry median for ${n}, but within the typical range. Targeted retention programs could meaningfully reduce your costs.`:e>i?`Your ${u}% turnover rate is below the industry median for ${n} — you're managing retention better than most peers.`:`Your ${u}% turnover rate is in the top quartile for retention in ${n}. Strong performance — keep reinforcing what's working.`}const hA={recruiting:"#7572FF",lostProductivity:"#FF6F57",rampUp:"#FADB8C",training:"#D2D1E8"},pv={recruiting:"Recruiting & Hiring",lostProductivity:"Lost Productivity",rampUp:"Ramp-Up Cost",training:"Training"};function gv({breakdown:e}){const r=Object.values(e).reduce((n,i)=>n+i,0);return r?oe.jsxs("div",{style:{marginTop:28},children:[oe.jsx("div",{style:{fontSize:13,fontWeight:700,color:"#1A1A29",fontFamily:"'Poppins', Arial, sans-serif",marginBottom:14},children:"Cost Breakdown per Departure"}),oe.jsx("div",{style:{display:"flex",height:12,borderRadius:6,overflow:"hidden",marginBottom:16},children:Object.entries(e).map(([n,i])=>oe.jsx("div",{style:{width:`${i/r*100}%`,backgroundColor:hA[n],transition:"width 0.4s ease"}},n))}),oe.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Object.entries(e).map(([n,i])=>{const o=(i/r*100).toFixed(0);return oe.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[oe.jsx("div",{style:{width:10,height:10,borderRadius:2,backgroundColor:hA[n],flexShrink:0}}),oe.jsx("div",{style:{flex:1,fontSize:12,color:"#56557E",fontFamily:"'Poppins', Arial, sans-serif"},children:pv[n]}),oe.jsxs("div",{style:{fontSize:12,fontWeight:600,color:"#1A1A29",fontFamily:"'Poppins', Arial, sans-serif"},children:[dv(i)," (",o,"%)"]})]},n)})})]}):null}function mv(){const[e,r]=it.useState(""),[n,i]=it.useState(""),[o,c]=it.useState(""),[u,f]=it.useState(""),[d,l]=it.useState(""),[h,g]=it.useState(!1),[w,v]=it.useState(""),[b,y]=it.useState(""),[k,C]=it.useState(""),[E,_]=it.useState(""),[N,I]=it.useState({}),[G,M]=it.useState("input"),[O,z]=it.useState(null),[Y,me]=it.useState(null),[F,J]=it.useState(null),[S,ee]=it.useState(!1),Ce=n?Math.round(Number(n)*.3).toLocaleString():"—",ie=it.useCallback(()=>{const ye=fv({headcount:e,avgSalary:n,turnoverRate:o,industry:u,companySizeBand:d});if(I(ye),Object.keys(ye).length)return;const Pe=Av({headcount:Number(e),avgSalary:Number(n),turnoverRate:Number(o),recruitingCost:Number(w)||0,timeToFill:Number(b)||0,rampUpDays:Number(k)||0,trainingPct:Number(E)||0});z(Pe),M("results"),setTimeout(()=>{var ge;(ge=document.getElementById("hrbench-cost-of-turnover-calculator"))==null||ge.scrollIntoView({behavior:"smooth",block:"start"})},100)},[e,n,o,u,d,w,b,k,E]),W=it.useCallback(async()=>{J(null);try{let re=null;try{re=await Yu("workforce_benchmarks.turnover_rate",u,d)}catch{re=await Yu("workforce_benchmarks.turnover_rate","All","All")}me(re)}catch(re){J("Benchmark data unavailable for this segment."),console.warn("[HRBench] Benchmark fetch error:",re.message)}M("gated")},[u,d]),V=it.useCallback(()=>O?{calculator_type:"cost_of_turnover",calculator_headline_result:Zt(O.annualCost),calculator_results_json:JSON.stringify({annualCost:O.annualCost,departures:O.departures,costPerDeparture:O.costPerDeparture,payrollPct:O.payrollPct,turnoverRate:O.turnoverRate,breakdown:O.breakdown}),calculator_industry:u,calculator_company_size:d}:{},[O,u,d]),ae=it.useCallback(async()=>{if(O){ee(!0);try{sv({calculatorName:"Cost of Turnover Calculator",calculatorSlug:"cost-of-turnover-calculator",headlineLabel:"Your Estimated Annual Cost of Turnover",headlineValue:Zt(O.annualCost),metrics:[{label:"Annual Departures",value:fA(O.departures),sublabel:`at ${O.turnoverRate}% turnover rate`},{label:"Cost per Departure",value:Zt(O.costPerDeparture),sublabel:"Recruiting + productivity + ramp + training"},{label:"Cost as % of Payroll",value:`${O.payrollPct.toFixed(1)}%`,sublabel:`of $${Math.round(O.headcount*O.avgSalary/1e6*10)/10}M total payroll`}],benchmarkData:Y?{userValue:O.turnoverRate,p25:Y.p25,p50:Y.p50,p75:Y.p75,label:"Voluntary Turnover Rate",unit:"percentage"}:null,industry:u,companySizeBand:d})}finally{ee(!1)}}},[O,Y,u,d]),P=()=>{M("input"),z(null),me(null),J(null)};let T=null,Z=null,se=null;if(O&&Y){const ye=O.headcount*(Y.p50/100)*O.costPerDeparture,Pe=O.annualCost-ye,ge=O.annualCost*3,ve=ye*3;T={medianAnnualCost:ye,savings:Pe,medianRate:Y.p50},Z={threeYearCurrent:ge,threeYearMedian:ve,savings3yr:ge-ve},se=hv(O.turnoverRate,Y,u)}return oe.jsxs("div",{style:{fontFamily:"'Poppins', Arial, sans-serif",maxWidth:720,margin:"0 auto",padding:"0 16px 48px"},children:[oe.jsx("style",{children:`@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap'); @keyframes hrbench-spin { to { transform: rotate(360deg); } } #hrbench-cost-of-turnover-calculator * { box-sizing: border-box; } #hrbench-cost-of-turnover-calculator .hs-form input, #hrbench-cost-of-turnover-calculator .hs-form select { border: 1.5px solid #E2E2EA !important; border-radius: 8px !important; font-family: 'Poppins', Arial, sans-serif !important; font-size: 14px !important; height: 40px !important; padding: 0 12px !important; } #hrbench-cost-of-turnover-calculator .hs-form .hs-button { background-color: #7572FF !important; border: none !important; border-radius: 8px !important; font-family: 'Poppins', Arial, sans-serif !important; font-weight: 600 !important; cursor: pointer !important; } `}),oe.jsxs("div",{style:{marginBottom:32,paddingTop:8},children:[oe.jsx("h2",{style:{fontSize:26,fontWeight:700,color:"#1A1A29",margin:"0 0 8px",lineHeight:1.2},children:"Cost of Turnover Calculator"}),oe.jsx("p",{style:{fontSize:14,color:"#56557E",margin:0,lineHeight:1.6},children:"Estimate the true cost of employee turnover at your organization."})]}),G==="input"&&oe.jsxs("div",{children:[oe.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0 24px"},children:[oe.jsx(un,{label:"Number of Employees",value:e,onChange:r,placeholder:"e.g. 250",type:"number",helper:"Total number of employees",error:N.headcount}),oe.jsx(un,{label:"Average Annual Salary",value:n,onChange:i,placeholder:"e.g. 75000",type:"number",prefix:"$",helper:"Average salary across all roles",error:N.avgSalary})]}),oe.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0 24px"},children:[oe.jsx(un,{label:"Annual Voluntary Turnover Rate",value:o,onChange:c,placeholder:"e.g. 18",type:"number",helper:"Percentage of employees who leave voluntarily per year",error:N.turnoverRate}),oe.jsx(nu,{label:"Industry",value:u,onChange:f,options:cv,placeholder:"Select industry…",helper:N.industry})]}),oe.jsx(nu,{label:"Company Size",value:d,onChange:l,options:uv,placeholder:"Select company size…",helper:N.companySizeBand}),oe.jsxs("button",{onClick:()=>g(re=>!re),style:{background:"none",border:"none",padding:"4px 0 16px",cursor:"pointer",display:"flex",alignItems:"center",gap:6,fontSize:13,fontWeight:600,color:"#7572FF",fontFamily:"'Poppins', Arial, sans-serif"},children:[oe.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",style:{transition:"transform 0.2s",transform:h?"rotate(180deg)":"rotate(0deg)"},children:oe.jsx("path",{d:"M3 5l4 4 4-4",stroke:"#7572FF",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),h?"Hide advanced settings":"Customize cost assumptions"]}),h&&oe.jsxs("div",{style:{backgroundColor:"#EFEFEF",borderRadius:12,padding:"20px 20px 4px",marginBottom:20},children:[oe.jsx("div",{style:{fontSize:12,fontWeight:600,color:"#56557E",fontFamily:"'Poppins', Arial, sans-serif",marginBottom:16,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Advanced Assumptions"}),oe.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0 24px"},children:[oe.jsx(un,{label:"Avg Recruiting Cost per Hire",value:w,onChange:v,placeholder:`Default: $${Ce} (30% of salary)`,type:"number",prefix:"$",helper:"Total external + internal recruiting spend per hire"}),oe.jsx(un,{label:"Avg Time to Fill (days)",value:b,onChange:y,placeholder:"Default: 42 days",type:"number",helper:"Days from open req to accepted offer"})]}),oe.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0 24px"},children:[oe.jsx(un,{label:"Avg Ramp-Up Time (days)",value:k,onChange:C,placeholder:"Default: 90 days",type:"number",helper:"Days until new hire reaches full productivity"}),oe.jsx(un,{label:"Training Cost (% of salary)",value:E,onChange:_,placeholder:"Default: 10%",type:"number",helper:"Onboarding and training spend as % of salary"})]})]}),oe.jsx(uh,{onClick:ie,children:"Calculate My Turnover Cost"})]}),(G==="results"||G==="gated")&&O&&oe.jsxs("div",{children:[oe.jsxs("div",{style:{textAlign:"center",padding:"28px 0 24px",borderBottom:"1.5px solid #E2E2EA",marginBottom:28},children:[oe.jsx("div",{style:{fontSize:13,color:"#56557E",marginBottom:6,fontWeight:500},children:"Your Estimated Annual Cost of Turnover"}),oe.jsx("div",{style:{fontSize:56,fontWeight:700,color:"#1A1A29",lineHeight:1,letterSpacing:"-0.03em"},children:Zt(O.annualCost)})]}),oe.jsxs("div",{style:{display:"flex",gap:16,marginBottom:8},children:[oe.jsx(Ss,{value:fA(O.departures),label:"Annual Departures",sublabel:`at ${O.turnoverRate}% voluntary turnover`,accent:!0}),oe.jsx(Ss,{value:Zt(O.costPerDeparture),label:"Cost per Departure",sublabel:"Recruiting + productivity + ramp + training",accent:!0}),oe.jsx(Ss,{value:`${O.payrollPct.toFixed(1)}%`,label:"Cost as % of Payroll",sublabel:`${u} · ${d} employees`,accent:!0})]}),oe.jsx(ph,{formId:lv,unlocked:G==="gated",onUnlock:W,getHiddenFields:V,headline:"See How Your Turnover Compares to Similar Companies",body:"Get your personalized benchmark comparison, cost breakdown, and savings projection based on your industry and company size.",children:F?oe.jsx("div",{style:{fontSize:13,color:"#FF6F57",padding:"8px 0"},children:F}):Y?oe.jsxs(oe.Fragment,{children:[oe.jsx(gh,{userValue:O.turnoverRate,p25:Y.p25,p50:Y.p50,p75:Y.p75,label:"Voluntary Turnover Rate",unit:"percentage",industry:u,companySizeBand:d}),se&&oe.jsx("div",{style:{fontSize:13,color:"#56557E",fontFamily:"'Poppins', Arial, sans-serif",lineHeight:1.6,padding:"12px 16px",backgroundColor:"#FFFFFF",borderRadius:8,borderLeft:"3px solid #7572FF",marginTop:4,marginBottom:4},children:se}),oe.jsx(gv,{breakdown:O.breakdown}),T&&T.savings>0&&oe.jsxs("div",{style:{marginTop:28,padding:"20px 24px",backgroundColor:"#FFFFFF",borderRadius:12,border:"1.5px solid #E2E2EA"},children:[oe.jsx("div",{style:{fontSize:13,fontWeight:700,color:"#1A1A29",fontFamily:"'Poppins', Arial, sans-serif",marginBottom:8},children:"What if you hit the industry median?"}),oe.jsxs("div",{style:{fontSize:32,fontWeight:700,color:"#7572FF",fontFamily:"'Poppins', Arial, sans-serif",lineHeight:1.1,marginBottom:8},children:[Zt(T.savings)," saved annually"]}),oe.jsxs("div",{style:{fontSize:13,color:"#56557E",fontFamily:"'Poppins', Arial, sans-serif",lineHeight:1.6},children:["If your turnover rate dropped from ",O.turnoverRate,"% to the industry median of ",T.medianRate.toFixed(1),"%, you'd save approximately"," ",oe.jsx("strong",{style:{color:"#1A1A29"},children:Zt(T.savings)})," per year"," ","(reducing your annual cost from ",Zt(O.annualCost)," to ",Zt(T.medianAnnualCost),")."]})]}),Z&&oe.jsxs("div",{style:{marginTop:16,padding:"20px 24px",backgroundColor:"#FFFFFF",borderRadius:12,border:"1.5px solid #E2E2EA"},children:[oe.jsx("div",{style:{fontSize:13,fontWeight:700,color:"#1A1A29",fontFamily:"'Poppins', Arial, sans-serif",marginBottom:12},children:"3-Year Cost Projection"}),oe.jsxs("div",{style:{display:"flex",gap:16},children:[oe.jsxs("div",{style:{flex:1},children:[oe.jsxs("div",{style:{fontSize:11,fontWeight:600,color:"#56557E",fontFamily:"'Poppins', Arial, sans-serif",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:4},children:["At current ",O.turnoverRate,"%"]}),oe.jsx("div",{style:{fontSize:24,fontWeight:700,color:"#FF6F57",fontFamily:"'Poppins', Arial, sans-serif"},children:Zt(Z.threeYearCurrent)})]}),oe.jsx("div",{style:{width:1,backgroundColor:"#E2E2EA",flexShrink:0,margin:"4px 8px"}}),oe.jsxs("div",{style:{flex:1},children:[oe.jsxs("div",{style:{fontSize:11,fontWeight:600,color:"#56557E",fontFamily:"'Poppins', Arial, sans-serif",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:4},children:["At industry median ",Y.p50.toFixed(1),"%"]}),oe.jsx("div",{style:{fontSize:24,fontWeight:700,color:"#7572FF",fontFamily:"'Poppins', Arial, sans-serif"},children:Zt(Z.threeYearMedian)})]})]}),Z.savings3yr>0&&oe.jsxs("div",{style:{marginTop:12,fontSize:12,color:"#56557E",fontFamily:"'Poppins', Arial, sans-serif",lineHeight:1.5},children:["Hitting the median turnover rate could save your organization"," ",oe.jsx("strong",{style:{color:"#1A1A29"},children:Zt(Z.savings3yr)})," over 3 years."]})]}),oe.jsx("div",{style:{marginTop:24},children:oe.jsx(mh,{onClick:ae,loading:S,children:"Export as PowerPoint"})})]}):oe.jsx("div",{style:{fontSize:13,color:"#56557E",padding:"8px 0"},children:"Loading benchmarks…"})}),oe.jsx("button",{onClick:P,style:{marginTop:20,background:"none",border:"none",color:"#7572FF",fontSize:13,fontWeight:600,fontFamily:"'Poppins', Arial, sans-serif",cursor:"pointer",padding:0,textDecoration:"underline"},children:"← Recalculate"})]})]})}const pA="hrbench-cost-of-turnover-calculator";function gA(){const e=document.getElementById(pA);if(!e){console.warn(`[HRBench] Mount target #${pA} not found in DOM.`);return}ch.createRoot(e).render(oe.jsx(mv,{}))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",gA):gA()})();