var nxe=Object.defineProperty;var uH=e=>{throw TypeError(e)};var ixe=(e,t,r)=>t in e?nxe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Rr=(e,t,r)=>ixe(e,typeof t!="symbol"?t+"":t,r),FT=(e,t,r)=>t.has(e)||uH("Cannot "+r);var Ne=(e,t,r)=>(FT(e,t,"read from private field"),r?r.call(e):t.get(e)),Xt=(e,t,r)=>t.has(e)?uH("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),mt=(e,t,r,n)=>(FT(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Tr=(e,t,r)=>(FT(e,t,"access private method"),r);var IN=(e,t,r,n)=>({set _(i){mt(e,t,i,r)},get _(){return Ne(e,t,n)}});function sxe(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var cs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function en(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function axe(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var oZ={exports:{}},C5={},lZ={exports:{}},$r={};/** * @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 uC=Symbol.for("react.element"),oxe=Symbol.for("react.portal"),lxe=Symbol.for("react.fragment"),cxe=Symbol.for("react.strict_mode"),uxe=Symbol.for("react.profiler"),dxe=Symbol.for("react.provider"),Axe=Symbol.for("react.context"),fxe=Symbol.for("react.forward_ref"),hxe=Symbol.for("react.suspense"),pxe=Symbol.for("react.memo"),mxe=Symbol.for("react.lazy"),dH=Symbol.iterator;function gxe(e){return e===null||typeof e!="object"?null:(e=dH&&e[dH]||e["@@iterator"],typeof e=="function"?e:null)}var cZ={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},uZ=Object.assign,dZ={};function m0(e,t,r){this.props=e,this.context=t,this.refs=dZ,this.updater=r||cZ}m0.prototype.isReactComponent={};m0.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};m0.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function AZ(){}AZ.prototype=m0.prototype;function xR(e,t,r){this.props=e,this.context=t,this.refs=dZ,this.updater=r||cZ}var yR=xR.prototype=new AZ;yR.constructor=xR;uZ(yR,m0.prototype);yR.isPureReactComponent=!0;var AH=Array.isArray,fZ=Object.prototype.hasOwnProperty,bR={current:null},hZ={key:!0,ref:!0,__self:!0,__source:!0};function pZ(e,t,r){var n,i={},s=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)fZ.call(t,n)&&!hZ.hasOwnProperty(n)&&(i[n]=t[n]);var l=arguments.length-2;if(l===1)i.children=r;else if(1>>1,O=Q[$];if(0>>1;$i(X,Y))nei(oe,X)?(Q[$]=oe,Q[ne]=Y,$=ne):(Q[$]=X,Q[V]=Y,$=V);else if(nei(oe,Y))Q[$]=oe,Q[ne]=Y,$=ne;else break e}}return z}function i(Q,z){var Y=Q.sortIndex-z.sortIndex;return Y!==0?Y:Q.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,A=null,h=3,f=!1,m=!1,p=!1,g=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(Q){for(var z=r(u);z!==null;){if(z.callback===null)n(u);else if(z.startTime<=Q)n(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=r(u)}}function b(Q){if(p=!1,y(Q),!m)if(r(c)!==null)m=!0,G(C);else{var z=r(u);z!==null&&U(b,z.startTime-Q)}}function C(Q,z){m=!1,p&&(p=!1,v(T),T=-1),f=!0;var Y=h;try{for(y(z),A=r(c);A!==null&&(!(A.expirationTime>z)||Q&&!P());){var $=A.callback;if(typeof $=="function"){A.callback=null,h=A.priorityLevel;var O=$(A.expirationTime<=z);z=e.unstable_now(),typeof O=="function"?A.callback=O:A===r(c)&&n(c),y(z)}else n(c);A=r(c)}if(A!==null)var W=!0;else{var V=r(u);V!==null&&U(b,V.startTime-z),W=!1}return W}finally{A=null,h=Y,f=!1}}var j=!1,S=null,T=-1,B=5,I=-1;function P(){return!(e.unstable_now()-IQ||125$?(Q.sortIndex=Y,t(u,Q),r(c)===null&&Q===r(u)&&(p?(v(T),T=-1):p=!0,U(b,Y-$))):(Q.sortIndex=O,t(c,Q),m||f||(m=!0,G(C))),Q},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(Q){var z=h;return function(){var Y=h;h=z;try{return Q.apply(this,arguments)}finally{h=Y}}}})(yZ);xZ.exports=yZ;var _xe=xZ.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 kxe=w,wl=_xe;function nt(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oO=Object.prototype.hasOwnProperty,Exe=/^[: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]*$/,hH={},pH={};function Txe(e){return oO.call(pH,e)?!0:oO.call(hH,e)?!1:Exe.test(e)?pH[e]=!0:(hH[e]=!0,!1)}function Pxe(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ixe(e,t,r,n){if(t===null||typeof t>"u"||Pxe(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function mo(e,t,r,n,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var Aa={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Aa[e]=new mo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Aa[t]=new mo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Aa[e]=new mo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Aa[e]=new mo(e,2,!1,e,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(e){Aa[e]=new mo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Aa[e]=new mo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Aa[e]=new mo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Aa[e]=new mo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Aa[e]=new mo(e,5,!1,e.toLowerCase(),null,!1,!1)});var NR=/[\-:]([a-z])/g;function jR(e){return e[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(e){var t=e.replace(NR,jR);Aa[t]=new mo(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(NR,jR);Aa[t]=new mo(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(NR,jR);Aa[t]=new mo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Aa[e]=new mo(e,1,!1,e.toLowerCase(),null,!1,!1)});Aa.xlinkHref=new mo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Aa[e]=new mo(e,1,!1,e.toLowerCase(),null,!0,!0)});function SR(e,t,r,n){var i=Aa.hasOwnProperty(t)?Aa[t]:null;(i!==null?i.type!==0:n||!(2l||i[o]!==s[l]){var c=` `+i[o].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{DT=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?sw(e):""}function Oxe(e){switch(e.tag){case 5:return sw(e.type);case 16:return sw("Lazy");case 13:return sw("Suspense");case 19:return sw("SuspenseList");case 0:case 2:case 15:return e=RT(e.type,!1),e;case 11:return e=RT(e.type.render,!1),e;case 1:return e=RT(e.type,!0),e;default:return""}}function dO(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case tx:return"Fragment";case ex:return"Portal";case lO:return"Profiler";case BR:return"StrictMode";case cO:return"Suspense";case uO:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case CZ:return(e.displayName||"Context")+".Consumer";case wZ:return(e._context.displayName||"Context")+".Provider";case _R:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case kR:return t=e.displayName||null,t!==null?t:dO(e.type)||"Memo";case jf:t=e._payload,e=e._init;try{return dO(e(t))}catch{}}return null}function Fxe(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return dO(t);case 8:return t===BR?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Fh(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function jZ(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Lxe(e){var t=jZ(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function LN(e){e._valueTracker||(e._valueTracker=Lxe(e))}function SZ(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=jZ(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function hB(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function AO(e,t){var r=t.checked;return Ni({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function gH(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Fh(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function BZ(e,t){t=t.checked,t!=null&&SR(e,"checked",t,!1)}function fO(e,t){BZ(e,t);var r=Fh(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?hO(e,t.type,r):t.hasOwnProperty("defaultValue")&&hO(e,t.type,Fh(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vH(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function hO(e,t,r){(t!=="number"||hB(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var aw=Array.isArray;function Nx(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=MN.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function x1(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Tw={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},Mxe=["Webkit","ms","Moz","O"];Object.keys(Tw).forEach(function(e){Mxe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tw[t]=Tw[e]})});function TZ(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Tw.hasOwnProperty(e)&&Tw[e]?(""+t).trim():t+"px"}function PZ(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=TZ(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var Dxe=Ni({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 gO(e,t){if(t){if(Dxe[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(nt(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(nt(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(nt(61))}if(t.style!=null&&typeof t.style!="object")throw Error(nt(62))}}function vO(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 xO=null;function ER(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yO=null,jx=null,Sx=null;function bH(e){if(e=fC(e)){if(typeof yO!="function")throw Error(nt(280));var t=e.stateNode;t&&(t=_5(t),yO(e.stateNode,e.type,t))}}function IZ(e){jx?Sx?Sx.push(e):Sx=[e]:jx=e}function OZ(){if(jx){var e=jx,t=Sx;if(Sx=jx=null,bH(e),t)for(e=0;e>>=0,e===0?32:31-(qxe(e)/Xxe|0)|0}var DN=64,RN=4194304;function ow(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function vB(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,s=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~i;l!==0?n=ow(l):(s&=o,s!==0&&(n=ow(s)))}else o=r&~i,o!==0?n=ow(o):s!==0&&(n=ow(s));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function dC(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Xc(t),e[t]=r}function eye(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Iw),EH=" ",TH=!1;function eee(e,t){switch(e){case"keyup":return _ye.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tee(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rx=!1;function Eye(e,t){switch(e){case"compositionend":return tee(t);case"keypress":return t.which!==32?null:(TH=!0,EH);case"textInput":return e=t.data,e===EH&&TH?null:e;default:return null}}function Tye(e,t){if(rx)return e==="compositionend"||!DR&&eee(e,t)?(e=JZ(),SS=FR=Yf=null,rx=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=FH(r)}}function see(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?see(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function aee(){for(var e=window,t=hB();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=hB(e.document)}return t}function RR(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Uye(e){var t=aee(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&see(r.ownerDocument.documentElement,r)){if(n!==null&&RR(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!e.extend&&s>n&&(i=n,n=s,s=i),i=LH(r,s);var o=LH(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,nx=null,SO=null,Fw=null,BO=!1;function MH(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;BO||nx==null||nx!==hB(n)||(n=nx,"selectionStart"in n&&RR(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Fw&&j1(Fw,n)||(Fw=n,n=bB(SO,"onSelect"),0ax||(e.current=IO[ax],IO[ax]=null,ax--)}function Gn(e,t){ax++,IO[ax]=e.current,e.current=t}var Lh={},Ma=qh(Lh),Fo=qh(!1),Km=Lh;function dy(e,t){var r=e.type.contextTypes;if(!r)return Lh;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=t[s];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Lo(e){return e=e.childContextTypes,e!=null}function CB(){si(Fo),si(Ma)}function zH(e,t,r){if(Ma.current!==Lh)throw Error(nt(168));Gn(Ma,t),Gn(Fo,r)}function pee(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(nt(108,Fxe(e)||"Unknown",i));return Ni({},r,n)}function NB(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Lh,Km=Ma.current,Gn(Ma,e),Gn(Fo,Fo.current),!0}function WH(e,t,r){var n=e.stateNode;if(!n)throw Error(nt(169));r?(e=pee(e,t,Km),n.__reactInternalMemoizedMergedChildContext=e,si(Fo),si(Ma),Gn(Ma,e)):si(Fo),Gn(Fo,r)}var iA=null,k5=!1,ZT=!1;function mee(e){iA===null?iA=[e]:iA.push(e)}function Jye(e){k5=!0,mee(e)}function Xh(){if(!ZT&&iA!==null){ZT=!0;var e=0,t=jn;try{var r=iA;for(jn=1;e>=o,i-=o,dA=1<<32-Xc(t)+i|r<T?(B=S,S=null):B=S.sibling;var I=h(v,S,y[T],b);if(I===null){S===null&&(S=B);break}e&&S&&I.alternate===null&&t(v,S),x=s(I,x,T),j===null?C=I:j.sibling=I,j=I,S=B}if(T===y.length)return r(v,S),ui&&Qp(v,T),C;if(S===null){for(;TT?(B=S,S=null):B=S.sibling;var P=h(v,S,I.value,b);if(P===null){S===null&&(S=B);break}e&&S&&P.alternate===null&&t(v,S),x=s(P,x,T),j===null?C=P:j.sibling=P,j=P,S=B}if(I.done)return r(v,S),ui&&Qp(v,T),C;if(S===null){for(;!I.done;T++,I=y.next())I=A(v,I.value,b),I!==null&&(x=s(I,x,T),j===null?C=I:j.sibling=I,j=I);return ui&&Qp(v,T),C}for(S=n(v,S);!I.done;T++,I=y.next())I=f(S,v,T,I.value,b),I!==null&&(e&&I.alternate!==null&&S.delete(I.key===null?T:I.key),x=s(I,x,T),j===null?C=I:j.sibling=I,j=I);return e&&S.forEach(function(E){return t(v,E)}),ui&&Qp(v,T),C}function g(v,x,y,b){if(typeof y=="object"&&y!==null&&y.type===tx&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case FN:e:{for(var C=y.key,j=x;j!==null;){if(j.key===C){if(C=y.type,C===tx){if(j.tag===7){r(v,j.sibling),x=i(j,y.props.children),x.return=v,v=x;break e}}else if(j.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===jf&&VH(C)===j.type){r(v,j.sibling),x=i(j,y.props),x.ref=_b(v,j,y),x.return=v,v=x;break e}r(v,j);break}else t(v,j);j=j.sibling}y.type===tx?(x=Tm(y.props.children,v.mode,b,y.key),x.return=v,v=x):(b=OS(y.type,y.key,y.props,null,v.mode,b),b.ref=_b(v,x,y),b.return=v,v=b)}return o(v);case ex:e:{for(j=y.key;x!==null;){if(x.key===j)if(x.tag===4&&x.stateNode.containerInfo===y.containerInfo&&x.stateNode.implementation===y.implementation){r(v,x.sibling),x=i(x,y.children||[]),x.return=v,v=x;break e}else{r(v,x);break}else t(v,x);x=x.sibling}x=oP(y,v.mode,b),x.return=v,v=x}return o(v);case jf:return j=y._init,g(v,x,j(y._payload),b)}if(aw(y))return m(v,x,y,b);if(Cb(y))return p(v,x,y,b);GN(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,x!==null&&x.tag===6?(r(v,x.sibling),x=i(x,y),x.return=v,v=x):(r(v,x),x=aP(y,v.mode,b),x.return=v,v=x),o(v)):r(v,x)}return g}var fy=yee(!0),bee=yee(!1),BB=qh(null),_B=null,cx=null,$R=null;function zR(){$R=cx=_B=null}function WR(e){var t=BB.current;si(BB),e._currentValue=t}function LO(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function _x(e,t){_B=e,$R=cx=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(To=!0),e.firstContext=null)}function fc(e){var t=e._currentValue;if($R!==e)if(e={context:e,memoizedValue:t,next:null},cx===null){if(_B===null)throw Error(nt(308));cx=e,_B.dependencies={lanes:0,firstContext:e}}else cx=cx.next=e;return t}var nm=null;function GR(e){nm===null?nm=[e]:nm.push(e)}function wee(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,GR(t)):(r.next=i.next,i.next=r),t.interleaved=r,_A(e,n)}function _A(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Sf=!1;function KR(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Cee(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function gA(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function mh(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,on&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,_A(e,r)}return i=n.interleaved,i===null?(t.next=t,GR(n)):(t.next=i.next,i.next=t),n.interleaved=t,_A(e,r)}function _S(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,PR(e,r)}}function qH(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=t:s=s.next=t}else i=s=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function kB(e,t,r,n){var i=e.updateQueue;Sf=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?s=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(s!==null){var A=i.baseState;o=0,d=u=c=null,l=s;do{var h=l.lane,f=l.eventTime;if((n&h)===h){d!==null&&(d=d.next={eventTime:f,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,p=l;switch(h=t,f=r,p.tag){case 1:if(m=p.payload,typeof m=="function"){A=m.call(f,A,h);break e}A=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=p.payload,h=typeof m=="function"?m.call(f,A,h):m,h==null)break e;A=Ni({},A,h);break e;case 2:Sf=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[l]:h.push(l))}else f={eventTime:f,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=f,c=A):d=d.next=f,o|=h;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(c=A),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Xm|=o,e.lanes=o,e.memoizedState=A}}function XH(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=tP.transition;tP.transition={};try{e(!1),t()}finally{jn=r,tP.transition=n}}function Uee(){return hc().memoizedState}function r0e(e,t,r){var n=vh(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Qee(e))Hee(t,r);else if(r=wee(e,t,r,n),r!==null){var i=oo();Yc(r,e,n,i),$ee(r,t,n)}}function n0e(e,t,r){var n=vh(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Qee(e))Hee(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,r);if(i.hasEagerState=!0,i.eagerState=l,eu(l,o)){var c=t.interleaved;c===null?(i.next=i,GR(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}r=wee(e,t,i,n),r!==null&&(i=oo(),Yc(r,e,n,i),$ee(r,t,n))}}function Qee(e){var t=e.alternate;return e===Ci||t!==null&&t===Ci}function Hee(e,t){Lw=TB=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function $ee(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,PR(e,r)}}var PB={readContext:fc,useCallback:ba,useContext:ba,useEffect:ba,useImperativeHandle:ba,useInsertionEffect:ba,useLayoutEffect:ba,useMemo:ba,useReducer:ba,useRef:ba,useState:ba,useDebugValue:ba,useDeferredValue:ba,useTransition:ba,useMutableSource:ba,useSyncExternalStore:ba,useId:ba,unstable_isNewReconciler:!1},i0e={readContext:fc,useCallback:function(e,t){return _u().memoizedState=[e,t===void 0?null:t],e},useContext:fc,useEffect:JH,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ES(4194308,4,Fee.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ES(4194308,4,e,t)},useInsertionEffect:function(e,t){return ES(4,2,e,t)},useMemo:function(e,t){var r=_u();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=_u();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=r0e.bind(null,Ci,e),[n.memoizedState,e]},useRef:function(e){var t=_u();return e={current:e},t.memoizedState=e},useState:YH,useDebugValue:t6,useDeferredValue:function(e){return _u().memoizedState=e},useTransition:function(){var e=YH(!1),t=e[0];return e=t0e.bind(null,e[1]),_u().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ci,i=_u();if(ui){if(r===void 0)throw Error(nt(407));r=r()}else{if(r=t(),Qs===null)throw Error(nt(349));qm&30||Bee(n,t,r)}i.memoizedState=r;var s={value:r,getSnapshot:t};return i.queue=s,JH(kee.bind(null,n,s,e),[e]),n.flags|=2048,I1(9,_ee.bind(null,n,s,r,t),void 0,null),r},useId:function(){var e=_u(),t=Qs.identifierPrefix;if(ui){var r=AA,n=dA;r=(n&~(1<<32-Xc(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=T1++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Lu]=t,e[_1]=n,Zee(e,t,!1,!1),t.stateNode=e;e:{switch(o=vO(r,n),r){case"dialog":Zn("cancel",e),Zn("close",e),i=n;break;case"iframe":case"object":case"embed":Zn("load",e),i=n;break;case"video":case"audio":for(i=0;imy&&(t.flags|=128,n=!0,kb(s,!1),t.lanes=4194304)}else{if(!n)if(e=EB(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),kb(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!ui)return wa(t),null}else 2*Wi()-s.renderingStartTime>my&&r!==1073741824&&(t.flags|=128,n=!0,kb(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(r=s.last,r!==null?r.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Wi(),t.sibling=null,r=vi.current,Gn(vi,n?r&1|2:r&1),t):(wa(t),null);case 22:case 23:return o6(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?sl&1073741824&&(wa(t),t.subtreeFlags&6&&(t.flags|=8192)):wa(t),null;case 24:return null;case 25:return null}throw Error(nt(156,t.tag))}function A0e(e,t){switch(QR(t),t.tag){case 1:return Lo(t.type)&&CB(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hy(),si(Fo),si(Ma),XR(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qR(t),null;case 13:if(si(vi),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(nt(340));Ay()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return si(vi),null;case 4:return hy(),null;case 10:return WR(t.type._context),null;case 22:case 23:return o6(),null;case 24:return null;default:return null}}var VN=!1,Oa=!1,f0e=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function ux(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ii(e,t,n)}else r.current=null}function WO(e,t,r){try{r()}catch(n){Ii(e,t,n)}}var c$=!1;function h0e(e,t){if(_O=xB,e=aee(),RR(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,u=0,d=0,A=e,h=null;t:for(;;){for(var f;A!==r||i!==0&&A.nodeType!==3||(l=o+i),A!==s||n!==0&&A.nodeType!==3||(c=o+n),A.nodeType===3&&(o+=A.nodeValue.length),(f=A.firstChild)!==null;)h=A,A=f;for(;;){if(A===e)break t;if(h===r&&++u===i&&(l=o),h===s&&++d===n&&(c=o),(f=A.nextSibling)!==null)break;A=h,h=A.parentNode}A=f}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(kO={focusedElem:e,selectionRange:r},xB=!1,Ct=t;Ct!==null;)if(t=Ct,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ct=e;else for(;Ct!==null;){t=Ct;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var p=m.memoizedProps,g=m.memoizedState,v=t.stateNode,x=v.getSnapshotBeforeUpdate(t.elementType===t.type?p:Fc(t.type,p),g);v.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(nt(163))}}catch(b){Ii(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,Ct=e;break}Ct=t.return}return m=c$,c$=!1,m}function Mw(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&WO(t,r,s)}i=i.next}while(i!==n)}}function P5(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function GO(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function rte(e){var t=e.alternate;t!==null&&(e.alternate=null,rte(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Lu],delete t[_1],delete t[PO],delete t[Xye],delete t[Yye])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function nte(e){return e.tag===5||e.tag===3||e.tag===4}function u$(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nte(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function KO(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=wB));else if(n!==4&&(e=e.child,e!==null))for(KO(e,t,r),e=e.sibling;e!==null;)KO(e,t,r),e=e.sibling}function VO(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(VO(e,t,r),e=e.sibling;e!==null;)VO(e,t,r),e=e.sibling}var ra=null,Dc=!1;function uf(e,t,r){for(r=r.child;r!==null;)ite(e,t,r),r=r.sibling}function ite(e,t,r){if(Ku&&typeof Ku.onCommitFiberUnmount=="function")try{Ku.onCommitFiberUnmount(N5,r)}catch{}switch(r.tag){case 5:Oa||ux(r,t);case 6:var n=ra,i=Dc;ra=null,uf(e,t,r),ra=n,Dc=i,ra!==null&&(Dc?(e=ra,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):ra.removeChild(r.stateNode));break;case 18:ra!==null&&(Dc?(e=ra,r=r.stateNode,e.nodeType===8?JT(e.parentNode,r):e.nodeType===1&&JT(e,r),C1(e)):JT(ra,r.stateNode));break;case 4:n=ra,i=Dc,ra=r.stateNode.containerInfo,Dc=!0,uf(e,t,r),ra=n,Dc=i;break;case 0:case 11:case 14:case 15:if(!Oa&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&WO(r,t,o),i=i.next}while(i!==n)}uf(e,t,r);break;case 1:if(!Oa&&(ux(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Ii(r,t,l)}uf(e,t,r);break;case 21:uf(e,t,r);break;case 22:r.mode&1?(Oa=(n=Oa)||r.memoizedState!==null,uf(e,t,r),Oa=n):uf(e,t,r);break;default:uf(e,t,r)}}function d$(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new f0e),t.forEach(function(n){var i=C0e.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function _c(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Wi()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*m0e(n/1960))-n,10e?16:e,Jf===null)var n=!1;else{if(e=Jf,Jf=null,FB=0,on&6)throw Error(nt(331));var i=on;for(on|=4,Ct=e.current;Ct!==null;){var s=Ct,o=s.child;if(Ct.flags&16){var l=s.deletions;if(l!==null){for(var c=0;cWi()-s6?Em(e,0):i6|=r),Mo(e,t)}function Ate(e,t){t===0&&(e.mode&1?(t=RN,RN<<=1,!(RN&130023424)&&(RN=4194304)):t=1);var r=oo();e=_A(e,t),e!==null&&(dC(e,t,r),Mo(e,r))}function w0e(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Ate(e,r)}function C0e(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(nt(314))}n!==null&&n.delete(t),Ate(e,r)}var fte;fte=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Fo.current)To=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return To=!1,u0e(e,t,r);To=!!(e.flags&131072)}else To=!1,ui&&t.flags&1048576&&gee(t,SB,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;TS(e,t),e=t.pendingProps;var i=dy(t,Ma.current);_x(t,r),i=JR(null,t,n,e,i,r);var s=ZR();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Lo(n)?(s=!0,NB(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,KR(t),i.updater=T5,t.stateNode=i,i._reactInternals=t,DO(t,n,e,r),t=QO(null,t,n,!0,s,r)):(t.tag=0,ui&&s&&UR(t),Za(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(TS(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=j0e(n),e=Fc(n,e),i){case 0:t=UO(null,t,n,e,r);break e;case 1:t=a$(null,t,n,e,r);break e;case 11:t=i$(null,t,n,e,r);break e;case 14:t=s$(null,t,n,Fc(n.type,e),r);break e}throw Error(nt(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Fc(n,i),UO(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Fc(n,i),a$(e,t,n,i,r);case 3:e:{if(Xee(t),e===null)throw Error(nt(387));n=t.pendingProps,s=t.memoizedState,i=s.element,Cee(e,t),kB(t,n,null,r);var o=t.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=py(Error(nt(423)),t),t=o$(e,t,n,r,i);break e}else if(n!==i){i=py(Error(nt(424)),t),t=o$(e,t,n,r,i);break e}else for(Al=ph(t.stateNode.containerInfo.firstChild),pl=t,ui=!0,Hc=null,r=bee(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ay(),n===i){t=kA(e,t,r);break e}Za(e,t,n,r)}t=t.child}return t;case 5:return Nee(t),e===null&&FO(t),n=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,EO(n,i)?o=null:s!==null&&EO(n,s)&&(t.flags|=32),qee(e,t),Za(e,t,o,r),t.child;case 6:return e===null&&FO(t),null;case 13:return Yee(e,t,r);case 4:return VR(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=fy(t,null,n,r):Za(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Fc(n,i),i$(e,t,n,i,r);case 7:return Za(e,t,t.pendingProps,r),t.child;case 8:return Za(e,t,t.pendingProps.children,r),t.child;case 12:return Za(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Gn(BB,n._currentValue),n._currentValue=o,s!==null)if(eu(s.value,o)){if(s.children===i.children&&!Fo.current){t=kA(e,t,r);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(s.tag===1){c=gA(-1,r&-r),c.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),LO(s.return,r,t),l.lanes|=r;break}c=c.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(nt(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),LO(o,r,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Za(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,_x(t,r),i=fc(i),n=n(i),t.flags|=1,Za(e,t,n,r),t.child;case 14:return n=t.type,i=Fc(n,t.pendingProps),i=Fc(n.type,i),s$(e,t,n,i,r);case 15:return Kee(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Fc(n,i),TS(e,t),t.tag=1,Lo(n)?(e=!0,NB(t)):e=!1,_x(t,r),zee(t,n,i),DO(t,n,i,r),QO(null,t,n,!0,e,r);case 19:return Jee(e,t,r);case 22:return Vee(e,t,r)}throw Error(nt(156,t.tag))};function hte(e,t){return QZ(e,t)}function N0e(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tc(e,t,r,n){return new N0e(e,t,r,n)}function c6(e){return e=e.prototype,!(!e||!e.isReactComponent)}function j0e(e){if(typeof e=="function")return c6(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_R)return 11;if(e===kR)return 14}return 2}function xh(e,t){var r=e.alternate;return r===null?(r=tc(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function OS(e,t,r,n,i,s){var o=2;if(n=e,typeof e=="function")c6(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case tx:return Tm(r.children,i,s,t);case BR:o=8,i|=8;break;case lO:return e=tc(12,r,t,i|2),e.elementType=lO,e.lanes=s,e;case cO:return e=tc(13,r,t,i),e.elementType=cO,e.lanes=s,e;case uO:return e=tc(19,r,t,i),e.elementType=uO,e.lanes=s,e;case NZ:return O5(r,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case wZ:o=10;break e;case CZ:o=9;break e;case _R:o=11;break e;case kR:o=14;break e;case jf:o=16,n=null;break e}throw Error(nt(130,e==null?e:typeof e,""))}return t=tc(o,r,t,i),t.elementType=e,t.type=n,t.lanes=s,t}function Tm(e,t,r,n){return e=tc(7,e,n,t),e.lanes=r,e}function O5(e,t,r,n){return e=tc(22,e,n,t),e.elementType=NZ,e.lanes=r,e.stateNode={isHidden:!1},e}function aP(e,t,r){return e=tc(6,e,null,t),e.lanes=r,e}function oP(e,t,r){return t=tc(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function S0e(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=QT(0),this.expirationTimes=QT(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=QT(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function u6(e,t,r,n,i,s,o,l,c){return e=new S0e(e,t,r,l,c),t===1?(t=1,s===!0&&(t|=8)):t=0,s=tc(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},KR(s),e}function B0e(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vte)}catch(e){console.error(e)}}vte(),vZ.exports=_l;var _g=vZ.exports;const R5=en(_g);var xte,yte,x$=_g;yte=x$.createRoot,xte=x$.hydrateRoot;const P0e=1,I0e=1e6;let lP=0;function O0e(){return lP=(lP+1)%Number.MAX_SAFE_INTEGER,lP.toString()}const cP=new Map,y$=e=>{if(cP.has(e))return;const t=setTimeout(()=>{cP.delete(e),Uw({type:"REMOVE_TOAST",toastId:e})},I0e);cP.set(e,t)},F0e=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,P0e)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?y$(r):e.toasts.forEach(n=>{y$(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},FS=[];let LS={toasts:[]};function Uw(e){LS=F0e(LS,e),FS.forEach(t=>{t(LS)})}function ZO({...e}){const t=O0e(),r=i=>Uw({type:"UPDATE_TOAST",toast:{...i,id:t}}),n=()=>Uw({type:"DISMISS_TOAST",toastId:t});return Uw({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||n()}}}),{id:t,dismiss:n,update:r}}function Dr(){const[e,t]=w.useState(LS);return w.useEffect(()=>(FS.push(t),()=>{const r=FS.indexOf(t);r>-1&&FS.splice(r,1)}),[e]),{...e,toast:ZO,dismiss:r=>Uw({type:"DISMISS_TOAST",toastId:r})}}function Ye(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function b$(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pC(...e){return t=>{let r=!1;const n=e.map(i=>{const s=b$(i,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let i=0;i{const{children:o,...l}=s,c=w.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:o})};n.displayName=e+"Provider";function i(s){const o=w.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,i]}function Zi(e,t=[]){let r=[];function n(s,o){const l=w.createContext(o),c=r.length;r=[...r,o];const u=A=>{var v;const{scope:h,children:f,...m}=A,p=((v=h==null?void 0:h[e])==null?void 0:v[c])||l,g=w.useMemo(()=>m,Object.values(m));return a.jsx(p.Provider,{value:g,children:f})};u.displayName=s+"Provider";function d(A,h){var p;const f=((p=h==null?void 0:h[e])==null?void 0:p[c])||l,m=w.useContext(f);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${A}\` must be used within \`${s}\``)}return[u,d]}const i=()=>{const s=r.map(o=>w.createContext(o));return function(l){const c=(l==null?void 0:l[e])||s;return w.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[n,M0e(i,...t)]}function M0e(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const A=c(s)[`__scope${u}`];return{...l,...A}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function Jm(e){const t=D0e(e),r=w.forwardRef((n,i)=>{const{children:s,...o}=n,l=w.Children.toArray(s),c=l.find(R0e);if(c){const u=c.props.children,d=l.map(A=>A===c?w.Children.count(u)>1?w.Children.only(null):w.isValidElement(u)?u.props.children:null:A);return a.jsx(t,{...o,ref:i,children:w.isValidElement(u)?w.cloneElement(u,void 0,d):null})}return a.jsx(t,{...o,ref:i,children:s})});return r.displayName=`${e}.Slot`,r}var x0=Jm("Slot");function D0e(e){const t=w.forwardRef((r,n)=>{const{children:i,...s}=r;if(w.isValidElement(i)){const o=Q0e(i),l=U0e(s,i.props);return i.type!==w.Fragment&&(l.ref=n?pC(n,o):o),w.cloneElement(i,l)}return w.Children.count(i)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bte=Symbol("radix.slottable");function wte(e){const t=({children:r})=>a.jsx(a.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=bte,t}function R0e(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bte}function U0e(e,t){const r={...t};for(const n in t){const i=e[n],s=t[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...l)=>{const c=s(...l);return i(...l),c}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...e,...r}}function Q0e(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Yh(e){const t=e+"CollectionProvider",[r,n]=Zi(t),[i,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:g,children:v}=p,x=re.useRef(null),y=re.useRef(new Map).current;return a.jsx(i,{scope:g,itemMap:y,collectionRef:x,children:v})};o.displayName=t;const l=e+"CollectionSlot",c=Jm(l),u=re.forwardRef((p,g)=>{const{scope:v,children:x}=p,y=s(l,v),b=Jt(g,y.collectionRef);return a.jsx(c,{ref:b,children:x})});u.displayName=l;const d=e+"CollectionItemSlot",A="data-radix-collection-item",h=Jm(d),f=re.forwardRef((p,g)=>{const{scope:v,children:x,...y}=p,b=re.useRef(null),C=Jt(g,b),j=s(d,v);return re.useEffect(()=>(j.itemMap.set(b,{ref:b,...y}),()=>void j.itemMap.delete(b))),a.jsx(h,{[A]:"",ref:C,children:x})});f.displayName=d;function m(p){const g=s(e+"CollectionConsumer",p);return re.useCallback(()=>{const x=g.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${A}]`));return Array.from(g.itemMap.values()).sort((j,S)=>y.indexOf(j.ref.current)-y.indexOf(S.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:u,ItemSlot:f},m,n]}var H0e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],at=H0e.reduce((e,t)=>{const r=Jm(`Primitive.${t}`),n=w.forwardRef((i,s)=>{const{asChild:o,...l}=i,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function F1(e,t){e&&_g.flushSync(()=>e.dispatchEvent(t))}function Li(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function $0e(e,t=globalThis==null?void 0:globalThis.document){const r=Li(e);w.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var z0e="DismissableLayer",eF="dismissableLayer.update",W0e="dismissableLayer.pointerDownOutside",G0e="dismissableLayer.focusOutside",w$,Cte=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),kg=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:l,...c}=e,u=w.useContext(Cte),[d,A]=w.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=w.useState({}),m=Jt(t,S=>A(S)),p=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(g),x=d?p.indexOf(d):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,b=x>=v,C=V0e(S=>{const T=S.target,B=[...u.branches].some(I=>I.contains(T));!b||B||(i==null||i(S),o==null||o(S),S.defaultPrevented||l==null||l())},h),j=q0e(S=>{const T=S.target;[...u.branches].some(I=>I.contains(T))||(s==null||s(S),o==null||o(S),S.defaultPrevented||l==null||l())},h);return $0e(S=>{x===u.layers.size-1&&(n==null||n(S),!S.defaultPrevented&&l&&(S.preventDefault(),l()))},h),w.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(w$=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),C$(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=w$)}},[d,h,r,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),C$())},[d,u]),w.useEffect(()=>{const S=()=>f({});return document.addEventListener(eF,S),()=>document.removeEventListener(eF,S)},[]),a.jsx(at.div,{...c,ref:m,style:{pointerEvents:y?b?"auto":"none":void 0,...e.style},onFocusCapture:Ye(e.onFocusCapture,j.onFocusCapture),onBlurCapture:Ye(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Ye(e.onPointerDownCapture,C.onPointerDownCapture)})});kg.displayName=z0e;var K0e="DismissableLayerBranch",Nte=w.forwardRef((e,t)=>{const r=w.useContext(Cte),n=w.useRef(null),i=Jt(t,n);return w.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),a.jsx(at.div,{...e,ref:i})});Nte.displayName=K0e;function V0e(e,t=globalThis==null?void 0:globalThis.document){const r=Li(e),n=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const s=l=>{if(l.target&&!n.current){let c=function(){jte(W0e,r,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function q0e(e,t=globalThis==null?void 0:globalThis.document){const r=Li(e),n=w.useRef(!1);return w.useEffect(()=>{const i=s=>{s.target&&!n.current&&jte(G0e,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function C$(){const e=new CustomEvent(eF);document.dispatchEvent(e)}function jte(e,t,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?F1(i,s):i.dispatchEvent(s)}var X0e=kg,Y0e=Nte,Ai=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},J0e="Portal",mC=w.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[i,s]=w.useState(!1);Ai(()=>s(!0),[]);const o=r||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?R5.createPortal(a.jsx(at.div,{...n,ref:t}),o):null});mC.displayName=J0e;function Z0e(e,t){return w.useReducer((r,n)=>t[r][n]??r,e)}var Gs=e=>{const{present:t,children:r}=e,n=ebe(t),i=typeof r=="function"?r({present:n.isPresent}):w.Children.only(r),s=Jt(n.ref,tbe(i));return typeof r=="function"||n.isPresent?w.cloneElement(i,{ref:s}):null};Gs.displayName="Presence";function ebe(e){const[t,r]=w.useState(),n=w.useRef(null),i=w.useRef(e),s=w.useRef("none"),o=e?"mounted":"unmounted",[l,c]=Z0e(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=YN(n.current);s.current=l==="mounted"?u:"none"},[l]),Ai(()=>{const u=n.current,d=i.current;if(d!==e){const h=s.current,f=YN(u);e?c("MOUNT"):f==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),Ai(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,A=f=>{const p=YN(n.current).includes(f.animationName);if(f.target===t&&p&&(c("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=f=>{f.target===t&&(s.current=YN(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",A),t.addEventListener("animationend",A),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",A),t.removeEventListener("animationend",A)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:w.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function YN(e){return(e==null?void 0:e.animationName)||"none"}function tbe(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var rbe=CR[" useInsertionEffect ".trim().toString()]||Ai;function fa({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,s,o]=nbe({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:i;{const d=w.useRef(e!==void 0);w.useEffect(()=>{const A=d.current;A!==l&&console.warn(`${n} is changing from ${A?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,n])}const u=w.useCallback(d=>{var A;if(l){const h=ibe(d)?d(e):d;h!==e&&((A=o.current)==null||A.call(o,h))}else s(d)},[l,e,s,o]);return[c,u]}function nbe({defaultProp:e,onChange:t}){const[r,n]=w.useState(e),i=w.useRef(r),s=w.useRef(t);return rbe(()=>{s.current=t},[t]),w.useEffect(()=>{var o;i.current!==r&&((o=s.current)==null||o.call(s,r),i.current=r)},[r,i]),[r,n,s]}function ibe(e){return typeof e=="function"}var Ste=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),sbe="VisuallyHidden",U5=w.forwardRef((e,t)=>a.jsx(at.span,{...e,ref:t,style:{...Ste,...e.style}}));U5.displayName=sbe;var Bte=U5,h6="ToastProvider",[p6,abe,obe]=Yh("Toast"),[_te,KCt]=Zi("Toast",[obe]),[lbe,Q5]=_te(h6),kte=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=e,[l,c]=w.useState(null),[u,d]=w.useState(0),A=w.useRef(!1),h=w.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${h6}\`. Expected non-empty \`string\`.`),a.jsx(p6.Provider,{scope:t,children:a.jsx(lbe,{scope:t,label:r,duration:n,swipeDirection:i,swipeThreshold:s,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:w.useCallback(()=>d(f=>f+1),[]),onToastRemove:w.useCallback(()=>d(f=>f-1),[]),isFocusedToastEscapeKeyDownRef:A,isClosePausedRef:h,children:o})})};kte.displayName=h6;var Ete="ToastViewport",cbe=["F8"],tF="toast.viewportPause",rF="toast.viewportResume",Tte=w.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=cbe,label:i="Notifications ({hotkey})",...s}=e,o=Q5(Ete,r),l=abe(r),c=w.useRef(null),u=w.useRef(null),d=w.useRef(null),A=w.useRef(null),h=Jt(t,A,o.onViewportChange),f=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=o.toastCount>0;w.useEffect(()=>{const g=v=>{var y;n.length!==0&&n.every(b=>v[b]||v.code===b)&&((y=A.current)==null||y.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),w.useEffect(()=>{const g=c.current,v=A.current;if(m&&g&&v){const x=()=>{if(!o.isClosePausedRef.current){const j=new CustomEvent(tF);v.dispatchEvent(j),o.isClosePausedRef.current=!0}},y=()=>{if(o.isClosePausedRef.current){const j=new CustomEvent(rF);v.dispatchEvent(j),o.isClosePausedRef.current=!1}},b=j=>{!g.contains(j.relatedTarget)&&y()},C=()=>{g.contains(document.activeElement)||y()};return g.addEventListener("focusin",x),g.addEventListener("focusout",b),g.addEventListener("pointermove",x),g.addEventListener("pointerleave",C),window.addEventListener("blur",x),window.addEventListener("focus",y),()=>{g.removeEventListener("focusin",x),g.removeEventListener("focusout",b),g.removeEventListener("pointermove",x),g.removeEventListener("pointerleave",C),window.removeEventListener("blur",x),window.removeEventListener("focus",y)}}},[m,o.isClosePausedRef]);const p=w.useCallback(({tabbingDirection:g})=>{const x=l().map(y=>{const b=y.ref.current,C=[b,...wbe(b)];return g==="forwards"?C:C.reverse()});return(g==="forwards"?x.reverse():x).flat()},[l]);return w.useEffect(()=>{const g=A.current;if(g){const v=x=>{var C,j,S;const y=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!y){const T=document.activeElement,B=x.shiftKey;if(x.target===g&&B){(C=u.current)==null||C.focus();return}const E=p({tabbingDirection:B?"backwards":"forwards"}),M=E.findIndex(_=>_===T);uP(E.slice(M+1))?x.preventDefault():B?(j=u.current)==null||j.focus():(S=d.current)==null||S.focus()}};return g.addEventListener("keydown",v),()=>g.removeEventListener("keydown",v)}},[l,p]),a.jsxs(Y0e,{ref:c,role:"region","aria-label":i.replace("{hotkey}",f),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&a.jsx(nF,{ref:u,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"forwards"});uP(g)}}),a.jsx(p6.Slot,{scope:r,children:a.jsx(at.ol,{tabIndex:-1,...s,ref:h})}),m&&a.jsx(nF,{ref:d,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"backwards"});uP(g)}})]})});Tte.displayName=Ete;var Pte="ToastFocusProxy",nF=w.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=e,s=Q5(Pte,r);return a.jsx(U5,{"aria-hidden":!0,tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const l=o.relatedTarget;!((u=s.viewport)!=null&&u.contains(l))&&n()}})});nF.displayName=Pte;var gC="Toast",ube="toast.swipeStart",dbe="toast.swipeMove",Abe="toast.swipeCancel",fbe="toast.swipeEnd",Ite=w.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:s,...o}=e,[l,c]=fa({prop:n,defaultProp:i??!0,onChange:s,caller:gC});return a.jsx(Gs,{present:r||l,children:a.jsx(mbe,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:Li(e.onPause),onResume:Li(e.onResume),onSwipeStart:Ye(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ye(e.onSwipeMove,u=>{const{x:d,y:A}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${A}px`)}),onSwipeCancel:Ye(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ye(e.onSwipeEnd,u=>{const{x:d,y:A}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${A}px`),c(!1)})})})});Ite.displayName=gC;var[hbe,pbe]=_te(gC,{onClose(){}}),mbe=w.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:A,onSwipeCancel:h,onSwipeEnd:f,...m}=e,p=Q5(gC,r),[g,v]=w.useState(null),x=Jt(t,_=>v(_)),y=w.useRef(null),b=w.useRef(null),C=i||p.duration,j=w.useRef(0),S=w.useRef(C),T=w.useRef(0),{onToastAdd:B,onToastRemove:I}=p,P=Li(()=>{var R;(g==null?void 0:g.contains(document.activeElement))&&((R=p.viewport)==null||R.focus()),o()}),E=w.useCallback(_=>{!_||_===1/0||(window.clearTimeout(T.current),j.current=new Date().getTime(),T.current=window.setTimeout(P,_))},[P]);w.useEffect(()=>{const _=p.viewport;if(_){const R=()=>{E(S.current),u==null||u()},G=()=>{const U=new Date().getTime()-j.current;S.current=S.current-U,window.clearTimeout(T.current),c==null||c()};return _.addEventListener(tF,G),_.addEventListener(rF,R),()=>{_.removeEventListener(tF,G),_.removeEventListener(rF,R)}}},[p.viewport,C,c,u,E]),w.useEffect(()=>{s&&!p.isClosePausedRef.current&&E(C)},[s,C,p.isClosePausedRef,E]),w.useEffect(()=>(B(),()=>I()),[B,I]);const M=w.useMemo(()=>g?Ute(g):null,[g]);return p.viewport?a.jsxs(a.Fragment,{children:[M&&a.jsx(gbe,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:M}),a.jsx(hbe,{scope:r,onClose:P,children:_g.createPortal(a.jsx(p6.ItemSlot,{scope:r,children:a.jsx(X0e,{asChild:!0,onEscapeKeyDown:Ye(l,()=>{p.isFocusedToastEscapeKeyDownRef.current||P(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:a.jsx(at.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":p.swipeDirection,...m,ref:x,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ye(e.onKeyDown,_=>{_.key==="Escape"&&(l==null||l(_.nativeEvent),_.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,P()))}),onPointerDown:Ye(e.onPointerDown,_=>{_.button===0&&(y.current={x:_.clientX,y:_.clientY})}),onPointerMove:Ye(e.onPointerMove,_=>{if(!y.current)return;const R=_.clientX-y.current.x,G=_.clientY-y.current.y,U=!!b.current,Q=["left","right"].includes(p.swipeDirection),z=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,Y=Q?z(0,R):0,$=Q?0:z(0,G),O=_.pointerType==="touch"?10:2,W={x:Y,y:$},V={originalEvent:_,delta:W};U?(b.current=W,JN(dbe,A,V,{discrete:!1})):N$(W,p.swipeDirection,O)?(b.current=W,JN(ube,d,V,{discrete:!1}),_.target.setPointerCapture(_.pointerId)):(Math.abs(R)>O||Math.abs(G)>O)&&(y.current=null)}),onPointerUp:Ye(e.onPointerUp,_=>{const R=b.current,G=_.target;if(G.hasPointerCapture(_.pointerId)&&G.releasePointerCapture(_.pointerId),b.current=null,y.current=null,R){const U=_.currentTarget,Q={originalEvent:_,delta:R};N$(R,p.swipeDirection,p.swipeThreshold)?JN(fbe,f,Q,{discrete:!0}):JN(Abe,h,Q,{discrete:!0}),U.addEventListener("click",z=>z.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),gbe=e=>{const{__scopeToast:t,children:r,...n}=e,i=Q5(gC,t),[s,o]=w.useState(!1),[l,c]=w.useState(!1);return ybe(()=>o(!0)),w.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:a.jsx(mC,{asChild:!0,children:a.jsx(U5,{...n,children:s&&a.jsxs(a.Fragment,{children:[i.label," ",r]})})})},vbe="ToastTitle",Ote=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return a.jsx(at.div,{...n,ref:t})});Ote.displayName=vbe;var xbe="ToastDescription",Fte=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return a.jsx(at.div,{...n,ref:t})});Fte.displayName=xbe;var Lte="ToastAction",Mte=w.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?a.jsx(Rte,{altText:r,asChild:!0,children:a.jsx(m6,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Lte}\`. Expected non-empty \`string\`.`),null)});Mte.displayName=Lte;var Dte="ToastClose",m6=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,i=pbe(Dte,r);return a.jsx(Rte,{asChild:!0,children:a.jsx(at.button,{type:"button",...n,ref:t,onClick:Ye(e.onClick,i.onClose)})})});m6.displayName=Dte;var Rte=w.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...i}=e;return a.jsx(at.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...i,ref:t})});function Ute(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),bbe(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=n.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...Ute(n))}}),t}function JN(e,t,r,{discrete:n}){const i=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?F1(i,s):i.dispatchEvent(s)}var N$=(e,t,r=0)=>{const n=Math.abs(e.x),i=Math.abs(e.y),s=n>i;return t==="left"||t==="right"?s&&n>r:!s&&i>r};function ybe(e=()=>{}){const t=Li(e);Ai(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function bbe(e){return e.nodeType===e.ELEMENT_NODE}function wbe(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function uP(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Cbe=kte,Qte=Tte,Hte=Ite,$te=Ote,zte=Fte,Wte=Mte,Gte=m6;function Kte(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,S$=mr,Jh=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return S$(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:s}=t,o=Object.keys(i).map(u=>{const d=r==null?void 0:r[u],A=s==null?void 0:s[u];if(d===null)return null;const h=j$(d)||j$(A);return i[u][h]}),l=r&&Object.entries(r).reduce((u,d)=>{let[A,h]=d;return h===void 0||(u[A]=h),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:A,className:h,...f}=d;return Object.entries(f).every(m=>{let[p,g]=m;return Array.isArray(g)?g.includes({...s,...l}[p]):{...s,...l}[p]===g})?[...u,A,h]:u},[]);return S$(e,o,c,r==null?void 0:r.class,r==null?void 0:r.className)};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Nbe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Vte=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var jbe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sbe=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:s,iconNode:o,...l},c)=>w.createElement("svg",{ref:c,...jbe,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Vte("lucide",i),...l},[...o.map(([u,d])=>w.createElement(u,d)),...Array.isArray(s)?s:[s]]));/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Me=(e,t)=>{const r=w.forwardRef(({className:n,...i},s)=>w.createElement(Sbe,{ref:s,iconNode:t,className:Vte(`lucide-${Nbe(e)}`,n),...i}));return r.displayName=`${e}`,r};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Bbe=Me("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const B$=Me("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _be=Me("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Cl=Me("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Di=Me("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kbe=Me("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ebe=Me("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Tbe=Me("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pc=Me("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dP=Me("BookmarkCheck",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2Z",key:"169p4p"}],["path",{d:"m9 10 2 2 4-4",key:"1gnqz4"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const MS=Me("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qte=Me("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const g6=Me("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pbe=Me("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ibe=Me("CalendarCheck",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Da=Me("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ra=Me("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Obe=Me("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Fbe=Me("ChartPie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dr=Me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const y0=Me("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const v6=Me("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vC=Me("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const x6=Me("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const H5=Me("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xp=Me("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zf=Me("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const L1=Me("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xte=Me("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Yte=Me("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const DS=Me("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tu=Me("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Lbe=Me("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Mbe=Me("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Dbe=Me("Cookie",[["path",{d:"M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5",key:"laymnq"}],["path",{d:"M8.5 8.5v.01",key:"ue8clq"}],["path",{d:"M16 15.5v.01",key:"14dtrp"}],["path",{d:"M12 12v.01",key:"u5ubse"}],["path",{d:"M11 17v.01",key:"1hyl5a"}],["path",{d:"M7 14v.01",key:"uct60s"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zl=Me("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const y6=Me("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ru=Me("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const M1=Me("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jte=Me("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zte=Me("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Rbe=Me("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zh=Me("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const b6=Me("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ere=Me("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tre=Me("FileImage",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ube=Me("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Qbe=Me("FileSpreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ai=Me("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Hbe=Me("Film",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rre=Me("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $be=Me("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nre=Me("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ire=Me("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zbe=Me("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Wbe=Me("GitCompareArrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gbe=Me("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Hs=Me("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sre=Me("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kbe=Me("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Vbe=Me("HandCoins",[["path",{d:"M11 15h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 17",key:"geh8rc"}],["path",{d:"m7 21 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9",key:"1fto5m"}],["path",{d:"m2 16 6 6",key:"1pfhp9"}],["circle",{cx:"16",cy:"9",r:"2.9",key:"1n0dlu"}],["circle",{cx:"6",cy:"5",r:"3",key:"151irh"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qbe=Me("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xbe=Me("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ybe=Me("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jbe=Me("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const w6=Me("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const D1=Me("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zbe=Me("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $5=Me("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ewe=Me("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const C6=Me("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const twe=Me("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const AP=Me("LayoutList",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["path",{d:"M14 4h7",key:"3xa0d5"}],["path",{d:"M14 9h7",key:"1icrd9"}],["path",{d:"M14 15h7",key:"1mj8o2"}],["path",{d:"M14 20h7",key:"11slyb"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rwe=Me("Leaf",[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nwe=Me("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vA=Me("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const iwe=Me("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xC=Me("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const are=Me("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const swe=Me("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Nl=Me("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ore=Me("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lre=Me("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jl=Me("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const awe=Me("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const owe=Me("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _$=Me("MessageCircleQuestion",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ex=Me("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cre=Me("MessageSquareText",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yC=Me("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Tx=Me("MicVocal",[["path",{d:"m11 7.601-5.994 8.19a1 1 0 0 0 .1 1.298l.817.818a1 1 0 0 0 1.314.087L15.09 12",key:"80a601"}],["path",{d:"M16.5 21.174C15.5 20.5 14.372 20 13 20c-2.058 0-3.928 2.356-6 2-2.072-.356-2.775-3.369-1.5-4.5",key:"j0ngtp"}],["circle",{cx:"16",cy:"7",r:"5",key:"d08jfb"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lwe=Me("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cwe=Me("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const uwe=Me("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dwe=Me("NotebookPen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Awe=Me("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Px=Me("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fwe=Me("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const N6=Me("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const R1=Me("PenTool",[["path",{d:"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z",key:"nt11vn"}],["path",{d:"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18",key:"15qc1e"}],["path",{d:"m2.3 2.3 7.286 7.286",key:"1wuzzi"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hwe=Me("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const z5=Me("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ure=Me("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pwe=Me("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xi=Me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ac=Me("Presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mwe=Me("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gwe=Me("Redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zm=Me("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const W5=Me("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vwe=Me("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Mh=Me("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xwe=Me("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const oc=Me("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ywe=Me("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gy=Me("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vy=Me("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const G5=Me("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const DB=Me("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const RB=Me("Shuffle",[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bwe=Me("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Do=Me("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const b0=Me("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const eg=Me("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wwe=Me("StickyNote",[["path",{d:"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z",key:"qazsjp"}],["path",{d:"M15 3v4a2 2 0 0 0 2 2h4",key:"40519r"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Cwe=Me("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const K5=Me("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ca=Me("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Nwe=Me("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sl=Me("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jwe=Me("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ni=Me("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const j6=Me("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Swe=Me("Triangle",[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Bwe=Me("Truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const S6=Me("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _we=Me("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kwe=Me("Undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ewe=Me("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tg=Me("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nu=Me("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const UB=Me("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kc=Me("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Twe=Me("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ml=Me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const V5=Me("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ln=Me("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),B6="-",Pwe=e=>{const t=Owe(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(B6);return l[0]===""&&l.length!==1&&l.shift(),dre(l,t)||Iwe(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},dre=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?dre(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(B6);return(o=t.validators.find(({validator:l})=>l(s)))==null?void 0:o.classGroupId},k$=/^\[(.+)\]$/,Iwe=e=>{if(k$.test(e)){const t=k$.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Owe=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return Lwe(Object.entries(e.classGroups),r).forEach(([s,o])=>{iF(o,n,s,t)}),n},iF=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:E$(t,i);s.classGroupId=r;return}if(typeof i=="function"){if(Fwe(i)){iF(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([s,o])=>{iF(o,E$(t,s),r,n)})})},E$=(e,t)=>{let r=e;return t.split(B6).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Fwe=e=>e.isThemeGetter,Lwe=(e,t)=>t?e.map(([r,n])=>{const i=n.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,l])=>[t+o,l])):s);return[r,i]}):e,Mwe=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(s,o)=>{r.set(s,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let o=r.get(s);if(o!==void 0)return o;if((o=n.get(s))!==void 0)return i(s,o),o},set(s,o){r.has(s)?r.set(s,o):i(s,o)}}},Are="!",Dwe=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,i=t[0],s=t.length,o=l=>{const c=[];let u=0,d=0,A;for(let g=0;gd?A-d:void 0;return{modifiers:c,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:p}};return r?l=>r({className:l,parseClassName:o}):o},Rwe=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Uwe=e=>({cache:Mwe(e.cacheSize),parseClassName:Dwe(e),...Pwe(e)}),Qwe=/\s+/,Hwe=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,s=[],o=e.trim().split(Qwe);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:A,baseClassName:h,maybePostfixModifierPosition:f}=r(u);let m=!!f,p=n(m?h.substring(0,f):h);if(!p){if(!m){l=u+(l.length>0?" "+l:l);continue}if(p=n(h),!p){l=u+(l.length>0?" "+l:l);continue}m=!1}const g=Rwe(d).join(":"),v=A?g+Are:g,x=v+p;if(s.includes(x))continue;s.push(x);const y=i(p,m);for(let b=0;b0?" "+l:l)}return l};function $we(){let e=0,t,r,n="";for(;e{if(typeof e=="string")return e;let t,r="";for(let n=0;nA(d),e());return r=Uwe(u),n=r.cache.get,i=r.cache.set,s=l,l(c)}function l(c){const u=n(c);if(u)return u;const d=Hwe(c,r);return i(c,d),d}return function(){return s($we.apply(null,arguments))}}const Jn=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},hre=/^\[(?:([a-z-]+):)?(.+)\]$/i,Wwe=/^\d+\/\d+$/,Gwe=new Set(["px","full","screen"]),Kwe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Vwe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,qwe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Xwe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ywe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ud=e=>Ix(e)||Gwe.has(e)||Wwe.test(e),df=e=>w0(e,"length",s1e),Ix=e=>!!e&&!Number.isNaN(Number(e)),fP=e=>w0(e,"number",Ix),Tb=e=>!!e&&Number.isInteger(Number(e)),Jwe=e=>e.endsWith("%")&&Ix(e.slice(0,-1)),kr=e=>hre.test(e),Af=e=>Kwe.test(e),Zwe=new Set(["length","size","percentage"]),e1e=e=>w0(e,Zwe,pre),t1e=e=>w0(e,"position",pre),r1e=new Set(["image","url"]),n1e=e=>w0(e,r1e,o1e),i1e=e=>w0(e,"",a1e),Pb=()=>!0,w0=(e,t,r)=>{const n=hre.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},s1e=e=>Vwe.test(e)&&!qwe.test(e),pre=()=>!1,a1e=e=>Xwe.test(e),o1e=e=>Ywe.test(e),l1e=()=>{const e=Jn("colors"),t=Jn("spacing"),r=Jn("blur"),n=Jn("brightness"),i=Jn("borderColor"),s=Jn("borderRadius"),o=Jn("borderSpacing"),l=Jn("borderWidth"),c=Jn("contrast"),u=Jn("grayscale"),d=Jn("hueRotate"),A=Jn("invert"),h=Jn("gap"),f=Jn("gradientColorStops"),m=Jn("gradientColorStopPositions"),p=Jn("inset"),g=Jn("margin"),v=Jn("opacity"),x=Jn("padding"),y=Jn("saturate"),b=Jn("scale"),C=Jn("sepia"),j=Jn("skew"),S=Jn("space"),T=Jn("translate"),B=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",kr,t],E=()=>[kr,t],M=()=>["",Ud,df],_=()=>["auto",Ix,kr],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",kr],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>[Ix,kr];return{cacheSize:500,separator:":",theme:{colors:[Pb],spacing:[Ud,df],blur:["none","",Af,kr],brightness:$(),borderColor:[e],borderRadius:["none","","full",Af,kr],borderSpacing:E(),borderWidth:M(),contrast:$(),grayscale:z(),hueRotate:$(),invert:z(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[Jwe,df],inset:P(),margin:P(),opacity:$(),padding:E(),saturate:$(),scale:$(),sepia:z(),skew:$(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",kr]}],container:["container"],columns:[{columns:[Af]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...R(),kr]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Tb,kr]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",kr]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",Tb,kr]}],"grid-cols":[{"grid-cols":[Pb]}],"col-start-end":[{col:["auto",{span:["full",Tb,kr]},kr]}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":[Pb]}],"row-start-end":[{row:["auto",{span:[Tb,kr]},kr]}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",kr]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",kr]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",kr,t]}],"min-w":[{"min-w":[kr,t,"min","max","fit"]}],"max-w":[{"max-w":[kr,t,"none","full","min","max","fit","prose",{screen:[Af]},Af]}],h:[{h:[kr,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[kr,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[kr,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[kr,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Af,df]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",fP]}],"font-family":[{font:[Pb]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",kr]}],"line-clamp":[{"line-clamp":["none",Ix,fP]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ud,kr]}],"list-image":[{"list-image":["none",kr]}],"list-style-type":[{list:["none","disc","decimal",kr]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ud,df]}],"underline-offset":[{"underline-offset":["auto",Ud,kr]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",kr]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",kr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),t1e]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",e1e]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},n1e]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:G()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[Ud,kr]}],"outline-w":[{outline:[Ud,df]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Ud,df]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Af,i1e]}],"shadow-color":[{shadow:[Pb]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Af,kr]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[A]}],saturate:[{saturate:[y]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[A]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",kr]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",kr]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",kr]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Tb,kr]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",kr]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",kr]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",kr]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ud,df,fP]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},c1e=zwe(l1e);function Le(...e){return c1e(mr(e))}const u1e=Cbe,mre=w.forwardRef(({className:e,...t},r)=>a.jsx(Qte,{ref:r,className:Le("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));mre.displayName=Qte.displayName;const d1e=Jh("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),gre=w.forwardRef(({className:e,variant:t,...r},n)=>a.jsx(Hte,{ref:n,className:Le(d1e({variant:t}),e),...r}));gre.displayName=Hte.displayName;const A1e=w.forwardRef(({className:e,...t},r)=>a.jsx(Wte,{ref:r,className:Le("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));A1e.displayName=Wte.displayName;const vre=w.forwardRef(({className:e,...t},r)=>a.jsx(Gte,{ref:r,className:Le("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:a.jsx(ml,{className:"h-4 w-4"})}));vre.displayName=Gte.displayName;const xre=w.forwardRef(({className:e,...t},r)=>a.jsx($te,{ref:r,className:Le("text-sm font-semibold",e),...t}));xre.displayName=$te.displayName;const yre=w.forwardRef(({className:e,...t},r)=>a.jsx(zte,{ref:r,className:Le("text-sm opacity-90",e),...t}));yre.displayName=zte.displayName;function f1e(){const{toasts:e}=Dr();return a.jsxs(u1e,{children:[e.map(function({id:t,title:r,description:n,action:i,...s}){return a.jsxs(gre,{...s,children:[a.jsxs("div",{className:"grid gap-1",children:[r&&a.jsx(xre,{children:r}),n&&a.jsx(yre,{children:n})]}),i,a.jsx(vre,{})]},t)}),a.jsx(mre,{})]})}var T$=["light","dark"],h1e="(prefers-color-scheme: dark)",p1e=w.createContext(void 0),m1e={setTheme:e=>{},themes:[]},g1e=()=>{var e;return(e=w.useContext(p1e))!=null?e:m1e};w.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:i,defaultTheme:s,value:o,attrs:l,nonce:c})=>{let u=s==="system",d=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(m=>`'${m}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,A=i?T$.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(m,p=!1,g=!0)=>{let v=o?o[m]:m,x=p?m+"|| ''":`'${v}'`,y="";return i&&g&&!p&&T$.includes(m)&&(y+=`d.style.colorScheme = '${m}';`),r==="class"?p||v?y+=`c.add(${x})`:y+="null":v&&(y+=`d[s](n,${x})`),y},f=e?`!function(){${d}${h(e)}}()`:n?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${h1e}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}${u?"":"else{"+h(s,!1,!1)+"}"}${A}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}else{${h(s,!1,!1)};}${A}}catch(t){}}();`;return w.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:f}})});var v1e=e=>{switch(e){case"success":return b1e;case"info":return C1e;case"warning":return w1e;case"error":return N1e;default:return null}},x1e=Array(12).fill(0),y1e=({visible:e,className:t})=>re.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},re.createElement("div",{className:"sonner-spinner"},x1e.map((r,n)=>re.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),b1e=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),w1e=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),C1e=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),N1e=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),j1e=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},re.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),re.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),S1e=()=>{let[e,t]=re.useState(document.hidden);return re.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},sF=1,B1e=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;let{message:n,...i}=t,s=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:sF++,o=this.toasts.find(c=>c.id===s),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(c=>c.id===s?(this.publish({...c,...t,id:s,title:n}),{...c,...t,id:s,dismissible:l,title:n}):c):this.addToast({title:n,...i,dismissible:l,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),this.subscribers.forEach(r=>r({id:t,dismiss:!0})),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));let i=t instanceof Promise?t:t(),s=n!==void 0,o,l=i.then(async u=>{if(o=["resolve",u],re.isValidElement(u))s=!1,this.create({id:n,type:"default",message:u});else if(k1e(u)&&!u.ok){s=!1;let d=typeof r.error=="function"?await r.error(`HTTP error! status: ${u.status}`):r.error,A=typeof r.description=="function"?await r.description(`HTTP error! status: ${u.status}`):r.description;this.create({id:n,type:"error",message:d,description:A})}else if(r.success!==void 0){s=!1;let d=typeof r.success=="function"?await r.success(u):r.success,A=typeof r.description=="function"?await r.description(u):r.description;this.create({id:n,type:"success",message:d,description:A})}}).catch(async u=>{if(o=["reject",u],r.error!==void 0){s=!1;let d=typeof r.error=="function"?await r.error(u):r.error,A=typeof r.description=="function"?await r.description(u):r.description;this.create({id:n,type:"error",message:d,description:A})}}).finally(()=>{var u;s&&(this.dismiss(n),n=void 0),(u=r.finally)==null||u.call(r)}),c=()=>new Promise((u,d)=>l.then(()=>o[0]==="reject"?d(o[1]):u(o[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(t,r)=>{let n=(r==null?void 0:r.id)||sF++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},jo=new B1e,_1e=(e,t)=>{let r=(t==null?void 0:t.id)||sF++;return jo.addToast({title:e,...t,id:r}),r},k1e=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",E1e=_1e,T1e=()=>jo.toasts,P1e=()=>jo.getActiveToasts(),ss=Object.assign(E1e,{success:jo.success,info:jo.info,warning:jo.warning,error:jo.error,custom:jo.custom,message:jo.message,promise:jo.promise,dismiss:jo.dismiss,loading:jo.loading},{getHistory:T1e,getToasts:P1e});function I1e(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}I1e(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} `);function ZN(e){return e.label!==void 0}var O1e=3,F1e="32px",L1e="16px",P$=4e3,M1e=356,D1e=14,R1e=20,U1e=200;function kc(...e){return e.filter(Boolean).join(" ")}function Q1e(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var H1e=e=>{var t,r,n,i,s,o,l,c,u,d,A;let{invert:h,toast:f,unstyled:m,interacting:p,setHeights:g,visibleToasts:v,heights:x,index:y,toasts:b,expanded:C,removeToast:j,defaultRichColors:S,closeButton:T,style:B,cancelButtonStyle:I,actionButtonStyle:P,className:E="",descriptionClassName:M="",duration:_,position:R,gap:G,loadingIcon:U,expandByDefault:Q,classNames:z,icons:Y,closeButtonAriaLabel:$="Close toast",pauseWhenPageIsHidden:O}=e,[W,V]=re.useState(null),[X,ne]=re.useState(null),[oe,pe]=re.useState(!1),[de,ge]=re.useState(!1),[ie,ue]=re.useState(!1),[Se,D]=re.useState(!1),[K,we]=re.useState(!1),[ae,te]=re.useState(0),[ce,be]=re.useState(0),je=re.useRef(f.duration||_||P$),xe=re.useRef(null),Ie=re.useRef(null),Ke=y===0,De=y+1<=v,Ve=f.type,ht=f.dismissible!==!1,ft=f.className||"",ut=f.descriptionClassName||"",Qt=re.useMemo(()=>x.findIndex(Kt=>Kt.toastId===f.id)||0,[x,f.id]),dt=re.useMemo(()=>{var Kt;return(Kt=f.closeButton)!=null?Kt:T},[f.closeButton,T]),Sr=re.useMemo(()=>f.duration||_||P$,[f.duration,_]),Tt=re.useRef(0),qt=re.useRef(0),nr=re.useRef(0),hr=re.useRef(null),[Mt,Vr]=R.split("-"),Ht=re.useMemo(()=>x.reduce((Kt,ir,Wr)=>Wr>=Qt?Kt:Kt+ir.height,0),[x,Qt]),$t=S1e(),zr=f.invert||h,Zt=Ve==="loading";qt.current=re.useMemo(()=>Qt*G+Ht,[Qt,Ht]),re.useEffect(()=>{je.current=Sr},[Sr]),re.useEffect(()=>{pe(!0)},[]),re.useEffect(()=>{let Kt=Ie.current;if(Kt){let ir=Kt.getBoundingClientRect().height;return be(ir),g(Wr=>[{toastId:f.id,height:ir,position:f.position},...Wr]),()=>g(Wr=>Wr.filter(Bn=>Bn.toastId!==f.id))}},[g,f.id]),re.useLayoutEffect(()=>{if(!oe)return;let Kt=Ie.current,ir=Kt.style.height;Kt.style.height="auto";let Wr=Kt.getBoundingClientRect().height;Kt.style.height=ir,be(Wr),g(Bn=>Bn.find(St=>St.toastId===f.id)?Bn.map(St=>St.toastId===f.id?{...St,height:Wr}:St):[{toastId:f.id,height:Wr,position:f.position},...Bn])},[oe,f.title,f.description,g,f.id]);let yt=re.useCallback(()=>{ge(!0),te(qt.current),g(Kt=>Kt.filter(ir=>ir.toastId!==f.id)),setTimeout(()=>{j(f)},U1e)},[f,j,g,qt]);re.useEffect(()=>{if(f.promise&&Ve==="loading"||f.duration===1/0||f.type==="loading")return;let Kt;return C||p||O&&$t?(()=>{if(nr.current{var ir;(ir=f.onAutoClose)==null||ir.call(f,f),yt()},je.current)),()=>clearTimeout(Kt)},[C,p,f,Ve,O,$t,yt]),re.useEffect(()=>{f.delete&&yt()},[yt,f.delete]);function tn(){var Kt,ir,Wr;return Y!=null&&Y.loading?re.createElement("div",{className:kc(z==null?void 0:z.loader,(Kt=f==null?void 0:f.classNames)==null?void 0:Kt.loader,"sonner-loader"),"data-visible":Ve==="loading"},Y.loading):U?re.createElement("div",{className:kc(z==null?void 0:z.loader,(ir=f==null?void 0:f.classNames)==null?void 0:ir.loader,"sonner-loader"),"data-visible":Ve==="loading"},U):re.createElement(y1e,{className:kc(z==null?void 0:z.loader,(Wr=f==null?void 0:f.classNames)==null?void 0:Wr.loader),visible:Ve==="loading"})}return re.createElement("li",{tabIndex:0,ref:Ie,className:kc(E,ft,z==null?void 0:z.toast,(t=f==null?void 0:f.classNames)==null?void 0:t.toast,z==null?void 0:z.default,z==null?void 0:z[Ve],(r=f==null?void 0:f.classNames)==null?void 0:r[Ve]),"data-sonner-toast":"","data-rich-colors":(n=f.richColors)!=null?n:S,"data-styled":!(f.jsx||f.unstyled||m),"data-mounted":oe,"data-promise":!!f.promise,"data-swiped":K,"data-removed":de,"data-visible":De,"data-y-position":Mt,"data-x-position":Vr,"data-index":y,"data-front":Ke,"data-swiping":ie,"data-dismissible":ht,"data-type":Ve,"data-invert":zr,"data-swipe-out":Se,"data-swipe-direction":X,"data-expanded":!!(C||Q&&oe),style:{"--index":y,"--toasts-before":y,"--z-index":b.length-y,"--offset":`${de?ae:qt.current}px`,"--initial-height":Q?"auto":`${ce}px`,...B,...f.style},onDragEnd:()=>{ue(!1),V(null),hr.current=null},onPointerDown:Kt=>{Zt||!ht||(xe.current=new Date,te(qt.current),Kt.target.setPointerCapture(Kt.pointerId),Kt.target.tagName!=="BUTTON"&&(ue(!0),hr.current={x:Kt.clientX,y:Kt.clientY}))},onPointerUp:()=>{var Kt,ir,Wr,Bn;if(Se||!ht)return;hr.current=null;let St=Number(((Kt=Ie.current)==null?void 0:Kt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),es=Number(((ir=Ie.current)==null?void 0:ir.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Or=new Date().getTime()-((Wr=xe.current)==null?void 0:Wr.getTime()),fn=W==="x"?St:es,hi=Math.abs(fn)/Or;if(Math.abs(fn)>=R1e||hi>.11){te(qt.current),(Bn=f.onDismiss)==null||Bn.call(f,f),ne(W==="x"?St>0?"right":"left":es>0?"down":"up"),yt(),D(!0),we(!1);return}ue(!1),V(null)},onPointerMove:Kt=>{var ir,Wr,Bn,St;if(!hr.current||!ht||((ir=window.getSelection())==null?void 0:ir.toString().length)>0)return;let es=Kt.clientY-hr.current.y,Or=Kt.clientX-hr.current.x,fn=(Wr=e.swipeDirections)!=null?Wr:Q1e(R);!W&&(Math.abs(Or)>1||Math.abs(es)>1)&&V(Math.abs(Or)>Math.abs(es)?"x":"y");let hi={x:0,y:0};W==="y"?(fn.includes("top")||fn.includes("bottom"))&&(fn.includes("top")&&es<0||fn.includes("bottom")&&es>0)&&(hi.y=es):W==="x"&&(fn.includes("left")||fn.includes("right"))&&(fn.includes("left")&&Or<0||fn.includes("right")&&Or>0)&&(hi.x=Or),(Math.abs(hi.x)>0||Math.abs(hi.y)>0)&&we(!0),(Bn=Ie.current)==null||Bn.style.setProperty("--swipe-amount-x",`${hi.x}px`),(St=Ie.current)==null||St.style.setProperty("--swipe-amount-y",`${hi.y}px`)}},dt&&!f.jsx?re.createElement("button",{"aria-label":$,"data-disabled":Zt,"data-close-button":!0,onClick:Zt||!ht?()=>{}:()=>{var Kt;yt(),(Kt=f.onDismiss)==null||Kt.call(f,f)},className:kc(z==null?void 0:z.closeButton,(i=f==null?void 0:f.classNames)==null?void 0:i.closeButton)},(s=Y==null?void 0:Y.close)!=null?s:j1e):null,f.jsx||w.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:re.createElement(re.Fragment,null,Ve||f.icon||f.promise?re.createElement("div",{"data-icon":"",className:kc(z==null?void 0:z.icon,(o=f==null?void 0:f.classNames)==null?void 0:o.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||tn():null,f.type!=="loading"?f.icon||(Y==null?void 0:Y[Ve])||v1e(Ve):null):null,re.createElement("div",{"data-content":"",className:kc(z==null?void 0:z.content,(l=f==null?void 0:f.classNames)==null?void 0:l.content)},re.createElement("div",{"data-title":"",className:kc(z==null?void 0:z.title,(c=f==null?void 0:f.classNames)==null?void 0:c.title)},typeof f.title=="function"?f.title():f.title),f.description?re.createElement("div",{"data-description":"",className:kc(M,ut,z==null?void 0:z.description,(u=f==null?void 0:f.classNames)==null?void 0:u.description)},typeof f.description=="function"?f.description():f.description):null),w.isValidElement(f.cancel)?f.cancel:f.cancel&&ZN(f.cancel)?re.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||I,onClick:Kt=>{var ir,Wr;ZN(f.cancel)&&ht&&((Wr=(ir=f.cancel).onClick)==null||Wr.call(ir,Kt),yt())},className:kc(z==null?void 0:z.cancelButton,(d=f==null?void 0:f.classNames)==null?void 0:d.cancelButton)},f.cancel.label):null,w.isValidElement(f.action)?f.action:f.action&&ZN(f.action)?re.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||P,onClick:Kt=>{var ir,Wr;ZN(f.action)&&((Wr=(ir=f.action).onClick)==null||Wr.call(ir,Kt),!Kt.defaultPrevented&&yt())},className:kc(z==null?void 0:z.actionButton,(A=f==null?void 0:f.classNames)==null?void 0:A.actionButton)},f.action.label):null))};function I$(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function $1e(e,t){let r={};return[e,t].forEach((n,i)=>{let s=i===1,o=s?"--mobile-offset":"--offset",l=s?L1e:F1e;function c(u){["top","right","bottom","left"].forEach(d=>{r[`${o}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${o}-${u}`]=l:r[`${o}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(l)}),r}var z1e=w.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:i=["altKey","KeyT"],expand:s,closeButton:o,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:A,duration:h,style:f,visibleToasts:m=O1e,toastOptions:p,dir:g=I$(),gap:v=D1e,loadingIcon:x,icons:y,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:C}=e,[j,S]=re.useState([]),T=re.useMemo(()=>Array.from(new Set([n].concat(j.filter(O=>O.position).map(O=>O.position)))),[j,n]),[B,I]=re.useState([]),[P,E]=re.useState(!1),[M,_]=re.useState(!1),[R,G]=re.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=re.useRef(null),Q=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=re.useRef(null),Y=re.useRef(!1),$=re.useCallback(O=>{S(W=>{var V;return(V=W.find(X=>X.id===O.id))!=null&&V.delete||jo.dismiss(O.id),W.filter(({id:X})=>X!==O.id)})},[]);return re.useEffect(()=>jo.subscribe(O=>{if(O.dismiss){S(W=>W.map(V=>V.id===O.id?{...V,delete:!0}:V));return}setTimeout(()=>{R5.flushSync(()=>{S(W=>{let V=W.findIndex(X=>X.id===O.id);return V!==-1?[...W.slice(0,V),{...W[V],...O},...W.slice(V+1)]:[O,...W]})})})}),[]),re.useEffect(()=>{if(d!=="system"){G(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;let O=window.matchMedia("(prefers-color-scheme: dark)");try{O.addEventListener("change",({matches:W})=>{G(W?"dark":"light")})}catch{O.addListener(({matches:V})=>{try{G(V?"dark":"light")}catch(X){console.error(X)}})}},[d]),re.useEffect(()=>{j.length<=1&&E(!1)},[j]),re.useEffect(()=>{let O=W=>{var V,X;i.every(ne=>W[ne]||W.code===ne)&&(E(!0),(V=U.current)==null||V.focus()),W.code==="Escape"&&(document.activeElement===U.current||(X=U.current)!=null&&X.contains(document.activeElement))&&E(!1)};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[i]),re.useEffect(()=>{if(U.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,Y.current=!1)}},[U.current]),re.createElement("section",{ref:t,"aria-label":`${b} ${Q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},T.map((O,W)=>{var V;let[X,ne]=O.split("-");return j.length?re.createElement("ol",{key:O,dir:g==="auto"?I$():g,tabIndex:-1,ref:U,className:l,"data-sonner-toaster":!0,"data-theme":R,"data-y-position":X,"data-lifted":P&&j.length>1&&!s,"data-x-position":ne,style:{"--front-toast-height":`${((V=B[0])==null?void 0:V.height)||0}px`,"--width":`${M1e}px`,"--gap":`${v}px`,...f,...$1e(c,u)},onBlur:oe=>{Y.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(Y.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,z.current=oe.relatedTarget)},onMouseEnter:()=>E(!0),onMouseMove:()=>E(!0),onMouseLeave:()=>{M||E(!1)},onDragEnd:()=>E(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||_(!0)},onPointerUp:()=>_(!1)},j.filter(oe=>!oe.position&&W===0||oe.position===O).map((oe,pe)=>{var de,ge;return re.createElement(H1e,{key:oe.id,icons:y,index:pe,toast:oe,defaultRichColors:A,duration:(de=p==null?void 0:p.duration)!=null?de:h,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:r,visibleToasts:m,closeButton:(ge=p==null?void 0:p.closeButton)!=null?ge:o,interacting:M,position:O,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:$,toasts:j.filter(ie=>ie.position==oe.position),heights:B.filter(ie=>ie.position==oe.position),setHeights:I,expandByDefault:s,gap:v,loadingIcon:x,expanded:P,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});const W1e=({...e})=>{const{theme:t="system"}=g1e();return a.jsx(z1e,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var G1e=CR[" useId ".trim().toString()]||(()=>{}),K1e=0;function lo(e){const[t,r]=w.useState(G1e());return Ai(()=>{e||r(n=>n??String(K1e++))},[e]),e||(t?`radix-${t}`:"")}const V1e=["top","right","bottom","left"],Dh=Math.min,ll=Math.max,QB=Math.round,ej=Math.floor,qu=e=>({x:e,y:e}),q1e={left:"right",right:"left",bottom:"top",top:"bottom"},X1e={start:"end",end:"start"};function aF(e,t,r){return ll(e,Dh(t,r))}function EA(e,t){return typeof e=="function"?e(t):e}function TA(e){return e.split("-")[0]}function C0(e){return e.split("-")[1]}function _6(e){return e==="x"?"y":"x"}function k6(e){return e==="y"?"height":"width"}const Y1e=new Set(["top","bottom"]);function Uu(e){return Y1e.has(TA(e))?"y":"x"}function E6(e){return _6(Uu(e))}function J1e(e,t,r){r===void 0&&(r=!1);const n=C0(e),i=E6(e),s=k6(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=HB(o)),[o,HB(o)]}function Z1e(e){const t=HB(e);return[oF(e),t,oF(t)]}function oF(e){return e.replace(/start|end/g,t=>X1e[t])}const O$=["left","right"],F$=["right","left"],e2e=["top","bottom"],t2e=["bottom","top"];function r2e(e,t,r){switch(e){case"top":case"bottom":return r?t?F$:O$:t?O$:F$;case"left":case"right":return t?e2e:t2e;default:return[]}}function n2e(e,t,r,n){const i=C0(e);let s=r2e(TA(e),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(oF)))),s}function HB(e){return e.replace(/left|right|bottom|top/g,t=>q1e[t])}function i2e(e){return{top:0,right:0,bottom:0,left:0,...e}}function bre(e){return typeof e!="number"?i2e(e):{top:e,right:e,bottom:e,left:e}}function $B(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function L$(e,t,r){let{reference:n,floating:i}=e;const s=Uu(t),o=E6(t),l=k6(o),c=TA(t),u=s==="y",d=n.x+n.width/2-i.width/2,A=n.y+n.height/2-i.height/2,h=n[l]/2-i[l]/2;let f;switch(c){case"top":f={x:d,y:n.y-i.height};break;case"bottom":f={x:d,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:A};break;case"left":f={x:n.x-i.width,y:A};break;default:f={x:n.x,y:n.y}}switch(C0(t)){case"start":f[o]-=h*(r&&u?-1:1);break;case"end":f[o]+=h*(r&&u?-1:1);break}return f}const s2e=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,l=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:A}=L$(u,n,c),h=n,f={},m=0;for(let p=0;p({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:s,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=EA(e,t)||{};if(u==null)return{};const A=bre(d),h={x:r,y:n},f=E6(i),m=k6(f),p=await o.getDimensions(u),g=f==="y",v=g?"top":"left",x=g?"bottom":"right",y=g?"clientHeight":"clientWidth",b=s.reference[m]+s.reference[f]-h[f]-s.floating[m],C=h[f]-s.reference[f],j=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let S=j?j[y]:0;(!S||!await(o.isElement==null?void 0:o.isElement(j)))&&(S=l.floating[y]||s.floating[m]);const T=b/2-C/2,B=S/2-p[m]/2-1,I=Dh(A[v],B),P=Dh(A[x],B),E=I,M=S-p[m]-P,_=S/2-p[m]/2+T,R=aF(E,_,M),G=!c.arrow&&C0(i)!=null&&_!==R&&s.reference[m]/2-(__<=0)){var P,E;const _=(((P=s.flip)==null?void 0:P.index)||0)+1,R=S[_];if(R&&(!(A==="alignment"?x!==Uu(R):!1)||I.every(Q=>Q.overflows[0]>0&&Uu(Q.placement)===x)))return{data:{index:_,overflows:I},reset:{placement:R}};let G=(E=I.filter(U=>U.overflows[0]<=0).sort((U,Q)=>U.overflows[1]-Q.overflows[1])[0])==null?void 0:E.placement;if(!G)switch(f){case"bestFit":{var M;const U=(M=I.filter(Q=>{if(j){const z=Uu(Q.placement);return z===x||z==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(z=>z>0).reduce((z,Y)=>z+Y,0)]).sort((Q,z)=>Q[1]-z[1])[0])==null?void 0:M[0];U&&(G=U);break}case"initialPlacement":G=l;break}if(i!==G)return{reset:{placement:G}}}return{}}}};function M$(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function D$(e){return V1e.some(t=>e[t]>=0)}const l2e=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=EA(e,t);switch(n){case"referenceHidden":{const s=await U1(t,{...i,elementContext:"reference"}),o=M$(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:D$(o)}}}case"escaped":{const s=await U1(t,{...i,altBoundary:!0}),o=M$(s,r.floating);return{data:{escapedOffsets:o,escaped:D$(o)}}}default:return{}}}}},wre=new Set(["left","top"]);async function c2e(e,t){const{placement:r,platform:n,elements:i}=e,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=TA(r),l=C0(r),c=Uu(r)==="y",u=wre.has(o)?-1:1,d=s&&c?-1:1,A=EA(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:m}=typeof A=="number"?{mainAxis:A,crossAxis:0,alignmentAxis:null}:{mainAxis:A.mainAxis||0,crossAxis:A.crossAxis||0,alignmentAxis:A.alignmentAxis};return l&&typeof m=="number"&&(f=l==="end"?m*-1:m),c?{x:f*d,y:h*u}:{x:h*u,y:f*d}}const u2e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:s,placement:o,middlewareData:l}=t,c=await c2e(t,e);return o===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},d2e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:l={fn:g=>{let{x:v,y:x}=g;return{x:v,y:x}}},...c}=EA(e,t),u={x:r,y:n},d=await U1(t,c),A=Uu(TA(i)),h=_6(A);let f=u[h],m=u[A];if(s){const g=h==="y"?"top":"left",v=h==="y"?"bottom":"right",x=f+d[g],y=f-d[v];f=aF(x,f,y)}if(o){const g=A==="y"?"top":"left",v=A==="y"?"bottom":"right",x=m+d[g],y=m-d[v];m=aF(x,m,y)}const p=l.fn({...t,[h]:f,[A]:m});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[h]:s,[A]:o}}}}}},A2e=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=EA(e,t),d={x:r,y:n},A=Uu(i),h=_6(A);let f=d[h],m=d[A];const p=EA(l,t),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const y=h==="y"?"height":"width",b=s.reference[h]-s.floating[y]+g.mainAxis,C=s.reference[h]+s.reference[y]-g.mainAxis;fC&&(f=C)}if(u){var v,x;const y=h==="y"?"width":"height",b=wre.has(TA(i)),C=s.reference[A]-s.floating[y]+(b&&((v=o.offset)==null?void 0:v[A])||0)+(b?0:g.crossAxis),j=s.reference[A]+s.reference[y]+(b?0:((x=o.offset)==null?void 0:x[A])||0)-(b?g.crossAxis:0);mj&&(m=j)}return{[h]:f,[A]:m}}}},f2e=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:i,rects:s,platform:o,elements:l}=t,{apply:c=()=>{},...u}=EA(e,t),d=await U1(t,u),A=TA(i),h=C0(i),f=Uu(i)==="y",{width:m,height:p}=s.floating;let g,v;A==="top"||A==="bottom"?(g=A,v=h===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(v=A,g=h==="end"?"top":"bottom");const x=p-d.top-d.bottom,y=m-d.left-d.right,b=Dh(p-d[g],x),C=Dh(m-d[v],y),j=!t.middlewareData.shift;let S=b,T=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(T=y),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(S=x),j&&!h){const I=ll(d.left,0),P=ll(d.right,0),E=ll(d.top,0),M=ll(d.bottom,0);f?T=m-2*(I!==0||P!==0?I+P:ll(d.left,d.right)):S=p-2*(E!==0||M!==0?E+M:ll(d.top,d.bottom))}await c({...t,availableWidth:T,availableHeight:S});const B=await o.getDimensions(l.floating);return m!==B.width||p!==B.height?{reset:{rects:!0}}:{}}}};function q5(){return typeof window<"u"}function N0(e){return Cre(e)?(e.nodeName||"").toLowerCase():"#document"}function gl(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function dd(e){var t;return(t=(Cre(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Cre(e){return q5()?e instanceof Node||e instanceof gl(e).Node:!1}function iu(e){return q5()?e instanceof Element||e instanceof gl(e).Element:!1}function rd(e){return q5()?e instanceof HTMLElement||e instanceof gl(e).HTMLElement:!1}function R$(e){return!q5()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof gl(e).ShadowRoot}const h2e=new Set(["inline","contents"]);function bC(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=su(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!h2e.has(i)}const p2e=new Set(["table","td","th"]);function m2e(e){return p2e.has(N0(e))}const g2e=[":popover-open",":modal"];function X5(e){return g2e.some(t=>{try{return e.matches(t)}catch{return!1}})}const v2e=["transform","translate","scale","rotate","perspective"],x2e=["transform","translate","scale","rotate","perspective","filter"],y2e=["paint","layout","strict","content"];function T6(e){const t=P6(),r=iu(e)?su(e):e;return v2e.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||x2e.some(n=>(r.willChange||"").includes(n))||y2e.some(n=>(r.contain||"").includes(n))}function b2e(e){let t=Rh(e);for(;rd(t)&&!xy(t);){if(T6(t))return t;if(X5(t))return null;t=Rh(t)}return null}function P6(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const w2e=new Set(["html","body","#document"]);function xy(e){return w2e.has(N0(e))}function su(e){return gl(e).getComputedStyle(e)}function Y5(e){return iu(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rh(e){if(N0(e)==="html")return e;const t=e.assignedSlot||e.parentNode||R$(e)&&e.host||dd(e);return R$(t)?t.host:t}function Nre(e){const t=Rh(e);return xy(t)?e.ownerDocument?e.ownerDocument.body:e.body:rd(t)&&bC(t)?t:Nre(t)}function Q1(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=Nre(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),o=gl(i);if(s){const l=lF(o);return t.concat(o,o.visualViewport||[],bC(i)?i:[],l&&r?Q1(l):[])}return t.concat(i,Q1(i,[],r))}function lF(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jre(e){const t=su(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=rd(e),s=i?e.offsetWidth:r,o=i?e.offsetHeight:n,l=QB(r)!==s||QB(n)!==o;return l&&(r=s,n=o),{width:r,height:n,$:l}}function I6(e){return iu(e)?e:e.contextElement}function Ox(e){const t=I6(e);if(!rd(t))return qu(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:s}=jre(t);let o=(s?QB(r.width):r.width)/n,l=(s?QB(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const C2e=qu(0);function Sre(e){const t=gl(e);return!P6()||!t.visualViewport?C2e:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function N2e(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==gl(e)?!1:t}function rg(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),s=I6(e);let o=qu(1);t&&(n?iu(n)&&(o=Ox(n)):o=Ox(e));const l=N2e(s,r,n)?Sre(s):qu(0);let c=(i.left+l.x)/o.x,u=(i.top+l.y)/o.y,d=i.width/o.x,A=i.height/o.y;if(s){const h=gl(s),f=n&&iu(n)?gl(n):n;let m=h,p=lF(m);for(;p&&n&&f!==m;){const g=Ox(p),v=p.getBoundingClientRect(),x=su(p),y=v.left+(p.clientLeft+parseFloat(x.paddingLeft))*g.x,b=v.top+(p.clientTop+parseFloat(x.paddingTop))*g.y;c*=g.x,u*=g.y,d*=g.x,A*=g.y,c+=y,u+=b,m=gl(p),p=lF(m)}}return $B({width:d,height:A,x:c,y:u})}function O6(e,t){const r=Y5(e).scrollLeft;return t?t.left+r:rg(dd(e)).left+r}function Bre(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-(r?0:O6(e,n)),s=n.top+t.scrollTop;return{x:i,y:s}}function j2e(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const s=i==="fixed",o=dd(n),l=t?X5(t.floating):!1;if(n===o||l&&s)return r;let c={scrollLeft:0,scrollTop:0},u=qu(1);const d=qu(0),A=rd(n);if((A||!A&&!s)&&((N0(n)!=="body"||bC(o))&&(c=Y5(n)),rd(n))){const f=rg(n);u=Ox(n),d.x=f.x+n.clientLeft,d.y=f.y+n.clientTop}const h=o&&!A&&!s?Bre(o,c,!0):qu(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:r.y*u.y-c.scrollTop*u.y+d.y+h.y}}function S2e(e){return Array.from(e.getClientRects())}function B2e(e){const t=dd(e),r=Y5(e),n=e.ownerDocument.body,i=ll(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=ll(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+O6(e);const l=-r.scrollTop;return su(n).direction==="rtl"&&(o+=ll(t.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:l}}function _2e(e,t){const r=gl(e),n=dd(e),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,l=0,c=0;if(i){s=i.width,o=i.height;const u=P6();(!u||u&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:l,y:c}}const k2e=new Set(["absolute","fixed"]);function E2e(e,t){const r=rg(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,s=rd(e)?Ox(e):qu(1),o=e.clientWidth*s.x,l=e.clientHeight*s.y,c=i*s.x,u=n*s.y;return{width:o,height:l,x:c,y:u}}function U$(e,t,r){let n;if(t==="viewport")n=_2e(e,r);else if(t==="document")n=B2e(dd(e));else if(iu(t))n=E2e(t,r);else{const i=Sre(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return $B(n)}function _re(e,t){const r=Rh(e);return r===t||!iu(r)||xy(r)?!1:su(r).position==="fixed"||_re(r,t)}function T2e(e,t){const r=t.get(e);if(r)return r;let n=Q1(e,[],!1).filter(l=>iu(l)&&N0(l)!=="body"),i=null;const s=su(e).position==="fixed";let o=s?Rh(e):e;for(;iu(o)&&!xy(o);){const l=su(o),c=T6(o);!c&&l.position==="fixed"&&(i=null),(s?!c&&!i:!c&&l.position==="static"&&!!i&&k2e.has(i.position)||bC(o)&&!c&&_re(e,o))?n=n.filter(d=>d!==o):i=l,o=Rh(o)}return t.set(e,n),n}function P2e(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o=[...r==="clippingAncestors"?X5(t)?[]:T2e(t,this._c):[].concat(r),n],l=o[0],c=o.reduce((u,d)=>{const A=U$(t,d,i);return u.top=ll(A.top,u.top),u.right=Dh(A.right,u.right),u.bottom=Dh(A.bottom,u.bottom),u.left=ll(A.left,u.left),u},U$(t,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function I2e(e){const{width:t,height:r}=jre(e);return{width:t,height:r}}function O2e(e,t,r){const n=rd(t),i=dd(t),s=r==="fixed",o=rg(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=qu(0);function u(){c.x=O6(i)}if(n||!n&&!s)if((N0(t)!=="body"||bC(i))&&(l=Y5(t)),n){const f=rg(t,!0,s,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else i&&u();s&&!n&&i&&u();const d=i&&!n&&!s?Bre(i,l):qu(0),A=o.left+l.scrollLeft-c.x-d.x,h=o.top+l.scrollTop-c.y-d.y;return{x:A,y:h,width:o.width,height:o.height}}function hP(e){return su(e).position==="static"}function Q$(e,t){if(!rd(e)||su(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return dd(e)===r&&(r=r.ownerDocument.body),r}function kre(e,t){const r=gl(e);if(X5(e))return r;if(!rd(e)){let i=Rh(e);for(;i&&!xy(i);){if(iu(i)&&!hP(i))return i;i=Rh(i)}return r}let n=Q$(e,t);for(;n&&m2e(n)&&hP(n);)n=Q$(n,t);return n&&xy(n)&&hP(n)&&!T6(n)?r:n||b2e(e)||r}const F2e=async function(e){const t=this.getOffsetParent||kre,r=this.getDimensions,n=await r(e.floating);return{reference:O2e(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function L2e(e){return su(e).direction==="rtl"}const M2e={convertOffsetParentRelativeRectToViewportRelativeRect:j2e,getDocumentElement:dd,getClippingRect:P2e,getOffsetParent:kre,getElementRects:F2e,getClientRects:S2e,getDimensions:I2e,getScale:Ox,isElement:iu,isRTL:L2e};function Ere(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function D2e(e,t){let r=null,n;const i=dd(e);function s(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:d,top:A,width:h,height:f}=u;if(l||t(),!h||!f)return;const m=ej(A),p=ej(i.clientWidth-(d+h)),g=ej(i.clientHeight-(A+f)),v=ej(d),y={rootMargin:-m+"px "+-p+"px "+-g+"px "+-v+"px",threshold:ll(0,Dh(1,c))||1};let b=!0;function C(j){const S=j[0].intersectionRatio;if(S!==c){if(!b)return o();S?o(!1,S):n=setTimeout(()=>{o(!1,1e-7)},1e3)}S===1&&!Ere(u,e.getBoundingClientRect())&&o(),b=!1}try{r=new IntersectionObserver(C,{...y,root:i.ownerDocument})}catch{r=new IntersectionObserver(C,y)}r.observe(e)}return o(!0),s}function R2e(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=I6(e),d=i||s?[...u?Q1(u):[],...Q1(t)]:[];d.forEach(v=>{i&&v.addEventListener("scroll",r,{passive:!0}),s&&v.addEventListener("resize",r)});const A=u&&l?D2e(u,r):null;let h=-1,f=null;o&&(f=new ResizeObserver(v=>{let[x]=v;x&&x.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=f)==null||y.observe(t)})),r()}),u&&!c&&f.observe(u),f.observe(t));let m,p=c?rg(e):null;c&&g();function g(){const v=rg(e);p&&!Ere(p,v)&&r(),p=v,m=requestAnimationFrame(g)}return r(),()=>{var v;d.forEach(x=>{i&&x.removeEventListener("scroll",r),s&&x.removeEventListener("resize",r)}),A==null||A(),(v=f)==null||v.disconnect(),f=null,c&&cancelAnimationFrame(m)}}const U2e=u2e,Q2e=d2e,H2e=o2e,$2e=f2e,z2e=l2e,H$=a2e,W2e=A2e,G2e=(e,t,r)=>{const n=new Map,i={platform:M2e,...r},s={...i.platform,_c:n};return s2e(e,t,{...i,platform:s})};var K2e=typeof document<"u",V2e=function(){},RS=K2e?w.useLayoutEffect:V2e;function zB(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!zB(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&e.$$typeof)&&!zB(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Tre(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $$(e,t){const r=Tre(e);return Math.round(t*r)/r}function pP(e){const t=w.useRef(e);return RS(()=>{t.current=e}),t}function q2e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,A]=w.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=w.useState(n);zB(h,n)||f(n);const[m,p]=w.useState(null),[g,v]=w.useState(null),x=w.useCallback(Q=>{Q!==j.current&&(j.current=Q,p(Q))},[]),y=w.useCallback(Q=>{Q!==S.current&&(S.current=Q,v(Q))},[]),b=s||m,C=o||g,j=w.useRef(null),S=w.useRef(null),T=w.useRef(d),B=c!=null,I=pP(c),P=pP(i),E=pP(u),M=w.useCallback(()=>{if(!j.current||!S.current)return;const Q={placement:t,strategy:r,middleware:h};P.current&&(Q.platform=P.current),G2e(j.current,S.current,Q).then(z=>{const Y={...z,isPositioned:E.current!==!1};_.current&&!zB(T.current,Y)&&(T.current=Y,_g.flushSync(()=>{A(Y)}))})},[h,t,r,P,E]);RS(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,A(Q=>({...Q,isPositioned:!1})))},[u]);const _=w.useRef(!1);RS(()=>(_.current=!0,()=>{_.current=!1}),[]),RS(()=>{if(b&&(j.current=b),C&&(S.current=C),b&&C){if(I.current)return I.current(b,C,M);M()}},[b,C,M,I,B]);const R=w.useMemo(()=>({reference:j,floating:S,setReference:x,setFloating:y}),[x,y]),G=w.useMemo(()=>({reference:b,floating:C}),[b,C]),U=w.useMemo(()=>{const Q={position:r,left:0,top:0};if(!G.floating)return Q;const z=$$(G.floating,d.x),Y=$$(G.floating,d.y);return l?{...Q,transform:"translate("+z+"px, "+Y+"px)",...Tre(G.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:z,top:Y}},[r,l,G.floating,d.x,d.y]);return w.useMemo(()=>({...d,update:M,refs:R,elements:G,floatingStyles:U}),[d,M,R,G,U])}const X2e=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?H$({element:n.current,padding:i}).fn(r):{}:n?H$({element:n,padding:i}).fn(r):{}}}},Y2e=(e,t)=>({...U2e(e),options:[e,t]}),J2e=(e,t)=>({...Q2e(e),options:[e,t]}),Z2e=(e,t)=>({...W2e(e),options:[e,t]}),eCe=(e,t)=>({...H2e(e),options:[e,t]}),tCe=(e,t)=>({...$2e(e),options:[e,t]}),rCe=(e,t)=>({...z2e(e),options:[e,t]}),nCe=(e,t)=>({...X2e(e),options:[e,t]});var iCe="Arrow",Pre=w.forwardRef((e,t)=>{const{children:r,width:n=10,height:i=5,...s}=e;return a.jsx(at.svg,{...s,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Pre.displayName=iCe;var sCe=Pre;function wC(e){const[t,r]=w.useState(void 0);return Ai(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,l;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;r({width:o,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var F6="Popper",[Ire,j0]=Zi(F6),[aCe,Ore]=Ire(F6),Fre=e=>{const{__scopePopper:t,children:r}=e,[n,i]=w.useState(null);return a.jsx(aCe,{scope:t,anchor:n,onAnchorChange:i,children:r})};Fre.displayName=F6;var Lre="PopperAnchor",Mre=w.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,s=Ore(Lre,r),o=w.useRef(null),l=Jt(t,o);return w.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:a.jsx(at.div,{...i,ref:l})});Mre.displayName=Lre;var L6="PopperContent",[oCe,lCe]=Ire(L6),Dre=w.forwardRef((e,t)=>{var oe,pe,de,ge,ie,ue;const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:A="partial",hideWhenDetached:h=!1,updatePositionStrategy:f="optimized",onPlaced:m,...p}=e,g=Ore(L6,r),[v,x]=w.useState(null),y=Jt(t,Se=>x(Se)),[b,C]=w.useState(null),j=wC(b),S=(j==null?void 0:j.width)??0,T=(j==null?void 0:j.height)??0,B=n+(s!=="center"?"-"+s:""),I=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(u)?u:[u],E=P.length>0,M={padding:I,boundary:P.filter(uCe),altBoundary:E},{refs:_,floatingStyles:R,placement:G,isPositioned:U,middlewareData:Q}=q2e({strategy:"fixed",placement:B,whileElementsMounted:(...Se)=>R2e(...Se,{animationFrame:f==="always"}),elements:{reference:g.anchor},middleware:[Y2e({mainAxis:i+T,alignmentAxis:o}),c&&J2e({mainAxis:!0,crossAxis:!1,limiter:A==="partial"?Z2e():void 0,...M}),c&&eCe({...M}),tCe({...M,apply:({elements:Se,rects:D,availableWidth:K,availableHeight:we})=>{const{width:ae,height:te}=D.reference,ce=Se.floating.style;ce.setProperty("--radix-popper-available-width",`${K}px`),ce.setProperty("--radix-popper-available-height",`${we}px`),ce.setProperty("--radix-popper-anchor-width",`${ae}px`),ce.setProperty("--radix-popper-anchor-height",`${te}px`)}}),b&&nCe({element:b,padding:l}),dCe({arrowWidth:S,arrowHeight:T}),h&&rCe({strategy:"referenceHidden",...M})]}),[z,Y]=Qre(G),$=Li(m);Ai(()=>{U&&($==null||$())},[U,$]);const O=(oe=Q.arrow)==null?void 0:oe.x,W=(pe=Q.arrow)==null?void 0:pe.y,V=((de=Q.arrow)==null?void 0:de.centerOffset)!==0,[X,ne]=w.useState();return Ai(()=>{v&&ne(window.getComputedStyle(v).zIndex)},[v]),a.jsx("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:U?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(ge=Q.transformOrigin)==null?void 0:ge.x,(ie=Q.transformOrigin)==null?void 0:ie.y].join(" "),...((ue=Q.hide)==null?void 0:ue.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(oCe,{scope:r,placedSide:z,onArrowChange:C,arrowX:O,arrowY:W,shouldHideArrow:V,children:a.jsx(at.div,{"data-side":z,"data-align":Y,...p,ref:y,style:{...p.style,animation:U?void 0:"none"}})})})});Dre.displayName=L6;var Rre="PopperArrow",cCe={top:"bottom",right:"left",bottom:"top",left:"right"},Ure=w.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,s=lCe(Rre,n),o=cCe[s.placedSide];return a.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:a.jsx(sCe,{...i,ref:r,style:{...i.style,display:"block"}})})});Ure.displayName=Rre;function uCe(e){return e!==null}var dCe=e=>({name:"transformOrigin",options:e,fn(t){var g,v,x;const{placement:r,rects:n,middlewareData:i}=t,o=((g=i.arrow)==null?void 0:g.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=Qre(r),A={start:"0%",center:"50%",end:"100%"}[d],h=(((v=i.arrow)==null?void 0:v.x)??0)+l/2,f=(((x=i.arrow)==null?void 0:x.y)??0)+c/2;let m="",p="";return u==="bottom"?(m=o?A:`${h}px`,p=`${-c}px`):u==="top"?(m=o?A:`${h}px`,p=`${n.floating.height+c}px`):u==="right"?(m=`${-c}px`,p=o?A:`${f}px`):u==="left"&&(m=`${n.floating.width+c}px`,p=o?A:`${f}px`),{data:{x:m,y:p}}}});function Qre(e){const[t,r="center"]=e.split("-");return[t,r]}var M6=Fre,D6=Mre,R6=Dre,U6=Ure,[J5,qCt]=Zi("Tooltip",[j0]),Z5=j0(),Hre="TooltipProvider",ACe=700,cF="tooltip.open",[fCe,Q6]=J5(Hre),$re=e=>{const{__scopeTooltip:t,delayDuration:r=ACe,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:s}=e,o=w.useRef(!0),l=w.useRef(!1),c=w.useRef(0);return w.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(fCe,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:w.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:w.useCallback(u=>{l.current=u},[]),disableHoverableContent:i,children:s})};$re.displayName=Hre;var H1="Tooltip",[hCe,eE]=J5(H1),zre=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:i,onOpenChange:s,disableHoverableContent:o,delayDuration:l}=e,c=Q6(H1,e.__scopeTooltip),u=Z5(t),[d,A]=w.useState(null),h=lo(),f=w.useRef(0),m=o??c.disableHoverableContent,p=l??c.delayDuration,g=w.useRef(!1),[v,x]=fa({prop:n,defaultProp:i??!1,onChange:S=>{S?(c.onOpen(),document.dispatchEvent(new CustomEvent(cF))):c.onClose(),s==null||s(S)},caller:H1}),y=w.useMemo(()=>v?g.current?"delayed-open":"instant-open":"closed",[v]),b=w.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,x(!0)},[x]),C=w.useCallback(()=>{window.clearTimeout(f.current),f.current=0,x(!1)},[x]),j=w.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,x(!0),f.current=0},p)},[p,x]);return w.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),a.jsx(M6,{...u,children:a.jsx(hCe,{scope:t,contentId:h,open:v,stateAttribute:y,trigger:d,onTriggerChange:A,onTriggerEnter:w.useCallback(()=>{c.isOpenDelayedRef.current?j():b()},[c.isOpenDelayedRef,j,b]),onTriggerLeave:w.useCallback(()=>{m?C():(window.clearTimeout(f.current),f.current=0)},[C,m]),onOpen:b,onClose:C,disableHoverableContent:m,children:r})})};zre.displayName=H1;var uF="TooltipTrigger",Wre=w.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=eE(uF,r),s=Q6(uF,r),o=Z5(r),l=w.useRef(null),c=Jt(t,l,i.onTriggerChange),u=w.useRef(!1),d=w.useRef(!1),A=w.useCallback(()=>u.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",A),[A]),a.jsx(D6,{asChild:!0,...o,children:a.jsx(at.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:c,onPointerMove:Ye(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ye(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:Ye(e.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",A,{once:!0})}),onFocus:Ye(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:Ye(e.onBlur,i.onClose),onClick:Ye(e.onClick,i.onClose)})})});Wre.displayName=uF;var pCe="TooltipPortal",[XCt,mCe]=J5(pCe,{forceMount:void 0}),yy="TooltipContent",Gre=w.forwardRef((e,t)=>{const r=mCe(yy,e.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...s}=e,o=eE(yy,e.__scopeTooltip);return a.jsx(Gs,{present:n||o.open,children:o.disableHoverableContent?a.jsx(Kre,{side:i,...s,ref:t}):a.jsx(gCe,{side:i,...s,ref:t})})}),gCe=w.forwardRef((e,t)=>{const r=eE(yy,e.__scopeTooltip),n=Q6(yy,e.__scopeTooltip),i=w.useRef(null),s=Jt(t,i),[o,l]=w.useState(null),{trigger:c,onClose:u}=r,d=i.current,{onPointerInTransitChange:A}=n,h=w.useCallback(()=>{l(null),A(!1)},[A]),f=w.useCallback((m,p)=>{const g=m.currentTarget,v={x:m.clientX,y:m.clientY},x=wCe(v,g.getBoundingClientRect()),y=CCe(v,x),b=NCe(p.getBoundingClientRect()),C=SCe([...y,...b]);l(C),A(!0)},[A]);return w.useEffect(()=>()=>h(),[h]),w.useEffect(()=>{if(c&&d){const m=g=>f(g,d),p=g=>f(g,c);return c.addEventListener("pointerleave",m),d.addEventListener("pointerleave",p),()=>{c.removeEventListener("pointerleave",m),d.removeEventListener("pointerleave",p)}}},[c,d,f,h]),w.useEffect(()=>{if(o){const m=p=>{const g=p.target,v={x:p.clientX,y:p.clientY},x=(c==null?void 0:c.contains(g))||(d==null?void 0:d.contains(g)),y=!jCe(v,o);x?h():y&&(h(),u())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,d,o,u,h]),a.jsx(Kre,{...e,ref:s})}),[vCe,xCe]=J5(H1,{isInside:!1}),yCe=wte("TooltipContent"),Kre=w.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...l}=e,c=eE(yy,r),u=Z5(r),{onClose:d}=c;return w.useEffect(()=>(document.addEventListener(cF,d),()=>document.removeEventListener(cF,d)),[d]),w.useEffect(()=>{if(c.trigger){const A=h=>{const f=h.target;f!=null&&f.contains(c.trigger)&&d()};return window.addEventListener("scroll",A,{capture:!0}),()=>window.removeEventListener("scroll",A,{capture:!0})}},[c.trigger,d]),a.jsx(kg,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:A=>A.preventDefault(),onDismiss:d,children:a.jsxs(R6,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(yCe,{children:n}),a.jsx(vCe,{scope:r,isInside:!0,children:a.jsx(Bte,{id:c.contentId,role:"tooltip",children:i||n})})]})})});Gre.displayName=yy;var Vre="TooltipArrow",bCe=w.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=Z5(r);return xCe(Vre,r).isInside?null:a.jsx(U6,{...i,...n,ref:t})});bCe.displayName=Vre;function wCe(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,i,s)){case s:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function CCe(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function NCe(e){const{top:t,right:r,bottom:n,left:i}=e;return[{x:i,y:t},{x:r,y:t},{x:r,y:n},{x:i,y:n}]}function jCe(e,t){const{x:r,y:n}=e;let i=!1;for(let s=0,o=t.length-1;sn!=h>n&&r<(A-u)*(n-d)/(h-d)+u&&(i=!i)}return i}function SCe(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),BCe(t)}function BCe(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const i=e[n];for(;r.length>=2;){const s=r[r.length-1],o=r[r.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))r.pop();else break}r.push(i)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var _Ce=$re,kCe=zre,ECe=Wre,qre=Gre;const CC=_Ce,$c=kCe,zc=ECe,Xl=w.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(qre,{ref:n,sideOffset:t,className:Le("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));Xl.displayName=qre.displayName;var S0=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ng=typeof window>"u"||"Deno"in globalThis;function eo(){}function TCe(e,t){return typeof e=="function"?e(t):e}function dF(e){return typeof e=="number"&&e>=0&&e!==1/0}function Xre(e,t){return Math.max(e+(t||0)-Date.now(),0)}function yh(e,t){return typeof e=="function"?e(t):e}function Wl(e,t){return typeof e=="function"?e(t):e}function z$(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:l}=e;if(o){if(n){if(t.queryHash!==H6(o,t.options))return!1}else if(!$1(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||s&&!s(t))}function W$(e,t){const{exact:r,status:n,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(ig(t.options.mutationKey)!==ig(s))return!1}else if(!$1(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function H6(e,t){return((t==null?void 0:t.queryKeyHashFn)||ig)(e)}function ig(e){return JSON.stringify(e,(t,r)=>AF(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function $1(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>$1(e[r],t[r])):!1}function Yre(e,t){if(e===t)return e;const r=G$(e)&&G$(t);if(r||AF(e)&&AF(t)){const n=r?e:Object.keys(e),i=n.length,s=r?t:Object.keys(t),o=s.length,l=r?[]:{},c=new Set(n);let u=0;for(let d=0;d{setTimeout(t,e)})}function fF(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Yre(e,t):t}function ICe(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function OCe(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var $6=Symbol();function Jre(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===$6?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Zre(e,t){return typeof e=="function"?e(...t):!!e}var ym,Qf,Jx,YJ,FCe=(YJ=class extends S0{constructor(){super();Xt(this,ym);Xt(this,Qf);Xt(this,Jx);mt(this,Jx,t=>{if(!ng&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){Ne(this,Qf)||this.setEventListener(Ne(this,Jx))}onUnsubscribe(){var t;this.hasListeners()||((t=Ne(this,Qf))==null||t.call(this),mt(this,Qf,void 0))}setEventListener(t){var r;mt(this,Jx,t),(r=Ne(this,Qf))==null||r.call(this),mt(this,Qf,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){Ne(this,ym)!==t&&(mt(this,ym,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof Ne(this,ym)=="boolean"?Ne(this,ym):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ym=new WeakMap,Qf=new WeakMap,Jx=new WeakMap,YJ),z6=new FCe,Zx,Hf,ey,JJ,LCe=(JJ=class extends S0{constructor(){super();Xt(this,Zx,!0);Xt(this,Hf);Xt(this,ey);mt(this,ey,t=>{if(!ng&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){Ne(this,Hf)||this.setEventListener(Ne(this,ey))}onUnsubscribe(){var t;this.hasListeners()||((t=Ne(this,Hf))==null||t.call(this),mt(this,Hf,void 0))}setEventListener(t){var r;mt(this,ey,t),(r=Ne(this,Hf))==null||r.call(this),mt(this,Hf,t(this.setOnline.bind(this)))}setOnline(t){Ne(this,Zx)!==t&&(mt(this,Zx,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return Ne(this,Zx)}},Zx=new WeakMap,Hf=new WeakMap,ey=new WeakMap,JJ),GB=new LCe;function hF(){let e,t;const r=new Promise((i,s)=>{e=i,t=s});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}function MCe(e){return Math.min(1e3*2**e,3e4)}function ene(e){return(e??"online")==="online"?GB.isOnline():!0}var tne=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function mP(e){return e instanceof tne}function rne(e){let t=!1,r=0,n=!1,i;const s=hF(),o=p=>{var g;n||(h(new tne(p)),(g=e.abort)==null||g.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>z6.isFocused()&&(e.networkMode==="always"||GB.isOnline())&&e.canRun(),d=()=>ene(e.networkMode)&&e.canRun(),A=p=>{var g;n||(n=!0,(g=e.onSuccess)==null||g.call(e,p),i==null||i(),s.resolve(p))},h=p=>{var g;n||(n=!0,(g=e.onError)==null||g.call(e,p),i==null||i(),s.reject(p))},f=()=>new Promise(p=>{var g;i=v=>{(n||u())&&p(v)},(g=e.onPause)==null||g.call(e)}).then(()=>{var p;i=void 0,n||(p=e.onContinue)==null||p.call(e)}),m=()=>{if(n)return;let p;const g=r===0?e.initialPromise:void 0;try{p=g??e.fn()}catch(v){p=Promise.reject(v)}Promise.resolve(p).then(A).catch(v=>{var j;if(n)return;const x=e.retry??(ng?0:3),y=e.retryDelay??MCe,b=typeof y=="function"?y(r,v):y,C=x===!0||typeof x=="number"&&ru()?void 0:f()).then(()=>{t?h(v):m()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?m():f().then(m),s)}}var DCe=e=>setTimeout(e,0);function RCe(){let e=[],t=0,r=l=>{l()},n=l=>{l()},i=DCe;const s=l=>{t?e.push(l):i(()=>{r(l)})},o=()=>{const l=e;e=[],l.length&&i(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{s(()=>{l(...c)})},schedule:s,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{i=l}}}var Ss=RCe(),bm,ZJ,nne=(ZJ=class{constructor(){Xt(this,bm)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dF(this.gcTime)&&mt(this,bm,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ng?1/0:5*60*1e3))}clearGcTimeout(){Ne(this,bm)&&(clearTimeout(Ne(this,bm)),mt(this,bm,void 0))}},bm=new WeakMap,ZJ),ty,wm,$l,Cm,_a,aC,Nm,Lc,Xd,eZ,UCe=(eZ=class extends nne{constructor(t){super();Xt(this,Lc);Xt(this,ty);Xt(this,wm);Xt(this,$l);Xt(this,Cm);Xt(this,_a);Xt(this,aC);Xt(this,Nm);mt(this,Nm,!1),mt(this,aC,t.defaultOptions),this.setOptions(t.options),this.observers=[],mt(this,Cm,t.client),mt(this,$l,Ne(this,Cm).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,mt(this,ty,QCe(this.options)),this.state=t.state??Ne(this,ty),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=Ne(this,_a))==null?void 0:t.promise}setOptions(t){this.options={...Ne(this,aC),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Ne(this,$l).remove(this)}setData(t,r){const n=fF(this.state.data,t,this.options);return Tr(this,Lc,Xd).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Tr(this,Lc,Xd).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,i;const r=(n=Ne(this,_a))==null?void 0:n.promise;return(i=Ne(this,_a))==null||i.cancel(t),r?r.then(eo).catch(eo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Ne(this,ty))}isActive(){return this.observers.some(t=>Wl(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===$6||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>yh(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Xre(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=Ne(this,_a))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=Ne(this,_a))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Ne(this,$l).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(Ne(this,_a)&&(Ne(this,Nm)?Ne(this,_a).cancel({revert:!0}):Ne(this,_a).cancelRetry()),this.scheduleGc()),Ne(this,$l).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Tr(this,Lc,Xd).call(this,{type:"invalidate"})}fetch(t,r){var u,d,A;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(Ne(this,_a))return Ne(this,_a).continueRetry(),Ne(this,_a).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(f=>f.options.queryFn);h&&this.setOptions(h.options)}const n=new AbortController,i=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(mt(this,Nm,!0),n.signal)})},s=()=>{const h=Jre(this.options,r),m=(()=>{const p={client:Ne(this,Cm),queryKey:this.queryKey,meta:this.meta};return i(p),p})();return mt(this,Nm,!1),this.options.persister?this.options.persister(h,m,this):h(m)},l=(()=>{const h={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:Ne(this,Cm),state:this.state,fetchFn:s};return i(h),h})();(u=this.options.behavior)==null||u.onFetch(l,this),mt(this,wm,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&Tr(this,Lc,Xd).call(this,{type:"fetch",meta:(A=l.fetchOptions)==null?void 0:A.meta});const c=h=>{var f,m,p,g;mP(h)&&h.silent||Tr(this,Lc,Xd).call(this,{type:"error",error:h}),mP(h)||((m=(f=Ne(this,$l).config).onError)==null||m.call(f,h,this),(g=(p=Ne(this,$l).config).onSettled)==null||g.call(p,this.state.data,h,this)),this.scheduleGc()};return mt(this,_a,rne({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,abort:n.abort.bind(n),onSuccess:h=>{var f,m,p,g;if(h===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(v){c(v);return}(m=(f=Ne(this,$l).config).onSuccess)==null||m.call(f,h,this),(g=(p=Ne(this,$l).config).onSettled)==null||g.call(p,h,this.state.error,this),this.scheduleGc()},onError:c,onFail:(h,f)=>{Tr(this,Lc,Xd).call(this,{type:"failed",failureCount:h,error:f})},onPause:()=>{Tr(this,Lc,Xd).call(this,{type:"pause"})},onContinue:()=>{Tr(this,Lc,Xd).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),Ne(this,_a).start()}},ty=new WeakMap,wm=new WeakMap,$l=new WeakMap,Cm=new WeakMap,_a=new WeakMap,aC=new WeakMap,Nm=new WeakMap,Lc=new WeakSet,Xd=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...ine(n.data,this.options),fetchMeta:t.meta??null};case"success":return mt(this,wm,void 0),{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return mP(i)&&i.revert&&Ne(this,wm)?{...Ne(this,wm),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Ss.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),Ne(this,$l).notify({query:this,type:"updated",action:t})})},eZ);function ine(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ene(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function QCe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Iu,tZ,HCe=(tZ=class extends S0{constructor(t={}){super();Xt(this,Iu);this.config=t,mt(this,Iu,new Map)}build(t,r,n){const i=r.queryKey,s=r.queryHash??H6(i,r);let o=this.get(s);return o||(o=new UCe({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){Ne(this,Iu).has(t.queryHash)||(Ne(this,Iu).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=Ne(this,Iu).get(t.queryHash);r&&(t.destroy(),r===t&&Ne(this,Iu).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ss.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Ne(this,Iu).get(t)}getAll(){return[...Ne(this,Iu).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>z$(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>z$(t,n)):r}notify(t){Ss.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Ss.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ss.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Iu=new WeakMap,tZ),Ou,qa,jm,Fu,vf,rZ,$Ce=(rZ=class extends nne{constructor(t){super();Xt(this,Fu);Xt(this,Ou);Xt(this,qa);Xt(this,jm);this.mutationId=t.mutationId,mt(this,qa,t.mutationCache),mt(this,Ou,[]),this.state=t.state||sne(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Ne(this,Ou).includes(t)||(Ne(this,Ou).push(t),this.clearGcTimeout(),Ne(this,qa).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){mt(this,Ou,Ne(this,Ou).filter(r=>r!==t)),this.scheduleGc(),Ne(this,qa).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Ne(this,Ou).length||(this.state.status==="pending"?this.scheduleGc():Ne(this,qa).remove(this))}continue(){var t;return((t=Ne(this,jm))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,o,l,c,u,d,A,h,f,m,p,g,v,x,y,b,C,j,S,T;const r=()=>{Tr(this,Fu,vf).call(this,{type:"continue"})};mt(this,jm,rne({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(B,I)=>{Tr(this,Fu,vf).call(this,{type:"failed",failureCount:B,error:I})},onPause:()=>{Tr(this,Fu,vf).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Ne(this,qa).canRun(this)}));const n=this.state.status==="pending",i=!Ne(this,jm).canStart();try{if(n)r();else{Tr(this,Fu,vf).call(this,{type:"pending",variables:t,isPaused:i}),await((o=(s=Ne(this,qa).config).onMutate)==null?void 0:o.call(s,t,this));const I=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));I!==this.state.context&&Tr(this,Fu,vf).call(this,{type:"pending",context:I,variables:t,isPaused:i})}const B=await Ne(this,jm).start();return await((d=(u=Ne(this,qa).config).onSuccess)==null?void 0:d.call(u,B,t,this.state.context,this)),await((h=(A=this.options).onSuccess)==null?void 0:h.call(A,B,t,this.state.context)),await((m=(f=Ne(this,qa).config).onSettled)==null?void 0:m.call(f,B,null,this.state.variables,this.state.context,this)),await((g=(p=this.options).onSettled)==null?void 0:g.call(p,B,null,t,this.state.context)),Tr(this,Fu,vf).call(this,{type:"success",data:B}),B}catch(B){try{throw await((x=(v=Ne(this,qa).config).onError)==null?void 0:x.call(v,B,t,this.state.context,this)),await((b=(y=this.options).onError)==null?void 0:b.call(y,B,t,this.state.context)),await((j=(C=Ne(this,qa).config).onSettled)==null?void 0:j.call(C,void 0,B,this.state.variables,this.state.context,this)),await((T=(S=this.options).onSettled)==null?void 0:T.call(S,void 0,B,t,this.state.context)),B}finally{Tr(this,Fu,vf).call(this,{type:"error",error:B})}}finally{Ne(this,qa).runNext(this)}}},Ou=new WeakMap,qa=new WeakMap,jm=new WeakMap,Fu=new WeakSet,vf=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Ss.batch(()=>{Ne(this,Ou).forEach(n=>{n.onMutationUpdate(t)}),Ne(this,qa).notify({mutation:this,type:"updated",action:t})})},rZ);function sne(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var oA,Mc,oC,nZ,zCe=(nZ=class extends S0{constructor(t={}){super();Xt(this,oA);Xt(this,Mc);Xt(this,oC);this.config=t,mt(this,oA,new Set),mt(this,Mc,new Map),mt(this,oC,0)}build(t,r,n){const i=new $Ce({mutationCache:this,mutationId:++IN(this,oC)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){Ne(this,oA).add(t);const r=tj(t);if(typeof r=="string"){const n=Ne(this,Mc).get(r);n?n.push(t):Ne(this,Mc).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(Ne(this,oA).delete(t)){const r=tj(t);if(typeof r=="string"){const n=Ne(this,Mc).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&Ne(this,Mc).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=tj(t);if(typeof r=="string"){const n=Ne(this,Mc).get(r),i=n==null?void 0:n.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=tj(t);if(typeof r=="string"){const i=(n=Ne(this,Mc).get(r))==null?void 0:n.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ss.batch(()=>{Ne(this,oA).forEach(t=>{this.notify({type:"removed",mutation:t})}),Ne(this,oA).clear(),Ne(this,Mc).clear()})}getAll(){return Array.from(Ne(this,oA))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>W$(r,n))}findAll(t={}){return this.getAll().filter(r=>W$(t,r))}notify(t){Ss.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Ss.batch(()=>Promise.all(t.map(r=>r.continue().catch(eo))))}},oA=new WeakMap,Mc=new WeakMap,oC=new WeakMap,nZ);function tj(e){var t;return(t=e.options.scope)==null?void 0:t.id}function V$(e){return{onFetch:(t,r)=>{var d,A,h,f,m;const n=t.options,i=(h=(A=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:A.fetchMore)==null?void 0:h.direction,s=((f=t.state.data)==null?void 0:f.pages)||[],o=((m=t.state.data)==null?void 0:m.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let p=!1;const g=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},v=Jre(t.options,t.fetchOptions),x=async(y,b,C)=>{if(p)return Promise.reject();if(b==null&&y.pages.length)return Promise.resolve(y);const S=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:b,direction:C?"backward":"forward",meta:t.options.meta};return g(P),P})(),T=await v(S),{maxPages:B}=t.options,I=C?OCe:ICe;return{pages:I(y.pages,T,B),pageParams:I(y.pageParams,b,B)}};if(i&&s.length){const y=i==="backward",b=y?WCe:q$,C={pages:s,pageParams:o},j=b(n,C);l=await x(C,j,y)}else{const y=e??s.length;do{const b=c===0?o[0]??n.initialPageParam:q$(n,l);if(c>0&&b==null)break;l=await x(l,b),c++}while(c{var p,g;return(g=(p=t.options).persister)==null?void 0:g.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function q$(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function WCe(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Ei,$f,zf,ry,ny,Wf,iy,sy,iZ,GCe=(iZ=class{constructor(e={}){Xt(this,Ei);Xt(this,$f);Xt(this,zf);Xt(this,ry);Xt(this,ny);Xt(this,Wf);Xt(this,iy);Xt(this,sy);mt(this,Ei,e.queryCache||new HCe),mt(this,$f,e.mutationCache||new zCe),mt(this,zf,e.defaultOptions||{}),mt(this,ry,new Map),mt(this,ny,new Map),mt(this,Wf,0)}mount(){IN(this,Wf)._++,Ne(this,Wf)===1&&(mt(this,iy,z6.subscribe(async e=>{e&&(await this.resumePausedMutations(),Ne(this,Ei).onFocus())})),mt(this,sy,GB.subscribe(async e=>{e&&(await this.resumePausedMutations(),Ne(this,Ei).onOnline())})))}unmount(){var e,t;IN(this,Wf)._--,Ne(this,Wf)===0&&((e=Ne(this,iy))==null||e.call(this),mt(this,iy,void 0),(t=Ne(this,sy))==null||t.call(this),mt(this,sy,void 0))}isFetching(e){return Ne(this,Ei).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Ne(this,$f).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=Ne(this,Ei).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=Ne(this,Ei).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(yh(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return Ne(this,Ei).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=Ne(this,Ei).get(n.queryHash),s=i==null?void 0:i.state.data,o=TCe(t,s);if(o!==void 0)return Ne(this,Ei).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Ss.batch(()=>Ne(this,Ei).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=Ne(this,Ei).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=Ne(this,Ei);Ss.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=Ne(this,Ei);return Ss.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Ss.batch(()=>Ne(this,Ei).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(eo).catch(eo)}invalidateQueries(e,t={}){return Ss.batch(()=>(Ne(this,Ei).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Ss.batch(()=>Ne(this,Ei).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(eo)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(eo)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=Ne(this,Ei).build(this,t);return r.isStaleByTime(yh(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(eo).catch(eo)}fetchInfiniteQuery(e){return e.behavior=V$(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(eo).catch(eo)}ensureInfiniteQueryData(e){return e.behavior=V$(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return GB.isOnline()?Ne(this,$f).resumePausedMutations():Promise.resolve()}getQueryCache(){return Ne(this,Ei)}getMutationCache(){return Ne(this,$f)}getDefaultOptions(){return Ne(this,zf)}setDefaultOptions(e){mt(this,zf,e)}setQueryDefaults(e,t){Ne(this,ry).set(ig(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Ne(this,ry).values()],r={};return t.forEach(n=>{$1(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){Ne(this,ny).set(ig(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Ne(this,ny).values()],r={};return t.forEach(n=>{$1(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Ne(this,zf).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=H6(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===$6&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Ne(this,zf).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Ne(this,Ei).clear(),Ne(this,$f).clear()}},Ei=new WeakMap,$f=new WeakMap,zf=new WeakMap,ry=new WeakMap,ny=new WeakMap,Wf=new WeakMap,iy=new WeakMap,sy=new WeakMap,iZ),Co,Xr,lC,Xa,Sm,ay,Gf,Kf,cC,oy,ly,Bm,_m,Vf,cy,vn,cw,pF,mF,gF,vF,xF,yF,bF,ane,sZ,KCe=(sZ=class extends S0{constructor(t,r){super();Xt(this,vn);Xt(this,Co);Xt(this,Xr);Xt(this,lC);Xt(this,Xa);Xt(this,Sm);Xt(this,ay);Xt(this,Gf);Xt(this,Kf);Xt(this,cC);Xt(this,oy);Xt(this,ly);Xt(this,Bm);Xt(this,_m);Xt(this,Vf);Xt(this,cy,new Set);this.options=r,mt(this,Co,t),mt(this,Kf,null),mt(this,Gf,hF()),this.options.experimental_prefetchInRender||Ne(this,Gf).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Ne(this,Xr).addObserver(this),X$(Ne(this,Xr),this.options)?Tr(this,vn,cw).call(this):this.updateResult(),Tr(this,vn,vF).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wF(Ne(this,Xr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wF(Ne(this,Xr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Tr(this,vn,xF).call(this),Tr(this,vn,yF).call(this),Ne(this,Xr).removeObserver(this)}setOptions(t){const r=this.options,n=Ne(this,Xr);if(this.options=Ne(this,Co).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Wl(this.options.enabled,Ne(this,Xr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Tr(this,vn,bF).call(this),Ne(this,Xr).setOptions(this.options),r._defaulted&&!WB(this.options,r)&&Ne(this,Co).getQueryCache().notify({type:"observerOptionsUpdated",query:Ne(this,Xr),observer:this});const i=this.hasListeners();i&&Y$(Ne(this,Xr),n,this.options,r)&&Tr(this,vn,cw).call(this),this.updateResult(),i&&(Ne(this,Xr)!==n||Wl(this.options.enabled,Ne(this,Xr))!==Wl(r.enabled,Ne(this,Xr))||yh(this.options.staleTime,Ne(this,Xr))!==yh(r.staleTime,Ne(this,Xr)))&&Tr(this,vn,pF).call(this);const s=Tr(this,vn,mF).call(this);i&&(Ne(this,Xr)!==n||Wl(this.options.enabled,Ne(this,Xr))!==Wl(r.enabled,Ne(this,Xr))||s!==Ne(this,Vf))&&Tr(this,vn,gF).call(this,s)}getOptimisticResult(t){const r=Ne(this,Co).getQueryCache().build(Ne(this,Co),t),n=this.createResult(r,t);return qCe(this,n)&&(mt(this,Xa,n),mt(this,ay,this.options),mt(this,Sm,Ne(this,Xr).state)),n}getCurrentResult(){return Ne(this,Xa)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),Reflect.get(n,i))})}trackProp(t){Ne(this,cy).add(t)}getCurrentQuery(){return Ne(this,Xr)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=Ne(this,Co).defaultQueryOptions(t),n=Ne(this,Co).getQueryCache().build(Ne(this,Co),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Tr(this,vn,cw).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Ne(this,Xa)))}createResult(t,r){var B;const n=Ne(this,Xr),i=this.options,s=Ne(this,Xa),o=Ne(this,Sm),l=Ne(this,ay),u=t!==n?t.state:Ne(this,lC),{state:d}=t;let A={...d},h=!1,f;if(r._optimisticResults){const I=this.hasListeners(),P=!I&&X$(t,r),E=I&&Y$(t,n,r,i);(P||E)&&(A={...A,...ine(d.data,t.options)}),r._optimisticResults==="isRestoring"&&(A.fetchStatus="idle")}let{error:m,errorUpdatedAt:p,status:g}=A;f=A.data;let v=!1;if(r.placeholderData!==void 0&&f===void 0&&g==="pending"){let I;s!=null&&s.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(I=s.data,v=!0):I=typeof r.placeholderData=="function"?r.placeholderData((B=Ne(this,ly))==null?void 0:B.state.data,Ne(this,ly)):r.placeholderData,I!==void 0&&(g="success",f=fF(s==null?void 0:s.data,I,r),h=!0)}if(r.select&&f!==void 0&&!v)if(s&&f===(o==null?void 0:o.data)&&r.select===Ne(this,cC))f=Ne(this,oy);else try{mt(this,cC,r.select),f=r.select(f),f=fF(s==null?void 0:s.data,f,r),mt(this,oy,f),mt(this,Kf,null)}catch(I){mt(this,Kf,I)}Ne(this,Kf)&&(m=Ne(this,Kf),f=Ne(this,oy),p=Date.now(),g="error");const x=A.fetchStatus==="fetching",y=g==="pending",b=g==="error",C=y&&x,j=f!==void 0,T={status:g,fetchStatus:A.fetchStatus,isPending:y,isSuccess:g==="success",isError:b,isInitialLoading:C,isLoading:C,data:f,dataUpdatedAt:A.dataUpdatedAt,error:m,errorUpdatedAt:p,failureCount:A.fetchFailureCount,failureReason:A.fetchFailureReason,errorUpdateCount:A.errorUpdateCount,isFetched:A.dataUpdateCount>0||A.errorUpdateCount>0,isFetchedAfterMount:A.dataUpdateCount>u.dataUpdateCount||A.errorUpdateCount>u.errorUpdateCount,isFetching:x,isRefetching:x&&!y,isLoadingError:b&&!j,isPaused:A.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:b&&j,isStale:W6(t,r),refetch:this.refetch,promise:Ne(this,Gf),isEnabled:Wl(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const I=M=>{T.status==="error"?M.reject(T.error):T.data!==void 0&&M.resolve(T.data)},P=()=>{const M=mt(this,Gf,T.promise=hF());I(M)},E=Ne(this,Gf);switch(E.status){case"pending":t.queryHash===n.queryHash&&I(E);break;case"fulfilled":(T.status==="error"||T.data!==E.value)&&P();break;case"rejected":(T.status!=="error"||T.error!==E.reason)&&P();break}}return T}updateResult(){const t=Ne(this,Xa),r=this.createResult(Ne(this,Xr),this.options);if(mt(this,Sm,Ne(this,Xr).state),mt(this,ay,this.options),Ne(this,Sm).data!==void 0&&mt(this,ly,Ne(this,Xr)),WB(r,t))return;mt(this,Xa,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!Ne(this,cy).size)return!0;const o=new Set(s??Ne(this,cy));return this.options.throwOnError&&o.add("error"),Object.keys(Ne(this,Xa)).some(l=>{const c=l;return Ne(this,Xa)[c]!==t[c]&&o.has(c)})};Tr(this,vn,ane).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Tr(this,vn,vF).call(this)}},Co=new WeakMap,Xr=new WeakMap,lC=new WeakMap,Xa=new WeakMap,Sm=new WeakMap,ay=new WeakMap,Gf=new WeakMap,Kf=new WeakMap,cC=new WeakMap,oy=new WeakMap,ly=new WeakMap,Bm=new WeakMap,_m=new WeakMap,Vf=new WeakMap,cy=new WeakMap,vn=new WeakSet,cw=function(t){Tr(this,vn,bF).call(this);let r=Ne(this,Xr).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(eo)),r},pF=function(){Tr(this,vn,xF).call(this);const t=yh(this.options.staleTime,Ne(this,Xr));if(ng||Ne(this,Xa).isStale||!dF(t))return;const n=Xre(Ne(this,Xa).dataUpdatedAt,t)+1;mt(this,Bm,setTimeout(()=>{Ne(this,Xa).isStale||this.updateResult()},n))},mF=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Ne(this,Xr)):this.options.refetchInterval)??!1},gF=function(t){Tr(this,vn,yF).call(this),mt(this,Vf,t),!(ng||Wl(this.options.enabled,Ne(this,Xr))===!1||!dF(Ne(this,Vf))||Ne(this,Vf)===0)&&mt(this,_m,setInterval(()=>{(this.options.refetchIntervalInBackground||z6.isFocused())&&Tr(this,vn,cw).call(this)},Ne(this,Vf)))},vF=function(){Tr(this,vn,pF).call(this),Tr(this,vn,gF).call(this,Tr(this,vn,mF).call(this))},xF=function(){Ne(this,Bm)&&(clearTimeout(Ne(this,Bm)),mt(this,Bm,void 0))},yF=function(){Ne(this,_m)&&(clearInterval(Ne(this,_m)),mt(this,_m,void 0))},bF=function(){const t=Ne(this,Co).getQueryCache().build(Ne(this,Co),this.options);if(t===Ne(this,Xr))return;const r=Ne(this,Xr);mt(this,Xr,t),mt(this,lC,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},ane=function(t){Ss.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(Ne(this,Xa))}),Ne(this,Co).getQueryCache().notify({query:Ne(this,Xr),type:"observerResultsUpdated"})})},sZ);function VCe(e,t){return Wl(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function X$(e,t){return VCe(e,t)||e.state.data!==void 0&&wF(e,t,t.refetchOnMount)}function wF(e,t,r){if(Wl(t.enabled,e)!==!1&&yh(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&W6(e,t)}return!1}function Y$(e,t,r,n){return(e!==t||Wl(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&W6(e,r)}function W6(e,t){return Wl(t.enabled,e)!==!1&&e.isStaleByTime(yh(t.staleTime,e))}function qCe(e,t){return!WB(e.getCurrentResult(),t)}var qf,Xf,No,lA,jA,US,CF,aZ,XCe=(aZ=class extends S0{constructor(r,n){super();Xt(this,jA);Xt(this,qf);Xt(this,Xf);Xt(this,No);Xt(this,lA);mt(this,qf,r),this.setOptions(n),this.bindMethods(),Tr(this,jA,US).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var i;const n=this.options;this.options=Ne(this,qf).defaultMutationOptions(r),WB(this.options,n)||Ne(this,qf).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Ne(this,No),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&ig(n.mutationKey)!==ig(this.options.mutationKey)?this.reset():((i=Ne(this,No))==null?void 0:i.state.status)==="pending"&&Ne(this,No).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=Ne(this,No))==null||r.removeObserver(this)}onMutationUpdate(r){Tr(this,jA,US).call(this),Tr(this,jA,CF).call(this,r)}getCurrentResult(){return Ne(this,Xf)}reset(){var r;(r=Ne(this,No))==null||r.removeObserver(this),mt(this,No,void 0),Tr(this,jA,US).call(this),Tr(this,jA,CF).call(this)}mutate(r,n){var i;return mt(this,lA,n),(i=Ne(this,No))==null||i.removeObserver(this),mt(this,No,Ne(this,qf).getMutationCache().build(Ne(this,qf),this.options)),Ne(this,No).addObserver(this),Ne(this,No).execute(r)}},qf=new WeakMap,Xf=new WeakMap,No=new WeakMap,lA=new WeakMap,jA=new WeakSet,US=function(){var n;const r=((n=Ne(this,No))==null?void 0:n.state)??sne();mt(this,Xf,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},CF=function(r){Ss.batch(()=>{var n,i,s,o,l,c,u,d;if(Ne(this,lA)&&this.hasListeners()){const A=Ne(this,Xf).variables,h=Ne(this,Xf).context;(r==null?void 0:r.type)==="success"?((i=(n=Ne(this,lA)).onSuccess)==null||i.call(n,r.data,A,h),(o=(s=Ne(this,lA)).onSettled)==null||o.call(s,r.data,null,A,h)):(r==null?void 0:r.type)==="error"&&((c=(l=Ne(this,lA)).onError)==null||c.call(l,r.error,A,h),(d=(u=Ne(this,lA)).onSettled)==null||d.call(u,void 0,r.error,A,h))}this.listeners.forEach(A=>{A(Ne(this,Xf))})})},aZ),one=w.createContext(void 0),B0=e=>{const t=w.useContext(one);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},YCe=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(one.Provider,{value:e,children:t})),lne=w.createContext(!1),JCe=()=>w.useContext(lne);lne.Provider;function ZCe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var eNe=w.createContext(ZCe()),tNe=()=>w.useContext(eNe),rNe=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},nNe=e=>{w.useEffect(()=>{e.clearReset()},[e])},iNe=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||Zre(r,[e.error,n])),sNe=e=>{if(e.suspense){const t=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>t(r(...n)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},aNe=(e,t)=>e.isLoading&&e.isFetching&&!t,oNe=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,J$=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function lNe(e,t,r){var A,h,f,m,p;const n=JCe(),i=tNe(),s=B0(),o=s.defaultQueryOptions(e);(h=(A=s.getDefaultOptions().queries)==null?void 0:A._experimental_beforeQuery)==null||h.call(A,o),o._optimisticResults=n?"isRestoring":"optimistic",sNe(o),rNe(o,i),nNe(i);const l=!s.getQueryCache().get(o.queryHash),[c]=w.useState(()=>new t(s,o)),u=c.getOptimisticResult(o),d=!n&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(g=>{const v=d?c.subscribe(Ss.batchCalls(g)):eo;return c.updateResult(),v},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),w.useEffect(()=>{c.setOptions(o)},[o,c]),oNe(o,u))throw J$(o,c,i);if(iNe({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((m=(f=s.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||m.call(f,o,u),o.experimental_prefetchInRender&&!ng&&aNe(u,n)){const g=l?J$(o,c,i):(p=s.getQueryCache().get(o.queryHash))==null?void 0:p.promise;g==null||g.catch(eo).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function Pm(e,t){return lNe(e,KCe)}function cNe(e,t){const r=B0(),[n]=w.useState(()=>new XCe(r,e));w.useEffect(()=>{n.setOptions(e)},[n,e]);const i=w.useSyncExternalStore(w.useCallback(o=>n.subscribe(Ss.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=w.useCallback((o,l)=>{n.mutate(o,l).catch(eo)},[n]);if(i.error&&Zre(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}/** * @remix-run/router v1.23.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function z1(){return z1=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function cne(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function dNe(){return Math.random().toString(36).substr(2,8)}function ez(e,t){return{usr:e.state,key:e.key,idx:t}}function NF(e,t,r,n){return r===void 0&&(r=null),z1({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?_0(t):t,{state:r,key:t&&t.key||n||dNe()})}function KB(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function _0(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function ANe(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,o=i.history,l=eh.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(z1({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function A(){l=eh.Pop;let g=d(),v=g==null?null:g-u;u=g,c&&c({action:l,location:p.location,delta:v})}function h(g,v){l=eh.Push;let x=NF(p.location,g,v);u=d()+1;let y=ez(x,u),b=p.createHref(x);try{o.pushState(y,"",b)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;i.location.assign(b)}s&&c&&c({action:l,location:p.location,delta:1})}function f(g,v){l=eh.Replace;let x=NF(p.location,g,v);u=d();let y=ez(x,u),b=p.createHref(x);o.replaceState(y,"",b),s&&c&&c({action:l,location:p.location,delta:0})}function m(g){let v=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof g=="string"?g:KB(g);return x=x.replace(/ $/,"%20"),Yi(v,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,v)}let p={get action(){return l},get location(){return e(i,o)},listen(g){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(Z$,A),c=g,()=>{i.removeEventListener(Z$,A),c=null}},createHref(g){return t(i,g)},createURL:m,encodeLocation(g){let v=m(g);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:f,go(g){return o.go(g)}};return p}var tz;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(tz||(tz={}));function fNe(e,t,r){return r===void 0&&(r="/"),hNe(e,t,r,!1)}function hNe(e,t,r,n){let i=typeof t=="string"?_0(t):t,s=G6(i.pathname||"/",r);if(s==null)return null;let o=une(e);pNe(o);let l=null;for(let c=0;l==null&&c{let c={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};c.relativePath.startsWith("/")&&(Yi(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=bh([n,c.relativePath]),d=r.concat(c);s.children&&s.children.length>0&&(Yi(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),une(s.children,t,d,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:wNe(u,s.index),routesMeta:d})};return e.forEach((s,o)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))i(s,o);else for(let c of dne(s.path))i(s,o,c)}),t}function dne(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let o=dne(n.join("/")),l=[];return l.push(...o.map(c=>c===""?s:[s,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function pNe(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:CNe(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const mNe=/^:[\w-]+$/,gNe=3,vNe=2,xNe=1,yNe=10,bNe=-2,rz=e=>e==="*";function wNe(e,t){let r=e.split("/"),n=r.length;return r.some(rz)&&(n+=bNe),t&&(n+=vNe),r.filter(i=>!rz(i)).reduce((i,s)=>i+(mNe.test(s)?gNe:s===""?xNe:yNe),n)}function CNe(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function NNe(e,t,r){let{routesMeta:n}=e,i={},s="/",o=[];for(let l=0;l{let{paramName:h,isOptional:f}=d;if(h==="*"){let p=l[A]||"";o=s.slice(0,s.length-p.length).replace(/(.)\/+$/,"$1")}const m=l[A];return f&&!m?u[h]=void 0:u[h]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:e}}function jNe(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),cne(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function SNe(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return cne(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function G6(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function BNe(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?_0(e):e;return{pathname:r?r.startsWith("/")?r:_Ne(r,t):t,search:TNe(n),hash:PNe(i)}}function _Ne(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function gP(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function kNe(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function K6(e,t){let r=kNe(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function V6(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=_0(e):(i=z1({},e),Yi(!i.pathname||!i.pathname.includes("?"),gP("?","pathname","search",i)),Yi(!i.pathname||!i.pathname.includes("#"),gP("#","pathname","hash",i)),Yi(!i.search||!i.search.includes("#"),gP("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,l;if(o==null)l=r;else{let A=t.length-1;if(!n&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),A-=1;i.pathname=h.join("/")}l=A>=0?t[A]:"/"}let c=BNe(i,l),u=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const bh=e=>e.join("/").replace(/\/\/+/g,"/"),ENe=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),TNe=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,PNe=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function INe(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ane=["post","put","patch","delete"];new Set(Ane);const ONe=["get",...Ane];new Set(ONe);/** * React Router v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function W1(){return W1=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),w.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let A=V6(u,JSON.parse(o),s,d.relative==="path");e==null&&t!=="/"&&(A.pathname=A.pathname==="/"?t:bh([t,A.pathname])),(d.replace?n.replace:n.push)(A,d.state,d)},[t,n,o,s,e])}function NC(){let{matches:e}=w.useContext(DA),t=e[e.length-1];return t?t.params:{}}function pne(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=w.useContext(ep),{matches:i}=w.useContext(DA),{pathname:s}=Ad(),o=JSON.stringify(K6(i,n.v7_relativeSplatPath));return w.useMemo(()=>V6(e,JSON.parse(o),s,r==="path"),[e,o,s,r])}function DNe(e,t){return RNe(e,t)}function RNe(e,t,r,n){k0()||Yi(!1);let{navigator:i}=w.useContext(ep),{matches:s}=w.useContext(DA),o=s[s.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Ad(),d;if(t){var A;let g=typeof t=="string"?_0(t):t;c==="/"||(A=g.pathname)!=null&&A.startsWith(c)||Yi(!1),d=g}else d=u;let h=d.pathname||"/",f=h;if(c!=="/"){let g=c.replace(/^\//,"").split("/");f="/"+h.replace(/^\//,"").split("/").slice(g.length).join("/")}let m=fNe(e,{pathname:f}),p=zNe(m&&m.map(g=>Object.assign({},g,{params:Object.assign({},l,g.params),pathname:bh([c,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?c:bh([c,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),s,r,n);return t&&p?w.createElement(tE.Provider,{value:{location:W1({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:eh.Pop}},p):p}function UNe(){let e=VNe(),t=INe(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),r?w.createElement("pre",{style:i},r):null,null)}const QNe=w.createElement(UNe,null);class HNe extends w.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?w.createElement(DA.Provider,{value:this.props.routeContext},w.createElement(fne.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function $Ne(e){let{routeContext:t,match:r,children:n}=e,i=w.useContext(q6);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),w.createElement(DA.Provider,{value:t},n)}function zNe(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var s;if(!r)return null;if(r.errors)e=r.matches;else if((s=n)!=null&&s.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=(i=r)==null?void 0:i.errors;if(l!=null){let d=o.findIndex(A=>A.route.id&&(l==null?void 0:l[A.route.id])!==void 0);d>=0||Yi(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,A,h)=>{let f,m=!1,p=null,g=null;r&&(f=l&&A.route.id?l[A.route.id]:void 0,p=A.route.errorElement||QNe,c&&(u<0&&h===0?(m=!0,g=null):u===h&&(m=!0,g=A.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,h+1)),x=()=>{let y;return f?y=p:m?y=g:A.route.Component?y=w.createElement(A.route.Component,null):A.route.element?y=A.route.element:y=d,w.createElement($Ne,{match:A,routeContext:{outlet:d,matches:v,isDataRoute:r!=null},children:y})};return r&&(A.route.ErrorBoundary||A.route.errorElement||h===0)?w.createElement(HNe,{location:r.location,revalidation:r.revalidation,component:p,error:f,children:x(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):x()},null)}var mne=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(mne||{}),VB=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(VB||{});function WNe(e){let t=w.useContext(q6);return t||Yi(!1),t}function GNe(e){let t=w.useContext(FNe);return t||Yi(!1),t}function KNe(e){let t=w.useContext(DA);return t||Yi(!1),t}function gne(e){let t=KNe(),r=t.matches[t.matches.length-1];return r.route.id||Yi(!1),r.route.id}function VNe(){var e;let t=w.useContext(fne),r=GNe(VB.UseRouteError),n=gne(VB.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function qNe(){let{router:e}=WNe(mne.UseNavigateStable),t=gne(VB.UseNavigateStable),r=w.useRef(!1);return hne(()=>{r.current=!0}),w.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,W1({fromRouteId:t},s)))},[e,t])}function XNe(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function YNe(e){let{to:t,replace:r,state:n,relative:i}=e;k0()||Yi(!1);let{future:s,static:o}=w.useContext(ep),{matches:l}=w.useContext(DA),{pathname:c}=Ad(),u=hs(),d=V6(t,K6(l,s.v7_relativeSplatPath),c,i==="path"),A=JSON.stringify(d);return w.useEffect(()=>u(JSON.parse(A),{replace:r,state:n,relative:i}),[u,A,i,r,n]),null}function an(e){Yi(!1)}function JNe(e){let{basename:t="/",children:r=null,location:n,navigationType:i=eh.Pop,navigator:s,static:o=!1,future:l}=e;k0()&&Yi(!1);let c=t.replace(/^\/*/,"/"),u=w.useMemo(()=>({basename:c,navigator:s,static:o,future:W1({v7_relativeSplatPath:!1},l)}),[c,l,s,o]);typeof n=="string"&&(n=_0(n));let{pathname:d="/",search:A="",hash:h="",state:f=null,key:m="default"}=n,p=w.useMemo(()=>{let g=G6(d,c);return g==null?null:{location:{pathname:g,search:A,hash:h,state:f,key:m},navigationType:i}},[c,d,A,h,f,m,i]);return p==null?null:w.createElement(ep.Provider,{value:u},w.createElement(tE.Provider,{children:r,value:p}))}function ZNe(e){let{children:t,location:r}=e;return DNe(jF(t),r)}new Promise(()=>{});function jF(e,t){t===void 0&&(t=[]);let r=[];return w.Children.forEach(e,(n,i)=>{if(!w.isValidElement(n))return;let s=[...t,i];if(n.type===w.Fragment){r.push.apply(r,jF(n.props.children,s));return}n.type!==an&&Yi(!1),!n.props.index||!n.props.children||Yi(!1);let o={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=jF(n.props.children,s)),r.push(o)}),r}/** * React Router DOM v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function SF(){return SF=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function tje(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function rje(e,t){return e.button===0&&(!t||t==="_self")&&!tje(e)}function BF(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function nje(e,t){let r=BF(e);return t&&t.forEach((n,i)=>{r.has(i)||t.getAll(i).forEach(s=>{r.append(i,s)})}),r}const ije=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],sje="6";try{window.__reactRouterVersion=sje}catch{}const aje="startTransition",iz=CR[aje];function oje(e){let{basename:t,children:r,future:n,window:i}=e,s=w.useRef();s.current==null&&(s.current=uNe({window:i,v5Compat:!0}));let o=s.current,[l,c]=w.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},d=w.useCallback(A=>{u&&iz?iz(()=>c(A)):c(A)},[c,u]);return w.useLayoutEffect(()=>o.listen(d),[o,d]),w.useEffect(()=>XNe(n),[n]),w.createElement(JNe,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}const lje=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cje=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Et=w.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:s,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:A}=t,h=eje(t,ije),{basename:f}=w.useContext(ep),m,p=!1;if(typeof u=="string"&&cje.test(u)&&(m=u,lje))try{let y=new URL(window.location.href),b=u.startsWith("//")?new URL(y.protocol+u):new URL(u),C=G6(b.pathname,f);b.origin===y.origin&&C!=null?u=C+b.search+b.hash:p=!0}catch{}let g=LNe(u,{relative:i}),v=uje(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:A});function x(y){n&&n(y),y.defaultPrevented||v(y)}return w.createElement("a",SF({},h,{href:m||g,onClick:p||s?n:x,ref:r,target:c}))});var sz;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(sz||(sz={}));var az;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(az||(az={}));function uje(e,t){let{target:r,replace:n,state:i,preventScrollReset:s,relative:o,viewTransition:l}=t===void 0?{}:t,c=hs(),u=Ad(),d=pne(e,{relative:o});return w.useCallback(A=>{if(rje(A,r)){A.preventDefault();let h=n!==void 0?n:KB(u)===KB(d);c(e,{replace:h,state:i,preventScrollReset:s,relative:o,viewTransition:l})}},[u,c,d,n,i,r,e,s,o,l])}function dje(e){let t=w.useRef(BF(e)),r=w.useRef(!1),n=Ad(),i=w.useMemo(()=>nje(n.search,r.current?null:t.current),[n.search]),s=hs(),o=w.useCallback((l,c)=>{const u=BF(typeof l=="function"?l(i):l);r.current=!0,s("?"+u,c)},[s,i]);return[i,o]}var Aje=typeof Element<"u",fje=typeof Map=="function",hje=typeof Set=="function",pje=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function QS(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!QS(e[n],t[n]))return!1;return!0}var s;if(fje&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(s=e.entries();!(n=s.next()).done;)if(!t.has(n.value[0]))return!1;for(s=e.entries();!(n=s.next()).done;)if(!QS(n.value[1],t.get(n.value[0])))return!1;return!0}if(hje&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(s=e.entries();!(n=s.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(pje&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[n]))return!1;if(Aje&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&e.$$typeof)&&!QS(e[i[n]],t[i[n]]))return!1;return!0}return e!==e&&t!==t}var mje=function(t,r){try{return QS(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const gje=en(mje);var vje=function(e,t,r,n,i,s,o,l){if(!e){var c;if(t===void 0)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,i,s,o,l],d=0;c=new Error(t.replace(/%s/g,function(){return u[d++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}},xje=vje;const oz=en(xje);var yje=function(t,r,n,i){var s=n?n.call(i,t,r):void 0;if(s!==void 0)return!!s;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var o=Object.keys(t),l=Object.keys(r);if(o.length!==l.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(r),u=0;u(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(vne||{}),vP={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},lz=Object.values(vne),X6={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},wje=Object.entries(X6).reduce((e,[t,r])=>(e[r]=t,e),{}),Vc="data-rh",Fx={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Lx=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},Cje=e=>{let t=Lx(e,"title");const r=Lx(e,Fx.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=Lx(e,Fx.DEFAULT_TITLE);return t||n||void 0},Nje=e=>Lx(e,Fx.ON_CHANGE_CLIENT_STATE)||(()=>{}),xP=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),jje=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const i=Object.keys(n);for(let s=0;sconsole&&typeof console.warn=="function"&&console.warn(e),Ib=(e,t,r)=>{const n={};return r.filter(i=>Array.isArray(i[e])?!0:(typeof i[e]<"u"&&Sje(`Helmet: ${e} should be of type "Array". Instead found type "${typeof i[e]}"`),!1)).map(i=>i[e]).reverse().reduce((i,s)=>{const o={};s.filter(c=>{let u;const d=Object.keys(c);for(let h=0;hi.push(c));const l=Object.keys(o);for(let c=0;c{if(Array.isArray(e)&&e.length){for(let r=0;r({baseTag:jje(["href"],e),bodyAttributes:xP("bodyAttributes",e),defer:Lx(e,Fx.DEFER),encode:Lx(e,Fx.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:xP("htmlAttributes",e),linkTags:Ib("link",["rel","href"],e),metaTags:Ib("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:Ib("noscript",["innerHTML"],e),onChangeClientState:Nje(e),scriptTags:Ib("script",["src","innerHTML"],e),styleTags:Ib("style",["cssText"],e),title:Cje(e),titleAttributes:xP("titleAttributes",e),prioritizeSeoTags:Bje(e,Fx.PRIORITIZE_SEO_TAGS)}),xne=e=>Array.isArray(e)?e.join(""):e,kje=(e,t)=>{const r=Object.keys(e);for(let n=0;nArray.isArray(e)?e.reduce((r,n)=>(kje(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},cz=(e,t)=>({...e,[t]:void 0}),Eje=["noscript","script","style"],_F=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),yne=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),Tje=(e,t,r,n)=>{const i=yne(r),s=xne(t);return i?`<${e} ${Vc}="true" ${i}>${_F(s,n)}`:`<${e} ${Vc}="true">${_F(s,n)}`},Pje=(e,t,r=!0)=>t.reduce((n,i)=>{const s=i,o=Object.keys(s).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,d)=>{const A=typeof s[d]>"u"?d:`${d}="${_F(s[d],r)}"`;return u?`${u} ${A}`:A},""),l=s.innerHTML||s.cssText||"",c=Eje.indexOf(e)===-1;return`${n}<${e} ${Vc}="true" ${o}${c?"/>":`>${l}`}`},""),bne=(e,t={})=>Object.keys(e).reduce((r,n)=>{const i=X6[n];return r[i||n]=e[n],r},t),Ije=(e,t,r)=>{const n={key:t,[Vc]:!0},i=bne(r,n);return[re.createElement("title",i,t)]},HS=(e,t)=>t.map((r,n)=>{const i={key:n,[Vc]:!0};return Object.keys(r).forEach(s=>{const l=X6[s]||s;if(l==="innerHTML"||l==="cssText"){const c=r.innerHTML||r.cssText;i.dangerouslySetInnerHTML={__html:c}}else i[l]=r[s]}),re.createElement(e,i)}),Ql=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>Ije(e,t.title,t.titleAttributes),toString:()=>Tje(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>bne(t),toString:()=>yne(t)};default:return{toComponent:()=>HS(e,t),toString:()=>Pje(e,t,r)}}},Oje=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const i=yP(e,vP.meta),s=yP(t,vP.link),o=yP(r,vP.script);return{priorityMethods:{toComponent:()=>[...HS("meta",i.priority),...HS("link",s.priority),...HS("script",o.priority)],toString:()=>`${Ql("meta",i.priority,n)} ${Ql("link",s.priority,n)} ${Ql("script",o.priority,n)}`},metaTags:i.default,linkTags:s.default,scriptTags:o.default}},Fje=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:i,noscriptTags:s,styleTags:o,title:l="",titleAttributes:c,prioritizeSeoTags:u}=e;let{linkTags:d,metaTags:A,scriptTags:h}=e,f={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:f,linkTags:d,metaTags:A,scriptTags:h}=Oje(e)),{priority:f,base:Ql("base",t,n),bodyAttributes:Ql("bodyAttributes",r,n),htmlAttributes:Ql("htmlAttributes",i,n),link:Ql("link",d,n),meta:Ql("meta",A,n),noscript:Ql("noscript",s,n),script:Ql("script",h,n),style:Ql("style",o,n),title:Ql("title",{title:l,titleAttributes:c},n)}},kF=Fje,rj=[],wne=!!(typeof window<"u"&&window.document&&window.document.createElement),EF=class{constructor(e,t){Rr(this,"instances",[]);Rr(this,"canUseDOM",wne);Rr(this,"context");Rr(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?rj:this.instances,add:e=>{(this.canUseDOM?rj:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?rj:this.instances).indexOf(e);(this.canUseDOM?rj:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=kF({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Lje={},Cne=re.createContext(Lje),km,Nne=(km=class extends w.Component{constructor(r){super(r);Rr(this,"helmetData");this.helmetData=new EF(this.props.context||{},km.canUseDOM)}render(){return re.createElement(Cne.Provider,{value:this.helmetData.value},this.props.children)}},Rr(km,"canUseDOM",wne),km),lv=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${Vc}]`),i=[].slice.call(n),s=[];let o;return t&&t.length&&t.forEach(l=>{const c=document.createElement(e);for(const u in l)if(Object.prototype.hasOwnProperty.call(l,u))if(u==="innerHTML")c.innerHTML=l.innerHTML;else if(u==="cssText")c.styleSheet?c.styleSheet.cssText=l.cssText:c.appendChild(document.createTextNode(l.cssText));else{const d=u,A=typeof l[d]>"u"?"":l[d];c.setAttribute(u,A)}c.setAttribute(Vc,"true"),i.some((u,d)=>(o=d,c.isEqualNode(u)))?i.splice(o,1):s.push(c)}),i.forEach(l=>{var c;return(c=l.parentNode)==null?void 0:c.removeChild(l)}),s.forEach(l=>r.appendChild(l)),{oldTags:i,newTags:s}},TF=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(Vc),i=n?n.split(","):[],s=[...i],o=Object.keys(t);for(const l of o){const c=t[l]||"";r.getAttribute(l)!==c&&r.setAttribute(l,c),i.indexOf(l)===-1&&i.push(l);const u=s.indexOf(l);u!==-1&&s.splice(u,1)}for(let l=s.length-1;l>=0;l-=1)r.removeAttribute(s[l]);i.length===s.length?r.removeAttribute(Vc):r.getAttribute(Vc)!==o.join(",")&&r.setAttribute(Vc,o.join(","))},Mje=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=xne(e)),TF("title",t)},uz=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:i,linkTags:s,metaTags:o,noscriptTags:l,onChangeClientState:c,scriptTags:u,styleTags:d,title:A,titleAttributes:h}=e;TF("body",n),TF("html",i),Mje(A,h);const f={baseTag:lv("base",r),linkTags:lv("link",s),metaTags:lv("meta",o),noscriptTags:lv("noscript",l),scriptTags:lv("script",u),styleTags:lv("style",d)},m={},p={};Object.keys(f).forEach(g=>{const{newTags:v,oldTags:x}=f[g];v.length&&(m[g]=v),x.length&&(p[g]=f[g].oldTags)}),t&&t(),c(e,m,p)},Ob=null,Dje=e=>{Ob&&cancelAnimationFrame(Ob),e.defer?Ob=requestAnimationFrame(()=>{uz(e,()=>{Ob=null})}):(uz(e),Ob=null)},Rje=Dje,dz=class extends w.Component{constructor(){super(...arguments);Rr(this,"rendered",!1)}shouldComponentUpdate(t){return!bje(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const i=_je(t.get().map(s=>{const o={...s.props};return delete o.context,o}));Nne.canUseDOM?Rje(i):kF&&(n=kF(i)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},aO,jne=(aO=class extends w.Component{shouldComponentUpdate(e){return!gje(cz(this.props,"helmetData"),cz(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return oz(lz.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${lz.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),oz(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`} ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return re.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:i,...s}=n.props,o=Object.keys(s).reduce((c,u)=>(c[wje[u]||u]=s[u],c),{});let{type:l}=n;switch(typeof l=="symbol"?l=l.toString():this.warnOnInvalidChildren(n,i),l){case"Symbol(react.fragment)":t=this.mapChildrenToProps(i,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,o,i);break;default:t=this.mapObjectTypeChildren(n,t,o,i);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof EF)){const i=n;n=new EF(i.context,!0),delete r.helmetData}return n?re.createElement(dz,{...r,context:n.value}):re.createElement(Cne.Consumer,null,i=>re.createElement(dz,{...r,context:i}))}},Rr(aO,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),aO);const G1=Jh("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary-dark shadow-md hover:shadow-lg transition-all duration-200",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",hero:"bg-primary text-primary-foreground hover:bg-primary-dark shadow-lg hover:shadow-xl transition-all duration-300 hover:-translate-y-0.5",accent:"bg-accent text-accent-foreground hover:bg-accent-light shadow-md hover:shadow-lg transition-all duration-200"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ve=w.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...i},s)=>{const o=n?x0:"button";return a.jsx(o,{className:Le(G1({variant:t,size:r,className:e})),ref:s,...i})});ve.displayName="Button";const Uje="modulepreload",Qje=function(e){return"/"+e},Az={},lc=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(r.map(c=>{if(c=Qje(c),c in Az)return;Az[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const A=document.createElement("link");if(A.rel=u?"stylesheet":Uje,u||(A.as="script"),A.crossOrigin="",A.href=c,l&&A.setAttribute("nonce",l),document.head.appendChild(A),u)return new Promise((h,f)=>{A.addEventListener("load",h),A.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})},Hje=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...r)=>lc(async()=>{const{default:n}=await Promise.resolve().then(()=>E0);return{default:n}},void 0).then(({default:n})=>n(...r)):t=fetch,(...r)=>t(...r)};class Y6 extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}}class $je extends Y6{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class fz extends Y6{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class hz extends Y6{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var PF;(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"})(PF||(PF={}));var zje=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(d){try{u(n.next(d))}catch(A){o(A)}}function c(d){try{u(n.throw(d))}catch(A){o(A)}}function u(d){d.done?s(d.value):i(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})};class Wje{constructor(t,{headers:r={},customFetch:n,region:i=PF.Any}={}){this.url=t,this.headers=r,this.region=i,this.fetch=Hje(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t,r={}){var n;return zje(this,void 0,void 0,function*(){try{const{headers:i,method:s,body:o}=r;let l={},{region:c}=r;c||(c=this.region);const u=new URL(`${this.url}/${t}`);c&&c!=="any"&&(l["x-region"]=c,u.searchParams.set("forceFunctionRegion",c));let d;o&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&o instanceof Blob||o instanceof ArrayBuffer?(l["Content-Type"]="application/octet-stream",d=o):typeof o=="string"?(l["Content-Type"]="text/plain",d=o):typeof FormData<"u"&&o instanceof FormData?d=o:(l["Content-Type"]="application/json",d=JSON.stringify(o)));const A=yield this.fetch(u.toString(),{method:s||"POST",headers:Object.assign(Object.assign(Object.assign({},l),this.headers),i),body:d}).catch(p=>{throw new $je(p)}),h=A.headers.get("x-relay-error");if(h&&h==="true")throw new fz(A);if(!A.ok)throw new hz(A);let f=((n=A.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),m;return f==="application/json"?m=yield A.json():f==="application/octet-stream"?m=yield A.blob():f==="text/event-stream"?m=A:f==="multipart/form-data"?m=yield A.formData():m=yield A.text(),{data:m,error:null,response:A}}catch(i){return{data:null,error:i,response:i instanceof hz||i instanceof fz?i.context:void 0}}})}}var _o={},J6={},rE={},jC={},nE={},iE={},Gje=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},by=Gje();const Kje=by.fetch,Sne=by.fetch.bind(by),Bne=by.Headers,Vje=by.Request,qje=by.Response,E0=Object.freeze(Object.defineProperty({__proto__:null,Headers:Bne,Request:Vje,Response:qje,default:Sne,fetch:Kje},Symbol.toStringTag,{value:"Module"})),Xje=axe(E0);var sE={};Object.defineProperty(sE,"__esModule",{value:!0});let Yje=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}};sE.default=Yje;var _ne=cs&&cs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(iE,"__esModule",{value:!0});const Jje=_ne(Xje),Zje=_ne(sE);let eSe=class{constructor(t){var r,n;this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(r=t.shouldThrowOnError)!==null&&r!==void 0?r:!1,this.signal=t.signal,this.isMaybeSingle=(n=t.isMaybeSingle)!==null&&n!==void 0?n:!1,t.fetch?this.fetch=t.fetch:typeof fetch>"u"?this.fetch=Jje.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,r){return this.headers=new Headers(this.headers),this.headers.set(t,r),this}then(t,r){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");const n=this.fetch;let i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async s=>{var o,l,c,u;let d=null,A=null,h=null,f=s.status,m=s.statusText;if(s.ok){if(this.method!=="HEAD"){const x=await s.text();x===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((o=this.headers.get("Accept"))===null||o===void 0)&&o.includes("application/vnd.pgrst.plan+text"))?A=x:A=JSON.parse(x))}const g=(l=this.headers.get("Prefer"))===null||l===void 0?void 0:l.match(/count=(exact|planned|estimated)/),v=(c=s.headers.get("content-range"))===null||c===void 0?void 0:c.split("/");g&&v&&v.length>1&&(h=parseInt(v[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(A)&&(A.length>1?(d={code:"PGRST116",details:`Results contain ${A.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},A=null,h=null,f=406,m="Not Acceptable"):A.length===1?A=A[0]:A=null)}else{const g=await s.text();try{d=JSON.parse(g),Array.isArray(d)&&s.status===404&&(A=[],d=null,f=200,m="OK")}catch{s.status===404&&g===""?(f=204,m="No Content"):d={message:g}}if(d&&this.isMaybeSingle&&(!((u=d==null?void 0:d.details)===null||u===void 0)&&u.includes("0 rows"))&&(d=null,f=200,m="OK"),d&&this.shouldThrowOnError)throw new Zje.default(d)}return{error:d,data:A,count:h,status:f,statusText:m}});return this.shouldThrowOnError||(i=i.catch(s=>{var o,l,c;return{error:{message:`${(o=s==null?void 0:s.name)!==null&&o!==void 0?o:"FetchError"}: ${s==null?void 0:s.message}`,details:`${(l=s==null?void 0:s.stack)!==null&&l!==void 0?l:""}`,hint:"",code:`${(c=s==null?void 0:s.code)!==null&&c!==void 0?c:""}`},data:null,count:null,status:0,statusText:""}})),i.then(t,r)}returns(){return this}overrideTypes(){return this}};iE.default=eSe;var tSe=cs&&cs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nE,"__esModule",{value:!0});const rSe=tSe(iE);let nSe=class extends rSe.default{select(t){let r=!1;const n=(t??"*").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(t,{ascending:r=!0,nullsFirst:n,foreignTable:i,referencedTable:s=i}={}){const o=s?`${s}.order`:"order",l=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${l?`${l},`:""}${t}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:r,referencedTable:n=r}={}){const i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${t}`),this}range(t,r,{foreignTable:n,referencedTable:i=n}={}){const s=typeof i>"u"?"offset":`${i}.offset`,o=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(s,`${t}`),this.url.searchParams.set(o,`${r-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),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:t=!1,verbose:r=!1,settings:n=!1,buffers:i=!1,wal:s=!1,format:o="text"}={}){var l;const c=[t?"analyze":null,r?"verbose":null,n?"settings":null,i?"buffers":null,s?"wal":null].filter(Boolean).join("|"),u=(l=this.headers.get("Accept"))!==null&&l!==void 0?l:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${u}"; options=${c};`),o==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};nE.default=nSe;var iSe=cs&&cs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(jC,"__esModule",{value:!0});const sSe=iSe(nE);let aSe=class extends sSe.default{eq(t,r){return this.url.searchParams.append(t,`eq.${r}`),this}neq(t,r){return this.url.searchParams.append(t,`neq.${r}`),this}gt(t,r){return this.url.searchParams.append(t,`gt.${r}`),this}gte(t,r){return this.url.searchParams.append(t,`gte.${r}`),this}lt(t,r){return this.url.searchParams.append(t,`lt.${r}`),this}lte(t,r){return this.url.searchParams.append(t,`lte.${r}`),this}like(t,r){return this.url.searchParams.append(t,`like.${r}`),this}likeAllOf(t,r){return this.url.searchParams.append(t,`like(all).{${r.join(",")}}`),this}likeAnyOf(t,r){return this.url.searchParams.append(t,`like(any).{${r.join(",")}}`),this}ilike(t,r){return this.url.searchParams.append(t,`ilike.${r}`),this}ilikeAllOf(t,r){return this.url.searchParams.append(t,`ilike(all).{${r.join(",")}}`),this}ilikeAnyOf(t,r){return this.url.searchParams.append(t,`ilike(any).{${r.join(",")}}`),this}is(t,r){return this.url.searchParams.append(t,`is.${r}`),this}in(t,r){const n=Array.from(new Set(r)).map(i=>typeof i=="string"&&new RegExp("[,()]").test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(t,`in.(${n})`),this}contains(t,r){return typeof r=="string"?this.url.searchParams.append(t,`cs.${r}`):Array.isArray(r)?this.url.searchParams.append(t,`cs.{${r.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(r)}`),this}containedBy(t,r){return typeof r=="string"?this.url.searchParams.append(t,`cd.${r}`):Array.isArray(r)?this.url.searchParams.append(t,`cd.{${r.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(r)}`),this}rangeGt(t,r){return this.url.searchParams.append(t,`sr.${r}`),this}rangeGte(t,r){return this.url.searchParams.append(t,`nxl.${r}`),this}rangeLt(t,r){return this.url.searchParams.append(t,`sl.${r}`),this}rangeLte(t,r){return this.url.searchParams.append(t,`nxr.${r}`),this}rangeAdjacent(t,r){return this.url.searchParams.append(t,`adj.${r}`),this}overlaps(t,r){return typeof r=="string"?this.url.searchParams.append(t,`ov.${r}`):this.url.searchParams.append(t,`ov.{${r.join(",")}}`),this}textSearch(t,r,{config:n,type:i}={}){let s="";i==="plain"?s="pl":i==="phrase"?s="ph":i==="websearch"&&(s="w");const o=n===void 0?"":`(${n})`;return this.url.searchParams.append(t,`${s}fts${o}.${r}`),this}match(t){return Object.entries(t).forEach(([r,n])=>{this.url.searchParams.append(r,`eq.${n}`)}),this}not(t,r,n){return this.url.searchParams.append(t,`not.${r}.${n}`),this}or(t,{foreignTable:r,referencedTable:n=r}={}){const i=n?`${n}.or`:"or";return this.url.searchParams.append(i,`(${t})`),this}filter(t,r,n){return this.url.searchParams.append(t,`${r}.${n}`),this}};jC.default=aSe;var oSe=cs&&cs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rE,"__esModule",{value:!0});const Fb=oSe(jC);let lSe=class{constructor(t,{headers:r={},schema:n,fetch:i}){this.url=t,this.headers=new Headers(r),this.schema=n,this.fetch=i}select(t,{head:r=!1,count:n}={}){const i=r?"HEAD":"GET";let s=!1;const o=(t??"*").split("").map(l=>/\s/.test(l)&&!s?"":(l==='"'&&(s=!s),l)).join("");return this.url.searchParams.set("select",o),n&&this.headers.append("Prefer",`count=${n}`),new Fb.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(t,{count:r,defaultToNull:n=!0}={}){var i;const s="POST";if(r&&this.headers.append("Prefer",`count=${r}`),n||this.headers.append("Prefer","missing=default"),Array.isArray(t)){const o=t.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(o.length>0){const l=[...new Set(o)].map(c=>`"${c}"`);this.url.searchParams.set("columns",l.join(","))}}return new Fb.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}upsert(t,{onConflict:r,ignoreDuplicates:n=!1,count:i,defaultToNull:s=!0}={}){var o;const l="POST";if(this.headers.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),r!==void 0&&this.url.searchParams.set("on_conflict",r),i&&this.headers.append("Prefer",`count=${i}`),s||this.headers.append("Prefer","missing=default"),Array.isArray(t)){const c=t.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(c.length>0){const u=[...new Set(c)].map(d=>`"${d}"`);this.url.searchParams.set("columns",u.join(","))}}return new Fb.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}update(t,{count:r}={}){var n;const i="PATCH";return r&&this.headers.append("Prefer",`count=${r}`),new Fb.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:t}={}){var r;const n="DELETE";return t&&this.headers.append("Prefer",`count=${t}`),new Fb.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}};rE.default=lSe;var kne=cs&&cs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(J6,"__esModule",{value:!0});const cSe=kne(rE),uSe=kne(jC);let dSe=class Ene{constructor(t,{headers:r={},schema:n,fetch:i}={}){this.url=t,this.headers=new Headers(r),this.schemaName=n,this.fetch=i}from(t){const r=new URL(`${this.url}/${t}`);return new cSe.default(r,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new Ene(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,r={},{head:n=!1,get:i=!1,count:s}={}){var o;let l;const c=new URL(`${this.url}/rpc/${t}`);let u;n||i?(l=n?"HEAD":"GET",Object.entries(r).filter(([A,h])=>h!==void 0).map(([A,h])=>[A,Array.isArray(h)?`{${h.join(",")}}`:`${h}`]).forEach(([A,h])=>{c.searchParams.append(A,h)})):(l="POST",u=r);const d=new Headers(this.headers);return s&&d.set("Prefer",`count=${s}`),new uSe.default({method:l,url:c,headers:d,schema:this.schemaName,body:u,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}};J6.default=dSe;var T0=cs&&cs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_o,"__esModule",{value:!0});_o.PostgrestError=_o.PostgrestBuilder=_o.PostgrestTransformBuilder=_o.PostgrestFilterBuilder=_o.PostgrestQueryBuilder=_o.PostgrestClient=void 0;const Tne=T0(J6);_o.PostgrestClient=Tne.default;const Pne=T0(rE);_o.PostgrestQueryBuilder=Pne.default;const Ine=T0(jC);_o.PostgrestFilterBuilder=Ine.default;const One=T0(nE);_o.PostgrestTransformBuilder=One.default;const Fne=T0(iE);_o.PostgrestBuilder=Fne.default;const Lne=T0(sE);_o.PostgrestError=Lne.default;var ASe=_o.default={PostgrestClient:Tne.default,PostgrestQueryBuilder:Pne.default,PostgrestFilterBuilder:Ine.default,PostgrestTransformBuilder:One.default,PostgrestBuilder:Fne.default,PostgrestError:Lne.default};const{PostgrestClient:fSe,PostgrestQueryBuilder:nNt,PostgrestFilterBuilder:iNt,PostgrestTransformBuilder:sNt,PostgrestBuilder:aNt,PostgrestError:oNt}=ASe;class hSe{static detectEnvironment(){var t;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"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.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."};if(typeof process<"u"&&process.versions&&process.versions.node){const r=parseInt(process.versions.node.split(".")[0]);return r>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${r} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${r} 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 t=this.detectEnvironment();if(t.constructor)return t.constructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=` Suggested solution: ${t.workaround}`),new Error(r)}static createWebSocket(t,r){const n=this.getWebSocketConstructor();return new n(t,r)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const pSe="2.15.1",mSe=`realtime-js/${pSe}`,gSe="1.0.0",IF=1e4,vSe=1e3,xSe=100;var Qw;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(Qw||(Qw={}));var Cs;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Cs||(Cs={}));var Rc;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(Rc||(Rc={}));var OF;(function(e){e.websocket="websocket"})(OF||(OF={}));var Yp;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Yp||(Yp={}));class ySe{constructor(){this.HEADER_LENGTH=1}decode(t,r){return t.constructor===ArrayBuffer?r(this._binaryDecode(t)):r(typeof t=="string"?JSON.parse(t):{})}_binaryDecode(t){const r=new DataView(t),n=new TextDecoder;return this._decodeBroadcast(t,r,n)}_decodeBroadcast(t,r,n){const i=r.getUint8(1),s=r.getUint8(2);let o=this.HEADER_LENGTH+2;const l=n.decode(t.slice(o,o+i));o=o+i;const c=n.decode(t.slice(o,o+s));o=o+s;const u=JSON.parse(n.decode(t.slice(o,t.byteLength)));return{ref:null,topic:l,event:c,payload:u}}}class Mne{constructor(t,r){this.callback=t,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Hn;(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"})(Hn||(Hn={}));const pz=(e,t,r={})=>{var n;const i=(n=r.skipTypes)!==null&&n!==void 0?n:[];return Object.keys(t).reduce((s,o)=>(s[o]=bSe(o,e,t,i),s),{})},bSe=(e,t,r,n)=>{const i=t.find(l=>l.name===e),s=i==null?void 0:i.type,o=r[e];return s&&!n.includes(s)?Dne(s,o):FF(o)},Dne=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return jSe(t,r)}switch(e){case Hn.bool:return wSe(t);case Hn.float4:case Hn.float8:case Hn.int2:case Hn.int4:case Hn.int8:case Hn.numeric:case Hn.oid:return CSe(t);case Hn.json:case Hn.jsonb:return NSe(t);case Hn.timestamp:return SSe(t);case Hn.abstime:case Hn.date:case Hn.daterange:case Hn.int4range:case Hn.int8range:case Hn.money:case Hn.reltime:case Hn.text:case Hn.time:case Hn.timestamptz:case Hn.timetz:case Hn.tsrange:case Hn.tstzrange:return FF(t);default:return FF(t)}},FF=e=>e,wSe=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},CSe=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},NSe=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},jSe=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let s;const o=e.slice(1,r);try{s=JSON.parse("["+o+"]")}catch{s=o?o.split(","):[]}return s.map(l=>Dne(t,l))}return e},SSe=e=>typeof e=="string"?e.replace(" ","T"):e,Rne=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")+"/api/broadcast"};class bP{constructor(t,r,n={},i=IF){this.channel=t,this.event=r,this.payload=n,this.timeout=i,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,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()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,r){var n;return this._hasReceived(t)&&r((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:t,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(r))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var mz;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(mz||(mz={}));class Hw{constructor(t,r){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},i=>{const{onJoin:s,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Hw.syncState(this.state,i,s,o),this.pendingDiffs.forEach(c=>{this.state=Hw.syncDiff(this.state,c,s,o)}),this.pendingDiffs=[],l()}),this.channel._on(n.diff,{},i=>{const{onJoin:s,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=Hw.syncDiff(this.state,i,s,o),l())}),this.onJoin((i,s,o)=>{this.channel._trigger("presence",{event:"join",key:i,currentPresences:s,newPresences:o})}),this.onLeave((i,s,o)=>{this.channel._trigger("presence",{event:"leave",key:i,currentPresences:s,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,r,n,i){const s=this.cloneDeep(t),o=this.transformState(r),l={},c={};return this.map(s,(u,d)=>{o[u]||(c[u]=d)}),this.map(o,(u,d)=>{const A=s[u];if(A){const h=d.map(g=>g.presence_ref),f=A.map(g=>g.presence_ref),m=d.filter(g=>f.indexOf(g.presence_ref)<0),p=A.filter(g=>h.indexOf(g.presence_ref)<0);m.length>0&&(l[u]=m),p.length>0&&(c[u]=p)}else l[u]=d}),this.syncDiff(s,{joins:l,leaves:c},n,i)}static syncDiff(t,r,n,i){const{joins:s,leaves:o}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),i||(i=()=>{}),this.map(s,(l,c)=>{var u;const d=(u=t[l])!==null&&u!==void 0?u:[];if(t[l]=this.cloneDeep(c),d.length>0){const A=t[l].map(f=>f.presence_ref),h=d.filter(f=>A.indexOf(f.presence_ref)<0);t[l].unshift(...h)}n(l,d,c)}),this.map(o,(l,c)=>{let u=t[l];if(!u)return;const d=c.map(A=>A.presence_ref);u=u.filter(A=>d.indexOf(A.presence_ref)<0),t[l]=u,i(l,u,c),u.length===0&&delete t[l]}),t}static map(t,r){return Object.getOwnPropertyNames(t).map(n=>r(n,t[n]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const i=t[n];return"metas"in i?r[n]=i.metas.map(s=>(s.presence_ref=s.phx_ref,delete s.phx_ref,delete s.phx_ref_prev,s)):r[n]=i,r},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var gz;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(gz||(gz={}));var $w;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})($w||($w={}));var eA;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(eA||(eA={}));class Z6{constructor(t,r={config:{}},n){this.topic=t,this.params=r,this.socket=n,this.bindings={},this.state=Cs.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new bP(this,Rc.join,this.params,this.timeout),this.rejoinTimer=new Mne(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Cs.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(i=>i.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Cs.closed,this.socket._remove(this)}),this._onError(i=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,i),this.state=Cs.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Cs.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",i=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,i),this.state=Cs.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Rc.reply,{},(i,s)=>{this._trigger(this._replyEventName(s),i)}),this.presence=new Hw(this),this.broadcastEndpointURL=Rne(this.socket.endPoint),this.private=this.params.config.private||!1}subscribe(t,r=this.timeout){var n,i;if(this.socket.isConnected()||this.socket.connect(),this.state==Cs.closed){const{config:{broadcast:s,presence:o,private:l}}=this.params,c=(i=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(h=>h.filter))!==null&&i!==void 0?i:[],u=!!this.bindings[$w.PRESENCE]&&this.bindings[$w.PRESENCE].length>0,d={},A={broadcast:s,presence:Object.assign(Object.assign({},o),{enabled:u}),postgres_changes:c,private:l};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(h=>t==null?void 0:t(eA.CHANNEL_ERROR,h)),this._onClose(()=>t==null?void 0:t(eA.CLOSED)),this.updateJoinPayload(Object.assign({config:A},d)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:h})=>{var f;if(this.socket.setAuth(),h===void 0){t==null||t(eA.SUBSCRIBED);return}else{const m=this.bindings.postgres_changes,p=(f=m==null?void 0:m.length)!==null&&f!==void 0?f:0,g=[];for(let v=0;v{this.state=Cs.errored,t==null||t(eA.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(h).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(eA.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,n){return this.state===Cs.joined&&t===$w.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(t,r,n)}async send(t,r={}){var n,i;if(!this._canPush()&&t.type==="broadcast"){const{event:s,payload:o}=t,c={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((i=u.body)===null||i===void 0?void 0:i.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var o,l,c;const u=this._push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(o=this.params)===null||o===void 0?void 0:o.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&s("ok"),u.receive("ok",()=>s("ok")),u.receive("error",()=>s("error")),u.receive("timeout",()=>s("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Cs.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Rc.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(i=>{n=new bP(this,Rc.leave,{},t),n.receive("ok",()=>{r(),i("ok")}).receive("timeout",()=>{r(),i("timed out")}).receive("error",()=>{i("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Cs.closed,this.bindings={}}async _fetchWithTimeout(t,r,n){const i=new AbortController,s=setTimeout(()=>i.abort(),n),o=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:i.signal}));return clearTimeout(s),o}_push(t,r,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let i=new bP(this,t,r,n);return this._canPush()?i.send():this._addToPushBuffer(i),i}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>xSe){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(t,r,n){return r}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,r,n){var i,s;const o=t.toLocaleLowerCase(),{close:l,error:c,leave:u,join:d}=Rc;if(n&&[l,c,u,d].indexOf(o)>=0&&n!==this._joinRef())return;let h=this._onMessage(o,r,n);if(r&&!h)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(i=this.bindings.postgres_changes)===null||i===void 0||i.filter(f=>{var m,p,g;return((m=f.filter)===null||m===void 0?void 0:m.event)==="*"||((g=(p=f.filter)===null||p===void 0?void 0:p.event)===null||g===void 0?void 0:g.toLocaleLowerCase())===o}).map(f=>f.callback(h,n)):(s=this.bindings[o])===null||s===void 0||s.filter(f=>{var m,p,g,v,x,y;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in f){const b=f.id,C=(m=f.filter)===null||m===void 0?void 0:m.event;return b&&((p=r.ids)===null||p===void 0?void 0:p.includes(b))&&(C==="*"||(C==null?void 0:C.toLocaleLowerCase())===((g=r.data)===null||g===void 0?void 0:g.type.toLocaleLowerCase()))}else{const b=(x=(v=f==null?void 0:f.filter)===null||v===void 0?void 0:v.event)===null||x===void 0?void 0:x.toLocaleLowerCase();return b==="*"||b===((y=r==null?void 0:r.event)===null||y===void 0?void 0:y.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===o}).map(f=>{if(typeof h=="object"&&"ids"in h){const m=h.data,{schema:p,table:g,commit_timestamp:v,type:x,errors:y}=m;h=Object.assign(Object.assign({},{schema:p,table:g,commit_timestamp:v,eventType:x,new:{},old:{},errors:y}),this._getPayloadRecords(m))}f.callback(h,n)})}_isClosed(){return this.state===Cs.closed}_isJoined(){return this.state===Cs.joined}_isJoining(){return this.state===Cs.joining}_isLeaving(){return this.state===Cs.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,r,n){const i=t.toLocaleLowerCase(),s={type:i,filter:r,callback:n};return this.bindings[i]?this.bindings[i].push(s):this.bindings[i]=[s],this}_off(t,r){const n=t.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(i=>{var s;return!(((s=i.type)===null||s===void 0?void 0:s.toLocaleLowerCase())===n&&Z6.isEqual(i.filter,r))})),this}static isEqual(t,r){if(Object.keys(t).length!==Object.keys(r).length)return!1;for(const n in t)if(t[n]!==r[n])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Rc.close,{},t)}_onError(t){this._on(Rc.error,{},r=>t(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Cs.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=pz(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=pz(t.columns,t.old_record)),r}}const vz=()=>{},nj={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},BSe=[1e3,2e3,5e3,1e4],_Se=1e4,kSe=` addEventListener("message", (e) => { if (e.data.event === "start") { setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); } });`;class ESe{constructor(t,r){var n;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=IF,this.transport=null,this.heartbeatIntervalMs=nj.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=vz,this.ref=0,this.reconnectTimer=null,this.logger=vz,this.conn=null,this.sendBuffer=[],this.serializer=new ySe,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=i=>{let s;return i?s=i:typeof fetch>"u"?s=(...o)=>lc(async()=>{const{default:l}=await Promise.resolve().then(()=>E0);return{default:l}},void 0).then(({default:l})=>l(...o)).catch(l=>{throw new Error(`Failed to load @supabase/node-fetch: ${l.message}. This is required for HTTP requests in Node.js environments without native fetch.`)}):s=fetch,(...o)=>s(...o)},!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${t}/${OF.websocket}`,this.httpEndpoint=Rne(t),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=hSe.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const r=t.message;throw r.includes("Node.js")?new Error(`${r} 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: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:gSe}))}disconnect(t,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},t?this.conn.close(t,r??""):this.conn.close(),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const t=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,r,n){this.logger(t,r,n)}connectionState(){switch(this.conn&&this.conn.readyState){case Qw.connecting:return Yp.Connecting;case Qw.open:return Yp.Open;case Qw.closing:return Yp.Closing;default:return Yp.Closed}}isConnected(){return this.connectionState()===Yp.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,r={config:{}}){const n=`realtime:${t}`,i=this.getChannels().find(s=>s.topic===n);if(i)return i;{const s=new Z6(`realtime:${t}`,r,this);return this.channels.push(s),s}}push(t){const{topic:r,event:n,payload:i,ref:s}=t,o=()=>{this.encode(t,l=>{var c;(c=this.conn)===null||c===void 0||c.send(l)})};this.log("push",`${r} ${n} (${s})`,i),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var t;if(!this.isConnected()){this.heartbeatCallback("disconnected");return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.heartbeatCallback("timeout"),this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(vSe,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout()},nj.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatCallback("sent"),this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let r=this.channels.find(n=>n.topic===t&&(n._isJoined()||n._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${t}"`),r.unsubscribe())}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,r=>{r.topic==="phoenix"&&r.event==="phx_reply"&&this.heartbeatCallback(r.payload.status==="ok"?"ok":"error"),r.ref&&r.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:n,event:i,payload:s,ref:o}=r,l=o?`(${o})`:"",c=s.status||"";this.log("receive",`${c} ${n} ${i} ${l}`.trim(),s),this.channels.filter(u=>u._isMember(n)).forEach(u=>u._trigger(i,s,o)),this._triggerStateCallbacks("message",r)})}_clearTimer(t){var r;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t))}_teardownConnection(){this.conn&&(this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null),this._clearAllTimers(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this.workerRef.terminate()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(t){var r;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t)}_triggerChanError(){this.channels.forEach(t=>t._trigger(Rc.error))}_appendParams(t,r){if(Object.keys(r).length===0)return t;const n=t.match(/\?/)?"&":"?",i=new URLSearchParams(r);return`${t}${n}${i}`}_workerObjectUrl(t){let r;if(t)r=t;else{const n=new Blob([kSe],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_setConnectionState(t,r=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(t=null){let r;t?r=t:this.accessToken?r=await this.accessToken():r=this.accessTokenValue,this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(n=>{const i={access_token:r,version:mSe};r&&n.updateJoinPayload(i),n.joinedOnce&&n._isJoined()&&n._push(Rc.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this.setAuth().catch(r=>{this.log("error",`error setting auth in ${t}`,r)})}_triggerStateCallbacks(t,r){try{this.stateChangeCallbacks[t].forEach(n=>{try{n(r)}catch(i){this.log("error",`error in ${t} callback`,i)}})}catch(n){this.log("error",`error triggering ${t} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new Mne(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},nj.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var r,n,i,s,o,l,c,u;if(this.transport=(r=t==null?void 0:t.transport)!==null&&r!==void 0?r:null,this.timeout=(n=t==null?void 0:t.timeout)!==null&&n!==void 0?n:IF,this.heartbeatIntervalMs=(i=t==null?void 0:t.heartbeatIntervalMs)!==null&&i!==void 0?i:nj.HEARTBEAT_INTERVAL,this.worker=(s=t==null?void 0:t.worker)!==null&&s!==void 0?s:!1,this.accessToken=(o=t==null?void 0:t.accessToken)!==null&&o!==void 0?o:null,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(l=t==null?void 0:t.reconnectAfterMs)!==null&&l!==void 0?l:d=>BSe[d-1]||_Se,this.encode=(c=t==null?void 0:t.encode)!==null&&c!==void 0?c:(d,A)=>A(JSON.stringify(d)),this.decode=(u=t==null?void 0:t.decode)!==null&&u!==void 0?u:this.serializer.decode.bind(this.serializer),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}class eU extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}}function Ns(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}class TSe extends eU{constructor(t,r,n){super(t),this.name="StorageApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class LF extends eU{constructor(t,r){super(t),this.name="StorageUnknownError",this.originalError=r}}var PSe=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(d){try{u(n.next(d))}catch(A){o(A)}}function c(d){try{u(n.throw(d))}catch(A){o(A)}}function u(d){d.done?s(d.value):i(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})};const Une=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...r)=>lc(async()=>{const{default:n}=await Promise.resolve().then(()=>E0);return{default:n}},void 0).then(({default:n})=>n(...r)):t=fetch,(...r)=>t(...r)},ISe=()=>PSe(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield lc(()=>Promise.resolve().then(()=>E0),void 0)).Response:Response}),MF=e=>{if(Array.isArray(e))return e.map(r=>MF(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,n])=>{const i=r.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));t[i]=MF(n)}),t},OSe=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};var Eg=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(d){try{u(n.next(d))}catch(A){o(A)}}function c(d){try{u(n.throw(d))}catch(A){o(A)}}function u(d){d.done?s(d.value):i(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})};const wP=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),FSe=(e,t,r)=>Eg(void 0,void 0,void 0,function*(){const n=yield ISe();e instanceof n&&!(r!=null&&r.noResolveJson)?e.json().then(i=>{const s=e.status||500,o=(i==null?void 0:i.statusCode)||s+"";t(new TSe(wP(i),s,o))}).catch(i=>{t(new LF(wP(i),i))}):t(new LF(wP(e),e))}),LSe=(e,t,r,n)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||!n?i:(OSe(n)?(i.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),i.body=JSON.stringify(n)):i.body=n,t!=null&&t.duplex&&(i.duplex=t.duplex),Object.assign(Object.assign({},i),r))};function SC(e,t,r,n,i,s){return Eg(this,void 0,void 0,function*(){return new Promise((o,l)=>{e(r,LSe(t,n,i,s)).then(c=>{if(!c.ok)throw c;return n!=null&&n.noResolveJson?c:c.json()}).then(c=>o(c)).catch(c=>FSe(c,l,n))})})}function qB(e,t,r,n){return Eg(this,void 0,void 0,function*(){return SC(e,"GET",t,r,n)})}function ku(e,t,r,n,i){return Eg(this,void 0,void 0,function*(){return SC(e,"POST",t,n,i,r)})}function DF(e,t,r,n,i){return Eg(this,void 0,void 0,function*(){return SC(e,"PUT",t,n,i,r)})}function MSe(e,t,r,n){return Eg(this,void 0,void 0,function*(){return SC(e,"HEAD",t,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}function Qne(e,t,r,n,i){return Eg(this,void 0,void 0,function*(){return SC(e,"DELETE",t,n,i,r)})}var Ka=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(d){try{u(n.next(d))}catch(A){o(A)}}function c(d){try{u(n.throw(d))}catch(A){o(A)}}function u(d){d.done?s(d.value):i(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})};const DSe={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},xz={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class RSe{constructor(t,r={},n,i){this.url=t,this.headers=r,this.bucketId=n,this.fetch=Une(i)}uploadOrUpdate(t,r,n,i){return Ka(this,void 0,void 0,function*(){try{let s;const o=Object.assign(Object.assign({},xz),i);let l=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&n instanceof Blob?(s=new FormData,s.append("cacheControl",o.cacheControl),c&&s.append("metadata",this.encodeMetadata(c)),s.append("",n)):typeof FormData<"u"&&n instanceof FormData?(s=n,s.append("cacheControl",o.cacheControl),c&&s.append("metadata",this.encodeMetadata(c))):(s=n,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=this.toBase64(this.encodeMetadata(c)))),i!=null&&i.headers&&(l=Object.assign(Object.assign({},l),i.headers));const u=this._removeEmptyFolders(r),d=this._getFinalPath(u),A=yield(t=="PUT"?DF:ku)(this.fetch,`${this.url}/object/${d}`,s,Object.assign({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:u,id:A.Id,fullPath:A.Key},error:null}}catch(s){if(Ns(s))return{data:null,error:s};throw s}})}upload(t,r,n){return Ka(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,r,n)})}uploadToSignedUrl(t,r,n,i){return Ka(this,void 0,void 0,function*(){const s=this._removeEmptyFolders(t),o=this._getFinalPath(s),l=new URL(this.url+`/object/upload/sign/${o}`);l.searchParams.set("token",r);try{let c;const u=Object.assign({upsert:xz.upsert},i),d=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.append("cacheControl",u.cacheControl)):(c=n,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType);const A=yield DF(this.fetch,l.toString(),c,{headers:d});return{data:{path:s,fullPath:A.Key},error:null}}catch(c){if(Ns(c))return{data:null,error:c};throw c}})}createSignedUploadUrl(t,r){return Ka(this,void 0,void 0,function*(){try{let n=this._getFinalPath(t);const i=Object.assign({},this.headers);r!=null&&r.upsert&&(i["x-upsert"]="true");const s=yield ku(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:i}),o=new URL(this.url+s.url),l=o.searchParams.get("token");if(!l)throw new eU("No token returned by API");return{data:{signedUrl:o.toString(),path:t,token:l},error:null}}catch(n){if(Ns(n))return{data:null,error:n};throw n}})}update(t,r,n){return Ka(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,r,n)})}move(t,r,n){return Ka(this,void 0,void 0,function*(){try{return{data:yield ku(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers}),error:null}}catch(i){if(Ns(i))return{data:null,error:i};throw i}})}copy(t,r,n){return Ka(this,void 0,void 0,function*(){try{return{data:{path:(yield ku(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:t,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if(Ns(i))return{data:null,error:i};throw i}})}createSignedUrl(t,r,n){return Ka(this,void 0,void 0,function*(){try{let i=this._getFinalPath(t),s=yield ku(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:r},n!=null&&n.transform?{transform:n.transform}:{}),{headers:this.headers});const o=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return s={signedUrl:encodeURI(`${this.url}${s.signedURL}${o}`)},{data:s,error:null}}catch(i){if(Ns(i))return{data:null,error:i};throw i}})}createSignedUrls(t,r,n){return Ka(this,void 0,void 0,function*(){try{const i=yield ku(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:t},{headers:this.headers}),s=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{data:i.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${s}`):null})),error:null}}catch(i){if(Ns(i))return{data:null,error:i};throw i}})}download(t,r){return Ka(this,void 0,void 0,function*(){const i=typeof(r==null?void 0:r.transform)<"u"?"render/image/authenticated":"object",s=this.transformOptsToQueryString((r==null?void 0:r.transform)||{}),o=s?`?${s}`:"";try{const l=this._getFinalPath(t);return{data:yield(yield qB(this.fetch,`${this.url}/${i}/${l}${o}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(l){if(Ns(l))return{data:null,error:l};throw l}})}info(t){return Ka(this,void 0,void 0,function*(){const r=this._getFinalPath(t);try{const n=yield qB(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:MF(n),error:null}}catch(n){if(Ns(n))return{data:null,error:n};throw n}})}exists(t){return Ka(this,void 0,void 0,function*(){const r=this._getFinalPath(t);try{return yield MSe(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if(Ns(n)&&n instanceof LF){const i=n.originalError;if([400,404].includes(i==null?void 0:i.status))return{data:!1,error:n}}throw n}})}getPublicUrl(t,r){const n=this._getFinalPath(t),i=[],s=r!=null&&r.download?`download=${r.download===!0?"":r.download}`:"";s!==""&&i.push(s);const l=typeof(r==null?void 0:r.transform)<"u"?"render/image":"object",c=this.transformOptsToQueryString((r==null?void 0:r.transform)||{});c!==""&&i.push(c);let u=i.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${l}/public/${n}${u}`)}}}remove(t){return Ka(this,void 0,void 0,function*(){try{return{data:yield Qne(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(r){if(Ns(r))return{data:null,error:r};throw r}})}list(t,r,n){return Ka(this,void 0,void 0,function*(){try{const i=Object.assign(Object.assign(Object.assign({},DSe),r),{prefix:t||""});return{data:yield ku(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n),error:null}}catch(i){if(Ns(i))return{data:null,error:i};throw i}})}listV2(t,r){return Ka(this,void 0,void 0,function*(){try{const n=Object.assign({},t);return{data:yield ku(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,n,{headers:this.headers},r),error:null}}catch(n){if(Ns(n))return{data:null,error:n};throw n}})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){const r=[];return t.width&&r.push(`width=${t.width}`),t.height&&r.push(`height=${t.height}`),t.resize&&r.push(`resize=${t.resize}`),t.format&&r.push(`format=${t.format}`),t.quality&&r.push(`quality=${t.quality}`),r.join("&")}}const USe="2.11.0",QSe={"X-Client-Info":`storage-js/${USe}`};var cv=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(d){try{u(n.next(d))}catch(A){o(A)}}function c(d){try{u(n.throw(d))}catch(A){o(A)}}function u(d){d.done?s(d.value):i(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})};class HSe{constructor(t,r={},n,i){const s=new URL(t);i!=null&&i.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase.")),this.url=s.href,this.headers=Object.assign(Object.assign({},QSe),r),this.fetch=Une(n)}listBuckets(){return cv(this,void 0,void 0,function*(){try{return{data:yield qB(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(t){if(Ns(t))return{data:null,error:t};throw t}})}getBucket(t){return cv(this,void 0,void 0,function*(){try{return{data:yield qB(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(r){if(Ns(r))return{data:null,error:r};throw r}})}createBucket(t,r={public:!1}){return cv(this,void 0,void 0,function*(){try{return{data:yield ku(this.fetch,`${this.url}/bucket`,{id:t,name:t,type:r.type,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(Ns(n))return{data:null,error:n};throw n}})}updateBucket(t,r){return cv(this,void 0,void 0,function*(){try{return{data:yield DF(this.fetch,`${this.url}/bucket/${t}`,{id:t,name:t,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(Ns(n))return{data:null,error:n};throw n}})}emptyBucket(t){return cv(this,void 0,void 0,function*(){try{return{data:yield ku(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(r){if(Ns(r))return{data:null,error:r};throw r}})}deleteBucket(t){return cv(this,void 0,void 0,function*(){try{return{data:yield Qne(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(r){if(Ns(r))return{data:null,error:r};throw r}})}}class $Se extends HSe{constructor(t,r={},n,i){super(t,r,n,i)}from(t){return new RSe(this.url,this.headers,t,this.fetch)}}const zSe="2.56.0";let uw="";typeof Deno<"u"?uw="deno":typeof document<"u"?uw="web":typeof navigator<"u"&&navigator.product==="ReactNative"?uw="react-native":uw="node";const WSe={"X-Client-Info":`supabase-js-${uw}/${zSe}`},GSe={headers:WSe},KSe={schema:"public"},VSe={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},qSe={};var XSe=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(d){try{u(n.next(d))}catch(A){o(A)}}function c(d){try{u(n.throw(d))}catch(A){o(A)}}function u(d){d.done?s(d.value):i(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})};const YSe=e=>{let t;return e?t=e:typeof fetch>"u"?t=Sne:t=fetch,(...r)=>t(...r)},JSe=()=>typeof Headers>"u"?Bne:Headers,ZSe=(e,t,r)=>{const n=YSe(r),i=JSe();return(s,o)=>XSe(void 0,void 0,void 0,function*(){var l;const c=(l=yield t())!==null&&l!==void 0?l:e;let u=new i(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),n(s,Object.assign(Object.assign({},o),{headers:u}))})};var eBe=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(d){try{u(n.next(d))}catch(A){o(A)}}function c(d){try{u(n.throw(d))}catch(A){o(A)}}function u(d){d.done?s(d.value):i(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})};function tBe(e){return e.endsWith("/")?e:e+"/"}function rBe(e,t){var r,n;const{db:i,auth:s,realtime:o,global:l}=e,{db:c,auth:u,realtime:d,global:A}=t,h={db:Object.assign(Object.assign({},c),i),auth:Object.assign(Object.assign({},u),s),realtime:Object.assign(Object.assign({},d),o),storage:{},global:Object.assign(Object.assign(Object.assign({},A),l),{headers:Object.assign(Object.assign({},(r=A==null?void 0:A.headers)!==null&&r!==void 0?r:{}),(n=l==null?void 0:l.headers)!==null&&n!==void 0?n:{})}),accessToken:()=>eBe(this,void 0,void 0,function*(){return""})};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}const Hne="2.71.1",Hv=30*1e3,RF=3,CP=RF*Hv,nBe="http://localhost:9999",iBe="supabase.auth.token",sBe={"X-Client-Info":`gotrue-js/${Hne}`},UF="X-Supabase-Api-Version",$ne={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},aBe=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,oBe=10*60*1e3;class tU extends Error{constructor(t,r,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function jr(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class lBe extends tU{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function cBe(e){return jr(e)&&e.name==="AuthApiError"}class zne extends tU{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class tp extends tU{constructor(t,r,n,i){super(t,n,i),this.name=r,this.status=n}}class xf extends tp{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function uBe(e){return jr(e)&&e.name==="AuthSessionMissingError"}class ij extends tp{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class sj extends tp{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class aj extends tp{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function dBe(e){return jr(e)&&e.name==="AuthImplicitGrantRedirectError"}class yz extends tp{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class QF extends tp{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function NP(e){return jr(e)&&e.name==="AuthRetryableFetchError"}class bz extends tp{constructor(t,r,n){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class HF extends tp{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const XB="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),wz=` \r=`.split(""),ABe=(()=>{const e=new Array(128);for(let t=0;t=6;){const n=t.queue>>t.queuedBits-6&63;r(XB[n]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(XB[n]),t.queuedBits-=6}}function Wne(e,t,r){const n=ABe[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function Nz(e){const t=[],r=o=>{t.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},s=o=>{pBe(o,n,r)};for(let o=0;o>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function hBe(e,t){for(let r=0;r55295&&n<=56319){const i=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|i)+65536,r+=1}fBe(n,t)}}function pBe(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&r(t.codepoint)}}function mBe(e){const t=[],r={queue:0,queuedBits:0},n=i=>{t.push(i)};for(let i=0;it.push(r)),new Uint8Array(t)}function vBe(e){const t=[],r={queue:0,queuedBits:0},n=i=>{t.push(i)};return e.forEach(i=>Cz(i,r,n)),Cz(null,r,n),t.join("")}function xBe(e){return Math.round(Date.now()/1e3)+e}function yBe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}const Pc=()=>typeof window<"u"&&typeof document<"u",_p={tested:!1,writable:!1},Gne=()=>{if(!Pc())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(_p.tested)return _p.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),_p.tested=!0,_p.writable=!0}catch{_p.tested=!0,_p.writable=!1}return _p.writable};function bBe(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((i,s)=>{t[s]=i})}catch{}return r.searchParams.forEach((n,i)=>{t[i]=n}),t}const Kne=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...r)=>lc(async()=>{const{default:n}=await Promise.resolve().then(()=>E0);return{default:n}},void 0).then(({default:n})=>n(...r)):t=fetch,(...r)=>t(...r)},wBe=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",$v=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},kp=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},ff=async(e,t)=>{await e.removeItem(t)};class aE{constructor(){this.promise=new aE.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}aE.promiseConstructor=Promise;function jP(e){const t=e.split(".");if(t.length!==3)throw new HF("Invalid JWT structure");for(let n=0;n{setTimeout(()=>t(null),e)})}function NBe(e,t){return new Promise((n,i)=>{(async()=>{for(let s=0;s<1/0;s++)try{const o=await e(s);if(!t(s,null,o)){n(o);return}}catch(o){if(!t(s,o)){i(o);return}}})()})}function jBe(e){return("0"+e.toString(16)).substr(-2)}function SBe(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let i="";for(let s=0;s<56;s++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(t),Array.from(t,jBe).join("")}async function BBe(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(n);return Array.from(i).map(s=>String.fromCharCode(s)).join("")}async function _Be(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 r=await BBe(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function uv(e,t,r=!1){const n=SBe();let i=n;r&&(i+="/PASSWORD_RECOVERY"),await $v(e,`${t}-code-verifier`,i);const s=await _Be(n);return[s,n===s?"plain":"s256"]}const kBe=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function EBe(e){const t=e.headers.get(UF);if(!t||!t.match(kBe))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function TBe(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function PBe(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 IBe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function dv(e){if(!IBe.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function SP(){const e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="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 "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function jz(e){return JSON.parse(JSON.stringify(e))}var OBe=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);ie.msg||e.message||e.error_description||e.error||JSON.stringify(e),FBe=[502,503,504];async function Sz(e){var t;if(!wBe(e))throw new QF($p(e),0);if(FBe.includes(e.status))throw new QF($p(e),e.status);let r;try{r=await e.json()}catch(s){throw new zne($p(s),s)}let n;const i=EBe(e);if(i&&i.getTime()>=$ne["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new bz($p(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new xf}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((s,o)=>s&&typeof o=="string",!0))throw new bz($p(r),e.status,r.weak_password.reasons);throw new lBe($p(r),e.status||500,n)}const LBe=(e,t,r,n)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};async function Ur(e,t,r,n){var i;const s=Object.assign({},n==null?void 0:n.headers);s[UF]||(s[UF]=$ne["2024-01-01"].name),n!=null&&n.jwt&&(s.Authorization=`Bearer ${n.jwt}`);const o=(i=n==null?void 0:n.query)!==null&&i!==void 0?i:{};n!=null&&n.redirectTo&&(o.redirect_to=n.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await MBe(e,t,r+l,{headers:s,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(c):{data:Object.assign({},c),error:null}}async function MBe(e,t,r,n,i,s){const o=LBe(t,n,i,s);let l;try{l=await e(r,Object.assign({},o))}catch(c){throw console.error(c),new QF($p(c),0)}if(l.ok||await Sz(l),n!=null&&n.noResolveJson)return l;try{return await l.json()}catch(c){await Sz(c)}}function Yd(e){var t;let r=null;QBe(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=xBe(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:n},error:null}}function Bz(e){const t=Yd(e);return!t.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((r,n)=>r&&typeof n=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Lf(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function DBe(e){return{data:e,error:null}}function RBe(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:i,verification_type:s}=e,o=OBe(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:r,hashed_token:n,redirect_to:i,verification_type:s},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function UBe(e){return e}function QBe(e){return e.access_token&&e.refresh_token&&e.expires_in}const BP=["global","local","others"];var HBe=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i0&&(f.forEach(m=>{const p=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(m.split(";")[1].split("=")[1]);u[`${g}Page`]=p}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},A),u),error:null}}catch(u){if(jr(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){dv(t);try{return await Ur(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Lf})}catch(r){if(jr(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){dv(t);try{return await Ur(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:Lf})}catch(n){if(jr(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){dv(t);try{return await Ur(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:Lf})}catch(n){if(jr(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){dv(t.userId);try{const{data:r,error:n}=await Ur(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if(jr(r))return{data:null,error:r};throw r}}async _deleteFactor(t){dv(t.userId),dv(t.id);try{return{data:await Ur(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(jr(r))return{data:null,error:r};throw r}}}function _z(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}function zBe(){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)}}const Av={debug:!!(globalThis&&Gne()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Vne extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class WBe extends Vne{}async function GBe(e,t,r){Av.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const n=new globalThis.AbortController;return t>0&&setTimeout(()=>{n.abort(),Av.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){Av.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,i.name);try{return await r()}finally{Av.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,i.name)}}else{if(t===0)throw Av.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new WBe(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Av.debug)try{const s=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(s,null," "))}catch(s){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",s)}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"),await r()}}))}zBe();const KBe={url:nBe,storageKey:iBe,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:sBe,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function kz(e,t,r){return await r()}const fv={};class K1{constructor(t){var r,n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=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,this.instanceID=K1.nextInstanceID,K1.nextInstanceID+=1,this.instanceID>0&&Pc()&&console.warn("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.");const i=Object.assign(Object.assign({},KBe),t);if(this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.persistSession=i.persistSession,this.storageKey=i.storageKey,this.autoRefreshToken=i.autoRefreshToken,this.admin=new $Be({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=Kne(i.fetch),this.lock=i.lock||kz,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:Pc()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=GBe:this.lock=kz,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)},this.persistSession?(i.storage?this.storage=i.storage:Gne()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=_z(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=_z(this.memoryStorage)),Pc()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(s){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",s)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async s=>{this._debug("received broadcast notification from other tab or client",s),await this._notifyAllSubscribers(s.data.event,s.data.session,!1)})}this.initialize()}get jwks(){var t,r;return(r=(t=fv[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){fv[this.storageKey]=Object.assign(Object.assign({},fv[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=fv[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){fv[this.storageKey]=Object.assign(Object.assign({},fv[this.storageKey]),{cachedAt:t})}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${Hne}) ${new Date().toISOString()}`,...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{const r=bBe(window.location.href);let n="none";if(this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce"),Pc()&&this.detectSessionInUrl&&n!=="none"){const{data:i,error:s}=await this._getSessionFromURL(r,n);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),dBe(s)){const c=(t=s.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:s}}return await this._removeSession(),{error:s}}const{session:o,redirectType:l}=i;return this._debug("#_initialize()","detected session in URL",o,"redirect type",l),await this._saveSession(o),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return jr(r)?{error:r}:{error:new zne("Unexpected error during initialization",r)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,i;try{const s=await Ur(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=t==null?void 0:t.options)===null||i===void 0?void 0:i.captchaToken}},xform:Yd}),{data:o,error:l}=s;if(l||!o)return{data:{user:null,session:null},error:l};const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:u,session:c},error:null}}catch(s){if(jr(s))return{data:{user:null,session:null},error:s};throw s}}async signUp(t){var r,n,i;try{let s;if("email"in t){const{email:d,password:A,options:h}=t;let f=null,m=null;this.flowType==="pkce"&&([f,m]=await uv(this.storage,this.storageKey)),s=await Ur(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h==null?void 0:h.emailRedirectTo,body:{email:d,password:A,data:(r=h==null?void 0:h.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:f,code_challenge_method:m},xform:Yd})}else if("phone"in t){const{phone:d,password:A,options:h}=t;s=await Ur(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:A,data:(n=h==null?void 0:h.data)!==null&&n!==void 0?n:{},channel:(i=h==null?void 0:h.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken}},xform:Yd})}else throw new sj("You must provide either an email or phone number and a password");const{data:o,error:l}=s;if(l||!o)return{data:{user:null,session:null},error:l};const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:u,session:c},error:null}}catch(s){if(jr(s))return{data:{user:null,session:null},error:s};throw s}}async signInWithPassword(t){try{let r;if("email"in t){const{email:s,password:o,options:l}=t;r=await Ur(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:Bz})}else if("phone"in t){const{phone:s,password:o,options:l}=t;r=await Ur(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:Bz})}else throw new sj("You must provide either an email or phone number and a password");const{data:n,error:i}=r;return i?{data:{user:null,session:null},error:i}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new ij}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if(jr(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOAuth(t){var r,n,i,s;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=t.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=t.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(s=t.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:r}=t;if(r==="solana")return await this.signInWithSolana(t);throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}async signInWithSolana(t){var r,n,i,s,o,l,c,u,d,A,h,f;let m,p;if("message"in t)m=t.message,p=t.signature;else{const{chain:g,wallet:v,statement:x,options:y}=t;let b;if(Pc())if(typeof v=="object")b=v;else{const j=window;if("solana"in j&&typeof j.solana=="object"&&("signIn"in j.solana&&typeof j.solana.signIn=="function"||"signMessage"in j.solana&&typeof j.solana.signMessage=="function"))b=j.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 v!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=v}const C=new URL((r=y==null?void 0:y.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in b&&b.signIn){const j=await b.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},y==null?void 0:y.signInWithSolana),{version:"1",domain:C.host,uri:C.href}),x?{statement:x}:null));let S;if(Array.isArray(j)&&j[0]&&typeof j[0]=="object")S=j[0];else if(j&&typeof j=="object"&&"signedMessage"in j&&"signature"in j)S=j;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in S&&"signature"in S&&(typeof S.signedMessage=="string"||S.signedMessage instanceof Uint8Array)&&S.signature instanceof Uint8Array)m=typeof S.signedMessage=="string"?S.signedMessage:new TextDecoder().decode(S.signedMessage),p=S.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in b)||typeof b.signMessage!="function"||!("publicKey"in b)||typeof b!="object"||!b.publicKey||!("toBase58"in b.publicKey)||typeof b.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");m=[`${C.host} wants you to sign in with your Solana account:`,b.publicKey.toBase58(),...x?["",x,""]:[""],"Version: 1",`URI: ${C.href}`,`Issued At: ${(i=(n=y==null?void 0:y.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((s=y==null?void 0:y.signInWithSolana)===null||s===void 0)&&s.notBefore?[`Not Before: ${y.signInWithSolana.notBefore}`]:[],...!((o=y==null?void 0:y.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${y.signInWithSolana.expirationTime}`]:[],...!((l=y==null?void 0:y.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${y.signInWithSolana.chainId}`]:[],...!((c=y==null?void 0:y.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${y.signInWithSolana.nonce}`]:[],...!((u=y==null?void 0:y.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${y.signInWithSolana.requestId}`]:[],...!((A=(d=y==null?void 0:y.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||A===void 0)&&A.length?["Resources",...y.signInWithSolana.resources.map(S=>`- ${S}`)]:[]].join(` `);const j=await b.signMessage(new TextEncoder().encode(m),"utf8");if(!j||!(j instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");p=j}}try{const{data:g,error:v}=await Ur(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:m,signature:vBe(p)},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:Yd});if(v)throw v;return!g||!g.session||!g.user?{data:{user:null,session:null},error:new ij}:(g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),{data:Object.assign({},g),error:v})}catch(g){if(jr(g))return{data:{user:null,session:null},error:g};throw g}}async _exchangeCodeForSession(t){const r=await kp(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{const{data:s,error:o}=await Ur(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:Yd});if(await ff(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!s||!s.session||!s.user?{data:{user:null,session:null,redirectType:null},error:new ij}:(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:Object.assign(Object.assign({},s),{redirectType:i??null}),error:o})}catch(s){if(jr(s))return{data:{user:null,session:null,redirectType:null},error:s};throw s}}async signInWithIdToken(t){try{const{options:r,provider:n,token:i,access_token:s,nonce:o}=t,l=await Ur(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:s,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:Yd}),{data:c,error:u}=l;return u?{data:{user:null,session:null},error:u}:!c||!c.session||!c.user?{data:{user:null,session:null},error:new ij}:(c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),{data:c,error:u})}catch(r){if(jr(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOtp(t){var r,n,i,s,o;try{if("email"in t){const{email:l,options:c}=t;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await uv(this.storage,this.storageKey));const{error:A}=await Ur(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(r=c==null?void 0:c.data)!==null&&r!==void 0?r:{},create_user:(n=c==null?void 0:c.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return{data:{user:null,session:null},error:A}}if("phone"in t){const{phone:l,options:c}=t,{data:u,error:d}=await Ur(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(i=c==null?void 0:c.data)!==null&&i!==void 0?i:{},create_user:(s=c==null?void 0:c.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d}}throw new sj("You must provide either an email or phone number.")}catch(l){if(jr(l))return{data:{user:null,session:null},error:l};throw l}}async verifyOtp(t){var r,n;try{let i,s;"options"in t&&(i=(r=t.options)===null||r===void 0?void 0:r.redirectTo,s=(n=t.options)===null||n===void 0?void 0:n.captchaToken);const{data:o,error:l}=await Ur(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:s}}),redirectTo:i,xform:Yd});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,u=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),{data:{user:u,session:c},error:null}}catch(i){if(jr(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(t){var r,n,i;try{let s=null,o=null;return this.flowType==="pkce"&&([s,o]=await uv(this.storage,this.storageKey)),await Ur(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(n=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=t==null?void 0:t.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:s,code_challenge_method:o}),headers:this.headers,xform:DBe})}catch(s){if(jr(s))return{data:null,error:s};throw s}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)throw n;if(!r)throw new xf;const{error:i}=await Ur(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:i}})}catch(t){if(jr(t))return{data:{user:null,session:null},error:t};throw t}}async resend(t){try{const r=`${this.url}/resend`;if("email"in t){const{email:n,type:i,options:s}=t,{error:o}=await Ur(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},redirectTo:s==null?void 0:s.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in t){const{phone:n,type:i,options:s}=t,{data:o,error:l}=await Ur(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}}});return{data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l}}throw new sj("You must provide either an email or phone number and a type")}catch(r){if(jr(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await t(r)}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 t=null;const r=await kp(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()(!o&&u==="user"&&(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."),o=!0,this.suppressGetSessionWarning=!0),Reflect.get(c,u,d))})}return{data:{session:t},error:null}}const{session:i,error:s}=await this._callRefreshToken(t.refresh_token);return s?{data:{session:null},error:s}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(t){return t?await this._getUser(t):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(t){try{return t?await Ur(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Lf}):await this._useSession(async r=>{var n,i,s;const{data:o,error:l}=r;if(l)throw l;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new xf}:await Ur(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(i=o.session)===null||i===void 0?void 0:i.access_token)!==null&&s!==void 0?s:void 0,xform:Lf})})}catch(r){if(jr(r))return uBe(r)&&(await this._removeSession(),await ff(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:r};throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async n=>{const{data:i,error:s}=n;if(s)throw s;if(!i.session)throw new xf;const o=i.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await uv(this.storage,this.storageKey));const{data:u,error:d}=await Ur(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:o.access_token,xform:Lf});if(d)throw d;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(n){if(jr(n))return{data:{user:null},error:n};throw n}}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new xf;const r=Date.now()/1e3;let n=r,i=!0,s=null;const{payload:o}=jP(t.access_token);if(o.exp&&(n=o.exp,i=n<=r),i){const{session:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return{data:{user:null,session:null},error:c};if(!l)return{data:{user:null,session:null},error:null};s=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)throw c;s={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return{data:{user:s.user,session:s},error:null}}catch(r){if(jr(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async r=>{var n;if(!t){const{data:o,error:l}=r;if(l)throw l;t=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new xf;const{session:i,error:s}=await this._callRefreshToken(t.refresh_token);return s?{data:{user:null,session:null},error:s}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if(jr(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(t,r){try{if(!Pc())throw new aj("No browser detected.");if(t.error||t.error_description||t.error_code)throw new aj(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new yz("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new aj("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new yz("No code detected.");const{data:x,error:y}=await this._exchangeCodeForSession(t.code);if(y)throw y;const b=new URL(window.location.href);return b.searchParams.delete("code"),window.history.replaceState(window.history.state,"",b.toString()),{data:{session:x.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:i,access_token:s,refresh_token:o,expires_in:l,expires_at:c,token_type:u}=t;if(!s||!l||!o||!u)throw new aj("No session defined in URL");const d=Math.round(Date.now()/1e3),A=parseInt(l);let h=d+A;c&&(h=parseInt(c));const f=h-d;f*1e3<=Hv&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${A}s`);const m=h-A;d-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,h,d):d-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,h,d);const{data:p,error:g}=await this._getUser(s);if(g)throw g;const v={provider_token:n,provider_refresh_token:i,access_token:s,expires_in:A,expires_at:h,refresh_token:o,token_type:u,user:p.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:v,redirectType:t.type},error:null}}catch(n){if(jr(n))return{data:{session:null,redirectType:null},error:n};throw n}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){const r=await kp(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:i,error:s}=r;if(s)return{error:s};const o=(n=i.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:l}=await this.admin.signOut(o,t);if(l&&!(cBe(l)&&(l.status===404||l.status===401||l.status===403)))return{error:l}}return t!=="others"&&(await this._removeSession(),await ff(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){const r=yBe(),n={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,i;try{const{data:{session:s},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",t,"session",s)}catch(s){await((i=this.stateChangeEmitters.get(t))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",s),console.error(s)}})}async resetPasswordForEmail(t,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await uv(this.storage,this.storageKey,!0));try{return await Ur(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(s){if(jr(s))return{data:null,error:s};throw s}}async getUserIdentities(){var t;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return{data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null}}catch(r){if(jr(r))return{data:null,error:r};throw r}}async linkIdentity(t){var r;try{const{data:n,error:i}=await this._useSession(async s=>{var o,l,c,u,d;const{data:A,error:h}=s;if(h)throw h;const f=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await Ur(this.fetch,"GET",f,{headers:this.headers,jwt:(d=(u=A.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(i)throw i;return Pc()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),{data:{provider:t.provider,url:n==null?void 0:n.url},error:null}}catch(n){if(jr(n))return{data:{provider:t.provider,url:null},error:n};throw n}}async unlinkIdentity(t){try{return await this._useSession(async r=>{var n,i;const{data:s,error:o}=r;if(o)throw o;return await Ur(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(i=(n=s.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if(jr(r))return{data:null,error:r};throw r}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await NBe(async i=>(i>0&&await CBe(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await Ur(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Yd})),(i,s)=>{const o=200*Math.pow(2,i);return s&&NP(s)&&Date.now()+o-n{try{await l.callback(t,r)}catch(c){s.push(c)}});if(await Promise.all(o),s.length>0){for(let l=0;lthis._autoRefreshTokenTick(),Hv);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}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 t=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((n.expires_at*1e3-t)/Hv);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Hv}ms, refresh threshold is ${RF} ticks`),i<=RF&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof Vne)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Pc()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"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(t,r,n){const i=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[s,o]=await uv(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(o)}`});i.push(l.toString())}if(n!=null&&n.queryParams){const s=new URLSearchParams(n.queryParams);i.push(s.toString())}return n!=null&&n.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${t}?${i.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var n;const{data:i,error:s}=r;return s?{data:null,error:s}:await Ur(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(jr(r))return{data:null,error:r};throw r}}async _enroll(t){try{return await this._useSession(async r=>{var n,i;const{data:s,error:o}=r;if(o)return{data:null,error:o};const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:{issuer:t.issuer}),{data:c,error:u}=await Ur(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return u?{data:null,error:u}:(t.factorType==="totp"&&(!((i=c==null?void 0:c.totp)===null||i===void 0)&&i.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),{data:c,error:null})})}catch(r){if(jr(r))return{data:null,error:r};throw r}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:s}=r;if(s)return{data:null,error:s};const{data:o,error:l}=await Ur(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:{code:t.code,challenge_id:t.challengeId},headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return l?{data:null,error:l}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),{data:o,error:l})})}catch(r){if(jr(r))return{data:null,error:r};throw r}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:s}=r;return s?{data:null,error:s}:await Ur(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:{channel:t.channel},headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(jr(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(t){const{data:r,error:n}=await this._challenge({factorId:t.factorId});return n?{data:null,error:n}:await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){const{data:{user:t},error:r}=await this.getUser();if(r)return{data:null,error:r};const n=(t==null?void 0:t.factors)||[],i=n.filter(o=>o.factor_type==="totp"&&o.status==="verified"),s=n.filter(o=>o.factor_type==="phone"&&o.status==="verified");return{data:{all:n,totp:i,phone:s},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async t=>{var r,n;const{data:{session:i},error:s}=t;if(s)return{data:null,error:s};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:o}=jP(i.access_token);let l=null;o.aal&&(l=o.aal);let c=l;((n=(r=i.user.factors)===null||r===void 0?void 0:r.filter(A=>A.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(c="aal2");const d=o.amr||[];return{data:{currentLevel:l,nextLevel:c,currentAuthenticationMethods:d},error:null}}))}async fetchJwk(t,r={keys:[]}){let n=r.keys.find(l=>l.kid===t);if(n)return n;const i=Date.now();if(n=this.jwks.keys.find(l=>l.kid===t),n&&this.jwks_cached_at+oBe>i)return n;const{data:s,error:o}=await Ur(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!s.keys||s.keys.length===0||(this.jwks=s,this.jwks_cached_at=i,n=s.keys.find(l=>l.kid===t),!n)?null:n}async getClaims(t,r={}){try{let n=t;if(!n){const{data:f,error:m}=await this.getSession();if(m||!f.session)return{data:null,error:m};n=f.session.access_token}const{header:i,payload:s,signature:o,raw:{header:l,payload:c}}=jP(n);r!=null&&r.allowExpired||TBe(s.exp);const u=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!u){const{error:f}=await this.getUser(n);if(f)throw f;return{data:{claims:s,header:i,signature:o},error:null}}const d=PBe(i.alg),A=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,A,o,gBe(`${l}.${c}`)))throw new HF("Invalid JWT signature");return{data:{claims:s,header:i,signature:o},error:null}}catch(n){if(jr(n))return{data:null,error:n};throw n}}}K1.nextInstanceID=0;const VBe=K1;class qBe extends VBe{constructor(t){super(t)}}var XBe=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(d){try{u(n.next(d))}catch(A){o(A)}}function c(d){try{u(n.throw(d))}catch(A){o(A)}}function u(d){d.done?s(d.value):i(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})};class YBe{constructor(t,r,n){var i,s,o;if(this.supabaseUrl=t,this.supabaseKey=r,!t)throw new Error("supabaseUrl is required.");if(!r)throw new Error("supabaseKey is required.");const l=tBe(t),c=new URL(l);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`,d={db:KSe,realtime:qSe,auth:Object.assign(Object.assign({},VSe),{storageKey:u}),global:GSe},A=rBe(n??{},d);this.storageKey=(i=A.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(s=A.global.headers)!==null&&s!==void 0?s:{},A.accessToken?(this.accessToken=A.accessToken,this.auth=new Proxy({},{get:(h,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=A.auth)!==null&&o!==void 0?o:{},this.headers,A.global.fetch),this.fetch=ZSe(r,this._getAccessToken.bind(this),A.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},A.realtime)),this.rest=new fSe(new URL("rest/v1",c).href,{headers:this.headers,schema:A.db.schema,fetch:this.fetch}),this.storage=new $Se(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),A.accessToken||this._listenForAuthEvents()}get functions(){return new Wje(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,r={},n={}){return this.rest.rpc(t,r,n)}channel(t,r={config:{}}){return this.realtime.channel(t,r)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var t,r;return XBe(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:n}=yield this.auth.getSession();return(r=(t=n.session)===null||t===void 0?void 0:t.access_token)!==null&&r!==void 0?r:this.supabaseKey})}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:r,detectSessionInUrl:n,storage:i,storageKey:s,flowType:o,lock:l,debug:c},u,d){const A={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new qBe({url:this.authUrl.href,headers:Object.assign(Object.assign({},A),u),storageKey:s,autoRefreshToken:t,persistSession:r,detectSessionInUrl:n,storage:i,flowType:o,lock:l,debug:c,fetch:d,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(t){return new ESe(this.realtimeUrl.href,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n==null?void 0:n.access_token)})}_handleTokenChanged(t,r,n){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==n?this.changedAccessToken=n:t==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const JBe=(e,t,r)=>new YBe(e,t,r);function ZBe(){if(typeof window<"u"||typeof process>"u")return!1;const e=process.version;if(e==null)return!1;const t=e.match(/^v(\d+)\./);return t?parseInt(t[1],10)<=18:!1}ZBe()&&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 e_e="https://aycpjrxjzgepcqdvvlwc.supabase.co",t_e="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImF5Y3BqcnhqemdlcGNxZHZ2bHdjIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTYzMTgxNjEsImV4cCI6MjA3MTg5NDE2MX0.3zmpNcPUrL3A5gdJ-dgXNQKo-sNbIOlaJl5WV7fYqpM",Re=JBe(e_e,t_e,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),fi=()=>{const[e,t]=w.useState(null),[r,n]=w.useState(null),[i,s]=w.useState(!1),[o,l]=w.useState(!1),[c,u]=w.useState(!0),d=async A=>{try{const{data:h,error:f}=await Re.from("user_roles").select("role").eq("user_id",A);if(f&&f.code!=="PGRST116")return console.error("Error checking user roles:",f),{isAdmin:!1,isSuperAdmin:!1};const m=(h==null?void 0:h.map(p=>p.role))||[];return{isAdmin:m.includes("admin"),isSuperAdmin:m.includes("super_admin")}}catch(h){return console.error("Error checking user roles:",h),{isAdmin:!1,isSuperAdmin:!1}}};return w.useEffect(()=>{const{data:{subscription:A}}=Re.auth.onAuthStateChange((h,f)=>{n(f),t((f==null?void 0:f.user)??null),f!=null&&f.user?setTimeout(async()=>{const m=await d(f.user.id);s(m.isAdmin),l(m.isSuperAdmin),u(!1),Re.functions.invoke("detect-user-location").catch(p=>{console.error("Failed to detect location:",p)})},0):(s(!1),l(!1),u(!1))});return Re.auth.getSession().then(async({data:{session:h}})=>{if(n(h),t((h==null?void 0:h.user)??null),h!=null&&h.user){const f=await d(h.user.id);s(f.isAdmin),l(f.isSuperAdmin)}u(!1)}),()=>A.unsubscribe()},[]),{user:e,session:r,isAdmin:i,isSuperAdmin:o,loading:c}},qne=w.createContext(null),r_e=({children:e})=>{const{user:t}=fi(),[r,n]=w.useState(null),[i,s]=w.useState(!0),o=w.useCallback(async()=>{if(!t){s(!1);return}try{const{data:u,error:d}=await Re.rpc("check_usage_limits",{_user_id:t.id});if(d){console.error("Error fetching usage data:",d);return}n(u)}catch(u){console.error("Error fetching usage data:",u)}finally{s(!1)}},[t]),l=w.useCallback(async(u,d=1)=>{if(!t||!r)return;const A=new Date().toISOString().slice(0,7);try{const{error:h}=await Re.from("user_usage").upsert({user_id:t.id,month_year:A,words_generated:r.current_usage.words_generated+u,generations_used:r.current_usage.generations_used+d},{onConflict:"user_id,month_year"});if(h){console.error("Error updating usage:",h);return}await o()}catch(h){console.error("Error updating usage:",h)}},[t,r,o]),c=w.useCallback(()=>{if(!r)return null;if(r.tier==="admin")return{type:"generations",remaining:999999,total:999999,used:0};const u=r.tier_limits.generation_limit||10,d=r.current_usage.generations_used||0,A=u-d;return{type:"generations",remaining:Math.max(0,A),total:u,used:d}},[r]);return w.useEffect(()=>{o()},[o]),a.jsx(qne.Provider,{value:{usageData:r,loading:i,updateUsage:l,getRemainingCredits:c,refreshUsage:o},children:e})},Ua=()=>{const e=w.useContext(qne);return e||{usageData:null,loading:!0,updateUsage:async()=>{},getRemainingCredits:()=>null,refreshUsage:async()=>{}}},Xne="/assets/logo-DD0DhEMf.png";var n_e=w.createContext(void 0);function rp(e){const t=w.useContext(n_e);return e||t||"ltr"}var _P=0;function rU(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ez()),document.body.insertAdjacentElement("beforeend",e[1]??Ez()),_P++,()=>{_P===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_P--}},[])}function Ez(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var kP="focusScope.autoFocusOnMount",EP="focusScope.autoFocusOnUnmount",Tz={bubbles:!1,cancelable:!0},i_e="FocusScope",oE=w.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[l,c]=w.useState(null),u=Li(i),d=Li(s),A=w.useRef(null),h=Jt(t,p=>c(p)),f=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(n){let p=function(y){if(f.paused||!l)return;const b=y.target;l.contains(b)?A.current=b:yf(A.current,{select:!0})},g=function(y){if(f.paused||!l)return;const b=y.relatedTarget;b!==null&&(l.contains(b)||yf(A.current,{select:!0}))},v=function(y){if(document.activeElement===document.body)for(const C of y)C.removedNodes.length>0&&yf(l)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const x=new MutationObserver(v);return l&&x.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),x.disconnect()}}},[n,l,f.paused]),w.useEffect(()=>{if(l){Iz.add(f);const p=document.activeElement;if(!l.contains(p)){const v=new CustomEvent(kP,Tz);l.addEventListener(kP,u),l.dispatchEvent(v),v.defaultPrevented||(s_e(u_e(Yne(l)),{select:!0}),document.activeElement===p&&yf(l))}return()=>{l.removeEventListener(kP,u),setTimeout(()=>{const v=new CustomEvent(EP,Tz);l.addEventListener(EP,d),l.dispatchEvent(v),v.defaultPrevented||yf(p??document.body,{select:!0}),l.removeEventListener(EP,d),Iz.remove(f)},0)}}},[l,u,d,f]);const m=w.useCallback(p=>{if(!r&&!n||f.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,v=document.activeElement;if(g&&v){const x=p.currentTarget,[y,b]=a_e(x);y&&b?!p.shiftKey&&v===b?(p.preventDefault(),r&&yf(y,{select:!0})):p.shiftKey&&v===y&&(p.preventDefault(),r&&yf(b,{select:!0})):v===x&&p.preventDefault()}},[r,n,f.paused]);return a.jsx(at.div,{tabIndex:-1,...o,ref:h,onKeyDown:m})});oE.displayName=i_e;function s_e(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(yf(n,{select:t}),document.activeElement!==r)return}function a_e(e){const t=Yne(e),r=Pz(t,e),n=Pz(t.reverse(),e);return[r,n]}function Yne(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Pz(e,t){for(const r of e)if(!o_e(r,{upTo:t}))return r}function o_e(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function l_e(e){return e instanceof HTMLInputElement&&"select"in e}function yf(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&l_e(e)&&t&&e.select()}}var Iz=c_e();function c_e(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Oz(e,t),e.unshift(t)},remove(t){var r;e=Oz(e,t),(r=e[0])==null||r.resume()}}}function Oz(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function u_e(e){return e.filter(t=>t.tagName!=="A")}var TP="rovingFocusGroup.onEntryFocus",d_e={bubbles:!1,cancelable:!0},BC="RovingFocusGroup",[$F,Jne,A_e]=Yh(BC),[f_e,P0]=Zi(BC,[A_e]),[h_e,p_e]=f_e(BC),Zne=w.forwardRef((e,t)=>a.jsx($F.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx($F.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(m_e,{...e,ref:t})})}));Zne.displayName=BC;var m_e=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...A}=e,h=w.useRef(null),f=Jt(t,h),m=rp(s),[p,g]=fa({prop:o,defaultProp:l??null,onChange:c,caller:BC}),[v,x]=w.useState(!1),y=Li(u),b=Jne(r),C=w.useRef(!1),[j,S]=w.useState(0);return w.useEffect(()=>{const T=h.current;if(T)return T.addEventListener(TP,y),()=>T.removeEventListener(TP,y)},[y]),a.jsx(h_e,{scope:r,orientation:n,dir:m,loop:i,currentTabStopId:p,onItemFocus:w.useCallback(T=>g(T),[g]),onItemShiftTab:w.useCallback(()=>x(!0),[]),onFocusableItemAdd:w.useCallback(()=>S(T=>T+1),[]),onFocusableItemRemove:w.useCallback(()=>S(T=>T-1),[]),children:a.jsx(at.div,{tabIndex:v||j===0?-1:0,"data-orientation":n,...A,ref:f,style:{outline:"none",...e.style},onMouseDown:Ye(e.onMouseDown,()=>{C.current=!0}),onFocus:Ye(e.onFocus,T=>{const B=!C.current;if(T.target===T.currentTarget&&B&&!v){const I=new CustomEvent(TP,d_e);if(T.currentTarget.dispatchEvent(I),!I.defaultPrevented){const P=b().filter(G=>G.focusable),E=P.find(G=>G.active),M=P.find(G=>G.id===p),R=[E,M,...P].filter(Boolean).map(G=>G.ref.current);rie(R,d)}}C.current=!1}),onBlur:Ye(e.onBlur,()=>x(!1))})})}),eie="RovingFocusGroupItem",tie=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,children:o,...l}=e,c=lo(),u=s||c,d=p_e(eie,r),A=d.currentTabStopId===u,h=Jne(r),{onFocusableItemAdd:f,onFocusableItemRemove:m,currentTabStopId:p}=d;return w.useEffect(()=>{if(n)return f(),()=>m()},[n,f,m]),a.jsx($F.ItemSlot,{scope:r,id:u,focusable:n,active:i,children:a.jsx(at.span,{tabIndex:A?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:Ye(e.onMouseDown,g=>{n?d.onItemFocus(u):g.preventDefault()}),onFocus:Ye(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:Ye(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){d.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const v=x_e(g,d.orientation,d.dir);if(v!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let y=h().filter(b=>b.focusable).map(b=>b.ref.current);if(v==="last")y.reverse();else if(v==="prev"||v==="next"){v==="prev"&&y.reverse();const b=y.indexOf(g.currentTarget);y=d.loop?y_e(y,b+1):y.slice(b+1)}setTimeout(()=>rie(y))}}),children:typeof o=="function"?o({isCurrentTabStop:A,hasTabStop:p!=null}):o})})});tie.displayName=eie;var g_e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function v_e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function x_e(e,t,r){const n=v_e(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return g_e[n]}function rie(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function y_e(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var nU=Zne,iU=tie,b_e=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},hv=new WeakMap,oj=new WeakMap,lj={},PP=0,nie=function(e){return e&&(e.host||nie(e.parentNode))},w_e=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=nie(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},C_e=function(e,t,r,n){var i=w_e(t,Array.isArray(e)?e:[e]);lj[r]||(lj[r]=new WeakMap);var s=lj[r],o=[],l=new Set,c=new Set(i),u=function(A){!A||l.has(A)||(l.add(A),u(A.parentNode))};i.forEach(u);var d=function(A){!A||c.has(A)||Array.prototype.forEach.call(A.children,function(h){if(l.has(h))d(h);else try{var f=h.getAttribute(n),m=f!==null&&f!=="false",p=(hv.get(h)||0)+1,g=(s.get(h)||0)+1;hv.set(h,p),s.set(h,g),o.push(h),p===1&&m&&oj.set(h,!0),g===1&&h.setAttribute(r,"true"),m||h.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return d(t),l.clear(),PP++,function(){o.forEach(function(A){var h=hv.get(A)-1,f=s.get(A)-1;hv.set(A,h),s.set(A,f),h||(oj.has(A)||A.removeAttribute(n),oj.delete(A)),f||A.removeAttribute(r)}),PP--,PP||(hv=new WeakMap,hv=new WeakMap,oj=new WeakMap,lj={})}},sU=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=b_e(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),C_e(n,i,r,"aria-hidden")):function(){return null}},Mu=function(){return Mu=Object.assign||function(t){for(var r,n=1,i=arguments.length;n"u")return U_e;var t=Q_e(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},$_e=oie(),Mx="data-scroll-locked",z_e=function(e,t,r,n){var i=e.left,s=e.top,o=e.right,l=e.gap;return r===void 0&&(r="margin"),` .`.concat(j_e,` { overflow: hidden `).concat(n,`; padding-right: `).concat(l,"px ").concat(n,`; } body[`).concat(Mx,`] { overflow: hidden `).concat(n,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` padding-left: `.concat(i,`px; padding-top: `).concat(s,`px; padding-right: `).concat(o,`px; margin-left:0; margin-top:0; margin-right: `).concat(l,"px ").concat(n,`; `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),` } .`).concat($S,` { right: `).concat(l,"px ").concat(n,`; } .`).concat(zS,` { margin-right: `).concat(l,"px ").concat(n,`; } .`).concat($S," .").concat($S,` { right: 0 `).concat(n,`; } .`).concat(zS," .").concat(zS,` { margin-right: 0 `).concat(n,`; } body[`).concat(Mx,`] { `).concat(S_e,": ").concat(l,`px; } `)},Lz=function(){var e=parseInt(document.body.getAttribute(Mx)||"0",10);return isFinite(e)?e:0},W_e=function(){w.useEffect(function(){return document.body.setAttribute(Mx,(Lz()+1).toString()),function(){var e=Lz()-1;e<=0?document.body.removeAttribute(Mx):document.body.setAttribute(Mx,e.toString())}},[])},G_e=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;W_e();var s=w.useMemo(function(){return H_e(i)},[i]);return w.createElement($_e,{styles:z_e(s,!t,i,r?"":"!important")})},zF=!1;if(typeof window<"u")try{var cj=Object.defineProperty({},"passive",{get:function(){return zF=!0,!0}});window.addEventListener("test",cj,cj),window.removeEventListener("test",cj,cj)}catch{zF=!1}var pv=zF?{passive:!1}:!1,K_e=function(e){return e.tagName==="TEXTAREA"},lie=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!K_e(e)&&r[t]==="visible")},V_e=function(e){return lie(e,"overflowY")},q_e=function(e){return lie(e,"overflowX")},Mz=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=cie(e,n);if(i){var s=uie(e,n),o=s[1],l=s[2];if(o>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},X_e=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Y_e=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},cie=function(e,t){return e==="v"?V_e(t):q_e(t)},uie=function(e,t){return e==="v"?X_e(t):Y_e(t)},J_e=function(e,t){return e==="h"&&t==="rtl"?-1:1},Z_e=function(e,t,r,n,i){var s=J_e(e,window.getComputedStyle(t).direction),o=s*n,l=r.target,c=t.contains(l),u=!1,d=o>0,A=0,h=0;do{if(!l)break;var f=uie(e,l),m=f[0],p=f[1],g=f[2],v=p-g-s*m;(m||v)&&cie(e,l)&&(A+=v,h+=m);var x=l.parentNode;l=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(A)<1||!i)||!d&&(Math.abs(h)<1||!i))&&(u=!0),u},uj=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Dz=function(e){return[e.deltaX,e.deltaY]},Rz=function(e){return e&&"current"in e?e.current:e},eke=function(e,t){return e[0]===t[0]&&e[1]===t[1]},tke=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},rke=0,mv=[];function nke(e){var t=w.useRef([]),r=w.useRef([0,0]),n=w.useRef(),i=w.useState(rke++)[0],s=w.useState(oie)[0],o=w.useRef(e);w.useEffect(function(){o.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=N_e([e.lockRef.current],(e.shards||[]).map(Rz),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=w.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var v=uj(p),x=r.current,y="deltaX"in p?p.deltaX:x[0]-v[0],b="deltaY"in p?p.deltaY:x[1]-v[1],C,j=p.target,S=Math.abs(y)>Math.abs(b)?"h":"v";if("touches"in p&&S==="h"&&j.type==="range")return!1;var T=Mz(S,j);if(!T)return!0;if(T?C=S:(C=S==="v"?"h":"v",T=Mz(S,j)),!T)return!1;if(!n.current&&"changedTouches"in p&&(y||b)&&(n.current=C),!C)return!0;var B=n.current||C;return Z_e(B,g,p,B==="h"?y:b,!0)},[]),c=w.useCallback(function(p){var g=p;if(!(!mv.length||mv[mv.length-1]!==s)){var v="deltaY"in g?Dz(g):uj(g),x=t.current.filter(function(C){return C.name===g.type&&(C.target===g.target||g.target===C.shadowParent)&&eke(C.delta,v)})[0];if(x&&x.should){g.cancelable&&g.preventDefault();return}if(!x){var y=(o.current.shards||[]).map(Rz).filter(Boolean).filter(function(C){return C.contains(g.target)}),b=y.length>0?l(g,y[0]):!o.current.noIsolation;b&&g.cancelable&&g.preventDefault()}}},[]),u=w.useCallback(function(p,g,v,x){var y={name:p,delta:g,target:v,should:x,shadowParent:ike(v)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(b){return b!==y})},1)},[]),d=w.useCallback(function(p){r.current=uj(p),n.current=void 0},[]),A=w.useCallback(function(p){u(p.type,Dz(p),p.target,l(p,e.lockRef.current))},[]),h=w.useCallback(function(p){u(p.type,uj(p),p.target,l(p,e.lockRef.current))},[]);w.useEffect(function(){return mv.push(s),e.setCallbacks({onScrollCapture:A,onWheelCapture:A,onTouchMoveCapture:h}),document.addEventListener("wheel",c,pv),document.addEventListener("touchmove",c,pv),document.addEventListener("touchstart",d,pv),function(){mv=mv.filter(function(p){return p!==s}),document.removeEventListener("wheel",c,pv),document.removeEventListener("touchmove",c,pv),document.removeEventListener("touchstart",d,pv)}},[]);var f=e.removeScrollBar,m=e.inert;return w.createElement(w.Fragment,null,m?w.createElement(s,{styles:tke(i)}):null,f?w.createElement(G_e,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ike(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ske=I_e(aie,nke);var cE=w.forwardRef(function(e,t){return w.createElement(lE,Mu({},e,{ref:t,sideCar:ske}))});cE.classNames=lE.classNames;var WF=["Enter"," "],ake=["ArrowDown","PageUp","Home"],die=["ArrowUp","PageDown","End"],oke=[...ake,...die],lke={ltr:[...WF,"ArrowRight"],rtl:[...WF,"ArrowLeft"]},cke={ltr:["ArrowLeft"],rtl:["ArrowRight"]},_C="Menu",[V1,uke,dke]=Yh(_C),[Tg,Aie]=Zi(_C,[dke,j0,P0]),uE=j0(),fie=P0(),[Ake,Pg]=Tg(_C),[fke,kC]=Tg(_C),hie=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:i,onOpenChange:s,modal:o=!0}=e,l=uE(t),[c,u]=w.useState(null),d=w.useRef(!1),A=Li(s),h=rp(i);return w.useEffect(()=>{const f=()=>{d.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>d.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),a.jsx(M6,{...l,children:a.jsx(Ake,{scope:t,open:r,onOpenChange:A,content:c,onContentChange:u,children:a.jsx(fke,{scope:t,onClose:w.useCallback(()=>A(!1),[A]),isUsingKeyboardRef:d,dir:h,modal:o,children:n})})})};hie.displayName=_C;var hke="MenuAnchor",aU=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=uE(r);return a.jsx(D6,{...i,...n,ref:t})});aU.displayName=hke;var oU="MenuPortal",[pke,pie]=Tg(oU,{forceMount:void 0}),mie=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:i}=e,s=Pg(oU,t);return a.jsx(pke,{scope:t,forceMount:r,children:a.jsx(Gs,{present:r||s.open,children:a.jsx(mC,{asChild:!0,container:i,children:n})})})};mie.displayName=oU;var cc="MenuContent",[mke,lU]=Tg(cc),gie=w.forwardRef((e,t)=>{const r=pie(cc,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,s=Pg(cc,e.__scopeMenu),o=kC(cc,e.__scopeMenu);return a.jsx(V1.Provider,{scope:e.__scopeMenu,children:a.jsx(Gs,{present:n||s.open,children:a.jsx(V1.Slot,{scope:e.__scopeMenu,children:o.modal?a.jsx(gke,{...i,ref:t}):a.jsx(vke,{...i,ref:t})})})})}),gke=w.forwardRef((e,t)=>{const r=Pg(cc,e.__scopeMenu),n=w.useRef(null),i=Jt(t,n);return w.useEffect(()=>{const s=n.current;if(s)return sU(s)},[]),a.jsx(cU,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Ye(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),vke=w.forwardRef((e,t)=>{const r=Pg(cc,e.__scopeMenu);return a.jsx(cU,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),xke=Jm("MenuContent.ScrollLock"),cU=w.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:A,onInteractOutside:h,onDismiss:f,disableOutsideScroll:m,...p}=e,g=Pg(cc,r),v=kC(cc,r),x=uE(r),y=fie(r),b=uke(r),[C,j]=w.useState(null),S=w.useRef(null),T=Jt(t,S,g.onContentChange),B=w.useRef(0),I=w.useRef(""),P=w.useRef(0),E=w.useRef(null),M=w.useRef("right"),_=w.useRef(0),R=m?cE:w.Fragment,G=m?{as:xke,allowPinchZoom:!0}:void 0,U=z=>{var oe,pe;const Y=I.current+z,$=b().filter(de=>!de.disabled),O=document.activeElement,W=(oe=$.find(de=>de.ref.current===O))==null?void 0:oe.textValue,V=$.map(de=>de.textValue),X=Tke(V,Y,W),ne=(pe=$.find(de=>de.textValue===X))==null?void 0:pe.ref.current;(function de(ge){I.current=ge,window.clearTimeout(B.current),ge!==""&&(B.current=window.setTimeout(()=>de(""),1e3))})(Y),ne&&setTimeout(()=>ne.focus())};w.useEffect(()=>()=>window.clearTimeout(B.current),[]),rU();const Q=w.useCallback(z=>{var $,O;return M.current===(($=E.current)==null?void 0:$.side)&&Ike(z,(O=E.current)==null?void 0:O.area)},[]);return a.jsx(mke,{scope:r,searchRef:I,onItemEnter:w.useCallback(z=>{Q(z)&&z.preventDefault()},[Q]),onItemLeave:w.useCallback(z=>{var Y;Q(z)||((Y=S.current)==null||Y.focus(),j(null))},[Q]),onTriggerLeave:w.useCallback(z=>{Q(z)&&z.preventDefault()},[Q]),pointerGraceTimerRef:P,onPointerGraceIntentChange:w.useCallback(z=>{E.current=z},[]),children:a.jsx(R,{...G,children:a.jsx(oE,{asChild:!0,trapped:i,onMountAutoFocus:Ye(s,z=>{var Y;z.preventDefault(),(Y=S.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:a.jsx(kg,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:A,onInteractOutside:h,onDismiss:f,children:a.jsx(nU,{asChild:!0,...y,dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:C,onCurrentTabStopIdChange:j,onEntryFocus:Ye(c,z=>{v.isUsingKeyboardRef.current||z.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(R6,{role:"menu","aria-orientation":"vertical","data-state":Iie(g.open),"data-radix-menu-content":"",dir:v.dir,...x,...p,ref:T,style:{outline:"none",...p.style},onKeyDown:Ye(p.onKeyDown,z=>{const $=z.target.closest("[data-radix-menu-content]")===z.currentTarget,O=z.ctrlKey||z.altKey||z.metaKey,W=z.key.length===1;$&&(z.key==="Tab"&&z.preventDefault(),!O&&W&&U(z.key));const V=S.current;if(z.target!==V||!oke.includes(z.key))return;z.preventDefault();const ne=b().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);die.includes(z.key)&&ne.reverse(),kke(ne)}),onBlur:Ye(e.onBlur,z=>{z.currentTarget.contains(z.target)||(window.clearTimeout(B.current),I.current="")}),onPointerMove:Ye(e.onPointerMove,q1(z=>{const Y=z.target,$=_.current!==z.clientX;if(z.currentTarget.contains(Y)&&$){const O=z.clientX>_.current?"right":"left";M.current=O,_.current=z.clientX}}))})})})})})})});gie.displayName=cc;var yke="MenuGroup",uU=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return a.jsx(at.div,{role:"group",...n,ref:t})});uU.displayName=yke;var bke="MenuLabel",vie=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return a.jsx(at.div,{...n,ref:t})});vie.displayName=bke;var YB="MenuItem",Uz="menu.itemSelect",dE=w.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...i}=e,s=w.useRef(null),o=kC(YB,e.__scopeMenu),l=lU(YB,e.__scopeMenu),c=Jt(t,s),u=w.useRef(!1),d=()=>{const A=s.current;if(!r&&A){const h=new CustomEvent(Uz,{bubbles:!0,cancelable:!0});A.addEventListener(Uz,f=>n==null?void 0:n(f),{once:!0}),F1(A,h),h.defaultPrevented?u.current=!1:o.onClose()}};return a.jsx(xie,{...i,ref:c,disabled:r,onClick:Ye(e.onClick,d),onPointerDown:A=>{var h;(h=e.onPointerDown)==null||h.call(e,A),u.current=!0},onPointerUp:Ye(e.onPointerUp,A=>{var h;u.current||(h=A.currentTarget)==null||h.click()}),onKeyDown:Ye(e.onKeyDown,A=>{const h=l.searchRef.current!=="";r||h&&A.key===" "||WF.includes(A.key)&&(A.currentTarget.click(),A.preventDefault())})})});dE.displayName=YB;var xie=w.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=e,o=lU(YB,r),l=fie(r),c=w.useRef(null),u=Jt(t,c),[d,A]=w.useState(!1),[h,f]=w.useState("");return w.useEffect(()=>{const m=c.current;m&&f((m.textContent??"").trim())},[s.children]),a.jsx(V1.ItemSlot,{scope:r,disabled:n,textValue:i??h,children:a.jsx(iU,{asChild:!0,...l,focusable:!n,children:a.jsx(at.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:u,onPointerMove:Ye(e.onPointerMove,q1(m=>{n?o.onItemLeave(m):(o.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ye(e.onPointerLeave,q1(m=>o.onItemLeave(m))),onFocus:Ye(e.onFocus,()=>A(!0)),onBlur:Ye(e.onBlur,()=>A(!1))})})})}),wke="MenuCheckboxItem",yie=w.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...i}=e;return a.jsx(jie,{scope:e.__scopeMenu,checked:r,children:a.jsx(dE,{role:"menuitemcheckbox","aria-checked":JB(r)?"mixed":r,...i,ref:t,"data-state":AU(r),onSelect:Ye(i.onSelect,()=>n==null?void 0:n(JB(r)?!0:!r),{checkForDefaultPrevented:!1})})})});yie.displayName=wke;var bie="MenuRadioGroup",[Cke,Nke]=Tg(bie,{value:void 0,onValueChange:()=>{}}),wie=w.forwardRef((e,t)=>{const{value:r,onValueChange:n,...i}=e,s=Li(n);return a.jsx(Cke,{scope:e.__scopeMenu,value:r,onValueChange:s,children:a.jsx(uU,{...i,ref:t})})});wie.displayName=bie;var Cie="MenuRadioItem",Nie=w.forwardRef((e,t)=>{const{value:r,...n}=e,i=Nke(Cie,e.__scopeMenu),s=r===i.value;return a.jsx(jie,{scope:e.__scopeMenu,checked:s,children:a.jsx(dE,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":AU(s),onSelect:Ye(n.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})})});Nie.displayName=Cie;var dU="MenuItemIndicator",[jie,jke]=Tg(dU,{checked:!1}),Sie=w.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...i}=e,s=jke(dU,r);return a.jsx(Gs,{present:n||JB(s.checked)||s.checked===!0,children:a.jsx(at.span,{...i,ref:t,"data-state":AU(s.checked)})})});Sie.displayName=dU;var Ske="MenuSeparator",Bie=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return a.jsx(at.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});Bie.displayName=Ske;var Bke="MenuArrow",_ie=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=uE(r);return a.jsx(U6,{...i,...n,ref:t})});_ie.displayName=Bke;var _ke="MenuSub",[lNt,kie]=Tg(_ke),dw="MenuSubTrigger",Eie=w.forwardRef((e,t)=>{const r=Pg(dw,e.__scopeMenu),n=kC(dw,e.__scopeMenu),i=kie(dw,e.__scopeMenu),s=lU(dw,e.__scopeMenu),o=w.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=s,u={__scopeMenu:e.__scopeMenu},d=w.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return w.useEffect(()=>d,[d]),w.useEffect(()=>{const A=l.current;return()=>{window.clearTimeout(A),c(null)}},[l,c]),a.jsx(aU,{asChild:!0,...u,children:a.jsx(xie,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":Iie(r.open),...e,ref:pC(t,i.onTriggerChange),onClick:A=>{var h;(h=e.onClick)==null||h.call(e,A),!(e.disabled||A.defaultPrevented)&&(A.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Ye(e.onPointerMove,q1(A=>{s.onItemEnter(A),!A.defaultPrevented&&!e.disabled&&!r.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:Ye(e.onPointerLeave,q1(A=>{var f,m;d();const h=(f=r.content)==null?void 0:f.getBoundingClientRect();if(h){const p=(m=r.content)==null?void 0:m.dataset.side,g=p==="right",v=g?-5:5,x=h[g?"left":"right"],y=h[g?"right":"left"];s.onPointerGraceIntentChange({area:[{x:A.clientX+v,y:A.clientY},{x,y:h.top},{x:y,y:h.top},{x:y,y:h.bottom},{x,y:h.bottom}],side:p}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(A),A.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Ye(e.onKeyDown,A=>{var f;const h=s.searchRef.current!=="";e.disabled||h&&A.key===" "||lke[n.dir].includes(A.key)&&(r.onOpenChange(!0),(f=r.content)==null||f.focus(),A.preventDefault())})})})});Eie.displayName=dw;var Tie="MenuSubContent",Pie=w.forwardRef((e,t)=>{const r=pie(cc,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,s=Pg(cc,e.__scopeMenu),o=kC(cc,e.__scopeMenu),l=kie(Tie,e.__scopeMenu),c=w.useRef(null),u=Jt(t,c);return a.jsx(V1.Provider,{scope:e.__scopeMenu,children:a.jsx(Gs,{present:n||s.open,children:a.jsx(V1.Slot,{scope:e.__scopeMenu,children:a.jsx(cU,{id:l.contentId,"aria-labelledby":l.triggerId,...i,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var A;o.isUsingKeyboardRef.current&&((A=c.current)==null||A.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Ye(e.onFocusOutside,d=>{d.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Ye(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:Ye(e.onKeyDown,d=>{var f;const A=d.currentTarget.contains(d.target),h=cke[o.dir].includes(d.key);A&&h&&(s.onOpenChange(!1),(f=l.trigger)==null||f.focus(),d.preventDefault())})})})})})});Pie.displayName=Tie;function Iie(e){return e?"open":"closed"}function JB(e){return e==="indeterminate"}function AU(e){return JB(e)?"indeterminate":e?"checked":"unchecked"}function kke(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function Eke(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function Tke(e,t,r){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let o=Eke(e,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==r));const c=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function Pke(e,t){const{x:r,y:n}=e;let i=!1;for(let s=0,o=t.length-1;sn!=h>n&&r<(A-u)*(n-d)/(h-d)+u&&(i=!i)}return i}function Ike(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return Pke(r,t)}function q1(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Oke=hie,Fke=aU,Lke=mie,Mke=gie,Dke=uU,Rke=vie,Uke=dE,Qke=yie,Hke=wie,$ke=Nie,zke=Sie,Wke=Bie,Gke=_ie,Kke=Eie,Vke=Pie,AE="DropdownMenu",[qke,cNt]=Zi(AE,[Aie]),go=Aie(),[Xke,Oie]=qke(AE),Fie=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:i,defaultOpen:s,onOpenChange:o,modal:l=!0}=e,c=go(t),u=w.useRef(null),[d,A]=fa({prop:i,defaultProp:s??!1,onChange:o,caller:AE});return a.jsx(Xke,{scope:t,triggerId:lo(),triggerRef:u,contentId:lo(),open:d,onOpenChange:A,onOpenToggle:w.useCallback(()=>A(h=>!h),[A]),modal:l,children:a.jsx(Oke,{...c,open:d,onOpenChange:A,dir:n,modal:l,children:r})})};Fie.displayName=AE;var Lie="DropdownMenuTrigger",Mie=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=e,s=Oie(Lie,r),o=go(r);return a.jsx(Fke,{asChild:!0,...o,children:a.jsx(at.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...i,ref:pC(t,s.triggerRef),onPointerDown:Ye(e.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(s.onOpenToggle(),s.open||l.preventDefault())}),onKeyDown:Ye(e.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&s.onOpenToggle(),l.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});Mie.displayName=Lie;var Yke="DropdownMenuPortal",Die=e=>{const{__scopeDropdownMenu:t,...r}=e,n=go(t);return a.jsx(Lke,{...n,...r})};Die.displayName=Yke;var Rie="DropdownMenuContent",Uie=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Oie(Rie,r),s=go(r),o=w.useRef(!1);return a.jsx(Mke,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...n,ref:t,onCloseAutoFocus:Ye(e.onCloseAutoFocus,l=>{var c;o.current||(c=i.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:Ye(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!i.modal||d)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Uie.displayName=Rie;var Jke="DropdownMenuGroup",Zke=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=go(r);return a.jsx(Dke,{...i,...n,ref:t})});Zke.displayName=Jke;var e5e="DropdownMenuLabel",Qie=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=go(r);return a.jsx(Rke,{...i,...n,ref:t})});Qie.displayName=e5e;var t5e="DropdownMenuItem",Hie=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=go(r);return a.jsx(Uke,{...i,...n,ref:t})});Hie.displayName=t5e;var r5e="DropdownMenuCheckboxItem",$ie=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=go(r);return a.jsx(Qke,{...i,...n,ref:t})});$ie.displayName=r5e;var n5e="DropdownMenuRadioGroup",i5e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=go(r);return a.jsx(Hke,{...i,...n,ref:t})});i5e.displayName=n5e;var s5e="DropdownMenuRadioItem",zie=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=go(r);return a.jsx($ke,{...i,...n,ref:t})});zie.displayName=s5e;var a5e="DropdownMenuItemIndicator",Wie=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=go(r);return a.jsx(zke,{...i,...n,ref:t})});Wie.displayName=a5e;var o5e="DropdownMenuSeparator",Gie=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=go(r);return a.jsx(Wke,{...i,...n,ref:t})});Gie.displayName=o5e;var l5e="DropdownMenuArrow",c5e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=go(r);return a.jsx(Gke,{...i,...n,ref:t})});c5e.displayName=l5e;var u5e="DropdownMenuSubTrigger",Kie=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=go(r);return a.jsx(Kke,{...i,...n,ref:t})});Kie.displayName=u5e;var d5e="DropdownMenuSubContent",Vie=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=go(r);return a.jsx(Vke,{...i,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Vie.displayName=d5e;var A5e=Fie,f5e=Mie,h5e=Die,qie=Uie,Xie=Qie,Yie=Hie,Jie=$ie,Zie=zie,ese=Wie,tse=Gie,rse=Kie,nse=Vie;const fE=A5e,hE=f5e,p5e=w.forwardRef(({className:e,inset:t,children:r,...n},i)=>a.jsxs(rse,{ref:i,className:Le("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,a.jsx(vC,{className:"ml-auto h-4 w-4"})]}));p5e.displayName=rse.displayName;const m5e=w.forwardRef(({className:e,...t},r)=>a.jsx(nse,{ref:r,className:Le("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));m5e.displayName=nse.displayName;const EC=w.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(h5e,{children:a.jsx(qie,{ref:n,sideOffset:t,className:Le("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));EC.displayName=qie.displayName;const xA=w.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(Yie,{ref:n,className:Le("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));xA.displayName=Yie.displayName;const g5e=w.forwardRef(({className:e,children:t,checked:r,...n},i)=>a.jsxs(Jie,{ref:i,className:Le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(ese,{children:a.jsx(dr,{className:"h-4 w-4"})})}),t]}));g5e.displayName=Jie.displayName;const v5e=w.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Zie,{ref:n,className:Le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(ese,{children:a.jsx(Yte,{className:"h-2 w-2 fill-current"})})}),t]}));v5e.displayName=Zie.displayName;const fU=w.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(Xie,{ref:n,className:Le("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));fU.displayName=Xie.displayName;const Im=w.forwardRef(({className:e,...t},r)=>a.jsx(tse,{ref:r,className:Le("-mx-1 my-1 h-px bg-muted",e),...t}));Im.displayName=tse.displayName;function I0(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ig="NavigationMenu",[hU,ise,x5e]=Yh(Ig),[GF,y5e,b5e]=Yh(Ig),[pU,uNt]=Zi(Ig,[x5e,b5e]),[w5e,yc]=pU(Ig),[C5e,N5e]=pU(Ig),sse=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,value:n,onValueChange:i,defaultValue:s,delayDuration:o=200,skipDelayDuration:l=300,orientation:c="horizontal",dir:u,...d}=e,[A,h]=w.useState(null),f=Jt(t,B=>h(B)),m=rp(u),p=w.useRef(0),g=w.useRef(0),v=w.useRef(0),[x,y]=w.useState(!0),[b,C]=fa({prop:n,onChange:B=>{const I=B!=="",P=l>0;I?(window.clearTimeout(v.current),P&&y(!1)):(window.clearTimeout(v.current),v.current=window.setTimeout(()=>y(!0),l)),i==null||i(B)},defaultProp:s??"",caller:Ig}),j=w.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>C(""),150)},[C]),S=w.useCallback(B=>{window.clearTimeout(g.current),C(B)},[C]),T=w.useCallback(B=>{b===B?window.clearTimeout(g.current):p.current=window.setTimeout(()=>{window.clearTimeout(g.current),C(B)},o)},[b,C,o]);return w.useEffect(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(g.current),window.clearTimeout(v.current)},[]),a.jsx(ase,{scope:r,isRootMenu:!0,value:b,dir:m,orientation:c,rootNavigationMenu:A,onTriggerEnter:B=>{window.clearTimeout(p.current),x?T(B):S(B)},onTriggerLeave:()=>{window.clearTimeout(p.current),j()},onContentEnter:()=>window.clearTimeout(g.current),onContentLeave:j,onItemSelect:B=>{C(I=>I===B?"":B)},onItemDismiss:()=>C(""),children:a.jsx(at.nav,{"aria-label":"Main","data-orientation":c,dir:m,...d,ref:f})})});sse.displayName=Ig;var KF="NavigationMenuSub",j5e=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,value:n,onValueChange:i,defaultValue:s,orientation:o="horizontal",...l}=e,c=yc(KF,r),[u,d]=fa({prop:n,onChange:i,defaultProp:s??"",caller:KF});return a.jsx(ase,{scope:r,isRootMenu:!1,value:u,dir:c.dir,orientation:o,rootNavigationMenu:c.rootNavigationMenu,onTriggerEnter:A=>d(A),onItemSelect:A=>d(A),onItemDismiss:()=>d(""),children:a.jsx(at.div,{"data-orientation":o,...l,ref:t})})});j5e.displayName=KF;var ase=e=>{const{scope:t,isRootMenu:r,rootNavigationMenu:n,dir:i,orientation:s,children:o,value:l,onItemSelect:c,onItemDismiss:u,onTriggerEnter:d,onTriggerLeave:A,onContentEnter:h,onContentLeave:f}=e,[m,p]=w.useState(null),[g,v]=w.useState(new Map),[x,y]=w.useState(null);return a.jsx(w5e,{scope:t,isRootMenu:r,rootNavigationMenu:n,value:l,previousValue:I0(l),baseId:lo(),dir:i,orientation:s,viewport:m,onViewportChange:p,indicatorTrack:x,onIndicatorTrackChange:y,onTriggerEnter:Li(d),onTriggerLeave:Li(A),onContentEnter:Li(h),onContentLeave:Li(f),onItemSelect:Li(c),onItemDismiss:Li(u),onViewportContentChange:w.useCallback((b,C)=>{v(j=>(j.set(b,C),new Map(j)))},[]),onViewportContentRemove:w.useCallback(b=>{v(C=>C.has(b)?(C.delete(b),new Map(C)):C)},[]),children:a.jsx(hU.Provider,{scope:t,children:a.jsx(C5e,{scope:t,items:g,children:o})})})},ose="NavigationMenuList",lse=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,...n}=e,i=yc(ose,r),s=a.jsx(at.ul,{"data-orientation":i.orientation,...n,ref:t});return a.jsx(at.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange,children:a.jsx(hU.Slot,{scope:r,children:i.isRootMenu?a.jsx(vse,{asChild:!0,children:s}):s})})});lse.displayName=ose;var cse="NavigationMenuItem",[S5e,use]=pU(cse),dse=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,value:n,...i}=e,s=lo(),o=n||s||"LEGACY_REACT_AUTO_VALUE",l=w.useRef(null),c=w.useRef(null),u=w.useRef(null),d=w.useRef(()=>{}),A=w.useRef(!1),h=w.useCallback((m="start")=>{if(l.current){d.current();const p=qF(l.current);p.length&&vU(m==="start"?p:p.reverse())}},[]),f=w.useCallback(()=>{if(l.current){const m=qF(l.current);m.length&&(d.current=I5e(m))}},[]);return a.jsx(S5e,{scope:r,value:o,triggerRef:c,contentRef:l,focusProxyRef:u,wasEscapeCloseRef:A,onEntryKeyDown:h,onFocusProxyEnter:h,onRootContentClose:f,onContentFocusOutside:f,children:a.jsx(at.li,{...i,ref:t})})});dse.displayName=cse;var VF="NavigationMenuTrigger",Ase=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,disabled:n,...i}=e,s=yc(VF,e.__scopeNavigationMenu),o=use(VF,e.__scopeNavigationMenu),l=w.useRef(null),c=Jt(l,o.triggerRef,t),u=yse(s.baseId,o.value),d=bse(s.baseId,o.value),A=w.useRef(!1),h=w.useRef(!1),f=o.value===s.value;return a.jsxs(a.Fragment,{children:[a.jsx(hU.ItemSlot,{scope:r,value:o.value,children:a.jsx(xse,{asChild:!0,children:a.jsx(at.button,{id:u,disabled:n,"data-disabled":n?"":void 0,"data-state":xU(f),"aria-expanded":f,"aria-controls":d,...i,ref:c,onPointerEnter:Ye(e.onPointerEnter,()=>{h.current=!1,o.wasEscapeCloseRef.current=!1}),onPointerMove:Ye(e.onPointerMove,ZB(()=>{n||h.current||o.wasEscapeCloseRef.current||A.current||(s.onTriggerEnter(o.value),A.current=!0)})),onPointerLeave:Ye(e.onPointerLeave,ZB(()=>{n||(s.onTriggerLeave(),A.current=!1)})),onClick:Ye(e.onClick,()=>{s.onItemSelect(o.value),h.current=f}),onKeyDown:Ye(e.onKeyDown,m=>{const g={horizontal:"ArrowDown",vertical:s.dir==="rtl"?"ArrowLeft":"ArrowRight"}[s.orientation];f&&m.key===g&&(o.onEntryKeyDown(),m.preventDefault())})})})}),f&&a.jsxs(a.Fragment,{children:[a.jsx(Bte,{"aria-hidden":!0,tabIndex:0,ref:o.focusProxyRef,onFocus:m=>{const p=o.contentRef.current,g=m.relatedTarget,v=g===l.current,x=p==null?void 0:p.contains(g);(v||!x)&&o.onFocusProxyEnter(v?"start":"end")}}),s.viewport&&a.jsx("span",{"aria-owns":d})]})]})});Ase.displayName=VF;var B5e="NavigationMenuLink",Qz="navigationMenu.linkSelect",fse=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,active:n,onSelect:i,...s}=e;return a.jsx(xse,{asChild:!0,children:a.jsx(at.a,{"data-active":n?"":void 0,"aria-current":n?"page":void 0,...s,ref:t,onClick:Ye(e.onClick,o=>{const l=o.target,c=new CustomEvent(Qz,{bubbles:!0,cancelable:!0});if(l.addEventListener(Qz,u=>i==null?void 0:i(u),{once:!0}),F1(l,c),!c.defaultPrevented&&!o.metaKey){const u=new CustomEvent(WS,{bubbles:!0,cancelable:!0});F1(l,u)}},{checkForDefaultPrevented:!1})})})});fse.displayName=B5e;var mU="NavigationMenuIndicator",hse=w.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=yc(mU,e.__scopeNavigationMenu),s=!!i.value;return i.indicatorTrack?R5.createPortal(a.jsx(Gs,{present:r||s,children:a.jsx(_5e,{...n,ref:t})}),i.indicatorTrack):null});hse.displayName=mU;var _5e=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,...n}=e,i=yc(mU,r),s=ise(r),[o,l]=w.useState(null),[c,u]=w.useState(null),d=i.orientation==="horizontal",A=!!i.value;w.useEffect(()=>{var p;const m=(p=s().find(g=>g.value===i.value))==null?void 0:p.ref.current;m&&l(m)},[s,i.value]);const h=()=>{o&&u({size:d?o.offsetWidth:o.offsetHeight,offset:d?o.offsetLeft:o.offsetTop})};return XF(o,h),XF(i.indicatorTrack,h),c?a.jsx(at.div,{"aria-hidden":!0,"data-state":A?"visible":"hidden","data-orientation":i.orientation,...n,ref:t,style:{position:"absolute",...d?{left:0,width:c.size+"px",transform:`translateX(${c.offset}px)`}:{top:0,height:c.size+"px",transform:`translateY(${c.offset}px)`},...n.style}}):null}),wy="NavigationMenuContent",pse=w.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=yc(wy,e.__scopeNavigationMenu),s=use(wy,e.__scopeNavigationMenu),o=Jt(s.contentRef,t),l=s.value===i.value,c={value:s.value,triggerRef:s.triggerRef,focusProxyRef:s.focusProxyRef,wasEscapeCloseRef:s.wasEscapeCloseRef,onContentFocusOutside:s.onContentFocusOutside,onRootContentClose:s.onRootContentClose,...n};return i.viewport?a.jsx(k5e,{forceMount:r,...c,ref:o}):a.jsx(Gs,{present:r||l,children:a.jsx(mse,{"data-state":xU(l),...c,ref:o,onPointerEnter:Ye(e.onPointerEnter,i.onContentEnter),onPointerLeave:Ye(e.onPointerLeave,ZB(i.onContentLeave)),style:{pointerEvents:!l&&i.isRootMenu?"none":void 0,...c.style}})})});pse.displayName=wy;var k5e=w.forwardRef((e,t)=>{const r=yc(wy,e.__scopeNavigationMenu),{onViewportContentChange:n,onViewportContentRemove:i}=r;return Ai(()=>{n(e.value,{ref:t,...e})},[e,t,n]),Ai(()=>()=>i(e.value),[e.value,i]),null}),WS="navigationMenu.rootContentDismiss",mse=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,value:n,triggerRef:i,focusProxyRef:s,wasEscapeCloseRef:o,onRootContentClose:l,onContentFocusOutside:c,...u}=e,d=yc(wy,r),A=w.useRef(null),h=Jt(A,t),f=yse(d.baseId,n),m=bse(d.baseId,n),p=ise(r),g=w.useRef(null),{onItemDismiss:v}=d;w.useEffect(()=>{const y=A.current;if(d.isRootMenu&&y){const b=()=>{var C;v(),l(),y.contains(document.activeElement)&&((C=i.current)==null||C.focus())};return y.addEventListener(WS,b),()=>y.removeEventListener(WS,b)}},[d.isRootMenu,e.value,i,v,l]);const x=w.useMemo(()=>{const b=p().map(I=>I.value);d.dir==="rtl"&&b.reverse();const C=b.indexOf(d.value),j=b.indexOf(d.previousValue),S=n===d.value,T=j===b.indexOf(n);if(!S&&!T)return g.current;const B=(()=>{if(C!==j){if(S&&j!==-1)return C>j?"from-end":"from-start";if(T&&C!==-1)return C>j?"to-start":"to-end"}return null})();return g.current=B,B},[d.previousValue,d.value,d.dir,p,n]);return a.jsx(vse,{asChild:!0,children:a.jsx(kg,{id:m,"aria-labelledby":f,"data-motion":x,"data-orientation":d.orientation,...u,ref:h,disableOutsidePointerEvents:!1,onDismiss:()=>{var b;const y=new Event(WS,{bubbles:!0,cancelable:!0});(b=A.current)==null||b.dispatchEvent(y)},onFocusOutside:Ye(e.onFocusOutside,y=>{var C;c();const b=y.target;(C=d.rootNavigationMenu)!=null&&C.contains(b)&&y.preventDefault()}),onPointerDownOutside:Ye(e.onPointerDownOutside,y=>{var S;const b=y.target,C=p().some(T=>{var B;return(B=T.ref.current)==null?void 0:B.contains(b)}),j=d.isRootMenu&&((S=d.viewport)==null?void 0:S.contains(b));(C||j||!d.isRootMenu)&&y.preventDefault()}),onKeyDown:Ye(e.onKeyDown,y=>{var j;const b=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!b){const S=qF(y.currentTarget),T=document.activeElement,B=S.findIndex(E=>E===T),P=y.shiftKey?S.slice(0,B).reverse():S.slice(B+1,S.length);vU(P)?y.preventDefault():(j=s.current)==null||j.focus()}}),onEscapeKeyDown:Ye(e.onEscapeKeyDown,y=>{o.current=!0})})})}),gU="NavigationMenuViewport",gse=w.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=!!yc(gU,e.__scopeNavigationMenu).value;return a.jsx(Gs,{present:r||s,children:a.jsx(E5e,{...n,ref:t})})});gse.displayName=gU;var E5e=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,children:n,...i}=e,s=yc(gU,r),o=Jt(t,s.onViewportChange),l=N5e(wy,e.__scopeNavigationMenu),[c,u]=w.useState(null),[d,A]=w.useState(null),h=c?(c==null?void 0:c.width)+"px":void 0,f=c?(c==null?void 0:c.height)+"px":void 0,m=!!s.value,p=m?s.value:s.previousValue;return XF(d,()=>{d&&u({width:d.offsetWidth,height:d.offsetHeight})}),a.jsx(at.div,{"data-state":xU(m),"data-orientation":s.orientation,...i,ref:o,style:{pointerEvents:!m&&s.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":h,"--radix-navigation-menu-viewport-height":f,...i.style},onPointerEnter:Ye(e.onPointerEnter,s.onContentEnter),onPointerLeave:Ye(e.onPointerLeave,ZB(s.onContentLeave)),children:Array.from(l.items).map(([v,{ref:x,forceMount:y,...b}])=>{const C=p===v;return a.jsx(Gs,{present:y||C,children:a.jsx(mse,{...b,ref:pC(x,j=>{C&&j&&A(j)})})},v)})})}),T5e="FocusGroup",vse=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,...n}=e,i=yc(T5e,r);return a.jsx(GF.Provider,{scope:r,children:a.jsx(GF.Slot,{scope:r,children:a.jsx(at.div,{dir:i.dir,...n,ref:t})})})}),Hz=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],P5e="FocusGroupItem",xse=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:r,...n}=e,i=y5e(r),s=yc(P5e,r);return a.jsx(GF.ItemSlot,{scope:r,children:a.jsx(at.button,{...n,ref:t,onKeyDown:Ye(e.onKeyDown,o=>{if(["Home","End",...Hz].includes(o.key)){let c=i().map(A=>A.ref.current);if([s.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(o.key)&&c.reverse(),Hz.includes(o.key)){const A=c.indexOf(o.currentTarget);c=c.slice(A+1)}setTimeout(()=>vU(c)),o.preventDefault()}})})})});function qF(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function vU(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}function I5e(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const r=t.dataset.tabindex;t.setAttribute("tabindex",r)})}}function XF(e,t){const r=Li(t);Ai(()=>{let n=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return i.observe(e),()=>{window.cancelAnimationFrame(n),i.unobserve(e)}}},[e,r])}function xU(e){return e?"open":"closed"}function yse(e,t){return`${e}-trigger-${t}`}function bse(e,t){return`${e}-content-${t}`}function ZB(e){return t=>t.pointerType==="mouse"?e(t):void 0}var wse=sse,Cse=lse,O5e=dse,Nse=Ase,F5e=fse,jse=hse,Sse=pse,Bse=gse;const _se=w.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(wse,{ref:n,className:Le("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,a.jsx(Pse,{})]}));_se.displayName=wse.displayName;const kse=w.forwardRef(({className:e,...t},r)=>a.jsx(Cse,{ref:r,className:Le("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));kse.displayName=Cse.displayName;const L5e=O5e,M5e=Jh("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),Ese=w.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Nse,{ref:n,className:Le(M5e(),"group",e),...r,children:[t," ",a.jsx(y0,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));Ese.displayName=Nse.displayName;const Tse=w.forwardRef(({className:e,...t},r)=>a.jsx(Sse,{ref:r,className:Le("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",e),...t}));Tse.displayName=Sse.displayName;const LP=F5e,Pse=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{className:Le("absolute left-0 top-full flex justify-center"),children:a.jsx(Bse,{className:Le("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:r,...t})}));Pse.displayName=Bse.displayName;const D5e=w.forwardRef(({className:e,...t},r)=>a.jsx(jse,{ref:r,className:Le("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:a.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));D5e.displayName=jse.displayName;var pE="Dialog",[Ise,Ose]=Zi(pE),[R5e,cu]=Ise(pE),Fse=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!0}=e,l=w.useRef(null),c=w.useRef(null),[u,d]=fa({prop:n,defaultProp:i??!1,onChange:s,caller:pE});return a.jsx(R5e,{scope:t,triggerRef:l,contentRef:c,contentId:lo(),titleId:lo(),descriptionId:lo(),open:u,onOpenChange:d,onOpenToggle:w.useCallback(()=>d(A=>!A),[d]),modal:o,children:r})};Fse.displayName=pE;var Lse="DialogTrigger",Mse=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=cu(Lse,r),s=Jt(t,i.triggerRef);return a.jsx(at.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":wU(i.open),...n,ref:s,onClick:Ye(e.onClick,i.onOpenToggle)})});Mse.displayName=Lse;var yU="DialogPortal",[U5e,Dse]=Ise(yU,{forceMount:void 0}),Rse=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,s=cu(yU,t);return a.jsx(U5e,{scope:t,forceMount:r,children:w.Children.map(n,o=>a.jsx(Gs,{present:r||s.open,children:a.jsx(mC,{asChild:!0,container:i,children:o})}))})};Rse.displayName=yU;var e_="DialogOverlay",Use=w.forwardRef((e,t)=>{const r=Dse(e_,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,s=cu(e_,e.__scopeDialog);return s.modal?a.jsx(Gs,{present:n||s.open,children:a.jsx(H5e,{...i,ref:t})}):null});Use.displayName=e_;var Q5e=Jm("DialogOverlay.RemoveScroll"),H5e=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=cu(e_,r);return a.jsx(cE,{as:Q5e,allowPinchZoom:!0,shards:[i.contentRef],children:a.jsx(at.div,{"data-state":wU(i.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),sg="DialogContent",Qse=w.forwardRef((e,t)=>{const r=Dse(sg,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,s=cu(sg,e.__scopeDialog);return a.jsx(Gs,{present:n||s.open,children:s.modal?a.jsx($5e,{...i,ref:t}):a.jsx(z5e,{...i,ref:t})})});Qse.displayName=sg;var $5e=w.forwardRef((e,t)=>{const r=cu(sg,e.__scopeDialog),n=w.useRef(null),i=Jt(t,r.contentRef,n);return w.useEffect(()=>{const s=n.current;if(s)return sU(s)},[]),a.jsx(Hse,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ye(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ye(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&s.preventDefault()}),onFocusOutside:Ye(e.onFocusOutside,s=>s.preventDefault())})}),z5e=w.forwardRef((e,t)=>{const r=cu(sg,e.__scopeDialog),n=w.useRef(!1),i=w.useRef(!1);return a.jsx(Hse,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,s),s.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),s.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((u=r.triggerRef.current)==null?void 0:u.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),Hse=w.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=e,l=cu(sg,r),c=w.useRef(null),u=Jt(t,c);return rU(),a.jsxs(a.Fragment,{children:[a.jsx(oE,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:a.jsx(kg,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":wU(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(G5e,{titleId:l.titleId}),a.jsx(V5e,{contentRef:c,descriptionId:l.descriptionId})]})]})}),bU="DialogTitle",$se=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=cu(bU,r);return a.jsx(at.h2,{id:i.titleId,...n,ref:t})});$se.displayName=bU;var zse="DialogDescription",Wse=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=cu(zse,r);return a.jsx(at.p,{id:i.descriptionId,...n,ref:t})});Wse.displayName=zse;var Gse="DialogClose",Kse=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=cu(Gse,r);return a.jsx(at.button,{type:"button",...n,ref:t,onClick:Ye(e.onClick,()=>i.onOpenChange(!1))})});Kse.displayName=Gse;function wU(e){return e?"open":"closed"}var Vse="DialogTitleWarning",[W5e,qse]=L0e(Vse,{contentName:sg,titleName:bU,docsSlug:"dialog"}),G5e=({titleId:e})=>{const t=qse(Vse),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},K5e="DialogDescriptionWarning",V5e=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${qse(K5e).contentName}}.`;return w.useEffect(()=>{var s;const i=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},CU=Fse,NU=Mse,jU=Rse,TC=Use,PC=Qse,IC=$se,OC=Wse,mE=Kse;const Xse=CU,q5e=NU,X5e=jU,Yse=w.forwardRef(({className:e,...t},r)=>a.jsx(TC,{className:Le("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));Yse.displayName=TC.displayName;const Y5e=Jh("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),SU=w.forwardRef(({side:e="right",className:t,children:r,...n},i)=>a.jsxs(X5e,{children:[a.jsx(Yse,{}),a.jsxs(PC,{ref:i,className:Le(Y5e({side:e}),t),...n,children:[r,a.jsxs(mE,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[a.jsx(ml,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));SU.displayName=PC.displayName;const J5e=w.forwardRef(({className:e,...t},r)=>a.jsx(IC,{ref:r,className:Le("text-lg font-semibold text-foreground",e),...t}));J5e.displayName=IC.displayName;const Z5e=w.forwardRef(({className:e,...t},r)=>a.jsx(OC,{ref:r,className:Le("text-sm text-muted-foreground",e),...t}));Z5e.displayName=OC.displayName;var Jse={exports:{}},Zse={};/** * @license React * use-sync-external-store-shim.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Cy=w;function eEe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var tEe=typeof Object.is=="function"?Object.is:eEe,rEe=Cy.useState,nEe=Cy.useEffect,iEe=Cy.useLayoutEffect,sEe=Cy.useDebugValue;function aEe(e,t){var r=t(),n=rEe({inst:{value:r,getSnapshot:t}}),i=n[0].inst,s=n[1];return iEe(function(){i.value=r,i.getSnapshot=t,MP(i)&&s({inst:i})},[e,r,t]),nEe(function(){return MP(i)&&s({inst:i}),e(function(){MP(i)&&s({inst:i})})},[e]),sEe(r),r}function MP(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!tEe(e,r)}catch{return!0}}function oEe(e,t){return t()}var lEe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?oEe:aEe;Zse.useSyncExternalStore=Cy.useSyncExternalStore!==void 0?Cy.useSyncExternalStore:lEe;Jse.exports=Zse;var gE=Jse.exports;function cEe(){return gE.useSyncExternalStore(uEe,()=>!0,()=>!1)}function uEe(){return()=>{}}var BU="Avatar",[dEe,dNt]=Zi(BU),[AEe,eae]=dEe(BU),tae=w.forwardRef((e,t)=>{const{__scopeAvatar:r,...n}=e,[i,s]=w.useState("idle");return a.jsx(AEe,{scope:r,imageLoadingStatus:i,onImageLoadingStatusChange:s,children:a.jsx(at.span,{...n,ref:t})})});tae.displayName=BU;var rae="AvatarImage",nae=w.forwardRef((e,t)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:i=()=>{},...s}=e,o=eae(rae,r),l=fEe(n,s),c=Li(u=>{i(u),o.onImageLoadingStatusChange(u)});return Ai(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?a.jsx(at.img,{...s,ref:t,src:n}):null});nae.displayName=rae;var iae="AvatarFallback",sae=w.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...i}=e,s=eae(iae,r),[o,l]=w.useState(n===void 0);return w.useEffect(()=>{if(n!==void 0){const c=window.setTimeout(()=>l(!0),n);return()=>window.clearTimeout(c)}},[n]),o&&s.imageLoadingStatus!=="loaded"?a.jsx(at.span,{...i,ref:t}):null});sae.displayName=iae;function $z(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function fEe(e,{referrerPolicy:t,crossOrigin:r}){const n=cEe(),i=w.useRef(null),s=n?(i.current||(i.current=new window.Image),i.current):null,[o,l]=w.useState(()=>$z(s,e));return Ai(()=>{l($z(s,e))},[s,e]),Ai(()=>{const c=A=>()=>{l(A)};if(!s)return;const u=c("loaded"),d=c("error");return s.addEventListener("load",u),s.addEventListener("error",d),t&&(s.referrerPolicy=t),typeof r=="string"&&(s.crossOrigin=r),()=>{s.removeEventListener("load",u),s.removeEventListener("error",d)}},[s,r,t]),o}var aae=tae,oae=nae,lae=sae;const _U=w.forwardRef(({className:e,...t},r)=>a.jsx(aae,{ref:r,className:Le("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));_U.displayName=aae.displayName;const hEe=w.forwardRef(({className:e,...t},r)=>a.jsx(oae,{ref:r,className:Le("aspect-square h-full w-full",e),...t}));hEe.displayName=oae.displayName;const kU=w.forwardRef(({className:e,...t},r)=>a.jsx(lae,{ref:r,className:Le("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));kU.displayName=lae.displayName;const Ln=()=>{const{user:e}=fi(),{usageData:t}=Ua(),r=Ad(),{toast:n}=Dr(),[i,s]=w.useState(!1),o=async()=>{try{const{error:u}=await Re.auth.signOut();u?n({title:"Error signing out",description:u.message,variant:"destructive"}):window.location.href="/"}catch(u){console.error("Error signing out:",u),n({title:"Something went wrong",description:"Please try again later.",variant:"destructive"})}},l=u=>{switch(u){case"elite":return a.jsx(ru,{className:"w-4 h-4 text-yellow-500"});case"pro":return a.jsx(ln,{className:"w-4 h-4 text-blue-500"});case"lite":return a.jsx(ln,{className:"w-4 h-4 text-green-500"});case"admin":return a.jsx(ru,{className:"w-4 h-4 text-purple-500"});default:return a.jsx(ire,{className:"w-4 h-4 text-gray-500"})}},c=u=>{switch(u){case"admin":return"Unlimited generations";case"elite":return"300 generations/month • All features";case"pro":return"150 generations/month • Advanced features";case"lite":return"50 generations/month";default:return"10 generations/month"}};return w.useEffect(()=>{r.hash&&setTimeout(()=>{const u=document.querySelector(r.hash);u&&u.scrollIntoView({behavior:"smooth",block:"start"})},100)},[r]),a.jsx("header",{className:"fixed top-0 z-50 w-full bg-[hsl(var(--surface-0))] border-b border-[hsl(var(--border-subtle))]",children:a.jsxs("div",{className:"container flex h-16 items-center justify-between px-4 sm:px-6 lg:px-8 max-w-[1200px] mx-auto",children:[a.jsx(Et,{to:"/",className:"flex items-center hover:opacity-80 transition-opacity",children:a.jsx("img",{src:Xne,alt:"WordSmith AGI Logo",className:"h-9 w-auto"})}),a.jsxs("nav",{className:"hidden md:flex items-center space-x-2",children:[a.jsx(_se,{children:a.jsx(kse,{children:a.jsxs(L5e,{children:[a.jsx(Ese,{className:"text-sm font-medium bg-transparent",children:"Products"}),a.jsx(Tse,{children:a.jsxs("ul",{className:"grid w-[340px] gap-1 p-3",children:[a.jsx("li",{children:a.jsx(LP,{asChild:!0,children:a.jsxs(Et,{to:"/ai-content-writer",className:"flex items-center gap-3 rounded-md p-3 hover:bg-muted transition-colors",children:[a.jsx(R1,{className:"w-5 h-5 text-primary"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium",children:"Content Writer"}),a.jsx("p",{className:"text-xs text-foreground",children:"Blogs, social, video & more"})]})]})})}),a.jsx("li",{children:a.jsx(LP,{asChild:!0,children:a.jsxs(Et,{to:"/presentations",className:"flex items-center gap-3 rounded-md p-3 hover:bg-muted transition-colors",children:[a.jsx(ac,{className:"w-5 h-5 text-primary"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium",children:"Presentation Maker"}),a.jsx("p",{className:"text-xs text-foreground",children:"AI-powered slide decks"})]})]})})}),a.jsx("li",{children:a.jsx(LP,{asChild:!0,children:a.jsxs(Et,{to:"/infographics",className:"flex items-center gap-3 rounded-md p-3 hover:bg-muted transition-colors",children:[a.jsx(Ra,{className:"w-5 h-5 text-primary"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium",children:"Infographic Maker"}),a.jsx("p",{className:"text-xs text-foreground",children:"Data to visuals instantly"})]})]})})})]})})]})})}),a.jsx(Et,{to:"/#features",className:"text-sm font-medium text-foreground hover:text-primary transition-colors px-3 py-2",children:"Features"}),a.jsx(Et,{to:"/#pricing",className:"text-sm font-medium text-foreground hover:text-primary transition-colors px-3 py-2",children:"Pricing"})]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs(Xse,{open:i,onOpenChange:s,children:[a.jsx(q5e,{asChild:!0,children:a.jsx(ve,{variant:"ghost",size:"icon",className:"md:hidden",children:a.jsx(owe,{className:"h-5 w-5"})})}),a.jsx(SU,{side:"right",className:"w-72 pt-12",children:a.jsxs("nav",{className:"flex flex-col space-y-1",children:[a.jsx("p",{className:"text-xs font-semibold text-foreground uppercase tracking-wider px-3 mb-2",children:"Products"}),a.jsxs(Et,{to:"/ai-content-writer",onClick:()=>s(!1),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-muted transition-colors",children:[a.jsx(R1,{className:"w-4 h-4 text-primary"}),a.jsx("span",{className:"text-sm font-medium text-foreground",children:"Content Writer"})]}),a.jsxs(Et,{to:"/presentations",onClick:()=>s(!1),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-muted transition-colors",children:[a.jsx(ac,{className:"w-4 h-4 text-primary"}),a.jsx("span",{className:"text-sm font-medium text-foreground",children:"Presentation Maker"})]}),a.jsxs(Et,{to:"/infographics",onClick:()=>s(!1),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-muted transition-colors",children:[a.jsx(Ra,{className:"w-4 h-4 text-primary"}),a.jsx("span",{className:"text-sm font-medium text-foreground",children:"Infographic Maker"})]}),a.jsx("div",{className:"border-t border-border my-3"}),a.jsx(Et,{to:"/#features",onClick:()=>s(!1),className:"px-3 py-2.5 rounded-lg hover:bg-muted text-sm font-medium text-foreground transition-colors",children:"Features"}),a.jsx(Et,{to:"/#pricing",onClick:()=>s(!1),className:"px-3 py-2.5 rounded-lg hover:bg-muted text-sm font-medium text-foreground transition-colors",children:"Pricing"}),a.jsx("div",{className:"border-t border-border my-3"}),e?a.jsx(ve,{variant:"hero",size:"sm",asChild:!0,className:"mx-3",children:a.jsx(Et,{to:"/dashboard",onClick:()=>s(!1),children:"Dashboard"})}):a.jsxs("div",{className:"flex flex-col gap-2 px-3",children:[a.jsx(ve,{variant:"ghost",size:"sm",asChild:!0,children:a.jsx(Et,{to:"/auth",onClick:()=>s(!1),children:"Sign In"})}),a.jsx(ve,{variant:"hero",size:"sm",asChild:!0,children:a.jsx(Et,{to:"/auth",onClick:()=>s(!1),children:"Get Started"})})]})]})})]}),e?a.jsxs(a.Fragment,{children:[a.jsx(ve,{variant:"ghost",size:"sm",asChild:!0,className:"hidden sm:flex",children:a.jsx(Et,{to:"/dashboard",children:"Dashboard"})}),a.jsxs(fE,{children:[a.jsx(hE,{asChild:!0,children:a.jsx(ve,{variant:"ghost",size:"icon",className:"rounded-full",children:a.jsx(_U,{className:"h-8 w-8",children:a.jsx(kU,{className:"bg-primary/10 text-primary",children:a.jsx(tg,{className:"h-4 w-4"})})})})}),a.jsxs(EC,{align:"end",className:"w-64",children:[a.jsx(fU,{children:a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsx("p",{className:"text-sm font-medium leading-none",children:e.email}),a.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[t&&l(t.tier),a.jsxs("p",{className:"text-xs text-foreground capitalize",children:[(t==null?void 0:t.tier)||"Free"," Plan"]})]})]})}),t&&a.jsxs(a.Fragment,{children:[a.jsx(Im,{}),a.jsx("div",{className:"px-2 py-2",children:a.jsx("p",{className:"text-xs text-foreground",children:c(t.tier)})})]}),a.jsx(Im,{}),a.jsx(xA,{asChild:!0,children:a.jsxs(Et,{to:"/dashboard?tab=profile",className:"cursor-pointer",children:[a.jsx(gy,{className:"mr-2 h-4 w-4"}),a.jsx("span",{children:"Account Preferences"})]})}),a.jsx(Im,{}),a.jsxs(xA,{onClick:o,className:"cursor-pointer text-destructive focus:text-destructive",children:[a.jsx(lre,{className:"mr-2 h-4 w-4"}),a.jsx("span",{children:"Sign Out"})]})]})]})]}):a.jsxs("div",{className:"hidden md:flex items-center space-x-4",children:[a.jsx(ve,{variant:"ghost",size:"sm",className:"hover:bg-primary/10 hover:text-primary",asChild:!0,children:a.jsx(Et,{to:"/auth",children:"Sign In"})}),a.jsx(ve,{variant:"hero",size:"sm",asChild:!0,children:a.jsx(Et,{to:"/auth",children:"Get Started"})})]})]})]})})},Mi=CU,EU=NU,pEe=jU,cae=w.forwardRef(({className:e,...t},r)=>a.jsx(TC,{ref:r,className:Le("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));cae.displayName=TC.displayName;const yi=w.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(pEe,{children:[a.jsx(cae,{}),a.jsxs(PC,{ref:n,className:Le("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,a.jsxs(mE,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(ml,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));yi.displayName=PC.displayName;const bi=({className:e,...t})=>a.jsx("div",{className:Le("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});bi.displayName="DialogHeader";const nd=({className:e,...t})=>a.jsx("div",{className:Le("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});nd.displayName="DialogFooter";const wi=w.forwardRef(({className:e,...t},r)=>a.jsx(IC,{ref:r,className:Le("text-lg font-semibold leading-none tracking-tight",e),...t}));wi.displayName=IC.displayName;const Qo=w.forwardRef(({className:e,...t},r)=>a.jsx(OC,{ref:r,className:Le("text-sm text-muted-foreground",e),...t}));Qo.displayName=OC.displayName;const st=w.forwardRef(({className:e,type:t,...r},n)=>a.jsx("input",{type:t,className:Le("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));st.displayName="Input";var mEe="Label",uae=w.forwardRef((e,t)=>a.jsx(at.label,{...e,ref:t,onMouseDown:r=>{var i;r.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));uae.displayName=mEe;var dae=uae;const gEe=Jh("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Pe=w.forwardRef(({className:e,...t},r)=>a.jsx(dae,{ref:r,className:Le(gEe(),e),...t}));Pe.displayName=dae.displayName;const Zr=w.forwardRef(({className:e,...t},r)=>a.jsx("textarea",{className:Le("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));Zr.displayName="Textarea";function t_(e,[t,r]){return Math.min(r,Math.max(t,e))}var vEe=[" ","Enter","ArrowUp","ArrowDown"],xEe=[" ","Enter"],ag="Select",[vE,xE,yEe]=Yh(ag),[O0,ANt]=Zi(ag,[yEe,j0]),yE=j0(),[bEe,np]=O0(ag),[wEe,CEe]=O0(ag),Aae=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:i,onOpenChange:s,value:o,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:A,disabled:h,required:f,form:m}=e,p=yE(t),[g,v]=w.useState(null),[x,y]=w.useState(null),[b,C]=w.useState(!1),j=rp(u),[S,T]=fa({prop:n,defaultProp:i??!1,onChange:s,caller:ag}),[B,I]=fa({prop:o,defaultProp:l,onChange:c,caller:ag}),P=w.useRef(null),E=g?m||!!g.closest("form"):!0,[M,_]=w.useState(new Set),R=Array.from(M).map(G=>G.props.value).join(";");return a.jsx(M6,{...p,children:a.jsxs(bEe,{required:f,scope:t,trigger:g,onTriggerChange:v,valueNode:x,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:C,contentId:lo(),value:B,onValueChange:I,open:S,onOpenChange:T,dir:j,triggerPointerDownPosRef:P,disabled:h,children:[a.jsx(vE.Provider,{scope:t,children:a.jsx(wEe,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(G=>{_(U=>new Set(U).add(G))},[]),onNativeOptionRemove:w.useCallback(G=>{_(U=>{const Q=new Set(U);return Q.delete(G),Q})},[]),children:r})}),E?a.jsxs(Lae,{"aria-hidden":!0,required:f,tabIndex:-1,name:d,autoComplete:A,value:B,onChange:G=>I(G.target.value),disabled:h,form:m,children:[B===void 0?a.jsx("option",{value:""}):null,Array.from(M)]},R):null]})})};Aae.displayName=ag;var fae="SelectTrigger",hae=w.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...i}=e,s=yE(r),o=np(fae,r),l=o.disabled||n,c=Jt(t,o.onTriggerChange),u=xE(r),d=w.useRef("touch"),[A,h,f]=Dae(p=>{const g=u().filter(y=>!y.disabled),v=g.find(y=>y.value===o.value),x=Rae(g,p,v);x!==void 0&&o.onValueChange(x.value)}),m=p=>{l||(o.onOpenChange(!0),f()),p&&(o.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return a.jsx(D6,{asChild:!0,...s,children:a.jsx(at.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Mae(o.value)?"":void 0,...i,ref:c,onClick:Ye(i.onClick,p=>{p.currentTarget.focus(),d.current!=="mouse"&&m(p)}),onPointerDown:Ye(i.onPointerDown,p=>{d.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(m(p),p.preventDefault())}),onKeyDown:Ye(i.onKeyDown,p=>{const g=A.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&h(p.key),!(g&&p.key===" ")&&vEe.includes(p.key)&&(m(),p.preventDefault())})})})});hae.displayName=fae;var pae="SelectValue",mae=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:o="",...l}=e,c=np(pae,r),{onValueNodeHasChildrenChange:u}=c,d=s!==void 0,A=Jt(t,c.onValueNodeChange);return Ai(()=>{u(d)},[u,d]),a.jsx(at.span,{...l,ref:A,style:{pointerEvents:"none"},children:Mae(c.value)?a.jsx(a.Fragment,{children:o}):s})});mae.displayName=pae;var NEe="SelectIcon",gae=w.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...i}=e;return a.jsx(at.span,{"aria-hidden":!0,...i,ref:t,children:n||"▼"})});gae.displayName=NEe;var jEe="SelectPortal",vae=e=>a.jsx(mC,{asChild:!0,...e});vae.displayName=jEe;var og="SelectContent",xae=w.forwardRef((e,t)=>{const r=np(og,e.__scopeSelect),[n,i]=w.useState();if(Ai(()=>{i(new DocumentFragment)},[]),!r.open){const s=n;return s?_g.createPortal(a.jsx(yae,{scope:e.__scopeSelect,children:a.jsx(vE.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),s):null}return a.jsx(bae,{...e,ref:t})});xae.displayName=og;var Oc=10,[yae,ip]=O0(og),SEe="SelectContentImpl",BEe=Jm("SelectContent.RemoveScroll"),bae=w.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:A,collisionBoundary:h,collisionPadding:f,sticky:m,hideWhenDetached:p,avoidCollisions:g,...v}=e,x=np(og,r),[y,b]=w.useState(null),[C,j]=w.useState(null),S=Jt(t,oe=>b(oe)),[T,B]=w.useState(null),[I,P]=w.useState(null),E=xE(r),[M,_]=w.useState(!1),R=w.useRef(!1);w.useEffect(()=>{if(y)return sU(y)},[y]),rU();const G=w.useCallback(oe=>{const[pe,...de]=E().map(ue=>ue.ref.current),[ge]=de.slice(-1),ie=document.activeElement;for(const ue of oe)if(ue===ie||(ue==null||ue.scrollIntoView({block:"nearest"}),ue===pe&&C&&(C.scrollTop=0),ue===ge&&C&&(C.scrollTop=C.scrollHeight),ue==null||ue.focus(),document.activeElement!==ie))return},[E,C]),U=w.useCallback(()=>G([T,y]),[G,T,y]);w.useEffect(()=>{M&&U()},[M,U]);const{onOpenChange:Q,triggerPointerDownPosRef:z}=x;w.useEffect(()=>{if(y){let oe={x:0,y:0};const pe=ge=>{var ie,ue;oe={x:Math.abs(Math.round(ge.pageX)-(((ie=z.current)==null?void 0:ie.x)??0)),y:Math.abs(Math.round(ge.pageY)-(((ue=z.current)==null?void 0:ue.y)??0))}},de=ge=>{oe.x<=10&&oe.y<=10?ge.preventDefault():y.contains(ge.target)||Q(!1),document.removeEventListener("pointermove",pe),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",pe),document.addEventListener("pointerup",de,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",pe),document.removeEventListener("pointerup",de,{capture:!0})}}},[y,Q,z]),w.useEffect(()=>{const oe=()=>Q(!1);return window.addEventListener("blur",oe),window.addEventListener("resize",oe),()=>{window.removeEventListener("blur",oe),window.removeEventListener("resize",oe)}},[Q]);const[Y,$]=Dae(oe=>{const pe=E().filter(ie=>!ie.disabled),de=pe.find(ie=>ie.ref.current===document.activeElement),ge=Rae(pe,oe,de);ge&&setTimeout(()=>ge.ref.current.focus())}),O=w.useCallback((oe,pe,de)=>{const ge=!R.current&&!de;(x.value!==void 0&&x.value===pe||ge)&&(B(oe),ge&&(R.current=!0))},[x.value]),W=w.useCallback(()=>y==null?void 0:y.focus(),[y]),V=w.useCallback((oe,pe,de)=>{const ge=!R.current&&!de;(x.value!==void 0&&x.value===pe||ge)&&P(oe)},[x.value]),X=n==="popper"?YF:wae,ne=X===YF?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:A,collisionBoundary:h,collisionPadding:f,sticky:m,hideWhenDetached:p,avoidCollisions:g}:{};return a.jsx(yae,{scope:r,content:y,viewport:C,onViewportChange:j,itemRefCallback:O,selectedItem:T,onItemLeave:W,itemTextRefCallback:V,focusSelectedItem:U,selectedItemText:I,position:n,isPositioned:M,searchRef:Y,children:a.jsx(cE,{as:BEe,allowPinchZoom:!0,children:a.jsx(oE,{asChild:!0,trapped:x.open,onMountAutoFocus:oe=>{oe.preventDefault()},onUnmountAutoFocus:Ye(i,oe=>{var pe;(pe=x.trigger)==null||pe.focus({preventScroll:!0}),oe.preventDefault()}),children:a.jsx(kg,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:oe=>oe.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:a.jsx(X,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:oe=>oe.preventDefault(),...v,...ne,onPlaced:()=>_(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:Ye(v.onKeyDown,oe=>{const pe=oe.ctrlKey||oe.altKey||oe.metaKey;if(oe.key==="Tab"&&oe.preventDefault(),!pe&&oe.key.length===1&&$(oe.key),["ArrowUp","ArrowDown","Home","End"].includes(oe.key)){let ge=E().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);if(["ArrowUp","End"].includes(oe.key)&&(ge=ge.slice().reverse()),["ArrowUp","ArrowDown"].includes(oe.key)){const ie=oe.target,ue=ge.indexOf(ie);ge=ge.slice(ue+1)}setTimeout(()=>G(ge)),oe.preventDefault()}})})})})})})});bae.displayName=SEe;var _Ee="SelectItemAlignedPosition",wae=w.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...i}=e,s=np(og,r),o=ip(og,r),[l,c]=w.useState(null),[u,d]=w.useState(null),A=Jt(t,S=>d(S)),h=xE(r),f=w.useRef(!1),m=w.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:v,focusSelectedItem:x}=o,y=w.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&u&&p&&g&&v){const S=s.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),B=s.valueNode.getBoundingClientRect(),I=v.getBoundingClientRect();if(s.dir!=="rtl"){const ie=I.left-T.left,ue=B.left-ie,Se=S.left-ue,D=S.width+Se,K=Math.max(D,T.width),we=window.innerWidth-Oc,ae=t_(ue,[Oc,Math.max(Oc,we-K)]);l.style.minWidth=D+"px",l.style.left=ae+"px"}else{const ie=T.right-I.right,ue=window.innerWidth-B.right-ie,Se=window.innerWidth-S.right-ue,D=S.width+Se,K=Math.max(D,T.width),we=window.innerWidth-Oc,ae=t_(ue,[Oc,Math.max(Oc,we-K)]);l.style.minWidth=D+"px",l.style.right=ae+"px"}const P=h(),E=window.innerHeight-Oc*2,M=p.scrollHeight,_=window.getComputedStyle(u),R=parseInt(_.borderTopWidth,10),G=parseInt(_.paddingTop,10),U=parseInt(_.borderBottomWidth,10),Q=parseInt(_.paddingBottom,10),z=R+G+M+Q+U,Y=Math.min(g.offsetHeight*5,z),$=window.getComputedStyle(p),O=parseInt($.paddingTop,10),W=parseInt($.paddingBottom,10),V=S.top+S.height/2-Oc,X=E-V,ne=g.offsetHeight/2,oe=g.offsetTop+ne,pe=R+G+oe,de=z-pe;if(pe<=V){const ie=P.length>0&&g===P[P.length-1].ref.current;l.style.bottom="0px";const ue=u.clientHeight-p.offsetTop-p.offsetHeight,Se=Math.max(X,ne+(ie?W:0)+ue+U),D=pe+Se;l.style.height=D+"px"}else{const ie=P.length>0&&g===P[0].ref.current;l.style.top="0px";const Se=Math.max(V,R+p.offsetTop+(ie?O:0)+ne)+de;l.style.height=Se+"px",p.scrollTop=pe-V+p.offsetTop}l.style.margin=`${Oc}px 0`,l.style.minHeight=Y+"px",l.style.maxHeight=E+"px",n==null||n(),requestAnimationFrame(()=>f.current=!0)}},[h,s.trigger,s.valueNode,l,u,p,g,v,s.dir,n]);Ai(()=>y(),[y]);const[b,C]=w.useState();Ai(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const j=w.useCallback(S=>{S&&m.current===!0&&(y(),x==null||x(),m.current=!1)},[y,x]);return a.jsx(EEe,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:f,onScrollButtonChange:j,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:a.jsx(at.div,{...i,ref:A,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});wae.displayName=_Ee;var kEe="SelectPopperPosition",YF=w.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Oc,...s}=e,o=yE(r);return a.jsx(R6,{...o,...s,ref:t,align:n,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});YF.displayName=kEe;var[EEe,TU]=O0(og,{}),JF="SelectViewport",Cae=w.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...i}=e,s=ip(JF,r),o=TU(JF,r),l=Jt(t,s.onViewportChange),c=w.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(vE.Slot,{scope:r,children:a.jsx(at.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ye(i.onScroll,u=>{const d=u.currentTarget,{contentWrapper:A,shouldExpandOnScrollRef:h}=o;if(h!=null&&h.current&&A){const f=Math.abs(c.current-d.scrollTop);if(f>0){const m=window.innerHeight-Oc*2,p=parseFloat(A.style.minHeight),g=parseFloat(A.style.height),v=Math.max(p,g);if(v0?b:0,A.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});Cae.displayName=JF;var Nae="SelectGroup",[TEe,PEe]=O0(Nae),IEe=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=lo();return a.jsx(TEe,{scope:r,id:i,children:a.jsx(at.div,{role:"group","aria-labelledby":i,...n,ref:t})})});IEe.displayName=Nae;var jae="SelectLabel",Sae=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=PEe(jae,r);return a.jsx(at.div,{id:i.id,...n,ref:t})});Sae.displayName=jae;var r_="SelectItem",[OEe,Bae]=O0(r_),_ae=w.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:s,...o}=e,l=np(r_,r),c=ip(r_,r),u=l.value===n,[d,A]=w.useState(s??""),[h,f]=w.useState(!1),m=Jt(t,x=>{var y;return(y=c.itemRefCallback)==null?void 0:y.call(c,x,n,i)}),p=lo(),g=w.useRef("touch"),v=()=>{i||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(OEe,{scope:r,value:n,disabled:i,textId:p,isSelected:u,onItemTextChange:w.useCallback(x=>{A(y=>y||((x==null?void 0:x.textContent)??"").trim())},[]),children:a.jsx(vE.ItemSlot,{scope:r,value:n,disabled:i,textValue:d,children:a.jsx(at.div,{role:"option","aria-labelledby":p,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:Ye(o.onFocus,()=>f(!0)),onBlur:Ye(o.onBlur,()=>f(!1)),onClick:Ye(o.onClick,()=>{g.current!=="mouse"&&v()}),onPointerUp:Ye(o.onPointerUp,()=>{g.current==="mouse"&&v()}),onPointerDown:Ye(o.onPointerDown,x=>{g.current=x.pointerType}),onPointerMove:Ye(o.onPointerMove,x=>{var y;g.current=x.pointerType,i?(y=c.onItemLeave)==null||y.call(c):g.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ye(o.onPointerLeave,x=>{var y;x.currentTarget===document.activeElement&&((y=c.onItemLeave)==null||y.call(c))}),onKeyDown:Ye(o.onKeyDown,x=>{var b;((b=c.searchRef)==null?void 0:b.current)!==""&&x.key===" "||(xEe.includes(x.key)&&v(),x.key===" "&&x.preventDefault())})})})})});_ae.displayName=r_;var Aw="SelectItemText",kae=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,...s}=e,o=np(Aw,r),l=ip(Aw,r),c=Bae(Aw,r),u=CEe(Aw,r),[d,A]=w.useState(null),h=Jt(t,v=>A(v),c.onItemTextChange,v=>{var x;return(x=l.itemTextRefCallback)==null?void 0:x.call(l,v,c.value,c.disabled)}),f=d==null?void 0:d.textContent,m=w.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return Ai(()=>(p(m),()=>g(m)),[p,g,m]),a.jsxs(a.Fragment,{children:[a.jsx(at.span,{id:c.textId,...s,ref:h}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?_g.createPortal(s.children,o.valueNode):null]})});kae.displayName=Aw;var Eae="SelectItemIndicator",Tae=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Bae(Eae,r).isSelected?a.jsx(at.span,{"aria-hidden":!0,...n,ref:t}):null});Tae.displayName=Eae;var ZF="SelectScrollUpButton",Pae=w.forwardRef((e,t)=>{const r=ip(ZF,e.__scopeSelect),n=TU(ZF,e.__scopeSelect),[i,s]=w.useState(!1),o=Jt(t,n.onScrollButtonChange);return Ai(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollTop>0;s(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),i?a.jsx(Oae,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Pae.displayName=ZF;var eL="SelectScrollDownButton",Iae=w.forwardRef((e,t)=>{const r=ip(eL,e.__scopeSelect),n=TU(eL,e.__scopeSelect),[i,s]=w.useState(!1),o=Jt(t,n.onScrollButtonChange);return Ai(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),i?a.jsx(Oae,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Iae.displayName=eL;var Oae=w.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=e,s=ip("SelectScrollButton",r),o=w.useRef(null),l=xE(r),c=w.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return w.useEffect(()=>()=>c(),[c]),Ai(()=>{var d;const u=l().find(A=>A.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),a.jsx(at.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ye(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:Ye(i.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:Ye(i.onPointerLeave,()=>{c()})})}),FEe="SelectSeparator",Fae=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(at.div,{"aria-hidden":!0,...n,ref:t})});Fae.displayName=FEe;var tL="SelectArrow",LEe=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=yE(r),s=np(tL,r),o=ip(tL,r);return s.open&&o.position==="popper"?a.jsx(U6,{...i,...n,ref:t}):null});LEe.displayName=tL;var MEe="SelectBubbleInput",Lae=w.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const i=w.useRef(null),s=Jt(n,i),o=I0(t);return w.useEffect(()=>{const l=i.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const A=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(A)}},[o,t]),a.jsx(at.select,{...r,style:{...Ste,...r.style},ref:s,defaultValue:t})});Lae.displayName=MEe;function Mae(e){return e===""||e===void 0}function Dae(e){const t=Li(e),r=w.useRef(""),n=w.useRef(0),i=w.useCallback(o=>{const l=r.current+o;t(l),function c(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),s=w.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,s]}function Rae(e,t,r){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let o=DEe(e,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==r));const c=o.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function DEe(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var REe=Aae,Uae=hae,UEe=mae,QEe=gae,HEe=vae,Qae=xae,$Ee=Cae,Hae=Sae,$ae=_ae,zEe=kae,WEe=Tae,zae=Pae,Wae=Iae,Gae=Fae;const It=REe,Ot=UEe,_t=w.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Uae,{ref:n,className:Le("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,a.jsx(QEe,{asChild:!0,children:a.jsx(y0,{className:"h-4 w-4 opacity-50"})})]}));_t.displayName=Uae.displayName;const Kae=w.forwardRef(({className:e,...t},r)=>a.jsx(zae,{ref:r,className:Le("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(x6,{className:"h-4 w-4"})}));Kae.displayName=zae.displayName;const Vae=w.forwardRef(({className:e,...t},r)=>a.jsx(Wae,{ref:r,className:Le("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(y0,{className:"h-4 w-4"})}));Vae.displayName=Wae.displayName;const kt=w.forwardRef(({className:e,children:t,position:r="popper",...n},i)=>a.jsx(HEe,{children:a.jsxs(Qae,{ref:i,className:Le("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[a.jsx(Kae,{}),a.jsx($Ee,{className:Le("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(Vae,{})]})}));kt.displayName=Qae.displayName;const GEe=w.forwardRef(({className:e,...t},r)=>a.jsx(Hae,{ref:r,className:Le("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));GEe.displayName=Hae.displayName;const ye=w.forwardRef(({className:e,children:t,...r},n)=>a.jsxs($ae,{ref:n,className:Le("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-primary focus:text-primary-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(WEe,{children:a.jsx(dr,{className:"h-4 w-4"})})}),a.jsx(zEe,{children:t})]}));ye.displayName=$ae.displayName;const KEe=w.forwardRef(({className:e,...t},r)=>a.jsx(Gae,{ref:r,className:Le("-mx-1 my-1 h-px bg-muted",e),...t}));KEe.displayName=Gae.displayName;var dn;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},e.getValidEnumValues=i=>{const s=e.objectKeys(i).filter(l=>typeof i[i[l]]!="number"),o={};for(const l of s)o[l]=i[l];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},e.find=(i,s)=>{for(const o of i)if(s(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}e.joinValues=n,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(dn||(dn={}));var zz;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(zz||(zz={}));const Lt=dn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Bf=e=>{switch(typeof e){case"undefined":return Lt.undefined;case"string":return Lt.string;case"number":return Number.isNaN(e)?Lt.nan:Lt.number;case"boolean":return Lt.boolean;case"function":return Lt.function;case"bigint":return Lt.bigint;case"symbol":return Lt.symbol;case"object":return Array.isArray(e)?Lt.array:e===null?Lt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Lt.promise:typeof Map<"u"&&e instanceof Map?Lt.map:typeof Set<"u"&&e instanceof Set?Lt.set:typeof Date<"u"&&e instanceof Date?Lt.date:Lt.object;default:return Lt.unknown}},it=dn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class PA extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(s){return s.message},n={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let l=n,c=0;for(;cr.message){const r={},n=[];for(const i of this.issues)if(i.path.length>0){const s=i.path[0];r[s]=r[s]||[],r[s].push(t(i))}else n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}PA.create=e=>new PA(e);const rL=(e,t)=>{let r;switch(e.code){case it.invalid_type:e.received===Lt.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case it.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,dn.jsonStringifyReplacer)}`;break;case it.unrecognized_keys:r=`Unrecognized key(s) in object: ${dn.joinValues(e.keys,", ")}`;break;case it.invalid_union:r="Invalid input";break;case it.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${dn.joinValues(e.options)}`;break;case it.invalid_enum_value:r=`Invalid enum value. Expected ${dn.joinValues(e.options)}, received '${e.received}'`;break;case it.invalid_arguments:r="Invalid function arguments";break;case it.invalid_return_type:r="Invalid function return type";break;case it.invalid_date:r="Invalid date";break;case it.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:dn.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case it.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case it.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case it.custom:r="Invalid input";break;case it.invalid_intersection_types:r="Intersection results could not be merged";break;case it.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case it.not_finite:r="Number must be finite";break;default:r=t.defaultError,dn.assertNever(e)}return{message:r}};let VEe=rL;function qEe(){return VEe}const XEe=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,s=[...r,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let l="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:t,defaultError:l}).message;return{...i,path:s,message:l}};function gt(e,t){const r=qEe(),n=XEe({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===rL?void 0:rL].filter(i=>!!i)});e.common.issues.push(n)}class Bl{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const i of r){if(i.status==="aborted")return yr;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const i of r){const s=await i.key,o=await i.value;n.push({key:s,value:o})}return Bl.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const i of r){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return yr;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:t.value,value:n}}}const yr=Object.freeze({status:"aborted"}),fw=e=>({status:"dirty",value:e}),bc=e=>({status:"valid",value:e}),Wz=e=>e.status==="aborted",Gz=e=>e.status==="dirty",Ny=e=>e.status==="valid",n_=e=>typeof Promise<"u"&&e instanceof Promise;var Ut;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ut||(Ut={}));class Uh{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Kz=(e,t)=>{if(Ny(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new PA(e.common.issues);return this._error=r,this._error}}};function Lr(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,l)=>{const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??n??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??r??l.defaultError}},description:i}}class cn{get description(){return this._def.description}_getType(t){return Bf(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Bf(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Bl,ctx:{common:t.parent.common,data:t.data,parsedType:Bf(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(n_(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Bf(t)},i=this._parseSync({data:t,path:n.path,parent:n});return Kz(n,i)}"~validate"(t){var n,i;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Bf(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:r});return Ny(s)?{value:s.value}:{issues:r.common.issues}}catch(s){(i=(n=s==null?void 0:s.message)==null?void 0:n.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(s=>Ny(s)?{value:s.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Bf(t)},i=this._parse({data:t,path:n.path,parent:n}),s=await(n_(i)?i:Promise.resolve(i));return Kz(n,s)}refine(t,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{const o=t(i),l=()=>s.addIssue({code:it.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new Sy({schema:this,typeName:br.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return wh.create(this,this._def)}nullable(){return By.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Xu.create(this)}promise(){return o_.create(this,this._def)}or(t){return s_.create([this,t],this._def)}and(t){return a_.create(this,t,this._def)}transform(t){return new Sy({...Lr(this._def),schema:this,typeName:br.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new iL({...Lr(this._def),innerType:this,defaultValue:r,typeName:br.ZodDefault})}brand(){return new x4e({typeName:br.ZodBranded,type:this,...Lr(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new sL({...Lr(this._def),innerType:this,catchValue:r,typeName:br.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return PU.create(this,t)}readonly(){return aL.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const YEe=/^c[^\s-]{8,}$/i,JEe=/^[0-9a-z]+$/,ZEe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,e4e=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,t4e=/^[a-z0-9_-]{21}$/i,r4e=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,n4e=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,i4e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,s4e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let DP;const a4e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,o4e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,l4e=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,c4e=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,u4e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,d4e=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,qae="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",A4e=new RegExp(`^${qae}$`);function Xae(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function f4e(e){return new RegExp(`^${Xae(e)}$`)}function h4e(e){let t=`${qae}T${Xae(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function p4e(e,t){return!!((t==="v4"||!t)&&a4e.test(e)||(t==="v6"||!t)&&l4e.test(e))}function m4e(e,t){if(!r4e.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function g4e(e,t){return!!((t==="v4"||!t)&&o4e.test(e)||(t==="v6"||!t)&&c4e.test(e))}class th extends cn{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Lt.string){const s=this._getOrReturnCtx(t);return gt(s,{code:it.invalid_type,expected:Lt.string,received:s.parsedType}),yr}const n=new Bl;let i;for(const s of this._def.checks)if(s.kind==="min")t.data.lengths.value&&(i=this._getOrReturnCtx(t,i),gt(i,{code:it.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,l=t.data.lengtht.test(i),{validation:r,code:it.invalid_string,...Ut.errToObj(n)})}_addCheck(t){return new th({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ut.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ut.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ut.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ut.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ut.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ut.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ut.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ut.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ut.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ut.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ut.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ut.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ut.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...Ut.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Ut.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ut.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Ut.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...Ut.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Ut.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Ut.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Ut.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Ut.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Ut.errToObj(r)})}nonempty(t){return this.min(1,Ut.errToObj(t))}trim(){return new th({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new th({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new th({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew th({checks:[],typeName:br.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Lr(e)});function v4e(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,s=Number.parseInt(e.toFixed(i).replace(".","")),o=Number.parseInt(t.toFixed(i).replace(".",""));return s%o/10**i}class X1 extends cn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Lt.number){const s=this._getOrReturnCtx(t);return gt(s,{code:it.invalid_type,expected:Lt.number,received:s.parsedType}),yr}let n;const i=new Bl;for(const s of this._def.checks)s.kind==="int"?dn.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),gt(n,{code:it.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),gt(n,{code:it.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?v4e(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),gt(n,{code:it.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),gt(n,{code:it.not_finite,message:s.message}),i.dirty()):dn.assertNever(s);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ut.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ut.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ut.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ut.toString(r))}setLimit(t,r,n,i){return new X1({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ut.toString(i)}]})}_addCheck(t){return new X1({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ut.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ut.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ut.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ut.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ut.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ut.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Ut.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ut.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ut.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&dn.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew X1({checks:[],typeName:br.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Lr(e)});class Y1 extends cn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Lt.bigint)return this._getInvalidInput(t);let n;const i=new Bl;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),gt(n,{code:it.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),gt(n,{code:it.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):dn.assertNever(s);return{status:i.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return gt(r,{code:it.invalid_type,expected:Lt.bigint,received:r.parsedType}),yr}gte(t,r){return this.setLimit("min",t,!0,Ut.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ut.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ut.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ut.toString(r))}setLimit(t,r,n,i){return new Y1({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ut.toString(i)}]})}_addCheck(t){return new Y1({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ut.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ut.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ut.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ut.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ut.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Y1({checks:[],typeName:br.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Lr(e)});class Vz extends cn{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Lt.boolean){const n=this._getOrReturnCtx(t);return gt(n,{code:it.invalid_type,expected:Lt.boolean,received:n.parsedType}),yr}return bc(t.data)}}Vz.create=e=>new Vz({typeName:br.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Lr(e)});class i_ extends cn{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Lt.date){const s=this._getOrReturnCtx(t);return gt(s,{code:it.invalid_type,expected:Lt.date,received:s.parsedType}),yr}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return gt(s,{code:it.invalid_date}),yr}const n=new Bl;let i;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()s.value&&(i=this._getOrReturnCtx(t,i),gt(i,{code:it.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):dn.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new i_({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Ut.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Ut.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew i_({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:br.ZodDate,...Lr(e)});class qz extends cn{_parse(t){if(this._getType(t)!==Lt.symbol){const n=this._getOrReturnCtx(t);return gt(n,{code:it.invalid_type,expected:Lt.symbol,received:n.parsedType}),yr}return bc(t.data)}}qz.create=e=>new qz({typeName:br.ZodSymbol,...Lr(e)});class Xz extends cn{_parse(t){if(this._getType(t)!==Lt.undefined){const n=this._getOrReturnCtx(t);return gt(n,{code:it.invalid_type,expected:Lt.undefined,received:n.parsedType}),yr}return bc(t.data)}}Xz.create=e=>new Xz({typeName:br.ZodUndefined,...Lr(e)});class Yz extends cn{_parse(t){if(this._getType(t)!==Lt.null){const n=this._getOrReturnCtx(t);return gt(n,{code:it.invalid_type,expected:Lt.null,received:n.parsedType}),yr}return bc(t.data)}}Yz.create=e=>new Yz({typeName:br.ZodNull,...Lr(e)});class Jz extends cn{constructor(){super(...arguments),this._any=!0}_parse(t){return bc(t.data)}}Jz.create=e=>new Jz({typeName:br.ZodAny,...Lr(e)});class Zz extends cn{constructor(){super(...arguments),this._unknown=!0}_parse(t){return bc(t.data)}}Zz.create=e=>new Zz({typeName:br.ZodUnknown,...Lr(e)});class Qh extends cn{_parse(t){const r=this._getOrReturnCtx(t);return gt(r,{code:it.invalid_type,expected:Lt.never,received:r.parsedType}),yr}}Qh.create=e=>new Qh({typeName:br.ZodNever,...Lr(e)});class e9 extends cn{_parse(t){if(this._getType(t)!==Lt.undefined){const n=this._getOrReturnCtx(t);return gt(n,{code:it.invalid_type,expected:Lt.void,received:n.parsedType}),yr}return bc(t.data)}}e9.create=e=>new e9({typeName:br.ZodVoid,...Lr(e)});class Xu extends cn{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==Lt.array)return gt(r,{code:it.invalid_type,expected:Lt.array,received:r.parsedType}),yr;if(i.exactLength!==null){const o=r.data.length>i.exactLength.value,l=r.data.lengthi.maxLength.value&&(gt(r,{code:it.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,l)=>i.type._parseAsync(new Uh(r,o,r.path,l)))).then(o=>Bl.mergeArray(n,o));const s=[...r.data].map((o,l)=>i.type._parseSync(new Uh(r,o,r.path,l)));return Bl.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new Xu({...this._def,minLength:{value:t,message:Ut.toString(r)}})}max(t,r){return new Xu({...this._def,maxLength:{value:t,message:Ut.toString(r)}})}length(t,r){return new Xu({...this._def,exactLength:{value:t,message:Ut.toString(r)}})}nonempty(t){return this.min(1,t)}}Xu.create=(e,t)=>new Xu({type:e,minLength:null,maxLength:null,exactLength:null,typeName:br.ZodArray,...Lr(t)});function zv(e){if(e instanceof Pi){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=wh.create(zv(n))}return new Pi({...e._def,shape:()=>t})}else return e instanceof Xu?new Xu({...e._def,type:zv(e.element)}):e instanceof wh?wh.create(zv(e.unwrap())):e instanceof By?By.create(zv(e.unwrap())):e instanceof lg?lg.create(e.items.map(t=>zv(t))):e}class Pi extends cn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=dn.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==Lt.object){const u=this._getOrReturnCtx(t);return gt(u,{code:it.invalid_type,expected:Lt.object,received:u.parsedType}),yr}const{status:n,ctx:i}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof Qh&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const d=s[u],A=i.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Uh(i,A,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Qh){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")l.length>0&&(gt(i,{code:it.unrecognized_keys,keys:l}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const A=i.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Uh(i,A,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const A=await d.key,h=await d.value;u.push({key:A,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>Bl.mergeObjectSync(n,u)):Bl.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return Ut.errToObj,new Pi({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var s,o;const i=((o=(s=this._def).errorMap)==null?void 0:o.call(s,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:Ut.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new Pi({...this._def,unknownKeys:"strip"})}passthrough(){return new Pi({...this._def,unknownKeys:"passthrough"})}extend(t){return new Pi({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Pi({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:br.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Pi({...this._def,catchall:t})}pick(t){const r={};for(const n of dn.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Pi({...this._def,shape:()=>r})}omit(t){const r={};for(const n of dn.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Pi({...this._def,shape:()=>r})}deepPartial(){return zv(this)}partial(t){const r={};for(const n of dn.objectKeys(this.shape)){const i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new Pi({...this._def,shape:()=>r})}required(t){const r={};for(const n of dn.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof wh;)s=s._def.innerType;r[n]=s}return new Pi({...this._def,shape:()=>r})}keyof(){return Yae(dn.objectKeys(this.shape))}}Pi.create=(e,t)=>new Pi({shape:()=>e,unknownKeys:"strip",catchall:Qh.create(),typeName:br.ZodObject,...Lr(t)});Pi.strictCreate=(e,t)=>new Pi({shape:()=>e,unknownKeys:"strict",catchall:Qh.create(),typeName:br.ZodObject,...Lr(t)});Pi.lazycreate=(e,t)=>new Pi({shape:e,unknownKeys:"strip",catchall:Qh.create(),typeName:br.ZodObject,...Lr(t)});class s_ extends cn{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function i(s){for(const l of s)if(l.result.status==="valid")return l.result;for(const l of s)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;const o=s.map(l=>new PA(l.ctx.common.issues));return gt(r,{code:it.invalid_union,unionErrors:o}),yr}if(r.common.async)return Promise.all(n.map(async s=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const l=o.map(c=>new PA(c));return gt(r,{code:it.invalid_union,unionErrors:l}),yr}}get options(){return this._def.options}}s_.create=(e,t)=>new s_({options:e,typeName:br.ZodUnion,...Lr(t)});function nL(e,t){const r=Bf(e),n=Bf(t);if(e===t)return{valid:!0,data:e};if(r===Lt.object&&n===Lt.object){const i=dn.objectKeys(t),s=dn.objectKeys(e).filter(l=>i.indexOf(l)!==-1),o={...e,...t};for(const l of s){const c=nL(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(r===Lt.array&&n===Lt.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let s=0;s{if(Wz(s)||Wz(o))return yr;const l=nL(s.value,o.value);return l.valid?((Gz(s)||Gz(o))&&r.dirty(),{status:r.value,value:l.data}):(gt(n,{code:it.invalid_intersection_types}),yr)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}a_.create=(e,t,r)=>new a_({left:e,right:t,typeName:br.ZodIntersection,...Lr(r)});class lg extends cn{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Lt.array)return gt(n,{code:it.invalid_type,expected:Lt.array,received:n.parsedType}),yr;if(n.data.lengththis._def.items.length&&(gt(n,{code:it.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const s=[...n.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new Uh(n,o,n.path,l)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>Bl.mergeArray(r,o)):Bl.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new lg({...this._def,rest:t})}}lg.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new lg({items:e,typeName:br.ZodTuple,rest:null,...Lr(t)})};class t9 extends cn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Lt.map)return gt(n,{code:it.invalid_type,expected:Lt.map,received:n.parsedType}),yr;const i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([l,c],u)=>({key:i._parse(new Uh(n,l,n.path,[u,"key"])),value:s._parse(new Uh(n,c,n.path,[u,"value"]))}));if(n.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return yr;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return yr;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}}}}t9.create=(e,t,r)=>new t9({valueType:t,keyType:e,typeName:br.ZodMap,...Lr(r)});class J1 extends cn{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Lt.set)return gt(n,{code:it.invalid_type,expected:Lt.set,received:n.parsedType}),yr;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(gt(n,{code:it.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const s=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return yr;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const l=[...n.data.values()].map((c,u)=>s._parse(new Uh(n,c,n.path,u)));return n.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,r){return new J1({...this._def,minSize:{value:t,message:Ut.toString(r)}})}max(t,r){return new J1({...this._def,maxSize:{value:t,message:Ut.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}J1.create=(e,t)=>new J1({valueType:e,minSize:null,maxSize:null,typeName:br.ZodSet,...Lr(t)});class r9 extends cn{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}r9.create=(e,t)=>new r9({getter:e,typeName:br.ZodLazy,...Lr(t)});class n9 extends cn{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return gt(r,{received:r.data,code:it.invalid_literal,expected:this._def.value}),yr}return{status:"valid",value:t.data}}get value(){return this._def.value}}n9.create=(e,t)=>new n9({value:e,typeName:br.ZodLiteral,...Lr(t)});function Yae(e,t){return new jy({values:e,typeName:br.ZodEnum,...Lr(t)})}class jy extends cn{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return gt(r,{expected:dn.joinValues(n),received:r.parsedType,code:it.invalid_type}),yr}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return gt(r,{received:r.data,code:it.invalid_enum_value,options:n}),yr}return bc(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return jy.create(t,{...this._def,...r})}exclude(t,r=this._def){return jy.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}jy.create=Yae;class i9 extends cn{_parse(t){const r=dn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==Lt.string&&n.parsedType!==Lt.number){const i=dn.objectValues(r);return gt(n,{expected:dn.joinValues(i),received:n.parsedType,code:it.invalid_type}),yr}if(this._cache||(this._cache=new Set(dn.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=dn.objectValues(r);return gt(n,{received:n.data,code:it.invalid_enum_value,options:i}),yr}return bc(t.data)}get enum(){return this._def.values}}i9.create=(e,t)=>new i9({values:e,typeName:br.ZodNativeEnum,...Lr(t)});class o_ extends cn{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Lt.promise&&r.common.async===!1)return gt(r,{code:it.invalid_type,expected:Lt.promise,received:r.parsedType}),yr;const n=r.parsedType===Lt.promise?r.data:Promise.resolve(r.data);return bc(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}o_.create=(e,t)=>new o_({type:e,typeName:br.ZodPromise,...Lr(t)});class Sy extends cn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===br.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o=>{gt(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(n.data,s);if(n.common.async)return Promise.resolve(o).then(async l=>{if(r.value==="aborted")return yr;const c=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return c.status==="aborted"?yr:c.status==="dirty"||r.value==="dirty"?fw(c.value):c});{if(r.value==="aborted")return yr;const l=this._def.schema._parseSync({data:o,path:n.path,parent:n});return l.status==="aborted"?yr:l.status==="dirty"||r.value==="dirty"?fw(l.value):l}}if(i.type==="refinement"){const o=l=>{const c=i.refinement(l,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?yr:(l.status==="dirty"&&r.dirty(),o(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?yr:(l.status==="dirty"&&r.dirty(),o(l.value).then(()=>({status:r.value,value:l.value}))))}if(i.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ny(o))return yr;const l=i.transform(o.value,s);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Ny(o)?Promise.resolve(i.transform(o.value,s)).then(l=>({status:r.value,value:l})):yr);dn.assertNever(i)}}Sy.create=(e,t,r)=>new Sy({schema:e,typeName:br.ZodEffects,effect:t,...Lr(r)});Sy.createWithPreprocess=(e,t,r)=>new Sy({schema:t,effect:{type:"preprocess",transform:e},typeName:br.ZodEffects,...Lr(r)});class wh extends cn{_parse(t){return this._getType(t)===Lt.undefined?bc(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}wh.create=(e,t)=>new wh({innerType:e,typeName:br.ZodOptional,...Lr(t)});class By extends cn{_parse(t){return this._getType(t)===Lt.null?bc(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}By.create=(e,t)=>new By({innerType:e,typeName:br.ZodNullable,...Lr(t)});class iL extends cn{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===Lt.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}iL.create=(e,t)=>new iL({innerType:e,typeName:br.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Lr(t)});class sL extends cn{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return n_(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new PA(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new PA(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}sL.create=(e,t)=>new sL({innerType:e,typeName:br.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Lr(t)});class s9 extends cn{_parse(t){if(this._getType(t)!==Lt.nan){const n=this._getOrReturnCtx(t);return gt(n,{code:it.invalid_type,expected:Lt.nan,received:n.parsedType}),yr}return{status:"valid",value:t.data}}}s9.create=e=>new s9({typeName:br.ZodNaN,...Lr(e)});class x4e extends cn{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class PU extends cn{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?yr:s.status==="dirty"?(r.dirty(),fw(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?yr:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new PU({in:t,out:r,typeName:br.ZodPipeline})}}class aL extends cn{_parse(t){const r=this._def.innerType._parse(t),n=i=>(Ny(i)&&(i.value=Object.freeze(i.value)),i);return n_(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}}aL.create=(e,t)=>new aL({innerType:e,typeName:br.ZodReadonly,...Lr(t)});Pi.lazycreate;var br;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(br||(br={}));const Ep=th.create;Qh.create;Xu.create;const y4e=Pi.create;Pi.strictCreate;s_.create;a_.create;lg.create;jy.create;o_.create;wh.create;By.create;const b4e=y4e({name:Ep().trim().min(1,"Name is required").max(100),email:Ep().trim().email("Please enter a valid email").max(255),company:Ep().trim().max(200).optional(),role:Ep().min(1,"Please select your role"),country:Ep().trim().max(100).optional(),phone:Ep().trim().max(20).optional(),brief:Ep().trim().max(1e3).optional()}),Jae=({trigger:e})=>{const[t,r]=w.useState(!1),[n,i]=w.useState(!1),[s,o]=w.useState({name:"",email:"",company:"",role:"",country:"",phone:"",brief:""}),[l,c]=w.useState({}),u=(A,h)=>{o(f=>({...f,[A]:h})),l[A]&&c(f=>({...f,[A]:""}))},d=async A=>{A.preventDefault(),c({});const h=b4e.safeParse(s);if(!h.success){const m={};h.error.errors.forEach(p=>{p.path[0]&&(m[p.path[0]]=p.message)}),c(m);return}i(!0);const{error:f}=await Re.from("demo_requests").insert({name:h.data.name,email:h.data.email,company:h.data.company||null,role:h.data.role,country:h.data.country||null,phone:h.data.phone||null,brief:h.data.brief||null});if(i(!1),f){ZO({title:"Something went wrong",description:"Please try again later.",variant:"destructive"});return}ZO({title:"Demo request submitted!",description:"Our team will reach out to you shortly."}),o({name:"",email:"",company:"",role:"",country:"",phone:"",brief:""}),r(!1)};return a.jsxs(Mi,{open:t,onOpenChange:r,children:[a.jsx(EU,{asChild:!0,children:e}),a.jsxs(yi,{className:"sm:max-w-2xl",children:[a.jsxs(bi,{className:"pb-2",children:[a.jsx(wi,{className:"text-xl font-bold text-foreground",children:"Request a Personalized Demo"}),a.jsx("p",{className:"text-sm text-foreground",children:"Our experts will reach out to give you a personalized walkthrough tailored to your needs."})]}),a.jsxs("form",{onSubmit:d,className:"space-y-3",children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(Pe,{htmlFor:"demo-name",className:"text-xs",children:"Name *"}),a.jsx(st,{id:"demo-name",value:s.name,onChange:A=>u("name",A.target.value),placeholder:"Your full name",className:"h-9"}),l.name&&a.jsx("p",{className:"text-xs text-destructive",children:l.name})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Pe,{htmlFor:"demo-email",className:"text-xs",children:"Email *"}),a.jsx(st,{id:"demo-email",type:"email",value:s.email,onChange:A=>u("email",A.target.value),placeholder:"you@company.com",className:"h-9"}),l.email&&a.jsx("p",{className:"text-xs text-destructive",children:l.email})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Pe,{htmlFor:"demo-role",className:"text-xs",children:"I am a... *"}),a.jsxs(It,{value:s.role,onValueChange:A=>u("role",A),children:[a.jsx(_t,{className:"h-9",children:a.jsx(Ot,{placeholder:"Select role"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"freelancer",children:"Freelancer"}),a.jsx(ye,{value:"content_creator",children:"Content Creator"}),a.jsx(ye,{value:"marketer",children:"Marketer"}),a.jsx(ye,{value:"agency",children:"Agency"}),a.jsx(ye,{value:"company",children:"Company / Team"}),a.jsx(ye,{value:"other",children:"Other"})]})]}),l.role&&a.jsx("p",{className:"text-xs text-destructive",children:l.role})]})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(Pe,{htmlFor:"demo-company",className:"text-xs",children:"Company"}),a.jsx(st,{id:"demo-company",value:s.company,onChange:A=>u("company",A.target.value),placeholder:"Company name",className:"h-9"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Pe,{htmlFor:"demo-country",className:"text-xs",children:"Country"}),a.jsx(st,{id:"demo-country",value:s.country,onChange:A=>u("country",A.target.value),placeholder:"Your country",className:"h-9"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Pe,{htmlFor:"demo-phone",className:"text-xs",children:"Phone (optional)"}),a.jsx(st,{id:"demo-phone",value:s.phone,onChange:A=>u("phone",A.target.value),placeholder:"+1 234 567 890",className:"h-9"})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Pe,{htmlFor:"demo-brief",className:"text-xs",children:"Tell us about your requirements"}),a.jsx(Zr,{id:"demo-brief",value:s.brief,onChange:A=>u("brief",A.target.value),placeholder:"What are you looking to achieve with WordSmith AGI?",rows:2,className:"resize-none"})]}),a.jsxs("div",{className:"flex items-center gap-3 bg-muted/50 rounded-lg p-3",children:[a.jsx(Ibe,{className:"w-4 h-4 text-primary shrink-0"}),a.jsx("p",{className:"text-xs text-foreground",children:"Our product experts will schedule a personalized demo. You'll hear from us within 24 hours."})]}),a.jsx(ve,{type:"submit",className:"w-full",disabled:n,children:n?"Submitting...":"Request Demo"})]})]})]})},Zae=({children:e,url:t="wordsmithagi.com",className:r})=>a.jsxs("div",{className:Le("rounded-xl overflow-hidden bg-[hsl(var(--surface-0))] border border-[hsl(var(--border-strong))]",r),children:[a.jsxs("div",{className:"flex items-center gap-3 px-4 h-9 border-b border-[hsl(var(--border-subtle))] bg-[hsl(var(--surface-1))]",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"w-3 h-3 rounded-full bg-[#FF5F57] ring-1 ring-inset ring-black/10"}),a.jsx("span",{className:"w-3 h-3 rounded-full bg-[#FEBC2E] ring-1 ring-inset ring-black/10"}),a.jsx("span",{className:"w-3 h-3 rounded-full bg-[#28C840] ring-1 ring-inset ring-black/10"})]}),a.jsx("div",{className:"flex-1 flex justify-center",children:a.jsxs("div",{className:"inline-flex items-center gap-1.5 px-3 py-0.5 rounded-md bg-[hsl(var(--surface-0))] border border-[hsl(var(--border-subtle))] text-[11px] text-foreground font-mono",children:[a.jsx(ore,{className:"w-3 h-3 text-foreground/70",strokeWidth:2}),t]})}),a.jsx("div",{className:"w-[54px]"})]}),a.jsx("div",{className:"bg-[hsl(var(--surface-0))]",children:e})]}),eoe="/assets/product-content-writer-DYP0xSpv.png",a9=["blog posts","slide decks","infographics"],w4e=()=>{const[e,t]=w.useState(0);return w.useEffect(()=>{const r=setInterval(()=>t(n=>(n+1)%a9.length),2400);return()=>clearInterval(r)},[]),a.jsxs("section",{className:"relative pt-20 pb-10 lg:pt-28 lg:pb-16 bg-[hsl(var(--surface-0))]",children:[a.jsxs("div",{className:"container px-4 sm:px-6 lg:px-8 max-w-[1200px] mx-auto",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-primary"}),a.jsx("span",{className:"eyebrow",children:"Strategy. Plan. Content. Distribution."})]}),a.jsxs("div",{className:"mb-10 lg:mb-14",children:[a.jsxs("h1",{className:"display-headline text-foreground text-balance max-w-[18ch]",style:{fontSize:"clamp(44px, 7.4vw, 96px)"},children:["Your AI marketing team,",a.jsx("br",{}),"from strategy to"," ",a.jsx("span",{className:"relative inline-block align-baseline",children:a.jsx("span",{className:"italic text-primary inline-block animate-[fadeUp_400ms_ease-out]",children:a9[e]},e)}),"."]}),a.jsxs("div",{className:"mt-8 lg:mt-10 max-w-[640px]",children:[a.jsx("p",{className:"text-[19px] lg:text-[20px] leading-[1.6] text-foreground mb-7",children:"The only platform that builds your marketing strategy, turns it into a weekly plan, then produces the content, slides, and visuals to ship it."}),a.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-3",children:[a.jsx(ve,{size:"lg",className:"h-12 px-6 text-base bg-primary hover:bg-[hsl(var(--primary-dark))] text-primary-foreground rounded-lg group",asChild:!0,children:a.jsxs(Et,{to:"/auth",className:"flex items-center gap-2",children:["Start free",a.jsx(Di,{className:"w-4 h-4 transition-transform group-hover:translate-x-0.5",strokeWidth:2})]})}),a.jsx(Jae,{trigger:a.jsx(ve,{size:"lg",variant:"outline",className:"h-12 px-6 text-base rounded-lg border border-[hsl(var(--border-strong))] bg-transparent text-foreground hover:bg-[hsl(var(--surface-1))]",children:"Request a demo"})})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[14px] text-foreground mt-5",children:[a.jsx("span",{children:"No credit card"}),a.jsx("span",{className:"text-foreground/40",children:"·"}),a.jsx("span",{children:"15 free credits"}),a.jsx("span",{className:"text-foreground/40",children:"·"}),a.jsx("span",{children:"Cancel anytime"})]})]})]}),a.jsx("div",{className:"border-t border-[hsl(var(--border-subtle))] mb-10"}),a.jsxs("div",{className:"relative",children:[a.jsx(Zae,{url:"wordsmithagi.com",className:"shadow-[0_30px_80px_-30px_rgba(0,0,0,0.18)]",children:a.jsx("img",{src:eoe,alt:"WordSmith AGI Content Writer dashboard",className:"block w-full h-auto"})}),a.jsx("div",{className:"flex flex-wrap items-center justify-center gap-x-8 gap-y-2 mt-8",children:["Content","Presentations","Infographics"].map((r,n)=>a.jsxs("span",{className:"flex items-center gap-3",children:[n>0&&a.jsx("span",{className:"w-1 h-1 rounded-full bg-foreground/30","aria-hidden":!0}),a.jsx("span",{className:"font-display italic text-foreground text-[20px]",children:r})]},r))})]})]}),a.jsx("style",{children:` @keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } } `})]})},o9=["Agencies","Freelancers","Founders","Marketing teams","Creators","SaaS companies"],C4e=()=>a.jsx("section",{className:"py-8 bg-[hsl(var(--surface-0))] border-b border-[hsl(var(--border-subtle))]",children:a.jsx("div",{className:"container px-4 sm:px-6 lg:px-8 max-w-[1200px] mx-auto",children:a.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-4 gap-y-3 text-foreground",children:[a.jsx("span",{className:"text-[14px] font-semibold uppercase tracking-[0.14em] text-foreground mr-2",children:"Built for"}),o9.map((e,t)=>a.jsxs("span",{className:"flex items-center gap-4",children:[a.jsx("span",{className:"font-display italic text-foreground text-[20px] leading-none",children:e}),ta.jsx("section",{className:"py-16 lg:py-24 bg-[hsl(var(--surface-0))]",children:a.jsxs("div",{className:"container px-4 sm:px-6 lg:px-8 max-w-[1200px] mx-auto",children:[a.jsxs("div",{className:"max-w-3xl mb-16 lg:mb-20",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[a.jsx("span",{className:"w-2 h-2 rounded-sm bg-primary"}),a.jsx("span",{className:"eyebrow",children:"The product"})]}),a.jsxs("h2",{className:"display-headline text-foreground",style:{fontSize:"clamp(36px, 5vw, 64px)"},children:["Three tools. ",a.jsx("em",{children:"One workflow."})]}),a.jsx("p",{className:"text-[17px] text-foreground leading-[1.7] max-w-[60ch] mt-5",children:"Built so a single person can run the content output of a small team."})]}),a.jsx("div",{className:"space-y-20 lg:space-y-32",children:S4e.map((e,t)=>{const r=t%2===1;return a.jsxs("div",{className:"grid lg:grid-cols-12 gap-10 lg:gap-14 items-center ",children:[a.jsxs("div",{className:`lg:col-span-5 ${r?"lg:order-2":"lg:order-1"}`,children:[a.jsx("div",{className:"text-[12px] font-semibold tracking-[0.16em] uppercase mb-4",style:{color:e.accent},children:e.eyebrow}),a.jsx("h3",{className:"display-headline text-foreground mb-5",style:{fontSize:"clamp(30px, 3.6vw, 48px)"},children:e.title}),a.jsx("p",{className:"text-[16px] text-foreground leading-[1.7] mb-6 max-w-[50ch]",children:e.description}),a.jsx("ul",{className:"space-y-2 mb-7",children:e.bullets.map(n=>a.jsxs("li",{className:"flex items-center gap-3 text-[14px] text-foreground",children:[a.jsx("span",{className:"w-4 h-px",style:{backgroundColor:e.accent},"aria-hidden":!0}),n]},n))}),a.jsxs(Et,{to:e.link,className:"inline-flex items-center gap-1.5 text-[14px] font-semibold text-foreground border-b border-foreground pb-0.5 hover:gap-3 transition-all",children:[e.cta,a.jsx(Di,{className:"w-4 h-4",strokeWidth:1.75})]})]}),a.jsx("div",{className:`lg:col-span-7 ${r?"lg:order-1":"lg:order-2"}`,children:a.jsx(Zae,{className:"shadow-[0_30px_80px_-30px_rgba(0,0,0,0.18)]",children:a.jsx("img",{src:e.image,alt:e.title,className:"block w-full h-auto"})})})]},e.title)})})]})}),_4e=[{n:"01",title:"Get your strategy",desc:"Our AI analyzes your business, audience, and goals, then builds a tailored marketing strategy in minutes."},{n:"02",title:"Get a weekly plan",desc:"Your strategy turns into a concrete content calendar. Topics, formats, and channels mapped week by week."},{n:"03",title:"Create the content",desc:"Generate the blogs, slides, and infographics on plan. Brand voice and SEO baked in from the first draft."},{n:"04",title:"Ship and track",desc:"Publish to WordPress, export to PPTX, PDF, or PNG. Track what's done and what's next from one dashboard."}],k4e=()=>a.jsx("section",{className:"py-16 lg:py-24 bg-[hsl(var(--surface-1))] border-y border-[hsl(var(--border-subtle))]",children:a.jsxs("div",{className:"container px-4 sm:px-6 lg:px-8 max-w-[1200px] mx-auto",children:[a.jsxs("div",{className:"max-w-3xl mb-14",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[a.jsx("span",{className:"w-2 h-2 rounded-sm bg-primary"}),a.jsx("span",{className:"eyebrow",children:"How it works"})]}),a.jsxs("h2",{className:"display-headline text-foreground",style:{fontSize:"clamp(36px, 5vw, 64px)"},children:["Strategy first. Then a plan. ",a.jsx("em",{children:"Then the content."})]})]}),a.jsx("div",{className:"divide-y divide-[hsl(var(--border-subtle))] border-y border-[hsl(var(--border-subtle))]",children:_4e.map(e=>a.jsxs("div",{className:"grid grid-cols-12 gap-6 py-8 lg:py-10 items-start",children:[a.jsx("div",{className:"col-span-12 md:col-span-2 font-display text-foreground/30",style:{fontSize:"clamp(40px, 5vw, 72px)",lineHeight:1},children:e.n}),a.jsx("div",{className:"col-span-12 md:col-span-4",children:a.jsx("h3",{className:"display-headline text-foreground",style:{fontSize:"clamp(24px, 2.4vw, 32px)"},children:e.title})}),a.jsx("div",{className:"col-span-12 md:col-span-6",children:a.jsx("p",{className:"text-[16px] text-foreground leading-[1.7] max-w-[58ch]",children:e.desc})})]},e.n))})]})}),E4e=()=>{const{user:e}=fi(),t=hs(),{toast:r}=Dr(),[n,i]=w.useState(null),s=[{name:"Free",price:"$0",period:"forever",badge:null,features:["15 credits for your first month, then 5/month","Content Writing, Presentations & Infographics","Create Mode with basic content","Idea Lab with 5 daily ideas","Content Library read access","3 content types","Email support"],cta:"Get Started Free",popular:!1,tier:"free",planId:null},{name:"Lite",price:"$10",period:"per month",badge:null,features:["50 credits per month","All three tools — Writing, Slides & Infographics","Create Mode with all content types","Unlimited Idea Lab access","Full Studio Mode access","Complete Library with save and export","7 content formats"],cta:"Choose Lite",popular:!1,tier:"lite",planId:"1072874"},{name:"Pro",price:"$20",period:"per month",badge:"Most Popular",features:["150 credits per month","All three tools — Writing, Slides & Infographics","Complete Growth Lab access","Presets and Templates","Advanced SEO + GEO optimization","Professional presentation templates","Priority support"],cta:"Choose Pro",popular:!0,tier:"pro",planId:"1072875"},{name:"Elite",price:"$30",period:"per month",badge:null,features:["300 credits per month","All three tools — Writing, Slides & Infographics","Unlimited Idea Lab with bookmarking","WordPress integration","Team Management","Premium presentation & infographic templates","Priority processing","Premium support"],cta:"Choose Elite",popular:!1,tier:"elite",planId:"1072883"}],o=async l=>{if(!e){t("/auth");return}if(l.tier==="free"){t("/dashboard");return}i(l.name);try{const{data:c,error:u}=await Re.functions.invoke("create-lemonsqueezy-subscription",{body:{variantId:l.planId,tier:l.tier}});if(u)throw u;if(c.checkoutUrl)window.location.href=c.checkoutUrl;else throw new Error("No checkout URL received")}catch(c){console.error("Subscription error:",c),r({title:"Subscription Failed",description:"Unable to create subscription. Please try again.",variant:"destructive"})}finally{i(null)}};return a.jsx("section",{id:"pricing",className:"py-16 lg:py-24 bg-[hsl(var(--surface-0))] border-y border-[hsl(var(--border-subtle))]",children:a.jsxs("div",{className:"container px-4 sm:px-6 lg:px-8 max-w-[1200px] mx-auto",children:[a.jsxs("div",{className:"max-w-3xl mb-14",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[a.jsx("span",{className:"w-2 h-2 rounded-sm bg-primary"}),a.jsx("span",{className:"eyebrow",children:"Pricing"})]}),a.jsxs("h2",{className:"display-headline text-foreground",style:{fontSize:"clamp(36px, 5vw, 64px)"},children:["Simple plans. ",a.jsx("em",{children:"Real value."})]}),a.jsx("p",{className:"text-[17px] text-foreground leading-[1.7] max-w-[60ch] mt-5",children:"Every plan includes Content Writer, Presentations, and Infographics. Start free, upgrade when you scale."})]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-5 max-w-[1200px] mx-auto",children:s.map((l,c)=>a.jsxs("div",{className:`relative bg-[hsl(var(--surface-0))] rounded-xl p-6 flex flex-col border ${l.popular?"border-saffron":l.tier==="elite"?"border-navy":"border-[hsl(var(--border-subtle))]"}`,children:[l.badge&&a.jsx("div",{className:"absolute -top-3 left-6 px-2.5 py-0.5 rounded-full bg-saffron text-saffron-foreground text-[11px] font-semibold tracking-wide uppercase",children:l.badge}),l.tier==="elite"&&a.jsx("div",{className:"absolute -top-3 left-6 px-2.5 py-0.5 rounded-full bg-navy text-navy-foreground text-[11px] font-semibold tracking-wide uppercase",children:"Premium"}),a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"text-[14px] font-semibold text-foreground mb-3",children:l.name}),a.jsxs("div",{className:"flex items-baseline gap-1.5",children:[a.jsx("span",{className:"text-[40px] font-bold leading-none text-foreground",children:l.price}),a.jsxs("span",{className:"text-[13px] text-foreground/60",children:["/",l.period]})]})]}),a.jsx("ul",{className:"space-y-2.5 flex-1 mb-6",children:l.features.map((u,d)=>a.jsxs("li",{className:"flex items-start gap-2.5 text-[13px] text-foreground/80 leading-snug",children:[a.jsx(dr,{className:"w-4 h-4 text-primary flex-shrink-0 mt-0.5",strokeWidth:2.25}),a.jsx("span",{children:u})]},d))}),a.jsx(ve,{size:"lg",variant:l.popular?"default":"outline",className:`w-full h-11 text-[14px] font-semibold rounded-lg ${l.popular?"bg-primary hover:bg-[hsl(var(--primary-dark))] text-primary-foreground":"border border-[hsl(var(--border-strong))] bg-transparent text-foreground hover:bg-[hsl(var(--surface-1))]"}`,onClick:()=>o(l),disabled:n===l.name,children:n===l.name?a.jsxs(a.Fragment,{children:[a.jsx(Nl,{className:"mr-2 h-4 w-4 animate-spin"}),"Processing"]}):l.cta})]},c))}),a.jsx("p",{className:"text-center text-[13px] text-foreground/60 mt-8",children:"SSL security, 99.9% uptime, and full data export on every plan."})]})})};var bE="Collapsible",[T4e,toe]=Zi(bE),[P4e,IU]=T4e(bE),roe=w.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:i,disabled:s,onOpenChange:o,...l}=e,[c,u]=fa({prop:n,defaultProp:i??!1,onChange:o,caller:bE});return a.jsx(P4e,{scope:r,disabled:s,contentId:lo(),open:c,onOpenToggle:w.useCallback(()=>u(d=>!d),[u]),children:a.jsx(at.div,{"data-state":FU(c),"data-disabled":s?"":void 0,...l,ref:t})})});roe.displayName=bE;var noe="CollapsibleTrigger",ioe=w.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,i=IU(noe,r);return a.jsx(at.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":FU(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...n,ref:t,onClick:Ye(e.onClick,i.onOpenToggle)})});ioe.displayName=noe;var OU="CollapsibleContent",soe=w.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=IU(OU,e.__scopeCollapsible);return a.jsx(Gs,{present:r||i.open,children:({present:s})=>a.jsx(I4e,{...n,ref:t,present:s})})});soe.displayName=OU;var I4e=w.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:i,...s}=e,o=IU(OU,r),[l,c]=w.useState(n),u=w.useRef(null),d=Jt(t,u),A=w.useRef(0),h=A.current,f=w.useRef(0),m=f.current,p=o.open||l,g=w.useRef(p),v=w.useRef(void 0);return w.useEffect(()=>{const x=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(x)},[]),Ai(()=>{const x=u.current;if(x){v.current=v.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const y=x.getBoundingClientRect();A.current=y.height,f.current=y.width,g.current||(x.style.transitionDuration=v.current.transitionDuration,x.style.animationName=v.current.animationName),c(n)}},[o.open,n]),a.jsx(at.div,{"data-state":FU(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!p,...s,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:p&&i})});function FU(e){return e?"open":"closed"}var O4e=roe,F4e=ioe,L4e=soe,uu="Accordion",M4e=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[LU,D4e,R4e]=Yh(uu),[wE,fNt]=Zi(uu,[R4e,toe]),MU=toe(),aoe=re.forwardRef((e,t)=>{const{type:r,...n}=e,i=n,s=n;return a.jsx(LU.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?a.jsx($4e,{...s,ref:t}):a.jsx(H4e,{...i,ref:t})})});aoe.displayName=uu;var[ooe,U4e]=wE(uu),[loe,Q4e]=wE(uu,{collapsible:!1}),H4e=re.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:i=()=>{},collapsible:s=!1,...o}=e,[l,c]=fa({prop:r,defaultProp:n??"",onChange:i,caller:uu});return a.jsx(ooe,{scope:e.__scopeAccordion,value:re.useMemo(()=>l?[l]:[],[l]),onItemOpen:c,onItemClose:re.useCallback(()=>s&&c(""),[s,c]),children:a.jsx(loe,{scope:e.__scopeAccordion,collapsible:s,children:a.jsx(coe,{...o,ref:t})})})}),$4e=re.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:i=()=>{},...s}=e,[o,l]=fa({prop:r,defaultProp:n??[],onChange:i,caller:uu}),c=re.useCallback(d=>l((A=[])=>[...A,d]),[l]),u=re.useCallback(d=>l((A=[])=>A.filter(h=>h!==d)),[l]);return a.jsx(ooe,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:u,children:a.jsx(loe,{scope:e.__scopeAccordion,collapsible:!0,children:a.jsx(coe,{...s,ref:t})})})}),[z4e,CE]=wE(uu),coe=re.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:i,orientation:s="vertical",...o}=e,l=re.useRef(null),c=Jt(l,t),u=D4e(r),A=rp(i)==="ltr",h=Ye(e.onKeyDown,f=>{var T;if(!M4e.includes(f.key))return;const m=f.target,p=u().filter(B=>{var I;return!((I=B.ref.current)!=null&&I.disabled)}),g=p.findIndex(B=>B.ref.current===m),v=p.length;if(g===-1)return;f.preventDefault();let x=g;const y=0,b=v-1,C=()=>{x=g+1,x>b&&(x=y)},j=()=>{x=g-1,x{const{__scopeAccordion:r,value:n,...i}=e,s=CE(l_,r),o=U4e(l_,r),l=MU(r),c=lo(),u=n&&o.value.includes(n)||!1,d=s.disabled||e.disabled;return a.jsx(W4e,{scope:r,open:u,disabled:d,triggerId:c,children:a.jsx(O4e,{"data-orientation":s.orientation,"data-state":moe(u),...l,...i,ref:t,disabled:d,open:u,onOpenChange:A=>{A?o.onItemOpen(n):o.onItemClose(n)}})})});uoe.displayName=l_;var doe="AccordionHeader",Aoe=re.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,i=CE(uu,r),s=DU(doe,r);return a.jsx(at.h3,{"data-orientation":i.orientation,"data-state":moe(s.open),"data-disabled":s.disabled?"":void 0,...n,ref:t})});Aoe.displayName=doe;var oL="AccordionTrigger",foe=re.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,i=CE(uu,r),s=DU(oL,r),o=Q4e(oL,r),l=MU(r);return a.jsx(LU.ItemSlot,{scope:r,children:a.jsx(F4e,{"aria-disabled":s.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:s.triggerId,...l,...n,ref:t})})});foe.displayName=oL;var hoe="AccordionContent",poe=re.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,i=CE(uu,r),s=DU(hoe,r),o=MU(r);return a.jsx(L4e,{role:"region","aria-labelledby":s.triggerId,"data-orientation":i.orientation,...o,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});poe.displayName=hoe;function moe(e){return e?"open":"closed"}var G4e=aoe,K4e=uoe,V4e=Aoe,goe=foe,voe=poe;const xoe=G4e,RU=w.forwardRef(({className:e,...t},r)=>a.jsx(K4e,{ref:r,className:Le("border-b",e),...t}));RU.displayName="AccordionItem";const UU=w.forwardRef(({className:e,children:t,...r},n)=>a.jsx(V4e,{className:"flex",children:a.jsxs(goe,{ref:n,className:Le("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,a.jsx(y0,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));UU.displayName=goe.displayName;const QU=w.forwardRef(({className:e,children:t,...r},n)=>a.jsx(voe,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:a.jsx("div",{className:Le("pb-4 pt-0",e),children:t})}));QU.displayName=voe.displayName;const q4e=()=>{const e=[{question:"What can I create with WordSmith AGI?",answer:"WordSmith AGI is a three-in-one AI platform. Write SEO and GEO optimized content (blogs, social, video scripts, emails, ecommerce copy), create professional slide presentations from a topic or outline, and design data driven infographics with timelines, comparisons, and charts."},{question:"How does the AI Presentation Maker work?",answer:"Enter a topic, paste an outline, or describe what you need. The AI generates a complete slide deck with professional layouts, text, charts, and speaker notes. Pick a template, customize, and export to PDF or PPTX for PowerPoint or Google Slides."},{question:"How does the AI Infographic Maker work?",answer:"Paste your data or describe what to visualize. Choose a layout (timeline, comparison, process flow, stats summary) and the AI designs a polished infographic with your brand colors and fonts. Export as high resolution PNG or PDF."},{question:"How is WordSmith AGI different from ChatGPT or other AI writers?",answer:"WordSmith AGI is a complete content platform, not just a text generator. It combines content writing with presentation and infographic creation, plus marketing strategy tools (Growth Lab), brand voice consistency, SEO + GEO scoring, and a full content library."},{question:"What is GEO and why does it matter?",answer:"GEO (Generative Engine Optimization) ensures your content is structured to be cited by AI powered search engines like ChatGPT, Perplexity, and Google AI Overviews. As more search happens through AI, GEO is becoming as important as SEO. WordSmith AGI scores your content for both."},{question:"Do all plans include Content Writing, Presentations, and Infographics?",answer:"Yes. Every plan, including Free, gives you access to all three tools. Plans differ in monthly credits and advanced features like Growth Lab, Presets, and WordPress integration."},{question:"How do credits work across the three tools?",answer:"Credits are shared. Content posts use 1 credit, Presentations use 5 credits, and Infographics use 7 credits since they require multiple high resolution AI illustrations. Free users get 15 credits in their first month, then 5 per month."},{question:"Can I cancel my subscription anytime?",answer:"Yes. No long term contracts, no hidden fees. Your plan stays active until the end of your current billing period."}];return a.jsx("section",{id:"faq",className:"py-16 lg:py-24 bg-[hsl(var(--surface-0))]",children:a.jsx("div",{className:"container px-4 sm:px-6 lg:px-8 max-w-[1100px] mx-auto",children:a.jsxs("div",{className:"grid lg:grid-cols-12 gap-12",children:[a.jsxs("div",{className:"lg:col-span-5 lg:sticky lg:top-24 self-start",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[a.jsx("span",{className:"w-2 h-2 rounded-sm bg-primary"}),a.jsx("span",{className:"eyebrow",children:"FAQ & Start"})]}),a.jsxs("h2",{className:"display-headline text-foreground mb-6",style:{fontSize:"clamp(36px, 5vw, 64px)"},children:["Answers, ",a.jsx("em",{children:"before you ask."})]}),a.jsx("p",{className:"text-[16px] text-foreground leading-[1.7] mb-8 max-w-[44ch]",children:"Still have questions? Start free in under a minute, or book a 15-minute demo with the team."}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 mb-6",children:[a.jsx(ve,{size:"lg",className:"h-12 px-6 text-base bg-primary hover:bg-[hsl(var(--primary-dark))] text-primary-foreground rounded-lg group",asChild:!0,children:a.jsxs(Et,{to:"/auth",className:"flex items-center gap-2",children:["Start free",a.jsx(Di,{className:"w-4 h-4 transition-transform group-hover:translate-x-0.5",strokeWidth:2})]})}),a.jsx(Jae,{trigger:a.jsx(ve,{size:"lg",variant:"outline",className:"h-12 px-6 text-base rounded-lg border border-[hsl(var(--border-strong))] bg-transparent text-foreground hover:bg-[hsl(var(--surface-1))]",children:"Request a demo"})})]}),a.jsxs("p",{className:"text-[13px] text-foreground/70",children:["Or email"," ",a.jsx("a",{href:"mailto:contact.wordsmithagi@gmail.com",className:"text-primary hover:underline font-semibold",children:"contact.wordsmithagi@gmail.com"})]})]}),a.jsx("div",{className:"lg:col-span-7",children:a.jsx(xoe,{type:"single",collapsible:!0,className:"border-t border-[hsl(var(--border-subtle))]",children:e.map((t,r)=>a.jsxs(RU,{value:`item-${r}`,className:"border-b border-[hsl(var(--border-subtle))] px-0",children:[a.jsx(UU,{className:"text-left text-[16px] font-semibold text-foreground hover:no-underline py-5",children:t.question}),a.jsx(QU,{className:"text-[15px] text-foreground leading-[1.7] pb-5 pr-4",children:t.answer})]},r))})})]})})})},Mn=()=>a.jsx("footer",{className:"bg-[hsl(var(--surface-1))] border-t border-[hsl(var(--border-subtle))]",children:a.jsxs("div",{className:"container max-w-[1200px] mx-auto px-4 sm:px-6 lg:px-8 py-14",children:[a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-10 mb-12",children:[a.jsxs("div",{className:"col-span-2",children:[a.jsx(Et,{to:"/",className:"inline-flex items-center mb-4",children:a.jsx("img",{src:Xne,alt:"WordSmith AGI",className:"h-10 w-auto"})}),a.jsx("p",{className:"text-[14px] text-foreground/70 leading-relaxed max-w-[320px] mb-5",children:"The AI workspace for content, presentations, and infographics. Built for teams that ship."}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("a",{href:"https://x.com/WordSmithAGI",target:"_blank",rel:"noopener noreferrer",className:"p-2 rounded-md text-foreground/70 hover:text-primary hover:bg-[hsl(var(--surface-2))] transition-colors","aria-label":"X (Twitter)",children:a.jsx("svg",{viewBox:"0 0 24 24",className:"h-4 w-4 fill-current",children:a.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}),a.jsx("a",{href:"https://www.youtube.com/@WordSmithAGI",target:"_blank",rel:"noopener noreferrer",className:"p-2 rounded-md text-foreground/70 hover:text-primary hover:bg-[hsl(var(--surface-2))] transition-colors","aria-label":"YouTube",children:a.jsx(V5,{className:"h-4 w-4"})}),a.jsx("a",{href:"https://linkedin.com/company/wordsmith-agi/?viewAsMember=true",target:"_blank",rel:"noopener noreferrer",className:"p-2 rounded-md text-foreground/70 hover:text-primary hover:bg-[hsl(var(--surface-2))] transition-colors","aria-label":"LinkedIn",children:a.jsx(xC,{className:"h-4 w-4"})}),a.jsx("a",{href:"https://www.facebook.com/profile.php?id=61579997324020",target:"_blank",rel:"noopener noreferrer",className:"p-2 rounded-md text-foreground/70 hover:text-primary hover:bg-[hsl(var(--surface-2))] transition-colors","aria-label":"Facebook",children:a.jsx(b6,{className:"h-4 w-4"})}),a.jsx("a",{href:"https://www.instagram.com/wordsmithagi/",target:"_blank",rel:"noopener noreferrer",className:"p-2 rounded-md text-foreground/70 hover:text-primary hover:bg-[hsl(var(--surface-2))] transition-colors","aria-label":"Instagram",children:a.jsx($5,{className:"h-4 w-4"})})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-[12px] font-semibold tracking-wider text-foreground uppercase mb-4",children:"Product"}),a.jsxs("ul",{className:"space-y-2.5 text-[14px]",children:[a.jsx("li",{children:a.jsx(Et,{to:"/ai-content-writer",className:"text-foreground/70 hover:text-primary transition-colors",children:"Content Writer"})}),a.jsx("li",{children:a.jsx(Et,{to:"/presentations",className:"text-foreground/70 hover:text-primary transition-colors",children:"Presentation Maker"})}),a.jsx("li",{children:a.jsx(Et,{to:"/infographics",className:"text-foreground/70 hover:text-primary transition-colors",children:"Infographic Maker"})}),a.jsx("li",{children:a.jsx(Et,{to:"/#features",className:"text-foreground/70 hover:text-primary transition-colors",children:"Features"})}),a.jsx("li",{children:a.jsx(Et,{to:"/#pricing",className:"text-foreground/70 hover:text-primary transition-colors",children:"Pricing"})})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-[12px] font-semibold tracking-wider text-foreground uppercase mb-4",children:"Company"}),a.jsxs("ul",{className:"space-y-2.5 text-[14px]",children:[a.jsx("li",{children:a.jsx(Et,{to:"/about",className:"text-foreground/70 hover:text-primary transition-colors",children:"About"})}),a.jsx("li",{children:a.jsx(Et,{to:"/careers",className:"text-foreground/70 hover:text-primary transition-colors",children:"Careers"})}),a.jsx("li",{children:a.jsx(Et,{to:"/contact-us",className:"text-foreground/70 hover:text-primary transition-colors",children:"Contact"})}),a.jsx("li",{children:a.jsx(Et,{to:"/help-center",className:"text-foreground/70 hover:text-primary transition-colors",children:"Help Center"})}),a.jsx("li",{children:a.jsx(Et,{to:"/documentation",className:"text-foreground/70 hover:text-primary transition-colors",children:"Docs"})})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-[12px] font-semibold tracking-wider text-foreground uppercase mb-4",children:"Legal"}),a.jsxs("ul",{className:"space-y-2.5 text-[14px]",children:[a.jsx("li",{children:a.jsx(Et,{to:"/privacy",className:"text-foreground/70 hover:text-primary transition-colors",children:"Privacy"})}),a.jsx("li",{children:a.jsx(Et,{to:"/terms-and-conditions",className:"text-foreground/70 hover:text-primary transition-colors",children:"Terms"})}),a.jsx("li",{children:a.jsx(Et,{to:"/cookie-policy",className:"text-foreground/70 hover:text-primary transition-colors",children:"Cookies"})}),a.jsx("li",{children:a.jsx(Et,{to:"/cancellation-refunds",className:"text-foreground/70 hover:text-primary transition-colors",children:"Refunds"})})]})]})]}),a.jsxs("div",{className:"pt-6 border-t border-[hsl(var(--border-subtle))] flex flex-col sm:flex-row items-center justify-between gap-3",children:[a.jsxs("p",{className:"text-[13px] text-foreground/60",children:["© ",new Date().getFullYear()," WordSmith AGI. An Interital Company. All rights reserved."]}),a.jsx("p",{className:"text-[13px] text-foreground/60",children:"Made for teams that ship."})]})]})}),RA=()=>{const[e,t]=w.useState(!1);w.useEffect(()=>{const n=()=>{window.scrollY>300?t(!0):t(!1)};return window.addEventListener("scroll",n),()=>window.removeEventListener("scroll",n)},[]);const r=()=>{window.scrollTo({top:0,behavior:"smooth"})};return a.jsx(a.Fragment,{children:e&&a.jsx(ve,{onClick:r,size:"icon",className:"fixed bottom-8 right-8 z-50 rounded-full shadow-lg hover:shadow-xl transition-all duration-300","aria-label":"Scroll to top",children:a.jsx(kbe,{className:"h-5 w-5"})})})},oi=({pageSlug:e,title:t,description:r,keywords:n,ogImage:i,canonicalUrl:s,schemaType:o,articleData:l})=>{var b,C;const[c,u]=w.useState(null);w.useEffect(()=>{(async()=>{if(e){const{data:S}=await Re.from("seo_settings").select("*").eq("page_slug",e).single();S&&u(S)}})()},[e]);const d=t||(c==null?void 0:c.page_title)||"WordSmith AGI",A=r||(c==null?void 0:c.meta_description)||"",h=n||(c==null?void 0:c.meta_keywords)||[],f=i||(c==null?void 0:c.og_image)||"https://wordsmithagi.com/og-image.jpg",m=s||(c==null?void 0:c.canonical_url)||`https://wordsmithagi.com${window.location.pathname}`,p=o||(c==null?void 0:c.schema_type)||"WebPage",g={"@context":"https://schema.org","@type":"Organization",name:"WordSmith AGI",url:"https://wordsmithagi.com",logo:"https://wordsmithagi.com/logo.png",description:"AI-Powered Content Creation Platform",contactPoint:{"@type":"ContactPoint",contactType:"Customer Support",email:"contact.wordsmithagi@gmail.com"},sameAs:["https://twitter.com/wordsmithai","https://facebook.com/wordsmithai","https://linkedin.com/company/wordsmithai"]},v=l?{"@context":"https://schema.org","@type":"Article",headline:d,description:A,image:f,author:{"@type":"Person",name:l.author||"WordSmith AGI"},publisher:{"@type":"Organization",name:"WordSmith AGI",logo:{"@type":"ImageObject",url:"https://wordsmithagi.com/logo.png"}},datePublished:l.publishedTime,dateModified:l.modifiedTime,articleSection:l.section,keywords:(b=l.tags)==null?void 0:b.join(", ")}:null,y=p==="Article"&&v?v:p==="Organization"?g:{"@context":"https://schema.org","@type":p,name:d,description:A,url:m};return a.jsxs(jne,{children:[a.jsx("title",{children:d}),a.jsx("meta",{name:"title",content:d}),a.jsx("meta",{name:"description",content:A}),h.length>0&&a.jsx("meta",{name:"keywords",content:h.join(", ")}),a.jsx("link",{rel:"canonical",href:m}),a.jsx("meta",{property:"og:type",content:p==="Article"?"article":"website"}),a.jsx("meta",{property:"og:url",content:m}),a.jsx("meta",{property:"og:title",content:(c==null?void 0:c.og_title)||d}),a.jsx("meta",{property:"og:description",content:(c==null?void 0:c.og_description)||A}),a.jsx("meta",{property:"og:image",content:f}),a.jsx("meta",{property:"twitter:card",content:(c==null?void 0:c.twitter_card)||"summary_large_image"}),a.jsx("meta",{property:"twitter:url",content:m}),a.jsx("meta",{property:"twitter:title",content:(c==null?void 0:c.og_title)||d}),a.jsx("meta",{property:"twitter:description",content:(c==null?void 0:c.og_description)||A}),a.jsx("meta",{property:"twitter:image",content:f}),a.jsx("script",{type:"application/ld+json",children:JSON.stringify(y)}),(c==null?void 0:c.additional_schema)&&a.jsx("script",{type:"application/ld+json",children:JSON.stringify(c.additional_schema)}),l&&a.jsxs(a.Fragment,{children:[l.author&&a.jsx("meta",{name:"author",content:l.author}),l.publishedTime&&a.jsx("meta",{property:"article:published_time",content:l.publishedTime}),l.modifiedTime&&a.jsx("meta",{property:"article:modified_time",content:l.modifiedTime}),l.section&&a.jsx("meta",{property:"article:section",content:l.section}),(C=l.tags)==null?void 0:C.map(j=>a.jsx("meta",{property:"article:tag",content:j},j))]})]})},X4e=[{q:"What can I create with WordSmith AGI?",a:"WordSmith AGI is a three-in-one AI platform. Write SEO and GEO optimized content (blogs, social, video scripts, emails, ecommerce copy), create professional slide presentations from a topic or outline, and design data driven infographics with timelines, comparisons, and charts."},{q:"How does the AI Presentation Maker work?",a:"Enter a topic, paste an outline, or describe what you need. The AI generates a complete slide deck with professional layouts, text, charts, and speaker notes. Pick a template, customize, and export to PDF or PPTX for PowerPoint or Google Slides."},{q:"How does the AI Infographic Maker work?",a:"Paste your data or describe what to visualize. Choose a layout (timeline, comparison, process flow, stats summary) and the AI designs a polished infographic with your brand colors and fonts. Export as high resolution PNG or PDF."},{q:"How is WordSmith AGI different from ChatGPT or other AI writers?",a:"WordSmith AGI is a complete content platform, not just a text generator. It combines content writing with presentation and infographic creation, plus marketing strategy tools (Growth Lab), brand voice consistency, SEO + GEO scoring, and a full content library."},{q:"What is GEO and why does it matter?",a:"GEO (Generative Engine Optimization) ensures your content is structured to be cited by AI powered search engines like ChatGPT, Perplexity, and Google AI Overviews. As more search happens through AI, GEO is becoming as important as SEO. WordSmith AGI scores your content for both."},{q:"Do all plans include Content Writing, Presentations, and Infographics?",a:"Yes. Every plan, including Free, gives you access to all three tools. Plans differ in monthly credits and advanced features like Growth Lab, Presets, and WordPress integration."},{q:"How do credits work across the three tools?",a:"Credits are shared. Content posts use 1 credit, Presentations use 5 credits, and Infographics use 7 credits since they require multiple high resolution AI illustrations. Free users get 15 credits in their first month, then 5 per month."},{q:"Can I cancel my subscription anytime?",a:"Yes. No long term contracts, no hidden fees. Your plan stays active until the end of your current billing period."}],Y4e={"@context":"https://schema.org","@type":"FAQPage",mainEntity:X4e.map(e=>({"@type":"Question",name:e.q,acceptedAnswer:{"@type":"Answer",text:e.a}}))},J4e=()=>a.jsxs("div",{className:"min-h-screen bg-[hsl(var(--surface-0))]",children:[a.jsx(oi,{pageSlug:"/",title:"WordSmith AGI | AI Marketing Strategy & Content Platform",description:"WordSmith AGI builds your marketing strategy, then ships SEO ready blogs, slide decks, and infographics. One AI workspace from strategy to shipped.",keywords:["AI marketing strategy","AI content writer","AI presentation maker","AI infographic maker","marketing plan generator","Growth Lab","SEO content generator"],canonicalUrl:"https://wordsmithagi.com/",schemaType:"Organization"}),a.jsx(jne,{children:a.jsx("script",{type:"application/ld+json",children:JSON.stringify(Y4e)})}),a.jsx(Ln,{}),a.jsxs("main",{children:[a.jsx(w4e,{}),a.jsx(C4e,{}),a.jsx(B4e,{}),a.jsx(k4e,{}),a.jsx(E4e,{}),a.jsx(q4e,{})]}),a.jsx(Mn,{}),a.jsx(RA,{})]}),RP=768;function HU(){const[e,t]=w.useState(void 0);return w.useEffect(()=>{const r=window.matchMedia(`(max-width: ${RP-1}px)`),n=()=>{t(window.innerWidthr.removeEventListener("change",n)},[]),!!e}var Z4e="Separator",l9="horizontal",eTe=["horizontal","vertical"],yoe=w.forwardRef((e,t)=>{const{decorative:r,orientation:n=l9,...i}=e,s=tTe(n)?n:l9,l=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return a.jsx(at.div,{"data-orientation":s,...l,...i,ref:t})});yoe.displayName=Z4e;function tTe(e){return eTe.includes(e)}var boe=yoe;const _y=w.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},i)=>a.jsx(boe,{ref:i,decorative:r,orientation:t,className:Le("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));_y.displayName=boe.displayName;function c_({className:e,...t}){return a.jsx("div",{className:Le("animate-pulse rounded-md bg-muted",e),...t})}const rTe="sidebar:state",nTe=60*60*24*7,iTe="16rem",sTe="18rem",aTe="3rem",oTe="b",woe=w.createContext(null);function FC(){const e=w.useContext(woe);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Coe=w.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:i,children:s,...o},l)=>{const c=HU(),[u,d]=w.useState(!1),[A,h]=w.useState(e),f=t??A,m=w.useCallback(x=>{const y=typeof x=="function"?x(f):x;r?r(y):h(y),document.cookie=`${rTe}=${y}; path=/; max-age=${nTe}`},[r,f]),p=w.useCallback(()=>c?d(x=>!x):m(x=>!x),[c,m,d]);w.useEffect(()=>{const x=y=>{y.key===oTe&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),p())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[p]);const g=f?"expanded":"collapsed",v=w.useMemo(()=>({state:g,open:f,setOpen:m,isMobile:c,openMobile:u,setOpenMobile:d,toggleSidebar:p}),[g,f,m,c,u,d,p]);return a.jsx(woe.Provider,{value:v,children:a.jsx(CC,{delayDuration:0,children:a.jsx("div",{style:{"--sidebar-width":iTe,"--sidebar-width-icon":aTe,...i},className:Le("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",n),ref:l,...o,children:s})})})});Coe.displayName="SidebarProvider";const Noe=w.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:i,...s},o)=>{const{isMobile:l,state:c,openMobile:u,setOpenMobile:d}=FC();return r==="none"?a.jsx("div",{className:Le("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:o,...s,children:i}):l?a.jsx(Xse,{open:u,onOpenChange:d,...s,children:a.jsx(SU,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":sTe},side:e,children:a.jsx("div",{className:"flex h-full w-full flex-col",children:i})})}):a.jsxs("div",{ref:o,className:"group peer hidden md:block text-sidebar-foreground","data-state":c,"data-collapsible":c==="collapsed"?r:"","data-variant":t,"data-side":e,children:[a.jsx("div",{className:Le("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),a.jsx("div",{className:Le("duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...s,children:a.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:i})})]})});Noe.displayName="Sidebar";const joe=w.forwardRef(({className:e,onClick:t,...r},n)=>{const{toggleSidebar:i}=FC();return a.jsxs(ve,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Le("h-7 w-7",e),onClick:s=>{t==null||t(s),i()},...r,children:[a.jsx(fwe,{}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});joe.displayName="SidebarTrigger";const lTe=w.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:n}=FC();return a.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:Le("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});lTe.displayName="SidebarRail";const cTe=w.forwardRef(({className:e,...t},r)=>a.jsx("main",{ref:r,className:Le("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));cTe.displayName="SidebarInset";const uTe=w.forwardRef(({className:e,...t},r)=>a.jsx(st,{ref:r,"data-sidebar":"input",className:Le("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));uTe.displayName="SidebarInput";const dTe=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"header",className:Le("flex flex-col gap-2 p-2",e),...t}));dTe.displayName="SidebarHeader";const ATe=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"footer",className:Le("flex flex-col gap-2 p-2",e),...t}));ATe.displayName="SidebarFooter";const fTe=w.forwardRef(({className:e,...t},r)=>a.jsx(_y,{ref:r,"data-sidebar":"separator",className:Le("mx-2 w-auto bg-sidebar-border",e),...t}));fTe.displayName="SidebarSeparator";const Soe=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"content",className:Le("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));Soe.displayName="SidebarContent";const Boe=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"group",className:Le("relative flex w-full min-w-0 flex-col p-2",e),...t}));Boe.displayName="SidebarGroup";const hTe=w.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const i=t?x0:"div";return a.jsx(i,{ref:n,"data-sidebar":"group-label",className:Le("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})});hTe.displayName="SidebarGroupLabel";const pTe=w.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const i=t?x0:"button";return a.jsx(i,{ref:n,"data-sidebar":"group-action",className:Le("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...r})});pTe.displayName="SidebarGroupAction";const _oe=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"group-content",className:Le("w-full text-sm",e),...t}));_oe.displayName="SidebarGroupContent";const koe=w.forwardRef(({className:e,...t},r)=>a.jsx("ul",{ref:r,"data-sidebar":"menu",className:Le("flex w-full min-w-0 flex-col gap-1",e),...t}));koe.displayName="SidebarMenu";const Eoe=w.forwardRef(({className:e,...t},r)=>a.jsx("li",{ref:r,"data-sidebar":"menu-item",className:Le("group/menu-item relative",e),...t}));Eoe.displayName="SidebarMenuItem";const mTe=Jh("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),Toe=w.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:i,className:s,...o},l)=>{const c=e?x0:"button",{isMobile:u,state:d}=FC(),A=a.jsx(c,{ref:l,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:Le(mTe({variant:r,size:n}),s),...o});return i?(typeof i=="string"&&(i={children:i}),a.jsxs($c,{children:[a.jsx(zc,{asChild:!0,children:A}),a.jsx(Xl,{side:"right",align:"center",hidden:d!=="collapsed"||u,...i})]})):A});Toe.displayName="SidebarMenuButton";const gTe=w.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...n},i)=>{const s=t?x0:"button";return a.jsx(s,{ref:i,"data-sidebar":"menu-action",className:Le("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...n})});gTe.displayName="SidebarMenuAction";const vTe=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:Le("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));vTe.displayName="SidebarMenuBadge";const xTe=w.forwardRef(({className:e,showIcon:t=!1,...r},n)=>{const i=w.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return a.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:Le("rounded-md h-8 flex gap-2 px-2 items-center",e),...r,children:[t&&a.jsx(c_,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),a.jsx(c_,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})});xTe.displayName="SidebarMenuSkeleton";const yTe=w.forwardRef(({className:e,...t},r)=>a.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:Le("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));yTe.displayName="SidebarMenuSub";const bTe=w.forwardRef(({...e},t)=>a.jsx("li",{ref:t,...e}));bTe.displayName="SidebarMenuSubItem";const wTe=w.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:n,...i},s)=>{const o=e?x0:"a";return a.jsx(o,{ref:s,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:Le("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...i})});wTe.displayName="SidebarMenuSubButton";const CTe=[{id:"growth-lab",title:"Growth Lab",icon:ni},{id:"ideas",title:"Idea Lab",icon:vA},{id:"calendar",title:"Calendar",icon:Da}],NTe=[{id:"studio",title:"Studio",icon:nre},{id:"create",title:"Create",icon:R1},{id:"remix",title:"Remix",icon:RB},{id:"brand-voice",title:"Brand Voice",icon:Tx}],jTe=[{id:"library",title:"Library",icon:pc},{id:"presets",title:"Presets",icon:ln},{id:"evaluator",title:"Evaluator",icon:DS},{id:"seo-analytics",title:"SEO Analytics",icon:Ra},{id:"integrations",title:"Integrations",icon:pwe}],STe=[{id:"presentations",title:"Create Deck",icon:ac},{id:"presentations-library",title:"Library",icon:pc}],BTe=[{id:"infographics",title:"Create Infographic",icon:D1},{id:"infographics-library",title:"Library",icon:pc}],_Te=[{id:"analytics",title:"Analytics",icon:Ra},{id:"content",title:"Website Content",icon:ai},{id:"seo",title:"SEO Settings",icon:oc},{id:"messages",title:"Messages",icon:jl},{id:"users",title:"Users",icon:nu}],kTe=[{id:"feedback",title:"User Feedback",icon:cre}];function ETe({children:e,collapsed:t,muted:r}){return t?null:a.jsx("p",{className:Le("text-[11px] uppercase tracking-[0.1em] font-semibold px-3 pt-4 pb-2",r?"text-foreground/45":"text-foreground/55"),children:e})}function TTe({item:e,isActive:t,collapsed:r,onClick:n,accentColor:i}){return a.jsx(Eoe,{children:a.jsxs($c,{children:[a.jsx(zc,{asChild:!0,children:a.jsxs(Toe,{size:"sm",onClick:n,className:Le("px-3 py-2 text-[13px] leading-tight rounded-lg mx-1 transition-colors",t?"bg-surface-2 text-foreground font-semibold":"text-foreground/70 hover:bg-surface-2/60 hover:text-foreground font-medium"),children:[a.jsx(e.icon,{className:Le("h-[16px] w-[16px] shrink-0",t&&i)}),!r&&a.jsx("span",{className:"ml-0.5",children:e.title})]})}),r&&a.jsx(Xl,{side:"right",sideOffset:8,children:a.jsx("p",{children:e.title})})]})})}function Tp({label:e,items:t,activeTab:r,collapsed:n,onTabChange:i,accentColor:s,muted:o}){return a.jsxs(Boe,{className:"py-0 px-0",children:[a.jsx(ETe,{collapsed:n,muted:o,children:e}),a.jsx(_oe,{children:a.jsx(koe,{className:"gap-0.5",children:t.map(l=>a.jsx(TTe,{item:l,isActive:r===l.id,collapsed:n,onClick:()=>i(l.id),accentColor:s},l.id))})})]})}const PTe={content:"text-pillar-content",presentations:"text-pillar-presentations",infographics:"text-pillar-infographics"};function ITe({activeTab:e,onTabChange:t,activePillar:r}){const{state:n}=FC(),{isAdmin:i,isSuperAdmin:s}=fi(),o=HU(),l=n==="collapsed",c=PTe[r],u=()=>l?"w-[56px]":"w-60";return a.jsx(Noe,{className:`${u()} top-14 h-[calc(100svh-3.5rem)] z-30 transition-all duration-300 border-r border-border-subtle bg-surface-1`,collapsible:"icon",children:a.jsx(Soe,{className:"px-1 pt-3 pb-6 gap-0 overflow-y-auto",children:a.jsxs(CC,{delayDuration:0,children:[r==="content"&&a.jsxs(a.Fragment,{children:[a.jsx(Tp,{label:"Plan",items:CTe,activeTab:e,collapsed:l,onTabChange:t,accentColor:c}),a.jsx(Tp,{label:"Create",items:NTe,activeTab:e,collapsed:l,onTabChange:t,accentColor:c}),a.jsx(Tp,{label:"Manage",items:jTe,activeTab:e,collapsed:l,onTabChange:t,accentColor:c})]}),r==="presentations"&&a.jsx(Tp,{label:"Presentations",items:STe,activeTab:e,collapsed:l,onTabChange:t,accentColor:c}),r==="infographics"&&a.jsx(Tp,{label:"Infographics",items:BTe,activeTab:e,collapsed:l,onTabChange:t,accentColor:c}),i&&a.jsxs(a.Fragment,{children:[a.jsx(Tp,{label:"Admin",items:_Te,activeTab:e,collapsed:l,onTabChange:t,muted:!0}),s&&a.jsx(Tp,{label:"Super",items:kTe,activeTab:e,collapsed:l,onTabChange:t,muted:!0})]})]})})})}const _e=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:Le("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));_e.displayName="Card";const ot=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:Le("flex flex-col space-y-1.5 p-6",e),...t}));ot.displayName="CardHeader";const lt=w.forwardRef(({className:e,...t},r)=>a.jsx("h3",{ref:r,className:Le("text-2xl font-semibold leading-none tracking-tight",e),...t}));lt.displayName="CardTitle";const Mr=w.forwardRef(({className:e,...t},r)=>a.jsx("p",{ref:r,className:Le("text-sm text-muted-foreground",e),...t}));Mr.displayName="CardDescription";const Ge=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:Le("p-6 pt-0",e),...t}));Ge.displayName="CardContent";const OTe=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:Le("flex items-center p-6 pt-0",e),...t}));OTe.displayName="CardFooter";const FTe=Jh("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function bt({className:e,variant:t,...r}){return a.jsx("div",{className:Le(FTe({variant:t}),e),...r})}var NE="Switch",[LTe,hNt]=Zi(NE),[MTe,DTe]=LTe(NE),Poe=w.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:s,required:o,disabled:l,value:c="on",onCheckedChange:u,form:d,...A}=e,[h,f]=w.useState(null),m=Jt(t,y=>f(y)),p=w.useRef(!1),g=h?d||!!h.closest("form"):!0,[v,x]=fa({prop:i,defaultProp:s??!1,onChange:u,caller:NE});return a.jsxs(MTe,{scope:r,checked:v,disabled:l,children:[a.jsx(at.button,{type:"button",role:"switch","aria-checked":v,"aria-required":o,"data-state":Loe(v),"data-disabled":l?"":void 0,disabled:l,value:c,...A,ref:m,onClick:Ye(e.onClick,y=>{x(b=>!b),g&&(p.current=y.isPropagationStopped(),p.current||y.stopPropagation())})}),g&&a.jsx(Foe,{control:h,bubbles:!p.current,name:n,value:c,checked:v,required:o,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});Poe.displayName=NE;var Ioe="SwitchThumb",Ooe=w.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,i=DTe(Ioe,r);return a.jsx(at.span,{"data-state":Loe(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:t})});Ooe.displayName=Ioe;var RTe="SwitchBubbleInput",Foe=w.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...i},s)=>{const o=w.useRef(null),l=Jt(o,s),c=I0(r),u=wC(t);return w.useEffect(()=>{const d=o.current;if(!d)return;const A=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(A,"checked").set;if(c!==r&&f){const m=new Event("click",{bubbles:n});f.call(d,r),d.dispatchEvent(m)}},[c,r,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:l,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Foe.displayName=RTe;function Loe(e){return e?"checked":"unchecked"}var Moe=Poe,UTe=Ooe;const jE=w.forwardRef(({className:e,...t},r)=>a.jsx(Moe,{className:Le("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:a.jsx(UTe,{className:Le("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));jE.displayName=Moe.displayName;const QTe=["Our AI considers your brand voice to match your unique style","Each piece is optimized for readability and engagement","We analyze top-performing content in your niche for inspiration","Your content is being structured for maximum impact","AI uses proven frameworks to boost conversion rates","Every paragraph is crafted to keep readers hooked","SEO best practices are baked into every piece we create","We tailor tone and language to resonate with your audience"],HTe=["Great infographics turn dense data into a story at a glance","We're picking a layout that fits your topic — timeline, comparison, stats, or process","Color palettes are chosen for contrast, hierarchy, and accessibility","Typography pairings are tuned for poster-grade readability","Icons and visual motifs are selected to reinforce your message","White space is intentional — it guides the eye through each section","Each stat block is sized by importance, not by accident","Designed to look stunning at full-size and still readable as a thumbnail"],$Te=["One idea per slide keeps audiences focused and engaged","Headlines do the heavy lifting — body text is a supporting actor","We balance text, visuals, and white space on every slide","Consistent themes and fonts make your deck feel professionally designed","Speaker-friendly pacing is built into the slide flow","Strong opening and closing slides leave the biggest impression","Visual hierarchy guides your audience's eye to what matters most"],zTe=e=>{const t=e.toLowerCase();return t.includes("infographic")?[{icon:oc,text:"Analyzing your topic and source content..."},{icon:C6,text:"Choosing the best layout for your data..."},{icon:Px,text:"Applying color theme and visual style..."},{icon:Fbe,text:"Composing stat blocks and visual sections..."},{icon:D1,text:"Rendering your poster-grade infographic..."}]:t.includes("presentation")||t.includes("slide")||t.includes("deck")?[{icon:oc,text:"Understanding your topic and notes..."},{icon:AP,text:"Structuring your slide outline..."},{icon:_we,text:"Writing punchy headlines and supporting copy..."},{icon:Px,text:"Applying theme, fonts, and visual style..."},{icon:ac,text:"Assembling your final deck..."}]:t.includes("blog")||t.includes("article")?[{icon:oc,text:"Researching your topic..."},{icon:AP,text:"Structuring sections and headings..."},{icon:Kc,text:"Writing compelling paragraphs..."},{icon:ln,text:"Optimizing for SEO and readability..."}]:t.includes("remix")?[{icon:ai,text:"Analyzing source material..."},{icon:vy,text:"Adapting for each platform..."},{icon:Px,text:"Matching tone and format..."},{icon:ln,text:"Polishing final outputs..."}]:t.includes("marketing")||t.includes("plan")?[{icon:ca,text:"Evaluating your business goals..."},{icon:Ra,text:"Analyzing market opportunities..."},{icon:AP,text:"Building your action plan..."},{icon:ln,text:"Generating actionable tasks..."}]:t.includes("idea")?[{icon:Hs,text:"Scanning trending topics..."},{icon:ca,text:"Matching ideas to your niche..."},{icon:Ra,text:"Scoring viral potential..."},{icon:Kc,text:"Curating your best ideas..."}]:t.includes("social")||t.includes("caption")?[{icon:ca,text:"Understanding your audience..."},{icon:Kc,text:"Crafting engaging captions..."},{icon:vy,text:"Optimizing for platform algorithms..."},{icon:ln,text:"Adding finishing touches..."}]:[{icon:ca,text:"Analyzing your requirements..."},{icon:Kc,text:"Crafting engaging content..."},{icon:ln,text:"Optimizing for SEO..."},{icon:ai,text:"Finalizing your masterpiece..."}]},WTe=e=>{const t=e.toLowerCase();return t.includes("infographic")?HTe:t.includes("presentation")||t.includes("slide")||t.includes("deck")?$Te:QTe},GTe=e=>{const t=e.toLowerCase();return t.includes("infographic")?"Designing Your Infographic":t.includes("presentation")||t.includes("slide")||t.includes("deck")?"Building Your Presentation":`Creating Your ${e}`},KTe=[{size:6,left:"10%",delay:0,duration:6},{size:4,left:"25%",delay:1.5,duration:8},{size:8,left:"50%",delay:.5,duration:7},{size:5,left:"70%",delay:2,duration:9},{size:3,left:"85%",delay:1,duration:6.5},{size:6,left:"40%",delay:3,duration:7.5}],id=({contentType:e})=>{const[t,r]=w.useState(0),[n,i]=w.useState(0),[s,o]=w.useState(0),l=zTe(e),c=WTe(e),u=GTe(e);w.useEffect(()=>{const A=setInterval(()=>{r(m=>m>=98?m+Math.random()*.1:m>=90?m+Math.random()*.3:m>=70?m+Math.random()*.5:m+Math.random()*.8)},400),h=setInterval(()=>{i(m=>(m+1)%l.length)},2500),f=setInterval(()=>{o(m=>(m+1)%c.length)},4e3);return()=>{clearInterval(A),clearInterval(h),clearInterval(f)}},[l.length]);const d=l[n].icon;return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-md",children:a.jsxs("div",{className:"relative max-w-2xl w-full mx-4 p-8 bg-card border-2 border-primary/30 rounded-3xl shadow-2xl shadow-primary/20 overflow-hidden",children:[KTe.map((A,h)=>a.jsx("div",{className:"absolute rounded-full bg-primary/20 animate-float pointer-events-none",style:{width:A.size,height:A.size,left:A.left,bottom:-A.size,animationDelay:`${A.delay}s`,animationDuration:`${A.duration}s`}},h)),a.jsx("div",{className:"flex justify-center mb-8 relative z-10",children:a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-0 animate-spin",children:a.jsx("div",{className:"h-24 w-24 border-4 border-t-primary border-r-primary/40 border-b-primary/20 border-l-primary/10 rounded-full"})}),a.jsxs("div",{className:"relative h-24 w-24 flex items-center justify-center",children:[a.jsx("div",{className:"absolute inset-2 bg-primary/20 rounded-full animate-pulse"}),a.jsx(d,{className:"h-12 w-12 text-primary relative z-10 animate-scale-in"})]})]})}),a.jsx("h2",{className:"text-2xl font-bold text-center text-foreground mb-3 relative z-10",children:u}),a.jsx("p",{className:"text-center text-muted-foreground mb-8 min-h-[2rem] animate-fade-in relative z-10",children:l[n].text}),a.jsxs("div",{className:"space-y-3 mb-8 relative z-10",children:[a.jsx("div",{className:"relative h-3 bg-muted rounded-full overflow-hidden",children:a.jsx("div",{className:"absolute inset-y-0 left-0 bg-primary rounded-full transition-all duration-300 ease-out",style:{width:`${t}%`},children:a.jsx("div",{className:"absolute inset-0 bg-white/20 animate-shimmer"})})}),a.jsxs("p",{className:"text-sm text-center text-muted-foreground",children:[Math.round(t),"% Complete"]})]}),a.jsx("div",{className:"p-4 bg-muted/50 rounded-xl border border-border/30 relative z-10 min-h-[4.5rem] flex items-center justify-center",children:a.jsxs("p",{className:"text-sm text-center text-muted-foreground animate-fade-in",children:[a.jsx("span",{className:"font-medium text-foreground",children:"💡 Did you know?"})," ",c[s]]},s)}),a.jsx("div",{className:"flex justify-center gap-2 mt-6 relative z-10",children:[0,1,2].map(A=>a.jsx("div",{className:"h-2 w-2 rounded-full bg-primary animate-pulse",style:{animationDelay:`${A*200}ms`}},A))})]})})};/*! @license DOMPurify 3.4.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.8/LICENSE */function c9(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r2?n-2:0),s=2;s1?r-1:0),i=1;i"u"?null:As(BigInt.prototype.toString),p9=typeof Symbol>"u"?null:As(Symbol.prototype.toString),ki=As(Object.prototype.hasOwnProperty),Lb=As(Object.prototype.toString),ea=As(RegExp.prototype.test),xv=oPe(TypeError);function As(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:hw;if(u9&&u9(e,null),!Va(t))return e;let n=t.length;for(;n--;){let i=t[n];if(typeof i=="string"){const s=r(i);s!==i&&(ZTe(t)||(t[n]=s),i=s)}e[i]=!0}return e}function lPe(e){for(let t=0;t/g),pPe=mc(/\${[\w\W]*/g),mPe=mc(/^data-[\-\w.\u00B7-\uFFFF]+$/),gPe=mc(/^aria-[\-\w]+$/),y9=mc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vPe=mc(/^(?:\w+script|data):/i),xPe=mc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),yPe=mc(/^html$/i),bPe=mc(/^[a-z][.\w]*(-[.\w]+)+$/i),Cu={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},wPe=function(){return typeof window>"u"?null:window},CPe=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const s="dompurify"+(n?"#"+n:"");try{return t.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},b9=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Uoe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wPe();const t=wt=>Uoe(wt);if(t.version="3.4.8",t.removed=[],!e||!e.document||e.document.nodeType!==Cu.document||!e.Element)return t.isSupported=!1,t;let r=e.document;const n=r,i=n.currentScript;e.DocumentFragment;const s=e.HTMLTemplateElement,o=e.Node,l=e.Element,c=e.NodeFilter,u=e.NamedNodeMap;u===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const d=e.DOMParser,A=e.trustedTypes,h=l.prototype,f=Su(h,"cloneNode"),m=Su(h,"remove"),p=Su(h,"nextSibling"),g=Su(h,"childNodes"),v=Su(h,"parentNode"),x=Su(h,"shadowRoot"),y=Su(h,"attributes"),b=o&&o.prototype?Su(o.prototype,"nodeType"):null,C=o&&o.prototype?Su(o.prototype,"nodeName"):null;if(typeof s=="function"){const wt=r.createElement("template");wt.content&&wt.content.ownerDocument&&(r=wt.content.ownerDocument)}let j,S="",T=0;const B=function(me){if(T>0)throw xv('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');T++;try{return j.createHTML(me)}finally{T--}},I=r,P=I.implementation,E=I.createNodeIterator,M=I.createDocumentFragment,_=I.getElementsByTagName,R=n.importNode;let G=b9();t.isSupported=typeof Doe=="function"&&typeof v=="function"&&P&&P.createHTMLDocument!==void 0;const U=fPe,Q=hPe,z=pPe,Y=mPe,$=gPe,O=vPe,W=xPe,V=bPe;let X=y9,ne=null;const oe=Er({},[...m9,...QP,...HP,...$P,...g9]);let pe=null;const de=Er({},[...v9,...zP,...x9,...dj]);let ge=Object.seal(Wv(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ie=null,ue=null;const Se=Object.seal(Wv(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let D=!0,K=!0,we=!1,ae=!0,te=!1,ce=!0,be=!1,je=!1,xe=!1,Ie=!1,Ke=!1,De=!1,Ve=!0,ht=!1;const ft="user-content-";let ut=!0,Qt=!1,dt={},Sr=null;const Tt=Er({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let qt=null;const nr=Er({},["audio","video","img","source","image","track"]);let hr=null;const Mt=Er({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Vr="http://www.w3.org/1998/Math/MathML",Ht="http://www.w3.org/2000/svg",$t="http://www.w3.org/1999/xhtml";let zr=$t,Zt=!1,yt=null;const tn=Er({},[Vr,Ht,$t],UP);let Kt=Er({},["mi","mo","mn","ms","mtext"]),ir=Er({},["annotation-xml"]);const Wr=Er({},["title","style","font","a","script"]);let Bn=null;const St=["application/xhtml+xml","text/html"],es="text/html";let Or=null,fn=null;const hi=r.createElement("form"),qn=function(me){return me instanceof RegExp||me instanceof Function},ji=function(){let me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(fn&&fn===me)return;(!me||typeof me!="object")&&(me={}),me=Ba(me),Bn=St.indexOf(me.PARSER_MEDIA_TYPE)===-1?es:me.PARSER_MEDIA_TYPE,Or=Bn==="application/xhtml+xml"?UP:hw,ne=ki(me,"ALLOWED_TAGS")&&Va(me.ALLOWED_TAGS)?Er({},me.ALLOWED_TAGS,Or):oe,pe=ki(me,"ALLOWED_ATTR")&&Va(me.ALLOWED_ATTR)?Er({},me.ALLOWED_ATTR,Or):de,yt=ki(me,"ALLOWED_NAMESPACES")&&Va(me.ALLOWED_NAMESPACES)?Er({},me.ALLOWED_NAMESPACES,UP):tn,hr=ki(me,"ADD_URI_SAFE_ATTR")&&Va(me.ADD_URI_SAFE_ATTR)?Er(Ba(Mt),me.ADD_URI_SAFE_ATTR,Or):Mt,qt=ki(me,"ADD_DATA_URI_TAGS")&&Va(me.ADD_DATA_URI_TAGS)?Er(Ba(nr),me.ADD_DATA_URI_TAGS,Or):nr,Sr=ki(me,"FORBID_CONTENTS")&&Va(me.FORBID_CONTENTS)?Er({},me.FORBID_CONTENTS,Or):Tt,ie=ki(me,"FORBID_TAGS")&&Va(me.FORBID_TAGS)?Er({},me.FORBID_TAGS,Or):Ba({}),ue=ki(me,"FORBID_ATTR")&&Va(me.FORBID_ATTR)?Er({},me.FORBID_ATTR,Or):Ba({}),dt=ki(me,"USE_PROFILES")?me.USE_PROFILES&&typeof me.USE_PROFILES=="object"?Ba(me.USE_PROFILES):me.USE_PROFILES:!1,D=me.ALLOW_ARIA_ATTR!==!1,K=me.ALLOW_DATA_ATTR!==!1,we=me.ALLOW_UNKNOWN_PROTOCOLS||!1,ae=me.ALLOW_SELF_CLOSE_IN_ATTR!==!1,te=me.SAFE_FOR_TEMPLATES||!1,ce=me.SAFE_FOR_XML!==!1,be=me.WHOLE_DOCUMENT||!1,Ie=me.RETURN_DOM||!1,Ke=me.RETURN_DOM_FRAGMENT||!1,De=me.RETURN_TRUSTED_TYPE||!1,xe=me.FORCE_BODY||!1,Ve=me.SANITIZE_DOM!==!1,ht=me.SANITIZE_NAMED_PROPS||!1,ut=me.KEEP_CONTENT!==!1,Qt=me.IN_PLACE||!1,X=uPe(me.ALLOWED_URI_REGEXP)?me.ALLOWED_URI_REGEXP:y9,zr=typeof me.NAMESPACE=="string"?me.NAMESPACE:$t,Kt=ki(me,"MATHML_TEXT_INTEGRATION_POINTS")&&me.MATHML_TEXT_INTEGRATION_POINTS&&typeof me.MATHML_TEXT_INTEGRATION_POINTS=="object"?Ba(me.MATHML_TEXT_INTEGRATION_POINTS):Er({},["mi","mo","mn","ms","mtext"]),ir=ki(me,"HTML_INTEGRATION_POINTS")&&me.HTML_INTEGRATION_POINTS&&typeof me.HTML_INTEGRATION_POINTS=="object"?Ba(me.HTML_INTEGRATION_POINTS):Er({},["annotation-xml"]);const $e=ki(me,"CUSTOM_ELEMENT_HANDLING")&&me.CUSTOM_ELEMENT_HANDLING&&typeof me.CUSTOM_ELEMENT_HANDLING=="object"?Ba(me.CUSTOM_ELEMENT_HANDLING):Wv(null);if(ge=Wv(null),ki($e,"tagNameCheck")&&qn($e.tagNameCheck)&&(ge.tagNameCheck=$e.tagNameCheck),ki($e,"attributeNameCheck")&&qn($e.attributeNameCheck)&&(ge.attributeNameCheck=$e.attributeNameCheck),ki($e,"allowCustomizedBuiltInElements")&&typeof $e.allowCustomizedBuiltInElements=="boolean"&&(ge.allowCustomizedBuiltInElements=$e.allowCustomizedBuiltInElements),te&&(K=!1),Ke&&(Ie=!0),dt&&(ne=Er({},g9),pe=Wv(null),dt.html===!0&&(Er(ne,m9),Er(pe,v9)),dt.svg===!0&&(Er(ne,QP),Er(pe,zP),Er(pe,dj)),dt.svgFilters===!0&&(Er(ne,HP),Er(pe,zP),Er(pe,dj)),dt.mathMl===!0&&(Er(ne,$P),Er(pe,x9),Er(pe,dj))),Se.tagCheck=null,Se.attributeCheck=null,ki(me,"ADD_TAGS")&&(typeof me.ADD_TAGS=="function"?Se.tagCheck=me.ADD_TAGS:Va(me.ADD_TAGS)&&(ne===oe&&(ne=Ba(ne)),Er(ne,me.ADD_TAGS,Or))),ki(me,"ADD_ATTR")&&(typeof me.ADD_ATTR=="function"?Se.attributeCheck=me.ADD_ATTR:Va(me.ADD_ATTR)&&(pe===de&&(pe=Ba(pe)),Er(pe,me.ADD_ATTR,Or))),ki(me,"ADD_URI_SAFE_ATTR")&&Va(me.ADD_URI_SAFE_ATTR)&&Er(hr,me.ADD_URI_SAFE_ATTR,Or),ki(me,"FORBID_CONTENTS")&&Va(me.FORBID_CONTENTS)&&(Sr===Tt&&(Sr=Ba(Sr)),Er(Sr,me.FORBID_CONTENTS,Or)),ki(me,"ADD_FORBID_CONTENTS")&&Va(me.ADD_FORBID_CONTENTS)&&(Sr===Tt&&(Sr=Ba(Sr)),Er(Sr,me.ADD_FORBID_CONTENTS,Or)),ut&&(ne["#text"]=!0),be&&Er(ne,["html","head","body"]),ne.table&&(Er(ne,["tbody"]),delete ie.tbody),me.TRUSTED_TYPES_POLICY){if(typeof me.TRUSTED_TYPES_POLICY.createHTML!="function")throw xv('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof me.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw xv('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const At=j;j=me.TRUSTED_TYPES_POLICY;try{S=B("")}catch(Gr){throw j=At,Gr}}else j===void 0&&me.TRUSTED_TYPES_POLICY!==null&&(j=CPe(A,i)),j&&typeof S=="string"&&(S=B(""));(G.uponSanitizeElement.length>0||G.uponSanitizeAttribute.length>0)&&ne===oe&&(ne=Ba(ne)),G.uponSanitizeAttribute.length>0&&pe===de&&(pe=Ba(pe)),uo&&uo(me),fn=me},ts=Er({},[...QP,...HP,...dPe]),pu=Er({},[...$P,...APe]),mu=function(me){let $e=v(me);(!$e||!$e.tagName)&&($e={namespaceURI:zr,tagName:"template"});const At=hw(me.tagName),Gr=hw($e.tagName);return yt[me.namespaceURI]?me.namespaceURI===Ht?$e.namespaceURI===$t?At==="svg":$e.namespaceURI===Vr?At==="svg"&&(Gr==="annotation-xml"||Kt[Gr]):!!ts[At]:me.namespaceURI===Vr?$e.namespaceURI===$t?At==="math":$e.namespaceURI===Ht?At==="math"&&ir[Gr]:!!pu[At]:me.namespaceURI===$t?$e.namespaceURI===Ht&&!ir[Gr]||$e.namespaceURI===Vr&&!Kt[Gr]?!1:!pu[At]&&(Wr[At]||!ts[At]):!!(Bn==="application/xhtml+xml"&&yt[me.namespaceURI]):!1},pi=function(me){gv(t.removed,{element:me});try{v(me).removeChild(me)}catch{m(me)}},Is=function(me,$e){try{gv(t.removed,{attribute:$e.getAttributeNode(me),from:$e})}catch{gv(t.removed,{attribute:null,from:$e})}if($e.removeAttribute(me),me==="is")if(Ie||Ke)try{pi($e)}catch{}else try{$e.setAttribute(me,"")}catch{}},vo=function(me){let $e=null,At=null;if(xe)me=""+me;else{const Fr=A9(me,/^[\r\n\t ]+/);At=Fr&&Fr[0]}Bn==="application/xhtml+xml"&&zr===$t&&(me=''+me+"");const Gr=j?B(me):me;if(zr===$t)try{$e=new d().parseFromString(Gr,Bn)}catch{}if(!$e||!$e.documentElement){$e=P.createDocument(zr,"template",null);try{$e.documentElement.innerHTML=Zt?S:Gr}catch{}}const vr=$e.body||$e.documentElement;return me&&At&&vr.insertBefore(r.createTextNode(At),vr.childNodes[0]||null),zr===$t?_.call($e,be?"html":"body")[0]:be?$e.documentElement:vr},xo=function(me){return E.call(me.ownerDocument||me,me,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ha=function(me){var $e,At;me.normalize();const Gr=E.call(me.ownerDocument||me,me,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let vr=Gr.nextNode();for(;vr;){let Dn=vr.data;Pp([U,Q,z],ma=>{Dn=vv(Dn,ma," ")}),vr.data=Dn,vr=Gr.nextNode()}const Fr=($e=(At=me.querySelectorAll)===null||At===void 0?void 0:At.call(me,"template"))!==null&&$e!==void 0?$e:[];Pp(Array.from(Fr),Dn=>{qs(Dn.content)&&ha(Dn.content)})},Tl=function(me){const $e=C?C(me):null;return typeof $e!="string"||Or($e)!=="form"?!1:typeof me.nodeName!="string"||typeof me.textContent!="string"||typeof me.removeChild!="function"||me.attributes!==y(me)||typeof me.removeAttribute!="function"||typeof me.setAttribute!="function"||typeof me.namespaceURI!="string"||typeof me.insertBefore!="function"||typeof me.hasChildNodes!="function"||me.nodeType!==b(me)||me.childNodes!==g(me)},qs=function(me){if(!b||typeof me!="object"||me===null)return!1;try{return b(me)===Cu.documentFragment}catch{return!1}},Pl=function(me){if(!b||typeof me!="object"||me===null)return!1;try{return typeof b(me)=="number"}catch{return!1}};function pa(wt,me,$e){Pp(wt,At=>{At.call(t,me,$e,fn)})}const jd=function(me){let $e=null;if(pa(G.beforeSanitizeElements,me,null),Tl(me))return pi(me),!0;const At=Or(C?C(me):me.nodeName);if(pa(G.uponSanitizeElement,me,{tagName:At,allowedTags:ne}),ce&&me.hasChildNodes()&&!Pl(me.firstElementChild)&&ea(/<[/\w!]/g,me.innerHTML)&&ea(/<[/\w!]/g,me.textContent)||ce&&me.namespaceURI===$t&&At==="style"&&Pl(me.firstElementChild)||me.nodeType===Cu.progressingInstruction||ce&&me.nodeType===Cu.comment&&ea(/<[/\w]/g,me.data))return pi(me),!0;if(ie[At]||!(Se.tagCheck instanceof Function&&Se.tagCheck(At))&&!ne[At]){if(!ie[At]&&GA(At)&&(ge.tagNameCheck instanceof RegExp&&ea(ge.tagNameCheck,At)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(At)))return!1;if(ut&&!Sr[At]){const vr=v(me),Fr=g(me);if(Fr&&vr){const Dn=Fr.length;for(let ma=Dn-1;ma>=0;--ma){const un=f(Fr[ma],!0);vr.insertBefore(un,p(me))}}}return pi(me),!0}return(b?b(me):me.nodeType)===Cu.element&&!mu(me)||(At==="noscript"||At==="noembed"||At==="noframes")&&ea(/<\/no(script|embed|frames)/i,me.innerHTML)?(pi(me),!0):(te&&me.nodeType===Cu.text&&($e=me.textContent,Pp([U,Q,z],vr=>{$e=vv($e,vr," ")}),me.textContent!==$e&&(gv(t.removed,{element:me.cloneNode()}),me.textContent=$e)),pa(G.afterSanitizeElements,me,null),!1)},Sd=function(me,$e,At){if(ue[$e]||Ve&&($e==="id"||$e==="name")&&(At in r||At in hi))return!1;const Gr=pe[$e]||Se.attributeCheck instanceof Function&&Se.attributeCheck($e,me);if(!(K&&!ue[$e]&&ea(Y,$e))){if(!(D&&ea($,$e))){if(!Gr||ue[$e]){if(!(GA(me)&&(ge.tagNameCheck instanceof RegExp&&ea(ge.tagNameCheck,me)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(me))&&(ge.attributeNameCheck instanceof RegExp&&ea(ge.attributeNameCheck,$e)||ge.attributeNameCheck instanceof Function&&ge.attributeNameCheck($e,me))||$e==="is"&&ge.allowCustomizedBuiltInElements&&(ge.tagNameCheck instanceof RegExp&&ea(ge.tagNameCheck,At)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(At))))return!1}else if(!hr[$e]){if(!ea(X,vv(At,W,""))){if(!(($e==="src"||$e==="xlink:href"||$e==="href")&&me!=="script"&&f9(At,"data:")===0&&qt[me])){if(!(we&&!ea(O,vv(At,W,"")))){if(At)return!1}}}}}}return!0},nb=Er({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),GA=function(me){return!nb[hw(me)]&&ea(V,me)},Ap=function(me){pa(G.beforeSanitizeAttributes,me,null);const $e=me.attributes;if(!$e||Tl(me))return;const At={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:pe,forceKeepAttr:void 0};let Gr=$e.length;for(;Gr--;){const vr=$e[Gr],Fr=vr.name,Dn=vr.namespaceURI,ma=vr.value,un=Or(Fr),KA=ma;let xn=Fr==="value"?KA:iPe(KA);if(At.attrName=un,At.attrValue=xn,At.keepAttr=!0,At.forceKeepAttr=void 0,pa(G.uponSanitizeAttribute,me,At),xn=At.attrValue,ht&&(un==="id"||un==="name")&&f9(xn,ft)!==0&&(Is(Fr,me),xn=ft+xn),ce&&ea(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,xn)){Is(Fr,me);continue}if(un==="attributename"&&A9(xn,"href")){Is(Fr,me);continue}if(At.forceKeepAttr)continue;if(!At.keepAttr){Is(Fr,me);continue}if(!ae&&ea(/\/>/i,xn)){Is(Fr,me);continue}te&&Pp([U,Q,z],VA=>{xn=vv(xn,VA," ")});const _d=Or(me.nodeName);if(!Sd(_d,un,xn)){Is(Fr,me);continue}if(j&&typeof A=="object"&&typeof A.getAttributeType=="function"&&!Dn)switch(A.getAttributeType(_d,un)){case"TrustedHTML":{xn=B(xn);break}case"TrustedScriptURL":{xn=j.createScriptURL(xn);break}}if(xn!==KA)try{Dn?me.setAttributeNS(Dn,Fr,xn):me.setAttribute(Fr,xn),Tl(me)?pi(me):d9(t.removed)}catch{Is(Fr,me)}}pa(G.afterSanitizeAttributes,me,null)},Bd=function(me){let $e=null;const At=xo(me);for(pa(G.beforeSanitizeShadowDOM,me,null);$e=At.nextNode();)if(pa(G.uponSanitizeShadowNode,$e,null),jd($e),Ap($e),qs($e.content)&&Bd($e.content),(b?b($e):$e.nodeType)===Cu.element){const vr=x?x($e):$e.shadowRoot;qs(vr)&&(ms(vr),Bd(vr))}pa(G.afterSanitizeShadowDOM,me,null)},ms=function(me){const $e=b?b(me):me.nodeType;if($e===Cu.element){const vr=x?x(me):me.shadowRoot;qs(vr)&&(ms(vr),Bd(vr))}const At=g?g(me):me.childNodes;if(!At)return;const Gr=[];Pp(At,vr=>{gv(Gr,vr)});for(const vr of Gr)ms(vr);if($e===Cu.element){const vr=C?C(me):null;if(typeof vr=="string"&&Or(vr)==="template"){const Fr=me.content;qs(Fr)&&ms(Fr)}}};return t.sanitize=function(wt){let me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$e=null,At=null,Gr=null,vr=null;if(Zt=!wt,Zt&&(wt=""),typeof wt!="string"&&!Pl(wt)&&(wt=cPe(wt),typeof wt!="string"))throw xv("dirty is not a string, aborting");if(!t.isSupported)return wt;if(je||ji(me),t.removed=[],typeof wt=="string"&&(Qt=!1),Qt){const ma=C?C(wt):wt.nodeName;if(typeof ma=="string"){const un=Or(ma);if(!ne[un]||ie[un])throw xv("root node is forbidden and cannot be sanitized in-place")}if(Tl(wt))throw xv("root node is clobbered and cannot be sanitized in-place");ms(wt)}else if(Pl(wt))$e=vo(""),At=$e.ownerDocument.importNode(wt,!0),At.nodeType===Cu.element&&At.nodeName==="BODY"||At.nodeName==="HTML"?$e=At:$e.appendChild(At),ms(At);else{if(!Ie&&!te&&!be&&wt.indexOf("<")===-1)return j&&De?B(wt):wt;if($e=vo(wt),!$e)return Ie?null:De?S:""}$e&&xe&&pi($e.firstChild);const Fr=xo(Qt?wt:$e);for(;Gr=Fr.nextNode();)jd(Gr),Ap(Gr),qs(Gr.content)&&Bd(Gr.content);if(Qt)return te&&ha(wt),wt;if(Ie){if(te&&ha($e),Ke)for(vr=M.call($e.ownerDocument);$e.firstChild;)vr.appendChild($e.firstChild);else vr=$e;return(pe.shadowroot||pe.shadowrootmode)&&(vr=R.call(n,vr,!0)),vr}let Dn=be?$e.outerHTML:$e.innerHTML;return be&&ne["!doctype"]&&$e.ownerDocument&&$e.ownerDocument.doctype&&$e.ownerDocument.doctype.name&&ea(yPe,$e.ownerDocument.doctype.name)&&(Dn=" `+Dn),te&&Pp([U,Q,z],ma=>{Dn=vv(Dn,ma," ")}),j&&De?B(Dn):Dn},t.setConfig=function(){let wt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ji(wt),je=!0},t.clearConfig=function(){fn=null,je=!1},t.isValidAttribute=function(wt,me,$e){fn||ji({});const At=Or(wt),Gr=Or(me);return Sd(At,Gr,$e)},t.addHook=function(wt,me){typeof me=="function"&&gv(G[wt],me)},t.removeHook=function(wt,me){if(me!==void 0){const $e=rPe(G[wt],me);return $e===-1?void 0:nPe(G[wt],$e,1)[0]}return d9(G[wt])},t.removeHooks=function(wt){G[wt]=[]},t.removeAllHooks=function(){G=b9()},t}var Qoe=Uoe();const NPe=Object.freeze(Object.defineProperty({__proto__:null,default:Qoe},Symbol.toStringTag,{value:"Module"}));function $U(e,t){if(!e)return"";const n={...{ALLOWED_TAGS:["p","br","strong","em","u","h1","h2","h3","h4","h5","h6","ul","ol","li","a","blockquote","code","pre","span","div","table","thead","tbody","tr","th","td"],ALLOWED_ATTR:["href","target","rel","class"],ALLOW_DATA_ATTR:!1,RETURN_TRUSTED_TYPE:!1},...t};return Qoe.sanitize(e,n)}function jPe(e){if(!e)return"";const t=e.replace(/\*\*(.*?)\*\*/g,"$1").replace(/__(.*?)__/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/_(.*?)_/g,"$1").replace(/\n/g,"
");return $U(t)}const Hh=({open:e,onOpenChange:t})=>{hs();const{toast:r}=Dr(),[n,i]=w.useState(null),s=[{name:"Lite",price:"$10",period:"per month",badge:null,features:["50 credits per month","Create Mode with all content types","Unlimited Idea Lab access","Full Studio Mode access","Complete Library with save and export","7 content formats","One-time Growth Lab and Presets trial"],cta:"Choose Lite",popular:!1,tier:"lite",planId:"1072874"},{name:"Pro",price:"$20",period:"per month",badge:"Most Popular",features:["150 credits per month","Create Mode with all content types","Unlimited Idea Lab access","Full Studio Mode access","Complete Growth Lab access","Presets and Templates","Advanced SEO optimization","Priority support","One-time Idea Bookmarking trial"],cta:"Choose Pro",popular:!0,tier:"pro",planId:"1072875"},{name:"Elite",price:"$30",period:"per month",badge:"Best Value",features:["300 credits per month","Create Mode with all content types","Unlimited Idea Lab with bookmarking","Full Studio Mode access","Complete Growth Lab access","Presets and Templates","WordPress integration","Team Management","Priority processing","Premium support"],cta:"Choose Elite",popular:!1,tier:"elite",planId:"1072883"}],o=async l=>{i(l.name);try{const{data:c,error:u}=await Re.functions.invoke("create-lemonsqueezy-subscription",{body:{variantId:l.planId,tier:l.tier}});if(u)throw u;if(c.checkoutUrl)window.location.href=c.checkoutUrl;else throw new Error("No checkout URL received")}catch(c){console.error("Subscription error:",c),r({title:"Subscription Failed",description:"Unable to create subscription. Please try again.",variant:"destructive"})}finally{i(null)}};return a.jsx(Mi,{open:e,onOpenChange:t,children:a.jsxs(yi,{className:"max-w-5xl max-h-[90vh] overflow-y-auto",children:[a.jsxs(bi,{children:[a.jsxs(wi,{className:"text-2xl font-semibold",children:["Simple, Transparent ",a.jsx("span",{className:"text-primary",children:"Pricing"})]}),a.jsx(Qo,{children:"Start free and upgrade when you're ready for advanced features. No hidden fees, cancel anytime."})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mt-4",children:s.map((l,c)=>a.jsxs(_e,{className:`relative brand-card hover-lift ${l.popular?"ring-2 ring-primary/50":""}`,children:[l.badge&&a.jsx(bt,{className:"absolute -top-3 left-1/2 -translate-x-1/2 bg-primary text-white border-0",children:l.badge}),a.jsxs(ot,{className:"text-center pb-6",children:[a.jsx(lt,{className:"text-xl font-semibold",children:l.name}),a.jsxs("div",{className:"mt-3",children:[a.jsx("span",{className:"text-3xl font-bold",children:l.price}),a.jsxs("span",{className:"text-foreground ml-2 text-sm",children:["/",l.period]})]})]}),a.jsxs(Ge,{className:"space-y-4",children:[a.jsx("ul",{className:"space-y-2",children:l.features.map((u,d)=>a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(dr,{className:"w-4 h-4 text-success flex-shrink-0"}),a.jsx("span",{className:"text-xs",children:u})]},d))}),a.jsx(ve,{variant:"hero",size:"default",className:"w-full text-sm font-bold",onClick:()=>o(l),disabled:n===l.name,children:n===l.name?a.jsxs(a.Fragment,{children:[a.jsx(Nl,{className:"mr-2 h-4 w-4 animate-spin"}),"Processing..."]}):l.cta})]})]},c))})]})})},SPe=Jh("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Z1=w.forwardRef(({className:e,variant:t,...r},n)=>a.jsx("div",{ref:n,role:"alert",className:Le(SPe({variant:t}),e),...r}));Z1.displayName="Alert";const BPe=w.forwardRef(({className:e,...t},r)=>a.jsx("h5",{ref:r,className:Le("mb-1 font-medium leading-none tracking-tight",e),...t}));BPe.displayName="AlertTitle";const e2=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:Le("text-sm [&_p]:leading-relaxed",e),...t}));e2.displayName="AlertDescription";const w9=e=>`free-user-alert-dismissed-${e}`,F0=()=>{const{usageData:e,getRemainingCredits:t,loading:r}=Ua(),[n,i]=w.useState(!1),[s,o]=w.useState({}),l=t(),c=(e==null?void 0:e.tier)==="free",u=l?Math.round(l.used/l.total*100):0,A=u>=100?100:u>=80?80:u>=50?50:0;w.useEffect(()=>{(()=>{const v={};[50,80,100].forEach(x=>{v[x]=sessionStorage.getItem(w9(x))==="true"}),o(v)})()},[]);const h=()=>{sessionStorage.setItem(w9(A),"true"),o(g=>({...g,[A]:!0}))};if(r||!c||A===0||s[A])return null;const m=(()=>{const g=(l==null?void 0:l.remaining)??0;return A===100?{variant:"destructive",icon:j6,iconColor:"text-destructive",bgClass:"border-destructive/50 bg-destructive/10",title:"You've reached your limit!",description:"Upgrade now to continue creating amazing content.",buttonText:"Upgrade Now",buttonVariant:"destructive"}:A===80?{variant:"default",icon:ln,iconColor:"text-warning",bgClass:"border-warning/50 bg-warning/10",title:`Only ${g} credits left!`,description:"Running low on credits. Upgrade to Pro for unlimited generations.",buttonText:"Upgrade to Unlimited",buttonVariant:"default"}:{variant:"default",icon:ni,iconColor:"text-primary",bgClass:"border-primary/30 bg-primary/5",title:"You're halfway through your credits",description:"Loving what you've created? Upgrade to never worry about limits.",buttonText:"See Upgrade Options",buttonVariant:"outline"}})(),p=m.icon;return a.jsxs(a.Fragment,{children:[a.jsx(Z1,{className:`mb-6 relative ${m.bgClass}`,children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(p,{className:`h-5 w-5 ${m.iconColor} mt-0.5 flex-shrink-0`}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"flex items-center gap-2 mb-1",children:a.jsx("span",{className:"font-semibold text-foreground",children:m.title})}),a.jsx(e2,{className:"text-sm text-muted-foreground",children:m.description}),a.jsxs(ve,{size:"sm",variant:m.buttonVariant,className:"mt-3 gap-2",onClick:()=>i(!0),children:[a.jsx(ru,{className:"h-4 w-4"}),m.buttonText]})]}),a.jsx(ve,{variant:"ghost",size:"icon",className:"h-8 w-8 flex-shrink-0 hover:bg-background/50",onClick:h,children:a.jsx(ml,{className:"h-4 w-4"})})]})}),a.jsx(Hh,{open:n,onOpenChange:i})]})},Hoe=({open:e,onOpenChange:t,contentType:r,onViewContent:n})=>{const{usageData:i,getRemainingCredits:s}=Ua(),[o,l]=w.useState(!1),c=s(),u=(i==null?void 0:i.tier)==="free",d=(c==null?void 0:c.remaining)??0,A=()=>{t(!1),n()},h=()=>{t(!1),l(!0)};return a.jsxs(a.Fragment,{children:[a.jsx(Mi,{open:e,onOpenChange:t,children:a.jsxs(yi,{className:"sm:max-w-md",children:[a.jsxs(bi,{className:"text-center",children:[a.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-primary/20",children:a.jsx(Do,{className:"h-8 w-8 text-primary animate-pulse"})}),a.jsx(wi,{className:"text-2xl font-bold text-center",children:"Content Created! ✨"}),a.jsxs(Qo,{className:"text-center",children:["Your ",r," has been generated successfully."]})]}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2 p-3 rounded-lg bg-muted/50",children:[a.jsx(ln,{className:"h-4 w-4 text-primary"}),a.jsxs("span",{className:"text-sm font-medium",children:[d," ",d===1?"credit":"credits"," remaining this month"]})]}),u&&d<=5&&a.jsx("div",{className:"p-4 rounded-lg border-2 border-primary/20 bg-primary/5",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(ru,{className:"h-5 w-5 text-primary mt-0.5"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium",children:d===0?"You've used all your free credits!":`Only ${d} credits left!`}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Upgrade to Pro for unlimited generations and unlock premium features."}),a.jsx(bt,{variant:"secondary",className:"text-xs",children:"Join 500+ creators who upgraded"})]})]})})]}),a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsxs(ve,{onClick:A,className:"w-full gap-2",children:[a.jsx(Zh,{className:"h-4 w-4"}),"View Your Content",a.jsx(Di,{className:"h-4 w-4"})]}),u&&a.jsxs(ve,{variant:"outline",onClick:h,className:"w-full gap-2 border-primary/50 hover:bg-primary/10",children:[a.jsx(ru,{className:"h-4 w-4"}),"Upgrade for Unlimited"]})]})]})}),a.jsx(Hh,{open:o,onOpenChange:l})]})},_Pe={content:"text-pillar-content",presentations:"text-pillar-presentations",infographics:"text-pillar-infographics"};function Dx({title:e,description:t,eyebrow:r,icon:n,pillar:i,actions:s,topRow:o,className:l}){const c=i?_Pe[i]:"text-primary";return a.jsxs("div",{className:Le("space-y-4 pb-6 border-b border-border-subtle",l),children:[o&&a.jsx("div",{children:o}),a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[n&&a.jsx("div",{className:"flex items-center justify-center h-10 w-10 rounded-xl bg-surface-2 shrink-0",children:a.jsx(n,{className:Le("h-5 w-5",c)})}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("h1",{className:"text-[24px] leading-tight font-semibold text-foreground tracking-tight",children:e}),t&&a.jsx("p",{className:"text-[14px] text-foreground/70 mt-1",children:t})]})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r&&a.jsx("span",{className:"hidden sm:inline-flex items-center px-2.5 py-1 rounded-md text-[11px] font-medium uppercase tracking-wide bg-surface-2 text-foreground/80",children:r}),s]})]})]})}const Aj=[{id:"blog",name:"Blog Post",icon:ai,description:"Long-form articles, how-tos, opinion pieces"},{id:"help",name:"Help Article",icon:L1,description:"Step-by-step support and FAQ content"},{id:"website",name:"Website Page",icon:Hs,description:"Hero, about, landing, services"},{id:"social",name:"Social Post",icon:yC,description:"Instagram, LinkedIn, Twitter, TikTok"},{id:"video",name:"Video Script",icon:UB,description:"Reels, Shorts, TikTok, YouTube"},{id:"email",name:"Email",icon:jl,description:"Newsletter, promo, welcome, cart"},{id:"ecommerce",name:"E-commerce",icon:DB,description:"Product, category, banner copy"}],kPe=({contentType:e,formData:t,handleInputChange:r,handleSelectChange:n})=>{switch(e){case"blog":return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"title",children:"Title / Headline"}),a.jsx(st,{id:"title",placeholder:"Enter your blog post title...",value:t.title,onChange:r})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"topic",children:"Main Topic"}),a.jsx(st,{id:"topic",placeholder:"e.g., Digital Marketing, AI, Productivity...",value:t.topic,onChange:r})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"description",children:"Brief Description"}),a.jsx(Zr,{id:"description",placeholder:"Briefly describe what you want to write about...",rows:3,value:t.description,onChange:r})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"keywords",children:"SEO Keywords"}),a.jsx(st,{id:"keywords",placeholder:"Enter keywords separated by commas...",value:t.keywords,onChange:r})]})]});case"help":return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"title",children:"Article Title"}),a.jsx(st,{id:"title",placeholder:"Enter help article title...",value:t.title,onChange:r})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"featureName",children:"Topic / Feature Name"}),a.jsx(st,{id:"featureName",placeholder:"e.g., User Management, Payment Setup...",value:t.featureName,onChange:r})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"problemStatement",children:"Problem Statement / Question"}),a.jsx(Zr,{id:"problemStatement",placeholder:"What problem does this help solve?",rows:3,value:t.problemStatement,onChange:r})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"keywords",children:"SEO Keywords"}),a.jsx(st,{id:"keywords",placeholder:"Enter keywords separated by commas...",value:t.keywords,onChange:r})]})]});case"website":return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"title",children:"Page Title / Headline"}),a.jsx(st,{id:"title",placeholder:"Enter page headline...",value:t.title,onChange:r})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"pageType",children:"Page Type"}),a.jsxs(It,{value:t.pageType,onValueChange:i=>n("pageType",i),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select page type"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"home",children:"Home"}),a.jsx(ye,{value:"about",children:"About"}),a.jsx(ye,{value:"services",children:"Services"}),a.jsx(ye,{value:"landing",children:"Landing Page"}),a.jsx(ye,{value:"product",children:"Product"}),a.jsx(ye,{value:"contact",children:"Contact"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"description",children:"Brand Message / USP"}),a.jsx(Zr,{id:"description",placeholder:"What makes your brand unique?",rows:3,value:t.description,onChange:r})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"keywords",children:"SEO Keywords"}),a.jsx(st,{id:"keywords",placeholder:"Enter keywords separated by commas...",value:t.keywords,onChange:r})]})]});case"social":return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"title",children:"Post Title"}),a.jsx(st,{id:"title",placeholder:"Enter your post title or main topic...",value:t.title,onChange:r})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"platform",children:"Platform"}),a.jsxs(It,{value:t.platform,onValueChange:i=>n("platform",i),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select platform"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"instagram",children:"Instagram"}),a.jsx(ye,{value:"linkedin",children:"LinkedIn"}),a.jsx(ye,{value:"twitter",children:"Twitter/X"}),a.jsx(ye,{value:"tiktok",children:"TikTok"}),a.jsx(ye,{value:"facebook",children:"Facebook"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"description",children:"Main Message"}),a.jsx(Zr,{id:"description",placeholder:"What's the key message you want to convey?",rows:3,value:t.description,onChange:r})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"hashtags",children:"Hashtags (Optional)"}),a.jsx(st,{id:"hashtags",placeholder:"#marketing #growth #tips",value:t.hashtags,onChange:r})]})]});case"video":return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"title",children:"Video Title / Hook Line"}),a.jsx(st,{id:"title",placeholder:"Enter compelling video title...",value:t.title,onChange:r})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"platform",children:"Platform"}),a.jsxs(It,{value:t.platform,onValueChange:i=>n("platform",i),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select platform"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"tiktok",children:"TikTok"}),a.jsx(ye,{value:"instagram",children:"Instagram Reels"}),a.jsx(ye,{value:"youtube",children:"YouTube Shorts"}),a.jsx(ye,{value:"linkedin",children:"LinkedIn"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"topic",children:"Theme"}),a.jsxs(It,{value:t.topic,onValueChange:i=>n("topic",i),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select theme"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"promo",children:"Promo"}),a.jsx(ye,{value:"tutorial",children:"Tutorial"}),a.jsx(ye,{value:"storytelling",children:"Storytelling"}),a.jsx(ye,{value:"explainer",children:"Explainer"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"keywords",children:"Additional Details"}),a.jsx(Zr,{id:"keywords",placeholder:"Add any specific requirements, context, or details to personalize your video script...",rows:3,value:t.keywords,onChange:r})]})]});case"email":return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"title",children:"Email Subject Line"}),a.jsx(st,{id:"title",placeholder:"Enter compelling subject line...",value:t.title,onChange:r})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"topic",children:"Campaign Type"}),a.jsxs(It,{value:t.topic,onValueChange:i=>n("topic",i),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select campaign type"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"newsletter",children:"Newsletter"}),a.jsx(ye,{value:"promotional",children:"Promotional"}),a.jsx(ye,{value:"welcome",children:"Welcome Email"}),a.jsx(ye,{value:"abandoned_cart",children:"Abandoned Cart"}),a.jsx(ye,{value:"announcement",children:"Announcement"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"description",children:"Email Purpose / Main Message"}),a.jsx(Zr,{id:"description",placeholder:"What's the main goal of this email?",rows:3,value:t.description,onChange:r})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"goal",children:"Call-to-Action"}),a.jsx(st,{id:"goal",placeholder:"e.g., Shop Now, Download, Sign Up...",value:t.goal,onChange:r})]})]});case"ecommerce":return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"title",children:"Product / Content Title"}),a.jsx(st,{id:"title",placeholder:"Enter product or content title...",value:t.title,onChange:r})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"topic",children:"Content Type"}),a.jsxs(It,{value:t.topic,onValueChange:i=>n("topic",i),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select content type"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"product_description",children:"Product Description"}),a.jsx(ye,{value:"category_page",children:"Category Page"}),a.jsx(ye,{value:"promotional_banner",children:"Promotional Banner"}),a.jsx(ye,{value:"product_review",children:"Product Review"}),a.jsx(ye,{value:"comparison",children:"Product Comparison"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"description",children:"Product Details / Key Features"}),a.jsx(Zr,{id:"description",placeholder:"Describe the product and its key features...",rows:3,value:t.description,onChange:r})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"keywords",children:"SEO Keywords"}),a.jsx(st,{id:"keywords",placeholder:"Enter product-related keywords...",value:t.keywords,onChange:r})]})]});default:return null}},EPe=({contentType:e,formData:t,handleSelectChange:r,handleInputChange:n,selectedTemplates:i,toggleTemplate:s,getTemplatesForType:o})=>{const l=()=>{switch(e){case"blog":return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"tone",children:"Writing Tone"}),a.jsxs(It,{value:t.tone,onValueChange:c=>r("tone",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select tone"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"professional",children:"Professional"}),a.jsx(ye,{value:"casual",children:"Casual"}),a.jsx(ye,{value:"friendly",children:"Friendly"}),a.jsx(ye,{value:"authoritative",children:"Authoritative"}),a.jsx(ye,{value:"conversational",children:"Conversational"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"wordCount",children:"Word Count"}),a.jsxs(It,{value:t.wordCount,onValueChange:c=>r("wordCount",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select length"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"short",children:"Short (500 words)"}),a.jsx(ye,{value:"medium",children:"Medium (1000 words)"}),a.jsx(ye,{value:"long",children:"Long (1500 words)"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"audience",children:"Target Audience"}),a.jsxs(It,{value:t.audience,onValueChange:c=>r("audience",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select audience"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"general",children:"General Public"}),a.jsx(ye,{value:"professionals",children:"Business Professionals"}),a.jsx(ye,{value:"developers",children:"Developers"}),a.jsx(ye,{value:"marketers",children:"Marketers"}),a.jsx(ye,{value:"entrepreneurs",children:"Entrepreneurs"})]})]})]})]});case"help":return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"tone",children:"Writing Tone"}),a.jsxs(It,{value:t.tone,onValueChange:c=>r("tone",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select tone"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"clear",children:"Clear & Simple"}),a.jsx(ye,{value:"friendly",children:"Friendly"}),a.jsx(ye,{value:"technical",children:"Technical"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"format",children:"Format"}),a.jsxs(It,{value:t.format,onValueChange:c=>r("format",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select format"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"step-by-step",children:"Step-by-Step"}),a.jsx(ye,{value:"faq",children:"FAQ"}),a.jsx(ye,{value:"troubleshooting",children:"Troubleshooting Guide"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"audience",children:"Audience Type"}),a.jsxs(It,{value:t.audience,onValueChange:c=>r("audience",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select audience"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"end-user",children:"End-User"}),a.jsx(ye,{value:"admin",children:"Admin"}),a.jsx(ye,{value:"developer",children:"Developer"}),a.jsx(ye,{value:"support",children:"Customer Support"})]})]})]})]});case"website":return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"tone",children:"Tone"}),a.jsxs(It,{value:t.tone,onValueChange:c=>r("tone",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select tone"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"professional",children:"Professional"}),a.jsx(ye,{value:"persuasive",children:"Persuasive"}),a.jsx(ye,{value:"conversational",children:"Conversational"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"goal",children:"Goal / CTA"}),a.jsx(st,{id:"goal",placeholder:"e.g., Sign up, Buy now, Contact us...",value:t.goal,onChange:n})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"audience",children:"Audience Type"}),a.jsxs(It,{value:t.audience,onValueChange:c=>r("audience",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select audience"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"leads",children:"Leads"}),a.jsx(ye,{value:"customers",children:"Customers"}),a.jsx(ye,{value:"partners",children:"Partners"}),a.jsx(ye,{value:"investors",children:"Investors"})]})]})]})]});case"social":return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"tone",children:"Tone"}),a.jsxs(It,{value:t.tone,onValueChange:c=>r("tone",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select tone"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"witty",children:"Witty"}),a.jsx(ye,{value:"professional",children:"Professional"}),a.jsx(ye,{value:"motivational",children:"Motivational"}),a.jsx(ye,{value:"casual",children:"Casual"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"format",children:"Format"}),a.jsxs(It,{value:t.format,onValueChange:c=>r("format",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select format"})}),a.jsx(kt,{children:t.platform==="linkedin"?a.jsxs(a.Fragment,{children:[a.jsx(ye,{value:"microblog",children:"Microblog"}),a.jsx(ye,{value:"carousel",children:"Carousel / PDF"}),a.jsx(ye,{value:"story-post",children:"Story Post"}),a.jsx(ye,{value:"thought-leadership",children:"Thought Leadership"})]}):a.jsxs(a.Fragment,{children:[a.jsx(ye,{value:"one-liner",children:"One-liner"}),a.jsx(ye,{value:"storytelling",children:"Storytelling"}),a.jsx(ye,{value:"caption-cta",children:"Caption + CTA"})]})})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"audience",children:"Audience Type"}),a.jsxs(It,{value:t.audience,onValueChange:c=>r("audience",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select audience"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"b2b",children:"B2B"}),a.jsx(ye,{value:"b2c",children:"B2C"}),a.jsx(ye,{value:"genz",children:"Gen Z"}),a.jsx(ye,{value:"professionals",children:"Professionals"})]})]})]})]});case"video":return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"scriptLength",children:"Script Length"}),a.jsxs(It,{value:t.scriptLength,onValueChange:c=>r("scriptLength",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select length"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"15s",children:"15 seconds"}),a.jsx(ye,{value:"30s",children:"30 seconds"}),a.jsx(ye,{value:"60s",children:"60 seconds"}),a.jsx(ye,{value:"2min",children:"2 minutes"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"tone",children:"Tone"}),a.jsxs(It,{value:t.tone,onValueChange:c=>r("tone",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select tone"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"energetic",children:"Energetic"}),a.jsx(ye,{value:"storytelling",children:"Storytelling"}),a.jsx(ye,{value:"professional",children:"Professional"}),a.jsx(ye,{value:"humorous",children:"Humorous"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"scriptStyle",children:"Script Style"}),a.jsxs(It,{value:t.scriptStyle,onValueChange:c=>r("scriptStyle",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select style"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"conversational",children:"Conversational"}),a.jsx(ye,{value:"informative",children:"Informative"}),a.jsx(ye,{value:"entertaining",children:"Entertaining"})]})]})]})]});case"email":return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"tone",children:"Tone"}),a.jsxs(It,{value:t.tone,onValueChange:c=>r("tone",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select tone"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"friendly",children:"Friendly"}),a.jsx(ye,{value:"professional",children:"Professional"}),a.jsx(ye,{value:"urgent",children:"Urgent"}),a.jsx(ye,{value:"casual",children:"Casual"}),a.jsx(ye,{value:"formal",children:"Formal"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"wordCount",children:"Email Length"}),a.jsxs(It,{value:t.wordCount,onValueChange:c=>r("wordCount",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select length"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"short",children:"Short (150 words)"}),a.jsx(ye,{value:"medium",children:"Medium (300 words)"}),a.jsx(ye,{value:"long",children:"Long (500 words)"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"audience",children:"Target Audience"}),a.jsxs(It,{value:t.audience,onValueChange:c=>r("audience",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select audience"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"existing_customers",children:"Existing Customers"}),a.jsx(ye,{value:"leads",children:"Leads/Prospects"}),a.jsx(ye,{value:"subscribers",children:"Newsletter Subscribers"}),a.jsx(ye,{value:"vip",children:"VIP/Premium"})]})]})]})]});case"ecommerce":return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"tone",children:"Tone"}),a.jsxs(It,{value:t.tone,onValueChange:c=>r("tone",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select tone"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"persuasive",children:"Persuasive"}),a.jsx(ye,{value:"informative",children:"Informative"}),a.jsx(ye,{value:"enthusiastic",children:"Enthusiastic"}),a.jsx(ye,{value:"professional",children:"Professional"}),a.jsx(ye,{value:"luxury",children:"Luxury"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"wordCount",children:"Content Length"}),a.jsxs(It,{value:t.wordCount,onValueChange:c=>r("wordCount",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select length"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"short",children:"Short (100 words)"}),a.jsx(ye,{value:"medium",children:"Medium (250 words)"}),a.jsx(ye,{value:"long",children:"Long (500 words)"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"audience",children:"Target Customer"}),a.jsxs(It,{value:t.audience,onValueChange:c=>r("audience",c),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select customer type"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"budget",children:"Budget-Conscious"}),a.jsx(ye,{value:"premium",children:"Premium/Luxury"}),a.jsx(ye,{value:"tech_savvy",children:"Tech-Savvy"}),a.jsx(ye,{value:"impulse",children:"Impulse Buyers"}),a.jsx(ye,{value:"researchers",children:"Researchers"})]})]})]})]});default:return null}};return a.jsxs("div",{className:"space-y-4",children:[l(),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Templates (Optional)"}),a.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Select one template to guide content structure"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:o().map(c=>a.jsx(bt,{variant:i.includes(c)?"default":"secondary",className:`cursor-pointer transition-all ${i.includes(c)?"bg-primary text-primary-foreground shadow-sm":"hover:bg-primary hover:text-primary-foreground"}`,onClick:()=>s(c),children:c},c))})]})]})};function TPe(){var z,Y;const[e,t]=w.useState("blog"),[r,n]=w.useState(2),[i,s]=w.useState({title:"",topic:"",keywords:"",tone:"",audience:"",wordCount:"",description:"",platform:"",pageType:"",format:"",scriptLength:"",scriptStyle:"",goal:"",hashtags:"",problemStatement:"",featureName:""}),[o,l]=w.useState([]),[c,u]=w.useState(!1),[d,A]=w.useState(null),[h,f]=w.useState(!1),[m,p]=w.useState(!1),[g,v]=w.useState(!1),[x,y]=w.useState(!1),[b,C]=w.useState(null),{toast:j}=Dr(),{usageData:S,refreshUsage:T}=Ua(),B=hs(),I=Ad();w.useEffect(()=>{const $=I.state,O=sessionStorage.getItem("pendingContentGeneration"),W=$!=null&&$.fromIdea?$:O?JSON.parse(O):null;if(W!=null&&W.fromIdea&&(W!=null&&W.ideaData)){const{title:V,topic:X,description:ne,platform:oe}=W.ideaData,pe=W.contentType;pe&&t(pe),s(de=>({...de,...V&&{title:V},...X&&{topic:X},...ne&&{description:ne},...oe&&{platform:oe}})),j({title:"Idea Loaded",description:"Your content idea has been pre-filled. Generating content..."}),W!=null&&W.autoGenerate&&p(!0),window.history.replaceState({},document.title),sessionStorage.removeItem("pendingContentGeneration")}},[I.state,j,B]),w.useEffect(()=>{const $=O=>{const{contentType:W,ideaData:V}=O.detail,{title:X,topic:ne,description:oe,platform:pe}=V;W&&t(W),s(de=>({...de,title:X||"",topic:ne||"",description:oe||"",...pe&&{platform:pe}})),p(!0)};return window.addEventListener("ideaContentGeneration",$),()=>window.removeEventListener("ideaContentGeneration",$)},[j]),w.useEffect(()=>{m&&i.title&&i.topic&&(p(!1),setTimeout(()=>{const $=document.querySelector("[data-generate-button]");$&&$.click()},800))},[m,i.title,i.topic]);const P=w.useCallback($=>{const O=$.target.id,W=$.target.value;s(V=>({...V,[O]:W}))},[]),E=w.useCallback(($,O)=>{s(W=>{const V={...W,[$]:O};return $==="platform"&&(O==="linkedin"?V.format="microblog":W.platform==="linkedin"&&(V.format="caption-cta")),V})},[]),M=$=>{l(O=>O.includes($)?[]:[$])},_=w.useCallback(()=>{switch(e){case"help":return i.title&&i.featureName;case"social":return i.title&&i.platform&&i.description;case"video":return i.title&&i.platform&&i.topic;case"website":return i.title&&i.pageType&&i.description;case"email":return i.title&&i.topic&&i.description;case"ecommerce":return i.title&&i.topic&&i.description;default:return i.title&&i.topic}},[e,i]),R=async()=>{var O;if(S&&!S.can_generate){v(!0),j({title:"Usage Limit Reached",description:S.tier==="free"?"You've used all 10 generations for this month. Upgrade to unlock unlimited content creation!":`You've reached your monthly limit of ${S.tier_limits.generation_limit} generations. Upgrade for more!`,variant:"destructive"});return}if(!_()){j({title:"Missing Information",description:(()=>{switch(e){case"help":return"Please provide a title and feature name.";case"social":return"Please provide a title, platform, and main message.";case"video":return"Please provide a title, platform, and topic.";case"website":return"Please provide a title, page type, and brand message.";case"email":return"Please provide a subject line, campaign type, and email purpose.";case"ecommerce":return"Please provide a title, content type, and product details.";default:return"Please provide a title and topic."}})(),variant:"destructive"});return}try{const{contentGenerationSchema:W}=await lc(async()=>{const{contentGenerationSchema:V}=await import("./validation-DOxMXGeX.js");return{contentGenerationSchema:V}},[]);W.parse(i)}catch(W){W.errors&&Array.isArray(W.errors)&&j({title:"Validation Error",description:((O=W.errors[0])==null?void 0:O.message)||"Please check your input",variant:"destructive"});return}u(!0);try{const{data:W,error:V}=await Re.functions.invoke("generate-blog-post",{body:{...i,contentType:e,templates:o,language:"en"}});if(V)throw V;if(W.error){if(W.error==="Usage limit exceeded"){v(!0),j({title:"Usage Limit Exceeded",description:"You've reached your generation limit. Upgrade your plan to unlock unlimited content creation!",variant:"destructive"});return}throw new Error(W.error)}A(W.blogPost),n(3),await T(),y(!0),C(W.blogPost.id)}catch(W){console.error("Error generating content:",W),j({title:"Generation Failed",description:"Unable to generate content at this time. Please try again or contact support if the issue persists.",variant:"destructive"})}finally{u(!1)}},G=w.useCallback(()=>{const $=Aj.find(O=>O.id===e);return($==null?void 0:$.name)||"Content"},[e]),U=w.useCallback(()=>{switch(e){case"blog":return"Generate Blog Post";case"help":return"Generate Help Article";case"website":return"Generate Website Page";case"social":return"Generate Social Media Post";case"video":return"Generate Video Script";case"email":return"Generate Email Content";case"ecommerce":return"Generate E-commerce Content";default:return"Generate Content"}},[e]),Q=w.useCallback(()=>{switch(e){case"blog":return["How-to Guide","List Article","Case Study","Product Review","Tutorial","News Article","Opinion Piece","Comparison","Interview","Industry Analysis","Tips & Tricks","Beginner's Guide"];case"help":return["Step-by-Step","FAQ","Troubleshooting Guide","Quick Start","Feature Overview","Best Practices"];case"website":return["Hero Section","About Page","Services Page","Landing Page","Product Page","Contact Page"];case"social":return["One-liner","Storytelling","Caption + CTA","Behind the Scenes","Tips & Tricks","Question Post"];case"video":return["Hook + Story","Tutorial Format","Problem + Solution","Before & After","Tips Format","Q&A Style"];case"email":return["Welcome Series","Promotional","Newsletter","Re-engagement","Cart Abandonment","Thank You"];case"ecommerce":return["Product Description","Category Copy","Banner Text","SEO Content","Comparison Table","Benefits List"];default:return[]}},[e]);return a.jsxs(a.Fragment,{children:[c&&a.jsx(id,{contentType:G()}),a.jsxs("div",{className:"container mx-auto p-0 max-w-6xl pb-12 space-y-6",children:[a.jsx(Dx,{title:"AI Content Writer",description:"Pick a content type, fill the brief, generate.",icon:Kc,pillar:"content",eyebrow:(z=Aj.find($=>$.id===e))==null?void 0:z.name}),a.jsx(F0,{}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[260px_1fr_300px] gap-6",children:[a.jsxs("aside",{className:"lg:sticky lg:top-4 self-start",children:[a.jsx("p",{className:"text-[11px] uppercase tracking-[0.1em] font-semibold text-foreground/55 px-1 pb-2",children:"Content Type"}),a.jsx("div",{className:"flex flex-col gap-1",children:Aj.map($=>{const O=$.icon,W=e===$.id;return a.jsxs("button",{onClick:()=>{t($.id),n(2)},className:Le("flex items-start gap-2.5 text-left px-3 py-2.5 rounded-lg border transition-colors",W?"bg-surface-2 border-border-strong":"border-transparent hover:bg-surface-2/60"),children:[a.jsx(O,{className:Le("h-4 w-4 mt-0.5 shrink-0",W?"text-pillar-content":"text-foreground/60")}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-[13px] font-semibold text-foreground leading-tight",children:$.name}),a.jsx("div",{className:"text-[11px] text-foreground/60 leading-snug mt-0.5",children:$.description})]})]},$.id)})})]}),a.jsxs("div",{className:"space-y-5 min-w-0",children:[a.jsxs(_e,{className:"border border-border-strong rounded-xl shadow-none",children:[a.jsxs(ot,{className:"pb-3",children:[a.jsx(lt,{className:"text-[18px] font-semibold",children:"Brief"}),a.jsxs(Mr,{className:"text-[13px]",children:["Essentials for your ",G().toLowerCase(),"."]})]}),a.jsx(Ge,{children:a.jsx(kPe,{contentType:e,formData:i,handleInputChange:P,handleSelectChange:E})})]}),a.jsxs(_e,{className:"border border-border-strong rounded-xl shadow-none",children:[a.jsxs(ot,{className:"pb-3",children:[a.jsx(lt,{className:"text-[18px] font-semibold",children:"Advanced"}),a.jsx(Mr,{className:"text-[13px]",children:"Fine-tune tone, length, audience, and template."})]}),a.jsx(Ge,{children:a.jsx(EPe,{contentType:e,formData:i,handleSelectChange:E,handleInputChange:P,selectedTemplates:o,toggleTemplate:M,getTemplatesForType:Q})})]})]}),a.jsx("aside",{className:"lg:sticky lg:top-4 self-start",children:a.jsx(_e,{className:"border border-border-strong rounded-xl shadow-none bg-surface-1",children:a.jsxs(Ge,{className:"p-5 space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-[11px] uppercase tracking-[0.1em] font-semibold text-foreground/55",children:"You'll generate"}),a.jsx("p",{className:"text-[18px] font-semibold text-foreground mt-1 leading-tight",children:G()}),a.jsx("p",{className:"text-[12px] text-foreground/60 mt-0.5",children:(Y=Aj.find($=>$.id===e))==null?void 0:Y.description})]}),a.jsxs("div",{className:"flex items-center justify-between text-[12px] py-2 border-t border-border-subtle",children:[a.jsx("span",{className:"text-foreground/65",children:"Cost"}),a.jsx("span",{className:"font-semibold text-foreground",children:"1 credit"})]}),a.jsxs("div",{className:"flex items-center justify-between text-[12px] -mt-2",children:[a.jsx("span",{className:"text-foreground/65",children:"Remaining"}),a.jsx("span",{className:"font-semibold text-foreground tabular-nums",children:S?Math.max(0,S.tier_limits.generation_limit-S.generations_used):"—"})]}),a.jsx(ve,{onClick:R,disabled:c||!_(),className:"w-full gap-2","data-generate-button":!0,children:c?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),"Generating..."]}):a.jsxs(a.Fragment,{children:[a.jsx(ln,{className:"h-4 w-4"}),U()]})})]})})})]}),d&&r===3&&a.jsxs(_e,{className:"border-2 border-foreground/10 shadow-md rounded-xl",children:[a.jsxs(ot,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(lt,{className:"flex items-center gap-2",children:[a.jsx(Kc,{className:"h-5 w-5 text-primary"}),"Generated ",G()]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Pe,{htmlFor:"format-toggle",className:"text-sm font-medium",children:"HTML Format"}),a.jsx(jE,{id:"format-toggle",checked:h,onCheckedChange:f})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>B(`/dashboard/view/${d.id}`),children:[a.jsx(Zh,{className:"h-4 w-4 mr-2"}),"View Full Content"]}),a.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>B(`/dashboard/edit/${d.id}`),children:[a.jsx(b0,{className:"h-4 w-4 mr-2"}),"Edit Content"]})]})]})]}),a.jsxs(Mr,{children:[d.title," • ",d.word_count," words • ",d.tone," tone"]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:h?"Viewing HTML code - suitable for HTML editors":"Viewing formatted content - suitable for WordPress and other platforms"})]}),a.jsxs(Ge,{children:[a.jsx("div",{className:"bg-muted/50 p-4 rounded-lg max-h-96 overflow-y-auto",children:h?a.jsx("div",{className:"bg-muted p-4 rounded-lg",children:a.jsx("pre",{className:"whitespace-pre-wrap font-mono text-sm overflow-x-auto",children:d.content})}):a.jsx("div",{className:"content-display",style:{fontSize:"16px",lineHeight:"1.75"},dangerouslySetInnerHTML:{__html:$U(d.content)}})}),a.jsx("p",{className:"text-xs text-foreground/60 mt-2",children:'Click "View Full Content" to see the complete result with meta description, synopsis, and abstract.'})]})]})]}),a.jsx(Hh,{open:g,onOpenChange:v}),a.jsx(Hoe,{open:x,onOpenChange:y,contentType:G(),onViewContent:()=>{b&&B(`/dashboard/view/${b}`)}})]})}var $oe="AlertDialog",[PPe,pNt]=Zi($oe,[Ose]),UA=Ose(),zoe=e=>{const{__scopeAlertDialog:t,...r}=e,n=UA(t);return a.jsx(CU,{...n,...r,modal:!0})};zoe.displayName=$oe;var IPe="AlertDialogTrigger",Woe=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=UA(r);return a.jsx(NU,{...i,...n,ref:t})});Woe.displayName=IPe;var OPe="AlertDialogPortal",Goe=e=>{const{__scopeAlertDialog:t,...r}=e,n=UA(t);return a.jsx(jU,{...n,...r})};Goe.displayName=OPe;var FPe="AlertDialogOverlay",Koe=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=UA(r);return a.jsx(TC,{...i,...n,ref:t})});Koe.displayName=FPe;var Rx="AlertDialogContent",[LPe,MPe]=PPe(Rx),DPe=wte("AlertDialogContent"),Voe=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...i}=e,s=UA(r),o=w.useRef(null),l=Jt(t,o),c=w.useRef(null);return a.jsx(W5e,{contentName:Rx,titleName:qoe,docsSlug:"alert-dialog",children:a.jsx(LPe,{scope:r,cancelRef:c,children:a.jsxs(PC,{role:"alertdialog",...s,...i,ref:l,onOpenAutoFocus:Ye(i.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[a.jsx(DPe,{children:n}),a.jsx(UPe,{contentRef:o})]})})})});Voe.displayName=Rx;var qoe="AlertDialogTitle",Xoe=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=UA(r);return a.jsx(IC,{...i,...n,ref:t})});Xoe.displayName=qoe;var Yoe="AlertDialogDescription",Joe=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=UA(r);return a.jsx(OC,{...i,...n,ref:t})});Joe.displayName=Yoe;var RPe="AlertDialogAction",Zoe=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=UA(r);return a.jsx(mE,{...i,...n,ref:t})});Zoe.displayName=RPe;var ele="AlertDialogCancel",tle=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:i}=MPe(ele,r),s=UA(r),o=Jt(t,i);return a.jsx(mE,{...s,...n,ref:o})});tle.displayName=ele;var UPe=({contentRef:e})=>{const t=`\`${Rx}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${Rx}\` by passing a \`${Yoe}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Rx}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return w.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},QPe=zoe,HPe=Woe,$Pe=Goe,rle=Koe,nle=Voe,ile=Zoe,sle=tle,ale=Xoe,ole=Joe;const QA=QPe,zPe=HPe,WPe=$Pe,lle=w.forwardRef(({className:e,...t},r)=>a.jsx(rle,{className:Le("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));lle.displayName=rle.displayName;const fd=w.forwardRef(({className:e,...t},r)=>a.jsxs(WPe,{children:[a.jsx(lle,{}),a.jsx(nle,{ref:r,className:Le("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));fd.displayName=nle.displayName;const hd=({className:e,...t})=>a.jsx("div",{className:Le("flex flex-col space-y-2 text-center sm:text-left",e),...t});hd.displayName="AlertDialogHeader";const pd=({className:e,...t})=>a.jsx("div",{className:Le("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});pd.displayName="AlertDialogFooter";const md=w.forwardRef(({className:e,...t},r)=>a.jsx(ale,{ref:r,className:Le("text-lg font-semibold",e),...t}));md.displayName=ale.displayName;const gd=w.forwardRef(({className:e,...t},r)=>a.jsx(ole,{ref:r,className:Le("text-sm text-muted-foreground",e),...t}));gd.displayName=ole.displayName;const vd=w.forwardRef(({className:e,...t},r)=>a.jsx(ile,{ref:r,className:Le(G1(),e),...t}));vd.displayName=ile.displayName;const xd=w.forwardRef(({className:e,...t},r)=>a.jsx(sle,{ref:r,className:Le(G1({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));xd.displayName=sle.displayName;function zw(e){if(!e)return"";const t=document.createElement("div");t.innerHTML=e,t.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach(n=>{n.insertAdjacentText("afterend",` `)}),t.querySelectorAll("p").forEach(n=>{n.insertAdjacentText("afterend",` `)}),t.querySelectorAll("br").forEach(n=>{n.insertAdjacentText("afterend",` `)}),t.querySelectorAll("div").forEach(n=>{n.insertAdjacentText("afterend",` `)}),t.querySelectorAll("li").forEach(n=>{n.insertAdjacentText("beforebegin","• "),n.insertAdjacentText("afterend",` `)}),t.querySelectorAll("ul, ol").forEach(n=>{n.insertAdjacentText("afterend",` `)}),t.querySelectorAll("blockquote").forEach(n=>{n.insertAdjacentText("beforebegin",` `),n.insertAdjacentText("afterend",` `)});let r=t.textContent||t.innerText||"";return r=r.replace(/\n{3,}/g,` `),r=r.replace(/ {2,}/g," "),r=r.trim(),r}const El=({message:e="Loading..."})=>a.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] p-8",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-0 animate-spin",children:a.jsx("div",{className:"h-16 w-16 border-4 border-t-primary border-r-primary/40 border-b-primary/20 border-l-primary/10 rounded-full"})}),a.jsxs("div",{className:"relative h-16 w-16 flex items-center justify-center",children:[a.jsx("div",{className:"absolute inset-2 bg-primary/20 rounded-full animate-pulse"}),a.jsx(Nl,{className:"h-8 w-8 text-primary relative z-10 animate-spin"})]})]}),a.jsx("p",{className:"text-muted-foreground mt-6 text-center animate-pulse",children:e}),a.jsx("div",{className:"flex justify-center gap-2 mt-4",children:[0,1,2].map(t=>a.jsx("div",{className:"h-2 w-2 rounded-full bg-primary animate-pulse",style:{animationDelay:`${t*200}ms`}},t))})]}),fj=[{id:"blog",name:"Blog Post",emoji:"📝"},{id:"help",name:"Help Article",emoji:"📖"},{id:"website",name:"Website Page",emoji:"🌐"},{id:"social",name:"Social Media Post",emoji:"📱"},{id:"video",name:"Video Script",emoji:"🎬"},{id:"email",name:"Email Marketing",emoji:"📧"},{id:"ecommerce",name:"E-commerce Content",emoji:"🛍️"}];function GPe(){const[e,t]=w.useState([]),[r,n]=w.useState(""),[i,s]=w.useState("newest"),[o,l]=w.useState("all"),[c,u]=w.useState(!0),[d,A]=w.useState(!1),[h,f]=w.useState(null),{toast:m}=Dr(),p=hs();w.useEffect(()=>{g()},[]);const g=async()=>{try{u(!0);const{data:S,error:T}=await Re.from("blog_posts").select("*").order("created_at",{ascending:!1});if(T)throw T;t(S||[])}catch(S){console.error("Error fetching posts:",S),m({title:"Error Loading Posts",description:"Failed to load your content.",variant:"destructive"})}finally{u(!1)}},v=S=>{f(S),A(!0)},x=async()=>{if(h)try{const{error:S}=await Re.from("blog_posts").delete().eq("id",h);if(S)throw S;t(T=>T.filter(B=>B.id!==h)),m({title:"Post Deleted",description:"The content has been deleted successfully."}),A(!1),f(null)}catch(S){console.error("Error deleting post:",S),m({title:"Delete Failed",description:"Failed to delete the content.",variant:"destructive"})}},y=async S=>{try{const T=zw(S);await navigator.clipboard.writeText(T),m({title:"Content Copied",description:"Content has been copied to clipboard."})}catch{m({title:"Copy Failed",description:"Failed to copy content to clipboard.",variant:"destructive"})}},b=S=>{const T=S==null?void 0:S.toLowerCase(),B=fj.find(I=>I.id===T||I.name.toLowerCase()===T);return(B==null?void 0:B.emoji)||"📝"},C=S=>{const T=S==null?void 0:S.toLowerCase(),B=fj.find(I=>I.id===T||I.name.toLowerCase()===T);return(B==null?void 0:B.name)||"Blog Post"};[...fj.map(S=>S.id)];const j=e.filter(S=>{var I;const T=S.title.toLowerCase().includes(r.toLowerCase())||((I=S.description)==null?void 0:I.toLowerCase().includes(r.toLowerCase()))||S.topic.toLowerCase().includes(r.toLowerCase()),B=o==="all"||(S.content_type||"blog")===o;return T&&B}).sort((S,T)=>{switch(i){case"newest":return new Date(T.created_at).getTime()-new Date(S.created_at).getTime();case"oldest":return new Date(S.created_at).getTime()-new Date(T.created_at).getTime();case"lastmodified":return new Date(T.updated_at).getTime()-new Date(S.updated_at).getTime();case"title":return S.title.localeCompare(T.title);case"wordcount":return(T.word_count||0)-(S.word_count||0);default:return 0}});return c?a.jsx("div",{className:"max-w-6xl mx-auto",children:a.jsx(El,{message:"Loading your content..."})}):a.jsxs("div",{className:"container mx-auto p-6 max-w-7xl pb-32",children:[a.jsx("div",{className:"mb-8",children:a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsx("div",{className:"p-3 bg-primary rounded-xl",children:a.jsx(ai,{className:"h-8 w-8 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-4xl font-bold text-primary",children:"Library"}),a.jsx("p",{className:"text-foreground/70",children:"Manage and organize all your generated content"})]})]})}),a.jsx(F0,{}),a.jsx(_e,{className:"border-2 shadow-lg",children:a.jsx(Ge,{className:"pt-4 md:pt-6",children:a.jsxs("div",{className:"flex flex-col lg:flex-row gap-2 md:gap-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(oc,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),a.jsx(st,{placeholder:"Search posts by title or description...",value:r,onChange:S=>n(S.target.value),className:"pl-10 text-sm"})]}),a.jsxs(It,{value:o,onValueChange:l,children:[a.jsx(_t,{className:"w-full lg:w-48",children:a.jsx(Ot,{placeholder:"Content Type"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"all",children:"All Types"}),fj.map(S=>a.jsxs(ye,{value:S.id,children:[S.emoji," ",S.name]},S.id))]})]}),a.jsxs(It,{value:i,onValueChange:s,children:[a.jsx(_t,{className:"w-full lg:w-48",children:a.jsx(Ot,{placeholder:"Sort by"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"newest",children:"Newest First"}),a.jsx(ye,{value:"oldest",children:"Oldest First"}),a.jsx(ye,{value:"lastmodified",children:"Last Modified"}),a.jsx(ye,{value:"title",children:"Title A-Z"}),a.jsx(ye,{value:"wordcount",children:"Word Count"})]})]})]})})}),a.jsx("div",{className:"bg-muted/30 rounded-xl p-3 md:p-6 border-2 border-border/50",children:j.length===0?a.jsx(_e,{className:"text-center py-16 bg-background",children:a.jsx(Ge,{children:a.jsxs("div",{className:"space-y-5",children:[a.jsx("div",{className:"w-20 h-20 mx-auto bg-primary/10 rounded-2xl flex items-center justify-center",children:a.jsx(ai,{className:"h-10 w-10 text-primary"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-bold text-xl text-foreground",children:r?"No matching content":"Your library is empty"}),a.jsx("p",{className:"text-foreground/70 mt-1 max-w-sm mx-auto",children:r?"Try adjusting your search or filter to find what you're looking for.":"Head to the Create or Studio tab to generate your first piece of content."})]}),!r&&a.jsxs(ve,{variant:"outline",className:"mt-2",onClick:()=>{},children:[a.jsx(R1,{className:"mr-2 h-4 w-4"}),"Start Creating"]})]})})}):a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-3 md:gap-6",children:j.map(S=>a.jsxs(_e,{className:"group hover:shadow-lg transition-all duration-300 bg-background border-2 border-border hover:border-primary/30",children:[a.jsxs(ot,{className:"pb-3 p-3 md:p-6 md:pb-3",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[a.jsxs(bt,{variant:"secondary",className:"text-xs font-medium",children:[b(S.content_type||"blog")," ",C(S.content_type||"blog")]}),a.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx(Da,{className:"h-3 w-3"}),a.jsx("span",{className:"hidden sm:inline",children:new Date(S.created_at).toLocaleDateString()}),a.jsx("span",{className:"sm:hidden",children:new Date(S.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]})]}),a.jsx(lt,{className:"text-base md:text-lg line-clamp-2 group-hover:text-primary transition-colors",children:S.title}),a.jsx(Mr,{className:"line-clamp-2 text-sm",children:S.description||"No description available"})]}),a.jsxs(Ge,{className:"space-y-3 md:space-y-4 p-3 md:p-6 pt-0",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs md:text-sm text-muted-foreground",children:[a.jsxs("span",{children:[S.word_count||0," words"]}),a.jsxs("span",{className:"capitalize",children:[S.tone||"N/A"," tone"]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx(K5,{className:"h-3 w-3"}),"Keywords:"]}),a.jsxs("div",{className:"flex flex-wrap gap-1",children:[(S.keywords||[]).slice(0,3).map((T,B)=>a.jsx(bt,{variant:"outline",className:"text-xs",children:T},B)),(S.keywords||[]).length>3&&a.jsxs(bt,{variant:"outline",className:"text-xs",children:["+",(S.keywords||[]).length-3," more"]})]})]}),a.jsx(CC,{children:a.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsxs($c,{children:[a.jsx(zc,{asChild:!0,children:a.jsxs(ve,{size:"sm",variant:"outline",className:"w-full hover:bg-primary hover:text-primary-foreground transition-colors text-xs h-8",onClick:()=>p(`/dashboard/view/${S.id}`),children:[a.jsx(Zh,{className:"h-3 w-3 mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"View"})]})}),a.jsx(Xl,{children:a.jsx("p",{children:"View content"})})]}),a.jsxs($c,{children:[a.jsx(zc,{asChild:!0,children:a.jsxs(ve,{size:"sm",variant:"outline",className:"w-full hover:bg-secondary hover:text-secondary-foreground transition-colors text-xs h-8",onClick:()=>p(`/dashboard/edit/${S.id}`),children:[a.jsx(b0,{className:"h-3 w-3 mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"Edit"})]})}),a.jsx(Xl,{children:a.jsx("p",{children:"Edit content"})})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsxs($c,{children:[a.jsx(zc,{asChild:!0,children:a.jsxs(ve,{size:"sm",variant:"outline",className:"w-full hover:bg-accent hover:text-accent-foreground transition-colors text-xs h-8",onClick:()=>y(S.content),children:[a.jsx(zl,{className:"h-3 w-3 mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"Copy"})]})}),a.jsx(Xl,{children:a.jsx("p",{children:"Copy to clipboard"})})]}),a.jsxs($c,{children:[a.jsx(zc,{asChild:!0,children:a.jsxs(ve,{size:"sm",variant:"outline",className:"w-full text-destructive hover:bg-destructive hover:text-destructive-foreground transition-colors text-xs h-8",onClick:()=>v(S.id),children:[a.jsx(Sl,{className:"h-3 w-3 mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"Delete"})]})}),a.jsx(Xl,{children:a.jsx("p",{children:"Delete content"})})]})]})]})})]})]},S.id))})}),a.jsx(QA,{open:d,onOpenChange:A,children:a.jsxs(fd,{children:[a.jsxs(hd,{children:[a.jsx(md,{children:"Are you sure?"}),a.jsx(gd,{children:"This action cannot be undone. This will permanently delete your content."})]}),a.jsxs(pd,{children:[a.jsx(xd,{onClick:()=>f(null),children:"Cancel"}),a.jsx(vd,{onClick:x,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}var SE="Tabs",[KPe,mNt]=Zi(SE,[P0]),cle=P0(),[VPe,zU]=KPe(SE),ule=w.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=rp(l),[A,h]=fa({prop:n,onChange:i,defaultProp:s??"",caller:SE});return a.jsx(VPe,{scope:r,baseId:lo(),value:A,onValueChange:h,orientation:o,dir:d,activationMode:c,children:a.jsx(at.div,{dir:d,"data-orientation":o,...u,ref:t})})});ule.displayName=SE;var dle="TabsList",Ale=w.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...i}=e,s=zU(dle,r),o=cle(r);return a.jsx(nU,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:n,children:a.jsx(at.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:t})})});Ale.displayName=dle;var fle="TabsTrigger",hle=w.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...s}=e,o=zU(fle,r),l=cle(r),c=gle(o.baseId,n),u=vle(o.baseId,n),d=n===o.value;return a.jsx(iU,{asChild:!0,...l,focusable:!i,active:d,children:a.jsx(at.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...s,ref:t,onMouseDown:Ye(e.onMouseDown,A=>{!i&&A.button===0&&A.ctrlKey===!1?o.onValueChange(n):A.preventDefault()}),onKeyDown:Ye(e.onKeyDown,A=>{[" ","Enter"].includes(A.key)&&o.onValueChange(n)}),onFocus:Ye(e.onFocus,()=>{const A=o.activationMode!=="manual";!d&&!i&&A&&o.onValueChange(n)})})})});hle.displayName=fle;var ple="TabsContent",mle=w.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:i,children:s,...o}=e,l=zU(ple,r),c=gle(l.baseId,n),u=vle(l.baseId,n),d=n===l.value,A=w.useRef(d);return w.useEffect(()=>{const h=requestAnimationFrame(()=>A.current=!1);return()=>cancelAnimationFrame(h)},[]),a.jsx(Gs,{present:i||d,children:({present:h})=>a.jsx(at.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:A.current?"0s":void 0},children:h&&s})})});mle.displayName=ple;function gle(e,t){return`${e}-trigger-${t}`}function vle(e,t){return`${e}-content-${t}`}var qPe=ule,xle=Ale,yle=hle,ble=mle;const LC=qPe,L0=w.forwardRef(({className:e,...t},r)=>a.jsx(xle,{ref:r,className:Le("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));L0.displayName=xle.displayName;const vl=w.forwardRef(({className:e,...t},r)=>a.jsx(yle,{ref:r,className:Le("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));vl.displayName=yle.displayName;const xl=w.forwardRef(({className:e,...t},r)=>a.jsx(ble,{ref:r,className:Le("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));xl.displayName=ble.displayName;const WP=[{id:"blog",name:"Blog Post",emoji:"📝"},{id:"help",name:"Help Article",emoji:"📖"},{id:"website",name:"Website Page",emoji:"🌐"},{id:"social",name:"Social Media Post",emoji:"📱"},{id:"video",name:"Video Script",emoji:"🎬"},{id:"email",name:"Email Marketing",emoji:"📧"},{id:"ecommerce",name:"E-commerce Content",emoji:"🛍️"}];function XPe({open:e,onOpenChange:t,onSuccess:r}){var b,C;const[n,i]=w.useState(""),[s,o]=w.useState("blog"),[l,c]=w.useState(!1),[u,d]=w.useState([]),{toast:A}=Dr(),{user:h}=fi(),[f,m]=w.useState({tone:"",audience:"",wordCount:"",platform:"",pageType:"",format:"",scriptLength:"",scriptStyle:"",goal:"",topic:""}),p=(j,S)=>{m(T=>({...T,[j]:S}))},g=j=>{d(S=>S.includes(j)?[]:[j])},v=()=>{switch(s){case"blog":return["How-to Guide","List Article","Case Study","Product Review","Tutorial","News Article"];case"help":return["Step-by-Step","FAQ","Troubleshooting Guide","Quick Start"];case"website":return["Hero Section","About Page","Services Page","Landing Page"];case"social":return["One-liner","Storytelling","Caption + CTA","Behind the Scenes"];case"video":return["Hook + Story","Tutorial Format","Problem + Solution"];case"email":return["Welcome Series","Promotional","Newsletter","Re-engagement"];case"ecommerce":return["Product Description","Category Copy","Banner Text"];default:return[]}},x=async()=>{if(!n.trim()){A({title:"Error",description:"Please enter a preset name",variant:"destructive"});return}if(!h){A({title:"Error",description:"You must be logged in to create presets",variant:"destructive"});return}c(!0);try{const j={...f,templates:u},{error:S}=await Re.from("presets").insert({user_id:h.id,name:n.trim(),content_type:s,settings:j});if(S)throw S;A({title:"Success",description:"Preset created successfully"}),i(""),m({tone:"",audience:"",wordCount:"",platform:"",pageType:"",format:"",scriptLength:"",scriptStyle:"",goal:"",topic:""}),d([]),r(),t(!1)}catch(j){console.error("Error creating preset:",j),A({title:"Error",description:"Failed to create preset",variant:"destructive"})}finally{c(!1)}},y=()=>{switch(s){case"blog":return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Writing Tone"}),a.jsxs(It,{value:f.tone,onValueChange:j=>p("tone",j),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select tone"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"professional",children:"Professional"}),a.jsx(ye,{value:"casual",children:"Casual"}),a.jsx(ye,{value:"friendly",children:"Friendly"}),a.jsx(ye,{value:"authoritative",children:"Authoritative"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Target Audience"}),a.jsxs(It,{value:f.audience,onValueChange:j=>p("audience",j),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select audience"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"general",children:"General Audience"}),a.jsx(ye,{value:"professionals",children:"Professionals"}),a.jsx(ye,{value:"beginners",children:"Beginners"}),a.jsx(ye,{value:"experts",children:"Experts"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Word Count"}),a.jsxs(It,{value:f.wordCount,onValueChange:j=>p("wordCount",j),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select word count"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"500",children:"500 words"}),a.jsx(ye,{value:"1000",children:"1000 words"}),a.jsx(ye,{value:"1500",children:"1500 words"}),a.jsx(ye,{value:"2000",children:"2000 words"})]})]})]})]});case"social":return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Platform"}),a.jsxs(It,{value:f.platform,onValueChange:j=>p("platform",j),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select platform"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"instagram",children:"Instagram"}),a.jsx(ye,{value:"linkedin",children:"LinkedIn"}),a.jsx(ye,{value:"twitter",children:"Twitter/X"}),a.jsx(ye,{value:"facebook",children:"Facebook"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Tone"}),a.jsxs(It,{value:f.tone,onValueChange:j=>p("tone",j),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select tone"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"engaging",children:"Engaging"}),a.jsx(ye,{value:"professional",children:"Professional"}),a.jsx(ye,{value:"casual",children:"Casual"})]})]})]})]});case"video":return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Platform"}),a.jsxs(It,{value:f.platform,onValueChange:j=>p("platform",j),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select platform"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"tiktok",children:"TikTok"}),a.jsx(ye,{value:"instagram",children:"Instagram Reels"}),a.jsx(ye,{value:"youtube",children:"YouTube Shorts"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Script Length"}),a.jsxs(It,{value:f.scriptLength,onValueChange:j=>p("scriptLength",j),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select length"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"15",children:"15 seconds"}),a.jsx(ye,{value:"30",children:"30 seconds"}),a.jsx(ye,{value:"60",children:"60 seconds"})]})]})]})]});default:return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Tone"}),a.jsxs(It,{value:f.tone,onValueChange:j=>p("tone",j),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select tone"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"professional",children:"Professional"}),a.jsx(ye,{value:"casual",children:"Casual"}),a.jsx(ye,{value:"friendly",children:"Friendly"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Target Audience"}),a.jsxs(It,{value:f.audience,onValueChange:j=>p("audience",j),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select audience"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"general",children:"General Audience"}),a.jsx(ye,{value:"professionals",children:"Professionals"}),a.jsx(ye,{value:"beginners",children:"Beginners"})]})]})]})]})}};return a.jsx(Mi,{open:e,onOpenChange:t,children:a.jsxs(yi,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsxs(bi,{children:[a.jsx(wi,{children:"Create New Preset"}),a.jsx(Qo,{children:"Save your content creation settings as a reusable preset"})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Preset Name"}),a.jsx(st,{placeholder:"e.g., My Marketing Blog Template",value:n,onChange:j=>i(j.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Content Type"}),a.jsxs(It,{value:s,onValueChange:j=>o(j),children:[a.jsx(_t,{className:"w-full h-16",children:a.jsx(Ot,{children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-xl",children:(b=WP.find(j=>j.id===s))==null?void 0:b.emoji}),a.jsx("span",{className:"font-medium",children:(C=WP.find(j=>j.id===s))==null?void 0:C.name})]})})}),a.jsx(kt,{children:WP.map(j=>a.jsx(ye,{value:j.id,className:"h-16",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-xl",children:j.emoji}),a.jsx("span",{className:"font-medium",children:j.name})]})},j.id))})]})]}),a.jsxs(LC,{defaultValue:"advanced",className:"w-full",children:[a.jsxs(L0,{className:"grid w-full grid-cols-2",children:[a.jsx(vl,{value:"advanced",children:"Advanced Settings"}),a.jsx(vl,{value:"templates",children:"Templates"})]}),a.jsx(xl,{value:"advanced",className:"space-y-4 mt-4",children:y()}),a.jsx(xl,{value:"templates",className:"space-y-4 mt-4",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Content Template (Optional)"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:v().map(j=>a.jsx(bt,{variant:u.includes(j)?"default":"outline",className:"cursor-pointer hover:bg-primary/20 transition-colors",onClick:()=>g(j),children:j},j))})]})})]}),a.jsxs("div",{className:"flex gap-3 justify-end pt-4",children:[a.jsx(ve,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),a.jsx(ve,{onClick:x,disabled:l||!n.trim(),className:"bg-primary hover:bg-primary/90 transition-all duration-300",children:l?"Creating...":"Create Preset"})]})]})]})})}function YPe({open:e,onOpenChange:t,preset:r}){const[n,i]=w.useState(""),[s,o]=w.useState(""),[l,c]=w.useState(""),[u,d]=w.useState(!1),{toast:A}=Dr(),{usageData:h,refreshUsage:f}=Ua(),m=hs(),p=async()=>{if(!n.trim()){A({title:"Missing Information",description:"Please enter a topic for your content",variant:"destructive"});return}if(h&&!h.can_generate){A({title:"Usage Limit Reached",description:(h.tier==="free","You have reached your monthly generation limit. Please upgrade your plan to continue."),variant:"destructive"});return}d(!0);try{const v={title:s||n,topic:n,description:l,keywords:"",...r.settings},{data:x,error:y}=await Re.functions.invoke("generate-blog-post",{body:{...v,contentType:r.content_type,language:"en"}});if(y)throw y;if(x.error){if(x.error==="Usage limit exceeded"){A({title:"Usage Limit Exceeded",description:x.details||"You have reached your usage limit. Please upgrade your plan to continue.",variant:"destructive"});return}throw new Error(x.error)}await f(),A({title:"Content Generated!",description:"Your AI-powered content has been created successfully using the preset."}),t(!1),m(`/dashboard/view/${x.blogPost.id}`)}catch(v){console.error("Error generating content:",v),A({title:"Generation Failed",description:"Failed to generate content. Please try again.",variant:"destructive"})}finally{d(!1)}},g=()=>({blog:"Blog Post",help:"Help Article",website:"Website Page",social:"Social Media Post",video:"Video Script",email:"Email Marketing",ecommerce:"E-commerce Content"})[r.content_type]||"Content";return a.jsxs(a.Fragment,{children:[u&&a.jsx(id,{contentType:g()}),a.jsx(Mi,{open:e,onOpenChange:t,children:a.jsxs(yi,{className:"max-w-xl",children:[a.jsxs(bi,{children:[a.jsxs(wi,{children:["Use Preset: ",r.name]}),a.jsxs(Qo,{children:["Enter your topic and generate ",g().toLowerCase()," with saved settings"]})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-muted/50 p-4 rounded-lg space-y-2",children:[a.jsx("h4",{className:"font-semibold text-sm",children:"Preset Configuration:"}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[r.settings.tone&&a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Tone:"})," ",a.jsx("span",{className:"font-medium capitalize",children:r.settings.tone})]}),r.settings.audience&&a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Audience:"})," ",a.jsx("span",{className:"font-medium capitalize",children:r.settings.audience})]}),r.settings.wordCount&&a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Word Count:"})," ",a.jsx("span",{className:"font-medium",children:r.settings.wordCount})]}),r.settings.platform&&a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Platform:"})," ",a.jsx("span",{className:"font-medium capitalize",children:r.settings.platform})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"topic",children:"Topic *"}),a.jsx(st,{id:"topic",placeholder:"Enter your main topic...",value:n,onChange:v=>i(v.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"title",children:"Title (Optional)"}),a.jsx(st,{id:"title",placeholder:"Leave blank to auto-generate from topic...",value:s,onChange:v=>o(v.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"description",children:"Additional Context (Optional)"}),a.jsx(Zr,{id:"description",placeholder:"Add any specific details or requirements...",rows:3,value:l,onChange:v=>c(v.target.value)})]})]}),a.jsxs("div",{className:"flex gap-3 justify-end pt-4",children:[a.jsx(ve,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),a.jsx(ve,{onClick:p,disabled:u||!n.trim(),className:"bg-primary hover:bg-primary/90 transition-all duration-300",children:u?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Generating..."]}):a.jsxs(a.Fragment,{children:[a.jsx(ln,{className:"h-4 w-4 mr-2"}),"Generate Content"]})})]})]})]})})]})}const ky={studio:{name:"Studio Mode",description:"Transform your research notes into polished content with AI-powered co-creation",trialEnabled:!0,requiredTier:["lite","pro","elite","admin"]},growth_lab:{name:"Growth Lab",description:"AI-powered marketing strategy and execution planning for your business",trialEnabled:!0,requiredTier:["pro","elite","admin"]},presets:{name:"Presets",description:"Create and manage reusable templates with predefined settings",trialEnabled:!0,requiredTier:["pro","elite","admin"]},bookmark_ideas:{name:"Bookmark Ideas",description:"Save your favorite content ideas for later access",trialEnabled:!0,requiredTier:["elite","admin"]},brand_voice:{name:"Brand Voice",description:"Define your brand voice and have all generated content match it automatically",trialEnabled:!0,requiredTier:["lite","pro","elite","admin"]},remix:{name:"Remix",description:"Transform one piece of content into multiple formats for different platforms",trialEnabled:!0,requiredTier:["lite","pro","elite","admin"]},multiple_brand_voices:{name:"Multiple Brand Voices",description:"Create and manage multiple brand voices for different brands or personas",trialEnabled:!1,requiredTier:["elite","admin"]},evaluator:{name:"Content Evaluator",description:"AI-powered SEO and content quality analysis with actionable improvement tips",trialEnabled:!0,requiredTier:["lite","pro","elite","admin"]},seo_analytics:{name:"SEO Analytics",description:"Track your content quality scores over time with historical trend analysis",trialEnabled:!0,requiredTier:["lite","pro","elite","admin"]}},JPe=e=>ky[e].requiredTier[0],WU=e=>{const t=JPe(e);return t.charAt(0).toUpperCase()+t.slice(1)},GU=()=>{const{user:e}=fi(),{usageData:t}=Ua(),[r,n]=w.useState([]),[i,s]=w.useState(!0),o=w.useCallback(async()=>{if(!e){s(!1);return}try{const{data:p,error:g}=await Re.from("feature_trials").select("*").eq("user_id",e.id);if(g)throw g;n(p||[])}catch(p){console.error("Error fetching feature trials:",p)}finally{s(!1)}},[e]);w.useEffect(()=>{o()},[o]);const l=w.useCallback(p=>{if(!t)return!1;const g=t.tier;return ky[p].requiredTier.includes(g)},[t]),c=w.useCallback(p=>!!r.find(v=>{if(v.feature_name!==p)return!1;const x=new Date(v.trial_used_at),y=new Date;return x.getMonth()===y.getMonth()&&x.getFullYear()===y.getFullYear()}),[r]),u=w.useCallback(p=>!ky[p].trialEnabled||l(p)?!1:!c(p),[l,c]),d=w.useCallback(p=>r.some(g=>g.feature_name===p),[r]),A=w.useCallback(p=>{const g=l(p),v=d(p),x=u(p),y=c(p);return{hasFullAccess:g,hasTrialAvailable:x,hasActiveTrialThisMonth:y,trialUsed:v,loading:i}},[l,d,u,c,i]),h=w.useCallback(p=>l(p)||u(p),[l,u]),f=w.useCallback(async p=>{if(!e)return!1;if(l(p))return!0;if(d(p))return!1;try{const{error:g}=await Re.from("feature_trials").insert({user_id:e.id,feature_name:p});if(g)throw g;return await o(),!0}catch(g){return console.error("Error using feature trial:",g),!1}},[e,l,d,o]),m=w.useCallback(async p=>{if(e)try{await Re.from("feature_trials").update({converted:!0}).eq("user_id",e.id).eq("feature_name",p),await o()}catch(g){console.error("Error marking trial converted:",g)}},[e,o]);return{loading:i,hasTierAccess:l,hasTrialAvailable:u,isTrialUsed:d,isTrialActiveThisMonth:c,getFeatureStatus:A,canAccessFeature:h,useFeatureTrial:f,markTrialConverted:m,refreshTrials:o}},Og=({feature:e,children:t,onTrialStart:r})=>{const{getFeatureStatus:n,useFeatureTrial:i,loading:s}=GU(),[o,l]=w.useState(!1),[c,u]=w.useState(!1),[d,A]=w.useState(!1),h=n(e),f=ky[e];return s?a.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:a.jsx(El,{message:"Loading feature..."})}):h.hasFullAccess||h.hasActiveTrialThisMonth?a.jsx(a.Fragment,{children:t}):h.hasTrialAvailable?a.jsxs(a.Fragment,{children:[a.jsx(ZPe,{feature:e,onStartTrial:()=>l(!0),onUpgrade:()=>u(!0)}),a.jsx(QA,{open:o,onOpenChange:l,children:a.jsxs(fd,{children:[a.jsxs(hd,{children:[a.jsxs(md,{className:"flex items-center gap-2",children:[a.jsx(Do,{className:"h-5 w-5 text-primary"}),"Try ",f.name," for Free!"]}),a.jsxs(gd,{className:"space-y-3",children:[a.jsxs("p",{children:["You're about to use your ",a.jsx("strong",{children:"monthly free trial"})," of ",f.name,"."]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["You can use this feature for the rest of this month. The trial resets next month, or upgrade to ",WU(e)," for unlimited access."]})]})]}),a.jsxs(pd,{children:[a.jsx(xd,{children:"Cancel"}),a.jsxs(vd,{onClick:async()=>{A(!0);const m=await i(e);A(!1),m&&(l(!1),r==null||r())},disabled:d,className:"gap-2",children:[a.jsx(ln,{className:"h-4 w-4"}),"Start Free Trial"]})]})]})}),a.jsx(Hh,{open:c,onOpenChange:u})]}):a.jsxs(a.Fragment,{children:[a.jsx(eIe,{feature:e,onUpgrade:()=>u(!0)}),a.jsx(Hh,{open:c,onOpenChange:u})]})},ZPe=({feature:e,onStartTrial:t,onUpgrade:r})=>{const n=ky[e];return a.jsx("div",{className:"container mx-auto p-6 max-w-4xl",children:a.jsxs(_e,{className:"border-2 border-primary/20 shadow-lg overflow-hidden",children:[a.jsx("div",{className:"absolute inset-0 bg-primary/5 pointer-events-none"}),a.jsxs(ot,{className:"text-center pb-4",children:[a.jsx("div",{className:"flex justify-center mb-4",children:a.jsx("div",{className:"p-4 bg-primary rounded-2xl",children:a.jsx(Do,{className:"h-10 w-10 text-white"})})}),a.jsxs(bt,{className:"mx-auto mb-4 bg-primary/10 text-primary border-primary/20",children:[a.jsx(ln,{className:"h-3 w-3 mr-1"}),"Monthly Trial Available"]}),a.jsx(lt,{className:"text-3xl",children:n.name}),a.jsx(Mr,{className:"text-lg max-w-xl mx-auto",children:n.description})]}),a.jsxs(Ge,{className:"text-center space-y-6 pb-8",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[a.jsxs(ve,{onClick:t,size:"lg",className:"gap-2 text-lg px-8",children:[a.jsx(Do,{className:"h-5 w-5"}),"Try Once for Free",a.jsx(Di,{className:"h-4 w-4"})]}),a.jsxs(ve,{onClick:r,variant:"outline",size:"lg",className:"gap-2",children:[a.jsx(ru,{className:"h-5 w-5"}),"Upgrade to ",WU(e)]})]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Experience the full power of ",n.name," with a monthly free trial"]})]})]})})},eIe=({feature:e,onUpgrade:t})=>{const r=ky[e];return a.jsx("div",{className:"container mx-auto p-6 max-w-4xl",children:a.jsxs(_e,{className:"border-2 border-border shadow-lg",children:[a.jsxs(ot,{className:"text-center pb-4",children:[a.jsx("div",{className:"flex justify-center mb-4",children:a.jsx("div",{className:"p-4 bg-muted rounded-2xl",children:a.jsx(ore,{className:"h-10 w-10 text-muted-foreground"})})}),a.jsx(bt,{variant:"secondary",className:"mx-auto mb-4",children:"Monthly Trial Used"}),a.jsx(lt,{className:"text-3xl",children:r.name}),a.jsxs(Mr,{className:"text-lg max-w-xl mx-auto",children:["You've used your monthly trial of ",r.name,". Come back next month or upgrade for unlimited access!"]})]}),a.jsxs(Ge,{className:"text-center space-y-6 pb-8",children:[a.jsxs("div",{className:"p-4 bg-muted/50 rounded-xl border border-border max-w-md mx-auto",children:[a.jsx("h4",{className:"font-semibold mb-2",children:"What you experienced:"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:r.description})]}),a.jsxs(ve,{onClick:t,size:"lg",className:"gap-2 text-lg px-8",children:[a.jsx(ru,{className:"h-5 w-5"}),"Upgrade to ",WU(e),a.jsx(Di,{className:"h-4 w-4"})]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Unlock ",r.name," and all premium features"]})]})]})})},tIe={blog:"Blog Post",help:"Help Article",website:"Website Page",social:"Social Media Post",video:"Video Script",email:"Email Marketing",ecommerce:"E-commerce Content"},rIe={blog:"📝",help:"📖",website:"🌐",social:"📱",video:"🎬",email:"📧",ecommerce:"🛍️"};function nIe(){const[e,t]=w.useState([]),[r,n]=w.useState(!0),[i,s]=w.useState(!1),[o,l]=w.useState(!1),[c,u]=w.useState(null),{toast:d}=Dr(),{user:A}=fi();w.useEffect(()=>{A&&h()},[A]);const h=async()=>{try{n(!0);const{data:p,error:g}=await Re.from("presets").select("*").order("created_at",{ascending:!1});if(g)throw g;t(p||[])}catch(p){console.error("Error fetching presets:",p),d({title:"Error",description:"Failed to load presets",variant:"destructive"})}finally{n(!1)}},f=async p=>{try{const{error:g}=await Re.from("presets").delete().eq("id",p);if(g)throw g;d({title:"Success",description:"Preset deleted successfully"}),h()}catch(g){console.error("Error deleting preset:",g),d({title:"Error",description:"Failed to delete preset",variant:"destructive"})}},m=p=>{u(p),l(!0)};return r?a.jsx("div",{className:"container mx-auto p-6 max-w-5xl",children:a.jsx(El,{message:"Loading presets..."})}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"container mx-auto p-6 max-w-5xl pb-32",children:[a.jsx("div",{className:"mb-8",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-3 bg-primary rounded-xl",children:a.jsx(MS,{className:"h-8 w-8 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-4xl font-bold text-primary",children:"Presets"}),a.jsx("p",{className:"text-muted-foreground",children:"Create and manage reusable templates with predefined settings"})]})]}),a.jsxs(ve,{onClick:()=>s(!0),className:"border-2 border-primary bg-primary hover:bg-primary/90",children:[a.jsx(Xi,{className:"h-4 w-4 mr-2"}),"Create Preset"]})]})}),a.jsx(F0,{}),a.jsx("div",{className:"space-y-6",children:e.length===0?a.jsx(_e,{className:"border-2 shadow-lg",children:a.jsxs(Ge,{className:"flex flex-col items-center justify-center py-16",children:[a.jsx("div",{className:"text-6xl mb-4",children:"🎯"}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:"No Presets Yet"}),a.jsx("p",{className:"text-muted-foreground text-center mb-6 max-w-md",children:"Create your first preset to save time on content creation. Presets store all your advanced settings, so you only need to enter a topic to generate content."}),a.jsxs(ve,{onClick:()=>s(!0),className:"border-2 border-primary bg-primary hover:bg-primary/90",children:[a.jsx(Xi,{className:"h-4 w-4 mr-2"}),"Create Your First Preset"]})]})}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:e.map(p=>a.jsxs(_e,{className:"border-2 shadow-lg hover:border-primary/50 transition-all",children:[a.jsx(ot,{children:a.jsx("div",{className:"flex items-start justify-between",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-2xl",children:rIe[p.content_type]}),a.jsxs("div",{children:[a.jsx(lt,{className:"text-lg",children:p.name}),a.jsx(Mr,{className:"text-sm",children:tIe[p.content_type]})]})]})})}),a.jsx(Ge,{children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"text-sm space-y-1",children:[p.settings.tone&&a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:"Tone:"}),a.jsx("span",{className:"font-medium capitalize",children:p.settings.tone})]}),p.settings.audience&&a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:"Audience:"}),a.jsx("span",{className:"font-medium capitalize",children:p.settings.audience})]}),p.settings.wordCount&&a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:"Words:"}),a.jsx("span",{className:"font-medium",children:p.settings.wordCount})]})]}),a.jsxs("div",{className:"flex gap-2 pt-2",children:[a.jsxs(ve,{onClick:()=>m(p),className:"flex-1 bg-primary hover:bg-primary/90 transition-all duration-300",size:"sm",children:[a.jsx(ure,{className:"h-4 w-4 mr-2"}),"Use Preset"]}),a.jsx(ve,{onClick:()=>f(p.id),variant:"outline",size:"sm",className:"border-destructive/50 text-destructive hover:bg-destructive/10",children:a.jsx(Sl,{className:"h-4 w-4"})})]})]})})]},p.id))})})]}),a.jsx(XPe,{open:i,onOpenChange:s,onSuccess:h}),c&&a.jsx(YPe,{open:o,onOpenChange:l,preset:c})]})}function iIe(){return a.jsx(Og,{feature:"presets",children:a.jsx(nIe,{})})}var KU="Radio",[sIe,wle]=Zi(KU),[aIe,oIe]=sIe(KU),Cle=w.forwardRef((e,t)=>{const{__scopeRadio:r,name:n,checked:i=!1,required:s,disabled:o,value:l="on",onCheck:c,form:u,...d}=e,[A,h]=w.useState(null),f=Jt(t,g=>h(g)),m=w.useRef(!1),p=A?u||!!A.closest("form"):!0;return a.jsxs(aIe,{scope:r,checked:i,disabled:o,children:[a.jsx(at.button,{type:"button",role:"radio","aria-checked":i,"data-state":Ble(i),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:f,onClick:Ye(e.onClick,g=>{i||c==null||c(),p&&(m.current=g.isPropagationStopped(),m.current||g.stopPropagation())})}),p&&a.jsx(Sle,{control:A,bubbles:!m.current,name:n,value:l,checked:i,required:s,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});Cle.displayName=KU;var Nle="RadioIndicator",jle=w.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...i}=e,s=oIe(Nle,r);return a.jsx(Gs,{present:n||s.checked,children:a.jsx(at.span,{"data-state":Ble(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:t})})});jle.displayName=Nle;var lIe="RadioBubbleInput",Sle=w.forwardRef(({__scopeRadio:e,control:t,checked:r,bubbles:n=!0,...i},s)=>{const o=w.useRef(null),l=Jt(o,s),c=I0(r),u=wC(t);return w.useEffect(()=>{const d=o.current;if(!d)return;const A=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(A,"checked").set;if(c!==r&&f){const m=new Event("click",{bubbles:n});f.call(d,r),d.dispatchEvent(m)}},[c,r,n]),a.jsx(at.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:l,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Sle.displayName=lIe;function Ble(e){return e?"checked":"unchecked"}var cIe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],BE="RadioGroup",[uIe,gNt]=Zi(BE,[P0,wle]),_le=P0(),kle=wle(),[dIe,AIe]=uIe(BE),Ele=w.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:i,value:s,required:o=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:A,...h}=e,f=_le(r),m=rp(u),[p,g]=fa({prop:s,defaultProp:i??null,onChange:A,caller:BE});return a.jsx(dIe,{scope:r,name:n,required:o,disabled:l,value:p,onValueChange:g,children:a.jsx(nU,{asChild:!0,...f,orientation:c,dir:m,loop:d,children:a.jsx(at.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:m,...h,ref:t})})})});Ele.displayName=BE;var Tle="RadioGroupItem",Ple=w.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:n,...i}=e,s=AIe(Tle,r),o=s.disabled||n,l=_le(r),c=kle(r),u=w.useRef(null),d=Jt(t,u),A=s.value===i.value,h=w.useRef(!1);return w.useEffect(()=>{const f=p=>{cIe.includes(p.key)&&(h.current=!0)},m=()=>h.current=!1;return document.addEventListener("keydown",f),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",f),document.removeEventListener("keyup",m)}},[]),a.jsx(iU,{asChild:!0,...l,focusable:!o,active:A,children:a.jsx(Cle,{disabled:o,required:s.required,checked:A,...c,...i,name:s.name,ref:d,onCheck:()=>s.onValueChange(i.value),onKeyDown:Ye(f=>{f.key==="Enter"&&f.preventDefault()}),onFocus:Ye(i.onFocus,()=>{var f;h.current&&((f=u.current)==null||f.click())})})})});Ple.displayName=Tle;var fIe="RadioGroupIndicator",Ile=w.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...n}=e,i=kle(r);return a.jsx(jle,{...i,...n,ref:t})});Ile.displayName=fIe;var Ole=Ele,Fle=Ple,hIe=Ile;const u_=w.forwardRef(({className:e,...t},r)=>a.jsx(Ole,{className:Le("grid gap-2",e),...t,ref:r}));u_.displayName=Ole.displayName;const Du=w.forwardRef(({className:e,...t},r)=>a.jsx(Fle,{ref:r,className:Le("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:a.jsx(hIe,{className:"flex items-center justify-center",children:a.jsx(Yte,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Du.displayName=Fle.displayName;const GP=[{id:"blog",name:"Blog Post",icon:ai,emoji:"📝",color:"text-blue-500"},{id:"instagram",name:"Instagram",icon:$5,emoji:"📸",color:"text-pink-500"},{id:"youtube",name:"YouTube",icon:V5,emoji:"🎥",color:"text-red-500"},{id:"linkedin",name:"LinkedIn",icon:xC,emoji:"💼",color:"text-blue-600"},{id:"twitter",name:"Twitter/X",icon:S6,emoji:"🐦",color:"text-sky-500"},{id:"tiktok",name:"TikTok",icon:uwe,emoji:"🎵",color:"text-gray-900"}],pIe=()=>{const[e,t]=w.useState(""),[r,n]=w.useState(""),[i,s]=w.useState(""),[o,l]=w.useState([]),[c,u]=w.useState([]),[d,A]=w.useState(!1),[h,f]=w.useState(!1),[m,p]=w.useState(!1),[g,v]=w.useState(0),[x,y]=w.useState(0),[b,C]=w.useState(!1),[j,S]=w.useState("generate"),[T,B]=w.useState(!1),[I,P]=w.useState(null),[E,M]=w.useState("microblog"),{toast:_}=Dr(),{usageData:R,getRemainingCredits:G,refreshUsage:U}=Ua(),{hasTierAccess:Q,hasTrialAvailable:z,useFeatureTrial:Y,isTrialUsed:$}=GU(),{isAdmin:O}=fi(),W=hs(),V=G(),X=(R==null?void 0:R.tier)==="free",ne=Q("bookmark_ideas")||O,oe=z("bookmark_ideas"),pe=$("bookmark_ideas"),de=be=>{S(be)},ge=[{icon:ca,text:"Analyzing viral trends...",duration:2e3},{icon:Kc,text:"Generating creative ideas...",duration:3e3},{icon:ni,text:"Scoring viral potential...",duration:2e3},{icon:ai,text:"Finalizing your ideas...",duration:2e3}];w.useEffect(()=>{if(d){v(0),y(0);const be=setInterval(()=>{v(xe=>xe>=98?xe+Math.random()*.1:xe>=90?xe+Math.random()*.3:xe>=70?xe+Math.random()*.5:xe+Math.random()*.8)},400),je=setInterval(()=>{y(xe=>(xe+1)%ge.length)},2500);return()=>{clearInterval(be),clearInterval(je)}}},[d]);const ie=be=>{switch(be){case"trending":return a.jsx($be,{className:"h-4 w-4"});case"evergreen":return a.jsx(rwe,{className:"h-4 w-4"});case"seasonal":return a.jsx(Da,{className:"h-4 w-4"});default:return a.jsx(ni,{className:"h-4 w-4"})}},ue=be=>{switch(be){case"trending":return"bg-orange-500 text-white";case"evergreen":return"bg-green-500 text-white";case"seasonal":return"bg-blue-500 text-white";default:return"bg-muted text-muted-foreground"}},Se=be=>be>=8?"bg-green-500 text-white":be>=5?"bg-yellow-500 text-white":"bg-muted text-muted-foreground",D=async(be=!1)=>{if(!e||!r.trim()){_({title:"Missing Information",description:"Please select a platform and enter your niche.",variant:"destructive"});return}A(!0);try{const{data:je,error:xe}=await Re.functions.invoke("generate-content-ideas",{body:{platform:e,niche:r.trim(),audience:i.trim(),refresh:be}});if(xe){console.error("Error generating ideas:",xe),xe.message.includes("Daily limit reached")?_({title:"Daily Limit Reached",description:"Free users can generate 5 idea sets per day. Upgrade for unlimited ideas!",variant:"destructive"}):xe.message.includes("Insufficient credits")?_({title:"Insufficient Credits",description:"You don't have enough credits. Please upgrade your plan.",variant:"destructive"}):_({title:"Error",description:xe.message||"Failed to generate ideas",variant:"destructive"});return}l(je.ideas),p(!0),await U(),_({title:"Success! 🎉",description:`Generated ${je.ideas.length} viral content ideas for ${e}`})}catch(je){console.error("Error:",je),_({title:"Error",description:"Something went wrong. Please try again.",variant:"destructive"})}finally{A(!1)}},K=be=>{be.platform==="linkedin"?(P(be),M("microblog"),B(!0)):ae(be)},we=()=>{I&&(B(!1),ae(I,E),P(null))},ae=async(be,je)=>{if(V&&typeof V.remaining=="number"&&V.remaining<=0){C(!0),_({title:"No Credits Remaining",description:"You've used all your generation credits for this month. Upgrade to continue creating amazing content!",variant:"destructive"});return}f(!0);const Ie={instagram:"social",tiktok:"social",twitter:"social",linkedin:"social",youtube:"video",blog:"blog"}[be.platform]||"blog";try{const{data:Ke,error:De}=await Re.functions.invoke("generate-blog-post",{body:{title:be.title,description:be.hook,topic:be.niche,keywords:"",tone:"professional",targetAudience:i||"",contentType:Ie,platform:be.platform,format:je||(be.platform==="linkedin"?"microblog":void 0),templates:[],language:"en"}});if(De)throw De;if(Ke.error){if(Ke.error==="Usage limit exceeded"){C(!0),_({title:"Usage Limit Exceeded",description:"You've reached your generation limit. Upgrade your plan to unlock unlimited content creation!",variant:"destructive"}),f(!1);return}throw new Error(Ke.error)}await U(),_({title:"Content Generated!",description:"Your AI-powered content is ready to view."}),W(`/dashboard/view/${Ke.blogPost.id}`)}catch(Ke){console.error("Error generating content:",Ke),_({title:"Generation Failed",description:"Unable to generate content at this time. Please try again or contact support if the issue persists.",variant:"destructive"})}finally{f(!1)}};w.useEffect(()=>{(async()=>{try{const{data:je,error:xe}=await Re.from("content_ideas").select("*").eq("bookmarked",!0).order("created_at",{ascending:!1});if(xe)throw xe;u(je||[])}catch(je){console.error("Error loading bookmarked ideas:",je)}})()},[]);const te=async(be,je)=>{if(!ne)if(oe){if(!await Y("bookmark_ideas")){_({title:"Error",description:"Failed to start trial. Please try again.",variant:"destructive"});return}_({title:"🎉 Bookmark Trial Activated!",description:"You've unlocked your one-time bookmark trial. Enjoy saving ideas!"})}else if(pe){C(!0),_({title:"Trial Already Used",description:"You've used your free bookmark trial. Upgrade to Elite to save unlimited ideas!",variant:"destructive"});return}else{C(!0),_({title:"Upgrade Required",description:"Upgrade to Elite to save ideas for later access.",variant:"destructive"});return}try{const{error:xe}=await Re.from("content_ideas").update({bookmarked:!je}).eq("id",be);if(xe)throw xe;l(Ke=>Ke.map(De=>De.id===be?{...De,bookmarked:!je}:De));const{data:Ie}=await Re.from("content_ideas").select("*").eq("bookmarked",!0).order("created_at",{ascending:!1});u(Ie||[]),_({title:je?"Bookmark Removed":"Idea Bookmarked!",description:je?"Idea removed from bookmarks.":"Idea saved to your bookmarks."})}catch(xe){console.error("Error toggling bookmark:",xe),_({title:"Error",description:"Failed to update bookmark. Please try again.",variant:"destructive"})}},ce=GP.find(be=>be.id===e);return ge[x].icon,a.jsxs(a.Fragment,{children:[h&&a.jsx(id,{contentType:"Content"}),a.jsxs("div",{className:"container mx-auto p-6 max-w-7xl pb-32",children:[d&&a.jsx(id,{contentType:"Content Ideas"}),a.jsx("div",{className:"mb-8",children:a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsx("div",{className:"p-3 bg-primary rounded-xl",children:a.jsx(vA,{className:"h-8 w-8 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-4xl font-bold text-primary",children:"Idea Lab"}),a.jsx("p",{className:"text-muted-foreground",children:"Discover viral content ideas tailored to your niche. Let AI analyze trends and generate ideas that resonate with your audience."})]})]})}),a.jsx(F0,{}),a.jsxs(LC,{value:j,onValueChange:de,className:"mb-8",children:[a.jsxs(L0,{className:"grid w-full max-w-md mx-auto grid-cols-2",children:[a.jsxs(vl,{value:"generate",className:"gap-2",children:[a.jsx(vA,{className:"h-4 w-4"}),"Generate Ideas"]}),a.jsxs(vl,{value:"saved",className:"gap-2",children:[a.jsx(MS,{className:"h-4 w-4"}),"Saved Ideas ",c.length>0&&`(${c.length})`]})]}),a.jsxs(xl,{value:"generate",className:"mt-8",children:[a.jsxs(_e,{className:"mb-8 border-2 shadow-lg",children:[a.jsxs(ot,{children:[a.jsxs(lt,{className:"flex items-center gap-2",children:[a.jsx(ni,{className:"h-5 w-5 text-primary"}),"Generate Viral Content Ideas"]}),a.jsx(Mr,{children:"Select your platform and niche to get 10 personalized content ideas"})]}),a.jsxs(Ge,{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"platform",className:"text-base font-medium",children:"Platform *"}),a.jsxs(It,{value:e,onValueChange:t,children:[a.jsx(_t,{id:"platform",className:"h-12",children:a.jsx(Ot,{placeholder:"Select a platform"})}),a.jsx(kt,{children:GP.map(be=>{const je=be.icon;return a.jsx(ye,{value:be.id,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(je,{className:`h-5 w-5 ${be.color}`}),a.jsx("span",{children:be.name})]})},be.id)})})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"niche",className:"text-base font-medium",children:"Your Niche / Industry *"}),a.jsx(st,{id:"niche",placeholder:"e.g., SaaS Marketing, Fitness, Personal Finance, Travel...",value:r,onChange:be=>n(be.target.value),className:"h-12"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Pe,{htmlFor:"audience",className:"text-base font-medium",children:["Target Audience ",a.jsx("span",{className:"text-muted-foreground text-sm",children:"(Optional)"})]}),a.jsx(st,{id:"audience",placeholder:"e.g., Young professionals, Small business owners, Tech enthusiasts...",value:i,onChange:be=>s(be.target.value),className:"h-12"})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx(ve,{onClick:()=>D(!1),disabled:d||!e||!r.trim(),className:"h-11 text-sm font-semibold w-auto",children:d?a.jsxs(a.Fragment,{children:[a.jsx(Zm,{className:"mr-2 h-4 w-4 animate-spin"}),"Generating Ideas..."]}):a.jsxs(a.Fragment,{children:[a.jsx(ni,{className:"mr-2 h-4 w-4"}),"Get 10 Viral Ideas ",!X&&"(0.5 credits)"]})}),m&&a.jsxs(ve,{onClick:()=>D(!0),disabled:d,variant:"outline",className:"h-12 px-6",children:[a.jsx(Zm,{className:"h-4 w-4 mr-2"}),"Refresh Ideas ",!X&&"(0.5 credits)"]})]})]})]}),m&&o.length>0&&a.jsxs("div",{className:"space-y-4 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("h2",{className:"text-2xl font-bold flex items-center gap-2",children:[a.jsx(ni,{className:"h-6 w-6 text-primary"}),"Your Viral Content Ideas"]}),ce&&a.jsxs(bt,{variant:"outline",className:"text-base px-4 py-2",children:[a.jsx("span",{className:"mr-2",children:ce.emoji}),ce.name]})]}),a.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:o.map(be=>{var je;return a.jsxs(_e,{className:"border-2 shadow-lg hover:border-primary/50 transition-all duration-300",children:[a.jsxs(ot,{className:"pb-3",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[a.jsxs(bt,{className:`${Se(be.viral_score)} font-bold px-3 py-1`,children:["🔥 ",be.viral_score,"/10"]}),a.jsxs(bt,{className:`${ue(be.category)} px-3 py-1`,children:[ie(be.category),a.jsx("span",{className:"ml-1.5 capitalize",children:be.category})]})]}),a.jsx(lt,{className:"text-lg leading-tight line-clamp-2",children:be.title})]}),a.jsxs(Ge,{className:"space-y-3",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"💬 Hook:"}),a.jsxs("p",{className:"text-sm text-foreground/90 italic line-clamp-2",children:['"',be.hook,'"']})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"💡 Why This Works:"}),a.jsx("p",{className:"text-sm text-foreground/90 line-clamp-3",children:be.reason})]}),((je=be.metadata)==null?void 0:je.platform_tips)&&a.jsx("div",{className:"pt-2 border-t border-border",children:a.jsxs("p",{className:"text-xs text-foreground/80",children:["📌 ",a.jsx("strong",{children:"Tip:"})," ",be.metadata.platform_tips]})}),a.jsxs("div",{className:"flex gap-2 pt-2",children:[a.jsxs(ve,{onClick:()=>K(be),className:"flex-1",size:"sm",children:["Generate This Content",a.jsx(Di,{className:"ml-2 h-4 w-4"})]}),ne&&a.jsx(ve,{onClick:()=>te(be.id,be.bookmarked||!1),variant:"outline",size:"sm",children:be.bookmarked?a.jsx(dP,{className:"h-4 w-4 text-primary"}):a.jsx(MS,{className:"h-4 w-4"})})]})]})]},be.id)})})]}),m&&o.length===0&&a.jsx(_e,{className:"border-2 border-dashed shadow-lg",children:a.jsxs(Ge,{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx(vA,{className:"h-16 w-16 text-muted-foreground mb-4"}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:"No Ideas Yet"}),a.jsx("p",{className:"text-muted-foreground max-w-md",children:"Select a platform and enter your niche to get started with viral content ideas."})]})})]}),a.jsx(xl,{value:"saved",className:"mt-8",children:c.length>0?a.jsxs("div",{className:"space-y-4 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("h2",{className:"text-2xl font-bold flex items-center gap-2",children:[a.jsx(dP,{className:"h-6 w-6 text-primary"}),"Saved Ideas"]}),a.jsxs(bt,{variant:"outline",className:"text-base px-4 py-2",children:[c.length," ",c.length===1?"Idea":"Ideas"]})]}),a.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:c.map(be=>{var xe;const je=GP.find(Ie=>Ie.id===be.platform);return a.jsxs(_e,{className:"border-2 shadow-lg hover:border-primary/50 transition-all duration-300",children:[a.jsxs(ot,{className:"pb-3",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[a.jsxs(bt,{className:`${Se(be.viral_score)} font-bold px-3 py-1`,children:["🔥 ",be.viral_score,"/10"]}),a.jsxs(bt,{className:`${ue(be.category)} px-3 py-1`,children:[ie(be.category),a.jsx("span",{className:"ml-1.5 capitalize",children:be.category})]})]}),a.jsx("div",{className:"flex items-center gap-2 mb-2",children:je&&a.jsxs(bt,{variant:"outline",className:"text-xs",children:[a.jsx("span",{className:"mr-1",children:je.emoji}),je.name]})}),a.jsx(lt,{className:"text-lg leading-tight line-clamp-2",children:be.title})]}),a.jsxs(Ge,{className:"space-y-3",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"💬 Hook:"}),a.jsxs("p",{className:"text-sm text-foreground/90 italic line-clamp-2",children:['"',be.hook,'"']})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm font-medium text-foreground",children:"💡 Why This Works:"}),a.jsx("p",{className:"text-sm text-foreground/90 line-clamp-3",children:be.reason})]}),((xe=be.metadata)==null?void 0:xe.platform_tips)&&a.jsx("div",{className:"pt-2 border-t border-border",children:a.jsxs("p",{className:"text-xs text-foreground/80",children:["📌 ",a.jsx("strong",{children:"Tip:"})," ",be.metadata.platform_tips]})}),a.jsxs("div",{className:"flex gap-2 pt-2",children:[a.jsxs(ve,{onClick:()=>K(be),className:"flex-1",size:"sm",children:["Generate This Content",a.jsx(Di,{className:"ml-2 h-4 w-4"})]}),a.jsx(ve,{onClick:()=>te(be.id,!0),variant:"outline",size:"sm",children:a.jsx(dP,{className:"h-4 w-4 text-primary"})})]})]})]},be.id)})})]}):a.jsx(_e,{className:"border-2 border-dashed shadow-lg",children:a.jsxs(Ge,{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx(MS,{className:"h-16 w-16 text-muted-foreground mb-4"}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:"No Saved Ideas"}),a.jsx("p",{className:"text-muted-foreground max-w-md mb-4",children:ne?"Bookmark your favorite ideas to access them quickly later. Generate some ideas and click the bookmark icon to save them.":"Save your favorite content ideas for later access."}),!ne&&a.jsxs(Z1,{className:"max-w-md bg-amber-50 dark:bg-amber-950/20 border-amber-200 dark:border-amber-900",children:[a.jsx(ru,{className:"h-4 w-4 text-amber-600 dark:text-amber-500"}),a.jsxs(e2,{className:"text-sm text-amber-900 dark:text-amber-100",children:[a.jsx("strong",{children:"Upgrade to a paid plan"})," to save and organize your content ideas. Access them anytime, from anywhere."]})]})]})})})]}),a.jsx(Hh,{open:b,onOpenChange:C}),a.jsx(Mi,{open:T,onOpenChange:B,children:a.jsxs(yi,{className:"sm:max-w-md",children:[a.jsxs(bi,{children:[a.jsxs(wi,{className:"flex items-center gap-2",children:[a.jsx(xC,{className:"h-5 w-5 text-primary"}),"Choose LinkedIn Content Format"]}),a.jsx(Qo,{children:"Select the format for your LinkedIn post before generating."})]}),a.jsxs(u_,{value:E,onValueChange:M,className:"space-y-3 py-2",children:[a.jsxs("label",{htmlFor:"fmt-microblog",className:"flex items-start gap-3 p-3 rounded-lg border cursor-pointer hover:bg-accent/50 transition-colors",children:[a.jsx(Du,{value:"microblog",id:"fmt-microblog",className:"mt-0.5"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-sm",children:"Microblog"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Short paragraphs, hook-driven, professional yet conversational"})]})]}),a.jsxs("label",{htmlFor:"fmt-carousel",className:"flex items-start gap-3 p-3 rounded-lg border cursor-pointer hover:bg-accent/50 transition-colors",children:[a.jsx(Du,{value:"carousel",id:"fmt-carousel",className:"mt-0.5"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-sm",children:"Carousel / PDF"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Slide-by-slide content for document-style posts"})]})]}),a.jsxs("label",{htmlFor:"fmt-story",className:"flex items-start gap-3 p-3 rounded-lg border cursor-pointer hover:bg-accent/50 transition-colors",children:[a.jsx(Du,{value:"story",id:"fmt-story",className:"mt-0.5"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-sm",children:"Story Post"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Personal narrative with a lesson or takeaway"})]})]}),a.jsxs("label",{htmlFor:"fmt-thought-leadership",className:"flex items-start gap-3 p-3 rounded-lg border cursor-pointer hover:bg-accent/50 transition-colors",children:[a.jsx(Du,{value:"thought-leadership",id:"fmt-thought-leadership",className:"mt-0.5"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-sm",children:"Thought Leadership"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Bold opinion or insightful industry take"})]})]})]}),a.jsxs(nd,{children:[a.jsx(ve,{variant:"outline",onClick:()=>B(!1),children:"Cancel"}),a.jsxs(ve,{onClick:we,children:[a.jsx(Do,{className:"mr-2 h-4 w-4"}),"Generate"]})]})]})})]})]})};var Lle=["PageUp","PageDown"],Mle=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Dle={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},M0="Slider",[uL,mIe,gIe]=Yh(M0),[Rle,vNt]=Zi(M0,[gIe]),[vIe,_E]=Rle(M0),Ule=w.forwardRef((e,t)=>{const{name:r,min:n=0,max:i=100,step:s=1,orientation:o="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[n],value:d,onValueChange:A=()=>{},onValueCommit:h=()=>{},inverted:f=!1,form:m,...p}=e,g=w.useRef(new Set),v=w.useRef(0),y=o==="horizontal"?xIe:yIe,[b=[],C]=fa({prop:d,defaultProp:u,onChange:P=>{var M;(M=[...g.current][v.current])==null||M.focus(),A(P)}}),j=w.useRef(b);function S(P){const E=jIe(b,P);I(P,E)}function T(P){I(P,v.current)}function B(){const P=j.current[v.current];b[v.current]!==P&&h(b)}function I(P,E,{commit:M}={commit:!1}){const _=kIe(s),R=EIe(Math.round((P-n)/s)*s+n,_),G=t_(R,[n,i]);C((U=[])=>{const Q=CIe(U,G,E);if(_Ie(Q,c*s)){v.current=Q.indexOf(G);const z=String(Q)!==String(U);return z&&M&&h(Q),z?Q:U}else return U})}return a.jsx(vIe,{scope:e.__scopeSlider,name:r,disabled:l,min:n,max:i,valueIndexToChangeRef:v,thumbs:g.current,values:b,orientation:o,form:m,children:a.jsx(uL.Provider,{scope:e.__scopeSlider,children:a.jsx(uL.Slot,{scope:e.__scopeSlider,children:a.jsx(y,{"aria-disabled":l,"data-disabled":l?"":void 0,...p,ref:t,onPointerDown:Ye(p.onPointerDown,()=>{l||(j.current=b)}),min:n,max:i,inverted:f,onSlideStart:l?void 0:S,onSlideMove:l?void 0:T,onSlideEnd:l?void 0:B,onHomeKeyDown:()=>!l&&I(n,0,{commit:!0}),onEndKeyDown:()=>!l&&I(i,b.length-1,{commit:!0}),onStepKeyDown:({event:P,direction:E})=>{if(!l){const R=Lle.includes(P.key)||P.shiftKey&&Mle.includes(P.key)?10:1,G=v.current,U=b[G],Q=s*R*E;I(U+Q,G,{commit:!0})}}})})})})});Ule.displayName=M0;var[Qle,Hle]=Rle(M0,{startEdge:"left",endEdge:"right",size:"width",direction:1}),xIe=w.forwardRef((e,t)=>{const{min:r,max:n,dir:i,inverted:s,onSlideStart:o,onSlideMove:l,onSlideEnd:c,onStepKeyDown:u,...d}=e,[A,h]=w.useState(null),f=Jt(t,y=>h(y)),m=w.useRef(void 0),p=rp(i),g=p==="ltr",v=g&&!s||!g&&s;function x(y){const b=m.current||A.getBoundingClientRect(),C=[0,b.width],S=VU(C,v?[r,n]:[n,r]);return m.current=b,S(y-b.left)}return a.jsx(Qle,{scope:e.__scopeSlider,startEdge:v?"left":"right",endEdge:v?"right":"left",direction:v?1:-1,size:"width",children:a.jsx($le,{dir:p,"data-orientation":"horizontal",...d,ref:f,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:y=>{const b=x(y.clientX);o==null||o(b)},onSlideMove:y=>{const b=x(y.clientX);l==null||l(b)},onSlideEnd:()=>{m.current=void 0,c==null||c()},onStepKeyDown:y=>{const C=Dle[v?"from-left":"from-right"].includes(y.key);u==null||u({event:y,direction:C?-1:1})}})})}),yIe=w.forwardRef((e,t)=>{const{min:r,max:n,inverted:i,onSlideStart:s,onSlideMove:o,onSlideEnd:l,onStepKeyDown:c,...u}=e,d=w.useRef(null),A=Jt(t,d),h=w.useRef(void 0),f=!i;function m(p){const g=h.current||d.current.getBoundingClientRect(),v=[0,g.height],y=VU(v,f?[n,r]:[r,n]);return h.current=g,y(p-g.top)}return a.jsx(Qle,{scope:e.__scopeSlider,startEdge:f?"bottom":"top",endEdge:f?"top":"bottom",size:"height",direction:f?1:-1,children:a.jsx($le,{"data-orientation":"vertical",...u,ref:A,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:p=>{const g=m(p.clientY);s==null||s(g)},onSlideMove:p=>{const g=m(p.clientY);o==null||o(g)},onSlideEnd:()=>{h.current=void 0,l==null||l()},onStepKeyDown:p=>{const v=Dle[f?"from-bottom":"from-top"].includes(p.key);c==null||c({event:p,direction:v?-1:1})}})})}),$le=w.forwardRef((e,t)=>{const{__scopeSlider:r,onSlideStart:n,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:o,onEndKeyDown:l,onStepKeyDown:c,...u}=e,d=_E(M0,r);return a.jsx(at.span,{...u,ref:t,onKeyDown:Ye(e.onKeyDown,A=>{A.key==="Home"?(o(A),A.preventDefault()):A.key==="End"?(l(A),A.preventDefault()):Lle.concat(Mle).includes(A.key)&&(c(A),A.preventDefault())}),onPointerDown:Ye(e.onPointerDown,A=>{const h=A.target;h.setPointerCapture(A.pointerId),A.preventDefault(),d.thumbs.has(h)?h.focus():n(A)}),onPointerMove:Ye(e.onPointerMove,A=>{A.target.hasPointerCapture(A.pointerId)&&i(A)}),onPointerUp:Ye(e.onPointerUp,A=>{const h=A.target;h.hasPointerCapture(A.pointerId)&&(h.releasePointerCapture(A.pointerId),s(A))})})}),zle="SliderTrack",Wle=w.forwardRef((e,t)=>{const{__scopeSlider:r,...n}=e,i=_E(zle,r);return a.jsx(at.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...n,ref:t})});Wle.displayName=zle;var dL="SliderRange",Gle=w.forwardRef((e,t)=>{const{__scopeSlider:r,...n}=e,i=_E(dL,r),s=Hle(dL,r),o=w.useRef(null),l=Jt(t,o),c=i.values.length,u=i.values.map(h=>qle(h,i.min,i.max)),d=c>1?Math.min(...u):0,A=100-Math.max(...u);return a.jsx(at.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...n,ref:l,style:{...e.style,[s.startEdge]:d+"%",[s.endEdge]:A+"%"}})});Gle.displayName=dL;var AL="SliderThumb",Kle=w.forwardRef((e,t)=>{const r=mIe(e.__scopeSlider),[n,i]=w.useState(null),s=Jt(t,l=>i(l)),o=w.useMemo(()=>n?r().findIndex(l=>l.ref.current===n):-1,[r,n]);return a.jsx(bIe,{...e,ref:s,index:o})}),bIe=w.forwardRef((e,t)=>{const{__scopeSlider:r,index:n,name:i,...s}=e,o=_E(AL,r),l=Hle(AL,r),[c,u]=w.useState(null),d=Jt(t,x=>u(x)),A=c?o.form||!!c.closest("form"):!0,h=wC(c),f=o.values[n],m=f===void 0?0:qle(f,o.min,o.max),p=NIe(n,o.values.length),g=h==null?void 0:h[l.size],v=g?SIe(g,m,l.direction):0;return w.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),a.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${m}% + ${v}px)`},children:[a.jsx(uL.ItemSlot,{scope:e.__scopeSlider,children:a.jsx(at.span,{role:"slider","aria-label":e["aria-label"]||p,"aria-valuemin":o.min,"aria-valuenow":f,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...s,ref:d,style:f===void 0?{display:"none"}:e.style,onFocus:Ye(e.onFocus,()=>{o.valueIndexToChangeRef.current=n})})}),A&&a.jsx(Vle,{name:i??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:f},n)]})});Kle.displayName=AL;var wIe="RadioBubbleInput",Vle=w.forwardRef(({__scopeSlider:e,value:t,...r},n)=>{const i=w.useRef(null),s=Jt(i,n),o=I0(t);return w.useEffect(()=>{const l=i.current;if(!l)return;const c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const A=new Event("input",{bubbles:!0});d.call(l,t),l.dispatchEvent(A)}},[o,t]),a.jsx(at.input,{style:{display:"none"},...r,ref:s,defaultValue:t})});Vle.displayName=wIe;function CIe(e=[],t,r){const n=[...e];return n[r]=t,n.sort((i,s)=>i-s)}function qle(e,t,r){const s=100/(r-t)*(e-t);return t_(s,[0,100])}function NIe(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function jIe(e,t){if(e.length===1)return 0;const r=e.map(i=>Math.abs(i-t)),n=Math.min(...r);return r.indexOf(n)}function SIe(e,t,r){const n=e/2,s=VU([0,50],[0,n]);return(n-s(t)*r)*r}function BIe(e){return e.slice(0,-1).map((t,r)=>e[r+1]-t)}function _Ie(e,t){if(t>0){const r=BIe(e);return Math.min(...r)>=t}return!0}function VU(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function kIe(e){return(String(e).split(".")[1]||"").length}function EIe(e,t){const r=Math.pow(10,t);return Math.round(e*r)/r}var Xle=Ule,TIe=Wle,PIe=Gle,IIe=Kle;const d_=w.forwardRef(({className:e,...t},r)=>a.jsxs(Xle,{ref:r,className:Le("relative flex w-full touch-none select-none items-center",e),...t,children:[a.jsx(TIe,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:a.jsx(PIe,{className:"absolute h-full bg-primary"})}),a.jsx(IIe,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));d_.displayName=Xle.displayName;const C9=[{id:"blog",name:"Blog Post",icon:ai,emoji:"📝"},{id:"help",name:"Help Article",icon:L1,emoji:"📖"},{id:"website",name:"Website Page",icon:Hs,emoji:"🌐"},{id:"social",name:"Social Media Post",icon:yC,emoji:"📱"},{id:"video",name:"Video Script",icon:UB,emoji:"🎬"},{id:"email",name:"Email Marketing",icon:jl,emoji:"📧"},{id:"ecommerce",name:"E-commerce Content",icon:DB,emoji:"🛍️"}],KP={high:{value:90,label:"High Fidelity",description:"90% your content, minimal AI enhancement"},medium:{value:70,label:"Balanced",description:"70% your content, balanced polish"},low:{value:50,label:"Creative",description:"50% your content, significant AI elaboration"}},OIe=()=>{const[e,t]=w.useState("blog"),[r,n]=w.useState(""),[i,s]=w.useState(70),[o,l]=w.useState("professional"),[c,u]=w.useState("General Public"),[d,A]=w.useState("1000"),[h,f]=w.useState(""),[m,p]=w.useState("instagram"),[g,v]=w.useState(!1),[x,y]=w.useState(!1),[b,C]=w.useState(!1),[j,S]=w.useState(null),{toast:T}=Dr(),{usageData:B,getRemainingCredits:I,refreshUsage:P}=Ua(),E=hs(),M=I(),_=r.length,R=5e3;w.useEffect(()=>{const $=setInterval(()=>{r&&localStorage.setItem("studio_draft",JSON.stringify({contentType:e,researchNotes:r,fidelityLevel:i,tone:o,audience:c,wordCount:d,keywords:h,platform:m}))},3e4);return()=>clearInterval($)},[e,r,i,o,c,d,h,m]),w.useEffect(()=>{const $=localStorage.getItem("studio_draft");if($)try{const O=JSON.parse($);confirm("Resume your previous draft?")&&(t(O.contentType||"blog"),n(O.researchNotes||""),s(O.fidelityLevel||70),l(O.tone||"professional"),u(O.audience||"General Public"),A(O.wordCount||"1000"),f(O.keywords||""),p(O.platform||"instagram"))}catch(O){console.error("Error loading draft:",O)}},[]);const G=()=>{confirm("Clear all inputs and draft?")&&(localStorage.removeItem("studio_draft"),n(""),s(70),l("professional"),u(""),A("1000"),f(""),p("instagram"),T({title:"Draft cleared"}))},U=()=>i>=85?KP.high:i>=60?KP.medium:KP.low,Q=()=>{if(r.trim().length<100){T({title:"Research notes too short",description:"Please provide at least 100 characters of research notes.",variant:"destructive"});return}if(!c||c.trim()===""){T({title:"Audience Required",description:"Please select a target audience.",variant:"destructive"});return}if(M&&typeof M.remaining=="number"&&M.remaining<2){y(!0),T({title:"Insufficient Credits",description:"Studio generations require 2 credits. Please upgrade your plan.",variant:"destructive"});return}z()},z=async()=>{v(!0);try{const{data:$,error:O}=await Re.functions.invoke("generate-studio-content",{body:{contentType:e,researchNotes:r.trim(),fidelityLevel:i>=85?"high":i>=60?"medium":"low",tone:o,audience:c,wordCount:parseInt(d),keywords:h.trim(),platform:m,language:"en"}});if(O)throw O;if($.error){if($.error==="Usage limit exceeded"){y(!0),T({title:"Usage Limit Exceeded",description:"You've reached your generation limit. Upgrade to continue!",variant:"destructive"});return}throw new Error($.error)}await P(),localStorage.removeItem("studio_draft"),C(!0),S($.blogPost.id)}catch($){console.error("Error generating content:",$),T({title:"Generation Failed",description:$.message||"Unable to generate content. Please try again.",variant:"destructive"})}finally{v(!1)}};C9.find($=>$.id===e);const Y=U();return a.jsxs(a.Fragment,{children:[g&&a.jsx(id,{contentType:"Studio Content"}),a.jsxs("div",{className:"container mx-auto p-6 max-w-5xl pb-32",children:[a.jsx("div",{className:"mb-8",children:a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsx("div",{className:"p-3 bg-primary rounded-xl",children:a.jsx(nre,{className:"h-8 w-8 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-4xl font-bold text-primary",children:"Studio"}),a.jsx("p",{className:"text-muted-foreground",children:"Co-create content with AI based on your research"})]})]})}),a.jsx(F0,{}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs(_e,{className:"border-2 shadow-lg",children:[a.jsxs(ot,{children:[a.jsxs(lt,{className:"flex items-center gap-2",children:[a.jsx(ai,{className:"h-5 w-5"}),"Content Type"]}),a.jsx(Mr,{children:"Select the type of content you want to create"})]}),a.jsx(Ge,{children:a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:C9.map($=>{const O=$.icon;return a.jsx("button",{onClick:()=>t($.id),className:`p-4 rounded-lg border-2 transition-all hover:border-primary/50 ${e===$.id?"border-primary bg-primary/10":"border-border"}`,children:a.jsxs("div",{className:"flex flex-col items-center gap-2",children:[a.jsx("span",{className:"text-3xl",children:$.emoji}),a.jsx(O,{className:"h-5 w-5"}),a.jsx("span",{className:"text-sm font-medium",children:$.name})]})},$.id)})})})]}),a.jsxs(_e,{className:"border-2 shadow-lg",children:[a.jsxs(ot,{children:[a.jsx(lt,{children:"Research Notes"}),a.jsx(Mr,{children:"Enter all your content including research notes, key facts, statistics, sources, and any information you want to transform."})]}),a.jsxs(Ge,{className:"space-y-2",children:[a.jsx(Zr,{value:r,onChange:$=>n($.target.value),placeholder:"Enter your research notes, findings, key facts, statistics, data points, sources, URLs, and any relevant information you've gathered. Include everything here that you want the AI to use as the foundation for your content...",rows:10,maxLength:R,className:"resize-none"}),a.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[a.jsx("span",{children:_<100?"⚠️ Minimum 100 characters required":"✓ Looks good"}),a.jsxs("span",{className:_>R*.9?"text-warning":"",children:[_," / ",R]})]})]})]}),a.jsxs(_e,{className:"border-2 shadow-lg",children:[a.jsxs(ot,{children:[a.jsxs(lt,{className:"flex items-center gap-2",children:[a.jsx(Kc,{className:"h-5 w-5"}),"AI Enhancement Level"]}),a.jsx(Mr,{children:"Control how much AI enhances vs. preserves your original content"})]}),a.jsx(Ge,{className:"space-y-4",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx(bt,{variant:"outline",className:"text-sm",children:Y.label}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[i,"%"]})]}),a.jsx(d_,{value:[i],onValueChange:$=>s($[0]),min:30,max:95,step:5,className:"w-full"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:Y.description})]})})]}),a.jsxs(_e,{className:"border-2 shadow-lg",children:[a.jsxs(ot,{children:[a.jsx(lt,{children:"Content Parameters"}),a.jsx(Mr,{children:"Configure tone, audience, and other settings"})]}),a.jsx(Ge,{className:"space-y-4",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Tone"}),a.jsxs(It,{value:o,onValueChange:l,children:[a.jsx(_t,{children:a.jsx(Ot,{})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"professional",children:"Professional"}),a.jsx(ye,{value:"casual",children:"Casual"}),a.jsx(ye,{value:"formal",children:"Formal"}),a.jsx(ye,{value:"friendly",children:"Friendly"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Target Word Count"}),a.jsxs(It,{value:d,onValueChange:A,children:[a.jsx(_t,{children:a.jsx(Ot,{})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"500",children:"500 words"}),a.jsx(ye,{value:"1000",children:"1000 words"}),a.jsx(ye,{value:"1500",children:"1500 words"}),a.jsx(ye,{value:"2000",children:"2000 words"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Target Audience"}),a.jsxs(It,{value:c,onValueChange:u,children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select audience"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"General Public",children:"General Public"}),a.jsx(ye,{value:"Professionals",children:"Professionals"}),a.jsx(ye,{value:"Beginners",children:"Beginners"}),a.jsx(ye,{value:"Experts",children:"Experts"}),a.jsx(ye,{value:"Students",children:"Students"}),a.jsx(ye,{value:"Business Owners",children:"Business Owners"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"SEO Keywords"}),a.jsx(st,{value:h,onChange:$=>f($.target.value),placeholder:"keyword1, keyword2, keyword3"})]}),(e==="social"||e==="video")&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Platform"}),a.jsxs(It,{value:m,onValueChange:p,children:[a.jsx(_t,{children:a.jsx(Ot,{})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"instagram",children:"Instagram"}),a.jsx(ye,{value:"linkedin",children:"LinkedIn"}),a.jsx(ye,{value:"twitter",children:"Twitter/X"}),a.jsx(ye,{value:"tiktok",children:"TikTok"}),a.jsx(ye,{value:"youtube",children:"YouTube"})]})]})]})]})})]}),a.jsxs("div",{className:"flex gap-3 justify-between",children:[a.jsx(ve,{variant:"outline",onClick:G,className:"border-2 border-primary hover:bg-primary/10",children:"Clear Draft"}),a.jsxs(ve,{onClick:Q,disabled:g,size:"lg",className:"gap-2 border-2 border-primary bg-primary hover:bg-primary/90",children:[a.jsx(Kc,{className:"h-5 w-5"}),"Generate (2 Credits)",a.jsx(Di,{className:"h-4 w-4"})]})]})]})]}),a.jsx(Hh,{open:x,onOpenChange:y}),a.jsx(Hoe,{open:b,onOpenChange:C,contentType:"Studio Content",onViewContent:()=>{j&&E(`/dashboard/view/${j}`)}})]})},FIe=()=>a.jsx(Og,{feature:"studio",children:a.jsx(OIe,{})});var kE="Checkbox",[LIe,xNt]=Zi(kE),[MIe,qU]=LIe(kE);function DIe(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:i,disabled:s,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:A}=e,[h,f]=fa({prop:r,defaultProp:i??!1,onChange:c,caller:kE}),[m,p]=w.useState(null),[g,v]=w.useState(null),x=w.useRef(!1),y=m?!!o||!!m.closest("form"):!0,b={checked:h,disabled:s,setChecked:f,control:m,setControl:p,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:x,required:u,defaultChecked:Ch(i)?!1:i,isFormControl:y,bubbleInput:g,setBubbleInput:v};return a.jsx(MIe,{scope:t,...b,children:RIe(A)?A(b):n})}var Yle="CheckboxTrigger",Jle=w.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},i)=>{const{control:s,value:o,disabled:l,checked:c,required:u,setControl:d,setChecked:A,hasConsumerStoppedPropagationRef:h,isFormControl:f,bubbleInput:m}=qU(Yle,e),p=Jt(i,d),g=w.useRef(c);return w.useEffect(()=>{const v=s==null?void 0:s.form;if(v){const x=()=>A(g.current);return v.addEventListener("reset",x),()=>v.removeEventListener("reset",x)}},[s,A]),a.jsx(at.button,{type:"button",role:"checkbox","aria-checked":Ch(c)?"mixed":c,"aria-required":u,"data-state":nce(c),"data-disabled":l?"":void 0,disabled:l,value:o,...n,ref:p,onKeyDown:Ye(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:Ye(r,v=>{A(x=>Ch(x)?!0:!x),m&&f&&(h.current=v.isPropagationStopped(),h.current||v.stopPropagation())})})});Jle.displayName=Yle;var XU=w.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:o,disabled:l,value:c,onCheckedChange:u,form:d,...A}=e;return a.jsx(DIe,{__scopeCheckbox:r,checked:i,defaultChecked:s,disabled:l,required:o,onCheckedChange:u,name:n,form:d,value:c,internal_do_not_use_render:({isFormControl:h})=>a.jsxs(a.Fragment,{children:[a.jsx(Jle,{...A,ref:t,__scopeCheckbox:r}),h&&a.jsx(rce,{__scopeCheckbox:r})]})})});XU.displayName=kE;var Zle="CheckboxIndicator",ece=w.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...i}=e,s=qU(Zle,r);return a.jsx(Gs,{present:n||Ch(s.checked)||s.checked===!0,children:a.jsx(at.span,{"data-state":nce(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});ece.displayName=Zle;var tce="CheckboxBubbleInput",rce=w.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:o,required:l,disabled:c,name:u,value:d,form:A,bubbleInput:h,setBubbleInput:f}=qU(tce,e),m=Jt(r,f),p=I0(s),g=wC(n);w.useEffect(()=>{const x=h;if(!x)return;const y=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(y,"checked").set,j=!i.current;if(p!==s&&C){const S=new Event("click",{bubbles:j});x.indeterminate=Ch(s),C.call(x,Ch(s)?!1:s),x.dispatchEvent(S)}},[h,p,s,i]);const v=w.useRef(Ch(s)?!1:s);return a.jsx(at.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??v.current,required:l,disabled:c,name:u,value:d,form:A,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});rce.displayName=tce;function RIe(e){return typeof e=="function"}function Ch(e){return e==="indeterminate"}function nce(e){return Ch(e)?"indeterminate":e?"checked":"unchecked"}const EE=w.forwardRef(({className:e,...t},r)=>a.jsx(XU,{ref:r,className:Le("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:a.jsx(ece,{className:Le("flex items-center justify-center text-current"),children:a.jsx(dr,{className:"h-4 w-4"})})}));EE.displayName=XU.displayName;var YU="Progress",JU=100,[UIe,yNt]=Zi(YU),[QIe,HIe]=UIe(YU),ice=w.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:i,getValueLabel:s=$Ie,...o}=e;(i||i===0)&&!N9(i)&&console.error(zIe(`${i}`,"Progress"));const l=N9(i)?i:JU;n!==null&&!j9(n,l)&&console.error(WIe(`${n}`,"Progress"));const c=j9(n,l)?n:null,u=A_(c)?s(c,l):void 0;return a.jsx(QIe,{scope:r,value:c,max:l,children:a.jsx(at.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":A_(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":oce(c,l),"data-value":c??void 0,"data-max":l,...o,ref:t})})});ice.displayName=YU;var sce="ProgressIndicator",ace=w.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,i=HIe(sce,r);return a.jsx(at.div,{"data-state":oce(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...n,ref:t})});ace.displayName=sce;function $Ie(e,t){return`${Math.round(e/t*100)}%`}function oce(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function A_(e){return typeof e=="number"}function N9(e){return A_(e)&&!isNaN(e)&&e>0}function j9(e,t){return A_(e)&&!isNaN(e)&&e<=t&&e>=0}function zIe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${JU}\`.`}function WIe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: - a positive number - less than the value passed to \`max\` (or ${JU} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. Defaulting to \`null\`.`}var lce=ice,GIe=ace;const MC=w.forwardRef(({className:e,value:t,...r},n)=>a.jsx(lce,{ref:n,className:Le("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:a.jsx(GIe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));MC.displayName=lce.displayName;function KIe({open:e,onOpenChange:t,post:r}){const[n,i]=w.useState([]),[s,o]=w.useState(""),[l,c]=w.useState(!0),[u,d]=w.useState("standard"),[A,h]=w.useState("publish"),[f,m]=w.useState("configure"),[p,g]=w.useState(""),[v,x]=w.useState(""),[y,b]=w.useState(0),[C,j]=w.useState([]),{toast:S}=Dr(),{getRemainingCredits:T,refreshUsage:B}=Ua(),I=T();w.useEffect(()=>{e&&(E(),P())},[e]);const P=()=>{m("configure"),g(""),x(""),b(0),j([])},E=async()=>{try{const{data:U,error:Q}=await Re.from("wordpress_connections").select("id, site_name, site_url").eq("is_active",!0).order("created_at",{ascending:!1});if(Q)throw Q;i(U||[]),U&&U.length>0&&o(U[0].id)}catch(U){console.error("Error fetching connections:",U)}},M=()=>l?u==="hd"?5:3:2,_=()=>u==="hd"?{width:1920,height:1080}:{width:1200,height:630},R=async()=>{if(!s){S({title:"Select a Site",description:"Please select a WordPress site to publish to.",variant:"destructive"});return}const U=M();if(I&&I.remainingY.map($=>({...$,status:"completed"}))),b(100),g(Q.postUrl),m("success"),await B(),S({title:"Published Successfully!",description:"Your post is now live on WordPress."})}catch(Q){console.error("Error publishing to WordPress:",Q),m("error"),x(Q.message||"Failed to publish to WordPress."),S({title:"Publishing Failed",description:Q.message||"Something went wrong.",variant:"destructive"})}},G=async()=>{try{await navigator.clipboard.writeText(p),S({title:"URL Copied",description:"Post URL copied to clipboard."})}catch{S({title:"Copy Failed",variant:"destructive"})}};return n.find(U=>U.id===s),f==="configure"?a.jsx(Mi,{open:e,onOpenChange:t,children:a.jsxs(yi,{className:"sm:max-w-lg",children:[a.jsxs(bi,{children:[a.jsxs(wi,{className:"flex items-center gap-2",children:[a.jsx(Hs,{className:"h-5 w-5 text-primary"}),"Publish to WordPress"]}),a.jsxs(Qo,{className:"truncate",children:['Publishing: "',r.title,'"']})]}),a.jsx("div",{className:"space-y-6 py-4",children:n.length===0?a.jsxs("div",{className:"text-center py-6",children:[a.jsx(Hs,{className:"h-12 w-12 text-muted-foreground mx-auto mb-3"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"No WordPress sites connected"}),a.jsx(ve,{variant:"outline",onClick:()=>t(!1),children:"Go to Integrations"})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Select WordPress Site"}),a.jsxs(It,{value:s,onValueChange:o,children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Choose a site"})}),a.jsx(kt,{children:n.map(U=>a.jsxs(ye,{value:U.id,children:[U.site_name," (",new URL(U.site_url).hostname,")"]},U.id))})]})]}),a.jsxs("div",{className:"space-y-3 p-4 border rounded-lg bg-muted/30",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(EE,{id:"generateImage",checked:l,onCheckedChange:U=>c(!!U)}),a.jsx(Pe,{htmlFor:"generateImage",className:"font-medium cursor-pointer",children:"Generate AI Featured Image"})]}),l&&a.jsxs(u_,{value:u,onValueChange:U=>d(U),className:"ml-6 space-y-2",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Du,{value:"standard",id:"standard"}),a.jsx(Pe,{htmlFor:"standard",className:"font-normal cursor-pointer",children:"Standard (1200×630) - 3 credits total"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Du,{value:"hd",id:"hd"}),a.jsx(Pe,{htmlFor:"hd",className:"font-normal cursor-pointer",children:"HD (1920×1080) - 5 credits total"})]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(Pe,{children:"Publish Status"}),a.jsxs(u_,{value:A,onValueChange:U=>h(U),className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Du,{value:"draft",id:"draft"}),a.jsx(Pe,{htmlFor:"draft",className:"font-normal cursor-pointer",children:"Draft (save for review before going live)"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Du,{value:"publish",id:"publish"}),a.jsx(Pe,{htmlFor:"publish",className:"font-normal cursor-pointer",children:"Publish (go live immediately)"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Du,{value:"pending",id:"pending"}),a.jsx(Pe,{htmlFor:"pending",className:"font-normal cursor-pointer",children:"Pending Review (submit for editorial approval)"})]})]})]}),a.jsxs("div",{className:"space-y-2 text-sm",children:[a.jsx(Pe,{className:"text-muted-foreground",children:"What will be published:"}),a.jsxs("ul",{className:"space-y-1 text-muted-foreground",children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(dr,{className:"h-3 w-3 text-green-500"}),'Title: "',r.title,'"']}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(dr,{className:"h-3 w-3 text-green-500"}),"Content: ",r.word_count||0," words"]}),r.meta_description&&a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(dr,{className:"h-3 w-3 text-green-500"}),"Meta Description as excerpt"]}),r.slug&&a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(dr,{className:"h-3 w-3 text-green-500"}),"URL Slug: /",r.slug]}),l&&a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(dr,{className:"h-3 w-3 text-green-500"}),"Featured Image: AI-generated"]})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ln,{className:"h-4 w-4 text-primary"}),a.jsxs("span",{className:"font-medium",children:["Credit Cost: ",M()," credits"]})]}),a.jsxs(bt,{variant:"secondary",children:["Balance: ",(I==null?void 0:I.remaining)??0," credits"]})]})]})}),n.length>0&&a.jsxs(nd,{children:[a.jsx(ve,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),a.jsxs(ve,{onClick:R,children:[a.jsx(W5,{className:"h-4 w-4 mr-2"}),"Publish Now"]})]})]})}):f==="publishing"?a.jsx(Mi,{open:e,onOpenChange:()=>{},children:a.jsxs(yi,{className:"sm:max-w-md [&>button]:hidden",children:[a.jsx(bi,{children:a.jsx(wi,{children:"Publishing to WordPress..."})}),a.jsxs("div",{className:"space-y-4 py-6",children:[C.map(U=>a.jsxs("div",{className:"flex items-center gap-3",children:[U.status==="completed"?a.jsx(dr,{className:"h-4 w-4 text-green-500"}):U.status==="active"?a.jsx("div",{className:"h-4 w-4 border-2 border-primary border-t-transparent rounded-full animate-spin"}):a.jsx("div",{className:"h-4 w-4 border-2 border-muted-foreground/30 rounded-full"}),a.jsx("span",{className:U.status==="active"?"font-medium":"text-muted-foreground",children:U.label})]},U.id)),a.jsx(MC,{value:y,className:"mt-4"}),a.jsx("p",{className:"text-sm text-center text-muted-foreground",children:"Please wait, this may take a moment..."})]})]})}):f==="success"?a.jsx(Mi,{open:e,onOpenChange:t,children:a.jsxs(yi,{className:"sm:max-w-md",children:[a.jsx(bi,{children:a.jsxs(wi,{className:"flex items-center gap-2 text-green-600",children:[a.jsx(dr,{className:"h-5 w-5"}),"Published Successfully!"]})}),a.jsxs("div",{className:"space-y-4 py-6 text-center",children:[a.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto",children:a.jsx(dr,{className:"h-8 w-8 text-green-600"})}),a.jsx("p",{children:"Your post has been published to WordPress!"}),a.jsxs("div",{className:"p-3 bg-muted rounded-lg",children:[a.jsx(Pe,{className:"text-xs text-muted-foreground",children:"Post URL:"}),a.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[a.jsx("code",{className:"text-xs flex-1 truncate",children:p}),a.jsx(ve,{variant:"ghost",size:"icon",onClick:G,children:a.jsx(zl,{className:"h-4 w-4"})})]})]}),a.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[a.jsxs("p",{children:["Status: ",A==="publish"?"Published":A==="draft"?"Draft":"Pending Review"]}),l&&a.jsx("p",{children:"Featured Image: ✓ Uploaded"}),a.jsxs("p",{children:["Credits Used: ",M()]})]})]}),a.jsxs(nd,{className:"gap-2 sm:gap-0",children:[a.jsxs(ve,{variant:"outline",onClick:()=>window.open(p,"_blank"),children:[a.jsx(Zte,{className:"h-4 w-4 mr-2"}),"View on WordPress"]}),a.jsx(ve,{onClick:()=>t(!1),children:"Close"})]})]})}):a.jsx(Mi,{open:e,onOpenChange:t,children:a.jsxs(yi,{className:"sm:max-w-md",children:[a.jsx(bi,{children:a.jsx(wi,{className:"text-destructive",children:"Publishing Failed"})}),a.jsxs("div",{className:"py-6 text-center",children:[a.jsx("p",{className:"text-muted-foreground mb-4",children:v}),a.jsx(ve,{onClick:P,children:"Try Again"})]})]})})}function VIe(){const{id:e}=NC(),t=hs(),[r,n]=w.useState(null),[i,s]=w.useState(!0),[o,l]=w.useState(!1),[c,u]=w.useState(""),[d,A]=w.useState(!1),[h,f]=w.useState(!1),[m,p]=w.useState(!1),{toast:g}=Dr(),{getRemainingCredits:v,refreshUsage:x}=Ua(),y=v();w.useEffect(()=>{e&&C(e),b()},[e]);const b=async()=>{try{const{count:I}=await Re.from("wordpress_connections").select("*",{count:"exact",head:!0}).eq("is_active",!0);p(I!==null&&I>0)}catch(I){console.error("Error checking WordPress connections:",I)}},C=async I=>{try{s(!0);const{data:P,error:E}=await Re.from("blog_posts").select("*").eq("id",I).single();if(E)throw E;n(P)}catch(P){console.error("Error fetching post:",P),g({title:"Error Loading Post",description:"Failed to load the blog post.",variant:"destructive"}),t("/dashboard")}finally{s(!1)}},j=async()=>{if(!r||!r.content||r.content.trim().length===0){g({title:"No Content",description:"There's no content available to copy.",variant:"destructive"});return}try{let I;o?I=r.content:I=zw(r.content),await navigator.clipboard.writeText(I),g({title:"Content Copied",description:`${o?"HTML":"Formatted"} content has been copied to clipboard.`})}catch{g({title:"Copy Failed",description:"Failed to copy content to clipboard.",variant:"destructive"})}},S=async(I,P)=>{try{await navigator.clipboard.writeText(I),g({title:"Copied",description:`${P} copied to clipboard.`})}catch{g({title:"Copy Failed",description:`Failed to copy ${P.toLowerCase()}.`,variant:"destructive"})}},T=I=>jPe(I),B=async()=>{if(!r||!c.trim()){g({title:"Missing Instructions",description:"Please provide instructions for how you'd like to modify the content.",variant:"destructive"});return}if(y&&typeof y.remaining=="number"&&y.remaining<=0){g({title:"No Credits Remaining",description:"You've used all your generation credits. Upgrade to continue!",variant:"destructive"});return}A(!0);try{const{data:I,error:P}=await Re.functions.invoke("refine-content",{body:{postId:r.id,instructions:c.trim()}});if(P)throw P;if(I.error)throw new Error(I.error);await x(),await C(r.id),u(""),g({title:"Content Refined!",description:"Your content has been updated based on your instructions."})}catch(I){console.error("Error refining content:",I),g({title:"Refinement Failed",description:I.message||"Unable to refine content. Please try again.",variant:"destructive"})}finally{A(!1)}};return i?a.jsx("div",{className:"max-w-4xl mx-auto",children:a.jsx(El,{message:"Loading blog post..."})}):r?a.jsxs(a.Fragment,{children:[d&&a.jsx(id,{contentType:"Refined Content"}),a.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[a.jsx(CC,{children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs($c,{children:[a.jsx(zc,{asChild:!0,children:a.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>t("/dashboard?tab=library"),children:[a.jsx(Cl,{className:"h-4 w-4 mr-2"}),"Back to Library"]})}),a.jsx(Xl,{children:a.jsx("p",{children:"Return to library"})})]}),a.jsx("div",{className:"flex-1"}),a.jsxs($c,{children:[a.jsx(zc,{asChild:!0,children:a.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>t("/dashboard?tab=create"),children:[a.jsx(Xi,{className:"h-4 w-4 mr-2"}),"Create New"]})}),a.jsx(Xl,{children:a.jsx("p",{children:"Create new content (Shortcut: C)"})})]}),a.jsxs($c,{children:[a.jsx(zc,{asChild:!0,children:a.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>t(`/dashboard/edit/${r.id}`),children:[a.jsx(b0,{className:"h-4 w-4 mr-2"}),"Edit Post"]})}),a.jsx(Xl,{children:a.jsx("p",{children:"Edit this content"})})]}),a.jsxs($c,{children:[a.jsx(zc,{asChild:!0,children:a.jsxs(ve,{variant:"outline",size:"sm",onClick:j,children:[a.jsx(zl,{className:"h-4 w-4 mr-2"}),"Copy Content"]})}),a.jsx(Xl,{children:a.jsx("p",{children:"Copy to clipboard"})})]}),a.jsxs($c,{children:[a.jsx(zc,{asChild:!0,children:a.jsxs(ve,{variant:"default",size:"sm",onClick:()=>{m?f(!0):t("/dashboard?tab=integrations")},children:[a.jsx(Hs,{className:"h-4 w-4 mr-2"}),m?"Publish to WordPress":"Connect WordPress"]})}),a.jsx(Xl,{children:a.jsx("p",{children:m?"Publish to your WordPress site":"Connect a WordPress site first"})})]})]})}),a.jsx(_e,{children:a.jsxs(ot,{children:[a.jsx(lt,{className:"text-2xl",children:r.title}),a.jsx(Mr,{className:"text-base",children:r.description||"No description available"}),a.jsxs("div",{className:"flex flex-wrap gap-4 text-sm text-muted-foreground pt-4",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Da,{className:"h-4 w-4"}),"Created: ",new Date(r.created_at).toLocaleDateString()]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(ai,{className:"h-4 w-4"}),r.word_count||0," words"]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(tg,{className:"h-4 w-4"}),r.tone||"N/A"," tone"]})]}),r.audience&&a.jsxs("div",{className:"text-sm text-muted-foreground",children:[a.jsx("strong",{children:"Target Audience:"})," ",r.audience]}),r.keywords&&r.keywords.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[a.jsx(K5,{className:"h-4 w-4"}),"Keywords:"]}),a.jsx("div",{className:"flex flex-wrap gap-2",children:r.keywords.map((I,P)=>a.jsx(bt,{variant:"secondary",children:I},P))})]})]})}),(r.meta_description||r.synopsis||r.abstract||r.slug)&&a.jsxs(_e,{children:[a.jsx(ot,{children:a.jsx(lt,{className:"text-xl",children:"Content Summary"})}),a.jsxs(Ge,{className:"space-y-4",children:[r.meta_description&&a.jsxs("div",{className:"relative",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h4",{className:"font-semibold text-sm text-muted-foreground",children:"Meta Description"}),a.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>S(r.meta_description,"Meta description"),className:"h-6 px-2",children:a.jsx(zl,{className:"h-3 w-3"})})]}),a.jsx("p",{className:"text-sm",children:r.meta_description})]}),r.synopsis&&a.jsxs("div",{className:"relative",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h4",{className:"font-semibold text-sm text-muted-foreground",children:"Synopsis"}),a.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>S(r.synopsis,"Synopsis"),className:"h-6 px-2",children:a.jsx(zl,{className:"h-3 w-3"})})]}),a.jsx("p",{className:"text-sm",children:r.synopsis})]}),r.abstract&&a.jsxs("div",{className:"relative",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h4",{className:"font-semibold text-sm text-muted-foreground",children:"Abstract"}),a.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>S(r.abstract,"Abstract"),className:"h-6 px-2",children:a.jsx(zl,{className:"h-3 w-3"})})]}),a.jsx("p",{className:"text-sm",children:r.abstract})]}),r.slug&&a.jsxs("div",{className:"relative",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h4",{className:"font-semibold text-sm text-muted-foreground",children:"URL Slug"}),a.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>S(r.slug,"URL slug"),className:"h-6 px-2",children:a.jsx(zl,{className:"h-3 w-3"})})]}),a.jsxs("p",{className:"text-sm text-blue-600 font-mono",children:["/",r.slug]})]})]})]}),a.jsxs(_e,{className:"border-primary/20 bg-primary/5",children:[a.jsxs(ot,{children:[a.jsxs(lt,{className:"flex items-center gap-2 text-lg",children:[a.jsx(Kc,{className:"h-5 w-5 text-primary"}),"Refine Content with AI"]}),a.jsx(Mr,{children:"Need changes? Describe what you'd like to modify and AI will regenerate the content."})]}),a.jsxs(Ge,{className:"space-y-3",children:[a.jsx(Zr,{placeholder:"e.g., Make it more casual and add more examples, or Make it shorter and focus on benefits...",value:c,onChange:I=>u(I.target.value),className:"min-h-[100px] resize-none",disabled:d}),a.jsx("div",{className:"flex gap-2",children:a.jsx(ve,{onClick:B,disabled:d||!c.trim(),className:"flex-1",children:d?a.jsxs(a.Fragment,{children:[a.jsx(Zm,{className:"mr-2 h-4 w-4 animate-spin"}),"Refining Content..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Kc,{className:"mr-2 h-4 w-4"}),"Refine Content (1 credit)"]})})})]})]}),a.jsxs(_e,{children:[a.jsxs(ot,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(lt,{className:"flex items-center gap-2",children:[a.jsx(ai,{className:"h-5 w-5"}),"Content"]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Pe,{htmlFor:"format-toggle",className:"text-sm font-medium",children:"HTML Format"}),a.jsx(jE,{id:"format-toggle",checked:o,onCheckedChange:l})]}),a.jsxs(ve,{onClick:j,size:"sm",children:[a.jsx(zl,{className:"h-4 w-4 mr-2"}),"Copy Content"]})]})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:o?"Viewing HTML code - suitable for HTML editors":r.content_type==="blog"||r.content_type==="Blog Post"?"Viewing formatted content - suitable for WordPress and other platforms":"Viewing formatted content"})]}),a.jsx(Ge,{children:o?a.jsx("div",{className:"bg-muted p-4 rounded-lg",children:a.jsx("pre",{className:"whitespace-pre-wrap font-mono text-sm overflow-x-auto",children:r.content||"No content available"})}):a.jsx("div",{children:r.content&&r.content.trim().length>0?r.content_type==="social"||r.content_type==="Social Media Post"?a.jsxs("div",{className:"bg-muted/30 p-6 rounded-lg",children:[a.jsx("div",{className:"content-display",dangerouslySetInnerHTML:{__html:T(r.content)}}),r.caption&&a.jsxs("div",{className:"mt-6 pt-4 border-t border-border",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h4",{className:"font-semibold text-sm text-muted-foreground",children:"Caption"}),a.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>S(zw(r.caption),"Caption"),className:"h-6 px-2",children:a.jsx(zl,{className:"h-3 w-3"})})]}),a.jsx("div",{className:"content-display",dangerouslySetInnerHTML:{__html:T(r.caption)}})]}),r.hashtags&&r.hashtags.length>0&&a.jsxs("div",{className:"mt-4",children:[a.jsx("h4",{className:"font-semibold text-sm text-muted-foreground mb-2",children:"Hashtags"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:r.hashtags.map((I,P)=>a.jsxs(bt,{variant:"secondary",children:["#",I]},P))})]})]}):r.content_type==="video"||r.content_type==="Video Script"?a.jsxs("div",{className:"bg-muted/30 p-6 rounded-lg",children:[a.jsx("div",{className:"content-display",dangerouslySetInnerHTML:{__html:T(r.content)}}),r.video_description&&a.jsxs("div",{className:"mt-6 pt-4 border-t border-border",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h4",{className:"font-semibold text-sm text-muted-foreground",children:"Video Description"}),a.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>S(zw(r.video_description),"Video Description"),className:"h-6 px-2",children:a.jsx(zl,{className:"h-3 w-3"})})]}),a.jsx("div",{className:"content-display",dangerouslySetInnerHTML:{__html:T(r.video_description)}})]})]}):a.jsx("div",{className:"content-display",dangerouslySetInnerHTML:{__html:$U(r.content)}}):a.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[a.jsx("p",{className:"mb-2",children:"No content available for this post."}),a.jsx("p",{className:"text-sm mb-4",children:"The content may not have been properly generated."}),a.jsx(ve,{onClick:()=>t(`/dashboard/edit/${r.id}`),variant:"outline",children:"Edit Post"})]})})})]})]}),r&&a.jsx(KIe,{open:h,onOpenChange:f,post:{id:r.id,title:r.title,content:r.content,meta_description:r.meta_description,slug:r.slug,word_count:r.word_count}})]}):a.jsx("div",{className:"max-w-4xl mx-auto space-y-6",children:a.jsx(_e,{className:"text-center py-12",children:a.jsxs(Ge,{children:[a.jsx("h3",{className:"font-semibold text-lg",children:"Blog post not found"}),a.jsx("p",{className:"text-muted-foreground",children:"The requested blog post could not be found."}),a.jsx(ve,{className:"mt-4",onClick:()=>t("/dashboard"),children:"Back to Library"})]})})})}function qIe(){const{id:e}=NC(),t=hs(),[r,n]=w.useState(null),[i,s]=w.useState(!0),[o,l]=w.useState(!1),{toast:c}=Dr();w.useEffect(()=>{e&&u(e)},[e]);const u=async h=>{try{s(!0);const{data:f,error:m}=await Re.from("blog_posts").select("*").eq("id",h).single();if(m)throw m;n(f)}catch(f){console.error("Error fetching post:",f),c({title:"Error Loading Post",description:f.message||"Failed to load the blog post.",variant:"destructive"}),t("/dashboard")}finally{s(!1)}},d=async()=>{if(!(!r||!e))try{l(!0);const h=r.content.split(/\s+/).filter(m=>m.length>0).length,{error:f}=await Re.from("blog_posts").update({title:r.title,topic:r.topic,description:r.description,keywords:r.keywords,tone:r.tone,audience:r.audience,content:r.content,word_count:h}).eq("id",e);if(f)throw f;c({title:"Post Updated",description:"Your blog post has been saved successfully."}),n(m=>m&&{...m,word_count:h})}catch(h){console.error("Error updating post:",h),c({title:"Save Failed",description:"Failed to save the blog post.",variant:"destructive"})}finally{l(!1)}},A=(h,f)=>{n(m=>m&&{...m,[h]:f})};return i?a.jsx("div",{className:"max-w-4xl mx-auto",children:a.jsx(El,{message:"Loading blog post..."})}):r?a.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>t("/dashboard"),children:[a.jsx(Cl,{className:"h-4 w-4 mr-2"}),"Back to Library"]}),a.jsx("div",{className:"flex-1"}),a.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>t(`/dashboard/view/${r.id}`),children:[a.jsx(Zh,{className:"h-4 w-4 mr-2"}),"Preview"]}),a.jsx(ve,{size:"sm",onClick:d,disabled:o,className:"bg-primary hover:bg-primary/90",children:o?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Saving..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Mh,{className:"h-4 w-4 mr-2"}),"Save Changes"]})})]}),a.jsxs(_e,{children:[a.jsxs(ot,{children:[a.jsx(lt,{children:"Edit Blog Post"}),a.jsx(Mr,{children:"Make changes to your blog post content and details"})]}),a.jsxs(Ge,{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"title",children:"Title"}),a.jsx(st,{id:"title",value:r.title,onChange:h=>A("title",h.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"topic",children:"Topic"}),a.jsx(st,{id:"topic",value:r.topic,onChange:h=>A("topic",h.target.value)})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"description",children:"Description"}),a.jsx(Zr,{id:"description",value:r.description||"",onChange:h=>A("description",h.target.value),rows:2})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"tone",children:"Tone"}),a.jsx(st,{id:"tone",value:r.tone||"",onChange:h=>A("tone",h.target.value),placeholder:"e.g., professional, casual"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"audience",children:"Target Audience"}),a.jsx(st,{id:"audience",value:r.audience||"",onChange:h=>A("audience",h.target.value),placeholder:"e.g., developers, marketers"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Word Count"}),a.jsx(st,{value:r.word_count||0,disabled:!0,className:"bg-muted"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"keywords",children:"Keywords (comma-separated)"}),a.jsx(st,{id:"keywords",value:r.keywords?r.keywords.join(", "):"",onChange:h=>A("keywords",h.target.value.split(",").map(f=>f.trim()).filter(f=>f)),placeholder:"keyword1, keyword2, keyword3"})]})]})]}),a.jsxs(_e,{children:[a.jsxs(ot,{children:[a.jsx(lt,{children:"Content"}),a.jsx(Mr,{children:"Edit your blog post content. The word count will be updated automatically when you save."})]}),a.jsx(Ge,{children:a.jsx(Zr,{value:r.content.replace(/<[^>]*>/g,""),onChange:h=>A("content",h.target.value),rows:20,className:"min-h-[500px]",placeholder:"Write your blog content here..."})})]})]}):a.jsx("div",{className:"max-w-4xl mx-auto space-y-6",children:a.jsx(_e,{className:"text-center py-12",children:a.jsxs(Ge,{children:[a.jsx("h3",{className:"font-semibold text-lg",children:"Blog post not found"}),a.jsx("p",{className:"text-muted-foreground",children:"The requested blog post could not be found."}),a.jsx(ve,{className:"mt-4",onClick:()=>t("/dashboard"),children:"Back to Library"})]})})})}function na(e){this.content=e}na.prototype={constructor:na,find:function(e){for(var t=0;t>1}};na.from=function(e){if(e instanceof na)return e;var t=[];if(e)for(var r in e)t.push(r,e[r]);return new na(t)};function cce(e,t,r){for(let n=0;;n++){if(n==e.childCount||n==t.childCount)return e.childCount==t.childCount?null:r;let i=e.child(n),s=t.child(n);if(i==s){r+=i.nodeSize;continue}if(!i.sameMarkup(s))return r;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)r++;return r}if(i.content.size||s.content.size){let o=cce(i.content,s.content,r+1);if(o!=null)return o}r+=i.nodeSize}}function uce(e,t,r,n){for(let i=e.childCount,s=t.childCount;;){if(i==0||s==0)return i==s?null:{a:r,b:n};let o=e.child(--i),l=t.child(--s),c=o.nodeSize;if(o==l){r-=c,n-=c;continue}if(!o.sameMarkup(l))return{a:r,b:n};if(o.isText&&o.text!=l.text){let u=0,d=Math.min(o.text.length,l.text.length);for(;ut&&n(c,i+l,s||null,o)!==!1&&c.content.size){let d=l+1;c.nodesBetween(Math.max(0,t-d),Math.min(c.content.size,r-d),n,i+d)}l=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,r,n,i){let s="",o=!0;return this.nodesBetween(t,r,(l,c)=>{let u=l.isText?l.text.slice(Math.max(t,c)-c,r-c):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&n&&(o?o=!1:s+=n),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let r=this.lastChild,n=t.firstChild,i=this.content.slice(),s=0;for(r.isText&&r.sameMarkup(n)&&(i[i.length-1]=r.withText(r.text+n.text),s=1);st)for(let s=0,o=0;ot&&((or)&&(l.isText?l=l.cut(Math.max(0,t-o),Math.min(l.text.length,r-o)):l=l.cut(Math.max(0,t-o-1),Math.min(l.content.size,r-o-1))),n.push(l),i+=l.nodeSize),o=c}return new Je(n,i)}cutByIndex(t,r){return t==r?Je.empty:t==0&&r==this.content.length?this:new Je(this.content.slice(t,r))}replaceChild(t,r){let n=this.content[t];if(n==r)return this;let i=this.content.slice(),s=this.size+r.nodeSize-n.nodeSize;return i[t]=r,new Je(i,s)}addToStart(t){return new Je([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Je(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let r=0;rthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,n=0;;r++){let i=this.child(r),s=n+i.nodeSize;if(s>=t)return s==t?hj(r+1,s):hj(r,n);n=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,r){if(!r)return Je.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new Je(r.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Je.empty;let r,n=0;for(let i=0;ithis.type.rank&&(r||(r=t.slice(0,i)),r.push(this),n=!0),r&&r.push(s)}}return r||(r=t.slice()),n||r.push(this),r}removeFromSet(t){for(let r=0;rn.type.rank-i.type.rank),r}};On.none=[];class h_ extends Error{}class vt{constructor(t,r,n){this.content=t,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,r){let n=Ace(this.content,t+this.openStart,r);return n&&new vt(n,this.openStart,this.openEnd)}removeBetween(t,r){return new vt(dce(this.content,t+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,r){if(!r)return vt.empty;let n=r.openStart||0,i=r.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new vt(Je.fromJSON(t,r.content),n,i)}static maxOpen(t,r=!0){let n=0,i=0;for(let s=t.firstChild;s&&!s.isLeaf&&(r||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=t.lastChild;s&&!s.isLeaf&&(r||!s.type.spec.isolating);s=s.lastChild)i++;return new vt(t,n,i)}}vt.empty=new vt(Je.empty,0,0);function dce(e,t,r){let{index:n,offset:i}=e.findIndex(t),s=e.maybeChild(n),{index:o,offset:l}=e.findIndex(r);if(i==t||s.isText){if(l!=r&&!e.child(o).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(r))}if(n!=o)throw new RangeError("Removing non-flat range");return e.replaceChild(n,s.copy(dce(s.content,t-i-1,r-i-1)))}function Ace(e,t,r,n){let{index:i,offset:s}=e.findIndex(t),o=e.maybeChild(i);if(s==t||o.isText)return n&&!n.canReplace(i,i,r)?null:e.cut(0,t).append(r).append(e.cut(t));let l=Ace(o.content,t-s-1,r,o);return l&&e.replaceChild(i,o.copy(l))}function XIe(e,t,r){if(r.openStart>e.depth)throw new h_("Inserted content deeper than insertion position");if(e.depth-r.openStart!=t.depth-r.openEnd)throw new h_("Inconsistent open depths");return fce(e,t,r,0)}function fce(e,t,r,n){let i=e.index(n),s=e.node(n);if(i==t.index(n)&&n=0&&e.isText&&e.sameMarkup(t[r])?t[r]=e.withText(t[r].text+e.text):t.push(e)}function Ww(e,t,r,n){let i=(t||e).node(r),s=0,o=t?t.index(r):i.childCount;e&&(s=e.index(r),e.depth>r?s++:e.textOffset&&(Om(e.nodeAfter,n),s++));for(let l=s;li&&hL(e,t,i+1),o=n.depth>i&&hL(r,n,i+1),l=[];return Ww(null,e,i,l),s&&o&&t.index(i)==r.index(i)?(hce(s,o),Om(Fm(s,pce(e,t,r,n,i+1)),l)):(s&&Om(Fm(s,p_(e,t,i+1)),l),Ww(t,r,i,l),o&&Om(Fm(o,p_(r,n,i+1)),l)),Ww(n,null,i,l),new Je(l)}function p_(e,t,r){let n=[];if(Ww(null,e,r,n),e.depth>r){let i=hL(e,t,r+1);Om(Fm(i,p_(e,t,r+1)),n)}return Ww(t,null,r,n),new Je(n)}function YIe(e,t){let r=t.depth-e.openStart,i=t.node(r).copy(e.content);for(let s=r-1;s>=0;s--)i=t.node(s).copy(Je.from(i));return{start:i.resolveNoCache(e.openStart+r),end:i.resolveNoCache(i.content.size-e.openEnd-r)}}class t2{constructor(t,r,n){this.pos=t,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,r=this.index(this.depth);if(r==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=t.child(r);return n?t.child(r).cut(n):i}get nodeBefore(){let t=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(t).cut(0,r):t==0?null:this.parent.child(t-1)}posAtIndex(t,r){r=this.resolveDepth(r);let n=this.path[r*3],i=r==0?0:this.path[r*3-1]+1;for(let s=0;s0;r--)if(this.start(r)<=t&&this.end(r)>=t)return r;return 0}blockRange(t=this,r){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!r||r(this.node(n))))return new m_(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&r<=t.content.size))throw new RangeError("Position "+r+" out of range");let n=[],i=0,s=r;for(let o=t;;){let{index:l,offset:c}=o.content.findIndex(s),u=s-c;if(n.push(o,l,i+c),!u||(o=o.child(l),o.isText))break;s=u-1,i+=c+1}return new t2(r,n,s)}static resolveCached(t,r){let n=S9.get(t);if(n)for(let s=0;st&&this.nodesBetween(t,r,s=>(n.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),mce(this.marks,t)}contentMatchAt(t){let r=this.type.contentMatch.matchFragment(this.content,0,t);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(t,r,n=Je.empty,i=0,s=n.childCount){let o=this.contentMatchAt(t).matchFragment(n,i,s),l=o&&o.matchFragment(this.content,r);if(!l||!l.validEnd)return!1;for(let c=i;cr.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let t={type:this.type.name};for(let r in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(r=>r.toJSON())),t}static fromJSON(t,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(t.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(r.text,n)}let i=Je.fromJSON(t,r.content),s=t.nodeType(r.type).create(r.attrs,i,n);return s.type.checkAttrs(s.attrs),s}};Nh.prototype.text=void 0;class g_ extends Nh{constructor(t,r,n,i){if(super(t,r,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):mce(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,r){return this.text.slice(t,r)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new g_(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new g_(this.type,this.attrs,t,this.marks)}cut(t=0,r=this.text.length){return t==0&&r==this.text.length?this:this.withText(this.text.slice(t,r))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function mce(e,t){for(let r=e.length-1;r>=0;r--)t=e[r].type.name+"("+t+")";return t}class cg{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,r){let n=new t3e(t,r);if(n.next==null)return cg.empty;let i=gce(n);n.next&&n.err("Unexpected trailing text");let s=l3e(o3e(i));return c3e(s,n),s}matchType(t){for(let r=0;ru.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function r(n){t.push(n);for(let i=0;i{let s=i+(n.validEnd?"*":" ")+" ";for(let o=0;o"+t.indexOf(n.next[o].next);return s}).join(` `)}}cg.empty=new cg(!0);class t3e{constructor(t,r){this.string=t,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function gce(e){let t=[];do t.push(r3e(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function r3e(e){let t=[];do t.push(n3e(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function n3e(e){let t=a3e(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=i3e(e,t);else break;return t}function B9(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function i3e(e,t){let r=B9(e),n=r;return e.eat(",")&&(e.next!="}"?n=B9(e):n=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:t}}function s3e(e,t){let r=e.nodeTypes,n=r[t];if(n)return[n];let i=[];for(let s in r){let o=r[s];o.isInGroup(t)&&i.push(o)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function a3e(e){if(e.eat("(")){let t=gce(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=s3e(e,e.next).map(r=>(e.inline==null?e.inline=r.isInline:e.inline!=r.isInline&&e.err("Mixing inline and block content"),{type:"name",value:r}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function o3e(e){let t=[[]];return i(s(e,0),r()),t;function r(){return t.push([])-1}function n(o,l,c){let u={term:c,to:l};return t[o].push(u),u}function i(o,l){o.forEach(c=>c.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((c,u)=>c.concat(s(u,l)),[]);if(o.type=="seq")for(let c=0;;c++){let u=s(o.exprs[c],l);if(c==o.exprs.length-1)return u;i(u,l=r())}else if(o.type=="star"){let c=r();return n(l,c),i(s(o.expr,c),c),[n(c)]}else if(o.type=="plus"){let c=r();return i(s(o.expr,l),c),i(s(o.expr,c),c),[n(c)]}else{if(o.type=="opt")return[n(l)].concat(s(o.expr,l));if(o.type=="range"){let c=l;for(let u=0;u{e[o].forEach(({term:l,to:c})=>{if(!l)return;let u;for(let d=0;d{u||i.push([l,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let s=t[n.join(",")]=new cg(n.indexOf(e.length-1)>-1);for(let o=0;o-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:yce(this.attrs,t)}create(t=null,r,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Nh(this,this.computeAttrs(t),Je.from(r),On.setFrom(n))}createChecked(t=null,r,n){return r=Je.from(r),this.checkContent(r),new Nh(this,this.computeAttrs(t),r,On.setFrom(n))}createAndFill(t=null,r,n){if(t=this.computeAttrs(t),r=Je.from(r),r.size){let o=this.contentMatch.fillBefore(r);if(!o)return null;r=o.append(r)}let i=this.contentMatch.matchFragment(r),s=i&&i.fillBefore(Je.empty,!0);return s?new Nh(this,t,r.append(s),On.setFrom(n)):null}validContent(t){let r=this.contentMatch.matchFragment(t);if(!r||!r.validEnd)return!1;for(let n=0;n-1}allowsMarks(t){if(this.markSet==null)return!0;for(let r=0;rn[s]=new Cce(s,r,o));let i=r.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let s in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function u3e(e,t,r){let n=r.split("|");return i=>{let s=i===null?"null":typeof i;if(n.indexOf(s)<0)throw new RangeError(`Expected value of type ${n} for attribute ${t} on type ${e}, got ${s}`)}}class d3e{constructor(t,r,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?u3e(t,r,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class TE{constructor(t,r,n,i){this.name=t,this.rank=r,this.schema=n,this.spec=i,this.attrs=wce(t,i.attrs),this.excluded=null;let s=xce(this.attrs);this.instance=s?new On(this,s):null}create(t=null){return!t&&this.instance?this.instance:new On(this,yce(this.attrs,t))}static compile(t,r){let n=Object.create(null),i=0;return t.forEach((s,o)=>n[s]=new TE(s,i++,r,o)),n}removeFromSet(t){for(var r=0;r-1}}class Nce{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let r=this.spec={};for(let i in t)r[i]=t[i];r.nodes=na.from(t.nodes),r.marks=na.from(t.marks||{}),this.nodes=k9.compile(this.spec.nodes,this),this.marks=TE.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=n[o]||(n[o]=cg.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?E9(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:E9(this,o.split(" "))}this.nodeFromJSON=i=>Nh.fromJSON(this,i),this.markFromJSON=i=>On.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,r=null,n,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof k9){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(r,n,i)}text(t,r){let n=this.nodes.text;return new g_(n,n.defaultAttrs,t,On.setFrom(r))}mark(t,r){return typeof t=="string"&&(t=this.marks[t]),t.create(r)}nodeType(t){let r=this.nodes[t];if(!r)throw new RangeError("Unknown node type: "+t);return r}}function E9(e,t){let r=[];for(let n=0;n-1)&&r.push(o=c)}if(!o)throw new SyntaxError("Unknown mark type: '"+t[n]+"'")}return r}function A3e(e){return e.tag!=null}function f3e(e){return e.style!=null}class jh{constructor(t,r){this.schema=t,this.rules=r,this.tags=[],this.styles=[];let n=this.matchedStyles=[];r.forEach(i=>{if(A3e(i))this.tags.push(i);else if(f3e(i)){let s=/[^=]*/.exec(i.style)[0];n.indexOf(s)<0&&n.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=t.nodes[i.node];return s.contentMatch.matchType(s)})}parse(t,r={}){let n=new P9(this,r,!1);return n.addAll(t,On.none,r.from,r.to),n.finish()}parseSlice(t,r={}){let n=new P9(this,r,!0);return n.addAll(t,On.none,r.from,r.to),vt.maxOpen(n.finish())}matchTag(t,r,n){for(let i=n?this.tags.indexOf(n)+1:0;it.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=r))){if(o.getAttrs){let c=o.getAttrs(r);if(c===!1)continue;o.attrs=c||void 0}return o}}}static schemaRules(t){let r=[];function n(i){let s=i.priority==null?50:i.priority,o=0;for(;o{n(o=I9(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in t.nodes){let s=t.nodes[i].spec.parseDOM;s&&s.forEach(o=>{n(o=I9(o)),o.node||o.ignore||o.mark||(o.node=i)})}return r}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new jh(t,jh.schemaRules(t)))}}const jce={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},h3e={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Sce={ol:!0,ul:!0},r2=1,mL=2,Gw=4;function T9(e,t,r){return t!=null?(t?r2:0)|(t==="full"?mL:0):e&&e.whitespace=="pre"?r2|mL:r&~Gw}class pj{constructor(t,r,n,i,s,o){this.type=t,this.attrs=r,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=On.none,this.match=s||(o&Gw?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(Je.from(t));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(t.type))?(this.match=n,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&r2)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let s=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let r=Je.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(Je.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!jce.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class P9{constructor(t,r,n){this.parser=t,this.options=r,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=r.topNode,s,o=T9(null,r.preserveWhitespace,0)|(n?Gw:0);i?s=new pj(i.type,i.attrs,On.none,!0,r.topMatch||i.type.contentMatch,o):n?s=new pj(null,null,On.none,!0,null,o):s=new pj(t.schema.topNodeType,null,On.none,!0,null,o),this.nodes=[s],this.find=r.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,r){t.nodeType==3?this.addTextNode(t,r):t.nodeType==1&&this.addElement(t,r)}addTextNode(t,r){let n=t.nodeValue,i=this.top,s=i.options&mL?"full":this.localPreserveWS||(i.options&r2)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(s)if(s==="full")n=n.replace(/\r\n?/g,` `);else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=n.split(/\r?\n|\r/);for(let c=0;c!c.clearMark(u)):r=r.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return r}addElementByRule(t,r,n,i){let s,o;if(r.node)if(o=this.parser.schema.nodes[r.node],o.isLeaf)this.insertNode(o.create(r.attrs),n,t.nodeName=="BR")||this.leafFallback(t,n);else{let c=this.enter(o,r.attrs||null,n,r.preserveWhitespace);c&&(s=!0,n=c)}else{let c=this.parser.schema.marks[r.mark];n=n.concat(c.create(r.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(t);else if(i)this.addElement(t,n,i);else if(r.getContent)this.findInside(t),r.getContent(t,this.parser.schema).forEach(c=>this.insertNode(c,n,!1));else{let c=t;typeof r.contentElement=="string"?c=t.querySelector(r.contentElement):typeof r.contentElement=="function"?c=r.contentElement(t):r.contentElement&&(c=r.contentElement),this.findAround(t,c,!0),this.addAll(c,n),this.findAround(t,c,!1)}s&&this.sync(l)&&this.open--}addAll(t,r,n,i){let s=n||0;for(let o=n?t.childNodes[n]:t.firstChild,l=i==null?null:t.childNodes[i];o!=l;o=o.nextSibling,++s)this.findAtPoint(t,s),this.addDOM(o,r);this.findAtPoint(t,s)}findPlace(t,r,n){let i,s;for(let o=this.open,l=0;o>=0;o--){let c=this.nodes[o],u=c.findWrapping(t);if(u&&(!i||i.length>u.length+l)&&(i=u,s=c,!u.length))break;if(c.solid){if(n)break;l+=2}}if(!i)return null;this.sync(s);for(let o=0;o(o.type?o.type.allowsMarkType(u.type):O9(u.type,t))?(c=u.addToSet(c),!1):!0),this.nodes.push(new pj(t,r,c,i,null,l)),this.open++,n}closeExtra(t=!1){let r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let r=this.open;r>=0;r--){if(this.nodes[r]==t)return this.open=r,!0;this.localPreserveWS&&(this.nodes[r].options|=r2)}return!1}get currentPos(){this.closeExtra();let t=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let i=n.length-1;i>=0;i--)t+=n[i].nodeSize;r&&t++}return t}findAtPoint(t,r){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let r=t.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),s=-(n?n.depth+1:0)+(i?0:1),o=(l,c)=>{for(;l>=0;l--){let u=r[l];if(u==""){if(l==r.length-1||l==0)continue;for(;c>=s;c--)if(o(l-1,c))return!0;return!1}else{let d=c>0||c==0&&i?this.nodes[c].type:n&&c>=s?n.node(c-s).type:null;if(!d||d.name!=u&&!d.isInGroup(u))return!1;c--}}return!0};return o(r.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let r=t.depth;r>=0;r--){let n=t.node(r).contentMatchAt(t.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}}function p3e(e){for(let t=e.firstChild,r=null;t;t=t.nextSibling){let n=t.nodeType==1?t.nodeName.toLowerCase():null;n&&Sce.hasOwnProperty(n)&&r?(r.appendChild(t),t=r):n=="li"?r=t:n&&(r=null)}}function m3e(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function I9(e){let t={};for(let r in e)t[r]=e[r];return t}function O9(e,t){let r=t.schema.nodes;for(let n in r){let i=r[n];if(!i.allowsMarkType(e))continue;let s=[],o=l=>{s.push(l);for(let c=0;c{if(s.length||o.marks.length){let l=0,c=0;for(;l=0;i--){let s=this.serializeMark(t.marks[i],t.isInline,r);s&&((s.contentDOM||s.dom).appendChild(n),n=s.dom)}return n}serializeMark(t,r,n={}){let i=this.marks[t.type.name];return i&&GS(qP(n),i(t,r),null,t.attrs)}static renderSpec(t,r,n=null,i){return GS(t,r,n,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Fg(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let r=F9(t.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(t){return F9(t.marks)}}function F9(e){let t={};for(let r in e){let n=e[r].spec.toDOM;n&&(t[r]=n)}return t}function qP(e){return e.document||window.document}const L9=new WeakMap;function g3e(e){let t=L9.get(e);return t===void 0&&L9.set(e,t=v3e(e)),t}function v3e(e){let t=null;function r(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")t||(t=[]),t.push(n);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let l,c=r?e.createElementNS(r,i):e.createElement(i),u=t[1],d=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){d=2;for(let A in u)if(u[A]!=null){let h=A.indexOf(" ");h>0?c.setAttributeNS(A.slice(0,h),A.slice(h+1),u[A]):A=="style"&&c.style?c.style.cssText=u[A]:c.setAttribute(A,u[A])}}for(let A=d;Ad)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:f,contentDOM:m}=GS(e,h,r,n);if(c.appendChild(f),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:c,contentDOM:l}}const Bce=65535,_ce=Math.pow(2,16);function x3e(e,t){return e+t*_ce}function M9(e){return e&Bce}function y3e(e){return(e-(e&Bce))/_ce}const kce=1,Ece=2,KS=4,Tce=8;class gL{constructor(t,r,n){this.pos=t,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&Tce)>0}get deletedBefore(){return(this.delInfo&(kce|KS))>0}get deletedAfter(){return(this.delInfo&(Ece|KS))>0}get deletedAcross(){return(this.delInfo&KS)>0}}class cl{constructor(t,r=!1){if(this.ranges=t,this.inverted=r,!t.length&&cl.empty)return cl.empty}recover(t){let r=0,n=M9(t);if(!this.inverted)for(let i=0;it)break;let u=this.ranges[l+s],d=this.ranges[l+o],A=c+u;if(t<=A){let h=u?t==c?-1:t==A?1:r:r,f=c+i+(h<0?0:d);if(n)return f;let m=t==(r<0?c:A)?null:x3e(l/3,t-c),p=t==c?Ece:t==A?kce:KS;return(r<0?t!=c:t!=A)&&(p|=Tce),new gL(f,p,m)}i+=d-u}return n?t+i:new gL(t+i,0,null)}touches(t,r){let n=0,i=M9(r),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;lt)break;let u=this.ranges[l+s],d=c+u;if(t<=d&&l==i*3)return!0;n+=this.ranges[l+o]-u}return!1}forEach(t){let r=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,s=0;i=0;r--){let i=t.getMirror(r);this.appendMap(t._maps[r].invert(),i!=null&&i>r?n-i-1:void 0)}}invert(){let t=new n2;return t.appendMappingInverted(this),t}map(t,r=1){if(this.mirror)return this._map(t,r,!0);for(let n=this.from;ns&&c!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),r.openStart,r.openEnd);return us.fromReplace(t,this.from,this.to,s)}invert(){return new qc(this.from,this.to,this.mark)}map(t){let r=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new rh(r.pos,n.pos,this.mark)}merge(t){return t instanceof rh&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new rh(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new rh(r.from,r.to,t.markFromJSON(r.mark))}}Qa.jsonID("addMark",rh);class qc extends Qa{constructor(t,r,n){super(),this.from=t,this.to=r,this.mark=n}apply(t){let r=t.slice(this.from,this.to),n=new vt(ZU(r.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),r.openStart,r.openEnd);return us.fromReplace(t,this.from,this.to,n)}invert(){return new rh(this.from,this.to,this.mark)}map(t){let r=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new qc(r.pos,n.pos,this.mark)}merge(t){return t instanceof qc&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new qc(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new qc(r.from,r.to,t.markFromJSON(r.mark))}}Qa.jsonID("removeMark",qc);class nh extends Qa{constructor(t,r){super(),this.pos=t,this.mark=r}apply(t){let r=t.nodeAt(this.pos);if(!r)return us.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return us.fromReplace(t,this.pos,this.pos+1,new vt(Je.from(n),0,r.isLeaf?0:1))}invert(t){let r=t.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let i=0;in.pos?null:new $s(r.pos,n.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new $s(r.from,r.to,r.gapFrom,r.gapTo,vt.fromJSON(t,r.slice),r.insert,!!r.structure)}}Qa.jsonID("replaceAround",$s);function vL(e,t,r){let n=e.resolve(t),i=r-t,s=n.depth;for(;i>0&&s>0&&n.indexAfter(s)==n.node(s).childCount;)s--,i--;if(i>0){let o=n.node(s).maybeChild(n.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function b3e(e,t,r,n){let i=[],s=[],o,l;e.doc.nodesBetween(t,r,(c,u,d)=>{if(!c.isInline)return;let A=c.marks;if(!n.isInSet(A)&&d.type.allowsMarkType(n.type)){let h=Math.max(u,t),f=Math.min(u+c.nodeSize,r),m=n.addToSet(A);for(let p=0;pe.step(c)),s.forEach(c=>e.step(c))}function w3e(e,t,r,n){let i=[],s=0;e.doc.nodesBetween(t,r,(o,l)=>{if(!o.isInline)return;s++;let c=null;if(n instanceof TE){let u=o.marks,d;for(;d=n.isInSet(u);)(c||(c=[])).push(d),u=d.removeFromSet(u)}else n?n.isInSet(o.marks)&&(c=[n]):c=o.marks;if(c&&c.length){let u=Math.min(l+o.nodeSize,r);for(let d=0;de.step(new qc(o.from,o.to,o.style)))}function e8(e,t,r,n=r.contentMatch,i=!0){let s=e.doc.nodeAt(t),o=[],l=t+1;for(let c=0;c=0;c--)e.step(o[c])}function C3e(e,t,r){return(t==0||e.canReplace(t,e.childCount))&&(r==e.childCount||e.canReplace(0,r))}function D0(e){let r=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let i=e.$from.node(n),s=e.$from.index(n),o=e.$to.indexAfter(n);if(nr;m--)p||n.index(m)>0?(p=!0,d=Je.from(n.node(m).copy(d)),A++):c--;let h=Je.empty,f=0;for(let m=s,p=!1;m>r;m--)p||i.after(m+1)=0;o--){if(n.size){let l=r[o].type.contentMatch.matchFragment(n);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=Je.from(r[o].type.create(r[o].attrs,n))}let i=t.start,s=t.end;e.step(new $s(i,s,i,s,new vt(n,0,0),r.length,!0))}function _3e(e,t,r,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,r,(o,l)=>{let c=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,c)&&k3e(e.doc,e.mapping.slice(s).map(l),n)){let u=null;if(n.schema.linebreakReplacement){let f=n.whitespace=="pre",m=!!n.contentMatch.matchType(n.schema.linebreakReplacement);f&&!m?u=!1:!f&&m&&(u=!0)}u===!1&&Ice(e,o,l,s),e8(e,e.mapping.slice(s).map(l,1),n,void 0,u===null);let d=e.mapping.slice(s),A=d.map(l,1),h=d.map(l+o.nodeSize,1);return e.step(new $s(A,h,A+1,h-1,new vt(Je.from(n.create(c,null,o.marks)),0,0),1,!0)),u===!0&&Pce(e,o,l,s),!1}})}function Pce(e,t,r,n){t.forEach((i,s)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let c=e.mapping.slice(n).map(r+1+s+o.index);e.replaceWith(c,c+1,t.type.schema.linebreakReplacement.create())}}})}function Ice(e,t,r,n){t.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=e.mapping.slice(n).map(r+1+s);e.replaceWith(o,o+1,t.type.schema.text(` `))}})}function k3e(e,t,r){let n=e.resolve(t),i=n.index();return n.parent.canReplaceWith(i,i+1,r)}function E3e(e,t,r,n,i){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");r||(r=s.type);let o=r.create(n,null,i||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,o);if(!r.validContent(s.content))throw new RangeError("Invalid content for node type "+r.name);e.step(new $s(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new vt(Je.from(o),0,0),1,!0))}function Ux(e,t,r=1,n){let i=e.resolve(t),s=i.depth-r,o=n&&n[n.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,d=r-2;u>s;u--,d--){let A=i.node(u),h=i.index(u);if(A.type.spec.isolating)return!1;let f=A.content.cutByIndex(h,A.childCount),m=n&&n[d+1];m&&(f=f.replaceChild(0,m.type.create(m.attrs)));let p=n&&n[d]||A;if(!A.canReplace(h+1,A.childCount)||!p.type.validContent(f))return!1}let l=i.indexAfter(s),c=n&&n[0];return i.node(s).canReplaceWith(l,l,c?c.type:i.node(s+1).type)}function T3e(e,t,r=1,n){let i=e.doc.resolve(t),s=Je.empty,o=Je.empty;for(let l=i.depth,c=i.depth-r,u=r-1;l>c;l--,u--){s=Je.from(i.node(l).copy(s));let d=n&&n[u];o=Je.from(d?d.type.create(d.attrs,o):i.node(l).copy(o))}e.step(new Rs(t,t,new vt(s.append(o),r,r),!0))}function sp(e,t){let r=e.resolve(t),n=r.index();return Oce(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function P3e(e,t){t.content.size||e.type.compatibleContent(t.type);let r=e.contentMatchAt(e.childCount),{linebreakReplacement:n}=e.type.schema;for(let i=0;i0?(s=n.node(i+1),l++,o=n.node(i).maybeChild(l)):(s=n.node(i).maybeChild(l-1),o=n.node(i+1)),s&&!s.isTextblock&&Oce(s,o)&&n.node(i).canReplace(l,l+1))return t;if(i==0)break;t=r<0?n.before(i):n.after(i)}}function I3e(e,t,r){let n=null,{linebreakReplacement:i}=e.doc.type.schema,s=e.doc.resolve(t-r),o=s.node().type;if(i&&o.inlineContent){let d=o.whitespace=="pre",A=!!o.contentMatch.matchType(i);d&&!A?n=!1:!d&&A&&(n=!0)}let l=e.steps.length;if(n===!1){let d=e.doc.resolve(t+r);Ice(e,d.node(),d.before(),l)}o.inlineContent&&e8(e,t+r-1,o,s.node().contentMatchAt(s.index()),n==null);let c=e.mapping.slice(l),u=c.map(t-r);if(e.step(new Rs(u,c.map(t+r,-1),vt.empty,!0)),n===!0){let d=e.doc.resolve(u);Pce(e,d.node(),d.before(),e.steps.length)}return e}function O3e(e,t,r){let n=e.resolve(t);if(n.parent.canReplaceWith(n.index(),n.index(),r))return t;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let s=n.index(i);if(n.node(i).canReplaceWith(s,s,r))return n.before(i+1);if(s>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let s=n.indexAfter(i);if(n.node(i).canReplaceWith(s,s,r))return n.after(i+1);if(s=0;o--){let l=o==n.depth?0:n.pos<=(n.start(o+1)+n.end(o+1))/2?-1:1,c=n.index(o)+(l>0?1:0),u=n.node(o),d=!1;if(s==1)d=u.canReplace(c,c,i);else{let A=u.contentMatchAt(c).findWrapping(i.firstChild.type);d=A&&u.canReplaceWith(c,c,A[0])}if(d)return l==0?n.pos:l<0?n.before(o+1):n.after(o+1)}return null}function IE(e,t,r=t,n=vt.empty){if(t==r&&!n.size)return null;let i=e.resolve(t),s=e.resolve(r);return Lce(i,s,n)?new Rs(t,r,n):new F3e(i,s,n).fit()}function Lce(e,t,r){return!r.openStart&&!r.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),r.content)}class F3e{constructor(t,r,n){this.$from=t,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=Je.empty;for(let i=0;i<=t.depth;i++){let s=t.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=Je.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(t<0?this.$to:n.doc.resolve(t));if(!i)return null;let s=this.placed,o=n.depth,l=i.depth;for(;o&&l&&s.childCount==1;)s=s.firstChild.content,o--,l--;let c=new vt(s,o,l);return t>-1?new $s(n.pos,t,this.$to.pos,this.$to.end(),c,r):c.size||n.pos!=this.$to.pos?new Rs(n.pos,i.pos,c):null}findFittable(){let t=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,i=this.unplaced.openEnd;n1&&(i=0),s.type.spec.isolating&&i<=n){t=n;break}r=s.content}for(let r=1;r<=2;r++)for(let n=r==1?t:this.unplaced.openStart;n>=0;n--){let i,s=null;n?(s=YP(this.unplaced.content,n-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:c,match:u}=this.frontier[l],d,A=null;if(r==1&&(o?u.matchType(o.type)||(A=u.fillBefore(Je.from(o),!1)):s&&c.compatibleContent(s.type)))return{sliceDepth:n,frontierDepth:l,parent:s,inject:A};if(r==2&&o&&(d=u.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:l,parent:s,wrap:d};if(s&&u.matchType(s.type))break}}}openMore(){let{content:t,openStart:r,openEnd:n}=this.unplaced,i=YP(t,r);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new vt(t,r+1,Math.max(n,i.size+r>=t.size-n?r+1:0)),!0)}dropNode(){let{content:t,openStart:r,openEnd:n}=this.unplaced,i=YP(t,r);if(i.childCount<=1&&r>0){let s=t.size-r<=r+i.size;this.unplaced=new vt(pw(t,r-1,1),r-1,s?r-1:n)}else this.unplaced=new vt(pw(t,r,1),r,n)}placeNodes({sliceDepth:t,frontierDepth:r,parent:n,inject:i,wrap:s}){for(;this.depth>r;)this.closeFrontierNode();if(s)for(let p=0;p1||c==0||p.content.size)&&(A=g,d.push(Mce(p.mark(h.allowedMarks(p.marks)),u==1?c:0,u==l.childCount?f:-1)))}let m=u==l.childCount;m||(f=-1),this.placed=mw(this.placed,r,Je.from(d)),this.frontier[r].match=A,m&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let p=0,g=l;p1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(t){e:for(let r=Math.min(this.depth,t.depth);r>=0;r--){let{match:n,type:i}=this.frontier[r],s=r=0;l--){let{match:c,type:u}=this.frontier[l],d=JP(t,l,u,c,!0);if(!d||d.childCount)continue e}return{depth:r,fit:o,move:s?t.doc.resolve(t.after(r+1)):t}}}}close(t){let r=this.findCloseLevel(t);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=mw(this.placed,r.depth,r.fit)),t=r.move;for(let n=r.depth+1;n<=t.depth;n++){let i=t.node(n),s=i.type.contentMatch.fillBefore(i.content,!0,t.index(n));this.openFrontierNode(i.type,i.attrs,s)}return t}openFrontierNode(t,r=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=mw(this.placed,this.depth,Je.from(t.create(r,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(Je.empty,!0);r.childCount&&(this.placed=mw(this.placed,this.frontier.length,r))}}function pw(e,t,r){return t==0?e.cutByIndex(r,e.childCount):e.replaceChild(0,e.firstChild.copy(pw(e.firstChild.content,t-1,r)))}function mw(e,t,r){return t==0?e.append(r):e.replaceChild(e.childCount-1,e.lastChild.copy(mw(e.lastChild.content,t-1,r)))}function YP(e,t){for(let r=0;r1&&(n=n.replaceChild(0,Mce(n.firstChild,t-1,n.childCount==1?r-1:0))),t>0&&(n=e.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(e.type.contentMatch.matchFragment(n).fillBefore(Je.empty,!0)))),e.copy(n)}function JP(e,t,r,n,i){let s=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==s.childCount&&!r.compatibleContent(s.type))return null;let l=n.fillBefore(s.content,!0,o);return l&&!L3e(r,s.content,o)?l:null}function L3e(e,t,r){for(let n=r;n0;h--,f--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;o.indexOf(h)>-1?l=h:i.before(h)==f&&o.splice(1,0,-h)}let c=o.indexOf(l),u=[],d=n.openStart;for(let h=n.content,f=0;;f++){let m=h.firstChild;if(u.push(m),f==n.openStart)break;h=m.content}for(let h=d-1;h>=0;h--){let f=u[h],m=M3e(f.type);if(m&&!f.sameMarkup(i.node(Math.abs(l)-1)))d=h;else if(m||!f.type.isTextblock)break}for(let h=n.openStart;h>=0;h--){let f=(h+d+1)%(n.openStart+1),m=u[f];if(m)for(let p=0;p=0&&(e.replace(t,r,n),!(e.steps.length>A));h--){let f=o[h];f<0||(t=i.before(f),r=s.after(f))}}function Dce(e,t,r,n,i){if(tn){let s=i.contentMatchAt(0),o=s.fillBefore(e).append(e);e=o.append(s.matchFragment(o).fillBefore(Je.empty,!0))}return e}function R3e(e,t,r,n){if(!n.isInline&&t==r&&e.doc.resolve(t).parent.content.size){let i=O3e(e.doc,t,n.type);i!=null&&(t=r=i)}e.replaceRange(t,r,new vt(Je.from(n),0,0))}function U3e(e,t,r){let n=e.doc.resolve(t),i=e.doc.resolve(r),s=Rce(n,i);for(let o=0;o0&&(c||n.node(l-1).canReplace(n.index(l-1),i.indexAfter(l-1))))return e.delete(n.before(l),i.after(l))}for(let o=1;o<=n.depth&&o<=i.depth;o++)if(t-n.start(o)==n.depth-o&&r>n.end(o)&&i.end(o)-r!=i.depth-o&&n.start(o-1)==i.start(o-1)&&n.node(o-1).canReplace(n.index(o-1),i.index(o-1)))return e.delete(n.before(o),r);e.delete(t,r)}function Rce(e,t){let r=[],n=Math.min(e.depth,t.depth);for(let i=n;i>=0;i--){let s=e.start(i);if(st.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(s==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==s-1)&&r.push(i)}return r}class Qx extends Qa{constructor(t,r,n){super(),this.pos=t,this.attr=r,this.value=n}apply(t){let r=t.nodeAt(this.pos);if(!r)return us.fail("No node at attribute step's position");let n=Object.create(null);for(let s in r.attrs)n[s]=r.attrs[s];n[this.attr]=this.value;let i=r.type.create(n,null,r.marks);return us.fromReplace(t,this.pos,this.pos+1,new vt(Je.from(i),0,r.isLeaf?0:1))}getMap(){return cl.empty}invert(t){return new Qx(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let r=t.mapResult(this.pos,1);return r.deletedAfter?null:new Qx(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Qx(r.pos,r.attr,r.value)}}Qa.jsonID("attr",Qx);class i2 extends Qa{constructor(t,r){super(),this.attr=t,this.value=r}apply(t){let r=Object.create(null);for(let i in t.attrs)r[i]=t.attrs[i];r[this.attr]=this.value;let n=t.type.create(r,t.content,t.marks);return us.ok(n)}getMap(){return cl.empty}invert(t){return new i2(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new i2(r.attr,r.value)}}Qa.jsonID("docAttr",i2);let Ey=class extends Error{};Ey=function e(t){let r=Error.call(this,t);return r.__proto__=e.prototype,r};Ey.prototype=Object.create(Error.prototype);Ey.prototype.constructor=Ey;Ey.prototype.name="TransformError";class Uce{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new n2}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let r=this.maybeStep(t);if(r.failed)throw new Ey(r.failed);return this}maybeStep(t){let r=t.apply(this.doc);return r.failed||this.addStep(t,r.doc),r}get docChanged(){return this.steps.length>0}addStep(t,r){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=r}replace(t,r=t,n=vt.empty){let i=IE(this.doc,t,r,n);return i&&this.step(i),this}replaceWith(t,r,n){return this.replace(t,r,new vt(Je.from(n),0,0))}delete(t,r){return this.replace(t,r,vt.empty)}insert(t,r){return this.replaceWith(t,t,r)}replaceRange(t,r,n){return D3e(this,t,r,n),this}replaceRangeWith(t,r,n){return R3e(this,t,r,n),this}deleteRange(t,r){return U3e(this,t,r),this}lift(t,r){return N3e(this,t,r),this}join(t,r=1){return I3e(this,t,r),this}wrap(t,r){return B3e(this,t,r),this}setBlockType(t,r=t,n,i=null){return _3e(this,t,r,n,i),this}setNodeMarkup(t,r,n=null,i){return E3e(this,t,r,n,i),this}setNodeAttribute(t,r,n){return this.step(new Qx(t,r,n)),this}setDocAttribute(t,r){return this.step(new i2(t,r)),this}addNodeMark(t,r){return this.step(new nh(t,r)),this}removeNodeMark(t,r){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(r instanceof On)r.isInSet(n.marks)&&this.step(new ug(t,r));else{let i=n.marks,s,o=[];for(;s=r.isInSet(i);)o.push(new ug(t,s)),i=s.removeFromSet(i);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(t,r=1,n){return T3e(this,t,r,n),this}addMark(t,r,n){return b3e(this,t,r,n),this}removeMark(t,r,n){return w3e(this,t,r,n),this}clearIncompatible(t,r,n){return e8(this,t,r,n),this}}const ZP=Object.create(null);class Ir{constructor(t,r,n){this.$anchor=t,this.$head=r,this.ranges=n||[new Q3e(t.min(r),t.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let r=0;r=0;s--){let o=r<0?Gv(t.node(0),t.node(s),t.before(s+1),t.index(s),r,n):Gv(t.node(0),t.node(s),t.after(s+1),t.index(s)+1,r,n);if(o)return o}return null}static near(t,r=1){return this.findFrom(t,r)||this.findFrom(t,-r)||new uc(t.node(0))}static atStart(t){return Gv(t,t,0,0,1)||new uc(t)}static atEnd(t){return Gv(t,t,t.content.size,t.childCount,-1)||new uc(t)}static fromJSON(t,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=ZP[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(t,r)}static jsonID(t,r){if(t in ZP)throw new RangeError("Duplicate use of selection JSON ID "+t);return ZP[t]=r,r.prototype.jsonID=t,r}getBookmark(){return gr.between(this.$anchor,this.$head).getBookmark()}}Ir.prototype.visible=!0;class Q3e{constructor(t,r){this.$from=t,this.$to=r}}let R9=!1;function U9(e){!R9&&!e.parent.inlineContent&&(R9=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class gr extends Ir{constructor(t,r=t){U9(t),U9(r),super(t,r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,r){let n=t.resolve(r.map(this.head));if(!n.parent.inlineContent)return Ir.near(n);let i=t.resolve(r.map(this.anchor));return new gr(i.parent.inlineContent?i:n,n)}replace(t,r=vt.empty){if(super.replace(t,r),r==vt.empty){let n=this.$from.marksAcross(this.$to);n&&t.ensureMarks(n)}}eq(t){return t instanceof gr&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new OE(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new gr(t.resolve(r.anchor),t.resolve(r.head))}static create(t,r,n=r){let i=t.resolve(r);return new this(i,n==r?i:t.resolve(n))}static between(t,r,n){let i=t.pos-r.pos;if((!n||i)&&(n=i>=0?1:-1),!r.parent.inlineContent){let s=Ir.findFrom(r,n,!0)||Ir.findFrom(r,-n,!0);if(s)r=s.$head;else return Ir.near(r,n)}return t.parent.inlineContent||(i==0?t=r:(t=(Ir.findFrom(t,-n,!0)||Ir.findFrom(t,n,!0)).$anchor,t.pos0?0:1);i>0?o=0;o+=i){let l=t.child(o);if(l.isAtom){if(!s&&Yt.isSelectable(l))return Yt.create(e,r-(i<0?l.nodeSize:0))}else{let c=Gv(e,l,r+i,i<0?l.childCount:0,i,s);if(c)return c}r+=l.nodeSize*i}return null}function Q9(e,t,r){let n=e.steps.length-1;if(n{o==null&&(o=d)}),e.setSelection(Ir.near(e.doc.resolve(o),r))}const H9=1,mj=2,$9=4;class $3e extends Uce{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=mj,this}ensureMarks(t){return On.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&mj)>0}addStep(t,r){super.addStep(t,r),this.updated=this.updated&~mj,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,r=!0){let n=this.selection;return r&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||On.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,r,n){let i=this.doc.type.schema;if(r==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(n==null&&(n=r),!t)return this.deleteRange(r,n);let s=this.storedMarks;if(!s){let o=this.doc.resolve(r);s=n==r?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(r,n,i.text(t,s)),!this.selection.empty&&this.selection.to==r+t.length&&this.setSelection(Ir.near(this.selection.$to)),this}}setMeta(t,r){return this.meta[typeof t=="string"?t:t.key]=r,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=$9,this}get scrolledIntoView(){return(this.updated&$9)>0}}function z9(e,t){return!t||!e?e:e.bind(t)}class gw{constructor(t,r,n){this.name=t,this.init=z9(r.init,n),this.apply=z9(r.apply,n)}}const z3e=[new gw("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new gw("selection",{init(e,t){return e.selection||Ir.atStart(t.doc)},apply(e){return e.selection}}),new gw("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,r,n){return n.selection.$cursor?e.storedMarks:null}}),new gw("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class eI{constructor(t,r){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=z3e.slice(),r&&r.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new gw(n.key,n.spec.state,n))})}}class Ax{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,r=-1){for(let n=0;nn.toJSON())),t&&typeof t=="object")for(let n in t){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[n],s=i.spec.state;s&&s.toJSON&&(r[n]=s.toJSON.call(i,this[i.key]))}return r}static fromJSON(t,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new eI(t.schema,t.plugins),s=new Ax(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=Nh.fromJSON(t.schema,r.doc);else if(o.name=="selection")s.selection=Ir.fromJSON(s.doc,r.selection);else if(o.name=="storedMarks")r.storedMarks&&(s.storedMarks=r.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let l in n){let c=n[l],u=c.spec.state;if(c.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(r,l)){s[o.name]=u.fromJSON.call(c,t,r[l],s);return}}s[o.name]=o.init(t,s)}}),s}}function Qce(e,t,r){for(let n in e){let i=e[n];i instanceof Function?i=i.bind(t):n=="handleDOMEvents"&&(i=Qce(i,t,{})),r[n]=i}return r}class Ri{constructor(t){this.spec=t,this.props={},t.props&&Qce(t.props,this,this.props),this.key=t.key?t.key.key:Hce("plugin")}getState(t){return t[this.key]}}const tI=Object.create(null);function Hce(e){return e in tI?e+"$"+ ++tI[e]:(tI[e]=0,e+"$")}class Ks{constructor(t="key"){this.key=Hce(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const W3e=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function $ce(e,t){let{$cursor:r}=e.selection;return!r||(t?!t.endOfTextblock("backward",e):r.parentOffset>0)?null:r}const G3e=(e,t,r)=>{let n=$ce(e,r);if(!n)return!1;let i=n8(n);if(!i){let o=n.blockRange(),l=o&&D0(o);return l==null?!1:(t&&t(e.tr.lift(o,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(Kce(e,i,t,-1))return!0;if(n.parent.content.size==0&&(Ty(s,"end")||Yt.isSelectable(s)))for(let o=n.depth;;o--){let l=IE(e.doc,n.before(o),n.after(o),vt.empty);if(l&&l.slice.size1)break}return s.isAtom&&i.depth==n.depth-1?(t&&t(e.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},K3e=(e,t,r)=>{let n=$ce(e,r);if(!n)return!1;let i=n8(n);return i?zce(e,i,t):!1},V3e=(e,t,r)=>{let n=Wce(e,r);if(!n)return!1;let i=i8(n);return i?zce(e,i,t):!1};function zce(e,t,r){let n=t.nodeBefore,i=n,s=t.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let d=i.lastChild;if(!d)return!1;i=d}let o=t.nodeAfter,l=o,c=t.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let d=l.firstChild;if(!d)return!1;l=d}let u=IE(e.doc,s,c,vt.empty);if(!u||u.from!=s||u instanceof Rs&&u.slice.size>=c-s)return!1;if(r){let d=e.tr.step(u);d.setSelection(gr.create(d.doc,s)),r(d.scrollIntoView())}return!0}function Ty(e,t,r=!1){for(let n=e;n;n=t=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(r&&n.childCount!=1)return!1}return!1}const q3e=(e,t,r)=>{let{$head:n,empty:i}=e.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",e):n.parentOffset>0)return!1;s=n8(n)}let o=s&&s.nodeBefore;return!o||!Yt.isSelectable(o)?!1:(t&&t(e.tr.setSelection(Yt.create(e.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function n8(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Wce(e,t){let{$cursor:r}=e.selection;return!r||(t?!t.endOfTextblock("forward",e):r.parentOffset{let n=Wce(e,r);if(!n)return!1;let i=i8(n);if(!i)return!1;let s=i.nodeAfter;if(Kce(e,i,t,1))return!0;if(n.parent.content.size==0&&(Ty(s,"start")||Yt.isSelectable(s))){let o=IE(e.doc,n.before(),n.after(),vt.empty);if(o&&o.slice.size{let{$head:n,empty:i}=e.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",e):n.parentOffset=0;t--){let r=e.node(t);if(e.index(t)+1{let r=e.selection,n=r instanceof Yt,i;if(n){if(r.node.isTextblock||!sp(e.doc,r.from))return!1;i=r.from}else if(i=PE(e.doc,r.from,-1),i==null)return!1;if(t){let s=e.tr.join(i);n&&s.setSelection(Yt.create(s.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(s.scrollIntoView())}return!0},Z3e=(e,t)=>{let r=e.selection,n;if(r instanceof Yt){if(r.node.isTextblock||!sp(e.doc,r.to))return!1;n=r.to}else if(n=PE(e.doc,r.to,1),n==null)return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0},eOe=(e,t)=>{let{$from:r,$to:n}=e.selection,i=r.blockRange(n),s=i&&D0(i);return s==null?!1:(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)},tOe=(e,t)=>{let{$head:r,$anchor:n}=e.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(t&&t(e.tr.insertText(` `).scrollIntoView()),!0)};function Gce(e){for(let t=0;t{let{$head:r,$anchor:n}=e.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let i=r.node(-1),s=r.indexAfter(-1),o=Gce(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(t){let l=r.after(),c=e.tr.replaceWith(l,l,o.createAndFill());c.setSelection(Ir.near(c.doc.resolve(l),1)),t(c.scrollIntoView())}return!0},nOe=(e,t)=>{let r=e.selection,{$from:n,$to:i}=r;if(r instanceof uc||n.parent.inlineContent||i.parent.inlineContent)return!1;let s=Gce(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let o=(!n.parentOffset&&i.index(){let{$cursor:r}=e.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let s=r.before();if(Ux(e.doc,s))return t&&t(e.tr.split(s).scrollIntoView()),!0}let n=r.blockRange(),i=n&&D0(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)},sOe=(e,t)=>{let{$from:r,to:n}=e.selection,i,s=r.sharedDepth(n);return s==0?!1:(i=r.before(s),t&&t(e.tr.setSelection(Yt.create(e.doc,i))),!0)};function aOe(e,t,r){let n=t.nodeBefore,i=t.nodeAfter,s=t.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&t.parent.canReplace(s-1,s)?(r&&r(e.tr.delete(t.pos-n.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(s,s+1)||!(i.isTextblock||sp(e.doc,t.pos))?!1:(r&&r(e.tr.join(t.pos).scrollIntoView()),!0)}function Kce(e,t,r,n){let i=t.nodeBefore,s=t.nodeAfter,o,l,c=i.type.spec.isolating||s.type.spec.isolating;if(!c&&aOe(e,t,r))return!0;let u=!c&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(o=(l=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&l.matchType(o[0]||s.type).validEnd){if(r){let f=t.pos+s.nodeSize,m=Je.empty;for(let v=o.length-1;v>=0;v--)m=Je.from(o[v].create(null,m));m=Je.from(i.copy(m));let p=e.tr.step(new $s(t.pos-1,f,t.pos,f,new vt(m,1,0),o.length,!0)),g=p.doc.resolve(f+2*o.length);g.nodeAfter&&g.nodeAfter.type==i.type&&sp(p.doc,g.pos)&&p.join(g.pos),r(p.scrollIntoView())}return!0}let d=s.type.spec.isolating||n>0&&c?null:Ir.findFrom(t,1),A=d&&d.$from.blockRange(d.$to),h=A&&D0(A);if(h!=null&&h>=t.depth)return r&&r(e.tr.lift(A,h).scrollIntoView()),!0;if(u&&Ty(s,"start",!0)&&Ty(i,"end")){let f=i,m=[];for(;m.push(f),!f.isTextblock;)f=f.lastChild;let p=s,g=1;for(;!p.isTextblock;p=p.firstChild)g++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(r){let v=Je.empty;for(let y=m.length-1;y>=0;y--)v=Je.from(m[y].copy(v));let x=e.tr.step(new $s(t.pos-m.length,t.pos+s.nodeSize,t.pos+g,t.pos+s.nodeSize-g,new vt(v,m.length,0),0,!0));r(x.scrollIntoView())}return!0}}return!1}function Vce(e){return function(t,r){let n=t.selection,i=e<0?n.$from:n.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(r&&r(t.tr.setSelection(gr.create(t.doc,e<0?i.start(s):i.end(s)))),!0):!1}}const oOe=Vce(-1),lOe=Vce(1);function cOe(e,t=null){return function(r,n){let{$from:i,$to:s}=r.selection,o=i.blockRange(s),l=o&&t8(o,e,t);return l?(n&&n(r.tr.wrap(o,l).scrollIntoView()),!0):!1}}function W9(e,t=null){return function(r,n){let i=!1;for(let s=0;s{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(e,t)))if(c.type==e)i=!0;else{let d=r.doc.resolve(u),A=d.index();i=d.parent.canReplaceWith(A,A+1,e)}})}if(!i)return!1;if(n){let s=r.tr;for(let o=0;o=2&&t.$from.node(t.depth-1).type.compatibleContent(r)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let c=o.resolve(t.start-2);s=new m_(c,c,t.depth),t.endIndex=0;d--)s=Je.from(r[d].type.create(r[d].attrs,s));e.step(new $s(t.start-(n?2:0),t.end,t.start,t.end,new vt(s,0,0),r.length,!0));let o=0;for(let d=0;do.childCount>0&&o.firstChild.type==e);return s?r?n.node(s.depth-1).type==e?hOe(t,r,e,s):pOe(t,r,s):!0:!1}}function hOe(e,t,r,n){let i=e.tr,s=n.end,o=n.$to.end(n.depth);sp;m--)f-=i.child(m).nodeSize,n.delete(f-1,f+1);let s=n.doc.resolve(r.start),o=s.nodeAfter;if(n.mapping.map(r.end)!=r.start+s.nodeAfter.nodeSize)return!1;let l=r.startIndex==0,c=r.endIndex==i.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(l?0:1),d+1,o.content.append(c?Je.empty:Je.from(i))))return!1;let A=s.pos,h=A+o.nodeSize;return n.step(new $s(A-(l?1:0),h+(c?1:0),A+1,h-1,new vt((l?Je.empty:Je.from(i.copy(Je.empty))).append(c?Je.empty:Je.from(i.copy(Je.empty))),l?0:1,c?0:1),l?0:1)),t(n.scrollIntoView()),!0}function mOe(e){return function(t,r){let{$from:n,$to:i}=t.selection,s=n.blockRange(i,u=>u.childCount>0&&u.firstChild.type==e);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,c=l.child(o-1);if(c.type!=e)return!1;if(r){let u=c.lastChild&&c.lastChild.type==l.type,d=Je.from(u?e.create():null),A=new vt(Je.from(e.create(null,Je.from(l.type.create(null,d)))),u?3:1,0),h=s.start,f=s.end;r(t.tr.step(new $s(h-(u?3:1),f,h,f,A,1,!0)).scrollIntoView())}return!0}}const oa=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Py=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let xL=null;const tA=function(e,t,r){let n=xL||(xL=document.createRange());return n.setEnd(e,r??e.nodeValue.length),n.setStart(e,t||0),n},gOe=function(){xL=null},dg=function(e,t,r,n){return r&&(G9(e,t,r,n,-1)||G9(e,t,r,n,1))},vOe=/^(img|br|input|textarea|hr)$/i;function G9(e,t,r,n,i){for(var s;;){if(e==r&&t==n)return!0;if(t==(i<0?0:Yl(e))){let o=e.parentNode;if(!o||o.nodeType!=1||DC(e)||vOe.test(e.nodeName)||e.contentEditable=="false")return!1;t=oa(e)+(i<0?0:1),e=o}else if(e.nodeType==1){let o=e.childNodes[t+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)t+=i;else return!1;else e=o,t=i<0?Yl(e):0}else return!1}}function Yl(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function xOe(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=Yl(e)}else if(e.parentNode&&!DC(e))t=oa(e),e=e.parentNode;else return null}}function yOe(e,t){for(;;){if(e.nodeType==3&&t2),Gl=Iy||(sd?/Mac/.test(sd.platform):!1),NOe=sd?/Win/.test(sd.platform):!1,fA=/Android \d/.test(ap),RC=!!K9&&"webkitFontSmoothing"in K9.documentElement.style,jOe=RC?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function SOe(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Qd(e,t){return typeof e=="number"?e:e[t]}function BOe(e){let t=e.getBoundingClientRect(),r=t.width/e.offsetWidth||1,n=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*r,top:t.top,bottom:t.top+e.clientHeight*n}}function V9(e,t,r){let n=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,s=e.dom.ownerDocument;for(let o=r||e.dom;o;){if(o.nodeType!=1){o=Py(o);continue}let l=o,c=l==s.body,u=c?SOe(s):BOe(l),d=0,A=0;if(t.topu.bottom-Qd(n,"bottom")&&(A=t.bottom-t.top>u.bottom-u.top?t.top+Qd(i,"top")-u.top:t.bottom-u.bottom+Qd(i,"bottom")),t.leftu.right-Qd(n,"right")&&(d=t.right-u.right+Qd(i,"right")),d||A)if(c)s.defaultView.scrollBy(d,A);else{let f=l.scrollLeft,m=l.scrollTop;A&&(l.scrollTop+=A),d&&(l.scrollLeft+=d);let p=l.scrollLeft-f,g=l.scrollTop-m;t={left:t.left-p,top:t.top-g,right:t.right-p,bottom:t.bottom-g}}let h=c?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(h))break;o=h=="absolute"?o.offsetParent:Py(o)}}function _Oe(e){let t=e.dom.getBoundingClientRect(),r=Math.max(0,t.top),n,i;for(let s=(t.left+t.right)/2,o=r+1;o=r-20){n=l,i=c.top;break}}return{refDOM:n,refTop:i,stack:Yce(e.dom)}}function Yce(e){let t=[],r=e.ownerDocument;for(let n=e;n&&(t.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),e!=r);n=Py(n));return t}function kOe({refDOM:e,refTop:t,stack:r}){let n=e?e.getBoundingClientRect().top:0;Jce(r,n==0?0:n-t)}function Jce(e,t){for(let r=0;r=l){o=Math.max(m.bottom,o),l=Math.min(m.top,l);let p=m.left>t.left?m.left-t.left:m.right=(m.left+m.right)/2?1:0));continue}}else m.top>t.top&&!c&&m.left<=t.left&&m.right>=t.left&&(c=d,u={left:Math.max(m.left,Math.min(m.right,t.left)),top:m.top});!r&&(t.left>=m.right&&t.top>=m.top||t.left>=m.left&&t.top>=m.bottom)&&(s=A+1)}}return!r&&c&&(r=c,i=u,n=0),r&&r.nodeType==3?TOe(r,i):!r||n&&r.nodeType==1?{node:e,offset:s}:Zce(r,i)}function TOe(e,t){let r=e.nodeValue.length,n=document.createRange();for(let i=0;i=(s.left+s.right)/2?1:0)}}return{node:e,offset:0}}function s8(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function POe(e,t){let r=e.parentNode;return r&&/^li$/i.test(r.nodeName)&&t.left(o.left+o.right)/2?1:-1}return e.docView.posFromDOM(n,i,s)}function OOe(e,t,r,n){let i=-1;for(let s=t,o=!1;s!=e.dom;){let l=e.docView.nearestDesc(s,!0),c;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((c=l.dom.getBoundingClientRect()).width||c.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!o&&c.left>n.left||c.top>n.top?i=l.posBefore:(!o&&c.right-1?i:e.docView.posFromDOM(t,r,-1)}function eue(e,t,r){let n=e.childNodes.length;if(n&&r.topt.top&&i++}let u;RC&&i&&n.nodeType==1&&(u=n.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=t.top&&i--,n==e.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&t.top>n.lastChild.getBoundingClientRect().bottom?l=e.state.doc.content.size:(i==0||n.nodeType!=1||n.childNodes[i-1].nodeName!="BR")&&(l=OOe(e,n,i,t))}l==null&&(l=IOe(e,o,t));let c=e.docView.nearestDesc(o,!0);return{pos:l,inside:c?c.posAtStart-c.border:-1}}function q9(e){return e.top=0&&i==n.nodeValue.length?(c--,d=1):r<0?c--:u++,Mb(bf(tA(n,c,u),d),d<0)}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(s==null&&i&&(r<0||i==Yl(n))){let c=n.childNodes[i-1];if(c.nodeType==1)return rI(c.getBoundingClientRect(),!1)}if(s==null&&i=0)}if(s==null&&i&&(r<0||i==Yl(n))){let c=n.childNodes[i-1],u=c.nodeType==3?tA(c,Yl(c)-(o?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(u)return Mb(bf(u,1),!1)}if(s==null&&i=0)}function Mb(e,t){if(e.width==0)return e;let r=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:r,right:r}}function rI(e,t){if(e.height==0)return e;let r=t?e.top:e.bottom;return{top:r,bottom:r,left:e.left,right:e.right}}function rue(e,t,r){let n=e.state,i=e.root.activeElement;n!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return r()}finally{n!=t&&e.updateState(n),i!=e.dom&&i&&i.focus()}}function MOe(e,t,r){let n=t.selection,i=r=="up"?n.$from:n.$to;return rue(e,t,()=>{let{node:s}=e.docView.domFromPos(i.pos,r=="up"?-1:1);for(;;){let l=e.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let o=tue(e,i.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let c;if(l.nodeType==1)c=l.getClientRects();else if(l.nodeType==3)c=tA(l,0,l.nodeValue.length).getClientRects();else continue;for(let u=0;ud.top+1&&(r=="up"?o.top-d.top>(d.bottom-o.top)*2:d.bottom-o.bottom>(o.bottom-d.top)*2))return!1}}return!0})}const DOe=/[\u0590-\u08ac]/;function ROe(e,t,r){let{$head:n}=t.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,s=!i,o=i==n.parent.content.size,l=e.domSelection();return l?!DOe.test(n.parent.textContent)||!l.modify?r=="left"||r=="backward"?s:o:rue(e,t,()=>{let{focusNode:c,focusOffset:u,anchorNode:d,anchorOffset:A}=e.domSelectionRange(),h=l.caretBidiLevel;l.modify("move",r,"character");let f=n.depth?e.docView.domAfterPos(n.before()):e.dom,{focusNode:m,focusOffset:p}=e.domSelectionRange(),g=m&&!f.contains(m.nodeType==1?m:m.parentNode)||c==m&&u==p;try{l.collapse(d,A),c&&(c!=d||u!=A)&&l.extend&&l.extend(c,u)}catch{}return h!=null&&(l.caretBidiLevel=h),g}):n.pos==n.start()||n.pos==n.end()}let X9=null,Y9=null,J9=!1;function UOe(e,t,r){return X9==t&&Y9==r?J9:(X9=t,Y9=r,J9=r=="up"||r=="down"?MOe(e,t,r):ROe(e,t,r))}const Ac=0,Z9=1,sm=2,ad=3;class UC{constructor(t,r,n,i){this.parent=t,this.children=r,this.dom=n,this.contentDOM=i,this.dirty=Ac,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,r,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let r=0;roa(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(let s=t;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&r==t.childNodes.length)for(let s=t;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??n>0?this.posAtEnd:this.posAtStart}nearestDesc(t,r=!1){for(let n=!0,i=t;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!r||s.node))if(n&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(t.nodeType==1?t:t.parentNode):o==t))n=!1;else return s}}getDesc(t){let r=t.pmViewDesc;for(let n=r;n;n=n.parent)if(n==this)return r}posFromDOM(t,r,n){for(let i=t;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(t,r,n)}return-1}descAt(t){for(let r=0,n=0;rt||o instanceof iue){i=t-s;break}s=l}if(i)return this.children[n].domFromPos(i-this.children[n].border,r);for(let s;n&&!(s=this.children[n-1]).size&&s instanceof nue&&s.side>=0;n--);if(r<=0){let s,o=!0;for(;s=n?this.children[n-1]:null,!(!s||s.dom.parentNode==this.contentDOM);n--,o=!1);return s&&r&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,r):{node:this.contentDOM,offset:s?oa(s.dom)+1:0}}else{let s,o=!0;for(;s=n=d&&r<=u-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(t,r,d);t=o;for(let A=l;A>0;A--){let h=this.children[A-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=oa(h.dom)+1;break}t-=h.size}i==-1&&(i=0)}if(i>-1&&(u>r||l==this.children.length-1)){r=u;for(let d=l+1;dm&&or){let m=l;l=c,c=m}let f=document.createRange();f.setEnd(c.node,c.offset),f.setStart(l.node,l.offset),u.removeAllRanges(),u.addRange(f)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,r){for(let n=0,i=0;i=n:tn){let l=n+s.border,c=o-s.border;if(t>=l&&r<=c){this.dirty=t==n||r==o?sm:Z9,t==l&&r==c&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=ad:s.markDirty(t-l,r-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?sm:ad}n=o}this.dirty=sm}markParentsDirty(){let t=1;for(let r=this.parent;r;r=r.parent,t++){let n=t==1?sm:Z9;r.dirty{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!r.type.spec.raw){if(o.nodeType!=1){let l=document.createElement("span");l.appendChild(o),o=l}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(t,[],o,null),this.widget=r,this.widget=r,s=this}matchesWidget(t){return this.dirty==Ac&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let r=this.widget.spec.stopEvent;return r?r(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class QOe extends UC{constructor(t,r,n,i){super(t,[],r,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(t,r){return t!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class Ag extends UC{constructor(t,r,n,i,s){super(t,[],n,i),this.mark=r,this.spec=s}static create(t,r,n,i){let s=i.nodeViews[r.type.name],o=s&&s(r,i,n);return(!o||!o.dom)&&(o=Fg.renderSpec(document,r.type.spec.toDOM(r,n),null,r.attrs)),new Ag(t,r,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&ad||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=ad&&this.mark.eq(t)}markDirty(t,r){if(super.markDirty(t,r),this.dirty!=Ac){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty0&&(s=NL(s,0,t,n));for(let l=0;l{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},n,i),d=u&&u.dom,A=u&&u.contentDOM;if(r.isText){if(!d)d=document.createTextNode(r.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:A}=Fg.renderSpec(document,r.type.spec.toDOM(r),null,r.attrs));!A&&!r.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),r.type.spec.draggable&&(d.draggable=!0));let h=d;return d=oue(d,n,r),u?c=new HOe(t,r,n,i,d,A||null,h,u,s,o+1):r.isText?new LE(t,r,n,i,d,h,s):new Bh(t,r,n,i,d,A||null,h,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let n=this.children[r];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>Je.empty)}return t}matchesNode(t,r,n){return this.dirty==Ac&&t.eq(this.node)&&v_(r,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,r){let n=this.node.inlineContent,i=r,s=t.composing?this.localCompositionInfo(t,r):null,o=s&&s.pos>-1?s:null,l=s&&s.pos<0,c=new zOe(this,o&&o.node,t);KOe(this.node,this.innerDeco,(u,d,A)=>{u.spec.marks?c.syncToMarks(u.spec.marks,n,t):u.type.side>=0&&!A&&c.syncToMarks(d==this.node.childCount?On.none:this.node.child(d).marks,n,t),c.placeWidget(u,t,i)},(u,d,A,h)=>{c.syncToMarks(u.marks,n,t);let f;c.findNodeMatch(u,d,A,h)||l&&t.state.selection.from>i&&t.state.selection.to-1&&c.updateNodeAt(u,d,A,f,t)||c.updateNextNode(u,d,A,t,h,i)||c.addNode(u,d,A,t,i),i+=u.nodeSize}),c.syncToMarks([],n,t),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==sm)&&(o&&this.protectLocalComposition(t,o),sue(this.contentDOM,this.children,t),Iy&&VOe(this.dom))}localCompositionInfo(t,r){let{from:n,to:i}=t.state.selection;if(!(t.state.selection instanceof gr)||nr+this.node.content.size)return null;let s=t.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,l=qOe(this.node.content,o,n-r,i-r);return l<0?null:{node:s,pos:l,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:r,pos:n,text:i}){if(this.getDesc(r))return;let s=r;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new QOe(this,s,r,i);t.input.compositionNodes.push(o),this.children=NL(this.children,n,n+i.length,t,o)}update(t,r,n,i){return this.dirty==ad||!t.sameMarkup(this.node)?!1:(this.updateInner(t,r,n,i),!0)}updateInner(t,r,n,i){this.updateOuterDeco(r),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Ac}updateOuterDeco(t){if(v_(t,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=aue(this.dom,this.nodeDOM,CL(this.outerDeco,this.node,r),CL(t,this.node,r)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function eW(e,t,r,n,i){oue(n,t,e);let s=new Bh(void 0,e,t,r,n,n,n,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class LE extends Bh{constructor(t,r,n,i,s,o,l){super(t,r,n,i,s,null,o,l,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,r,n,i){return this.dirty==ad||this.dirty!=Ac&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=Ac||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=Ac,!0)}inParent(){let t=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,r,n){return t==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(t,r,n)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,r,n){let i=this.node.cut(t,r),s=document.createTextNode(i.text);return new LE(this.parent,i,this.outerDeco,this.innerDeco,s,s,n)}markDirty(t,r){super.markDirty(t,r),this.dom!=this.nodeDOM&&(t==0||r==this.nodeDOM.nodeValue.length)&&(this.dirty=ad)}get domAtom(){return!1}isText(t){return this.node.text==t}}class iue extends UC{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Ac&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class HOe extends Bh{constructor(t,r,n,i,s,o,l,c,u,d){super(t,r,n,i,s,o,l,u,d),this.spec=c}update(t,r,n,i){if(this.dirty==ad)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let s=this.spec.update(t,r,n);return s&&this.updateInner(t,r,n,i),s}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,r,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,r,n,i){this.spec.setSelection?this.spec.setSelection(t,r,n.root):super.setSelection(t,r,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function sue(e,t,r){let n=e.firstChild,i=!1;for(let s=0;s>1,o=Math.min(s,t.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=Ag.create(this.top,t[s],r,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,s++}}findNodeMatch(t,r,n,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(t,r,n))s=this.top.children.indexOf(o,this.index);else for(let l=this.index,c=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(n){let u=r.children[n-1];if(u instanceof Ag)r=u,n=u.children.length;else{l=u,n--;break}}else{if(r==t)break e;n=r.parent.children.indexOf(r),r=r.parent}let c=l.node;if(c){if(c!=e.child(i-1))break;--i,s.set(l,i),o.push(l)}}return{index:i,matched:s,matches:o.reverse()}}function GOe(e,t){return e.type.side-t.type.side}function KOe(e,t,r,n){let i=t.locals(e),s=0;if(i.length==0){for(let u=0;us;)l.push(i[o++]);let m=s+h.nodeSize;if(h.isText){let g=m;o!g.inline):l.slice();n(h,p,t.forChild(s,h),f),s=m}}function VOe(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function qOe(e,t,r,n){for(let i=0,s=0;i=r){if(s>=n&&c.slice(n-t.length-l,n-l)==t)return n-t.length;let u=l=0&&u+t.length+l>=r)return l+u;if(r==n&&c.length>=n+t.length-l&&c.slice(n-l,n-l+t.length)==t)return n}}return-1}function NL(e,t,r,n,i){let s=[];for(let o=0,l=0;o=r||d<=t?s.push(c):(ur&&s.push(c.slice(r-u,c.size,n)))}return s}function a8(e,t=null){let r=e.domSelectionRange(),n=e.state.doc;if(!r.focusNode)return null;let i=e.docView.nearestDesc(r.focusNode),s=i&&i.size==0,o=e.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(o<0)return null;let l=n.resolve(o),c,u;if(FE(r)){for(c=o;i&&!i.node;)i=i.parent;let A=i.node;if(i&&A.isAtom&&Yt.isSelectable(A)&&i.parent&&!(A.isInline&&bOe(r.focusNode,r.focusOffset,i.dom))){let h=i.posBefore;u=new Yt(o==h?l:n.resolve(h))}}else{if(r instanceof e.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){let A=o,h=o;for(let f=0;f{(r.anchorNode!=n||r.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!lue(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function YOe(e){let t=e.domSelection();if(!t)return;let r=e.cursorWrapper.dom,n=r.nodeName=="IMG";n?t.collapse(r.parentNode,oa(r)+1):t.collapse(r,0),!n&&!e.state.selection.visible&&Ro&&Sh<=11&&(r.disabled=!0,r.disabled=!1)}function cue(e,t){if(t instanceof Yt){let r=e.docView.descAt(t.from);r!=e.lastSelectedViewDesc&&(sW(e),r&&r.selectNode(),e.lastSelectedViewDesc=r)}else sW(e)}function sW(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function o8(e,t,r,n){return e.someProp("createSelectionBetween",i=>i(e,t,r))||gr.between(t,r,n)}function aW(e){return e.editable&&!e.hasFocus()?!1:uue(e)}function uue(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function JOe(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),r=e.domSelectionRange();return dg(t.node,t.offset,r.anchorNode,r.anchorOffset)}function jL(e,t){let{$anchor:r,$head:n}=e.selection,i=t>0?r.max(n):r.min(n),s=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return s&&Ir.findFrom(s,t)}function _f(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function oW(e,t,r){let n=e.state.selection;if(n instanceof gr)if(r.indexOf("s")>-1){let{$head:i}=n,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=e.state.doc.resolve(i.pos+s.nodeSize*(t<0?-1:1));return _f(e,new gr(n.$anchor,o))}else if(n.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=jL(e.state,t);return i&&i instanceof Yt?_f(e,i):!1}else if(!(Gl&&r.indexOf("m")>-1)){let i=n.$head,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let l=t<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=e.docView.descAt(l))&&!o.contentDOM?Yt.isSelectable(s)?_f(e,new Yt(t<0?e.state.doc.resolve(i.pos-s.nodeSize):i)):RC?_f(e,new gr(e.state.doc.resolve(t<0?l:l+s.nodeSize))):!1:!1}}else return!1;else{if(n instanceof Yt&&n.node.isInline)return _f(e,new gr(t>0?n.$to:n.$from));{let i=jL(e.state,t);return i?_f(e,i):!1}}}function x_(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Vw(e,t){let r=e.pmViewDesc;return r&&r.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function bv(e,t){return t<0?ZOe(e):eFe(e)}function ZOe(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let i,s,o=!1;for(dc&&r.nodeType==1&&n0){if(r.nodeType!=1)break;{let l=r.childNodes[n-1];if(Vw(l,-1))i=r,s=--n;else if(l.nodeType==3)r=l,n=r.nodeValue.length;else break}}else{if(due(r))break;{let l=r.previousSibling;for(;l&&Vw(l,-1);)i=r.parentNode,s=oa(l),l=l.previousSibling;if(l)r=l,n=x_(r);else{if(r=r.parentNode,r==e.dom)break;n=0}}}o?SL(e,r,n):i&&SL(e,i,s)}function eFe(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let i=x_(r),s,o;for(;;)if(n{e.state==i&&yA(e)},50)}function lW(e,t){let r=e.state.doc.resolve(t);if(!(La||NOe)&&r.parent.inlineContent){let i=e.coordsAtPos(t);if(t>r.start()){let s=e.coordsAtPos(t-1),o=(s.top+s.bottom)/2;if(o>i.top&&o1)return s.lefti.top&&o1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function cW(e,t,r){let n=e.state.selection;if(n instanceof gr&&!n.empty||r.indexOf("s")>-1||Gl&&r.indexOf("m")>-1)return!1;let{$from:i,$to:s}=n;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let o=jL(e.state,t);if(o&&o instanceof Yt)return _f(e,o)}if(!i.parent.inlineContent){let o=t<0?i:s,l=n instanceof uc?Ir.near(o,t):Ir.findFrom(o,t);return l?_f(e,l):!1}return!1}function uW(e,t){if(!(e.state.selection instanceof gr))return!0;let{$head:r,$anchor:n,empty:i}=e.state.selection;if(!r.sameParent(n))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let s=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(s&&!s.isText){let o=e.state.tr;return t<0?o.delete(r.pos-s.nodeSize,r.pos):o.delete(r.pos,r.pos+s.nodeSize),e.dispatch(o),!0}return!1}function dW(e,t,r){e.domObserver.stop(),t.contentEditable=r,e.domObserver.start()}function nFe(e){if(!Ao||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:r}=e.domSelectionRange();if(t&&t.nodeType==1&&r==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let n=t.firstChild;dW(e,n,"true"),setTimeout(()=>dW(e,n,"false"),20)}return!1}function iFe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function sFe(e,t){let r=t.keyCode,n=iFe(t);if(r==8||Gl&&r==72&&n=="c")return uW(e,-1)||bv(e,-1);if(r==46&&!t.shiftKey||Gl&&r==68&&n=="c")return uW(e,1)||bv(e,1);if(r==13||r==27)return!0;if(r==37||Gl&&r==66&&n=="c"){let i=r==37?lW(e,e.state.selection.from)=="ltr"?-1:1:-1;return oW(e,i,n)||bv(e,i)}else if(r==39||Gl&&r==70&&n=="c"){let i=r==39?lW(e,e.state.selection.from)=="ltr"?1:-1:1;return oW(e,i,n)||bv(e,i)}else{if(r==38||Gl&&r==80&&n=="c")return cW(e,-1,n)||bv(e,-1);if(r==40||Gl&&r==78&&n=="c")return nFe(e)||cW(e,1,n)||bv(e,1);if(n==(Gl?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function l8(e,t){e.someProp("transformCopied",f=>{t=f(t,e)});let r=[],{content:n,openStart:i,openEnd:s}=t;for(;i>1&&s>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,s--;let f=n.firstChild;r.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),n=f.content}let o=e.someProp("clipboardSerializer")||Fg.fromSchema(e.state.schema),l=gue(),c=l.createElement("div");c.appendChild(o.serializeFragment(n,{document:l}));let u=c.firstChild,d,A=0;for(;u&&u.nodeType==1&&(d=mue[u.nodeName.toLowerCase()]);){for(let f=d.length-1;f>=0;f--){let m=l.createElement(d[f]);for(;c.firstChild;)m.appendChild(c.firstChild);c.appendChild(m),A++}u=c.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${A?` -${A}`:""} ${JSON.stringify(r)}`);let h=e.someProp("clipboardTextSerializer",f=>f(t,e))||t.content.textBetween(0,t.content.size,` `);return{dom:c,text:h,slice:t}}function Aue(e,t,r,n,i){let s=i.parent.type.spec.code,o,l;if(!r&&!t)return null;let c=!!t&&(n||s||!r);if(c){if(e.someProp("transformPastedText",h=>{t=h(t,s||n,e)}),s)return l=new vt(Je.from(e.state.schema.text(t.replace(/\r\n?/g,` `))),0,0),e.someProp("transformPasted",h=>{l=h(l,e,!0)}),l;let A=e.someProp("clipboardTextParser",h=>h(t,i,n,e));if(A)l=A;else{let h=i.marks(),{schema:f}=e.state,m=Fg.fromSchema(f);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(p=>{let g=o.appendChild(document.createElement("p"));p&&g.appendChild(m.serializeNode(f.text(p,h)))})}}else e.someProp("transformPastedHTML",A=>{r=A(r,e)}),o=cFe(r),RC&&uFe(o);let u=o&&o.querySelector("[data-pm-slice]"),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let A=+d[3];A>0;A--){let h=o.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;o=h}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||jh.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||d),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!aFe.test(h.parentNode.nodeName)?{ignore:!0}:null}})),d)l=dFe(AW(l,+d[1],+d[2]),d[4]);else if(l=vt.maxOpen(oFe(l.content,i),!0),l.openStart||l.openEnd){let A=0,h=0;for(let f=l.content.firstChild;A{l=A(l,e,c)}),l}const aFe=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function oFe(e,t){if(e.childCount<2)return e;for(let r=t.depth;r>=0;r--){let i=t.node(r).contentMatchAt(t.index(r)),s,o=[];if(e.forEach(l=>{if(!o)return;let c=i.findWrapping(l.type),u;if(!c)return o=null;if(u=o.length&&s.length&&hue(c,s,l,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=pue(o[o.length-1],s.length));let d=fue(l,c);o.push(d),i=i.matchType(d.type),s=c}}),o)return Je.from(o)}return e}function fue(e,t,r=0){for(let n=t.length-1;n>=r;n--)e=t[n].create(null,Je.from(e));return e}function hue(e,t,r,n,i){if(i1&&(s=0),i=r&&(l=t<0?o.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(Je.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(l))}function AW(e,t,r){return tr})),iI.createHTML(e)):e}function cFe(e){let t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let r=gue().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(e),i;if((i=n&&mue[n[1].toLowerCase()])&&(e=i.map(s=>"<"+s+">").join("")+e+i.map(s=>"").reverse().join("")),r.innerHTML=lFe(e),i)for(let s=0;s=0;l-=2){let c=r.nodes[n[l]];if(!c||c.hasRequiredAttrs())break;i=Je.from(c.create(n[l+1],i)),s++,o++}return new vt(i,s,o)}const fo={},ho={},AFe={touchstart:!0,touchmove:!0};class fFe{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function hFe(e){for(let t in fo){let r=fo[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=n=>{mFe(e,n)&&!c8(e,n)&&(e.editable||!(n.type in ho))&&r(e,n)},AFe[t]?{passive:!0}:void 0)}Ao&&e.dom.addEventListener("input",()=>null),_L(e)}function ih(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function pFe(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function _L(e){e.someProp("handleDOMEvents",t=>{for(let r in t)e.input.eventHandlers[r]||e.dom.addEventListener(r,e.input.eventHandlers[r]=n=>c8(e,n))})}function c8(e,t){return e.someProp("handleDOMEvents",r=>{let n=r[t.type];return n?n(e,t)||t.defaultPrevented:!1})}function mFe(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let r=t.target;r!=e.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(t))return!1;return!0}function gFe(e,t){!c8(e,t)&&fo[t.type]&&(e.editable||!(t.type in ho))&&fo[t.type](e,t)}ho.keydown=(e,t)=>{let r=t;if(e.input.shiftKey=r.keyCode==16||r.shiftKey,!xue(e,r)&&(e.input.lastKeyCode=r.keyCode,e.input.lastKeyCodeTime=Date.now(),!(fA&&La&&r.keyCode==13)))if(r.keyCode!=229&&e.domObserver.forceFlush(),Iy&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();e.input.lastIOSEnter=n,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==n&&(e.someProp("handleKeyDown",i=>i(e,Jp(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",n=>n(e,r))||sFe(e,r)?r.preventDefault():ih(e,"key")};ho.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};ho.keypress=(e,t)=>{let r=t;if(xue(e,r)||!r.charCode||r.ctrlKey&&!r.altKey||Gl&&r.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,r))){r.preventDefault();return}let n=e.state.selection;if(!(n instanceof gr)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(r.charCode),s=()=>e.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",o=>o(e,n.$from.pos,n.$to.pos,i,s))&&e.dispatch(s()),r.preventDefault()}};function ME(e){return{left:e.clientX,top:e.clientY}}function vFe(e,t){let r=t.x-e.clientX,n=t.y-e.clientY;return r*r+n*n<100}function u8(e,t,r,n,i){if(n==-1)return!1;let s=e.state.doc.resolve(n);for(let o=s.depth+1;o>0;o--)if(e.someProp(t,l=>o>s.depth?l(e,r,s.nodeAfter,s.before(o),i,!0):l(e,r,s.node(o),s.before(o),i,!1)))return!0;return!1}function Hx(e,t,r){if(e.focused||e.focus(),e.state.selection.eq(t))return;let n=e.state.tr.setSelection(t);n.setMeta("pointer",!0),e.dispatch(n)}function xFe(e,t){if(t==-1)return!1;let r=e.state.doc.resolve(t),n=r.nodeAfter;return n&&n.isAtom&&Yt.isSelectable(n)?(Hx(e,new Yt(r)),!0):!1}function yFe(e,t){if(t==-1)return!1;let r=e.state.selection,n,i;r instanceof Yt&&(n=r.node);let s=e.state.doc.resolve(t);for(let o=s.depth+1;o>0;o--){let l=o>s.depth?s.nodeAfter:s.node(o);if(Yt.isSelectable(l)){n&&r.$from.depth>0&&o>=r.$from.depth&&s.before(r.$from.depth+1)==r.$from.pos?i=s.before(r.$from.depth):i=s.before(o);break}}return i!=null?(Hx(e,Yt.create(e.state.doc,i)),!0):!1}function bFe(e,t,r,n,i){return u8(e,"handleClickOn",t,r,n)||e.someProp("handleClick",s=>s(e,t,n))||(i?yFe(e,r):xFe(e,r))}function wFe(e,t,r,n){return u8(e,"handleDoubleClickOn",t,r,n)||e.someProp("handleDoubleClick",i=>i(e,t,n))}function CFe(e,t,r,n){return u8(e,"handleTripleClickOn",t,r,n)||e.someProp("handleTripleClick",i=>i(e,t,n))||NFe(e,r,n)}function NFe(e,t,r){if(r.button!=0)return!1;let n=e.state.doc;if(t==-1)return n.inlineContent?(Hx(e,gr.create(n,0,n.content.size)),!0):!1;let i=n.resolve(t);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),l=i.before(s);if(o.inlineContent)Hx(e,gr.create(n,l+1,l+1+o.content.size));else if(Yt.isSelectable(o))Hx(e,Yt.create(n,l));else continue;return!0}}function d8(e){return y_(e)}const vue=Gl?"metaKey":"ctrlKey";fo.mousedown=(e,t)=>{let r=t;e.input.shiftKey=r.shiftKey;let n=d8(e),i=Date.now(),s="singleClick";i-e.input.lastClick.time<500&&vFe(r,e.input.lastClick)&&!r[vue]&&e.input.lastClick.button==r.button&&(e.input.lastClick.type=="singleClick"?s="doubleClick":e.input.lastClick.type=="doubleClick"&&(s="tripleClick")),e.input.lastClick={time:i,x:r.clientX,y:r.clientY,type:s,button:r.button};let o=e.posAtCoords(ME(r));o&&(s=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new jFe(e,o,r,!!n)):(s=="doubleClick"?wFe:CFe)(e,o.pos,o.inside,r)?r.preventDefault():ih(e,"pointer"))};class jFe{constructor(t,r,n,i){this.view=t,this.pos=r,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[vue],this.allowDefault=n.shiftKey;let s,o;if(r.inside>-1)s=t.state.doc.nodeAt(r.inside),o=r.inside;else{let d=t.state.doc.resolve(r.pos);s=d.parent,o=d.depth?d.before():0}const l=i?null:n.target,c=l?t.docView.nearestDesc(l,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:u}=t.state;(n.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof Yt&&u.from<=o&&u.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&dc&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),ih(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>yA(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(ME(t))),this.updateAllowDefault(t),this.allowDefault||!r?ih(this.view,"pointer"):bFe(this.view,r.pos,r.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Ao&&this.mightDrag&&!this.mightDrag.node.isAtom||La&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(Hx(this.view,Ir.near(this.view.state.doc.resolve(r.pos))),t.preventDefault()):ih(this.view,"pointer")}move(t){this.updateAllowDefault(t),ih(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}fo.touchstart=e=>{e.input.lastTouch=Date.now(),d8(e),ih(e,"pointer")};fo.touchmove=e=>{e.input.lastTouch=Date.now(),ih(e,"pointer")};fo.contextmenu=e=>d8(e);function xue(e,t){return e.composing?!0:Ao&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const SFe=fA?5e3:-1;ho.compositionstart=ho.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,r=t.selection.$to;if(t.selection instanceof gr&&(t.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||r.marks(),y_(e,!0),e.markCursor=null;else if(y_(e,!t.selection.empty),dc&&t.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=e.domSelectionRange();for(let i=n.focusNode,s=n.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let l=e.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}e.input.composing=!0}yue(e,SFe)};ho.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,yue(e,20))};function yue(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>y_(e),t))}function bue(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=_Fe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function BFe(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let r=xOe(t.focusNode,t.focusOffset),n=yOe(t.focusNode,t.focusOffset);if(r&&n&&r!=n){let i=n.pmViewDesc,s=e.domObserver.lastChangedTextNode;if(r==s||n==s)return s;if(!i||!i.isText(n.nodeValue))return n;if(e.input.compositionNode==n){let o=r.pmViewDesc;if(!(!o||!o.isText(r.nodeValue)))return n}}return r||n}function _Fe(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function y_(e,t=!1){if(!(fA&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),bue(e),t||e.docView&&e.docView.dirty){let r=a8(e),n=e.state.selection;return r&&!r.eq(n)?e.dispatch(e.state.tr.setSelection(r)):(e.markCursor||t)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function kFe(e,t){if(!e.dom.parentNode)return;let r=e.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(t),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),e.focus()},50)}const s2=Ro&&Sh<15||Iy&&jOe<604;fo.copy=ho.cut=(e,t)=>{let r=t,n=e.state.selection,i=r.type=="cut";if(n.empty)return;let s=s2?null:r.clipboardData,o=n.content(),{dom:l,text:c}=l8(e,o);s?(r.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",c)):kFe(e,l),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function EFe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function TFe(e,t){if(!e.dom.parentNode)return;let r=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,n=e.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),n.parentNode&&n.parentNode.removeChild(n),r?a2(e,n.value,null,i,t):a2(e,n.textContent,n.innerHTML,i,t)},50)}function a2(e,t,r,n,i){let s=Aue(e,t,r,n,e.state.selection.$from);if(e.someProp("handlePaste",c=>c(e,i,s||vt.empty)))return!0;if(!s)return!1;let o=EFe(s),l=o?e.state.tr.replaceSelectionWith(o,n):e.state.tr.replaceSelection(s);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function wue(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let r=e.getData("text/uri-list");return r?r.replace(/\r?\n/g," "):""}ho.paste=(e,t)=>{let r=t;if(e.composing&&!fA)return;let n=s2?null:r.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;n&&a2(e,wue(n),n.getData("text/html"),i,r)?r.preventDefault():TFe(e,r)};class Cue{constructor(t,r,n){this.slice=t,this.move=r,this.node=n}}const PFe=Gl?"altKey":"ctrlKey";function Nue(e,t){let r=e.someProp("dragCopies",n=>!n(t));return r??!t[PFe]}fo.dragstart=(e,t)=>{let r=t,n=e.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let i=e.state.selection,s=i.empty?null:e.posAtCoords(ME(r)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof Yt?i.to-1:i.to))){if(n&&n.mightDrag)o=Yt.create(e.state.doc,n.mightDrag.pos);else if(r.target&&r.target.nodeType==1){let A=e.docView.nearestDesc(r.target,!0);A&&A.node.type.spec.draggable&&A!=e.docView&&(o=Yt.create(e.state.doc,A.posBefore))}}let l=(o||e.state.selection).content(),{dom:c,text:u,slice:d}=l8(e,l);(!r.dataTransfer.files.length||!La||Xce>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(s2?"Text":"text/html",c.innerHTML),r.dataTransfer.effectAllowed="copyMove",s2||r.dataTransfer.setData("text/plain",u),e.dragging=new Cue(d,Nue(e,r),o)};fo.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};ho.dragover=ho.dragenter=(e,t)=>t.preventDefault();ho.drop=(e,t)=>{let r=t,n=e.dragging;if(e.dragging=null,!r.dataTransfer)return;let i=e.posAtCoords(ME(r));if(!i)return;let s=e.state.doc.resolve(i.pos),o=n&&n.slice;o?e.someProp("transformPasted",m=>{o=m(o,e,!1)}):o=Aue(e,wue(r.dataTransfer),s2?null:r.dataTransfer.getData("text/html"),!1,s);let l=!!(n&&Nue(e,r));if(e.someProp("handleDrop",m=>m(e,r,o||vt.empty,l))){r.preventDefault();return}if(!o)return;r.preventDefault();let c=o?Fce(e.state.doc,s.pos,o):s.pos;c==null&&(c=s.pos);let u=e.state.tr;if(l){let{node:m}=n;m?m.replace(u):u.deleteSelection()}let d=u.mapping.map(c),A=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,h=u.doc;if(A?u.replaceRangeWith(d,d,o.content.firstChild):u.replaceRange(d,d,o),u.doc.eq(h))return;let f=u.doc.resolve(d);if(A&&Yt.isSelectable(o.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(o.content.firstChild))u.setSelection(new Yt(f));else{let m=u.mapping.map(c);u.mapping.maps[u.mapping.maps.length-1].forEach((p,g,v,x)=>m=x),u.setSelection(o8(e,f,u.doc.resolve(m)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))};fo.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&yA(e)},20))};fo.blur=(e,t)=>{let r=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),r.relatedTarget&&e.dom.contains(r.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};fo.beforeinput=(e,t)=>{if(La&&fA&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:n}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=n||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",s=>s(e,Jp(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in ho)fo[e]=ho[e];function o2(e,t){if(e==t)return!0;for(let r in e)if(e[r]!==t[r])return!1;for(let r in t)if(!(r in e))return!1;return!0}class b_{constructor(t,r){this.toDOM=t,this.spec=r||Lm,this.side=this.spec.side||0}map(t,r,n,i){let{pos:s,deleted:o}=t.mapResult(r.from+i,this.side<0?-1:1);return o?null:new ro(s-n,s-n,this)}valid(){return!0}eq(t){return this==t||t instanceof b_&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&o2(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class _h{constructor(t,r){this.attrs=t,this.spec=r||Lm}map(t,r,n,i){let s=t.map(r.from+i,this.spec.inclusiveStart?-1:1)-n,o=t.map(r.to+i,this.spec.inclusiveEnd?1:-1)-n;return s>=o?null:new ro(s,o,this)}valid(t,r){return r.from=t&&(!s||s(l.spec))&&n.push(l.copy(l.from+i,l.to+i))}for(let o=0;ot){let l=this.children[o]+1;this.children[o+2].findInner(t-l,r-l,n,i+l,s)}}map(t,r,n){return this==Ea||t.maps.length==0?this:this.mapInner(t,r,0,0,n||Lm)}mapInner(t,r,n,i,s){let o;for(let l=0;l{let u=c+n,d;if(d=Sue(r,l,u)){for(i||(i=this.children.slice());sl&&A.to=t){this.children[l]==t&&(n=this.children[l+2]);break}let s=t+1,o=s+r.content.size;for(let l=0;ls&&c.type instanceof _h){let u=Math.max(s,c.from)-s,d=Math.min(o,c.to)-s;ui.map(t,r,Lm));return Mf.from(n)}forChild(t,r){if(r.isLeaf)return xi.empty;let n=[];for(let i=0;ir instanceof xi)?t:t.reduce((r,n)=>r.concat(n instanceof xi?n:n.members),[]))}}forEachSet(t){for(let r=0;r{let g=p-m-(f-h);for(let v=0;vx+d-A)continue;let y=l[v]+d-A;f>=y?l[v+1]=h<=y?-2:-1:h>=d&&g&&(l[v]+=g,l[v+1]+=g)}A+=g}),d=r.maps[u].map(d,-1)}let c=!1;for(let u=0;u=n.content.size){c=!0;continue}let h=r.map(e[u+1]+s,-1),f=h-i,{index:m,offset:p}=n.content.findIndex(A),g=n.maybeChild(m);if(g&&p==A&&p+g.nodeSize==f){let v=l[u+2].mapInner(r,g,d+1,e[u]+s+1,o);v!=Ea?(l[u]=A,l[u+1]=f,l[u+2]=v):(l[u+1]=-2,c=!0)}else c=!0}if(c){let u=OFe(l,e,t,r,i,s,o),d=w_(u,n,0,o);t=d.local;for(let A=0;Ar&&o.to{let u=Sue(e,l,c+r);if(u){s=!0;let d=w_(u,l,r+c+1,n);d!=Ea&&i.push(c,c+l.nodeSize,d)}});let o=jue(s?Bue(e):e,-r).sort(Mm);for(let l=0;l0;)t++;e.splice(t,0,r)}function sI(e){let t=[];return e.someProp("decorations",r=>{let n=r(e.state);n&&n!=Ea&&t.push(n)}),e.cursorWrapper&&t.push(xi.create(e.state.doc,[e.cursorWrapper.deco])),Mf.from(t)}const FFe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},LFe=Ro&&Sh<=11;class MFe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class DFe{constructor(t,r){this.view=t,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new MFe,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),LFe&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,FFe)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let r=0;rthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(aW(this.view)){if(this.suppressingSelectionUpdates)return yA(this.view);if(Ro&&Sh<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&dg(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let r=new Set,n;for(let s=t.focusNode;s;s=Py(s))r.add(s);for(let s=t.anchorNode;s;s=Py(s))if(r.has(s)){n=s;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&aW(t)&&!this.ignoreSelectionChange(n),s=-1,o=-1,l=!1,c=[];if(t.editable)for(let d=0;dA.nodeName=="BR");if(d.length==2){let[A,h]=d;A.parentNode&&A.parentNode.parentNode==h.parentNode?h.remove():A.remove()}else{let{focusNode:A}=this.currentSelection;for(let h of d){let f=h.parentNode;f&&f.nodeName=="LI"&&(!A||QFe(t,A)!=f)&&h.remove()}}}let u=null;s<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||i)&&(s>-1&&(t.docView.markDirty(s,o),RFe(t)),this.handleDOMChange(s,o,l,c),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||yA(t),this.currentSelection.set(n))}registerMutation(t,r){if(r.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(n==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!n||n.ignoreMutation(t))return null;if(t.type=="childList"){for(let d=0;di;g--){let v=n.childNodes[g-1],x=v.pmViewDesc;if(v.nodeName=="BR"&&!x){s=g;break}if(!x||x.size)break}let A=e.state.doc,h=e.someProp("domParser")||jh.fromSchema(e.state.schema),f=A.resolve(o),m=null,p=h.parse(n,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:i,to:s,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:$Fe,context:f});if(u&&u[0].pos!=null){let g=u[0].pos,v=u[1]&&u[1].pos;v==null&&(v=g),m={anchor:g+o,head:v+o}}return{doc:p,sel:m,from:o,to:l}}function $Fe(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(Ao&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||Ao&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const zFe=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function WFe(e,t,r,n,i){let s=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let S=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,T=a8(e,S);if(T&&!e.state.selection.eq(T)){if(La&&fA&&e.input.lastKeyCode===13&&Date.now()-100I(e,Jp(13,"Enter"))))return;let B=e.state.tr.setSelection(T);S=="pointer"?B.setMeta("pointer",!0):S=="key"&&B.scrollIntoView(),s&&B.setMeta("composition",s),e.dispatch(B)}return}let o=e.state.doc.resolve(t),l=o.sharedDepth(r);t=o.before(l+1),r=e.state.doc.resolve(r).after(l+1);let c=e.state.selection,u=HFe(e,t,r),d=e.state.doc,A=d.slice(u.from,u.to),h,f;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||fA)&&i.some(S=>S.nodeType==1&&!zFe.test(S.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp("handleKeyDown",S=>S(e,Jp(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!m)if(n&&c instanceof gr&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(u.sel){let S=vW(e,e.state.doc,u.sel);if(S&&!S.eq(e.state.selection)){let T=e.state.tr.setSelection(S);s&&T.setMeta("composition",s),e.dispatch(T)}}return}e.state.selection.frome.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?m.start=e.state.selection.from:m.endA=e.state.selection.to-2&&e.state.selection.to<=u.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),Ro&&Sh<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>u.from&&u.doc.textBetween(m.start-u.from-1,m.start-u.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let p=u.doc.resolveNoCache(m.start-u.from),g=u.doc.resolveNoCache(m.endB-u.from),v=d.resolve(m.start),x=p.sameParent(g)&&p.parent.inlineContent&&v.end()>=m.endA;if((Iy&&e.input.lastIOSEnter>Date.now()-225&&(!x||i.some(S=>S.nodeName=="DIV"||S.nodeName=="P"))||!x&&p.posS(e,Jp(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&KFe(d,m.start,m.endA,p,g)&&e.someProp("handleKeyDown",S=>S(e,Jp(8,"Backspace")))){fA&&La&&e.domObserver.suppressSelectionUpdates();return}La&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),fA&&!x&&p.start()!=g.start()&&g.parentOffset==0&&p.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==m.endA&&(m.endB-=2,g=u.doc.resolveNoCache(m.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(S){return S(e,Jp(13,"Enter"))})},20));let y=m.start,b=m.endA,C=S=>{let T=S||e.state.tr.replace(y,b,u.doc.slice(m.start-u.from,m.endB-u.from));if(u.sel){let B=vW(e,T.doc,u.sel);B&&!(La&&e.composing&&B.empty&&(m.start!=m.endB||e.input.lastChromeDeleteyA(e),20));let S=C(e.state.tr.delete(y,b)),T=d.resolve(m.start).marksAcross(d.resolve(m.endA));T&&S.ensureMarks(T),e.dispatch(S)}else if(m.endA==m.endB&&(j=GFe(p.parent.content.cut(p.parentOffset,g.parentOffset),v.parent.content.cut(v.parentOffset,m.endA-v.start())))){let S=C(e.state.tr);j.type=="add"?S.addMark(y,b,j.mark):S.removeMark(y,b,j.mark),e.dispatch(S)}else if(p.parent.child(p.index()).isText&&p.index()==g.index()-(g.textOffset?0:1)){let S=p.parent.textBetween(p.parentOffset,g.parentOffset),T=()=>C(e.state.tr.insertText(S,y,b));e.someProp("handleTextInput",B=>B(e,y,b,S,T))||e.dispatch(T())}else e.dispatch(C());else e.dispatch(C())}function vW(e,t,r){return Math.max(r.anchor,r.head)>t.content.size?null:o8(e,t.resolve(r.anchor),t.resolve(r.head))}function GFe(e,t){let r=e.firstChild.marks,n=t.firstChild.marks,i=r,s=n,o,l,c;for(let d=0;dd.mark(l.addToSet(d.marks));else if(i.length==0&&s.length==1)l=s[0],o="remove",c=d=>d.mark(l.removeFromSet(d.marks));else return null;let u=[];for(let d=0;dr||aI(o,!0,!1)0&&(t||e.indexAfter(n)==e.node(n).childCount);)n--,i++,t=!1;if(r){let s=e.node(n).maybeChild(e.indexAfter(n));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function VFe(e,t,r,n,i){let s=e.findDiffStart(t,r);if(s==null)return null;let{a:o,b:l}=e.findDiffEnd(t,r+e.size,r+t.size);if(i=="end"){let c=Math.max(0,s-Math.min(o,l));n-=o+c-s}if(o=o?s-n:0;s-=c,s&&s=l?s-n:0;s-=c,s&&s=56320&&t<=57343&&r>=55296&&r<=56319}class _ue{constructor(t,r){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new fFe,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(NW),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=wW(this),bW(this),this.nodeViews=CW(this),this.docView=eW(this.state.doc,yW(this),sI(this),this.dom,this),this.domObserver=new DFe(this,(n,i,s,o)=>WFe(this,n,i,s,o)),this.domObserver.start(),hFe(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let r in t)this._props[r]=t[r];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&_L(this);let r=this._props;this._props=t,t.plugins&&(t.plugins.forEach(NW),this.directPlugins=t.plugins),this.updateStateInner(t.state,r)}setProps(t){let r={};for(let n in this._props)r[n]=this._props[n];r.state=this.state;for(let n in t)r[n]=t[n];this.update(r)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,r){var n;let i=this.state,s=!1,o=!1;t.storedMarks&&this.composing&&(bue(this),o=!0),this.state=t;let l=i.plugins!=t.plugins||this._props.plugins!=r.plugins;if(l||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let f=CW(this);XFe(f,this.nodeViews)&&(this.nodeViews=f,s=!0)}(l||r.handleDOMEvents!=this._props.handleDOMEvents)&&_L(this),this.editable=wW(this),bW(this);let c=sI(this),u=yW(this),d=i.plugins!=t.plugins&&!i.doc.eq(t.doc)?"reset":t.scrollToSelection>i.scrollToSelection?"to selection":"preserve",A=s||!this.docView.matchesNode(t.doc,u,c);(A||!t.selection.eq(i.selection))&&(o=!0);let h=d=="preserve"&&o&&this.dom.style.overflowAnchor==null&&_Oe(this);if(o){this.domObserver.stop();let f=A&&(Ro||La)&&!this.composing&&!i.selection.empty&&!t.selection.empty&&qFe(i.selection,t.selection);if(A){let m=La?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=BFe(this)),(s||!this.docView.update(t.doc,u,c,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=eW(t.doc,u,c,this.dom,this)),m&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&JOe(this))?yA(this,f):(cue(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((n=this.dragging)===null||n===void 0)&&n.node&&!i.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,i),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():h&&kOe(h)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof Yt){let r=this.docView.domAfterPos(this.state.selection.from);r.nodeType==1&&V9(this,r.getBoundingClientRect(),t)}else V9(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;r0&&this.state.doc.nodeAt(s))==n.node&&(i=s)}this.dragging=new Cue(t.slice,t.move,i<0?void 0:Yt.create(this.state.doc,i))}someProp(t,r){let n=this._props&&this._props[t],i;if(n!=null&&(i=r?r(n):n))return i;for(let o=0;or.ownerDocument.getSelection()),this._root=r}return t||document}updateRoot(){this._root=null}posAtCoords(t){return FOe(this,t)}coordsAtPos(t,r=1){return tue(this,t,r)}domAtPos(t,r=0){return this.docView.domFromPos(t,r)}nodeDOM(t){let r=this.docView.descAt(t);return r?r.nodeDOM:null}posAtDOM(t,r,n=-1){let i=this.docView.posFromDOM(t,r,n);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,r){return UOe(this,r||this.state,t)}pasteHTML(t,r){return a2(this,"",t,!1,r||new ClipboardEvent("paste"))}pasteText(t,r){return a2(this,t,null,!0,r||new ClipboardEvent("paste"))}serializeForClipboard(t){return l8(this,t)}destroy(){this.docView&&(pFe(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],sI(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,gOe())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return gFe(this,t)}domSelectionRange(){let t=this.domSelection();return t?Ao&&this.root.nodeType===11&&wOe(this.dom.ownerDocument)==this.dom&&UFe(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}_ue.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function yW(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",r=>{if(typeof r=="function"&&(r=r(e.state)),r)for(let n in r)n=="class"?t.class+=" "+r[n]:n=="style"?t.style=(t.style?t.style+";":"")+r[n]:!t[n]&&n!="contenteditable"&&n!="nodeName"&&(t[n]=String(r[n]))}),t.translate||(t.translate="no"),[ro.node(0,e.state.doc.content.size,t)]}function bW(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:ro.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function wW(e){return!e.someProp("editable",t=>t(e.state)===!1)}function qFe(e,t){let r=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(r)!=t.$anchor.start(r)}function CW(e){let t=Object.create(null);function r(n){for(let i in n)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=n[i])}return e.someProp("nodeViews",r),e.someProp("markViews",r),t}function XFe(e,t){let r=0,n=0;for(let i in e){if(e[i]!=t[i])return!0;r++}for(let i in t)n++;return r!=n}function NW(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var $h={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},C_={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},YFe=typeof navigator<"u"&&/Mac/.test(navigator.platform),JFe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var la=0;la<10;la++)$h[48+la]=$h[96+la]=String(la);for(var la=1;la<=24;la++)$h[la+111]="F"+la;for(var la=65;la<=90;la++)$h[la]=String.fromCharCode(la+32),C_[la]=String.fromCharCode(la);for(var oI in $h)C_.hasOwnProperty(oI)||(C_[oI]=$h[oI]);function ZFe(e){var t=YFe&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||JFe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",r=!t&&e.key||(e.shiftKey?C_:$h)[e.keyCode]||e.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}const eLe=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),tLe=typeof navigator<"u"&&/Win/.test(navigator.platform);function rLe(e){let t=e.split(/-(?!$)/),r=t[t.length-1];r=="Space"&&(r=" ");let n,i,s,o;for(let l=0;l{for(var r in t)sLe(e,r,{get:t[r],enumerable:!0})};function DE(e){const{state:t,transaction:r}=e;let{selection:n}=r,{doc:i}=r,{storedMarks:s}=r;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return s},get selection(){return n},get doc(){return i},get tr(){return n=r.selection,i=r.doc,s=r.storedMarks,r}}}var RE=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:n}=t,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([o,l])=>[o,(...u)=>{const d=l(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&n.dispatch(i),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:n,state:i}=this,{view:s}=n,o=[],l=!!e,c=e||i.tr,u=()=>(!l&&t&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),o.every(A=>A===!0)),d={...Object.fromEntries(Object.entries(r).map(([A,h])=>[A,(...m)=>{const p=this.buildProps(c,t),g=h(...m)(p);return o.push(g),d}])),run:u};return d}createCan(e){const{rawCommands:t,state:r}=this,n=!1,i=e||r.tr,s=this.buildProps(i,n);return{...Object.fromEntries(Object.entries(t).map(([l,c])=>[l,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,n)}}buildProps(e,t=!0){const{rawCommands:r,editor:n,state:i}=this,{view:s}=n,o={tr:e,editor:n,view:s,state:DE({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(o)]))}};return o}},Eue={};h8(Eue,{blur:()=>aLe,clearContent:()=>oLe,clearNodes:()=>lLe,command:()=>cLe,createParagraphNear:()=>uLe,cut:()=>dLe,deleteCurrentNode:()=>ALe,deleteNode:()=>fLe,deleteRange:()=>hLe,deleteSelection:()=>pLe,enter:()=>mLe,exitCode:()=>gLe,extendMarkRange:()=>vLe,first:()=>xLe,focus:()=>bLe,forEach:()=>wLe,insertContent:()=>CLe,insertContentAt:()=>SLe,joinBackward:()=>kLe,joinDown:()=>_Le,joinForward:()=>ELe,joinItemBackward:()=>TLe,joinItemForward:()=>PLe,joinTextblockBackward:()=>ILe,joinTextblockForward:()=>OLe,joinUp:()=>BLe,keyboardShortcut:()=>LLe,lift:()=>MLe,liftEmptyBlock:()=>DLe,liftListItem:()=>RLe,newlineInCode:()=>ULe,resetAttributes:()=>QLe,scrollIntoView:()=>HLe,selectAll:()=>$Le,selectNodeBackward:()=>zLe,selectNodeForward:()=>WLe,selectParentNode:()=>GLe,selectTextblockEnd:()=>KLe,selectTextblockStart:()=>VLe,setContent:()=>qLe,setMark:()=>fMe,setMeta:()=>hMe,setNode:()=>pMe,setNodeSelection:()=>mMe,setTextSelection:()=>gMe,sinkListItem:()=>vMe,splitBlock:()=>xMe,splitListItem:()=>yMe,toggleList:()=>bMe,toggleMark:()=>wMe,toggleNode:()=>CMe,toggleWrap:()=>NMe,undoInputRule:()=>jMe,unsetAllMarks:()=>SMe,unsetMark:()=>BMe,updateAttributes:()=>_Me,wrapIn:()=>kMe,wrapInList:()=>EMe});var aLe=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var r;e.isDestroyed||(t.dom.blur(),(r=window==null?void 0:window.getSelection())==null||r.removeAllRanges())}),!0),oLe=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),lLe=()=>({state:e,tr:t,dispatch:r})=>{const{selection:n}=t,{ranges:i}=n;return r&&i.forEach(({$from:s,$to:o})=>{e.doc.nodesBetween(s.pos,o.pos,(l,c)=>{if(l.type.isText)return;const{doc:u,mapping:d}=t,A=u.resolve(d.map(c)),h=u.resolve(d.map(c+l.nodeSize)),f=A.blockRange(h);if(!f)return;const m=D0(f);if(l.type.isTextblock){const{defaultType:p}=A.parent.contentMatchAt(A.index());t.setNodeMarkup(f.start,p)}(m||m===0)&&t.lift(f,m)})}),!0},cLe=e=>t=>e(t),uLe=()=>({state:e,dispatch:t})=>nOe(e,t),dLe=(e,t)=>({editor:r,tr:n})=>{const{state:i}=r,s=i.doc.slice(e.from,e.to);n.deleteRange(e.from,e.to);const o=n.mapping.map(t);return n.insert(o,s.content),n.setSelection(new gr(n.doc.resolve(Math.max(o-1,0)))),!0},ALe=()=>({tr:e,dispatch:t})=>{const{selection:r}=e,n=r.$anchor.node();if(n.content.size>0)return!1;const i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===n.type){if(t){const l=i.before(s),c=i.after(s);e.delete(l,c).scrollIntoView()}return!0}return!1};function fs(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var fLe=e=>({tr:t,state:r,dispatch:n})=>{const i=fs(e,r.schema),s=t.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(n){const c=s.before(o),u=s.after(o);t.delete(c,u).scrollIntoView()}return!0}return!1},hLe=e=>({tr:t,dispatch:r})=>{const{from:n,to:i}=e;return r&&t.delete(n,i),!0},pLe=()=>({state:e,dispatch:t})=>W3e(e,t),mLe=()=>({commands:e})=>e.keyboardShortcut("Enter"),gLe=()=>({state:e,dispatch:t})=>rOe(e,t);function p8(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function N_(e,t,r={strict:!0}){const n=Object.keys(t);return n.length?n.every(i=>r.strict?t[i]===e[i]:p8(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function Tue(e,t,r={}){return e.find(n=>n.type===t&&N_(Object.fromEntries(Object.keys(r).map(i=>[i,n.attrs[i]])),r))}function jW(e,t,r={}){return!!Tue(e,t,r)}function m8(e,t,r){var n;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if((!i.node||!i.node.marks.some(d=>d.type===t))&&(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(d=>d.type===t)||(r=r||((n=i.node.marks[0])==null?void 0:n.attrs),!Tue([...i.node.marks],t,r)))return;let o=i.index,l=e.start()+i.offset,c=o+1,u=l+i.node.nodeSize;for(;o>0&&jW([...e.parent.child(o-1).marks],t,r);)o-=1,l-=e.parent.child(o).nodeSize;for(;c({tr:r,state:n,dispatch:i})=>{const s=HA(e,n.schema),{doc:o,selection:l}=r,{$from:c,from:u,to:d}=l;if(i){const A=m8(c,s,t);if(A&&A.from<=u&&A.to>=d){const h=gr.create(o,A.from,A.to);r.setSelection(h)}}return!0},xLe=e=>t=>{const r=typeof e=="function"?e(t):e;for(let n=0;n({editor:r,view:n,tr:i,dispatch:s})=>{t={scrollIntoView:!0,...t};const o=()=>{(g8()||yLe())&&n.dom.focus(),requestAnimationFrame(()=>{r.isDestroyed||(n.focus(),t!=null&&t.scrollIntoView&&r.commands.scrollIntoView())})};if(n.hasFocus()&&e===null||e===!1)return!0;if(s&&e===null&&!Pue(r.state.selection))return o(),!0;const l=Iue(i.doc,e)||r.state.selection,c=r.state.selection.eq(l);return s&&(c||i.setSelection(l),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},wLe=(e,t)=>r=>e.every((n,i)=>t(n,{...r,index:i})),CLe=(e,t)=>({tr:r,commands:n})=>n.insertContentAt({from:r.selection.from,to:r.selection.to},e,t),Oue=e=>{const t=e.childNodes;for(let r=t.length-1;r>=0;r-=1){const n=t[r];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?e.removeChild(n):n.nodeType===1&&Oue(n)}return e};function gj(e){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`${e}`,r=new window.DOMParser().parseFromString(t,"text/html").body;return Oue(r)}function l2(e,t,r){if(e instanceof Nh||e instanceof Je)return e;r={slice:!0,parseOptions:{},...r};const n=typeof e=="object"&&e!==null,i=typeof e=="string";if(n)try{if(Array.isArray(e)&&e.length>0)return Je.fromArray(e.map(l=>t.nodeFromJSON(l)));const o=t.nodeFromJSON(e);return r.errorOnInvalidContent&&o.check(),o}catch(s){if(r.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",s),l2("",t,r)}if(i){if(r.errorOnInvalidContent){let o=!1,l="";const c=new Nce({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,l=typeof u=="string"?u:u.outerHTML,null)}]}})});if(r.slice?jh.fromSchema(c).parseSlice(gj(e),r.parseOptions):jh.fromSchema(c).parse(gj(e),r.parseOptions),r.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const s=jh.fromSchema(t);return r.slice?s.parseSlice(gj(e),r.parseOptions).content:s.parse(gj(e),r.parseOptions)}return l2("",t,r)}function NLe(e,t,r){const n=e.steps.length-1;if(n{o===0&&(o=d)}),e.setSelection(Ir.near(e.doc.resolve(o),r))}var jLe=e=>!("type"in e),SLe=(e,t,r)=>({tr:n,dispatch:i,editor:s})=>{var o;if(i){r={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...r};let l;const c=g=>{s.emit("contentError",{editor:s,error:g,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...r.parseOptions};if(!r.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{l2(t,s.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(g){c(g)}try{l=l2(t,s.schema,{parseOptions:u,errorOnInvalidContent:(o=r.errorOnInvalidContent)!=null?o:s.options.enableContentCheck})}catch(g){return c(g),!1}let{from:d,to:A}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},h=!0,f=!0;if((jLe(l)?l:[l]).forEach(g=>{g.check(),h=h?g.isText&&g.marks.length===0:!1,f=f?g.isBlock:!1}),d===A&&f){const{parent:g}=n.doc.resolve(d);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(d-=1,A+=1)}let p;if(h){if(Array.isArray(t))p=t.map(g=>g.text||"").join("");else if(t instanceof Je){let g="";t.forEach(v=>{v.text&&(g+=v.text)}),p=g}else typeof t=="object"&&t&&t.text?p=t.text:p=t;n.insertText(p,d,A)}else{p=l;const g=n.doc.resolve(d),v=g.node(),x=g.parentOffset===0,y=v.isText||v.isTextblock,b=v.content.size>0;x&&y&&b&&(d=Math.max(0,d-1)),n.replaceWith(d,A,p)}r.updateSelection&&NLe(n,n.steps.length-1,-1),r.applyInputRules&&n.setMeta("applyInputRules",{from:d,text:p}),r.applyPasteRules&&n.setMeta("applyPasteRules",{from:d,text:p})}return!0},BLe=()=>({state:e,dispatch:t})=>J3e(e,t),_Le=()=>({state:e,dispatch:t})=>Z3e(e,t),kLe=()=>({state:e,dispatch:t})=>G3e(e,t),ELe=()=>({state:e,dispatch:t})=>X3e(e,t),TLe=()=>({state:e,dispatch:t,tr:r})=>{try{const n=PE(e.doc,e.selection.$from.pos,-1);return n==null?!1:(r.join(n,2),t&&t(r),!0)}catch{return!1}},PLe=()=>({state:e,dispatch:t,tr:r})=>{try{const n=PE(e.doc,e.selection.$from.pos,1);return n==null?!1:(r.join(n,2),t&&t(r),!0)}catch{return!1}},ILe=()=>({state:e,dispatch:t})=>K3e(e,t),OLe=()=>({state:e,dispatch:t})=>V3e(e,t);function Fue(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function FLe(e){const t=e.split(/-(?!$)/);let r=t[t.length-1];r==="Space"&&(r=" ");let n,i,s,o;for(let l=0;l({editor:t,view:r,tr:n,dispatch:i})=>{const s=FLe(e).split(/-(?!$)/),o=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=t.captureTransaction(()=>{r.someProp("handleKeyDown",u=>u(r,l))});return c==null||c.steps.forEach(u=>{const d=u.map(n.mapping);d&&i&&n.maybeStep(d)}),!0};function zh(e,t,r={}){const{from:n,to:i,empty:s}=e.selection,o=t?fs(t,e.schema):null,l=[];e.doc.nodesBetween(n,i,(A,h)=>{if(A.isText)return;const f=Math.max(n,h),m=Math.min(i,h+A.nodeSize);l.push({node:A,from:f,to:m})});const c=i-n,u=l.filter(A=>o?o.name===A.node.type.name:!0).filter(A=>N_(A.node.attrs,r,{strict:!1}));return s?!!u.length:u.reduce((A,h)=>A+h.to-h.from,0)>=c}var MLe=(e,t={})=>({state:r,dispatch:n})=>{const i=fs(e,r.schema);return zh(r,i,t)?eOe(r,n):!1},DLe=()=>({state:e,dispatch:t})=>iOe(e,t),RLe=e=>({state:t,dispatch:r})=>{const n=fs(e,t.schema);return fOe(n)(t,r)},ULe=()=>({state:e,dispatch:t})=>tOe(e,t);function UE(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function SW(e,t){const r=typeof t=="string"?[t]:t;return Object.keys(e).reduce((n,i)=>(r.includes(i)||(n[i]=e[i]),n),{})}var QLe=(e,t)=>({tr:r,state:n,dispatch:i})=>{let s=null,o=null;const l=UE(typeof e=="string"?e:e.name,n.schema);return l?(l==="node"&&(s=fs(e,n.schema)),l==="mark"&&(o=HA(e,n.schema)),i&&r.selection.ranges.forEach(c=>{n.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,d)=>{s&&s===u.type&&r.setNodeMarkup(d,void 0,SW(u.attrs,t)),o&&u.marks.length&&u.marks.forEach(A=>{o===A.type&&r.addMark(d,d+u.nodeSize,o.create(SW(A.attrs,t)))})})}),!0):!1},HLe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),$Le=()=>({tr:e,dispatch:t})=>{if(t){const r=new uc(e.doc);e.setSelection(r)}return!0},zLe=()=>({state:e,dispatch:t})=>q3e(e,t),WLe=()=>({state:e,dispatch:t})=>Y3e(e,t),GLe=()=>({state:e,dispatch:t})=>sOe(e,t),KLe=()=>({state:e,dispatch:t})=>lOe(e,t),VLe=()=>({state:e,dispatch:t})=>oOe(e,t);function kL(e,t,r={},n={}){return l2(e,t,{slice:!1,parseOptions:r,errorOnInvalidContent:n.errorOnInvalidContent})}var qLe=(e,{errorOnInvalidContent:t,emitUpdate:r=!0,parseOptions:n={}}={})=>({editor:i,tr:s,dispatch:o,commands:l})=>{const{doc:c}=s;if(n.preserveWhitespace!=="full"){const u=kL(e,i.schema,n,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&s.replaceWith(0,c.content.size,u).setMeta("preventUpdate",!r),!0}return o&&s.setMeta("preventUpdate",!r),l.insertContentAt({from:0,to:c.content.size},e,{parseOptions:n,errorOnInvalidContent:t??i.options.enableContentCheck})};function Lue(e,t){const r=HA(t,e.schema),{from:n,to:i,empty:s}=e.selection,o=[];s?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(n,i,c=>{o.push(...c.marks)});const l=o.find(c=>c.type.name===r.name);return l?{...l.attrs}:{}}function Mue(e,t){const r=new Uce(e);return t.forEach(n=>{n.steps.forEach(i=>{r.step(i)})}),r}function XLe(e){for(let t=0;t{r(i)&&n.push({node:i,pos:s})}),n}function JLe(e,t){for(let r=e.depth;r>0;r-=1){const n=e.node(r);if(t(n))return{pos:r>0?e.before(r):0,start:e.start(r),depth:r,node:n}}}function QE(e){return t=>JLe(t.$from,e)}function Vt(e,t,r){return e.config[t]===void 0&&e.parent?Vt(e.parent,t,r):typeof e.config[t]=="function"?e.config[t].bind({...r,parent:e.parent?Vt(e.parent,t,r):null}):e.config[t]}function v8(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},n=Vt(t,"addExtensions",r);return n?[t,...v8(n())]:t}).flat(10)}function x8(e,t){const r=Fg.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(r),i.innerHTML}function Due(e){return typeof e=="function"}function wn(e,t=void 0,...r){return Due(e)?t?e.bind(t)(...r):e(...r):e}function ZLe(e={}){return Object.keys(e).length===0&&e.constructor===Object}function c2(e){const t=e.filter(i=>i.type==="extension"),r=e.filter(i=>i.type==="node"),n=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:r,markExtensions:n}}function Rue(e){const t=[],{nodeExtensions:r,markExtensions:n}=c2(e),i=[...r,...n],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(o=>{const l={name:o.name,options:o.options,storage:o.storage,extensions:i},c=Vt(o,"addGlobalAttributes",l);if(!c)return;c().forEach(d=>{d.types.forEach(A=>{Object.entries(d.attributes).forEach(([h,f])=>{t.push({type:A,name:h,attribute:{...s,...f}})})})})}),i.forEach(o=>{const l={name:o.name,options:o.options,storage:o.storage},c=Vt(o,"addAttributes",l);if(!c)return;const u=c();Object.entries(u).forEach(([d,A])=>{const h={...s,...A};typeof(h==null?void 0:h.default)=="function"&&(h.default=h.default()),h!=null&&h.isRequired&&(h==null?void 0:h.default)===void 0&&delete h.default,t.push({type:o.name,name:d,attribute:h})})}),t}function Ji(...e){return e.filter(t=>!!t).reduce((t,r)=>{const n={...t};return Object.entries(r).forEach(([i,s])=>{if(!n[i]){n[i]=s;return}if(i==="class"){const l=s?String(s).split(" "):[],c=n[i]?n[i].split(" "):[],u=l.filter(d=>!c.includes(d));n[i]=[...c,...u].join(" ")}else if(i==="style"){const l=s?s.split(";").map(d=>d.trim()).filter(Boolean):[],c=n[i]?n[i].split(";").map(d=>d.trim()).filter(Boolean):[],u=new Map;c.forEach(d=>{const[A,h]=d.split(":").map(f=>f.trim());u.set(A,h)}),l.forEach(d=>{const[A,h]=d.split(":").map(f=>f.trim());u.set(A,h)}),n[i]=Array.from(u.entries()).map(([d,A])=>`${d}: ${A}`).join("; ")}else n[i]=s}),n},{})}function j_(e,t){return t.filter(r=>r.type===e.type.name).filter(r=>r.attribute.rendered).map(r=>r.attribute.renderHTML?r.attribute.renderHTML(e.attrs)||{}:{[r.name]:e.attrs[r.name]}).reduce((r,n)=>Ji(r,n),{})}function eMe(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function BW(e,t){return"style"in e?e:{...e,getAttrs:r=>{const n=e.getAttrs?e.getAttrs(r):e.attrs;if(n===!1)return!1;const i=t.reduce((s,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(r):eMe(r.getAttribute(o.name));return l==null?s:{...s,[o.name]:l}},{});return{...n,...i}}}}function _W(e){return Object.fromEntries(Object.entries(e).filter(([t,r])=>t==="attrs"&&ZLe(r)?!1:r!=null))}function kW(e){var t,r,n;const i={};return!((t=e==null?void 0:e.attribute)!=null&&t.isRequired)&&((r=e==null?void 0:e.attribute)==null?void 0:r.default)!==void 0&&(i.default=e.attribute.default),((n=e==null?void 0:e.attribute)==null?void 0:n.validate)!==void 0&&(i.validate=e.attribute.validate),[e.name,i]}function tMe(e,t){var r;const n=Rue(e),{nodeExtensions:i,markExtensions:s}=c2(e),o=(r=i.find(u=>Vt(u,"topNode")))==null?void 0:r.name,l=Object.fromEntries(i.map(u=>{const d=n.filter(v=>v.type===u.name),A={name:u.name,options:u.options,storage:u.storage,editor:t},h=e.reduce((v,x)=>{const y=Vt(x,"extendNodeSchema",A);return{...v,...y?y(u):{}}},{}),f=_W({...h,content:wn(Vt(u,"content",A)),marks:wn(Vt(u,"marks",A)),group:wn(Vt(u,"group",A)),inline:wn(Vt(u,"inline",A)),atom:wn(Vt(u,"atom",A)),selectable:wn(Vt(u,"selectable",A)),draggable:wn(Vt(u,"draggable",A)),code:wn(Vt(u,"code",A)),whitespace:wn(Vt(u,"whitespace",A)),linebreakReplacement:wn(Vt(u,"linebreakReplacement",A)),defining:wn(Vt(u,"defining",A)),isolating:wn(Vt(u,"isolating",A)),attrs:Object.fromEntries(d.map(kW))}),m=wn(Vt(u,"parseHTML",A));m&&(f.parseDOM=m.map(v=>BW(v,d)));const p=Vt(u,"renderHTML",A);p&&(f.toDOM=v=>p({node:v,HTMLAttributes:j_(v,d)}));const g=Vt(u,"renderText",A);return g&&(f.toText=g),[u.name,f]})),c=Object.fromEntries(s.map(u=>{const d=n.filter(g=>g.type===u.name),A={name:u.name,options:u.options,storage:u.storage,editor:t},h=e.reduce((g,v)=>{const x=Vt(v,"extendMarkSchema",A);return{...g,...x?x(u):{}}},{}),f=_W({...h,inclusive:wn(Vt(u,"inclusive",A)),excludes:wn(Vt(u,"excludes",A)),group:wn(Vt(u,"group",A)),spanning:wn(Vt(u,"spanning",A)),code:wn(Vt(u,"code",A)),attrs:Object.fromEntries(d.map(kW))}),m=wn(Vt(u,"parseHTML",A));m&&(f.parseDOM=m.map(g=>BW(g,d)));const p=Vt(u,"renderHTML",A);return p&&(f.toDOM=g=>p({mark:g,HTMLAttributes:j_(g,d)})),[u.name,f]}));return new Nce({topNode:o,nodes:l,marks:c})}function rMe(e){const t=e.filter((r,n)=>e.indexOf(r)!==n);return Array.from(new Set(t))}function y8(e){return e.sort((r,n)=>{const i=Vt(r,"priority")||100,s=Vt(n,"priority")||100;return i>s?-1:in.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(n=>`'${n}'`).join(", ")}]. This can lead to issues.`),t}function Que(e,t,r){const{from:n,to:i}=t,{blockSeparator:s=` `,textSerializers:o={}}=r||{};let l="";return e.nodesBetween(n,i,(c,u,d,A)=>{var h;c.isBlock&&u>n&&(l+=s);const f=o==null?void 0:o[c.type.name];if(f)return d&&(l+=f({node:c,pos:u,parent:d,index:A,range:t})),!1;c.isText&&(l+=(h=c==null?void 0:c.text)==null?void 0:h.slice(Math.max(n,u)-u,i-u))}),l}function nMe(e,t){const r={from:0,to:e.content.size};return Que(e,r,t)}function Hue(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,r])=>[t,r.spec.toText]))}function iMe(e,t){const r=fs(t,e.schema),{from:n,to:i}=e.selection,s=[];e.doc.nodesBetween(n,i,l=>{s.push(l)});const o=s.reverse().find(l=>l.type.name===r.name);return o?{...o.attrs}:{}}function $ue(e,t){const r=UE(typeof t=="string"?t:t.name,e.schema);return r==="node"?iMe(e,t):r==="mark"?Lue(e,t):{}}function sMe(e,t=JSON.stringify){const r={};return e.filter(n=>{const i=t(n);return Object.prototype.hasOwnProperty.call(r,i)?!1:r[i]=!0})}function aMe(e){const t=sMe(e);return t.length===1?t:t.filter((r,n)=>!t.filter((s,o)=>o!==n).some(s=>r.oldRange.from>=s.oldRange.from&&r.oldRange.to<=s.oldRange.to&&r.newRange.from>=s.newRange.from&&r.newRange.to<=s.newRange.to))}function zue(e){const{mapping:t,steps:r}=e,n=[];return t.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((l,c)=>{o.push({from:l,to:c})});else{const{from:l,to:c}=r[s];if(l===void 0||c===void 0)return;o.push({from:l,to:c})}o.forEach(({from:l,to:c})=>{const u=t.slice(s).map(l,-1),d=t.slice(s).map(c),A=t.invert().map(u,-1),h=t.invert().map(d);n.push({oldRange:{from:A,to:h},newRange:{from:u,to:d}})})}),aMe(n)}function b8(e,t,r){const n=[];return e===t?r.resolve(e).marks().forEach(i=>{const s=r.resolve(e),o=m8(s,i.type);o&&n.push({mark:i,...o})}):r.nodesBetween(e,t,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||n.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),n}var oMe=(e,t,r,n=20)=>{const i=e.doc.resolve(r);let s=n,o=null;for(;s>0&&o===null;){const l=i.node(s);(l==null?void 0:l.type.name)===t?o=l:s-=1}return[o,s]};function cI(e,t){return t.nodes[e]||t.marks[e]||null}function VS(e,t,r){return Object.fromEntries(Object.entries(r).filter(([n])=>{const i=e.find(s=>s.type===t&&s.name===n);return i?i.attribute.keepOnSplit:!1}))}var lMe=(e,t=500)=>{let r="";const n=e.parentOffset;return e.parent.nodesBetween(Math.max(0,n-t),n,(i,s,o,l)=>{var c,u;const d=((u=(c=i.type.spec).toText)==null?void 0:u.call(c,{node:i,pos:s,parent:o,index:l}))||i.textContent||"%leaf%";r+=i.isAtom&&!i.isText?d:d.slice(0,Math.max(0,n-s))}),r};function EL(e,t,r={}){const{empty:n,ranges:i}=e.selection,s=t?HA(t,e.schema):null;if(n)return!!(e.storedMarks||e.selection.$from.marks()).filter(A=>s?s.name===A.type.name:!0).find(A=>N_(A.attrs,r,{strict:!1}));let o=0;const l=[];if(i.forEach(({$from:A,$to:h})=>{const f=A.pos,m=h.pos;e.doc.nodesBetween(f,m,(p,g)=>{if(!p.isText&&!p.marks.length)return;const v=Math.max(f,g),x=Math.min(m,g+p.nodeSize),y=x-v;o+=y,l.push(...p.marks.map(b=>({mark:b,from:v,to:x})))})}),o===0)return!1;const c=l.filter(A=>s?s.name===A.mark.type.name:!0).filter(A=>N_(A.mark.attrs,r,{strict:!1})).reduce((A,h)=>A+h.to-h.from,0),u=l.filter(A=>s?A.mark.type!==s&&A.mark.type.excludes(s):!0).reduce((A,h)=>A+h.to-h.from,0);return(c>0?c+u:c)>=o}function cMe(e,t,r={}){if(!t)return zh(e,null,r)||EL(e,null,r);const n=UE(t,e.schema);return n==="node"?zh(e,t,r):n==="mark"?EL(e,t,r):!1}var uMe=(e,t)=>{const{$from:r,$to:n,$anchor:i}=e.selection;if(t){const s=QE(l=>l.type.name===t)(e.selection);if(!s)return!1;const o=e.doc.resolve(s.pos+1);return i.pos+1===o.end()}return!(n.parentOffset{const{$from:t,$to:r}=e.selection;return!(t.parentOffset>0||t.pos!==r.pos)};function EW(e,t){return Array.isArray(t)?t.some(r=>(typeof r=="string"?r:r.name)===e.name):t}function TW(e,t){const{nodeExtensions:r}=c2(t),n=r.find(o=>o.name===e);if(!n)return!1;const i={name:n.name,options:n.options,storage:n.storage},s=wn(Vt(n,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function HE(e,{checkChildren:t=!0,ignoreWhitespace:r=!1}={}){var n;if(r){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((n=e.text)!=null?n:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let i=!0;return e.content.forEach(s=>{i!==!1&&(HE(s,{ignoreWhitespace:r,checkChildren:t})||(i=!1))}),i}return!1}function Wue(e){return e instanceof Yt}function AMe(e,t,r){var n;const{selection:i}=t;let s=null;if(Pue(i)&&(s=i.$cursor),s){const l=(n=e.storedMarks)!=null?n:s.marks();return s.parent.type.allowsMarkType(r)&&(!!r.isInSet(l)||!l.some(u=>u.type.excludes(r)))}const{ranges:o}=i;return o.some(({$from:l,$to:c})=>{let u=l.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(r):!1;return e.doc.nodesBetween(l.pos,c.pos,(d,A,h)=>{if(u)return!1;if(d.isInline){const f=!h||h.type.allowsMarkType(r),m=!!r.isInSet(d.marks)||!d.marks.some(p=>p.type.excludes(r));u=f&&m}return!u}),u})}var fMe=(e,t={})=>({tr:r,state:n,dispatch:i})=>{const{selection:s}=r,{empty:o,ranges:l}=s,c=HA(e,n.schema);if(i)if(o){const u=Lue(n,c);r.addStoredMark(c.create({...u,...t}))}else l.forEach(u=>{const d=u.$from.pos,A=u.$to.pos;n.doc.nodesBetween(d,A,(h,f)=>{const m=Math.max(f,d),p=Math.min(f+h.nodeSize,A);h.marks.find(v=>v.type===c)?h.marks.forEach(v=>{c===v.type&&r.addMark(m,p,c.create({...v.attrs,...t}))}):r.addMark(m,p,c.create(t))})});return AMe(n,r,c)},hMe=(e,t)=>({tr:r})=>(r.setMeta(e,t),!0),pMe=(e,t={})=>({state:r,dispatch:n,chain:i})=>{const s=fs(e,r.schema);let o;return r.selection.$anchor.sameParent(r.selection.$head)&&(o=r.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:l})=>W9(s,{...o,...t})(r)?!0:l.clearNodes()).command(({state:l})=>W9(s,{...o,...t})(l,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},mMe=e=>({tr:t,dispatch:r})=>{if(r){const{doc:n}=t,i=om(e,0,n.content.size),s=Yt.create(n,i);t.setSelection(s)}return!0},gMe=e=>({tr:t,dispatch:r})=>{if(r){const{doc:n}=t,{from:i,to:s}=typeof e=="number"?{from:e,to:e}:e,o=gr.atStart(n).from,l=gr.atEnd(n).to,c=om(i,o,l),u=om(s,o,l),d=gr.create(n,c,u);t.setSelection(d)}return!0},vMe=e=>({state:t,dispatch:r})=>{const n=fs(e,t.schema);return mOe(n)(t,r)};function PW(e,t){const r=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(r){const n=r.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(n)}}var xMe=({keepMarks:e=!0}={})=>({tr:t,state:r,dispatch:n,editor:i})=>{const{selection:s,doc:o}=t,{$from:l,$to:c}=s,u=i.extensionManager.attributes,d=VS(u,l.node().type.name,l.node().attrs);if(s instanceof Yt&&s.node.isBlock)return!l.parentOffset||!Ux(o,l.pos)?!1:(n&&(e&&PW(r,i.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const A=c.parentOffset===c.parent.content.size,h=l.depth===0?void 0:XLe(l.node(-1).contentMatchAt(l.indexAfter(-1)));let f=A&&h?[{type:h,attrs:d}]:void 0,m=Ux(t.doc,t.mapping.map(l.pos),1,f);if(!f&&!m&&Ux(t.doc,t.mapping.map(l.pos),1,h?[{type:h}]:void 0)&&(m=!0,f=h?[{type:h,attrs:d}]:void 0),n){if(m&&(s instanceof gr&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,f),h&&!A&&!l.parentOffset&&l.parent.type!==h)){const p=t.mapping.map(l.before()),g=t.doc.resolve(p);l.node(-1).canReplaceWith(g.index(),g.index()+1,h)&&t.setNodeMarkup(t.mapping.map(l.before()),h)}e&&PW(r,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},yMe=(e,t={})=>({tr:r,state:n,dispatch:i,editor:s})=>{var o;const l=fs(e,n.schema),{$from:c,$to:u}=n.selection,d=n.selection.node;if(d&&d.isBlock||c.depth<2||!c.sameParent(u))return!1;const A=c.node(-1);if(A.type!==l)return!1;const h=s.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let v=Je.empty;const x=c.index(-1)?1:c.index(-2)?2:3;for(let T=c.depth-x;T>=c.depth-3;T-=1)v=Je.from(c.node(T).copy(v));const y=c.indexAfter(-1){if(S>-1)return!1;T.isTextblock&&T.content.size===0&&(S=B+1)}),S>-1&&r.setSelection(gr.near(r.doc.resolve(S))),r.scrollIntoView()}return!0}const f=u.pos===c.end()?A.contentMatchAt(0).defaultType:null,m={...VS(h,A.type.name,A.attrs),...t},p={...VS(h,c.node().type.name,c.node().attrs),...t};r.delete(c.pos,u.pos);const g=f?[{type:l,attrs:m},{type:f,attrs:p}]:[{type:l,attrs:m}];if(!Ux(r.doc,c.pos,2))return!1;if(i){const{selection:v,storedMarks:x}=n,{splittableMarks:y}=s.extensionManager,b=x||v.$to.parentOffset&&v.$from.marks();if(r.split(c.pos,2,g).scrollIntoView(),!b||!i)return!0;const C=b.filter(j=>y.includes(j.type.name));r.ensureMarks(C)}return!0},uI=(e,t)=>{const r=QE(o=>o.type===t)(e.selection);if(!r)return!0;const n=e.doc.resolve(Math.max(0,r.pos-1)).before(r.depth);if(n===void 0)return!0;const i=e.doc.nodeAt(n);return r.node.type===(i==null?void 0:i.type)&&sp(e.doc,r.pos)&&e.join(r.pos),!0},dI=(e,t)=>{const r=QE(o=>o.type===t)(e.selection);if(!r)return!0;const n=e.doc.resolve(r.start).after(r.depth);if(n===void 0)return!0;const i=e.doc.nodeAt(n);return r.node.type===(i==null?void 0:i.type)&&sp(e.doc,n)&&e.join(n),!0},bMe=(e,t,r,n={})=>({editor:i,tr:s,state:o,dispatch:l,chain:c,commands:u,can:d})=>{const{extensions:A,splittableMarks:h}=i.extensionManager,f=fs(e,o.schema),m=fs(t,o.schema),{selection:p,storedMarks:g}=o,{$from:v,$to:x}=p,y=v.blockRange(x),b=g||p.$to.parentOffset&&p.$from.marks();if(!y)return!1;const C=QE(j=>TW(j.type.name,A))(p);if(y.depth>=1&&C&&y.depth-C.depth<=1){if(C.node.type===f)return u.liftListItem(m);if(TW(C.node.type.name,A)&&f.validContent(C.node.content)&&l)return c().command(()=>(s.setNodeMarkup(C.pos,f),!0)).command(()=>uI(s,f)).command(()=>dI(s,f)).run()}return!r||!b||!l?c().command(()=>d().wrapInList(f,n)?!0:u.clearNodes()).wrapInList(f,n).command(()=>uI(s,f)).command(()=>dI(s,f)).run():c().command(()=>{const j=d().wrapInList(f,n),S=b.filter(T=>h.includes(T.type.name));return s.ensureMarks(S),j?!0:u.clearNodes()}).wrapInList(f,n).command(()=>uI(s,f)).command(()=>dI(s,f)).run()},wMe=(e,t={},r={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:s=!1}=r,o=HA(e,n.schema);return EL(n,o,t)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,t)},CMe=(e,t,r={})=>({state:n,commands:i})=>{const s=fs(e,n.schema),o=fs(t,n.schema),l=zh(n,s,r);let c;return n.selection.$anchor.sameParent(n.selection.$head)&&(c=n.selection.$anchor.parent.attrs),l?i.setNode(o,c):i.setNode(s,{...c,...r})},NMe=(e,t={})=>({state:r,commands:n})=>{const i=fs(e,r.schema);return zh(r,i,t)?n.lift(i):n.wrapIn(i,t)},jMe=()=>({state:e,dispatch:t})=>{const r=e.plugins;for(let n=0;n=0;c-=1)o.step(l.steps[c].invert(l.docs[c]));if(s.text){const c=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,e.schema.text(s.text,c))}else o.delete(s.from,s.to)}return!0}}return!1},SMe=()=>({tr:e,dispatch:t})=>{const{selection:r}=e,{empty:n,ranges:i}=r;return n||t&&i.forEach(s=>{e.removeMark(s.$from.pos,s.$to.pos)}),!0},BMe=(e,t={})=>({tr:r,state:n,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=t,{selection:l}=r,c=HA(e,n.schema),{$from:u,empty:d,ranges:A}=l;if(!i)return!0;if(d&&o){let{from:h,to:f}=l;const m=(s=u.marks().find(g=>g.type===c))==null?void 0:s.attrs,p=m8(u,c,m);p&&(h=p.from,f=p.to),r.removeMark(h,f,c)}else A.forEach(h=>{r.removeMark(h.$from.pos,h.$to.pos,c)});return r.removeStoredMark(c),!0},_Me=(e,t={})=>({tr:r,state:n,dispatch:i})=>{let s=null,o=null;const l=UE(typeof e=="string"?e:e.name,n.schema);return l?(l==="node"&&(s=fs(e,n.schema)),l==="mark"&&(o=HA(e,n.schema)),i&&r.selection.ranges.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;let A,h,f,m;r.selection.empty?n.doc.nodesBetween(u,d,(p,g)=>{s&&s===p.type&&(f=Math.max(g,u),m=Math.min(g+p.nodeSize,d),A=g,h=p)}):n.doc.nodesBetween(u,d,(p,g)=>{g=u&&g<=d&&(s&&s===p.type&&r.setNodeMarkup(g,void 0,{...p.attrs,...t}),o&&p.marks.length&&p.marks.forEach(v=>{if(o===v.type){const x=Math.max(g,u),y=Math.min(g+p.nodeSize,d);r.addMark(x,y,o.create({...v.attrs,...t}))}}))}),h&&(A!==void 0&&r.setNodeMarkup(A,void 0,{...h.attrs,...t}),o&&h.marks.length&&h.marks.forEach(p=>{o===p.type&&r.addMark(f,m,o.create({...p.attrs,...t}))}))}),!0):!1},kMe=(e,t={})=>({state:r,dispatch:n})=>{const i=fs(e,r.schema);return cOe(i,t)(r,n)},EMe=(e,t={})=>({state:r,dispatch:n})=>{const i=fs(e,r.schema);return uOe(i,t)(r,n)},TMe=class{constructor(){this.callbacks={}}on(t,r){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(r),this}emit(t,...r){const n=this.callbacks[t];return n&&n.forEach(i=>i.apply(this,r)),this}off(t,r){const n=this.callbacks[t];return n&&(r?this.callbacks[t]=n.filter(i=>i!==r):delete this.callbacks[t]),this}once(t,r){const n=(...i)=>{this.off(t,n),r.apply(this,i)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},$E=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=(t=e.undoable)!=null?t:!0}},PMe=(e,t)=>{if(p8(t))return t.exec(e);const r=t(e);if(!r)return null;const n=[r.text];return n.index=r.index,n.input=e,n.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(r.replaceWith)),n};function vj(e){var t;const{editor:r,from:n,to:i,text:s,rules:o,plugin:l}=e,{view:c}=r;if(c.composing)return!1;const u=c.state.doc.resolve(n);if(u.parent.type.spec.code||(t=u.nodeBefore||u.nodeAfter)!=null&&t.marks.find(h=>h.type.spec.code))return!1;let d=!1;const A=lMe(u)+s;return o.forEach(h=>{if(d)return;const f=PMe(A,h.find);if(!f)return;const m=c.state.tr,p=DE({state:c.state,transaction:m}),g={from:n-(f[0].length-s.length),to:i},{commands:v,chain:x,can:y}=new RE({editor:r,state:p});h.handler({state:p,range:g,match:f,commands:v,chain:x,can:y})===null||!m.steps.length||(h.undoable&&m.setMeta(l,{transform:m,from:n,to:i,text:s}),c.dispatch(m),d=!0)}),d}function IMe(e){const{editor:t,rules:r}=e,n=new Ri({state:{init(){return null},apply(i,s,o){const l=i.getMeta(n);if(l)return l;const c=i.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:d}=c;typeof d=="string"?d=d:d=x8(Je.from(d),o.schema);const{from:A}=c,h=A+d.length;vj({editor:t,from:A,to:h,text:d,rules:r,plugin:n})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,l){return vj({editor:t,from:s,to:o,text:l,rules:r,plugin:n})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&vj({editor:t,from:s.pos,to:s.pos,text:"",rules:r,plugin:n})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?vj({editor:t,from:o.pos,to:o.pos,text:` `,rules:r,plugin:n}):!1}},isInputRules:!0});return n}function OMe(e){return Object.prototype.toString.call(e).slice(8,-1)}function xj(e){return OMe(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Gue(e,t){const r={...e};return xj(e)&&xj(t)&&Object.keys(t).forEach(n=>{xj(t[n])&&xj(e[n])?r[n]=Gue(e[n],t[n]):r[n]=t[n]}),r}var w8=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...wn(Vt(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...wn(Vt(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Gue(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},Lg=class Kue extends w8{constructor(){super(...arguments),this.type="mark"}static create(t={}){const r=typeof t=="function"?t():t;return new Kue(r)}static handleExit({editor:t,mark:r}){const{tr:n}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===r.name))return!1;const c=o.find(u=>(u==null?void 0:u.type.name)===r.name);return c&&n.removeStoredMark(c),n.insertText(" ",i.pos),t.view.dispatch(n),!0}return!1}configure(t){return super.configure(t)}extend(t){const r=typeof t=="function"?t():t;return super.extend(r)}};function FMe(e){return typeof e=="number"}var LMe=class{constructor(e){this.find=e.find,this.handler=e.handler}},MMe=(e,t,r)=>{if(p8(t))return[...e.matchAll(t)];const n=t(e,r);return n?n.map(i=>{const s=[i.text];return s.index=i.index,s.input=e,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function DMe(e){const{editor:t,state:r,from:n,to:i,rule:s,pasteEvent:o,dropEvent:l}=e,{commands:c,chain:u,can:d}=new RE({editor:t,state:r}),A=[];return r.doc.nodesBetween(n,i,(f,m)=>{var p,g,v,x,y;if((g=(p=f.type)==null?void 0:p.spec)!=null&&g.code||!(f.isText||f.isTextblock||f.isInline))return;const b=(y=(x=(v=f.content)==null?void 0:v.size)!=null?x:f.nodeSize)!=null?y:0,C=Math.max(n,m),j=Math.min(i,m+b);if(C>=j)return;const S=f.isText?f.text||"":f.textBetween(C-m,j-m,void 0,"");MMe(S,s.find,o).forEach(B=>{if(B.index===void 0)return;const I=C+B.index+1,P=I+B[0].length,E={from:r.tr.mapping.map(I),to:r.tr.mapping.map(P)},M=s.handler({state:r,range:E,match:B,commands:c,chain:u,can:d,pasteEvent:o,dropEvent:l});A.push(M)})}),A.every(f=>f!==null)}var yj=null,RMe=e=>{var t;const r=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=r.clipboardData)==null||t.setData("text/html",e),r};function UMe(e){const{editor:t,rules:r}=e;let n=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const c=({state:d,from:A,to:h,rule:f,pasteEvt:m})=>{const p=d.tr,g=DE({state:d,transaction:p});if(!(!DMe({editor:t,state:g,from:Math.max(A-1,0),to:h.b-1,rule:f,pasteEvent:m,dropEvent:l})||!p.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,p}};return r.map(d=>new Ri({view(A){const h=m=>{var p;n=(p=A.dom.parentElement)!=null&&p.contains(m.target)?A.dom.parentElement:null,n&&(yj=t)},f=()=>{yj&&(yj=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(A,h)=>{if(s=n===A.dom.parentElement,l=h,!s){const f=yj;f!=null&&f.isEditable&&setTimeout(()=>{const m=f.state.selection;m&&f.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(A,h)=>{var f;const m=(f=h.clipboardData)==null?void 0:f.getData("text/html");return o=h,i=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(A,h,f)=>{const m=A[0],p=m.getMeta("uiEvent")==="paste"&&!i,g=m.getMeta("uiEvent")==="drop"&&!s,v=m.getMeta("applyPasteRules"),x=!!v;if(!p&&!g&&!x)return;if(x){let{text:C}=v;typeof C=="string"?C=C:C=x8(Je.from(C),f.schema);const{from:j}=v,S=j+C.length,T=RMe(C);return c({rule:d,state:f,from:j,to:{b:S},pasteEvt:T})}const y=h.doc.content.findDiffStart(f.doc.content),b=h.doc.content.findDiffEnd(f.doc.content);if(!(!FMe(y)||!b||y===b.b))return c({rule:d,state:f,from:y,to:b,pasteEvt:o})}}))}var zE=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=Uue(e),this.schema=tMe(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:cI(t.name,this.schema)},n=Vt(t,"addCommands",r);return n?{...e,...n()}:e},{})}get plugins(){const{editor:e}=this;return y8([...this.extensions].reverse()).flatMap(n=>{const i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:cI(n.name,this.schema)},s=[],o=Vt(n,"addKeyboardShortcuts",i);let l={};if(n.type==="mark"&&Vt(n,"exitable",i)&&(l.ArrowRight=()=>Lg.handleExit({editor:e,mark:n})),o){const h=Object.fromEntries(Object.entries(o()).map(([f,m])=>[f,()=>m({editor:e})]));l={...l,...h}}const c=iLe(l);s.push(c);const u=Vt(n,"addInputRules",i);if(EW(n,e.options.enableInputRules)&&u){const h=u();if(h&&h.length){const f=IMe({editor:e,rules:h}),m=Array.isArray(f)?f:[f];s.push(...m)}}const d=Vt(n,"addPasteRules",i);if(EW(n,e.options.enablePasteRules)&&d){const h=d();if(h&&h.length){const f=UMe({editor:e,rules:h});s.push(...f)}}const A=Vt(n,"addProseMirrorPlugins",i);if(A){const h=A();s.push(...h)}return s})}get attributes(){return Rue(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=c2(this.extensions);return Object.fromEntries(t.filter(r=>!!Vt(r,"addNodeView")).map(r=>{const n=this.attributes.filter(c=>c.type===r.name),i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:fs(r.name,this.schema)},s=Vt(r,"addNodeView",i);if(!s)return[];const o=s();if(!o)return[];const l=(c,u,d,A,h)=>{const f=j_(c,n);return o({node:c,view:u,getPos:d,decorations:A,innerDecorations:h,editor:e,extension:r,HTMLAttributes:f})};return[r.name,l]}))}get markViews(){const{editor:e}=this,{markExtensions:t}=c2(this.extensions);return Object.fromEntries(t.filter(r=>!!Vt(r,"addMarkView")).map(r=>{const n=this.attributes.filter(l=>l.type===r.name),i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:HA(r.name,this.schema)},s=Vt(r,"addMarkView",i);if(!s)return[];const o=(l,c,u)=>{const d=j_(l,n);return s()({mark:l,view:c,inline:u,editor:e,extension:r,HTMLAttributes:d,updateAttributes:A=>{tDe(l,e,A)}})};return[r.name,o]}))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(t=>[t.name,t.storage])),e.forEach(t=>{var r;const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:cI(t.name,this.schema)};t.type==="mark"&&((r=wn(Vt(t,"keepOnSplit",n)))==null||r)&&this.splittableMarks.push(t.name);const i=Vt(t,"onBeforeCreate",n),s=Vt(t,"onCreate",n),o=Vt(t,"onUpdate",n),l=Vt(t,"onSelectionUpdate",n),c=Vt(t,"onTransaction",n),u=Vt(t,"onFocus",n),d=Vt(t,"onBlur",n),A=Vt(t,"onDestroy",n);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),o&&this.editor.on("update",o),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),u&&this.editor.on("focus",u),d&&this.editor.on("blur",d),A&&this.editor.on("destroy",A)})}};zE.resolve=Uue;zE.sort=y8;zE.flatten=v8;var QMe={};h8(QMe,{ClipboardTextSerializer:()=>que,Commands:()=>Xue,Delete:()=>Yue,Drop:()=>Jue,Editable:()=>Zue,FocusEvents:()=>tde,Keymap:()=>rde,Paste:()=>nde,Tabindex:()=>ide,focusEventsPluginKey:()=>ede});var ps=class Vue extends w8{constructor(){super(...arguments),this.type="extension"}static create(t={}){const r=typeof t=="function"?t():t;return new Vue(r)}configure(t){return super.configure(t)}extend(t){const r=typeof t=="function"?t():t;return super.extend(r)}},que=ps.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ri({key:new Ks("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:r}=e,{doc:n,selection:i}=t,{ranges:s}=i,o=Math.min(...s.map(d=>d.$from.pos)),l=Math.max(...s.map(d=>d.$to.pos)),c=Hue(r);return Que(n,{from:o,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),Xue=ps.create({name:"commands",addCommands(){return{...Eue}}}),Yue=ps.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var r,n,i;const s=()=>{var o,l,c,u;if((u=(c=(l=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:l.filterTransaction)==null?void 0:c.call(l,e))!=null?u:e.getMeta("y-sync$"))return;const d=Mue(e.before,[e,...t]);zue(d).forEach(f=>{d.mapping.mapResult(f.oldRange.from).deletedAfter&&d.mapping.mapResult(f.oldRange.to).deletedBefore&&d.before.nodesBetween(f.oldRange.from,f.oldRange.to,(m,p)=>{const g=p+m.nodeSize-2,v=f.oldRange.from<=p&&g<=f.oldRange.to;this.editor.emit("delete",{type:"node",node:m,from:p,to:g,newFrom:d.mapping.map(p),newTo:d.mapping.map(g),deletedRange:f.oldRange,newRange:f.newRange,partial:!v,editor:this.editor,transaction:e,combinedTransform:d})})});const h=d.mapping;d.steps.forEach((f,m)=>{var p,g;if(f instanceof qc){const v=h.slice(m).map(f.from,-1),x=h.slice(m).map(f.to),y=h.invert().map(v,-1),b=h.invert().map(x),C=(p=d.doc.nodeAt(v-1))==null?void 0:p.marks.some(S=>S.eq(f.mark)),j=(g=d.doc.nodeAt(x))==null?void 0:g.marks.some(S=>S.eq(f.mark));this.editor.emit("delete",{type:"mark",mark:f.mark,from:f.from,to:f.to,deletedRange:{from:y,to:b},newRange:{from:v,to:x},partial:!!(j||C),editor:this.editor,transaction:e,combinedTransform:d})}})};(i=(n=(r=this.editor.options.coreExtensionOptions)==null?void 0:r.delete)==null?void 0:n.async)==null||i?setTimeout(s,0):s()}}),Jue=ps.create({name:"drop",addProseMirrorPlugins(){return[new Ri({key:new Ks("tiptapDrop"),props:{handleDrop:(e,t,r,n)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:r,moved:n})}}})]}}),Zue=ps.create({name:"editable",addProseMirrorPlugins(){return[new Ri({key:new Ks("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ede=new Ks("focusEvents"),tde=ps.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Ri({key:ede,props:{handleDOMEvents:{focus:(t,r)=>{e.isFocused=!0;const n=e.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return t.dispatch(n),!1},blur:(t,r)=>{e.isFocused=!1;const n=e.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return t.dispatch(n),!1}}}})]}}),rde=ps.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:c,doc:u}=l,{empty:d,$anchor:A}=c,{pos:h,parent:f}=A,m=A.parent.isTextblock&&h>0?l.doc.resolve(h-1):A,p=m.parent.type.spec.isolating,g=A.pos-A.parentOffset,v=p&&m.parent.childCount===1?g===A.pos:Ir.atStart(u).from===h;return!d||!f.type.isTextblock||f.textContent.length||!v||v&&A.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},s={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return g8()||Fue()?s:i},addProseMirrorPlugins(){return[new Ri({key:new Ks("clearDocument"),appendTransaction:(e,t,r)=>{if(e.some(p=>p.getMeta("composition")))return;const n=e.some(p=>p.docChanged)&&!t.doc.eq(r.doc),i=e.some(p=>p.getMeta("preventClearDocument"));if(!n||i)return;const{empty:s,from:o,to:l}=t.selection,c=Ir.atStart(t.doc).from,u=Ir.atEnd(t.doc).to;if(s||!(o===c&&l===u)||!HE(r.doc))return;const h=r.tr,f=DE({state:r,transaction:h}),{commands:m}=new RE({editor:this.editor,state:f});if(m.clearNodes(),!!h.steps.length)return h}})]}}),nde=ps.create({name:"paste",addProseMirrorPlugins(){return[new Ri({key:new Ks("tiptapPaste"),props:{handlePaste:(e,t,r)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:r})}}})]}}),ide=ps.create({name:"tabindex",addProseMirrorPlugins(){return[new Ri({key:new Ks("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),HMe=class Vv{constructor(t,r,n=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=t,this.editor=r,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!=null?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let r=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}r=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:r,to:n},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),r=this.resolvedPos.doc.resolve(t);return new Vv(r,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new Vv(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new Vv(t,this.editor)}get children(){const t=[];return this.node.content.forEach((r,n)=>{const i=r.isBlock&&!r.isTextblock,s=r.isAtom&&!r.isText,o=this.pos+n+(s?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(o);if(!i&&l.depth<=this.depth)return;const c=new Vv(l,this.editor,i,i?r:null);i&&(c.actualDepth=this.depth+1),t.push(new Vv(l,this.editor,i,i?r:null))}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,r={}){let n=null,i=this.parent;for(;i&&!n;){if(i.node.type.name===t)if(Object.keys(r).length>0){const s=i.node.attrs,o=Object.keys(r);for(let l=0;l{n&&i.length>0||(o.node.type.name===t&&s.every(c=>r[c]===o.node.attrs[c])&&i.push(o),!(n&&i.length>0)&&(i=i.concat(o.querySelectorAll(t,r,n))))}),i}setAttribute(t){const{tr:r}=this.editor.state;r.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(r)}},$Me=`.ProseMirror { position: relative; } .ProseMirror { word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; -webkit-font-variant-ligatures: none; font-variant-ligatures: none; font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ } .ProseMirror [contenteditable="false"] { white-space: normal; } .ProseMirror [contenteditable="false"] [contenteditable="true"] { white-space: pre-wrap; } .ProseMirror pre { white-space: pre-wrap; } img.ProseMirror-separator { display: inline !important; border: none !important; margin: 0 !important; width: 0 !important; height: 0 !important; } .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; margin: 0; } .ProseMirror-gapcursor:after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid black; animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; } @keyframes ProseMirror-cursor-blink { to { visibility: hidden; } } .ProseMirror-hideselection *::selection { background: transparent; } .ProseMirror-hideselection *::-moz-selection { background: transparent; } .ProseMirror-hideselection * { caret-color: transparent; } .ProseMirror-focused .ProseMirror-gapcursor { display: block; }`;function zMe(e,t,r){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style",""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}var WMe=class extends TMe{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:i,moved:s})=>this.options.onDrop(n,i,s)),this.on("paste",({event:n,slice:i})=>this.options.onPaste(n,i)),this.on("delete",this.options.onDelete);const t=this.createDoc(),r=Iue(t,this.options.autofocus);this.editorState=Ax.create({doc:t,schema:this.schema,selection:r||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const e=this.editorView.dom;e!=null&&e.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=zMe($Me,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const r=Due(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],n=this.state.reconfigure({plugins:r});return this.view.updateState(n),n}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let r=t;if([].concat(e).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;r=r.filter(o=>!o.key.startsWith(s))}),t.length===r.length)return;const n=this.state.reconfigure({plugins:r});return this.view.updateState(n),n}createExtensionManager(){var e,t;const n=[...this.options.enableCoreExtensions?[Zue,que.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:t.blockSeparator}),Xue,tde,rde,ide,Jue,nde,Yue].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new zE(n,this)}createCommandManager(){this.commandManager=new RE({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=kL(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),e=kL(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){var t;this.editorView=new _ue(e,{...this.options.editorProps,attributes:{role:"textbox",...(t=this.options.editorProps)==null?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.prependClass(),this.injectCSS();const n=this.view.dom;n.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(u=>{var d;return(d=this.capturedTransaction)==null?void 0:d.step(u)});return}const{state:t,transactions:r}=this.state.applyTransaction(e),n=!this.state.selection.eq(t.selection),i=r.includes(e),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:r.slice(1)}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const o=r.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),l=o==null?void 0:o.getMeta("focus"),c=o==null?void 0:o.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:o}),c&&this.emit("blur",{editor:this,event:c.event,transaction:o}),!(e.getMeta("preventUpdate")||!r.some(u=>u.docChanged)||s.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:r.slice(1)})}getAttributes(e){return $ue(this.state,e)}isActive(e,t){const r=typeof e=="string"?e:null,n=typeof e=="string"?t:e;return cMe(this.state,r,n)}getJSON(){return this.state.doc.toJSON()}getHTML(){return x8(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=` `,textSerializers:r={}}=e||{};return nMe(this.state.doc,{blockSeparator:t,textSerializers:{...Hue(this.schema),...r}})}get isEmpty(){return HE(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return(t=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?t:!0}$node(e,t){var r;return((r=this.$doc)==null?void 0:r.querySelector(e,t))||null}$nodes(e,t){var r;return((r=this.$doc)==null?void 0:r.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new HMe(t,this)}get $doc(){return this.$pos(0)}};function Oy(e){return new $E({find:e.find,handler:({state:t,range:r,match:n})=>{const i=wn(e.getAttributes,void 0,n);if(i===!1||i===null)return null;const{tr:s}=t,o=n[n.length-1],l=n[0];if(o){const c=l.search(/\S/),u=r.from+l.indexOf(o),d=u+o.length;if(b8(r.from,r.to,t.doc).filter(f=>f.mark.type.excluded.find(p=>p===e.type&&p!==f.mark.type)).filter(f=>f.to>u).length)return null;dr.from&&s.delete(r.from+c,u);const h=r.from+c+o.length;s.addMark(r.from+c,h,e.type.create(i||{})),s.removeStoredMark(e.type)}},undoable:e.undoable})}function sde(e){return new $E({find:e.find,handler:({state:t,range:r,match:n})=>{const i=wn(e.getAttributes,void 0,n)||{},{tr:s}=t,o=r.from;let l=r.to;const c=e.type.create(i);if(n[1]){const u=n[0].lastIndexOf(n[1]);let d=o+u;d>l?d=l:l=d+n[1].length;const A=n[0][n[0].length-1];s.insertText(A,o+n[0].length-1),s.replaceWith(d,l,c)}else if(n[0]){const u=e.type.isInline?o:o-1;s.insert(u,e.type.create(i)).delete(s.mapping.map(o),s.mapping.map(l))}s.scrollIntoView()},undoable:e.undoable})}function TL(e){return new $E({find:e.find,handler:({state:t,range:r,match:n})=>{const i=t.doc.resolve(r.from),s=wn(e.getAttributes,void 0,n)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(r.from,r.to).setBlockType(r.from,r.from,e.type,s)},undoable:e.undoable})}function Fy(e){return new $E({find:e.find,handler:({state:t,range:r,match:n,chain:i})=>{const s=wn(e.getAttributes,void 0,n)||{},o=t.tr.delete(r.from,r.to),c=o.doc.resolve(r.from).blockRange(),u=c&&t8(c,e.type,s);if(!u)return null;if(o.wrap(c,u),e.keepMarks&&e.editor){const{selection:A,storedMarks:h}=t,{splittableMarks:f}=e.editor.extensionManager,m=h||A.$to.parentOffset&&A.$from.marks();if(m){const p=m.filter(g=>f.includes(g.type.name));o.ensureMarks(p)}}if(e.keepAttributes){const A=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(A,s).run()}const d=o.doc.resolve(r.from-1).nodeBefore;d&&d.type===e.type&&sp(o.doc,r.from-1)&&(!e.joinPredicate||e.joinPredicate(n,d))&&o.join(r.from-1)},undoable:e.undoable})}var GMe=e=>"touches"in e,KMe=class{constructor(e){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.handleMouseMove=o=>{if(!this.isResizing||!this.activeHandle)return;const l=o.clientX-this.startX,c=o.clientY-this.startY;this.handleResize(l,c)},this.handleTouchMove=o=>{if(!this.isResizing||!this.activeHandle)return;const l=o.touches[0];if(!l)return;const c=l.clientX-this.startX,u=l.clientY-this.startY;this.handleResize(c,u)},this.handleMouseUp=()=>{if(!this.isResizing)return;const o=this.element.offsetWidth,l=this.element.offsetHeight;this.onCommit(o,l),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!1)};var t,r,n,i,s;this.node=e.node,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,(t=e.options)!=null&&t.min&&(this.minSize={...this.minSize,...e.options.min}),(r=e.options)!=null&&r.max&&(this.maxSize=e.options.max),(n=e==null?void 0:e.options)!=null&&n.directions&&(this.directions=e.options.directions),(i=e.options)!=null&&i.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),(s=e.options)!=null&&s.className&&(this.classNames={container:e.options.className.container||"",wrapper:e.options.className.wrapper||"",handle:e.options.className.handle||"",resizing:e.options.className.resizing||""}),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles()}get dom(){return this.container}get contentDOM(){return this.contentElement}update(e,t,r){return e.type!==this.node.type?!1:(this.node=e,this.onUpdate?this.onUpdate(e,t,r):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.container.remove()}createContainer(){const e=document.createElement("div");return e.dataset.resizeContainer="",e.dataset.node=this.node.type.name,e.style.display="flex",e.style.justifyContent="flex-start",e.style.alignItems="flex-start",this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){const e=document.createElement("div");return e.style.position="relative",e.style.display="block",e.dataset.resizeWrapper="",this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){const t=document.createElement("div");return t.dataset.resizeHandle=e,t.style.position="absolute",this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){const r=t.includes("top"),n=t.includes("bottom"),i=t.includes("left"),s=t.includes("right");r&&(e.style.top="0"),n&&(e.style.bottom="0"),i&&(e.style.left="0"),s&&(e.style.right="0"),(t==="top"||t==="bottom")&&(e.style.left="0",e.style.right="0"),(t==="left"||t==="right")&&(e.style.top="0",e.style.bottom="0")}attachHandles(){this.directions.forEach(e=>{const t=this.createHandle(e);this.positionHandle(t,e),t.addEventListener("mousedown",r=>this.handleResizeStart(r,e)),t.addEventListener("touchstart",r=>this.handleResizeStart(r,e)),this.wrapper.appendChild(t)})}applyInitialSize(){const e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,GMe(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;const r=this.preserveAspectRatio||this.isShiftKeyPressed,{width:n,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),s=this.applyConstraints(n,i,r);this.element.style.width=`${s.width}px`,this.element.style.height=`${s.height}px`,this.onResize&&this.onResize(s.width,s.height)}calculateNewDimensions(e,t,r){let n=this.startWidth,i=this.startHeight;const s=e.includes("right"),o=e.includes("left"),l=e.includes("bottom"),c=e.includes("top");return s?n=this.startWidth+t:o&&(n=this.startWidth-t),l?i=this.startHeight+r:c&&(i=this.startHeight-r),(e==="right"||e==="left")&&(n=this.startWidth+(s?t:-t)),(e==="top"||e==="bottom")&&(i=this.startHeight+(l?r:-r)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(n,i,e):{width:n,height:i}}applyConstraints(e,t,r){var n,i,s,o;if(!r){let u=Math.max(this.minSize.width,e),d=Math.max(this.minSize.height,t);return(n=this.maxSize)!=null&&n.width&&(u=Math.min(this.maxSize.width,u)),(i=this.maxSize)!=null&&i.height&&(d=Math.min(this.maxSize.height,d)),{width:u,height:d}}let l=e,c=t;return lthis.maxSize.width&&(l=this.maxSize.width,c=l/this.aspectRatio),(o=this.maxSize)!=null&&o.height&&c>this.maxSize.height&&(c=this.maxSize.height,l=c*this.aspectRatio),{width:l,height:c}}applyAspectRatio(e,t,r){const n=r==="left"||r==="right",i=r==="top"||r==="bottom";return n?{width:e,height:e/this.aspectRatio}:i?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}};function VMe(e,t){const{selection:r}=e,{$from:n}=r;if(r instanceof Yt){const s=n.index();return n.parent.canReplaceWith(s,s+1,t)}let i=n.depth;for(;i>=0;){const s=n.index(i);if(n.node(i).contentMatchAt(s).matchType(t))return!0;i-=1}return!1}var qMe={};h8(qMe,{createAtomBlockMarkdownSpec:()=>XMe,createBlockMarkdownSpec:()=>YMe,createInlineMarkdownSpec:()=>eDe,parseAttributes:()=>C8,parseIndentedBlocks:()=>PL,renderNestedMarkdownContent:()=>j8,serializeAttributes:()=>N8});function C8(e){if(!(e!=null&&e.trim()))return{};const t={},r=[],n=e.replace(/["']([^"']*)["']/g,u=>(r.push(u),`__QUOTED_${r.length-1}__`)),i=n.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const u=i.map(d=>d.trim().slice(1));t.class=u.join(" ")}const s=n.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(t.id=s[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(n.matchAll(o)).forEach(([,u,d])=>{var A;const h=parseInt(((A=d.match(/__QUOTED_(\d+)__/))==null?void 0:A[1])||"0",10),f=r[h];f&&(t[u]=f.slice(1,-1))});const c=n.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return c&&c.split(/\s+/).filter(Boolean).forEach(d=>{d.match(/^[a-zA-Z][\w-]*$/)&&(t[d]=!0)}),t}function N8(e){if(!e||Object.keys(e).length===0)return"";const t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(n=>t.push(`.${n}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([r,n])=>{r==="class"||r==="id"||(n===!0?t.push(r):n!==!1&&n!=null&&t.push(`${r}="${String(n)}"`))}),t.join(" ")}function XMe(e){const{nodeName:t,name:r,parseAttributes:n=C8,serializeAttributes:i=N8,defaultAttributes:s={},requiredAttributes:o=[],allowedAttributes:l}=e,c=r||t,u=d=>{if(!l)return d;const A={};return l.forEach(h=>{h in d&&(A[h]=d[h])}),A};return{parseMarkdown:(d,A)=>{const h={...s,...d.attributes};return A.createNode(t,h,[])},markdownTokenizer:{name:t,level:"block",start(d){var A;const h=new RegExp(`^:::${c}(?:\\s|$)`,"m"),f=(A=d.match(h))==null?void 0:A.index;return f!==void 0?f:-1},tokenize(d,A,h){const f=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),m=d.match(f);if(!m)return;const p=m[1]||"",g=n(p);if(!o.find(x=>!(x in g)))return{type:t,raw:m[0],attributes:g}}},renderMarkdown:d=>{const A=u(d.attrs||{}),h=i(A),f=h?` {${h}}`:"";return`:::${c}${f} :::`}}}function YMe(e){const{nodeName:t,name:r,getContent:n,parseAttributes:i=C8,serializeAttributes:s=N8,defaultAttributes:o={},content:l="block",allowedAttributes:c}=e,u=r||t,d=A=>{if(!c)return A;const h={};return c.forEach(f=>{f in A&&(h[f]=A[f])}),h};return{parseMarkdown:(A,h)=>{let f;if(n){const p=n(A);f=typeof p=="string"?[{type:"text",text:p}]:p}else l==="block"?f=h.parseChildren(A.tokens||[]):f=h.parseInline(A.tokens||[]);const m={...o,...A.attributes};return h.createNode(t,m,f)},markdownTokenizer:{name:t,level:"block",start(A){var h;const f=new RegExp(`^:::${u}`,"m"),m=(h=A.match(f))==null?void 0:h.index;return m!==void 0?m:-1},tokenize(A,h,f){var m;const p=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),g=A.match(p);if(!g)return;const[v,x=""]=g,y=i(x);let b=1;const C=v.length;let j="";const S=/^:::([\w-]*)(\s.*)?/gm,T=A.slice(C);for(S.lastIndex=0;;){const B=S.exec(T);if(B===null)break;const I=B.index,P=B[1];if(!((m=B[2])!=null&&m.endsWith(":::"))){if(P)b+=1;else if(b-=1,b===0){const E=T.slice(0,I);j=E.trim();const M=A.slice(0,C+I+B[0].length);let _=[];if(j)if(l==="block")for(_=f.blockTokens(E),_.forEach(R=>{R.text&&(!R.tokens||R.tokens.length===0)&&(R.tokens=f.inlineTokens(R.text))});_.length>0;){const R=_[_.length-1];if(R.type==="paragraph"&&(!R.text||R.text.trim()===""))_.pop();else break}else _=f.inlineTokens(j);return{type:t,raw:M,attributes:y,content:j,tokens:_}}}}}},renderMarkdown:(A,h)=>{const f=d(A.attrs||{}),m=s(f),p=m?` {${m}}`:"",g=h.renderChildren(A.content||[],` `);return`:::${u}${p} ${g} :::`}}}function JMe(e){if(!e.trim())return{};const t={},r=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let n=r.exec(e);for(;n!==null;){const[,i,s,o]=n;t[i]=s||o,n=r.exec(e)}return t}function ZMe(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,r])=>`${t}="${r}"`).join(" ")}function eDe(e){const{nodeName:t,name:r,getContent:n,parseAttributes:i=JMe,serializeAttributes:s=ZMe,defaultAttributes:o={},selfClosing:l=!1,allowedAttributes:c}=e,u=r||t,d=h=>{if(!c)return h;const f={};return c.forEach(m=>{m in h&&(f[m]=h[m])}),f},A=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(h,f)=>{const m={...o,...h.attributes};if(l)return f.createNode(t,m);const p=n?n(h):h.content||"";return p?f.createNode(t,m,[f.createTextNode(p)]):f.createNode(t,m,[])},markdownTokenizer:{name:t,level:"inline",start(h){const f=l?new RegExp(`\\[${A}\\s*[^\\]]*\\]`):new RegExp(`\\[${A}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${A}\\]`),m=h.match(f),p=m==null?void 0:m.index;return p!==void 0?p:-1},tokenize(h,f,m){const p=l?new RegExp(`^\\[${A}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${A}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${A}\\]`),g=h.match(p);if(!g)return;let v="",x="";if(l){const[,b]=g;x=b}else{const[,b,C]=g;x=b,v=C||""}const y=i(x.trim());return{type:t,raw:g[0],content:v.trim(),attributes:y}}},renderMarkdown:h=>{let f="";n?f=n(h):h.content&&h.content.length>0&&(f=h.content.filter(v=>v.type==="text").map(v=>v.text).join(""));const m=d(h.attrs||{}),p=s(m),g=p?` ${p}`:"";return l?`[${u}${g}]`:`[${u}${g}]${f}[/${u}]`}}}function PL(e,t,r){var n,i,s,o;const l=e.split(` `),c=[];let u="",d=0;const A=t.baseIndentSize||2;for(;d0)break;if(h.trim()===""){d+=1;continue}else return}const m=t.extractItemData(f),{indentLevel:p,mainContent:g}=m;u=`${u}${h} `;const v=[g];for(d+=1;dI.trim()!=="");if(S===-1)break;if((((i=(n=l[d+1+S].match(/^(\s*)/))==null?void 0:n[1])==null?void 0:i.length)||0)>p){v.push(C),u=`${u}${C} `,d+=1;continue}else break}if((((o=(s=C.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:o.length)||0)>p)v.push(C),u=`${u}${C} `,d+=1;else break}let x;const y=v.slice(1);if(y.length>0){const C=y.map(j=>j.slice(p+A)).join(` `);C.trim()&&(t.customNestedParser?x=t.customNestedParser(C):x=r.blockTokens(C))}const b=t.createToken(m,x);c.push(b)}if(c.length!==0)return{items:c,raw:u.trim()}}function j8(e,t,r,n){if(!e||!Array.isArray(e.content))return"";const i=typeof r=="function"?r(n):r,[s,...o]=e.content,l=t.renderChildren([s]),c=[`${i}${l}`];return o&&o.length>0&&o.forEach(u=>{const d=t.renderChildren([u]);if(d){const A=d.split(` `).map(h=>h?t.indent(h):"").join(` `);c.push(A)}}),c.join(` `)}function tDe(e,t,r={}){const{state:n}=t,{doc:i,tr:s}=n,o=e;i.descendants((l,c)=>{const u=s.mapping.map(c),d=s.mapping.map(c)+l.nodeSize;let A=null;if(l.marks.forEach(f=>{if(f!==o)return!1;A=f}),!A)return;let h=!1;if(Object.keys(r).forEach(f=>{r[f]!==A.attrs[f]&&(h=!0)}),h){const f=e.type.create({...e.attrs,...r});s.removeMark(u,d,e.type),s.addMark(u,d,f)}}),s.docChanged&&t.view.dispatch(s)}var $o=class ade extends w8{constructor(){super(...arguments),this.type="node"}static create(t={}){const r=typeof t=="function"?t():t;return new ade(r)}configure(t){return super.configure(t)}extend(t){const r=typeof t=="function"?t():t;return super.extend(r)}};function fg(e){return new LMe({find:e.find,handler:({state:t,range:r,match:n,pasteEvent:i})=>{const s=wn(e.getAttributes,void 0,n,i);if(s===!1||s===null)return null;const{tr:o}=t,l=n[n.length-1],c=n[0];let u=r.to;if(l){const d=c.search(/\S/),A=r.from+c.indexOf(l),h=A+l.length;if(b8(r.from,r.to,t.doc).filter(m=>m.mark.type.excluded.find(g=>g===e.type&&g!==m.mark.type)).filter(m=>m.to>A).length)return null;hr.from&&o.delete(r.from+d,A),u=r.from+d+l.length,o.addMark(r.from+d,u,e.type.create(s||{})),o.removeStoredMark(e.type)}}})}var rDe=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(i of t.entries())if(!r.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],r.get(i[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(i of t.entries())if(!r.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(t[i]!==r[i])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!(o==="_owner"&&t.$$typeof)&&!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r};const nDe=en(rDe);var ode={exports:{}},lde={};/** * @license React * use-sync-external-store-shim/with-selector.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var WE=w,iDe=gE;function sDe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var aDe=typeof Object.is=="function"?Object.is:sDe,oDe=iDe.useSyncExternalStore,lDe=WE.useRef,cDe=WE.useEffect,uDe=WE.useMemo,dDe=WE.useDebugValue;lde.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var s=lDe(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=uDe(function(){function c(f){if(!u){if(u=!0,d=f,f=n(f),i!==void 0&&o.hasValue){var m=o.value;if(i(m,f))return A=m}return A=f}if(m=A,aDe(d,f))return m;var p=n(f);return i!==void 0&&i(m,p)?(d=f,m):(d=f,A=p)}var u=!1,d,A,h=r===void 0?null:r;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,r,n,i]);var l=oDe(e,s[0],s[1]);return cDe(function(){o.hasValue=!0,o.value=l},[l]),dDe(l),l};ode.exports=lde;var ADe=ode.exports,fDe=(...e)=>t=>{e.forEach(r=>{typeof r=="function"?r(t):r&&(r.current=t)})},hDe=({contentComponent:e})=>{const t=gE.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return a.jsx(a.Fragment,{children:Object.values(t)})};function pDe(){const e=new Set;let t={};return{subscribe(r){return e.add(r),()=>{e.delete(r)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(r,n){t={...t,[r]:R5.createPortal(n.reactElement,n.element,r)},e.forEach(i=>i())},removeRenderer(r){const n={...t};delete n[r],t=n,e.forEach(i=>i())}}}var mDe=class extends re.Component{constructor(e){var t;super(e),this.editorContentRef=re.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((t=e.editor)!=null&&t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(e.view.dom),e.setOptions({element:t}),e.contentComponent=pDe(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;const t=this.props.editor;if(t){this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null;try{if(!((e=t.view.dom)!=null&&e.firstChild))return;const r=document.createElement("div");r.append(t.view.dom),t.setOptions({element:r})}catch{}}}render(){const{editor:e,innerRef:t,...r}=this.props;return a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:fDe(t,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&a.jsx(hDe,{contentComponent:e.contentComponent})]})}},gDe=w.forwardRef((e,t)=>{const r=re.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return re.createElement(mDe,{key:r,innerRef:t,...e})}),vDe=re.memo(gDe),xDe=typeof window<"u"?w.useLayoutEffect:w.useEffect,yDe=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const t=()=>{this.transactionNumber+=1,this.subscribers.forEach(n=>n())},r=this.editor;return r.on("transaction",t),()=>{r.off("transaction",t)}}}};function bDe(e){var t;const[r]=w.useState(()=>new yDe(e.editor)),n=ADe.useSyncExternalStoreWithSelector(r.subscribe,r.getSnapshot,r.getServerSnapshot,e.selector,(t=e.equalityFn)!=null?t:nDe);return xDe(()=>r.watch(e.editor),[e.editor,r]),w.useDebugValue(n),n}var wDe=!1,IL=typeof window>"u",CDe=IL||!!(typeof window<"u"&&window.next),NDe=class cde{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(r=>r())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return IL||CDe?null:this.createEditor();if(this.options.current.immediatelyRender&&IL&&wDe)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const t={...this.options.current,onBeforeCreate:(...n)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)==null?void 0:s.call(i,...n)},onBlur:(...n)=>{var i,s;return(s=(i=this.options.current).onBlur)==null?void 0:s.call(i,...n)},onCreate:(...n)=>{var i,s;return(s=(i=this.options.current).onCreate)==null?void 0:s.call(i,...n)},onDestroy:(...n)=>{var i,s;return(s=(i=this.options.current).onDestroy)==null?void 0:s.call(i,...n)},onFocus:(...n)=>{var i,s;return(s=(i=this.options.current).onFocus)==null?void 0:s.call(i,...n)},onSelectionUpdate:(...n)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)==null?void 0:s.call(i,...n)},onTransaction:(...n)=>{var i,s;return(s=(i=this.options.current).onTransaction)==null?void 0:s.call(i,...n)},onUpdate:(...n)=>{var i,s;return(s=(i=this.options.current).onUpdate)==null?void 0:s.call(i,...n)},onContentError:(...n)=>{var i,s;return(s=(i=this.options.current).onContentError)==null?void 0:s.call(i,...n)},onDrop:(...n)=>{var i,s;return(s=(i=this.options.current).onDrop)==null?void 0:s.call(i,...n)},onPaste:(...n)=>{var i,s;return(s=(i=this.options.current).onPaste)==null?void 0:s.call(i,...n)},onDelete:(...n)=>{var i,s;return(s=(i=this.options.current).onDelete)==null?void 0:s.call(i,...n)}};return new WMe(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,r){return Object.keys(t).every(n=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)?!0:n==="extensions"&&t.extensions&&r.extensions?t.extensions.length!==r.extensions.length?!1:t.extensions.every((i,s)=>{var o;return i===((o=r.extensions)==null?void 0:o[s])}):t[n]===r[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?cde.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((n,i)=>n===t[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,r=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){r&&r.setOptions(this.options.current);return}r&&!r.isDestroyed&&(r.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function jDe(e={},t=[]){const r=w.useRef(e);r.current=e;const[n]=w.useState(()=>new NDe(r)),i=gE.useSyncExternalStore(n.subscribe,n.getEditor,n.getServerSnapshot);return w.useDebugValue(i),w.useEffect(n.onRender(t)),bDe({editor:i,selector:({transactionNumber:s})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&s===0?0:s+1}),i}var SDe=w.createContext({editor:null});SDe.Consumer;var BDe=w.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),_De=()=>w.useContext(BDe);re.forwardRef((e,t)=>{const{onDragStart:r}=_De(),n=e.as||"div";return a.jsx(n,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...e.style}})});re.createContext({markViewContentRef:()=>{}});var S_=(e,t)=>{if(e==="slot")return 0;if(e instanceof Function)return e(t);const{children:r,...n}=t??{};if(e==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,n,r]},kDe=/^\s*>\s$/,EDe=$o.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return S_("blockquote",{...Ji(this.options.HTMLAttributes,e),children:S_("slot",{})})},parseMarkdown:(e,t)=>t.createNode("blockquote",void 0,t.parseChildren(e.tokens||[])),renderMarkdown:(e,t)=>{if(!e.content)return"";const r=">",n=[];return e.content.forEach(i=>{const l=t.renderChildren([i]).split(` `).map(c=>c.trim()===""?r:`${r} ${c}`);n.push(l.join(` `))}),n.join(` ${r} `)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Fy({find:kDe,type:this.type})]}}),TDe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,PDe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,IDe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,ODe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,FDe=Lg.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return S_("strong",{...Ji(this.options.HTMLAttributes,e),children:S_("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Oy({find:TDe,type:this.type}),Oy({find:IDe,type:this.type})]},addPasteRules(){return[fg({find:PDe,type:this.type}),fg({find:ODe,type:this.type})]}}),LDe=/(^|[^`])`([^`]+)`(?!`)$/,MDe=/(^|[^`])`([^`]+)`(?!`)/g,DDe=Lg.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",Ji(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Oy({find:LDe,type:this.type})]},addPasteRules(){return[fg({find:MDe,type:this.type})]}}),AI=4,RDe=/^```([a-z]+)?[\s\n]$/,UDe=/^~~~([a-z]+)?[\s\n]$/,QDe=$o.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:AI,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:r}=this.options;if(!r)return null;const s=[...((t=e.firstElementChild)==null?void 0:t.classList)||[]].filter(o=>o.startsWith(r)).map(o=>o.replace(r,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",Ji(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var r;return((r=e.raw)==null?void 0:r.startsWith("```"))===!1&&e.codeBlockStyle!=="indented"?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var r;let n="";const i=((r=e.attrs)==null?void 0:r.language)||"";return e.content?n=[`\`\`\`${i}`,t.renderChildren(e.content),"```"].join(` `):n=`\`\`\`${i} \`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,r=t.pos===1;return!e||t.parent.type.name!==this.name?!1:r||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const r=(t=this.options.tabSize)!=null?t:AI,{state:n}=e,{selection:i}=n,{$from:s,empty:o}=i;if(s.parent.type!==this.type)return!1;const l=" ".repeat(r);return o?e.commands.insertContent(l):e.commands.command(({tr:c})=>{const{from:u,to:d}=i,f=n.doc.textBetween(u,d,` `,` `).split(` `).map(m=>l+m).join(` `);return c.replaceWith(u,d,n.schema.text(f)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const r=(t=this.options.tabSize)!=null?t:AI,{state:n}=e,{selection:i}=n,{$from:s,empty:o}=i;return s.parent.type!==this.type?!1:o?e.commands.command(({tr:l})=>{var c;const{pos:u}=s,d=s.start(),A=s.end(),f=n.doc.textBetween(d,A,` `,` `).split(` `);let m=0,p=0;const g=u-d;for(let j=0;j=g){m=j;break}p+=f[j].length+1}const x=((c=f[m].match(/^ */))==null?void 0:c[0])||"",y=Math.min(x.length,r);if(y===0)return!0;let b=d;for(let j=0;j{const{from:c,to:u}=i,h=n.doc.textBetween(c,u,` `,` `).split(` `).map(f=>{var m;const p=((m=f.match(/^ */))==null?void 0:m[0])||"",g=Math.min(p.length,r);return f.slice(g)}).join(` `);return l.replaceWith(c,u,n.schema.text(h)),!0})},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:r}=t,{$from:n,empty:i}=r;if(!i||n.parent.type!==this.type)return!1;const s=n.parentOffset===n.parent.nodeSize-2,o=n.parent.textContent.endsWith(` `);return!s||!o?!1:e.chain().command(({tr:l})=>(l.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:r,doc:n}=t,{$from:i,empty:s}=r;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0?!1:n.nodeAt(l)?e.commands.command(({tr:u})=>(u.setSelection(Ir.near(n.resolve(l))),!0)):e.commands.exitCode()}}},addInputRules(){return[TL({find:RDe,type:this.type,getAttributes:e=>({language:e[1]})}),TL({find:UDe,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Ri({key:new Ks("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const r=t.clipboardData.getData("text/plain"),n=t.clipboardData.getData("vscode-editor-data"),i=n?JSON.parse(n):void 0,s=i==null?void 0:i.mode;if(!r||!s)return!1;const{tr:o,schema:l}=e.state,c=l.text(r.replace(/\r\n?/g,` `));return o.replaceSelectionWith(this.type.create({language:s},c)),o.selection.$from.parent.type!==this.type&&o.setSelection(gr.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}}),HDe=$o.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` `):""}),$De=$o.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",Ji(this.options.HTMLAttributes,e)]},renderText(){return` `},renderMarkdown:()=>` `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:r,editor:n})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:s}=r;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=n.extensionManager,c=s||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:u,dispatch:d})=>{if(d&&c&&o){const A=c.filter(h=>l.includes(h.type.name));u.ensureMarks(A)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),zDe=$o.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Ji(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var r;const n=(r=e.attrs)!=null&&r.level?parseInt(e.attrs.level,10):1,i="#".repeat(n);return e.content?`${i} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>TL({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),WDe=$o.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",Ji(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!VMe(t,t.schema.nodes[this.name]))return!1;const{selection:r}=t,{$to:n}=r,i=e();return Wue(r)?i.insertContentAt(n.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:o,dispatch:l})=>{if(l){const{$to:c}=o.selection,u=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?o.setSelection(gr.create(o.doc,c.pos+1)):c.nodeAfter.isBlock?o.setSelection(Yt.create(o.doc,c.pos)):o.setSelection(gr.create(o.doc,c.pos));else{const d=s.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,A=d==null?void 0:d.create();A&&(o.insert(u,A),o.setSelection(gr.create(o.doc,u+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[sde({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),GDe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,KDe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,VDe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,qDe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,XDe=Lg.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Ji(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Oy({find:GDe,type:this.type}),Oy({find:VDe,type:this.type})]},addPasteRules(){return[fg({find:KDe,type:this.type}),fg({find:qDe,type:this.type})]}});const YDe="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",JDe="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",OL="numeric",FL="ascii",LL="alpha",qw="asciinumeric",vw="alphanumeric",ML="domain",ude="emoji",ZDe="scheme",eRe="slashscheme",fI="whitespace";function tRe(e,t){return e in t||(t[e]=[]),t[e]}function lm(e,t,r){t[OL]&&(t[qw]=!0,t[vw]=!0),t[FL]&&(t[qw]=!0,t[LL]=!0),t[qw]&&(t[vw]=!0),t[LL]&&(t[vw]=!0),t[vw]&&(t[ML]=!0),t[ude]&&(t[ML]=!0);for(const n in t){const i=tRe(n,r);i.indexOf(e)<0&&i.push(e)}}function rRe(e,t){const r={};for(const n in t)t[n].indexOf(e)>=0&&(r[n]=!0);return r}function ko(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}ko.groups={};ko.prototype={accepts(){return!!this.t},go(e){const t=this,r=t.j[e];if(r)return r;for(let n=0;ne.ta(t,r,n,i),_i=(e,t,r,n,i)=>e.tr(t,r,n,i),IW=(e,t,r,n,i)=>e.ts(t,r,n,i),tt=(e,t,r,n,i)=>e.tt(t,r,n,i),Jd="WORD",DL="UWORD",dde="ASCIINUMERICAL",Ade="ALPHANUMERICAL",u2="LOCALHOST",RL="TLD",UL="UTLD",qS="SCHEME",qv="SLASH_SCHEME",S8="NUM",QL="WS",B8="NL",Xw="OPENBRACE",Yw="CLOSEBRACE",B_="OPENBRACKET",__="CLOSEBRACKET",k_="OPENPAREN",E_="CLOSEPAREN",T_="OPENANGLEBRACKET",P_="CLOSEANGLEBRACKET",I_="FULLWIDTHLEFTPAREN",O_="FULLWIDTHRIGHTPAREN",F_="LEFTCORNERBRACKET",L_="RIGHTCORNERBRACKET",M_="LEFTWHITECORNERBRACKET",D_="RIGHTWHITECORNERBRACKET",R_="FULLWIDTHLESSTHAN",U_="FULLWIDTHGREATERTHAN",Q_="AMPERSAND",H_="APOSTROPHE",$_="ASTERISK",kf="AT",z_="BACKSLASH",W_="BACKTICK",G_="CARET",Df="COLON",_8="COMMA",K_="DOLLAR",Eu="DOT",V_="EQUALS",k8="EXCLAMATION",Ul="HYPHEN",Jw="PERCENT",q_="PIPE",X_="PLUS",Y_="POUND",Zw="QUERY",E8="QUOTE",fde="FULLWIDTHMIDDLEDOT",T8="SEMI",Tu="SLASH",e1="TILDE",J_="UNDERSCORE",hde="EMOJI",Z_="SYM";var pde=Object.freeze({__proto__:null,ALPHANUMERICAL:Ade,AMPERSAND:Q_,APOSTROPHE:H_,ASCIINUMERICAL:dde,ASTERISK:$_,AT:kf,BACKSLASH:z_,BACKTICK:W_,CARET:G_,CLOSEANGLEBRACKET:P_,CLOSEBRACE:Yw,CLOSEBRACKET:__,CLOSEPAREN:E_,COLON:Df,COMMA:_8,DOLLAR:K_,DOT:Eu,EMOJI:hde,EQUALS:V_,EXCLAMATION:k8,FULLWIDTHGREATERTHAN:U_,FULLWIDTHLEFTPAREN:I_,FULLWIDTHLESSTHAN:R_,FULLWIDTHMIDDLEDOT:fde,FULLWIDTHRIGHTPAREN:O_,HYPHEN:Ul,LEFTCORNERBRACKET:F_,LEFTWHITECORNERBRACKET:M_,LOCALHOST:u2,NL:B8,NUM:S8,OPENANGLEBRACKET:T_,OPENBRACE:Xw,OPENBRACKET:B_,OPENPAREN:k_,PERCENT:Jw,PIPE:q_,PLUS:X_,POUND:Y_,QUERY:Zw,QUOTE:E8,RIGHTCORNERBRACKET:L_,RIGHTWHITECORNERBRACKET:D_,SCHEME:qS,SEMI:T8,SLASH:Tu,SLASH_SCHEME:qv,SYM:Z_,TILDE:e1,TLD:RL,UNDERSCORE:J_,UTLD:UL,UWORD:DL,WORD:Jd,WS:QL});const Hd=/[a-z]/,Db=new RegExp("\\p{L}","u"),hI=new RegExp("\\p{Emoji}","u"),$d=/\d/,pI=/\s/,OW="\r",mI=` `,nRe="️",iRe="‍",gI="";let bj=null,wj=null;function sRe(e=[]){const t={};ko.groups=t;const r=new ko;bj==null&&(bj=FW(YDe)),wj==null&&(wj=FW(JDe)),tt(r,"'",H_),tt(r,"{",Xw),tt(r,"}",Yw),tt(r,"[",B_),tt(r,"]",__),tt(r,"(",k_),tt(r,")",E_),tt(r,"<",T_),tt(r,">",P_),tt(r,"(",I_),tt(r,")",O_),tt(r,"「",F_),tt(r,"」",L_),tt(r,"『",M_),tt(r,"』",D_),tt(r,"<",R_),tt(r,">",U_),tt(r,"&",Q_),tt(r,"*",$_),tt(r,"@",kf),tt(r,"`",W_),tt(r,"^",G_),tt(r,":",Df),tt(r,",",_8),tt(r,"$",K_),tt(r,".",Eu),tt(r,"=",V_),tt(r,"!",k8),tt(r,"-",Ul),tt(r,"%",Jw),tt(r,"|",q_),tt(r,"+",X_),tt(r,"#",Y_),tt(r,"?",Zw),tt(r,'"',E8),tt(r,"/",Tu),tt(r,";",T8),tt(r,"~",e1),tt(r,"_",J_),tt(r,"\\",z_),tt(r,"・",fde);const n=_i(r,$d,S8,{[OL]:!0});_i(n,$d,n);const i=_i(n,Hd,dde,{[qw]:!0}),s=_i(n,Db,Ade,{[vw]:!0}),o=_i(r,Hd,Jd,{[FL]:!0});_i(o,$d,i),_i(o,Hd,o),_i(i,$d,i),_i(i,Hd,i);const l=_i(r,Db,DL,{[LL]:!0});_i(l,Hd),_i(l,$d,s),_i(l,Db,l),_i(s,$d,s),_i(s,Hd),_i(s,Db,s);const c=tt(r,mI,B8,{[fI]:!0}),u=tt(r,OW,QL,{[fI]:!0}),d=_i(r,pI,QL,{[fI]:!0});tt(r,gI,d),tt(u,mI,c),tt(u,gI,d),_i(u,pI,d),tt(d,OW),tt(d,mI),_i(d,pI,d),tt(d,gI,d);const A=_i(r,hI,hde,{[ude]:!0});tt(A,"#"),_i(A,hI,A),tt(A,nRe,A);const h=tt(A,iRe);tt(h,"#"),_i(h,hI,A);const f=[[Hd,o],[$d,i]],m=[[Hd,null],[Db,l],[$d,s]];for(let p=0;pp[0]>g[0]?1:-1);for(let p=0;p=0?x[ML]=!0:Hd.test(g)?$d.test(g)?x[qw]=!0:x[FL]=!0:x[OL]=!0,IW(r,g,g,x)}return IW(r,"localhost",u2,{ascii:!0}),r.jd=new ko(Z_),{start:r,tokens:Object.assign({groups:t},pde)}}function mde(e,t){const r=aRe(t.replace(/[A-Z]/g,l=>l.toLowerCase())),n=r.length,i=[];let s=0,o=0;for(;o=0&&(A+=r[o].length,h++),u+=r[o].length,s+=r[o].length,o++;s-=A,o-=h,u-=A,i.push({t:d.t,v:t.slice(s-u,s),s:s-u,e:s})}return i}function aRe(e){const t=[],r=e.length;let n=0;for(;n56319||n+1===r||(s=e.charCodeAt(n+1))<56320||s>57343?e[n]:e.slice(n,n+2);t.push(o),n+=o.length}return t}function hf(e,t,r,n,i){let s;const o=t.length;for(let l=0;l=0;)s++;if(s>0){t.push(r.join(""));for(let o=parseInt(e.substring(n,n+s),10);o>0;o--)r.pop();n+=s}else r.push(e[n]),n++}return t}const d2={defaultProtocol:"http",events:null,format:LW,formatHref:LW,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function P8(e,t=null){let r=Object.assign({},d2);e&&(r=Object.assign(r,e instanceof P8?e.o:e));const n=r.ignoreTags,i=[];for(let s=0;sr?n.substring(0,r)+"…":n},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=d2.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,r=this.toHref(e.get("defaultProtocol")),n=e.get("formatHref",r,this),i=e.get("tagName",r,t),s=this.toFormattedString(e),o={},l=e.get("className",r,t),c=e.get("target",r,t),u=e.get("rel",r,t),d=e.getObj("attributes",r,t),A=e.getObj("events",r,t);return o.href=n,l&&(o.class=l),c&&(o.target=c),u&&(o.rel=u),d&&Object.assign(o,d),{tagName:i,attributes:o,content:s,eventListeners:A}}};function GE(e,t){class r extends gde{constructor(i,s){super(i,s),this.t=e}}for(const n in t)r.prototype[n]=t[n];return r.t=e,r}const MW=GE("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),DW=GE("text"),oRe=GE("nl"),Cj=GE("url",{isLink:!0,toHref(e=d2.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==u2&&e[1].t===Df}}),Ll=e=>new ko(e);function lRe({groups:e}){const t=e.domain.concat([Q_,$_,kf,z_,W_,G_,K_,V_,Ul,S8,Jw,q_,X_,Y_,Tu,Z_,e1,J_]),r=[H_,Df,_8,Eu,k8,Jw,Zw,E8,T8,T_,P_,Xw,Yw,__,B_,k_,E_,I_,O_,F_,L_,M_,D_,R_,U_],n=[Q_,H_,$_,z_,W_,G_,K_,V_,Ul,Xw,Yw,Jw,q_,X_,Y_,Zw,Tu,Z_,e1,J_],i=Ll(),s=tt(i,e1);Pr(s,n,s),Pr(s,e.domain,s);const o=Ll(),l=Ll(),c=Ll();Pr(i,e.domain,o),Pr(i,e.scheme,l),Pr(i,e.slashscheme,c),Pr(o,n,s),Pr(o,e.domain,o);const u=tt(o,kf);tt(s,kf,u),tt(l,kf,u),tt(c,kf,u);const d=tt(s,Eu);Pr(d,n,s),Pr(d,e.domain,s);const A=Ll();Pr(u,e.domain,A),Pr(A,e.domain,A);const h=tt(A,Eu);Pr(h,e.domain,A);const f=Ll(MW);Pr(h,e.tld,f),Pr(h,e.utld,f),tt(u,u2,f);const m=tt(A,Ul);tt(m,Ul,m),Pr(m,e.domain,A),Pr(f,e.domain,A),tt(f,Eu,h),tt(f,Ul,m);const p=tt(f,Df);Pr(p,e.numeric,MW);const g=tt(o,Ul),v=tt(o,Eu);tt(g,Ul,g),Pr(g,e.domain,o),Pr(v,n,s),Pr(v,e.domain,o);const x=Ll(Cj);Pr(v,e.tld,x),Pr(v,e.utld,x),Pr(x,e.domain,o),Pr(x,n,s),tt(x,Eu,v),tt(x,Ul,g),tt(x,kf,u);const y=tt(x,Df),b=Ll(Cj);Pr(y,e.numeric,b);const C=Ll(Cj),j=Ll();Pr(C,t,C),Pr(C,r,j),Pr(j,t,C),Pr(j,r,j),tt(x,Tu,C),tt(b,Tu,C);const S=tt(l,Df),T=tt(c,Df),B=tt(T,Tu),I=tt(B,Tu);Pr(l,e.domain,o),tt(l,Eu,v),tt(l,Ul,g),Pr(c,e.domain,o),tt(c,Eu,v),tt(c,Ul,g),Pr(S,e.domain,C),tt(S,Tu,C),tt(S,Zw,C),Pr(I,e.domain,C),Pr(I,t,C),tt(I,Tu,C);const P=[[Xw,Yw],[B_,__],[k_,E_],[T_,P_],[I_,O_],[F_,L_],[M_,D_],[R_,U_]];for(let E=0;E=0&&h++,i++,d++;if(h<0)i-=d,i0&&(s.push(vI(DW,t,o)),o=[]),i-=h,d-=h;const f=A.t,m=r.slice(i-d,i);s.push(vI(f,t,m))}}return o.length>0&&s.push(vI(DW,t,o)),s}function vI(e,t,r){const n=r[0].s,i=r[r.length-1].e,s=t.slice(n,i);return new e(s,r)}const uRe=typeof console<"u"&&console&&console.warn||(()=>{}),dRe="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ti={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function ARe(){return ko.groups={},ti.scanner=null,ti.parser=null,ti.tokenQueue=[],ti.pluginQueue=[],ti.customSchemes=[],ti.initialized=!1,ti}function RW(e,t=!1){if(ti.initialized&&uRe(`linkifyjs: already initialized - will not register custom scheme "${e}" ${dRe}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" 3. "-" cannot repeat`);ti.customSchemes.push([e,t])}function fRe(){ti.scanner=sRe(ti.customSchemes);for(let e=0;e{const i=t.some(u=>u.docChanged)&&!r.doc.eq(n.doc),s=t.some(u=>u.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=n,l=Mue(r.doc,[...t]);if(zue(l).forEach(({newRange:u})=>{const d=YLe(n.doc,u,f=>f.isTextblock);let A,h;if(d.length>1)A=d[0],h=n.doc.textBetween(A.pos,A.pos+A.node.nodeSize,void 0," ");else if(d.length){const f=n.doc.textBetween(u.from,u.to," "," ");if(!pRe.test(f))return;A=d[0],h=n.doc.textBetween(A.pos,u.to,void 0," ")}if(A&&h){const f=h.split(hRe).filter(Boolean);if(f.length<=0)return!1;const m=f[f.length-1],p=A.pos+h.lastIndexOf(m);if(!m)return!1;const g=I8(m).map(v=>v.toObject(e.defaultProtocol));if(!gRe(g))return!1;g.filter(v=>v.isLink).map(v=>({...v,from:p+v.start+1,to:p+v.end+1})).filter(v=>n.schema.marks.code?!n.doc.rangeHasMark(v.from,v.to,n.schema.marks.code):!0).filter(v=>e.validate(v.value)).filter(v=>e.shouldAutoLink(v.value)).forEach(v=>{b8(v.from,v.to,n.doc).some(x=>x.mark.type===e.type)||o.addMark(v.from,v.to,e.type.create({href:v.href}))})}}),!!o.steps.length)return o}})}function xRe(e){return new Ri({key:new Ks("handleClickLink"),props:{handleClick:(t,r,n)=>{var i,s;if(n.button!==0||!t.editable)return!1;let o=null;if(n.target instanceof HTMLAnchorElement)o=n.target;else{let d=n.target;const A=[];for(;d.nodeName!=="DIV";)A.push(d),d=d.parentNode;o=A.find(h=>h.nodeName==="A")}if(!o)return!1;const l=$ue(t.state,e.type.name),c=(i=o==null?void 0:o.href)!=null?i:l.href,u=(s=o==null?void 0:o.target)!=null?s:l.target;return e.enableClickSelection&&e.editor.commands.extendMarkRange(e.type.name),o&&c?(window.open(c,u),!0):!1}}})}function yRe(e){return new Ri({key:new Ks("handlePasteLink"),props:{handlePaste:(t,r,n)=>{const{shouldAutoLink:i}=e,{state:s}=t,{selection:o}=s,{empty:l}=o;if(l)return!1;let c="";n.content.forEach(d=>{c+=d.textContent});const u=vde(c,{defaultProtocol:e.defaultProtocol}).find(d=>d.isLink&&d.value===c);return!c||!u||i!==void 0&&!i(u.href)?!1:e.editor.commands.setMark(e.type,{href:u.href})}}})}function Ip(e,t){const r=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(n=>{const i=typeof n=="string"?n:n.scheme;i&&r.push(i)}),!e||e.replace(mRe,"").match(new RegExp(`^(?:(?:${r.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var xde=Lg.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){RW(e);return}RW(e.scheme,e.optionalSlashes)})},onDestroy(){ARe()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!Ip(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:r=>!!Ip(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!Ip(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Ji(this.options.HTMLAttributes,e),0]:["a",Ji(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var r;const n=((r=e.attrs)==null?void 0:r.href)||"";return`[${t.renderChildren(e)}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:r}=e;return this.options.isAllowedUri(r,{defaultValidate:n=>!!Ip(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:r}=e||{};return r&&!this.options.isAllowedUri(r,{defaultValidate:n=>!!Ip(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[fg({find:e=>{const t=[];if(e){const{protocols:r,defaultProtocol:n}=this.options,i=vde(e).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:o=>!!Ip(o,r),protocols:r,defaultProtocol:n}));i.length&&i.forEach(s=>{this.options.shouldAutoLink(s.value)&&t.push({text:s.value,data:{href:s.href},index:s.start})})}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)==null?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:r}=this.options;return this.options.autolink&&e.push(vRe({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!Ip(i,t),protocols:t,defaultProtocol:r}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&e.push(xRe({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(yRe({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),bRe=xde,wRe=Object.defineProperty,CRe=(e,t)=>{for(var r in t)wRe(e,r,{get:t[r],enumerable:!0})},NRe="listItem",UW="textStyle",QW=/^\s*([-+*])\s$/,yde=$o.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",Ji(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>e.type!=="list"||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(NRe,this.editor.getAttributes(UW)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Fy({find:QW,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Fy({find:QW,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(UW),editor:this.editor})),[e]}}),bde=$o.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Ji(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{if(e.type!=="list_item")return[];let r=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(i=>i.type==="paragraph"))r=t.parseChildren(e.tokens);else{const i=e.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(r=[{type:"paragraph",content:t.parseInline(i.tokens)}],e.tokens.length>1){const o=e.tokens.slice(1),l=t.parseChildren(o);r.push(...l)}}else r=t.parseChildren(e.tokens)}return r.length===0&&(r=[{type:"paragraph",content:[]}]),{type:"listItem",content:r}},renderMarkdown:(e,t,r)=>j8(e,t,n=>n.parentType==="bulletList"?"- ":n.parentType==="orderedList"?`${n.index+1}. `:"- ",r),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),jRe={};CRe(jRe,{findListItemPos:()=>QC,getNextListDepth:()=>F8,handleBackspace:()=>HL,handleDelete:()=>$L,hasListBefore:()=>wde,hasListItemAfter:()=>SRe,hasListItemBefore:()=>Cde,listItemHasSubList:()=>Nde,nextListIsDeeper:()=>jde,nextListIsHigher:()=>Sde});var QC=(e,t)=>{const{$from:r}=t.selection,n=fs(e,t.schema);let i=null,s=r.depth,o=r.pos,l=null;for(;s>0&&l===null;)i=r.node(s),i.type===n?l=s:(s-=1,o-=1);return l===null?null:{$pos:t.doc.resolve(o),depth:l}},F8=(e,t)=>{const r=QC(e,t);if(!r)return!1;const[,n]=oMe(t,e,r.$pos.pos+4);return n},wde=(e,t,r)=>{const{$anchor:n}=e.selection,i=Math.max(0,n.pos-2),s=e.doc.resolve(i).node();return!(!s||!r.includes(s.type.name))},Cde=(e,t)=>{var r;const{$anchor:n}=t.selection,i=t.doc.resolve(n.pos-2);return!(i.index()===0||((r=i.nodeBefore)==null?void 0:r.type.name)!==e)},Nde=(e,t,r)=>{if(!r)return!1;const n=fs(e,t.schema);let i=!1;return r.descendants(s=>{s.type===n&&(i=!0)}),i},HL=(e,t,r)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!zh(e.state,t)&&wde(e.state,t,r)){const{$anchor:l}=e.state.selection,c=e.state.doc.resolve(l.before()-1),u=[];c.node().descendants((h,f)=>{h.type.name===t&&u.push({node:h,pos:f})});const d=u.at(-1);if(!d)return!1;const A=e.state.doc.resolve(c.start()+d.pos+1);return e.chain().cut({from:l.start()-1,to:l.end()+1},A.end()).joinForward().run()}if(!zh(e.state,t)||!dMe(e.state))return!1;const n=QC(t,e.state);if(!n)return!1;const s=e.state.doc.resolve(n.$pos.pos-2).node(n.depth),o=Nde(t,e.state,s);return Cde(t,e.state)&&!o?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},jde=(e,t)=>{const r=F8(e,t),n=QC(e,t);return!n||!r?!1:r>n.depth},Sde=(e,t)=>{const r=F8(e,t),n=QC(e,t);return!n||!r?!1:r{if(!zh(e.state,t)||!uMe(e.state,t))return!1;const{selection:r}=e.state,{$from:n,$to:i}=r;return!r.empty&&n.sameParent(i)?!1:jde(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Sde(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},SRe=(e,t)=>{var r;const{$anchor:n}=t.selection,i=t.doc.resolve(n.pos-n.parentOffset-2);return!(i.index()===i.parent.childCount-1||((r=i.nodeAfter)==null?void 0:r.type.name)!==e)},Bde=ps.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:r})=>{e.state.schema.nodes[r]!==void 0&&$L(e,r)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:r})=>{e.state.schema.nodes[r]!==void 0&&$L(e,r)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:n})=>{e.state.schema.nodes[r]!==void 0&&HL(e,r,n)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:n})=>{e.state.schema.nodes[r]!==void 0&&HL(e,r,n)&&(t=!0)}),t}}}}),HW=/^(\s*)(\d+)\.\s+(.*)$/,BRe=/^\s/;function _Re(e){const t=[];let r=0,n=0;for(;rt;)h.push(e[A]),A+=1;if(h.length>0){const f=Math.min(...h.map(p=>p.indent)),m=_de(h,f,r);u.push({type:"list",ordered:!0,start:h[0].number,items:m,raw:h.map(p=>p.raw).join(` `)})}i.push({type:"list_item",raw:o.raw,tokens:u}),s=A}else s+=1}return i}function kRe(e,t){return e.map(r=>{if(r.type!=="list_item")return t.parseChildren([r])[0];const n=[];return r.tokens&&r.tokens.length>0&&r.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")n.push(...t.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=t.parseChildren([i]);n.push({type:"paragraph",content:s})}else{const s=t.parseChildren([i]);s.length>0&&n.push(...s)}}),{type:"listItem",content:n}})}var ERe="listItem",$W="textStyle",zW=/^(\d+)\.\s$/,kde=$o.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...r}=e;return t===1?["ol",Ji(this.options.HTMLAttributes,r),0]:["ol",Ji(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if(e.type!=="list"||!e.ordered)return[];const r=e.start||1,n=e.items?kRe(e.items,t):[];return r!==1?{type:"orderedList",attrs:{start:r},content:n}:{type:"orderedList",content:n}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` `):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{const t=e.match(/^(\s*)(\d+)\.\s+/),r=t==null?void 0:t.index;return r!==void 0?r:-1},tokenize:(e,t,r)=>{var n;const i=e.split(` `),[s,o]=_Re(i);if(s.length===0)return;const l=_de(s,0,r);return l.length===0?void 0:{type:"list",ordered:!0,start:((n=s[0])==null?void 0:n.number)||1,items:l,raw:i.slice(0,o).join(` `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ERe,this.editor.getAttributes($W)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Fy({find:zW,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,r)=>r.childCount+r.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Fy({find:zW,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes($W)}),joinPredicate:(t,r)=>r.childCount+r.attrs.start===+t[1],editor:this.editor})),[e]}}),TRe=/^\s*(\[([( |x])?\])\s$/,PRe=$o.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",Ji(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const r=[];if(e.tokens&&e.tokens.length>0?r.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?r.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):r.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){const n=t.parseChildren(e.nestedTokens);r.push(...n)}return t.createNode("taskItem",{checked:e.checked||!1},r)},renderMarkdown:(e,t)=>{var r;const i=`- [${(r=e.attrs)!=null&&r.checked?"x":" "}] `;return j8(e,t,i)},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:r,editor:n})=>{const i=document.createElement("li"),s=document.createElement("label"),o=document.createElement("span"),l=document.createElement("input"),c=document.createElement("div"),u=d=>{var A,h;l.ariaLabel=((h=(A=this.options.a11y)==null?void 0:A.checkboxLabel)==null?void 0:h.call(A,d,l.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};return u(e),s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",d=>d.preventDefault()),l.addEventListener("change",d=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:A}=d.target;n.isEditable&&typeof r=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const f=r();if(typeof f!="number")return!1;const m=h.doc.nodeAt(f);return h.setNodeMarkup(f,void 0,{...m==null?void 0:m.attrs,checked:A}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,A)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,A])=>{i.setAttribute(d,A)}),i.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,s.append(l,o),i.append(s,c),Object.entries(t).forEach(([d,A])=>{i.setAttribute(d,A)}),{dom:i,contentDOM:c,update:d=>d.type!==this.type?!1:(i.dataset.checked=d.attrs.checked,l.checked=d.attrs.checked,u(d),!0)}}},addInputRules(){return[Fy({find:TRe,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),IRe=$o.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",Ji(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` `):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const r=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:t.index;return r!==void 0?r:-1},tokenize(e,t,r){const n=s=>{const o=PL(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,c)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:r.inlineTokens(l.mainContent),nestedTokens:c}),customNestedParser:n},r);return o?[{type:"taskList",raw:o.raw,items:o.items}]:r.blockTokens(s)},i=PL(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,o)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:r.inlineTokens(s.mainContent),nestedTokens:o}),customNestedParser:n},r);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});ps.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push(yde.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(bde.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Bde.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(kde.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(PRe.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(IRe.configure(this.options.taskList)),e}});var ORe=$o.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Ji(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const r=e.tokens||[];return r.length===1&&r[0].type==="image"?t.parseChildren([r[0]]):t.createNode("paragraph",void 0,t.parseInline(r))},renderMarkdown:(e,t)=>!e||!Array.isArray(e.content)?"":t.renderChildren(e.content),addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),FRe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,LRe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,MRe=Lg.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",Ji(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Oy({find:FRe,type:this.type})]},addPasteRules(){return[fg({find:LRe,type:this.type})]}}),DRe=$o.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),RRe=Lg.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",Ji(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,t,r){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!i)return;const s=i[2].trim();return{type:"underline",raw:i[0],text:s,tokens:r.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function URe(e={}){return new Ri({view(t){return new QRe(t,e)}})}class QRe{constructor(t,r){var n;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=r.width)!==null&&n!==void 0?n:1,this.color=r.color===!1?void 0:r.color||"black",this.class=r.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return t.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:t,handler:r})=>this.editorView.dom.removeEventListener(t,r))}update(t,r){this.cursorPos!=null&&r.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),r=!t.parent.inlineContent,n,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,l=s.height/i.offsetHeight;if(r){let A=t.nodeBefore,h=t.nodeAfter;if(A||h){let f=this.editorView.nodeDOM(this.cursorPos-(A?A.nodeSize:0));if(f){let m=f.getBoundingClientRect(),p=A?m.bottom:m.top;A&&h&&(p=(p+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*l;n={left:m.left,right:m.right,top:p-g,bottom:p+g}}}}if(!n){let A=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*o;n={left:A.left-h,right:A.left+h,top:A.top,bottom:A.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r);let u,d;if(!c||c==document.body&&getComputedStyle(c).position=="static")u=-pageXOffset,d=-pageYOffset;else{let A=c.getBoundingClientRect(),h=A.width/c.offsetWidth,f=A.height/c.offsetHeight;u=A.left-c.scrollLeft*h,d=A.top-c.scrollTop*f}this.element.style.left=(n.left-u)/o+"px",this.element.style.top=(n.top-d)/l+"px",this.element.style.width=(n.right-n.left)/o+"px",this.element.style.height=(n.bottom-n.top)/l+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let r=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=r&&r.inside>=0&&this.editorView.state.doc.nodeAt(r.inside),i=n&&n.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,r,t):i;if(r&&!s){let o=r.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Fce(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class Fi extends Ir{constructor(t){super(t,t)}map(t,r){let n=t.resolve(r.map(this.head));return Fi.valid(n)?new Fi(n):Ir.near(n)}content(){return vt.empty}eq(t){return t instanceof Fi&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Fi(t.resolve(r.pos))}getBookmark(){return new L8(this.anchor)}static valid(t){let r=t.parent;if(r.isTextblock||!HRe(t)||!$Re(t))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let i=r.contentMatchAt(t.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(t,r,n=!1){e:for(;;){if(!n&&Fi.valid(t))return t;let i=t.pos,s=null;for(let o=t.depth;;o--){let l=t.node(o);if(r>0?t.indexAfter(o)0){s=l.child(r>0?t.indexAfter(o):t.index(o)-1);break}else if(o==0)return null;i+=r;let c=t.doc.resolve(i);if(Fi.valid(c))return c}for(;;){let o=r>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!Yt.isSelectable(s)){t=t.doc.resolve(i+s.nodeSize*r),n=!1;continue e}break}s=o,i+=r;let l=t.doc.resolve(i);if(Fi.valid(l))return l}return null}}}Fi.prototype.visible=!1;Fi.findFrom=Fi.findGapCursorFrom;Ir.jsonID("gapcursor",Fi);class L8{constructor(t){this.pos=t}map(t){return new L8(t.map(this.pos))}resolve(t){let r=t.resolve(this.pos);return Fi.valid(r)?new Fi(r):Ir.near(r)}}function Ede(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function HRe(e){for(let t=e.depth;t>=0;t--){let r=e.index(t),n=e.node(t);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||Ede(i.type))return!0;if(i.inlineContent)return!1}}return!0}function $Re(e){for(let t=e.depth;t>=0;t--){let r=e.indexAfter(t),n=e.node(t);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||Ede(i.type))return!0;if(i.inlineContent)return!1}}return!0}function zRe(){return new Ri({props:{decorations:VRe,createSelectionBetween(e,t,r){return t.pos==r.pos&&Fi.valid(r)?new Fi(r):null},handleClick:GRe,handleKeyDown:WRe,handleDOMEvents:{beforeinput:KRe}}})}const WRe=kue({ArrowLeft:Nj("horiz",-1),ArrowRight:Nj("horiz",1),ArrowUp:Nj("vert",-1),ArrowDown:Nj("vert",1)});function Nj(e,t){const r=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(n,i,s){let o=n.selection,l=t>0?o.$to:o.$from,c=o.empty;if(o instanceof gr){if(!s.endOfTextblock(r)||l.depth==0)return!1;c=!1,l=n.doc.resolve(t>0?l.after():l.before())}let u=Fi.findGapCursorFrom(l,t,c);return u?(i&&i(n.tr.setSelection(new Fi(u))),!0):!1}}function GRe(e,t,r){if(!e||!e.editable)return!1;let n=e.state.doc.resolve(t);if(!Fi.valid(n))return!1;let i=e.posAtCoords({left:r.clientX,top:r.clientY});return i&&i.inside>-1&&Yt.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Fi(n))),!0)}function KRe(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Fi))return!1;let{$from:r}=e.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(e.state.schema.nodes.text);if(!n)return!1;let i=Je.empty;for(let o=n.length-1;o>=0;o--)i=Je.from(n[o].createAndFill(null,i));let s=e.state.tr.replace(r.pos,r.pos,new vt(i,0,0));return s.setSelection(gr.near(s.doc.resolve(r.pos+1))),e.dispatch(s),!1}function VRe(e){if(!(e.selection instanceof Fi))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",xi.create(e.doc,[ro.widget(e.selection.head,t,{key:"gapcursor"})])}var ek=200,zs=function(){};zs.prototype.append=function(t){return t.length?(t=zs.from(t),!this.length&&t||t.length=r?zs.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,r))};zs.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};zs.prototype.forEach=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(t,r,n,0):this.forEachInvertedInner(t,r,n,0)};zs.prototype.map=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(s,o){return i.push(t(s,o))},r,n),i};zs.from=function(t){return t instanceof zs?t:t&&t.length?new Tde(t):zs.empty};var Tde=function(e){function t(n){e.call(this),this.values=n}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new t(this.values.slice(i,s))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,s,o,l){for(var c=s;c=o;c--)if(i(this.values[c],l+c)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=ek)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=ek)return new t(i.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(t.prototype,r),t}(zs);zs.empty=new Tde([]);var qRe=function(e){function t(r,n){e.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(n){return nl&&this.right.forEachInner(n,Math.max(i-l,0),Math.min(this.length,s)-l,o+l)===!1)return!1},t.prototype.forEachInvertedInner=function(n,i,s,o){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(n,i-l,Math.max(s,l)-l,o+l)===!1||s=s?this.right.slice(n-s,i-s):this.left.slice(n,s).append(this.right.slice(0,i-s))},t.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new t(i,this.right)},t.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new t(this.left,new t(this.right,n)):new t(this,n)},t}(zs);const XRe=500;class Wc{constructor(t,r){this.items=t,this.eventCount=r}popEvent(t,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,s;r&&(i=this.remapping(n,this.items.length),s=i.maps.length);let o=t.tr,l,c,u=[],d=[];return this.items.forEach((A,h)=>{if(!A.step){i||(i=this.remapping(n,h+1),s=i.maps.length),s--,d.push(A);return}if(i){d.push(new Pu(A.map));let f=A.step.map(i.slice(s)),m;f&&o.maybeStep(f).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],u.push(new Pu(m,void 0,void 0,u.length+d.length))),s--,m&&i.appendMap(m,s)}else o.maybeStep(A.step);if(A.selection)return l=i?A.selection.map(i.slice(s)):A.selection,c=new Wc(this.items.slice(0,n).append(d.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:l}}addTransform(t,r,n,i){let s=[],o=this.eventCount,l=this.items,c=!i&&l.length?l.get(l.length-1):null;for(let d=0;dJRe&&(l=YRe(l,u),o-=u),new Wc(l.append(s),o)}remapping(t,r){let n=new n2;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=t?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},t,r),n}addMaps(t){return this.eventCount==0?this:new Wc(this.items.append(t.map(r=>new Pu(r))),this.eventCount)}rebased(t,r){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-r),s=t.mapping,o=t.steps.length,l=this.eventCount;this.items.forEach(h=>{h.selection&&l--},i);let c=r;this.items.forEach(h=>{let f=s.getMirror(--c);if(f==null)return;o=Math.min(o,f);let m=s.maps[f];if(h.step){let p=t.steps[f].invert(t.docs[f]),g=h.selection&&h.selection.map(s.slice(c+1,f));g&&l++,n.push(new Pu(m,p,g))}else n.push(new Pu(m))},i);let u=[];for(let h=r;hXRe&&(A=A.compress(this.items.length-n.length)),A}emptyItemCount(){let t=0;return this.items.forEach(r=>{r.step||t++}),t}compress(t=this.items.length){let r=this.remapping(0,t),n=r.maps.length,i=[],s=0;return this.items.forEach((o,l)=>{if(l>=t)i.push(o),o.selection&&s++;else if(o.step){let c=o.step.map(r.slice(n)),u=c&&c.getMap();if(n--,u&&r.appendMap(u,n),c){let d=o.selection&&o.selection.map(r.slice(n));d&&s++;let A=new Pu(u.invert(),c,d),h,f=i.length-1;(h=i.length&&i[f].merge(A))?i[f]=h:i.push(A)}}else o.map&&n--},this.items.length,0),new Wc(zs.from(i.reverse()),s)}}Wc.empty=new Wc(zs.empty,0);function YRe(e,t){let r;return e.forEach((n,i)=>{if(n.selection&&t--==0)return r=i,!1}),e.slice(r)}class Pu{constructor(t,r,n,i){this.map=t,this.step=r,this.selection=n,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let r=t.step.merge(this.step);if(r)return new Pu(r.getMap().invert(),r,this.selection)}}}class Ef{constructor(t,r,n,i,s){this.done=t,this.undone=r,this.prevRanges=n,this.prevTime=i,this.prevComposition=s}}const JRe=20;function ZRe(e,t,r,n){let i=r.getMeta(Dm),s;if(i)return i.historyState;r.getMeta(r6e)&&(e=new Ef(e.done,e.undone,null,0,-1));let o=r.getMeta("appendedTransaction");if(r.steps.length==0)return e;if(o&&o.getMeta(Dm))return o.getMeta(Dm).redo?new Ef(e.done.addTransform(r,void 0,n,XS(t)),e.undone,WW(r.mapping.maps),e.prevTime,e.prevComposition):new Ef(e.done,e.undone.addTransform(r,void 0,n,XS(t)),null,e.prevTime,e.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=r.getMeta("composition"),c=e.prevTime==0||!o&&e.prevComposition!=l&&(e.prevTime<(r.time||0)-n.newGroupDelay||!e6e(r,e.prevRanges)),u=o?xI(e.prevRanges,r.mapping):WW(r.mapping.maps);return new Ef(e.done.addTransform(r,c?t.selection.getBookmark():void 0,n,XS(t)),Wc.empty,u,r.time,l??e.prevComposition)}else return(s=r.getMeta("rebased"))?new Ef(e.done.rebased(r,s),e.undone.rebased(r,s),xI(e.prevRanges,r.mapping),e.prevTime,e.prevComposition):new Ef(e.done.addMaps(r.mapping.maps),e.undone.addMaps(r.mapping.maps),xI(e.prevRanges,r.mapping),e.prevTime,e.prevComposition)}function e6e(e,t){if(!t)return!1;if(!e.docChanged)return!0;let r=!1;return e.mapping.maps[0].forEach((n,i)=>{for(let s=0;s=t[s]&&(r=!0)}),r}function WW(e){let t=[];for(let r=e.length-1;r>=0&&t.length==0;r--)e[r].forEach((n,i,s,o)=>t.push(s,o));return t}function xI(e,t){if(!e)return null;let r=[];for(let n=0;n{let i=Dm.getState(r);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(n){let s=t6e(i,r,e);s&&n(t?s.scrollIntoView():s)}return!0}}const Ide=Pde(!1,!0),Ode=Pde(!0,!0);ps.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc;if(((e==null?void 0:e.mode)||this.options.mode)==="textSize"){const n=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(n)}return t.nodeSize},this.storage.words=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc,r=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(r)}},addProseMirrorPlugins(){let e=!1;return[new Ri({key:new Ks("characterCount"),appendTransaction:(t,r,n)=>{if(e)return;const i=this.options.limit;if(i==null||i===0){e=!0;return}const s=this.storage.characters({node:n.doc});if(s>i){const o=s-i,l=0,c=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const u=n.tr.deleteRange(l,c);return e=!0,u}e=!0},filterTransaction:(t,r)=>{const n=this.options.limit;if(!t.docChanged||n===0||n===null||n===void 0)return!0;const i=this.storage.characters({node:r.doc}),s=this.storage.characters({node:t.doc});if(s<=n||i>n&&s>n&&s<=i)return!0;if(i>n&&s>n&&s>i||!t.getMeta("paste"))return!1;const l=t.selection.$head.pos,c=s-n,u=l-c,d=l;return t.deleteRange(u,d),!(this.storage.characters({node:t.doc})>n)}})]}});var i6e=ps.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[URe(this.options)]}});ps.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Ri({key:new Ks("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:r,isFocused:n}=this.editor,{anchor:i}=t,s=[];if(!r||!n)return xi.create(e,[]);let o=0;this.options.mode==="deepest"&&e.descendants((c,u)=>{if(c.isText)return;if(!(i>=u&&i<=u+c.nodeSize-1))return!1;o+=1});let l=0;return e.descendants((c,u)=>{if(c.isText||!(i>=u&&i<=u+c.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&o-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";s.push(ro.node(u,u+c.nodeSize,{class:this.options.className}))}),xi.create(e,s)}}})]}});var s6e=ps.create({name:"gapCursor",addProseMirrorPlugins(){return[zRe()]},extendNodeSchema(e){var t;const r={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=wn(Vt(e,"allowGapCursor",r)))!=null?t:null}}}),a6e=ps.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Ri({key:new Ks("placeholder"),props:{decorations:({doc:e,selection:t})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=t,i=[];if(!r)return null;const s=this.editor.isEmpty;return e.descendants((o,l)=>{const c=n>=l&&n<=l+o.nodeSize,u=!o.isLeaf&&HE(o);if((c||!this.options.showOnlyCurrent)&&u){const d=[this.options.emptyNodeClass];s&&d.push(this.options.emptyEditorClass);const A=ro.node(l,l+o.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:l,hasAnchor:c}):this.options.placeholder});i.push(A)}return this.options.includeChildren}),xi.create(e,i)}}})]}});ps.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new Ri({key:new Ks("selection"),props:{decorations(r){return r.selection.empty||e.isFocused||!e.isEditable||Wue(r.selection)||e.view.dragging?null:xi.create(r.doc,[ro.inline(r.selection.from,r.selection.to,{class:t.className})])}}})]}});function KW({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(t==null?void 0:t.type)===e}var o6e=ps.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new Ks(this.name),r=((e=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:e.name)||this.options.node||"paragraph",n=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(r).includes(i.name));return[new Ri({key:t,appendTransaction:(i,s,o)=>{const{doc:l,tr:c,schema:u}=o,d=t.getState(o),A=l.content.size,h=u.nodes[r];if(d)return c.insert(A,h.create())},state:{init:(i,s)=>{const o=s.tr.doc.lastChild;return!KW({node:o,types:n})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const o=i.doc.lastChild;return!KW({node:o,types:n})}}})]}}),l6e=ps.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>Ide(e,t),redo:()=>({state:e,dispatch:t})=>Ode(e,t)}},addProseMirrorPlugins(){return[n6e(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),c6e=ps.create({name:"starterKit",addExtensions(){var e,t,r,n;const i=[];return this.options.bold!==!1&&i.push(FDe.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(EDe.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(yde.configure(this.options.bulletList)),this.options.code!==!1&&i.push(DDe.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(QDe.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(HDe.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(i6e.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(s6e.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push($De.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(zDe.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(l6e.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(WDe.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(XDe.configure(this.options.italic)),this.options.listItem!==!1&&i.push(bde.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(Bde.configure((e=this.options)==null?void 0:e.listKeymap)),this.options.link!==!1&&i.push(xde.configure((t=this.options)==null?void 0:t.link)),this.options.orderedList!==!1&&i.push(kde.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(ORe.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(MRe.configure(this.options.strike)),this.options.text!==!1&&i.push(DRe.configure(this.options.text)),this.options.underline!==!1&&i.push(RRe.configure((r=this.options)==null?void 0:r.underline)),this.options.trailingNode!==!1&&i.push(o6e.configure((n=this.options)==null?void 0:n.trailingNode)),i}}),u6e=c6e,d6e=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,A6e=$o.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",Ji(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,r,n,i,s,o;const l=(r=(t=e.attrs)==null?void 0:t.src)!=null?r:"",c=(i=(n=e.attrs)==null?void 0:n.alt)!=null?i:"",u=(o=(s=e.attrs)==null?void 0:s.title)!=null?o:"";return u?`![${c}](${l} "${u}")`:`![${c}](${l})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u"||!this.editor.isEditable)return null;const{directions:e,minWidth:t,minHeight:r,alwaysPreserveAspectRatio:n}=this.options.resize;return({node:i,getPos:s,HTMLAttributes:o})=>{const l=document.createElement("img");Object.entries(o).forEach(([d,A])=>{if(A!=null)switch(d){case"width":case"height":break;default:l.setAttribute(d,A);break}}),l.src=o.src;const c=new KMe({element:l,node:i,getPos:s,onResize:(d,A)=>{l.style.width=`${d}px`,l.style.height=`${A}px`},onCommit:(d,A)=>{const h=s();h!==void 0&&this.editor.chain().setNodeSelection(h).updateAttributes(this.name,{width:d,height:A}).run()},onUpdate:(d,A,h)=>d.type===i.type,options:{directions:e,min:{width:t,height:r},preserveAspectRatio:n===!0}}),u=c.dom;return u.style.visibility="hidden",u.style.pointerEvents="none",l.onload=()=>{u.style.visibility="",u.style.pointerEvents=""},c}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[sde({find:d6e,type:this.type,getAttributes:e=>{const[,,t,r,n]=e;return{src:r,alt:t,title:n}}})]}}),f6e=A6e,h6e=a6e;const p6e=({content:e,onChange:t,placeholder:r})=>{const[n,i]=w.useState(""),[s,o]=w.useState(!1),[l,c]=w.useState(""),[u,d]=w.useState(!1),[A,h]=w.useState(!1),f=jDe({extensions:[u6e.configure({heading:{levels:[1,2,3]}}),bRe.configure({openOnClick:!1,HTMLAttributes:{class:"text-primary underline cursor-pointer hover:text-primary/80"}}),f6e.configure({HTMLAttributes:{class:"max-w-full h-auto rounded-lg my-4"}}),h6e.configure({placeholder:r||"Write your content here..."})],content:e,onUpdate:({editor:g})=>{t(g.getHTML())},editorProps:{attributes:{class:"prose max-w-none focus:outline-none min-h-[300px] p-4 prose-headings:font-bold prose-h1:text-3xl prose-h2:text-2xl prose-h3:text-xl prose-p:my-2 prose-ul:list-disc prose-ul:ml-6 prose-ol:list-decimal prose-ol:ml-6 prose-li:my-1 prose-blockquote:border-l-4 prose-blockquote:border-primary prose-blockquote:pl-4 prose-blockquote:italic prose-pre:bg-muted prose-pre:p-4 prose-pre:rounded-md prose-img:rounded-lg prose-img:my-4"}}});w.useEffect(()=>{f&&e!==f.getHTML()&&f.commands.setContent(e)},[e,f]);const m=()=>{if(n&&f){const g={href:n};s&&(g.target="_blank",g.rel="noopener noreferrer"),f.chain().focus().extendMarkRange("link").setLink(g).run(),i(""),o(!1),d(!1)}},p=()=>{l&&f&&(f.chain().focus().setImage({src:l}).run(),c(""),h(!1))};return f?a.jsxs("div",{className:"border border-input rounded-md bg-background overflow-hidden",children:[a.jsxs("div",{className:"border-b border-input p-2 flex flex-wrap gap-1 bg-muted/30",children:[a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>f.chain().focus().toggleBold().run(),className:f.isActive("bold")?"bg-accent":"",children:a.jsx(Tbe,{className:"h-4 w-4"})}),a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>f.chain().focus().toggleItalic().run(),className:f.isActive("italic")?"bg-accent":"",children:a.jsx(ewe,{className:"h-4 w-4"})}),a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>f.chain().focus().toggleStrike().run(),className:f.isActive("strike")?"bg-accent":"",children:a.jsx(Cwe,{className:"h-4 w-4"})}),a.jsx("div",{className:"w-px h-6 bg-border mx-1"}),a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>f.chain().focus().toggleHeading({level:1}).run(),className:f.isActive("heading",{level:1})?"bg-accent":"",children:a.jsx(Xbe,{className:"h-4 w-4"})}),a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>f.chain().focus().toggleHeading({level:2}).run(),className:f.isActive("heading",{level:2})?"bg-accent":"",children:a.jsx(Ybe,{className:"h-4 w-4"})}),a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>f.chain().focus().toggleHeading({level:3}).run(),className:f.isActive("heading",{level:3})?"bg-accent":"",children:a.jsx(Jbe,{className:"h-4 w-4"})}),a.jsx("div",{className:"w-px h-6 bg-border mx-1"}),a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>f.chain().focus().toggleBulletList().run(),className:f.isActive("bulletList")?"bg-accent":"",children:a.jsx(swe,{className:"h-4 w-4"})}),a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>f.chain().focus().toggleOrderedList().run(),className:f.isActive("orderedList")?"bg-accent":"",children:a.jsx(are,{className:"h-4 w-4"})}),a.jsx("div",{className:"w-px h-6 bg-border mx-1"}),a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>f.chain().focus().toggleBlockquote().run(),className:f.isActive("blockquote")?"bg-accent":"",children:a.jsx(mwe,{className:"h-4 w-4"})}),a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>f.chain().focus().toggleCodeBlock().run(),className:f.isActive("codeBlock")?"bg-accent":"",children:a.jsx(Lbe,{className:"h-4 w-4"})}),a.jsx("div",{className:"w-px h-6 bg-border mx-1"}),a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>d(!0),children:a.jsx(iwe,{className:"h-4 w-4"})}),a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>h(!0),children:a.jsx(D1,{className:"h-4 w-4"})}),a.jsx("div",{className:"w-px h-6 bg-border mx-1"}),a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>f.chain().focus().undo().run(),disabled:!f.can().undo(),children:a.jsx(kwe,{className:"h-4 w-4"})}),a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>f.chain().focus().redo().run(),disabled:!f.can().redo(),children:a.jsx(gwe,{className:"h-4 w-4"})})]}),a.jsx(vDe,{editor:f}),a.jsx(Mi,{open:u,onOpenChange:d,children:a.jsxs(yi,{children:[a.jsxs(bi,{children:[a.jsx(wi,{children:"Insert Link"}),a.jsx(Qo,{children:"Enter the URL you want to link to"})]}),a.jsxs("div",{className:"py-4 space-y-4",children:[a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"link-url",children:"URL"}),a.jsx(st,{id:"link-url",placeholder:"https://example.com",value:n,onChange:g=>i(g.target.value),onKeyDown:g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),m())}})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(EE,{id:"new-tab",checked:s,onCheckedChange:g=>o(g)}),a.jsx(Pe,{htmlFor:"new-tab",className:"text-sm font-normal cursor-pointer",children:"Open in new tab"})]})]}),a.jsxs(nd,{children:[a.jsx(ve,{variant:"outline",onClick:()=>{d(!1),i(""),o(!1)},children:"Cancel"}),a.jsx(ve,{onClick:m,disabled:!n,children:"Insert Link"})]})]})}),a.jsx(Mi,{open:A,onOpenChange:h,children:a.jsxs(yi,{children:[a.jsxs(bi,{children:[a.jsx(wi,{children:"Insert Image"}),a.jsx(Qo,{children:"Enter the URL of the image you want to insert"})]}),a.jsx("div",{className:"py-4",children:a.jsx(st,{placeholder:"https://example.com/image.jpg",value:l,onChange:g=>c(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),p())}})}),a.jsxs(nd,{children:[a.jsx(ve,{variant:"outline",onClick:()=>h(!1),children:"Cancel"}),a.jsx(ve,{onClick:p,children:"Insert Image"})]})]})})]}):null},m6e=()=>{const[e,t]=w.useState([]),[r,n]=w.useState(null),[i,s]=w.useState(!1),[o,l]=w.useState(!0),{toast:c}=Dr(),[u,d]=w.useState({title:"",slug:"",content:"",excerpt:"",content_type:"blog_post",featured_image_url:"",video_url:"",meta_title:"",meta_description:"",keywords:"",status:"draft",featured:!1});w.useEffect(()=>{A()},[]);const A=async()=>{try{const{data:v,error:x}=await Re.from("website_content").select("*").order("created_at",{ascending:!1});if(x)throw x;t(v||[])}catch(v){c({title:"Error",description:"Failed to fetch content: "+v.message,variant:"destructive"})}finally{l(!1)}},h=async v=>{v.preventDefault(),l(!0);try{const{data:{user:x}}=await Re.auth.getUser();if(!x)throw new Error("User not authenticated");const y={...u,keywords:u.keywords?u.keywords.split(",").map(C=>C.trim()):[],author_id:x.id,published_at:u.status==="published"?new Date().toISOString():null};let b;if(r?{error:b}=await Re.from("website_content").update(y).eq("id",r.id):{error:b}=await Re.from("website_content").insert([y]),b)throw b;c({title:"Success",description:`Content ${r?"updated":"created"} successfully!`}),p(),A()}catch(x){c({title:"Error",description:x.message,variant:"destructive"})}finally{l(!1)}},f=v=>{var x;n(v),d({title:v.title,slug:v.slug,content:v.content,excerpt:v.excerpt||"",content_type:v.content_type,featured_image_url:v.featured_image_url||"",video_url:v.video_url||"",meta_title:v.meta_title||"",meta_description:v.meta_description||"",keywords:((x=v.keywords)==null?void 0:x.join(", "))||"",status:v.status,featured:v.featured}),s(!0)},m=async v=>{if(confirm("Are you sure you want to delete this content?"))try{const{error:x}=await Re.from("website_content").delete().eq("id",v);if(x)throw x;c({title:"Success",description:"Content deleted successfully!"}),A()}catch(x){c({title:"Error",description:x.message,variant:"destructive"})}},p=()=>{d({title:"",slug:"",content:"",excerpt:"",content_type:"blog_post",featured_image_url:"",video_url:"",meta_title:"",meta_description:"",keywords:"",status:"draft",featured:!1}),n(null),s(!1)},g=v=>v.toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").trim();return o&&e.length===0?a.jsx("div",{className:"p-6",children:"Loading..."}):a.jsxs("div",{className:"p-6 max-w-7xl mx-auto",children:[a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Content Manager"}),a.jsx("p",{className:"text-muted-foreground",children:"Manage blog posts, help articles, and user guides"})]}),a.jsxs(ve,{onClick:()=>s(!0),className:"flex items-center gap-2",children:[a.jsx(Xi,{className:"w-4 h-4"}),"Create Content"]})]}),i?a.jsxs(_e,{className:"mb-6",children:[a.jsxs(ot,{children:[a.jsx(lt,{children:r?"Edit Content":"Create New Content"}),a.jsxs(Mr,{children:["Fill in the details below to ",r?"update":"create"," content"]})]}),a.jsx(Ge,{children:a.jsxs("form",{onSubmit:h,className:"space-y-6",children:[a.jsxs(LC,{defaultValue:"basic",className:"w-full",children:[a.jsxs(L0,{children:[a.jsx(vl,{value:"basic",children:"Basic Info"}),a.jsx(vl,{value:"seo",children:"SEO Settings"}),a.jsx(vl,{value:"media",children:"Media"})]}),a.jsxs(xl,{value:"basic",className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"title",children:"Title"}),a.jsx(st,{id:"title",value:u.title,onChange:v=>{d({...u,title:v.target.value}),r||d(x=>({...x,slug:g(v.target.value)}))},placeholder:"Enter title",required:!0})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"slug",children:"Slug"}),a.jsx(st,{id:"slug",value:u.slug,onChange:v=>d({...u,slug:v.target.value}),placeholder:"url-slug",required:!0})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"content_type",children:"Content Type"}),a.jsxs(It,{value:u.content_type,onValueChange:v=>d({...u,content_type:v}),children:[a.jsx(_t,{children:a.jsx(Ot,{})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"blog_post",children:"Blog Post"}),a.jsx(ye,{value:"help_article",children:"Help Article"}),a.jsx(ye,{value:"user_guide",children:"User Guide"}),a.jsx(ye,{value:"demo_video",children:"Demo Video"}),a.jsx(ye,{value:"email_marketing",children:"Email Marketing"}),a.jsx(ye,{value:"ecommerce",children:"E-commerce Content"}),a.jsx(ye,{value:"webpage",children:"Webpage Content"}),a.jsx(ye,{value:"social_media",children:"Social Media"})]})]})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"status",children:"Status"}),a.jsxs(It,{value:u.status,onValueChange:v=>d({...u,status:v}),children:[a.jsx(_t,{children:a.jsx(Ot,{})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"draft",children:"Draft"}),a.jsx(ye,{value:"published",children:"Published"}),a.jsx(ye,{value:"archived",children:"Archived"})]})]})]})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"excerpt",children:"Excerpt"}),a.jsx(Zr,{id:"excerpt",value:u.excerpt,onChange:v=>d({...u,excerpt:v.target.value}),placeholder:"Brief description",rows:2})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"content",children:"Content"}),a.jsx(p6e,{content:u.content,onChange:v=>d({...u,content:v}),placeholder:"Write your content here..."})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(jE,{id:"featured",checked:u.featured,onCheckedChange:v=>d({...u,featured:v})}),a.jsx(Pe,{htmlFor:"featured",children:"Featured Content"})]})]}),a.jsxs(xl,{value:"seo",className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"meta_title",children:"Meta Title"}),a.jsx(st,{id:"meta_title",value:u.meta_title,onChange:v=>d({...u,meta_title:v.target.value}),placeholder:"SEO title (60 chars max)",maxLength:60})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"meta_description",children:"Meta Description"}),a.jsx(Zr,{id:"meta_description",value:u.meta_description,onChange:v=>d({...u,meta_description:v.target.value}),placeholder:"SEO description (160 chars max)",rows:3,maxLength:160})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"keywords",children:"Keywords"}),a.jsx(st,{id:"keywords",value:u.keywords,onChange:v=>d({...u,keywords:v.target.value}),placeholder:"keyword1, keyword2, keyword3"})]})]}),a.jsxs(xl,{value:"media",className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"featured_image_url",children:"Featured Image URL"}),a.jsx(st,{id:"featured_image_url",value:u.featured_image_url,onChange:v=>d({...u,featured_image_url:v.target.value}),placeholder:"https://example.com/image.jpg"})]}),u.content_type==="demo_video"&&a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"video_url",children:"Video URL"}),a.jsx(st,{id:"video_url",value:u.video_url,onChange:v=>d({...u,video_url:v.target.value}),placeholder:"https://youtube.com/watch?v=..."})]})]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(ve,{type:"submit",disabled:o,children:[r?"Update":"Create"," Content"]}),a.jsx(ve,{type:"button",variant:"outline",onClick:p,children:"Cancel"})]})]})})]}):a.jsx("div",{className:"grid gap-4",children:a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(v=>a.jsxs(_e,{children:[a.jsx(ot,{children:a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsxs("div",{children:[a.jsx(lt,{className:"text-lg",children:v.title}),a.jsx(Mr,{children:v.excerpt})]}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx(ve,{size:"sm",variant:"outline",onClick:()=>f(v),children:a.jsx(z5,{className:"w-4 h-4"})}),a.jsx(ve,{size:"sm",variant:"outline",onClick:()=>m(v.id),children:a.jsx(Sl,{className:"w-4 h-4"})})]})]})}),a.jsxs(Ge,{children:[a.jsxs("div",{className:"flex gap-2 mb-2",children:[a.jsx(bt,{variant:"outline",children:v.content_type.replace("_"," ")}),a.jsx(bt,{variant:v.status==="published"?"default":"secondary",children:v.status}),v.featured&&a.jsx(bt,{variant:"default",children:"Featured"})]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Created: ",new Date(v.created_at).toLocaleDateString()]})]})]},v.id))})})]})},M8=w.forwardRef(({className:e,...t},r)=>a.jsx("div",{className:"relative w-full overflow-auto",children:a.jsx("table",{ref:r,className:Le("w-full caption-bottom text-sm",e),...t})}));M8.displayName="Table";const D8=w.forwardRef(({className:e,...t},r)=>a.jsx("thead",{ref:r,className:Le("[&_tr]:border-b",e),...t}));D8.displayName="TableHeader";const R8=w.forwardRef(({className:e,...t},r)=>a.jsx("tbody",{ref:r,className:Le("[&_tr:last-child]:border-0",e),...t}));R8.displayName="TableBody";const g6e=w.forwardRef(({className:e,...t},r)=>a.jsx("tfoot",{ref:r,className:Le("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));g6e.displayName="TableFooter";const Rm=w.forwardRef(({className:e,...t},r)=>a.jsx("tr",{ref:r,className:Le("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Rm.displayName="TableRow";const Ja=w.forwardRef(({className:e,...t},r)=>a.jsx("th",{ref:r,className:Le("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Ja.displayName="TableHead";const sa=w.forwardRef(({className:e,...t},r)=>a.jsx("td",{ref:r,className:Le("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));sa.displayName="TableCell";const v6e=w.forwardRef(({className:e,...t},r)=>a.jsx("caption",{ref:r,className:Le("mt-4 text-sm text-muted-foreground",e),...t}));v6e.displayName="TableCaption";const x6e=()=>{const[e,t]=w.useState([]),[r,n]=w.useState(""),[i,s]=w.useState(!1),[o,l]=w.useState(null),{toast:c}=Dr(),[u,d]=w.useState({page_slug:"",page_title:"",meta_description:"",meta_keywords:"",og_title:"",og_description:"",og_image:"",twitter_card:"summary_large_image",canonical_url:"",schema_type:"WebPage"});w.useEffect(()=>{A()},[]);const A=async()=>{const{data:v,error:x}=await Re.from("seo_settings").select("*").order("page_slug");if(x){c({title:"Error",description:"Failed to load SEO settings",variant:"destructive"});return}t(v||[])},h=async v=>{v.preventDefault();const x={...u,meta_keywords:u.meta_keywords.split(",").map(y=>y.trim())};if(o){const{error:y}=await Re.from("seo_settings").update(x).eq("id",o.id);if(y){c({title:"Error",description:"Failed to update SEO settings",variant:"destructive"});return}c({title:"Success",description:"SEO settings updated successfully"})}else{const{error:y}=await Re.from("seo_settings").insert([x]);if(y){c({title:"Error",description:"Failed to create SEO settings",variant:"destructive"});return}c({title:"Success",description:"SEO settings created successfully"})}s(!1),p(),A()},f=v=>{var x;l(v),d({page_slug:v.page_slug,page_title:v.page_title,meta_description:v.meta_description,meta_keywords:((x=v.meta_keywords)==null?void 0:x.join(", "))||"",og_title:v.og_title||"",og_description:v.og_description||"",og_image:v.og_image||"",twitter_card:v.twitter_card||"summary_large_image",canonical_url:v.canonical_url||"",schema_type:v.schema_type||"WebPage"}),s(!0)},m=async v=>{if(!confirm("Are you sure you want to delete this SEO setting?"))return;const{error:x}=await Re.from("seo_settings").delete().eq("id",v);if(x){c({title:"Error",description:"Failed to delete SEO settings",variant:"destructive"});return}c({title:"Success",description:"SEO settings deleted successfully"}),A()},p=()=>{l(null),d({page_slug:"",page_title:"",meta_description:"",meta_keywords:"",og_title:"",og_description:"",og_image:"",twitter_card:"summary_large_image",canonical_url:"",schema_type:"WebPage"})},g=e.filter(v=>v.page_slug.toLowerCase().includes(r.toLowerCase())||v.page_title.toLowerCase().includes(r.toLowerCase()));return a.jsx("div",{className:"space-y-6",children:a.jsxs(_e,{children:[a.jsxs(ot,{children:[a.jsx(lt,{children:"SEO Settings Management"}),a.jsx(Mr,{children:"Manage meta tags, Open Graph data, and Schema.org markup for all pages"})]}),a.jsxs(Ge,{children:[a.jsxs("div",{className:"flex gap-4 mb-6",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(oc,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),a.jsx(st,{placeholder:"Search by page slug or title...",value:r,onChange:v=>n(v.target.value),className:"pl-10"})]}),a.jsxs(Mi,{open:i,onOpenChange:s,children:[a.jsx(EU,{asChild:!0,children:a.jsxs(ve,{onClick:p,children:[a.jsx(Xi,{className:"mr-2 h-4 w-4"}),"Add New Page"]})}),a.jsxs(yi,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[a.jsxs(bi,{children:[a.jsxs(wi,{children:[o?"Edit":"Add"," SEO Settings"]}),a.jsx(Qo,{children:"Configure SEO meta tags and structured data for the page"})]}),a.jsxs("form",{onSubmit:h,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"page_slug",children:"Page Slug *"}),a.jsx(st,{id:"page_slug",value:u.page_slug,onChange:v=>d({...u,page_slug:v.target.value}),placeholder:"/about",required:!0,disabled:!!o})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"page_title",children:"Page Title *"}),a.jsx(st,{id:"page_title",value:u.page_title,onChange:v=>d({...u,page_title:v.target.value}),placeholder:"About Us | Wordsmith AI",required:!0,maxLength:60}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[u.page_title.length,"/60 characters"]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"meta_description",children:"Meta Description *"}),a.jsx(Zr,{id:"meta_description",value:u.meta_description,onChange:v=>d({...u,meta_description:v.target.value}),placeholder:"Brief description of the page",required:!0,maxLength:160,rows:3}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[u.meta_description.length,"/160 characters"]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"meta_keywords",children:"Meta Keywords"}),a.jsx(st,{id:"meta_keywords",value:u.meta_keywords,onChange:v=>d({...u,meta_keywords:v.target.value}),placeholder:"keyword1, keyword2, keyword3"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Comma-separated keywords"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"canonical_url",children:"Canonical URL"}),a.jsx(st,{id:"canonical_url",value:u.canonical_url,onChange:v=>d({...u,canonical_url:v.target.value}),placeholder:"https://yourdomain.com/page"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"schema_type",children:"Schema Type"}),a.jsxs(It,{value:u.schema_type,onValueChange:v=>d({...u,schema_type:v}),children:[a.jsx(_t,{children:a.jsx(Ot,{})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"WebPage",children:"WebPage"}),a.jsx(ye,{value:"Organization",children:"Organization"}),a.jsx(ye,{value:"Article",children:"Article"}),a.jsx(ye,{value:"Blog",children:"Blog"}),a.jsx(ye,{value:"AboutPage",children:"AboutPage"}),a.jsx(ye,{value:"ContactPage",children:"ContactPage"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"og_title",children:"Open Graph Title"}),a.jsx(st,{id:"og_title",value:u.og_title,onChange:v=>d({...u,og_title:v.target.value}),placeholder:"Leave empty to use page title"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"og_description",children:"Open Graph Description"}),a.jsx(Zr,{id:"og_description",value:u.og_description,onChange:v=>d({...u,og_description:v.target.value}),placeholder:"Leave empty to use meta description",rows:2})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"og_image",children:"Open Graph Image URL"}),a.jsx(st,{id:"og_image",value:u.og_image,onChange:v=>d({...u,og_image:v.target.value}),placeholder:"https://yourdomain.com/og-image.jpg"})]}),a.jsxs("div",{className:"flex gap-2 justify-end",children:[a.jsx(ve,{type:"button",variant:"outline",onClick:()=>{s(!1),p()},children:"Cancel"}),a.jsxs(ve,{type:"submit",children:[a.jsx(Mh,{className:"mr-2 h-4 w-4"}),"Save"]})]})]})]})]})]}),a.jsx("div",{className:"border rounded-lg",children:a.jsxs(M8,{children:[a.jsx(D8,{children:a.jsxs(Rm,{children:[a.jsx(Ja,{children:"Page Slug"}),a.jsx(Ja,{children:"Title"}),a.jsx(Ja,{children:"Schema Type"}),a.jsx(Ja,{className:"text-right",children:"Actions"})]})}),a.jsx(R8,{children:g.length===0?a.jsx(Rm,{children:a.jsx(sa,{colSpan:4,className:"text-center text-muted-foreground",children:"No SEO settings found"})}):g.map(v=>a.jsxs(Rm,{children:[a.jsx(sa,{className:"font-mono text-sm",children:v.page_slug}),a.jsx(sa,{children:v.page_title}),a.jsx(sa,{children:v.schema_type}),a.jsx(sa,{className:"text-right",children:a.jsxs("div",{className:"flex gap-2 justify-end",children:[a.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>f(v),children:a.jsx(b0,{className:"h-4 w-4"})}),a.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>m(v.id),children:a.jsx(Sl,{className:"h-4 w-4"})})]})})]},v.id))})]})})]})]})})},y6e=()=>{const[e,t]=w.useState([]),[r,n]=w.useState(!0),[i,s]=w.useState(null),{toast:o}=Dr();w.useEffect(()=>{l()},[]);const l=async()=>{try{const{data:d,error:A}=await Re.from("contact_submissions").select("*").order("created_at",{ascending:!1});if(A)throw A;t(d||[])}catch{o({title:"Error",description:"Failed to load contact submissions",variant:"destructive"})}finally{n(!1)}},c=async d=>{try{const{error:A}=await Re.from("contact_submissions").delete().eq("id",d);if(A)throw A;t(e.filter(h=>h.id!==d)),o({title:"Success",description:"Submission deleted successfully"})}catch{o({title:"Error",description:"Failed to delete submission",variant:"destructive"})}s(null)},u=d=>new Date(d).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});return r?a.jsx(El,{message:"Loading submissions..."}):e.length===0?a.jsxs(_e,{className:"p-8 text-center",children:[a.jsx(jl,{className:"w-12 h-12 text-muted-foreground mx-auto mb-4"}),a.jsx("p",{className:"text-foreground/75",children:"No contact submissions yet"})]}):a.jsxs("div",{className:"space-y-4",children:[e.map(d=>a.jsx(_e,{className:"p-6",children:a.jsxs("div",{className:"flex justify-between items-start gap-4",children:[a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h3",{className:"text-lg font-semibold",children:d.name}),a.jsx("span",{className:"text-sm text-foreground/70",children:d.email})]}),d.subject&&a.jsxs("p",{className:"text-sm font-medium text-foreground/80",children:["Subject: ",d.subject]}),a.jsx("p",{className:"text-foreground/75 whitespace-pre-wrap",children:d.message}),a.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground/60 pt-2",children:[a.jsx(Da,{className:"w-4 h-4"}),u(d.created_at)]})]}),a.jsx(ve,{variant:"destructive",size:"icon",onClick:()=>s(d.id),children:a.jsx(Sl,{className:"w-4 h-4"})})]})},d.id)),a.jsx(QA,{open:!!i,onOpenChange:()=>s(null),children:a.jsxs(fd,{children:[a.jsxs(hd,{children:[a.jsx(md,{children:"Delete Submission"}),a.jsx(gd,{children:"Are you sure you want to delete this contact submission? This action cannot be undone."})]}),a.jsxs(pd,{children:[a.jsx(xd,{children:"Cancel"}),a.jsx(vd,{onClick:()=>i&&c(i),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},b6e=()=>{const[e,t]=w.useState([]),[r,n]=w.useState(!0),[i,s]=w.useState(null),[o,l]=w.useState("all"),[c,u]=w.useState("all"),{toast:d}=Dr();w.useEffect(()=>{A()},[]);const A=async()=>{try{const{data:b,error:C}=await Re.from("user_feedback").select("*").order("created_at",{ascending:!1});if(C)throw C;t(b||[])}catch(b){console.error("Error fetching feedback:",b),d({title:"Error",description:"Failed to load feedback",variant:"destructive"})}finally{n(!1)}},h=async b=>{try{const{error:C}=await Re.from("user_feedback").delete().eq("id",b);if(C)throw C;t(e.filter(j=>j.id!==b)),d({title:"Success",description:"Feedback deleted successfully"})}catch(C){console.error("Error deleting feedback:",C),d({title:"Error",description:"Failed to delete feedback",variant:"destructive"})}s(null)},f=async(b,C)=>{try{const{error:j}=await Re.from("user_feedback").update({status:C,reviewed_at:C!=="pending"?new Date().toISOString():null}).eq("id",b);if(j)throw j;t(e.map(S=>S.id===b?{...S,status:C,reviewed_at:C!=="pending"?new Date().toISOString():null}:S)),d({title:"Status updated",description:`Feedback marked as ${C}`})}catch(j){console.error("Error updating status:",j),d({title:"Error",description:"Failed to update status",variant:"destructive"})}},m=b=>new Date(b).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),p=b=>{switch(b){case"bug":return"destructive";case"feature":return"default";case"improvement":return"secondary";case"praise":return"outline";default:return"secondary"}},g=b=>{switch(b){case"reviewed":return a.jsx(Xp,{className:"h-4 w-4 text-green-500"});case"archived":return a.jsx(B$,{className:"h-4 w-4 text-muted-foreground"});default:return a.jsx(tu,{className:"h-4 w-4 text-yellow-500"})}},v=b=>b?a.jsx("div",{className:"flex gap-0.5",children:[1,2,3,4,5].map(C=>a.jsx(eg,{className:`h-4 w-4 ${C<=b?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},C))}):a.jsx("span",{className:"text-muted-foreground text-sm",children:"No rating"}),x=e.filter(b=>{const C=o==="all"||b.status===o,j=c==="all"||b.feedback_type===c;return C&&j}),y={total:e.length,pending:e.filter(b=>b.status==="pending").length,reviewed:e.filter(b=>b.status==="reviewed").length,archived:e.filter(b=>b.status==="archived").length};return r?a.jsx(El,{message:"Loading feedback..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold",children:"User Feedback"}),a.jsxs("p",{className:"text-muted-foreground",children:[y.total," total • ",y.pending," pending"]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(It,{value:o,onValueChange:l,children:[a.jsxs(_t,{className:"w-[140px]",children:[a.jsx(rre,{className:"h-4 w-4 mr-2"}),a.jsx(Ot,{placeholder:"Status"})]}),a.jsxs(kt,{children:[a.jsx(ye,{value:"all",children:"All Status"}),a.jsx(ye,{value:"pending",children:"Pending"}),a.jsx(ye,{value:"reviewed",children:"Reviewed"}),a.jsx(ye,{value:"archived",children:"Archived"})]})]}),a.jsxs(It,{value:c,onValueChange:u,children:[a.jsx(_t,{className:"w-[160px]",children:a.jsx(Ot,{placeholder:"Type"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"all",children:"All Types"}),a.jsx(ye,{value:"general",children:"General"}),a.jsx(ye,{value:"bug",children:"Bug Report"}),a.jsx(ye,{value:"feature",children:"Feature Request"}),a.jsx(ye,{value:"improvement",children:"Improvement"}),a.jsx(ye,{value:"praise",children:"Praise"})]})]})]})]}),x.length===0?a.jsxs(_e,{className:"p-8 text-center",children:[a.jsx(yC,{className:"w-12 h-12 text-muted-foreground mx-auto mb-4"}),a.jsx("p",{className:"text-foreground/75",children:e.length===0?"No feedback received yet":"No feedback matches the current filters"})]}):a.jsx("div",{className:"space-y-4",children:x.map(b=>a.jsx(_e,{className:"p-6",children:a.jsxs("div",{className:"flex flex-col lg:flex-row justify-between gap-4",children:[a.jsxs("div",{className:"flex-1 space-y-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(bt,{variant:p(b.feedback_type),children:b.feedback_type}),a.jsxs("div",{className:"flex items-center gap-1",children:[g(b.status),a.jsx("span",{className:"text-sm capitalize text-muted-foreground",children:b.status})]}),v(b.rating)]}),b.subject&&a.jsx("h3",{className:"text-lg font-semibold",children:b.subject}),a.jsx("p",{className:"text-foreground/80 whitespace-pre-wrap",children:b.message}),a.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm text-muted-foreground pt-2 border-t",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(tg,{className:"h-4 w-4"}),a.jsx("span",{children:b.user_name||"Anonymous"})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(jl,{className:"h-4 w-4"}),a.jsx("span",{children:b.user_email})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Da,{className:"h-4 w-4"}),a.jsx("span",{children:m(b.created_at)})]})]})]}),a.jsxs("div",{className:"flex lg:flex-col gap-2",children:[a.jsxs(fE,{children:[a.jsx(hE,{asChild:!0,children:a.jsxs(ve,{variant:"outline",size:"sm",children:[g(b.status),a.jsx("span",{className:"ml-2 capitalize",children:b.status})]})}),a.jsxs(EC,{align:"end",children:[a.jsxs(xA,{onClick:()=>f(b.id,"pending"),children:[a.jsx(tu,{className:"h-4 w-4 mr-2 text-yellow-500"}),"Mark as Pending"]}),a.jsxs(xA,{onClick:()=>f(b.id,"reviewed"),children:[a.jsx(Xp,{className:"h-4 w-4 mr-2 text-green-500"}),"Mark as Reviewed"]}),a.jsxs(xA,{onClick:()=>f(b.id,"archived"),children:[a.jsx(B$,{className:"h-4 w-4 mr-2"}),"Archive"]})]})]}),a.jsx(ve,{variant:"destructive",size:"sm",onClick:()=>s(b.id),children:a.jsx(Sl,{className:"h-4 w-4"})})]})]})},b.id))}),a.jsx(QA,{open:!!i,onOpenChange:()=>s(null),children:a.jsxs(fd,{children:[a.jsxs(hd,{children:[a.jsx(md,{children:"Delete Feedback"}),a.jsx(gd,{children:"Are you sure you want to delete this feedback? This action cannot be undone."})]}),a.jsxs(pd,{children:[a.jsx(xd,{children:"Cancel"}),a.jsx(vd,{onClick:()=>i&&h(i),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},w6e=({isSuperAdmin:e=!1})=>{var B;const{toast:t}=Dr(),[r,n]=w.useState([]),[i,s]=w.useState(!0),[o,l]=w.useState(""),[c,u]=w.useState(null),[d,A]=w.useState(!1),[h,f]=w.useState(!1),[m,p]=w.useState(""),[g,v]=w.useState(""),[x,y]=w.useState(!1),b=async()=>{try{const{data:I,error:P}=await Re.from("profiles").select("*").order("created_at",{ascending:!1});if(P)throw P;const{data:E,error:M}=await Re.from("user_subscriptions").select("user_id, tier");if(M)throw M;const _=new Date().toISOString().slice(0,7),{data:R}=await Re.from("user_usage").select("user_id, generations_used").eq("month_year",_),G=new Map((E==null?void 0:E.map(Y=>[Y.user_id,Y.tier]))||[]),U=new Map((R==null?void 0:R.map(Y=>[Y.user_id,Y.generations_used]))||[]),Q={free:10,lite:50,pro:150,elite:300,admin:999999},z=(I||[]).map(Y=>{const $=G.get(Y.user_id)||"free";return{...Y,tier:$,generations_used:U.get(Y.user_id)||0,generation_limit:Q[$]}});n(z)}catch{t({title:"Error",description:"Failed to load users",variant:"destructive"})}finally{s(!1)}},C=async()=>{if(!(!c||!m)){y(!0);try{const{data:I}=await Re.from("user_subscriptions").select("id").eq("user_id",c.user_id).maybeSingle();if(I){const{error:P}=await Re.from("user_subscriptions").update({tier:m,status:"active",updated_at:new Date().toISOString()}).eq("user_id",c.user_id);if(P)throw P}else{const{error:P}=await Re.from("user_subscriptions").insert([{user_id:c.user_id,tier:m,status:"active"}]);if(P)throw P}t({title:"Success",description:`User upgraded to ${m.toUpperCase()} tier`}),A(!1),u(null),p(""),b()}catch(I){t({title:"Error",description:I.message||"Failed to upgrade user",variant:"destructive"})}finally{y(!1)}}},j=async()=>{if(!c||!g)return;const I=parseInt(g);if(isNaN(I)||I<=0){t({title:"Error",description:"Please enter a valid number of credits",variant:"destructive"});return}y(!0);try{const P=new Date().toISOString().slice(0,7),{data:E}=await Re.from("user_usage").select("*").eq("user_id",c.user_id).eq("month_year",P).single();if(E){const M=E.generations_used-I,{error:_}=await Re.from("user_usage").update({generations_used:M}).eq("user_id",c.user_id).eq("month_year",P);if(_)throw _}else{const{error:M}=await Re.from("user_usage").insert([{user_id:c.user_id,month_year:P,generations_used:-I,words_generated:0}]);if(M)throw M}t({title:"Success",description:`Added ${I} generation credits to user`}),f(!1),u(null),v(""),b()}catch(P){t({title:"Error",description:P.message||"Failed to add credits",variant:"destructive"})}finally{y(!1)}},S=()=>{if(!e){t({title:"Access Denied",description:"Only super admins can export user data",variant:"destructive"});return}const I=[["Email","First Name","Last Name","Plan","Country","Profession","Joined Date"].join(","),...r.map(_=>{var R;return[_.email||"",_.first_name||"",_.second_name||"",((R=_.tier)==null?void 0:R.toUpperCase())||"FREE",_.country||"",_.profession||"",new Date(_.created_at).toLocaleDateString()].map(G=>`"${G}"`).join(",")})].join(` `),P=new Blob([I],{type:"text/csv;charset=utf-8;"}),E=document.createElement("a"),M=URL.createObjectURL(P);E.setAttribute("href",M),E.setAttribute("download",`user_emails_${new Date().toISOString().split("T")[0]}.csv`),E.style.visibility="hidden",document.body.appendChild(E),E.click(),document.body.removeChild(E),t({title:"Export Complete",description:`Exported ${r.length} user records to CSV`})};w.useEffect(()=>{b()},[]);const T=r.filter(I=>{var E,M,_,R;const P=o.toLowerCase();return((E=I.email)==null?void 0:E.toLowerCase().includes(P))||((M=I.first_name)==null?void 0:M.toLowerCase().includes(P))||((_=I.second_name)==null?void 0:_.toLowerCase().includes(P))||((R=I.username)==null?void 0:R.toLowerCase().includes(P))||I.user_id.toLowerCase().includes(P)});return i?a.jsx(El,{message:"Loading users..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold",children:"User Management"}),a.jsx("p",{className:"text-muted-foreground",children:"View and manage user profiles and information"})]}),e&&a.jsxs(ve,{onClick:S,variant:"outline",className:"gap-2",children:[a.jsx(Jte,{className:"h-4 w-4"}),"Export Emails"]})]}),a.jsxs(_e,{className:"p-4",children:[a.jsxs("div",{className:"relative mb-4",children:[a.jsx(oc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),a.jsx(st,{placeholder:"Search by email, name, username, or UID...",value:o,onChange:I=>l(I.target.value),className:"pl-10"})]}),a.jsx("div",{className:"rounded-md border",children:a.jsxs(M8,{children:[a.jsx(D8,{children:a.jsxs(Rm,{children:[a.jsx(Ja,{children:"UID"}),a.jsx(Ja,{children:"Name"}),a.jsx(Ja,{children:"Email"}),a.jsx(Ja,{children:"Plan"}),a.jsx(Ja,{children:"Usage"}),a.jsx(Ja,{children:"Username"}),a.jsx(Ja,{children:"Country"}),a.jsx(Ja,{children:"Profession"}),a.jsx(Ja,{children:"Joined"}),a.jsx(Ja,{className:"text-right",children:"Actions"})]})}),a.jsx(R8,{children:T.length===0?a.jsx(Rm,{children:a.jsx(sa,{colSpan:10,className:"text-center py-8 text-muted-foreground",children:"No users found"})}):T.map(I=>{var P;return a.jsxs(Rm,{children:[a.jsx(sa,{className:"font-mono text-xs max-w-[120px] truncate",title:I.user_id,children:I.user_id}),a.jsx(sa,{children:I.first_name||I.second_name?`${I.first_name||""} ${I.second_name||""}`.trim():"-"}),a.jsx(sa,{children:I.email||"-"}),a.jsx(sa,{children:a.jsx(bt,{variant:I.tier==="elite"||I.tier==="pro"?"default":I.tier==="lite"?"secondary":"outline",children:((P=I.tier)==null?void 0:P.toUpperCase())||"FREE"})}),a.jsxs(sa,{children:[a.jsxs("span",{className:"text-sm",children:[Math.max(0,I.generations_used),"/",I.generation_limit+Math.max(0,-I.generations_used)]}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:[I.generation_limit-I.generations_used," remaining"]})]}),a.jsx(sa,{children:I.username||"-"}),a.jsx(sa,{children:I.country||"-"}),a.jsx(sa,{children:I.profession||"-"}),a.jsx(sa,{children:new Date(I.created_at).toLocaleDateString()}),a.jsx(sa,{className:"text-right",children:a.jsxs("div",{className:"flex gap-2 justify-end",children:[a.jsxs(ve,{size:"sm",variant:"outline",onClick:()=>{u(I),p(I.tier||"free"),A(!0)},children:[a.jsx(gy,{className:"h-4 w-4 mr-1"}),"Upgrade"]}),a.jsxs(ve,{size:"sm",variant:"outline",onClick:()=>{u(I),f(!0)},children:[a.jsx(Xi,{className:"h-4 w-4 mr-1"}),"Credits"]})]})})]},I.id)})})]})}),a.jsxs("div",{className:"mt-4 text-sm text-muted-foreground",children:["Showing ",T.length," of ",r.length," users"]})]}),a.jsx(Mi,{open:d,onOpenChange:A,children:a.jsxs(yi,{children:[a.jsxs(bi,{children:[a.jsx(wi,{children:"Upgrade User Tier"}),a.jsxs(Qo,{children:["Change the subscription tier for ",c==null?void 0:c.email,". This is a one-time manual upgrade."]})]}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Current Tier"}),a.jsx("div",{className:"text-sm font-medium",children:((B=c==null?void 0:c.tier)==null?void 0:B.toUpperCase())||"FREE"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"tier",children:"New Tier"}),a.jsxs(It,{value:m,onValueChange:p,children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select tier"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"free",children:"FREE (10 generations/month)"}),a.jsx(ye,{value:"lite",children:"LITE (50 generations/month)"}),a.jsx(ye,{value:"pro",children:"PRO (150 generations/month)"}),a.jsx(ye,{value:"elite",children:"ELITE (300 generations/month)"}),a.jsx(ye,{value:"business",children:"BUSINESS (Unlimited generations + Team Management)"})]})]})]})]}),a.jsxs(nd,{children:[a.jsx(ve,{variant:"outline",onClick:()=>{A(!1),u(null),p("")},disabled:x,children:"Cancel"}),a.jsx(ve,{onClick:C,disabled:x||!m,children:x?"Updating...":"Upgrade Tier"})]})]})}),a.jsx(Mi,{open:h,onOpenChange:f,children:a.jsxs(yi,{children:[a.jsxs(bi,{children:[a.jsx(wi,{children:"Add Generation Credits"}),a.jsxs(Qo,{children:["Add extra generation credits for ",c==null?void 0:c.email," this month."]})]}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Current Usage"}),a.jsxs("div",{className:"text-sm font-medium",children:[Math.max(0,(c==null?void 0:c.generations_used)||0)," / ",((c==null?void 0:c.generation_limit)||0)+Math.max(0,-((c==null?void 0:c.generations_used)||0))," generations used"]}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:[((c==null?void 0:c.generation_limit)||0)-((c==null?void 0:c.generations_used)||0)," remaining"]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"credits",children:"Credits to Add"}),a.jsx(st,{id:"credits",type:"number",min:"1",placeholder:"Enter number of credits",value:g,onChange:I=>v(I.target.value)}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["This will allow the user to generate ",g||0," more times this month"]})]})]}),a.jsxs(nd,{children:[a.jsx(ve,{variant:"outline",onClick:()=>{f(!1),u(null),v("")},disabled:x,children:"Cancel"}),a.jsx(ve,{onClick:j,disabled:x||!g,children:x?"Adding...":"Add Credits"})]})]})})]})},C6e=()=>{const[e,t]=w.useState(null),[r,n]=w.useState(!0),[i,s]=w.useState(!1),[o,l]=w.useState(!1),[c,u]=w.useState({first_name:"",second_name:"",username:"",email:""}),{toast:d}=Dr(),{usageData:A}=Ua();w.useEffect(()=>{h()},[]);const h=async()=>{try{const{data:{user:p}}=await Re.auth.getUser();if(!p)return;const{data:g,error:v}=await Re.from("profiles").select("*").eq("user_id",p.id).single();if(v&&v.code!=="PGRST116"){console.error("Error loading profile:",v),d({title:"Error loading profile",description:v.message,variant:"destructive"});return}if(g)t(g),u({first_name:g.first_name||"",second_name:g.second_name||"",username:g.username||"",email:g.email||p.email||""});else{const x={user_id:p.id,email:p.email,first_name:null,second_name:null,username:null},{data:y,error:b}=await Re.from("profiles").insert(x).select().single();b?console.error("Error creating profile:",b):(t(y),u({first_name:"",second_name:"",username:"",email:p.email||""}))}}catch(p){console.error("Error in loadProfile:",p)}finally{n(!1)}},f=async()=>{if(e){s(!0);try{const{error:p}=await Re.from("profiles").update({first_name:c.first_name||null,second_name:c.second_name||null,username:c.username||null,email:c.email||null}).eq("user_id",e.user_id);if(p){p.code==="23505"?d({title:"Username already taken",description:"Please choose a different username.",variant:"destructive"}):d({title:"Error saving profile",description:p.message,variant:"destructive"});return}d({title:"Profile updated",description:"Your profile has been saved successfully."}),h()}catch(p){console.error("Error saving profile:",p),d({title:"Something went wrong",description:"Please try again later.",variant:"destructive"})}finally{s(!1)}}},m=async()=>{if(e){l(!0);try{const{data:{session:p}}=await Re.auth.getSession();if(!p){d({title:"Authentication required",description:"Please sign in to cancel your subscription.",variant:"destructive"});return}const{data:g,error:v}=await Re.functions.invoke("cancel-lemonsqueezy-subscription",{headers:{Authorization:`Bearer ${p.access_token}`}});if(v)throw v;d({title:"Subscription cancellation scheduled",description:"Your subscription will remain active until the end of your current billing period, then you'll be moved to the free plan."}),setTimeout(()=>window.location.reload(),2e3)}catch(p){console.error("Error cancelling subscription:",p),d({title:"Error cancelling subscription",description:"Please try again or contact support for assistance.",variant:"destructive"})}finally{l(!1)}}};return r?a.jsx("div",{className:"container mx-auto p-6 max-w-5xl",children:a.jsx(El,{message:"Loading profile..."})}):a.jsxs("div",{className:"container mx-auto p-6 max-w-5xl pb-32",children:[a.jsx("div",{className:"mb-8",children:a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsx("div",{className:"p-3 bg-primary rounded-xl",children:a.jsx(tg,{className:"h-8 w-8 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-4xl font-bold text-primary",children:"Profile"}),a.jsx("p",{className:"text-muted-foreground",children:"Manage your account preferences"})]})]})}),a.jsx(F0,{}),a.jsx("div",{className:"space-y-6",children:a.jsxs(_e,{className:"border-2 shadow-lg",children:[a.jsxs(ot,{children:[a.jsxs(lt,{className:"flex items-center gap-2",children:[a.jsx(tg,{className:"w-5 h-5"}),"Account Preferences"]}),a.jsx(Mr,{children:"Update your personal information and account settings"})]}),a.jsxs(Ge,{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"first_name",children:"First Name"}),a.jsx(st,{id:"first_name",value:c.first_name,onChange:p=>u({...c,first_name:p.target.value}),placeholder:"Enter your first name"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"second_name",children:"Second Name"}),a.jsx(st,{id:"second_name",value:c.second_name,onChange:p=>u({...c,second_name:p.target.value}),placeholder:"Enter your second name"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"username",children:"Username"}),a.jsx(st,{id:"username",value:c.username,onChange:p=>u({...c,username:p.target.value}),placeholder:"Choose a unique username"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"email",children:"Email"}),a.jsx(st,{id:"email",type:"email",value:c.email,onChange:p=>u({...c,email:p.target.value}),placeholder:"Enter your email"})]}),a.jsxs(ve,{onClick:f,disabled:i,variant:"hero",children:[a.jsx(Mh,{className:"w-4 h-4 mr-2"}),i?"Saving...":"Save Changes"]}),a.jsx(_y,{}),A&&A.tier!=="free"&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-lg font-medium",children:"Subscription Management"}),a.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg",children:[a.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:["Current Plan: ",a.jsx("span",{className:"font-semibold text-foreground capitalize",children:A.tier})]}),a.jsxs(QA,{children:[a.jsx(zPe,{asChild:!0,children:a.jsxs(ve,{variant:"outline",disabled:o,children:[a.jsx(y6,{className:"w-4 h-4 mr-2"}),o?"Cancelling...":"Cancel Subscription"]})}),a.jsxs(fd,{children:[a.jsxs(hd,{children:[a.jsx(md,{children:"Cancel Subscription"}),a.jsx(gd,{children:"Are you sure you want to cancel your subscription? Your subscription will remain active until the end of your current billing period, after which you'll be moved to the free plan."})]}),a.jsxs(pd,{children:[a.jsx(xd,{children:"Keep Subscription"}),a.jsx(vd,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Subscription"})]})]})]})]})]})]})]})})]})};function Ar(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Ho(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function to(e,t){const r=Ar(e);return isNaN(t)?Ho(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function gc(e,t){const r=Ar(e);if(isNaN(t))return Ho(e,NaN);if(!t)return r;const n=r.getDate(),i=Ho(e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const s=i.getDate();return n>=s?i:(r.setFullYear(i.getFullYear(),i.getMonth(),n),r)}const U8=6048e5,N6e=864e5,jj=43200,VW=1440;let j6e={};function R0(){return j6e}function od(e,t){var l,c,u,d;const r=R0(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,i=Ar(e),s=i.getDay(),o=(s=i.getTime()?r+1:t.getTime()>=o.getTime()?r:r-1}function Ly(e){const t=Ar(e);return t.setHours(0,0,0,0),t}function My(e){const t=Ar(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Qu(e,t){const r=Ly(e),n=Ly(t),i=+r-My(r),s=+n-My(n);return Math.round((i-s)/N6e)}function S6e(e){const t=Fde(e),r=Ho(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),hg(r)}function zL(e,t){const r=t*7;return to(e,r)}function B6e(e,t){return gc(e,t*12)}function _6e(e){let t;return e.forEach(function(r){const n=Ar(r);(t===void 0||t{const n=Ar(r);(!t||t>n||isNaN(+n))&&(t=n)}),t||new Date(NaN)}function YS(e,t){const r=Ar(e),n=Ar(t),i=r.getTime()-n.getTime();return i<0?-1:i>0?1:i}function E6e(e){return Ho(e,Date.now())}function Po(e,t){const r=Ly(e),n=Ly(t);return+r==+n}function Q8(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function T6e(e){if(!Q8(e)&&typeof e!="number")return!1;const t=Ar(e);return!isNaN(Number(t))}function Dy(e,t){const r=Ar(e),n=Ar(t),i=r.getFullYear()-n.getFullYear(),s=r.getMonth()-n.getMonth();return i*12+s}function P6e(e,t,r){const n=od(e,r),i=od(t,r),s=+n-My(n),o=+i-My(i);return Math.round((s-o)/U8)}function I6e(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function O6e(e,t){return+Ar(e)-+Ar(t)}function F6e(e){const t=Ar(e);return t.setHours(23,59,59,999),t}function KE(e){const t=Ar(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function L6e(e){const t=Ar(e);return+F6e(t)==+KE(t)}function M6e(e,t){const r=Ar(e),n=Ar(t),i=YS(r,n),s=Math.abs(Dy(r,n));let o;if(s<1)o=0;else{r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*s);let l=YS(r,n)===-i;L6e(Ar(e))&&s===1&&YS(e,n)===1&&(l=!1),o=i*(s-Number(l))}return o===0?0:o}function D6e(e,t,r){const n=O6e(e,t)/1e3;return I6e(r==null?void 0:r.roundingMethod)(n)}function co(e){const t=Ar(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Lde(e){const t=Ar(e),r=Ho(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function H8(e,t){var l,c,u,d;const r=R0(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,i=Ar(e),s=i.getDay(),o=(s{let n;const i=R6e[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function bI(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Q6e={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},H6e={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},$6e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},z6e={date:bI({formats:Q6e,defaultWidth:"full"}),time:bI({formats:H6e,defaultWidth:"full"}),dateTime:bI({formats:$6e,defaultWidth:"full"})},W6e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},G6e=(e,t,r,n)=>W6e[e];function Rb(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):o;i=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[l]||e.values[o]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const K6e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},V6e={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},q6e={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},X6e={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Y6e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},J6e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Z6e=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},eUe={ordinalNumber:Z6e,era:Rb({values:K6e,defaultWidth:"wide"}),quarter:Rb({values:V6e,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Rb({values:q6e,defaultWidth:"wide"}),day:Rb({values:X6e,defaultWidth:"wide"}),dayPeriod:Rb({values:Y6e,defaultWidth:"wide",formattingValues:J6e,defaultFormattingWidth:"wide"})};function Ub(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?rUe(l,A=>A.test(o)):tUe(l,A=>A.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=r.valueCallback?r.valueCallback(u):u;const d=t.slice(o.length);return{value:u,rest:d}}}function tUe(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function rUe(e,t){for(let r=0;r{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],s=t.match(e.parsePattern);if(!s)return null;let o=e.valueCallback?e.valueCallback(s[0]):s[0];o=r.valueCallback?r.valueCallback(o):o;const l=t.slice(i.length);return{value:o,rest:l}}}const iUe=/^(\d+)(th|st|nd|rd)?/i,sUe=/\d+/i,aUe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},oUe={any:[/^b/i,/^(a|c)/i]},lUe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},cUe={any:[/1/i,/2/i,/3/i,/4/i]},uUe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},dUe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},AUe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},fUe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},hUe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},pUe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},mUe={ordinalNumber:nUe({matchPattern:iUe,parsePattern:sUe,valueCallback:e=>parseInt(e,10)}),era:Ub({matchPatterns:aUe,defaultMatchWidth:"wide",parsePatterns:oUe,defaultParseWidth:"any"}),quarter:Ub({matchPatterns:lUe,defaultMatchWidth:"wide",parsePatterns:cUe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ub({matchPatterns:uUe,defaultMatchWidth:"wide",parsePatterns:dUe,defaultParseWidth:"any"}),day:Ub({matchPatterns:AUe,defaultMatchWidth:"wide",parsePatterns:fUe,defaultParseWidth:"any"}),dayPeriod:Ub({matchPatterns:hUe,defaultMatchWidth:"any",parsePatterns:pUe,defaultParseWidth:"any"})},$8={code:"en-US",formatDistance:U6e,formatLong:z6e,formatRelative:G6e,localize:eUe,match:mUe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function gUe(e){const t=Ar(e);return Qu(t,Lde(t))+1}function Dde(e){const t=Ar(e),r=+hg(t)-+S6e(t);return Math.round(r/U8)+1}function Rde(e,t){var d,A,h,f;const r=Ar(e),n=r.getFullYear(),i=R0(),s=(t==null?void 0:t.firstWeekContainsDate)??((A=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:A.firstWeekContainsDate)??i.firstWeekContainsDate??((f=(h=i.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,o=Ho(e,0);o.setFullYear(n+1,0,s),o.setHours(0,0,0,0);const l=od(o,t),c=Ho(e,0);c.setFullYear(n,0,s),c.setHours(0,0,0,0);const u=od(c,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=u.getTime()?n:n-1}function vUe(e,t){var l,c,u,d;const r=R0(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,i=Rde(e,t),s=Ho(e,0);return s.setFullYear(i,0,n),s.setHours(0,0,0,0),od(s,t)}function Ude(e,t){const r=Ar(e),n=+od(r,t)-+vUe(r,t);return Math.round(n/U8)+1}function Cn(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const pf={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Cn(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Cn(r+1,2)},d(e,t){return Cn(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return Cn(e.getHours()%12||12,t.length)},H(e,t){return Cn(e.getHours(),t.length)},m(e,t){return Cn(e.getMinutes(),t.length)},s(e,t){return Cn(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return Cn(i,t.length)}},wv={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},qW={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return pf.y(e,t)},Y:function(e,t,r,n){const i=Rde(e,n),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return Cn(o,2)}return t==="Yo"?r.ordinalNumber(s,{unit:"year"}):Cn(s,t.length)},R:function(e,t){const r=Fde(e);return Cn(r,t.length)},u:function(e,t){const r=e.getFullYear();return Cn(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Cn(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Cn(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return pf.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return Cn(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=Ude(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):Cn(i,t.length)},I:function(e,t,r){const n=Dde(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):Cn(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):pf.d(e,t)},D:function(e,t,r){const n=gUe(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Cn(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Cn(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Cn(s,t.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return Cn(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(n===12?i=wv.noon:n===0?i=wv.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(n>=17?i=wv.evening:n>=12?i=wv.afternoon:n>=4?i=wv.morning:i=wv.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return pf.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):pf.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Cn(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):Cn(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):pf.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):pf.s(e,t)},S:function(e,t){return pf.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return YW(n);case"XXXX":case"XX":return zp(n);case"XXXXX":case"XXX":default:return zp(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return YW(n);case"xxxx":case"xx":return zp(n);case"xxxxx":case"xxx":default:return zp(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+XW(n,":");case"OOOO":default:return"GMT"+zp(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+XW(n,":");case"zzzz":default:return"GMT"+zp(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return Cn(n,t.length)},T:function(e,t,r){const n=e.getTime();return Cn(n,t.length)}};function XW(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),s=n%60;return s===0?r+String(i):r+String(i)+t+Cn(s,2)}function YW(e,t){return e%60===0?(e>0?"-":"+")+Cn(Math.abs(e)/60,2):zp(e,t)}function zp(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Cn(Math.trunc(n/60),2),s=Cn(n%60,2);return r+i+t+s}const JW=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Qde=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},xUe=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return JW(e,t);let s;switch(n){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",JW(n,t)).replace("{{time}}",Qde(i,t))},yUe={p:Qde,P:xUe},bUe=/^D+$/,wUe=/^Y+$/,CUe=["D","DD","YY","YYYY"];function NUe(e){return bUe.test(e)}function jUe(e){return wUe.test(e)}function SUe(e,t,r){const n=BUe(e,t,r);if(console.warn(n),CUe.includes(e))throw new RangeError(n)}function BUe(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const _Ue=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kUe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,EUe=/^'([^]*?)'?$/,TUe=/''/g,PUe=/[a-zA-Z]/;function ks(e,t,r){var d,A,h,f,m,p,g,v;const n=R0(),i=(r==null?void 0:r.locale)??n.locale??$8,s=(r==null?void 0:r.firstWeekContainsDate)??((A=(d=r==null?void 0:r.locale)==null?void 0:d.options)==null?void 0:A.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(h=n.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,o=(r==null?void 0:r.weekStartsOn)??((p=(m=r==null?void 0:r.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)??n.weekStartsOn??((v=(g=n.locale)==null?void 0:g.options)==null?void 0:v.weekStartsOn)??0,l=Ar(e);if(!T6e(l))throw new RangeError("Invalid time value");let c=t.match(kUe).map(x=>{const y=x[0];if(y==="p"||y==="P"){const b=yUe[y];return b(x,i.formatLong)}return x}).join("").match(_Ue).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const y=x[0];if(y==="'")return{isToken:!1,value:IUe(x)};if(qW[y])return{isToken:!0,value:x};if(y.match(PUe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:x}});i.localize.preprocessor&&(c=i.localize.preprocessor(l,c));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return c.map(x=>{if(!x.isToken)return x.value;const y=x.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&jUe(y)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&NUe(y))&&SUe(y,t,String(e));const b=qW[y[0]];return b(l,y,i.localize,u)}).join("")}function IUe(e){const t=e.match(EUe);return t?t[1].replace(TUe,"'"):e}function OUe(e,t,r){const n=R0(),i=(r==null?void 0:r.locale)??n.locale??$8,s=2520,o=YS(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:o});let c,u;o>0?(c=Ar(t),u=Ar(e)):(c=Ar(e),u=Ar(t));const d=D6e(u,c),A=(My(u)-My(c))/1e3,h=Math.round((d-A)/60);let f;if(h<2)return r!=null&&r.includeSeconds?d<5?i.formatDistance("lessThanXSeconds",5,l):d<10?i.formatDistance("lessThanXSeconds",10,l):d<20?i.formatDistance("lessThanXSeconds",20,l):d<40?i.formatDistance("halfAMinute",0,l):d<60?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",1,l):h===0?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",h,l);if(h<45)return i.formatDistance("xMinutes",h,l);if(h<90)return i.formatDistance("aboutXHours",1,l);if(hn.getTime()}function $de(e,t){const r=Ar(e),n=Ar(t);return+r<+n}function z8(e,t){const r=Ar(e),n=Ar(t);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function RUe(e,t){const r=Ar(e),n=Ar(t);return r.getFullYear()===n.getFullYear()}function wI(e,t){return to(e,-t)}function CI(e,t){const r=Ar(e),n=r.getFullYear(),i=r.getDate(),s=Ho(e,0);s.setFullYear(n,t,15),s.setHours(0,0,0,0);const o=FUe(s);return r.setMonth(t,Math.min(i,o)),r}function ZW(e,t){const r=Ar(e);return isNaN(+r)?Ho(e,NaN):(r.setFullYear(t),r)}function eG(e,t){return gc(e,-t)}var lr=function(){return lr=Object.assign||function(t){for(var r,n=1,i=arguments.length;n1&&(c||!u),A=t>1&&(u||!c),h=function(){n&&s(n)},f=function(){i&&s(i)};return a.jsx(v8e,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:A,nextMonth:i,previousMonth:n,onPreviousClick:h,onNextClick:f})}function x8e(e){var t,r=Vn(),n=r.classNames,i=r.disableNavigation,s=r.styles,o=r.captionLayout,l=r.components,c=(t=l==null?void 0:l.CaptionLabel)!==null&&t!==void 0?t:Gde,u;return i?u=a.jsx(c,{id:e.id,displayMonth:e.displayMonth}):o==="dropdown"?u=a.jsx(tG,{displayMonth:e.displayMonth,id:e.id}):o==="dropdown-buttons"?u=a.jsxs(a.Fragment,{children:[a.jsx(tG,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),a.jsx(rG,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):u=a.jsxs(a.Fragment,{children:[a.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),a.jsx(rG,{displayMonth:e.displayMonth,id:e.id})]}),a.jsx("div",{className:n.caption,style:s.caption,children:u})}function y8e(e){var t=Vn(),r=t.footer,n=t.styles,i=t.classNames.tfoot;return r?a.jsx("tfoot",{className:i,style:n.tfoot,children:a.jsx("tr",{children:a.jsx("td",{colSpan:8,children:r})})}):a.jsx(a.Fragment,{})}function b8e(e,t,r){for(var n=r?hg(new Date):od(new Date,{locale:e,weekStartsOn:t}),i=[],s=0;s<7;s++){var o=to(n,s);i.push(o)}return i}function w8e(){var e=Vn(),t=e.classNames,r=e.styles,n=e.showWeekNumber,i=e.locale,s=e.weekStartsOn,o=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,u=b8e(i,s,o);return a.jsxs("tr",{style:r.head_row,className:t.head_row,children:[n&&a.jsx("td",{style:r.head_cell,className:t.head_cell}),u.map(function(d,A){return a.jsx("th",{scope:"col",className:t.head_cell,style:r.head_cell,"aria-label":c(d,{locale:i}),children:l(d,{locale:i})},A)})]})}function C8e(){var e,t=Vn(),r=t.classNames,n=t.styles,i=t.components,s=(e=i==null?void 0:i.HeadRow)!==null&&e!==void 0?e:w8e;return a.jsx("thead",{style:n.head,className:r.head,children:a.jsx(s,{})})}function N8e(e){var t=Vn(),r=t.locale,n=t.formatters.formatDay;return a.jsx(a.Fragment,{children:n(e.date,{locale:r})})}var W8=w.createContext(void 0);function j8e(e){if(!HC(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return a.jsx(W8.Provider,{value:t,children:e.children})}return a.jsx(S8e,{initialProps:e.initialProps,children:e.children})}function S8e(e){var t=e.initialProps,r=e.children,n=t.selected,i=t.min,s=t.max,o=function(u,d,A){var h,f;(h=t.onDayClick)===null||h===void 0||h.call(t,u,d,A);var m=!!(d.selected&&i&&(n==null?void 0:n.length)===i);if(!m){var p=!!(!d.selected&&s&&(n==null?void 0:n.length)===s);if(!p){var g=n?zde([],n):[];if(d.selected){var v=g.findIndex(function(x){return Po(u,x)});g.splice(v,1)}else g.push(u);(f=t.onSelect)===null||f===void 0||f.call(t,g,u,d,A)}}},l={disabled:[]};n&&l.disabled.push(function(u){var d=s&&n.length>s-1,A=n.some(function(h){return Po(h,u)});return!!(d&&!A)});var c={selected:n,onDayClick:o,modifiers:l};return a.jsx(W8.Provider,{value:c,children:r})}function G8(){var e=w.useContext(W8);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function B8e(e,t){var r=t||{},n=r.from,i=r.to;return n&&i?Po(i,e)&&Po(n,e)?void 0:Po(i,e)?{from:i,to:void 0}:Po(n,e)?void 0:WL(n,e)?{from:e,to:i}:{from:n,to:e}:i?WL(e,i)?{from:i,to:e}:{from:e,to:i}:n?$de(e,n)?{from:e,to:n}:{from:n,to:e}:{from:e,to:void 0}}var K8=w.createContext(void 0);function _8e(e){if(!$C(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return a.jsx(K8.Provider,{value:t,children:e.children})}return a.jsx(k8e,{initialProps:e.initialProps,children:e.children})}function k8e(e){var t=e.initialProps,r=e.children,n=t.selected,i=n||{},s=i.from,o=i.to,l=t.min,c=t.max,u=function(f,m,p){var g,v;(g=t.onDayClick)===null||g===void 0||g.call(t,f,m,p);var x=B8e(f,n);(v=t.onSelect)===null||v===void 0||v.call(t,x,f,m,p)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(s?(d.range_start=[s],o?(d.range_end=[o],Po(s,o)||(d.range_middle=[{after:s,before:o}])):d.range_end=[s]):o&&(d.range_start=[o],d.range_end=[o]),l&&(s&&!o&&d.disabled.push({after:wI(s,l-1),before:to(s,l-1)}),s&&o&&d.disabled.push({after:s,before:to(s,l-1)}),!s&&o&&d.disabled.push({after:wI(o,l-1),before:to(o,l-1)})),c){if(s&&!o&&(d.disabled.push({before:to(s,-c+1)}),d.disabled.push({after:to(s,c-1)})),s&&o){var A=Qu(o,s)+1,h=c-A;d.disabled.push({before:wI(s,h)}),d.disabled.push({after:to(o,h)})}!s&&o&&(d.disabled.push({before:to(o,-c+1)}),d.disabled.push({after:to(o,c-1)}))}return a.jsx(K8.Provider,{value:{selected:n,onDayClick:u,modifiers:d},children:r})}function V8(){var e=w.useContext(K8);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function JS(e){return Array.isArray(e)?zde([],e):e!==void 0?[e]:[]}function E8e(e){var t={};return Object.entries(e).forEach(function(r){var n=r[0],i=r[1];t[n]=JS(i)}),t}var au;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(au||(au={}));var T8e=au.Selected,zd=au.Disabled,P8e=au.Hidden,I8e=au.Today,NI=au.RangeEnd,jI=au.RangeMiddle,SI=au.RangeStart,O8e=au.Outside;function F8e(e,t,r){var n,i=(n={},n[T8e]=JS(e.selected),n[zd]=JS(e.disabled),n[P8e]=JS(e.hidden),n[I8e]=[e.today],n[NI]=[],n[jI]=[],n[SI]=[],n[O8e]=[],n);return e.fromDate&&i[zd].push({before:e.fromDate}),e.toDate&&i[zd].push({after:e.toDate}),HC(e)?i[zd]=i[zd].concat(t.modifiers[zd]):$C(e)&&(i[zd]=i[zd].concat(r.modifiers[zd]),i[SI]=r.modifiers[SI],i[jI]=r.modifiers[jI],i[NI]=r.modifiers[NI]),i}var qde=w.createContext(void 0);function L8e(e){var t=Vn(),r=G8(),n=V8(),i=F8e(t,r,n),s=E8e(t.modifiers),o=lr(lr({},i),s);return a.jsx(qde.Provider,{value:o,children:e.children})}function Xde(){var e=w.useContext(qde);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function M8e(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function D8e(e){return!!(e&&typeof e=="object"&&"from"in e)}function R8e(e){return!!(e&&typeof e=="object"&&"after"in e)}function U8e(e){return!!(e&&typeof e=="object"&&"before"in e)}function Q8e(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function H8e(e,t){var r,n=t.from,i=t.to;if(n&&i){var s=Qu(i,n)<0;s&&(r=[i,n],n=r[0],i=r[1]);var o=Qu(e,n)>=0&&Qu(i,e)>=0;return o}return i?Po(i,e):n?Po(n,e):!1}function $8e(e){return Q8(e)}function z8e(e){return Array.isArray(e)&&e.every(Q8)}function W8e(e,t){return t.some(function(r){if(typeof r=="boolean")return r;if($8e(r))return Po(e,r);if(z8e(r))return r.includes(e);if(D8e(r))return H8e(e,r);if(Q8e(r))return r.dayOfWeek.includes(e.getDay());if(M8e(r)){var n=Qu(r.before,e),i=Qu(r.after,e),s=n>0,o=i<0,l=WL(r.before,r.after);return l?o&&s:s||o}return R8e(r)?Qu(e,r.after)>0:U8e(r)?Qu(r.before,e)>0:typeof r=="function"?r(e):!1})}function q8(e,t,r){var n=Object.keys(t).reduce(function(s,o){var l=t[o];return W8e(e,l)&&s.push(o),s},[]),i={};return n.forEach(function(s){return i[s]=!0}),r&&!z8(e,r)&&(i.outside=!0),i}function G8e(e,t){for(var r=co(e[0]),n=KE(e[e.length-1]),i,s,o=r;o<=n;){var l=q8(o,t),c=!l.disabled&&!l.hidden;if(!c){o=to(o,1);continue}if(l.selected)return o;l.today&&!s&&(s=o),i||(i=o),o=to(o,1)}return s||i}var K8e=365;function Yde(e,t){var r=t.moveBy,n=t.direction,i=t.context,s=t.modifiers,o=t.retry,l=o===void 0?{count:0,lastFocused:e}:o,c=i.weekStartsOn,u=i.fromDate,d=i.toDate,A=i.locale,h={day:to,week:zL,month:gc,year:B6e,startOfWeek:function(g){return i.ISOWeek?hg(g):od(g,{locale:A,weekStartsOn:c})},endOfWeek:function(g){return i.ISOWeek?Mde(g):H8(g,{locale:A,weekStartsOn:c})}},f=h[r](e,n==="after"?1:-1);n==="before"&&u?f=_6e([u,f]):n==="after"&&d&&(f=k6e([d,f]));var m=!0;if(s){var p=q8(f,s);m=!p.disabled&&!p.hidden}return m?f:l.count>K8e?l.lastFocused:Yde(f,{moveBy:r,direction:n,context:i,modifiers:s,retry:lr(lr({},l),{count:l.count+1})})}var Jde=w.createContext(void 0);function V8e(e){var t=zC(),r=Xde(),n=w.useState(),i=n[0],s=n[1],o=w.useState(),l=o[0],c=o[1],u=G8e(t.displayMonths,r),d=i??(l&&t.isDateDisplayed(l))?l:u,A=function(){c(i),s(void 0)},h=function(g){s(g)},f=Vn(),m=function(g,v){if(i){var x=Yde(i,{moveBy:g,direction:v,context:f,modifiers:r});Po(i,x)||(t.goToDate(x,i),h(x))}},p={focusedDay:i,focusTarget:d,blur:A,focus:h,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return a.jsx(Jde.Provider,{value:p,children:e.children})}function X8(){var e=w.useContext(Jde);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function q8e(e,t){var r=Xde(),n=q8(e,r,t);return n}var Y8=w.createContext(void 0);function X8e(e){if(!VE(e.initialProps)){var t={selected:void 0};return a.jsx(Y8.Provider,{value:t,children:e.children})}return a.jsx(Y8e,{initialProps:e.initialProps,children:e.children})}function Y8e(e){var t=e.initialProps,r=e.children,n=function(s,o,l){var c,u,d;if((c=t.onDayClick)===null||c===void 0||c.call(t,s,o,l),o.selected&&!t.required){(u=t.onSelect)===null||u===void 0||u.call(t,void 0,s,o,l);return}(d=t.onSelect)===null||d===void 0||d.call(t,s,s,o,l)},i={selected:t.selected,onDayClick:n};return a.jsx(Y8.Provider,{value:i,children:r})}function Zde(){var e=w.useContext(Y8);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function J8e(e,t){var r=Vn(),n=Zde(),i=G8(),s=V8(),o=X8(),l=o.focusDayAfter,c=o.focusDayBefore,u=o.focusWeekAfter,d=o.focusWeekBefore,A=o.blur,h=o.focus,f=o.focusMonthBefore,m=o.focusMonthAfter,p=o.focusYearBefore,g=o.focusYearAfter,v=o.focusStartOfWeek,x=o.focusEndOfWeek,y=function(U){var Q,z,Y,$;VE(r)?(Q=n.onDayClick)===null||Q===void 0||Q.call(n,e,t,U):HC(r)?(z=i.onDayClick)===null||z===void 0||z.call(i,e,t,U):$C(r)?(Y=s.onDayClick)===null||Y===void 0||Y.call(s,e,t,U):($=r.onDayClick)===null||$===void 0||$.call(r,e,t,U)},b=function(U){var Q;h(e),(Q=r.onDayFocus)===null||Q===void 0||Q.call(r,e,t,U)},C=function(U){var Q;A(),(Q=r.onDayBlur)===null||Q===void 0||Q.call(r,e,t,U)},j=function(U){var Q;(Q=r.onDayMouseEnter)===null||Q===void 0||Q.call(r,e,t,U)},S=function(U){var Q;(Q=r.onDayMouseLeave)===null||Q===void 0||Q.call(r,e,t,U)},T=function(U){var Q;(Q=r.onDayPointerEnter)===null||Q===void 0||Q.call(r,e,t,U)},B=function(U){var Q;(Q=r.onDayPointerLeave)===null||Q===void 0||Q.call(r,e,t,U)},I=function(U){var Q;(Q=r.onDayTouchCancel)===null||Q===void 0||Q.call(r,e,t,U)},P=function(U){var Q;(Q=r.onDayTouchEnd)===null||Q===void 0||Q.call(r,e,t,U)},E=function(U){var Q;(Q=r.onDayTouchMove)===null||Q===void 0||Q.call(r,e,t,U)},M=function(U){var Q;(Q=r.onDayTouchStart)===null||Q===void 0||Q.call(r,e,t,U)},_=function(U){var Q;(Q=r.onDayKeyUp)===null||Q===void 0||Q.call(r,e,t,U)},R=function(U){var Q;switch(U.key){case"ArrowLeft":U.preventDefault(),U.stopPropagation(),r.dir==="rtl"?l():c();break;case"ArrowRight":U.preventDefault(),U.stopPropagation(),r.dir==="rtl"?c():l();break;case"ArrowDown":U.preventDefault(),U.stopPropagation(),u();break;case"ArrowUp":U.preventDefault(),U.stopPropagation(),d();break;case"PageUp":U.preventDefault(),U.stopPropagation(),U.shiftKey?p():f();break;case"PageDown":U.preventDefault(),U.stopPropagation(),U.shiftKey?g():m();break;case"Home":U.preventDefault(),U.stopPropagation(),v();break;case"End":U.preventDefault(),U.stopPropagation(),x();break}(Q=r.onDayKeyDown)===null||Q===void 0||Q.call(r,e,t,U)},G={onClick:y,onFocus:b,onBlur:C,onKeyDown:R,onKeyUp:_,onMouseEnter:j,onMouseLeave:S,onPointerEnter:T,onPointerLeave:B,onTouchCancel:I,onTouchEnd:P,onTouchMove:E,onTouchStart:M};return G}function Z8e(){var e=Vn(),t=Zde(),r=G8(),n=V8(),i=VE(e)?t.selected:HC(e)?r.selected:$C(e)?n.selected:void 0;return i}function eQe(e){return Object.values(au).includes(e)}function tQe(e,t){var r=[e.classNames.day];return Object.keys(t).forEach(function(n){var i=e.modifiersClassNames[n];if(i)r.push(i);else if(eQe(n)){var s=e.classNames["day_".concat(n)];s&&r.push(s)}}),r}function rQe(e,t){var r=lr({},e.styles.day);return Object.keys(t).forEach(function(n){var i;r=lr(lr({},r),(i=e.modifiersStyles)===null||i===void 0?void 0:i[n])}),r}function nQe(e,t,r){var n,i,s,o=Vn(),l=X8(),c=q8e(e,t),u=J8e(e,c),d=Z8e(),A=!!(o.onDayClick||o.mode!=="default");w.useEffect(function(){var j;c.outside||l.focusedDay&&A&&Po(l.focusedDay,e)&&((j=r.current)===null||j===void 0||j.focus())},[l.focusedDay,e,r,A,c.outside]);var h=tQe(o,c).join(" "),f=rQe(o,c),m=!!(c.outside&&!o.showOutsideDays||c.hidden),p=(s=(i=o.components)===null||i===void 0?void 0:i.DayContent)!==null&&s!==void 0?s:N8e,g=a.jsx(p,{date:e,displayMonth:t,activeModifiers:c}),v={style:f,className:h,children:g,role:"gridcell"},x=l.focusTarget&&Po(l.focusTarget,e)&&!c.outside,y=l.focusedDay&&Po(l.focusedDay,e),b=lr(lr(lr({},v),(n={disabled:c.disabled,role:"gridcell"},n["aria-selected"]=c.selected,n.tabIndex=y||x?0:-1,n)),u),C={isButton:A,isHidden:m,activeModifiers:c,selectedDays:d,buttonProps:b,divProps:v};return C}function iQe(e){var t=w.useRef(null),r=nQe(e.date,e.displayMonth,t);return r.isHidden?a.jsx("div",{role:"gridcell"}):r.isButton?a.jsx(tk,lr({name:"day",ref:t},r.buttonProps)):a.jsx("div",lr({},r.divProps))}function sQe(e){var t=e.number,r=e.dates,n=Vn(),i=n.onWeekNumberClick,s=n.styles,o=n.classNames,l=n.locale,c=n.labels.labelWeekNumber,u=n.formatters.formatWeekNumber,d=u(Number(t),{locale:l});if(!i)return a.jsx("span",{className:o.weeknumber,style:s.weeknumber,children:d});var A=c(Number(t),{locale:l}),h=function(f){i(t,r,f)};return a.jsx(tk,{name:"week-number","aria-label":A,className:o.weeknumber,style:s.weeknumber,onClick:h,children:d})}function aQe(e){var t,r,n=Vn(),i=n.styles,s=n.classNames,o=n.showWeekNumber,l=n.components,c=(t=l==null?void 0:l.Day)!==null&&t!==void 0?t:iQe,u=(r=l==null?void 0:l.WeekNumber)!==null&&r!==void 0?r:sQe,d;return o&&(d=a.jsx("td",{className:s.cell,style:i.cell,children:a.jsx(u,{number:e.weekNumber,dates:e.dates})})),a.jsxs("tr",{className:s.row,style:i.row,children:[d,e.dates.map(function(A){return a.jsx("td",{className:s.cell,style:i.cell,role:"presentation",children:a.jsx(c,{displayMonth:e.displayMonth,date:A})},LUe(A))})]})}function nG(e,t,r){for(var n=r!=null&&r.ISOWeek?Mde(t):H8(t,r),i=r!=null&&r.ISOWeek?hg(e):od(e,r),s=Qu(n,i),o=[],l=0;l<=s;l++)o.push(to(i,l));var c=o.reduce(function(u,d){var A=r!=null&&r.ISOWeek?Dde(d):Ude(d,r),h=u.find(function(f){return f.weekNumber===A});return h?(h.dates.push(d),u):(u.push({weekNumber:A,dates:[d]}),u)},[]);return c}function oQe(e,t){var r=nG(co(e),KE(e),t);if(t!=null&&t.useFixedWeeks){var n=DUe(e,t);if(n<6){var i=r[r.length-1],s=i.dates[i.dates.length-1],o=zL(s,6-n),l=nG(zL(s,1),o,t);r.push.apply(r,l)}}return r}function lQe(e){var t,r,n,i=Vn(),s=i.locale,o=i.classNames,l=i.styles,c=i.hideHead,u=i.fixedWeeks,d=i.components,A=i.weekStartsOn,h=i.firstWeekContainsDate,f=i.ISOWeek,m=oQe(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:f,locale:s,weekStartsOn:A,firstWeekContainsDate:h}),p=(t=d==null?void 0:d.Head)!==null&&t!==void 0?t:C8e,g=(r=d==null?void 0:d.Row)!==null&&r!==void 0?r:aQe,v=(n=d==null?void 0:d.Footer)!==null&&n!==void 0?n:y8e;return a.jsxs("table",{id:e.id,className:o.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&a.jsx(p,{}),a.jsx("tbody",{className:o.tbody,style:l.tbody,children:m.map(function(x){return a.jsx(g,{displayMonth:e.displayMonth,dates:x.dates,weekNumber:x.weekNumber},x.weekNumber)})}),a.jsx(v,{displayMonth:e.displayMonth})]})}function cQe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var uQe=cQe()?w.useLayoutEffect:w.useEffect,BI=!1,dQe=0;function iG(){return"react-day-picker-".concat(++dQe)}function AQe(e){var t,r=e??(BI?iG():null),n=w.useState(r),i=n[0],s=n[1];return uQe(function(){i===null&&s(iG())},[]),w.useEffect(function(){BI===!1&&(BI=!0)},[]),(t=e??i)!==null&&t!==void 0?t:void 0}function fQe(e){var t,r,n=Vn(),i=n.dir,s=n.classNames,o=n.styles,l=n.components,c=zC().displayMonths,u=AQe(n.id?"".concat(n.id,"-").concat(e.displayIndex):void 0),d=n.id?"".concat(n.id,"-grid-").concat(e.displayIndex):void 0,A=[s.month],h=o.month,f=e.displayIndex===0,m=e.displayIndex===c.length-1,p=!f&&!m;i==="rtl"&&(t=[f,m],m=t[0],f=t[1]),f&&(A.push(s.caption_start),h=lr(lr({},h),o.caption_start)),m&&(A.push(s.caption_end),h=lr(lr({},h),o.caption_end)),p&&(A.push(s.caption_between),h=lr(lr({},h),o.caption_between));var g=(r=l==null?void 0:l.Caption)!==null&&r!==void 0?r:x8e;return a.jsxs("div",{className:A.join(" "),style:h,children:[a.jsx(g,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),a.jsx(lQe,{id:d,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function hQe(e){var t=Vn(),r=t.classNames,n=t.styles;return a.jsx("div",{className:r.months,style:n.months,children:e.children})}function pQe(e){var t,r,n=e.initialProps,i=Vn(),s=X8(),o=zC(),l=w.useState(!1),c=l[0],u=l[1];w.useEffect(function(){i.initialFocus&&s.focusTarget&&(c||(s.focus(s.focusTarget),u(!0)))},[i.initialFocus,c,s.focus,s.focusTarget,s]);var d=[i.classNames.root,i.className];i.numberOfMonths>1&&d.push(i.classNames.multiple_months),i.showWeekNumber&&d.push(i.classNames.with_weeknumber);var A=lr(lr({},i.styles.root),i.style),h=Object.keys(n).filter(function(m){return m.startsWith("data-")}).reduce(function(m,p){var g;return lr(lr({},m),(g={},g[p]=n[p],g))},{}),f=(r=(t=n.components)===null||t===void 0?void 0:t.Months)!==null&&r!==void 0?r:hQe;return a.jsx("div",lr({className:d.join(" "),style:A,dir:i.dir,id:i.id,nonce:n.nonce,title:n.title,lang:n.lang},h,{children:a.jsx(f,{children:o.displayMonths.map(function(m,p){return a.jsx(fQe,{displayIndex:p,displayMonth:m},p)})})}))}function mQe(e){var t=e.children,r=UUe(e,["children"]);return a.jsx(s8e,{initialProps:r,children:a.jsx(p8e,{children:a.jsx(X8e,{initialProps:r,children:a.jsx(j8e,{initialProps:r,children:a.jsx(_8e,{initialProps:r,children:a.jsx(L8e,{children:a.jsx(V8e,{children:t})})})})})})})}function gQe(e){return a.jsx(mQe,lr({},e,{children:a.jsx(pQe,{initialProps:e})}))}function eAe({className:e,classNames:t,showOutsideDays:r=!0,...n}){return a.jsx(gQe,{showOutsideDays:r,className:Le("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Le(G1({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:Le(G1({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...i})=>a.jsx(v6,{className:"h-4 w-4"}),IconRight:({...i})=>a.jsx(vC,{className:"h-4 w-4"})},...n})}eAe.displayName="Calendar";const vQe=()=>{const{user:e}=fi(),[t,r]=w.useState(new Date),[n,i]=w.useState([]),[s,o]=w.useState([]),[l,c]=w.useState(!1),[u,d]=w.useState(null),[A,h]=w.useState({title:"",description:"",content_type:"blog_post",status:"planned"});w.useEffect(()=>{e&&f()},[e]),w.useEffect(()=>{if(t){const x=ks(t,"yyyy-MM-dd"),y=n.filter(b=>b.scheduled_date===x);o(y)}},[t,n]);const f=async()=>{if(!e)return;const{data:x,error:y}=await Re.from("content_calendar").select("*").eq("user_id",e.id).order("scheduled_date",{ascending:!0});if(y){console.error("Error fetching events:",y);return}i(x||[])},m=async x=>{if(x.preventDefault(),!e||!t)return;const y={user_id:e.id,title:A.title,description:A.description,content_type:A.content_type,scheduled_date:ks(t,"yyyy-MM-dd"),status:A.status};if(u){const{error:b}=await Re.from("content_calendar").update(y).eq("id",u.id);if(b){ss.error("Failed to update event");return}ss.success("Event updated successfully")}else{const{error:b}=await Re.from("content_calendar").insert([y]);if(b){ss.error("Failed to create event");return}ss.success("Event created successfully")}c(!1),h({title:"",description:"",content_type:"blog_post",status:"planned"}),d(null),f()},p=x=>{d(x),h({title:x.title,description:x.description||"",content_type:x.content_type||"blog_post",status:x.status}),c(!0)},g=async x=>{const{error:y}=await Re.from("content_calendar").delete().eq("id",x);if(y){ss.error("Failed to delete event");return}ss.success("Event deleted successfully"),f()},v=()=>n.map(x=>new Date(x.scheduled_date));return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Content Calendar"}),a.jsx("p",{className:"text-muted-foreground",children:"Plan and schedule your content launches"})]}),a.jsxs(Mi,{open:l,onOpenChange:x=>{c(x),x||(d(null),h({title:"",description:"",content_type:"blog_post",status:"planned"}))},children:[a.jsx(EU,{asChild:!0,children:a.jsxs(ve,{children:[a.jsx(Xi,{className:"mr-2 h-4 w-4"}),"Add Event"]})}),a.jsxs(yi,{children:[a.jsx(bi,{children:a.jsx(wi,{children:u?"Edit Event":"Add New Event"})}),a.jsxs("form",{onSubmit:m,className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium",children:"Title"}),a.jsx(st,{value:A.title,onChange:x=>h({...A,title:x.target.value}),required:!0,placeholder:"Enter event title"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium",children:"Description"}),a.jsx(Zr,{value:A.description,onChange:x=>h({...A,description:x.target.value}),placeholder:"Enter event description",rows:3})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium",children:"Content Type"}),a.jsxs(It,{value:A.content_type,onValueChange:x=>h({...A,content_type:x}),children:[a.jsx(_t,{children:a.jsx(Ot,{})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"blog_post",children:"Blog Post"}),a.jsx(ye,{value:"social_media",children:"Social Media"}),a.jsx(ye,{value:"video",children:"Video"}),a.jsx(ye,{value:"email",children:"Email"}),a.jsx(ye,{value:"other",children:"Other"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium",children:"Status"}),a.jsxs(It,{value:A.status,onValueChange:x=>h({...A,status:x}),children:[a.jsx(_t,{children:a.jsx(Ot,{})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"planned",children:"Planned"}),a.jsx(ye,{value:"in_progress",children:"In Progress"}),a.jsx(ye,{value:"completed",children:"Completed"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm font-medium",children:"Scheduled Date"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:t?ks(t,"PPP"):"No date selected"})]}),a.jsx(ve,{type:"submit",className:"w-full",children:u?"Update Event":"Create Event"})]})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsx(_e,{className:"p-6 lg:col-span-2",children:a.jsx(eAe,{mode:"single",selected:t,onSelect:r,className:"rounded-md border pointer-events-auto",modifiers:{hasEvent:v()},modifiersStyles:{hasEvent:{fontWeight:"bold",backgroundColor:"hsl(var(--primary) / 0.2)"}}})}),a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-xl font-semibold mb-4",children:t?ks(t,"MMMM d, yyyy"):"Select a date"}),a.jsx("div",{className:"space-y-3",children:s.length===0?a.jsxs("div",{className:"text-center py-8",children:[a.jsx("div",{className:"w-14 h-14 mx-auto bg-primary/10 rounded-xl flex items-center justify-center mb-3",children:a.jsx(Xi,{className:"h-7 w-7 text-primary"})}),a.jsx("p",{className:"text-sm font-medium text-foreground",children:"No events scheduled"}),a.jsx("p",{className:"text-xs text-foreground/60 mt-1",children:'Click "Add Event" to plan content for this date'})]}):s.map(x=>a.jsx(_e,{className:"p-4",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"font-semibold",children:x.title}),x.description&&a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:x.description}),a.jsxs("div",{className:"flex gap-2 mt-2",children:[x.content_type&&a.jsx("span",{className:"text-xs px-2 py-1 bg-primary/10 text-primary rounded",children:x.content_type}),a.jsx("span",{className:`text-xs px-2 py-1 rounded ${x.status==="completed"?"bg-primary/10 text-primary":x.status==="in_progress"?"bg-pillar-presentations/10 text-pillar-presentations":"bg-muted text-foreground/70"}`,children:x.status})]})]}),a.jsxs("div",{className:"flex gap-1 ml-2",children:[a.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>p(x),children:a.jsx(b0,{className:"h-4 w-4"})}),a.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>g(x.id),children:a.jsx(Sl,{className:"h-4 w-4"})})]})]})},x.id))})]})]})]})},tAe=({value:e,onChange:t,showLabel:r=!0,className:n=""})=>{const[i,s]=w.useState([]),[o,l]=w.useState(!0),{user:c}=fi(),u=hs();return w.useEffect(()=>{(async()=>{if(!c){l(!1);return}try{const{data:A,error:h}=await Re.from("brand_voices").select("id, name, is_default").eq("user_id",c.id).order("is_default",{ascending:!1});if(h)throw h;if(s(A||[]),!e&&A&&A.length>0){const f=A.find(m=>m.is_default);f&&t(f.id)}}catch(A){console.error("Error fetching brand voices:",A)}finally{l(!1)}})()},[c]),o?a.jsxs("div",{className:n,children:[r&&a.jsx(Pe,{className:"mb-2 block text-muted-foreground",children:"Brand Voice"}),a.jsx("div",{className:"h-10 bg-muted animate-pulse rounded-md"})]}):i.length===0?a.jsxs("div",{className:n,children:[r&&a.jsx(Pe,{className:"mb-2 block",children:"Brand Voice"}),a.jsxs(ve,{variant:"outline",className:"w-full justify-start gap-2 text-muted-foreground",onClick:()=>u("/dashboard?tab=brand-voice"),children:[a.jsx(Xi,{className:"h-4 w-4"}),"Create a Brand Voice"]})]}):a.jsxs("div",{className:n,children:[r&&a.jsx(Pe,{className:"mb-2 block",children:"Brand Voice"}),a.jsxs(It,{value:e||"none",onValueChange:d=>t(d==="none"?null:d),children:[a.jsxs(_t,{className:"gap-2",children:[a.jsx(Tx,{className:"h-4 w-4 text-muted-foreground"}),a.jsx(Ot,{placeholder:"Select a brand voice"})]}),a.jsxs(kt,{children:[a.jsx(ye,{value:"none",children:a.jsx("span",{className:"text-muted-foreground",children:"No brand voice"})}),i.map(d=>a.jsx(ye,{value:d.id,children:a.jsxs("div",{className:"flex items-center gap-2",children:[d.name,d.is_default&&a.jsx(eg,{className:"h-3 w-3 text-primary fill-primary"})]})},d.id)),a.jsx("div",{className:"border-t mt-1 pt-1",children:a.jsxs(ve,{variant:"ghost",size:"sm",className:"w-full justify-start gap-2",onClick:d=>{d.preventDefault(),u("/dashboard?tab=brand-voice")},children:[a.jsx(Xi,{className:"h-4 w-4"}),"Create New Voice"]})})]})]})]})},xQe=({onClose:e,onComplete:t})=>{const{user:r}=fi(),n=B0(),[i,s]=w.useState(1),[o,l]=w.useState(!1),[c,u]=w.useState({brandVoiceId:null,businessName:"",businessStage:"",industry:"",targetAudience:"",goal:"",goalMetrics:"",timeFrame:"90",marketingType:"",budget:""}),d=async x=>{if(u(y=>({...y,brandVoiceId:x})),!!x)try{const{data:y,error:b}=await Re.from("brand_voices").select("brand_name, brand_description, industry, target_audience").eq("id",x).single();if(b)throw b;y&&u(C=>({...C,brandVoiceId:x,businessName:y.brand_name||C.businessName,industry:y.industry||C.industry,targetAudience:y.target_audience||C.targetAudience}))}catch(y){console.error("Error fetching brand voice:",y)}},A=(x,y)=>{u(b=>({...b,[x]:y}))},h=()=>{i<5&&s(i+1)},f=()=>{i>1&&s(i-1)},m=async()=>{var x;if(!(r!=null&&r.id)){ss.error("Please sign in to create a marketing plan");return}l(!0);try{const{data:{session:y},error:b}=await Re.auth.getSession();if(console.log("Session check:",{hasSession:!!y,hasToken:!!(y!=null&&y.access_token),userId:(x=y==null?void 0:y.user)==null?void 0:x.id}),!y||b){console.error("Session error:",b),ss.error("Your session has expired. Please sign in again.");return}console.log("Calling generate-marketing-plan edge function...");const{data:C,error:j}=await Re.functions.invoke("generate-marketing-plan",{body:{businessName:c.businessName,businessStage:c.businessStage,industry:c.industry,targetAudience:c.targetAudience,goal:c.goal,goalMetrics:c.goalMetrics,timeFrame:parseInt(c.timeFrame),marketingType:c.marketingType,budget:c.budget?parseFloat(c.budget):null,brandVoiceId:c.brandVoiceId}});if(console.log("Edge function response:",C),j)throw console.error("Edge function error:",j),new Error(`Failed to generate plan: ${j.message}`);ss.success("Marketing plan generated successfully!"),n.invalidateQueries({queryKey:["latest-marketing-plan",r.id]}),n.invalidateQueries({queryKey:["marketing-plans-list",r.id]}),t(C==null?void 0:C.planId)}catch(y){console.error("Error generating plan:",y),ss.error(y.message||"Failed to generate marketing plan. Check console for details.")}finally{l(!1)}},p=()=>{switch(i){case 1:return a.jsxs("div",{className:"space-y-4",children:[a.jsx(tAe,{value:c.brandVoiceId,onChange:d}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"businessName",children:"Business Name"}),a.jsx(st,{id:"businessName",value:c.businessName,onChange:x=>A("businessName",x.target.value),placeholder:"Your business name"})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"businessStage",children:"Business Stage"}),a.jsxs(It,{value:c.businessStage,onValueChange:x=>A("businessStage",x),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select stage"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"startup",children:"Startup (0-1 year)"}),a.jsx(ye,{value:"growth",children:"Growth (1-3 years)"}),a.jsx(ye,{value:"established",children:"Established (3-5 years)"}),a.jsx(ye,{value:"scaling",children:"Scaling (5+ years)"})]})]})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"industry",children:"Industry"}),a.jsx(st,{id:"industry",value:c.industry,onChange:x=>A("industry",x.target.value),placeholder:"e.g., SaaS, E-commerce, Healthcare"})]})]});case 2:return a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"targetAudience",children:"Target Audience"}),a.jsx(Zr,{id:"targetAudience",value:c.targetAudience,onChange:x=>A("targetAudience",x.target.value),placeholder:"Describe your ideal customer (demographics, pain points, behaviors)",rows:5})]})});case 3:return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"goal",children:"Primary Goal"}),a.jsx(st,{id:"goal",value:c.goal,onChange:x=>A("goal",x.target.value),placeholder:"e.g., Increase brand awareness by 50%"})]}),a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"goalMetrics",children:"Success Metrics"}),a.jsx(Zr,{id:"goalMetrics",value:c.goalMetrics,onChange:x=>A("goalMetrics",x.target.value),placeholder:"How will you measure success? (KPIs, numbers, specific outcomes)",rows:4})]})]});case 4:return a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"timeFrame",children:"Time Frame (days)"}),a.jsxs(It,{value:c.timeFrame,onValueChange:x=>A("timeFrame",x),children:[a.jsx(_t,{children:a.jsx(Ot,{})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"30",children:"30 days (1 month)"}),a.jsx(ye,{value:"60",children:"60 days (2 months)"}),a.jsx(ye,{value:"90",children:"90 days (3 months)"}),a.jsx(ye,{value:"180",children:"180 days (6 months)"})]})]})]})});case 5:return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"marketingType",children:"Marketing Type"}),a.jsxs(It,{value:c.marketingType,onValueChange:x=>A("marketingType",x),children:[a.jsx(_t,{children:a.jsx(Ot,{placeholder:"Select type"})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"organic",children:"Organic (Content, SEO, Social)"}),a.jsx(ye,{value:"paid",children:"Paid (Ads, Sponsored)"}),a.jsx(ye,{value:"hybrid",children:"Hybrid (Organic + Paid)"})]})]})]}),(c.marketingType==="paid"||c.marketingType==="hybrid")&&a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"budget",children:"Budget (USD)"}),a.jsx(st,{id:"budget",type:"number",value:c.budget,onChange:x=>A("budget",x.target.value),placeholder:"Total marketing budget"})]})]});default:return null}},g=()=>{switch(i){case 1:return c.businessName&&c.businessStage&&c.industry;case 2:return c.targetAudience;case 3:return c.goal&&c.goalMetrics;case 4:return c.timeFrame;case 5:return c.marketingType;default:return!1}},v=["Business Details","Target Audience","Goals & Metrics","Time Frame","Marketing Type"];return a.jsxs(a.Fragment,{children:[o&&a.jsx(id,{contentType:"Marketing Plan"}),a.jsx("div",{className:"container mx-auto p-6 max-w-3xl",children:a.jsxs(_e,{children:[a.jsxs(ot,{children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs(ve,{variant:"ghost",onClick:e,children:[a.jsx(Cl,{className:"mr-2 h-4 w-4"}),"Cancel"]}),a.jsxs("div",{className:"text-sm text-muted-foreground",children:["Step ",i," of 5"]})]}),a.jsx(lt,{className:"text-2xl",children:v[i-1]})]}),a.jsxs(Ge,{children:[a.jsx("div",{className:"mb-6",children:a.jsx("div",{className:"flex gap-2 mb-8",children:[1,2,3,4,5].map(x=>a.jsx("div",{className:`h-2 flex-1 rounded-full transition-colors ${x<=i?"bg-primary":"bg-muted"}`},x))})}),p(),a.jsxs("div",{className:"flex justify-between mt-8",children:[a.jsxs(ve,{variant:"outline",onClick:f,disabled:i===1,children:[a.jsx(Cl,{className:"mr-2 h-4 w-4"}),"Back"]}),i<5?a.jsxs(ve,{onClick:h,disabled:!g(),children:["Next",a.jsx(Di,{className:"ml-2 h-4 w-4"})]}):a.jsx(ve,{onClick:m,disabled:!g()||o,children:o?a.jsxs(a.Fragment,{children:[a.jsx(Nl,{className:"mr-2 h-4 w-4 animate-spin"}),"Generating..."]}):"Generate Plan"})]})]})]})})]})},yQe=({planId:e})=>{const t=B0(),{data:r}=Pm({queryKey:["marketing-checklists",e],queryFn:async()=>{const{data:o,error:l}=await Re.from("marketing_checklists").select("*").eq("plan_id",e).order("order_index");if(l)throw l;return o}}),n=cNe({mutationFn:async({taskId:o,completed:l})=>{const{error:c}=await Re.from("marketing_checklists").update({status:l?"completed":"pending",completed_at:l?new Date().toISOString():null}).eq("id",o);if(c)throw c},onSuccess:()=>{t.invalidateQueries({queryKey:["marketing-checklists",e]}),t.invalidateQueries({queryKey:["plan-completion",e]}),ss.success("Task updated!")}}),i=r==null?void 0:r.reduce((o,l)=>(o[l.category]||(o[l.category]=[]),o[l.category].push(l),o),{}),s={high:"destructive",medium:"default",low:"secondary"};return a.jsxs(_e,{children:[a.jsx(ot,{children:a.jsx(lt,{children:"Action Checklist"})}),a.jsx(Ge,{children:a.jsx("div",{className:"space-y-6",children:i&&Object.entries(i).map(([o,l])=>a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold mb-3 text-sm uppercase text-muted-foreground",children:o}),a.jsx("div",{className:"space-y-2",children:l.map(c=>a.jsxs("div",{className:Le("flex items-start gap-3 p-3 rounded-lg border transition-colors",c.status==="completed"?"bg-muted/50":"hover:bg-muted/30"),children:[a.jsx(EE,{checked:c.status==="completed",onCheckedChange:u=>n.mutate({taskId:c.id,completed:u}),className:"mt-1"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("p",{className:Le("font-medium",c.status==="completed"&&"line-through text-muted-foreground"),children:c.task_title}),a.jsx(bt,{variant:s[c.priority],className:"text-xs",children:c.priority})]}),c.task_description&&a.jsx("p",{className:"text-sm text-muted-foreground",children:c.task_description}),c.due_date&&a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Due: ",new Date(c.due_date).toLocaleDateString()]})]})]},c.id))})]},o))})})]})},bQe=({planId:e})=>{const{data:t}=Pm({queryKey:["marketing-tips",e],queryFn:async()=>{const{data:i,error:s}=await Re.from("marketing_tips").select("*").eq("plan_id",e).order("relevance_score",{ascending:!1}).limit(10);if(s)throw s;return i}}),r={strategy:ca,tactic:vA,tool:Twe,warning:j6},n={strategy:"default",tactic:"secondary",tool:"outline",warning:"destructive"};return a.jsxs(_e,{className:"sticky top-6",children:[a.jsx(ot,{children:a.jsxs(lt,{className:"flex items-center gap-2",children:[a.jsx(vA,{className:"h-5 w-5"}),"AI Tips & Insights"]})}),a.jsx(Ge,{children:t&&t.length>0?a.jsx("div",{className:"space-y-4",children:t.map(i=>{const s=r[i.tip_type];return a.jsx("div",{className:"p-4 rounded-lg border bg-card hover:bg-muted/50 transition-colors",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(s,{className:"h-5 w-5 text-muted-foreground shrink-0 mt-0.5"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(bt,{variant:n[i.tip_type],className:"mb-2",children:i.tip_type}),a.jsx("p",{className:"text-sm",children:i.content})]})]})},i.id)})}):a.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"Tips will appear here as you progress through your plan"})})]})},wQe=({planId:e,isOpen:t,onClose:r})=>{var A,h,f,m;const n=B0(),[i,s]=w.useState(""),[o,l]=w.useState(!1),[c,u]=w.useState(null),d=async()=>{var p;l(!0);try{const{data:g,error:v}=await Re.auth.getSession();if(v)throw v;const x=(p=g.session)==null?void 0:p.access_token;if(!x){ss.error("Please sign in to generate an evaluation.");return}const{data:y,error:b}=await Re.functions.invoke("evaluate-marketing-plan",{body:{planId:e,userNotes:i},headers:{Authorization:`Bearer ${x}`}});if(b){const C=b==null?void 0:b.context;if(C&&typeof C.json=="function"){const j=await C.json().catch(()=>null);throw new Error((j==null?void 0:j.error)||(j==null?void 0:j.message)||b.message)}throw b}if(y!=null&&y.error)throw new Error(y.error);u(y),ss.success("Evaluation complete!"),n.invalidateQueries({queryKey:["marketing-plan",e]})}catch(g){console.error("Error generating evaluation:",g),ss.error(g.message||"Failed to generate evaluation")}finally{l(!1)}};return a.jsx(Mi,{open:t,onOpenChange:r,children:a.jsxs(yi,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[a.jsx(bi,{children:a.jsx(wi,{children:"Marketing Plan Evaluation"})}),c?a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-lg mb-3",children:"What Worked"}),a.jsx("ul",{className:"space-y-2",children:(A=c.what_worked)==null?void 0:A.map((p,g)=>a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-green-500",children:"✓"}),a.jsx("span",{children:p})]},g))})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-lg mb-3",children:"What Didn't Work"}),a.jsx("ul",{className:"space-y-2",children:(h=c.what_didnt_work)==null?void 0:h.map((p,g)=>a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-red-500",children:"✗"}),a.jsx("span",{children:p})]},g))})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Why & Analysis"}),a.jsx("p",{className:"text-muted-foreground",children:c.why_analysis})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Recommendations"}),a.jsx("ul",{className:"space-y-2",children:(f=c.recommendations)==null?void 0:f.map((p,g)=>a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-blue-500",children:"→"}),a.jsx("span",{children:p})]},g))})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-lg mb-3",children:"Next Goals"}),a.jsx("ul",{className:"space-y-2",children:(m=c.next_goals)==null?void 0:m.map((p,g)=>a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-purple-500",children:"⭐"}),a.jsx("span",{children:p})]},g))})]}),a.jsx(ve,{onClick:r,className:"w-full",children:"Close & Create Next Plan"})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Pe,{htmlFor:"userNotes",children:"Your Reflections"}),a.jsx(Zr,{id:"userNotes",value:i,onChange:p=>s(p.target.value),placeholder:"Share your thoughts on what worked, what didn't, and any challenges you faced...",rows:6,className:"mt-2"})]}),a.jsx(ve,{onClick:d,disabled:o,className:"w-full",children:o?a.jsxs(a.Fragment,{children:[a.jsx(Nl,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyzing your plan..."]}):"Generate AI Evaluation"})]})]})})},CQe=({plan:e})=>{const t=e.plan_content||{},{executiveSummary:r,strategicPillars:n,weeklyPlan:i,metrics:s}=t;return a.jsxs("div",{className:"space-y-6",children:[a.jsxs(_e,{children:[a.jsx(ot,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ca,{className:"h-5 w-5 text-primary"}),a.jsx(lt,{children:"Your Marketing Mission"})]})}),a.jsx(Ge,{children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-lg mb-2",children:e.business_name}),a.jsx("p",{className:"text-muted-foreground mb-4",children:e.goal})]}),r&&a.jsx("div",{className:"prose prose-sm max-w-none",children:a.jsx("p",{className:"text-foreground leading-relaxed whitespace-pre-wrap",children:r})})]})})]}),n&&n.length>0&&a.jsxs(_e,{children:[a.jsx(ot,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(vA,{className:"h-5 w-5 text-primary"}),a.jsx(lt,{children:"Strategic Focus Areas"})]})}),a.jsx(Ge,{children:a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:n.map((o,l)=>a.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-muted/50 border border-border",children:[a.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-primary font-semibold text-sm",children:l+1}),a.jsx("p",{className:"text-sm font-medium flex-1 pt-1",children:o})]},l))})})]}),s&&s.length>0&&a.jsxs(_e,{children:[a.jsx(ot,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ni,{className:"h-5 w-5 text-primary"}),a.jsx(lt,{children:"Key Success Metrics"})]})}),a.jsx(Ge,{children:a.jsx("div",{className:"space-y-2",children:s.map((o,l)=>a.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[a.jsx("div",{className:"flex-shrink-0 w-2 h-2 rounded-full bg-primary"}),a.jsx("p",{className:"text-sm",children:o})]},l))})})]}),i&&i.length>0&&a.jsxs(_e,{children:[a.jsx(ot,{children:a.jsx(lt,{children:"Weekly Strategy Breakdown"})}),a.jsx(Ge,{children:a.jsx("div",{className:"space-y-4",children:i.map((o,l)=>a.jsxs("div",{className:"border border-border rounded-lg p-4 hover:border-primary/50 transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsxs(bt,{variant:"outline",children:["Week ",o.week]}),a.jsx("h4",{className:"font-semibold",children:o.focus})]}),o.actions&&o.actions.length>0&&a.jsx("ul",{className:"space-y-2 ml-4",children:o.actions.map((c,u)=>a.jsxs("li",{className:"text-sm text-muted-foreground flex gap-2",children:[a.jsx("span",{className:"text-primary",children:"•"}),a.jsx("span",{children:c})]},u))})]},l))})})]})]})},rAe=()=>{const{user:e}=fi(),{data:t}=Pm({queryKey:["marketing-plans-list",e==null?void 0:e.id],queryFn:async()=>{if(!(e!=null&&e.id))return[];const{data:r,error:n}=await Re.from("marketing_plans").select("*").eq("user_id",e.id).in("status",["completed","archived"]).order("created_at",{ascending:!1}).limit(10);if(n)throw n;return r},enabled:!!(e!=null&&e.id)});return!t||t.length===0?null:a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Previous Plans"}),a.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:t.map(r=>a.jsxs(_e,{className:"hover:shadow-lg transition-shadow",children:[a.jsx(ot,{children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(lt,{className:"text-lg line-clamp-1",children:r.business_name}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1 line-clamp-2",children:r.goal})]}),a.jsx(bt,{variant:r.status==="completed"?"default":"secondary",className:"ml-2",children:r.status})]})}),a.jsx(Ge,{children:a.jsxs("div",{className:"space-y-2 text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(Da,{className:"h-4 w-4"}),a.jsx("span",{children:r.created_at&&Hde(new Date(r.created_at),{addSuffix:!0})})]}),a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(ni,{className:"h-4 w-4"}),a.jsx("span",{className:"capitalize",children:r.marketing_type})]}),a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx(Zf,{className:"h-4 w-4"}),a.jsxs("span",{children:[r.time_frame," days duration"]})]})]})})]},r.id))})]})},NQe=({planId:e})=>{const[t,r]=w.useState(!1),[n,i]=w.useState(!1),s=B0(),o=hs(),{data:l}=Pm({queryKey:["marketing-plan",e],queryFn:async()=>{const{data:x,error:y}=await Re.from("marketing_plans").select("*").eq("id",e).single();if(y)throw y;return x!=null&&x.start_date&&i(!0),x}}),{data:c}=Pm({queryKey:["plan-completion",e],queryFn:async()=>{const{data:x,error:y}=await Re.rpc("calculate_plan_completion",{p_plan_id:e});if(y)throw y;return x}}),{data:u}=Pm({queryKey:["marketing-checklists",e],queryFn:async()=>{const{data:x,error:y}=await Re.from("marketing_checklists").select("*").eq("plan_id",e).order("order_index");if(y)throw y;return x}}),d=async()=>{if(l)try{const x=new Date().toISOString().split("T")[0],y=new Date;y.setDate(y.getDate()+l.time_frame);const{error:b}=await Re.from("marketing_plans").update({start_date:x,end_date:y.toISOString().split("T")[0],status:"active"}).eq("id",e);if(b)throw b;i(!0),ss.success("Marketing plan started! Your journey begins today 🚀")}catch(x){console.error("Error starting plan:",x),ss.error("Failed to start plan")}},A=async()=>{if(l)try{const{error:x}=await Re.from("marketing_plans").update({status:"archived"}).eq("id",e);if(x)throw x;ss.success("Plan closed! Ready for your next strategy 🎯"),s.invalidateQueries({queryKey:["latest-marketing-plan"]}),s.invalidateQueries({queryKey:["marketing-plans"]}),o("/dashboard?tab=growth-lab&create=true")}catch(x){console.error("Error closing plan:",x),ss.error("Failed to close plan")}},h=async()=>{if(l)try{const{error:x}=await Re.from("marketing_plans").update({status:"completed"}).eq("id",e);if(x)throw x;ss.success("Plan completed! Great work! 🎉"),s.invalidateQueries({queryKey:["latest-marketing-plan"]}),setTimeout(()=>window.location.reload(),500)}catch(x){console.error("Error completing plan:",x),ss.error("Failed to complete plan")}};if(!l)return null;const f=l.end_date?Math.ceil((new Date(l.end_date).getTime()-new Date().getTime())/(1e3*60*60*24)):0,m=f<=0,p=(u==null?void 0:u.filter(x=>x.status==="completed").length)||0,g=(u==null?void 0:u.length)||0,v=(u==null?void 0:u.every(x=>x.status==="completed"))&&((u==null?void 0:u.length)??0)>0;return a.jsxs("div",{className:"container mx-auto p-6 max-w-7xl",children:[a.jsx("div",{className:"mb-8",children:a.jsxs("div",{className:"flex items-start justify-between mb-4",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("h1",{className:"text-4xl font-bold",children:l.business_name}),a.jsx(bt,{variant:"default",className:"capitalize",children:l.status})]}),a.jsx("p",{className:"text-muted-foreground text-lg",children:l.goal})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsxs(ve,{size:"lg",variant:"outline",onClick:()=>o("/dashboard?tab=growth-lab&create=true"),className:"gap-2",children:[a.jsx(Xi,{className:"h-5 w-5"}),"Create New Plan"]}),n?v&&a.jsxs(ve,{size:"lg",onClick:h,className:"gap-2",children:[a.jsx(Zf,{className:"h-5 w-5"}),"Complete Plan"]}):a.jsxs(ve,{size:"lg",onClick:d,className:"gap-2",children:[a.jsx(ure,{className:"h-5 w-5"}),"Start Your Plan"]})]})]})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6 mb-8",children:[a.jsxs(_e,{children:[a.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(lt,{className:"text-sm font-medium",children:"Progress"}),a.jsx(ni,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(Ge,{children:[a.jsxs("div",{className:"text-2xl font-bold",children:[(c==null?void 0:c.toFixed(0))||0,"%"]}),a.jsx(MC,{value:c||0,className:"mt-2"}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:[p," of ",g," tasks completed"]})]})]}),a.jsxs(_e,{children:[a.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(lt,{className:"text-sm font-medium",children:"Time Remaining"}),a.jsx(Da,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(Ge,{children:[a.jsx("div",{className:"text-2xl font-bold",children:n?m?"Completed":`${f} days`:"Not Started"}),n&&l.end_date&&a.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:Hde(new Date(l.end_date),{addSuffix:!0})})]})]}),a.jsxs(_e,{children:[a.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(lt,{className:"text-sm font-medium",children:"Marketing Type"}),a.jsx(Zf,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(Ge,{children:[a.jsx("div",{className:"text-2xl font-bold capitalize",children:l.marketing_type}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:[l.business_stage," stage"]})]})]}),a.jsxs(_e,{children:[a.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[a.jsx(lt,{className:"text-sm font-medium",children:"Duration"}),a.jsx(pc,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(Ge,{children:[a.jsxs("div",{className:"text-2xl font-bold",children:[l.time_frame," days"]}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:[Math.ceil(l.time_frame/7)," weeks"]})]})]})]}),n&&m&&a.jsx(_e,{className:"mb-6 border-yellow-500 bg-yellow-500/5",children:a.jsx(Ge,{className:"pt-6",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx(H5,{className:"h-6 w-6 text-yellow-500 mt-0.5"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"font-semibold text-lg mb-1",children:"Strategy Period Ended"}),a.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:["Your ",l.time_frame,"-day marketing plan has concluded. Choose how you'd like to proceed:"]}),a.jsxs("div",{className:"flex flex-wrap gap-3",children:[a.jsxs(ve,{onClick:()=>r(!0),className:"gap-2",children:[a.jsx(ni,{className:"h-4 w-4"}),"Evaluate Progress"]}),a.jsxs(ve,{variant:"outline",onClick:A,className:"gap-2",children:[a.jsx(Xte,{className:"h-4 w-4"}),"Close Plan"]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-3",children:[a.jsx("strong",{children:"Evaluate:"})," Get AI-powered insights on what worked and recommendations for next time.",a.jsx("strong",{className:"ml-2",children:"Close:"})," Archive this plan and start fresh with a new strategy."]})]})]})})}),a.jsxs(LC,{defaultValue:"overview",className:"space-y-6",children:[a.jsxs(L0,{className:"grid w-full grid-cols-3",children:[a.jsx(vl,{value:"overview",children:"Plan Overview"}),a.jsx(vl,{value:"tasks",children:"Daily Tasks"}),a.jsx(vl,{value:"tips",children:"Tips & Insights"})]}),a.jsx(xl,{value:"overview",className:"space-y-6",children:a.jsx(CQe,{plan:l})}),a.jsx(xl,{value:"tasks",children:a.jsx(yQe,{planId:e})}),a.jsx(xl,{value:"tips",children:a.jsx(bQe,{planId:e})})]}),a.jsx("div",{className:"mt-12",children:a.jsx(rAe,{})}),t&&a.jsx(wQe,{planId:e,isOpen:t,onClose:()=>r(!1)})]})},jQe=()=>{const{user:e}=fi(),[t,r]=w.useState(!1),[n,i]=w.useState(null),[s,o]=dje();w.useEffect(()=>{if(s.get("create")==="true"){r(!0);const A=new URLSearchParams(s);A.delete("create"),o(A)}},[s,o]);const{data:l,isLoading:c}=Pm({queryKey:["latest-marketing-plan",e==null?void 0:e.id],queryFn:async()=>{if(!(e!=null&&e.id))return null;const{data:d,error:A}=await Re.from("marketing_plans").select("*").eq("user_id",e.id).in("status",["draft","active"]).order("created_at",{ascending:!1}).limit(1).maybeSingle();if(A)throw A;return d},enabled:!!(e!=null&&e.id)});if(c)return a.jsx("div",{className:"container mx-auto p-6 max-w-7xl",children:a.jsx(El,{message:"Loading Growth Lab..."})});if(t)return a.jsx(xQe,{onClose:()=>r(!1),onComplete:d=>{r(!1),d&&i(d)}});const u=n||(l==null?void 0:l.id);return u?a.jsx(NQe,{planId:u}):a.jsxs("div",{className:"container mx-auto p-6 max-w-7xl",children:[a.jsxs("div",{className:"flex justify-between items-center mb-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-4xl font-bold mb-2",children:"Growth Lab"}),a.jsx("p",{className:"text-muted-foreground",children:"AI-powered marketing strategy and execution planning"})]}),a.jsxs(ve,{onClick:()=>r(!0),size:"lg",children:[a.jsx(Xi,{className:"mr-2 h-5 w-5"}),"Create Marketing Plan"]})]}),a.jsx("div",{className:"grid gap-6 mb-8",children:!l&&a.jsx(_e,{className:"p-8 text-center",children:a.jsxs("div",{className:"max-w-2xl mx-auto",children:[a.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Build Your Marketing Strategy with AI"}),a.jsx("p",{className:"text-muted-foreground mb-6",children:"Get a personalized marketing plan based on your business stage, goals, and target audience. Track progress with AI-powered insights and recommendations."}),a.jsx(ve,{onClick:()=>r(!0),size:"lg",children:"Get Started"})]})})}),a.jsx(rAe,{})]})},SQe=()=>a.jsx(Og,{feature:"growth_lab",children:a.jsx(jQe,{})}),BQe=["Professional","Friendly","Authoritative","Playful","Empathetic","Bold","Minimalist","Inspiring","Educational","Witty","Sophisticated","Down-to-earth","Innovative","Trustworthy","Passionate"],_Qe=["Technology","Healthcare","Finance","Education","E-commerce","Marketing","Real Estate","Legal","Manufacturing","Hospitality","Entertainment","Fitness","Food & Beverage","Fashion","Non-profit"],kQe=({editingVoice:e,onClose:t,onSave:r})=>{const[n,i]=w.useState(1),[s,o]=w.useState(!1),[l,c]=w.useState(!1),{user:u}=fi(),{toast:d}=Dr(),[A,h]=w.useState((e==null?void 0:e.name)||""),[f,m]=w.useState((e==null?void 0:e.brand_name)||""),[p,g]=w.useState((e==null?void 0:e.brand_description)||""),[v,x]=w.useState((e==null?void 0:e.industry)||""),[y,b]=w.useState((e==null?void 0:e.target_audience)||""),[C,j]=w.useState((e==null?void 0:e.personality_traits)||[]),[S,T]=w.useState((e==null?void 0:e.formality_level)||3),[B,I]=w.useState((e==null?void 0:e.emotion_level)||3),[P,E]=w.useState((e==null?void 0:e.sample_content)||[""]),[M,_]=w.useState((e==null?void 0:e.always_use_words)||[]),[R,G]=w.useState((e==null?void 0:e.never_use_words)||[]),[U,Q]=w.useState(""),[z,Y]=w.useState(""),[$,O]=w.useState((e==null?void 0:e.ai_analysis)||{}),W=4,V=ie=>{C.includes(ie)?j(C.filter(ue=>ue!==ie)):C.length<5&&j([...C,ie])},X=async()=>{var ue;const ie=P.filter(Se=>Se.trim().length>50);if(ie.length===0){d({title:"Not enough content",description:"Please add at least one sample with 50+ characters",variant:"destructive"});return}c(!0);try{const{data:Se,error:D}=await Re.functions.invoke("analyze-brand-voice",{body:{samples:ie}});if(D)throw D;if(O(Se.analysis||{}),(ue=Se.analysis)!=null&&ue.suggestedTraits){const K=Se.analysis.suggestedTraits.slice(0,5);j(K)}d({title:"Analysis complete",description:"We've analyzed your writing style and applied suggestions"})}catch(Se){console.error("Error analyzing samples:",Se),d({title:"Analysis failed",description:"Could not analyze your samples. You can still save your voice.",variant:"destructive"})}finally{c(!1)}},ne=async()=>{if(u){if(!A.trim()){d({title:"Name required",description:"Please give your brand voice a name",variant:"destructive"});return}o(!0);try{if(e){const{error:ie}=await Re.from("brand_voices").update({name:A.trim(),brand_name:f.trim()||null,brand_description:p.trim()||null,industry:v||null,target_audience:y.trim()||null,personality_traits:C,formality_level:S,emotion_level:B,sample_content:P.filter(ue=>ue.trim()),always_use_words:M,never_use_words:R,ai_analysis:$}).eq("id",e.id);if(ie)throw ie}else{const{data:ie}=await Re.from("brand_voices").select("id").eq("user_id",u.id),{error:ue}=await Re.from("brand_voices").insert({user_id:u.id,name:A.trim(),brand_name:f.trim()||null,brand_description:p.trim()||null,industry:v||null,target_audience:y.trim()||null,personality_traits:C,formality_level:S,emotion_level:B,sample_content:P.filter(Se=>Se.trim()),always_use_words:M,never_use_words:R,ai_analysis:$,is_default:!ie||ie.length===0});if(ue)throw ue}d({title:e?"Voice updated":"Voice created",description:`"${A}" has been ${e?"updated":"saved"}`}),r()}catch(ie){console.error("Error saving voice:",ie),d({title:"Error",description:"Failed to save brand voice",variant:"destructive"})}finally{o(!1)}}},oe=ie=>{ie==="always"&&U.trim()?(_([...M,U.trim()]),Q("")):ie==="never"&&z.trim()&&(G([...R,z.trim()]),Y(""))},pe=(ie,ue)=>{ie==="always"?_(M.filter(Se=>Se!==ue)):G(R.filter(Se=>Se!==ue))},de=()=>{switch(n){case 1:return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"name",children:"Voice Name *"}),a.jsx(st,{id:"name",placeholder:"e.g., My Tech Blog Voice",value:A,onChange:ie=>h(ie.target.value)}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"A name to identify this voice"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"brandName",children:"Brand/Company Name"}),a.jsx(st,{id:"brandName",placeholder:"e.g., TechCorp Inc.",value:f,onChange:ie=>m(ie.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"brandDescription",children:"Describe your brand, product, or service"}),a.jsx(Zr,{id:"brandDescription",placeholder:"e.g., An online store selling handcrafted leather bags for young professionals, or a SaaS platform that helps small businesses manage their social media...",value:p,onChange:ie=>g(ie.target.value),rows:3}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Tell us what you sell, the service you provide, or what your company does. This helps the AI create relevant content."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{children:"Industry"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:_Qe.map(ie=>a.jsx(bt,{variant:v===ie?"default":"outline",className:"cursor-pointer",onClick:()=>x(v===ie?"":ie),children:ie},ie))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"audience",children:"Target Audience"}),a.jsx(Zr,{id:"audience",placeholder:"Describe your ideal reader/customer...",value:y,onChange:ie=>b(ie.target.value),rows:3})]})]});case 2:return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(Pe,{children:"Personality Traits (select up to 5)"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:BQe.map(ie=>a.jsx(bt,{variant:C.includes(ie)?"default":"outline",className:"cursor-pointer",onClick:()=>V(ie),children:ie},ie))}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[C.length,"/5 traits selected"]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx(Pe,{children:"Formality Level"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("span",{className:"text-sm text-muted-foreground w-20",children:"Casual"}),a.jsx(d_,{value:[S],onValueChange:ie=>T(ie[0]),min:1,max:5,step:1,className:"flex-1"}),a.jsx("span",{className:"text-sm text-muted-foreground w-20 text-right",children:"Formal"})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(Pe,{children:"Emotional Expression"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("span",{className:"text-sm text-muted-foreground w-20",children:"Reserved"}),a.jsx(d_,{value:[B],onValueChange:ie=>I(ie[0]),min:1,max:5,step:1,className:"flex-1"}),a.jsx("span",{className:"text-sm text-muted-foreground w-20 text-right",children:"Expressive"})]})]})]})]});case 3:return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Pe,{children:"Sample Content (Optional)"}),a.jsxs(ve,{variant:"outline",size:"sm",onClick:X,disabled:l||!P.some(ie=>ie.trim().length>50),className:"gap-2",children:[l?a.jsx(Nl,{className:"h-4 w-4 animate-spin"}):a.jsx(Do,{className:"h-4 w-4"}),"Analyze Writing Style"]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Paste examples of your existing content so AI can learn your style"})]}),P.map((ie,ue)=>a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(Pe,{children:["Sample ",ue+1]}),P.length>1&&a.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>E(P.filter((Se,D)=>D!==ue)),children:a.jsx(ml,{className:"h-4 w-4"})})]}),a.jsx(Zr,{placeholder:"Paste a sample of your writing here...",value:ie,onChange:Se=>{const D=[...P];D[ue]=Se.target.value,E(D)},rows:4})]},ue)),P.length<3&&a.jsxs(ve,{variant:"outline",onClick:()=>E([...P,""]),className:"w-full gap-2",children:[a.jsx(Xi,{className:"h-4 w-4"}),"Add Another Sample"]}),Object.keys($).length>0&&a.jsxs(_e,{className:"bg-primary/5 border-primary/20",children:[a.jsx(ot,{className:"pb-2",children:a.jsxs(lt,{className:"text-sm flex items-center gap-2",children:[a.jsx(Do,{className:"h-4 w-4"}),"AI Analysis Results"]})}),a.jsxs(Ge,{className:"text-sm space-y-2",children:[$.summary&&a.jsx("p",{children:$.summary}),$.suggestedTraits&&a.jsx("div",{className:"flex flex-wrap gap-1",children:($.suggestedTraits||[]).map(ie=>a.jsx(bt,{variant:"secondary",children:ie},ie))})]})]})]});case 4:return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(Pe,{children:"Words & Phrases to Always Use"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(st,{placeholder:"e.g., innovative, transform...",value:U,onChange:ie=>Q(ie.target.value),onKeyDown:ie=>ie.key==="Enter"&&oe("always")}),a.jsx(ve,{onClick:()=>oe("always"),variant:"outline",children:a.jsx(Xi,{className:"h-4 w-4"})})]}),M.length>0&&a.jsx("div",{className:"flex flex-wrap gap-2",children:M.map(ie=>a.jsxs(bt,{variant:"secondary",className:"gap-1",children:[ie,a.jsx(ml,{className:"h-3 w-3 cursor-pointer",onClick:()=>pe("always",ie)})]},ie))})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(Pe,{children:"Words & Phrases to Never Use"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(st,{placeholder:"e.g., cheap, maybe...",value:z,onChange:ie=>Y(ie.target.value),onKeyDown:ie=>ie.key==="Enter"&&oe("never")}),a.jsx(ve,{onClick:()=>oe("never"),variant:"outline",children:a.jsx(Xi,{className:"h-4 w-4"})})]}),R.length>0&&a.jsx("div",{className:"flex flex-wrap gap-2",children:R.map(ie=>a.jsxs(bt,{variant:"destructive",className:"gap-1",children:[ie,a.jsx(ml,{className:"h-3 w-3 cursor-pointer",onClick:()=>pe("never",ie)})]},ie))})]}),a.jsxs(_e,{className:"bg-muted/50",children:[a.jsx(ot,{className:"pb-2",children:a.jsx(lt,{className:"text-sm",children:"Voice Summary"})}),a.jsxs(Ge,{className:"text-sm space-y-2",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:"Name:"}),a.jsx("span",{className:"font-medium",children:A||"Not set"})]}),f&&a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:"Brand:"}),a.jsx("span",{className:"font-medium",children:f})]}),p&&a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:"Description:"}),a.jsx("span",{className:"font-medium line-clamp-2",children:p})]}),v&&a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:"Industry:"}),a.jsx("span",{className:"font-medium",children:v})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:"Traits:"}),a.jsx("span",{className:"font-medium",children:C.length>0?C.join(", "):"None selected"})]})]})]})]});default:return null}},ge=[{title:"Brand Basics",description:"Define your brand identity"},{title:"Voice Characteristics",description:"Set your tone and personality"},{title:"Sample Content",description:"Help AI learn your style"},{title:"Words & Phrases",description:"Fine-tune your vocabulary"}];return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(ve,{variant:"ghost",size:"icon",onClick:t,children:a.jsx(Cl,{className:"h-4 w-4"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold",children:e?"Edit Brand Voice":"Create Brand Voice"}),a.jsxs("p",{className:"text-muted-foreground",children:["Step ",n," of ",W,": ",ge[n-1].description]})]})]}),a.jsx("div",{className:"flex items-center justify-between",children:ge.map((ie,ue)=>a.jsxs("div",{className:`flex items-center ${ueue+1||n===ue+1?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:n>ue+1?a.jsx(dr,{className:"h-4 w-4"}):ue+1}),a.jsx("span",{className:"text-xs mt-1 hidden sm:block",children:ie.title})]}),ueue+1?"bg-primary":"bg-muted"}`})]},ue))}),a.jsxs(_e,{children:[a.jsxs(ot,{children:[a.jsx(lt,{children:ge[n-1].title}),a.jsx(Mr,{children:ge[n-1].description})]}),a.jsx(Ge,{children:de()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsxs(ve,{variant:"outline",onClick:()=>i(n-1),disabled:n===1,children:[a.jsx(Cl,{className:"h-4 w-4 mr-2"}),"Previous"]}),ni(n+1),children:["Next",a.jsx(Di,{className:"h-4 w-4 ml-2"})]}):a.jsxs(ve,{onClick:ne,disabled:s||!A.trim(),children:[s?a.jsx(Nl,{className:"h-4 w-4 mr-2 animate-spin"}):a.jsx(dr,{className:"h-4 w-4 mr-2"}),e?"Update Voice":"Create Voice"]})]})]})},EQe=()=>{const[e,t]=w.useState([]),[r,n]=w.useState(!0),[i,s]=w.useState(!1),[o,l]=w.useState(null),[c,u]=w.useState(!1),[d,A]=w.useState(null),[h,f]=w.useState(!1),{user:m}=fi();Ua();const{hasTierAccess:p}=GU(),{toast:g}=Dr(),v=p("multiple_brand_voices"),x=v?1/0:1,y=async()=>{if(m)try{const{data:B,error:I}=await Re.from("brand_voices").select("*").eq("user_id",m.id).order("created_at",{ascending:!1});if(I)throw I;t(B||[])}catch(B){console.error("Error fetching brand voices:",B),g({title:"Error",description:"Failed to load brand voices",variant:"destructive"})}finally{n(!1)}};w.useEffect(()=>{y()},[m]);const b=async B=>{if(m)try{await Re.from("brand_voices").update({is_default:!1}).eq("user_id",m.id);const{error:I}=await Re.from("brand_voices").update({is_default:!0}).eq("id",B);if(I)throw I;g({title:"Default voice updated",description:"This voice will now be used for new content generation"}),y()}catch(I){console.error("Error setting default voice:",I),g({title:"Error",description:"Failed to set default voice",variant:"destructive"})}},C=async()=>{if(d)try{const{error:B}=await Re.from("brand_voices").delete().eq("id",d.id);if(B)throw B;g({title:"Voice deleted",description:"Brand voice has been removed"}),u(!1),A(null),y()}catch(B){console.error("Error deleting voice:",B),g({title:"Error",description:"Failed to delete brand voice",variant:"destructive"})}},j=()=>{if(e.length>=x){f(!0);return}l(null),s(!0)},S=B=>["Very Casual","Casual","Balanced","Formal","Very Formal"][B-1]||"Balanced",T=B=>["Reserved","Measured","Balanced","Expressive","Very Expressive"][B-1]||"Balanced";return i?a.jsx(kQe,{editingVoice:o,onClose:()=>{s(!1),l(null)},onSave:()=>{s(!1),l(null),y()}}):a.jsxs("div",{className:"container mx-auto p-6 max-w-5xl",children:[a.jsx("div",{className:"mb-8",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-3 bg-primary rounded-xl",children:a.jsx(Tx,{className:"h-8 w-8 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-4xl font-bold text-primary",children:"Brand Voice"}),a.jsx("p",{className:"text-muted-foreground",children:"Define your brand voice and have all generated content match it automatically"})]})]}),a.jsxs(ve,{onClick:j,className:"gap-2",children:[a.jsx(Xi,{className:"h-4 w-4"}),"Create Voice"]})]})}),a.jsxs("div",{className:"space-y-6",children:[a.jsx(_e,{className:"bg-muted/50",children:a.jsxs(Ge,{className:"flex items-center justify-between py-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Tx,{className:"h-5 w-5 text-primary"}),a.jsx("span",{className:"text-sm",children:v?a.jsx("span",{children:"Unlimited brand voices available"}):a.jsxs("span",{children:[e.length," of ",x," voice used"]})})]}),!v&&e.length>0&&a.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>f(!0),className:"gap-2",children:[a.jsx(ru,{className:"h-4 w-4"}),"Upgrade for Multiple Voices"]})]})}),r?a.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(B=>a.jsxs(_e,{className:"animate-pulse",children:[a.jsxs(ot,{children:[a.jsx("div",{className:"h-6 bg-muted rounded w-2/3"}),a.jsx("div",{className:"h-4 bg-muted rounded w-1/2 mt-2"})]}),a.jsx(Ge,{children:a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"h-4 bg-muted rounded"}),a.jsx("div",{className:"h-4 bg-muted rounded w-3/4"})]})})]},B))}):e.length===0?a.jsx(_e,{className:"border-dashed",children:a.jsxs(Ge,{className:"flex flex-col items-center justify-center py-12",children:[a.jsx(Tx,{className:"h-12 w-12 text-muted-foreground mb-4"}),a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No brand voices yet"}),a.jsx("p",{className:"text-muted-foreground text-center mb-4 max-w-sm",children:"Create your first brand voice to ensure all your content sounds consistent and on-brand"}),a.jsxs(ve,{onClick:j,className:"gap-2",children:[a.jsx(Xi,{className:"h-4 w-4"}),"Create Your First Voice"]})]})}):a.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(B=>a.jsxs(_e,{className:B.is_default?"border-primary":"",children:[a.jsx(ot,{children:a.jsx("div",{className:"flex items-start justify-between",children:a.jsxs("div",{children:[a.jsxs(lt,{className:"flex items-center gap-2",children:[B.name,B.is_default&&a.jsxs(bt,{variant:"default",className:"gap-1",children:[a.jsx(eg,{className:"h-3 w-3"}),"Default"]})]}),a.jsx(Mr,{className:"mt-1",children:B.brand_name||"No brand name set"})]})})}),a.jsxs(Ge,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2 text-sm",children:[B.industry&&a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:"Industry:"}),a.jsx("span",{className:"font-medium",children:B.industry})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:"Formality:"}),a.jsx("span",{className:"font-medium",children:S(B.formality_level)})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:"Expression:"}),a.jsx("span",{className:"font-medium",children:T(B.emotion_level)})]})]}),B.personality_traits&&B.personality_traits.length>0&&a.jsxs("div",{className:"flex flex-wrap gap-1",children:[B.personality_traits.slice(0,3).map(I=>a.jsx(bt,{variant:"secondary",className:"text-xs",children:I},I)),B.personality_traits.length>3&&a.jsxs(bt,{variant:"outline",className:"text-xs",children:["+",B.personality_traits.length-3]})]}),a.jsxs("div",{className:"flex gap-2 pt-2",children:[!B.is_default&&a.jsxs(ve,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>b(B.id),children:[a.jsx(eg,{className:"h-4 w-4 mr-1"}),"Set Default"]}),a.jsx(ve,{variant:"outline",size:"sm",onClick:()=>{l(B),s(!0)},children:a.jsx(b0,{className:"h-4 w-4"})}),a.jsx(ve,{variant:"outline",size:"sm",onClick:()=>{A(B),u(!0)},children:a.jsx(Sl,{className:"h-4 w-4"})})]})]})]},B.id))}),a.jsx(QA,{open:c,onOpenChange:u,children:a.jsxs(fd,{children:[a.jsxs(hd,{children:[a.jsx(md,{children:"Delete Brand Voice"}),a.jsxs(gd,{children:['Are you sure you want to delete "',d==null?void 0:d.name,'"? This action cannot be undone.']})]}),a.jsxs(pd,{children:[a.jsx(xd,{children:"Cancel"}),a.jsx(vd,{onClick:C,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),a.jsx(Hh,{open:h,onOpenChange:f})]})]})},TQe=()=>a.jsx(Og,{feature:"brand_voice",children:a.jsx(EQe,{})}),PQe=[{id:"twitter_thread",name:"Twitter/X Thread",icon:a.jsx(S6,{className:"h-4 w-4"}),description:"Split into numbered tweets"},{id:"linkedin_post",name:"LinkedIn Post",icon:a.jsx(xC,{className:"h-4 w-4"}),description:"Professional tone with hashtags"},{id:"email_newsletter",name:"Email Newsletter",icon:a.jsx(jl,{className:"h-4 w-4"}),description:"With subject line"},{id:"instagram_caption",name:"Instagram Caption",icon:a.jsx($5,{className:"h-4 w-4"}),description:"With hashtag suggestions"},{id:"facebook_post",name:"Facebook Post",icon:a.jsx(b6,{className:"h-4 w-4"}),description:"Engaging social content"},{id:"youtube_description",name:"YouTube Description",icon:a.jsx(V5,{className:"h-4 w-4"}),description:"Optimized for search"},{id:"tiktok_script",name:"TikTok Script",icon:a.jsx(Ex,{className:"h-4 w-4"}),description:"Short-form video script"},{id:"blog_summary",name:"Blog Summary",icon:a.jsx(ai,{className:"h-4 w-4"}),description:"Condensed version"}],IQe=({selected:e,onChange:t,maxFormats:r=5})=>{const n=i=>{e.includes(i)?t(e.filter(s=>s!==i)):e.length{const s=e.includes(i.id),o=!s&&e.length>=r;return a.jsx("div",{onClick:()=>!o&&n(i.id),className:` p-3 rounded-lg border cursor-pointer transition-all ${s?"border-primary bg-primary/5":o?"border-muted bg-muted/50 cursor-not-allowed opacity-50":"border-border hover:border-primary/50 hover:bg-muted/50"} `,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:`${s?"text-primary":"text-muted-foreground"}`,children:i.icon}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:`text-sm font-medium truncate ${s?"text-primary":""}`,children:i.name}),a.jsx("div",{className:"text-xs text-muted-foreground truncate",children:i.description})]}),s&&a.jsx(bt,{variant:"default",className:"shrink-0",children:"✓"})]})},i.id)})})]})},_I={twitter_thread:{icon:a.jsx(S6,{className:"h-4 w-4"}),label:"Twitter/X Thread",color:"bg-sky-500"},linkedin_post:{icon:a.jsx(xC,{className:"h-4 w-4"}),label:"LinkedIn Post",color:"bg-blue-600"},email_newsletter:{icon:a.jsx(jl,{className:"h-4 w-4"}),label:"Email Newsletter",color:"bg-amber-500"},instagram_caption:{icon:a.jsx($5,{className:"h-4 w-4"}),label:"Instagram Caption",color:"bg-pink-500"},facebook_post:{icon:a.jsx(b6,{className:"h-4 w-4"}),label:"Facebook Post",color:"bg-blue-500"},youtube_description:{icon:a.jsx(V5,{className:"h-4 w-4"}),label:"YouTube Description",color:"bg-red-500"},tiktok_script:{icon:a.jsx(Ex,{className:"h-4 w-4"}),label:"TikTok Script",color:"bg-gray-900"},blog_summary:{icon:a.jsx(ai,{className:"h-4 w-4"}),label:"Blog Summary",color:"bg-emerald-500"}},OQe=({results:e,onReset:t,sourceTitle:r})=>{const[n,i]=w.useState(null),[s,o]=w.useState({}),[l,c]=w.useState(null),{toast:u}=Dr(),d=async(m,p)=>{var g;try{await navigator.clipboard.writeText(s[m]||p),c(m),setTimeout(()=>c(null),2e3),u({title:"Copied!",description:`${((g=_I[m])==null?void 0:g.label)||m} content copied to clipboard`})}catch{u({title:"Copy failed",description:"Could not copy to clipboard",variant:"destructive"})}},A=(m,p)=>{i(m),s[m]||o({...s,[m]:p})},h=m=>{i(null),u({title:"Changes saved",description:"Your edits have been saved locally"})},f=m=>s[m.platform]||m.content;return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(ve,{variant:"ghost",size:"icon",onClick:t,children:a.jsx(Cl,{className:"h-4 w-4"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Remix Results"}),a.jsxs("p",{className:"text-muted-foreground",children:[e.length,' versions created from "',r,'"']})]})]}),a.jsxs(ve,{onClick:t,variant:"outline",className:"gap-2",children:[a.jsx(RB,{className:"h-4 w-4"}),"Remix Again"]})]}),a.jsx("div",{className:"flex flex-wrap gap-2",children:e.map(m=>{const p=_I[m.platform];return a.jsxs(bt,{variant:"secondary",className:`gap-1 ${p==null?void 0:p.color} text-white`,children:[p==null?void 0:p.icon,(p==null?void 0:p.label)||m.platform]},m.platform)})}),a.jsx(xoe,{type:"multiple",defaultValue:e.map(m=>m.platform),className:"space-y-4",children:e.map(m=>{const p=_I[m.platform],g=n===m.platform,v=f(m);return a.jsxs(RU,{value:m.platform,className:"border rounded-lg",children:[a.jsx(UU,{className:"px-4 hover:no-underline",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`p-2 rounded-md ${p==null?void 0:p.color} text-white`,children:p==null?void 0:p.icon}),a.jsxs("div",{className:"text-left",children:[a.jsx("div",{className:"font-medium",children:(p==null?void 0:p.label)||m.platform}),a.jsxs("div",{className:"text-xs text-muted-foreground",children:[v.length," characters"]})]})]})}),a.jsx(QU,{className:"px-4 pb-4",children:a.jsxs("div",{className:"space-y-4",children:[g?a.jsx(Zr,{value:s[m.platform]||m.content,onChange:x=>o({...s,[m.platform]:x.target.value}),rows:10,className:"font-mono text-sm"}):a.jsx("div",{className:"p-4 bg-muted rounded-md whitespace-pre-wrap text-sm",children:v}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ve,{variant:"outline",size:"sm",onClick:()=>d(m.platform,m.content),className:"gap-2",children:l===m.platform?a.jsxs(a.Fragment,{children:[a.jsx(dr,{className:"h-4 w-4 text-green-500"}),"Copied!"]}):a.jsxs(a.Fragment,{children:[a.jsx(zl,{className:"h-4 w-4"}),"Copy"]})}),g?a.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>h(m.platform),className:"gap-2",children:[a.jsx(Mh,{className:"h-4 w-4"}),"Save"]}):a.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>A(m.platform,m.content),className:"gap-2",children:[a.jsx(hwe,{className:"h-4 w-4"}),"Edit"]})]})]})})]},m.platform)})})]})},FQe=()=>{const[e,t]=w.useState("library"),[r,n]=w.useState(null),[i,s]=w.useState(""),[o,l]=w.useState([]),[c,u]=w.useState(null),[d,A]=w.useState([]),[h,f]=w.useState(""),[m,p]=w.useState(!1),[g,v]=w.useState(null),[x,y]=w.useState(!0),{user:b}=fi(),{usageData:C,getRemainingCredits:j,refreshUsage:S}=Ua(),{toast:T}=Dr(),B=j(),I=B&&B.remaining>=2;w.useEffect(()=>{(async()=>{if(b)try{const{data:U,error:Q}=await Re.from("blog_posts").select("id, title, content, content_type, created_at").eq("user_id",b.id).order("created_at",{ascending:!1});if(Q)throw Q;A(U||[])}catch(U){console.error("Error fetching library posts:",U)}finally{y(!1)}})()},[b]);const P=d.filter(G=>G.title.toLowerCase().includes(h.toLowerCase())),E=e==="library"?r?zw(r.content||""):"":i,M=E.trim().length>50&&o.length>0&&I,_=async()=>{var G;if(!(!b||!M)){p(!0),v(null);try{const{data:U,error:Q}=await Re.functions.invoke("remix-content",{body:{sourceContent:E,sourceContentId:e==="library"?r==null?void 0:r.id:null,sourceType:e,targetFormats:o,brandVoiceId:c}});if(Q)throw Q;if(U.error)throw new Error(U.error);v(U.outputs||[]),S(),T({title:"Content remixed!",description:`Created ${((G=U.outputs)==null?void 0:G.length)||0} versions using 2 credits`})}catch(U){console.error("Error remixing content:",U),T({title:"Remix failed",description:U.message||"Could not remix your content. Please try again.",variant:"destructive"})}finally{p(!1)}}},R=()=>{v(null),l([]),e==="paste"?s(""):n(null)};return g?a.jsx(OQe,{results:g,onReset:R,sourceTitle:(r==null?void 0:r.title)||"Pasted Content"}):a.jsxs(a.Fragment,{children:[m&&a.jsx(id,{contentType:"Remixed Content"}),a.jsxs("div",{className:"container mx-auto p-6 max-w-5xl",children:[a.jsx("div",{className:"mb-8",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-3 bg-primary rounded-xl",children:a.jsx(RB,{className:"h-8 w-8 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-4xl font-bold text-primary",children:"Remix"}),a.jsx("p",{className:"text-muted-foreground",children:"Transform one piece of content into multiple formats for different platforms"})]})]})}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs(Z1,{className:I?"bg-primary/5 border-primary/20":"bg-destructive/5 border-destructive/20",children:[a.jsx(ln,{className:`h-4 w-4 ${I?"text-primary":"text-destructive"}`}),a.jsxs(e2,{className:"flex items-center justify-between",children:[a.jsxs("span",{children:["This will use ",a.jsx("strong",{children:"2 credits"})," regardless of how many formats you select"]}),a.jsxs("span",{className:`font-medium ${I?"text-primary":"text-destructive"}`,children:[(B==null?void 0:B.remaining)||0," credits remaining"]})]})]}),a.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[a.jsxs(_e,{children:[a.jsxs(ot,{children:[a.jsx(lt,{children:"Source Content"}),a.jsx(Mr,{children:"Select content from your library or paste new content"})]}),a.jsx(Ge,{children:a.jsxs(LC,{value:e,onValueChange:G=>t(G),children:[a.jsxs(L0,{className:"grid w-full grid-cols-2 mb-4",children:[a.jsx(vl,{value:"library",children:"From Library"}),a.jsx(vl,{value:"paste",children:"Paste Content"})]}),a.jsxs(xl,{value:"library",className:"space-y-4",children:[a.jsx(st,{placeholder:"Search your content...",value:h,onChange:G=>f(G.target.value)}),a.jsx("div",{className:"max-h-64 overflow-y-auto space-y-2",children:x?a.jsx("div",{className:"text-center py-4 text-muted-foreground",children:"Loading..."}):P.length===0?a.jsx("div",{className:"text-center py-4 text-muted-foreground",children:d.length===0?"No content in your library yet":"No matching content found"}):P.map(G=>a.jsx(_e,{className:`cursor-pointer transition-colors ${(r==null?void 0:r.id)===G.id?"border-primary bg-primary/5":"hover:border-primary/50"}`,onClick:()=>n(G),children:a.jsxs(Ge,{className:"p-3",children:[a.jsx("div",{className:"font-medium truncate",children:G.title}),a.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[G.content_type," • ",new Date(G.created_at).toLocaleDateString()]})]})},G.id))}),r&&a.jsxs("div",{className:"p-3 bg-muted rounded-md",children:[a.jsx(Pe,{className:"text-xs text-muted-foreground",children:"Selected:"}),a.jsx("p",{className:"font-medium truncate",children:r.title})]})]}),a.jsxs(xl,{value:"paste",className:"space-y-4",children:[a.jsx(Zr,{placeholder:"Paste your content here (minimum 50 characters)...",value:i,onChange:G=>s(G.target.value),rows:10,className:"resize-none"}),a.jsxs("div",{className:"text-xs text-muted-foreground text-right",children:[i.length," characters",i.length>0&&i.length<50&&a.jsx("span",{className:"text-destructive ml-2",children:"(minimum 50 required)"})]})]})]})})]}),a.jsxs(_e,{children:[a.jsxs(ot,{children:[a.jsx(lt,{children:"Output Formats"}),a.jsx(Mr,{children:"Select up to 5 platforms to remix your content for"})]}),a.jsxs(Ge,{className:"space-y-6",children:[a.jsx(IQe,{selected:o,onChange:l,maxFormats:5}),a.jsx(tAe,{value:c,onChange:u})]})]})]}),a.jsx("div",{className:"flex justify-center",children:a.jsx(ve,{size:"lg",onClick:_,disabled:!M||m,className:"gap-2 px-8",children:m?a.jsxs(a.Fragment,{children:[a.jsx(Nl,{className:"h-4 w-4 animate-spin"}),"Remixing..."]}):a.jsxs(a.Fragment,{children:[a.jsx(RB,{className:"h-4 w-4"}),"Remix Content (2 Credits)"]})})}),!I&&a.jsxs(Z1,{variant:"destructive",children:[a.jsx(H5,{className:"h-4 w-4"}),a.jsx(e2,{children:"You need at least 2 credits to remix content. Please upgrade your plan."})]})]})]})]})},LQe=()=>a.jsx(Og,{feature:"remix",children:a.jsx(FQe,{})});function MQe({open:e,onOpenChange:t,editingConnection:r,onSaved:n}){const[i,s]=w.useState(""),[o,l]=w.useState(""),[c,u]=w.useState(""),[d,A]=w.useState(""),[h,f]=w.useState(!1),[m,p]=w.useState(!1),[g,v]=w.useState(!1),{toast:x}=Dr(),{user:y}=fi(),b=!!r;w.useEffect(()=>{e&&(r?(s(r.site_name),l(r.site_url),u(r.username),A("")):C())},[e,r]);const C=()=>{s(""),l(""),u(""),A(""),f(!1)},j=I=>{let P=I.trim();return P.endsWith("/")&&(P=P.slice(0,-1)),!P.startsWith("http://")&&!P.startsWith("https://")&&(P="https://"+P),P},S=()=>i.trim()?o.trim()?j(o).startsWith("https://")?c.trim()?!b&&!d.trim()?(x({title:"Missing Application Password",description:"Please enter your WordPress application password.",variant:"destructive"}),!1):!0:(x({title:"Missing Username",description:"Please enter your WordPress username.",variant:"destructive"}),!1):(x({title:"HTTPS Required",description:"WordPress site must use HTTPS for secure connections.",variant:"destructive"}),!1):(x({title:"Missing Site URL",description:"Please enter your WordPress site URL.",variant:"destructive"}),!1):(x({title:"Missing Site Name",description:"Please enter a name for this WordPress site.",variant:"destructive"}),!1),T=async()=>{if(!S()||!y)return;p(!0);const I=j(o);try{const P=`${I}/wp-json/wp/v2/users/me`,M=await fetch(P,{method:"GET",headers:{Authorization:"Basic "+btoa(`${c}:${d||"test"}`)}});if(!M.ok&&M.status!==0&&M.status===401){x({title:"Authentication Failed",description:"Invalid username or application password. Please check your credentials.",variant:"destructive"}),p(!1);return}}catch{console.log("Connection test encountered CORS - proceeding with save")}p(!1),v(!0);try{const P={site_name:i.trim(),site_url:I,username:c.trim(),is_active:!0};if(d.trim()&&(P.app_password=d.trim()),b){const{error:E}=await Re.from("wordpress_connections").update(P).eq("id",r.id);if(E)throw E;x({title:"Connection Updated",description:`${i} has been updated.`})}else{P.user_id=y.id,P.app_password=d.trim();const{error:E}=await Re.from("wordpress_connections").insert(P);if(E)throw E;x({title:"Connection Added",description:`${i} has been connected successfully.`})}n()}catch(P){console.error("Error saving connection:",P),x({title:"Error",description:P.message||"Failed to save WordPress connection.",variant:"destructive"})}finally{v(!1)}},B=m||g;return a.jsx(Mi,{open:e,onOpenChange:t,children:a.jsxs(yi,{className:"sm:max-w-md",children:[a.jsxs(bi,{children:[a.jsxs(wi,{className:"flex items-center gap-2",children:[a.jsx(Hs,{className:"h-5 w-5 text-primary"}),b?"Edit WordPress Site":"Add WordPress Site"]}),a.jsx(Qo,{children:b?"Update your WordPress connection settings.":"Connect your WordPress site to publish content directly."})]}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"siteName",children:"Site Name (for your reference)"}),a.jsx(st,{id:"siteName",placeholder:"My Personal Blog",value:i,onChange:I=>s(I.target.value),disabled:B})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"siteUrl",children:"WordPress Site URL"}),a.jsx(st,{id:"siteUrl",placeholder:"https://myblog.com",value:o,onChange:I=>l(I.target.value),disabled:B}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter your WordPress site URL (must use HTTPS)"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"username",children:"WordPress Username"}),a.jsx(st,{id:"username",placeholder:"admin",value:c,onChange:I=>u(I.target.value),disabled:B})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Pe,{htmlFor:"appPassword",children:["Application Password",b&&a.jsx("span",{className:"text-muted-foreground font-normal ml-2",children:"(leave empty to keep current)"})]}),a.jsxs("div",{className:"relative",children:[a.jsx(st,{id:"appPassword",type:h?"text":"password",placeholder:b?"••••••••••••••••":"xxxx xxxx xxxx xxxx xxxx xxxx",value:d,onChange:I=>A(I.target.value),disabled:B,className:"pr-10"}),a.jsx(ve,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 hover:bg-transparent",onClick:()=>f(!h),disabled:B,children:h?a.jsx(Rbe,{className:"h-4 w-4 text-muted-foreground"}):a.jsx(Zh,{className:"h-4 w-4 text-muted-foreground"})})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Generated from WordPress: Users → Profile → Application Passwords"})]})]}),a.jsxs(nd,{className:"gap-2 sm:gap-0",children:[a.jsx(ve,{variant:"outline",onClick:()=>t(!1),disabled:B,children:"Cancel"}),a.jsx(ve,{onClick:T,disabled:B,children:B?a.jsxs(a.Fragment,{children:[a.jsx(Nl,{className:"h-4 w-4 mr-2 animate-spin"}),m?"Testing...":"Saving..."]}):b?"Save Changes":"Test & Save Connection"})]})]})})}function DQe({onBack:e,initialShowAddDialog:t=!1,onDialogClose:r}){const[n,i]=w.useState([]),[s,o]=w.useState(!0),[l,c]=w.useState(t),[u,d]=w.useState(null),[A,h]=w.useState(null),[f,m]=w.useState(null),{toast:p}=Dr(),{user:g}=fi();w.useEffect(()=>{g&&v()},[g]),w.useEffect(()=>{t&&c(!0)},[t]);const v=async()=>{try{o(!0);const{data:S,error:T}=await Re.from("wordpress_connections").select("*").order("created_at",{ascending:!1});if(T)throw T;i(S||[])}catch(S){console.error("Error fetching WordPress connections:",S),p({title:"Error",description:"Failed to load WordPress connections.",variant:"destructive"})}finally{o(!1)}},x=async S=>{h(S.id);try{const T=`${S.site_url}/wp-json/wp/v2/posts?per_page=1`,B=await fetch(T,{method:"GET",headers:{Authorization:"Basic "+btoa(`${S.username}:placeholder`)}});if(B.ok||B.status===401)p({title:"Connection Valid",description:`WordPress REST API is accessible at ${S.site_url}`});else throw new Error("WordPress REST API not accessible")}catch{p({title:"Connection Issue",description:"Could not verify the WordPress REST API. This may be due to CORS restrictions - the connection might still work for publishing.",variant:"destructive"})}finally{h(null)}},y=async()=>{if(f)try{const{error:S}=await Re.from("wordpress_connections").delete().eq("id",f);if(S)throw S;i(T=>T.filter(B=>B.id!==f)),p({title:"Connection Removed",description:"WordPress site has been disconnected."})}catch(S){console.error("Error deleting connection:",S),p({title:"Error",description:"Failed to remove connection.",variant:"destructive"})}finally{m(null)}},b=()=>{c(!1),d(null),r==null||r()},C=()=>{v(),b()},j=S=>{if(!S)return"Never published";const T=new Date(S),I=Math.floor((new Date().getTime()-T.getTime())/(1e3*60*60*24));return I===0?"Today":I===1?"Yesterday":I<7?`${I} days ago`:T.toLocaleDateString()};return a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center gap-4",children:a.jsxs(ve,{variant:"ghost",size:"sm",onClick:e,children:[a.jsx(Cl,{className:"h-4 w-4 mr-2"}),"Back to Integrations"]})}),a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[a.jsx(Hs,{className:"h-6 w-6 text-primary"}),"WordPress Integration"]}),a.jsx("p",{className:"text-muted-foreground",children:"Publish your generated content directly to WordPress"})]}),a.jsxs(ve,{onClick:()=>c(!0),children:[a.jsx(Xi,{className:"h-4 w-4 mr-2"}),"Add WordPress Site"]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h2",{className:"text-lg font-semibold",children:"Connected Sites"}),s?a.jsx(_e,{children:a.jsx(Ge,{className:"py-8 text-center text-muted-foreground",children:"Loading connections..."})}):n.length===0?a.jsx(_e,{className:"border-dashed",children:a.jsxs(Ge,{className:"py-12 text-center",children:[a.jsx(Hs,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),a.jsx("h3",{className:"font-semibold mb-2",children:"No WordPress sites connected"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Add your first WordPress site to start publishing content directly."}),a.jsxs(ve,{onClick:()=>c(!0),children:[a.jsx(Xi,{className:"h-4 w-4 mr-2"}),"Add WordPress Site"]})]})}):a.jsx("div",{className:"space-y-3",children:n.map(S=>a.jsx(_e,{className:"transition-all hover:shadow-sm",children:a.jsx(Ge,{className:"p-4",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[a.jsx("div",{className:"p-2 bg-primary/10 rounded-lg",children:a.jsx(Hs,{className:"h-5 w-5 text-primary"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("h3",{className:"font-semibold truncate",children:S.site_name}),S.is_active?a.jsxs(bt,{variant:"secondary",className:"text-xs",children:[a.jsx(dr,{className:"h-3 w-3 mr-1"}),"Connected"]}):a.jsxs(bt,{variant:"outline",className:"text-xs text-muted-foreground",children:[a.jsx(ml,{className:"h-3 w-3 mr-1"}),"Inactive"]})]}),a.jsxs("a",{href:S.site_url,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-muted-foreground hover:text-primary flex items-center gap-1 mt-1",children:[S.site_url,a.jsx(Zte,{className:"h-3 w-3"})]}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Last published: ",j(S.last_published_at)]})]})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsx(ve,{variant:"outline",size:"sm",onClick:()=>x(S),disabled:A===S.id,children:A===S.id?a.jsx(Zm,{className:"h-4 w-4 animate-spin"}):"Test"}),a.jsx(ve,{variant:"ghost",size:"icon",onClick:()=>{d(S),c(!0)},children:a.jsx(z5,{className:"h-4 w-4"})}),a.jsx(ve,{variant:"ghost",size:"icon",className:"text-destructive hover:text-destructive",onClick:()=>m(S.id),children:a.jsx(Sl,{className:"h-4 w-4"})})]})]})})},S.id))})]}),a.jsxs(_e,{className:"bg-muted/30",children:[a.jsx(ot,{children:a.jsx(lt,{className:"text-base",children:"How to Get Application Password"})}),a.jsxs(Ge,{className:"text-sm text-muted-foreground space-y-2",children:[a.jsxs("ol",{className:"list-decimal list-inside space-y-1",children:[a.jsx("li",{children:"Log into your WordPress admin dashboard"}),a.jsxs("li",{children:["Go to ",a.jsx("strong",{children:"Users → Profile"})]}),a.jsx("li",{children:'Scroll to "Application Passwords" section'}),a.jsx("li",{children:'Enter "WordSmith" as the application name'}),a.jsx("li",{children:'Click "Add New Application Password"'}),a.jsx("li",{children:"Copy the generated password (it won't be shown again!)"})]}),a.jsxs("p",{className:"text-xs mt-4 pt-2 border-t",children:[a.jsx("strong",{children:"Note:"})," Application passwords require WordPress 5.6 or later. Your site must also use HTTPS."]})]})]}),a.jsx(MQe,{open:l,onOpenChange:b,editingConnection:u,onSaved:C}),a.jsx(QA,{open:!!f,onOpenChange:()=>m(null),children:a.jsxs(fd,{children:[a.jsxs(hd,{children:[a.jsx(md,{children:"Remove WordPress Connection?"}),a.jsx(gd,{children:"This will disconnect the WordPress site from your account. You can add it again later."})]}),a.jsxs(pd,{children:[a.jsx(xd,{children:"Cancel"}),a.jsx(vd,{onClick:y,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]})})]})}function RQe({icon:e,title:t,description:r,status:n,connectedCount:i=0,onManage:s,onAdd:o}){const l=n==="active";return a.jsxs(_e,{className:`relative transition-all duration-200 ${l?"hover:shadow-md hover:border-primary/30":"opacity-75"}`,children:[a.jsxs(ot,{className:"pb-3",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsx("div",{className:"p-2 bg-primary/10 rounded-lg w-fit",children:e}),l&&i>0&&a.jsxs(bt,{variant:"secondary",className:"text-xs",children:[a.jsx(dr,{className:"h-3 w-3 mr-1"}),i," connected"]}),!l&&a.jsx(bt,{variant:"outline",className:"text-xs text-muted-foreground",children:"Coming Soon"})]}),a.jsx(lt,{className:"text-lg mt-3",children:t}),a.jsx(Mr,{className:"text-sm",children:r})]}),a.jsx(Ge,{className:"pt-0",children:l?a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ve,{variant:"outline",size:"sm",onClick:s,className:"flex-1",children:"Manage"}),a.jsxs(ve,{size:"sm",onClick:o,className:"flex-1",children:[a.jsx(Di,{className:"h-4 w-4 mr-1"}),"Add Site"]})]}):a.jsx(ve,{variant:"ghost",size:"sm",className:"w-full",disabled:!0,children:"Coming Soon"})})]})}function UQe(){const[e,t]=w.useState("hub"),[r,n]=w.useState(0),[i,s]=w.useState(!1),{user:o}=fi();w.useEffect(()=>{o&&l()},[o]);const l=async()=>{try{const{count:A,error:h}=await Re.from("wordpress_connections").select("*",{count:"exact",head:!0}).eq("is_active",!0);!h&&A!==null&&n(A)}catch(A){console.error("Error fetching WordPress connections count:",A)}},c=()=>{t("wordpress")},u=()=>{t("wordpress"),s(!0)},d=()=>{t("hub"),s(!1),l()};return e==="wordpress"?a.jsx(DQe,{onBack:d,initialShowAddDialog:i,onDialogClose:()=>s(!1)}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Integrations"}),a.jsx("p",{className:"text-muted-foreground",children:"Connect your favorite platforms to publish content directly"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:a.jsx(RQe,{icon:a.jsx(Hs,{className:"h-6 w-6 text-primary"}),title:"WordPress",description:"Publish blog posts directly to your WordPress site with AI-generated featured images.",status:"active",connectedCount:r,onManage:c,onAdd:u})}),a.jsx(_e,{className:"bg-muted/30 border-dashed",children:a.jsx(Ge,{className:"py-6",children:a.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"font-semibold mb-1",children:"Need help setting up integrations?"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Check our guides for step-by-step instructions on connecting your platforms."})]}),a.jsx(ve,{variant:"outline",onClick:()=>window.open("/help-center","_blank"),children:"View Help Center"})]})})})]})}const GL=e=>e>=75?"text-green-500":e>=50?"text-yellow-500":"text-red-500",QQe=e=>e>=75?"[&>div]:bg-green-500":e>=50?"[&>div]:bg-yellow-500":"[&>div]:bg-red-500",HQe=e=>{switch(e){case"high":return"destructive";case"medium":return"secondary";default:return"outline"}};function $Qe({score:e}){const t=2*Math.PI*54,r=t-e/100*t;return a.jsxs("div",{className:"relative w-36 h-36 mx-auto",children:[a.jsxs("svg",{className:"w-full h-full -rotate-90",viewBox:"0 0 120 120",children:[a.jsx("circle",{cx:"60",cy:"60",r:"54",fill:"none",stroke:"currentColor",strokeWidth:"8",className:"text-muted/30"}),a.jsx("circle",{cx:"60",cy:"60",r:"54",fill:"none",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:t,strokeDashoffset:r,className:GL(e),style:{transition:"stroke-dashoffset 1s ease-in-out"}})]}),a.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[a.jsx("span",{className:`text-4xl font-bold ${GL(e)}`,children:e}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"/ 100"})]})]})}function Cv({label:e,score:t}){return a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-muted-foreground",children:e}),a.jsx("span",{className:`font-semibold ${GL(t)}`,children:t})]}),a.jsx(MC,{value:t,className:`h-2 ${QQe(t)}`})]})}function zQe(){var m,p;const[e,t]=w.useState(""),[r,n]=w.useState(""),[i,s]=w.useState(""),[o,l]=w.useState(""),[c,u]=w.useState(!1),[d,A]=w.useState(null),{toast:h}=Dr(),f=async()=>{if(!e.trim()||e.trim().length<50){h({title:"Content too short",description:"Please paste at least 50 characters of content.",variant:"destructive"});return}u(!0),A(null);try{const{data:{session:g}}=await Re.auth.getSession();if(!(g!=null&&g.access_token)){h({title:"Not authenticated",description:"Please sign in to use the evaluator.",variant:"destructive"});return}const{data:v,error:x}=await Re.functions.invoke("evaluate-content",{body:{content:e,keyword:r||void 0,metaDescription:i||void 0,audience:o||void 0},headers:{Authorization:`Bearer ${g.access_token}`}});if(x)throw x;if(v!=null&&v.error)throw new Error(v.error);A({overall_score:v.overall_score,seo_score:v.seo_score,geo_score:v.geo_score,readability_score:v.readability_score,structure_score:v.structure_score,engagement_score:v.engagement_score,keyword_optimization_score:v.keyword_optimization_score,suggested_keywords:v.suggested_keywords,improvements:v.improvements})}catch(g){console.error("Evaluation error:",g),h({title:"Evaluation failed",description:g.message||"Something went wrong. Please try again.",variant:"destructive"})}finally{u(!1)}};return c?a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-md",children:a.jsxs("div",{className:"relative max-w-2xl w-full mx-4 p-8 bg-card border-2 border-primary/30 rounded-3xl shadow-2xl shadow-primary/20 overflow-hidden",children:[a.jsx("div",{className:"flex justify-center mb-8",children:a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-0 animate-spin",children:a.jsx("div",{className:"h-24 w-24 border-4 border-t-primary border-r-primary/40 border-b-primary/20 border-l-primary/10 rounded-full"})}),a.jsxs("div",{className:"relative h-24 w-24 flex items-center justify-center",children:[a.jsx("div",{className:"absolute inset-2 bg-primary/20 rounded-full animate-pulse"}),a.jsx(DS,{className:"h-12 w-12 text-primary relative z-10"})]})]})}),a.jsx("h2",{className:"text-2xl font-bold text-center text-foreground mb-3",children:"Evaluating Your Content"}),a.jsx("p",{className:"text-center text-muted-foreground mb-8 animate-pulse",children:"Analyzing SEO, GEO, readability, structure, and engagement..."}),a.jsx("div",{className:"flex justify-center gap-2 mt-6",children:[0,1,2].map(g=>a.jsx("div",{className:"h-2 w-2 rounded-full bg-primary animate-pulse",style:{animationDelay:`${g*200}ms`}},g))})]})}):a.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[a.jsx(DS,{className:"h-6 w-6 text-primary"}),"Content Evaluator"]}),a.jsx("p",{className:"text-muted-foreground mt-1",children:"Paste any blog content to get an AI-powered SEO and quality analysis with actionable improvement tips."})]}),a.jsxs(_e,{children:[a.jsxs(ot,{className:"pb-4",children:[a.jsx(lt,{className:"text-lg",children:"Content to Evaluate"}),a.jsx(Mr,{children:"Paste your blog post content below. Optionally add SEO parameters for a more targeted analysis."})]}),a.jsxs(Ge,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"content",children:"Blog Content *"}),a.jsx(Zr,{id:"content",placeholder:"Paste your blog post content here...",value:e,onChange:g=>t(g.target.value),className:"min-h-[200px] resize-y"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.length," characters"]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"keyword",children:"Target Keyword"}),a.jsx(st,{id:"keyword",placeholder:"e.g. content marketing",value:r,onChange:g=>n(g.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"meta",children:"Meta Description"}),a.jsx(st,{id:"meta",placeholder:"e.g. Learn the best strategies...",value:i,onChange:g=>s(g.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{htmlFor:"audience",children:"Target Audience"}),a.jsx(st,{id:"audience",placeholder:"e.g. Small business owners",value:o,onChange:g=>l(g.target.value)})]})]}),a.jsxs(ve,{onClick:f,disabled:!e.trim()||e.trim().length<50,className:"gap-2",children:[a.jsx(Do,{className:"h-4 w-4"}),"Evaluate Content (1 credit)"]})]})]}),d&&a.jsxs("div",{className:"space-y-6 animate-in fade-in-0 slide-in-from-bottom-4 duration-500",children:[a.jsx(_e,{children:a.jsx(Ge,{className:"pt-6",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[a.jsxs("div",{className:"text-center space-y-2",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Overall Score"}),a.jsx($Qe,{score:d.overall_score}),a.jsx("p",{className:"text-sm text-muted-foreground",children:d.overall_score>=75?"Great content! Minor tweaks recommended.":d.overall_score>=50?"Good foundation. Several improvements possible.":"Needs significant improvements."})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Category Breakdown"}),a.jsx(Cv,{label:"SEO",score:d.seo_score}),a.jsx(Cv,{label:"GEO (AI Search)",score:d.geo_score}),a.jsx(Cv,{label:"Readability",score:d.readability_score}),a.jsx(Cv,{label:"Structure",score:d.structure_score}),a.jsx(Cv,{label:"Engagement",score:d.engagement_score}),a.jsx(Cv,{label:"Keyword Optimization",score:d.keyword_optimization_score})]})]})})}),((m=d.suggested_keywords)==null?void 0:m.length)>0&&a.jsxs(_e,{children:[a.jsxs(ot,{className:"pb-3",children:[a.jsxs(lt,{className:"text-lg flex items-center gap-2",children:[a.jsx(ca,{className:"h-5 w-5 text-primary"}),"Suggested Keywords"]}),a.jsx(Mr,{children:"Best keywords for this content based on topic and search intent."})]}),a.jsx(Ge,{children:a.jsx("div",{className:"flex flex-wrap gap-2",children:d.suggested_keywords.map((g,v)=>a.jsx(bt,{variant:"secondary",className:"text-sm px-3 py-1",children:g},v))})})]}),((p=d.improvements)==null?void 0:p.length)>0&&a.jsxs(_e,{children:[a.jsxs(ot,{className:"pb-3",children:[a.jsxs(lt,{className:"text-lg flex items-center gap-2",children:[a.jsx(j6,{className:"h-5 w-5 text-primary"}),"Improvement Tips"]}),a.jsx(Mr,{children:"Actionable suggestions to improve your content."})]}),a.jsx(Ge,{children:a.jsx("div",{className:"space-y-3",children:d.improvements.sort((g,v)=>{const x={high:0,medium:1,low:2};return x[g.priority]-x[v.priority]}).map((g,v)=>a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-muted/50 border border-border",children:[a.jsx(bt,{variant:HQe(g.priority),className:"mt-0.5 shrink-0 text-xs capitalize",children:g.priority}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-sm",children:g.tip}),a.jsx("p",{className:"text-xs text-muted-foreground capitalize mt-1",children:g.category})]})]},v))})})]}),a.jsxs("div",{className:"flex justify-center gap-3",children:[a.jsxs(ve,{variant:"outline",onClick:f,className:"gap-2",children:[a.jsx(vwe,{className:"h-4 w-4"}),"Re-evaluate Content"]}),a.jsxs(ve,{onClick:()=>{A(null),t(""),n(""),s(""),l("")},className:"gap-2",children:[a.jsx(DS,{className:"h-4 w-4"}),"Evaluate New Content"]})]})]})]})}function WQe(){return a.jsx(Og,{feature:"evaluator",children:a.jsx(zQe,{})})}var GQe=Array.isArray,zo=GQe,KQe=typeof cs=="object"&&cs&&cs.Object===Object&&cs,nAe=KQe,VQe=nAe,qQe=typeof self=="object"&&self&&self.Object===Object&&self,XQe=VQe||qQe||Function("return this")(),yd=XQe,YQe=yd,JQe=YQe.Symbol,WC=JQe,sG=WC,iAe=Object.prototype,ZQe=iAe.hasOwnProperty,e7e=iAe.toString,Qb=sG?sG.toStringTag:void 0;function t7e(e){var t=ZQe.call(e,Qb),r=e[Qb];try{e[Qb]=void 0;var n=!0}catch{}var i=e7e.call(e);return n&&(t?e[Qb]=r:delete e[Qb]),i}var r7e=t7e,n7e=Object.prototype,i7e=n7e.toString;function s7e(e){return i7e.call(e)}var a7e=s7e,aG=WC,o7e=r7e,l7e=a7e,c7e="[object Null]",u7e="[object Undefined]",oG=aG?aG.toStringTag:void 0;function d7e(e){return e==null?e===void 0?u7e:c7e:oG&&oG in Object(e)?o7e(e):l7e(e)}var $A=d7e;function A7e(e){return e!=null&&typeof e=="object"}var zA=A7e,f7e=$A,h7e=zA,p7e="[object Symbol]";function m7e(e){return typeof e=="symbol"||h7e(e)&&f7e(e)==p7e}var U0=m7e,g7e=zo,v7e=U0,x7e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,y7e=/^\w*$/;function b7e(e,t){if(g7e(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||v7e(e)?!0:y7e.test(e)||!x7e.test(e)||t!=null&&e in Object(t)}var J8=b7e;function w7e(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var op=w7e;const Q0=en(op);var C7e=$A,N7e=op,j7e="[object AsyncFunction]",S7e="[object Function]",B7e="[object GeneratorFunction]",_7e="[object Proxy]";function k7e(e){if(!N7e(e))return!1;var t=C7e(e);return t==S7e||t==B7e||t==j7e||t==_7e}var Z8=k7e;const rr=en(Z8);var E7e=yd,T7e=E7e["__core-js_shared__"],P7e=T7e,kI=P7e,lG=function(){var e=/[^.]+$/.exec(kI&&kI.keys&&kI.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function I7e(e){return!!lG&&lG in e}var O7e=I7e,F7e=Function.prototype,L7e=F7e.toString;function M7e(e){if(e!=null){try{return L7e.call(e)}catch{}try{return e+""}catch{}}return""}var sAe=M7e,D7e=Z8,R7e=O7e,U7e=op,Q7e=sAe,H7e=/[\\^$.*+?()[\]{}|]/g,$7e=/^\[object .+?Constructor\]$/,z7e=Function.prototype,W7e=Object.prototype,G7e=z7e.toString,K7e=W7e.hasOwnProperty,V7e=RegExp("^"+G7e.call(K7e).replace(H7e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function q7e(e){if(!U7e(e)||R7e(e))return!1;var t=D7e(e)?V7e:$7e;return t.test(Q7e(e))}var X7e=q7e;function Y7e(e,t){return e==null?void 0:e[t]}var J7e=Y7e,Z7e=X7e,eHe=J7e;function tHe(e,t){var r=eHe(e,t);return Z7e(r)?r:void 0}var Mg=tHe,rHe=Mg,nHe=rHe(Object,"create"),qE=nHe,cG=qE;function iHe(){this.__data__=cG?cG(null):{},this.size=0}var sHe=iHe;function aHe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var oHe=aHe,lHe=qE,cHe="__lodash_hash_undefined__",uHe=Object.prototype,dHe=uHe.hasOwnProperty;function AHe(e){var t=this.__data__;if(lHe){var r=t[e];return r===cHe?void 0:r}return dHe.call(t,e)?t[e]:void 0}var fHe=AHe,hHe=qE,pHe=Object.prototype,mHe=pHe.hasOwnProperty;function gHe(e){var t=this.__data__;return hHe?t[e]!==void 0:mHe.call(t,e)}var vHe=gHe,xHe=qE,yHe="__lodash_hash_undefined__";function bHe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=xHe&&t===void 0?yHe:t,this}var wHe=bHe,CHe=sHe,NHe=oHe,jHe=fHe,SHe=vHe,BHe=wHe;function H0(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t-1}var zHe=$He,WHe=XE;function GHe(e,t){var r=this.__data__,n=WHe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var KHe=GHe,VHe=EHe,qHe=DHe,XHe=QHe,YHe=zHe,JHe=KHe;function $0(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},cm=function(t){return pg(t)&&t.indexOf("%")===t.length-1},rt=function(t){return yze(t)&&!W0(t)},Nze=function(t){return fr(t)},Ts=function(t){return rt(t)||pg(t)},jze=0,Dg=function(t){var r=++jze;return"".concat(t||"").concat(r)},io=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!rt(t)&&!pg(t))return n;var s;if(cm(t)){var o=t.indexOf("%");s=r*parseFloat(t.slice(0,o))/100}else s=+t;return W0(s)&&(s=n),i&&s>r&&(s=r),s},Rf=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},Sze=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ize(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function VL(e){"@babel/helpers - typeof";return VL=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},VL(e)}var mG={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},bA=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},gG=null,TI=null,cQ=function e(t){if(t===gG&&Array.isArray(TI))return TI;var r=[];return w.Children.forEach(t,function(n){fr(n)||(pze.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),TI=r,gG=t,r};function bl(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return bA(i)}):n=[bA(t)],cQ(e).forEach(function(i){var s=yl(i,"type.displayName")||yl(i,"type.name");n.indexOf(s)!==-1&&r.push(i)}),r}function al(e,t){var r=bl(e,t);return r&&r[0]}var vG=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!rt(n)||n<=0||!rt(i)||i<=0)},Oze=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Fze=function(t){return t&&t.type&&pg(t.type)&&Oze.indexOf(t.type)>=0},pAe=function(t){return t&&VL(t)==="object"&&"clipDot"in t},Lze=function(t,r,n,i){var s,o=(s=EI==null?void 0:EI[i])!==null&&s!==void 0?s:[];return r.startsWith("data-")||!rr(t)&&(i&&o.includes(r)||kze.includes(r))||n&&lQ.includes(r)},Gt=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(w.isValidElement(t)&&(i=t.props),!Q0(i))return null;var s={};return Object.keys(i).forEach(function(o){var l;Lze((l=i)===null||l===void 0?void 0:l[o],o,r,n)&&(s[o]=i[o])}),s},qL=function e(t,r){if(t===r)return!0;var n=w.Children.count(t);if(n!==w.Children.count(r))return!1;if(n===0)return!0;if(n===1)return xG(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Qze(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function YL(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,s=e.className,o=e.style,l=e.title,c=e.desc,u=Uze(e,Rze),d=i||{width:r,height:n,x:0,y:0},A=mr("recharts-surface",s);return re.createElement("svg",XL({},Gt(u,!0,"svg"),{className:A,width:r,height:n,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),re.createElement("title",null,l),re.createElement("desc",null,c),t)}var Hze=["children","className"];function JL(){return JL=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zze(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Hr=re.forwardRef(function(e,t){var r=e.children,n=e.className,i=$ze(e,Hze),s=mr("recharts-layer",n);return re.createElement("g",JL({className:s},Gt(i,!0),{ref:t}),r)}),Jc=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;si?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var s=Array(i);++n=n?e:Kze(e,t,r)}var qze=Vze,Xze="\\ud800-\\udfff",Yze="\\u0300-\\u036f",Jze="\\ufe20-\\ufe2f",Zze="\\u20d0-\\u20ff",e9e=Yze+Jze+Zze,t9e="\\ufe0e\\ufe0f",r9e="\\u200d",n9e=RegExp("["+r9e+Xze+e9e+t9e+"]");function i9e(e){return n9e.test(e)}var mAe=i9e;function s9e(e){return e.split("")}var a9e=s9e,gAe="\\ud800-\\udfff",o9e="\\u0300-\\u036f",l9e="\\ufe20-\\ufe2f",c9e="\\u20d0-\\u20ff",u9e=o9e+l9e+c9e,d9e="\\ufe0e\\ufe0f",A9e="["+gAe+"]",ZL="["+u9e+"]",eM="\\ud83c[\\udffb-\\udfff]",f9e="(?:"+ZL+"|"+eM+")",vAe="[^"+gAe+"]",xAe="(?:\\ud83c[\\udde6-\\uddff]){2}",yAe="[\\ud800-\\udbff][\\udc00-\\udfff]",h9e="\\u200d",bAe=f9e+"?",wAe="["+d9e+"]?",p9e="(?:"+h9e+"(?:"+[vAe,xAe,yAe].join("|")+")"+wAe+bAe+")*",m9e=wAe+bAe+p9e,g9e="(?:"+[vAe+ZL+"?",ZL,xAe,yAe,A9e].join("|")+")",v9e=RegExp(eM+"(?="+eM+")|"+g9e+m9e,"g");function x9e(e){return e.match(v9e)||[]}var y9e=x9e,b9e=a9e,w9e=mAe,C9e=y9e;function N9e(e){return w9e(e)?C9e(e):b9e(e)}var j9e=N9e,S9e=qze,B9e=mAe,_9e=j9e,k9e=cAe;function E9e(e){return function(t){t=k9e(t);var r=B9e(t)?_9e(t):void 0,n=r?r[0]:t.charAt(0),i=r?S9e(r,1).join(""):t.slice(1);return n[e]()+i}}var T9e=E9e,P9e=T9e,I9e=P9e("toUpperCase"),O9e=I9e;const u4=en(O9e);function zn(e){return function(){return e}}const CAe=Math.cos,ik=Math.sin,du=Math.sqrt,sk=Math.PI,d4=2*sk,tM=Math.PI,rM=2*tM,Wp=1e-6,F9e=rM-Wp;function NAe(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return NAe;const r=10**t;return function(n){this._+=n[0];for(let i=1,s=n.length;iWp)if(!(Math.abs(A*c-u*d)>Wp)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let f=n-o,m=i-l,p=c*c+u*u,g=f*f+m*m,v=Math.sqrt(p),x=Math.sqrt(h),y=s*Math.tan((tM-Math.acos((p+h-g)/(2*v*x)))/2),b=y/x,C=y/v;Math.abs(b-1)>Wp&&this._append`L${t+b*d},${r+b*A}`,this._append`A${s},${s},0,0,${+(A*f>d*m)},${this._x1=t+C*c},${this._y1=r+C*u}`}}arc(t,r,n,i,s,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),c=n*Math.sin(i),u=t+l,d=r+c,A=1^o,h=o?i-s:s-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Wp||Math.abs(this._y1-d)>Wp)&&this._append`L${u},${d}`,n&&(h<0&&(h=h%rM+rM),h>F9e?this._append`A${n},${n},0,1,${A},${t-l},${r-c}A${n},${n},0,1,${A},${this._x1=u},${this._y1=d}`:h>Wp&&this._append`A${n},${n},0,${+(h>=tM)},${A},${this._x1=t+n*Math.cos(s)},${this._y1=r+n*Math.sin(s)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function uQ(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new M9e(t)}function dQ(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function jAe(e){this._context=e}jAe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function A4(e){return new jAe(e)}function SAe(e){return e[0]}function BAe(e){return e[1]}function _Ae(e,t){var r=zn(!0),n=null,i=A4,s=null,o=uQ(l);e=typeof e=="function"?e:e===void 0?SAe:zn(e),t=typeof t=="function"?t:t===void 0?BAe:zn(t);function l(c){var u,d=(c=dQ(c)).length,A,h=!1,f;for(n==null&&(s=i(f=o())),u=0;u<=d;++u)!(u=f;--m)l.point(y[m],b[m]);l.lineEnd(),l.areaEnd()}v&&(y[h]=+e(g,h,A),b[h]=+t(g,h,A),l.point(n?+n(g,h,A):y[h],r?+r(g,h,A):b[h]))}if(x)return l=null,x+""||null}function d(){return _Ae().defined(i).curve(o).context(s)}return u.x=function(A){return arguments.length?(e=typeof A=="function"?A:zn(+A),n=null,u):e},u.x0=function(A){return arguments.length?(e=typeof A=="function"?A:zn(+A),u):e},u.x1=function(A){return arguments.length?(n=A==null?null:typeof A=="function"?A:zn(+A),u):n},u.y=function(A){return arguments.length?(t=typeof A=="function"?A:zn(+A),r=null,u):t},u.y0=function(A){return arguments.length?(t=typeof A=="function"?A:zn(+A),u):t},u.y1=function(A){return arguments.length?(r=A==null?null:typeof A=="function"?A:zn(+A),u):r},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(r)},u.lineX1=function(){return d().x(n).y(t)},u.defined=function(A){return arguments.length?(i=typeof A=="function"?A:zn(!!A),u):i},u.curve=function(A){return arguments.length?(o=A,s!=null&&(l=o(s)),u):o},u.context=function(A){return arguments.length?(A==null?s=l=null:l=o(s=A),u):s},u}class kAe{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function D9e(e){return new kAe(e,!0)}function R9e(e){return new kAe(e,!1)}const AQ={draw(e,t){const r=du(t/sk);e.moveTo(r,0),e.arc(0,0,r,0,d4)}},U9e={draw(e,t){const r=du(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},EAe=du(1/3),Q9e=EAe*2,H9e={draw(e,t){const r=du(t/Q9e),n=r*EAe;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},$9e={draw(e,t){const r=du(t),n=-r/2;e.rect(n,n,r,r)}},z9e=.8908130915292852,TAe=ik(sk/10)/ik(7*sk/10),W9e=ik(d4/10)*TAe,G9e=-CAe(d4/10)*TAe,K9e={draw(e,t){const r=du(t*z9e),n=W9e*r,i=G9e*r;e.moveTo(0,-r),e.lineTo(n,i);for(let s=1;s<5;++s){const o=d4*s/5,l=CAe(o),c=ik(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*i,c*n+l*i)}e.closePath()}},PI=du(3),V9e={draw(e,t){const r=-du(t/(PI*3));e.moveTo(0,r*2),e.lineTo(-PI*r,-r),e.lineTo(PI*r,-r),e.closePath()}},Ml=-.5,Dl=du(3)/2,nM=1/du(12),q9e=(nM/2+1)*3,X9e={draw(e,t){const r=du(t/q9e),n=r/2,i=r*nM,s=n,o=r*nM+r,l=-s,c=o;e.moveTo(n,i),e.lineTo(s,o),e.lineTo(l,c),e.lineTo(Ml*n-Dl*i,Dl*n+Ml*i),e.lineTo(Ml*s-Dl*o,Dl*s+Ml*o),e.lineTo(Ml*l-Dl*c,Dl*l+Ml*c),e.lineTo(Ml*n+Dl*i,Ml*i-Dl*n),e.lineTo(Ml*s+Dl*o,Ml*o-Dl*s),e.lineTo(Ml*l+Dl*c,Ml*c-Dl*l),e.closePath()}};function Y9e(e,t){let r=null,n=uQ(i);e=typeof e=="function"?e:zn(e||AQ),t=typeof t=="function"?t:zn(t===void 0?64:+t);function i(){let s;if(r||(r=s=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),s)return r=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:zn(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:zn(+s),i):t},i.context=function(s){return arguments.length?(r=s??null,i):r},i}function ak(){}function ok(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function PAe(e){this._context=e}PAe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ok(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ok(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function J9e(e){return new PAe(e)}function IAe(e){this._context=e}IAe.prototype={areaStart:ak,areaEnd:ak,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ok(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Z9e(e){return new IAe(e)}function OAe(e){this._context=e}OAe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ok(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function eWe(e){return new OAe(e)}function FAe(e){this._context=e}FAe.prototype={areaStart:ak,areaEnd:ak,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function tWe(e){return new FAe(e)}function bG(e){return e<0?-1:1}function wG(e,t,r){var n=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),l=(s*i+o*n)/(n+i);return(bG(s)+bG(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(l))||0}function CG(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function II(e,t,r){var n=e._x0,i=e._y0,s=e._x1,o=e._y1,l=(s-n)/3;e._context.bezierCurveTo(n+l,i+l*t,s-l,o-l*r,s,o)}function lk(e){this._context=e}lk.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:II(this,this._t0,CG(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,II(this,CG(this,r=wG(this,e,t)),r);break;default:II(this,this._t0,r=wG(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function LAe(e){this._context=new MAe(e)}(LAe.prototype=Object.create(lk.prototype)).point=function(e,t){lk.prototype.point.call(this,t,e)};function MAe(e){this._context=e}MAe.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,s){this._context.bezierCurveTo(t,e,n,r,s,i)}};function rWe(e){return new lk(e)}function nWe(e){return new LAe(e)}function DAe(e){this._context=e}DAe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=NG(e),i=NG(t),s=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/s[t];for(s[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function sWe(e){return new f4(e,.5)}function aWe(e){return new f4(e,0)}function oWe(e){return new f4(e,1)}function Ry(e,t){if((o=e.length)>1)for(var r=1,n,i,s=e[t[0]],o,l=s.length;r=0;)r[t]=t;return r}function lWe(e,t){return e[t]}function cWe(e){const t=[];return t.key=e,t}function uWe(){var e=zn([]),t=iM,r=Ry,n=lWe;function i(s){var o=Array.from(e.apply(this,arguments),cWe),l,c=o.length,u=-1,d;for(const A of s)for(l=0,++u;l0){for(var r,n,i=0,s=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,s=n.length;r0)||!((s=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,s,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xWe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var RAe={symbolCircle:AQ,symbolCross:U9e,symbolDiamond:H9e,symbolSquare:$9e,symbolStar:K9e,symbolTriangle:V9e,symbolWye:X9e},yWe=Math.PI/180,bWe=function(t){var r="symbol".concat(u4(t));return RAe[r]||AQ},wWe=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*yWe;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},CWe=function(t,r){RAe["symbol".concat(u4(t))]=r},fQ=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,s=i===void 0?64:i,o=t.sizeType,l=o===void 0?"area":o,c=vWe(t,hWe),u=SG(SG({},c),{},{type:n,size:s,sizeType:l}),d=function(){var g=bWe(n),v=Y9e().type(g).size(wWe(s,l,n));return v()},A=u.className,h=u.cx,f=u.cy,m=Gt(u,!0);return h===+h&&f===+f&&s===+s?re.createElement("path",sM({},m,{className:mr("recharts-symbols",A),transform:"translate(".concat(h,", ").concat(f,")"),d:d()})):null};fQ.registerSymbol=CWe;function Uy(e){"@babel/helpers - typeof";return Uy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uy(e)}function aM(){return aM=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var x=f.inactive?u:f.color;return re.createElement("li",aM({className:g,style:A,key:"legend-item-".concat(m)},mg(n.props,f,m)),re.createElement(YL,{width:o,height:o,viewBox:d,style:h},n.renderIcon(f)),re.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},p?p(v,f,m):v))})}},{key:"render",value:function(){var n=this.props,i=n.payload,s=n.layout,o=n.align;if(!i||!i.length)return null;var l={padding:0,margin:0,textAlign:s==="horizontal"?o:"left"};return re.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(w.PureComponent);f2(hQ,"displayName","Legend");f2(hQ,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var IWe=YE;function OWe(){this.__data__=new IWe,this.size=0}var FWe=OWe;function LWe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var MWe=LWe;function DWe(e){return this.__data__.get(e)}var RWe=DWe;function UWe(e){return this.__data__.has(e)}var QWe=UWe,HWe=YE,$We=tQ,zWe=rQ,WWe=200;function GWe(e,t){var r=this.__data__;if(r instanceof HWe){var n=r.__data__;if(!$We||n.lengthl))return!1;var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var A=-1,h=!0,f=r&hGe?new uGe:void 0;for(s.set(e,t),s.set(t,e);++A-1&&e%1==0&&e-1&&e%1==0&&e<=vKe}var vQ=xKe,yKe=$A,bKe=vQ,wKe=zA,CKe="[object Arguments]",NKe="[object Array]",jKe="[object Boolean]",SKe="[object Date]",BKe="[object Error]",_Ke="[object Function]",kKe="[object Map]",EKe="[object Number]",TKe="[object Object]",PKe="[object RegExp]",IKe="[object Set]",OKe="[object String]",FKe="[object WeakMap]",LKe="[object ArrayBuffer]",MKe="[object DataView]",DKe="[object Float32Array]",RKe="[object Float64Array]",UKe="[object Int8Array]",QKe="[object Int16Array]",HKe="[object Int32Array]",$Ke="[object Uint8Array]",zKe="[object Uint8ClampedArray]",WKe="[object Uint16Array]",GKe="[object Uint32Array]",ei={};ei[DKe]=ei[RKe]=ei[UKe]=ei[QKe]=ei[HKe]=ei[$Ke]=ei[zKe]=ei[WKe]=ei[GKe]=!0;ei[CKe]=ei[NKe]=ei[LKe]=ei[jKe]=ei[MKe]=ei[SKe]=ei[BKe]=ei[_Ke]=ei[kKe]=ei[EKe]=ei[TKe]=ei[PKe]=ei[IKe]=ei[OKe]=ei[FKe]=!1;function KKe(e){return wKe(e)&&bKe(e.length)&&!!ei[yKe(e)]}var VKe=KKe;function qKe(e){return function(t){return e(t)}}var XAe=qKe,Ak={exports:{}};Ak.exports;(function(e,t){var r=nAe,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===n,o=s&&r.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(Ak,Ak.exports);var XKe=Ak.exports,YKe=VKe,JKe=XAe,IG=XKe,OG=IG&&IG.isTypedArray,ZKe=OG?JKe(OG):YKe,YAe=ZKe,eVe=nKe,tVe=mQ,rVe=zo,nVe=qAe,iVe=gQ,sVe=YAe,aVe=Object.prototype,oVe=aVe.hasOwnProperty;function lVe(e,t){var r=rVe(e),n=!r&&tVe(e),i=!r&&!n&&nVe(e),s=!r&&!n&&!i&&sVe(e),o=r||n||i||s,l=o?eVe(e.length,String):[],c=l.length;for(var u in e)(t||oVe.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||iVe(u,c)))&&l.push(u);return l}var cVe=lVe,uVe=Object.prototype;function dVe(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||uVe;return e===r}var AVe=dVe;function fVe(e,t){return function(r){return e(t(r))}}var JAe=fVe,hVe=JAe,pVe=hVe(Object.keys,Object),mVe=pVe,gVe=AVe,vVe=mVe,xVe=Object.prototype,yVe=xVe.hasOwnProperty;function bVe(e){if(!gVe(e))return vVe(e);var t=[];for(var r in Object(e))yVe.call(e,r)&&r!="constructor"&&t.push(r);return t}var wVe=bVe,CVe=Z8,NVe=vQ;function jVe(e){return e!=null&&NVe(e.length)&&!CVe(e)}var GC=jVe,SVe=cVe,BVe=wVe,_Ve=GC;function kVe(e){return _Ve(e)?SVe(e):BVe(e)}var h4=kVe,EVe=WGe,TVe=tKe,PVe=h4;function IVe(e){return EVe(e,PVe,TVe)}var OVe=IVe,FG=OVe,FVe=1,LVe=Object.prototype,MVe=LVe.hasOwnProperty;function DVe(e,t,r,n,i,s){var o=r&FVe,l=FG(e),c=l.length,u=FG(t),d=u.length;if(c!=d&&!o)return!1;for(var A=c;A--;){var h=l[A];if(!(o?h in t:MVe.call(t,h)))return!1}var f=s.get(e),m=s.get(t);if(f&&m)return f==t&&m==e;var p=!0;s.set(e,t),s.set(t,e);for(var g=o;++A-1}var LXe=FXe;function MXe(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=JXe){var u=t?null:XXe(e);if(u)return YXe(u);o=!1,i=qXe,c=new GXe}else c=t?[]:l;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hYe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function pYe(e){return e.value}function mYe(e,t){if(re.isValidElement(e))return re.cloneElement(e,t);if(typeof e=="function")return re.createElement(e,t);t.ref;var r=fYe(t,sYe);return re.createElement(hQ,r)}var YG=1,Um=function(e){function t(){var r;aYe(this,t);for(var n=arguments.length,i=new Array(n),s=0;sYG||Math.abs(i.height-this.lastBoundingBox.height)>YG)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Wd({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,s=i.layout,o=i.align,l=i.verticalAlign,c=i.margin,u=i.chartWidth,d=i.chartHeight,A,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&s==="vertical"){var f=this.getBBoxSnapshot();A={left:((u||0)-f.width)/2}}else A=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var m=this.getBBoxSnapshot();h={top:((d||0)-m.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Wd(Wd({},A),h)}},{key:"render",value:function(){var n=this,i=this.props,s=i.content,o=i.width,l=i.height,c=i.wrapperStyle,u=i.payloadUniqBy,d=i.payload,A=Wd(Wd({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return re.createElement("div",{className:"recharts-legend-wrapper",style:A,ref:function(f){n.wrapperNode=f}},mYe(s,Wd(Wd({},this.props),{},{payload:sfe(d,u,pYe)})))}}],[{key:"getWithHeight",value:function(n,i){var s=Wd(Wd({},this.defaultProps),n.props),o=s.layout;return o==="vertical"&&rt(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(w.PureComponent);p4(Um,"displayName","Legend");p4(Um,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var JG=WC,gYe=mQ,vYe=zo,ZG=JG?JG.isConcatSpreadable:void 0;function xYe(e){return vYe(e)||gYe(e)||!!(ZG&&e&&e[ZG])}var yYe=xYe,bYe=KAe,wYe=yYe;function lfe(e,t,r,n,i){var s=-1,o=e.length;for(r||(r=wYe),i||(i=[]);++s0&&r(l)?t>1?lfe(l,t-1,r,n,i):bYe(i,l):n||(i[i.length]=l)}return i}var cfe=lfe;function CYe(e){return function(t,r,n){for(var i=-1,s=Object(t),o=n(t),l=o.length;l--;){var c=o[e?l:++i];if(r(s[c],c,s)===!1)break}return t}}var NYe=CYe,jYe=NYe,SYe=jYe(),BYe=SYe,_Ye=BYe,kYe=h4;function EYe(e,t){return e&&_Ye(e,t,kYe)}var ufe=EYe,TYe=GC;function PYe(e,t){return function(r,n){if(r==null)return r;if(!TYe(r))return e(r,n);for(var i=r.length,s=t?i:-1,o=Object(r);(t?s--:++st||s&&o&&c&&!l&&!u||n&&o&&c||!r&&c||!i)return 1;if(!n&&!s&&!u&&e=l)return c;var u=r[n];return c*(u=="desc"?-1:1)}}return e.index-t.index}var GYe=WYe,MI=iQ,KYe=sQ,VYe=bd,qYe=dfe,XYe=QYe,YYe=XAe,JYe=GYe,ZYe=V0,eJe=zo;function tJe(e,t,r){t.length?t=MI(t,function(s){return eJe(s)?function(o){return KYe(o,s.length===1?s[0]:s)}:s}):t=[ZYe];var n=-1;t=MI(t,YYe(VYe));var i=qYe(e,function(s,o,l){var c=MI(t,function(u){return u(s)});return{criteria:c,index:++n,value:s}});return XYe(i,function(s,o){return JYe(s,o,r)})}var rJe=tJe;function nJe(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var iJe=nJe,sJe=iJe,tK=Math.max;function aJe(e,t,r){return t=tK(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=tK(n.length-t,0),o=Array(s);++i0){if(++t>=mJe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var yJe=xJe,bJe=pJe,wJe=yJe,CJe=wJe(bJe),NJe=CJe,jJe=V0,SJe=oJe,BJe=NJe;function _Je(e,t){return BJe(SJe(e,t,jJe),e+"")}var kJe=_Je,EJe=eQ,TJe=GC,PJe=gQ,IJe=op;function OJe(e,t,r){if(!IJe(r))return!1;var n=typeof t;return(n=="number"?TJe(r)&&PJe(t,r.length):n=="string"&&t in r)?EJe(r[t],e):!1}var m4=OJe,FJe=cfe,LJe=rJe,MJe=kJe,nK=m4,DJe=MJe(function(e,t){if(e==null)return[];var r=t.length;return r>1&&nK(e,t[0],t[1])?t=[]:r>2&&nK(t[0],t[1],t[2])&&(t=[t[0]]),LJe(e,FJe(t,1),[])}),RJe=DJe;const bQ=en(RJe);function h2(e){"@babel/helpers - typeof";return h2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h2(e)}function hM(){return hM=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(Hb,"-left"),rt(r)&&t&&rt(t.x)&&r=t.y),"".concat(Hb,"-top"),rt(n)&&t&&rt(t.y)&&np?Math.max(d,c[n]):Math.max(A,c[n])}function eZe(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function tZe(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,s=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,A;return o.height>0&&o.width>0&&r?(d=aK({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:s,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),A=aK({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:s,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=eZe({translateX:d,translateY:A,useTranslate3d:l})):u=JJe,{cssProperties:u,cssClasses:ZJe({translateX:d,translateY:A,coordinate:r})}}function Hy(e){"@babel/helpers - typeof";return Hy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hy(e)}function oK(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function lK(e){for(var t=1;tcK||Math.abs(n.height-this.state.lastBoundingBox.height)>cK)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,s=i.active,o=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.children,d=i.coordinate,A=i.hasPayload,h=i.isAnimationActive,f=i.offset,m=i.position,p=i.reverseDirection,g=i.useTranslate3d,v=i.viewBox,x=i.wrapperStyle,y=tZe({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:f,position:m,reverseDirection:p,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:v}),b=y.cssClasses,C=y.cssProperties,j=lK(lK({transition:h&&s?"transform ".concat(l,"ms ").concat(c):void 0},C),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&A?"visible":"hidden",position:"absolute",top:0,left:0},x);return re.createElement("div",{tabIndex:-1,className:b,style:j,ref:function(T){n.wrapperNode=T}},u)}}])}(w.PureComponent),dZe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Zc={isSsr:dZe(),get:function(t){return Zc[t]},set:function(t,r){if(typeof t=="string")Zc[t]=r;else{var n=Object.keys(t);n&&n.length&&n.forEach(function(i){Zc[i]=t[i]})}}};function $y(e){"@babel/helpers - typeof";return $y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$y(e)}function uK(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dK(e){for(var t=1;t0;return re.createElement(uZe,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:h,active:s,coordinate:d,hasPayload:j,offset:f,position:g,reverseDirection:v,useTranslate3d:x,viewBox:y,wrapperStyle:b},bZe(u,dK(dK({},this.props),{},{payload:C})))}}])}(w.PureComponent);wQ(Pa,"displayName","Tooltip");wQ(Pa,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Zc.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var wZe=yd,CZe=function(){return wZe.Date.now()},NZe=CZe,jZe=/\s/;function SZe(e){for(var t=e.length;t--&&jZe.test(e.charAt(t)););return t}var BZe=SZe,_Ze=BZe,kZe=/^\s+/;function EZe(e){return e&&e.slice(0,_Ze(e)+1).replace(kZe,"")}var TZe=EZe,PZe=TZe,AK=op,IZe=U0,fK=NaN,OZe=/^[-+]0x[0-9a-f]+$/i,FZe=/^0b[01]+$/i,LZe=/^0o[0-7]+$/i,MZe=parseInt;function DZe(e){if(typeof e=="number")return e;if(IZe(e))return fK;if(AK(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=AK(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=PZe(e);var r=FZe.test(e);return r||LZe.test(e)?MZe(e.slice(2),r?2:8):OZe.test(e)?fK:+e}var gfe=DZe,RZe=op,RI=NZe,hK=gfe,UZe="Expected a function",QZe=Math.max,HZe=Math.min;function $Ze(e,t,r){var n,i,s,o,l,c,u=0,d=!1,A=!1,h=!0;if(typeof e!="function")throw new TypeError(UZe);t=hK(t)||0,RZe(r)&&(d=!!r.leading,A="maxWait"in r,s=A?QZe(hK(r.maxWait)||0,t):s,h="trailing"in r?!!r.trailing:h);function f(j){var S=n,T=i;return n=i=void 0,u=j,o=e.apply(T,S),o}function m(j){return u=j,l=setTimeout(v,t),d?f(j):o}function p(j){var S=j-c,T=j-u,B=t-S;return A?HZe(B,s-T):B}function g(j){var S=j-c,T=j-u;return c===void 0||S>=t||S<0||A&&T>=s}function v(){var j=RI();if(g(j))return x(j);l=setTimeout(v,p(j))}function x(j){return l=void 0,h&&n?f(j):(n=i=void 0,o)}function y(){l!==void 0&&clearTimeout(l),u=0,n=c=i=l=void 0}function b(){return l===void 0?o:x(RI())}function C(){var j=RI(),S=g(j);if(n=arguments,i=this,c=j,S){if(l===void 0)return m(c);if(A)return clearTimeout(l),l=setTimeout(v,t),f(c)}return l===void 0&&(l=setTimeout(v,t)),o}return C.cancel=y,C.flush=b,C}var zZe=$Ze,WZe=zZe,GZe=op,KZe="Expected a function";function VZe(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(KZe);return GZe(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),WZe(e,t,{leading:n,maxWait:t,trailing:i})}var qZe=VZe;const vfe=en(qZe);function m2(e){"@babel/helpers - typeof";return m2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m2(e)}function pK(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function kj(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(M=vfe(M,p,{trailing:!0,leading:!1}));var _=new ResizeObserver(M),R=C.current.getBoundingClientRect(),G=R.width,U=R.height;return P(G,U),_.observe(C.current),function(){_.disconnect()}},[P,p]);var E=w.useMemo(function(){var M=B.containerWidth,_=B.containerHeight;if(M<0||_<0)return null;Jc(cm(o)||cm(c),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,o,c),Jc(!r||r>0,"The aspect(%s) must be greater than zero.",r);var R=cm(o)?M:o,G=cm(c)?_:c;r&&r>0&&(R?G=R/r:G&&(R=G*r),h&&G>h&&(G=h)),Jc(R>0||G>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the height and width.`,R,G,o,c,d,A,r);var U=!Array.isArray(f)&&bA(f.type).endsWith("Chart");return re.Children.map(f,function(Q){return re.isValidElement(Q)?w.cloneElement(Q,kj({width:R,height:G},U?{style:kj({height:"100%",width:"100%",maxHeight:G,maxWidth:R},Q.props.style)}:{})):Q})},[r,f,c,h,A,d,B,o]);return re.createElement("div",{id:g?"".concat(g):void 0,className:mr("recharts-responsive-container",v),style:kj(kj({},b),{},{width:o,height:c,minWidth:d,minHeight:A,maxHeight:h}),ref:C},E)}),g2=function(t){return null};g2.displayName="Cell";function v2(e){"@babel/helpers - typeof";return v2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v2(e)}function gK(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function vM(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Zc.isSsr)return{width:0,height:0};var n=uet(r),i=JSON.stringify({text:t,copyStyle:n});if(Nv.widthCache[i])return Nv.widthCache[i];try{var s=document.getElementById(vK);s||(s=document.createElement("span"),s.setAttribute("id",vK),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var o=vM(vM({},cet),n);Object.assign(s.style,o),s.textContent="".concat(t);var l=s.getBoundingClientRect(),c={width:l.width,height:l.height};return Nv.widthCache[i]=c,++Nv.cacheCount>oet&&(Nv.cacheCount=0,Nv.widthCache={}),c}catch{return{width:0,height:0}}},det=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function x2(e){"@babel/helpers - typeof";return x2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x2(e)}function mk(e,t){return pet(e)||het(e,t)||fet(e,t)||Aet()}function Aet(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fet(e,t){if(e){if(typeof e=="string")return xK(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xK(e,t)}}function xK(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Eet(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function jK(e,t){return Oet(e)||Iet(e,t)||Pet(e,t)||Tet()}function Tet(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pet(e,t){if(e){if(typeof e=="string")return SK(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return SK(e,t)}}function SK(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return R.reduce(function(G,U){var Q=U.word,z=U.width,Y=G[G.length-1];if(Y&&(i==null||s||Y.width+z+nU.width?G:U})};if(!d)return f;for(var p="…",g=function(R){var G=A.slice(0,R),U=wfe({breakAll:u,style:c,children:G+p}).wordsWithComputedWidth,Q=h(U),z=Q.length>o||m(Q).width>Number(i);return[z,Q]},v=0,x=A.length-1,y=0,b;v<=x&&y<=A.length-1;){var C=Math.floor((v+x)/2),j=C-1,S=g(j),T=jK(S,2),B=T[0],I=T[1],P=g(C),E=jK(P,1),M=E[0];if(!B&&!M&&(v=C+1),B&&M&&(x=C-1),!B&&M){b=I;break}y++}return b||f},BK=function(t){var r=fr(t)?[]:t.toString().split(bfe);return[{words:r}]},Let=function(t){var r=t.width,n=t.scaleToFit,i=t.children,s=t.style,o=t.breakAll,l=t.maxLines;if((r||n)&&!Zc.isSsr){var c,u,d=wfe({breakAll:o,children:i,style:s});if(d){var A=d.wordsWithComputedWidth,h=d.spaceWidth;c=A,u=h}else return BK(i);return Fet({breakAll:o,children:i,maxLines:l,style:s},c,u,r,n)}return BK(i)},_K="#808080",gg=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,s=i===void 0?0:i,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,A=d===void 0?!1:d,h=t.textAnchor,f=h===void 0?"start":h,m=t.verticalAnchor,p=m===void 0?"end":m,g=t.fill,v=g===void 0?_K:g,x=NK(t,_et),y=w.useMemo(function(){return Let({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:A,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,A,x.style,x.width]),b=x.dx,C=x.dy,j=x.angle,S=x.className,T=x.breakAll,B=NK(x,ket);if(!Ts(n)||!Ts(s))return null;var I=n+(rt(b)?b:0),P=s+(rt(C)?C:0),E;switch(p){case"start":E=UI("calc(".concat(u,")"));break;case"middle":E=UI("calc(".concat((y.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:E=UI("calc(".concat(y.length-1," * -").concat(l,")"));break}var M=[];if(A){var _=y[0].width,R=x.width;M.push("scale(".concat((rt(R)?R/_:1)/_,")"))}return j&&M.push("rotate(".concat(j,", ").concat(I,", ").concat(P,")")),M.length&&(B.transform=M.join(" ")),re.createElement("text",xM({},Gt(B,!0),{x:I,y:P,className:mr("recharts-text",S),textAnchor:f,fill:v.includes("url")?_K:v}),y.map(function(G,U){var Q=G.words.join(T?"":" ");return re.createElement("tspan",{x:I,dy:U===0?E:l,key:"".concat(Q,"-").concat(U)},Q)}))};function kh(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function Met(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function CQ(e){let t,r,n;e.length!==2?(t=kh,r=(l,c)=>kh(e(l),c),n=(l,c)=>e(l)-c):(t=e===kh||e===Met?e:Det,r=e,n=e);function i(l,c,u=0,d=l.length){if(u>>1;r(l[A],c)<0?u=A+1:d=A}while(u>>1;r(l[A],c)<=0?u=A+1:d=A}while(uu&&n(l[A-1],c)>-n(l[A],c)?A-1:A}return{left:i,center:o,right:s}}function Det(){return 0}function Cfe(e){return e===null?NaN:+e}function*Ret(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const Uet=CQ(kh),KC=Uet.right;CQ(Cfe).center;class kK extends Map{constructor(t,r=$et){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(EK(this,t))}has(t){return super.has(EK(this,t))}set(t,r){return super.set(Qet(this,t),r)}delete(t){return super.delete(Het(this,t))}}function EK({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function Qet({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function Het({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function $et(e){return e!==null&&typeof e=="object"?e.valueOf():e}function zet(e=kh){if(e===kh)return Nfe;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function Nfe(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const Wet=Math.sqrt(50),Get=Math.sqrt(10),Ket=Math.sqrt(2);function gk(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),s=n/Math.pow(10,i),o=s>=Wet?10:s>=Get?5:s>=Ket?2:1;let l,c,u;return i<0?(u=Math.pow(10,-i)/o,l=Math.round(e*u),c=Math.round(t*u),l/ut&&--c,u=-u):(u=Math.pow(10,i)*o,l=Math.round(e/u),c=Math.round(t/u),l*ut&&--c),c0))return[];if(e===t)return[e];const n=t=i))return[];const l=s-i+1,c=new Array(l);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function PK(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function jfe(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?Nfe:zet(i);n>r;){if(n-r>600){const c=n-r+1,u=t-r+1,d=Math.log(c),A=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*A*(c-A)/c)*(u-c/2<0?-1:1),f=Math.max(r,Math.floor(t-u*A/c+h)),m=Math.min(n,Math.floor(t+(c-u)*A/c+h));jfe(e,t,f,m,i)}const s=e[t];let o=r,l=n;for($b(e,r,t),i(e[n],s)>0&&$b(e,r,n);o0;)--l}i(e[r],s)===0?$b(e,r,l):(++l,$b(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function $b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function Vet(e,t,r){if(e=Float64Array.from(Ret(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return PK(e);if(t>=1)return TK(e);var n,i=(n-1)*t,s=Math.floor(i),o=TK(jfe(e,s).subarray(0,s+1)),l=PK(e.subarray(s+1));return o+(l-o)*(i-s)}}function qet(e,t,r=Cfe){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,s=Math.floor(i),o=+r(e[s],s,e),l=+r(e[s+1],s+1,e);return o+(l-o)*(i-s)}}function Xet(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,s=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Tj(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Tj(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Jet.exec(e))?new Io(t[1],t[2],t[3],1):(t=Zet.exec(e))?new Io(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ett.exec(e))?Tj(t[1],t[2],t[3],t[4]):(t=ttt.exec(e))?Tj(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=rtt.exec(e))?RK(t[1],t[2]/100,t[3]/100,1):(t=ntt.exec(e))?RK(t[1],t[2]/100,t[3]/100,t[4]):IK.hasOwnProperty(e)?LK(IK[e]):e==="transparent"?new Io(NaN,NaN,NaN,0):null}function LK(e){return new Io(e>>16&255,e>>8&255,e&255,1)}function Tj(e,t,r,n){return n<=0&&(e=t=r=NaN),new Io(e,t,r,n)}function att(e){return e instanceof VC||(e=C2(e)),e?(e=e.rgb(),new Io(e.r,e.g,e.b,e.opacity)):new Io}function NM(e,t,r,n){return arguments.length===1?att(e):new Io(e,t,r,n??1)}function Io(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}jQ(Io,NM,Bfe(VC,{brighter(e){return e=e==null?vk:Math.pow(vk,e),new Io(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?b2:Math.pow(b2,e),new Io(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Io(Qm(this.r),Qm(this.g),Qm(this.b),xk(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:MK,formatHex:MK,formatHex8:ott,formatRgb:DK,toString:DK}));function MK(){return`#${um(this.r)}${um(this.g)}${um(this.b)}`}function ott(){return`#${um(this.r)}${um(this.g)}${um(this.b)}${um((isNaN(this.opacity)?1:this.opacity)*255)}`}function DK(){const e=xk(this.opacity);return`${e===1?"rgb(":"rgba("}${Qm(this.r)}, ${Qm(this.g)}, ${Qm(this.b)}${e===1?")":`, ${e})`}`}function xk(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Qm(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function um(e){return e=Qm(e),(e<16?"0":"")+e.toString(16)}function RK(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Gc(e,t,r,n)}function _fe(e){if(e instanceof Gc)return new Gc(e.h,e.s,e.l,e.opacity);if(e instanceof VC||(e=C2(e)),!e)return new Gc;if(e instanceof Gc)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),s=Math.max(t,r,n),o=NaN,l=s-i,c=(s+i)/2;return l?(t===s?o=(r-n)/l+(r0&&c<1?0:o,new Gc(o,l,c,e.opacity)}function ltt(e,t,r,n){return arguments.length===1?_fe(e):new Gc(e,t,r,n??1)}function Gc(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}jQ(Gc,ltt,Bfe(VC,{brighter(e){return e=e==null?vk:Math.pow(vk,e),new Gc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?b2:Math.pow(b2,e),new Gc(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Io(QI(e>=240?e-240:e+120,i,n),QI(e,i,n),QI(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Gc(UK(this.h),Pj(this.s),Pj(this.l),xk(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=xk(this.opacity);return`${e===1?"hsl(":"hsla("}${UK(this.h)}, ${Pj(this.s)*100}%, ${Pj(this.l)*100}%${e===1?")":`, ${e})`}`}}));function UK(e){return e=(e||0)%360,e<0?e+360:e}function Pj(e){return Math.max(0,Math.min(1,e||0))}function QI(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const SQ=e=>()=>e;function ctt(e,t){return function(r){return e+r*t}}function utt(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function dtt(e){return(e=+e)==1?kfe:function(t,r){return r-t?utt(t,r,e):SQ(isNaN(t)?r:t)}}function kfe(e,t){var r=t-e;return r?ctt(e,r):SQ(isNaN(e)?t:e)}const QK=function e(t){var r=dtt(t);function n(i,s){var o=r((i=NM(i)).r,(s=NM(s)).r),l=r(i.g,s.g),c=r(i.b,s.b),u=kfe(i.opacity,s.opacity);return function(d){return i.r=o(d),i.g=l(d),i.b=c(d),i.opacity=u(d),i+""}}return n.gamma=e,n}(1);function Att(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(s){for(i=0;ir&&(s=t.slice(r,s),l[o]?l[o]+=s:l[++o]=s),(n=n[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:yk(n,i)})),r=HI.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Ctt(e,t,r){var n=e[0],i=e[1],s=t[0],o=t[1];return i2?Ntt:Ctt,c=u=null,A}function A(h){return h==null||isNaN(h=+h)?s:(c||(c=l(e.map(n),t,r)))(n(o(h)))}return A.invert=function(h){return o(i((u||(u=l(t,e.map(n),yk)))(h)))},A.domain=function(h){return arguments.length?(e=Array.from(h,bk),d()):e.slice()},A.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},A.rangeRound=function(h){return t=Array.from(h),r=BQ,d()},A.clamp=function(h){return arguments.length?(o=h?!0:so,d()):o!==so},A.interpolate=function(h){return arguments.length?(r=h,d()):r},A.unknown=function(h){return arguments.length?(s=h,A):s},function(h,f){return n=h,i=f,d()}}function _Q(){return g4()(so,so)}function jtt(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function wk(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function zy(e){return e=wk(Math.abs(e)),e?e[1]:NaN}function Stt(e,t){return function(r,n){for(var i=r.length,s=[],o=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),s.push(r.substring(i-=l,i+l)),!((c+=l+1)>n));)l=e[o=(o+1)%e.length];return s.reverse().join(t)}}function Btt(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var _tt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function N2(e){if(!(t=_tt.exec(e)))throw new Error("invalid format: "+e);var t;return new kQ({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}N2.prototype=kQ.prototype;function kQ(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}kQ.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function ktt(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var Efe;function Ett(e,t){var r=wk(e,t);if(!r)return e+"";var n=r[0],i=r[1],s=i-(Efe=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return s===o?n:s>o?n+new Array(s-o+1).join("0"):s>0?n.slice(0,s)+"."+n.slice(s):"0."+new Array(1-s).join("0")+wk(e,Math.max(0,t+s-1))[0]}function $K(e,t){var r=wk(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const zK={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:jtt,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>$K(e*100,t),r:$K,s:Ett,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function WK(e){return e}var GK=Array.prototype.map,KK=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ttt(e){var t=e.grouping===void 0||e.thousands===void 0?WK:Stt(GK.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?WK:Btt(GK.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(A){A=N2(A);var h=A.fill,f=A.align,m=A.sign,p=A.symbol,g=A.zero,v=A.width,x=A.comma,y=A.precision,b=A.trim,C=A.type;C==="n"?(x=!0,C="g"):zK[C]||(y===void 0&&(y=12),b=!0,C="g"),(g||h==="0"&&f==="=")&&(g=!0,h="0",f="=");var j=p==="$"?r:p==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",S=p==="$"?n:/[%p]/.test(C)?o:"",T=zK[C],B=/[defgprs%]/.test(C);y=y===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function I(P){var E=j,M=S,_,R,G;if(C==="c")M=T(P)+M,P="";else{P=+P;var U=P<0||1/P<0;if(P=isNaN(P)?c:T(Math.abs(P),y),b&&(P=ktt(P)),U&&+P==0&&m!=="+"&&(U=!1),E=(U?m==="("?m:l:m==="-"||m==="("?"":m)+E,M=(C==="s"?KK[8+Efe/3]:"")+M+(U&&m==="("?")":""),B){for(_=-1,R=P.length;++_G||G>57){M=(G===46?i+P.slice(_+1):P.slice(_))+M,P=P.slice(0,_);break}}}x&&!g&&(P=t(P,1/0));var Q=E.length+P.length+M.length,z=Q>1)+E+P+M+z.slice(Q);break;default:P=z+E+P+M;break}return s(P)}return I.toString=function(){return A+""},I}function d(A,h){var f=u((A=N2(A),A.type="f",A)),m=Math.max(-8,Math.min(8,Math.floor(zy(h)/3)))*3,p=Math.pow(10,-m),g=KK[8+m/3];return function(v){return f(p*v)+g}}return{format:u,formatPrefix:d}}var Ij,EQ,Tfe;Ptt({thousands:",",grouping:[3],currency:["$",""]});function Ptt(e){return Ij=Ttt(e),EQ=Ij.format,Tfe=Ij.formatPrefix,Ij}function Itt(e){return Math.max(0,-zy(Math.abs(e)))}function Ott(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(zy(t)/3)))*3-zy(Math.abs(e)))}function Ftt(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,zy(t)-zy(e))+1}function Pfe(e,t,r,n){var i=wM(e,t,r),s;switch(n=N2(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(s=Ott(i,o))&&(n.precision=s),Tfe(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=Ftt(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=Itt(i))&&(n.precision=s-(n.type==="%")*2);break}}return EQ(n)}function lp(e){var t=e.domain;return e.ticks=function(r){var n=t();return yM(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return Pfe(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,s=n.length-1,o=n[i],l=n[s],c,u,d=10;for(l0;){if(u=bM(o,l,r),u===c)return n[i]=o,n[s]=l,t(n);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function Ck(){var e=_Q();return e.copy=function(){return qC(e,Ck())},Cc.apply(e,arguments),lp(e)}function Ife(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,bk),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return Ife(e).unknown(t)},e=arguments.length?Array.from(e,bk):[0,1],lp(r)}function Ofe(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],s=e[n],o;return sMath.pow(e,t)}function Utt(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function XK(e){return(t,r)=>-e(-t,r)}function TQ(e){const t=e(VK,qK),r=t.domain;let n=10,i,s;function o(){return i=Utt(n),s=Rtt(n),r()[0]<0?(i=XK(i),s=XK(s),e(Ltt,Mtt)):e(VK,qK),t}return t.base=function(l){return arguments.length?(n=+l,o()):n},t.domain=function(l){return arguments.length?(r(l),o()):r()},t.ticks=l=>{const c=r();let u=c[0],d=c[c.length-1];const A=d0){for(;h<=f;++h)for(m=1;md)break;v.push(p)}}else for(;h<=f;++h)for(m=n-1;m>=1;--m)if(p=h>0?m/s(-h):m*s(h),!(pd)break;v.push(p)}v.length*2{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=N2(c)).precision==null&&(c.trim=!0),c=EQ(c)),l===1/0)return c;const u=Math.max(1,n*l/t.ticks().length);return d=>{let A=d/s(Math.round(i(d)));return A*nr(Ofe(r(),{floor:l=>s(Math.floor(i(l))),ceil:l=>s(Math.ceil(i(l)))})),t}function Ffe(){const e=TQ(g4()).domain([1,10]);return e.copy=()=>qC(e,Ffe()).base(e.base()),Cc.apply(e,arguments),e}function YK(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function JK(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function PQ(e){var t=1,r=e(YK(t),JK(t));return r.constant=function(n){return arguments.length?e(YK(t=+n),JK(t)):t},lp(r)}function Lfe(){var e=PQ(g4());return e.copy=function(){return qC(e,Lfe()).constant(e.constant())},Cc.apply(e,arguments)}function ZK(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Qtt(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Htt(e){return e<0?-e*e:e*e}function IQ(e){var t=e(so,so),r=1;function n(){return r===1?e(so,so):r===.5?e(Qtt,Htt):e(ZK(r),ZK(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},lp(t)}function OQ(){var e=IQ(g4());return e.copy=function(){return qC(e,OQ()).exponent(e.exponent())},Cc.apply(e,arguments),e}function $tt(){return OQ.apply(null,arguments).exponent(.5)}function eV(e){return Math.sign(e)*e*e}function ztt(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Mfe(){var e=_Q(),t=[0,1],r=!1,n;function i(s){var o=ztt(e(s));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(s){return e.invert(eV(s))},i.domain=function(s){return arguments.length?(e.domain(s),i):e.domain()},i.range=function(s){return arguments.length?(e.range((t=Array.from(s,bk)).map(eV)),i):t.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(r=!!s,i):r},i.clamp=function(s){return arguments.length?(e.clamp(s),i):e.clamp()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return Mfe(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Cc.apply(i,arguments),lp(i)}function Dfe(){var e=[],t=[],r=[],n;function i(){var o=0,l=Math.max(1,t.length);for(r=new Array(l-1);++o0?r[l-1]:e[0],l=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(c){return arguments.length&&(s=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return Rfe().domain([e,t]).range(i).unknown(s)},Cc.apply(lp(o),arguments)}function Ufe(){var e=[.5],t=[0,1],r,n=1;function i(s){return s!=null&&s<=s?t[KC(e,s,0,n)]:r}return i.domain=function(s){return arguments.length?(e=Array.from(s),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return Ufe().domain(e).range(t).unknown(r)},Cc.apply(i,arguments)}const $I=new Date,zI=new Date;function Ps(e,t,r,n){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const o=i(s),l=i.ceil(s);return s-o(t(s=new Date(+s),o==null?1:Math.floor(o)),s),i.range=(s,o,l)=>{const c=[];if(s=i.ceil(s),l=l==null?1:Math.floor(l),!(s0))return c;let u;do c.push(u=new Date(+s)),t(s,l),e(s);while(uPs(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!s(o););else for(;--l>=0;)for(;t(o,1),!s(o););}),r&&(i.count=(s,o)=>($I.setTime(+s),zI.setTime(+o),e($I),e(zI),Math.floor(r($I,zI))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(n?o=>n(o)%s===0:o=>i.count(0,o)%s===0):i)),i}const Nk=Ps(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Nk.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ps(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Nk);Nk.range;const hA=1e3,rc=hA*60,pA=rc*60,IA=pA*24,FQ=IA*7,tV=IA*30,WI=IA*365,dm=Ps(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*hA)},(e,t)=>(t-e)/hA,e=>e.getUTCSeconds());dm.range;const LQ=Ps(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hA)},(e,t)=>{e.setTime(+e+t*rc)},(e,t)=>(t-e)/rc,e=>e.getMinutes());LQ.range;const MQ=Ps(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*rc)},(e,t)=>(t-e)/rc,e=>e.getUTCMinutes());MQ.range;const DQ=Ps(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hA-e.getMinutes()*rc)},(e,t)=>{e.setTime(+e+t*pA)},(e,t)=>(t-e)/pA,e=>e.getHours());DQ.range;const RQ=Ps(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*pA)},(e,t)=>(t-e)/pA,e=>e.getUTCHours());RQ.range;const XC=Ps(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*rc)/IA,e=>e.getDate()-1);XC.range;const v4=Ps(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/IA,e=>e.getUTCDate()-1);v4.range;const Qfe=Ps(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/IA,e=>Math.floor(e/IA));Qfe.range;function Rg(e){return Ps(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*rc)/FQ)}const x4=Rg(0),jk=Rg(1),Wtt=Rg(2),Gtt=Rg(3),Wy=Rg(4),Ktt=Rg(5),Vtt=Rg(6);x4.range;jk.range;Wtt.range;Gtt.range;Wy.range;Ktt.range;Vtt.range;function Ug(e){return Ps(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/FQ)}const y4=Ug(0),Sk=Ug(1),qtt=Ug(2),Xtt=Ug(3),Gy=Ug(4),Ytt=Ug(5),Jtt=Ug(6);y4.range;Sk.range;qtt.range;Xtt.range;Gy.range;Ytt.range;Jtt.range;const UQ=Ps(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());UQ.range;const QQ=Ps(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());QQ.range;const OA=Ps(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());OA.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ps(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});OA.range;const FA=Ps(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());FA.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ps(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});FA.range;function Hfe(e,t,r,n,i,s){const o=[[dm,1,hA],[dm,5,5*hA],[dm,15,15*hA],[dm,30,30*hA],[s,1,rc],[s,5,5*rc],[s,15,15*rc],[s,30,30*rc],[i,1,pA],[i,3,3*pA],[i,6,6*pA],[i,12,12*pA],[n,1,IA],[n,2,2*IA],[r,1,FQ],[t,1,tV],[t,3,3*tV],[e,1,WI]];function l(u,d,A){const h=dg).right(o,h);if(f===o.length)return e.every(wM(u/WI,d/WI,A));if(f===0)return Nk.every(Math.max(wM(u,d,A),1));const[m,p]=o[h/o[f-1][2]53)return null;"w"in ue||(ue.w=1),"Z"in ue?(D=KI(zb(ue.y,0,1)),K=D.getUTCDay(),D=K>4||K===0?Sk.ceil(D):Sk(D),D=v4.offset(D,(ue.V-1)*7),ue.y=D.getUTCFullYear(),ue.m=D.getUTCMonth(),ue.d=D.getUTCDate()+(ue.w+6)%7):(D=GI(zb(ue.y,0,1)),K=D.getDay(),D=K>4||K===0?jk.ceil(D):jk(D),D=XC.offset(D,(ue.V-1)*7),ue.y=D.getFullYear(),ue.m=D.getMonth(),ue.d=D.getDate()+(ue.w+6)%7)}else("W"in ue||"U"in ue)&&("w"in ue||(ue.w="u"in ue?ue.u%7:"W"in ue?1:0),K="Z"in ue?KI(zb(ue.y,0,1)).getUTCDay():GI(zb(ue.y,0,1)).getDay(),ue.m=0,ue.d="W"in ue?(ue.w+6)%7+ue.W*7-(K+5)%7:ue.w+ue.U*7-(K+6)%7);return"Z"in ue?(ue.H+=ue.Z/100|0,ue.M+=ue.Z%100,KI(ue)):GI(ue)}}function T(de,ge,ie,ue){for(var Se=0,D=ge.length,K=ie.length,we,ae;Se=K)return-1;if(we=ge.charCodeAt(Se++),we===37){if(we=ge.charAt(Se++),ae=C[we in rV?ge.charAt(Se++):we],!ae||(ue=ae(de,ie,ue))<0)return-1}else if(we!=ie.charCodeAt(ue++))return-1}return ue}function B(de,ge,ie){var ue=u.exec(ge.slice(ie));return ue?(de.p=d.get(ue[0].toLowerCase()),ie+ue[0].length):-1}function I(de,ge,ie){var ue=f.exec(ge.slice(ie));return ue?(de.w=m.get(ue[0].toLowerCase()),ie+ue[0].length):-1}function P(de,ge,ie){var ue=A.exec(ge.slice(ie));return ue?(de.w=h.get(ue[0].toLowerCase()),ie+ue[0].length):-1}function E(de,ge,ie){var ue=v.exec(ge.slice(ie));return ue?(de.m=x.get(ue[0].toLowerCase()),ie+ue[0].length):-1}function M(de,ge,ie){var ue=p.exec(ge.slice(ie));return ue?(de.m=g.get(ue[0].toLowerCase()),ie+ue[0].length):-1}function _(de,ge,ie){return T(de,t,ge,ie)}function R(de,ge,ie){return T(de,r,ge,ie)}function G(de,ge,ie){return T(de,n,ge,ie)}function U(de){return o[de.getDay()]}function Q(de){return s[de.getDay()]}function z(de){return c[de.getMonth()]}function Y(de){return l[de.getMonth()]}function $(de){return i[+(de.getHours()>=12)]}function O(de){return 1+~~(de.getMonth()/3)}function W(de){return o[de.getUTCDay()]}function V(de){return s[de.getUTCDay()]}function X(de){return c[de.getUTCMonth()]}function ne(de){return l[de.getUTCMonth()]}function oe(de){return i[+(de.getUTCHours()>=12)]}function pe(de){return 1+~~(de.getUTCMonth()/3)}return{format:function(de){var ge=j(de+="",y);return ge.toString=function(){return de},ge},parse:function(de){var ge=S(de+="",!1);return ge.toString=function(){return de},ge},utcFormat:function(de){var ge=j(de+="",b);return ge.toString=function(){return de},ge},utcParse:function(de){var ge=S(de+="",!0);return ge.toString=function(){return de},ge}}}var rV={"-":"",_:" ",0:"0"},Vs=/^\s*\d+/,irt=/^%/,srt=/[\\^$*+?|[\]().{}]/g;function An(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",s=i.length;return n+(s[t.toLowerCase(),r]))}function ort(e,t,r){var n=Vs.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function lrt(e,t,r){var n=Vs.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function crt(e,t,r){var n=Vs.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function urt(e,t,r){var n=Vs.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function drt(e,t,r){var n=Vs.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function nV(e,t,r){var n=Vs.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function iV(e,t,r){var n=Vs.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Art(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function frt(e,t,r){var n=Vs.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function hrt(e,t,r){var n=Vs.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function sV(e,t,r){var n=Vs.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function prt(e,t,r){var n=Vs.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function aV(e,t,r){var n=Vs.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function mrt(e,t,r){var n=Vs.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function grt(e,t,r){var n=Vs.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function vrt(e,t,r){var n=Vs.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function xrt(e,t,r){var n=Vs.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function yrt(e,t,r){var n=irt.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function brt(e,t,r){var n=Vs.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function wrt(e,t,r){var n=Vs.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function oV(e,t){return An(e.getDate(),t,2)}function Crt(e,t){return An(e.getHours(),t,2)}function Nrt(e,t){return An(e.getHours()%12||12,t,2)}function jrt(e,t){return An(1+XC.count(OA(e),e),t,3)}function $fe(e,t){return An(e.getMilliseconds(),t,3)}function Srt(e,t){return $fe(e,t)+"000"}function Brt(e,t){return An(e.getMonth()+1,t,2)}function _rt(e,t){return An(e.getMinutes(),t,2)}function krt(e,t){return An(e.getSeconds(),t,2)}function Ert(e){var t=e.getDay();return t===0?7:t}function Trt(e,t){return An(x4.count(OA(e)-1,e),t,2)}function zfe(e){var t=e.getDay();return t>=4||t===0?Wy(e):Wy.ceil(e)}function Prt(e,t){return e=zfe(e),An(Wy.count(OA(e),e)+(OA(e).getDay()===4),t,2)}function Irt(e){return e.getDay()}function Ort(e,t){return An(jk.count(OA(e)-1,e),t,2)}function Frt(e,t){return An(e.getFullYear()%100,t,2)}function Lrt(e,t){return e=zfe(e),An(e.getFullYear()%100,t,2)}function Mrt(e,t){return An(e.getFullYear()%1e4,t,4)}function Drt(e,t){var r=e.getDay();return e=r>=4||r===0?Wy(e):Wy.ceil(e),An(e.getFullYear()%1e4,t,4)}function Rrt(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+An(t/60|0,"0",2)+An(t%60,"0",2)}function lV(e,t){return An(e.getUTCDate(),t,2)}function Urt(e,t){return An(e.getUTCHours(),t,2)}function Qrt(e,t){return An(e.getUTCHours()%12||12,t,2)}function Hrt(e,t){return An(1+v4.count(FA(e),e),t,3)}function Wfe(e,t){return An(e.getUTCMilliseconds(),t,3)}function $rt(e,t){return Wfe(e,t)+"000"}function zrt(e,t){return An(e.getUTCMonth()+1,t,2)}function Wrt(e,t){return An(e.getUTCMinutes(),t,2)}function Grt(e,t){return An(e.getUTCSeconds(),t,2)}function Krt(e){var t=e.getUTCDay();return t===0?7:t}function Vrt(e,t){return An(y4.count(FA(e)-1,e),t,2)}function Gfe(e){var t=e.getUTCDay();return t>=4||t===0?Gy(e):Gy.ceil(e)}function qrt(e,t){return e=Gfe(e),An(Gy.count(FA(e),e)+(FA(e).getUTCDay()===4),t,2)}function Xrt(e){return e.getUTCDay()}function Yrt(e,t){return An(Sk.count(FA(e)-1,e),t,2)}function Jrt(e,t){return An(e.getUTCFullYear()%100,t,2)}function Zrt(e,t){return e=Gfe(e),An(e.getUTCFullYear()%100,t,2)}function ent(e,t){return An(e.getUTCFullYear()%1e4,t,4)}function tnt(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Gy(e):Gy.ceil(e),An(e.getUTCFullYear()%1e4,t,4)}function rnt(){return"+0000"}function cV(){return"%"}function uV(e){return+e}function dV(e){return Math.floor(+e/1e3)}var jv,Kfe,Vfe;nnt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function nnt(e){return jv=nrt(e),Kfe=jv.format,jv.parse,Vfe=jv.utcFormat,jv.utcParse,jv}function int(e){return new Date(e)}function snt(e){return e instanceof Date?+e:+new Date(+e)}function HQ(e,t,r,n,i,s,o,l,c,u){var d=_Q(),A=d.invert,h=d.domain,f=u(".%L"),m=u(":%S"),p=u("%I:%M"),g=u("%I %p"),v=u("%a %d"),x=u("%b %d"),y=u("%B"),b=u("%Y");function C(j){return(c(j)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,s)=>Vet(e,s/n))},r.copy=function(){return Jfe(t).domain(e)},WA.apply(r,arguments)}function w4(){var e=0,t=.5,r=1,n=1,i,s,o,l,c,u=so,d,A=!1,h;function f(p){return isNaN(p=+p)?h:(p=.5+((p=+d(p))-s)*(n*pt}var rhe=Ant,fnt=C4,hnt=rhe,pnt=V0;function mnt(e){return e&&e.length?fnt(e,pnt,hnt):void 0}var gnt=mnt;const sh=en(gnt);function vnt(e,t){return ee.e^s.s<0?1:-1;for(n=s.d.length,i=e.d.length,t=0,r=ne.d[t]^s.s<0?1:-1;return n===i?0:n>i^s.s<0?1:-1};Nt.decimalPlaces=Nt.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ri;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Nt.dividedBy=Nt.div=function(e){return wA(this,new this.constructor(e))};Nt.dividedToIntegerBy=Nt.idiv=function(e){var t=this,r=t.constructor;return Fn(wA(t,new r(e),0,1),r.precision)};Nt.equals=Nt.eq=function(e){return!this.cmp(e)};Nt.exponent=function(){return ds(this)};Nt.greaterThan=Nt.gt=function(e){return this.cmp(e)>0};Nt.greaterThanOrEqualTo=Nt.gte=function(e){return this.cmp(e)>=0};Nt.isInteger=Nt.isint=function(){return this.e>this.d.length-2};Nt.isNegative=Nt.isneg=function(){return this.s<0};Nt.isPositive=Nt.ispos=function(){return this.s>0};Nt.isZero=function(){return this.s===0};Nt.lessThan=Nt.lt=function(e){return this.cmp(e)<0};Nt.lessThanOrEqualTo=Nt.lte=function(e){return this.cmp(e)<1};Nt.logarithm=Nt.log=function(e){var t,r=this,n=r.constructor,i=n.precision,s=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(ul))throw Error(vc+"NaN");if(r.s<1)throw Error(vc+(r.s?"NaN":"-Infinity"));return r.eq(ul)?new n(0):(di=!1,t=wA(j2(r,s),j2(e,s),s),di=!0,Fn(t,i))};Nt.minus=Nt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?ohe(t,e):she(t,(e.s=-e.s,e))};Nt.modulo=Nt.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(vc+"NaN");return r.s?(di=!1,t=wA(r,e,0,1).times(e),di=!0,r.minus(t)):Fn(new n(r),i)};Nt.naturalExponential=Nt.exp=function(){return ahe(this)};Nt.naturalLogarithm=Nt.ln=function(){return j2(this)};Nt.negated=Nt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Nt.plus=Nt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?she(t,e):ohe(t,(e.s=-e.s,e))};Nt.precision=Nt.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Hm+e);if(t=ds(i)+1,n=i.d.length-1,r=n*ri+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Nt.squareRoot=Nt.sqrt=function(){var e,t,r,n,i,s,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(vc+"NaN")}for(e=ds(l),di=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=Hu(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Y0((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(i.toString()),r=c.precision,i=o=r+3;;)if(s=n,n=s.plus(wA(l,s,o+2)).times(.5),Hu(s.d).slice(0,o)===(t=Hu(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Fn(s,r+1,0),s.times(s).eq(l)){n=s;break}}else if(t!="9999")break;o+=4}return di=!0,Fn(n,r)};Nt.times=Nt.mul=function(e){var t,r,n,i,s,o,l,c,u,d=this,A=d.constructor,h=d.d,f=(e=new A(e)).d;if(!d.s||!e.s)return new A(0);for(e.s*=d.s,r=d.e+e.e,c=h.length,u=f.length,c=0;){for(t=0,i=c+n;i>n;)l=s[i]+f[n]*h[i-n-1]+t,s[i--]=l%Ls|0,t=l/Ls|0;s[i]=(s[i]+t)%Ls|0}for(;!s[--o];)s.pop();return t?++r:s.shift(),e.d=s,e.e=r,di?Fn(e,A.precision):e};Nt.toDecimalPlaces=Nt.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ld(e,0,X0),t===void 0?t=n.rounding:ld(t,0,8),Fn(r,e+ds(r)+1,t))};Nt.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=xg(n,!0):(ld(e,0,X0),t===void 0?t=i.rounding:ld(t,0,8),n=Fn(new i(n),e+1,t),r=xg(n,!0,e+1)),r};Nt.toFixed=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?xg(i):(ld(e,0,X0),t===void 0?t=s.rounding:ld(t,0,8),n=Fn(new s(i),e+ds(i)+1,t),r=xg(n.abs(),!1,e+ds(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};Nt.toInteger=Nt.toint=function(){var e=this,t=e.constructor;return Fn(new t(e),ds(e)+1,t.rounding)};Nt.toNumber=function(){return+this};Nt.toPower=Nt.pow=function(e){var t,r,n,i,s,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(ul);if(l=new c(l),!l.s){if(e.s<1)throw Error(vc+"Infinity");return l}if(l.eq(ul))return l;if(n=c.precision,e.eq(ul))return Fn(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,s=l.s,o){if((r=d<0?-d:d)<=ihe){for(i=new c(ul),t=Math.ceil(n/ri+4),di=!1;r%2&&(i=i.times(l),hV(i.d,t)),r=Y0(r/2),r!==0;)l=l.times(l),hV(l.d,t);return di=!0,e.s<0?new c(ul).div(i):Fn(i,n)}}else if(s<0)throw Error(vc+"NaN");return s=s<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,di=!1,i=e.times(j2(l,n+u)),di=!0,i=ahe(i),i.s=s,i};Nt.toPrecision=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?(r=ds(i),n=xg(i,r<=s.toExpNeg||r>=s.toExpPos)):(ld(e,1,X0),t===void 0?t=s.rounding:ld(t,0,8),i=Fn(new s(i),e,t),r=ds(i),n=xg(i,e<=r||r<=s.toExpNeg,e)),n};Nt.toSignificantDigits=Nt.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ld(e,1,X0),t===void 0?t=n.rounding:ld(t,0,8)),Fn(new n(r),e,t)};Nt.toString=Nt.valueOf=Nt.val=Nt.toJSON=Nt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ds(e),r=e.constructor;return xg(e,t<=r.toExpNeg||t>=r.toExpPos)};function she(e,t){var r,n,i,s,o,l,c,u,d=e.constructor,A=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),di?Fn(t,A):t;if(c=e.d,u=t.d,o=e.e,i=t.e,c=c.slice(),s=o-i,s){for(s<0?(n=c,s=-s,l=u.length):(n=u,i=o,l=c.length),o=Math.ceil(A/ri),l=o>l?o+1:l+1,s>l&&(s=l,n.length=1),n.reverse();s--;)n.push(0);n.reverse()}for(l=c.length,s=u.length,l-s<0&&(s=l,n=u,u=c,c=n),r=0;s;)r=(c[--s]=c[s]+u[s]+r)/Ls|0,c[s]%=Ls;for(r&&(c.unshift(r),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,di?Fn(t,A):t}function ld(e,t,r){if(e!==~~e||er)throw Error(Hm+e)}function Hu(e){var t,r,n,i=e.length-1,s="",o=e[0];if(i>0){for(s+=o,t=1;to?1:-1;else for(l=c=0;li[l]?1:-1;break}return c}function r(n,i,s){for(var o=0;s--;)n[s]-=o,o=n[s]1;)n.shift()}return function(n,i,s,o){var l,c,u,d,A,h,f,m,p,g,v,x,y,b,C,j,S,T,B=n.constructor,I=n.s==i.s?1:-1,P=n.d,E=i.d;if(!n.s)return new B(n);if(!i.s)throw Error(vc+"Division by zero");for(c=n.e-i.e,S=E.length,C=P.length,f=new B(I),m=f.d=[],u=0;E[u]==(P[u]||0);)++u;if(E[u]>(P[u]||0)&&--c,s==null?x=s=B.precision:o?x=s+(ds(n)-ds(i))+1:x=s,x<0)return new B(0);if(x=x/ri+2|0,u=0,S==1)for(d=0,E=E[0],x++;(u1&&(E=e(E,d),P=e(P,d),S=E.length,C=P.length),b=S,p=P.slice(0,S),g=p.length;g=Ls/2&&++j;do d=0,l=t(E,p,S,g),l<0?(v=p[0],S!=g&&(v=v*Ls+(p[1]||0)),d=v/j|0,d>1?(d>=Ls&&(d=Ls-1),A=e(E,d),h=A.length,g=p.length,l=t(A,p,h,g),l==1&&(d--,r(A,S16)throw Error(WQ+ds(e));if(!e.s)return new d(ul);for(t==null?(di=!1,l=A):l=t,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(Vp(2,u))/Math.LN10*2+5|0,l+=n,r=i=s=new d(ul),d.precision=l;;){if(i=Fn(i.times(e),l),r=r.times(++c),o=s.plus(wA(i,r,l)),Hu(o.d).slice(0,l)===Hu(s.d).slice(0,l)){for(;u--;)s=Fn(s.times(s),l);return d.precision=A,t==null?(di=!0,Fn(s,A)):s}s=o}}function ds(e){for(var t=e.e*ri,r=e.d[0];r>=10;r/=10)t++;return t}function VI(e,t,r){if(t>e.LN10.sd())throw di=!0,r&&(e.precision=r),Error(vc+"LN10 precision limit exceeded");return Fn(new e(e.LN10),t)}function Tf(e){for(var t="";e--;)t+="0";return t}function j2(e,t){var r,n,i,s,o,l,c,u,d,A=1,h=10,f=e,m=f.d,p=f.constructor,g=p.precision;if(f.s<1)throw Error(vc+(f.s?"NaN":"-Infinity"));if(f.eq(ul))return new p(0);if(t==null?(di=!1,u=g):u=t,f.eq(10))return t==null&&(di=!0),VI(p,u);if(u+=h,p.precision=u,r=Hu(m),n=r.charAt(0),s=ds(f),Math.abs(s)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)f=f.times(e),r=Hu(f.d),n=r.charAt(0),A++;s=ds(f),n>1?(f=new p("0."+r),s++):f=new p(n+"."+r.slice(1))}else return c=VI(p,u+2,g).times(s+""),f=j2(new p(n+"."+r.slice(1)),u-h).plus(c),p.precision=g,t==null?(di=!0,Fn(f,g)):f;for(l=o=f=wA(f.minus(ul),f.plus(ul),u),d=Fn(f.times(f),u),i=3;;){if(o=Fn(o.times(d),u),c=l.plus(wA(o,new p(i),u)),Hu(c.d).slice(0,u)===Hu(l.d).slice(0,u))return l=l.times(2),s!==0&&(l=l.plus(VI(p,u+2,g).times(s+""))),l=wA(l,new p(A),u),p.precision=g,t==null?(di=!0,Fn(l,g)):l;l=c,i+=2}}function fV(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Y0(r/ri),e.d=[],n=(r+1)%ri,r<0&&(n+=ri),nBk||e.e<-Bk))throw Error(WQ+r)}else e.s=0,e.e=0,e.d=[0];return e}function Fn(e,t,r){var n,i,s,o,l,c,u,d,A=e.d;for(o=1,s=A[0];s>=10;s/=10)o++;if(n=t-o,n<0)n+=ri,i=t,u=A[d=0];else{if(d=Math.ceil((n+1)/ri),s=A.length,d>=s)return e;for(u=s=A[d],o=1;s>=10;s/=10)o++;n%=ri,i=n-ri+o}if(r!==void 0&&(s=Vp(10,o-i-1),l=u/s%10|0,c=t<0||A[d+1]!==void 0||u%s,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?i>0?u/Vp(10,o-i):0:A[d-1])%10&1||r==(e.s<0?8:7))),t<1||!A[0])return c?(s=ds(e),A.length=1,t=t-s-1,A[0]=Vp(10,(ri-t%ri)%ri),e.e=Y0(-t/ri)||0):(A.length=1,A[0]=e.e=e.s=0),e;if(n==0?(A.length=d,s=1,d--):(A.length=d+1,s=Vp(10,ri-n),A[d]=i>0?(u/Vp(10,o-i)%Vp(10,i)|0)*s:0),c)for(;;)if(d==0){(A[0]+=s)==Ls&&(A[0]=1,++e.e);break}else{if(A[d]+=s,A[d]!=Ls)break;A[d--]=0,s=1}for(n=A.length;A[--n]===0;)A.pop();if(di&&(e.e>Bk||e.e<-Bk))throw Error(WQ+ds(e));return e}function ohe(e,t){var r,n,i,s,o,l,c,u,d,A,h=e.constructor,f=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),di?Fn(t,f):t;if(c=e.d,A=t.d,n=t.e,u=e.e,c=c.slice(),o=u-n,o){for(d=o<0,d?(r=c,o=-o,l=A.length):(r=A,n=u,l=c.length),i=Math.max(Math.ceil(f/ri),l)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=c.length,l=A.length,d=i0;--i)c[l++]=0;for(i=A.length;i>o;){if(c[--i]0?s=s.charAt(0)+"."+s.slice(1)+Tf(n):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+Tf(-i-1)+s,r&&(n=r-o)>0&&(s+=Tf(n))):i>=o?(s+=Tf(i+1-o),r&&(n=r-i-1)>0&&(s=s+"."+Tf(n))):((n=i+1)0&&(i+1===o&&(s+="."),s+=Tf(n))),e.s<0?"-"+s:s}function hV(e,t){if(e.length>t)return e.length=t,!0}function lhe(e){var t,r,n;function i(s){var o=this;if(!(o instanceof i))return new i(s);if(o.constructor=i,s instanceof i){o.s=s.s,o.e=s.e,o.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(Hm+s);if(s>0)o.s=1;else if(s<0)s=-s,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(s===~~s&&s<1e7){o.e=0,o.d=[s];return}return fV(o,s.toString())}else if(typeof s!="string")throw Error(Hm+s);if(s.charCodeAt(0)===45?(s=s.slice(1),o.s=-1):o.s=1,Rnt.test(s))fV(o,s);else throw Error(Hm+s)}if(i.prototype=Nt,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=lhe,i.config=i.set=Unt,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Hm+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Hm+r+": "+n);return this}var GQ=lhe(Dnt);ul=new GQ(1);const kn=GQ;function Qnt(e){return Wnt(e)||znt(e)||$nt(e)||Hnt()}function Hnt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $nt(e,t){if(e){if(typeof e=="string")return BM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return BM(e,t)}}function znt(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Wnt(e){if(Array.isArray(e))return BM(e)}function BM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,pV(function(){for(var l=arguments.length,c=new Array(l),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,s=void 0;try{for(var o=e[Symbol.iterator](),l;!(n=(l=o.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(c){i=!0,s=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}return r}}function ait(e){if(Array.isArray(e))return e}function fhe(e){var t=S2(e,2),r=t[0],n=t[1],i=r,s=n;return r>n&&(i=n,s=r),[i,s]}function hhe(e,t,r){if(e.lte(0))return new kn(0);var n=S4.getDigitCount(e.toNumber()),i=new kn(10).pow(n),s=e.div(i),o=n!==1?.05:.1,l=new kn(Math.ceil(s.div(o).toNumber())).add(r).mul(o),c=l.mul(i);return t?c:new kn(Math.ceil(c))}function oit(e,t,r){var n=1,i=new kn(e);if(!i.isint()&&r){var s=Math.abs(e);s<1?(n=new kn(10).pow(S4.getDigitCount(e)-1),i=new kn(Math.floor(i.div(n).toNumber())).mul(n)):s>1&&(i=new kn(Math.floor(e)))}else e===0?i=new kn(Math.floor((t-1)/2)):r||(i=new kn(Math.floor(e)));var o=Math.floor((t-1)/2),l=qnt(Vnt(function(c){return i.add(new kn(c-o).mul(n)).toNumber()}),_M);return l(0,t)}function phe(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new kn(0),tickMin:new kn(0),tickMax:new kn(0)};var s=hhe(new kn(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new kn(0):(o=new kn(e).add(t).div(2),o=o.sub(new kn(o).mod(s)));var l=Math.ceil(o.sub(e).div(s).toNumber()),c=Math.ceil(new kn(t).sub(o).div(s).toNumber()),u=l+c+1;return u>r?phe(e,t,r,n,i+1):(u0?c+(r-u):c,l=t>0?l:l+(r-u)),{step:s,tickMin:o.sub(new kn(l).mul(s)),tickMax:o.add(new kn(c).mul(s))})}function lit(e){var t=S2(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),l=fhe([r,n]),c=S2(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var A=d===1/0?[u].concat(EM(_M(0,i-1).map(function(){return 1/0}))):[].concat(EM(_M(0,i-1).map(function(){return-1/0})),[d]);return r>n?kM(A):A}if(u===d)return oit(u,i,s);var h=phe(u,d,o,s),f=h.step,m=h.tickMin,p=h.tickMax,g=S4.rangeStep(m,p.add(new kn(.1).mul(f)),f);return r>n?kM(g):g}function cit(e,t){var r=S2(e,2),n=r[0],i=r[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=fhe([n,i]),l=S2(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[n,i];if(c===u)return[c];var d=Math.max(t,2),A=hhe(new kn(u).sub(c).div(d-1),s,0),h=[].concat(EM(S4.rangeStep(new kn(c),new kn(u).sub(new kn(.99).mul(A)),A)),[u]);return n>i?kM(h):h}var uit=dhe(lit),dit=dhe(cit),Ait="Invariant failed";function yg(e,t){throw new Error(Ait)}var fit=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Ky(e){"@babel/helpers - typeof";return Ky=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ky(e)}function _k(){return _k=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yit(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function bit(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wit(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,o=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(s&&s.axisType==="angleAxis"&&Math.abs(Math.abs(s.range[1]-s.range[0])-360)<=1e-6)for(var c=s.range,u=0;u0?i[u-1].coordinate:i[l-1].coordinate,A=i[u].coordinate,h=u>=l-1?i[0].coordinate:i[u+1].coordinate,f=void 0;if(no(A-d)!==no(h-A)){var m=[];if(no(h-A)===no(c[1]-c[0])){f=h;var p=A+c[1]-c[0];m[0]=Math.min(p,(p+d)/2),m[1]=Math.max(p,(p+d)/2)}else{f=d;var g=h+c[1]-c[0];m[0]=Math.min(A,(g+A)/2),m[1]=Math.max(A,(g+A)/2)}var v=[Math.min(A,(f+A)/2),Math.max(A,(f+A)/2)];if(t>v[0]&&t<=v[1]||t>=m[0]&&t<=m[1]){o=i[u].index;break}}else{var x=Math.min(d,h),y=Math.max(d,h);if(t>(x+A)/2&&t<=(y+A)/2){o=i[u].index;break}}}else for(var b=0;b0&&b(n[b].coordinate+n[b-1].coordinate)/2&&t<=(n[b].coordinate+n[b+1].coordinate)/2||b===l-1&&t>(n[b].coordinate+n[b-1].coordinate)/2){o=n[b].index;break}return o},KQ=function(t){var r,n=t,i=n.type.displayName,s=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Oi(Oi({},t.type.defaultProps),t.props):t.props,o=s.stroke,l=s.fill,c;switch(i){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},Rit=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,s=i===void 0?{}:i;if(!s)return{};for(var o={},l=Object.keys(s),c=0,u=l.length;c=0});if(v&&v.length){var x=v[0].type.defaultProps,y=x!==void 0?Oi(Oi({},x),v[0].props):v[0].props,b=y.barSize,C=y[g];o[C]||(o[C]=[]);var j=fr(b)?r:b;o[C].push({item:v[0],stackList:v.slice(1),barSize:fr(j)?void 0:io(j,n,0)})}}return o},Uit=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,s=t.sizeList,o=s===void 0?[]:s,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=io(r,i,0,!0),d,A=[];if(o[0].barSize===+o[0].barSize){var h=!1,f=i/c,m=o.reduce(function(b,C){return b+C.barSize||0},0);m+=(c-1)*u,m>=i&&(m-=(c-1)*u,u=0),m>=i&&f>0&&(h=!0,f*=.9,m=c*f);var p=(i-m)/2>>0,g={offset:p-u,size:0};d=o.reduce(function(b,C){var j={item:C.item,position:{offset:g.offset+g.size+u,size:h?f:C.barSize}},S=[].concat(vV(b),[j]);return g=S[S.length-1].position,C.stackList&&C.stackList.length&&C.stackList.forEach(function(T){S.push({item:T,position:g})}),S},A)}else{var v=io(n,i,0,!0);i-2*v-(c-1)*u<=0&&(u=0);var x=(i-2*v-(c-1)*u)/c;x>1&&(x>>=0);var y=l===+l?Math.min(x,l):x;d=o.reduce(function(b,C,j){var S=[].concat(vV(b),[{item:C.item,position:{offset:v+(x+u)*j+(x-y)/2,size:y}}]);return C.stackList&&C.stackList.length&&C.stackList.forEach(function(T){S.push({item:T,position:S[S.length-1].position})}),S},A)}return d},Qit=function(t,r,n,i){var s=n.children,o=n.width,l=n.margin,c=o-(l.left||0)-(l.right||0),u=xhe({children:s,legendWidth:c});if(u){var d=i||{},A=d.width,h=d.height,f=u.align,m=u.verticalAlign,p=u.layout;if((p==="vertical"||p==="horizontal"&&m==="middle")&&f!=="center"&&rt(t[f]))return Oi(Oi({},t),{},Wx({},f,t[f]+(A||0)));if((p==="horizontal"||p==="vertical"&&f==="center")&&m!=="middle"&&rt(t[m]))return Oi(Oi({},t),{},Wx({},m,t[m]+(h||0)))}return t},Hit=function(t,r,n){return fr(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},yhe=function(t,r,n,i,s){var o=r.props.children,l=bl(o,YC).filter(function(u){return Hit(i,s,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var A=qi(d,n);if(fr(A))return u;var h=Array.isArray(A)?[N4(A),sh(A)]:[A,A],f=c.reduce(function(m,p){var g=qi(d,p,0),v=h[0]-Math.abs(Array.isArray(g)?g[0]:g),x=h[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(v,m[0]),Math.max(x,m[1])]},[1/0,-1/0]);return[Math.min(f[0],u[0]),Math.max(f[1],u[1])]},[1/0,-1/0])}return null},$it=function(t,r,n,i,s){var o=r.map(function(l){return yhe(t,l,n,s,i)}).filter(function(l){return!fr(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},bhe=function(t,r,n,i,s){var o=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&yhe(t,c,u,i)||n1(t,u,n,s)});if(n==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,A=u.length;d=2?no(l[0]-l[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(A){var h=s?s.indexOf(A):A;return{coordinate:i(h)+u,value:A,offset:u}});return d.filter(function(A){return!W0(A.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(A,h){return{coordinate:i(A)+u,value:A,index:h,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(A){return{coordinate:i(A)+u,value:A,offset:u}}):i.domain().map(function(A,h){return{coordinate:i(A)+u,value:s?s[A]:A,index:h,offset:u}})},qI=new WeakMap,Oj=function(t,r){if(typeof r!="function")return t;qI.has(t)||qI.set(t,new WeakMap);var n=qI.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},Nhe=function(t,r,n){var i=t.scale,s=t.type,o=t.layout,l=t.axisType;if(i==="auto")return o==="radial"&&l==="radiusAxis"?{scale:y2(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:Ck(),realScaleType:"linear"}:s==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:r1(),realScaleType:"point"}:s==="category"?{scale:y2(),realScaleType:"band"}:{scale:Ck(),realScaleType:"linear"};if(pg(i)){var c="scale".concat(u4(i));return{scale:(AV[c]||r1)(),realScaleType:AV[c]?c:"point"}}return rr(i)?{scale:i}:{scale:r1(),realScaleType:"point"}},yV=1e-4,jhe=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),s=Math.min(i[0],i[1])-yV,o=Math.max(i[0],i[1])+yV,l=t(r[0]),c=t(r[n-1]);(lo||co)&&t.domain([r[0],r[n-1]])}},zit=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(s[1]=i),s[0]>i&&(s[0]=i),s[1]=0?(t[l][n][0]=s,t[l][n][1]=s+c,s=t[l][n][1]):(t[l][n][0]=o,t[l][n][1]=o+c,o=t[l][n][1])}},Kit=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=s,t[o][n][1]=s+l,s=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},Vit={sign:Git,expand:dWe,none:Ry,silhouette:AWe,wiggle:fWe,positive:Kit},qit=function(t,r,n){var i=r.map(function(l){return l.props.dataKey}),s=Vit[n],o=uWe().keys(i).value(function(l,c){return+qi(l,c,0)}).order(iM).offset(s);return o(t)},Xit=function(t,r,n,i,s,o){if(!t)return null;var l=o?r.reverse():r,c={},u=l.reduce(function(A,h){var f,m=(f=h.type)!==null&&f!==void 0&&f.defaultProps?Oi(Oi({},h.type.defaultProps),h.props):h.props,p=m.stackId,g=m.hide;if(g)return A;var v=m[n],x=A[v]||{hasStack:!1,stackGroups:{}};if(Ts(p)){var y=x.stackGroups[p]||{numericAxisId:n,cateAxisId:i,items:[]};y.items.push(h),x.hasStack=!0,x.stackGroups[p]=y}else x.stackGroups[Dg("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return Oi(Oi({},A),{},Wx({},v,x))},c),d={};return Object.keys(u).reduce(function(A,h){var f=u[h];if(f.hasStack){var m={};f.stackGroups=Object.keys(f.stackGroups).reduce(function(p,g){var v=f.stackGroups[g];return Oi(Oi({},p),{},Wx({},g,{numericAxisId:n,cateAxisId:i,items:v.items,stackedData:qit(t,v.items,s)}))},m)}return Oi(Oi({},A),{},Wx({},h,f))},d)},She=function(t,r){var n=r.realScaleType,i=r.type,s=r.tickCount,o=r.originalDomain,l=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(s&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=uit(u,s,l);return t.domain([N4(d),sh(d)]),{niceTicks:d}}if(s&&i==="number"){var A=t.domain(),h=dit(A,s,l);return{niceTicks:h}}return null};function Ek(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,s=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!fr(i[t.dataKey])){var l=rk(r,"value",i[t.dataKey]);if(l)return l.coordinate+n/2}return r[s]?r[s].coordinate+n/2:null}var c=qi(i,fr(o)?t.dataKey:o);return fr(c)?null:t.scale(c)}var bV=function(t){var r=t.axis,n=t.ticks,i=t.offset,s=t.bandSize,o=t.entry,l=t.index;if(r.type==="category")return n[l]?n[l].coordinate+i:null;var c=qi(o,r.dataKey,r.domain[l]);return fr(c)?null:r.scale(c)-s/2+i},Yit=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),s=Math.max(n[0],n[1]);return i<=0&&s>=0?0:s<0?s:i}return n[0]},Jit=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Oi(Oi({},t.type.defaultProps),t.props):t.props,s=i.stackId;if(Ts(s)){var o=r[s];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},Zit=function(t){return t.reduce(function(r,n){return[N4(n.concat([r[0]]).filter(rt)),sh(n.concat([r[1]]).filter(rt))]},[1/0,-1/0])},Bhe=function(t,r,n){return Object.keys(t).reduce(function(i,s){var o=t[s],l=o.stackedData,c=l.reduce(function(u,d){var A=Zit(d.slice(r,n+1));return[Math.min(u[0],A[0]),Math.max(u[1],A[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},wV=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,CV=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,OM=function(t,r,n){if(rr(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(rt(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(wV.test(t[0])){var s=+wV.exec(t[0])[1];i[0]=r[0]-s}else rr(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(rt(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(CV.test(t[1])){var o=+CV.exec(t[1])[1];i[1]=r[1]+o}else rr(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},Tk=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var s=bQ(r,function(A){return A.coordinate}),o=1/0,l=1,c=s.length;le.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},lst=function(t,r,n,i,s){var o=t.width,l=t.height,c=t.startAngle,u=t.endAngle,d=io(t.cx,o,o/2),A=io(t.cy,l,l/2),h=Ehe(o,l,n),f=io(t.innerRadius,h,0),m=io(t.outerRadius,h,h*.8),p=Object.keys(r);return p.reduce(function(g,v){var x=r[v],y=x.domain,b=x.reversed,C;if(fr(x.range))i==="angleAxis"?C=[c,u]:i==="radiusAxis"&&(C=[f,m]),b&&(C=[C[1],C[0]]);else{C=x.range;var j=C,S=rst(j,2);c=S[0],u=S[1]}var T=Nhe(x,s),B=T.realScaleType,I=T.scale;I.domain(y).range(C),jhe(I);var P=She(I,rA(rA({},x),{},{realScaleType:B})),E=rA(rA(rA({},x),P),{},{range:C,radius:m,realScaleType:B,scale:I,cx:d,cy:A,innerRadius:f,outerRadius:m,startAngle:c,endAngle:u});return rA(rA({},g),{},khe({},v,E))},{})},cst=function(t,r){var n=t.x,i=t.y,s=r.x,o=r.y;return Math.sqrt(Math.pow(n-s,2)+Math.pow(i-o,2))},ust=function(t,r){var n=t.x,i=t.y,s=r.cx,o=r.cy,l=cst({x:n,y:i},{x:s,y:o});if(l<=0)return{radius:l};var c=(n-s)/l,u=Math.acos(c);return i>o&&(u=2*Math.PI-u),{radius:l,angle:ost(u),angleInRadian:u}},dst=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),s=Math.floor(n/360),o=Math.min(i,s);return{startAngle:r-o*360,endAngle:n-o*360}},Ast=function(t,r){var n=r.startAngle,i=r.endAngle,s=Math.floor(n/360),o=Math.floor(i/360),l=Math.min(s,o);return t+l*360},BV=function(t,r){var n=t.x,i=t.y,s=ust({x:n,y:i},r),o=s.radius,l=s.angle,c=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var d=dst(r),A=d.startAngle,h=d.endAngle,f=l,m;if(A<=h){for(;f>h;)f-=360;for(;f=A&&f<=h}else{for(;f>A;)f-=360;for(;f=h&&f<=A}return m?rA(rA({},r),{},{radius:o,angle:Ast(f,r)}):null},The=function(t){return!w.isValidElement(t)&&!rr(t)&&typeof t!="boolean"?t.className:""};function E2(e){"@babel/helpers - typeof";return E2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E2(e)}var fst=["offset"];function hst(e){return vst(e)||gst(e)||mst(e)||pst()}function pst(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mst(e,t){if(e){if(typeof e=="string")return FM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return FM(e,t)}}function gst(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vst(e){if(Array.isArray(e))return FM(e)}function FM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yst(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ws(e){for(var t=1;t=0?1:-1,y,b;i==="insideStart"?(y=f+x*o,b=p):i==="insideEnd"?(y=m-x*o,b=!p):i==="end"&&(y=m+x*o,b=p),b=v<=0?b:!b;var C=Kn(u,d,g,y),j=Kn(u,d,g,y+(b?1:-1)*359),S="M".concat(C.x,",").concat(C.y,` A`).concat(g,",").concat(g,",0,1,").concat(b?0:1,`, `).concat(j.x,",").concat(j.y),T=fr(t.id)?Dg("recharts-radial-line-"):t.id;return re.createElement("text",T2({},n,{dominantBaseline:"central",className:mr("recharts-radial-bar-label",l)}),re.createElement("defs",null,re.createElement("path",{id:T,d:S})),re.createElement("textPath",{xlinkHref:"#".concat(T)},r))},Bst=function(t){var r=t.viewBox,n=t.offset,i=t.position,s=r,o=s.cx,l=s.cy,c=s.innerRadius,u=s.outerRadius,d=s.startAngle,A=s.endAngle,h=(d+A)/2;if(i==="outside"){var f=Kn(o,l,u+n,h),m=f.x,p=f.y;return{x:m,y:p,textAnchor:m>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var g=(c+u)/2,v=Kn(o,l,g,h),x=v.x,y=v.y;return{x,y,textAnchor:"middle",verticalAnchor:"middle"}},_st=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,s=t.position,o=r,l=o.x,c=o.y,u=o.width,d=o.height,A=d>=0?1:-1,h=A*i,f=A>0?"end":"start",m=A>0?"start":"end",p=u>=0?1:-1,g=p*i,v=p>0?"end":"start",x=p>0?"start":"end";if(s==="top"){var y={x:l+u/2,y:c-A*i,textAnchor:"middle",verticalAnchor:f};return ws(ws({},y),n?{height:Math.max(c-n.y,0),width:u}:{})}if(s==="bottom"){var b={x:l+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:m};return ws(ws({},b),n?{height:Math.max(n.y+n.height-(c+d),0),width:u}:{})}if(s==="left"){var C={x:l-g,y:c+d/2,textAnchor:v,verticalAnchor:"middle"};return ws(ws({},C),n?{width:Math.max(C.x-n.x,0),height:d}:{})}if(s==="right"){var j={x:l+u+g,y:c+d/2,textAnchor:x,verticalAnchor:"middle"};return ws(ws({},j),n?{width:Math.max(n.x+n.width-j.x,0),height:d}:{})}var S=n?{width:u,height:d}:{};return s==="insideLeft"?ws({x:l+g,y:c+d/2,textAnchor:x,verticalAnchor:"middle"},S):s==="insideRight"?ws({x:l+u-g,y:c+d/2,textAnchor:v,verticalAnchor:"middle"},S):s==="insideTop"?ws({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:m},S):s==="insideBottom"?ws({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:f},S):s==="insideTopLeft"?ws({x:l+g,y:c+h,textAnchor:x,verticalAnchor:m},S):s==="insideTopRight"?ws({x:l+u-g,y:c+h,textAnchor:v,verticalAnchor:m},S):s==="insideBottomLeft"?ws({x:l+g,y:c+d-h,textAnchor:x,verticalAnchor:f},S):s==="insideBottomRight"?ws({x:l+u-g,y:c+d-h,textAnchor:v,verticalAnchor:f},S):Q0(s)&&(rt(s.x)||cm(s.x))&&(rt(s.y)||cm(s.y))?ws({x:l+io(s.x,u),y:c+io(s.y,d),textAnchor:"end",verticalAnchor:"end"},S):ws({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},S)},kst=function(t){return"cx"in t&&rt(t.cx)};function Us(e){var t=e.offset,r=t===void 0?5:t,n=xst(e,fst),i=ws({offset:r},n),s=i.viewBox,o=i.position,l=i.value,c=i.children,u=i.content,d=i.className,A=d===void 0?"":d,h=i.textBreakAll;if(!s||fr(l)&&fr(c)&&!w.isValidElement(u)&&!rr(u))return null;if(w.isValidElement(u))return w.cloneElement(u,i);var f;if(rr(u)){if(f=w.createElement(u,i),w.isValidElement(f))return f}else f=Nst(i);var m=kst(s),p=Gt(i,!0);if(m&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Sst(i,f,p);var g=m?Bst(i):_st(i);return re.createElement(gg,T2({className:mr("recharts-label",A)},p,g,{breakAll:h}),f)}Us.displayName="Label";var Phe=function(t){var r=t.cx,n=t.cy,i=t.angle,s=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,A=t.x,h=t.y,f=t.top,m=t.left,p=t.width,g=t.height,v=t.clockWise,x=t.labelViewBox;if(x)return x;if(rt(p)&&rt(g)){if(rt(A)&&rt(h))return{x:A,y:h,width:p,height:g};if(rt(f)&&rt(m))return{x:f,y:m,width:p,height:g}}return rt(A)&&rt(h)?{x:A,y:h,width:0,height:0}:rt(r)&&rt(n)?{cx:r,cy:n,startAngle:s||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:v}:t.viewBox?t.viewBox:{}},Est=function(t,r){return t?t===!0?re.createElement(Us,{key:"label-implicit",viewBox:r}):Ts(t)?re.createElement(Us,{key:"label-implicit",viewBox:r,value:t}):w.isValidElement(t)?t.type===Us?w.cloneElement(t,{key:"label-implicit",viewBox:r}):re.createElement(Us,{key:"label-implicit",content:t,viewBox:r}):rr(t)?re.createElement(Us,{key:"label-implicit",content:t,viewBox:r}):Q0(t)?re.createElement(Us,T2({viewBox:r},t,{key:"label-implicit"})):null:null},Tst=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,s=Phe(t),o=bl(i,Us).map(function(c,u){return w.cloneElement(c,{viewBox:r||s,key:"label-".concat(u)})});if(!n)return o;var l=Est(t.label,r||s);return[l].concat(hst(o))};Us.parseViewBox=Phe;Us.renderCallByParent=Tst;function Pst(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Ist=Pst;const Ost=en(Ist);function P2(e){"@babel/helpers - typeof";return P2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P2(e)}var Fst=["valueAccessor"],Lst=["data","dataKey","clockWise","id","textBreakAll"];function Mst(e){return Qst(e)||Ust(e)||Rst(e)||Dst()}function Dst(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rst(e,t){if(e){if(typeof e=="string")return LM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return LM(e,t)}}function Ust(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Qst(e){if(Array.isArray(e))return LM(e)}function LM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Wst(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Gst=function(t){return Array.isArray(t.value)?Ost(t.value):t.value};function Ju(e){var t=e.valueAccessor,r=t===void 0?Gst:t,n=TV(e,Fst),i=n.data,s=n.dataKey,o=n.clockWise,l=n.id,c=n.textBreakAll,u=TV(n,Lst);return!i||!i.length?null:re.createElement(Hr,{className:"recharts-label-list"},i.map(function(d,A){var h=fr(s)?r(d,A):qi(d&&d.payload,s),f=fr(l)?{}:{id:"".concat(l,"-").concat(A)};return re.createElement(Us,Ik({},Gt(d,!0),u,f,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:Us.parseViewBox(fr(o)?d:EV(EV({},d),{},{clockWise:o})),key:"label-".concat(A),index:A}))}))}Ju.displayName="LabelList";function Kst(e,t){return e?e===!0?re.createElement(Ju,{key:"labelList-implicit",data:t}):re.isValidElement(e)||rr(e)?re.createElement(Ju,{key:"labelList-implicit",data:t,content:e}):Q0(e)?re.createElement(Ju,Ik({data:t},e,{key:"labelList-implicit"})):null:null}function Vst(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=bl(n,Ju).map(function(o,l){return w.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!r)return i;var s=Kst(e.label,t);return[s].concat(Mst(i))}Ju.renderCallByParent=Vst;function I2(e){"@babel/helpers - typeof";return I2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I2(e)}function MM(){return MM=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>u),`, `).concat(A.x,",").concat(A.y,` `);if(i>0){var f=Kn(r,n,i,o),m=Kn(r,n,i,u);h+="L ".concat(m.x,",").concat(m.y,` A `).concat(i,",").concat(i,`,0, `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`, `).concat(f.x,",").concat(f.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},Zst=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,s=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,A=no(d-u),h=Fj({cx:r,cy:n,radius:s,angle:u,sign:A,cornerRadius:o,cornerIsExternal:c}),f=h.circleTangency,m=h.lineTangency,p=h.theta,g=Fj({cx:r,cy:n,radius:s,angle:d,sign:-A,cornerRadius:o,cornerIsExternal:c}),v=g.circleTangency,x=g.lineTangency,y=g.theta,b=c?Math.abs(u-d):Math.abs(u-d)-p-y;if(b<0)return l?"M ".concat(m.x,",").concat(m.y,` a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 `):Ihe({cx:r,cy:n,innerRadius:i,outerRadius:s,startAngle:u,endAngle:d});var C="M ".concat(m.x,",").concat(m.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(A<0),",").concat(f.x,",").concat(f.y,` A`).concat(s,",").concat(s,",0,").concat(+(b>180),",").concat(+(A<0),",").concat(v.x,",").concat(v.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(A<0),",").concat(x.x,",").concat(x.y,` `);if(i>0){var j=Fj({cx:r,cy:n,radius:i,angle:u,sign:A,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),S=j.circleTangency,T=j.lineTangency,B=j.theta,I=Fj({cx:r,cy:n,radius:i,angle:d,sign:-A,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),P=I.circleTangency,E=I.lineTangency,M=I.theta,_=c?Math.abs(u-d):Math.abs(u-d)-B-M;if(_<0&&o===0)return"".concat(C,"L").concat(r,",").concat(n,"Z");C+="L".concat(E.x,",").concat(E.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(A<0),",").concat(P.x,",").concat(P.y,` A`).concat(i,",").concat(i,",0,").concat(+(_>180),",").concat(+(A>0),",").concat(S.x,",").concat(S.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(A<0),",").concat(T.x,",").concat(T.y,"Z")}else C+="L".concat(r,",").concat(n,"Z");return C},eat={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Ohe=function(t){var r=IV(IV({},eat),t),n=r.cx,i=r.cy,s=r.innerRadius,o=r.outerRadius,l=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,d=r.startAngle,A=r.endAngle,h=r.className;if(o0&&Math.abs(d-A)<360?g=Zst({cx:n,cy:i,innerRadius:s,outerRadius:o,cornerRadius:Math.min(p,m/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:A}):g=Ihe({cx:n,cy:i,innerRadius:s,outerRadius:o,startAngle:d,endAngle:A}),re.createElement("path",MM({},Gt(r,!0),{className:f,d:g,role:"img"}))};function O2(e){"@babel/helpers - typeof";return O2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O2(e)}function DM(){return DM=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function xat(e,t){return Qg(e.getTime(),t.getTime())}function yat(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function bat(e,t){return e===t}function QV(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),s=e.entries(),o,l,c=0;(o=s.next())&&!o.done;){for(var u=t.entries(),d=!1,A=0;(l=u.next())&&!l.done;){if(i[A]){A++;continue}var h=o.value,f=l.value;if(r.equals(h[0],f[0],c,A,e,t,r)&&r.equals(h[1],f[1],h[0],f[0],e,t,r)){d=i[A]=!0;break}A++}if(!d)return!1;c++}return!0}var wat=Qg;function Cat(e,t,r){var n=UV(e),i=n.length;if(UV(t).length!==i)return!1;for(;i-- >0;)if(!Dhe(e,t,r,n[i]))return!1;return!0}function qb(e,t,r){var n=DV(e),i=n.length;if(DV(t).length!==i)return!1;for(var s,o,l;i-- >0;)if(s=n[i],!Dhe(e,t,r,s)||(o=RV(e,s),l=RV(t,s),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function Nat(e,t){return Qg(e.valueOf(),t.valueOf())}function jat(e,t){return e.source===t.source&&e.flags===t.flags}function HV(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),s=e.values(),o,l;(o=s.next())&&!o.done;){for(var c=t.values(),u=!1,d=0;(l=c.next())&&!l.done;){if(!i[d]&&r.equals(o.value,l.value,o.value,l.value,e,t,r)){u=i[d]=!0;break}d++}if(!u)return!1}return!0}function Sat(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function Bat(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Dhe(e,t,r,n){return(n===gat||n===mat||n===pat)&&(e.$$typeof||t.$$typeof)?!0:hat(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var _at="[object Arguments]",kat="[object Boolean]",Eat="[object Date]",Tat="[object Error]",Pat="[object Map]",Iat="[object Number]",Oat="[object Object]",Fat="[object RegExp]",Lat="[object Set]",Mat="[object String]",Dat="[object URL]",Rat=Array.isArray,$V=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,zV=Object.assign,Uat=Object.prototype.toString.call.bind(Object.prototype.toString);function Qat(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,i=e.areFunctionsEqual,s=e.areMapsEqual,o=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,d=e.areSetsEqual,A=e.areTypedArraysEqual,h=e.areUrlsEqual;return function(m,p,g){if(m===p)return!0;if(m==null||p==null)return!1;var v=typeof m;if(v!==typeof p)return!1;if(v!=="object")return v==="number"?o(m,p,g):v==="function"?i(m,p,g):!1;var x=m.constructor;if(x!==p.constructor)return!1;if(x===Object)return l(m,p,g);if(Rat(m))return t(m,p,g);if($V!=null&&$V(m))return A(m,p,g);if(x===Date)return r(m,p,g);if(x===RegExp)return u(m,p,g);if(x===Map)return s(m,p,g);if(x===Set)return d(m,p,g);var y=Uat(m);return y===Eat?r(m,p,g):y===Fat?u(m,p,g):y===Pat?s(m,p,g):y===Lat?d(m,p,g):y===Oat?typeof m.then!="function"&&typeof p.then!="function"&&l(m,p,g):y===Dat?h(m,p,g):y===Tat?n(m,p,g):y===_at?l(m,p,g):y===kat||y===Iat||y===Mat?c(m,p,g):!1}}function Hat(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?qb:vat,areDatesEqual:xat,areErrorsEqual:yat,areFunctionsEqual:bat,areMapsEqual:n?MV(QV,qb):QV,areNumbersEqual:wat,areObjectsEqual:n?qb:Cat,arePrimitiveWrappersEqual:Nat,areRegExpsEqual:jat,areSetsEqual:n?MV(HV,qb):HV,areTypedArraysEqual:n?qb:Sat,areUrlsEqual:Bat};if(r&&(i=zV({},i,r(i))),t){var s=Mj(i.areArraysEqual),o=Mj(i.areMapsEqual),l=Mj(i.areObjectsEqual),c=Mj(i.areSetsEqual);i=zV({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return i}function $at(e){return function(t,r,n,i,s,o,l){return e(t,r,l)}}function zat(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,s=e.strict;if(n)return function(c,u){var d=n(),A=d.cache,h=A===void 0?t?new WeakMap:void 0:A,f=d.meta;return r(c,u,{cache:h,equals:i,meta:f,strict:s})};if(t)return function(c,u){return r(c,u,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var o={cache:void 0,equals:i,meta:void 0,strict:s};return function(c,u){return r(c,u,o)}}var Wat=up();up({strict:!0});up({circular:!0});up({circular:!0,strict:!0});up({createInternalComparator:function(){return Qg}});up({strict:!0,createInternalComparator:function(){return Qg}});up({circular:!0,createInternalComparator:function(){return Qg}});up({circular:!0,createInternalComparator:function(){return Qg},strict:!0});function up(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,s=e.strict,o=s===void 0?!1:s,l=Hat(e),c=Qat(l),u=n?n(c):$at(c);return zat({circular:r,comparator:c,createState:i,equals:u,strict:o})}function Gat(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function WV(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(s){r<0&&(r=s),s-r>t?(e(s),r=-1):Gat(i)};requestAnimationFrame(n)}function RM(e){"@babel/helpers - typeof";return RM=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},RM(e)}function Kat(e){return Yat(e)||Xat(e)||qat(e)||Vat()}function Vat(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qat(e,t){if(e){if(typeof e=="string")return GV(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return GV(e,t)}}function GV(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:v<0?0:v},p=function(v){for(var x=v>1?1:v,y=x,b=0;b<8;++b){var C=A(y)-x,j=f(y);if(Math.abs(C-x)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,s=i===void 0?8:i,o=t.dt,l=o===void 0?17:o,c=function(d,A,h){var f=-(d-A)*n,m=h*s,p=h+(f-m)*l/1e3,g=h*l/1e3+d;return Math.abs(g-A)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _ot(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function XI(e){return Pot(e)||Tot(e)||Eot(e)||kot()}function kot(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Eot(e,t){if(e){if(typeof e=="string")return zM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zM(e,t)}}function Tot(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pot(e){if(Array.isArray(e))return zM(e)}function zM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Lk(e){return Lk=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Lk(e)}var ou=function(e){Mot(r,e);var t=Dot(r);function r(n,i){var s;Iot(this,r),s=t.call(this,n,i);var o=s.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,A=o.steps,h=o.children,f=o.duration;if(s.handleStyleChange=s.handleStyleChange.bind(KM(s)),s.changeStyle=s.changeStyle.bind(KM(s)),!l||f<=0)return s.state={style:{}},typeof h=="function"&&(s.state={style:d}),GM(s);if(A&&A.length)s.state={style:A[0].style};else if(u){if(typeof h=="function")return s.state={style:u},GM(s);s.state={style:c?xw({},c,u):u}}else s.state={style:{}};return s}return Fot(r,[{key:"componentDidMount",value:function(){var i=this.props,s=i.isActive,o=i.canBegin;this.mounted=!0,!(!s||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var s=this.props,o=s.isActive,l=s.canBegin,c=s.attributeName,u=s.shouldReAnimate,d=s.to,A=s.from,h=this.state.style;if(l){if(!o){var f={style:c?xw({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(f);return}if(!(Wat(i.to,d)&&i.canBegin&&i.isActive)){var m=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var p=m||u?A:i.to;if(this.state&&h){var g={style:c?xw({},c,p):p};(c&&h[c]!==p||!c&&h!==p)&&this.setState(g)}this.runAnimation(Ec(Ec({},this.props),{},{from:p,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var s=this,o=i.from,l=i.to,c=i.duration,u=i.easing,d=i.begin,A=i.onAnimationEnd,h=i.onAnimationStart,f=jot(o,l,hot(u),c,this.changeStyle),m=function(){s.stopJSAnimation=f()};this.manager.start([h,d,m,c,A])}},{key:"runStepAnimation",value:function(i){var s=this,o=i.steps,l=i.begin,c=i.onAnimationStart,u=o[0],d=u.style,A=u.duration,h=A===void 0?0:A,f=function(p,g,v){if(v===0)return p;var x=g.duration,y=g.easing,b=y===void 0?"ease":y,C=g.style,j=g.properties,S=g.onAnimationEnd,T=v>0?o[v-1]:g,B=j||Object.keys(C);if(typeof b=="function"||b==="spring")return[].concat(XI(p),[s.runJSAnimation.bind(s,{from:T.style,to:C,duration:x,easing:b}),x]);var I=qV(B,x,b),P=Ec(Ec(Ec({},T.style),C),{},{transition:I});return[].concat(XI(p),[P,x,S]).filter(rot)};return this.manager.start([c].concat(XI(o.reduce(f,[d,Math.max(h,l)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=Jat());var s=i.begin,o=i.duration,l=i.attributeName,c=i.to,u=i.easing,d=i.onAnimationStart,A=i.onAnimationEnd,h=i.steps,f=i.children,m=this.manager;if(this.unSubscribe=m.subscribe(this.handleStyleChange),typeof u=="function"||typeof f=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var p=l?xw({},l,c):c,g=qV(Object.keys(p),o,u);m.start([d,s,Ec(Ec({},p),{},{transition:g}),o,A])}},{key:"render",value:function(){var i=this.props,s=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var l=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=Bot(i,Sot),u=w.Children.count(s),d=this.state.style;if(typeof s=="function")return s(d);if(!l||u===0||o<=0)return s;var A=function(f){var m=f.props,p=m.style,g=p===void 0?{}:p,v=m.className,x=w.cloneElement(f,Ec(Ec({},c),{},{style:Ec(Ec({},g),d),className:v}));return x};return u===1?A(w.Children.only(s)):re.createElement("div",null,w.Children.map(s,function(h){return A(h)}))}}]),r}(w.PureComponent);ou.displayName="Animate";ou.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ou.propTypes={from:mn.oneOfType([mn.object,mn.string]),to:mn.oneOfType([mn.object,mn.string]),attributeName:mn.string,duration:mn.number,begin:mn.number,easing:mn.oneOfType([mn.string,mn.func]),steps:mn.arrayOf(mn.shape({duration:mn.number.isRequired,style:mn.object.isRequired,easing:mn.oneOfType([mn.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),mn.func]),properties:mn.arrayOf("string"),onAnimationEnd:mn.func})),children:mn.oneOfType([mn.node,mn.func]),isActive:mn.bool,canBegin:mn.bool,onAnimationEnd:mn.func,shouldReAnimate:mn.bool,onAnimationStart:mn.func,onAnimationReStart:mn.func};function M2(e){"@babel/helpers - typeof";return M2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M2(e)}function Mk(){return Mk=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,c=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,d;if(o>0&&s instanceof Array){for(var A=[0,0,0,0],h=0,f=4;ho?o:s[h];d="M".concat(t,",").concat(r+l*A[0]),A[0]>0&&(d+="A ".concat(A[0],",").concat(A[0],",0,0,").concat(u,",").concat(t+c*A[0],",").concat(r)),d+="L ".concat(t+n-c*A[1],",").concat(r),A[1]>0&&(d+="A ".concat(A[1],",").concat(A[1],",0,0,").concat(u,`, `).concat(t+n,",").concat(r+l*A[1])),d+="L ".concat(t+n,",").concat(r+i-l*A[2]),A[2]>0&&(d+="A ".concat(A[2],",").concat(A[2],",0,0,").concat(u,`, `).concat(t+n-c*A[2],",").concat(r+i)),d+="L ".concat(t+c*A[3],",").concat(r+i),A[3]>0&&(d+="A ".concat(A[3],",").concat(A[3],",0,0,").concat(u,`, `).concat(t,",").concat(r+i-l*A[3])),d+="Z"}else if(o>0&&s===+s&&s>0){var m=Math.min(o,s);d="M ".concat(t,",").concat(r+l*m,` A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+c*m,",").concat(r,` L `).concat(t+n-c*m,",").concat(r,` A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+n,",").concat(r+l*m,` L `).concat(t+n,",").concat(r+i-l*m,` A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+n-c*m,",").concat(r+i,` L `).concat(t+c*m,",").concat(r+i,` A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t,",").concat(r+i-l*m," Z")}else d="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return d},Vot=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,s=r.x,o=r.y,l=r.width,c=r.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(s,s+l),d=Math.max(s,s+l),A=Math.min(o,o+c),h=Math.max(o,o+c);return n>=u&&n<=d&&i>=A&&i<=h}return!1},qot={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},VQ=function(t){var r=nq(nq({},qot),t),n=w.useRef(),i=w.useState(-1),s=Uot(i,2),o=s[0],l=s[1];w.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var b=n.current.getTotalLength();b&&l(b)}catch{}},[]);var c=r.x,u=r.y,d=r.width,A=r.height,h=r.radius,f=r.className,m=r.animationEasing,p=r.animationDuration,g=r.animationBegin,v=r.isAnimationActive,x=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||A!==+A||d===0||A===0)return null;var y=mr("recharts-rectangle",f);return x?re.createElement(ou,{canBegin:o>0,from:{width:d,height:A,x:c,y:u},to:{width:d,height:A,x:c,y:u},duration:p,animationEasing:m,isActive:x},function(b){var C=b.width,j=b.height,S=b.x,T=b.y;return re.createElement(ou,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:p,isActive:v,easing:m},re.createElement("path",Mk({},Gt(r,!0),{className:y,d:iq(S,T,C,j,h),ref:n})))}):re.createElement("path",Mk({},Gt(r,!0),{className:y,d:iq(c,u,d,A,h)}))},Xot=["points","className","baseLinePoints","connectNulls"];function hx(){return hx=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Jot(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function sq(e){return rlt(e)||tlt(e)||elt(e)||Zot()}function Zot(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function elt(e,t){if(e){if(typeof e=="string")return VM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return VM(e,t)}}function tlt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rlt(e){if(Array.isArray(e))return VM(e)}function VM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){aq(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),aq(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},s1=function(t,r){var n=nlt(t);r&&(n=[n.reduce(function(s,o){return[].concat(sq(s),sq(o))},[])]);var i=n.map(function(s){return s.reduce(function(o,l,c){return"".concat(o).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},ilt=function(t,r,n){var i=s1(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(s1(r.reverse(),n).slice(1))},slt=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,s=t.connectNulls,o=Yot(t,Xot);if(!r||!r.length)return null;var l=mr("recharts-polygon",n);if(i&&i.length){var c=o.stroke&&o.stroke!=="none",u=ilt(r,i,s);return re.createElement("g",{className:l},re.createElement("path",hx({},Gt(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),c?re.createElement("path",hx({},Gt(o,!0),{fill:"none",d:s1(r,s)})):null,c?re.createElement("path",hx({},Gt(o,!0),{fill:"none",d:s1(i,s)})):null)}var d=s1(r,s);return re.createElement("path",hx({},Gt(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",className:l,d}))};function qM(){return qM=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Alt(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var flt=function(t,r,n,i,s,o){return"M".concat(t,",").concat(s,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},hlt=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,s=i===void 0?0:i,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,d=t.width,A=d===void 0?0:d,h=t.height,f=h===void 0?0:h,m=t.className,p=dlt(t,alt),g=olt({x:n,y:s,top:l,left:u,width:A,height:f},p);return!rt(n)||!rt(s)||!rt(A)||!rt(f)||!rt(l)||!rt(u)?null:re.createElement("path",XM({},Gt(g,!0),{className:mr("recharts-cross",m),d:flt(n,s,A,f,l,u)}))},plt=C4,mlt=rhe,glt=bd;function vlt(e,t){return e&&e.length?plt(e,glt(t),mlt):void 0}var xlt=vlt;const ylt=en(xlt);var blt=C4,wlt=bd,Clt=nhe;function Nlt(e,t){return e&&e.length?blt(e,wlt(t),Clt):void 0}var jlt=Nlt;const Slt=en(jlt);var Blt=["cx","cy","angle","ticks","axisLine"],_lt=["ticks","tick","angle","tickFormatter","stroke"];function qy(e){"@babel/helpers - typeof";return qy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qy(e)}function a1(){return a1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function klt(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Elt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uq(e,t){for(var r=0;rfq?o=i==="outer"?"start":"end":s<-fq?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,s=n.cy,o=n.radius,l=n.axisLine,c=n.axisLineType,u=Lp(Lp({},Gt(this.props,!1)),{},{fill:"none"},Gt(l,!1));if(c==="circle")return re.createElement(JC,Zp({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:s,r:o}));var d=this.props.ticks,A=d.map(function(h){return Kn(i,s,o,h.coordinate)});return re.createElement(slt,Zp({className:"recharts-polar-angle-axis-line"},u,{points:A}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,s=i.ticks,o=i.tick,l=i.tickLine,c=i.tickFormatter,u=i.stroke,d=Gt(this.props,!1),A=Gt(o,!1),h=Lp(Lp({},d),{},{fill:"none"},Gt(l,!1)),f=s.map(function(m,p){var g=n.getTickLineCoord(m),v=n.getTickTextAnchor(m),x=Lp(Lp(Lp({textAnchor:v},d),{},{stroke:"none",fill:u},A),{},{index:p,payload:m,x:g.x2,y:g.y2});return re.createElement(Hr,Zp({className:mr("recharts-polar-angle-axis-tick",The(o)),key:"tick-".concat(m.coordinate)},mg(n.props,m,p)),l&&re.createElement("line",Zp({className:"recharts-polar-angle-axis-tick-line"},h,g)),o&&t.renderTickItem(o,x,c?c(m.value,p):m.value))});return re.createElement(Hr,{className:"recharts-polar-angle-axis-ticks"},f)}},{key:"render",value:function(){var n=this.props,i=n.ticks,s=n.radius,o=n.axisLine;return s<=0||!i||!i.length?null:re.createElement(Hr,{className:mr("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,s){var o;return re.isValidElement(n)?o=re.cloneElement(n,i):rr(n)?o=n(i):o=re.createElement(gg,Zp({},i,{className:"recharts-polar-angle-axis-tick-value"}),s),o}}])}(w.PureComponent);k4(E4,"displayName","PolarAngleAxis");k4(E4,"axisType","angleAxis");k4(E4,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Wlt=JAe,Glt=Wlt(Object.getPrototypeOf,Object),Klt=Glt,Vlt=$A,qlt=Klt,Xlt=zA,Ylt="[object Object]",Jlt=Function.prototype,Zlt=Object.prototype,qhe=Jlt.toString,ect=Zlt.hasOwnProperty,tct=qhe.call(Object);function rct(e){if(!Xlt(e)||Vlt(e)!=Ylt)return!1;var t=qlt(e);if(t===null)return!0;var r=ect.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&qhe.call(r)==tct}var nct=rct;const ict=en(nct);var sct=$A,act=zA,oct="[object Boolean]";function lct(e){return e===!0||e===!1||act(e)&&sct(e)==oct}var cct=lct;const uct=en(cct);function R2(e){"@babel/helpers - typeof";return R2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R2(e)}function Uk(){return Uk=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:d,lowerWidth:A,height:h,x:c,y:u},duration:p,animationEasing:m,isActive:v},function(y){var b=y.upperWidth,C=y.lowerWidth,j=y.height,S=y.x,T=y.y;return re.createElement(ou,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:p,easing:m},re.createElement("path",Uk({},Gt(r,!0),{className:x,d:gq(S,T,b,C,j),ref:n})))}):re.createElement("g",null,re.createElement("path",Uk({},Gt(r,!0),{className:x,d:gq(c,u,d,A,h)})))},bct=["option","shapeType","propTransformer","activeClassName","isActive"];function U2(e){"@babel/helpers - typeof";return U2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},U2(e)}function wct(e,t){if(e==null)return{};var r=Cct(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Cct(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function vq(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Qk(e){for(var t=1;t0?yl(y,"paddingAngle",0):0;if(C){var S=Bs(C.endAngle-C.startAngle,y.endAngle-y.startAngle),T=$n($n({},y),{},{startAngle:x+j,endAngle:x+S(p)+j});g.push(T),x=T.endAngle}else{var B=y.endAngle,I=y.startAngle,P=Bs(0,B-I),E=P(p),M=$n($n({},y),{},{startAngle:x+j,endAngle:x+E+j});g.push(M),x=M.endAngle}}),re.createElement(Hr,null,n.renderSectorsStatically(g))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(s){if(!s.altKey)switch(s.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var l=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[l].focus(),i.setState({sectorToFocus:l});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,s=n.isAnimationActive,o=this.state.prevSectors;return s&&i&&i.length&&(!o||!vg(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,s=i.hide,o=i.sectors,l=i.className,c=i.label,u=i.cx,d=i.cy,A=i.innerRadius,h=i.outerRadius,f=i.isAnimationActive,m=this.state.isAnimationFinished;if(s||!o||!o.length||!rt(u)||!rt(d)||!rt(A)||!rt(h))return null;var p=mr("recharts-pie",l);return re.createElement(Hr,{tabIndex:this.props.rootTabIndex,className:p,ref:function(v){n.pieRef=v}},this.renderSectors(),c&&this.renderLabels(o),Us.renderCallByParent(this.props,null,!1),(!f||m)&&Ju.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?x:x-1)*c,b=g-x*f-y,C=i.reduce(function(T,B){var I=qi(B,v,0);return T+(rt(I)?I:0)},0),j;if(C>0){var S;j=i.map(function(T,B){var I=qi(T,v,0),P=qi(T,d,B),E=(rt(I)?I:0)/C,M;B?M=S.endAngle+no(p)*c*(I!==0?1:0):M=o;var _=M+no(p)*((I!==0?f:0)+E*b),R=(M+_)/2,G=(m.innerRadius+m.outerRadius)/2,U=[{name:P,value:I,payload:T,dataKey:v,type:h}],Q=Kn(m.cx,m.cy,G,R);return S=$n($n($n({percent:E,cornerRadius:s,name:P,tooltipPayload:U,midAngle:R,middleRadius:G,tooltipPosition:Q},T),m),{},{value:qi(T,v),startAngle:M,endAngle:_,payload:T,paddingAngle:no(p)*c}),S})}return $n($n({},m),{},{sectors:j,data:i})});var zct=Math.ceil,Wct=Math.max;function Gct(e,t,r,n){for(var i=-1,s=Wct(zct((t-e)/(r||1)),0),o=Array(s);s--;)o[n?s:++i]=e,e+=r;return o}var Kct=Gct,Vct=gfe,wq=1/0,qct=17976931348623157e292;function Xct(e){if(!e)return e===0?e:0;if(e=Vct(e),e===wq||e===-wq){var t=e<0?-1:1;return t*qct}return e===e?e:0}var Zhe=Xct,Yct=Kct,Jct=m4,YI=Zhe;function Zct(e){return function(t,r,n){return n&&typeof n!="number"&&Jct(t,r,n)&&(r=n=void 0),t=YI(t),r===void 0?(r=t,t=0):r=YI(r),n=n===void 0?t0&&n.handleDrag(i.changedTouches[0])}),rl(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,s=i.endIndex,o=i.onDragEnd,l=i.startIndex;o==null||o({endIndex:s,startIndex:l})}),n.detachDragEndListener()}),rl(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),rl(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),rl(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),rl(n,"handleSlideDragStart",function(i){var s=Bq(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:s.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return fut(t,e),cut(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,s=n.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,A=Math.min(i,s),h=Math.max(i,s),f=t.getIndexInRange(o,A),m=t.getIndexInRange(o,h);return{startIndex:f-f%c,endIndex:m===d?d:m-m%c}}},{key:"getTextOfTick",value:function(n){var i=this.props,s=i.data,o=i.tickFormatter,l=i.dataKey,c=qi(s[n],l,n);return rr(o)?o(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,s=i.slideMoveStartX,o=i.startX,l=i.endX,c=this.props,u=c.x,d=c.width,A=c.travellerWidth,h=c.startIndex,f=c.endIndex,m=c.onChange,p=n.pageX-s;p>0?p=Math.min(p,u+d-A-l,u+d-A-o):p<0&&(p=Math.max(p,u-o,u-l));var g=this.getIndex({startX:o+p,endX:l+p});(g.startIndex!==h||g.endIndex!==f)&&m&&m(g),this.setState({startX:o+p,endX:l+p,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var s=Bq(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:s.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,s=i.brushMoveStartX,o=i.movingTravellerId,l=i.endX,c=i.startX,u=this.state[o],d=this.props,A=d.x,h=d.width,f=d.travellerWidth,m=d.onChange,p=d.gap,g=d.data,v={startX:this.state.startX,endX:this.state.endX},x=n.pageX-s;x>0?x=Math.min(x,A+h-f-u):x<0&&(x=Math.max(x,A-u)),v[o]=u+x;var y=this.getIndex(v),b=y.startIndex,C=y.endIndex,j=function(){var T=g.length-1;return o==="startX"&&(l>c?b%p===0:C%p===0)||lc?C%p===0:b%p===0)||l>c&&C===T};this.setState(rl(rl({},o,u+x),"brushMoveStartX",n.pageX),function(){m&&j()&&m(y)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var s=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[i],A=l.indexOf(d);if(A!==-1){var h=A+n;if(!(h===-1||h>=l.length)){var f=l[h];i==="startX"&&f>=u||i==="endX"&&f<=c||this.setState(rl({},i,f),function(){s.props.onChange(s.getIndex({startX:s.state.startX,endX:s.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,s=n.y,o=n.width,l=n.height,c=n.fill,u=n.stroke;return re.createElement("rect",{stroke:u,fill:c,x:i,y:s,width:o,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,s=n.y,o=n.width,l=n.height,c=n.data,u=n.children,d=n.padding,A=w.Children.only(u);return A?re.cloneElement(A,{x:i,y:s,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,i){var s,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,A=c.height,h=c.traveller,f=c.ariaLabel,m=c.data,p=c.startIndex,g=c.endIndex,v=Math.max(n,this.props.x),x=JI(JI({},Gt(this.props,!1)),{},{x:v,y:u,width:d,height:A}),y=f||"Min value: ".concat((s=m[p])===null||s===void 0?void 0:s.name,", Max value: ").concat((o=m[g])===null||o===void 0?void 0:o.name);return re.createElement(Hr,{tabIndex:0,role:"slider","aria-label":y,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(C){["ArrowLeft","ArrowRight"].includes(C.key)&&(C.preventDefault(),C.stopPropagation(),l.handleTravellerMoveKeyboard(C.key==="ArrowRight"?1:-1,i))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,x))}},{key:"renderSlide",value:function(n,i){var s=this.props,o=s.y,l=s.height,c=s.stroke,u=s.travellerWidth,d=Math.min(n,i)+u,A=Math.max(Math.abs(i-n)-u,0);return re.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:o,width:A,height:l})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,s=n.endIndex,o=n.y,l=n.height,c=n.travellerWidth,u=n.stroke,d=this.state,A=d.startX,h=d.endX,f=5,m={pointerEvents:"none",fill:u};return re.createElement(Hr,{className:"recharts-brush-texts"},re.createElement(gg,zk({textAnchor:"end",verticalAnchor:"middle",x:Math.min(A,h)-f,y:o+l/2},m),this.getTextOfTick(i)),re.createElement(gg,zk({textAnchor:"start",verticalAnchor:"middle",x:Math.max(A,h)+c+f,y:o+l/2},m),this.getTextOfTick(s)))}},{key:"render",value:function(){var n=this.props,i=n.data,s=n.className,o=n.children,l=n.x,c=n.y,u=n.width,d=n.height,A=n.alwaysShowText,h=this.state,f=h.startX,m=h.endX,p=h.isTextActive,g=h.isSlideMoving,v=h.isTravellerMoving,x=h.isTravellerFocused;if(!i||!i.length||!rt(l)||!rt(c)||!rt(u)||!rt(d)||u<=0||d<=0)return null;var y=mr("recharts-brush",s),b=re.Children.count(o)===1,C=out("userSelect","none");return re.createElement(Hr,{className:y,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:C},this.renderBackground(),b&&this.renderPanorama(),this.renderSlide(f,m),this.renderTravellerLayer(f,"startX"),this.renderTravellerLayer(m,"endX"),(p||g||v||x||A)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,s=n.y,o=n.width,l=n.height,c=n.stroke,u=Math.floor(s+l/2)-1;return re.createElement(re.Fragment,null,re.createElement("rect",{x:i,y:s,width:o,height:l,fill:c,stroke:"none"}),re.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),re.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var s;return re.isValidElement(n)?s=re.cloneElement(n,i):rr(n)?s=n(i):s=t.renderDefaultTraveller(i),s}},{key:"getDerivedStateFromProps",value:function(n,i){var s=n.data,o=n.width,l=n.x,c=n.travellerWidth,u=n.updateId,d=n.startIndex,A=n.endIndex;if(s!==i.prevData||u!==i.prevUpdateId)return JI({prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},s&&s.length?put({data:s,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:A}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||l!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([l,l+o-c]);var h=i.scale.domain().map(function(f){return i.scale(f)});return{prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,i){for(var s=n.length,o=0,l=s-1;l-o>1;){var c=Math.floor((o+l)/2);n[c]>i?l=c:o=c}return i>=n[l]?l:o}}])}(w.PureComponent);rl(Zy,"displayName","Brush");rl(Zy,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var mut=yQ;function gut(e,t){var r;return mut(e,function(n,i,s){return r=t(n,i,s),!r}),!!r}var vut=gut,xut=zAe,yut=bd,but=vut,wut=zo,Cut=m4;function Nut(e,t,r){var n=wut(e)?xut:but;return r&&Cut(e,t,r)&&(t=void 0),n(e,yut(t))}var jut=Nut;const Sut=en(jut);var Zu=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},_q=Afe;function But(e,t,r){t=="__proto__"&&_q?_q(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var _ut=But,kut=_ut,Eut=ufe,Tut=bd;function Put(e,t){var r={};return t=Tut(t),Eut(e,function(n,i,s){kut(r,i,t(n,i,s))}),r}var Iut=Put;const Out=en(Iut);function Fut(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Jut(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Zut(e,t){var r=e.x,n=e.y,i=Yut(e,Kut),s="".concat(r),o=parseInt(s,10),l="".concat(n),c=parseInt(l,10),u="".concat(t.height||i.height),d=parseInt(u,10),A="".concat(t.width||i.width),h=parseInt(A,10);return Xb(Xb(Xb(Xb(Xb({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function Eq(e){return re.createElement(Xhe,tD({shapeType:"rectangle",propTransformer:Zut,activeClassName:"recharts-active-bar"},e))}var edt=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var s=rt(n)||Nze(n);return s?t(n,i):(s||yg(),r)}},tdt=["value","background"],ipe;function e0(e){"@babel/helpers - typeof";return e0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e0(e)}function rdt(e,t){if(e==null)return{};var r=ndt(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ndt(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Gk(){return Gk=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(R)0&&Math.abs(_)0&&(M=Math.min((V||0)-(_[X-1]||0),M))}),Number.isFinite(M)){var R=M/E,G=p.layout==="vertical"?n.height:n.width;if(p.padding==="gap"&&(S=R*G/2),p.padding==="no-gap"){var U=io(t.barCategoryGap,R*G),Q=R*G/2;S=Q-U-(Q-U)/G*U}}}i==="xAxis"?T=[n.left+(y.left||0)+(S||0),n.left+n.width-(y.right||0)-(S||0)]:i==="yAxis"?T=c==="horizontal"?[n.top+n.height-(y.bottom||0),n.top+(y.top||0)]:[n.top+(y.top||0)+(S||0),n.top+n.height-(y.bottom||0)-(S||0)]:T=p.range,C&&(T=[T[1],T[0]]);var z=Nhe(p,s,h),Y=z.scale,$=z.realScaleType;Y.domain(v).range(T),jhe(Y);var O=She(Y,Uc(Uc({},p),{},{realScaleType:$}));i==="xAxis"?(P=g==="top"&&!b||g==="bottom"&&b,B=n.left,I=A[j]-P*p.height):i==="yAxis"&&(P=g==="left"&&!b||g==="right"&&b,B=A[j]-P*p.width,I=n.top);var W=Uc(Uc(Uc({},p),O),{},{realScaleType:$,x:B,y:I,scale:Y,width:i==="xAxis"?n.width:p.width,height:i==="yAxis"?n.height:p.height});return W.bandSize=Tk(W,O),!p.hide&&i==="xAxis"?A[j]+=(P?-1:1)*W.height:p.hide||(A[j]+=(P?-1:1)*W.width),Uc(Uc({},f),{},I4({},m,W))},{})},lpe=function(t,r){var n=t.x,i=t.y,s=r.x,o=r.y;return{x:Math.min(n,s),y:Math.min(i,o),width:Math.abs(s-n),height:Math.abs(o-i)}},hdt=function(t){var r=t.x1,n=t.y1,i=t.x2,s=t.y2;return lpe({x:r,y:n},{x:i,y:s})},cpe=function(){function e(t){ddt(this,e),this.scale=t}return Adt(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,s=n.position;if(r!==void 0){if(s)switch(s){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],s=n[n.length-1];return i<=s?r>=i&&r<=s:r>=s&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();I4(cpe,"EPS",1e-4);var XQ=function(t){var r=Object.keys(t).reduce(function(n,i){return Uc(Uc({},n),{},I4({},i,cpe.create(t[i])))},{});return Uc(Uc({},r),{},{apply:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=s.bandAware,l=s.position;return Out(i,function(c,u){return r[u].apply(c,{bandAware:o,position:l})})},isInRange:function(i){return npe(i,function(s,o){return r[o].isInRange(s)})}})};function pdt(e){return(e%180+180)%180}var mdt=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=pdt(i),o=s*Math.PI/180,l=Math.atan(n/r),c=o>l&&o-1?i[s?t[o]:o]:void 0}}var bdt=ydt,wdt=Zhe;function Cdt(e){var t=wdt(e),r=t%1;return t===t?r?t-r:t:0}var Ndt=Cdt,jdt=ife,Sdt=bd,Bdt=Ndt,_dt=Math.max;function kdt(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:Bdt(r);return i<0&&(i=_dt(n+i,0)),jdt(e,Sdt(t),i)}var Edt=kdt,Tdt=bdt,Pdt=Edt,Idt=Tdt(Pdt),Odt=Idt;const Fdt=en(Odt);var Ldt=_$e(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),YQ=w.createContext(void 0),JQ=w.createContext(void 0),upe=w.createContext(void 0),dpe=w.createContext({}),Ape=w.createContext(void 0),fpe=w.createContext(0),hpe=w.createContext(0),Fq=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,s=r.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=Ldt(s);return re.createElement(YQ.Provider,{value:n},re.createElement(JQ.Provider,{value:i},re.createElement(dpe.Provider,{value:s},re.createElement(upe.Provider,{value:d},re.createElement(Ape.Provider,{value:o},re.createElement(fpe.Provider,{value:u},re.createElement(hpe.Provider,{value:c},l)))))))},Mdt=function(){return w.useContext(Ape)},ppe=function(t){var r=w.useContext(YQ);r==null&&yg();var n=r[t];return n==null&&yg(),n},Ddt=function(){var t=w.useContext(YQ);return Rf(t)},Rdt=function(){var t=w.useContext(JQ),r=Fdt(t,function(n){return npe(n.domain,Number.isFinite)});return r||Rf(t)},mpe=function(t){var r=w.useContext(JQ);r==null&&yg();var n=r[t];return n==null&&yg(),n},Udt=function(){var t=w.useContext(upe);return t},Qdt=function(){return w.useContext(dpe)},ZQ=function(){return w.useContext(hpe)},e7=function(){return w.useContext(fpe)};function t0(e){"@babel/helpers - typeof";return t0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t0(e)}function Hdt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $dt(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var s=r();return e*(t-e*s/2-n)>=0&&e*(t+e*s/2-i)<=0}function NAt(e,t){return Cpe(e,t+1)}function jAt(e,t,r,n,i){for(var s=(n||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,A=function(){var m=n==null?void 0:n[c];if(m===void 0)return{v:Cpe(n,u)};var p=c,g,v=function(){return g===void 0&&(g=r(m,p)),g},x=m.coordinate,y=c===0||Yk(e,x,v,d,l);y||(c=0,d=o,u+=1),y&&(d=x+e*(v()/2+i),c+=u)},h;u<=s.length;)if(h=A(),h)return h.v;return[]}function W2(e){"@babel/helpers - typeof";return W2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W2(e)}function $q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ta(e){for(var t=1;t0?f.coordinate-g*e:f.coordinate})}else s[h]=f=Ta(Ta({},f),{},{tickCoord:f.coordinate});var v=Yk(e,f.tickCoord,p,l,c);v&&(c=f.tickCoord-e*(p()/2+i),s[h]=Ta(Ta({},f),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return s}function EAt(e,t,r,n,i,s){var o=(n||[]).slice(),l=o.length,c=t.start,u=t.end;if(s){var d=n[l-1],A=r(d,l-1),h=e*(d.coordinate+e*A/2-u);o[l-1]=d=Ta(Ta({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var f=Yk(e,d.tickCoord,function(){return A},c,u);f&&(u=d.tickCoord-e*(A/2+i),o[l-1]=Ta(Ta({},d),{},{isShow:!0}))}for(var m=s?l-1:l,p=function(x){var y=o[x],b,C=function(){return b===void 0&&(b=r(y,x)),b};if(x===0){var j=e*(y.coordinate-e*C()/2-c);o[x]=y=Ta(Ta({},y),{},{tickCoord:j<0?y.coordinate-j*e:y.coordinate})}else o[x]=y=Ta(Ta({},y),{},{tickCoord:y.coordinate});var S=Yk(e,y.tickCoord,C,c,u);S&&(c=y.tickCoord+e*(C()/2+i),o[x]=Ta(Ta({},y),{},{isShow:!0}))},g=0;g=2?no(i[1].coordinate-i[0].coordinate):1,v=CAt(s,g,f);return c==="equidistantPreserveStart"?jAt(g,v,p,i,o):(c==="preserveStart"||c==="preserveStartEnd"?h=EAt(g,v,p,i,o,c==="preserveStartEnd"):h=kAt(g,v,p,i,o),h.filter(function(x){return x.isShow}))}var TAt=["viewBox"],PAt=["viewBox"],IAt=["ticks"];function i0(e){"@babel/helpers - typeof";return i0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i0(e)}function mx(){return mx=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function OAt(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function FAt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wq(e,t){for(var r=0;r0?c(this.props):c(f)),o<=0||l<=0||!m||!m.length?null:re.createElement(Hr,{className:mr("recharts-cartesian-axis",u),ref:function(g){n.layerReference=g}},s&&this.renderAxisLine(),this.renderTicks(m,this.state.fontSize,this.state.letterSpacing),Us.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,s){var o,l=mr(i.className,"recharts-cartesian-axis-tick-value");return re.isValidElement(n)?o=re.cloneElement(n,bs(bs({},i),{},{className:l})):rr(n)?o=n(bs(bs({},i),{},{className:l})):o=re.createElement(gg,mx({},i,{className:"recharts-cartesian-axis-tick-value"}),s),o}}])}(w.Component);i7(J0,"displayName","CartesianAxis");i7(J0,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var HAt=["x1","y1","x2","y2","key"],$At=["offset"];function bg(e){"@babel/helpers - typeof";return bg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bg(e)}function Gq(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Fa(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function KAt(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var VAt=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,s=t.y,o=t.width,l=t.height,c=t.ry;return re.createElement("rect",{x:i,y:s,ry:c,width:o,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function Spe(e,t){var r;if(re.isValidElement(e))r=re.cloneElement(e,t);else if(rr(e))r=e(t);else{var n=t.x1,i=t.y1,s=t.x2,o=t.y2,l=t.key,c=Kq(t,HAt),u=Gt(c,!1);u.offset;var d=Kq(u,$At);r=re.createElement("line",Am({},d,{x1:n,y1:i,x2:s,y2:o,fill:"none",key:l}))}return r}function qAt(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,s=e.horizontalPoints;if(!i||!s||!s.length)return null;var o=s.map(function(l,c){var u=Fa(Fa({},e),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return Spe(i,u)});return re.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function XAt(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,s=e.verticalPoints;if(!i||!s||!s.length)return null;var o=s.map(function(l,c){var u=Fa(Fa({},e),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return Spe(i,u)});return re.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function YAt(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,s=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(h){return Math.round(h+i-i)}).sort(function(h,f){return h-f});i!==d[0]&&d.unshift(0);var A=d.map(function(h,f){var m=!d[f+1],p=m?i+o-h:d[f+1]-h;if(p<=0)return null;var g=f%t.length;return re.createElement("rect",{key:"react-".concat(f),y:h,x:n,height:p,width:s,stroke:"none",fill:t[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return re.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},A)}function JAt(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,s=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var d=u.map(function(h){return Math.round(h+s-s)}).sort(function(h,f){return h-f});s!==d[0]&&d.unshift(0);var A=d.map(function(h,f){var m=!d[f+1],p=m?s+l-h:d[f+1]-h;if(p<=0)return null;var g=f%n.length;return re.createElement("rect",{key:"react-".concat(f),x:h,y:o,width:p,height:c,stroke:"none",fill:n[g],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return re.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},A)}var ZAt=function(t,r){var n=t.xAxis,i=t.width,s=t.height,o=t.offset;return Che(n7(Fa(Fa(Fa({},J0.defaultProps),n),{},{ticks:mA(n,!0),viewBox:{x:0,y:0,width:i,height:s}})),o.left,o.left+o.width,r)},eft=function(t,r){var n=t.yAxis,i=t.width,s=t.height,o=t.offset;return Che(n7(Fa(Fa(Fa({},J0.defaultProps),n),{},{ticks:mA(n,!0),viewBox:{x:0,y:0,width:i,height:s}})),o.top,o.top+o.height,r)},Sv={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Zk(e){var t,r,n,i,s,o,l=ZQ(),c=e7(),u=Qdt(),d=Fa(Fa({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Sv.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Sv.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Sv.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Sv.horizontalFill,vertical:(s=e.vertical)!==null&&s!==void 0?s:Sv.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Sv.verticalFill,x:rt(e.x)?e.x:u.left,y:rt(e.y)?e.y:u.top,width:rt(e.width)?e.width:u.width,height:rt(e.height)?e.height:u.height}),A=d.x,h=d.y,f=d.width,m=d.height,p=d.syncWithTicks,g=d.horizontalValues,v=d.verticalValues,x=Ddt(),y=Rdt();if(!rt(f)||f<=0||!rt(m)||m<=0||!rt(A)||A!==+A||!rt(h)||h!==+h)return null;var b=d.verticalCoordinatesGenerator||ZAt,C=d.horizontalCoordinatesGenerator||eft,j=d.horizontalPoints,S=d.verticalPoints;if((!j||!j.length)&&rr(C)){var T=g&&g.length,B=C({yAxis:y?Fa(Fa({},y),{},{ticks:T?g:y.ticks}):void 0,width:l,height:c,offset:u},T?!0:p);Jc(Array.isArray(B),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(bg(B),"]")),Array.isArray(B)&&(j=B)}if((!S||!S.length)&&rr(b)){var I=v&&v.length,P=b({xAxis:x?Fa(Fa({},x),{},{ticks:I?v:x.ticks}):void 0,width:l,height:c,offset:u},I?!0:p);Jc(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(bg(P),"]")),Array.isArray(P)&&(S=P)}return re.createElement("g",{className:"recharts-cartesian-grid"},re.createElement(VAt,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),re.createElement(qAt,Am({},d,{offset:u,horizontalPoints:j,xAxis:x,yAxis:y})),re.createElement(XAt,Am({},d,{offset:u,verticalPoints:S,xAxis:x,yAxis:y})),re.createElement(YAt,Am({},d,{horizontalPoints:j})),re.createElement(JAt,Am({},d,{verticalPoints:S})))}Zk.displayName="CartesianGrid";var tft=["type","layout","connectNulls","ref"],rft=["key"];function s0(e){"@babel/helpers - typeof";return s0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s0(e)}function Vq(e,t){if(e==null)return{};var r=nft(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nft(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function o1(){return o1=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rA){f=[].concat(Bv(c.slice(0,m)),[A-p]);break}var g=f.length%2===0?[0,h]:[h];return[].concat(Bv(t.repeat(c,d)),Bv(f),g).map(function(v){return"".concat(v,"px")}).join(", ")}),Qc(r,"id",Dg("recharts-line-")),Qc(r,"pathRef",function(o){r.mainCurve=o}),Qc(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Qc(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return fft(t,e),cft(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,o=s.points,l=s.xAxis,c=s.yAxis,u=s.layout,d=s.children,A=bl(d,YC);if(!A)return null;var h=function(p,g){return{x:p.x,y:p.y,value:p.value,errorVal:qi(p.payload,g)}},f={clipPath:n?"url(#clipPath-".concat(i,")"):null};return re.createElement(Hr,f,A.map(function(m){return re.cloneElement(m,{key:"bar-".concat(m.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,i,s){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,d=l.dataKey,A=Gt(this.props,!1),h=Gt(c,!0),f=u.map(function(p,g){var v=el(el(el({key:"dot-".concat(g),r:3},A),h),{},{index:g,cx:p.x,cy:p.y,value:p.value,dataKey:d,payload:p.payload,points:u});return t.renderDotItem(c,v)}),m={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(s,")"):null};return re.createElement(Hr,o1({className:"recharts-line-dots",key:"dots"},m),f)}},{key:"renderCurveStatically",value:function(n,i,s,o){var l=this.props,c=l.type,u=l.layout,d=l.connectNulls;l.ref;var A=Vq(l,tft),h=el(el(el({},Gt(A,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(s,")"):null,points:n},o),{},{type:c,layout:u,connectNulls:d});return re.createElement($m,o1({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var s=this,o=this.props,l=o.points,c=o.strokeDasharray,u=o.isAnimationActive,d=o.animationBegin,A=o.animationDuration,h=o.animationEasing,f=o.animationId,m=o.animateNewValues,p=o.width,g=o.height,v=this.state,x=v.prevPoints,y=v.totalLength;return re.createElement(ou,{begin:d,duration:A,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(b){var C=b.t;if(x){var j=x.length/l.length,S=l.map(function(E,M){var _=Math.floor(M*j);if(x[_]){var R=x[_],G=Bs(R.x,E.x),U=Bs(R.y,E.y);return el(el({},E),{},{x:G(C),y:U(C)})}if(m){var Q=Bs(p*2,E.x),z=Bs(g/2,E.y);return el(el({},E),{},{x:Q(C),y:z(C)})}return el(el({},E),{},{x:E.x,y:E.y})});return s.renderCurveStatically(S,n,i)}var T=Bs(0,y),B=T(C),I;if(c){var P="".concat(c).split(/[,\s]+/gim).map(function(E){return parseFloat(E)});I=s.getStrokeDasharray(B,y,P)}else I=s.generateSimpleStrokeDasharray(y,B);return s.renderCurveStatically(l,n,i,{strokeDasharray:I})})}},{key:"renderCurve",value:function(n,i){var s=this.props,o=s.points,l=s.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return l&&o&&o.length&&(!u&&d>0||!vg(u,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,s=i.hide,o=i.dot,l=i.points,c=i.className,u=i.xAxis,d=i.yAxis,A=i.top,h=i.left,f=i.width,m=i.height,p=i.isAnimationActive,g=i.id;if(s||!l||!l.length)return null;var v=this.state.isAnimationFinished,x=l.length===1,y=mr("recharts-line",c),b=u&&u.allowDataOverflow,C=d&&d.allowDataOverflow,j=b||C,S=fr(g)?this.id:g,T=(n=Gt(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},B=T.r,I=B===void 0?3:B,P=T.strokeWidth,E=P===void 0?2:P,M=pAe(o)?o:{},_=M.clipDot,R=_===void 0?!0:_,G=I*2+E;return re.createElement(Hr,{className:y},b||C?re.createElement("defs",null,re.createElement("clipPath",{id:"clipPath-".concat(S)},re.createElement("rect",{x:b?h:h-f/2,y:C?A:A-m/2,width:b?f:f*2,height:C?m:m*2})),!R&&re.createElement("clipPath",{id:"clipPath-dots-".concat(S)},re.createElement("rect",{x:h-G/2,y:A-G/2,width:f+G,height:m+G}))):null,!x&&this.renderCurve(j,S),this.renderErrorBar(j,S),(x||o)&&this.renderDots(j,R,S),(!p||v)&&Ju.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var s=n.length%2!==0?[].concat(Bv(n),[0]):n,o=[],l=0;l=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function gft(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function fm(){return fm=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!vg(d,o)||!vg(A,l))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(o,l,n,i)}},{key:"render",value:function(){var n,i=this.props,s=i.hide,o=i.dot,l=i.points,c=i.className,u=i.top,d=i.left,A=i.xAxis,h=i.yAxis,f=i.width,m=i.height,p=i.isAnimationActive,g=i.id;if(s||!l||!l.length)return null;var v=this.state.isAnimationFinished,x=l.length===1,y=mr("recharts-area",c),b=A&&A.allowDataOverflow,C=h&&h.allowDataOverflow,j=b||C,S=fr(g)?this.id:g,T=(n=Gt(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},B=T.r,I=B===void 0?3:B,P=T.strokeWidth,E=P===void 0?2:P,M=pAe(o)?o:{},_=M.clipDot,R=_===void 0?!0:_,G=I*2+E;return re.createElement(Hr,{className:y},b||C?re.createElement("defs",null,re.createElement("clipPath",{id:"clipPath-".concat(S)},re.createElement("rect",{x:b?d:d-f/2,y:C?u:u-m/2,width:b?f:f*2,height:C?m:m*2})),!R&&re.createElement("clipPath",{id:"clipPath-dots-".concat(S)},re.createElement("rect",{x:d-G/2,y:u-G/2,width:f+G,height:m+G}))):null,x?null:this.renderArea(j,S),(o||x)&&this.renderDots(j,R,S),(!p||v)&&Ju.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(w.PureComponent);kpe=dp;$u(dp,"displayName","Area");$u(dp,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Zc.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});$u(dp,"getBaseValue",function(e,t,r,n){var i=e.layout,s=e.baseValue,o=t.props.baseValue,l=o??s;if(rt(l)&&typeof l=="number")return l;var c=i==="horizontal"?n:r,u=c.scale.domain();if(c.type==="number"){var d=Math.max(u[0],u[1]),A=Math.min(u[0],u[1]);return l==="dataMin"?A:l==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});$u(dp,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,i=e.yAxis,s=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,A=e.displayedData,h=e.offset,f=t.layout,m=u&&u.length,p=kpe.getBaseValue(t,r,n,i),g=f==="horizontal",v=!1,x=A.map(function(b,C){var j;m?j=u[d+C]:(j=qi(b,c),Array.isArray(j)?v=!0:j=[p,j]);var S=j[1]==null||m&&qi(b,c)==null;return g?{x:Ek({axis:n,ticks:s,bandSize:l,entry:b,index:C}),y:S?null:i.scale(j[1]),value:j,payload:b}:{x:S?null:n.scale(j[1]),y:Ek({axis:i,ticks:o,bandSize:l,entry:b,index:C}),value:j,payload:b}}),y;return m||v?y=x.map(function(b){var C=Array.isArray(b.value)?b.value[0]:null;return g?{x:b.x,y:C!=null&&b.y!=null?i.scale(C):null}:{x:C!=null?n.scale(C):null,y:b.y}}):y=g?i.scale(p):n.scale(p),wf({points:x,baseLine:y,layout:f,isRange:v},h)});$u(dp,"renderDotItem",function(e,t){var r;if(re.isValidElement(e))r=re.cloneElement(e,t);else if(rr(e))r=e(t);else{var n=mr("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,s=Epe(t,mft);r=re.createElement(JC,fm({},s,{key:i,className:n}))}return r});function o0(e){"@babel/helpers - typeof";return o0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o0(e)}function jft(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sft(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Aht(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function fht(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hht(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&rt(i)&&rt(s)?t.slice(i,s+1):[]};function Gpe(e){return e==="number"?[0,"auto"]:void 0}var bD=function(t,r,n,i){var s=t.graphicalItems,o=t.tooltipAxis,l=D4(r,t);return n<0||!s||!s.length||n>=l.length?null:s.reduce(function(c,u){var d,A=(d=u.props.data)!==null&&d!==void 0?d:r;A&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(A=A.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var f=A===void 0?l:A;h=rk(f,o.dataKey,i)}else h=A&&A[n]||l[n];return h?[].concat(u0(c),[_he(u,h)]):c},[])},iX=function(t,r,n,i){var s=i||{x:t.chartX,y:t.chartY},o=Sht(s,n),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=Dit(o,l,u,c);if(d>=0&&u){var A=u[d]&&u[d].value,h=bD(t,r,d,A),f=Bht(n,l,d,s);return{activeTooltipIndex:d,activeLabel:A,activePayload:h,activeCoordinate:f}}return null},_ht=function(t,r){var n=r.axes,i=r.graphicalItems,s=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,A=t.children,h=t.stackOffset,f=whe(d,s);return n.reduce(function(m,p){var g,v=p.type.defaultProps!==void 0?He(He({},p.type.defaultProps),p.props):p.props,x=v.type,y=v.dataKey,b=v.allowDataOverflow,C=v.allowDuplicatedCategory,j=v.scale,S=v.ticks,T=v.includeHidden,B=v[o];if(m[B])return m;var I=D4(t.data,{graphicalItems:i.filter(function(O){var W,V=o in O.props?O.props[o]:(W=O.type.defaultProps)===null||W===void 0?void 0:W[o];return V===B}),dataStartIndex:c,dataEndIndex:u}),P=I.length,E,M,_;eht(v.domain,b,x)&&(E=OM(v.domain,null,b),f&&(x==="number"||j!=="auto")&&(_=n1(I,y,"category")));var R=Gpe(x);if(!E||E.length===0){var G,U=(G=v.domain)!==null&&G!==void 0?G:R;if(y){if(E=n1(I,y,x),x==="category"&&f){var Q=Sze(E);C&&Q?(M=E,E=$k(0,P)):C||(E=NV(U,E,p).reduce(function(O,W){return O.indexOf(W)>=0?O:[].concat(u0(O),[W])},[]))}else if(x==="category")C?E=E.filter(function(O){return O!==""&&!fr(O)}):E=NV(U,E,p).reduce(function(O,W){return O.indexOf(W)>=0||W===""||fr(W)?O:[].concat(u0(O),[W])},[]);else if(x==="number"){var z=$it(I,i.filter(function(O){var W,V,X=o in O.props?O.props[o]:(W=O.type.defaultProps)===null||W===void 0?void 0:W[o],ne="hide"in O.props?O.props.hide:(V=O.type.defaultProps)===null||V===void 0?void 0:V.hide;return X===B&&(T||!ne)}),y,s,d);z&&(E=z)}f&&(x==="number"||j!=="auto")&&(_=n1(I,y,"category"))}else f?E=$k(0,P):l&&l[B]&&l[B].hasStack&&x==="number"?E=h==="expand"?[0,1]:Bhe(l[B].stackGroups,c,u):E=bhe(I,i.filter(function(O){var W=o in O.props?O.props[o]:O.type.defaultProps[o],V="hide"in O.props?O.props.hide:O.type.defaultProps.hide;return W===B&&(T||!V)}),x,d,!0);if(x==="number")E=vD(A,E,B,s,S),U&&(E=OM(U,E,b));else if(x==="category"&&U){var Y=U,$=E.every(function(O){return Y.indexOf(O)>=0});$&&(E=Y)}}return He(He({},m),{},tr({},B,He(He({},v),{},{axisType:s,domain:E,categoricalDomain:_,duplicateDomain:M,originalDomain:(g=v.domain)!==null&&g!==void 0?g:R,isCategorical:f,layout:d})))},{})},kht=function(t,r){var n=r.graphicalItems,i=r.Axis,s=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,A=t.children,h=D4(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),f=h.length,m=whe(d,s),p=-1;return n.reduce(function(g,v){var x=v.type.defaultProps!==void 0?He(He({},v.type.defaultProps),v.props):v.props,y=x[o],b=Gpe("number");if(!g[y]){p++;var C;return m?C=$k(0,f):l&&l[y]&&l[y].hasStack?(C=Bhe(l[y].stackGroups,c,u),C=vD(A,C,y,s)):(C=OM(b,bhe(h,n.filter(function(j){var S,T,B=o in j.props?j.props[o]:(S=j.type.defaultProps)===null||S===void 0?void 0:S[o],I="hide"in j.props?j.props.hide:(T=j.type.defaultProps)===null||T===void 0?void 0:T.hide;return B===y&&!I}),"number",d),i.defaultProps.allowDataOverflow),C=vD(A,C,y,s)),He(He({},g),{},tr({},y,He(He({axisType:s},i.defaultProps),{},{hide:!0,orientation:yl(Nht,"".concat(s,".").concat(p%2),null),domain:C,originalDomain:b,isCategorical:m,layout:d})))}return g},{})},Eht=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,s=r.AxisComp,o=r.graphicalItems,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.children,A="".concat(i,"Id"),h=bl(d,s),f={};return h&&h.length?f=_ht(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:A,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(f=kht(t,{Axis:s,graphicalItems:o,axisType:i,axisIdKey:A,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),f},Tht=function(t){var r=Rf(t),n=mA(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:bQ(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Tk(r,n)}},sX=function(t){var r=t.children,n=t.defaultShowTooltip,i=al(r,Zy),s=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(s=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:s,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},Pht=function(t){return!t||!t.length?!1:t.some(function(r){var n=bA(r&&r.type);return n&&n.indexOf("Bar")>=0})},aX=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Iht=function(t,r){var n=t.props,i=t.graphicalItems,s=t.xAxisMap,o=s===void 0?{}:s,l=t.yAxisMap,c=l===void 0?{}:l,u=n.width,d=n.height,A=n.children,h=n.margin||{},f=al(A,Zy),m=al(A,Um),p=Object.keys(c).reduce(function(C,j){var S=c[j],T=S.orientation;return!S.mirror&&!S.hide?He(He({},C),{},tr({},T,C[T]+S.width)):C},{left:h.left||0,right:h.right||0}),g=Object.keys(o).reduce(function(C,j){var S=o[j],T=S.orientation;return!S.mirror&&!S.hide?He(He({},C),{},tr({},T,yl(C,"".concat(T))+S.height)):C},{top:h.top||0,bottom:h.bottom||0}),v=He(He({},g),p),x=v.bottom;f&&(v.bottom+=f.props.height||Zy.defaultProps.height),m&&r&&(v=Qit(v,i,n,r));var y=u-v.left-v.right,b=d-v.top-v.bottom;return He(He({brushBottom:x},v),{},{width:Math.max(y,0),height:Math.max(b,0)})},Oht=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},R4=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,s=i===void 0?"axis":i,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,A=t.defaultProps,h=function(v,x){var y=x.graphicalItems,b=x.stackGroups,C=x.offset,j=x.updateId,S=x.dataStartIndex,T=x.dataEndIndex,B=v.barSize,I=v.layout,P=v.barGap,E=v.barCategoryGap,M=v.maxBarSize,_=aX(I),R=_.numericAxisName,G=_.cateAxisName,U=Pht(y),Q=[];return y.forEach(function(z,Y){var $=D4(v.data,{graphicalItems:[z],dataStartIndex:S,dataEndIndex:T}),O=z.type.defaultProps!==void 0?He(He({},z.type.defaultProps),z.props):z.props,W=O.dataKey,V=O.maxBarSize,X=O["".concat(R,"Id")],ne=O["".concat(G,"Id")],oe={},pe=c.reduce(function(je,xe){var Ie=x["".concat(xe.axisType,"Map")],Ke=O["".concat(xe.axisType,"Id")];Ie&&Ie[Ke]||xe.axisType==="zAxis"||yg();var De=Ie[Ke];return He(He({},je),{},tr(tr({},xe.axisType,De),"".concat(xe.axisType,"Ticks"),mA(De)))},oe),de=pe[G],ge=pe["".concat(G,"Ticks")],ie=b&&b[X]&&b[X].hasStack&&Jit(z,b[X].stackGroups),ue=bA(z.type).indexOf("Bar")>=0,Se=Tk(de,ge),D=[],K=U&&Rit({barSize:B,stackGroups:b,totalSize:Oht(pe,G)});if(ue){var we,ae,te=fr(V)?M:V,ce=(we=(ae=Tk(de,ge,!0))!==null&&ae!==void 0?ae:te)!==null&&we!==void 0?we:0;D=Uit({barGap:P,barCategoryGap:E,bandSize:ce!==Se?ce:Se,sizeList:K[ne],maxBarSize:te}),ce!==Se&&(D=D.map(function(je){return He(He({},je),{},{position:He(He({},je.position),{},{offset:je.position.offset-ce/2})})}))}var be=z&&z.type&&z.type.getComposedData;be&&Q.push({props:He(He({},be(He(He({},pe),{},{displayedData:$,props:v,dataKey:W,item:z,bandSize:Se,barPosition:D,offset:C,stackedData:ie,layout:I,dataStartIndex:S,dataEndIndex:T}))),{},tr(tr(tr({key:z.key||"item-".concat(Y)},R,pe[R]),G,pe[G]),"animationId",j)),childIndex:Dze(z,v.children),item:z})}),Q},f=function(v,x){var y=v.props,b=v.dataStartIndex,C=v.dataEndIndex,j=v.updateId;if(!vG({props:y}))return null;var S=y.children,T=y.layout,B=y.stackOffset,I=y.data,P=y.reverseStackOrder,E=aX(T),M=E.numericAxisName,_=E.cateAxisName,R=bl(S,n),G=Xit(I,R,"".concat(M,"Id"),"".concat(_,"Id"),B,P),U=c.reduce(function(O,W){var V="".concat(W.axisType,"Map");return He(He({},O),{},tr({},V,Eht(y,He(He({},W),{},{graphicalItems:R,stackGroups:W.axisType===M&&G,dataStartIndex:b,dataEndIndex:C}))))},{}),Q=Iht(He(He({},U),{},{props:y,graphicalItems:R}),x==null?void 0:x.legendBBox);Object.keys(U).forEach(function(O){U[O]=d(y,U[O],Q,O.replace("Map",""),r)});var z=U["".concat(_,"Map")],Y=Tht(z),$=h(y,He(He({},U),{},{dataStartIndex:b,dataEndIndex:C,updateId:j,graphicalItems:R,stackGroups:G,offset:Q}));return He(He({formattedGraphicalItems:$,graphicalItems:R,offset:Q,stackGroups:G},Y),U)},m=function(g){function v(x){var y,b,C;return fht(this,v),C=mht(this,v,[x]),tr(C,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),tr(C,"accessibilityManager",new Zft),tr(C,"handleLegendBBoxUpdate",function(j){if(j){var S=C.state,T=S.dataStartIndex,B=S.dataEndIndex,I=S.updateId;C.setState(He({legendBBox:j},f({props:C.props,dataStartIndex:T,dataEndIndex:B,updateId:I},He(He({},C.state),{},{legendBBox:j}))))}}),tr(C,"handleReceiveSyncEvent",function(j,S,T){if(C.props.syncId===j){if(T===C.eventEmitterSymbol&&typeof C.props.syncMethod!="function")return;C.applySyncEvent(S)}}),tr(C,"handleBrushChange",function(j){var S=j.startIndex,T=j.endIndex;if(S!==C.state.dataStartIndex||T!==C.state.dataEndIndex){var B=C.state.updateId;C.setState(function(){return He({dataStartIndex:S,dataEndIndex:T},f({props:C.props,dataStartIndex:S,dataEndIndex:T,updateId:B},C.state))}),C.triggerSyncEvent({dataStartIndex:S,dataEndIndex:T})}}),tr(C,"handleMouseEnter",function(j){var S=C.getMouseInfo(j);if(S){var T=He(He({},S),{},{isTooltipActive:!0});C.setState(T),C.triggerSyncEvent(T);var B=C.props.onMouseEnter;rr(B)&&B(T,j)}}),tr(C,"triggeredAfterMouseMove",function(j){var S=C.getMouseInfo(j),T=S?He(He({},S),{},{isTooltipActive:!0}):{isTooltipActive:!1};C.setState(T),C.triggerSyncEvent(T);var B=C.props.onMouseMove;rr(B)&&B(T,j)}),tr(C,"handleItemMouseEnter",function(j){C.setState(function(){return{isTooltipActive:!0,activeItem:j,activePayload:j.tooltipPayload,activeCoordinate:j.tooltipPosition||{x:j.cx,y:j.cy}}})}),tr(C,"handleItemMouseLeave",function(){C.setState(function(){return{isTooltipActive:!1}})}),tr(C,"handleMouseMove",function(j){j.persist(),C.throttleTriggeredAfterMouseMove(j)}),tr(C,"handleMouseLeave",function(j){C.throttleTriggeredAfterMouseMove.cancel();var S={isTooltipActive:!1};C.setState(S),C.triggerSyncEvent(S);var T=C.props.onMouseLeave;rr(T)&&T(S,j)}),tr(C,"handleOuterEvent",function(j){var S=Mze(j),T=yl(C.props,"".concat(S));if(S&&rr(T)){var B,I;/.*touch.*/i.test(S)?I=C.getMouseInfo(j.changedTouches[0]):I=C.getMouseInfo(j),T((B=I)!==null&&B!==void 0?B:{},j)}}),tr(C,"handleClick",function(j){var S=C.getMouseInfo(j);if(S){var T=He(He({},S),{},{isTooltipActive:!0});C.setState(T),C.triggerSyncEvent(T);var B=C.props.onClick;rr(B)&&B(T,j)}}),tr(C,"handleMouseDown",function(j){var S=C.props.onMouseDown;if(rr(S)){var T=C.getMouseInfo(j);S(T,j)}}),tr(C,"handleMouseUp",function(j){var S=C.props.onMouseUp;if(rr(S)){var T=C.getMouseInfo(j);S(T,j)}}),tr(C,"handleTouchMove",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&C.throttleTriggeredAfterMouseMove(j.changedTouches[0])}),tr(C,"handleTouchStart",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&C.handleMouseDown(j.changedTouches[0])}),tr(C,"handleTouchEnd",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&C.handleMouseUp(j.changedTouches[0])}),tr(C,"handleDoubleClick",function(j){var S=C.props.onDoubleClick;if(rr(S)){var T=C.getMouseInfo(j);S(T,j)}}),tr(C,"handleContextMenu",function(j){var S=C.props.onContextMenu;if(rr(S)){var T=C.getMouseInfo(j);S(T,j)}}),tr(C,"triggerSyncEvent",function(j){C.props.syncId!==void 0&&e3.emit(t3,C.props.syncId,j,C.eventEmitterSymbol)}),tr(C,"applySyncEvent",function(j){var S=C.props,T=S.layout,B=S.syncMethod,I=C.state.updateId,P=j.dataStartIndex,E=j.dataEndIndex;if(j.dataStartIndex!==void 0||j.dataEndIndex!==void 0)C.setState(He({dataStartIndex:P,dataEndIndex:E},f({props:C.props,dataStartIndex:P,dataEndIndex:E,updateId:I},C.state)));else if(j.activeTooltipIndex!==void 0){var M=j.chartX,_=j.chartY,R=j.activeTooltipIndex,G=C.state,U=G.offset,Q=G.tooltipTicks;if(!U)return;if(typeof B=="function")R=B(Q,j);else if(B==="value"){R=-1;for(var z=0;z=0){var ie,ue;if(M.dataKey&&!M.allowDuplicatedCategory){var Se=typeof M.dataKey=="function"?ge:"payload.".concat(M.dataKey.toString());ie=rk(z,Se,R),ue=Y&&$&&rk($,Se,R)}else ie=z==null?void 0:z[_],ue=Y&&$&&$[_];if(ne||X){var D=j.props.activeIndex!==void 0?j.props.activeIndex:_;return[w.cloneElement(j,He(He(He({},B.props),pe),{},{activeIndex:D})),null,null]}if(!fr(ie))return[de].concat(u0(C.renderActivePoints({item:B,activePoint:ie,basePoint:ue,childIndex:_,isRange:Y})))}else{var K,we=(K=C.getItemByXY(C.state.activeCoordinate))!==null&&K!==void 0?K:{graphicalItem:de},ae=we.graphicalItem,te=ae.item,ce=te===void 0?j:te,be=ae.childIndex,je=He(He(He({},B.props),pe),{},{activeIndex:be});return[w.cloneElement(ce,je),null,null]}return Y?[de,null,null]:[de,null]}),tr(C,"renderCustomized",function(j,S,T){return w.cloneElement(j,He(He({key:"recharts-customized-".concat(T)},C.props),C.state))}),tr(C,"renderMap",{CartesianGrid:{handler:Rj,once:!0},ReferenceArea:{handler:C.renderReferenceElement},ReferenceLine:{handler:Rj},ReferenceDot:{handler:C.renderReferenceElement},XAxis:{handler:Rj},YAxis:{handler:Rj},Brush:{handler:C.renderBrush,once:!0},Bar:{handler:C.renderGraphicChild},Line:{handler:C.renderGraphicChild},Area:{handler:C.renderGraphicChild},Radar:{handler:C.renderGraphicChild},RadialBar:{handler:C.renderGraphicChild},Scatter:{handler:C.renderGraphicChild},Pie:{handler:C.renderGraphicChild},Funnel:{handler:C.renderGraphicChild},Tooltip:{handler:C.renderCursor,once:!0},PolarGrid:{handler:C.renderPolarGrid,once:!0},PolarAngleAxis:{handler:C.renderPolarAxis},PolarRadiusAxis:{handler:C.renderPolarAxis},Customized:{handler:C.renderCustomized}}),C.clipPathId="".concat((y=x.id)!==null&&y!==void 0?y:Dg("recharts"),"-clip"),C.throttleTriggeredAfterMouseMove=vfe(C.triggeredAfterMouseMove,(b=x.throttleDelay)!==null&&b!==void 0?b:1e3/60),C.state={},C}return xht(v,g),pht(v,[{key:"componentDidMount",value:function(){var y,b;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(y=this.props.margin.left)!==null&&y!==void 0?y:0,top:(b=this.props.margin.top)!==null&&b!==void 0?b:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var y=this.props,b=y.children,C=y.data,j=y.height,S=y.layout,T=al(b,Pa);if(T){var B=T.props.defaultIndex;if(!(typeof B!="number"||B<0||B>this.state.tooltipTicks.length-1)){var I=this.state.tooltipTicks[B]&&this.state.tooltipTicks[B].value,P=bD(this.state,C,B,I),E=this.state.tooltipTicks[B].coordinate,M=(this.state.offset.top+j)/2,_=S==="horizontal",R=_?{x:E,y:M}:{y:E,x:M},G=this.state.formattedGraphicalItems.find(function(Q){var z=Q.item;return z.type.name==="Scatter"});G&&(R=He(He({},R),G.props.points[B].tooltipPosition),P=G.props.points[B].tooltipPayload);var U={activeTooltipIndex:B,isTooltipActive:!0,activeLabel:I,activePayload:P,activeCoordinate:R};this.setState(U),this.renderCursor(T),this.accessibilityManager.setIndex(B)}}}},{key:"getSnapshotBeforeUpdate",value:function(y,b){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==b.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==y.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==y.margin){var C,j;this.accessibilityManager.setDetails({offset:{left:(C=this.props.margin.left)!==null&&C!==void 0?C:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0}})}return null}},{key:"componentDidUpdate",value:function(y){qL([al(y.children,Pa)],[al(this.props.children,Pa)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var y=al(this.props.children,Pa);if(y&&typeof y.props.shared=="boolean"){var b=y.props.shared?"axis":"item";return l.indexOf(b)>=0?b:s}return s}},{key:"getMouseInfo",value:function(y){if(!this.container)return null;var b=this.container,C=b.getBoundingClientRect(),j=det(C),S={chartX:Math.round(y.pageX-j.left),chartY:Math.round(y.pageY-j.top)},T=C.width/b.offsetWidth||1,B=this.inRange(S.chartX,S.chartY,T);if(!B)return null;var I=this.state,P=I.xAxisMap,E=I.yAxisMap,M=this.getTooltipEventType(),_=iX(this.state,this.props.data,this.props.layout,B);if(M!=="axis"&&P&&E){var R=Rf(P).scale,G=Rf(E).scale,U=R&&R.invert?R.invert(S.chartX):null,Q=G&&G.invert?G.invert(S.chartY):null;return He(He({},S),{},{xValue:U,yValue:Q},_)}return _?He(He({},S),_):null}},{key:"inRange",value:function(y,b){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=this.props.layout,S=y/C,T=b/C;if(j==="horizontal"||j==="vertical"){var B=this.state.offset,I=S>=B.left&&S<=B.left+B.width&&T>=B.top&&T<=B.top+B.height;return I?{x:S,y:T}:null}var P=this.state,E=P.angleAxisMap,M=P.radiusAxisMap;if(E&&M){var _=Rf(E);return BV({x:S,y:T},_)}return null}},{key:"parseEventsOfWrapper",value:function(){var y=this.props.children,b=this.getTooltipEventType(),C=al(y,Pa),j={};C&&b==="axis"&&(C.props.trigger==="click"?j={onClick:this.handleClick}:j={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var S=nk(this.props,this.handleOuterEvent);return He(He({},S),j)}},{key:"addListener",value:function(){e3.on(t3,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){e3.removeListener(t3,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(y,b,C){for(var j=this.state.formattedGraphicalItems,S=0,T=j.length;S{const o=s.country||"Unknown",l=s.profession||"Unknown";t[o]=(t[o]||0)+1,r[l]=(r[l]||0)+1});const n=Object.entries(t).sort((s,o)=>o[1]-s[1]).slice(0,10),i=Object.entries(r).sort((s,o)=>o[1]-s[1]).slice(0,10);return a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsx(lX,{title:"Top Countries",items:n,total:e.length}),a.jsx(lX,{title:"Top Professions",items:i,total:e.length})]})}function Rht({profiles:e,currentMonthKey:t}){const r=e.filter(n=>n.created_at.startsWith(t));return a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Users who signed up this month"}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b text-muted-foreground text-left",children:[a.jsx("th",{className:"pb-2 font-medium",children:"Name"}),a.jsx("th",{className:"pb-2 font-medium",children:"Email"}),a.jsx("th",{className:"pb-2 font-medium",children:"Country"}),a.jsx("th",{className:"pb-2 font-medium",children:"Joined"})]})}),a.jsxs("tbody",{children:[r.slice(0,20).map(n=>a.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[a.jsx("td",{className:"py-2",children:[n.first_name,n.second_name].filter(Boolean).join(" ")||"N/A"}),a.jsx("td",{className:"py-2 text-muted-foreground truncate max-w-[180px]",children:n.email||"N/A"}),a.jsx("td",{className:"py-2",children:n.country||"N/A"}),a.jsx("td",{className:"py-2 text-muted-foreground",children:ks(new Date(n.created_at),"MMM d, yyyy")})]},n.user_id)),r.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"py-4 text-center text-muted-foreground",children:"No new users this month"})})]})]})}),r.length>20&&a.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Showing 20 of ",r.length," new users"]})]})}function Uht({profiles:e,subscriptions:t}){const r=t.filter(l=>l.tier!=="free");new Map(t.map(l=>[l.user_id,l.tier]));const n=new Map(e.map(l=>[l.user_id,l])),i={};r.forEach(l=>{i[l.tier]=(i[l.tier]||0)+1});const s=Object.entries(i).sort((l,c)=>c[1]-l[1]),o=r.map(l=>({...n.get(l.user_id),tier:l.tier,user_id:l.user_id}));return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium mb-2",children:"Breakdown by Tier"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:s.map(([l,c])=>a.jsxs(bt,{variant:"secondary",className:"text-sm capitalize",children:[l,": ",c]},l))})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium mb-2",children:"Paid Users List"}),a.jsx("div",{className:"overflow-x-auto max-h-[300px] overflow-y-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{className:"sticky top-0 bg-background",children:a.jsxs("tr",{className:"border-b text-muted-foreground text-left",children:[a.jsx("th",{className:"pb-2 font-medium",children:"Name"}),a.jsx("th",{className:"pb-2 font-medium",children:"Email"}),a.jsx("th",{className:"pb-2 font-medium",children:"Tier"}),a.jsx("th",{className:"pb-2 font-medium",children:"Country"})]})}),a.jsxs("tbody",{children:[o.slice(0,30).map(l=>a.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[a.jsx("td",{className:"py-2",children:[l.first_name,l.second_name].filter(Boolean).join(" ")||"N/A"}),a.jsx("td",{className:"py-2 text-muted-foreground truncate max-w-[180px]",children:l.email||"N/A"}),a.jsx("td",{className:"py-2",children:a.jsx(bt,{variant:"default",className:"text-xs capitalize",children:l.tier})}),a.jsx("td",{className:"py-2",children:l.country||"N/A"})]},l.user_id)),o.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"py-4 text-center text-muted-foreground",children:"No paid users yet"})})]})]})})]})]})}function Qht({profiles:e,subscriptions:t}){const r=e.length,n=t.filter(o=>o.tier!=="free").length,i=r-n,s=r>0?(n/r*100).toFixed(1):"0";return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsx(Uo,{label:"Total Users",value:r}),a.jsx(Uo,{label:"Free Users",value:i}),a.jsx(Uo,{label:"Paid Users",value:n})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between text-sm mb-1",children:[a.jsx("span",{className:"text-muted-foreground",children:"Free to Paid Conversion"}),a.jsxs("span",{className:"font-medium",children:[s,"%"]})]}),a.jsx("div",{className:"w-full bg-muted rounded-full h-3",children:a.jsx("div",{className:"bg-primary rounded-full h-3 transition-all",style:{width:`${s}%`}})})]})]})}function Hht({usageRecords:e,currentMonthKey:t}){const r=e.filter(o=>o.month_year===t),n=[...r].sort((o,l)=>l.generations_used-o.generations_used).slice(0,10),i=r.reduce((o,l)=>o+l.generations_used,0),s=r.length>0?(i/r.length).toFixed(1):"0";return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsx(Uo,{label:"Total",value:i.toLocaleString()}),a.jsx(Uo,{label:"Active Users",value:r.length}),a.jsx(Uo,{label:"Avg per User",value:s})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium mb-2",children:"Top Generators This Month"}),a.jsxs("div",{className:"space-y-1.5",children:[n.map((o,l)=>a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsxs("span",{className:"text-muted-foreground truncate max-w-[200px]",children:["#",l+1," ",o.user_id.slice(0,8),"..."]}),a.jsxs("span",{className:"font-medium",children:[o.generations_used," gens"]})]},o.user_id)),n.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"No activity yet"})]})]})]})}function $ht({usageRecords:e,currentMonthKey:t}){const r=e.filter(o=>o.month_year===t),n=r.reduce((o,l)=>o+l.words_generated,0),i=r.length>0?Math.round(n/r.length).toLocaleString():"0",s=[...r].sort((o,l)=>l.words_generated-o.words_generated).slice(0,10);return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsx(Uo,{label:"Total Words",value:n.toLocaleString()}),a.jsx(Uo,{label:"Active Writers",value:r.filter(o=>o.words_generated>0).length}),a.jsx(Uo,{label:"Avg per User",value:i})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium mb-2",children:"Top Writers This Month"}),a.jsxs("div",{className:"space-y-1.5",children:[s.map((o,l)=>a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsxs("span",{className:"text-muted-foreground truncate max-w-[200px]",children:["#",l+1," ",o.user_id.slice(0,8),"..."]}),a.jsxs("span",{className:"font-medium",children:[o.words_generated.toLocaleString()," words"]})]},o.user_id)),s.length===0&&a.jsx("p",{className:"text-sm text-muted-foreground",children:"No activity yet"})]})]})]})}function zht({profiles:e,usageRecords:t,currentMonthKey:r}){const n=t.filter(d=>d.month_year===r&&d.generations_used>0),i=new Set(n.map(d=>d.user_id));new Map(n.map(d=>[d.user_id,d]));const s=e.length,o=i.size,l=s-o,c=new Map(e.map(d=>[d.user_id,d])),u=n.sort((d,A)=>A.generations_used-d.generations_used).map(d=>{const A=c.get(d.user_id);return{user_id:d.user_id,name:A&&[A.first_name,A.second_name].filter(Boolean).join(" ")||"N/A",email:(A==null?void 0:A.email)||"N/A",country:(A==null?void 0:A.country)||"N/A",profession:(A==null?void 0:A.profession)||"N/A",generations:d.generations_used,words:d.words_generated}});return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsx(Uo,{label:"Active",value:o}),a.jsx(Uo,{label:"Inactive",value:l}),a.jsx(Uo,{label:"Total",value:s})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between text-sm mb-1",children:[a.jsx("span",{className:"text-muted-foreground",children:"Activity Rate"}),a.jsxs("span",{className:"font-medium",children:[s>0?(o/s*100).toFixed(1):"0","%"]})]}),a.jsx("div",{className:"w-full bg-muted rounded-full h-3",children:a.jsx("div",{className:"bg-primary rounded-full h-3 transition-all",style:{width:`${s>0?o/s*100:0}%`}})})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium mb-2",children:"Active Users This Month"}),a.jsx("div",{className:"overflow-x-auto max-h-[300px] overflow-y-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{className:"sticky top-0 bg-background",children:a.jsxs("tr",{className:"border-b text-muted-foreground text-left",children:[a.jsx("th",{className:"pb-2 font-medium",children:"Name"}),a.jsx("th",{className:"pb-2 font-medium",children:"Email"}),a.jsx("th",{className:"pb-2 font-medium",children:"Country"}),a.jsx("th",{className:"pb-2 font-medium",children:"Generations"}),a.jsx("th",{className:"pb-2 font-medium",children:"Words"})]})}),a.jsxs("tbody",{children:[u.map(d=>a.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[a.jsx("td",{className:"py-2",children:d.name}),a.jsx("td",{className:"py-2 text-muted-foreground truncate max-w-[160px]",children:d.email}),a.jsx("td",{className:"py-2",children:d.country}),a.jsx("td",{className:"py-2 font-medium",children:d.generations}),a.jsx("td",{className:"py-2 text-muted-foreground",children:d.words.toLocaleString()})]},d.user_id)),u.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:5,className:"py-4 text-center text-muted-foreground",children:"No active users this month"})})]})]})}),u.length>0&&a.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Sorted by generations (highest first)"})]})]})}function Wht({profiles:e,usageRecords:t,currentMonthKey:r}){const n=t.filter(l=>l.month_year===r&&l.generations_used>0),i=new Set(n.map(l=>l.user_id)).size,s=e.length,o=s>0?(i/s*100).toFixed(1):"0";return a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Activity rate measures the percentage of registered users who have generated at least one piece of content this month."}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsx(Uo,{label:"Active Users",value:i}),a.jsx(Uo,{label:"Total Users",value:s})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between text-sm mb-1",children:[a.jsx("span",{className:"text-muted-foreground",children:"Rate"}),a.jsxs("span",{className:"font-medium",children:[o,"%"]})]}),a.jsx("div",{className:"w-full bg-muted rounded-full h-3",children:a.jsx("div",{className:"bg-primary rounded-full h-3 transition-all",style:{width:`${o}%`}})})]})]})}function lX({title:e,items:t,total:r}){return a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium mb-2",children:e}),a.jsx("div",{className:"space-y-1.5",children:t.map(([n,i])=>a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsx("span",{className:"text-muted-foreground truncate max-w-[150px]",children:n}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-medium",children:i}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",(i/r*100).toFixed(0),"%)"]})]})]},n))})]})}function Uo({label:e,value:t}){return a.jsx(_e,{children:a.jsxs(Ge,{className:"p-3 text-center",children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:e}),a.jsx("p",{className:"text-lg font-bold",children:t})]})})}const cX={free:"hsl(var(--muted-foreground))",lite:"hsl(142, 71%, 45%)",pro:"hsl(217, 91%, 60%)",elite:"hsl(45, 93%, 47%)",business:"hsl(280, 67%, 55%)",enterprise:"hsl(0, 84%, 60%)"},Ght={free:"Free",lite:"Lite",pro:"Pro",elite:"Elite",business:"Business",enterprise:"Enterprise"},Uj=["hsl(217, 91%, 60%)","hsl(142, 71%, 45%)","hsl(45, 93%, 47%)","hsl(280, 67%, 55%)","hsl(0, 84%, 60%)","hsl(190, 80%, 50%)","hsl(330, 70%, 55%)","hsl(var(--muted-foreground))"],_v={backgroundColor:"hsl(var(--background))",border:"1px solid hsl(var(--border))",borderRadius:8,fontSize:13};function Kht(){const[e,t]=w.useState([]),[r,n]=w.useState([]),[i,s]=w.useState([]),[o,l]=w.useState([]),[c,u]=w.useState(!0),[d,A]=w.useState(null),h=ks(new Date,"yyyy-MM"),f=ks(eG(new Date,1),"yyyy-MM");w.useEffect(()=>{async function Y(){u(!0);const[$,O,W,V]=await Promise.all([Re.from("profiles").select("user_id, email, first_name, second_name, country, profession, referral_source, created_at").order("created_at",{ascending:!1}),Re.from("user_subscriptions").select("user_id, tier, status").eq("status","active"),Re.from("user_usage").select("user_id, month_year, generations_used, words_generated"),Re.from("blog_posts").select("user_id, content_type, created_at")]);t($.data??[]),n(O.data??[]),s(W.data??[]),l(V.data??[]),u(!1)}Y()},[]);const m=e.length,p=e.filter(Y=>Y.created_at.startsWith(h)).length,g=r.filter(Y=>Y.tier!=="free").length,v=m>0?(g/m*100).toFixed(1):"0",x=i.filter(Y=>Y.month_year===h),y=x.reduce((Y,$)=>Y+$.generations_used,0),b=x.reduce((Y,$)=>Y+$.words_generated,0),C=new Set(x.filter(Y=>Y.generations_used>0).map(Y=>Y.user_id)).size,j=m>0?(C/m*100).toFixed(1):"0",S=(()=>{const Y=[];for(let $=5;$>=0;$--){const O=eG(new Date,$);Y.push({label:ks(O,"MMM yyyy"),start:co(O)})}return Y.map(({label:$,start:O})=>{const W=ks(O,"yyyy-MM");return{month:$,users:e.filter(V=>V.created_at.startsWith(W)).length}})})(),T=(()=>{const Y=new Map(r.map(O=>[O.user_id,O.tier])),$={};return e.forEach(O=>{const W=Y.get(O.user_id)??"free";$[W]=($[W]||0)+1}),Object.entries($).map(([O,W])=>({tier:O,label:Ght[O]||O,count:W})).sort((O,W)=>W.count-O.count)})(),B=(()=>{const Y={};return e.forEach($=>{const O=$.country||"Unknown";Y[O]=(Y[O]||0)+1}),Object.entries(Y).map(([$,O])=>({country:$,count:O})).sort(($,O)=>O.count-$.count).slice(0,8)})(),I=(()=>{const Y={};return o.forEach($=>{const O=$.content_type||"Other";Y[O]=(Y[O]||0)+1}),Object.entries(Y).map(([$,O])=>({type:$,count:O})).sort(($,O)=>O.count-$.count).slice(0,8)})(),P=o.length,E=o.filter(Y=>Y.created_at.startsWith(h)).length,M=o.filter(Y=>Y.created_at.startsWith(f)).length,_=M>0?((E-M)/M*100).toFixed(0):E>0?"+100":"0",R=(()=>{const Y={};return e.forEach($=>{const O=$.profession||"Unknown";Y[O]=(Y[O]||0)+1}),Object.entries(Y).map(([$,O])=>({profession:$,count:O})).sort(($,O)=>O.count-$.count).slice(0,8)})(),G=(()=>{const Y={};return e.forEach($=>{const O=$.referral_source||"Unknown";Y[O]=(Y[O]||0)+1}),Object.entries(Y).map(([$,O])=>({source:$,count:O})).sort(($,O)=>O.count-$.count).slice(0,8)})(),U=(()=>{const Y=new Map(r.map($=>[$.user_id,$.tier]));return e.slice(0,10).map($=>({...$,tier:Y.get($.user_id)??"free"}))})();if(c)return a.jsxs("div",{className:"space-y-6",children:[a.jsx("h2",{className:"text-2xl font-bold",children:"Analytics"}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[1,2,3,4,5,6,7,8].map(Y=>a.jsx(_e,{children:a.jsx(Ge,{className:"p-6",children:a.jsx(c_,{className:"h-16 w-full"})})},Y))}),a.jsx(c_,{className:"h-72 w-full"})]});const Q=[{id:"total-users",icon:nu,label:"Total Users",value:m,detail:a.jsx(Dht,{profiles:e})},{id:"new-this-month",icon:Ewe,label:"New This Month",value:p,detail:a.jsx(Rht,{profiles:e,currentMonthKey:h})},{id:"paid-users",icon:y6,label:"Paid Users",value:g,detail:a.jsx(Uht,{profiles:e,subscriptions:r})},{id:"conversion-rate",icon:ni,label:"Conversion Rate",value:`${v}%`,detail:a.jsx(Qht,{profiles:e,subscriptions:r})},{id:"generations",icon:ln,label:"Generations (This Month)",value:y.toLocaleString(),detail:a.jsx(Hht,{usageRecords:i,currentMonthKey:h})},{id:"words",icon:ai,label:"Words Generated",value:b.toLocaleString(),detail:a.jsx($ht,{usageRecords:i,currentMonthKey:h})},{id:"active-users",icon:Bbe,label:"Active Users",value:C,detail:a.jsx(zht,{profiles:e,usageRecords:i,currentMonthKey:h})},{id:"activity-rate",icon:ni,label:"Activity Rate",value:`${j}%`,detail:a.jsx(Wht,{profiles:e,usageRecords:i,currentMonthKey:h})}],z=Q.find(Y=>Y.id===d);return a.jsxs("div",{className:"space-y-6",children:[a.jsx("h2",{className:"text-2xl font-bold",children:"Analytics"}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:Q.slice(0,4).map(Y=>a.jsx(uX,{icon:Y.icon,label:Y.label,value:Y.value,onClick:()=>A(Y.id)},Y.id))}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:Q.slice(4).map(Y=>a.jsx(uX,{icon:Y.icon,label:Y.label,value:Y.value,onClick:()=>A(Y.id)},Y.id))}),z&&a.jsx(Mht,{open:!!d,onOpenChange:Y=>{Y||A(null)},title:z.label,icon:z.icon,value:z.value,children:z.detail}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[a.jsxs(_e,{className:"lg:col-span-2",children:[a.jsx(ot,{children:a.jsx(lt,{className:"text-base",children:"Signup Trend (Last 6 Months)"})}),a.jsx(Ge,{children:a.jsx("div",{className:"h-64",children:a.jsx(Kp,{width:"100%",height:"100%",children:a.jsxs(Lht,{data:S,children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:"signupGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"hsl(var(--primary))",stopOpacity:.3}),a.jsx("stop",{offset:"95%",stopColor:"hsl(var(--primary))",stopOpacity:0})]})}),a.jsx(Zk,{strokeDasharray:"3 3",className:"stroke-border"}),a.jsx(zu,{dataKey:"month",tick:{fontSize:12},className:"fill-muted-foreground"}),a.jsx(Wu,{allowDecimals:!1,tick:{fontSize:12},className:"fill-muted-foreground"}),a.jsx(Pa,{contentStyle:_v}),a.jsx(dp,{type:"monotone",dataKey:"users",stroke:"hsl(var(--primary))",fill:"url(#signupGrad)",strokeWidth:2})]})})})})]}),a.jsxs(_e,{children:[a.jsx(ot,{children:a.jsx(lt,{className:"text-base",children:"Subscription Tiers"})}),a.jsxs(Ge,{children:[a.jsx("div",{className:"h-48",children:a.jsx(Kp,{width:"100%",height:"100%",children:a.jsxs(oX,{children:[a.jsx(cd,{data:T,dataKey:"count",nameKey:"label",cx:"50%",cy:"50%",innerRadius:40,outerRadius:70,paddingAngle:2,children:T.map(Y=>a.jsx(g2,{fill:cX[Y.tier]||"hsl(var(--muted))"},Y.tier))}),a.jsx(Pa,{contentStyle:_v})]})})}),a.jsx("div",{className:"flex flex-wrap gap-2 mt-2 justify-center",children:T.map(Y=>a.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[a.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:cX[Y.tier]||"hsl(var(--muted))"}}),a.jsx("span",{className:"text-muted-foreground",children:Y.label}),a.jsx("span",{className:"font-medium",children:Y.count})]},Y.tier))})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[a.jsxs(_e,{className:"lg:col-span-2",children:[a.jsx(ot,{children:a.jsxs(lt,{className:"text-base flex items-center gap-2",children:[a.jsx(ai,{className:"h-4 w-4"})," Content Production",a.jsxs(bt,{variant:"secondary",className:"ml-auto text-xs font-normal",children:[P," total • ",E," this month (",_,"%)"]})]})}),a.jsx(Ge,{children:I.length>0?a.jsx("div",{className:"h-56",children:a.jsx(Kp,{width:"100%",height:"100%",children:a.jsxs(n3,{data:I,children:[a.jsx(Zk,{strokeDasharray:"3 3",className:"stroke-border"}),a.jsx(zu,{dataKey:"type",tick:{fontSize:11},className:"fill-muted-foreground"}),a.jsx(Wu,{allowDecimals:!1,tick:{fontSize:12},className:"fill-muted-foreground"}),a.jsx(Pa,{contentStyle:_v}),a.jsx(CA,{dataKey:"count",fill:"hsl(var(--primary))",radius:[4,4,0,0]})]})})}):a.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No content created yet"})})]}),a.jsxs(_e,{children:[a.jsx(ot,{children:a.jsxs(lt,{className:"text-base flex items-center gap-2",children:[a.jsx(awe,{className:"h-4 w-4"})," Referral Sources"]})}),a.jsx(Ge,{children:G.length>0?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-48",children:a.jsx(Kp,{width:"100%",height:"100%",children:a.jsxs(oX,{children:[a.jsx(cd,{data:G,dataKey:"count",nameKey:"source",cx:"50%",cy:"50%",innerRadius:40,outerRadius:70,paddingAngle:2,children:G.map((Y,$)=>a.jsx(g2,{fill:Uj[$%Uj.length]},$))}),a.jsx(Pa,{contentStyle:_v})]})})}),a.jsx("div",{className:"flex flex-wrap gap-2 mt-2 justify-center",children:G.map((Y,$)=>a.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[a.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:Uj[$%Uj.length]}}),a.jsx("span",{className:"text-muted-foreground",children:Y.source}),a.jsx("span",{className:"font-medium",children:Y.count})]},Y.source))})]}):a.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No referral data yet"})})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[a.jsxs(_e,{className:"lg:col-span-2",children:[a.jsx(ot,{children:a.jsx(lt,{className:"text-base",children:"Recent Signups"})}),a.jsx(Ge,{children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b text-muted-foreground text-left",children:[a.jsx("th",{className:"pb-2 font-medium",children:"Name"}),a.jsx("th",{className:"pb-2 font-medium",children:"Email"}),a.jsx("th",{className:"pb-2 font-medium hidden md:table-cell",children:"Country"}),a.jsx("th",{className:"pb-2 font-medium hidden lg:table-cell",children:"Profession"}),a.jsx("th",{className:"pb-2 font-medium",children:"Tier"}),a.jsx("th",{className:"pb-2 font-medium",children:"Joined"})]})}),a.jsxs("tbody",{children:[U.map(Y=>a.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[a.jsx("td",{className:"py-2",children:[Y.first_name,Y.second_name].filter(Boolean).join(" ")||"N/A"}),a.jsx("td",{className:"py-2 text-muted-foreground truncate max-w-[180px]",children:Y.email||"N/A"}),a.jsx("td",{className:"py-2 hidden md:table-cell",children:Y.country||"N/A"}),a.jsx("td",{className:"py-2 hidden lg:table-cell text-muted-foreground",children:Y.profession||"N/A"}),a.jsx("td",{className:"py-2",children:a.jsx(bt,{variant:Y.tier==="free"?"secondary":"default",className:"text-xs capitalize",children:Y.tier})}),a.jsx("td",{className:"py-2 text-muted-foreground",children:ks(new Date(Y.created_at),"MMM d, yyyy")})]},Y.user_id)),U.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:6,className:"py-4 text-center text-muted-foreground",children:"No users yet"})})]})]})})})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs(_e,{children:[a.jsx(ot,{children:a.jsxs(lt,{className:"text-base flex items-center gap-2",children:[a.jsx(Hs,{className:"h-4 w-4"})," Top Countries"]})}),a.jsx(Ge,{children:B.length>0?a.jsx("div",{className:"h-44",children:a.jsx(Kp,{width:"100%",height:"100%",children:a.jsxs(n3,{data:B,layout:"vertical",margin:{left:0},children:[a.jsx(zu,{type:"number",allowDecimals:!1,tick:{fontSize:12},className:"fill-muted-foreground"}),a.jsx(Wu,{type:"category",dataKey:"country",width:80,tick:{fontSize:11},className:"fill-muted-foreground"}),a.jsx(Pa,{contentStyle:_v}),a.jsx(CA,{dataKey:"count",fill:"hsl(var(--primary))",radius:[0,4,4,0]})]})})}):a.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No data"})})]}),a.jsxs(_e,{children:[a.jsx(ot,{children:a.jsxs(lt,{className:"text-base flex items-center gap-2",children:[a.jsx(nu,{className:"h-4 w-4"})," Top Professions"]})}),a.jsx(Ge,{children:R.length>0?a.jsx("div",{className:"h-44",children:a.jsx(Kp,{width:"100%",height:"100%",children:a.jsxs(n3,{data:R,layout:"vertical",margin:{left:0},children:[a.jsx(zu,{type:"number",allowDecimals:!1,tick:{fontSize:12},className:"fill-muted-foreground"}),a.jsx(Wu,{type:"category",dataKey:"profession",width:90,tick:{fontSize:11},className:"fill-muted-foreground"}),a.jsx(Pa,{contentStyle:_v}),a.jsx(CA,{dataKey:"count",fill:"hsl(142, 71%, 45%)",radius:[0,4,4,0]})]})})}):a.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No data"})})]})]})]})]})}function uX({icon:e,label:t,value:r,onClick:n}){return a.jsx(_e,{className:"cursor-pointer transition-all hover:shadow-md hover:border-primary/30 hover:scale-[1.02] active:scale-[0.98]",onClick:n,children:a.jsxs(Ge,{className:"p-5 flex items-center gap-4",children:[a.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-lg bg-primary/10",children:a.jsx(e,{className:"h-5 w-5 text-primary"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:t}),a.jsx("p",{className:"text-2xl font-bold",children:r})]}),a.jsx("span",{className:"text-xs text-muted-foreground/50",children:"Click for details →"})]})})}function Vht({current:e,previous:t}){return e>t?a.jsx(ni,{className:"h-4 w-4 text-green-500"}):ei>=75?"text-green-500":i>=50?"text-yellow-500":"text-red-500";return a.jsx(_e,{children:a.jsxs(Ge,{className:"pt-4 pb-3 px-4",children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:e}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`text-2xl font-bold ${n(t)}`,children:t}),r!==void 0&&a.jsx(Vht,{current:t,previous:r})]})]})})}function qht(){const[e,t]=w.useState([]),[r,n]=w.useState(!0),{user:i}=fi();w.useEffect(()=>{i&&s()},[i]);const s=async()=>{if(!i)return;const{data:d}=await Re.from("seo_evaluations").select("*").eq("user_id",i.id).order("created_at",{ascending:!0}).limit(100);d&&t(d),n(!1)},o=e.map(d=>({date:ks(new Date(d.created_at),"MMM d"),Overall:d.overall_score,SEO:d.seo_score,GEO:d.geo_score,Readability:d.readability_score,Structure:d.structure_score,Engagement:d.engagement_score})),l=e[e.length-1],c=e.length>=2?e[e.length-2]:void 0,u=d=>e.length?Math.round(e.reduce((A,h)=>A+h[d],0)/e.length):0;return a.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[a.jsx(Ra,{className:"h-6 w-6 text-primary"}),"SEO Analytics"]}),a.jsx("p",{className:"text-muted-foreground mt-1",children:"Track your content quality scores over time from Evaluator runs."})]}),r?a.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"Loading analytics..."}):e.length===0?a.jsx(_e,{children:a.jsxs(Ge,{className:"py-12 text-center",children:[a.jsx(Ra,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No evaluations yet"}),a.jsx("p",{className:"text-muted-foreground",children:"Use the Content Evaluator to analyze your content. Results will appear here automatically."})]})}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-7 gap-3",children:[a.jsx(Mp,{label:"Overall",value:(l==null?void 0:l.overall_score)||0,previousValue:c==null?void 0:c.overall_score}),a.jsx(Mp,{label:"SEO",value:(l==null?void 0:l.seo_score)||0,previousValue:c==null?void 0:c.seo_score}),a.jsx(Mp,{label:"GEO",value:(l==null?void 0:l.geo_score)||0,previousValue:c==null?void 0:c.geo_score}),a.jsx(Mp,{label:"Readability",value:(l==null?void 0:l.readability_score)||0,previousValue:c==null?void 0:c.readability_score}),a.jsx(Mp,{label:"Structure",value:(l==null?void 0:l.structure_score)||0,previousValue:c==null?void 0:c.structure_score}),a.jsx(Mp,{label:"Engagement",value:(l==null?void 0:l.engagement_score)||0,previousValue:c==null?void 0:c.engagement_score}),a.jsx(Mp,{label:"Keywords",value:(l==null?void 0:l.keyword_optimization_score)||0,previousValue:c==null?void 0:c.keyword_optimization_score})]}),o.length>=2&&a.jsxs(_e,{children:[a.jsxs(ot,{className:"pb-2",children:[a.jsx(lt,{className:"text-lg",children:"Score Trends"}),a.jsxs(Mr,{children:[e.length," evaluations tracked"]})]}),a.jsx(Ge,{children:a.jsx("div",{className:"h-72",children:a.jsx(Kp,{width:"100%",height:"100%",children:a.jsxs(Fht,{data:o,children:[a.jsx(Zk,{strokeDasharray:"3 3",className:"stroke-border"}),a.jsx(zu,{dataKey:"date",className:"text-xs",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Wu,{domain:[0,100],tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Pa,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),a.jsx(Um,{}),a.jsx(cA,{type:"monotone",dataKey:"Overall",stroke:"hsl(var(--primary))",strokeWidth:2,dot:!1}),a.jsx(cA,{type:"monotone",dataKey:"SEO",stroke:"#3b82f6",strokeWidth:1.5,dot:!1}),a.jsx(cA,{type:"monotone",dataKey:"GEO",stroke:"#8b5cf6",strokeWidth:1.5,dot:!1}),a.jsx(cA,{type:"monotone",dataKey:"Readability",stroke:"#10b981",strokeWidth:1.5,dot:!1}),a.jsx(cA,{type:"monotone",dataKey:"Engagement",stroke:"#f59e0b",strokeWidth:1.5,dot:!1})]})})})})]}),a.jsxs(_e,{children:[a.jsxs(ot,{className:"pb-2",children:[a.jsx(lt,{className:"text-lg",children:"Average Scores"}),a.jsxs(Mr,{children:["Across all ",e.length," evaluations"]})]}),a.jsx(Ge,{children:a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[{label:"Overall",key:"overall_score"},{label:"SEO",key:"seo_score"},{label:"GEO",key:"geo_score"},{label:"Readability",key:"readability_score"}].map(({label:d,key:A})=>a.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:d}),a.jsx("p",{className:"text-xl font-bold",children:u(A)})]},A))})})]}),a.jsxs(_e,{children:[a.jsx(ot,{className:"pb-2",children:a.jsx(lt,{className:"text-lg",children:"Recent Evaluations"})}),a.jsx(Ge,{children:a.jsx("div",{className:"space-y-2",children:[...e].reverse().slice(0,10).map(d=>a.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/30 border border-border",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:d.content_snippet||"Untitled content"}),a.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[a.jsx("span",{className:"text-xs text-muted-foreground",children:ks(new Date(d.created_at),"MMM d, yyyy h:mm a")}),d.keyword&&a.jsx(bt,{variant:"secondary",className:"text-xs",children:d.keyword})]})]}),a.jsx(bt,{variant:d.overall_score>=75?"default":d.overall_score>=50?"secondary":"destructive",className:"ml-3 shrink-0",children:d.overall_score})]},d.id))})})]})]})]})}function Xht(){return a.jsx(Og,{feature:"seo_analytics",children:a.jsx(qht,{})})}function Kpe({options:e}){const[t,r]=w.useState(!1),{toast:n}=Dr(),i=async(s,o)=>{r(!0);try{await s(),n({title:"Downloaded!",description:`${o} saved successfully.`})}catch(l){console.error("Download error:",l),n({title:"Download failed",description:l.message||"Please try again.",variant:"destructive"})}finally{r(!1)}};return a.jsxs(fE,{children:[a.jsx(hE,{asChild:!0,children:a.jsxs(ve,{variant:"outline",size:"sm",disabled:t,children:[a.jsx(Jte,{className:"h-4 w-4 mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:t?"Downloading...":"Download"})]})}),a.jsx(EC,{align:"end",children:e.map((s,o)=>a.jsxs(xA,{onClick:()=>i(s.action,s.label),children:[s.icon,a.jsx("span",{className:"ml-2",children:s.label})]},o))})]})}/*! * html2canvas 1.4.1 * Copyright (c) 2022 Niklas von Hertzen * Released under MIT License *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var wD=function(e,t){return wD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},wD(e,t)};function Au(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");wD(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var CD=function(){return CD=Object.assign||function(t){for(var r,n=1,i=arguments.length;n0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]=55296&&i<=56319&&r>10)+55296,o%1024+56320)),(i+1===r||n.length>16384)&&(s+=String.fromCharCode.apply(String,n),n.length=0)}return s},dX="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Jht=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Hj=0;Hj"u"?[]:new Uint8Array(256);for(var $j=0;$j>4,d[i++]=(o&15)<<4|l>>2,d[i++]=(l&3)<<6|c&63;return u},ept=function(e){for(var t=e.length,r=[],n=0;n>zm,npt=1<>zm,spt=Vpe+ipt,apt=spt,opt=32,lpt=apt+opt,cpt=65536>>s7,upt=1<=0){if(t<55296||t>56319&&t<=65535)return r=this.index[t>>zm],r=(r<>zm)],r=(r<>s7),r=this.index[r],r+=t>>zm&dpt,r=this.index[r],r=(r<"u"?[]:new Uint8Array(256);for(var zj=0;zjpX?(i.push(!0),l-=pX):i.push(!1),["normal","auto","loose"].indexOf(t)!==-1&&[8208,8211,12316,12448].indexOf(s)!==-1)return n.push(o),r.push(SD);if(l===vpt||l===ND){if(o===0)return n.push(o),r.push(em);var c=r[o-1];return Spt.indexOf(c)===-1?(n.push(n[o-1]),r.push(c)):(n.push(o),r.push(em))}if(n.push(o),l===Cpt)return r.push(t==="strict"?BD:V2);if(l===Jpe||l===wpt)return r.push(em);if(l===Npt)return s>=131072&&s<=196605||s>=196608&&s<=262141?r.push(V2):r.push(em);r.push(l)}),[n,r,i]},l3=function(e,t,r,n){var i=n[r];if(Array.isArray(e)?e.indexOf(i)!==-1:e===i)for(var s=r;s<=n.length;){s++;var o=n[s];if(o===t)return!0;if(o!==oh)break}if(i===oh)for(var s=r;s>0;){s--;var l=n[s];if(Array.isArray(e)?e.indexOf(l)!==-1:e===l)for(var c=r;c<=n.length;){c++;var o=n[c];if(o===t)return!0;if(o!==oh)break}if(l!==oh)break}return!1},wX=function(e,t){for(var r=e;r>=0;){var n=t[r];if(n===oh)r--;else return n}return 0},kpt=function(e,t,r,n,i){if(r[n]===0)return Kr;var s=n-1;if(Array.isArray(i)&&i[s]===!0)return Kr;var o=s-1,l=s+1,c=t[s],u=o>=0?t[o]:0,d=t[l];if(c===qpe&&d===Xpe)return Kr;if(ID.indexOf(c)!==-1)return Zpe;if(ID.indexOf(d)!==-1||eme.indexOf(d)!==-1)return Kr;if(wX(s,t)===Ype)return Vj;if(PD.get(e[s])===ND||(c===Gj||c===Kj)&&PD.get(e[l])===ND||c===mX||d===mX||c===gX||[oh,jD,bw].indexOf(c)===-1&&d===gX||[Wj,Yb,bpt,kv,Ev].indexOf(d)!==-1||wX(s,t)===Jb||l3(a3,Jb,s,t)||l3([Wj,Yb],BD,s,t)||l3(vX,vX,s,t))return Kr;if(c===oh)return Vj;if(c===a3||d===a3)return Kr;if(d===SD||c===SD)return Vj;if([jD,bw,BD].indexOf(d)!==-1||c===ypt||u===ED&&Bpt.indexOf(c)!==-1||c===Ev&&d===ED||d===xX||Gd.indexOf(d)!==-1&&c===tl||Gd.indexOf(c)!==-1&&d===tl||c===Cw&&[V2,Gj,Kj].indexOf(d)!==-1||[V2,Gj,Kj].indexOf(c)!==-1&&d===ww||Gd.indexOf(c)!==-1&&yX.indexOf(d)!==-1||yX.indexOf(c)!==-1&&Gd.indexOf(d)!==-1||[Cw,ww].indexOf(c)!==-1&&(d===tl||[Jb,bw].indexOf(d)!==-1&&t[l+1]===tl)||[Jb,bw].indexOf(c)!==-1&&d===tl||c===tl&&[tl,Ev,kv].indexOf(d)!==-1)return Kr;if([tl,Ev,kv,Wj,Yb].indexOf(d)!==-1)for(var A=s;A>=0;){var h=t[A];if(h===tl)return Kr;if([Ev,kv].indexOf(h)!==-1)A--;else break}if([Cw,ww].indexOf(d)!==-1)for(var A=[Wj,Yb].indexOf(c)!==-1?o:s;A>=0;){var h=t[A];if(h===tl)return Kr;if([Ev,kv].indexOf(h)!==-1)A--;else break}if(TD===c&&[TD,eB,_D,kD].indexOf(d)!==-1||[eB,_D].indexOf(c)!==-1&&[eB,tB].indexOf(d)!==-1||[tB,kD].indexOf(c)!==-1&&d===tB||bX.indexOf(c)!==-1&&[xX,ww].indexOf(d)!==-1||bX.indexOf(d)!==-1&&c===Cw||Gd.indexOf(c)!==-1&&Gd.indexOf(d)!==-1||c===kv&&Gd.indexOf(d)!==-1||Gd.concat(tl).indexOf(c)!==-1&&d===Jb&&jpt.indexOf(e[l])===-1||Gd.concat(tl).indexOf(d)!==-1&&c===Yb)return Kr;if(c===o3&&d===o3){for(var f=r[s],m=1;f>0&&(f--,t[f]===o3);)m++;if(m%2!==0)return Kr}return c===Gj&&d===Kj?Kr:Vj},Ept=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var r=_pt(e,t.lineBreak),n=r[0],i=r[1],s=r[2];(t.wordBreak==="break-all"||t.wordBreak==="break-word")&&(i=i.map(function(l){return[tl,em,Jpe].indexOf(l)!==-1?V2:l}));var o=t.wordBreak==="keep-all"?s.map(function(l,c){return l&&e[c]>=19968&&e[c]<=40959}):void 0;return[n,i,o]},Tpt=function(){function e(t,r,n,i){this.codePoints=t,this.required=r===Zpe,this.start=n,this.end=i}return e.prototype.slice=function(){return zi.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),Ppt=function(e,t){var r=Q4(e),n=Ept(r,t),i=n[0],s=n[1],o=n[2],l=r.length,c=0,u=0;return{next:function(){if(u>=l)return{done:!0,value:null};for(var d=Kr;u=tme&&e<=57},Amt=function(e){return e>=55296&&e<=57343},Tv=function(e){return Ia(e)||e>=ime&&e<=ame||e>=rme&&e<=omt},fmt=function(e){return e>=rme&&e<=cmt},hmt=function(e){return e>=ime&&e<=dmt},pmt=function(e){return fmt(e)||hmt(e)},mmt=function(e){return e>=Ypt},Zj=function(e){return e===s5||e===Fpt||e===Lpt},a5=function(e){return pmt(e)||mmt(e)||e===Upt},BX=function(e){return a5(e)||Ia(e)||e===So},gmt=function(e){return e>=tmt&&e<=rmt||e===nmt||e>=imt&&e<=smt||e===amt},Pf=function(e,t){return e!==l1?!1:t!==s5},eS=function(e,t,r){return e===So?a5(t)||Pf(t,r):a5(e)?!0:!!(e===l1&&Pf(e,t))},u3=function(e,t,r){return e===hm||e===So?Ia(t)?!0:t===q2&&Ia(r):Ia(e===q2?t:e)},vmt=function(e){var t=0,r=1;(e[t]===hm||e[t]===So)&&(e[t]===So&&(r=-1),t++);for(var n=[];Ia(e[t]);)n.push(e[t++]);var i=n.length?parseInt(zi.apply(void 0,n),10):0;e[t]===q2&&t++;for(var s=[];Ia(e[t]);)s.push(e[t++]);var o=s.length,l=o?parseInt(zi.apply(void 0,s),10):0;(e[t]===sme||e[t]===nme)&&t++;var c=1;(e[t]===hm||e[t]===So)&&(e[t]===So&&(c=-1),t++);for(var u=[];Ia(e[t]);)u.push(e[t++]);var d=u.length?parseInt(zi.apply(void 0,u),10):0;return r*(i+l*Math.pow(10,-o))*Math.pow(10,c*d)},xmt={type:2},ymt={type:3},bmt={type:4},wmt={type:13},Cmt={type:8},Nmt={type:21},jmt={type:9},Smt={type:10},Bmt={type:11},_mt={type:12},kmt={type:14},tS={type:23},Emt={type:1},Tmt={type:25},Pmt={type:24},Imt={type:26},Omt={type:27},Fmt={type:28},Lmt={type:29},Mmt={type:31},OD={type:32},ome=function(){function e(){this._value=[]}return e.prototype.write=function(t){this._value=this._value.concat(Q4(t))},e.prototype.read=function(){for(var t=[],r=this.consumeToken();r!==OD;)t.push(r),r=this.consumeToken();return t},e.prototype.consumeToken=function(){var t=this.consumeCodePoint();switch(t){case qj:return this.consumeStringToken(qj);case Mpt:var r=this.peekCodePoint(0),n=this.peekCodePoint(1),i=this.peekCodePoint(2);if(BX(r)||Pf(n,i)){var s=eS(r,n,i)?Opt:Ipt,o=this.consumeName();return{type:5,value:o,flags:s}}break;case Dpt:if(this.peekCodePoint(0)===Zb)return this.consumeCodePoint(),wmt;break;case Xj:return this.consumeStringToken(Xj);case Yj:return xmt;case ew:return ymt;case c3:if(this.peekCodePoint(0)===Zb)return this.consumeCodePoint(),kmt;break;case hm:if(u3(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case Jpt:return bmt;case So:var l=t,c=this.peekCodePoint(0),u=this.peekCodePoint(1);if(u3(l,c,u))return this.reconsumeCodePoint(t),this.consumeNumericToken();if(eS(l,c,u))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();if(c===So&&u===$pt)return this.consumeCodePoint(),this.consumeCodePoint(),Pmt;break;case q2:if(u3(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case NX:if(this.peekCodePoint(0)===c3)for(this.consumeCodePoint();;){var d=this.consumeCodePoint();if(d===c3&&(d=this.consumeCodePoint(),d===NX))return this.consumeToken();if(d===Nu)return this.consumeToken()}break;case Zpt:return Imt;case emt:return Omt;case Hpt:if(this.peekCodePoint(0)===Qpt&&this.peekCodePoint(1)===So&&this.peekCodePoint(2)===So)return this.consumeCodePoint(),this.consumeCodePoint(),Tmt;break;case zpt:var A=this.peekCodePoint(0),h=this.peekCodePoint(1),f=this.peekCodePoint(2);if(eS(A,h,f)){var o=this.consumeName();return{type:7,value:o}}break;case Wpt:return Fmt;case l1:if(Pf(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();break;case Gpt:return Lmt;case Kpt:if(this.peekCodePoint(0)===Zb)return this.consumeCodePoint(),Cmt;break;case Vpt:return Bmt;case qpt:return _mt;case lmt:case umt:var m=this.peekCodePoint(0),p=this.peekCodePoint(1);return m===hm&&(Tv(p)||p===Jj)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(t),this.consumeIdentLikeToken();case jX:if(this.peekCodePoint(0)===Zb)return this.consumeCodePoint(),jmt;if(this.peekCodePoint(0)===jX)return this.consumeCodePoint(),Nmt;break;case Xpt:if(this.peekCodePoint(0)===Zb)return this.consumeCodePoint(),Smt;break;case Nu:return OD}return Zj(t)?(this.consumeWhiteSpace(),Mmt):Ia(t)?(this.reconsumeCodePoint(t),this.consumeNumericToken()):a5(t)?(this.reconsumeCodePoint(t),this.consumeIdentLikeToken()):{type:6,value:zi(t)}},e.prototype.consumeCodePoint=function(){var t=this._value.shift();return typeof t>"u"?-1:t},e.prototype.reconsumeCodePoint=function(t){this._value.unshift(t)},e.prototype.peekCodePoint=function(t){return t>=this._value.length?-1:this._value[t]},e.prototype.consumeUnicodeRangeToken=function(){for(var t=[],r=this.consumeCodePoint();Tv(r)&&t.length<6;)t.push(r),r=this.consumeCodePoint();for(var n=!1;r===Jj&&t.length<6;)t.push(r),r=this.consumeCodePoint(),n=!0;if(n){var i=parseInt(zi.apply(void 0,t.map(function(c){return c===Jj?tme:c})),16),s=parseInt(zi.apply(void 0,t.map(function(c){return c===Jj?ame:c})),16);return{type:30,start:i,end:s}}var o=parseInt(zi.apply(void 0,t),16);if(this.peekCodePoint(0)===So&&Tv(this.peekCodePoint(1))){this.consumeCodePoint(),r=this.consumeCodePoint();for(var l=[];Tv(r)&&l.length<6;)l.push(r),r=this.consumeCodePoint();var s=parseInt(zi.apply(void 0,l),16);return{type:30,start:o,end:s}}else return{type:30,start:o,end:o}},e.prototype.consumeIdentLikeToken=function(){var t=this.consumeName();return t.toLowerCase()==="url"&&this.peekCodePoint(0)===Yj?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===Yj?(this.consumeCodePoint(),{type:19,value:t}):{type:20,value:t}},e.prototype.consumeUrlToken=function(){var t=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===Nu)return{type:22,value:""};var r=this.peekCodePoint(0);if(r===Xj||r===qj){var n=this.consumeStringToken(this.consumeCodePoint());return n.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===Nu||this.peekCodePoint(0)===ew)?(this.consumeCodePoint(),{type:22,value:n.value}):(this.consumeBadUrlRemnants(),tS)}for(;;){var i=this.consumeCodePoint();if(i===Nu||i===ew)return{type:22,value:zi.apply(void 0,t)};if(Zj(i))return this.consumeWhiteSpace(),this.peekCodePoint(0)===Nu||this.peekCodePoint(0)===ew?(this.consumeCodePoint(),{type:22,value:zi.apply(void 0,t)}):(this.consumeBadUrlRemnants(),tS);if(i===qj||i===Xj||i===Yj||gmt(i))return this.consumeBadUrlRemnants(),tS;if(i===l1)if(Pf(i,this.peekCodePoint(0)))t.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),tS;else t.push(i)}},e.prototype.consumeWhiteSpace=function(){for(;Zj(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var t=this.consumeCodePoint();if(t===ew||t===Nu)return;Pf(t,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(t){for(var r=5e4,n="";t>0;){var i=Math.min(r,t);n+=zi.apply(void 0,this._value.splice(0,i)),t-=i}return this._value.shift(),n},e.prototype.consumeStringToken=function(t){var r="",n=0;do{var i=this._value[n];if(i===Nu||i===void 0||i===t)return r+=this.consumeStringSlice(n),{type:0,value:r};if(i===s5)return this._value.splice(0,n),Emt;if(i===l1){var s=this._value[n+1];s!==Nu&&s!==void 0&&(s===s5?(r+=this.consumeStringSlice(n),n=-1,this._value.shift()):Pf(i,s)&&(r+=this.consumeStringSlice(n),r+=zi(this.consumeEscapedCodePoint()),n=-1))}n++}while(!0)},e.prototype.consumeNumber=function(){var t=[],r=ZC,n=this.peekCodePoint(0);for((n===hm||n===So)&&t.push(this.consumeCodePoint());Ia(this.peekCodePoint(0));)t.push(this.consumeCodePoint());n=this.peekCodePoint(0);var i=this.peekCodePoint(1);if(n===q2&&Ia(i))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),r=CX;Ia(this.peekCodePoint(0));)t.push(this.consumeCodePoint());n=this.peekCodePoint(0),i=this.peekCodePoint(1);var s=this.peekCodePoint(2);if((n===sme||n===nme)&&((i===hm||i===So)&&Ia(s)||Ia(i)))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),r=CX;Ia(this.peekCodePoint(0));)t.push(this.consumeCodePoint());return[vmt(t),r]},e.prototype.consumeNumericToken=function(){var t=this.consumeNumber(),r=t[0],n=t[1],i=this.peekCodePoint(0),s=this.peekCodePoint(1),o=this.peekCodePoint(2);if(eS(i,s,o)){var l=this.consumeName();return{type:15,number:r,flags:n,unit:l}}return i===Rpt?(this.consumeCodePoint(),{type:16,number:r,flags:n}):{type:17,number:r,flags:n}},e.prototype.consumeEscapedCodePoint=function(){var t=this.consumeCodePoint();if(Tv(t)){for(var r=zi(t);Tv(this.peekCodePoint(0))&&r.length<6;)r+=zi(this.consumeCodePoint());Zj(this.peekCodePoint(0))&&this.consumeCodePoint();var n=parseInt(r,16);return n===0||Amt(n)||n>1114111?SX:n}return t===Nu?SX:t},e.prototype.consumeName=function(){for(var t="";;){var r=this.consumeCodePoint();if(BX(r))t+=zi(r);else if(Pf(r,this.peekCodePoint(0)))t+=zi(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(r),t}},e}(),lme=function(){function e(t){this._tokens=t}return e.create=function(t){var r=new ome;return r.write(t),new e(r.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var t=this.consumeToken();t.type===31;)t=this.consumeToken();if(t.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(t);var r=this.consumeComponentValue();do t=this.consumeToken();while(t.type===31);if(t.type===32)return r;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var t=[];;){var r=this.consumeComponentValue();if(r.type===32)return t;t.push(r),t.push()}},e.prototype.consumeComponentValue=function(){var t=this.consumeToken();switch(t.type){case 11:case 28:case 2:return this.consumeSimpleBlock(t.type);case 19:return this.consumeFunction(t)}return t},e.prototype.consumeSimpleBlock=function(t){for(var r={type:t,values:[]},n=this.consumeToken();;){if(n.type===32||Rmt(n,t))return r;this.reconsumeToken(n),r.values.push(this.consumeComponentValue()),n=this.consumeToken()}},e.prototype.consumeFunction=function(t){for(var r={name:t.value,values:[],type:18};;){var n=this.consumeToken();if(n.type===32||n.type===3)return r;this.reconsumeToken(n),r.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var t=this._tokens.shift();return typeof t>"u"?OD:t},e.prototype.reconsumeToken=function(t){this._tokens.unshift(t)},e}(),eN=function(e){return e.type===15},Z0=function(e){return e.type===17},En=function(e){return e.type===20},Dmt=function(e){return e.type===0},FD=function(e,t){return En(e)&&e.value===t},cme=function(e){return e.type!==31},d0=function(e){return e.type!==31&&e.type!==4},wd=function(e){var t=[],r=[];return e.forEach(function(n){if(n.type===4){if(r.length===0)throw new Error("Error parsing function args, zero tokens for arg");t.push(r),r=[];return}n.type!==31&&r.push(n)}),r.length&&t.push(r),t},Rmt=function(e,t){return t===11&&e.type===12||t===28&&e.type===29?!0:t===2&&e.type===3},Wh=function(e){return e.type===17||e.type===15},as=function(e){return e.type===16||Wh(e)},ume=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},ua={type:17,number:0,flags:ZC},a7={type:16,number:50,flags:ZC},lh={type:16,number:100,flags:ZC},Nw=function(e,t,r){var n=e[0],i=e[1];return[Wn(n,t),Wn(typeof i<"u"?i:n,r)]},Wn=function(e,t){if(e.type===16)return e.number/100*t;if(eN(e))switch(e.unit){case"rem":case"em":return 16*e.number;case"px":default:return e.number}return e.number},dme="deg",Ame="grad",fme="rad",hme="turn",H4={name:"angle",parse:function(e,t){if(t.type===15)switch(t.unit){case dme:return Math.PI*t.number/180;case Ame:return Math.PI/200*t.number;case fme:return t.number;case hme:return Math.PI*2*t.number}throw new Error("Unsupported angle type")}},pme=function(e){return e.type===15&&(e.unit===dme||e.unit===Ame||e.unit===fme||e.unit===hme)},mme=function(e){var t=e.filter(En).map(function(r){return r.value}).join(" ");switch(t){case"to bottom right":case"to right bottom":case"left top":case"top left":return[ua,ua];case"to top":case"bottom":return nc(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ua,lh];case"to right":case"left":return nc(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[lh,lh];case"to bottom":case"top":return nc(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[lh,ua];case"to left":case"right":return nc(270)}return 0},nc=function(e){return Math.PI*e/180},Eh={name:"color",parse:function(e,t){if(t.type===18){var r=Umt[t.name];if(typeof r>"u")throw new Error('Attempting to parse an unsupported color function "'+t.name+'"');return r(e,t.values)}if(t.type===5){if(t.value.length===3){var n=t.value.substring(0,1),i=t.value.substring(1,2),s=t.value.substring(2,3);return ch(parseInt(n+n,16),parseInt(i+i,16),parseInt(s+s,16),1)}if(t.value.length===4){var n=t.value.substring(0,1),i=t.value.substring(1,2),s=t.value.substring(2,3),o=t.value.substring(3,4);return ch(parseInt(n+n,16),parseInt(i+i,16),parseInt(s+s,16),parseInt(o+o,16)/255)}if(t.value.length===6){var n=t.value.substring(0,2),i=t.value.substring(2,4),s=t.value.substring(4,6);return ch(parseInt(n,16),parseInt(i,16),parseInt(s,16),1)}if(t.value.length===8){var n=t.value.substring(0,2),i=t.value.substring(2,4),s=t.value.substring(4,6),o=t.value.substring(6,8);return ch(parseInt(n,16),parseInt(i,16),parseInt(s,16),parseInt(o,16)/255)}}if(t.type===20){var l=NA[t.value.toUpperCase()];if(typeof l<"u")return l}return NA.TRANSPARENT}},Th=function(e){return(255&e)===0},Os=function(e){var t=255&e,r=255&e>>8,n=255&e>>16,i=255&e>>24;return t<255?"rgba("+i+","+n+","+r+","+t/255+")":"rgb("+i+","+n+","+r+")"},ch=function(e,t,r,n){return(e<<24|t<<16|r<<8|Math.round(n*255)<<0)>>>0},_X=function(e,t){if(e.type===17)return e.number;if(e.type===16){var r=t===3?1:255;return t===3?e.number/100*r:Math.round(e.number/100*r)}return 0},kX=function(e,t){var r=t.filter(d0);if(r.length===3){var n=r.map(_X),i=n[0],s=n[1],o=n[2];return ch(i,s,o,1)}if(r.length===4){var l=r.map(_X),i=l[0],s=l[1],o=l[2],c=l[3];return ch(i,s,o,c)}return 0};function d3(e,t,r){return r<0&&(r+=1),r>=1&&(r-=1),r<1/6?(t-e)*r*6+e:r<1/2?t:r<2/3?(t-e)*6*(2/3-r)+e:e}var EX=function(e,t){var r=t.filter(d0),n=r[0],i=r[1],s=r[2],o=r[3],l=(n.type===17?nc(n.number):H4.parse(e,n))/(Math.PI*2),c=as(i)?i.number/100:0,u=as(s)?s.number/100:0,d=typeof o<"u"&&as(o)?Wn(o,1):1;if(c===0)return ch(u*255,u*255,u*255,1);var A=u<=.5?u*(c+1):u+c-u*c,h=u*2-A,f=d3(h,A,l+1/3),m=d3(h,A,l),p=d3(h,A,l-1/3);return ch(f*255,m*255,p*255,d)},Umt={hsl:EX,hsla:EX,rgb:kX,rgba:kX},c1=function(e,t){return Eh.parse(e,lme.create(t).parseComponentValue())},NA={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},Qmt={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(r){if(En(r))switch(r.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Hmt={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},$4=function(e,t){var r=Eh.parse(e,t[0]),n=t[1];return n&&as(n)?{color:r,stop:n}:{color:r,stop:null}},TX=function(e,t){var r=e[0],n=e[e.length-1];r.stop===null&&(r.stop=ua),n.stop===null&&(n.stop=lh);for(var i=[],s=0,o=0;os?i.push(c):i.push(s),s=c}else i.push(null)}for(var u=null,o=0;oo.optimumDistance)?{optimumCorner:l,optimumDistance:d}:o},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},Wmt=function(e,t,r,n,i){var s=0,o=0;switch(e.size){case 0:e.shape===0?s=o=Math.min(Math.abs(t),Math.abs(t-n),Math.abs(r),Math.abs(r-i)):e.shape===1&&(s=Math.min(Math.abs(t),Math.abs(t-n)),o=Math.min(Math.abs(r),Math.abs(r-i)));break;case 2:if(e.shape===0)s=o=Math.min(Ic(t,r),Ic(t,r-i),Ic(t-n,r),Ic(t-n,r-i));else if(e.shape===1){var l=Math.min(Math.abs(r),Math.abs(r-i))/Math.min(Math.abs(t),Math.abs(t-n)),c=PX(n,i,t,r,!0),u=c[0],d=c[1];s=Ic(u-t,(d-r)/l),o=l*s}break;case 1:e.shape===0?s=o=Math.max(Math.abs(t),Math.abs(t-n),Math.abs(r),Math.abs(r-i)):e.shape===1&&(s=Math.max(Math.abs(t),Math.abs(t-n)),o=Math.max(Math.abs(r),Math.abs(r-i)));break;case 3:if(e.shape===0)s=o=Math.max(Ic(t,r),Ic(t,r-i),Ic(t-n,r),Ic(t-n,r-i));else if(e.shape===1){var l=Math.max(Math.abs(r),Math.abs(r-i))/Math.max(Math.abs(t),Math.abs(t-n)),A=PX(n,i,t,r,!1),u=A[0],d=A[1];s=Ic(u-t,(d-r)/l),o=l*s}break}return Array.isArray(e.size)&&(s=Wn(e.size[0],n),o=e.size.length===2?Wn(e.size[1],i):s),[s,o]},Gmt=function(e,t){var r=nc(180),n=[];return wd(t).forEach(function(i,s){if(s===0){var o=i[0];if(o.type===20&&o.value==="to"){r=mme(i);return}else if(pme(o)){r=H4.parse(e,o);return}}var l=$4(e,i);n.push(l)}),{angle:r,stops:n,type:1}},rS=function(e,t){var r=nc(180),n=[];return wd(t).forEach(function(i,s){if(s===0){var o=i[0];if(o.type===20&&["top","left","right","bottom"].indexOf(o.value)!==-1){r=mme(i);return}else if(pme(o)){r=(H4.parse(e,o)+nc(270))%nc(360);return}}var l=$4(e,i);n.push(l)}),{angle:r,stops:n,type:1}},Kmt=function(e,t){var r=nc(180),n=[],i=1,s=0,o=3,l=[];return wd(t).forEach(function(c,u){var d=c[0];if(u===0){if(En(d)&&d.value==="linear"){i=1;return}else if(En(d)&&d.value==="radial"){i=2;return}}if(d.type===18){if(d.name==="from"){var A=Eh.parse(e,d.values[0]);n.push({stop:ua,color:A})}else if(d.name==="to"){var A=Eh.parse(e,d.values[0]);n.push({stop:lh,color:A})}else if(d.name==="color-stop"){var h=d.values.filter(d0);if(h.length===2){var A=Eh.parse(e,h[1]),f=h[0];Z0(f)&&n.push({stop:{type:16,number:f.number*100,flags:f.flags},color:A})}}}}),i===1?{angle:(r+nc(180))%nc(360),stops:n,type:i}:{size:o,shape:s,stops:n,position:l,type:i}},gme="closest-side",vme="farthest-side",xme="closest-corner",yme="farthest-corner",bme="circle",wme="ellipse",Cme="cover",Nme="contain",Vmt=function(e,t){var r=0,n=3,i=[],s=[];return wd(t).forEach(function(o,l){var c=!0;if(l===0){var u=!1;c=o.reduce(function(A,h){if(u)if(En(h))switch(h.value){case"center":return s.push(a7),A;case"top":case"left":return s.push(ua),A;case"right":case"bottom":return s.push(lh),A}else(as(h)||Wh(h))&&s.push(h);else if(En(h))switch(h.value){case bme:return r=0,!1;case wme:return r=1,!1;case"at":return u=!0,!1;case gme:return n=0,!1;case Cme:case vme:return n=1,!1;case Nme:case xme:return n=2,!1;case yme:return n=3,!1}else if(Wh(h)||as(h))return Array.isArray(n)||(n=[]),n.push(h),!1;return A},c)}if(c){var d=$4(e,o);i.push(d)}}),{size:n,shape:r,stops:i,position:s,type:2}},nS=function(e,t){var r=0,n=3,i=[],s=[];return wd(t).forEach(function(o,l){var c=!0;if(l===0?c=o.reduce(function(d,A){if(En(A))switch(A.value){case"center":return s.push(a7),!1;case"top":case"left":return s.push(ua),!1;case"right":case"bottom":return s.push(lh),!1}else if(as(A)||Wh(A))return s.push(A),!1;return d},c):l===1&&(c=o.reduce(function(d,A){if(En(A))switch(A.value){case bme:return r=0,!1;case wme:return r=1,!1;case Nme:case gme:return n=0,!1;case vme:return n=1,!1;case xme:return n=2,!1;case Cme:case yme:return n=3,!1}else if(Wh(A)||as(A))return Array.isArray(n)||(n=[]),n.push(A),!1;return d},c)),c){var u=$4(e,o);i.push(u)}}),{size:n,shape:r,stops:i,position:s,type:2}},qmt=function(e){return e.type===1},Xmt=function(e){return e.type===2},o7={name:"image",parse:function(e,t){if(t.type===22){var r={url:t.value,type:0};return e.cache.addImage(t.value),r}if(t.type===18){var n=jme[t.name];if(typeof n>"u")throw new Error('Attempting to parse an unsupported image function "'+t.name+'"');return n(e,t.values)}throw new Error("Unsupported image type "+t.type)}};function Ymt(e){return!(e.type===20&&e.value==="none")&&(e.type!==18||!!jme[e.name])}var jme={"linear-gradient":Gmt,"-moz-linear-gradient":rS,"-ms-linear-gradient":rS,"-o-linear-gradient":rS,"-webkit-linear-gradient":rS,"radial-gradient":Vmt,"-moz-radial-gradient":nS,"-ms-radial-gradient":nS,"-o-radial-gradient":nS,"-webkit-radial-gradient":nS,"-webkit-gradient":Kmt},Jmt={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(t.length===0)return[];var r=t[0];return r.type===20&&r.value==="none"?[]:t.filter(function(n){return d0(n)&&Ymt(n)}).map(function(n){return o7.parse(e,n)})}},Zmt={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(r){if(En(r))switch(r.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},egt={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return wd(t).map(function(r){return r.filter(as)}).map(ume)}},tgt={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return wd(t).map(function(r){return r.filter(En).map(function(n){return n.value}).join(" ")}).map(rgt)}},rgt=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}},Gx;(function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"})(Gx||(Gx={}));var ngt={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return wd(t).map(function(r){return r.filter(igt)})}},igt=function(e){return En(e)||as(e)},z4=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},sgt=z4("top"),agt=z4("right"),ogt=z4("bottom"),lgt=z4("left"),W4=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(t,r){return ume(r.filter(as))}}},cgt=W4("top-left"),ugt=W4("top-right"),dgt=W4("bottom-right"),Agt=W4("bottom-left"),G4=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(t,r){switch(r){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},fgt=G4("top"),hgt=G4("right"),pgt=G4("bottom"),mgt=G4("left"),K4=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(t,r){return eN(r)?r.number:0}}},ggt=K4("top"),vgt=K4("right"),xgt=K4("bottom"),ygt=K4("left"),bgt={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},wgt={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){switch(t){case"rtl":return 1;case"ltr":default:return 0}}},Cgt={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter(En).reduce(function(r,n){return r|Ngt(n.value)},0)}},Ngt=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},jgt={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Sgt={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,t){return t.type===20&&t.value==="normal"?0:t.type===17||t.type===15?t.number:0}},o5;(function(e){e.NORMAL="normal",e.STRICT="strict"})(o5||(o5={}));var Bgt={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"strict":return o5.STRICT;case"normal":default:return o5.NORMAL}}},_gt={name:"line-height",initialValue:"normal",prefix:!1,type:4},IX=function(e,t){return En(e)&&e.value==="normal"?1.2*t:e.type===17?t*e.number:as(e)?Wn(e,t):t},kgt={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return t.type===20&&t.value==="none"?null:o7.parse(e,t)}},Egt={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,t){switch(t){case"inside":return 0;case"outside":default:return 1}}},LD={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},V4=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},Tgt=V4("top"),Pgt=V4("right"),Igt=V4("bottom"),Ogt=V4("left"),Fgt={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,t){return t.filter(En).map(function(r){switch(r.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}})}},Lgt={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-word":return"break-word";case"normal":default:return"normal"}}},q4=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Mgt=q4("top"),Dgt=q4("right"),Rgt=q4("bottom"),Ugt=q4("left"),Qgt={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,t){switch(t){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},Hgt={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},$gt={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.length===1&&FD(t[0],"none")?[]:wd(t).map(function(r){for(var n={color:NA.TRANSPARENT,offsetX:ua,offsetY:ua,blur:ua},i=0,s=0;s"u")throw new Error('Attempting to parse an unsupported transform function "'+t.name+'"');return r(t.values)}return null}},Ggt=function(e){var t=e.filter(function(r){return r.type===17}).map(function(r){return r.number});return t.length===6?t:null},Kgt=function(e){var t=e.filter(function(c){return c.type===17}).map(function(c){return c.number}),r=t[0],n=t[1];t[2],t[3];var i=t[4],s=t[5];t[6],t[7],t[8],t[9],t[10],t[11];var o=t[12],l=t[13];return t[14],t[15],t.length===16?[r,n,i,s,o,l]:null},Vgt={matrix:Ggt,matrix3d:Kgt},OX={type:16,number:50,flags:ZC},qgt=[OX,OX],Xgt={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,t){var r=t.filter(as);return r.length!==2?qgt:[r[0],r[1]]}},Ygt={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}}},u1;(function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"})(u1||(u1={}));var Jgt={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-all":return u1.BREAK_ALL;case"keep-all":return u1.KEEP_ALL;case"normal":default:return u1.NORMAL}}},Zgt={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,t){if(t.type===20)return{auto:!0,order:0};if(Z0(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},Sme={name:"time",parse:function(e,t){if(t.type===15)switch(t.unit.toLowerCase()){case"s":return 1e3*t.number;case"ms":return t.number}throw new Error("Unsupported time type")}},evt={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,t){return Z0(t)?t.number:1}},tvt={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},rvt={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,t){return t.filter(En).map(function(r){switch(r.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(r){return r!==0})}},nvt={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(e,t){var r=[],n=[];return t.forEach(function(i){switch(i.type){case 20:case 0:r.push(i.value);break;case 17:r.push(i.number.toString());break;case 4:n.push(r.join(" ")),r.length=0;break}}),r.length&&n.push(r.join(" ")),n.map(function(i){return i.indexOf(" ")===-1?i:"'"+i+"'"})}},ivt={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},svt={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,t){if(Z0(t))return t.number;if(En(t))switch(t.value){case"bold":return 700;case"normal":default:return 400}return 400}},avt={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.filter(En).map(function(r){return r.value})}},ovt={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"oblique":return"oblique";case"italic":return"italic";case"normal":default:return"normal"}}},_s=function(e,t){return(e&t)!==0},lvt={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(t.length===0)return[];var r=t[0];return r.type===20&&r.value==="none"?[]:t}},cvt={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(t.length===0)return null;var r=t[0];if(r.type===20&&r.value==="none")return null;for(var n=[],i=t.filter(cme),s=0;s1?1:0],this.overflowWrap=xt(t,Lgt,r.overflowWrap),this.paddingTop=xt(t,Mgt,r.paddingTop),this.paddingRight=xt(t,Dgt,r.paddingRight),this.paddingBottom=xt(t,Rgt,r.paddingBottom),this.paddingLeft=xt(t,Ugt,r.paddingLeft),this.paintOrder=xt(t,hvt,r.paintOrder),this.position=xt(t,Hgt,r.position),this.textAlign=xt(t,Qgt,r.textAlign),this.textDecorationColor=xt(t,tvt,(n=r.textDecorationColor)!==null&&n!==void 0?n:r.color),this.textDecorationLine=xt(t,rvt,(i=r.textDecorationLine)!==null&&i!==void 0?i:r.textDecoration),this.textShadow=xt(t,$gt,r.textShadow),this.textTransform=xt(t,zgt,r.textTransform),this.transform=xt(t,Wgt,r.transform),this.transformOrigin=xt(t,Xgt,r.transformOrigin),this.visibility=xt(t,Ygt,r.visibility),this.webkitTextStrokeColor=xt(t,pvt,r.webkitTextStrokeColor),this.webkitTextStrokeWidth=xt(t,mvt,r.webkitTextStrokeWidth),this.wordBreak=xt(t,Jgt,r.wordBreak),this.zIndex=xt(t,Zgt,r.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},e.prototype.isTransparent=function(){return Th(this.backgroundColor)},e.prototype.isTransformed=function(){return this.transform!==null},e.prototype.isPositioned=function(){return this.position!==0},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return this.float!==0},e.prototype.isInlineLevel=function(){return _s(this.display,4)||_s(this.display,33554432)||_s(this.display,268435456)||_s(this.display,536870912)||_s(this.display,67108864)||_s(this.display,134217728)},e}(),vvt=function(){function e(t,r){this.content=xt(t,lvt,r.content),this.quotes=xt(t,Avt,r.quotes)}return e}(),LX=function(){function e(t,r){this.counterIncrement=xt(t,cvt,r.counterIncrement),this.counterReset=xt(t,uvt,r.counterReset)}return e}(),xt=function(e,t,r){var n=new ome,i=r!==null&&typeof r<"u"?r.toString():t.initialValue;n.write(i);var s=new lme(n.read());switch(t.type){case 2:var o=s.parseComponentValue();return t.parse(e,En(o)?o.value:t.initialValue);case 0:return t.parse(e,s.parseComponentValue());case 1:return t.parse(e,s.parseComponentValues());case 4:return s.parseComponentValue();case 3:switch(t.format){case"angle":return H4.parse(e,s.parseComponentValue());case"color":return Eh.parse(e,s.parseComponentValue());case"image":return o7.parse(e,s.parseComponentValue());case"length":var l=s.parseComponentValue();return Wh(l)?l:ua;case"length-percentage":var c=s.parseComponentValue();return as(c)?c:ua;case"time":return Sme.parse(e,s.parseComponentValue())}break}},xvt="data-html2canvas-debug",yvt=function(e){var t=e.getAttribute(xvt);switch(t){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},MD=function(e,t){var r=yvt(e);return r===1||t===r},Cd=function(){function e(t,r){if(this.context=t,this.textNodes=[],this.elements=[],this.flags=0,MD(r,3))debugger;this.styles=new gvt(t,window.getComputedStyle(r,null)),UD(r)&&(this.styles.animationDuration.some(function(n){return n>0})&&(r.style.animationDuration="0s"),this.styles.transform!==null&&(r.style.transform="none")),this.bounds=U4(this.context,r),MD(r,4)&&(this.flags|=16)}return e}(),bvt="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",MX="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jw=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var iS=0;iS>4,d[i++]=(o&15)<<4|l>>2,d[i++]=(l&3)<<6|c&63;return u},Cvt=function(e){for(var t=e.length,r=[],n=0;n>Wm,Svt=1<>Wm,_vt=Bme+Bvt,kvt=_vt,Evt=32,Tvt=kvt+Evt,Pvt=65536>>l7,Ivt=1<=0){if(t<55296||t>56319&&t<=65535)return r=this.index[t>>Wm],r=(r<>Wm)],r=(r<>l7),r=this.index[r],r+=t>>Wm&Ovt,r=this.index[r],r=(r<"u"?[]:new Uint8Array(256);for(var sS=0;sS=55296&&i<=56319&&r>10)+55296,o%1024+56320)),(i+1===r||n.length>16384)&&(s+=String.fromCharCode.apply(String,n),n.length=0)}return s},$vt=Lvt(bvt),Hl="×",x3="÷",zvt=function(e){return $vt.get(e)},Wvt=function(e,t,r){var n=r-2,i=t[n],s=t[r-1],o=t[r];if(s===h3&&o===p3)return Hl;if(s===h3||s===p3||s===UX||o===h3||o===p3||o===UX)return x3;if(s===HX&&[HX,m3,$X,zX].indexOf(o)!==-1||(s===$X||s===m3)&&(o===m3||o===g3)||(s===zX||s===g3)&&o===g3||o===WX||o===QX||o===Uvt||s===Rvt)return Hl;if(s===WX&&o===GX){for(;i===QX;)i=t[--n];if(i===GX)return Hl}if(s===v3&&o===v3){for(var l=0;i===v3;)l++,i=t[--n];if(l%2===0)return Hl}return x3},Gvt=function(e){var t=Qvt(e),r=t.length,n=0,i=0,s=t.map(zvt);return{next:function(){if(n>=r)return{done:!0,value:null};for(var o=Hl;no.x||d.y>o.y;return o=d,u===0?!0:A});return e.body.removeChild(t),l},Xvt=function(){return typeof new Image().crossOrigin<"u"},Yvt=function(){return typeof new XMLHttpRequest().responseType=="string"},Jvt=function(e){var t=new Image,r=e.createElement("canvas"),n=r.getContext("2d");if(!n)return!1;t.src="data:image/svg+xml,";try{n.drawImage(t,0,0),r.toDataURL()}catch{return!1}return!0},KX=function(e){return e[0]===0&&e[1]===255&&e[2]===0&&e[3]===255},Zvt=function(e){var t=e.createElement("canvas"),r=100;t.width=r,t.height=r;var n=t.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,r,r);var i=new Image,s=t.toDataURL();i.src=s;var o=DD(r,r,0,0,i);return n.fillStyle="red",n.fillRect(0,0,r,r),VX(o).then(function(l){n.drawImage(l,0,0);var c=n.getImageData(0,0,r,r).data;n.fillStyle="red",n.fillRect(0,0,r,r);var u=e.createElement("div");return u.style.backgroundImage="url("+s+")",u.style.height=r+"px",KX(c)?VX(DD(r,r,0,0,u)):Promise.reject(!1)}).then(function(l){return n.drawImage(l,0,0),KX(n.getImageData(0,0,r,r).data)}).catch(function(){return!1})},DD=function(e,t,r,n,i){var s="http://www.w3.org/2000/svg",o=document.createElementNS(s,"svg"),l=document.createElementNS(s,"foreignObject");return o.setAttributeNS(null,"width",e.toString()),o.setAttributeNS(null,"height",t.toString()),l.setAttributeNS(null,"width","100%"),l.setAttributeNS(null,"height","100%"),l.setAttributeNS(null,"x",r.toString()),l.setAttributeNS(null,"y",n.toString()),l.setAttributeNS(null,"externalResourcesRequired","true"),o.appendChild(l),l.appendChild(i),o},VX=function(e){return new Promise(function(t,r){var n=new Image;n.onload=function(){return t(n)},n.onerror=r,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},aa={get SUPPORT_RANGE_BOUNDS(){var e=Vvt(document);return Object.defineProperty(aa,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=aa.SUPPORT_RANGE_BOUNDS&&qvt(document);return Object.defineProperty(aa,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=Jvt(document);return Object.defineProperty(aa,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e=typeof Array.from=="function"&&typeof window.fetch=="function"?Zvt(document):Promise.resolve(!1);return Object.defineProperty(aa,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=Xvt();return Object.defineProperty(aa,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e=Yvt();return Object.defineProperty(aa,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(aa,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(aa,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},d1=function(){function e(t,r){this.text=t,this.bounds=r}return e}(),ext=function(e,t,r,n){var i=nxt(t,r),s=[],o=0;return i.forEach(function(l){if(r.textDecorationLine.length||l.trim().length>0)if(aa.SUPPORT_RANGE_BOUNDS){var c=qX(n,o,l.length).getClientRects();if(c.length>1){var u=c7(l),d=0;u.forEach(function(h){s.push(new d1(h,LA.fromDOMRectList(e,qX(n,d+o,h.length).getClientRects()))),d+=h.length})}else s.push(new d1(l,LA.fromDOMRectList(e,c)))}else{var A=n.splitText(l.length);s.push(new d1(l,txt(e,n))),n=A}else aa.SUPPORT_RANGE_BOUNDS||(n=n.splitText(l.length));o+=l.length}),s},txt=function(e,t){var r=t.ownerDocument;if(r){var n=r.createElement("html2canvaswrapper");n.appendChild(t.cloneNode(!0));var i=t.parentNode;if(i){i.replaceChild(n,t);var s=U4(e,n);return n.firstChild&&i.replaceChild(n.firstChild,n),s}}return LA.EMPTY},qX=function(e,t,r){var n=e.ownerDocument;if(!n)throw new Error("Node has no owner document");var i=n.createRange();return i.setStart(e,t),i.setEnd(e,t+r),i},c7=function(e){if(aa.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(t.segment(e)).map(function(r){return r.segment})}return Kvt(e)},rxt=function(e,t){if(aa.SUPPORT_NATIVE_TEXT_SEGMENTATION){var r=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(r.segment(e)).map(function(n){return n.segment})}return sxt(e,t)},nxt=function(e,t){return t.letterSpacing!==0?c7(e):rxt(e,t)},ixt=[32,160,4961,65792,65793,4153,4241],sxt=function(e,t){for(var r=Ppt(e,{lineBreak:t.lineBreak,wordBreak:t.overflowWrap==="break-word"?"break-word":t.wordBreak}),n=[],i,s=function(){if(i.value){var o=i.value.slice(),l=Q4(o),c="";l.forEach(function(u){ixt.indexOf(u)===-1?c+=zi(u):(c.length&&n.push(c),n.push(zi(u)),c="")}),c.length&&n.push(c)}};!(i=r.next()).done;)s();return n},axt=function(){function e(t,r,n){this.text=oxt(r.data,n.textTransform),this.textBounds=ext(t,this.text,n,r)}return e}(),oxt=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(lxt,cxt);case 2:return e.toUpperCase();default:return e}},lxt=/(^|\s|:|-|\(|\))([a-z])/g,cxt=function(e,t,r){return e.length>0?t+r.toUpperCase():e},_me=function(e){Au(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.src=n.currentSrc||n.src,i.intrinsicWidth=n.naturalWidth,i.intrinsicHeight=n.naturalHeight,i.context.cache.addImage(i.src),i}return t}(Cd),kme=function(e){Au(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.canvas=n,i.intrinsicWidth=n.width,i.intrinsicHeight=n.height,i}return t}(Cd),Eme=function(e){Au(t,e);function t(r,n){var i=e.call(this,r,n)||this,s=new XMLSerializer,o=U4(r,n);return n.setAttribute("width",o.width+"px"),n.setAttribute("height",o.height+"px"),i.svg="data:image/svg+xml,"+encodeURIComponent(s.serializeToString(n)),i.intrinsicWidth=n.width.baseVal.value,i.intrinsicHeight=n.height.baseVal.value,i.context.cache.addImage(i.svg),i}return t}(Cd),Tme=function(e){Au(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.value=n.value,i}return t}(Cd),RD=function(e){Au(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.start=n.start,i.reversed=typeof n.reversed=="boolean"&&n.reversed===!0,i}return t}(Cd),uxt=[{type:15,flags:0,unit:"px",number:3}],dxt=[{type:16,flags:0,number:50}],Axt=function(e){return e.width>e.height?new LA(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width0)r.textNodes.push(new axt(e,i,r.styles));else if(vx(i))if(Qme(i)&&i.assignedNodes)i.assignedNodes().forEach(function(l){return rB(e,l,r,n)});else{var o=Fme(e,i);o.styles.isVisible()&&(mxt(i,o,n)?o.flags|=4:gxt(o.styles)&&(o.flags|=2),pxt.indexOf(i.tagName)!==-1&&(o.flags|=8),r.elements.push(o),i.slot,i.shadowRoot?rB(e,i.shadowRoot,o,n):!u5(i)&&!Dme(i)&&!d5(i)&&rB(e,i,o,n))}},Fme=function(e,t){return QD(t)?new _me(e,t):Rme(t)?new kme(e,t):Dme(t)?new Eme(e,t):vxt(t)?new Tme(e,t):xxt(t)?new RD(e,t):yxt(t)?new u7(e,t):d5(t)?new Pme(e,t):u5(t)?new Ime(e,t):Ume(t)?new Ome(e,t):new Cd(e,t)},Lme=function(e,t){var r=Fme(e,t);return r.flags|=4,rB(e,t,r,r),r},mxt=function(e,t,r){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||d7(e)&&r.styles.isTransparent()},gxt=function(e){return e.isPositioned()||e.isFloating()},Mme=function(e){return e.nodeType===Node.TEXT_NODE},vx=function(e){return e.nodeType===Node.ELEMENT_NODE},UD=function(e){return vx(e)&&typeof e.style<"u"&&!nB(e)},nB=function(e){return typeof e.className=="object"},vxt=function(e){return e.tagName==="LI"},xxt=function(e){return e.tagName==="OL"},yxt=function(e){return e.tagName==="INPUT"},bxt=function(e){return e.tagName==="HTML"},Dme=function(e){return e.tagName==="svg"},d7=function(e){return e.tagName==="BODY"},Rme=function(e){return e.tagName==="CANVAS"},YX=function(e){return e.tagName==="VIDEO"},QD=function(e){return e.tagName==="IMG"},Ume=function(e){return e.tagName==="IFRAME"},JX=function(e){return e.tagName==="STYLE"},wxt=function(e){return e.tagName==="SCRIPT"},u5=function(e){return e.tagName==="TEXTAREA"},d5=function(e){return e.tagName==="SELECT"},Qme=function(e){return e.tagName==="SLOT"},ZX=function(e){return e.tagName.indexOf("-")>0},Cxt=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(t){var r=this.counters[t];return r&&r.length?r[r.length-1]:1},e.prototype.getCounterValues=function(t){var r=this.counters[t];return r||[]},e.prototype.pop=function(t){var r=this;t.forEach(function(n){return r.counters[n].pop()})},e.prototype.parse=function(t){var r=this,n=t.counterIncrement,i=t.counterReset,s=!0;n!==null&&n.forEach(function(l){var c=r.counters[l.counter];c&&l.increment!==0&&(s=!1,c.length||c.push(1),c[Math.max(0,c.length-1)]+=l.increment)});var o=[];return s&&i.forEach(function(l){var c=r.counters[l.counter];o.push(l.counter),c||(c=r.counters[l.counter]=[]),c.push(l.reset)}),o},e}(),eY={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},tY={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Nxt={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},jxt={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Pv=function(e,t,r,n,i,s){return er?X2(e,i,s.length>0):n.integers.reduce(function(o,l,c){for(;e>=l;)e-=l,o+=n.values[c];return o},"")+s},Hme=function(e,t,r,n){var i="";do r||e--,i=n(e)+i,e/=t;while(e*t>=t);return i},$i=function(e,t,r,n,i){var s=r-t+1;return(e<0?"-":"")+(Hme(Math.abs(e),s,n,function(o){return zi(Math.floor(o%s)+t)})+i)},Dp=function(e,t,r){r===void 0&&(r=". ");var n=t.length;return Hme(Math.abs(e),n,!1,function(i){return t[Math.floor(i%n)]})+r},Xv=1,Cf=2,Nf=4,Sw=8,Kd=function(e,t,r,n,i,s){if(e<-9999||e>9999)return X2(e,4,i.length>0);var o=Math.abs(e),l=i;if(o===0)return t[0]+l;for(var c=0;o>0&&c<=4;c++){var u=o%10;u===0&&_s(s,Xv)&&l!==""?l=t[u]+l:u>1||u===1&&c===0||u===1&&c===1&&_s(s,Cf)||u===1&&c===1&&_s(s,Nf)&&e>100||u===1&&c>1&&_s(s,Sw)?l=t[u]+(c>0?r[c-1]:"")+l:u===1&&c>0&&(l=r[c-1]+l),o=Math.floor(o/10)}return(e<0?n:"")+l},rY="十百千萬",nY="拾佰仟萬",iY="マイナス",y3="마이너스",X2=function(e,t,r){var n=r?". ":"",i=r?"、":"",s=r?", ":"",o=r?" ":"";switch(t){case 0:return"•"+o;case 1:return"◦"+o;case 2:return"◾"+o;case 5:var l=$i(e,48,57,!0,n);return l.length<4?"0"+l:l;case 4:return Dp(e,"〇一二三四五六七八九",i);case 6:return Pv(e,1,3999,eY,3,n).toLowerCase();case 7:return Pv(e,1,3999,eY,3,n);case 8:return $i(e,945,969,!1,n);case 9:return $i(e,97,122,!1,n);case 10:return $i(e,65,90,!1,n);case 11:return $i(e,1632,1641,!0,n);case 12:case 49:return Pv(e,1,9999,tY,3,n);case 35:return Pv(e,1,9999,tY,3,n).toLowerCase();case 13:return $i(e,2534,2543,!0,n);case 14:case 30:return $i(e,6112,6121,!0,n);case 15:return Dp(e,"子丑寅卯辰巳午未申酉戌亥",i);case 16:return Dp(e,"甲乙丙丁戊己庚辛壬癸",i);case 17:case 48:return Kd(e,"零一二三四五六七八九",rY,"負",i,Cf|Nf|Sw);case 47:return Kd(e,"零壹貳參肆伍陸柒捌玖",nY,"負",i,Xv|Cf|Nf|Sw);case 42:return Kd(e,"零一二三四五六七八九",rY,"负",i,Cf|Nf|Sw);case 41:return Kd(e,"零壹贰叁肆伍陆柒捌玖",nY,"负",i,Xv|Cf|Nf|Sw);case 26:return Kd(e,"〇一二三四五六七八九","十百千万",iY,i,0);case 25:return Kd(e,"零壱弐参四伍六七八九","拾百千万",iY,i,Xv|Cf|Nf);case 31:return Kd(e,"영일이삼사오육칠팔구","십백천만",y3,s,Xv|Cf|Nf);case 33:return Kd(e,"零一二三四五六七八九","十百千萬",y3,s,0);case 32:return Kd(e,"零壹貳參四五六七八九","拾百千",y3,s,Xv|Cf|Nf);case 18:return $i(e,2406,2415,!0,n);case 20:return Pv(e,1,19999,jxt,3,n);case 21:return $i(e,2790,2799,!0,n);case 22:return $i(e,2662,2671,!0,n);case 22:return Pv(e,1,10999,Nxt,3,n);case 23:return Dp(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return Dp(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return $i(e,3302,3311,!0,n);case 28:return Dp(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case 29:return Dp(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case 34:return $i(e,3792,3801,!0,n);case 37:return $i(e,6160,6169,!0,n);case 38:return $i(e,4160,4169,!0,n);case 39:return $i(e,2918,2927,!0,n);case 40:return $i(e,1776,1785,!0,n);case 43:return $i(e,3046,3055,!0,n);case 44:return $i(e,3174,3183,!0,n);case 45:return $i(e,3664,3673,!0,n);case 46:return $i(e,3872,3881,!0,n);case 3:default:return $i(e,48,57,!0,n)}},$me="data-html2canvas-ignore",sY=function(){function e(t,r,n){if(this.context=t,this.options=n,this.scrolledElements=[],this.referenceElement=r,this.counters=new Cxt,this.quoteDepth=0,!r.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(r.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(t,r){var n=this,i=Sxt(t,r);if(!i.contentWindow)return Promise.reject("Unable to find iframe window");var s=t.defaultView.pageXOffset,o=t.defaultView.pageYOffset,l=i.contentWindow,c=l.document,u=kxt(i).then(function(){return Ya(n,void 0,void 0,function(){var d,A;return ka(this,function(h){switch(h.label){case 0:return this.scrolledElements.forEach(Ixt),l&&(l.scrollTo(r.left,r.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(l.scrollY!==r.top||l.scrollX!==r.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(l.scrollX-r.left,l.scrollY-r.top,0,0))),d=this.options.onclone,A=this.clonedReferenceElement,typeof A>"u"?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:c.fonts&&c.fonts.ready?[4,c.fonts.ready]:[3,2];case 1:h.sent(),h.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,_xt(c)]:[3,4];case 3:h.sent(),h.label=4;case 4:return typeof d=="function"?[2,Promise.resolve().then(function(){return d(c,A)}).then(function(){return i})]:[2,i]}})})});return c.open(),c.write(Txt(document.doctype)+""),Pxt(this.referenceElement.ownerDocument,s,o),c.replaceChild(c.adoptNode(this.documentElement),c.documentElement),c.close(),u},e.prototype.createElementClone=function(t){if(MD(t,2))debugger;if(Rme(t))return this.createCanvasClone(t);if(YX(t))return this.createVideoClone(t);if(JX(t))return this.createStyleClone(t);var r=t.cloneNode(!1);return QD(r)&&(QD(t)&&t.currentSrc&&t.currentSrc!==t.src&&(r.src=t.currentSrc,r.srcset=""),r.loading==="lazy"&&(r.loading="eager")),ZX(r)?this.createCustomElementClone(r):r},e.prototype.createCustomElementClone=function(t){var r=document.createElement("html2canvascustomelement");return b3(t.style,r),r},e.prototype.createStyleClone=function(t){try{var r=t.sheet;if(r&&r.cssRules){var n=[].slice.call(r.cssRules,0).reduce(function(s,o){return o&&typeof o.cssText=="string"?s+o.cssText:s},""),i=t.cloneNode(!1);return i.textContent=n,i}}catch(s){if(this.context.logger.error("Unable to access cssRules property",s),s.name!=="SecurityError")throw s}return t.cloneNode(!1)},e.prototype.createCanvasClone=function(t){var r;if(this.options.inlineImages&&t.ownerDocument){var n=t.ownerDocument.createElement("img");try{return n.src=t.toDataURL(),n}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",t)}}var i=t.cloneNode(!1);try{i.width=t.width,i.height=t.height;var s=t.getContext("2d"),o=i.getContext("2d");if(o)if(!this.options.allowTaint&&s)o.putImageData(s.getImageData(0,0,t.width,t.height),0,0);else{var l=(r=t.getContext("webgl2"))!==null&&r!==void 0?r:t.getContext("webgl");if(l){var c=l.getContextAttributes();(c==null?void 0:c.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",t)}o.drawImage(t,0,0)}return i}catch{this.context.logger.info("Unable to clone canvas as it is tainted",t)}return i},e.prototype.createVideoClone=function(t){var r=t.ownerDocument.createElement("canvas");r.width=t.offsetWidth,r.height=t.offsetHeight;var n=r.getContext("2d");try{return n&&(n.drawImage(t,0,0,r.width,r.height),this.options.allowTaint||n.getImageData(0,0,r.width,r.height)),r}catch{this.context.logger.info("Unable to clone video as it is tainted",t)}var i=t.ownerDocument.createElement("canvas");return i.width=t.offsetWidth,i.height=t.offsetHeight,i},e.prototype.appendChildNode=function(t,r,n){(!vx(r)||!wxt(r)&&!r.hasAttribute($me)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(r)))&&(!this.options.copyStyles||!vx(r)||!JX(r))&&t.appendChild(this.cloneNode(r,n))},e.prototype.cloneChildNodes=function(t,r,n){for(var i=this,s=t.shadowRoot?t.shadowRoot.firstChild:t.firstChild;s;s=s.nextSibling)if(vx(s)&&Qme(s)&&typeof s.assignedNodes=="function"){var o=s.assignedNodes();o.length&&o.forEach(function(l){return i.appendChildNode(r,l,n)})}else this.appendChildNode(r,s,n)},e.prototype.cloneNode=function(t,r){if(Mme(t))return document.createTextNode(t.data);if(!t.ownerDocument)return t.cloneNode(!1);var n=t.ownerDocument.defaultView;if(n&&vx(t)&&(UD(t)||nB(t))){var i=this.createElementClone(t);i.style.transitionProperty="none";var s=n.getComputedStyle(t),o=n.getComputedStyle(t,":before"),l=n.getComputedStyle(t,":after");this.referenceElement===t&&UD(i)&&(this.clonedReferenceElement=i),d7(i)&&Lxt(i);var c=this.counters.parse(new LX(this.context,s)),u=this.resolvePseudoContent(t,i,o,A1.BEFORE);ZX(t)&&(r=!0),YX(t)||this.cloneChildNodes(t,i,r),u&&i.insertBefore(u,i.firstChild);var d=this.resolvePseudoContent(t,i,l,A1.AFTER);return d&&i.appendChild(d),this.counters.pop(c),(s&&(this.options.copyStyles||nB(t))&&!Ume(t)||r)&&b3(s,i),(t.scrollTop!==0||t.scrollLeft!==0)&&this.scrolledElements.push([i,t.scrollLeft,t.scrollTop]),(u5(t)||d5(t))&&(u5(i)||d5(i))&&(i.value=t.value),i}return t.cloneNode(!1)},e.prototype.resolvePseudoContent=function(t,r,n,i){var s=this;if(n){var o=n.content,l=r.ownerDocument;if(!(!l||!o||o==="none"||o==="-moz-alt-content"||n.display==="none")){this.counters.parse(new LX(this.context,n));var c=new vvt(this.context,n),u=l.createElement("html2canvaspseudoelement");b3(n,u),c.content.forEach(function(A){if(A.type===0)u.appendChild(l.createTextNode(A.value));else if(A.type===22){var h=l.createElement("img");h.src=A.value,h.style.opacity="1",u.appendChild(h)}else if(A.type===18){if(A.name==="attr"){var f=A.values.filter(En);f.length&&u.appendChild(l.createTextNode(t.getAttribute(f[0].value)||""))}else if(A.name==="counter"){var m=A.values.filter(d0),p=m[0],g=m[1];if(p&&En(p)){var v=s.counters.getCounterValue(p.value),x=g&&En(g)?LD.parse(s.context,g.value):3;u.appendChild(l.createTextNode(X2(v,x,!1)))}}else if(A.name==="counters"){var y=A.values.filter(d0),p=y[0],b=y[1],g=y[2];if(p&&En(p)){var C=s.counters.getCounterValues(p.value),j=g&&En(g)?LD.parse(s.context,g.value):3,S=b&&b.type===0?b.value:"",T=C.map(function(P){return X2(P,j,!1)}).join(S);u.appendChild(l.createTextNode(T))}}}else if(A.type===20)switch(A.value){case"open-quote":u.appendChild(l.createTextNode(FX(c.quotes,s.quoteDepth++,!0)));break;case"close-quote":u.appendChild(l.createTextNode(FX(c.quotes,--s.quoteDepth,!1)));break;default:u.appendChild(l.createTextNode(A.value))}}),u.className=HD+" "+$D;var d=i===A1.BEFORE?" "+HD:" "+$D;return nB(r)?r.className.baseValue+=d:r.className+=d,u}}},e.destroy=function(t){return t.parentNode?(t.parentNode.removeChild(t),!0):!1},e}(),A1;(function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"})(A1||(A1={}));var Sxt=function(e,t){var r=e.createElement("iframe");return r.className="html2canvas-container",r.style.visibility="hidden",r.style.position="fixed",r.style.left="-10000px",r.style.top="0px",r.style.border="0",r.width=t.width.toString(),r.height=t.height.toString(),r.scrolling="no",r.setAttribute($me,"true"),e.body.appendChild(r),r},Bxt=function(e){return new Promise(function(t){if(e.complete){t();return}if(!e.src){t();return}e.onload=t,e.onerror=t})},_xt=function(e){return Promise.all([].slice.call(e.images,0).map(Bxt))},kxt=function(e){return new Promise(function(t,r){var n=e.contentWindow;if(!n)return r("No window assigned for iframe");var i=n.document;n.onload=e.onload=function(){n.onload=e.onload=null;var s=setInterval(function(){i.body.childNodes.length>0&&i.readyState==="complete"&&(clearInterval(s),t(e))},50)}})},Ext=["all","d","content"],b3=function(e,t){for(var r=e.length-1;r>=0;r--){var n=e.item(r);Ext.indexOf(n)===-1&&t.style.setProperty(n,e.getPropertyValue(n))}return t},Txt=function(e){var t="";return e&&(t+=""),t},Pxt=function(e,t,r){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||r!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,r)},Ixt=function(e){var t=e[0],r=e[1],n=e[2];t.scrollLeft=r,t.scrollTop=n},Oxt=":before",Fxt=":after",HD="___html2canvas___pseudoelement_before",$D="___html2canvas___pseudoelement_after",aY=`{ content: "" !important; display: none !important; }`,Lxt=function(e){Mxt(e,"."+HD+Oxt+aY+` .`+$D+Fxt+aY)},Mxt=function(e,t){var r=e.ownerDocument;if(r){var n=r.createElement("style");n.textContent=t,e.appendChild(n)}},zme=function(){function e(){}return e.getOrigin=function(t){var r=e._link;return r?(r.href=t,r.href=r.href,r.protocol+r.hostname+r.port):"about:blank"},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement("a"),e._origin=e.getOrigin(t.location.href)},e._origin="about:blank",e}(),Dxt=function(){function e(t,r){this.context=t,this._options=r,this._cache={}}return e.prototype.addImage=function(t){var r=Promise.resolve();return this.has(t)||(C3(t)||Hxt(t))&&(this._cache[t]=this.loadImage(t)).catch(function(){}),r},e.prototype.match=function(t){return this._cache[t]},e.prototype.loadImage=function(t){return Ya(this,void 0,void 0,function(){var r,n,i,s,o=this;return ka(this,function(l){switch(l.label){case 0:return r=zme.isSameOrigin(t),n=!w3(t)&&this._options.useCORS===!0&&aa.SUPPORT_CORS_IMAGES&&!r,i=!w3(t)&&!r&&!C3(t)&&typeof this._options.proxy=="string"&&aa.SUPPORT_CORS_XHR&&!n,!r&&this._options.allowTaint===!1&&!w3(t)&&!C3(t)&&!i&&!n?[2]:(s=t,i?[4,this.proxy(s)]:[3,2]);case 1:s=l.sent(),l.label=2;case 2:return this.context.logger.debug("Added image "+t.substring(0,256)),[4,new Promise(function(c,u){var d=new Image;d.onload=function(){return c(d)},d.onerror=u,($xt(s)||n)&&(d.crossOrigin="anonymous"),d.src=s,d.complete===!0&&setTimeout(function(){return c(d)},500),o._options.imageTimeout>0&&setTimeout(function(){return u("Timed out ("+o._options.imageTimeout+"ms) loading image")},o._options.imageTimeout)})];case 3:return[2,l.sent()]}})})},e.prototype.has=function(t){return typeof this._cache[t]<"u"},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(t){var r=this,n=this._options.proxy;if(!n)throw new Error("No proxy defined");var i=t.substring(0,256);return new Promise(function(s,o){var l=aa.SUPPORT_RESPONSE_TYPE?"blob":"text",c=new XMLHttpRequest;c.onload=function(){if(c.status===200)if(l==="text")s(c.response);else{var A=new FileReader;A.addEventListener("load",function(){return s(A.result)},!1),A.addEventListener("error",function(h){return o(h)},!1),A.readAsDataURL(c.response)}else o("Failed to proxy resource "+i+" with status code "+c.status)},c.onerror=o;var u=n.indexOf("?")>-1?"&":"?";if(c.open("GET",""+n+u+"url="+encodeURIComponent(t)+"&responseType="+l),l!=="text"&&c instanceof XMLHttpRequest&&(c.responseType=l),r._options.imageTimeout){var d=r._options.imageTimeout;c.timeout=d,c.ontimeout=function(){return o("Timed out ("+d+"ms) proxying "+i)}}c.send()})},e}(),Rxt=/^data:image\/svg\+xml/i,Uxt=/^data:image\/.*;base64,/i,Qxt=/^data:image\/.*/i,Hxt=function(e){return aa.SUPPORT_SVG_DRAWING||!zxt(e)},w3=function(e){return Qxt.test(e)},$xt=function(e){return Uxt.test(e)},C3=function(e){return e.substr(0,4)==="blob"},zxt=function(e){return e.substr(-3).toLowerCase()==="svg"||Rxt.test(e)},pt=function(){function e(t,r){this.type=0,this.x=t,this.y=r}return e.prototype.add=function(t,r){return new e(this.x+t,this.y+r)},e}(),Iv=function(e,t,r){return new pt(e.x+(t.x-e.x)*r,e.y+(t.y-e.y)*r)},aS=function(){function e(t,r,n,i){this.type=1,this.start=t,this.startControl=r,this.endControl=n,this.end=i}return e.prototype.subdivide=function(t,r){var n=Iv(this.start,this.startControl,t),i=Iv(this.startControl,this.endControl,t),s=Iv(this.endControl,this.end,t),o=Iv(n,i,t),l=Iv(i,s,t),c=Iv(o,l,t);return r?new e(this.start,n,o,c):new e(c,l,s,this.end)},e.prototype.add=function(t,r){return new e(this.start.add(t,r),this.startControl.add(t,r),this.endControl.add(t,r),this.end.add(t,r))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),ql=function(e){return e.type===1},Wxt=function(){function e(t){var r=t.styles,n=t.bounds,i=Nw(r.borderTopLeftRadius,n.width,n.height),s=i[0],o=i[1],l=Nw(r.borderTopRightRadius,n.width,n.height),c=l[0],u=l[1],d=Nw(r.borderBottomRightRadius,n.width,n.height),A=d[0],h=d[1],f=Nw(r.borderBottomLeftRadius,n.width,n.height),m=f[0],p=f[1],g=[];g.push((s+c)/n.width),g.push((m+A)/n.width),g.push((o+p)/n.height),g.push((u+h)/n.height);var v=Math.max.apply(Math,g);v>1&&(s/=v,o/=v,c/=v,u/=v,A/=v,h/=v,m/=v,p/=v);var x=n.width-c,y=n.height-h,b=n.width-A,C=n.height-p,j=r.borderTopWidth,S=r.borderRightWidth,T=r.borderBottomWidth,B=r.borderLeftWidth,I=Wn(r.paddingTop,t.bounds.width),P=Wn(r.paddingRight,t.bounds.width),E=Wn(r.paddingBottom,t.bounds.width),M=Wn(r.paddingLeft,t.bounds.width);this.topLeftBorderDoubleOuterBox=s>0||o>0?li(n.left+B/3,n.top+j/3,s-B/3,o-j/3,gn.TOP_LEFT):new pt(n.left+B/3,n.top+j/3),this.topRightBorderDoubleOuterBox=s>0||o>0?li(n.left+x,n.top+j/3,c-S/3,u-j/3,gn.TOP_RIGHT):new pt(n.left+n.width-S/3,n.top+j/3),this.bottomRightBorderDoubleOuterBox=A>0||h>0?li(n.left+b,n.top+y,A-S/3,h-T/3,gn.BOTTOM_RIGHT):new pt(n.left+n.width-S/3,n.top+n.height-T/3),this.bottomLeftBorderDoubleOuterBox=m>0||p>0?li(n.left+B/3,n.top+C,m-B/3,p-T/3,gn.BOTTOM_LEFT):new pt(n.left+B/3,n.top+n.height-T/3),this.topLeftBorderDoubleInnerBox=s>0||o>0?li(n.left+B*2/3,n.top+j*2/3,s-B*2/3,o-j*2/3,gn.TOP_LEFT):new pt(n.left+B*2/3,n.top+j*2/3),this.topRightBorderDoubleInnerBox=s>0||o>0?li(n.left+x,n.top+j*2/3,c-S*2/3,u-j*2/3,gn.TOP_RIGHT):new pt(n.left+n.width-S*2/3,n.top+j*2/3),this.bottomRightBorderDoubleInnerBox=A>0||h>0?li(n.left+b,n.top+y,A-S*2/3,h-T*2/3,gn.BOTTOM_RIGHT):new pt(n.left+n.width-S*2/3,n.top+n.height-T*2/3),this.bottomLeftBorderDoubleInnerBox=m>0||p>0?li(n.left+B*2/3,n.top+C,m-B*2/3,p-T*2/3,gn.BOTTOM_LEFT):new pt(n.left+B*2/3,n.top+n.height-T*2/3),this.topLeftBorderStroke=s>0||o>0?li(n.left+B/2,n.top+j/2,s-B/2,o-j/2,gn.TOP_LEFT):new pt(n.left+B/2,n.top+j/2),this.topRightBorderStroke=s>0||o>0?li(n.left+x,n.top+j/2,c-S/2,u-j/2,gn.TOP_RIGHT):new pt(n.left+n.width-S/2,n.top+j/2),this.bottomRightBorderStroke=A>0||h>0?li(n.left+b,n.top+y,A-S/2,h-T/2,gn.BOTTOM_RIGHT):new pt(n.left+n.width-S/2,n.top+n.height-T/2),this.bottomLeftBorderStroke=m>0||p>0?li(n.left+B/2,n.top+C,m-B/2,p-T/2,gn.BOTTOM_LEFT):new pt(n.left+B/2,n.top+n.height-T/2),this.topLeftBorderBox=s>0||o>0?li(n.left,n.top,s,o,gn.TOP_LEFT):new pt(n.left,n.top),this.topRightBorderBox=c>0||u>0?li(n.left+x,n.top,c,u,gn.TOP_RIGHT):new pt(n.left+n.width,n.top),this.bottomRightBorderBox=A>0||h>0?li(n.left+b,n.top+y,A,h,gn.BOTTOM_RIGHT):new pt(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=m>0||p>0?li(n.left,n.top+C,m,p,gn.BOTTOM_LEFT):new pt(n.left,n.top+n.height),this.topLeftPaddingBox=s>0||o>0?li(n.left+B,n.top+j,Math.max(0,s-B),Math.max(0,o-j),gn.TOP_LEFT):new pt(n.left+B,n.top+j),this.topRightPaddingBox=c>0||u>0?li(n.left+Math.min(x,n.width-S),n.top+j,x>n.width+S?0:Math.max(0,c-S),Math.max(0,u-j),gn.TOP_RIGHT):new pt(n.left+n.width-S,n.top+j),this.bottomRightPaddingBox=A>0||h>0?li(n.left+Math.min(b,n.width-B),n.top+Math.min(y,n.height-T),Math.max(0,A-S),Math.max(0,h-T),gn.BOTTOM_RIGHT):new pt(n.left+n.width-S,n.top+n.height-T),this.bottomLeftPaddingBox=m>0||p>0?li(n.left+B,n.top+Math.min(C,n.height-T),Math.max(0,m-B),Math.max(0,p-T),gn.BOTTOM_LEFT):new pt(n.left+B,n.top+n.height-T),this.topLeftContentBox=s>0||o>0?li(n.left+B+M,n.top+j+I,Math.max(0,s-(B+M)),Math.max(0,o-(j+I)),gn.TOP_LEFT):new pt(n.left+B+M,n.top+j+I),this.topRightContentBox=c>0||u>0?li(n.left+Math.min(x,n.width+B+M),n.top+j+I,x>n.width+B+M?0:c-B+M,u-(j+I),gn.TOP_RIGHT):new pt(n.left+n.width-(S+P),n.top+j+I),this.bottomRightContentBox=A>0||h>0?li(n.left+Math.min(b,n.width-(B+M)),n.top+Math.min(y,n.height+j+I),Math.max(0,A-(S+P)),h-(T+E),gn.BOTTOM_RIGHT):new pt(n.left+n.width-(S+P),n.top+n.height-(T+E)),this.bottomLeftContentBox=m>0||p>0?li(n.left+B+M,n.top+C,Math.max(0,m-(B+M)),p-(T+E),gn.BOTTOM_LEFT):new pt(n.left+B+M,n.top+n.height-(T+E))}return e}(),gn;(function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(gn||(gn={}));var li=function(e,t,r,n,i){var s=4*((Math.sqrt(2)-1)/3),o=r*s,l=n*s,c=e+r,u=t+n;switch(i){case gn.TOP_LEFT:return new aS(new pt(e,u),new pt(e,u-l),new pt(c-o,t),new pt(c,t));case gn.TOP_RIGHT:return new aS(new pt(e,t),new pt(e+o,t),new pt(c,u-l),new pt(c,u));case gn.BOTTOM_RIGHT:return new aS(new pt(c,t),new pt(c,t+l),new pt(e+o,u),new pt(e,u));case gn.BOTTOM_LEFT:default:return new aS(new pt(c,u),new pt(c-o,u),new pt(e,t+l),new pt(e,t))}},A5=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},Gxt=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},f5=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},Kxt=function(){function e(t,r,n){this.offsetX=t,this.offsetY=r,this.matrix=n,this.type=0,this.target=6}return e}(),oS=function(){function e(t,r){this.path=t,this.target=r,this.type=1}return e}(),Vxt=function(){function e(t){this.opacity=t,this.type=2,this.target=6}return e}(),qxt=function(e){return e.type===0},Wme=function(e){return e.type===1},Xxt=function(e){return e.type===2},oY=function(e,t){return e.length===t.length?e.some(function(r,n){return r===t[n]}):!1},Yxt=function(e,t,r,n,i){return e.map(function(s,o){switch(o){case 0:return s.add(t,r);case 1:return s.add(t+n,r);case 2:return s.add(t+n,r+i);case 3:return s.add(t,r+i)}return s})},Gme=function(){function e(t){this.element=t,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),Kme=function(){function e(t,r){if(this.container=t,this.parent=r,this.effects=[],this.curves=new Wxt(this.container),this.container.styles.opacity<1&&this.effects.push(new Vxt(this.container.styles.opacity)),this.container.styles.transform!==null){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,i=this.container.bounds.top+this.container.styles.transformOrigin[1].number,s=this.container.styles.transform;this.effects.push(new Kxt(n,i,s))}if(this.container.styles.overflowX!==0){var o=A5(this.curves),l=f5(this.curves);oY(o,l)?this.effects.push(new oS(o,6)):(this.effects.push(new oS(o,2)),this.effects.push(new oS(l,4)))}}return e.prototype.getEffects=function(t){for(var r=[2,3].indexOf(this.container.styles.position)===-1,n=this.parent,i=this.effects.slice(0);n;){var s=n.effects.filter(function(c){return!Wme(c)});if(r||n.container.styles.position!==0||!n.parent){if(i.unshift.apply(i,s),r=[2,3].indexOf(n.container.styles.position)===-1,n.container.styles.overflowX!==0){var o=A5(n.curves),l=f5(n.curves);oY(o,l)||i.unshift(new oS(l,6))}}else i.unshift.apply(i,s);n=n.parent}return i.filter(function(c){return _s(c.target,t)})},e}(),zD=function(e,t,r,n){e.container.elements.forEach(function(i){var s=_s(i.flags,4),o=_s(i.flags,2),l=new Kme(i,e);_s(i.styles.display,2048)&&n.push(l);var c=_s(i.flags,8)?[]:n;if(s||o){var u=s||i.styles.isPositioned()?r:t,d=new Gme(l);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var A=i.styles.zIndex.order;if(A<0){var h=0;u.negativeZIndex.some(function(m,p){return A>m.element.container.styles.zIndex.order?(h=p,!1):h>0}),u.negativeZIndex.splice(h,0,d)}else if(A>0){var f=0;u.positiveZIndex.some(function(m,p){return A>=m.element.container.styles.zIndex.order?(f=p+1,!1):f>0}),u.positiveZIndex.splice(f,0,d)}else u.zeroOrAutoZIndexOrTransformedOrOpacity.push(d)}else i.styles.isFloating()?u.nonPositionedFloats.push(d):u.nonPositionedInlineLevel.push(d);zD(l,d,s?d:r,c)}else i.styles.isInlineLevel()?t.inlineLevel.push(l):t.nonInlineLevel.push(l),zD(l,t,r,c);_s(i.flags,8)&&Vme(i,c)})},Vme=function(e,t){for(var r=e instanceof RD?e.start:1,n=e instanceof RD?e.reversed:!1,i=0;i"u"?e[0]:r},syt=function(e,t,r,n,i){var s=t[0],o=t[1],l=r[0],c=r[1];switch(e){case 2:return[new pt(Math.round(n.left),Math.round(n.top+o)),new pt(Math.round(n.left+n.width),Math.round(n.top+o)),new pt(Math.round(n.left+n.width),Math.round(c+n.top+o)),new pt(Math.round(n.left),Math.round(c+n.top+o))];case 3:return[new pt(Math.round(n.left+s),Math.round(n.top)),new pt(Math.round(n.left+s+l),Math.round(n.top)),new pt(Math.round(n.left+s+l),Math.round(n.height+n.top)),new pt(Math.round(n.left+s),Math.round(n.height+n.top))];case 1:return[new pt(Math.round(n.left+s),Math.round(n.top+o)),new pt(Math.round(n.left+s+l),Math.round(n.top+o)),new pt(Math.round(n.left+s+l),Math.round(n.top+o+c)),new pt(Math.round(n.left+s),Math.round(n.top+o+c))];default:return[new pt(Math.round(i.left),Math.round(i.top)),new pt(Math.round(i.left+i.width),Math.round(i.top)),new pt(Math.round(i.left+i.width),Math.round(i.height+i.top)),new pt(Math.round(i.left),Math.round(i.height+i.top))]}},ayt="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",cY="Hidden Text",oyt=function(){function e(t){this._data={},this._document=t}return e.prototype.parseMetrics=function(t,r){var n=this._document.createElement("div"),i=this._document.createElement("img"),s=this._document.createElement("span"),o=this._document.body;n.style.visibility="hidden",n.style.fontFamily=t,n.style.fontSize=r,n.style.margin="0",n.style.padding="0",n.style.whiteSpace="nowrap",o.appendChild(n),i.src=ayt,i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",s.style.fontFamily=t,s.style.fontSize=r,s.style.margin="0",s.style.padding="0",s.appendChild(this._document.createTextNode(cY)),n.appendChild(s),n.appendChild(i);var l=i.offsetTop-s.offsetTop+2;n.removeChild(s),n.appendChild(this._document.createTextNode(cY)),n.style.lineHeight="normal",i.style.verticalAlign="super";var c=i.offsetTop-n.offsetTop+2;return o.removeChild(n),{baseline:l,middle:c}},e.prototype.getMetrics=function(t,r){var n=t+" "+r;return typeof this._data[n]>"u"&&(this._data[n]=this.parseMetrics(t,r)),this._data[n]},e}(),Xme=function(){function e(t,r){this.context=t,this.options=r}return e}(),lyt=1e4,cyt=function(e){Au(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i._activeEffects=[],i.canvas=n.canvas?n.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),n.canvas||(i.canvas.width=Math.floor(n.width*n.scale),i.canvas.height=Math.floor(n.height*n.scale),i.canvas.style.width=n.width+"px",i.canvas.style.height=n.height+"px"),i.fontMetrics=new oyt(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-n.x,-n.y),i.ctx.textBaseline="bottom",i._activeEffects=[],i.context.logger.debug("Canvas renderer initialized ("+n.width+"x"+n.height+") with scale "+n.scale),i}return t.prototype.applyEffects=function(r){for(var n=this;this._activeEffects.length;)this.popEffect();r.forEach(function(i){return n.applyEffect(i)})},t.prototype.applyEffect=function(r){this.ctx.save(),Xxt(r)&&(this.ctx.globalAlpha=r.opacity),qxt(r)&&(this.ctx.translate(r.offsetX,r.offsetY),this.ctx.transform(r.matrix[0],r.matrix[1],r.matrix[2],r.matrix[3],r.matrix[4],r.matrix[5]),this.ctx.translate(-r.offsetX,-r.offsetY)),Wme(r)&&(this.path(r.path),this.ctx.clip()),this._activeEffects.push(r)},t.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},t.prototype.renderStack=function(r){return Ya(this,void 0,void 0,function(){var n;return ka(this,function(i){switch(i.label){case 0:return n=r.element.container.styles,n.isVisible()?[4,this.renderStackContent(r)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},t.prototype.renderNode=function(r){return Ya(this,void 0,void 0,function(){return ka(this,function(n){switch(n.label){case 0:if(_s(r.container.flags,16))debugger;return r.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(r)]:[3,3];case 1:return n.sent(),[4,this.renderNodeContent(r)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},t.prototype.renderTextWithLetterSpacing=function(r,n,i){var s=this;if(n===0)this.ctx.fillText(r.text,r.bounds.left,r.bounds.top+i);else{var o=c7(r.text);o.reduce(function(l,c){return s.ctx.fillText(c,l,r.bounds.top+i),l+s.ctx.measureText(c).width},r.bounds.left)}},t.prototype.createFontStyle=function(r){var n=r.fontVariant.filter(function(o){return o==="normal"||o==="small-caps"}).join(""),i=hyt(r.fontFamily).join(", "),s=eN(r.fontSize)?""+r.fontSize.number+r.fontSize.unit:r.fontSize.number+"px";return[[r.fontStyle,n,r.fontWeight,s,i].join(" "),i,s]},t.prototype.renderTextNode=function(r,n){return Ya(this,void 0,void 0,function(){var i,s,o,l,c,u,d,A,h=this;return ka(this,function(f){return i=this.createFontStyle(n),s=i[0],o=i[1],l=i[2],this.ctx.font=s,this.ctx.direction=n.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",c=this.fontMetrics.getMetrics(o,l),u=c.baseline,d=c.middle,A=n.paintOrder,r.textBounds.forEach(function(m){A.forEach(function(p){switch(p){case 0:h.ctx.fillStyle=Os(n.color),h.renderTextWithLetterSpacing(m,n.letterSpacing,u);var g=n.textShadow;g.length&&m.text.trim().length&&(g.slice(0).reverse().forEach(function(v){h.ctx.shadowColor=Os(v.color),h.ctx.shadowOffsetX=v.offsetX.number*h.options.scale,h.ctx.shadowOffsetY=v.offsetY.number*h.options.scale,h.ctx.shadowBlur=v.blur.number,h.renderTextWithLetterSpacing(m,n.letterSpacing,u)}),h.ctx.shadowColor="",h.ctx.shadowOffsetX=0,h.ctx.shadowOffsetY=0,h.ctx.shadowBlur=0),n.textDecorationLine.length&&(h.ctx.fillStyle=Os(n.textDecorationColor||n.color),n.textDecorationLine.forEach(function(v){switch(v){case 1:h.ctx.fillRect(m.bounds.left,Math.round(m.bounds.top+u),m.bounds.width,1);break;case 2:h.ctx.fillRect(m.bounds.left,Math.round(m.bounds.top),m.bounds.width,1);break;case 3:h.ctx.fillRect(m.bounds.left,Math.ceil(m.bounds.top+d),m.bounds.width,1);break}}));break;case 1:n.webkitTextStrokeWidth&&m.text.trim().length&&(h.ctx.strokeStyle=Os(n.webkitTextStrokeColor),h.ctx.lineWidth=n.webkitTextStrokeWidth,h.ctx.lineJoin=window.chrome?"miter":"round",h.ctx.strokeText(m.text,m.bounds.left,m.bounds.top+u)),h.ctx.strokeStyle="",h.ctx.lineWidth=0,h.ctx.lineJoin="miter";break}})}),[2]})})},t.prototype.renderReplacedElement=function(r,n,i){if(i&&r.intrinsicWidth>0&&r.intrinsicHeight>0){var s=h5(r),o=f5(n);this.path(o),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(i,0,0,r.intrinsicWidth,r.intrinsicHeight,s.left,s.top,s.width,s.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(r){return Ya(this,void 0,void 0,function(){var n,i,s,o,l,c,x,x,u,d,A,h,b,f,m,C,p,g,v,x,y,b,C;return ka(this,function(j){switch(j.label){case 0:this.applyEffects(r.getEffects(4)),n=r.container,i=r.curves,s=n.styles,o=0,l=n.textNodes,j.label=1;case 1:return o0&&_>0&&(T=s.ctx.createPattern(C,"repeat"),s.renderRepeat(I,T,G,U))):Xmt(d)&&(B=N3(r,n,[null,null,null]),I=B[0],P=B[1],E=B[2],M=B[3],_=B[4],R=d.position.length===0?[a7]:d.position,G=Wn(R[0],M),U=Wn(R[R.length-1],_),Q=Wmt(d,G,U,M,_),z=Q[0],Y=Q[1],z>0&&Y>0&&($=s.ctx.createRadialGradient(P+G,E+U,0,P+G,E+U,z),TX(d.stops,z*2).forEach(function(oe){return $.addColorStop(oe.stop,Os(oe.color))}),s.path(I),s.ctx.fillStyle=$,z!==Y?(O=r.bounds.left+.5*r.bounds.width,W=r.bounds.top+.5*r.bounds.height,V=Y/z,X=1/V,s.ctx.save(),s.ctx.translate(O,W),s.ctx.transform(1,0,0,V,0,0),s.ctx.translate(-O,-W),s.ctx.fillRect(P,X*(E-W)+W,M,_*X),s.ctx.restore()):s.ctx.fill())),ne.label=6;case 6:return n--,[2]}})},s=this,o=0,l=r.styles.backgroundImage.slice(0).reverse(),u.label=1;case 1:return o0?d.style!==2?[3,5]:[4,this.renderDashedDottedBorder(d.color,d.width,l,r.curves,2)]:[3,11]):[3,13];case 4:return h.sent(),[3,11];case 5:return d.style!==3?[3,7]:[4,this.renderDashedDottedBorder(d.color,d.width,l,r.curves,3)];case 6:return h.sent(),[3,11];case 7:return d.style!==4?[3,9]:[4,this.renderDoubleBorder(d.color,d.width,l,r.curves)];case 8:return h.sent(),[3,11];case 9:return[4,this.renderSolidBorder(d.color,l,r.curves)];case 10:h.sent(),h.label=11;case 11:l++,h.label=12;case 12:return c++,[3,3];case 13:return[2]}})})},t.prototype.renderDashedDottedBorder=function(r,n,i,s,o){return Ya(this,void 0,void 0,function(){var l,c,u,d,A,h,f,m,p,g,v,x,y,b,C,j,C,j;return ka(this,function(S){return this.ctx.save(),l=tyt(s,i),c=lY(s,i),o===2&&(this.path(c),this.ctx.clip()),ql(c[0])?(u=c[0].start.x,d=c[0].start.y):(u=c[0].x,d=c[0].y),ql(c[1])?(A=c[1].end.x,h=c[1].end.y):(A=c[1].x,h=c[1].y),i===0||i===2?f=Math.abs(u-A):f=Math.abs(d-h),this.ctx.beginPath(),o===3?this.formatPath(l):this.formatPath(c.slice(0,2)),m=n<3?n*3:n*2,p=n<3?n*2:n,o===3&&(m=n,p=n),g=!0,f<=m*2?g=!1:f<=m*2+p?(v=f/(2*m+p),m*=v,p*=v):(x=Math.floor((f+p)/(m+p)),y=(f-x*m)/(x-1),b=(f-(x+1)*m)/x,p=b<=0||Math.abs(p-y)>1|(ii&21845)<<1;mf=(mf&52428)>>2|(mf&13107)<<2,mf=(mf&61680)>>4|(mf&3855)<<4,GD[ii]=((mf&65280)>>8|(mf&255)<<8)>>1}var f1=function(e,t,r){for(var n=e.length,i=0,s=new fl(t);i>c]=u}else for(l=new fl(n),i=0;i>15-e[i]);return l},wg=new lu(288);for(var ii=0;ii<144;++ii)wg[ii]=8;for(var ii=144;ii<256;++ii)wg[ii]=9;for(var ii=256;ii<280;++ii)wg[ii]=7;for(var ii=280;ii<288;++ii)wg[ii]=8;var p5=new lu(32);for(var ii=0;ii<32;++ii)p5[ii]=5;var Nyt=f1(wg,9,0),jyt=f1(p5,5,0),Zme=function(e){return(e+7)/8|0},Syt=function(e,t,r){return(r==null||r>e.length)&&(r=e.length),new lu(e.subarray(t,r))},Vd=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},tw=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},j3=function(e,t){for(var r=[],n=0;nh&&(h=s[n].s);var f=new fl(h+1),m=KD(r[d-1],f,0);if(m>t){var n=0,p=0,g=m-t,v=1<t)p+=v-(1<>=g;p>0;){var y=s[n].s;f[y]=0&&p;--n){var b=s[n].s;f[b]==t&&(--f[b],++p)}m=t}return{t:new lu(f),l:m}},KD=function(e,t,r){return e.s==-1?Math.max(KD(e.l,t,r+1),KD(e.r,t,r+1)):t[e.s]=r},AY=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new fl(++t),n=0,i=e[0],s=1,o=function(c){r[n++]=c},l=1;l<=t;++l)if(e[l]==i&&l!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[l]}return{c:r.subarray(0,n),n:t}},rw=function(e,t){for(var r=0,n=0;n>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var s=0;s4&&!I[uY[E-1]];--E);var M=u+5<<3,_=rw(i,wg)+rw(s,p5)+o,R=rw(i,h)+rw(s,p)+o+14+3*E+rw(S,I)+2*S[16]+3*S[17]+7*S[18];if(c>=0&&M<=_&&M<=R)return ege(t,d,e.subarray(c,c+u));var G,U,Q,z;if(Vd(t,d,1+(R<_)),d+=2,R<_){G=f1(h,f,0),U=h,Q=f1(p,g,0),z=p;var Y=f1(I,P,0);Vd(t,d,y-257),Vd(t,d+5,j-1),Vd(t,d+10,E-4),d+=14;for(var T=0;T15&&(Vd(t,d,W[T]>>5&127),d+=W[T]>>12)}}else G=Nyt,U=wg,Q=jyt,z=p5;for(var T=0;T255){var V=X>>18&31;tw(t,d,G[V+257]),d+=U[V+257],V>7&&(Vd(t,d,X>>23&31),d+=f7[V]);var ne=X&31;tw(t,d,Q[ne]),d+=z[ne],ne>3&&(tw(t,d,X>>5&8191),d+=h7[ne])}else tw(t,d,G[X]),d+=U[X]}return tw(t,d,G[256]),d+U[256]},Byt=new A7([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),tge=new lu(0),_yt=function(e,t,r,n,i,s){var o=s.z||e.length,l=new lu(n+o+5*(1+Math.ceil(o/7e3))+i),c=l.subarray(n,l.length-i),u=s.l,d=(s.r||0)&7;if(t){d&&(c[0]=s.r>>3);for(var A=Byt[t-1],h=A>>13,f=A&8191,m=(1<7e3||I>24576)&&(G>423||!u)){d=fY(e,c,0,b,C,j,T,I,E,B-E,d),I=S=T=0,E=B;for(var U=0;U<286;++U)C[U]=0;for(var U=0;U<30;++U)j[U]=0}var Q=2,z=0,Y=f,$=_-R&32767;if(G>2&&M==y(B-$))for(var O=Math.min(h,G)-1,W=Math.min(32767,B),V=Math.min(258,G);$<=W&&--Y&&_!=R;){if(e[B+Q]==e[B+Q-$]){for(var X=0;XQ){if(Q=X,z=$,X>O)break;for(var ne=Math.min($,X-2),oe=0,U=0;Uoe&&(oe=ge,R=pe)}}}_=R,R=p[_],$+=_-R&32767}if(z){b[I++]=268435456|WD[Q]<<18|dY[z];var ie=WD[Q]&31,ue=dY[z]&31;T+=f7[ie]+h7[ue],++C[257+ie],++j[ue],P=B+Q,++S}else b[I++]=e[B],++C[e[B]]}}for(B=Math.max(B,P);B=o&&(c[d/8|0]=u,Se=o),d=ege(c,d+1,e.subarray(B,Se))}s.i=o}return Syt(l,0,n+Zme(d)+i)},rge=function(){var e=1,t=0;return{p:function(r){for(var n=e,i=t,s=r.length|0,o=0;o!=s;){for(var l=Math.min(o+2655,s);o>16),i=(i&65535)+15*(i>>16)}e=n,t=i},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},kyt=function(e,t,r,n,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),o=new lu(s.length+e.length);o.set(s),o.set(e,s.length),e=o,i.w=s.length}return _yt(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,i)},nge=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Eyt=function(e,t){var r=t.level,n=r==0?0:r<6?1:r==9?3:2;if(e[0]=120,e[1]=n<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=rge();i.p(t.dictionary),nge(e,2,i.d())}};function VD(e,t){t||(t={});var r=rge();r.p(e);var n=kyt(e,t,t.dictionary?6:2,4);return Eyt(n,t),nge(n,n.length-4,r.d()),n}var Tyt=typeof TextDecoder<"u"&&new TextDecoder,Pyt=0;try{Tyt.decode(tge,{stream:!0}),Pyt=1}catch{}function Iyt(e){if(Array.isArray(e))return e}function Oyt(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function hY(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{const e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),S3={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class p7{constructor(t=Ryt,r={}){Rr(this,"buffer");Rr(this,"byteLength");Rr(this,"byteOffset");Rr(this,"length");Rr(this,"offset");Rr(this,"lastWrittenByte");Rr(this,"littleEndian");Rr(this,"_data");Rr(this,"_mark");Rr(this,"_marks");let n=!1;typeof t=="number"?t=new ArrayBuffer(t):(n=!0,this.lastWrittenByte=t.byteLength);const i=r.offset?r.offset>>>0:0,s=t.byteLength-i;let o=i;(ArrayBuffer.isView(t)||t instanceof p7)&&(t.byteLength!==t.buffer.byteLength&&(o=t.byteOffset+i),t=t.buffer),n?this.lastWrittenByte=s:this.lastWrittenByte=0,this.buffer=t,this.length=s,this.byteLength=s,this.byteOffset=o,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,o,s),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}back(t=1){return this.offset-=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const t=this._marks.pop();if(t===void 0)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){const n=(this.offset+t)*2,i=new Uint8Array(n);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=n,this.byteLength=n,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t=1){return this.readArray(t,"uint8")}readArray(t,r){const n=S3[r].BYTES_PER_ELEMENT*t,i=this.byteOffset+this.offset,s=this.buffer.slice(i,i+n);if(this.littleEndian===Uyt&&r!=="uint8"&&r!=="int8"){const l=new Uint8Array(this.buffer.slice(i,i+n));l.reverse();const c=new S3[r](l.buffer);return this.offset+=n,c.reverse(),c}const o=new S3[r](s);return this.offset+=n,o}readInt16(){const t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){const t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){const t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){const t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){const t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){const t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readBigInt64(){const t=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,t}readBigUint64(){const t=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let r="";for(let n=0;nthis.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Qyt=4,gY=0,vY=1,Hyt=2;function eb(e){let t=e.length;for(;--t>=0;)e[t]=0}const $yt=0,ige=1,zyt=2,Wyt=3,Gyt=258,m7=29,tN=256,Y2=tN+1+m7,Kx=30,g7=19,sge=2*Y2+1,pm=15,B3=16,Kyt=7,v7=256,age=16,oge=17,lge=18,qD=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),iB=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Vyt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),cge=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),qyt=512,sA=new Array((Y2+2)*2);eb(sA);const h1=new Array(Kx*2);eb(h1);const J2=new Array(qyt);eb(J2);const Z2=new Array(Gyt-Wyt+1);eb(Z2);const x7=new Array(m7);eb(x7);const m5=new Array(Kx);eb(m5);function _3(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let uge,dge,Age;function k3(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const fge=e=>e<256?J2[e]:J2[256+(e>>>7)],eC=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},Oo=(e,t,r)=>{e.bi_valid>B3-r?(e.bi_buf|=t<>B3-e.bi_valid,e.bi_valid+=r-B3):(e.bi_buf|=t<{Oo(e,r[t*2],r[t*2+1])},hge=(e,t)=>{let r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1},Xyt=e=>{e.bi_valid===16?(eC(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Yyt=(e,t)=>{const r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,s=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,c=t.stat_desc.max_length;let u,d,A,h,f,m,p=0;for(h=0;h<=pm;h++)e.bl_count[h]=0;for(r[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;uc&&(h=c,p++),r[d*2+1]=h,!(d>n)&&(e.bl_count[h]++,f=0,d>=l&&(f=o[d-l]),m=r[d*2],e.opt_len+=m*(h+f),s&&(e.static_len+=m*(i[d*2+1]+f)));if(p!==0){do{for(h=c-1;e.bl_count[h]===0;)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[c]--,p-=2}while(p>0);for(h=c;h!==0;h--)for(d=e.bl_count[h];d!==0;)A=e.heap[--u],!(A>n)&&(r[A*2+1]!==h&&(e.opt_len+=(h-r[A*2+1])*r[A*2],r[A*2+1]=h),d--)}},pge=(e,t,r)=>{const n=new Array(pm+1);let i=0,s,o;for(s=1;s<=pm;s++)i=i+r[s-1]<<1,n[s]=i;for(o=0;o<=t;o++){let l=e[o*2+1];l!==0&&(e[o*2]=hge(n[l]++,l))}},Jyt=()=>{let e,t,r,n,i;const s=new Array(pm+1);for(r=0,n=0;n>=7;n{let t;for(t=0;t{e.bi_valid>8?eC(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},xY=(e,t,r,n)=>{const i=t*2,s=r*2;return e[i]{const n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i{let n,i,s=0,o,l;if(e.sym_next!==0)do n=e.pending_buf[e.sym_buf+s++]&255,n+=(e.pending_buf[e.sym_buf+s++]&255)<<8,i=e.pending_buf[e.sym_buf+s++],n===0?Ru(e,i,t):(o=Z2[i],Ru(e,o+tN+1,t),l=qD[o],l!==0&&(i-=x7[o],Oo(e,i,l)),n--,o=fge(n),Ru(e,o,r),l=iB[o],l!==0&&(n-=m5[o],Oo(e,n,l)));while(s{const r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,s=t.stat_desc.elems;let o,l,c=-1,u;for(e.heap_len=0,e.heap_max=sge,o=0;o>1;o>=1;o--)E3(e,r,o);u=s;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],E3(e,r,1),l=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=l,r[u*2]=r[o*2]+r[l*2],e.depth[u]=(e.depth[o]>=e.depth[l]?e.depth[o]:e.depth[l])+1,r[o*2+1]=r[l*2+1]=u,e.heap[1]=u++,E3(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Yyt(e,t),pge(r,c,e.bl_count)},bY=(e,t,r)=>{let n,i=-1,s,o=t[0*2+1],l=0,c=7,u=4;for(o===0&&(c=138,u=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)s=o,o=t[(n+1)*2+1],!(++l{let n,i=-1,s,o=t[0*2+1],l=0,c=7,u=4;for(o===0&&(c=138,u=3),n=0;n<=r;n++)if(s=o,o=t[(n+1)*2+1],!(++l{let t;for(bY(e,e.dyn_ltree,e.l_desc.max_code),bY(e,e.dyn_dtree,e.d_desc.max_code),XD(e,e.bl_desc),t=g7-1;t>=3&&e.bl_tree[cge[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},e0t=(e,t,r,n)=>{let i;for(Oo(e,t-257,5),Oo(e,r-1,5),Oo(e,n-4,4),i=0;i{let t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return gY;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return vY;for(r=32;r{CY||(Jyt(),CY=!0),e.l_desc=new k3(e.dyn_ltree,uge),e.d_desc=new k3(e.dyn_dtree,dge),e.bl_desc=new k3(e.bl_tree,Age),e.bi_buf=0,e.bi_valid=0,mge(e)},vge=(e,t,r,n)=>{Oo(e,($yt<<1)+(n?1:0),3),gge(e),eC(e,r),eC(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r},n0t=e=>{Oo(e,ige<<1,3),Ru(e,v7,sA),Xyt(e)},i0t=(e,t,r,n)=>{let i,s,o=0;e.level>0?(e.strm.data_type===Hyt&&(e.strm.data_type=t0t(e)),XD(e,e.l_desc),XD(e,e.d_desc),o=Zyt(e),i=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=i&&(i=s)):i=s=r+5,r+4<=i&&t!==-1?vge(e,t,r,n):e.strategy===Qyt||s===i?(Oo(e,(ige<<1)+(n?1:0),3),yY(e,sA,h1)):(Oo(e,(zyt<<1)+(n?1:0),3),e0t(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),yY(e,e.dyn_ltree,e.dyn_dtree)),mge(e),n&&gge(e)},s0t=(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(Z2[r]+tN+1)*2]++,e.dyn_dtree[fge(t)*2]++),e.sym_next===e.sym_end);var a0t=r0t,o0t=vge,l0t=i0t,c0t=s0t,u0t=n0t,d0t={_tr_init:a0t,_tr_stored_block:o0t,_tr_flush_block:l0t,_tr_tally:c0t,_tr_align:u0t};const A0t=(e,t,r,n)=>{let i=e&65535|0,s=e>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+t[n++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16|0};var tC=A0t;const f0t=()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t},h0t=new Uint32Array(f0t()),p0t=(e,t,r,n)=>{const i=h0t,s=n+r;e^=-1;for(let o=n;o>>8^i[(e^t[o])&255];return e^-1};var Fs=p0t,A0={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},rN={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:m0t,_tr_stored_block:YD,_tr_flush_block:g0t,_tr_tally:Ph,_tr_align:v0t}=d0t,{Z_NO_FLUSH:Ih,Z_PARTIAL_FLUSH:x0t,Z_FULL_FLUSH:y0t,Z_FINISH:Zl,Z_BLOCK:NY,Z_OK:ia,Z_STREAM_END:jY,Z_STREAM_ERROR:ed,Z_DATA_ERROR:b0t,Z_BUF_ERROR:T3,Z_DEFAULT_COMPRESSION:w0t,Z_FILTERED:C0t,Z_HUFFMAN_ONLY:uS,Z_RLE:N0t,Z_FIXED:j0t,Z_DEFAULT_STRATEGY:S0t,Z_UNKNOWN:B0t,Z_DEFLATED:Y4}=rN,_0t=9,k0t=15,E0t=8,T0t=29,P0t=256,JD=P0t+1+T0t,I0t=30,O0t=19,F0t=2*JD+1,L0t=15,Jr=3,uh=258,td=uh+Jr+1,M0t=32,f0=42,y7=57,ZD=69,eR=73,tR=91,rR=103,mm=113,Bw=666,ao=1,tb=2,Cg=3,rb=4,D0t=3,gm=(e,t)=>(e.msg=A0[t],t),SY=e=>e*2-(e>4?9:0),Uf=e=>{let t=e.length;for(;--t>=0;)e[t]=0},R0t=e=>{let t,r,n,i=e.w_size;t=e.hash_size,n=t;do r=e.head[--n],e.head[n]=r>=i?r-i:0;while(--t);t=i,n=t;do r=e.prev[--n],e.prev[n]=r>=i?r-i:0;while(--t)};let U0t=(e,t,r)=>(t<{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))},hl=(e,t)=>{g0t(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,nl(e.strm)},hn=(e,t)=>{e.pending_buf[e.pending++]=t},nw=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},nR=(e,t,r,n)=>{let i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),e.state.wrap===1?e.adler=tC(e.adler,t,i,r):e.state.wrap===2&&(e.adler=Fs(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},xge=(e,t)=>{let r=e.max_chain_length,n=e.strstart,i,s,o=e.prev_length,l=e.nice_match;const c=e.strstart>e.w_size-td?e.strstart-(e.w_size-td):0,u=e.window,d=e.w_mask,A=e.prev,h=e.strstart+uh;let f=u[n+o-1],m=u[n+o];e.prev_length>=e.good_match&&(r>>=2),l>e.lookahead&&(l=e.lookahead);do if(i=t,!(u[i+o]!==m||u[i+o-1]!==f||u[i]!==u[n]||u[++i]!==u[n+1])){n+=2,i++;do;while(u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&no){if(e.match_start=t,o=s,s>=l)break;f=u[n+o-1],m=u[n+o]}}while((t=A[t&d])>c&&--r!==0);return o<=e.lookahead?o:e.lookahead},h0=e=>{const t=e.w_size;let r,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-td)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),R0t(e),n+=t),e.strm.avail_in===0)break;if(r=nR(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,e.lookahead+e.insert>=Jr)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Oh(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Oh(e,e.ins_h,e.window[i+Jr-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert{let r=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,n,i,s,o=0,l=e.strm.avail_in;do{if(n=65535,s=e.bi_valid+42>>3,e.strm.avail_outi+e.strm.avail_in&&(n=i+e.strm.avail_in),n>s&&(n=s),n>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,nl(e.strm),i&&(i>n&&(i=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,n-=i),n&&(nR(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(o===0);return l-=e.strm.avail_in,l&&(l>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=l&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-l,e.strm.next_in),e.strstart),e.strstart+=l,e.insert+=l>e.w_size-e.insert?e.w_size-e.insert:l),e.block_start=e.strstart),e.high_waters&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,s+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),s>e.strm.avail_in&&(s=e.strm.avail_in),s&&(nR(e.strm,e.window,e.strstart,s),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.high_water>3,s=e.pending_buf_size-s>65535?65535:e.pending_buf_size-s,r=s>e.w_size?e.w_size:s,i=e.strstart-e.block_start,(i>=r||(i||t===Zl)&&t!==Ih&&e.strm.avail_in===0&&i<=s)&&(n=i>s?s:i,o=t===Zl&&e.strm.avail_in===0&&n===i?1:0,YD(e,e.block_start,n,o),e.block_start+=n,nl(e.strm)),o?Cg:ao)},P3=(e,t)=>{let r,n;for(;;){if(e.lookahead=Jr&&(e.ins_h=Oh(e,e.ins_h,e.window[e.strstart+Jr-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-td&&(e.match_length=xge(e,r)),e.match_length>=Jr)if(n=Ph(e,e.strstart-e.match_start,e.match_length-Jr),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Jr){e.match_length--;do e.strstart++,e.ins_h=Oh(e,e.ins_h,e.window[e.strstart+Jr-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Oh(e,e.ins_h,e.window[e.strstart+1]);else n=Ph(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(hl(e,!1),e.strm.avail_out===0))return ao}return e.insert=e.strstart{let r,n,i;for(;;){if(e.lookahead=Jr&&(e.ins_h=Oh(e,e.ins_h,e.window[e.strstart+Jr-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Jr-1,r!==0&&e.prev_length4096)&&(e.match_length=Jr-1)),e.prev_length>=Jr&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-Jr,n=Ph(e,e.strstart-1-e.prev_match,e.prev_length-Jr),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=Oh(e,e.ins_h,e.window[e.strstart+Jr-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=Jr-1,e.strstart++,n&&(hl(e,!1),e.strm.avail_out===0))return ao}else if(e.match_available){if(n=Ph(e,0,e.window[e.strstart-1]),n&&hl(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return ao}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Ph(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart{let r,n,i,s;const o=e.window;for(;;){if(e.lookahead<=uh){if(h0(e),e.lookahead<=uh&&t===Ih)return ao;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Jr&&e.strstart>0&&(i=e.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){s=e.strstart+uh;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Jr?(r=Ph(e,1,e.match_length-Jr),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Ph(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(hl(e,!1),e.strm.avail_out===0))return ao}return e.insert=0,t===Zl?(hl(e,!0),e.strm.avail_out===0?Cg:rb):e.sym_next&&(hl(e,!1),e.strm.avail_out===0)?ao:tb},H0t=(e,t)=>{let r;for(;;){if(e.lookahead===0&&(h0(e),e.lookahead===0)){if(t===Ih)return ao;break}if(e.match_length=0,r=Ph(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(hl(e,!1),e.strm.avail_out===0))return ao}return e.insert=0,t===Zl?(hl(e,!0),e.strm.avail_out===0?Cg:rb):e.sym_next&&(hl(e,!1),e.strm.avail_out===0)?ao:tb};function ju(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}const _w=[new ju(0,0,0,0,yge),new ju(4,4,8,4,P3),new ju(4,5,16,8,P3),new ju(4,6,32,32,P3),new ju(4,4,16,16,Fv),new ju(8,16,32,32,Fv),new ju(8,16,128,128,Fv),new ju(8,32,128,256,Fv),new ju(32,128,258,1024,Fv),new ju(32,258,258,4096,Fv)],$0t=e=>{e.window_size=2*e.w_size,Uf(e.head),e.max_lazy_match=_w[e.level].max_lazy,e.good_match=_w[e.level].good_length,e.nice_match=_w[e.level].nice_length,e.max_chain_length=_w[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Jr-1,e.match_available=0,e.ins_h=0};function z0t(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Y4,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(F0t*2),this.dyn_dtree=new Uint16Array((2*I0t+1)*2),this.bl_tree=new Uint16Array((2*O0t+1)*2),Uf(this.dyn_ltree),Uf(this.dyn_dtree),Uf(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(L0t+1),this.heap=new Uint16Array(2*JD+1),Uf(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*JD+1),Uf(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const nN=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==f0&&t.status!==y7&&t.status!==ZD&&t.status!==eR&&t.status!==tR&&t.status!==rR&&t.status!==mm&&t.status!==Bw?1:0},bge=e=>{if(nN(e))return gm(e,ed);e.total_in=e.total_out=0,e.data_type=B0t;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?y7:t.wrap?f0:mm,e.adler=t.wrap===2?0:1,t.last_flush=-2,m0t(t),ia},wge=e=>{const t=bge(e);return t===ia&&$0t(e.state),t},W0t=(e,t)=>nN(e)||e.state.wrap!==2?ed:(e.state.gzhead=t,ia),Cge=(e,t,r,n,i,s)=>{if(!e)return ed;let o=1;if(t===w0t&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>_0t||r!==Y4||n<8||n>15||t<0||t>9||s<0||s>j0t||n===8&&o!==1)return gm(e,ed);n===8&&(n=9);const l=new z0t;return e.state=l,l.strm=e,l.status=f0,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<Cge(e,t,Y4,k0t,E0t,S0t),K0t=(e,t)=>{if(nN(e)||t>NY||t<0)return e?gm(e,ed):ed;const r=e.state;if(!e.output||e.avail_in!==0&&!e.input||r.status===Bw&&t!==Zl)return gm(e,e.avail_out===0?T3:ed);const n=r.last_flush;if(r.last_flush=t,r.pending!==0){if(nl(e),e.avail_out===0)return r.last_flush=-1,ia}else if(e.avail_in===0&&SY(t)<=SY(n)&&t!==Zl)return gm(e,T3);if(r.status===Bw&&e.avail_in!==0)return gm(e,T3);if(r.status===f0&&r.wrap===0&&(r.status=mm),r.status===f0){let i=Y4+(r.w_bits-8<<4)<<8,s=-1;if(r.strategy>=uS||r.level<2?s=0:r.level<6?s=1:r.level===6?s=2:s=3,i|=s<<6,r.strstart!==0&&(i|=M0t),i+=31-i%31,nw(r,i),r.strstart!==0&&(nw(r,e.adler>>>16),nw(r,e.adler&65535)),e.adler=1,r.status=mm,nl(e),r.pending!==0)return r.last_flush=-1,ia}if(r.status===y7){if(e.adler=0,hn(r,31),hn(r,139),hn(r,8),r.gzhead)hn(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),hn(r,r.gzhead.time&255),hn(r,r.gzhead.time>>8&255),hn(r,r.gzhead.time>>16&255),hn(r,r.gzhead.time>>24&255),hn(r,r.level===9?2:r.strategy>=uS||r.level<2?4:0),hn(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(hn(r,r.gzhead.extra.length&255),hn(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=Fs(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=ZD;else if(hn(r,0),hn(r,0),hn(r,0),hn(r,0),hn(r,0),hn(r,r.level===9?2:r.strategy>=uS||r.level<2?4:0),hn(r,D0t),r.status=mm,nl(e),r.pending!==0)return r.last_flush=-1,ia}if(r.status===ZD){if(r.gzhead.extra){let i=r.pending,s=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+s>r.pending_buf_size;){let l=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+l),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>i&&(e.adler=Fs(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=l,nl(e),r.pending!==0)return r.last_flush=-1,ia;i=0,s-=l}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending+=s,r.gzhead.hcrc&&r.pending>i&&(e.adler=Fs(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=eR}if(r.status===eR){if(r.gzhead.name){let i=r.pending,s;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(e.adler=Fs(e.adler,r.pending_buf,r.pending-i,i)),nl(e),r.pending!==0)return r.last_flush=-1,ia;i=0}r.gzindexi&&(e.adler=Fs(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=tR}if(r.status===tR){if(r.gzhead.comment){let i=r.pending,s;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(e.adler=Fs(e.adler,r.pending_buf,r.pending-i,i)),nl(e),r.pending!==0)return r.last_flush=-1,ia;i=0}r.gzindexi&&(e.adler=Fs(e.adler,r.pending_buf,r.pending-i,i))}r.status=rR}if(r.status===rR){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(nl(e),r.pending!==0))return r.last_flush=-1,ia;hn(r,e.adler&255),hn(r,e.adler>>8&255),e.adler=0}if(r.status=mm,nl(e),r.pending!==0)return r.last_flush=-1,ia}if(e.avail_in!==0||r.lookahead!==0||t!==Ih&&r.status!==Bw){let i=r.level===0?yge(r,t):r.strategy===uS?H0t(r,t):r.strategy===N0t?Q0t(r,t):_w[r.level].func(r,t);if((i===Cg||i===rb)&&(r.status=Bw),i===ao||i===Cg)return e.avail_out===0&&(r.last_flush=-1),ia;if(i===tb&&(t===x0t?v0t(r):t!==NY&&(YD(r,0,0,!1),t===y0t&&(Uf(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),nl(e),e.avail_out===0))return r.last_flush=-1,ia}return t!==Zl?ia:r.wrap<=0?jY:(r.wrap===2?(hn(r,e.adler&255),hn(r,e.adler>>8&255),hn(r,e.adler>>16&255),hn(r,e.adler>>24&255),hn(r,e.total_in&255),hn(r,e.total_in>>8&255),hn(r,e.total_in>>16&255),hn(r,e.total_in>>24&255)):(nw(r,e.adler>>>16),nw(r,e.adler&65535)),nl(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?ia:jY)},V0t=e=>{if(nN(e))return ed;const t=e.state.status;return e.state=null,t===mm?gm(e,b0t):ia},q0t=(e,t)=>{let r=t.length;if(nN(e))return ed;const n=e.state,i=n.wrap;if(i===2||i===1&&n.status!==f0||n.lookahead)return ed;if(i===1&&(e.adler=tC(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){i===0&&(Uf(n.head),n.strstart=0,n.block_start=0,n.insert=0);let c=new Uint8Array(n.w_size);c.set(t.subarray(r-n.w_size,r),0),t=c,r=n.w_size}const s=e.avail_in,o=e.next_in,l=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,h0(n);n.lookahead>=Jr;){let c=n.strstart,u=n.lookahead-(Jr-1);do n.ins_h=Oh(n,n.ins_h,n.window[c+Jr-1]),n.prev[c&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=c,c++;while(--u);n.strstart=c,n.lookahead=Jr-1,h0(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=Jr-1,n.match_available=0,e.next_in=o,e.input=l,e.avail_in=s,n.wrap=i,ia};var X0t=G0t,Y0t=Cge,J0t=wge,Z0t=bge,ebt=W0t,tbt=K0t,rbt=V0t,nbt=q0t,ibt="pako deflate (from Nodeca project)",p1={deflateInit:X0t,deflateInit2:Y0t,deflateReset:J0t,deflateResetKeep:Z0t,deflateSetHeader:ebt,deflate:tbt,deflateEnd:rbt,deflateSetDictionary:nbt,deflateInfo:ibt};const sbt=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var abt=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(const n in r)sbt(r,n)&&(e[n]=r[n])}}return e},obt=e=>{let t=0;for(let n=0,i=e.length;n=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;rC[254]=rC[254]=1;var lbt=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,r,n,i,s,o=e.length,l=0;for(i=0;i>>6,t[s++]=128|r&63):r<65536?(t[s++]=224|r>>>12,t[s++]=128|r>>>6&63,t[s++]=128|r&63):(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63,t[s++]=128|r>>>6&63,t[s++]=128|r&63);return t};const cbt=(e,t)=>{if(t<65534&&e.subarray&&Nge)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n{const r=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let n,i;const s=new Array(r*2);for(i=0,n=0;n4){s[i++]=65533,n+=l-1;continue}for(o&=l===2?31:l===3?15:7;l>1&&n1){s[i++]=65533;continue}o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|o&1023)}return cbt(s,i)},dbt=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let r=t-1;for(;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+rC[e[r]]>t?r:t},nC={string2buf:lbt,buf2string:ubt,utf8border:dbt};function Abt(){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}var jge=Abt;const Sge=Object.prototype.toString,{Z_NO_FLUSH:fbt,Z_SYNC_FLUSH:hbt,Z_FULL_FLUSH:pbt,Z_FINISH:mbt,Z_OK:g5,Z_STREAM_END:gbt,Z_DEFAULT_COMPRESSION:vbt,Z_DEFAULT_STRATEGY:xbt,Z_DEFLATED:ybt}=rN;function b7(e){this.options=J4.assign({level:vbt,method:ybt,chunkSize:16384,windowBits:15,memLevel:8,strategy:xbt},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jge,this.strm.avail_out=0;let r=p1.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==g5)throw new Error(A0[r]);if(t.header&&p1.deflateSetHeader(this.strm,t.header),t.dictionary){let n;if(typeof t.dictionary=="string"?n=nC.string2buf(t.dictionary):Sge.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=p1.deflateSetDictionary(this.strm,n),r!==g5)throw new Error(A0[r]);this._dict_set=!0}}b7.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let i,s;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?mbt:fbt,typeof e=="string"?r.input=nC.string2buf(e):Sge.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(s===hbt||s===pbt)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=p1.deflate(r,s),i===gbt)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=p1.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===g5;if(r.avail_out===0){this.onData(r.output);continue}if(s>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};b7.prototype.onData=function(e){this.chunks.push(e)};b7.prototype.onEnd=function(e){e===g5&&(this.result=J4.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const dS=16209,bbt=16191;var wbt=function(t,r){let n,i,s,o,l,c,u,d,A,h,f,m,p,g,v,x,y,b,C,j,S,T,B,I;const P=t.state;n=t.next_in,B=t.input,i=n+(t.avail_in-5),s=t.next_out,I=t.output,o=s-(r-t.avail_out),l=s+(t.avail_out-257),c=P.dmax,u=P.wsize,d=P.whave,A=P.wnext,h=P.window,f=P.hold,m=P.bits,p=P.lencode,g=P.distcode,v=(1<>>24,f>>>=b,m-=b,b=y>>>16&255,b===0)I[s++]=y&65535;else if(b&16){C=y&65535,b&=15,b&&(m>>=b,m-=b),m<15&&(f+=B[n++]<>>24,f>>>=b,m-=b,b=y>>>16&255,b&16){if(j=y&65535,b&=15,mc){t.msg="invalid distance too far back",P.mode=dS;break e}if(f>>>=b,m-=b,b=s-o,j>b){if(b=j-b,b>d&&P.sane){t.msg="invalid distance too far back",P.mode=dS;break e}if(S=0,T=h,A===0){if(S+=u-b,b2;)I[s++]=T[S++],I[s++]=T[S++],I[s++]=T[S++],C-=3;C&&(I[s++]=T[S++],C>1&&(I[s++]=T[S++]))}else{S=s-j;do I[s++]=I[S++],I[s++]=I[S++],I[s++]=I[S++],C-=3;while(C>2);C&&(I[s++]=I[S++],C>1&&(I[s++]=I[S++]))}}else if(b&64){t.msg="invalid distance code",P.mode=dS;break e}else{y=g[(y&65535)+(f&(1<>3,n-=C,m-=C<<3,f&=(1<{const c=l.bits;let u=0,d=0,A=0,h=0,f=0,m=0,p=0,g=0,v=0,x=0,y,b,C,j,S,T=null,B;const I=new Uint16Array(Lv+1),P=new Uint16Array(Lv+1);let E=null,M,_,R;for(u=0;u<=Lv;u++)I[u]=0;for(d=0;d=1&&I[h]===0;h--);if(f>h&&(f=h),h===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,l.bits=1,0;for(A=1;A0&&(e===kY||h!==1))return-1;for(P[1]=0,u=1;uBY||e===EY&&v>_Y)return 1;for(;;){M=u-p,o[d]+1=B?(_=E[o[d]-B],R=T[o[d]-B]):(_=96,R=0),y=1<>p)+b]=M<<24|_<<16|R|0;while(b!==0);for(y=1<>=1;if(y!==0?(x&=y-1,x+=y):x=0,d++,--I[u]===0){if(u===h)break;u=t[r+o[d]]}if(u>f&&(x&j)!==C){for(p===0&&(p=f),S+=A,m=u-p,g=1<BY||e===EY&&v>_Y)return 1;C=x&j,i[C]=f<<24|m<<16|S-s|0}}return x!==0&&(i[S+x]=u-p<<24|64<<16|0),l.bits=f,0};var m1=Bbt;const _bt=0,Bge=1,_ge=2,{Z_FINISH:TY,Z_BLOCK:kbt,Z_TREES:AS,Z_OK:Ng,Z_STREAM_END:Ebt,Z_NEED_DICT:Tbt,Z_STREAM_ERROR:xc,Z_DATA_ERROR:kge,Z_MEM_ERROR:Ege,Z_BUF_ERROR:Pbt,Z_DEFLATED:PY}=rN,Z4=16180,IY=16181,OY=16182,FY=16183,LY=16184,MY=16185,DY=16186,RY=16187,UY=16188,QY=16189,v5=16190,qd=16191,O3=16192,HY=16193,F3=16194,$Y=16195,zY=16196,WY=16197,GY=16198,fS=16199,hS=16200,KY=16201,VY=16202,qY=16203,XY=16204,YY=16205,L3=16206,JY=16207,ZY=16208,ci=16209,Tge=16210,Pge=16211,Ibt=852,Obt=592,Fbt=15,Lbt=Fbt,eJ=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function Mbt(){this.strm=null,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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Hg=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.modePge?1:0},Ige=e=>{if(Hg(e))return xc;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Z4,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(Ibt),t.distcode=t.distdyn=new Int32Array(Obt),t.sane=1,t.back=-1,Ng},Oge=e=>{if(Hg(e))return xc;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Ige(e)},Fge=(e,t)=>{let r;if(Hg(e))return xc;const n=e.state;return t<0?(r=0,t=-t):(r=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?xc:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Oge(e))},Lge=(e,t)=>{if(!e)return xc;const r=new Mbt;e.state=r,r.strm=e,r.window=null,r.mode=Z4;const n=Fge(e,t);return n!==Ng&&(e.state=null),n},Dbt=e=>Lge(e,Lbt);let tJ=!0,M3,D3;const Rbt=e=>{if(tJ){M3=new Int32Array(512),D3=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(m1(Bge,e.lens,0,288,M3,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;m1(_ge,e.lens,0,32,D3,0,e.work,{bits:5}),tJ=!1}e.lencode=M3,e.lenbits=9,e.distcode=D3,e.distbits=5},Mge=(e,t,r,n)=>{let i;const s=e.state;return s.window===null&&(s.wsize=1<=s.wsize?(s.window.set(t.subarray(r-s.wsize,r),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>n&&(i=n),s.window.set(t.subarray(r-n,r-n+i),s.wnext),n-=i,n?(s.window.set(t.subarray(r-n,r),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave{let r,n,i,s,o,l,c,u,d,A,h,f,m,p,g=0,v,x,y,b,C,j,S,T;const B=new Uint8Array(4);let I,P;const E=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Hg(e)||!e.output||!e.input&&e.avail_in!==0)return xc;r=e.state,r.mode===qd&&(r.mode=O3),o=e.next_out,i=e.output,c=e.avail_out,s=e.next_in,n=e.input,l=e.avail_in,u=r.hold,d=r.bits,A=l,h=c,T=Ng;e:for(;;)switch(r.mode){case Z4:if(r.wrap===0){r.mode=O3;break}for(;d<16;){if(l===0)break e;l--,u+=n[s++]<>>8&255,r.check=Fs(r.check,B,2,0),u=0,d=0,r.mode=IY;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=ci;break}if((u&15)!==PY){e.msg="unknown compression method",r.mode=ci;break}if(u>>>=4,d-=4,S=(u&15)+8,r.wbits===0&&(r.wbits=S),S>15||S>r.wbits){e.msg="invalid window size",r.mode=ci;break}r.dmax=1<>8&1),r.flags&512&&r.wrap&4&&(B[0]=u&255,B[1]=u>>>8&255,r.check=Fs(r.check,B,2,0)),u=0,d=0,r.mode=OY;case OY:for(;d<32;){if(l===0)break e;l--,u+=n[s++]<>>8&255,B[2]=u>>>16&255,B[3]=u>>>24&255,r.check=Fs(r.check,B,4,0)),u=0,d=0,r.mode=FY;case FY:for(;d<16;){if(l===0)break e;l--,u+=n[s++]<>8),r.flags&512&&r.wrap&4&&(B[0]=u&255,B[1]=u>>>8&255,r.check=Fs(r.check,B,2,0)),u=0,d=0,r.mode=LY;case LY:if(r.flags&1024){for(;d<16;){if(l===0)break e;l--,u+=n[s++]<>>8&255,r.check=Fs(r.check,B,2,0)),u=0,d=0}else r.head&&(r.head.extra=null);r.mode=MY;case MY:if(r.flags&1024&&(f=r.length,f>l&&(f=l),f&&(r.head&&(S=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(s,s+f),S)),r.flags&512&&r.wrap&4&&(r.check=Fs(r.check,n,f,s)),l-=f,s+=f,r.length-=f),r.length))break e;r.length=0,r.mode=DY;case DY:if(r.flags&2048){if(l===0)break e;f=0;do S=n[s+f++],r.head&&S&&r.length<65536&&(r.head.name+=String.fromCharCode(S));while(S&&f>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=qd;break;case QY:for(;d<32;){if(l===0)break e;l--,u+=n[s++]<>>=d&7,d-=d&7,r.mode=L3;break}for(;d<3;){if(l===0)break e;l--,u+=n[s++]<>>=1,d-=1,u&3){case 0:r.mode=HY;break;case 1:if(Rbt(r),r.mode=fS,t===AS){u>>>=2,d-=2;break e}break;case 2:r.mode=zY;break;case 3:e.msg="invalid block type",r.mode=ci}u>>>=2,d-=2;break;case HY:for(u>>>=d&7,d-=d&7;d<32;){if(l===0)break e;l--,u+=n[s++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=ci;break}if(r.length=u&65535,u=0,d=0,r.mode=F3,t===AS)break e;case F3:r.mode=$Y;case $Y:if(f=r.length,f){if(f>l&&(f=l),f>c&&(f=c),f===0)break e;i.set(n.subarray(s,s+f),o),l-=f,s+=f,c-=f,o+=f,r.length-=f;break}r.mode=qd;break;case zY:for(;d<14;){if(l===0)break e;l--,u+=n[s++]<>>=5,d-=5,r.ndist=(u&31)+1,u>>>=5,d-=5,r.ncode=(u&15)+4,u>>>=4,d-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=ci;break}r.have=0,r.mode=WY;case WY:for(;r.have>>=3,d-=3}for(;r.have<19;)r.lens[E[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,I={bits:r.lenbits},T=m1(_bt,r.lens,0,19,r.lencode,0,r.work,I),r.lenbits=I.bits,T){e.msg="invalid code lengths set",r.mode=ci;break}r.have=0,r.mode=GY;case GY:for(;r.have>>24,x=g>>>16&255,y=g&65535,!(v<=d);){if(l===0)break e;l--,u+=n[s++]<>>=v,d-=v,r.lens[r.have++]=y;else{if(y===16){for(P=v+2;d>>=v,d-=v,r.have===0){e.msg="invalid bit length repeat",r.mode=ci;break}S=r.lens[r.have-1],f=3+(u&3),u>>>=2,d-=2}else if(y===17){for(P=v+3;d>>=v,d-=v,S=0,f=3+(u&7),u>>>=3,d-=3}else{for(P=v+7;d>>=v,d-=v,S=0,f=11+(u&127),u>>>=7,d-=7}if(r.have+f>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=ci;break}for(;f--;)r.lens[r.have++]=S}}if(r.mode===ci)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=ci;break}if(r.lenbits=9,I={bits:r.lenbits},T=m1(Bge,r.lens,0,r.nlen,r.lencode,0,r.work,I),r.lenbits=I.bits,T){e.msg="invalid literal/lengths set",r.mode=ci;break}if(r.distbits=6,r.distcode=r.distdyn,I={bits:r.distbits},T=m1(_ge,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,I),r.distbits=I.bits,T){e.msg="invalid distances set",r.mode=ci;break}if(r.mode=fS,t===AS)break e;case fS:r.mode=hS;case hS:if(l>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=s,e.avail_in=l,r.hold=u,r.bits=d,wbt(e,h),o=e.next_out,i=e.output,c=e.avail_out,s=e.next_in,n=e.input,l=e.avail_in,u=r.hold,d=r.bits,r.mode===qd&&(r.back=-1);break}for(r.back=0;g=r.lencode[u&(1<>>24,x=g>>>16&255,y=g&65535,!(v<=d);){if(l===0)break e;l--,u+=n[s++]<>b)],v=g>>>24,x=g>>>16&255,y=g&65535,!(b+v<=d);){if(l===0)break e;l--,u+=n[s++]<>>=b,d-=b,r.back+=b}if(u>>>=v,d-=v,r.back+=v,r.length=y,x===0){r.mode=YY;break}if(x&32){r.back=-1,r.mode=qd;break}if(x&64){e.msg="invalid literal/length code",r.mode=ci;break}r.extra=x&15,r.mode=KY;case KY:if(r.extra){for(P=r.extra;d>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=VY;case VY:for(;g=r.distcode[u&(1<>>24,x=g>>>16&255,y=g&65535,!(v<=d);){if(l===0)break e;l--,u+=n[s++]<>b)],v=g>>>24,x=g>>>16&255,y=g&65535,!(b+v<=d);){if(l===0)break e;l--,u+=n[s++]<>>=b,d-=b,r.back+=b}if(u>>>=v,d-=v,r.back+=v,x&64){e.msg="invalid distance code",r.mode=ci;break}r.offset=y,r.extra=x&15,r.mode=qY;case qY:if(r.extra){for(P=r.extra;d>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=ci;break}r.mode=XY;case XY:if(c===0)break e;if(f=h-c,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=ci;break}f>r.wnext?(f-=r.wnext,m=r.wsize-f):m=r.wnext-f,f>r.length&&(f=r.length),p=r.window}else p=i,m=o-r.offset,f=r.length;f>c&&(f=c),c-=f,r.length-=f;do i[o++]=p[m++];while(--f);r.length===0&&(r.mode=hS);break;case YY:if(c===0)break e;i[o++]=r.length,c--,r.mode=hS;break;case L3:if(r.wrap){for(;d<32;){if(l===0)break e;l--,u|=n[s++]<{if(Hg(e))return xc;let t=e.state;return t.window&&(t.window=null),e.state=null,Ng},Hbt=(e,t)=>{if(Hg(e))return xc;const r=e.state;return r.wrap&2?(r.head=t,t.done=!1,Ng):xc},$bt=(e,t)=>{const r=t.length;let n,i,s;return Hg(e)||(n=e.state,n.wrap!==0&&n.mode!==v5)?xc:n.mode===v5&&(i=1,i=tC(i,t,r,0),i!==n.check)?kge:(s=Mge(e,t,r,r),s?(n.mode=Tge,Ege):(n.havedict=1,Ng))};var zbt=Oge,Wbt=Fge,Gbt=Ige,Kbt=Dbt,Vbt=Lge,qbt=Ubt,Xbt=Qbt,Ybt=Hbt,Jbt=$bt,Zbt="pako inflate (from Nodeca project)",aA={inflateReset:zbt,inflateReset2:Wbt,inflateResetKeep:Gbt,inflateInit:Kbt,inflateInit2:Vbt,inflate:qbt,inflateEnd:Xbt,inflateGetHeader:Ybt,inflateSetDictionary:Jbt,inflateInfo:Zbt};function ewt(){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}var twt=ewt;const Dge=Object.prototype.toString,{Z_NO_FLUSH:rwt,Z_FINISH:nwt,Z_OK:iC,Z_STREAM_END:R3,Z_NEED_DICT:U3,Z_STREAM_ERROR:iwt,Z_DATA_ERROR:rJ,Z_MEM_ERROR:swt}=rN;function iN(e){this.options=J4.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jge,this.strm.avail_out=0;let r=aA.inflateInit2(this.strm,t.windowBits);if(r!==iC)throw new Error(A0[r]);if(this.header=new twt,aA.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=nC.string2buf(t.dictionary):Dge.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=aA.inflateSetDictionary(this.strm,t.dictionary),r!==iC)))throw new Error(A0[r])}iN.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let s,o,l;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?nwt:rwt,Dge.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),s=aA.inflate(r,o),s===U3&&i&&(s=aA.inflateSetDictionary(r,i),s===iC?s=aA.inflate(r,o):s===rJ&&(s=U3));r.avail_in>0&&s===R3&&r.state.wrap>0&&e[r.next_in]!==0;)aA.inflateReset(r),s=aA.inflate(r,o);switch(s){case iwt:case rJ:case U3:case swt:return this.onEnd(s),this.ended=!0,!1}if(l=r.avail_out,r.next_out&&(r.avail_out===0||s===R3))if(this.options.to==="string"){let c=nC.utf8border(r.output,r.next_out),u=r.next_out-c,d=nC.buf2string(r.output,c);r.next_out=u,r.avail_out=n-u,u&&r.output.set(r.output.subarray(c,c+u),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(s===iC&&l===0)){if(s===R3)return s=aA.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};iN.prototype.onData=function(e){this.chunks.push(e)};iN.prototype.onEnd=function(e){e===iC&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=J4.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function w7(e,t){const r=new iN(t);if(r.push(e),r.err)throw r.msg||A0[r.err];return r.result}function awt(e,t){return t=t||{},t.raw=!0,w7(e,t)}var owt=iN,lwt=w7,cwt=awt,uwt=w7,dwt=rN,Awt={Inflate:owt,inflate:lwt,inflateRaw:cwt,ungzip:uwt,constants:dwt};const{Inflate:fwt,inflate:hwt,inflateRaw:CNt,ungzip:NNt}=Awt;var nJ=fwt,pwt=hwt;const Rge=[];for(let e=0;e<256;e++){let t=e;for(let r=0;r<8;r++)t&1?t=3988292384^t>>>1:t=t>>>1;Rge[e]=t}const iJ=4294967295;function mwt(e,t,r){let n=e;for(let i=0;i>>8;return n}function gwt(e,t){return(mwt(iJ,e,t)^iJ)>>>0}function sJ(e,t,r){const n=e.readUint32(),i=gwt(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(i!==n)throw new Error(`CRC mismatch for chunk ${r}. Expected ${n}, found ${i}`)}function Uge(e,t,r){for(let n=0;n>1)&255}else{for(;s>1)&255;for(;s>1)&255}}function zge(e,t,r,n,i){let s=0;if(r.length===0){for(;s=r||j>=n))for(let S=0;S>8&255}const jwt=new Uint16Array([255]),Swt=new Uint8Array(jwt.buffer),Bwt=Swt[0]===255,_wt=new Uint8Array(0);function aJ(e){const{data:t,width:r,height:n,channels:i,depth:s}=e,o=Math.ceil(s/8)*i,l=Math.ceil(s/8*i*r),c=new Uint8Array(n*l);let u=_wt,d=0,A,h;for(let f=0;f>8&255}const sB=Uint8Array.of(137,80,78,71,13,10,26,10);function oJ(e){if(!Ewt(e.readBytes(sB.length)))throw new Error("wrong PNG signature")}function Ewt(e){if(e.length79)throw new Error("keyword length must be between 1 and 79")}const Owt=/^[\u0000-\u00FF]*$/;function Fwt(e){if(!Owt.test(e))throw new Error("invalid latin1 text")}function Lwt(e,t,r){const n=Gge(t);e[n]=Mwt(t,r-n.length-1)}function Gge(e){for(e.mark();e.readByte()!==Pwt;);const t=e.offset;e.reset();const r=Wge.decode(e.readBytes(t-e.offset-1));return e.skip(1),Iwt(r),r}function Mwt(e,t){return Wge.decode(e.readBytes(t))}const Zo={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},Q3={UNKNOWN:-1,DEFLATE:0},lJ={UNKNOWN:-1,ADAPTIVE:0},H3={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},pS={NONE:0,BACKGROUND:1,PREVIOUS:2},$3={SOURCE:0,OVER:1};class Dwt extends p7{constructor(r,n={}){super(r);Rr(this,"_checkCrc");Rr(this,"_inflator");Rr(this,"_png");Rr(this,"_apng");Rr(this,"_end");Rr(this,"_hasPalette");Rr(this,"_palette");Rr(this,"_hasTransparency");Rr(this,"_transparency");Rr(this,"_compressionMethod");Rr(this,"_filterMethod");Rr(this,"_interlaceMethod");Rr(this,"_colorType");Rr(this,"_isAnimated");Rr(this,"_numberOfFrames");Rr(this,"_numberOfPlays");Rr(this,"_frames");Rr(this,"_writingDataChunks");const{checkCrc:i=!1}=n;this._checkCrc=i,this._inflator=new nJ,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=Q3.UNKNOWN,this._filterMethod=lJ.UNKNOWN,this._interlaceMethod=H3.UNKNOWN,this._colorType=Zo.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(oJ(this);!this._end;){const r=this.readUint32(),n=this.readChars(4);this.decodeChunk(r,n)}return this.decodeImage(),this._png}decodeApng(){for(oJ(this);!this._end;){const r=this.readUint32(),n=this.readChars(4);this.decodeApngChunk(r,n)}return this.decodeApngImage(),this._apng}decodeChunk(r,n){const i=this.offset;switch(n){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(r);break;case"IDAT":this.decodeIDAT(r);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(r);break;case"iCCP":this.decodeiCCP(r);break;case Twt:Lwt(this._png.text,this,r);break;case"pHYs":this.decodepHYs();break;default:this.skip(r);break}if(this.offset-i!==r)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?sJ(this,r+4,n):this.skip(4)}decodeApngChunk(r,n){const i=this.offset;switch(n!=="fdAT"&&n!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),n){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(r);break;default:this.decodeChunk(r,n),this.offset=i+r;break}if(this.offset-i!==r)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?sJ(this,r+4,n):this.skip(4)}decodeIHDR(){const r=this._png;r.width=this.readUint32(),r.height=this.readUint32(),r.depth=Rwt(this.readUint8());const n=this.readUint8();this._colorType=n;let i;switch(n){case Zo.GREYSCALE:i=1;break;case Zo.TRUECOLOUR:i=3;break;case Zo.INDEXED_COLOUR:i=1;break;case Zo.GREYSCALE_ALPHA:i=2;break;case Zo.TRUECOLOUR_ALPHA:i=4;break;case Zo.UNKNOWN:default:throw new Error(`Unknown color type: ${n}`)}if(this._png.channels=i,this._compressionMethod=this.readUint8(),this._compressionMethod!==Q3.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const r={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(r)}decodePLTE(r){if(r%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${r}`);const n=r/3;this._hasPalette=!0;const i=[];this._palette=i;for(let s=0;sthis._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${r/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(r/2);for(let n=0;nthis._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${r} vs ${this._palette.length})`);let n=0;for(;n{const c=((o+n.yOffset)*this._png.width+n.xOffset+l)*this._png.channels,u=(o*n.width+l)*this._png.channels;return{index:c,frameIndex:u}};switch(n.blendOp){case $3.SOURCE:for(let o=0;o=200&&t.status<=299}function mS(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var qp=ur.saveAs||((typeof window>"u"?"undefined":Nn(window))!=="object"||window!==ur?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,t,r){var n=ur.URL||ur.webkitURL,i=document.createElement("a");t=t||e.name||"download",i.download=t,i.rel="noopener",typeof e=="string"?(i.href=e,i.origin!==location.origin?uJ(i.href)?W3(e,t,r):mS(i,i.target="_blank"):mS(i)):(i.href=n.createObjectURL(e),setTimeout(function(){n.revokeObjectURL(i.href)},4e4),setTimeout(function(){mS(i)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,r){if(t=t||e.name||"download",typeof e=="string")if(uJ(e))W3(e,t,r);else{var n=document.createElement("a");n.href=e,n.target="_blank",setTimeout(function(){mS(n)})}else navigator.msSaveOrOpenBlob(function(i,s){return s===void 0?s={autoBom:!1}:Nn(s)!=="object"&&(In.warn("Deprecated: Expected third argument to be a object"),s={autoBom:!s}),s.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob(["\uFEFF",i],{type:i.type}):i}(e,r),t)}:function(e,t,r,n){if((n=n||open("","_blank"))&&(n.document.title=n.document.body.innerText="downloading..."),typeof e=="string")return W3(e,t,r);var i=e.type==="application/octet-stream",s=/constructor/i.test(ur.HTMLElement)||ur.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&s)&&(typeof FileReader>"u"?"undefined":Nn(FileReader))==="object"){var l=new FileReader;l.onloadend=function(){var d=l.result;d=o?d:d.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=d:location=d,n=null},l.readAsDataURL(e)}else{var c=ur.URL||ur.webkitURL,u=c.createObjectURL(e);n?n.location=u:location.href=u,n=null,setTimeout(function(){c.revokeObjectURL(u)},4e4)}});/** * A class to parse color values * @author Stoyan Stefanov * {@link http://www.phpied.com/rgb-color-parser-in-javascript/} * @license Use it if you like it */function Kge(e){var t;e=e||"",this.ok=!1,e.charAt(0)=="#"&&(e=e.substr(1,6)),e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[e=(e=e.replace(/ /g,"")).toLowerCase()]||e;for(var r=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(l){return[parseInt(l[1]),parseInt(l[2]),parseInt(l[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(l){return[parseInt(l[1],16),parseInt(l[2],16),parseInt(l[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(l){return[parseInt(l[1]+l[1],16),parseInt(l[2]+l[2],16),parseInt(l[3]+l[3],16)]}}],n=0;n255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var l=this.r.toString(16),c=this.g.toString(16),u=this.b.toString(16);return l.length==1&&(l="0"+l),c.length==1&&(c="0"+c),u.length==1&&(u="0"+u),"#"+l+c+u}}var aB=ur.atob.bind(ur),dJ=ur.btoa.bind(ur);/** * @license * Joseph Myers does not specify a particular license for his work. * * Author: Joseph Myers * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js * * Modified by: Owen Leong */function G3(e,t){var r=e[0],n=e[1],i=e[2],s=e[3];r=Ca(r,n,i,s,t[0],7,-680876936),s=Ca(s,r,n,i,t[1],12,-389564586),i=Ca(i,s,r,n,t[2],17,606105819),n=Ca(n,i,s,r,t[3],22,-1044525330),r=Ca(r,n,i,s,t[4],7,-176418897),s=Ca(s,r,n,i,t[5],12,1200080426),i=Ca(i,s,r,n,t[6],17,-1473231341),n=Ca(n,i,s,r,t[7],22,-45705983),r=Ca(r,n,i,s,t[8],7,1770035416),s=Ca(s,r,n,i,t[9],12,-1958414417),i=Ca(i,s,r,n,t[10],17,-42063),n=Ca(n,i,s,r,t[11],22,-1990404162),r=Ca(r,n,i,s,t[12],7,1804603682),s=Ca(s,r,n,i,t[13],12,-40341101),i=Ca(i,s,r,n,t[14],17,-1502002290),r=Na(r,n=Ca(n,i,s,r,t[15],22,1236535329),i,s,t[1],5,-165796510),s=Na(s,r,n,i,t[6],9,-1069501632),i=Na(i,s,r,n,t[11],14,643717713),n=Na(n,i,s,r,t[0],20,-373897302),r=Na(r,n,i,s,t[5],5,-701558691),s=Na(s,r,n,i,t[10],9,38016083),i=Na(i,s,r,n,t[15],14,-660478335),n=Na(n,i,s,r,t[4],20,-405537848),r=Na(r,n,i,s,t[9],5,568446438),s=Na(s,r,n,i,t[14],9,-1019803690),i=Na(i,s,r,n,t[3],14,-187363961),n=Na(n,i,s,r,t[8],20,1163531501),r=Na(r,n,i,s,t[13],5,-1444681467),s=Na(s,r,n,i,t[2],9,-51403784),i=Na(i,s,r,n,t[7],14,1735328473),r=ja(r,n=Na(n,i,s,r,t[12],20,-1926607734),i,s,t[5],4,-378558),s=ja(s,r,n,i,t[8],11,-2022574463),i=ja(i,s,r,n,t[11],16,1839030562),n=ja(n,i,s,r,t[14],23,-35309556),r=ja(r,n,i,s,t[1],4,-1530992060),s=ja(s,r,n,i,t[4],11,1272893353),i=ja(i,s,r,n,t[7],16,-155497632),n=ja(n,i,s,r,t[10],23,-1094730640),r=ja(r,n,i,s,t[13],4,681279174),s=ja(s,r,n,i,t[0],11,-358537222),i=ja(i,s,r,n,t[3],16,-722521979),n=ja(n,i,s,r,t[6],23,76029189),r=ja(r,n,i,s,t[9],4,-640364487),s=ja(s,r,n,i,t[12],11,-421815835),i=ja(i,s,r,n,t[15],16,530742520),r=Sa(r,n=ja(n,i,s,r,t[2],23,-995338651),i,s,t[0],6,-198630844),s=Sa(s,r,n,i,t[7],10,1126891415),i=Sa(i,s,r,n,t[14],15,-1416354905),n=Sa(n,i,s,r,t[5],21,-57434055),r=Sa(r,n,i,s,t[12],6,1700485571),s=Sa(s,r,n,i,t[3],10,-1894986606),i=Sa(i,s,r,n,t[10],15,-1051523),n=Sa(n,i,s,r,t[1],21,-2054922799),r=Sa(r,n,i,s,t[8],6,1873313359),s=Sa(s,r,n,i,t[15],10,-30611744),i=Sa(i,s,r,n,t[6],15,-1560198380),n=Sa(n,i,s,r,t[13],21,1309151649),r=Sa(r,n,i,s,t[4],6,-145523070),s=Sa(s,r,n,i,t[11],10,-1120210379),i=Sa(i,s,r,n,t[2],15,718787259),n=Sa(n,i,s,r,t[9],21,-343485551),e[0]=dh(r,e[0]),e[1]=dh(n,e[1]),e[2]=dh(i,e[2]),e[3]=dh(s,e[3])}function eT(e,t,r,n,i,s){return t=dh(dh(t,e),dh(n,s)),dh(t<>>32-i,r)}function Ca(e,t,r,n,i,s,o){return eT(t&r|~t&n,e,t,i,s,o)}function Na(e,t,r,n,i,s,o){return eT(t&n|r&~n,e,t,i,s,o)}function ja(e,t,r,n,i,s,o){return eT(t^r^n,e,t,i,s,o)}function Sa(e,t,r,n,i,s,o){return eT(r^(t|~n),e,t,i,s,o)}function Vge(e){var t,r=e.length,n=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)G3(n,Qwt(e.substring(t-64,t)));e=e.substring(t-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t>2]|=e.charCodeAt(t)<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(G3(n,i),t=0;t<16;t++)i[t]=0;return i[14]=8*r,G3(n,i),n}function Qwt(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}var AJ="0123456789abcdef".split("");function Hwt(e){for(var t="",r=0;r<4;r++)t+=AJ[e>>8*r+4&15]+AJ[e>>8*r&15];return t}function $wt(e){return String.fromCharCode(255&e,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function iR(e){return Vge(e).map($wt).join("")}var zwt=function(e){for(var t=0;t>16)+(t>>16)+(r>>16)<<16|65535&r}return e+t&4294967295}/** * @license * FPDF is released under a permissive license: there is no usage restriction. * You may embed it freely in your application (commercial or not), with or * without modifications. * * Reference: http://www.fpdf.org/en/script/script37.php */function sR(e,t){var r,n,i,s;if(e!==r){for(var o=(i=e,s=1+(256/e.length|0),new Array(s+1).join(i)),l=[],c=0;c<256;c++)l[c]=c;var u=0;for(c=0;c<256;c++){var d=l[c];u=(u+d+o.charCodeAt(c))%256,l[c]=l[u],l[u]=d}r=e,n=l}else l=n;var A=t.length,h=0,f=0,m="";for(c=0;c€/\f©þdSiz";var s=(t+this.padding).substr(0,32),o=(r+this.padding).substr(0,32);this.O=this.processOwnerPassword(s,o),this.P=-(1+(255^i)),this.encryptionKey=iR(s+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(n)).substr(0,5),this.U=sR(this.encryptionKey,this.padding)}function Zv(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var t="",r=e.length,n=0;n126?"#"+("0"+i.toString(16)).slice(-2):e[n]}return t}function hJ(e){if(Nn(e)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};this.subscribe=function(r,n,i){if(i=i||!1,typeof r!="string"||typeof n!="function"||typeof i!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");t.hasOwnProperty(r)||(t[r]={});var s=Math.random().toString(35);return t[r][s]=[n,!!i],s},this.unsubscribe=function(r){for(var n in t)if(t[n][r])return delete t[n][r],Object.keys(t[n]).length===0&&delete t[n],!0;return!1},this.publish=function(r){if(t.hasOwnProperty(r)){var n=Array.prototype.slice.call(arguments,1),i=[];for(var s in t[r]){var o=t[r][s];try{o[0].apply(e,n)}catch(l){ur.console&&In.error("jsPDF PubSub Error",l.message,l)}o[1]&&i.push(s)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function x5(e){if(!(this instanceof x5))return new x5(e);var t="opacity,stroke-opacity".split(",");for(var r in e)e.hasOwnProperty(r)&&t.indexOf(r)>=0&&(this[r]=e[r]);this.id="",this.objectNumber=-1}function qge(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function tm(e,t,r,n,i){if(!(this instanceof tm))return new tm(e,t,r,n,i);this.type=e==="axial"?2:3,this.coords=t,this.colors=r,qge.call(this,n,i)}function xx(e,t,r,n,i){if(!(this instanceof xx))return new xx(e,t,r,n,i);this.boundingBox=e,this.xStep=t,this.yStep=r,this.stream="",this.cloneIndex=0,qge.call(this,n,i)}function Wt(e){var t,r=typeof arguments[0]=="string"?arguments[0]:"p",n=arguments[1],i=arguments[2],s=arguments[3],o=[],l=1,c=16,u="S",d=null;Nn(e=e||{})==="object"&&(r=e.orientation,n=e.unit||n,i=e.format||i,s=e.compress||e.compressPdf||s,(d=e.encryption||null)!==null&&(d.userPassword=d.userPassword||"",d.ownerPassword=d.ownerPassword||"",d.userPermissions=d.userPermissions||[]),l=typeof e.userUnit=="number"?Math.abs(e.userUnit):1,e.precision!==void 0&&(t=e.precision),e.floatPrecision!==void 0&&(c=e.floatPrecision),u=e.defaultPathOperation||"S"),o=e.filters||(s===!0?["FlateEncode"]:o),n=n||"mm",r=(""+(r||"P")).toLowerCase();var A=e.putOnlyUsedFonts||!1,h={},f={internal:{},__private__:{}};f.__private__.PubSub=hJ;var m="1.3",p=f.__private__.getPdfVersion=function(){return m};f.__private__.setPdfVersion=function(F){m=F};var g={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};f.__private__.getPageFormats=function(){return g};var v=f.__private__.getPageFormat=function(F){return g[F]};i=i||"a4";var x="compat",y="advanced",b=x;function C(){this.saveGraphicsState(),K(new St(Qt,0,0,-Qt,0,pp()*Qt).toString()+" cm"),this.setFontSize(this.getFontSize()/Qt),u="n",b=y}function j(){this.restoreGraphicsState(),u="S",b=x}var S=f.__private__.combineFontStyleAndFontWeight=function(F,q){if(F=="bold"&&q=="normal"||F=="bold"&&q==400||F=="normal"&&q=="italic"||F=="bold"&&q=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return q&&(F=q==400||q==="normal"?F==="italic"?"italic":"normal":q!=700&&q!=="bold"||F!=="normal"?(q==700?"bold":q)+""+F:"bold"),F};f.advancedAPI=function(F){var q=b===x;return q&&C.call(this),typeof F!="function"||(F(this),q&&j.call(this)),this},f.compatAPI=function(F){var q=b===y;return q&&j.call(this),typeof F!="function"||(F(this),q&&C.call(this)),this},f.isAdvancedAPI=function(){return b===y};var T,B=function(F){if(b!==y)throw new Error(F+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},I=f.roundToPrecision=f.__private__.roundToPrecision=function(F,q){var Ae=t||q;if(isNaN(F)||isNaN(Ae))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return F.toFixed(Ae).replace(/0+$/,"")};T=f.hpf=f.__private__.hpf=typeof c=="number"?function(F){if(isNaN(F))throw new Error("Invalid argument passed to jsPDF.hpf");return I(F,c)}:c==="smart"?function(F){if(isNaN(F))throw new Error("Invalid argument passed to jsPDF.hpf");return I(F,F>-1&&F<1?16:5)}:function(F){if(isNaN(F))throw new Error("Invalid argument passed to jsPDF.hpf");return I(F,16)};var P=f.f2=f.__private__.f2=function(F){if(isNaN(F))throw new Error("Invalid argument passed to jsPDF.f2");return I(F,2)},E=f.__private__.f3=function(F){if(isNaN(F))throw new Error("Invalid argument passed to jsPDF.f3");return I(F,3)},M=f.scale=f.__private__.scale=function(F){if(isNaN(F))throw new Error("Invalid argument passed to jsPDF.scale");return b===x?F*Qt:b===y?F:void 0},_=function(F){return M(function(q){return b===x?pp()-q:b===y?q:void 0}(F))};f.__private__.setPrecision=f.setPrecision=function(F){typeof parseInt(F,10)=="number"&&(t=parseInt(F,10))};var R,G="00000000000000000000000000000000",U=f.__private__.getFileId=function(){return G},Q=f.__private__.setFileId=function(F){return G=F!==void 0&&/^[a-fA-F0-9]{32}$/.test(F)?F.toUpperCase():G.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),d!==null&&(Xs=new Jv(d.userPermissions,d.userPassword,d.ownerPassword,G)),G};f.setFileId=function(F){return Q(F),this},f.getFileId=function(){return U()};var z=f.__private__.convertDateToPDFDate=function(F){var q=F.getTimezoneOffset(),Ae=q<0?"+":"-",Ce=Math.floor(Math.abs(q/60)),Ee=Math.abs(q%60),Ue=[Ae,V(Ce),"'",V(Ee),"'"].join("");return["D:",F.getFullYear(),V(F.getMonth()+1),V(F.getDate()),V(F.getHours()),V(F.getMinutes()),V(F.getSeconds()),Ue].join("")},Y=f.__private__.convertPDFDateToDate=function(F){var q=parseInt(F.substr(2,4),10),Ae=parseInt(F.substr(6,2),10)-1,Ce=parseInt(F.substr(8,2),10),Ee=parseInt(F.substr(10,2),10),Ue=parseInt(F.substr(12,2),10),qe=parseInt(F.substr(14,2),10);return new Date(q,Ae,Ce,Ee,Ue,qe,0)},$=f.__private__.setCreationDate=function(F){var q;if(F===void 0&&(F=new Date),F instanceof Date)q=z(F);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(F))throw new Error("Invalid argument passed to jsPDF.setCreationDate");q=F}return R=q},O=f.__private__.getCreationDate=function(F){var q=R;return F==="jsDate"&&(q=Y(R)),q};f.setCreationDate=function(F){return $(F),this},f.getCreationDate=function(F){return O(F)};var W,V=f.__private__.padd2=function(F){return("0"+parseInt(F)).slice(-2)},X=f.__private__.padd2Hex=function(F){return("00"+(F=F.toString())).substr(F.length)},ne=0,oe=[],pe=[],de=0,ge=[],ie=[],ue=!1,Se=pe;f.__private__.setCustomOutputDestination=function(F){ue=!0,Se=F};var D=function(F){ue||(Se=F)};f.__private__.resetCustomOutputDestination=function(){ue=!1,Se=pe};var K=f.__private__.out=function(F){return F=F.toString(),de+=F.length+1,Se.push(F),Se},we=f.__private__.write=function(F){return K(arguments.length===1?F.toString():Array.prototype.join.call(arguments," "))},ae=f.__private__.getArrayBuffer=function(F){for(var q=F.length,Ae=new ArrayBuffer(q),Ce=new Uint8Array(Ae);q--;)Ce[q]=F.charCodeAt(q);return Ae},te=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];f.__private__.getStandardFonts=function(){return te};var ce=e.fontSize||16;f.__private__.setFontSize=f.setFontSize=function(F){return ce=b===y?F/Qt:F,this};var be,je=f.__private__.getFontSize=f.getFontSize=function(){return b===x?ce:ce*Qt},xe=e.R2L||!1;f.__private__.setR2L=f.setR2L=function(F){return xe=F,this},f.__private__.getR2L=f.getR2L=function(){return xe};var Ie,Ke=f.__private__.setZoomMode=function(F){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(F))be=F;else if(isNaN(F)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(F)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+F+'" is not recognized.');be=F}else be=parseInt(F,10)};f.__private__.getZoomMode=function(){return be};var De,Ve=f.__private__.setPageMode=function(F){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(F)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+F+'" is not recognized.');Ie=F};f.__private__.getPageMode=function(){return Ie};var ht=f.__private__.setLayoutMode=function(F){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(F)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+F+'" is not recognized.');De=F};f.__private__.getLayoutMode=function(){return De},f.__private__.setDisplayMode=f.setDisplayMode=function(F,q,Ae){return Ke(F),ht(q),Ve(Ae),this};var ft={title:"",subject:"",author:"",keywords:"",creator:""};f.__private__.getDocumentProperty=function(F){if(Object.keys(ft).indexOf(F)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return ft[F]},f.__private__.getDocumentProperties=function(){return ft},f.__private__.setDocumentProperties=f.setProperties=f.setDocumentProperties=function(F){for(var q in ft)ft.hasOwnProperty(q)&&F[q]&&(ft[q]=F[q]);return this},f.__private__.setDocumentProperty=function(F,q){if(Object.keys(ft).indexOf(F)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return ft[F]=q};var ut,Qt,dt,Sr,Tt,qt={},nr={},hr=[],Mt={},Vr={},Ht={},$t={},zr=null,Zt=0,yt=[],tn=new hJ(f),Kt=e.hotfixes||[],ir={},Wr={},Bn=[],St=function F(q,Ae,Ce,Ee,Ue,qe){if(!(this instanceof F))return new F(q,Ae,Ce,Ee,Ue,qe);isNaN(q)&&(q=1),isNaN(Ae)&&(Ae=0),isNaN(Ce)&&(Ce=0),isNaN(Ee)&&(Ee=1),isNaN(Ue)&&(Ue=0),isNaN(qe)&&(qe=0),this._matrix=[q,Ae,Ce,Ee,Ue,qe]};Object.defineProperty(St.prototype,"sx",{get:function(){return this._matrix[0]},set:function(F){this._matrix[0]=F}}),Object.defineProperty(St.prototype,"shy",{get:function(){return this._matrix[1]},set:function(F){this._matrix[1]=F}}),Object.defineProperty(St.prototype,"shx",{get:function(){return this._matrix[2]},set:function(F){this._matrix[2]=F}}),Object.defineProperty(St.prototype,"sy",{get:function(){return this._matrix[3]},set:function(F){this._matrix[3]=F}}),Object.defineProperty(St.prototype,"tx",{get:function(){return this._matrix[4]},set:function(F){this._matrix[4]=F}}),Object.defineProperty(St.prototype,"ty",{get:function(){return this._matrix[5]},set:function(F){this._matrix[5]=F}}),Object.defineProperty(St.prototype,"a",{get:function(){return this._matrix[0]},set:function(F){this._matrix[0]=F}}),Object.defineProperty(St.prototype,"b",{get:function(){return this._matrix[1]},set:function(F){this._matrix[1]=F}}),Object.defineProperty(St.prototype,"c",{get:function(){return this._matrix[2]},set:function(F){this._matrix[2]=F}}),Object.defineProperty(St.prototype,"d",{get:function(){return this._matrix[3]},set:function(F){this._matrix[3]=F}}),Object.defineProperty(St.prototype,"e",{get:function(){return this._matrix[4]},set:function(F){this._matrix[4]=F}}),Object.defineProperty(St.prototype,"f",{get:function(){return this._matrix[5]},set:function(F){this._matrix[5]=F}}),Object.defineProperty(St.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(St.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(St.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(St.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),St.prototype.join=function(F){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(T).join(F)},St.prototype.multiply=function(F){var q=F.sx*this.sx+F.shy*this.shx,Ae=F.sx*this.shy+F.shy*this.sy,Ce=F.shx*this.sx+F.sy*this.shx,Ee=F.shx*this.shy+F.sy*this.sy,Ue=F.tx*this.sx+F.ty*this.shx+this.tx,qe=F.tx*this.shy+F.ty*this.sy+this.ty;return new St(q,Ae,Ce,Ee,Ue,qe)},St.prototype.decompose=function(){var F=this.sx,q=this.shy,Ae=this.shx,Ce=this.sy,Ee=this.tx,Ue=this.ty,qe=Math.sqrt(F*F+q*q),Ft=(F/=qe)*Ae+(q/=qe)*Ce;Ae-=F*Ft,Ce-=q*Ft;var Pt=Math.sqrt(Ae*Ae+Ce*Ce);return Ft/=Pt,F*(Ce/=Pt)>16&255,Ce=Pt>>8&255,Ee=255&Pt}if(Ce===void 0||Ue===void 0&&Ae===Ce&&Ce===Ee)q=typeof Ae=="string"?Ae+" "+qe[0]:F.precision===2?P(Ae/255)+" "+qe[0]:E(Ae/255)+" "+qe[0];else if(Ue===void 0||Nn(Ue)==="object"){if(Ue&&!isNaN(Ue.a)&&Ue.a===0)return["1.","1.","1.",qe[1]].join(" ");q=typeof Ae=="string"?[Ae,Ce,Ee,qe[1]].join(" "):F.precision===2?[P(Ae/255),P(Ce/255),P(Ee/255),qe[1]].join(" "):[E(Ae/255),E(Ce/255),E(Ee/255),qe[1]].join(" ")}else q=typeof Ae=="string"?[Ae,Ce,Ee,Ue,qe[2]].join(" "):F.precision===2?[P(Ae),P(Ce),P(Ee),P(Ue),qe[2]].join(" "):[E(Ae),E(Ce),E(Ee),E(Ue),qe[2]].join(" ");return q},xo=f.__private__.getFilters=function(){return o},ha=f.__private__.putStream=function(F){var q=(F=F||{}).data||"",Ae=F.filters||xo(),Ce=F.alreadyAppliedFilters||[],Ee=F.addLength1||!1,Ue=q.length,qe=F.objectId,Ft=function(Xn){return Xn};if(d!==null&&qe===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");d!==null&&(Ft=Xs.encryptor(qe,0));var Pt={};Ae===!0&&(Ae=["FlateEncode"]);var pr=F.additionalKeyValues||[],wr=(Pt=Wt.API.processDataByFilters!==void 0?Wt.API.processDataByFilters(q,Ae):{data:q,reverseChain:[]}).reverseChain+(Array.isArray(Ce)?Ce.join(" "):Ce.toString());if(Pt.data.length!==0&&(pr.push({key:"Length",value:Pt.data.length}),Ee===!0&&pr.push({key:"Length1",value:Ue})),wr.length!=0)if(wr.split("/").length-1==1)pr.push({key:"Filter",value:wr});else{pr.push({key:"Filter",value:"["+wr+"]"});for(var rn=0;rn>"),Pt.data.length!==0&&(K("stream"),K(Ft(Pt.data)),K("endstream"))},Tl=f.__private__.putPage=function(F){var q=F.number,Ae=F.data,Ce=F.objId,Ee=F.contentsObjId;ts(Ce,!0),K("<>"),K("endobj");var Ue=Ae.join(` `);return b===y&&(Ue+=` Q`),ts(Ee,!0),ha({data:Ue,filters:xo(),objectId:Ee}),K("endobj"),Ce},qs=f.__private__.putPages=function(){var F,q,Ae=[];for(F=1;F<=Zt;F++)yt[F].objId=ji(),yt[F].contentsObjId=ji();for(F=1;F<=Zt;F++)Ae.push(Tl({number:F,data:ie[F],objId:yt[F].objId,contentsObjId:yt[F].contentsObjId,mediaBox:yt[F].mediaBox,cropBox:yt[F].cropBox,bleedBox:yt[F].bleedBox,trimBox:yt[F].trimBox,artBox:yt[F].artBox,userUnit:yt[F].userUnit,rootDictionaryObjId:mu,resourceDictionaryObjId:pi}));ts(mu,!0),K("<>"),K("endobj"),tn.publish("postPutPages")},Pl=function(F){tn.publish("putFont",{font:F,out:K,newObject:qn,putStream:ha}),F.isAlreadyPutted!==!0&&(F.objectNumber=qn(),K("<<"),K("/Type /Font"),K("/BaseFont /"+Zv(F.postScriptName)),K("/Subtype /Type1"),typeof F.encoding=="string"&&K("/Encoding /"+F.encoding),K("/FirstChar 32"),K("/LastChar 255"),K(">>"),K("endobj"))},pa=function(F){F.objectNumber=qn();var q=[];q.push({key:"Type",value:"/XObject"}),q.push({key:"Subtype",value:"/Form"}),q.push({key:"BBox",value:"["+[T(F.x),T(F.y),T(F.x+F.width),T(F.y+F.height)].join(" ")+"]"}),q.push({key:"Matrix",value:"["+F.matrix.toString()+"]"});var Ae=F.pages[1].join(` `);ha({data:Ae,additionalKeyValues:q,objectId:F.objectNumber}),K("endobj")},jd=function(F,q){q||(q=21);var Ae=qn(),Ce=function(qe,Ft){var Pt,pr=[],wr=1/(Ft-1);for(Pt=0;Pt<1;Pt+=wr)pr.push(Pt);if(pr.push(1),qe[0].offset!=0){var rn={offset:0,color:qe[0].color};qe.unshift(rn)}if(qe[qe.length-1].offset!=1){var rs={offset:1,color:qe[qe.length-1].color};qe.push(rs)}for(var Tn="",_n=0,Xn=0;Xnqe[_n+1].offset;)_n++;var mi=qe[_n].offset,gi=(Pt-mi)/(qe[_n+1].offset-mi),ga=qe[_n].color,Od=qe[_n+1].color;Tn+=X(Math.round((1-gi)*ga[0]+gi*Od[0]).toString(16))+X(Math.round((1-gi)*ga[1]+gi*Od[1]).toString(16))+X(Math.round((1-gi)*ga[2]+gi*Od[2]).toString(16))}return Tn.trim()}(F.colors,q),Ee=[];Ee.push({key:"FunctionType",value:"0"}),Ee.push({key:"Domain",value:"[0.0 1.0]"}),Ee.push({key:"Size",value:"["+q+"]"}),Ee.push({key:"BitsPerSample",value:"8"}),Ee.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Ee.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ha({data:Ce,additionalKeyValues:Ee,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:Ae}),K("endobj"),F.objectNumber=qn(),K("<< /ShadingType "+F.type),K("/ColorSpace /DeviceRGB");var Ue="/Coords ["+T(parseFloat(F.coords[0]))+" "+T(parseFloat(F.coords[1]))+" ";F.type===2?Ue+=T(parseFloat(F.coords[2]))+" "+T(parseFloat(F.coords[3])):Ue+=T(parseFloat(F.coords[2]))+" "+T(parseFloat(F.coords[3]))+" "+T(parseFloat(F.coords[4]))+" "+T(parseFloat(F.coords[5])),K(Ue+="]"),F.matrix&&K("/Matrix ["+F.matrix.toString()+"]"),K("/Function "+Ae+" 0 R"),K("/Extend [true true]"),K(">>"),K("endobj")},Sd=function(F,q){var Ae=ji(),Ce=qn();q.push({resourcesOid:Ae,objectOid:Ce}),F.objectNumber=Ce;var Ee=[];Ee.push({key:"Type",value:"/Pattern"}),Ee.push({key:"PatternType",value:"1"}),Ee.push({key:"PaintType",value:"1"}),Ee.push({key:"TilingType",value:"1"}),Ee.push({key:"BBox",value:"["+F.boundingBox.map(T).join(" ")+"]"}),Ee.push({key:"XStep",value:T(F.xStep)}),Ee.push({key:"YStep",value:T(F.yStep)}),Ee.push({key:"Resources",value:Ae+" 0 R"}),F.matrix&&Ee.push({key:"Matrix",value:"["+F.matrix.toString()+"]"}),ha({data:F.stream,additionalKeyValues:Ee,objectId:F.objectNumber}),K("endobj")},nb=function(F){for(var q in F.objectNumber=qn(),K("<<"),F)switch(q){case"opacity":K("/ca "+P(F[q]));break;case"stroke-opacity":K("/CA "+P(F[q]))}K(">>"),K("endobj")},GA=function(F){ts(F.resourcesOid,!0),K("<<"),K("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var q in K("/Font <<"),qt)qt.hasOwnProperty(q)&&(A===!1||A===!0&&h.hasOwnProperty(q))&&K("/"+q+" "+qt[q].objectNumber+" 0 R");K(">>")}(),function(){if(Object.keys(Mt).length>0){for(var q in K("/Shading <<"),Mt)Mt.hasOwnProperty(q)&&Mt[q]instanceof tm&&Mt[q].objectNumber>=0&&K("/"+q+" "+Mt[q].objectNumber+" 0 R");tn.publish("putShadingPatternDict"),K(">>")}}(),function(q){if(Object.keys(Mt).length>0){for(var Ae in K("/Pattern <<"),Mt)Mt.hasOwnProperty(Ae)&&Mt[Ae]instanceof f.TilingPattern&&Mt[Ae].objectNumber>=0&&Mt[Ae].objectNumber>")}}(F.objectOid),function(){if(Object.keys(Ht).length>0){var q;for(q in K("/ExtGState <<"),Ht)Ht.hasOwnProperty(q)&&Ht[q].objectNumber>=0&&K("/"+q+" "+Ht[q].objectNumber+" 0 R");tn.publish("putGStateDict"),K(">>")}}(),function(){for(var q in K("/XObject <<"),ir)ir.hasOwnProperty(q)&&ir[q].objectNumber>=0&&K("/"+q+" "+ir[q].objectNumber+" 0 R");tn.publish("putXobjectDict"),K(">>")}(),K(">>"),K("endobj")},Ap=function(F){nr[F.fontName]=nr[F.fontName]||{},nr[F.fontName][F.fontStyle]=F.id},Bd=function(F,q,Ae,Ce,Ee){var Ue={id:"F"+(Object.keys(qt).length+1).toString(10),postScriptName:F,fontName:q,fontStyle:Ae,encoding:Ce,isStandardFont:Ee||!1,metadata:{}};return tn.publish("addFont",{font:Ue,instance:this}),qt[Ue.id]=Ue,Ap(Ue),Ue.id},ms=f.__private__.pdfEscape=f.pdfEscape=function(F,q){return function(Ae,Ce){var Ee,Ue,qe,Ft,Pt,pr,wr,rn,rs;if(qe=(Ce=Ce||{}).sourceEncoding||"Unicode",Pt=Ce.outputEncoding,(Ce.autoencode||Pt)&&qt[ut].metadata&&qt[ut].metadata[qe]&&qt[ut].metadata[qe].encoding&&(Ft=qt[ut].metadata[qe].encoding,!Pt&&qt[ut].encoding&&(Pt=qt[ut].encoding),!Pt&&Ft.codePages&&(Pt=Ft.codePages[0]),typeof Pt=="string"&&(Pt=Ft[Pt]),Pt)){for(wr=!1,pr=[],Ee=0,Ue=Ae.length;Ee>8&&(wr=!0);Ae=pr.join("")}for(Ee=Ae.length;wr===void 0&&Ee!==0;)Ae.charCodeAt(Ee-1)>>8&&(wr=!0),Ee--;if(!wr)return Ae;for(pr=Ce.noBOM?[]:[254,255],Ee=0,Ue=Ae.length;Ee>8)>>8)throw new Error("Character at position "+Ee+" of string '"+Ae+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");pr.push(rs),pr.push(rn-(rs<<8))}return String.fromCharCode.apply(void 0,pr)}(F,q).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},wt=f.__private__.beginPage=function(F){ie[++Zt]=[],yt[Zt]={objId:0,contentsObjId:0,userUnit:Number(l),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(F[0]),topRightY:Number(F[1])}},At(Zt),D(ie[W])},me=function(F,q){var Ae,Ce,Ee;switch(r=q||r,typeof F=="string"&&(Ae=v(F.toLowerCase()),Array.isArray(Ae)&&(Ce=Ae[0],Ee=Ae[1])),Array.isArray(F)&&(Ce=F[0]*Qt,Ee=F[1]*Qt),isNaN(Ce)&&(Ce=i[0],Ee=i[1]),(Ce>14400||Ee>14400)&&(In.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),Ce=Math.min(14400,Ce),Ee=Math.min(14400,Ee)),i=[Ce,Ee],r.substr(0,1)){case"l":Ee>Ce&&(i=[Ee,Ce]);break;case"p":Ce>Ee&&(i=[Ee,Ce])}wt(i),uT(cr),K(Kg),ab!==0&&K(ab+" J"),YA!==0&&K(YA+" j"),tn.publish("addPage",{pageNumber:Zt})},$e=function(F){F>0&&F<=Zt&&(ie.splice(F,1),yt.splice(F,1),Zt--,W>Zt&&(W=Zt),this.setPage(W))},At=function(F){F>0&&F<=Zt&&(W=F)},Gr=f.__private__.getNumberOfPages=f.getNumberOfPages=function(){return ie.length-1},vr=function(F,q,Ae){var Ce,Ee=void 0;return Ae=Ae||{},F=F!==void 0?F:qt[ut].fontName,q=q!==void 0?q:qt[ut].fontStyle,Ce=F.toLowerCase(),nr[Ce]!==void 0&&nr[Ce][q]!==void 0?Ee=nr[Ce][q]:nr[F]!==void 0&&nr[F][q]!==void 0?Ee=nr[F][q]:Ae.disableWarning===!1&&In.warn("Unable to look up font label for font '"+F+"', '"+q+"'. Refer to getFontList() for available fonts."),Ee||Ae.noFallback||(Ee=nr.times[q])==null&&(Ee=nr.times.normal),Ee},Fr=f.__private__.putInfo=function(){var F=qn(),q=function(Ce){return Ce};for(var Ae in d!==null&&(q=Xs.encryptor(F,0)),K("<<"),K("/Producer ("+ms(q("jsPDF "+Wt.version))+")"),ft)ft.hasOwnProperty(Ae)&&ft[Ae]&&K("/"+Ae.substr(0,1).toUpperCase()+Ae.substr(1)+" ("+ms(q(ft[Ae]))+")");K("/CreationDate ("+ms(q(R))+")"),K(">>"),K("endobj")},Dn=f.__private__.putCatalog=function(F){var q=(F=F||{}).rootDictionaryObjId||mu;switch(qn(),K("<<"),K("/Type /Catalog"),K("/Pages "+q+" 0 R"),be||(be="fullwidth"),be){case"fullwidth":K("/OpenAction [3 0 R /FitH null]");break;case"fullheight":K("/OpenAction [3 0 R /FitV null]");break;case"fullpage":K("/OpenAction [3 0 R /Fit]");break;case"original":K("/OpenAction [3 0 R /XYZ null null 1]");break;default:var Ae=""+be;Ae.substr(Ae.length-1)==="%"&&(be=parseInt(be)/100),typeof be=="number"&&K("/OpenAction [3 0 R /XYZ null null "+P(be)+"]")}switch(De||(De="continuous"),De){case"continuous":K("/PageLayout /OneColumn");break;case"single":K("/PageLayout /SinglePage");break;case"two":case"twoleft":K("/PageLayout /TwoColumnLeft");break;case"tworight":K("/PageLayout /TwoColumnRight")}Ie&&K("/PageMode /"+Ie),tn.publish("putCatalog"),K(">>"),K("endobj")},ma=f.__private__.putTrailer=function(){K("trailer"),K("<<"),K("/Size "+(ne+1)),K("/Root "+ne+" 0 R"),K("/Info "+(ne-1)+" 0 R"),d!==null&&K("/Encrypt "+Xs.oid+" 0 R"),K("/ID [ <"+G+"> <"+G+"> ]"),K(">>")},un=f.__private__.putHeader=function(){K("%PDF-"+m),K("%ºß¬à")},KA=f.__private__.putXRef=function(){var F="0000000000";K("xref"),K("0 "+(ne+1)),K("0000000000 65535 f ");for(var q=1;q<=ne;q++)typeof oe[q]=="function"?K((F+oe[q]()).slice(-10)+" 00000 n "):oe[q]!==void 0?K((F+oe[q]).slice(-10)+" 00000 n "):K("0000000000 00000 n ")},xn=f.__private__.buildDocument=function(){var F;ne=0,de=0,pe=[],oe=[],ge=[],mu=ji(),pi=ji(),D(pe),tn.publish("buildDocument"),un(),qs(),function(){tn.publish("putAdditionalObjects");for(var Ae=0;Ae"),K("/O <"+Xs.toHexString(Xs.O)+">"),K("/P "+Xs.P),K(">>"),K("endobj")),Fr(),Dn();var q=de;return KA(),ma(),K("startxref"),K(""+q),K("%%EOF"),D(ie[W]),pe.join(` `)},_d=f.__private__.getBlob=function(F){return new Blob([ae(F)],{type:"application/pdf"})},VA=function(F){for(;F.firstChild;)F.removeChild(F.firstChild)},Go=function(F){var q,Ae=F.document,Ce=Ae.documentElement,Ee=Ae.head,Ue=Ae.body;return Ee||(Ee=Ae.createElement("head"),Ce.appendChild(Ee)),Ue||(Ue=Ae.createElement("body"),Ce.appendChild(Ue)),VA(Ee),VA(Ue),(q=Ae.createElement("style")).appendChild(Ae.createTextNode("html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}")),Ee.appendChild(q),{document:Ae,body:Ue}},zg=f.output=f.__private__.output=(hi=function(F,q){switch(typeof(q=q||{})=="string"?q={filename:q}:q.filename=q.filename||"generated.pdf",F){case void 0:return xn();case"save":f.save(q.filename);break;case"arraybuffer":return ae(xn());case"blob":return _d(xn());case"bloburi":case"bloburl":if(ur.URL!==void 0&&typeof ur.URL.createObjectURL=="function")return ur.URL&&ur.URL.createObjectURL(_d(xn()))||void 0;In.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var Ae="",Ce=xn();try{Ae=dJ(Ce)}catch{Ae=dJ(unescape(encodeURIComponent(Ce)))}return"data:application/pdf;filename="+encodeURIComponent(q.filename)+";base64,"+Ae;case"pdfobjectnewwindow":if(Object.prototype.toString.call(ur)==="[object Window]"){var Ee="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",Ue=!q.pdfObjectUrl;Ue||(Ee=q.pdfObjectUrl);var qe=ur.open();if(qe!==null){var Ft=Go(qe),Pt=Ft.document.createElement("script"),pr=this;Pt.src=Ee,Ue&&(Pt.integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==",Pt.crossOrigin="anonymous"),Pt.onload=function(){qe.PDFObject.embed(pr.output("dataurlstring"),q)},Ft.body.appendChild(Pt)}return qe}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(ur)==="[object Window]"){var wr=q.pdfJsUrl||"examples/PDF.js/web/viewer.html",rn=ur.open();if(rn!==null){var rs=Go(rn),Tn=rs.document.createElement("iframe"),_n=wr.indexOf("?")===-1?"?":"&";pr=this,Tn.id="pdfViewer",Tn.width="500px",Tn.height="400px",Tn.src=wr+_n+"file=&downloadName="+encodeURIComponent(q.filename),Tn.onload=function(){rn.document.title=q.filename,Tn.contentWindow.PDFViewerApplication.open(pr.output("bloburl"))},rs.body.appendChild(Tn)}return rn}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(ur)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Xn=ur.open();if(Xn!==null){var mi=Go(Xn),gi=mi.document.createElement("iframe");gi.src=this.output("datauristring",q),mi.body.appendChild(gi),Xn.document.title=q.filename}if(Xn||typeof safari>"u")return Xn;break;case"datauri":case"dataurl":return ur.document.location.href=this.output("datauristring",q);default:return null}},hi.foo=function(){try{return hi.apply(this,arguments)}catch(Ae){var F=Ae.stack||"";~F.indexOf(" at ")&&(F=F.split(" at ")[1]);var q="Error in function "+F.split(` `)[0].split("<")[0]+": "+Ae.message;if(!ur.console)throw new Error(q);ur.console.error(q,Ae),ur.alert&&alert(q)}},hi.foo.bar=hi,hi.foo),kd=function(F){return Array.isArray(Kt)===!0&&Kt.indexOf(F)>-1};switch(n){case"pt":Qt=1;break;case"mm":Qt=72/25.4;break;case"cm":Qt=72/2.54;break;case"in":Qt=72;break;case"px":Qt=kd("px_scaling")==1?.75:96/72;break;case"pc":case"em":Qt=12;break;case"ex":Qt=6;break;default:if(typeof n!="number")throw new Error("Invalid unit: "+n);Qt=n}var Xs=null;$(),Q();var aN=f.__private__.getPageInfo=f.getPageInfo=function(F){if(isNaN(F)||F%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:yt[F].objId,pageNumber:F,pageContext:yt[F]}},rT=f.__private__.getPageInfoByObjId=function(F){if(isNaN(F)||F%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var q in yt)if(yt[q].objId===F)break;return aN(q)},nT=f.__private__.getCurrentPageInfo=f.getCurrentPageInfo=function(){return{objId:yt[W].objId,pageNumber:W,pageContext:yt[W]}};f.addPage=function(){return me.apply(this,arguments),this},f.setPage=function(){return At.apply(this,arguments),D.call(this,ie[W]),this},f.insertPage=function(F){return this.addPage(),this.movePage(W,F),this},f.movePage=function(F,q){var Ae,Ce;if(F>q){Ae=ie[F],Ce=yt[F];for(var Ee=F;Ee>q;Ee--)ie[Ee]=ie[Ee-1],yt[Ee]=yt[Ee-1];ie[q]=Ae,yt[q]=Ce,this.setPage(q)}else if(F0&&(typeof F=="string"?F=_n.splitTextToSize(F,wr):Object.prototype.toString.call(F)==="[object Array]"&&(F=F.reduce(function(Rn,Un){return Rn.concat(_n.splitTextToSize(Un,wr))},[]))),Ue={text:F,x:q,y:Ae,options:Ce,mutex:{pdfEscape:ms,activeFontKey:ut,fonts:qt,activeFontSize:ce}},tn.publish("preProcessText",Ue),F=Ue.text,Ft=(Ce=Ue.options).angle,Tn instanceof St==0&&Ft&&typeof Ft=="number"){Ft*=Math.PI/180,Ce.rotationDirection===0&&(Ft=-Ft),b===y&&(Ft=-Ft);var db=Math.cos(Ft),xu=Math.sin(Ft);Tn=new St(db,xu,-xu,db,0,0)}else Ft&&Ft instanceof St&&(Tn=Ft);b!==y||Tn||(Tn=Or),(pr=Ce.charSpace||Vg)!==void 0&&(gi+=T(M(pr))+` Tc `,this.setCharSpace(this.getCharSpace()||0)),(rs=Ce.horizontalScale)!==void 0&&(gi+=T(100*rs)+` Tz `),Ce.lang;var Ha=-1,hN=Ce.renderingMode!==void 0?Ce.renderingMode:Ce.stroke,Zg=_n.internal.getCurrentPageInfo().pageContext;switch(hN){case 0:case!1:case"fill":Ha=0;break;case 1:case!0:case"stroke":Ha=1;break;case 2:case"fillThenStroke":Ha=2;break;case 3:case"invisible":Ha=3;break;case 4:case"fillAndAddForClipping":Ha=4;break;case 5:case"strokeAndAddPathForClipping":Ha=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":Ha=6;break;case 7:case"addToPathForClipping":Ha=7}var pN=Zg.usedRenderingMode!==void 0?Zg.usedRenderingMode:-1;Ha!==-1?gi+=Ha+` Tr `:pN!==-1&&(gi+=`0 Tr `),Ha!==-1&&(Zg.usedRenderingMode=Ha),Pt=Ce.align||"left";var Il,bp=ce*ga,Ab=_n.internal.pageSize.getWidth(),ev=qt[ut];pr=Ce.charSpace||Vg,wr=Ce.maxWidth||0,rn=Object.assign({autoencode:!0,noBOM:!0},Ce.flags);var wp=[],fb=function(Rn){return _n.getStringUnitWidth(Rn,{font:ev,charSpace:pr,fontSize:ce,doKerning:!1})*ce/Od};if(Object.prototype.toString.call(F)==="[object Array]"){var $a;qe=mp(F),Pt!=="left"&&(Il=qe.map(fb));var yo,tv=0;if(Pt==="right"){q-=Il[0],F=[],va=qe.length;for(var ZA=0;ZA0?(wr-Il[ns])/hb:0;ns":")"),jp=parseFloat(qe[xa][1]),Sp=parseFloat(qe[xa][2]);break;case 0:tf=(mi?"<":"(")+qe[xa]+(mi?">":")"),jp=Ed(q),Sp=Td(Ae)}wp!==void 0&&wp[xa]!==void 0&&(rf=wp[xa]+` Tw `),xa===0?F.push(rf+iv(jp,Sp,Tn)+tf):Fd===0?F.push(rf+tf):Fd===1&&F.push(rf+iv(jp,Sp,Tn)+tf)}F=Fd===0?F.join(` Tj T* `):F.join(` Tj `),F+=` Tj `;var bu=`BT /`;return bu+=ut+" "+ce+` Tf `,bu+=T(ce*ga)+` TL `,bu+=vu+` `,bu+=gi,bu+=F,K(bu+="ET"),h[ut]=!0,_n};var iT=f.__private__.clip=f.clip=function(F){return K(F==="evenodd"?"W*":"W"),this};f.clipEvenOdd=function(){return iT("evenodd")},f.__private__.discardPath=f.discardPath=function(){return K("n"),this};var gu=f.__private__.isValidStyle=function(F){var q=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(F)!==-1&&(q=!0),q};f.__private__.setDefaultPathOperation=f.setDefaultPathOperation=function(F){return gu(F)&&(u=F),this};var oN=f.__private__.getStyle=f.getStyle=function(F){var q=u;switch(F){case"D":case"S":q="S";break;case"F":q="f";break;case"FD":case"DF":q="B";break;case"f":case"f*":case"B":case"B*":q=F}return q},Wg=f.close=function(){return K("h"),this};f.stroke=function(){return K("S"),this},f.fill=function(F){return Gg("f",F),this},f.fillEvenOdd=function(F){return Gg("f*",F),this},f.fillStroke=function(F){return Gg("B",F),this},f.fillStrokeEvenOdd=function(F){return Gg("B*",F),this};var Gg=function(F,q){Nn(q)==="object"?aT(q,F):K(F)},ib=function(F){F===null||b===y&&F===void 0||(F=oN(F),K(F))};function sT(F,q,Ae,Ce,Ee){var Ue=new xx(q||this.boundingBox,Ae||this.xStep,Ce||this.yStep,this.gState,Ee||this.matrix);Ue.stream=this.stream;var qe=F+"$$"+this.cloneIndex+++"$$";return fn(qe,Ue),Ue}var aT=function(F,q){var Ae=Vr[F.key],Ce=Mt[Ae];if(Ce instanceof tm)K("q"),K(oT(q)),Ce.gState&&f.setGState(Ce.gState),K(F.matrix.toString()+" cm"),K("/"+Ae+" sh"),K("Q");else if(Ce instanceof xx){var Ee=new St(1,0,0,-1,0,pp());F.matrix&&(Ee=Ee.multiply(F.matrix||Or),Ae=sT.call(Ce,F.key,F.boundingBox,F.xStep,F.yStep,Ee).id),K("q"),K("/Pattern cs"),K("/"+Ae+" scn"),Ce.gState&&f.setGState(Ce.gState),K(q),K("Q")}},oT=function(F){switch(F){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},qA=f.moveTo=function(F,q){return K(T(M(F))+" "+T(_(q))+" m"),this},lN=f.lineTo=function(F,q){return K(T(M(F))+" "+T(_(q))+" l"),this},XA=f.curveTo=function(F,q,Ae,Ce,Ee,Ue){return K([T(M(F)),T(_(q)),T(M(Ae)),T(_(Ce)),T(M(Ee)),T(_(Ue)),"c"].join(" ")),this};f.__private__.line=f.line=function(F,q,Ae,Ce,Ee){if(isNaN(F)||isNaN(q)||isNaN(Ae)||isNaN(Ce)||!gu(Ee))throw new Error("Invalid arguments passed to jsPDF.line");return b===x?this.lines([[Ae-F,Ce-q]],F,q,[1,1],Ee||"S"):this.lines([[Ae-F,Ce-q]],F,q,[1,1]).stroke()},f.__private__.lines=f.lines=function(F,q,Ae,Ce,Ee,Ue){var qe,Ft,Pt,pr,wr,rn,rs,Tn,_n,Xn,mi,gi;if(typeof F=="number"&&(gi=Ae,Ae=q,q=F,F=gi),Ce=Ce||[1,1],Ue=Ue||!1,isNaN(q)||isNaN(Ae)||!Array.isArray(F)||!Array.isArray(Ce)||!gu(Ee)||typeof Ue!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(qA(q,Ae),qe=Ce[0],Ft=Ce[1],pr=F.length,Xn=q,mi=Ae,Pt=0;Pt>8&255,e>>16&255,e>>24&255)},Jv.prototype.toHexString=function(e){return e.split("").map(function(t){return("0"+(255&t.charCodeAt(0)).toString(16)).slice(-2)}).join("")},Jv.prototype.hexToBytes=function(e){for(var t=[],r=0;r>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(n){return sR(r,n)}},x5.prototype.equals=function(e){var t,r="id,objectNumber,equals";if(!e||Nn(e)!==Nn(this))return!1;var n=0;for(t in this)if(!(r.indexOf(t)>=0)){if(this.hasOwnProperty(t)&&!e.hasOwnProperty(t)||this[t]!==e[t])return!1;n++}for(t in e)e.hasOwnProperty(t)&&r.indexOf(t)<0&&n--;return n===0},Wt.API={events:[]},Wt.version="4.2.1";var Ti=Wt.API,C7=1,$g=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Mv=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},jg=function(e){return e.toString().replace(/#/g,"#23").replace(/[\s\n\r()<>[\]{}\/%]/g,function(t){var r=t.charCodeAt(0).toString(16).toUpperCase();return"#"+(r.length===1?"0"+r:r)})},xr=function(e){return e.toFixed(2)},gf=function(e){return e.toFixed(5)};Ti.__acroform__={};var Wo=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},pJ=function(e){return e*C7},Bu=function(e){var t=new Yge,r=Bt.internal.getHeight(e)||0,n=Bt.internal.getWidth(e)||0;return t.BBox=[0,0,Number(xr(n)),Number(xr(r))],t},Wwt=Ti.__acroform__.setBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|1<0;){t="",s--;var u,d,A=gS("3",e,s).height,h=e.multiline?o-s:(o-A)/2,f=h+=2,m=0,p=0,g=0;if(s<=0){t=`(...) Tj `,t+="% Width of Text: "+gS(t,e,s=12).width+", FieldWidth:"+l+` `;break}for(var v="",x=0,y=0;yo)continue e;v+=i[y][g],b=!0,p=y,y--}else{v=(v+=i[y][g]+" ").substr(v.length-1)==" "?v.substr(0,v.length-1):v;var C=parseInt(y),j=c(C,v,s),S=y>=i.length-1;if(j&&!S){v+=" ",g=0;continue}if(j||S){if(S)p=C;else if(e.multiline&&(A+2)*(x+2)+2>o)continue e}else{if(!e.multiline||(A+2)*(x+2)+2>o)continue e;p=C}}for(var T="",B=m;B<=p;B++){var I=i[B];if(e.multiline){if(B===p){T+=I[g]+" ",g=(g+1)%I.length;continue}if(B===m){T+=I[I.length-1]+" ";continue}}T+=I[0]+" "}switch(T=T.substr(T.length-1)==" "?T.substr(0,T.length-1):T,d=gS(T,e,s).width,e.textAlign){case"right":u=l-d-2;break;case"center":u=(l-d)/2;break;default:u=2}t+=xr(u)+" "+xr(f)+` Td `,t+="("+$g(T)+`) Tj `,t+=-xr(u)+` 0 Td `,f=-(s+2),d=0,m=b?p:p+1,x++,v=""}break}return n.text=t,n.fontSize=s,n},gS=function(e,t,r){var n=t.scope.internal.getFont(t.fontName,t.fontStyle),i=t.scope.getStringUnitWidth(e,{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r);return{height:t.scope.getStringUnitWidth("3",{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r)*1.5,width:i}},Xwt={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},Ywt=function(e,t){var r={type:"reference",object:e};t.internal.getPageInfo(e.page).pageContext.annotations.find(function(n){return n.type===r.type&&n.object===r.object})===void 0&&t.internal.getPageInfo(e.page).pageContext.annotations.push(r)},Jwt=function(e,t){if(t.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||e.internal.acroformPlugin.isInitialized===!1)){if(fu.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(Xwt)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");C7=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new Jge,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",function(){(function(r){r.internal.events.unsubscribe(r.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete r.internal.acroformPlugin.acroFormDictionaryRoot._eventID,r.internal.acroformPlugin.printedOut=!0})(e)}),e.internal.events.subscribe("buildDocument",function(){(function(r){r.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var n=r.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var i in n)if(n.hasOwnProperty(i)){var s=n[i];s.objId=void 0,s.hasAnnotation&&Ywt(s,r)}})(e)}),e.internal.events.subscribe("putCatalog",function(){(function(r){if(r.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");r.internal.write("/AcroForm "+r.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(e)}),e.internal.events.subscribe("postPutPages",function(r){(function(n,i){var s=!n;for(var o in n||(i.internal.newObjectDeferredBegin(i.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),i.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),n=n||i.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(n.hasOwnProperty(o)){var l=n[o],c=[],u=l.Rect;if(l.Rect&&(l.Rect=Vwt(l.Rect,i)),i.internal.newObjectDeferredBegin(l.objId,!0),l.DA=Bt.createDefaultAppearanceStream(l),Nn(l)==="object"&&typeof l.getKeyValueListForStream=="function"&&(c=l.getKeyValueListForStream()),l.Rect=u,l.hasAppearanceStream&&!l.appearanceStreamContent){var d=qwt(l);c.push({key:"AP",value:"<>"}),i.internal.acroformPlugin.xForms.push(d)}if(l.appearanceStreamContent){var A="";for(var h in l.appearanceStreamContent)if(l.appearanceStreamContent.hasOwnProperty(h)){var f=l.appearanceStreamContent[h];if(A+="/"+h+" ",A+="<<",Object.keys(f).length>=1||Array.isArray(f)){for(var o in f)if(f.hasOwnProperty(o)){var m=f[o];typeof m=="function"&&(m=m.call(i,l)),A+="/"+o+" "+m+" ",i.internal.acroformPlugin.xForms.indexOf(m)>=0||i.internal.acroformPlugin.xForms.push(m)}}else typeof(m=f)=="function"&&(m=m.call(i,l)),A+="/"+o+" "+m,i.internal.acroformPlugin.xForms.indexOf(m)>=0||i.internal.acroformPlugin.xForms.push(m);A+=">>"}c.push({key:"AP",value:`<< `+A+">>"})}i.internal.putStream({additionalKeyValues:c,objectId:l.objId}),i.internal.out("endobj")}s&&function(p,g){for(var v in p)if(p.hasOwnProperty(v)){var x=v,y=p[v];g.internal.newObjectDeferredBegin(y.objId,!0),Nn(y)==="object"&&typeof y.putStream=="function"&&y.putStream(),delete p[x]}}(i.internal.acroformPlugin.xForms,i)})(r,e)}),e.internal.acroformPlugin.isInitialized=!0}},Xge=Ti.__acroform__.arrayToPdfArray=function(e,t,r){var n=function(o){return o};if(Array.isArray(e)){for(var i="[",s=0;s0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var r=function(n){return n};return this.scope&&(r=this.scope.internal.getEncryptor(this.objId)),"("+$g(r(e))+")"}},set:function(r){e=r}})};Wo(Jge,Gu);var fu=function e(){Gu.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(v){if(isNaN(v))throw new Error('Invalid value "'+v+'" for attribute F supplied.');t=v}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!Gi(t,3)},set:function(v){v?this.F=Ki(t,3):this.F=Vi(t,3)}});var r=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return r},set:function(v){if(isNaN(v))throw new Error('Invalid value "'+v+'" for attribute Ff supplied.');r=v}});var n=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(n.length!==0)return n},set:function(v){n=v!==void 0?v:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[0])?0:n[0]},set:function(v){n[0]=v}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[1])?0:n[1]},set:function(v){n[1]=v}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[2])?0:n[2]},set:function(v){n[2]=v}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[3])?0:n[3]},set:function(v){n[3]=v}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(v){switch(v){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=v;break;default:throw new Error('Invalid value "'+v+'" for attribute FT supplied.')}}});var s=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!s||s.length<1){if(this instanceof y5)return;s="FieldObject"+e.FieldNum++}var v=function(x){return x};return this.scope&&(v=this.scope.internal.getEncryptor(this.objId)),"("+$g(v(s))+")"},set:function(v){s=v.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return s},set:function(v){s=v}});var o="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return o},set:function(v){o=v}});var l="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return l},set:function(v){l=v}});var c=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return c},set:function(v){c=v}});var u=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return u===void 0?50/C7:u},set:function(v){u=v}});var d="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return d},set:function(v){d=v}});var A="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!A||this instanceof y5||this instanceof Gm))return K3(A,this.objId,this.scope)},set:function(v){v=v.toString(),A=v}});var h=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(h)return this instanceof Ds==0?K3(h,this.objId,this.scope):h},set:function(v){v=v.toString(),h=this instanceof Ds==0?v.substr(0,1)==="("?Mv(v.substr(1,v.length-2)):Mv(v):v}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ds==1?Mv(h.substr(1,h.length-1)):h},set:function(v){v=v.toString(),h=this instanceof Ds==1?"/"+jg(v):v}});var f=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(f)return f},set:function(v){this.V=v}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(f)return this instanceof Ds==0?K3(f,this.objId,this.scope):f},set:function(v){v=v.toString(),f=this instanceof Ds==0?v.substr(0,1)==="("?Mv(v.substr(1,v.length-2)):Mv(v):v}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ds==1?Mv(f.substr(1,f.length-1)):f},set:function(v){v=v.toString(),f=this instanceof Ds==1?"/"+jg(v):v}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var m,p=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return p},set:function(v){v=!!v,p=v}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(m)return m},set:function(v){m=v}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,1)},set:function(v){v?this.Ff=Ki(this.Ff,1):this.Ff=Vi(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,2)},set:function(v){v?this.Ff=Ki(this.Ff,2):this.Ff=Vi(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,3)},set:function(v){v?this.Ff=Ki(this.Ff,3):this.Ff=Vi(this.Ff,3)}});var g=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(g!==null)return g},set:function(v){if([0,1,2].indexOf(v)===-1)throw new Error('Invalid value "'+v+'" for attribute Q supplied.');g=v}}),Object.defineProperty(this,"textAlign",{get:function(){var v;switch(g){case 0:default:v="left";break;case 1:v="center";break;case 2:v="right"}return v},configurable:!0,enumerable:!0,set:function(v){switch(v){case"right":case 2:g=2;break;case"center":case 1:g=1;break;default:g=0}}})};Wo(fu,Gu);var Vx=function(){fu.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(r){e=r}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(r){e=r}});var t=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return Xge(t,this.objId,this.scope)},set:function(r){var n,i;i=[],typeof(n=r)=="string"&&(i=function(s,o,l){l||(l=1);for(var c,u=[];c=o.exec(s);)u.push(c[l]);return u}(n,/\((.*?)\)/g)),t=i}}),this.getOptions=function(){return t},this.setOptions=function(r){t=r,this.sort&&t.sort()},this.addOption=function(r){r=(r=r||"").toString(),t.push(r),this.sort&&t.sort()},this.removeOption=function(r,n){for(n=n||!1,r=(r=r||"").toString();t.indexOf(r)!==-1&&(t.splice(t.indexOf(r),1),n!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,18)},set:function(r){r?this.Ff=Ki(this.Ff,18):this.Ff=Vi(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,19)},set:function(r){this.combo===!0&&(r?this.Ff=Ki(this.Ff,19):this.Ff=Vi(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,20)},set:function(r){r?(this.Ff=Ki(this.Ff,20),t.sort()):this.Ff=Vi(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,22)},set:function(r){r?this.Ff=Ki(this.Ff,22):this.Ff=Vi(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,23)},set:function(r){r?this.Ff=Ki(this.Ff,23):this.Ff=Vi(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,27)},set:function(r){r?this.Ff=Ki(this.Ff,27):this.Ff=Vi(this.Ff,27)}}),this.hasAppearanceStream=!1};Wo(Vx,fu);var qx=function(){Vx.call(this),this.fontName="helvetica",this.combo=!1};Wo(qx,Vx);var Xx=function(){qx.call(this),this.combo=!0};Wo(Xx,qx);var oB=function(){Xx.call(this),this.edit=!0};Wo(oB,Xx);var Ds=function(){fu.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,15)},set:function(r){r?this.Ff=Ki(this.Ff,15):this.Ff=Vi(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,16)},set:function(r){r?this.Ff=Ki(this.Ff,16):this.Ff=Vi(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,17)},set:function(r){r?this.Ff=Ki(this.Ff,17):this.Ff=Vi(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,26)},set:function(r){r?this.Ff=Ki(this.Ff,26):this.Ff=Vi(this.Ff,26)}});var e,t={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var r=function(s){return s};if(this.scope&&(r=this.scope.internal.getEncryptor(this.objId)),Object.keys(t).length!==0){var n,i=[];for(n in i.push("<<"),t)i.push("/"+n+" ("+$g(r(t[n]))+")");return i.push(">>"),i.join(` `)}},set:function(r){Nn(r)==="object"&&(t=r)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||""},set:function(r){typeof r=="string"&&(t.CA=r)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(r){var n=r==null?"":r.toString();n.substr(0,1)==="/"&&(n=n.substr(1)),e="/"+jg(n)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(r){e="/"+jg(r)}})};Wo(Ds,fu);var lB=function(){Ds.call(this),this.pushButton=!0};Wo(lB,Ds);var Yx=function(){Ds.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t!==void 0?t:[]}})};Wo(Yx,Ds);var y5=function(){var e,t;fu.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(i){e=i}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(i){t=i}});var r,n={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var i=function(l){return l};this.scope&&(i=this.scope.internal.getEncryptor(this.objId));var s,o=[];for(s in o.push("<<"),n)o.push("/"+s+" ("+$g(i(n[s]))+")");return o.push(">>"),o.join(` `)},set:function(i){Nn(i)==="object"&&(n=i)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(i){typeof i=="string"&&(n.CA=i)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return r},set:function(i){var s=i==null?"":i.toString();s.substr(0,1)==="/"&&(s=s.substr(1)),r="/"+jg(s)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return r.substr(1,r.length-1)},set:function(i){var s=i==null?"":i.toString();s.substr(0,1)==="/"&&(s=s.substr(1)),r="/"+jg(s)}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=Bt.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Wo(y5,fu),Yx.prototype.setAppearance=function(e){if(!("createAppearanceStream"in e)||!("getCA"in e))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var t in this.Kids)if(this.Kids.hasOwnProperty(t)){var r=this.Kids[t];r.appearanceStreamContent=e.createAppearanceStream(r.optionName),r.caption=e.getCA()}},Yx.prototype.createOption=function(e){var t=new y5;return t.Parent=this,t.optionName=e,this.Kids.push(t),Zwt.call(this.scope,t),t};var cB=function(){Ds.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Bt.CheckBox.createAppearanceStream()};Wo(cB,Ds);var Gm=function(){fu.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,13)},set:function(t){t?this.Ff=Ki(this.Ff,13):this.Ff=Vi(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,21)},set:function(t){t?this.Ff=Ki(this.Ff,21):this.Ff=Vi(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,23)},set:function(t){t?this.Ff=Ki(this.Ff,23):this.Ff=Vi(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,24)},set:function(t){t?this.Ff=Ki(this.Ff,24):this.Ff=Vi(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,25)},set:function(t){t?this.Ff=Ki(this.Ff,25):this.Ff=Vi(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,26)},set:function(t){t?this.Ff=Ki(this.Ff,26):this.Ff=Vi(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Wo(Gm,fu);var uB=function(){Gm.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!Gi(this.Ff,14)},set:function(e){e?this.Ff=Ki(this.Ff,14):this.Ff=Vi(this.Ff,14)}}),this.password=!0};Wo(uB,Gm);var Bt={CheckBox:{createAppearanceStream:function(){return{N:{On:Bt.CheckBox.YesNormal},D:{On:Bt.CheckBox.YesPushDown,Off:Bt.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=Bu(e);t.scope=e.scope;var r=[],n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,i=e.scope.__private__.encodeColorString(e.color),s=aR(e,e.caption);return r.push("0.749023 g"),r.push("0 0 "+xr(Bt.internal.getWidth(e))+" "+xr(Bt.internal.getHeight(e))+" re"),r.push("f"),r.push("BMC"),r.push("q"),r.push("0 0 1 rg"),r.push("/"+n+" "+xr(s.fontSize)+" Tf "+i),r.push("BT"),r.push(s.text),r.push("ET"),r.push("Q"),r.push("EMC"),t.stream=r.join(` `),t},YesNormal:function(e){var t=Bu(e);t.scope=e.scope;var r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color),i=[],s=Bt.internal.getHeight(e),o=Bt.internal.getWidth(e),l=aR(e,e.caption);return i.push("1 g"),i.push("0 0 "+xr(o)+" "+xr(s)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+xr(o-1)+" "+xr(s-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+r+" "+xr(l.fontSize)+" Tf "+n),i.push(l.text),i.push("ET"),i.push("Q"),t.stream=i.join(` `),t},OffPushDown:function(e){var t=Bu(e);t.scope=e.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+xr(Bt.internal.getWidth(e))+" "+xr(Bt.internal.getHeight(e))+" re"),r.push("f"),t.stream=r.join(` `),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:Bt.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=Bt.RadioButton.Circle.YesNormal,t.D[e]=Bt.RadioButton.Circle.YesPushDown,t},getCA:function(){return"l"},YesNormal:function(e){var t=Bu(e);t.scope=e.scope;var r=[],n=Bt.internal.getWidth(e)<=Bt.internal.getHeight(e)?Bt.internal.getWidth(e)/4:Bt.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var i=Bt.internal.Bezier_C,s=Number((n*i).toFixed(5));return r.push("q"),r.push("1 0 0 1 "+gf(Bt.internal.getWidth(e)/2)+" "+gf(Bt.internal.getHeight(e)/2)+" cm"),r.push(n+" 0 m"),r.push(n+" "+s+" "+s+" "+n+" 0 "+n+" c"),r.push("-"+s+" "+n+" -"+n+" "+s+" -"+n+" 0 c"),r.push("-"+n+" -"+s+" -"+s+" -"+n+" 0 -"+n+" c"),r.push(s+" -"+n+" "+n+" -"+s+" "+n+" 0 c"),r.push("f"),r.push("Q"),t.stream=r.join(` `),t},YesPushDown:function(e){var t=Bu(e);t.scope=e.scope;var r=[],n=Bt.internal.getWidth(e)<=Bt.internal.getHeight(e)?Bt.internal.getWidth(e)/4:Bt.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var i=Number((2*n).toFixed(5)),s=Number((i*Bt.internal.Bezier_C).toFixed(5)),o=Number((n*Bt.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+gf(Bt.internal.getWidth(e)/2)+" "+gf(Bt.internal.getHeight(e)/2)+" cm"),r.push(i+" 0 m"),r.push(i+" "+s+" "+s+" "+i+" 0 "+i+" c"),r.push("-"+s+" "+i+" -"+i+" "+s+" -"+i+" 0 c"),r.push("-"+i+" -"+s+" -"+s+" -"+i+" 0 -"+i+" c"),r.push(s+" -"+i+" "+i+" -"+s+" "+i+" 0 c"),r.push("f"),r.push("Q"),r.push("0 g"),r.push("q"),r.push("1 0 0 1 "+gf(Bt.internal.getWidth(e)/2)+" "+gf(Bt.internal.getHeight(e)/2)+" cm"),r.push(n+" 0 m"),r.push(n+" "+o+" "+o+" "+n+" 0 "+n+" c"),r.push("-"+o+" "+n+" -"+n+" "+o+" -"+n+" 0 c"),r.push("-"+n+" -"+o+" -"+o+" -"+n+" 0 -"+n+" c"),r.push(o+" -"+n+" "+n+" -"+o+" "+n+" 0 c"),r.push("f"),r.push("Q"),t.stream=r.join(` `),t},OffPushDown:function(e){var t=Bu(e);t.scope=e.scope;var r=[],n=Bt.internal.getWidth(e)<=Bt.internal.getHeight(e)?Bt.internal.getWidth(e)/4:Bt.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var i=Number((2*n).toFixed(5)),s=Number((i*Bt.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+gf(Bt.internal.getWidth(e)/2)+" "+gf(Bt.internal.getHeight(e)/2)+" cm"),r.push(i+" 0 m"),r.push(i+" "+s+" "+s+" "+i+" 0 "+i+" c"),r.push("-"+s+" "+i+" -"+i+" "+s+" -"+i+" 0 c"),r.push("-"+i+" -"+s+" -"+s+" -"+i+" 0 -"+i+" c"),r.push(s+" -"+i+" "+i+" -"+s+" "+i+" 0 c"),r.push("f"),r.push("Q"),t.stream=r.join(` `),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:Bt.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=Bt.RadioButton.Cross.YesNormal,t.D[e]=Bt.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=Bu(e);t.scope=e.scope;var r=[],n=Bt.internal.calculateCross(e);return r.push("q"),r.push("1 1 "+xr(Bt.internal.getWidth(e)-2)+" "+xr(Bt.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(xr(n.x1.x)+" "+xr(n.x1.y)+" m"),r.push(xr(n.x2.x)+" "+xr(n.x2.y)+" l"),r.push(xr(n.x4.x)+" "+xr(n.x4.y)+" m"),r.push(xr(n.x3.x)+" "+xr(n.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join(` `),t},YesPushDown:function(e){var t=Bu(e);t.scope=e.scope;var r=Bt.internal.calculateCross(e),n=[];return n.push("0.749023 g"),n.push("0 0 "+xr(Bt.internal.getWidth(e))+" "+xr(Bt.internal.getHeight(e))+" re"),n.push("f"),n.push("q"),n.push("1 1 "+xr(Bt.internal.getWidth(e)-2)+" "+xr(Bt.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(xr(r.x1.x)+" "+xr(r.x1.y)+" m"),n.push(xr(r.x2.x)+" "+xr(r.x2.y)+" l"),n.push(xr(r.x4.x)+" "+xr(r.x4.y)+" m"),n.push(xr(r.x3.x)+" "+xr(r.x3.y)+" l"),n.push("s"),n.push("Q"),t.stream=n.join(` `),t},OffPushDown:function(e){var t=Bu(e);t.scope=e.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+xr(Bt.internal.getWidth(e))+" "+xr(Bt.internal.getHeight(e))+" re"),r.push("f"),t.stream=r.join(` `),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+r}};Bt.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=Bt.internal.getWidth(e),r=Bt.internal.getHeight(e),n=Math.min(t,r);return{x1:{x:(t-n)/2,y:(r-n)/2+n},x2:{x:(t-n)/2+n,y:(r-n)/2},x3:{x:(t-n)/2,y:(r-n)/2},x4:{x:(t-n)/2+n,y:(r-n)/2+n}}}},Bt.internal.getWidth=function(e){var t=0;return Nn(e)==="object"&&(t=pJ(e.Rect[2])),t},Bt.internal.getHeight=function(e){var t=0;return Nn(e)==="object"&&(t=pJ(e.Rect[3])),t};var Zwt=Ti.addField=function(e){if(Jwt(this,e),!(e instanceof fu))throw new Error("Invalid argument passed to jsPDF.addField.");var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};Ti.AcroFormChoiceField=Vx,Ti.AcroFormListBox=qx,Ti.AcroFormComboBox=Xx,Ti.AcroFormEditBox=oB,Ti.AcroFormButton=Ds,Ti.AcroFormPushButton=lB,Ti.AcroFormRadioButton=Yx,Ti.AcroFormCheckBox=cB,Ti.AcroFormTextField=Gm,Ti.AcroFormPasswordField=uB,Ti.AcroFormAppearance=Bt,Ti.AcroForm={ChoiceField:Vx,ListBox:qx,ComboBox:Xx,EditBox:oB,Button:Ds,PushButton:lB,RadioButton:Yx,CheckBox:cB,TextField:Gm,PasswordField:uB,Appearance:Bt},Wt.AcroForm={ChoiceField:Vx,ListBox:qx,ComboBox:Xx,EditBox:oB,Button:Ds,PushButton:lB,RadioButton:Yx,CheckBox:cB,TextField:Gm,PasswordField:uB,Appearance:Bt};function Zge(e){return e.reduce(function(t,r,n){return t[r]=n,t},{})}(function(e){var t="addImage_";e.__addimage__={};var r="UNKNOWN",n={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},i=e.__addimage__.getImageFileTypeByImageData=function(P,E){var M,_,R,G,U,Q=r;if((E=E||r)==="RGBA"||P.data!==void 0&&P.data instanceof Uint8ClampedArray&&"height"in P&&"width"in P)return"RGBA";if(j(P))for(U in n)for(R=n[U],M=0;M>"}),"transparency"in E&&Array.isArray(E.transparency)&&E.transparency.length>0){for(var U="",Q=0,z=E.transparency.length;Q>",p.content=s;var y=p.objId+" 0 R";s="<>";else if(n.options.pageNumber)switch(s="<=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(p){return o(p)&&s(p)&&t[p.charCodeAt(0)].length>=1};var u=e.__arabicParser__.arabicLetterHasFinalForm=function(p){return o(p)&&s(p)&&t[p.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(p){return o(p)&&s(p)&&t[p.charCodeAt(0)].length>=3};var d=e.__arabicParser__.arabicLetterHasMedialForm=function(p){return o(p)&&s(p)&&t[p.charCodeAt(0)].length==4},A=e.__arabicParser__.resolveLigatures=function(p){var g=0,v=r,x="",y=0;for(g=0;g>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+t+" 0 R")})),this},function(e){var t=function(){var r=void 0;Object.defineProperty(this,"pdf",{get:function(){return r},set:function(l){r=l}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(l){n=isNaN(l)||Number.isInteger(l)===!1||l<0?150:l,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var i=300;Object.defineProperty(this,"height",{get:function(){return i},set:function(l){i=isNaN(l)||Number.isInteger(l)===!1||l<0?300:l,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=i+1)}});var s=[];Object.defineProperty(this,"childNodes",{get:function(){return s},set:function(l){s=l}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(l){o=l}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(r,n){var i;if((r=r||"2d")!=="2d")return null;for(i in n)this.pdf.context2d.hasOwnProperty(i)&&(this.pdf.context2d[i]=n[i]);return this.pdf.context2d._canvas=this,this.pdf.context2d},t.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new t,this.canvas.pdf=this}])}(Wt.API),function(e){var t={left:0,top:0,bottom:0,right:0},r=!1,n=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},t),this.internal.__cell__.margins.width=this.getPageWidth(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new s,this.internal.__cell__.pages=1},s=function(){var c=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return c},set:function(p){c=p}});var u=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return u},set:function(p){u=p}});var d=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return d},set:function(p){d=p}});var A=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return A},set:function(p){A=p}});var h=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return h},set:function(p){h=p}});var f=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return f},set:function(p){f=p}});var m=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return m},set:function(p){m=p}}),this};s.prototype.clone=function(){return new s(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},s.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(c){return n.call(this),this.internal.__cell__.headerFunction=typeof c=="function"?c:void 0,this},e.getTextDimensions=function(c,u){n.call(this);var d=(u=u||{}).fontSize||this.getFontSize(),A=u.font||this.getFont(),h=u.scaleFactor||this.internal.scaleFactor,f=0,m=0,p=0,g=this;if(!Array.isArray(c)&&typeof c!="string"){if(typeof c!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");c=String(c)}var v=u.maxWidth;v>0?typeof c=="string"?c=this.splitTextToSize(c,v):Object.prototype.toString.call(c)==="[object Array]"&&(c=c.reduce(function(y,b){return y.concat(g.splitTextToSize(b,v))},[])):c=Array.isArray(c)?c:[c];for(var x=0;xthis.getPageHeight()?(this.cellAddPage(),c.y=A.top,f&&h&&(this.printHeaderRow(c.lineNumber,!0),c.y+=h[0].height)):c.y=u.y+u.height||c.y),c.text[0]!==void 0&&(this.rect(c.x,c.y,c.width,c.height,r===!0?"FD":void 0),c.align==="right"?this.text(c.text,c.x+c.width-d,c.y+d,{align:"right",baseline:"top"}):c.align==="center"?this.text(c.text,c.x+c.width/2,c.y+d,{align:"center",baseline:"top",maxWidth:c.width-d-d}):this.text(c.text,c.x+d,c.y+d,{align:"left",baseline:"top",maxWidth:c.width-d-d})),this.internal.__cell__.lastCell=c,this};e.table=function(c,u,d,A,h){if(n.call(this),!d)throw new Error("No data for PDF table.");var f,m,p,g,v=[],x=[],y=[],b={},C={},j=[],S=[],T=(h=h||{}).autoSize||!1,B=h.printHeaders!==!1,I=h.css&&h.css["font-size"]!==void 0?16*h.css["font-size"]:h.fontSize||12,P=h.margins||Object.assign({width:this.getPageWidth()},t),E=typeof h.padding=="number"?h.padding:3,M=h.headerBackgroundColor||"#c8c8c8",_=h.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=B,this.internal.__cell__.margins=P,this.internal.__cell__.table_font_size=I,this.internal.__cell__.padding=E,this.internal.__cell__.headerBackgroundColor=M,this.internal.__cell__.headerTextColor=_,this.setFontSize(I),A==null)x=v=Object.keys(d[0]),y=v.map(function(){return"left"});else if(Array.isArray(A)&&Nn(A[0])==="object")for(v=A.map(function(Y){return Y.name}),x=A.map(function(Y){return Y.prompt||Y.name||""}),y=A.map(function(Y){return Y.align||"left"}),f=0;f0&&this.setTableHeaderRow(h),this.setFont(void 0,"normal"),r=!1}}(Wt.API);var eve={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},tve=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],oR=Zge(tve),rve=[100,200,300,400,500,600,700,800,900],e1t=Zge(rve);function V3(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),r=function(s){return eve[s=s||"normal"]?s:"normal"}(e.style),n=function(s){return s?typeof s=="number"?s>=100&&s<=900&&s%100==0?s:400:/^\d00$/.test(s)?parseInt(s):s==="bold"?700:400:400}(e.weight),i=function(s){return typeof oR[s=s||"normal"]=="number"?s:"normal"}(e.stretch);return{family:t,style:r,weight:n,stretch:i,src:e.src||[],ref:e.ref||{name:t,style:[i,r,n].join(" ")}}}function mJ(e,t,r,n){var i;for(i=r;i>=0&&i=0&&i>>1)&255}return i}function BJ(e,t,r){var n=e.length,i=[];i[0]=4;for(var s=0;s>s&o}function _J(e,t,r,n){var i=r*n,s=Math.floor(i/8),o=16-(i-8*s+n),l=(1<>8&255;u.setUint8(d,h)}})(e,s,nve(e,s)&~(l<>7,o=1<<1+(7&i);e[t++],e[t++];var l=null,c=null;s&&(l=t,c=o,t+=3*o);var u=!0,d=[],A=0,h=null,f=0,m=null;for(this.width=r,this.height=n;u&&t=0))throw Error("Invalid block size");if(P===0)break;t+=P}break;case 249:if(e[t++]!==4||e[t+4]!==0)throw new Error("Invalid graphics extension block.");var p=e[t++];A=e[t++]|e[t++]<<8,h=e[t++],1&p||(h=null),f=p>>2&7,t++;break;case 254:for(;;){if(!((P=e[t++])>=0))throw Error("Invalid block size");if(P===0)break;t+=P}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var g=e[t++]|e[t++]<<8,v=e[t++]|e[t++]<<8,x=e[t++]|e[t++]<<8,y=e[t++]|e[t++]<<8,b=e[t++],C=b>>6&1,j=1<<1+(7&b),S=l,T=c,B=!1;b>>7&&(B=!0,S=t,T=j,t+=3*j);var I=t;for(t++;;){var P;if(!((P=e[t++])>=0))throw Error("Invalid block size");if(P===0)break;t+=P}d.push({x:g,y:v,width:x,height:y,has_local_palette:B,palette_offset:S,palette_size:T,data_offset:I,data_length:t-I,transparent_index:h,interlaced:!!C,delay:A,disposal:f});break;case 59:u=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return d.length},this.loopCount=function(){return m},this.frameInfo=function(E){if(E<0||E>=d.length)throw new Error("Frame index out of range.");return d[E]},this.decodeAndBlitFrameBGRA=function(E,M){var _=this.frameInfo(E),R=_.width*_.height;if(R>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var G=new Uint8Array(R);kJ(e,_.data_offset,G,R);var U=_.palette_offset,Q=_.transparent_index;Q===null&&(Q=256);var z=_.width,Y=r-z,$=z,O=4*(_.y*r+_.x),W=4*((_.y+_.height)*r+_.x),V=O,X=4*Y;_.interlaced===!0&&(X+=4*r*7);for(var ne=8,oe=0,pe=G.length;oe=W&&(X=4*Y+4*r*(ne-1),V=O+(z+Y)*(ne<<1),ne>>=1)),de===Q)V+=4;else{var ge=e[U+3*de],ie=e[U+3*de+1],ue=e[U+3*de+2];M[V++]=ue,M[V++]=ie,M[V++]=ge,M[V++]=255}--$}},this.decodeAndBlitFrameRGBA=function(E,M){var _=this.frameInfo(E),R=_.width*_.height;if(R>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var G=new Uint8Array(R);kJ(e,_.data_offset,G,R);var U=_.palette_offset,Q=_.transparent_index;Q===null&&(Q=256);var z=_.width,Y=r-z,$=z,O=4*(_.y*r+_.x),W=4*((_.y+_.height)*r+_.x),V=O,X=4*Y;_.interlaced===!0&&(X+=4*r*7);for(var ne=8,oe=0,pe=G.length;oe=W&&(X=4*Y+4*r*(ne-1),V=O+(z+Y)*(ne<<1),ne>>=1)),de===Q)V+=4;else{var ge=e[U+3*de],ie=e[U+3*de+1],ue=e[U+3*de+2];M[V++]=ge,M[V++]=ie,M[V++]=ue,M[V++]=255}--$}}}function kJ(e,t,r,n){for(var i=e[t++],s=1<>=c,d-=c,g!==s){if(g===o)break;for(var v=gs;)y=m[y]>>8,++x;var b=y;if(h+x+(v!==g?1:0)>n)return void In.log("Warning, gif stream longer than expected.");r[h++]=b;var C=h+=x;for(v!==g&&(r[h++]=b),y=v;x--;)y=m[y],r[--C]=255&y,y>>=8;p!==null&&l<4096&&(m[l++]=p<<8|b,l>=u+1&&c<12&&(++c,u=u<<1|1)),p=g}else l=o+1,u=(1<<(c=i+1))-1,p=null}return h!==n&&In.log("Warning, gif stream shorter than expected."),r}/** * @license Copyright (c) 2008, Adobe Systems Incorporated All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Adobe Systems Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */function Y3(e){var t,r,n,i,s,o=Math.floor,l=new Array(64),c=new Array(64),u=new Array(64),d=new Array(64),A=new Array(65535),h=new Array(65535),f=new Array(64),m=new Array(64),p=[],g=0,v=7,x=new Array(64),y=new Array(64),b=new Array(64),C=new Array(256),j=new Array(2048),S=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],T=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],B=[0,1,2,3,4,5,6,7,8,9,10,11],I=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],P=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],E=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],M=[0,1,2,3,4,5,6,7,8,9,10,11],_=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],R=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function G(O,W){for(var V=0,X=0,ne=new Array,oe=1;oe<=16;oe++){for(var pe=1;pe<=O[oe];pe++)ne[W[X]]=[],ne[W[X]][0]=V,ne[W[X]][1]=oe,X++,V++;V*=2}return ne}function U(O){for(var W=O[0],V=O[1]-1;V>=0;)W&1<>8&255),Q(255&O)}function Y(O,W,V,X,ne){for(var oe,pe=ne[0],de=ne[240],ge=function(ce,be){var je,xe,Ie,Ke,De,Ve,ht,ft,ut,Qt,dt=0;for(ut=0;ut<8;++ut){je=ce[dt],xe=ce[dt+1],Ie=ce[dt+2],Ke=ce[dt+3],De=ce[dt+4],Ve=ce[dt+5],ht=ce[dt+6];var Sr=je+(ft=ce[dt+7]),Tt=je-ft,qt=xe+ht,nr=xe-ht,hr=Ie+Ve,Mt=Ie-Ve,Vr=Ke+De,Ht=Ke-De,$t=Sr+Vr,zr=Sr-Vr,Zt=qt+hr,yt=qt-hr;ce[dt]=$t+Zt,ce[dt+4]=$t-Zt;var tn=.707106781*(yt+zr);ce[dt+2]=zr+tn,ce[dt+6]=zr-tn;var Kt=.382683433*(($t=Ht+Mt)-(yt=nr+Tt)),ir=.5411961*$t+Kt,Wr=1.306562965*yt+Kt,Bn=.707106781*(Zt=Mt+nr),St=Tt+Bn,es=Tt-Bn;ce[dt+5]=es+ir,ce[dt+3]=es-ir,ce[dt+1]=St+Wr,ce[dt+7]=St-Wr,dt+=8}for(dt=0,ut=0;ut<8;++ut){je=ce[dt],xe=ce[dt+8],Ie=ce[dt+16],Ke=ce[dt+24],De=ce[dt+32],Ve=ce[dt+40],ht=ce[dt+48];var Or=je+(ft=ce[dt+56]),fn=je-ft,hi=xe+ht,qn=xe-ht,ji=Ie+Ve,ts=Ie-Ve,pu=Ke+De,mu=Ke-De,pi=Or+pu,Is=Or-pu,vo=hi+ji,xo=hi-ji;ce[dt]=pi+vo,ce[dt+32]=pi-vo;var ha=.707106781*(xo+Is);ce[dt+16]=Is+ha,ce[dt+48]=Is-ha;var Tl=.382683433*((pi=mu+ts)-(xo=qn+fn)),qs=.5411961*pi+Tl,Pl=1.306562965*xo+Tl,pa=.707106781*(vo=ts+qn),jd=fn+pa,Sd=fn-pa;ce[dt+40]=Sd+qs,ce[dt+24]=Sd-qs,ce[dt+8]=jd+Pl,ce[dt+56]=jd-Pl,dt++}for(ut=0;ut<64;++ut)Qt=ce[ut]*be[ut],f[ut]=Qt>0?Qt+.5|0:Qt-.5|0;return f}(O,W),ie=0;ie<64;++ie)m[S[ie]]=ge[ie];var ue=m[0]-V;V=m[0],ue==0?U(X[0]):(U(X[h[oe=32767+ue]]),U(A[oe]));for(var Se=63;Se>0&&m[Se]==0;)Se--;if(Se==0)return U(pe),V;for(var D,K=1;K<=Se;){for(var we=K;m[K]==0&&K<=Se;)++K;var ae=K-we;if(ae>=16){D=ae>>4;for(var te=1;te<=D;++te)U(de);ae&=15}oe=32767+m[K],U(ne[(ae<<4)+h[oe]]),U(A[oe]),K++}return Se!=63&&U(pe),V}function $(O){O=Math.min(Math.max(O,1),100),s!=O&&(function(W){for(var V=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],X=0;X<64;X++){var ne=o((V[X]*W+50)/100);ne=Math.min(Math.max(ne,1),255),l[S[X]]=ne}for(var oe=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],pe=0;pe<64;pe++){var de=o((oe[pe]*W+50)/100);de=Math.min(Math.max(de,1),255),c[S[pe]]=de}for(var ge=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],ie=0,ue=0;ue<8;ue++)for(var Se=0;Se<8;Se++)u[ie]=1/(l[S[ie]]*ge[ue]*ge[Se]*8),d[ie]=1/(c[S[ie]]*ge[ue]*ge[Se]*8),ie++}(O<50?Math.floor(5e3/O):Math.floor(200-2*O)),s=O)}this.encode=function(O,W){W&&$(W),p=new Array,g=0,v=7,z(65496),z(65504),z(16),Q(74),Q(70),Q(73),Q(70),Q(0),Q(1),Q(1),Q(0),z(1),z(1),Q(0),Q(0),function(){z(65499),z(132),Q(0);for(var xe=0;xe<64;xe++)Q(l[xe]);Q(1);for(var Ie=0;Ie<64;Ie++)Q(c[Ie])}(),function(xe,Ie){z(65472),z(17),Q(8),z(Ie),z(xe),Q(3),Q(1),Q(17),Q(0),Q(2),Q(17),Q(1),Q(3),Q(17),Q(1)}(O.width,O.height),function(){z(65476),z(418),Q(0);for(var xe=0;xe<16;xe++)Q(T[xe+1]);for(var Ie=0;Ie<=11;Ie++)Q(B[Ie]);Q(16);for(var Ke=0;Ke<16;Ke++)Q(I[Ke+1]);for(var De=0;De<=161;De++)Q(P[De]);Q(1);for(var Ve=0;Ve<16;Ve++)Q(E[Ve+1]);for(var ht=0;ht<=11;ht++)Q(M[ht]);Q(17);for(var ft=0;ft<16;ft++)Q(_[ft+1]);for(var ut=0;ut<=161;ut++)Q(R[ut])}(),z(65498),z(12),Q(3),Q(1),Q(0),Q(2),Q(17),Q(3),Q(17),Q(0),Q(63),Q(0);var V=0,X=0,ne=0;g=0,v=7,this.encode.displayName="_encode_";for(var oe,pe,de,ge,ie,ue,Se,D,K,we=O.data,ae=O.width,te=O.height,ce=4*ae,be=0;be>3)*ce+(Se=4*(7&K)),be+D>=te&&(ue-=ce*(be+1+D-te)),oe+Se>=ce&&(ue-=oe+Se-ce+4),pe=we[ue++],de=we[ue++],ge=we[ue++],x[K]=(j[pe]+j[de+256|0]+j[ge+512|0]>>16)-128,y[K]=(j[pe+768|0]+j[de+1024|0]+j[ge+1280|0]>>16)-128,b[K]=(j[pe+1280|0]+j[de+1536|0]+j[ge+1792|0]>>16)-128;V=Y(x,u,V,t,n),X=Y(y,d,X,r,i),ne=Y(b,d,ne,r,i),oe+=32}be+=8}if(v>=0){var je=[];je[1]=v+1,je[0]=(1<E;E++)if(B[I+E]!=P.charCodeAt(E))return!0;return!1}function n(B,I,P,E,M){for(var _=0;__+1?[]:new I),!(R.length<_+1));U++)E(M[U],_+1,R)}(P,0,B),P}var c=function(){var B=this;function I(N,k){for(var L=1<>>0;N&L;)L>>>=1;return L?(N&L-1)+L:N}function P(N,k,L,H,J){t(!(H%L));do N[k+(H-=L)]=J;while(0=J),512>=J)var Z=s(512);else if((Z=s(J))==null)return 0;return function(ee,se,le,fe,Be,Fe){var he,ke,Te=se,Qe=1<he;++he){if(Oe[he]>1<(Br-=Oe[he]))return 0;for(;0=he;++he,Be<<=1){if(jt+=Br<<=1,0>(Br-=Oe[he]))return 0;for(;0Ze&&!(0>=(We-=Oe[Ze]));)++Ze,We<<=1;Qe+=Dt=1<<(We=Ze-le),ee[se+(Ze=zt&Xe)].g=We+le,ee[se+Ze].value=Te-se-Ze}fe.g=he-le,fe.value=Fe[ke++],P(ee,Te+(zt>>le),Be,Dt,fe),zt=I(zt,he)}}return jt!=2*ze[15]-1?0:Qe}(N,k,L,H,J,Z)}function M(){this.value=this.g=0}function _(){this.value=this.g=0}function R(){this.G=o(5,M),this.H=s(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(ev,_)}function G(N,k,L,H){t(N!=null),t(k!=null),t(2147483648>H),N.Ca=254,N.I=0,N.b=-8,N.Ka=0,N.oa=k,N.pa=L,N.Jd=k,N.Yc=L+H,N.Zc=4<=H?L+H-4+1:L,pe(N)}function U(N,k){for(var L=0;0H),N.Sb=H,N.Ra=0,N.u=0,N.h=0,4>>=8,N.Ra+=N.oa[N.pa+N.bb]<<$a-8>>>0,++N.bb,N.u-=8;X(N)&&(N.h=1,N.u=0)}function $(N,k){if(t(0<=k),!N.h&&k<=fb){var L=V(N)&wp[k];return N.u+=k,Y(N),L}return N.h=1,N.u=0}function O(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function W(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function V(N){return N.Ra>>>(N.u&$a-1)>>>0}function X(N){return t(N.bb<=N.Sb),N.h||N.bb==N.Sb&&N.u>$a}function ne(N,k){N.u=k,N.h=X(N)}function oe(N){N.u>=yo&&(t(N.u>=yo),Y(N))}function pe(N){t(N!=null&&N.oa!=null),N.pa>>0,N.b+=8):(t(N!=null&&N.oa!=null),N.paN.b&&pe(N);var H=N.b,J=L*k>>>8,Z=(N.I>>>H>J)+0;for(Z?(L-=J,N.I-=J+1<>>0):L=J+1,H=L,J=0;256<=H;)J+=8,H>>=8;return H=7^J+tv[H],N.b-=H,N.Ca=(L<>24&255,N[k+1]=L>>16&255,N[k+2]=L>>8&255,N[k+3]=255&L}function ue(N,k){return N[k+0]|N[k+1]<<8}function Se(N,k){return ue(N,k)|N[k+2]<<16}function D(N,k){return ue(N,k)|ue(N,k+2)<<16}function K(N,k){var L=1<=J||0>=Z?0:(L[0]=J,H[0]=Z,1)}function ce(N,k){return N+(1<>>k}function be(N,k){return((4278255360&N)+(4278255360&k)>>>0&4278255360)+((16711935&N)+(16711935&k)>>>0&16711935)>>>0}function je(N,k){B[k]=function(L,H,J,Z,ee,se,le){var fe;for(fe=0;fe>>1)+(N&k)>>>0}function Ke(N){return 0<=N&&256>N?N:0>N?0:255>1))}function Ve(N,k,L){return Math.abs(k-L)-Math.abs(N-L)}function ht(N,k,L,H,J,Z,ee){for(H=Z[ee-1],L=0;L>8&255,le=16711935&(le=(le=16711935&ee)+((se<<16)+se));H[J+Z]=(4278255360&ee)+le>>>0}}function ut(N,k){k.jd=255&N,k.hd=N>>8&255,k.ud=N>>16&255}function Qt(N,k,L,H,J,Z){var ee;for(ee=0;ee>>8,fe=se,Be=255&(Be=(Be=se>>>16)+((N.jd<<24>>24)*(le<<24>>24)>>>5));fe=255&(fe=(fe+=(N.hd<<24>>24)*(le<<24>>24)>>>5)+((N.ud<<24>>24)*(Be<<24>>24)>>>5)),J[Z+ee]=(4278255360&se)+(Be<<16)+fe}}function dt(N,k,L,H,J){B[k]=function(Z,ee,se,le,fe,Be,Fe,he,ke){for(le=Fe;le>Z.b,ke=Z.Ea,Te=Z.K[0],Qe=Z.w;if(8>he)for(Z=(1<>=he}else B["VP8LMapColor"+L](le,fe,Te,Qe,Be,Fe,ee,se,ke)}}function Sr(N,k,L,H,J){for(L=k+L;k>16&255,H[J++]=Z>>8&255,H[J++]=255&Z}}function Tt(N,k,L,H,J){for(L=k+L;k>16&255,H[J++]=Z>>8&255,H[J++]=255&Z,H[J++]=Z>>24&255}}function qt(N,k,L,H,J){for(L=k+L;k>16&240|ee>>12&15,ee=240&ee|ee>>28&15;H[J++]=Z,H[J++]=ee}}function nr(N,k,L,H,J){for(L=k+L;k>16&248|ee>>13&7,ee=ee>>5&224|ee>>3&31;H[J++]=Z,H[J++]=ee}}function hr(N,k,L,H,J){for(L=k+L;k>8&255,H[J++]=Z>>16&255}}function Mt(N,k,L,H,J,Z){if(Z==0)for(L=k+L;k>24|Z[1]>>8&65280|Z[2]<<8&16711680|Z[3]<<24)>>>0),J+=32;else n(H,J,N,k,L)}function Vr(N,k){B[k][0]=B[N+"0"],B[k][1]=B[N+"1"],B[k][2]=B[N+"2"],B[k][3]=B[N+"3"],B[k][4]=B[N+"4"],B[k][5]=B[N+"5"],B[k][6]=B[N+"6"],B[k][7]=B[N+"7"],B[k][8]=B[N+"8"],B[k][9]=B[N+"9"],B[k][10]=B[N+"10"],B[k][11]=B[N+"11"],B[k][12]=B[N+"12"],B[k][13]=B[N+"13"],B[k][14]=B[N+"0"],B[k][15]=B[N+"0"]}function Ht(N){return N==bT||N==wT||N==wN||N==CT}function $t(){this.eb=[],this.size=this.A=this.fb=0}function zr(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function Zt(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new $t,this.f.kb=new zr,this.sd=null}function yt(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function tn(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function Kt(N){return alert("todo:WebPSamplerProcessPlane"),N.T}function ir(N,k){var L=N.T,H=k.ba.f.RGBA,J=H.eb,Z=H.fb+N.ka*H.A,ee=Fl[k.ba.S],se=N.y,le=N.O,fe=N.f,Be=N.N,Fe=N.ea,he=N.W,ke=k.cc,Te=k.dc,Qe=k.Mc,Oe=k.Nc,ze=N.ka,We=N.ka+N.T,Ze=N.U,Xe=Ze+1>>1;for(ze==0?ee(se,le,null,null,fe,Be,Fe,he,fe,Be,Fe,he,J,Z,null,null,Ze):(ee(k.ec,k.fc,se,le,ke,Te,Qe,Oe,fe,Be,Fe,he,J,Z-H.A,J,Z,Ze),++L);ze+2L,J=L==xN||L==yN||L==bN||L==yT||L==12||Ht(L);if(k.memory=null,k.Ib=null,k.Jb=null,k.Nd=null,!Il(k.Oa,N,J?11:12))return 0;if(J&&Ht(L)&&Od(),N.da)alert("todo:use_scaling");else{if(H){if(k.Ib=Kt,N.Kb){if(L=N.U+1>>1,k.memory=s(N.U+2*L),k.memory==null)return 0;k.ec=k.memory,k.fc=0,k.cc=k.ec,k.dc=k.fc+N.U,k.Mc=k.cc,k.Nc=k.dc+L,k.Ib=ir,Od()}}else alert("todo:EmitYUV");J&&(k.Jb=Wr,H&&gi())}if(H&&!X7){for(N=0;256>N;++N)Dve[N]=89858*(N-128)+NN>>CN,Qve[N]=-22014*(N-128)+NN,Uve[N]=-45773*(N-128),Rve[N]=113618*(N-128)+NN>>CN;for(N=xb;N>CN,Hve[N-xb]=Fr(k,255),$ve[N-xb]=Fr(k+8>>4,15);X7=1}return 1}function St(N){var k=N.ma,L=N.U,H=N.T;return t(!(1&N.ka)),0>=L||0>=H?0:(L=k.Ib(N,k),k.Jb!=null&&k.Jb(N,k,L),k.Dc+=L,1)}function es(N){N.ma.memory=null}function Or(N,k,L,H){return $(N,8)!=47?0:(k[0]=$(N,14)+1,L[0]=$(N,14)+1,H[0]=$(N,1),$(N,3)!=0?0:!N.h)}function fn(N,k){if(4>N)return N+1;var L=N-2>>1;return(2+(1&N)<>4)*N+(8-(15&L)))?L:1;var L}function qn(N,k,L){var H=V(L),J=N[k+=255&H].g-8;return 0>>0,t(8>=L.g),N.g}function ts(N,k,L){var H=N.xc;return t((k=H==0?0:N.vc[N.md*(L>>H)+(k>>H)])>Dt.b)*jt;QeZe&&(Rt=Ze),(0,Nc[qr[vs++]>>8&15])(he,ke+ +_r,ze,We+_r-Ze,Rt-_r,ze,We+_r),_r=Rt}ke+=Ze,We+=Ze,++Qe&zt||(Dt+=jt)}Fe!=fe.nc&&n(le,se-Te,le,se+(Fe-Be-1)*Te,Te);break;case 1:for(Te=he,Oe=ke,Ze=(he=fe.Ea)-(We=he&~(ze=(ke=1<>fe.b)*Qe;Be=J),0Z.o&&(H=Z.o),L=H?L=0:(J[0]+=4*Z.v,Z.ka=L-Z.j,Z.U=Z.va-Z.v,Z.T=H-L,L=1),L){if(se=se[0],11>(L=N.ca).S){var Be=L.f.RGBA,Fe=(H=L.S,J=Z.U,Z=Z.T,fe=Be.eb,Be.A),he=Z;for(Be=Be.fb+N.Ma*Be.A;0H){var J=N.l.width,Z=L.ca,ee=L.tb+J*H,se=N.V,le=N.Ba+N.c*H,fe=N.gc;t(N.ab==1),t(fe[0].hc==3),vT(fe[0],H,k,se,le,Z,ee),Is(L,H,k,Z,ee,J)}N.C=N.Ma=k}function xo(N,k,L,H,J,Z,ee){var se=N.$/H,le=N.$%H,fe=N.m,Be=N.s,Fe=L+N.$,he=Fe;J=L+H*J;var ke=L+H*Z,Te=280+Be.ua,Qe=N.Pb?se:16777216,Oe=0=Qe){var zt=Fe-L;t((Qe=N).Pb),Qe.wd=Qe.m,Qe.xd=zt,0Br.g?(ne(Xe,Xe.u+Br.g),zt[jt]=Br.value,Xe=0):(ne(Xe,Xe.u+Br.g-256),t(256<=Br.value),Xe=Br.value),Xe==0&&(Ze=!0)}else Xe=qn(We.G[0],We.H[0],fe);if(fe.h)break;if(Ze||256>Xe){if(!Ze)if(We.nd)k[Fe]=(We.qb|Xe<<8)>>>0;else{if(oe(fe),Ze=qn(We.G[1],We.H[1],fe),oe(fe),zt=qn(We.G[2],We.H[2],fe),jt=qn(We.G[3],We.H[3],fe),fe.h)break;k[Fe]=(jt<<24|Ze<<16|Xe<<8|zt)>>>0}if(Ze=!1,++Fe,++le>=H&&(le=0,++se,ee!=null&&se<=Z&&!(se%16)&&ee(N,se),Oe!=null))for(;he>>Oe.Mb]=Xe}else if(280>Xe){if(Xe=fn(Xe-256,fe),zt=qn(We.G[4],We.H[4],fe),oe(fe),zt=hi(H,zt=fn(zt,fe)),fe.h)break;if(Fe-L=H;)le-=H,++se,ee!=null&&se<=Z&&!(se%16)&&ee(N,se);if(t(Fe<=J),le&ze&&(We=ts(Be,le,se)),Oe!=null)for(;he>>Oe.Mb]=Xe}else{if(!(Xe>>Oe.Mb]=Xe;Xe=Fe,t(!(Ze>>>(zt=Oe).Xa)),k[Xe]=zt.X[Ze],Ze=!0}Ze||t(fe.h==X(fe))}if(N.Pb&&fe.h&&FeZ?Z:se),N.a=0,N.$=Fe-L}return 1}return N.a=3,0}function ha(N){t(N!=null),N.vc=null,N.yc=null,N.Ya=null;var k=N.Wa;k!=null&&(k.X=null),N.vb=null,t(N!=null)}function Tl(){var N=new Ft;return N==null?null:(N.a=0,N.xb=z7,Vr("Predictor","VP8LPredictors"),Vr("Predictor","VP8LPredictors_C"),Vr("PredictorAdd","VP8LPredictorsAdd"),Vr("PredictorAdd","VP8LPredictorsAdd_C"),rv=ft,Np=Qt,hb=Sr,pb=Tt,nv=qt,jp=nr,Sp=hr,B.VP8LMapColor32b=ns,B.VP8LMapColor8b=yu,N)}function qs(N,k,L,H,J){var Z=1,ee=[N],se=[k],le=H.m,fe=H.s,Be=null,Fe=0;e:for(;;){if(L)for(;Z&&$(le,1);){var he=ee,ke=se,Te=H,Qe=1,Oe=Te.m,ze=Te.gc[Te.ab],We=$(Oe,2);if(Te.Oc&1<=Te.ab),We){case 0:case 1:ze.b=$(Oe,3)+2,Qe=qs(ce(ze.Ea,ze.b),ce(ze.nc,ze.b),0,Te,ze.K),ze.K=ze.K[0];break;case 3:var Ze,Xe=$(Oe,8)+1,zt=16>Dt.b),vs=s(qr);if(vs==null)Ze=0;else{var _r=Dt.K[0],Rt=Dt.w;for(vs[0]=Dt.K[0][0],jt=1;jt<1*Br;++jt)vs[jt]=be(_r[Rt+jt],vs[jt-1]);for(;jt<4*qr;++jt)vs[jt]=0;Dt.K[0]=null,Dt.K[0]=vs,Ze=1}}Qe=Ze;break;case 2:break;default:t(0)}Z=Qe}}if(ee=ee[0],se=se[0],Z&&$(le,1)&&!(Z=1<=(Fe=$(le,4))&&11>=Fe)){H.a=3;break e}var ct;if(ct=Z)t:{var Qi,Cr,nn,Yn=H,Ys=ee,za=se,Si=Fe,ya=L,Wa=Yn.m,xs=Yn.s,sn=[null],yn=1,Bi=0,bn=jve[Si];r:for(;;){if(ya&&$(Wa,1)){var Js=$(Wa,3)+2,Sc=ce(Ys,Js),Hi=ce(za,Js),bo=Sc*Hi;if(!qs(Sc,Hi,0,Yn,sn))break r;for(sn=sn[0],xs.xc=Js,Qi=0;Qi>8&65535;sn[Qi]=Pn,Pn>=yn&&(yn=Pn+1)}}if(Wa.h)break r;for(Cr=0;5>Cr;++Cr){var ys=H7[Cr];!Cr&&0=Ga),Xo=qo;var wo=s(Bi);if(Xo==null||wo==null||Vo==null){Yn.a=1;break r}var Yo=Vo;for(Qi=nn=0;QiCr;++Cr){ys=H7[Cr],Jo[Cr]=Yo,Bc[Cr]=nn,!Cr&&0EN)break n}else kT=EN;for(bb=0;bbav)nH[bb++]=av,av!=0&&(iH=av);else{var Zve=av==16,oH=av-16,exe=bve[oH],lH=$(of,yve[oH])+exe;if(bb+lH>EN)break n;for(var txe=Zve?iH:0;0=Cr){var wb,TT=wo[0];for(wb=1;wbTT&&(TT=wo[wb]);Zs+=TT}}if(Qn.nd=Dd,Qn.Qb=0,Dd&&(Qn.qb=(Jo[3][Bc[3]+0].value<<24|Jo[1][Bc[1]+0].value<<16|Jo[2][Bc[2]+0].value)>>>0,Bp==0&&256>Jo[0][Bc[0]+0].value&&(Qn.Qb=1,Qn.qb+=Jo[0][Bc[0]+0].value<<8)),Qn.jc=!Qn.Qb&&6>Zs,Qn.jc){var TN,Rd=Qn;for(TN=0;TN>=ji(PN,8,cf),lf>>=ji(Rd.G[1][Rd.H[1]+lf],16,cf),lf>>=ji(Rd.G[2][Rd.H[2]+lf],0,cf),ji(Rd.G[3][Rd.H[3]+lf],24,cf))}}}xs.vc=sn,xs.Wb=yn,xs.Ya=Xo,xs.yc=Vo,ct=1;break t}ct=0}if(!(Z=ct)){H.a=3;break e}if(0H+1?[]:0),!(J.lengthN?0:N>k?k:N}function Dn(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function ma(){var N=new vr;return N!=null&&(N.a=0,N.sc="OK",N.cb=0,N.Xb=0,vb||(vb=_d)),N}function un(N,k,L){return N.a==0&&(N.a=k,N.sc=L,N.cb=0),0}function KA(N,k,L){return 3<=L&&N[k+0]==157&&N[k+1]==1&&N[k+2]==42}function xn(N,k){if(N==null)return 0;if(N.a=0,N.sc="OK",k==null)return un(N,2,"null VP8Io passed to VP8GetHeaders()");var L=k.data,H=k.w,J=k.ha;if(4>J)return un(N,7,"Truncated header.");var Z=L[H+0]|L[H+1]<<8|L[H+2]<<16,ee=N.Od;if(ee.Rb=!(1&Z),ee.td=Z>>1&7,ee.yd=Z>>4&1,ee.ub=Z>>5,3J)return un(N,7,"cannot parse picture header");if(!KA(L,H,J))return un(N,3,"Bad code word");se.c=16383&(L[H+4]<<8|L[H+3]),se.Td=L[H+4]>>6,se.i=16383&(L[H+6]<<8|L[H+5]),se.Ud=L[H+6]>>6,H+=7,J-=7,N.za=se.c+15>>4,N.Ub=se.i+15>>4,k.width=se.c,k.height=se.i,k.Da=0,k.j=0,k.v=0,k.va=k.width,k.o=k.height,k.da=0,k.ib=k.width,k.hb=k.height,k.U=k.width,k.T=k.height,i((Z=N.Pa).jb,0,255,Z.jb.length),t((Z=N.Qa)!=null),Z.Cb=0,Z.Bb=0,Z.Fb=1,i(Z.Zb,0,0,Z.Zb.length),i(Z.Lb,0,0,Z.Lb)}if(ee.ub>J)return un(N,7,"bad partition length");G(Z=N.m,L,H,ee.ub),H+=ee.ub,J-=ee.ub,ee.Rb&&(se.Ld=de(Z),se.Kd=de(Z)),se=N.Qa;var le,fe=N.Pa;if(t(Z!=null),t(se!=null),se.Cb=de(Z),se.Cb){if(se.Bb=de(Z),de(Z)){for(se.Fb=de(Z),le=0;4>le;++le)se.Zb[le]=de(Z)?Q(Z,7):0;for(le=0;4>le;++le)se.Lb[le]=de(Z)?Q(Z,6):0}if(se.Bb)for(le=0;3>le;++le)fe.jb[le]=de(Z)?U(Z,8):255}else se.Bb=0;if(Z.Ka)return un(N,3,"cannot parse segment header");if((se=N.ed).zd=de(Z),se.Tb=U(Z,6),se.wb=U(Z,3),se.Pc=de(Z),se.Pc&&de(Z)){for(fe=0;4>fe;++fe)de(Z)&&(se.vd[fe]=Q(Z,6));for(fe=0;4>fe;++fe)de(Z)&&(se.od[fe]=Q(Z,6))}if(N.L=se.Tb==0?0:se.zd?1:2,Z.Ka)return un(N,3,"cannot parse filter header");var Be=J;if(J=le=H,H=le+Be,se=Be,N.Xb=(1<se&&(Fe=se),G(N.Jc[+Be],L,le,Fe),le+=Fe,se-=Fe,J+=3}G(N.Jc[+fe],L,le,se),L=leFe;++Fe){if(Be.Cb){var he=Be.Zb[Fe];Be.Fb||(he+=L)}else{if(0>16,8>ke.Eb[1]&&(ke.Eb[1]=8),ke.Qc[0]=NT[Fr(he+fe,117)],ke.Qc[1]=jT[Fr(he+le,127)],ke.lc=he+le}if(!ee.Rb)return un(N,4,"Not a key frame.");for(de(Z),ee=N.Pa,L=0;4>L;++L){for(J=0;8>J;++J)for(H=0;3>H;++H)for(se=0;11>se;++se)fe=ge(Z,Tve[L][J][H][se])?U(Z,8):kve[L][J][H][se],ee.Wc[L][J].Yb[H][se]=fe;for(J=0;17>J;++J)ee.Xc[L][J]=ee.Wc[L][Pve[J]]}return N.kc=de(Z),N.kc&&(N.Bd=U(Z,8)),N.cb=1}function _d(N,k,L,H,J,Z,ee){var se=k[J].Yb[L];for(L=0;16>J;++J){if(!ge(N,se[L+0]))return J;for(;!ge(N,se[L+1]);)if(se=k[++J].Yb[0],L=0,J==16)return 16;var le=k[J+1].Yb;if(ge(N,se[L+2])){var fe=N,Be=0;if(ge(fe,(he=se)[(Fe=L)+3]))if(ge(fe,he[Fe+6])){for(se=0,Fe=2*(Be=ge(fe,he[Fe+8]))+(he=ge(fe,he[Fe+9+Be])),Be=0,he=Bve[Fe];he[se];++se)Be+=Be+ge(fe,he[se]);Be+=3+(8<(fe=N).b&&pe(fe);var Fe,he=fe.b,ke=(Fe=fe.Ca>>1)-(fe.I>>he)>>31;--fe.b,fe.Ca+=ke,fe.Ca|=1,fe.I-=(Fe+1&ke)<>3),N[k+L+32*H]=-256&J?0>J?0:255:J}function zg(N,k,L,H,J,Z){Go(N,k,0,L,H+J),Go(N,k,1,L,H+Z),Go(N,k,2,L,H-Z),Go(N,k,3,L,H-J)}function kd(N){return(20091*N>>16)+N}function Xs(N,k,L,H){var J,Z=0,ee=s(16);for(J=0;4>J;++J){var se=N[k+0]+N[k+8],le=N[k+0]-N[k+8],fe=(35468*N[k+4]>>16)-kd(N[k+12]),Be=kd(N[k+4])+(35468*N[k+12]>>16);ee[Z+0]=se+Be,ee[Z+1]=le+fe,ee[Z+2]=le-fe,ee[Z+3]=se-Be,Z+=4,k++}for(J=Z=0;4>J;++J)se=(N=ee[Z+0]+4)+ee[Z+8],le=N-ee[Z+8],fe=(35468*ee[Z+4]>>16)-kd(ee[Z+12]),Go(L,H,0,0,se+(Be=kd(ee[Z+4])+(35468*ee[Z+12]>>16))),Go(L,H,1,0,le+fe),Go(L,H,2,0,le-fe),Go(L,H,3,0,se-Be),Z++,H+=32}function aN(N,k,L,H){var J=N[k+0]+4,Z=35468*N[k+4]>>16,ee=kd(N[k+4]),se=35468*N[k+1]>>16;zg(L,H,0,J+ee,N=kd(N[k+1]),se),zg(L,H,1,J+Z,N,se),zg(L,H,2,J-Z,N,se),zg(L,H,3,J-ee,N,se)}function rT(N,k,L,H,J){Xs(N,k,L,H),J&&Xs(N,k+16,L,H+4)}function nT(N,k,L,H){Fd(N,k+0,L,H,1),Fd(N,k+32,L,H+128,1)}function iT(N,k,L,H){var J;for(N=N[k+0]+4,J=0;4>J;++J)for(k=0;4>k;++k)Go(L,H,k,J,N)}function gu(N,k,L,H){N[k+0]&&xa(N,k+0,L,H),N[k+16]&&xa(N,k+16,L,H+4),N[k+32]&&xa(N,k+32,L,H+128),N[k+48]&&xa(N,k+48,L,H+128+4)}function oN(N,k,L,H){var J,Z=s(16);for(J=0;4>J;++J){var ee=N[k+0+J]+N[k+12+J],se=N[k+4+J]+N[k+8+J],le=N[k+4+J]-N[k+8+J],fe=N[k+0+J]-N[k+12+J];Z[0+J]=ee+se,Z[8+J]=ee-se,Z[4+J]=fe+le,Z[12+J]=fe-le}for(J=0;4>J;++J)ee=(N=Z[0+4*J]+3)+Z[3+4*J],se=Z[1+4*J]+Z[2+4*J],le=Z[1+4*J]-Z[2+4*J],fe=N-Z[3+4*J],L[H+0]=ee+se>>3,L[H+16]=fe+le>>3,L[H+32]=ee-se>>3,L[H+48]=fe-le>>3,H+=64}function Wg(N,k,L){var H,J=k-32,Z=Ko,ee=255-N[J-1];for(H=0;HL;++L)n(N,k+32*L,N,k-32,16)}function oT(N,k){var L;for(L=16;0H;++H)i(k,L+32*H,N,16)}function lN(N,k){var L,H=16;for(L=0;16>L;++L)H+=N[k-1+32*L]+N[k+L-32];qA(H>>5,N,k)}function XA(N,k){var L,H=8;for(L=0;16>L;++L)H+=N[k-1+32*L];qA(H>>4,N,k)}function lT(N,k){var L,H=8;for(L=0;16>L;++L)H+=N[k+L-32];qA(H>>4,N,k)}function fp(N,k){qA(128,N,k)}function cr(N,k,L){return N+2*k+L+2>>2}function cT(N,k){var L,H=k-32;for(H=new Uint8Array([cr(N[H-1],N[H+0],N[H+1]),cr(N[H+0],N[H+1],N[H+2]),cr(N[H+1],N[H+2],N[H+3]),cr(N[H+2],N[H+3],N[H+4])]),L=0;4>L;++L)n(N,k+32*L,H,0,H.length)}function uT(N,k){var L=N[k-1],H=N[k-1+32],J=N[k-1+64],Z=N[k-1+96];ie(N,k+0,16843009*cr(N[k-1-32],L,H)),ie(N,k+32,16843009*cr(L,H,J)),ie(N,k+64,16843009*cr(H,J,Z)),ie(N,k+96,16843009*cr(J,Z,Z))}function dT(N,k){var L,H=4;for(L=0;4>L;++L)H+=N[k+L-32]+N[k-1+32*L];for(H>>=3,L=0;4>L;++L)i(N,k+32*L,H,4)}function AT(N,k){var L=N[k-1+0],H=N[k-1+32],J=N[k-1+64],Z=N[k-1-32],ee=N[k+0-32],se=N[k+1-32],le=N[k+2-32],fe=N[k+3-32];N[k+0+96]=cr(H,J,N[k-1+96]),N[k+1+96]=N[k+0+64]=cr(L,H,J),N[k+2+96]=N[k+1+64]=N[k+0+32]=cr(Z,L,H),N[k+3+96]=N[k+2+64]=N[k+1+32]=N[k+0+0]=cr(ee,Z,L),N[k+3+64]=N[k+2+32]=N[k+1+0]=cr(se,ee,Z),N[k+3+32]=N[k+2+0]=cr(le,se,ee),N[k+3+0]=cr(fe,le,se)}function fT(N,k){var L=N[k+1-32],H=N[k+2-32],J=N[k+3-32],Z=N[k+4-32],ee=N[k+5-32],se=N[k+6-32],le=N[k+7-32];N[k+0+0]=cr(N[k+0-32],L,H),N[k+1+0]=N[k+0+32]=cr(L,H,J),N[k+2+0]=N[k+1+32]=N[k+0+64]=cr(H,J,Z),N[k+3+0]=N[k+2+32]=N[k+1+64]=N[k+0+96]=cr(J,Z,ee),N[k+3+32]=N[k+2+64]=N[k+1+96]=cr(Z,ee,se),N[k+3+64]=N[k+2+96]=cr(ee,se,le),N[k+3+96]=cr(se,le,le)}function Ed(N,k){var L=N[k-1+0],H=N[k-1+32],J=N[k-1+64],Z=N[k-1-32],ee=N[k+0-32],se=N[k+1-32],le=N[k+2-32],fe=N[k+3-32];N[k+0+0]=N[k+1+64]=Z+ee+1>>1,N[k+1+0]=N[k+2+64]=ee+se+1>>1,N[k+2+0]=N[k+3+64]=se+le+1>>1,N[k+3+0]=le+fe+1>>1,N[k+0+96]=cr(J,H,L),N[k+0+64]=cr(H,L,Z),N[k+0+32]=N[k+1+96]=cr(L,Z,ee),N[k+1+32]=N[k+2+96]=cr(Z,ee,se),N[k+2+32]=N[k+3+96]=cr(ee,se,le),N[k+3+32]=cr(se,le,fe)}function Td(N,k){var L=N[k+0-32],H=N[k+1-32],J=N[k+2-32],Z=N[k+3-32],ee=N[k+4-32],se=N[k+5-32],le=N[k+6-32],fe=N[k+7-32];N[k+0+0]=L+H+1>>1,N[k+1+0]=N[k+0+64]=H+J+1>>1,N[k+2+0]=N[k+1+64]=J+Z+1>>1,N[k+3+0]=N[k+2+64]=Z+ee+1>>1,N[k+0+32]=cr(L,H,J),N[k+1+32]=N[k+0+96]=cr(H,J,Z),N[k+2+32]=N[k+1+96]=cr(J,Z,ee),N[k+3+32]=N[k+2+96]=cr(Z,ee,se),N[k+3+64]=cr(ee,se,le),N[k+3+96]=cr(se,le,fe)}function hT(N,k){var L=N[k-1+0],H=N[k-1+32],J=N[k-1+64],Z=N[k-1+96];N[k+0+0]=L+H+1>>1,N[k+2+0]=N[k+0+32]=H+J+1>>1,N[k+2+32]=N[k+0+64]=J+Z+1>>1,N[k+1+0]=cr(L,H,J),N[k+3+0]=N[k+1+32]=cr(H,J,Z),N[k+3+32]=N[k+1+64]=cr(J,Z,Z),N[k+3+64]=N[k+2+64]=N[k+0+96]=N[k+1+96]=N[k+2+96]=N[k+3+96]=Z}function pT(N,k){var L=N[k-1+0],H=N[k-1+32],J=N[k-1+64],Z=N[k-1+96],ee=N[k-1-32],se=N[k+0-32],le=N[k+1-32],fe=N[k+2-32];N[k+0+0]=N[k+2+32]=L+ee+1>>1,N[k+0+32]=N[k+2+64]=H+L+1>>1,N[k+0+64]=N[k+2+96]=J+H+1>>1,N[k+0+96]=Z+J+1>>1,N[k+3+0]=cr(se,le,fe),N[k+2+0]=cr(ee,se,le),N[k+1+0]=N[k+3+32]=cr(L,ee,se),N[k+1+32]=N[k+3+64]=cr(H,L,ee),N[k+1+64]=N[k+3+96]=cr(J,H,L),N[k+1+96]=cr(Z,J,H)}function Kg(N,k){var L;for(L=0;8>L;++L)n(N,k+32*L,N,k-32,8)}function sb(N,k){var L;for(L=0;8>L;++L)i(N,k,N[k-1],8),k+=32}function vu(N,k,L){var H;for(H=0;8>H;++H)i(k,L+32*H,N,8)}function mT(N,k){var L,H=8;for(L=0;8>L;++L)H+=N[k+L-32]+N[k-1+32*L];vu(H>>4,N,k)}function Vg(N,k){var L,H=4;for(L=0;8>L;++L)H+=N[k+L-32];vu(H>>3,N,k)}function gT(N,k){var L,H=4;for(L=0;8>L;++L)H+=N[k-1+32*L];vu(H>>3,N,k)}function ab(N,k){vu(128,N,k)}function YA(N,k,L){var H=N[k-L],J=N[k+0],Z=3*(J-H)+xT[1020+N[k-2*L]-N[k+L]],ee=gN[112+(Z+4>>3)];N[k-L]=Ko[255+H+gN[112+(Z+3>>3)]],N[k+0]=Ko[255+J-ee]}function ob(N,k,L,H){var J=N[k+0],Z=N[k+L];return Ol[255+N[k-2*L]-N[k-L]]>H||Ol[255+Z-J]>H}function hp(N,k,L,H){return 4*Ol[255+N[k-L]-N[k+0]]+Ol[255+N[k-2*L]-N[k+L]]<=H}function lb(N,k,L,H,J){var Z=N[k-3*L],ee=N[k-2*L],se=N[k-L],le=N[k+0],fe=N[k+L],Be=N[k+2*L],Fe=N[k+3*L];return 4*Ol[255+se-le]+Ol[255+ee-fe]>H?0:Ol[255+N[k-4*L]-Z]<=J&&Ol[255+Z-ee]<=J&&Ol[255+ee-se]<=J&&Ol[255+Fe-Be]<=J&&Ol[255+Be-fe]<=J&&Ol[255+fe-le]<=J}function qg(N,k,L,H){var J=2*H+1;for(H=0;16>H;++H)hp(N,k+H,L,J)&&YA(N,k+H,L)}function cb(N,k,L,H){var J=2*H+1;for(H=0;16>H;++H)hp(N,k+H*L,1,J)&&YA(N,k+H*L,1)}function Xg(N,k,L,H){var J;for(J=3;0>7,ze=18*We+63>>7,We=9*We+63>>7;le[fe-3*Be]=Ko[255+le[fe-3*Be]+We],le[fe-2*Be]=Ko[255+Fe+ze],le[fe-Be]=Ko[255+he+Oe],le[fe+0]=Ko[255+ke-Oe],le[fe+Be]=Ko[255+Te-ze],le[fe+2*Be]=Ko[255+Qe-We]}k+=H}}function Id(N,k,L,H,J,Z,ee,se){for(Z=2*Z+1;0>3)],Qe=gN[112+(Qe+3>>3)],Oe=Te+1>>1;le[fe-2*Be]=Ko[255+le[fe-2*Be]+Oe],le[fe-Be]=Ko[255+Fe+Qe],le[fe+0]=Ko[255+he-Te],le[fe+Be]=Ko[255+ke-Oe]}k+=H}}function uN(N,k,L,H,J,Z){Pd(N,k,L,1,16,H,J,Z)}function dN(N,k,L,H,J,Z){Pd(N,k,1,L,16,H,J,Z)}function AN(N,k,L,H,J,Z){var ee;for(ee=3;0fe?0:255:fe)&255,fe=le,J[Z+se]=Be}}function rs(N,k,L,H){var J=k.width,Z=k.o;if(t(N!=null&&k!=null),0>L||0>=H||L+H>Z)return null;if(!N.Cc){if(N.ga==null){var ee;if(N.ga=new Pt,(ee=N.ga==null)||(ee=k.width*k.o,t(N.Gb.length==0),N.Gb=s(ee),N.Uc=0,N.Gb==null?ee=0:(N.mb=N.Gb,N.nb=N.Uc,N.rc=null,ee=1),ee=!ee),!ee){ee=N.ga;var se=N.Fa,le=N.P,fe=N.qc,Be=N.mb,Fe=N.nb,he=le+1,ke=fe-1,Te=ee.l;if(t(se!=null&&Be!=null&&k!=null),sf[0]=null,sf[1]=pr,sf[2]=wr,sf[3]=rn,ee.ca=Be,ee.tb=Fe,ee.c=k.width,ee.i=k.height,t(0=fe)k=0;else if(ee.$a=3&se[le+0],ee.Z=se[le+0]>>2&3,ee.Lc=se[le+0]>>4&3,le=se[le+0]>>6&3,0>ee.$a||1=ee.c*ee.i;ee=!k}if(ee)return null;N.ga.Lc!=1?N.Ga=0:H=Z-L}t(N.ga!=null),t(L+H<=Z);e:{if(k=(se=N.ga).c,Z=se.l.o,se.$a==0){if(he=N.rc,ke=N.Vc,Te=N.Fa,le=N.P+1+L*k,fe=N.mb,Be=N.nb+L*k,t(le<=N.P+N.qc),se.Z!=0)for(t(sf[se.Z]!=null),ee=0;ee=k)k=1;else if(se.ic||gi(),se.ic){se=ee.V,he=ee.Ba,ke=ee.c;var Qe=ee.i,Oe=(Te=1,le=ee.$/ke,fe=ee.$%ke,Be=ee.m,Fe=ee.s,ee.$),ze=ke*Qe,We=ke*k,Ze=Fe.wc,Xe=Oe(Qe=qn(Xe.G[0],Xe.H[0],Be)))se[he+Oe]=Qe,++Oe,++fe>=ke&&(fe=0,++le<=k&&!(le%16)&&vo(ee,le));else{if(!(280>Qe)){Te=0;break t}Qe=fn(Qe-256,Be);var zt,jt=qn(Xe.G[4],Xe.H[4],Be);if(oe(Be),!(Oe>=(jt=hi(ke,jt=fn(jt,Be)))&&ze-Oe>=Qe)){Te=0;break t}for(zt=0;zt=ke;)fe-=ke,++le<=k&&!(le%16)&&vo(ee,le);Oek?k:le);break t}!Te||Be.h&&Oe=Z&&(N.Cc=1),H=1}if(!H)return null;if(N.Cc&&((H=N.ga)!=null&&(H.mc=null),N.ga=null,0>23,se[le+4*ee+1]=se[le+4*ee+1]*Fe>>23,se[le+4*ee+2]=se[le+4*ee+2]*Fe>>23)}k+=Z}}function _n(N,k,L,H,J){for(;0>4)*le>>16;N[k+2*Z+0]=(240&ee|ee>>4)*le>>16&240|(15&ee|ee<<4)*le>>16>>4&15,N[k+2*Z+1]=240&fe|se}k+=J}}function Xn(N,k,L,H,J,Z,ee,se){var le,fe,Be=255;for(fe=0;fe>8}function gi(){gb=Tn,P7=_n,I7=Xn,O7=mi}function ga(N,k,L){B[N]=function(H,J,Z,ee,se,le,fe,Be,Fe,he,ke,Te,Qe,Oe,ze,We,Ze){var Xe,zt=Ze-1>>1,jt=se[le+0]|fe[Be+0]<<16,Br=Fe[he+0]|ke[Te+0]<<16;t(H!=null);var Dt=3*jt+Br+131074>>2;for(k(H[J+0],255&Dt,Dt>>16,Qe,Oe),Z!=null&&(Dt=3*Br+jt+131074>>2,k(Z[ee+0],255&Dt,Dt>>16,ze,We)),Xe=1;Xe<=zt;++Xe){var qr=se[le+Xe]|fe[Be+Xe]<<16,vs=Fe[he+Xe]|ke[Te+Xe]<<16,_r=jt+qr+Br+vs+524296,Rt=_r+2*(qr+Br)>>3;Dt=Rt+jt>>1,jt=(_r=_r+2*(jt+vs)>>3)+qr>>1,k(H[J+2*Xe-1],255&Dt,Dt>>16,Qe,Oe+(2*Xe-1)*L),k(H[J+2*Xe-0],255&jt,jt>>16,Qe,Oe+(2*Xe-0)*L),Z!=null&&(Dt=_r+Br>>1,jt=Rt+vs>>1,k(Z[ee+2*Xe-1],255&Dt,Dt>>16,ze,We+(2*Xe-1)*L),k(Z[ee+2*Xe+0],255&jt,jt>>16,ze,We+(2*Xe+0)*L)),jt=qr,Br=vs}1&Ze||(Dt=3*jt+Br+131074>>2,k(H[J+Ze-1],255&Dt,Dt>>16,Qe,Oe+(Ze-1)*L),Z!=null&&(Dt=3*Br+jt+131074>>2,k(Z[ee+Ze-1],255&Dt,Dt>>16,ze,We+(Ze-1)*L)))}}function Od(){Fl[vN]=Ove,Fl[xN]=W7,Fl[U7]=Fve,Fl[yN]=G7,Fl[bN]=K7,Fl[yT]=V7,Fl[Q7]=Lve,Fl[bT]=W7,Fl[wT]=G7,Fl[wN]=K7,Fl[CT]=V7}function ub(N){return N&~Mve?0>N?0:255:N>>q7}function mp(N,k){return ub((19077*N>>8)+(26149*k>>8)-14234)}function gp(N,k,L){return ub((19077*N>>8)-(6419*k>>8)-(13320*L>>8)+8708)}function JA(N,k){return ub((19077*N>>8)+(33050*k>>8)-17685)}function vp(N,k,L,H,J){H[J+0]=mp(N,L),H[J+1]=gp(N,k,L),H[J+2]=JA(N,k)}function Yg(N,k,L,H,J){H[J+0]=JA(N,k),H[J+1]=gp(N,k,L),H[J+2]=mp(N,L)}function Jg(N,k,L,H,J){var Z=gp(N,k,L);k=Z<<3&224|JA(N,k)>>3,H[J+0]=248&mp(N,L)|Z>>5,H[J+1]=k}function va(N,k,L,H,J){var Z=240&JA(N,k)|15;H[J+0]=240&mp(N,L)|gp(N,k,L)>>4,H[J+1]=Z}function xp(N,k,L,H,J){H[J+0]=255,vp(N,k,L,H,J+1)}function yp(N,k,L,H,J){Yg(N,k,L,H,J),H[J+3]=255}function db(N,k,L,H,J){vp(N,k,L,H,J),H[J+3]=255}function xu(N,k,L){B[N]=function(H,J,Z,ee,se,le,fe,Be,Fe){for(var he=Be+(-2&Fe)*L;Be!=he;)k(H[J+0],Z[ee+0],se[le+0],fe,Be),k(H[J+1],Z[ee+0],se[le+0],fe,Be+L),J+=2,++ee,++le,Be+=2*L;1&Fe&&k(H[J+0],Z[ee+0],se[le+0],fe,Be)}}function Ha(N,k,L){return L==0?N==0?k==0?6:5:k==0?4:0:L}function hN(N,k,L,H,J){switch(N>>>30){case 3:Fd(k,L,H,J,0);break;case 2:rf(k,L,H,J);break;case 1:xa(k,L,H,J)}}function Zg(N,k){var L,H,J=k.M,Z=k.Nb,ee=N.oc,se=N.pc+40,le=N.oc,fe=N.pc+584,Be=N.oc,Fe=N.pc+600;for(L=0;16>L;++L)ee[se+32*L-1]=129;for(L=0;8>L;++L)le[fe+32*L-1]=129,Be[Fe+32*L-1]=129;for(0L;++L)n(ee,se+32*L-4,ee,se+32*L+12,4);for(L=-1;8>L;++L)n(le,fe+32*L-4,le,fe+32*L+4,4),n(Be,Fe+32*L-4,Be,Fe+32*L+4,4)}var ke=N.Gd,Te=N.Hd+H,Qe=he.ad,Oe=he.Hc;if(0=N.za-1?i(ze,We,ke[Te].y[15],4):n(ze,We,ke[Te+1].y,0,4)),L=0;4>L;L++)ze[We+128+L]=ze[We+256+L]=ze[We+384+L]=ze[We+0+L];for(L=0;16>L;++L,Oe<<=2)ze=ee,We=se+Y7[L],jc[he.Ob[L]](ze,We),hN(Oe,Qe,16*+L,ze,We)}else if(ze=Ha(H,J,he.Ob[0]),nf[ze](ee,se),Oe!=0)for(L=0;16>L;++L,Oe<<=2)hN(Oe,Qe,16*+L,ee,se+Y7[L]);for(L=he.Gc,ze=Ha(H,J,he.Dd),Md[ze](le,fe),Md[ze](Be,Fe),Oe=Qe,ze=le,We=fe,255&(he=0|L)&&(170&he?iv(Oe,256,ze,We):bu(Oe,256,ze,We)),he=Be,Oe=Fe,255&(L>>=8)&&(170&L?iv(Qe,320,he,Oe):bu(Qe,320,he,Oe)),JL;++L)n(ke,Te+L*N.R,ee,se+32*L,16);for(L=0;8>L;++L)n(Qe,he+L*N.B,le,fe+32*L,8),n(Oe,ze+L*N.B,Be,Fe+32*L,8)}}function pN(N,k,L,H,J,Z,ee,se,le){var fe=[0],Be=[0],Fe=0,he=le!=null?le.kd:0,ke=le??new Ee;if(N==null||12>L)return 7;ke.data=N,ke.w=k,ke.ha=L,k=[k],L=[L],ke.gb=[ke.gb];e:{var Te=k,Qe=L,Oe=ke.gb;if(t(N!=null),t(Qe!=null),t(Oe!=null),Oe[0]=0,12<=Qe[0]&&!r(N,Te[0],"RIFF")){if(r(N,Te[0]+8,"WEBP")){Oe=3;break e}var ze=D(N,Te[0]+4);if(12>ze||4294967286Qe[0]-8){Oe=7;break e}Oe[0]=ze,Te[0]+=12,Qe[0]-=12}Oe=0}if(Oe!=0)return Oe;for(ze=0Oe[0])Oe=7;else{if(!r(We,Qe[0],"VP8X")){if(D(We,Qe[0]+4)!=10){Oe=3;break e}if(18>Oe[0]){Oe=7;break e}var jt=D(We,Qe[0]+8),Br=1+Se(We,Qe[0]+12);if(2147483648<=Br*(We=1+Se(We,Qe[0]+15))){Oe=3;break e}zt!=null&&(zt[0]=jt),Ze!=null&&(Ze[0]=Br),Xe!=null&&(Xe[0]=We),Qe[0]+=18,Oe[0]-=18,Dt[0]=1}Oe=0}}if(Fe=Fe[0],Te=Te[0],Oe!=0)return Oe;if(Qe=!!(2&Te),!ze&&Fe)return 3;if(Z!=null&&(Z[0]=!!(16&Te)),ee!=null&&(ee[0]=Qe),se!=null&&(se[0]=0),ee=fe[0],Te=Be[0],Fe&&Qe&&le==null){Oe=0;break}if(4>L){Oe=7;break}if(ze&&Fe||!ze&&!Fe&&!r(N,k[0],"ALPH")){L=[L],ke.na=[ke.na],ke.P=[ke.P],ke.Sa=[ke.Sa];e:{jt=N,Oe=k,ze=L;var Dt=ke.gb;Ze=ke.na,Xe=ke.P,zt=ke.Sa,Br=22,t(jt!=null),t(ze!=null),We=Oe[0];var qr=ze[0];for(t(Ze!=null),t(zt!=null),Ze[0]=null,Xe[0]=null,zt[0]=0;;){if(Oe[0]=We,ze[0]=qr,8>qr){Oe=7;break e}var vs=D(jt,We+4);if(4294967286Dt){Oe=3;break e}if(!r(jt,We,"VP8 ")||!r(jt,We,"VP8L")){Oe=0;break e}if(qr[0]<_r){Oe=7;break e}r(jt,We,"ALPH")||(Ze[0]=jt,Xe[0]=We+8,zt[0]=vs),We+=_r,qr-=_r}}if(L=L[0],ke.na=ke.na[0],ke.P=ke.P[0],ke.Sa=ke.Sa[0],Oe!=0)break}L=[L],ke.Ja=[ke.Ja],ke.xa=[ke.xa];e:if(Dt=N,Oe=k,ze=L,Ze=ke.gb[0],Xe=ke.Ja,zt=ke.xa,jt=Oe[0],We=!r(Dt,jt,"VP8 "),Br=!r(Dt,jt,"VP8L"),t(Dt!=null),t(ze!=null),t(Xe!=null),t(zt!=null),8>ze[0])Oe=7;else{if(We||Br){if(Dt=D(Dt,jt+4),12<=Ze&&Dt>Ze-12){Oe=3;break e}if(he&&Dt>ze[0]-8){Oe=7;break e}Xe[0]=Dt,Oe[0]+=8,ze[0]-=8,zt[0]=Br}else zt[0]=5<=ze[0]&&Dt[jt+0]==47&&!(Dt[jt+4]>>5),Xe[0]=ze[0];Oe=0}if(L=L[0],ke.Ja=ke.Ja[0],ke.xa=ke.xa[0],k=k[0],Oe!=0)break;if(4294967286L){Oe=7;break}se=ee,he=Te,Qe=Z,N==null||5>L?N=0:5<=L&&N[k+0]==47&&!(N[k+4]>>5)?(ze=[0],Dt=[0],Ze=[0],z(Xe=new W,N,k,L),Or(Xe,ze,Dt,Ze)?(se!=null&&(se[0]=ze[0]),he!=null&&(he[0]=Dt[0]),Qe!=null&&(Qe[0]=Ze[0]),N=1):N=0):N=0}else{if(10>L){Oe=7;break}se=Te,N==null||10>L||!KA(N,k+3,L-3)?N=0:(he=N[k+0]|N[k+1]<<8|N[k+2]<<16,Qe=16383&(N[k+7]<<8|N[k+6]),N=16383&(N[k+9]<<8|N[k+8]),1&he||3<(he>>1&7)||!(he>>4&1)||he>>5>=ke.Ja||!Qe||!N?N=0:(ee&&(ee[0]=Qe),se&&(se[0]=N),N=1))}if(!N||(ee=ee[0],Te=Te[0],Fe&&(fe[0]!=ee||Be[0]!=Te)))return 3;le!=null&&(le[0]=ke,le.offset=k-le.w,t(4294967286>k-le.w),t(le.offset==le.ha-L));break}return Oe==0||Oe==7&&Fe&&le==null?(Z!=null&&(Z[0]|=ke.na!=null&&0L||(Z&=-2,ee&=-2),0>Z||0>ee||0>=se||0>=le||Z+se>H||ee+le>J))return 0;if(k.v=Z,k.j=ee,k.va=Z+se,k.o=ee+le,k.U=se,k.T=le,k.da=N!=null&&0N.S){var k=N.f.RGBA;k.fb+=(N.height-1)*k.A,k.A=-k.A}else k=N.f.kb,N=N.height,k.O+=(N-1)*k.fa,k.fa=-k.fa,k.N+=(N-1>>1)*k.Ab,k.Ab=-k.Ab,k.W+=(N-1>>1)*k.Db,k.Db=-k.Db,k.F!=null&&(k.J+=(N-1)*k.lb,k.lb=-k.lb);return 0}function Ab(N,k,L,H){if(H==null||0>=N||0>=k)return 2;if(L!=null){if(L.Da){var J=L.cd,Z=L.bd,ee=-2&L.v,se=-2&L.j;if(0>ee||0>se||0>=J||0>=Z||ee+J>N||se+Z>k)return 2;N=J,k=Z}if(L.da){if(!te(N,k,J=[L.ib],Z=[L.hb]))return 2;N=J[0],k=Z[0]}}H.width=N,H.height=k;e:{var le=H.width,fe=H.height;if(N=H.S,0>=le||0>=fe||!(N>=vN&&13>N))N=2;else{if(0>=H.Rd&&H.sd==null){ee=Z=J=k=0;var Be=(se=le*J7[N])*fe;if(11>N||(Z=(fe+1)/2*(k=(le+1)/2),N==12&&(ee=(J=le)*fe)),(fe=s(Be+2*Z+ee))==null){N=1;break e}H.sd=fe,11>N?((le=H.f.RGBA).eb=fe,le.fb=0,le.A=se,le.size=Be):((le=H.f.kb).y=fe,le.O=0,le.fa=se,le.Fd=Be,le.f=fe,le.N=0+Be,le.Ab=k,le.Cd=Z,le.ea=fe,le.W=0+Be+Z,le.Db=k,le.Ed=Z,N==12&&(le.F=fe,le.J=0+Be+2*Z),le.Tc=ee,le.lb=J)}if(k=1,J=H.S,Z=H.width,ee=H.height,J>=vN&&13>J)if(11>J)N=H.f.RGBA,k&=(se=Math.abs(N.A))*(ee-1)+Z<=N.size,k&=se>=Z*J7[J],k&=N.eb!=null;else{N=H.f.kb,se=(Z+1)/2,Be=(ee+1)/2,le=Math.abs(N.fa),fe=Math.abs(N.Ab);var Fe=Math.abs(N.Db),he=Math.abs(N.lb),ke=he*(ee-1)+Z;k&=le*(ee-1)+Z<=N.Fd,k&=fe*(Be-1)+se<=N.Cd,k=(k&=Fe*(Be-1)+se<=N.Ed)&le>=Z&fe>=se&Fe>=se,k&=N.y!=null,k&=N.f!=null,k&=N.ea!=null,J==12&&(k&=he>=Z,k&=ke<=N.Tc,k&=N.F!=null)}else k=0;N=k?0:2}}return N!=0||L!=null&&L.fd&&(N=bp(H)),N}var ev=64,wp=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],fb=24,$a=32,yo=8,tv=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];je("Predictor0","PredictorAdd0"),B.Predictor0=function(){return 4278190080},B.Predictor1=function(N){return N},B.Predictor2=function(N,k,L){return k[L+0]},B.Predictor3=function(N,k,L){return k[L+1]},B.Predictor4=function(N,k,L){return k[L-1]},B.Predictor5=function(N,k,L){return Ie(Ie(N,k[L+1]),k[L+0])},B.Predictor6=function(N,k,L){return Ie(N,k[L-1])},B.Predictor7=function(N,k,L){return Ie(N,k[L+0])},B.Predictor8=function(N,k,L){return Ie(k[L-1],k[L+0])},B.Predictor9=function(N,k,L){return Ie(k[L+0],k[L+1])},B.Predictor10=function(N,k,L){return Ie(Ie(N,k[L-1]),Ie(k[L+0],k[L+1]))},B.Predictor11=function(N,k,L){var H=k[L+0];return 0>=Ve(H>>24&255,N>>24&255,(k=k[L-1])>>24&255)+Ve(H>>16&255,N>>16&255,k>>16&255)+Ve(H>>8&255,N>>8&255,k>>8&255)+Ve(255&H,255&N,255&k)?H:N},B.Predictor12=function(N,k,L){var H=k[L+0];return(Ke((N>>24&255)+(H>>24&255)-((k=k[L-1])>>24&255))<<24|Ke((N>>16&255)+(H>>16&255)-(k>>16&255))<<16|Ke((N>>8&255)+(H>>8&255)-(k>>8&255))<<8|Ke((255&N)+(255&H)-(255&k)))>>>0},B.Predictor13=function(N,k,L){var H=k[L-1];return(De((N=Ie(N,k[L+0]))>>24&255,H>>24&255)<<24|De(N>>16&255,H>>16&255)<<16|De(N>>8&255,H>>8&255)<<8|De(255&N,255&H))>>>0};var ZA=B.PredictorAdd0;B.PredictorAdd1=ht,je("Predictor2","PredictorAdd2"),je("Predictor3","PredictorAdd3"),je("Predictor4","PredictorAdd4"),je("Predictor5","PredictorAdd5"),je("Predictor6","PredictorAdd6"),je("Predictor7","PredictorAdd7"),je("Predictor8","PredictorAdd8"),je("Predictor9","PredictorAdd9"),je("Predictor10","PredictorAdd10"),je("Predictor11","PredictorAdd11"),je("Predictor12","PredictorAdd12"),je("Predictor13","PredictorAdd13");var ef=B.PredictorAdd2;dt("ColorIndexInverseTransform","MapARGB","32b",function(N){return N>>8&255},function(N){return N}),dt("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(N){return N},function(N){return N>>8&255});var rv,Cp=B.ColorIndexInverseTransform,ns=B.MapARGB,vT=B.VP8LColorIndexInverseTransformAlpha,yu=B.MapAlpha,Nc=B.VP8LPredictorsAdd=[];Nc.length=16,(B.VP8LPredictors=[]).length=16,(B.VP8LPredictorsAdd_C=[]).length=16,(B.VP8LPredictors_C=[]).length=16;var Np,hb,pb,nv,jp,Sp,tf,Fd,rf,iv,xa,bu,Rn,Un,Ui,gs,Ld,mb,sv,mN,_7,k7,E7,T7,gb,P7,I7,O7,F7=s(511),L7=s(2041),M7=s(225),D7=s(767),R7=0,xT=L7,gN=M7,Ko=D7,Ol=F7,vN=0,xN=1,U7=2,yN=3,bN=4,yT=5,Q7=6,bT=7,wT=8,wN=9,CT=10,yve=[2,3,7],bve=[3,3,11],H7=[280,256,256,256,40],wve=[0,1,1,1,0],Cve=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Nve=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],jve=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Sve=8,NT=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],jT=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],vb=null,Bve=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],_ve=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],$7=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],kve=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],Eve=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],Tve=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],Pve=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],nf=[],jc=[],Md=[],Ive=1,z7=2,sf=[],Fl=[];ga("UpsampleRgbLinePair",vp,3),ga("UpsampleBgrLinePair",Yg,3),ga("UpsampleRgbaLinePair",db,4),ga("UpsampleBgraLinePair",yp,4),ga("UpsampleArgbLinePair",xp,4),ga("UpsampleRgba4444LinePair",va,2),ga("UpsampleRgb565LinePair",Jg,2);var Ove=B.UpsampleRgbLinePair,Fve=B.UpsampleBgrLinePair,W7=B.UpsampleRgbaLinePair,G7=B.UpsampleBgraLinePair,K7=B.UpsampleArgbLinePair,V7=B.UpsampleRgba4444LinePair,Lve=B.UpsampleRgb565LinePair,CN=16,NN=1<H.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),H.ca.f.kb.F!=null&&gi()),H.Pb&&0(le=L.Md)?0:100fe;++fe)12>(Fe=J.pb[fe]).lc&&(Fe.ia=le*zve[0>Fe.lc?0:Fe.lc]>>3),Be|=Fe.ia;Be&&(alert("todo:VP8InitRandom"),J.ia=1)}J.Ga=L.Id,100J.Ga&&(J.Ga=0)}(function(he,ke){if(he==null)return 0;if(ke==null)return un(he,2,"NULL VP8Io parameter in VP8Decode().");if(!he.cb&&!xn(he,ke))return 0;if(t(he.cb),ke.ac==null||ke.ac(ke)){ke.ob&&(he.L=0);var Te=jN[he.L];if(he.L==2?(he.yb=0,he.zb=0):(he.yb=ke.v-Te>>4,he.zb=ke.j-Te>>4,0>he.yb&&(he.yb=0),0>he.zb&&(he.zb=0)),he.Va=ke.o+15+Te>>4,he.Hb=ke.va+15+Te>>4,he.Hb>he.za&&(he.Hb=he.za),he.Va>he.Ub&&(he.Va=he.Ub),0Te;++Te){var Oe;if(he.Qa.Cb){var ze=he.Qa.Lb[Te];he.Qa.Fb||(ze+=Qe.Tb)}else ze=Qe.Tb;for(Oe=0;1>=Oe;++Oe){var We=he.gd[Te][Oe],Ze=ze;if(Qe.Pc&&(Ze+=Qe.vd[0],Oe&&(Ze+=Qe.od[0])),0<(Ze=0>Ze?0:63>2:Xe>>1)>9-Qe.wb&&(Xe=9-Qe.wb),1>Xe&&(Xe=1),We.dd=Xe,We.tc=2*Ze+Xe,We.ld=40<=Ze?2:15<=Ze?1:0}else We.tc=0;We.La=Oe}}}Te=0}else un(he,6,"Frame setup failed"),Te=he.a;if(Te=Te==0){if(Te){he.$c=0,0he.Vb){if(he.Vb=0,he.Ec=s(We),he.Fc=0,he.Ec==null){Te=un(he,1,"no memory during frame initialization.");break t}he.Vb=We}We=he.Ec,Ze=he.Fc,he.Ac=We,he.Bc=Ze,Ze+=Qe,he.Gd=o(zt,Gr),he.Hd=0,he.rb=o(jt+1,wt),he.sb=1,he.wa=Br?o(Br,ms):null,he.Y=0,he.D.Nb=0,he.D.wa=he.wa,he.D.Y=he.Y,0=Te;++Te)F7[255+Te]=0>Te?-Te:Te;for(Te=-1020;1020>=Te;++Te)L7[1020+Te]=-128>Te?-128:127=Te;++Te)M7[112+Te]=-16>Te?-16:15=Te;++Te)D7[255+Te]=0>Te?0:255nn;++nn){var xs,sn=za[0+nn];for(xs=0;4>xs;++xs){sn=Eve[Yn[Ys+xs]][sn];for(var yn=$7[ge(Cr,sn[0])];0>3;for(yn=0;256>yn;yn+=16)nn[ya+yn]=bo}Js=1,Sc=Ys[0]}var Pn=15&Cr.la,ys=15&Wa.la;for(yn=0;4>yn;++yn){var Vo=1&ys;for(bo=bn=0;4>bo;++bo)Pn=Pn>>1|(Vo=(Hi=vb(Yn,Sc,Hi=Vo+(1&Pn),Si.Sc,Js,nn,ya))>Js)<<7,bn=bn<<2|(3>=4,ys=ys>>1|Vo<<7,xs=(xs<<8|bn)>>>0}for(Sc=Pn,Js=ys>>4,Bi=0;4>Bi;Bi+=2){for(bn=0,Pn=Cr.la>>4+Bi,ys=Wa.la>>4+Bi,yn=0;2>yn;++yn){for(Vo=1&ys,bo=0;2>bo;++bo)Hi=Vo+(1&Pn),Pn=Pn>>1|(Vo=0<(Hi=vb(Yn,Ys[2],Hi,Si.Qc,0,nn,ya)))<<3,bn=bn<<2|(3>=2,ys=ys>>1|Vo<<5}sn|=bn<<4*Bi,Sc|=Pn<<4<=Rt.zb&&Rt.M<=Rt.Va,Rt.Aa==0)t:{if(_r.M=Rt.M,_r.uc=Cr,Zg(Rt,_r),Qi=1,_r=(bn=Rt.D).Nb,Cr=(sn=jN[Rt.L])*Rt.R,Yn=sn/2*Rt.B,yn=16*_r*Rt.R,bo=8*_r*Rt.B,Ys=Rt.sa,za=Rt.ta-Cr+yn,Si=Rt.qa,nn=Rt.ra-Yn+bo,ya=Rt.Ha,Wa=Rt.Ia-Yn+bo,ys=(Pn=bn.M)==0,xs=Pn>=Rt.Va-1,Rt.Aa==2&&Zg(Rt,bn),bn.uc)for(Vo=(Hi=Rt).D.M,t(Hi.D.uc),bn=Hi.yb;bnct.o&&(Pn=ct.o),ct.F=null,ct.J=null,Rt.Fa!=null&&0>1),ct.W+=Rt.B*(sn>>1),ct.F!=null&&(ct.J+=ct.width*sn)),bn>1,ct.W+=ct.v>>1,ct.F!=null&&(ct.J+=ct.v),ct.ka=bn-ct.j,ct.U=ct.va-ct.v,ct.T=Pn-bn,Qi=ct.put(ct))}_r+1!=Rt.Ic||xs||(n(Rt.sa,Rt.ta-Cr,Ys,za+16*Rt.R,Cr),n(Rt.qa,Rt.ra-Yn,Si,nn+8*Rt.B,Yn),n(Rt.Ha,Rt.Ia-Yn,ya,Wa+8*Rt.B,Yn))}if(!Qi)return un(qr,6,"Output aborted.")}return 1}(he,ke)),ke.bc!=null&&ke.bc(ke),Te&=1}return Te?(he.cb=0,Te):0})(N,H)||(k=N.a)}}else k=N.a}k==0&&ee.Oa!=null&&ee.Oa.fd&&(k=bp(ee.ba))}ee=k}Z=ee!=0?null:11>Z?se.f.RGBA.eb:se.f.kb.y}else Z=null;return Z};var J7=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function u(B,I){for(var P="",E=0;E<4;E++)P+=String.fromCharCode(B[I++]);return P}function d(B,I){return B[I+0]|B[I+1]<<8}function A(B,I){return(B[I+0]|B[I+1]<<8|B[I+2]<<16)>>>0}function h(B,I){return(B[I+0]|B[I+1]<<8|B[I+2]<<16|B[I+3]<<24)>>>0}new c;var f=[0],m=[0],p=[],g=new c,v=e,x=function(B,I){var P={},E=0,M=!1,_=0,R=0;if(P.frames=[],!function(O,W){for(var V=0;V<4;V++)if(O[W+V]!="RIFF".charCodeAt(V))return!0;return!1}(B,I)){for(h(B,I+=4),I+=8;I>1&1}G!="ANMF"&&(I+=Q)}return P}}(v,0);x.response=v,x.rgbaoutput=!0,x.dataurl=!1;var y=x.header?x.header:null,b=x.frames?x.frames:null;if(y){y.loop_counter=y.loop_count,f=[y.canvas_height],m=[y.canvas_width];for(var C=0;C'+r.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")+"",this.internal.__metadata__.metadataObjectNumber=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+e.length+" >>"),this.internal.write("stream"),this.internal.write(e),this.internal.write("endstream"),this.internal.write("endobj")}function c1t(){this.internal.__metadata__.metadataObjectNumber&&this.internal.write("/Metadata "+this.internal.__metadata__.metadataObjectNumber+" 0 R")}(function(e){var t,r,n,i,s,o,l,c,u,d=function(O){return O=O||{},this.isStrokeTransparent=O.isStrokeTransparent||!1,this.strokeOpacity=O.strokeOpacity||1,this.strokeStyle=O.strokeStyle||"#000000",this.fillStyle=O.fillStyle||"#000000",this.isFillTransparent=O.isFillTransparent||!1,this.fillOpacity=O.fillOpacity||1,this.font=O.font||"10px sans-serif",this.textBaseline=O.textBaseline||"alphabetic",this.textAlign=O.textAlign||"left",this.lineWidth=O.lineWidth||1,this.lineJoin=O.lineJoin||"miter",this.lineCap=O.lineCap||"butt",this.path=O.path||[],this.transform=O.transform!==void 0?O.transform.clone():new c,this.globalCompositeOperation=O.globalCompositeOperation||"normal",this.globalAlpha=O.globalAlpha||1,this.clip_path=O.clip_path||[],this.currentPoint=O.currentPoint||new o,this.miterLimit=O.miterLimit||10,this.lastPoint=O.lastPoint||new o,this.lineDashOffset=O.lineDashOffset||0,this.lineDash=O.lineDash||[],this.margin=O.margin||[0,0,0,0],this.prevPageLastElemOffset=O.prevPageLastElemOffset||0,this.ignoreClearRect=typeof O.ignoreClearRect!="boolean"||O.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new A(this),t=this.internal.f2,r=this.internal.getCoordinateString,n=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,s=this.internal.getVerticalCoordinate,o=this.internal.Point,l=this.internal.Rectangle,c=this.internal.Matrix,u=new d}]);var A=function(O){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var W=O;Object.defineProperty(this,"pdf",{get:function(){return W}});var V=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return V},set:function(K){V=!!K}});var X=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return X},set:function(K){X=!!K}});var ne=0;Object.defineProperty(this,"posX",{get:function(){return ne},set:function(K){isNaN(K)||(ne=K)}});var oe=0;Object.defineProperty(this,"posY",{get:function(){return oe},set:function(K){isNaN(K)||(oe=K)}}),Object.defineProperty(this,"margin",{get:function(){return u.margin},set:function(K){var we;typeof K=="number"?we=[K,K,K,K]:((we=new Array(4))[0]=K[0],we[1]=K.length>=2?K[1]:we[0],we[2]=K.length>=3?K[2]:we[0],we[3]=K.length>=4?K[3]:we[1]),u.margin=we}});var pe=!1;Object.defineProperty(this,"autoPaging",{get:function(){return pe},set:function(K){pe=K}});var de=0;Object.defineProperty(this,"lastBreak",{get:function(){return de},set:function(K){de=K}});var ge=[];Object.defineProperty(this,"pageBreaks",{get:function(){return ge},set:function(K){ge=K}}),Object.defineProperty(this,"ctx",{get:function(){return u},set:function(K){K instanceof d&&(u=K)}}),Object.defineProperty(this,"path",{get:function(){return u.path},set:function(K){u.path=K}});var ie=[];Object.defineProperty(this,"ctxStack",{get:function(){return ie},set:function(K){ie=K}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(K){var we;we=h(K),this.ctx.fillStyle=we.style,this.ctx.isFillTransparent=we.a===0,this.ctx.fillOpacity=we.a,this.pdf.setFillColor(we.r,we.g,we.b,{a:we.a}),this.pdf.setTextColor(we.r,we.g,we.b,{a:we.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(K){var we=h(K);this.ctx.strokeStyle=we.style,this.ctx.isStrokeTransparent=we.a===0,this.ctx.strokeOpacity=we.a,we.a===0?this.pdf.setDrawColor(255,255,255):(we.a,this.pdf.setDrawColor(we.r,we.g,we.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(K){["butt","round","square"].indexOf(K)!==-1&&(this.ctx.lineCap=K,this.pdf.setLineCap(K))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(K){isNaN(K)||(this.ctx.lineWidth=K,this.pdf.setLineWidth(K))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(K){["bevel","round","miter"].indexOf(K)!==-1&&(this.ctx.lineJoin=K,this.pdf.setLineJoin(K))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(K){isNaN(K)||(this.ctx.miterLimit=K,this.pdf.setMiterLimit(K))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(K){this.ctx.textBaseline=K}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(K){["right","end","center","left","start"].indexOf(K)!==-1&&(this.ctx.textAlign=K)}});var ue=null,Se=null,D=null;Object.defineProperty(this,"fontFaces",{get:function(){return D},set:function(K){ue=null,Se=null,D=K}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(K){var we;if(this.ctx.font=K,(we=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(K))!==null){var ae=we[1];we[2];var te=we[3],ce=we[4];we[5];var be=we[6],je=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(ce)[2];ce=Math.floor(je==="px"?parseFloat(ce)*this.pdf.internal.scaleFactor:je==="em"?parseFloat(ce)*this.pdf.getFontSize():parseFloat(ce)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(ce);var xe=function(dt){var Sr,Tt,qt=[],nr=dt.trim();if(nr==="")return q3;if(nr in gJ)return[gJ[nr]];for(;nr!=="";){switch(Tt=null,Sr=(nr=xJ(nr)).charAt(0)){case'"':case"'":Tt=r1t(nr.substring(1),Sr);break;default:Tt=n1t(nr)}if(Tt===null||(qt.push(Tt[0]),(nr=xJ(Tt[1]))!==""&&nr.charAt(0)!==","))return q3;nr=nr.replace(/^,/,"")}return qt}(be);if(this.fontFaces){var Ie=function(dt,Sr){var Tt=dt.getFontList(),qt=JSON.stringify(Tt);if(ue===null||Se!==qt){var nr=function(hr){var Mt=[];return Object.keys(hr).forEach(function(Vr){hr[Vr].forEach(function(Ht){var $t=null;switch(Ht){case"bold":$t={family:Vr,weight:"bold"};break;case"italic":$t={family:Vr,style:"italic"};break;case"bolditalic":$t={family:Vr,weight:"bold",style:"italic"};break;case"":case"normal":$t={family:Vr}}$t!==null&&($t.ref={name:Vr,style:Ht},Mt.push($t))})}),Mt}(Tt);ue=function(hr){for(var Mt={},Vr=0;Vr=700||ae==="bold")&&(Ve="bold"),ae==="italic"&&(Ve+="italic"),Ve.length===0&&(Ve="normal");for(var ht="",ft={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},ut=0;ut=2*Math.PI&&(X=0,ne=2*Math.PI),this.path.push({type:"arc",x:O,y:W,radius:V,startAngle:X,endAngle:ne,counterclockwise:oe})},A.prototype.arcTo=function(O,W,V,X,ne){throw new Error("arcTo not implemented.")},A.prototype.rect=function(O,W,V,X){if(isNaN(O)||isNaN(W)||isNaN(V)||isNaN(X))throw In.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(O,W),this.lineTo(O+V,W),this.lineTo(O+V,W+X),this.lineTo(O,W+X),this.lineTo(O,W),this.lineTo(O+V,W),this.lineTo(O,W)},A.prototype.fillRect=function(O,W,V,X){if(isNaN(O)||isNaN(W)||isNaN(V)||isNaN(X))throw In.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!f.call(this)){var ne={};this.lineCap!=="butt"&&(ne.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(ne.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(O,W,V,X),this.fill(),ne.hasOwnProperty("lineCap")&&(this.lineCap=ne.lineCap),ne.hasOwnProperty("lineJoin")&&(this.lineJoin=ne.lineJoin)}},A.prototype.strokeRect=function(O,W,V,X){if(isNaN(O)||isNaN(W)||isNaN(V)||isNaN(X))throw In.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");m.call(this)||(this.beginPath(),this.rect(O,W,V,X),this.stroke())},A.prototype.clearRect=function(O,W,V,X){if(isNaN(O)||isNaN(W)||isNaN(V)||isNaN(X))throw In.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(O,W,V,X))},A.prototype.save=function(O){O=typeof O!="boolean"||O;for(var W=this.pdf.internal.getCurrentPageInfo().pageNumber,V=0;V0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};A.prototype.drawImage=function(O,W,V,X,ne,oe,pe,de,ge){var ie=this.pdf.getImageProperties(O),ue=1,Se=1,D=1,K=1;X!==void 0&&de!==void 0&&(D=de/X,K=ge/ne,ue=ie.width/X*de/X,Se=ie.height/ne*ge/ne),oe===void 0&&(oe=W,pe=V,W=0,V=0),X!==void 0&&de===void 0&&(de=X,ge=ne),X===void 0&&de===void 0&&(de=ie.width,ge=ie.height);var we=this.ctx.transform.decompose(),ae=Q(we.rotate.shx),te=new c,ce=(te=(te=(te=te.multiply(we.translate)).multiply(we.skew)).multiply(we.scale)).applyToRectangle(new l(oe-W*D,pe-V*K,X*ue,ne*Se));if(this.autoPaging){for(var be,je=g.call(this,ce),xe=[],Ie=0;IeKe||Vece||je0)){for(;ge>=0;ge--)if(ne[ge-1].close!==!0&&ne[ge-1].begin!==!0){ne[ge-1].deltas.push(V),ne[ge-1].abs.push(de);break}}break;case"bct":V=[de.x1-oe[pe-1].x,de.y1-oe[pe-1].y,de.x2-oe[pe-1].x,de.y2-oe[pe-1].y,de.x-oe[pe-1].x,de.y-oe[pe-1].y],ne[ne.length-1].deltas.push(V);break;case"qct":var ie=oe[pe-1].x+2/3*(de.x1-oe[pe-1].x),ue=oe[pe-1].y+2/3*(de.y1-oe[pe-1].y),Se=de.x+2/3*(de.x1-de.x),D=de.y+2/3*(de.y1-de.y),K=de.x,we=de.y;V=[ie-oe[pe-1].x,ue-oe[pe-1].y,Se-oe[pe-1].x,D-oe[pe-1].y,K-oe[pe-1].x,we-oe[pe-1].y],ne[ne.length-1].deltas.push(V);break;case"arc":ne.push({deltas:[],abs:[],arc:!0}),Array.isArray(ne[ne.length-1].abs)&&ne[ne.length-1].abs.push(de)}}X=W?null:O==="stroke"?"stroke":"fill";for(var ae=!1,te=0;te=.01&&(X=this.pdf.internal.getFontSize(),this.pdf.setFontSize(X*O.scale),ne=this.lineWidth,this.lineWidth=ne*O.scale);var Qt=this.autoPaging!=="text";if(Qt||ut.y+ut.h<=Ie){if(Qt||ut.y>=je&&ut.x<=De){var dt=Qt?O.text:this.pdf.splitTextToSize(O.text,O.maxWidth||De-ut.x)[0],Sr=x([JSON.parse(JSON.stringify(Se))],this.posX+this.margin[3],-ht+je+this.ctx.prevPageLastElemOffset)[0],Tt=Qt&&(be>te||be=.01&&(this.pdf.setFontSize(X),this.lineWidth=ne)}}else O.scale>=.01&&(X=this.pdf.internal.getFontSize(),this.pdf.setFontSize(X*O.scale),ne=this.lineWidth,this.lineWidth=ne*O.scale),this.pdf.text(O.text,ge.x+this.posX,ge.y+this.posY,{angle:O.angle,align:W,renderingMode:O.renderingMode,maxWidth:O.maxWidth}),O.scale>=.01&&(this.pdf.setFontSize(X),this.lineWidth=ne)},M=function(O,W,V,X){V=V||0,X=X||0,this.pdf.internal.out(r(O+V)+" "+n(W+X)+" l")},_=function(O,W,V){return this.pdf.lines(O,W,V,null,null)},R=function(O,W,V,X,ne,oe,pe,de){this.pdf.internal.out([t(i(V+O)),t(s(X+W)),t(i(ne+O)),t(s(oe+W)),t(i(pe+O)),t(s(de+W)),"c"].join(" "))},G=function(O,W,V,X){for(var ne=2*Math.PI,oe=Math.PI/2;W>V;)W-=ne;var pe=Math.abs(V-W);pe1e-5;){var ue=ie+ge*Math.min(pe,oe);de.push(U.call(this,O,ie,ue)),pe-=Math.abs(ue-ie),ie=ue}return de},U=function(O,W,V){var X=(V-W)/2,ne=O*Math.cos(X),oe=O*Math.sin(X),pe=ne,de=-oe,ge=pe*pe+de*de,ie=ge+pe*ne+de*oe,ue=4/3*(Math.sqrt(2*ge*ie)-ie)/(pe*oe-de*ne),Se=pe-ue*de,D=de+ue*pe,K=Se,we=-D,ae=X+W,te=Math.cos(ae),ce=Math.sin(ae);return{x1:O*Math.cos(W),y1:O*Math.sin(W),x2:Se*te-D*ce,y2:Se*ce+D*te,x3:K*te-we*ce,y3:K*ce+we*te,x4:O*Math.cos(V),y4:O*Math.sin(V)}},Q=function(O){return 180*O/Math.PI},z=function(O,W,V,X,ne,oe){var pe=O+.5*(V-O),de=W+.5*(X-W),ge=ne+.5*(V-ne),ie=oe+.5*(X-oe),ue=Math.min(O,ne,pe,ge),Se=Math.max(O,ne,pe,ge),D=Math.min(W,oe,de,ie),K=Math.max(W,oe,de,ie);return new l(ue,D,Se-ue,K-D)},Y=function(O,W,V,X,ne,oe,pe,de){var ge,ie,ue,Se,D,K,we,ae,te,ce,be,je,xe,Ie,Ke=V-O,De=X-W,Ve=ne-V,ht=oe-X,ft=pe-ne,ut=de-oe;for(ie=0;ie<41;ie++)te=(we=(ue=O+(ge=ie/40)*Ke)+ge*((D=V+ge*Ve)-ue))+ge*(D+ge*(ne+ge*ft-D)-we),ce=(ae=(Se=W+ge*De)+ge*((K=X+ge*ht)-Se))+ge*(K+ge*(oe+ge*ut-K)-ae),ie==0?(be=te,je=ce,xe=te,Ie=ce):(be=Math.min(be,te),je=Math.min(je,ce),xe=Math.max(xe,te),Ie=Math.max(Ie,ce));return new l(Math.round(be),Math.round(je),Math.round(xe-be),Math.round(Ie-je))},$=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var O,W,V=(O=this.ctx.lineDash,W=this.ctx.lineDashOffset,JSON.stringify({lineDash:O,lineDashOffset:W}));this.prevLineDash!==V&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=V)}}})(Wt.API),function(e){var t=function(o){var l,c,u,d,A,h,f,m,p,g;for(c=[],u=0,d=(o+=l="\0\0\0\0".slice(o.length%4||4)).length;d>u;u+=4)(A=(o.charCodeAt(u)<<24)+(o.charCodeAt(u+1)<<16)+(o.charCodeAt(u+2)<<8)+o.charCodeAt(u+3))!==0?(h=(A=((A=((A=((A=(A-(g=A%85))/85)-(p=A%85))/85)-(m=A%85))/85)-(f=A%85))/85)%85,c.push(h+33,f+33,m+33,p+33,g+33)):c.push(122);return function(v,x){for(var y=x;y>0;y--)v.pop()}(c,l.length),String.fromCharCode.apply(String,c)+"~>"},r=function(o){var l,c,u,d,A,h=String,f="length",m=255,p="charCodeAt",g="slice",v="replace";for(o[g](-2),o=o[g](0,-2)[v](/\s/g,"")[v]("z","!!!!!"),u=[],d=0,A=(o+=l="uuuuu"[g](o[f]%5||5))[f];A>d;d+=5)c=52200625*(o[p](d)-33)+614125*(o[p](d+1)-33)+7225*(o[p](d+2)-33)+85*(o[p](d+3)-33)+(o[p](d+4)-33),u.push(m&c>>24,m&c>>16,m&c>>8,m&c);return function(x,y){for(var b=y;b>0;b--)x.pop()}(u,l[f]),h.fromCharCode.apply(h,u)},n=function(o){return o.split("").map(function(l){return("0"+l.charCodeAt().toString(16)).slice(-2)}).join("")+">"},i=function(o){var l=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((o=o.replace(/\s/g,"")).indexOf(">")!==-1&&(o=o.substr(0,o.indexOf(">"))),o.length%2&&(o+="0"),l.test(o)===!1)return"";for(var c="",u=0;uPromise.resolve().then(()=>byt),void 0)).catch(function(l){return Promise.reject(new Error("Could not load html2canvas: "+l))}).then(function(l){return l.default?l.default:l})}function r(){return(ur.DOMPurify?Promise.resolve(ur.DOMPurify):lc(()=>Promise.resolve().then(()=>NPe),void 0)).catch(function(l){return Promise.reject(new Error("Could not load dompurify: "+l))}).then(function(l){return l.default?l.default:l})}var n=function(l){var c=Nn(l);return c==="undefined"?"undefined":c==="string"||l instanceof String?"string":c==="number"||l instanceof Number?"number":c==="function"||l instanceof Function?"function":l&&l.constructor===Array?"array":l&&l.nodeType===1?"element":c==="object"?"object":"unknown"},i=function(l,c){var u=document.createElement(l);for(var d in c.className&&(u.className=c.className),c.innerHTML&&c.dompurify&&(u.innerHTML=c.dompurify.sanitize(c.innerHTML)),c.style)u.style[d]=c.style[d];return u},s=function l(c,u){for(var d=c.nodeType===3?document.createTextNode(c.nodeValue):c.cloneNode(!1),A=c.firstChild;A;A=A.nextSibling)u!==!0&&A.nodeType===1&&A.nodeName==="SCRIPT"||d.appendChild(l(A,u));return c.nodeType===1&&(c.nodeName==="CANVAS"?(d.width=c.width,d.height=c.height,d.getContext("2d").drawImage(c,0,0)):c.nodeName!=="TEXTAREA"&&c.nodeName!=="SELECT"||(d.value=c.value),d.addEventListener("load",function(){d.scrollTop=c.scrollTop,d.scrollLeft=c.scrollLeft},!0)),d},o=function l(c){var u=Object.assign(l.convert(Promise.resolve()),JSON.parse(JSON.stringify(l.template))),d=l.convert(Promise.resolve(),u);return(d=d.setProgress(1,l,1,[l])).set(c)};(o.prototype=Object.create(Promise.prototype)).constructor=o,o.convert=function(l,c){return l.__proto__=c||o.prototype,l},o.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},o.prototype.from=function(l,c){return this.then(function(){switch(c=c||function(u){switch(n(u)){case"string":return"string";case"element":return u.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(l),c){case"string":return this.then(r).then(function(u){return this.set({src:i("div",{innerHTML:l,dompurify:u})})});case"element":return this.set({src:l});case"canvas":return this.set({canvas:l});case"img":return this.set({img:l});default:return this.error("Unknown source type.")}})},o.prototype.to=function(l){switch(l){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},o.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var l={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},c=s(this.prop.src,this.opt.html2canvas.javascriptEnabled);c.tagName==="BODY"&&(l.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:l}),this.prop.container.appendChild(c),this.prop.container.firstChild.appendChild(i("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},o.prototype.toCanvas=function(){var l=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(l).then(t).then(function(c){var u=Object.assign({},this.opt.html2canvas);return delete u.onrendered,c(this.prop.container,u)}).then(function(c){(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},o.prototype.toContext2d=function(){var l=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(l).then(t).then(function(c){var u=this.opt.jsPDF,d=this.opt.fontFaces,A=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,h=Object.assign({async:!0,allowTaint:!0,scale:A,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete h.onrendered,u.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,u.context2d.posX=this.opt.x,u.context2d.posY=this.opt.y,u.context2d.margin=this.opt.margin,u.context2d.fontFaces=d,d)for(var f=0;fp&&(m=g,g=p,p=m);else{if(l!=="l"&&l!=="landscape")throw"Invalid orientation: "+l;l="l",p>g&&(m=g,g=p,p=m)}return{width:g,height:p,unit:c,k:A,orientation:l}},e.html=function(l,c){(c=c||{}).callback=c.callback||function(){},c.html2canvas=c.html2canvas||{},c.html2canvas.canvas=c.html2canvas.canvas||this.canvas,c.jsPDF=c.jsPDF||this,c.fontFaces=c.fontFaces?c.fontFaces.map(V3):null;var u=new o(c);return c.worker?u:u.from(l).doCallback()}}(Wt.API),Wt.API.addJS=function(e){var t,r,n=function(i){for(var s="",o=0;o=0&&i[u]==="\\";u--)c++;s+=c%2==0?"\\"+l:l}else s+=l}return s}(e);return this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(t+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),r=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+n+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){t!==void 0&&r!==void 0&&this.internal.out("/Names <>")}),this},function(e){var t;e.events.push(["postPutResources",function(){var r=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=r.outline.render().split(/\r\n/),s=0;s> endobj")}var f=r.internal.newObject();for(r.internal.write("<< /Names [ "),s=0;s>","endobj"),t=r.internal.newObject(),r.internal.write("<< /Dests "+f+" 0 R"),r.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){var r=this;r.outline.root.children.length>0&&(r.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&r.internal.write("/Names "+t+" 0 R"))}]),e.events.push(["initialized",function(){var r=this;r.outline={createNamedDestinations:!1,root:{children:[]}},r.outline.add=function(n,i,s){var o={title:i,options:s,children:[]};return n==null&&(n=this.root),n.children.push(o),o},r.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=r,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},r.outline.genIds_r=function(n){n.id=r.internal.newObjectDeferred();for(var i=0;i0&&(this.line("/First "+this.makeRef(n.children[0])),this.line("/Last "+this.makeRef(n.children[n.children.length-1]))),this.line("/Count "+this.count_r({count:0},n)),this.objEnd()},r.outline.renderItems=function(n){for(var i=this.ctx.pdf.internal.getVerticalCoordinateString,s=0;s0&&this.line("/Prev "+this.makeRef(n.children[s-1])),s0&&(this.line("/First "+this.makeRef(o.children[0])),this.line("/Last "+this.makeRef(o.children[o.children.length-1])));var l=this.count=this.count_r({count:0},o);if(l>0&&this.line("/Count "+l),o.options&&o.options.pageNumber){var c=r.internal.getPageInfo(o.options.pageNumber);this.line("/Dest ["+c.objId+" 0 R /XYZ 0 "+i(0)+" 0]")}this.objEnd()}for(var u=0;u> \r endobj\r `},r.outline.count_r=function(n,i){for(var s=0;s1){_=!0,G=void 0;var ne=B*I;U=new Uint8Array(ne);for(var oe=new DataView(P.buffer),pe=0;pe536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");this.data=new Uint8Array(t);try{this[e]()}catch(r){In.log("bit decode error:"+r)}},Tc.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),r=t%4;for(e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,i=0;i>7-l&1];this.data[o+4*l]=c.blue,this.data[o+4*l+1]=c.green,this.data[o+4*l+2]=c.red,this.data[o+4*l+3]=255}r!==0&&(this.pos+=4-r)}},Tc.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,i=0;i>4,c=15&s,u=this.palette[l];if(this.data[o]=u.blue,this.data[o+1]=u.green,this.data[o+2]=u.red,this.data[o+3]=255,2*i+1>=this.width)break;u=this.palette[c],this.data[o+4]=u.blue,this.data[o+4+1]=u.green,this.data[o+4+2]=u.red,this.data[o+4+3]=255}t!==0&&(this.pos+=4-t)}},Tc.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,n=0;n=0;r--){for(var n=this.bottom_up?r:this.height-1-r,i=0;i>5&t)/t*255|0,c=(s>>10&t)/t*255|0,u=s>>15?255:0,d=n*this.width*4+4*i;this.data[d]=c,this.data[d+1]=l,this.data[d+2]=o,this.data[d+3]=u}this.pos+=e}},Tc.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),r=parseInt("111111",2),n=this.height-1;n>=0;n--){for(var i=this.bottom_up?n:this.height-1-n,s=0;s>5&r)/r*255|0,u=(o>>11)/t*255|0,d=i*this.width*4+4*s;this.data[d]=u,this.data[d+1]=c,this.data[d+2]=l,this.data[d+3]=255}this.pos+=e}},Tc.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,r=0;r=0;e--)for(var t=this.bottom_up?e:this.height-1-e,r=0;rn&&(i.push(e.slice(c,s)),l=0,c=s),l+=t[s],s++;return c!==s&&i.push(e.slice(c,s)),i},wJ=function(e,t,r){r||(r={});var n,i,s,o,l,c,u,d=[],A=[d],h=r.textIndent||0,f=0,m=0,p=e.split(" "),g=vS.apply(this,[" ",r])[0];if(c=r.lineIndent===-1?p[0].length+2:r.lineIndent||0){var v=Array(c).join(" "),x=[];p.map(function(b){(b=b.split(/\s*\n/)).length>1?x=x.concat(b.map(function(C,j){return(j&&C.length?` `:"")+C})):x.push(b[0])}),p=x,c=yJ.apply(this,[v,r])}for(s=0,o=p.length;st||y){if(m>t){for(l=bJ.apply(this,[n,i,t-(h+f),t]),d.push(l.shift()),d=[l.pop()];l.length;)A.push([l.shift()]);m=i.slice(n.length-(d[0]?d[0].length:0)).reduce(function(b,C){return b+C},0)}else d=[n];A.push(d),h=m+c,f=g}else d.push(n),h+=f+m,f=g}return u=c?function(b,C){return(C?v:"")+b.join(" ")}:function(b){return b.join(" ")},A.map(u)},Dv.splitTextToSize=function(e,t,r){var n,i=(r=r||{}).fontSize||this.internal.getFontSize(),s=(function(d){if(d.widths&&d.kerning)return{widths:d.widths,kerning:d.kerning};var A=this.internal.getFont(d.fontName,d.fontStyle),h="Unicode";return A.metadata[h]?{widths:A.metadata[h].widths||{0:1},kerning:A.metadata[h].kerning||{}}:{font:A.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,r);n=Array.isArray(e)?e:String(e).split(/\r?\n/);var o=1*this.internal.scaleFactor*t/i;s.textIndent=r.textIndent?1*r.textIndent*this.internal.scaleFactor/i:0,s.lineIndent=r.lineIndent;var l,c,u=[];for(l=0,c=n.length;limport("./index.es-DV7h-XjM.js"),[])).catch(function(h){return Promise.reject(new Error("Could not load canvg: "+h))}).then(function(h){return h.default?h.default:h}).then(function(h){return h.fromString(u,e,d)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(h){return h.render(d)}).then(function(){A.addImage(c.toDataURL("image/jpeg",1),t,r,n,i,o,l)})},Wt.API.putTotalPages=function(e){var t,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),r=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i1){for(d=0;d>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=r,this},Wt.API.addMetadata=function(e,t){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:e,namespaceUri:t??"http://jspdf.default.namespaceuri/",rawXml:typeof t=="boolean"&&t},this.internal.events.subscribe("putCatalog",c1t),this.internal.events.subscribe("postPutResources",l1t)),this},function(e){var t=e.API,r=t.pdfEscape16=function(s,o){for(var l,c=o.metadata.Unicode.widths,u=["","0","00","000","0000"],d=[""],A=0,h=s.length;A> def /CMapName /Adobe-Identity-UCS def /CMapType 2 def 1 begincodespacerange <0000> endcodespacerange`,c=[],A=0,h=(l=Object.keys(s).sort(function(f,m){return f-m})).length;A=100&&(d+=` `+c.length+` beginbfchar `+c.join(` `)+` endbfchar`,c=[]),s[o]!==void 0&&s[o]!==null&&typeof s[o].toString=="function"&&(u=("0000"+s[o].toString(16)).slice(-4),o=("0000"+(+o).toString(16)).slice(-4),c.push("<"+o+"><"+u+">"));return c.length&&(d+=` `+c.length+` beginbfchar `+c.join(` `)+` endbfchar `),d+`endcmap CMapName currentdict /CMap defineresource pop end end`};t.events.push(["putFont",function(s){(function(o){var l=o.font,c=o.out,u=o.newObject,d=o.putStream;if(l.metadata instanceof e.API.TTFFont&&l.encoding==="Identity-H"){for(var A=l.metadata.Unicode.widths,h=l.metadata.subset.encode(l.metadata.glyIdsUsed,1),f="",m=0;m>"),c("endobj");var x=u();c("<<"),c("/Type /Font"),c("/BaseFont /"+Zv(l.fontName)),c("/FontDescriptor "+v+" 0 R"),c("/W "+e.API.PDFObject.convert(A)),c("/CIDToGIDMap /Identity"),c("/DW 1000"),c("/Subtype /CIDFontType2"),c("/CIDSystemInfo"),c("<<"),c("/Supplement 0"),c("/Registry (Adobe)"),c("/Ordering ("+l.encoding+")"),c(">>"),c(">>"),c("endobj"),l.objectNumber=u(),c("<<"),c("/Type /Font"),c("/Subtype /Type0"),c("/ToUnicode "+g+" 0 R"),c("/BaseFont /"+Zv(l.fontName)),c("/Encoding /"+l.encoding),c("/DescendantFonts ["+x+" 0 R]"),c(">>"),c("endobj"),l.isAlreadyPutted=!0}})(s)}]),t.events.push(["putFont",function(s){(function(o){var l=o.font,c=o.out,u=o.newObject,d=o.putStream;if(l.metadata instanceof e.API.TTFFont&&l.encoding==="WinAnsiEncoding"){for(var A=l.metadata.rawData,h="",f=0;f>"),c("endobj"),l.objectNumber=u();for(var v=0;v>"),c("endobj"),l.isAlreadyPutted=!0}})(s)}]);var i=function(s){var o,l=s.text||"",c=s.x,u=s.y,d=s.options||{},A=s.mutex||{},h=A.pdfEscape,f=A.activeFontKey,m=A.fonts,p=f,g="",v=0,x="",y=m[p].encoding;if(m[p].encoding!=="Identity-H")return{text:l,x:c,y:u,options:d,mutex:A};for(x=l,p=f,Array.isArray(l)&&(x=l[0]),v=0;v","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],v=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),x=!1,y=0;this.__bidiEngine__={};var b=function(P){var E=P.charCodeAt(),M=E>>8,_=p[M];return _!==void 0?A[256*_+(255&E)]:M===252||M===253?"AL":v.test(M)?"L":M===8?"R":"N"},C=function(P){for(var E,M=0;M=E.length||(R=M[_-1])!=="EN"&&R!=="AN"||(G=E[_+1])!=="EN"&&G!=="AN"?z="N":x&&(G="AN"),z=G===R?G:"N";break;case"ES":z=(R=_>0?M[_-1]:"B")==="EN"&&_+10&&M[_-1]==="EN"){z="EN";break}if(x){z="N";break}for(U=_+1,Q=E.length;U=1425&&Y<=2303||Y===64286;if(R=E[U],$&&(R==="R"||R==="AL")){z="R";break}}}z=_<1||(R=E[_-1])==="B"?"N":M[_-1];break;case"B":x=!1,i=!0,z=y;break;case"S":s=!0,z="N"}return z},S=function(P,E,M){var _=P.split("");return M&&T(_,M,{hiLevel:y}),_.reverse(),E&&E.reverse(),_.join("")},T=function(P,E,M){var _,R,G,U,Q,z=-1,Y=P.length,$=0,O=[],W=y?f:h,V=[];for(x=!1,i=!1,s=!1,R=0;R0)if(_===16){for(R=z;R-1){for(R=z;R=0&&X[de]==="WS";de--)ne[de]=y}}(V,E,Y)},B=function(P,E,M,_,R){if(!(R.hiLevel=P){for(Q=$+1;Q=P;)Q++;for(z=$,U=Q-1;z=0&&(G[Y]=g[z+1])}(_,M,R),B(2,_,E,M,R),B(1,_,E,M,R),_.join("")};return this.__bidiEngine__.doBidiReorder=function(P,E,M){if(function(R,G){if(G)for(var U=0;U>16)&&(r=-(1+(65535^r))),this.italicAngle=+(r+"."+n)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(s=this.familyClass)===1||s===2||s===3||s===4||s===5||s===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(t){var r;return((r=this.cmap.unicode)!=null?r.codeMap[t]:void 0)||0},e.prototype.widthOfGlyph=function(t){var r;return r=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*r},e.prototype.widthOfString=function(t,r,n){var i,s,o,l;for(o=0,s=0,l=(t=""+t).length;0<=l?sl;s=0<=l?++s:--s)i=t.charCodeAt(s),o+=this.widthOfGlyph(this.characterToGlyph(i))+n*(1e3/r)||0;return o*(r/1e3)},e.prototype.lineHeight=function(t,r){var n;return r==null&&(r=!1),n=r?this.lineGap:0,(this.ascender+n-this.decender)/1e3*t},e}();var hu,Gh=function(){function e(t){this.data=t??[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(t){return this.data[this.pos++]=t},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt32=function(){var t;return(t=this.readUInt32())>=2147483648?t-4294967296:t},e.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt16=function(){var t;return(t=this.readUInt16())>=32768?t-65536:t},e.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},e.prototype.readString=function(t){var r,n;for(n=[],r=0;0<=t?rt;r=0<=t?++r:--r)n[r]=String.fromCharCode(this.readByte());return n.join("")},e.prototype.writeString=function(t){var r,n,i;for(i=[],r=0,n=t.length;0<=n?rn;r=0<=n?++r:--r)i.push(this.writeByte(t.charCodeAt(r)));return i},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(t){return this.writeInt16(t)},e.prototype.readLongLong=function(){var t,r,n,i,s,o,l,c;return t=this.readByte(),r=this.readByte(),n=this.readByte(),i=this.readByte(),s=this.readByte(),o=this.readByte(),l=this.readByte(),c=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^r)+1099511627776*(255^n)+4294967296*(255^i)+16777216*(255^s)+65536*(255^o)+256*(255^l)+(255^c)+1):72057594037927940*t+281474976710656*r+1099511627776*n+4294967296*i+16777216*s+65536*o+256*l+c},e.prototype.writeLongLong=function(t){var r,n;return r=Math.floor(t/4294967296),n=4294967295&t,this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(t){return this.writeInt32(t)},e.prototype.read=function(t){var r,n;for(r=[],n=0;0<=t?nt;n=0<=t?++n:--n)r.push(this.readByte());return r},e.prototype.write=function(t){var r,n,i,s;for(s=[],n=0,i=t.length;ns;i=0<=s?++i:--i)n={tag:r.readString(4),checksum:r.readInt(),offset:r.readInt(),length:r.readInt()},this.tables[n.tag]=n}return t.prototype.encode=function(r){var n,i,s,o,l,c,u,d,A,h,f,m,p;for(p in f=Object.keys(r).length,c=Math.log(2),A=16*Math.floor(Math.log(f)/c),o=Math.floor(A/c),d=16*f-A,(i=new Gh).writeInt(this.scalarType),i.writeShort(f),i.writeShort(A),i.writeShort(o),i.writeShort(d),s=16*f,u=i.pos+s,l=null,m=[],r)for(h=r[p],i.writeString(p),i.writeInt(e(h)),i.writeInt(u),i.writeInt(h.length),m=m.concat(h),p==="head"&&(l=u),u+=h.length;u%4;)m.push(0),u++;return i.write(m),n=2981146554-e(i.data),i.pos=l+8,i.writeUInt32(n),i.data},e=function(r){var n,i,s,o;for(r=sve.call(r);r.length%4;)r.push(0);for(s=new Gh(r),i=0,n=0,o=r.length;nh;c=0<=h?++b:--b)C.push(t.readUInt16());return C}(),t.pos+=2,p=function(){var b,C;for(C=[],c=b=0;0<=h?bh;c=0<=h?++b:--b)C.push(t.readUInt16());return C}(),u=function(){var b,C;for(C=[],c=b=0;0<=h?bh;c=0<=h?++b:--b)C.push(t.readUInt16());return C}(),d=function(){var b,C;for(C=[],c=b=0;0<=h?bh;c=0<=h?++b:--b)C.push(t.readUInt16());return C}(),i=(this.length-t.pos+this.offset)/2,l=function(){var b,C;for(C=[],c=b=0;0<=i?bi;c=0<=i?++b:--b)C.push(t.readUInt16());return C}(),c=v=0,y=s.length;v=g;n=m<=g?++x:--x)d[c]===0?o=n+u[c]:(o=l[d[c]/2+(n-m)-(h-c)]||0)!==0&&(o+=u[c]),this.codeMap[n]=65535&o}t.pos=A}return e.encode=function(t,r){var n,i,s,o,l,c,u,d,A,h,f,m,p,g,v,x,y,b,C,j,S,T,B,I,P,E,M,_,R,G,U,Q,z,Y,$,O,W,V,X,ne,oe,pe,de,ge,ie,ue;switch(_=new Gh,o=Object.keys(t).sort(function(Se,D){return Se-D}),r){case"macroman":for(p=0,g=function(){var Se=[];for(m=0;m<256;++m)Se.push(0);return Se}(),x={0:0},s={},R=0,z=o.length;R=32768)for(c.push(0),j.push(2*(f.length+B-m)),i=Q=P;P<=d?Q<=d:Q>=d;i=P<=d?++Q:--Q)f.push(n[i].new);else c.push(M-P),j.push(0)}for(_.writeUInt16(3),_.writeUInt16(1),_.writeUInt32(12),_.writeUInt16(4),_.writeUInt16(16+8*B+2*f.length),_.writeUInt16(0),_.writeUInt16(I),_.writeUInt16(T),_.writeUInt16(h),_.writeUInt16(S),oe=0,O=A.length;oei;n=0<=i?++n:--n)r=new TJ(t,this.offset),this.tables.push(r),r.isUnicode&&this.unicode==null&&(this.unicode=r);return!0},e.encode=function(t,r){var n,i;return r==null&&(r="macroman"),n=TJ.encode(t,r),(i=new Gh).writeUInt16(0),i.writeUInt16(1),n.table=i.data.concat(n.subtable),n},e}(),f1t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Nd(e,hu),e.prototype.tag="hhea",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},e}(),h1t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Nd(e,hu),e.prototype.tag="OS/2",e.prototype.parse=function(t){if(t.pos=this.offset,this.version=t.readUInt16(),this.averageCharWidth=t.readShort(),this.weightClass=t.readUInt16(),this.widthClass=t.readUInt16(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort(),this.ySubscriptYSize=t.readShort(),this.ySubscriptXOffset=t.readShort(),this.ySubscriptYOffset=t.readShort(),this.ySuperscriptXSize=t.readShort(),this.ySuperscriptYSize=t.readShort(),this.ySuperscriptXOffset=t.readShort(),this.ySuperscriptYOffset=t.readShort(),this.yStrikeoutSize=t.readShort(),this.yStrikeoutPosition=t.readShort(),this.familyClass=t.readShort(),this.panose=function(){var r,n;for(n=[],r=0;r<10;++r)n.push(t.readByte());return n}(),this.charRange=function(){var r,n;for(n=[],r=0;r<4;++r)n.push(t.readInt());return n}(),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort(),this.descent=t.readShort(),this.lineGap=t.readShort(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=function(){var r,n;for(n=[],r=0;r<2;r=++r)n.push(t.readInt());return n}(),this.version>1))return this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()},e}(),p1t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Nd(e,hu),e.prototype.tag="post",e.prototype.parse=function(t){var r,n,i;switch(t.pos=this.offset,this.format=t.readInt(),this.italicAngle=t.readInt(),this.underlinePosition=t.readShort(),this.underlineThickness=t.readShort(),this.isFixedPitch=t.readInt(),this.minMemType42=t.readInt(),this.maxMemType42=t.readInt(),this.minMemType1=t.readInt(),this.maxMemType1=t.readInt(),this.format){case 65536:case 196608:break;case 131072:var s;for(n=t.readUInt16(),this.glyphNameIndex=[],s=0;0<=n?sn;s=0<=n?++s:--s)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],i=[];t.posl;s=0<=l?++o:--o)c.push(t.readUInt32());return c}).call(this)}},e}(),m1t=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},g1t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Nd(e,hu),e.prototype.tag="name",e.prototype.parse=function(t){var r,n,i,s,o,l,c,u,d,A,h;for(t.pos=this.offset,t.readShort(),r=t.readShort(),l=t.readShort(),n=[],s=0;0<=r?sr;s=0<=r?++s:--s)n.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+l+t.readShort()});for(c={},s=d=0,A=n.length;dl;r=0<=l?++r:--r)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(i=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var u,d;for(d=[],r=u=0;0<=i?ui;r=0<=i?++u:--u)d.push(t.readInt16());return d}(),this.widths=(function(){var u,d,A,h;for(h=[],u=0,d=(A=this.metrics).length;ui;r=0<=i?++o:--o)c.push(this.widths.push(n));return c},e.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},e}(),sve=[].slice,y1t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Nd(e,hu),e.prototype.tag="glyf",e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(t){var r,n,i,s,o,l,c,u,d,A;return t in this.cache?this.cache[t]:(s=this.file.loca,r=this.file.contents,n=s.indexOf(t),(i=s.lengthOf(t))===0?this.cache[t]=null:(r.pos=this.offset+n,o=(l=new Gh(r.read(i))).readShort(),u=l.readShort(),A=l.readShort(),c=l.readShort(),d=l.readShort(),this.cache[t]=o===-1?new w1t(l,u,A,c,d):new b1t(l,o,u,A,c,d),this.cache[t]))},e.prototype.encode=function(t,r,n){var i,s,o,l,c;for(o=[],s=[],l=0,c=r.length;l0&&(i+=c)}for(var u=new Array(4*n.length),d=0;d>8,u[4*d+1]=(16711680&n[d])>>16,u[4*d]=(4278190080&n[d])>>24;return u},e}(),N1t=function(){function e(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var t,r,n,i,s;for(r in i=this.font.cmap.tables[0].codeMap,t={},s=this.subset)n=s[r],t[r]=i[n];return t},e.prototype.glyphsFor=function(t){var r,n,i,s,o,l,c;for(i={},o=0,l=t.length;o0)for(s in c=this.glyphsFor(r))n=c[s],i[s]=n;return i},e.prototype.encode=function(t,r){var n,i,s,o,l,c,u,d,A,h,f,m,p,g,v;for(i in n=ive.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(t),f={0:0},v=n.charMap)f[(c=v[i]).old]=c.new;for(m in h=n.maxGlyphID,o)m in f||(f[m]=h++);return d=function(x){var y,b;for(y in b={},x)b[x[y]]=y;return b}(f),A=Object.keys(d).sort(function(x,y){return x-y}),p=function(){var x,y,b;for(b=[],x=0,y=A.length;x>"),s.join(` `)}return""+r},t}();async function ave(e,t){const r=document.getElementById(e);if(!r)throw new Error("Element not found");const n=await X4(r,{scale:2,useCORS:!0,backgroundColor:null}),i=document.createElement("a");i.download=`${t}.png`,i.href=n.toDataURL("image/png"),i.click()}async function j1t(e,t,r="landscape"){const n=document.getElementById(e);if(!n)throw new Error("Element not found");const i=await X4(n,{scale:2,useCORS:!0,backgroundColor:"#ffffff"}),s=i.toDataURL("image/png"),o=new Wt({orientation:r,unit:"px",format:[i.width,i.height]});o.addImage(s,"PNG",0,0,i.width,i.height),o.save(`${t}.pdf`)}async function S1t(e,t,r="landscape"){if(e.length===0)throw new Error("No elements to export");const n=[];for(const o of e){const l=document.getElementById(o);if(!l)continue;const c=await X4(l,{scale:2,useCORS:!0,backgroundColor:"#ffffff"});n.push(c)}if(n.length===0)throw new Error("No elements rendered");const i=n[0],s=new Wt({orientation:r,unit:"px",format:[i.width,i.height]});n.forEach((o,l)=>{l>0&&s.addPage([o.width,o.height],r),s.addImage(o.toDataURL("image/png"),"PNG",0,0,o.width,o.height)}),s.save(`${t}.pdf`)}function xS(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 ove={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 */(function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,s){function o(u,d){if(!i[u]){if(!n[u]){var A=typeof xS=="function"&&xS;if(!d&&A)return A(u,!0);if(l)return l(u,!0);var h=new Error("Cannot find module '"+u+"'");throw h.code="MODULE_NOT_FOUND",h}var f=i[u]={exports:{}};n[u][0].call(f.exports,function(m){var p=n[u][1][m];return o(p||m)},f,f.exports,r,n,i,s)}return i[u].exports}for(var l=typeof xS=="function"&&xS,c=0;c>2,f=(3&u)<<4|d>>4,m=1>6:64,p=2>4,d=(15&h)<<4|(f=l.indexOf(c.charAt(p++)))>>2,A=(3&f)<<6|(m=l.indexOf(c.charAt(p++))),x[g++]=u,f!==64&&(x[g++]=d),m!==64&&(x[g++]=A);return x}},{"./support":30,"./utils":32}],2:[function(r,n,i){var s=r("./external"),o=r("./stream/DataWorker"),l=r("./stream/Crc32Probe"),c=r("./stream/DataLengthProbe");function u(d,A,h,f,m){this.compressedSize=d,this.uncompressedSize=A,this.crc32=h,this.compression=f,this.compressedContent=m}u.prototype={getContentWorker:function(){var d=new o(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),A=this;return d.on("end",function(){if(this.streamInfo.data_length!==A.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new o(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},u.createWorkerFrom=function(d,A,h){return d.pipe(new l).pipe(new c("uncompressedSize")).pipe(A.compressWorker(h)).pipe(new c("compressedSize")).withStreamInfo("compression",A)},n.exports=u},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,n,i){var s=r("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},i.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,n,i){var s=r("./utils"),o=function(){for(var l,c=[],u=0;u<256;u++){l=u;for(var d=0;d<8;d++)l=1&l?3988292384^l>>>1:l>>>1;c[u]=l}return c}();n.exports=function(l,c){return l!==void 0&&l.length?s.getTypeOf(l)!=="string"?function(u,d,A,h){var f=o,m=h+A;u^=-1;for(var p=h;p>>8^f[255&(u^d[p])];return-1^u}(0|c,l,l.length,0):function(u,d,A,h){var f=o,m=h+A;u^=-1;for(var p=h;p>>8^f[255&(u^d.charCodeAt(p))];return-1^u}(0|c,l,l.length,0):0}},{"./utils":32}],5:[function(r,n,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(r,n,i){var s=null;s=typeof Promise<"u"?Promise:r("lie"),n.exports={Promise:s}},{lie:37}],7:[function(r,n,i){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=r("pako"),l=r("./utils"),c=r("./stream/GenericWorker"),u=s?"uint8array":"array";function d(A,h){c.call(this,"FlateWorker/"+A),this._pako=null,this._pakoAction=A,this._pakoOptions=h,this.meta={}}i.magic="\b\0",l.inherits(d,c),d.prototype.processChunk=function(A){this.meta=A.meta,this._pako===null&&this._createPako(),this._pako.push(l.transformTo(u,A.data),!1)},d.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var A=this;this._pako.onData=function(h){A.push({data:h,meta:A.meta})}},i.compressWorker=function(A){return new d("Deflate",A)},i.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,n,i){function s(f,m){var p,g="";for(p=0;p>>=8;return g}function o(f,m,p,g,v,x){var y,b,C=f.file,j=f.compression,S=x!==u.utf8encode,T=l.transformTo("string",x(C.name)),B=l.transformTo("string",u.utf8encode(C.name)),I=C.comment,P=l.transformTo("string",x(I)),E=l.transformTo("string",u.utf8encode(I)),M=B.length!==C.name.length,_=E.length!==I.length,R="",G="",U="",Q=C.dir,z=C.date,Y={crc32:0,compressedSize:0,uncompressedSize:0};m&&!p||(Y.crc32=f.crc32,Y.compressedSize=f.compressedSize,Y.uncompressedSize=f.uncompressedSize);var $=0;m&&($|=8),S||!M&&!_||($|=2048);var O=0,W=0;Q&&(O|=16),v==="UNIX"?(W=798,O|=function(X,ne){var oe=X;return X||(oe=ne?16893:33204),(65535&oe)<<16}(C.unixPermissions,Q)):(W=20,O|=function(X){return 63&(X||0)}(C.dosPermissions)),y=z.getUTCHours(),y<<=6,y|=z.getUTCMinutes(),y<<=5,y|=z.getUTCSeconds()/2,b=z.getUTCFullYear()-1980,b<<=4,b|=z.getUTCMonth()+1,b<<=5,b|=z.getUTCDate(),M&&(G=s(1,1)+s(d(T),4)+B,R+="up"+s(G.length,2)+G),_&&(U=s(1,1)+s(d(P),4)+E,R+="uc"+s(U.length,2)+U);var V="";return V+=` \0`,V+=s($,2),V+=j.magic,V+=s(y,2),V+=s(b,2),V+=s(Y.crc32,4),V+=s(Y.compressedSize,4),V+=s(Y.uncompressedSize,4),V+=s(T.length,2),V+=s(R.length,2),{fileRecord:A.LOCAL_FILE_HEADER+V+T+R,dirRecord:A.CENTRAL_FILE_HEADER+s(W,2)+V+s(P.length,2)+"\0\0\0\0"+s(O,4)+s(g,4)+T+R+P}}var l=r("../utils"),c=r("../stream/GenericWorker"),u=r("../utf8"),d=r("../crc32"),A=r("../signature");function h(f,m,p,g){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=m,this.zipPlatform=p,this.encodeFileName=g,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}l.inherits(h,c),h.prototype.push=function(f){var m=f.meta.percent||0,p=this.entriesCount,g=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,c.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:p?(m+100*(p-g-1))/p:100}}))},h.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var m=this.streamFiles&&!f.file.dir;if(m){var p=o(f,m,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:p.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(f){this.accumulate=!1;var m=this.streamFiles&&!f.file.dir,p=o(f,m,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(p.dirRecord),m)this.push({data:function(g){return A.DATA_DESCRIPTOR+s(g.crc32,4)+s(g.compressedSize,4)+s(g.uncompressedSize,4)}(f),meta:{percent:100}});else for(this.push({data:p.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var f=this.bytesWritten,m=0;m=this.index;c--)u=(u<<8)+this.byteAt(c);return this.index+=l,u},readString:function(l){return s.transformTo("string",this.readData(l))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var l=this.readInt(4);return new Date(Date.UTC(1980+(l>>25&127),(l>>21&15)-1,l>>16&31,l>>11&31,l>>5&63,(31&l)<<1))}},n.exports=o},{"../utils":32}],19:[function(r,n,i){var s=r("./Uint8ArrayReader");function o(l){s.call(this,l)}r("../utils").inherits(o,s),o.prototype.readData=function(l){this.checkOffset(l);var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,i){var s=r("./DataReader");function o(l){s.call(this,l)}r("../utils").inherits(o,s),o.prototype.byteAt=function(l){return this.data.charCodeAt(this.zero+l)},o.prototype.lastIndexOfSignature=function(l){return this.data.lastIndexOf(l)-this.zero},o.prototype.readAndCheckSignature=function(l){return l===this.readData(4)},o.prototype.readData=function(l){this.checkOffset(l);var c=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=o},{"../utils":32,"./DataReader":18}],21:[function(r,n,i){var s=r("./ArrayReader");function o(l){s.call(this,l)}r("../utils").inherits(o,s),o.prototype.readData=function(l){if(this.checkOffset(l),l===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+l);return this.index+=l,c},n.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,i){var s=r("../utils"),o=r("../support"),l=r("./ArrayReader"),c=r("./StringReader"),u=r("./NodeBufferReader"),d=r("./Uint8ArrayReader");n.exports=function(A){var h=s.getTypeOf(A);return s.checkSupport(h),h!=="string"||o.uint8array?h==="nodebuffer"?new u(A):o.uint8array?new d(s.transformTo("uint8array",A)):new l(s.transformTo("array",A)):new c(A)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,i){var s=r("./GenericWorker"),o=r("../utils");function l(c){s.call(this,"ConvertWorker to "+c),this.destType=c}o.inherits(l,s),l.prototype.processChunk=function(c){this.push({data:o.transformTo(this.destType,c.data),meta:c.meta})},n.exports=l},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,i){var s=r("./GenericWorker"),o=r("../crc32");function l(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(l,s),l.prototype.processChunk=function(c){this.streamInfo.crc32=o(c.data,this.streamInfo.crc32||0),this.push(c)},n.exports=l},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,i){var s=r("../utils"),o=r("./GenericWorker");function l(c){o.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}s.inherits(l,o),l.prototype.processChunk=function(c){if(c){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+c.data.length}o.prototype.processChunk.call(this,c)},n.exports=l},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,i){var s=r("../utils"),o=r("./GenericWorker");function l(c){o.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(d){u.dataIsReady=!0,u.data=d,u.max=d&&d.length||0,u.type=s.getTypeOf(d),u.isPaused||u._tickAndRepeat()},function(d){u.error(d)})}s.inherits(l,o),l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},l.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},l.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},l.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,u);break;case"uint8array":c=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":c=this.data.slice(this.index,u)}return this.index=u,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=l},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,i){function s(o){this.name=o||"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}s.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,l){return this._listeners[o].push(l),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,l){if(this._listeners[o])for(var c=0;c "+o:o}},n.exports=s},{}],29:[function(r,n,i){var s=r("../utils"),o=r("./ConvertWorker"),l=r("./GenericWorker"),c=r("../base64"),u=r("../support"),d=r("../external"),A=null;if(u.nodestream)try{A=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function h(m,p){return new d.Promise(function(g,v){var x=[],y=m._internalType,b=m._outputType,C=m._mimeType;m.on("data",function(j,S){x.push(j),p&&p(S)}).on("error",function(j){x=[],v(j)}).on("end",function(){try{var j=function(S,T,B){switch(S){case"blob":return s.newBlob(s.transformTo("arraybuffer",T),B);case"base64":return c.encode(T);default:return s.transformTo(S,T)}}(b,function(S,T){var B,I=0,P=null,E=0;for(B=0;B"u")i.blob=!1;else{var s=new ArrayBuffer(0);try{i.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(s),i.blob=o.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!r("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,i){for(var s=r("./utils"),o=r("./support"),l=r("./nodejsUtils"),c=r("./stream/GenericWorker"),u=new Array(256),d=0;d<256;d++)u[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;u[254]=u[254]=1;function A(){c.call(this,"utf-8 decode"),this.leftOver=null}function h(){c.call(this,"utf-8 encode")}i.utf8encode=function(f){return o.nodebuffer?l.newBufferFrom(f,"utf-8"):function(m){var p,g,v,x,y,b=m.length,C=0;for(x=0;x>>6:(g<65536?p[y++]=224|g>>>12:(p[y++]=240|g>>>18,p[y++]=128|g>>>12&63),p[y++]=128|g>>>6&63),p[y++]=128|63&g);return p}(f)},i.utf8decode=function(f){return o.nodebuffer?s.transformTo("nodebuffer",f).toString("utf-8"):function(m){var p,g,v,x,y=m.length,b=new Array(2*y);for(p=g=0;p>10&1023,b[g++]=56320|1023&v)}return b.length!==g&&(b.subarray?b=b.subarray(0,g):b.length=g),s.applyFromCharCode(b)}(f=s.transformTo(o.uint8array?"uint8array":"array",f))},s.inherits(A,c),A.prototype.processChunk=function(f){var m=s.transformTo(o.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var p=m;(m=new Uint8Array(p.length+this.leftOver.length)).set(this.leftOver,0),m.set(p,this.leftOver.length)}else m=this.leftOver.concat(m);this.leftOver=null}var g=function(x,y){var b;for((y=y||x.length)>x.length&&(y=x.length),b=y-1;0<=b&&(192&x[b])==128;)b--;return b<0||b===0?y:b+u[x[b]]>y?b:y}(m),v=m;g!==m.length&&(o.uint8array?(v=m.subarray(0,g),this.leftOver=m.subarray(g,m.length)):(v=m.slice(0,g),this.leftOver=m.slice(g,m.length))),this.push({data:i.utf8decode(v),meta:f.meta})},A.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=A,s.inherits(h,c),h.prototype.processChunk=function(f){this.push({data:i.utf8encode(f.data),meta:f.meta})},i.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,i){var s=r("./support"),o=r("./base64"),l=r("./nodejsUtils"),c=r("./external");function u(p){return p}function d(p,g){for(var v=0;v>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=s(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var m,p,g,v=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4>>6:(f<65536?h[g++]=224|f>>>12:(h[g++]=240|f>>>18,h[g++]=128|f>>>12&63),h[g++]=128|f>>>6&63),h[g++]=128|63&f);return h},i.buf2binstring=function(A){return d(A,A.length)},i.binstring2buf=function(A){for(var h=new s.Buf8(A.length),f=0,m=h.length;f>10&1023,x[m++]=56320|1023&p)}return d(x,m)},i.utf8border=function(A,h){var f;for((h=h||A.length)>A.length&&(h=A.length),f=h-1;0<=f&&(192&A[f])==128;)f--;return f<0||f===0?h:f+c[A[f]]>h?f:h}},{"./common":41}],43:[function(r,n,i){n.exports=function(s,o,l,c){for(var u=65535&s|0,d=s>>>16&65535|0,A=0;l!==0;){for(l-=A=2e3>>1:o>>>1;l[c]=o}return l}();n.exports=function(o,l,c,u){var d=s,A=u+c;o^=-1;for(var h=u;h>>8^d[255&(o^l[h])];return-1^o}},{}],46:[function(r,n,i){var s,o=r("../utils/common"),l=r("./trees"),c=r("./adler32"),u=r("./crc32"),d=r("./messages"),A=0,h=4,f=0,m=-2,p=-1,g=4,v=2,x=8,y=9,b=286,C=30,j=19,S=2*b+1,T=15,B=3,I=258,P=I+B+1,E=42,M=113,_=1,R=2,G=3,U=4;function Q(D,K){return D.msg=d[K],K}function z(D){return(D<<1)-(4D.avail_out&&(we=D.avail_out),we!==0&&(o.arraySet(D.output,K.pending_buf,K.pending_out,we,D.next_out),D.next_out+=we,K.pending_out+=we,D.total_out+=we,D.avail_out-=we,K.pending-=we,K.pending===0&&(K.pending_out=0))}function O(D,K){l._tr_flush_block(D,0<=D.block_start?D.block_start:-1,D.strstart-D.block_start,K),D.block_start=D.strstart,$(D.strm)}function W(D,K){D.pending_buf[D.pending++]=K}function V(D,K){D.pending_buf[D.pending++]=K>>>8&255,D.pending_buf[D.pending++]=255&K}function X(D,K){var we,ae,te=D.max_chain_length,ce=D.strstart,be=D.prev_length,je=D.nice_match,xe=D.strstart>D.w_size-P?D.strstart-(D.w_size-P):0,Ie=D.window,Ke=D.w_mask,De=D.prev,Ve=D.strstart+I,ht=Ie[ce+be-1],ft=Ie[ce+be];D.prev_length>=D.good_match&&(te>>=2),je>D.lookahead&&(je=D.lookahead);do if(Ie[(we=K)+be]===ft&&Ie[we+be-1]===ht&&Ie[we]===Ie[ce]&&Ie[++we]===Ie[ce+1]){ce+=2,we++;do;while(Ie[++ce]===Ie[++we]&&Ie[++ce]===Ie[++we]&&Ie[++ce]===Ie[++we]&&Ie[++ce]===Ie[++we]&&Ie[++ce]===Ie[++we]&&Ie[++ce]===Ie[++we]&&Ie[++ce]===Ie[++we]&&Ie[++ce]===Ie[++we]&&cexe&&--te!=0);return be<=D.lookahead?be:D.lookahead}function ne(D){var K,we,ae,te,ce,be,je,xe,Ie,Ke,De=D.w_size;do{if(te=D.window_size-D.lookahead-D.strstart,D.strstart>=De+(De-P)){for(o.arraySet(D.window,D.window,De,De,0),D.match_start-=De,D.strstart-=De,D.block_start-=De,K=we=D.hash_size;ae=D.head[--K],D.head[K]=De<=ae?ae-De:0,--we;);for(K=we=De;ae=D.prev[--K],D.prev[K]=De<=ae?ae-De:0,--we;);te+=De}if(D.strm.avail_in===0)break;if(be=D.strm,je=D.window,xe=D.strstart+D.lookahead,Ie=te,Ke=void 0,Ke=be.avail_in,Ie=B)for(ce=D.strstart-D.insert,D.ins_h=D.window[ce],D.ins_h=(D.ins_h<=B&&(D.ins_h=(D.ins_h<=B)if(ae=l._tr_tally(D,D.strstart-D.match_start,D.match_length-B),D.lookahead-=D.match_length,D.match_length<=D.max_lazy_match&&D.lookahead>=B){for(D.match_length--;D.strstart++,D.ins_h=(D.ins_h<=B&&(D.ins_h=(D.ins_h<=B&&D.match_length<=D.prev_length){for(te=D.strstart+D.lookahead-B,ae=l._tr_tally(D,D.strstart-1-D.prev_match,D.prev_length-B),D.lookahead-=D.prev_length-1,D.prev_length-=2;++D.strstart<=te&&(D.ins_h=(D.ins_h<D.pending_buf_size-5&&(we=D.pending_buf_size-5);;){if(D.lookahead<=1){if(ne(D),D.lookahead===0&&K===A)return _;if(D.lookahead===0)break}D.strstart+=D.lookahead,D.lookahead=0;var ae=D.block_start+we;if((D.strstart===0||D.strstart>=ae)&&(D.lookahead=D.strstart-ae,D.strstart=ae,O(D,!1),D.strm.avail_out===0)||D.strstart-D.block_start>=D.w_size-P&&(O(D,!1),D.strm.avail_out===0))return _}return D.insert=0,K===h?(O(D,!0),D.strm.avail_out===0?G:U):(D.strstart>D.block_start&&(O(D,!1),D.strm.avail_out),_)}),new de(4,4,8,4,oe),new de(4,5,16,8,oe),new de(4,6,32,32,oe),new de(4,4,16,16,pe),new de(8,16,32,32,pe),new de(8,16,128,128,pe),new de(8,32,128,256,pe),new de(32,128,258,1024,pe),new de(32,258,258,4096,pe)],i.deflateInit=function(D,K){return Se(D,K,x,15,8,0)},i.deflateInit2=Se,i.deflateReset=ue,i.deflateResetKeep=ie,i.deflateSetHeader=function(D,K){return D&&D.state?D.state.wrap!==2?m:(D.state.gzhead=K,f):m},i.deflate=function(D,K){var we,ae,te,ce;if(!D||!D.state||5>8&255),W(ae,ae.gzhead.time>>16&255),W(ae,ae.gzhead.time>>24&255),W(ae,ae.level===9?2:2<=ae.strategy||ae.level<2?4:0),W(ae,255&ae.gzhead.os),ae.gzhead.extra&&ae.gzhead.extra.length&&(W(ae,255&ae.gzhead.extra.length),W(ae,ae.gzhead.extra.length>>8&255)),ae.gzhead.hcrc&&(D.adler=u(D.adler,ae.pending_buf,ae.pending,0)),ae.gzindex=0,ae.status=69):(W(ae,0),W(ae,0),W(ae,0),W(ae,0),W(ae,0),W(ae,ae.level===9?2:2<=ae.strategy||ae.level<2?4:0),W(ae,3),ae.status=M);else{var be=x+(ae.w_bits-8<<4)<<8;be|=(2<=ae.strategy||ae.level<2?0:ae.level<6?1:ae.level===6?2:3)<<6,ae.strstart!==0&&(be|=32),be+=31-be%31,ae.status=M,V(ae,be),ae.strstart!==0&&(V(ae,D.adler>>>16),V(ae,65535&D.adler)),D.adler=1}if(ae.status===69)if(ae.gzhead.extra){for(te=ae.pending;ae.gzindex<(65535&ae.gzhead.extra.length)&&(ae.pending!==ae.pending_buf_size||(ae.gzhead.hcrc&&ae.pending>te&&(D.adler=u(D.adler,ae.pending_buf,ae.pending-te,te)),$(D),te=ae.pending,ae.pending!==ae.pending_buf_size));)W(ae,255&ae.gzhead.extra[ae.gzindex]),ae.gzindex++;ae.gzhead.hcrc&&ae.pending>te&&(D.adler=u(D.adler,ae.pending_buf,ae.pending-te,te)),ae.gzindex===ae.gzhead.extra.length&&(ae.gzindex=0,ae.status=73)}else ae.status=73;if(ae.status===73)if(ae.gzhead.name){te=ae.pending;do{if(ae.pending===ae.pending_buf_size&&(ae.gzhead.hcrc&&ae.pending>te&&(D.adler=u(D.adler,ae.pending_buf,ae.pending-te,te)),$(D),te=ae.pending,ae.pending===ae.pending_buf_size)){ce=1;break}ce=ae.gzindexte&&(D.adler=u(D.adler,ae.pending_buf,ae.pending-te,te)),ce===0&&(ae.gzindex=0,ae.status=91)}else ae.status=91;if(ae.status===91)if(ae.gzhead.comment){te=ae.pending;do{if(ae.pending===ae.pending_buf_size&&(ae.gzhead.hcrc&&ae.pending>te&&(D.adler=u(D.adler,ae.pending_buf,ae.pending-te,te)),$(D),te=ae.pending,ae.pending===ae.pending_buf_size)){ce=1;break}ce=ae.gzindexte&&(D.adler=u(D.adler,ae.pending_buf,ae.pending-te,te)),ce===0&&(ae.status=103)}else ae.status=103;if(ae.status===103&&(ae.gzhead.hcrc?(ae.pending+2>ae.pending_buf_size&&$(D),ae.pending+2<=ae.pending_buf_size&&(W(ae,255&D.adler),W(ae,D.adler>>8&255),D.adler=0,ae.status=M)):ae.status=M),ae.pending!==0){if($(D),D.avail_out===0)return ae.last_flush=-1,f}else if(D.avail_in===0&&z(K)<=z(we)&&K!==h)return Q(D,-5);if(ae.status===666&&D.avail_in!==0)return Q(D,-5);if(D.avail_in!==0||ae.lookahead!==0||K!==A&&ae.status!==666){var je=ae.strategy===2?function(xe,Ie){for(var Ke;;){if(xe.lookahead===0&&(ne(xe),xe.lookahead===0)){if(Ie===A)return _;break}if(xe.match_length=0,Ke=l._tr_tally(xe,0,xe.window[xe.strstart]),xe.lookahead--,xe.strstart++,Ke&&(O(xe,!1),xe.strm.avail_out===0))return _}return xe.insert=0,Ie===h?(O(xe,!0),xe.strm.avail_out===0?G:U):xe.last_lit&&(O(xe,!1),xe.strm.avail_out===0)?_:R}(ae,K):ae.strategy===3?function(xe,Ie){for(var Ke,De,Ve,ht,ft=xe.window;;){if(xe.lookahead<=I){if(ne(xe),xe.lookahead<=I&&Ie===A)return _;if(xe.lookahead===0)break}if(xe.match_length=0,xe.lookahead>=B&&0xe.lookahead&&(xe.match_length=xe.lookahead)}if(xe.match_length>=B?(Ke=l._tr_tally(xe,1,xe.match_length-B),xe.lookahead-=xe.match_length,xe.strstart+=xe.match_length,xe.match_length=0):(Ke=l._tr_tally(xe,0,xe.window[xe.strstart]),xe.lookahead--,xe.strstart++),Ke&&(O(xe,!1),xe.strm.avail_out===0))return _}return xe.insert=0,Ie===h?(O(xe,!0),xe.strm.avail_out===0?G:U):xe.last_lit&&(O(xe,!1),xe.strm.avail_out===0)?_:R}(ae,K):s[ae.level].func(ae,K);if(je!==G&&je!==U||(ae.status=666),je===_||je===G)return D.avail_out===0&&(ae.last_flush=-1),f;if(je===R&&(K===1?l._tr_align(ae):K!==5&&(l._tr_stored_block(ae,0,0,!1),K===3&&(Y(ae.head),ae.lookahead===0&&(ae.strstart=0,ae.block_start=0,ae.insert=0))),$(D),D.avail_out===0))return ae.last_flush=-1,f}return K!==h?f:ae.wrap<=0?1:(ae.wrap===2?(W(ae,255&D.adler),W(ae,D.adler>>8&255),W(ae,D.adler>>16&255),W(ae,D.adler>>24&255),W(ae,255&D.total_in),W(ae,D.total_in>>8&255),W(ae,D.total_in>>16&255),W(ae,D.total_in>>24&255)):(V(ae,D.adler>>>16),V(ae,65535&D.adler)),$(D),0=we.w_size&&(ce===0&&(Y(we.head),we.strstart=0,we.block_start=0,we.insert=0),Ie=new o.Buf8(we.w_size),o.arraySet(Ie,K,Ke-we.w_size,we.w_size,0),K=Ie,Ke=we.w_size),be=D.avail_in,je=D.next_in,xe=D.input,D.avail_in=Ke,D.next_in=0,D.input=K,ne(we);we.lookahead>=B;){for(ae=we.strstart,te=we.lookahead-(B-1);we.ins_h=(we.ins_h<>>=B=T>>>24,y-=B,(B=T>>>16&255)===0)R[d++]=65535&T;else{if(!(16&B)){if(!(64&B)){T=b[(65535&T)+(x&(1<>>=B,y-=B),y<15&&(x+=_[c++]<>>=B=T>>>24,y-=B,!(16&(B=T>>>16&255))){if(!(64&B)){T=C[(65535&T)+(x&(1<>>=B,y-=B,(B=d-A)>3,x&=(1<<(y-=I<<3))-1,s.next_in=c,s.next_out=d,s.avail_in=c>>24&255)+(E>>>8&65280)+((65280&E)<<8)+((255&E)<<24)}function x(){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 s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function y(E){var M;return E&&E.state?(M=E.state,E.total_in=E.total_out=M.total=0,E.msg="",M.wrap&&(E.adler=1&M.wrap),M.mode=m,M.last=0,M.havedict=0,M.dmax=32768,M.head=null,M.hold=0,M.bits=0,M.lencode=M.lendyn=new s.Buf32(p),M.distcode=M.distdyn=new s.Buf32(g),M.sane=1,M.back=-1,h):f}function b(E){var M;return E&&E.state?((M=E.state).wsize=0,M.whave=0,M.wnext=0,y(E)):f}function C(E,M){var _,R;return E&&E.state?(R=E.state,M<0?(_=0,M=-M):(_=1+(M>>4),M<48&&(M&=15)),M&&(M<8||15=U.wsize?(s.arraySet(U.window,M,_-U.wsize,U.wsize,0),U.wnext=0,U.whave=U.wsize):(R<(G=U.wsize-U.wnext)&&(G=R),s.arraySet(U.window,M,_-R,G,U.wnext),(R-=G)?(s.arraySet(U.window,M,_-R,R,0),U.wnext=R,U.whave=U.wsize):(U.wnext+=G,U.wnext===U.wsize&&(U.wnext=0),U.whave>>8&255,_.check=l(_.check,ce,2,0),O=$=0,_.mode=2;break}if(_.flags=0,_.head&&(_.head.done=!1),!(1&_.wrap)||(((255&$)<<8)+($>>8))%31){E.msg="incorrect header check",_.mode=30;break}if((15&$)!=8){E.msg="unknown compression method",_.mode=30;break}if(O-=4,D=8+(15&($>>>=4)),_.wbits===0)_.wbits=D;else if(D>_.wbits){E.msg="invalid window size",_.mode=30;break}_.dmax=1<>8&1),512&_.flags&&(ce[0]=255&$,ce[1]=$>>>8&255,_.check=l(_.check,ce,2,0)),O=$=0,_.mode=3;case 3:for(;O<32;){if(z===0)break e;z--,$+=R[U++]<>>8&255,ce[2]=$>>>16&255,ce[3]=$>>>24&255,_.check=l(_.check,ce,4,0)),O=$=0,_.mode=4;case 4:for(;O<16;){if(z===0)break e;z--,$+=R[U++]<>8),512&_.flags&&(ce[0]=255&$,ce[1]=$>>>8&255,_.check=l(_.check,ce,2,0)),O=$=0,_.mode=5;case 5:if(1024&_.flags){for(;O<16;){if(z===0)break e;z--,$+=R[U++]<>>8&255,_.check=l(_.check,ce,2,0)),O=$=0}else _.head&&(_.head.extra=null);_.mode=6;case 6:if(1024&_.flags&&(z<(X=_.length)&&(X=z),X&&(_.head&&(D=_.head.extra_len-_.length,_.head.extra||(_.head.extra=new Array(_.head.extra_len)),s.arraySet(_.head.extra,R,U,X,D)),512&_.flags&&(_.check=l(_.check,R,X,U)),z-=X,U+=X,_.length-=X),_.length))break e;_.length=0,_.mode=7;case 7:if(2048&_.flags){if(z===0)break e;for(X=0;D=R[U+X++],_.head&&D&&_.length<65536&&(_.head.name+=String.fromCharCode(D)),D&&X>9&1,_.head.done=!0),E.adler=_.check=0,_.mode=12;break;case 10:for(;O<32;){if(z===0)break e;z--,$+=R[U++]<>>=7&O,O-=7&O,_.mode=27;break}for(;O<3;){if(z===0)break e;z--,$+=R[U++]<>>=1)){case 0:_.mode=14;break;case 1:if(I(_),_.mode=20,M!==6)break;$>>>=2,O-=2;break e;case 2:_.mode=17;break;case 3:E.msg="invalid block type",_.mode=30}$>>>=2,O-=2;break;case 14:for($>>>=7&O,O-=7&O;O<32;){if(z===0)break e;z--,$+=R[U++]<>>16^65535)){E.msg="invalid stored block lengths",_.mode=30;break}if(_.length=65535&$,O=$=0,_.mode=15,M===6)break e;case 15:_.mode=16;case 16:if(X=_.length){if(z>>=5,O-=5,_.ndist=1+(31&$),$>>>=5,O-=5,_.ncode=4+(15&$),$>>>=4,O-=4,286<_.nlen||30<_.ndist){E.msg="too many length or distance symbols",_.mode=30;break}_.have=0,_.mode=18;case 18:for(;_.have<_.ncode;){for(;O<3;){if(z===0)break e;z--,$+=R[U++]<>>=3,O-=3}for(;_.have<19;)_.lens[be[_.have++]]=0;if(_.lencode=_.lendyn,_.lenbits=7,we={bits:_.lenbits},K=u(0,_.lens,0,19,_.lencode,0,_.work,we),_.lenbits=we.bits,K){E.msg="invalid code lengths set",_.mode=30;break}_.have=0,_.mode=19;case 19:for(;_.have<_.nlen+_.ndist;){for(;de=(te=_.lencode[$&(1<<_.lenbits)-1])>>>16&255,ge=65535&te,!((pe=te>>>24)<=O);){if(z===0)break e;z--,$+=R[U++]<>>=pe,O-=pe,_.lens[_.have++]=ge;else{if(ge===16){for(ae=pe+2;O>>=pe,O-=pe,_.have===0){E.msg="invalid bit length repeat",_.mode=30;break}D=_.lens[_.have-1],X=3+(3&$),$>>>=2,O-=2}else if(ge===17){for(ae=pe+3;O>>=pe)),$>>>=3,O-=3}else{for(ae=pe+7;O>>=pe)),$>>>=7,O-=7}if(_.have+X>_.nlen+_.ndist){E.msg="invalid bit length repeat",_.mode=30;break}for(;X--;)_.lens[_.have++]=D}}if(_.mode===30)break;if(_.lens[256]===0){E.msg="invalid code -- missing end-of-block",_.mode=30;break}if(_.lenbits=9,we={bits:_.lenbits},K=u(d,_.lens,0,_.nlen,_.lencode,0,_.work,we),_.lenbits=we.bits,K){E.msg="invalid literal/lengths set",_.mode=30;break}if(_.distbits=6,_.distcode=_.distdyn,we={bits:_.distbits},K=u(A,_.lens,_.nlen,_.ndist,_.distcode,0,_.work,we),_.distbits=we.bits,K){E.msg="invalid distances set",_.mode=30;break}if(_.mode=20,M===6)break e;case 20:_.mode=21;case 21:if(6<=z&&258<=Y){E.next_out=Q,E.avail_out=Y,E.next_in=U,E.avail_in=z,_.hold=$,_.bits=O,c(E,V),Q=E.next_out,G=E.output,Y=E.avail_out,U=E.next_in,R=E.input,z=E.avail_in,$=_.hold,O=_.bits,_.mode===12&&(_.back=-1);break}for(_.back=0;de=(te=_.lencode[$&(1<<_.lenbits)-1])>>>16&255,ge=65535&te,!((pe=te>>>24)<=O);){if(z===0)break e;z--,$+=R[U++]<>ie)])>>>16&255,ge=65535&te,!(ie+(pe=te>>>24)<=O);){if(z===0)break e;z--,$+=R[U++]<>>=ie,O-=ie,_.back+=ie}if($>>>=pe,O-=pe,_.back+=pe,_.length=ge,de===0){_.mode=26;break}if(32&de){_.back=-1,_.mode=12;break}if(64&de){E.msg="invalid literal/length code",_.mode=30;break}_.extra=15&de,_.mode=22;case 22:if(_.extra){for(ae=_.extra;O>>=_.extra,O-=_.extra,_.back+=_.extra}_.was=_.length,_.mode=23;case 23:for(;de=(te=_.distcode[$&(1<<_.distbits)-1])>>>16&255,ge=65535&te,!((pe=te>>>24)<=O);){if(z===0)break e;z--,$+=R[U++]<>ie)])>>>16&255,ge=65535&te,!(ie+(pe=te>>>24)<=O);){if(z===0)break e;z--,$+=R[U++]<>>=ie,O-=ie,_.back+=ie}if($>>>=pe,O-=pe,_.back+=pe,64&de){E.msg="invalid distance code",_.mode=30;break}_.offset=ge,_.extra=15&de,_.mode=24;case 24:if(_.extra){for(ae=_.extra;O>>=_.extra,O-=_.extra,_.back+=_.extra}if(_.offset>_.dmax){E.msg="invalid distance too far back",_.mode=30;break}_.mode=25;case 25:if(Y===0)break e;if(X=V-Y,_.offset>X){if((X=_.offset-X)>_.whave&&_.sane){E.msg="invalid distance too far back",_.mode=30;break}ne=X>_.wnext?(X-=_.wnext,_.wsize-X):_.wnext-X,X>_.length&&(X=_.length),oe=_.window}else oe=G,ne=Q-_.offset,X=_.length;for(YS?(B=ne[oe+g[M]],O[W+g[M]]):(B=96,0),x=1<>Q)+(y-=x)]=T<<24|B<<16|I|0,y!==0;);for(x=1<>=1;if(x!==0?($&=x-1,$+=x):$=0,M++,--V[E]==0){if(E===R)break;E=A[h+g[M]]}if(G>>7)]}function W(te,ce){te.pending_buf[te.pending++]=255&ce,te.pending_buf[te.pending++]=ce>>>8&255}function V(te,ce,be){te.bi_valid>v-be?(te.bi_buf|=ce<>v-te.bi_valid,te.bi_valid+=be-v):(te.bi_buf|=ce<>>=1,be<<=1,0<--ce;);return be>>>1}function oe(te,ce,be){var je,xe,Ie=new Array(g+1),Ke=0;for(je=1;je<=g;je++)Ie[je]=Ke=Ke+be[je-1]<<1;for(xe=0;xe<=ce;xe++){var De=te[2*xe+1];De!==0&&(te[2*xe]=ne(Ie[De]++,De))}}function pe(te){var ce;for(ce=0;ce>1;1<=be;be--)ie(te,Ie,be);for(xe=Ve;be=te.heap[1],te.heap[1]=te.heap[te.heap_len--],ie(te,Ie,1),je=te.heap[1],te.heap[--te.heap_max]=be,te.heap[--te.heap_max]=je,Ie[2*xe]=Ie[2*be]+Ie[2*je],te.depth[xe]=(te.depth[be]>=te.depth[je]?te.depth[be]:te.depth[je])+1,Ie[2*be+1]=Ie[2*je+1]=xe,te.heap[1]=xe++,ie(te,Ie,1),2<=te.heap_len;);te.heap[--te.heap_max]=te.heap[1],function(ft,ut){var Qt,dt,Sr,Tt,qt,nr,hr=ut.dyn_tree,Mt=ut.max_code,Vr=ut.stat_desc.static_tree,Ht=ut.stat_desc.has_stree,$t=ut.stat_desc.extra_bits,zr=ut.stat_desc.extra_base,Zt=ut.stat_desc.max_length,yt=0;for(Tt=0;Tt<=g;Tt++)ft.bl_count[Tt]=0;for(hr[2*ft.heap[ft.heap_max]+1]=0,Qt=ft.heap_max+1;Qt>=7;xe>>=1)if(1&ht&&De.dyn_ltree[2*Ve]!==0)return o;if(De.dyn_ltree[18]!==0||De.dyn_ltree[20]!==0||De.dyn_ltree[26]!==0)return l;for(Ve=32;Ve>>3,(Ie=te.static_len+3+7>>>3)<=xe&&(xe=Ie)):xe=Ie=be+5,be+4<=xe&&ce!==-1?ae(te,ce,be,je):te.strategy===4||Ie===xe?(V(te,2+(je?1:0),3),ue(te,P,E)):(V(te,4+(je?1:0),3),function(De,Ve,ht,ft){var ut;for(V(De,Ve-257,5),V(De,ht-1,5),V(De,ft-4,4),ut=0;ut>>8&255,te.pending_buf[te.d_buf+2*te.last_lit+1]=255&ce,te.pending_buf[te.l_buf+te.last_lit]=255&be,te.last_lit++,ce===0?te.dyn_ltree[2*be]++:(te.matches++,ce--,te.dyn_ltree[2*(_[be]+A+1)]++,te.dyn_dtree[2*O(ce)]++),te.last_lit===te.lit_bufsize-1},i._tr_align=function(te){V(te,2,3),X(te,y,P),function(ce){ce.bi_valid===16?(W(ce,ce.bi_buf),ce.bi_buf=0,ce.bi_valid=0):8<=ce.bi_valid&&(ce.pending_buf[ce.pending++]=255&ce.bi_buf,ce.bi_buf>>=8,ce.bi_valid-=8)}(te)}},{"../utils/common":41}],53:[function(r,n,i){n.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(r,n,i){(function(s){(function(o,l){if(!o.setImmediate){var c,u,d,A,h=1,f={},m=!1,p=o.document,g=Object.getPrototypeOf&&Object.getPrototypeOf(o);g=g&&g.setTimeout?g:o,c={}.toString.call(o.process)==="[object process]"?function(b){process.nextTick(function(){x(b)})}:function(){if(o.postMessage&&!o.importScripts){var b=!0,C=o.onmessage;return o.onmessage=function(){b=!1},o.postMessage("","*"),o.onmessage=C,b}}()?(A="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",y,!1):o.attachEvent("onmessage",y),function(b){o.postMessage(A+b,"*")}):o.MessageChannel?((d=new MessageChannel).port1.onmessage=function(b){x(b.data)},function(b){d.port2.postMessage(b)}):p&&"onreadystatechange"in p.createElement("script")?(u=p.documentElement,function(b){var C=p.createElement("script");C.onreadystatechange=function(){x(b),C.onreadystatechange=null,u.removeChild(C),C=null},u.appendChild(C)}):function(b){setTimeout(x,0,b)},g.setImmediate=function(b){typeof b!="function"&&(b=new Function(""+b));for(var C=new Array(arguments.length-1),j=0;j"u"?s===void 0?this:s:self)}).call(this,typeof cs<"u"?cs:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(ove);var B1t=ove.exports;const lve=en(B1t);function ol(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(d){try{u(n.next(d))}catch(A){o(A)}}function c(d){try{u(n.throw(d))}catch(A){o(A)}}function u(d){d.done?s(d.value):i(d.value).then(l,c)}u((n=n.apply(e,[])).next())})}const or=914400,sN=12700,Ws=`\r `,_1t=2147483649,J3=/^[0-9a-fA-F]{6}$/,k1t=1.67,E1t=27,Rv={type:"solid",color:"666666",pt:1},cve=[.05,.1,.05,.1],Uv={color:"363636",pt:1},vm={color:"888888",style:"solid",size:1,cap:"flat"},Eo="000000",ec=12,T1t=18,Qv="LAYOUT_16x9",lR="DEFAULT",uve="333333",Rp={type:"outer",blur:3,offset:23e3/12700,angle:90,color:"000000",opacity:.35,rotateWithShape:!0},sC=[.5,.5,.5,.5],PJ={color:"000000"},P1t={size:8,color:"FFFFFF",opacity:.75},nA="2094734552",dB="2094734553",kw="2094734554",cR="2094734555",dve="2094734556",iw="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),Ew=["C0504D","4F81BD","9BBB59","8064A2","4BACC6","F79646","628FC6","C86360","C0504D","4F81BD","9BBB59","8064A2","4BACC6","F79646","628FC6","C86360"],I1t=["5DA5DA","FAA43A","60BD68","F17CB0","B2912F","B276B2","DECF3F","F15854","A7A7A7","5DA5DA","FAA43A","60BD68","F17CB0","B2912F","B276B2","DECF3F","F15854","A7A7A7"];var yx;(function(e){e.left="left",e.center="center",e.right="right",e.justify="justify"})(yx||(yx={}));var bx;(function(e){e.b="b",e.ctr="ctr",e.t="t"})(bx||(bx={}));const Ave="{F7021451-1387-4CA6-816F-3879F97B5CBC}";var uR;(function(e){e.arraybuffer="arraybuffer",e.base64="base64",e.binarystring="binarystring",e.blob="blob",e.nodebuffer="nodebuffer",e.uint8array="uint8array"})(uR||(uR={}));var dR;(function(e){e.area="area",e.bar="bar",e.bar3d="bar3D",e.bubble="bubble",e.bubble3d="bubble3D",e.doughnut="doughnut",e.line="line",e.pie="pie",e.radar="radar",e.scatter="scatter"})(dR||(dR={}));var AR;(function(e){e.accentBorderCallout1="accentBorderCallout1",e.accentBorderCallout2="accentBorderCallout2",e.accentBorderCallout3="accentBorderCallout3",e.accentCallout1="accentCallout1",e.accentCallout2="accentCallout2",e.accentCallout3="accentCallout3",e.actionButtonBackPrevious="actionButtonBackPrevious",e.actionButtonBeginning="actionButtonBeginning",e.actionButtonBlank="actionButtonBlank",e.actionButtonDocument="actionButtonDocument",e.actionButtonEnd="actionButtonEnd",e.actionButtonForwardNext="actionButtonForwardNext",e.actionButtonHelp="actionButtonHelp",e.actionButtonHome="actionButtonHome",e.actionButtonInformation="actionButtonInformation",e.actionButtonMovie="actionButtonMovie",e.actionButtonReturn="actionButtonReturn",e.actionButtonSound="actionButtonSound",e.arc="arc",e.bentArrow="bentArrow",e.bentUpArrow="bentUpArrow",e.bevel="bevel",e.blockArc="blockArc",e.borderCallout1="borderCallout1",e.borderCallout2="borderCallout2",e.borderCallout3="borderCallout3",e.bracePair="bracePair",e.bracketPair="bracketPair",e.callout1="callout1",e.callout2="callout2",e.callout3="callout3",e.can="can",e.chartPlus="chartPlus",e.chartStar="chartStar",e.chartX="chartX",e.chevron="chevron",e.chord="chord",e.circularArrow="circularArrow",e.cloud="cloud",e.cloudCallout="cloudCallout",e.corner="corner",e.cornerTabs="cornerTabs",e.cube="cube",e.curvedDownArrow="curvedDownArrow",e.curvedLeftArrow="curvedLeftArrow",e.curvedRightArrow="curvedRightArrow",e.curvedUpArrow="curvedUpArrow",e.custGeom="custGeom",e.decagon="decagon",e.diagStripe="diagStripe",e.diamond="diamond",e.dodecagon="dodecagon",e.donut="donut",e.doubleWave="doubleWave",e.downArrow="downArrow",e.downArrowCallout="downArrowCallout",e.ellipse="ellipse",e.ellipseRibbon="ellipseRibbon",e.ellipseRibbon2="ellipseRibbon2",e.flowChartAlternateProcess="flowChartAlternateProcess",e.flowChartCollate="flowChartCollate",e.flowChartConnector="flowChartConnector",e.flowChartDecision="flowChartDecision",e.flowChartDelay="flowChartDelay",e.flowChartDisplay="flowChartDisplay",e.flowChartDocument="flowChartDocument",e.flowChartExtract="flowChartExtract",e.flowChartInputOutput="flowChartInputOutput",e.flowChartInternalStorage="flowChartInternalStorage",e.flowChartMagneticDisk="flowChartMagneticDisk",e.flowChartMagneticDrum="flowChartMagneticDrum",e.flowChartMagneticTape="flowChartMagneticTape",e.flowChartManualInput="flowChartManualInput",e.flowChartManualOperation="flowChartManualOperation",e.flowChartMerge="flowChartMerge",e.flowChartMultidocument="flowChartMultidocument",e.flowChartOfflineStorage="flowChartOfflineStorage",e.flowChartOffpageConnector="flowChartOffpageConnector",e.flowChartOnlineStorage="flowChartOnlineStorage",e.flowChartOr="flowChartOr",e.flowChartPredefinedProcess="flowChartPredefinedProcess",e.flowChartPreparation="flowChartPreparation",e.flowChartProcess="flowChartProcess",e.flowChartPunchedCard="flowChartPunchedCard",e.flowChartPunchedTape="flowChartPunchedTape",e.flowChartSort="flowChartSort",e.flowChartSummingJunction="flowChartSummingJunction",e.flowChartTerminator="flowChartTerminator",e.folderCorner="folderCorner",e.frame="frame",e.funnel="funnel",e.gear6="gear6",e.gear9="gear9",e.halfFrame="halfFrame",e.heart="heart",e.heptagon="heptagon",e.hexagon="hexagon",e.homePlate="homePlate",e.horizontalScroll="horizontalScroll",e.irregularSeal1="irregularSeal1",e.irregularSeal2="irregularSeal2",e.leftArrow="leftArrow",e.leftArrowCallout="leftArrowCallout",e.leftBrace="leftBrace",e.leftBracket="leftBracket",e.leftCircularArrow="leftCircularArrow",e.leftRightArrow="leftRightArrow",e.leftRightArrowCallout="leftRightArrowCallout",e.leftRightCircularArrow="leftRightCircularArrow",e.leftRightRibbon="leftRightRibbon",e.leftRightUpArrow="leftRightUpArrow",e.leftUpArrow="leftUpArrow",e.lightningBolt="lightningBolt",e.line="line",e.lineInv="lineInv",e.mathDivide="mathDivide",e.mathEqual="mathEqual",e.mathMinus="mathMinus",e.mathMultiply="mathMultiply",e.mathNotEqual="mathNotEqual",e.mathPlus="mathPlus",e.moon="moon",e.noSmoking="noSmoking",e.nonIsoscelesTrapezoid="nonIsoscelesTrapezoid",e.notchedRightArrow="notchedRightArrow",e.octagon="octagon",e.parallelogram="parallelogram",e.pentagon="pentagon",e.pie="pie",e.pieWedge="pieWedge",e.plaque="plaque",e.plaqueTabs="plaqueTabs",e.plus="plus",e.quadArrow="quadArrow",e.quadArrowCallout="quadArrowCallout",e.rect="rect",e.ribbon="ribbon",e.ribbon2="ribbon2",e.rightArrow="rightArrow",e.rightArrowCallout="rightArrowCallout",e.rightBrace="rightBrace",e.rightBracket="rightBracket",e.round1Rect="round1Rect",e.round2DiagRect="round2DiagRect",e.round2SameRect="round2SameRect",e.roundRect="roundRect",e.rtTriangle="rtTriangle",e.smileyFace="smileyFace",e.snip1Rect="snip1Rect",e.snip2DiagRect="snip2DiagRect",e.snip2SameRect="snip2SameRect",e.snipRoundRect="snipRoundRect",e.squareTabs="squareTabs",e.star10="star10",e.star12="star12",e.star16="star16",e.star24="star24",e.star32="star32",e.star4="star4",e.star5="star5",e.star6="star6",e.star7="star7",e.star8="star8",e.stripedRightArrow="stripedRightArrow",e.sun="sun",e.swooshArrow="swooshArrow",e.teardrop="teardrop",e.trapezoid="trapezoid",e.triangle="triangle",e.upArrow="upArrow",e.upArrowCallout="upArrowCallout",e.upDownArrow="upDownArrow",e.upDownArrowCallout="upDownArrowCallout",e.uturnArrow="uturnArrow",e.verticalScroll="verticalScroll",e.wave="wave",e.wedgeEllipseCallout="wedgeEllipseCallout",e.wedgeRectCallout="wedgeRectCallout",e.wedgeRoundRectCallout="wedgeRoundRectCallout"})(AR||(AR={}));var il;(function(e){e.text1="tx1",e.text2="tx2",e.background1="bg1",e.background2="bg2",e.accent1="accent1",e.accent2="accent2",e.accent3="accent3",e.accent4="accent4",e.accent5="accent5",e.accent6="accent6"})(il||(il={}));var fR;(function(e){e.left="left",e.center="center",e.right="right",e.justify="justify"})(fR||(fR={}));var hR;(function(e){e.top="top",e.middle="middle",e.bottom="bottom"})(hR||(hR={}));var Kh;(function(e){e.ACTION_BUTTON_BACK_OR_PREVIOUS="actionButtonBackPrevious",e.ACTION_BUTTON_BEGINNING="actionButtonBeginning",e.ACTION_BUTTON_CUSTOM="actionButtonBlank",e.ACTION_BUTTON_DOCUMENT="actionButtonDocument",e.ACTION_BUTTON_END="actionButtonEnd",e.ACTION_BUTTON_FORWARD_OR_NEXT="actionButtonForwardNext",e.ACTION_BUTTON_HELP="actionButtonHelp",e.ACTION_BUTTON_HOME="actionButtonHome",e.ACTION_BUTTON_INFORMATION="actionButtonInformation",e.ACTION_BUTTON_MOVIE="actionButtonMovie",e.ACTION_BUTTON_RETURN="actionButtonReturn",e.ACTION_BUTTON_SOUND="actionButtonSound",e.ARC="arc",e.BALLOON="wedgeRoundRectCallout",e.BENT_ARROW="bentArrow",e.BENT_UP_ARROW="bentUpArrow",e.BEVEL="bevel",e.BLOCK_ARC="blockArc",e.CAN="can",e.CHART_PLUS="chartPlus",e.CHART_STAR="chartStar",e.CHART_X="chartX",e.CHEVRON="chevron",e.CHORD="chord",e.CIRCULAR_ARROW="circularArrow",e.CLOUD="cloud",e.CLOUD_CALLOUT="cloudCallout",e.CORNER="corner",e.CORNER_TABS="cornerTabs",e.CROSS="plus",e.CUBE="cube",e.CURVED_DOWN_ARROW="curvedDownArrow",e.CURVED_DOWN_RIBBON="ellipseRibbon",e.CURVED_LEFT_ARROW="curvedLeftArrow",e.CURVED_RIGHT_ARROW="curvedRightArrow",e.CURVED_UP_ARROW="curvedUpArrow",e.CURVED_UP_RIBBON="ellipseRibbon2",e.CUSTOM_GEOMETRY="custGeom",e.DECAGON="decagon",e.DIAGONAL_STRIPE="diagStripe",e.DIAMOND="diamond",e.DODECAGON="dodecagon",e.DONUT="donut",e.DOUBLE_BRACE="bracePair",e.DOUBLE_BRACKET="bracketPair",e.DOUBLE_WAVE="doubleWave",e.DOWN_ARROW="downArrow",e.DOWN_ARROW_CALLOUT="downArrowCallout",e.DOWN_RIBBON="ribbon",e.EXPLOSION1="irregularSeal1",e.EXPLOSION2="irregularSeal2",e.FLOWCHART_ALTERNATE_PROCESS="flowChartAlternateProcess",e.FLOWCHART_CARD="flowChartPunchedCard",e.FLOWCHART_COLLATE="flowChartCollate",e.FLOWCHART_CONNECTOR="flowChartConnector",e.FLOWCHART_DATA="flowChartInputOutput",e.FLOWCHART_DECISION="flowChartDecision",e.FLOWCHART_DELAY="flowChartDelay",e.FLOWCHART_DIRECT_ACCESS_STORAGE="flowChartMagneticDrum",e.FLOWCHART_DISPLAY="flowChartDisplay",e.FLOWCHART_DOCUMENT="flowChartDocument",e.FLOWCHART_EXTRACT="flowChartExtract",e.FLOWCHART_INTERNAL_STORAGE="flowChartInternalStorage",e.FLOWCHART_MAGNETIC_DISK="flowChartMagneticDisk",e.FLOWCHART_MANUAL_INPUT="flowChartManualInput",e.FLOWCHART_MANUAL_OPERATION="flowChartManualOperation",e.FLOWCHART_MERGE="flowChartMerge",e.FLOWCHART_MULTIDOCUMENT="flowChartMultidocument",e.FLOWCHART_OFFLINE_STORAGE="flowChartOfflineStorage",e.FLOWCHART_OFFPAGE_CONNECTOR="flowChartOffpageConnector",e.FLOWCHART_OR="flowChartOr",e.FLOWCHART_PREDEFINED_PROCESS="flowChartPredefinedProcess",e.FLOWCHART_PREPARATION="flowChartPreparation",e.FLOWCHART_PROCESS="flowChartProcess",e.FLOWCHART_PUNCHED_TAPE="flowChartPunchedTape",e.FLOWCHART_SEQUENTIAL_ACCESS_STORAGE="flowChartMagneticTape",e.FLOWCHART_SORT="flowChartSort",e.FLOWCHART_STORED_DATA="flowChartOnlineStorage",e.FLOWCHART_SUMMING_JUNCTION="flowChartSummingJunction",e.FLOWCHART_TERMINATOR="flowChartTerminator",e.FOLDED_CORNER="folderCorner",e.FRAME="frame",e.FUNNEL="funnel",e.GEAR_6="gear6",e.GEAR_9="gear9",e.HALF_FRAME="halfFrame",e.HEART="heart",e.HEPTAGON="heptagon",e.HEXAGON="hexagon",e.HORIZONTAL_SCROLL="horizontalScroll",e.ISOSCELES_TRIANGLE="triangle",e.LEFT_ARROW="leftArrow",e.LEFT_ARROW_CALLOUT="leftArrowCallout",e.LEFT_BRACE="leftBrace",e.LEFT_BRACKET="leftBracket",e.LEFT_CIRCULAR_ARROW="leftCircularArrow",e.LEFT_RIGHT_ARROW="leftRightArrow",e.LEFT_RIGHT_ARROW_CALLOUT="leftRightArrowCallout",e.LEFT_RIGHT_CIRCULAR_ARROW="leftRightCircularArrow",e.LEFT_RIGHT_RIBBON="leftRightRibbon",e.LEFT_RIGHT_UP_ARROW="leftRightUpArrow",e.LEFT_UP_ARROW="leftUpArrow",e.LIGHTNING_BOLT="lightningBolt",e.LINE_CALLOUT_1="borderCallout1",e.LINE_CALLOUT_1_ACCENT_BAR="accentCallout1",e.LINE_CALLOUT_1_BORDER_AND_ACCENT_BAR="accentBorderCallout1",e.LINE_CALLOUT_1_NO_BORDER="callout1",e.LINE_CALLOUT_2="borderCallout2",e.LINE_CALLOUT_2_ACCENT_BAR="accentCallout2",e.LINE_CALLOUT_2_BORDER_AND_ACCENT_BAR="accentBorderCallout2",e.LINE_CALLOUT_2_NO_BORDER="callout2",e.LINE_CALLOUT_3="borderCallout3",e.LINE_CALLOUT_3_ACCENT_BAR="accentCallout3",e.LINE_CALLOUT_3_BORDER_AND_ACCENT_BAR="accentBorderCallout3",e.LINE_CALLOUT_3_NO_BORDER="callout3",e.LINE_CALLOUT_4="borderCallout4",e.LINE_CALLOUT_4_ACCENT_BAR="accentCallout3=4",e.LINE_CALLOUT_4_BORDER_AND_ACCENT_BAR="accentBorderCallout4",e.LINE_CALLOUT_4_NO_BORDER="callout4",e.LINE="line",e.LINE_INVERSE="lineInv",e.MATH_DIVIDE="mathDivide",e.MATH_EQUAL="mathEqual",e.MATH_MINUS="mathMinus",e.MATH_MULTIPLY="mathMultiply",e.MATH_NOT_EQUAL="mathNotEqual",e.MATH_PLUS="mathPlus",e.MOON="moon",e.NON_ISOSCELES_TRAPEZOID="nonIsoscelesTrapezoid",e.NOTCHED_RIGHT_ARROW="notchedRightArrow",e.NO_SYMBOL="noSmoking",e.OCTAGON="octagon",e.OVAL="ellipse",e.OVAL_CALLOUT="wedgeEllipseCallout",e.PARALLELOGRAM="parallelogram",e.PENTAGON="homePlate",e.PIE="pie",e.PIE_WEDGE="pieWedge",e.PLAQUE="plaque",e.PLAQUE_TABS="plaqueTabs",e.QUAD_ARROW="quadArrow",e.QUAD_ARROW_CALLOUT="quadArrowCallout",e.RECTANGLE="rect",e.RECTANGULAR_CALLOUT="wedgeRectCallout",e.REGULAR_PENTAGON="pentagon",e.RIGHT_ARROW="rightArrow",e.RIGHT_ARROW_CALLOUT="rightArrowCallout",e.RIGHT_BRACE="rightBrace",e.RIGHT_BRACKET="rightBracket",e.RIGHT_TRIANGLE="rtTriangle",e.ROUNDED_RECTANGLE="roundRect",e.ROUNDED_RECTANGULAR_CALLOUT="wedgeRoundRectCallout",e.ROUND_1_RECTANGLE="round1Rect",e.ROUND_2_DIAG_RECTANGLE="round2DiagRect",e.ROUND_2_SAME_RECTANGLE="round2SameRect",e.SMILEY_FACE="smileyFace",e.SNIP_1_RECTANGLE="snip1Rect",e.SNIP_2_DIAG_RECTANGLE="snip2DiagRect",e.SNIP_2_SAME_RECTANGLE="snip2SameRect",e.SNIP_ROUND_RECTANGLE="snipRoundRect",e.SQUARE_TABS="squareTabs",e.STAR_10_POINT="star10",e.STAR_12_POINT="star12",e.STAR_16_POINT="star16",e.STAR_24_POINT="star24",e.STAR_32_POINT="star32",e.STAR_4_POINT="star4",e.STAR_5_POINT="star5",e.STAR_6_POINT="star6",e.STAR_7_POINT="star7",e.STAR_8_POINT="star8",e.STRIPED_RIGHT_ARROW="stripedRightArrow",e.SUN="sun",e.SWOOSH_ARROW="swooshArrow",e.TEAR="teardrop",e.TRAPEZOID="trapezoid",e.UP_ARROW="upArrow",e.UP_ARROW_CALLOUT="upArrowCallout",e.UP_DOWN_ARROW="upDownArrow",e.UP_DOWN_ARROW_CALLOUT="upDownArrowCallout",e.UP_RIBBON="ribbon2",e.U_TURN_ARROW="uturnArrow",e.VERTICAL_SCROLL="verticalScroll",e.WAVE="wave"})(Kh||(Kh={}));var et;(function(e){e.AREA="area",e.BAR="bar",e.BAR3D="bar3D",e.BUBBLE="bubble",e.BUBBLE3D="bubble3D",e.DOUGHNUT="doughnut",e.LINE="line",e.PIE="pie",e.RADAR="radar",e.SCATTER="scatter"})(et||(et={}));var b5;(function(e){e.TEXT1="tx1",e.TEXT2="tx2",e.BACKGROUND1="bg1",e.BACKGROUND2="bg2",e.ACCENT1="accent1",e.ACCENT2="accent2",e.ACCENT3="accent3",e.ACCENT4="accent4",e.ACCENT5="accent5",e.ACCENT6="accent6"})(b5||(b5={}));var If;(function(e){e.chart="chart",e.image="image",e.line="line",e.rect="rect",e.text="text",e.placeholder="placeholder"})(If||(If={}));var ar;(function(e){e.chart="chart",e.hyperlink="hyperlink",e.image="image",e.media="media",e.online="online",e.placeholder="placeholder",e.table="table",e.tablecell="tablecell",e.text="text",e.notes="notes"})(ar||(ar={}));var g1;(function(e){e.title="title",e.body="body",e.image="pic",e.chart="chart",e.table="tbl",e.media="media"})(g1||(g1={}));var wx;(function(e){e.DEFAULT="•",e.CHECK="✓",e.STAR="★",e.TRIANGLE="▶"})(wx||(wx={}));const Cx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAB3CAYAAAD1oOVhAAAGAUlEQVR4Xu2dT0xcRRzHf7tAYSsc0EBSIq2xEg8mtTGebVzEqOVIolz0siRE4gGTStqKwdpWsXoyGhMuyAVJOHBgqyvLNgonDkabeCBYW/8kTUr0wsJC+Wfm0bfuvn37Znbem9mR9303mJnf/Pb7ed95M7PDI5JIJPYJV5EC7e3t1N/fT62trdqViQCIu+bVgpIHEo/Hqbe3V/sdYVKHyWSSZmZm8ilVA0oeyNjYmEnaVC2Xvr6+qg5fAOJAz4DU1dURGzFSqZRVqtMpAFIGyMjICC0vL9PExIRWKADiAYTNshYWFrRCARAOEFZcCKWtrY0GBgaUTYkBRACIE4rKZwqACALR5RQAqQCIDqcASIVAVDsFQCSAqHQKgEgCUeUUAPEBRIVTAMQnEBvK5OQkbW9vk991CoAEAMQJxc86BUACAhKUUwAkQCBBOAVAAgbi1ykAogCIH6cAiCIgsk4BEIVAZJwCIIqBVLqiBxANQFgXS0tLND4+zl08AogmIG5OSSQS1gGKwgtANAIRcQqAaAbCe6YASBWA2E6xDyeyDUl7+AKQMkDYYevm5mZHabA/Li4uUiaTsYLau8QA4gLE/hU7wajyYtv1hReDAiAOxQcHBymbzark4BkbQKom/X8dp9Npmpqasn4BIAYAYSnYp+4BBEAMUcCwNOCQsAKZnp62NtQOw8WmwT09PUo+ijaHsOMx7GppaaH6+nolH0Z10K2tLVpdXbW6UfV3mNqBdHd3U1NTk2rtlMRfW1uj2dlZAFGirkRQAJEQTWUTAFGprkRsAJEQTWUTAFGprkRsAJEQTWUTAFGprkRsAJEQTWUTAFGprkRsAJEQTWUTAFGprkRsAJEQTWUTAGHqrm8caPzQ0WC1logbeiC7X3xJm0PvUmRzh45cuki1588FAmVn9BO6P3yF9utrqGH0MtW82S8UN9RA9v/4k7InjhcJFTs/TLVXLwmJV67S7vD7tHF5pKi46fYdosdOcOOGG8j1OcqefbFEJD9Q3GCwDhqT31HklS4A8VRgfYM2Op6k3bt/BQJl58J7lPvwg5JYNccepaMry0LPqFA7hCm39+NNyp2J0172b19QysGINj5CsRtpij57musOViH0QPJQXn6J9u7dlYJSFkbrMYolrwvDAJAC+WWdEpQz7FTgECeUCpzi6YxvvqXoM6eEhqnCSgDikEzUKUE7Aw7xuHctKB5OYU3dZlNR9syQdAaAcAYTC0pXF+39c09o2Ik+3EqxVKqiB7hbYAxZkk4pbBaEM+AQofv+wTrFwylBOQNABIGwavdfe4O2pg5elO+86l99nY58/VUF0byrYsjiSFluNlXYrOHcBar7+EogUADEQ0YRGHbzoKAASBkg2+9cpM1rV0tK2QOcXW7bLEFAARAXIF4w2DrDWoeUWaf4hQIgDiA8GPZ2iNfi0Q8UACkAIgrDbrJ385eDxaPLLrEsFAB5oG6lMPJQPLZZZKAACBGVhcG2Q+bmuLu2nk55e4jqPv1IeEoceiBeX7s2zCa5MAqdstl91vfXwaEGsv/rb5TtOFk6tWXOuJGh6KmnhO9sayrMninPx103JBtXblHkice58cINZP4Hyr5wpkgkdiChEmc4FWazLzenNKa/p0jncwDiqcD6BuWePk07t1asatZGoYQzSqA4nFJ7soNiP/+EUyfc25GI2GG53dHPrKo1g/1Cw4pIXLrzO+1c+/wg7tBbFDle/EbQcjFCPWQJCau5EoBoFpzXHYDwFNJcDiCaBed1ByA8hTSXA4hmwXndAQhPIc3lAKJZcF53AMJTSHM5gGgWnNcdgPAU0lwOIJoF53UHIDyFNJcfSiCdnZ0Ui8U0SxlMd7lcjubn561gh+Y1scFIU/0o/3sgeLO12E2k7UXKYumgFoAYdg8ACIAYpoBh6cAhAGKYAoalA4cAiGEKGJYOHAIghilgWDpwCIAYpoBh6cAhAGKYAoalA4cAiGEKGJYOHAIghilgWDpwCIAYpoBh6ZQ4JB6PKzviYthnNy4d9h+1M5mMlVckkUjsG5dhiBMCEMPg/wuOfrZZ/RSywQAAAABJRU5ErkJggg==",O1t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAB4AAAAVnCAYAAACzfHDVAAAAYHpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjaVcjJDYAwDEXBu6ughBfH+YnLQSwSHVA+Yrkwx7HtPHabHuEWrQ+lBBAZ6TMweBWoCwUH8quZH6VWFXVT696zxp12ARkVFEqn8wB8AAAACXBIWXMAAC4jAAAuIwF4pT92AADZLklEQVR42uzdd5hV9Z0/8M+dmcsUZmDovYOhKCiKYhR7JJuoSTCWGFI0WUxijBoTTXazVlyza4maYm9rTRSJigVsqCDNQhHBAogKCEgRMjMMU+7vj93sL8kqClLmnPt6PY+PeXZM9vP9vO8jZ+Y955xMfJLjorBrRMuSgmiViyjN1Ee2oSCyucbIBAAAAAAAAADbXaYgcoWNUZcrirpMbdRsysa69wbF+rggGrf439vSF7seF12aFUTnxvoosGIAAAAAAACAXacgoqEgF++/VRgr4r5o+Kh/pvD//F8uiII+LaPrum/EXzqui2b1ddHGKgEAAAAAAAB2rVxEQWMmWrQtjHZlA6N2w2tR84//zP8pgHu3ib6NBdG+zdqorK6KVUXZaB85j3sGAAAAAAAAaAoaG6OwIBdtyneP2PBabPzbr/1dAdx3VHRtyESHiIhcYzQrLo7WmVzkcjmPgAYAAAAAAABoSgpy0eIfS+D/LYD7fy3abC6Inn/7X2hsjELlLwAAAAAAAEDT9D8lcM1fHwddFBFxyAVR9M686PVp/gfqayKiJiLqLBMAAAAAAABgh8hGRGlEUekn/6PFEb3ikNgQk6O+KCJi6dzoksv83/cB/1X9xoiaJdmoWxlRV1dk2QAAAAAAAAA7QTZbH9muERX96v7n9t7/q6Exinq3i86LI94pjOOisHUu+uYykfmof7h+Y8Sa6aVRt74gGhs9DRoAAAAAAABgZ2lsLIi69QWxeUUmSjs0/vedwR8hk4uydSfE+wVd6qOyMfMx7/mtj9jwUtbjngEAAAAAAAB2obrqolg7IxtR/9Ffb4wo7P5GtCwobRaVH/c/UvNmNuqqPfIZAAAAAAAAYFerqy6KmjezH/v1ktpoVZBr/PgCeMN7yl8AAAAAAACApmJLHW5jUVQWNDSP+Q3ZeLco4i9/+8X6teHRzwAAAAAAAABNSd3/dLn/oLAoqqIuVhXFxhhSGB/xqGjlLwAAAAAAAECTU1eTjaK/KXSLIv7SWB+bc5ko9YxnAAAAAAAAgATJFv393bz1EeV//c8F1gMAAAAAAACQDgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKREkRUAAACwrUpLSwuGDRvWfMCAAS26du3avKysrLiioqKkZcuWzZs1a1bcvHnz0tLS0rJsNtusuLi4ebNmzUoLCgo+8/eijY2N9Zs3b66pra2tqqur21xTU1NdVVVVs2nTptqNGzdWbdiwoeYvf/nL5hUrVlQtWLBgw6xZs6pqamoaJQYAAEDaKYABAACIiIghQ4aUHnTQQW379u3bql27dq3at2/fpkWLFq2bN29eWVpa2qpZs2bNCwsLm2ez2fLCwsLyoqKi8sLCwtKknK+hoaG6vr6+qqGh4S91dXV/aWhoqNq8eXNVTU3NuqqqqvUbNmxYu2rVqjWrV69e99Zbb6177rnnPpgzZ06NTwYAAABJogAGAADIA8OGDWt+xBFHdBwwYECnLl26dGjdunXHFi1adCgtLe1YUlLSvlmzZq0KCgqK07yDwsLCssLCwrKIaPdp/zuNjY21mzdvXrdp06ZVNTU172/YsGHl2rVr31+2bNnKBQsWrHjyySffnzVrVpVPGAAAAE1Fpuexsd9HfaF+ZcSal0ptCAAAIAE6deqUPf744zvtueeeXbp3796lbdu2XSorKzuXlpZ2KS0t7VBYWFhhSztGQ0PDxpqampU1NTXL169fv+yDDz5Y9s477yybPXv2sj/96U8rVqxYUWdLAAAAbE9t9q6Jog4f/TUFMAAAQEJks9nMt7/97Y4jRozo1bdv397t2rXrXl5e3rWsrKxzcXFx+4gosKUmp7G2tnZVTU3Nso0bNy5btWrV0tdff/2tJ598cvG999672noAAADYFgpgAACAhPne977X6a9Fb/v27Xu1bNmyV1lZWa8kvXOXLauvr9/wl7/8ZdG6desWL1u2bNHChQsX/fGPf1w8derUjbYDAADAliiAAQAAmqhsNps59dRTuxx66KH9+/Tp87n27dv3Ly8v719UVOSRzXlq06ZNKzZu3Pj6+++//8abb775xqOPPvrG3XffvcpmAAAA+CsFMAAAQBNx6qmndvniF784qHfv3v3btWv3uYqKis8VFhaW2wxbUl9fv37Dhg1vfPDBB68vXrz4jccee2z+jTfeuNxmAAAA8pMCGAAAYBc45phjWn/rW9/aq3///kPatGnTv6Kiop9HOLO9NDQ0VG/cuPGtNWvWLFy4cOGcO+6445WHHnporc0AAACknwIYAABgJzjjjDO6f+lLX9qrV69eg1u3bj2orKysR0RkbIadJFddXb103bp18xcvXjz30UcffeXqq69+x1oAAADSRwEMAACwnZWWlhb86le/2u3QQw8d1r17931btmw5qLCwsMxmaEoaGhqqP/zww/nvvPPOzGeeeWbW2LFj36ipqWm0GQAAgGRTAAMAAGwHP/7xj7t+9atf3bdXr15D27Ztu1c2m21jKyRJXV3dmg8++OCVRYsWvfznP/95xh/+8IdltgIAAJA8CmAAAIBtcOKJJ7Y75ZRTDujXr9+w1q1bD81ms61shTSpq6tbt3bt2pfffPPNWbfccsvUe++9d7WtAAAANH0KYAAAgE+hoqKi4IILLhg0YsSI/bp27bpfy5YtB2YymUKbIR/kcrmGDz/8cP6777474/nnn59x4YUXvrZx40aPiwYAAGiCFMAAAAAf4/jjj2/7/e9//8D+/fsf2Lp1630KCgpKbAUiGhsbN61fv37eW2+9NeWGG2545u67715lKwAAAE2DAhgAAOB/ZLPZzAUXXPC5I4888sDu3bsfWFFRsVtEFNgMbFl1dfWSd999d8qsWbNmnnvuuS+vW7euwVYAAAB2DQUwAACQ10pLSwsuvfTSQYcccsjBXbt2HVFWVtbDVmDb1dbWrnr//fdfmDp16uRf/vKXL65evbreVgAAAHYeBTAAAJB3Bg0aVHrBBRd8fs899zywQ4cOBxQVFbWwFdj+Ghsba9euXTtrzpw5T59//vmTX3755WpbAQAA2LEUwAAAQF4YNmxY8/POO+/gIUOGHOZ9vrDz/W0ZfNFFFz07a9asKlsBAADY/hTAAABAarVq1arwyiuv3HfEiBEjO3TocFBhYWGZrcCu19DQUP3+++8/O2XKlIk/+clPZm7cuLHRVgAAALYPBTAAAJAqrVq1Kvztb3+7/3777Xd4x44dRxQWFpbbCjRdDQ0NG99///0pM2bMeOqHP/zhC8pgAACAz0YBDAAApMJZZ53V45vf/OaRvXr1GllaWtrVRiB5ampq3l28ePHEO++8c9LVV1/9jo0AAABsPQUwAACQWMOHDy+/6KKLvjB48OCjW7RoMdBGID0+/PDDV+fNmzfhvPPOe3L69Ol/sREAAIBPRwEMAAAkSqtWrQpvuOGGQ/bbb79/atOmzX6ZTCZrK5BeuVyubs2aNTNmzJjx2JgxYyavW7euwVYAAAA+ngIYAABIhB//+Mddv/e9732lZ8+e/1RcXNzWRiD/1NbWfvD2228/dssttzz029/+9l0bAQAA+L8UwAAAQJNVUVFRcO21137+4IMPPrZ169b7ZTKZAlsBIqJxzZo1M59//vnxp5122hR3BQMAAPx/CmAAAKDJOeWUUzqefvrpx/bu3ftL2Wy2jY0AH6e+vn7j0qVLH/vd7373x+uvv36ZjQAAAPlOAQwAADQJ2Ww2c+uttx5wyCGHnNC6deu9I8LdvsDWaFy7du1L06ZN+/OPfvSjZ1evXl1vJQAAQD5SAAMAALtU//79S6655pp/2nPPPY8tLy/vayPAZ1VTU7NswYIF488999wHp06dutFGAACAfKIABgAAdomf//znPU855ZQTu3btemRhYWGZjQDbW2NjY92KFSuevOWWW+689NJLF9kIAACQDxTAAADATuMxz8Cusn79+rlPP/30f5188slT6+rqcjYCAACklQIYAADY4fr27Vv8hz/84a+Pee5nI8CuUlNT8+68efPu/8EPfvDgwoULN9kIAACQNgpgAABghxkyZEjpNddc89XBgwefWFxc3MFGgKaitrZ21dy5c+/5yU9+8uc5c+bU2AgAAJAWWyqAPYoNAADYJqNHj+4wb968n06ZMuXRYcOGnaH8BZqa4uLi9sOGDTtjypQpj86bN++nJ510UntbAQAA0s4dwAAAwFY599xze33/+9//dufOnY/IZDJZGwGSIpfL1S1fvvzJG2644fbLLrvsbRsBAACSyiOgAQCAz+y8887r+53vfOfbHTt2PDyTyRTaCJBUuVyuYcWKFU/cdNNN//XrX/96sY0AAABJowAGAAC22WWXXTboG9/4xg9at249zDaAtFm7du2su++++9pzzjnnNdsAAACSQgEMAABsNcUvkE8UwQAAQJIogAEAgE9N8Qvks7Vr18665557rvv5z38+3zYAAICmaksFcGHlwOj6UV9orIqoWZG1PQAAyBO/+MUvet9xxx3nHHrooT8pLS3tYiNAPiotLe2y7777HvP973+/X1lZ2ZIpU6assxUAAKCpKetcHwXlH/01BTAAAOS5M844o/u99957zpe//OWflZeX94qIjK0AeS5TXl7e8+CDDx71/e9/v3dEvDVjxowPrQUAAGgqFMAAAMD/ceKJJ7a77777fjJq1Kh/KS8v7xOKX4B/lCkvL+99+OGHj/rWt77VfvXq1Qvnz59fbS0AAMCutqUC2DuAAQAgzwwdOrTs+uuvP6l///4nFRYWltkI20NjY2Ns2rQpqquro6amJurr62PTpk2xefPmqK+vj+rq6qivr4/NmzfHpk2boqGhYZv/fxUWFkZJSUk0a9YsioqKoqysLIqKiqJZs2ZRUlISRUVFUVpa+r9/FRQUCIjtoqGhoeq11167a8yYMffMmTOnxkYAAIBdZUvvAFYAAwBAnujUqVP2nnvuGbXXXnudnM1mK22Ej9PQ0BAbN26MDRs2/J+/Nm7cGBs3boyamprYtGlTbNq0KWpqaqK2trbJnqe4uDhKSkqitLT0f/9eUVERFRUV0aJFi//zV0VFRRQWFvog8LHq6urWvvjii7eceOKJf169enW9jQAAADubAhgAAPLcXXfdddAXv/jF00tLS7vZRn7L5XKxYcOGWLt2baxbty7Wrl37d3+tW7cuNmzYkPd7atGiRbRu3TpatWoVrVu3jjZt2vzvf27dunW0aNHCh4morq5e+sgjj1zzne98Z6ptAAAAO5MCGAAA8tTVV189+MQTTzyzoqJioG3kj8bGxli5cmUsX748Pvjgg1i9evX//n3t2rXR2NhoSZ9RYWFhtGrVKtq1axdt27b937937tw5OnTo4LHTeWbDhg3z77333qvOPPPMebYBAADsDApgAADIM1/72tfaXHrppad27979qIjQRKVUQ0NDrFq1KlasWBHvv//+//595cqVTfqRzGlXXFwcHTp0iI4dO0bnzp2jY8eO0alTp2jXrp1HS6dYLpdrfOeddx76+c9/fv2ECRPW2QgAALAjKYABACBP9OrVq9ldd931jT322OM7hYWFZTaSHh9++GG88847sXTp0njvvfdixYoVsXr16mhoaLCchCgsLIz27dtHp06dolu3btG9e/fo3r27x0mnTENDQ9W8efNu++Y3v/nHJUuWbLYRAABgR1AAAwBAHrjrrrtG/NM//dOZJSUlXWwj2davXx9Lly6Nd955539L3w8//NBiUqqysvJ/y+C//tWqVSuLSbiamppljz322G9Gjx49xTYAAIDtTQEMAAAp9qtf/arPD3/4w5+1atVqL9tIno0bN8aSJUvirbfeikWLFsV7770XmzZtspg8V1JSEl27do0+ffpE3759o3fv3lFeXm4xCbRu3bqXr7322ivGjh27yDYAAIDtRQEMAAApNGjQoNI77rjju7vttttJBQUFWRtJhtWrV8ebb74ZixcvjiVLlsTy5cujsbHRYtiigoKC6Ny5c/Tu3Tt69+4d/fr1i7Zt21pMQjQ2Nta98cYbd33rW9+6ff78+TU2AgAAfFYKYAAASJHS0tKCBx988Jj99tvvn7PZbBsbaboaGhri7bffjrfeeisWLFgQS5YscXcv201FRUX06tUr+vbtG3379o2ePXtGYWGhxTRhdXV1a2bMmHHjV77ylYdqamr85gcAALDNFMAAAJASp59+erdf/vKX51ZWVu5jG03T6tWr47XXXouFCxfGm2++GRs3brQUdooWLVpE3759Y8CAATFw4EB3CDdh69evf/E//uM//vPqq69+xzYAAIBtoQAGAICEGzRoUOm99977w969ex+byWTc4teErF+/PubNmxcLFiyIN954Q+FLk9GiRYvo169fDBgwIPbYY4+orKy0lCYkl8s1LF68eNyJJ554rcdCAwAAW0sBDAAACXbNNdcMOemkk35RVlbWyzZ2vVwuF++++27MnTs3XnvttViyZIl3+NLkFRQURK9evWLQoEExePDg6Natm6U0EdXV1UvuvvvuX//kJz+ZYxsAAMCnpQAGAIAEOuqoo1r99re//VmHDh0Ot41da9OmTTF79uyYO3duLFy4MKqqqiyFRGvevHn0798/Bg8eHHvuuWeUlJRYyi62cuXKp04//fTLJ0yYsM42AACAT6IABgCAhBk3btwRRxxxxFnZbLaNbewaVVVVMXfu3Jg7d27Mnz8/amtrLYVUKi4ujoEDB8bgwYNj8ODBUV5ebim7SF1d3ZqnnnrqqlGjRj1hGwAAwJYogAEAICFOOeWUjhdddNEvW7duvZ9t7HwrV66MWbNmxdy5c+Odd96JXC5nKeSdzp07x9577x3Dhg2LDh06WMgusHbt2hnnnXfepbfccsv7tgEAAHwUBTAAADRxpaWlBU899dQ3Bw8e/L2CggLPYt2JVqxYES+99FK89NJLsXz5cguBv/HXMnjvvfeOTp06WchO1NjYuGnu3Lk3H3744XfV1NR40TgAAPB3FMAAANCEjR49usOll176yzZt2gy3jZ1j/fr18eKLL8bMmTNj6dKlFgKfQs+ePWPfffeNYcOGRYsWLSxkJ1mzZs0L55577q/vvvvuVbYBAAD8lQIYAACaoIqKioKJEyd+c/Dgwd8vKCgotpEda8OGDfHiiy/G9OnTlb7wGfXo0SOGDx8ew4YNi4qKCgvZwdwNDAAA/CMFMAAANDGnnHJKx7Fjx/5rZWXlMNvYcerr6+PVV1+NGTNmxLx586Kurs5SYDvKZrMxZMiQ2HfffWP33XePwsJCS9mB1q5dO+MXv/jFv995550rbQMAAPKbAhgAAJqIbDabeeKJJ47fZ599fuSu3x0jl8vFwoULY/r06TF79uzYtGmTpcBOUFpaGkOGDInhw4fHgAEDLGQHaWhoqJ42bdo1Rx555J9tAwAA8pcCGAAAmoDjjz++7ZVXXvmr1q1be9fvDrBmzZqYNm1azJw5M1audHMc7EodO3aMz3/+87H//vt7X/CO+3fetDPPPPOScePGfWAbAACQfxTAAACwi9100037HXvssf9WXFzc1ja2n1wuF6+99lo8//zzMW/evKivr7cUaEKKiopizz33jBEjRsTnPve5yGQylrId1dbWrvrjH/948Q9+8INZtgEAAPlFAQwAALvIkCFDSu+///5zunTp8k+2sf2sXbs2Jk+eHNOnT48PP/zQQiABKisrY8SIEXHIIYdEeXm5hWxHy5Yte+zrX//6f86ZM6fGNgAAID9sqQAurBwYXT/qC41VETUrsrYHAADb6IILLtjt97///VVt2rQZZhvbx+LFi2P8+PFx9913xxtvvBG1tbWWAgmxadOmeOONN+LZZ5+NtWvXRps2bTweejtp0aJFv5NOOumg0tLSuc8+++xaGwEAgPQr61wfBR/zu7XuAAYAgO0sm81mJk2a9PVhw4b9pKCgwG9VfkZ1dXUxY8aMeOaZZ+K9996zEEiRfv36xSGHHBJDhw6NgoICC/mMGhsbN8+YMeOaL37xi+Pq6upyNgIAAOnlEdAAALCTHH/88W2vuuqqCyorK/exjc9mzZo18dRTT8XUqVNj06ZNFgIpVlFREZ///OfjsMMOi8rKSgv5jNavXz/r9NNPv3DcuHEf2AYAAKSTAhgAAHaC22677fNf+9rXzstms5W2se0WLVoUjz/+eMybNy9yOTewQT4pKiqKIUOGxBFHHBG9e/e2kM+grq5u3QMPPHDRySefPM02AAAgfRTAAACwA1VUVBQ8/fTTpwwcOPCUTCbjGabbIJfLxauvvhpPPvlkLFy40EIgz2UymRgwYEAcccQRMWjQIAvZ9n+3Ns6fP/+Www8//JaNGzc22ggAAKTHlgrgwsqB0fWjvtBYFVGzwuvKAABgS0488cR2EyZMuLx79+5fzmQyGRvZOo2NjTFr1qy49dZb48knn4wPPvC0UuC/rV69OmbMmBFz5syJ0tLS6NSpU/jX7NbJZDKZ9u3bD/3+978/dPny5TNfffXValsBAIB0KOtcHwXlH/O9gDuAAQBg29x66637H3vssRcWFRW1sI2tU1NTE0899VQ8++yzsWHDBgsBPlGLFi3i4IMPjsMPPzxKS/28YmvV19d/OG7cuPNPPvnk6bYBAADJ5xHQAACwHWWz2cyzzz77rSFDhvzAI5+3zqZNm2Ly5Mnx1FNPKX6BbdKiRYs47LDD4pBDDlEEb6VcLtfwyiuvXHfooYfeWVdX5yXrAACQYApgAADYTo455pjW11133cWVlZV728ant2HDhnj88cdjypQpUVtbayHAZ1ZcXBwHHnhgfPGLX4wWLTyIYWusWbNm2re//e3zn3nmGb+JAwAACeUdwAAAsB1cfvnlu1900UW/LS8v72cbn05VVVVMmDAhbrnllnjzzTejoaHBUoDtoqGhIZYsWRLPPfdc1NTURI8ePSKb9XOMT6OsrKzb17/+9SPbtm0774knnlhtIwAAkMDreu8ABgCAz+bhhx/+8qGHHnpOQUFBsW18sk2bNsUzzzwTTzzxRFRVVVkIsMOVl5fHkUceGYccckgUF/tX9afR2Ni46emnn/71Mccc87htAABAsngENAAAbKN27doVTZ48+YxevXodZxufrK6uLp5++umYOHGi4hfYJSoqKuKLX/xiHHzwwe4I/pQWLVr0x4MOOuiadevWeUwDAAAkhEdAAwDANjj22GPbPvzww7/p2LHjobaxZXV1dfHkk0/GddddF3Pnzo26ujpLAXaJzZs3x2uvvRbPPfdcRET06NEjCgsLLWYLWrduvfv3vve9fd9+++1pCxYsqLYRAABo+rb0CGgFMAAAfITLL7989wsuuOB3zZs372UbH6+xsTGmTJkS119/fbzyyiuKX6DJ2Lx5cyxYsCCmT58excXF0a1bt8hkMhbzMUpKSjp8+ctfPrJt27ZzvBcYAACaPu8ABgCArTB+/Pgjv/CFL/xLQUFBiW18vAULFsT48eNj6dKllgE0eT169IivfOUrMWjQIMvYgsbGxpqJEydecuyxxz5pGwAA0HR5BzAAAHwK7dq1K3ruued+1qNHj6/axsdbtGhR3H///bF48WLLABKnV69ecdxxx0WfPn0sYwuWLl3654MOOujy1atX19sGAAA0Pd4BDAAAn2DYsGHNn3766V936tTpC7bx0TZs2BD33Xdf/PGPf4y1a9daCJBI69evj2nTpsW6deuiZ8+eUVLiYQ8fpbKysv+3v/3t/lOmTJmyfPlyz/cHAIAmxjuAAQBgC372s5/1uP76669t0aKF54J+hJqamhg/fnzcfPPN8fbbb0cul7MUINFyuVy888478cwzz0RVVVX07t07slk/A/lHZWVl3U488cTD6+rqZkyfPv1DGwEAgCZ0va4ABgCAj3bFFVfscdZZZ11dXFzcwTb+Xi6XixkzZsR1110XCxYsiMbGRksBUqWxsTGWLFkSM2bMiPLy8ujSpUtkMhmL+RvZbLbFQQcddHibNm1mP/HEE6ttBAAAmoYtFcDeAQwAQN6aNGnSqAMOOODsTCZTaBt/b9GiRXHPPffEu+++axlA3ujWrVucdNJJ0bt3b8v4B7lcrm7y5Mm//vKXv/yIbQAAwK63pXcAK4ABAMg7paWlBTNnzjyzT58+x9vG39uwYUOMGzcuZsyY4VHPQF7KZDKx3377xde//vWoqKiwkH+waNGiP+27775X1dTUeCwEAADsQgpgAAD4H926dctOnjz5V506dRppG/9fLpeLqVOnxp///OfYuHGjhQB5r6KiIkaNGhX777+/x0L/g+XLlz9+6KGHXvLuu+/W2QYAAOwaWyqAvQMYAIC8MXz48PInnnjiynbt2o2wjf/vnXfeiWuvvTaee+652Lx5s4UARMTmzZtjzpw58dprr0XPnj2jRYsWlvI/Kioq+n7rW98aMnXq1Ofee+89f3AAAMAusKV3ACuAAQDIC9/+9rc73n777X9o0aLFANv4b1VVVXHXXXfFvffeG+vXr7cQgI+wbt26eP7552P9+vWx2267RVFRkaVERElJSefjjjvuoA8++GDKK6+88hcbAQCAnUsBDABAXjv//PP7XXzxxX8oKSnpbBv/bfr06XHttdfGokWLLAPgU3jnnXdi2rRp0bp16+jc2R8nERHZbLbyC1/4whElJSUvTp48eY2NAADAzqMABgAgb/3ud7/b60c/+tFVRUVFrWwjYs2aNXHzzTfHpEmTora21kIAtkJtbW289NJL8c4770Tfvn2jtLQ073dSWFhYNnz48C/26dNn4UMPPbTMpwQAAHYOBTAAAHnp1ltv3f+b3/zmfxYWFjbP913kcrl4/vnn4/rrr4/ly5f7cAB8BitXroxp06ZFRUVFdOvWLTKZTF7vo6CgIDto0KBDBw0atOiBBx54xycEAAB2vC0VwJmex8Z+H/WF+pURa17ym6wAACTTww8//KXDDjvsXzKZTN6/rPGDDz6I22+/Pd544w0fDIDtbMCAAfGtb30r2rRpk/e7yOVyjVOmTPn1yJEjH/LJAACAHavN3jVR1OGjv6YABgAgdV555ZXTPve5z30r3/fQ0NAQjz32WDz++ONRV1fngwGwg2Sz2Tj66KPjC1/4QhQUFOT9Pl5//fU79tprr9/7ZAAAwI6jAAYAIC9ks9nMyy+/fFafPn2Oz/ddvPvuu3HbbbfFe++954MBsJN069YtvvOd70S3bt3yfhdLliy5f5999rmypqam0ScDAAC2PwUwAACpV1paWjBr1qyzevfufVw+7yGXy8WTTz4ZDz74oLt+AXaBbDYbxxxzTBxxxBF5fzfw0qVLHxg6dOjlSmAAANj+FMAAAKRar169mk2ePHlsu3btDsrnPaxcuTJuueWWePvtt30oAHaxnj17ximnnBIdOnTI6z2sXr16yiGHHPIvS5Ys2exTAQAA28+WCuDCyoHR9aO+0FgVUbMia3sAADRpQ4cOLXvqqacub9Omzf75uoNcLhfPPPNMXH/99bF27VofCoAmYP369TFlypQoKSmJnj17RiaTycs9NG/evPtJJ500ZPLkyc+sWLHCoykAAGA7KetcHwXlH/01BTAAAIk1ZMiQ0kceeeSKVq1a7Z2vO6iuro7bb789nnjiiWhs9IRNgKaksbEx5s+fH++//34MGDAgstn8/DlLaWlpp6997WuDn3rqqadXrlxZ75MBAACfnQIYAIDUOfTQQ1s8+OCDv2/ZsuUe+bqDOXPmxNVXX+2RzwBN3PLly+OFF16Ijh075u0joUtLSzudcMIJ+7/00ktPv/3227U+FQAA8NkogAEASJVhw4Y1v++++37TsmXLQfl4/vr6+hg/fnz88Y9/jNpaP0MHSILNmzfHiy++GJs3b47ddtstCgoK8m4HxcXFbY866qg9n3vuuaeXL1/ucdAAAPAZKIABAEiNI488snLcuHG/b9GixcB8PP97770XV111VcyZM8eHASCBFi1aFC+//HL069cvWrRokXfnLykp6XDcccftP2fOnGcWLVq0yScCAAC2jQIYAIBUOPLIIyvvvPPO35aXl++Wj+d/+umn48Ybb4wPP/zQhwEgwf7yl7/ECy+8ECUlJdGrV6+8O3+zZs3aHHXUUfspgQEAYNspgAEASLxjjz227W233faH5s2b98m3s1dVVcXNN98cTz31VDQ2NvowAKRAY2NjzJ8/P5YtWxYDBgyIZs2a5dX5mzVr1uaYY4458M0333xm4cKFNT4RAACwdRTAAAAk2qGHHtritttuuzofy9+33347rrnmmli8eLEPAkAKvf/++/HKK69Enz59orKyMq/Ons1mK4888sh9Zs6c+dTSpUs3+zQAAMCnpwAGACCxjjjiiJb33nvvteXl5f3y6dy5XC4mTZoUN998c1RVVfkgAKRYVVVVTJ06NbLZbPTp0ycymUzenL24uLjtV7/61c+/8sorTy1evLjWpwEAAD4dBTAAAIl06KGHtrj33nt/l2/lb3V1ddx0000xefLkyOVyPggAeSCXy8WCBQvi3Xffjd133z2y2fz5mUyzZs1aH3300fvNmDHjSXcCAwDAp6MABgAgcYYOHVo2fvz4qysqKgbk07mXLVsWV111lUc+A+SplStXxiuvvBKf+9znoqKiIm/O3axZszZHH3300GeeeebJFStW1PkkAADAlimAAQBIlCFDhpQ++uij17Rs2XL3fDr31KlT49prr42NGzf6EADksaqqqpg+fXq0bds2unTpkjfnLikpaT9q1KihTz755JMrV66s90kAAICPt6UCuMB6AABoSjp16pSdMGHCv1dWVu6RL2dubGyMcePGxR133BF1dW56AiCitrY2br755hg/fnw0NjbmzbkrKyv3mDBhwr9369bNXQkAALCNFMAAADQZrVq1Kpw+ffolbdq02T9fzlxdXR2/+93vYtKkSd73C8DfyeVy8fjjj8fvf//7qK6uzptzt2nTZv8pU6Zc0qpVq0KfAgAA2HoKYAAAmoSKioqC2bNnX9KuXbuD8uXMS5cujYsuuijmz5/vAwDAx3r11VfjoosuiqVLl+bNmdu1a3fQ7Nmz/72iosLPrgAAYCu5iAYAoEmYOXPmz9q1a3dIvpz35ZdfjiuuuCLWrVsnfAA+0bp16+KKK66Il19+OW/O3K5du4Nnzpz5M+kDAMDWUQADALDLvfjii2N69OgxKh/Omsvl4oEHHogbbrghamtrhQ/Ap1ZbWxs33HBDPPDAA3nz2oAePXqMevHFF8dIHwAAPj0FMAAAu9SkSZO+NnDgwFPy4ax1dXVx8803x8SJE73vF4BtksvlYuLEiXHLLbdEXV1dXpx54MCBJ0+aNOlr0gcAgE9HAQwAwC7z6KOPHnXggQeekw9nXbduXfz617+OWbNmCR6Az2zmzJnx61//Ol9eJZA58MADz3n00UePkjwAAHyywsqB0fWjvtBYFVGzImtDAADsEDfeeOO+Rx999EWZTKYw7Wddvnx5XHXVVbFy5UrBA7DdbNiwIWbPnh0DBw6MioqKtB8307179/179uz56sMPP7xc+gAA5LuyzvVRUP7RX1MAAwCw011xxRV7fPe7372qoKCgWdrPOmfOnPjtb38bGzduFDwA2111dXVMmzYtOnfuHB07dkz1WTOZTOHuu+9+eJs2bV6aNGnSKukDAJDPFMAAADQZZ5xxRvef/exnvy0sLCxP+1knTJgQd999d9TX1wsegB2moaEhXnrppchms9G3b99UnzWTyRTttddeB/3lL395dubMmRukDwBAvlIAAwDQJBx00EEVf/jDH64pLi7ulOZz5nK5eOCBB+Kxxx4TOgA77c+eBQsWRF1dXfTv3z8ymUxqz1pQUFBywAEHDJs+ffqkpUuXbpY+AAD5aEsFcIH1AACwMwwaNKj0vvvuu7qsrKxXms9ZV1cX1113XUyaNEnoAOx0EydOjOuvvz7q6upSfc6ysrJef/rTn67u379/idQBAODvKYABANjhKioqCh577LGLKyoqBqb5nNXV1XHNNdfE7NmzhQ7ALvPKK6/ElVdeGVVVVak+Z4sWLQZOnDhxbEVFhZ9vAQDA33CBDADADjdz5syftW3b9sA0n3HdunVx2WWXxRtvvCFwAHa5xYsXx2WXXRZr165N9TnbtWt34MyZM38mcQAA+P8UwAAA7FBPPvnkqB49eoxK8xlXrVoVV1xxRSxfvlzgADQZK1asiCuuuCJWrlyZ6nP26NFj1KRJk0ZJHAAA/lth5cDo+lFfaKyKqFmRtSEAALbZjTfeuO+XvvSlCzOZTGp/8fDdd9+NK6+8MtatWydwAJqc6urqmDVrVvTv3z8qKytTe85u3boN79mz57yHH37Yb2MBAJAXyjrXR0H5R39NAQwAwA5x3nnn9T311FOvLigoKE7rGV977bW45pprorq6WuAANFmbN2+OGTNmRI8ePaJ9+/apPGMmkykYNGjQIYWFhVOee+45v5UFAEDqKYABANipjjrqqFb/8R//8YdmzZq1SusZX3755bj++uujrq5O4AA0eQ0NDfHSSy9Fp06dolOnTqk8Y0FBQXbYsGGfnz9//qQ33nhjk9QBAEizLRXA3gEMAMB21a1bt+wNN9zwnyUlJR3TesYpU6bEjTfeGPX19QIHIDHq6+vjxhtvjKlTp6b2jCUlJZ1uuOGG/+jWrZu7GgAAyFsKYAAAtqunn376XyorK/dI6/kmTZoUd955ZzQ2NgobgMRpbGyMO+64I5588snUnrGysnLw008//UtpAwCQrxTAAABsN88///w3unTp8k9pPd/EiRNj3LhxkcvlhA1AYuVyubj//vtTXQJ36dLlS88+++yJ0gYAIB95BzAAANvFTTfdNPzII488L5PJZNJ4vsceeyzGjx8vaABS47XXXotmzZpF3759U3m+zp0779urV695Dz/88DJpAwCQNlt6B7ACGACAz+wXv/hF7x/+8IdXFxQUNEvj+R544IF45JFHBA1A6ixYsCDq6upiwIABqTtbJpPJDBo06ODGxsbnpk6dul7aAACkiQIYAIAd5oADDqj43e9+99tmzZq1TeP5xo0bF5MmTRI0AKm1aNGi2Lx5cwwcODB1ZysoKMjut99+w5577rnH33vvvc3SBgAgLbZUAHsHMAAA2yybzWbuvPPOfyktLe2exvNNmDBB+QtAXpg0aVI89NBDqTxbaWlpj3vuuedfstlsRtIAAOQDBTAAANvs+eef/06HDh0OTePZHn744Xj44YeFDEDeeOSRR+LPf/5zKs/WoUOHw5599tlvSxkAgHygAAYAYJvcd999hw8ePPjUNJ7t/vvvjwkTJggZgLzz2GOPxX333ZfKs+25554/+NOf/nSYlAEASDvvAAYAYKudccYZ3ceMGXN5QUFBcdrONnHixHjkkUeEDEDeWrx4cWSz2ejbt2/ajpbp06fPvn/5y18mz5w5c4OkAQBIsi29A1gBDADAVhk2bFjzG2+88Q/NmjVrl7azPfroo6l99CUAbI2FCxdGUVFR9OvXL1XnKigoKD7wwAP3e/LJJx9dsWJFnaQBAEiqLRXAHgENAMBWuffee39ZWlraPW3nevzxx+PBBx8UMAD8jz//+c8xceLE1J2rtLS0x3333fdLCQMAkFYKYAAAPrVJkyaN6tSp0xEpPFeMHz9ewADwD8aPHx+TJ09O3bk6der0hUmTJn1VwgAApJFHQAMA8Kmcd955fU888cR/z2QyRWk618yZM+Puu+8WMAB8jNdeey06duwYnTt3TtW5unbtuk9BQcHzzz333DopAwCQNN4BDADAZ3LEEUe0vOKKK67NZrOVaTrXyy+/HDfffHPkcjkhA8DHyOVyMXv27OjSpUt06tQpNefKZDJF++yzz/CpU6c+9u67726WNAAASeIdwAAAbLNsNpu55ZZb/q2kpKRjms61YMGCuPnmm6OxsVHIAPAJGhsb4+abb44333wzVecqLS3tcvfdd5+fzWYzUgYAIC0UwAAAbNGkSZO+3rZt2wPTdKZly5bFDTfcEPX19QIGgE+prq4urr322li+fHmqztWuXbsDH3/88VESBgAgLTwCGgCAj3XZZZcN+upXvzo2k8mk5hcH33///bjyyiujqqpKwACwlerq6uLll1+OIUOGRHl5eWrO1aVLl31LS0unPvPMM2ukDABAEngENAAAW61///4lJ5988q8ymUxRWs60YcOG+P3vfx8bN24UMABso40bN8bvfve7VP15WlBQkP3hD394ft++fYslDABA4q9vrQAAgI/y4IMPnl1WVtYrLeeprq6O3/zmN7Fq1SrhAsBntGrVqrjyyiujuro6NWcqKyvr8/DDD58lXQAAkk4BDADA/zF+/Pgju3XrdnRazlNfX5/KdxYCwK60fPnyuO6666K+vj41Z+rRo8dXx40bd4R0AQBIMgUwAAB/53vf+16nI4444py0nCeXy8Vtt90Wb7zxhnABYDt7/fXX47bbbotcLpeaMx155JHnfvvb3+4oXQAAkkoBDADA/6qoqCi4+OKLLywsLCxPy5nGjx8fs2bNEi4A7CCzZs2Khx56KDXnKSwsrPj1r399QUVFhZ+bAQCQSC5kAQD4XxMnThxdWVk5OC3nef7552PixImCBYAd7LHHHosXXnghNeeprKzc89FHHz1RsgAAJFFh5cDo+lFfaKyKqFmRtSEAgDxxwQUX7DZq1KgLM5lMYRrO8+qrr8Ytt9ySqkdSAkBT/7O3d+/e0a5du1Scp2PHjkNzudxzU6ZMWSddAACamrLO9VHwMc/wcwcwAADRt2/f4h//+McXZzKZVPwG4HvvvRc33HBDNDY2ChcAdpKGhoa47rrrYtmyZak4T0FBQfbss88e27dv32LpAgCQqGtZKwAAYPz48T8qKyvrkYazbNiwIX7/+99HbW2tYAFgJ9u0aVP8/ve/j40bN6biPGVlZb3GjRs3RrIAACSJAhgAIM/ddNNNw/v06XN8Gs5SX18f1157baxdu1awALCLrFmzJq699tqor69PxXn69ev3jd///vdDJQsAQFIogAEA8thBBx1Uceyxx/5rRGTScJ477rgjFi9eLFgA2MUWLVoUd955Z1qOU/CNb3zj34YNG9ZcsgAAJOIC1goAAPLXzTfffFZxcXG7NJxl4sSJMX36dKECQBMxbdq0mDRpUirOUlJS0unOO+88Q6oAACSBAhgAIE/913/914FdunT5UhrO8tprr8Wf//xnoQJAEzN+/PhYsGBBKs7SrVu3o2+66abhUgUAoKlTAAMA5KEvfelLlV/5yld+lYazrFixIq6//vpobGwULAA0MY2NjXHdddfFihUr0nCczHHHHfergw46qEKyAAA0ZQpgAIA8dPXVV5+ezWYrk36OmpqauPbaa2PTpk1CBYAmatOmTXHttddGTU1N4s+SzWbb3njjjT+RKgAATZkCGAAgz9x6663Du3Tp8uWknyOXy8Utt9wSK1euFCoANHErV66MW2+9NXK5XOLP4lHQAAA0dQpgAIA8MnTo0LKvfvWrv0jDWSZMmBBz584VKgAkxJw5c+Kxxx5LxVlGjRr1i6FDh5ZJFQCApkgBDACQR+64444fFRcXd0z6OV5++eV45JFHBAoACfPQQw+l4he4SkpKOt5xxx0/lCgAAE2RAhgAIE9cfvnlu/fs2XNU0s/xwQcfxB133JGKR0gCQL7J5XJx2223xZo1axJ/lp49ex57+eWX7y5VAACaGgUwAEAe6NatW/a73/3uv2YymURf/9XX18cNN9wQ1dXVQgWAhKqqqoobb7wx6uvrE32OTCZT8N3vfvdX3bp1y0oVAICmRAEMAJAHxo8ff0pZWVmvpJ/jnnvuiaVLlwoUABJuyZIlcd999yX+HGVlZT3Hjx9/ikQBAGhKFMAAACn385//vOeAAQNGJ/0c06dPjylTpggUAFJi8uTJMWPGjMSfY8CAAaN//vOf95QoAABNhQIYACDFstls5qyzzjo3k8kk+tGEK1asiLvvvlugAJAyd911V6xYsSLRZ8hkMtmzzjrr3Gw2m5EoAABNgQIYACDFxo0b98XKysq9knyG2trauOGGG6K2tlagAJAyf/1zfvPmzYk+R2Vl5V7jxo0bKVEAAJoCBTAAQEoNHz68/OCDDz4t6ee4//77Y/ny5QIFgJRavnx5jBs3LvHnGDFixI+HDRvWXKIAAOxqCmAAgJS69dZbT8tms22TfIYZM2bEc889J0wASLnJkyfHzJkzE32G4uLitrfffvtp0gQAYFdTAAMApNBVV121R48ePb6S5DOsXLky7rrrLmECQJ64++6744MPPkj0GXr27PnVK664Yg9pAgCwKymAAQBSprS0tOAb3/jGT5N8rdfY2Bi333679/4CQB6pqamJ2267LRobG5N8jIJvfvObZ5aWlvqZGwAAu+6i1AoAANJlwoQJX6uoqBiQ5DOMHz8+Fi1aJEwAyDNvvvlmPPjgg4k+Q4sWLQY9+OCDx0gTAIBdRQEMAJAiRx55ZOWwYcN+kOQzzJ07N5544glhAkCemjhxYixYsCDRZxg+fPiPjjjiiJbSBABgV1AAAwCkyBVXXHFyUVFRRVLnr6qqijvvvDNyuZwwASBP5XK5uP3226O6ujqxZygqKmrxm9/85mRpAgCwKyiAAQBS4vzzz+/Xu3fv45J8httvvz0+/PBDYQJAnlu3bl3cfvvtiT5D7969jz///PP7SRMAgJ1NAQwAkALZbDZz6qmn/jyTyST2+m769OkxZ84cYQIAERExe/bsmDFjRmLnz2QyBaeeeurPs9lsRpoAAOxMCmAAgBT44x//eERlZeXgpM6/du3auPfeewUJAPyde+65J9atW5fY+SsrKwf/6U9/+oIkAQDYmRTAAAAJ17dv3+JDDjnkR0k+w9133x01NTXCBAD+Tk1NTdx9992JPsPBBx/8o759+xZLEwCAnUUBDACQcHfdddc3S0pKOiV1/smTJ8e8efMECQB8pLlz58azzz6b2PlLSko63nPPPd+SJAAAO4sCGAAgwb70pS9VDhw48KSkzr9mzZoYP368IAGALXrggQdizZo1iZ2/f//+Jx111FGtJAkAwM6gAAYASLArrrji1MLCwvIkzp7L5eK2226LTZs2CRIA2KJNmzbFbbfdFrlcLpHzFxYWll1++eU/kCQAADuDAhgAIKF+8Ytf9O7evftXkjr/s88+G2+88YYgAYBP5Y033ojnn38+sfN369bt6F/96ld9JAkAwI6mAAYASKgf/vCHP8pkMom8nvvggw/igQceECIAsFXGjRsX69atS+TsmUym4NRTT/2xFAEA2NEUwAAACXTdddcNa9eu3YFJnD2Xy8Udd9wRtbW1ggQAtsqmTZvizjvvTOz8bdq02f+mm27aT5IAAOxICmAAgIQpLS0t+NrXvnZ6Uud/4YUXYuHChYIEALbJq6++GjNmzEjs/Mccc8zpFRUVfiYHAMAO42ITACBhbr/99oMrKip2S+LsGzZsiHHjxgkRAPhM7r///qiqqkrk7OXl5X3/67/+6wgpAgCwoyiAAQASpKKiouCwww47Nanz33vvvYn9YS0A0HRs2LAh7r///sTOf9BBB/1zq1atCiUJAMCOoAAGAEiQ+++//+iysrKeSZx9zpw58dJLLwkRANguXnjhhViwYEEiZy8tLe32xz/+8StSBABgR1AAAwAkRN++fYv33Xfff07i7LW1tXHvvfcKEQDYru6+++6oq6tL5Oz77bffKf379y+RIgAA25sCGAAgIW6++eZRxcXFbZM4+yOPPBJr164VIgCwXa1atSoee+yxRM6ezWbb3njjjV+TIgAA25sCGAAgAYYOHVq21157fSeJs7/33nvxxBNPCBEA2CEmTpwYK1asSOTsQ4YM+c7QoUPLpAgAwPakAAYASIBrr732xKKiosqkzZ3L5eKee+6JxsZGIQIAO0R9fX3cddddkcvlEjd7UVFR5bXXXnuCFAEA2J4UwAAATdwBBxxQMWDAgG8kcfYZM2bEW2+9JUQAYId6880348UXX0zk7AMGDPjG8OHDy6UIAMD2ogAGAGjirrrqqhOKiooqkjb3pk2b4oEHHhAgALBT3H///VFbW5u4uYuKilpcffXV7gIGAGC7UQADADRhBx10UEX//v0Teffvww8/HB9++KEQAYCdYv369TFhwoREzj5w4MBvHHDAARVSBABge1AAAwA0Yf/5n/95bGFhYfOkzb1q1aqYPHmyAAGAnerpp5+O1atXJ27uwsLC8ssuu2yUBAEA2B4UwAAATdQBBxxQMWjQoNFJnP3uu++O+vp6IQIAO1V9fX3cddddiZx99913/+bQoUPLpAgAwGelAAYAaKIuv/zyYwsLC8uTNvfcuXNjwYIFAgQAdokFCxbE3LlzEzd3UVFRi9/97ndflyAAAJ+VAhgAoAkaOnRo2aBBgxL37t+6urr405/+JEAAYJf605/+FHV1dYmbe/fdd//mkCFDSiUIAMBnoQAGAGiCfvOb33ylqKioZdLmfu655xL53j0AIF1Wr14dzz33XOLmLioqann11VcfLUEAAD4LBTAAQBPTq1evZoMHD/5m0uaurq6ORx55RIAAQJPwyCOPRHV1deLmHjJkyLe6deuWlSAAANtKAQwA0MTcdNNNxxQXF7dN2twTJkyIqqoqAQIATUJVVVUifzmtuLi43a233uouYAAAtpkCGACgCWnVqlXhXnvtdVLS5l61alU8++yzAgQAmpTJkyfHqlWrEjf30KFDR7dq1apQggAAbAsFMABAE3LLLbccXlJS0jlpcz/44INRX18vQACgSamvr48HH3wwcXOXlJR0vummmw6VIAAA20IBDADQRGSz2cwBBxzw7aTNvWjRonjppZcECAA0SS+99FIsXrw4cXOPGDHiO9lsNiNBAAC2lgIYAKCJuOaaa/YuLy/vm7S5H3roocjlcgIEAJqkXC6XyLuAy8vL+1111VV7SRAAgK2lAAYAaCK+8pWvfDdpM8+bNy8WLlwoPACgSVu4cGG8+uqrrg8BAMgLCmAAgCbgsssuG1RZWblPkmbO5XIxfvx44QEAifDAAw8k7qklrVu33veSSy7pLz0AALaGAhgAoAkYNWrUCUmbefbs2bFs2TLhAQCJsGzZsnjllVcSN/cJJ5xwovQAANgaCmAAgF3sn//5nzt37NjxiCTN3NjYGA888IDwAIBEGT9+fDQ0NCRq5k6dOn1h9OjRHaQHAMCnpQAGANjFfvSjH30tk8kk6rps2rRpsWrVKuEBAImyatWqeOGFFxI1cyaTKfzpT386SnoAAHxaCmAAgF1o0KBBpX369Plqkmaur6+PCRMmCA8ASKQJEyZEXV1dombu27fvV/r27VssPQAAPg0FMADALnTZZZcdXlRUVJGkmadOnRpr164VHgCQSOvXr48pU6YkauaioqLK3/zmN0dIDwCAT0MBDACwi2Sz2cy+++57UpJmrqurc/cvAJB4jz76aOLuAt5///1PymazGekBAPBJFMAAALvI1VdfPbSsrKx3kmaeMmVKbNiwQXgAQKJt2LAhnn/++UTNXFZW1ueqq67aS3oAAHwSBTAAwC7y5S9/+bgkzVtfXx8TJ04UHACQCo8//nji7gL+0pe+dLzkAAD4JApgAIBdYPTo0R3atm07IkkzT5s2LdatWyc8ACAVPvzww5g+fXqiZm7fvv2I0aNHd5AeAABbogAGANgFfvrTn47KZDKFSZm3vr4+HnnkEcEBAKnyyCOPRH19fWLmzWQyhT/96U+/JjkAALZEAQwAsJN16tQp26dPn6OTNLO7fwGANFq3bl1MmzYtUTP36dPnmE6dOmWlBwDAx1EAAwDsZFddddUB2Wy2dVLmbWxsjEmTJgmOVOvYsWN06OCJmgD5aNKkSdHY2JiYebPZbOurrrrqAMkBAPBxFMAAADvZiBEjvp6keV988cVYtWqV4Ei1Ll26xIUXXhinnXZadO3a1UIA8siqVavipZdecj0JAEBqKIABAHaiM844o3tlZeXeSZk3l8vFxIkTBUdeyGQyMXjw4PjVr34VY8aMcUcwQB55/PHHI5fLJWbeysrKvc8444zukgMA4KMogAEAdqJTTjnlqxGRScq8CxYsiPfee09w5JVMJhN77713XHjhhTFmzJho3769pQCk3HvvvRcLFy5M1B9X/3NdCQAA/4cCGABgJ+nVq1ezXr16fTlJM3v3L/nsr0XwBRdcECeffHK0bdvWUgBSLGnXPb169fpyr169mkkOAIB/pAAGANhJrrjiioOLiopaJmXeBN4JAztEYWFhDB8+PC688MIYPXp0VFZWWgpACi1YsCCWLVuWmHmLiopaXnnllYdIDgCAf6QABgDYSYYPH/6VJM2btHfhwY5WVFQUI0aMiEsuuSRGjx4dLVu2tBSAFMnlcvH4448naub99tvvK5IDAOAfKYABAHaC0aNHd6isrByalHnXrl0bL7/8suDgI/y1CL744ovjhBNOiBYtWlgKQEq89NJLsW7dusTMW1lZudfo0aM7SA4AgL+lAAYA2AlOP/30o5J07fXMM89EQ0OD4GALiouL47DDDouxY8fGqFGjoqyszFIAEq6hoSGeeeaZJI1c8D/XmQAA8P8vEq0AAGDHymazmX79+n05KfPW1tbGlClTBAefUnFxcYwcOTIuvfTSGDVqVJSWlloKQII9//zzUVtbm5h5+/Xr9+VsNpuRHAAAf6UABgDYwX7zm9/sWVJS0jkp886YMSOqq6sFB1uppKQkRo4cGZdcckkcffTRUVJSYikACVRdXR0zZ85M0p8/na+44orBkgMA4K8UwAAAO9gXvvCFLyVl1lwuF08//bTQ4DNo3rx5HHXUUXHJJZfEyJEjI5vNWgpAwjz11FORy+USM++RRx75ZakBAPBXCmAAgB1oyJAhpZ07dz4iKfO+/vrrsWLFCsHBdlBeXh6jRo2KSy+9VBEMkDArVqyI119/PTHzdunS5fD+/ft79AQAABGhAAYA2KHGjh17aGFhYWJeCOruX9j+KioqYtSoUXHxxRfH4YcfHkVFRZYC4LpouyosLGz+H//xHwdLDQCACAUwAMAOteeeex6ZlFnXrl0b8+bNExrsIK1atYrjjz8+LrroohgxYkQUFPh2DKApmzdvXqxZsyYx8+61115HSg0AgAgFMADADnPMMce0bt269b5Jmfe5556LxsZGwcEO1qZNmxg9enRcfPHFimCAJqyxsTGee+65JP35MvyYY45pLTkAAPykAQBgBznzzDMPz2Qyibjeqq+vj6lTpwoNdqK2bdvG6NGj47zzzovhw4crggGaoBdeeCHq6+sTMWsmkyk844wzDpUaAAB+wgAAsIP079//C0mZdc6cObFhwwahwS7QqVOnOPnkk+Pf/u3fYu+9945MJmMpAE3Ehg0bYvbs2YmZd8CAAR4DDQCAAhgAYEf43ve+16mysnKPpMybpMcbQlp17tw5xowZE7/61a8UwQBNyPPPP5+YWSsrKwd/73vf6yQ1AID8pgAGANgBTj755CMiIhHtzcqVK+P1118XGjQRXbt2jTFjxsQ555wTgwcPthCAXez111+PlStXJmXczMknn3y41AAA8psCGABgB+jXr19iHv88ZcqUyOVyQoMmpnfv3nHaaafFOeecE/3797cQgF0kl8vFlClTknQd6jHQAAB5TgEMALCdnX766d0qKip2S8Ks9fX1MW3aNKFBE9anT58466yz4pxzzonddtvNQgB2gWnTpkV9fX0iZq2oqNjt9NNP7yY1AID8pQAGANjORo8efURSZp03b15s3LhRaJAAffr0ibPPPjvOPPPM6Nmzp4UA7EQbN26MefPmuR4FACARFMAAANtZr169EvPetSQ9zhD4bwMGDIhf/vKXceaZZ0b37t0tBGAnmTp1apKuRw+TGABA/lIAAwBsR2eccUb38vLyvkmYdf369fHaa68JDRJqwIAB8S//8i9x2mmnRbdunvQJsKPNnz8/Pvzww0TMWl5e3u9HP/pRF6kBAOQnBTAAwHZ03HHHHZSUWWfMmBGNjY1CgwTLZDIxePDg+Nd//dcYM2ZMdOjQwVIAdpDGxsaYMWNGYub9xje+cYjUAADykwIYAGA76tOnz8FJmDOXyyXqMYbAlmUymdh7773jwgsvjDFjxkT79u0tBWAHeOGFF5J0XXqIxAAA8pMCGABgOznppJPat2zZcvckzLpkyZJYuXKl0CBl/loEX3DBBXHyySdH27ZtLQVgO1qxYkW8/fbbiZi1srJy0PHHH+8PAgCAPKQABgDYTr773e8eGBGZJMyapMcXAluvsLAwhg8fHhdeeGGMHj06KisrLQVgO5k+fXpSRi34/ve/f6DEAADyjwIYAGA72X333Q9Nwpz19fUxc+ZMgUEeKCoqihEjRsQll1wSo0ePjpYtW1oKwGc0c+bMqK+vT8SsAwcOPFRiAAD5RwEMALAdHHTQQRUtW7bcKwmzLly4MKqrq4UGeeSvRfDFF18cJ5xwQrRo0cJSALZRVVVVvP7664mYtVWrVkOHDx9eLjUAgPyiAAYA2A7OPvvsz2cymaIkzOrxz5C/iouL47DDDouxY8fGqFGjoqyszFIAtkFSnqaSyWSy55577uclBgCQXxTAAADbwe67735AEuasra2NOXPmCAzyXHFxcYwcOTIuvfRSRTDANpg9e3bU1dUlYtY99tjjAIkBAOQXBTAAwGfUqlWrwnbt2u2fhFnnzZsXtbW1QgMiIqKkpCRGjhwZY8eOjaOPPjpKSkosBeBT2LRpU8ybNy8Rs7Zv337/iooKPwMEAMgjLv4AAD6jCy+8cPeioqKKJMz64osvCgz4P5o3bx5HHXVUXHLJJTFy5MjIZrOWAvAJZs2alYg5i4qKWlx88cWDJAYAkD8UwAAAn9GBBx6YiMfqVVdXJ+ZOFWDXKC8vj1GjRsWll16qCAb4BPPmzYuamppEzHrQQQd5DDQAQB5RAAMAfEZdu3YdnoQ5582bF/X19QIDPlFFRUWMGjUqLr744jj88MOjqKjIUgD+QV1dXbz66quJmLVLly77SwwAIH8ogAEAPoNTTjmlY3l5+W5JmPXll18WGLBVWrVqFccff3xcdNFFMWLEiCgo8C0kwN966aWXEjFnRUXFbieddFJ7iQEA5AffvQMAfAYnnnji55MwZ21tbcyfP19gwDZp06ZNjB49OsaOHasIBvgb8+fPj9ra2iSMmvnud7/7eYkBAOQH37UDAHwGn/vc5/ZLwpwLFy6Muro6gQGfyV+L4PPOOy+GDx+uCAby3ubNm2PhwoWJmLVfv37DJQYAkB98tw4AsI1atWpV2Lp1672TMKvHPwPbU6dOneLkk0+Oc889NwYNGmQhQF6bPXt2IuZs06bN3hUVFX4WCACQB1z0AQBso/PPP39gYWFheVOfs76+PubMmSMwYLvr2bNn/OQnP4nzzjsv9t5778hkMpYC5J3Zs2dHfX19k5+zqKio4vzzzx8oMQCA9FMAAwBso/3333/fJMz5+uuvR01NjcCAHaZLly4xZsyYOOecc2Lw4MEWAuSV6urqeOONNxIx64EHHriPxAAA0k8BDACwjbp27ZqIxz/PnTtXWMBO0bt37zjttNPinHPOif79+1sIkDeScr3VvXv3vaUFAJB+CmAAgG0wZMiQ0srKyj2a+py5XM7jn4Gdrk+fPnHWWWfFOeecE7vttpuFAKk3e/bsyOVyTX7Oli1b7jlo0KBSiQEApJsCGABgG5x55pl7ZjKZbFOfc9myZbFu3TqBAbtEnz594uyzz44zzzwzevbsaSFAaq1bty6WL1/e5OfMZDLZs846a4jEAADSrcgKAAC23tChQ4clYc558+YJC9jlBgwYEAMGDIgFCxbE+PHjY+nSpZYCpM68efOiS5cuTX7OffbZZ5+ImC4xAID0cgcwAMA26Nix4z5JmHP+/PnCApqMAQMGxC9/+cs47bTTolu3bhYCpEpSrrs6deq0j7QAANJNAQwAsJWOOOKIlhUVFf2a+pxVVVWxaNEigQFNSiaTicGDB8e//uu/xpgxY6JDhw6WAqTCW2+9FVVVVU1+zoqKis8deuihLSQGAJBeCmAAgK108sknD46ITFOfc/78+dHY2CgwoEnKZDKx9957x4UXXhhjxoyJ9u3bWwqQaI2NjbFgwYJE/Cv4u9/97h4SAwBILwUwAMBW2n333fdMwpze/wskwV+L4AsuuCBOPvnkaNu2raUAiZWU66/BgwfvKS0AgPQqsgIAgK3Trl27wU19xlwul5Q7UAAiIqKwsDCGDx8e++yzT0ybNi0mTJgQ69evtxggURYsWBC5XC4ymab9sJgOHToMlhYAQHq5AxgAYCsMGjSotGXLlgOa+pzvvfdebNy4UWBA4hQVFcWIESPikksuidGjR0fLli0tBUiMDz/8MJYtW9bk52zZsuXA/v37l0gMACCdFMAAAFvhxz/+8aBMJtPkn6Li7l8g6f5aBI8dOzZOOOGEaNGihaUAibBw4cImP2Mmk8n+5Cc/GSAtAIB0UgADAGyFvffee88kzJmEHzwCfBrNmjWLww47LMaOHRujRo2KsrIySwGatKT8Il5SrmsBANh63gEMALAVunbtOqSpz1hfXx9vvvmmsIBUKS4ujpEjR8bBBx8czz77bDz++ONRXV1tMUCT8+abb0Z9fX0UFTXtH7t16dJlT2kBAKSTO4ABAD6lioqKgoqKikFNfc4lS5bE5s2bBQakUklJSYwcOTLGjh0bRx99dJSUeIUl0LTU1tbG0qVLm/ycLVu2HFRaWupngwAAKeQiDwDgUzr77LP7FhYWNvlnj7722mvCAlKvefPmcdRRR8Ull1wSI0eOjGbNmlkK4HpsKxQWFpafffbZvaQFAJA+CmAAgE9p//3375+EOV9//XVhAXmjvLw8Ro0aFf/+7/8eI0eOjGw2aymA67FP6fOf//xAaQEApI8CGADgU+rRo8fuTX3G2traePvtt4UF5J2KiooYNWpUXHzxxXH44Yc3+XdvAum2ePHiRLySo1evXoOkBQCQPgpgAIBPqXXr1k3+DoklS5ZEQ0ODsIC81apVqzj++OPj4osvjhEjRkRBgW97gZ2voaEhlixZ0uTnbNOmjQIYACCFfCcMAPApDBkypLR58+a9m/qcb775prAAIqJ169YxevToGDt2rCIYcF32MZo3b95n0KBBpdICAEgX3wEDAHwKp556av9MJtPkr53eeustYQH8jTZt2sTo0aPjvPPOi+HDhyuCAddlfyOTyRT84Ac/+Jy0AADSxXe+AACfwuDBg5v84/Hq6+tj0aJFwgL4CJ06dYqTTz45/u3f/i323nvvyGQylgLsUIsXL07Eqzn23HPPgdICAEgXBTAAwKfQpUuXAU19xnfeeSfq6uqEBbAFnTt3jjFjxiiCgR2utrY23n333SRc53oPMABAyiiAAQA+hZYtW/Zv6jN6/DPAp9elS5cYM2ZMnHvuuTF48GALAfL2+iwJ17kAAGwdBTAAwCcYPnx4eUlJSeemPqfHPwNsvV69esVpp50W55xzTvTvrwMB8u/6rLS0tPPw4cPLpQUAkB4KYACAT/Ctb31rt4ho8s8IXbx4sbAAtlGfPn3irLPOinPOOSd22203CwG2i4T8gl7m29/+dj9pAQCkhwIYAOAT7L777k2+CVi7dm1s2LBBWACfUZ8+feLss8+OM888M3r27GkhwGfy4Ycfxrp165r8nAMHDlQAAwCkSJEVAABsWadOnZr8D8TefvttQQFsRwMGDIgBAwbEggULYvz48bF06VJLAbb5Oq1Vq1audwEA2GkUwAAAn6CyslIBDJCnBgwYEP3794958+bFQw89FO+++66lAFtlyZIlsddeezX1613PvgcASBEFMADAFnTq1CnbvHnzXk19ziVLlggLYAfJZDIxePDg2GOPPeLll1+OBx98MFauXGkxQGqu05o3b967Xbt2RatXr66XGABA8nkHMADAFowZM6ZnJpPJNuUZGxsbPZoUYCfIZDKx9957x4UXXhhjxoyJ9u3bWwrwiZYuXRqNjY1NesaCgoLsqaee2kNaAADp4A5gAIAt2Hvvvfs29RlXrlwZtbW1wgLYSf5aBO+5554xa9asmDBhQqxevdpigI9UW1sb77//fnTu3LlJzzls2LC+EbFIYgAAyecOYACALejRo0eTL4DfeecdQQHsAoWFhTF8+PC48MILY/To0VFZWWkpQGKv15Jw3QsAwKejAAYA2ILWrVs3+ff/vvvuu4IC2IUKCwtjxIgRcckll8To0aOjZcuWlgIk7notCde9AAB8Oh4BDQCwBc2bN+/Z1GdUAAM0kW+wi4pixIgRsd9++8WUKVPiscceiw0bNlgMEO+9914SrnsVwAAAKeEOYACAj9G/f/+SkpKSjk19TgUwQNPSrFmzOOyww2Ls2LExatSoKCsrsxTIc0m4XistLe3Ut2/fYmkBACSfAhgA4GOccMIJ3Zr69dK6deuiqqpKWABNUHFxcYwcOTJ+/etfK4Ihz1VVVcX69eub+pgF3/zmN7tLCwAg+RTAAAAfY8iQIT2b+oxJeJwgQL77axE8duzYOProo6OkpMRSIA8l4botCde/AAB8MgUwAMDH6N69e8+mPqPHPwMkR/PmzeOoo46KSy65JEaOHBnNmjWzFMgjSbhuS8L1LwAAn0wBDADwMVq1atWjqc+4bNkyQQEkTHl5eYwaNSr+/d//PUaOHBnZbNZSIA8k4botCde/AAB8MgUwAMDHqKio6NXUZ1y+fLmgAJL750yMGjUqLr744jj88MOjqKjIUiDFknDd1rJly16SAgBIPgUwAMBHyGazmbKysq5NecbGxsZYtWqVsAASrlWrVnH88cfHxRdfHCNGjIiCAt+qQxqtWrUqGhsbm/SMJSUlXbPZbEZaAADJ5rtKAICPcNxxx7UrKCgobsozrl69Ourr64UFkBKtW7eO0aNHx9ixYxXBkEJ1dXXxwQcfNOkZCwoKio877rh20gIASDbfTQIAfITPf/7zXZr6jO+//76gAFKoTZs2MXr06Dj//PNj+PDhimBIkRUrVrgOBgBgh/NdJP+PvTuPr7I888d/nSwEkhD2HUQEUVRAoIiouCtq64Jabd1arVorbqO2tlXbaavTOu38Rqffdmpbu9rWpYogsqgFRXCttAIKArJDgAAJBLKQ5JzfH8WO4+DOcp6T9/v18jWvTv657ut6hNvnk/t+AICd2G+//bL+xVcSXiAC8PF17do1Lr300rj99ttj2LBhkUq5lRWSLgn7tyTsgwEAeH8FWgAA8H917txZAAxAVujevXtceeWVsXr16njiiSdi9uzZkclkNAYSKAn7tyTsgwEAeH8CYACAnWjXrp0roAHIKj169Igrr7wyli5dGpMmTYo5c+ZoCiRMEvZvSdgHAwDw/gTAAAA7UVxc3D3baxQAAzRPffr0ibFjx8aSJUti/PjxsWDBAk2BhEjC/i0J+2AAAN6fbwADAOxESUlJz2yur7q6Ourq6gwKoBnbb7/94l/+5V/ia1/7WhxwwAEaAglQV1cX1dXV9sEAAOxWAmAAgHc5/PDDSwsKCtpmc40VFRUGBUBERPTt2zduvPHGuOGGG2LffffVEMhy2b6PKygoaDt8+PASkwIASC4BMADAu5x44oldsr3GDRs2GBQA/8uAAQPiG9/4Rtxwww3Ru3dvDQH7uE+yH+5qUgAAyeUbwAAA79KvX7+sD4DXr19vUADs1IABA+LAAw+MuXPnxoQJE2LlypWaAlkkCTe5HHDAAV0i4i3TAgBIJgEwAMC7dO/evXO21+gEMADvJ5VKxaBBg2LgwIExe/bsGD9+fKxbt05jwD4uZ/bDAAC8NwEwAMC7tG/fvlO21ygABuDDSKVSMWzYsBg6dGjMnj07HnvsMbdIwF6WhBPASdgPAwDw3gTAAADv0rp166w/8ZCEF4cAZI+3g+BDDz00XnnllZg4caK/S8A+LtH7YQAA3psAGADgXUpKSrL6xENjY2Ns3rzZoAD4yPLz8+Pwww+P4cOHx/PPPx8TJ06MqqoqjYE9aPPmzdHY2BgFBdn7Wi7b98MAALw/ATAAwLu0bNmySzbXV1lZGZlMxqAA+Njy8/Nj1KhRMXLkyHjhhRcEwbAHZTKZqKqqio4dO9oPAwCwWwiAAQDepaioKKuvvKusrDQkAHaJgoKCGDVqVIwYMSJmzpwZkydPji1btmgM7IH9XDYHwNm+HwYA4P3laQEAwP8YPnx4SX5+fkk21ygABmBXa9GiRRx//PFxxx13xNlnnx0lJSWaAs14P5efn18yfPhwfxAAACSUABgA4B2OOOKIDtleo+//ArC7FBUVxejRo+P73/9+nH322VFcXKwpsBsk4cr1JOyLAQDYOQEwAMA79O3bt1221+gEMAC729tB8B133BGnn356tGrVSlOgme3n9ttvv7YmBQCQTAJgAIB36NSpkwAYAHYoKSmJz3zmM3HnnXfG6NGjo0WLFpoCzWQ/l4R9MQAAOycABgB4hw4dOrTN9hqTcGUgALmlpKQkzj777PjOd74To0aNivz8fE2BHN/PJWFfDADAzgmAAQDeoaysrG221ygABmBvad++fVx00UVx5513xgknnBCFhYWaAjm6nysrK3MCGAAgoQTAAADvUFJS0j6b68tkMlFdXW1QAOxV7dq1i/POOy+++93vxqhRoyIvz+sF+CiSsJ8rLS0VAAMAJJT/QgMAeIfi4uK22VxfXV1dNDY2GhQAWeHtE8F33HGHIBg+gsbGxqirq7MvBgBgt/BfZgAA79CqVausPung9C8A2ahDhw5x0UUXxbe//e04/PDDBcGQA/u6oqIiJ4ABABLKf5EBALxDQUGBABgAPqauXbvGpZdeGt/61rdi2LBhkUqlNAUSuq9r0aJFW1MCAEimAi0AAPgfhYWFZdlc39atWw0JgKzXrVu3uPLKK2P16tXxxBNPxOzZsyOTyWgMJGhfl+37YgAA3psAGADgnZujgoLW2VyfE8AAJEmPHj3iyiuvjKVLl8akSZNizpw5mgIJ2ddl+74YAID35gpoAIAdWrdunZefn98ym2sUAAOQRH369ImxY8fGLbfcEgMGDNAQSMC+Lj8/v1WrVq28OwQASCCbOACAHQYNGlQSEVn9scJt27YZFACJtd9++8UNN9wQX/va1+KAAw7QEJq1BOzr8gYPHlxsUgAAySMABgDY4YADDijJ9hpramoMCoDE69u3b9x4441xww03xL777qshNEu1tbVZX2P//v1LTQoAIHl8AxgAYIeePXtm/QuuJLwoBIAPa8CAATFgwICYP39+jBs3LpYvX64pNBtJ2Nf16NGjxKQAAJJHAAwAsEOnTp0EwACwFwwYMCAOPPDAmDt3bkyYMCFWrlypKeS8JOzrunbtKgAGAEggATAAwA5lZWVZ/4Krrq7OoADISalUKgYNGhQDBw6M2bNnx4QJE2Lt2rUaQ85KQgDcpk0bV0ADACSQABgAYIeysjIngAFgL0ulUjFs2LAYOnRozJ49O8aPHx/r1q3TGHKOABgAgN1FAAwAsENJSUlxttfoBDAAzcXbQfCQIUPi5ZdfjokTJ0ZFRYXGkDOSEAAnYX8MAMD/JQAGANihqKioKNtrrKmpMSgAmpW8vLw4/PDDY/jw4fH888/HE088EZWVlRpD4iUhAG7RokWRSQEAJI8AGABgh8LCwhbZXF86nY7t27cbFADNUn5+fowaNSpGjhwZL7zwQkycODGqqqo0hsTavn17ZDKZSKVSWVtjixYtWpgUAEDyCIABAHbI9gC4oaHBkABo9goKCmLUqFExYsSImDlzZkyePDm2bNmiMSROJpOJhoaGyOaMtbCw0AlgAIAk/neTFgAA7NgYFRRk9QuuxsZGQwKAHVq0aBHHH398HHnkkfHMM8/E1KlTY9u2bRpDomR7AJzt+2MAAN5jH6cFAAA7NkZZ/oLL9c8A8H8VFRXF6NGj49hjj41nnnkmpkyZEjU1NRpDImT7DS8FBQWugAYASCABMADA2xujLH/B5QpoAHhvbwfBRx11VEyfPj2efvrpqK2t1RiymgAYAIDdIU8LAAD+QQAMAMlXUlISn/nMZ+LOO++M0aNHZ/X1uiAABgBgdxAAAwDskO1XQAuAAeDDKykpibPPPjv+7d/+LUaPHh2FhYWagv3dR5Sfn9/SlAAAkkcADADw9sYoL88JYADIMa1bt46zzz47vve978UJJ5wgCMb+7iPIz8/3LwwAQAIJgAEAdkilUlm9N2psbDQkAPiY2rVrF+edd15897vfjRNOOCEKCgo0Bfu7D94f55sSAEDyCIABAHbI9gA4nU4bEgB8Qu3bt/9nEDxq1KjIy/NqBPu799kfp0wJACB5/FcOAMAOXnABQPPRoUOHuOiii+J73/ueIJi9JpPJZHuJ/sUAAEggmzgAgP+R1QFwAl4QAkDidOzYMS666KL41re+FYcffnj4fTDs796xOc7yG3IAANg5mzgAgITsjQTAALD7dOvWLS699NL41re+FcOGDRMEs0dk+xXQeXl5/kUAAEigAi0AAPiHbH/BJQAGgN2ve/fuceWVV8ayZcviiSeeiDlz5mgKzXl/5/AIAEACCYABAHbIZDJOAAMAERGx7777xtixY2PJkiUxYcKEmD9/vqZgfwwAQCIIgAEA/ocr7gCA/2W//faLG264Id56660YP358vPnmm5rCLpPtV0Cn3IUOAJBIAmAAgB2y/QVXtr8gBIBc1rdv37jxxhvjrbfeinHjxsWiRYs0hU/MFdAAANjEAQDsXln9Bs4BDADY+/r27Rs333xz3HDDDdG7d28NIdf3d75BAgCQQE4AAwDskO0nMATAAJA9BgwYEAMGDIj58+fHI488EitXrtQUcnF/5woaAIAEcgIYAGCHVCqVzvL6DAkAssyAAQPi1ltvjbFjx0bPnj01hJza32UScEc1AAD/lxPAAAD/QwAMAHysv6MHDRoUBx98cDz//PMxadKk2LRpk8aQ+P1dtv+CJAAAO+cEMADADul0dr/fEgADQHarr6+PioqK2LZtm2aQE/u7dDrtBDAAQAI5AQwA8D+cAAYAPrK6urp4+umnY9q0acJfcm1/5wQwAEACCYABAP6HEw4AwIfW0NAQ06ZNiyeffDK2bt2qIXxkCfgGsAAYACCBBMAAADtkMpmsDoDz8ny9AwCywdvB71NPPRXV1dUaQs7u7wTAAADJJAAGANgh219wCYABYO9qbGyMGTNmxJNPPhmVlZUawieWn5+f9VtkUwIASB4BMADADplMpiGb6yssLDQkANgL0ul0zJo1KyZPnhwbN27UEHaZgoLsfjXX1NTUaEoAAAncZ2oBAMA/NDY2bs/m+gTAALBnpdPpePnll2Py5Mmxdu1aDWGXa9GiRbb/O1BvSgAAySMABgDYoampSQAMAEQmk4nZs2fH448/HuXl5RpCs93fNTY2CoABABJIAAwAsENDQ0NWv+ASAAPA7vV28PvEE0/E6tWrNYTdLtuvgM72G3IAAHiPfaYWAAD8gyugAaD5mjNnTkyaNCmWLl2qGewx2X4FtAAYACCZBMAAADs0NTU5AQwAzcyCBQtiwoQJ8dZbb2kG9nfv0tDQIAAGAEggATAAwA7Z/oJLAAwAu87ChQtj/PjxsXjxYs1gr8n2K6Cz/RckAQB4j32mFgAA/EO2B8AFBQWRl5cX6XTasADgY1q+fHmMGzcu5s+frxnsVXl5eVkfAG/fvt0JYACABBIAAwDs0NDQkPUnHFq1ahXbtm0zLAD4iFauXBmPPPKI4Jes2tclYH8sAAYASCABMADADrW1tXXZXqMAGAA+mnXr1sX48eNj9uzZkclkNISs2tdlu7q6ulqTAgBIHgEwAMAOW7du3ZrtNSbhRSEAZIP169fHY489JvjFvu4TqK6u3mpSAADJIwAGANihqqpKAAwACbdhw4Z4/PHH45VXXommpiYNwb7uE6isrHT1DABAAgmAAQB22LRpU9a/4GrZsqVBAcBOVFVVxcSJE+OFF16IxsZGDSHrJSEA3rRpkxPAAAAJJAAGANhh3bp1WR8AOwEMAP/bli1bYsKECYJfEicJ+7ry8nIBMABAAgmAAQB2WLZsmSugASAhqqurY/LkyTFz5syor6/XEBInCfu6pUuXCoABABJIAAwAsMP8+fOz/gRwcXGxQQHQrNXU1MSUKVPimWeeEfySaEnY173++uu+AQwAkEACYACAHRYsWFCXyWQaUqlUYbbW2Lp1a4MCoFmqq6uLp59+OqZNmxbbtsmkSL5s39el0+mGpUuXbjcpAIDkEQADALxDU1PTtoKCgrbZWp8AGIDmZvv27TF9+vR48sknY+tWt9GSO7J9X9fU1ORfOACAhBIAAwC8Q0NDw9ZsDoBLS0sNCYDm8ndyTJs2LZ566qmorq7WEHJOtu/rGhsb/YsHAJBQAmAAgHeor6+vbNWqVc9src8JYAByXWNjY8yYMSOefPLJqKys1BByVrbv6+rr66tMCQAgmQTAAADv0NDQkNVvmgXAAOSqdDods2bNismTJ8fGjRs1hJyX7fu6bN8XAwDw3gTAAADvUFdXV5XN9ZWWlkYqlYpMJmNYAOSETCYTr732Wjz++OOxatUqDaFZSKVSUVJSktU11tbWVpkUAEAyCYABAN5h27Ztm7K5vvz8/GjVqlXU1NQYFgCJlslkYvbs2fH4449HeXm5htCstGrVKvLz87O6xq1btzoBDACQUAJgAIB3qK6u3pztNZaVlQmAAUist4PfiRMnxpo1azSEZqmsrCzra9y2bVuVSQEAJJMAGADgHaqqqjZle43t2rWLtWvXGhYAiTNnzpyYNGlSLF26VDNo1tq1a5f1NW7atMkJYACALNbQWBgFjQ0REZFKRSavMJre/pkAGADgHSoqKqqyvcYkvDAEgHdasGBBTJgwId566y3NgITs5zZs2CAABgDIYoUFDf9MejMRqab0/+S+AmAAgHdYtWpV1r/oatu2rUEBkAgLFy6M8ePHx+LFizUD3iEJAfDq1aurTAoAIJkEwAAA77BgwYKsD4CdAAYg2y1fvjzGjRsX8+fP1wzYiST8Ql8S9sUAAOycABgA4B2eeOKJjZlMpimVSuVna41OAAOQrVauXBmPPPKI4Bc+QLb/Ql8mk2l64oknNpoUAEAyCYABAN6huro6vX379g1FRUVdsrVGJ4AByDZr166NCRMmxOzZsyOTyWgIJHw/t3379g3V1dVpkwIASCYBMADAu9TV1a0XAAPAB1u/fn089thjgl/Isf1cXV3delMCAEguATAAwLvU1dVVtGnTJmvrKykpiRYtWsT27dsNC4C9oqKiIiZOnBivvPJKNDU1aQh8BEVFRVFcXJz1+2GTAgBILgEwAMC7bN26dV2XLll7ADhSqVR07Ngx1qxZY1gA7FFVVVUxceLEeP755wW/8DF17NgxUqlU1u+HTQoAILkEwAAA71JVVZX1Jx46deokAAZgj9m8eXM8/vjj8cILL0RjY6OGwCfcx9kPAwCwOwmAAQDeZf369Vn/zbMkvDgEIPm2bNkSU6ZMiZkzZ0Z9fb2GwC7QsWNH+2EAAHYrATAAwLusXr066088JOHFIQDJVVNTE1OmTIlnnnlG8Au7WBJ+kW/VqlUCYACABBMAAwC8y9///ves/+aZABiA3aG2tjYmT54czz77bNTV1WkINNN93KuvvioABgBIMAEwAMC7PPzww+t//OMfN6RSqcJsrbFz584GBcAus3379pg+fXpMnTo1tm3bpiGwG2X7CeB0Ot3w8MMPC4ABABJMAAwA8C7V1dXpurq68latWu2TrTV26NAh8vLyIp1OGxgAH1tDQ0NMmzYtnnrqqaiurtYQ2M3y8vKiQ4cOWV1jfX39mtraWptMAIAEEwADAOxEbW3tmmwOgAsKCqJdu3axceNGwwLgI2tsbIwZM2bEk08+GZWVlRoCe0j79u2joCC7X8fV1NSUmxQAQLIJgAEAdmLz5s2r2rdvn9U1duvWTQAMwEeSTqdj1qxZMXnyZH+HwF7av2W7LVu2rDQpAIBkEwADAOzEpk2bVvfp0yera+zWrVvMmzfPsAD4QG8Hv1OmTIkNGzZoCOzF/Vu227BhwxqTAgBINgEwAMBOrFixYvWwYcOyusYkvEAEYO/KZDLx0ksvxZQpU6K83K2usLd17do162tctWrVKpMCAEg2ATAAwE7Mnz9/9ZgxY7K6xiS8QARg78hkMjF79uyYOHFirFnjMB9kiyT8At+8efP8oQEAkHACYACAnRg3btyab37zm5mISGVrjU4AA7Azc+bMiSeeeCKWLVumGZBlEvALfJlx48atNikAgGQTAAMA7MTrr79e29DQsKmwsLBDttZYXFwcZWVlsWXLFgMDIBYsWBDjx4+PJUuWaAZkobKysiguLs7qGhsaGjYuWLCgzrQAAJJNAAwA8B62bt26vF27dh2yucauXbsKgAGauYULF8b48eNj8eLFmgFZLAm3t2zbtm25SQEAJJ8AGADgPVRVVS1t167d0GyusWfPnrFw4ULDAmiGli1bFo899ljMnz9fMyABevbsmfU1VlZWLjUpAIDkEwADALyHdevWLevTp09W15iEF4kA7ForVqyIRx99VPALCZOEfdvatWuXmRQAQPIJgAEA3sPChQuXHX744VldY69evQwKoJlYtWpVjB8/PubOnRuZTEZDIGGSsG9buHDhMpMCAEg+ATAAwHuYNm3a0ksuuSSra+zevXvk5+dHU1OTgQHkqHXr1sX48eNj9uzZgl9IqIKCgkR8A/jpp59eZloAADmw/9QCAICde+ihhzbcd999W/Pz80uzdjNXUBBdunSJNWvWGBhAjqmoqIiJEyfGyy+/HOl0WkMgwbp27RoFBdn9Gq6xsbH6kUce2WBaAADJJwAGAHgf27ZtW15WVnZwNtfYq1cvATBADqmqqoqJEyfG888/74YHyBFJ+P7vtm3blpsUAEBuEAADALyPLVu2LMv2ALhnz57x0ksvGRZAwm3evDkef/zxeOGFF6KxsVFDIIck4fu/W7ZsWWpSAAC5QQAMAPA+1q9fvyzbT2z06NHDoAASbMuWLTFlypSYOXNm1NfXawjkoCTs19avX7/MpAAAcoMAGADgfSxYsGDh0KFDs7rGfffdN1KpVGQyGQMDSJCampqYMmVKPPPMM4JfyGGpVCr23XffrK9z/vz5C00LACA3CIABAN7Ho48++uYFF1yQ1TWWlJRE586dY926dQYGkAC1tbUxefLkePbZZ6Ourk5DIMd17do1WrVqlfV1/vnPf15kWgAAuUEADADwPiZNmlRVX1+/oaioqGM217nvvvsKgAGy3Pbt22P69OkxderU2LZtm4ZAM9GnT5+sr7G+vr7iySefrDItAIDcIAAGAPgAW7duXZTtAXCfPn3ipZdeMiyALNTQ0BDTpk2Lp556KqqrqzUEmpkkXP+8detWp38BAHKIABgA4ANUVFQs7NChw8hsrjEJLxYBmpvGxsaYMWNGPPnkk1FZWakh0EwlYZ9WUVHh+78AADlEAAwA8AGWLl266MADD8zqGnv16hUFBQXR2NhoYAB7WTqdjlmzZsWkSZNi06ZNGgLNWGFhYfTs2TMR+13TAgDIHQJgAIAPMHPmzEWnnnpqdm/qCgqiZ8+esWzZMgMD2EveDn4nT54cGzdu1BAg9tlnn8jPz0/CfnexaQEA5I48LQAAeH+//OUvV6bT6bpsr7NPnz6GBbAXZDKZePHFF+O73/1u3H///cJf4J+ScP1zOp2u++Uvf7nStAAAcocTwAAAH6C6ujpdXV29uE2bNodkc539+vWL6dOnGxjAHpLJZGL27NkxceLEWLNmjYYAO92fJWCvu7i6ujptWgAAuUMADADwIWzYsGFetgfA/fv3NyiAPeTVV1+NSZMmxapVqzQD2KlUKpWI/dmGDRvmmhYAQG4RAAMAfAiLFy9+o2/fvlldY1lZWXTu3DnWr19vYAC7yYIFC2L8+PGxZMkSzQDeV5cuXaK0tDQJ+9z5pgUAkFsEwAAAH8JTTz31+ujRo7O+zv33318ADLAbLFy4MMaPHx+LFy/WDOBD78uSYMqUKa+bFgBAbsnTAgCAD/aLX/xiTWNjY1W215mUF40ASbFs2bK4++674z/+4z+Ev8BHkoTv/zY0NFTee++9q00LACC3OAEMAPAhNDQ0ZDZv3jy/Q4cOI7O5TgEwwK6xYsWKePTRR2P+fDejArm7L9uyZYs/5AAAcpAAGADgQ1q3bl3WB8AdO3aMNm3axObNmw0M4GNYtWpVjB8/PubOnRuZTEZDgI+lbdu20aFDh0Tsb00LACD3CIABAD6kefPmzTvooIOyvs4DDzwwXnrpJQMD+AjWrVsX48ePj9mzZwt+gV2yH0uCuXPnzjMtAIDcIwAGAPiQ/vznP88/77zzsr7OAw44QAAM8CFVVFTEuHHjBL/ALt+PJcHDDz/sBDAAQA4SAAMAfEgTJ06srK2tXdGqVat9srnOgw8+2LAAPkBVVVVMnDgxnn/++WhqatIQYJdKwq0xNTU1yydNmlRlWgAAuUcADADwEWzYsOHvvXr1yuoAuG3bttG1a9dYu3atgQG8y+bNm+Pxxx+PF154IRobGzUE2OW6desWbdu2TcS+1rQAAHKTABgA4CNYuHDha7169Toj2+scMGCAABjgHbZs2RJTpkyJ5557LrZv364hwG6TlO//Lly48O+mBQCQmwTAAAAfwcSJE/9+wgknZH2dBx54YEyfPt3AgGavpqYmpkyZEs8880zU19drCLDbDRgwIBF1jh8//u+mBQCQmwTAAAAfwb333rv6Bz/4wfqioqLO2VznAQccEHl5eZFOpw0NaJZqa2tj8uTJ8eyzz0ZdXZ2GAHtEXl5e9O/fP+vrrK+vX3ffffeVmxgAQG4SAAMAfESVlZVzu3btmtXHgFu1ahX77LNPLFu2zMCAZqWuri6efvrpmDZtWmzbtk1DgD1qn332iVatWmV9nZs2bZpjWgAAuUsADADwES1dunR2tgfAERGDBg0SAAPNRkNDQ0ybNi2eeuqpqK6u1hBgr+2/kuCtt976m2kBAOQuATAAwEc0ffr0v48cOTLr6xw4cGBMmDDBwICc1tDQEM8991w8+eSTUVlZqSHAXt9/JcG0adP+bloAALlLAAwA8BH9x3/8x9JbbrmlOj8/v3U219mrV68oKyuLLVu2GBqQc9LpdMyaNSsmTZoUmzZt0hBgrysrK4tevXplfZ2NjY1b7rnnnmUmBgCQuwTAAAAfUW1tbXrDhg1/7dKly3HZXGcqlYqBAwfGrFmzDA3IGW8Hv5MnT46NGzdqCJA1Bg4cGKlUKuvr3Lhx4yu1tbVpEwMAyF0CYACAj+Gtt956JdsD4IgQAAM5I51Ox8svvxxTpkyJ8vJyDQGyct+VBIsWLXrFtAAAcpsAGADgYxg/fvwrRxxxRNbXedBBB0VBQUE0NjYaGpBImUwmZs+eHRMnTow1a9ZoCJCVCgoK4qCDDkpErY888ogAGAAgx+VpAQDAR/fjH/94ZX19/fpsr7OoqCj69etnYEAivfrqq3HHHXfEz3/+c+EvkNX69esXRUVFWV9nXV1d+b333rvaxAAAcpsTwAAAH9OGDRte6dGjx6ezvc5BgwbFggULDAxIjCVLlsSECRNi/vz5mgEkwuDBgxNR5/r1653+BQBoBgTAAAAf07x5815OQgA8bNiwePjhhyOTyRgakNXefPPNmDBhQixevFgzgMRIpVIxdOjQRNQ6d+7cl0wMACD3CYABAD6m++677+XRo0dnIiKVzXW2bds2evfuHcuWLTM0ICstW7YsHnvsMSd+gUTq06dPtG3bNgmlpu+9996/mhgAQO4TAAMAfEwTJ06s3Lp165LS0tK+2V7rkCFDBMBA1lmxYkU8+uijgl8g0YYMGZKIOqurqxc+/fTTm00MACD3CYABAD6B8vLyl/fff/+sD4AHDx4c48aNMzAgK6xcuTImTJgQc+fOdT09kHhJ+f7vmjVrfP8XAKCZEAADAHwCM2fOfG7//ff/fLbX2a1bt+jWrVuUl5cbGrDXrFu3LsaPHx+zZ88W/AI5oWfPntGlS5dE1DpjxoznTAwAoHkQAAMAfAK33Xbba5dcckl1fn5+62yvdciQIQJgYK9Yv359PPbYY4JfIOck5frnxsbGzbfddts8EwMAaB4EwAAAn0BlZWXThg0b/tqlS5fjsr3WQw89NCZNmmRowJ78MzKeeOKJeP7556OpqUlDgJxz6KGHJqLOioqKV6qrq9MmBgDQPAiAAQA+oXnz5s1MQgDcu3dv10ADe0RVVVVMnDgxXnjhhWhsbNQQICd17949evbsmZT9quufAQCakTwtAAD4ZP77v/97VkQk4kTFpz71KQMDdpstW7bEQw89FLfffns899xzwl8gpw0fPjwRdWYymfTdd9/9gokBADQfTgADAHxCkyZNqtqyZcuCsrKyg7K91uHDh8fjjz9uaMAuVVNTE1OmTIlnnnkm6uvrNQTIealUKg477LBE1Lply5bXp0+fvsXUAACaDwEwAMAusHz58lkDBw7M+gC4S5cu0atXr1i5cqWhAZ9YbW1tTJ48OZ599tmoq6vTEKDZ6N27d3Ts2DEx+1QTAwBoXgTAAAC7wLPPPvvCwIEDr0hCrcOGDRMAA59IXV1dPP300zFt2rTYtm2bhgDNzrBhwxJT61/+8pcXTQwAoHnxDWAAgF3g1ltvnV9fX782CbUefvjhkUqlDA34yBoaGmLq1Klx6623xuOPPy78BZqlJF3/XFdXt/rWW29dYGoAAM2LE8AAALtAQ0NDZs2aNc/16dPns9lea7t27aJPnz6xZMkSgwM+7J9xMW3atHjqqaeiurpaQ4Bmbb/99ou2bdsmotbVq1fPNDEAgOZHAAwAsIs8++yz05IQAEdEHHHEEQJg4AOl0+mYNWtWTJo0KTZt2qQhABFx5JFHJqbW6dOnTzMxAIDmxxXQAAC7yC233PJaQ0NDZRJqHT58eLRo0cLQgJ1Kp9Px3HPPxW233Rb333+/8Bdgh6KiovjUpz6ViFobGho23HLLLXNNDQCg+XECGABgF6murk6Xl5c/t88++5yR7bW2bNkyDj300Hj55ZcNDvindDodL7/8ckyZMiXKy8s1BOBdhgwZEkVFRYmodc2aNc/V1tamTQ0AoPkRAAMA7EIvvvjiM0kIgCMiRo4cKQAGIiIik8nE7NmzY+LEibFmzRoNAXif/VNSzJo161kTAwBongTAAAC70O233/7KOeecszU/P78022sdMGBAtG/f3tWu0My9+uqrMWnSpFi1apVmALyPjh07xgEHHJCIWhsbG6u/8Y1v/NXUAACaJwEwAMAutHLlyob169fP6tat2+hsrzWVSsXhhx8ekyZNMjhohubMmROTJ0+OJUuWaAbAh3D44YdHKpVKRK3r16+fVVFR0WhqAADNU54WAADsWq+++mpirts77LDDDAyamTfffDP+/d//PX7yk58IfwE+pFQqFSNGjEhMva+88sozpgYA0Hw5AQwAsIvddNNNz5166qnV+fn5rbO91m7dukX//v1j4cKFBgc5btmyZfHYY4/F/PnzNQPgIzrggAOic+fOiai1sbFxy4033jjL1AAAmi8BMADALrZy5cqG8vLyGT179vx0Euo9+uijBcCQw5YvXx7jxo0T/AJ8wv1SUpSXlz9TXl7eYGoAAM2XABgAYDeYMWPGUxdccEEiAuAhQ4ZE69ato7q62uAgh6xcuTImTJgQc+fOjUwmoyEAH1ObNm3i0EMPTUy9zz777FOmBgDQvPkGMADAbvDVr371lYaGhk1JqLWgoCCOOOIIQ4McsW7duvj5z38ed955Z8yZM0f4C/AJjRw5MvLz8xNRa0NDw8abbrrpVVMDAGjenAAGANgNKisrm1atWjW9T58+5ySh3qOPPjqefPJJQREk2Pr16+Oxxx6L2bNn+3cZYBdJpVIxatSoxNS7cuXKadXV1WmTAwBo3pwABgDYTaZNm5aY6/c6duwYAwYMMDRIoA0bNsSvf/3r+Nd//dd49dVXhb8Au9CAAQOiY8eOian36aefftLUAAAQAAMA7CZf+9rX5tTX11ckpd6jjjrK0CBBqqqq4v77749vf/vb8eKLL0ZTU5OmAOxiRx55ZGJqra+vX/eNb3zjdVMDAMAV0AAAu0ltbW16xYoVT++///6fT0K9hx56aLRt2zaqqqoMD7LYli1bYsqUKfHcc8/F9u3bNQRgN2nbtm0MGTIkMfUuX778qdraWtc/AwDgBDAAwO70xz/+cUJSas3Pz4/jjjvO0CBL1dTUxKOPPhq33XZb/OUvfxH+Auxmxx57bOTn5yel3Myvf/3rCaYGAECEABgAYLe66667llZXV89PSr1HH310tGjRwuAgi7wd/H7jG9+IqVOnRn19vaYA7GYtWrSIo48+OjH1btmy5Y177rlnhckBABDhCmgAgN3u9ddfn3T44YcPSEKtxcXFcdhhh8XMmTMNDvayurq6ePrpp2PatGmxbds2DQHYgw477LAoKSlJTL3z5s17wtQAAHibE8AAALvZ9773vanpdLohKfWecMIJkUqlDA72koaGhpg6dWrceuut8fjjjwt/AfawVCoVJ5xwQmLqTafT27/73e8+ZXIAALzNCWAAgN1s+vTpWyoqKmZ26dIlER/Y7d69e/Tv3z/efPNNw4M9qKGhIaZNmxZPPfVUVFdXawjAXnLAAQdE9+7dE1NvRUXFczNmzPAXBwAA/+QEMADAHjBr1qxEXcuXpFMvkHTpdDqee+65uP322+PRRx8V/gLsZccff3yi6p0xY8YkUwMA4J2cAAYA2AO++tWvvnT66adXFRYWtk1CvQMHDoyOHTvGhg0bDA92k3Q6HbNmzYrJkyfHxo0bNQQgC3Ts2DEGDhyYmHobGhoqb7755pdMDgCAd3ICGABgDygvL29YsWLF1MRsEvPy4sQTTzQ42A3S6XS8+OKL8Z3vfCfuv/9+4S9AFjnppJMiLy85r8tWrFgxpaKiotHkAAB4JwEwAMAe8qtf/erRiMgkpd6jjjoqysrKDA52kUwmE6+++mp873vfi1//+texdu1aTQHIImVlZXHUUUcl6q+W//7v//6zyQEA8G4CYACAPeQ///M/l1dWVv4tKfUWFhbGMcccY3CwC7wd/P785z+PNWvWaAhAFjruuOOioCA5X0urqqqa/dOf/nS1yQEA8G4CYACAPeill14al6R6jzvuuCgqKjI4+JjmzJkTd911V/z85z+P1au9owfIVkVFRYn7xbcXXnhhnMkBALAzBVoAALDnjB079pkFCxZUFhYWtktCvSUlJXHEEUfE9OnTDQ8+gjfffDPGjx8fb731lmYAJMCRRx4ZJSUliam3oaFh0zXXXPOsyQEAsDMCYACAPai8vLxh6dKlE/v3739xUmo+8cQT49lnn410Om2A8AEWLVoUjz32WCxevFgzABIiLy8vTjzxxETVvGTJkifKy8sbTA8AgJ3ucbUAAGDP+u1vfzsxIjJJqbdjx44xdOhQg4P3sXz58rj77rvjRz/6kfAXIGGGDRsWHTp0SFLJmd/85jePmxwAAO9FAAwAsIf953/+5/JNmza9kqSaTz/99EilUoYH77Jy5cr4yU9+Et///vdj/vz5GgKQMHl5eXHGGWckquZNmza9fM8996wwPQAA3osroAEA9oKXXnpp/KmnnnpYUurt2rVrDBkyJGbPnm14EBHr1q2L8ePHx+zZsyOTyWgIQEINHTo0OnfunKiaX3jhhQkmBwDA+xEAAwDsBZdffvkzS5YsWVdUVNQlKTWfccYZ8be//U3YRbO2fv36eOyxxwS/ADkglUrF6aefnqia6+rq1lx22WXTTQ8AgPcjAAYA2AsqKyub5s+f/8ihhx56dVJq7tatm1PANFsbNmyIxx9/PF555ZVoamrSEIAc8KlPfSq6du2aqJrfeOONcdXV1WnTAwDg/fgGMADAXvL1r399XDqdrktSzb4FTHNTVVUV999/f3z729+OF198UfgLkCNSqVR8+tOfTlTN6XS69pvf/OZjpgcAwAdxAhgAYC+ZMWNG9Zo1a/7Ss2fPxLx97N69ewwcODDmzJljgOS0LVu2xIQJE+KFF16IxsZGDQHIMYceemh069YtUTWvXr36qRkzZlSbHgAAH8QJYACAvejXv/71HyMiUR8SPeuss5wCJmdt27YtHn300bjtttviueeeE/4C5KC8vLwYM2ZM0srO/OpXv/qT6QEA8KH2vFoAALD3fP/733+rqqoqUR/V7dGjR3zqU58yPHJKfX19TJ06Nb71rW/F1KlTo76+XlMActSIESOiS5cuiap506ZNf73rrruWmh4AAB+GABgAYC975plnHkpazWeccUbk5dlKkjvmzZsXjz76aGzdulUzAHJYQUFBnH766Ymre9q0aQ+aHgAAH5a3dgAAe9nYsWNn1tfXr01SzZ07d47DDjvM8ACARBk5cmR06NAhUTXX1dWtHjt27POmBwDAhyUABgDYyyorK5tee+21Pyat7jPPPDMKCgoMEABIhBYtWiTy9O/s2bP/UF1dnTZBAAA+LAEwAEAWuOqqqyY0NjZWJanm9u3bx9FHH214AEAiHHfccdGmTZtE1dzQ0LDxiiuumGh6AAB8FAJgAIAssGDBgrqFCxc+lrS6R48eHYWFhQYIAGS1li1bxsknn5y4uhcuXDhu6dKl200QAICPQgAMAJAlvv71r/8pnU7XJqnmtm3bximnnGJ4AEBWO+2006K0tDRRNTc1NdV+7Wtfe8j0AAD4qATAAABZ4umnn968fPnyxF3xN3r06GjXrp0BAgBZqUOHDnH88ccnru5ly5ZNmD59+hYTBADgoxIAAwBkkbvvvvtPmUymKUk1FxYWxumnn254AEBWOvPMMxP3yYpMJtN41113/dH0AAD4OATAAABZ5Be/+MWatWvXTkta3UcccUT06tXLAAGArNK7d+847LDDEld3eXn5X+6///51JggAwMchAAYAyDIPP/zwn5JWcyqVijPPPNPwAICsMmbMmEilUomr+8EHH/yT6QEA8HEJgAEAsszXv/71NzZs2DAraXUPHDgwDj74YAMEALLCoEGDYsCAAYmru6KiYuatt966wAQBAPi4BMAAAFlo3Lhxv01i3WPGjIm8PFtMAGDvysvLizFjxiSy9j//+c+/NUEAAD7RflgLAACyz/XXXz+nqqrqr0mru1evXnHUUUcZIACwVx1zzDHRvXv3xNW9adOmV2666aa5JggAwCchAAYAyFJ/+tOf7k1i3WPGjInS0lIDBAD2ijZt2sRZZ52VyNofeOCBe00QAIBPSgAMAJClbrrpprlJPAVcXFwcZ555pgECAHvFWWedFS1btkxc3Zs2bXrl5ptvnmeCAAB8UgJgAIAsNm7cuF8lse5Ro0ZF7969DRAA2KP69OkTI0eOTGTtjz322K9MEACAXUEADACQxcaOHTu7qqrqb0mrO5VKxfnnnx+pVMoQAYA9tv/4/Oc/n8j9R2Vl5d+uueaav5kiAAC7ggAYACDLTZ069bdJrLtv374xZMgQAwQA9ojDDjsssTeQTJ48+TcmCADAriIABgDIcpdeeumLVVVVryax9s9//vNRXFxsiADAblVaWhrnn39+Imuvqqr66+WXX/6SKQIAsKsIgAEAEuChhx76WRLrLisri9NPP90AAYDd6qyzzoqSkpIklp753e9+91MTBABgVxIAAwAkwA033DB3w4YNs5JY+3HHHRd9+vQxRABgt+jbt28cddRRiay9oqJi1te//vU3TBEAgF1JAAwAkBA///nPfxoR6aTVnUql4vOf/3zk5dl6AgC7Vn5+flx00UWRSqWSWH76F7/4xX+bIgAAu5q3cAAACXHHHXe8tW7duulJrL13795xzDHHGCIAsEudcMIJ0b1790TWXl5e/pc77rjjLVMEAGBXEwADACTI3XfffW8mk2lKYu1nnXVWtG3b1hABgF2iQ4cOcfrppyey9kwm03T33Xf/3BQBANgdBMAAAAlyzz33rCgvL386ibW3bNkyzj33XEMEAHaJc889N1q0aJHI2tesWTP1xz/+8UpTBABgdxAAAwAkzA9/+MOfZzKZhiTWPnz48Bg0aJAhAgCfyKGHHhpDhw5NZO3pdLrhBz/4wS9MEQCA3UUADACQMPfee+/qRYsWPZDU+i+++OIoKSkxSADgY2ndunVcfPHFia1/4cKFf7jvvvvKTRIAgN1FAAwAkECXXXbZrxsaGjYlsfaysjJXQQMAH9u5554bpaWliay9oaFh4+WXX/47UwQAYHcSAAMAJNDs2bNrXn311V8ntf4jjjgiDj74YIMEAD6SwYMHx+GHH57Y+l955ZX7Zs+eXWOSAADsTgJgAICEOueccx6tqalZmtT6L7roomjZsqVBAgAfSsuWLeNzn/tcYuuvqalZMmbMmMdMEgCA3U0ADACQUJWVlU3Tpk37RVLrb9++fZx++ukGCQB8KGeccUa0b98+sfU/+eST91ZXV6dNEgCA3U0ADACQYOedd960qqqqV5Ja/wknnOAqaADgAx188MFx/PHHJ7b+TZs2vXzBBRc8a5IAAOwJAmAAgIT74x//eG9EZJJYeyqVigsuuMBV0ADAe2rZsmVccMEFkUqlkrqEzP333/8zkwQAYE8RAAMAJNzNN988b9WqVU8ktf6OHTsm+nt+AMDudcEFF0THjh0TW/+KFSse//rXv/6GSQIAsKcIgAEAcsCNN974k6ampq1JrX/kyJExdOhQgwQA/pdPfepTMWLEiMTW39TUVH3zzTf/t0kCALAnCYABAHLAxIkTK//+97//KslruPDCC6OsrMwwAYCIiGjTpk18/vOfT/QaZs+efd/EiRMrTRMAgD1JAAwAkCPOPvvsh2pqapYntf7S0tK46KKLDBIAiFQqFV/84hejtLQ0sWuoqal566yzznrYNAEA2NMEwAAAOaKioqJx0qRJP07yGgYPHhwjR440TABo5o444og46KCDEr2GJ5544qeVlZVNpgkAwJ4mAAYAyCGXXHLJzIqKihlJXsMFF1wQ3bp1M0wAaKZ69uyZ+KufKyoqZnzhC1+YZZoAAOwNAmAAgBzzb//2b/ek0+ntSa2/RYsWceWVV0ZhYaFhAkAzU1hYGF/60pcSvQ9Ip9Pb/+3f/u0e0wQAYG8RAAMA5Jh777139aJFix5M8hq6d+8eZ555pmECQDNzxhlnRPfu3RO9hsWLFz947733rjZNAAD2FgEwAEAO+uxnP/vL2traRL94PPHEE2Pw4MGGCQDNxKBBg+Kkk05K9Bpqa2tXn3vuub80TQAA9iYBMABADlq8eHH9uHHj/j3Ja0ilUnHJJZdE27ZtDRQAclybNm3ikksuiVQqleh1jBs37t8XL15cb6IAAOxNAmAAgBx1+eWXv1RRUTEjyWsoLS2NL3zhC4l/GQwAvLe3f+mrdevWiV5HRUXFM5dffvlLJgoAwN4mAAYAyGE33HDDXU1NTVuTvIaDDjrI94ABIId95jOfiUMOOSTRa2hqaqq+4YYbfmiaAABkAwEwAEAOGzdu3MbZs2cn/jt0p5xyiu8BA0AOOuSQQ+LTn/504tfx17/+9efjxo3baKIAAGQDATAAQI77zGc+81B1dfXCJK8hlUrFF7/4xejQoYOBAkCO6NixY3zpS19K/KceNm/ePO+00057xEQBAMgWAmAAgBxXXV2dfuCBB34UEekkr6O4uDguvfTSyMuzhQWApMvPz4/LLrssiouLk76U9P333/+ftbW1aVMFACBbeHsGANAMXH/99XMWLVr0YNLXsf/++8e5555roACQcOedd1707ds38etYuHDhH7/61a++bqIAAGQTATAAQDNxySWX/Lyurq486es4/vjjfQ8YABJs2LBhccwxxyR+HXV1dWsuvPDC+0wUAIBsIwAGAGgmXnvttdoHHnjguxGRSfI6UqlUfOlLX4oePXoYKgAkTO/evePSSy9N/Hd/IyLzwAMPfO/111+vNVUAALKNABgAoBm5+uqr/7Z06dJHk76OoqKiGDt2bJSWlhoqACRE69at46qrrorCwsLEr2X58uXjrr766r+ZKgAA2UgADADQzJx33nn/r66ubnXS19GhQ4e4/PLLIy/PlhYAsl1eXl5cfvnl0b59+8Svpb6+ft0ll1zyE1MFACBr999aAADQvLz++uu1Dz744Pcj4VdBR0QMGDAgzjrrLEMFgCw3ZsyYOPDAA3NiLY899tgPXnnllW2mCgBAthIAAwA0Q1/5ylf+umbNmqm5sJaTTz45Dj30UEMFgCw1ZMiQOOmkk3JiLWvXrv3LpZde+oKpAgCQzQTAAADN1GWXXfYf9fX1FUlfRyqViksvvTS6d+9uqACQZXr06BFf/OIXI5VKJX4tDQ0Nm6655pofmioAANlOAAwA0EzNmDGj+oEHHvhO5MBV0C1btozrr78+2rZta7AAkCXatWsX1113XbRs2TIXlpN56KGH/nXSpElVJgsAQLYTAAMANGNf+cpX/rpkyZI/58Ja2rZtG1dffXW0aNHCYAFgL2vRokVcffXVOfPLWUuXLn30iiuueNlkAQBIAgEwAEAzd+655/6ktrZ2eS6spXfv3jlzzSQAJNXbn2fYZ599cmI9tbW1y88555wfmywAAEkhAAYAaOYWLFhQ97Of/ezbmUymMRfWM2zYsDjllFMMFgD2kk9/+tMxdOjQnFhLJpNp/NnPfvbtBQsW1JksAABJIQAGACBuvfXWBfPnz78/V9Zz5plnxuDBgw0WAPaw4cOHx2c+85mcWc/8+fN/d+utty4wWQAAkkQADABARESMGTPmvpqamrdyYS2pVCouu+yy6Nmzp8ECwB7Su3fvuPjii3PmUwxbt25ddPrpp//aZAEASBoBMAAAERGxcuXKhh/+8Ie3pdPpnLjisGXLlvEv//Iv0aVLF8MFgN2sS5cucf3110dRUVFOrKepqanmu9/97jfKy8sbTBcAgKQRAAMA8E933XXX0ueff/6eXFlPaWlpXHvttVFWVma4ALCblJWVxXXXXRclJSU5s6aZM2fe/f/+3/9bZboAACSRABgAgP/l5JNPHldeXv50rqynU6dOMXbs2Jw5kQQA2aSoqCiuueaa6NixY86sqby8/MlTTz11gukCAJBUAmAAAP6PSy655K66urq1ubKefffdN6644orIy7P9BYBdJS8vL6688sro3bt3zqyprq6u/JJLLvmh6QIAkOi9uhYAAPBus2bNqn7ooYfujIh0rqxp4MCBcd555xkuAOwi559/fhxyyCG5tKT0gw8+eOesWbOqTRcAgCTLb3tQ9NzpjndbRG15oQ4BADRTEydOXDNmzJi8Tp06Dc2VNfXp0yfy8/PjzTffNGAA+ATOOuusOOmkk3JqTa+//vp9Z5555kTTBQAgCYq7N0Ze6c5/5gQwAADv6dRTT/31li1bXs+lNZ122mlx9NFHGy4AfEzHHntsnHrqqTm1pi1btrxx2mmn/cZ0AQDIBQJgAADeU0VFReONN974jcbGxqpcWtcFF1wQRx55pAEDwEd05JFHxuc+97mcWlNjY2PVzTff/I2KiopGEwYAIBcIgAEAeF9//OMf1z/yyCPfiRz6HnAqlYqLLroohgwZYsAA8CENHTo0LrrookilUrm0rPQjjzzynfvvv3+dCQMAkCsEwAAAfKBLL730hQULFvwupzbCeXnxpS99Kfbff38DBoAPcNBBB8WXvvSlyMvLrVdJCxYs+N2ll176ggkDAJBLBMAAAHwoo0eP/mVVVdXcXFpTYWFhfOUrX4kePXoYMAC8h169esUVV1wRBQUFObWuqqqqOaNHj/6lCQMAkGsEwAAAfCgVFRWNV1111S0NDQ0bcmldJSUlcfPNN8c+++xjyADwLr17946bbropiouLc2pdDQ0NG6666qqv++4vAAC5SAAMAMCHNmHChE3333//tzKZTDqX1lVcXBzXXXdddO/e3ZABYIfu3bvHtddeG61atcqpdWUymfT999//rQkTJmwyZQAAcpEAGACAj2Ts2LGz58+f/9tcW1fr1q3juuuuiw4dOhgyAM1ehw4d4rrrrovWrVvn3Nrmz5//m7Fjx842ZQAAcpUAGACAj+y44477xaZNm17MtXW1a9cubrzxxmjXrp0hA9BstW3bNmf/Pty4ceOLxx13nO/+AgCQ0wTAAAB8ZNXV1emLL774W3V1datzbW0dO3aMG2+8Mdq0aWPQADQ7ZWVlceONN0bHjh1zbm21tbWrL7zwwturq6vTJg0AQC7Lb3tQ9NzZD9LbImrLC3UIAICdWrZsWf327dtfOvbYY0/Ny8trkUtrKykpiaFDh8Zrr70WNTU1hg1As9ChQ4f42te+Fp06dcq5tTU1NW39zne+M/bBBx9cb9IAAOSC4u6NkVe6858JgAEA+NhefPHFzYcccsiyAQMGnBgRqZzaRBcXx5AhQ4TAADQLHTt2jJtuuik6dOiQi8tLjx8//ravfvWrc0waAIBc8X4BsCugAQD4RC688MIZb7zxxm9ycW3t27ePm266KSdPQgHA2zp16pTL4W+88cYbv77wwgufM2kAAJoLATAAAJ/YqFGjfrFhw4aZubi2t0Pgzp07GzQAOadz585x0003Rfv27XNyfRs2bJg5atSo+0waAIDmRAAMAMAnVltbm77sssu+V1dXtzoX19euXbu44YYbomPHjoYNQM7o0KFDXH/99dGuXbtc3Z+s/sIXvvDd2tratGkDANCc+AYwAAC7xJIlS+oj4pVRo0admpeX1yLX1ldcXBxDhw6NuXPnxrZt2wwcgETr0qVL3HjjjTl77XNTU1P1nXfeec0f/vCHdaYNAEAuer9vAAuAAQDYZWbNmlXVo0ePuYceeujoVCqVn2vra9WqVYwYMSIWLVoUlZWVBg5AIu23335x0003RVlZWU6uL51ON/z617++4fbbb3/TtAEAyFUCYAAA9phJkyatPeqoozbsu+++R+fi+goLC2P48OGxbNmy2LBhg4EDkCgDBgyIa6+9Nlq1apWza5w2bdq/XXLJJc+ZNgAAuez9AmDfAAYAYJc77bTTHn/rrbcezNX1FRUVxTXXXBNDhgwxbAASY8iQIXHNNddEUVFRzq5xwYIFvzv99NOfMG0AAJozATAAALvFEUcccc+GDRtm5ur6CgoK4sorr4wjjjjCsAFIwt/LceWVV0ZBQUHOrrG8vPypESNG/LdpAwDQ3AmAAQDYLaqrq9MXXXTRd2pra1fk7GY6Ly8uvvjiOPLIIw0cgKw1atSouPjiiyMvL3dfA23dunXxZz/72e83NDRkTBwAgObON4ABANhtli9fvr2mpuaFY4899uT8/PyWubjGVCoVgwYNikwmE4sWLTJ0ALLK6aefHueee26kUqmcXWN9fX3FDTfccM3UqVOrTBwAgObi/b4BLAAGAGC3evnll7cUFBS8cMQRR4zOy8trkYtrTKVSccABB0SnTp1i7ty5kck4fATA3lVYWBhXXHFFHHPMMTm9zsbGxuo777zzKz/72c9WmzoAAM2JABgAgL1qxowZlb169Xp98ODBJ6dSqfxcXWfPnj2jb9++8fe//z0aGxsNHoC9olWrVnH11VfHwIEDc3qd6XS64be//e2Nt9122wJTBwCguREAAwCw1z3xxBPlw4cPX9OvX79jIyJn76Hs2LFjDBw4MObMmRN1dXUGD8Ae1a5du7jxxhujT58+ub7U9JQpU779xS9+8XlTBwCgOXq/ADhPewAA2FPGjBkz9Y033vh1rq+zZ8+eceONN0bHjh0NHYA9pkuXLnHTTTdF9+7dc36tc+fO/eU555zzF1MHAID/SwAMAMAe9alPfernS5cufTjX19mlS5e49dZb48ADDzR0AHa7gQMHxje/+c3o1KlTzq/1rbfeemjEiBG/MnUAANg5ATAAAHvcsccee8/GjRtfyPV1FhcXx7XXXhsjRowwdAB2m8MPPzyuuuqqaNmyZc6vdePGjc8fffTR95g6AAC8NwEwAAB7XEVFReNxxx339crKyr/l+loLCgrisssui/PPPz9SqZThA7DLpFKpOP/88+PSSy+NgoKCnF/vpk2bXj7ssMNuqaysbDJ9AAB4bwJgAAD2isWLF9efddZZN1dXV7/ZHNZ7/PHHx5e//OUoKioyfAA+sRYtWsSXv/zlOP7445vFequrq98cM2bMN8rLyxtMHwAA3l9+24Oi585+kN4WUVteqEMAAOw2a9asaVi1atWs0aNHH1dQUNA619fbrVu3OOCAA2LevHlRX1/vAQDgYykrK4trrrkmDjrooGax3rq6uvKxY8de89RTT202fQAA+Ifi7o2RV7rznwmAAQDYq+bNm1ezevXqZ04++eTjCwoKSnN9ve3atYuRI0fG8uXLY+PGjR4AAD6S/v37x0033RRdu3ZtFuutr69fd9111335T3/6U4XpAwDA/xAAAwCQ1ebMmbMtlUq9fOSRR56Ul5eX83ckt2jRIkaMGBG1tbWxdOlSDwAAH8rxxx8fX/rSl5rN5wQaGxu33HXXXdf99Kc/XWn6AADwvwmAAQDIejNnzqzs2bPn64MHDz4plUrl5/p6U6lUHHLIIdGqVatYsGBBZDIZDwEAO5WXlxef/exn4/TTT49UKtUs1pxOp7f//ve//+o3vvGN1z0BAADwfwmAAQBIhEmTJpXvs88+8wYOHHhCKpUqaA5r3m+//WLAgAExd+5c3wUG4P8oKyuL6667LoYNG9Zs1pxOp7f/8Y9/vOmqq676qycAAAB2TgAMAEBiTJw4cc3BBx+85MADDzwulUrlNYc1t2/fPoYOHRqLFi2KLVu2eAgAiIiIffbZJ66//vro2bNns1lzJpNpnDBhwm1f/OIXn/cEAADAexMAAwCQKI8++ujy/fff/42DDjrohOZwHXRERHFxcRx11FHR2NgYb731locAoJkbPXp0XHHFFVFSUtJs1pxOpxsefvjhr15yySWzPAEAAPD+BMAAACTO+PHjVw0cOHDpAQcccGxzOQmcSqViwIAB0aVLl3jjjTeiqanJgwDQzBQVFcWll14aJ554YrP53m/EP07+Pv7447dffPHFMz0FAADwwQTAAAAk0iOPPLLs0EMPXbb//vs3mxA4IqJHjx4xZMiQePPNN2Pr1q0eBIBmonv37vEv//IvccABBzSrdWcymaYnnnji9s997nPPeAoAAODDEQADAJBYDz/88NJjjjlmY+/evY+KiGZzFKq0tDSGDx8eq1evjvXr13sQAHLcwIED45prrol27do1t6VnZsyY8YOzzjprqqcAAAA+PAEwAACJdv/99795zDHHVO6zzz5HRDMKgVu0aBGHHXZYtGzZMhYuXBjpdNrDAJBjCgoK4pxzzonzzz8/WrRo0dyWn37uuefuOuWUUyZ4EgAA4KMRAAMAkHi///3v5w8bNmxF3759j2lO10GnUqno27dvDB06NBYvXhxbtmzxMADkiJ49e8YNN9wQgwcPblbf+434x7XPU6ZM+fbpp58+2ZMAAAAfnQAYAICc8OCDDy4ZNmzYin79+jWrEDgionXr1nHEEUdEfX19LF261MMAkGCpVCpOOOGEuOKKK6JNmzbNbv07wt9vnXPOOX/xNAAAwMcjAAYAIGc89NBDS4YNG7a8X79+xza3EDg/Pz8OPvjg6NWrV8yfPz8aGho8EAAJU1JSEpdffnmccMIJkZ+f3+zWn8lkGp944olvffazn53maQAAgI9PAAwAQE556KGHlo4cOXJdnz59RqWa252ZEdG1a9cYNmxYLFu2LCorKz0QAAnRt2/fuO6662K//fZrluvPZDLpp59++rvnnHPO054GAAD4ZATAAADknD/96U+LDj300KX7779/s7sOOiKiuLg4jjzyyCgpKYk333wz0um0hwIgSxUUFMRnP/vZuPDCC6OkpKRZ9iCdTjc88sgjt5x//vnTPREAAPDJCYABAMhJDz/88NId3wQelUqlmt09mqlUKvr06RMHH3xwLFy4MLZt2+ahAMgynTt3jrFjx8bQoUOjGV5aERH/CH+feOKJ2y+88MLnPBEAALBrCIABAMhZDz300JIePXq8NmjQoGPz8vJaNMcetG3bNkaNGhVNTU2xZMkSDwVAFkilUjF69Oi48soro0OHDs22D01NTdt++9vf/stll132oqcCAAB2HQEwAAA5bdKkSeXdu3efM3jw4GYbAufn58eAAQOiV69esWDBgti+fbsHA2Avad26dVx66aVx/PHHR35+frPtQ2NjY/WvfvWrf7nuuute81QAAMCuJQAGACDnTZ48eW1jY+OMI4444uiCgoKS5tqHrl27xqhRo2Lbtm2xcuVKDwbAHpRKpWLUqFExduzY6NWrV7PuRX19/fo77rjjK9/61rcWejIAAGDXEwADANAsPP/881UbNmx45rjjjjuqsLCwrLn2obCwMAYNGhT77bdfLF68OGpraz0cALtZ+/bt44orrogTTzwxCgub9/uU2tralTfffPPVP/nJT1Z7MgAAYPcQAAMA0Gz87W9/27p27doZJ5xwwsjCwsK2zbkXnTp1ipEjR0Z1dbXTwAC70ciRI+Pqq6+OHj16NPte1NTULL/hhhuu/e1vf7vOkwEAALuPABgAgGbltdde2zpv3rynTznllKFFRUWdmnMvCgsL49BDD4399tsvFi1a5DQwwC709qnfk08+udmf+o2I2Lx587yLL774unHjxm30dAAAwO71fgFwat9zYsTOftC4LmLjq610DwCAxOrVq1fhs88++69du3Y9QTciGhoaYurUqTF58uRobGzUEICPqaCgIE499dQYPXq04HeH8vLyp4499tjvrly5skE3AABg9+swrDYKuuz8ZwJgAAByWuvWrfNeeumlm/fdd9+zdeMfVq9eHffff38sWbJEMwA+ov322y8uuugi1z2/w8KFC38/fPjwnzY0NGR0AwAA9gwBMAAAzd7zzz9/8aGHHnp1RKR0IyKTycTMmTPjz3/+c9TV1WkIwAcoKSmJ8847L0aMGBGplL9Kdki//PLL9xx77LEPagUAAOxZ7xcA+wYwAADNwn333Tfn+OOP39yrV6/DQwgcqVQqevfuHcOHD49169ZFRUWFhwTgPRxyyCExduzY6N+/v/B3h0wm0/jMM8/828knnzxONwAAYM97v28AC4ABAGg2fve7370xePDgJf369Ts6lUrl60hEcXFxjBgxInr06BFLly6N2tpaTQHYoUOHDvGFL3whzjzzzCguLtaQHZqammoeeOCBWz73uc9N1w0AANg7BMAAALDDww8/vKygoOC54cOHH1FQUFCqI//QrVu3OO6446K0tDQWL14cTU1NmgI0Wy1btoxzzjknLr300ujevbuGvENtbe2K22677arbbrvtDd0AAIC9RwAMAADv8Oyzz25avHjx0yeddNKQoqKiTjryD3l5edGnT58YOXJkbN26NVatWqUpQLNz+OGHx1e+8pUYMGBA5OXlacg7VFVV/e3CCy+8/oEHHvDdAAAA2MsEwAAA8C7z58+vefbZZ58+44wz+hcXF/fSkf/RsmXLGDJkSOyzzz6xdOnSqKmp0RQg53Xs2DG++MUvximnnBItW7bUkHdZt27dMyeffPI3Xn755W26AQAAe9/7BcCpfc+JETv7QeO6iI2vttI9AAByWmFhYer555//0sEHH3y5bvxfTU1N8fzzz8f48eOjurpaQ4Cc07p16zjzzDPjyCOPdOJ35zJ///vff3rMMcfc39DQkNEOAADIDh2G1UZBl53/TAAMAAARMWnSpM8cc8wxt6RSKdfg7ERNTU1MmTIlpk2bFg0NDRoCJF5hYWGccsopcdJJJ0VRUZGG7EQ6na6fOnXqd88555y/6AYAAGSX9wuAXQENAAAR8Yc//GHhfvvt98aAAQOOysvLkwS8S2FhYQwYMCCGDh0amzZtinXr1mkKkFiDBw+Oq666KoYOHRoFBQUashONjY1Vv//972/5whe+MEs3AAAg+/gGMAAAfAgTJkxYXV1dPf3II4/8VGFhYTsd+b9KS0vjsMMOi/79+8eaNWti8+bNmgIkRu/evePyyy+PU045JUpLSzXkPWzdunXxLbfccs33vve9hboBAADZyTeAAQDgI+jTp0+LJ5988us9evQ4TTfe3/z58+ORRx6JlStXagaQtXr16hXnnHNODBgwQDM+wKpVq5444YQTfrBy5Ur3/QMAQBbzDWAAAPgYnnnmmfOHDx9+fSqVytON95bJZGL27Nkxbty4qKio0BAga3Tu3DnOOuusGDp0aKRSKQ15/z/Lm2bNmvXDk08++THdAACA7OcbwAAA8DH85je/eX3//fd//cADDzzSd4HfWyqViu7du8cxxxwT7dq1i2XLlkV9fb3GAHtN27Zt49xzz42LL744evToIfz9AI2NjdUPPvjgLZ/97Gf/ohsAAJAMvgEMAAAf0/jx41dFxPOHHXbYiMLCwjIdeW95eXnRu3fvOOqoo6KgoCBWrlwZjY2NGgPsMcXFxXHKKafEl770pejbt2/k5bnA4YPU1tau+MEPfnD9LbfcMk83AAAgQf/94xvAAADwyQwePLjVo48++s1u3bqdpBsfTn19fTzzzDMxderU2LZtm4YAu01ZWVmceuqpceSRR0ZRkQsbPqyVK1c+/ulPf/pHixcvdm0DAAAkjG8AAwDALvLkk0+edeSRR96USqVcl/MhCYKB3eXtE7/HHnus4PcjyGQyDbNmzfoP3/sFAIDk8g1gAADYRX7/+98v6NGjx2uHHHLIyPz8fL8x+SEUFBREv3794qijjoq8vLxYtWqVq6GBT6Rly5ZxwgknxBVXXBEHHXRQFBQUaMqH1NDQsOG3v/3t1z7/+c8/oxsAAJBcroAGAIBd7Lzzzut4991339m2bdvBuvHR1NTUxLPPPhvTpk2LLVu2aAjwoZWVlcXxxx8fxxxzTBQXF2vIR1RVVfW3a6+99vZHHnlkg24AAECyuQIaAAB2g06dOhVMmzZtbN++fT8XESkd+WgaGhri+eefjyeffDI2bJBFAO/7522cdNJJccQRR0RhodvKPobMokWL/nTsscf+pLKyskk7AAAg+QTAAACwG/3hD38Ydfrpp99WUFDQRjc+unQ6Ha+++mpMnTo1Vq5cqSHAP/Xq1StOOeWUGDp0aOTl5WnIx9DY2Fg1YcKEOy666KKZugEAALlDAAwAALvZaaed1vbee+/9docOHUbqxse3fPnymDZtWrz88suRTqc1BJqhvLy8OOyww+L444+P3r17a8gnsHHjxue//OUvf3fSpElVugEAALlFAAwAAHtAYWFh6qmnnjpv+PDh16RSKXeUfgIbNmyIGTNmxHPPPRc1NTUaAs1AcXFxjBo1Ko4++ujo2LGjhnwCmUym4ZVXXvl/J5100kMNDQ0ZHQEAgNzzfgFwftuDoufOfpDeFlFb7p0VAAB8WOl0On7zm9+8Xlpa+uLgwYM/VVhYWKYrH09xcXEMGDAgjj322GjTpk2sXbs2amtrNQZyUIcOHeKMM86ISy+9NAYOHBjFxcWa8gnU1tau+slPfnLjxRdf/IybFAAAIHcVd2+MvNKd/8wJYAAA2A1OPPHENvfdd9+tnTp1Olo3PrnGxsb429/+Fs8++2wsWrRIQyAH9OvXL44++ugYNmxYFBQUaMguUFFR8cwXv/jFf5s+ffoW3QAAgNzmCmgAANhLHn744RNGjx799YKCgta6sWusX78+Zs6cGc8//3xUV1drCCRIaWlpHHnkkXHUUUdF586dNWQXaWxs3DJ16tS7PvvZz/5FNwAAoHkQAAMAwF50ySWXdP3+97//rXbt2g3VjV2nsbExXnvttXjuuedi/vz5GgJZbMCAATFq1KgYPHiw0767WFVV1atf//rXv/e73/1urW4AAEDzIQAGAIC9rF27dvlTp0699OCDD740lUrl68iutXz58nj++efj5ZdfjpqaGg2BLFBSUhLDhw+PI444Inr37q0hu1gmk2mcN2/efSeeeOJvq6urfewXAACaGQEwAABkia9//ev73Xjjjf9aWlraXzd2vXQ6HW+++WY899xz8dprr0VjY6OmwB5UUFAQgwcPjlGjRsUBBxwQeXl5mrIbVFdXL/zP//zPf/3BD36wRDcAAKB5EgADAEAWOfjgg1v9+c9/vrZ3795jIiKlI7tHZWVlvPjii/HCCy/EunXrNAR2o65du8bIkSPj8MMPj7Zt22rI7pNZunTpn88888z/t3jx4nrtAACA5ksADAAAWejuu+8eePHFF9/WqlUrd6PuZuXl5fHqq6/GSy+9FOvXr9cQ2AU6d+4cI0aMiGHDhkW3bt00ZDerqalZ9tvf/vbOm266aa5uAAAAAmAAAMhS/fr1K3r44Ycv79+//4WpVMpdqXvA8uXL46WXXoqXX345qqurNQQ+grKyshg+fHiMGDHCd333kEwmk164cOEfzj777F8sXbp0u44AAAARAmAAAMh6P/3pT4d97nOf+2bLli176Mae0dDQEHPnzo2//vWvMXfu3Ni+Xa4CO9OyZcsYNGhQDBs2LA455JAoKCjQlD2ktrZ21R//+Mc7rr322r/rBgAA8E4CYAAASIA+ffq0ePTRR69wGnjPS6fTsXTp0nj11VedDIaIaNu2bQwbNiyGDRsWffr0ibw8fyTtSZlMpuG11177+ZlnnvmnioqKRh0BAADeTQAMAAAJ8uMf//jQCy644JutWrXaRzf2vLdPBs+ePTvmzp0bdXV1mkKzUFZWFoMHD45hw4ZF//79Iz8/X1P2gpqammX333//nTfccINv/QIAAO9JAAwAAAnTrl27/HHjxp37qU996qq8vDwb870kk8nEihUrYu7cuTFnzpxYsWJFZDIZjSEnpFKp6Nu3bwwbNiwGDRoUHTt21JS9qKmpqfbVV1/92ZgxY/5cWVnZpCMAAMD7EQADAEBCffnLX+5x++23f7V9+/aH68bet2XLlnjjjTdizpw5MW/evKivr9cUEqVly5Zx8MEHx6BBg+KQQw6J0tJSTckCGzdufPG73/3uv//iF79YoxsAAMCHIQAGAIAEKywsTE2cOPGMkSNHXlNQUNBaR7JDXV1dvPnmm/HGG2/EG2+8EevXr9cUslKXLl3ioIMOioMOOigOOOCAKCoq0pQs0djYuGXmzJk/PvPMMyc2NDS4XgAAAPjQBMAAAJADjjzyyNY/+9nPrujbt++5EZGnI9mluro6Fi5cGPPnz4958+ZFZWWlprBXtGvXLg455JAYMGBA9O/fP1q39nsjWSj91ltv/fmqq676xaxZs6q1AwAA+KgEwAAAkEN++ctfjhgzZsyNrVq16q0b2SmdTsfKlStj0aJFsXDhwli8eHFs27ZNY9gtSkpKol+/ftG/f//Yf//9o1evXpGX53dEslVNTc3yRx999EdXXnnlK7oBAAB8XAJgAADIMd26dSt8+OGHPzd48ODL8vPzbdyzXCaTiTVr1sTChQtj0aJFsWjRotiyZYvG8LGUlZVF//79/xn6du/ePVKplMZkuaampprXXnvtV2PGjHmgoqKiUUcAAIBPQgAMAAA56rjjjiv7r//6r8tdC508mzdvjuXLl8eKFSti+fLlsXjx4qipqdEY/pfi4uLo169f9O7dO/bZZ5/Yd999o6ysTGMSJJPJpJcsWfLn66677pfTp0/3mx8AAMAuIQAGAIAc99Of/nTIueeee3NpaWlf3UimxsbGWLlyZSxdujSWLVsWy5cvj3Xr1kUmk9GcZiKVSkWXLl1in332iT59+kSfPn2iV69eUVBQoDkJtXXr1sUPPvjgj6699tq/6wYAALArCYABAKAZaNeuXf64cePOGTp06BUFBQWtdST56uvrY+XKlf88KbxixYpYu3ZtpNNpzUm4vLy86Nq1a+yzzz7//KdXr17RsmVLzckBjY2NW/7617/+4pxzznm0srKySUcAAIBdTQAMAADNyIknntjmnnvuuXzfffcdk0qlHB3MMdu3b481a9bEmjVrYu3atbF27dooLy+PDRs2CIazUF5eXnTs2DG6desWXbt2jW7dukW3bt2iR48eUVhYqEE5JpPJNC5ZsuRR1z0DAAC7mwAYAACaoa9+9av7Xnfdddd16NDhCN3IfY2Njf8MhNetWxfr1q2LioqKWLduXWzbtk2DdrPS0tLo3LnzP//p0qVLdO3aNbp27eoK52Ziw4YNM//rv/7rxz/60Y+W6wYAALC7CYABAKAZ++UvfznirLPOuq64uNj3gZupmpqaWL9+/T//qaioiMrKyqisrIxNmzZFY2OjJn2AgoKCaN++fbRr1y7at28fHTt2jC5dukSnTp2ic+fOUVxcrEnN1NatW98aP378PVdcccXLugEAAOwpAmAAAGjm2rVrl//ggw+eOWLEiCsLCwvb6gjvtHnz5n+GwZs2bYrKysqorq6OLVu2xJYtW6K6ujqqq6sjk8nk3NpTqVS0bt06WrduHWVlZdGmTZsoLS39X2Fvu3btok2bNh4U/peGhobKl1566efnnHPO+OrqavevAwAAe5QAGAAAiIiIoUOHFt97770XHHjggRfk5+c7ssiHlk6n/xkEV1dXR01Nzfv+k8lkora2NtLpdNTX10dTU1PU1dXt0u8U5+XlRcuWLSM/Pz+KiooiLy8vWrVqFalUKoqLi3f6T0lJSbRq1eqfgW9paWnk5eUZMB9aU1NTzYIFC/745S9/+Y+zZ8+u0REAAGBvEAADAAD/y2mnndb2rrvuurRPnz5n5+XlFeoIe9LbgfDbtm/f/r7XUBcUFESLFi3++b/fDnxhT8pkMg1LliwZd8stt/xq0qRJVToCAADsTQJgAABgp0477bS2d95554X777//5wTBAP9XJpNpWLhw4QO33nrrHwS/AABAtni/ADi/7UHRc2c/SG+LqC33/gcAAHLZokWL6u69995X0un0swcddFCnkpKS3roC8A8VFRUz/7//7/+77aKLLpq6aNGiOh0BAACyRXH3xsgr3fnPBMAAAEDMnDmz8u67736qqalpWr9+/Ypbt27dN5VKpXQGaG4ymUx6zZo1U+65555/Peeccx6cOXNmpa4AAADZRgAMAAB8KDNnzqz88Y9//Gw6nZ4uCAaak7eD37vvvvtfzz///McEvwAAQDYTAAMAAB+JIBhoLgS/AABAEgmAAQCAj+XtILisrOyFvn37diwuLu4VEYJgIBdkKioqnrv33nu/PWbMmEcEvwAAQJK8XwCc2vecGLGzHzSui9j4aivdAwAA/unqq6/u8ZWvfOX8Pn36nJWXl9dCR4CkSafT9UuXLh3/X//1Xw/84he/WKMjAABAEnUYVhsFXXb+MwEwAADwkZ1xxhntb7/99rMPPPDA8/Pz81vrCJDtmpqaqhcsWPDgd77znUcmTpzotC8AAJBoAmAAAGC3GD58eMkPf/jDzwwePPjioqKijjoCZJv6+voNr7322u9vvPHGx2fPnl2jIwAAQC4QAAMAALvV0KFDi++5556zDjnkkPOKioq66giwt9XV1a19/fXXH7z++uvHC34BAIBcIwAGAAD2iFatWuXdc889w0455ZTzO3bseJSOAHtYZsOGDbOmTJny4PXXX/9qbW1tWksAAIBcJAAGAAD2uH/913/tf/7555/dq1ev0/Ly8lroCLC7pNPp+pUrV05+4IEHHvnOd76zSEcAAIBcJwAGAAD2mjPOOKP97bfffvYBBxzw2YKCgjY6AuwqjY2NVW+++eafv/e97z06YcKETToCAAA0FwJgAABgrxs+fHjJ97///dGDBg0aU1paur+OAB9XdXX1wtdee+3Rr371q1Nfe+21Wh0BAACaGwEwAACQVb761a/ue8EFF3y6b9++ZxUUFLTWEeCDNDY2bnnrrbfG/+EPf5j4ox/9aLmOAAAAzZkAGAAAyEpDhw4t/sEPfnDy4MGDz27dunV/HQHerbq6+s2XX375weuuu+7ppUuXbtcRAAAAATAAAJDlCgsLU3ffffeQ0aNHn9G1a9fj8vLyinQFmq90Ol1XXl4+bcqUKROuvfbav+sIAADA/yYABgAAEqNPnz4t/v3f/33UyJEjz2rfvv2nIiKlK9AsZDZt2vTXF1544bGvfe1rzzntCwAA8N4EwAAAQCJddNFFXa6++uqTDzzwwLNbtmzZTUcg99TV1a1ZsGDBuJ/+9KdP3n///et0BAAA4IMJgAEAgETr1q1b4d13333k4YcffmqHDh2OyMvLK9QVSK50Ot2wcePGWbNmzZp8/fXXz6qoqGjUFQAAgA9PAAwAAOSMo48+uvWtt956/CGHHHJKu3btBkdEnq5AIqQrKytfmzdv3uQ777xz+owZM6q1BAAA4OMRAAMAADnpuOOOK/vGN75x/CGHHHJa27ZtB4bvBUO2yVRVVc2dN2/epO9///vTpk+fvkVLAAAAPjkBMAAAkPNuu+22vmedddZJffr0Oa5Vq1a9dQT2ntra2uXLly+f/uijjz51xx13vKUjAAAAu5YAGAAAaFa+9KUvdbv44ouP7t+//wlOBsMekamqqpq7cOHCv/z+97+fcd9995VrCQAAwO4jAAYAAJqtSy65pOtll112jDAYdrl0VVXVvIULF/7lV7/61bO/+93v1moJAADAniEABgAAiIirr766x/nnnz9q//33P7JNmzZDUqlUga7Ah5fJZBoqKyv/vnjx4uf+9Kc/zbr33ntX6woAAMCeJwAGAAB4l379+hV97WtfGzRy5MhRPXv2PLaoqKizrsD/VV9fv37VqlXPvPDCC8/9+7//+5zFixfX6woAAMDeJQAGAAB4H61bt8678847Bx599NFHde/efURpaen+4apomq/M1q1bF69Zs+bF5557btY3v/nNOdXV1WltAQAAyB4CYAAAgI9g8ODBrcaOHXvI8OHDD+vevfvw1q1bHxACYXJXprq6+s01a9a88sorr7z8k5/8ZN5rr71Wqy0AAADZSwAMAADwCVx//fX7nHHGGYf169dvePv27Yfm5+e31hWSrLGxsXrjxo2vvvXWWy+PHz/+lR//+McrdQUAACA5BMAAAAC70Je//OUe55xzzvA+ffoM7tix45CioqKuukI2q6+vX7t27doXFy9ePGfixImv3Xvvvat1BQAAILkEwAAAALvRl7/85R6f+cxnBvfr129Qly5dDm/ZsqVAmL2qrq5u7bp16wS+AAAAOUoADAAAsIe0atUq75prrtnn2GOPPXi//fY7uH379oeUlpb2TaVS+brDbpKuqalZtnHjxnlvvfXW3GeffXbef/3Xfy2vra1Naw0AAEBuEgADAADsRQceeGDLq6+++oAhQ4Yc3LNnz4Pbtm17sGuj+biampqqq6qqXi8vL583Z86ceb/85S/nvfjii1t1BgAAoPkQAAMAAGSZoUOHFn/xi1/cf9CgQQf26NHjwHbt2h3YqlWr3qlUKk932CFdU1OzvLKycsHq1asXzJkzZ8Gf//znJTNmzKjWGgAAgOZNAAwAAJAAxx13XNkFF1xw4MEHH3xA165dDywtLd23pKRkn1QqVag7uS2TyTRs27ZtRXV19dJ169YtfOONNxZOmDBh4YQJEzbpDgAAAO8mAAYAAEiw8847r+OJJ57Yp3///vt16dKlT5s2bfZr3bp1v/z8/GLdSZampqaa6urqxZs3b16ybt26pQsXLlzy9NNPL33ooYc26A4AAAAflgAYAAAgx7Rr1y7/kksu6TFkyJCe++67b89OnTr1Kisr61VcXNyzZcuW3VKpVL4u7R2ZTKaprq6uvKamZtWWLVtWVlRUrFy6dOnK2bNnr7r//vvXVFZWNukSAAAAn4QAGAAAoBnp1KlTwec+97luQ4cO7bnPPvv0aNeuXafWrVt3Li4u7tqyZcvORUVFnfLy8lro1MeTTqe319fXr6+rq6uoqalZW11dvb6ysnL9ihUrVr/66qurHnzwwbUVFRWNOgUAAMDuIgAGAADgfznjjDPaH3bYYZ369OnTuUuXLp3Kysral5SUtC0uLu5YVFTUrqioqG2LFi065OfnlzaXnjQ1NW3dvn37xvr6+qr6+vrKmpqaDdu2bavasmXLpnXr1lUsXbp0/Ysvvrh+4sSJlZ4gAAAA9iYBMAAAAB9Lr169CkeNGtXuoIMOatexY8ey9u3bl7Zp06Z1SUlJWXFxcetWrVq1btGiRVlRUVHrwsLC1hGRX1hYWBoR+QUFBSV5eXkFeXl5u/0/LtPpdG06nW5sbGzcFhFNDQ0NW3f83+r6+vrq7du3b6mtra2uqamp3rZtW/XmzZurN23aVL1hw4YtCxYsqJo1a1bl0qVLt5s4AAAASSAABgAAYK/q169fUffu3Vvss88+xSUlJQVv//8LCwtT3bp1+8BTxuXl5VsbGhoyb//vbdu2Na5YsaJmzZo12xcvXlyvwwAAADQn7xcAF2gPAAAAu9vixYvrdwS11boBAAAAu0+eFgAAAAAAAADkBgEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4o0AIAAAAAAACA5GhoLIyCxoaIiEilIpNXGE1v/0wADAAAAAAAAJAghQUN/0x6MxGppvT/5L6ugAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAIb/v5272ZHiusM4/FZ1NUkz9sQwOF4EyZJtpJCwysa5jSy4n1xPEqRIuQFvvfGSgIwBOzGRQAQERnx0d1UW0cgWGvKxsMGvnmfVdc7/1OJsf+oCAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoMY3JP//9K8My551lzpAk293a7QAAAAAAAAD8iIw3r+SL7TpPxuSt4/ibJJuz20QDBgAAAAAAAHhzrJPp6NvHYcyyjLl7dJTPbl/Jp6sPLufSsM+5ec7q5YOrF0OeP/SVaAAAAAAAAIA3weH7u6zfm79dWDIMSw6225w785vsx3XyzasOby5ssz69c4sAAAAAAAAAr9n69C6bC9sT93a7rKdnORin5Otxynzi1JQcfiwCAwAAAAAAALxO69O7HH68TaaT98cp85R8vbp3Nfszv8q0LHn7xMF1sjk/ZzUPmZ/MmWefhAYAAAAAAAD4oayPdjn7223Gn7x6ZrXPnetX8mBKkpv3cufDd/Pufn5FL56SzcVtNheT3dNt8tQlAwAAAAAAAHyv1sm0ySv/9XtsNWZ3I/lHkgzHi7/4XY7WYz5yiwAAAAAAAAA/Ivtcv/3nPEyS1fHa42t5+vNLyX7JoRsCAAAAAAAAePPt1/nbV3/KvePn1Xc371/NYxEYAAAAAAAA4M0yTHk2rvNo2WdzvHZqzN9v/SF3vju3evng/at5fPDLPDu1yuGyZHSVAAAAAAAAAK/XOGe4ueSvZ4e8M8xZbVe5ceuPufvy3Oqkw4+v5emDX+fuuTlLhhwsEYIBAAAAAAAAXpclGR8OuXP0TR4cPM/9z/+SRyfNDf/1TZezOp/87KdjzizJZkhO7edMy/w/nAUAAAAAAADg/zaMWcZkP8/ZLsmLacr2/MV8+cnvs/tP5/4FmLjAq1ifcioAAAAASUVORK5CYII=";function Nr(e,t,r){return typeof e=="string"&&!isNaN(Number(e))&&(e=Number(e)),typeof e=="number"&&e<100?Qr(e):typeof e=="number"&&e>=100?e:typeof e=="string"&&e.includes("%")?Math.round(t&&t==="X"?parseFloat(e)/100*r.width:t&&t==="Y"?parseFloat(e)/100*r.height:parseFloat(e)/100*r.width):0}function AB(e){return e.replace(/[xy]/g,function(t){const r=Math.random()*16|0;return(t==="x"?r:r&3|8).toString(16)})}function sr(e){return typeof e>"u"||e==null?"":e.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Qr(e){return typeof e=="number"&&e>100?e:(typeof e=="string"&&(e=Number(e.replace(/in*/gi,""))),Math.round(or*e))}function er(e){const t=Number(e)||0;return isNaN(t)?0:Math.round(t*sN)}function xm(e){return e=e||0,Math.round((e>360?e-360:e)*6e4)}function Z3(e){const t=e.toString(16);return t.length===1?"0"+t:t}function eO(e,t,r){return(Z3(e)+Z3(t)+Z3(r)).toUpperCase()}function Yr(e,t){let r=(e||"").replace("#","");!J3.test(r)&&r!==il.background1&&r!==il.background2&&r!==il.text1&&r!==il.text2&&r!==il.accent1&&r!==il.accent2&&r!==il.accent3&&r!==il.accent4&&r!==il.accent5&&r!==il.accent6&&(console.warn(`"${r}" is not a valid scheme color or hex RGB! "${Eo}" used instead. Only provide 6-digit RGB or 'pptx.SchemeColor' values!`),r=Eo);const n=J3.test(r)?"srgbClr":"schemeClr",i='val="'+(J3.test(r)?r.toUpperCase():r)+'"';return t?`${t}`:``}function F1t(e,t){let r="";const n=Object.assign(Object.assign({},t),e),i=Math.round(n.size*sN),s=n.color,o=Math.round(n.opacity*1e5);return r+=``,r+=Yr(s,``),r+="",r}function dl(e){let t="solid",r="",n="",i="";if(e)switch(typeof e=="string"?r=e:(e.type&&(t=e.type),e.color&&(r=e.color),e.alpha&&(n+=``),e.transparency&&(n+=``)),t){case"solid":i+=`${Yr(r,n)}`;break;default:i+="";break}return i}function uA(e){return e._rels.length+e._relsChart.length+e._relsMedia.length+1}function N7(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 L1t(e,t,r){var n,i;const s=2.3+(!((n=e.options)===null||n===void 0)&&n.autoPageCharWeight?e.options.autoPageCharWeight:0),o=Math.floor(t/sN*or)/((!((i=e.options)===null||i===void 0)&&i.fontSize?e.options.fontSize:ec)/s),l=[];let c=[];const u=[],d=[];e.text&&e.text.toString().trim().length===0?c.push({_type:ar.tablecell,text:" "}):typeof e.text=="number"||typeof e.text=="string"?c.push({_type:ar.tablecell,text:(e.text||"").toString().trim()}):Array.isArray(e.text)&&(c=e.text);let A=[];return c.forEach(h=>{var f;typeof h.text=="string"&&(h.text.split(` `).length>1?h.text.split(` `).forEach(m=>{A.push({_type:ar.tablecell,text:m,options:Object.assign(Object.assign({},h.options),{breakLine:!0})})}):A.push({_type:ar.tablecell,text:h.text.trim(),options:h.options}),!((f=h.options)===null||f===void 0)&&f.breakLine&&(u.push(A),A=[])),A.length>0&&(u.push(A),A=[])}),u.forEach(h=>{h.forEach(f=>{const m=[],g=String(f.text).split(" ");g.forEach((v,x)=>{const y=Object.assign({},f.options);y!=null&&y.breakLine&&(y.breakLine=x+1===g.length),m.push({_type:ar.tablecell,text:v+(x+1{let f=[],m="";h.forEach(p=>{m.length+p.text.length>o&&(l.push(f),f=[],m=""),f.push(p),m+=p.text.toString()}),f.length>0&&l.push(f)}),l}function fve(e=[],t={},r,n){let i=sC,s=or*1,o=or*1,l=0,c=0;const u=[],d=Nr(t.x,"X",r),A=Nr(t.y,"Y",r),h=Nr(t.w,"X",r),f=Nr(t.h,"Y",r);let m=h;function p(){let v=0;u.length===0&&(v=A||Qr(i[0])),u.length>0&&(v=Qr(t.autoPageSlideStartY||t.newSlideStartY||i[0])),o=(f||r.height)-v-Qr(i[2]),u.length>1&&(typeof t.autoPageSlideStartY=="number"?o=(f||r.height)-Qr(t.autoPageSlideStartY+i[2]):typeof t.newSlideStartY=="number"?o=(f||r.height)-Qr(t.newSlideStartY+i[2]):A&&(o=(f||r.height)-Qr((A/or{x||(x={_type:ar.tablecell});const y=x.options||null;c+=Number(y!=null&&y.colspan?y.colspan:1)}),t.verbose&&console.log(`| numCols ......................................... = ${c}`),!h&&t.colW&&(m=Array.isArray(t.colW)?t.colW.reduce((v,x)=>v+x)*or:t.colW*c||0,t.verbose&&console.log(`| tableCalcW ...................................... = ${m/or}`)),s=m||Qr((d?d/or:i[1])+i[3]),t.verbose&&console.log(`| emuSlideTabW .................................... = ${(s/or).toFixed(1)}`),!t.colW||!Array.isArray(t.colW))if(t.colW&&!isNaN(Number(t.colW))){const v=[];(e[0]||[]).forEach(()=>v.push(t.colW)),t.colW=[],v.forEach(y=>{Array.isArray(t.colW)&&t.colW.push(y)})}else{t.colW=[];for(let v=0;v{const y=[];let b=0,C=0,j=[];v.forEach(I=>{var P,E,M,_;j.push({_type:ar.tablecell,text:[],options:I.options}),I.options.margin&&I.options.margin[0]>=1?(!((P=I.options)===null||P===void 0)&&P.margin&&I.options.margin[0]&&er(I.options.margin[0])>b?b=er(I.options.margin[0]):t!=null&&t.margin&&t.margin[0]&&er(t.margin[0])>b&&(b=er(t.margin[0])),!((E=I.options)===null||E===void 0)&&E.margin&&I.options.margin[2]&&er(I.options.margin[2])>C?C=er(I.options.margin[2]):t!=null&&t.margin&&t.margin[2]&&er(t.margin[2])>C&&(C=er(t.margin[2]))):(!((M=I.options)===null||M===void 0)&&M.margin&&I.options.margin[0]&&Qr(I.options.margin[0])>b?b=Qr(I.options.margin[0]):t!=null&&t.margin&&t.margin[0]&&Qr(t.margin[0])>b&&(b=Qr(t.margin[0])),!((_=I.options)===null||_===void 0)&&_.margin&&I.options.margin[2]&&Qr(I.options.margin[2])>C?C=Qr(I.options.margin[2]):t!=null&&t.margin&&t.margin[2]&&Qr(t.margin[2])>C&&(C=Qr(t.margin[2])))}),p(),l+=b+C,t.verbose&&x===0&&console.log(`| SLIDE [${u.length}]: emuSlideTabH ...... = ${(o/or).toFixed(1)} `),v.forEach((I,P)=>{var E;const M={_type:ar.tablecell,_lines:null,_lineHeight:Qr((!((E=I.options)===null||E===void 0)&&E.fontSize?I.options.fontSize:t.fontSize?t.fontSize:ec)*(k1t+(t.autoPageLineWeight?t.autoPageLineWeight:0))/100),text:[],options:I.options};M.options.rowspan&&(M._lineHeight=0),M.options.autoPageCharWeight=t.autoPageCharWeight?t.autoPageCharWeight:null;let _=t.colW[P];I.options.colspan&&Array.isArray(t.colW)&&(_=t.colW.filter((R,G)=>G>=P&&GR+G)),M._lines=L1t(I,_),y.push(M)}),t.verbose&&console.log(` | SLIDE [${u.length}]: ROW [${x}]: START...`);let S=0,T=0,B=!1;for(;!B;){const I=y[S];let P=j[S];y.forEach(_=>{_._lineHeight>=T&&(T=_._lineHeight)}),l+T>o&&(t.verbose&&(console.log(` |-----------------------------------------------------------------------|`),console.log(`|-- NEW SLIDE CREATED (currTabH+currLineH > maxH) => ${(l/or).toFixed(2)} + ${(I._lineHeight/or).toFixed(2)} > ${o/or}`),console.log(`|-----------------------------------------------------------------------| `)),j.length>0&&j.map(R=>R.text.length).reduce((R,G)=>R+G)>0&&g.rows.push(j),u.push(g),g={rows:[]},j=[],v.forEach(R=>j.push({_type:ar.tablecell,text:[],options:R.options})),p(),l+=b+C,t.verbose&&console.log(`| SLIDE [${u.length}]: emuSlideTabH ...... = ${(o/or).toFixed(1)} `),l=0,(t.addHeaderToEach||t.autoPageRepeatHeader)&&t._arrObjTabHeadRows&&t._arrObjTabHeadRows.forEach(R=>{const G=[];let U=0;R.forEach(Q=>{G.push(Q),Q._lineHeight>U&&(U=Q._lineHeight)}),g.rows.push(G),l+=U}),P=j[S]);const E=I._lines.shift();Array.isArray(P.text)&&(E?P.text=P.text.concat(E):P.text.length===0&&(P.text=P.text.concat({_type:ar.tablecell,text:""}))),S===y.length-1&&(l+=T),S=S_._lines.length).reduce((_,R)=>_+R)===0&&(B=!0)}j.length>0&&g.rows.push(j),t.verbose&&console.log(`- SLIDE [${u.length}]: ROW [${x}]: ...COMPLETE ...... emuTabCurrH = ${(l/or).toFixed(2)} ( emuSlideTabH = ${(o/or).toFixed(2)} )`)}),u.push(g),t.verbose&&(console.log(` |================================================|`),console.log(`| FINAL: tableRowSlides.length = ${u.length}`),u.forEach(v=>console.log(v)),console.log(`|================================================| `)),u}function M1t(e,t,r={},n){const i=r||{};i.slideMargin=i.slideMargin||i.slideMargin===0?i.slideMargin:.5;let s=i.w||e.presLayout.width;const o=[],l=[],c=[],u=[],d=[];let A=[.5,.5,.5,.5],h=0;if(!document.getElementById(t))throw new Error('tableToSlides: Table ID "'+t+'" does not exist!');n!=null&&n._margin?(Array.isArray(n._margin)?A=n._margin:isNaN(n._margin)||(A=[n._margin,n._margin,n._margin,n._margin]),i.slideMargin=A):i!=null&&i.slideMargin&&(Array.isArray(i.slideMargin)?A=i.slideMargin:isNaN(i.slideMargin)||(A=[i.slideMargin,i.slideMargin,i.slideMargin,i.slideMargin])),s=(i.w?Qr(i.w):e.presLayout.width)-Qr(A[1]+A[3]),i.verbose&&(console.log("[[VERBOSE MODE]]"),console.log("|-- `tableToSlides` ----------------------------------------------------|"),console.log(`| tableProps.h .................................... = ${i.h}`),console.log(`| tableProps.w .................................... = ${i.w}`),console.log(`| pptx.presLayout.width ........................... = ${(e.presLayout.width/or).toFixed(1)}`),console.log(`| pptx.presLayout.height .......................... = ${(e.presLayout.height/or).toFixed(1)}`),console.log(`| emuSlideTabW .................................... = ${(s/or).toFixed(1)}`));let f=document.querySelectorAll(`#${t} tr:first-child th`);f.length===0&&(f=document.querySelectorAll(`#${t} tr:first-child td`)),f.forEach(p=>{const g=p;if(g.getAttribute("colspan"))for(let v=0;v{h+=p}),d.forEach((p,g)=>{const v=Number((Number(s)*(p/h*100)/100/or).toFixed(2));let x=0;const y=document.querySelector(`#${t} thead tr:first-child th:nth-child(${g+1})`);y&&(x=Number(y.getAttribute("data-pptx-min-width")));const b=document.querySelector(`#${t} thead tr:first-child th:nth-child(${g+1})`);b&&(x=Number(b.getAttribute("data-pptx-width"))),u.push(x>v?x:v)}),i.verbose&&console.log(`| arrColW ......................................... = [${u.join(", ")}]`),["thead","tbody","tfoot"].forEach(p=>{document.querySelectorAll(`#${t} ${p} tr`).forEach(g=>{const v=g,x=[];switch(Array.from(v.cells).forEach(y=>{const b=window.getComputedStyle(y).getPropertyValue("color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(",");let C=window.getComputedStyle(y).getPropertyValue("background-color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(",");(window.getComputedStyle(y).getPropertyValue("background-color")==="rgba(0, 0, 0, 0)"||window.getComputedStyle(y).getPropertyValue("transparent"))&&(C=["255","255","255"]);const j={align:null,bold:window.getComputedStyle(y).getPropertyValue("font-weight")==="bold"||Number(window.getComputedStyle(y).getPropertyValue("font-weight"))>=500,border:null,color:eO(Number(b[0]),Number(b[1]),Number(b[2])),fill:{color:eO(Number(C[0]),Number(C[1]),Number(C[2]))},fontFace:(window.getComputedStyle(y).getPropertyValue("font-family")||"").split(",")[0].replace(/"/g,"").replace("inherit","").replace("initial","")||null,fontSize:Number(window.getComputedStyle(y).getPropertyValue("font-size").replace(/[a-z]/gi,"")),margin:null,colspan:Number(y.getAttribute("colspan"))||null,rowspan:Number(y.getAttribute("rowspan"))||null,valign:null};if(["left","center","right","start","end"].includes(window.getComputedStyle(y).getPropertyValue("text-align"))){const S=window.getComputedStyle(y).getPropertyValue("text-align").replace("start","left").replace("end","right");j.align=S==="center"?"center":S==="left"?"left":S==="right"?"right":null}if(["top","middle","bottom"].includes(window.getComputedStyle(y).getPropertyValue("vertical-align"))){const S=window.getComputedStyle(y).getPropertyValue("vertical-align");j.valign=S==="top"?"top":S==="middle"?"middle":S==="bottom"?"bottom":null}window.getComputedStyle(y).getPropertyValue("padding-left")&&(j.margin=[0,0,0,0],["padding-top","padding-right","padding-bottom","padding-left"].forEach((T,B)=>{j.margin[B]=Math.round(Number(window.getComputedStyle(y).getPropertyValue(T).replace(/\D/gi,"")))})),(window.getComputedStyle(y).getPropertyValue("border-top-width")||window.getComputedStyle(y).getPropertyValue("border-right-width")||window.getComputedStyle(y).getPropertyValue("border-bottom-width")||window.getComputedStyle(y).getPropertyValue("border-left-width"))&&(j.border=[null,null,null,null],["top","right","bottom","left"].forEach((T,B)=>{const I=Math.round(Number(window.getComputedStyle(y).getPropertyValue("border-"+T+"-width").replace("px","")));let P=[];P=window.getComputedStyle(y).getPropertyValue("border-"+T+"-color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(",");const E=eO(Number(P[0]),Number(P[1]),Number(P[2]));j.border[B]={pt:I,color:E}})),x.push({_type:ar.tablecell,text:y.innerText,options:j})}),p){case"thead":o.push(x);break;case"tbody":l.push(x);break;case"tfoot":c.push(x);break;default:console.log(`table parsing: unexpected table part: ${p}`);break}})}),i._arrObjTabHeadRows=o||null,i.colW=u,fve([...o,...l,...c],i,e.presLayout,n).forEach((p,g)=>{const v=e.addSlide({masterName:i.masterSlideName||null});g===0&&(i.y=i.y||A[0]),g>0&&(i.y=i.autoPageSlideStartY||i.newSlideStartY||A[0]),i.verbose&&console.log(`| opts.autoPageSlideStartY: ${i.autoPageSlideStartY} / arrInchMargins[0]: ${A[0]} => opts.y = ${i.y}`),v.addTable(p.rows,{x:i.x||A[3],y:i.y,w:Number(s)/or,colW:u,autoPage:!1}),i.addImage&&(i.addImage.options=i.addImage.options||{},!i.addImage.image||!i.addImage.image.path&&!i.addImage.image.data?console.warn("Warning: tableToSlides.addImage requires either `path` or `data`"):v.addImage({path:i.addImage.image.path,data:i.addImage.image.data,x:i.addImage.options.x,y:i.addImage.options.y,w:i.addImage.options.w,h:i.addImage.options.h})),i.addShape&&v.addShape(i.addShape.shapeName,i.addShape.options||{}),i.addTable&&v.addTable(i.addTable.rows,i.addTable.options||{}),i.addText&&v.addText(i.addText.text,i.addText.options||{})})}let D1t=0;function R1t(e,t){e.bkgd&&(t.bkgd=e.bkgd),e.objects&&Array.isArray(e.objects)&&e.objects.length>0&&e.objects.forEach((r,n)=>{const i=Object.keys(r)[0],s=t;If[i]&&i==="chart"?hve(s,r[i].type,r[i].data,r[i].opts):If[i]&&i==="image"?pve(s,r[i]):If[i]&&i==="line"?pR(s,Kh.LINE,r[i]):If[i]&&i==="rect"?pR(s,Kh.RECTANGLE,r[i]):If[i]&&i==="text"?w5(s,[{text:r[i].text}],r[i].options,!1):If[i]&&i==="placeholder"&&(r[i].options.placeholder=r[i].options.name,delete r[i].options.name,r[i].options._placeholderType=r[i].options.type,delete r[i].options.type,r[i].options._placeholderIdx=100+n,w5(s,[{text:r[i].text}],r[i].options,!0))}),e.slideNumber&&typeof e.slideNumber=="object"&&(t._slideNumberProps=e.slideNumber)}function hve(e,t,r,n){var i;function s(A){!A||A.style==="none"||(A.size!==void 0&&(isNaN(Number(A.size))||A.size<=0)&&(console.warn("Warning: chart.gridLine.size must be greater than 0."),delete A.size),A.style&&!["solid","dash","dot"].includes(A.style)&&(console.warn("Warning: chart.gridLine.style options: `solid`, `dash`, `dot`."),delete A.style),A.cap&&!["flat","square","round"].includes(A.cap)&&(console.warn("Warning: chart.gridLine.cap options: `flat`, `square`, `round`."),delete A.cap))}const o=++D1t,l={_type:null,text:null,options:null,chartRid:null};let c=null,u=[];Array.isArray(t)?(t.forEach(A=>{u=u.concat(A.data)}),c=r||n):(u=r,c=n),u.forEach((A,h)=>{A._dataIndex=h,A.labels!==void 0&&!Array.isArray(A.labels[0])&&(A.labels=[A.labels])});const d=c&&typeof c=="object"?c:{};if(d._type=t,d.x=typeof d.x<"u"&&d.x!=null&&!isNaN(Number(d.x))?d.x:1,d.y=typeof d.y<"u"&&d.y!=null&&!isNaN(Number(d.y))?d.y:1,d.w=d.w||"50%",d.h=d.h||"50%",d.objectName=d.objectName?sr(d.objectName):`Chart ${e._slideObjects.filter(A=>A._type===ar.chart).length}`,["bar","col"].includes(d.barDir||"")||(d.barDir="col"),d._type===et.AREA&&(["stacked","standard","percentStacked"].includes(d.barGrouping||"")||(d.barGrouping="standard")),d._type===et.BAR&&(["clustered","stacked","percentStacked"].includes(d.barGrouping||"")||(d.barGrouping="clustered")),d._type===et.BAR3D&&(["clustered","stacked","standard","percentStacked"].includes(d.barGrouping||"")||(d.barGrouping="standard")),!((i=d.barGrouping)===null||i===void 0)&&i.includes("tacked")&&(d.barGapWidthPct||(d.barGapWidthPct=50)),d.dataLabelPosition&&((d._type===et.AREA||d._type===et.BAR3D||d._type===et.DOUGHNUT||d._type===et.RADAR)&&delete d.dataLabelPosition,d._type===et.PIE&&(["bestFit","ctr","inEnd","outEnd"].includes(d.dataLabelPosition)||delete d.dataLabelPosition),(d._type===et.BUBBLE||d._type===et.BUBBLE3D||d._type===et.LINE||d._type===et.SCATTER)&&(["b","ctr","l","r","t"].includes(d.dataLabelPosition)||delete d.dataLabelPosition),d._type===et.BAR&&(["stacked","percentStacked"].includes(d.barGrouping||"")||["ctr","inBase","inEnd"].includes(d.dataLabelPosition)||delete d.dataLabelPosition,["clustered"].includes(d.barGrouping||"")||["ctr","inBase","inEnd","outEnd"].includes(d.dataLabelPosition)||delete d.dataLabelPosition)),d.dataLabelBkgrdColors=d.dataLabelBkgrdColors||!d.dataLabelBkgrdColors?d.dataLabelBkgrdColors:!1,["b","l","r","t","tr"].includes(d.legendPos||"")||(d.legendPos="r"),["cone","coneToMax","box","cylinder","pyramid","pyramidToMax"].includes(d.bar3DShape||"")||(d.bar3DShape="box"),["circle","dash","diamond","dot","none","square","triangle"].includes(d.lineDataSymbol||"")||(d.lineDataSymbol="circle"),["gap","span"].includes(d.displayBlanksAs||"")||(d.displayBlanksAs="span"),["standard","marker","filled"].includes(d.radarStyle||"")||(d.radarStyle="standard"),d.lineDataSymbolSize=d.lineDataSymbolSize&&!isNaN(d.lineDataSymbolSize)?d.lineDataSymbolSize:6,d.lineDataSymbolLineSize=d.lineDataSymbolLineSize&&!isNaN(d.lineDataSymbolLineSize)?er(d.lineDataSymbolLineSize):er(.75),d.layout&&["x","y","w","h"].forEach(A=>{const h=d.layout[A];(isNaN(Number(h))||h<0||h>1)&&(console.warn("Warning: chart.layout."+A+" can only be 0-1"),delete d.layout[A])}),d.catGridLine=d.catGridLine||(d._type===et.SCATTER?{color:"D9D9D9",size:1}:{style:"none"}),d.valGridLine=d.valGridLine||(d._type===et.SCATTER?{color:"D9D9D9",size:1}:{}),d.serGridLine=d.serGridLine||(d._type===et.SCATTER?{color:"D9D9D9",size:1}:{style:"none"}),s(d.catGridLine),s(d.valGridLine),s(d.serGridLine),N7(d.shadow),d.showDataTable=d.showDataTable||!d.showDataTable?d.showDataTable:!1,d.showDataTableHorzBorder=d.showDataTableHorzBorder||!d.showDataTableHorzBorder?d.showDataTableHorzBorder:!0,d.showDataTableVertBorder=d.showDataTableVertBorder||!d.showDataTableVertBorder?d.showDataTableVertBorder:!0,d.showDataTableOutline=d.showDataTableOutline||!d.showDataTableOutline?d.showDataTableOutline:!0,d.showDataTableKeys=d.showDataTableKeys||!d.showDataTableKeys?d.showDataTableKeys:!0,d.showLabel=d.showLabel||!d.showLabel?d.showLabel:!1,d.showLegend=d.showLegend||!d.showLegend?d.showLegend:!1,d.showPercent=d.showPercent||!d.showPercent?d.showPercent:!0,d.showTitle=d.showTitle||!d.showTitle?d.showTitle:!1,d.showValue=d.showValue||!d.showValue?d.showValue:!1,d.showLeaderLines=d.showLeaderLines||!d.showLeaderLines?d.showLeaderLines:!1,d.catAxisLineShow=typeof d.catAxisLineShow<"u"?d.catAxisLineShow:!0,d.valAxisLineShow=typeof d.valAxisLineShow<"u"?d.valAxisLineShow:!0,d.serAxisLineShow=typeof d.serAxisLineShow<"u"?d.serAxisLineShow:!0,d.v3DRotX=!isNaN(d.v3DRotX)&&d.v3DRotX>=-90&&d.v3DRotX<=90?d.v3DRotX:30,d.v3DRotY=!isNaN(d.v3DRotY)&&d.v3DRotY>=0&&d.v3DRotY<=360?d.v3DRotY:30,d.v3DRAngAx=d.v3DRAngAx||!d.v3DRAngAx?d.v3DRAngAx:!0,d.v3DPerspective=!isNaN(d.v3DPerspective)&&d.v3DPerspective>=0&&d.v3DPerspective<=240?d.v3DPerspective:30,d.barGapWidthPct=!isNaN(d.barGapWidthPct)&&d.barGapWidthPct>=0&&d.barGapWidthPct<=1e3?d.barGapWidthPct:150,d.barGapDepthPct=!isNaN(d.barGapDepthPct)&&d.barGapDepthPct>=0&&d.barGapDepthPct<=1e3?d.barGapDepthPct:150,d.chartColors=Array.isArray(d.chartColors)?d.chartColors:d._type===et.PIE||d._type===et.DOUGHNUT?I1t:Ew,d.chartColorsOpacity=d.chartColorsOpacity&&!isNaN(d.chartColorsOpacity)?d.chartColorsOpacity:null,d.border=d.border&&typeof d.border=="object"?d.border:null,d.border&&(!d.border.pt||isNaN(d.border.pt))&&(d.border.pt=Uv.pt),d.border&&(!d.border.color||typeof d.border.color!="string")&&(d.border.color=Uv.color),d.plotArea=d.plotArea||{},d.plotArea.border=d.plotArea.border&&typeof d.plotArea.border=="object"?d.plotArea.border:null,d.plotArea.border&&(!d.plotArea.border.pt||isNaN(d.plotArea.border.pt))&&(d.plotArea.border.pt=Uv.pt),d.plotArea.border&&(!d.plotArea.border.color||typeof d.plotArea.border.color!="string")&&(d.plotArea.border.color=Uv.color),d.border&&(d.plotArea.border=d.border),d.plotArea.fill=d.plotArea.fill||{color:null,transparency:null},d.fill&&(d.plotArea.fill.color=d.fill),d.chartArea=d.chartArea||{},d.chartArea.border=d.chartArea.border&&typeof d.chartArea.border=="object"?d.chartArea.border:null,d.chartArea.border&&(d.chartArea.border={color:d.chartArea.border.color||Uv.color,pt:d.chartArea.border.pt||Uv.pt}),d.chartArea.roundedCorners=typeof d.chartArea.roundedCorners=="boolean"?d.chartArea.roundedCorners:!0,d.dataBorder=d.dataBorder&&typeof d.dataBorder=="object"?d.dataBorder:null,d.dataBorder&&(!d.dataBorder.pt||isNaN(d.dataBorder.pt))&&(d.dataBorder.pt=.75),d.dataBorder&&d.dataBorder.color){const A=typeof d.dataBorder.color=="string"&&d.dataBorder.color.length===6&&/^[0-9A-Fa-f]{6}$/.test(d.dataBorder.color),h=Object.values(b5).includes(d.dataBorder.color);!A&&!h&&(d.dataBorder.color="F9F9F9")}return!d.dataLabelFormatCode&&d._type===et.SCATTER&&(d.dataLabelFormatCode="General"),!d.dataLabelFormatCode&&(d._type===et.PIE||d._type===et.DOUGHNUT)&&(d.dataLabelFormatCode=d.showPercent?"0%":"General"),d.dataLabelFormatCode=d.dataLabelFormatCode&&typeof d.dataLabelFormatCode=="string"?d.dataLabelFormatCode:"#,##0",!d.dataLabelFormatScatter&&d._type===et.SCATTER&&(d.dataLabelFormatScatter="custom"),d.lineSize=typeof d.lineSize=="number"?d.lineSize:2,d.valAxisMajorUnit=typeof d.valAxisMajorUnit=="number"?d.valAxisMajorUnit:null,d._type===et.AREA||d._type===et.BAR||d._type===et.BAR3D||d._type===et.LINE?d.catAxisMultiLevelLabels=!!d.catAxisMultiLevelLabels:delete d.catAxisMultiLevelLabels,l._type="chart",l.options=d,l.chartRid=uA(e),e._relsChart.push({rId:uA(e),data:u,opts:d,type:d._type,globalId:o,fileName:`chart${o}.xml`,Target:`/ppt/charts/chart${o}.xml`}),e._slideObjects.push(l),l}function pve(e,t){const r={_type:null,text:null,options:null,image:null,imageRid:null,hyperlink:null},n=t.x||0,i=t.y||0,s=t.w||0,o=t.h||0,l=t.sizing||null,c=t.hyperlink||"",u=t.data||"",d=t.path||"";let A=uA(e);const h=t.objectName?sr(t.objectName):`Image ${e._slideObjects.filter(m=>m._type===ar.image).length}`;if(!d&&!u)return console.error("ERROR: addImage() requires either 'data' or 'path' parameter!"),null;if(d&&typeof d!="string")return console.error(`ERROR: addImage() 'path' should be a string, ex: {path:'/img/sample.png'} - you sent ${String(d)}`),null;if(u&&typeof u!="string")return console.error(`ERROR: addImage() 'data' should be a string, ex: {data:'image/png;base64,NMP[...]'} - you sent ${String(u)}`),null;if(u&&typeof u=="string"&&!u.toLowerCase().includes("base64,"))return console.error("ERROR: Image `data` value lacks a base64 header! Ex: 'image/png;base64,NMP[...]')"),null;let f=(d.substring(d.lastIndexOf("/")+1).split("?")[0].split(".").pop().split("#")[0]||"png").toLowerCase();if(u&&/image\/(\w+);/.exec(u)&&/image\/(\w+);/.exec(u).length>0?f=/image\/(\w+);/.exec(u)[1]:u!=null&&u.toLowerCase().includes("image/svg+xml")&&(f="svg"),r._type=ar.image,r.image=d||"preencoded.png",r.options={x:n||0,y:i||0,w:s||1,h:o||1,altText:t.altText||"",rounding:typeof t.rounding=="boolean"?t.rounding:!1,sizing:l,placeholder:t.placeholder,rotate:t.rotate||0,flipV:t.flipV||!1,flipH:t.flipH||!1,transparency:t.transparency||0,objectName:h,shadow:N7(t.shadow)},f==="svg")e._relsMedia.push({path:d||u+"png",type:"image/png",extn:"png",data:u||"",rId:A,Target:`../media/image-${e._slideNum}-${e._relsMedia.length+1}.png`,isSvgPng:!0,svgSize:{w:Nr(r.options.w,"X",e._presLayout),h:Nr(r.options.h,"Y",e._presLayout)}}),r.imageRid=A,e._relsMedia.push({path:d||u,type:"image/svg+xml",extn:f,data:u||"",rId:A+1,Target:`../media/image-${e._slideNum}-${e._relsMedia.length+1}.${f}`}),r.imageRid=A+1;else{const m=e._relsMedia.filter(p=>p.path&&p.path===d&&p.type==="image/"+f&&!p.isDuplicate)[0];e._relsMedia.push({path:d||"preencoded."+f,type:"image/"+f,extn:f,data:u||"",rId:A,isDuplicate:!!(m!=null&&m.Target),Target:m!=null&&m.Target?m.Target:`../media/image-${e._slideNum}-${e._relsMedia.length+1}.${f}`}),r.imageRid=A}if(typeof c=="object"){if(!c.url&&!c.slide)throw new Error("ERROR: `hyperlink` option requires either: `url` or `slide`");A++,e._rels.push({type:ar.hyperlink,data:c.slide?"slide":"dummy",rId:A,Target:c.url||c.slide.toString()}),c._rId=A,r.hyperlink=c}e._slideObjects.push(r)}function U1t(e,t){const r=t.x||0,n=t.y||0,i=t.w||2,s=t.h||2,o=t.data||"",l=t.link||"",c=t.path||"",u=t.type||"audio";let d="";const A=t.cover||O1t,h=t.objectName?sr(t.objectName):`Media ${e._slideObjects.filter(m=>m._type===ar.media).length}`,f={_type:ar.media};if(!c&&!o&&u!=="online")throw new Error("addMedia() error: either `data` or `path` are required!");if(o&&!o.toLowerCase().includes("base64,"))throw new Error("addMedia() error: `data` value lacks a base64 header! Ex: 'video/mpeg;base64,NMP[...]')");if(!A.toLowerCase().includes("base64,"))throw new Error("addMedia() error: `cover` value lacks a base64 header! Ex: 'data:image/png;base64,iV[...]')");if(u==="online"&&!l)throw new Error("addMedia() error: online videos require `link` value");if(d=t.extn||(o?o.split(";")[0].split("/")[1]:c.split(".").pop())||"mp3",f.mtype=u,f.media=c||"preencoded.mov",f.options={},f.options.x=r,f.options.y=n,f.options.w=i,f.options.h=s,f.options.objectName=h,u==="online"){const m=uA(e);e._relsMedia.push({path:c||"preencoded"+d,data:"dummy",type:"online",extn:d,rId:m,Target:l}),f.mediaRid=m,e._relsMedia.push({path:"preencoded.png",data:A,type:"image/png",extn:"png",rId:uA(e),Target:`../media/image-${e._slideNum}-${e._relsMedia.length+1}.png`})}else{const m=e._relsMedia.filter(g=>g.path&&g.path===c&&g.type===u+"/"+d&&!g.isDuplicate)[0],p=uA(e);e._relsMedia.push({path:c||"preencoded"+d,type:u+"/"+d,extn:d,data:o||"",rId:p,isDuplicate:!!(m!=null&&m.Target),Target:m!=null&&m.Target?m.Target:`../media/media-${e._slideNum}-${e._relsMedia.length+1}.${d}`}),f.mediaRid=p,e._relsMedia.push({path:c||"preencoded"+d,type:u+"/"+d,extn:d,data:o||"",rId:uA(e),isDuplicate:!!(m!=null&&m.Target),Target:m!=null&&m.Target?m.Target:`../media/media-${e._slideNum}-${e._relsMedia.length+0}.${d}`}),e._relsMedia.push({path:"preencoded.png",type:"image/png",extn:"png",data:A,rId:uA(e),Target:`../media/image-${e._slideNum}-${e._relsMedia.length+1}.png`})}e._slideObjects.push(f)}function Q1t(e,t){e._slideObjects.push({_type:ar.notes,text:[{text:t}]})}function pR(e,t,r){const n=typeof r=="object"?r:{};n.line=n.line||{type:"none"};const i={_type:ar.text,shape:t||Kh.RECTANGLE,options:n,text:null};if(!t)throw new Error("Missing/Invalid shape parameter! Example: `addShape(pptxgen.shapes.LINE, {x:1, y:1, w:1, h:1});`");const s={type:n.line.type||"solid",color:n.line.color||uve,transparency:n.line.transparency||0,width:n.line.width||1,dashType:n.line.dashType||"solid",beginArrowType:n.line.beginArrowType||null,endArrowType:n.line.endArrowType||null};if(typeof n.line=="object"&&n.line.type!=="none"&&(n.line=s),n.x=n.x||(n.x===0?0:1),n.y=n.y||(n.y===0?0:1),n.w=n.w||(n.w===0?0:1),n.h=n.h||(n.h===0?0:1),n.objectName=n.objectName?sr(n.objectName):`Shape ${e._slideObjects.filter(o=>o._type===ar.text).length}`,typeof n.line=="string"){const o=s;o.color=String(n.line),n.line=o}typeof n.lineSize=="number"&&(n.line.width=n.lineSize),typeof n.lineDash=="string"&&(n.line.dashType=n.lineDash),typeof n.lineHead=="string"&&(n.line.beginArrowType=n.lineHead),typeof n.lineTail=="string"&&(n.line.endArrowType=n.lineTail),p0(e,i),e._slideObjects.push(i)}function H1t(e,t,r,n,i,s,o){const l=[e],c=r&&typeof r=="object"?r:{};c.objectName=c.objectName?sr(c.objectName):`Table ${e._slideObjects.filter(h=>h._type===ar.table).length}`;{if(t===null||t.length===0||!Array.isArray(t))throw new Error("addTable: Array expected! EX: 'slide.addTable( [rows], {options} );' (https://gitbrent.github.io/PptxGenJS/docs/api-tables.html)");if(!t[0]||!Array.isArray(t[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)")}const u=[];t.forEach(h=>{const f=[];Array.isArray(h)?h.forEach(m=>{const p={_type:ar.tablecell,text:"",options:typeof m=="object"&&m.options?m.options:{}};typeof m=="string"||typeof m=="number"?p.text=m.toString():m.text&&(typeof m.text=="string"||typeof m.text=="number"?p.text=m.text.toString():m.text&&(p.text=m.text),m.options&&typeof m.options=="object"&&(p.options=m.options)),p.options.border=p.options.border||c.border||[{type:"none"},{type:"none"},{type:"none"},{type:"none"}];const g=p.options.border;!Array.isArray(g)&&typeof g=="object"&&(p.options.border=[g,g,g,g]),p.options.border[0]||(p.options.border[0]={type:"none"}),p.options.border[1]||(p.options.border[1]={type:"none"}),p.options.border[2]||(p.options.border[2]={type:"none"}),p.options.border[3]||(p.options.border[3]={type:"none"}),[0,1,2,3].forEach(x=>{p.options.border[x]={type:p.options.border[x].type||Rv.type,color:p.options.border[x].color||Rv.color,pt:typeof p.options.border[x].pt=="number"?p.options.border[x].pt:Rv.pt}}),f.push(p)}):(console.log("addTable: tableRows has a bad row. A row should be an array of cells. You provided:"),console.log(h)),u.push(f)}),c.x=Nr(c.x||(c.x===0?0:or/2),"X",i),c.y=Nr(c.y||(c.y===0?0:or/2),"Y",i),c.h&&(c.h=Nr(c.h,"Y",i)),c.fontSize=c.fontSize||ec,c.margin=c.margin===0||c.margin?c.margin:cve,typeof c.margin=="number"&&(c.margin=[Number(c.margin),Number(c.margin),Number(c.margin),Number(c.margin)]),JSON.stringify({arrRows:u}).indexOf("hyperlink")===-1&&(c.color||(c.color=c.color||Eo)),typeof c.border=="string"?(console.warn("addTable `border` option must be an object. Ex: `{border: {type:'none'}}`"),c.border=null):Array.isArray(c.border)&&[0,1,2,3].forEach(h=>{c.border[h]=c.border[h]?{type:c.border[h].type||Rv.type,color:c.border[h].color||Rv.color,pt:c.border[h].pt||Rv.pt}:{type:"none"}}),c.autoPage=typeof c.autoPage=="boolean"?c.autoPage:!1,c.autoPageRepeatHeader=typeof c.autoPageRepeatHeader=="boolean"?c.autoPageRepeatHeader:!1,c.autoPageHeaderRows=typeof c.autoPageHeaderRows<"u"&&!isNaN(Number(c.autoPageHeaderRows))?Number(c.autoPageHeaderRows):1,c.autoPageLineWeight=typeof c.autoPageLineWeight<"u"&&!isNaN(Number(c.autoPageLineWeight))?Number(c.autoPageLineWeight):0,c.autoPageLineWeight&&(c.autoPageLineWeight>1?c.autoPageLineWeight=1:c.autoPageLineWeight<-1&&(c.autoPageLineWeight=-1));let d=sC;if(n&&typeof n._margin<"u"&&(Array.isArray(n._margin)?d=n._margin:isNaN(Number(n._margin))||(d=[Number(n._margin),Number(n._margin),Number(n._margin),Number(n._margin)])),c.colW){const h=u[0].reduce((f,m)=>{var p;return!((p=m==null?void 0:m.options)===null||p===void 0)&&p.colspan&&typeof m.options.colspan=="number"?f+=m.options.colspan:f+=1,f},0);typeof c.colW=="string"||typeof c.colW=="number"||c.colW&&Array.isArray(c.colW)&&c.colW.length===1&&h>1?(c.w=Math.floor(Number(c.colW)*h),c.colW=null):c.colW&&Array.isArray(c.colW)&&c.colW.length!==h&&(console.warn("addTable: mismatch: (colW.length != data.length) Therefore, defaulting to evenly distributed col widths."),c.colW=null)}else c.w?c.w=Nr(c.w,"X",i):c.w=Math.floor(i._sizeW/or-d[1]-d[3]);c.x&&c.x<20&&(c.x=Qr(c.x)),c.y&&c.y<20&&(c.y=Qr(c.y)),c.w&&typeof c.w=="number"&&c.w<20&&(c.w=Qr(c.w)),c.h&&typeof c.h=="number"&&c.h<20&&(c.h=Qr(c.h)),u.forEach(h=>{h.forEach((f,m)=>{typeof f=="number"||typeof f=="string"?h[m]={_type:ar.tablecell,text:String(h[m]),options:c}:typeof f=="object"&&(typeof f.text=="number"?h[m].text=h[m].text.toString():(typeof f.text>"u"||f.text===null)&&(h[m].text=""),h[m].options=f.options||{},h[m]._type=ar.tablecell)})});const A=[];return c&&!c.autoPage?(p0(e,u),e._slideObjects.push({_type:ar.table,arrTabRows:u,options:Object.assign({},c)})):(c.autoPageRepeatHeader&&(c._arrObjTabHeadRows=u.filter((h,f)=>f{o(e._slideNum+f)||l.push(s({masterName:(n==null?void 0:n._name)||null})),f>0&&(c.y=Qr(c.autoPageSlideStartY||c.newSlideStartY||d[0]));{const m=o(e._slideNum+f);c.autoPage=!1,p0(m,h.rows),m.addTable(h.rows,Object.assign({},c)),f>0&&A.push(m)}})),A}function w5(e,t,r,n){const i={_type:n?ar.placeholder:ar.text,shape:(r==null?void 0:r.shape)||Kh.RECTANGLE,text:!t||t.length===0?[{text:"",options:null}]:t,options:r||{}};function s(o){{if(o.placeholder||(o.color=o.color||i.options.color||e.color||Eo),(o.placeholder||n)&&(o.bullet=o.bullet||!1),o.placeholder&&e._slideLayout&&e._slideLayout._slideObjects){const l=e._slideLayout._slideObjects.filter(c=>c._type==="placeholder"&&c.options&&c.options.placeholder&&c.options.placeholder===o.placeholder)[0];l!=null&&l.options&&(o=Object.assign(Object.assign({},o),l.options))}if(o.objectName=o.objectName?sr(o.objectName):`Text ${e._slideObjects.filter(l=>l._type===ar.text).length}`,o.shape===Kh.LINE){const l={type:o.line.type||"solid",color:o.line.color||uve,transparency:o.line.transparency||0,width:o.line.width||1,dashType:o.line.dashType||"solid",beginArrowType:o.line.beginArrowType||null,endArrowType:o.line.endArrowType||null};if(typeof o.line=="object"&&(o.line=l),typeof o.line=="string"){const c=l;typeof o.line=="string"&&(c.color=o.line),o.line=c}typeof o.lineSize=="number"&&(o.line.width=o.lineSize),typeof o.lineDash=="string"&&(o.line.dashType=o.lineDash),typeof o.lineHead=="string"&&(o.line.beginArrowType=o.lineHead),typeof o.lineTail=="string"&&(o.line.endArrowType=o.lineTail)}o.line=o.line||{},o.lineSpacing=o.lineSpacing&&!isNaN(o.lineSpacing)?o.lineSpacing:null,o.lineSpacingMultiple=o.lineSpacingMultiple&&!isNaN(o.lineSpacingMultiple)?o.lineSpacingMultiple:null,o._bodyProp=o._bodyProp||{},o._bodyProp.autoFit=o.autoFit||!1,o._bodyProp.anchor=o.placeholder?null:bx.ctr,o._bodyProp.vert=o.vert||null,o._bodyProp.wrap=typeof o.wrap=="boolean"?o.wrap:!0,(o.inset&&!isNaN(Number(o.inset))||o.inset===0)&&(o._bodyProp.lIns=Qr(o.inset),o._bodyProp.rIns=Qr(o.inset),o._bodyProp.tIns=Qr(o.inset),o._bodyProp.bIns=Qr(o.inset)),typeof o.underline=="boolean"&&o.underline===!0&&(o.underline={style:"sng"})}return(o.align||"").toLowerCase().indexOf("c")===0?o._bodyProp.align=yx.center:(o.align||"").toLowerCase().indexOf("l")===0?o._bodyProp.align=yx.left:(o.align||"").toLowerCase().indexOf("r")===0?o._bodyProp.align=yx.right:(o.align||"").toLowerCase().indexOf("j")===0&&(o._bodyProp.align=yx.justify),(o.valign||"").toLowerCase().indexOf("b")===0?o._bodyProp.anchor=bx.b:(o.valign||"").toLowerCase().indexOf("m")===0?o._bodyProp.anchor=bx.ctr:(o.valign||"").toLowerCase().indexOf("t")===0&&(o._bodyProp.anchor=bx.t),N7(o.shadow),o}i.options=s(i.options),i.text.forEach(o=>o.options=s(o.options||{})),p0(e,i.text||""),e._slideObjects.push(i)}function $1t(e){(e._slideLayout._slideObjects||[]).forEach(t=>{t._type===ar.placeholder&&e._slideObjects.filter(r=>r.options&&r.options.placeholder===t.options.placeholder).length===0&&w5(e,[{text:""}],t.options,!1)})}function mve(e,t){var r;if(t.bkgd&&(t.background||(t.background={}),typeof t.bkgd=="string"?t.background.color=t.bkgd:(t.bkgd.data&&(t.background.data=t.bkgd.data),t.bkgd.path&&(t.background.path=t.bkgd.path),t.bkgd.src&&(t.background.path=t.bkgd.src))),!((r=t.background)===null||r===void 0)&&r.fill&&(t.background.color=t.background.fill),e&&(e.path||e.data)){e.path=e.path||"preencoded.png";let n=(e.path.split(".").pop()||"png").split("?")[0];n==="jpg"&&(n="jpeg"),t._relsMedia=t._relsMedia||[];const i=t._relsMedia.length+1;t._relsMedia.push({path:e.path,type:ar.image,extn:n,data:e.data||null,rId:i,Target:`../media/${(t._name||"").replace(/\s+/gi,"-")}-image-${t._relsMedia.length+1}.${n}`}),t._bkgdImgRid=i}}function p0(e,t,r){let n=[];typeof t=="string"||typeof t=="number"||(Array.isArray(t)?n=t:typeof t=="object"&&(n=[t]),n.forEach((i,s)=>{if(r&&r[s]&&r[s].hyperlink&&(i.options=Object.assign(Object.assign({},i.options),r[s])),Array.isArray(i)){const o=[];i.forEach(l=>{l.options&&!l.text.options&&o.push(l.options)}),p0(e,i,o)}else if(Array.isArray(i.text))p0(e,i.text,r&&r[s]?[r[s]]:void 0);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{const o=uA(e);e._rels.push({type:ar.hyperlink,data:i.options.hyperlink.slide?"slide":"dummy",rId:o,Target:sr(i.options.hyperlink.url)||i.options.hyperlink.slide.toString()}),i.options.hyperlink._rId=o}else i&&typeof i=="object"&&i.options&&i.options.hyperlink&&i.options.hyperlink._rId&&e._rels.filter(o=>o.rId===i.options.hyperlink._rId).length===0&&e._rels.push({type:ar.hyperlink,data:i.options.hyperlink.slide?"slide":"dummy",rId:i.options.hyperlink._rId,Target:sr(i.options.hyperlink.url)||i.options.hyperlink.slide.toString()})}))}class z1t{constructor(t){var r;this.addSlide=t.addSlide,this.getSlide=t.getSlide,this._name=`Slide ${t.slideNumber}`,this._presLayout=t.presLayout,this._rId=t.slideRId,this._rels=[],this._relsChart=[],this._relsMedia=[],this._setSlideNum=t.setSlideNum,this._slideId=t.slideId,this._slideLayout=t.slideLayout||null,this._slideNum=t.slideNumber,this._slideObjects=[],this._slideNumberProps=!((r=this._slideLayout)===null||r===void 0)&&r._slideNumberProps?this._slideLayout._slideNumberProps:null}set bkgd(t){this._bkgd=t,(!this._background||!this._background.color)&&(this._background||(this._background={}),typeof t=="string"&&(this._background.color=t))}get bkgd(){return this._bkgd}set background(t){this._background=t,t&&mve(t,this)}get background(){return this._background}set color(t){this._color=t}get color(){return this._color}set hidden(t){this._hidden=t}get hidden(){return this._hidden}set slideNumber(t){this._slideNumberProps=t,this._setSlideNum(t)}get slideNumber(){return this._slideNumberProps}get newAutoPagedSlides(){return this._newAutoPagedSlides}addChart(t,r,n){const i=n||{};return i._type=t,hve(this,t,r,n),this}addImage(t){return pve(this,t),this}addMedia(t){return U1t(this,t),this}addNotes(t){return Q1t(this,t),this}addShape(t,r){return pR(this,t,r),this}addTable(t,r){return this._newAutoPagedSlides=H1t(this,t,r,this._slideLayout,this._presLayout,this.addSlide,this.getSlide),this}addText(t,r){return w5(this,typeof t=="string"||typeof t=="number"?[{text:t,options:r}]:t,r,!1),this}}function W1t(e,t){return ol(this,void 0,void 0,function*(){const r=e.data;return yield new Promise((n,i)=>{var s,o;const l=new lve,c=(r.length-1)*2+1,u=((o=(s=r[0])===null||s===void 0?void 0:s.labels)===null||o===void 0?void 0:o.length)>1;l.folder("_rels"),l.folder("docProps"),l.folder("xl/_rels"),l.folder("xl/tables"),l.folder("xl/theme"),l.folder("xl/worksheets"),l.folder("xl/worksheets/_rels"),l.file("[Content_Types].xml",` `),l.file("_rels/.rels",` `),l.file("docProps/app.xml",`Microsoft Macintosh Excel0falseWorksheets1Sheet1falsefalsefalse16.0300 `),l.file("docProps/core.xml",'PptxGenJSPptxGenJS'+new Date().toISOString()+''+new Date().toISOString()+""),l.file("xl/_rels/workbook.xml.rels",''),l.file("xl/styles.xml",` `),l.file("xl/theme/theme1.xml",''),l.file("xl/workbook.xml",` `),l.file("xl/worksheets/_rels/sheet1.xml.rels",` `);{let d='';if(e.opts._type===et.BUBBLE||e.opts._type===et.BUBBLE3D)d+=``;else if(e.opts._type===et.SCATTER)d+=``;else if(u){let A=r.length;r[0].labels.forEach(h=>A+=h.filter(f=>f&&f!=="").length),d+=``,d+=""}else{const A=r.length+r[0].labels.length*r[0].labels[0].length+r[0].labels.length,h=r.length+r[0].labels.length*r[0].labels[0].length+1;d+=``,d+=''}e.opts._type===et.BUBBLE||e.opts._type===et.BUBBLE3D?r.forEach((A,h)=>{h===0?d+="X-Axis":(d+=`${sr(A.name||`Y-Axis${h}`)}`,d+=`${sr(`Size${h}`)}`)}):r.forEach(A=>{d+=`${sr((A.name||" ").replace("X-Axis","X-Values"))}`}),e.opts._type!==et.BUBBLE&&e.opts._type!==et.BUBBLE3D&&e.opts._type!==et.SCATTER&&r[0].labels.slice().reverse().forEach(A=>{A.filter(h=>h&&h!=="").forEach(h=>{d+=`${sr(h)}`})}),d+=` `,l.file("xl/sharedStrings.xml",d)}{let d='';if(e.opts._type===et.BUBBLE||e.opts._type===et.BUBBLE3D){d+=``,d+=``;let A=1;r.forEach((h,f)=>{f===0?d+=``:(d+=``,A++,d+=``)})}else e.opts._type===et.SCATTER?(d+=`
`,d+=``,r.forEach((A,h)=>{d+=``})):(d+=`
`,d+=``,r[0].labels.forEach((A,h)=>{d+=``}),r.forEach((A,h)=>{d+=``}));d+="",d+='',d+="
",l.file("xl/tables/table1.xml",d)}{let d='';if(d+='',e.opts._type===et.BUBBLE||e.opts._type===et.BUBBLE3D?d+=``:e.opts._type===et.SCATTER?d+=``:d+=``,d+='',d+='',e.opts._type===et.BUBBLE||e.opts._type===et.BUBBLE3D){d+="",d+=``,d+='0';for(let A=1;A${A}`;d+="",r[0].values.forEach((A,h)=>{d+=``,d+=`${A}`;let f=2;for(let m=1;m${r[m].values[h]||""}`,f++,d+=`${r[m].sizes[h]||""}`,f++;d+=""})}else if(e.opts._type===et.SCATTER){d+="",d+=``;for(let A=0;A${A}`;d+="",r[0].values.forEach((A,h)=>{d+=``,d+=`${A}`;for(let f=1;f${r[f].values[h]||r[f].values[h]===0?r[f].values[h]:""}`;d+=""})}else if(d+="",u){d+=``;for(let m=0;m0`;for(let m=r[0].labels.length-1;m${m}`;d+="";const A=r.length,h=r[0].labels[0].length,f=r[0].labels.length;for(let m=0;m`;let p=A;const g=r[0].labels.slice().reverse();g.forEach((v,x)=>{if(v[m]){const b=x===0?1:g[x-1].filter(C=>C&&C!=="").length;p+=b,d+=`${p}`}});for(let v=0;v${r[v].values[m]||0}`;d+=""}}else{d+=``,r[0].labels.forEach((A,h)=>{d+=`0`});for(let A=0;A${A+1}`;d+="",r[0].labels[0].forEach((A,h)=>{d+=``;for(let f=r[0].labels.length-1;f>=0;f--)d+=``,d+=`${r.length+h+1}`,d+="";for(let f=0;f${r[f].values[h]||""}`;d+=""})}d+="",d+='',d+=` `,l.file("xl/worksheets/sheet1.xml",d)}l.generateAsync({type:"base64"}).then(d=>{t.file(`ppt/embeddings/Microsoft_Excel_Worksheet${e.globalId}.xlsx`,d,{base64:!0}),t.file("ppt/charts/_rels/"+e.fileName+".rels",``),t.file(`ppt/charts/${e.fileName}`,G1t(e)),n("")}).catch(d=>{i(d)})})})}function G1t(e){var t,r,n,i;let s='',o=!1;if(s+='',s+='',s+=``,s+="",e.opts.showTitle?(s+=tT({title:e.opts.title||"Chart Title",color:e.opts.titleColor,fontFace:e.opts.titleFontFace,fontSize:e.opts.titleFontSize||T1t,titleAlign:e.opts.titleAlign,titleBold:e.opts.titleBold,titlePos:e.opts.titlePos,titleRotate:e.opts.titleRotate},e.opts.x,e.opts.y),s+=''):s+='',e.opts._type===et.BAR3D&&(s+=``),s+="",e.opts.layout?(s+="",s+=" ",s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=' ',s+=" ",s+=""):s+="",Array.isArray(e.opts._type)?e.opts._type.forEach(l=>{const c=Object.assign(Object.assign({},e.opts),l.options),u=c.secondaryValAxis?dB:nA,d=c.secondaryCatAxis?cR:kw;o=o||c.secondaryValAxis,s+=IJ(l.type,l.data,c,u,d)}):s+=IJ(e.opts._type,e.data,e.opts,nA,kw),e.opts._type!==et.PIE&&e.opts._type!==et.DOUGHNUT){if(e.opts.valAxes&&e.opts.valAxes.length>1&&!o)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.");s+=tO(Object.assign(Object.assign({},e.opts),e.opts.catAxes[0]),kw,nA)}else s+=tO(e.opts,kw,nA);e.opts.valAxes?(s+=rO(Object.assign(Object.assign({},e.opts),e.opts.valAxes[0]),nA),e.opts.valAxes[1]&&(s+=rO(Object.assign(Object.assign({},e.opts),e.opts.valAxes[1]),dB))):(s+=rO(e.opts,nA),e.opts._type===et.BAR3D&&(s+=K1t(e.opts,dve,nA))),!((t=e.opts)===null||t===void 0)&&t.catAxes&&(!((r=e.opts)===null||r===void 0)&&r.catAxes[1])&&(s+=tO(Object.assign(Object.assign({},e.opts),e.opts.catAxes[1]),cR,dB))}return e.opts.showDataTable&&(s+="",s+=` `,s+=` `,s+=` `,s+=` `,s+=" ",s+=" ",s+=' ',s+=" ",s+=" ",s+=" ",s+=' ',s+=" ",s+=" ",s+=' ',s+=` `,s+=' ',s+=' ',s+=' ',s+=' ',s+=" ",s+=" ",s+=' ',s+=" ",s+=" ",s+=""),s+=" ",s+=!((n=e.opts.plotArea.fill)===null||n===void 0)&&n.color?dl(e.opts.plotArea.fill):"",s+=e.opts.plotArea.border?`${dl(e.opts.plotArea.border.color)}`:"",s+=" ",s+=" ",s+="",e.opts.showLegend&&(s+="",s+='',s+='',(e.opts.legendFontFace||e.opts.legendFontSize||e.opts.legendColor)&&(s+="",s+=" ",s+=" ",s+=" ",s+=" ",s+=e.opts.legendFontSize?``:"",e.opts.legendColor&&(s+=dl(e.opts.legendColor)),e.opts.legendFontFace&&(s+=''),e.opts.legendFontFace&&(s+=''),s+=" ",s+=" ",s+=' ',s+=" ",s+=""),s+=""),s+=' ',s+=' ',e.opts._type===et.SCATTER&&(s+=''),s+="",s+="",s+=!((i=e.opts.chartArea.fill)===null||i===void 0)&&i.color?dl(e.opts.chartArea.fill):"",s+=e.opts.chartArea.border?`${dl(e.opts.chartArea.border.color)}`:"",s+=" ",s+="",s+='',s+="",s}function IJ(e,t,r,n,i,s){let o=-1,l=1,c=null,u="";switch(e){case et.AREA:case et.BAR:case et.BAR3D:case et.LINE:case et.RADAR:u+=``,e===et.AREA&&r.barGrouping==="stacked"&&(u+=''),(e===et.BAR||e===et.BAR3D)&&(u+='',u+=''),e===et.RADAR&&(u+=''),u+='',t.forEach(d=>{var A;o++,u+="",u+=` `,u+=" ",u+=" ",u+=" Sheet1!$"+pn(d._dataIndex+d.labels.length+1)+"$1",u+=' '+sr(d.name)+"",u+=" ",u+=" ";const h=r.chartColors?r.chartColors[o%r.chartColors.length]:null;u+=" ",h==="transparent"?u+="":r.chartColorsOpacity?u+=""+Yr(h,``)+"":u+=""+Yr(h)+"",e===et.LINE||e===et.RADAR?r.lineSize===0?u+="":(u+=`${Yr(h)}`,u+=''):r.dataBorder&&(u+=`${Yr(r.dataBorder.color)}`),u+=Up(r.shadow,Rp),u+=" ",u+=' ',e!==et.RADAR&&(u+="",u+=``,r.dataLabelBkgrdColors&&(u+=`${Yr(h)}`),u+="",u+=``,u+=`${Yr(r.dataLabelColor||Eo)}`,u+=``,u+="",r.dataLabelPosition&&(u+=``),u+='',u+=``,u+=``,u+=``,u+=""),(e===et.LINE||e===et.RADAR)&&(u+="",u+=' ',r.lineDataSymbolSize&&(u+=``),u+=" ",u+=` ${Yr(r.chartColors[d._dataIndex+1>r.chartColors.length?Math.floor(Math.random()*r.chartColors.length):d._dataIndex])}`,u+=` ${Yr(r.lineDataSymbolLineColor||h)}`,u+=" ",u+=" ",u+=""),(e===et.BAR||e===et.BAR3D)&&t.length===1&&(r.chartColors&&r.chartColors!==Ew&&r.chartColors.length>1||!((A=r.invertedColors)===null||A===void 0)&&A.length)&&d.values.forEach((f,m)=>{const p=f<0?r.invertedColors||r.chartColors||Ew:r.chartColors||[];u+=" ",u+=` `,u+=' ',u+=' ',u+=" ",r.lineSize===0?u+="":e===et.BAR?(u+="",u+=' ',u+=""):(u+="",u+=" ",u+=' ',u+=" ",u+=""),u+=Up(r.shadow,Rp),u+=" ",u+=" "}),u+="",r.catLabelFormatCode?(u+=" ",u+=` Sheet1!$A$2:$A$${d.labels[0].length+1}`,u+=" ",u+=" "+(r.catLabelFormatCode||"General")+"",u+=` `,d.labels[0].forEach((f,m)=>u+=`${sr(f)}`),u+=" ",u+=" "):(u+=" ",u+=` Sheet1!$A$2:$${pn(d.labels.length)}$${d.labels[0].length+1}`,u+=" ",u+=` `,d.labels.forEach(f=>{u+="",f.forEach((m,p)=>u+=`${sr(m)}`),u+=""}),u+=" ",u+=" "),u+="",u+="",u+=" ",u+=`Sheet1!$${pn(d._dataIndex+d.labels.length+1)}$2:$${pn(d._dataIndex+d.labels.length+1)}$${d.labels[0].length+1}`,u+=" ",u+=" "+(r.valLabelFormatCode||r.dataTableFormatCode||"General")+"",u+=` `,d.values.forEach((f,m)=>u+=`${f||f===0?f:""}`),u+=" ",u+=" ",u+="",e===et.LINE&&(u+=''),u+=""}),u+=" ",u+=` `,u+=" ",u+=" ",u+=" ",u+=" ",u+=` `,u+=" "+Yr(r.dataLabelColor||Eo)+"",u+=' ',u+=" ",u+=" ",u+=" ",r.dataLabelPosition&&(u+=' '),u+=' ',u+=' ',u+=' ',u+=' ',u+=' ',u+=' ',u+=` `,u+=" ",e===et.BAR?(u+=` `,u+=` `):e===et.BAR3D?(u+=` `,u+=` `,u+=' '):e===et.LINE&&(u+=' '),u+=``,u+=``;break;case et.SCATTER:u+="",u+='',u+='',o=-1,t.filter((d,A)=>A>0).forEach((d,A)=>{o++,u+="",u+=` `,u+=` `,u+=" ",u+=" ",u+=` Sheet1!$${pn(A+2)}$1`,u+=' '+sr(d.name)+"",u+=" ",u+=" ",u+=" ";{const h=r.chartColors[o%r.chartColors.length];h==="transparent"?u+="":r.chartColorsOpacity?u+=""+Yr(h,'')+"":u+=""+Yr(h)+"",r.lineSize===0?u+="":(u+=`${Yr(h)}`,u+=``),u+=Up(r.shadow,Rp)}if(u+=" ",u+="",u+=' ',r.lineDataSymbolSize&&(u+=``),u+="",u+=`${Yr(r.chartColors[A+1>r.chartColors.length?Math.floor(Math.random()*r.chartColors.length):A])}`,u+=`${Yr(r.lineDataSymbolLineColor||r.chartColors[o%r.chartColors.length])}`,u+="",u+="",u+="",r.showLabel){const h=AB("-xxxx-xxxx-xxxx-xxxxxxxxxxxx");d.labels[0]&&(r.dataLabelFormatScatter==="custom"||r.dataLabelFormatScatter==="customXY")&&(u+="",d.labels[0].forEach((f,m)=>{(r.dataLabelFormatScatter==="custom"||r.dataLabelFormatScatter==="customXY")&&(u+=" ",u+=` `,u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=' ',u+=" "+sr(f)+"",u+=" ",r.dataLabelFormatScatter==="customXY"&&!/^ *$/.test(f)&&(u+=" ",u+=' ',u+=" (",u+=" ",u+=' ',u+=' ',u+=" ",u+=" ",u+=" ",u+=" ["+sr(d.name)+"",u+=" ",u+=" ",u+=' ',u+=" , ",u+=" ",u+=' ',u+=' ',u+=" ",u+=" ",u+=" ",u+=" ["+sr(d.name)+"]",u+=" ",u+=" ",u+=' ',u+=" )",u+=" ",u+=' '),u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",r.dataLabelPosition&&(u+=' '),u+=' ',u+=' ',u+=' ',u+=' ',u+=' ',u+=' ',u+=' ',u+=" ",u+=' ',u+=' ',u+=` `,u+=" ",u+=" ",u+="")}),u+=""),r.dataLabelFormatScatter==="XY"&&(u+="",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=' ',u+=" ",u+=" ",r.dataLabelPosition&&(u+=' '),u+=' ',u+=` `,u+=` `,u+=` `,u+=' ',u+=' ',u+=" ",u+=' ',u+=' ',u+=" ",u+=" ",u+="")}t.length===1&&r.chartColors!==Ew&&d.values.forEach((h,f)=>{const m=h<0?r.invertedColors||r.chartColors||Ew:r.chartColors||[];u+=" ",u+=` `,u+=' ',u+=' ',u+=" ",r.lineSize===0?u+="":(u+="",u+=' ',u+=""),u+=Up(r.shadow,Rp),u+=" ",u+=" "}),u+="",u+=" ",u+=` Sheet1!$A$2:$A$${t[0].values.length+1}`,u+=" ",u+=" General",u+=` `,t[0].values.forEach((h,f)=>{u+=`${h||h===0?h:""}`}),u+=" ",u+=" ",u+="",u+="",u+=" ",u+=` Sheet1!$${pn(A+2)}$2:$${pn(A+2)}$${t[0].values.length+1}`,u+=" ",u+=" General",u+=` `,t[0].values.forEach((h,f)=>{u+=`${d.values[f]||d.values[f]===0?d.values[f]:""}`}),u+=" ",u+=" ",u+="",u+='',u+=""}),u+=" ",u+=` `,u+=" ",u+=" ",u+=" ",u+=" ",u+=` `,u+=" "+Yr(r.dataLabelColor||Eo)+"",u+=' ',u+=" ",u+=" ",u+=" ",r.dataLabelPosition&&(u+=' '),u+=' ',u+=' ',u+=' ',u+=' ',u+=' ',u+=' ',u+=" ",u+=``,u+="";break;case et.BUBBLE:case et.BUBBLE3D:u+="",u+='',o=-1,t.filter((d,A)=>A>0).forEach((d,A)=>{o++,u+="",u+=` `,u+=` `,u+=" ",u+=" ",u+=" Sheet1!$"+pn(l+1)+"$1",u+=' '+sr(d.name)+"",u+=" ",u+=" ";{u+="";const h=r.chartColors[o%r.chartColors.length];h==="transparent"?u+="":r.chartColorsOpacity?u+=`${Yr(h,'')}`:u+=""+Yr(h)+"",r.lineSize===0?u+="":r.dataBorder?u+=`${Yr(r.dataBorder.color)}`:(u+=`${Yr(h)}`,u+=``),u+=Up(r.shadow,Rp),u+=""}u+="",u+=" ",u+=` Sheet1!$A$2:$A$${t[0].values.length+1}`,u+=" ",u+=" General",u+=` `,t[0].values.forEach((h,f)=>{u+=`${h||h===0?h:""}`}),u+=" ",u+=" ",u+="",u+="",u+=" ",u+=`Sheet1!$${pn(l+1)}$2:$${pn(l+1)}$${t[0].values.length+1}`,l++,u+=" ",u+=" General",u+=` `,t[0].values.forEach((h,f)=>{u+=`${d.values[f]||d.values[f]===0?d.values[f]:""}`}),u+=" ",u+=" ",u+="",u+=" ",u+=" ",u+=`Sheet1!$${pn(l+1)}$2:$${pn(l+1)}$${d.sizes.length+1}`,l++,u+=" ",u+=" General",u+=` `,d.sizes.forEach((h,f)=>{u+=`${h||""}`}),u+=" ",u+=" ",u+=" ",u+=' ',u+=""}),u+="",u+=``,u+="",u+=``,u+=`${Yr(r.dataLabelColor||Eo)}`,u+=``,u+="",r.dataLabelPosition&&(u+=``),u+='',u+=``,u+=``,u+="",u+=' ',u+=' ',u+=" ",u+="",u+="",u+=``,u+="";break;case et.DOUGHNUT:case et.PIE:c=t[0],u+="",u+=' ',u+="",u+=' ',u+=' ',u+=" ",u+=" ",u+=" Sheet1!$B$1",u+=" ",u+=' ',u+=' '+sr(c.name)+"",u+=" ",u+=" ",u+=" ",u+=" ",u+=' ',u+=' ',r.dataNoEffects?u+="":u+=Up(r.shadow,Rp),u+=" ",c.labels[0].forEach((d,A)=>{u+="",u+=` `,u+=' ',u+=" ",u+=`${Yr(r.chartColors[A+1>r.chartColors.length?Math.floor(Math.random()*r.chartColors.length):A])}`,r.dataBorder&&(u+=`${Yr(r.dataBorder.color)}`),u+=Up(r.shadow,Rp),u+=" ",u+=""}),u+="",c.labels[0].forEach((d,A)=>{u+="",u+=` `,u+=` `,u+=" ",u+=" ",u+=" ",u+=` `,u+=" "+Yr(r.dataLabelColor||Eo)+"",u+=` `,u+=" ",u+=" ",u+=" ",e===et.PIE&&r.dataLabelPosition&&(u+=``),u+=' ',u+=' ',u+=' ',u+=' ',u+=' ',u+=' ',u+=" "}),u+=` `,u+=" ",u+=" ",u+=" ",u+=" ",u+=" ",u+=` `,u+=' ',u+=" ",u+=" ",u+=" ",u+=" ",u+=e===et.PIE?'':"",u+=' ',u+=' ',u+=' ',u+=' ',u+=' ',u+=' ',u+=` `,u+="",u+="",u+=" ",u+=` Sheet1!$A$2:$A$${c.labels[0].length+1}`,u+=" ",u+=` `,c.labels[0].forEach((d,A)=>{u+=`${sr(d)}`}),u+=" ",u+=" ",u+="",u+=" ",u+=" ",u+=` Sheet1!$B$2:$B$${c.labels[0].length+1}`,u+=" ",u+=` `,c.values.forEach((d,A)=>{u+=`${d||d===0?d:""}`}),u+=" ",u+=" ",u+=" ",u+=" ",u+=` `,e===et.DOUGHNUT&&(u+=``),u+="";break;default:u+="";break}return u}function tO(e,t,r){let n="";return e._type===et.SCATTER||e._type===et.BUBBLE||e._type===et.BUBBLE3D?n+="":n+="",n+=' ',n+=" ",n+='',(e.catAxisMaxVal||e.catAxisMaxVal===0)&&(n+=``),(e.catAxisMinVal||e.catAxisMinVal===0)&&(n+=``),n+="",n+=' ',n+=' ',n+=e.catGridLine.style!=="none"?j7(e.catGridLine):"",e.showCatAxisTitle&&(n+=tT({color:e.catAxisTitleColor,fontFace:e.catAxisTitleFontFace,fontSize:e.catAxisTitleFontSize,titleRotate:e.catAxisTitleRotate,title:e.catAxisTitle||"Axis Title"})),e._type===et.SCATTER||e._type===et.BUBBLE||e._type===et.BUBBLE3D?n+=' ':n+=' ',e._type===et.SCATTER?(n+=' ',n+=' ',n+=' '):(n+=' ',n+=' ',n+=' '),n+=" ",n+=` `,n+=e.catAxisLineShow?""+Yr(e.catAxisLineColor||vm.color)+"":"",n+=' ',n+=" ",n+=" ",n+=" ",n+=" ",e.catAxisLabelRotate?n+=``:n+="",n+=" ",n+=" ",n+=" ",n+=` `,n+=" "+Yr(e.catAxisLabelColor||Eo)+"",n+=' ',n+=" ",n+=" ",n+=' ',n+=" ",n+=" ",n+=' ',n+=` `,n+=' ',n+=' ',n+=` `,e.catAxisLabelFrequency&&(n+=' '),(e.catLabelFormatCode||e._type===et.SCATTER||e._type===et.BUBBLE||e._type===et.BUBBLE3D)&&(e.catLabelFormatCode&&(["catAxisBaseTimeUnit","catAxisMajorTimeUnit","catAxisMinorTimeUnit"].forEach(i=>{e[i]&&(typeof e[i]!="string"||!["days","months","years"].includes(e[i].toLowerCase()))&&(console.warn(`"${i}" must be one of: 'days','months','years' !`),e[i]=null)}),e.catAxisBaseTimeUnit&&(n+=''),e.catAxisMajorTimeUnit&&(n+=''),e.catAxisMinorTimeUnit&&(n+='')),e.catAxisMajorUnit&&(n+=``),e.catAxisMinorUnit&&(n+=``)),e._type===et.SCATTER||e._type===et.BUBBLE||e._type===et.BUBBLE3D?n+="":n+="",n}function rO(e,t){let r=t===nA?e.barDir==="col"?"l":"b":e.barDir!=="col"?"r":"t";t===dB&&(r="r");const n=t===nA?kw:cR;let i="";return i+="",i+=' ',i+=" ",e.valAxisLogScaleBase&&(i+=``),i+='',(e.valAxisMaxVal||e.valAxisMaxVal===0)&&(i+=``),(e.valAxisMinVal||e.valAxisMinVal===0)&&(i+=``),i+=" ",i+=` `,i+=' ',e.valGridLine.style!=="none"&&(i+=j7(e.valGridLine)),e.showValAxisTitle&&(i+=tT({color:e.valAxisTitleColor,fontFace:e.valAxisTitleFontFace,fontSize:e.valAxisTitleFontSize,titleRotate:e.valAxisTitleRotate,title:e.valAxisTitle||"Axis Title"})),i+=``,e._type===et.SCATTER?(i+=' ',i+=' ',i+=' '):(i+=' ',i+=' ',i+=' '),i+=" ",i+=` `,i+=e.valAxisLineShow?""+Yr(e.valAxisLineColor||vm.color)+"":"",i+=' ',i+=" ",i+=" ",i+=" ",i+=" ",i+=` `,i+=" ",i+=" ",i+=" ",i+=` `,i+=" "+Yr(e.valAxisLabelColor||Eo)+"",i+=' ',i+=" ",i+=" ",i+=' ',i+=" ",i+=" ",i+=' ',typeof e.catAxisCrossesAt=="number"?i+=` `:typeof e.catAxisCrossesAt=="string"?i+=' ':i+=' ',i+=' ',e.valAxisMajorUnit&&(i+=` `),e.valAxisDisplayUnit&&(i+=`${e.valAxisDisplayUnitLabel?"":""}`),i+="",i}function K1t(e,t,r){let n="";return n+="",n+=' ',n+=' ',n+=' ',n+=' ',n+=e.serGridLine.style!=="none"?j7(e.serGridLine):"",e.showSerAxisTitle&&(n+=tT({color:e.serAxisTitleColor,fontFace:e.serAxisTitleFontFace,fontSize:e.serAxisTitleFontSize,titleRotate:e.serAxisTitleRotate,title:e.serAxisTitle||"Axis Title"})),n+=` `,n+=' ',n+=' ',n+=` `,n+=" ",n+=' ',n+=e.serAxisLineShow?`${Yr(e.serAxisLineColor||vm.color)}`:"",n+=' ',n+=" ",n+=" ",n+=" ",n+=" ",n+=" ",n+=" ",n+=" ",n+=" ",n+=` `,n+=` ${Yr(e.serAxisLabelColor||Eo)}`,n+=` `,n+=" ",n+=" ",n+=' ',n+=" ",n+=" ",n+=' ',n+=' ',e.serAxisLabelFrequency&&(n+=' '),e.serLabelFormatCode&&(["serAxisBaseTimeUnit","serAxisMajorTimeUnit","serAxisMinorTimeUnit"].forEach(i=>{e[i]&&(typeof e[i]!="string"||!["days","months","years"].includes(i.toLowerCase()))&&(console.warn(`"${i}" must be one of: 'days','months','years' !`),e[i]=null)}),e.serAxisBaseTimeUnit&&(n+=` `),e.serAxisMajorTimeUnit&&(n+=` `),e.serAxisMinorTimeUnit&&(n+=` `),e.serAxisMajorUnit&&(n+=` `),e.serAxisMinorUnit&&(n+=` `)),n+="",n}function tT(e,t,r){const n=e.titleAlign==="left"||e.titleAlign==="right"?``:"",i=e.titleRotate?``:"",s=e.fontSize?`sz="${Math.round(e.fontSize*100)}"`:"",o=e.titleBold?1:0;let l="";if(e.titlePos&&typeof e.titlePos.x=="number"&&typeof e.titlePos.y=="number"){const c=e.titlePos.x+t,u=e.titlePos.y+r;let d=c===0?0:c*(c/5)/10;d>=1&&(d=d/10),d>=.1&&(d=d/10);let A=u===0?0:u*(u/5)/10;A>=1&&(A=A/10),A>=.1&&(A=A/10),l=``}return` ${i} ${n} ${Yr(e.color||Eo)} ${Yr(e.color||Eo)} ${sr(e.title)||""} ${l} `}function pn(e){let t="";const r=e-1;return r<=25?t=iw[r]:t=`${iw[Math.floor(r/iw.length-1)]}${iw[r%iw.length]}`,t}function Up(e,t){if(e){if(typeof e!="object")return console.warn("`shadow` options must be an object. Ex: `{shadow: {type:'none'}}`"),""}else return"";let r="";const n=Object.assign(Object.assign({},t),e),i=n.type||"outer",s=er(n.blur),o=er(n.offset),l=Math.round(n.angle*6e4),c=n.color,u=Math.round(n.opacity*1e5),d=n.rotateWithShape?1:0;return r+=``,r+=``,r+=``,r+=``,r+="",r}function j7(e){let t="";return t+=" ",t+=` `,t+=' ',t+=' ',t+=" ",t+=" ",t+="",t}function fB(e){if(!e||e==="flat")return"flat";if(e==="square")return"sq";if(e==="round")return"rnd";{const t=e;throw new Error(`Invalid chart line cap: ${t}`)}}function nO(e){var t,r;const n=typeof process<"u"&&!!(!((t=process.versions)===null||t===void 0)&&t.node)&&((r=process.release)===null||r===void 0?void 0:r.name)==="node";let i,s;const o=n?()=>ol(this,void 0,void 0,function*(){({default:i}=yield lc(()=>import("./__vite-browser-external-BIHI7g3E.js"),[])),{default:s}=yield lc(()=>import("./__vite-browser-external-BIHI7g3E.js"),[])}):()=>ol(this,void 0,void 0,function*(){});n&&o();const l=[],c=e._relsMedia.filter(d=>d.type!=="online"&&!d.data&&(!d.path||d.path&&!d.path.includes("preencoded"))),u=[];return c.forEach(d=>{u.includes(d.path)?d.isDuplicate=!0:(d.isDuplicate=!1,u.push(d.path))}),c.filter(d=>!d.isDuplicate).forEach(d=>{l.push(ol(this,void 0,void 0,function*(){if(s||(yield o()),n&&i&&d.path.indexOf("http")!==0)try{const A=i.readFileSync(d.path);return d.data=Buffer.from(A).toString("base64"),c.filter(h=>h.isDuplicate&&h.path===d.path).forEach(h=>h.data=d.data),"done"}catch(A){throw d.data=Cx,c.filter(h=>h.isDuplicate&&h.path===d.path).forEach(h=>h.data=d.data),new Error(`ERROR: Unable to read media: "${d.path}" ${String(A)}`)}return n&&s&&d.path.startsWith("http")?yield new Promise((A,h)=>{s.get(d.path,f=>{let m="";f.setEncoding("binary"),f.on("data",p=>m+=p),f.on("end",()=>{d.data=Buffer.from(m,"binary").toString("base64"),c.filter(p=>p.isDuplicate&&p.path===d.path).forEach(p=>p.data=d.data),A("done")}),f.on("error",()=>{d.data=Cx,c.filter(p=>p.isDuplicate&&p.path===d.path).forEach(p=>p.data=d.data),h(new Error(`ERROR! Unable to load image (https.get): ${d.path}`))})})}):yield new Promise((A,h)=>{const f=new XMLHttpRequest;f.onload=()=>{const m=new FileReader;m.onloadend=()=>{d.data=m.result,c.filter(p=>p.isDuplicate&&p.path===d.path).forEach(p=>p.data=d.data),d.isSvgPng?OJ(d).then(()=>A("done")).catch(h):A("done")},m.readAsDataURL(f.response)},f.onerror=()=>{d.data=Cx,c.filter(m=>m.isDuplicate&&m.path===d.path).forEach(m=>m.data=d.data),h(new Error(`ERROR! Unable to load image (xhr.onerror): ${d.path}`))},f.open("GET",d.path),f.responseType="blob",f.send()})}))}),e._relsMedia.filter(d=>d.isSvgPng&&d.data).forEach(d=>{ol(this,void 0,void 0,function*(){n&&!i&&(yield o()),n&&i?(d.data=Cx,l.push(Promise.resolve("done"))):l.push(OJ(d))})}),l}function OJ(e){return ol(this,void 0,void 0,function*(){return yield new Promise((t,r)=>{const n=new Image;n.onload=()=>{n.width+n.height===0&&n.onerror("h/w=0");let i=document.createElement("CANVAS");const s=i.getContext("2d");i.width=n.width,i.height=n.height,s.drawImage(n,0,0);try{e.data=i.toDataURL(e.type),t("done")}catch(o){n.onerror(o.toString())}i=null},n.onerror=()=>{e.data=Cx,r(new Error(`ERROR! Unable to load image (image.onerror): ${e.path}`))},n.src=typeof e.data=="string"?e.data:Cx})})}const V1t={cover:function(e,t){const r=e.h/e.w,i=t.h/t.w>r,s=i?t.h/r:t.w,o=i?t.h:t.w*r,l=Math.round(1e5*.5*(1-t.w/s)),c=Math.round(1e5*.5*(1-t.h/o));return``},contain:function(e,t){const r=e.h/e.w,i=t.h/t.w>r,s=i?t.w:t.h/r,o=i?t.w*r:t.h,l=Math.round(1e5*.5*(1-t.w/s)),c=Math.round(1e5*.5*(1-t.h/o));return``},crop:function(e,t){const r=t.x,n=e.w-(t.x+t.w),i=t.y,s=e.h-(t.y+t.h),o=Math.round(1e5*(r/e.w)),l=Math.round(1e5*(n/e.w)),c=Math.round(1e5*(i/e.h)),u=Math.round(1e5*(s/e.h));return``}};function S7(e){var t;let r=e._name?'':"",n=1;return e._bkgdImgRid?r+=``:!((t=e.background)===null||t===void 0)&&t.color?r+=`${dl(e.background)}`:!e.bkgd&&e._name&&e._name===lR&&(r+=''),r+="",r+='',r+='',r+='',e._slideObjects.forEach((i,s)=>{var o,l,c,u,d,A,h,f;let m=0,p=0,g=Nr("75%","X",e._presLayout),v=0,x,y="",b=null,C=null,j=0,S=0,T=null,B=null;const I=(o=i.options)===null||o===void 0?void 0:o.sizing,P=(l=i.options)===null||l===void 0?void 0:l.rounding;e._slideLayout!==void 0&&e._slideLayout._slideObjects!==void 0&&i.options&&i.options.placeholder&&(x=e._slideLayout._slideObjects.filter(_=>_.options.placeholder===i.options.placeholder)[0]),i.options=i.options||{},typeof i.options.x<"u"&&(m=Nr(i.options.x,"X",e._presLayout)),typeof i.options.y<"u"&&(p=Nr(i.options.y,"Y",e._presLayout)),typeof i.options.w<"u"&&(g=Nr(i.options.w,"X",e._presLayout)),typeof i.options.h<"u"&&(v=Nr(i.options.h,"Y",e._presLayout));let E=g,M=v;switch(x&&((x.options.x||x.options.x===0)&&(m=Nr(x.options.x,"X",e._presLayout)),(x.options.y||x.options.y===0)&&(p=Nr(x.options.y,"Y",e._presLayout)),(x.options.w||x.options.w===0)&&(g=Nr(x.options.w,"X",e._presLayout)),(x.options.h||x.options.h===0)&&(v=Nr(x.options.h,"Y",e._presLayout))),i.options.flipH&&(y+=' flipH="1"'),i.options.flipV&&(y+=' flipV="1"'),i.options.rotate&&(y+=` rot="${xm(i.options.rotate)}"`),i._type){case ar.table:if(b=i.arrTabRows,C=i.options,j=0,S=0,b[0].forEach(_=>{T=_.options||null,j+=T!=null&&T.colspan?Number(T.colspan):1}),B=``,B+=' ',B+=``,B+='',Array.isArray(C.colW)){B+="";for(let _=0;_`}B+=""}else{S=C.colW?C.colW:or,i.options.w&&!C.colW&&(S=Math.round((typeof i.options.w=="number"?i.options.w:1)/j)),B+="";for(let _=0;_`;B+=""}b.forEach(_=>{var R,G;for(let U=0;U<_.length;){const Q=_[U],z=(R=Q.options)===null||R===void 0?void 0:R.colspan,Y=(G=Q.options)===null||G===void 0?void 0:G.rowspan;if(z&&z>1){const $=new Array(z-1).fill(void 0).map(()=>({_type:ar.tablecell,options:{rowspan:Y},_hmerge:!0}));_.splice(U+1,0,...$),U+=z}else U+=1}}),b.forEach((_,R)=>{const G=b[R+1];G&&_.forEach((U,Q)=>{var z,Y;const $=U._rowContinue||((z=U.options)===null||z===void 0?void 0:z.rowspan),O=(Y=U.options)===null||Y===void 0?void 0:Y.colspan,W=U._hmerge;if($&&$>1){const V={_type:ar.tablecell,options:{colspan:O},_rowContinue:$-1,_vmerge:!0,_hmerge:W};G.splice(Q,0,V)}})}),b.forEach((_,R)=>{let G=0;Array.isArray(C.rowH)&&C.rowH[R]?G=Qr(Number(C.rowH[R])):C.rowH&&!isNaN(Number(C.rowH))?G=Qr(Number(C.rowH)):(i.options.cy||i.options.h)&&(G=Math.round((i.options.h?Qr(i.options.h):typeof i.options.cy=="number"?i.options.cy:1)/b.length)),B+=``,_.forEach(U=>{var Q,z,Y,$,O;const W=U,V={rowSpan:((Q=W.options)===null||Q===void 0?void 0:Q.rowspan)>1?W.options.rowspan:void 0,gridSpan:((z=W.options)===null||z===void 0?void 0:z.colspan)>1?W.options.colspan:void 0,vMerge:W._vmerge?1:void 0,hMerge:W._hmerge?1:void 0};let X=Object.keys(V).map(Se=>[Se,V[Se]]).filter(([,Se])=>!!Se).map(([Se,D])=>`${String(Se)}="${String(D)}"`).join(" ");if(X&&(X=" "+X),W._hmerge||W._vmerge){B+=``;return}const ne=W.options||{};W.options=ne,["align","bold","border","color","fill","fontFace","fontSize","margin","textDirection","underline","valign"].forEach(Se=>{C[Se]&&!ne[Se]&&ne[Se]!==0&&(ne[Se]=C[Se])});const oe=ne.valign?` anchor="${ne.valign.replace(/^c$/i,"ctr").replace(/^m$/i,"ctr").replace("center","ctr").replace("middle","ctr").replace("top","t").replace("btm","b").replace("bottom","b")}"`:"",pe=ne.textDirection&&ne.textDirection!=="horz"?` vert="${ne.textDirection}"`:"";let de=!(($=(Y=W._optImp)===null||Y===void 0?void 0:Y.fill)===null||$===void 0)&&$.color?W._optImp.fill.color:!((O=W._optImp)===null||O===void 0)&&O.fill&&typeof W._optImp.fill=="string"?W._optImp.fill:"";de=de||ne.fill?ne.fill:"";const ge=de?dl(de):"";let ie=ne.margin===0||ne.margin?ne.margin:cve;!Array.isArray(ie)&&typeof ie=="number"&&(ie=[ie,ie,ie,ie]);let ue="";ie[0]>=1?ue=` marL="${er(ie[3])}" marR="${er(ie[1])}" marT="${er(ie[0])}" marB="${er(ie[2])}"`:ue=` marL="${Qr(ie[3])}" marR="${Qr(ie[1])}" marT="${Qr(ie[0])}" marB="${Qr(ie[2])}"`,B+=`${LJ(W)}`,ne.border&&Array.isArray(ne.border)&&[{idx:3,name:"lnL"},{idx:1,name:"lnR"},{idx:0,name:"lnT"},{idx:2,name:"lnB"}].forEach(Se=>{ne.border[Se.idx].type!=="none"?(B+=``,B+=`${Yr(ne.border[Se.idx].color)}`,B+=``,B+=``):B+=``}),B+=ge,B+=" ",B+=" "}),B+=""}),B+=" ",B+=" ",B+=" ",B+="",r+=B,n++;break;case ar.text:case ar.placeholder:if(!i.options.line&&v===0&&(v=or*.3),i.options._bodyProp||(i.options._bodyProp={}),i.options.margin&&Array.isArray(i.options.margin)?(i.options._bodyProp.lIns=er(i.options.margin[0]||0),i.options._bodyProp.rIns=er(i.options.margin[1]||0),i.options._bodyProp.bIns=er(i.options.margin[2]||0),i.options._bodyProp.tIns=er(i.options.margin[3]||0)):typeof i.options.margin=="number"&&(i.options._bodyProp.lIns=er(i.options.margin),i.options._bodyProp.rIns=er(i.options.margin),i.options._bodyProp.bIns=er(i.options.margin),i.options._bodyProp.tIns=er(i.options.margin)),r+="",r+=``,!((c=i.options.hyperlink)===null||c===void 0)&&c.url&&(r+=``),!((u=i.options.hyperlink)===null||u===void 0)&&u.slide&&(r+=``),r+="",r+="':"/>"),r+=`${i._type==="placeholder"?yS(i):yS(x)}`,r+="",r+=``,r+=``,r+=``,i.shape==="custGeom")r+="",r+="",r+="",r+="",r+="",r+="",r+='',r+="",r+=``,(A=i.options.points)===null||A===void 0||A.forEach((_,R)=>{if("curve"in _)switch(_.curve.type){case"arc":r+=``;break;case"cubic":r+=` `;break;case"quadratic":r+=` `;break}else"close"in _?r+="":_.moveTo||R===0?r+=``:r+=``}),r+="",r+="",r+="";else{if(r+='',i.options.rectRadius)r+=``;else if(i.options.angleRange){for(let _=0;_<2;_++){const R=i.options.angleRange[_];r+=``}i.options.arcThicknessRatio&&(r+=``)}r+=""}r+=i.options.fill?dl(i.options.fill):"",i.options.line&&(r+=i.options.line.width?``:"",i.options.line.color&&(r+=dl(i.options.line)),i.options.line.dashType&&(r+=``),i.options.line.beginArrowType&&(r+=``),i.options.line.endArrowType&&(r+=``),r+=""),i.options.shadow&&i.options.shadow.type!=="none"&&(i.options.shadow.type=i.options.shadow.type||"outer",i.options.shadow.blur=er(i.options.shadow.blur||8),i.options.shadow.offset=er(i.options.shadow.offset||4),i.options.shadow.angle=Math.round((i.options.shadow.angle||270)*6e4),i.options.shadow.opacity=Math.round((i.options.shadow.opacity||.75)*1e5),i.options.shadow.color=i.options.shadow.color||PJ.color,r+="",r+=` `,r+=` `,r+=` `,r+=" ",r+=""),r+="",r+=LJ(i),r+="";break;case ar.image:if(r+="",r+=" ",r+=``,!((h=i.hyperlink)===null||h===void 0)&&h.url&&(r+=``),!((f=i.hyperlink)===null||f===void 0)&&f.slide&&(r+=``),r+=" ",r+=' ',r+=" "+yS(x)+"",r+=" ",r+="",(e._relsMedia||[]).filter(_=>_.rId===i.imageRid)[0]&&(e._relsMedia||[]).filter(_=>_.rId===i.imageRid)[0].extn==="svg"?(r+=``,r+=i.options.transparency?` `:"",r+=" ",r+=' ',r+=` `,r+=" ",r+=" ",r+=""):(r+=``,r+=i.options.transparency?``:"",r+=""),I!=null&&I.type){const _=I.w?Nr(I.w,"X",e._presLayout):g,R=I.h?Nr(I.h,"Y",e._presLayout):v,G=Nr(I.x||0,"X",e._presLayout),U=Nr(I.y||0,"Y",e._presLayout);r+=V1t[I.type]({w:E,h:M},{w:_,h:R,x:G,y:U}),E=_,M=R}else r+=" ";r+="",r+="",r+=" ",r+=` `,r+=` `,r+=" ",r+=` `,i.options.shadow&&i.options.shadow.type!=="none"&&(i.options.shadow.type=i.options.shadow.type||"outer",i.options.shadow.blur=er(i.options.shadow.blur||8),i.options.shadow.offset=er(i.options.shadow.offset||4),i.options.shadow.angle=Math.round((i.options.shadow.angle||270)*6e4),i.options.shadow.opacity=Math.round((i.options.shadow.opacity||.75)*1e5),i.options.shadow.color=i.options.shadow.color||PJ.color,r+="",r+=``,r+=``,r+=``,r+=``,r+=""),r+="",r+="";break;case ar.media:i.mtype==="online"?(r+="",r+=" ",r+=``,r+=" ",r+=" ",r+=` `,r+=" ",r+=" ",r+=` `,r+=" ",r+=` `,r+=' ',r+=" ",r+=""):(r+="",r+=" ",r+=``,r+=' ',r+=" ",r+=` `,r+=" ",r+=' ',r+=` `,r+=" ",r+=" ",r+=" ",r+=" ",r+=` `,r+=" ",r+=` `,r+=' ',r+=" ",r+="");break;case ar.chart:r+="",r+=" ",r+=` `,r+=" ",r+=` ${yS(x)}`,r+=" ",r+=` `,r+=' ',r+=' ',r+=` `,r+=" ",r+=" ",r+="";break;default:r+="";break}}),e._slideNumberProps&&(e._slideNumberProps.align||(e._slideNumberProps.align="left"),r+="",r+=" ",r+=' ',r+=' ',r+=" ",r+=" ",r+=` `,r+="",r+="`,e._slideNumberProps.color&&(r+=dl(e._slideNumberProps.color)),e._slideNumberProps.fontFace&&(r+=``),r+=""),r+="",r+="",e._slideNumberProps.align.startsWith("l")?r+='':e._slideNumberProps.align.startsWith("c")?r+='':e._slideNumberProps.align.startsWith("r")?r+='':r+='',r+=``,r+=`${e._slideNum}`,r+=""),r+="",r+="",r}function B7(e,t){let r=0,n=''+Ws+'';return e._rels.forEach(i=>{r=Math.max(r,i.rId),i.type.toLowerCase().includes("hyperlink")?i.data==="slide"?n+=``:n+=``:i.type.toLowerCase().includes("notesSlide")&&(n+=``)}),(e._relsChart||[]).forEach(i=>{r=Math.max(r,i.rId),n+=``}),(e._relsMedia||[]).forEach(i=>{const s=i.rId.toString();r=Math.max(r,i.rId),i.type.toLowerCase().includes("image")?n+='':i.type.toLowerCase().includes("audio")?n.includes(' Target="'+i.Target+'"')?n+='':n+='':i.type.toLowerCase().includes("video")?n.includes(' Target="'+i.Target+'"')?n+='':n+='':i.type.toLowerCase().includes("online")&&(n.includes(' Target="'+i.Target+'"')?n+='':n+='')}),t.forEach((i,s)=>{n+=``}),n+="",n}function FJ(e,t){var r,n;let i="",s="",o="",l="";const c=t?"a:lvl1pPr":"a:pPr";let u=er(E1t),d=`<${c}${e.options.rtlMode?' rtl="1" ':""}`;{if(e.options.align)switch(e.options.align){case"left":d+=' algn="l"';break;case"right":d+=' algn="r"';break;case"center":d+=' algn="ctr"';break;case"justify":d+=' algn="just"';break;default:d+="";break}if(e.options.lineSpacing?s=``:e.options.lineSpacingMultiple&&(s=``),e.options.indentLevel&&!isNaN(Number(e.options.indentLevel))&&e.options.indentLevel>0&&(d+=` lvl="${e.options.indentLevel}"`),e.options.paraSpaceBefore&&!isNaN(Number(e.options.paraSpaceBefore))&&e.options.paraSpaceBefore>0&&(o+=``),e.options.paraSpaceAfter&&!isNaN(Number(e.options.paraSpaceAfter))&&e.options.paraSpaceAfter>0&&(o+=``),typeof e.options.bullet=="object")if(!((n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.bullet)===null||n===void 0)&&n.indent&&(u=er(e.options.bullet.indent)),e.options.bullet.type)e.options.bullet.type.toString().toLowerCase()==="number"&&(d+=` marL="${e.options.indentLevel&&e.options.indentLevel>0?u+u*e.options.indentLevel:u}" indent="-${u}"`,i=``);else if(e.options.bullet.characterCode){let A=`&#x${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)`!"),A=wx.DEFAULT),d+=` marL="${e.options.indentLevel&&e.options.indentLevel>0?u+u*e.options.indentLevel:u}" indent="-${u}"`,i=''}else if(e.options.bullet.code){let A=`&#x${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)`!"),A=wx.DEFAULT),d+=` marL="${e.options.indentLevel&&e.options.indentLevel>0?u+u*e.options.indentLevel:u}" indent="-${u}"`,i=''}else d+=` marL="${e.options.indentLevel&&e.options.indentLevel>0?u+u*e.options.indentLevel:u}" indent="-${u}"`,i=``;else e.options.bullet?(d+=` marL="${e.options.indentLevel&&e.options.indentLevel>0?u+u*e.options.indentLevel:u}" indent="-${u}"`,i=``):e.options.bullet||(d+=' indent="0" marL="0"',i="");e.options.tabStops&&Array.isArray(e.options.tabStops)&&(l=`${e.options.tabStops.map(h=>``).join("")}`),d+=">"+s+o+i+l,t&&(d+=gve(e.options,!0)),d+=""}return d}function gve(e,t){var r;let n="";const i=t?"a:defRPr":"a:rPr";if(n+="<"+i+' lang="'+(e.lang?e.lang:"en-US")+'"'+(e.lang?' altLang="en-US"':""),n+=e.fontSize?` sz="${Math.round(e.fontSize*100)}"`:"",n+=e!=null&&e.bold?` b="${e.bold?"1":"0"}"`:"",n+=e!=null&&e.italic?` i="${e.italic?"1":"0"}"`:"",n+=e!=null&&e.strike?` strike="${typeof e.strike=="string"?e.strike:"sngStrike"}"`:"",typeof e.underline=="object"&&(!((r=e.underline)===null||r===void 0)&&r.style)?n+=` u="${e.underline.style}"`:typeof e.underline=="string"?n+=` u="${String(e.underline)}"`:e.hyperlink&&(n+=' u="sng"'),e.baseline?n+=` baseline="${Math.round(e.baseline*50)}"`:e.subscript?n+=' baseline="-40000"':e.superscript&&(n+=' baseline="30000"'),n+=e.charSpacing?` spc="${Math.round(e.charSpacing*100)}" kern="0"`:"",n+=' dirty="0">',(e.color||e.fontFace||e.outline||typeof e.underline=="object"&&e.underline.color)&&(e.outline&&typeof e.outline=="object"&&(n+=`${dl(e.outline.color||"FFFFFF")}`),e.color&&(n+=dl({color:e.color,transparency:e.transparency})),e.highlight&&(n+=`${Yr(e.highlight)}`),typeof e.underline=="object"&&e.underline.color&&(n+=`${dl(e.underline.color)}`),e.glow&&(n+=`${F1t(e.glow,P1t)}`),e.fontFace&&(n+=``)),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?n+=`":"/>"}`:e.hyperlink.slide&&(n+=`":"/>"}`),e.color&&(n+=" ",n+=' ',n+=' ',n+=" ",n+=" ",n+="")}return n+=``,n}function q1t(e){return e.text?`${gve(e.options,!1)}${sr(e.text)}`:""}function X1t(e){let t="":e.options.fit==="resize"&&(t+="")),e.options.shrinkText&&(t+=""),t+=e.options._bodyProp.autoFit?"":"",t+=""):(t+=' wrap="square" rtlCol="0">',t+=""),e._type===ar.tablecell?"":t}function LJ(e){const t=e.options||{};let r=[];const n=[];if(t&&e._type!==ar.tablecell&&(typeof e.text>"u"||e.text===null))return"";let i=e._type===ar.tablecell?"":"";i+=X1t(e),t.h===0&&t.line&&t.align?i+='':e._type==="placeholder"?i+=`${FJ(e,!0)}`:i+="",typeof e.text=="string"||typeof e.text=="number"?r.push({text:e.text.toString(),options:t||{}}):e.text&&!Array.isArray(e.text)&&typeof e.text=="object"&&Object.keys(e.text).includes("text")?r.push({text:e.text||"",options:e.options||{}}):Array.isArray(e.text)&&(r=e.text.map(l=>({text:l.text,options:l.options}))),r.forEach((l,c)=>{l.text||(l.text=""),l.options=l.options||t||{},c===0&&l.options&&!l.options.bullet&&t.bullet&&(l.options.bullet=t.bullet),(typeof l.text=="string"||typeof l.text=="number")&&(l.text=l.text.toString().replace(/\r*\n/g,Ws)),l.text.includes(Ws)&&l.text.match(/\n$/g)===null?l.text.split(Ws).forEach(u=>{l.options.breakLine=!0,n.push({text:u,options:l.options})}):n.push(l)});const s=[];let o=[];return n.forEach((l,c)=>{o.length>0&&(l.options.align||t.align)?l.options.align!==n[c-1].options.align&&(s.push(o),o=[]):o.length>0&&l.options.bullet&&o.length>0&&(s.push(o),o=[],l.options.breakLine=!1),o.push(l),o.length>0&&l.options.breakLine&&c+1{var c;let u=!1;i+="";let d=`{A.options._lineIdx=h,h>0&&A.options.softBreakBefore&&(i+=""),A.options.align=A.options.align||t.align,A.options.lineSpacing=A.options.lineSpacing||t.lineSpacing,A.options.lineSpacingMultiple=A.options.lineSpacingMultiple||t.lineSpacingMultiple,A.options.indentLevel=A.options.indentLevel||t.indentLevel,A.options.paraSpaceBefore=A.options.paraSpaceBefore||t.paraSpaceBefore,A.options.paraSpaceAfter=A.options.paraSpaceAfter||t.paraSpaceAfter,d=FJ(A,!1),i+=d.replace("",""),Object.entries(t).filter(([f])=>!(A.options.hyperlink&&f==="color")).forEach(([f,m])=>{f!=="bullet"&&!A.options[f]&&(A.options[f]=m)}),i+=q1t(A),(!A.text&&t.fontSize||A.options.fontSize)&&(u=!0,t.fontSize=t.fontSize||A.options.fontSize)}),e._type===ar.tablecell&&(t.fontSize||t.fontFace)?t.fontFace?(i+=`',i+=``,i+=``,i+=``,i+=""):i+=`':u?i+=`':i+=``,i+=""}),i.indexOf("")===-1&&(i+=""),i+=e._type===ar.tablecell?"":"",i}function yS(e){var t,r;if(!e)return"";const n=!((t=e.options)===null||t===void 0)&&t._placeholderIdx?e.options._placeholderIdx:"",i=!((r=e.options)===null||r===void 0)&&r._placeholderType?e.options._placeholderType:"",s=i&&g1[i]?g1[i].toString():"";return`0?' hasCustomPrompt="1"':""} />`}function Y1t(e,t,r){let n=''+Ws;return n+='',n+='',n+='',n+='',n+='',n+='',n+='',n+='',n+='',n+='',e.forEach(i=>{(i._relsMedia||[]).forEach(s=>{s.type!=="image"&&s.type!=="online"&&s.type!=="chart"&&s.extn!=="m4v"&&!n.includes(s.type)&&(n+='')})}),n+='',n+='',n+='',n+='',e.forEach((i,s)=>{n+=``,n+=``,i._relsChart.forEach(o=>{n+=``})}),n+='',n+='',n+='',n+='',t.forEach((i,s)=>{n+=``,(i._relsChart||[]).forEach(o=>{n+=' '})}),e.forEach((i,s)=>{n+=``}),r._relsChart.forEach(i=>{n+=' '}),r._relsMedia.forEach(i=>{i.type!=="image"&&i.type!=="online"&&i.type!=="chart"&&i.extn!=="m4v"&&!n.includes(i.type)&&(n+=' ')}),n+=' ',n+=' ',n+="",n}function J1t(){return`${Ws} `}function Z1t(e,t){return`${Ws} 0 0 Microsoft Office PowerPoint On-screen Show (16:9) 0 ${e.length} ${e.length} 0 0 false Fonts Used 2 Theme 1 Slide Titles ${e.length} Arial Calibri Office Theme ${e.map((r,n)=>`Slide ${n+1}`).join("")} ${t} false false false 16.0000 `}function e2t(e,t,r,n){return` ${sr(e)} ${sr(t)} ${sr(r)} ${sr(r)} ${n} ${new Date().toISOString().replace(/\.\d\d\dZ/,"Z")} ${new Date().toISOString().replace(/\.\d\d\dZ/,"Z")} `}function t2t(e){let t=1,r=''+Ws;r+='',r+='';for(let n=1;n<=e.length;n++)r+=``;return t++,r+=``,r}function r2t(e){return`${Ws}${S7(e)}`}function n2t(e){let t="";return e._slideObjects.forEach(r=>{r._type===ar.notes&&(t+=r!=null&&r.text&&r.text[0]?r.text[0].text:"")}),t.replace(/\r*\n/g,Ws)}function i2t(){return`${Ws}7/23/19Click to edit Master text stylesSecond levelThird levelFourth levelFifth level‹#›`}function s2t(e){return`${Ws}${sr(n2t(e))}${e._slideNum}`}function a2t(e){return` ${S7(e)} `}function o2t(e,t){const r=t.map((i,s)=>``);let n=''+Ws;return n+='',n+=S7(e),n+='',n+=""+r.join("")+"",n+='',n+=' ',n+="",n}function l2t(e,t){return B7(t[e-1],[{target:"../slideMasters/slideMaster1.xml",type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster"}])}function c2t(e,t,r){return B7(e[r-1],[{target:`../slideLayouts/slideLayout${f2t(e,t,r)}.xml`,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"},{target:`../notesSlides/notesSlide${r}.xml`,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide"}])}function u2t(e){return` `}function d2t(e,t){const r=t.map((n,i)=>({target:`../slideLayouts/slideLayout${i+1}.xml`,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"}));return r.push({target:"../theme/theme1.xml",type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"}),B7(e,r)}function A2t(){return`${Ws} `}function f2t(e,t,r){for(let n=0;n`:'',o=!((n=e.theme)===null||n===void 0)&&n.bodyFontFace?``:'';return`${s}${o}`}function p2t(e){let t=`${Ws}`;t+='',t+="",e.slides.forEach(r=>t+=``),t+="",t+=``,t+=``,t+=``,t+="";for(let r=1;r<10;r++)t+=``;return t+="",e.sections&&e.sections.length>0&&(t+='',t+='',e.sections.forEach(r=>{t+=``,r._slides.forEach(n=>t+=``),t+=""}),t+="",t+='',t+=""),t+="",t}function m2t(){return`${Ws}`}function g2t(){return`${Ws}`}function v2t(){return`${Ws}`}const x2t="4.0.1";class y2t{set layout(t){const r=this.LAYOUTS[t];if(r)this._layout=t,this._presLayout=r;else throw new Error("UNKNOWN-LAYOUT")}get layout(){return this._layout}get version(){return this._version}set author(t){this._author=t}get author(){return this._author}set company(t){this._company=t}get company(){return this._company}set revision(t){this._revision=t}get revision(){return this._revision}set subject(t){this._subject=t}get subject(){return this._subject}set theme(t){this._theme=t}get theme(){return this._theme}set title(t){this._title=t}get title(){return this._title}set rtlMode(t){this._rtlMode=t}get rtlMode(){return this._rtlMode}get masterSlide(){return this._masterSlide}get slides(){return this._slides}get sections(){return this._sections}get slideLayouts(){return this._slideLayouts}get AlignH(){return this._alignH}get AlignV(){return this._alignV}get ChartType(){return this._chartType}get OutputType(){return this._outputType}get presLayout(){return this._presLayout}get SchemeColor(){return this._schemeColor}get ShapeType(){return this._shapeType}get charts(){return this._charts}get colors(){return this._colors}get shapes(){return this._shapes}constructor(){this._version=x2t,this._alignH=fR,this._alignV=hR,this._chartType=dR,this._outputType=uR,this._schemeColor=il,this._shapeType=AR,this._charts=et,this._colors=b5,this._shapes=Kh,this.addNewSlide=s=>{const o=this.sections.length>0&&this.sections[this.sections.length-1]._slides.filter(l=>l._slideNum===this.slides[this.slides.length-1]._slideNum).length>0;return s.sectionTitle=o?this.sections[this.sections.length-1].title:null,this.addSlide(s)},this.getSlide=s=>this.slides.filter(o=>o._slideNum===s)[0],this.setSlideNumber=s=>{this.masterSlide._slideNumberProps=s,this.slideLayouts.filter(o=>o._name===lR)[0]._slideNumberProps=s},this.createChartMediaRels=(s,o,l)=>{s._relsChart.forEach(c=>l.push(W1t(c,o))),s._relsMedia.forEach(c=>{if(c.type!=="online"&&c.type!=="hyperlink"){let u=c.data&&typeof c.data=="string"?c.data:"";!u.includes(",")&&!u.includes(";")?u="image/png;base64,"+u:u.includes(",")?u.includes(";")||(u="image/png;"+u):u="image/png;base64,"+u,o.file(c.Target.replace("..","ppt"),u.split(",").pop(),{base64:!0})}})},this.writeFileToBrowser=(s,o)=>ol(this,void 0,void 0,function*(){const l=document.createElement("a");if(l.setAttribute("style","display:none;"),l.dataset.interception="off",document.body.appendChild(l),window.URL.createObjectURL){const c=window.URL.createObjectURL(new Blob([o],{type:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}));return l.href=c,l.download=s,l.click(),setTimeout(()=>{window.URL.revokeObjectURL(c),document.body.removeChild(l)},100),yield Promise.resolve(s)}}),this.exportPresentation=s=>ol(this,void 0,void 0,function*(){const o=[];let l=[];const c=new lve;return this.slides.forEach(u=>{l=l.concat(nO(u))}),this.slideLayouts.forEach(u=>{l=l.concat(nO(u))}),l=l.concat(nO(this.masterSlide)),yield Promise.all(l).then(()=>ol(this,void 0,void 0,function*(){return this.slides.forEach(u=>{u._slideLayout&&$1t(u)}),c.folder("_rels"),c.folder("docProps"),c.folder("ppt").folder("_rels"),c.folder("ppt/charts").folder("_rels"),c.folder("ppt/embeddings"),c.folder("ppt/media"),c.folder("ppt/slideLayouts").folder("_rels"),c.folder("ppt/slideMasters").folder("_rels"),c.folder("ppt/slides").folder("_rels"),c.folder("ppt/theme"),c.folder("ppt/notesMasters").folder("_rels"),c.folder("ppt/notesSlides").folder("_rels"),c.file("[Content_Types].xml",Y1t(this.slides,this.slideLayouts,this.masterSlide)),c.file("_rels/.rels",J1t()),c.file("docProps/app.xml",Z1t(this.slides,this.company)),c.file("docProps/core.xml",e2t(this.title,this.subject,this.author,this.revision)),c.file("ppt/_rels/presentation.xml.rels",t2t(this.slides)),c.file("ppt/theme/theme1.xml",h2t(this)),c.file("ppt/presentation.xml",p2t(this)),c.file("ppt/presProps.xml",m2t()),c.file("ppt/tableStyles.xml",g2t()),c.file("ppt/viewProps.xml",v2t()),this.slideLayouts.forEach((u,d)=>{c.file(`ppt/slideLayouts/slideLayout${d+1}.xml`,a2t(u)),c.file(`ppt/slideLayouts/_rels/slideLayout${d+1}.xml.rels`,l2t(d+1,this.slideLayouts))}),this.slides.forEach((u,d)=>{c.file(`ppt/slides/slide${d+1}.xml`,r2t(u)),c.file(`ppt/slides/_rels/slide${d+1}.xml.rels`,c2t(this.slides,this.slideLayouts,d+1)),c.file(`ppt/notesSlides/notesSlide${d+1}.xml`,s2t(u)),c.file(`ppt/notesSlides/_rels/notesSlide${d+1}.xml.rels`,u2t(d+1))}),c.file("ppt/slideMasters/slideMaster1.xml",o2t(this.masterSlide,this.slideLayouts)),c.file("ppt/slideMasters/_rels/slideMaster1.xml.rels",d2t(this.masterSlide,this.slideLayouts)),c.file("ppt/notesMasters/notesMaster1.xml",i2t()),c.file("ppt/notesMasters/_rels/notesMaster1.xml.rels",A2t()),this.slideLayouts.forEach(u=>{this.createChartMediaRels(u,c,o)}),this.slides.forEach(u=>{this.createChartMediaRels(u,c,o)}),this.createChartMediaRels(this.masterSlide,c,o),yield Promise.all(o).then(()=>ol(this,void 0,void 0,function*(){return s.outputType==="STREAM"?yield c.generateAsync({type:"nodebuffer",compression:s.compression?"DEFLATE":"STORE"}):s.outputType?yield c.generateAsync({type:s.outputType}):yield c.generateAsync({type:"blob",compression:s.compression?"DEFLATE":"STORE"})}))}))});const t={name:"screen4x3",width:9144e3,height:6858e3},r={name:"screen16x9",width:9144e3,height:5143500},n={name:"screen16x10",width:9144e3,height:5715e3},i={name:"custom",width:12192e3,height:6858e3};this.LAYOUTS={LAYOUT_4x3:t,LAYOUT_16x9:r,LAYOUT_16x10:n,LAYOUT_WIDE:i},this._author="PptxGenJS",this._company="PptxGenJS",this._revision="1",this._subject="PptxGenJS Presentation",this._title="PptxGenJS Presentation",this._presLayout={name:this.LAYOUTS[Qv].name,_sizeW:this.LAYOUTS[Qv].width,_sizeH:this.LAYOUTS[Qv].height,width:this.LAYOUTS[Qv].width,height:this.LAYOUTS[Qv].height},this._rtlMode=!1,this._slideLayouts=[{_margin:sC,_name:lR,_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:[]}}stream(t){return ol(this,void 0,void 0,function*(){return yield this.exportPresentation({compression:t==null?void 0:t.compression,outputType:"STREAM"})})}write(t){return ol(this,void 0,void 0,function*(){const r=typeof t=="object"&&(t!=null&&t.outputType)?t.outputType:t||null,n=typeof t=="object"&&(t!=null&&t.compression)?t.compression:!1;return yield this.exportPresentation({compression:n,outputType:r})})}writeFile(t){return ol(this,void 0,void 0,function*(){var r,n;const i=typeof process<"u"&&!!(!((r=process.versions)===null||r===void 0)&&r.node)&&((n=process.release)===null||n===void 0?void 0:n.name)==="node";typeof t=="string"&&(console.warn("[WARNING] writeFile(string) is deprecated - pass { fileName } instead."),t={fileName:t});const{fileName:s="Presentation.pptx",compression:o=!1}=t,l=s.toLowerCase().endsWith(".pptx")?s:`${s}.pptx`,c=i?"nodebuffer":null,u=yield this.exportPresentation({compression:o,outputType:c});if(i){const{promises:d}=yield lc(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]),{writeFile:A}=d;return yield A(l,u),l}return yield this.writeFileToBrowser(l,u),l})}addSection(t){t?t.title||console.warn("addSection requires a title"):console.warn("addSection requires an argument");const r={_type:"user",_slides:[],title:t.title};t.order?this.sections.splice(t.order,0,r):this._sections.push(r)}addSlide(t){const r=typeof t=="string"?t:t!=null&&t.masterName?t.masterName:"";let n={_name:this.LAYOUTS[Qv].name,_presLayout:this.presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slideNum:this.slides.length+1};if(r){const s=this.slideLayouts.filter(o=>o._name===r)[0];s&&(n=s)}const i=new z1t({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:n});if(this._slides.push(i),t!=null&&t.sectionTitle){const s=this.sections.filter(o=>o.title===t.sectionTitle)[0];s?s._slides.push(i):console.warn(`addSlide: unable to find section with title: "${t.sectionTitle}"`)}else if(this.sections&&this.sections.length>0&&!(t!=null&&t.sectionTitle)){const s=this._sections[this.sections.length-1];s._type==="default"?s._slides.push(i):this._sections.push({title:`Default-${this.sections.filter(o=>o._type==="default").length+1}`,_type:"default",_slides:[i]})}return i}defineLayout(t){t?t.name?t.width?t.height?typeof t.height!="number"?console.warn("defineLayout `height` should be a number (inches)"):typeof t.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[t.name]={name:t.name,_sizeW:Math.round(Number(t.width)*or),_sizeH:Math.round(Number(t.height)*or),width:Math.round(Number(t.width)*or),height:Math.round(Number(t.height)*or)}}defineSlideMaster(t){const r=JSON.parse(JSON.stringify(t));if(!r.title)throw new Error("defineSlideMaster() object argument requires a `title` value. (https://gitbrent.github.io/PptxGenJS/docs/masters.html)");const n={_margin:r.margin||sC,_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};R1t(r,n),this.slideLayouts.push(n),(r.background||r.bkgd)&&mve(r.background,n),n._slideNumberProps&&!this.masterSlide._slideNumberProps&&(this.masterSlide._slideNumberProps=n._slideNumberProps)}tableToSlides(t,r={}){M1t(this,t,r,r!=null&&r.masterSlideName?this.slideLayouts.filter(n=>n._name===r.masterSlideName)[0]:null)}}const b2t=[{id:"pitch-deck",name:"Pitch Deck",description:"Startup fundraising with bold stats & CTA",icon:ni,suggestedSlides:10,suggestedTheme:"startup",structureHint:"Include slides for: Problem, Solution, Market Size, Traction/Metrics, Business Model, Team, Competition, Financial Projections, The Ask/CTA. Use bold statistics and concise value propositions.",previewSlides:[{label:"TITLE",accent:!0},{label:"PROBLEM"},{label:"SOLUTION"},{label:"MARKET"},{label:"TRACTION",accent:!0},{label:"ASK"}],badge:"Popular"},{id:"business-report",name:"Business Report",description:"Corporate charts-and-data style",icon:ac,suggestedSlides:12,suggestedTheme:"corporate",structureHint:"Include slides for: Executive Summary, Key Metrics Dashboard, Performance Analysis, Quarterly Comparison, Trends & Insights, Recommendations, Next Steps. Use data-driven bullet points and structured sections.",previewSlides:[{label:"COVER",accent:!0},{label:"SUMMARY"},{label:"METRICS"},{label:"ANALYSIS",accent:!0},{label:"TRENDS"},{label:"NEXT"}]},{id:"educational",name:"Educational",description:"Clean academic with concept slides",icon:sre,suggestedSlides:10,suggestedTheme:"academic",structureHint:"Include slides for: Learning Objectives, Key Definitions, Core Concepts (multiple), Examples & Case Studies, Practice/Discussion Questions, Summary/Recap. Use clear headings and structured content hierarchy.",previewSlides:[{label:"INTRO",accent:!0},{label:"OBJECTIVES"},{label:"CONCEPT"},{label:"EXAMPLE"},{label:"PRACTICE",accent:!0},{label:"RECAP"}]},{id:"creative-portfolio",name:"Creative Portfolio",description:"Bold colors, image-heavy layouts",icon:Px,suggestedSlides:8,suggestedTheme:"creative",structureHint:"Include slides for: Hero/Title with tagline, About/Vision, Featured Work (multiple showcase slides), Process/Approach, Testimonials/Results, Contact/CTA. Use minimal text, bold statements, and visual-first layouts.",previewSlides:[{label:"HERO",accent:!0},{label:"ABOUT"},{label:"WORK"},{label:"WORK",accent:!0},{label:"RESULTS"},{label:"CTA"}]},{id:"sales-proposal",name:"Sales Proposal",description:"Problem/solution/pricing structure",icon:Vbe,suggestedSlides:10,suggestedTheme:"modern",structureHint:"Include slides for: Company Overview, Client Pain Points, Proposed Solution, Key Features/Benefits, Case Studies/Social Proof, Pricing Options, Implementation Timeline, ROI Projections, Next Steps. Use persuasive language and clear value propositions.",previewSlides:[{label:"INTRO",accent:!0},{label:"PAIN"},{label:"SOLUTION"},{label:"PROOF",accent:!0},{label:"PRICING"},{label:"NEXT"}],badge:"Popular"},{id:"team-meeting",name:"Team Meeting",description:"Agenda, updates, action items",icon:nu,suggestedSlides:8,suggestedTheme:"modern",structureHint:"Include slides for: Meeting Agenda, Last Meeting Recap, Status Updates (by team/project), Key Discussion Points, Blockers & Risks, Decisions Made, Action Items with Owners, Next Meeting Date. Use concise bullet points and clear ownership assignments.",previewSlides:[{label:"AGENDA",accent:!0},{label:"RECAP"},{label:"STATUS"},{label:"DISCUSS"},{label:"ACTIONS",accent:!0},{label:"CLOSE"}]},{id:"product-launch",name:"Product Launch",description:"Feature reveal, demo & pricing",icon:W5,suggestedSlides:10,suggestedTheme:"startup",structureHint:"Include slides for: Hero Announcement, The Problem We're Solving, Product Overview / Demo Walkthrough, Key Features (2-3 slides), Competitive Advantage, Pricing & Plans, Launch Timeline, Early Adopter Offer / CTA. Use exciting language, dramatic reveals, and strong visual hooks.",previewSlides:[{label:"LAUNCH",accent:!0},{label:"PROBLEM"},{label:"DEMO"},{label:"FEATURES",accent:!0},{label:"PRICING"},{label:"CTA"}],badge:"New"},{id:"case-study",name:"Case Study",description:"Challenge, approach & results",icon:ai,suggestedSlides:10,suggestedTheme:"corporate",structureHint:"Include slides for: Client Overview, The Challenge, Goals & Objectives, Our Approach / Strategy, Implementation Steps, Key Results & Metrics, Before vs After Comparison, Client Testimonial (quote slide), Key Takeaways, Contact / Next Steps. Use data-driven results and compelling storytelling.",previewSlides:[{label:"CLIENT",accent:!0},{label:"CHALLENGE"},{label:"APPROACH"},{label:"RESULTS",accent:!0},{label:"QUOTE"},{label:"CONTACT"}],badge:"New"},{id:"workshop",name:"Workshop",description:"Interactive agenda & exercises",icon:pc,suggestedSlides:12,suggestedTheme:"academic",structureHint:"Include slides for: Workshop Title & Facilitator, Agenda / Schedule, Ice Breaker Activity, Learning Objectives, Core Content Modules (2-3 slides), Hands-On Exercise Instructions, Group Discussion Prompts, Key Takeaways, Resources & Further Reading, Feedback / Q&A. Use interactive prompts and clear exercise instructions.",previewSlides:[{label:"WELCOME",accent:!0},{label:"AGENDA"},{label:"LEARN"},{label:"EXERCISE",accent:!0},{label:"DISCUSS"},{label:"WRAP-UP"}],badge:"New"},{id:"investor-update",name:"Investor Update",description:"KPIs, runway & roadmap",icon:Obe,suggestedSlides:10,suggestedTheme:"corporate",structureHint:"Include slides for: Executive Summary, Key Metrics / KPIs Dashboard, Revenue & Growth Trends, Product Milestones Achieved, Upcoming Roadmap, Cash Position & Runway, Team Updates / Key Hires, Risks & Challenges, Asks / How Investors Can Help, Thank You & Next Update Date. Use bold metrics, clear charts descriptions, and transparent communication.",previewSlides:[{label:"UPDATE",accent:!0},{label:"KPIs"},{label:"GROWTH"},{label:"ROADMAP",accent:!0},{label:"RUNWAY"},{label:"ASKS"}],badge:"New"}];function w2t({slides:e,accentColor:t}){return a.jsx("div",{className:"grid grid-cols-3 gap-1 w-full aspect-[16/10]",children:e.map((r,n)=>a.jsx("div",{className:Le("rounded-[3px] flex items-center justify-center border",r.accent?`${t} text-white border-transparent`:"bg-muted/50 border-border/50"),children:a.jsx("span",{className:Le("text-[7px] font-bold tracking-wider",!r.accent&&"text-muted-foreground"),children:r.label})},n))})}const C2t={"pitch-deck":"bg-emerald-600","business-report":"bg-blue-600",educational:"bg-amber-600","creative-portfolio":"bg-purple-600","sales-proposal":"bg-primary","team-meeting":"bg-slate-700","product-launch":"bg-rose-600","case-study":"bg-cyan-600",workshop:"bg-orange-600","investor-update":"bg-indigo-600"};function N2t({selected:e,onSelect:t}){return a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"pb-4 border-b border-border",children:[a.jsx("h2",{className:"text-xl font-semibold",children:"Choose a Template"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Pick a structure — the AI will tailor slides to match"})]}),a.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-4",children:b2t.map(r=>{const n=r.icon,i=e===r.id;return a.jsxs("button",{onClick:()=>t(r),className:Le("group relative rounded-xl border-2 p-5 text-left transition-all hover:shadow-lg hover:-translate-y-0.5",i?"border-primary bg-primary/5 ring-2 ring-primary/20":"border-border hover:border-primary/40"),children:[r.badge&&a.jsx(bt,{variant:r.badge==="Popular"?"default":"secondary",className:"absolute -top-2 -right-2 text-[9px] px-1.5 py-0 h-4 z-10",children:r.badge}),i&&a.jsx("div",{className:"absolute top-2 left-2 w-5 h-5 rounded-full bg-primary flex items-center justify-center z-10",children:a.jsx(dr,{className:"h-3 w-3 text-primary-foreground"})}),a.jsx("div",{className:"mb-3",children:a.jsx(w2t,{slides:r.previewSlides,accentColor:C2t[r.id]||"bg-primary"})}),a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(n,{className:"h-4 w-4 text-primary shrink-0"}),a.jsx("span",{className:"font-semibold text-sm",children:r.name})]}),a.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:r.description}),a.jsxs("p",{className:"text-[10px] text-muted-foreground/70 mt-1",children:[r.suggestedSlides," slides suggested"]}),a.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-t from-primary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none"})]},r.id)})})]})}const MJ={"vintage-poster":"'Playfair Display', 'Georgia', serif","modern-cartoon":"'Poppins', 'Inter', sans-serif","hand-drawn-sketch":"'Caveat', 'Patrick Hand', cursive","storybook-watercolor":"'Lora', 'Georgia', serif","comic-book":"'Bangers', 'Impact', sans-serif"},DJ={modern:{bg:"#ffffff",bgGradient:"linear-gradient(135deg, #ffffff 0%, #f3f0ff 100%)",titleBgGradient:"linear-gradient(135deg, #f8f6ff 0%, #ede9fe 60%, #ddd6fe 100%)",closingBg:"linear-gradient(135deg, #1e1b4b 0%, #312e81 100%)",heading:"#111827",text:"#4b5563",accent:"#6d28d9",accentHex:"#6d28d9",accentLight:"rgba(109,40,217,0.08)",quoteBgWash:"rgba(109,40,217,0.04)"},corporate:{bg:"#f8fafc",bgGradient:"linear-gradient(135deg, #f8fafc 0%, #e0ecff 100%)",titleBgGradient:"linear-gradient(135deg, #eff6ff 0%, #dbeafe 60%, #bfdbfe 100%)",closingBg:"linear-gradient(135deg, #0c1e3a 0%, #1e3a5f 100%)",heading:"#0f172a",text:"#475569",accent:"#2563eb",accentHex:"#2563eb",accentLight:"rgba(37,99,235,0.08)",quoteBgWash:"rgba(37,99,235,0.04)"},creative:{bg:"#fdf4ff",bgGradient:"linear-gradient(135deg, #fdf4ff 0%, #f3e8ff 100%)",titleBgGradient:"linear-gradient(135deg, #faf5ff 0%, #f3e8ff 60%, #e9d5ff 100%)",closingBg:"linear-gradient(135deg, #3b0764 0%, #581c87 100%)",heading:"#581c87",text:"#7e22ce",accent:"#a855f7",accentHex:"#a855f7",accentLight:"rgba(168,85,247,0.08)",quoteBgWash:"rgba(168,85,247,0.04)"},academic:{bg:"#fffbeb",bgGradient:"linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%)",titleBgGradient:"linear-gradient(135deg, #fffbeb 0%, #fef3c7 60%, #fde68a 100%)",closingBg:"linear-gradient(135deg, #451a03 0%, #78350f 100%)",heading:"#78350f",text:"#92400e",accent:"#d97706",accentHex:"#d97706",accentLight:"rgba(217,119,6,0.08)",quoteBgWash:"rgba(217,119,6,0.04)"},startup:{bg:"#ecfdf5",bgGradient:"linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%)",titleBgGradient:"linear-gradient(135deg, #ecfdf5 0%, #d1fae5 60%, #a7f3d0 100%)",closingBg:"linear-gradient(135deg, #022c22 0%, #064e3b 100%)",heading:"#064e3b",text:"#047857",accent:"#10b981",accentHex:"#10b981",accentLight:"rgba(16,185,129,0.08)",quoteBgWash:"rgba(16,185,129,0.04)"},dark:{bg:"#0f172a",bgGradient:"linear-gradient(135deg, #0f172a 0%, #1e293b 100%)",titleBgGradient:"linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #334155 100%)",closingBg:"linear-gradient(135deg, #020617 0%, #0f172a 100%)",heading:"#f1f5f9",text:"#94a3b8",accent:"#38bdf8",accentHex:"#38bdf8",accentLight:"rgba(56,189,248,0.1)",quoteBgWash:"rgba(56,189,248,0.05)"},warm:{bg:"#fdf8f0",bgGradient:"linear-gradient(135deg, #fdf8f0 0%, #f5e6d3 100%)",titleBgGradient:"linear-gradient(135deg, #fdf8f0 0%, #f5e6d3 60%, #e8d5b7 100%)",closingBg:"linear-gradient(135deg, #44200d 0%, #7c3a12 100%)",heading:"#431407",text:"#78350f",accent:"#c2410c",accentHex:"#c2410c",accentLight:"rgba(194,65,12,0.08)",quoteBgWash:"rgba(194,65,12,0.04)"}},mR=1920,gR=1080;function j2t(e){const[t,r]=w.useState(.5),n=w.useCallback(()=>{if(!e.current)return;const{clientWidth:i,clientHeight:s}=e.current;r(Math.min(i/mR,s/gR))},[e]);return w.useEffect(()=>{n();const i=new ResizeObserver(n);return e.current&&i.observe(e.current),()=>i.disconnect()},[n,e]),t}function vve({t:e,variant:t}){return t==="title"?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"absolute top-[-60px] left-[-60px] w-[300px] h-[300px] rounded-full",style:{backgroundColor:e.accent,opacity:.07}}),a.jsx("div",{className:"absolute bottom-[-80px] right-[-80px] w-[400px] h-[400px] rounded-full",style:{backgroundColor:e.accent,opacity:.05}}),a.jsx("div",{className:"absolute top-[200px] right-[160px] w-[120px] h-[120px] rounded-full",style:{backgroundColor:e.accent,opacity:.04}}),a.jsx("div",{className:"absolute bottom-[180px] left-[200px] w-[60px] h-[60px] rotate-45",style:{backgroundColor:e.accent,opacity:.06,borderRadius:8}})]}):t==="quote"?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"absolute top-0 bottom-0 left-0 w-[10px]",style:{backgroundColor:e.accent,opacity:.6}}),a.jsx("div",{className:"absolute top-[-40px] right-[-40px] w-[200px] h-[200px] rounded-full",style:{backgroundColor:e.accent,opacity:.04}})]}):null}function RJ({slide:e,t,isClosing:r,heroImage:n}){const i=e.illustrationUrl||n;return a.jsxs("div",{className:"flex flex-col items-center justify-center text-center h-full px-[200px] relative",style:{background:r?t.closingBg:t.titleBgGradient},children:[a.jsx(vve,{t,variant:"title"}),r&&i&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",style:{opacity:.08},children:a.jsx("img",{src:i,alt:"",loading:"lazy",className:"max-w-[600px] max-h-[600px] object-contain"})}),a.jsxs("div",{className:"relative z-10 flex flex-col items-center",children:[a.jsx("div",{className:"w-[100px] h-[6px] rounded-full mb-[40px]",style:{backgroundColor:t.accent,opacity:r?.7:1}}),a.jsx("h2",{className:"font-black leading-[1.08] tracking-tight max-w-[1400px]",style:{fontSize:76,color:r?"#ffffff":t.heading},children:e.heading}),a.jsxs("div",{className:"flex items-center gap-[12px] mt-[32px] mb-[28px]",children:[a.jsx("div",{className:"w-[40px] h-[3px] rounded-full",style:{backgroundColor:t.accent,opacity:.4}}),a.jsx("div",{className:"w-[10px] h-[10px] rotate-45 rounded-[2px]",style:{backgroundColor:t.accent,opacity:.5}}),a.jsx("div",{className:"w-[40px] h-[3px] rounded-full",style:{backgroundColor:t.accent,opacity:.4}})]}),e.subheading&&a.jsx("p",{className:"max-w-[1200px] mx-auto leading-relaxed",style:{fontSize:30,color:r?"rgba(255,255,255,0.8)":t.text},children:e.subheading}),!r&&i&&a.jsx("img",{src:i,alt:"",loading:"lazy",className:"mt-[32px] object-contain drop-shadow-lg",style:{maxHeight:280,maxWidth:600}})]})]})}function S2t({slide:e,t}){const r=!!e.illustrationUrl;return a.jsxs("div",{className:"flex h-full",style:{background:t.bgGradient},children:[a.jsx("div",{className:"flex-shrink-0 flex flex-col items-center justify-center",style:{width:48,backgroundColor:t.accent},children:a.jsx("span",{className:"font-black text-white",style:{fontSize:22,writingMode:"vertical-rl",transform:"rotate(180deg)",letterSpacing:4},children:String(e.slideNumber).padStart(2,"0")})}),a.jsxs("div",{className:"flex flex-1",children:[a.jsxs("div",{className:`flex flex-col px-[90px] pt-[90px] pb-[70px] ${r?"w-[60%]":"flex-1"}`,children:[a.jsx("h3",{className:"font-bold leading-tight",style:{fontSize:52,color:t.heading},children:e.heading}),a.jsx("div",{className:"mt-[16px] w-[80px] h-[5px] rounded-full",style:{backgroundColor:t.accent}}),e.subheading&&a.jsx("p",{className:"mt-[20px] leading-relaxed",style:{fontSize:26,color:t.text},children:e.subheading}),e.bullets&&e.bullets.length>0&&a.jsx("ul",{className:"mt-[44px] space-y-[28px] flex-1",children:e.bullets.map((n,i)=>a.jsxs("li",{className:"flex items-start gap-[22px]",children:[a.jsx("span",{className:"flex-shrink-0 w-[40px] h-[40px] rounded-full flex items-center justify-center font-bold text-white",style:{backgroundColor:t.accent,fontSize:18,marginTop:4},children:i+1}),a.jsx("span",{style:{fontSize:28,color:t.text,lineHeight:1.55},children:n})]},i))})]}),r&&a.jsxs("div",{className:"w-[40%] flex items-center justify-center p-[40px] relative",children:[a.jsx("div",{className:"absolute inset-[20px] rounded-[24px]",style:{backgroundColor:t.accentLight}}),a.jsx("img",{src:e.illustrationUrl,alt:"",loading:"lazy",className:"max-w-full max-h-full object-contain relative z-10 drop-shadow-md",style:{maxHeight:700}})]})]})]})}function B2t({slide:e,t}){var s,o,l;const r=Math.ceil((((s=e.bullets)==null?void 0:s.length)||0)/2),n=((o=e.bullets)==null?void 0:o.slice(0,r))||[],i=((l=e.bullets)==null?void 0:l.slice(r))||[];return a.jsxs("div",{className:"flex h-full",style:{background:t.bgGradient},children:[a.jsx("div",{className:"flex-shrink-0 flex flex-col items-center justify-center",style:{width:48,backgroundColor:t.accent},children:a.jsx("span",{className:"font-black text-white",style:{fontSize:22,writingMode:"vertical-rl",transform:"rotate(180deg)",letterSpacing:4},children:String(e.slideNumber).padStart(2,"0")})}),a.jsxs("div",{className:"flex flex-col flex-1 px-[90px] pt-[90px] pb-[70px]",children:[a.jsx("h3",{className:"font-bold leading-tight",style:{fontSize:52,color:t.heading},children:e.heading}),a.jsx("div",{className:"mt-[16px] w-[80px] h-[5px] rounded-full",style:{backgroundColor:t.accent}}),e.subheading&&a.jsx("p",{className:"mt-[20px] leading-relaxed",style:{fontSize:26,color:t.text},children:e.subheading}),e.illustrationUrl&&a.jsx("div",{className:"flex justify-center mt-[24px]",children:a.jsx("div",{className:"rounded-[16px] p-[16px]",style:{backgroundColor:t.accentLight},children:a.jsx("img",{src:e.illustrationUrl,alt:"",loading:"lazy",className:"object-contain drop-shadow-sm",style:{maxHeight:180,maxWidth:400}})})}),a.jsxs("div",{className:"flex gap-[40px] mt-[32px] flex-1 relative",children:[[n,i].map((c,u)=>a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"rounded-lg px-[20px] py-[10px] mb-[24px] font-bold text-white text-center",style:{backgroundColor:t.accent,fontSize:18,opacity:u===0?1:.8},children:u===0?"A":"B"}),a.jsx("ul",{className:"space-y-[24px]",children:c.map((d,A)=>a.jsxs("li",{className:"flex items-start gap-[16px]",children:[a.jsx("span",{className:"flex-shrink-0 w-[32px] h-[32px] rounded-full flex items-center justify-center font-bold text-white",style:{backgroundColor:t.accent,fontSize:14,marginTop:4,opacity:.85},children:u*r+A+1}),a.jsx("span",{style:{fontSize:26,color:t.text,lineHeight:1.5},children:d})]},A))})]},u)),a.jsx("div",{className:"absolute top-0 bottom-0 left-1/2 w-[3px] rounded-full",style:{backgroundColor:t.accent,opacity:.15,transform:"translateX(-50%)"}})]})]})]})}function _2t({slide:e,t}){return a.jsxs("div",{className:"flex flex-col items-center justify-center text-center h-full px-[200px] relative",style:{background:t.quoteBgWash},children:[a.jsx(vve,{t,variant:"quote"}),e.illustrationUrl&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",style:{opacity:.06},children:a.jsx("img",{src:e.illustrationUrl,alt:"",loading:"lazy",className:"max-w-[500px] max-h-[500px] object-contain"})}),a.jsxs("div",{className:"relative z-10 flex flex-col items-center max-w-[1400px]",children:[a.jsx("div",{className:"font-serif leading-none",style:{fontSize:140,color:t.accent,opacity:.25},children:'"'}),a.jsx("p",{className:"font-medium italic leading-relaxed",style:{fontSize:44,color:t.heading,marginTop:-50},children:e.heading}),e.subheading&&a.jsxs("p",{className:"font-semibold mt-[32px]",style:{fontSize:26,color:t.text},children:["— ",e.subheading]}),a.jsxs("div",{className:"flex items-center gap-[8px] mt-[40px]",children:[a.jsx("div",{className:"w-[50px] h-[4px] rounded-full",style:{backgroundColor:t.accent,opacity:.6}}),a.jsx("div",{className:"w-[8px] h-[8px] rotate-45 rounded-[1px]",style:{backgroundColor:t.accent,opacity:.5}}),a.jsx("div",{className:"w-[50px] h-[4px] rounded-full",style:{backgroundColor:t.accent,opacity:.6}})]})]})]})}function vR({slide:e,theme:t,isActive:r,id:n,presentationTitle:i,headerImage:s,visualStyle:o}){const l=w.useRef(null),c=j2t(l),u=DJ[t]||DJ.modern,d=()=>{if(e.fullArtworkUrl){const A=MJ[o||"vintage-poster"]||MJ["vintage-poster"];return a.jsxs("div",{className:"h-full w-full relative",style:{backgroundColor:"#000",fontFamily:A},children:[a.jsx("img",{src:e.fullArtworkUrl,alt:e.heading,className:"absolute inset-0 w-full h-full object-cover",loading:"lazy",crossOrigin:"anonymous"}),a.jsxs("div",{className:"absolute left-0 right-0 top-0 px-[80px] pt-[60px] pb-[80px]",style:{background:"linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.25) 70%, rgba(0,0,0,0) 100%)"},children:[a.jsx("h2",{className:"font-black leading-tight text-white",style:{fontSize:76,textShadow:"0 4px 18px rgba(0,0,0,0.7)"},children:e.heading}),e.subheading&&a.jsx("p",{className:"mt-4 text-white/90 leading-snug",style:{fontSize:32,textShadow:"0 2px 10px rgba(0,0,0,0.7)"},children:e.subheading}),a.jsx("div",{className:"mt-6 h-[6px] w-[120px] rounded-full",style:{backgroundColor:u.accent}})]}),e.bullets&&e.bullets.length>0&&a.jsx("div",{className:"absolute left-0 right-0 bottom-0 px-[80px] pt-[80px] pb-[80px]",style:{background:"linear-gradient(0deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.25) 70%, rgba(0,0,0,0) 100%)"},children:a.jsx("ul",{className:"space-y-[18px]",children:e.bullets.slice(0,5).map((h,f)=>a.jsxs("li",{className:"flex items-start gap-[20px]",children:[a.jsx("span",{className:"flex-shrink-0 w-[36px] h-[36px] rounded-full flex items-center justify-center font-bold text-white",style:{backgroundColor:u.accent,fontSize:18,marginTop:4},children:f+1}),a.jsx("span",{className:"text-white",style:{fontSize:28,lineHeight:1.45,textShadow:"0 2px 8px rgba(0,0,0,0.7)"},children:h})]},f))})})]})}switch(e.layout){case"title":return a.jsx(RJ,{slide:e,t:u,heroImage:s});case"closing":return a.jsx(RJ,{slide:e,t:u,isClosing:!0});case"quote":return a.jsx(_2t,{slide:e,t:u});case"two-column":return a.jsx(B2t,{slide:e,t:u});default:return a.jsx(S2t,{slide:e,t:u})}};return a.jsx("div",{id:n,ref:l,className:Le("relative w-full aspect-video rounded-lg overflow-hidden border-2 shadow-sm transition-all",r?"border-primary ring-2 ring-primary/20":"border-border"),children:a.jsxs("div",{className:"absolute",style:{width:mR,height:gR,left:"50%",top:"50%",marginLeft:-(mR/2),marginTop:-(gR/2),transform:`scale(${c})`,transformOrigin:"center center",backgroundColor:u.bg},children:[a.jsx("div",{className:"absolute top-0 left-0 right-0 z-20",style:{height:8,backgroundColor:u.accent}}),a.jsx("div",{className:"absolute inset-0",style:{paddingTop:8},children:d()}),a.jsxs("div",{className:"absolute bottom-0 left-0 right-0 flex items-center justify-between z-20",style:{height:52,paddingLeft:56,paddingRight:40,backgroundColor:"rgba(0,0,0,0.04)"},children:[i&&a.jsx("span",{className:"font-semibold uppercase tracking-[0.2em] opacity-30",style:{fontSize:13,color:u.heading},children:i}),a.jsx("span",{className:"font-black ml-auto",style:{fontSize:18,color:u.accent,opacity:.5},children:String(e.slideNumber).padStart(2,"0")})]})]})})}function k2t({items:e,onChange:t,itemLabel:r="item"}){const[n,i]=w.useState(null),s=(u,d)=>{const A=[...e],h=d==="up"?u-1:u+1;h<0||h>=A.length||([A[u],A[h]]=[A[h],A[u]],t(A))},o=(u,d)=>{t(e.map(A=>A.id===u?{...A,...d}:A))},l=u=>{e.length<=1||t(e.filter(d=>d.id!==u))},c=()=>{t([...e,{id:crypto.randomUUID(),title:`New ${r}`,description:"",bullets:[]}])};return a.jsxs("div",{className:"space-y-3",children:[e.map((u,d)=>{const A=n===u.id;return a.jsx(_e,{className:Le("transition-all duration-200",A&&"ring-2 ring-primary/30"),children:a.jsx(Ge,{className:"p-3 sm:p-4",children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsxs("div",{className:"flex flex-col items-center gap-0.5 pt-1 shrink-0",children:[a.jsx(Kbe,{className:"h-4 w-4 text-muted-foreground/40"}),a.jsx(ve,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>s(d,"up"),disabled:d===0,children:a.jsx(x6,{className:"h-3 w-3"})}),a.jsx("span",{className:"text-xs font-medium text-muted-foreground tabular-nums",children:d+1}),a.jsx(ve,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>s(d,"down"),disabled:d===e.length-1,children:a.jsx(y0,{className:"h-3 w-3"})})]}),a.jsx("div",{className:"flex-1 min-w-0 space-y-2",children:A?a.jsxs(a.Fragment,{children:[a.jsx(st,{value:u.title,onChange:h=>o(u.id,{title:h.target.value}),placeholder:`${r} title`,className:"font-medium"}),a.jsx(Zr,{value:u.description,onChange:h=>o(u.id,{description:h.target.value}),placeholder:"Description or key points...",rows:2,className:"text-sm"}),u.bullets&&u.bullets.length>0&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Bullet points:"}),u.bullets.map((h,f)=>a.jsxs("div",{className:"flex gap-1.5 items-center",children:[a.jsx("span",{className:"text-xs text-muted-foreground",children:"•"}),a.jsx(st,{value:h,onChange:m=>{const p=[...u.bullets||[]];p[f]=m.target.value,o(u.id,{bullets:p})},className:"h-7 text-xs"}),a.jsx(ve,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>{const m=(u.bullets||[]).filter((p,g)=>g!==f);o(u.id,{bullets:m})},children:a.jsx(Sl,{className:"h-3 w-3"})})]},f)),a.jsxs(ve,{variant:"ghost",size:"sm",className:"h-6 text-xs",onClick:()=>o(u.id,{bullets:[...u.bullets||[],""]}),children:[a.jsx(Xi,{className:"h-3 w-3 mr-1"}),"Add bullet"]})]})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"font-medium text-sm truncate",children:u.title}),u.description&&a.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:u.description}),u.bullets&&u.bullets.length>0&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:[u.bullets.length," bullet point",u.bullets.length>1?"s":""]})]})}),a.jsxs("div",{className:"flex flex-col gap-1 shrink-0",children:[a.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>i(A?null:u.id),children:A?a.jsx(dr,{className:"h-3.5 w-3.5"}):a.jsx(z5,{className:"h-3.5 w-3.5"})}),a.jsx(ve,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>l(u.id),disabled:e.length<=1,children:a.jsx(Sl,{className:"h-3.5 w-3.5"})})]})]})})},u.id)}),a.jsxs(ve,{variant:"outline",size:"sm",onClick:c,className:"w-full",children:[a.jsx(Xi,{className:"h-4 w-4 mr-1"}),"Add ",r]})]})}const UJ=[{value:"modern",label:"Modern Minimal"},{value:"corporate",label:"Corporate Professional"},{value:"creative",label:"Creative Bold"},{value:"academic",label:"Academic Clean"},{value:"startup",label:"Startup Pitch"},{value:"dark",label:"Dark Premium"},{value:"warm",label:"Warm Terracotta"}],E2t=[{value:"minimal-icons",label:"Minimal (fast, coded layout)"},{value:"vintage-poster",label:"Vintage Illustrated Poster ★"},{value:"modern-cartoon",label:"Modern Cartoon"},{value:"hand-drawn-sketch",label:"Hand-drawn Sketch"},{value:"storybook-watercolor",label:"Storybook Watercolor"},{value:"comic-book",label:"Comic Book"}];function T2t(){var ge;const{user:e}=fi(),{usageData:t,updateUsage:r,getRemainingCredits:n}=Ua(),{toast:i}=Dr(),[s,o]=w.useState(null),[l,c]=w.useState(""),[u,d]=w.useState(""),[A,h]=w.useState("modern"),[f,m]=w.useState([8]),[p,g]=w.useState(""),[v,x]=w.useState(""),[y,b]=w.useState(!1),[C,j]=w.useState(null),[S,T]=w.useState(!1),[B,I]=w.useState(null),[P,E]=w.useState(0),[M,_]=w.useState(!1),[R,G]=w.useState("minimal-icons"),[U,Q]=w.useState(!1),[z,Y]=w.useState(!1),$=n(),O=(t==null?void 0:t.can_generate)??!1,W=(t==null?void 0:t.tier)==="admin"||(t==null?void 0:t.tier)&&t.tier!=="free",V=ie=>{o(ie),h(ie.suggestedTheme),m([ie.suggestedSlides])},X=async()=>{var ie;if(!v.trim()||v.trim().length<10){i({title:"More notes needed",description:"Please enter at least 10 characters of notes.",variant:"destructive"});return}b(!0);try{const{data:ue,error:Se}=await Re.functions.invoke("organize-notes",{body:{notes:v.trim(),type:"presentation",templateName:s==null?void 0:s.name,templateHint:s==null?void 0:s.structureHint}});if(Se)throw Se;if(ue!=null&&ue.error)throw new Error(ue.error);j(ue.items||[]),i({title:"Notes organized!",description:`${((ie=ue.items)==null?void 0:ie.length)||0} slides outlined. Edit and reorder, then generate.`})}catch(ue){console.error("Organize error:",ue),i({title:"Organization failed",description:ue.message||"Please try again.",variant:"destructive"})}finally{b(!1)}},ne=async(ie=!1)=>{var ue;if(!l.trim()){i({title:"Topic required",description:"Please enter a presentation topic.",variant:"destructive"});return}if(!O||$&&$.remaining<5){i({title:"Not enough credits",description:"Presentations cost 5 credits. Upgrade your plan for more.",variant:"destructive"});return}T(!0);try{const Se={topic:l.trim(),slideCount:f[0],theme:A,outline:u.trim()||void 0,templateName:s==null?void 0:s.name,templateHint:s==null?void 0:s.structureHint,designInstructions:p.trim()||void 0,visualStyle:R};ie&&C&&(Se.structuredOutline=C.map(te=>({title:te.title,description:te.description,bullets:te.bullets})),Se.slideCount=C.length);const{data:D,error:K}=await Re.functions.invoke("generate-presentation",{body:Se});if(K)throw K;if(D!=null&&D.error)throw new Error(D.error);I(D),E(0),Q(!1),await r(0,5);const ae=["vintage-poster","modern-cartoon","hand-drawn-sketch","storybook-watercolor","comic-book"].includes(R)&&Array.isArray(D==null?void 0:D.slides)?D.slides.filter(te=>!te.fullArtworkUrl).length:0;ae>0?i({title:"Some slide artwork failed",description:`${ae} of ${D.slides.length} slides used a fallback. You can regenerate the deck or use a different visual style.`,variant:"destructive"}):i({title:"Presentation generated!",description:`${((ue=D.slides)==null?void 0:ue.length)||0} slides created.`})}catch(Se){console.error("Generation error:",Se),i({title:"Generation failed",description:Se.message||"Please try again.",variant:"destructive"})}finally{T(!1)}},oe=async()=>{var ie;if(l.trim()){if(!O||$&&$.remaining<5){i({title:"Not enough credits",description:"Regenerating costs 5 credits.",variant:"destructive"});return}T(!0);try{const ue={topic:l.trim(),slideCount:f[0],theme:A,outline:u.trim()||void 0,templateName:s==null?void 0:s.name,templateHint:s==null?void 0:s.structureHint,designInstructions:p.trim()||void 0,visualStyle:R},{data:Se,error:D}=await Re.functions.invoke("generate-presentation",{body:ue});if(D)throw D;if(Se!=null&&Se.error)throw new Error(Se.error);I(Se),E(0),await r(0,5),i({title:"Slide artwork regenerated!",description:`${((ie=Se.slides)==null?void 0:ie.length)||0} slides refreshed.`})}catch(ue){i({title:"Regeneration failed",description:ue.message||"Please try again.",variant:"destructive"})}finally{T(!1)}}},pe=async()=>{if(!(!B||!e)){Y(!0);try{const{error:ie}=await Re.from("presentations").insert({user_id:e.id,title:B.title,topic:l,theme:A,slides:B.slides,speaker_notes:B.slides.map(ue=>ue.speakerNotes||""),slide_count:B.slides.length,status:"draft"});if(ie)throw ie;i({title:"Saved!",description:"Presentation saved to your library."})}catch(ie){i({title:"Save failed",description:ie.message,variant:"destructive"})}finally{Y(!1)}}};if(S)return a.jsx(id,{contentType:"presentation"});if(!B&&!s)return a.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[a.jsx(Dx,{title:"AI Presentation Maker",description:"Generate professional slide decks in seconds. Pick a template to begin.",icon:ac,pillar:"presentations",eyebrow:"Step 1 of 2"}),a.jsx(N2t,{selected:null,onSelect:V})]});if(!B&&C)return a.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[a.jsx(Dx,{title:"Edit Your Outline",description:"Reorder, edit, or delete slides before generating.",icon:ac,pillar:"presentations",eyebrow:"Edit Outline",topRow:a.jsxs(ve,{variant:"ghost",size:"sm",className:"text-foreground/70 hover:text-foreground -ml-2",onClick:()=>j(null),children:[a.jsx(Cl,{className:"h-4 w-4 mr-1"}),"Back"]})}),a.jsx(_e,{className:"border border-border-strong rounded-xl shadow-none",children:a.jsx(Ge,{className:"p-6 sm:p-8",children:a.jsx(k2t,{items:C,onChange:j,itemLabel:"slide"})})}),a.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3",children:[a.jsxs("p",{className:"text-xs text-foreground/60",children:[C.length," slides • Costs 5 credits • ",$?`${$.remaining} remaining`:"Loading..."]}),a.jsxs(ve,{onClick:()=>ne(!0),disabled:!O||!l.trim()||C.length===0,children:[a.jsx(Do,{className:"mr-2 h-4 w-4"}),"Generate from Outline"]})]})]});if(!B)return a.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[a.jsx(Dx,{title:(s==null?void 0:s.name)??"Presentation Details",description:s==null?void 0:s.description,icon:ac,pillar:"presentations",eyebrow:"Step 2 of 2",topRow:a.jsxs(ve,{variant:"ghost",size:"sm",className:"text-foreground/70 hover:text-foreground -ml-2",onClick:()=>o(null),children:[a.jsx(Cl,{className:"h-4 w-4 mr-1"}),"Back to Templates"]})}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_300px] gap-6",children:[a.jsx(_e,{className:"border border-border-strong rounded-xl shadow-none",children:a.jsxs(Ge,{className:"p-6 sm:p-8 space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] font-semibold text-foreground",children:"Topic *"}),a.jsx(st,{placeholder:"e.g., Q4 Marketing Strategy, Introduction to Machine Learning",value:l,onChange:ie=>c(ie.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] font-semibold text-foreground",children:"Raw Notes / Meeting Minutes"}),a.jsx(Zr,{placeholder:"Paste raw notes, meeting minutes, brainstorm ideas, or key points. The AI will organize them into a structured slide outline you can edit.",value:v,onChange:ie=>x(ie.target.value),rows:4}),v.trim().length>=10&&a.jsxs("div",{className:"flex items-center justify-between gap-3 p-3 rounded-lg bg-surface-2 border border-border-subtle",children:[a.jsx("p",{className:"text-[12px] text-foreground/75",children:"We can structure these into slides for you."}),a.jsxs(ve,{variant:"outline",size:"sm",onClick:X,disabled:y,children:[y?a.jsx(Nl,{className:"mr-2 h-4 w-4 animate-spin"}):a.jsx(dwe,{className:"mr-2 h-4 w-4"}),y?"Organizing...":"Organize"]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] font-semibold text-foreground",children:"Outline / Additional Context"}),a.jsx(Zr,{placeholder:"Add key points, structure preferences, or any context.",value:u,onChange:ie=>d(ie.target.value),rows:3})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-5",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] font-semibold text-foreground",children:"Theme"}),a.jsxs(It,{value:A,onValueChange:h,children:[a.jsx(_t,{children:a.jsx(Ot,{})}),a.jsx(kt,{children:UJ.map(ie=>a.jsx(ye,{value:ie.value,children:ie.label},ie.value))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] font-semibold text-foreground",children:"Visual Style"}),a.jsxs(It,{value:R,onValueChange:G,children:[a.jsx(_t,{children:a.jsx(Ot,{})}),a.jsx(kt,{children:E2t.map(ie=>a.jsx(ye,{value:ie.value,children:ie.label},ie.value))})]}),a.jsx("p",{className:"text-[11px] text-foreground/60",children:R==="minimal-icons"?"Coded slides with small AI icons (~10 sec)":"Each slide is a fully illustrated artwork (~5 sec/slide)"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] font-semibold text-foreground",children:"Design Style Instructions"}),a.jsx(Zr,{placeholder:"e.g., Clean and professional with emphasis on data visualization, bold typography with high contrast.",value:p,onChange:ie=>g(ie.target.value),rows:2})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] font-semibold text-foreground",children:"Number of Slides"}),a.jsx("div",{className:"grid grid-cols-4 gap-2",children:[5,8,12,18].map(ie=>{const ue=f[0]===ie;return a.jsx("button",{type:"button",onClick:()=>m([ie]),className:Le("h-10 rounded-lg border text-[13px] font-semibold transition-colors",ue?"bg-surface-2 border-border-strong text-foreground":"bg-surface-1 border-border-subtle text-foreground/70 hover:border-border-strong"),children:ie},ie)})})]})]})}),a.jsx("aside",{className:"lg:sticky lg:top-4 self-start",children:a.jsx(_e,{className:"border border-border-strong rounded-xl shadow-none bg-surface-1",children:a.jsxs(Ge,{className:"p-5 space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-[11px] uppercase tracking-[0.1em] font-semibold text-foreground/55",children:"You'll generate"}),a.jsx("p",{className:"text-[18px] font-semibold text-foreground mt-1 leading-tight",children:(s==null?void 0:s.name)??"Presentation"}),a.jsxs("p",{className:"text-[12px] text-foreground/60 mt-0.5",children:[f[0]," slides · ",(ge=UJ.find(ie=>ie.value===A))==null?void 0:ge.label]})]}),a.jsxs("div",{className:"flex items-center justify-between text-[12px] py-2 border-t border-border-subtle",children:[a.jsx("span",{className:"text-foreground/65",children:"Cost"}),a.jsx("span",{className:"font-semibold text-foreground",children:"5 credits"})]}),a.jsxs("div",{className:"flex items-center justify-between text-[12px] -mt-2",children:[a.jsx("span",{className:"text-foreground/65",children:"Remaining"}),a.jsx("span",{className:"font-semibold text-foreground tabular-nums",children:$?$.remaining:"—"})]}),a.jsxs(ve,{className:"w-full",onClick:()=>ne(!1),disabled:!O||!l.trim(),children:[a.jsx(Do,{className:"mr-2 h-4 w-4"}),"Generate Presentation"]})]})})})]})]});const de=B.slides[P];return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-bold",children:B.title}),a.jsxs("p",{className:"text-sm text-foreground/70",children:[B.slides.length," slides • ",A," theme"]})]}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>Q(!U),children:[a.jsx(twe,{className:"h-4 w-4 mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:U?"Slide View":"Grid"})]}),a.jsxs(ve,{variant:"outline",size:"sm",onClick:()=>_(!M),children:[a.jsx(wwe,{className:"h-4 w-4 mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"Notes"})]}),a.jsx(Kpe,{options:[{label:"Download as PNG (current slide)",icon:a.jsx(tre,{className:"h-4 w-4"}),action:()=>ave(`slide-preview-${P}`,`${B.title}-slide-${P+1}`)},{label:"Download as PDF (all slides)",icon:a.jsx(ai,{className:"h-4 w-4"}),action:async()=>{const ie=P,ue=[];for(let Se=0;SesetTimeout(D,100)),ue.push(`slide-preview-${Se}`);await S1t(ue,B.title),E(ie)}},{label:"Download as PPTX",icon:a.jsx(Qbe,{className:"h-4 w-4"}),action:async()=>{const ie=new y2t;ie.layout="LAYOUT_WIDE",B.slides.forEach(ue=>{var D;const Se=ie.addSlide();ue.layout==="title"||ue.layout==="closing"?(Se.addText(ue.heading,{x:.5,y:1.5,w:12.5,h:2,fontSize:36,bold:!0,align:"center",color:"333333"}),ue.subheading&&Se.addText(ue.subheading,{x:.5,y:3.5,w:12.5,h:1,fontSize:18,align:"center",color:"666666"})):(Se.addText(ue.heading,{x:.5,y:.3,w:12.5,h:1,fontSize:28,bold:!0,color:"333333"}),ue.subheading&&Se.addText(ue.subheading,{x:.5,y:1.2,w:12.5,h:.6,fontSize:14,color:"666666"}),(D=ue.bullets)!=null&&D.length&&Se.addText(ue.bullets.map(K=>({text:K,options:{bullet:!0,fontSize:16,color:"444444",breakLine:!0}})),{x:.5,y:ue.subheading?2:1.5,w:12.5,h:4})),ue.speakerNotes&&Se.addNotes(ue.speakerNotes)}),await ie.writeFile({fileName:`${B.title}.pptx`})}}]}),W?a.jsxs(ve,{variant:"outline",size:"sm",onClick:pe,disabled:z,children:[a.jsx(Mh,{className:"h-4 w-4 mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"Save"})]}):a.jsxs(ve,{variant:"outline",size:"sm",disabled:!0,title:"Upgrade to a paid plan to save presentations",children:[a.jsx(Mh,{className:"h-4 w-4 mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"Upgrade to Save"})]}),["vintage-poster","modern-cartoon","hand-drawn-sketch","storybook-watercolor","comic-book"].includes(R)&&a.jsxs(ve,{variant:"outline",size:"sm",onClick:oe,disabled:S,children:[a.jsx(Do,{className:"h-4 w-4 mr-1"}),a.jsx("span",{className:"hidden sm:inline",children:"Regenerate Artwork (5 credits)"})]}),a.jsx(ve,{variant:"outline",size:"sm",onClick:()=>{I(null),o(null),c(""),d(""),x(""),j(null)},children:"New"})]})]}),U?a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:B.slides.map((ie,ue)=>a.jsxs("button",{onClick:()=>{E(ue),Q(!1)},className:"text-left",children:[a.jsx(vR,{slide:ie,theme:A,isActive:P===ue,presentationTitle:B.title,headerImage:ie.layout==="title"?B.headerImage:void 0,visualStyle:B.visualStyle}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1 truncate",children:["Slide ",ie.slideNumber,": ",ie.heading]})]},ue))}):a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"max-w-4xl mx-auto",children:a.jsx(vR,{slide:de,theme:A,isActive:!0,id:`slide-preview-${P}`,presentationTitle:B.title,headerImage:de.layout==="title"?B.headerImage:void 0,visualStyle:B.visualStyle})}),a.jsxs("div",{className:"flex items-center justify-center gap-4",children:[a.jsx(ve,{variant:"outline",size:"icon",onClick:()=>E(Math.max(0,P-1)),disabled:P===0,children:a.jsx(v6,{className:"h-4 w-4"})}),a.jsxs("span",{className:"text-sm text-muted-foreground tabular-nums",children:[P+1," / ",B.slides.length]}),a.jsx(ve,{variant:"outline",size:"icon",onClick:()=>E(Math.min(B.slides.length-1,P+1)),disabled:P===B.slides.length-1,children:a.jsx(vC,{className:"h-4 w-4"})})]}),M&&de.speakerNotes&&a.jsx(_e,{className:"max-w-4xl mx-auto border-2 border-foreground/10 shadow-md rounded-xl",children:a.jsxs(Ge,{className:"p-4",children:[a.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-1",children:"Speaker Notes"}),a.jsx("p",{className:"text-sm",children:de.speakerNotes})]})})]})]})}const QJ={"vintage-poster":"'Playfair Display', 'Georgia', serif","modern-cartoon":"'Poppins', 'Inter', sans-serif","hand-drawn-sketch":"'Caveat', 'Patrick Hand', cursive","storybook-watercolor":"'Lora', 'Georgia', serif","comic-book":"'Bangers', 'Impact', sans-serif"},HJ={chart:Ra,clock:tu,star:eg,target:ca,users:nu,zap:ln,trending:ni,check:Zf,layers:C6,award:Ebe,lightbulb:vA,rocket:W5,shield:G5,heart:w6},$J={brand:{primary:"#2d8a4e",primaryDark:"#1e6b3a",primaryLight:"#e8f5ec",accent:"#2d8a4e"},ocean:{primary:"#1a6fc4",primaryDark:"#134e8a",primaryLight:"#e6f0fa",accent:"#1a6fc4"},sunset:{primary:"#e87c1e",primaryDark:"#c45a0a",primaryLight:"#fdf1e6",accent:"#e87c1e"},forest:{primary:"#2d8a5e",primaryDark:"#1e6b48",primaryLight:"#e8f5ef",accent:"#2d8a5e"},royal:{primary:"#7b3db8",primaryDark:"#5a2d87",primaryLight:"#f3eafa",accent:"#7b3db8"}};function P2t(e){return e&&HJ[e]?HJ[e]:ln}function zJ({iconName:e,color:t,size:r=20}){const n=P2t(e);return a.jsx(n,{style:{color:t},size:r})}function I2t({src:e,size:t="md"}){if(!e)return null;const r=t==="lg"?"max-h-[80px]":t==="md"?"max-h-[56px]":"max-h-[40px]";return a.jsx("img",{src:e,alt:"",loading:"lazy",className:Le("w-auto object-contain",r)})}function ud({section:e,p:t,size:r,vs:n}){return n==="text-only"?null:n==="icons"?a.jsx(zJ,{iconName:e.icon,color:e.highlightColor||t.primary,size:r==="lg"?28:r==="sm"?16:22}):e.illustrationUrl?a.jsx(I2t,{src:e.illustrationUrl,size:r}):a.jsx(zJ,{iconName:e.icon,color:e.highlightColor||t.primary,size:r==="lg"?28:20})}function O2t({sections:e,p:t,vs:r}){return a.jsxs("div",{className:"relative pl-8",children:[a.jsx("div",{className:"absolute left-3 top-0 bottom-0 w-[2px]",style:{backgroundColor:`${t.primary}25`}}),e.map((n,i)=>a.jsxs("div",{className:"relative mb-8 last:mb-0",children:[a.jsx("div",{className:"absolute -left-5 top-1 w-[10px] h-[10px] rounded-full border-2",style:{backgroundColor:"#fff",borderColor:n.highlightColor||t.primary}}),a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[n.value&&a.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:n.highlightColor||t.primary},children:n.value}),a.jsx("h3",{className:"text-[15px] font-bold leading-snug",style:{color:"#1a1a1a"},children:n.heading}),a.jsx("p",{className:"text-[13px] mt-1 leading-relaxed",style:{color:"#555"},children:n.description})]}),a.jsx("div",{className:"shrink-0",children:a.jsx(ud,{section:n,p:t,size:i===0?"lg":"md",vs:r})})]})]},i))]})}function F2t({sections:e,p:t,vs:r}){return a.jsx("div",{className:"grid grid-cols-2 gap-x-10 gap-y-8",children:e.map((n,i)=>a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"shrink-0 mt-1",children:a.jsx(ud,{section:n,p:t,size:"md",vs:r})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[n.value&&a.jsx("p",{className:"text-2xl font-black leading-none",style:{color:n.highlightColor||t.primary},children:n.value}),a.jsx("h4",{className:"font-bold text-[13px] mt-1",style:{color:"#1a1a1a"},children:n.heading}),a.jsx("p",{className:"text-[12px] mt-1 leading-relaxed",style:{color:"#555"},children:n.description})]})]},i))})}function L2t({sections:e,p:t,vs:r}){return a.jsxs("div",{className:"relative pl-8",children:[a.jsx("div",{className:"absolute left-[18px] top-4 bottom-4 w-[2px]",style:{backgroundColor:`${t.primary}20`}}),e.map((n,i)=>{const s=i===e.length-1;return a.jsxs("div",{className:"relative mb-7 last:mb-0",children:[a.jsx("div",{className:"absolute -left-5 top-0 w-[36px] h-[36px] rounded-full flex items-center justify-center text-sm font-bold",style:{backgroundColor:n.highlightColor||t.primary,color:"#fff"},children:n.order}),a.jsxs("div",{className:"ml-6 flex items-start gap-3",children:[a.jsxs("div",{className:"flex-1 min-w-0 pt-1",children:[a.jsx("h3",{className:"font-bold text-[14px]",style:{color:"#1a1a1a"},children:n.heading}),a.jsx("p",{className:"text-[12px] mt-1 leading-relaxed",style:{color:"#555"},children:n.description})]}),a.jsx("div",{className:"shrink-0",children:a.jsx(ud,{section:n,p:t,size:"md",vs:r})})]}),!s&&a.jsx("div",{className:"absolute -left-[11px] bottom-[-18px]",children:a.jsx(vC,{className:"h-3 w-3 rotate-90",style:{color:`${t.primary}40`}})})]},i)})]})}function M2t({sections:e,p:t,vs:r}){const n=Math.min(e.length,3);return a.jsx("div",{className:"grid gap-8",style:{gridTemplateColumns:`repeat(${n}, 1fr)`},children:e.map((i,s)=>a.jsxs("div",{children:[a.jsx("div",{className:"flex justify-center mb-3",children:a.jsx(ud,{section:i,p:t,size:"md",vs:r})}),a.jsx("h4",{className:"font-bold text-[14px] text-center mb-1",style:{color:i.highlightColor||t.primary},children:i.heading}),i.value&&a.jsx("p",{className:"text-center text-lg font-bold mb-1",style:{color:"#1a1a1a"},children:i.value}),a.jsx("p",{className:"text-[12px] leading-relaxed text-center",style:{color:"#555"},children:i.description})]},s))})}function D2t({sections:e,p:t,vs:r}){return a.jsx("div",{className:"space-y-0",children:e.map((n,i)=>{const s=i===e.length-1;return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-start gap-4 py-5",children:[a.jsx("span",{className:"text-3xl font-black shrink-0 leading-none w-10 text-right",style:{color:n.highlightColor||t.primary},children:String(n.order).padStart(2,"0")}),a.jsx("div",{className:"shrink-0 mt-1",children:a.jsx(ud,{section:n,p:t,size:"sm",vs:r})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h3",{className:"font-bold text-[14px]",style:{color:"#1a1a1a"},children:n.heading}),a.jsx("p",{className:"text-[12px] mt-1 leading-relaxed",style:{color:"#555"},children:n.description})]})]}),!s&&a.jsx("div",{className:"h-[1px] ml-14",style:{backgroundColor:`${t.primary}12`}})]},i)})})}function R2t({sections:e,p:t,vs:r}){const n=e[0],i=e.slice(1);return a.jsxs("div",{className:"py-4",children:[a.jsx("div",{className:"flex justify-center mb-8",children:a.jsxs("div",{className:"text-center py-4 px-8 rounded-full border-2",style:{borderColor:t.primary},children:[a.jsx("h3",{className:"font-bold text-[16px]",style:{color:"#1a1a1a"},children:n==null?void 0:n.heading}),(n==null?void 0:n.value)&&a.jsx("p",{className:"text-[11px] mt-1",style:{color:t.primary},children:n.value})]})}),a.jsx("div",{className:"grid gap-6",style:{gridTemplateColumns:"repeat(auto-fit, minmax(160px, 1fr))"},children:i.map((s,o)=>a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("div",{className:"w-2 h-2 rounded-full shrink-0 mt-1.5",style:{backgroundColor:s.highlightColor||t.primary}}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[a.jsx(ud,{section:s,p:t,size:"sm",vs:r}),a.jsx("h4",{className:"font-bold text-[12px]",style:{color:"#1a1a1a"},children:s.heading})]}),a.jsx("p",{className:"text-[11px] leading-relaxed",style:{color:"#555"},children:s.description})]})]},o))})]})}function U2t({sections:e,p:t}){const r=[...e].sort((i,s)=>i.order-s.order),n=r.length;return a.jsx("div",{className:"space-y-2 py-3",children:r.map((i,s)=>{const o=35+(n-1-s)/Math.max(n-1,1)*65;return a.jsx("div",{className:"flex justify-center",children:a.jsxs("div",{className:"py-3 px-4 rounded-sm text-center",style:{width:`${o}%`,backgroundColor:`${i.highlightColor||t.primary}12`},children:[a.jsx("h3",{className:"font-bold text-[13px]",style:{color:"#1a1a1a"},children:i.heading}),a.jsx("p",{className:"text-[11px] mt-0.5",style:{color:"#555"},children:i.description})]})},s)})})}function Q2t({sections:e,p:t,vs:r}){return a.jsx("div",{className:"space-y-0 py-2",children:e.map((n,i)=>{const s=i===e.length-1;return a.jsxs("div",{children:[a.jsx("div",{className:"flex justify-center",children:a.jsxs("div",{className:"py-3 px-5 w-[85%]",style:{backgroundColor:`${n.highlightColor||t.primary}06`,borderLeft:`3px solid ${n.highlightColor||t.primary}`},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(ud,{section:n,p:t,size:"sm",vs:r}),a.jsx("h3",{className:"font-bold text-[13px]",style:{color:"#1a1a1a"},children:n.heading}),n.value&&a.jsx("span",{className:"text-[9px] font-bold uppercase px-1.5 py-0.5 rounded ml-auto",style:{backgroundColor:`${n.highlightColor||t.primary}15`,color:n.highlightColor||t.primary},children:n.value})]}),a.jsx("p",{className:"text-[12px] leading-relaxed",style:{color:"#555"},children:n.description})]})}),!s&&a.jsx("div",{className:"flex justify-center py-1.5",children:a.jsx(_be,{className:"h-4 w-4",style:{color:`${t.primary}35`}})})]},i)})})}function H2t({sections:e,p:t}){const r=e.filter((i,s)=>s%2===0),n=e.filter((i,s)=>s%2!==0);return a.jsx("div",{className:"grid grid-cols-2 gap-8",children:[{items:r,label:"Pros",color:"#10b981"},{items:n,label:"Cons",color:"#ef4444"}].map((i,s)=>a.jsxs("div",{children:[a.jsx("p",{className:"font-bold text-[14px] uppercase tracking-wider mb-4",style:{color:i.color},children:i.label}),a.jsx("div",{className:"space-y-4",children:i.items.map((o,l)=>a.jsxs("div",{className:"pl-3",style:{borderLeft:`3px solid ${i.color}`},children:[a.jsx("h3",{className:"font-bold text-[12px]",style:{color:"#1a1a1a"},children:o.heading}),a.jsx("p",{className:"text-[11px] mt-0.5 leading-relaxed",style:{color:"#555"},children:o.description})]},l))})]},s))})}function $2t({sections:e,p:t,vs:r}){return a.jsxs("div",{className:"relative pl-8",children:[a.jsx("div",{className:"absolute left-[18px] top-4 bottom-4 w-[2px]",style:{backgroundColor:`${t.primary}20`}}),e.map((n,i)=>{const s=i===e.length-1;return a.jsxs("div",{className:"relative mb-6 last:mb-0",children:[a.jsx("div",{className:"absolute -left-5 top-0 w-[32px] h-[32px] rounded-full flex items-center justify-center text-xs font-bold",style:{backgroundColor:n.highlightColor||t.primary,color:"#fff"},children:n.order}),a.jsxs("div",{className:"ml-6 flex items-start gap-3",children:[a.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[a.jsx("h3",{className:"font-bold text-[13px]",style:{color:"#1a1a1a"},children:n.heading}),a.jsx("p",{className:"text-[12px] leading-relaxed mt-0.5",style:{color:"#555"},children:n.description})]}),a.jsx("div",{className:"shrink-0",children:a.jsx(ud,{section:n,p:t,size:"sm",vs:r})})]}),s&&a.jsxs("div",{className:"flex items-center gap-2 mt-3 ml-6",children:[a.jsx(Zm,{className:"h-3.5 w-3.5",style:{color:t.primary}}),a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:t.primary},children:"Repeat Cycle"})]})]},i)})]})}function z2t({sections:e,p:t,vs:r}){const n=e.filter(o=>o.size==="large"),i=e.filter(o=>o.size==="medium"),s=e.filter(o=>o.size==="small"||!o.size&&o!==e[0]);return a.jsxs("div",{className:"space-y-8",children:[n.map(o=>a.jsxs("div",{className:"flex items-start gap-4 pl-4",style:{borderLeft:`3px solid ${o.highlightColor||t.primary}`},children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h3",{className:"text-[15px] font-bold",style:{color:"#1a1a1a"},children:o.heading}),o.value&&a.jsx("p",{className:"text-xl font-black my-0.5",style:{color:o.highlightColor||t.primary},children:o.value}),a.jsx("p",{className:"text-[12px] leading-relaxed mt-1",style:{color:"#555"},children:o.description})]}),a.jsx("div",{className:"shrink-0",children:a.jsx(ud,{section:o,p:t,size:"lg",vs:r})})]},o.order)),i.length>0&&a.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:i.map(o=>a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[a.jsx(ud,{section:o,p:t,size:"sm",vs:r}),a.jsx("h4",{className:"font-bold text-[13px]",style:{color:"#1a1a1a"},children:o.heading})]}),a.jsx("p",{className:"text-[11px] leading-relaxed",style:{color:"#555"},children:o.description})]},o.order))}),s.length>0&&a.jsx("div",{className:"space-y-3",children:s.map(o=>a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"w-2 h-2 rounded-full shrink-0 mt-1.5",style:{backgroundColor:o.highlightColor||t.primary}}),a.jsxs("div",{children:[a.jsx("span",{className:"font-bold text-[12px]",style:{color:"#1a1a1a"},children:o.heading}),a.jsxs("span",{className:"text-[12px]",style:{color:"#555"},children:[" — ",o.description]})]})]},o.order))})]})}const WJ=["#FF6B35","#2EC4B6","#E71D36","#7B2D8E","#1B98E0","#FF9F1C","#06D6A0","#EF476F","#118AB2","#073B4C"];function W2t(e){return e.map((t,r)=>({...t,highlightColor:t.highlightColor||WJ[r%WJ.length],size:t.size||(r===0?"large":r<3?"medium":"small"),icon:t.icon||"zap"}))}function xve({data:e,templateType:t,colorScheme:r,visualStyle:n="illustrations",dimension:i,onRegeneratePoster:s,isRegeneratingPoster:o}){const l=$J[r]||$J.brand,c=W2t(e.sections),d=["vintage-poster","modern-cartoon","hand-drawn-sketch","storybook-watercolor","comic-book"].includes(n),A=d?"illustrations":n,h=(i==null?void 0:i.width)||720,f=(i==null?void 0:i.height)||void 0;if(e.posterImageUrl){const m=QJ[e.visualStyle||"vintage-poster"]||QJ["vintage-poster"],p=l.primary;return a.jsxs("div",{id:"infographic-preview",className:"overflow-hidden mx-auto rounded-xl shadow-md bg-black relative",style:{width:`${h}px`,fontFamily:m},children:[a.jsxs("div",{className:"relative w-full",style:{aspectRatio:"1024 / 1792"},children:[a.jsx("img",{src:e.posterImageUrl,alt:e.title,className:"absolute inset-0 w-full h-full object-cover",loading:"lazy",crossOrigin:"anonymous"}),a.jsx("div",{className:"absolute left-0 right-0 top-0 px-[6%] pt-[3%] pb-[2.5%]",style:{background:"linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.25) 70%, rgba(0,0,0,0) 100%)"},children:a.jsxs("div",{className:"text-center",children:[a.jsx("h2",{className:"font-black tracking-tight leading-[1.05] text-white",style:{fontSize:"clamp(20px, 3.4vw, 38px)",textShadow:"0 2px 8px rgba(0,0,0,0.6)"},children:e.title}),e.subtitle&&a.jsx("p",{className:"mt-2 text-white/90 leading-snug",style:{fontSize:"clamp(11px, 1.5vw, 16px)",textShadow:"0 1px 4px rgba(0,0,0,0.6)"},children:e.subtitle}),a.jsx("div",{className:"mx-auto mt-3 h-[3px] w-16 rounded-full",style:{backgroundColor:p}})]})}),a.jsx("div",{className:"absolute inset-x-0 top-[18%] bottom-[14%] flex flex-col justify-around px-[5%] pointer-events-none",children:c.map((g,v)=>a.jsx("div",{className:"flex justify-end",children:a.jsxs("div",{className:"max-w-[55%] rounded-md px-3 py-2",style:{backgroundColor:"rgba(255,255,255,0.92)",borderLeft:`4px solid ${g.highlightColor||p}`,boxShadow:"0 4px 14px rgba(0,0,0,0.25)"},children:[g.value&&a.jsx("p",{className:"font-bold uppercase tracking-wider leading-none",style:{fontSize:"clamp(9px, 1.05vw, 12px)",color:g.highlightColor||p},children:g.value}),a.jsx("h3",{className:"font-bold leading-tight mt-1",style:{fontSize:"clamp(11px, 1.4vw, 15px)",color:"#1a1a1a"},children:g.heading}),a.jsx("p",{className:"leading-snug mt-1",style:{fontSize:"clamp(9px, 1.15vw, 12px)",color:"#333"},children:g.description})]})},v))}),e.footer&&a.jsx("div",{className:"absolute left-0 right-0 bottom-0 px-[6%] pt-[2.5%] pb-[3%]",style:{background:"linear-gradient(0deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.25) 70%, rgba(0,0,0,0) 100%)"},children:a.jsx("p",{className:"text-center font-semibold text-white leading-snug",style:{fontSize:"clamp(11px, 1.5vw, 16px)",textShadow:"0 1px 4px rgba(0,0,0,0.6)"},children:e.footer})})]}),a.jsxs("div",{className:"sr-only",children:[a.jsx("h2",{children:e.title}),e.subtitle&&a.jsx("p",{children:e.subtitle}),c.map((g,v)=>a.jsxs("div",{children:[a.jsx("h3",{children:g.heading}),g.value&&a.jsx("p",{children:g.value}),a.jsx("p",{children:g.description})]},v)),e.footer&&a.jsx("p",{children:e.footer})]})]})}return a.jsxs("div",{id:"infographic-preview",className:"overflow-hidden mx-auto rounded-xl shadow-sm bg-white",style:{fontFamily:"'Georgia', serif",width:`${h}px`,minHeight:f?`${f}px`:void 0},children:[d&&e.posterError&&a.jsxs("div",{className:"px-6 py-3 flex items-center justify-between gap-4",style:{backgroundColor:"#fef3c7",borderBottom:"1px solid #fde68a"},children:[a.jsxs("div",{className:"text-[12px]",style:{color:"#78350f"},children:[a.jsx("strong",{children:"Poster artwork failed to generate."})," Showing illustrated fallback below."]}),s&&a.jsx("button",{onClick:s,disabled:o,className:"text-[11px] font-semibold px-3 py-1.5 rounded-md disabled:opacity-50",style:{backgroundColor:"#92400e",color:"#fff"},children:o?"Regenerating...":"Regenerate Poster"})]}),a.jsx("div",{className:"px-8 pt-10 pb-6",children:a.jsxs("div",{className:"flex items-start gap-5",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h2",{className:"text-[26px] font-black tracking-tight leading-tight",style:{color:"#1a1a1a"},children:e.title}),e.subtitle&&a.jsx("p",{className:"text-[14px] mt-2 leading-relaxed",style:{color:"#777"},children:e.subtitle}),a.jsx("div",{className:"mt-4 w-10 h-[2px]",style:{backgroundColor:l.primary}})]}),e.headerImage&&A!=="text-only"&&A!=="icons"&&a.jsx("div",{className:"shrink-0",children:a.jsx("img",{src:e.headerImage,alt:"",loading:"lazy",className:"max-h-[90px] w-auto object-contain"})})]})}),a.jsxs("div",{className:"px-8 pb-8",children:[t==="timeline"&&a.jsx(O2t,{sections:c,p:l,vs:A}),t==="statistics"&&a.jsx(F2t,{sections:c,p:l,vs:A}),t==="process"&&a.jsx(L2t,{sections:c,p:l,vs:A}),t==="comparison"&&a.jsx(M2t,{sections:c,p:l,vs:A}),t==="listicle"&&a.jsx(D2t,{sections:c,p:l,vs:A}),t==="mindmap"&&a.jsx(R2t,{sections:c,p:l,vs:A}),t==="pyramid"&&a.jsx(U2t,{sections:c,p:l}),t==="flowchart"&&a.jsx(Q2t,{sections:c,p:l,vs:A}),t==="pros-cons"&&a.jsx(H2t,{sections:c,p:l}),t==="cycle"&&a.jsx($2t,{sections:c,p:l,vs:A}),t==="general"&&a.jsx(z2t,{sections:c,p:l,vs:A})]}),e.footer&&a.jsxs("div",{className:"px-8 pb-6 text-center",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full mx-auto mb-2",style:{backgroundColor:`${l.primary}40`}}),a.jsx("p",{className:"text-[11px]",style:{color:"#999"},children:e.footer})]})]})}const G2t=[{id:"general",name:"General",description:"Universal layout — paste any content",icon:ai,badge:"Popular"},{id:"timeline",name:"Timeline",description:"Chronological milestones & events",icon:tu,badge:"Popular"},{id:"comparison",name:"Comparison",description:"Side-by-side analysis of options",icon:Gbe},{id:"process",name:"Process Flow",description:"Step-by-step guide with arrows",icon:Di,badge:"Popular"},{id:"statistics",name:"Statistics",description:"Big numbers, metrics & data",icon:Ra},{id:"listicle",name:"Listicle",description:"Numbered ranked list of items",icon:are},{id:"mindmap",name:"Mind Map",description:"Central topic with branching subtopics",icon:qte},{id:"pyramid",name:"Pyramid",description:"Layered hierarchy from base to top",icon:Swe,badge:"New"},{id:"flowchart",name:"Flowchart",description:"Decision tree with branching paths",icon:zbe,badge:"New"},{id:"pros-cons",name:"Pros & Cons",description:"Two-column advantage vs disadvantage",icon:xwe,badge:"New"},{id:"cycle",name:"Cycle",description:"Circular repeating process loop",icon:Zm,badge:"New"}];function K2t(){return a.jsx("div",{className:"flex items-center gap-1 h-full",children:a.jsx("div",{className:"flex flex-col items-center gap-1 h-full justify-center",children:[0,1,2].map(e=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-primary"}),a.jsx("div",{className:"w-8 h-1.5 rounded bg-muted-foreground/20"})]},e))})})}function V2t(){return a.jsxs("div",{className:"flex gap-1 h-full items-center justify-center",children:[a.jsx("div",{className:"w-8 h-10 rounded-sm bg-primary/20 border border-primary/30"}),a.jsx("div",{className:"text-[8px] font-bold text-muted-foreground",children:"VS"}),a.jsx("div",{className:"w-8 h-10 rounded-sm bg-accent/40 border border-accent/50"})]})}function q2t(){return a.jsx("div",{className:"flex items-center justify-center gap-0.5 h-full",children:[1,2,3].map((e,t)=>a.jsxs("div",{className:"flex items-center gap-0.5",children:[a.jsx("div",{className:"w-5 h-5 rounded-full bg-primary flex items-center justify-center",children:a.jsx("span",{className:"text-[7px] font-bold text-white",children:e})}),t<2&&a.jsx("div",{className:"w-2 h-0.5 bg-primary/40"})]},e))})}function X2t(){return a.jsx("div",{className:"grid grid-cols-2 gap-1 h-full place-items-center",children:["87%","2.4K","↑12","$5M"].map(e=>a.jsx("div",{className:"text-[8px] font-black text-primary",children:e},e))})}function Y2t(){return a.jsx("div",{className:"flex flex-col gap-0.5 justify-center h-full",children:[1,2,3,4].map(e=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"w-3 h-3 rounded-sm bg-primary flex items-center justify-center",children:a.jsx("span",{className:"text-[6px] font-bold text-white",children:e})}),a.jsx("div",{className:"flex-1 h-1 rounded bg-muted-foreground/15"})]},e))})}function J2t(){return a.jsxs("div",{className:"flex items-center justify-center h-full relative",children:[a.jsx("div",{className:"w-5 h-5 rounded-full bg-primary flex items-center justify-center z-10",children:a.jsx("div",{className:"w-2 h-2 rounded-full bg-white"})}),["-rotate-45 -translate-x-1 -translate-y-3","rotate-45 translate-x-1 -translate-y-3","-rotate-45 -translate-x-1 translate-y-3","rotate-45 translate-x-1 translate-y-3"].map((e,t)=>a.jsx("div",{className:Le("absolute w-3 h-0.5 bg-primary/40",e),style:{transformOrigin:"center"}},t)),["-top-0 left-0","-top-0 right-0","bottom-0 left-0","bottom-0 right-0"].map((e,t)=>a.jsx("div",{className:Le("absolute w-3 h-3 rounded-full bg-primary/20 border border-primary/30",e)},t))]})}function Z2t(){return a.jsx("div",{className:"flex flex-col items-center justify-center gap-[2px] h-full",children:[{w:"w-4"},{w:"w-7"},{w:"w-10"},{w:"w-14"}].map((e,t)=>a.jsx("div",{className:Le("h-2 rounded-sm bg-primary",e.w),style:{opacity:1-t*.15}},t))})}function eCt(){return a.jsxs("div",{className:"flex flex-col items-center justify-center gap-[3px] h-full",children:[a.jsx("div",{className:"w-7 h-3 rounded-sm bg-primary/80 border border-primary/30"}),a.jsx("div",{className:"w-[1px] h-2 bg-primary/40"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-5 h-3 rounded-sm bg-emerald-500/60"}),a.jsx("div",{className:"w-5 h-3 rounded-sm bg-rose-500/60"})]})]})}function tCt(){return a.jsxs("div",{className:"flex gap-1 h-full items-center justify-center",children:[a.jsx("div",{className:"flex flex-col gap-[2px]",children:[0,1,2].map(e=>a.jsx("div",{className:"w-6 h-1.5 rounded-sm bg-emerald-500/50"},e))}),a.jsx("div",{className:"w-[1px] h-8 bg-border"}),a.jsx("div",{className:"flex flex-col gap-[2px]",children:[0,1,2].map(e=>a.jsx("div",{className:"w-6 h-1.5 rounded-sm bg-rose-500/50"},e))})]})}function rCt(){return a.jsxs("div",{className:"flex items-center justify-center h-full relative",children:[a.jsx("div",{className:"w-10 h-10 rounded-full border-2 border-primary/30 border-dashed"}),[0,90,180,270].map(e=>a.jsx("div",{className:"absolute w-2.5 h-2.5 rounded-full bg-primary",style:{transform:`rotate(${e}deg) translateY(-5px)`,transformOrigin:"center 5px"}},e))]})}function nCt(){return a.jsxs("div",{className:"flex flex-col gap-1 justify-center h-full w-full px-1",children:[a.jsx("div",{className:"w-full h-3 rounded-sm bg-primary/70"}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"flex-1 h-5 rounded-sm bg-primary/30"}),a.jsx("div",{className:"flex-1 h-5 rounded-sm bg-primary/20"})]}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"flex-1 h-2.5 rounded-sm bg-muted-foreground/15"}),a.jsx("div",{className:"flex-1 h-2.5 rounded-sm bg-muted-foreground/15"}),a.jsx("div",{className:"flex-1 h-2.5 rounded-sm bg-muted-foreground/15"})]})]})}const iCt={general:nCt,timeline:K2t,comparison:V2t,process:q2t,statistics:X2t,listicle:Y2t,mindmap:J2t,pyramid:Z2t,flowchart:eCt,"pros-cons":tCt,cycle:rCt};function sCt({selected:e,onSelect:t}){return a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"pb-4 border-b border-border",children:[a.jsx("h2",{className:"text-xl font-semibold",children:"Choose a Template"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Pick a layout style for your infographic"})]}),a.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-4",children:G2t.map(r=>{const n=r.icon,i=iCt[r.id],s=e===r.id;return a.jsxs("button",{onClick:()=>t(r),className:Le("group relative rounded-xl border-2 p-5 text-left transition-all hover:shadow-lg hover:-translate-y-0.5",s?"border-primary bg-primary/5 ring-2 ring-primary/20":"border-border hover:border-primary/40"),children:[r.badge&&a.jsx(bt,{variant:r.badge==="Popular"?"default":"secondary",className:"absolute -top-2 -right-2 text-[9px] px-1.5 py-0 h-4 z-10",children:r.badge}),s&&a.jsx("div",{className:"absolute top-2 left-2 w-5 h-5 rounded-full bg-primary flex items-center justify-center z-10",children:a.jsx(dr,{className:"h-3 w-3 text-primary-foreground"})}),a.jsx("div",{className:"w-full h-24 mb-3 rounded-lg bg-muted/30 flex items-center justify-center overflow-hidden",children:i&&a.jsx(i,{})}),a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(n,{className:"h-4 w-4 text-primary shrink-0"}),a.jsx("span",{className:"font-semibold text-sm",children:r.name})]}),a.jsx("p",{className:"text-xs text-muted-foreground leading-snug",children:r.description}),a.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-t from-primary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none"})]},r.id)})})]})}const aCt=["vintage-poster","modern-cartoon","hand-drawn-sketch","storybook-watercolor","comic-book"],GJ=e=>aCt.includes(e),bS={"portrait-a4":{width:794,height:1123,label:"Portrait A4",ratio:"210/297"},square:{width:1080,height:1080,label:"Square",ratio:"1/1"},story:{width:1080,height:1920,label:"Story / Pin",ratio:"9/16"},wide:{width:1200,height:628,label:"Wide Banner",ratio:"1200/628"},"landscape-a4":{width:1123,height:794,label:"Landscape A4",ratio:"297/210"}},oCt=[{value:"brand",label:"Brand",swatch:"hsl(var(--primary))"},{value:"ocean",label:"Ocean",swatch:"hsl(217 91% 55%)"},{value:"sunset",label:"Sunset",swatch:"hsl(20 90% 55%)"},{value:"forest",label:"Forest",swatch:"hsl(150 60% 35%)"},{value:"royal",label:"Royal",swatch:"hsl(270 70% 55%)"}],KJ=[{value:"vintage-poster",label:"Vintage Poster",hint:"Illustrated, retro"},{value:"modern-cartoon",label:"Modern Cartoon",hint:"Bright, friendly"},{value:"hand-drawn-sketch",label:"Hand-drawn",hint:"Sketchy, organic"},{value:"storybook-watercolor",label:"Watercolor",hint:"Soft, painterly"},{value:"comic-book",label:"Comic Book",hint:"Bold panels"},{value:"minimal-icons",label:"Minimal Icons",hint:"Fast, coded"}];function lCt(){var V;const{user:e}=fi(),{usageData:t,updateUsage:r,getRemainingCredits:n}=Ua(),{toast:i}=Dr(),[s,o]=w.useState(null),[l,c]=w.useState(""),[u,d]=w.useState(""),[A,h]=w.useState("brand"),[f,m]=w.useState("vintage-poster"),[p,g]=w.useState("portrait-a4"),[v,x]=w.useState(!1),[y,b]=w.useState(null),[C,j]=w.useState(!1),[S,T]=w.useState(!1),[B,I]=w.useState(null),[P,E]=w.useState(!1),M=n(),_=(t==null?void 0:t.can_generate)??!1,R=(t==null?void 0:t.tier)==="admin"||(t==null?void 0:t.tier)&&t.tier!=="free",G=async()=>{var X;if(!l.trim()||!s){i({title:"Topic required",description:"Please enter a topic for your infographic.",variant:"destructive"});return}if(!_||M&&M.remaining<7){i({title:"Not enough credits",description:"Infographics cost 7 credits. Upgrade your plan for more.",variant:"destructive"});return}x(!0);try{const ne={topic:l.trim(),templateType:s.id,colorScheme:A,visualStyle:f};u.trim()&&(ne.sourceContent=u.trim());const{data:oe,error:pe}=await Re.functions.invoke("generate-infographic",{body:ne});if(pe)throw pe;if(oe!=null&&oe.error)throw new Error(oe.error);b(oe),await r(0,7),oe!=null&&oe.posterError?i({title:"Poster artwork failed",description:"We saved the content and showed an illustrated fallback. You can regenerate the poster from the result view.",variant:"destructive"}):i({title:"Infographic created!",description:`${((X=oe.sections)==null?void 0:X.length)||0} sections generated.`})}catch(ne){console.error("Generation error:",ne),i({title:"Generation failed",description:ne.message||"Please try again.",variant:"destructive"})}finally{x(!1)}},U=async()=>{if(!(!s||!y)){if(!_||M&&M.remaining<7){i({title:"Not enough credits",description:"Regenerating costs 7 credits.",variant:"destructive"});return}x(!0);try{const X={topic:l.trim(),templateType:s.id,colorScheme:A,visualStyle:f};u.trim()&&(X.sourceContent=u.trim());const{data:ne,error:oe}=await Re.functions.invoke("generate-infographic",{body:X});if(oe)throw oe;if(ne!=null&&ne.error)throw new Error(ne.error);b(ne),await r(0,7),ne!=null&&ne.posterError?i({title:"Still failed",description:"Poster artwork could not be generated. Try a different visual style.",variant:"destructive"}):i({title:"Poster regenerated!",description:"Your new artwork is ready."})}catch(X){i({title:"Regeneration failed",description:X.message||"Please try again.",variant:"destructive"})}finally{x(!1)}}},Q=async()=>{if(!(!y||!e||!s)){j(!0);try{const{error:X}=await Re.from("infographics").insert({user_id:e.id,title:y.title,topic:l,template_type:s.id,sections:y.sections,color_scheme:A,status:"draft"});if(X)throw X;i({title:"Saved!",description:"Infographic saved to your library."})}catch(X){i({title:"Save failed",description:X.message,variant:"destructive"})}finally{j(!1)}}},z=()=>{I(y?JSON.parse(JSON.stringify(y)):null),T(!0)},Y=()=>{B&&b(B),T(!1),i({title:"Changes applied",description:"Your edits have been saved locally."})},$=()=>{I(null),T(!1)},O=async()=>{if(!(!B||!s)){E(!0);try{const{data:X,error:ne}=await Re.functions.invoke("generate-infographic",{body:{topic:l.trim(),templateType:s.id,colorScheme:A,visualStyle:f,structuredOutline:B}});if(ne)throw ne;if(X!=null&&X.error)throw new Error(X.error);b(X),I(null),T(!1),await r(0,7),i({title:"Regenerated!",description:"New images created for your edited content."})}catch(X){i({title:"Regeneration failed",description:X.message,variant:"destructive"})}finally{E(!1)}}},W=()=>{b(null),o(null),c(""),d(""),T(!1),I(null)};return v||P?a.jsx(id,{contentType:"infographic"}):!y&&!s?a.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[a.jsx(Dx,{title:"AI Infographic Maker",description:"Choose a layout, enter your topic, and let AI design it for you.",icon:Ra,pillar:"infographics",eyebrow:"Step 1 of 2"}),a.jsx(sCt,{selected:null,onSelect:o})]}):!y&&s?a.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[a.jsx(Dx,{title:s.name,description:s.description,icon:Ra,pillar:"infographics",eyebrow:"Step 2 of 2",topRow:a.jsxs(ve,{variant:"ghost",size:"sm",className:"text-foreground/70 hover:text-foreground -ml-2",onClick:()=>o(null),children:[a.jsx(Cl,{className:"h-4 w-4 mr-1"}),"Back to Templates"]})}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_300px] gap-6",children:[a.jsx(_e,{className:"border border-border-strong rounded-xl shadow-none",children:a.jsxs(Ge,{className:"p-6 sm:p-8 space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] font-semibold text-foreground",children:"What's your infographic about?"}),a.jsx(st,{placeholder:"e.g., Evolution of AI, Benefits of Remote Work",value:l,onChange:X=>c(X.target.value),className:"text-base"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"text-[13px] font-semibold text-foreground",children:["Paste content to extract from ",a.jsx("span",{className:"text-foreground/55 font-normal",children:"(optional)"})]}),a.jsx(Zr,{placeholder:"Paste a blog post, article, notes, or key points.",value:u,onChange:X=>d(X.target.value),className:"min-h-[120px] text-sm"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] font-semibold text-foreground",children:"Color Theme"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:oCt.map(X=>{const ne=A===X.value;return a.jsxs("button",{type:"button",onClick:()=>h(X.value),className:Le("flex items-center gap-2 px-3 h-10 rounded-lg border text-[12px] font-semibold transition-colors",ne?"bg-surface-2 border-border-strong text-foreground":"bg-surface-1 border-border-subtle text-foreground/70 hover:border-border-strong"),children:[a.jsx("span",{className:"h-4 w-4 rounded-full border border-border-subtle",style:{background:X.swatch}}),X.label]},X.value)})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] font-semibold text-foreground",children:"Visual Style"}),a.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:KJ.map(X=>{const ne=f===X.value;return a.jsxs("button",{type:"button",onClick:()=>m(X.value),className:Le("flex flex-col items-start text-left px-3 py-2.5 rounded-lg border transition-colors",ne?"bg-surface-2 border-border-strong":"bg-surface-1 border-border-subtle hover:border-border-strong"),children:[a.jsx("span",{className:"text-[12px] font-semibold text-foreground",children:X.label}),a.jsx("span",{className:"text-[11px] text-foreground/60",children:X.hint})]},X.value)})}),a.jsx("p",{className:"text-[11px] text-foreground/60",children:GJ(f)?"Generates one fully illustrated poster (~30 sec)":"Coded layout with small icons (~5 sec)"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[13px] font-semibold text-foreground",children:"Dimensions"}),a.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-5 gap-2",children:Object.entries(bS).map(([X,ne])=>{const oe=p===X,pe=ne.width>ne.height,ge=ne.width===ne.height?"h-6 w-6":pe?"h-3 w-7":"h-7 w-5";return a.jsxs("button",{type:"button",onClick:()=>g(X),className:Le("flex flex-col items-center justify-center gap-1.5 h-20 rounded-lg border transition-colors px-2",oe?"bg-surface-2 border-border-strong":"bg-surface-1 border-border-subtle hover:border-border-strong"),children:[a.jsx("span",{className:Le("rounded-sm border border-foreground/40",ge)}),a.jsx("span",{className:"text-[10px] font-semibold text-foreground leading-tight text-center",children:ne.label})]},X)})})]})]})}),a.jsx("aside",{className:"lg:sticky lg:top-4 self-start",children:a.jsx(_e,{className:"border border-border-strong rounded-xl shadow-none bg-surface-1",children:a.jsxs(Ge,{className:"p-5 space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-[11px] uppercase tracking-[0.1em] font-semibold text-foreground/55",children:"You'll generate"}),a.jsx("p",{className:"text-[18px] font-semibold text-foreground mt-1 leading-tight",children:s.name}),a.jsxs("p",{className:"text-[12px] text-foreground/60 mt-0.5",children:[bS[p].label," · ",(V=KJ.find(X=>X.value===f))==null?void 0:V.label]})]}),a.jsxs("div",{className:"flex items-center justify-between text-[12px] py-2 border-t border-border-subtle",children:[a.jsx("span",{className:"text-foreground/65",children:"Cost"}),a.jsx("span",{className:"font-semibold text-foreground",children:"7 credits"})]}),a.jsxs("div",{className:"flex items-center justify-between text-[12px] -mt-2",children:[a.jsx("span",{className:"text-foreground/65",children:"Remaining"}),a.jsx("span",{className:"font-semibold text-foreground tabular-nums",children:M?M.remaining:"—"})]}),a.jsxs(ve,{className:"w-full",onClick:G,disabled:!_||!l.trim(),children:[a.jsx(Do,{className:"mr-2 h-4 w-4"}),"Generate Infographic"]})]})})})]})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-bold",children:y.title}),a.jsxs("p",{className:"text-sm text-foreground/70",children:[s==null?void 0:s.name," • ",y.sections.length," sections"]})]}),a.jsx("div",{className:"flex gap-2 flex-wrap",children:S?a.jsxs(a.Fragment,{children:[a.jsxs(ve,{size:"sm",onClick:Y,children:[a.jsx(dr,{className:"h-4 w-4 mr-1"}),"Apply Changes"]}),f==="illustrations"&&a.jsxs(ve,{variant:"secondary",size:"sm",onClick:O,disabled:!_,children:[a.jsx(Zm,{className:"h-4 w-4 mr-1"}),"Regenerate Images (7 credits)"]}),a.jsxs(ve,{variant:"ghost",size:"sm",onClick:$,children:[a.jsx(ml,{className:"h-4 w-4 mr-1"}),"Cancel"]})]}):a.jsxs(a.Fragment,{children:[a.jsx(Kpe,{options:[{label:"Download as PNG",icon:a.jsx(tre,{className:"h-4 w-4"}),action:()=>ave("infographic-preview",y.title)},{label:"Download as PDF",icon:a.jsx(ai,{className:"h-4 w-4"}),action:()=>j1t("infographic-preview",y.title,"portrait")}]}),a.jsxs(ve,{variant:"outline",size:"sm",onClick:z,children:[a.jsx(z5,{className:"h-4 w-4 mr-1"}),"Edit"]}),R?a.jsxs(ve,{variant:"outline",size:"sm",onClick:Q,disabled:C,children:[a.jsx(Mh,{className:"h-4 w-4 mr-1"}),"Save"]}):a.jsxs(ve,{variant:"outline",size:"sm",disabled:!0,title:"Upgrade to save",children:[a.jsx(Mh,{className:"h-4 w-4 mr-1"}),"Upgrade to Save"]}),a.jsx(ve,{variant:"outline",size:"sm",onClick:W,children:"New"})]})})]}),S&&B&&a.jsx(_e,{className:"border-2 border-foreground/10 shadow-md rounded-xl",children:a.jsxs(Ge,{className:"p-4 space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Title"}),a.jsx(st,{value:B.title,onChange:X=>I({...B,title:X.target.value})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Subtitle"}),a.jsx(st,{value:B.subtitle||"",onChange:X=>I({...B,subtitle:X.target.value})})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Sections"}),B.sections.map((X,ne)=>a.jsxs("div",{className:"border rounded-lg p-3 space-y-2",children:[a.jsx(st,{value:X.heading,onChange:oe=>{const pe=[...B.sections];pe[ne]={...pe[ne],heading:oe.target.value},I({...B,sections:pe})},placeholder:"Heading",className:"font-medium"}),a.jsx(Zr,{value:X.description,onChange:oe=>{const pe=[...B.sections];pe[ne]={...pe[ne],description:oe.target.value},I({...B,sections:pe})},placeholder:"Description",className:"min-h-[60px] text-sm"})]},ne))]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Footer"}),a.jsx(st,{value:B.footer||"",onChange:X=>I({...B,footer:X.target.value})})]})]})}),a.jsx("div",{className:"mx-auto",style:{maxWidth:`${bS[p].width}px`},children:a.jsx(xve,{data:S&&B?B:y,templateType:(s==null?void 0:s.id)||"timeline",colorScheme:A,visualStyle:f,dimension:bS[p],onRegeneratePoster:GJ(f)?U:void 0,isRegeneratingPoster:v})})]})}function cCt({onOpenPresentation:e}){var j;const[t,r]=w.useState([]),[n,i]=w.useState(""),[s,o]=w.useState("newest"),[l,c]=w.useState(!0),[u,d]=w.useState(null),[A,h]=w.useState(null),[f,m]=w.useState(0),[p,g]=w.useState(!1),{toast:v}=Dr();w.useEffect(()=>{x()},[]);const x=async()=>{c(!0);try{const{data:S,error:T}=await Re.from("presentations").select("id, title, topic, theme, slide_count, status, created_at, updated_at").order("created_at",{ascending:!1});if(T)throw T;r(S||[])}catch{v({title:"Error",description:"Failed to load presentations.",variant:"destructive"})}finally{c(!1)}},y=async S=>{g(!0);try{const{data:T,error:B}=await Re.from("presentations").select("*").eq("id",S.id).single();if(B)throw B;const I=T.slides||[];h({title:T.title,slides:I,theme:T.theme}),m(0)}catch{v({title:"Error",description:"Failed to load presentation preview.",variant:"destructive"})}finally{g(!1)}},b=async()=>{if(u)try{const{error:S}=await Re.from("presentations").delete().eq("id",u);if(S)throw S;r(T=>T.filter(B=>B.id!==u)),v({title:"Deleted",description:"Presentation removed."})}catch{v({title:"Error",description:"Failed to delete.",variant:"destructive"})}finally{d(null)}},C=t.filter(S=>S.title.toLowerCase().includes(n.toLowerCase())||S.topic.toLowerCase().includes(n.toLowerCase())).sort((S,T)=>s==="oldest"?new Date(S.created_at).getTime()-new Date(T.created_at).getTime():s==="title"?S.title.localeCompare(T.title):new Date(T.created_at).getTime()-new Date(S.created_at).getTime());return l?a.jsx(El,{message:"Loading presentations..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-3 bg-pillar-presentations rounded-xl",children:a.jsx(ac,{className:"h-7 w-7 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Presentation Library"}),a.jsx("p",{className:"text-foreground/70 text-sm",children:"All your saved slide decks"})]})]}),a.jsx(_e,{children:a.jsx(Ge,{className:"pt-4",children:a.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(oc,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),a.jsx(st,{placeholder:"Search presentations...",value:n,onChange:S=>i(S.target.value),className:"pl-10"})]}),a.jsxs(It,{value:s,onValueChange:o,children:[a.jsx(_t,{className:"w-full sm:w-44",children:a.jsx(Ot,{})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"newest",children:"Newest First"}),a.jsx(ye,{value:"oldest",children:"Oldest First"}),a.jsx(ye,{value:"title",children:"Title A-Z"})]})]})]})})}),C.length===0?a.jsx(_e,{className:"text-center py-16",children:a.jsxs(Ge,{children:[a.jsx("div",{className:"w-16 h-16 mx-auto bg-pillar-presentations/10 rounded-2xl flex items-center justify-center mb-4",children:a.jsx(ac,{className:"h-8 w-8 text-pillar-presentations"})}),a.jsx("h3",{className:"font-bold text-lg",children:n?"No matching presentations":"No presentations yet"}),a.jsx("p",{className:"text-foreground/70 mt-1 text-sm max-w-sm mx-auto",children:n?"Try a different search term.":"Create a presentation and save it to see it here."})]})}):a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:C.map(S=>a.jsxs(_e,{className:"group hover:shadow-md transition-all border-2 hover:border-pillar-presentations/30",children:[a.jsxs(ot,{className:"pb-2",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx(bt,{variant:"secondary",className:"text-xs capitalize",children:S.theme}),a.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[a.jsx(Da,{className:"h-3 w-3"}),new Date(S.created_at).toLocaleDateString()]})]}),a.jsx(lt,{className:"text-base line-clamp-2 group-hover:text-pillar-presentations transition-colors",children:S.title}),a.jsx(Mr,{className:"text-sm line-clamp-1",children:S.topic})]}),a.jsxs(Ge,{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(C6,{className:"h-3 w-3"})," ",S.slide_count||"?"," slides"]}),a.jsx(bt,{variant:"outline",className:"text-xs capitalize",children:S.status})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(ve,{size:"sm",variant:"outline",className:"flex-1 text-xs h-8",onClick:()=>y(S),disabled:p,children:[a.jsx(Zh,{className:"h-3 w-3 mr-1"})," Preview"]}),a.jsxs(ve,{size:"sm",variant:"outline",className:"flex-1 text-xs h-8 text-destructive hover:bg-destructive hover:text-destructive-foreground",onClick:()=>d(S.id),children:[a.jsx(Sl,{className:"h-3 w-3 mr-1"})," Delete"]})]})]})]},S.id))}),a.jsx(Mi,{open:!!A,onOpenChange:S=>!S&&h(null),children:a.jsxs(yi,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[a.jsx(bi,{children:a.jsx(wi,{children:A==null?void 0:A.title})}),A&&A.slides.length>0&&a.jsxs("div",{className:"space-y-4",children:[a.jsx(vR,{slide:A.slides[f],theme:A.theme,isActive:!0,presentationTitle:A.title,headerImage:(((j=A.slides[f])==null?void 0:j.layout)==="title",void 0)}),a.jsxs("div",{className:"flex items-center justify-center gap-4",children:[a.jsx(ve,{variant:"outline",size:"icon",onClick:()=>m(Math.max(0,f-1)),disabled:f===0,children:a.jsx(v6,{className:"h-4 w-4"})}),a.jsxs("span",{className:"text-sm text-muted-foreground tabular-nums",children:[f+1," / ",A.slides.length]}),a.jsx(ve,{variant:"outline",size:"icon",onClick:()=>m(Math.min(A.slides.length-1,f+1)),disabled:f===A.slides.length-1,children:a.jsx(vC,{className:"h-4 w-4"})})]})]})]})}),a.jsx(QA,{open:!!u,onOpenChange:S=>!S&&d(null),children:a.jsxs(fd,{children:[a.jsxs(hd,{children:[a.jsx(md,{children:"Delete presentation?"}),a.jsx(gd,{children:"This action cannot be undone."})]}),a.jsxs(pd,{children:[a.jsx(xd,{children:"Cancel"}),a.jsx(vd,{onClick:b,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}function uCt(){const[e,t]=w.useState([]),[r,n]=w.useState(""),[i,s]=w.useState("newest"),[o,l]=w.useState(!0),[c,u]=w.useState(null),[d,A]=w.useState(null),[h,f]=w.useState(!1),{toast:m}=Dr();w.useEffect(()=>{p()},[]);const p=async()=>{l(!0);try{const{data:y,error:b}=await Re.from("infographics").select("id, title, topic, template_type, color_scheme, status, created_at").order("created_at",{ascending:!1});if(b)throw b;t(y||[])}catch{m({title:"Error",description:"Failed to load infographics.",variant:"destructive"})}finally{l(!1)}},g=async y=>{f(!0);try{const{data:b,error:C}=await Re.from("infographics").select("*").eq("id",y.id).single();if(C)throw C;const j=b.sections||[];A({data:{title:b.title,sections:j},templateType:b.template_type,colorScheme:b.color_scheme||"brand"})}catch{m({title:"Error",description:"Failed to load infographic preview.",variant:"destructive"})}finally{f(!1)}},v=async()=>{if(c)try{const{error:y}=await Re.from("infographics").delete().eq("id",c);if(y)throw y;t(b=>b.filter(C=>C.id!==c)),m({title:"Deleted",description:"Infographic removed."})}catch{m({title:"Error",description:"Failed to delete.",variant:"destructive"})}finally{u(null)}},x=e.filter(y=>y.title.toLowerCase().includes(r.toLowerCase())||y.topic.toLowerCase().includes(r.toLowerCase())).sort((y,b)=>i==="oldest"?new Date(y.created_at).getTime()-new Date(b.created_at).getTime():i==="title"?y.title.localeCompare(b.title):new Date(b.created_at).getTime()-new Date(y.created_at).getTime());return o?a.jsx(El,{message:"Loading infographics..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-3 bg-pillar-infographics rounded-xl",children:a.jsx(D1,{className:"h-7 w-7 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Infographic Library"}),a.jsx("p",{className:"text-foreground/70 text-sm",children:"All your saved infographics"})]})]}),a.jsx(_e,{children:a.jsx(Ge,{className:"pt-4",children:a.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(oc,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),a.jsx(st,{placeholder:"Search infographics...",value:r,onChange:y=>n(y.target.value),className:"pl-10"})]}),a.jsxs(It,{value:i,onValueChange:s,children:[a.jsx(_t,{className:"w-full sm:w-44",children:a.jsx(Ot,{})}),a.jsxs(kt,{children:[a.jsx(ye,{value:"newest",children:"Newest First"}),a.jsx(ye,{value:"oldest",children:"Oldest First"}),a.jsx(ye,{value:"title",children:"Title A-Z"})]})]})]})})}),x.length===0?a.jsx(_e,{className:"text-center py-16",children:a.jsxs(Ge,{children:[a.jsx("div",{className:"w-16 h-16 mx-auto bg-pillar-infographics/10 rounded-2xl flex items-center justify-center mb-4",children:a.jsx(D1,{className:"h-8 w-8 text-pillar-infographics"})}),a.jsx("h3",{className:"font-bold text-lg",children:r?"No matching infographics":"No infographics yet"}),a.jsx("p",{className:"text-foreground/70 mt-1 text-sm max-w-sm mx-auto",children:r?"Try a different search term.":"Create an infographic and save it to see it here."})]})}):a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:x.map(y=>a.jsxs(_e,{className:"group hover:shadow-md transition-all border-2 hover:border-pillar-infographics/30",children:[a.jsxs(ot,{className:"pb-2",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx(bt,{variant:"secondary",className:"text-xs capitalize",children:y.template_type}),a.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[a.jsx(Da,{className:"h-3 w-3"}),new Date(y.created_at).toLocaleDateString()]})]}),a.jsx(lt,{className:"text-base line-clamp-2 group-hover:text-pillar-infographics transition-colors",children:y.title}),a.jsx(Mr,{className:"text-sm line-clamp-1",children:y.topic})]}),a.jsxs(Ge,{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[a.jsx(bt,{variant:"outline",className:"text-xs capitalize",children:y.color_scheme||"brand"}),a.jsx(bt,{variant:"outline",className:"text-xs capitalize",children:y.status})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(ve,{size:"sm",variant:"outline",className:"flex-1 text-xs h-8",onClick:()=>g(y),disabled:h,children:[a.jsx(Zh,{className:"h-3 w-3 mr-1"})," Preview"]}),a.jsxs(ve,{size:"sm",variant:"outline",className:"flex-1 text-xs h-8 text-destructive hover:bg-destructive hover:text-destructive-foreground",onClick:()=>u(y.id),children:[a.jsx(Sl,{className:"h-3 w-3 mr-1"})," Delete"]})]})]})]},y.id))}),a.jsx(Mi,{open:!!d,onOpenChange:y=>!y&&A(null),children:a.jsxs(yi,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[a.jsx(bi,{children:a.jsx(wi,{children:d==null?void 0:d.data.title})}),d&&a.jsx(xve,{data:d.data,templateType:d.templateType,colorScheme:d.colorScheme})]})}),a.jsx(QA,{open:!!c,onOpenChange:y=>!y&&u(null),children:a.jsxs(fd,{children:[a.jsxs(hd,{children:[a.jsx(md,{children:"Delete infographic?"}),a.jsx(gd,{children:"This action cannot be undone."})]}),a.jsxs(pd,{children:[a.jsx(xd,{children:"Cancel"}),a.jsx(vd,{onClick:v,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}const dCt=()=>{const{user:e}=fi(),{toast:t}=Dr(),[r,n]=w.useState(!1),[i,s]=w.useState(!1),[o,l]=w.useState("general"),[c,u]=w.useState(""),[d,A]=w.useState(""),[h,f]=w.useState(null),[m,p]=w.useState(null),g=()=>{l("general"),u(""),A(""),f(null),p(null)},v=async y=>{var b,C;if(y.preventDefault(),!e){t({title:"Authentication required",description:"Please sign in to submit feedback.",variant:"destructive"});return}if(!d.trim()){t({title:"Message required",description:"Please enter your feedback message.",variant:"destructive"});return}s(!0);try{const{error:j}=await Re.from("user_feedback").insert({user_id:e.id,user_email:e.email||"",user_name:((b=e.user_metadata)==null?void 0:b.full_name)||((C=e.user_metadata)==null?void 0:C.first_name)||null,feedback_type:o,subject:c.trim()||null,message:d.trim(),rating:h});if(j)throw j;t({title:"Feedback submitted!",description:"Thank you for your feedback. We appreciate it!"}),g(),n(!1)}catch(j){console.error("Error submitting feedback:",j),t({title:"Error",description:"Failed to submit feedback. Please try again.",variant:"destructive"})}finally{s(!1)}},x=[{value:"general",label:"General Feedback"},{value:"bug",label:"Bug Report"},{value:"feature",label:"Feature Request"},{value:"improvement",label:"Improvement Suggestion"},{value:"praise",label:"Praise / Testimonial"},{value:"support",label:"Help & Support"}];return a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>n(!0),className:"fixed bottom-6 right-6 z-50 group","aria-label":"Open feedback and support",children:[a.jsx("span",{className:"absolute inset-0 rounded-full bg-emerald-500/20 animate-ping",style:{animationDuration:"2s"}}),a.jsx("span",{className:"absolute -inset-1 rounded-full bg-white shadow-[0_0_20px_6px_rgba(16,185,129,0.4)] group-hover:shadow-[0_0_30px_10px_rgba(16,185,129,0.5)] transition-shadow duration-300"}),a.jsx("span",{className:"relative flex items-center justify-center w-14 h-14 rounded-full bg-primary shadow-lg group-hover:scale-105 transition-transform duration-200",children:a.jsx(_$,{className:"h-7 w-7 text-white drop-shadow-md",strokeWidth:2})}),a.jsx("span",{className:"absolute right-full mr-3 top-1/2 -translate-y-1/2 px-3 py-1.5 bg-foreground text-background text-sm font-medium rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 whitespace-nowrap pointer-events-none shadow-lg",children:"Help & Feedback"})]}),a.jsx(Mi,{open:r,onOpenChange:n,children:a.jsx(yi,{className:"sm:max-w-[500px]",children:a.jsxs("form",{onSubmit:v,children:[a.jsxs(bi,{children:[a.jsxs(wi,{className:"flex items-center gap-2",children:[a.jsx("div",{className:"p-1.5 rounded-full bg-emerald-500/10",children:a.jsx(_$,{className:"h-5 w-5 text-emerald-500"})}),"Help & Feedback"]}),a.jsx(Qo,{children:"Need help or have feedback? We're here to assist you and would love to hear your thoughts!"})]}),a.jsxs("div",{className:"grid gap-4 py-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(Pe,{htmlFor:"feedback-type",children:"What can we help you with?"}),a.jsxs(It,{value:o,onValueChange:l,children:[a.jsx(_t,{id:"feedback-type",children:a.jsx(Ot,{placeholder:"Select type"})}),a.jsx(kt,{children:x.map(y=>a.jsx(ye,{value:y.value,children:y.label},y.value))})]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsxs(Pe,{htmlFor:"subject",children:["Subject ",a.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),a.jsx(st,{id:"subject",placeholder:"Brief summary",value:c,onChange:y=>u(y.target.value),maxLength:100})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsxs(Pe,{htmlFor:"message",children:["Your Message ",a.jsx("span",{className:"text-destructive",children:"*"})]}),a.jsx(Zr,{id:"message",placeholder:"Tell us how we can help or share your feedback...",value:d,onChange:y=>A(y.target.value),rows:4,className:"resize-none",maxLength:2e3}),a.jsxs("p",{className:"text-xs text-muted-foreground text-right",children:[d.length,"/2000"]})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsxs(Pe,{children:["Rate your experience"," ",a.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),a.jsxs("div",{className:"flex gap-1",children:[[1,2,3,4,5].map(y=>a.jsx("button",{type:"button",className:"p-1 transition-transform hover:scale-110 focus:outline-none focus:ring-2 focus:ring-primary rounded",onClick:()=>f(h===y?null:y),onMouseEnter:()=>p(y),onMouseLeave:()=>p(null),"aria-label":`Rate ${y} star${y>1?"s":""}`,children:a.jsx(eg,{className:`h-6 w-6 transition-colors ${(m!==null?y<=m:y<=(h||0))?"fill-amber-400 text-amber-400":"text-muted-foreground"}`})},y)),h&&a.jsxs("span",{className:"ml-2 text-sm text-muted-foreground self-center",children:[h,"/5"]})]})]})]}),a.jsxs(nd,{children:[a.jsx(ve,{type:"button",variant:"outline",onClick:()=>n(!1),disabled:i,children:"Cancel"}),a.jsx(ve,{type:"submit",disabled:i||!d.trim(),className:"bg-emerald-500 hover:bg-emerald-600 text-white",children:i?a.jsxs(a.Fragment,{children:[a.jsx(Nl,{className:"mr-2 h-4 w-4 animate-spin"}),"Submitting..."]}):"Submit"})]})]})})})]})},ACt=({onSetup:e,onDismiss:t})=>a.jsx(_e,{className:"mb-6 border-primary/20 bg-primary/5",children:a.jsx(Ge,{className:"p-6",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"rounded-xl bg-primary/10 p-3 shrink-0",children:a.jsx(Tx,{className:"h-6 w-6 text-primary"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h3",{className:"text-lg font-semibold mb-1",children:"Set up your Brand Voice"}),a.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:"Tell us about your brand so every piece of content we create is relevant and on-brand. This only takes a minute."}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs(ve,{onClick:e,size:"sm",children:["Set Up Brand Voice",a.jsx(Di,{className:"ml-1 h-4 w-4"})]}),a.jsx(ve,{variant:"ghost",size:"sm",onClick:t,className:"text-muted-foreground",children:"Skip for now"})]})]}),a.jsx(ve,{variant:"ghost",size:"icon",className:"shrink-0 h-8 w-8 text-muted-foreground",onClick:t,children:a.jsx(ml,{className:"h-4 w-4"})})]})})}),fCt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANIAAABDCAYAAADpo1ukAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAA4BSURBVHhe7Z17cF3Ffcc/K2xZDwuQdKWCLdkdSu5tbF050GnITAtumiZMAKkBYlsPGwothAYapg4DsYWZgpHtEJyGNiXQFAjUehjbPCTXMCGlcdohJTM0QZJVS6RJQTJGvrqSsKwrGVv69Q9JV3f3nHMfehJ3PzM74/3unr2rPf6ds7tnd39gsVgsFovFYrFYLBaLxWKxWCwWi8VisVgsljlBmUKUHSuuI5jxZ9F4S+QVarqf0vK40ex/BLgEAFFj1IXvZ29vp5kNgHWcx6L8Mqp8VwIFiKSZWVCcAbqpDx2iof+nZnKUQOYyHi1+FEg3k9xRZ0G6aAgfoj78b2ZqlOmWW993kIbew2aqK6tIZ43vBirzrwIpQLndF3UW5D0a+g5S3/sTMzVKIHMZ31qxGyWLxwXVz31d22iPfGBmjfLwistZk3FPzN8Yoqzzq4Bo+ZoC96DkM5qWCi2RPdR0v6RpKbevG6qHso67tPquyVzO9hWPxrTDBxN5vFmdUczOlY9ErxGOU975V2Y2N1xu2ATN/m+BuicaF96kvCN+I97OYsoCH2laXegGGvte1DSA9bklbCx8HsUnzSRvpJmtPTfT+mG/mUKV7zoq85tNOTnkNba9X80vToXMlBmW+0O2vb/RtdxJdq68jJIlz4O61EzyRDjEN45vov1kn5nkUd+XKOu43tDGuZQlfDvQjpp4+E3yXF8O+0KnNK3J34FSfk1LCamnrLNak9zrmzpmfd3KffJkNgePRzQtlqq8G6gsOKBpj3Ys5jBnNc0F5xtgktbhAS2uyNHibgznnG9KpCm9HICqwkvYVPDj1IwIQJVRe9GrXMoSMwUR74dCQtTn2b7sVVaSYabMsNwveJYLUOn7BCUZr6dkRACKa9h18SFWuTzF3ev7JXau+BNTBOCW4q87jAggZ8ytHDctFZzXu9c3dcz6upV7oevfNIW41C9J4hjS0IeGktiQJM1pSGMuhlR54XdA5ZtyUig+zS1F8V/R00JdzleK7zbVmROn3Kr8x4ALTTkpFFdQXfyXpuxJScZ3WMd5mlaRv4zSzC2aZpkW3oY0plI3pLH0C0wJOaN3wzb+ViGoazQNeoFXEP7FJfwIRO8ulmbfqsU9kWaQAx7hIMKIlj2YNTUmjM9LLuXFlntay+1W7rqCi4CrdVF6EF50KdOr3Fu0eFzUai4r0g2v2rcL1FJNi4fiKZd6HUBE72KKdDryIAdoGdqv5QNoi/wcodGRN5VykSd4Oqx3Q+cZ71dZRX451b6Xo3GRs5R3TgzcPNjgu5KN+fpA+LkTF7Kvf8ooK/L/mGrfv2p5GnpKqR9o1bRYdhTdRTD772OUUZ7rWMI+RqNKZX4ZVb6mmDzw/Ps+/nkwrGmx1BbdSWn2d2OU5MrdO7CUPT1DmhZLbfFfU5r17RjFWa5bO9SdKKGx/4imxWKWK5ymvEPvNrrVdxKRPu497ufoYJiKvCuoLnjD82H6Yu/5PB0eNGVXmgM/A34/GhfZTXnn1Ph6usykXLd2SHTfKvNupKpAN/YZj5HMsY1Si7ju4ixNM1GYXbtR9vWf1BRFthYHSFvyK1PSaBn5taGcR05+/LokQ+vI/xrK7JTbNvSeoTjLdWuHRelmfXSODP4IaEfkHUTeAX5mZomLUnk8smw7oKgqeCzu/bekhHdDjp11jm0uOOPsusXinJAYxJxC/TiR5vJGHkybn/oq5fyd0wkGw/UDrZR1rKa80z8eOq4ys7giEvNEldto9j+C4oqYHFNvSsu08DakUZdJAsR84+iIYUgi5jjr48NaFlGRV6Zpwmn2hbxf/bOJjDq7nJdl3GhKs8Q/RP+l1CLtswYA8n09bkkVb0PKSXN+qznj6LrpqFHdkJRjwmJ+WXfxcZr8H7mGewIjKHW7ccWb8/YGfaP/54joRhvM+gFN/jOOujb5P6I5EKHZ/w7Ngd0TExXJ03Zq+0RX0InIfur6DpryOcn6C/od7RobKn2N5iXJ4m1IT4cH9S6B6xhIpyRbnwESXN5q84hSiz0DxlQwQOvQ35rSnPEuIyi+Z8ootchR1/H6Zk58b9rMTblt7Cr+Q/NST9pHRzgycgdiPCSED7m3+2uadi5jtqkzLDIvSRZvQxpHnyhIm+i6fWppAc2B3TT5n6K26N5oOcEsw9BkYQ0pFYTvO5avzDV3dW4D8V725InKZ1Xmy3w5b7mZ4smW915HybOa1hrZwtHIcU2zTIv4hmR2zcYmDOmh5c8Am1HqVkqzv8mOFeMfSJUyJyOc3cOPHRKmJbKZ8g6zmzf3vMsItZ2fA/k7xzeiRCiVx02+b5hyXP6m805aIlsQ2UlL5A5qupxvRMu0iG9Igm5IaeRQW7wexbWaHsx4mHW5K8Ds+qmFNaSWyB3s6a2OBhHnB8H63muo6Zq/Lp3JfzJMWefd7A0Vsid0NXXhKq3Ok6E+dCvQrl+svqTHE/AWEWq6dlHeuZWarifN5HOe1qFbHe0aG1qHHjMvSZb4hmR2zUoyVxDMdPkxlcOmwscRw5Dahha2a3d0YD97w/XR0Dhwn2PcV1UwB8uNpkFd30n29v2Qxt4Grc6ToaHvGfb01mrXKJYlvoeWKO1nnne0a2xojfy7eUmyxL8JypgCL83+Gkq5zxgprgW5UtNaIgs7a2dSf+JXoIyV6LKB6rwiXZsHfi/3AmqL7qc58CDNgQepLbrTzOIgTczuXxprE9xDy7yQ4CaI2TXLjPn3KCJPx8RBKf1rvTK6hgBjY87lFiPDztXcsaSNOdNHl54xpaSoD+3WBZVOhW+WZ66Uc7W3WV8/n6E0ezvwAPAApdnf5cvn52l5HDjKHeMwY4ZmWQASGFKcMY7IUzzYeQdIh5kUxc2QhC5T4qaLn6DSV8GG3A3OkL+JioJt+gUS5tl39QWnydLY9ybwH5om6nYCjlUZ3qxacoOznjH1rco3V1T3Ouo7yjEtDnDzRf8Ytx3McoXjMI+GtL5gjbNeuRsQ9AeAIuDIU5G7ntUZxVq+c4j4S1J2FG0jmP2QKQMDbDvm5xenQjy8/IusWXrIzABAXe/naAy/bso0Bf7HdQ9M0sgzlHXqK8DdFil6LVqtyv9TKn36VHdr5Ots7YpdaDqOW7kp41JfZqEdhO9R3vFVTXOrb6LFmhW+a6nO1z/Kui1abQq0p76HLAbhOco7bjZlT86JRasArRH9O9IkLZGHors+7z/2CoK7IbntRQJoHb7P8XEwaWSQhoGHTTUl6sNN40vyYwhm3s1apv1Bzps49Z1ROzBA3Ymdpji3yMzaJ7rt+9wjviG5dc3gKC90xW49gL29mx17hgDSjb1Ik9S8t5/WyNaUuyXCSVqGbxyfNJgRQtuwMeWtVnB10TpdmyGJ6jvddoAB2k5dz95+ZzfZsiAkMqSjhoEMcCRyG2+hD5zrwh20Dj+ASIwuYUZyvA/cqOnaRcOJq4CXQcJxnsyjCN0gT9LYU0pN12tmBgBG+cDx+2l53q/xpq5ngRZNC2ZVaXHcyk3IKNAF8kTc+k6SSjtAF/A4jaEgW4792MwAgFLvG/fsBF095myfiX6NEOLtsNsYtNsUUkKUub0kEVPjSEFoG07h96XH+NSRuB3G5LixUr6Hw3ZlvMVisVgsFovFYrFYLBaLxWKxWCwWi8VisSwo8RetWizx2FkUZHX2Vtc1dEKYB0P38lbMKbuJmE33NsyRGxoPXCpqsSRJk/91lPqsKUdpiWyhpmuXKbsy2+5tmCM3NB7EX2tnsXixwedHqbWmrBHMui2ph/VcuLcZJ/Fvxyfp660hWabHxry/SPj/R3EJlblfMGUH8+neZo5I2uIsliirSGdXoBtFQYz6a5D/Ar4IasphgMgLlHd6H8W8ruAibso7phul9CDqDZQ4t5eIykDJ50FNvYWEtynv+JSWD6DZf5+2MXAS4bMoNbWrV6QThdMbSstQPTXHXjBlN6whWVJnR/EGgln68b4tQ5XUdDfSHPgn4M+jusgZ9vatpK7X/SDK6bi32VG8mWDW1Nkbbu5t4jGTnbcexH81WyxulGR+RYsLIeq6x5/cdSH9QH6lFrM607nNfpLpuLdpG3xtRu5t5gBrSJbUqPR9wjHJoOQHtDO+MbCx702Et7X0YGbi8VQqTNe9zRwye3+c5f8HVXm3Gf9vxqjv099CrRHjFFf122zINdx8nltYQ7IkzyrSEaX7wxU5TEOv7jLmma46h8uajYV6dzAVmvy1NPtPO9ywREOge6HH+9aQLMmzsfh6Y6YO2oadZ4j/kpMopU9GiFybkvcMnZWg0l3csEwElrPWxU3PPGINyZI8wSzdY4cQYk+XcQT0BM5Jh0VcnuU96fAbjjUkS3KMn4/+R5oWO8lg4jbpUJKd/OGQOgkPaFxoFrRfafkNojL3aqoKX9U04SdAj6bFoqQUVCAaF4THRzN59ZdTx2IlcyLqJzNWUpr9B9H4msxPE8y+Oxon+RNRwX5Hsiwoac71bIqrUKzzDLFGNJ5fsazfWU4i/nvk3dlyvzJXWEOyWGYBa0iWhUXGnKfYqkiC5T4fP/c2doxkSQ63sYxIE6h4R/ouQ3GFppheLtbnlrCp0FgwKgeo79vP2KjL8c1p6VT7tmheMYRjlHc4ncWtL1iDOvu7pkx1YS2K35kS5CB7Qntis6AQWod/ypGRpM5Xt4ZkSQ43QzInBUzc3KSYhsQcubdhft3Q2K6dZeGZM/c28+eGxhqSZeE5B9zbWEOyJIfTvU3qblK83cXMvnubcVJwA+NC6m5oLBaLxWKxWCwWi8VisVhmh/8DsKoLO1UZjTQAAAAASUVORK5CYII=",hCt={content:"create",presentations:"presentations",infographics:"infographics"},pCt=[{id:"content",label:"Content",icon:R1,colorClass:"text-pillar-content",bgClass:"bg-pillar-content",borderClass:"border-pillar-content"},{id:"presentations",label:"Presentations",icon:ac,colorClass:"text-pillar-presentations",bgClass:"bg-pillar-presentations",borderClass:"border-pillar-presentations"},{id:"infographics",label:"Infographics",icon:Ra,colorClass:"text-pillar-infographics",bgClass:"bg-pillar-infographics",borderClass:"border-pillar-infographics"}],VJ=()=>{const[e,t]=w.useState("create"),[r,n]=w.useState("content"),[i,s]=w.useState(null),[o,l]=w.useState(()=>localStorage.getItem("brandVoicePromptDismissed")==="true"),{action:c,id:u}=NC(),{isAdmin:d,isSuperAdmin:A,user:h}=fi(),f=hs(),m=Ad(),p=HU(),{toast:g}=Dr(),{usageData:v}=Ua(),x=async()=>{try{const{error:I}=await Re.auth.signOut();I?g({title:"Error signing out",description:I.message,variant:"destructive"}):window.location.href="/"}catch(I){console.error("Error signing out:",I),g({title:"Something went wrong",description:"Please try again later.",variant:"destructive"})}},y=I=>{switch(I){case"elite":return a.jsx(ru,{className:"w-4 h-4 text-navy"});case"pro":return a.jsx(ln,{className:"w-4 h-4 text-pillar-presentations"});case"lite":return a.jsx(ln,{className:"w-4 h-4 text-primary"});case"admin":return a.jsx(ru,{className:"w-4 h-4 text-saffron"});default:return a.jsx(ire,{className:"w-4 h-4 text-foreground/60"})}},b=()=>{if(!v)return"Loading...";const I=v.tier_limits.generation_limit?v.tier_limits.generation_limit-v.current_usage.generations_used:null;return v.tier==="admin"?"Unlimited credits • Admin access":I===null?"Unlimited credits":`${I} of ${v.tier_limits.generation_limit} credits left`};w.useEffect(()=>{const P=new URLSearchParams(m.search).get("tab");if(P&&["create","library","presets","profile","ideas","studio","content","seo","messages","users","calendar","growth-lab","brand-voice","remix","feedback","integrations","evaluator","analytics","seo-analytics","presentations","infographics","presentations-library","infographics-library"].includes(P)){const M=P;t(M),n(M==="presentations"||M==="presentations-library"?"presentations":M==="infographics"||M==="infographics-library"?"infographics":"content")}},[m.search]),w.useEffect(()=>{h&&Re.from("brand_voices").select("id",{count:"exact",head:!0}).eq("user_id",h.id).then(({count:I})=>s(I??0))},[h,e]);const C=()=>{l(!0),localStorage.setItem("brandVoicePromptDismissed","true")},j=i===0&&!o&&e!=="brand-voice",S=I=>{(I==="content"||I==="seo"||I==="messages"||I==="users"||I==="analytics")&&!d||I==="feedback"&&!A||(t(I),f(`/dashboard?tab=${I}`))},T=I=>{n(I);const P=hCt[I];t(P),f(`/dashboard?tab=${P}`)},B=(()=>{if(!v)return null;if(v.tier==="admin")return{remaining:"∞",total:"∞"};const I=v.tier_limits.generation_limit;if(I==null)return{remaining:"∞",total:"∞"};const P=v.current_usage.generations_used;return{remaining:Math.max(0,I-P),total:I}})();return a.jsx(Coe,{defaultOpen:!p,children:a.jsxs("div",{className:"min-h-screen flex flex-col w-full bg-surface-0 pt-14",children:[a.jsx("header",{className:"fixed inset-x-0 top-0 h-14 border-b border-border-subtle bg-surface-1 z-50",children:a.jsxs("div",{className:"relative h-full flex items-center px-3 md:px-5",children:[a.jsx("div",{className:"flex items-center shrink-0",children:a.jsx("img",{src:fCt,alt:"WordSmith AGI",className:"h-8 w-auto object-contain"})}),a.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:a.jsx("div",{className:"flex items-center bg-surface-2 rounded-lg p-0.5 gap-0.5 border border-border-subtle",children:pCt.map(I=>{const P=r===I.id;return a.jsxs("button",{onClick:()=>T(I.id),className:Le("flex items-center gap-1.5 px-3 md:px-4 h-8 rounded-md text-[12px] md:text-[13px] font-medium transition-colors select-none whitespace-nowrap",P?"bg-surface-1 text-foreground shadow-[0_0_0_1px_hsl(var(--border-subtle))]":"text-foreground/70 hover:text-foreground"),"aria-pressed":P,children:[a.jsx(I.icon,{className:Le("h-3.5 w-3.5 shrink-0",P?I.colorClass:"text-foreground/60")}),a.jsx("span",{className:"hidden sm:inline",children:I.label})]},I.id)})})}),a.jsxs("div",{className:"ml-auto flex items-center gap-2 shrink-0",children:[B&&a.jsxs("button",{onClick:()=>S("profile"),className:"hidden md:inline-flex items-center gap-1.5 px-2.5 h-8 rounded-md bg-surface-2 hover:bg-border-subtle transition-colors text-[12px] font-medium text-foreground",title:`${B.remaining} of ${B.total} credits left`,children:[a.jsx(ln,{className:"h-3.5 w-3.5 text-primary"}),a.jsx("span",{className:"tabular-nums",children:B.remaining}),a.jsxs("span",{className:"text-foreground/60",children:["/",B.total]})]}),a.jsx(joe,{className:"shrink-0 h-8 w-8"}),a.jsxs(fE,{children:[a.jsx(hE,{asChild:!0,children:a.jsx(ve,{variant:"ghost",size:"icon",className:"rounded-full h-8 w-8 hover:bg-surface-2",children:a.jsx(_U,{className:"h-7 w-7",children:a.jsx(kU,{className:"bg-primary/10 text-primary font-semibold text-sm",children:a.jsx(tg,{className:"h-4 w-4"})})})})}),a.jsxs(EC,{align:"end",className:"w-64",children:[a.jsx(fU,{children:a.jsxs("div",{className:"flex flex-col space-y-1",children:[a.jsx("p",{className:"text-sm font-medium leading-none",children:h==null?void 0:h.email}),a.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[v&&y(v.tier),a.jsxs("p",{className:"text-xs text-foreground/70 capitalize",children:[(v==null?void 0:v.tier)||"Free"," Plan"]})]})]})}),v&&a.jsxs(a.Fragment,{children:[a.jsx(Im,{}),a.jsx("div",{className:"px-2 py-2",children:a.jsx("p",{className:"text-xs text-foreground/70",children:b()})})]}),a.jsx(Im,{}),a.jsxs(xA,{onClick:()=>S("profile"),className:"cursor-pointer",children:[a.jsx(gy,{className:"mr-2 h-4 w-4"}),a.jsx("span",{children:"Account Preferences"})]}),a.jsx(Im,{}),a.jsxs(xA,{onClick:x,className:"cursor-pointer text-destructive focus:text-destructive",children:[a.jsx(lre,{className:"mr-2 h-4 w-4"}),a.jsx("span",{children:"Sign Out"})]})]})]})]})]})}),a.jsxs("div",{className:"flex-1 flex min-h-0 overflow-hidden bg-surface-0",children:[a.jsx(ITe,{activeTab:e,onTabChange:S,activePillar:r}),a.jsx("main",{className:"flex-1 p-4 md:p-6 lg:p-8 pb-12 overflow-auto bg-surface-0",children:a.jsxs("div",{className:"max-w-6xl mx-auto",children:[j&&a.jsx(ACt,{onSetup:()=>S("brand-voice"),onDismiss:C}),c==="view"&&u?a.jsx(VIe,{}):c==="edit"&&u?a.jsx(qIe,{}):e==="ideas"?a.jsx(pIe,{}):e==="studio"?a.jsx(FIe,{}):e==="growth-lab"?a.jsx(SQe,{}):e==="create"?a.jsx(TPe,{}):e==="presets"?a.jsx(iIe,{}):e==="library"?a.jsx(GPe,{}):e==="profile"?a.jsx(C6e,{}):e==="calendar"?a.jsx(vQe,{}):e==="brand-voice"?a.jsx(TQe,{}):e==="remix"?a.jsx(LQe,{}):e==="integrations"?a.jsx(UQe,{}):e==="evaluator"?a.jsx(WQe,{}):e==="seo-analytics"?a.jsx(Xht,{}):e==="presentations"?a.jsx(T2t,{}):e==="presentations-library"?a.jsx(cCt,{}):e==="infographics"?a.jsx(lCt,{}):e==="infographics-library"?a.jsx(uCt,{}):e==="content"&&d?a.jsx(m6e,{}):e==="seo"&&d?a.jsx(x6e,{}):e==="analytics"&&d?a.jsx(Kht,{}):e==="messages"&&d?a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Contact Submissions"}),a.jsx(y6e,{})]}):e==="users"&&d?a.jsx(w6e,{isSuperAdmin:A}):e==="feedback"&&A?a.jsx(b6e,{}):["content","seo","messages","users","analytics"].includes(e)&&!d?a.jsxs("div",{className:"text-center py-12",children:[a.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Access Denied"}),a.jsx("p",{className:"text-foreground/75",children:"You need admin privileges to access this section."})]}):e==="feedback"&&!A?a.jsxs("div",{className:"text-center py-12",children:[a.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Access Denied"}),a.jsx("p",{className:"text-foreground/75",children:"You need super admin privileges to access this section."})]}):null]})}),a.jsx(dCt,{})]})]})})},mCt=()=>{const[e,t]=w.useState(!1),r=hs(),{toast:n}=Dr();w.useEffect(()=>{const{data:{subscription:s}}=Re.auth.onAuthStateChange((o,l)=>{l!=null&&l.user&&r("/welcome")});return Re.auth.getSession().then(({data:{session:o}})=>{o!=null&&o.user&&r("/welcome")}),()=>s.unsubscribe()},[r]);const i=async()=>{t(!0);try{const s=`${window.location.origin}/welcome`,{error:o}=await Re.auth.signInWithOAuth({provider:"google",options:{redirectTo:s}});o&&(n({title:"Sign in failed",description:o.message,variant:"destructive"}),t(!1))}catch{n({title:"Something went wrong",description:"Please try again later.",variant:"destructive"}),t(!1)}};return a.jsxs(a.Fragment,{children:[a.jsx(oi,{pageSlug:"/auth",title:"Sign In - WordSmith AGI | AI Content Creation Platform",description:"Sign in to WordSmith AGI to access AI-powered content creation, SEO optimization, and marketing strategy tools.",canonicalUrl:"https://wordsmithagi.com/auth"}),a.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-md",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsxs(Et,{to:"/",className:"flex items-center justify-center space-x-2 mb-6",children:[a.jsx("div",{className:"w-10 h-10 bg-primary rounded-lg flex items-center justify-center",children:a.jsx("span",{className:"text-white font-bold",children:"W"})}),a.jsx("span",{className:"font-display font-bold text-2xl",children:"WordSmith AGI"})]}),a.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Welcome"}),a.jsx("p",{className:"text-muted-foreground",children:"Sign in to your account or create a new one"})]}),a.jsxs(_e,{className:"brand-card hover-lift",children:[a.jsxs(ot,{children:[a.jsx(lt,{className:"text-center",children:"Get Started"}),a.jsx(Mr,{className:"text-center",children:"Sign in with your Google account to start creating amazing content"})]}),a.jsx(Ge,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"text-center space-y-2 mb-6",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"Join thousands of creators using AI to write amazing content"})}),a.jsxs(ve,{onClick:i,className:"w-full",variant:"hero",disabled:e,size:"lg",children:[a.jsxs("svg",{className:"w-5 h-5 mr-2",viewBox:"0 0 24 24",children:[a.jsx("path",{fill:"currentColor",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),a.jsx("path",{fill:"currentColor",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),a.jsx("path",{fill:"currentColor",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),a.jsx("path",{fill:"currentColor",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),e?"Signing in...":"Continue with Google"]}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-0 flex items-center",children:a.jsx("span",{className:"w-full border-t"})}),a.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:a.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Quick & Secure"})})]}),a.jsx("div",{className:"text-center space-y-2",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"By continuing, you agree to our Terms of Service and Privacy Policy"})})]})})]}),a.jsx("div",{className:"text-center mt-6",children:a.jsx(Et,{to:"/",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"← Back to home"})})]})})]})},gCt=[{id:"personal_brand",title:"Personal Brand",subtitle:"Build authority & grow audience",icon:tg,color:"bg-violet-500"},{id:"saas",title:"SaaS",subtitle:"Get more users & reduce churn",icon:W5,color:"bg-blue-500"},{id:"course",title:"Course",subtitle:"Launch & sell your expertise",icon:pc,color:"bg-orange-500"},{id:"freelance_service",title:"Freelance Service",subtitle:"Get more clients",icon:g6,color:"bg-emerald-500"}];function vCt({onSelect:e,isLoading:t}){return a.jsxs("div",{className:"w-full max-w-2xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("h2",{className:"text-2xl sm:text-3xl font-bold mb-2",children:"What are you trying to grow right now?"}),a.jsx("p",{className:"text-muted-foreground",children:"We'll create your personalized marketing starter kit"})]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:gCt.map(r=>{const n=r.icon;return a.jsxs("button",{onClick:()=>e(r.id),disabled:t,className:Le("relative group p-6 rounded-xl border-2 border-border bg-card","transition-all duration-300 ease-out","hover:border-primary/50 hover:shadow-lg hover:shadow-primary/10","hover:-translate-y-1","focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2","disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:translate-y-0","text-left"),children:[a.jsx("div",{className:Le("w-12 h-12 rounded-lg flex items-center justify-center mb-4",r.color,"shadow-lg"),children:a.jsx(n,{className:"w-6 h-6 text-white"})}),a.jsx("h3",{className:"font-semibold text-lg mb-1 group-hover:text-primary transition-colors",children:r.title}),a.jsx("p",{className:"text-sm text-muted-foreground",children:r.subtitle}),a.jsx("div",{className:Le("absolute inset-0 rounded-xl opacity-0 group-hover:opacity-5",r.color,"transition-opacity")})]},r.id)})}),a.jsx("p",{className:"text-center text-xs text-muted-foreground mt-6",children:"This helps us personalize your experience • Takes about 30 seconds"})]})}const qJ=[{id:1,label:"Creating your 7-day action plan"},{id:2,label:"Writing 3 ready-to-post content pieces"},{id:3,label:"Scheduling your content calendar"}];function xCt({isGenerating:e}){const[t,r]=w.useState(0),[n,i]=w.useState(0);return w.useEffect(()=>{if(!e)return;const s=setInterval(()=>{r(l=>l{i(l=>l<95?l+1:l)},250);return()=>{clearInterval(s),clearInterval(o)}},[e]),a.jsxs("div",{className:"w-full max-w-md mx-auto text-center",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx("div",{className:"w-16 h-16 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:a.jsx(Nl,{className:"w-8 h-8 text-primary animate-spin"})}),a.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Building your marketing starter kit..."}),a.jsx("p",{className:"text-muted-foreground",children:"This usually takes about 30 seconds"})]}),a.jsxs("div",{className:"mb-8",children:[a.jsx(MC,{value:n,className:"h-2 mb-2"}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[Math.round(n),"%"]})]}),a.jsx("div",{className:"space-y-4 text-left",children:qJ.map((s,o)=>{const l=o{await navigator.clipboard.writeText(A),l(h),c({title:"Copied to clipboard!",description:"Ready to paste anywhere"}),setTimeout(()=>l(null),2e3)},d=A=>({LinkedIn:"bg-blue-500/10 text-blue-600","Twitter/X":"bg-sky-500/10 text-sky-600",Blog:"bg-purple-500/10 text-purple-600"})[A]||"bg-muted text-muted-foreground";return a.jsxs("div",{className:"w-full max-w-3xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:a.jsx(Do,{className:"w-8 h-8 text-primary"})}),a.jsx("h2",{className:"text-2xl sm:text-3xl font-bold mb-2",children:"Your Marketing Starter Kit is Ready! 🎉"}),a.jsx("p",{className:"text-muted-foreground",children:"Everything you need to start growing today"})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs(_e,{children:[a.jsx(ot,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",children:a.jsx(Da,{className:"w-4 h-4 text-primary"})}),a.jsx(lt,{className:"text-lg",children:e.title})]}),a.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>s(!i),children:i?a.jsxs(a.Fragment,{children:["Show less ",a.jsx(x6,{className:"w-4 h-4 ml-1"})]}):a.jsxs(a.Fragment,{children:["View all 7 days ",a.jsx(y0,{className:"w-4 h-4 ml-1"})]})})]})}),a.jsx(Ge,{children:a.jsxs("div",{className:"space-y-3",children:[(i?e.days:e.days.slice(0,2)).map(A=>a.jsxs("div",{className:"p-3 rounded-lg bg-muted/50 border border-border",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsxs(bt,{variant:"outline",className:"text-xs",children:["Day ",A.day]}),a.jsx("span",{className:"font-medium text-sm",children:A.title})]}),a.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:A.action}),a.jsxs("p",{className:"text-xs text-primary/80",children:["💡 ",A.tip]})]},A.day)),!i&&e.days.length>2&&a.jsxs("p",{className:"text-sm text-muted-foreground text-center",children:["+ ",e.days.length-2," more days"]})]})})]}),a.jsxs(_e,{children:[a.jsx(ot,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",children:a.jsx(ai,{className:"w-4 h-4 text-primary"})}),a.jsx(lt,{className:"text-lg",children:"Your First 3 Content Pieces"})]})}),a.jsx(Ge,{children:a.jsx("div",{className:"space-y-4",children:t.map((A,h)=>a.jsxs("div",{className:"p-4 rounded-lg border border-border bg-card",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(bt,{className:d(A.platform),children:A.platform}),a.jsx("span",{className:"font-medium text-sm",children:A.title})]}),a.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>u(A.content,h),children:o===h?a.jsxs(a.Fragment,{children:[a.jsx(dr,{className:"w-4 h-4 mr-1 text-primary"}),"Copied"]}):a.jsxs(a.Fragment,{children:[a.jsx(zl,{className:"w-4 h-4 mr-1"}),"Copy"]})})]}),a.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap line-clamp-4",children:A.content})]},h))})})]}),a.jsxs(_e,{children:[a.jsx(ot,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center",children:a.jsx(Da,{className:"w-4 h-4 text-primary"})}),a.jsx(lt,{className:"text-lg",children:"Your 7-Day Calendar"})]})}),a.jsx(Ge,{children:a.jsx("div",{className:"grid grid-cols-7 gap-1 sm:gap-2",children:r.slice(0,7).map((A,h)=>a.jsxs("div",{className:Le("p-2 rounded-lg text-center border",A.contentRef!==null?"bg-primary/10 border-primary/20":"bg-muted/50 border-border"),children:[a.jsx("span",{className:"text-xs font-medium block mb-1",children:A.dayName.slice(0,3)}),a.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:A.task.split(" ").slice(0,2).join(" ")})]},h))})})]})]}),a.jsxs("div",{className:"mt-8 text-center",children:[a.jsxs(ve,{onClick:n,variant:"hero",size:"lg",className:"min-w-[200px]",children:["Go to Dashboard",a.jsx(Di,{className:"w-4 h-4 ml-2"})]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-3",children:"All content saved to your Library"})]})]})}const bCt=()=>{const[e,t]=w.useState("name"),[r,n]=w.useState(""),[i,s]=w.useState(!1),[o,l]=w.useState(!0),[c,u]=w.useState(null),d=hs(),{toast:A}=Dr();w.useEffect(()=>{(async()=>{const{data:{user:v}}=await Re.auth.getUser();if(!v){d("/auth");return}const{data:x}=await Re.from("profiles").select("first_name, onboarding_completed").eq("user_id",v.id).single();if(x!=null&&x.onboarding_completed){d("/dashboard");return}x!=null&&x.first_name&&(n(x.first_name),t("growth")),l(!1)})()},[d]);const h=async g=>{if(g.preventDefault(),!r.trim()){A({title:"Please enter your name",variant:"destructive"});return}t("growth")},f=async g=>{t("generating"),s(!0);try{const{data:{session:v}}=await Re.auth.getSession();if(!v){d("/auth");return}const x=await fetch("https://aycpjrxjzgepcqdvvlwc.supabase.co/functions/v1/generate-onboarding-kit",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${v.access_token}`},body:JSON.stringify({growthType:g,firstName:r.trim()})}),y=await x.json();if(!x.ok){if(y.alreadyCompleted){d("/dashboard");return}throw new Error(y.error||"Failed to generate content")}u(y.data),t("results")}catch(v){console.error("Generation error:",v),A({title:"Something went wrong",description:"Please try again or skip for now.",variant:"destructive"}),t("growth")}finally{s(!1)}},m=()=>{A({title:`Welcome, ${r.trim()}! 🎉`,description:"Your starter kit is ready in the Library."}),d("/dashboard")},p=async()=>{s(!0);try{const{data:{user:g}}=await Re.auth.getUser();if(!g){d("/auth");return}await Re.from("profiles").upsert({user_id:g.id,first_name:r.trim()||null,onboarding_completed:!0},{onConflict:"user_id"}),A({title:r.trim()?`Welcome, ${r.trim()}!`:"Welcome!",description:"Let's get started."}),d("/dashboard")}catch{A({title:"Something went wrong",description:"Please try again.",variant:"destructive"})}finally{s(!1)}};return o?a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})}):a.jsx("div",{className:"min-h-screen flex items-center justify-center p-4 bg-background",children:a.jsxs("div",{className:"w-full max-w-3xl",children:[a.jsx("div",{className:"text-center mb-8",children:a.jsxs(Et,{to:"/",className:"inline-flex items-center justify-center space-x-2",children:[a.jsx("div",{className:"w-10 h-10 bg-primary rounded-lg flex items-center justify-center",children:a.jsx("span",{className:"text-primary-foreground font-bold",children:"W"})}),a.jsx("span",{className:"font-display font-bold text-2xl",children:"WordSmith AGI"})]})}),e==="name"&&a.jsxs(_e,{className:"brand-card hover-lift max-w-md mx-auto",children:[a.jsxs(ot,{className:"text-center",children:[a.jsx(lt,{className:"text-2xl",children:"Hey there! 👋"}),a.jsx(Mr,{className:"text-base",children:"What should we call you?"})]}),a.jsx(Ge,{children:a.jsxs("form",{onSubmit:h,className:"space-y-6",children:[a.jsx("div",{className:"space-y-2",children:a.jsx(st,{type:"text",placeholder:"Your first name",value:r,onChange:g=>n(g.target.value),className:"text-center text-lg py-6",autoFocus:!0,disabled:i})}),a.jsxs(ve,{type:"submit",className:"w-full",variant:"hero",size:"lg",disabled:i,children:["Continue",a.jsx(Di,{className:"w-4 h-4 ml-2"})]}),a.jsx("p",{className:"text-xs text-center text-muted-foreground",children:"We'd love to make your experience more personal"})]})})]}),e==="growth"&&a.jsxs("div",{className:"animate-in fade-in slide-in-from-right-4 duration-300",children:[a.jsx(vCt,{onSelect:f,isLoading:i}),a.jsx("div",{className:"text-center mt-6",children:a.jsx("button",{onClick:p,disabled:i,className:"text-sm text-muted-foreground hover:text-foreground transition-colors underline-offset-4 hover:underline",children:"I'll explore on my own"})})]}),e==="generating"&&a.jsx("div",{className:"animate-in fade-in duration-300",children:a.jsx(xCt,{isGenerating:i})}),e==="results"&&c&&a.jsx("div",{className:"animate-in fade-in slide-in-from-bottom-4 duration-500",children:a.jsx(yCt,{marketingPlan:c.marketingPlan,contentPieces:c.contentPieces,calendarItems:c.calendarItems,onContinue:m})})]})})},wCt=()=>{const e=Ad();return w.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),a.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),a.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})},wS=()=>{const[e,t]=w.useState([]),[r,n]=w.useState([]),[i,s]=w.useState(!0),[o,l]=w.useState(""),[c,u]=w.useState("all"),{type:d}=NC();w.useEffect(()=>{A()},[]),w.useEffect(()=>{h()},[e,o,c]);const A=async()=>{try{const{data:g,error:v}=await Re.from("website_content").select("*").eq("status","published").order("published_at",{ascending:!1});if(v)throw v;t(g||[])}catch(g){console.error("Error fetching posts:",g)}finally{s(!1)}},h=()=>{let g=[...e];o&&(g=g.filter(v=>{var x,y;return v.title.toLowerCase().includes(o.toLowerCase())||((x=v.excerpt)==null?void 0:x.toLowerCase().includes(o.toLowerCase()))||((y=v.keywords)==null?void 0:y.some(b=>b.toLowerCase().includes(o.toLowerCase())))})),c!=="all"&&(g=g.filter(v=>v.content_type===c)),d&&d!=="all"&&(g=g.filter(v=>v.content_type===d)),n(g)},f=r.filter(g=>g.featured),m=r.filter(g=>!g.featured),p=g=>g.replace("_"," ").replace(/\b\w/g,v=>v.toUpperCase());return i?a.jsxs("div",{className:"min-h-screen",children:[a.jsx(Ln,{}),a.jsx("div",{className:"max-w-7xl mx-auto px-4 py-16",children:a.jsx("div",{className:"text-center",children:"Loading..."})}),a.jsx(Mn,{})]}):a.jsxs("div",{className:"min-h-screen",children:[a.jsx(oi,{pageSlug:"/blog",title:"Blog & Resources - WordSmith AGI | AI Content Marketing Insights",description:"Explore expert insights on AI content creation, SEO optimization, GEO strategies, and digital marketing tips from the WordSmith AGI team.",keywords:["AI content blog","SEO tips","content marketing blog","AI writing insights","GEO optimization"],canonicalUrl:"https://wordsmithagi.com/blog",schemaType:"Blog"}),a.jsx(Ln,{}),a.jsx("section",{className:"bg-background py-16 border-b border-border",children:a.jsx("div",{className:"max-w-7xl mx-auto px-4",children:a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:d?`${p(d)}s`:"Blog & Resources"}),a.jsx("p",{className:"text-lg text-muted-foreground mb-8",children:"Discover insights, tutorials, and guides about AI-powered content creation"}),a.jsxs("div",{className:"flex flex-col md:flex-row gap-4 justify-center items-center max-w-2xl mx-auto",children:[a.jsxs("div",{className:"relative flex-1 w-full",children:[a.jsx(oc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4"}),a.jsx(st,{placeholder:"Search articles...",value:o,onChange:g=>l(g.target.value),className:"pl-10"})]}),!d&&a.jsxs(It,{value:c,onValueChange:u,children:[a.jsxs(_t,{className:"w-full md:w-48",children:[a.jsx(rre,{className:"w-4 h-4 mr-2"}),a.jsx(Ot,{placeholder:"Filter by type"})]}),a.jsxs(kt,{children:[a.jsx(ye,{value:"all",children:"All Content"}),a.jsx(ye,{value:"blog_post",children:"Blog Posts"}),a.jsx(ye,{value:"help_article",children:"Help Articles"}),a.jsx(ye,{value:"user_guide",children:"User Guides"}),a.jsx(ye,{value:"demo_video",children:"Demo Videos"})]})]})]})]})})}),a.jsxs("main",{className:"max-w-7xl mx-auto px-4 py-12",children:[f.length>0&&a.jsxs("section",{className:"mb-12",children:[a.jsx("h2",{className:"text-2xl font-bold text-foreground mb-6",children:"Featured"}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:f.map(g=>a.jsxs(_e,{className:"overflow-hidden hover:shadow-lg transition-shadow",children:[g.featured_image_url&&a.jsx("div",{className:"aspect-video overflow-hidden",children:a.jsx("img",{src:g.featured_image_url,alt:g.title,className:"w-full h-full object-cover hover:scale-105 transition-transform"})}),a.jsxs(ot,{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(bt,{variant:"default",children:"Featured"}),a.jsx(bt,{variant:"outline",children:p(g.content_type)})]}),a.jsx(lt,{className:"text-xl",children:a.jsx(Et,{to:`/blog/${g.slug}`,className:"hover:text-primary transition-colors",children:g.title})}),g.excerpt&&a.jsx(Mr,{children:g.excerpt})]}),a.jsx(Ge,{children:a.jsx("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Da,{className:"w-4 h-4"}),new Date(g.published_at).toLocaleDateString()]})})})]},g.id))})]}),m.length>0&&a.jsxs("section",{children:[a.jsx("h2",{className:"text-2xl font-bold text-foreground mb-6",children:f.length>0?"Latest Articles":"All Articles"}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:m.map(g=>a.jsxs(_e,{className:"overflow-hidden hover:shadow-lg transition-shadow",children:[g.featured_image_url&&a.jsx("div",{className:"aspect-video overflow-hidden",children:a.jsx("img",{src:g.featured_image_url,alt:g.title,className:"w-full h-full object-cover hover:scale-105 transition-transform"})}),a.jsxs(ot,{children:[a.jsx("div",{className:"flex items-center gap-2 mb-2",children:a.jsx(bt,{variant:"outline",children:p(g.content_type)})}),a.jsx(lt,{className:"text-xl",children:a.jsx(Et,{to:`/blog/${g.slug}`,className:"hover:text-primary transition-colors",children:g.title})}),g.excerpt&&a.jsx(Mr,{children:g.excerpt})]}),a.jsx(Ge,{children:a.jsx("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Da,{className:"w-4 h-4"}),new Date(g.published_at).toLocaleDateString()]})})})]},g.id))})]}),r.length===0&&a.jsxs("div",{className:"text-center py-12",children:[a.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"No articles found"}),a.jsx("p",{className:"text-muted-foreground mb-6",children:"Try adjusting your search terms or filters."}),a.jsx(ve,{variant:"outline",onClick:()=>{l(""),u("all")},children:"Clear Filters"})]})]}),a.jsx(Mn,{})]})},CCt=()=>{const{slug:e}=NC(),[t,r]=w.useState(null),[n,i]=w.useState(!0),[s,o]=w.useState([]),{toast:l}=Dr();w.useEffect(()=>{e&&c()},[e]),w.useEffect(()=>{if(t){document.title=t.meta_title||t.title;const f=document.querySelector('meta[name="description"]');f&&t.meta_description&&f.setAttribute("content",t.meta_description),u()}},[t]);const c=async()=>{try{const{data:f,error:m}=await Re.from("website_content").select("*").eq("slug",e).eq("status","published").single();if(m)throw m;r(f)}catch(f){console.error("Error fetching post:",f),r(null)}finally{i(!1)}},u=async()=>{if(t)try{const{data:f,error:m}=await Re.from("website_content").select("*").eq("content_type",t.content_type).eq("status","published").neq("id",t.id).order("published_at",{ascending:!1}).limit(3);if(m)throw m;o(f||[])}catch(f){console.error("Error fetching related posts:",f)}},d=async()=>{if(navigator.share)try{await navigator.share({title:t==null?void 0:t.title,text:t==null?void 0:t.excerpt,url:window.location.href})}catch(f){console.log("Error sharing:",f)}else await navigator.clipboard.writeText(window.location.href),l({title:"Link Copied",description:"Article link has been copied to clipboard!"})},A=f=>f.replace("_"," ").replace(/\b\w/g,m=>m.toUpperCase()),h=f=>{const p=f.split(" ").length;return Math.ceil(p/200)};return n?a.jsxs("div",{className:"min-h-screen",children:[a.jsx(Ln,{}),a.jsx("div",{className:"max-w-4xl mx-auto px-4 py-16",children:a.jsx("div",{className:"text-center",children:"Loading..."})}),a.jsx(Mn,{})]}):t?a.jsxs(a.Fragment,{children:[a.jsx(oi,{title:(t==null?void 0:t.meta_title)||(t==null?void 0:t.title),description:(t==null?void 0:t.meta_description)||(t==null?void 0:t.excerpt),keywords:t==null?void 0:t.keywords,ogImage:t==null?void 0:t.featured_image_url,schemaType:"Article",articleData:{author:"Wordsmith AI",publishedTime:t==null?void 0:t.published_at,modifiedTime:t==null?void 0:t.updated_at,tags:t==null?void 0:t.keywords}}),a.jsxs("div",{className:"min-h-screen",children:[a.jsx(Ln,{}),a.jsxs("article",{className:"max-w-4xl mx-auto px-4 py-12",children:[a.jsx("div",{className:"mb-8",children:a.jsxs(Et,{to:"/blog",className:"inline-flex items-center text-muted-foreground hover:text-primary transition-colors",children:[a.jsx(Cl,{className:"w-4 h-4 mr-2"}),"Back to Blog"]})}),a.jsxs("header",{className:"mb-8",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(bt,{variant:"outline",children:A(t.content_type)}),t.featured&&a.jsx(bt,{variant:"default",children:"Featured"})]}),a.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-foreground mb-4 leading-tight",children:t.title}),t.excerpt&&a.jsx("p",{className:"text-xl text-muted-foreground mb-6 leading-relaxed",children:t.excerpt}),a.jsxs("div",{className:"flex flex-wrap items-center gap-6 text-sm text-muted-foreground mb-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Da,{className:"w-4 h-4"}),new Date(t.published_at).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(tu,{className:"w-4 h-4"}),h(t.content)," min read"]}),a.jsxs(ve,{variant:"ghost",size:"sm",onClick:d,className:"flex items-center gap-2 hover:text-primary",children:[a.jsx(vy,{className:"w-4 h-4"}),"Share"]})]}),t.featured_image_url&&a.jsx("div",{className:"aspect-video overflow-hidden rounded-lg mb-8",children:a.jsx("img",{src:t.featured_image_url,alt:t.title,className:"w-full h-full object-cover"})})]}),a.jsx("div",{className:"prose prose-lg max-w-none",children:a.jsx("div",{className:"text-foreground leading-relaxed whitespace-pre-wrap",children:t.content})}),t.content_type==="demo_video"&&t.video_url&&a.jsxs("div",{className:"mt-8",children:[a.jsx("h3",{className:"text-xl font-semibold text-foreground mb-4",children:"Watch the Demo"}),a.jsx("div",{className:"aspect-video",children:a.jsx("iframe",{src:t.video_url.replace("watch?v=","embed/"),title:t.title,className:"w-full h-full rounded-lg",allowFullScreen:!0})})]}),t.keywords&&t.keywords.length>0&&a.jsxs("div",{className:"mt-8 pt-8 border-t border-border",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(K5,{className:"w-4 h-4 text-muted-foreground"}),a.jsx("span",{className:"text-sm font-medium text-foreground",children:"Tags"})]}),a.jsx("div",{className:"flex flex-wrap gap-2",children:t.keywords.map((f,m)=>a.jsx(bt,{variant:"secondary",children:f},m))})]}),a.jsx(_y,{className:"my-12"}),s.length>0&&a.jsxs("section",{children:[a.jsxs("h3",{className:"text-2xl font-bold text-foreground mb-6",children:["Related ",A(t.content_type),"s"]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:s.map(f=>a.jsx(Et,{to:`/blog/${f.slug}`,className:"block group",children:a.jsxs("div",{className:"border border-border rounded-lg overflow-hidden hover:shadow-lg transition-shadow",children:[f.featured_image_url&&a.jsx("div",{className:"aspect-video overflow-hidden",children:a.jsx("img",{src:f.featured_image_url,alt:f.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform"})}),a.jsxs("div",{className:"p-4",children:[a.jsx("h4",{className:"font-semibold text-foreground group-hover:text-primary transition-colors mb-2",children:f.title}),f.excerpt&&a.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:f.excerpt})]})]})},f.id))})]})]}),a.jsx(Mn,{})]})]}):a.jsxs("div",{className:"min-h-screen",children:[a.jsx(Ln,{}),a.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-16 text-center",children:[a.jsx("h1",{className:"text-2xl font-bold text-foreground mb-4",children:"Article Not Found"}),a.jsx("p",{className:"text-muted-foreground mb-6",children:"The article you're looking for doesn't exist or has been removed."}),a.jsx(Et,{to:"/blog",children:a.jsxs(ve,{children:[a.jsx(Cl,{className:"w-4 h-4 mr-2"}),"Back to Blog"]})})]}),a.jsx(Mn,{})]})},NCt=()=>{const e=[{icon:Mbe,title:"Accessible AI",description:"We make advanced AI technology accessible to everyone, regardless of technical expertise. No complicated setup, no steep learning curve, just powerful content creation at your fingertips."},{icon:nu,title:"Empowering Creators",description:"Whether you are a solo entrepreneur, content creator, marketer, or business team, we empower you to produce content that resonates with your audience and drives results."},{icon:ln,title:"Speed & Efficiency",description:"Save hours of research, writing, and editing. Our AI-powered platform helps you create high-quality content in minutes, not hours or days."},{icon:ca,title:"Optimized for Success",description:"Every piece of content generated is optimized for both traditional SEO and AI search engines, ensuring maximum visibility and reach for your content."},{icon:Hs,title:"Every Medium, Every Format",description:"From long-form blog posts to social media snippets, product descriptions to email campaigns, create content for any medium with ease and consistency."},{icon:w6,title:"Human-Centric AI",description:"Our AI is designed to augment human creativity, not replace it. We provide the tools that help you express your unique voice and vision more effectively."}],t=["WordSmith AGI was born from a simple observation: content creation had become one of the biggest bottlenecks for businesses and individuals alike. Writers faced blank pages, marketers struggled with consistent output, and entrepreneurs spent valuable time on content instead of building their dreams.","We saw an opportunity to change this narrative. By leveraging the latest advancements in artificial intelligence and natural language processing, we set out to build a platform that could understand context, maintain brand voice, and produce content that truly connects with audiences.","Today, WordSmith AGI serves thousands of users worldwide, helping them create millions of words of content each month. But we are just getting started. Our vision extends beyond blog posts and articles. We are building a comprehensive AI-powered content ecosystem that adapts to your needs, learns from your preferences, and grows with your success."];return a.jsxs("div",{className:"min-h-screen",children:[a.jsx(oi,{pageSlug:"/about",title:"About Us - WordSmith AGI | AI-Powered Content Creation Platform",description:"Learn about WordSmith AGI's mission to make AI-powered content creation accessible to everyone. Our platform helps creators, marketers, and businesses produce optimized content effortlessly.",keywords:["about WordSmith AGI","AI content platform","content creation company","AI writing company"],canonicalUrl:"https://wordsmithagi.com/about"}),a.jsx(Ln,{}),a.jsxs("main",{children:[a.jsx("section",{className:"py-24 px-4 bg-primary/5",children:a.jsxs("div",{className:"container max-w-4xl mx-auto text-center",children:[a.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold mb-6",children:"About WordSmith AGI"}),a.jsx("p",{className:"text-xl text-muted-foreground mb-8",children:"Revolutionizing how people create content for every medium through the power of artificial intelligence."})]})}),a.jsx("section",{className:"py-16 px-4",children:a.jsx("div",{className:"container max-w-4xl mx-auto",children:a.jsxs("div",{className:"text-center mb-12",children:[a.jsx("h2",{className:"text-3xl md:text-4xl font-bold mb-6",children:"Our Mission"}),a.jsx("p",{className:"text-lg text-muted-foreground leading-relaxed",children:"At WordSmith AGI, we believe that everyone deserves access to powerful content creation tools. Our mission is to democratize content creation by harnessing cutting-edge AI technology, making it possible for individuals and businesses of all sizes to produce high-quality, engaging content across every medium, from blog posts and articles to social media captions and marketing copy."})]})})}),a.jsx("section",{className:"py-16 px-4 bg-muted/30",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",children:"Transforming Consumer AI Usage"}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:e.map((r,n)=>a.jsxs("div",{className:"bg-card p-6 rounded-lg border border-border",children:[a.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-lg flex items-center justify-center mb-4",children:a.jsx(r.icon,{className:"w-6 h-6 text-primary"})}),a.jsx("h3",{className:"text-xl font-semibold mb-3",children:r.title}),a.jsx("p",{className:"text-muted-foreground",children:r.description})]},n))})]})}),a.jsx("section",{className:"py-16 px-4",children:a.jsxs("div",{className:"container max-w-4xl mx-auto",children:[a.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-8",children:"The WordSmith AGI Story"}),a.jsx("div",{className:"prose prose-lg max-w-none text-muted-foreground",children:t.map((r,n)=>a.jsx("p",{className:"mb-6",children:r},n))})]})}),a.jsx("section",{className:"py-16 px-4 bg-primary/5",children:a.jsxs("div",{className:"container max-w-3xl mx-auto text-center",children:[a.jsx("h2",{className:"text-3xl md:text-4xl font-bold mb-6",children:"Join the Content Revolution"}),a.jsx("p",{className:"text-lg text-muted-foreground mb-8",children:"Experience the future of content creation. Start creating exceptional content today."}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[a.jsx(Et,{to:"/auth",children:a.jsx(ve,{size:"lg",variant:"hero",children:"Get Started Free"})}),a.jsx(Et,{to:"/blog",children:a.jsx(ve,{size:"lg",variant:"outline",children:"Read Our Blog"})})]})]})})]}),a.jsx(Mn,{})]})},jCt=()=>a.jsxs("div",{className:"min-h-screen flex flex-col",children:[a.jsx(oi,{pageSlug:"/contact-us",title:"Contact Us - WordSmith AGI | Get in Touch",description:"Have questions about WordSmith AGI? Contact our team for support, partnerships, or inquiries about our AI content creation platform.",keywords:["contact WordSmith AGI","AI content support","WordSmith AGI help"],canonicalUrl:"https://wordsmithagi.com/contact-us",schemaType:"ContactPage"}),a.jsx(Ln,{}),a.jsx("main",{className:"flex-1",children:a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-12",children:[a.jsx("h1",{className:"text-4xl sm:text-5xl font-bold mb-4",children:"Get in Touch"}),a.jsx("p",{className:"text-lg text-foreground/80 max-w-2xl mx-auto",children:"Have questions about WordSmith AGI? We're here to help you transform your content creation experience."})]}),a.jsx(_e,{className:"p-8 max-w-2xl mx-auto",children:a.jsxs("div",{className:"text-center space-y-6",children:[a.jsx("h2",{className:"text-2xl font-bold",children:"Send us a message"}),a.jsxs("div",{className:"flex items-center justify-center gap-3",children:[a.jsx(jl,{className:"w-6 h-6 text-primary"}),a.jsx("a",{href:"mailto:contact.wordsmithagi@gmail.com",className:"text-xl text-primary hover:underline transition-colors",children:"contact.wordsmithagi@gmail.com"})]}),a.jsxs("div",{className:"flex items-center justify-center gap-3 text-muted-foreground",children:[a.jsx(tu,{className:"w-5 h-5"}),a.jsx("p",{children:"We typically respond within 24-48 hours"})]})]})})]})})}),a.jsx(Mn,{})]}),SCt=()=>a.jsxs("div",{className:"min-h-screen flex flex-col",children:[a.jsx(oi,{pageSlug:"/careers",title:"Careers at WordSmith AGI | Join Our AI Content Team",description:"Join the WordSmith AGI team and help shape the future of AI-powered content creation. Explore open positions and career opportunities.",keywords:["WordSmith AGI careers","AI jobs","content AI careers","tech jobs"],canonicalUrl:"https://wordsmithagi.com/careers"}),a.jsx(Ln,{}),a.jsxs("main",{className:"flex-1",children:[a.jsx("section",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-primary/5",children:a.jsxs("div",{className:"container max-w-4xl mx-auto text-center",children:[a.jsx("div",{className:"w-20 h-20 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-6",children:a.jsx(g6,{className:"w-10 h-10 text-primary"})}),a.jsx("h1",{className:"text-4xl sm:text-5xl font-bold mb-4",children:"Join Our Team"}),a.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Building the future of AI-powered content creation together"})]})}),a.jsx("section",{className:"py-16 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-12",children:[a.jsx("h2",{className:"text-3xl font-bold mb-4",children:"Why WordSmith AGI?"}),a.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto",children:"We're building cutting-edge AI technology that empowers creators and businesses worldwide"})]}),a.jsxs("div",{className:"grid md:grid-cols-3 gap-6 mb-16",children:[a.jsxs(_e,{className:"p-6",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-primary/10 flex items-center justify-center mb-4",children:a.jsx(ln,{className:"w-6 h-6 text-primary"})}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Innovation First"}),a.jsx("p",{className:"text-muted-foreground",children:"Work with cutting-edge AI technology and push the boundaries of what's possible in content creation"})]}),a.jsxs(_e,{className:"p-6",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-green-500/10 flex items-center justify-center mb-4",children:a.jsx(nu,{className:"w-6 h-6 text-green-600 dark:text-green-400"})}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Collaborative Culture"}),a.jsx("p",{className:"text-muted-foreground",children:"Join a diverse team of talented individuals who are passionate about making a real impact"})]}),a.jsxs(_e,{className:"p-6",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-blue-500/10 flex items-center justify-center mb-4",children:a.jsx(w6,{className:"w-6 h-6 text-blue-600 dark:text-blue-400"})}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Work-Life Balance"}),a.jsx("p",{className:"text-muted-foreground",children:"Flexible remote work options, competitive benefits, and a culture that values your well-being"})]})]}),a.jsxs(_e,{className:"p-8 max-w-3xl mx-auto text-center border-2",children:[a.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-6",children:a.jsx(jl,{className:"w-8 h-8 text-primary"})}),a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Currently Not Hiring"}),a.jsx("p",{className:"text-muted-foreground mb-6 leading-relaxed",children:"Thank you for your interest in joining WordSmith AGI. While we don't have any open positions at the moment, we're always excited to connect with talented individuals who are passionate about AI, content creation, and innovation."}),a.jsx("p",{className:"text-muted-foreground mb-8",children:"If you'd like to be considered for future opportunities, please send your resume, portfolio, and a brief introduction telling us about yourself and why you're interested in WordSmith AGI."}),a.jsx("div",{className:"inline-flex flex-col sm:flex-row items-center gap-4",children:a.jsxs("a",{href:"mailto:contact.wordsmithagi@gmail.com",className:"inline-flex items-center gap-2 text-primary hover:underline font-semibold text-lg",children:[a.jsx(jl,{className:"w-5 h-5"}),"contact.wordsmithagi@gmail.com"]})})]})]})})]}),a.jsx(Mn,{})]}),BCt=()=>{const e=[{icon:pc,title:"Getting Started",description:"Learn the basics of WordSmith AGI",articles:12},{icon:ai,title:"Content Creation",description:"Tips for generating better content",articles:18},{icon:gy,title:"Account Settings",description:"Manage your account and preferences",articles:8},{icon:y6,title:"Billing & Subscriptions",description:"Payment and plan information",articles:10},{icon:Ex,title:"AI Features",description:"Understanding AI capabilities",articles:15}];return a.jsxs("div",{className:"min-h-screen flex flex-col",children:[a.jsx(oi,{pageSlug:"/help-center",title:"Help Center - WordSmith AGI | Support & Guides",description:"Find answers to your questions about WordSmith AGI. Browse guides on content creation, account management, billing, and more.",keywords:["WordSmith AGI help","AI content help center","WordSmith support","content creation guide"],canonicalUrl:"https://wordsmithagi.com/help-center"}),a.jsx(Ln,{}),a.jsxs("main",{className:"flex-1",children:[a.jsx("section",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-primary/5",children:a.jsx("div",{className:"container max-w-6xl mx-auto",children:a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("div",{className:"w-20 h-20 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-6",children:a.jsx(L1,{className:"w-10 h-10 text-primary"})}),a.jsx("h1",{className:"text-4xl sm:text-5xl font-bold mb-4",children:"How Can We Help You?"}),a.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto mb-10",children:"Search our comprehensive knowledge base or browse help articles by category"}),a.jsxs("div",{className:"max-w-2xl mx-auto relative",children:[a.jsx(oc,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-muted-foreground w-5 h-5"}),a.jsx(st,{placeholder:"Search for help articles, guides, or FAQs...",className:"pl-12 h-14 text-lg border-2"})]})]})})}),a.jsx("section",{className:"py-16 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsx("h2",{className:"text-2xl font-bold text-center mb-10",children:"Browse by Category"}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:e.map((t,r)=>{const n=t.icon;return a.jsxs(_e,{className:"p-6 hover:border-primary hover:shadow-lg transition-all cursor-pointer group",children:[a.jsx("div",{className:"w-14 h-14 rounded-lg bg-primary/10 flex items-center justify-center mb-4 group-hover:bg-primary/20 transition-colors",children:a.jsx(n,{className:"w-7 h-7 text-primary"})}),a.jsx("h3",{className:"text-xl font-semibold mb-2 group-hover:text-primary transition-colors",children:t.title}),a.jsx("p",{className:"text-muted-foreground mb-4 leading-relaxed",children:t.description}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("p",{className:"text-sm text-primary font-semibold",children:[t.articles," articles"]}),a.jsx("span",{className:"text-primary text-sm opacity-0 group-hover:opacity-100 transition-opacity",children:"Browse →"})]})]},r)})})]})}),a.jsx("section",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-muted/30",children:a.jsxs("div",{className:"container max-w-3xl mx-auto text-center",children:[a.jsx("div",{className:"w-16 h-16 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-6",children:a.jsx(Ex,{className:"w-8 h-8 text-primary"})}),a.jsx("h2",{className:"text-3xl font-bold mb-4",children:"Still Need Help?"}),a.jsx("p",{className:"text-lg text-muted-foreground mb-8 max-w-2xl mx-auto",children:"Can't find what you're looking for? Our dedicated support team is available 24/7 to assist you with any questions or issues you may have."}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[a.jsx(Et,{to:"/contact",children:a.jsxs(ve,{size:"lg",className:"min-w-[180px]",children:[a.jsx(Ex,{className:"w-4 h-4 mr-2"}),"Contact Support"]})}),a.jsx(Et,{to:"/documentation",children:a.jsxs(ve,{size:"lg",variant:"outline",className:"min-w-[180px]",children:[a.jsx(pc,{className:"w-4 h-4 mr-2"}),"View Documentation"]})})]})]})})]}),a.jsx(Mn,{})]})},_Ct=()=>a.jsxs("div",{className:"min-h-screen flex flex-col",children:[a.jsx(oi,{pageSlug:"/documentation",title:"Documentation - WordSmith AGI | Complete Platform Guide",description:"Your complete guide to mastering WordSmith AGI's AI-powered content creation platform. Learn about Studio, Growth Lab, Brand Voice, and more.",keywords:["WordSmith AGI documentation","AI content platform guide","WordSmith AGI tutorial"],canonicalUrl:"https://wordsmithagi.com/documentation"}),a.jsx(Ln,{}),a.jsxs("main",{className:"flex-1",children:[a.jsx("section",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-primary/5",children:a.jsxs("div",{className:"container max-w-4xl mx-auto text-center",children:[a.jsx("div",{className:"w-20 h-20 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-6",children:a.jsx(pc,{className:"w-10 h-10 text-primary"})}),a.jsx("h1",{className:"text-4xl sm:text-5xl font-bold mb-4",children:"Documentation"}),a.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Your complete guide to mastering WordSmith AGI's AI-powered content creation platform"})]})}),a.jsx("section",{className:"py-16 px-4 sm:px-6 lg:px-8",children:a.jsx("div",{className:"container max-w-4xl mx-auto",children:a.jsxs("div",{className:"space-y-6",children:[a.jsx(_e,{className:"p-8 border-2",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:a.jsx(ln,{className:"w-6 h-6 text-primary"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-2xl font-bold mb-3",children:"Getting Started with WordSmith AGI"}),a.jsx("p",{className:"text-muted-foreground mb-6",children:"WordSmith AGI is an advanced AI-powered content creation platform designed to help businesses, marketers, and content creators generate high-quality, SEO-optimized content across multiple formats including blog posts, articles, social media content, and more."}),a.jsxs("div",{className:"bg-muted/50 rounded-lg p-6",children:[a.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[a.jsx("span",{className:"w-6 h-6 rounded-full bg-primary/10 flex items-center justify-center text-xs font-bold text-primary",children:"⚡"}),"Quick Start Guide"]}),a.jsxs("ol",{className:"space-y-3",children:[a.jsxs("li",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-sm font-bold flex-shrink-0",children:"1"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Create Your Account"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign up with your email and verify your account"})]})]}),a.jsxs("li",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-sm font-bold flex-shrink-0",children:"2"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Select Content Type"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose from blog posts, articles, social media, or other formats"})]})]}),a.jsxs("li",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-sm font-bold flex-shrink-0",children:"3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Enter Your Topic"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Provide keywords, topics, or detailed prompts"})]})]}),a.jsxs("li",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-sm font-bold flex-shrink-0",children:"4"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Customize Settings"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Adjust tone, length, style, and target audience"})]})]}),a.jsxs("li",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-sm font-bold flex-shrink-0",children:"5"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Generate & Refine"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Create content and edit to perfection"})]})]})]})]})]})]})}),a.jsxs(_e,{className:"p-8",children:[a.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-blue-500/10 flex items-center justify-center flex-shrink-0",children:a.jsx(ca,{className:"w-6 h-6 text-blue-600 dark:text-blue-400"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Core Features Overview"}),a.jsx("p",{className:"text-muted-foreground",children:"Discover the powerful tools and capabilities that make WordSmith AGI the ultimate content creation platform"})]})]}),a.jsx(_y,{className:"my-6"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"border-l-4 border-primary pl-6",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-2 flex items-center gap-2",children:[a.jsx(ln,{className:"w-5 h-5 text-primary"}),"Advanced AI Content Generation"]}),a.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Our state-of-the-art AI models leverage deep learning and natural language processing to analyze your requirements and generate SEO-optimized, engaging content. The AI considers context, desired tone, target audience demographics, and industry best practices to produce professional-quality material that resonates with your readers and ranks well in search engines."})]}),a.jsxs("div",{className:"border-l-4 border-green-500 pl-6",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-2 flex items-center gap-2",children:[a.jsx(nwe,{className:"w-5 h-5 text-green-600 dark:text-green-400"}),"Comprehensive Content Library"]}),a.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Store, organize, and manage all your generated content in one centralized location. Access your complete content history, edit and revise previous generations, organize content by projects or categories, and maintain consistency across multiple content pieces. Your content library serves as your personal content management system with powerful search and filtering capabilities."})]}),a.jsxs("div",{className:"border-l-4 border-purple-500 pl-6",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-2 flex items-center gap-2",children:[a.jsx(ca,{className:"w-5 h-5 text-purple-600 dark:text-purple-400"}),"Built-in SEO Optimization"]}),a.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Every piece of content is automatically optimized for search engines using industry-leading SEO best practices. Our AI ensures proper keyword density, creates compelling meta descriptions, implements structured formatting with appropriate heading hierarchies, optimizes readability scores, and includes internal linking suggestions to maximize your content's visibility and ranking potential."})]})]})]}),a.jsxs(_e,{className:"p-8 bg-muted/30",children:[a.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-amber-500/10 flex items-center justify-center flex-shrink-0",children:a.jsx(vA,{className:"w-6 h-6 text-amber-600 dark:text-amber-400"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Best Practices for Maximum Results"}),a.jsx("p",{className:"text-muted-foreground",children:"Follow these proven strategies to get the most out of WordSmith AGI"})]})]}),a.jsx(_y,{className:"my-6"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-start gap-4 p-4 rounded-lg bg-background border border-border",children:[a.jsx("span",{className:"text-primary text-2xl font-bold",children:"1"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold mb-1",children:"Be Specific with Prompts"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Provide clear, detailed prompts with specific requirements. The more context you give, the better the AI can understand and deliver exactly what you need."})]})]}),a.jsxs("div",{className:"flex items-start gap-4 p-4 rounded-lg bg-background border border-border",children:[a.jsx("span",{className:"text-primary text-2xl font-bold",children:"2"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold mb-1",children:"Always Review Before Publishing"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"While our AI generates high-quality content, human review ensures accuracy, brand alignment, and that the content meets your specific standards and requirements."})]})]}),a.jsxs("div",{className:"flex items-start gap-4 p-4 rounded-lg bg-background border border-border",children:[a.jsx("span",{className:"text-primary text-2xl font-bold",children:"3"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold mb-1",children:"Match Your Brand Voice"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Utilize tone and style settings consistently to maintain your unique brand voice across all content pieces and strengthen brand recognition."})]})]}),a.jsxs("div",{className:"flex items-start gap-4 p-4 rounded-lg bg-background border border-border",children:[a.jsx("span",{className:"text-primary text-2xl font-bold",children:"4"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold mb-1",children:"Leverage Your Content Library"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Use your content library to maintain consistency, repurpose successful content, and build upon previous work for a cohesive content strategy."})]})]}),a.jsxs("div",{className:"flex items-start gap-4 p-4 rounded-lg bg-background border border-border",children:[a.jsx("span",{className:"text-primary text-2xl font-bold",children:"5"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold mb-1",children:"Experiment and Iterate"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Don't be afraid to try different parameters, tones, and formats. Experimentation helps you discover what resonates best with your audience."})]})]})]})]})]})})})]}),a.jsx(Mn,{})]}),kCt=()=>a.jsxs("div",{className:"min-h-screen flex flex-col",children:[a.jsx(oi,{title:"Privacy Policy - WordSmith AGI",description:"Read WordSmith AGI's privacy policy. Learn how we collect, use, and protect your personal information when using our AI content creation platform.",keywords:["privacy policy","data protection","WordSmith AGI privacy"],canonicalUrl:"https://wordsmithagi.com/privacy"}),a.jsx(Ln,{}),a.jsx("main",{className:"flex-1",children:a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"container max-w-4xl mx-auto",children:[a.jsx("h1",{className:"text-4xl sm:text-5xl font-bold mb-6",children:"Privacy Notice"}),a.jsx("p",{className:"text-muted-foreground mb-8",children:"Last updated: January 2025"}),a.jsxs("div",{className:"space-y-8",children:[a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Information We Collect"}),a.jsxs("div",{className:"space-y-4 text-muted-foreground",children:[a.jsx("p",{children:"We collect information that you provide directly to us, including:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[a.jsx("li",{children:"Account information (name, email address, password)"}),a.jsx("li",{children:"Payment information (processed securely through third-party providers)"}),a.jsx("li",{children:"Content you create using our AI service"}),a.jsx("li",{children:"Communications with our support team"}),a.jsx("li",{children:"Usage data and analytics"})]})]})]}),a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"How We Use Your Information"}),a.jsxs("div",{className:"space-y-4 text-muted-foreground",children:[a.jsx("p",{children:"We use the information we collect to:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[a.jsx("li",{children:"Provide, maintain, and improve our AI content generation service"}),a.jsx("li",{children:"Process your transactions and send related information"}),a.jsx("li",{children:"Send technical notices, updates, and support messages"}),a.jsx("li",{children:"Respond to your comments and questions"}),a.jsx("li",{children:"Train and improve our AI models"}),a.jsx("li",{children:"Monitor and analyze trends, usage, and activities"})]})]})]}),a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Data Security"}),a.jsx("div",{className:"space-y-4 text-muted-foreground",children:a.jsx("p",{children:"We implement appropriate technical and organizational measures to protect your personal information against unauthorized access, alteration, disclosure, or destruction. However, no method of transmission over the Internet is 100% secure."})})]}),a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Data Retention"}),a.jsx("div",{className:"space-y-4 text-muted-foreground",children:a.jsx("p",{children:"We retain your personal information for as long as necessary to provide our services and fulfill the purposes outlined in this privacy notice. You may request deletion of your account and associated data at any time."})})]}),a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Third-Party Services"}),a.jsxs("div",{className:"space-y-4 text-muted-foreground",children:[a.jsx("p",{children:"We may share your information with third-party service providers who assist us in:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[a.jsx("li",{children:"Payment processing"}),a.jsx("li",{children:"Data analytics"}),a.jsx("li",{children:"Customer support"}),a.jsx("li",{children:"Email communications"})]}),a.jsx("p",{className:"mt-4",children:"These providers are contractually obligated to protect your information and use it only for the services they provide to us."})]})]}),a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Your Rights"}),a.jsxs("div",{className:"space-y-4 text-muted-foreground",children:[a.jsx("p",{children:"You have the right to:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[a.jsx("li",{children:"Access your personal information"}),a.jsx("li",{children:"Correct inaccurate data"}),a.jsx("li",{children:"Request deletion of your data"}),a.jsx("li",{children:"Object to processing of your data"}),a.jsx("li",{children:"Export your data in a portable format"}),a.jsx("li",{children:"Opt-out of marketing communications"})]})]})]}),a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Cookies and Tracking"}),a.jsx("div",{className:"space-y-4 text-muted-foreground",children:a.jsx("p",{children:"We use cookies and similar tracking technologies to track activity on our service and store certain information. You can instruct your browser to refuse all cookies or to indicate when a cookie is being sent."})})]}),a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Contact Us"}),a.jsxs("div",{className:"space-y-4 text-muted-foreground",children:[a.jsx("p",{children:"If you have questions about this Privacy Notice, please contact us:"}),a.jsx("p",{children:"Email: contact.wordsmithagi@gmail.com"})]})]})]})]})})}),a.jsx(Mn,{})]}),ECt=()=>a.jsxs("div",{className:"min-h-screen flex flex-col",children:[a.jsx(oi,{title:"Terms and Conditions - WordSmith AGI",description:"Read the terms and conditions for using WordSmith AGI's AI content creation platform. Understand your rights and responsibilities as a user.",keywords:["terms and conditions","terms of service","WordSmith AGI terms"],canonicalUrl:"https://wordsmithagi.com/terms-and-conditions"}),a.jsx(Ln,{}),a.jsx("main",{className:"flex-1",children:a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"container max-w-4xl mx-auto",children:[a.jsx("h1",{className:"text-4xl sm:text-5xl font-bold mb-6",children:"Terms and Conditions"}),a.jsx("p",{className:"text-muted-foreground mb-8",children:"Last updated: January 2025"}),a.jsxs("div",{className:"space-y-8",children:[a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Agreement to Terms"}),a.jsx("div",{className:"space-y-4 text-muted-foreground",children:a.jsx("p",{children:"By accessing or using WordSmith AGI, you agree to be bound by these Terms and Conditions. If you disagree with any part of these terms, you may not access the service."})})]}),a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Use of Service"}),a.jsxs("div",{className:"space-y-4 text-muted-foreground",children:[a.jsx("p",{children:"You agree to use WordSmith AGI only for lawful purposes and in accordance with these Terms:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[a.jsx("li",{children:"You must be at least 18 years old to use this service"}),a.jsx("li",{children:"You are responsible for maintaining the confidentiality of your account"}),a.jsx("li",{children:"You must not use the service to generate illegal, harmful, or offensive content"}),a.jsx("li",{children:"You must not attempt to circumvent any limitations or restrictions"}),a.jsx("li",{children:"You must not resell or redistribute our service without permission"})]})]})]}),a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Intellectual Property"}),a.jsxs("div",{className:"space-y-4 text-muted-foreground",children:[a.jsx("p",{children:"The service and its original content, features, and functionality are owned by WordSmith AGI and are protected by international copyright, trademark, patent, trade secret, and other intellectual property laws."}),a.jsx("p",{className:"mt-4",children:"Content generated using our AI service belongs to you, the user, subject to our Fair Use Policy."})]})]}),a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"User Content"}),a.jsxs("div",{className:"space-y-4 text-muted-foreground",children:[a.jsx("p",{children:"You retain all rights to content you create using WordSmith AGI. However:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[a.jsx("li",{children:"You grant us permission to process and store your content to provide the service"}),a.jsx("li",{children:"You are responsible for ensuring your content complies with all applicable laws"}),a.jsx("li",{children:"We reserve the right to remove content that violates our policies"}),a.jsx("li",{children:"You must not generate content that infringes on others' intellectual property rights"})]})]})]}),a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Payment Terms"}),a.jsx("div",{className:"space-y-4 text-muted-foreground",children:a.jsx("p",{children:"Subscription fees are billed in advance on a monthly or annual basis and are non-refundable except as provided in our Refund Policy. We reserve the right to change our pricing with 30 days' notice to existing subscribers."})})]}),a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Termination"}),a.jsx("div",{className:"space-y-4 text-muted-foreground",children:a.jsx("p",{children:"We may terminate or suspend your account immediately, without prior notice or liability, for any reason, including if you breach these Terms. Upon termination, your right to use the service will immediately cease."})})]}),a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Limitation of Liability"}),a.jsx("div",{className:"space-y-4 text-muted-foreground",children:a.jsx("p",{children:"WordSmith AGI shall not be liable for any indirect, incidental, special, consequential, or punitive damages resulting from your use or inability to use the service."})})]}),a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Changes to Terms"}),a.jsx("div",{className:"space-y-4 text-muted-foreground",children:a.jsx("p",{children:"We reserve the right to modify these terms at any time. We will notify users of any material changes. Your continued use of the service after such modifications constitutes acceptance of the updated terms."})})]}),a.jsxs(_e,{className:"p-6",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Contact Information"}),a.jsxs("div",{className:"space-y-4 text-muted-foreground",children:[a.jsx("p",{children:"For questions about these Terms and Conditions, please contact us at:"}),a.jsx("p",{children:"Email: contact.wordsmithagi@gmail.com"})]})]})]})]})})}),a.jsx(Mn,{})]}),TCt=()=>a.jsxs("div",{className:"min-h-screen flex flex-col",children:[a.jsx(oi,{title:"Cookie Policy - WordSmith AGI",description:"Learn about how WordSmith AGI uses cookies to enhance your experience. Understand our cookie practices and how to manage your preferences.",keywords:["cookie policy","cookies","privacy","data protection","WordSmith AGI"],canonicalUrl:"https://wordsmithagi.com/cookie-policy"}),a.jsx(Ln,{}),a.jsxs("main",{className:"flex-1",children:[a.jsx("section",{className:"py-12 px-4 sm:px-6 lg:px-8 bg-primary/5",children:a.jsxs("div",{className:"container max-w-4xl mx-auto text-center",children:[a.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 mb-6",children:a.jsx(Dbe,{className:"w-8 h-8 text-primary"})}),a.jsx("h1",{className:"text-4xl sm:text-5xl font-bold mb-4",children:"Cookie Policy"}),a.jsx("p",{className:"text-xl text-muted-foreground",children:"Last updated: January 2025"}),a.jsx("p",{className:"mt-4 text-muted-foreground max-w-2xl mx-auto",children:"This Cookie Policy explains how WordSmith AGI uses cookies and similar technologies to recognize you when you visit our platform."})]})}),a.jsx("section",{className:"py-12 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"container max-w-4xl mx-auto space-y-8",children:[a.jsx(_e,{className:"p-8",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx(Zbe,{className:"w-6 h-6 text-primary"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"What Are Cookies"}),a.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Cookies are small text files that are placed on your device when you visit our website. They help us provide you with a better experience by remembering your preferences and understanding how you use our service. Cookies contain information that is transferred to your device's hard drive."})]})]})}),a.jsxs(_e,{className:"p-8",children:[a.jsx("h2",{className:"text-2xl font-bold mb-6",children:"How We Use Cookies"}),a.jsx("p",{className:"text-muted-foreground mb-6",children:"WordSmith AGI uses cookies for various purposes to enhance your experience:"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"border-l-4 border-primary pl-6",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx(G5,{className:"w-5 h-5 text-primary"}),a.jsx("h3",{className:"text-xl font-semibold",children:"Essential Cookies"})]}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"These cookies are necessary for our website to function properly. They enable core functionality such as:"}),a.jsxs("ul",{className:"space-y-2 text-muted-foreground",children:[a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-primary mt-1",children:"•"}),a.jsx("span",{children:"Authentication and secure account access"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-primary mt-1",children:"•"}),a.jsx("span",{children:"Security features and fraud prevention"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-primary mt-1",children:"•"}),a.jsx("span",{children:"Session management and state preservation"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-primary mt-1",children:"•"}),a.jsx("span",{children:"Load balancing and performance optimization"})]})]})]}),a.jsxs("div",{className:"border-l-4 border-secondary pl-6",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx(Zh,{className:"w-5 h-5 text-secondary"}),a.jsx("h3",{className:"text-xl font-semibold",children:"Performance Cookies"})]}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"These cookies help us understand how visitors interact with our website by collecting and reporting information anonymously:"}),a.jsxs("ul",{className:"space-y-2 text-muted-foreground",children:[a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-secondary mt-1",children:"•"}),a.jsx("span",{children:"Page visit statistics and traffic analysis"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-secondary mt-1",children:"•"}),a.jsx("span",{children:"Navigation patterns and user flow"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-secondary mt-1",children:"•"}),a.jsx("span",{children:"Error tracking and debugging"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-secondary mt-1",children:"•"}),a.jsx("span",{children:"Performance metrics and load times"})]})]})]}),a.jsxs("div",{className:"border-l-4 border-accent pl-6",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx(gy,{className:"w-5 h-5 text-accent"}),a.jsx("h3",{className:"text-xl font-semibold",children:"Functionality Cookies"})]}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"These cookies enable enhanced functionality and personalization:"}),a.jsxs("ul",{className:"space-y-2 text-muted-foreground",children:[a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-accent mt-1",children:"•"}),a.jsx("span",{children:"Language preferences and localization"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-accent mt-1",children:"•"}),a.jsx("span",{children:"Theme selection (light/dark mode)"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-accent mt-1",children:"•"}),a.jsx("span",{children:"Content preferences and recommendations"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-accent mt-1",children:"•"}),a.jsx("span",{children:"User interface settings and customization"})]})]})]})]})]}),a.jsxs(_e,{className:"p-8",children:[a.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Third-Party Cookies"}),a.jsx("p",{className:"text-muted-foreground mb-6",children:"We may use trusted third-party services that set cookies on our behalf to provide essential functionality:"}),a.jsxs("div",{className:"grid md:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("h3",{className:"font-semibold",children:"Authentication Services"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Secure login providers may set their own cookies for authentication purposes."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h3",{className:"font-semibold",children:"Payment Processing"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Payment processors use cookies to facilitate secure transactions and prevent fraud."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h3",{className:"font-semibold",children:"Analytics Providers"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Analytics services track usage patterns to help us improve our platform."})]})]})]}),a.jsxs(_e,{className:"p-8",children:[a.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[a.jsx(tu,{className:"w-6 h-6 text-primary flex-shrink-0"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Types of Cookies We Use"}),a.jsx("p",{className:"text-muted-foreground",children:"We use different types of cookies based on how long they remain on your device:"})]})]}),a.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"p-6 bg-primary/5 rounded-lg",children:[a.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Session Cookies"}),a.jsx("p",{className:"text-muted-foreground text-sm mb-2",children:"Temporary cookies that are deleted when you close your browser."}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[a.jsx("strong",{children:"Purpose:"})," Maintain your session while using our platform"]})]}),a.jsxs("div",{className:"p-6 bg-secondary/5 rounded-lg",children:[a.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Persistent Cookies"}),a.jsx("p",{className:"text-muted-foreground text-sm mb-2",children:"Remain on your device for a set period or until manually deleted."}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[a.jsx("strong",{children:"Purpose:"})," Remember your preferences across multiple visits"]})]})]})]}),a.jsxs(_e,{className:"p-8",children:[a.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Cookie Duration"}),a.jsx("p",{className:"text-muted-foreground mb-6",children:"Our cookies have different lifespans depending on their purpose:"}),a.jsx("div",{className:"grid gap-4",children:[{type:"Session cookies",duration:"Expire when you close your browser"},{type:"Authentication cookies",duration:"Typically 30 days"},{type:"Preference cookies",duration:"Up to 1 year"},{type:"Analytics cookies",duration:"Up to 2 years"}].map((e,t)=>a.jsxs("div",{className:"flex items-center justify-between p-4 bg-muted/50 rounded-lg",children:[a.jsx("span",{className:"font-medium",children:e.type}),a.jsx("span",{className:"text-muted-foreground",children:e.duration})]},t))})]}),a.jsxs(_e,{className:"p-8",children:[a.jsxs("div",{className:"flex items-start gap-4 mb-6",children:[a.jsx(gy,{className:"w-6 h-6 text-primary flex-shrink-0"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Managing Cookies"}),a.jsx("p",{className:"text-muted-foreground",children:"You have full control over how cookies are used on your device:"})]})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Browser Settings"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"Most web browsers allow you to control cookies through their settings. You can:"}),a.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-primary"}),a.jsx("span",{children:"View and delete existing cookies"})]}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-primary"}),a.jsx("span",{children:"Block all cookies"})]}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-primary"}),a.jsx("span",{children:"Block third-party cookies"})]}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-primary"}),a.jsx("span",{children:"Clear cookies when closing browser"})]})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Opt-Out Tools"}),a.jsx("p",{className:"text-muted-foreground mb-3",children:"You can opt out of certain analytics cookies using industry opt-out tools:"}),a.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[a.jsx("li",{children:"• Google Analytics Opt-out Browser Add-on"}),a.jsx("li",{children:"• Network Advertising Initiative opt-out page"}),a.jsx("li",{children:"• Digital Advertising Alliance opt-out page"})]})]})]})]}),a.jsx(_e,{className:"p-8 border-amber-500/50 bg-amber-500/5",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx(H5,{className:"w-6 h-6 text-amber-500 flex-shrink-0"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Impact of Disabling Cookies"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"While you can disable cookies, please note that doing so may affect your experience on our platform:"}),a.jsxs("ul",{className:"space-y-2 text-muted-foreground",children:[a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-amber-500 mt-1",children:"⚠"}),a.jsx("span",{children:"You may not be able to access certain features"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-amber-500 mt-1",children:"⚠"}),a.jsx("span",{children:"Your preferences will not be saved between sessions"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-amber-500 mt-1",children:"⚠"}),a.jsx("span",{children:"You may need to log in more frequently"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-amber-500 mt-1",children:"⚠"}),a.jsx("span",{children:"Some functionality may not work properly"})]})]})]})]})}),a.jsx(_e,{className:"p-8",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx(ai,{className:"w-6 h-6 text-primary flex-shrink-0"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Do Not Track Signals"}),a.jsx("p",{className:"text-muted-foreground",children:`Some browsers include a "Do Not Track" feature that signals to websites that you don't want to be tracked. Currently, there is no universal industry standard for how to respond to these signals. We do not currently respond to Do Not Track browser signals, but we respect your privacy choices through our cookie management options.`})]})]})}),a.jsxs(_e,{className:"p-8",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Updates to This Policy"}),a.jsx("p",{className:"text-muted-foreground leading-relaxed",children:'We may update this Cookie Policy from time to time to reflect changes in our practices, technology, legal requirements, or for other operational reasons. We will notify you of any material changes by posting the updated policy on our website and updating the "Last updated" date at the top of this page. We encourage you to review this policy periodically.'})]}),a.jsxs(_e,{className:"p-8 bg-primary/5",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Questions About Cookies?"}),a.jsx("p",{className:"text-muted-foreground mb-6",children:"If you have any questions about our use of cookies or this Cookie Policy, please don't hesitate to contact us:"}),a.jsx("div",{className:"space-y-2",children:a.jsxs("p",{className:"text-muted-foreground",children:[a.jsx("strong",{className:"text-foreground",children:"Email:"})," contact.wordsmithagi@gmail.com"]})})]})]})})]}),a.jsx(Mn,{})]}),PCt=()=>a.jsxs("div",{className:"min-h-screen flex flex-col",children:[a.jsx(oi,{pageSlug:"/cancellation-refunds",title:"Cancellation & Refunds Policy - WordSmith AGI",description:"Learn about WordSmith AGI's cancellation and refund policies for subscription plans. Understand your rights and our commitment to customer satisfaction.",canonicalUrl:"https://wordsmithagi.com/cancellation-refunds"}),a.jsx(Ln,{}),a.jsxs("main",{className:"flex-1",children:[a.jsx("section",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-primary/5",children:a.jsxs("div",{className:"container max-w-4xl mx-auto text-center",children:[a.jsx("div",{className:"w-20 h-20 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-6",children:a.jsx(M1,{className:"w-10 h-10 text-primary"})}),a.jsx("h1",{className:"text-4xl sm:text-5xl font-bold mb-4",children:"Cancellation & Refunds Policy"}),a.jsx("p",{className:"text-lg text-muted-foreground mb-2",children:"Clear and transparent policies for subscription cancellations and refunds"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Last updated: January 2025"})]})}),a.jsx("section",{className:"py-16 px-4 sm:px-6 lg:px-8",children:a.jsx("div",{className:"container max-w-4xl mx-auto",children:a.jsxs("div",{className:"space-y-6",children:[a.jsx(_e,{className:"p-8 border-2",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-red-500/10 flex items-center justify-center flex-shrink-0",children:a.jsx(Xte,{className:"w-6 h-6 text-red-600 dark:text-red-400"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-2xl font-bold mb-3",children:"Subscription Cancellation"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"You have full control over your subscription and may cancel at any time through your account dashboard. The cancellation process is simple, instant, and doesn't require contacting support."}),a.jsxs("div",{className:"bg-muted/50 rounded-lg p-4 space-y-3",children:[a.jsx("h3",{className:"font-semibold text-foreground mb-2",children:"What happens after cancellation:"}),a.jsxs("ul",{className:"space-y-2",children:[a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-primary mt-1",children:"•"}),a.jsx("span",{className:"text-muted-foreground",children:"Your subscription remains active until the end of the current billing period"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-primary mt-1",children:"•"}),a.jsx("span",{className:"text-muted-foreground",children:"Continued access to all premium features until expiration"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-primary mt-1",children:"•"}),a.jsx("span",{className:"text-muted-foreground",children:"No additional charges after the current billing cycle"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-primary mt-1",children:"•"}),a.jsx("span",{className:"text-muted-foreground",children:"Ability to reactivate your subscription at any time without penalties"})]})]})]})]})]})}),a.jsx(_e,{className:"p-8",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-green-500/10 flex items-center justify-center flex-shrink-0",children:a.jsx(M1,{className:"w-6 h-6 text-green-600 dark:text-green-400"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-2xl font-bold mb-3",children:"14-Day Money-Back Guarantee"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"We stand behind the quality of our service. All new subscriptions come with a 14-day money-back guarantee, allowing you to try WordSmith AGI risk-free."}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-foreground mb-2",children:"Eligibility Requirements:"}),a.jsxs("div",{className:"grid sm:grid-cols-2 gap-3",children:[a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-primary mt-1 text-sm",children:"✓"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"Request within 14 days of purchase"})]}),a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-primary mt-1 text-sm",children:"✓"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"First-time subscribers only"})]}),a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-primary mt-1 text-sm",children:"✓"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"No Terms of Service violations"})]}),a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-primary mt-1 text-sm",children:"✓"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"Initial purchase only (not renewals)"})]})]})]}),a.jsx("div",{className:"bg-primary/5 rounded-lg p-4",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:[a.jsx("strong",{className:"text-foreground",children:"How to Request:"})," Contact our support team at",a.jsx("a",{href:"mailto:contact.wordsmithagi@gmail.com",className:"text-primary hover:underline ml-1",children:"contact.wordsmithagi@gmail.com"})," with your order details and reason for refund."]})})]})]})]})}),a.jsx(_e,{className:"p-8 bg-muted/30",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-blue-500/10 flex items-center justify-center flex-shrink-0",children:a.jsx(tu,{className:"w-6 h-6 text-blue-600 dark:text-blue-400"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-2xl font-bold mb-3",children:"Refund Processing Time"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"Once your refund request is approved, we process it promptly. The timeline is as follows:"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:a.jsx("span",{className:"text-xs font-bold text-primary",children:"1"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Approval: 1-2 business days"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Review of refund request"})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:a.jsx("span",{className:"text-xs font-bold text-primary",children:"2"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Processing: 5-10 business days"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Refund issued to original payment method"})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:a.jsx("span",{className:"text-xs font-bold text-primary",children:"3"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Bank Processing: Varies"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Depends on your payment provider"})]})]})]})]})]})}),a.jsx(_e,{className:"p-8",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-amber-500/10 flex items-center justify-center flex-shrink-0",children:a.jsx(H5,{className:"w-6 h-6 text-amber-600 dark:text-amber-400"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-2xl font-bold mb-3",children:"Non-Refundable Items"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"For transparency, the following items and circumstances are not eligible for refunds:"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-muted/30",children:[a.jsx("span",{className:"text-amber-600 dark:text-amber-400 mt-0.5",children:"✕"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-foreground",children:"One-time Credit Purchases"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Additional generation credits are final sale"})]})]}),a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-muted/30",children:[a.jsx("span",{className:"text-amber-600 dark:text-amber-400 mt-0.5",children:"✕"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-foreground",children:"Subscription Renewals"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Only initial subscriptions eligible, not subsequent renewals"})]})]}),a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-muted/30",children:[a.jsx("span",{className:"text-amber-600 dark:text-amber-400 mt-0.5",children:"✕"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-foreground",children:"Generated Content"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Services already rendered or content already created"})]})]}),a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-muted/30",children:[a.jsx("span",{className:"text-amber-600 dark:text-amber-400 mt-0.5",children:"✕"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-foreground",children:"Policy Violations"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Accounts terminated for Terms of Service violations"})]})]})]})]})]})}),a.jsx(_e,{className:"p-8 border-2 border-primary/20",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:a.jsx(jl,{className:"w-6 h-6 text-primary"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-2xl font-bold mb-3",children:"Questions or Concerns?"}),a.jsx("p",{className:"text-muted-foreground mb-6",children:"If you have any questions about our cancellation and refund policy, or need assistance with a cancellation or refund request, our support team is here to help."}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-6",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Email Support"}),a.jsx("a",{href:"mailto:contact.wordsmithagi@gmail.com",className:"text-primary hover:underline font-semibold",children:"contact.wordsmithagi@gmail.com"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Response Time"}),a.jsx("p",{className:"font-semibold",children:"Within 24 hours"})]})]})]})]})})]})})})]}),a.jsx(Mn,{})]}),ICt=()=>a.jsxs("div",{className:"min-h-screen flex flex-col",children:[a.jsx(oi,{pageSlug:"/shipping",title:"Shipping & Delivery Policy - WordSmith AGI",description:"WordSmith AGI is a digital service with instant delivery. Learn about our digital service delivery policy.",canonicalUrl:"https://wordsmithagi.com/shipping"}),a.jsx(Ln,{}),a.jsxs("main",{className:"flex-1",children:[a.jsx("section",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-primary/5",children:a.jsxs("div",{className:"container max-w-4xl mx-auto text-center",children:[a.jsx("div",{className:"w-20 h-20 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-6",children:a.jsx(Bwe,{className:"w-10 h-10 text-primary"})}),a.jsx("h1",{className:"text-4xl sm:text-5xl font-bold mb-4",children:"Shipping & Delivery Policy"}),a.jsx("p",{className:"text-lg text-muted-foreground mb-2",children:"Instant digital service delivery with no waiting time"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Last updated: January 2025"})]})}),a.jsx("section",{className:"py-16 px-4 sm:px-6 lg:px-8",children:a.jsx("div",{className:"container max-w-4xl mx-auto",children:a.jsxs("div",{className:"space-y-6",children:[a.jsx(_e,{className:"p-8 border-2",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:a.jsx(G5,{className:"w-6 h-6 text-primary"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-2xl font-bold mb-3",children:"Digital Service Delivery"}),a.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"WordSmith AGI is a cloud-based AI-powered content generation platform delivered entirely online. As a digital service, there are no physical products to ship, package, or deliver through traditional shipping methods. All features and functionality are accessed through your web browser from any device with an internet connection."})]})]})}),a.jsx(_e,{className:"p-8",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-green-500/10 flex items-center justify-center flex-shrink-0",children:a.jsx(Xp,{className:"w-6 h-6 text-green-600 dark:text-green-400"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-2xl font-bold mb-3",children:"Instant Access"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"Upon successful subscription or payment, you receive immediate access to your account:"}),a.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(Xp,{className:"w-5 h-5 text-primary mt-0.5 flex-shrink-0"}),a.jsx("span",{className:"text-muted-foreground",children:"Account activated immediately"})]}),a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(Xp,{className:"w-5 h-5 text-primary mt-0.5 flex-shrink-0"}),a.jsx("span",{className:"text-muted-foreground",children:"All features unlocked instantly"})]}),a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(Xp,{className:"w-5 h-5 text-primary mt-0.5 flex-shrink-0"}),a.jsx("span",{className:"text-muted-foreground",children:"Zero waiting or delivery time"})]}),a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(Xp,{className:"w-5 h-5 text-primary mt-0.5 flex-shrink-0"}),a.jsx("span",{className:"text-muted-foreground",children:"24/7 availability worldwide"})]})]})]})]})}),a.jsx(_e,{className:"p-8 bg-muted/30",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:a.jsx(tu,{className:"w-6 h-6 text-primary"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-2xl font-bold mb-3",children:"Service Availability"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"Our platform is engineered for maximum uptime and reliability, available 24 hours a day, 7 days a week, 365 days a year. We maintain multiple redundant systems to ensure continuous service availability."}),a.jsx("div",{className:"bg-background rounded-lg p-4 border border-border",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:[a.jsx("strong",{className:"text-foreground",children:"Scheduled Maintenance:"})," Occasional maintenance windows may be required for system upgrades. We provide advance notice via email and in-app notifications for any planned downtime affecting service accessibility."]})})]})]})}),a.jsx(_e,{className:"p-8",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-purple-500/10 flex items-center justify-center flex-shrink-0",children:a.jsx(Hs,{className:"w-6 h-6 text-purple-600 dark:text-purple-400"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-2xl font-bold mb-3",children:"Global Availability"}),a.jsx("p",{className:"text-muted-foreground mb-4",children:"WordSmith AGI is available worldwide, providing AI-powered content creation services to users in most countries across all continents. Our cloud infrastructure ensures fast, reliable access regardless of your location."}),a.jsx("div",{className:"bg-amber-500/10 rounded-lg p-4 border border-amber-500/20",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:[a.jsx("strong",{className:"text-foreground",children:"Regional Compliance:"})," Service availability may be subject to local laws, regulations, and compliance requirements in certain jurisdictions. We continuously work to expand our global reach while maintaining full regulatory compliance."]})})]})]})}),a.jsxs(_e,{className:"p-8 border-2 border-primary/20",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4 text-center",children:"Need Assistance?"}),a.jsx("p",{className:"text-center text-muted-foreground mb-6",children:"If you have questions about service delivery, access, or any technical issues, our support team is here to help."}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-center",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Email Support"}),a.jsx("a",{href:"mailto:contact.wordsmithagi@gmail.com",className:"text-primary hover:underline font-semibold",children:"contact.wordsmithagi@gmail.com"})]}),a.jsx("div",{className:"hidden sm:block w-px h-12 bg-border"}),a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"Response Time"}),a.jsx("p",{className:"font-semibold",children:"Within 24 hours"})]})]})]})]})})})]}),a.jsx(Mn,{})]}),OCt=()=>a.jsxs("div",{className:"min-h-screen",children:[a.jsx(oi,{pageSlug:"/video-script",title:"AI Video Script Generator - WordSmith AGI | Create Professional Scripts",description:"Generate professional video scripts for YouTube, TikTok, Instagram, and more with AI. Create engaging, SEO-optimized scripts in minutes with WordSmith AGI.",keywords:["AI video script generator","video script writer","YouTube script AI","TikTok script generator","video content creation"],canonicalUrl:"https://wordsmithagi.com/solutions/video-scripts"}),a.jsx(Ln,{}),a.jsxs("main",{children:[a.jsxs("section",{className:"relative min-h-[90vh] flex items-center justify-center px-4 sm:px-6 lg:px-8 overflow-hidden pt-20",children:[a.jsx("div",{className:"absolute inset-0 bg-primary/5"}),a.jsxs("div",{className:"container relative z-10 text-center max-w-5xl mx-auto",children:[a.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 border border-primary/20 mb-8",children:[a.jsx(UB,{className:"w-4 h-4 text-primary"}),a.jsx("span",{className:"text-sm font-medium",children:"AI-Powered Video Scripts"})]}),a.jsxs("h1",{className:"text-4xl sm:text-5xl lg:text-7xl font-bold mb-6 leading-tight",children:["Create Engaging Video Scripts",a.jsx("span",{className:"block text-primary mt-2",children:"In Minutes, Not Hours"})]}),a.jsx("p",{className:"text-lg sm:text-xl text-muted-foreground mb-8 max-w-3xl mx-auto",children:"Transform your video content creation with AI-powered scripts tailored for YouTube, TikTok, Instagram Reels, and more. Perfect for content creators who want to focus on filming, not writing."}),a.jsx("div",{className:"flex justify-center mb-12",children:a.jsx(ve,{asChild:!0,size:"lg",className:"text-lg px-8",children:a.jsx(Et,{to:"/auth",children:"Start Creating Scripts"})})}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No credit card required • 15 free credits in your first month, then 5/month"})]})]}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-muted/30",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Why Content Creators Choose WordSmith AGI"}),a.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Everything you need to create compelling video scripts that engage and convert"})]}),a.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:[{icon:tu,title:"Save Hours Daily",description:"Generate complete video scripts in under 2 minutes instead of spending hours brainstorming and writing."},{icon:ni,title:"Boost Engagement",description:"AI-optimized scripts designed to hook viewers in the first 3 seconds and keep them watching until the end."},{icon:Hbe,title:"Multiple Formats",description:"Create scripts for YouTube videos, TikToks, Instagram Reels, video ads, tutorials, and more."},{icon:nu,title:"Brand Voice",description:"Maintain your unique style with customizable tone, personality, and messaging across all scripts."},{icon:ln,title:"Instant Variations",description:"Generate multiple script versions instantly to A/B test what resonates best with your audience."},{icon:UB,title:"Platform-Specific",description:"Scripts optimized for each platform's unique format, timing, and audience expectations."}].map((e,t)=>a.jsxs(_e,{className:"p-6 hover:shadow-lg transition-shadow",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-primary/10 flex items-center justify-center mb-4",children:a.jsx(e.icon,{className:"w-6 h-6 text-primary"})}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:e.title}),a.jsx("p",{className:"text-muted-foreground",children:e.description})]},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsx("div",{className:"text-center mb-16",children:a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"From Idea to Script in 3 Simple Steps"})}),a.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:[{step:"01",title:"Choose Your Format",description:"Select your video type: YouTube long-form, Short-form content, Tutorial, Product review, or custom format."},{step:"02",title:"Set Your Parameters",description:"Define your topic, target length, tone, and key points you want to cover in your video."},{step:"03",title:"Generate & Refine",description:"Get your complete script with hooks, transitions, and CTAs. Edit and refine until it's perfect."}].map((e,t)=>a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"text-6xl font-bold text-primary/50 mb-4",children:e.step}),a.jsx("h3",{className:"text-2xl font-semibold mb-3",children:e.title}),a.jsx("p",{className:"text-muted-foreground",children:e.description})]},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-primary/5",children:a.jsxs("div",{className:"container max-w-4xl mx-auto text-center",children:[a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-6",children:"Ready to Create Your Next Viral Video?"}),a.jsx("p",{className:"text-lg text-muted-foreground mb-8 max-w-2xl mx-auto",children:"Join thousands of content creators who use WordSmith AGI to streamline their video production workflow."}),a.jsx(ve,{asChild:!0,size:"lg",className:"text-lg px-8",children:a.jsx(Et,{to:"/auth",children:"Get Started Free"})})]})})]}),a.jsx(Mn,{}),a.jsx(RA,{})]}),FCt=()=>a.jsxs("div",{className:"min-h-screen",children:[a.jsx(oi,{pageSlug:"/social-media",title:"AI Social Media Content Generator - WordSmith AGI | Posts, Captions & Hashtags",description:"Create engaging social media content with AI. Generate platform-specific posts, captions, and hashtags for Instagram, Twitter, LinkedIn, and more with WordSmith AGI.",keywords:["AI social media content","social media post generator","AI caption generator","hashtag generator","social media marketing AI"],canonicalUrl:"https://wordsmithagi.com/solutions/social-media"}),a.jsx(Ln,{}),a.jsxs("main",{children:[a.jsxs("section",{className:"relative min-h-[90vh] flex items-center justify-center px-4 sm:px-6 lg:px-8 overflow-hidden pt-20",children:[a.jsx("div",{className:"absolute inset-0 bg-primary/5"}),a.jsxs("div",{className:"container relative z-10 text-center max-w-5xl mx-auto",children:[a.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 border border-primary/20 mb-8",children:[a.jsx(vy,{className:"w-4 h-4 text-primary"}),a.jsx("span",{className:"text-sm font-medium",children:"AI-Powered Social Media Content"})]}),a.jsxs("h1",{className:"text-4xl sm:text-5xl lg:text-7xl font-bold mb-6 leading-tight",children:["AI-Powered Social Media",a.jsx("span",{className:"block text-primary mt-2",children:"Content at Scale"})]}),a.jsx("p",{className:"text-lg sm:text-xl text-foreground/80 mb-8 max-w-3xl mx-auto",children:"Generate weeks of engaging social media content in minutes. Perfect for marketing teams, agencies, and businesses managing multiple platforms and campaigns."}),a.jsx("div",{className:"flex justify-center mb-12",children:a.jsx(ve,{asChild:!0,size:"lg",className:"text-lg px-8",children:a.jsx(Et,{to:"/auth",children:"Start Creating Content"})})}),a.jsx("p",{className:"text-sm text-foreground/70",children:"No credit card required • 15 free credits in your first month, then 5/month"})]})]}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-muted/30",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"One Platform, All Your Social Media Needs"}),a.jsx("p",{className:"text-lg text-foreground/80 max-w-2xl mx-auto",children:"Create platform-optimized content for every major social network"})]}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:[{platform:"Instagram",description:"Captions, Stories, Reels scripts, and carousel content that drives engagement"},{platform:"LinkedIn",description:"Professional posts, thought leadership content, and company updates"},{platform:"Twitter/X",description:"Viral tweets, thread ideas, and conversation starters"},{platform:"Facebook",description:"Engaging posts, event descriptions, and community content"},{platform:"TikTok",description:"Trending content ideas, captions, and video descriptions"},{platform:"Pinterest",description:"Pin descriptions, board ideas, and SEO-optimized titles"}].map((e,t)=>a.jsxs(_e,{className:"p-6 hover:shadow-lg transition-shadow",children:[a.jsx("h3",{className:"text-xl font-semibold mb-2",children:e.platform}),a.jsx("p",{className:"text-foreground/75",children:e.description})]},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Built for Marketing Teams"}),a.jsx("p",{className:"text-lg text-foreground/80 max-w-2xl mx-auto",children:"Everything your team needs to scale social media content production"})]}),a.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:[{icon:Da,title:"Batch Content Creation",description:"Generate an entire month's worth of social posts in one sitting. Plan ahead and maintain consistency."},{icon:ca,title:"Brand Voice Consistency",description:"Set your brand guidelines once and get content that matches your voice across all platforms."},{icon:yC,title:"Multiple Formats",description:"Create posts, captions, hashtags, CTAs, and engagement hooks all in one place."},{icon:Ra,title:"A/B Test Variations",description:"Generate multiple versions of each post to test what resonates best with your audience."},{icon:qbe,title:"Trend Integration",description:"AI stays updated with current trends to keep your content fresh and relevant."},{icon:vy,title:"Cross-Platform Adaptation",description:"Create one piece of content and adapt it for every platform automatically."}].map((e,t)=>a.jsxs(_e,{className:"p-6 hover:shadow-lg transition-shadow",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-primary/10 flex items-center justify-center mb-4",children:a.jsx(e.icon,{className:"w-6 h-6 text-primary"})}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:e.title}),a.jsx("p",{className:"text-foreground/75",children:e.description})]},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-muted/30",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsx("div",{className:"text-center mb-16",children:a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Perfect For Every Social Media Need"})}),a.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:[{title:"Product Launches",description:"Create comprehensive launch campaigns with announcement posts, teasers, feature highlights, and user testimonials."},{title:"Campaign Management",description:"Generate cohesive content series for marketing campaigns, promotions, and seasonal initiatives."},{title:"Community Engagement",description:"Create polls, questions, conversation starters, and interactive content that builds community."},{title:"Content Calendars",description:"Fill your editorial calendar with diverse, engaging content planned weeks in advance."}].map((e,t)=>a.jsxs(_e,{className:"p-8",children:[a.jsx("h3",{className:"text-2xl font-semibold mb-3",children:e.title}),a.jsx("p",{className:"text-foreground/75 text-lg",children:e.description})]},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-primary/5",children:a.jsxs("div",{className:"container max-w-4xl mx-auto text-center",children:[a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-6",children:"Transform Your Social Media Strategy Today"}),a.jsx("p",{className:"text-lg text-foreground/80 mb-8 max-w-2xl mx-auto",children:"Join marketing teams and agencies using WordSmith AGI to scale their social media content production."}),a.jsx(ve,{asChild:!0,size:"lg",className:"text-lg px-8",children:a.jsx(Et,{to:"/auth",children:"Get Started Free"})})]})})]}),a.jsx(Mn,{}),a.jsx(RA,{})]}),LCt=()=>a.jsxs("div",{className:"min-h-screen",children:[a.jsx(oi,{pageSlug:"/email-marketing",title:"AI Email Marketing Content Generator - WordSmith AGI | Campaigns & Sequences",description:"Create high-converting email marketing content with AI. Generate personalized email campaigns, sequences, and newsletters that drive engagement with WordSmith AGI.",keywords:["AI email marketing","email content generator","AI email writer","email campaign AI","newsletter generator"],canonicalUrl:"https://wordsmithagi.com/solutions/email-marketing"}),a.jsx(Ln,{}),a.jsxs("main",{children:[a.jsxs("section",{className:"relative min-h-[90vh] flex items-center justify-center px-4 sm:px-6 lg:px-8 overflow-hidden pt-20",children:[a.jsx("div",{className:"absolute inset-0 bg-primary/5"}),a.jsxs("div",{className:"container relative z-10 text-center max-w-5xl mx-auto",children:[a.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 border border-primary/20 mb-8",children:[a.jsx(jl,{className:"w-4 h-4 text-primary"}),a.jsx("span",{className:"text-sm font-medium",children:"Email Marketing Content"})]}),a.jsxs("h1",{className:"text-4xl sm:text-5xl lg:text-7xl font-bold mb-6 leading-tight",children:["High-Converting Email Copy",a.jsx("span",{className:"block text-primary mt-2",children:"Written by AI in Seconds"})]}),a.jsx("p",{className:"text-lg sm:text-xl text-muted-foreground mb-8 max-w-3xl mx-auto",children:"Create compelling email campaigns, newsletters, and sequences that drive opens, clicks, and conversions. Perfect for marketers who need consistent, persuasive email content."}),a.jsx("div",{className:"flex justify-center mb-12",children:a.jsx(ve,{asChild:!0,size:"lg",className:"text-lg px-8",children:a.jsx(Et,{to:"/auth",children:"Start Writing Emails"})})}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No credit card required • 15 free credits in your first month, then 5/month"})]})]}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-muted/30",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Why Email Marketers Love WordSmith AGI"}),a.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Everything you need to create emails that get opened, read, and clicked"})]}),a.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:[{icon:ni,title:"Boost Open Rates",description:"AI-crafted subject lines and preview text that grab attention and increase open rates by up to 40%."},{icon:ca,title:"Drive Conversions",description:"Persuasive copy with clear CTAs that guide readers to take action and increase click-through rates."},{icon:ln,title:"Save Time",description:"Generate complete email campaigns in minutes instead of hours of writing and editing."},{icon:nu,title:"Personalization",description:"Create targeted content for different audience segments with customizable tone and messaging."},{icon:ywe,title:"A/B Testing",description:"Generate multiple variations instantly to test and optimize your email performance."},{icon:jl,title:"All Email Types",description:"From newsletters to promotions, welcome sequences to re-engagement campaigns."}].map((e,t)=>a.jsxs(_e,{className:"p-6 hover:shadow-lg transition-shadow",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-primary/10 flex items-center justify-center mb-4",children:a.jsx(e.icon,{className:"w-6 h-6 text-primary"})}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:e.title}),a.jsx("p",{className:"text-muted-foreground",children:e.description})]},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsx("div",{className:"text-center mb-16",children:a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Create Any Type of Email Campaign"})}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:["Welcome Sequences","Product Launches","Newsletter Content","Promotional Campaigns","Abandoned Cart Emails","Re-engagement Campaigns","Event Invitations","Survey & Feedback","Product Updates","Holiday Campaigns","Lead Nurturing","Customer Testimonials"].map((e,t)=>a.jsx(_e,{className:"p-6 text-center hover:shadow-lg transition-shadow",children:a.jsx("p",{className:"font-semibold",children:e})},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-muted/30",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsx("div",{className:"text-center mb-16",children:a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Powerful Features for Email Success"})}),a.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:[{title:"Subject Line Generator",description:"Create multiple compelling subject line options that increase open rates and avoid spam filters."},{title:"Preview Text Optimization",description:"Generate preview text that complements your subject line and entices readers to open."},{title:"Body Copy That Converts",description:"Persuasive email body content with proper structure, storytelling, and clear CTAs."},{title:"Mobile-Optimized",description:"Copy formatted and written to work perfectly on mobile devices where most emails are read."}].map((e,t)=>a.jsxs(_e,{className:"p-8",children:[a.jsx("h3",{className:"text-2xl font-semibold mb-3",children:e.title}),a.jsx("p",{className:"text-muted-foreground text-lg",children:e.description})]},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-primary/5",children:a.jsxs("div",{className:"container max-w-4xl mx-auto text-center",children:[a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-6",children:"Start Creating Better Email Campaigns Today"}),a.jsx("p",{className:"text-lg text-muted-foreground mb-8 max-w-2xl mx-auto",children:"Join email marketers who use WordSmith AGI to create high-performing campaigns that drive results."}),a.jsx(ve,{asChild:!0,size:"lg",className:"text-lg px-8",children:a.jsx(Et,{to:"/auth",children:"Get Started Free"})})]})})]}),a.jsx(Mn,{}),a.jsx(RA,{})]}),MCt=()=>a.jsxs("div",{className:"min-h-screen",children:[a.jsx(oi,{pageSlug:"/ecommerce-content",title:"AI Ecommerce Content Generator - WordSmith AGI | Product Descriptions & Ad Copy",description:"Generate SEO-optimized product descriptions, category pages, and ad copy with AI. Boost your ecommerce sales with compelling content from WordSmith AGI.",keywords:["AI product description generator","ecommerce content AI","product copywriting AI","ecommerce SEO content","AI ad copy generator"],canonicalUrl:"https://wordsmithagi.com/solutions/ecommerce"}),a.jsx(Ln,{}),a.jsxs("main",{children:[a.jsxs("section",{className:"relative min-h-[90vh] flex items-center justify-center px-4 sm:px-6 lg:px-8 overflow-hidden pt-20",children:[a.jsx("div",{className:"absolute inset-0 bg-primary/5"}),a.jsxs("div",{className:"container relative z-10 text-center max-w-5xl mx-auto",children:[a.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 border border-primary/20 mb-8",children:[a.jsx(DB,{className:"w-4 h-4 text-primary"}),a.jsx("span",{className:"text-sm font-medium",children:"E-commerce Content"})]}),a.jsxs("h1",{className:"text-4xl sm:text-5xl lg:text-7xl font-bold mb-6 leading-tight",children:["Product Descriptions That",a.jsx("span",{className:"block text-primary mt-2",children:"Drive Sales & Conversions"})]}),a.jsx("p",{className:"text-lg sm:text-xl text-muted-foreground mb-8 max-w-3xl mx-auto",children:"Generate compelling product descriptions, category pages, and e-commerce content that increases conversions. Perfect for online stores, marketplaces, and e-commerce teams."}),a.jsx("div",{className:"flex justify-center mb-12",children:a.jsx(ve,{asChild:!0,size:"lg",className:"text-lg px-8",children:a.jsx(Et,{to:"/auth",children:"Start Creating Content"})})}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No credit card required • 15 free credits in your first month, then 5/month"})]})]}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-muted/30",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Why E-commerce Teams Choose WordSmith AGI"}),a.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Everything you need to scale your product content and increase sales"})]}),a.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:[{icon:M1,title:"Increase Conversions",description:"Persuasive product descriptions that highlight benefits and drive purchase decisions."},{icon:ni,title:"SEO Optimized",description:"Content automatically optimized for search engines to increase organic traffic and visibility."},{icon:Awe,title:"Scale Quickly",description:"Generate hundreds of product descriptions in minutes, perfect for large catalogs."},{icon:eg,title:"Brand Consistency",description:"Maintain your brand voice and style across all product pages automatically."},{icon:K5,title:"Feature Highlights",description:"Automatically emphasize key features, benefits, and unique selling points."},{icon:DB,title:"Multiple Formats",description:"Create short descriptions, long descriptions, bullet points, and meta descriptions."}].map((e,t)=>a.jsxs(_e,{className:"p-6 hover:shadow-lg transition-shadow",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-primary/10 flex items-center justify-center mb-4",children:a.jsx(e.icon,{className:"w-6 h-6 text-primary"})}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:e.title}),a.jsx("p",{className:"text-muted-foreground",children:e.description})]},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsx("div",{className:"text-center mb-16",children:a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"All Your E-commerce Content Needs"})}),a.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:[{title:"Product Descriptions",description:"Compelling descriptions that showcase features, benefits, and convince customers to buy."},{title:"Category Pages",description:"SEO-optimized category descriptions that improve search rankings and guide customers."},{title:"Meta Descriptions",description:"Search-friendly meta descriptions that improve click-through rates from search results."},{title:"Product Titles",description:"Clear, descriptive titles optimized for both search engines and customer understanding."},{title:"Bullet Points",description:"Scannable feature lists that highlight key specifications and benefits."},{title:"About Product",description:"Detailed long-form content about materials, usage, care instructions, and more."}].map((e,t)=>a.jsxs(_e,{className:"p-8",children:[a.jsx("h3",{className:"text-2xl font-semibold mb-3",children:e.title}),a.jsx("p",{className:"text-muted-foreground text-lg",children:e.description})]},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-muted/30",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsx("div",{className:"text-center mb-16",children:a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Perfect For Every E-commerce Business"})}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-6",children:["Fashion & Apparel","Electronics","Home & Garden","Beauty & Cosmetics","Sports & Fitness","Jewelry & Accessories","Food & Beverages","Books & Media"].map((e,t)=>a.jsx(_e,{className:"p-6 text-center hover:shadow-lg transition-shadow",children:a.jsx("p",{className:"font-semibold text-lg",children:e})},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsx("div",{className:"text-center mb-16",children:a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Smart Features for E-commerce Success"})}),a.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:[{title:"Bulk Generation",description:"Upload product specs and generate descriptions for your entire catalog at once."},{title:"Keyword Integration",description:"Automatically includes relevant keywords for better search engine rankings."},{title:"Emotional Triggers",description:"Uses persuasive language and emotional triggers that increase purchase intent."},{title:"Length Control",description:"Generate descriptions in any length from short snippets to detailed narratives."},{title:"Multiple Variations",description:"Create A/B testing variations to optimize for maximum conversions."},{title:"Platform Optimization",description:"Formatted perfectly for Amazon, Shopify, WooCommerce, and other platforms."}].map((e,t)=>a.jsxs(_e,{className:"p-6 hover:shadow-lg transition-shadow",children:[a.jsx("h3",{className:"text-xl font-semibold mb-2",children:e.title}),a.jsx("p",{className:"text-muted-foreground",children:e.description})]},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-primary/5",children:a.jsxs("div",{className:"container max-w-4xl mx-auto text-center",children:[a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-6",children:"Ready to Scale Your Product Content?"}),a.jsx("p",{className:"text-lg text-muted-foreground mb-8 max-w-2xl mx-auto",children:"Join e-commerce businesses using WordSmith AGI to create product descriptions that convert."}),a.jsx(ve,{asChild:!0,size:"lg",className:"text-lg px-8",children:a.jsx(Et,{to:"/auth",children:"Get Started Free"})})]})})]}),a.jsx(Mn,{}),a.jsx(RA,{})]}),DCt=()=>a.jsxs("div",{className:"min-h-screen",children:[a.jsx(oi,{pageSlug:"/webpage-content",title:"AI Webpage Content Generator - WordSmith AGI | Landing Pages & Website Copy",description:"Create professional webpage content with AI. Generate SEO-optimized landing pages, about pages, and website copy in minutes with WordSmith AGI.",keywords:["AI webpage content","landing page generator","website copy AI","AI web content writer","SEO website content"],canonicalUrl:"https://wordsmithagi.com/solutions/webpage"}),a.jsx(Ln,{}),a.jsxs("main",{children:[a.jsxs("section",{className:"relative min-h-[90vh] flex items-center justify-center px-4 sm:px-6 lg:px-8 overflow-hidden pt-20",children:[a.jsx("div",{className:"absolute inset-0 bg-primary/5"}),a.jsxs("div",{className:"container relative z-10 text-center max-w-5xl mx-auto",children:[a.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 border border-primary/20 mb-8",children:[a.jsx(Hs,{className:"w-4 h-4 text-primary"}),a.jsx("span",{className:"text-sm font-medium",children:"Website Content Creation"})]}),a.jsxs("h1",{className:"text-4xl sm:text-5xl lg:text-7xl font-bold mb-6 leading-tight",children:["Professional Web Content",a.jsx("span",{className:"block text-primary mt-2",children:"That Engages & Converts"})]}),a.jsx("p",{className:"text-lg sm:text-xl text-muted-foreground mb-8 max-w-3xl mx-auto",children:"Generate compelling website copy for landing pages, about pages, service pages, and more. Perfect for businesses, agencies, and web developers who need quality content fast."}),a.jsx("div",{className:"flex justify-center mb-12",children:a.jsx(ve,{asChild:!0,size:"lg",className:"text-lg px-8",children:a.jsx(Et,{to:"/auth",children:"Start Creating Content"})})}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No credit card required • 15 free credits in your first month, then 5/month"})]})]}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-muted/30",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Why Businesses Choose WordSmith AGI"}),a.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Everything you need to create professional website content that drives results"})]}),a.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:[{icon:ni,title:"SEO Optimized",description:"Content automatically optimized for search engines to improve rankings and organic traffic."},{icon:ca,title:"Conversion Focused",description:"Persuasive copy designed to guide visitors through your sales funnel and drive actions."},{icon:ln,title:"Fast Turnaround",description:"Generate complete webpage content in minutes instead of days of writing and revisions."},{icon:N6,title:"Brand Voice",description:"Maintain consistent brand messaging and tone across all website pages."},{icon:ai,title:"Multiple Page Types",description:"Create content for any webpage: landing pages, about, services, product pages, and more."},{icon:Hs,title:"Mobile Optimized",description:"Copy structured and written to work perfectly on mobile devices and tablets."}].map((e,t)=>a.jsxs(_e,{className:"p-6 hover:shadow-lg transition-shadow",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-primary/10 flex items-center justify-center mb-4",children:a.jsx(e.icon,{className:"w-6 h-6 text-primary"})}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:e.title}),a.jsx("p",{className:"text-muted-foreground",children:e.description})]},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsx("div",{className:"text-center mb-16",children:a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Content for Every Type of Webpage"})}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:["Landing Pages","About Us Pages","Service Pages","Product Pages","Homepage Copy","Contact Pages","Team Pages","Portfolio Pages","Testimonial Pages","FAQ Pages","Privacy & Legal","Case Studies"].map((e,t)=>a.jsx(_e,{className:"p-6 text-center hover:shadow-lg transition-shadow",children:a.jsx("p",{className:"font-semibold",children:e})},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-muted/30",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsx("div",{className:"text-center mb-16",children:a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Powerful Features for Web Content"})}),a.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:[{title:"Headline Generator",description:"Create attention-grabbing headlines that capture visitor interest instantly."},{title:"Value Proposition",description:"Clearly communicate your unique selling points and benefits to visitors."},{title:"Call-to-Action",description:"Persuasive CTAs strategically placed to drive conversions and engagement."},{title:"Structured Content",description:"Properly formatted content with headers, bullets, and sections for easy scanning."}].map((e,t)=>a.jsxs(_e,{className:"p-8",children:[a.jsx("h3",{className:"text-2xl font-semibold mb-3",children:e.title}),a.jsx("p",{className:"text-muted-foreground text-lg",children:e.description})]},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsx("div",{className:"text-center mb-16",children:a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Perfect For Every Industry"})}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-6",children:["SaaS Companies","E-commerce Stores","Professional Services","Real Estate","Healthcare","Education","Restaurants","Non-profits"].map((e,t)=>a.jsx(_e,{className:"p-6 text-center hover:shadow-lg transition-shadow",children:a.jsx("p",{className:"font-semibold",children:e})},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-primary/5",children:a.jsxs("div",{className:"container max-w-4xl mx-auto text-center",children:[a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-6",children:"Ready to Build Your Perfect Website?"}),a.jsx("p",{className:"text-lg text-muted-foreground mb-8 max-w-2xl mx-auto",children:"Join businesses using WordSmith AGI to create professional web content that converts visitors into customers."}),a.jsx(ve,{asChild:!0,size:"lg",className:"text-lg px-8",children:a.jsx(Et,{to:"/auth",children:"Get Started Free"})})]})})]}),a.jsx(Mn,{}),a.jsx(RA,{})]}),RCt=()=>a.jsxs("div",{className:"min-h-screen",children:[a.jsx(oi,{pageSlug:"/help-article",title:"AI Help Article Writer - WordSmith AGI | Knowledge Base & Documentation",description:"Create professional help articles and knowledge base content with AI. Generate clear, comprehensive documentation and support articles with WordSmith AGI.",keywords:["AI help article writer","knowledge base generator","documentation AI","support article generator","AI technical writing"],canonicalUrl:"https://wordsmithagi.com/solutions/help-articles"}),a.jsx(Ln,{}),a.jsxs("main",{children:[a.jsxs("section",{className:"relative min-h-[90vh] flex items-center justify-center px-4 sm:px-6 lg:px-8 overflow-hidden pt-20",children:[a.jsx("div",{className:"absolute inset-0 bg-primary/5"}),a.jsxs("div",{className:"container relative z-10 text-center max-w-5xl mx-auto",children:[a.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 border border-primary/20 mb-8",children:[a.jsx(L1,{className:"w-4 h-4 text-primary"}),a.jsx("span",{className:"text-sm font-medium",children:"Help Center Content"})]}),a.jsxs("h1",{className:"text-4xl sm:text-5xl lg:text-7xl font-bold mb-6 leading-tight",children:["Create Comprehensive",a.jsx("span",{className:"block text-primary mt-2",children:"Help Articles & Documentation"})]}),a.jsx("p",{className:"text-lg sm:text-xl text-muted-foreground mb-8 max-w-3xl mx-auto",children:"Generate clear, helpful articles for your knowledge base, FAQs, tutorials, and user guides. Perfect for support teams, SaaS companies, and customer success professionals."}),a.jsx("div",{className:"flex justify-center mb-12",children:a.jsx(ve,{asChild:!0,size:"lg",className:"text-lg px-8",children:a.jsx(Et,{to:"/auth",children:"Start Creating Articles"})})}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No credit card required • 15 free credits in your first month, then 5/month"})]})]}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-muted/30",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Why Support Teams Choose WordSmith AGI"}),a.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Everything you need to build a comprehensive knowledge base"})]}),a.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:[{icon:tu,title:"Save Support Time",description:"Reduce support tickets by providing clear, searchable help articles that customers can find instantly."},{icon:nu,title:"Better User Experience",description:"Help users help themselves with well-structured documentation and easy-to-follow guides."},{icon:pc,title:"Comprehensive Coverage",description:"Create articles for every feature, function, and common question in your product or service."},{icon:Ube,title:"Consistent Quality",description:"Maintain professional, clear writing across all documentation with AI-powered consistency."},{icon:Ex,title:"Multiple Formats",description:"Generate how-to guides, troubleshooting articles, FAQs, tutorials, and more."},{icon:L1,title:"SEO Optimized",description:"Articles optimized for search engines so customers can find answers via Google."}].map((e,t)=>a.jsxs(_e,{className:"p-6 hover:shadow-lg transition-shadow",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-primary/10 flex items-center justify-center mb-4",children:a.jsx(e.icon,{className:"w-6 h-6 text-primary"})}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:e.title}),a.jsx("p",{className:"text-muted-foreground",children:e.description})]},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsx("div",{className:"text-center mb-16",children:a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Create Every Type of Help Content"})}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:["How-To Guides","Troubleshooting Articles","FAQ Sections","Getting Started Guides","Feature Documentation","API Documentation","Video Tutorials Scripts","Product Walkthroughs","Best Practices","Common Issues","Integration Guides","Release Notes"].map((e,t)=>a.jsx(_e,{className:"p-6 text-center hover:shadow-lg transition-shadow",children:a.jsx("p",{className:"font-semibold",children:e})},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-muted/30",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsx("div",{className:"text-center mb-16",children:a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Smart Features for Help Documentation"})}),a.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:[{title:"Step-by-Step Instructions",description:"Automatically structure content into clear, numbered steps that are easy to follow."},{title:"Screenshot Descriptions",description:"Generate descriptive text to accompany screenshots and visual aids in your articles."},{title:"Troubleshooting Trees",description:"Create logical if/then troubleshooting flows that help users diagnose issues."},{title:"Search Optimized",description:"Articles written with keywords and phrases that match how users search for help."}].map((e,t)=>a.jsxs(_e,{className:"p-8",children:[a.jsx("h3",{className:"text-2xl font-semibold mb-3",children:e.title}),a.jsx("p",{className:"text-muted-foreground text-lg",children:e.description})]},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsx("div",{className:"text-center mb-16",children:a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-4",children:"Perfect For Every Support Need"})}),a.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:[{title:"SaaS Products",description:"Complete knowledge bases for software products, features, and integrations."},{title:"E-commerce Support",description:"Shipping, returns, payment, and product care articles for online stores."},{title:"Technical Products",description:"Detailed technical documentation for complex products and APIs."},{title:"Service Businesses",description:"Client onboarding, process guides, and service FAQs for professional services."}].map((e,t)=>a.jsxs(_e,{className:"p-8",children:[a.jsx("h3",{className:"text-2xl font-semibold mb-3",children:e.title}),a.jsx("p",{className:"text-muted-foreground text-lg",children:e.description})]},t))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-primary/5",children:a.jsxs("div",{className:"container max-w-4xl mx-auto text-center",children:[a.jsx("h2",{className:"text-3xl sm:text-4xl font-bold mb-6",children:"Build Your Knowledge Base Today"}),a.jsx("p",{className:"text-lg text-muted-foreground mb-8 max-w-2xl mx-auto",children:"Join support teams using WordSmith AGI to create helpful documentation that empowers users and reduces support load."}),a.jsx(ve,{asChild:!0,size:"lg",className:"text-lg px-8",children:a.jsx(Et,{to:"/auth",children:"Get Started Free"})})]})})]}),a.jsx(Mn,{}),a.jsx(RA,{})]}),UCt=()=>{const e=hs(),t=[{feature:"SEO Optimization",wordsmith:!0,chatgpt:!1,description:"Built-in SEO optimization for higher search rankings"},{feature:"AI Search Optimization",wordsmith:!0,chatgpt:!1,description:"Content optimized for AI assistants like ChatGPT, Gemini, and Claude"},{feature:"Studio Mode",wordsmith:!0,chatgpt:!1,description:"Research-backed content creation with fact integration and source management"},{feature:"Idea Lab",wordsmith:!0,chatgpt:!1,description:"Generate viral content ideas tailored to your niche and platform"},{feature:"Custom Presets",wordsmith:!0,chatgpt:!1,description:"Save and reuse your favorite content generation settings"},{feature:"Long-form Content Generation",wordsmith:!0,chatgpt:"Limited",description:"Generate complete blog posts up to 3000+ words"},{feature:"Content Templates",wordsmith:!0,chatgpt:!1,description:"Pre-built templates for various content types"},{feature:"Tone Customization",wordsmith:!0,chatgpt:"Manual",description:"Easy tone selection with consistent output"},{feature:"Content Library",wordsmith:!0,chatgpt:!1,description:"Save, organize, and manage all your content in one place"},{feature:"Rich Text Editor",wordsmith:!0,chatgpt:!1,description:"Advanced editor with formatting and media support"},{feature:"Multi-language Support",wordsmith:!0,chatgpt:!0,description:"Create content in multiple languages"},{feature:"Direct Publishing",wordsmith:!0,chatgpt:!1,description:"Publish directly without copy-paste"},{feature:"Content Refinement",wordsmith:!0,chatgpt:"Manual",description:"AI-powered content refinement with one click"}];return a.jsxs("div",{className:"min-h-screen",children:[a.jsx(oi,{pageSlug:"/chatgpt-comparison",title:"ChatGPT vs WordSmith AGI | Best AI Content Creation Tool",description:"Compare ChatGPT and WordSmith AGI for content creation. Discover why WordSmith AGI is the superior choice for SEO-optimized, professional content generation.",keywords:["ChatGPT vs WordSmith AGI","ChatGPT alternative","AI content creation comparison","best AI writing tool"],canonicalUrl:"https://wordsmithagi.com/chatgpt-comparison"}),a.jsx(Ln,{}),a.jsxs("main",{className:"container mx-auto px-4 py-20 md:py-24 space-y-16",children:[a.jsxs("section",{className:"text-center space-y-6 max-w-4xl mx-auto pt-8",children:[a.jsxs("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold",children:["ChatGPT vs ",a.jsx("span",{className:"text-primary",children:"WordSmith AGI"})]}),a.jsx("p",{className:"text-xl text-muted-foreground",children:"While ChatGPT is a powerful general-purpose AI assistant, WordSmith AGI is specifically designed and optimized for professional content creation with built-in SEO and publishing features."})]}),a.jsxs("section",{className:"space-y-8",children:[a.jsxs("div",{className:"text-center space-y-4",children:[a.jsx("h2",{className:"text-3xl md:text-4xl font-bold",children:"Why WordSmith AGI Wins"}),a.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Purpose-built for content creators who need more than just text generation"})]}),a.jsxs("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:[a.jsxs(_e,{children:[a.jsxs(ot,{children:[a.jsx(ca,{className:"h-10 w-10 text-primary mb-2"}),a.jsx(lt,{children:"Purpose-Built for Content"})]}),a.jsx(Ge,{children:a.jsx("p",{className:"text-muted-foreground",children:"WordSmith AGI is specifically designed for content creation with features like SEO optimization, content templates, and publishing tools - not a general chatbot."})})]}),a.jsxs(_e,{children:[a.jsxs(ot,{children:[a.jsx(ni,{className:"h-10 w-10 text-primary mb-2"}),a.jsx(lt,{children:"SEO & AI Search Ready"})]}),a.jsx(Ge,{children:a.jsx("p",{className:"text-muted-foreground",children:"Every piece of content is automatically optimized for both traditional search engines and AI assistants - ensuring maximum visibility."})})]}),a.jsxs(_e,{children:[a.jsxs(ot,{children:[a.jsx(pc,{className:"h-10 w-10 text-primary mb-2"}),a.jsx(lt,{children:"Complete Content Workflow"})]}),a.jsx(Ge,{children:a.jsx("p",{className:"text-muted-foreground",children:"From ideation to publishing - manage your entire content creation process in one platform with built-in library and collaboration tools."})})]}),a.jsxs(_e,{children:[a.jsxs(ot,{children:[a.jsx(ln,{className:"h-10 w-10 text-primary mb-2"}),a.jsx(lt,{children:"Consistent Quality"})]}),a.jsx(Ge,{children:a.jsx("p",{className:"text-muted-foreground",children:"Get professional, publication-ready content every time with pre-configured tones, formats, and quality controls built into the platform."})})]}),a.jsxs(_e,{children:[a.jsxs(ot,{children:[a.jsx(Hs,{className:"h-10 w-10 text-primary mb-2"}),a.jsx(lt,{children:"Studio & Research Mode"})]}),a.jsx(Ge,{children:a.jsx("p",{className:"text-muted-foreground",children:"Studio mode lets you integrate your research seamlessly with fact-checking, source management, and the ability to create factually accurate content that maintains your expertise."})})]}),a.jsxs(_e,{children:[a.jsxs(ot,{children:[a.jsx(ln,{className:"h-10 w-10 text-primary mb-2"}),a.jsx(lt,{children:"Presets & Idea Lab"})]}),a.jsx(Ge,{children:a.jsx("p",{className:"text-muted-foreground",children:"Save your favorite settings as presets for instant reuse. Generate viral content ideas tailored to your niche with Idea Lab - features ChatGPT simply doesn't offer."})})]}),a.jsxs(_e,{children:[a.jsxs(ot,{children:[a.jsx(M1,{className:"h-10 w-10 text-primary mb-2"}),a.jsx(lt,{children:"Better Value"})]}),a.jsx(Ge,{children:a.jsx("p",{className:"text-muted-foreground",children:"Predictable pricing with generous generation limits and no hidden costs. Free tier available to get started without credit card."})})]})]})]}),a.jsxs("section",{className:"space-y-8",children:[a.jsxs("div",{className:"text-center space-y-4",children:[a.jsx("h2",{className:"text-3xl md:text-4xl font-bold",children:"Feature-by-Feature Comparison"}),a.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"See how WordSmith AGI stacks up against ChatGPT for content creation"})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("div",{className:"min-w-[600px] bg-card rounded-lg border",children:[a.jsxs("div",{className:"grid grid-cols-4 gap-4 p-4 border-b bg-muted/50 font-semibold",children:[a.jsx("div",{children:"Feature"}),a.jsx("div",{className:"text-center",children:"WordSmith AGI"}),a.jsx("div",{className:"text-center",children:"ChatGPT"}),a.jsx("div",{children:"Details"})]}),t.map((r,n)=>a.jsxs("div",{className:`grid grid-cols-4 gap-4 p-4 items-center ${n!==t.length-1?"border-b":""}`,children:[a.jsx("div",{className:"font-medium",children:r.feature}),a.jsx("div",{className:"flex justify-center",children:r.wordsmith===!0?a.jsx(dr,{className:"h-6 w-6 text-green-500"}):r.wordsmith===!1?a.jsx(ml,{className:"h-6 w-6 text-destructive"}):a.jsx("span",{className:"text-sm text-muted-foreground",children:r.wordsmith})}),a.jsx("div",{className:"flex justify-center",children:r.chatgpt===!0?a.jsx(dr,{className:"h-6 w-6 text-green-500"}):r.chatgpt===!1?a.jsx(ml,{className:"h-6 w-6 text-destructive"}):a.jsx("span",{className:"text-sm text-muted-foreground",children:r.chatgpt})}),a.jsx("div",{className:"text-sm text-muted-foreground",children:r.description})]},n))]})})]}),a.jsxs("section",{className:"space-y-8",children:[a.jsx("div",{className:"text-center space-y-4",children:a.jsx("h2",{className:"text-3xl md:text-4xl font-bold",children:"Which Tool Should You Use?"})}),a.jsxs("div",{className:"grid md:grid-cols-2 gap-8 max-w-5xl mx-auto",children:[a.jsxs(_e,{className:"border-primary",children:[a.jsx(ot,{children:a.jsxs(lt,{className:"text-2xl flex items-center gap-2",children:[a.jsx(dr,{className:"h-6 w-6 text-primary"}),"Use WordSmith AGI When:"]})}),a.jsx(Ge,{className:"space-y-3",children:a.jsxs("ul",{className:"space-y-2",children:[a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx(dr,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),a.jsx("span",{children:"You need SEO-optimized blog posts and articles"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx(dr,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),a.jsx("span",{children:"You want content optimized for AI search engines"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx(dr,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),a.jsx("span",{children:"You need long-form content (1000-3000+ words)"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx(dr,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),a.jsx("span",{children:"You want to manage content in one platform"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx(dr,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),a.jsx("span",{children:"You need consistent, professional quality"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx(dr,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),a.jsx("span",{children:"You want research-based content creation"})]})]})})]}),a.jsxs(_e,{children:[a.jsx(ot,{children:a.jsxs(lt,{className:"text-2xl flex items-center gap-2",children:[a.jsx(dr,{className:"h-6 w-6 text-muted-foreground"}),"Use ChatGPT When:"]})}),a.jsx(Ge,{className:"space-y-3",children:a.jsxs("ul",{className:"space-y-2",children:[a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx(dr,{className:"h-5 w-5 text-muted-foreground mt-0.5 flex-shrink-0"}),a.jsx("span",{children:"You need general Q&A and conversation"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx(dr,{className:"h-5 w-5 text-muted-foreground mt-0.5 flex-shrink-0"}),a.jsx("span",{children:"You want coding assistance"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx(dr,{className:"h-5 w-5 text-muted-foreground mt-0.5 flex-shrink-0"}),a.jsx("span",{children:"You need brainstorming or idea generation"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx(dr,{className:"h-5 w-5 text-muted-foreground mt-0.5 flex-shrink-0"}),a.jsx("span",{children:"You need quick, short-form responses"})]}),a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx(dr,{className:"h-5 w-5 text-muted-foreground mt-0.5 flex-shrink-0"}),a.jsx("span",{children:"You need a general-purpose AI assistant"})]})]})})]})]})]}),a.jsxs("section",{className:"bg-primary/5 rounded-lg p-8 md:p-12 text-center space-y-6",children:[a.jsx("h2",{className:"text-3xl md:text-4xl font-bold",children:"Ready to Experience the Difference?"}),a.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Join thousands of content creators who've switched to WordSmith AGI for better, faster, and more effective content creation."}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[a.jsx(ve,{size:"lg",className:"border-2",onClick:()=>e("/auth"),children:"Start Free Trial"}),a.jsx(ve,{size:"lg",variant:"outline",className:"border-2 border-primary",onClick:()=>e("/pricing"),children:"View Pricing"})]})]})]}),a.jsx(Mn,{})]})},QCt=()=>{const e=hs(),t=[{feature:"Pricing",wordsmith:"Starting at $19/mo",jasper:"Starting at $49/mo",description:"More affordable pricing for individuals and small teams"},{feature:"Free Tier",wordsmith:!0,jasper:!1,description:"10 generations per month completely free"},{feature:"SEO Optimization",wordsmith:!0,jasper:!0,description:"Built-in SEO optimization features"},{feature:"AI Search Optimization",wordsmith:!0,jasper:!1,description:"Content optimized for AI assistants like ChatGPT, Gemini, and Claude"},{feature:"Studio Mode",wordsmith:!0,jasper:"Limited",description:"Research-backed content creation with fact integration and source management"},{feature:"Idea Lab",wordsmith:!0,jasper:!1,description:"Generate viral content ideas tailored to your niche and platform"},{feature:"Custom Presets",wordsmith:!0,jasper:"Templates Only",description:"Save and reuse your personalized content generation settings"},{feature:"Long-form Content",wordsmith:"Up to 3000+ words",jasper:"Up to 3000+ words",description:"Generate comprehensive long-form content"},{feature:"Content Library",wordsmith:!0,jasper:!0,description:"Organize and manage your content in one place"},{feature:"Rich Text Editor",wordsmith:!0,jasper:!0,description:"Advanced editor with formatting support"},{feature:"Multi-language Support",wordsmith:!0,jasper:!0,description:"Create content in multiple languages"},{feature:"Team Collaboration",wordsmith:"Pro & Elite Plans",jasper:"Higher Plans Only",description:"Collaborate with your team on content creation"},{feature:"Learning Curve",wordsmith:"Beginner Friendly",jasper:"Steeper Learning Curve",description:"Easy to use interface designed for all skill levels"},{feature:"Content Refinement",wordsmith:!0,jasper:!0,description:"AI-powered content refinement capabilities"}],r=[{icon:M1,title:"Better Value",description:"Get more features at a lower price point, with a generous free tier to get started"},{icon:ln,title:"Simpler Interface",description:"No steep learning curve - start creating professional content in minutes, not hours"},{icon:ni,title:"AI Search Ready",description:"Only WordSmith AGI optimizes your content for AI assistants, not just traditional search engines"},{icon:pc,title:"Research-Driven",description:"Studio Mode lets you build content from verified facts and sources, ensuring accuracy"}],n=i=>typeof i=="boolean"?i?a.jsx(dr,{className:"w-6 h-6 text-green-500"}):a.jsx(ml,{className:"w-6 h-6 text-muted-foreground/50"}):a.jsx("span",{className:"text-sm text-foreground",children:i});return a.jsxs("div",{className:"min-h-screen",children:[a.jsx(oi,{pageSlug:"/jasper-alternative",title:"Jasper AI Alternative | WordSmith AGI - Better Value, More Features at $10/mo",description:"Switch from Jasper AI to WordSmith AGI and save over 60%. Get AI Search Optimization, Studio Mode, Idea Lab, custom presets, and more starting at just $10/month. Free tier included.",keywords:["Jasper AI alternative","Jasper alternative","Jasper AI competitor","cheaper than Jasper AI","best Jasper alternative","WordSmith AGI vs Jasper","AI content writing tool","affordable AI writing software","Jasper AI pricing alternative","AI content generator","SEO content creation tool","AI copywriting software","blog post generator","content marketing AI","AI writing assistant"],canonicalUrl:"https://wordsmithagi.com/jasper-alternative",schemaType:"WebPage"}),a.jsx(Ln,{}),a.jsxs("main",{className:"container mx-auto px-4 py-20 md:py-24 space-y-16",children:[a.jsxs("section",{className:"text-center space-y-6 max-w-4xl mx-auto pt-8",children:[a.jsxs("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold",children:["The Better ",a.jsx("span",{className:"text-primary",children:"Jasper AI Alternative"})]}),a.jsx("p",{className:"text-xl text-muted-foreground",children:"While Jasper AI is a solid content creation tool, WordSmith AGI offers more value, unique features, and a simpler experience at a fraction of the cost."})]}),a.jsxs("section",{className:"space-y-8",children:[a.jsxs("div",{className:"text-center space-y-4",children:[a.jsx("h2",{className:"text-3xl md:text-4xl font-bold",children:"Why Choose WordSmith AGI?"}),a.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Here's what makes WordSmith AGI the smarter choice over Jasper AI"})]}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-6",children:r.map((i,s)=>a.jsxs(_e,{className:"border-2",children:[a.jsxs(ot,{children:[a.jsx("div",{className:"w-12 h-12 rounded-lg bg-primary/10 flex items-center justify-center mb-4",children:a.jsx(i.icon,{className:"w-6 h-6 text-primary"})}),a.jsx(lt,{className:"text-xl",children:i.title})]}),a.jsx(Ge,{children:a.jsx(Mr,{className:"text-base",children:i.description})})]},s))})]}),a.jsxs("section",{className:"space-y-8",children:[a.jsxs("div",{className:"text-center space-y-4",children:[a.jsx("h2",{className:"text-3xl md:text-4xl font-bold",children:"Feature-by-Feature Comparison"}),a.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"See how WordSmith AGI stacks up against Jasper AI"})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full border-collapse",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b-2 border-border",children:[a.jsx("th",{className:"text-left py-4 px-4 font-bold",children:"Feature"}),a.jsx("th",{className:"text-center py-4 px-4 font-bold text-primary",children:"WordSmith AGI"}),a.jsx("th",{className:"text-center py-4 px-4 font-bold",children:"Jasper AI"})]})}),a.jsx("tbody",{children:t.map((i,s)=>a.jsxs("tr",{className:"border-b border-border hover:bg-muted/50 transition-colors",children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:i.feature}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:i.description})]})}),a.jsx("td",{className:"py-4 px-4 text-center",children:n(i.wordsmith)}),a.jsx("td",{className:"py-4 px-4 text-center",children:n(i.jasper)})]},s))})]})})]}),a.jsxs("section",{className:"space-y-8",children:[a.jsx("div",{className:"text-center space-y-4",children:a.jsx("h2",{className:"text-3xl md:text-4xl font-bold",children:"When to Choose WordSmith AGI"})}),a.jsxs("div",{className:"grid md:grid-cols-2 gap-8 max-w-5xl mx-auto",children:[a.jsxs(_e,{className:"border-2 border-primary/20",children:[a.jsx(ot,{children:a.jsxs(lt,{className:"text-xl flex items-center gap-2",children:[a.jsx(dr,{className:"w-6 h-6 text-green-500"}),"Choose WordSmith AGI If You:"]})}),a.jsxs(Ge,{className:"space-y-3",children:[a.jsxs("p",{className:"flex items-start gap-2",children:[a.jsx(dr,{className:"w-5 h-5 text-green-500 mt-0.5 flex-shrink-0"}),a.jsx("span",{children:"Want better value for your money with powerful features"})]}),a.jsxs("p",{className:"flex items-start gap-2",children:[a.jsx(dr,{className:"w-5 h-5 text-green-500 mt-0.5 flex-shrink-0"}),a.jsx("span",{children:"Need content optimized for AI search assistants"})]}),a.jsxs("p",{className:"flex items-start gap-2",children:[a.jsx(dr,{className:"w-5 h-5 text-green-500 mt-0.5 flex-shrink-0"}),a.jsx("span",{children:"Want viral content ideas generated for your niche"})]}),a.jsxs("p",{className:"flex items-start gap-2",children:[a.jsx(dr,{className:"w-5 h-5 text-green-500 mt-0.5 flex-shrink-0"}),a.jsx("span",{children:"Prefer a beginner-friendly interface"})]}),a.jsxs("p",{className:"flex items-start gap-2",children:[a.jsx(dr,{className:"w-5 h-5 text-green-500 mt-0.5 flex-shrink-0"}),a.jsx("span",{children:"Need research-backed content with source management"})]}),a.jsxs("p",{className:"flex items-start gap-2",children:[a.jsx(dr,{className:"w-5 h-5 text-green-500 mt-0.5 flex-shrink-0"}),a.jsx("span",{children:"Want to try the platform for free before committing"})]})]})]}),a.jsxs(_e,{children:[a.jsx(ot,{children:a.jsxs(lt,{className:"text-xl flex items-center gap-2",children:[a.jsx(G5,{className:"w-6 h-6 text-muted-foreground"}),"Consider Jasper AI If You:"]})}),a.jsxs(Ge,{className:"space-y-3",children:[a.jsxs("p",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-muted-foreground",children:"•"}),a.jsx("span",{children:"Already have a large team trained on Jasper"})]}),a.jsxs("p",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-muted-foreground",children:"•"}),a.jsx("span",{children:"Are heavily invested in their ecosystem"})]}),a.jsxs("p",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-muted-foreground",children:"•"}),a.jsx("span",{children:"Have business-specific requirements"})]}),a.jsxs("p",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-muted-foreground",children:"•"}),a.jsx("span",{children:"Don't mind paying premium prices"})]})]})]})]})]}),a.jsxs("section",{className:"text-center space-y-6 py-12",children:[a.jsx("h2",{className:"text-3xl md:text-4xl font-bold",children:"Ready to Make the Switch?"}),a.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Join thousands of content creators who've switched to WordSmith AGI for better value and results"}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[a.jsx(ve,{size:"lg",onClick:()=>e("/auth"),className:"text-lg px-8",children:"Start Free Trial"}),a.jsx(ve,{size:"lg",variant:"outline",onClick:()=>e("/#pricing"),className:"text-lg px-8",children:"View Pricing"})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No credit card required • 15 free credits in your first month, then 5/month"})]})]}),a.jsx(Mn,{})]})},HCt=()=>{const e=hs(),t=[{icon:qte,title:"GPT-4o Powered AI",description:"Advanced neural networks that write like humans, with perfect grammar, engaging flow, and natural storytelling that captivates your readers"},{icon:oc,title:"Built-in SEO Intelligence",description:"Every article automatically optimized for Google: strategic keyword placement, proper headings, meta descriptions, and search-friendly structure"},{icon:Hs,title:"9+ Languages, One Platform",description:"Write for global audiences effortlessly. English, Spanish, French, German, Arabic, Hindi, Chinese, Japanese, Portuguese, and more"},{icon:ln,title:"60-Second Content Creation",description:"From idea to polished 2,000+ word article in under a minute. No more staring at blank pages or spending hours writing"},{icon:ni,title:"Your Brand Voice, Perfected",description:"Professional, casual, persuasive, or friendly, WordSmith AGI matches your exact tone and style across every piece of content"},{icon:ca,title:"Smart Audience Adaptation",description:"Content that speaks directly to your target readers, from beginners to experts, B2B to B2C, technical to conversational"}],r=["Write blog posts 10X faster than manual writing","Generate unlimited SEO-optimized articles for less than one freelance writer","Never face writer's block or content bottlenecks again","Scale from 1 article per week to 10+ without adding headcount","Maintain perfect brand consistency across all your content","Create content in 9 languages to reach global markets","Get publication-ready drafts in 60 seconds, not 6 hours","Turn content creation from your biggest expense into your competitive advantage"],n=[{title:"Content Marketers",description:"Publish 10X more blog posts without hiring writers. Build your content library, dominate SEO rankings, and drive organic traffic that converts"},{title:"E-commerce Brands",description:"Write product descriptions, landing pages, and email sequences that sell. Turn your content into a 24/7 sales machine"},{title:"Agencies & Freelancers",description:"Take on 5X more clients without burnout. Deliver premium content faster, increase your revenue, and scale your business profitably"},{title:"Bloggers & Publishers",description:"Go from 1 post per week to 1 per day. Build authority, grow your audience, and monetize with consistent, high-quality content"},{title:"Startups & Founders",description:"Launch your content marketing engine without a big team or budget. Compete with established players from day one"},{title:"Social Media Teams",description:"Create engaging posts, captions, and threads for every platform. Keep your channels active and your audience engaged"}];return a.jsxs(a.Fragment,{children:[a.jsx(oi,{title:"AI Content Writer | Best AI Writing Tool for SEO & Marketing Content",description:"WordSmith AGI is the world's best AI content writer. Generate SEO-optimized blog posts, articles, social media content, and marketing copy in seconds. Multi-language support, advanced AI, and unlimited content creation.",keywords:["ai content writer","ai writing tool","ai blog writer","content generation ai","seo content writer","ai copywriter","automated content creation","ai article writer","content writing software","ai marketing content"],canonicalUrl:"https://wordsmithagi.com/ai-content-writer",schemaType:"WebPage"}),a.jsxs("div",{className:"min-h-screen bg-background",children:[a.jsx(Ln,{}),a.jsxs("section",{className:"relative pt-32 pb-20 px-4 sm:px-6 lg:px-8 overflow-hidden",children:[a.jsx("div",{className:"absolute inset-0 bg-primary/5"}),a.jsx("div",{className:"container max-w-6xl mx-auto relative",children:a.jsxs("div",{className:"text-center space-y-8",children:[a.jsxs("h1",{className:"text-4xl sm:text-5xl lg:text-7xl font-bold leading-tight tracking-tight",children:["Write Brilliant Content in",a.jsx("span",{className:"block text-primary mt-2",children:"60 Seconds with WordSmith AGI"})]}),a.jsxs("p",{className:"text-xl sm:text-2xl text-foreground/90 max-w-3xl mx-auto leading-relaxed",children:["The AI content writer that creates SEO-optimized blog posts, articles, and marketing copy that ",a.jsx("span",{className:"font-semibold text-foreground",children:"reads like a human wrote it"}),", trained on millions of top-performing articles."]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center pt-6",children:[a.jsxs(ve,{size:"lg",onClick:()=>e("/auth"),className:"text-lg px-10 py-6 shadow-lg hover:shadow-xl transition-all font-semibold",children:["Start Writing Free Now",a.jsx(Di,{className:"ml-2 h-5 w-5"})]}),a.jsx(ve,{size:"lg",variant:"outline",onClick:()=>e("/pricing"),className:"text-lg px-10 py-6 font-semibold border-2",children:"See Plans & Pricing"})]}),a.jsxs("div",{className:"flex flex-wrap gap-6 justify-center pt-8 text-base",children:[a.jsxs("div",{className:"flex items-center gap-2 bg-primary/10 px-4 py-2 rounded-full",children:[a.jsx(Zf,{className:"h-5 w-5 text-primary"}),a.jsx("span",{className:"font-medium",children:"15 Free Credits"})]}),a.jsxs("div",{className:"flex items-center gap-2 bg-primary/10 px-4 py-2 rounded-full",children:[a.jsx(Zf,{className:"h-5 w-5 text-primary"}),a.jsx("span",{className:"font-medium",children:"No Credit Card"})]}),a.jsxs("div",{className:"flex items-center gap-2 bg-primary/10 px-4 py-2 rounded-full",children:[a.jsx(Zf,{className:"h-5 w-5 text-primary"}),a.jsx("span",{className:"font-medium",children:"Cancel Anytime"})]})]})]})})]}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-muted/30",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-3xl sm:text-4xl lg:text-5xl font-bold mb-6",children:"Why WordSmith AGI is the Best AI Content Writer"}),a.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"The complete AI writing solution built for marketers, businesses, and creators who demand quality at scale"})]}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:t.map((i,s)=>a.jsxs(_e,{className:"p-8 hover:shadow-xl hover:scale-105 transition-all duration-300 border-2 hover:border-primary/50",children:[a.jsx(i.icon,{className:"h-14 w-14 text-primary mb-6"}),a.jsx("h3",{className:"text-xl font-bold mb-4",children:i.title}),a.jsx("p",{className:"text-muted-foreground leading-relaxed",children:i.description})]},s))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:a.jsx("div",{className:"container max-w-6xl mx-auto",children:a.jsxs("div",{className:"grid lg:grid-cols-2 gap-12 items-center",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-3xl sm:text-4xl lg:text-5xl font-bold mb-6 leading-tight",children:"Stop Struggling with Content Creation"}),a.jsx("p",{className:"text-xl text-muted-foreground mb-10 leading-relaxed",children:"WordSmith AGI is your unfair advantage. While competitors spend weeks creating content, you'll publish better articles in minutes. Here's what changes when you switch:"}),a.jsx("div",{className:"space-y-4",children:r.map((i,s)=>a.jsxs("div",{className:"flex items-start gap-4 bg-card p-4 rounded-lg hover:bg-accent/10 transition-colors",children:[a.jsx(Zf,{className:"h-6 w-6 text-primary flex-shrink-0 mt-1"}),a.jsx("span",{className:"text-foreground text-lg leading-relaxed",children:i})]},s))})]}),a.jsx("div",{className:"relative",children:a.jsx(_e,{className:"p-10 bg-primary/10 border-2 border-primary/30 shadow-2xl",children:a.jsxs("div",{className:"space-y-8",children:[a.jsxs("div",{className:"border-b border-border pb-6",children:[a.jsx("div",{className:"text-6xl font-black text-primary mb-3 tracking-tight",children:"10X"}),a.jsx("p",{className:"text-foreground text-lg font-medium",children:"Faster than writing manually, from 6 hours to 60 seconds per article"})]}),a.jsxs("div",{className:"border-b border-border pb-6",children:[a.jsx("div",{className:"text-6xl font-black text-primary mb-3 tracking-tight",children:"$2,000+"}),a.jsx("p",{className:"text-foreground text-lg font-medium",children:"Saved monthly vs. hiring freelance writers or agencies"})]}),a.jsxs("div",{className:"border-b border-border pb-6",children:[a.jsx("div",{className:"text-6xl font-black text-primary mb-3 tracking-tight",children:"9+"}),a.jsx("p",{className:"text-foreground text-lg font-medium",children:"Languages to reach billions of readers worldwide"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-6xl font-black text-primary mb-3 tracking-tight",children:"100%"}),a.jsx("p",{className:"text-foreground text-lg font-medium",children:"SEO-optimized with keywords, meta tags, and search-friendly structure"})]})]})})})]})})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-muted/30",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-3xl sm:text-4xl lg:text-5xl font-bold mb-6",children:"Built for Teams and Creators Who Need Results"}),a.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"Whether you're scaling a content empire or launching your first blog, WordSmith AGI adapts to your workflow"})]}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:n.map((i,s)=>a.jsxs(_e,{className:"p-8 hover:shadow-xl hover:border-primary/50 transition-all duration-300 border-2",children:[a.jsx("h3",{className:"text-2xl font-bold mb-4 text-primary",children:i.title}),a.jsx("p",{className:"text-muted-foreground text-lg leading-relaxed",children:i.description})]},s))})]})}),a.jsx("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"container max-w-6xl mx-auto",children:[a.jsxs("div",{className:"text-center mb-16",children:[a.jsx("h2",{className:"text-3xl sm:text-4xl lg:text-5xl font-bold mb-6",children:"From Blank Page to Published in 3 Minutes"}),a.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"No complex prompts. No trial and error. Just results."})]}),a.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[a.jsxs(_e,{className:"p-10 text-center border-2 hover:border-primary transition-all hover:shadow-xl",children:[a.jsx("div",{className:"w-20 h-20 bg-primary rounded-full flex items-center justify-center mx-auto mb-6 shadow-lg",children:a.jsx("span",{className:"text-3xl font-black text-primary-foreground",children:"1"})}),a.jsx("h3",{className:"text-2xl font-bold mb-4",children:"Tell Us What to Write"}),a.jsx("p",{className:"text-muted-foreground text-lg leading-relaxed",children:"Enter your topic, keywords, and target audience. Choose your tone and content length. That's it."})]}),a.jsxs(_e,{className:"p-10 text-center border-2 hover:border-primary transition-all hover:shadow-xl",children:[a.jsx("div",{className:"w-20 h-20 bg-primary rounded-full flex items-center justify-center mx-auto mb-6 shadow-lg",children:a.jsx("span",{className:"text-3xl font-black text-primary-foreground",children:"2"})}),a.jsx("h3",{className:"text-2xl font-bold mb-4",children:"AI Writes Your Content"}),a.jsx("p",{className:"text-muted-foreground text-lg leading-relaxed",children:"WordSmith AGI analyzes top content, optimizes for SEO, and generates a complete, publication-ready article in 60 seconds."})]}),a.jsxs(_e,{className:"p-10 text-center border-2 hover:border-primary transition-all hover:shadow-xl",children:[a.jsx("div",{className:"w-20 h-20 bg-primary rounded-full flex items-center justify-center mx-auto mb-6 shadow-lg",children:a.jsx("span",{className:"text-3xl font-black text-primary-foreground",children:"3"})}),a.jsx("h3",{className:"text-2xl font-bold mb-4",children:"Edit & Publish"}),a.jsx("p",{className:"text-muted-foreground text-lg leading-relaxed",children:"Fine-tune with our built-in editor, make any adjustments you need, and publish your content immediately. Or just hit publish as-is."})]})]})]})}),a.jsx("section",{className:"py-24 px-4 sm:px-6 lg:px-8 bg-primary/5",children:a.jsxs("div",{className:"container max-w-5xl mx-auto text-center",children:[a.jsx("h2",{className:"text-4xl sm:text-5xl lg:text-6xl font-bold mb-8 leading-tight",children:"Ready to Write Like a Pro in 60 Seconds?"}),a.jsxs("p",{className:"text-xl sm:text-2xl text-muted-foreground mb-12 max-w-3xl mx-auto leading-relaxed",children:["Join 10,000+ marketers, creators, and businesses using WordSmith AGI to dominate their content game.",a.jsx("span",{className:"block mt-2 font-semibold text-foreground",children:"Start free. No credit card. No risk."})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-6 justify-center",children:[a.jsxs(ve,{size:"lg",onClick:()=>e("/auth"),className:"text-xl px-12 py-7 shadow-2xl hover:shadow-primary/50 transition-all font-bold",children:["Start Creating Free Content Now",a.jsx(Di,{className:"ml-3 h-6 w-6"})]}),a.jsx(ve,{size:"lg",variant:"outline",onClick:()=>e("/contact"),className:"text-xl px-12 py-7 font-bold border-2",children:"Talk to Our Team"})]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-8",children:"✨ 15 free credits in your first month • No credit card required • Upgrade or cancel anytime"})]})}),a.jsx(Mn,{})]})]})},$Ct=()=>{const e=[{icon:Do,title:"AI Slide Generation",description:"Enter a topic, paste an outline, or describe your presentation goal. AI generates a complete, professionally structured slide deck in seconds."},{icon:bwe,title:"Professional Templates",description:"Choose from a library of polished themes designed for business pitches, sales decks, educational content, team meetings, and conference talks."},{icon:N6,title:"Smart Auto-Layout",description:"AI arranges text, charts, images, and data into clean, balanced slide layouts that look hand-designed by a professional."},{icon:cre,title:"Speaker Notes Generation",description:"Every slide comes with detailed speaker notes so you can present confidently without memorizing your entire deck."},{icon:Px,title:"Brand Voice & Styling",description:"Apply your brand colors, fonts, and logo across every slide automatically. Maintain visual consistency without manual design work."},{icon:ere,title:"Export to PDF & PPTX",description:"Download your finished presentations as PDF or PPTX files. Import directly into PowerPoint, Google Slides, or Keynote."}],t=[{icon:g6,title:"Business Pitches",description:"Create investor decks and business proposals that look polished and professional in minutes instead of hours."},{icon:ni,title:"Sales Decks",description:"Build persuasive sales presentations with data visualization, product highlights, and clear value propositions."},{icon:nu,title:"Team Meetings",description:"Prepare weekly updates, project reviews, and strategy presentations quickly with AI-generated structure and content."},{icon:sre,title:"Educational Content",description:"Design course materials, training decks, and lecture slides with clear information hierarchy and engaging layouts."},{icon:lwe,title:"Conference Talks",description:"Build compelling conference presentations with speaker notes, key takeaways, and visually striking slides."}],r=[{step:"1",title:"Enter Your Topic",description:"Type a topic, paste an outline, or describe what your presentation should cover."},{step:"2",title:"AI Generates Your Deck",description:"AI creates a complete slide deck with layouts, content, charts, and speaker notes."},{step:"3",title:"Review & Customize",description:"Edit slides, swap templates, adjust content, and refine the design to match your needs."},{step:"4",title:"Export & Present",description:"Download as PDF or PPTX and present with confidence using AI-generated speaker notes."}];return a.jsxs("div",{className:"min-h-screen",children:[a.jsx(oi,{pageSlug:"/presentations",title:"AI Presentation Maker | Create Professional Slide Decks | WordSmith AGI",description:"Create professional slide presentations in minutes with AI. Generate complete decks from a topic or outline with smart layouts, speaker notes, and brand styling. Export to PDF/PPTX.",keywords:["AI presentation maker","AI slide generator","create presentations with AI","AI PowerPoint maker","automated slide decks"],canonicalUrl:"https://wordsmithagi.com/presentations"}),a.jsx(Ln,{}),a.jsxs("main",{children:[a.jsxs("section",{className:"relative overflow-hidden pt-24 pb-16",children:[a.jsx("div",{className:"absolute inset-0 bg-background"}),a.jsx("div",{className:"absolute inset-0 bg-dot-pattern-light opacity-40"}),a.jsxs("div",{className:"container relative px-4 sm:px-6 lg:px-8 max-w-5xl mx-auto text-center",children:[a.jsxs("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-primary/10 border border-primary/20 mb-8",children:[a.jsx(ac,{className:"w-4 h-4 text-primary mr-2"}),a.jsx("span",{className:"text-sm font-medium text-primary",children:"AI Presentation Maker"})]}),a.jsxs("h1",{className:"text-4xl sm:text-5xl md:text-6xl font-bold tracking-tight leading-[1.1] mb-6",children:[a.jsx("span",{className:"text-foreground",children:"Create Professional Slide Decks"}),a.jsx("br",{}),a.jsx("span",{className:"text-primary",children:"in Minutes with AI"})]}),a.jsx("p",{className:"text-lg sm:text-xl text-muted-foreground max-w-2xl mx-auto leading-relaxed mb-8",children:"Enter a topic or outline and let AI generate a complete, polished presentation with professional layouts, charts, speaker notes, and your brand styling applied automatically."}),a.jsx(ve,{size:"lg",className:"text-lg px-8 py-6 bg-primary hover:bg-primary-dark text-primary-foreground rounded-xl",asChild:!0,children:a.jsxs(Et,{to:"/auth",children:["Start Creating Presentations",a.jsx(Di,{className:"ml-2 w-5 h-5"})]})}),a.jsx("p",{className:"text-sm text-muted-foreground mt-4",children:"No credit card required. 15 free credits in your first month."})]})]}),a.jsx("section",{className:"py-16 bg-muted/30",children:a.jsxs("div",{className:"container px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[a.jsxs("div",{className:"text-center max-w-3xl mx-auto mb-12",children:[a.jsxs("h2",{className:"text-3xl lg:text-4xl font-bold mb-4",children:["Everything You Need to Build",a.jsx("span",{className:"text-primary",children:" Stunning Presentations"})]}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"From topic to finished deck, AI handles the design so you can focus on your message."})]}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:e.map((n,i)=>a.jsx(_e,{className:"brand-card hover-lift group",children:a.jsxs(Ge,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[a.jsx("div",{className:"w-12 h-12 bg-primary rounded-xl flex items-center justify-center group-hover:bg-primary-dark transition-colors",children:a.jsx(n.icon,{className:"w-6 h-6 text-white"})}),a.jsx("h3",{className:"text-lg font-semibold",children:n.title})]}),a.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:n.description})]})},i))})]})}),a.jsx("section",{className:"py-16",children:a.jsxs("div",{className:"container px-4 sm:px-6 lg:px-8 max-w-5xl mx-auto",children:[a.jsxs("div",{className:"text-center max-w-3xl mx-auto mb-12",children:[a.jsx("h2",{className:"text-3xl lg:text-4xl font-bold mb-4 text-primary",children:"How It Works"}),a.jsx("p",{className:"text-lg text-foreground",children:"From idea to presentation in four steps"})]}),a.jsx("div",{className:"grid md:grid-cols-4 gap-8",children:r.map((n,i)=>a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx("span",{className:"text-lg font-bold text-primary",children:n.step})}),a.jsx("h3",{className:"font-semibold mb-2",children:n.title}),a.jsx("p",{className:"text-sm text-muted-foreground",children:n.description})]},i))})]})}),a.jsx("section",{className:"py-16 bg-secondary/30",children:a.jsxs("div",{className:"container px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[a.jsx("div",{className:"text-center max-w-3xl mx-auto mb-12",children:a.jsxs("h2",{className:"text-3xl lg:text-4xl font-bold mb-4",children:["Built for Every",a.jsx("span",{className:"text-primary",children:" Presentation Need"})]})}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:t.map((n,i)=>a.jsx(_e,{className:"border-0 shadow-sm",children:a.jsxs(Ge,{className:"p-6",children:[a.jsx("div",{className:"w-10 h-10 bg-primary/10 rounded-lg flex items-center justify-center mb-4",children:a.jsx(n.icon,{className:"w-5 h-5 text-primary"})}),a.jsx("h3",{className:"font-semibold mb-2",children:n.title}),a.jsx("p",{className:"text-sm text-muted-foreground",children:n.description})]})},i))})]})}),a.jsx("section",{className:"py-16 bg-primary/5",children:a.jsxs("div",{className:"container px-4 sm:px-6 lg:px-8 max-w-4xl mx-auto text-center",children:[a.jsx("h2",{className:"text-3xl lg:text-4xl font-bold mb-4",children:"Ready to create your next presentation?"}),a.jsx("p",{className:"text-lg text-muted-foreground mb-8 max-w-2xl mx-auto",children:"Join thousands of professionals who save hours every week creating presentations with AI."}),a.jsx(ve,{size:"lg",className:"text-lg px-12 py-4 bg-primary hover:bg-primary/90 text-white shadow-xl",asChild:!0,children:a.jsxs(Et,{to:"/auth",children:["Get Started Free",a.jsx(Di,{className:"ml-2 w-5 h-5"})]})})]})})]}),a.jsx(Mn,{}),a.jsx(RA,{})]})},zCt=()=>{const e=[{icon:Ra,title:"Data-to-Visual Conversion",description:"Paste raw data, statistics, survey results, or text descriptions and watch AI transform them into beautifully designed infographics."},{icon:N6,title:"Pre-Designed Templates",description:"Choose from a library of layouts optimized for timelines, comparisons, process flows, statistical summaries, lists, and more."},{icon:Nwe,title:"Timeline & Process Flows",description:"Create step-by-step process diagrams and chronological timelines with smart auto-layout, connector lines, and icons."},{icon:Wbe,title:"Comparison Charts",description:"Build side-by-side comparisons, pros/cons layouts, feature matrices, and before/after visuals with clear hierarchy."},{icon:Px,title:"Brand-Consistent Design",description:"Your brand colors, fonts, and style guide are applied automatically to every infographic. No manual design adjustments."},{icon:ere,title:"Export to PNG & PDF",description:"Download high-resolution infographics ready for social media, presentations, reports, blogs, and print materials."}],t=[{icon:vy,title:"Social Media Graphics",description:"Create shareable infographics sized for Instagram, LinkedIn, Twitter, and Facebook that drive engagement and saves."},{icon:ai,title:"Blog Visuals",description:"Add professional data visuals and explainer graphics to blog posts to increase time on page and shareability."},{icon:ni,title:"Reports & Dashboards",description:"Turn quarterly data, survey results, and KPIs into visual summaries for stakeholders and team reviews."},{icon:yC,title:"Marketing Materials",description:"Design product comparison charts, feature highlights, and promotional visuals for campaigns and landing pages."},{icon:Pbe,title:"Internal Communications",description:"Create process documentation, onboarding visuals, and organizational charts for team alignment."}],r=[{step:"1",title:"Enter Data or Topic",description:"Paste your data, statistics, or describe the information you want to visualize."},{step:"2",title:"Choose a Template",description:"Pick a layout type — timeline, comparison, process flow, stats, or let AI choose."},{step:"3",title:"AI Designs the Layout",description:"AI arranges your data into a polished infographic with charts, icons, and brand styling."},{step:"4",title:"Download & Share",description:"Export as high-resolution PNG or PDF and use across social media, reports, and presentations."}];return a.jsxs("div",{className:"min-h-screen",children:[a.jsx(oi,{pageSlug:"/infographics",title:"AI Infographic Maker | Turn Data Into Stunning Visuals | WordSmith AGI",description:"Create professional infographics from data and ideas with AI. Choose from timelines, comparisons, process flows, and chart templates. Export to PNG/PDF with brand-consistent design.",keywords:["AI infographic maker","AI infographic generator","data visualization tool","create infographics with AI","automated infographic design"],canonicalUrl:"https://wordsmithagi.com/infographics"}),a.jsx(Ln,{}),a.jsxs("main",{children:[a.jsxs("section",{className:"relative overflow-hidden pt-24 pb-16",children:[a.jsx("div",{className:"absolute inset-0 bg-background"}),a.jsx("div",{className:"absolute inset-0 bg-dot-pattern-light opacity-40"}),a.jsxs("div",{className:"container relative px-4 sm:px-6 lg:px-8 max-w-5xl mx-auto text-center",children:[a.jsxs("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-primary/10 border border-primary/20 mb-8",children:[a.jsx(Ra,{className:"w-4 h-4 text-primary mr-2"}),a.jsx("span",{className:"text-sm font-medium text-primary",children:"AI Infographic Maker"})]}),a.jsxs("h1",{className:"text-4xl sm:text-5xl md:text-6xl font-bold tracking-tight leading-[1.1] mb-6",children:[a.jsx("span",{className:"text-foreground",children:"Turn Data and Ideas Into"}),a.jsx("br",{}),a.jsx("span",{className:"text-primary",children:"Stunning Visuals"})]}),a.jsx("p",{className:"text-lg sm:text-xl text-muted-foreground max-w-2xl mx-auto leading-relaxed mb-8",children:"Paste your data, choose a template, and let AI design beautiful infographics with timelines, comparisons, charts, and process flows — all styled to match your brand."}),a.jsx(ve,{size:"lg",className:"text-lg px-8 py-6 bg-primary hover:bg-primary-dark text-primary-foreground rounded-xl",asChild:!0,children:a.jsxs(Et,{to:"/auth",children:["Start Designing Infographics",a.jsx(Di,{className:"ml-2 w-5 h-5"})]})}),a.jsx("p",{className:"text-sm text-muted-foreground mt-4",children:"No credit card required. 15 free credits in your first month."})]})]}),a.jsx("section",{className:"py-16 bg-muted/30",children:a.jsxs("div",{className:"container px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[a.jsxs("div",{className:"text-center max-w-3xl mx-auto mb-12",children:[a.jsxs("h2",{className:"text-3xl lg:text-4xl font-bold mb-4",children:["Everything You Need to Create",a.jsx("span",{className:"text-primary",children:" Professional Infographics"})]}),a.jsx("p",{className:"text-lg text-muted-foreground",children:"From raw data to polished visuals, AI handles the design so you can focus on your story."})]}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:e.map((n,i)=>a.jsx(_e,{className:"brand-card hover-lift group",children:a.jsxs(Ge,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[a.jsx("div",{className:"w-12 h-12 bg-primary rounded-xl flex items-center justify-center group-hover:bg-primary-dark transition-colors",children:a.jsx(n.icon,{className:"w-6 h-6 text-white"})}),a.jsx("h3",{className:"text-lg font-semibold",children:n.title})]}),a.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:n.description})]})},i))})]})}),a.jsx("section",{className:"py-16",children:a.jsxs("div",{className:"container px-4 sm:px-6 lg:px-8 max-w-5xl mx-auto",children:[a.jsxs("div",{className:"text-center max-w-3xl mx-auto mb-12",children:[a.jsx("h2",{className:"text-3xl lg:text-4xl font-bold mb-4 text-primary",children:"How It Works"}),a.jsx("p",{className:"text-lg text-foreground",children:"From data to designed infographic in four steps"})]}),a.jsx("div",{className:"grid md:grid-cols-4 gap-8",children:r.map((n,i)=>a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx("span",{className:"text-lg font-bold text-primary",children:n.step})}),a.jsx("h3",{className:"font-semibold mb-2",children:n.title}),a.jsx("p",{className:"text-sm text-muted-foreground",children:n.description})]},i))})]})}),a.jsx("section",{className:"py-16 bg-secondary/30",children:a.jsxs("div",{className:"container px-4 sm:px-6 lg:px-8 max-w-7xl mx-auto",children:[a.jsx("div",{className:"text-center max-w-3xl mx-auto mb-12",children:a.jsxs("h2",{className:"text-3xl lg:text-4xl font-bold mb-4",children:["Infographics for Every",a.jsx("span",{className:"text-primary",children:" Use Case"})]})}),a.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:t.map((n,i)=>a.jsx(_e,{className:"border-0 shadow-sm",children:a.jsxs(Ge,{className:"p-6",children:[a.jsx("div",{className:"w-10 h-10 bg-primary/10 rounded-lg flex items-center justify-center mb-4",children:a.jsx(n.icon,{className:"w-5 h-5 text-primary"})}),a.jsx("h3",{className:"font-semibold mb-2",children:n.title}),a.jsx("p",{className:"text-sm text-muted-foreground",children:n.description})]})},i))})]})}),a.jsx("section",{className:"py-16 bg-primary/5",children:a.jsxs("div",{className:"container px-4 sm:px-6 lg:px-8 max-w-4xl mx-auto text-center",children:[a.jsx("h2",{className:"text-3xl lg:text-4xl font-bold mb-4",children:"Ready to visualize your data?"}),a.jsx("p",{className:"text-lg text-muted-foreground mb-8 max-w-2xl mx-auto",children:"Create professional infographics in minutes — no design skills required."}),a.jsx(ve,{size:"lg",className:"text-lg px-12 py-4 bg-primary hover:bg-primary/90 text-white shadow-xl",asChild:!0,children:a.jsxs(Et,{to:"/auth",children:["Get Started Free",a.jsx(Di,{className:"ml-2 w-5 h-5"})]})})]})})]}),a.jsx(Mn,{}),a.jsx(RA,{})]})},iO=({children:e})=>{const[t,r]=w.useState(null),[n,i]=w.useState(!0);return w.useEffect(()=>{const{data:{subscription:s}}=Re.auth.onAuthStateChange((o,l)=>{r((l==null?void 0:l.user)??null),i(!1)});return Re.auth.getSession().then(({data:{session:o}})=>{r((o==null?void 0:o.user)??null),i(!1)}),()=>s.unsubscribe()},[]),n?a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsx(El,{message:"Authenticating..."})}):t?a.jsx(a.Fragment,{children:e}):a.jsx(YNe,{to:"/auth",replace:!0})},WCt=new GCe,XJ=()=>a.jsx(YCe,{client:WCt,children:a.jsx(Nne,{children:a.jsx(r_e,{children:a.jsxs(CC,{children:[a.jsx(f1e,{}),a.jsx(W1e,{}),a.jsx(oje,{children:a.jsxs(ZNe,{children:[a.jsx(an,{path:"/",element:a.jsx(J4e,{})}),a.jsx(an,{path:"/auth",element:a.jsx(mCt,{})}),a.jsx(an,{path:"/welcome",element:a.jsx(iO,{children:a.jsx(bCt,{})})}),a.jsx(an,{path:"/about",element:a.jsx(NCt,{})}),a.jsx(an,{path:"/contact-us",element:a.jsx(jCt,{})}),a.jsx(an,{path:"/careers",element:a.jsx(SCt,{})}),a.jsx(an,{path:"/help-center",element:a.jsx(BCt,{})}),a.jsx(an,{path:"/documentation",element:a.jsx(_Ct,{})}),a.jsx(an,{path:"/privacy",element:a.jsx(kCt,{})}),a.jsx(an,{path:"/terms-and-conditions",element:a.jsx(ECt,{})}),a.jsx(an,{path:"/cookie-policy",element:a.jsx(TCt,{})}),a.jsx(an,{path:"/cancellation-refunds",element:a.jsx(PCt,{})}),a.jsx(an,{path:"/shipping",element:a.jsx(ICt,{})}),a.jsx(an,{path:"/solutions/video-scripts",element:a.jsx(OCt,{})}),a.jsx(an,{path:"/solutions/social-media",element:a.jsx(FCt,{})}),a.jsx(an,{path:"/solutions/email-marketing",element:a.jsx(LCt,{})}),a.jsx(an,{path:"/solutions/ecommerce",element:a.jsx(MCt,{})}),a.jsx(an,{path:"/solutions/webpage",element:a.jsx(DCt,{})}),a.jsx(an,{path:"/solutions/help-articles",element:a.jsx(RCt,{})}),a.jsx(an,{path:"/chatgpt-comparison",element:a.jsx(UCt,{})}),a.jsx(an,{path:"/jasper-alternative",element:a.jsx(QCt,{})}),a.jsx(an,{path:"/ai-content-writer",element:a.jsx(HCt,{})}),a.jsx(an,{path:"/presentations",element:a.jsx($Ct,{})}),a.jsx(an,{path:"/infographics",element:a.jsx(zCt,{})}),a.jsx(an,{path:"/blog",element:a.jsx(wS,{})}),a.jsx(an,{path:"/blog/:type",element:a.jsx(wS,{})}),a.jsx(an,{path:"/blog/post/:slug",element:a.jsx(CCt,{})}),a.jsx(an,{path:"/help",element:a.jsx(wS,{})}),a.jsx(an,{path:"/guides",element:a.jsx(wS,{})}),a.jsx(an,{path:"/dashboard",element:a.jsx(iO,{children:a.jsx(VJ,{})})}),a.jsx(an,{path:"/dashboard/:action/:id",element:a.jsx(iO,{children:a.jsx(VJ,{})})}),a.jsx(an,{path:"*",element:a.jsx(wCt,{})})]})})]})})})}),sO=document.getElementById("root");sO.hasAttribute("data-prerendered")?xte(sO,a.jsx(XJ,{})):yte(sO).render(a.jsx(XJ,{}));export{Nn as _,cs as c,en as g,y4e as o,Ep as s};