@mevdragon/vidfarm-devcli 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SKILL.director.md +29 -7
- package/SKILL.platform.md +4 -4
- package/demo/dist/app.css +1 -1
- package/demo/dist/app.js +254 -80
- package/dist/src/account-pages-legacy.js +9 -14
- package/dist/src/app.js +1081 -133
- package/dist/src/cli.js +107 -9
- package/dist/src/composition-runtime.js +88 -9
- package/dist/src/devcli/clips.js +5 -0
- package/dist/src/devcli/composition-edit.js +176 -8
- package/dist/src/devcli/transitions.js +205 -0
- package/dist/src/editor-chat.js +6 -5
- package/dist/src/frontend/homepage-view.js +1 -1
- package/dist/src/frontend/template-editor-chat.js +9 -6
- package/dist/src/homepage.js +9 -48
- package/dist/src/hyperframes/composition.js +183 -2
- package/dist/src/primitive-registry.js +237 -47
- package/dist/src/services/hyperframes.js +60 -15
- package/dist/src/services/providers.js +1 -0
- package/dist/src/services/serverless-records.js +19 -2
- package/dist/src/services/storage.js +12 -0
- package/dist/src/template-editor-shell.js +87 -48
- package/package.json +1 -1
- package/public/assets/homepage-client-app.js +23 -23
- package/public/assets/page-runtime-client-app.js +31 -31
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
var wx=Object.create;var AS=Object.defineProperty;var Cx=Object.getOwnPropertyDescriptor;var Rx=Object.getOwnPropertyNames;var xx=Object.getPrototypeOf,bx=Object.prototype.hasOwnProperty;var Ur=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var kx=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Rx(t))!bx.call(e,o)&&o!==n&&AS(e,o,{get:()=>t[o],enumerable:!(r=Cx(t,o))||r.enumerable});return e};var In=(e,t,n)=>(n=e!=null?wx(xx(e)):{},kx(t||!e||!e.__esModule?AS(n,"default",{value:e,enumerable:!0}):n,e));var II=Ur(ve=>{"use strict";var xl=Symbol.for("react.element"),aO=Symbol.for("react.portal"),lO=Symbol.for("react.fragment"),cO=Symbol.for("react.strict_mode"),uO=Symbol.for("react.profiler"),dO=Symbol.for("react.provider"),fO=Symbol.for("react.context"),pO=Symbol.for("react.forward_ref"),mO=Symbol.for("react.suspense"),hO=Symbol.for("react.memo"),gO=Symbol.for("react.lazy"),fI=Symbol.iterator;function yO(e){return e===null||typeof e!="object"?null:(e=fI&&e[fI]||e["@@iterator"],typeof e=="function"?e:null)}var hI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},gI=Object.assign,yI={};function Ps(e,t,n){this.props=e,this.context=t,this.refs=yI,this.updater=n||hI}Ps.prototype.isReactComponent={};Ps.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")};Ps.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function SI(){}SI.prototype=Ps.prototype;function Ah(e,t,n){this.props=e,this.context=t,this.refs=yI,this.updater=n||hI}var Mh=Ah.prototype=new SI;Mh.constructor=Ah;gI(Mh,Ps.prototype);Mh.isPureReactComponent=!0;var pI=Array.isArray,_I=Object.prototype.hasOwnProperty,Ph={current:null},vI={key:!0,ref:!0,__self:!0,__source:!0};function EI(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)_I.call(t,r)&&!vI.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:xl,type:e,key:i,ref:s,props:o,_owner:Ph.current}}function SO(e,t){return{$$typeof:xl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Lh(e){return typeof e=="object"&&e!==null&&e.$$typeof===xl}function _O(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var mI=/\/+/g;function Nh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?_O(""+e.key):t.toString(36)}function ld(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case xl:case aO:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Nh(s,0):r,pI(o)?(n="",e!=null&&(n=e.replace(mI,"$&/")+"/"),ld(o,t,n,"",function(c){return c})):o!=null&&(Lh(o)&&(o=SO(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(mI,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",pI(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Nh(i,a);s+=ld(i,t,n,l,o)}else if(l=yO(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Nh(i,a++),s+=ld(i,t,n,l,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function ad(e,t,n){if(e==null)return e;var r=[],o=0;return ld(e,r,"","",function(i){return t.call(n,i,o++)}),r}function vO(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var nn={current:null},cd={transition:null},EO={ReactCurrentDispatcher:nn,ReactCurrentBatchConfig:cd,ReactCurrentOwner:Ph};function TI(){throw Error("act(...) is not supported in production builds of React.")}ve.Children={map:ad,forEach:function(e,t,n){ad(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ad(e,function(){t++}),t},toArray:function(e){return ad(e,function(t){return t})||[]},only:function(e){if(!Lh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ve.Component=Ps;ve.Fragment=lO;ve.Profiler=uO;ve.PureComponent=Ah;ve.StrictMode=cO;ve.Suspense=mO;ve.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=EO;ve.act=TI;ve.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=gI({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Ph.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)_I.call(t,l)&&!vI.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:xl,type:e.type,key:o,ref:i,props:r,_owner:s}};ve.createContext=function(e){return e={$$typeof:fO,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:dO,_context:e},e.Consumer=e};ve.createElement=EI;ve.createFactory=function(e){var t=EI.bind(null,e);return t.type=e,t};ve.createRef=function(){return{current:null}};ve.forwardRef=function(e){return{$$typeof:pO,render:e}};ve.isValidElement=Lh;ve.lazy=function(e){return{$$typeof:gO,_payload:{_status:-1,_result:e},_init:vO}};ve.memo=function(e,t){return{$$typeof:hO,type:e,compare:t===void 0?null:t}};ve.startTransition=function(e){var t=cd.transition;cd.transition={};try{e()}finally{cd.transition=t}};ve.unstable_act=TI;ve.useCallback=function(e,t){return nn.current.useCallback(e,t)};ve.useContext=function(e){return nn.current.useContext(e)};ve.useDebugValue=function(){};ve.useDeferredValue=function(e){return nn.current.useDeferredValue(e)};ve.useEffect=function(e,t){return nn.current.useEffect(e,t)};ve.useId=function(){return nn.current.useId()};ve.useImperativeHandle=function(e,t,n){return nn.current.useImperativeHandle(e,t,n)};ve.useInsertionEffect=function(e,t){return nn.current.useInsertionEffect(e,t)};ve.useLayoutEffect=function(e,t){return nn.current.useLayoutEffect(e,t)};ve.useMemo=function(e,t){return nn.current.useMemo(e,t)};ve.useReducer=function(e,t,n){return nn.current.useReducer(e,t,n)};ve.useRef=function(e){return nn.current.useRef(e)};ve.useState=function(e){return nn.current.useState(e)};ve.useSyncExternalStore=function(e,t,n){return nn.current.useSyncExternalStore(e,t,n)};ve.useTransition=function(){return nn.current.useTransition()};ve.version="18.3.1"});var Qr=Ur((gY,wI)=>{"use strict";wI.exports=II()});var $I=Ur(We=>{"use strict";function $h(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<ud(o,t))e[r]=t,e[n]=o,n=r;else break e}}function fr(e){return e.length===0?null:e[0]}function fd(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,i=o>>>1;r<i;){var s=2*(r+1)-1,a=e[s],l=s+1,c=e[l];if(0>ud(a,n))l<o&&0>ud(c,a)?(e[r]=c,e[l]=n,r=l):(e[r]=a,e[s]=n,r=s);else if(l<o&&0>ud(c,n))e[r]=c,e[l]=n,r=l;else break e}}return t}function ud(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(MI=performance,We.unstable_now=function(){return MI.now()}):(Fh=Date,PI=Fh.now(),We.unstable_now=function(){return Fh.now()-PI});var MI,Fh,PI,br=[],Ao=[],CO=1,Yn=null,jt=3,pd=!1,Ci=!1,kl=!1,DI=typeof setTimeout=="function"?setTimeout:null,UI=typeof clearTimeout=="function"?clearTimeout:null,LI=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function zh(e){for(var t=fr(Ao);t!==null;){if(t.callback===null)fd(Ao);else if(t.startTime<=e)fd(Ao),t.sortIndex=t.expirationTime,$h(br,t);else break;t=fr(Ao)}}function jh(e){if(kl=!1,zh(e),!Ci)if(fr(br)!==null)Ci=!0,Gh(Wh);else{var t=fr(Ao);t!==null&&Vh(jh,t.startTime-e)}}function Wh(e,t){Ci=!1,kl&&(kl=!1,UI(Nl),Nl=-1),pd=!0;var n=jt;try{for(zh(t),Yn=fr(br);Yn!==null&&(!(Yn.expirationTime>t)||e&&!HI());){var r=Yn.callback;if(typeof r=="function"){Yn.callback=null,jt=Yn.priorityLevel;var o=r(Yn.expirationTime<=t);t=We.unstable_now(),typeof o=="function"?Yn.callback=o:Yn===fr(br)&&fd(br),zh(t)}else fd(br);Yn=fr(br)}if(Yn!==null)var i=!0;else{var s=fr(Ao);s!==null&&Vh(jh,s.startTime-t),i=!1}return i}finally{Yn=null,jt=n,pd=!1}}var md=!1,dd=null,Nl=-1,FI=5,BI=-1;function HI(){return!(We.unstable_now()-BI<FI)}function Bh(){if(dd!==null){var e=We.unstable_now();BI=e;var t=!0;try{t=dd(!0,e)}finally{t?bl():(md=!1,dd=null)}}else md=!1}var bl;typeof LI=="function"?bl=function(){LI(Bh)}:typeof MessageChannel<"u"?(Hh=new MessageChannel,OI=Hh.port2,Hh.port1.onmessage=Bh,bl=function(){OI.postMessage(null)}):bl=function(){DI(Bh,0)};var Hh,OI;function Gh(e){dd=e,md||(md=!0,bl())}function Vh(e,t){Nl=DI(function(){e(We.unstable_now())},t)}We.unstable_IdlePriority=5;We.unstable_ImmediatePriority=1;We.unstable_LowPriority=4;We.unstable_NormalPriority=3;We.unstable_Profiling=null;We.unstable_UserBlockingPriority=2;We.unstable_cancelCallback=function(e){e.callback=null};We.unstable_continueExecution=function(){Ci||pd||(Ci=!0,Gh(Wh))};We.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):FI=0<e?Math.floor(1e3/e):5};We.unstable_getCurrentPriorityLevel=function(){return jt};We.unstable_getFirstCallbackNode=function(){return fr(br)};We.unstable_next=function(e){switch(jt){case 1:case 2:case 3:var t=3;break;default:t=jt}var n=jt;jt=t;try{return e()}finally{jt=n}};We.unstable_pauseExecution=function(){};We.unstable_requestPaint=function(){};We.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=jt;jt=e;try{return t()}finally{jt=n}};We.unstable_scheduleCallback=function(e,t,n){var r=We.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=n+o,e={id:CO++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,$h(Ao,e),fr(br)===null&&e===fr(Ao)&&(kl?(UI(Nl),Nl=-1):kl=!0,Vh(jh,n-r))):(e.sortIndex=o,$h(br,e),Ci||pd||(Ci=!0,Gh(Wh))),e};We.unstable_shouldYield=HI;We.unstable_wrapCallback=function(e){var t=jt;return function(){var n=jt;jt=t;try{return e.apply(this,arguments)}finally{jt=n}}}});var jI=Ur((UY,zI)=>{"use strict";zI.exports=$I()});var qC=Ur(Ln=>{"use strict";var RO=Qr(),Mn=jI();function L(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Jw=new Set,Ql={};function Fi(e,t){ta(e,t),ta(e+"Capture",t)}function ta(e,t){for(Ql[e]=t,e=0;e<t.length;e++)Jw.add(t[e])}var io=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hg=Object.prototype.hasOwnProperty,xO=/^[: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]*$/,WI={},GI={};function bO(e){return hg.call(GI,e)?!0:hg.call(WI,e)?!1:xO.test(e)?GI[e]=!0:(WI[e]=!0,!1)}function kO(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function NO(e,t,n,r){if(t===null||typeof t>"u"||kO(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 sn(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Lt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Lt[e]=new sn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Lt[t]=new sn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Lt[e]=new sn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Lt[e]=new sn(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){Lt[e]=new sn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Lt[e]=new sn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Lt[e]=new sn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Lt[e]=new sn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Lt[e]=new sn(e,5,!1,e.toLowerCase(),null,!1,!1)});var ay=/[\-:]([a-z])/g;function ly(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(ay,ly);Lt[t]=new sn(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(ay,ly);Lt[t]=new sn(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(ay,ly);Lt[t]=new sn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Lt[e]=new sn(e,1,!1,e.toLowerCase(),null,!1,!1)});Lt.xlinkHref=new sn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Lt[e]=new sn(e,1,!1,e.toLowerCase(),null,!0,!0)});function cy(e,t,n,r){var o=Lt.hasOwnProperty(t)?Lt[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(NO(t,n,o,r)&&(n=null),r||o===null?bO(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var co=RO.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,hd=Symbol.for("react.element"),Us=Symbol.for("react.portal"),Fs=Symbol.for("react.fragment"),uy=Symbol.for("react.strict_mode"),gg=Symbol.for("react.profiler"),Xw=Symbol.for("react.provider"),Qw=Symbol.for("react.context"),dy=Symbol.for("react.forward_ref"),yg=Symbol.for("react.suspense"),Sg=Symbol.for("react.suspense_list"),fy=Symbol.for("react.memo"),Po=Symbol.for("react.lazy"),Zw=Symbol.for("react.offscreen"),VI=Symbol.iterator;function Al(e){return e===null||typeof e!="object"?null:(e=VI&&e[VI]||e["@@iterator"],typeof e=="function"?e:null)}var ot=Object.assign,qh;function Bl(e){if(qh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);qh=t&&t[1]||""}return`
|
|
2
|
-
`+
|
|
1
|
+
var Rx=Object.create;var PS=Object.defineProperty;var xx=Object.getOwnPropertyDescriptor;var bx=Object.getOwnPropertyNames;var kx=Object.getPrototypeOf,Nx=Object.prototype.hasOwnProperty;var Br=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var Ax=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of bx(t))!Nx.call(e,o)&&o!==n&&PS(e,o,{get:()=>t[o],enumerable:!(r=xx(t,o))||r.enumerable});return e};var Cn=(e,t,n)=>(n=e!=null?Rx(kx(e)):{},Ax(t||!e||!e.__esModule?PS(n,"default",{value:e,enumerable:!0}):n,e));var CI=Br(_e=>{"use strict";var kl=Symbol.for("react.element"),cO=Symbol.for("react.portal"),uO=Symbol.for("react.fragment"),dO=Symbol.for("react.strict_mode"),fO=Symbol.for("react.profiler"),pO=Symbol.for("react.provider"),mO=Symbol.for("react.context"),hO=Symbol.for("react.forward_ref"),gO=Symbol.for("react.suspense"),yO=Symbol.for("react.memo"),SO=Symbol.for("react.lazy"),mI=Symbol.iterator;function _O(e){return e===null||typeof e!="object"?null:(e=mI&&e[mI]||e["@@iterator"],typeof e=="function"?e:null)}var yI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},SI=Object.assign,_I={};function Os(e,t,n){this.props=e,this.context=t,this.refs=_I,this.updater=n||yI}Os.prototype.isReactComponent={};Os.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")};Os.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function vI(){}vI.prototype=Os.prototype;function Ph(e,t,n){this.props=e,this.context=t,this.refs=_I,this.updater=n||yI}var Lh=Ph.prototype=new vI;Lh.constructor=Ph;SI(Lh,Os.prototype);Lh.isPureReactComponent=!0;var hI=Array.isArray,EI=Object.prototype.hasOwnProperty,Oh={current:null},TI={key:!0,ref:!0,__self:!0,__source:!0};function II(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)EI.call(t,r)&&!TI.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:kl,type:e,key:i,ref:s,props:o,_owner:Oh.current}}function vO(e,t){return{$$typeof:kl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Dh(e){return typeof e=="object"&&e!==null&&e.$$typeof===kl}function EO(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var gI=/\/+/g;function Mh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?EO(""+e.key):t.toString(36)}function ud(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case kl:case cO:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Mh(s,0):r,hI(o)?(n="",e!=null&&(n=e.replace(gI,"$&/")+"/"),ud(o,t,n,"",function(c){return c})):o!=null&&(Dh(o)&&(o=vO(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(gI,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",hI(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Mh(i,a);s+=ud(i,t,n,l,o)}else if(l=_O(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Mh(i,a++),s+=ud(i,t,n,l,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function cd(e,t,n){if(e==null)return e;var r=[],o=0;return ud(e,r,"","",function(i){return t.call(n,i,o++)}),r}function TO(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var on={current:null},dd={transition:null},IO={ReactCurrentDispatcher:on,ReactCurrentBatchConfig:dd,ReactCurrentOwner:Oh};function wI(){throw Error("act(...) is not supported in production builds of React.")}_e.Children={map:cd,forEach:function(e,t,n){cd(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return cd(e,function(){t++}),t},toArray:function(e){return cd(e,function(t){return t})||[]},only:function(e){if(!Dh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};_e.Component=Os;_e.Fragment=uO;_e.Profiler=fO;_e.PureComponent=Ph;_e.StrictMode=dO;_e.Suspense=gO;_e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=IO;_e.act=wI;_e.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=SI({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Oh.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)EI.call(t,l)&&!TI.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:kl,type:e.type,key:o,ref:i,props:r,_owner:s}};_e.createContext=function(e){return e={$$typeof:mO,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:pO,_context:e},e.Consumer=e};_e.createElement=II;_e.createFactory=function(e){var t=II.bind(null,e);return t.type=e,t};_e.createRef=function(){return{current:null}};_e.forwardRef=function(e){return{$$typeof:hO,render:e}};_e.isValidElement=Dh;_e.lazy=function(e){return{$$typeof:SO,_payload:{_status:-1,_result:e},_init:TO}};_e.memo=function(e,t){return{$$typeof:yO,type:e,compare:t===void 0?null:t}};_e.startTransition=function(e){var t=dd.transition;dd.transition={};try{e()}finally{dd.transition=t}};_e.unstable_act=wI;_e.useCallback=function(e,t){return on.current.useCallback(e,t)};_e.useContext=function(e){return on.current.useContext(e)};_e.useDebugValue=function(){};_e.useDeferredValue=function(e){return on.current.useDeferredValue(e)};_e.useEffect=function(e,t){return on.current.useEffect(e,t)};_e.useId=function(){return on.current.useId()};_e.useImperativeHandle=function(e,t,n){return on.current.useImperativeHandle(e,t,n)};_e.useInsertionEffect=function(e,t){return on.current.useInsertionEffect(e,t)};_e.useLayoutEffect=function(e,t){return on.current.useLayoutEffect(e,t)};_e.useMemo=function(e,t){return on.current.useMemo(e,t)};_e.useReducer=function(e,t,n){return on.current.useReducer(e,t,n)};_e.useRef=function(e){return on.current.useRef(e)};_e.useState=function(e){return on.current.useState(e)};_e.useSyncExternalStore=function(e,t,n){return on.current.useSyncExternalStore(e,t,n)};_e.useTransition=function(){return on.current.useTransition()};_e.version="18.3.1"});var eo=Br((SY,RI)=>{"use strict";RI.exports=CI()});var jI=Br(We=>{"use strict";function jh(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<fd(o,t))e[r]=t,e[n]=o,n=r;else break e}}function pr(e){return e.length===0?null:e[0]}function md(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,i=o>>>1;r<i;){var s=2*(r+1)-1,a=e[s],l=s+1,c=e[l];if(0>fd(a,n))l<o&&0>fd(c,a)?(e[r]=c,e[l]=n,r=l):(e[r]=a,e[s]=n,r=s);else if(l<o&&0>fd(c,n))e[r]=c,e[l]=n,r=l;else break e}}return t}function fd(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(LI=performance,We.unstable_now=function(){return LI.now()}):(Hh=Date,OI=Hh.now(),We.unstable_now=function(){return Hh.now()-OI});var LI,Hh,OI,kr=[],Ao=[],xO=1,Yn=null,Gt=3,hd=!1,Ri=!1,Al=!1,FI=typeof setTimeout=="function"?setTimeout:null,BI=typeof clearTimeout=="function"?clearTimeout:null,DI=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Wh(e){for(var t=pr(Ao);t!==null;){if(t.callback===null)md(Ao);else if(t.startTime<=e)md(Ao),t.sortIndex=t.expirationTime,jh(kr,t);else break;t=pr(Ao)}}function Gh(e){if(Al=!1,Wh(e),!Ri)if(pr(kr)!==null)Ri=!0,qh(Vh);else{var t=pr(Ao);t!==null&&Yh(Gh,t.startTime-e)}}function Vh(e,t){Ri=!1,Al&&(Al=!1,BI(Ml),Ml=-1),hd=!0;var n=Gt;try{for(Wh(t),Yn=pr(kr);Yn!==null&&(!(Yn.expirationTime>t)||e&&!zI());){var r=Yn.callback;if(typeof r=="function"){Yn.callback=null,Gt=Yn.priorityLevel;var o=r(Yn.expirationTime<=t);t=We.unstable_now(),typeof o=="function"?Yn.callback=o:Yn===pr(kr)&&md(kr),Wh(t)}else md(kr);Yn=pr(kr)}if(Yn!==null)var i=!0;else{var s=pr(Ao);s!==null&&Yh(Gh,s.startTime-t),i=!1}return i}finally{Yn=null,Gt=n,hd=!1}}var gd=!1,pd=null,Ml=-1,HI=5,$I=-1;function zI(){return!(We.unstable_now()-$I<HI)}function $h(){if(pd!==null){var e=We.unstable_now();$I=e;var t=!0;try{t=pd(!0,e)}finally{t?Nl():(gd=!1,pd=null)}}else gd=!1}var Nl;typeof DI=="function"?Nl=function(){DI($h)}:typeof MessageChannel<"u"?(zh=new MessageChannel,UI=zh.port2,zh.port1.onmessage=$h,Nl=function(){UI.postMessage(null)}):Nl=function(){FI($h,0)};var zh,UI;function qh(e){pd=e,gd||(gd=!0,Nl())}function Yh(e,t){Ml=FI(function(){e(We.unstable_now())},t)}We.unstable_IdlePriority=5;We.unstable_ImmediatePriority=1;We.unstable_LowPriority=4;We.unstable_NormalPriority=3;We.unstable_Profiling=null;We.unstable_UserBlockingPriority=2;We.unstable_cancelCallback=function(e){e.callback=null};We.unstable_continueExecution=function(){Ri||hd||(Ri=!0,qh(Vh))};We.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):HI=0<e?Math.floor(1e3/e):5};We.unstable_getCurrentPriorityLevel=function(){return Gt};We.unstable_getFirstCallbackNode=function(){return pr(kr)};We.unstable_next=function(e){switch(Gt){case 1:case 2:case 3:var t=3;break;default:t=Gt}var n=Gt;Gt=t;try{return e()}finally{Gt=n}};We.unstable_pauseExecution=function(){};We.unstable_requestPaint=function(){};We.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=Gt;Gt=e;try{return t()}finally{Gt=n}};We.unstable_scheduleCallback=function(e,t,n){var r=We.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=n+o,e={id:xO++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,jh(Ao,e),pr(kr)===null&&e===pr(Ao)&&(Al?(BI(Ml),Ml=-1):Al=!0,Yh(Gh,n-r))):(e.sortIndex=o,jh(kr,e),Ri||hd||(Ri=!0,qh(Vh))),e};We.unstable_shouldYield=zI;We.unstable_wrapCallback=function(e){var t=Gt;return function(){var n=Gt;Gt=t;try{return e.apply(this,arguments)}finally{Gt=n}}}});var GI=Br((BY,WI)=>{"use strict";WI.exports=jI()});var KC=Br(Dn=>{"use strict";var bO=eo(),Ln=GI();function L(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Qw=new Set,ec={};function Bi(e,t){ra(e,t),ra(e+"Capture",t)}function ra(e,t){for(ec[e]=t,e=0;e<t.length;e++)Qw.add(t[e])}var ao=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yg=Object.prototype.hasOwnProperty,kO=/^[: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]*$/,VI={},qI={};function NO(e){return yg.call(qI,e)?!0:yg.call(VI,e)?!1:kO.test(e)?qI[e]=!0:(VI[e]=!0,!1)}function AO(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function MO(e,t,n,r){if(t===null||typeof t>"u"||AO(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 ln(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Ot={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ot[e]=new ln(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ot[t]=new ln(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ot[e]=new ln(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ot[e]=new ln(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){Ot[e]=new ln(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ot[e]=new ln(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ot[e]=new ln(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ot[e]=new ln(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ot[e]=new ln(e,5,!1,e.toLowerCase(),null,!1,!1)});var cy=/[\-:]([a-z])/g;function uy(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(cy,uy);Ot[t]=new ln(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(cy,uy);Ot[t]=new ln(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(cy,uy);Ot[t]=new ln(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ot[e]=new ln(e,1,!1,e.toLowerCase(),null,!1,!1)});Ot.xlinkHref=new ln("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ot[e]=new ln(e,1,!1,e.toLowerCase(),null,!0,!0)});function dy(e,t,n,r){var o=Ot.hasOwnProperty(t)?Ot[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(MO(t,n,o,r)&&(n=null),r||o===null?NO(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var fo=bO.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,yd=Symbol.for("react.element"),Bs=Symbol.for("react.portal"),Hs=Symbol.for("react.fragment"),fy=Symbol.for("react.strict_mode"),Sg=Symbol.for("react.profiler"),Zw=Symbol.for("react.provider"),e0=Symbol.for("react.context"),py=Symbol.for("react.forward_ref"),_g=Symbol.for("react.suspense"),vg=Symbol.for("react.suspense_list"),my=Symbol.for("react.memo"),Po=Symbol.for("react.lazy"),t0=Symbol.for("react.offscreen"),YI=Symbol.iterator;function Pl(e){return e===null||typeof e!="object"?null:(e=YI&&e[YI]||e["@@iterator"],typeof e=="function"?e:null)}var rt=Object.assign,Kh;function $l(e){if(Kh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Kh=t&&t[1]||""}return`
|
|
2
|
+
`+Kh+e}var Jh=!1;function Xh(e,t){if(!e||Jh)return"";Jh=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
|
|
3
3
|
`),i=r.stack.split(`
|
|
4
4
|
`),s=o.length-1,a=i.length-1;1<=s&&0<=a&&o[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||o[s]!==i[a]){var l=`
|
|
5
|
-
`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Yh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Bl(e):""}function AO(e){switch(e.tag){case 5:return Bl(e.type);case 16:return Bl("Lazy");case 13:return Bl("Suspense");case 19:return Bl("SuspenseList");case 0:case 2:case 15:return e=Kh(e.type,!1),e;case 11:return e=Kh(e.type.render,!1),e;case 1:return e=Kh(e.type,!0),e;default:return""}}function _g(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 Fs:return"Fragment";case Us:return"Portal";case gg:return"Profiler";case uy:return"StrictMode";case yg:return"Suspense";case Sg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Qw:return(e.displayName||"Context")+".Consumer";case Xw:return(e._context.displayName||"Context")+".Provider";case dy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case fy:return t=e.displayName||null,t!==null?t:_g(e.type)||"Memo";case Po:t=e._payload,e=e._init;try{return _g(e(t))}catch{}}return null}function MO(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 _g(t);case 8:return t===uy?"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 qo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function e0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function PO(e){var t=e0(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function gd(e){e._valueTracker||(e._valueTracker=PO(e))}function t0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=e0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Wd(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 vg(e,t){var n=t.checked;return ot({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function qI(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=qo(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function n0(e,t){t=t.checked,t!=null&&cy(e,"checked",t,!1)}function Eg(e,t){n0(e,t);var n=qo(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Tg(e,t.type,n):t.hasOwnProperty("defaultValue")&&Tg(e,t.type,qo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function YI(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Tg(e,t,n){(t!=="number"||Wd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Hl=Array.isArray;function Ks(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+qo(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ig(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(L(91));return ot({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function KI(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(L(92));if(Hl(n)){if(1<n.length)throw Error(L(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:qo(n)}}function r0(e,t){var n=qo(t.value),r=qo(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function JI(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function o0(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function wg(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?o0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var yd,i0=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(yd=yd||document.createElement("div"),yd.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=yd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var jl={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},LO=["Webkit","ms","Moz","O"];Object.keys(jl).forEach(function(e){LO.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),jl[t]=jl[e]})});function s0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||jl.hasOwnProperty(e)&&jl[e]?(""+t).trim():t+"px"}function a0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=s0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var OO=ot({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 Cg(e,t){if(t){if(OO[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(L(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(L(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(L(61))}if(t.style!=null&&typeof t.style!="object")throw Error(L(62))}}function Rg(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 xg=null;function py(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bg=null,Js=null,Xs=null;function XI(e){if(e=yc(e)){if(typeof bg!="function")throw Error(L(280));var t=e.stateNode;t&&(t=_f(t),bg(e.stateNode,e.type,t))}}function l0(e){Js?Xs?Xs.push(e):Xs=[e]:Js=e}function c0(){if(Js){var e=Js,t=Xs;if(Xs=Js=null,XI(e),t)for(e=0;e<t.length;e++)XI(t[e])}}function u0(e,t){return e(t)}function d0(){}var Jh=!1;function f0(e,t,n){if(Jh)return e(t,n);Jh=!0;try{return u0(e,t,n)}finally{Jh=!1,(Js!==null||Xs!==null)&&(d0(),c0())}}function ec(e,t){var n=e.stateNode;if(n===null)return null;var r=_f(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(L(231,t,typeof n));return n}var kg=!1;if(io)try{Os={},Object.defineProperty(Os,"passive",{get:function(){kg=!0}}),window.addEventListener("test",Os,Os),window.removeEventListener("test",Os,Os)}catch{kg=!1}var Os;function DO(e,t,n,r,o,i,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var Wl=!1,Gd=null,Vd=!1,Ng=null,UO={onError:function(e){Wl=!0,Gd=e}};function FO(e,t,n,r,o,i,s,a,l){Wl=!1,Gd=null,DO.apply(UO,arguments)}function BO(e,t,n,r,o,i,s,a,l){if(FO.apply(this,arguments),Wl){if(Wl){var c=Gd;Wl=!1,Gd=null}else throw Error(L(198));Vd||(Vd=!0,Ng=c)}}function Bi(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function p0(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function QI(e){if(Bi(e)!==e)throw Error(L(188))}function HO(e){var t=e.alternate;if(!t){if(t=Bi(e),t===null)throw Error(L(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return QI(o),e;if(i===r)return QI(o),t;i=i.sibling}throw Error(L(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(L(189))}}if(n.alternate!==r)throw Error(L(190))}if(n.tag!==3)throw Error(L(188));return n.stateNode.current===n?e:t}function m0(e){return e=HO(e),e!==null?h0(e):null}function h0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=h0(e);if(t!==null)return t;e=e.sibling}return null}var g0=Mn.unstable_scheduleCallback,ZI=Mn.unstable_cancelCallback,$O=Mn.unstable_shouldYield,zO=Mn.unstable_requestPaint,pt=Mn.unstable_now,jO=Mn.unstable_getCurrentPriorityLevel,my=Mn.unstable_ImmediatePriority,y0=Mn.unstable_UserBlockingPriority,qd=Mn.unstable_NormalPriority,WO=Mn.unstable_LowPriority,S0=Mn.unstable_IdlePriority,hf=null,Mr=null;function GO(e){if(Mr&&typeof Mr.onCommitFiberRoot=="function")try{Mr.onCommitFiberRoot(hf,e,void 0,(e.current.flags&128)===128)}catch{}}var yr=Math.clz32?Math.clz32:YO,VO=Math.log,qO=Math.LN2;function YO(e){return e>>>=0,e===0?32:31-(VO(e)/qO|0)|0}var Sd=64,_d=4194304;function $l(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 Yd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=$l(a):(i&=s,i!==0&&(r=$l(i)))}else s=n&~o,s!==0?r=$l(s):i!==0&&(r=$l(i));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-yr(t),o=1<<n,r|=e[n],t&=~o;return r}function KO(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function JO(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-yr(i),a=1<<s,l=o[s];l===-1?((a&n)===0||(a&r)!==0)&&(o[s]=KO(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Ag(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function _0(){var e=Sd;return Sd<<=1,(Sd&4194240)===0&&(Sd=64),e}function Xh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function hc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-yr(t),e[t]=n}function XO(e,t){var n=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 r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-yr(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function hy(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-yr(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var De=0;function v0(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var E0,gy,T0,I0,w0,Mg=!1,vd=[],Bo=null,Ho=null,$o=null,tc=new Map,nc=new Map,Oo=[],QO="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ew(e,t){switch(e){case"focusin":case"focusout":Bo=null;break;case"dragenter":case"dragleave":Ho=null;break;case"mouseover":case"mouseout":$o=null;break;case"pointerover":case"pointerout":tc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":nc.delete(t.pointerId)}}function Ml(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=yc(t),t!==null&&gy(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function ZO(e,t,n,r,o){switch(t){case"focusin":return Bo=Ml(Bo,e,t,n,r,o),!0;case"dragenter":return Ho=Ml(Ho,e,t,n,r,o),!0;case"mouseover":return $o=Ml($o,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return tc.set(i,Ml(tc.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,nc.set(i,Ml(nc.get(i)||null,e,t,n,r,o)),!0}return!1}function C0(e){var t=bi(e.target);if(t!==null){var n=Bi(t);if(n!==null){if(t=n.tag,t===13){if(t=p0(n),t!==null){e.blockedOn=t,w0(e.priority,function(){T0(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ld(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Pg(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);xg=r,n.target.dispatchEvent(r),xg=null}else return t=yc(n),t!==null&&gy(t),e.blockedOn=n,!1;t.shift()}return!0}function tw(e,t,n){Ld(e)&&n.delete(t)}function eD(){Mg=!1,Bo!==null&&Ld(Bo)&&(Bo=null),Ho!==null&&Ld(Ho)&&(Ho=null),$o!==null&&Ld($o)&&($o=null),tc.forEach(tw),nc.forEach(tw)}function Pl(e,t){e.blockedOn===t&&(e.blockedOn=null,Mg||(Mg=!0,Mn.unstable_scheduleCallback(Mn.unstable_NormalPriority,eD)))}function rc(e){function t(o){return Pl(o,e)}if(0<vd.length){Pl(vd[0],e);for(var n=1;n<vd.length;n++){var r=vd[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Bo!==null&&Pl(Bo,e),Ho!==null&&Pl(Ho,e),$o!==null&&Pl($o,e),tc.forEach(t),nc.forEach(t),n=0;n<Oo.length;n++)r=Oo[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Oo.length&&(n=Oo[0],n.blockedOn===null);)C0(n),n.blockedOn===null&&Oo.shift()}var Qs=co.ReactCurrentBatchConfig,Kd=!0;function tD(e,t,n,r){var o=De,i=Qs.transition;Qs.transition=null;try{De=1,yy(e,t,n,r)}finally{De=o,Qs.transition=i}}function nD(e,t,n,r){var o=De,i=Qs.transition;Qs.transition=null;try{De=4,yy(e,t,n,r)}finally{De=o,Qs.transition=i}}function yy(e,t,n,r){if(Kd){var o=Pg(e,t,n,r);if(o===null)og(e,t,r,Jd,n),ew(e,r);else if(ZO(o,e,t,n,r))r.stopPropagation();else if(ew(e,r),t&4&&-1<QO.indexOf(e)){for(;o!==null;){var i=yc(o);if(i!==null&&E0(i),i=Pg(e,t,n,r),i===null&&og(e,t,r,Jd,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else og(e,t,r,null,n)}}var Jd=null;function Pg(e,t,n,r){if(Jd=null,e=py(r),e=bi(e),e!==null)if(t=Bi(e),t===null)e=null;else if(n=t.tag,n===13){if(e=p0(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Jd=e,null}function R0(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(jO()){case my:return 1;case y0:return 4;case qd:case WO:return 16;case S0:return 536870912;default:return 16}default:return 16}}var Uo=null,Sy=null,Od=null;function x0(){if(Od)return Od;var e,t=Sy,n=t.length,r,o="value"in Uo?Uo.value:Uo.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Od=o.slice(e,1<r?1-r:void 0)}function Dd(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ed(){return!0}function nw(){return!1}function Pn(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ed:nw,this.isPropagationStopped=nw,this}return ot(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ed)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ed)},persist:function(){},isPersistent:Ed}),t}var la={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_y=Pn(la),gc=ot({},la,{view:0,detail:0}),rD=Pn(gc),Qh,Zh,Ll,gf=ot({},gc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vy,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ll&&(Ll&&e.type==="mousemove"?(Qh=e.screenX-Ll.screenX,Zh=e.screenY-Ll.screenY):Zh=Qh=0,Ll=e),Qh)},movementY:function(e){return"movementY"in e?e.movementY:Zh}}),rw=Pn(gf),oD=ot({},gf,{dataTransfer:0}),iD=Pn(oD),sD=ot({},gc,{relatedTarget:0}),eg=Pn(sD),aD=ot({},la,{animationName:0,elapsedTime:0,pseudoElement:0}),lD=Pn(aD),cD=ot({},la,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),uD=Pn(cD),dD=ot({},la,{data:0}),ow=Pn(dD),fD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pD={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},mD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=mD[e])?!!t[e]:!1}function vy(){return hD}var gD=ot({},gc,{key:function(e){if(e.key){var t=fD[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Dd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?pD[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vy,charCode:function(e){return e.type==="keypress"?Dd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Dd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),yD=Pn(gD),SD=ot({},gf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),iw=Pn(SD),_D=ot({},gc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vy}),vD=Pn(_D),ED=ot({},la,{propertyName:0,elapsedTime:0,pseudoElement:0}),TD=Pn(ED),ID=ot({},gf,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),wD=Pn(ID),CD=[9,13,27,32],Ey=io&&"CompositionEvent"in window,Gl=null;io&&"documentMode"in document&&(Gl=document.documentMode);var RD=io&&"TextEvent"in window&&!Gl,b0=io&&(!Ey||Gl&&8<Gl&&11>=Gl),sw=" ",aw=!1;function k0(e,t){switch(e){case"keyup":return CD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function N0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bs=!1;function xD(e,t){switch(e){case"compositionend":return N0(t);case"keypress":return t.which!==32?null:(aw=!0,sw);case"textInput":return e=t.data,e===sw&&aw?null:e;default:return null}}function bD(e,t){if(Bs)return e==="compositionend"||!Ey&&k0(e,t)?(e=x0(),Od=Sy=Uo=null,Bs=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return b0&&t.locale!=="ko"?null:t.data;default:return null}}var kD={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function lw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!kD[e.type]:t==="textarea"}function A0(e,t,n,r){l0(r),t=Xd(t,"onChange"),0<t.length&&(n=new _y("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Vl=null,oc=null;function ND(e){z0(e,0)}function yf(e){var t=zs(e);if(t0(t))return e}function AD(e,t){if(e==="change")return t}var M0=!1;io&&(io?(Id="oninput"in document,Id||(tg=document.createElement("div"),tg.setAttribute("oninput","return;"),Id=typeof tg.oninput=="function"),Td=Id):Td=!1,M0=Td&&(!document.documentMode||9<document.documentMode));var Td,Id,tg;function cw(){Vl&&(Vl.detachEvent("onpropertychange",P0),oc=Vl=null)}function P0(e){if(e.propertyName==="value"&&yf(oc)){var t=[];A0(t,oc,e,py(e)),f0(ND,t)}}function MD(e,t,n){e==="focusin"?(cw(),Vl=t,oc=n,Vl.attachEvent("onpropertychange",P0)):e==="focusout"&&cw()}function PD(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return yf(oc)}function LD(e,t){if(e==="click")return yf(t)}function OD(e,t){if(e==="input"||e==="change")return yf(t)}function DD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _r=typeof Object.is=="function"?Object.is:DD;function ic(e,t){if(_r(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!hg.call(t,o)||!_r(e[o],t[o]))return!1}return!0}function uw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dw(e,t){var n=uw(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=uw(n)}}function L0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?L0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function O0(){for(var e=window,t=Wd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Wd(e.document)}return t}function Ty(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 UD(e){var t=O0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&L0(n.ownerDocument.documentElement,n)){if(r!==null&&Ty(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=dw(n,i);var s=dw(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var FD=io&&"documentMode"in document&&11>=document.documentMode,Hs=null,Lg=null,ql=null,Og=!1;function fw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Og||Hs==null||Hs!==Wd(r)||(r=Hs,"selectionStart"in r&&Ty(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ql&&ic(ql,r)||(ql=r,r=Xd(Lg,"onSelect"),0<r.length&&(t=new _y("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Hs)))}function wd(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var $s={animationend:wd("Animation","AnimationEnd"),animationiteration:wd("Animation","AnimationIteration"),animationstart:wd("Animation","AnimationStart"),transitionend:wd("Transition","TransitionEnd")},ng={},D0={};io&&(D0=document.createElement("div").style,"AnimationEvent"in window||(delete $s.animationend.animation,delete $s.animationiteration.animation,delete $s.animationstart.animation),"TransitionEvent"in window||delete $s.transitionend.transition);function Sf(e){if(ng[e])return ng[e];if(!$s[e])return e;var t=$s[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in D0)return ng[e]=t[n];return e}var U0=Sf("animationend"),F0=Sf("animationiteration"),B0=Sf("animationstart"),H0=Sf("transitionend"),$0=new Map,pw="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ko(e,t){$0.set(e,t),Fi(t,[e])}for(Cd=0;Cd<pw.length;Cd++)Rd=pw[Cd],mw=Rd.toLowerCase(),hw=Rd[0].toUpperCase()+Rd.slice(1),Ko(mw,"on"+hw);var Rd,mw,hw,Cd;Ko(U0,"onAnimationEnd");Ko(F0,"onAnimationIteration");Ko(B0,"onAnimationStart");Ko("dblclick","onDoubleClick");Ko("focusin","onFocus");Ko("focusout","onBlur");Ko(H0,"onTransitionEnd");ta("onMouseEnter",["mouseout","mouseover"]);ta("onMouseLeave",["mouseout","mouseover"]);ta("onPointerEnter",["pointerout","pointerover"]);ta("onPointerLeave",["pointerout","pointerover"]);Fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Fi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),BD=new Set("cancel close invalid load scroll toggle".split(" ").concat(zl));function gw(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,BO(r,t,void 0,e),e.currentTarget=null}function z0(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;gw(o,a,c),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;gw(o,a,c),i=l}}}if(Vd)throw e=Ng,Vd=!1,Ng=null,e}function Ke(e,t){var n=t[Hg];n===void 0&&(n=t[Hg]=new Set);var r=e+"__bubble";n.has(r)||(j0(t,e,2,!1),n.add(r))}function rg(e,t,n){var r=0;t&&(r|=4),j0(n,e,r,t)}var xd="_reactListening"+Math.random().toString(36).slice(2);function sc(e){if(!e[xd]){e[xd]=!0,Jw.forEach(function(n){n!=="selectionchange"&&(BD.has(n)||rg(n,!1,e),rg(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,rg("selectionchange",!1,t))}}function j0(e,t,n,r){switch(R0(t)){case 1:var o=tD;break;case 4:o=nD;break;default:o=yy}n=o.bind(null,t,n,e),o=void 0,!kg||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function og(e,t,n,r,o){var i=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=bi(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}f0(function(){var c=i,u=py(n),d=[];e:{var p=$0.get(e);if(p!==void 0){var h=_y,y=e;switch(e){case"keypress":if(Dd(n)===0)break e;case"keydown":case"keyup":h=yD;break;case"focusin":y="focus",h=eg;break;case"focusout":y="blur",h=eg;break;case"beforeblur":case"afterblur":h=eg;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=rw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=iD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=vD;break;case U0:case F0:case B0:h=lD;break;case H0:h=TD;break;case"scroll":h=rD;break;case"wheel":h=wD;break;case"copy":case"cut":case"paste":h=uD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=iw}var _=(t&4)!==0,T=!_&&e==="scroll",g=_?p!==null?p+"Capture":null:p;_=[];for(var S=c,E;S!==null;){E=S;var R=E.stateNode;if(E.tag===5&&R!==null&&(E=R,g!==null&&(R=ec(S,g),R!=null&&_.push(ac(S,R,E)))),T)break;S=S.return}0<_.length&&(p=new h(p,y,null,n,u),d.push({event:p,listeners:_}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==xg&&(y=n.relatedTarget||n.fromElement)&&(bi(y)||y[so]))break e;if((h||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=c,y=y?bi(y):null,y!==null&&(T=Bi(y),y!==T||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=c),h!==y)){if(_=rw,R="onMouseLeave",g="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(_=iw,R="onPointerLeave",g="onPointerEnter",S="pointer"),T=h==null?p:zs(h),E=y==null?p:zs(y),p=new _(R,S+"leave",h,n,u),p.target=T,p.relatedTarget=E,R=null,bi(u)===c&&(_=new _(g,S+"enter",y,n,u),_.target=E,_.relatedTarget=T,R=_),T=R,h&&y)t:{for(_=h,g=y,S=0,E=_;E;E=Ds(E))S++;for(E=0,R=g;R;R=Ds(R))E++;for(;0<S-E;)_=Ds(_),S--;for(;0<E-S;)g=Ds(g),E--;for(;S--;){if(_===g||g!==null&&_===g.alternate)break t;_=Ds(_),g=Ds(g)}_=null}else _=null;h!==null&&yw(d,p,h,_,!1),y!==null&&T!==null&&yw(d,T,y,_,!0)}}e:{if(p=c?zs(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var M=AD;else if(lw(p))if(M0)M=OD;else{M=PD;var A=MD}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(M=LD);if(M&&(M=M(e,c))){A0(d,M,n,u);break e}A&&A(e,p,c),e==="focusout"&&(A=p._wrapperState)&&A.controlled&&p.type==="number"&&Tg(p,"number",p.value)}switch(A=c?zs(c):window,e){case"focusin":(lw(A)||A.contentEditable==="true")&&(Hs=A,Lg=c,ql=null);break;case"focusout":ql=Lg=Hs=null;break;case"mousedown":Og=!0;break;case"contextmenu":case"mouseup":case"dragend":Og=!1,fw(d,n,u);break;case"selectionchange":if(FD)break;case"keydown":case"keyup":fw(d,n,u)}var I;if(Ey)e:{switch(e){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else Bs?k0(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(b0&&n.locale!=="ko"&&(Bs||N!=="onCompositionStart"?N==="onCompositionEnd"&&Bs&&(I=x0()):(Uo=u,Sy="value"in Uo?Uo.value:Uo.textContent,Bs=!0)),A=Xd(c,N),0<A.length&&(N=new ow(N,e,null,n,u),d.push({event:N,listeners:A}),I?N.data=I:(I=N0(n),I!==null&&(N.data=I)))),(I=RD?xD(e,n):bD(e,n))&&(c=Xd(c,"onBeforeInput"),0<c.length&&(u=new ow("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=I))}z0(d,t)})}function ac(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Xd(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=ec(e,n),i!=null&&r.unshift(ac(e,i,o)),i=ec(e,t),i!=null&&r.push(ac(e,i,o))),e=e.return}return r}function Ds(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function yw(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,o?(l=ec(n,i),l!=null&&s.unshift(ac(n,l,a))):o||(l=ec(n,i),l!=null&&s.push(ac(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var HD=/\r\n?/g,$D=/\u0000|\uFFFD/g;function Sw(e){return(typeof e=="string"?e:""+e).replace(HD,`
|
|
6
|
-
`).replace($D,"")}function bd(e,t,n){if(t=Sw(t),Sw(e)!==t&&n)throw Error(L(425))}function Qd(){}var Dg=null,Ug=null;function Fg(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Bg=typeof setTimeout=="function"?setTimeout:void 0,zD=typeof clearTimeout=="function"?clearTimeout:void 0,_w=typeof Promise=="function"?Promise:void 0,jD=typeof queueMicrotask=="function"?queueMicrotask:typeof _w<"u"?function(e){return _w.resolve(null).then(e).catch(WD)}:Bg;function WD(e){setTimeout(function(){throw e})}function ig(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),rc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);rc(t)}function zo(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function vw(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var ca=Math.random().toString(36).slice(2),Ar="__reactFiber$"+ca,lc="__reactProps$"+ca,so="__reactContainer$"+ca,Hg="__reactEvents$"+ca,GD="__reactListeners$"+ca,VD="__reactHandles$"+ca;function bi(e){var t=e[Ar];if(t)return t;for(var n=e.parentNode;n;){if(t=n[so]||n[Ar]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vw(e);e!==null;){if(n=e[Ar])return n;e=vw(e)}return t}e=n,n=e.parentNode}return null}function yc(e){return e=e[Ar]||e[so],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function zs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(L(33))}function _f(e){return e[lc]||null}var $g=[],js=-1;function Jo(e){return{current:e}}function Je(e){0>js||(e.current=$g[js],$g[js]=null,js--)}function Ge(e,t){js++,$g[js]=e.current,e.current=t}var Yo={},qt=Jo(Yo),Sn=Jo(!1),Pi=Yo;function na(e,t){var n=e.type.contextTypes;if(!n)return Yo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function _n(e){return e=e.childContextTypes,e!=null}function Zd(){Je(Sn),Je(qt)}function Ew(e,t,n){if(qt.current!==Yo)throw Error(L(168));Ge(qt,t),Ge(Sn,n)}function W0(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(L(108,MO(e)||"Unknown",o));return ot({},n,r)}function ef(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yo,Pi=qt.current,Ge(qt,e),Ge(Sn,Sn.current),!0}function Tw(e,t,n){var r=e.stateNode;if(!r)throw Error(L(169));n?(e=W0(e,t,Pi),r.__reactInternalMemoizedMergedChildContext=e,Je(Sn),Je(qt),Ge(qt,e)):Je(Sn),Ge(Sn,n)}var to=null,vf=!1,sg=!1;function G0(e){to===null?to=[e]:to.push(e)}function qD(e){vf=!0,G0(e)}function Xo(){if(!sg&&to!==null){sg=!0;var e=0,t=De;try{var n=to;for(De=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}to=null,vf=!1}catch(o){throw to!==null&&(to=to.slice(e+1)),g0(my,Xo),o}finally{De=t,sg=!1}}return null}var Ws=[],Gs=0,tf=null,nf=0,Kn=[],Jn=0,Li=null,no=1,ro="";function Ri(e,t){Ws[Gs++]=nf,Ws[Gs++]=tf,tf=e,nf=t}function V0(e,t,n){Kn[Jn++]=no,Kn[Jn++]=ro,Kn[Jn++]=Li,Li=e;var r=no;e=ro;var o=32-yr(r)-1;r&=~(1<<o),n+=1;var i=32-yr(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,no=1<<32-yr(t)+o|n<<o|r,ro=i+e}else no=1<<i|n<<o|r,ro=e}function Iy(e){e.return!==null&&(Ri(e,1),V0(e,1,0))}function wy(e){for(;e===tf;)tf=Ws[--Gs],Ws[Gs]=null,nf=Ws[--Gs],Ws[Gs]=null;for(;e===Li;)Li=Kn[--Jn],Kn[Jn]=null,ro=Kn[--Jn],Kn[Jn]=null,no=Kn[--Jn],Kn[Jn]=null}var An=null,Nn=null,Ze=!1,gr=null;function q0(e,t){var n=Xn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Iw(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,An=e,Nn=zo(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,An=e,Nn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Li!==null?{id:no,overflow:ro}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Xn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,An=e,Nn=null,!0):!1;default:return!1}}function zg(e){return(e.mode&1)!==0&&(e.flags&128)===0}function jg(e){if(Ze){var t=Nn;if(t){var n=t;if(!Iw(e,t)){if(zg(e))throw Error(L(418));t=zo(n.nextSibling);var r=An;t&&Iw(e,t)?q0(r,n):(e.flags=e.flags&-4097|2,Ze=!1,An=e)}}else{if(zg(e))throw Error(L(418));e.flags=e.flags&-4097|2,Ze=!1,An=e}}}function ww(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;An=e}function kd(e){if(e!==An)return!1;if(!Ze)return ww(e),Ze=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Fg(e.type,e.memoizedProps)),t&&(t=Nn)){if(zg(e))throw Y0(),Error(L(418));for(;t;)q0(e,t),t=zo(t.nextSibling)}if(ww(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(L(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Nn=zo(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Nn=null}}else Nn=An?zo(e.stateNode.nextSibling):null;return!0}function Y0(){for(var e=Nn;e;)e=zo(e.nextSibling)}function ra(){Nn=An=null,Ze=!1}function Cy(e){gr===null?gr=[e]:gr.push(e)}var YD=co.ReactCurrentBatchConfig;function Ol(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(L(309));var r=n.stateNode}if(!r)throw Error(L(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=o.refs;s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(L(284));if(!n._owner)throw Error(L(290,e))}return e}function Nd(e,t){throw e=Object.prototype.toString.call(t),Error(L(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Cw(e){var t=e._init;return t(e._payload)}function K0(e){function t(g,S){if(e){var E=g.deletions;E===null?(g.deletions=[S],g.flags|=16):E.push(S)}}function n(g,S){if(!e)return null;for(;S!==null;)t(g,S),S=S.sibling;return null}function r(g,S){for(g=new Map;S!==null;)S.key!==null?g.set(S.key,S):g.set(S.index,S),S=S.sibling;return g}function o(g,S){return g=Vo(g,S),g.index=0,g.sibling=null,g}function i(g,S,E){return g.index=E,e?(E=g.alternate,E!==null?(E=E.index,E<S?(g.flags|=2,S):E):(g.flags|=2,S)):(g.flags|=1048576,S)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,S,E,R){return S===null||S.tag!==6?(S=pg(E,g.mode,R),S.return=g,S):(S=o(S,E),S.return=g,S)}function l(g,S,E,R){var M=E.type;return M===Fs?u(g,S,E.props.children,R,E.key):S!==null&&(S.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===Po&&Cw(M)===S.type)?(R=o(S,E.props),R.ref=Ol(g,S,E),R.return=g,R):(R=jd(E.type,E.key,E.props,null,g.mode,R),R.ref=Ol(g,S,E),R.return=g,R)}function c(g,S,E,R){return S===null||S.tag!==4||S.stateNode.containerInfo!==E.containerInfo||S.stateNode.implementation!==E.implementation?(S=mg(E,g.mode,R),S.return=g,S):(S=o(S,E.children||[]),S.return=g,S)}function u(g,S,E,R,M){return S===null||S.tag!==7?(S=Mi(E,g.mode,R,M),S.return=g,S):(S=o(S,E),S.return=g,S)}function d(g,S,E){if(typeof S=="string"&&S!==""||typeof S=="number")return S=pg(""+S,g.mode,E),S.return=g,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case hd:return E=jd(S.type,S.key,S.props,null,g.mode,E),E.ref=Ol(g,null,S),E.return=g,E;case Us:return S=mg(S,g.mode,E),S.return=g,S;case Po:var R=S._init;return d(g,R(S._payload),E)}if(Hl(S)||Al(S))return S=Mi(S,g.mode,E,null),S.return=g,S;Nd(g,S)}return null}function p(g,S,E,R){var M=S!==null?S.key:null;if(typeof E=="string"&&E!==""||typeof E=="number")return M!==null?null:a(g,S,""+E,R);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case hd:return E.key===M?l(g,S,E,R):null;case Us:return E.key===M?c(g,S,E,R):null;case Po:return M=E._init,p(g,S,M(E._payload),R)}if(Hl(E)||Al(E))return M!==null?null:u(g,S,E,R,null);Nd(g,E)}return null}function h(g,S,E,R,M){if(typeof R=="string"&&R!==""||typeof R=="number")return g=g.get(E)||null,a(S,g,""+R,M);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case hd:return g=g.get(R.key===null?E:R.key)||null,l(S,g,R,M);case Us:return g=g.get(R.key===null?E:R.key)||null,c(S,g,R,M);case Po:var A=R._init;return h(g,S,E,A(R._payload),M)}if(Hl(R)||Al(R))return g=g.get(E)||null,u(S,g,R,M,null);Nd(S,R)}return null}function y(g,S,E,R){for(var M=null,A=null,I=S,N=S=0,U=null;I!==null&&N<E.length;N++){I.index>N?(U=I,I=null):U=I.sibling;var x=p(g,I,E[N],R);if(x===null){I===null&&(I=U);break}e&&I&&x.alternate===null&&t(g,I),S=i(x,S,N),A===null?M=x:A.sibling=x,A=x,I=U}if(N===E.length)return n(g,I),Ze&&Ri(g,N),M;if(I===null){for(;N<E.length;N++)I=d(g,E[N],R),I!==null&&(S=i(I,S,N),A===null?M=I:A.sibling=I,A=I);return Ze&&Ri(g,N),M}for(I=r(g,I);N<E.length;N++)U=h(I,g,N,E[N],R),U!==null&&(e&&U.alternate!==null&&I.delete(U.key===null?N:U.key),S=i(U,S,N),A===null?M=U:A.sibling=U,A=U);return e&&I.forEach(function($){return t(g,$)}),Ze&&Ri(g,N),M}function _(g,S,E,R){var M=Al(E);if(typeof M!="function")throw Error(L(150));if(E=M.call(E),E==null)throw Error(L(151));for(var A=M=null,I=S,N=S=0,U=null,x=E.next();I!==null&&!x.done;N++,x=E.next()){I.index>N?(U=I,I=null):U=I.sibling;var $=p(g,I,x.value,R);if($===null){I===null&&(I=U);break}e&&I&&$.alternate===null&&t(g,I),S=i($,S,N),A===null?M=$:A.sibling=$,A=$,I=U}if(x.done)return n(g,I),Ze&&Ri(g,N),M;if(I===null){for(;!x.done;N++,x=E.next())x=d(g,x.value,R),x!==null&&(S=i(x,S,N),A===null?M=x:A.sibling=x,A=x);return Ze&&Ri(g,N),M}for(I=r(g,I);!x.done;N++,x=E.next())x=h(I,g,N,x.value,R),x!==null&&(e&&x.alternate!==null&&I.delete(x.key===null?N:x.key),S=i(x,S,N),A===null?M=x:A.sibling=x,A=x);return e&&I.forEach(function(W){return t(g,W)}),Ze&&Ri(g,N),M}function T(g,S,E,R){if(typeof E=="object"&&E!==null&&E.type===Fs&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case hd:e:{for(var M=E.key,A=S;A!==null;){if(A.key===M){if(M=E.type,M===Fs){if(A.tag===7){n(g,A.sibling),S=o(A,E.props.children),S.return=g,g=S;break e}}else if(A.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===Po&&Cw(M)===A.type){n(g,A.sibling),S=o(A,E.props),S.ref=Ol(g,A,E),S.return=g,g=S;break e}n(g,A);break}else t(g,A);A=A.sibling}E.type===Fs?(S=Mi(E.props.children,g.mode,R,E.key),S.return=g,g=S):(R=jd(E.type,E.key,E.props,null,g.mode,R),R.ref=Ol(g,S,E),R.return=g,g=R)}return s(g);case Us:e:{for(A=E.key;S!==null;){if(S.key===A)if(S.tag===4&&S.stateNode.containerInfo===E.containerInfo&&S.stateNode.implementation===E.implementation){n(g,S.sibling),S=o(S,E.children||[]),S.return=g,g=S;break e}else{n(g,S);break}else t(g,S);S=S.sibling}S=mg(E,g.mode,R),S.return=g,g=S}return s(g);case Po:return A=E._init,T(g,S,A(E._payload),R)}if(Hl(E))return y(g,S,E,R);if(Al(E))return _(g,S,E,R);Nd(g,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,S!==null&&S.tag===6?(n(g,S.sibling),S=o(S,E),S.return=g,g=S):(n(g,S),S=pg(E,g.mode,R),S.return=g,g=S),s(g)):n(g,S)}return T}var oa=K0(!0),J0=K0(!1),rf=Jo(null),of=null,Vs=null,Ry=null;function xy(){Ry=Vs=of=null}function by(e){var t=rf.current;Je(rf),e._currentValue=t}function Wg(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Zs(e,t){of=e,Ry=Vs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(yn=!0),e.firstContext=null)}function Zn(e){var t=e._currentValue;if(Ry!==e)if(e={context:e,memoizedValue:t,next:null},Vs===null){if(of===null)throw Error(L(308));Vs=e,of.dependencies={lanes:0,firstContext:e}}else Vs=Vs.next=e;return t}var ki=null;function ky(e){ki===null?ki=[e]:ki.push(e)}function X0(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,ky(t)):(n.next=o.next,o.next=n),t.interleaved=n,ao(e,r)}function ao(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Lo=!1;function Ny(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Q0(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 oo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function jo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(xe&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,ao(e,n)}return o=r.interleaved,o===null?(t.next=t,ky(r)):(t.next=o.next,o.next=t),r.interleaved=t,ao(e,n)}function Ud(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,hy(e,n)}}function Rw(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function sf(e,t,n,r){var o=e.updateQueue;Lo=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?i=c:s.next=c,s=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var d=o.baseState;s=0,u=c=l=null,a=i;do{var p=a.lane,h=a.eventTime;if((r&p)===p){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,_=a;switch(p=t,h=n,_.tag){case 1:if(y=_.payload,typeof y=="function"){d=y.call(h,d,p);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=_.payload,p=typeof y=="function"?y.call(h,d,p):y,p==null)break e;d=ot({},d,p);break e;case 2:Lo=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=h,l=d):u=u.next=h,s|=p;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;p=a,a=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(!0);if(u===null&&(l=d),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=u,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Di|=s,e.lanes=s,e.memoizedState=d}}function xw(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(L(191,o));o.call(r)}}}var Sc={},Pr=Jo(Sc),cc=Jo(Sc),uc=Jo(Sc);function Ni(e){if(e===Sc)throw Error(L(174));return e}function Ay(e,t){switch(Ge(uc,t),Ge(cc,e),Ge(Pr,Sc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:wg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=wg(t,e)}Je(Pr),Ge(Pr,t)}function ia(){Je(Pr),Je(cc),Je(uc)}function Z0(e){Ni(uc.current);var t=Ni(Pr.current),n=wg(t,e.type);t!==n&&(Ge(cc,e),Ge(Pr,n))}function My(e){cc.current===e&&(Je(Pr),Je(cc))}var nt=Jo(0);function af(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ag=[];function Py(){for(var e=0;e<ag.length;e++)ag[e]._workInProgressVersionPrimary=null;ag.length=0}var Fd=co.ReactCurrentDispatcher,lg=co.ReactCurrentBatchConfig,Oi=0,rt=null,Tt=null,Rt=null,lf=!1,Yl=!1,dc=0,KD=0;function Wt(){throw Error(L(321))}function Ly(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function Oy(e,t,n,r,o,i){if(Oi=i,rt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Fd.current=e===null||e.memoizedState===null?ZD:eU,e=n(r,o),Yl){i=0;do{if(Yl=!1,dc=0,25<=i)throw Error(L(301));i+=1,Rt=Tt=null,t.updateQueue=null,Fd.current=tU,e=n(r,o)}while(Yl)}if(Fd.current=cf,t=Tt!==null&&Tt.next!==null,Oi=0,Rt=Tt=rt=null,lf=!1,t)throw Error(L(300));return e}function Dy(){var e=dc!==0;return dc=0,e}function Nr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?rt.memoizedState=Rt=e:Rt=Rt.next=e,Rt}function er(){if(Tt===null){var e=rt.alternate;e=e!==null?e.memoizedState:null}else e=Tt.next;var t=Rt===null?rt.memoizedState:Rt.next;if(t!==null)Rt=t,Tt=e;else{if(e===null)throw Error(L(310));Tt=e,e={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},Rt===null?rt.memoizedState=Rt=e:Rt=Rt.next=e}return Rt}function fc(e,t){return typeof t=="function"?t(e):t}function cg(e){var t=er(),n=t.queue;if(n===null)throw Error(L(311));n.lastRenderedReducer=e;var r=Tt,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,c=i;do{var u=c.lane;if((Oi&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,s=r):l=l.next=d,rt.lanes|=u,Di|=u}c=c.next}while(c!==null&&c!==i);l===null?s=r:l.next=a,_r(r,t.memoizedState)||(yn=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,rt.lanes|=i,Di|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ug(e){var t=er(),n=t.queue;if(n===null)throw Error(L(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);_r(i,t.memoizedState)||(yn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function eC(){}function tC(e,t){var n=rt,r=er(),o=t(),i=!_r(r.memoizedState,o);if(i&&(r.memoizedState=o,yn=!0),r=r.queue,Uy(oC.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Rt!==null&&Rt.memoizedState.tag&1){if(n.flags|=2048,pc(9,rC.bind(null,n,r,o,t),void 0,null),xt===null)throw Error(L(349));(Oi&30)!==0||nC(n,t,o)}return o}function nC(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=rt.updateQueue,t===null?(t={lastEffect:null,stores:null},rt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function rC(e,t,n,r){t.value=n,t.getSnapshot=r,iC(t)&&sC(e)}function oC(e,t,n){return n(function(){iC(t)&&sC(e)})}function iC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function sC(e){var t=ao(e,1);t!==null&&Sr(t,e,1,-1)}function bw(e){var t=Nr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fc,lastRenderedState:e},t.queue=e,e=e.dispatch=QD.bind(null,rt,e),[t.memoizedState,e]}function pc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=rt.updateQueue,t===null?(t={lastEffect:null,stores:null},rt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function aC(){return er().memoizedState}function Bd(e,t,n,r){var o=Nr();rt.flags|=e,o.memoizedState=pc(1|t,n,void 0,r===void 0?null:r)}function Ef(e,t,n,r){var o=er();r=r===void 0?null:r;var i=void 0;if(Tt!==null){var s=Tt.memoizedState;if(i=s.destroy,r!==null&&Ly(r,s.deps)){o.memoizedState=pc(t,n,i,r);return}}rt.flags|=e,o.memoizedState=pc(1|t,n,i,r)}function kw(e,t){return Bd(8390656,8,e,t)}function Uy(e,t){return Ef(2048,8,e,t)}function lC(e,t){return Ef(4,2,e,t)}function cC(e,t){return Ef(4,4,e,t)}function uC(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function dC(e,t,n){return n=n!=null?n.concat([e]):null,Ef(4,4,uC.bind(null,t,e),n)}function Fy(){}function fC(e,t){var n=er();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ly(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function pC(e,t){var n=er();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ly(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function mC(e,t,n){return(Oi&21)===0?(e.baseState&&(e.baseState=!1,yn=!0),e.memoizedState=n):(_r(n,t)||(n=_0(),rt.lanes|=n,Di|=n,e.baseState=!0),t)}function JD(e,t){var n=De;De=n!==0&&4>n?n:4,e(!0);var r=lg.transition;lg.transition={};try{e(!1),t()}finally{De=n,lg.transition=r}}function hC(){return er().memoizedState}function XD(e,t,n){var r=Go(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},gC(e))yC(t,n);else if(n=X0(e,t,n,r),n!==null){var o=on();Sr(n,e,r,o),SC(n,t,r)}}function QD(e,t,n){var r=Go(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(gC(e))yC(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,_r(a,s)){var l=t.interleaved;l===null?(o.next=o,ky(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}n=X0(e,t,o,r),n!==null&&(o=on(),Sr(n,e,r,o),SC(n,t,r))}}function gC(e){var t=e.alternate;return e===rt||t!==null&&t===rt}function yC(e,t){Yl=lf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function SC(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,hy(e,n)}}var cf={readContext:Zn,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useInsertionEffect:Wt,useLayoutEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useMutableSource:Wt,useSyncExternalStore:Wt,useId:Wt,unstable_isNewReconciler:!1},ZD={readContext:Zn,useCallback:function(e,t){return Nr().memoizedState=[e,t===void 0?null:t],e},useContext:Zn,useEffect:kw,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Bd(4194308,4,uC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bd(4,2,e,t)},useMemo:function(e,t){var n=Nr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Nr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=XD.bind(null,rt,e),[r.memoizedState,e]},useRef:function(e){var t=Nr();return e={current:e},t.memoizedState=e},useState:bw,useDebugValue:Fy,useDeferredValue:function(e){return Nr().memoizedState=e},useTransition:function(){var e=bw(!1),t=e[0];return e=JD.bind(null,e[1]),Nr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=rt,o=Nr();if(Ze){if(n===void 0)throw Error(L(407));n=n()}else{if(n=t(),xt===null)throw Error(L(349));(Oi&30)!==0||nC(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,kw(oC.bind(null,r,i,e),[e]),r.flags|=2048,pc(9,rC.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Nr(),t=xt.identifierPrefix;if(Ze){var n=ro,r=no;n=(r&~(1<<32-yr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=dc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=KD++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},eU={readContext:Zn,useCallback:fC,useContext:Zn,useEffect:Uy,useImperativeHandle:dC,useInsertionEffect:lC,useLayoutEffect:cC,useMemo:pC,useReducer:cg,useRef:aC,useState:function(){return cg(fc)},useDebugValue:Fy,useDeferredValue:function(e){var t=er();return mC(t,Tt.memoizedState,e)},useTransition:function(){var e=cg(fc)[0],t=er().memoizedState;return[e,t]},useMutableSource:eC,useSyncExternalStore:tC,useId:hC,unstable_isNewReconciler:!1},tU={readContext:Zn,useCallback:fC,useContext:Zn,useEffect:Uy,useImperativeHandle:dC,useInsertionEffect:lC,useLayoutEffect:cC,useMemo:pC,useReducer:ug,useRef:aC,useState:function(){return ug(fc)},useDebugValue:Fy,useDeferredValue:function(e){var t=er();return Tt===null?t.memoizedState=e:mC(t,Tt.memoizedState,e)},useTransition:function(){var e=ug(fc)[0],t=er().memoizedState;return[e,t]},useMutableSource:eC,useSyncExternalStore:tC,useId:hC,unstable_isNewReconciler:!1};function mr(e,t){if(e&&e.defaultProps){t=ot({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Gg(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ot({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Tf={isMounted:function(e){return(e=e._reactInternals)?Bi(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=on(),o=Go(e),i=oo(r,o);i.payload=t,n!=null&&(i.callback=n),t=jo(e,i,o),t!==null&&(Sr(t,e,o,r),Ud(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=on(),o=Go(e),i=oo(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=jo(e,i,o),t!==null&&(Sr(t,e,o,r),Ud(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=on(),r=Go(e),o=oo(n,r);o.tag=2,t!=null&&(o.callback=t),t=jo(e,o,r),t!==null&&(Sr(t,e,r,n),Ud(t,e,r))}};function Nw(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!ic(n,r)||!ic(o,i):!0}function _C(e,t,n){var r=!1,o=Yo,i=t.contextType;return typeof i=="object"&&i!==null?i=Zn(i):(o=_n(t)?Pi:qt.current,r=t.contextTypes,i=(r=r!=null)?na(e,o):Yo),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Tf,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Aw(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Tf.enqueueReplaceState(t,t.state,null)}function Vg(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Ny(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Zn(i):(i=_n(t)?Pi:qt.current,o.context=na(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Gg(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Tf.enqueueReplaceState(o,o.state,null),sf(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function sa(e,t){try{var n="",r=t;do n+=AO(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
5
|
+
`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Jh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?$l(e):""}function PO(e){switch(e.tag){case 5:return $l(e.type);case 16:return $l("Lazy");case 13:return $l("Suspense");case 19:return $l("SuspenseList");case 0:case 2:case 15:return e=Xh(e.type,!1),e;case 11:return e=Xh(e.type.render,!1),e;case 1:return e=Xh(e.type,!0),e;default:return""}}function Eg(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 Hs:return"Fragment";case Bs:return"Portal";case Sg:return"Profiler";case fy:return"StrictMode";case _g:return"Suspense";case vg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case e0:return(e.displayName||"Context")+".Consumer";case Zw:return(e._context.displayName||"Context")+".Provider";case py:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case my:return t=e.displayName||null,t!==null?t:Eg(e.type)||"Memo";case Po:t=e._payload,e=e._init;try{return Eg(e(t))}catch{}}return null}function LO(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 Eg(t);case 8:return t===fy?"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 qo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function n0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function OO(e){var t=n0(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Sd(e){e._valueTracker||(e._valueTracker=OO(e))}function r0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=n0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Vd(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 Tg(e,t){var n=t.checked;return rt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function KI(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=qo(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function o0(e,t){t=t.checked,t!=null&&dy(e,"checked",t,!1)}function Ig(e,t){o0(e,t);var n=qo(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?wg(e,t.type,n):t.hasOwnProperty("defaultValue")&&wg(e,t.type,qo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function JI(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function wg(e,t,n){(t!=="number"||Vd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var zl=Array.isArray;function Xs(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+qo(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Cg(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(L(91));return rt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function XI(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(L(92));if(zl(n)){if(1<n.length)throw Error(L(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:qo(n)}}function i0(e,t){var n=qo(t.value),r=qo(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function QI(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function s0(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Rg(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?s0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var _d,a0=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(_d=_d||document.createElement("div"),_d.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=_d.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function tc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gl={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},DO=["Webkit","ms","Moz","O"];Object.keys(Gl).forEach(function(e){DO.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Gl[t]=Gl[e]})});function l0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Gl.hasOwnProperty(e)&&Gl[e]?(""+t).trim():t+"px"}function c0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=l0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var UO=rt({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 xg(e,t){if(t){if(UO[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(L(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(L(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(L(61))}if(t.style!=null&&typeof t.style!="object")throw Error(L(62))}}function bg(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 kg=null;function hy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ng=null,Qs=null,Zs=null;function ZI(e){if(e=_c(e)){if(typeof Ng!="function")throw Error(L(280));var t=e.stateNode;t&&(t=Ef(t),Ng(e.stateNode,e.type,t))}}function u0(e){Qs?Zs?Zs.push(e):Zs=[e]:Qs=e}function d0(){if(Qs){var e=Qs,t=Zs;if(Zs=Qs=null,ZI(e),t)for(e=0;e<t.length;e++)ZI(t[e])}}function f0(e,t){return e(t)}function p0(){}var Qh=!1;function m0(e,t,n){if(Qh)return e(t,n);Qh=!0;try{return f0(e,t,n)}finally{Qh=!1,(Qs!==null||Zs!==null)&&(p0(),d0())}}function nc(e,t){var n=e.stateNode;if(n===null)return null;var r=Ef(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(L(231,t,typeof n));return n}var Ag=!1;if(ao)try{Us={},Object.defineProperty(Us,"passive",{get:function(){Ag=!0}}),window.addEventListener("test",Us,Us),window.removeEventListener("test",Us,Us)}catch{Ag=!1}var Us;function FO(e,t,n,r,o,i,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var Vl=!1,qd=null,Yd=!1,Mg=null,BO={onError:function(e){Vl=!0,qd=e}};function HO(e,t,n,r,o,i,s,a,l){Vl=!1,qd=null,FO.apply(BO,arguments)}function $O(e,t,n,r,o,i,s,a,l){if(HO.apply(this,arguments),Vl){if(Vl){var c=qd;Vl=!1,qd=null}else throw Error(L(198));Yd||(Yd=!0,Mg=c)}}function Hi(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function h0(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ew(e){if(Hi(e)!==e)throw Error(L(188))}function zO(e){var t=e.alternate;if(!t){if(t=Hi(e),t===null)throw Error(L(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return ew(o),e;if(i===r)return ew(o),t;i=i.sibling}throw Error(L(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(L(189))}}if(n.alternate!==r)throw Error(L(190))}if(n.tag!==3)throw Error(L(188));return n.stateNode.current===n?e:t}function g0(e){return e=zO(e),e!==null?y0(e):null}function y0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=y0(e);if(t!==null)return t;e=e.sibling}return null}var S0=Ln.unstable_scheduleCallback,tw=Ln.unstable_cancelCallback,jO=Ln.unstable_shouldYield,WO=Ln.unstable_requestPaint,pt=Ln.unstable_now,GO=Ln.unstable_getCurrentPriorityLevel,gy=Ln.unstable_ImmediatePriority,_0=Ln.unstable_UserBlockingPriority,Kd=Ln.unstable_NormalPriority,VO=Ln.unstable_LowPriority,v0=Ln.unstable_IdlePriority,yf=null,Pr=null;function qO(e){if(Pr&&typeof Pr.onCommitFiberRoot=="function")try{Pr.onCommitFiberRoot(yf,e,void 0,(e.current.flags&128)===128)}catch{}}var Sr=Math.clz32?Math.clz32:JO,YO=Math.log,KO=Math.LN2;function JO(e){return e>>>=0,e===0?32:31-(YO(e)/KO|0)|0}var vd=64,Ed=4194304;function jl(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 Jd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=jl(a):(i&=s,i!==0&&(r=jl(i)))}else s=n&~o,s!==0?r=jl(s):i!==0&&(r=jl(i));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Sr(t),o=1<<n,r|=e[n],t&=~o;return r}function XO(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function QO(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Sr(i),a=1<<s,l=o[s];l===-1?((a&n)===0||(a&r)!==0)&&(o[s]=XO(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Pg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function E0(){var e=vd;return vd<<=1,(vd&4194240)===0&&(vd=64),e}function Zh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Sr(t),e[t]=n}function ZO(e,t){var n=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 r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Sr(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function yy(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Sr(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var De=0;function T0(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var I0,Sy,w0,C0,R0,Lg=!1,Td=[],Bo=null,Ho=null,$o=null,rc=new Map,oc=new Map,Oo=[],eD="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function nw(e,t){switch(e){case"focusin":case"focusout":Bo=null;break;case"dragenter":case"dragleave":Ho=null;break;case"mouseover":case"mouseout":$o=null;break;case"pointerover":case"pointerout":rc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":oc.delete(t.pointerId)}}function Ll(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=_c(t),t!==null&&Sy(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function tD(e,t,n,r,o){switch(t){case"focusin":return Bo=Ll(Bo,e,t,n,r,o),!0;case"dragenter":return Ho=Ll(Ho,e,t,n,r,o),!0;case"mouseover":return $o=Ll($o,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return rc.set(i,Ll(rc.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,oc.set(i,Ll(oc.get(i)||null,e,t,n,r,o)),!0}return!1}function x0(e){var t=ki(e.target);if(t!==null){var n=Hi(t);if(n!==null){if(t=n.tag,t===13){if(t=h0(n),t!==null){e.blockedOn=t,R0(e.priority,function(){w0(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Og(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);kg=r,n.target.dispatchEvent(r),kg=null}else return t=_c(n),t!==null&&Sy(t),e.blockedOn=n,!1;t.shift()}return!0}function rw(e,t,n){Dd(e)&&n.delete(t)}function nD(){Lg=!1,Bo!==null&&Dd(Bo)&&(Bo=null),Ho!==null&&Dd(Ho)&&(Ho=null),$o!==null&&Dd($o)&&($o=null),rc.forEach(rw),oc.forEach(rw)}function Ol(e,t){e.blockedOn===t&&(e.blockedOn=null,Lg||(Lg=!0,Ln.unstable_scheduleCallback(Ln.unstable_NormalPriority,nD)))}function ic(e){function t(o){return Ol(o,e)}if(0<Td.length){Ol(Td[0],e);for(var n=1;n<Td.length;n++){var r=Td[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Bo!==null&&Ol(Bo,e),Ho!==null&&Ol(Ho,e),$o!==null&&Ol($o,e),rc.forEach(t),oc.forEach(t),n=0;n<Oo.length;n++)r=Oo[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Oo.length&&(n=Oo[0],n.blockedOn===null);)x0(n),n.blockedOn===null&&Oo.shift()}var ea=fo.ReactCurrentBatchConfig,Xd=!0;function rD(e,t,n,r){var o=De,i=ea.transition;ea.transition=null;try{De=1,_y(e,t,n,r)}finally{De=o,ea.transition=i}}function oD(e,t,n,r){var o=De,i=ea.transition;ea.transition=null;try{De=4,_y(e,t,n,r)}finally{De=o,ea.transition=i}}function _y(e,t,n,r){if(Xd){var o=Og(e,t,n,r);if(o===null)sg(e,t,r,Qd,n),nw(e,r);else if(tD(o,e,t,n,r))r.stopPropagation();else if(nw(e,r),t&4&&-1<eD.indexOf(e)){for(;o!==null;){var i=_c(o);if(i!==null&&I0(i),i=Og(e,t,n,r),i===null&&sg(e,t,r,Qd,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else sg(e,t,r,null,n)}}var Qd=null;function Og(e,t,n,r){if(Qd=null,e=hy(r),e=ki(e),e!==null)if(t=Hi(e),t===null)e=null;else if(n=t.tag,n===13){if(e=h0(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Qd=e,null}function b0(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(GO()){case gy:return 1;case _0:return 4;case Kd:case VO:return 16;case v0:return 536870912;default:return 16}default:return 16}}var Uo=null,vy=null,Ud=null;function k0(){if(Ud)return Ud;var e,t=vy,n=t.length,r,o="value"in Uo?Uo.value:Uo.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Ud=o.slice(e,1<r?1-r:void 0)}function Fd(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Id(){return!0}function ow(){return!1}function On(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Id:ow,this.isPropagationStopped=ow,this}return rt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Id)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Id)},persist:function(){},isPersistent:Id}),t}var ua={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ey=On(ua),Sc=rt({},ua,{view:0,detail:0}),iD=On(Sc),eg,tg,Dl,Sf=rt({},Sc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ty,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Dl&&(Dl&&e.type==="mousemove"?(eg=e.screenX-Dl.screenX,tg=e.screenY-Dl.screenY):tg=eg=0,Dl=e),eg)},movementY:function(e){return"movementY"in e?e.movementY:tg}}),iw=On(Sf),sD=rt({},Sf,{dataTransfer:0}),aD=On(sD),lD=rt({},Sc,{relatedTarget:0}),ng=On(lD),cD=rt({},ua,{animationName:0,elapsedTime:0,pseudoElement:0}),uD=On(cD),dD=rt({},ua,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),fD=On(dD),pD=rt({},ua,{data:0}),sw=On(pD),mD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hD={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},gD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=gD[e])?!!t[e]:!1}function Ty(){return yD}var SD=rt({},Sc,{key:function(e){if(e.key){var t=mD[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?hD[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ty,charCode:function(e){return e.type==="keypress"?Fd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_D=On(SD),vD=rt({},Sf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),aw=On(vD),ED=rt({},Sc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ty}),TD=On(ED),ID=rt({},ua,{propertyName:0,elapsedTime:0,pseudoElement:0}),wD=On(ID),CD=rt({},Sf,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),RD=On(CD),xD=[9,13,27,32],Iy=ao&&"CompositionEvent"in window,ql=null;ao&&"documentMode"in document&&(ql=document.documentMode);var bD=ao&&"TextEvent"in window&&!ql,N0=ao&&(!Iy||ql&&8<ql&&11>=ql),lw=" ",cw=!1;function A0(e,t){switch(e){case"keyup":return xD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function M0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $s=!1;function kD(e,t){switch(e){case"compositionend":return M0(t);case"keypress":return t.which!==32?null:(cw=!0,lw);case"textInput":return e=t.data,e===lw&&cw?null:e;default:return null}}function ND(e,t){if($s)return e==="compositionend"||!Iy&&A0(e,t)?(e=k0(),Ud=vy=Uo=null,$s=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return N0&&t.locale!=="ko"?null:t.data;default:return null}}var AD={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function uw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!AD[e.type]:t==="textarea"}function P0(e,t,n,r){u0(r),t=Zd(t,"onChange"),0<t.length&&(n=new Ey("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Yl=null,sc=null;function MD(e){W0(e,0)}function _f(e){var t=Ws(e);if(r0(t))return e}function PD(e,t){if(e==="change")return t}var L0=!1;ao&&(ao?(Cd="oninput"in document,Cd||(rg=document.createElement("div"),rg.setAttribute("oninput","return;"),Cd=typeof rg.oninput=="function"),wd=Cd):wd=!1,L0=wd&&(!document.documentMode||9<document.documentMode));var wd,Cd,rg;function dw(){Yl&&(Yl.detachEvent("onpropertychange",O0),sc=Yl=null)}function O0(e){if(e.propertyName==="value"&&_f(sc)){var t=[];P0(t,sc,e,hy(e)),m0(MD,t)}}function LD(e,t,n){e==="focusin"?(dw(),Yl=t,sc=n,Yl.attachEvent("onpropertychange",O0)):e==="focusout"&&dw()}function OD(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return _f(sc)}function DD(e,t){if(e==="click")return _f(t)}function UD(e,t){if(e==="input"||e==="change")return _f(t)}function FD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vr=typeof Object.is=="function"?Object.is:FD;function ac(e,t){if(vr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!yg.call(t,o)||!vr(e[o],t[o]))return!1}return!0}function fw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pw(e,t){var n=fw(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fw(n)}}function D0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?D0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function U0(){for(var e=window,t=Vd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vd(e.document)}return t}function wy(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 BD(e){var t=U0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&D0(n.ownerDocument.documentElement,n)){if(r!==null&&wy(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=pw(n,i);var s=pw(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var HD=ao&&"documentMode"in document&&11>=document.documentMode,zs=null,Dg=null,Kl=null,Ug=!1;function mw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ug||zs==null||zs!==Vd(r)||(r=zs,"selectionStart"in r&&wy(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Kl&&ac(Kl,r)||(Kl=r,r=Zd(Dg,"onSelect"),0<r.length&&(t=new Ey("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=zs)))}function Rd(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var js={animationend:Rd("Animation","AnimationEnd"),animationiteration:Rd("Animation","AnimationIteration"),animationstart:Rd("Animation","AnimationStart"),transitionend:Rd("Transition","TransitionEnd")},og={},F0={};ao&&(F0=document.createElement("div").style,"AnimationEvent"in window||(delete js.animationend.animation,delete js.animationiteration.animation,delete js.animationstart.animation),"TransitionEvent"in window||delete js.transitionend.transition);function vf(e){if(og[e])return og[e];if(!js[e])return e;var t=js[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in F0)return og[e]=t[n];return e}var B0=vf("animationend"),H0=vf("animationiteration"),$0=vf("animationstart"),z0=vf("transitionend"),j0=new Map,hw="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ko(e,t){j0.set(e,t),Bi(t,[e])}for(xd=0;xd<hw.length;xd++)bd=hw[xd],gw=bd.toLowerCase(),yw=bd[0].toUpperCase()+bd.slice(1),Ko(gw,"on"+yw);var bd,gw,yw,xd;Ko(B0,"onAnimationEnd");Ko(H0,"onAnimationIteration");Ko($0,"onAnimationStart");Ko("dblclick","onDoubleClick");Ko("focusin","onFocus");Ko("focusout","onBlur");Ko(z0,"onTransitionEnd");ra("onMouseEnter",["mouseout","mouseover"]);ra("onMouseLeave",["mouseout","mouseover"]);ra("onPointerEnter",["pointerout","pointerover"]);ra("onPointerLeave",["pointerout","pointerover"]);Bi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Bi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Bi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Bi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Bi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Bi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),$D=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wl));function Sw(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,$O(r,t,void 0,e),e.currentTarget=null}function W0(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;Sw(o,a,c),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;Sw(o,a,c),i=l}}}if(Yd)throw e=Mg,Yd=!1,Mg=null,e}function Ye(e,t){var n=t[zg];n===void 0&&(n=t[zg]=new Set);var r=e+"__bubble";n.has(r)||(G0(t,e,2,!1),n.add(r))}function ig(e,t,n){var r=0;t&&(r|=4),G0(n,e,r,t)}var kd="_reactListening"+Math.random().toString(36).slice(2);function lc(e){if(!e[kd]){e[kd]=!0,Qw.forEach(function(n){n!=="selectionchange"&&($D.has(n)||ig(n,!1,e),ig(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[kd]||(t[kd]=!0,ig("selectionchange",!1,t))}}function G0(e,t,n,r){switch(b0(t)){case 1:var o=rD;break;case 4:o=oD;break;default:o=_y}n=o.bind(null,t,n,e),o=void 0,!Ag||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function sg(e,t,n,r,o){var i=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=ki(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}m0(function(){var c=i,u=hy(n),f=[];e:{var p=j0.get(e);if(p!==void 0){var h=Ey,y=e;switch(e){case"keypress":if(Fd(n)===0)break e;case"keydown":case"keyup":h=_D;break;case"focusin":y="focus",h=ng;break;case"focusout":y="blur",h=ng;break;case"beforeblur":case"afterblur":h=ng;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=iw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=aD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=TD;break;case B0:case H0:case $0:h=uD;break;case z0:h=wD;break;case"scroll":h=iD;break;case"wheel":h=RD;break;case"copy":case"cut":case"paste":h=fD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=aw}var _=(t&4)!==0,T=!_&&e==="scroll",g=_?p!==null?p+"Capture":null:p;_=[];for(var S=c,E;S!==null;){E=S;var R=E.stateNode;if(E.tag===5&&R!==null&&(E=R,g!==null&&(R=nc(S,g),R!=null&&_.push(cc(S,R,E)))),T)break;S=S.return}0<_.length&&(p=new h(p,y,null,n,u),f.push({event:p,listeners:_}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==kg&&(y=n.relatedTarget||n.fromElement)&&(ki(y)||y[lo]))break e;if((h||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=c,y=y?ki(y):null,y!==null&&(T=Hi(y),y!==T||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=c),h!==y)){if(_=iw,R="onMouseLeave",g="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(_=aw,R="onPointerLeave",g="onPointerEnter",S="pointer"),T=h==null?p:Ws(h),E=y==null?p:Ws(y),p=new _(R,S+"leave",h,n,u),p.target=T,p.relatedTarget=E,R=null,ki(u)===c&&(_=new _(g,S+"enter",y,n,u),_.target=E,_.relatedTarget=T,R=_),T=R,h&&y)t:{for(_=h,g=y,S=0,E=_;E;E=Fs(E))S++;for(E=0,R=g;R;R=Fs(R))E++;for(;0<S-E;)_=Fs(_),S--;for(;0<E-S;)g=Fs(g),E--;for(;S--;){if(_===g||g!==null&&_===g.alternate)break t;_=Fs(_),g=Fs(g)}_=null}else _=null;h!==null&&_w(f,p,h,_,!1),y!==null&&T!==null&&_w(f,T,y,_,!0)}}e:{if(p=c?Ws(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var M=PD;else if(uw(p))if(L0)M=UD;else{M=OD;var A=LD}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(M=DD);if(M&&(M=M(e,c))){P0(f,M,n,u);break e}A&&A(e,p,c),e==="focusout"&&(A=p._wrapperState)&&A.controlled&&p.type==="number"&&wg(p,"number",p.value)}switch(A=c?Ws(c):window,e){case"focusin":(uw(A)||A.contentEditable==="true")&&(zs=A,Dg=c,Kl=null);break;case"focusout":Kl=Dg=zs=null;break;case"mousedown":Ug=!0;break;case"contextmenu":case"mouseup":case"dragend":Ug=!1,mw(f,n,u);break;case"selectionchange":if(HD)break;case"keydown":case"keyup":mw(f,n,u)}var I;if(Iy)e:{switch(e){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else $s?A0(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(N0&&n.locale!=="ko"&&($s||N!=="onCompositionStart"?N==="onCompositionEnd"&&$s&&(I=k0()):(Uo=u,vy="value"in Uo?Uo.value:Uo.textContent,$s=!0)),A=Zd(c,N),0<A.length&&(N=new sw(N,e,null,n,u),f.push({event:N,listeners:A}),I?N.data=I:(I=M0(n),I!==null&&(N.data=I)))),(I=bD?kD(e,n):ND(e,n))&&(c=Zd(c,"onBeforeInput"),0<c.length&&(u=new sw("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=I))}W0(f,t)})}function cc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zd(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=nc(e,n),i!=null&&r.unshift(cc(e,i,o)),i=nc(e,t),i!=null&&r.push(cc(e,i,o))),e=e.return}return r}function Fs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function _w(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,o?(l=nc(n,i),l!=null&&s.unshift(cc(n,l,a))):o||(l=nc(n,i),l!=null&&s.push(cc(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var zD=/\r\n?/g,jD=/\u0000|\uFFFD/g;function vw(e){return(typeof e=="string"?e:""+e).replace(zD,`
|
|
6
|
+
`).replace(jD,"")}function Nd(e,t,n){if(t=vw(t),vw(e)!==t&&n)throw Error(L(425))}function ef(){}var Fg=null,Bg=null;function Hg(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var $g=typeof setTimeout=="function"?setTimeout:void 0,WD=typeof clearTimeout=="function"?clearTimeout:void 0,Ew=typeof Promise=="function"?Promise:void 0,GD=typeof queueMicrotask=="function"?queueMicrotask:typeof Ew<"u"?function(e){return Ew.resolve(null).then(e).catch(VD)}:$g;function VD(e){setTimeout(function(){throw e})}function ag(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),ic(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);ic(t)}function zo(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Tw(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var da=Math.random().toString(36).slice(2),Mr="__reactFiber$"+da,uc="__reactProps$"+da,lo="__reactContainer$"+da,zg="__reactEvents$"+da,qD="__reactListeners$"+da,YD="__reactHandles$"+da;function ki(e){var t=e[Mr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lo]||n[Mr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Tw(e);e!==null;){if(n=e[Mr])return n;e=Tw(e)}return t}e=n,n=e.parentNode}return null}function _c(e){return e=e[Mr]||e[lo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ws(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(L(33))}function Ef(e){return e[uc]||null}var jg=[],Gs=-1;function Jo(e){return{current:e}}function Ke(e){0>Gs||(e.current=jg[Gs],jg[Gs]=null,Gs--)}function Ge(e,t){Gs++,jg[Gs]=e.current,e.current=t}var Yo={},Kt=Jo(Yo),_n=Jo(!1),Li=Yo;function oa(e,t){var n=e.type.contextTypes;if(!n)return Yo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function vn(e){return e=e.childContextTypes,e!=null}function tf(){Ke(_n),Ke(Kt)}function Iw(e,t,n){if(Kt.current!==Yo)throw Error(L(168));Ge(Kt,t),Ge(_n,n)}function V0(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(L(108,LO(e)||"Unknown",o));return rt({},n,r)}function nf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yo,Li=Kt.current,Ge(Kt,e),Ge(_n,_n.current),!0}function ww(e,t,n){var r=e.stateNode;if(!r)throw Error(L(169));n?(e=V0(e,t,Li),r.__reactInternalMemoizedMergedChildContext=e,Ke(_n),Ke(Kt),Ge(Kt,e)):Ke(_n),Ge(_n,n)}var ro=null,Tf=!1,lg=!1;function q0(e){ro===null?ro=[e]:ro.push(e)}function KD(e){Tf=!0,q0(e)}function Xo(){if(!lg&&ro!==null){lg=!0;var e=0,t=De;try{var n=ro;for(De=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ro=null,Tf=!1}catch(o){throw ro!==null&&(ro=ro.slice(e+1)),S0(gy,Xo),o}finally{De=t,lg=!1}}return null}var Vs=[],qs=0,rf=null,of=0,Kn=[],Jn=0,Oi=null,oo=1,io="";function xi(e,t){Vs[qs++]=of,Vs[qs++]=rf,rf=e,of=t}function Y0(e,t,n){Kn[Jn++]=oo,Kn[Jn++]=io,Kn[Jn++]=Oi,Oi=e;var r=oo;e=io;var o=32-Sr(r)-1;r&=~(1<<o),n+=1;var i=32-Sr(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,oo=1<<32-Sr(t)+o|n<<o|r,io=i+e}else oo=1<<i|n<<o|r,io=e}function Cy(e){e.return!==null&&(xi(e,1),Y0(e,1,0))}function Ry(e){for(;e===rf;)rf=Vs[--qs],Vs[qs]=null,of=Vs[--qs],Vs[qs]=null;for(;e===Oi;)Oi=Kn[--Jn],Kn[Jn]=null,io=Kn[--Jn],Kn[Jn]=null,oo=Kn[--Jn],Kn[Jn]=null}var Pn=null,Mn=null,Qe=!1,yr=null;function K0(e,t){var n=Xn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Cw(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Pn=e,Mn=zo(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Pn=e,Mn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Oi!==null?{id:oo,overflow:io}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Xn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Pn=e,Mn=null,!0):!1;default:return!1}}function Wg(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Gg(e){if(Qe){var t=Mn;if(t){var n=t;if(!Cw(e,t)){if(Wg(e))throw Error(L(418));t=zo(n.nextSibling);var r=Pn;t&&Cw(e,t)?K0(r,n):(e.flags=e.flags&-4097|2,Qe=!1,Pn=e)}}else{if(Wg(e))throw Error(L(418));e.flags=e.flags&-4097|2,Qe=!1,Pn=e}}}function Rw(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Pn=e}function Ad(e){if(e!==Pn)return!1;if(!Qe)return Rw(e),Qe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Hg(e.type,e.memoizedProps)),t&&(t=Mn)){if(Wg(e))throw J0(),Error(L(418));for(;t;)K0(e,t),t=zo(t.nextSibling)}if(Rw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(L(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Mn=zo(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Mn=null}}else Mn=Pn?zo(e.stateNode.nextSibling):null;return!0}function J0(){for(var e=Mn;e;)e=zo(e.nextSibling)}function ia(){Mn=Pn=null,Qe=!1}function xy(e){yr===null?yr=[e]:yr.push(e)}var JD=fo.ReactCurrentBatchConfig;function Ul(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(L(309));var r=n.stateNode}if(!r)throw Error(L(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=o.refs;s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(L(284));if(!n._owner)throw Error(L(290,e))}return e}function Md(e,t){throw e=Object.prototype.toString.call(t),Error(L(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function xw(e){var t=e._init;return t(e._payload)}function X0(e){function t(g,S){if(e){var E=g.deletions;E===null?(g.deletions=[S],g.flags|=16):E.push(S)}}function n(g,S){if(!e)return null;for(;S!==null;)t(g,S),S=S.sibling;return null}function r(g,S){for(g=new Map;S!==null;)S.key!==null?g.set(S.key,S):g.set(S.index,S),S=S.sibling;return g}function o(g,S){return g=Vo(g,S),g.index=0,g.sibling=null,g}function i(g,S,E){return g.index=E,e?(E=g.alternate,E!==null?(E=E.index,E<S?(g.flags|=2,S):E):(g.flags|=2,S)):(g.flags|=1048576,S)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,S,E,R){return S===null||S.tag!==6?(S=hg(E,g.mode,R),S.return=g,S):(S=o(S,E),S.return=g,S)}function l(g,S,E,R){var M=E.type;return M===Hs?u(g,S,E.props.children,R,E.key):S!==null&&(S.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===Po&&xw(M)===S.type)?(R=o(S,E.props),R.ref=Ul(g,S,E),R.return=g,R):(R=Gd(E.type,E.key,E.props,null,g.mode,R),R.ref=Ul(g,S,E),R.return=g,R)}function c(g,S,E,R){return S===null||S.tag!==4||S.stateNode.containerInfo!==E.containerInfo||S.stateNode.implementation!==E.implementation?(S=gg(E,g.mode,R),S.return=g,S):(S=o(S,E.children||[]),S.return=g,S)}function u(g,S,E,R,M){return S===null||S.tag!==7?(S=Pi(E,g.mode,R,M),S.return=g,S):(S=o(S,E),S.return=g,S)}function f(g,S,E){if(typeof S=="string"&&S!==""||typeof S=="number")return S=hg(""+S,g.mode,E),S.return=g,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case yd:return E=Gd(S.type,S.key,S.props,null,g.mode,E),E.ref=Ul(g,null,S),E.return=g,E;case Bs:return S=gg(S,g.mode,E),S.return=g,S;case Po:var R=S._init;return f(g,R(S._payload),E)}if(zl(S)||Pl(S))return S=Pi(S,g.mode,E,null),S.return=g,S;Md(g,S)}return null}function p(g,S,E,R){var M=S!==null?S.key:null;if(typeof E=="string"&&E!==""||typeof E=="number")return M!==null?null:a(g,S,""+E,R);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case yd:return E.key===M?l(g,S,E,R):null;case Bs:return E.key===M?c(g,S,E,R):null;case Po:return M=E._init,p(g,S,M(E._payload),R)}if(zl(E)||Pl(E))return M!==null?null:u(g,S,E,R,null);Md(g,E)}return null}function h(g,S,E,R,M){if(typeof R=="string"&&R!==""||typeof R=="number")return g=g.get(E)||null,a(S,g,""+R,M);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case yd:return g=g.get(R.key===null?E:R.key)||null,l(S,g,R,M);case Bs:return g=g.get(R.key===null?E:R.key)||null,c(S,g,R,M);case Po:var A=R._init;return h(g,S,E,A(R._payload),M)}if(zl(R)||Pl(R))return g=g.get(E)||null,u(S,g,R,M,null);Md(S,R)}return null}function y(g,S,E,R){for(var M=null,A=null,I=S,N=S=0,U=null;I!==null&&N<E.length;N++){I.index>N?(U=I,I=null):U=I.sibling;var x=p(g,I,E[N],R);if(x===null){I===null&&(I=U);break}e&&I&&x.alternate===null&&t(g,I),S=i(x,S,N),A===null?M=x:A.sibling=x,A=x,I=U}if(N===E.length)return n(g,I),Qe&&xi(g,N),M;if(I===null){for(;N<E.length;N++)I=f(g,E[N],R),I!==null&&(S=i(I,S,N),A===null?M=I:A.sibling=I,A=I);return Qe&&xi(g,N),M}for(I=r(g,I);N<E.length;N++)U=h(I,g,N,E[N],R),U!==null&&(e&&U.alternate!==null&&I.delete(U.key===null?N:U.key),S=i(U,S,N),A===null?M=U:A.sibling=U,A=U);return e&&I.forEach(function(H){return t(g,H)}),Qe&&xi(g,N),M}function _(g,S,E,R){var M=Pl(E);if(typeof M!="function")throw Error(L(150));if(E=M.call(E),E==null)throw Error(L(151));for(var A=M=null,I=S,N=S=0,U=null,x=E.next();I!==null&&!x.done;N++,x=E.next()){I.index>N?(U=I,I=null):U=I.sibling;var H=p(g,I,x.value,R);if(H===null){I===null&&(I=U);break}e&&I&&H.alternate===null&&t(g,I),S=i(H,S,N),A===null?M=H:A.sibling=H,A=H,I=U}if(x.done)return n(g,I),Qe&&xi(g,N),M;if(I===null){for(;!x.done;N++,x=E.next())x=f(g,x.value,R),x!==null&&(S=i(x,S,N),A===null?M=x:A.sibling=x,A=x);return Qe&&xi(g,N),M}for(I=r(g,I);!x.done;N++,x=E.next())x=h(I,g,N,x.value,R),x!==null&&(e&&x.alternate!==null&&I.delete(x.key===null?N:x.key),S=i(x,S,N),A===null?M=x:A.sibling=x,A=x);return e&&I.forEach(function(j){return t(g,j)}),Qe&&xi(g,N),M}function T(g,S,E,R){if(typeof E=="object"&&E!==null&&E.type===Hs&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case yd:e:{for(var M=E.key,A=S;A!==null;){if(A.key===M){if(M=E.type,M===Hs){if(A.tag===7){n(g,A.sibling),S=o(A,E.props.children),S.return=g,g=S;break e}}else if(A.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===Po&&xw(M)===A.type){n(g,A.sibling),S=o(A,E.props),S.ref=Ul(g,A,E),S.return=g,g=S;break e}n(g,A);break}else t(g,A);A=A.sibling}E.type===Hs?(S=Pi(E.props.children,g.mode,R,E.key),S.return=g,g=S):(R=Gd(E.type,E.key,E.props,null,g.mode,R),R.ref=Ul(g,S,E),R.return=g,g=R)}return s(g);case Bs:e:{for(A=E.key;S!==null;){if(S.key===A)if(S.tag===4&&S.stateNode.containerInfo===E.containerInfo&&S.stateNode.implementation===E.implementation){n(g,S.sibling),S=o(S,E.children||[]),S.return=g,g=S;break e}else{n(g,S);break}else t(g,S);S=S.sibling}S=gg(E,g.mode,R),S.return=g,g=S}return s(g);case Po:return A=E._init,T(g,S,A(E._payload),R)}if(zl(E))return y(g,S,E,R);if(Pl(E))return _(g,S,E,R);Md(g,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,S!==null&&S.tag===6?(n(g,S.sibling),S=o(S,E),S.return=g,g=S):(n(g,S),S=hg(E,g.mode,R),S.return=g,g=S),s(g)):n(g,S)}return T}var sa=X0(!0),Q0=X0(!1),sf=Jo(null),af=null,Ys=null,by=null;function ky(){by=Ys=af=null}function Ny(e){var t=sf.current;Ke(sf),e._currentValue=t}function Vg(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ta(e,t){af=e,by=Ys=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Sn=!0),e.firstContext=null)}function Zn(e){var t=e._currentValue;if(by!==e)if(e={context:e,memoizedValue:t,next:null},Ys===null){if(af===null)throw Error(L(308));Ys=e,af.dependencies={lanes:0,firstContext:e}}else Ys=Ys.next=e;return t}var Ni=null;function Ay(e){Ni===null?Ni=[e]:Ni.push(e)}function Z0(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Ay(t)):(n.next=o.next,o.next=n),t.interleaved=n,co(e,r)}function co(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Lo=!1;function My(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function eC(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 so(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function jo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(xe&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,co(e,n)}return o=r.interleaved,o===null?(t.next=t,Ay(r)):(t.next=o.next,o.next=t),r.interleaved=t,co(e,n)}function Bd(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yy(e,n)}}function bw(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function lf(e,t,n,r){var o=e.updateQueue;Lo=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?i=c:s.next=c,s=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var f=o.baseState;s=0,u=c=l=null,a=i;do{var p=a.lane,h=a.eventTime;if((r&p)===p){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,_=a;switch(p=t,h=n,_.tag){case 1:if(y=_.payload,typeof y=="function"){f=y.call(h,f,p);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=_.payload,p=typeof y=="function"?y.call(h,f,p):y,p==null)break e;f=rt({},f,p);break e;case 2:Lo=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=h,l=f):u=u.next=h,s|=p;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;p=a,a=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(!0);if(u===null&&(l=f),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=u,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Ui|=s,e.lanes=s,e.memoizedState=f}}function kw(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(L(191,o));o.call(r)}}}var vc={},Lr=Jo(vc),dc=Jo(vc),fc=Jo(vc);function Ai(e){if(e===vc)throw Error(L(174));return e}function Py(e,t){switch(Ge(fc,t),Ge(dc,e),Ge(Lr,vc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Rg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Rg(t,e)}Ke(Lr),Ge(Lr,t)}function aa(){Ke(Lr),Ke(dc),Ke(fc)}function tC(e){Ai(fc.current);var t=Ai(Lr.current),n=Rg(t,e.type);t!==n&&(Ge(dc,e),Ge(Lr,n))}function Ly(e){dc.current===e&&(Ke(Lr),Ke(dc))}var tt=Jo(0);function cf(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var cg=[];function Oy(){for(var e=0;e<cg.length;e++)cg[e]._workInProgressVersionPrimary=null;cg.length=0}var Hd=fo.ReactCurrentDispatcher,ug=fo.ReactCurrentBatchConfig,Di=0,nt=null,Tt=null,Rt=null,uf=!1,Jl=!1,pc=0,XD=0;function Vt(){throw Error(L(321))}function Dy(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vr(e[n],t[n]))return!1;return!0}function Uy(e,t,n,r,o,i){if(Di=i,nt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Hd.current=e===null||e.memoizedState===null?tU:nU,e=n(r,o),Jl){i=0;do{if(Jl=!1,pc=0,25<=i)throw Error(L(301));i+=1,Rt=Tt=null,t.updateQueue=null,Hd.current=rU,e=n(r,o)}while(Jl)}if(Hd.current=df,t=Tt!==null&&Tt.next!==null,Di=0,Rt=Tt=nt=null,uf=!1,t)throw Error(L(300));return e}function Fy(){var e=pc!==0;return pc=0,e}function Ar(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?nt.memoizedState=Rt=e:Rt=Rt.next=e,Rt}function er(){if(Tt===null){var e=nt.alternate;e=e!==null?e.memoizedState:null}else e=Tt.next;var t=Rt===null?nt.memoizedState:Rt.next;if(t!==null)Rt=t,Tt=e;else{if(e===null)throw Error(L(310));Tt=e,e={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},Rt===null?nt.memoizedState=Rt=e:Rt=Rt.next=e}return Rt}function mc(e,t){return typeof t=="function"?t(e):t}function dg(e){var t=er(),n=t.queue;if(n===null)throw Error(L(311));n.lastRenderedReducer=e;var r=Tt,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,c=i;do{var u=c.lane;if((Di&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,s=r):l=l.next=f,nt.lanes|=u,Ui|=u}c=c.next}while(c!==null&&c!==i);l===null?s=r:l.next=a,vr(r,t.memoizedState)||(Sn=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,nt.lanes|=i,Ui|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function fg(e){var t=er(),n=t.queue;if(n===null)throw Error(L(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);vr(i,t.memoizedState)||(Sn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function nC(){}function rC(e,t){var n=nt,r=er(),o=t(),i=!vr(r.memoizedState,o);if(i&&(r.memoizedState=o,Sn=!0),r=r.queue,By(sC.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Rt!==null&&Rt.memoizedState.tag&1){if(n.flags|=2048,hc(9,iC.bind(null,n,r,o,t),void 0,null),xt===null)throw Error(L(349));(Di&30)!==0||oC(n,t,o)}return o}function oC(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=nt.updateQueue,t===null?(t={lastEffect:null,stores:null},nt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function iC(e,t,n,r){t.value=n,t.getSnapshot=r,aC(t)&&lC(e)}function sC(e,t,n){return n(function(){aC(t)&&lC(e)})}function aC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vr(e,n)}catch{return!0}}function lC(e){var t=co(e,1);t!==null&&_r(t,e,1,-1)}function Nw(e){var t=Ar();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:mc,lastRenderedState:e},t.queue=e,e=e.dispatch=eU.bind(null,nt,e),[t.memoizedState,e]}function hc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=nt.updateQueue,t===null?(t={lastEffect:null,stores:null},nt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function cC(){return er().memoizedState}function $d(e,t,n,r){var o=Ar();nt.flags|=e,o.memoizedState=hc(1|t,n,void 0,r===void 0?null:r)}function If(e,t,n,r){var o=er();r=r===void 0?null:r;var i=void 0;if(Tt!==null){var s=Tt.memoizedState;if(i=s.destroy,r!==null&&Dy(r,s.deps)){o.memoizedState=hc(t,n,i,r);return}}nt.flags|=e,o.memoizedState=hc(1|t,n,i,r)}function Aw(e,t){return $d(8390656,8,e,t)}function By(e,t){return If(2048,8,e,t)}function uC(e,t){return If(4,2,e,t)}function dC(e,t){return If(4,4,e,t)}function fC(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function pC(e,t,n){return n=n!=null?n.concat([e]):null,If(4,4,fC.bind(null,t,e),n)}function Hy(){}function mC(e,t){var n=er();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Dy(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hC(e,t){var n=er();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Dy(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function gC(e,t,n){return(Di&21)===0?(e.baseState&&(e.baseState=!1,Sn=!0),e.memoizedState=n):(vr(n,t)||(n=E0(),nt.lanes|=n,Ui|=n,e.baseState=!0),t)}function QD(e,t){var n=De;De=n!==0&&4>n?n:4,e(!0);var r=ug.transition;ug.transition={};try{e(!1),t()}finally{De=n,ug.transition=r}}function yC(){return er().memoizedState}function ZD(e,t,n){var r=Go(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},SC(e))_C(t,n);else if(n=Z0(e,t,n,r),n!==null){var o=an();_r(n,e,r,o),vC(n,t,r)}}function eU(e,t,n){var r=Go(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(SC(e))_C(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,vr(a,s)){var l=t.interleaved;l===null?(o.next=o,Ay(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}n=Z0(e,t,o,r),n!==null&&(o=an(),_r(n,e,r,o),vC(n,t,r))}}function SC(e){var t=e.alternate;return e===nt||t!==null&&t===nt}function _C(e,t){Jl=uf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vC(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yy(e,n)}}var df={readContext:Zn,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useInsertionEffect:Vt,useLayoutEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useMutableSource:Vt,useSyncExternalStore:Vt,useId:Vt,unstable_isNewReconciler:!1},tU={readContext:Zn,useCallback:function(e,t){return Ar().memoizedState=[e,t===void 0?null:t],e},useContext:Zn,useEffect:Aw,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$d(4194308,4,fC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $d(4194308,4,e,t)},useInsertionEffect:function(e,t){return $d(4,2,e,t)},useMemo:function(e,t){var n=Ar();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ar();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ZD.bind(null,nt,e),[r.memoizedState,e]},useRef:function(e){var t=Ar();return e={current:e},t.memoizedState=e},useState:Nw,useDebugValue:Hy,useDeferredValue:function(e){return Ar().memoizedState=e},useTransition:function(){var e=Nw(!1),t=e[0];return e=QD.bind(null,e[1]),Ar().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=nt,o=Ar();if(Qe){if(n===void 0)throw Error(L(407));n=n()}else{if(n=t(),xt===null)throw Error(L(349));(Di&30)!==0||oC(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Aw(sC.bind(null,r,i,e),[e]),r.flags|=2048,hc(9,iC.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ar(),t=xt.identifierPrefix;if(Qe){var n=io,r=oo;n=(r&~(1<<32-Sr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=pc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=XD++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},nU={readContext:Zn,useCallback:mC,useContext:Zn,useEffect:By,useImperativeHandle:pC,useInsertionEffect:uC,useLayoutEffect:dC,useMemo:hC,useReducer:dg,useRef:cC,useState:function(){return dg(mc)},useDebugValue:Hy,useDeferredValue:function(e){var t=er();return gC(t,Tt.memoizedState,e)},useTransition:function(){var e=dg(mc)[0],t=er().memoizedState;return[e,t]},useMutableSource:nC,useSyncExternalStore:rC,useId:yC,unstable_isNewReconciler:!1},rU={readContext:Zn,useCallback:mC,useContext:Zn,useEffect:By,useImperativeHandle:pC,useInsertionEffect:uC,useLayoutEffect:dC,useMemo:hC,useReducer:fg,useRef:cC,useState:function(){return fg(mc)},useDebugValue:Hy,useDeferredValue:function(e){var t=er();return Tt===null?t.memoizedState=e:gC(t,Tt.memoizedState,e)},useTransition:function(){var e=fg(mc)[0],t=er().memoizedState;return[e,t]},useMutableSource:nC,useSyncExternalStore:rC,useId:yC,unstable_isNewReconciler:!1};function hr(e,t){if(e&&e.defaultProps){t=rt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function qg(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:rt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var wf={isMounted:function(e){return(e=e._reactInternals)?Hi(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=an(),o=Go(e),i=so(r,o);i.payload=t,n!=null&&(i.callback=n),t=jo(e,i,o),t!==null&&(_r(t,e,o,r),Bd(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=an(),o=Go(e),i=so(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=jo(e,i,o),t!==null&&(_r(t,e,o,r),Bd(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=an(),r=Go(e),o=so(n,r);o.tag=2,t!=null&&(o.callback=t),t=jo(e,o,r),t!==null&&(_r(t,e,r,n),Bd(t,e,r))}};function Mw(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!ac(n,r)||!ac(o,i):!0}function EC(e,t,n){var r=!1,o=Yo,i=t.contextType;return typeof i=="object"&&i!==null?i=Zn(i):(o=vn(t)?Li:Kt.current,r=t.contextTypes,i=(r=r!=null)?oa(e,o):Yo),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=wf,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Pw(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&wf.enqueueReplaceState(t,t.state,null)}function Yg(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},My(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Zn(i):(i=vn(t)?Li:Kt.current,o.context=oa(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(qg(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&wf.enqueueReplaceState(o,o.state,null),lf(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function la(e,t){try{var n="",r=t;do n+=PO(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
7
7
|
Error generating stack: `+i.message+`
|
|
8
|
-
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function dg(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function qg(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var nU=typeof WeakMap=="function"?WeakMap:Map;function vC(e,t,n){n=oo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){df||(df=!0,ry=r),qg(e,t)},n}function EC(e,t,n){n=oo(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){qg(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){qg(e,t),typeof r!="function"&&(Wo===null?Wo=new Set([this]):Wo.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Mw(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new nU;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=gU.bind(null,e,t,n),t.then(e,e))}function Pw(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Lw(e,t,n,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=oo(-1,1),t.tag=2,jo(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var rU=co.ReactCurrentOwner,yn=!1;function rn(e,t,n,r){t.child=e===null?J0(t,null,n,r):oa(t,e.child,n,r)}function Ow(e,t,n,r,o){n=n.render;var i=t.ref;return Zs(t,o),r=Oy(e,t,n,r,i,o),n=Dy(),e!==null&&!yn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,lo(e,t,o)):(Ze&&n&&Iy(t),t.flags|=1,rn(e,t,r,o),t.child)}function Dw(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Vy(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,TC(e,t,i,r,o)):(e=jd(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,(e.lanes&o)===0){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:ic,n(s,r)&&e.ref===t.ref)return lo(e,t,o)}return t.flags|=1,e=Vo(i,r),e.ref=t.ref,e.return=t,t.child=e}function TC(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(ic(i,r)&&e.ref===t.ref)if(yn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)(e.flags&131072)!==0&&(yn=!0);else return t.lanes=e.lanes,lo(e,t,o)}return Yg(e,t,n,r,o)}function IC(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ge(Ys,kn),kn|=n;else{if((n&1073741824)===0)return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ge(Ys,kn),kn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Ge(Ys,kn),kn|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Ge(Ys,kn),kn|=r;return rn(e,t,o,n),t.child}function wC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Yg(e,t,n,r,o){var i=_n(n)?Pi:qt.current;return i=na(t,i),Zs(t,o),n=Oy(e,t,n,r,i,o),r=Dy(),e!==null&&!yn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,lo(e,t,o)):(Ze&&r&&Iy(t),t.flags|=1,rn(e,t,n,o),t.child)}function Uw(e,t,n,r,o){if(_n(n)){var i=!0;ef(t)}else i=!1;if(Zs(t,o),t.stateNode===null)Hd(e,t),_C(t,n,r),Vg(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Zn(c):(c=_n(n)?Pi:qt.current,c=na(t,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&Aw(t,s,r,c),Lo=!1;var p=t.memoizedState;s.state=p,sf(t,r,s,o),l=t.memoizedState,a!==r||p!==l||Sn.current||Lo?(typeof u=="function"&&(Gg(t,n,u,r),l=t.memoizedState),(a=Lo||Nw(t,n,a,r,p,l,c))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=c,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Q0(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:mr(t.type,a),s.props=c,d=t.pendingProps,p=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Zn(l):(l=_n(n)?Pi:qt.current,l=na(t,l));var h=n.getDerivedStateFromProps;(u=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||p!==l)&&Aw(t,s,r,l),Lo=!1,p=t.memoizedState,s.state=p,sf(t,r,s,o);var y=t.memoizedState;a!==d||p!==y||Sn.current||Lo?(typeof h=="function"&&(Gg(t,n,h,r),y=t.memoizedState),(c=Lo||Nw(t,n,c,r,p,y,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),s.props=r,s.state=y,s.context=l,r=c):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Kg(e,t,n,r,i,o)}function Kg(e,t,n,r,o,i){wC(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Tw(t,n,!1),lo(e,t,i);r=t.stateNode,rU.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=oa(t,e.child,null,i),t.child=oa(t,null,a,i)):rn(e,t,a,i),t.memoizedState=r.state,o&&Tw(t,n,!0),t.child}function CC(e){var t=e.stateNode;t.pendingContext?Ew(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ew(e,t.context,!1),Ay(e,t.containerInfo)}function Fw(e,t,n,r,o){return ra(),Cy(o),t.flags|=256,rn(e,t,n,r),t.child}var Jg={dehydrated:null,treeContext:null,retryLane:0};function Xg(e){return{baseLanes:e,cachePool:null,transitions:null}}function RC(e,t,n){var r=t.pendingProps,o=nt.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Ge(nt,o&1),e===null)return jg(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},(r&1)===0&&i!==null?(i.childLanes=0,i.pendingProps=s):i=Cf(s,r,0,null),e=Mi(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Xg(n),t.memoizedState=Jg,e):By(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return oU(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return(s&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Vo(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Vo(a,i):(i=Mi(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?Xg(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Jg,r}return i=e.child,e=i.sibling,r=Vo(i,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function By(e,t){return t=Cf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ad(e,t,n,r){return r!==null&&Cy(r),oa(t,e.child,null,n),e=By(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function oU(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=dg(Error(L(422))),Ad(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Cf({mode:"visible",children:r.children},o,0,null),i=Mi(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,(t.mode&1)!==0&&oa(t,e.child,null,s),t.child.memoizedState=Xg(s),t.memoizedState=Jg,i);if((t.mode&1)===0)return Ad(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(L(419)),r=dg(i,r,void 0),Ad(e,t,s,r)}if(a=(s&e.childLanes)!==0,yn||a){if(r=xt,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|s))!==0?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,ao(e,o),Sr(r,e,o,-1))}return Gy(),r=dg(Error(L(421))),Ad(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=yU.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Nn=zo(o.nextSibling),An=t,Ze=!0,gr=null,e!==null&&(Kn[Jn++]=no,Kn[Jn++]=ro,Kn[Jn++]=Li,no=e.id,ro=e.overflow,Li=t),t=By(t,r.children),t.flags|=4096,t)}function Bw(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wg(e.return,t,n)}function fg(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function xC(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(rn(e,t,r.children,n),r=nt.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Bw(e,n,t);else if(e.tag===19)Bw(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ge(nt,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&af(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),fg(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&af(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}fg(t,!0,n,null,i);break;case"together":fg(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Hd(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function lo(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Di|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(L(153));if(t.child!==null){for(e=t.child,n=Vo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Vo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function iU(e,t,n){switch(t.tag){case 3:CC(t),ra();break;case 5:Z0(t);break;case 1:_n(t.type)&&ef(t);break;case 4:Ay(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Ge(rf,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ge(nt,nt.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?RC(e,t,n):(Ge(nt,nt.current&1),e=lo(e,t,n),e!==null?e.sibling:null);Ge(nt,nt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return xC(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ge(nt,nt.current),r)break;return null;case 22:case 23:return t.lanes=0,IC(e,t,n)}return lo(e,t,n)}var bC,Qg,kC,NC;bC=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Qg=function(){};kC=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Ni(Pr.current);var i=null;switch(n){case"input":o=vg(e,o),r=vg(e,r),i=[];break;case"select":o=ot({},o,{value:void 0}),r=ot({},r,{value:void 0}),i=[];break;case"textarea":o=Ig(e,o),r=Ig(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Qd)}Cg(n,r);var s;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var a=o[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Ql.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=o?.[c],r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Ql.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Ke("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};NC=function(e,t,n,r){n!==r&&(t.flags|=4)};function Dl(e,t){if(!Ze)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Gt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function sU(e,t,n){var r=t.pendingProps;switch(wy(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gt(t),null;case 1:return _n(t.type)&&Zd(),Gt(t),null;case 3:return r=t.stateNode,ia(),Je(Sn),Je(qt),Py(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(kd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,gr!==null&&(sy(gr),gr=null))),Qg(e,t),Gt(t),null;case 5:My(t);var o=Ni(uc.current);if(n=t.type,e!==null&&t.stateNode!=null)kC(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(L(166));return Gt(t),null}if(e=Ni(Pr.current),kd(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Ar]=t,r[lc]=i,e=(t.mode&1)!==0,n){case"dialog":Ke("cancel",r),Ke("close",r);break;case"iframe":case"object":case"embed":Ke("load",r);break;case"video":case"audio":for(o=0;o<zl.length;o++)Ke(zl[o],r);break;case"source":Ke("error",r);break;case"img":case"image":case"link":Ke("error",r),Ke("load",r);break;case"details":Ke("toggle",r);break;case"input":qI(r,i),Ke("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Ke("invalid",r);break;case"textarea":KI(r,i),Ke("invalid",r)}Cg(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&bd(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&bd(r.textContent,a,e),o=["children",""+a]):Ql.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Ke("scroll",r)}switch(n){case"input":gd(r),YI(r,i,!0);break;case"textarea":gd(r),JI(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Qd)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=o0(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Ar]=t,e[lc]=r,bC(e,t,!1,!1),t.stateNode=e;e:{switch(s=Rg(n,r),n){case"dialog":Ke("cancel",e),Ke("close",e),o=r;break;case"iframe":case"object":case"embed":Ke("load",e),o=r;break;case"video":case"audio":for(o=0;o<zl.length;o++)Ke(zl[o],e);o=r;break;case"source":Ke("error",e),o=r;break;case"img":case"image":case"link":Ke("error",e),Ke("load",e),o=r;break;case"details":Ke("toggle",e),o=r;break;case"input":qI(e,r),o=vg(e,r),Ke("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=ot({},r,{value:void 0}),Ke("invalid",e);break;case"textarea":KI(e,r),o=Ig(e,r),Ke("invalid",e);break;default:o=r}Cg(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?a0(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&i0(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Zl(e,l):typeof l=="number"&&Zl(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ql.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Ke("scroll",e):l!=null&&cy(e,i,l,s))}switch(n){case"input":gd(e),YI(e,r,!1);break;case"textarea":gd(e),JI(e);break;case"option":r.value!=null&&e.setAttribute("value",""+qo(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Ks(e,!!r.multiple,i,!1):r.defaultValue!=null&&Ks(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Qd)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Gt(t),null;case 6:if(e&&t.stateNode!=null)NC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(L(166));if(n=Ni(uc.current),Ni(Pr.current),kd(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ar]=t,(i=r.nodeValue!==n)&&(e=An,e!==null))switch(e.tag){case 3:bd(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&bd(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ar]=t,t.stateNode=r}return Gt(t),null;case 13:if(Je(nt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ze&&Nn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Y0(),ra(),t.flags|=98560,i=!1;else if(i=kd(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(L(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(L(317));i[Ar]=t}else ra(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Gt(t),i=!1}else gr!==null&&(sy(gr),gr=null),i=!0;if(!i)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(nt.current&1)!==0?It===0&&(It=3):Gy())),t.updateQueue!==null&&(t.flags|=4),Gt(t),null);case 4:return ia(),Qg(e,t),e===null&&sc(t.stateNode.containerInfo),Gt(t),null;case 10:return by(t.type._context),Gt(t),null;case 17:return _n(t.type)&&Zd(),Gt(t),null;case 19:if(Je(nt),i=t.memoizedState,i===null)return Gt(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Dl(i,!1);else{if(It!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=af(e),s!==null){for(t.flags|=128,Dl(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ge(nt,nt.current&1|2),t.child}e=e.sibling}i.tail!==null&&pt()>aa&&(t.flags|=128,r=!0,Dl(i,!1),t.lanes=4194304)}else{if(!r)if(e=af(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Dl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Ze)return Gt(t),null}else 2*pt()-i.renderingStartTime>aa&&n!==1073741824&&(t.flags|=128,r=!0,Dl(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=pt(),t.sibling=null,n=nt.current,Ge(nt,r?n&1|2:n&1),t):(Gt(t),null);case 22:case 23:return Wy(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(kn&1073741824)!==0&&(Gt(t),t.subtreeFlags&6&&(t.flags|=8192)):Gt(t),null;case 24:return null;case 25:return null}throw Error(L(156,t.tag))}function aU(e,t){switch(wy(t),t.tag){case 1:return _n(t.type)&&Zd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ia(),Je(Sn),Je(qt),Py(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return My(t),null;case 13:if(Je(nt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));ra()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Je(nt),null;case 4:return ia(),null;case 10:return by(t.type._context),null;case 22:case 23:return Wy(),null;case 24:return null;default:return null}}var Md=!1,Vt=!1,lU=typeof WeakSet=="function"?WeakSet:Set,H=null;function qs(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){lt(e,t,r)}else n.current=null}function Zg(e,t,n){try{n()}catch(r){lt(e,t,r)}}var Hw=!1;function cU(e,t){if(Dg=Kd,e=O0(),Ty(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=e,p=null;t:for(;;){for(var h;d!==n||o!==0&&d.nodeType!==3||(a=s+o),d!==i||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)p=d,d=h;for(;;){if(d===e)break t;if(p===n&&++c===o&&(a=s),p===i&&++u===r&&(l=s),(h=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ug={focusedElem:e,selectionRange:n},Kd=!1,H=t;H!==null;)if(t=H,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,H=e;else for(;H!==null;){t=H;try{var y=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var _=y.memoizedProps,T=y.memoizedState,g=t.stateNode,S=g.getSnapshotBeforeUpdate(t.elementType===t.type?_:mr(t.type,_),T);g.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var E=t.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(L(163))}}catch(R){lt(t,t.return,R)}if(e=t.sibling,e!==null){e.return=t.return,H=e;break}H=t.return}return y=Hw,Hw=!1,y}function Kl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Zg(t,n,i)}o=o.next}while(o!==r)}}function If(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ey(e){var t=e.ref;if(t!==null){var n=e.stateNode;e.tag,e=n,typeof t=="function"?t(e):t.current=e}}function AC(e){var t=e.alternate;t!==null&&(e.alternate=null,AC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ar],delete t[lc],delete t[Hg],delete t[GD],delete t[VD])),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 MC(e){return e.tag===5||e.tag===3||e.tag===4}function $w(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||MC(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 ty(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qd));else if(r!==4&&(e=e.child,e!==null))for(ty(e,t,n),e=e.sibling;e!==null;)ty(e,t,n),e=e.sibling}function ny(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ny(e,t,n),e=e.sibling;e!==null;)ny(e,t,n),e=e.sibling}var Mt=null,hr=!1;function Mo(e,t,n){for(n=n.child;n!==null;)PC(e,t,n),n=n.sibling}function PC(e,t,n){if(Mr&&typeof Mr.onCommitFiberUnmount=="function")try{Mr.onCommitFiberUnmount(hf,n)}catch{}switch(n.tag){case 5:Vt||qs(n,t);case 6:var r=Mt,o=hr;Mt=null,Mo(e,t,n),Mt=r,hr=o,Mt!==null&&(hr?(e=Mt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Mt.removeChild(n.stateNode));break;case 18:Mt!==null&&(hr?(e=Mt,n=n.stateNode,e.nodeType===8?ig(e.parentNode,n):e.nodeType===1&&ig(e,n),rc(e)):ig(Mt,n.stateNode));break;case 4:r=Mt,o=hr,Mt=n.stateNode.containerInfo,hr=!0,Mo(e,t,n),Mt=r,hr=o;break;case 0:case 11:case 14:case 15:if(!Vt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&((i&2)!==0||(i&4)!==0)&&Zg(n,t,s),o=o.next}while(o!==r)}Mo(e,t,n);break;case 1:if(!Vt&&(qs(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){lt(n,t,a)}Mo(e,t,n);break;case 21:Mo(e,t,n);break;case 22:n.mode&1?(Vt=(r=Vt)||n.memoizedState!==null,Mo(e,t,n),Vt=r):Mo(e,t,n);break;default:Mo(e,t,n)}}function zw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new lU),t.forEach(function(r){var o=SU.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function pr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:Mt=a.stateNode,hr=!1;break e;case 3:Mt=a.stateNode.containerInfo,hr=!0;break e;case 4:Mt=a.stateNode.containerInfo,hr=!0;break e}a=a.return}if(Mt===null)throw Error(L(160));PC(i,s,o),Mt=null,hr=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(c){lt(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)LC(t,e),t=t.sibling}function LC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(pr(t,e),kr(e),r&4){try{Kl(3,e,e.return),If(3,e)}catch(_){lt(e,e.return,_)}try{Kl(5,e,e.return)}catch(_){lt(e,e.return,_)}}break;case 1:pr(t,e),kr(e),r&512&&n!==null&&qs(n,n.return);break;case 5:if(pr(t,e),kr(e),r&512&&n!==null&&qs(n,n.return),e.flags&32){var o=e.stateNode;try{Zl(o,"")}catch(_){lt(e,e.return,_)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&n0(o,i),Rg(a,s);var c=Rg(a,i);for(s=0;s<l.length;s+=2){var u=l[s],d=l[s+1];u==="style"?a0(o,d):u==="dangerouslySetInnerHTML"?i0(o,d):u==="children"?Zl(o,d):cy(o,u,d,c)}switch(a){case"input":Eg(o,i);break;case"textarea":r0(o,i);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Ks(o,!!i.multiple,h,!1):p!==!!i.multiple&&(i.defaultValue!=null?Ks(o,!!i.multiple,i.defaultValue,!0):Ks(o,!!i.multiple,i.multiple?[]:"",!1))}o[lc]=i}catch(_){lt(e,e.return,_)}}break;case 6:if(pr(t,e),kr(e),r&4){if(e.stateNode===null)throw Error(L(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(_){lt(e,e.return,_)}}break;case 3:if(pr(t,e),kr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{rc(t.containerInfo)}catch(_){lt(e,e.return,_)}break;case 4:pr(t,e),kr(e);break;case 13:pr(t,e),kr(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(zy=pt())),r&4&&zw(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(Vt=(c=Vt)||u,pr(t,e),Vt=c):pr(t,e),kr(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&(e.mode&1)!==0)for(H=e,u=e.child;u!==null;){for(d=H=u;H!==null;){switch(p=H,h=p.child,p.tag){case 0:case 11:case 14:case 15:Kl(4,p,p.return);break;case 1:qs(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(_){lt(r,n,_)}}break;case 5:qs(p,p.return);break;case 22:if(p.memoizedState!==null){Ww(d);continue}}h!==null?(h.return=p,H=h):Ww(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{o=d.stateNode,c?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=s0("display",s))}catch(_){lt(e,e.return,_)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(_){lt(e,e.return,_)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:pr(t,e),kr(e),r&4&&zw(e);break;case 21:break;default:pr(t,e),kr(e)}}function kr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(MC(n)){var r=n;break e}n=n.return}throw Error(L(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Zl(o,""),r.flags&=-33);var i=$w(e);ny(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=$w(e);ty(e,a,s);break;default:throw Error(L(161))}}catch(l){lt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function uU(e,t,n){H=e,OC(e,t,n)}function OC(e,t,n){for(var r=(e.mode&1)!==0;H!==null;){var o=H,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Md;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||Vt;a=Md;var c=Vt;if(Md=s,(Vt=l)&&!c)for(H=o;H!==null;)s=H,l=s.child,s.tag===22&&s.memoizedState!==null?Gw(o):l!==null?(l.return=s,H=l):Gw(o);for(;i!==null;)H=i,OC(i,t,n),i=i.sibling;H=o,Md=a,Vt=c}jw(e,t,n)}else(o.subtreeFlags&8772)!==0&&i!==null?(i.return=o,H=i):jw(e,t,n)}}function jw(e){for(;H!==null;){var t=H;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Vt||If(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Vt)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:mr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&xw(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}xw(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&rc(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(L(163))}Vt||t.flags&512&&ey(t)}catch(p){lt(t,t.return,p)}}if(t===e){H=null;break}if(n=t.sibling,n!==null){n.return=t.return,H=n;break}H=t.return}}function Ww(e){for(;H!==null;){var t=H;if(t===e){H=null;break}var n=t.sibling;if(n!==null){n.return=t.return,H=n;break}H=t.return}}function Gw(e){for(;H!==null;){var t=H;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{If(4,t)}catch(l){lt(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){lt(t,o,l)}}var i=t.return;try{ey(t)}catch(l){lt(t,i,l)}break;case 5:var s=t.return;try{ey(t)}catch(l){lt(t,s,l)}}}catch(l){lt(t,t.return,l)}if(t===e){H=null;break}var a=t.sibling;if(a!==null){a.return=t.return,H=a;break}H=t.return}}var dU=Math.ceil,uf=co.ReactCurrentDispatcher,Hy=co.ReactCurrentOwner,Qn=co.ReactCurrentBatchConfig,xe=0,xt=null,yt=null,Pt=0,kn=0,Ys=Jo(0),It=0,mc=null,Di=0,wf=0,$y=0,Jl=null,gn=null,zy=0,aa=1/0,eo=null,df=!1,ry=null,Wo=null,Pd=!1,Fo=null,ff=0,Xl=0,oy=null,$d=-1,zd=0;function on(){return(xe&6)!==0?pt():$d!==-1?$d:$d=pt()}function Go(e){return(e.mode&1)===0?1:(xe&2)!==0&&Pt!==0?Pt&-Pt:YD.transition!==null?(zd===0&&(zd=_0()),zd):(e=De,e!==0||(e=window.event,e=e===void 0?16:R0(e.type)),e)}function Sr(e,t,n,r){if(50<Xl)throw Xl=0,oy=null,Error(L(185));hc(e,n,r),((xe&2)===0||e!==xt)&&(e===xt&&((xe&2)===0&&(wf|=n),It===4&&Do(e,Pt)),vn(e,r),n===1&&xe===0&&(t.mode&1)===0&&(aa=pt()+500,vf&&Xo()))}function vn(e,t){var n=e.callbackNode;JO(e,t);var r=Yd(e,e===xt?Pt:0);if(r===0)n!==null&&ZI(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&ZI(n),t===1)e.tag===0?qD(Vw.bind(null,e)):G0(Vw.bind(null,e)),jD(function(){(xe&6)===0&&Xo()}),n=null;else{switch(v0(r)){case 1:n=my;break;case 4:n=y0;break;case 16:n=qd;break;case 536870912:n=S0;break;default:n=qd}n=jC(n,DC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function DC(e,t){if($d=-1,zd=0,(xe&6)!==0)throw Error(L(327));var n=e.callbackNode;if(ea()&&e.callbackNode!==n)return null;var r=Yd(e,e===xt?Pt:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=pf(e,r);else{t=r;var o=xe;xe|=2;var i=FC();(xt!==e||Pt!==t)&&(eo=null,aa=pt()+500,Ai(e,t));do try{mU();break}catch(a){UC(e,a)}while(!0);xy(),uf.current=i,xe=o,yt!==null?t=0:(xt=null,Pt=0,t=It)}if(t!==0){if(t===2&&(o=Ag(e),o!==0&&(r=o,t=iy(e,o))),t===1)throw n=mc,Ai(e,0),Do(e,r),vn(e,pt()),n;if(t===6)Do(e,r);else{if(o=e.current.alternate,(r&30)===0&&!fU(o)&&(t=pf(e,r),t===2&&(i=Ag(e),i!==0&&(r=i,t=iy(e,i))),t===1))throw n=mc,Ai(e,0),Do(e,r),vn(e,pt()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(L(345));case 2:xi(e,gn,eo);break;case 3:if(Do(e,r),(r&130023424)===r&&(t=zy+500-pt(),10<t)){if(Yd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){on(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Bg(xi.bind(null,e,gn,eo),t);break}xi(e,gn,eo);break;case 4:if(Do(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-yr(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=pt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*dU(r/1960))-r,10<r){e.timeoutHandle=Bg(xi.bind(null,e,gn,eo),r);break}xi(e,gn,eo);break;case 5:xi(e,gn,eo);break;default:throw Error(L(329))}}}return vn(e,pt()),e.callbackNode===n?DC.bind(null,e):null}function iy(e,t){var n=Jl;return e.current.memoizedState.isDehydrated&&(Ai(e,t).flags|=256),e=pf(e,t),e!==2&&(t=gn,gn=n,t!==null&&sy(t)),e}function sy(e){gn===null?gn=e:gn.push.apply(gn,e)}function fU(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!_r(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Do(e,t){for(t&=~$y,t&=~wf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-yr(t),r=1<<n;e[n]=-1,t&=~r}}function Vw(e){if((xe&6)!==0)throw Error(L(327));ea();var t=Yd(e,0);if((t&1)===0)return vn(e,pt()),null;var n=pf(e,t);if(e.tag!==0&&n===2){var r=Ag(e);r!==0&&(t=r,n=iy(e,r))}if(n===1)throw n=mc,Ai(e,0),Do(e,t),vn(e,pt()),n;if(n===6)throw Error(L(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,xi(e,gn,eo),vn(e,pt()),null}function jy(e,t){var n=xe;xe|=1;try{return e(t)}finally{xe=n,xe===0&&(aa=pt()+500,vf&&Xo())}}function Ui(e){Fo!==null&&Fo.tag===0&&(xe&6)===0&&ea();var t=xe;xe|=1;var n=Qn.transition,r=De;try{if(Qn.transition=null,De=1,e)return e()}finally{De=r,Qn.transition=n,xe=t,(xe&6)===0&&Xo()}}function Wy(){kn=Ys.current,Je(Ys)}function Ai(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,zD(n)),yt!==null)for(n=yt.return;n!==null;){var r=n;switch(wy(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Zd();break;case 3:ia(),Je(Sn),Je(qt),Py();break;case 5:My(r);break;case 4:ia();break;case 13:Je(nt);break;case 19:Je(nt);break;case 10:by(r.type._context);break;case 22:case 23:Wy()}n=n.return}if(xt=e,yt=e=Vo(e.current,null),Pt=kn=t,It=0,mc=null,$y=wf=Di=0,gn=Jl=null,ki!==null){for(t=0;t<ki.length;t++)if(n=ki[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}ki=null}return e}function UC(e,t){do{var n=yt;try{if(xy(),Fd.current=cf,lf){for(var r=rt.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}lf=!1}if(Oi=0,Rt=Tt=rt=null,Yl=!1,dc=0,Hy.current=null,n===null||n.return===null){It=1,mc=t,yt=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=Pt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if((u.mode&1)===0&&(d===0||d===11||d===15)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var h=Pw(s);if(h!==null){h.flags&=-257,Lw(h,s,a,i,t),h.mode&1&&Mw(i,c,t),t=h,l=c;var y=t.updateQueue;if(y===null){var _=new Set;_.add(l),t.updateQueue=_}else y.add(l);break e}else{if((t&1)===0){Mw(i,c,t),Gy();break e}l=Error(L(426))}}else if(Ze&&a.mode&1){var T=Pw(s);if(T!==null){(T.flags&65536)===0&&(T.flags|=256),Lw(T,s,a,i,t),Cy(sa(l,a));break e}}i=l=sa(l,a),It!==4&&(It=2),Jl===null?Jl=[i]:Jl.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=vC(i,l,t);Rw(i,g);break e;case 1:a=l;var S=i.type,E=i.stateNode;if((i.flags&128)===0&&(typeof S.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Wo===null||!Wo.has(E)))){i.flags|=65536,t&=-t,i.lanes|=t;var R=EC(i,a,t);Rw(i,R);break e}}i=i.return}while(i!==null)}HC(n)}catch(M){t=M,yt===n&&n!==null&&(yt=n=n.return);continue}break}while(!0)}function FC(){var e=uf.current;return uf.current=cf,e===null?cf:e}function Gy(){(It===0||It===3||It===2)&&(It=4),xt===null||(Di&268435455)===0&&(wf&268435455)===0||Do(xt,Pt)}function pf(e,t){var n=xe;xe|=2;var r=FC();(xt!==e||Pt!==t)&&(eo=null,Ai(e,t));do try{pU();break}catch(o){UC(e,o)}while(!0);if(xy(),xe=n,uf.current=r,yt!==null)throw Error(L(261));return xt=null,Pt=0,It}function pU(){for(;yt!==null;)BC(yt)}function mU(){for(;yt!==null&&!$O();)BC(yt)}function BC(e){var t=zC(e.alternate,e,kn);e.memoizedProps=e.pendingProps,t===null?HC(e):yt=t,Hy.current=null}function HC(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=sU(n,t,kn),n!==null){yt=n;return}}else{if(n=aU(n,t),n!==null){n.flags&=32767,yt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{It=6,yt=null;return}}if(t=t.sibling,t!==null){yt=t;return}yt=t=e}while(t!==null);It===0&&(It=5)}function xi(e,t,n){var r=De,o=Qn.transition;try{Qn.transition=null,De=1,hU(e,t,n,r)}finally{Qn.transition=o,De=r}return null}function hU(e,t,n,r){do ea();while(Fo!==null);if((xe&6)!==0)throw Error(L(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(L(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(XO(e,i),e===xt&&(yt=xt=null,Pt=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Pd||(Pd=!0,jC(qd,function(){return ea(),null})),i=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||i){i=Qn.transition,Qn.transition=null;var s=De;De=1;var a=xe;xe|=4,Hy.current=null,cU(e,n),LC(n,e),UD(Ug),Kd=!!Dg,Ug=Dg=null,e.current=n,uU(n,e,o),zO(),xe=a,De=s,Qn.transition=i}else e.current=n;if(Pd&&(Pd=!1,Fo=e,ff=o),i=e.pendingLanes,i===0&&(Wo=null),GO(n.stateNode,r),vn(e,pt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(df)throw df=!1,e=ry,ry=null,e;return(ff&1)!==0&&e.tag!==0&&ea(),i=e.pendingLanes,(i&1)!==0?e===oy?Xl++:(Xl=0,oy=e):Xl=0,Xo(),null}function ea(){if(Fo!==null){var e=v0(ff),t=Qn.transition,n=De;try{if(Qn.transition=null,De=16>e?16:e,Fo===null)var r=!1;else{if(e=Fo,Fo=null,ff=0,(xe&6)!==0)throw Error(L(331));var o=xe;for(xe|=4,H=e.current;H!==null;){var i=H,s=i.child;if((H.flags&16)!==0){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(H=c;H!==null;){var u=H;switch(u.tag){case 0:case 11:case 15:Kl(8,u,i)}var d=u.child;if(d!==null)d.return=u,H=d;else for(;H!==null;){u=H;var p=u.sibling,h=u.return;if(AC(u),u===c){H=null;break}if(p!==null){p.return=h,H=p;break}H=h}}}var y=i.alternate;if(y!==null){var _=y.child;if(_!==null){y.child=null;do{var T=_.sibling;_.sibling=null,_=T}while(_!==null)}}H=i}}if((i.subtreeFlags&2064)!==0&&s!==null)s.return=i,H=s;else e:for(;H!==null;){if(i=H,(i.flags&2048)!==0)switch(i.tag){case 0:case 11:case 15:Kl(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,H=g;break e}H=i.return}}var S=e.current;for(H=S;H!==null;){s=H;var E=s.child;if((s.subtreeFlags&2064)!==0&&E!==null)E.return=s,H=E;else e:for(s=S;H!==null;){if(a=H,(a.flags&2048)!==0)try{switch(a.tag){case 0:case 11:case 15:If(9,a)}}catch(M){lt(a,a.return,M)}if(a===s){H=null;break e}var R=a.sibling;if(R!==null){R.return=a.return,H=R;break e}H=a.return}}if(xe=o,Xo(),Mr&&typeof Mr.onPostCommitFiberRoot=="function")try{Mr.onPostCommitFiberRoot(hf,e)}catch{}r=!0}return r}finally{De=n,Qn.transition=t}}return!1}function qw(e,t,n){t=sa(n,t),t=vC(e,t,1),e=jo(e,t,1),t=on(),e!==null&&(hc(e,1,t),vn(e,t))}function lt(e,t,n){if(e.tag===3)qw(e,e,n);else for(;t!==null;){if(t.tag===3){qw(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Wo===null||!Wo.has(r))){e=sa(n,e),e=EC(t,e,1),t=jo(t,e,1),e=on(),t!==null&&(hc(t,1,e),vn(t,e));break}}t=t.return}}function gU(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=on(),e.pingedLanes|=e.suspendedLanes&n,xt===e&&(Pt&n)===n&&(It===4||It===3&&(Pt&130023424)===Pt&&500>pt()-zy?Ai(e,0):$y|=n),vn(e,t)}function $C(e,t){t===0&&((e.mode&1)===0?t=1:(t=_d,_d<<=1,(_d&130023424)===0&&(_d=4194304)));var n=on();e=ao(e,t),e!==null&&(hc(e,t,n),vn(e,n))}function yU(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$C(e,n)}function SU(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(L(314))}r!==null&&r.delete(t),$C(e,n)}var zC;zC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Sn.current)yn=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return yn=!1,iU(e,t,n);yn=(e.flags&131072)!==0}else yn=!1,Ze&&(t.flags&1048576)!==0&&V0(t,nf,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Hd(e,t),e=t.pendingProps;var o=na(t,qt.current);Zs(t,n),o=Oy(null,t,r,e,o,n);var i=Dy();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,_n(r)?(i=!0,ef(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Ny(t),o.updater=Tf,t.stateNode=o,o._reactInternals=t,Vg(t,r,e,n),t=Kg(null,t,r,!0,i,n)):(t.tag=0,Ze&&i&&Iy(t),rn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Hd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=vU(r),e=mr(r,e),o){case 0:t=Yg(null,t,r,e,n);break e;case 1:t=Uw(null,t,r,e,n);break e;case 11:t=Ow(null,t,r,e,n);break e;case 14:t=Dw(null,t,r,mr(r.type,e),n);break e}throw Error(L(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:mr(r,o),Yg(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:mr(r,o),Uw(e,t,r,o,n);case 3:e:{if(CC(t),e===null)throw Error(L(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Q0(e,t),sf(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=sa(Error(L(423)),t),t=Fw(e,t,r,n,o);break e}else if(r!==o){o=sa(Error(L(424)),t),t=Fw(e,t,r,n,o);break e}else for(Nn=zo(t.stateNode.containerInfo.firstChild),An=t,Ze=!0,gr=null,n=J0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ra(),r===o){t=lo(e,t,n);break e}rn(e,t,r,n)}t=t.child}return t;case 5:return Z0(t),e===null&&jg(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Fg(r,o)?s=null:i!==null&&Fg(r,i)&&(t.flags|=32),wC(e,t),rn(e,t,s,n),t.child;case 6:return e===null&&jg(t),null;case 13:return RC(e,t,n);case 4:return Ay(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=oa(t,null,r,n):rn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:mr(r,o),Ow(e,t,r,o,n);case 7:return rn(e,t,t.pendingProps,n),t.child;case 8:return rn(e,t,t.pendingProps.children,n),t.child;case 12:return rn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Ge(rf,r._currentValue),r._currentValue=s,i!==null)if(_r(i.value,s)){if(i.children===o.children&&!Sn.current){t=lo(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=oo(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Wg(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(L(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Wg(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}rn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Zs(t,n),o=Zn(o),r=r(o),t.flags|=1,rn(e,t,r,n),t.child;case 14:return r=t.type,o=mr(r,t.pendingProps),o=mr(r.type,o),Dw(e,t,r,o,n);case 15:return TC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:mr(r,o),Hd(e,t),t.tag=1,_n(r)?(e=!0,ef(t)):e=!1,Zs(t,n),_C(t,r,o),Vg(t,r,o,n),Kg(null,t,r,!0,e,n);case 19:return xC(e,t,n);case 22:return IC(e,t,n)}throw Error(L(156,t.tag))};function jC(e,t){return g0(e,t)}function _U(e,t,n,r){this.tag=e,this.key=n,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(e,t,n,r){return new _U(e,t,n,r)}function Vy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function vU(e){if(typeof e=="function")return Vy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===dy)return 11;if(e===fy)return 14}return 2}function Vo(e,t){var n=e.alternate;return n===null?(n=Xn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function jd(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Vy(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Fs:return Mi(n.children,o,i,t);case uy:s=8,o|=8;break;case gg:return e=Xn(12,n,t,o|2),e.elementType=gg,e.lanes=i,e;case yg:return e=Xn(13,n,t,o),e.elementType=yg,e.lanes=i,e;case Sg:return e=Xn(19,n,t,o),e.elementType=Sg,e.lanes=i,e;case Zw:return Cf(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Xw:s=10;break e;case Qw:s=9;break e;case dy:s=11;break e;case fy:s=14;break e;case Po:s=16,r=null;break e}throw Error(L(130,e==null?e:typeof e,""))}return t=Xn(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Mi(e,t,n,r){return e=Xn(7,e,r,t),e.lanes=n,e}function Cf(e,t,n,r){return e=Xn(22,e,r,t),e.elementType=Zw,e.lanes=n,e.stateNode={isHidden:!1},e}function pg(e,t,n){return e=Xn(6,e,null,t),e.lanes=n,e}function mg(e,t,n){return t=Xn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function EU(e,t,n,r,o){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=Xh(0),this.expirationTimes=Xh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xh(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function qy(e,t,n,r,o,i,s,a,l){return e=new EU(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Xn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ny(i),e}function TU(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Us,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function WC(e){if(!e)return Yo;e=e._reactInternals;e:{if(Bi(e)!==e||e.tag!==1)throw Error(L(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(_n(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(L(171))}if(e.tag===1){var n=e.type;if(_n(n))return W0(e,n,t)}return t}function GC(e,t,n,r,o,i,s,a,l){return e=qy(n,r,!0,e,o,i,s,a,l),e.context=WC(null),n=e.current,r=on(),o=Go(n),i=oo(r,o),i.callback=t??null,jo(n,i,o),e.current.lanes=o,hc(e,o,r),vn(e,r),e}function Rf(e,t,n,r){var o=t.current,i=on(),s=Go(o);return n=WC(n),t.context===null?t.context=n:t.pendingContext=n,t=oo(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=jo(o,t,s),e!==null&&(Sr(e,o,s,i),Ud(e,o,s)),s}function mf(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Yw(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Yy(e,t){Yw(e,t),(e=e.alternate)&&Yw(e,t)}function IU(){return null}var VC=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ky(e){this._internalRoot=e}xf.prototype.render=Ky.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(L(409));Rf(e,t,null,null)};xf.prototype.unmount=Ky.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ui(function(){Rf(null,e,null,null)}),t[so]=null}};function xf(e){this._internalRoot=e}xf.prototype.unstable_scheduleHydration=function(e){if(e){var t=I0();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Oo.length&&t!==0&&t<Oo[n].priority;n++);Oo.splice(n,0,e),n===0&&C0(e)}};function Jy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function bf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Kw(){}function wU(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=mf(s);i.call(c)}}var s=GC(t,r,e,0,null,!1,!1,"",Kw);return e._reactRootContainer=s,e[so]=s.current,sc(e.nodeType===8?e.parentNode:e),Ui(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=mf(l);a.call(c)}}var l=qy(e,0,!1,null,null,!1,!1,"",Kw);return e._reactRootContainer=l,e[so]=l.current,sc(e.nodeType===8?e.parentNode:e),Ui(function(){Rf(t,l,n,r)}),l}function kf(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=mf(s);a.call(l)}}Rf(t,s,e,o)}else s=wU(n,t,e,o,r);return mf(s)}E0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=$l(t.pendingLanes);n!==0&&(hy(t,n|1),vn(t,pt()),(xe&6)===0&&(aa=pt()+500,Xo()))}break;case 13:Ui(function(){var r=ao(e,1);if(r!==null){var o=on();Sr(r,e,1,o)}}),Yy(e,1)}};gy=function(e){if(e.tag===13){var t=ao(e,134217728);if(t!==null){var n=on();Sr(t,e,134217728,n)}Yy(e,134217728)}};T0=function(e){if(e.tag===13){var t=Go(e),n=ao(e,t);if(n!==null){var r=on();Sr(n,e,t,r)}Yy(e,t)}};I0=function(){return De};w0=function(e,t){var n=De;try{return De=e,t()}finally{De=n}};bg=function(e,t,n){switch(t){case"input":if(Eg(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=_f(r);if(!o)throw Error(L(90));t0(r),Eg(r,o)}}}break;case"textarea":r0(e,n);break;case"select":t=n.value,t!=null&&Ks(e,!!n.multiple,t,!1)}};u0=jy;d0=Ui;var CU={usingClientEntryPoint:!1,Events:[yc,zs,_f,l0,c0,jy]},Ul={findFiberByHostInstance:bi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},RU={bundleType:Ul.bundleType,version:Ul.version,rendererPackageName:Ul.rendererPackageName,rendererConfig:Ul.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:co.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=m0(e),e===null?null:e.stateNode},findFiberByHostInstance:Ul.findFiberByHostInstance||IU,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Fl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Fl.isDisabled&&Fl.supportsFiber))try{hf=Fl.inject(RU),Mr=Fl}catch{}var Fl;Ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=CU;Ln.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Jy(t))throw Error(L(200));return TU(e,t,null,n)};Ln.createRoot=function(e,t){if(!Jy(e))throw Error(L(299));var n=!1,r="",o=VC;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=qy(e,1,!1,null,null,n,!1,r,o),e[so]=t.current,sc(e.nodeType===8?e.parentNode:e),new Ky(t)};Ln.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(L(188)):(e=Object.keys(e).join(","),Error(L(268,e)));return e=m0(t),e=e===null?null:e.stateNode,e};Ln.flushSync=function(e){return Ui(e)};Ln.hydrate=function(e,t,n){if(!bf(t))throw Error(L(200));return kf(null,e,t,!0,n)};Ln.hydrateRoot=function(e,t,n){if(!Jy(e))throw Error(L(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=VC;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=GC(t,null,e,1,n??null,o,!1,i,s),e[so]=t.current,sc(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new xf(t)};Ln.render=function(e,t,n){if(!bf(t))throw Error(L(200));return kf(null,e,t,!1,n)};Ln.unmountComponentAtNode=function(e){if(!bf(e))throw Error(L(40));return e._reactRootContainer?(Ui(function(){kf(null,null,e,!1,function(){e._reactRootContainer=null,e[so]=null})}),!0):!1};Ln.unstable_batchedUpdates=jy;Ln.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!bf(n))throw Error(L(200));if(e==null||e._reactInternals===void 0)throw Error(L(38));return kf(e,t,n,!1,r)};Ln.version="18.3.1-next-f1338f8080-20240426"});var Nf=Ur((BY,KC)=>{"use strict";function YC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(YC)}catch(e){console.error(e)}}YC(),KC.exports=qC()});var XC=Ur(Xy=>{"use strict";var JC=Nf();Xy.createRoot=JC.createRoot,Xy.hydrateRoot=JC.hydrateRoot;var HY});var lR=Ur(Pf=>{"use strict";var DU=Qr(),UU=Symbol.for("react.element"),FU=Symbol.for("react.fragment"),BU=Object.prototype.hasOwnProperty,HU=DU.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,$U={key:!0,ref:!0,__self:!0,__source:!0};function aR(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)BU.call(t,r)&&!$U.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:UU,type:e,key:i,ref:s,props:o,_owner:HU.current}}Pf.Fragment=FU;Pf.jsx=aR;Pf.jsxs=aR});var vc=Ur((JY,cR)=>{"use strict";cR.exports=lR()});var O=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var V=globalThis;var vr="10.56.0";function wn(){return Zo(V),V}function Zo(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||vr,t[vr]=t[vr]||{}}function nr(e,t,n=V){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[vr]=r[vr]||{};return o[e]||(o[e]=t())}var Cc=["debug","info","warn","error","log","assert","trace"],Nx="Sentry Logger ",ei={};function bt(e){if(!("console"in V))return e();let t=V.console,n={},r=Object.keys(ei);r.forEach(o=>{let i=ei[o];n[o]=t[o],t[o]=i});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function Ax(){op().enabled=!0}function Mx(){op().enabled=!1}function MS(){return op().enabled}function Px(...e){rp("log",...e)}function Lx(...e){rp("warn",...e)}function Ox(...e){rp("error",...e)}function rp(e,...t){O&&MS()&&bt(()=>{V.console[e](`${Nx}[${e}]:`,...t)})}function op(){return O?nr("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var C={enable:Ax,disable:Mx,isEnabled:MS,log:Px,warn:Lx,error:Ox};var PS=/\(error: (.*)\)/,LS=/captureMessage|captureException/;function ga(...e){let t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{let i=[],s=n.split(`
|
|
9
|
-
`);for(let a=r;a<s.length;a++){let l=s[a];l.length>1024&&(l=l.slice(0,1024));let c=
|
|
8
|
+
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function pg(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Kg(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var oU=typeof WeakMap=="function"?WeakMap:Map;function TC(e,t,n){n=so(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){pf||(pf=!0,iy=r),Kg(e,t)},n}function IC(e,t,n){n=so(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Kg(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Kg(e,t),typeof r!="function"&&(Wo===null?Wo=new Set([this]):Wo.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Lw(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new oU;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=SU.bind(null,e,t,n),t.then(e,e))}function Ow(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Dw(e,t,n,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=so(-1,1),t.tag=2,jo(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var iU=fo.ReactCurrentOwner,Sn=!1;function sn(e,t,n,r){t.child=e===null?Q0(t,null,n,r):sa(t,e.child,n,r)}function Uw(e,t,n,r,o){n=n.render;var i=t.ref;return ta(t,o),r=Uy(e,t,n,r,i,o),n=Fy(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,uo(e,t,o)):(Qe&&n&&Cy(t),t.flags|=1,sn(e,t,r,o),t.child)}function Fw(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Yy(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,wC(e,t,i,r,o)):(e=Gd(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,(e.lanes&o)===0){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:ac,n(s,r)&&e.ref===t.ref)return uo(e,t,o)}return t.flags|=1,e=Vo(i,r),e.ref=t.ref,e.return=t,t.child=e}function wC(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(ac(i,r)&&e.ref===t.ref)if(Sn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)(e.flags&131072)!==0&&(Sn=!0);else return t.lanes=e.lanes,uo(e,t,o)}return Jg(e,t,n,r,o)}function CC(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ge(Js,An),An|=n;else{if((n&1073741824)===0)return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ge(Js,An),An|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Ge(Js,An),An|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Ge(Js,An),An|=r;return sn(e,t,o,n),t.child}function RC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Jg(e,t,n,r,o){var i=vn(n)?Li:Kt.current;return i=oa(t,i),ta(t,o),n=Uy(e,t,n,r,i,o),r=Fy(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,uo(e,t,o)):(Qe&&r&&Cy(t),t.flags|=1,sn(e,t,n,o),t.child)}function Bw(e,t,n,r,o){if(vn(n)){var i=!0;nf(t)}else i=!1;if(ta(t,o),t.stateNode===null)zd(e,t),EC(t,n,r),Yg(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Zn(c):(c=vn(n)?Li:Kt.current,c=oa(t,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&Pw(t,s,r,c),Lo=!1;var p=t.memoizedState;s.state=p,lf(t,r,s,o),l=t.memoizedState,a!==r||p!==l||_n.current||Lo?(typeof u=="function"&&(qg(t,n,u,r),l=t.memoizedState),(a=Lo||Mw(t,n,a,r,p,l,c))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=c,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,eC(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:hr(t.type,a),s.props=c,f=t.pendingProps,p=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Zn(l):(l=vn(n)?Li:Kt.current,l=oa(t,l));var h=n.getDerivedStateFromProps;(u=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||p!==l)&&Pw(t,s,r,l),Lo=!1,p=t.memoizedState,s.state=p,lf(t,r,s,o);var y=t.memoizedState;a!==f||p!==y||_n.current||Lo?(typeof h=="function"&&(qg(t,n,h,r),y=t.memoizedState),(c=Lo||Mw(t,n,c,r,p,y,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),s.props=r,s.state=y,s.context=l,r=c):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Xg(e,t,n,r,i,o)}function Xg(e,t,n,r,o,i){RC(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&ww(t,n,!1),uo(e,t,i);r=t.stateNode,iU.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=sa(t,e.child,null,i),t.child=sa(t,null,a,i)):sn(e,t,a,i),t.memoizedState=r.state,o&&ww(t,n,!0),t.child}function xC(e){var t=e.stateNode;t.pendingContext?Iw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Iw(e,t.context,!1),Py(e,t.containerInfo)}function Hw(e,t,n,r,o){return ia(),xy(o),t.flags|=256,sn(e,t,n,r),t.child}var Qg={dehydrated:null,treeContext:null,retryLane:0};function Zg(e){return{baseLanes:e,cachePool:null,transitions:null}}function bC(e,t,n){var r=t.pendingProps,o=tt.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Ge(tt,o&1),e===null)return Gg(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},(r&1)===0&&i!==null?(i.childLanes=0,i.pendingProps=s):i=xf(s,r,0,null),e=Pi(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Zg(n),t.memoizedState=Qg,e):$y(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return sU(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return(s&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Vo(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Vo(a,i):(i=Pi(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?Zg(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Qg,r}return i=e.child,e=i.sibling,r=Vo(i,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function $y(e,t){return t=xf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Pd(e,t,n,r){return r!==null&&xy(r),sa(t,e.child,null,n),e=$y(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sU(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=pg(Error(L(422))),Pd(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=xf({mode:"visible",children:r.children},o,0,null),i=Pi(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,(t.mode&1)!==0&&sa(t,e.child,null,s),t.child.memoizedState=Zg(s),t.memoizedState=Qg,i);if((t.mode&1)===0)return Pd(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(L(419)),r=pg(i,r,void 0),Pd(e,t,s,r)}if(a=(s&e.childLanes)!==0,Sn||a){if(r=xt,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|s))!==0?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,co(e,o),_r(r,e,o,-1))}return qy(),r=pg(Error(L(421))),Pd(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=_U.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Mn=zo(o.nextSibling),Pn=t,Qe=!0,yr=null,e!==null&&(Kn[Jn++]=oo,Kn[Jn++]=io,Kn[Jn++]=Oi,oo=e.id,io=e.overflow,Oi=t),t=$y(t,r.children),t.flags|=4096,t)}function $w(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Vg(e.return,t,n)}function mg(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function kC(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(sn(e,t,r.children,n),r=tt.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$w(e,n,t);else if(e.tag===19)$w(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ge(tt,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&cf(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),mg(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&cf(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}mg(t,!0,n,null,i);break;case"together":mg(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function zd(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function uo(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ui|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(L(153));if(t.child!==null){for(e=t.child,n=Vo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Vo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function aU(e,t,n){switch(t.tag){case 3:xC(t),ia();break;case 5:tC(t);break;case 1:vn(t.type)&&nf(t);break;case 4:Py(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Ge(sf,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ge(tt,tt.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?bC(e,t,n):(Ge(tt,tt.current&1),e=uo(e,t,n),e!==null?e.sibling:null);Ge(tt,tt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return kC(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ge(tt,tt.current),r)break;return null;case 22:case 23:return t.lanes=0,CC(e,t,n)}return uo(e,t,n)}var NC,ey,AC,MC;NC=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ey=function(){};AC=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Ai(Lr.current);var i=null;switch(n){case"input":o=Tg(e,o),r=Tg(e,r),i=[];break;case"select":o=rt({},o,{value:void 0}),r=rt({},r,{value:void 0}),i=[];break;case"textarea":o=Cg(e,o),r=Cg(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ef)}xg(n,r);var s;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var a=o[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ec.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=o?.[c],r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ec.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Ye("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};MC=function(e,t,n,r){n!==r&&(t.flags|=4)};function Fl(e,t){if(!Qe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function qt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function lU(e,t,n){var r=t.pendingProps;switch(Ry(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qt(t),null;case 1:return vn(t.type)&&tf(),qt(t),null;case 3:return r=t.stateNode,aa(),Ke(_n),Ke(Kt),Oy(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ad(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,yr!==null&&(ly(yr),yr=null))),ey(e,t),qt(t),null;case 5:Ly(t);var o=Ai(fc.current);if(n=t.type,e!==null&&t.stateNode!=null)AC(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(L(166));return qt(t),null}if(e=Ai(Lr.current),Ad(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Mr]=t,r[uc]=i,e=(t.mode&1)!==0,n){case"dialog":Ye("cancel",r),Ye("close",r);break;case"iframe":case"object":case"embed":Ye("load",r);break;case"video":case"audio":for(o=0;o<Wl.length;o++)Ye(Wl[o],r);break;case"source":Ye("error",r);break;case"img":case"image":case"link":Ye("error",r),Ye("load",r);break;case"details":Ye("toggle",r);break;case"input":KI(r,i),Ye("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Ye("invalid",r);break;case"textarea":XI(r,i),Ye("invalid",r)}xg(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Nd(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Nd(r.textContent,a,e),o=["children",""+a]):ec.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Ye("scroll",r)}switch(n){case"input":Sd(r),JI(r,i,!0);break;case"textarea":Sd(r),QI(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=ef)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=s0(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Mr]=t,e[uc]=r,NC(e,t,!1,!1),t.stateNode=e;e:{switch(s=bg(n,r),n){case"dialog":Ye("cancel",e),Ye("close",e),o=r;break;case"iframe":case"object":case"embed":Ye("load",e),o=r;break;case"video":case"audio":for(o=0;o<Wl.length;o++)Ye(Wl[o],e);o=r;break;case"source":Ye("error",e),o=r;break;case"img":case"image":case"link":Ye("error",e),Ye("load",e),o=r;break;case"details":Ye("toggle",e),o=r;break;case"input":KI(e,r),o=Tg(e,r),Ye("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=rt({},r,{value:void 0}),Ye("invalid",e);break;case"textarea":XI(e,r),o=Cg(e,r),Ye("invalid",e);break;default:o=r}xg(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?c0(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&a0(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&tc(e,l):typeof l=="number"&&tc(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ec.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Ye("scroll",e):l!=null&&dy(e,i,l,s))}switch(n){case"input":Sd(e),JI(e,r,!1);break;case"textarea":Sd(e),QI(e);break;case"option":r.value!=null&&e.setAttribute("value",""+qo(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Xs(e,!!r.multiple,i,!1):r.defaultValue!=null&&Xs(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=ef)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return qt(t),null;case 6:if(e&&t.stateNode!=null)MC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(L(166));if(n=Ai(fc.current),Ai(Lr.current),Ad(t)){if(r=t.stateNode,n=t.memoizedProps,r[Mr]=t,(i=r.nodeValue!==n)&&(e=Pn,e!==null))switch(e.tag){case 3:Nd(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Nd(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Mr]=t,t.stateNode=r}return qt(t),null;case 13:if(Ke(tt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Qe&&Mn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)J0(),ia(),t.flags|=98560,i=!1;else if(i=Ad(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(L(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(L(317));i[Mr]=t}else ia(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qt(t),i=!1}else yr!==null&&(ly(yr),yr=null),i=!0;if(!i)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(tt.current&1)!==0?It===0&&(It=3):qy())),t.updateQueue!==null&&(t.flags|=4),qt(t),null);case 4:return aa(),ey(e,t),e===null&&lc(t.stateNode.containerInfo),qt(t),null;case 10:return Ny(t.type._context),qt(t),null;case 17:return vn(t.type)&&tf(),qt(t),null;case 19:if(Ke(tt),i=t.memoizedState,i===null)return qt(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Fl(i,!1);else{if(It!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=cf(e),s!==null){for(t.flags|=128,Fl(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ge(tt,tt.current&1|2),t.child}e=e.sibling}i.tail!==null&&pt()>ca&&(t.flags|=128,r=!0,Fl(i,!1),t.lanes=4194304)}else{if(!r)if(e=cf(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Qe)return qt(t),null}else 2*pt()-i.renderingStartTime>ca&&n!==1073741824&&(t.flags|=128,r=!0,Fl(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=pt(),t.sibling=null,n=tt.current,Ge(tt,r?n&1|2:n&1),t):(qt(t),null);case 22:case 23:return Vy(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(An&1073741824)!==0&&(qt(t),t.subtreeFlags&6&&(t.flags|=8192)):qt(t),null;case 24:return null;case 25:return null}throw Error(L(156,t.tag))}function cU(e,t){switch(Ry(t),t.tag){case 1:return vn(t.type)&&tf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return aa(),Ke(_n),Ke(Kt),Oy(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Ly(t),null;case 13:if(Ke(tt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ke(tt),null;case 4:return aa(),null;case 10:return Ny(t.type._context),null;case 22:case 23:return Vy(),null;case 24:return null;default:return null}}var Ld=!1,Yt=!1,uU=typeof WeakSet=="function"?WeakSet:Set,B=null;function Ks(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ct(e,t,r)}else n.current=null}function ty(e,t,n){try{n()}catch(r){ct(e,t,r)}}var zw=!1;function dU(e,t){if(Fg=Xd,e=U0(),wy(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,f=e,p=null;t:for(;;){for(var h;f!==n||o!==0&&f.nodeType!==3||(a=s+o),f!==i||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++c===o&&(a=s),p===i&&++u===r&&(l=s),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Bg={focusedElem:e,selectionRange:n},Xd=!1,B=t;B!==null;)if(t=B,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,B=e;else for(;B!==null;){t=B;try{var y=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var _=y.memoizedProps,T=y.memoizedState,g=t.stateNode,S=g.getSnapshotBeforeUpdate(t.elementType===t.type?_:hr(t.type,_),T);g.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var E=t.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(L(163))}}catch(R){ct(t,t.return,R)}if(e=t.sibling,e!==null){e.return=t.return,B=e;break}B=t.return}return y=zw,zw=!1,y}function Xl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&ty(t,n,i)}o=o.next}while(o!==r)}}function Cf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ny(e){var t=e.ref;if(t!==null){var n=e.stateNode;e.tag,e=n,typeof t=="function"?t(e):t.current=e}}function PC(e){var t=e.alternate;t!==null&&(e.alternate=null,PC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Mr],delete t[uc],delete t[zg],delete t[qD],delete t[YD])),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 LC(e){return e.tag===5||e.tag===3||e.tag===4}function jw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||LC(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 ry(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ef));else if(r!==4&&(e=e.child,e!==null))for(ry(e,t,n),e=e.sibling;e!==null;)ry(e,t,n),e=e.sibling}function oy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(oy(e,t,n),e=e.sibling;e!==null;)oy(e,t,n),e=e.sibling}var Pt=null,gr=!1;function Mo(e,t,n){for(n=n.child;n!==null;)OC(e,t,n),n=n.sibling}function OC(e,t,n){if(Pr&&typeof Pr.onCommitFiberUnmount=="function")try{Pr.onCommitFiberUnmount(yf,n)}catch{}switch(n.tag){case 5:Yt||Ks(n,t);case 6:var r=Pt,o=gr;Pt=null,Mo(e,t,n),Pt=r,gr=o,Pt!==null&&(gr?(e=Pt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Pt.removeChild(n.stateNode));break;case 18:Pt!==null&&(gr?(e=Pt,n=n.stateNode,e.nodeType===8?ag(e.parentNode,n):e.nodeType===1&&ag(e,n),ic(e)):ag(Pt,n.stateNode));break;case 4:r=Pt,o=gr,Pt=n.stateNode.containerInfo,gr=!0,Mo(e,t,n),Pt=r,gr=o;break;case 0:case 11:case 14:case 15:if(!Yt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&((i&2)!==0||(i&4)!==0)&&ty(n,t,s),o=o.next}while(o!==r)}Mo(e,t,n);break;case 1:if(!Yt&&(Ks(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ct(n,t,a)}Mo(e,t,n);break;case 21:Mo(e,t,n);break;case 22:n.mode&1?(Yt=(r=Yt)||n.memoizedState!==null,Mo(e,t,n),Yt=r):Mo(e,t,n);break;default:Mo(e,t,n)}}function Ww(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new uU),t.forEach(function(r){var o=vU.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function mr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:Pt=a.stateNode,gr=!1;break e;case 3:Pt=a.stateNode.containerInfo,gr=!0;break e;case 4:Pt=a.stateNode.containerInfo,gr=!0;break e}a=a.return}if(Pt===null)throw Error(L(160));OC(i,s,o),Pt=null,gr=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(c){ct(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)DC(t,e),t=t.sibling}function DC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(mr(t,e),Nr(e),r&4){try{Xl(3,e,e.return),Cf(3,e)}catch(_){ct(e,e.return,_)}try{Xl(5,e,e.return)}catch(_){ct(e,e.return,_)}}break;case 1:mr(t,e),Nr(e),r&512&&n!==null&&Ks(n,n.return);break;case 5:if(mr(t,e),Nr(e),r&512&&n!==null&&Ks(n,n.return),e.flags&32){var o=e.stateNode;try{tc(o,"")}catch(_){ct(e,e.return,_)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&o0(o,i),bg(a,s);var c=bg(a,i);for(s=0;s<l.length;s+=2){var u=l[s],f=l[s+1];u==="style"?c0(o,f):u==="dangerouslySetInnerHTML"?a0(o,f):u==="children"?tc(o,f):dy(o,u,f,c)}switch(a){case"input":Ig(o,i);break;case"textarea":i0(o,i);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Xs(o,!!i.multiple,h,!1):p!==!!i.multiple&&(i.defaultValue!=null?Xs(o,!!i.multiple,i.defaultValue,!0):Xs(o,!!i.multiple,i.multiple?[]:"",!1))}o[uc]=i}catch(_){ct(e,e.return,_)}}break;case 6:if(mr(t,e),Nr(e),r&4){if(e.stateNode===null)throw Error(L(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(_){ct(e,e.return,_)}}break;case 3:if(mr(t,e),Nr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ic(t.containerInfo)}catch(_){ct(e,e.return,_)}break;case 4:mr(t,e),Nr(e);break;case 13:mr(t,e),Nr(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Wy=pt())),r&4&&Ww(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(Yt=(c=Yt)||u,mr(t,e),Yt=c):mr(t,e),Nr(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&(e.mode&1)!==0)for(B=e,u=e.child;u!==null;){for(f=B=u;B!==null;){switch(p=B,h=p.child,p.tag){case 0:case 11:case 14:case 15:Xl(4,p,p.return);break;case 1:Ks(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(_){ct(r,n,_)}}break;case 5:Ks(p,p.return);break;case 22:if(p.memoizedState!==null){Vw(f);continue}}h!==null?(h.return=p,B=h):Vw(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{o=f.stateNode,c?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=l0("display",s))}catch(_){ct(e,e.return,_)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(_){ct(e,e.return,_)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:mr(t,e),Nr(e),r&4&&Ww(e);break;case 21:break;default:mr(t,e),Nr(e)}}function Nr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(LC(n)){var r=n;break e}n=n.return}throw Error(L(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(tc(o,""),r.flags&=-33);var i=jw(e);oy(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=jw(e);ry(e,a,s);break;default:throw Error(L(161))}}catch(l){ct(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function fU(e,t,n){B=e,UC(e,t,n)}function UC(e,t,n){for(var r=(e.mode&1)!==0;B!==null;){var o=B,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Ld;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||Yt;a=Ld;var c=Yt;if(Ld=s,(Yt=l)&&!c)for(B=o;B!==null;)s=B,l=s.child,s.tag===22&&s.memoizedState!==null?qw(o):l!==null?(l.return=s,B=l):qw(o);for(;i!==null;)B=i,UC(i,t,n),i=i.sibling;B=o,Ld=a,Yt=c}Gw(e,t,n)}else(o.subtreeFlags&8772)!==0&&i!==null?(i.return=o,B=i):Gw(e,t,n)}}function Gw(e){for(;B!==null;){var t=B;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Yt||Cf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Yt)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:hr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&kw(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}kw(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&ic(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(L(163))}Yt||t.flags&512&&ny(t)}catch(p){ct(t,t.return,p)}}if(t===e){B=null;break}if(n=t.sibling,n!==null){n.return=t.return,B=n;break}B=t.return}}function Vw(e){for(;B!==null;){var t=B;if(t===e){B=null;break}var n=t.sibling;if(n!==null){n.return=t.return,B=n;break}B=t.return}}function qw(e){for(;B!==null;){var t=B;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Cf(4,t)}catch(l){ct(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){ct(t,o,l)}}var i=t.return;try{ny(t)}catch(l){ct(t,i,l)}break;case 5:var s=t.return;try{ny(t)}catch(l){ct(t,s,l)}}}catch(l){ct(t,t.return,l)}if(t===e){B=null;break}var a=t.sibling;if(a!==null){a.return=t.return,B=a;break}B=t.return}}var pU=Math.ceil,ff=fo.ReactCurrentDispatcher,zy=fo.ReactCurrentOwner,Qn=fo.ReactCurrentBatchConfig,xe=0,xt=null,yt=null,Lt=0,An=0,Js=Jo(0),It=0,gc=null,Ui=0,Rf=0,jy=0,Ql=null,yn=null,Wy=0,ca=1/0,no=null,pf=!1,iy=null,Wo=null,Od=!1,Fo=null,mf=0,Zl=0,sy=null,jd=-1,Wd=0;function an(){return(xe&6)!==0?pt():jd!==-1?jd:jd=pt()}function Go(e){return(e.mode&1)===0?1:(xe&2)!==0&&Lt!==0?Lt&-Lt:JD.transition!==null?(Wd===0&&(Wd=E0()),Wd):(e=De,e!==0||(e=window.event,e=e===void 0?16:b0(e.type)),e)}function _r(e,t,n,r){if(50<Zl)throw Zl=0,sy=null,Error(L(185));yc(e,n,r),((xe&2)===0||e!==xt)&&(e===xt&&((xe&2)===0&&(Rf|=n),It===4&&Do(e,Lt)),En(e,r),n===1&&xe===0&&(t.mode&1)===0&&(ca=pt()+500,Tf&&Xo()))}function En(e,t){var n=e.callbackNode;QO(e,t);var r=Jd(e,e===xt?Lt:0);if(r===0)n!==null&&tw(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&tw(n),t===1)e.tag===0?KD(Yw.bind(null,e)):q0(Yw.bind(null,e)),GD(function(){(xe&6)===0&&Xo()}),n=null;else{switch(T0(r)){case 1:n=gy;break;case 4:n=_0;break;case 16:n=Kd;break;case 536870912:n=v0;break;default:n=Kd}n=GC(n,FC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function FC(e,t){if(jd=-1,Wd=0,(xe&6)!==0)throw Error(L(327));var n=e.callbackNode;if(na()&&e.callbackNode!==n)return null;var r=Jd(e,e===xt?Lt:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=hf(e,r);else{t=r;var o=xe;xe|=2;var i=HC();(xt!==e||Lt!==t)&&(no=null,ca=pt()+500,Mi(e,t));do try{gU();break}catch(a){BC(e,a)}while(!0);ky(),ff.current=i,xe=o,yt!==null?t=0:(xt=null,Lt=0,t=It)}if(t!==0){if(t===2&&(o=Pg(e),o!==0&&(r=o,t=ay(e,o))),t===1)throw n=gc,Mi(e,0),Do(e,r),En(e,pt()),n;if(t===6)Do(e,r);else{if(o=e.current.alternate,(r&30)===0&&!mU(o)&&(t=hf(e,r),t===2&&(i=Pg(e),i!==0&&(r=i,t=ay(e,i))),t===1))throw n=gc,Mi(e,0),Do(e,r),En(e,pt()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(L(345));case 2:bi(e,yn,no);break;case 3:if(Do(e,r),(r&130023424)===r&&(t=Wy+500-pt(),10<t)){if(Jd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){an(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=$g(bi.bind(null,e,yn,no),t);break}bi(e,yn,no);break;case 4:if(Do(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Sr(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=pt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*pU(r/1960))-r,10<r){e.timeoutHandle=$g(bi.bind(null,e,yn,no),r);break}bi(e,yn,no);break;case 5:bi(e,yn,no);break;default:throw Error(L(329))}}}return En(e,pt()),e.callbackNode===n?FC.bind(null,e):null}function ay(e,t){var n=Ql;return e.current.memoizedState.isDehydrated&&(Mi(e,t).flags|=256),e=hf(e,t),e!==2&&(t=yn,yn=n,t!==null&&ly(t)),e}function ly(e){yn===null?yn=e:yn.push.apply(yn,e)}function mU(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!vr(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Do(e,t){for(t&=~jy,t&=~Rf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Sr(t),r=1<<n;e[n]=-1,t&=~r}}function Yw(e){if((xe&6)!==0)throw Error(L(327));na();var t=Jd(e,0);if((t&1)===0)return En(e,pt()),null;var n=hf(e,t);if(e.tag!==0&&n===2){var r=Pg(e);r!==0&&(t=r,n=ay(e,r))}if(n===1)throw n=gc,Mi(e,0),Do(e,t),En(e,pt()),n;if(n===6)throw Error(L(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,bi(e,yn,no),En(e,pt()),null}function Gy(e,t){var n=xe;xe|=1;try{return e(t)}finally{xe=n,xe===0&&(ca=pt()+500,Tf&&Xo())}}function Fi(e){Fo!==null&&Fo.tag===0&&(xe&6)===0&&na();var t=xe;xe|=1;var n=Qn.transition,r=De;try{if(Qn.transition=null,De=1,e)return e()}finally{De=r,Qn.transition=n,xe=t,(xe&6)===0&&Xo()}}function Vy(){An=Js.current,Ke(Js)}function Mi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,WD(n)),yt!==null)for(n=yt.return;n!==null;){var r=n;switch(Ry(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&tf();break;case 3:aa(),Ke(_n),Ke(Kt),Oy();break;case 5:Ly(r);break;case 4:aa();break;case 13:Ke(tt);break;case 19:Ke(tt);break;case 10:Ny(r.type._context);break;case 22:case 23:Vy()}n=n.return}if(xt=e,yt=e=Vo(e.current,null),Lt=An=t,It=0,gc=null,jy=Rf=Ui=0,yn=Ql=null,Ni!==null){for(t=0;t<Ni.length;t++)if(n=Ni[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}Ni=null}return e}function BC(e,t){do{var n=yt;try{if(ky(),Hd.current=df,uf){for(var r=nt.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}uf=!1}if(Di=0,Rt=Tt=nt=null,Jl=!1,pc=0,zy.current=null,n===null||n.return===null){It=1,gc=t,yt=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=Lt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if((u.mode&1)===0&&(f===0||f===11||f===15)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var h=Ow(s);if(h!==null){h.flags&=-257,Dw(h,s,a,i,t),h.mode&1&&Lw(i,c,t),t=h,l=c;var y=t.updateQueue;if(y===null){var _=new Set;_.add(l),t.updateQueue=_}else y.add(l);break e}else{if((t&1)===0){Lw(i,c,t),qy();break e}l=Error(L(426))}}else if(Qe&&a.mode&1){var T=Ow(s);if(T!==null){(T.flags&65536)===0&&(T.flags|=256),Dw(T,s,a,i,t),xy(la(l,a));break e}}i=l=la(l,a),It!==4&&(It=2),Ql===null?Ql=[i]:Ql.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=TC(i,l,t);bw(i,g);break e;case 1:a=l;var S=i.type,E=i.stateNode;if((i.flags&128)===0&&(typeof S.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Wo===null||!Wo.has(E)))){i.flags|=65536,t&=-t,i.lanes|=t;var R=IC(i,a,t);bw(i,R);break e}}i=i.return}while(i!==null)}zC(n)}catch(M){t=M,yt===n&&n!==null&&(yt=n=n.return);continue}break}while(!0)}function HC(){var e=ff.current;return ff.current=df,e===null?df:e}function qy(){(It===0||It===3||It===2)&&(It=4),xt===null||(Ui&268435455)===0&&(Rf&268435455)===0||Do(xt,Lt)}function hf(e,t){var n=xe;xe|=2;var r=HC();(xt!==e||Lt!==t)&&(no=null,Mi(e,t));do try{hU();break}catch(o){BC(e,o)}while(!0);if(ky(),xe=n,ff.current=r,yt!==null)throw Error(L(261));return xt=null,Lt=0,It}function hU(){for(;yt!==null;)$C(yt)}function gU(){for(;yt!==null&&!jO();)$C(yt)}function $C(e){var t=WC(e.alternate,e,An);e.memoizedProps=e.pendingProps,t===null?zC(e):yt=t,zy.current=null}function zC(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=lU(n,t,An),n!==null){yt=n;return}}else{if(n=cU(n,t),n!==null){n.flags&=32767,yt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{It=6,yt=null;return}}if(t=t.sibling,t!==null){yt=t;return}yt=t=e}while(t!==null);It===0&&(It=5)}function bi(e,t,n){var r=De,o=Qn.transition;try{Qn.transition=null,De=1,yU(e,t,n,r)}finally{Qn.transition=o,De=r}return null}function yU(e,t,n,r){do na();while(Fo!==null);if((xe&6)!==0)throw Error(L(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(L(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(ZO(e,i),e===xt&&(yt=xt=null,Lt=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Od||(Od=!0,GC(Kd,function(){return na(),null})),i=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||i){i=Qn.transition,Qn.transition=null;var s=De;De=1;var a=xe;xe|=4,zy.current=null,dU(e,n),DC(n,e),BD(Bg),Xd=!!Fg,Bg=Fg=null,e.current=n,fU(n,e,o),WO(),xe=a,De=s,Qn.transition=i}else e.current=n;if(Od&&(Od=!1,Fo=e,mf=o),i=e.pendingLanes,i===0&&(Wo=null),qO(n.stateNode,r),En(e,pt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(pf)throw pf=!1,e=iy,iy=null,e;return(mf&1)!==0&&e.tag!==0&&na(),i=e.pendingLanes,(i&1)!==0?e===sy?Zl++:(Zl=0,sy=e):Zl=0,Xo(),null}function na(){if(Fo!==null){var e=T0(mf),t=Qn.transition,n=De;try{if(Qn.transition=null,De=16>e?16:e,Fo===null)var r=!1;else{if(e=Fo,Fo=null,mf=0,(xe&6)!==0)throw Error(L(331));var o=xe;for(xe|=4,B=e.current;B!==null;){var i=B,s=i.child;if((B.flags&16)!==0){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(B=c;B!==null;){var u=B;switch(u.tag){case 0:case 11:case 15:Xl(8,u,i)}var f=u.child;if(f!==null)f.return=u,B=f;else for(;B!==null;){u=B;var p=u.sibling,h=u.return;if(PC(u),u===c){B=null;break}if(p!==null){p.return=h,B=p;break}B=h}}}var y=i.alternate;if(y!==null){var _=y.child;if(_!==null){y.child=null;do{var T=_.sibling;_.sibling=null,_=T}while(_!==null)}}B=i}}if((i.subtreeFlags&2064)!==0&&s!==null)s.return=i,B=s;else e:for(;B!==null;){if(i=B,(i.flags&2048)!==0)switch(i.tag){case 0:case 11:case 15:Xl(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,B=g;break e}B=i.return}}var S=e.current;for(B=S;B!==null;){s=B;var E=s.child;if((s.subtreeFlags&2064)!==0&&E!==null)E.return=s,B=E;else e:for(s=S;B!==null;){if(a=B,(a.flags&2048)!==0)try{switch(a.tag){case 0:case 11:case 15:Cf(9,a)}}catch(M){ct(a,a.return,M)}if(a===s){B=null;break e}var R=a.sibling;if(R!==null){R.return=a.return,B=R;break e}B=a.return}}if(xe=o,Xo(),Pr&&typeof Pr.onPostCommitFiberRoot=="function")try{Pr.onPostCommitFiberRoot(yf,e)}catch{}r=!0}return r}finally{De=n,Qn.transition=t}}return!1}function Kw(e,t,n){t=la(n,t),t=TC(e,t,1),e=jo(e,t,1),t=an(),e!==null&&(yc(e,1,t),En(e,t))}function ct(e,t,n){if(e.tag===3)Kw(e,e,n);else for(;t!==null;){if(t.tag===3){Kw(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Wo===null||!Wo.has(r))){e=la(n,e),e=IC(t,e,1),t=jo(t,e,1),e=an(),t!==null&&(yc(t,1,e),En(t,e));break}}t=t.return}}function SU(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=an(),e.pingedLanes|=e.suspendedLanes&n,xt===e&&(Lt&n)===n&&(It===4||It===3&&(Lt&130023424)===Lt&&500>pt()-Wy?Mi(e,0):jy|=n),En(e,t)}function jC(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ed,Ed<<=1,(Ed&130023424)===0&&(Ed=4194304)));var n=an();e=co(e,t),e!==null&&(yc(e,t,n),En(e,n))}function _U(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jC(e,n)}function vU(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(L(314))}r!==null&&r.delete(t),jC(e,n)}var WC;WC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||_n.current)Sn=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Sn=!1,aU(e,t,n);Sn=(e.flags&131072)!==0}else Sn=!1,Qe&&(t.flags&1048576)!==0&&Y0(t,of,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;zd(e,t),e=t.pendingProps;var o=oa(t,Kt.current);ta(t,n),o=Uy(null,t,r,e,o,n);var i=Fy();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,vn(r)?(i=!0,nf(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,My(t),o.updater=wf,t.stateNode=o,o._reactInternals=t,Yg(t,r,e,n),t=Xg(null,t,r,!0,i,n)):(t.tag=0,Qe&&i&&Cy(t),sn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(zd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=TU(r),e=hr(r,e),o){case 0:t=Jg(null,t,r,e,n);break e;case 1:t=Bw(null,t,r,e,n);break e;case 11:t=Uw(null,t,r,e,n);break e;case 14:t=Fw(null,t,r,hr(r.type,e),n);break e}throw Error(L(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:hr(r,o),Jg(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:hr(r,o),Bw(e,t,r,o,n);case 3:e:{if(xC(t),e===null)throw Error(L(387));r=t.pendingProps,i=t.memoizedState,o=i.element,eC(e,t),lf(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=la(Error(L(423)),t),t=Hw(e,t,r,n,o);break e}else if(r!==o){o=la(Error(L(424)),t),t=Hw(e,t,r,n,o);break e}else for(Mn=zo(t.stateNode.containerInfo.firstChild),Pn=t,Qe=!0,yr=null,n=Q0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ia(),r===o){t=uo(e,t,n);break e}sn(e,t,r,n)}t=t.child}return t;case 5:return tC(t),e===null&&Gg(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Hg(r,o)?s=null:i!==null&&Hg(r,i)&&(t.flags|=32),RC(e,t),sn(e,t,s,n),t.child;case 6:return e===null&&Gg(t),null;case 13:return bC(e,t,n);case 4:return Py(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=sa(t,null,r,n):sn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:hr(r,o),Uw(e,t,r,o,n);case 7:return sn(e,t,t.pendingProps,n),t.child;case 8:return sn(e,t,t.pendingProps.children,n),t.child;case 12:return sn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Ge(sf,r._currentValue),r._currentValue=s,i!==null)if(vr(i.value,s)){if(i.children===o.children&&!_n.current){t=uo(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=so(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Vg(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(L(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Vg(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}sn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ta(t,n),o=Zn(o),r=r(o),t.flags|=1,sn(e,t,r,n),t.child;case 14:return r=t.type,o=hr(r,t.pendingProps),o=hr(r.type,o),Fw(e,t,r,o,n);case 15:return wC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:hr(r,o),zd(e,t),t.tag=1,vn(r)?(e=!0,nf(t)):e=!1,ta(t,n),EC(t,r,o),Yg(t,r,o,n),Xg(null,t,r,!0,e,n);case 19:return kC(e,t,n);case 22:return CC(e,t,n)}throw Error(L(156,t.tag))};function GC(e,t){return S0(e,t)}function EU(e,t,n,r){this.tag=e,this.key=n,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(e,t,n,r){return new EU(e,t,n,r)}function Yy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function TU(e){if(typeof e=="function")return Yy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===py)return 11;if(e===my)return 14}return 2}function Vo(e,t){var n=e.alternate;return n===null?(n=Xn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Gd(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Yy(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Hs:return Pi(n.children,o,i,t);case fy:s=8,o|=8;break;case Sg:return e=Xn(12,n,t,o|2),e.elementType=Sg,e.lanes=i,e;case _g:return e=Xn(13,n,t,o),e.elementType=_g,e.lanes=i,e;case vg:return e=Xn(19,n,t,o),e.elementType=vg,e.lanes=i,e;case t0:return xf(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Zw:s=10;break e;case e0:s=9;break e;case py:s=11;break e;case my:s=14;break e;case Po:s=16,r=null;break e}throw Error(L(130,e==null?e:typeof e,""))}return t=Xn(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Pi(e,t,n,r){return e=Xn(7,e,r,t),e.lanes=n,e}function xf(e,t,n,r){return e=Xn(22,e,r,t),e.elementType=t0,e.lanes=n,e.stateNode={isHidden:!1},e}function hg(e,t,n){return e=Xn(6,e,null,t),e.lanes=n,e}function gg(e,t,n){return t=Xn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function IU(e,t,n,r,o){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=Zh(0),this.expirationTimes=Zh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zh(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Ky(e,t,n,r,o,i,s,a,l){return e=new IU(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Xn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},My(i),e}function wU(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Bs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function VC(e){if(!e)return Yo;e=e._reactInternals;e:{if(Hi(e)!==e||e.tag!==1)throw Error(L(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(vn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(L(171))}if(e.tag===1){var n=e.type;if(vn(n))return V0(e,n,t)}return t}function qC(e,t,n,r,o,i,s,a,l){return e=Ky(n,r,!0,e,o,i,s,a,l),e.context=VC(null),n=e.current,r=an(),o=Go(n),i=so(r,o),i.callback=t??null,jo(n,i,o),e.current.lanes=o,yc(e,o,r),En(e,r),e}function bf(e,t,n,r){var o=t.current,i=an(),s=Go(o);return n=VC(n),t.context===null?t.context=n:t.pendingContext=n,t=so(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=jo(o,t,s),e!==null&&(_r(e,o,s,i),Bd(e,o,s)),s}function gf(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Jw(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Jy(e,t){Jw(e,t),(e=e.alternate)&&Jw(e,t)}function CU(){return null}var YC=typeof reportError=="function"?reportError:function(e){console.error(e)};function Xy(e){this._internalRoot=e}kf.prototype.render=Xy.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(L(409));bf(e,t,null,null)};kf.prototype.unmount=Xy.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Fi(function(){bf(null,e,null,null)}),t[lo]=null}};function kf(e){this._internalRoot=e}kf.prototype.unstable_scheduleHydration=function(e){if(e){var t=C0();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Oo.length&&t!==0&&t<Oo[n].priority;n++);Oo.splice(n,0,e),n===0&&x0(e)}};function Qy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Nf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Xw(){}function RU(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=gf(s);i.call(c)}}var s=qC(t,r,e,0,null,!1,!1,"",Xw);return e._reactRootContainer=s,e[lo]=s.current,lc(e.nodeType===8?e.parentNode:e),Fi(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=gf(l);a.call(c)}}var l=Ky(e,0,!1,null,null,!1,!1,"",Xw);return e._reactRootContainer=l,e[lo]=l.current,lc(e.nodeType===8?e.parentNode:e),Fi(function(){bf(t,l,n,r)}),l}function Af(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=gf(s);a.call(l)}}bf(t,s,e,o)}else s=RU(n,t,e,o,r);return gf(s)}I0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=jl(t.pendingLanes);n!==0&&(yy(t,n|1),En(t,pt()),(xe&6)===0&&(ca=pt()+500,Xo()))}break;case 13:Fi(function(){var r=co(e,1);if(r!==null){var o=an();_r(r,e,1,o)}}),Jy(e,1)}};Sy=function(e){if(e.tag===13){var t=co(e,134217728);if(t!==null){var n=an();_r(t,e,134217728,n)}Jy(e,134217728)}};w0=function(e){if(e.tag===13){var t=Go(e),n=co(e,t);if(n!==null){var r=an();_r(n,e,t,r)}Jy(e,t)}};C0=function(){return De};R0=function(e,t){var n=De;try{return De=e,t()}finally{De=n}};Ng=function(e,t,n){switch(t){case"input":if(Ig(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Ef(r);if(!o)throw Error(L(90));r0(r),Ig(r,o)}}}break;case"textarea":i0(e,n);break;case"select":t=n.value,t!=null&&Xs(e,!!n.multiple,t,!1)}};f0=Gy;p0=Fi;var xU={usingClientEntryPoint:!1,Events:[_c,Ws,Ef,u0,d0,Gy]},Bl={findFiberByHostInstance:ki,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},bU={bundleType:Bl.bundleType,version:Bl.version,rendererPackageName:Bl.rendererPackageName,rendererConfig:Bl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:fo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=g0(e),e===null?null:e.stateNode},findFiberByHostInstance:Bl.findFiberByHostInstance||CU,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Hl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Hl.isDisabled&&Hl.supportsFiber))try{yf=Hl.inject(bU),Pr=Hl}catch{}var Hl;Dn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xU;Dn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Qy(t))throw Error(L(200));return wU(e,t,null,n)};Dn.createRoot=function(e,t){if(!Qy(e))throw Error(L(299));var n=!1,r="",o=YC;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Ky(e,1,!1,null,null,n,!1,r,o),e[lo]=t.current,lc(e.nodeType===8?e.parentNode:e),new Xy(t)};Dn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(L(188)):(e=Object.keys(e).join(","),Error(L(268,e)));return e=g0(t),e=e===null?null:e.stateNode,e};Dn.flushSync=function(e){return Fi(e)};Dn.hydrate=function(e,t,n){if(!Nf(t))throw Error(L(200));return Af(null,e,t,!0,n)};Dn.hydrateRoot=function(e,t,n){if(!Qy(e))throw Error(L(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=YC;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=qC(t,null,e,1,n??null,o,!1,i,s),e[lo]=t.current,lc(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new kf(t)};Dn.render=function(e,t,n){if(!Nf(t))throw Error(L(200));return Af(null,e,t,!1,n)};Dn.unmountComponentAtNode=function(e){if(!Nf(e))throw Error(L(40));return e._reactRootContainer?(Fi(function(){Af(null,null,e,!1,function(){e._reactRootContainer=null,e[lo]=null})}),!0):!1};Dn.unstable_batchedUpdates=Gy;Dn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Nf(n))throw Error(L(200));if(e==null||e._reactInternals===void 0)throw Error(L(38));return Af(e,t,n,!1,r)};Dn.version="18.3.1-next-f1338f8080-20240426"});var Mf=Br(($Y,XC)=>{"use strict";function JC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(JC)}catch(e){console.error(e)}}JC(),XC.exports=KC()});var ZC=Br(Zy=>{"use strict";var QC=Mf();Zy.createRoot=QC.createRoot,Zy.hydrateRoot=QC.hydrateRoot;var zY});var uR=Br(Of=>{"use strict";var FU=eo(),BU=Symbol.for("react.element"),HU=Symbol.for("react.fragment"),$U=Object.prototype.hasOwnProperty,zU=FU.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,jU={key:!0,ref:!0,__self:!0,__source:!0};function cR(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)$U.call(t,r)&&!jU.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:BU,type:e,key:i,ref:s,props:o,_owner:zU.current}}Of.Fragment=HU;Of.jsx=cR;Of.jsxs=cR});var Tc=Br((QY,dR)=>{"use strict";dR.exports=uR()});var O=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var G=globalThis;var Er="10.56.0";function Rn(){return ei(G),G}function ei(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Er,t[Er]=t[Er]||{}}function rr(e,t,n=G){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[Er]=r[Er]||{};return o[e]||(o[e]=t())}var xc=["debug","info","warn","error","log","assert","trace"],Mx="Sentry Logger ",ti={};function kt(e){if(!("console"in G))return e();let t=G.console,n={},r=Object.keys(ti);r.forEach(o=>{let i=ti[o];n[o]=t[o],t[o]=i});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function Px(){sp().enabled=!0}function Lx(){sp().enabled=!1}function LS(){return sp().enabled}function Ox(...e){ip("log",...e)}function Dx(...e){ip("warn",...e)}function Ux(...e){ip("error",...e)}function ip(e,...t){O&&LS()&&kt(()=>{G.console[e](`${Mx}[${e}]:`,...t)})}function sp(){return O?rr("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var C={enable:Px,disable:Lx,isEnabled:LS,log:Ox,warn:Dx,error:Ux};var OS=/\(error: (.*)\)/,DS=/captureMessage|captureException/;function Sa(...e){let t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{let i=[],s=n.split(`
|
|
9
|
+
`);for(let a=r;a<s.length;a++){let l=s[a];l.length>1024&&(l=l.slice(0,1024));let c=OS.test(l)?l.replace(OS,"$1"):l;if(!c.includes("Error: ")){for(let u of t){let f=u(c);if(f){i.push(f);break}}if(i.length>=50+o)break}}return lp(i.slice(o))}}function kc(e){return Array.isArray(e)?Sa(...e):e}function lp(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(bc(t).function||"")&&t.pop(),t.reverse(),DS.test(bc(t).function||"")&&(t.pop(),DS.test(bc(t).function||"")&&t.pop()),t.slice(0,50).map(n=>({...n,filename:n.filename||bc(t).filename,function:n.function||"?"}))}function bc(e){return e[e.length-1]||{}}var ap="<anonymous>";function Qt(e){try{return!e||typeof e!="function"?ap:e.name||ap}catch{return ap}}function _a(e){let t=e.exception;if(t){let n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}var va={},US={};function Ft(e,t){return va[e]=va[e]||[],va[e].push(t),()=>{let n=va[e];if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}function Bt(e,t){if(!US[e]){US[e]=!0;try{t()}catch(n){O&&C.error(`Error while instrumenting ${e}`,n)}}}function mt(e,t){let n=e&&va[e];if(n)for(let r of n)try{r(t)}catch(o){O&&C.error(`Error while triggering instrumentation handler.
|
|
10
10
|
Type: ${e}
|
|
11
|
-
Name: ${
|
|
12
|
-
Error:`,o)}}var ap=null;function _a(e){let t="error";Dt(t,e),Ut(t,Dx)}function Dx(){ap=V.onerror,V.onerror=function(e,t,n,r,o){return mt("error",{column:r,error:o,line:n,msg:e,url:t}),ap?ap.apply(this,arguments):!1},V.onerror.__SENTRY_INSTRUMENTED__=!0}var lp=null;function va(e){let t="unhandledrejection";Dt(t,e),Ut(t,Ux)}function Ux(){lp=V.onunhandledrejection,V.onunhandledrejection=function(e){return mt("unhandledrejection",e),lp?lp.apply(this,arguments):!0},V.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var DS=Object.prototype.toString;function Un(e){switch(DS.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return or(e,Error)}}function Yi(e,t){return DS.call(e)===`[object ${t}]`}function Ki(e){return Yi(e,"ErrorEvent")}function Ea(e){return Yi(e,"DOMError")}function bc(e){return Yi(e,"DOMException")}function Ft(e){return Yi(e,"String")}function go(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function cn(e){return e===null||go(e)||typeof e!="object"&&typeof e!="function"}function Fn(e){return Yi(e,"Object")}function yo(e){return typeof Event<"u"&&or(e,Event)}function kc(e){return Yi(e,"RegExp")}function rr(e){return!!(e?.then&&typeof e.then=="function")}function or(e,t){try{return e instanceof t}catch{return!1}}function Ta(e){return typeof Request<"u"&&or(e,Request)}function it(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&Ia(o,r);try{e[t]=o}catch{O&&C.log(`Failed to replace method "${t}" in object`,e)}}function qe(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{O&&C.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function Ia(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,qe(e,"__sentry_original__",t)}catch{}}function So(e){return e.__sentry_original__}function wa(e){if(Un(e))return{message:e.message,name:e.name,stack:e.stack,...US(e)};if(yo(e)){let{type:t,target:n,currentTarget:r,detail:o}=e;return{type:t,target:n,currentTarget:r,...o?{detail:o}:{},...US(e)}}return e}function US(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function Nc(e){let t=Object.keys(wa(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}var Ji;function ti(e){if(Ji!==void 0)return Ji?Ji(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=V;return t in n&&typeof n[t]=="function"?(Ji=n[t],Ji(e)):(Ji=null,e())}function Bn(){return ti(()=>Math.random())}function ni(){return ti(()=>Date.now())}var Fx=Symbol.for("sentry.skipNormalization"),Bx=Symbol.for("sentry.overrideNormalizationDepth");function FS(e){return!!e[Fx]}function BS(e){let t=e[Bx];return typeof t=="number"?t:void 0}var cp;function Xi(e){cp=e}function Bt(e,t=100,n=1/0){try{return up("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Ca(e,t=3,n=100*1024){let r=Bt(e,t);return zx(r)>n?Ca(e,t-1,n):r}function up(e,t,n=1/0,r=1/0,o=jx()){let[i,s]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let a=dp(e,t);if(!a.startsWith("[object "))return a;if(FS(t))return t;let l=BS(t),c=l!==void 0?l:n;if(c===0)return a.replace("object ","");if(i(t))return"[Circular ~]";let u=t;if(u&&typeof u.toJSON=="function")try{let y=u.toJSON();return up("",y,c-1,r,o)}catch{}let d=Array.isArray(t)?[]:{},p=0,h=wa(t);for(let y in h){if(!Object.prototype.hasOwnProperty.call(h,y))continue;if(p>=r){d[y]="[MaxProperties ~]";break}let _=h[y];d[y]=up(y,_,c-1,r,o),p++}return s(t),d}function dp(e,t){try{if(cp){let r=cp(t);if(r)return r}return typeof global<"u"&&t===global?"[Global]":typeof t=="number"&&!Number.isFinite(t)?`[${t}]`:typeof t=="function"?`[Function: ${Jt(t)}]`:typeof t=="symbol"?`[${String(t)}]`:typeof t=="bigint"?`[BigInt: ${String(t)}]`:`[object ${Hx(t)}]`}catch(n){return`**non-serializable** (${n})`}}function Hx(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function $x(e){return~-encodeURI(e).split(/%..|./).length}function zx(e){return $x(JSON.stringify(e))}function jx(){let e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function ri(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Ra(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let o=e[r];cn(o)?n.push(String(o)):o instanceof Error?n.push(o.message?`${o.name}: ${o.message}`:o.name):n.push(dp(void 0,o))}return n.join(t)}function _o(e,t,n=!1){return Ft(e)?kc(t)?t.test(e):Ft(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function kt(e,t=[],n=!1){for(let r of t)if(_o(e,r,n))return!0;return!1}function Wx(){let e=V;return e.crypto||e.msCrypto}var fp;function Gx(){return Bn()*16}function st(e=Wx()){try{if(e?.randomUUID)return ti(()=>e.randomUUID()).replace(/-/g,"")}catch{}return fp||(fp="10000000100040008000"+1e11),fp.replace(/[018]/g,t=>(t^(Gx()&15)>>t/4).toString(16))}function HS(e){return e.exception?.values?.[0]}function ir(e){let{message:t,event_id:n}=e;if(t)return t;let r=HS(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function oi(e,t,n){let r=e.exception=e.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function Hn(e,t){let n=HS(e);if(!n)return;let r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...t},t&&"data"in t){let i={...o?.data,...t.data};n.mechanism.data=i}}function xa(e){if(pp(e))return!0;try{qe(e,"__sentry_captured__",!0)}catch{}return!1}function pp(e){try{return e.__sentry_captured__}catch{}}var zS=1e3;function un(){return ni()/zS}function Vx(){let{performance:e}=V;if(!e?.now||!e.timeOrigin)return un;let t=e.timeOrigin;return()=>(t+ti(()=>e.now()))/zS}var $S;function Ae(){return($S??($S=Vx()))()}var mp=null;function qx(){let{performance:e}=V;if(!e?.now)return;let t=3e5,n=ti(()=>e.now()),r=ni(),o=e.timeOrigin;if(typeof o=="number"&&Math.abs(o+n-r)<t)return o;let i=e.timing?.navigationStart;return typeof i=="number"&&Math.abs(i+n-r)<t?i:r-n}function $e(){return mp===null&&(mp=qx()),mp}function jS(e){let t=Ae(),n={sid:st(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Yx(n)};return e&&Fr(n,e),n}function Fr(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Ae(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:st()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{let n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function WS(e,t){let n={};t?n={status:t}:e.status==="ok"&&(n={status:"exited"}),Fr(e,n)}function Yx(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function vo(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=vo(r[o],t[o],n-1));return r}function Xt(){return st()}function Ht(){return st().substring(16)}function Ac(e){try{let t=V.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function Mc(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var hp="_sentrySpan";function Eo(e,t){t?qe(e,hp,Ac(t)):delete e[hp]}function ii(e){return Mc(e[hp])}var Kx=100,dn=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Xt(),sampleRand:Bn()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,Eo(t,ii(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Fr(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t=="function"?t(this):t,r=n instanceof e?n.getScopeData():Fn(n)?t:void 0,{tags:o,attributes:i,extra:s,user:a,contexts:l,level:c,fingerprint:u=[],propagationContext:d,conversationId:p}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...i},this._extra={...this._extra,...s},this._contexts={...this._contexts,...l},a&&Object.keys(a).length&&(this._user=a),c&&(this._level=c),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),p&&(this._conversationId=p),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Eo(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Xt(),sampleRand:Bn()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){let r=typeof n=="number"?n:Kx;if(r<=0)return this;let o={timestamp:un(),...t,message:t.message?ri(t.message,2048):t.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:ii(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=vo(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){let r=n?.event_id||st();if(!this._client)return O&&C.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){let o=r?.event_id||st();if(!this._client)return O&&C.warn("No client configured on scope - will not capture message!"),o;let i=r?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:i,...r,event_id:o},this),o}captureEvent(t,n){let r=t.event_id||n?.event_id||st();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(O&&C.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}};function GS(){return nr("defaultCurrentScope",()=>new dn)}function VS(){return nr("defaultIsolationScope",()=>new dn)}var qS=e=>e instanceof Promise&&!e[YS],YS=Symbol("chained PromiseLike"),KS=(e,t,n)=>{let r=e.then(o=>(t(o),o),o=>{throw n(o),o});return qS(r)&&qS(e)?r:Jx(e,r)},Jx=(e,t)=>{if(!t)return e;let n=!1;for(let r in e){if(r in t)continue;n=!0;let o=e[r];typeof o=="function"?Object.defineProperty(t,r,{value:(...i)=>o.apply(e,i),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[YS]:!0}),t};var gp=class{constructor(t,n){let r;t?r=t:r=new dn;let o;n?o=n:o=new dn,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){let n=this._pushScope(),r;try{r=t(n)}catch(o){throw this._popScope(),o}return rr(r)?KS(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Qi(){let e=wn(),t=Zo(e);return t.stack=t.stack||new gp(GS(),VS())}function Xx(e){return Qi().withScope(e)}function Qx(e,t){let n=Qi();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function JS(e){return Qi().withScope(()=>e(Qi().getIsolationScope()))}function XS(){return{withIsolationScope:JS,withScope:Xx,withSetScope:Qx,withSetIsolationScope:(e,t)=>JS(t),getCurrentScope:()=>Qi().getScope(),getIsolationScope:()=>Qi().getIsolationScope()}}function Er(e){let t=Zo(e);return t.acs?t.acs:XS()}function Zx(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function eb(e,t){let{value:n,unit:r}=Zx(e)?e:{value:e,unit:void 0},o=tb(n),i=r&&typeof r=="string"?{unit:r}:{};if(o)return{...o,...i};if(!t||t==="skip-undefined"&&n===void 0)return;let s="";try{s=JSON.stringify(n)??""}catch{}return{value:s,type:"string",...i}}function yp(e,t=!1){let n={};for(let[r,o]of Object.entries(e??{})){let i=eb(o,t);i&&(n[r]=i)}return n}function tb(e){if(Array.isArray(e))return{value:e,type:"array"};let t=typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?Number.isInteger(e)?"integer":"double":null;if(t)return{value:e,type:t}}var QS;function Sp(){return QS?.()}function Pc(){return QS!==void 0}function ee(){let e=wn();return Er(e).getCurrentScope()}function Qe(){let e=wn();return Er(e).getIsolationScope()}function ba(){return nr("globalScope",()=>new dn)}function $n(...e){let t=wn(),n=Er(t);if(e.length===2){let[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function z(){return ee().getClient()}function Lc(e){let t=Sp();if(t)return{trace_id:t.traceId,span_id:t.spanId};let n=e.getPropagationContext(),{traceId:r,parentSpanId:o,propagationSpanId:i}=n,s={trace_id:r,span_id:i||Ht()};return o&&(s.parent_span_id=o),s}var vt="sentry.source",Br="sentry.sample_rate",Zi="sentry.previous_trace_sample_rate",Ye="sentry.op",Ce="sentry.origin",Hr="sentry.idle_span_finish_reason",sr="sentry.measurement_unit",ar="sentry.measurement_value";var es="sentry.custom_span_name",si="sentry.profile_id",$t="sentry.exclusive_time";var Oc="sentry.link.type",Dc="gen_ai.conversation.id";function _p(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:"unauthenticated"};case 403:return{code:2,message:"permission_denied"};case 404:return{code:2,message:"not_found"};case 409:return{code:2,message:"already_exists"};case 413:return{code:2,message:"failed_precondition"};case 429:return{code:2,message:"resource_exhausted"};case 499:return{code:2,message:"cancelled"};default:return{code:2,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:"unimplemented"};case 503:return{code:2,message:"unavailable"};case 504:return{code:2,message:"deadline_exceeded"};default:return{code:2,message:"internal_error"}}return{code:2,message:"internal_error"}}function ts(e,t){e.setAttribute("http.response.status_code",t);let n=_p(t);n.message!=="unknown_error"&&e.setStatus(n)}var ZS="_sentryScope",e_="_sentryIsolationScope";function t_(e,t,n){e&&(qe(e,e_,Ac(n)),qe(e,ZS,t))}function ai(e){let t=e;return{scope:t[ZS],isolationScope:Mc(t[e_])}}var ka="sentry-";var nb=8192;function Uc(e){let t=rb(e);if(!t)return;let n=Object.entries(t).reduce((r,[o,i])=>{if(o.startsWith(ka)){let s=o.slice(ka.length);r[s]=i}return r},{});if(Object.keys(n).length>0)return n}function vp(e){if(!e)return;let t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${ka}${r}`]=o),n),{});return ob(t)}function rb(e){if(!(!e||!Ft(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{let r=n_(n);return Object.entries(r).forEach(([o,i])=>{t[o]=i}),t},{}):n_(e)}function n_(e){return e.split(",").map(t=>{let n=t.indexOf("=");if(n===-1)return[];let r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(i=>{try{return decodeURIComponent(i.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function ob(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],o)=>{let i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,s=o===0?i:`${t},${i}`;return s.length>nb?(O&&C.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):s},"")}var ib=/^o(\d+)\./,sb=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function ab(e){return e==="http"||e==="https"}function Cn(e,t=!1){let{host:n,path:r,pass:o,port:i,projectId:s,protocol:a,publicKey:l}=e;return`${a}://${l}${t&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${s}`}function lb(e){let t=sb.exec(e);if(!t){bt(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,o="",i="",s="",a=""]=t.slice(1),l="",c=a,u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){let d=c.match(/^\d+/);d&&(c=d[0])}return r_({host:i,pass:o,path:l,projectId:c,port:s,protocol:n,publicKey:r})}function r_(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function cb(e){if(!O)return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(s=>e[s]?!1:(C.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:n.match(/^\d+$/)?ab(r)?t&&isNaN(parseInt(t,10))?(C.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(C.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(C.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function ub(e){return e.match(ib)?.[1]}function o_(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=ub(n)),r}function Fc(e){let t=typeof e=="string"?lb(e):r_(e);if(!(!t||!cb(t)))return t}function Rn(e){if(typeof e=="boolean")return Number(e);let t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}var Bc=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function i_(e){if(!e)return;let t=e.match(Bc);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function Ep(e,t){let n=i_(e),r=Uc(t);if(!n?.traceId)return{traceId:Xt(),sampleRand:Bn()};let o=db(n,r);r&&(r.sample_rand=o.toString());let{traceId:i,parentSpanId:s,parentSampled:a}=n;return{traceId:i,parentSpanId:s,sampled:a,dsc:r||{},sampleRand:o}}function Na(e=Xt(),t=Ht(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function Aa(e=Xt(),t=Ht(),n){return`00-${e}-${t}-${n?"01":"00"}`}function db(e,t){let n=Rn(t?.sample_rand);if(n!==void 0)return n;let r=Rn(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?Bn()*r:r+Bn()*(1-r):Bn()}var Hc=0,Pa=1,s_=!1;function c_(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:o,parent_span_id:i,status:s,origin:a,links:l}=te(e);return{parent_span_id:i,span_id:t,trace_id:n,data:r,op:o,status:s,origin:a,links:l}}function $c(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:te(e).parent_span_id,i=ai(e).scope,s=r?i?.getPropagationContext().propagationSpanId||Ht():t;return{parent_span_id:o,span_id:s,trace_id:n}}function La(e){let{traceId:t,spanId:n}=e.spanContext(),r=pn(e);return Na(t,n,r)}function u_(e){let{traceId:t,spanId:n}=e.spanContext(),r=pn(e);return Aa(t,n,r)}function Oa(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...o},attributes:i})=>({span_id:t,trace_id:n,sampled:r===Pa,attributes:i,...o}))}function wp(e){if(e?.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===Pa,attributes:o}))}function fn(e){return typeof e=="number"?a_(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?a_(e.getTime()):Ae()}function a_(e){return e>9999999999?e/1e3:e}function te(e){if(m_(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(p_(e)){let{attributes:r,startTime:o,name:i,endTime:s,status:a,links:l}=e;return{span_id:t,trace_id:n,data:r,description:i,parent_span_id:d_(e),start_timestamp:fn(o),timestamp:fn(s)||void 0,status:Ua(a),op:r[Ye],origin:r[Ce],links:Oa(l)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Da(e){if(m_(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(p_(e)){let{attributes:r,startTime:o,name:i,endTime:s,status:a,links:l}=e;return{name:i,span_id:t,trace_id:n,parent_span_id:d_(e),start_timestamp:fn(o),end_timestamp:fn(s),is_segment:e===Ma(e),status:Cp(a),attributes:r,links:wp(l)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===Ma(e)}}function d_(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function f_(e){return{...e,attributes:yp(e.attributes),links:e.links?.map(t=>({...t,attributes:yp(t.attributes)}))}}function p_(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function m_(e){return typeof e.getSpanJSON=="function"}function pn(e){let{traceFlags:t}=e.spanContext();return t===Pa}function Ua(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function Cp(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}var li="_sentryChildSpans",Tp="_sentryRootSpan";function Fa(e,t){let n=e[Tp]||e;qe(t,Tp,n),e[li]?e[li].add(t):qe(e,li,new Set([t]))}function h_(e,t){e[li]&&e[li].delete(t)}function $r(e){let t=new Set;function n(r){if(!t.has(r)&&pn(r)){t.add(r);let o=r[li]?Array.from(r[li]):[];for(let i of o)n(i)}}return n(e),Array.from(t)}var be=Ma;function Ma(e){return e[Tp]||e}function Me(){let e=wn(),t=Er(e);return t.getActiveSpan?t.getActiveSpan():ii(ee())}function Ba(){s_||(bt(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),s_=!0)}var g_=!1;function zc(){if(g_)return;function e(){let t=Me(),n=t&&be(t);if(n){let r="internal_error";O&&C.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}g_=!0,_a(e),va(e)}function Et(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||z()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function y_(e){C.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function zr(e,t){if(!t?.length)return!1;for(let n of t){if(pb(n)){if(e.description&&_o(e.description,n))return O&&y_(e),!0;continue}let r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;let o=n.name?e.description&&_o(e.description,n.name):!0,i=n.op?e.op&&_o(e.op,n.op):!0,s=n.attributes?Object.entries(n.attributes).every(([a,l])=>fb(e.attributes?.[a],l)):!0;if(o&&i&&s)return O&&y_(e),!0}return!1}function fb(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?_o(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e===t}function S_(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function pb(e){return typeof e=="string"||e instanceof RegExp}var ns="production";var __="_frozenDsc";function rs(e,t){qe(e,__,t)}function jc(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||ns,release:n.release,public_key:r,trace_id:e,org_id:o_(t)};return t.emit("createDsc",o),o}function os(e,t){let n=t.getPropagationContext();return n.dsc||jc(n.traceId,e)}function ht(e){let t=z();if(!t)return{};let n=be(e),r=te(n),o=r.data,i=n.spanContext().traceState,s=i?.get("sentry.sample_rate")??o[Br]??o[Zi];function a(y){return(typeof s=="number"||typeof s=="string")&&(y.sample_rate=`${s}`),y}let l=n[__];if(l)return a(l);let c=i?.get("sentry.dsc"),u=c&&Uc(c);if(u)return a(u);let d=jc(e.spanContext().traceId,t),p=o[vt]??o["sentry.span.source"],h=r.description;return p!=="url"&&h&&(d.transaction=h),Et()&&(d.sampled=String(pn(n)),d.sample_rand=i?.get("sentry.sample_rand")??ai(n).scope?.getPropagationContext().sampleRand.toString()),a(d),t.emit("createDsc",d,n),d}var Nt=class{constructor(t={}){this._traceId=t.traceId||Xt(),this._spanId=t.spanId||Ht(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Hc}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,r){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}};function Wc(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function Qt(e,t=[]){return[e,t]}function Gc(e,t){let[n,r]=e;return[n,[...r,t]]}function Ha(e,t){let n=e[1];for(let r of n){let o=r[0].type;if(t(r,o))return!0}return!1}function xp(e,t){return Ha(e,(n,r)=>t.includes(r))}function Rp(e){let t=Zo(V);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function bp(e){let[t,n]=e,r=JSON.stringify(t);function o(i){typeof r=="string"?r=typeof i=="string"?r+i:[Rp(r),i]:r.push(typeof i=="string"?Rp(i):i)}for(let i of n){let[s,a]=i;if(o(`
|
|
11
|
+
Name: ${Qt(r)}
|
|
12
|
+
Error:`,o)}}var cp=null;function Ea(e){let t="error";Ft(t,e),Bt(t,Fx)}function Fx(){cp=G.onerror,G.onerror=function(e,t,n,r,o){return mt("error",{column:r,error:o,line:n,msg:e,url:t}),cp?cp.apply(this,arguments):!1},G.onerror.__SENTRY_INSTRUMENTED__=!0}var up=null;function Ta(e){let t="unhandledrejection";Ft(t,e),Bt(t,Bx)}function Bx(){up=G.onunhandledrejection,G.onunhandledrejection=function(e){return mt("unhandledrejection",e),up?up.apply(this,arguments):!0},G.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var FS=Object.prototype.toString;function Un(e){switch(FS.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return ir(e,Error)}}function Ji(e,t){return FS.call(e)===`[object ${t}]`}function Xi(e){return Ji(e,"ErrorEvent")}function Ia(e){return Ji(e,"DOMError")}function Nc(e){return Ji(e,"DOMException")}function Ht(e){return Ji(e,"String")}function go(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function un(e){return e===null||go(e)||typeof e!="object"&&typeof e!="function"}function Fn(e){return Ji(e,"Object")}function yo(e){return typeof Event<"u"&&ir(e,Event)}function Ac(e){return Ji(e,"RegExp")}function or(e){return!!(e?.then&&typeof e.then=="function")}function ir(e,t){try{return e instanceof t}catch{return!1}}function wa(e){return typeof Request<"u"&&ir(e,Request)}function st(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&Ca(o,r);try{e[t]=o}catch{O&&C.log(`Failed to replace method "${t}" in object`,e)}}function Ve(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{O&&C.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function Ca(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,Ve(e,"__sentry_original__",t)}catch{}}function So(e){return e.__sentry_original__}function Ra(e){if(Un(e))return{message:e.message,name:e.name,stack:e.stack,...BS(e)};if(yo(e)){let{type:t,target:n,currentTarget:r,detail:o}=e;return{type:t,target:n,currentTarget:r,...o?{detail:o}:{},...BS(e)}}return e}function BS(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function Mc(e){let t=Object.keys(Ra(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}var Qi;function ni(e){if(Qi!==void 0)return Qi?Qi(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=G;return t in n&&typeof n[t]=="function"?(Qi=n[t],Qi(e)):(Qi=null,e())}function Bn(){return ni(()=>Math.random())}function ri(){return ni(()=>Date.now())}var Hx=Symbol.for("sentry.skipNormalization"),$x=Symbol.for("sentry.overrideNormalizationDepth");function HS(e){return!!e[Hx]}function $S(e){let t=e[$x];return typeof t=="number"?t:void 0}var dp;function Zi(e){dp=e}function $t(e,t=100,n=1/0){try{return fp("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function xa(e,t=3,n=100*1024){let r=$t(e,t);return Wx(r)>n?xa(e,t-1,n):r}function fp(e,t,n=1/0,r=1/0,o=Gx()){let[i,s]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let a=pp(e,t);if(!a.startsWith("[object "))return a;if(HS(t))return t;let l=$S(t),c=l!==void 0?l:n;if(c===0)return a.replace("object ","");if(i(t))return"[Circular ~]";let u=t;if(u&&typeof u.toJSON=="function")try{let y=u.toJSON();return fp("",y,c-1,r,o)}catch{}let f=Array.isArray(t)?[]:{},p=0,h=Ra(t);for(let y in h){if(!Object.prototype.hasOwnProperty.call(h,y))continue;if(p>=r){f[y]="[MaxProperties ~]";break}let _=h[y];f[y]=fp(y,_,c-1,r,o),p++}return s(t),f}function pp(e,t){try{if(dp){let r=dp(t);if(r)return r}return typeof global<"u"&&t===global?"[Global]":typeof t=="number"&&!Number.isFinite(t)?`[${t}]`:typeof t=="function"?`[Function: ${Qt(t)}]`:typeof t=="symbol"?`[${String(t)}]`:typeof t=="bigint"?`[BigInt: ${String(t)}]`:`[object ${zx(t)}]`}catch(n){return`**non-serializable** (${n})`}}function zx(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function jx(e){return~-encodeURI(e).split(/%..|./).length}function Wx(e){return jx(JSON.stringify(e))}function Gx(){let e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function oi(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function ba(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let o=e[r];un(o)?n.push(String(o)):o instanceof Error?n.push(o.message?`${o.name}: ${o.message}`:o.name):n.push(pp(void 0,o))}return n.join(t)}function _o(e,t,n=!1){return Ht(e)?Ac(t)?t.test(e):Ht(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function Nt(e,t=[],n=!1){for(let r of t)if(_o(e,r,n))return!0;return!1}function Vx(){let e=G;return e.crypto||e.msCrypto}var mp;function qx(){return Bn()*16}function at(e=Vx()){try{if(e?.randomUUID)return ni(()=>e.randomUUID()).replace(/-/g,"")}catch{}return mp||(mp="10000000100040008000"+1e11),mp.replace(/[018]/g,t=>(t^(qx()&15)>>t/4).toString(16))}function zS(e){return e.exception?.values?.[0]}function sr(e){let{message:t,event_id:n}=e;if(t)return t;let r=zS(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function ii(e,t,n){let r=e.exception=e.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function Hn(e,t){let n=zS(e);if(!n)return;let r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...t},t&&"data"in t){let i={...o?.data,...t.data};n.mechanism.data=i}}function ka(e){if(hp(e))return!0;try{Ve(e,"__sentry_captured__",!0)}catch{}return!1}function hp(e){try{return e.__sentry_captured__}catch{}}var WS=1e3;function dn(){return ri()/WS}function Yx(){let{performance:e}=G;if(!e?.now||!e.timeOrigin)return dn;let t=e.timeOrigin;return()=>(t+ni(()=>e.now()))/WS}var jS;function Ae(){return(jS??(jS=Yx()))()}var gp=null;function Kx(){let{performance:e}=G;if(!e?.now)return;let t=3e5,n=ni(()=>e.now()),r=ri(),o=e.timeOrigin;if(typeof o=="number"&&Math.abs(o+n-r)<t)return o;let i=e.timing?.navigationStart;return typeof i=="number"&&Math.abs(i+n-r)<t?i:r-n}function He(){return gp===null&&(gp=Kx()),gp}function GS(e){let t=Ae(),n={sid:at(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Jx(n)};return e&&Hr(n,e),n}function Hr(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Ae(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:at()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{let n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function VS(e,t){let n={};t?n={status:t}:e.status==="ok"&&(n={status:"exited"}),Hr(e,n)}function Jx(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function vo(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=vo(r[o],t[o],n-1));return r}function Zt(){return at()}function zt(){return at().substring(16)}function Pc(e){try{let t=G.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function Lc(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var yp="_sentrySpan";function Eo(e,t){t?Ve(e,yp,Pc(t)):delete e[yp]}function si(e){return Lc(e[yp])}var Xx=100,fn=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Zt(),sampleRand:Bn()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,Eo(t,si(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Hr(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t=="function"?t(this):t,r=n instanceof e?n.getScopeData():Fn(n)?t:void 0,{tags:o,attributes:i,extra:s,user:a,contexts:l,level:c,fingerprint:u=[],propagationContext:f,conversationId:p}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...i},this._extra={...this._extra,...s},this._contexts={...this._contexts,...l},a&&Object.keys(a).length&&(this._user=a),c&&(this._level=c),u.length&&(this._fingerprint=u),f&&(this._propagationContext=f),p&&(this._conversationId=p),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Eo(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Zt(),sampleRand:Bn()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){let r=typeof n=="number"?n:Xx;if(r<=0)return this;let o={timestamp:dn(),...t,message:t.message?oi(t.message,2048):t.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:si(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=vo(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){let r=n?.event_id||at();if(!this._client)return O&&C.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){let o=r?.event_id||at();if(!this._client)return O&&C.warn("No client configured on scope - will not capture message!"),o;let i=r?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:i,...r,event_id:o},this),o}captureEvent(t,n){let r=t.event_id||n?.event_id||at();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(O&&C.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}};function qS(){return rr("defaultCurrentScope",()=>new fn)}function YS(){return rr("defaultIsolationScope",()=>new fn)}var KS=e=>e instanceof Promise&&!e[JS],JS=Symbol("chained PromiseLike"),XS=(e,t,n)=>{let r=e.then(o=>(t(o),o),o=>{throw n(o),o});return KS(r)&&KS(e)?r:Qx(e,r)},Qx=(e,t)=>{if(!t)return e;let n=!1;for(let r in e){if(r in t)continue;n=!0;let o=e[r];typeof o=="function"?Object.defineProperty(t,r,{value:(...i)=>o.apply(e,i),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[JS]:!0}),t};var Sp=class{constructor(t,n){let r;t?r=t:r=new fn;let o;n?o=n:o=new fn,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){let n=this._pushScope(),r;try{r=t(n)}catch(o){throw this._popScope(),o}return or(r)?XS(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function es(){let e=Rn(),t=ei(e);return t.stack=t.stack||new Sp(qS(),YS())}function Zx(e){return es().withScope(e)}function eb(e,t){let n=es();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function QS(e){return es().withScope(()=>e(es().getIsolationScope()))}function ZS(){return{withIsolationScope:QS,withScope:Zx,withSetScope:eb,withSetIsolationScope:(e,t)=>QS(t),getCurrentScope:()=>es().getScope(),getIsolationScope:()=>es().getIsolationScope()}}function Tr(e){let t=ei(e);return t.acs?t.acs:ZS()}function tb(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function nb(e,t){let{value:n,unit:r}=tb(e)?e:{value:e,unit:void 0},o=rb(n),i=r&&typeof r=="string"?{unit:r}:{};if(o)return{...o,...i};if(!t||t==="skip-undefined"&&n===void 0)return;let s="";try{s=JSON.stringify(n)??""}catch{}return{value:s,type:"string",...i}}function _p(e,t=!1){let n={};for(let[r,o]of Object.entries(e??{})){let i=nb(o,t);i&&(n[r]=i)}return n}function rb(e){if(Array.isArray(e))return{value:e,type:"array"};let t=typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?Number.isInteger(e)?"integer":"double":null;if(t)return{value:e,type:t}}var e_;function vp(){return e_?.()}function Oc(){return e_!==void 0}function te(){let e=Rn();return Tr(e).getCurrentScope()}function Xe(){let e=Rn();return Tr(e).getIsolationScope()}function Na(){return rr("globalScope",()=>new fn)}function $n(...e){let t=Rn(),n=Tr(t);if(e.length===2){let[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function $(){return te().getClient()}function Dc(e){let t=vp();if(t)return{trace_id:t.traceId,span_id:t.spanId};let n=e.getPropagationContext(),{traceId:r,parentSpanId:o,propagationSpanId:i}=n,s={trace_id:r,span_id:i||zt()};return o&&(s.parent_span_id=o),s}var vt="sentry.source",$r="sentry.sample_rate",ts="sentry.previous_trace_sample_rate",qe="sentry.op",we="sentry.origin",zr="sentry.idle_span_finish_reason",ar="sentry.measurement_unit",lr="sentry.measurement_value";var ns="sentry.custom_span_name",ai="sentry.profile_id",jt="sentry.exclusive_time";var Uc="sentry.link.type",Fc="gen_ai.conversation.id";function Ep(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:"unauthenticated"};case 403:return{code:2,message:"permission_denied"};case 404:return{code:2,message:"not_found"};case 409:return{code:2,message:"already_exists"};case 413:return{code:2,message:"failed_precondition"};case 429:return{code:2,message:"resource_exhausted"};case 499:return{code:2,message:"cancelled"};default:return{code:2,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:"unimplemented"};case 503:return{code:2,message:"unavailable"};case 504:return{code:2,message:"deadline_exceeded"};default:return{code:2,message:"internal_error"}}return{code:2,message:"internal_error"}}function rs(e,t){e.setAttribute("http.response.status_code",t);let n=Ep(t);n.message!=="unknown_error"&&e.setStatus(n)}var t_="_sentryScope",n_="_sentryIsolationScope";function r_(e,t,n){e&&(Ve(e,n_,Pc(n)),Ve(e,t_,t))}function li(e){let t=e;return{scope:t[t_],isolationScope:Lc(t[n_])}}var Aa="sentry-";var ob=8192;function Bc(e){let t=ib(e);if(!t)return;let n=Object.entries(t).reduce((r,[o,i])=>{if(o.startsWith(Aa)){let s=o.slice(Aa.length);r[s]=i}return r},{});if(Object.keys(n).length>0)return n}function Tp(e){if(!e)return;let t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${Aa}${r}`]=o),n),{});return sb(t)}function ib(e){if(!(!e||!Ht(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{let r=o_(n);return Object.entries(r).forEach(([o,i])=>{t[o]=i}),t},{}):o_(e)}function o_(e){return e.split(",").map(t=>{let n=t.indexOf("=");if(n===-1)return[];let r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(i=>{try{return decodeURIComponent(i.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function sb(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],o)=>{let i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,s=o===0?i:`${t},${i}`;return s.length>ob?(O&&C.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):s},"")}var ab=/^o(\d+)\./,lb=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function cb(e){return e==="http"||e==="https"}function xn(e,t=!1){let{host:n,path:r,pass:o,port:i,projectId:s,protocol:a,publicKey:l}=e;return`${a}://${l}${t&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${s}`}function ub(e){let t=lb.exec(e);if(!t){kt(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,o="",i="",s="",a=""]=t.slice(1),l="",c=a,u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){let f=c.match(/^\d+/);f&&(c=f[0])}return i_({host:i,pass:o,path:l,projectId:c,port:s,protocol:n,publicKey:r})}function i_(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function db(e){if(!O)return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(s=>e[s]?!1:(C.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:n.match(/^\d+$/)?cb(r)?t&&isNaN(parseInt(t,10))?(C.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(C.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(C.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function fb(e){return e.match(ab)?.[1]}function s_(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=fb(n)),r}function Hc(e){let t=typeof e=="string"?ub(e):i_(e);if(!(!t||!db(t)))return t}function bn(e){if(typeof e=="boolean")return Number(e);let t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}var $c=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function a_(e){if(!e)return;let t=e.match($c);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function Ip(e,t){let n=a_(e),r=Bc(t);if(!n?.traceId)return{traceId:Zt(),sampleRand:Bn()};let o=pb(n,r);r&&(r.sample_rand=o.toString());let{traceId:i,parentSpanId:s,parentSampled:a}=n;return{traceId:i,parentSpanId:s,sampled:a,dsc:r||{},sampleRand:o}}function Ma(e=Zt(),t=zt(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function Pa(e=Zt(),t=zt(),n){return`00-${e}-${t}-${n?"01":"00"}`}function pb(e,t){let n=bn(t?.sample_rand);if(n!==void 0)return n;let r=bn(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?Bn()*r:r+Bn()*(1-r):Bn()}var zc=0,Oa=1,l_=!1;function d_(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:o,parent_span_id:i,status:s,origin:a,links:l}=ne(e);return{parent_span_id:i,span_id:t,trace_id:n,data:r,op:o,status:s,origin:a,links:l}}function jc(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:ne(e).parent_span_id,i=li(e).scope,s=r?i?.getPropagationContext().propagationSpanId||zt():t;return{parent_span_id:o,span_id:s,trace_id:n}}function Da(e){let{traceId:t,spanId:n}=e.spanContext(),r=mn(e);return Ma(t,n,r)}function f_(e){let{traceId:t,spanId:n}=e.spanContext(),r=mn(e);return Pa(t,n,r)}function Ua(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...o},attributes:i})=>({span_id:t,trace_id:n,sampled:r===Oa,attributes:i,...o}))}function Rp(e){if(e?.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===Oa,attributes:o}))}function pn(e){return typeof e=="number"?c_(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?c_(e.getTime()):Ae()}function c_(e){return e>9999999999?e/1e3:e}function ne(e){if(g_(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(h_(e)){let{attributes:r,startTime:o,name:i,endTime:s,status:a,links:l}=e;return{span_id:t,trace_id:n,data:r,description:i,parent_span_id:p_(e),start_timestamp:pn(o),timestamp:pn(s)||void 0,status:Ba(a),op:r[qe],origin:r[we],links:Ua(l)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Fa(e){if(g_(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(h_(e)){let{attributes:r,startTime:o,name:i,endTime:s,status:a,links:l}=e;return{name:i,span_id:t,trace_id:n,parent_span_id:p_(e),start_timestamp:pn(o),end_timestamp:pn(s),is_segment:e===La(e),status:xp(a),attributes:r,links:Rp(l)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===La(e)}}function p_(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function m_(e){return{...e,attributes:_p(e.attributes),links:e.links?.map(t=>({...t,attributes:_p(t.attributes)}))}}function h_(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function g_(e){return typeof e.getSpanJSON=="function"}function mn(e){let{traceFlags:t}=e.spanContext();return t===Oa}function Ba(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function xp(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}var ci="_sentryChildSpans",wp="_sentryRootSpan";function Ha(e,t){let n=e[wp]||e;Ve(t,wp,n),e[ci]?e[ci].add(t):Ve(e,ci,new Set([t]))}function y_(e,t){e[ci]&&e[ci].delete(t)}function jr(e){let t=new Set;function n(r){if(!t.has(r)&&mn(r)){t.add(r);let o=r[ci]?Array.from(r[ci]):[];for(let i of o)n(i)}}return n(e),Array.from(t)}var be=La;function La(e){return e[wp]||e}function Me(){let e=Rn(),t=Tr(e);return t.getActiveSpan?t.getActiveSpan():si(te())}function $a(){l_||(kt(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),l_=!0)}var S_=!1;function Wc(){if(S_)return;function e(){let t=Me(),n=t&&be(t);if(n){let r="internal_error";O&&C.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}S_=!0,Ea(e),Ta(e)}function Et(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||$()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function __(e){C.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Wr(e,t){if(!t?.length)return!1;for(let n of t){if(hb(n)){if(e.description&&_o(e.description,n))return O&&__(e),!0;continue}let r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;let o=n.name?e.description&&_o(e.description,n.name):!0,i=n.op?e.op&&_o(e.op,n.op):!0,s=n.attributes?Object.entries(n.attributes).every(([a,l])=>mb(e.attributes?.[a],l)):!0;if(o&&i&&s)return O&&__(e),!0}return!1}function mb(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?_o(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e===t}function v_(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function hb(e){return typeof e=="string"||e instanceof RegExp}var os="production";var E_="_frozenDsc";function is(e,t){Ve(e,E_,t)}function Gc(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||os,release:n.release,public_key:r,trace_id:e,org_id:s_(t)};return t.emit("createDsc",o),o}function ss(e,t){let n=t.getPropagationContext();return n.dsc||Gc(n.traceId,e)}function ht(e){let t=$();if(!t)return{};let n=be(e),r=ne(n),o=r.data,i=n.spanContext().traceState,s=i?.get("sentry.sample_rate")??o[$r]??o[ts];function a(y){return(typeof s=="number"||typeof s=="string")&&(y.sample_rate=`${s}`),y}let l=n[E_];if(l)return a(l);let c=i?.get("sentry.dsc"),u=c&&Bc(c);if(u)return a(u);let f=Gc(e.spanContext().traceId,t),p=o[vt]??o["sentry.span.source"],h=r.description;return p!=="url"&&h&&(f.transaction=h),Et()&&(f.sampled=String(mn(n)),f.sample_rand=i?.get("sentry.sample_rand")??li(n).scope?.getPropagationContext().sampleRand.toString()),a(f),t.emit("createDsc",f,n),f}var At=class{constructor(t={}){this._traceId=t.traceId||Zt(),this._spanId=t.spanId||zt(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:zc}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,r){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}};function Vc(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function en(e,t=[]){return[e,t]}function qc(e,t){let[n,r]=e;return[n,[...r,t]]}function za(e,t){let n=e[1];for(let r of n){let o=r[0].type;if(t(r,o))return!0}return!1}function kp(e,t){return za(e,(n,r)=>t.includes(r))}function bp(e){let t=ei(G);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Np(e){let[t,n]=e,r=JSON.stringify(t);function o(i){typeof r=="string"?r=typeof i=="string"?r+i:[bp(r),i]:r.push(typeof i=="string"?bp(i):i)}for(let i of n){let[s,a]=i;if(o(`
|
|
13
13
|
${JSON.stringify(s)}
|
|
14
|
-
`),typeof a=="string"||a instanceof Uint8Array)o(a);else{let l;try{l=JSON.stringify(a)}catch{l=JSON.stringify(
|
|
14
|
+
`),typeof a=="string"||a instanceof Uint8Array)o(a);else{let l;try{l=JSON.stringify(a)}catch{l=JSON.stringify($t(a))}o(l)}}return typeof r=="string"?r:gb(r)}function gb(e){let t=e.reduce((o,i)=>o+i.length,0),n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return n}function Ap(e){return[{type:"span"},e]}function Mp(e){let t=typeof e.data=="string"?bp(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var T_={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function yb(e){return e in T_}function Yc(e){return yb(e)?T_[e]:e}function as(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function ja(e,t,n,r){let o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:xn(r)},...o&&{trace:o}}}function Sb(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function I_(e,t,n,r){let o=as(n),i={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:xn(t)}},s="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return en(i,[s])}function w_(e,t,n,r){let o=as(n),i=e.type&&e.type!=="replay_event"?e.type:"event";Sb(e,n?.sdk);let s=ja(e,o,r,t);return delete e.sdkProcessingMetadata,en(s,[[{type:i},e]])}function C_(e,t){function n(h){return!!h.trace_id&&!!h.public_key}let r=ht(e[0]),o=t?.getDsn(),i=t?.getOptions().tunnel,s={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!i&&o&&{dsn:xn(o)}},{beforeSendSpan:a,ignoreSpans:l}=t?.getOptions()||{},c=l?.length?e.filter(h=>{let y=ne(h);return!Wr({description:y.description,op:y.op,attributes:y.data},l)}):e,u=e.length-c.length;u&&t?.recordDroppedEvent("before_send","span",u);let f=a?h=>{let y=ne(h),_=Vc(a)?y:a(y);return _||($a(),y)}:ne,p=[];for(let h of c){let y=f(h);y&&p.push(Ap(y))}return en(s,p)}function R_(e){if(!O)return;let{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=ne(e),{spanId:o}=e.spanContext(),i=mn(e),s=be(e),a=s===e,l=`[Tracing] Starting ${i?"sampled":"unsampled"} ${a?"root ":""}span`,c=[`op: ${n}`,`name: ${t}`,`ID: ${o}`];if(r&&c.push(`parent ID: ${r}`),!a){let{op:u,description:f}=ne(s);c.push(`root ID: ${s.spanContext().spanId}`),u&&c.push(`root op: ${u}`),f&&c.push(`root description: ${f}`)}C.log(`${l}
|
|
15
15
|
${c.join(`
|
|
16
|
-
`)}`)}function C_(e){if(!O)return;let{description:t="< unknown name >",op:n="< unknown op >"}=te(e),{spanId:r}=e.spanContext(),i=be(e)===e,s=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;C.log(s)}function qc(e,t,n,r=Me()){let o=r&&be(r);o&&(O&&C.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[ar]:t,[sr]:n}))}function Yc(e){if(!e||e.length===0)return;let t={};return e.forEach(n=>{let r=n.attributes||{},o=r[sr],i=r[ar];typeof o=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:o})}),t}function At(e){return e.getOptions().traceLifecycle==="stream"}var R_=1e3,To=class{constructor(t={}){this._traceId=t.traceId||Xt(),this._spanId=t.spanId||Ht(),this._startTime=t.startTimestamp||Ae(),this._links=t.links,this._attributes={},this.setAttributes({[Ce]:"manual",[Ye]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){let{_spanId:t,_traceId:n,_sampled:r}=this;return{spanId:t,traceId:n,traceFlags:r?Pa:Hc}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=fn(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(vt,"custom"),this}end(t){this._endTime||(this._endTime=fn(t),C_(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Ye],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Ua(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[Ce],profile_id:this._attributes[si],exclusive_time:this._attributes[$t],measurements:Yc(this._events),is_segment:this._isStandaloneSpan&&be(this)===this||void 0,segment_id:this._isStandaloneSpan?be(this).spanContext().spanId:void 0,links:Oa(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===be(this),status:Cp(this._status),attributes:this._attributes,links:wp(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){O&&C.log("[Tracing] Adding an event to span:",t);let o=x_(n)?n:r||Ae(),i=x_(n)?{}:n||{},s={name:t,time:fn(o),attributes:i};return this._events.push(s),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let t=z();if(t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===be(this)))return;if(this._isStandaloneSpan){this._sampled?Sb(I_([this],t)):(O&&C.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&At(t)){t.emit("afterSegmentSpanEnd",this);return}let r=this._convertSpanToTransaction();r&&(ai(this).scope||ee()).captureEvent(r)}_convertSpanToTransaction(){if(!b_(te(this)))return;this._name||(O&&C.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:t,isolationScope:n}=ai(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let i=$r(this).filter(d=>d!==this&&!yb(d)).map(d=>te(d)).filter(b_),s=this._attributes[vt];delete this._attributes[es];let a=!1;i.forEach(d=>{delete d.data[es],d.op?.startsWith("gen_ai.")&&(a=!0)});let l={contexts:{trace:c_(this)},spans:i.length>R_?i.sort((d,p)=>d.start_timestamp-p.start_timestamp).slice(0,R_):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:ht(this),hasGenAiSpans:a},request:r,...s&&{transaction_info:{source:s}}},c=Yc(this._events);return c&&Object.keys(c).length&&(O&&C.log("[Measurements] Adding measurements to transaction event",JSON.stringify(c,void 0,2)),l.measurements=c),l}};function x_(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function b_(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function yb(e){return e instanceof To&&e.isStandaloneSpan()}function Sb(e){let t=z();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function k_(e,t,n){if(!Et(e))return[!1];let r,o;typeof e.tracesSampler=="function"?(o=e.tracesSampler({...t,inheritOrSampleWith:a=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):a}),r=!0):t.parentSampled!==void 0?o=t.parentSampled:typeof e.tracesSampleRate<"u"&&(o=e.tracesSampleRate,r=!0);let i=Rn(o);if(i===void 0)return O&&C.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(o)} of type ${JSON.stringify(typeof o)}.`),[!1];if(!i)return O&&C.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,i,r];let s=n<i;return s||O&&C.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[s,i,r]}var Ap="__SENTRY_SUPPRESS_TRACING__";function wt(e){let t=A_();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=vb(e),{forceTransaction:r,parentSpan:o}=e;return(e.scope?s=>$n(e.scope,s):o!==void 0?s=>ss(o,s):s=>s())(()=>{let s=ee(),a=Tb(s,o),l=z();return e.onlyIfParent&&!a?(l?.recordDroppedEvent("no_parent_span","span"),new Nt):_b({parentSpan:a,spanArguments:n,forceTransaction:r,scope:s})})}function ss(e,t){let n=A_();return n.withActiveSpan?n.withActiveSpan(e,t):$n(r=>(Eo(r,e||void 0),t(r)))}function _b({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Et()){let a=new Nt;if(n||!e){let l={sampled:"false",sample_rate:"0",transaction:t.name,...ht(a)};rs(a,l)}return a}let o=z();if(Ib(o,t))return Mp(r)||o?.recordDroppedEvent("ignored","span"),new Nt({dropReason:"ignored",traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});let i=Qe(),s;if(e&&!n)s=Eb(e,r,t),Fa(e,s);else if(e){let a=ht(e),{traceId:l,spanId:c}=e.spanContext(),u=pn(e);s=N_({traceId:l,parentSpanId:c,...t},r,u),rs(s,a)}else{let{traceId:a,dsc:l,parentSpanId:c,sampled:u}={...i.getPropagationContext(),...r.getPropagationContext()};s=N_({traceId:a,parentSpanId:c,...t},r,u),l&&rs(s,l)}return w_(s),t_(s,r,i),s}function vb(e){let n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let r={...n};return r.startTimestamp=fn(e.startTime),delete r.startTime,r}return n}function A_(){let e=wn();return Er(e)}function N_(e,t,n){let r=z(),o=r?.getOptions()||{},{name:i=""}=e,s={spanAttributes:{...e.attributes},spanName:i,parentSampled:n};r?.emit("beforeSampling",s,{decision:!1});let a=s.parentSampled??n,l=s.spanAttributes,c=t.getPropagationContext(),u=Mp(t),[d,p,h]=u?[!1]:k_(o,{name:i,parentSampled:a,attributes:l,parentSampleRate:Rn(c.dsc?.sample_rate)},c.sampleRand),y=new To({...e,attributes:{[vt]:"custom",[Br]:p!==void 0&&h?p:void 0,...l},sampled:d});return!d&&r&&!u&&(O&&C.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",At(r)?"span":"transaction")),r&&r.emit("spanStart",y),y}function Eb(e,t,n){let{spanId:r,traceId:o}=e.spanContext(),i=Mp(t),s=i?!1:pn(e),a=s?new To({...n,parentSpanId:r,traceId:o,sampled:s}):new Nt({traceId:o});Fa(e,a);let l=z();return l&&(At(l)&&a instanceof Nt&&(e instanceof Nt&&e.dropReason?(a.dropReason=e.dropReason,l.recordDroppedEvent(e.dropReason,"span")):i||(a.dropReason="sample_rate",l.recordDroppedEvent("sample_rate","span"))),l.emit("spanStart",a),n.endTimestamp&&(l.emit("spanEnd",a),l.emit("afterSpanEnd",a))),a}function Tb(e,t){if(t)return t;if(t===null)return;let n=ii(e);if(!n)return;let r=z();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?be(n):n}function Ib(e,t){let n=e?.getOptions().ignoreSpans;return!e||!At(e)||!n?.length?!1:zr({description:t.name||"",op:t.attributes?.[Ye]||t.op,attributes:t.attributes},n)}function Mp(e){return e.getScopeData().sdkProcessingMetadata[Ap]===!0}var as={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},wb="heartbeatFailed",Cb="idleTimeout",Rb="finalTimeout",xb="externalFinish";function Kc(e,t={}){let n=new Map,r=!1,o,i=xb,s=!t.disableAutoFinish,a=[],{idleTimeout:l=as.idleTimeout,finalTimeout:c=as.finalTimeout,childSpanTimeout:u=as.childSpanTimeout,beforeSpanEnd:d,trimIdleSpanEndTimestamp:p=!0}=t,h=z();if(!h||!Et()){let I=new Nt,N={sample_rate:"0",sampled:"false",...ht(I)};return rs(I,N),I}let y=ee(),_=Me(),T=bb(e);T.end=new Proxy(T.end,{apply(I,N,U){if(d&&d(T),N instanceof Nt)return;let[x,...$]=U,W=x||Ae(),ye=fn(W),K=$r(T).filter(J=>J!==T),et=te(T);if(!K.length||!p)return A(ye),Reflect.apply(I,N,[ye,...$]);let pe=h.getOptions().ignoreSpans,fe=K?.reduce((J,le)=>{let Ie=te(le);return!Ie.timestamp||pe&&zr({description:Ie.description,op:Ie.op,attributes:Ie.data},pe)?J:J?Math.max(J,Ie.timestamp):Ie.timestamp},void 0),D=et.start_timestamp,Se=Math.min(D?D+c/1e3:1/0,Math.max(D||-1/0,Math.min(ye,fe||1/0)));return A(Se),Reflect.apply(I,N,[Se,...$])}});function g(){o&&(clearTimeout(o),o=void 0)}function S(I){g(),o=setTimeout(()=>{!r&&n.size===0&&s&&(i=Cb,T.end(I))},l)}function E(I){o=setTimeout(()=>{!r&&s&&(i=wb,T.end(I))},u)}function R(I){g(),n.set(I,!0);let N=Ae();E(N+u/1e3)}function M(I){if(n.has(I)&&n.delete(I),n.size===0){let N=Ae();S(N+l/1e3)}}function A(I){r=!0,n.clear(),a.forEach(K=>K()),Eo(y,_);let N=te(T),{start_timestamp:U}=N;if(!U)return;N.data[Hr]||T.setAttribute(Hr,i);let $=N.status;(!$||$==="unknown")&&T.setStatus({code:1}),C.log(`[Tracing] Idle span "${N.op}" finished`);let W=$r(T).filter(K=>K!==T),ye=0;W.forEach(K=>{K.isRecording()&&(K.setStatus({code:2,message:"cancelled"}),K.end(I),O&&C.log("[Tracing] Cancelling span since span ended early",JSON.stringify(K,void 0,2)));let et=te(K),{timestamp:pe=0,start_timestamp:fe=0}=et,D=fe<=I,Se=(c+l)/1e3,J=pe-fe<=Se;if(O){let le=JSON.stringify(K,void 0,2);D?J||C.log("[Tracing] Discarding span since it finished after idle span final timeout",le):C.log("[Tracing] Discarding span since it happened after idle span was finished",le)}(!J||!D)&&(h_(T,K),ye++)}),ye>0&&T.setAttribute("sentry.idle_span_discarded_spans",ye)}return a.push(h.on("spanStart",I=>{if(r||I===T||te(I).timestamp||I instanceof To&&I.isStandaloneSpan())return;$r(T).includes(I)&&R(I.spanContext().spanId)})),a.push(h.on("spanEnd",I=>{r||M(I.spanContext().spanId)})),a.push(h.on("idleSpanEnableAutoFinish",I=>{I===T&&(s=!0,S(),n.size&&E())})),t.disableAutoFinish||S(),setTimeout(()=>{r||(T.setStatus({code:2,message:"deadline_exceeded"}),i=Rb,T.end())},c),T}function bb(e){let t=wt(e);return Eo(ee(),t),O&&C.log("[Tracing] Started span is an idle span"),t}function P_(e,t){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=t;kb(e,t),r&&Mb(e,r),Pb(e,n),Nb(e,o),Ab(e,i)}function M_(e,t){let{extra:n,tags:r,attributes:o,user:i,contexts:s,level:a,sdkProcessingMetadata:l,breadcrumbs:c,fingerprint:u,eventProcessors:d,attachments:p,propagationContext:h,transactionName:y,span:_}=t;za(e,"extra",n),za(e,"tags",r),za(e,"attributes",o),za(e,"user",i),za(e,"contexts",s),e.sdkProcessingMetadata=vo(e.sdkProcessingMetadata,l,2),a&&(e.level=a),y&&(e.transactionName=y),_&&(e.span=_),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),p.length&&(e.attachments=[...e.attachments,...p]),e.propagationContext={...e.propagationContext,...h}}function za(e,t,n){e[t]=vo(e[t],n,1)}function Jc(e,t){let n=ba().getScopeData();return e&&M_(n,e.getScopeData()),t&&M_(n,t.getScopeData()),n}function kb(e,t){let{extra:n,tags:r,user:o,contexts:i,level:s,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(o).length&&(e.user={...o,...e.user}),Object.keys(i).length&&(e.contexts={...i,...e.contexts}),s&&(e.level=s),a&&e.type!=="transaction"&&(e.transaction=a)}function Nb(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Ab(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Mb(e,t){e.contexts={trace:$c(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:ht(t),...e.sdkProcessingMetadata};let n=be(t),r=te(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function Pb(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}var Lb="thismessage:/";function ui(e){return"isRelative"in e}function Tr(e,t){let n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=t??(n?Lb:void 0);try{if("canParse"in URL&&!URL.canParse(e,r))return;let o=new URL(e,r);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch{}}function ls(e){if(ui(e))return e.pathname;let t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function zn(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Xc(e){return e.split(/[?#]/,1)[0]}function zt(e,t=!0){if(e.startsWith("data:")){let n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=e.includes(";base64,"),i=e.indexOf(","),s="";if(t&&i!==-1){let a=e.slice(i+1);s=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${o?",base64":""}${s?`,${s}`:""}`}return e}function Io(e,t){let n=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}var Pp=0,L_=1,O_=2;function Ir(e){return new ja(t=>{t(e)})}function di(e){return new ja((t,n)=>{n(e)})}var ja=class e{constructor(t){this._state=Pp,this._handlers=[],this._runExecutor(t)}then(t,n){return new e((r,o)=>{this._handlers.push([!1,i=>{if(!t)r(i);else try{r(t(i))}catch(s){o(s)}},i=>{if(!n)o(i);else try{r(n(i))}catch(s){o(s)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new e((n,r)=>{let o,i;return this.then(s=>{i=!1,o=s,t&&t()},s=>{i=!0,o=s,t&&t()}).then(()=>{if(i){r(o);return}n(o)})})}_executeHandlers(){if(this._state===Pp)return;let t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===L_&&n[1](this._value),this._state===O_&&n[2](this._value),n[0]=!0)})}_runExecutor(t){let n=(i,s)=>{if(this._state===Pp){if(rr(s)){s.then(r,o);return}this._state=i,this._value=s,this._executeHandlers()}},r=i=>{n(L_,i)},o=i=>{n(O_,i)};try{t(r,o)}catch(i){o(i)}}};function D_(e,t,n,r=0){try{let o=Lp(t,n,e,r);return rr(o)?o:Ir(o)}catch(o){return di(o)}}function Lp(e,t,n,r){let o=n[r];if(!e||!o)return e;let i=o({...e},t);return O&&i===null&&C.log(`Event processor "${o.id||"?"}" dropped event`),rr(i)?i.then(s=>Lp(s,t,n,r+1)):Lp(i,t,n,r+1)}var fi,U_,F_,wo;function B_(e){let t=V._sentryDebugIds,n=V._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(wo&&r.length===U_&&o.length===F_)return wo;U_=r.length,F_=o.length,wo={},fi||(fi={});let i=(s,a)=>{for(let l of s){let c=a[l],u=fi?.[l];if(u&&wo&&c)wo[u[0]]=c,fi&&(fi[l]=[u[0],c]);else if(c){let d=e(l);for(let p=d.length-1;p>=0;p--){let y=d[p]?.filename;if(y&&wo&&fi){wo[y]=c,fi[l]=[y,c];break}}}}};return t&&i(r,t),n&&i(o,n),wo}function Wa(e,t,n,r,o,i){let{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=e,l={...t,event_id:t.event_id||n.event_id||st(),timestamp:t.timestamp||un()},c=n.integrations||e.integrations.map(g=>g.name);Ob(l,e),Fb(l,c),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&Db(l,e.stackParser);let u=Hb(r,n.captureContext);n.mechanism&&Hn(l,n.mechanism);let d=o?o.getEventProcessors():[],p=Jc(i,u),h=[...n.attachments||[],...p.attachments];h.length&&(n.attachments=h),P_(l,p);let y=[...d,...p.eventProcessors];return(n.data&&n.data.__sentry__===!0?Ir(l):D_(y,l,n)).then(g=>(g&&Ub(g),typeof s=="number"&&s>0?Bb(g,s,a):g))}function Ob(e,t){let{environment:n,release:r,dist:o,maxValueLength:i}=t;e.environment=e.environment||n||ns,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);let s=e.request;s?.url&&i&&(s.url=ri(s.url,i)),i&&e.exception?.values?.forEach(a=>{a.value&&(a.value=ri(a.value,i))})}function Db(e,t){let n=B_(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function Ub(e){let t={};if(e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?t[o.abs_path]=o.debug_id:o.filename&&(t[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function Fb(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Bb(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:Bt(o.data,t,n)}}))},...e.user&&{user:Bt(e.user,t,n)},...e.contexts&&{contexts:Bt(e.contexts,t,n)},...e.extra&&{extra:Bt(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Bt(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:Bt(o.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=Bt(e.contexts.flags,3,n)),r}function Hb(e,t){if(!t)return e;let n=e?e.clone():new dn;return n.update(t),n}function H_(e){if(e)return $b(e)?{captureContext:e}:jb(e)?{captureContext:e}:e}function $b(e){return e instanceof dn||typeof e=="function"}var zb=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function jb(e){return Object.keys(e).some(t=>zb.includes(t))}function jr(e,t){return ee().captureException(e,H_(t))}function cs(e,t){return ee().captureEvent(e,t)}function pi(e,t){Qe().setContext(e,t)}function Ga(){return Qe().lastEventId()}function Va(){let e=z();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function qa(e){Qe().addEventProcessor(e)}function us(e){let t=Qe(),{user:n}=Jc(t,ee()),{userAgent:r}=V.navigator||{},o=jS({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return i?.status==="ok"&&Fr(i,{status:"exited"}),Ya(),t.setSession(o),o}function Ya(){let e=Qe(),n=ee().getSession()||e.getSession();n&&WS(n),$_(),e.setSession()}function $_(){let e=Qe(),t=z(),n=e.getSession();n&&t&&t.captureSession(n)}function mi(e=!1){if(e){Ya();return}$_()}var z_="7";function j_(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Wb(e){return`${j_(e)}${e.projectId}/envelope/`}function Gb(e,t){let n={sentry_version:z_};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Dp(e,t,n){return t||`${Wb(e)}?${Gb(e,n)}`}function Up(e,t){let n=Fc(e);if(!n)return"";let r=`${j_(n)}embed/error-page/`,o=`dsn=${Cn(n)}`;for(let i in t)if(i!=="dsn"&&i!=="onClose")if(i==="user"){let s=t.user;if(!s)continue;s.name&&(o+=`&name=${encodeURIComponent(s.name)}`),s.email&&(o+=`&email=${encodeURIComponent(s.email)}`)}else o+=`&${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`;return`${r}?${o}`}var Fp=[];function Vb(e){let t={};return e.forEach(n=>{let{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function Bp(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){let o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return Vb(r)}function W_(e,t){let n={};return t.forEach(r=>{r?.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&$p(e,r,n)}),n}function Hp(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function $p(e,t,n){if(n[t.name]){O&&C.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Fp.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Fp.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){let r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,i)=>r(o,i,e))}if(typeof t.processEvent=="function"){let r=t.processEvent.bind(t),o=Object.assign((i,s)=>r(i,s,e),{id:t.name});e.addEventProcessor(o)}["processSpan","processSegmentSpan"].forEach(r=>{let o=t[r];typeof o=="function"&&e.on(r,i=>o.call(t,i,e))}),O&&C.log(`Integration installed: ${t.name}`)}function zp(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function jp(){return"npm"}function G_(){return!zp()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function jn(){return typeof window<"u"&&(!G_()||qb())}function qb(){return V.process?.type==="renderer"}function Yb(e,t){let n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...jn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function V_(e,t,n,r,o){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=Cn(r)),Qt(i,[Yb(e,o)])}function ds(e,t){let n=t??Kb(e)??[];if(n.length===0)return;let r=e.getOptions(),o=V_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);q_().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function Kb(e){return q_().get(e)}function q_(){return nr("clientToLogBufferMap",()=>new WeakMap)}function Jb(e,t){let n=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...jn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function Y_(e,t,n,r,o){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=Cn(r)),Qt(i,[Jb(e,o)])}function Ka(e,t){let n=t??Xb(e)??[];if(n.length===0)return;let r=e.getOptions(),o=Y_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);K_().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function Xb(e){return K_().get(e)}function K_(){return nr("clientToMetricBufferMap",()=>new WeakMap)}function J_(e){let t={trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||"",start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:!e.status||e.status==="ok"||e.status==="cancelled"?"ok":"error",is_segment:!1,attributes:{...e.data},links:e.links};return f_(t)}function X_(e,t){if(e.type!=="transaction"||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||!t.getOptions().streamGenAiSpans||At(t))return;let n=[],r=[];for(let i of e.spans)i.op?.startsWith("gen_ai.")?n.push(J_(i)):r.push(i);if(n.length===0)return;e.spans=r;let o=t.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...jn()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:n}]}function Qc(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var fs=Symbol.for("SentryBufferFullError");function hi(e=100){let t=new Set;function n(){return t.size<e}function r(s){t.delete(s)}function o(s){if(!n())return di(fs);let a=s();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function i(s){if(!t.size)return Ir(!0);let a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!s)return a;let l=[a,new Promise(c=>Qc(setTimeout(()=>c(!1),s)))];return Promise.race(l)}return{get $(){return Array.from(t)},add:o,drain:i}}var Q_=60*1e3;function Z_(e,t=ni()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?Q_:r-t}function ev(e,t){return e[t]||e.all||0}function Ja(e,t,n=ni()){return ev(e,t)>n}function Xa(e,{statusCode:t,headers:n},r=ni()){let o={...e},i=n?.["x-sentry-rate-limits"],s=n?.["retry-after"];if(i)for(let a of i.trim().split(",")){let[l,c,,,u]=a.split(":",5),d=parseInt(l,10),p=(isNaN(d)?60:d)*1e3;if(!c)o.all=r+p;else for(let h of c.split(";"))h==="metric_bucket"?(!u||u.split(";").includes("custom"))&&(o[h]=r+p):o[h]=r+p}else s?o.all=r+Z_(s,r):t===429&&(o.all=r+60*1e3);return o}var Wp=64;function Zc(e,t,n=hi(e.bufferSize||Wp)){let r={},o=s=>n.drain(s);function i(s){let a=[];if(Ha(s,(d,p)=>{let h=Vc(p);Ja(r,h)?e.recordDroppedEvent("ratelimit_backoff",h):a.push(d)}),a.length===0)return Promise.resolve({});let l=Qt(s[0],a),c=d=>{if(xp(l,["client_report"])){O&&C.warn(`Dropping client report. Will not send outcomes (reason: ${d}).`);return}Ha(l,(p,h)=>{e.recordDroppedEvent(d,Vc(h))})},u=()=>t({body:bp(l)}).then(d=>d.statusCode===413?(O&&C.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),c("send_error"),d):(O&&d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&C.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=Xa(r,d),d),d=>{throw c("network_error"),O&&C.error("Encountered error running transport request:",d),d});return n.add(u).then(d=>d,d=>{if(d===fs)return O&&C.error("Skipped sending event because buffer is full."),c("queue_overflow"),Promise.resolve({});throw d})}return{send:i,flush:o}}function tv(e,t,n){let r=[{type:"client_report"},{timestamp:n||un(),discarded_events:e}];return Qt(t?{dsn:t}:{},[r])}function eu(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function nv(e){let{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:i,data:s,op:a}=e.contexts?.trace??{};return{data:s??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:s?.[si],exclusive_time:s?.[$t],measurements:e.measurements,is_segment:!0}}function rv(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[si]:e.profile_id},...e.exclusive_time&&{[$t]:e.exclusive_time}}}},measurements:e.measurements}}var Qa=["forwarded","-ip","remote-","via","-user"];function ov(e){return e===!0?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:5}:{userInfo:!1,cookies:{deny:Qa},httpHeaders:{request:{deny:Qa},response:{deny:Qa}},httpBodies:[],queryParams:{deny:Qa},genAI:{inputs:!1,outputs:!1},stackFrameVariables:!0,frameContextLines:5}}var Qb={userInfo:!1,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:[],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:5};function iv(e){let t=e.dataCollection!=null?Qb:ov(e.sendDefaultPii),n=e.dataCollection??{};return{userInfo:n.userInfo??t.userInfo,cookies:n.cookies??t.cookies,httpHeaders:{request:n.httpHeaders?.request??t.httpHeaders.request,response:n.httpHeaders?.response??t.httpHeaders.response},httpBodies:n.httpBodies??t.httpBodies,queryParams:n.queryParams??t.queryParams,genAI:{inputs:n.genAI?.inputs??t.genAI.inputs,outputs:n.genAI?.outputs??t.genAI.outputs},stackFrameVariables:n.stackFrameVariables??t.stackFrameVariables,frameContextLines:n.frameContextLines??t.frameContextLines}}var sv="Not capturing exception because it's already been captured.",av="Discarded session because of missing or non-string release",pv=Symbol.for("SentryInternalError"),mv=Symbol.for("SentryDoNotSendEventError"),Zb=5e3;function tu(e){return{message:e,[pv]:!0}}function Gp(e){return{message:e,[mv]:!0}}function lv(e){return!!e&&typeof e=="object"&&pv in e}function cv(e){return!!e&&typeof e=="object"&&mv in e}function uv(e,t,n,r,o){let i=0,s,a=!1;e.on(n,()=>{i=0,clearTimeout(s),a=!1}),e.on(t,l=>{if(i+=r(l),i>=8e5)o(e);else if(!a){let c=e.getOptions()._flushInterval??Zb;c>0&&(a=!0,s=Qc(setTimeout(()=>{o(e)},c)))}}),e.on("flush",()=>{o(e)})}var Za=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=hi(t.transportOptions?.bufferSize??Wp),this._dataCollection=iv(t),t.dsn?this._dsn=Fc(t.dsn):O&&C.warn("No DSN provided, client will not send events."),this._dsn){let r=Dp(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&uv(this,"afterCaptureLog","flushLogs",rk,ds),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&uv(this,"afterCaptureMetric","flushMetrics",nk,Ka)}captureException(t,n,r){let o=st();if(xa(t))return O&&C.log(sv),o;let i={event_id:o,...n};return this._process(()=>this.eventFromException(t,i).then(s=>this._captureEvent(s,i,r)).then(s=>s),"error"),i.event_id}captureMessage(t,n,r,o){let i={event_id:st(),...r},s=go(t)?t:String(t),a=cn(t),l=a?this.eventFromMessage(s,n,i):this.eventFromException(t,i);return this._process(()=>l.then(c=>this._captureEvent(c,i,o)),a?"unknown":"error"),i.event_id}captureEvent(t,n,r){let o=st();if(n?.originalException&&xa(n.originalException))return O&&C.log(sv),o;let i={event_id:o,...n},s=t.sdkProcessingMetadata||{},a=s.capturedSpanScope,l=s.capturedSpanIsolationScope,c=dv(t.type);return this._process(()=>this._captureEvent(t,i,a||r,l),c),i.event_id}captureSession(t){this.sendSession(t),Fr(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){let n=this._transport;if(this.emit("flush"),!n)return!0;let r=await this._isClientDoneProcessing(t),o=await n.flush(t);return r&&o}async close(t){ds(this);let n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(t){let n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),$p(this,t,this._integrations),n||Hp(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=X_(t,this),o=T_(t,this._dsn,this._options._metadata,this._options.tunnel);for(let i of n.attachments||[])o=Gc(o,Np(i));r&&(o=Gc(o,r)),this.sendEnvelope(o).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){let{release:n,environment:r=ns}=this._options;if("aggregates"in t){let i=t.attrs||{};if(!i.release&&!n){O&&C.warn(av);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){O&&C.warn(av);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);let o=E_(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){let o=`${t}:${n}`;O&&C.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){let r=this._hooks[t]=this._hooks[t]||new Set,o=(...i)=>n(...i);return r.add(o),()=>{r.delete(o)}}emit(t,...n){let r=this._hooks[t];r&&r.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return O&&C.error("Error while sending envelope:",n),{}}return O&&C.error("Transport disabled"),{}}registerCleanup(t){}dispose(){}_setupIntegrations(){let{integrations:t}=this._options;this._integrations=W_(this,t),Hp(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",o=!1,i=n.exception?.values;if(i){o=!0,r=!1;for(let l of i)if(l.mechanism?.handled===!1){r=!0;break}}let s=t.status==="ok";(s&&t.errors===0||s&&r)&&(Fr(t,{...r&&{status:"crashed"},errors:t.errors||Number(o||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,o){let i=this.getOptions(),s=this.getIntegrationNames();return!n.integrations&&s.length&&(n.integrations=s),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),Wa(i,t,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...a.contexts?.trace,...Lc(r)},...a.contexts};let l=os(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:l,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=ee(),o=Qe()){return O&&Vp(t)&&C.log(`Captured error event \`${eu(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(i=>i.event_id,i=>{O&&(cv(i)?C.log(i.message):lv(i)?C.warn(i.message):C.warn(i))})}_processEvent(t,n,r,o){let i=this.getOptions(),{sampleRate:s}=i,a=hv(t),l=Vp(t),u=`before send for type \`${t.type||"error"}\``,d=typeof s>"u"?void 0:Rn(s);if(l&&typeof d=="number"&&Bn()>d)return this.recordDroppedEvent("sample_rate","error"),di(Gp(`Discarding event because it's not included in the random sample (sampling rate = ${s})`));let p=dv(t.type);return this._prepareEvent(t,n,r,o).then(h=>{if(h===null)throw this.recordDroppedEvent("event_processor",p),Gp("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return h;let _=tk(this,i,h,n);return ek(_,u)}).then(h=>{if(h===null){if(this.recordDroppedEvent("before_send",p),a){let g=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",g)}throw Gp(`${u} returned \`null\`, will not send event.`)}let y=r.getSession()||o.getSession();if(l&&y&&this._updateSessionFromEvent(y,h),a){let T=h.sdkProcessingMetadata?.spanCountBeforeProcessing||0,g=h.spans?h.spans.length:0,S=T-g;S>0&&this.recordDroppedEvent("before_send","span",S)}let _=h.transaction_info;if(a&&_&&h.transaction!==t.transaction){let T="custom";h.transaction_info={..._,source:T}}return this.sendEvent(h,n),h}).then(null,h=>{throw cv(h)||lv(h)?h:(this.captureException(h,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:h}),tu(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
17
|
-
Reason: ${h}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===
|
|
18
|
-
Event: ${
|
|
19
|
-
Event: ${
|
|
20
|
-
Event: ${
|
|
21
|
-
Event: ${
|
|
22
|
-
Url: ${
|
|
23
|
-
Event: ${
|
|
24
|
-
Url: ${ru(e)}`),!0}return!1}function hk(e,t){return t?.length?eu(e).some(n=>kt(n,t)):!1}function gk(e,t){if(!t?.length)return!1;let n=e.transaction;return n?kt(n,t):!1}function yk(e,t){if(!t?.length)return!1;let n=ru(e);return n?kt(n,t):!1}function Sk(e,t){if(!t?.length)return!0;let n=ru(e);return n?kt(n,t):!0}function _k(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function ru(e){try{let n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?_k(n):null}catch{return O&&C.error(`Cannot extract url for event ${ir(e)}`),null}}function vk(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function em(e,t,n,r,o,i){if(!o.exception?.values||!i||!or(i.originalException,Error))return;let s=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;s&&(o.exception.values=Zp(e,t,r,i.originalException,n,o.exception.values,s,0))}function Zp(e,t,n,r,o,i,s,a){if(i.length>=n+1)return i;let l=[...i];if(or(r[o],Error)){Ev(s,a,r);let c=e(t,r[o]),u=l.length;Tv(c,o,u,a),l=Zp(e,t,n,r[o],o,[c,...l],c,u)}return Iv(r)&&r.errors.forEach((c,u)=>{if(or(c,Error)){Ev(s,a,r);let d=e(t,c),p=l.length;Tv(d,`errors[${u}]`,p,a),l=Zp(e,t,n,c,o,[d,...l],d,p)}}),l}function Iv(e){return Array.isArray(e.errors)}function Ev(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Iv(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Tv(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Ek(e){return Un(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function iu(e){return Ek(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var wv=new Set([]);function tm(e){let t="console",n=Dt(t,e);return Ut(t,Tk),n}function Tk(){"console"in V&&Cc.forEach(function(e){e in V.console&&it(V.console,e,function(t){return ei[e]=t,function(...n){let r=n[0],o=ei[e],i=wv.size&&typeof r=="string"&&kt(r,wv);i||mt("console",{args:n,level:e}),(!i||O&&C.isEnabled())&&o?.apply(V.console,n)}})})}function ms(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var Ik="Dedupe",wk=(()=>{let e;return{name:Ik,processEvent(t){if(t.type)return t;try{if(Ck(t,e))return O&&C.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),su=wk;function Ck(e,t){return t?!!(Rk(e,t)||xk(e,t)):!1}function Rk(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!xv(e,t)||!Rv(e,t))}function xk(e,t){let n=Cv(t),r=Cv(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!xv(e,t)||!Rv(e,t))}function Rv(e,t){let n=ya(e),r=ya(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o<r.length;o++){let i=r[o],s=n[o];if(i.filename!==s.filename||i.lineno!==s.lineno||i.colno!==s.colno||i.function!==s.function)return!1}return!0}function xv(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function Cv(e){return e.exception?.values?.[0]}var bk="ConversationId",kk=(()=>({name:bk,setup(e){e.on("spanStart",t=>{let n=ee().getScopeData(),r=Qe().getScopeData(),o=n.conversationId||r.conversationId;if(o){let{op:i,data:s,description:a}=te(t);if(!i?.startsWith("gen_ai.")&&!s["ai.operationId"]&&!a?.startsWith("ai."))return;t.setAttribute(Dc,o)}})}})),nm=kk;function rm(e,t,n,r,o){if(!e.fetchData)return;let{method:i,url:s}=e.fetchData,a=Et()&&t(s);if(e.endTimestamp){let y=e.fetchData.__span;if(!y)return;let _=r[y];_&&(a&&(Ak(_,e),Nk(_,e,o)),delete r[y]);return}let{spanOrigin:l="auto.http.browser",propagateTraceparent:c=!1}=typeof o=="object"?o:{spanOrigin:o},u=z(),p=!!Me()||!!u&&At(u),h=a&&p?wt(Lk(s,i,l)):new Nt;if(a&&!p&&u?.recordDroppedEvent("no_parent_span","span"),e.fetchData.__span=h.spanContext().spanId,r[h.spanContext().spanId]=h,n(e.fetchData.url)){let y=e.args[0],_={...e.args[1]||{}},T=kv(y,_,Et()&&p?h:void 0,c);T&&(e.args[1]=_,_.headers=T)}if(u){let y={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};u.emit("beforeOutgoingRequestSpan",h,y)}return h}function Nk(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function kv(e,t,n,r){let o=ps({span:n,propagateTraceparent:r}),i=o["sentry-trace"],s=o.baggage,a=o.traceparent;if(!i)return;let l=t.headers||(Ta(e)?e.headers:void 0);if(l)if(Mk(l)){let c=new Headers(l);if(c.get("sentry-trace")||c.set("sentry-trace",i),r&&a&&!c.get("traceparent")&&c.set("traceparent",a),s){let u=c.get("baggage");u?au(u)||c.set("baggage",`${u},${s}`):c.set("baggage",s)}return c}else if(Pk(l)){let c=[...l];c.find(d=>d[0]==="sentry-trace")||c.push(["sentry-trace",i]),r&&a&&!c.find(d=>d[0]==="traceparent")&&c.push(["traceparent",a]);let u=l.find(d=>d[0]==="baggage"&&typeof d[1]=="string"&&au(d[1]));return s&&!u&&c.push(["baggage",s]),c}else{let c="sentry-trace"in l?l["sentry-trace"]:void 0,u="traceparent"in l?l.traceparent:void 0,d="baggage"in l?l.baggage:void 0,p=d?Array.isArray(d)?[...d]:[d]:[],h=d&&(Array.isArray(d)?d.find(_=>au(_)):au(d));s&&!h&&p.push(s);let y=Object.assign({},l,{"sentry-trace":c??i,baggage:p.length>0?p.join(","):void 0});return r&&a&&!u&&(y.traceparent=a),y}else return{...o}}function Ak(e,t){if(t.response){ts(e,t.response.status);let n=t.response?.headers?.get("content-length");if(n){let r=parseInt(n);r>0&&e.setAttribute("http.response_content_length",r)}}else t.error&&e.setStatus({code:2,message:"internal_error"});e.end()}function au(e){return typeof e!="string"?!1:e.split(",").some(t=>t.trim().startsWith(ka))}function Mk(e){return typeof Headers<"u"&&or(e,Headers)}function Pk(e){return Array.isArray(e)?e.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"):!1}function Lk(e,t,n){if(e.startsWith("data:")){let i=zt(e);return{name:`${t} ${i}`,attributes:bv(e,void 0,t,n)}}let r=Tr(e),o=r?ls(r):e;return{name:`${t} ${o}`,attributes:bv(e,r,t,n)}}function bv(e,t,n,r){let o={url:zt(e),type:"fetch","http.method":n,[Ce]:r,[Ye]:"http.client"};return t&&(ui(t)||(o["http.url"]=zt(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function lu(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}var tl=V;function om(){return"history"in tl&&!!tl.history}function Ok(){if(!("fetch"in tl))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function nl(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function im(){if(typeof EdgeRuntime=="string")return!0;if(!Ok())return!1;if(nl(tl.fetch))return!0;let e=!1,t=tl.document;if(t&&typeof t.createElement=="function")try{let n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=nl(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){O&&C.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function Co(e,t){let n="fetch",r=Dt(n,e);return Ut(n,()=>Av(void 0,t)),r}function uu(e){let t="fetch-body-resolved",n=Dt(t,e);return Ut(t,()=>Av(Uk)),n}function Av(e,t=!1){t&&!im()||it(V,"fetch",function(n){return function(...r){let o=new Error,{method:i,url:s}=Fk(r),a={args:r,fetchData:{method:i,url:s},startTimestamp:Ae()*1e3,virtualError:o,headers:Bk(r)};return e||mt("fetch",{...a}),n.apply(V,r).then(async l=>(e?e(l):mt("fetch",{...a,endTimestamp:Ae()*1e3,response:l}),l),l=>{mt("fetch",{...a,endTimestamp:Ae()*1e3,error:l}),Un(l)&&l.stack===void 0&&(l.stack=o.stack,qe(l,"framesToPop",1));let u=z()?.getOptions().enhanceFetchErrorMessages??"always";if(u!==!1&&l instanceof TypeError&&(l.message==="Failed to fetch"||l.message==="Load failed"||l.message==="NetworkError when attempting to fetch resource."))try{let h=new URL(a.fetchData.url).host;u==="always"?l.message=`${l.message} (${h})`:qe(l,"__sentry_fetch_url_host__",h)}catch{}throw l})}})}async function Dk(e,t){if(e?.body){let n=e.body,r=n.getReader(),o=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3),i=!0;for(;i;){let s;try{s=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);let{done:a}=await r.read();clearTimeout(s),a&&(t(),i=!1)}catch{i=!1}finally{clearTimeout(s)}}clearTimeout(o),r.releaseLock(),n.cancel().then(null,()=>{})}}function Uk(e){let t;try{t=e.clone()}catch{return}Dk(t,()=>{mt("fetch-body-resolved",{endTimestamp:Ae()*1e3,response:e})})}function cu(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Nv(e){return typeof e=="string"?e:e?cu(e,"url")?e.url:e.toString?e.toString():"":""}function Fk(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[n,r]=e;return{url:Nv(n),method:cu(r,"method")?String(r.method).toUpperCase():Ta(n)&&cu(n,"method")?String(n.method).toUpperCase():"GET"}}let t=e[0];return{url:Nv(t),method:cu(t,"method")?String(t.method).toUpperCase():"GET"}}function Bk(e){let[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Ta(t))return new Headers(t.headers)}catch{}}var Mv=V;function mn(){try{return Mv.document.location.href}catch{return""}}function hs(e,t=5){if(!Mv.HTMLElement)return null;let n=e;for(let r=0;r<t;r++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}var Q=V,sm=0;function am(){return sm>0}function _N(){sm++,setTimeout(()=>{sm--})}function gi(e,t={}){function n(o){return typeof o=="function"}if(!n(e))return e;try{let o=e.__sentry_wrapped__;if(o)return typeof o=="function"?o:e;if(So(e))return e}catch{return e}let r=function(...o){V._sentryWrappedDepth=(V._sentryWrappedDepth||0)+1;try{let i=o.map(s=>gi(s,t));return e.apply(this,i)}catch(i){throw _N(),$n(s=>{s.addEventProcessor(a=>(t.mechanism&&(oi(a,void 0,void 0),Hn(a,t.mechanism)),a.extra={...a.extra,arguments:o},a)),jr(i)}),i}finally{V._sentryWrappedDepth=(V._sentryWrappedDepth||0)-1}};try{for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}Ia(r,e),qe(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function gs(){let e=mn(),{referrer:t}=Q.document||{},{userAgent:n}=Q.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}function du(e,t){let n=fu(e,t),r={type:wN(t),value:CN(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function vN(e,t,n,r){let i=z()?.getOptions().normalizeDepth,s=bN(t),a={__serialized__:Ca(t,i)};if(s)return{exception:{values:[du(e,s)]},extra:a};let l={exception:{values:[{type:yo(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:RN(t,{isUnhandledRejection:r})}]},extra:a};if(n){let c=fu(e,n);c.length&&(l.exception.values[0].stacktrace={frames:c})}return l}function lm(e,t){return{exception:{values:[du(e,t)]}}}function fu(e,t){let n=t.stacktrace||t.stack||"",r=TN(t),o=IN(t);try{return e(n,r,o)}catch{}return[]}var EN=/Minified React error #\d+;/i;function TN(e){return e&&EN.test(e.message)?1:0}function IN(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Jv(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function wN(e){let t=e?.name;return!t&&Jv(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function CN(e){let t=e?.message;return Jv(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?iu(t.error):iu(e):"No error message"}function Xv(e,t,n,r){let o=n?.syntheticException||void 0,i=pu(e,t,o,r);return Hn(i),i.level="error",n?.event_id&&(i.event_id=n.event_id),Ir(i)}function Qv(e,t,n="info",r,o){let i=r?.syntheticException||void 0,s=cm(e,t,i,o);return s.level=n,r?.event_id&&(s.event_id=r.event_id),Ir(s)}function pu(e,t,n,r,o){let i;if(Ki(t)&&t.error)return lm(e,t.error);if(Ea(t)||bc(t)){let s=t;if("stack"in t){i=lm(e,t);let a=i.exception?.values?.[0];if(r&&n&&a&&!a.stacktrace){let l=fu(e,n);l.length&&(a.stacktrace={frames:l},Hn(i,{synthetic:!0}))}}else{let a=s.name||(Ea(s)?"DOMError":"DOMException"),l=s.message?`${a}: ${s.message}`:a;i=cm(e,l,n,r),oi(i,l)}return"code"in s&&(i.tags={...i.tags,"DOMException.code":`${s.code}`}),i}return Un(t)?lm(e,t):Fn(t)||yo(t)?(i=vN(e,t,n,o),Hn(i,{synthetic:!0}),i):(i=cm(e,t,n,r),oi(i,`${t}`,void 0),Hn(i,{synthetic:!0}),i)}function cm(e,t,n,r){let o={};if(r&&n){let i=fu(e,n);i.length&&(o.exception={values:[{value:t,stacktrace:{frames:i}}]}),Hn(o,{synthetic:!0})}if(go(t)){let{__sentry_template_string__:i,__sentry_template_values__:s}=t;return o.logentry={message:i,params:s},o}return o.message=t,o}function RN(e,{isUnhandledRejection:t}){let n=Nc(e),r=t?"promise rejection":"exception";return Ki(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:yo(e)?`Event \`${xN(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function xN(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function bN(e){return Object.values(e).find(t=>t instanceof Error)}var mu=class extends Za{constructor(t){let n=kN(t),r=Q.SENTRY_SDK_SOURCE||jp();el(n,"browser",["browser"],r),super(n);let{userInfo:o}=this.getDataCollectionOptions();n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:o?"auto":"never",...n._metadata.sdk.settings});let{sendClientReports:i,enableLogs:s,_experiments:a,enableMetrics:l}=this._options,c=l??a?.enableMetrics??!0;Q.document&&(i||s||c)&&Q.document.addEventListener("visibilitychange",()=>{Q.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),s&&ds(this),c&&Ka(this))}),o&&this.on("beforeSendSession",Jp)}eventFromException(t,n){return Xv(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return Qv(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,o){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,o)}};function kN(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:Q.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var Ct=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var q=V;var NN=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",wr=(e,t,n,r)=>{let o,i;return s=>{t.value>=0&&(s||r)&&(i=t.value-(o??0),(i||o===void 0)&&(o=t.value,t.delta=i,t.rating=NN(t.value,n),e(t)))}};var Gr=(e=!0)=>{let t=q.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t};var Wn=()=>Gr()?.activationStart??0;function Gn(e,t,n){q.document&&q.addEventListener(e,t,n)}function yi(e,t,n){q.document&&q.removeEventListener(e,t,n)}var ys=-1,Zv=new Set,AN=()=>q.document?.visibilityState==="hidden"&&!q.document?.prerendering?0:1/0,hu=e=>{if(MN(e)&&ys>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(let t of Zv)t();isFinite(ys)||(ys=e.type==="visibilitychange"?e.timeStamp:0,yi("prerenderingchange",hu,!0))}},Cr=()=>{if(q.document&&ys<0){let e=Wn();ys=(q.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??AN(),Gn("visibilitychange",hu,!0),Gn("pagehide",hu,!0),Gn("prerenderingchange",hu,!0)}return{get firstHiddenTime(){return ys},onHidden(e){Zv.add(e)}}};function MN(e){return e.type==="pagehide"||q.document?.visibilityState==="hidden"}var eE=()=>`v5-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`;var Rr=(e,t=-1)=>{let n=Gr(),r="navigate";return n&&(q.document?.prerendering||Wn()>0?r="prerender":q.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:eE(),navigationType:r}};var um=new WeakMap;function Ss(e,t){try{return um.get(e)||um.set(e,new t),um.get(e)}catch{return new t}}var gu=class{constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(t){if(t.hadRecentInput)return;let n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&t.startTime-r.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),this._onAfterProcessingUnexpectedShift?.(t)}};var Vn=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{t(o.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}};var _s=e=>{let t=!1;return()=>{t||(e(),t=!0)}};var xo=e=>{q.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()};var PN=[1800,3e3],tE=(e,t={})=>{xo(()=>{let n=Cr(),r=Rr("FCP"),o,s=Vn("paint",a=>{for(let l of a)l.name==="first-contentful-paint"&&(s.disconnect(),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-Wn(),0),r.entries.push(l),o(!0)))});s&&(o=wr(e,r,PN,t.reportAllChanges))})};var LN=[.1,.25],nE=(e,t={})=>{tE(_s(()=>{let n=Rr("CLS",0),r,o=Cr(),i=Ss(t,gu),s=l=>{for(let c of l)i._processEntry(c);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},a=Vn("layout-shift",s);a&&(r=wr(e,n,LN,t.reportAllChanges),o.onHidden(()=>{s(a.takeRecords()),r(!0)}),q?.setTimeout?.(r))}))};var rE=0,dm=1/0,yu=0,ON=e=>{e.forEach(t=>{t.interactionId&&(dm=Math.min(dm,t.interactionId),yu=Math.max(yu,t.interactionId),rE=yu?(yu-dm)/7+1:0)})},fm,pm=()=>fm?rE:performance.interactionCount||0,oE=()=>{"interactionCount"in performance||fm||(fm=Vn("event",ON,{type:"event",buffered:!0,durationThreshold:0}))};var mm=10,iE=0,DN=()=>pm()-iE,Su=class{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){iE=pm(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let t=Math.min(this._longestInteractionList.length-1,Math.floor(DN()/50));return this._longestInteractionList[t]}_processEntry(t){if(this._onBeforeProcessingEntry?.(t),!(t.interactionId||t.entryType==="first-input"))return;let n=this._longestInteractionList.at(-1),r=this._longestInteractionMap.get(t.interactionId);if(r||this._longestInteractionList.length<mm||t.duration>n._latency){if(r?t.duration>r._latency?(r.entries=[t],r._latency=t.duration):t.duration===r._latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(r={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((o,i)=>i._latency-o._latency),this._longestInteractionList.length>mm){let o=this._longestInteractionList.splice(mm);for(let i of o)this._longestInteractionMap.delete(i.id)}this._onAfterProcessingINPCandidate?.(r)}}};var _u=e=>{let t=q.requestIdleCallback||q.setTimeout;q.document?.visibilityState==="hidden"?e():(e=_s(e),Gn("visibilitychange",e,{once:!0,capture:!0}),Gn("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),yi("visibilitychange",e,{capture:!0}),yi("pagehide",e,{capture:!0})}))};var UN=[200,500],FN=40,sE=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;let n=Cr();xo(()=>{oE();let r=Rr("INP"),o,i=Ss(t,Su),s=l=>{_u(()=>{for(let u of l)i._processEntry(u);let c=i._estimateP98LongestInteraction();c&&c._latency!==r.value&&(r.value=c._latency,r.entries=c.entries,o())})},a=Vn("event",s,{durationThreshold:t.durationThreshold??FN});o=wr(e,r,UN,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{s(a.takeRecords()),o(!0)}))})};var vu=class{_processEntry(t){this._onBeforeProcessingEntry?.(t)}};var BN=[2500,4e3],aE=(e,t={})=>{xo(()=>{let n=Cr(),r=Rr("LCP"),o,i=Ss(t,vu),s=l=>{t.reportAllChanges||(l=l.slice(-1));for(let c of l)i._processEntry(c),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-Wn(),0),r.entries=[c],o())},a=Vn("largest-contentful-paint",s);if(a){o=wr(e,r,BN,t.reportAllChanges);let l=_s(()=>{s(a.takeRecords()),a.disconnect(),o(!0)}),c=u=>{u.isTrusted&&(_u(l),yi(u.type,c,{capture:!0}))};for(let u of["keydown","click","visibilitychange"])Gn(u,c,{capture:!0})}})};var HN=[800,1800],hm=e=>{q.document?.prerendering?xo(()=>hm(e)):q.document?.readyState!=="complete"?addEventListener("load",()=>hm(e),!0):setTimeout(e)},lE=(e,t={})=>{let n=Rr("TTFB"),r=wr(e,n,HN,t.reportAllChanges);hm(()=>{let o=Gr();o&&(n.value=Math.max(o.responseStart-Wn(),0),n.entries=[o],r(!0))})};var rl={},Eu={},cE,uE,dE,fE;function Vr(e,t=!1){return Tu("cls",e,$N,cE,t)}function qr(e,t=!1){return Tu("lcp",e,zN,uE,t)}function gm(e){return Tu("ttfb",e,jN,dE)}function Si(e){return Tu("inp",e,WN,fE)}function lr(e,t){return pE(e,t),Eu[e]||(GN(e),Eu[e]=!0),mE(e,t)}function ol(e,t){let n=rl[e];if(n?.length)for(let r of n)try{r(t)}catch(o){Ct&&C.error(`Error while triggering instrumentation handler.
|
|
16
|
+
`)}`)}function x_(e){if(!O)return;let{description:t="< unknown name >",op:n="< unknown op >"}=ne(e),{spanId:r}=e.spanContext(),i=be(e)===e,s=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;C.log(s)}function Kc(e,t,n,r=Me()){let o=r&&be(r);o&&(O&&C.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[lr]:t,[ar]:n}))}function Jc(e){if(!e||e.length===0)return;let t={};return e.forEach(n=>{let r=n.attributes||{},o=r[ar],i=r[lr];typeof o=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:o})}),t}function Mt(e){return e.getOptions().traceLifecycle==="stream"}var b_=1e3,To=class{constructor(t={}){this._traceId=t.traceId||Zt(),this._spanId=t.spanId||zt(),this._startTime=t.startTimestamp||Ae(),this._links=t.links,this._attributes={},this.setAttributes({[we]:"manual",[qe]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){let{_spanId:t,_traceId:n,_sampled:r}=this;return{spanId:t,traceId:n,traceFlags:r?Oa:zc}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=pn(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(vt,"custom"),this}end(t){this._endTime||(this._endTime=pn(t),x_(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[qe],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Ba(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[we],profile_id:this._attributes[ai],exclusive_time:this._attributes[jt],measurements:Jc(this._events),is_segment:this._isStandaloneSpan&&be(this)===this||void 0,segment_id:this._isStandaloneSpan?be(this).spanContext().spanId:void 0,links:Ua(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===be(this),status:xp(this._status),attributes:this._attributes,links:Rp(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){O&&C.log("[Tracing] Adding an event to span:",t);let o=k_(n)?n:r||Ae(),i=k_(n)?{}:n||{},s={name:t,time:pn(o),attributes:i};return this._events.push(s),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let t=$();if(t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===be(this)))return;if(this._isStandaloneSpan){this._sampled?vb(C_([this],t)):(O&&C.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&Mt(t)){t.emit("afterSegmentSpanEnd",this);return}let r=this._convertSpanToTransaction();r&&(li(this).scope||te()).captureEvent(r)}_convertSpanToTransaction(){if(!N_(ne(this)))return;this._name||(O&&C.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:t,isolationScope:n}=li(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let i=jr(this).filter(f=>f!==this&&!_b(f)).map(f=>ne(f)).filter(N_),s=this._attributes[vt];delete this._attributes[ns];let a=!1;i.forEach(f=>{delete f.data[ns],f.op?.startsWith("gen_ai.")&&(a=!0)});let l={contexts:{trace:d_(this)},spans:i.length>b_?i.sort((f,p)=>f.start_timestamp-p.start_timestamp).slice(0,b_):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:ht(this),hasGenAiSpans:a},request:r,...s&&{transaction_info:{source:s}}},c=Jc(this._events);return c&&Object.keys(c).length&&(O&&C.log("[Measurements] Adding measurements to transaction event",JSON.stringify(c,void 0,2)),l.measurements=c),l}};function k_(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function N_(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function _b(e){return e instanceof To&&e.isStandaloneSpan()}function vb(e){let t=$();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function A_(e,t,n){if(!Et(e))return[!1];let r,o;typeof e.tracesSampler=="function"?(o=e.tracesSampler({...t,inheritOrSampleWith:a=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):a}),r=!0):t.parentSampled!==void 0?o=t.parentSampled:typeof e.tracesSampleRate<"u"&&(o=e.tracesSampleRate,r=!0);let i=bn(o);if(i===void 0)return O&&C.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(o)} of type ${JSON.stringify(typeof o)}.`),[!1];if(!i)return O&&C.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,i,r];let s=n<i;return s||O&&C.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[s,i,r]}var Pp="__SENTRY_SUPPRESS_TRACING__";function wt(e){let t=P_();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=Tb(e),{forceTransaction:r,parentSpan:o}=e;return(e.scope?s=>$n(e.scope,s):o!==void 0?s=>ls(o,s):s=>s())(()=>{let s=te(),a=wb(s,o),l=$();return e.onlyIfParent&&!a?(l?.recordDroppedEvent("no_parent_span","span"),new At):Eb({parentSpan:a,spanArguments:n,forceTransaction:r,scope:s})})}function ls(e,t){let n=P_();return n.withActiveSpan?n.withActiveSpan(e,t):$n(r=>(Eo(r,e||void 0),t(r)))}function Eb({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Et()){let a=new At;if(n||!e){let l={sampled:"false",sample_rate:"0",transaction:t.name,...ht(a)};is(a,l)}return a}let o=$();if(Cb(o,t))return Lp(r)||o?.recordDroppedEvent("ignored","span"),new At({dropReason:"ignored",traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});let i=Xe(),s;if(e&&!n)s=Ib(e,r,t),Ha(e,s);else if(e){let a=ht(e),{traceId:l,spanId:c}=e.spanContext(),u=mn(e);s=M_({traceId:l,parentSpanId:c,...t},r,u),is(s,a)}else{let{traceId:a,dsc:l,parentSpanId:c,sampled:u}={...i.getPropagationContext(),...r.getPropagationContext()};s=M_({traceId:a,parentSpanId:c,...t},r,u),l&&is(s,l)}return R_(s),r_(s,r,i),s}function Tb(e){let n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let r={...n};return r.startTimestamp=pn(e.startTime),delete r.startTime,r}return n}function P_(){let e=Rn();return Tr(e)}function M_(e,t,n){let r=$(),o=r?.getOptions()||{},{name:i=""}=e,s={spanAttributes:{...e.attributes},spanName:i,parentSampled:n};r?.emit("beforeSampling",s,{decision:!1});let a=s.parentSampled??n,l=s.spanAttributes,c=t.getPropagationContext(),u=Lp(t),[f,p,h]=u?[!1]:A_(o,{name:i,parentSampled:a,attributes:l,parentSampleRate:bn(c.dsc?.sample_rate)},c.sampleRand),y=new To({...e,attributes:{[vt]:"custom",[$r]:p!==void 0&&h?p:void 0,...l},sampled:f});return!f&&r&&!u&&(O&&C.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",Mt(r)?"span":"transaction")),r&&r.emit("spanStart",y),y}function Ib(e,t,n){let{spanId:r,traceId:o}=e.spanContext(),i=Lp(t),s=i?!1:mn(e),a=s?new To({...n,parentSpanId:r,traceId:o,sampled:s}):new At({traceId:o});Ha(e,a);let l=$();return l&&(Mt(l)&&a instanceof At&&(e instanceof At&&e.dropReason?(a.dropReason=e.dropReason,l.recordDroppedEvent(e.dropReason,"span")):i||(a.dropReason="sample_rate",l.recordDroppedEvent("sample_rate","span"))),l.emit("spanStart",a),n.endTimestamp&&(l.emit("spanEnd",a),l.emit("afterSpanEnd",a))),a}function wb(e,t){if(t)return t;if(t===null)return;let n=si(e);if(!n)return;let r=$();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?be(n):n}function Cb(e,t){let n=e?.getOptions().ignoreSpans;return!e||!Mt(e)||!n?.length?!1:Wr({description:t.name||"",op:t.attributes?.[qe]||t.op,attributes:t.attributes},n)}function Lp(e){return e.getScopeData().sdkProcessingMetadata[Pp]===!0}var cs={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},Rb="heartbeatFailed",xb="idleTimeout",bb="finalTimeout",kb="externalFinish";function Xc(e,t={}){let n=new Map,r=!1,o,i=kb,s=!t.disableAutoFinish,a=[],{idleTimeout:l=cs.idleTimeout,finalTimeout:c=cs.finalTimeout,childSpanTimeout:u=cs.childSpanTimeout,beforeSpanEnd:f,trimIdleSpanEndTimestamp:p=!0}=t,h=$();if(!h||!Et()){let I=new At,N={sample_rate:"0",sampled:"false",...ht(I)};return is(I,N),I}let y=te(),_=Me(),T=Nb(e);T.end=new Proxy(T.end,{apply(I,N,U){if(f&&f(T),N instanceof At)return;let[x,...H]=U,j=x||Ae(),ge=pn(j),X=jr(T).filter(Q=>Q!==T),Ze=ne(T);if(!X.length||!p)return A(ge),Reflect.apply(I,N,[ge,...H]);let fe=h.getOptions().ignoreSpans,de=X?.reduce((Q,ae)=>{let Re=ne(ae);return!Re.timestamp||fe&&Wr({description:Re.description,op:Re.op,attributes:Re.data},fe)?Q:Q?Math.max(Q,Re.timestamp):Re.timestamp},void 0),D=Ze.start_timestamp,ye=Math.min(D?D+c/1e3:1/0,Math.max(D||-1/0,Math.min(ge,de||1/0)));return A(ye),Reflect.apply(I,N,[ye,...H])}});function g(){o&&(clearTimeout(o),o=void 0)}function S(I){g(),o=setTimeout(()=>{!r&&n.size===0&&s&&(i=xb,T.end(I))},l)}function E(I){o=setTimeout(()=>{!r&&s&&(i=Rb,T.end(I))},u)}function R(I){g(),n.set(I,!0);let N=Ae();E(N+u/1e3)}function M(I){if(n.has(I)&&n.delete(I),n.size===0){let N=Ae();S(N+l/1e3)}}function A(I){r=!0,n.clear(),a.forEach(X=>X()),Eo(y,_);let N=ne(T),{start_timestamp:U}=N;if(!U)return;N.data[zr]||T.setAttribute(zr,i);let H=N.status;(!H||H==="unknown")&&T.setStatus({code:1}),C.log(`[Tracing] Idle span "${N.op}" finished`);let j=jr(T).filter(X=>X!==T),ge=0;j.forEach(X=>{X.isRecording()&&(X.setStatus({code:2,message:"cancelled"}),X.end(I),O&&C.log("[Tracing] Cancelling span since span ended early",JSON.stringify(X,void 0,2)));let Ze=ne(X),{timestamp:fe=0,start_timestamp:de=0}=Ze,D=de<=I,ye=(c+l)/1e3,Q=fe-de<=ye;if(O){let ae=JSON.stringify(X,void 0,2);D?Q||C.log("[Tracing] Discarding span since it finished after idle span final timeout",ae):C.log("[Tracing] Discarding span since it happened after idle span was finished",ae)}(!Q||!D)&&(y_(T,X),ge++)}),ge>0&&T.setAttribute("sentry.idle_span_discarded_spans",ge)}return a.push(h.on("spanStart",I=>{if(r||I===T||ne(I).timestamp||I instanceof To&&I.isStandaloneSpan())return;jr(T).includes(I)&&R(I.spanContext().spanId)})),a.push(h.on("spanEnd",I=>{r||M(I.spanContext().spanId)})),a.push(h.on("idleSpanEnableAutoFinish",I=>{I===T&&(s=!0,S(),n.size&&E())})),t.disableAutoFinish||S(),setTimeout(()=>{r||(T.setStatus({code:2,message:"deadline_exceeded"}),i=bb,T.end())},c),T}function Nb(e){let t=wt(e);return Eo(te(),t),O&&C.log("[Tracing] Started span is an idle span"),t}function O_(e,t){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=t;Ab(e,t),r&&Lb(e,r),Ob(e,n),Mb(e,o),Pb(e,i)}function L_(e,t){let{extra:n,tags:r,attributes:o,user:i,contexts:s,level:a,sdkProcessingMetadata:l,breadcrumbs:c,fingerprint:u,eventProcessors:f,attachments:p,propagationContext:h,transactionName:y,span:_}=t;Wa(e,"extra",n),Wa(e,"tags",r),Wa(e,"attributes",o),Wa(e,"user",i),Wa(e,"contexts",s),e.sdkProcessingMetadata=vo(e.sdkProcessingMetadata,l,2),a&&(e.level=a),y&&(e.transactionName=y),_&&(e.span=_),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),f.length&&(e.eventProcessors=[...e.eventProcessors,...f]),p.length&&(e.attachments=[...e.attachments,...p]),e.propagationContext={...e.propagationContext,...h}}function Wa(e,t,n){e[t]=vo(e[t],n,1)}function Qc(e,t){let n=Na().getScopeData();return e&&L_(n,e.getScopeData()),t&&L_(n,t.getScopeData()),n}function Ab(e,t){let{extra:n,tags:r,user:o,contexts:i,level:s,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(o).length&&(e.user={...o,...e.user}),Object.keys(i).length&&(e.contexts={...i,...e.contexts}),s&&(e.level=s),a&&e.type!=="transaction"&&(e.transaction=a)}function Mb(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Pb(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Lb(e,t){e.contexts={trace:jc(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:ht(t),...e.sdkProcessingMetadata};let n=be(t),r=ne(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function Ob(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}var Db="thismessage:/";function di(e){return"isRelative"in e}function Ir(e,t){let n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=t??(n?Db:void 0);try{if("canParse"in URL&&!URL.canParse(e,r))return;let o=new URL(e,r);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch{}}function us(e){if(di(e))return e.pathname;let t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function zn(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Zc(e){return e.split(/[?#]/,1)[0]}function Wt(e,t=!0){if(e.startsWith("data:")){let n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=e.includes(";base64,"),i=e.indexOf(","),s="";if(t&&i!==-1){let a=e.slice(i+1);s=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${o?",base64":""}${s?`,${s}`:""}`}return e}function Io(e,t){let n=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}var Op=0,D_=1,U_=2;function wr(e){return new Ga(t=>{t(e)})}function fi(e){return new Ga((t,n)=>{n(e)})}var Ga=class e{constructor(t){this._state=Op,this._handlers=[],this._runExecutor(t)}then(t,n){return new e((r,o)=>{this._handlers.push([!1,i=>{if(!t)r(i);else try{r(t(i))}catch(s){o(s)}},i=>{if(!n)o(i);else try{r(n(i))}catch(s){o(s)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new e((n,r)=>{let o,i;return this.then(s=>{i=!1,o=s,t&&t()},s=>{i=!0,o=s,t&&t()}).then(()=>{if(i){r(o);return}n(o)})})}_executeHandlers(){if(this._state===Op)return;let t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===D_&&n[1](this._value),this._state===U_&&n[2](this._value),n[0]=!0)})}_runExecutor(t){let n=(i,s)=>{if(this._state===Op){if(or(s)){s.then(r,o);return}this._state=i,this._value=s,this._executeHandlers()}},r=i=>{n(D_,i)},o=i=>{n(U_,i)};try{t(r,o)}catch(i){o(i)}}};function F_(e,t,n,r=0){try{let o=Dp(t,n,e,r);return or(o)?o:wr(o)}catch(o){return fi(o)}}function Dp(e,t,n,r){let o=n[r];if(!e||!o)return e;let i=o({...e},t);return O&&i===null&&C.log(`Event processor "${o.id||"?"}" dropped event`),or(i)?i.then(s=>Dp(s,t,n,r+1)):Dp(i,t,n,r+1)}var pi,B_,H_,wo;function $_(e){let t=G._sentryDebugIds,n=G._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(wo&&r.length===B_&&o.length===H_)return wo;B_=r.length,H_=o.length,wo={},pi||(pi={});let i=(s,a)=>{for(let l of s){let c=a[l],u=pi?.[l];if(u&&wo&&c)wo[u[0]]=c,pi&&(pi[l]=[u[0],c]);else if(c){let f=e(l);for(let p=f.length-1;p>=0;p--){let y=f[p]?.filename;if(y&&wo&&pi){wo[y]=c,pi[l]=[y,c];break}}}}};return t&&i(r,t),n&&i(o,n),wo}function Va(e,t,n,r,o,i){let{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=e,l={...t,event_id:t.event_id||n.event_id||at(),timestamp:t.timestamp||dn()},c=n.integrations||e.integrations.map(g=>g.name);Ub(l,e),Hb(l,c),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&Fb(l,e.stackParser);let u=zb(r,n.captureContext);n.mechanism&&Hn(l,n.mechanism);let f=o?o.getEventProcessors():[],p=Qc(i,u),h=[...n.attachments||[],...p.attachments];h.length&&(n.attachments=h),O_(l,p);let y=[...f,...p.eventProcessors];return(n.data&&n.data.__sentry__===!0?wr(l):F_(y,l,n)).then(g=>(g&&Bb(g),typeof s=="number"&&s>0?$b(g,s,a):g))}function Ub(e,t){let{environment:n,release:r,dist:o,maxValueLength:i}=t;e.environment=e.environment||n||os,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);let s=e.request;s?.url&&i&&(s.url=oi(s.url,i)),i&&e.exception?.values?.forEach(a=>{a.value&&(a.value=oi(a.value,i))})}function Fb(e,t){let n=$_(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function Bb(e){let t={};if(e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?t[o.abs_path]=o.debug_id:o.filename&&(t[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function Hb(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function $b(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:$t(o.data,t,n)}}))},...e.user&&{user:$t(e.user,t,n)},...e.contexts&&{contexts:$t(e.contexts,t,n)},...e.extra&&{extra:$t(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=$t(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:$t(o.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=$t(e.contexts.flags,3,n)),r}function zb(e,t){if(!t)return e;let n=e?e.clone():new fn;return n.update(t),n}function z_(e){if(e)return jb(e)?{captureContext:e}:Gb(e)?{captureContext:e}:e}function jb(e){return e instanceof fn||typeof e=="function"}var Wb=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Gb(e){return Object.keys(e).some(t=>Wb.includes(t))}function Gr(e,t){return te().captureException(e,z_(t))}function ds(e,t){return te().captureEvent(e,t)}function mi(e,t){Xe().setContext(e,t)}function qa(){return Xe().lastEventId()}function Ya(){let e=$();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Ka(e){Xe().addEventProcessor(e)}function fs(e){let t=Xe(),{user:n}=Qc(t,te()),{userAgent:r}=G.navigator||{},o=GS({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return i?.status==="ok"&&Hr(i,{status:"exited"}),Ja(),t.setSession(o),o}function Ja(){let e=Xe(),n=te().getSession()||e.getSession();n&&VS(n),j_(),e.setSession()}function j_(){let e=Xe(),t=$(),n=e.getSession();n&&t&&t.captureSession(n)}function hi(e=!1){if(e){Ja();return}j_()}var W_="7";function G_(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Vb(e){return`${G_(e)}${e.projectId}/envelope/`}function qb(e,t){let n={sentry_version:W_};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Fp(e,t,n){return t||`${Vb(e)}?${qb(e,n)}`}function Bp(e,t){let n=Hc(e);if(!n)return"";let r=`${G_(n)}embed/error-page/`,o=`dsn=${xn(n)}`;for(let i in t)if(i!=="dsn"&&i!=="onClose")if(i==="user"){let s=t.user;if(!s)continue;s.name&&(o+=`&name=${encodeURIComponent(s.name)}`),s.email&&(o+=`&email=${encodeURIComponent(s.email)}`)}else o+=`&${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`;return`${r}?${o}`}var Hp=[];function Yb(e){let t={};return e.forEach(n=>{let{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function $p(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){let o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return Yb(r)}function V_(e,t){let n={};return t.forEach(r=>{r?.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&jp(e,r,n)}),n}function zp(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function jp(e,t,n){if(n[t.name]){O&&C.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Hp.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Hp.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){let r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,i)=>r(o,i,e))}if(typeof t.processEvent=="function"){let r=t.processEvent.bind(t),o=Object.assign((i,s)=>r(i,s,e),{id:t.name});e.addEventProcessor(o)}["processSpan","processSegmentSpan"].forEach(r=>{let o=t[r];typeof o=="function"&&e.on(r,i=>o.call(t,i,e))}),O&&C.log(`Integration installed: ${t.name}`)}function Wp(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Gp(){return"npm"}function q_(){return!Wp()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function jn(){return typeof window<"u"&&(!q_()||Kb())}function Kb(){return G.process?.type==="renderer"}function Jb(e,t){let n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...jn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function Y_(e,t,n,r,o){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=xn(r)),en(i,[Jb(e,o)])}function ps(e,t){let n=t??Xb(e)??[];if(n.length===0)return;let r=e.getOptions(),o=Y_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);K_().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function Xb(e){return K_().get(e)}function K_(){return rr("clientToLogBufferMap",()=>new WeakMap)}function Qb(e,t){let n=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...jn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function J_(e,t,n,r,o){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=xn(r)),en(i,[Qb(e,o)])}function Xa(e,t){let n=t??Zb(e)??[];if(n.length===0)return;let r=e.getOptions(),o=J_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);X_().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function Zb(e){return X_().get(e)}function X_(){return rr("clientToMetricBufferMap",()=>new WeakMap)}function Q_(e){let t={trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||"",start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:!e.status||e.status==="ok"||e.status==="cancelled"?"ok":"error",is_segment:!1,attributes:{...e.data},links:e.links};return m_(t)}function Z_(e,t){if(e.type!=="transaction"||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||!t.getOptions().streamGenAiSpans||Mt(t))return;let n=[],r=[];for(let i of e.spans)i.op?.startsWith("gen_ai.")?n.push(Q_(i)):r.push(i);if(n.length===0)return;e.spans=r;let o=t.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...jn()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:n}]}function eu(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var ms=Symbol.for("SentryBufferFullError");function gi(e=100){let t=new Set;function n(){return t.size<e}function r(s){t.delete(s)}function o(s){if(!n())return fi(ms);let a=s();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function i(s){if(!t.size)return wr(!0);let a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!s)return a;let l=[a,new Promise(c=>eu(setTimeout(()=>c(!1),s)))];return Promise.race(l)}return{get $(){return Array.from(t)},add:o,drain:i}}var ev=60*1e3;function tv(e,t=ri()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?ev:r-t}function nv(e,t){return e[t]||e.all||0}function Qa(e,t,n=ri()){return nv(e,t)>n}function Za(e,{statusCode:t,headers:n},r=ri()){let o={...e},i=n?.["x-sentry-rate-limits"],s=n?.["retry-after"];if(i)for(let a of i.trim().split(",")){let[l,c,,,u]=a.split(":",5),f=parseInt(l,10),p=(isNaN(f)?60:f)*1e3;if(!c)o.all=r+p;else for(let h of c.split(";"))h==="metric_bucket"?(!u||u.split(";").includes("custom"))&&(o[h]=r+p):o[h]=r+p}else s?o.all=r+tv(s,r):t===429&&(o.all=r+60*1e3);return o}var Vp=64;function tu(e,t,n=gi(e.bufferSize||Vp)){let r={},o=s=>n.drain(s);function i(s){let a=[];if(za(s,(f,p)=>{let h=Yc(p);Qa(r,h)?e.recordDroppedEvent("ratelimit_backoff",h):a.push(f)}),a.length===0)return Promise.resolve({});let l=en(s[0],a),c=f=>{if(kp(l,["client_report"])){O&&C.warn(`Dropping client report. Will not send outcomes (reason: ${f}).`);return}za(l,(p,h)=>{e.recordDroppedEvent(f,Yc(h))})},u=()=>t({body:Np(l)}).then(f=>f.statusCode===413?(O&&C.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),c("send_error"),f):(O&&f.statusCode!==void 0&&(f.statusCode<200||f.statusCode>=300)&&C.warn(`Sentry responded with status code ${f.statusCode} to sent event.`),r=Za(r,f),f),f=>{throw c("network_error"),O&&C.error("Encountered error running transport request:",f),f});return n.add(u).then(f=>f,f=>{if(f===ms)return O&&C.error("Skipped sending event because buffer is full."),c("queue_overflow"),Promise.resolve({});throw f})}return{send:i,flush:o}}function rv(e,t,n){let r=[{type:"client_report"},{timestamp:n||dn(),discarded_events:e}];return en(t?{dsn:t}:{},[r])}function nu(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function ov(e){let{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:i,data:s,op:a}=e.contexts?.trace??{};return{data:s??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:s?.[ai],exclusive_time:s?.[jt],measurements:e.measurements,is_segment:!0}}function iv(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[ai]:e.profile_id},...e.exclusive_time&&{[jt]:e.exclusive_time}}}},measurements:e.measurements}}var el=["forwarded","-ip","remote-","via","-user"];function sv(e){return e===!0?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:5}:{userInfo:!1,cookies:{deny:el},httpHeaders:{request:{deny:el},response:{deny:el}},httpBodies:[],queryParams:{deny:el},genAI:{inputs:!1,outputs:!1},stackFrameVariables:!0,frameContextLines:5}}var ek={userInfo:!1,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:[],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:5};function av(e){let t=e.dataCollection!=null?ek:sv(e.sendDefaultPii),n=e.dataCollection??{};return{userInfo:n.userInfo??t.userInfo,cookies:n.cookies??t.cookies,httpHeaders:{request:n.httpHeaders?.request??t.httpHeaders.request,response:n.httpHeaders?.response??t.httpHeaders.response},httpBodies:n.httpBodies??t.httpBodies,queryParams:n.queryParams??t.queryParams,genAI:{inputs:n.genAI?.inputs??t.genAI.inputs,outputs:n.genAI?.outputs??t.genAI.outputs},stackFrameVariables:n.stackFrameVariables??t.stackFrameVariables,frameContextLines:n.frameContextLines??t.frameContextLines}}var lv="Not capturing exception because it's already been captured.",cv="Discarded session because of missing or non-string release",hv=Symbol.for("SentryInternalError"),gv=Symbol.for("SentryDoNotSendEventError"),tk=5e3;function ru(e){return{message:e,[hv]:!0}}function qp(e){return{message:e,[gv]:!0}}function uv(e){return!!e&&typeof e=="object"&&hv in e}function dv(e){return!!e&&typeof e=="object"&&gv in e}function fv(e,t,n,r,o){let i=0,s,a=!1;e.on(n,()=>{i=0,clearTimeout(s),a=!1}),e.on(t,l=>{if(i+=r(l),i>=8e5)o(e);else if(!a){let c=e.getOptions()._flushInterval??tk;c>0&&(a=!0,s=eu(setTimeout(()=>{o(e)},c)))}}),e.on("flush",()=>{o(e)})}var tl=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=gi(t.transportOptions?.bufferSize??Vp),this._dataCollection=av(t),t.dsn?this._dsn=Hc(t.dsn):O&&C.warn("No DSN provided, client will not send events."),this._dsn){let r=Fp(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&fv(this,"afterCaptureLog","flushLogs",ik,ps),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&fv(this,"afterCaptureMetric","flushMetrics",ok,Xa)}captureException(t,n,r){let o=at();if(ka(t))return O&&C.log(lv),o;let i={event_id:o,...n};return this._process(()=>this.eventFromException(t,i).then(s=>this._captureEvent(s,i,r)).then(s=>s),"error"),i.event_id}captureMessage(t,n,r,o){let i={event_id:at(),...r},s=go(t)?t:String(t),a=un(t),l=a?this.eventFromMessage(s,n,i):this.eventFromException(t,i);return this._process(()=>l.then(c=>this._captureEvent(c,i,o)),a?"unknown":"error"),i.event_id}captureEvent(t,n,r){let o=at();if(n?.originalException&&ka(n.originalException))return O&&C.log(lv),o;let i={event_id:o,...n},s=t.sdkProcessingMetadata||{},a=s.capturedSpanScope,l=s.capturedSpanIsolationScope,c=pv(t.type);return this._process(()=>this._captureEvent(t,i,a||r,l),c),i.event_id}captureSession(t){this.sendSession(t),Hr(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){let n=this._transport;if(this.emit("flush"),!n)return!0;let r=await this._isClientDoneProcessing(t),o=await n.flush(t);return r&&o}async close(t){ps(this);let n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(t){let n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),jp(this,t,this._integrations),n||zp(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=Z_(t,this),o=w_(t,this._dsn,this._options._metadata,this._options.tunnel);for(let i of n.attachments||[])o=qc(o,Mp(i));r&&(o=qc(o,r)),this.sendEnvelope(o).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){let{release:n,environment:r=os}=this._options;if("aggregates"in t){let i=t.attrs||{};if(!i.release&&!n){O&&C.warn(cv);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){O&&C.warn(cv);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);let o=I_(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){let o=`${t}:${n}`;O&&C.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){let r=this._hooks[t]=this._hooks[t]||new Set,o=(...i)=>n(...i);return r.add(o),()=>{r.delete(o)}}emit(t,...n){let r=this._hooks[t];r&&r.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return O&&C.error("Error while sending envelope:",n),{}}return O&&C.error("Transport disabled"),{}}registerCleanup(t){}dispose(){}_setupIntegrations(){let{integrations:t}=this._options;this._integrations=V_(this,t),zp(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",o=!1,i=n.exception?.values;if(i){o=!0,r=!1;for(let l of i)if(l.mechanism?.handled===!1){r=!0;break}}let s=t.status==="ok";(s&&t.errors===0||s&&r)&&(Hr(t,{...r&&{status:"crashed"},errors:t.errors||Number(o||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,o){let i=this.getOptions(),s=this.getIntegrationNames();return!n.integrations&&s.length&&(n.integrations=s),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),Va(i,t,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...a.contexts?.trace,...Dc(r)},...a.contexts};let l=ss(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:l,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=te(),o=Xe()){return O&&Yp(t)&&C.log(`Captured error event \`${nu(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(i=>i.event_id,i=>{O&&(dv(i)?C.log(i.message):uv(i)?C.warn(i.message):C.warn(i))})}_processEvent(t,n,r,o){let i=this.getOptions(),{sampleRate:s}=i,a=yv(t),l=Yp(t),u=`before send for type \`${t.type||"error"}\``,f=typeof s>"u"?void 0:bn(s);if(l&&typeof f=="number"&&Bn()>f)return this.recordDroppedEvent("sample_rate","error"),fi(qp(`Discarding event because it's not included in the random sample (sampling rate = ${s})`));let p=pv(t.type);return this._prepareEvent(t,n,r,o).then(h=>{if(h===null)throw this.recordDroppedEvent("event_processor",p),qp("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return h;let _=rk(this,i,h,n);return nk(_,u)}).then(h=>{if(h===null){if(this.recordDroppedEvent("before_send",p),a){let g=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",g)}throw qp(`${u} returned \`null\`, will not send event.`)}let y=r.getSession()||o.getSession();if(l&&y&&this._updateSessionFromEvent(y,h),a){let T=h.sdkProcessingMetadata?.spanCountBeforeProcessing||0,g=h.spans?h.spans.length:0,S=T-g;S>0&&this.recordDroppedEvent("before_send","span",S)}let _=h.transaction_info;if(a&&_&&h.transaction!==t.transaction){let T="custom";h.transaction_info={..._,source:T}}return this.sendEvent(h,n),h}).then(null,h=>{throw dv(h)||uv(h)?h:(this.captureException(h,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:h}),ru(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
17
|
+
Reason: ${h}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===ms&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){let t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{let[o,i]=n.split(":");return{reason:o,category:i,quantity:r}})}_flushOutcomes(){O&&C.log("Flushing outcomes...");let t=this._clearOutcomes();if(t.length===0){O&&C.log("No outcomes to send");return}if(!this._dsn){O&&C.log("No dsn provided, will not send outcomes");return}O&&C.log("Sending outcomes:",t);let n=rv(t,this._options.tunnel&&xn(this._dsn));this.sendEnvelope(n)}};function pv(e){return e==="replay_event"?"replay":e||"error"}function nk(e,t){let n=`${t} must return \`null\` or a valid event.`;if(or(e))return e.then(r=>{if(!Fn(r)&&r!==null)throw ru(n);return r},r=>{throw ru(`${t} rejected with ${r}`)});if(!Fn(e)&&e!==null)throw ru(n);return e}function rk(e,t,n,r){let{beforeSend:o,beforeSendTransaction:i,ignoreSpans:s}=t,a=!Vc(t.beforeSendSpan)&&t.beforeSendSpan,l=n;if(Yp(l)&&o)return o(l,r);if(yv(l)){if(a||s){let c=ov(l);if(s?.length&&Wr({description:c.description,op:c.op,attributes:c.data},s))return null;if(a){let u=a(c);u?l=vo(n,iv(u)):$a()}if(l.spans){let u=[],f=l.spans;for(let h of f){if(s?.length&&Wr({description:h.description,op:h.op,attributes:h.data},s)){v_(f,h);continue}if(a){let y=a(h);y?u.push(y):($a(),u.push(h))}else u.push(h)}let p=l.spans.length-u.length;p&&e.recordDroppedEvent("before_send","span",p),l.spans=u}}if(i){if(l.spans){let c=l.spans.length;l.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:c}}return i(l,r)}}return l}function Yp(e){return e.type===void 0}function yv(e){return e.type==="transaction"}function ok(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Sv(e.attributes)}function ik(e){let t=0;return e.message&&(t+=e.message.length*2),t+Sv(e.attributes)}function Sv(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*mv(n[0]):un(n)?t+=mv(n):t+=100}),t}function mv(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function Kp(e,t){t.debug===!0&&(O?C.enable():kt(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),te().update(t.initialScope);let r=new e(t);return Jp(r),r.init(),r}function Jp(e){te().setClient(e)}function Xp(e,t){let n=t?.getDsn(),r=t?.getOptions().tunnel;return ak(e,n)||sk(e,r)}function sk(e,t){return t?_v(e)===_v(t):!1}function ak(e,t){let n=Ir(e);return!n||di(n)||!t?!1:lk(n.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function lk(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function _v(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function Qp(e){"aggregates"in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function nl(e,t,n=[t],r="npm"){let o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(i=>({name:`${r}:@sentry/${i}`,version:Er})),o.version=Er)}function hs(e={}){let t=e.client||$();if(!Ya()||!t)return{};let n=Rn(),r=Tr(n);if(r.getTraceData)return r.getTraceData(e);let o=e.scope||te(),i=e.span||Me();if(!i&&Oc())return{};let s=i?Da(i):ck(o),a=i?ht(i):ss(t,o),l=Tp(a);if(!$c.test(s))return C.warn("Invalid sentry-trace data. Cannot generate trace data"),{};let u={"sentry-trace":s,baggage:l};return e.propagateTraceparent&&(u.traceparent=i?f_(i):uk(o)),u}function ck(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Ma(t,r,n)}function uk(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Pa(t,r,n)}function Zp(e,t,n){let r,o,i,s=n?.maxWait?Math.max(n.maxWait,t):0,a=n?.setTimeoutImpl||setTimeout;function l(){return c(),r=e(),r}function c(){o!==void 0&&clearTimeout(o),i!==void 0&&clearTimeout(i),o=i=void 0}function u(){return o!==void 0||i!==void 0?l():r}function f(){return o&&clearTimeout(o),o=a(l,t),s&&i===void 0&&(i=a(l,s)),r}return f.cancel=c,f.flush=u,f}var dk=100;function kn(e,t){let n=$(),r=Xe();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:i=dk}=n.getOptions();if(i<=0)return;let a={timestamp:dn(),...e},l=o?kt(()=>o(a,t)):a;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,t),r.addBreadcrumb(l,i))}var vv,fk="FunctionToString",Ev=new WeakMap,pk=(()=>({name:fk,setupOnce(){vv=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=So(this),n=Ev.has($())&&t!==void 0?t:this;return vv.apply(n,e)}}catch{}},setup(e){Ev.set(e,!0)}})),ou=pk;var mk=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],hk="EventFilters",em=(e={})=>{let t;return{name:hk,setup(n){let r=n.getOptions();t=Tv(e,r)},processEvent(n,r,o){if(!t){let i=o.getOptions();t=Tv(e,i)}return gk(n,t)?null:n}}},su=((e={})=>({...em(e),name:"InboundFilters"}));function Tv(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:mk],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function gk(e,t){if(e.type){if(e.type==="transaction"&&Sk(e,t.ignoreTransactions))return O&&C.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
18
|
+
Event: ${sr(e)}`),!0}else{if(yk(e,t.ignoreErrors))return O&&C.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
19
|
+
Event: ${sr(e)}`),!0;if(Tk(e))return O&&C.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
20
|
+
Event: ${sr(e)}`),!0;if(_k(e,t.denyUrls))return O&&C.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
21
|
+
Event: ${sr(e)}.
|
|
22
|
+
Url: ${iu(e)}`),!0;if(!vk(e,t.allowUrls))return O&&C.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
23
|
+
Event: ${sr(e)}.
|
|
24
|
+
Url: ${iu(e)}`),!0}return!1}function yk(e,t){return t?.length?nu(e).some(n=>Nt(n,t)):!1}function Sk(e,t){if(!t?.length)return!1;let n=e.transaction;return n?Nt(n,t):!1}function _k(e,t){if(!t?.length)return!1;let n=iu(e);return n?Nt(n,t):!1}function vk(e,t){if(!t?.length)return!0;let n=iu(e);return n?Nt(n,t):!0}function Ek(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function iu(e){try{let n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?Ek(n):null}catch{return O&&C.error(`Cannot extract url for event ${sr(e)}`),null}}function Tk(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function nm(e,t,n,r,o,i){if(!o.exception?.values||!i||!ir(i.originalException,Error))return;let s=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;s&&(o.exception.values=tm(e,t,r,i.originalException,n,o.exception.values,s,0))}function tm(e,t,n,r,o,i,s,a){if(i.length>=n+1)return i;let l=[...i];if(ir(r[o],Error)){Iv(s,a,r);let c=e(t,r[o]),u=l.length;wv(c,o,u,a),l=tm(e,t,n,r[o],o,[c,...l],c,u)}return Cv(r)&&r.errors.forEach((c,u)=>{if(ir(c,Error)){Iv(s,a,r);let f=e(t,c),p=l.length;wv(f,`errors[${u}]`,p,a),l=tm(e,t,n,c,o,[f,...l],f,p)}}),l}function Cv(e){return Array.isArray(e.errors)}function Iv(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Cv(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function wv(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Ik(e){return Un(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function au(e){return Ik(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var Rv=new Set([]);function rm(e){let t="console",n=Ft(t,e);return Bt(t,wk),n}function wk(){"console"in G&&xc.forEach(function(e){e in G.console&&st(G.console,e,function(t){return ti[e]=t,function(...n){let r=n[0],o=ti[e],i=Rv.size&&typeof r=="string"&&Nt(r,Rv);i||mt("console",{args:n,level:e}),(!i||O&&C.isEnabled())&&o?.apply(G.console,n)}})})}function gs(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var Ck="Dedupe",Rk=(()=>{let e;return{name:Ck,processEvent(t){if(t.type)return t;try{if(xk(t,e))return O&&C.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),lu=Rk;function xk(e,t){return t?!!(bk(e,t)||kk(e,t)):!1}function bk(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!kv(e,t)||!bv(e,t))}function kk(e,t){let n=xv(t),r=xv(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!kv(e,t)||!bv(e,t))}function bv(e,t){let n=_a(e),r=_a(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o<r.length;o++){let i=r[o],s=n[o];if(i.filename!==s.filename||i.lineno!==s.lineno||i.colno!==s.colno||i.function!==s.function)return!1}return!0}function kv(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function xv(e){return e.exception?.values?.[0]}var Nk="ConversationId",Ak=(()=>({name:Nk,setup(e){e.on("spanStart",t=>{let n=te().getScopeData(),r=Xe().getScopeData(),o=n.conversationId||r.conversationId;if(o){let{op:i,data:s,description:a}=ne(t);if(!i?.startsWith("gen_ai.")&&!s["ai.operationId"]&&!a?.startsWith("ai."))return;t.setAttribute(Fc,o)}})}})),om=Ak;function im(e,t,n,r,o){if(!e.fetchData)return;let{method:i,url:s}=e.fetchData,a=Et()&&t(s);if(e.endTimestamp){let y=e.fetchData.__span;if(!y)return;let _=r[y];_&&(a&&(Pk(_,e),Mk(_,e,o)),delete r[y]);return}let{spanOrigin:l="auto.http.browser",propagateTraceparent:c=!1}=typeof o=="object"?o:{spanOrigin:o},u=$(),p=!!Me()||!!u&&Mt(u),h=a&&p?wt(Dk(s,i,l)):new At;if(a&&!p&&u?.recordDroppedEvent("no_parent_span","span"),e.fetchData.__span=h.spanContext().spanId,r[h.spanContext().spanId]=h,n(e.fetchData.url)){let y=e.args[0],_={...e.args[1]||{}},T=Av(y,_,Et()&&p?h:void 0,c);T&&(e.args[1]=_,_.headers=T)}if(u){let y={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};u.emit("beforeOutgoingRequestSpan",h,y)}return h}function Mk(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function Av(e,t,n,r){let o=hs({span:n,propagateTraceparent:r}),i=o["sentry-trace"],s=o.baggage,a=o.traceparent;if(!i)return;let l=t.headers||(wa(e)?e.headers:void 0);if(l)if(Lk(l)){let c=new Headers(l);if(c.get("sentry-trace")||c.set("sentry-trace",i),r&&a&&!c.get("traceparent")&&c.set("traceparent",a),s){let u=c.get("baggage");u?cu(u)||c.set("baggage",`${u},${s}`):c.set("baggage",s)}return c}else if(Ok(l)){let c=[...l];c.find(f=>f[0]==="sentry-trace")||c.push(["sentry-trace",i]),r&&a&&!c.find(f=>f[0]==="traceparent")&&c.push(["traceparent",a]);let u=l.find(f=>f[0]==="baggage"&&typeof f[1]=="string"&&cu(f[1]));return s&&!u&&c.push(["baggage",s]),c}else{let c="sentry-trace"in l?l["sentry-trace"]:void 0,u="traceparent"in l?l.traceparent:void 0,f="baggage"in l?l.baggage:void 0,p=f?Array.isArray(f)?[...f]:[f]:[],h=f&&(Array.isArray(f)?f.find(_=>cu(_)):cu(f));s&&!h&&p.push(s);let y=Object.assign({},l,{"sentry-trace":c??i,baggage:p.length>0?p.join(","):void 0});return r&&a&&!u&&(y.traceparent=a),y}else return{...o}}function Pk(e,t){if(t.response){rs(e,t.response.status);let n=t.response?.headers?.get("content-length");if(n){let r=parseInt(n);r>0&&e.setAttribute("http.response_content_length",r)}}else t.error&&e.setStatus({code:2,message:"internal_error"});e.end()}function cu(e){return typeof e!="string"?!1:e.split(",").some(t=>t.trim().startsWith(Aa))}function Lk(e){return typeof Headers<"u"&&ir(e,Headers)}function Ok(e){return Array.isArray(e)?e.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"):!1}function Dk(e,t,n){if(e.startsWith("data:")){let i=Wt(e);return{name:`${t} ${i}`,attributes:Nv(e,void 0,t,n)}}let r=Ir(e),o=r?us(r):e;return{name:`${t} ${o}`,attributes:Nv(e,r,t,n)}}function Nv(e,t,n,r){let o={url:Wt(e),type:"fetch","http.method":n,[we]:r,[qe]:"http.client"};return t&&(di(t)||(o["http.url"]=Wt(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function uu(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}var rl=G;function sm(){return"history"in rl&&!!rl.history}function Uk(){if(!("fetch"in rl))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function ol(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function am(){if(typeof EdgeRuntime=="string")return!0;if(!Uk())return!1;if(ol(rl.fetch))return!0;let e=!1,t=rl.document;if(t&&typeof t.createElement=="function")try{let n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=ol(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){O&&C.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function Co(e,t){let n="fetch",r=Ft(n,e);return Bt(n,()=>Pv(void 0,t)),r}function fu(e){let t="fetch-body-resolved",n=Ft(t,e);return Bt(t,()=>Pv(Bk)),n}function Pv(e,t=!1){t&&!am()||st(G,"fetch",function(n){return function(...r){let o=new Error,{method:i,url:s}=Hk(r),a={args:r,fetchData:{method:i,url:s},startTimestamp:Ae()*1e3,virtualError:o,headers:$k(r)};return e||mt("fetch",{...a}),n.apply(G,r).then(async l=>(e?e(l):mt("fetch",{...a,endTimestamp:Ae()*1e3,response:l}),l),l=>{mt("fetch",{...a,endTimestamp:Ae()*1e3,error:l}),Un(l)&&l.stack===void 0&&(l.stack=o.stack,Ve(l,"framesToPop",1));let u=$()?.getOptions().enhanceFetchErrorMessages??"always";if(u!==!1&&l instanceof TypeError&&(l.message==="Failed to fetch"||l.message==="Load failed"||l.message==="NetworkError when attempting to fetch resource."))try{let h=new URL(a.fetchData.url).host;u==="always"?l.message=`${l.message} (${h})`:Ve(l,"__sentry_fetch_url_host__",h)}catch{}throw l})}})}async function Fk(e,t){if(e?.body){let n=e.body,r=n.getReader(),o=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3),i=!0;for(;i;){let s;try{s=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);let{done:a}=await r.read();clearTimeout(s),a&&(t(),i=!1)}catch{i=!1}finally{clearTimeout(s)}}clearTimeout(o),r.releaseLock(),n.cancel().then(null,()=>{})}}function Bk(e){let t;try{t=e.clone()}catch{return}Fk(t,()=>{mt("fetch-body-resolved",{endTimestamp:Ae()*1e3,response:e})})}function du(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Mv(e){return typeof e=="string"?e:e?du(e,"url")?e.url:e.toString?e.toString():"":""}function Hk(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[n,r]=e;return{url:Mv(n),method:du(r,"method")?String(r.method).toUpperCase():wa(n)&&du(n,"method")?String(n.method).toUpperCase():"GET"}}let t=e[0];return{url:Mv(t),method:du(t,"method")?String(t.method).toUpperCase():"GET"}}function $k(e){let[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(wa(t))return new Headers(t.headers)}catch{}}var Lv=G;function hn(){try{return Lv.document.location.href}catch{return""}}function ys(e,t=5){if(!Lv.HTMLElement)return null;let n=e;for(let r=0;r<t;r++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}var ee=G,lm=0;function cm(){return lm>0}function EN(){lm++,setTimeout(()=>{lm--})}function yi(e,t={}){function n(o){return typeof o=="function"}if(!n(e))return e;try{let o=e.__sentry_wrapped__;if(o)return typeof o=="function"?o:e;if(So(e))return e}catch{return e}let r=function(...o){G._sentryWrappedDepth=(G._sentryWrappedDepth||0)+1;try{let i=o.map(s=>yi(s,t));return e.apply(this,i)}catch(i){throw EN(),$n(s=>{s.addEventProcessor(a=>(t.mechanism&&(ii(a,void 0,void 0),Hn(a,t.mechanism)),a.extra={...a.extra,arguments:o},a)),Gr(i)}),i}finally{G._sentryWrappedDepth=(G._sentryWrappedDepth||0)-1}};try{for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}Ca(r,e),Ve(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function Ss(){let e=hn(),{referrer:t}=ee.document||{},{userAgent:n}=ee.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}function pu(e,t){let n=mu(e,t),r={type:RN(t),value:xN(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function TN(e,t,n,r){let i=$()?.getOptions().normalizeDepth,s=NN(t),a={__serialized__:xa(t,i)};if(s)return{exception:{values:[pu(e,s)]},extra:a};let l={exception:{values:[{type:yo(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:bN(t,{isUnhandledRejection:r})}]},extra:a};if(n){let c=mu(e,n);c.length&&(l.exception.values[0].stacktrace={frames:c})}return l}function um(e,t){return{exception:{values:[pu(e,t)]}}}function mu(e,t){let n=t.stacktrace||t.stack||"",r=wN(t),o=CN(t);try{return e(n,r,o)}catch{}return[]}var IN=/Minified React error #\d+;/i;function wN(e){return e&&IN.test(e.message)?1:0}function CN(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Qv(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function RN(e){let t=e?.name;return!t&&Qv(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function xN(e){let t=e?.message;return Qv(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?au(t.error):au(e):"No error message"}function Zv(e,t,n,r){let o=n?.syntheticException||void 0,i=hu(e,t,o,r);return Hn(i),i.level="error",n?.event_id&&(i.event_id=n.event_id),wr(i)}function eE(e,t,n="info",r,o){let i=r?.syntheticException||void 0,s=dm(e,t,i,o);return s.level=n,r?.event_id&&(s.event_id=r.event_id),wr(s)}function hu(e,t,n,r,o){let i;if(Xi(t)&&t.error)return um(e,t.error);if(Ia(t)||Nc(t)){let s=t;if("stack"in t){i=um(e,t);let a=i.exception?.values?.[0];if(r&&n&&a&&!a.stacktrace){let l=mu(e,n);l.length&&(a.stacktrace={frames:l},Hn(i,{synthetic:!0}))}}else{let a=s.name||(Ia(s)?"DOMError":"DOMException"),l=s.message?`${a}: ${s.message}`:a;i=dm(e,l,n,r),ii(i,l)}return"code"in s&&(i.tags={...i.tags,"DOMException.code":`${s.code}`}),i}return Un(t)?um(e,t):Fn(t)||yo(t)?(i=TN(e,t,n,o),Hn(i,{synthetic:!0}),i):(i=dm(e,t,n,r),ii(i,`${t}`,void 0),Hn(i,{synthetic:!0}),i)}function dm(e,t,n,r){let o={};if(r&&n){let i=mu(e,n);i.length&&(o.exception={values:[{value:t,stacktrace:{frames:i}}]}),Hn(o,{synthetic:!0})}if(go(t)){let{__sentry_template_string__:i,__sentry_template_values__:s}=t;return o.logentry={message:i,params:s},o}return o.message=t,o}function bN(e,{isUnhandledRejection:t}){let n=Mc(e),r=t?"promise rejection":"exception";return Xi(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:yo(e)?`Event \`${kN(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function kN(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function NN(e){return Object.values(e).find(t=>t instanceof Error)}var gu=class extends tl{constructor(t){let n=AN(t),r=ee.SENTRY_SDK_SOURCE||Gp();nl(n,"browser",["browser"],r),super(n);let{userInfo:o}=this.getDataCollectionOptions();n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:o?"auto":"never",...n._metadata.sdk.settings});let{sendClientReports:i,enableLogs:s,_experiments:a,enableMetrics:l}=this._options,c=l??a?.enableMetrics??!0;ee.document&&(i||s||c)&&ee.document.addEventListener("visibilitychange",()=>{ee.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),s&&ps(this),c&&Xa(this))}),o&&this.on("beforeSendSession",Qp)}eventFromException(t,n){return Zv(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return eE(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,o){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,o)}};function AN(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:ee.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var Ct=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var q=G;var MN=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Cr=(e,t,n,r)=>{let o,i;return s=>{t.value>=0&&(s||r)&&(i=t.value-(o??0),(i||o===void 0)&&(o=t.value,t.delta=i,t.rating=MN(t.value,n),e(t)))}};var qr=(e=!0)=>{let t=q.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t};var Wn=()=>qr()?.activationStart??0;function Gn(e,t,n){q.document&&q.addEventListener(e,t,n)}function Si(e,t,n){q.document&&q.removeEventListener(e,t,n)}var _s=-1,tE=new Set,PN=()=>q.document?.visibilityState==="hidden"&&!q.document?.prerendering?0:1/0,yu=e=>{if(LN(e)&&_s>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(let t of tE)t();isFinite(_s)||(_s=e.type==="visibilitychange"?e.timeStamp:0,Si("prerenderingchange",yu,!0))}},Rr=()=>{if(q.document&&_s<0){let e=Wn();_s=(q.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??PN(),Gn("visibilitychange",yu,!0),Gn("pagehide",yu,!0),Gn("prerenderingchange",yu,!0)}return{get firstHiddenTime(){return _s},onHidden(e){tE.add(e)}}};function LN(e){return e.type==="pagehide"||q.document?.visibilityState==="hidden"}var nE=()=>`v5-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`;var xr=(e,t=-1)=>{let n=qr(),r="navigate";return n&&(q.document?.prerendering||Wn()>0?r="prerender":q.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:nE(),navigationType:r}};var fm=new WeakMap;function vs(e,t){try{return fm.get(e)||fm.set(e,new t),fm.get(e)}catch{return new t}}var Su=class{constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(t){if(t.hadRecentInput)return;let n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&t.startTime-r.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),this._onAfterProcessingUnexpectedShift?.(t)}};var Vn=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{t(o.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}};var Es=e=>{let t=!1;return()=>{t||(e(),t=!0)}};var xo=e=>{q.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()};var ON=[1800,3e3],rE=(e,t={})=>{xo(()=>{let n=Rr(),r=xr("FCP"),o,s=Vn("paint",a=>{for(let l of a)l.name==="first-contentful-paint"&&(s.disconnect(),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-Wn(),0),r.entries.push(l),o(!0)))});s&&(o=Cr(e,r,ON,t.reportAllChanges))})};var DN=[.1,.25],oE=(e,t={})=>{rE(Es(()=>{let n=xr("CLS",0),r,o=Rr(),i=vs(t,Su),s=l=>{for(let c of l)i._processEntry(c);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},a=Vn("layout-shift",s);a&&(r=Cr(e,n,DN,t.reportAllChanges),o.onHidden(()=>{s(a.takeRecords()),r(!0)}),q?.setTimeout?.(r))}))};var iE=0,pm=1/0,_u=0,UN=e=>{e.forEach(t=>{t.interactionId&&(pm=Math.min(pm,t.interactionId),_u=Math.max(_u,t.interactionId),iE=_u?(_u-pm)/7+1:0)})},mm,hm=()=>mm?iE:performance.interactionCount||0,sE=()=>{"interactionCount"in performance||mm||(mm=Vn("event",UN,{type:"event",buffered:!0,durationThreshold:0}))};var gm=10,aE=0,FN=()=>hm()-aE,vu=class{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){aE=hm(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let t=Math.min(this._longestInteractionList.length-1,Math.floor(FN()/50));return this._longestInteractionList[t]}_processEntry(t){if(this._onBeforeProcessingEntry?.(t),!(t.interactionId||t.entryType==="first-input"))return;let n=this._longestInteractionList.at(-1),r=this._longestInteractionMap.get(t.interactionId);if(r||this._longestInteractionList.length<gm||t.duration>n._latency){if(r?t.duration>r._latency?(r.entries=[t],r._latency=t.duration):t.duration===r._latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(r={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((o,i)=>i._latency-o._latency),this._longestInteractionList.length>gm){let o=this._longestInteractionList.splice(gm);for(let i of o)this._longestInteractionMap.delete(i.id)}this._onAfterProcessingINPCandidate?.(r)}}};var Eu=e=>{let t=q.requestIdleCallback||q.setTimeout;q.document?.visibilityState==="hidden"?e():(e=Es(e),Gn("visibilitychange",e,{once:!0,capture:!0}),Gn("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),Si("visibilitychange",e,{capture:!0}),Si("pagehide",e,{capture:!0})}))};var BN=[200,500],HN=40,lE=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;let n=Rr();xo(()=>{sE();let r=xr("INP"),o,i=vs(t,vu),s=l=>{Eu(()=>{for(let u of l)i._processEntry(u);let c=i._estimateP98LongestInteraction();c&&c._latency!==r.value&&(r.value=c._latency,r.entries=c.entries,o())})},a=Vn("event",s,{durationThreshold:t.durationThreshold??HN});o=Cr(e,r,BN,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{s(a.takeRecords()),o(!0)}))})};var Tu=class{_processEntry(t){this._onBeforeProcessingEntry?.(t)}};var $N=[2500,4e3],cE=(e,t={})=>{xo(()=>{let n=Rr(),r=xr("LCP"),o,i=vs(t,Tu),s=l=>{t.reportAllChanges||(l=l.slice(-1));for(let c of l)i._processEntry(c),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-Wn(),0),r.entries=[c],o())},a=Vn("largest-contentful-paint",s);if(a){o=Cr(e,r,$N,t.reportAllChanges);let l=Es(()=>{s(a.takeRecords()),a.disconnect(),o(!0)}),c=u=>{u.isTrusted&&(Eu(l),Si(u.type,c,{capture:!0}))};for(let u of["keydown","click","visibilitychange"])Gn(u,c,{capture:!0})}})};var zN=[800,1800],ym=e=>{q.document?.prerendering?xo(()=>ym(e)):q.document?.readyState!=="complete"?addEventListener("load",()=>ym(e),!0):setTimeout(e)},uE=(e,t={})=>{let n=xr("TTFB"),r=Cr(e,n,zN,t.reportAllChanges);ym(()=>{let o=qr();o&&(n.value=Math.max(o.responseStart-Wn(),0),n.entries=[o],r(!0))})};var il={},Iu={},dE,fE,pE,mE;function Yr(e,t=!1){return wu("cls",e,jN,dE,t)}function Kr(e,t=!1){return wu("lcp",e,WN,fE,t)}function Sm(e){return wu("ttfb",e,GN,pE)}function _i(e){return wu("inp",e,VN,mE)}function cr(e,t){return hE(e,t),Iu[e]||(qN(e),Iu[e]=!0),gE(e,t)}function sl(e,t){let n=il[e];if(n?.length)for(let r of n)try{r(t)}catch(o){Ct&&C.error(`Error while triggering instrumentation handler.
|
|
25
25
|
Type: ${e}
|
|
26
|
-
Name: ${
|
|
27
|
-
Error:`,o)}}function $N(){return nE(e=>{ol("cls",{metric:e}),cE=e},{reportAllChanges:!0})}function zN(){return aE(e=>{ol("lcp",{metric:e}),uE=e},{reportAllChanges:!0})}function jN(){return lE(e=>{ol("ttfb",{metric:e}),dE=e})}function WN(){return sE(e=>{ol("inp",{metric:e}),fE=e})}function Tu(e,t,n,r,o=!1){pE(e,t);let i;return Eu[e]||(i=n(),Eu[e]=!0),r&&t({metric:r}),mE(e,t,o?i:void 0)}function GN(e){let t={};e==="event"&&(t.durationThreshold=0),Vn(e,n=>{ol(e,{entries:n})},t)}function pE(e,t){rl[e]=rl[e]||[],rl[e].push(t)}function mE(e,t,n){return()=>{n&&n();let r=rl[e];if(!r)return;let o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function hE(e){return"duration"in e}var VN=80;function Ue(e,t={}){if(!e)return"<unknown>";try{let n=e,r=5,o=[],i=0,s=0,a=" > ",l=a.length,c,u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||VN;for(;n&&i++<r&&(c=qN(n,u),!(c==="html"||i>1&&s+o.length*l+c.length>=d));)o.push(c),s+=c.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function qN(e,t){let n=e,r=[];if(!n?.tagName)return"";if(typeof HTMLElement<"u"&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let o=t?.length?t.filter(i=>n.getAttribute(i)).map(i=>[i,n.getAttribute(i)]):null;if(o?.length)o.forEach(i=>{r.push(`[${i[0]}="${i[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let i=n.className;if(i&&Ft(i)){let s=i.split(/\s+/);for(let a of s)r.push(`.${a}`)}}for(let i of["aria-label","type","name","title","alt"]){let s=n.getAttribute(i);s&&r.push(`[${i}="${s}"]`)}return r.join("")}var gE=e=>{let t=n=>{(n.type==="pagehide"||q.document?.visibilityState==="hidden")&&e(n)};Gn("visibilitychange",t,{capture:!0,once:!0}),Gn("pagehide",t,{capture:!0,once:!0})};function Iu(e){return typeof e=="number"&&isFinite(e)}function Yr(e,t,n,{...r}){let o=te(e).start_timestamp;return o&&o>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),ss(e,()=>{let i=wt({startTime:t,...r});return i&&i.end(n),i})}function vs(e){let t=z();if(!t)return;let{name:n,transaction:r,attributes:o,startTime:i}=e,{release:s,environment:a}=t.getOptions(),{userInfo:l}=t.getDataCollectionOptions(),u=t.getIntegrationByName("Replay")?.getReplayId(),d=ee(),p=d.getUser(),h=p!==void 0?p.email||p.id||p.ip_address:void 0,y;try{y=d.getScopeData().contexts.profile.profile_id}catch{}let _={release:s,environment:a,user:h||void 0,profile_id:y||void 0,replay_id:u||void 0,transaction:r,"user_agent.original":q.navigator?.userAgent,"client.address":l?"{{auto}}":void 0,...o};return wt({name:n,attributes:_,startTime:i,experimental:{standalone:!0}})}function Kr(){return q.addEventListener&&q.performance}function Pe(e){return e/1e3}function yE(e){let t="unknown",n="unknown",r="";for(let o of e){if(o==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(o))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=o}return r===e&&(t=r),{name:t,version:n}}function _i(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function vi(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n.spanContext().spanId,n),r=!0}gE(()=>{o("pagehide")});let i=e.on("beforeStartNavigationSpan",(a,l)=>{l?.isRedirect||(o("navigation"),i(),s())}),s=e.on("afterStartPageLoadSpan",a=>{n=a,s()})}function SE(e){let t=0,n;if(!_i("layout-shift"))return;let r=Vr(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);vi(e,(o,i)=>{YN(t,n,i,o),r()})}function YN(e,t,n,r){Ct&&C.log(`Sending CLS span (${e})`);let o=t?Pe(($e()||0)+t.startTime):Ae(),i=ee().getScopeData().transactionName,s=t?Ue(t.sources[0]?.node):"Layout shift",a={[Ce]:"auto.http.browser.cls",[Ye]:"ui.webvital.cls",[$t]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((c,u)=>{a[`cls.source.${u+1}`]=Ue(c.node)});let l=vs({name:s,transaction:i,attributes:a,startTime:o});l&&(l.addEvent("cls",{[sr]:"",[ar]:e}),l.end(o))}var KN=6e4;function Ei(e){return e!=null&&e>0&&e<=KN}function _E(e){let t=0,n;if(!_i("largest-contentful-paint"))return;let r=qr(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!Ei(o.value)||(t=o.value,n=i)},!0);vi(e,(o,i)=>{JN(t,n,i,o),r()})}function JN(e,t,n,r){if(!Ei(e))return;Ct&&C.log(`Sending LCP span (${e})`);let o=Pe(($e()||0)+(t?.startTime||0)),i=ee().getScopeData().transactionName,s=t?Ue(t.element):"Largest contentful paint",a={[Ce]:"auto.http.browser.lcp",[Ye]:"ui.webvital.lcp",[$t]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=Ue(t.element)),t.id&&(a["lcp.id"]=t.id),t.url&&(a["lcp.url"]=t.url),t.loadTime!=null&&(a["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(a["lcp.renderTime"]=t.renderTime),t.size!=null&&(a["lcp.size"]=t.size));let l=vs({name:s,transaction:i,attributes:a,startTime:o});l&&(l.addEvent("lcp",{[sr]:"millisecond",[ar]:e}),l.end(o))}function qn(e){return e&&(($e()||performance.timeOrigin)+e)/1e3}function il(e){let t={};if(e.nextHopProtocol!=null){let{name:n,version:r}=yE(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return $e()||Kr()?.timeOrigin?XN({...t,"http.request.redirect_start":qn(e.redirectStart),"http.request.redirect_end":qn(e.redirectEnd),"http.request.worker_start":qn(e.workerStart),"http.request.fetch_start":qn(e.fetchStart),"http.request.domain_lookup_start":qn(e.domainLookupStart),"http.request.domain_lookup_end":qn(e.domainLookupEnd),"http.request.connect_start":qn(e.connectStart),"http.request.secure_connection_start":qn(e.secureConnectionStart),"http.request.connection_end":qn(e.connectEnd),"http.request.request_start":qn(e.requestStart),"http.request.response_start":qn(e.responseStart),"http.request.response_end":qn(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function XN(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}var QN=2147483647,vE=0,Zt={},hn,Cu;function ym({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){let r=Kr();if(r&&$e()){r.mark&&q.performance.mark("sentry-tracing-init");let o=t?_E(n):t===!1?eA():void 0,i=e?SE(n):e===!1?ZN():void 0,s=tA();return()=>{s(),o?.(),i?.()}}return()=>{}}function Sm(){lr("longtask",({entries:e})=>{let t=Me();if(!t)return;let{op:n,start_timestamp:r}=te(t);for(let o of e){let i=Pe($e()+o.startTime),s=Pe(o.duration);n==="navigation"&&r&&i<r||Yr(t,i,i+s,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[Ce]:"auto.ui.browser.metrics"}})}})}function _m(){new PerformanceObserver(t=>{let n=Me();if(n)for(let r of t.getEntries()){if(!r.scripts[0])continue;let o=Pe($e()+r.startTime),{start_timestamp:i,op:s}=te(n);if(s==="navigation"&&i&&o<i)continue;let a=Pe(r.duration),l={[Ce]:"auto.ui.browser.metrics"},c=r.scripts[0],{invoker:u,invokerType:d,sourceURL:p,sourceFunctionName:h,sourceCharPosition:y}=c;l["browser.script.invoker"]=u,l["browser.script.invoker_type"]=d,p&&(l["code.filepath"]=p),h&&(l["code.function"]=h),y!==-1&&(l["browser.script.source_char_position"]=y),Yr(n,o,o+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:l})}}).observe({type:"long-animation-frame",buffered:!0})}function vm(){lr("event",({entries:e})=>{let t=Me();if(t){for(let n of e)if(n.name==="click"){let r=Pe($e()+n.startTime),o=Pe(n.duration),i={name:Ue(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[Ce]:"auto.ui.browser.metrics"}},s=hs(n.target);s&&(i.attributes["ui.component_name"]=s),Yr(t,r,r+o,i)}}})}function ZN(){return Vr(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(Zt.cls={value:e.value,unit:""},Cu=t)},!0)}function eA(){return qr(({metric:e})=>{let t=e.entries[e.entries.length-1];!t||!Ei(e.value)||(Zt.lcp={value:e.value,unit:"millisecond"},hn=t)},!0)}function tA(){return gm(({metric:e})=>{e.entries[e.entries.length-1]&&(Zt.ttfb={value:e.value,unit:"millisecond"})})}function Em(e,t){let n=Kr(),r=$e();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:o,ignorePerformanceApiSpans:i,ignoreResourceSpans:s,recordClsOnPageloadSpan:a,recordLcpOnPageloadSpan:l}=t,c=Pe(r),u=n.getEntries(),{op:d,start_timestamp:p}=te(e);if(u.slice(vE).forEach(h=>{let y=Pe(h.startTime),_=Pe(Math.max(0,h.duration));if(!(d==="navigation"&&p&&c+y<p))switch(h.entryType){case"navigation":{iA(e,h,c);break}case"mark":case"paint":case"measure":{rA(e,h,y,_,c,i);let T=Cr(),g=h.startTime<T.firstHiddenTime;h.name==="first-paint"&&g&&(Zt.fp={value:h.startTime,unit:"millisecond"}),h.name==="first-contentful-paint"&&g&&(Zt.fcp={value:h.startTime,unit:"millisecond"});break}case"resource":{lA(e,h,h.name,y,_,c,s);break}}}),vE=Math.max(u.length-1,0),cA(e,o),d==="pageload"){if(fA(Zt),o){let h=(y,_,T)=>{let g=T??`browser.web_vital.${y}.value`;e.setAttribute(g,_),Ct&&C.log("Setting web vital attribute",{[g]:_},"on pageload span")};["ttfb","fp","fcp"].forEach(y=>{Zt[y]&&h(y,Zt[y].value)}),Zt["ttfb.requestTime"]&&h("ttfb.requestTime",Zt["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else a||delete Zt.cls,l||delete Zt.lcp,Object.entries(Zt).forEach(([h,y])=>{qc(h,y.value,y.unit)}),uA(e,t);e.setAttribute(o?"browser.performance.time_origin":"performance.timeOrigin",c),e.setAttribute(o?"browser.performance.navigation.activation_start":"performance.activationStart",Wn())}hn=void 0,Cu=void 0,Zt={}}function nA(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components \u269B"}catch{return}}function rA(e,t,n,r,o,i){if(nA(t)||["mark","measure"].includes(t.entryType)&&kt(t.name,i))return;let s=Gr(!1),a=Pe(s?s.requestStart:0),l=o+Math.max(n,a),c=o+n,u=c+r,d={[Ce]:"auto.resource.browser.metrics"};l!==c&&(d["sentry.browser.measure_happened_before_request"]=!0,d["sentry.browser.measure_start_time"]=l),oA(d,t),l<=u&&Yr(e,l,u,{name:t.name,op:t.entryType,attributes:d})}function oA(e,t){try{let n=t.detail;if(!n)return;if(typeof n=="object"){for(let[r,o]of Object.entries(n))if(o&&cn(o))e[`sentry.browser.measure.detail.${r}`]=o;else if(o!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(o)}catch{}return}if(cn(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function iA(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{wu(e,t,r,n)}),wu(e,t,"secureConnection",n,"TLS/SSL"),wu(e,t,"fetch",n,"cache"),wu(e,t,"domainLookup",n,"DNS"),aA(e,t,n)}function wu(e,t,n,r,o=n){let i=sA(n),s=t[i],a=t[`${n}Start`];!a||!s||Yr(e,r+Pe(a),r+Pe(s),{op:`browser.${o}`,name:t.name,attributes:{[Ce]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function sA(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function aA(e,t,n){let r=n+Pe(t.requestStart),o=n+Pe(t.responseEnd),i=n+Pe(t.responseStart);t.responseEnd&&(Yr(e,r,o,{op:"browser.request",name:t.name,attributes:{[Ce]:"auto.ui.browser.metrics"}}),Yr(e,i,o,{op:"browser.response",name:t.name,attributes:{[Ce]:"auto.ui.browser.metrics"}}))}function lA(e,t,n,r,o,i,s){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;let a=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(s?.includes(a))return;let l={[Ce]:"auto.resource.browser.metrics"},c=zn(n);c.protocol&&(l["url.scheme"]=c.protocol.split(":").pop()),c.host&&(l["server.address"]=c.host),l["url.same_origin"]=n.includes(q.location.origin),dA(t,l,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);let u={...l,...il(t)},d=i+r,p=d+o;Yr(e,d,p,{name:n.replace(q.location.origin,""),op:a,attributes:u})}function cA(e,t){let n=q.navigator;if(!n)return;let r=n.connection;r&&(r.effectiveType&&e.setAttribute(t?"network.connection.effective_type":"effectiveConnectionType",r.effectiveType),r.type&&e.setAttribute(t?"network.connection.type":"connectionType",r.type),Iu(r.rtt)&&(Zt["connection.rtt"]={value:r.rtt,unit:"millisecond"},t&&e.setAttribute("network.connection.rtt",r.rtt))),Iu(n.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",n.deviceMemory):e.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),Iu(n.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",n.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function uA(e,t){hn&&t.recordLcpOnPageloadSpan&&(hn.element&&e.setAttribute("lcp.element",Ue(hn.element)),hn.id&&e.setAttribute("lcp.id",hn.id),hn.url&&e.setAttribute("lcp.url",hn.url.trim().slice(0,200)),hn.loadTime!=null&&e.setAttribute("lcp.loadTime",hn.loadTime),hn.renderTime!=null&&e.setAttribute("lcp.renderTime",hn.renderTime),e.setAttribute("lcp.size",hn.size)),Cu?.sources&&t.recordClsOnPageloadSpan&&Cu.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Ue(n.node)))}function dA(e,t,n){n.forEach(([r,o])=>{let i=e[r];i!=null&&(typeof i=="number"&&i<QN||typeof i=="string")&&(t[o]=i)})}function fA(e){let t=Gr(!1);if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}var Tm=[],sl=new Map,Es=new Map,Im=60;function wm(){if(Kr()&&$e()){let t=pA();return()=>{t()}}return()=>{}}var Ts={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function pA(){return Si(mA)}var mA=({metric:e})=>{if(e.value==null)return;let t=Pe(e.value);if(t>Im)return;let n=e.entries.find(y=>y.duration===e.value&&Ts[y.name]);if(!n)return;let{interactionId:r}=n,o=Ts[n.name],i=Pe($e()+n.startTime),s=Me(),a=s?be(s):void 0,l=r!=null?sl.get(r):void 0,c=l?.span||a,u=c?te(c).description:ee().getScopeData().transactionName,d=l?.elementName||Ue(n.target),p={[Ce]:"auto.http.browser.inp",[Ye]:`ui.interaction.${o}`,[$t]:n.duration},h=vs({name:d,transaction:u,attributes:p,startTime:i});h&&(h.addEvent("inp",{[sr]:"millisecond",[ar]:e.value}),h.end(i+t))};function EE(e){return e!=null?sl.get(e):void 0}function Cm(){let e=Object.keys(Ts);jn()&&e.forEach(o=>{q.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){let i=o.target;if(!i)return;let s=Ue(i),a=Math.round(o.timeStamp);if(Es.set(a,s),Es.size>50){let l=Es.keys().next().value;l!==void 0&&Es.delete(l)}}function n(o){let i=Math.round(o.startTime),s=Es.get(i);if(!s)for(let a=-5;a<=5;a++){let l=Es.get(i+a);if(l){s=l;break}}return s||"<unknown>"}let r=({entries:o})=>{let i=Me(),s=i&&be(i);o.forEach(a=>{if(!hE(a))return;let l=a.interactionId;if(l==null||sl.has(l))return;let c=a.target?Ue(a.target):n(a);if(Tm.length>10){let u=Tm.shift();sl.delete(u)}Tm.push(l),sl.set(l,{span:s,elementName:c})})};lr("event",r),lr("first-input",r)}function Rm(e){let{name:t,op:n,origin:r,metricName:o,value:i,attributes:s,parentSpan:a,reportEvent:l,startTime:c,endTime:u}=e,d=ee().getScopeData().transactionName,p={[Ce]:r,[Ye]:n,[$t]:0,[`browser.web_vital.${o}.value`]:i,"sentry.transaction":d,"user_agent.original":q.navigator?.userAgent,...s};a&&Da(a).attributes?.[Ye]==="pageload"&&(p["sentry.pageload.span_id"]=a.spanContext().spanId),l&&(p[`browser.web_vital.${o}.report_event`]=l);let h=wt({name:t,attributes:p,startTime:c,parentSpan:a});h&&h.end(u??c)}function xm(e){let t=0,n;if(!_i("largest-contentful-paint"))return;let r=qr(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!Ei(o.value)||(t=o.value,n=i)},!0);vi(e,(o,i,s)=>{hA(t,n,s,o),r()})}function hA(e,t,n,r){if(!Ei(e))return;Ct&&C.log(`Sending LCP span (${e})`);let o=$e()||0,i=Pe(o),s=Pe(o+(t?.startTime||0)),a=t?Ue(t.element):"Largest contentful paint",l={};t?.element&&(l["browser.web_vital.lcp.element"]=Ue(t.element)),t?.id&&(l["browser.web_vital.lcp.id"]=t.id),t?.url&&(l["browser.web_vital.lcp.url"]=t.url),t?.loadTime!=null&&(l["browser.web_vital.lcp.load_time"]=t.loadTime),t?.renderTime!=null&&(l["browser.web_vital.lcp.render_time"]=t.renderTime),t?.size!=null&&(l["browser.web_vital.lcp.size"]=t.size),Rm({name:a,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:e,attributes:l,parentSpan:n,reportEvent:r,startTime:i,endTime:s})}function bm(e){let t=0,n;if(!_i("layout-shift"))return;let r=Vr(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);vi(e,(o,i,s)=>{gA(t,n,s,o),r()})}function gA(e,t,n,r){Ct&&C.log(`Sending CLS span (${e})`);let o=t?Pe(($e()||0)+t.startTime):Ae(),i=t?Ue(t.sources[0]?.node):"Layout shift",s={};t?.sources&&t.sources.forEach((a,l)=>{s[`browser.web_vital.cls.source.${l+1}`]=Ue(a.node)}),Rm({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:s,parentSpan:n,reportEvent:r,startTime:o})}function km(){if(!Kr()||!$e())return;Si(({metric:n})=>{if(n.value==null||Pe(n.value)>Im)return;let o=n.entries.find(i=>i.duration===n.value&&Ts[i.name]);o&&yA(n.value,o)})}function yA(e,t){Ct&&C.log(`Sending INP span (${e})`);let n=Pe($e()+t.startTime),r=Pe(e),o=Ts[t.name],i=EE(t.interactionId),s=Me(),a=s?be(s):void 0,l=i?.span||a,c=l?Da(l).name:ee().getScopeData().transactionName,u=i?.elementName||Ue(t.target);Rm({name:u,op:`ui.interaction.${o}`,origin:"auto.http.browser.inp",metricName:"inp",value:e,attributes:{[$t]:t.duration,"sentry.transaction":c},startTime:n,endTime:n+r,parentSpan:l})}var SA=1e3,TE,Nm,Am;function al(e){Dt("dom",e),Ut("dom",_A)}function _A(){if(!q.document)return;let e=mt.bind(null,"dom"),t=IE(e,!0);q.document.addEventListener("click",t,!1),q.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{let o=q[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(it(o,"addEventListener",function(i){return function(s,a,l){if(s==="click"||s=="keypress")try{let c=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},u=c[s]=c[s]||{refCount:0};if(!u.handler){let d=IE(e);u.handler=d,i.call(this,s,d,l)}u.refCount++}catch{}return i.call(this,s,a,l)}}),it(o,"removeEventListener",function(i){return function(s,a,l){if(s==="click"||s=="keypress")try{let c=this.__sentry_instrumentation_handlers__||{},u=c[s];u&&(u.refCount--,u.refCount<=0&&(i.call(this,s,u.handler,l),u.handler=void 0,delete c[s]),Object.keys(c).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,a,l)}}))})}function vA(e){if(e.type!==Nm)return!1;try{if(!e.target||e.target._sentryId!==Am)return!1}catch{}return!0}function EA(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function IE(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=TA(n);if(EA(n.type,r))return;qe(n,"_sentryCaptured",!0),r&&!r._sentryId&&qe(r,"_sentryId",st());let o=n.type==="keypress"?"input":n.type;vA(n)||(e({event:n,name:o,global:t}),Nm=n.type,Am=r?r._sentryId:void 0),clearTimeout(TE),TE=q.setTimeout(()=>{Am=void 0,Nm=void 0},SA)}}function TA(e){try{return e.target}catch{return null}}var Ru;function Jr(e){let t="history";Dt(t,e),Ut(t,IA)}function IA(){if(q.addEventListener("popstate",()=>{let t=q.location.href,n=Ru;if(Ru=t,n===t)return;mt("history",{from:n,to:t})}),!om())return;function e(t){return function(...n){let r=n.length>2?n[2]:void 0;if(r){let o=Ru,i=wA(String(r));if(Ru=i,o===i)return t.apply(this,n);mt("history",{from:o,to:i})}return t.apply(this,n)}}it(q.history,"pushState",e),it(q.history,"replaceState",e)}function wA(e){try{return new URL(e,q.location.origin).toString()}catch{return e}}var xu={};function bu(e){let t=xu[e];if(t)return t;let n=q[e];if(nl(n))return xu[e]=n.bind(q);let r=q.document;if(r&&typeof r.createElement=="function")try{let o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);let i=o.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(o)}catch(o){Ct&&C.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(xu[e]=n.bind(q))}function Mm(e){xu[e]=void 0}function Ti(...e){return bu("setTimeout")(...e)}var cr="__sentry_xhr_v3__";function ll(e){Dt("xhr",e),Ut("xhr",CA)}function CA(){if(!q.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){let o=new Error,i=Ae()*1e3,s=Ft(r[0])?r[0].toUpperCase():void 0,a=RA(r[1]);if(!s||!a)return t.apply(n,r);n[cr]={method:s,url:a,request_headers:{}},s==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);let l=()=>{let c=n[cr];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}let u={endTimestamp:Ae()*1e3,startTimestamp:i,xhr:n,virtualError:o};mt("xhr",u)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,u,d){return l(),c.apply(u,d)}}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,u,d){let[p,h]=d,y=u[cr];return y&&Ft(p)&&Ft(h)&&(y.request_headers[p.toLowerCase()]=h),c.apply(u,d)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){let o=n[cr];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);let i={startTimestamp:Ae()*1e3,xhr:n};return mt("xhr",i),t.apply(n,r)}})}function RA(e){if(Ft(e))return e;try{return e.toString()}catch{}}var xA=Symbol.for("sentry__originalRequestBody");function ku(e){return new URLSearchParams(e).toString()}function Nu(e,t=C){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[ku(e)];if(!e)return[void 0]}catch(n){return Ct&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Ct&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Au(e=[]){if(e.length>=2&&e[1]&&typeof e[1]=="object"&&"body"in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){let n=e[0][xA];return n!==void 0?n:void 0}}function cl(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Ct&&C.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
|
|
28
|
-
`).reduce((n,r)=>{let[o,i]=r.split(": ");return i&&(n[o.toLowerCase()]=i),n},{}):{}}function Pm(e){if(typeof Element>"u")return!1;try{return e instanceof Element}catch{return!1}}var bA=40;function wE(e,t=bu("fetch")){let n=0,r=0;async function o(i){let s=i.body.length;n+=s,r++;let a={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{let l=await t(e.url,a);return{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}}catch(l){throw Mm("fetch"),l}finally{n-=s,r--}}return Zc(e,o,hi(e.bufferSize||bA))}var tt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var kA=30;var NA=50;function Lm(e,t,n,r){let o={filename:e,function:t==="<anonymous>"?"?":t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}var AA=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,MA=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,PA=/\((\S*)(?::(\d+))(?::(\d+))\)/,LA=/at (.+?) ?\(data:(.+?),/,OA=e=>{let t=e.match(LA);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=AA.exec(e);if(n){let[,o,i,s]=n;return Lm(o,"?",+i,+s)}let r=MA.exec(e);if(r){if(r[2]?.indexOf("eval")===0){let a=PA.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}let[i,s]=RE(r[1]||"?",r[2]);return Lm(s,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},DA=[kA,OA],UA=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,FA=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,BA=e=>{let t=UA.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let i=FA.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],o=t[1]||"?";return[o,r]=RE(o,r),Lm(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},HA=[NA,BA];var $A=[DA,HA],CE=ga(...$A),RE=(e,t)=>{let n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:"?",n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};var Mu=1024,zA="Breadcrumbs",jA=((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:zA,setup(n){t.console&&tm(VA(n)),t.dom&&al(GA(n,t.dom)),t.xhr&&ll(qA(n)),t.fetch&&Co(YA(n)),t.history&&Jr(KA(n)),t.sentry&&n.on("beforeSendEvent",WA(n))}}}),xE=jA;function WA(e){return function(n){z()===e&&xn({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:ir(n)},{event:n})}}function GA(e,t){return function(r){if(z()!==e)return;let o,i,s=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>Mu&&(tt&&C.warn(`\`dom.maxStringLength\` cannot exceed ${Mu}, but a value of ${a} was configured. Sentry will use ${Mu} instead.`),a=Mu),typeof s=="string"&&(s=[s]);try{let c=r.event,u=JA(c)?c.target:c;o=Ue(u,{keyAttrs:s,maxStringLength:a}),i=hs(u)}catch{o="<unknown>"}if(o.length===0)return;let l={category:`ui.${r.name}`,message:o};i&&(l.data={"ui.component_name":i}),xn(l,{event:r.event,name:r.name,global:r.global})}}function VA(e){return function(n){if(z()!==e)return;let r={category:"console",data:{arguments:n.args,logger:"console"},level:ms(n.level),message:Ra(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Ra(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;xn(r,{input:n.args,level:n.level})}}function qA(e){return function(n){if(z()!==e)return;let{startTimestamp:r,endTimestamp:o}=n,i=n.xhr[cr];if(!r||!o||!i)return;let{method:s,url:a,status_code:l,body:c}=i,u={method:s,url:a,status_code:l},d={xhr:n.xhr,input:c,startTimestamp:r,endTimestamp:o},p={category:"xhr",data:u,type:"http",level:lu(l)};e.emit("beforeOutgoingRequestBreadcrumb",p,d),xn(p,d)}}function YA(e){return function(n){if(z()!==e)return;let{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){let i={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o},s={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",s,i),xn(s,i)}else{let i=n.response,s={...n.fetchData,status_code:i?.status},a={input:n.args,response:i,startTimestamp:r,endTimestamp:o},l={category:"fetch",data:s,type:"http",level:lu(s.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",l,a),xn(l,a)}}}function KA(e){return function(n){if(z()!==e)return;let r=n.from,o=n.to,i=zn(Q.location.href),s=r?zn(r):void 0,a=zn(o);s?.path||(s=i),i.protocol===a.protocol&&i.host===a.host&&(o=a.relative),i.protocol===s.protocol&&i.host===s.host&&(r=s.relative),xn({category:"navigation",data:{from:r,to:o}})}}function JA(e){return!!e&&!!e.target}var XA="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),QA="BrowserApiErrors",ZA=((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:QA,setupOnce(){t.setTimeout&&it(Q,"setTimeout",bE),t.setInterval&&it(Q,"setInterval",bE),t.requestAnimationFrame&&it(Q,"requestAnimationFrame",e1),t.XMLHttpRequest&&"XMLHttpRequest"in Q&&it(XMLHttpRequest.prototype,"send",t1);let n=t.eventTarget;n&&(Array.isArray(n)?n:XA).forEach(o=>n1(o,t))}}}),kE=ZA;function bE(e){return function(...t){let n=t[0];return t[0]=gi(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Jt(e)}`}}),e.apply(this,t)}}function e1(e){return function(t){return e.apply(this,[gi(t,{mechanism:{data:{handler:Jt(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function t1(e){return function(...t){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&it(n,o,function(i){let s={mechanism:{data:{handler:Jt(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=So(i);return a&&(s.mechanism.data.handler=Jt(a)),gi(i,s)})}),e.apply(this,t)}}function n1(e,t){let r=Q[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(it(r,"addEventListener",function(o){return function(i,s,a){try{r1(s)&&(s.handleEvent=gi(s.handleEvent,{mechanism:{data:{handler:Jt(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&o1(this,i,s),o.apply(this,[i,gi(s,{mechanism:{data:{handler:Jt(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),it(r,"removeEventListener",function(o){return function(i,s,a){try{let l=s.__sentry_wrapped__;l&&o.call(this,i,l,a)}catch{}return o.call(this,i,s,a)}}))}function r1(e){return typeof e.handleEvent=="function"}function o1(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}var NE=(e={})=>{let t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof Q.document>"u"){tt&&C.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}us({ignoreDuration:!0}),mi();let n=Qe(),r=n.getUser();n.addScopeListener(o=>{let i=o.getUser();(r?.id!==i?.id||r?.ip_address!==i?.ip_address)&&(mi(),r=i)}),t==="route"&&Jr(({from:o,to:i})=>{o!==i&&(us({ignoreDuration:!0}),mi())})}}};var i1="CultureContext",s1=(()=>({name:i1,preprocessEvent(e){let t=AE();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=AE();t&&Io(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})),ME=s1;function AE(){try{let e=Q.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var a1="GlobalHandlers",l1=((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:a1,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(c1(n),PE("onerror")),t.onunhandledrejection&&(u1(n),PE("onunhandledrejection"))}}}),LE=l1;function c1(e){_a(t=>{let{stackParser:n,attachStacktrace:r}=OE();if(z()!==e||am())return;let{msg:o,url:i,line:s,column:a,error:l}=t,c=p1(pu(n,l||o,void 0,r,!1),i,s,a);c.level="error",cs(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function u1(e){va(t=>{let{stackParser:n,attachStacktrace:r}=OE();if(z()!==e||am())return;let o=d1(t),i=cn(o)?f1(o):pu(n,o,void 0,r,!0);i.level="error",cs(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function d1(e){if(cn(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function f1(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function p1(e,t,n,r){let o=e.exception=e.exception||{},i=o.values=o.values||[],s=i[0]=i[0]||{},a=s.stacktrace=s.stacktrace||{},l=a.frames=a.frames||[];return l.length===0&&l.push({colno:r,lineno:n,filename:m1(t)??mn(),function:"?",in_app:!0}),e}function PE(e){tt&&C.log(`Global Handler attached: ${e}`)}function OE(){return z()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function m1(e){if(!(!Ft(e)||e.length===0))return e.startsWith("data:")?`<${zt(e,!1)}>`:e}var DE=()=>({name:"HttpContext",preprocessEvent(e){if(!Q.navigator&&!Q.location&&!Q.document)return;let t=gs(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){if(!Q.navigator&&!Q.location&&!Q.document)return;let t=gs();Io(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers["User-Agent"],"http.request.header.referer":t.headers.Referer})}});var h1="cause",g1=5,y1="LinkedErrors",S1=((e={})=>{let t=e.limit||g1,n=e.key||h1;return{name:y1,preprocessEvent(r,o,i){let s=i.getOptions();em(du,s.stackParser,n,t,r,o)}}}),UE=S1;var _1=/^HTML(\w*)Element$/;function ul(e){if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Pm(e)){let t=v1(e);if(_1.test(t))return`[HTMLElement: ${Ue(e)}]`}}function v1(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function FE(){return E1()?(tt&&bt(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function E1(){if(typeof Q.window>"u")return!1;let e=Q;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let n=mn();return!(Q===Q.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function BE(e){return[ou(),nu(),nm(),kE(),xE(),LE(),UE(),su(),DE(),ME(),NE()]}function Om(e={}){let t=!e.skipBrowserExtensionCheck&&FE(),n=e.defaultIntegrations==null?BE():e.defaultIntegrations,r={...e,enabled:t?!1:e.enabled,stackParser:xc(e.stackParser||CE),integrations:Bp({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||wE};return Xi(ul),qp(mu,r)}function Pu(e={}){let t=Q.document,n=t?.head||t?.body;if(!n){tt&&C.error("[showReportDialog] Global document not defined");return}let r=ee(),i=z()?.getDsn();if(!i){tt&&C.error("[showReportDialog] DSN not configured");return}let s={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||Ga()},a=Q.document.createElement("script");a.async=!0,a.crossOrigin="anonymous",a.src=Up(i,s);let{onLoad:l,onClose:c}=s;if(l&&(a.onload=l),c){let u=d=>{if(d.data==="__sentry_reportdialog_closed__")try{c()}finally{Q.removeEventListener("message",u)}};Q.addEventListener("message",u)}n.appendChild(a)}var je=V,dh="sentryReplaySession",T1="replay_event",fh="Unable to send Replay",I1=3e5,w1=9e5,C1=5e3,R1=5500,x1=6e4,b1=5e3,k1=3,HE=15e4,Lu=5e3,N1=3e3,A1=300,ph=2e7,M1=4999,P1=5e4,$E=36e5,L1=Object.defineProperty,O1=(e,t,n)=>t in e?L1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zE=(e,t,n)=>O1(e,typeof t!="symbol"?t+"":t,n),gt=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(gt||{});function D1(e){return e.nodeType===e.ELEMENT_NODE}function pl(e){return e?.host?.shadowRoot===e}function ml(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function U1(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function F1(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let n=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function Bu(e){try{let t=e.rules||e.cssRules;return t?U1(Array.from(t,fT).join("")):null}catch{return null}}function B1(e){let t="";for(let n=0;n<e.style.length;n++){let r=e.style,o=r[n],i=r.getPropertyPriority(o);t+=`${o}:${r.getPropertyValue(o)}${i?" !important":""};`}return`${e.selectorText} { ${t} }`}function fT(e){let t;if($1(e))try{t=Bu(e.styleSheet)||F1(e)}catch{}else if(z1(e)){let n=e.cssText,r=e.selectorText.includes(":"),o=typeof e.style.all=="string"&&e.style.all;if(o&&(n=B1(e)),r&&(n=H1(n)),r||o)return n}return t||e.cssText}function H1(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function $1(e){return"styleSheet"in e}function z1(e){return"selectorText"in e}var Hu=class{constructor(){zE(this,"idNodeMap",new Map),zE(this,"nodeMetaMap",new WeakMap)}getId(t){return t?this.getMeta(t)?.id??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){let r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){let r=this.getNode(t);if(r){let o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function j1(){return new Hu}function ed({maskInputOptions:e,tagName:t,type:n}){return t==="OPTION"&&(t="SELECT"),!!(e[t.toLowerCase()]||n&&e[n]||n==="password"||t==="INPUT"&&!n&&e.text)}function gl({isMasked:e,element:t,value:n,maskInputFn:r}){let o=n||"";return e?(r&&(o=r(o,t)),"*".repeat(o.length)):o}function Ns(e){return e.toLowerCase()}function $m(e){return e.toUpperCase()}var jE="__rrweb_original__";function W1(e){let t=e.getContext("2d");if(!t)return!0;let n=50;for(let r=0;r<e.width;r+=n)for(let o=0;o<e.height;o+=n){let i=t.getImageData,s=jE in i?i[jE]:i;if(new Uint32Array(s.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer).some(l=>l!==0))return!1}return!0}function mh(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ns(t):null}function $u(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function pT(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}let r=/\.([0-9a-z]+)(?:$)/i;return n.pathname.match(r)?.[1]??null}var WE={};function mT(e){let t=WE[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement=="function")try{let o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);let i=o.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(o)}catch{}return WE[e]=r.bind(window)}function zm(...e){return mT("setTimeout")(...e)}function hT(...e){return mT("clearTimeout")(...e)}function gT(e){try{return e.contentDocument}catch{}}function G1(e){try{return e.contentWindow}catch{}}var V1=1,q1=new RegExp("[^a-z0-9-_:]"),yl=-2;function hh(){return V1++}function Y1(e){if(e instanceof HTMLFormElement)return"form";let t=Ns(e.tagName);return q1.test(t)?"div":t}function K1(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var Is,GE,J1=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,X1=/^(?:[a-z+]+:)?\/\//i,Q1=/^www\..*/i,Z1=/^(data:)([^,]*),(.*)/i;function eM(e,t){if(!e||t.size===0)return e;try{let n=e.split(";"),r=[];for(let o of n){if(o=o.trim(),!o)continue;let i=o.indexOf(":");if(i===-1){r.push(o);continue}let s=o.slice(0,i).trim();t.has(s)||r.push(o)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function zu(e,t){return(e||"").replace(J1,(n,r,o,i,s,a)=>{let l=o||s||a,c=r||i||"";if(!l)return n;if(X1.test(l)||Q1.test(l))return`url(${c}${l}${c})`;if(Z1.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${K1(t)+l}${c})`;let u=t.split("/"),d=l.split("/");u.pop();for(let p of d)p!=="."&&(p===".."?u.pop():u.push(p));return`url(${c}${u.join("/")}${c})`})}var tM=/^[^ \t\n\r\u000c]+/,nM=/^[, \t\n\r\u000c]+/;function rM(e,t){if(t.trim()==="")return t;let n=0;function r(i){let s,a=i.exec(t.substring(n));return a?(s=a[0],n+=s.length,s):""}let o=[];for(;r(nM),!(n>=t.length);){let i=r(tM);if(i.slice(-1)===",")i=Rs(e,i.substring(0,i.length-1)),o.push(i);else{let s="";i=Rs(e,i);let a=!1;for(;;){let l=t.charAt(n);if(l===""){o.push((i+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){n+=1,o.push((i+s).trim());break}else l==="("&&(a=!0);s+=l,n+=1}}}return o.join(", ")}var VE=new WeakMap;function Rs(e,t){return!t||t.trim()===""?t:td(e,t)}function oM(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function td(e,t){let n=VE.get(e);if(n||(n=e.createElement("a"),VE.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function yT(e,t,n,r,o,i,s){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return Rs(e,r);if(n==="xlink:href"&&r[0]!=="#")return Rs(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return Rs(e,r);if(n==="srcset")return rM(e,r);if(n==="style"){let a=zu(r,td(e));return s&&s.size>0&&(a=eM(a,s)),a}else if(t==="object"&&n==="data")return Rs(e,r);return typeof i=="function"?i(n,r,o):r}function ST(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function iM(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let o=e.classList.length;o--;){let i=e.classList[o];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function sM(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function Ii(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Ii(e.parentNode,t,n,r+1)}function xs(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(sM(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function As(e,t,n,r,o,i){try{let s=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(s===null)return!1;if(s.tagName==="INPUT"){let c=s.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(c))return!0}let a=-1,l=-1;if(i){if(l=Ii(s,xs(r,o)),l<0)return!0;a=Ii(s,xs(t,n),l>=0?l:1/0)}else{if(a=Ii(s,xs(t,n)),a<0)return!1;l=Ii(s,xs(r,o),a>=0?a:1/0)}return a>=0?l>=0?a<=l:!0:l>=0?!1:!!i}catch{}return!!i}function aM(e,t,n){let r=G1(e);if(!r)return;let o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){let a=zm(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{hT(a),o=!0,t()});return}let s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return zm(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function lM(e,t,n){let r=!1,o;try{o=e.sheet}catch{o=null}if(o)return;let i=zm(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{hT(i),r=!0,t()})}function cM(e,t){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskAttributeFn:l,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:y={},maskTextFn:_,maskInputFn:T,dataURLOptions:g={},inlineImages:S,recordCanvas:E,keepIframeSrcFn:R,newlyAddedElement:M=!1,ignoreCSSAttributes:A}=t,I=uM(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:gt.Document,childNodes:[],compatMode:e.compatMode}:{type:gt.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:gt.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return fM(e,{doc:n,blockClass:o,blockSelector:i,unblockSelector:s,inlineStylesheet:h,maskAttributeFn:l,maskInputOptions:y,maskInputFn:T,dataURLOptions:g,inlineImages:S,recordCanvas:E,keepIframeSrcFn:R,newlyAddedElement:M,rootId:I,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:p,ignoreCSSAttributes:A});case e.TEXT_NODE:return dM(e,{doc:n,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:p,maskTextFn:_,maskInputOptions:y,maskInputFn:T,rootId:I});case e.CDATA_SECTION_NODE:return{type:gt.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:gt.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function uM(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function dM(e,t){let{maskAllText:n,maskTextClass:r,unmaskTextClass:o,maskTextSelector:i,unmaskTextSelector:s,maskTextFn:a,maskInputOptions:l,maskInputFn:c,rootId:u}=t,d=e.parentNode&&e.parentNode.tagName,p=e.textContent,h=d==="STYLE"?!0:void 0,y=d==="SCRIPT"?!0:void 0,_=d==="TEXTAREA"?!0:void 0;if(h&&p){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(p=Bu(e.parentNode.sheet))}catch(g){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${g}`,e)}p=zu(p,td(t.doc))}y&&(p="SCRIPT_PLACEHOLDER");let T=As(e,r,i,o,s,n);if(!h&&!y&&!_&&p&&T&&(p=a?a(p,e.parentElement):p.replace(/[\S]/g,"*")),_&&p&&(l.textarea||T)&&(p=c?c(p,e.parentNode):p.replace(/[\S]/g,"*")),d==="OPTION"&&p){let g=ed({type:null,tagName:d,maskInputOptions:l});p=gl({isMasked:As(e,r,i,o,s,g),element:e,value:p,maskInputFn:c})}return{type:gt.Text,textContent:p||"",isStyle:h,rootId:u}}function fM(e,t){let{doc:n,blockClass:r,blockSelector:o,unblockSelector:i,inlineStylesheet:s,maskInputOptions:a={},maskAttributeFn:l,maskInputFn:c,dataURLOptions:u={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:h,newlyAddedElement:y=!1,rootId:_,maskTextClass:T,unmaskTextClass:g,maskTextSelector:S,unmaskTextSelector:E,ignoreCSSAttributes:R}=t,M=iM(e,r,o,i),A=Y1(e),I={},N=e.attributes.length;for(let x=0;x<N;x++){let $=e.attributes[x];$.name&&!ST(A,$.name,$.value)&&(I[$.name]=yT(n,A,Ns($.name),$.value,e,l,R))}if(A==="link"&&s){let x=Array.from(n.styleSheets).find(W=>W.href===e.href),$=null;x&&($=Bu(x)),$&&(I.rel=null,I.href=null,I.crossorigin=null,I._cssText=zu($,x.href))}if(A==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){let x=Bu(e.sheet);x&&(I._cssText=zu(x,td(n)))}if(A==="input"||A==="textarea"||A==="select"||A==="option"){let x=e,$=mh(x),W=$u(x,$m(A),$),ye=x.checked;if($!=="submit"&&$!=="button"&&W){let K=As(x,T,S,g,E,ed({type:$,tagName:$m(A),maskInputOptions:a}));I.value=gl({isMasked:K,element:x,value:W,maskInputFn:c})}ye&&(I.checked=ye)}if(A==="option"&&(e.selected&&!a.select?I.selected=!0:delete I.selected),A==="canvas"&&p){if(e.__context==="2d")W1(e)||(I.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){let x=e.toDataURL(u.type,u.quality),$=n.createElement("canvas");$.width=e.width,$.height=e.height;let W=$.toDataURL(u.type,u.quality);x!==W&&(I.rr_dataURL=x)}}if(A==="img"&&d){Is||(Is=n.createElement("canvas"),GE=Is.getContext("2d"));let x=e,$=x.currentSrc||x.getAttribute("src")||"<unknown-src>",W=x.crossOrigin,ye=()=>{x.removeEventListener("load",ye);try{Is.width=x.naturalWidth,Is.height=x.naturalHeight,GE.drawImage(x,0,0),I.rr_dataURL=Is.toDataURL(u.type,u.quality)}catch(K){if(x.crossOrigin!=="anonymous"){x.crossOrigin="anonymous",x.complete&&x.naturalWidth!==0?ye():x.addEventListener("load",ye);return}else console.warn(`Cannot inline img src=${$}! Error: ${K}`)}x.crossOrigin==="anonymous"&&(W?I.crossOrigin=W:x.removeAttribute("crossorigin"))};x.complete&&x.naturalWidth!==0?ye():x.addEventListener("load",ye)}if((A==="audio"||A==="video")&&(I.rr_mediaState=e.paused?"paused":"played",I.rr_mediaCurrentTime=e.currentTime),y||(e.scrollLeft&&(I.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(I.rr_scrollTop=e.scrollTop)),M){let{width:x,height:$}=e.getBoundingClientRect();I={class:I.class,rr_width:`${x}px`,rr_height:`${$}px`}}A==="iframe"&&!h(I.src)&&(!M&&!gT(e)&&(I.rr_src=I.src),delete I.src);let U;try{customElements.get(A)&&(U=!0)}catch{}return{type:gt.Element,tagName:A,attributes:I,childNodes:[],isSVG:oM(e)||void 0,needBlock:M,rootId:_,isCustom:U}}function ze(e){return e==null?"":e.toLowerCase()}function pM(e,t){if(t.comment&&e.type===gt.Comment)return!0;if(e.type===gt.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&pT(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ze(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ze(e.attributes.name)==="application-name"||ze(e.attributes.rel)==="icon"||ze(e.attributes.rel)==="apple-touch-icon"||ze(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ze(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ze(e.attributes.property).match(/^(og|twitter|fb):/)||ze(e.attributes.name).match(/^(og|twitter):/)||ze(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ze(e.attributes.name)==="robots"||ze(e.attributes.name)==="googlebot"||ze(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ze(e.attributes.name)==="author"||ze(e.attributes.name)==="generator"||ze(e.attributes.name)==="framework"||ze(e.attributes.name)==="publisher"||ze(e.attributes.name)==="progid"||ze(e.attributes.property).match(/^article:/)||ze(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ze(e.attributes.name)==="google-site-verification"||ze(e.attributes.name)==="yandex-verification"||ze(e.attributes.name)==="csrf-token"||ze(e.attributes.name)==="p:domain_verify"||ze(e.attributes.name)==="verify-v1"||ze(e.attributes.name)==="verification"||ze(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function bs(e,t){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,skipChild:p=!1,inlineStylesheet:h=!0,maskInputOptions:y={},maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S,dataURLOptions:E={},inlineImages:R=!1,recordCanvas:M=!1,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N=5e3,onBlockedImageLoad:U,onStylesheetLoad:x,stylesheetLoadTimeout:$=5e3,keepIframeSrcFn:W=()=>!1,newlyAddedElement:ye=!1,ignoreCSSAttributes:K}=t,{preserveWhiteSpace:et=!0}=t,pe=cM(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:a,unblockSelector:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,inlineStylesheet:h,maskInputOptions:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,dataURLOptions:E,inlineImages:R,recordCanvas:M,keepIframeSrcFn:W,newlyAddedElement:ye,ignoreCSSAttributes:K});if(!pe)return console.warn(e,"not serialized"),null;let fe;r.hasNode(e)?fe=r.getId(e):pM(pe,S)||!et&&pe.type===gt.Text&&!pe.isStyle&&!pe.textContent.trim().length?fe=yl:fe=hh();let D=Object.assign(pe,{id:fe});if(r.add(e,D),fe===yl)return null;A&&A(e);let Se=!p;if(D.type===gt.Element){Se=Se&&!D.needBlock;let J=e.shadowRoot;J&&ml(J)&&(D.isShadowHost=!0)}if((D.type===gt.Document||D.type===gt.Element)&&Se){S.headWhitespace&&D.type===gt.Element&&D.tagName==="head"&&(et=!1);let J={doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:a,unblockSelector:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,skipChild:p,inlineStylesheet:h,maskInputOptions:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S,dataURLOptions:E,inlineImages:R,recordCanvas:M,preserveWhiteSpace:et,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onBlockedImageLoad:U,onStylesheetLoad:x,stylesheetLoadTimeout:$,keepIframeSrcFn:W,ignoreCSSAttributes:K},le=e.childNodes?Array.from(e.childNodes):[];for(let Ie of le){let _e=bs(Ie,J);_e&&D.childNodes.push(_e)}if(D1(e)&&e.shadowRoot)for(let Ie of Array.from(e.shadowRoot.childNodes)){let _e=bs(Ie,J);_e&&(ml(e.shadowRoot)&&(_e.isShadow=!0),D.childNodes.push(_e))}}if(e.parentNode&&pl(e.parentNode)&&ml(e.parentNode)&&(D.isShadow=!0),D.type===gt.Element&&D.tagName==="iframe"&&!D.needBlock&&aM(e,()=>{let J=gT(e);if(J&&I){let le=bs(J,{doc:J,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S,dataURLOptions:E,inlineImages:R,recordCanvas:M,preserveWhiteSpace:et,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onStylesheetLoad:x,stylesheetLoadTimeout:$,keepIframeSrcFn:W,ignoreCSSAttributes:K});le&&I(e,le)}},N),D.type===gt.Element&&D.tagName==="img"&&!e.complete&&D.needBlock){let J=e,le=()=>{if(J.isConnected&&!J.complete&&U)try{let Ie=J.getBoundingClientRect();Ie.width>0&&Ie.height>0&&U(J,D,Ie)}catch{}J.removeEventListener("load",le)};J.isConnected&&J.addEventListener("load",le)}return D.type===gt.Element&&D.tagName==="link"&&typeof D.attributes.rel=="string"&&(D.attributes.rel==="stylesheet"||D.attributes.rel==="preload"&&typeof D.attributes.href=="string"&&pT(D.attributes.href)==="css")&&lM(e,()=>{if(x){let J=bs(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S,dataURLOptions:E,inlineImages:R,recordCanvas:M,preserveWhiteSpace:et,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onStylesheetLoad:x,stylesheetLoadTimeout:$,keepIframeSrcFn:W,ignoreCSSAttributes:K});J&&x(e,J)}},$),D.type===gt.Element&&delete D.needBlock,D}function mM(e,t){let{mirror:n=new Hu,blockClass:r="rr-block",blockSelector:o=null,unblockSelector:i=null,maskAllText:s=!1,maskTextClass:a="rr-mask",unmaskTextClass:l=null,maskTextSelector:c=null,unmaskTextSelector:u=null,inlineStylesheet:d=!0,inlineImages:p=!1,recordCanvas:h=!1,maskAllInputs:y=!1,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOM:S=!1,dataURLOptions:E,preserveWhiteSpace:R,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:I,onBlockedImageLoad:N,onStylesheetLoad:U,stylesheetLoadTimeout:x,keepIframeSrcFn:$=()=>!1,ignoreCSSAttributes:W=new Set([])}=t||{};return bs(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,maskAllText:s,maskTextClass:a,unmaskTextClass:l,maskTextSelector:c,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:y===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:y===!1?{}:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S===!0||S==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:S==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:S===!1?{}:S,dataURLOptions:E,inlineImages:p,recordCanvas:h,preserveWhiteSpace:R,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:I,onBlockedImageLoad:N,onStylesheetLoad:U,stylesheetLoadTimeout:x,keepIframeSrcFn:$,newlyAddedElement:!1,ignoreCSSAttributes:W})}function tn(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var ws=`Please stop import mirror directly. Instead of that,\r
|
|
26
|
+
Name: ${Qt(r)}
|
|
27
|
+
Error:`,o)}}function jN(){return oE(e=>{sl("cls",{metric:e}),dE=e},{reportAllChanges:!0})}function WN(){return cE(e=>{sl("lcp",{metric:e}),fE=e},{reportAllChanges:!0})}function GN(){return uE(e=>{sl("ttfb",{metric:e}),pE=e})}function VN(){return lE(e=>{sl("inp",{metric:e}),mE=e})}function wu(e,t,n,r,o=!1){hE(e,t);let i;return Iu[e]||(i=n(),Iu[e]=!0),r&&t({metric:r}),gE(e,t,o?i:void 0)}function qN(e){let t={};e==="event"&&(t.durationThreshold=0),Vn(e,n=>{sl(e,{entries:n})},t)}function hE(e,t){il[e]=il[e]||[],il[e].push(t)}function gE(e,t,n){return()=>{n&&n();let r=il[e];if(!r)return;let o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function yE(e){return"duration"in e}var YN=80;function Ue(e,t={}){if(!e)return"<unknown>";try{let n=e,r=5,o=[],i=0,s=0,a=" > ",l=a.length,c,u=Array.isArray(t)?t:t.keyAttrs,f=!Array.isArray(t)&&t.maxStringLength||YN;for(;n&&i++<r&&(c=KN(n,u),!(c==="html"||i>1&&s+o.length*l+c.length>=f));)o.push(c),s+=c.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function KN(e,t){let n=e,r=[];if(!n?.tagName)return"";if(typeof HTMLElement<"u"&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let o=t?.length?t.filter(i=>n.getAttribute(i)).map(i=>[i,n.getAttribute(i)]):null;if(o?.length)o.forEach(i=>{r.push(`[${i[0]}="${i[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let i=n.className;if(i&&Ht(i)){let s=i.split(/\s+/);for(let a of s)r.push(`.${a}`)}}for(let i of["aria-label","type","name","title","alt"]){let s=n.getAttribute(i);s&&r.push(`[${i}="${s}"]`)}return r.join("")}var SE=e=>{let t=n=>{(n.type==="pagehide"||q.document?.visibilityState==="hidden")&&e(n)};Gn("visibilitychange",t,{capture:!0,once:!0}),Gn("pagehide",t,{capture:!0,once:!0})};function Cu(e){return typeof e=="number"&&isFinite(e)}function Jr(e,t,n,{...r}){let o=ne(e).start_timestamp;return o&&o>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),ls(e,()=>{let i=wt({startTime:t,...r});return i&&i.end(n),i})}function Ts(e){let t=$();if(!t)return;let{name:n,transaction:r,attributes:o,startTime:i}=e,{release:s,environment:a}=t.getOptions(),{userInfo:l}=t.getDataCollectionOptions(),u=t.getIntegrationByName("Replay")?.getReplayId(),f=te(),p=f.getUser(),h=p!==void 0?p.email||p.id||p.ip_address:void 0,y;try{y=f.getScopeData().contexts.profile.profile_id}catch{}let _={release:s,environment:a,user:h||void 0,profile_id:y||void 0,replay_id:u||void 0,transaction:r,"user_agent.original":q.navigator?.userAgent,"client.address":l?"{{auto}}":void 0,...o};return wt({name:n,attributes:_,startTime:i,experimental:{standalone:!0}})}function Xr(){return q.addEventListener&&q.performance}function Pe(e){return e/1e3}function _E(e){let t="unknown",n="unknown",r="";for(let o of e){if(o==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(o))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=o}return r===e&&(t=r),{name:t,version:n}}function vi(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function Ei(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n.spanContext().spanId,n),r=!0}SE(()=>{o("pagehide")});let i=e.on("beforeStartNavigationSpan",(a,l)=>{l?.isRedirect||(o("navigation"),i(),s())}),s=e.on("afterStartPageLoadSpan",a=>{n=a,s()})}function vE(e){let t=0,n;if(!vi("layout-shift"))return;let r=Yr(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);Ei(e,(o,i)=>{JN(t,n,i,o),r()})}function JN(e,t,n,r){Ct&&C.log(`Sending CLS span (${e})`);let o=t?Pe((He()||0)+t.startTime):Ae(),i=te().getScopeData().transactionName,s=t?Ue(t.sources[0]?.node):"Layout shift",a={[we]:"auto.http.browser.cls",[qe]:"ui.webvital.cls",[jt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((c,u)=>{a[`cls.source.${u+1}`]=Ue(c.node)});let l=Ts({name:s,transaction:i,attributes:a,startTime:o});l&&(l.addEvent("cls",{[ar]:"",[lr]:e}),l.end(o))}var XN=6e4;function Ti(e){return e!=null&&e>0&&e<=XN}function EE(e){let t=0,n;if(!vi("largest-contentful-paint"))return;let r=Kr(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!Ti(o.value)||(t=o.value,n=i)},!0);Ei(e,(o,i)=>{QN(t,n,i,o),r()})}function QN(e,t,n,r){if(!Ti(e))return;Ct&&C.log(`Sending LCP span (${e})`);let o=Pe((He()||0)+(t?.startTime||0)),i=te().getScopeData().transactionName,s=t?Ue(t.element):"Largest contentful paint",a={[we]:"auto.http.browser.lcp",[qe]:"ui.webvital.lcp",[jt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=Ue(t.element)),t.id&&(a["lcp.id"]=t.id),t.url&&(a["lcp.url"]=t.url),t.loadTime!=null&&(a["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(a["lcp.renderTime"]=t.renderTime),t.size!=null&&(a["lcp.size"]=t.size));let l=Ts({name:s,transaction:i,attributes:a,startTime:o});l&&(l.addEvent("lcp",{[ar]:"millisecond",[lr]:e}),l.end(o))}function qn(e){return e&&((He()||performance.timeOrigin)+e)/1e3}function al(e){let t={};if(e.nextHopProtocol!=null){let{name:n,version:r}=_E(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return He()||Xr()?.timeOrigin?ZN({...t,"http.request.redirect_start":qn(e.redirectStart),"http.request.redirect_end":qn(e.redirectEnd),"http.request.worker_start":qn(e.workerStart),"http.request.fetch_start":qn(e.fetchStart),"http.request.domain_lookup_start":qn(e.domainLookupStart),"http.request.domain_lookup_end":qn(e.domainLookupEnd),"http.request.connect_start":qn(e.connectStart),"http.request.secure_connection_start":qn(e.secureConnectionStart),"http.request.connection_end":qn(e.connectEnd),"http.request.request_start":qn(e.requestStart),"http.request.response_start":qn(e.responseStart),"http.request.response_end":qn(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function ZN(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}var eA=2147483647,TE=0,tn={},gn,xu;function _m({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){let r=Xr();if(r&&He()){r.mark&&q.performance.mark("sentry-tracing-init");let o=t?EE(n):t===!1?nA():void 0,i=e?vE(n):e===!1?tA():void 0,s=rA();return()=>{s(),o?.(),i?.()}}return()=>{}}function vm(){cr("longtask",({entries:e})=>{let t=Me();if(!t)return;let{op:n,start_timestamp:r}=ne(t);for(let o of e){let i=Pe(He()+o.startTime),s=Pe(o.duration);n==="navigation"&&r&&i<r||Jr(t,i,i+s,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[we]:"auto.ui.browser.metrics"}})}})}function Em(){new PerformanceObserver(t=>{let n=Me();if(n)for(let r of t.getEntries()){if(!r.scripts[0])continue;let o=Pe(He()+r.startTime),{start_timestamp:i,op:s}=ne(n);if(s==="navigation"&&i&&o<i)continue;let a=Pe(r.duration),l={[we]:"auto.ui.browser.metrics"},c=r.scripts[0],{invoker:u,invokerType:f,sourceURL:p,sourceFunctionName:h,sourceCharPosition:y}=c;l["browser.script.invoker"]=u,l["browser.script.invoker_type"]=f,p&&(l["code.filepath"]=p),h&&(l["code.function"]=h),y!==-1&&(l["browser.script.source_char_position"]=y),Jr(n,o,o+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:l})}}).observe({type:"long-animation-frame",buffered:!0})}function Tm(){cr("event",({entries:e})=>{let t=Me();if(t){for(let n of e)if(n.name==="click"){let r=Pe(He()+n.startTime),o=Pe(n.duration),i={name:Ue(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[we]:"auto.ui.browser.metrics"}},s=ys(n.target);s&&(i.attributes["ui.component_name"]=s),Jr(t,r,r+o,i)}}})}function tA(){return Yr(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(tn.cls={value:e.value,unit:""},xu=t)},!0)}function nA(){return Kr(({metric:e})=>{let t=e.entries[e.entries.length-1];!t||!Ti(e.value)||(tn.lcp={value:e.value,unit:"millisecond"},gn=t)},!0)}function rA(){return Sm(({metric:e})=>{e.entries[e.entries.length-1]&&(tn.ttfb={value:e.value,unit:"millisecond"})})}function Im(e,t){let n=Xr(),r=He();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:o,ignorePerformanceApiSpans:i,ignoreResourceSpans:s,recordClsOnPageloadSpan:a,recordLcpOnPageloadSpan:l}=t,c=Pe(r),u=n.getEntries(),{op:f,start_timestamp:p}=ne(e);if(u.slice(TE).forEach(h=>{let y=Pe(h.startTime),_=Pe(Math.max(0,h.duration));if(!(f==="navigation"&&p&&c+y<p))switch(h.entryType){case"navigation":{aA(e,h,c);break}case"mark":case"paint":case"measure":{iA(e,h,y,_,c,i);let T=Rr(),g=h.startTime<T.firstHiddenTime;h.name==="first-paint"&&g&&(tn.fp={value:h.startTime,unit:"millisecond"}),h.name==="first-contentful-paint"&&g&&(tn.fcp={value:h.startTime,unit:"millisecond"});break}case"resource":{uA(e,h,h.name,y,_,c,s);break}}}),TE=Math.max(u.length-1,0),dA(e,o),f==="pageload"){if(mA(tn),o){let h=(y,_,T)=>{let g=T??`browser.web_vital.${y}.value`;e.setAttribute(g,_),Ct&&C.log("Setting web vital attribute",{[g]:_},"on pageload span")};["ttfb","fp","fcp"].forEach(y=>{tn[y]&&h(y,tn[y].value)}),tn["ttfb.requestTime"]&&h("ttfb.requestTime",tn["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else a||delete tn.cls,l||delete tn.lcp,Object.entries(tn).forEach(([h,y])=>{Kc(h,y.value,y.unit)}),fA(e,t);e.setAttribute(o?"browser.performance.time_origin":"performance.timeOrigin",c),e.setAttribute(o?"browser.performance.navigation.activation_start":"performance.activationStart",Wn())}gn=void 0,xu=void 0,tn={}}function oA(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components \u269B"}catch{return}}function iA(e,t,n,r,o,i){if(oA(t)||["mark","measure"].includes(t.entryType)&&Nt(t.name,i))return;let s=qr(!1),a=Pe(s?s.requestStart:0),l=o+Math.max(n,a),c=o+n,u=c+r,f={[we]:"auto.resource.browser.metrics"};l!==c&&(f["sentry.browser.measure_happened_before_request"]=!0,f["sentry.browser.measure_start_time"]=l),sA(f,t),l<=u&&Jr(e,l,u,{name:t.name,op:t.entryType,attributes:f})}function sA(e,t){try{let n=t.detail;if(!n)return;if(typeof n=="object"){for(let[r,o]of Object.entries(n))if(o&&un(o))e[`sentry.browser.measure.detail.${r}`]=o;else if(o!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(o)}catch{}return}if(un(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function aA(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Ru(e,t,r,n)}),Ru(e,t,"secureConnection",n,"TLS/SSL"),Ru(e,t,"fetch",n,"cache"),Ru(e,t,"domainLookup",n,"DNS"),cA(e,t,n)}function Ru(e,t,n,r,o=n){let i=lA(n),s=t[i],a=t[`${n}Start`];!a||!s||Jr(e,r+Pe(a),r+Pe(s),{op:`browser.${o}`,name:t.name,attributes:{[we]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function lA(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function cA(e,t,n){let r=n+Pe(t.requestStart),o=n+Pe(t.responseEnd),i=n+Pe(t.responseStart);t.responseEnd&&(Jr(e,r,o,{op:"browser.request",name:t.name,attributes:{[we]:"auto.ui.browser.metrics"}}),Jr(e,i,o,{op:"browser.response",name:t.name,attributes:{[we]:"auto.ui.browser.metrics"}}))}function uA(e,t,n,r,o,i,s){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;let a=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(s?.includes(a))return;let l={[we]:"auto.resource.browser.metrics"},c=zn(n);c.protocol&&(l["url.scheme"]=c.protocol.split(":").pop()),c.host&&(l["server.address"]=c.host),l["url.same_origin"]=n.includes(q.location.origin),pA(t,l,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);let u={...l,...al(t)},f=i+r,p=f+o;Jr(e,f,p,{name:n.replace(q.location.origin,""),op:a,attributes:u})}function dA(e,t){let n=q.navigator;if(!n)return;let r=n.connection;r&&(r.effectiveType&&e.setAttribute(t?"network.connection.effective_type":"effectiveConnectionType",r.effectiveType),r.type&&e.setAttribute(t?"network.connection.type":"connectionType",r.type),Cu(r.rtt)&&(tn["connection.rtt"]={value:r.rtt,unit:"millisecond"},t&&e.setAttribute("network.connection.rtt",r.rtt))),Cu(n.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",n.deviceMemory):e.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),Cu(n.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",n.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function fA(e,t){gn&&t.recordLcpOnPageloadSpan&&(gn.element&&e.setAttribute("lcp.element",Ue(gn.element)),gn.id&&e.setAttribute("lcp.id",gn.id),gn.url&&e.setAttribute("lcp.url",gn.url.trim().slice(0,200)),gn.loadTime!=null&&e.setAttribute("lcp.loadTime",gn.loadTime),gn.renderTime!=null&&e.setAttribute("lcp.renderTime",gn.renderTime),e.setAttribute("lcp.size",gn.size)),xu?.sources&&t.recordClsOnPageloadSpan&&xu.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Ue(n.node)))}function pA(e,t,n){n.forEach(([r,o])=>{let i=e[r];i!=null&&(typeof i=="number"&&i<eA||typeof i=="string")&&(t[o]=i)})}function mA(e){let t=qr(!1);if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}var wm=[],ll=new Map,Is=new Map,Cm=60;function Rm(){if(Xr()&&He()){let t=hA();return()=>{t()}}return()=>{}}var ws={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function hA(){return _i(gA)}var gA=({metric:e})=>{if(e.value==null)return;let t=Pe(e.value);if(t>Cm)return;let n=e.entries.find(y=>y.duration===e.value&&ws[y.name]);if(!n)return;let{interactionId:r}=n,o=ws[n.name],i=Pe(He()+n.startTime),s=Me(),a=s?be(s):void 0,l=r!=null?ll.get(r):void 0,c=l?.span||a,u=c?ne(c).description:te().getScopeData().transactionName,f=l?.elementName||Ue(n.target),p={[we]:"auto.http.browser.inp",[qe]:`ui.interaction.${o}`,[jt]:n.duration},h=Ts({name:f,transaction:u,attributes:p,startTime:i});h&&(h.addEvent("inp",{[ar]:"millisecond",[lr]:e.value}),h.end(i+t))};function IE(e){return e!=null?ll.get(e):void 0}function xm(){let e=Object.keys(ws);jn()&&e.forEach(o=>{q.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){let i=o.target;if(!i)return;let s=Ue(i),a=Math.round(o.timeStamp);if(Is.set(a,s),Is.size>50){let l=Is.keys().next().value;l!==void 0&&Is.delete(l)}}function n(o){let i=Math.round(o.startTime),s=Is.get(i);if(!s)for(let a=-5;a<=5;a++){let l=Is.get(i+a);if(l){s=l;break}}return s||"<unknown>"}let r=({entries:o})=>{let i=Me(),s=i&&be(i);o.forEach(a=>{if(!yE(a))return;let l=a.interactionId;if(l==null||ll.has(l))return;let c=a.target?Ue(a.target):n(a);if(wm.length>10){let u=wm.shift();ll.delete(u)}wm.push(l),ll.set(l,{span:s,elementName:c})})};cr("event",r),cr("first-input",r)}function bm(e){let{name:t,op:n,origin:r,metricName:o,value:i,attributes:s,parentSpan:a,reportEvent:l,startTime:c,endTime:u}=e,f=te().getScopeData().transactionName,p={[we]:r,[qe]:n,[jt]:0,[`browser.web_vital.${o}.value`]:i,"sentry.transaction":f,"user_agent.original":q.navigator?.userAgent,...s};a&&Fa(a).attributes?.[qe]==="pageload"&&(p["sentry.pageload.span_id"]=a.spanContext().spanId),l&&(p[`browser.web_vital.${o}.report_event`]=l);let h=wt({name:t,attributes:p,startTime:c,parentSpan:a});h&&h.end(u??c)}function km(e){let t=0,n;if(!vi("largest-contentful-paint"))return;let r=Kr(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!Ti(o.value)||(t=o.value,n=i)},!0);Ei(e,(o,i,s)=>{yA(t,n,s,o),r()})}function yA(e,t,n,r){if(!Ti(e))return;Ct&&C.log(`Sending LCP span (${e})`);let o=He()||0,i=Pe(o),s=Pe(o+(t?.startTime||0)),a=t?Ue(t.element):"Largest contentful paint",l={};t?.element&&(l["browser.web_vital.lcp.element"]=Ue(t.element)),t?.id&&(l["browser.web_vital.lcp.id"]=t.id),t?.url&&(l["browser.web_vital.lcp.url"]=t.url),t?.loadTime!=null&&(l["browser.web_vital.lcp.load_time"]=t.loadTime),t?.renderTime!=null&&(l["browser.web_vital.lcp.render_time"]=t.renderTime),t?.size!=null&&(l["browser.web_vital.lcp.size"]=t.size),bm({name:a,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:e,attributes:l,parentSpan:n,reportEvent:r,startTime:i,endTime:s})}function Nm(e){let t=0,n;if(!vi("layout-shift"))return;let r=Yr(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);Ei(e,(o,i,s)=>{SA(t,n,s,o),r()})}function SA(e,t,n,r){Ct&&C.log(`Sending CLS span (${e})`);let o=t?Pe((He()||0)+t.startTime):Ae(),i=t?Ue(t.sources[0]?.node):"Layout shift",s={};t?.sources&&t.sources.forEach((a,l)=>{s[`browser.web_vital.cls.source.${l+1}`]=Ue(a.node)}),bm({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:s,parentSpan:n,reportEvent:r,startTime:o})}function Am(){if(!Xr()||!He())return;_i(({metric:n})=>{if(n.value==null||Pe(n.value)>Cm)return;let o=n.entries.find(i=>i.duration===n.value&&ws[i.name]);o&&_A(n.value,o)})}function _A(e,t){Ct&&C.log(`Sending INP span (${e})`);let n=Pe(He()+t.startTime),r=Pe(e),o=ws[t.name],i=IE(t.interactionId),s=Me(),a=s?be(s):void 0,l=i?.span||a,c=l?Fa(l).name:te().getScopeData().transactionName,u=i?.elementName||Ue(t.target);bm({name:u,op:`ui.interaction.${o}`,origin:"auto.http.browser.inp",metricName:"inp",value:e,attributes:{[jt]:t.duration,"sentry.transaction":c},startTime:n,endTime:n+r,parentSpan:l})}var vA=1e3,wE,Mm,Pm;function cl(e){Ft("dom",e),Bt("dom",EA)}function EA(){if(!q.document)return;let e=mt.bind(null,"dom"),t=CE(e,!0);q.document.addEventListener("click",t,!1),q.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{let o=q[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(st(o,"addEventListener",function(i){return function(s,a,l){if(s==="click"||s=="keypress")try{let c=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},u=c[s]=c[s]||{refCount:0};if(!u.handler){let f=CE(e);u.handler=f,i.call(this,s,f,l)}u.refCount++}catch{}return i.call(this,s,a,l)}}),st(o,"removeEventListener",function(i){return function(s,a,l){if(s==="click"||s=="keypress")try{let c=this.__sentry_instrumentation_handlers__||{},u=c[s];u&&(u.refCount--,u.refCount<=0&&(i.call(this,s,u.handler,l),u.handler=void 0,delete c[s]),Object.keys(c).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,a,l)}}))})}function TA(e){if(e.type!==Mm)return!1;try{if(!e.target||e.target._sentryId!==Pm)return!1}catch{}return!0}function IA(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function CE(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=wA(n);if(IA(n.type,r))return;Ve(n,"_sentryCaptured",!0),r&&!r._sentryId&&Ve(r,"_sentryId",at());let o=n.type==="keypress"?"input":n.type;TA(n)||(e({event:n,name:o,global:t}),Mm=n.type,Pm=r?r._sentryId:void 0),clearTimeout(wE),wE=q.setTimeout(()=>{Pm=void 0,Mm=void 0},vA)}}function wA(e){try{return e.target}catch{return null}}var bu;function Qr(e){let t="history";Ft(t,e),Bt(t,CA)}function CA(){if(q.addEventListener("popstate",()=>{let t=q.location.href,n=bu;if(bu=t,n===t)return;mt("history",{from:n,to:t})}),!sm())return;function e(t){return function(...n){let r=n.length>2?n[2]:void 0;if(r){let o=bu,i=RA(String(r));if(bu=i,o===i)return t.apply(this,n);mt("history",{from:o,to:i})}return t.apply(this,n)}}st(q.history,"pushState",e),st(q.history,"replaceState",e)}function RA(e){try{return new URL(e,q.location.origin).toString()}catch{return e}}var ku={};function Nu(e){let t=ku[e];if(t)return t;let n=q[e];if(ol(n))return ku[e]=n.bind(q);let r=q.document;if(r&&typeof r.createElement=="function")try{let o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);let i=o.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(o)}catch(o){Ct&&C.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(ku[e]=n.bind(q))}function Lm(e){ku[e]=void 0}function Ii(...e){return Nu("setTimeout")(...e)}var ur="__sentry_xhr_v3__";function ul(e){Ft("xhr",e),Bt("xhr",xA)}function xA(){if(!q.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){let o=new Error,i=Ae()*1e3,s=Ht(r[0])?r[0].toUpperCase():void 0,a=bA(r[1]);if(!s||!a)return t.apply(n,r);n[ur]={method:s,url:a,request_headers:{}},s==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);let l=()=>{let c=n[ur];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}let u={endTimestamp:Ae()*1e3,startTimestamp:i,xhr:n,virtualError:o};mt("xhr",u)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,u,f){return l(),c.apply(u,f)}}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,u,f){let[p,h]=f,y=u[ur];return y&&Ht(p)&&Ht(h)&&(y.request_headers[p.toLowerCase()]=h),c.apply(u,f)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){let o=n[ur];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);let i={startTimestamp:Ae()*1e3,xhr:n};return mt("xhr",i),t.apply(n,r)}})}function bA(e){if(Ht(e))return e;try{return e.toString()}catch{}}var kA=Symbol.for("sentry__originalRequestBody");function Au(e){return new URLSearchParams(e).toString()}function Mu(e,t=C){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[Au(e)];if(!e)return[void 0]}catch(n){return Ct&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Ct&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Pu(e=[]){if(e.length>=2&&e[1]&&typeof e[1]=="object"&&"body"in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){let n=e[0][kA];return n!==void 0?n:void 0}}function dl(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Ct&&C.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
|
|
28
|
+
`).reduce((n,r)=>{let[o,i]=r.split(": ");return i&&(n[o.toLowerCase()]=i),n},{}):{}}function Om(e){if(typeof Element>"u")return!1;try{return e instanceof Element}catch{return!1}}var NA=40;function RE(e,t=Nu("fetch")){let n=0,r=0;async function o(i){let s=i.body.length;n+=s,r++;let a={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{let l=await t(e.url,a);return{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}}catch(l){throw Lm("fetch"),l}finally{n-=s,r--}}return tu(e,o,gi(e.bufferSize||NA))}var et=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var AA=30;var MA=50;function Dm(e,t,n,r){let o={filename:e,function:t==="<anonymous>"?"?":t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}var PA=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,LA=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,OA=/\((\S*)(?::(\d+))(?::(\d+))\)/,DA=/at (.+?) ?\(data:(.+?),/,UA=e=>{let t=e.match(DA);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=PA.exec(e);if(n){let[,o,i,s]=n;return Dm(o,"?",+i,+s)}let r=LA.exec(e);if(r){if(r[2]?.indexOf("eval")===0){let a=OA.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}let[i,s]=bE(r[1]||"?",r[2]);return Dm(s,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},FA=[AA,UA],BA=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,HA=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,$A=e=>{let t=BA.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let i=HA.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],o=t[1]||"?";return[o,r]=bE(o,r),Dm(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},zA=[MA,$A];var jA=[FA,zA],xE=Sa(...jA),bE=(e,t)=>{let n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:"?",n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};var Lu=1024,WA="Breadcrumbs",GA=((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:WA,setup(n){t.console&&rm(YA(n)),t.dom&&cl(qA(n,t.dom)),t.xhr&&ul(KA(n)),t.fetch&&Co(JA(n)),t.history&&Qr(XA(n)),t.sentry&&n.on("beforeSendEvent",VA(n))}}}),kE=GA;function VA(e){return function(n){$()===e&&kn({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:sr(n)},{event:n})}}function qA(e,t){return function(r){if($()!==e)return;let o,i,s=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>Lu&&(et&&C.warn(`\`dom.maxStringLength\` cannot exceed ${Lu}, but a value of ${a} was configured. Sentry will use ${Lu} instead.`),a=Lu),typeof s=="string"&&(s=[s]);try{let c=r.event,u=QA(c)?c.target:c;o=Ue(u,{keyAttrs:s,maxStringLength:a}),i=ys(u)}catch{o="<unknown>"}if(o.length===0)return;let l={category:`ui.${r.name}`,message:o};i&&(l.data={"ui.component_name":i}),kn(l,{event:r.event,name:r.name,global:r.global})}}function YA(e){return function(n){if($()!==e)return;let r={category:"console",data:{arguments:n.args,logger:"console"},level:gs(n.level),message:ba(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${ba(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;kn(r,{input:n.args,level:n.level})}}function KA(e){return function(n){if($()!==e)return;let{startTimestamp:r,endTimestamp:o}=n,i=n.xhr[ur];if(!r||!o||!i)return;let{method:s,url:a,status_code:l,body:c}=i,u={method:s,url:a,status_code:l},f={xhr:n.xhr,input:c,startTimestamp:r,endTimestamp:o},p={category:"xhr",data:u,type:"http",level:uu(l)};e.emit("beforeOutgoingRequestBreadcrumb",p,f),kn(p,f)}}function JA(e){return function(n){if($()!==e)return;let{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){let i={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o},s={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",s,i),kn(s,i)}else{let i=n.response,s={...n.fetchData,status_code:i?.status},a={input:n.args,response:i,startTimestamp:r,endTimestamp:o},l={category:"fetch",data:s,type:"http",level:uu(s.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",l,a),kn(l,a)}}}function XA(e){return function(n){if($()!==e)return;let r=n.from,o=n.to,i=zn(ee.location.href),s=r?zn(r):void 0,a=zn(o);s?.path||(s=i),i.protocol===a.protocol&&i.host===a.host&&(o=a.relative),i.protocol===s.protocol&&i.host===s.host&&(r=s.relative),kn({category:"navigation",data:{from:r,to:o}})}}function QA(e){return!!e&&!!e.target}var ZA="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),e1="BrowserApiErrors",t1=((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:e1,setupOnce(){t.setTimeout&&st(ee,"setTimeout",NE),t.setInterval&&st(ee,"setInterval",NE),t.requestAnimationFrame&&st(ee,"requestAnimationFrame",n1),t.XMLHttpRequest&&"XMLHttpRequest"in ee&&st(XMLHttpRequest.prototype,"send",r1);let n=t.eventTarget;n&&(Array.isArray(n)?n:ZA).forEach(o=>o1(o,t))}}}),AE=t1;function NE(e){return function(...t){let n=t[0];return t[0]=yi(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Qt(e)}`}}),e.apply(this,t)}}function n1(e){return function(t){return e.apply(this,[yi(t,{mechanism:{data:{handler:Qt(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function r1(e){return function(...t){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&st(n,o,function(i){let s={mechanism:{data:{handler:Qt(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=So(i);return a&&(s.mechanism.data.handler=Qt(a)),yi(i,s)})}),e.apply(this,t)}}function o1(e,t){let r=ee[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(st(r,"addEventListener",function(o){return function(i,s,a){try{i1(s)&&(s.handleEvent=yi(s.handleEvent,{mechanism:{data:{handler:Qt(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&s1(this,i,s),o.apply(this,[i,yi(s,{mechanism:{data:{handler:Qt(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),st(r,"removeEventListener",function(o){return function(i,s,a){try{let l=s.__sentry_wrapped__;l&&o.call(this,i,l,a)}catch{}return o.call(this,i,s,a)}}))}function i1(e){return typeof e.handleEvent=="function"}function s1(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}var ME=(e={})=>{let t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof ee.document>"u"){et&&C.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}fs({ignoreDuration:!0}),hi();let n=Xe(),r=n.getUser();n.addScopeListener(o=>{let i=o.getUser();(r?.id!==i?.id||r?.ip_address!==i?.ip_address)&&(hi(),r=i)}),t==="route"&&Qr(({from:o,to:i})=>{o!==i&&(fs({ignoreDuration:!0}),hi())})}}};var a1="CultureContext",l1=(()=>({name:a1,preprocessEvent(e){let t=PE();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=PE();t&&Io(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})),LE=l1;function PE(){try{let e=ee.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var c1="GlobalHandlers",u1=((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:c1,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(d1(n),OE("onerror")),t.onunhandledrejection&&(f1(n),OE("onunhandledrejection"))}}}),DE=u1;function d1(e){Ea(t=>{let{stackParser:n,attachStacktrace:r}=UE();if($()!==e||cm())return;let{msg:o,url:i,line:s,column:a,error:l}=t,c=h1(hu(n,l||o,void 0,r,!1),i,s,a);c.level="error",ds(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function f1(e){Ta(t=>{let{stackParser:n,attachStacktrace:r}=UE();if($()!==e||cm())return;let o=p1(t),i=un(o)?m1(o):hu(n,o,void 0,r,!0);i.level="error",ds(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function p1(e){if(un(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function m1(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function h1(e,t,n,r){let o=e.exception=e.exception||{},i=o.values=o.values||[],s=i[0]=i[0]||{},a=s.stacktrace=s.stacktrace||{},l=a.frames=a.frames||[];return l.length===0&&l.push({colno:r,lineno:n,filename:g1(t)??hn(),function:"?",in_app:!0}),e}function OE(e){et&&C.log(`Global Handler attached: ${e}`)}function UE(){return $()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function g1(e){if(!(!Ht(e)||e.length===0))return e.startsWith("data:")?`<${Wt(e,!1)}>`:e}var FE=()=>({name:"HttpContext",preprocessEvent(e){if(!ee.navigator&&!ee.location&&!ee.document)return;let t=Ss(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){if(!ee.navigator&&!ee.location&&!ee.document)return;let t=Ss();Io(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers["User-Agent"],"http.request.header.referer":t.headers.Referer})}});var y1="cause",S1=5,_1="LinkedErrors",v1=((e={})=>{let t=e.limit||S1,n=e.key||y1;return{name:_1,preprocessEvent(r,o,i){let s=i.getOptions();nm(pu,s.stackParser,n,t,r,o)}}}),BE=v1;var E1=/^HTML(\w*)Element$/;function fl(e){if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Om(e)){let t=T1(e);if(E1.test(t))return`[HTMLElement: ${Ue(e)}]`}}function T1(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function HE(){return I1()?(et&&kt(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function I1(){if(typeof ee.window>"u")return!1;let e=ee;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let n=hn();return!(ee===ee.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function $E(e){return[su(),ou(),om(),AE(),kE(),DE(),BE(),lu(),FE(),LE(),ME()]}function Um(e={}){let t=!e.skipBrowserExtensionCheck&&HE(),n=e.defaultIntegrations==null?$E():e.defaultIntegrations,r={...e,enabled:t?!1:e.enabled,stackParser:kc(e.stackParser||xE),integrations:$p({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||RE};return Zi(fl),Kp(gu,r)}function Ou(e={}){let t=ee.document,n=t?.head||t?.body;if(!n){et&&C.error("[showReportDialog] Global document not defined");return}let r=te(),i=$()?.getDsn();if(!i){et&&C.error("[showReportDialog] DSN not configured");return}let s={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||qa()},a=ee.document.createElement("script");a.async=!0,a.crossOrigin="anonymous",a.src=Bp(i,s);let{onLoad:l,onClose:c}=s;if(l&&(a.onload=l),c){let u=f=>{if(f.data==="__sentry_reportdialog_closed__")try{c()}finally{ee.removeEventListener("message",u)}};ee.addEventListener("message",u)}n.appendChild(a)}var je=G,ph="sentryReplaySession",w1="replay_event",mh="Unable to send Replay",C1=3e5,R1=9e5,x1=5e3,b1=5500,k1=6e4,N1=5e3,A1=3,zE=15e4,Du=5e3,M1=3e3,P1=300,hh=2e7,L1=4999,O1=5e4,jE=36e5,D1=Object.defineProperty,U1=(e,t,n)=>t in e?D1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WE=(e,t,n)=>U1(e,typeof t!="symbol"?t+"":t,n),gt=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(gt||{});function F1(e){return e.nodeType===e.ELEMENT_NODE}function hl(e){return e?.host?.shadowRoot===e}function gl(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function B1(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function H1(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let n=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function $u(e){try{let t=e.rules||e.cssRules;return t?B1(Array.from(t,mT).join("")):null}catch{return null}}function $1(e){let t="";for(let n=0;n<e.style.length;n++){let r=e.style,o=r[n],i=r.getPropertyPriority(o);t+=`${o}:${r.getPropertyValue(o)}${i?" !important":""};`}return`${e.selectorText} { ${t} }`}function mT(e){let t;if(j1(e))try{t=$u(e.styleSheet)||H1(e)}catch{}else if(W1(e)){let n=e.cssText,r=e.selectorText.includes(":"),o=typeof e.style.all=="string"&&e.style.all;if(o&&(n=$1(e)),r&&(n=z1(n)),r||o)return n}return t||e.cssText}function z1(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function j1(e){return"styleSheet"in e}function W1(e){return"selectorText"in e}var zu=class{constructor(){WE(this,"idNodeMap",new Map),WE(this,"nodeMetaMap",new WeakMap)}getId(t){return t?this.getMeta(t)?.id??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){let r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){let r=this.getNode(t);if(r){let o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function G1(){return new zu}function nd({maskInputOptions:e,tagName:t,type:n}){return t==="OPTION"&&(t="SELECT"),!!(e[t.toLowerCase()]||n&&e[n]||n==="password"||t==="INPUT"&&!n&&e.text)}function Sl({isMasked:e,element:t,value:n,maskInputFn:r}){let o=n||"";return e?(r&&(o=r(o,t)),"*".repeat(o.length)):o}function Ms(e){return e.toLowerCase()}function jm(e){return e.toUpperCase()}var GE="__rrweb_original__";function V1(e){let t=e.getContext("2d");if(!t)return!0;let n=50;for(let r=0;r<e.width;r+=n)for(let o=0;o<e.height;o+=n){let i=t.getImageData,s=GE in i?i[GE]:i;if(new Uint32Array(s.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer).some(l=>l!==0))return!1}return!0}function gh(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ms(t):null}function ju(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function hT(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}let r=/\.([0-9a-z]+)(?:$)/i;return n.pathname.match(r)?.[1]??null}var VE={};function gT(e){let t=VE[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement=="function")try{let o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);let i=o.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(o)}catch{}return VE[e]=r.bind(window)}function Wm(...e){return gT("setTimeout")(...e)}function yT(...e){return gT("clearTimeout")(...e)}function ST(e){try{return e.contentDocument}catch{}}function q1(e){try{return e.contentWindow}catch{}}var Y1=1,K1=new RegExp("[^a-z0-9-_:]"),_l=-2;function yh(){return Y1++}function J1(e){if(e instanceof HTMLFormElement)return"form";let t=Ms(e.tagName);return K1.test(t)?"div":t}function X1(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var Cs,qE,Q1=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Z1=/^(?:[a-z+]+:)?\/\//i,eM=/^www\..*/i,tM=/^(data:)([^,]*),(.*)/i;function nM(e,t){if(!e||t.size===0)return e;try{let n=e.split(";"),r=[];for(let o of n){if(o=o.trim(),!o)continue;let i=o.indexOf(":");if(i===-1){r.push(o);continue}let s=o.slice(0,i).trim();t.has(s)||r.push(o)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function Wu(e,t){return(e||"").replace(Q1,(n,r,o,i,s,a)=>{let l=o||s||a,c=r||i||"";if(!l)return n;if(Z1.test(l)||eM.test(l))return`url(${c}${l}${c})`;if(tM.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${X1(t)+l}${c})`;let u=t.split("/"),f=l.split("/");u.pop();for(let p of f)p!=="."&&(p===".."?u.pop():u.push(p));return`url(${c}${u.join("/")}${c})`})}var rM=/^[^ \t\n\r\u000c]+/,oM=/^[, \t\n\r\u000c]+/;function iM(e,t){if(t.trim()==="")return t;let n=0;function r(i){let s,a=i.exec(t.substring(n));return a?(s=a[0],n+=s.length,s):""}let o=[];for(;r(oM),!(n>=t.length);){let i=r(rM);if(i.slice(-1)===",")i=bs(e,i.substring(0,i.length-1)),o.push(i);else{let s="";i=bs(e,i);let a=!1;for(;;){let l=t.charAt(n);if(l===""){o.push((i+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){n+=1,o.push((i+s).trim());break}else l==="("&&(a=!0);s+=l,n+=1}}}return o.join(", ")}var YE=new WeakMap;function bs(e,t){return!t||t.trim()===""?t:rd(e,t)}function sM(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function rd(e,t){let n=YE.get(e);if(n||(n=e.createElement("a"),YE.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function _T(e,t,n,r,o,i,s){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return bs(e,r);if(n==="xlink:href"&&r[0]!=="#")return bs(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return bs(e,r);if(n==="srcset")return iM(e,r);if(n==="style"){let a=Wu(r,rd(e));return s&&s.size>0&&(a=nM(a,s)),a}else if(t==="object"&&n==="data")return bs(e,r);return typeof i=="function"?i(n,r,o):r}function vT(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function aM(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let o=e.classList.length;o--;){let i=e.classList[o];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function lM(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function wi(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:wi(e.parentNode,t,n,r+1)}function ks(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(lM(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function Ps(e,t,n,r,o,i){try{let s=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(s===null)return!1;if(s.tagName==="INPUT"){let c=s.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(c))return!0}let a=-1,l=-1;if(i){if(l=wi(s,ks(r,o)),l<0)return!0;a=wi(s,ks(t,n),l>=0?l:1/0)}else{if(a=wi(s,ks(t,n)),a<0)return!1;l=wi(s,ks(r,o),a>=0?a:1/0)}return a>=0?l>=0?a<=l:!0:l>=0?!1:!!i}catch{}return!!i}function cM(e,t,n){let r=q1(e);if(!r)return;let o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){let a=Wm(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{yT(a),o=!0,t()});return}let s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return Wm(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function uM(e,t,n){let r=!1,o;try{o=e.sheet}catch{o=null}if(o)return;let i=Wm(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{yT(i),r=!0,t()})}function dM(e,t){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskAttributeFn:l,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:y={},maskTextFn:_,maskInputFn:T,dataURLOptions:g={},inlineImages:S,recordCanvas:E,keepIframeSrcFn:R,newlyAddedElement:M=!1,ignoreCSSAttributes:A}=t,I=fM(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:gt.Document,childNodes:[],compatMode:e.compatMode}:{type:gt.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:gt.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return mM(e,{doc:n,blockClass:o,blockSelector:i,unblockSelector:s,inlineStylesheet:h,maskAttributeFn:l,maskInputOptions:y,maskInputFn:T,dataURLOptions:g,inlineImages:S,recordCanvas:E,keepIframeSrcFn:R,newlyAddedElement:M,rootId:I,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:p,ignoreCSSAttributes:A});case e.TEXT_NODE:return pM(e,{doc:n,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:p,maskTextFn:_,maskInputOptions:y,maskInputFn:T,rootId:I});case e.CDATA_SECTION_NODE:return{type:gt.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:gt.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function fM(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function pM(e,t){let{maskAllText:n,maskTextClass:r,unmaskTextClass:o,maskTextSelector:i,unmaskTextSelector:s,maskTextFn:a,maskInputOptions:l,maskInputFn:c,rootId:u}=t,f=e.parentNode&&e.parentNode.tagName,p=e.textContent,h=f==="STYLE"?!0:void 0,y=f==="SCRIPT"?!0:void 0,_=f==="TEXTAREA"?!0:void 0;if(h&&p){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(p=$u(e.parentNode.sheet))}catch(g){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${g}`,e)}p=Wu(p,rd(t.doc))}y&&(p="SCRIPT_PLACEHOLDER");let T=Ps(e,r,i,o,s,n);if(!h&&!y&&!_&&p&&T&&(p=a?a(p,e.parentElement):p.replace(/[\S]/g,"*")),_&&p&&(l.textarea||T)&&(p=c?c(p,e.parentNode):p.replace(/[\S]/g,"*")),f==="OPTION"&&p){let g=nd({type:null,tagName:f,maskInputOptions:l});p=Sl({isMasked:Ps(e,r,i,o,s,g),element:e,value:p,maskInputFn:c})}return{type:gt.Text,textContent:p||"",isStyle:h,rootId:u}}function mM(e,t){let{doc:n,blockClass:r,blockSelector:o,unblockSelector:i,inlineStylesheet:s,maskInputOptions:a={},maskAttributeFn:l,maskInputFn:c,dataURLOptions:u={},inlineImages:f,recordCanvas:p,keepIframeSrcFn:h,newlyAddedElement:y=!1,rootId:_,maskTextClass:T,unmaskTextClass:g,maskTextSelector:S,unmaskTextSelector:E,ignoreCSSAttributes:R}=t,M=aM(e,r,o,i),A=J1(e),I={},N=e.attributes.length;for(let x=0;x<N;x++){let H=e.attributes[x];H.name&&!vT(A,H.name,H.value)&&(I[H.name]=_T(n,A,Ms(H.name),H.value,e,l,R))}if(A==="link"&&s){let x=Array.from(n.styleSheets).find(j=>j.href===e.href),H=null;x&&(H=$u(x)),H&&(I.rel=null,I.href=null,I.crossorigin=null,I._cssText=Wu(H,x.href))}if(A==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){let x=$u(e.sheet);x&&(I._cssText=Wu(x,rd(n)))}if(A==="input"||A==="textarea"||A==="select"||A==="option"){let x=e,H=gh(x),j=ju(x,jm(A),H),ge=x.checked;if(H!=="submit"&&H!=="button"&&j){let X=Ps(x,T,S,g,E,nd({type:H,tagName:jm(A),maskInputOptions:a}));I.value=Sl({isMasked:X,element:x,value:j,maskInputFn:c})}ge&&(I.checked=ge)}if(A==="option"&&(e.selected&&!a.select?I.selected=!0:delete I.selected),A==="canvas"&&p){if(e.__context==="2d")V1(e)||(I.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){let x=e.toDataURL(u.type,u.quality),H=n.createElement("canvas");H.width=e.width,H.height=e.height;let j=H.toDataURL(u.type,u.quality);x!==j&&(I.rr_dataURL=x)}}if(A==="img"&&f){Cs||(Cs=n.createElement("canvas"),qE=Cs.getContext("2d"));let x=e,H=x.currentSrc||x.getAttribute("src")||"<unknown-src>",j=x.crossOrigin,ge=()=>{x.removeEventListener("load",ge);try{Cs.width=x.naturalWidth,Cs.height=x.naturalHeight,qE.drawImage(x,0,0),I.rr_dataURL=Cs.toDataURL(u.type,u.quality)}catch(X){if(x.crossOrigin!=="anonymous"){x.crossOrigin="anonymous",x.complete&&x.naturalWidth!==0?ge():x.addEventListener("load",ge);return}else console.warn(`Cannot inline img src=${H}! Error: ${X}`)}x.crossOrigin==="anonymous"&&(j?I.crossOrigin=j:x.removeAttribute("crossorigin"))};x.complete&&x.naturalWidth!==0?ge():x.addEventListener("load",ge)}if((A==="audio"||A==="video")&&(I.rr_mediaState=e.paused?"paused":"played",I.rr_mediaCurrentTime=e.currentTime),y||(e.scrollLeft&&(I.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(I.rr_scrollTop=e.scrollTop)),M){let{width:x,height:H}=e.getBoundingClientRect();I={class:I.class,rr_width:`${x}px`,rr_height:`${H}px`}}A==="iframe"&&!h(I.src)&&(!M&&!ST(e)&&(I.rr_src=I.src),delete I.src);let U;try{customElements.get(A)&&(U=!0)}catch{}return{type:gt.Element,tagName:A,attributes:I,childNodes:[],isSVG:sM(e)||void 0,needBlock:M,rootId:_,isCustom:U}}function ze(e){return e==null?"":e.toLowerCase()}function hM(e,t){if(t.comment&&e.type===gt.Comment)return!0;if(e.type===gt.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&hT(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ze(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ze(e.attributes.name)==="application-name"||ze(e.attributes.rel)==="icon"||ze(e.attributes.rel)==="apple-touch-icon"||ze(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ze(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ze(e.attributes.property).match(/^(og|twitter|fb):/)||ze(e.attributes.name).match(/^(og|twitter):/)||ze(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ze(e.attributes.name)==="robots"||ze(e.attributes.name)==="googlebot"||ze(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ze(e.attributes.name)==="author"||ze(e.attributes.name)==="generator"||ze(e.attributes.name)==="framework"||ze(e.attributes.name)==="publisher"||ze(e.attributes.name)==="progid"||ze(e.attributes.property).match(/^article:/)||ze(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ze(e.attributes.name)==="google-site-verification"||ze(e.attributes.name)==="yandex-verification"||ze(e.attributes.name)==="csrf-token"||ze(e.attributes.name)==="p:domain_verify"||ze(e.attributes.name)==="verify-v1"||ze(e.attributes.name)==="verification"||ze(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ns(e,t){let{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:f,skipChild:p=!1,inlineStylesheet:h=!0,maskInputOptions:y={},maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S,dataURLOptions:E={},inlineImages:R=!1,recordCanvas:M=!1,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N=5e3,onBlockedImageLoad:U,onStylesheetLoad:x,stylesheetLoadTimeout:H=5e3,keepIframeSrcFn:j=()=>!1,newlyAddedElement:ge=!1,ignoreCSSAttributes:X}=t,{preserveWhiteSpace:Ze=!0}=t,fe=dM(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:a,unblockSelector:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:f,inlineStylesheet:h,maskInputOptions:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,dataURLOptions:E,inlineImages:R,recordCanvas:M,keepIframeSrcFn:j,newlyAddedElement:ge,ignoreCSSAttributes:X});if(!fe)return console.warn(e,"not serialized"),null;let de;r.hasNode(e)?de=r.getId(e):hM(fe,S)||!Ze&&fe.type===gt.Text&&!fe.isStyle&&!fe.textContent.trim().length?de=_l:de=yh();let D=Object.assign(fe,{id:de});if(r.add(e,D),de===_l)return null;A&&A(e);let ye=!p;if(D.type===gt.Element){ye=ye&&!D.needBlock;let Q=e.shadowRoot;Q&&gl(Q)&&(D.isShadowHost=!0)}if((D.type===gt.Document||D.type===gt.Element)&&ye){S.headWhitespace&&D.type===gt.Element&&D.tagName==="head"&&(Ze=!1);let Q={doc:n,mirror:r,blockClass:o,blockSelector:i,maskAllText:a,unblockSelector:s,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:f,skipChild:p,inlineStylesheet:h,maskInputOptions:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S,dataURLOptions:E,inlineImages:R,recordCanvas:M,preserveWhiteSpace:Ze,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onBlockedImageLoad:U,onStylesheetLoad:x,stylesheetLoadTimeout:H,keepIframeSrcFn:j,ignoreCSSAttributes:X},ae=e.childNodes?Array.from(e.childNodes):[];for(let Re of ae){let Te=Ns(Re,Q);Te&&D.childNodes.push(Te)}if(F1(e)&&e.shadowRoot)for(let Re of Array.from(e.shadowRoot.childNodes)){let Te=Ns(Re,Q);Te&&(gl(e.shadowRoot)&&(Te.isShadow=!0),D.childNodes.push(Te))}}if(e.parentNode&&hl(e.parentNode)&&gl(e.parentNode)&&(D.isShadow=!0),D.type===gt.Element&&D.tagName==="iframe"&&!D.needBlock&&cM(e,()=>{let Q=ST(e);if(Q&&I){let ae=Ns(Q,{doc:Q,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S,dataURLOptions:E,inlineImages:R,recordCanvas:M,preserveWhiteSpace:Ze,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onStylesheetLoad:x,stylesheetLoadTimeout:H,keepIframeSrcFn:j,ignoreCSSAttributes:X});ae&&I(e,ae)}},N),D.type===gt.Element&&D.tagName==="img"&&!e.complete&&D.needBlock){let Q=e,ae=()=>{if(Q.isConnected&&!Q.complete&&U)try{let Re=Q.getBoundingClientRect();Re.width>0&&Re.height>0&&U(Q,D,Re)}catch{}Q.removeEventListener("load",ae)};Q.isConnected&&Q.addEventListener("load",ae)}return D.type===gt.Element&&D.tagName==="link"&&typeof D.attributes.rel=="string"&&(D.attributes.rel==="stylesheet"||D.attributes.rel==="preload"&&typeof D.attributes.href=="string"&&hT(D.attributes.href)==="css")&&uM(e,()=>{if(x){let Q=Ns(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S,dataURLOptions:E,inlineImages:R,recordCanvas:M,preserveWhiteSpace:Ze,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onStylesheetLoad:x,stylesheetLoadTimeout:H,keepIframeSrcFn:j,ignoreCSSAttributes:X});Q&&x(e,Q)}},H),D.type===gt.Element&&delete D.needBlock,D}function gM(e,t){let{mirror:n=new zu,blockClass:r="rr-block",blockSelector:o=null,unblockSelector:i=null,maskAllText:s=!1,maskTextClass:a="rr-mask",unmaskTextClass:l=null,maskTextSelector:c=null,unmaskTextSelector:u=null,inlineStylesheet:f=!0,inlineImages:p=!1,recordCanvas:h=!1,maskAllInputs:y=!1,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOM:S=!1,dataURLOptions:E,preserveWhiteSpace:R,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:I,onBlockedImageLoad:N,onStylesheetLoad:U,stylesheetLoadTimeout:x,keepIframeSrcFn:H=()=>!1,ignoreCSSAttributes:j=new Set([])}=t||{};return Ns(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,maskAllText:s,maskTextClass:a,unmaskTextClass:l,maskTextSelector:c,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:y===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:y===!1?{}:y,maskAttributeFn:_,maskTextFn:T,maskInputFn:g,slimDOMOptions:S===!0||S==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:S==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:S===!1?{}:S,dataURLOptions:E,inlineImages:p,recordCanvas:h,preserveWhiteSpace:R,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:I,onBlockedImageLoad:N,onStylesheetLoad:U,stylesheetLoadTimeout:x,keepIframeSrcFn:H,newlyAddedElement:!1,ignoreCSSAttributes:j})}function rn(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var Rs=`Please stop import mirror directly. Instead of that,\r
|
|
29
29
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
30
|
-
or you can use record.mirror to access the mirror instance during recording.`,qE={map:{},getId(){return console.error(ws),-1},getNode(){return console.error(ws),null},removeNodeFromMap(){console.error(ws)},has(){return console.error(ws),!1},reset(){console.error(ws)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(qE=new Proxy(qE,{get(e,t,n){return t==="map"&&console.error(ws),Reflect.get(e,t,n)}}));function Sl(e,t,n={}){let r=null,o=0;return function(...i){let s=Date.now();!o&&n.leading===!1&&(o=s);let a=t-(s-o),l=this;a<=0||a>t?(r&&(vM(r),r=null),o=s,e.apply(l,i)):!r&&n.trailing!==!1&&(r=nd(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(l,i)},a))}}function _T(e,t,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(s){nd(()=>{n.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>_T(e,t,i||{},!0)}function gh(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}var ju=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ju=()=>new Date().getTime());function vT(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0}}function ET(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function TT(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function IT(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function bn(e,t,n,r,o){if(!e)return!1;let i=IT(e);if(!i)return!1;let s=xs(t,n);if(!o){let c=r&&i.matches(r);return s(i)&&!c}let a=Ii(i,s),l=-1;return a<0?!1:(r&&(l=Ii(i,xs(null,r))),a>-1&&l<0?!0:a<l)}function hM(e,t){return t.getId(e)!==-1}function Dm(e,t){return t.getId(e)===yl}function wT(e,t){if(pl(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?wT(e.parentNode,t):!0:!0}function jm(e){return!!e.changedTouches}function gM(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function CT(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function RT(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Wm(e){return!!e?.shadowRoot}var Gm=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function xT(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function yM(e){let t=e,n;for(;n=xT(t);)t=n;return t}function SM(e){let t=e.ownerDocument;if(!t)return!1;let n=yM(e);return t.contains(n)}function bT(e){let t=e.ownerDocument;return t?t.contains(e)||SM(e):!1}var YE={};function yh(e){let t=YE[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement=="function")try{let o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);let i=o.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(o)}catch{}return YE[e]=r.bind(window)}function _M(...e){return yh("requestAnimationFrame")(...e)}function nd(...e){return yh("setTimeout")(...e)}function vM(...e){return yh("clearTimeout")(...e)}var ge=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(ge||{}),se=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(se||{}),en=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(en||{}),Xr=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Xr||{}),Cs=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Cs||{}),hl;function EM(e){hl=e}function TM(){hl=void 0}var Re=e=>hl?((...n)=>{try{return e(...n)}catch(r){if(hl&&hl(r)===!0)return()=>{};throw r}}):e,KE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",IM=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(dl=0;dl<KE.length;dl++)IM[KE.charCodeAt(dl)]=dl;var dl,Wu=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function Sh(e){try{return e.contentDocument}catch{}}function _l(e){try{return e.contentWindow}catch{}}var Vm=class{constructor(t){this.doc=t,this.unattachedDoc=null}parse(t){return this.parseWithConstructableStylesheet(t)||this.parseWithDetachedElement(t)}parseWithConstructableStylesheet(t){if(typeof CSSStyleSheet>"u"||typeof CSSStyleSheet.prototype.replaceSync!="function")return null;try{let n=new CSSStyleSheet;n.replaceSync(`x { ${t} }`);let r=n.cssRules[0];return!r||r.type!==CSSRule.STYLE_RULE?null:r.style}catch{return null}}parseWithDetachedElement(t){let n=this.getUnattachedDoc().createElement("span");return n.setAttribute("style",t),n.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}return this.unattachedDoc}};function JE(e){return"__ln"in e}var qm=class{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){let n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&JE(t.previousSibling)){let r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&JE(t.nextSibling)&&t.nextSibling.__ln.previous){let r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){let n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},XE=(e,t)=>`${e}@${t}`,Ym=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let t=[],n=new Set,r=new qm,o=l=>{let c=l,u=yl;for(;u===yl;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},i=l=>{if(!l.parentNode||!bT(l))return;let c=pl(l.parentNode)?this.mirror.getId(xT(l)):this.mirror.getId(l.parentNode),u=o(l);if(c===-1||u===-1)return r.addNode(l);let d=bs(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:p=>{CT(p,this.mirror)&&!bn(p,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(p),RT(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Wm(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,this.doc)},onIframeLoad:(p,h)=>{if(bn(p,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(p,h);let y=_l(p);y&&this.canvasManager.addWindow(y),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,h)=>{this.stylesheetManager.attachLinkElement(p,h)},onBlockedImageLoad:(p,h,{width:y,height:_})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:h.id,attributes:{style:{width:`${y}px`,height:`${_}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});d&&(t.push({parentId:c,nextId:u,node:d}),n.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)QE(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||i(l);for(let l of this.addedSet)!ZE(this.droppedSet,l)&&!QE(this.removes,l,this.mirror)||ZE(this.movedSet,l)?i(l):this.droppedSet.add(l);let s=null;for(;r.length;){let l=null;if(s){let c=this.mirror.getId(s.value.parentNode),u=o(s.value);c!==-1&&u!==-1&&(l=s)}if(!l){let c=r.tail;for(;c;){let u=c;if(c=c.previous,u){let d=this.mirror.getId(u.value.parentNode);if(o(u.value)===-1)continue;if(d!==-1){l=u;break}else{let h=u.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let y=h.parentNode.host;if(this.mirror.getId(y)!==-1){l=u;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}s=l.previous,r.removeNode(l.value),i(l.value)}let a={texts:this.texts.map(l=>({id:this.mirror.getId(l.node),value:l.value})).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{let{attributes:c}=l;if(typeof c.style=="string"){let u=JSON.stringify(l.styleDiff),d=JSON.stringify(l._unchangedStyles);u.length<c.style.length&&(u+d).split("var(").length===c.style.split("var(").length&&(c.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:c}}).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!Dm(t.target,this.mirror))switch(t.type){case"characterData":{let n=t.target.textContent;!bn(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:As(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,IT(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{let n=t.target,r=t.attributeName,o=t.target.getAttribute(r);if(r==="value"){let s=mh(n),a=n.tagName;o=$u(n,a,s);let l=ed({maskInputOptions:this.maskInputOptions,tagName:a,type:s}),c=As(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,l);o=gl({isMasked:c,element:n,value:o,maskInputFn:this.maskInputFn})}if(bn(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||o===t.oldValue)return;let i=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(o))if(!Sh(n))r="rr_src";else return;if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!ST(n.tagName,r)&&(i.attributes[r]=yT(this.doc,Ns(n.tagName),Ns(r),o,n,this.maskAttributeFn),r==="style")){let s=t.oldValue?this.styleDeclarationParser.parse(t.oldValue):null;for(let a of Array.from(n.style)){let l=n.style.getPropertyValue(a),c=n.style.getPropertyPriority(a);l!==(s?.getPropertyValue(a)||"")||c!==(s?.getPropertyPriority(a)||"")?c===""?i.styleDiff[a]=l:i.styleDiff[a]=[l,c]:i._unchangedStyles[a]=[l,c]}if(s)for(let a of Array.from(s))n.style.getPropertyValue(a)===""&&(i.styleDiff[a]=!1)}break}case"childList":{if(bn(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{let r=this.mirror.getId(n),o=pl(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);bn(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Dm(n,this.mirror)||!hM(n,this.mirror)||(this.addedSet.has(n)?(Km(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||wT(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[XE(r,o)]?Km(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:pl(t.target)&&ml(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Dm(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[XE(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);bn(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),Wm(t)&&t.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,t)}))}}}init(t){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","ignoreCSSAttributes"].forEach(n=>{this[n]=t[n]}),this.styleDeclarationParser=new Vm(this.doc)}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function Km(e,t){e.delete(t),t.childNodes?.forEach(n=>Km(e,n))}function QE(e,t,n){return e.length===0?!1:wM(e,t,n)}function wM(e,t,n){let r=t.parentNode;for(;r;){let o=n.getId(r);if(e.some(i=>i.id===o))return!0;r=r.parentNode}return!1}function ZE(e,t){return e.size===0?!1:kT(e,t)}function kT(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:kT(e,n):!1}var ks=[];function wl(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function NT(e,t){let n=new Ym;ks.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver,o=window?.Zone?.__symbol__?.("MutationObserver");o&&window[o]&&(r=window[o]);let i=new r(Re(s=>{e.onMutation&&e.onMutation(s)===!1||n.processMutations.bind(n)(s)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function CM({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],a,l=Sl(Re(d=>{let p=Date.now()-a;e(s.map(h=>(h.timeOffset-=p,h)),d),s=[],a=null}),i),c=Re(Sl(Re(d=>{let p=wl(d),{clientX:h,clientY:y}=jm(d)?d.changedTouches[0]:d;a||(a=ju()),s.push({x:h,y,id:r.getId(p),timeOffset:ju()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?se.Drag:d instanceof MouseEvent?se.MouseMove:se.TouchMove)}),o,{trailing:!1})),u=[tn("mousemove",c,n),tn("touchmove",c,n),tn("drag",c,n)];return Re(()=>{u.forEach(d=>d())})}function RM({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:s}){if(s.mouseInteraction===!1)return()=>{};let a=s.mouseInteraction===!0||s.mouseInteraction===void 0?{}:s.mouseInteraction,l=[],c=null,u=d=>p=>{let h=wl(p);if(bn(h,r,o,i,!0))return;let y=null,_=d;if("pointerType"in p){switch(p.pointerType){case"mouse":y=Xr.Mouse;break;case"touch":y=Xr.Touch;break;case"pen":y=Xr.Pen;break}y===Xr.Touch?en[d]===en.MouseDown?_="TouchStart":en[d]===en.MouseUp&&(_="TouchEnd"):Xr.Pen}else jm(p)&&(y=Xr.Touch);y!==null?(c=y,(_.startsWith("Touch")&&y===Xr.Touch||_.startsWith("Mouse")&&y===Xr.Mouse)&&(y=null)):en[d]===en.Click&&(y=c,c=null);let T=jm(p)?p.changedTouches[0]:p;if(!T)return;let g=n.getId(h),{clientX:S,clientY:E}=T;Re(e)({type:en[_],id:g,x:S,y:E,...y!==null&&{pointerType:y}})};return Object.keys(en).filter(d=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&a[d]!==!1).forEach(d=>{let p=Ns(d),h=u(d);if(window.PointerEvent)switch(en[d]){case en.MouseDown:case en.MouseUp:p=p.replace("mouse","pointer");break;case en.TouchStart:case en.TouchEnd:return}l.push(tn(p,h,t))}),Re(()=>{l.forEach(d=>d())})}function AT({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:s}){let a=Re(Sl(Re(l=>{let c=wl(l);if(!c||bn(c,r,o,i,!0))return;let u=n.getId(c);if(c===t&&t.defaultView){let d=vT(t.defaultView);e({id:u,x:d.left,y:d.top})}else e({id:u,x:c.scrollLeft,y:c.scrollTop})}),s.scroll||100));return tn("scroll",a,t)}function xM({viewportResizeCb:e},{win:t}){let n=-1,r=-1,o=Re(Sl(Re(()=>{let i=ET(),s=TT();(n!==i||r!==s)&&(e({width:Number(s),height:Number(i)}),n=i,r=s)}),200));return tn("resize",o,t)}var bM=["INPUT","TEXTAREA","SELECT"],eT=new WeakMap;function kM({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:c,sampling:u,userTriggeredOnInput:d,maskTextClass:p,unmaskTextClass:h,maskTextSelector:y,unmaskTextSelector:_}){function T(I){let N=wl(I),U=I.isTrusted,x=N&&$m(N.tagName);if(x==="OPTION"&&(N=N.parentElement),!N||!x||bM.indexOf(x)<0||bn(N,r,o,i,!0))return;let $=N;if($.classList.contains(s)||a&&$.matches(a))return;let W=mh(N),ye=$u($,x,W),K=!1,et=ed({maskInputOptions:l,tagName:x,type:W}),pe=As(N,p,y,h,_,et);(W==="radio"||W==="checkbox")&&(K=N.checked),ye=gl({isMasked:pe,element:N,value:ye,maskInputFn:c}),g(N,d?{text:ye,isChecked:K,userTriggered:U}:{text:ye,isChecked:K});let fe=N.name;W==="radio"&&fe&&K&&t.querySelectorAll(`input[type="radio"][name="${fe}"]`).forEach(D=>{if(D!==N){let Se=gl({isMasked:pe,element:D,value:$u(D,x,W),maskInputFn:c});g(D,d?{text:Se,isChecked:!K,userTriggered:!1}:{text:Se,isChecked:!K})}})}function g(I,N){let U=eT.get(I);if(!U||U.text!==N.text||U.isChecked!==N.isChecked){eT.set(I,N);let x=n.getId(I);Re(e)({...N,id:x})}}let E=(u.input==="last"?["change"]:["input","change"]).map(I=>tn(I,Re(T),t)),R=t.defaultView;if(!R)return()=>{E.forEach(I=>I())};let M=R.Object.getOwnPropertyDescriptor(R.HTMLInputElement.prototype,"value"),A=[[R.HTMLInputElement.prototype,"value"],[R.HTMLInputElement.prototype,"checked"],[R.HTMLSelectElement.prototype,"value"],[R.HTMLTextAreaElement.prototype,"value"],[R.HTMLSelectElement.prototype,"selectedIndex"],[R.HTMLOptionElement.prototype,"selected"]];return M&&M.set&&E.push(...A.map(I=>_T(I[0],I[1],{set(){Re(T)({target:this,isTrusted:!1})}},!1,R))),Re(()=>{E.forEach(I=>I())})}function Gu(e){let t=[];function n(r,o){if(Ou("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Ou("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Ou("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Ou("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let s=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(s)}else if(r.parentStyleSheet){let s=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(s)}return o}return n(e,t)}function bo(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function NM({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Re((u,d,p)=>{let[h,y]=p,{id:_,styleId:T}=bo(d,t,n.styleMirror);return(_&&_!==-1||T&&T!==-1)&&e({id:_,styleId:T,adds:[{rule:h,index:y}]}),u.apply(d,p)})});let i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Re((u,d,p)=>{let[h]=p,{id:y,styleId:_}=bo(d,t,n.styleMirror);return(y&&y!==-1||_&&_!==-1)&&e({id:y,styleId:_,removes:[{index:h}]}),u.apply(d,p)})});let s;r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Re((u,d,p)=>{let[h]=p,{id:y,styleId:_}=bo(d,t,n.styleMirror);return(y&&y!==-1||_&&_!==-1)&&e({id:y,styleId:_,replace:h}),u.apply(d,p)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Re((u,d,p)=>{let[h]=p,{id:y,styleId:_}=bo(d,t,n.styleMirror);return(y&&y!==-1||_&&_!==-1)&&e({id:y,styleId:_,replaceSync:h}),u.apply(d,p)})}));let l={};Du("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Du("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Du("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Du("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));let c={};return Object.entries(l).forEach(([u,d])=>{c[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(c[u].insertRule,{apply:Re((p,h,y)=>{let[_,T]=y,{id:g,styleId:S}=bo(h.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,adds:[{rule:_,index:[...Gu(h),T||0]}]}),p.apply(h,y)})}),d.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:Re((p,h,y)=>{let[_]=y,{id:T,styleId:g}=bo(h.parentStyleSheet,t,n.styleMirror);return(T&&T!==-1||g&&g!==-1)&&e({id:T,styleId:g,removes:[{index:[...Gu(h),_]}]}),p.apply(h,y)})})}),Re(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([u,d])=>{d.prototype.insertRule=c[u].insertRule,d.prototype.deleteRule=c[u].deleteRule})})}function MT({mirror:e,stylesheetManager:t},n){let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);let o=n.nodeName==="#document"?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,i=o?.prototype?Object.getOwnPropertyDescriptor(o?.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!o||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return i.get?.call(this)},set(s){let a=i.set?.call(this,s);if(r!==null&&r!==-1)try{t.adoptStyleSheets(s,r)}catch{}return a}}),Re(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function AM({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Re((a,l,c)=>{let[u,d,p]=c;if(n.has(u))return i.apply(l,[u,d,p]);let{id:h,styleId:y}=bo(l.parentRule?.parentStyleSheet,t,r.styleMirror);return(h&&h!==-1||y&&y!==-1)&&e({id:h,styleId:y,set:{property:u,value:d,priority:p},index:Gu(l.parentRule)}),a.apply(l,c)})});let s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Re((a,l,c)=>{let[u]=c;if(n.has(u))return s.apply(l,[u]);let{id:d,styleId:p}=bo(l.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||p&&p!==-1)&&e({id:d,styleId:p,remove:{property:u},index:Gu(l.parentRule)}),a.apply(l,c)})}),Re(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s})}function MM({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:o,sampling:i,doc:s}){let a=Re(c=>Sl(Re(u=>{let d=wl(u);if(!d||bn(d,t,n,r,!0))return;let{currentTime:p,volume:h,muted:y,playbackRate:_}=d;e({type:c,id:o.getId(d),currentTime:p,volume:h,muted:y,playbackRate:_})}),i.media||500)),l=[tn("play",a(Cs.Play),s),tn("pause",a(Cs.Pause),s),tn("seeked",a(Cs.Seeked),s),tn("volumechange",a(Cs.VolumeChange),s),tn("ratechange",a(Cs.RateChange),s)];return Re(()=>{l.forEach(c=>c())})}function PM({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(l,c,u){let d=new i(l,c,u);return o.set(d,{family:l,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),d};let s=gh(t.fonts,"add",function(a){return function(l){return nd(Re(()=>{let c=o.get(l);c&&(e(c),o.delete(l))}),0),a.apply(this,[l])}});return r.push(()=>{n.FontFace=i}),r.push(s),Re(()=>{r.forEach(a=>a())})}function LM(e){let{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,selectionCb:s}=e,a=!0,l=Re(()=>{let c=t.getSelection();if(!c||a&&c?.isCollapsed)return;a=c.isCollapsed||!1;let u=[],d=c.rangeCount||0;for(let p=0;p<d;p++){let h=c.getRangeAt(p),{startContainer:y,startOffset:_,endContainer:T,endOffset:g}=h;bn(y,r,o,i,!0)||bn(T,r,o,i,!0)||u.push({start:n.getId(y),startOffset:_,end:n.getId(T),endOffset:g})}s({ranges:u})});return l(),tn("selectionchange",l)}function OM({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:gh(n.customElements,"define",function(o){return function(i,s,a){try{t({define:{name:i}})}catch{}return o.apply(this,[i,s,a])}})}function DM(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=NT(e,e.doc));let o=CM(e),i=RM(e),s=AT(e),a=xM(e,{win:n}),l=kM(e),c=MM(e),u=()=>{},d=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(u=NM(e,{win:n}),d=MT(e,e.doc),p=AM(e,{win:n}),e.collectFonts&&(h=PM(e)));let y=LM(e),_=OM(e),T=[];for(let g of e.plugins)T.push(g.observer(g.callback,n,g.options));return Re(()=>{ks.forEach(g=>g.reset()),r?.disconnect(),o(),i(),s(),a(),l(),c(),u(),d(),p(),h(),y(),_(),T.forEach(g=>g())})}function Ou(e){return typeof window[e]<"u"}function Du(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var vl=class{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,o){let i=r||this.getIdToRemoteIdMap(t),s=o||this.getRemoteIdToIdMap(t),a=i.get(n);return a||(a=this.generateIdFn(),i.set(n,a),s.set(a,n)),a}getIds(t,n){let r=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,o))}getRemoteId(t,n,r){let o=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;let i=o.get(n);return i||-1}getRemoteIds(t,n){let r=this.getRemoteIdToIdMap(t);return n.map(o=>this.getRemoteId(t,o,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}},Jm=class{constructor(){this.crossOriginIframeMirror=new vl(hh),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},Xm=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new vl(hh),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new vl(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0);let n=_l(t);n&&this.crossOriginIframeMap.set(n,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&_l(t)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(t);let r=Sh(t);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(t){let n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;let o=this.crossOriginIframeMap.get(t.source);if(!o)return;let i=this.transformCrossOriginEvent(o,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(t,n){switch(n.type){case ge.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);let r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:ge.IncrementalSnapshot,data:{source:se.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ge.Meta:case ge.Load:case ge.DomContentLoaded:return!1;case ge.Plugin:return n;case ge.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case ge.IncrementalSnapshot:switch(n.data.source){case se.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(r.node,o)}),n.data.removes.forEach(r=>{this.replaceIds(r,t,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,t,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case se.Drag:case se.TouchMove:case se.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case se.ViewportResize:return!1;case se.MediaInteraction:case se.MouseInteraction:case se.Scroll:case se.CanvasMutation:case se.Input:return this.replaceIds(n.data,t,["id"]),n;case se.StyleSheetRule:case se.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case se.Font:return n;case se.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case se.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),n.data.styles?.forEach(r=>{this.replaceStyleIds(r,t,["styleId"])}),n}}return!1}replace(t,n,r,o){for(let i of o)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==gt.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},Qm=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},Zm=class{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,n){if(!ml(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);let r=NT({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(AT({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),nd(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(MT({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){let n=Sh(t),r=_l(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){let r=this;this.restoreHandlers.push(gh(t.prototype,"attachShadow",function(o){return function(i){let s=o.call(this,i);return this.shadowRoot&&bT(this)&&r.addShadowRoot(this.shadowRoot,n),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}},eh=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Gm,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;let r={id:n,styleIds:[]},o=[];for(let i of t){let s;this.styleMirror.has(i)?s=this.styleMirror.getId(i):(s=this.styleMirror.add(i),o.push({styleId:s,rules:Array.from(i.rules||CSSRule,(a,l)=>({rule:fT(a),index:l}))})),r.styleIds.push(s)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},th=class{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){let r=this.nodeMap.get(t);return r&&Array.from(r).some(o=>o!==n)}add(t,n){this.active||(this.active=!0,_M(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}},at,Vu;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var ur=j1();function dr(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,unblockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskAllText:c=!1,maskTextClass:u="rr-mask",unmaskTextClass:d=null,maskTextSelector:p=null,unmaskTextSelector:h=null,inlineStylesheet:y=!0,maskAllInputs:_,maskInputOptions:T,slimDOMOptions:g,maskAttributeFn:S,maskInputFn:E,maskTextFn:R,maxCanvasSize:M=null,packFn:A,sampling:I={},dataURLOptions:N={},mousemoveWait:U,recordDOM:x=!0,recordCanvas:$=!1,recordCrossOriginIframes:W=!1,recordAfter:ye=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:K=!1,collectFonts:et=!1,inlineImages:pe=!1,plugins:fe,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:Se=new Set([]),errorHandler:J,onMutation:le,getCanvasManager:Ie}=e;EM(J);let _e=W?window.parent===window:!0,ut=!1;if(!_e)try{window.parent.document&&(ut=!1)}catch{ut=!0}if(_e&&!t)throw new Error("emit function is required");if(!_e&&!ut)return()=>{};U!==void 0&&I.mousemove===void 0&&(I.mousemove=U),ur.reset();let Xe=_===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:T!==void 0?T:{},Yt=g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:g==="all",headMetaDescKeywords:g==="all"}:g||{};gM();let dt,an=0,Tn=Z=>{for(let Fe of fe||[])Fe.eventProcessor&&(Z=Fe.eventProcessor(Z));return A&&!ut&&(Z=A(Z)),Z};at=(Z,Fe)=>{let me=Z;if(me.timestamp=ju(),ks[0]?.isFrozen()&&me.type!==ge.FullSnapshot&&!(me.type===ge.IncrementalSnapshot&&me.data.source===se.Mutation)&&ks.forEach(Ve=>Ve.unfreeze()),_e)t?.(Tn(me),Fe);else if(ut){let Ve={type:"rrweb",event:Tn(me),origin:window.location.origin,isCheckout:Fe};window.parent.postMessage(Ve,"*")}if(me.type===ge.FullSnapshot)dt=me,an=0;else if(me.type===ge.IncrementalSnapshot){if(me.data.source===se.Mutation&&me.data.isAttachIframe)return;an++;let Ve=r&&an>=r,re=n&&dt&&me.timestamp-dt.timestamp>n;(Ve||re)&&St(!0)}};let On=Z=>{at({type:ge.IncrementalSnapshot,data:{source:se.Mutation,...Z}})},po=Z=>at({type:ge.IncrementalSnapshot,data:{source:se.Scroll,...Z}}),mo=Z=>at({type:ge.IncrementalSnapshot,data:{source:se.CanvasMutation,...Z}}),Gi=Z=>at({type:ge.IncrementalSnapshot,data:{source:se.AdoptedStyleSheet,...Z}}),P=new eh({mutationCb:On,adoptedStyleSheetCb:Gi}),F=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Jm:new Xm({mirror:ur,mutationCb:On,stylesheetManager:P,recordCrossOriginIframes:W,wrappedEmit:at});for(let Z of fe||[])Z.getMirror&&Z.getMirror({nodeMirror:ur,crossOriginIframeMirror:F.crossOriginIframeMirror,crossOriginIframeStyleMirror:F.crossOriginIframeStyleMirror});let ne=new th,ae=FM(Ie,{mirror:ur,win:window,mutationCb:Z=>at({type:ge.IncrementalSnapshot,data:{source:se.CanvasMutation,...Z}}),recordCanvas:$,blockClass:o,blockSelector:i,unblockSelector:s,maxCanvasSize:M,sampling:I.canvas,dataURLOptions:N,errorHandler:J}),we=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Qm:new Zm({mutationCb:On,scrollCb:po,bypassOptions:{onMutation:le,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,inlineStylesheet:y,maskInputOptions:Xe,dataURLOptions:N,maskAttributeFn:S,maskTextFn:R,maskInputFn:E,recordCanvas:$,inlineImages:pe,sampling:I,slimDOMOptions:Yt,iframeManager:F,stylesheetManager:P,canvasManager:ae,keepIframeSrcFn:D,processedNodeManager:ne,ignoreCSSAttributes:Se},mirror:ur}),St=(Z=!1)=>{if(!x)return;at({type:ge.Meta,data:{href:window.location.href,width:TT(),height:ET()}},Z),P.reset(),we.init(),ks.forEach(me=>me.lock());let Fe=mM(document,{mirror:ur,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,inlineStylesheet:y,maskAllInputs:Xe,maskAttributeFn:S,maskInputFn:E,maskTextFn:R,slimDOM:Yt,dataURLOptions:N,recordCanvas:$,inlineImages:pe,onSerialize:me=>{CT(me,ur)&&F.addIframe(me),RT(me,ur)&&P.trackLinkElement(me),Wm(me)&&we.addShadowRoot(me.shadowRoot,document)},onIframeLoad:(me,Ve)=>{F.attachIframe(me,Ve);let re=_l(me);re&&ae.addWindow(re),we.observeAttachShadow(me)},onStylesheetLoad:(me,Ve)=>{P.attachLinkElement(me,Ve)},onBlockedImageLoad:(me,Ve,{width:re,height:Dn})=>{On({adds:[],removes:[],texts:[],attributes:[{id:Ve.id,attributes:{style:{width:`${re}px`,height:`${Dn}px`}}}]})},keepIframeSrcFn:D,ignoreCSSAttributes:Se});if(!Fe)return console.warn("Failed to snapshot the document");at({type:ge.FullSnapshot,data:{node:Fe,initialOffset:vT(window)}}),ks.forEach(me=>me.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&P.adoptStyleSheets(document.adoptedStyleSheets,ur.getId(document))};Vu=St;try{let Z=[],Fe=Ve=>Re(DM)({onMutation:le,mutationCb:On,mousemoveCb:(re,Dn)=>at({type:ge.IncrementalSnapshot,data:{source:Dn,positions:re}}),mouseInteractionCb:re=>at({type:ge.IncrementalSnapshot,data:{source:se.MouseInteraction,...re}}),scrollCb:po,viewportResizeCb:re=>at({type:ge.IncrementalSnapshot,data:{source:se.ViewportResize,...re}}),inputCb:re=>at({type:ge.IncrementalSnapshot,data:{source:se.Input,...re}}),mediaInteractionCb:re=>at({type:ge.IncrementalSnapshot,data:{source:se.MediaInteraction,...re}}),styleSheetRuleCb:re=>at({type:ge.IncrementalSnapshot,data:{source:se.StyleSheetRule,...re}}),styleDeclarationCb:re=>at({type:ge.IncrementalSnapshot,data:{source:se.StyleDeclaration,...re}}),canvasMutationCb:mo,fontCb:re=>at({type:ge.IncrementalSnapshot,data:{source:se.Font,...re}}),selectionCb:re=>{at({type:ge.IncrementalSnapshot,data:{source:se.Selection,...re}})},customElementCb:re=>{at({type:ge.IncrementalSnapshot,data:{source:se.CustomElement,...re}})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,maskInputOptions:Xe,inlineStylesheet:y,sampling:I,recordDOM:x,recordCanvas:$,inlineImages:pe,userTriggeredOnInput:K,collectFonts:et,doc:Ve,maskAttributeFn:S,maskInputFn:E,maskTextFn:R,keepIframeSrcFn:D,blockSelector:i,unblockSelector:s,slimDOMOptions:Yt,dataURLOptions:N,mirror:ur,iframeManager:F,stylesheetManager:P,shadowDomManager:we,processedNodeManager:ne,canvasManager:ae,ignoreCSSAttributes:Se,plugins:fe?.filter(re=>re.observer)?.map(re=>({observer:re.observer,options:re.options,callback:Dn=>at({type:ge.Plugin,data:{plugin:re.name,payload:Dn}})}))||[]},{});F.addLoadListener(Ve=>{try{Z.push(Fe(Ve.contentDocument))}catch(re){console.warn(re)}});let me=()=>{St(),Z.push(Fe(document))};return document.readyState==="interactive"||document.readyState==="complete"?me():(Z.push(tn("DOMContentLoaded",()=>{at({type:ge.DomContentLoaded,data:{}}),ye==="DOMContentLoaded"&&me()})),Z.push(tn("load",()=>{at({type:ge.Load,data:{}}),ye==="load"&&me()},window))),()=>{Z.forEach(Ve=>Ve()),ne.destroy(),Vu=void 0,TM()}}catch(Z){console.warn(Z)}}function UM(e){if(!Vu)throw new Error("please take full snapshot after start recording");Vu(e)}dr.mirror=ur;dr.takeFullSnapshot=UM;function FM(e,t){try{return e?e(t):new Wu}catch{return console.warn("Unable to initialize CanvasManager"),new Wu}}var tT;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(tT||(tT={}));var BM=3,HM=5;function _h(e){return e>9999999999?e:e*1e3}function Um(e){return e>9999999999?e/1e3:e}function Cl(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:ge.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Bt(t,10,1e3)}}),t.category==="console")))}var $M="button,a";function PT(e){return e.closest($M)||e}function LT(e){let t=OT(e);return!t||!(t instanceof Element)?t:PT(t)}function OT(e){return zM(e)?e.target:e}function zM(e){return typeof e=="object"&&!!e&&"target"in e}var ko;function jM(e){return ko||(ko=[],WM()),ko.push(e),()=>{let t=ko?ko.indexOf(e):-1;t>-1&&ko.splice(t,1)}}function WM(){it(je,"open",function(e){return function(...t){if(ko)try{ko.forEach(n=>n())}catch{}return e.apply(je,t)}})}var GM=new Set([se.Mutation,se.StyleSheetRule,se.StyleDeclaration,se.AdoptedStyleSheet,se.CanvasMutation,se.Selection,se.MediaInteraction]);function VM(e,t,n){e.handleClick(t,n)}var nh=class{constructor(t,n,r=Cl){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scrollTimeout=n.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){let t=jM(()=>{this._lastMutation=nT()});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,n){if(YM(n,this._ignoreSelector)||!KM(t))return;let r={timestamp:Um(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(o=>o.node===r.node&&Math.abs(o.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=Um(t)}registerScroll(t=Date.now()){this._lastScroll=Um(t)}registerClick(t){let n=PT(t);this._handleMultiClick(n)}_handleMultiClick(t){this._getClicks(t).forEach(n=>{n.clickCount++})}_getClicks(t){return this._clicks.filter(n=>n.node===t)}_checkClicks(){let t=[],n=nT();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&t.push(r)});for(let r of t){let o=this._clicks.indexOf(r);o>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(o,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){let n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scrollTimeout,o=t.mutationAfter&&t.mutationAfter<=this._threshold,i=!r&&!o,{clickCount:s,clickBreadcrumb:a}=t;if(i){let l=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,c=l<this._timeout*1e3?"mutation":"timeout",u={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.slowClickDetected",data:{...a.data,url:je.location.href,route:n.getCurrentRoute(),timeAfterClickMs:l,endReason:c,clickCount:s||1}};this._addBreadcrumbEvent(n,u);return}if(s>1){let l={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.multiClick",data:{...a.data,url:je.location.href,route:n.getCurrentRoute(),clickCount:s,metric:!0}};this._addBreadcrumbEvent(n,l)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Ti(()=>this._checkClicks(),1e3)}},qM=["A","BUTTON","INPUT"];function YM(e,t){return!!(!qM.includes(e.tagName)||e.tagName==="INPUT"&&!["submit","button"].includes(e.getAttribute("type")||"")||e.tagName==="A"&&(e.hasAttribute("download")||e.hasAttribute("target")&&e.getAttribute("target")!=="_self")||t&&e.matches(t))}function KM(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function nT(){return Date.now()/1e3}function JM(e,t){try{if(!XM(t))return;let{source:n}=t.data;if(GM.has(n)&&e.registerMutation(t.timestamp),n===se.Scroll&&e.registerScroll(t.timestamp),QM(t)){let{type:r,id:o}=t.data,i=dr.mirror.getNode(o);i instanceof HTMLElement&&r===en.Click&&e.registerClick(i)}}catch{}}function XM(e){return e.type===BM}function QM(e){return e.data.source===se.MouseInteraction}function xr(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var rd=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(rd||{}),ZM=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function eP(e){let t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(let n in e)if(ZM.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}var tP=e=>t=>{if(!e.isEnabled())return;let n=nP(t);if(!n)return;let r=t.name==="click",o=r?t.event:void 0;r&&e.clickDetector&&o?.target&&!o.altKey&&!o.metaKey&&!o.ctrlKey&&!o.shiftKey&&VM(e.clickDetector,n,LT(t.event)),Cl(e,n)};function DT(e,t){let n=dr.mirror.getId(e),r=n&&dr.mirror.getNode(n),o=r&&dr.mirror.getMeta(r),i=o&&oP(o)?o:null;return{message:t,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(s=>s.type===rd.Text&&s.textContent).filter(Boolean).map(s=>s.trim()).join(""),attributes:eP(i.attributes)}}:{}}}function nP(e){let{target:t,message:n}=rP(e);return xr({category:`ui.${e.name}`,...DT(t,n)})}function rP(e){let t=e.name==="click",n,r=null;try{r=t?LT(e.event):OT(e.event),n=Ue(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function oP(e){return e.type===rd.Element}function iP(e,t){if(!e.isEnabled())return;e.updateUserActivity();let n=sP(t);n&&Cl(e,n)}function sP(e){let{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i,target:s}=e;if(!s||aP(s)||!i)return null;let a=t||r||o,l=i.length===1;if(!a&&l)return null;let c=Ue(s,{maxStringLength:200})||"<unknown>",u=DT(s,c);return xr({category:"ui.keyDown",message:c,data:{...u.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i}})}function aP(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}var lP={resource:pP,paint:dP,navigation:fP};function Fm(e,t){return({metric:n})=>{t.replayPerformanceEntries.push(e(n))}}function cP(e){return e.map(uP).filter(Boolean)}function uP(e){let t=lP[e.entryType];return t?t(e):null}function Ms(e){return(($e()||je.performance.timeOrigin)+e)/1e3}function dP(e){let{duration:t,entryType:n,name:r,startTime:o}=e,i=Ms(o);return{type:n,name:r,start:i,end:i+t,data:void 0}}function fP(e){let{entryType:t,name:n,decodedBodySize:r,duration:o,domComplete:i,encodedBodySize:s,domContentLoadedEventStart:a,domContentLoadedEventEnd:l,domInteractive:c,loadEventStart:u,loadEventEnd:d,redirectCount:p,startTime:h,transferSize:y,type:_}=e;return o===0?null:{type:`${t}.${_}`,start:Ms(h),end:Ms(i),name:n,data:{size:y,decodedBodySize:r,encodedBodySize:s,duration:o,domInteractive:c,domContentLoadedEventStart:a,domContentLoadedEventEnd:l,loadEventStart:u,loadEventEnd:d,domComplete:i,redirectCount:p}}}function pP(e){let{entryType:t,initiatorType:n,name:r,responseEnd:o,startTime:i,decodedBodySize:s,encodedBodySize:a,responseStatus:l,transferSize:c}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:Ms(i),end:Ms(o),name:r,data:{size:c,statusCode:l,decodedBodySize:s,encodedBodySize:a}}}function mP(e){let t=e.entries[e.entries.length-1],n=t?.element?[t.element]:void 0;return vh(e,"largest-contentful-paint",n)}function hP(e){return e.sources!==void 0}function gP(e){let t=[],n=[];for(let r of e.entries)if(hP(r)){let o=[];for(let i of r.sources)if(i.node){n.push(i.node);let s=dr.mirror.getId(i.node);s&&o.push(s)}t.push({value:r.value,nodeIds:o.length?o:void 0})}return vh(e,"cumulative-layout-shift",n,t)}function yP(e){let t=e.entries[e.entries.length-1],n=t?.target?[t.target]:void 0;return vh(e,"interaction-to-next-paint",n)}function vh(e,t,n,r){let o=e.value,i=e.rating,s=Ms(o);return{type:"web-vital",name:t,start:s,end:s,data:{value:o,size:o,rating:i,nodeIds:n?n.map(a=>dr.mirror.getId(a)):void 0,attributions:r}}}function SP(e){function t(o){e.performanceEntries.includes(o)||e.performanceEntries.push(o)}function n({entries:o}){o.forEach(t)}let r=[];return["navigation","paint","resource"].forEach(o=>{r.push(lr(o,n))}),r.push(qr(Fm(mP,e)),Vr(Fm(gP,e)),Si(Fm(yP,e))),()=>{r.forEach(o=>o())}}var oe=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,_P='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([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,0,0,0]),i=new t([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,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(){j.prototype.flush.call(this)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function vP(){let e=new Blob([_P]);return URL.createObjectURL(e)}var rT=["log","warn","error"],Fu="[Replay] ";function Bm(e,t="info"){xn({category:"console",data:{logger:"replay"},level:t,message:`${Fu}${e}`},{level:t})}function EP(){let e=!1,t=!1,n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return oe?(rT.forEach(r=>{n[r]=(...o)=>{C[r](Fu,...o),t&&Bm(o.join(""),ms(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),C.error(Fu,r),e?jr(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&Bm(r,"error")},n.infoTick=(...r)=>{C.log(Fu,...r),t&&setTimeout(()=>Bm(r[0]),0)}):rT.forEach(r=>{n[r]=()=>{}}),n}var ie=EP(),El=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${ph}.`)}},qu=class{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(t){let n=JSON.stringify(t).length;if(this._totalSize+=n,this._totalSize>ph)throw new El;this.events.push(t)}finish(){return new Promise(t=>{let n=this.events;this.clear(),t(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let t=null;for(let{timestamp:n}of this.events)(t===null||n<t)&&(t=n);return t===null?t:_h(t)}},rh=class{constructor(t){this._onMessage=({data:n})=>{let r=n;if(typeof r.id!="number")return;let o=this._pending.get(r.id);if(!(!o||o.method!==r.method)){if(this._pending.delete(r.id),!r.success){oe&&ie.error("Error in compression worker: ",r.response),o.reject(new Error("Error in compression worker"));return}o.resolve(r.response)}},this._worker=t,this._id=0,this._pending=new Map,this._worker.addEventListener("message",this._onMessage)}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((t,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?t():(oe&&ie.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{oe&&ie.warn("Failed to load Replay compression worker",r),n(new Error(`Failed to load Replay compression worker: ${r instanceof ErrorEvent&&r.message?r.message:"Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load."}`))},{once:!0})}),this._ensureReadyPromise)}destroy(){oe&&ie.log("Destroying compression worker"),this._worker.removeEventListener("message",this._onMessage),this._pending.forEach(t=>t.reject(new Error("Worker destroyed"))),this._pending.clear(),this._worker.terminate()}postMessage(t,n){let r=this._getAndIncrementId();return new Promise((o,i)=>{this._pending.set(r,{method:t,resolve:o,reject:i});try{this._worker.postMessage({id:r,method:t,arg:n})}catch(s){this._pending.delete(r),i(s)}})}_getAndIncrementId(){return this._id++}},oh=class{constructor(t){this._worker=new rh(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){let n=_h(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);let r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>ph?Promise.reject(new El):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{oe&&ie.exception(t,'Sending "clear" message to worker failed',t)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}async _finishRequest(){let t=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t}},ih=class{constructor(t){this._fallback=new qu,this._compression=new oh(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(t){this._used.hasCheckout=t}set waitForCheckout(t){this._used.waitForCheckout=t}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(t){return this._used.addEvent(t)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(t){oe&&ie.exception(t,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:t,hasCheckout:n,waitForCheckout:r}=this._fallback,o=[];for(let i of t)o.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(o),this._fallback.clear()}catch(i){oe&&ie.exception(i,"Failed to add events when switching buffers.")}}};function TP({useCompression:e,workerUrl:t}){if(e&&window.Worker){let n=IP(t);if(n)return n}return oe&&ie.log("Using simple buffer"),new qu}function IP(e){try{let t=e||wP();if(!t)return;oe&&ie.log(`Using compression worker${e?` from ${e}`:""}`);let n=new Worker(t);return new ih(n)}catch(t){oe&&ie.exception(t,"Failed to create compression worker")}}function wP(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?vP():""}function Eh(){try{return"sessionStorage"in je&&!!je.sessionStorage}catch{return!1}}function CP(e){RP(),e.session=void 0}function RP(){if(Eh())try{je.sessionStorage.removeItem(dh)}catch{}}function UT(e){return e===void 0?!1:Math.random()<e}function od(e){if(Eh())try{je.sessionStorage.setItem(dh,JSON.stringify(e))}catch{}}function FT(e){let t=Date.now(),n=e.id||st(),r=e.started||t,o=e.lastActivity||t,i=e.segmentId||0,s=e.sampled,a=e.previousSessionId,l=e.dirty||!1;return{id:n,started:r,lastActivity:o,segmentId:i,sampled:s,previousSessionId:a,dirty:l}}function xP(e,t){return UT(e)?"session":t?"buffer":!1}function oT({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){let o=xP(e,t),i=FT({sampled:o,previousSessionId:r});return n&&od(i),i}function bP(){if(!Eh())return null;try{let e=je.sessionStorage.getItem(dh);if(!e)return null;let t=JSON.parse(e);return oe&&ie.infoTick("Loading existing session"),FT(t)}catch{return null}}function sh(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function kP(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return sh(e.started,t,r)||sh(e.lastActivity,n,r)}function Yu(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!kP(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function Hm({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){let o=r.stickySession&&bP();return o?Yu(o,{sessionIdleExpire:e,maxReplayDuration:t})?(oe&&ie.infoTick("Session in sessionStorage is expired, creating new one..."),oT(r,{previousSessionId:o.id})):o:(oe&&ie.infoTick("Creating new session"),oT(r,{previousSessionId:n}))}function NP(e){return e.type===ge.Custom}function Th(e,t,n){return HT(e,t)?(BT(e,t,n),!0):!1}function AP(e,t,n){return HT(e,t)?BT(e,t,n):Promise.resolve(null)}async function BT(e,t,n){let{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;let o=e.recordingMode==="buffer";try{n&&o&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);let i=e.getOptions(),s=MP(t,i.beforeAddRecordingEvent);return s?await r.addEvent(s):void 0}catch(i){let s=i&&i instanceof El,a=s?"eventBufferOverflow":"eventBufferError",l=z();if(l){let c=s?"buffer_overflow":"internal_sdk_error";l.recordDroppedEvent(c,"replay")}if(s&&o)return r.clear(),r.waitForCheckout=!0,null;e.handleException(i),await e.stop({reason:a})}}function HT(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;let n=_h(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(oe&&ie.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function MP(e,t){try{if(typeof t=="function"&&NP(e))return t(e)}catch(n){return oe&&ie.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Ih(e){return!e.type}function ah(e){return e.type==="transaction"}function PP(e){return e.type==="replay_event"}function iT(e){return e.type==="feedback"}function LP(e){return(t,n)=>{if(!e.isEnabled()||!Ih(t)&&!ah(t))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(ah(t)){OP(e,t);return}DP(e,t)}}}function OP(e,t){let n=e.getContext();t.contexts?.trace?.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function DP(e,t){let n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!t.tags?.replayId)return;let{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||Ti(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(o){e.handleException(o)}})}function UP(e){return t=>{!e.isEnabled()||!Ih(t)||FP(e,t)}}function FP(e,t){let n=t.exception?.values?.[0]?.value;if(typeof n=="string"&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){let r=xr({category:"replay.hydrate-error",data:{url:mn()}});Cl(e,r)}}function BP(e){let t=z();t&&t.on("beforeAddBreadcrumb",n=>HP(e,n))}function HP(e,t){if(!e.isEnabled()||!$T(t))return;let n=$P(t);n&&Cl(e,n)}function $P(e){return!$T(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?zP(e):xr(e)}function zP(e){let t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return xr(e);let n=!1,r=t.map(o=>{if(!o)return o;if(typeof o=="string")return o.length>Lu?(n=!0,`${o.slice(0,Lu)}\u2026`):o;if(typeof o=="object")try{let i=Bt(o,7);return JSON.stringify(i).length>Lu?(n=!0,`${JSON.stringify(i,null,2).slice(0,Lu)}\u2026`):i}catch{}return o});return xr({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function $T(e){return!!e.category}function jP(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function Ku(){let e=ee().getPropagationContext().dsc;e&&delete e.replay_id;let t=Me();if(t){let n=ht(t);delete n.replay_id}}function sT(e){let t=ee().getPropagationContext().dsc;t&&(t.replay_id=e);let n=Me();if(n){let r=ht(n);r.replay_id=e}}function WP(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:ge.Custom,timestamp:t.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1):!0)}function GP(e,t){return e.recordingMode!=="buffer"||t.message===fh||!t.exception||t.type?!1:UT(e.getOptions().errorSampleRate)}function VP(e){return Object.assign((t,n)=>{if(e.session&&Yu(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&Ku(),!e.isEnabled()||e.isPaused())return t;if(PP(t))return delete t.breadcrumbs,t;if(!Ih(t)&&!ah(t)&&!iT(t))return t;if(!e.checkAndHandleExpiredSession())return Ku(),t;if(iT(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),WP(e,t),t;if(jP(t,n)&&!e.getOptions()._experiments.captureExceptions)return oe&&ie.log("Ignoring error from rrweb internals",t),null;let o=GP(e,t);if((o||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),o&&e.recordingMode==="buffer"&&e.session?.sampled==="buffer"){let s=e.session;s.dirty=!0,e.getOptions().stickySession&&od(s)}return t},{id:"Replay"})}function id(e,t){return t.map(({type:n,start:r,end:o,name:i,data:s})=>{let a=e.throttledAddEvent({type:ge.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:o,data:s}}});return typeof a=="string"?Promise.resolve(null):a})}function qP(e){let{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}function YP(e){return t=>{if(!e.isEnabled())return;let n=qP(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(id(e,[n]),!1)))}}function KP(e,t){return oe&&e.getOptions()._experiments.traceInternals?!1:Kp(t,z())}function zT(e,t){e.isEnabled()&&t!==null&&(KP(e,t.name)||e.addUpdate(()=>(id(e,[t]),!0)))}function sd(e){if(!e)return;let t=new TextEncoder;try{if(typeof e=="string")return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){let n=ku(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function jT(e){if(!e)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}function Ju(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};let n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function WT(e,t){if(!t)return null;let{startTimestamp:n,endTimestamp:r,url:o,method:i,statusCode:s,request:a,response:l}=t;return{type:e,start:n/1e3,end:r/1e3,name:o,data:{method:i,statusCode:s,request:a,response:l}}}function Tl(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function No(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};let r={headers:e,size:t},{body:o,warnings:i}=JP(n);return r.body=o,i?.length&&(r._meta={warnings:i}),r}function lh(e,t){return Object.entries(e).reduce((n,[r,o])=>{let i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=o),n},{})}function JP(e){if(!e||typeof e!="string")return{body:e};let t=e.length>HE,n=XP(e);if(t){let r=e.slice(0,HE);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}\u2026`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function XP(e){let t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function Xu(e,t){let n=QP(e);return kt(n,t)}function QP(e,t=je.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(je.location.origin))return e;let n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;let r=n.href;return!e.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function ZP(e,t,n){try{let r=await tL(e,t,n),o=WT("resource.fetch",r);zT(n.replay,o)}catch(r){oe&&ie.exception(r,"Failed to capture fetch breadcrumb")}}function eL(e,t){let{input:n,response:r}=t,o=n?Au(n):void 0,i=sd(o),s=r?jT(r.headers.get("content-length")):void 0;i!==void 0&&(e.data.request_body_size=i),s!==void 0&&(e.data.response_body_size=s)}async function tL(e,t,n){let r=Date.now(),{startTimestamp:o=r,endTimestamp:i=r}=t,{url:s,method:a,status_code:l=0,request_body_size:c,response_body_size:u}=e.data,d=Xu(s,n.networkDetailAllowUrls)&&!Xu(s,n.networkDetailDenyUrls),p=d?nL(n,t.input,c):Tl(c),h=await rL(d,n,t.response,u);return{startTimestamp:o,endTimestamp:i,url:s,method:a,statusCode:l,request:p,response:h}}function nL({networkCaptureBodies:e,networkRequestHeaders:t},n,r){let o=n?sL(n,t):{};if(!e)return No(o,r,void 0);let i=Au(n),[s,a]=Nu(i,ie),l=No(o,r,s);return a?Ju(l,a):l}async function rL(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,o){if(!e&&o!==void 0)return Tl(o);let i=r?GT(r.headers,n):{};if(!r||!t&&o!==void 0)return No(i,o,void 0);let[s,a]=await iL(r),l=oL(s,{networkCaptureBodies:t,responseBodySize:o,captureDetails:e,headers:i});return a?Ju(l,a):l}function oL(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:o}){try{let i=e?.length&&n===void 0?sd(e):n;return r?t?No(o,i,e):No(o,i,void 0):Tl(i)}catch(i){return oe&&ie.exception(i,"Failed to serialize response body"),No(o,n,void 0)}}async function iL(e){let t=aL(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await lL(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(oe&&ie.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(oe&&ie.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function GT(e,t){let n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function sL(e,t){return e.length===1&&typeof e[0]!="string"?aT(e[0],t):e.length===2?aT(e[1],t):{}}function aT(e,t){if(!e)return{};let n=e.headers;return n?n instanceof Headers?GT(n,t):Array.isArray(n)?{}:lh(n,t):{}}function aL(e){try{return e.clone()}catch(t){oe&&ie.exception(t,"Failed to clone response body")}}function lL(e){return new Promise((t,n)=>{let r=Ti(()=>n(new Error("Timeout while trying to read response body")),500);cL(e).then(o=>t(o),o=>n(o)).finally(()=>clearTimeout(r))})}async function cL(e){return await e.text()}async function uL(e,t,n){try{let r=fL(e,t,n),o=WT("resource.xhr",r);zT(n.replay,o)}catch(r){oe&&ie.exception(r,"Failed to capture xhr breadcrumb")}}function dL(e,t){let{xhr:n,input:r}=t;if(!n)return;let o=sd(r),i=n.getResponseHeader("content-length")?jT(n.getResponseHeader("content-length")):hL(n.response,n.responseType);o!==void 0&&(e.data.request_body_size=o),i!==void 0&&(e.data.response_body_size=i)}function fL(e,t,n){let r=Date.now(),{startTimestamp:o=r,endTimestamp:i=r,input:s,xhr:a}=t,{url:l,method:c,status_code:u=0,request_body_size:d,response_body_size:p}=e.data;if(!l)return null;if(!a||!Xu(l,n.networkDetailAllowUrls)||Xu(l,n.networkDetailDenyUrls)){let A=Tl(d),I=Tl(p);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:u,request:A,response:I}}let h=a[cr],y=h?lh(h.request_headers,n.networkRequestHeaders):{},_=lh(cl(a),n.networkResponseHeaders),[T,g]=n.networkCaptureBodies?Nu(s,ie):[void 0],[S,E]=n.networkCaptureBodies?pL(a):[void 0],R=No(y,d,T),M=No(_,p,S);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:u,request:g?Ju(R,g):R,response:E?Ju(M,E):M}}function pL(e){let t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return mL(e.response,e.responseType)}catch(n){t.push(n)}return oe&&ie.warn("Failed to get xhr response body",...t),[void 0]}function mL(e,t){try{if(typeof e=="string")return[e];if(e instanceof Document)return[e.body.outerHTML];if(t==="json"&&e&&typeof e=="object")return[JSON.stringify(e)];if(!e)return[void 0]}catch(n){return oe&&ie.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return oe&&ie.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function hL(e,t){try{let n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return sd(n)}catch{return}}function gL(e){let t=z();try{let{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:i,networkResponseHeaders:s}=e.getOptions(),a={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:i,networkResponseHeaders:s};t&&t.on("beforeAddBreadcrumb",(l,c)=>yL(a,l,c))}catch{}}function yL(e,t,n){if(t.data)try{SL(t)&&vL(n)&&(dL(t,n),uL(t,n,e)),_L(t)&&EL(n)&&(eL(t,n),ZP(t,n,e))}catch(r){oe&&ie.exception(r,"Error when enriching network breadcrumb")}}function SL(e){return e.category==="xhr"}function _L(e){return e.category==="fetch"}function vL(e){return e?.xhr}function EL(e){return e?.input!==void 0}function TL(e){let t=z();al(tP(e)),Jr(YP(e)),BP(e),gL(e);let n=VP(e);qa(n),t&&(t.on("beforeSendEvent",UP(e)),t.on("afterSendEvent",LP(e)),t.on("createDsc",r=>{let o=e.getSessionId();o&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=o)}),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",async(r,o)=>{let i=e.getSessionId();o?.includeReplay&&e.isEnabled()&&i&&r.contexts?.feedback&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=i)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function IL(e){try{return Promise.all(id(e,[wL(je.performance.memory)]))}catch{return[]}}function wL(e){let{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,o=Date.now()/1e3;return{type:"memory",name:"memory",start:o,end:o,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function CL(e,t,n){return Xp(e,t,{...n,setTimeoutImpl:Ti})}var Uu=V.navigator;function RL(){return/iPhone|iPad|iPod/i.test(Uu?.userAgent??"")||/Macintosh/i.test(Uu?.userAgent??"")&&Uu?.maxTouchPoints&&Uu?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function xL(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){oe&&ie.warn("Received replay event after session expired.");return}let o=r||!t;t=!0,bL(n),e.clickDetector&&JM(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&o&&e.setInitialState(),!Th(e,n,o))return!0;if(!o)return!1;let i=e.session;if(NL(e,o),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){let s=e.eventBuffer.getEarliestTimestamp();s&&(oe&&ie.log(`Updating session start time to earliest event in buffer to ${new Date(s)}`),i.started=s,e.getOptions().stickySession&&od(i))}return i?.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function bL(e){let t=e.data;if(!(e.type!==ge.IncrementalSnapshot||!t||typeof t!="object"||!("source"in t)||t.source!==se.Mutation||!("attributes"in t)||!Array.isArray(t.attributes)))for(let n of t.attributes){let r=dr.mirror.getNode(n.id),o=r&&dr.mirror.getMeta(r);if(o?.type===rd.Element)for(let[i,s]of Object.entries(n.attributes))s===null?delete o.attributes[i]:o.attributes[i]=s}}function kL(e){let t=e.getOptions();return{type:ge.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:e.eventBuffer?e.eventBuffer.type==="worker":!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function NL(e,t){!t||e.session?.segmentId!==0||Th(e,kL(e),!1)}function AL(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function ML(e,t,n,r){return Qt($a(e,is(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function PL({recordingData:e,headers:t}){let n,r=`${JSON.stringify(t)}
|
|
31
|
-
`;if(typeof e=="string")n=`${r}${e}`;else{let i=new TextEncoder().encode(r);n=new Uint8Array(i.length+e.length),n.set(i),n.set(e,i.length)}return n}async function LL({client:e,scope:t,replayId:n,event:r}){let o=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,i={event_id:n,integrations:o};e.emit("preprocessEvent",r,i);let s=await Wa(e.getOptions(),r,i,t,e,Qe());if(!s)return null;e.emit("postprocessEvent",s,i),s.platform=s.platform||"javascript";let a=e.getSdkMetadata(),{name:l,version:c,settings:u}=a?.sdk||{};return s.sdk={...s.sdk,name:l||"sentry.javascript.unknown",version:c||"0.0.0",settings:u},s}async function OL({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:o,session:i}){let s=PL({recordingData:e,headers:{segment_id:n}}),{urls:a,errorIds:l,traceIds:c,initialTimestamp:u}=r,d=z(),p=ee(),h=d?.getTransport(),y=d?.getDsn();if(!d||!h||!y||!i.sampled)return Promise.resolve({});let _={type:T1,replay_start_timestamp:u/1e3,timestamp:o/1e3,error_ids:l,trace_ids:c,urls:a,replay_id:t,segment_id:n,replay_type:i.sampled},T=await LL({scope:p,client:d,replayId:t,event:_});if(!T)return d.recordDroppedEvent("event_processor","replay"),oe&&ie.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete T.sdkProcessingMetadata;let g=ML(T,s,y,d.getOptions().tunnel),S;try{S=await h.send(g)}catch(R){let M=new Error(fh);try{M.cause=R}catch{}throw M}let E=Xa({},S);if(Ja(E,"replay"))throw new Il(E);if(typeof S.statusCode=="number"&&(S.statusCode<200||S.statusCode>=300))throw new Qu(S.statusCode);return S}var Qu=class extends Error{constructor(t){super(`Transport returned status code ${t}`)}},Il=class extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}},Zu=class extends Error{constructor(){super("Session is too long, not sending replay")}};async function VT(e,t={count:0,interval:b1}){let{recordingData:n,onError:r}=e;if(n.length)try{return await OL(e),!0}catch(o){if(o instanceof Qu||o instanceof Il)throw o;if(pi("Replays",{_retryCount:t.count}),r&&r(o),t.count>=k1){let i=new Error(`${fh} - max retries exceeded`);try{i.cause=o}catch{}throw i}return t.interval*=++t.count,new Promise((i,s)=>{Ti(async()=>{try{await VT(e,t),i(!0)}catch(a){s(a)}},t.interval)})}}var qT="__THROTTLED",DL="__SKIPPED";function UL(e,t,n){let r=new Map,o=a=>{let l=a-n;r.forEach((c,u)=>{u<l&&r.delete(u)})},i=()=>[...r.values()].reduce((a,l)=>a+l,0),s=!1;return(...a)=>{let l=Math.floor(Date.now()/1e3);if(o(l),i()>=t){let u=s;return s=!0,u?DL:qT}s=!1;let c=r.get(l)||0;return r.set(l,c+1),e(...a)}}var ch=class{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:I1,sessionIdleExpire:w1},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=t,this._debouncedFlush=CL(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=UL((s,a)=>AP(this,s,a),300,5);let{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),i=r?{threshold:Math.min(N1,r),timeout:r,scrollTimeout:A1,ignoreSelector:o?o.join(","):""}:void 0;if(i&&(this.clickDetector=new nh(this,i)),oe){let s=t._experiments;ie.setConfig({captureExceptions:!!s.captureExceptions,traceInternals:!!s.traceInternals})}this._handleVisibilityChange=()=>{je.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{let s=xr({category:"ui.blur"});this._doChangeToBackgroundTasks(s)},this._handleWindowFocus=()=>{let s=xr({category:"ui.focus"});this._doChangeToForegroundTasks(s)},this._handleKeyboardEvent=s=>{iP(this,s)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){oe&&ie.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){let{errorSampleRate:n,sessionSampleRate:r}=this._options,o=n<=0&&r<=0;if(this._requiresManualStart=o,!o){if(this._initializeSessionForSampling(t),!this.session){oe&&ie.exception(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",oe&&ie.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){oe&&ie.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){oe&&ie.log("Buffering is in progress, call `flush()` to save the replay");return}oe&&ie.infoTick("Starting replay in session mode"),this._updateUserActivity();let t=Hm({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){oe&&ie.log("Buffering is in progress, call `flush()` to save the replay");return}oe&&ie.infoTick("Starting replay in buffer mode");let t=Hm({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{let t=this._canvas;this._stopRecording=dr({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:x1}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:xL(this),...RL(),onMutation:this._onMutationHandler.bind(this),...t?{recordCanvas:t.recordCanvas,getCanvasManager:t.getCanvasManager,sampling:t.sampling,dataURLOptions:t.dataURLOptions}:{}})}catch(t){this.handleException(t)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(t){return this.handleException(t),!1}}async stop({forceFlush:t=!1,reason:n}={}){if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode="buffer";let r=n??"manual";z()?.emit("replayEnd",{sessionId:this.session?.id,reason:r});try{oe&&ie.log(`Stopping Replay triggered by ${r}`),Ku(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,CP(this)}catch(o){this.handleException(o)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),oe&&ie.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),oe&&ie.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();let n=Date.now();oe&&ie.log("Converting buffer to session"),await this.flushImmediate();let r=this.stopRecording();!t||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession(),sT(this.session.id)),this.startRecording())}addUpdate(t){let n=t();this.recordingMode==="buffer"||!this._isEnabled||n!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(t){if(!(t&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&sh(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){let t=`${je.location.pathname}${je.location.hash}${je.location.search}`,n=`${je.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(t,n){let r=this._throttledAddEvent(t,n);if(r===qT){let o=xr({category:"replay.throttled"});this.addUpdate(()=>!Th(this,{type:HM,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){let t=this.lastActiveSpan||Me(),n=t&&be(t),o=(n&&te(n).data||{})[vt];if(!(!n||!o||!["route","custom"].includes(o)))return te(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=TP({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&z()?.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode==="session"&&this.session&&sT(this.session.id)}_initializeSessionForSampling(t){let n=this._options.errorSampleRate>0,r=Hm({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;let t=this.session;return Yu(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"sessionExpired"}),this.initializeSampling(t.id))}_addListeners(){try{je.document.addEventListener("visibilitychange",this._handleVisibilityChange),je.addEventListener("blur",this._handleWindowBlur),je.addEventListener("focus",this._handleWindowFocus),je.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(TL(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=SP(this)}_removeListeners(){try{je.document.removeEventListener("visibilitychange",this._handleVisibilityChange),je.removeEventListener("blur",this._handleWindowBlur),je.removeEventListener("focus",this._handleWindowFocus),je.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){if(!this.session)return;if(Yu(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){Ku();return}t&&this._createCustomBreadcrumb(t),this.conditionalFlush()}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){oe&&ie.log("Document has become active, but session has expired");return}t&&this._createCustomBreadcrumb(t)}_updateUserActivity(t=Date.now()){this._lastActivity=t}_updateSessionActivity(t=Date.now()){this.session&&(this.session.lastActivity=t,this._maybeSaveSession())}_createCustomBreadcrumb(t){this.addUpdate(()=>{this.throttledAddEvent({type:ge.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=cP(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){let n=this._context.initialTimestamp/1e3;t=t.filter(r=>r.start>=n)}return Promise.all(id(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:t,eventBuffer:n}=this;if(!t||!n||this._requiresManualStart||t.segmentId)return;let r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){let t={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),t}async _runFlush(){let t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){oe&&ie.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!this.eventBuffer?.hasEvents&&(await IL(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Zu;let r=this._popEventContext(),o=this.session.segmentId++;this._maybeSaveSession();let i=await this.eventBuffer.finish();await VT({replayId:t,recordingData:i,segmentId:o,eventContext:r,session:this.session,timestamp:n,onError:s=>this.handleException(s)})}catch(n){this.handleException(n),this.stop({reason:"sendError"});let r=z();if(r){let o;n instanceof Il?o="ratelimit_backoff":n instanceof Zu?o="invalid":o="send_error",r.recordDroppedEvent(o,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){oe&&ie.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;let n=this.session.started,o=Date.now()-n;this._debouncedFlush.cancel();let i=o<this._options.minReplayDuration,s=o>this._options.maxReplayDuration+5e3;if(i||s){oe&&ie.log(`Session duration (${Math.floor(o/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}let a=this.eventBuffer;a&&this.session.segmentId===0&&!a.hasCheckout&&oe&&ie.log("Flushing initial segment without checkout.");let l=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(c){this.handleException(c)}finally{this._flushLock=void 0,l&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&od(this.session)}_onMutationHandler(t){let{ignoreMutations:n}=this._options._experiments;if(n?.length&&t.some(a=>{let l=AL(a.target),c=n.join(",");return l?.matches(c)}))return!1;let r=t.length,o=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,s=o&&r>o;if(r>i||s){let a=xr({category:"replay.mutations",data:{count:r,limit:s}});this._createCustomBreadcrumb(a)}return s?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}};function fl(e,t){return[...e,...t].join(",")}function FL({mask:e,unmask:t,block:n,unblock:r,ignore:o}){let i=["base","iframe[srcdoc]:not([src])"],s=fl(e,[".sentry-mask","[data-sentry-mask]"]),a=fl(t,[]);return{maskTextSelector:s,unmaskTextSelector:a,blockSelector:fl(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:fl(r,[]),ignoreSelector:fl(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function BL({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:o,value:i}){if(o.unmaskTextSelector&&e.matches(o.unmaskTextSelector))return i;let s=n.includes(t),a=r&&t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"");return s||a?i.replace(/[\S]/g,"*"):i}var lT='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',HL=["content-length","content-type","accept"],$L=Symbol.for("sentry__originalRequestBody"),cT=!1,uT=!1;function zL(){if(typeof Request>"u"||uT)return;let e=Request;try{let t=function(n,r){let o=new e(n,r);return r?.body!=null&&(o[$L]=r.body),o};t.prototype=e.prototype,V.Request=t,uT=!0}catch{}}var wh=(e=>new uh(e)),uh=class{constructor({flushMinDelay:t=C1,flushMaxDelay:n=R1,minReplayDuration:r=M1,maxReplayDuration:o=$E,stickySession:i=!0,useCompression:s=!0,workerUrl:a,_experiments:l={},maskAllText:c=!0,maskAllInputs:u=!0,blockAllMedia:d=!0,mutationBreadcrumbLimit:p=750,mutationLimit:h=1e4,slowClickTimeout:y=7e3,slowClickIgnoreSelectors:_=[],networkDetailAllowUrls:T=[],networkDetailDenyUrls:g=[],networkCaptureBodies:S=!0,networkRequestHeaders:E=[],networkResponseHeaders:R=[],mask:M=[],maskAttributes:A=["title","placeholder","aria-label"],unmask:I=[],block:N=[],unblock:U=[],ignore:x=[],maskFn:$,beforeAddRecordingEvent:W,beforeErrorSampling:ye,onError:K,attachRawBodyFromRequest:et=!1}={}){this.name="Replay";let pe=FL({mask:M,unmask:I,block:N,unblock:U,ignore:x});if(this._recordingOptions={maskAllInputs:u,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:$,maskInputFn:$,maskAttributeFn:(fe,D,Se)=>BL({maskAttributes:A,maskAllText:c,privacyOptions:pe,key:fe,value:D,el:Se}),...pe,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:fe=>{try{fe.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!l.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,P1),maxReplayDuration:Math.min(o,$E),stickySession:i,useCompression:s,workerUrl:a,blockAllMedia:d,maskAllInputs:u,maskAllText:c,mutationBreadcrumbLimit:p,mutationLimit:h,slowClickTimeout:y,slowClickIgnoreSelectors:_,networkDetailAllowUrls:T,networkDetailDenyUrls:g,networkCaptureBodies:S,networkRequestHeaders:dT(E),networkResponseHeaders:dT(R),beforeAddRecordingEvent:W,beforeErrorSampling:ye,onError:K,attachRawBodyFromRequest:et,_experiments:l},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${lT}`:lT,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&jn())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return cT}set _isInitialized(t){cT=t}afterAllSetup(t){!jn()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&zL(),this._setup(t),this._initialize(t))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session",reason:"manual"}):Promise.resolve()}flush(t){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(t):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(t){if(this._replay?.isEnabled())return this._replay.getSessionId(t)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}processSpan(t){let n=this.getReplayId(!0);n&&Io(t,{"sentry.replay_id":n})}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){let n=jL(this._initialOptions,t);this._replay=new ch({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{let n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}};function jL(e,t){let n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},o=Rn(n.replaysSessionSampleRate),i=Rn(n.replaysOnErrorSampleRate);return o==null&&i==null&&bt(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),i!=null&&(r.errorSampleRate=i),r}function dT(e){return[...HL,...e.map(t=>t.toLowerCase())]}function YT(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function Ch(e){try{return new URL(e,Q.location.origin).href}catch{return}}function KT(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function Rh(e){try{return new Headers(e)}catch{return}}var xh={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function XT(e,t){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:i,tracePropagationTargets:s,onRequestSpanStart:a,onRequestSpanEnd:l}={...xh,...t},c=typeof o=="function"?o:h=>!0,u=h=>GL(h,s),d={},p=e.getOptions().propagateTraceparent;n&&Co(h=>{let y=rm(h,c,u,d,{propagateTraceparent:p,onRequestSpanEnd:l});if(y){let _=Ch(h.fetchData.url),T=_?zn(_).host:void 0;y.setAttributes({"http.url":_?zt(_):void 0,"server.address":T}),i&&JT(y,e),a?.(y,{headers:h.headers})}}),r&&ll(h=>{let y=VL(h,c,u,d,p,l);y&&(i&&JT(y,e),a?.(y,{headers:Rh(h.xhr.__sentry_xhr_v3__?.request_headers)}))})}var WL=300;function JT(e,t){let{url:n}=te(e).data;if(!n||typeof n!="string")return;let r=()=>{setTimeout(o)};if(At(t)){let i=e.end.bind(e);e.end=s=>{let a=s??Ae(),l=!1,c=()=>{l||(l=!0,setTimeout(o),i(a),clearTimeout(u))};r=c;let u=setTimeout(c,WL)}}let o=lr("resource",({entries:i})=>{i.forEach(s=>{KT(s)&&s.name.endsWith(n)&&(e.setAttributes(il(s)),r())})})}function GL(e,t){let n=mn();if(n){let r,o;try{r=new URL(e,n),o=new URL(n).origin}catch{return!1}let i=r.origin===o;return t?kt(r.toString(),t)||i&&kt(r.pathname,t):i}else{let r=!!e.match(/^\/(?!\/)/);return t?kt(e,t):r}}function VL(e,t,n,r,o,i){let s=e.xhr,a=s?.[cr];if(!s||s.__sentry_own_request__||!a)return;let{url:l,method:c}=a,u=Et()&&t(l);if(e.endTimestamp){let S=s.__sentry_xhr_span_id__;if(!S)return;let E=r[S];E&&(u&&a.status_code!==void 0&&(ts(E,a.status_code),E.end(),i?.(E,{headers:Rh(cl(s)),error:e.error})),delete r[S]);return}let d=Ch(l),p=d?zn(d):zn(l),h=zt(Xc(l)),y=z(),T=!!Me()||!!y&&At(y),g=u&&T?wt({name:`${c} ${h}`,attributes:{url:zt(l),type:"xhr","http.method":c,"http.url":d?zt(d):void 0,"server.address":p?.host,[Ce]:"auto.http.browser",[Ye]:"http.client",...p?.search&&{"http.query":p?.search},...p?.hash&&{"http.fragment":p?.hash}}}):new Nt;return u&&!T&&y?.recordDroppedEvent("no_parent_span","span"),s.__sentry_xhr_span_id__=g.spanContext().spanId,r[s.__sentry_xhr_span_id__]=g,n(l)&&qL(s,Et()&&T?g:void 0,o),y&&y.emit("beforeOutgoingRequestSpan",g,e),g}function qL(e,t,n){let{"sentry-trace":r,baggage:o,traceparent:i}=ps({span:t,propagateTraceparent:n});r&&YL(e,r,o,i)}function YL(e,t,n,r){let o=e.__sentry_xhr_v3__?.request_headers;if(!(o?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!o?.traceparent&&e.setRequestHeader("traceparent",r),n){let i=o?.baggage;(!i||!YT(i))&&e.setRequestHeader("baggage",n)}}catch{}}var QT=new WeakMap,ZT=new WeakMap,KL=9e4,JL=["text/event-stream","application/x-ndjson","application/stream+json"],eI=()=>({name:"FetchStreamPerformance",setup(){uu(e=>{if(e.response){let t=QT.get(e.response);if(t&&e.endTimestamp){t.end(e.endTimestamp);let n=ZT.get(e.response);n&&clearTimeout(n)}}}),Co(e=>{if(e.endTimestamp&&e.response){let t=e.response.headers?.get("content-type")||"";if(e.response.headers?.get("content-length")||!JL.some(l=>t.startsWith(l)))return;let n=e.fetchData?.url||"",r=e.fetchData?.method||"GET",o=Tr(n),i=n.startsWith("data:")?zt(n):o?ls(o):n,s=wt({name:`${r} ${i}`,startTime:e.endTimestamp,attributes:{url:zt(n),"http.method":r,type:"fetch",[Ye]:"http.client.stream",[Ce]:"auto.http.browser.stream"}});QT.set(e.response,s);let a=setTimeout(()=>{s.isRecording()&&s.end()},KL);ZT.set(e.response,a)}})}});function tI(){Q.document?Q.document.addEventListener("visibilitychange",()=>{let e=Me();if(!e)return;let t=be(e);if(Q.document.hidden&&t){let n="cancelled",{op:r,status:o}=te(t);tt&&C.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||t.setStatus({code:2,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):tt&&C.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var XL=3600,nI="sentry_previous_trace",QL="sentry.previous_trace";function rI(e,{linkPreviousTrace:t,consistentTraceSampling:n}){let r=t==="session-storage",o=r?tO():void 0;e.on("spanStart",s=>{if(be(s)!==s)return;let a=ee().getPropagationContext();o=ZL(o,s,a),r&&eO(o)});let i=!0;n&&e.on("beforeSampling",s=>{if(!o)return;let a=ee(),l=a.getPropagationContext();if(i&&l.parentSpanId){i=!1;return}a.setPropagationContext({...l,dsc:{...l.dsc,sample_rate:String(o.sampleRate),sampled:String(bh(o.spanContext))},sampleRand:o.sampleRand}),s.parentSampled=bh(o.spanContext),s.parentSampleRate=o.sampleRate,s.spanAttributes={...s.spanAttributes,[Zi]:o.sampleRate}})}function ZL(e,t,n){let r=te(t);function o(){try{let a=Number(r.data?.[Br]??n.dsc?.sample_rate);return Number.isNaN(a)?0:a}catch{return 0}}let i={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:o(),sampleRand:n.sampleRand};if(!e)return i;let s=e.spanContext;return s.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=XL&&(tt&&C.log(`Adding previous_trace \`${JSON.stringify(s)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:s,attributes:{[Oc]:"previous_trace"}}),t.setAttribute(QL,`${s.traceId}-${s.spanId}-${bh(s)?1:0}`)),i)}function eO(e){try{Q.sessionStorage.setItem(nI,JSON.stringify(e))}catch(t){tt&&C.warn("Could not store previous trace in sessionStorage",t)}}function tO(){try{let e=Q.sessionStorage?.getItem(nI);return JSON.parse(e)}catch{return}}function bh(e){return e.traceFlags===1}var nO="BrowserTracing",rO=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function lI(){let e=Q.navigator;return e?.userAgent?rO.test(e.userAgent):!1}var oO={...as,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...xh},kh=((e={})=>{"enableElementTiming"in e&&bt(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});let t={name:void 0,source:void 0},n=Q.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:i,_experiments:{enableInteractions:s,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:l},beforeStartSpan:c,idleTimeout:u,finalTimeout:d,childSpanTimeout:p,markBackgroundSpan:h,traceFetch:y,traceXHR:_,trackFetchStreamPerformance:T,shouldCreateSpanForRequest:g,enableHTTPTimings:S,ignoreResourceSpans:E,ignorePerformanceApiSpans:R,instrumentPageLoad:M,instrumentNavigation:A,detectRedirects:I,linkPreviousTrace:N,consistentTraceSampling:U,enableReportPageLoaded:x,onRequestSpanStart:$,onRequestSpanEnd:W}={...oO,...e},ye=lI(),K,et,pe;function fe(D,Se,J=!0){let le=Se.op==="pageload",Ie=Se.name,_e=c?c(Se):Se,ut=_e.attributes||{};if(Ie!==_e.name&&(ut[vt]="custom",_e.attributes=ut),!J){let dt=un();wt({..._e,startTime:dt}).end(dt);return}t.name=_e.name,t.source=ut[vt];let Xe=Kc(_e,{idleTimeout:u,finalTimeout:d,childSpanTimeout:p,disableAutoFinish:le,beforeSpanEnd:dt=>{K?.();let an=At(D);Em(dt,{recordClsOnPageloadSpan:!an&&!a,recordLcpOnPageloadSpan:!an&&!l,ignoreResourceSpans:E,ignorePerformanceApiSpans:R,spanStreamingEnabled:an}),sI(D,void 0);let Tn=ee(),On=Tn.getPropagationContext();Tn.setPropagationContext({...On,traceId:Xe.spanContext().traceId,sampled:pn(Xe),dsc:ht(dt)}),le&&(pe=void 0)},trimIdleSpanEndTimestamp:!x});le&&x&&(pe=Xe),sI(D,Xe);function Yt(){n&&["interactive","complete"].includes(n.readyState)&&D.emit("idleSpanEnableAutoFinish",Xe)}le&&!x&&n&&(n.addEventListener("readystatechange",()=>{Yt()}),Yt())}return{name:nO,setup(D){if(ye){tt&&C.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}zc();let Se=At(D);if(K=ym({recordClsStandaloneSpans:Se?void 0:a||!1,recordLcpStandaloneSpans:Se?void 0:l||!1,client:D}),Se?(xm(D),bm(D),r&&km()):r&&wm(),i&&V.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?_m():o&&Sm(),s&&vm(),I&&n){let le=()=>{et=Ae()};addEventListener("click",le,{capture:!0}),addEventListener("keydown",le,{capture:!0,passive:!0})}function J(){let le=Rl(D);le&&!te(le).timestamp&&(tt&&C.log(`[Tracing] Finishing current active span with op: ${te(le).op}`),le.setAttribute(Hr,"cancelled"),le.end())}D.on("startNavigationSpan",(le,Ie)=>{if(z()!==D)return;if(Ie?.isRedirect){tt&&C.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),fe(D,{op:"navigation.redirect",...le},!1);return}et=void 0,J(),Qe().setPropagationContext({traceId:Xt(),sampleRand:Math.random(),propagationSpanId:Et()?void 0:Ht()});let _e=ee();_e.setPropagationContext({traceId:Xt(),sampleRand:Math.random(),propagationSpanId:Et()?void 0:Ht()}),_e.setSDKProcessingMetadata({normalizedRequest:void 0}),fe(D,{op:"navigation",...le,parentSpan:null,forceTransaction:!0})}),D.on("startPageLoadSpan",(le,Ie={})=>{if(z()!==D)return;J();let _e=Ie.sentryTrace||oI("sentry-trace")||iI("sentry-trace"),ut=Ie.baggage||oI("baggage")||iI("baggage"),Xe=Ep(_e,ut),Yt=ee();Yt.setPropagationContext(Xe),Et()||(Yt.getPropagationContext().propagationSpanId=Ht()),Yt.setSDKProcessingMetadata({normalizedRequest:gs()}),fe(D,{op:"pageload",...le})}),D.on("endPageloadSpan",()=>{x&&pe&&(pe.setAttribute(Hr,"reportPageLoaded"),pe.end())})},afterAllSetup(D){if(ye)return;let Se=mn();if(N!=="off"&&rI(D,{linkPreviousTrace:N,consistentTraceSampling:U}),Q.location){if(M){let J=$e();cI(D,{name:Q.location.pathname,startTime:J?J/1e3:void 0,attributes:{[vt]:"url",[Ce]:"auto.pageload.browser"}})}A&&Jr(({to:J,from:le})=>{if(le===void 0&&Se?.indexOf(J)!==-1){Se=void 0;return}Se=void 0;let Ie=Tr(J),_e=Rl(D),ut=_e&&I&&sO(_e,et);uI(D,{name:Ie?.pathname||Q.location.pathname,attributes:{[vt]:"url",[Ce]:"auto.navigation.browser"}},{url:J,isRedirect:ut})})}h&&tI(),s&&iO(D,u,d,p,t),r&&Cm(),XT(D,{traceFetch:y,traceXHR:_,tracePropagationTargets:D.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:g,enableHTTPTimings:S,onRequestSpanStart:$,onRequestSpanEnd:W}),T&&D.addIntegration(eI())}}});function cI(e,t,n){e.emit("startPageLoadSpan",t,n),ee().setTransactionName(t.name);let r=Rl(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function uI(e,t,n){let{url:r,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o}),e.emit("startNavigationSpan",t,{isRedirect:o});let i=ee();return i.setTransactionName(t.name),r&&!o&&i.setSDKProcessingMetadata({normalizedRequest:{...gs(),url:r}}),Rl(e)}function oI(e){return Q.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function iI(e){return Q.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===e)?.description}function iO(e,t,n,r,o){let i=Q.document,s,a=()=>{let l="ui.action.click",c=Rl(e);if(c){let u=te(c).op;if(["navigation","pageload"].includes(u)){tt&&C.warn(`[Tracing] Did not create ${l} span because a pageload or navigation span is in progress.`);return}}if(s&&(s.setAttribute(Hr,"interactionInterrupted"),s.end(),s=void 0),!o.name){tt&&C.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}s=Kc({name:o.name,op:l,attributes:{[vt]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",a,{capture:!0})}var dI="_sentry_idleSpan";function Rl(e){return e[dI]}function sI(e,t){qe(e,dI,t)}var aI=1.5;function sO(e,t){let n=te(e),r=un(),o=n.start_timestamp;return!(r-o>aI||t&&r-t<=aI)}var RI=In(Qr(),1);function CI(e){return Fn(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Oh(e){let t={...e};el(t,"react"),pi("react",{version:RI.version});let n=Om(t);return Xi(TO),n}function TO(e){return CI(e)?"[SyntheticEvent]":ul(e)}var xI=In(Qr(),1);function IO(e){let t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}function wO(e,t){let n=new WeakSet;function r(o,i){if(!n.has(o)){if(o.cause)return n.add(o),r(o.cause,i);o.cause=i}}r(e,t)}function bI(e,{componentStack:t},n){if(IO(xI.version)&&Un(e)&&t){let r=new Error(e.message);r.name=`React ErrorBoundary ${e.name}`,r.stack=t,wO(e,r)}return $n(r=>(r.setContext("react",{componentStack:t}),jr(e,n)))}var wi=In(Qr(),1);var kI=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Dh={componentStack:null,error:null,eventId:null},Ls=class extends wi.Component{constructor(t){super(t),this.state=Dh,this._openFallbackReportDialog=!0;let n=z();n&&t.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=n.on("afterSendEvent",r=>{!r.type&&this._lastEventId&&r.event_id===this._lastEventId&&Pu({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,n){let{componentStack:r}=n,{beforeCapture:o,onError:i,showDialog:s,dialogOptions:a}=this.props;$n(l=>{o&&o(l,t,r);let c=this.props.handled!=null?this.props.handled:!!this.props.fallback,u=bI(t,n,{mechanism:{handled:c,type:"auto.function.react.error_boundary"}});i&&i(t,r,u),s&&(this._lastEventId=u,this._openFallbackReportDialog&&Pu({...a,eventId:u})),this.setState({error:t,componentStack:r,eventId:u})})}componentDidMount(){let{onMount:t}=this.props;t&&t()}componentWillUnmount(){let{error:t,componentStack:n,eventId:r}=this.state,{onUnmount:o}=this.props;o&&(this.state===Dh?o(null,null,null):o(t,n,r)),this._cleanupHook&&(this._cleanupHook(),this._cleanupHook=void 0)}resetErrorBoundary(){let{onReset:t}=this.props,{error:n,componentStack:r,eventId:o}=this.state;t&&t(n,r,o),this.setState(Dh)}render(){let{fallback:t,children:n}=this.props,r=this.state;if(r.componentStack===null)return typeof n=="function"?n():n;let o=typeof t=="function"?wi.createElement(t,{error:r.error,componentStack:r.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:r.eventId}):t;return wi.isValidElement(o)?o:(t&&kI&&C.warn("fallback did not produce a valid ReactElement"),null)}};function Uh(e,t){if(e==null||e==="")return t;let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)&&n>=0&&n<=1?n:t}var Zr=window.__vidfarmSentry,AI=Zr?.dsn?.trim()||"";if(AI){let e=Zr?.environment?.trim()||"development",t=e==="production"?.1:1,n=e==="production"?.1:1,r=["localhost",window.location.origin,`${window.location.origin}/api`],o=Array.from(new Set([...r,...Zr?.tracePropagationTargets??[]].filter(Boolean)));Oh({dsn:AI,environment:e,release:Zr?.release?.trim()||void 0,integrations:[kh(),wh({maskAllText:!0,blockAllMedia:!0})],tracesSampleRate:Uh(Zr?.tracesSampleRate,t),tracePropagationTargets:o,replaysSessionSampleRate:Uh(Zr?.replaysSessionSampleRate,n),replaysOnErrorSampleRate:Uh(Zr?.replaysOnErrorSampleRate,1),enableLogs:Zr?.enableLogs??!0,sendDefaultPii:Zr?.sendDefaultPii??!0})}var Wi=In(Qr(),1),JR=In(Nf(),1),XR=In(XC(),1);var QC=e=>{let t,n=new Set,r=(c,u)=>{let d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){let p=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(h=>h(t,p))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(r,o,a);return a},Af=(e=>e?QC(e):QC);var _c=In(Qr(),1);var xU=e=>e;function ZC(e,t=xU){let n=_c.default.useSyncExternalStore(e.subscribe,_c.default.useCallback(()=>t(e.getState()),[e,t]),_c.default.useCallback(()=>t(e.getInitialState()),[e,t]));return _c.default.useDebugValue(n),n}var bU="[vidfarm]";function kU(e){if(e!=="debug")return!0;if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).has("debug")||window.localStorage?.getItem("VIDFARM_DEBUG")==="1"}catch{return!1}}function Qy(e,t,n){let r={event:t,detail:n,timestamp:new Date().toISOString()};typeof window<"u"&&(window.__VIDFARM_DEBUG_LOGS__=window.__VIDFARM_DEBUG_LOGS__??[],window.__VIDFARM_DEBUG_LOGS__.push(r),window.__VIDFARM_DEBUG_LOGS__.length>1e3&&window.__VIDFARM_DEBUG_LOGS__.splice(0,window.__VIDFARM_DEBUG_LOGS__.length-1e3)),kU(e)&&console[e==="debug"?"log":e](bU,t,n??"")}function Lr(e,t){Qy("info",e,t)}function eR(e,t){Qy("warn",e,t)}function uo(e,t){Qy("error",e,t)}function tR(){typeof window>"u"||window.__VIDFARM_DEBUG_HOOKS__||(window.__VIDFARM_DEBUG_HOOKS__=!0,Lr("boot.hooks-installed",{href:window.location.href,readyState:document.readyState,userAgent:navigator.userAgent}),window.addEventListener("error",e=>{uo("window.error",{message:e.message,filename:e.filename,lineno:e.lineno,colno:e.colno,error:e.error instanceof Error?e.error.stack:e.error})}),window.addEventListener("unhandledrejection",e=>{uo("window.unhandledrejection",{reason:e.reason instanceof Error?e.reason.stack:e.reason})}))}var NU="vidfarm:flockposter-cache:v1",AU="public",Mf={channels:[],posts:[],channelsUpdatedAt:null,calendarUpdatedAt:null,calendarRangeStart:null,calendarRangeEnd:null};function oR(e){return`${NU}_${e?.trim()||AU}`}function eS(e){if(typeof window>"u")return Mf;try{let t=window.localStorage.getItem(oR(e));if(!t)return Mf;let n=JSON.parse(t);return!n||typeof n!="object"?Mf:{channels:Array.isArray(n.channels)?n.channels:[],posts:Array.isArray(n.posts)?n.posts:[],channelsUpdatedAt:typeof n.channelsUpdatedAt=="string"?n.channelsUpdatedAt:null,calendarUpdatedAt:typeof n.calendarUpdatedAt=="string"?n.calendarUpdatedAt:null,calendarRangeStart:typeof n.calendarRangeStart=="string"?n.calendarRangeStart:null,calendarRangeEnd:typeof n.calendarRangeEnd=="string"?n.calendarRangeEnd:null}}catch{return Mf}}function nR(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(oR(t),JSON.stringify(e))}catch{}}function iR(e){let t=eS(e);return Af((n,r)=>({...t,setChannelsData:o=>{let i=r(),s={...i,channels:[...i.channels.filter(rR),...o.filter(a=>!rR(a))],channelsUpdatedAt:new Date().toISOString()};nR(s,e),n(s)},setCalendarData:o=>{let i=r(),s=MU([...i.channels,...o.channels]),a=o.replaceRange?PU(i.posts,o.posts,o.rangeStart,o.rangeEnd):Zy([...i.posts,...o.posts]),l={...i,channels:s,posts:a,channelsUpdatedAt:new Date().toISOString(),calendarUpdatedAt:new Date().toISOString(),calendarRangeStart:LU(i.calendarRangeStart,o.rangeStart),calendarRangeEnd:OU(i.calendarRangeEnd,o.rangeEnd)};nR(l,e),n(l)}}))}function MU(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function rR(e){return e.id.startsWith("email:")||e.platform?.toLowerCase()==="email"}function Zy(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function PU(e,t,n,r){let o=Date.parse(n),i=Date.parse(r);return Number.isNaN(o)||Number.isNaN(i)?Zy([...e,...t]):Zy([...e.filter(s=>{let a=Date.parse(s.scheduledAt);return Number.isNaN(a)||a<o||a>i}),...t])}function LU(e,t){return e?Date.parse(t)<Date.parse(e)?t:e:t}function OU(e,t){return e?Date.parse(t)>Date.parse(e)?t:e:t}function sR(e){return Af(t=>({boot:e,hydratedAt:null,setHydratedAt:n=>t({hydratedAt:n})}))}var k=In(Qr(),1),ji=In(Nf(),1);var f=In(vc(),1),Wf=1024*1024,PR=50*Wf,zU=2*Wf,jU=3*Wf,WU=Math.floor(3.5*Wf),GU=2048,LR="chat";function da(e){let t=e.id||e.attachment_id||e.file_id||"",n=e.fileName||e.file_name,r=e.contentType||e.content_type,o=e.viewUrl||e.view_url||"";return!t||!n||!r||!o?null:{id:t,fileName:n,contentType:r,viewUrl:o,sizeBytes:typeof e.sizeBytes=="number"?e.sizeBytes:e.size_bytes,folderPath:e.folderPath??e.folder_path??""}}function $f(e){return e.contentType.startsWith("image/")}function lS(e){return e.contentType.startsWith("video/")}var VU=new Set(["apng","avif","gif","jpeg","jpg","png","svg","webp"]),qU=new Set(["m4v","mov","mp4","mpeg","mpg","ogv","webm"]),uR=1200,tS=24,nS=80,YU=/^data:([^;,]+)[^,]*,/i,dR=/authorization|api[-_]?key|secret|token|vidfarm-api-key/i,KU=48e3,rS=14,JU=12e3,XU=1200,QU=30;function Uf(e){if(e==null||e==="")return"";if(typeof e=="string")try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}return JSON.stringify(e,null,2)}function Ff(e){let t=YU.exec(e);return t?`[${t[1]} data URL omitted, ${e.length.toLocaleString()} chars]`:e.length>uR?`${e.slice(0,uR)}\u2026 [truncated ${e.length.toLocaleString()} chars]`:e}function zi(e,t=0){if(e==null)return e;if(typeof e=="string")return Ff(e);if(typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return e.toString();if(!(typeof e=="function"||typeof e=="symbol")){if(t>=8)return"[nested payload omitted]";if(Array.isArray(e)){let n=e.slice(0,tS).map(r=>zi(r,t+1));return e.length>tS&&n.push(`[${e.length-tS} more items omitted]`),n}if(typeof e=="object"){let n={},r=Object.entries(e);for(let[o,i]of r.slice(0,nS)){let s=zi(i,t+1);s!==void 0&&(n[o]=s)}return r.length>nS&&(n.__omitted_keys=r.length-nS),n}return String(e)}}function OR(e){return zi(e)}function Ic(e){return{...e,request:{...e.request,headers:Object.fromEntries(Object.entries(e.request.headers).map(([t,n])=>[t,dR.test(t)?"[redacted]":Ff(n)])),body:zi(e.request.body)},result:{...e.result,headers:Object.fromEntries(Object.entries(e.result.headers).map(([t,n])=>[t,dR.test(t)?"[redacted]":Ff(n)])),body:zi(e.result.body),error:e.result.error?Ff(e.result.error):e.result.error}}}function ZU(){let e=new Date,t=null,n=null;try{t=new Intl.DateTimeFormat(void 0,{dateStyle:"full",timeStyle:"long"}).format(e)}catch{t=e.toString()}try{n=Intl.DateTimeFormat().resolvedOptions().timeZone||null}catch{n=null}return{currentDateTime:e.toISOString(),localDateTime:t,timeZone:n}}function DR(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function oS(e){let t=DR(e);return t=t.replace(/`([^`]+)`/g,"<code>$1</code>"),t=t.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),t=t.replace(/(^|[^\*])\*([^*]+)\*(?!\*)/g,"$1<em>$2</em>"),t=t.replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'),t=t.replace(/(^|[\s(])(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/g,'$1<a href="$2" target="_blank" rel="noopener noreferrer">$2</a>'),t}function UR(e){let t=e.replace(/\r\n/g,`
|
|
32
|
-
`).trim();return t?t.split(/\n{2,}/).map(r=>{let o=r.trim();if(!o)return"";if(o.startsWith("```")&&o.endsWith("```")){let l=o.replace(/^```[^\n]*\n?/,"").replace(/\n?```$/,"");return`<pre><code>${
|
|
33
|
-
`);return i.every(l=>/^[-*]\s+/.test(l.trim()))?`<ul>${i.map(c=>c.trim().replace(/^[-*]\s+/,"")).map(c=>`<li>${
|
|
30
|
+
or you can use record.mirror to access the mirror instance during recording.`,KE={map:{},getId(){return console.error(Rs),-1},getNode(){return console.error(Rs),null},removeNodeFromMap(){console.error(Rs)},has(){return console.error(Rs),!1},reset(){console.error(Rs)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(KE=new Proxy(KE,{get(e,t,n){return t==="map"&&console.error(Rs),Reflect.get(e,t,n)}}));function vl(e,t,n={}){let r=null,o=0;return function(...i){let s=Date.now();!o&&n.leading===!1&&(o=s);let a=t-(s-o),l=this;a<=0||a>t?(r&&(TM(r),r=null),o=s,e.apply(l,i)):!r&&n.trailing!==!1&&(r=od(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(l,i)},a))}}function ET(e,t,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(s){od(()=>{n.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>ET(e,t,i||{},!0)}function Sh(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}var Gu=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Gu=()=>new Date().getTime());function TT(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0}}function IT(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function wT(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function CT(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Nn(e,t,n,r,o){if(!e)return!1;let i=CT(e);if(!i)return!1;let s=ks(t,n);if(!o){let c=r&&i.matches(r);return s(i)&&!c}let a=wi(i,s),l=-1;return a<0?!1:(r&&(l=wi(i,ks(null,r))),a>-1&&l<0?!0:a<l)}function yM(e,t){return t.getId(e)!==-1}function Fm(e,t){return t.getId(e)===_l}function RT(e,t){if(hl(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?RT(e.parentNode,t):!0:!0}function Gm(e){return!!e.changedTouches}function SM(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function xT(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function bT(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Vm(e){return!!e?.shadowRoot}var qm=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function kT(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function _M(e){let t=e,n;for(;n=kT(t);)t=n;return t}function vM(e){let t=e.ownerDocument;if(!t)return!1;let n=_M(e);return t.contains(n)}function NT(e){let t=e.ownerDocument;return t?t.contains(e)||vM(e):!1}var JE={};function _h(e){let t=JE[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement=="function")try{let o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);let i=o.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(o)}catch{}return JE[e]=r.bind(window)}function EM(...e){return _h("requestAnimationFrame")(...e)}function od(...e){return _h("setTimeout")(...e)}function TM(...e){return _h("clearTimeout")(...e)}var me=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(me||{}),se=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(se||{}),nn=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(nn||{}),Zr=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Zr||{}),xs=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(xs||{}),yl;function IM(e){yl=e}function wM(){yl=void 0}var Ce=e=>yl?((...n)=>{try{return e(...n)}catch(r){if(yl&&yl(r)===!0)return()=>{};throw r}}):e,XE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",CM=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(pl=0;pl<XE.length;pl++)CM[XE.charCodeAt(pl)]=pl;var pl,Vu=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function vh(e){try{return e.contentDocument}catch{}}function El(e){try{return e.contentWindow}catch{}}var Ym=class{constructor(t){this.doc=t,this.unattachedDoc=null}parse(t){return this.parseWithConstructableStylesheet(t)||this.parseWithDetachedElement(t)}parseWithConstructableStylesheet(t){if(typeof CSSStyleSheet>"u"||typeof CSSStyleSheet.prototype.replaceSync!="function")return null;try{let n=new CSSStyleSheet;n.replaceSync(`x { ${t} }`);let r=n.cssRules[0];return!r||r.type!==CSSRule.STYLE_RULE?null:r.style}catch{return null}}parseWithDetachedElement(t){let n=this.getUnattachedDoc().createElement("span");return n.setAttribute("style",t),n.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}return this.unattachedDoc}};function QE(e){return"__ln"in e}var Km=class{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){let n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&QE(t.previousSibling)){let r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&QE(t.nextSibling)&&t.nextSibling.__ln.previous){let r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){let n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},ZE=(e,t)=>`${e}@${t}`,Jm=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let t=[],n=new Set,r=new Km,o=l=>{let c=l,u=_l;for(;u===_l;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},i=l=>{if(!l.parentNode||!NT(l))return;let c=hl(l.parentNode)?this.mirror.getId(kT(l)):this.mirror.getId(l.parentNode),u=o(l);if(c===-1||u===-1)return r.addNode(l);let f=Ns(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:p=>{xT(p,this.mirror)&&!Nn(p,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(p),bT(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Vm(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,this.doc)},onIframeLoad:(p,h)=>{if(Nn(p,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(p,h);let y=El(p);y&&this.canvasManager.addWindow(y),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,h)=>{this.stylesheetManager.attachLinkElement(p,h)},onBlockedImageLoad:(p,h,{width:y,height:_})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:h.id,attributes:{style:{width:`${y}px`,height:`${_}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});f&&(t.push({parentId:c,nextId:u,node:f}),n.add(f.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)eT(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||i(l);for(let l of this.addedSet)!tT(this.droppedSet,l)&&!eT(this.removes,l,this.mirror)||tT(this.movedSet,l)?i(l):this.droppedSet.add(l);let s=null;for(;r.length;){let l=null;if(s){let c=this.mirror.getId(s.value.parentNode),u=o(s.value);c!==-1&&u!==-1&&(l=s)}if(!l){let c=r.tail;for(;c;){let u=c;if(c=c.previous,u){let f=this.mirror.getId(u.value.parentNode);if(o(u.value)===-1)continue;if(f!==-1){l=u;break}else{let h=u.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let y=h.parentNode.host;if(this.mirror.getId(y)!==-1){l=u;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}s=l.previous,r.removeNode(l.value),i(l.value)}let a={texts:this.texts.map(l=>({id:this.mirror.getId(l.node),value:l.value})).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{let{attributes:c}=l;if(typeof c.style=="string"){let u=JSON.stringify(l.styleDiff),f=JSON.stringify(l._unchangedStyles);u.length<c.style.length&&(u+f).split("var(").length===c.style.split("var(").length&&(c.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:c}}).filter(l=>!n.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!Fm(t.target,this.mirror))switch(t.type){case"characterData":{let n=t.target.textContent;!Nn(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:Ps(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,CT(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{let n=t.target,r=t.attributeName,o=t.target.getAttribute(r);if(r==="value"){let s=gh(n),a=n.tagName;o=ju(n,a,s);let l=nd({maskInputOptions:this.maskInputOptions,tagName:a,type:s}),c=Ps(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,l);o=Sl({isMasked:c,element:n,value:o,maskInputFn:this.maskInputFn})}if(Nn(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||o===t.oldValue)return;let i=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(o))if(!vh(n))r="rr_src";else return;if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!vT(n.tagName,r)&&(i.attributes[r]=_T(this.doc,Ms(n.tagName),Ms(r),o,n,this.maskAttributeFn),r==="style")){let s=t.oldValue?this.styleDeclarationParser.parse(t.oldValue):null;for(let a of Array.from(n.style)){let l=n.style.getPropertyValue(a),c=n.style.getPropertyPriority(a);l!==(s?.getPropertyValue(a)||"")||c!==(s?.getPropertyPriority(a)||"")?c===""?i.styleDiff[a]=l:i.styleDiff[a]=[l,c]:i._unchangedStyles[a]=[l,c]}if(s)for(let a of Array.from(s))n.style.getPropertyValue(a)===""&&(i.styleDiff[a]=!1)}break}case"childList":{if(Nn(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{let r=this.mirror.getId(n),o=hl(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);Nn(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Fm(n,this.mirror)||!yM(n,this.mirror)||(this.addedSet.has(n)?(Xm(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||RT(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[ZE(r,o)]?Xm(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:hl(t.target)&&gl(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Fm(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[ZE(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Nn(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),Vm(t)&&t.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,t)}))}}}init(t){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","ignoreCSSAttributes"].forEach(n=>{this[n]=t[n]}),this.styleDeclarationParser=new Ym(this.doc)}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function Xm(e,t){e.delete(t),t.childNodes?.forEach(n=>Xm(e,n))}function eT(e,t,n){return e.length===0?!1:RM(e,t,n)}function RM(e,t,n){let r=t.parentNode;for(;r;){let o=n.getId(r);if(e.some(i=>i.id===o))return!0;r=r.parentNode}return!1}function tT(e,t){return e.size===0?!1:AT(e,t)}function AT(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:AT(e,n):!1}var As=[];function Rl(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function MT(e,t){let n=new Jm;As.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver,o=window?.Zone?.__symbol__?.("MutationObserver");o&&window[o]&&(r=window[o]);let i=new r(Ce(s=>{e.onMutation&&e.onMutation(s)===!1||n.processMutations.bind(n)(s)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function xM({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],a,l=vl(Ce(f=>{let p=Date.now()-a;e(s.map(h=>(h.timeOffset-=p,h)),f),s=[],a=null}),i),c=Ce(vl(Ce(f=>{let p=Rl(f),{clientX:h,clientY:y}=Gm(f)?f.changedTouches[0]:f;a||(a=Gu()),s.push({x:h,y,id:r.getId(p),timeOffset:Gu()-a}),l(typeof DragEvent<"u"&&f instanceof DragEvent?se.Drag:f instanceof MouseEvent?se.MouseMove:se.TouchMove)}),o,{trailing:!1})),u=[rn("mousemove",c,n),rn("touchmove",c,n),rn("drag",c,n)];return Ce(()=>{u.forEach(f=>f())})}function bM({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:s}){if(s.mouseInteraction===!1)return()=>{};let a=s.mouseInteraction===!0||s.mouseInteraction===void 0?{}:s.mouseInteraction,l=[],c=null,u=f=>p=>{let h=Rl(p);if(Nn(h,r,o,i,!0))return;let y=null,_=f;if("pointerType"in p){switch(p.pointerType){case"mouse":y=Zr.Mouse;break;case"touch":y=Zr.Touch;break;case"pen":y=Zr.Pen;break}y===Zr.Touch?nn[f]===nn.MouseDown?_="TouchStart":nn[f]===nn.MouseUp&&(_="TouchEnd"):Zr.Pen}else Gm(p)&&(y=Zr.Touch);y!==null?(c=y,(_.startsWith("Touch")&&y===Zr.Touch||_.startsWith("Mouse")&&y===Zr.Mouse)&&(y=null)):nn[f]===nn.Click&&(y=c,c=null);let T=Gm(p)?p.changedTouches[0]:p;if(!T)return;let g=n.getId(h),{clientX:S,clientY:E}=T;Ce(e)({type:nn[_],id:g,x:S,y:E,...y!==null&&{pointerType:y}})};return Object.keys(nn).filter(f=>Number.isNaN(Number(f))&&!f.endsWith("_Departed")&&a[f]!==!1).forEach(f=>{let p=Ms(f),h=u(f);if(window.PointerEvent)switch(nn[f]){case nn.MouseDown:case nn.MouseUp:p=p.replace("mouse","pointer");break;case nn.TouchStart:case nn.TouchEnd:return}l.push(rn(p,h,t))}),Ce(()=>{l.forEach(f=>f())})}function PT({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:s}){let a=Ce(vl(Ce(l=>{let c=Rl(l);if(!c||Nn(c,r,o,i,!0))return;let u=n.getId(c);if(c===t&&t.defaultView){let f=TT(t.defaultView);e({id:u,x:f.left,y:f.top})}else e({id:u,x:c.scrollLeft,y:c.scrollTop})}),s.scroll||100));return rn("scroll",a,t)}function kM({viewportResizeCb:e},{win:t}){let n=-1,r=-1,o=Ce(vl(Ce(()=>{let i=IT(),s=wT();(n!==i||r!==s)&&(e({width:Number(s),height:Number(i)}),n=i,r=s)}),200));return rn("resize",o,t)}var NM=["INPUT","TEXTAREA","SELECT"],nT=new WeakMap;function AM({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:c,sampling:u,userTriggeredOnInput:f,maskTextClass:p,unmaskTextClass:h,maskTextSelector:y,unmaskTextSelector:_}){function T(I){let N=Rl(I),U=I.isTrusted,x=N&&jm(N.tagName);if(x==="OPTION"&&(N=N.parentElement),!N||!x||NM.indexOf(x)<0||Nn(N,r,o,i,!0))return;let H=N;if(H.classList.contains(s)||a&&H.matches(a))return;let j=gh(N),ge=ju(H,x,j),X=!1,Ze=nd({maskInputOptions:l,tagName:x,type:j}),fe=Ps(N,p,y,h,_,Ze);(j==="radio"||j==="checkbox")&&(X=N.checked),ge=Sl({isMasked:fe,element:N,value:ge,maskInputFn:c}),g(N,f?{text:ge,isChecked:X,userTriggered:U}:{text:ge,isChecked:X});let de=N.name;j==="radio"&&de&&X&&t.querySelectorAll(`input[type="radio"][name="${de}"]`).forEach(D=>{if(D!==N){let ye=Sl({isMasked:fe,element:D,value:ju(D,x,j),maskInputFn:c});g(D,f?{text:ye,isChecked:!X,userTriggered:!1}:{text:ye,isChecked:!X})}})}function g(I,N){let U=nT.get(I);if(!U||U.text!==N.text||U.isChecked!==N.isChecked){nT.set(I,N);let x=n.getId(I);Ce(e)({...N,id:x})}}let E=(u.input==="last"?["change"]:["input","change"]).map(I=>rn(I,Ce(T),t)),R=t.defaultView;if(!R)return()=>{E.forEach(I=>I())};let M=R.Object.getOwnPropertyDescriptor(R.HTMLInputElement.prototype,"value"),A=[[R.HTMLInputElement.prototype,"value"],[R.HTMLInputElement.prototype,"checked"],[R.HTMLSelectElement.prototype,"value"],[R.HTMLTextAreaElement.prototype,"value"],[R.HTMLSelectElement.prototype,"selectedIndex"],[R.HTMLOptionElement.prototype,"selected"]];return M&&M.set&&E.push(...A.map(I=>ET(I[0],I[1],{set(){Ce(T)({target:this,isTrusted:!1})}},!1,R))),Ce(()=>{E.forEach(I=>I())})}function qu(e){let t=[];function n(r,o){if(Uu("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Uu("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Uu("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Uu("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let s=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(s)}else if(r.parentStyleSheet){let s=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(s)}return o}return n(e,t)}function bo(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function MM({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ce((u,f,p)=>{let[h,y]=p,{id:_,styleId:T}=bo(f,t,n.styleMirror);return(_&&_!==-1||T&&T!==-1)&&e({id:_,styleId:T,adds:[{rule:h,index:y}]}),u.apply(f,p)})});let i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Ce((u,f,p)=>{let[h]=p,{id:y,styleId:_}=bo(f,t,n.styleMirror);return(y&&y!==-1||_&&_!==-1)&&e({id:y,styleId:_,removes:[{index:h}]}),u.apply(f,p)})});let s;r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Ce((u,f,p)=>{let[h]=p,{id:y,styleId:_}=bo(f,t,n.styleMirror);return(y&&y!==-1||_&&_!==-1)&&e({id:y,styleId:_,replace:h}),u.apply(f,p)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Ce((u,f,p)=>{let[h]=p,{id:y,styleId:_}=bo(f,t,n.styleMirror);return(y&&y!==-1||_&&_!==-1)&&e({id:y,styleId:_,replaceSync:h}),u.apply(f,p)})}));let l={};Fu("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Fu("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Fu("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Fu("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));let c={};return Object.entries(l).forEach(([u,f])=>{c[u]={insertRule:f.prototype.insertRule,deleteRule:f.prototype.deleteRule},f.prototype.insertRule=new Proxy(c[u].insertRule,{apply:Ce((p,h,y)=>{let[_,T]=y,{id:g,styleId:S}=bo(h.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,adds:[{rule:_,index:[...qu(h),T||0]}]}),p.apply(h,y)})}),f.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:Ce((p,h,y)=>{let[_]=y,{id:T,styleId:g}=bo(h.parentStyleSheet,t,n.styleMirror);return(T&&T!==-1||g&&g!==-1)&&e({id:T,styleId:g,removes:[{index:[...qu(h),_]}]}),p.apply(h,y)})})}),Ce(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([u,f])=>{f.prototype.insertRule=c[u].insertRule,f.prototype.deleteRule=c[u].deleteRule})})}function LT({mirror:e,stylesheetManager:t},n){let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);let o=n.nodeName==="#document"?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,i=o?.prototype?Object.getOwnPropertyDescriptor(o?.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!o||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return i.get?.call(this)},set(s){let a=i.set?.call(this,s);if(r!==null&&r!==-1)try{t.adoptStyleSheets(s,r)}catch{}return a}}),Ce(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function PM({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Ce((a,l,c)=>{let[u,f,p]=c;if(n.has(u))return i.apply(l,[u,f,p]);let{id:h,styleId:y}=bo(l.parentRule?.parentStyleSheet,t,r.styleMirror);return(h&&h!==-1||y&&y!==-1)&&e({id:h,styleId:y,set:{property:u,value:f,priority:p},index:qu(l.parentRule)}),a.apply(l,c)})});let s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Ce((a,l,c)=>{let[u]=c;if(n.has(u))return s.apply(l,[u]);let{id:f,styleId:p}=bo(l.parentRule?.parentStyleSheet,t,r.styleMirror);return(f&&f!==-1||p&&p!==-1)&&e({id:f,styleId:p,remove:{property:u},index:qu(l.parentRule)}),a.apply(l,c)})}),Ce(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s})}function LM({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:o,sampling:i,doc:s}){let a=Ce(c=>vl(Ce(u=>{let f=Rl(u);if(!f||Nn(f,t,n,r,!0))return;let{currentTime:p,volume:h,muted:y,playbackRate:_}=f;e({type:c,id:o.getId(f),currentTime:p,volume:h,muted:y,playbackRate:_})}),i.media||500)),l=[rn("play",a(xs.Play),s),rn("pause",a(xs.Pause),s),rn("seeked",a(xs.Seeked),s),rn("volumechange",a(xs.VolumeChange),s),rn("ratechange",a(xs.RateChange),s)];return Ce(()=>{l.forEach(c=>c())})}function OM({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(l,c,u){let f=new i(l,c,u);return o.set(f,{family:l,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),f};let s=Sh(t.fonts,"add",function(a){return function(l){return od(Ce(()=>{let c=o.get(l);c&&(e(c),o.delete(l))}),0),a.apply(this,[l])}});return r.push(()=>{n.FontFace=i}),r.push(s),Ce(()=>{r.forEach(a=>a())})}function DM(e){let{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,selectionCb:s}=e,a=!0,l=Ce(()=>{let c=t.getSelection();if(!c||a&&c?.isCollapsed)return;a=c.isCollapsed||!1;let u=[],f=c.rangeCount||0;for(let p=0;p<f;p++){let h=c.getRangeAt(p),{startContainer:y,startOffset:_,endContainer:T,endOffset:g}=h;Nn(y,r,o,i,!0)||Nn(T,r,o,i,!0)||u.push({start:n.getId(y),startOffset:_,end:n.getId(T),endOffset:g})}s({ranges:u})});return l(),rn("selectionchange",l)}function UM({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:Sh(n.customElements,"define",function(o){return function(i,s,a){try{t({define:{name:i}})}catch{}return o.apply(this,[i,s,a])}})}function FM(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=MT(e,e.doc));let o=xM(e),i=bM(e),s=PT(e),a=kM(e,{win:n}),l=AM(e),c=LM(e),u=()=>{},f=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(u=MM(e,{win:n}),f=LT(e,e.doc),p=PM(e,{win:n}),e.collectFonts&&(h=OM(e)));let y=DM(e),_=UM(e),T=[];for(let g of e.plugins)T.push(g.observer(g.callback,n,g.options));return Ce(()=>{As.forEach(g=>g.reset()),r?.disconnect(),o(),i(),s(),a(),l(),c(),u(),f(),p(),h(),y(),_(),T.forEach(g=>g())})}function Uu(e){return typeof window[e]<"u"}function Fu(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var Tl=class{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,o){let i=r||this.getIdToRemoteIdMap(t),s=o||this.getRemoteIdToIdMap(t),a=i.get(n);return a||(a=this.generateIdFn(),i.set(n,a),s.set(a,n)),a}getIds(t,n){let r=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,o))}getRemoteId(t,n,r){let o=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;let i=o.get(n);return i||-1}getRemoteIds(t,n){let r=this.getRemoteIdToIdMap(t);return n.map(o=>this.getRemoteId(t,o,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}},Qm=class{constructor(){this.crossOriginIframeMirror=new Tl(yh),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},Zm=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Tl(yh),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Tl(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0);let n=El(t);n&&this.crossOriginIframeMap.set(n,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&El(t)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(t);let r=vh(t);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(t){let n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;let o=this.crossOriginIframeMap.get(t.source);if(!o)return;let i=this.transformCrossOriginEvent(o,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(t,n){switch(n.type){case me.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);let r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:me.IncrementalSnapshot,data:{source:se.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case me.Meta:case me.Load:case me.DomContentLoaded:return!1;case me.Plugin:return n;case me.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case me.IncrementalSnapshot:switch(n.data.source){case se.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(r.node,o)}),n.data.removes.forEach(r=>{this.replaceIds(r,t,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,t,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case se.Drag:case se.TouchMove:case se.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case se.ViewportResize:return!1;case se.MediaInteraction:case se.MouseInteraction:case se.Scroll:case se.CanvasMutation:case se.Input:return this.replaceIds(n.data,t,["id"]),n;case se.StyleSheetRule:case se.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case se.Font:return n;case se.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case se.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),n.data.styles?.forEach(r=>{this.replaceStyleIds(r,t,["styleId"])}),n}}return!1}replace(t,n,r,o){for(let i of o)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==gt.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},eh=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},th=class{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,n){if(!gl(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);let r=MT({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(PT({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),od(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(LT({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){let n=vh(t),r=El(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){let r=this;this.restoreHandlers.push(Sh(t.prototype,"attachShadow",function(o){return function(i){let s=o.call(this,i);return this.shadowRoot&&NT(this)&&r.addShadowRoot(this.shadowRoot,n),s}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}},nh=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new qm,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;let r={id:n,styleIds:[]},o=[];for(let i of t){let s;this.styleMirror.has(i)?s=this.styleMirror.getId(i):(s=this.styleMirror.add(i),o.push({styleId:s,rules:Array.from(i.rules||CSSRule,(a,l)=>({rule:mT(a),index:l}))})),r.styleIds.push(s)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},rh=class{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){let r=this.nodeMap.get(t);return r&&Array.from(r).some(o=>o!==n)}add(t,n){this.active||(this.active=!0,EM(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}},lt,Yu;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var dr=G1();function fr(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,unblockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskAllText:c=!1,maskTextClass:u="rr-mask",unmaskTextClass:f=null,maskTextSelector:p=null,unmaskTextSelector:h=null,inlineStylesheet:y=!0,maskAllInputs:_,maskInputOptions:T,slimDOMOptions:g,maskAttributeFn:S,maskInputFn:E,maskTextFn:R,maxCanvasSize:M=null,packFn:A,sampling:I={},dataURLOptions:N={},mousemoveWait:U,recordDOM:x=!0,recordCanvas:H=!1,recordCrossOriginIframes:j=!1,recordAfter:ge=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:X=!1,collectFonts:Ze=!1,inlineImages:fe=!1,plugins:de,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:ye=new Set([]),errorHandler:Q,onMutation:ae,getCanvasManager:Re}=e;IM(Q);let Te=j?window.parent===window:!0,St=!1;if(!Te)try{window.parent.document&&(St=!1)}catch{St=!0}if(Te&&!t)throw new Error("emit function is required");if(!Te&&!St)return()=>{};U!==void 0&&I.mousemove===void 0&&(I.mousemove=U),dr.reset();let ot=_===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:T!==void 0?T:{},bt=g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:g==="all",headMetaDescKeywords:g==="all"}:g||{};SM();let it,In=0,Dt=J=>{for(let $e of de||[])$e.eventProcessor&&(J=$e.eventProcessor(J));return A&&!St&&(J=A(J)),J};lt=(J,$e)=>{let he=J;if(he.timestamp=Gu(),As[0]?.isFrozen()&&he.type!==me.FullSnapshot&&!(he.type===me.IncrementalSnapshot&&he.data.source===se.Mutation)&&As.forEach(Je=>Je.unfreeze()),Te)t?.(Dt(he),$e);else if(St){let Je={type:"rrweb",event:Dt(he),origin:window.location.origin,isCheckout:$e};window.parent.postMessage(Je,"*")}if(he.type===me.FullSnapshot)it=he,In=0;else if(he.type===me.IncrementalSnapshot){if(he.data.source===se.Mutation&&he.data.isAttachIframe)return;In++;let Je=r&&In>=r,Se=n&&it&&he.timestamp-it.timestamp>n;(Je||Se)&&dt(!0)}};let wn=J=>{lt({type:me.IncrementalSnapshot,data:{source:se.Mutation,...J}})},nr=J=>lt({type:me.IncrementalSnapshot,data:{source:se.Scroll,...J}}),Vi=J=>lt({type:me.IncrementalSnapshot,data:{source:se.CanvasMutation,...J}}),Zo=J=>lt({type:me.IncrementalSnapshot,data:{source:se.AdoptedStyleSheet,...J}}),P=new nh({mutationCb:wn,adoptedStyleSheetCb:Zo}),V=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Qm:new Zm({mirror:dr,mutationCb:wn,stylesheetManager:P,recordCrossOriginIframes:j,wrappedEmit:lt});for(let J of de||[])J.getMirror&&J.getMirror({nodeMirror:dr,crossOriginIframeMirror:V.crossOriginIframeMirror,crossOriginIframeStyleMirror:V.crossOriginIframeStyleMirror});let ie=new rh,Y=HM(Re,{mirror:dr,win:window,mutationCb:J=>lt({type:me.IncrementalSnapshot,data:{source:se.CanvasMutation,...J}}),recordCanvas:H,blockClass:o,blockSelector:i,unblockSelector:s,maxCanvasSize:M,sampling:I.canvas,dataURLOptions:N,errorHandler:Q}),Ie=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new eh:new th({mutationCb:wn,scrollCb:nr,bypassOptions:{onMutation:ae,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:c,maskTextClass:u,unmaskTextClass:f,maskTextSelector:p,unmaskTextSelector:h,inlineStylesheet:y,maskInputOptions:ot,dataURLOptions:N,maskAttributeFn:S,maskTextFn:R,maskInputFn:E,recordCanvas:H,inlineImages:fe,sampling:I,slimDOMOptions:bt,iframeManager:V,stylesheetManager:P,canvasManager:Y,keepIframeSrcFn:D,processedNodeManager:ie,ignoreCSSAttributes:ye},mirror:dr}),dt=(J=!1)=>{if(!x)return;lt({type:me.Meta,data:{href:window.location.href,width:wT(),height:IT()}},J),P.reset(),Ie.init(),As.forEach(he=>he.lock());let $e=gM(document,{mirror:dr,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:c,maskTextClass:u,unmaskTextClass:f,maskTextSelector:p,unmaskTextSelector:h,inlineStylesheet:y,maskAllInputs:ot,maskAttributeFn:S,maskInputFn:E,maskTextFn:R,slimDOM:bt,dataURLOptions:N,recordCanvas:H,inlineImages:fe,onSerialize:he=>{xT(he,dr)&&V.addIframe(he),bT(he,dr)&&P.trackLinkElement(he),Vm(he)&&Ie.addShadowRoot(he.shadowRoot,document)},onIframeLoad:(he,Je)=>{V.attachIframe(he,Je);let Se=El(he);Se&&Y.addWindow(Se),Ie.observeAttachShadow(he)},onStylesheetLoad:(he,Je)=>{P.attachLinkElement(he,Je)},onBlockedImageLoad:(he,Je,{width:Se,height:Ur})=>{wn({adds:[],removes:[],texts:[],attributes:[{id:Je.id,attributes:{style:{width:`${Se}px`,height:`${Ur}px`}}}]})},keepIframeSrcFn:D,ignoreCSSAttributes:ye});if(!$e)return console.warn("Failed to snapshot the document");lt({type:me.FullSnapshot,data:{node:$e,initialOffset:TT(window)}}),As.forEach(he=>he.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&P.adoptStyleSheets(document.adoptedStyleSheets,dr.getId(document))};Yu=dt;try{let J=[],$e=Je=>Ce(FM)({onMutation:ae,mutationCb:wn,mousemoveCb:(Se,Ur)=>lt({type:me.IncrementalSnapshot,data:{source:Ur,positions:Se}}),mouseInteractionCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.MouseInteraction,...Se}}),scrollCb:nr,viewportResizeCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.ViewportResize,...Se}}),inputCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.Input,...Se}}),mediaInteractionCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.MediaInteraction,...Se}}),styleSheetRuleCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.StyleSheetRule,...Se}}),styleDeclarationCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.StyleDeclaration,...Se}}),canvasMutationCb:Vi,fontCb:Se=>lt({type:me.IncrementalSnapshot,data:{source:se.Font,...Se}}),selectionCb:Se=>{lt({type:me.IncrementalSnapshot,data:{source:se.Selection,...Se}})},customElementCb:Se=>{lt({type:me.IncrementalSnapshot,data:{source:se.CustomElement,...Se}})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskAllText:c,maskTextClass:u,unmaskTextClass:f,maskTextSelector:p,unmaskTextSelector:h,maskInputOptions:ot,inlineStylesheet:y,sampling:I,recordDOM:x,recordCanvas:H,inlineImages:fe,userTriggeredOnInput:X,collectFonts:Ze,doc:Je,maskAttributeFn:S,maskInputFn:E,maskTextFn:R,keepIframeSrcFn:D,blockSelector:i,unblockSelector:s,slimDOMOptions:bt,dataURLOptions:N,mirror:dr,iframeManager:V,stylesheetManager:P,shadowDomManager:Ie,processedNodeManager:ie,canvasManager:Y,ignoreCSSAttributes:ye,plugins:de?.filter(Se=>Se.observer)?.map(Se=>({observer:Se.observer,options:Se.options,callback:Ur=>lt({type:me.Plugin,data:{plugin:Se.name,payload:Ur}})}))||[]},{});V.addLoadListener(Je=>{try{J.push($e(Je.contentDocument))}catch(Se){console.warn(Se)}});let he=()=>{dt(),J.push($e(document))};return document.readyState==="interactive"||document.readyState==="complete"?he():(J.push(rn("DOMContentLoaded",()=>{lt({type:me.DomContentLoaded,data:{}}),ge==="DOMContentLoaded"&&he()})),J.push(rn("load",()=>{lt({type:me.Load,data:{}}),ge==="load"&&he()},window))),()=>{J.forEach(Je=>Je()),ie.destroy(),Yu=void 0,wM()}}catch(J){console.warn(J)}}function BM(e){if(!Yu)throw new Error("please take full snapshot after start recording");Yu(e)}fr.mirror=dr;fr.takeFullSnapshot=BM;function HM(e,t){try{return e?e(t):new Vu}catch{return console.warn("Unable to initialize CanvasManager"),new Vu}}var rT;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(rT||(rT={}));var $M=3,zM=5;function Eh(e){return e>9999999999?e:e*1e3}function Bm(e){return e>9999999999?e/1e3:e}function xl(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:me.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:$t(t,10,1e3)}}),t.category==="console")))}var jM="button,a";function OT(e){return e.closest(jM)||e}function DT(e){let t=UT(e);return!t||!(t instanceof Element)?t:OT(t)}function UT(e){return WM(e)?e.target:e}function WM(e){return typeof e=="object"&&!!e&&"target"in e}var ko;function GM(e){return ko||(ko=[],VM()),ko.push(e),()=>{let t=ko?ko.indexOf(e):-1;t>-1&&ko.splice(t,1)}}function VM(){st(je,"open",function(e){return function(...t){if(ko)try{ko.forEach(n=>n())}catch{}return e.apply(je,t)}})}var qM=new Set([se.Mutation,se.StyleSheetRule,se.StyleDeclaration,se.AdoptedStyleSheet,se.CanvasMutation,se.Selection,se.MediaInteraction]);function YM(e,t,n){e.handleClick(t,n)}var oh=class{constructor(t,n,r=xl){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scrollTimeout=n.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){let t=GM(()=>{this._lastMutation=oT()});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,n){if(JM(n,this._ignoreSelector)||!XM(t))return;let r={timestamp:Bm(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(o=>o.node===r.node&&Math.abs(o.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=Bm(t)}registerScroll(t=Date.now()){this._lastScroll=Bm(t)}registerClick(t){let n=OT(t);this._handleMultiClick(n)}_handleMultiClick(t){this._getClicks(t).forEach(n=>{n.clickCount++})}_getClicks(t){return this._clicks.filter(n=>n.node===t)}_checkClicks(){let t=[],n=oT();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&t.push(r)});for(let r of t){let o=this._clicks.indexOf(r);o>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(o,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){let n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scrollTimeout,o=t.mutationAfter&&t.mutationAfter<=this._threshold,i=!r&&!o,{clickCount:s,clickBreadcrumb:a}=t;if(i){let l=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,c=l<this._timeout*1e3?"mutation":"timeout",u={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.slowClickDetected",data:{...a.data,url:je.location.href,route:n.getCurrentRoute(),timeAfterClickMs:l,endReason:c,clickCount:s||1}};this._addBreadcrumbEvent(n,u);return}if(s>1){let l={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.multiClick",data:{...a.data,url:je.location.href,route:n.getCurrentRoute(),clickCount:s,metric:!0}};this._addBreadcrumbEvent(n,l)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Ii(()=>this._checkClicks(),1e3)}},KM=["A","BUTTON","INPUT"];function JM(e,t){return!!(!KM.includes(e.tagName)||e.tagName==="INPUT"&&!["submit","button"].includes(e.getAttribute("type")||"")||e.tagName==="A"&&(e.hasAttribute("download")||e.hasAttribute("target")&&e.getAttribute("target")!=="_self")||t&&e.matches(t))}function XM(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function oT(){return Date.now()/1e3}function QM(e,t){try{if(!ZM(t))return;let{source:n}=t.data;if(qM.has(n)&&e.registerMutation(t.timestamp),n===se.Scroll&&e.registerScroll(t.timestamp),eP(t)){let{type:r,id:o}=t.data,i=fr.mirror.getNode(o);i instanceof HTMLElement&&r===nn.Click&&e.registerClick(i)}}catch{}}function ZM(e){return e.type===$M}function eP(e){return e.data.source===se.MouseInteraction}function br(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var id=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(id||{}),tP=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function nP(e){let t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(let n in e)if(tP.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}var rP=e=>t=>{if(!e.isEnabled())return;let n=oP(t);if(!n)return;let r=t.name==="click",o=r?t.event:void 0;r&&e.clickDetector&&o?.target&&!o.altKey&&!o.metaKey&&!o.ctrlKey&&!o.shiftKey&&YM(e.clickDetector,n,DT(t.event)),xl(e,n)};function FT(e,t){let n=fr.mirror.getId(e),r=n&&fr.mirror.getNode(n),o=r&&fr.mirror.getMeta(r),i=o&&sP(o)?o:null;return{message:t,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(s=>s.type===id.Text&&s.textContent).filter(Boolean).map(s=>s.trim()).join(""),attributes:nP(i.attributes)}}:{}}}function oP(e){let{target:t,message:n}=iP(e);return br({category:`ui.${e.name}`,...FT(t,n)})}function iP(e){let t=e.name==="click",n,r=null;try{r=t?DT(e.event):UT(e.event),n=Ue(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function sP(e){return e.type===id.Element}function aP(e,t){if(!e.isEnabled())return;e.updateUserActivity();let n=lP(t);n&&xl(e,n)}function lP(e){let{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i,target:s}=e;if(!s||cP(s)||!i)return null;let a=t||r||o,l=i.length===1;if(!a&&l)return null;let c=Ue(s,{maxStringLength:200})||"<unknown>",u=FT(s,c);return br({category:"ui.keyDown",message:c,data:{...u.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i}})}function cP(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}var uP={resource:hP,paint:pP,navigation:mP};function Hm(e,t){return({metric:n})=>{t.replayPerformanceEntries.push(e(n))}}function dP(e){return e.map(fP).filter(Boolean)}function fP(e){let t=uP[e.entryType];return t?t(e):null}function Ls(e){return((He()||je.performance.timeOrigin)+e)/1e3}function pP(e){let{duration:t,entryType:n,name:r,startTime:o}=e,i=Ls(o);return{type:n,name:r,start:i,end:i+t,data:void 0}}function mP(e){let{entryType:t,name:n,decodedBodySize:r,duration:o,domComplete:i,encodedBodySize:s,domContentLoadedEventStart:a,domContentLoadedEventEnd:l,domInteractive:c,loadEventStart:u,loadEventEnd:f,redirectCount:p,startTime:h,transferSize:y,type:_}=e;return o===0?null:{type:`${t}.${_}`,start:Ls(h),end:Ls(i),name:n,data:{size:y,decodedBodySize:r,encodedBodySize:s,duration:o,domInteractive:c,domContentLoadedEventStart:a,domContentLoadedEventEnd:l,loadEventStart:u,loadEventEnd:f,domComplete:i,redirectCount:p}}}function hP(e){let{entryType:t,initiatorType:n,name:r,responseEnd:o,startTime:i,decodedBodySize:s,encodedBodySize:a,responseStatus:l,transferSize:c}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:Ls(i),end:Ls(o),name:r,data:{size:c,statusCode:l,decodedBodySize:s,encodedBodySize:a}}}function gP(e){let t=e.entries[e.entries.length-1],n=t?.element?[t.element]:void 0;return Th(e,"largest-contentful-paint",n)}function yP(e){return e.sources!==void 0}function SP(e){let t=[],n=[];for(let r of e.entries)if(yP(r)){let o=[];for(let i of r.sources)if(i.node){n.push(i.node);let s=fr.mirror.getId(i.node);s&&o.push(s)}t.push({value:r.value,nodeIds:o.length?o:void 0})}return Th(e,"cumulative-layout-shift",n,t)}function _P(e){let t=e.entries[e.entries.length-1],n=t?.target?[t.target]:void 0;return Th(e,"interaction-to-next-paint",n)}function Th(e,t,n,r){let o=e.value,i=e.rating,s=Ls(o);return{type:"web-vital",name:t,start:s,end:s,data:{value:o,size:o,rating:i,nodeIds:n?n.map(a=>fr.mirror.getId(a)):void 0,attributions:r}}}function vP(e){function t(o){e.performanceEntries.includes(o)||e.performanceEntries.push(o)}function n({entries:o}){o.forEach(t)}let r=[];return["navigation","paint","resource"].forEach(o=>{r.push(cr(o,n))}),r.push(Kr(Hm(gP,e)),Yr(Hm(SP,e)),_i(Hm(_P,e))),()=>{r.forEach(o=>o())}}var re=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,EP='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([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,0,0,0]),i=new t([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,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(){j.prototype.flush.call(this)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function TP(){let e=new Blob([EP]);return URL.createObjectURL(e)}var iT=["log","warn","error"],Hu="[Replay] ";function $m(e,t="info"){kn({category:"console",data:{logger:"replay"},level:t,message:`${Hu}${e}`},{level:t})}function IP(){let e=!1,t=!1,n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return re?(iT.forEach(r=>{n[r]=(...o)=>{C[r](Hu,...o),t&&$m(o.join(""),gs(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),C.error(Hu,r),e?Gr(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&$m(r,"error")},n.infoTick=(...r)=>{C.log(Hu,...r),t&&setTimeout(()=>$m(r[0]),0)}):iT.forEach(r=>{n[r]=()=>{}}),n}var oe=IP(),Il=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${hh}.`)}},Ku=class{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(t){let n=JSON.stringify(t).length;if(this._totalSize+=n,this._totalSize>hh)throw new Il;this.events.push(t)}finish(){return new Promise(t=>{let n=this.events;this.clear(),t(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let t=null;for(let{timestamp:n}of this.events)(t===null||n<t)&&(t=n);return t===null?t:Eh(t)}},ih=class{constructor(t){this._onMessage=({data:n})=>{let r=n;if(typeof r.id!="number")return;let o=this._pending.get(r.id);if(!(!o||o.method!==r.method)){if(this._pending.delete(r.id),!r.success){re&&oe.error("Error in compression worker: ",r.response),o.reject(new Error("Error in compression worker"));return}o.resolve(r.response)}},this._worker=t,this._id=0,this._pending=new Map,this._worker.addEventListener("message",this._onMessage)}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((t,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?t():(re&&oe.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{re&&oe.warn("Failed to load Replay compression worker",r),n(new Error(`Failed to load Replay compression worker: ${r instanceof ErrorEvent&&r.message?r.message:"Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load."}`))},{once:!0})}),this._ensureReadyPromise)}destroy(){re&&oe.log("Destroying compression worker"),this._worker.removeEventListener("message",this._onMessage),this._pending.forEach(t=>t.reject(new Error("Worker destroyed"))),this._pending.clear(),this._worker.terminate()}postMessage(t,n){let r=this._getAndIncrementId();return new Promise((o,i)=>{this._pending.set(r,{method:t,resolve:o,reject:i});try{this._worker.postMessage({id:r,method:t,arg:n})}catch(s){this._pending.delete(r),i(s)}})}_getAndIncrementId(){return this._id++}},sh=class{constructor(t){this._worker=new ih(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){let n=Eh(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);let r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>hh?Promise.reject(new Il):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{re&&oe.exception(t,'Sending "clear" message to worker failed',t)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}async _finishRequest(){let t=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t}},ah=class{constructor(t){this._fallback=new Ku,this._compression=new sh(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(t){this._used.hasCheckout=t}set waitForCheckout(t){this._used.waitForCheckout=t}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(t){return this._used.addEvent(t)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(t){re&&oe.exception(t,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:t,hasCheckout:n,waitForCheckout:r}=this._fallback,o=[];for(let i of t)o.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(o),this._fallback.clear()}catch(i){re&&oe.exception(i,"Failed to add events when switching buffers.")}}};function wP({useCompression:e,workerUrl:t}){if(e&&window.Worker){let n=CP(t);if(n)return n}return re&&oe.log("Using simple buffer"),new Ku}function CP(e){try{let t=e||RP();if(!t)return;re&&oe.log(`Using compression worker${e?` from ${e}`:""}`);let n=new Worker(t);return new ah(n)}catch(t){re&&oe.exception(t,"Failed to create compression worker")}}function RP(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?TP():""}function Ih(){try{return"sessionStorage"in je&&!!je.sessionStorage}catch{return!1}}function xP(e){bP(),e.session=void 0}function bP(){if(Ih())try{je.sessionStorage.removeItem(ph)}catch{}}function BT(e){return e===void 0?!1:Math.random()<e}function sd(e){if(Ih())try{je.sessionStorage.setItem(ph,JSON.stringify(e))}catch{}}function HT(e){let t=Date.now(),n=e.id||at(),r=e.started||t,o=e.lastActivity||t,i=e.segmentId||0,s=e.sampled,a=e.previousSessionId,l=e.dirty||!1;return{id:n,started:r,lastActivity:o,segmentId:i,sampled:s,previousSessionId:a,dirty:l}}function kP(e,t){return BT(e)?"session":t?"buffer":!1}function sT({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){let o=kP(e,t),i=HT({sampled:o,previousSessionId:r});return n&&sd(i),i}function NP(){if(!Ih())return null;try{let e=je.sessionStorage.getItem(ph);if(!e)return null;let t=JSON.parse(e);return re&&oe.infoTick("Loading existing session"),HT(t)}catch{return null}}function lh(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function AP(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return lh(e.started,t,r)||lh(e.lastActivity,n,r)}function Ju(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!AP(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function zm({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){let o=r.stickySession&&NP();return o?Ju(o,{sessionIdleExpire:e,maxReplayDuration:t})?(re&&oe.infoTick("Session in sessionStorage is expired, creating new one..."),sT(r,{previousSessionId:o.id})):o:(re&&oe.infoTick("Creating new session"),sT(r,{previousSessionId:n}))}function MP(e){return e.type===me.Custom}function wh(e,t,n){return zT(e,t)?($T(e,t,n),!0):!1}function PP(e,t,n){return zT(e,t)?$T(e,t,n):Promise.resolve(null)}async function $T(e,t,n){let{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;let o=e.recordingMode==="buffer";try{n&&o&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);let i=e.getOptions(),s=LP(t,i.beforeAddRecordingEvent);return s?await r.addEvent(s):void 0}catch(i){let s=i&&i instanceof Il,a=s?"eventBufferOverflow":"eventBufferError",l=$();if(l){let c=s?"buffer_overflow":"internal_sdk_error";l.recordDroppedEvent(c,"replay")}if(s&&o)return r.clear(),r.waitForCheckout=!0,null;e.handleException(i),await e.stop({reason:a})}}function zT(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;let n=Eh(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(re&&oe.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function LP(e,t){try{if(typeof t=="function"&&MP(e))return t(e)}catch(n){return re&&oe.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Ch(e){return!e.type}function ch(e){return e.type==="transaction"}function OP(e){return e.type==="replay_event"}function aT(e){return e.type==="feedback"}function DP(e){return(t,n)=>{if(!e.isEnabled()||!Ch(t)&&!ch(t))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(ch(t)){UP(e,t);return}FP(e,t)}}}function UP(e,t){let n=e.getContext();t.contexts?.trace?.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function FP(e,t){let n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!t.tags?.replayId)return;let{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||Ii(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(o){e.handleException(o)}})}function BP(e){return t=>{!e.isEnabled()||!Ch(t)||HP(e,t)}}function HP(e,t){let n=t.exception?.values?.[0]?.value;if(typeof n=="string"&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){let r=br({category:"replay.hydrate-error",data:{url:hn()}});xl(e,r)}}function $P(e){let t=$();t&&t.on("beforeAddBreadcrumb",n=>zP(e,n))}function zP(e,t){if(!e.isEnabled()||!jT(t))return;let n=jP(t);n&&xl(e,n)}function jP(e){return!jT(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?WP(e):br(e)}function WP(e){let t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return br(e);let n=!1,r=t.map(o=>{if(!o)return o;if(typeof o=="string")return o.length>Du?(n=!0,`${o.slice(0,Du)}\u2026`):o;if(typeof o=="object")try{let i=$t(o,7);return JSON.stringify(i).length>Du?(n=!0,`${JSON.stringify(i,null,2).slice(0,Du)}\u2026`):i}catch{}return o});return br({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function jT(e){return!!e.category}function GP(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function Xu(){let e=te().getPropagationContext().dsc;e&&delete e.replay_id;let t=Me();if(t){let n=ht(t);delete n.replay_id}}function lT(e){let t=te().getPropagationContext().dsc;t&&(t.replay_id=e);let n=Me();if(n){let r=ht(n);r.replay_id=e}}function VP(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:me.Custom,timestamp:t.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1):!0)}function qP(e,t){return e.recordingMode!=="buffer"||t.message===mh||!t.exception||t.type?!1:BT(e.getOptions().errorSampleRate)}function YP(e){return Object.assign((t,n)=>{if(e.session&&Ju(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&Xu(),!e.isEnabled()||e.isPaused())return t;if(OP(t))return delete t.breadcrumbs,t;if(!Ch(t)&&!ch(t)&&!aT(t))return t;if(!e.checkAndHandleExpiredSession())return Xu(),t;if(aT(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),VP(e,t),t;if(GP(t,n)&&!e.getOptions()._experiments.captureExceptions)return re&&oe.log("Ignoring error from rrweb internals",t),null;let o=qP(e,t);if((o||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),o&&e.recordingMode==="buffer"&&e.session?.sampled==="buffer"){let s=e.session;s.dirty=!0,e.getOptions().stickySession&&sd(s)}return t},{id:"Replay"})}function ad(e,t){return t.map(({type:n,start:r,end:o,name:i,data:s})=>{let a=e.throttledAddEvent({type:me.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:o,data:s}}});return typeof a=="string"?Promise.resolve(null):a})}function KP(e){let{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}function JP(e){return t=>{if(!e.isEnabled())return;let n=KP(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(ad(e,[n]),!1)))}}function XP(e,t){return re&&e.getOptions()._experiments.traceInternals?!1:Xp(t,$())}function WT(e,t){e.isEnabled()&&t!==null&&(XP(e,t.name)||e.addUpdate(()=>(ad(e,[t]),!0)))}function ld(e){if(!e)return;let t=new TextEncoder;try{if(typeof e=="string")return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){let n=Au(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function GT(e){if(!e)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}function Qu(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};let n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function VT(e,t){if(!t)return null;let{startTimestamp:n,endTimestamp:r,url:o,method:i,statusCode:s,request:a,response:l}=t;return{type:e,start:n/1e3,end:r/1e3,name:o,data:{method:i,statusCode:s,request:a,response:l}}}function wl(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function No(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};let r={headers:e,size:t},{body:o,warnings:i}=QP(n);return r.body=o,i?.length&&(r._meta={warnings:i}),r}function uh(e,t){return Object.entries(e).reduce((n,[r,o])=>{let i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=o),n},{})}function QP(e){if(!e||typeof e!="string")return{body:e};let t=e.length>zE,n=ZP(e);if(t){let r=e.slice(0,zE);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}\u2026`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function ZP(e){let t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function Zu(e,t){let n=eL(e);return Nt(n,t)}function eL(e,t=je.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(je.location.origin))return e;let n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;let r=n.href;return!e.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function tL(e,t,n){try{let r=await rL(e,t,n),o=VT("resource.fetch",r);WT(n.replay,o)}catch(r){re&&oe.exception(r,"Failed to capture fetch breadcrumb")}}function nL(e,t){let{input:n,response:r}=t,o=n?Pu(n):void 0,i=ld(o),s=r?GT(r.headers.get("content-length")):void 0;i!==void 0&&(e.data.request_body_size=i),s!==void 0&&(e.data.response_body_size=s)}async function rL(e,t,n){let r=Date.now(),{startTimestamp:o=r,endTimestamp:i=r}=t,{url:s,method:a,status_code:l=0,request_body_size:c,response_body_size:u}=e.data,f=Zu(s,n.networkDetailAllowUrls)&&!Zu(s,n.networkDetailDenyUrls),p=f?oL(n,t.input,c):wl(c),h=await iL(f,n,t.response,u);return{startTimestamp:o,endTimestamp:i,url:s,method:a,statusCode:l,request:p,response:h}}function oL({networkCaptureBodies:e,networkRequestHeaders:t},n,r){let o=n?lL(n,t):{};if(!e)return No(o,r,void 0);let i=Pu(n),[s,a]=Mu(i,oe),l=No(o,r,s);return a?Qu(l,a):l}async function iL(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,o){if(!e&&o!==void 0)return wl(o);let i=r?qT(r.headers,n):{};if(!r||!t&&o!==void 0)return No(i,o,void 0);let[s,a]=await aL(r),l=sL(s,{networkCaptureBodies:t,responseBodySize:o,captureDetails:e,headers:i});return a?Qu(l,a):l}function sL(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:o}){try{let i=e?.length&&n===void 0?ld(e):n;return r?t?No(o,i,e):No(o,i,void 0):wl(i)}catch(i){return re&&oe.exception(i,"Failed to serialize response body"),No(o,n,void 0)}}async function aL(e){let t=cL(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await uL(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(re&&oe.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(re&&oe.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function qT(e,t){let n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function lL(e,t){return e.length===1&&typeof e[0]!="string"?cT(e[0],t):e.length===2?cT(e[1],t):{}}function cT(e,t){if(!e)return{};let n=e.headers;return n?n instanceof Headers?qT(n,t):Array.isArray(n)?{}:uh(n,t):{}}function cL(e){try{return e.clone()}catch(t){re&&oe.exception(t,"Failed to clone response body")}}function uL(e){return new Promise((t,n)=>{let r=Ii(()=>n(new Error("Timeout while trying to read response body")),500);dL(e).then(o=>t(o),o=>n(o)).finally(()=>clearTimeout(r))})}async function dL(e){return await e.text()}async function fL(e,t,n){try{let r=mL(e,t,n),o=VT("resource.xhr",r);WT(n.replay,o)}catch(r){re&&oe.exception(r,"Failed to capture xhr breadcrumb")}}function pL(e,t){let{xhr:n,input:r}=t;if(!n)return;let o=ld(r),i=n.getResponseHeader("content-length")?GT(n.getResponseHeader("content-length")):yL(n.response,n.responseType);o!==void 0&&(e.data.request_body_size=o),i!==void 0&&(e.data.response_body_size=i)}function mL(e,t,n){let r=Date.now(),{startTimestamp:o=r,endTimestamp:i=r,input:s,xhr:a}=t,{url:l,method:c,status_code:u=0,request_body_size:f,response_body_size:p}=e.data;if(!l)return null;if(!a||!Zu(l,n.networkDetailAllowUrls)||Zu(l,n.networkDetailDenyUrls)){let A=wl(f),I=wl(p);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:u,request:A,response:I}}let h=a[ur],y=h?uh(h.request_headers,n.networkRequestHeaders):{},_=uh(dl(a),n.networkResponseHeaders),[T,g]=n.networkCaptureBodies?Mu(s,oe):[void 0],[S,E]=n.networkCaptureBodies?hL(a):[void 0],R=No(y,f,T),M=No(_,p,S);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:u,request:g?Qu(R,g):R,response:E?Qu(M,E):M}}function hL(e){let t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return gL(e.response,e.responseType)}catch(n){t.push(n)}return re&&oe.warn("Failed to get xhr response body",...t),[void 0]}function gL(e,t){try{if(typeof e=="string")return[e];if(e instanceof Document)return[e.body.outerHTML];if(t==="json"&&e&&typeof e=="object")return[JSON.stringify(e)];if(!e)return[void 0]}catch(n){return re&&oe.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return re&&oe.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function yL(e,t){try{let n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return ld(n)}catch{return}}function SL(e){let t=$();try{let{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:i,networkResponseHeaders:s}=e.getOptions(),a={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:i,networkResponseHeaders:s};t&&t.on("beforeAddBreadcrumb",(l,c)=>_L(a,l,c))}catch{}}function _L(e,t,n){if(t.data)try{vL(t)&&TL(n)&&(pL(t,n),fL(t,n,e)),EL(t)&&IL(n)&&(nL(t,n),tL(t,n,e))}catch(r){re&&oe.exception(r,"Error when enriching network breadcrumb")}}function vL(e){return e.category==="xhr"}function EL(e){return e.category==="fetch"}function TL(e){return e?.xhr}function IL(e){return e?.input!==void 0}function wL(e){let t=$();cl(rP(e)),Qr(JP(e)),$P(e),SL(e);let n=YP(e);Ka(n),t&&(t.on("beforeSendEvent",BP(e)),t.on("afterSendEvent",DP(e)),t.on("createDsc",r=>{let o=e.getSessionId();o&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=o)}),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",async(r,o)=>{let i=e.getSessionId();o?.includeReplay&&e.isEnabled()&&i&&r.contexts?.feedback&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=i)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function CL(e){try{return Promise.all(ad(e,[RL(je.performance.memory)]))}catch{return[]}}function RL(e){let{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,o=Date.now()/1e3;return{type:"memory",name:"memory",start:o,end:o,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function xL(e,t,n){return Zp(e,t,{...n,setTimeoutImpl:Ii})}var Bu=G.navigator;function bL(){return/iPhone|iPad|iPod/i.test(Bu?.userAgent??"")||/Macintosh/i.test(Bu?.userAgent??"")&&Bu?.maxTouchPoints&&Bu?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function kL(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){re&&oe.warn("Received replay event after session expired.");return}let o=r||!t;t=!0,NL(n),e.clickDetector&&QM(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&o&&e.setInitialState(),!wh(e,n,o))return!0;if(!o)return!1;let i=e.session;if(ML(e,o),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){let s=e.eventBuffer.getEarliestTimestamp();s&&(re&&oe.log(`Updating session start time to earliest event in buffer to ${new Date(s)}`),i.started=s,e.getOptions().stickySession&&sd(i))}return i?.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function NL(e){let t=e.data;if(!(e.type!==me.IncrementalSnapshot||!t||typeof t!="object"||!("source"in t)||t.source!==se.Mutation||!("attributes"in t)||!Array.isArray(t.attributes)))for(let n of t.attributes){let r=fr.mirror.getNode(n.id),o=r&&fr.mirror.getMeta(r);if(o?.type===id.Element)for(let[i,s]of Object.entries(n.attributes))s===null?delete o.attributes[i]:o.attributes[i]=s}}function AL(e){let t=e.getOptions();return{type:me.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:e.eventBuffer?e.eventBuffer.type==="worker":!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function ML(e,t){!t||e.session?.segmentId!==0||wh(e,AL(e),!1)}function PL(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function LL(e,t,n,r){return en(ja(e,as(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function OL({recordingData:e,headers:t}){let n,r=`${JSON.stringify(t)}
|
|
31
|
+
`;if(typeof e=="string")n=`${r}${e}`;else{let i=new TextEncoder().encode(r);n=new Uint8Array(i.length+e.length),n.set(i),n.set(e,i.length)}return n}async function DL({client:e,scope:t,replayId:n,event:r}){let o=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,i={event_id:n,integrations:o};e.emit("preprocessEvent",r,i);let s=await Va(e.getOptions(),r,i,t,e,Xe());if(!s)return null;e.emit("postprocessEvent",s,i),s.platform=s.platform||"javascript";let a=e.getSdkMetadata(),{name:l,version:c,settings:u}=a?.sdk||{};return s.sdk={...s.sdk,name:l||"sentry.javascript.unknown",version:c||"0.0.0",settings:u},s}async function UL({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:o,session:i}){let s=OL({recordingData:e,headers:{segment_id:n}}),{urls:a,errorIds:l,traceIds:c,initialTimestamp:u}=r,f=$(),p=te(),h=f?.getTransport(),y=f?.getDsn();if(!f||!h||!y||!i.sampled)return Promise.resolve({});let _={type:w1,replay_start_timestamp:u/1e3,timestamp:o/1e3,error_ids:l,trace_ids:c,urls:a,replay_id:t,segment_id:n,replay_type:i.sampled},T=await DL({scope:p,client:f,replayId:t,event:_});if(!T)return f.recordDroppedEvent("event_processor","replay"),re&&oe.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete T.sdkProcessingMetadata;let g=LL(T,s,y,f.getOptions().tunnel),S;try{S=await h.send(g)}catch(R){let M=new Error(mh);try{M.cause=R}catch{}throw M}let E=Za({},S);if(Qa(E,"replay"))throw new Cl(E);if(typeof S.statusCode=="number"&&(S.statusCode<200||S.statusCode>=300))throw new ed(S.statusCode);return S}var ed=class extends Error{constructor(t){super(`Transport returned status code ${t}`)}},Cl=class extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}},td=class extends Error{constructor(){super("Session is too long, not sending replay")}};async function YT(e,t={count:0,interval:N1}){let{recordingData:n,onError:r}=e;if(n.length)try{return await UL(e),!0}catch(o){if(o instanceof ed||o instanceof Cl)throw o;if(mi("Replays",{_retryCount:t.count}),r&&r(o),t.count>=A1){let i=new Error(`${mh} - max retries exceeded`);try{i.cause=o}catch{}throw i}return t.interval*=++t.count,new Promise((i,s)=>{Ii(async()=>{try{await YT(e,t),i(!0)}catch(a){s(a)}},t.interval)})}}var KT="__THROTTLED",FL="__SKIPPED";function BL(e,t,n){let r=new Map,o=a=>{let l=a-n;r.forEach((c,u)=>{u<l&&r.delete(u)})},i=()=>[...r.values()].reduce((a,l)=>a+l,0),s=!1;return(...a)=>{let l=Math.floor(Date.now()/1e3);if(o(l),i()>=t){let u=s;return s=!0,u?FL:KT}s=!1;let c=r.get(l)||0;return r.set(l,c+1),e(...a)}}var dh=class{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:C1,sessionIdleExpire:R1},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=t,this._debouncedFlush=xL(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=BL((s,a)=>PP(this,s,a),300,5);let{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),i=r?{threshold:Math.min(M1,r),timeout:r,scrollTimeout:P1,ignoreSelector:o?o.join(","):""}:void 0;if(i&&(this.clickDetector=new oh(this,i)),re){let s=t._experiments;oe.setConfig({captureExceptions:!!s.captureExceptions,traceInternals:!!s.traceInternals})}this._handleVisibilityChange=()=>{je.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{let s=br({category:"ui.blur"});this._doChangeToBackgroundTasks(s)},this._handleWindowFocus=()=>{let s=br({category:"ui.focus"});this._doChangeToForegroundTasks(s)},this._handleKeyboardEvent=s=>{aP(this,s)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){re&&oe.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){let{errorSampleRate:n,sessionSampleRate:r}=this._options,o=n<=0&&r<=0;if(this._requiresManualStart=o,!o){if(this._initializeSessionForSampling(t),!this.session){re&&oe.exception(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",re&&oe.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){re&&oe.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){re&&oe.log("Buffering is in progress, call `flush()` to save the replay");return}re&&oe.infoTick("Starting replay in session mode"),this._updateUserActivity();let t=zm({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){re&&oe.log("Buffering is in progress, call `flush()` to save the replay");return}re&&oe.infoTick("Starting replay in buffer mode");let t=zm({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{let t=this._canvas;this._stopRecording=fr({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:k1}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:kL(this),...bL(),onMutation:this._onMutationHandler.bind(this),...t?{recordCanvas:t.recordCanvas,getCanvasManager:t.getCanvasManager,sampling:t.sampling,dataURLOptions:t.dataURLOptions}:{}})}catch(t){this.handleException(t)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(t){return this.handleException(t),!1}}async stop({forceFlush:t=!1,reason:n}={}){if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode="buffer";let r=n??"manual";$()?.emit("replayEnd",{sessionId:this.session?.id,reason:r});try{re&&oe.log(`Stopping Replay triggered by ${r}`),Xu(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,xP(this)}catch(o){this.handleException(o)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),re&&oe.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),re&&oe.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();let n=Date.now();re&&oe.log("Converting buffer to session"),await this.flushImmediate();let r=this.stopRecording();!t||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession(),lT(this.session.id)),this.startRecording())}addUpdate(t){let n=t();this.recordingMode==="buffer"||!this._isEnabled||n!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(t){if(!(t&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&lh(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){let t=`${je.location.pathname}${je.location.hash}${je.location.search}`,n=`${je.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(t,n){let r=this._throttledAddEvent(t,n);if(r===KT){let o=br({category:"replay.throttled"});this.addUpdate(()=>!wh(this,{type:zM,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){let t=this.lastActiveSpan||Me(),n=t&&be(t),o=(n&&ne(n).data||{})[vt];if(!(!n||!o||!["route","custom"].includes(o)))return ne(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=wP({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&$()?.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode==="session"&&this.session&&lT(this.session.id)}_initializeSessionForSampling(t){let n=this._options.errorSampleRate>0,r=zm({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;let t=this.session;return Ju(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"sessionExpired"}),this.initializeSampling(t.id))}_addListeners(){try{je.document.addEventListener("visibilitychange",this._handleVisibilityChange),je.addEventListener("blur",this._handleWindowBlur),je.addEventListener("focus",this._handleWindowFocus),je.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(wL(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=vP(this)}_removeListeners(){try{je.document.removeEventListener("visibilitychange",this._handleVisibilityChange),je.removeEventListener("blur",this._handleWindowBlur),je.removeEventListener("focus",this._handleWindowFocus),je.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){if(!this.session)return;if(Ju(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){Xu();return}t&&this._createCustomBreadcrumb(t),this.conditionalFlush()}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){re&&oe.log("Document has become active, but session has expired");return}t&&this._createCustomBreadcrumb(t)}_updateUserActivity(t=Date.now()){this._lastActivity=t}_updateSessionActivity(t=Date.now()){this.session&&(this.session.lastActivity=t,this._maybeSaveSession())}_createCustomBreadcrumb(t){this.addUpdate(()=>{this.throttledAddEvent({type:me.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=dP(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){let n=this._context.initialTimestamp/1e3;t=t.filter(r=>r.start>=n)}return Promise.all(ad(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:t,eventBuffer:n}=this;if(!t||!n||this._requiresManualStart||t.segmentId)return;let r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){let t={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),t}async _runFlush(){let t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){re&&oe.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!this.eventBuffer?.hasEvents&&(await CL(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new td;let r=this._popEventContext(),o=this.session.segmentId++;this._maybeSaveSession();let i=await this.eventBuffer.finish();await YT({replayId:t,recordingData:i,segmentId:o,eventContext:r,session:this.session,timestamp:n,onError:s=>this.handleException(s)})}catch(n){this.handleException(n),this.stop({reason:"sendError"});let r=$();if(r){let o;n instanceof Cl?o="ratelimit_backoff":n instanceof td?o="invalid":o="send_error",r.recordDroppedEvent(o,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){re&&oe.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;let n=this.session.started,o=Date.now()-n;this._debouncedFlush.cancel();let i=o<this._options.minReplayDuration,s=o>this._options.maxReplayDuration+5e3;if(i||s){re&&oe.log(`Session duration (${Math.floor(o/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}let a=this.eventBuffer;a&&this.session.segmentId===0&&!a.hasCheckout&&re&&oe.log("Flushing initial segment without checkout.");let l=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(c){this.handleException(c)}finally{this._flushLock=void 0,l&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&sd(this.session)}_onMutationHandler(t){let{ignoreMutations:n}=this._options._experiments;if(n?.length&&t.some(a=>{let l=PL(a.target),c=n.join(",");return l?.matches(c)}))return!1;let r=t.length,o=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,s=o&&r>o;if(r>i||s){let a=br({category:"replay.mutations",data:{count:r,limit:s}});this._createCustomBreadcrumb(a)}return s?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}};function ml(e,t){return[...e,...t].join(",")}function HL({mask:e,unmask:t,block:n,unblock:r,ignore:o}){let i=["base","iframe[srcdoc]:not([src])"],s=ml(e,[".sentry-mask","[data-sentry-mask]"]),a=ml(t,[]);return{maskTextSelector:s,unmaskTextSelector:a,blockSelector:ml(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:ml(r,[]),ignoreSelector:ml(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function $L({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:o,value:i}){if(o.unmaskTextSelector&&e.matches(o.unmaskTextSelector))return i;let s=n.includes(t),a=r&&t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"");return s||a?i.replace(/[\S]/g,"*"):i}var uT='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',zL=["content-length","content-type","accept"],jL=Symbol.for("sentry__originalRequestBody"),dT=!1,fT=!1;function WL(){if(typeof Request>"u"||fT)return;let e=Request;try{let t=function(n,r){let o=new e(n,r);return r?.body!=null&&(o[jL]=r.body),o};t.prototype=e.prototype,G.Request=t,fT=!0}catch{}}var Rh=(e=>new fh(e)),fh=class{constructor({flushMinDelay:t=x1,flushMaxDelay:n=b1,minReplayDuration:r=L1,maxReplayDuration:o=jE,stickySession:i=!0,useCompression:s=!0,workerUrl:a,_experiments:l={},maskAllText:c=!0,maskAllInputs:u=!0,blockAllMedia:f=!0,mutationBreadcrumbLimit:p=750,mutationLimit:h=1e4,slowClickTimeout:y=7e3,slowClickIgnoreSelectors:_=[],networkDetailAllowUrls:T=[],networkDetailDenyUrls:g=[],networkCaptureBodies:S=!0,networkRequestHeaders:E=[],networkResponseHeaders:R=[],mask:M=[],maskAttributes:A=["title","placeholder","aria-label"],unmask:I=[],block:N=[],unblock:U=[],ignore:x=[],maskFn:H,beforeAddRecordingEvent:j,beforeErrorSampling:ge,onError:X,attachRawBodyFromRequest:Ze=!1}={}){this.name="Replay";let fe=HL({mask:M,unmask:I,block:N,unblock:U,ignore:x});if(this._recordingOptions={maskAllInputs:u,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:H,maskInputFn:H,maskAttributeFn:(de,D,ye)=>$L({maskAttributes:A,maskAllText:c,privacyOptions:fe,key:de,value:D,el:ye}),...fe,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:de=>{try{de.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!l.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,O1),maxReplayDuration:Math.min(o,jE),stickySession:i,useCompression:s,workerUrl:a,blockAllMedia:f,maskAllInputs:u,maskAllText:c,mutationBreadcrumbLimit:p,mutationLimit:h,slowClickTimeout:y,slowClickIgnoreSelectors:_,networkDetailAllowUrls:T,networkDetailDenyUrls:g,networkCaptureBodies:S,networkRequestHeaders:pT(E),networkResponseHeaders:pT(R),beforeAddRecordingEvent:j,beforeErrorSampling:ge,onError:X,attachRawBodyFromRequest:Ze,_experiments:l},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${uT}`:uT,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&jn())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return dT}set _isInitialized(t){dT=t}afterAllSetup(t){!jn()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&WL(),this._setup(t),this._initialize(t))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session",reason:"manual"}):Promise.resolve()}flush(t){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(t):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(t){if(this._replay?.isEnabled())return this._replay.getSessionId(t)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}processSpan(t){let n=this.getReplayId(!0);n&&Io(t,{"sentry.replay_id":n})}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){let n=GL(this._initialOptions,t);this._replay=new dh({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{let n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}};function GL(e,t){let n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},o=bn(n.replaysSessionSampleRate),i=bn(n.replaysOnErrorSampleRate);return o==null&&i==null&&kt(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),i!=null&&(r.errorSampleRate=i),r}function pT(e){return[...zL,...e.map(t=>t.toLowerCase())]}function JT(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function xh(e){try{return new URL(e,ee.location.origin).href}catch{return}}function XT(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function bh(e){try{return new Headers(e)}catch{return}}var kh={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function ZT(e,t){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:i,tracePropagationTargets:s,onRequestSpanStart:a,onRequestSpanEnd:l}={...kh,...t},c=typeof o=="function"?o:h=>!0,u=h=>qL(h,s),f={},p=e.getOptions().propagateTraceparent;n&&Co(h=>{let y=im(h,c,u,f,{propagateTraceparent:p,onRequestSpanEnd:l});if(y){let _=xh(h.fetchData.url),T=_?zn(_).host:void 0;y.setAttributes({"http.url":_?Wt(_):void 0,"server.address":T}),i&&QT(y,e),a?.(y,{headers:h.headers})}}),r&&ul(h=>{let y=YL(h,c,u,f,p,l);y&&(i&&QT(y,e),a?.(y,{headers:bh(h.xhr.__sentry_xhr_v3__?.request_headers)}))})}var VL=300;function QT(e,t){let{url:n}=ne(e).data;if(!n||typeof n!="string")return;let r=()=>{setTimeout(o)};if(Mt(t)){let i=e.end.bind(e);e.end=s=>{let a=s??Ae(),l=!1,c=()=>{l||(l=!0,setTimeout(o),i(a),clearTimeout(u))};r=c;let u=setTimeout(c,VL)}}let o=cr("resource",({entries:i})=>{i.forEach(s=>{XT(s)&&s.name.endsWith(n)&&(e.setAttributes(al(s)),r())})})}function qL(e,t){let n=hn();if(n){let r,o;try{r=new URL(e,n),o=new URL(n).origin}catch{return!1}let i=r.origin===o;return t?Nt(r.toString(),t)||i&&Nt(r.pathname,t):i}else{let r=!!e.match(/^\/(?!\/)/);return t?Nt(e,t):r}}function YL(e,t,n,r,o,i){let s=e.xhr,a=s?.[ur];if(!s||s.__sentry_own_request__||!a)return;let{url:l,method:c}=a,u=Et()&&t(l);if(e.endTimestamp){let S=s.__sentry_xhr_span_id__;if(!S)return;let E=r[S];E&&(u&&a.status_code!==void 0&&(rs(E,a.status_code),E.end(),i?.(E,{headers:bh(dl(s)),error:e.error})),delete r[S]);return}let f=xh(l),p=f?zn(f):zn(l),h=Wt(Zc(l)),y=$(),T=!!Me()||!!y&&Mt(y),g=u&&T?wt({name:`${c} ${h}`,attributes:{url:Wt(l),type:"xhr","http.method":c,"http.url":f?Wt(f):void 0,"server.address":p?.host,[we]:"auto.http.browser",[qe]:"http.client",...p?.search&&{"http.query":p?.search},...p?.hash&&{"http.fragment":p?.hash}}}):new At;return u&&!T&&y?.recordDroppedEvent("no_parent_span","span"),s.__sentry_xhr_span_id__=g.spanContext().spanId,r[s.__sentry_xhr_span_id__]=g,n(l)&&KL(s,Et()&&T?g:void 0,o),y&&y.emit("beforeOutgoingRequestSpan",g,e),g}function KL(e,t,n){let{"sentry-trace":r,baggage:o,traceparent:i}=hs({span:t,propagateTraceparent:n});r&&JL(e,r,o,i)}function JL(e,t,n,r){let o=e.__sentry_xhr_v3__?.request_headers;if(!(o?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!o?.traceparent&&e.setRequestHeader("traceparent",r),n){let i=o?.baggage;(!i||!JT(i))&&e.setRequestHeader("baggage",n)}}catch{}}var eI=new WeakMap,tI=new WeakMap,XL=9e4,QL=["text/event-stream","application/x-ndjson","application/stream+json"],nI=()=>({name:"FetchStreamPerformance",setup(){fu(e=>{if(e.response){let t=eI.get(e.response);if(t&&e.endTimestamp){t.end(e.endTimestamp);let n=tI.get(e.response);n&&clearTimeout(n)}}}),Co(e=>{if(e.endTimestamp&&e.response){let t=e.response.headers?.get("content-type")||"";if(e.response.headers?.get("content-length")||!QL.some(l=>t.startsWith(l)))return;let n=e.fetchData?.url||"",r=e.fetchData?.method||"GET",o=Ir(n),i=n.startsWith("data:")?Wt(n):o?us(o):n,s=wt({name:`${r} ${i}`,startTime:e.endTimestamp,attributes:{url:Wt(n),"http.method":r,type:"fetch",[qe]:"http.client.stream",[we]:"auto.http.browser.stream"}});eI.set(e.response,s);let a=setTimeout(()=>{s.isRecording()&&s.end()},XL);tI.set(e.response,a)}})}});function rI(){ee.document?ee.document.addEventListener("visibilitychange",()=>{let e=Me();if(!e)return;let t=be(e);if(ee.document.hidden&&t){let n="cancelled",{op:r,status:o}=ne(t);et&&C.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||t.setStatus({code:2,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):et&&C.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var ZL=3600,oI="sentry_previous_trace",eO="sentry.previous_trace";function iI(e,{linkPreviousTrace:t,consistentTraceSampling:n}){let r=t==="session-storage",o=r?rO():void 0;e.on("spanStart",s=>{if(be(s)!==s)return;let a=te().getPropagationContext();o=tO(o,s,a),r&&nO(o)});let i=!0;n&&e.on("beforeSampling",s=>{if(!o)return;let a=te(),l=a.getPropagationContext();if(i&&l.parentSpanId){i=!1;return}a.setPropagationContext({...l,dsc:{...l.dsc,sample_rate:String(o.sampleRate),sampled:String(Nh(o.spanContext))},sampleRand:o.sampleRand}),s.parentSampled=Nh(o.spanContext),s.parentSampleRate=o.sampleRate,s.spanAttributes={...s.spanAttributes,[ts]:o.sampleRate}})}function tO(e,t,n){let r=ne(t);function o(){try{let a=Number(r.data?.[$r]??n.dsc?.sample_rate);return Number.isNaN(a)?0:a}catch{return 0}}let i={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:o(),sampleRand:n.sampleRand};if(!e)return i;let s=e.spanContext;return s.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=ZL&&(et&&C.log(`Adding previous_trace \`${JSON.stringify(s)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:s,attributes:{[Uc]:"previous_trace"}}),t.setAttribute(eO,`${s.traceId}-${s.spanId}-${Nh(s)?1:0}`)),i)}function nO(e){try{ee.sessionStorage.setItem(oI,JSON.stringify(e))}catch(t){et&&C.warn("Could not store previous trace in sessionStorage",t)}}function rO(){try{let e=ee.sessionStorage?.getItem(oI);return JSON.parse(e)}catch{return}}function Nh(e){return e.traceFlags===1}var oO="BrowserTracing",iO=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function uI(){let e=ee.navigator;return e?.userAgent?iO.test(e.userAgent):!1}var sO={...cs,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...kh},Ah=((e={})=>{"enableElementTiming"in e&&kt(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});let t={name:void 0,source:void 0},n=ee.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:i,_experiments:{enableInteractions:s,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:l},beforeStartSpan:c,idleTimeout:u,finalTimeout:f,childSpanTimeout:p,markBackgroundSpan:h,traceFetch:y,traceXHR:_,trackFetchStreamPerformance:T,shouldCreateSpanForRequest:g,enableHTTPTimings:S,ignoreResourceSpans:E,ignorePerformanceApiSpans:R,instrumentPageLoad:M,instrumentNavigation:A,detectRedirects:I,linkPreviousTrace:N,consistentTraceSampling:U,enableReportPageLoaded:x,onRequestSpanStart:H,onRequestSpanEnd:j}={...sO,...e},ge=uI(),X,Ze,fe;function de(D,ye,Q=!0){let ae=ye.op==="pageload",Re=ye.name,Te=c?c(ye):ye,St=Te.attributes||{};if(Re!==Te.name&&(St[vt]="custom",Te.attributes=St),!Q){let it=dn();wt({...Te,startTime:it}).end(it);return}t.name=Te.name,t.source=St[vt];let ot=Xc(Te,{idleTimeout:u,finalTimeout:f,childSpanTimeout:p,disableAutoFinish:ae,beforeSpanEnd:it=>{X?.();let In=Mt(D);Im(it,{recordClsOnPageloadSpan:!In&&!a,recordLcpOnPageloadSpan:!In&&!l,ignoreResourceSpans:E,ignorePerformanceApiSpans:R,spanStreamingEnabled:In}),lI(D,void 0);let Dt=te(),wn=Dt.getPropagationContext();Dt.setPropagationContext({...wn,traceId:ot.spanContext().traceId,sampled:mn(ot),dsc:ht(it)}),ae&&(fe=void 0)},trimIdleSpanEndTimestamp:!x});ae&&x&&(fe=ot),lI(D,ot);function bt(){n&&["interactive","complete"].includes(n.readyState)&&D.emit("idleSpanEnableAutoFinish",ot)}ae&&!x&&n&&(n.addEventListener("readystatechange",()=>{bt()}),bt())}return{name:oO,setup(D){if(ge){et&&C.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}Wc();let ye=Mt(D);if(X=_m({recordClsStandaloneSpans:ye?void 0:a||!1,recordLcpStandaloneSpans:ye?void 0:l||!1,client:D}),ye?(km(D),Nm(D),r&&Am()):r&&Rm(),i&&G.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?Em():o&&vm(),s&&Tm(),I&&n){let ae=()=>{Ze=Ae()};addEventListener("click",ae,{capture:!0}),addEventListener("keydown",ae,{capture:!0,passive:!0})}function Q(){let ae=bl(D);ae&&!ne(ae).timestamp&&(et&&C.log(`[Tracing] Finishing current active span with op: ${ne(ae).op}`),ae.setAttribute(zr,"cancelled"),ae.end())}D.on("startNavigationSpan",(ae,Re)=>{if($()!==D)return;if(Re?.isRedirect){et&&C.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),de(D,{op:"navigation.redirect",...ae},!1);return}Ze=void 0,Q(),Xe().setPropagationContext({traceId:Zt(),sampleRand:Math.random(),propagationSpanId:Et()?void 0:zt()});let Te=te();Te.setPropagationContext({traceId:Zt(),sampleRand:Math.random(),propagationSpanId:Et()?void 0:zt()}),Te.setSDKProcessingMetadata({normalizedRequest:void 0}),de(D,{op:"navigation",...ae,parentSpan:null,forceTransaction:!0})}),D.on("startPageLoadSpan",(ae,Re={})=>{if($()!==D)return;Q();let Te=Re.sentryTrace||sI("sentry-trace")||aI("sentry-trace"),St=Re.baggage||sI("baggage")||aI("baggage"),ot=Ip(Te,St),bt=te();bt.setPropagationContext(ot),Et()||(bt.getPropagationContext().propagationSpanId=zt()),bt.setSDKProcessingMetadata({normalizedRequest:Ss()}),de(D,{op:"pageload",...ae})}),D.on("endPageloadSpan",()=>{x&&fe&&(fe.setAttribute(zr,"reportPageLoaded"),fe.end())})},afterAllSetup(D){if(ge)return;let ye=hn();if(N!=="off"&&iI(D,{linkPreviousTrace:N,consistentTraceSampling:U}),ee.location){if(M){let Q=He();dI(D,{name:ee.location.pathname,startTime:Q?Q/1e3:void 0,attributes:{[vt]:"url",[we]:"auto.pageload.browser"}})}A&&Qr(({to:Q,from:ae})=>{if(ae===void 0&&ye?.indexOf(Q)!==-1){ye=void 0;return}ye=void 0;let Re=Ir(Q),Te=bl(D),St=Te&&I&&lO(Te,Ze);fI(D,{name:Re?.pathname||ee.location.pathname,attributes:{[vt]:"url",[we]:"auto.navigation.browser"}},{url:Q,isRedirect:St})})}h&&rI(),s&&aO(D,u,f,p,t),r&&xm(),ZT(D,{traceFetch:y,traceXHR:_,tracePropagationTargets:D.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:g,enableHTTPTimings:S,onRequestSpanStart:H,onRequestSpanEnd:j}),T&&D.addIntegration(nI())}}});function dI(e,t,n){e.emit("startPageLoadSpan",t,n),te().setTransactionName(t.name);let r=bl(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function fI(e,t,n){let{url:r,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o}),e.emit("startNavigationSpan",t,{isRedirect:o});let i=te();return i.setTransactionName(t.name),r&&!o&&i.setSDKProcessingMetadata({normalizedRequest:{...Ss(),url:r}}),bl(e)}function sI(e){return ee.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function aI(e){return ee.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===e)?.description}function aO(e,t,n,r,o){let i=ee.document,s,a=()=>{let l="ui.action.click",c=bl(e);if(c){let u=ne(c).op;if(["navigation","pageload"].includes(u)){et&&C.warn(`[Tracing] Did not create ${l} span because a pageload or navigation span is in progress.`);return}}if(s&&(s.setAttribute(zr,"interactionInterrupted"),s.end(),s=void 0),!o.name){et&&C.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}s=Xc({name:o.name,op:l,attributes:{[vt]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",a,{capture:!0})}var pI="_sentry_idleSpan";function bl(e){return e[pI]}function lI(e,t){Ve(e,pI,t)}var cI=1.5;function lO(e,t){let n=ne(e),r=dn(),o=n.start_timestamp;return!(r-o>cI||t&&r-t<=cI)}var bI=Cn(eo(),1);function xI(e){return Fn(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Uh(e){let t={...e};nl(t,"react"),mi("react",{version:bI.version});let n=Um(t);return Zi(wO),n}function wO(e){return xI(e)?"[SyntheticEvent]":fl(e)}var kI=Cn(eo(),1);function CO(e){let t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}function RO(e,t){let n=new WeakSet;function r(o,i){if(!n.has(o)){if(o.cause)return n.add(o),r(o.cause,i);o.cause=i}}r(e,t)}function NI(e,{componentStack:t},n){if(CO(kI.version)&&Un(e)&&t){let r=new Error(e.message);r.name=`React ErrorBoundary ${e.name}`,r.stack=t,RO(e,r)}return $n(r=>(r.setContext("react",{componentStack:t}),Gr(e,n)))}var Ci=Cn(eo(),1);var AI=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Fh={componentStack:null,error:null,eventId:null},Ds=class extends Ci.Component{constructor(t){super(t),this.state=Fh,this._openFallbackReportDialog=!0;let n=$();n&&t.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=n.on("afterSendEvent",r=>{!r.type&&this._lastEventId&&r.event_id===this._lastEventId&&Ou({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,n){let{componentStack:r}=n,{beforeCapture:o,onError:i,showDialog:s,dialogOptions:a}=this.props;$n(l=>{o&&o(l,t,r);let c=this.props.handled!=null?this.props.handled:!!this.props.fallback,u=NI(t,n,{mechanism:{handled:c,type:"auto.function.react.error_boundary"}});i&&i(t,r,u),s&&(this._lastEventId=u,this._openFallbackReportDialog&&Ou({...a,eventId:u})),this.setState({error:t,componentStack:r,eventId:u})})}componentDidMount(){let{onMount:t}=this.props;t&&t()}componentWillUnmount(){let{error:t,componentStack:n,eventId:r}=this.state,{onUnmount:o}=this.props;o&&(this.state===Fh?o(null,null,null):o(t,n,r)),this._cleanupHook&&(this._cleanupHook(),this._cleanupHook=void 0)}resetErrorBoundary(){let{onReset:t}=this.props,{error:n,componentStack:r,eventId:o}=this.state;t&&t(n,r,o),this.setState(Fh)}render(){let{fallback:t,children:n}=this.props,r=this.state;if(r.componentStack===null)return typeof n=="function"?n():n;let o=typeof t=="function"?Ci.createElement(t,{error:r.error,componentStack:r.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:r.eventId}):t;return Ci.isValidElement(o)?o:(t&&AI&&C.warn("fallback did not produce a valid ReactElement"),null)}};function Bh(e,t){if(e==null||e==="")return t;let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)&&n>=0&&n<=1?n:t}var to=window.__vidfarmSentry,PI=to?.dsn?.trim()||"";if(PI){let e=to?.environment?.trim()||"development",t=e==="production"?.1:1,n=e==="production"?.1:1,r=["localhost",window.location.origin,`${window.location.origin}/api`],o=Array.from(new Set([...r,...to?.tracePropagationTargets??[]].filter(Boolean)));Uh({dsn:PI,environment:e,release:to?.release?.trim()||void 0,integrations:[Ah(),Rh({maskAllText:!0,blockAllMedia:!0})],tracesSampleRate:Bh(to?.tracesSampleRate,t),tracePropagationTargets:o,replaysSessionSampleRate:Bh(to?.replaysSessionSampleRate,n),replaysOnErrorSampleRate:Bh(to?.replaysOnErrorSampleRate,1),enableLogs:to?.enableLogs??!0,sendDefaultPii:to?.sendDefaultPii??!0})}var Gi=Cn(eo(),1),QR=Cn(Mf(),1),ZR=Cn(ZC(),1);var eR=e=>{let t,n=new Set,r=(c,u)=>{let f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){let p=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(h=>h(t,p))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(r,o,a);return a},Pf=(e=>e?eR(e):eR);var Ec=Cn(eo(),1);var kU=e=>e;function tR(e,t=kU){let n=Ec.default.useSyncExternalStore(e.subscribe,Ec.default.useCallback(()=>t(e.getState()),[e,t]),Ec.default.useCallback(()=>t(e.getInitialState()),[e,t]));return Ec.default.useDebugValue(n),n}var NU="[vidfarm]";function AU(e){if(e!=="debug")return!0;if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).has("debug")||window.localStorage?.getItem("VIDFARM_DEBUG")==="1"}catch{return!1}}function eS(e,t,n){let r={event:t,detail:n,timestamp:new Date().toISOString()};typeof window<"u"&&(window.__VIDFARM_DEBUG_LOGS__=window.__VIDFARM_DEBUG_LOGS__??[],window.__VIDFARM_DEBUG_LOGS__.push(r),window.__VIDFARM_DEBUG_LOGS__.length>1e3&&window.__VIDFARM_DEBUG_LOGS__.splice(0,window.__VIDFARM_DEBUG_LOGS__.length-1e3)),AU(e)&&console[e==="debug"?"log":e](NU,t,n??"")}function Or(e,t){eS("info",e,t)}function nR(e,t){eS("warn",e,t)}function po(e,t){eS("error",e,t)}function rR(){typeof window>"u"||window.__VIDFARM_DEBUG_HOOKS__||(window.__VIDFARM_DEBUG_HOOKS__=!0,Or("boot.hooks-installed",{href:window.location.href,readyState:document.readyState,userAgent:navigator.userAgent}),window.addEventListener("error",e=>{po("window.error",{message:e.message,filename:e.filename,lineno:e.lineno,colno:e.colno,error:e.error instanceof Error?e.error.stack:e.error})}),window.addEventListener("unhandledrejection",e=>{po("window.unhandledrejection",{reason:e.reason instanceof Error?e.reason.stack:e.reason})}))}var MU="vidfarm:flockposter-cache:v1",PU="public",Lf={channels:[],posts:[],channelsUpdatedAt:null,calendarUpdatedAt:null,calendarRangeStart:null,calendarRangeEnd:null};function sR(e){return`${MU}_${e?.trim()||PU}`}function nS(e){if(typeof window>"u")return Lf;try{let t=window.localStorage.getItem(sR(e));if(!t)return Lf;let n=JSON.parse(t);return!n||typeof n!="object"?Lf:{channels:Array.isArray(n.channels)?n.channels:[],posts:Array.isArray(n.posts)?n.posts:[],channelsUpdatedAt:typeof n.channelsUpdatedAt=="string"?n.channelsUpdatedAt:null,calendarUpdatedAt:typeof n.calendarUpdatedAt=="string"?n.calendarUpdatedAt:null,calendarRangeStart:typeof n.calendarRangeStart=="string"?n.calendarRangeStart:null,calendarRangeEnd:typeof n.calendarRangeEnd=="string"?n.calendarRangeEnd:null}}catch{return Lf}}function oR(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(sR(t),JSON.stringify(e))}catch{}}function aR(e){let t=nS(e);return Pf((n,r)=>({...t,setChannelsData:o=>{let i=r(),s={...i,channels:[...i.channels.filter(iR),...o.filter(a=>!iR(a))],channelsUpdatedAt:new Date().toISOString()};oR(s,e),n(s)},setCalendarData:o=>{let i=r(),s=LU([...i.channels,...o.channels]),a=o.replaceRange?OU(i.posts,o.posts,o.rangeStart,o.rangeEnd):tS([...i.posts,...o.posts]),l={...i,channels:s,posts:a,channelsUpdatedAt:new Date().toISOString(),calendarUpdatedAt:new Date().toISOString(),calendarRangeStart:DU(i.calendarRangeStart,o.rangeStart),calendarRangeEnd:UU(i.calendarRangeEnd,o.rangeEnd)};oR(l,e),n(l)}}))}function LU(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function iR(e){return e.id.startsWith("email:")||e.platform?.toLowerCase()==="email"}function tS(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function OU(e,t,n,r){let o=Date.parse(n),i=Date.parse(r);return Number.isNaN(o)||Number.isNaN(i)?tS([...e,...t]):tS([...e.filter(s=>{let a=Date.parse(s.scheduledAt);return Number.isNaN(a)||a<o||a>i}),...t])}function DU(e,t){return e?Date.parse(t)<Date.parse(e)?t:e:t}function UU(e,t){return e?Date.parse(t)>Date.parse(e)?t:e:t}function lR(e){return Pf(t=>({boot:e,hydratedAt:null,setHydratedAt:n=>t({hydratedAt:n})}))}var k=Cn(eo(),1),Wi=Cn(Mf(),1);var d=Cn(Tc(),1),Vf=1024*1024,OR=50*Vf,WU=2*Vf,GU=3*Vf,VU=Math.floor(3.5*Vf),qU=2048,DR="chat";function pa(e){let t=e.id||e.attachment_id||e.file_id||"",n=e.fileName||e.file_name,r=e.contentType||e.content_type,o=e.viewUrl||e.view_url||"";return!t||!n||!r||!o?null:{id:t,fileName:n,contentType:r,viewUrl:o,sizeBytes:typeof e.sizeBytes=="number"?e.sizeBytes:e.size_bytes,folderPath:e.folderPath??e.folder_path??""}}function jf(e){return e.contentType.startsWith("image/")}function uS(e){return e.contentType.startsWith("video/")}var YU=new Set(["apng","avif","gif","jpeg","jpg","png","svg","webp"]),KU=new Set(["m4v","mov","mp4","mpeg","mpg","ogv","webm"]),fR=1200,rS=24,oS=80,JU=/^data:([^;,]+)[^,]*,/i,pR=/authorization|api[-_]?key|secret|token|vidfarm-api-key/i,XU=48e3,iS=14,QU=12e3,ZU=1200,eF=30;function Bf(e){if(e==null||e==="")return"";if(typeof e=="string")try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}return JSON.stringify(e,null,2)}function Hf(e){let t=JU.exec(e);return t?`[${t[1]} data URL omitted, ${e.length.toLocaleString()} chars]`:e.length>fR?`${e.slice(0,fR)}\u2026 [truncated ${e.length.toLocaleString()} chars]`:e}function ji(e,t=0){if(e==null)return e;if(typeof e=="string")return Hf(e);if(typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return e.toString();if(!(typeof e=="function"||typeof e=="symbol")){if(t>=8)return"[nested payload omitted]";if(Array.isArray(e)){let n=e.slice(0,rS).map(r=>ji(r,t+1));return e.length>rS&&n.push(`[${e.length-rS} more items omitted]`),n}if(typeof e=="object"){let n={},r=Object.entries(e);for(let[o,i]of r.slice(0,oS)){let s=ji(i,t+1);s!==void 0&&(n[o]=s)}return r.length>oS&&(n.__omitted_keys=r.length-oS),n}return String(e)}}function UR(e){return ji(e)}function Cc(e){return{...e,request:{...e.request,headers:Object.fromEntries(Object.entries(e.request.headers).map(([t,n])=>[t,pR.test(t)?"[redacted]":Hf(n)])),body:ji(e.request.body)},result:{...e.result,headers:Object.fromEntries(Object.entries(e.result.headers).map(([t,n])=>[t,pR.test(t)?"[redacted]":Hf(n)])),body:ji(e.result.body),error:e.result.error?Hf(e.result.error):e.result.error}}}function tF(){let e=new Date,t=null,n=null;try{t=new Intl.DateTimeFormat(void 0,{dateStyle:"full",timeStyle:"long"}).format(e)}catch{t=e.toString()}try{n=Intl.DateTimeFormat().resolvedOptions().timeZone||null}catch{n=null}return{currentDateTime:e.toISOString(),localDateTime:t,timeZone:n}}function FR(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function sS(e){let t=FR(e);return t=t.replace(/`([^`]+)`/g,"<code>$1</code>"),t=t.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),t=t.replace(/(^|[^\*])\*([^*]+)\*(?!\*)/g,"$1<em>$2</em>"),t=t.replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'),t=t.replace(/(^|[\s(])(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/g,'$1<a href="$2" target="_blank" rel="noopener noreferrer">$2</a>'),t}function BR(e){let t=e.replace(/\r\n/g,`
|
|
32
|
+
`).trim();return t?t.split(/\n{2,}/).map(r=>{let o=r.trim();if(!o)return"";if(o.startsWith("```")&&o.endsWith("```")){let l=o.replace(/^```[^\n]*\n?/,"").replace(/\n?```$/,"");return`<pre><code>${FR(l)}</code></pre>`}let i=o.split(`
|
|
33
|
+
`);return i.every(l=>/^[-*]\s+/.test(l.trim()))?`<ul>${i.map(c=>c.trim().replace(/^[-*]\s+/,"")).map(c=>`<li>${sS(c)}</li>`).join("")}</ul>`:i.every(l=>/^\d+\.\s+/.test(l.trim()))?`<ol>${i.map(c=>c.trim().replace(/^\d+\.\s+/,"")).map(c=>`<li>${sS(c)}</li>`).join("")}</ol>`:`<p>${i.map(l=>sS(l.trim())).join("<br />")}</p>`}).filter(Boolean).join(""):""}function nF(e){return e.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase())}function rF(e){return/^item \d+$/i.test(e.trim())||/^output$/i.test(e.trim())}function oF(e){try{let n=new URL(e).searchParams.get("key");return n?.trim()?n.trim().replace(/^\/+/,""):null}catch{return null}}function Wf(e){try{return decodeURIComponent(e)}catch{return e}}function mS(e){let t=oF(e);if(t){let n=Wf(t.split("/").filter(Boolean).pop()||"");if(n)return n}try{let n=new URL(e).pathname;return Wf(n.split("/").filter(Boolean).pop()||"")}catch{return""}}function HR(e){return mS(e)||"Output"}function $R(e,t){let n=mS(e);return n||t.trim().replace(/[\\/:*?"<>|]+/g,"-")||"download"}function iF(e){let n=mS(e).split(".").pop()?.trim().toLowerCase()||"";return YU.has(n)?"image":KU.has(n)?"video":null}function sF(e){let t=new Set,n=/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,r=/(^|[\s(])(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/gm,o=null;for(;(o=n.exec(e))!==null;)t.add(o[2]);for(;(o=r.exec(e))!==null;)t.add(o[2]);return[...t]}function aF(e,t=[]){let n=new Set(t),r=new Set,o=[];for(let i of sF(e)){if(n.has(i)||r.has(i))continue;let s=iF(i);s&&(r.add(i),o.push({kind:s,url:i,label:HR(i)}))}return o}function dS(e,t,n=new Set,r=[]){if(!(t.length>=12||e==null)){if(typeof e=="string"){let o=e.trim();if(/^https?:\/\//i.test(o)&&!n.has(o)){n.add(o);let i=r.length?r[r.length-1]||"Output":"",s=nF(i),a=HR(o);t.push({label:a!=="Output"?a:s&&!rF(i)?s:a,url:o})}return}if(Array.isArray(e)){for(let[o,i]of e.entries())if(dS(i,t,n,[...r,`item ${o+1}`]),t.length>=12)return;return}if(typeof e=="object"){for(let[o,i]of Object.entries(e))if(dS(i,t,n,[...r,o]),t.length>=12)return}}}function mR(e){return[`Started render \`${e.job_id}\`${e.tracer?` with tracer \`${e.tracer}\``:""}.`,"If it takes a while, ask for an update later and I can check it for you."].join(`
|
|
34
34
|
|
|
35
|
-
`)}function
|
|
36
|
-
`)}return e.status==="failed"?`Render \`${e.job_id}\` failed.${e.error?.message?` ${e.error.message}`:""}`:e.status==="cancelled"?`Render \`${e.job_id}\` was cancelled.`:`Render \`${e.job_id}\` is ${e.status}.`}function
|
|
35
|
+
`)}function hS(e){return typeof e=="string"&&e.startsWith("primitive:brainstorm_")}function gS(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(!n||typeof n!="object")continue;let r=n,o={artifact_id:typeof r.artifact_id=="string"?r.artifact_id:void 0,kind:typeof r.kind=="string"?r.kind:void 0,storage_key:typeof r.storage_key=="string"?r.storage_key:void 0,public_url:typeof r.public_url=="string"?r.public_url:void 0,metadata:r.metadata&&typeof r.metadata=="object"?r.metadata:null,created_at:typeof r.created_at=="string"?r.created_at:void 0};(o.public_url||o.storage_key)&&t.push(o)}return t}function zR(e){return e?Wf(e.split("/").filter(Boolean).pop()||"result.json"):"JSON result"}function lF(e){return Wf(e?.split("/").filter(Boolean).pop()||"")}function cF(e){switch(e){case"primitive:brainstorm_hooks":return"Hooks JSON";case"primitive:brainstorm_angles":return"Angles JSON";case"primitive:brainstorm_awareness_stages":return"Awareness JSON";case"primitive:brainstorm_coldstart":return"Coldstart JSON";default:return"Brainstorm JSON"}}function jR(e){if(e.status!=="succeeded"||!hS(e.primitive_id))return[];let t=[];for(let[n,r]of gS(e.artifacts).entries()){let o=r.public_url?.trim(),i=r.storage_key?.trim();if(!(r.kind==="json"||!!(o&&/\.json(?:[?#]|$)/i.test(o))||!!(i&&/\.json$/i.test(i)))||!o)continue;let a=zR(r.storage_key),l=cF(e.primitive_id);t.push({key:r.artifact_id||`${e.job_id}:${o}:${n}`,url:o,label:a==="result.json"?l:`${l} \u2022 ${a}`,primitiveId:e.primitive_id,primitiveType:e.primitive_type,jobId:e.job_id})}return t}function uF(e){return e==="primitive:brainstorm_awareness_stages"?"Awareness response":"Brainstorm response"}function WR(e){if(e.status!=="succeeded"||!hS(e.primitive_id))return[];let t=[];for(let[n,r]of gS(e.artifacts).entries()){let o=r.public_url?.trim(),i=r.storage_key?.trim(),s=lF(i),a=/^prompt\./i.test(s),l=r.kind==="text"?!!(o&&/\.md(?:[?#]|$)/i.test(o)||i&&/\.md$/i.test(i)):!!(o&&/\.md(?:[?#]|$)/i.test(o)||i&&/\.md$/i.test(i)),c=!!(o&&/\.txt(?:[?#]|$)/i.test(o)||i&&/\.txt$/i.test(i));if(!o||a||!l&&!c)continue;let u=uF(e.primitive_id);t.push({key:r.artifact_id||`${e.job_id}:${o}:${n}`,url:o,label:s==="response.md"||s==="response.txt"?u:zR(i),jobId:e.job_id,format:l?"markdown":"text"})}return t}function Df(e){if(e.status==="succeeded"){let t=[];dS(e.result,t);let n=[`Render \`${e.job_id}\` succeeded.`];return hS(e.primitive_id)&&(jR(e).length||WR(e).length)&&(n.push(""),n.push("Open the result below. It contains the brainstorm output you can review, copy, and reuse.")),t.length&&(n.push(""),n.push("Outputs:"),n.push(...t.map(({url:r,label:o})=>`- [${o}](${r})`))),n.join(`
|
|
36
|
+
`)}return e.status==="failed"?`Render \`${e.job_id}\` failed.${e.error?.message?` ${e.error.message}`:""}`:e.status==="cancelled"?`Render \`${e.job_id}\` was cancelled.`:`Render \`${e.job_id}\` is ${e.status}.`}function Ic(e,t){let n=e.trim(),r=t.trim();return!r||n.includes(r)?e:n?`${n}
|
|
37
37
|
|
|
38
|
-
${r}`:r}var
|
|
38
|
+
${r}`:r}var dF=48;function fF(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=dF}function pF(e,t){let n=[...e??[]],r=n.findIndex(o=>o.pollMode==="automatic"&&o.pollJobId===t.pollJobId);return r===-1?(n.push(t),n):(n[r]=t,n)}var hR=3e4,mF=18e4,gR=4,yR=40,hF=1500,SR=250;function $i(e){if(!e||typeof e!="object")return null;let t=e;return typeof t.job_id!="string"||typeof t.status!="string"?null:{job_id:t.job_id,tracer:typeof t.tracer=="string"?t.tracer:void 0,status:t.status,primitive_id:typeof t.primitive_id=="string"?t.primitive_id:void 0,primitive_type:typeof t.primitive_type=="string"?t.primitive_type:void 0,operation_name:typeof t.operation_name=="string"?t.operation_name:void 0,progress:typeof t.progress=="number"?t.progress:null,result:t.result,artifacts:gS(t.artifacts),error:t.error&&typeof t.error=="object"?{message:typeof t.error.message=="string"?t.error.message:void 0,type:typeof t.error.type=="string"?t.error.type:void 0}:null}}function gF(e){if(!e)return!1;try{let t=typeof window<"u"?window.location.origin:"http://localhost";return new URL(e,t).pathname.startsWith("/api/v1/primitives")}catch{return!1}}function fa(e){return e==="succeeded"||e==="failed"||e==="cancelled"}function _R(e,t,n){return`${e}::${t}::${n}`}function ut(e,t){let n=new Headers;return e&&n.set("vidfarm-api-key",e),t&&n.set("content-type",t),n}async function zi(e){return await e.json()}async function aS(e){return await new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{if(typeof r.result=="string"){t(r.result);return}n(new Error("Unable to read attachment contents."))},r.onerror=()=>n(r.error??new Error("Unable to read attachment contents.")),r.readAsDataURL(e)})}async function vR(e){return await new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{if(typeof r.result=="string"){t(r.result);return}n(new Error("Unable to read compressed attachment contents."))},r.onerror=()=>n(r.error??new Error("Unable to read compressed attachment contents.")),r.readAsDataURL(e)})}function yF(e){if(!e)return 0;let t=";base64,",n=e.indexOf(t);if(n<0)return e.length;let r=e.slice(n+t.length).replace(/\s/g,""),o=r.endsWith("==")?2:r.endsWith("=")?1:0;return Math.max(0,Math.floor(r.length*3/4)-o)}function GR(e){return e.reduce((t,n)=>t+yF(n.transportData),0)}async function SF(e,t,n){return await new Promise(r=>{e.toBlob(o=>r(o),t,n)})}async function _F(e){if(typeof createImageBitmap=="function")try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,close:()=>t.close()}}catch{}return await new Promise(t=>{let n=new Image,r=URL.createObjectURL(e);n.onload=()=>{URL.revokeObjectURL(r),t({source:n,width:n.naturalWidth||n.width,height:n.naturalHeight||n.height})},n.onerror=()=>{URL.revokeObjectURL(r),t(null)},n.src=r})}async function vF(e,t){if(!e.type.startsWith("image/")||t<=0)return;let n=Math.min(GU,t),r=Math.min(WU,n);if(e.size<=r)return aS(e);let o=await _F(e);if(!o||o.width<=0||o.height<=0)return e.size<=n?aS(e):void 0;try{let i=null,s=[qU,1600,1280,1024],a=[.86,.78,.7,.62,.54];for(let l of s){let c=Math.min(1,l/Math.max(o.width,o.height)),u=Math.max(1,Math.round(o.width*c)),f=Math.max(1,Math.round(o.height*c)),p=document.createElement("canvas");p.width=u,p.height=f;let h=p.getContext("2d");if(h){h.fillStyle="#fff",h.fillRect(0,0,u,f),h.drawImage(o.source,0,0,u,f);for(let y of a){let _=await SF(p,"image/jpeg",y);if(_&&(_.size<=n&&(!i||_.size<i.size)&&(i=_),_.size<=r))return vR(_)}}}return i&&(e.size>n||i.size<e.size)?vR(i):e.size<=n?aS(e):void 0}finally{o.close?.()}}async function VR(e){let t=VU-e.currentInlineBytes,n=await vF(e.file,t).catch(()=>{});return n?{...e.attachment,transportData:n}:e.attachment}async function EF(e){let t=e.maxBytes??OR,n=e.limitLabel??"50 MB";if(e.file.size>t)throw new Error(`File uploads can be at most ${n}.`);let r=new FormData;r.append("file",e.file),r.append("folder_path",e.folderPath||""),Or("chat.upload.attempt",{file_name:e.file.name,size_bytes:e.file.size,folder_path:e.folderPath});let o=await fetch("/api/v1/user/me/attachments/upload",{method:"POST",headers:ut(e.apiKey),body:r}),i=await zi(o);if(!o.ok||!i.attachment)throw po("chat.upload.failed",{file_name:e.file.name,status:o.status,error:i.error}),new Error(i.error||"Unable to upload attachment.");return Or("chat.upload.succeeded",{file_name:e.file.name,attachment_id:i.attachment.id}),pa(i.attachment)??(()=>{throw new Error("Attachment response was incomplete.")})()}async function TF(e){let t=await fetch("/api/v1/user/me/attachments",{headers:ut(e)}),n=await zi(t);if(!t.ok)throw new Error(n.error||"Unable to load My Files.");let r=[];for(let o of n.attachments??[]){let i=pa(o);i&&r.push({...i,createdAt:o.createdAt??o.created_at})}return{attachments:r,folders:n.folders??[]}}async function qR(e){if(e.file.size>100*1024*1024)throw new Error("Temporary files can be at most 100 MB.");Or("chat.temp_upload.attempt",{file_name:e.file.name,size_bytes:e.file.size,content_type:e.file.type});let t=await fetch("/api/v1/user/me/temporary-files/presign",{method:"POST",headers:ut(e.apiKey,"application/json"),body:JSON.stringify({file_name:e.file.name,content_type:e.file.type||void 0,size_bytes:e.file.size,folder_path:e.folderPath||void 0})}),n=await zi(t);if(!t.ok||!("transport"in n))throw new Error("error"in n&&n.error||"Unable to prepare temporary upload.");if(n.transport==="server"){let a=new FormData;a.append(n.upload.form_field||"file",e.file),a.append("folder_path",e.folderPath||"");let l=await fetch(n.upload.url,{method:n.upload.method||"POST",headers:ut(e.apiKey),body:a}),c=await zi(l);if(!l.ok||!c.file)throw new Error(c.error||"Unable to upload temporary file.");let u=pa(c.file);if(!u)throw new Error("Temporary file response was incomplete.");return{...u,createdAt:c.file.createdAt??c.file.created_at,expiresAt:c.file.expiresAt??c.file.expires_at,s3Url:c.file.s3Url??c.file.s3_url}}let r=await fetch(n.upload.url,{method:n.upload.method,headers:n.upload.headers,body:e.file});if(!r.ok)throw new Error(`Upload failed with status ${r.status}.`);let o=await fetch("/api/v1/user/me/temporary-files",{method:"POST",headers:ut(e.apiKey,"application/json"),body:JSON.stringify({file_id:n.file_id,file_name:n.file_name,content_type:n.content_type,size_bytes:e.file.size,storage_key:n.storage_key,folder_path:n.folder_path||e.folderPath||""})}),i=await zi(o);if(!o.ok||!i.file)throw new Error(i.error||"Unable to save temporary file.");let s=pa(i.file);if(!s)throw new Error("Temporary file response was incomplete.");return{...s,createdAt:i.file.createdAt??i.file.created_at,expiresAt:i.file.expiresAt??i.file.expires_at,s3Url:i.file.s3Url??i.file.s3_url}}async function IF(e){let t=await fetch("/api/v1/user/me/temporary-files",{headers:ut(e)}),n=await zi(t);if(!t.ok)throw new Error(n.error||"Unable to load temporary files.");let r=[];for(let o of n.files??[]){let i=pa(o);i&&r.push({...i,createdAt:o.createdAt??o.created_at,expiresAt:o.expiresAt??o.expires_at,s3Url:o.s3Url??o.s3_url})}return{files:r,folders:n.folders??[]}}async function ER(e,t){let n=new URL("/api/v1/user/me/generated-media",window.location.origin);n.searchParams.set("limit","24"),t&&n.searchParams.set("cursor",t);let r=await fetch(`${n.pathname}${n.search}`,{headers:ut(e)}),o=await zi(r);if(!r.ok)throw new Error(o.error||"Unable to load recent media.");let i=[];for(let s of o.media??[]){let a=pa(s);a&&i.push({...a,createdAt:s.createdAt??s.created_at,jobId:typeof s.job_id=="string"?s.job_id:void 0,tracer:typeof s.tracer=="string"?s.tracer:void 0,templateId:typeof s.template_id=="string"?s.template_id:void 0})}return{media:i,nextCursor:o.next_cursor??null}}function wF(e){return e.reduce((t,n)=>{let r=n.attachments.reduce((o,i)=>o+i.fileName.length+i.contentType.length+32,0);return t+n.text.length+r},0)}function CF(e,t){let n=e.trim().replace(/\s+/g," ");return n.length<=t?n:`${n.slice(0,Math.max(0,t-32)).trimEnd()}\u2026 [truncated]`}function RF(e){if(e.length<=iS||wF(e)<=XU)return e;let t=e.slice(-iS),n=e.slice(0,-iS),r=[],o=0;for(let i of n){let s=i.attachments.length?` Attachments: ${i.attachments.map(l=>`${l.fileName} (${l.contentType})`).join(", ")}.`:"",a=`[${i.role}]: ${CF(`${i.text}${s}`,ZU)}`;if(o+a.length>QU){r.push(`[${n.length-r.length} earlier messages omitted]`);break}r.push(a),o+=a.length}return[{id:$f("assistant"),role:"assistant",text:["[Earlier in this conversation - compacted summary]","Older turns were summarized before sending this request so the chat can continue efficiently.","",r.join(`
|
|
39
39
|
|
|
40
40
|
`)].join(`
|
|
41
|
-
`),attachments:[]},...t]}function
|
|
42
|
-
`):null}function
|
|
41
|
+
`),attachments:[]},...t]}function xF(e){return e.length?["Attached file URLs for REST payloads:",...e.map(n=>`- ${n.fileName} (${n.contentType}): ${n.viewUrl}`),"Use these exact URLs as prompt_attachments for primitive image generation, source_image_url for primitive image edits, media_url for primitive video slides, or reference attachment URLs when calling template routes."].join(`
|
|
42
|
+
`):null}function bF(e){let t=e.length-1;return e.map((n,r)=>{let o=xF(n.attachments);return{role:n.role,content:[...n.text?[{type:"text",text:n.text}]:[],...o?[{type:"text",text:o}]:[],...n.attachments.map(i=>({type:"file",data:r===t&&i.transportData||i.viewUrl,mediaType:i.contentType}))]}})}function kF(){let t=window.__vidfarmFlockPosterCache?.readSnapshot?.();if(!t)return{};let n=Array.isArray(t?.channels)?t.channels.map(r=>r&&typeof r=="object"?r:null).filter(r=>typeof r?.id=="string"&&!!r.id.trim()).map(r=>({id:String(r?.id||""),name:typeof r?.name=="string"?r.name:null,title:typeof r?.title=="string"?r.title:null,handle:typeof r?.handle=="string"?r.handle:null,platform:typeof r?.platform=="string"?r.platform:null,status:typeof r?.status=="string"?r.status:null})):[];return n.length||t?.channelsUpdatedAt?{scheduleChannels:n,scheduleChannelsUpdatedAt:t?.channelsUpdatedAt??null}:{}}function NF(){let e=window.__vidfarmLibrarySelection?.readSelectedPosts?.();return{selectedPosts:Array.isArray(e?.posts)?e.posts.map(n=>n&&typeof n=="object"?n:null).filter(n=>typeof n?.post_id=="string"&&!!n.post_id.trim()).map(n=>({post_id:String(n?.post_id||""),title:typeof n?.title=="string"?n.title:null,caption:typeof n?.caption=="string"?n.caption:null,tracer:typeof n?.tracer=="string"?n.tracer:null,status:typeof n?.status=="string"?n.status:null,share_url:typeof n?.share_url=="string"?n.share_url:null,media:Array.isArray(n?.media)?n.media.slice(0,8).map(r=>r&&typeof r=="object"?r:null).filter(Boolean).map(r=>({url:typeof r?.url=="string"?r.url:null,kind:typeof r?.kind=="string"?r.kind:null,role:typeof r?.role=="string"?r.role:null,content_type:typeof r?.content_type=="string"?r.content_type:null})):[]})):[],selectedPostsUpdatedAt:e?.updatedAt??null}}async function AF(e,t){if(!e.body)throw new Error("Chat response did not include a body.");let n=e.body.getReader(),r=new TextDecoder,o="";for(;;){let{done:i,value:s}=await n.read();if(i)break;o+=r.decode(s,{stream:!0});let a=o.split(`
|
|
43
43
|
|
|
44
44
|
`);o=a.pop()??"";for(let l of a){let c=l.split(`
|
|
45
|
-
`).map(h=>h.trim()).find(h=>h.startsWith("data:"));if(!c)continue;let u=c.slice(5).trim();if(u==="[DONE]")continue;let d;try{d=JSON.parse(u)}catch{continue}if(!d||typeof d!="object")continue;let p=d;if(p.type==="text-delta"&&typeof p.delta=="string")t.onDelta(p.delta);else if(p.type==="status"){let h=typeof p.status=="string"?p.status:typeof p.message=="string"?p.message:null;h&&t.onStatus&&t.onStatus(h)}else p.type==="tool-call"&&typeof p.toolCallId=="string"&&typeof p.toolName=="string"&&t.onToolCall?t.onToolCall({toolCallId:p.toolCallId,toolName:p.toolName,args:p.args&&typeof p.args=="object"?p.args:void 0}):p.type==="tool-result"&&typeof p.toolCallId=="string"&&typeof p.toolName=="string"&&t.onToolResult?t.onToolResult({toolCallId:p.toolCallId,toolName:p.toolName,result:p.result}):p.type==="error"&&t.onError&&t.onError?.(typeof p.errorText=="string"?p.errorText:typeof p.error?.message=="string"?p.error.message:"Unable to read assistant response.")}}}function NF(e){return{threads:`vidfarm-editor-chat-threads:${e}`,activeThread:`vidfarm-editor-chat-active-thread:${e}`}}function AF(){if(typeof window>"u")return null;try{return window.sessionStorage}catch{try{return window.localStorage}catch{return null}}}function vR(){return`thread-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function Bf(e){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`${e}-${crypto.randomUUID()}`:`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function tr(e){let t=new Set,n=[];for(let r of e){let o=r.trim();!o||t.has(o)||(t.add(o),n.push(o))}return n}function sS(...e){return tr(e.flat())}function MF(e){let t=e.trim();return!t||t.startsWith("archived_")?t:`archived_${t}`}function uS(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID().replace(/-/g,"").slice(-8):Math.random().toString(16).slice(2,10).padEnd(8,"0").slice(0,8)}function PF(e){return(e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"tracer").slice(0,28)}function LF(e,t){let n=PF(e),r="";do r=`${n}-${uS()}`;while(t.includes(r));return r}function OF(e,t){let n=e.trim();if(!n)return"";if(/-[a-z0-9]{8}$/i.test(n))return n;let r=`${n}-${uS()}`;for(;t.includes(r);)r=`${n}-${uS()}`;return r}function Hf(){let e=new URLSearchParams(window.location.search),t=[...e.getAll("tracers"),...e.getAll("tracer")],n=[];for(let r of t){let o=r.trim();if(!o)continue;let i=o.startsWith("[")&&o.endsWith("]")?o.slice(1,-1):o;n.push(...i.split(",").map(s=>s.trim().replace(/^["']|["']$/g,"")))}return tr(n)}function ER(){let e=new URLSearchParams(window.location.search);return(e.get("thread_id")||e.get("threadId")||e.get("chat_id")||e.get("chatId")||"").trim()}function Of(e){let t=e.trim().replace(/\s+/g," ");return t?t.length>42?`${t.slice(0,42).trimEnd()}\u2026`:t:"New chat"}function TR(e,t){return e.map(n=>({id:n.id,templateId:n.templateId,title:n.title,createdAt:n.createdAt,updatedAt:n.updatedAt,lastMessageAt:n.lastMessageAt??null,messageCount:Math.max(n.messageCount??0,n.messages.length),tracers:n.tracers,hiddenFromView:n.hiddenFromView,messages:(n.id===t?n.messages.slice(-QU):[]).map(r=>({id:r.id,role:r.role,text:r.text,attachments:r.attachments.map(o=>({id:o.id,fileName:o.fileName,contentType:o.contentType,viewUrl:o.viewUrl})),toolExchanges:r.toolExchanges?.map(o=>({...o,args:zi(o.args),result:OR(o.result)})),httpExchanges:r.httpExchanges?.map(Ic)}))}))}function DF(e,t){if(!e)return[];try{let n=JSON.parse(e);return Array.isArray(n)?n.filter(r=>r&&typeof r.id=="string").map(r=>({id:r.id,templateId:typeof r.templateId=="string"&&r.templateId.trim()?r.templateId:t,title:typeof r.title=="string"&&r.title.trim()?r.title:"New chat",createdAt:typeof r.createdAt=="string"?r.createdAt:new Date().toISOString(),updatedAt:typeof r.updatedAt=="string"?r.updatedAt:new Date().toISOString(),lastMessageAt:typeof r.lastMessageAt=="string"?r.lastMessageAt:null,messageCount:Math.max(typeof r.messageCount=="number"?r.messageCount:0,Array.isArray(r.messages)?r.messages.length:0),tracers:tr(Array.isArray(r.tracers)?r.tracers.filter(o=>typeof o=="string"):[]),hiddenFromView:r.hiddenFromView===!0,messages:Array.isArray(r.messages)?r.messages.map(o=>({id:o.id,role:o.role,text:o.text,attachments:Array.isArray(o.attachments)?o.attachments:[],toolExchanges:Array.isArray(o.toolExchanges)?o.toolExchanges:[],httpExchanges:Array.isArray(o.httpExchanges)?o.httpExchanges:[]})):[]})):[]}catch{return[]}}function IR(e,t){return!e||typeof e.id!="string"?null:{id:e.id,templateId:typeof e.templateId=="string"&&e.templateId.trim()?e.templateId:t,title:typeof e.title=="string"&&e.title.trim()?e.title:"New chat",createdAt:typeof e.createdAt=="string"?e.createdAt:new Date().toISOString(),updatedAt:typeof e.updatedAt=="string"?e.updatedAt:new Date().toISOString(),lastMessageAt:typeof e.lastMessageAt=="string"?e.lastMessageAt:null,messageCount:Math.max(typeof e.messageCount=="number"?e.messageCount:0,Array.isArray(e.messages)?e.messages.length:0),tracers:tr(Array.isArray(e.tracers)?e.tracers.filter(n=>typeof n=="string"):[]),hiddenFromView:e.hiddenFromView===!0,messages:Array.isArray(e.messages)?e.messages.map(n=>({id:n.id,role:n.role,text:n.text,attachments:Array.isArray(n.attachments)?n.attachments:[],toolExchanges:Array.isArray(n.toolExchanges)?n.toolExchanges:[],httpExchanges:Array.isArray(n.httpExchanges)?n.httpExchanges:[]})):[]}}function wR(e,t){let n=new Map;for(let r of t){let o=e.find(i=>i.id===r.id);n.set(r.id,{...r,lastMessageAt:r.lastMessageAt??o?.lastMessageAt??null,messageCount:Math.max(r.messageCount??0,o?.messageCount??0,r.messages.length,o?.messages.length??0),messages:r.messages.length?r.messages:o?.messages??[]})}for(let r of e)n.has(r.id)||n.set(r.id,r);return[...n.values()].sort((r,o)=>Date.parse(o.updatedAt)-Date.parse(r.updatedAt))}function UF(e){return[...e].sort((t,n)=>Date.parse(n.updatedAt)-Date.parse(t.updatedAt))}function Tc(e,t){return t.length?e.tracers.some(n=>t.some(r=>FF(n,r))):!0}function FF(e,t){let n=e.trim(),r=t.trim();return!n||!r?!1:n===r?!0:n.startsWith(`${r}-`)&&/-[a-z0-9]{8}$/i.test(n)}function BF(e){return(0,f.jsxs)("div",{className:"vf-editor-chat-attachment",children:[(0,f.jsx)("span",{className:"vf-editor-chat-attachment-name",children:e.attachment.fileName}),e.onRemove?(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-attachment-remove","aria-label":"Remove attachment",onClick:e.onRemove,children:"\xD7"}):null]})}function hS(){return(0,f.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("path",{d:"M10 3v9"}),(0,f.jsx)("path",{d:"m6.5 8.5 3.5 3.5 3.5-3.5"}),(0,f.jsx)("path",{d:"M4 16h12"})]})}function HF(){return(0,f.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("path",{d:"M4.2 15.8c1.6.5 3.1-.1 3.7-1.7.6-1.4 1.8-2.1 3.5-2.1"}),(0,f.jsx)("path",{d:"m10.7 11.6 5.2-5.2a1.9 1.9 0 0 0-2.7-2.7L8 8.9"}),(0,f.jsx)("path",{d:"m7.9 9 3.1 3.1"}),(0,f.jsx)("path",{d:"M3.5 16.5c1.4.5 3.6.5 4.9-.8"})]})}function gS(){return(0,f.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("path",{d:"M8.4 11.6a3.2 3.2 0 0 0 4.5 0l2.2-2.2a3.2 3.2 0 0 0-4.5-4.5L9.4 6.1"}),(0,f.jsx)("path",{d:"M11.6 8.4a3.2 3.2 0 0 0-4.5 0L4.9 10.6a3.2 3.2 0 0 0 4.5 4.5l1.2-1.2"})]})}function yS(){return(0,f.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("rect",{x:"7",y:"7",width:"9",height:"9",rx:"2"}),(0,f.jsx)("path",{d:"M5 12H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1"})]})}function Df(e){return(0,f.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{transform:e.open?"rotate(90deg)":"rotate(0deg)"},children:(0,f.jsx)("path",{d:"m7 4 6 6-6 6"})})}function VR(e){let t=e.label.trim().replace(/[\\/:*?"<>|]+/g,"-");if(t)return t;try{return new URL(e.url,window.location.href).pathname.split("/").filter(Boolean).pop()||"media"}catch{return"media"}}function CR(e,t=!1){if(typeof window>"u"||e.kind!=="image"||!e.url)return"";let n=new URL("/inpaint",window.location.origin),r=window.__vidfarmEditorTracers,i=(r?.get()??Hf())[0]||(t?r?.add()??"":"");return i&&n.searchParams.set("tracer",i),n.searchParams.set("source_image_url",e.url),n.searchParams.set("source_image_name",e.label||VR(e)),n.toString()}function $F(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(""),{onClose:i}=e,s=e.gallery?.length?e.gallery:[e.preview],a=Math.max(0,s.findIndex(T=>T.url===e.preview.url)),[l,c]=(0,k.useState)(a),u=s[l]||e.preview,d=s.length>1,p=u.kind==="image",h=p&&CR(u,!1)||"/inpaint";(0,k.useEffect)(()=>{n(!0)},[]),(0,k.useEffect)(()=>{o("")},[u.url]);let y=async()=>{try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(u.url);else{let T=document.createElement("textarea");T.value=u.url,T.style.position="fixed",T.style.opacity="0",document.body.appendChild(T),T.focus(),T.select(),document.execCommand("copy"),document.body.removeChild(T)}o("done")}catch{o("error")}window.setTimeout(()=>o(""),1600)},_=T=>{let g=CR(u,!0);if(!g){T.preventDefault();return}T.preventDefault(),window.open(g,"_blank","noopener,noreferrer")};return(0,k.useEffect)(()=>{let T=g=>{if(g.key==="Escape"){i();return}d&&(g.key==="ArrowLeft"?(g.preventDefault(),c(S=>(S-1+s.length)%s.length)):g.key==="ArrowRight"&&(g.preventDefault(),c(S=>(S+1)%s.length)))};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[d,s.length,i]),t?(0,ji.createPortal)((0,f.jsx)("div",{className:"vf-editor-chat-media-modal-backdrop",onClick:e.onClose,children:(0,f.jsxs)("div",{className:"vf-editor-chat-media-modal",onClick:T=>T.stopPropagation(),children:[(0,f.jsxs)("div",{className:"vf-editor-chat-media-modal-header",children:[(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-link",href:u.url,target:"_blank",rel:"noopener noreferrer",children:d?`${u.label} (${l+1} of ${s.length})`:u.label}),(0,f.jsxs)("div",{className:"vf-editor-chat-media-modal-actions",children:[d?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:()=>c(T=>(T-1+s.length)%s.length),"aria-label":"Previous image",title:"Previous image",children:"\u2039"}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:()=>c(T=>(T+1)%s.length),"aria-label":"Next image",title:"Next image",children:"\u203A"})]}):null,p?(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:h,target:"_blank",rel:"noopener noreferrer",onClick:_,"aria-label":"Open image editor",title:"Image edit",children:(0,f.jsx)(HF,{})}):null,(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:u.url,download:VR(u),"aria-label":"Download media",title:"Download",children:(0,f.jsx)(hS,{})}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control","data-state":r,onClick:()=>{y()},"aria-label":r==="done"?"Media URL copied":r==="error"?"Unable to copy media URL":"Copy media URL",title:r==="done"?"Copied":r==="error"?"Copy failed":"Copy link",children:(0,f.jsx)(gS,{})}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:e.onClose,"aria-label":"Close media preview",title:"Close",children:"\xD7"})]})]}),(0,f.jsx)("div",{className:"vf-editor-chat-media-modal-body",children:u.kind==="image"?(0,f.jsx)("img",{src:u.url,alt:u.label,className:"vf-editor-chat-media-modal-image"}):(0,f.jsx)("video",{src:u.url,className:"vf-editor-chat-media-modal-video",controls:!0,autoPlay:!0,playsInline:!0})})]})}),document.body):null}function zF(e){let[t,n]=(0,k.useState)(!1);return(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-message-thumb-button is-image",onClick:()=>e.onOpenModal(e.preview,e.previews),"aria-label":`Preview ${e.preview.label}`,title:e.preview.label,"data-error":t?"true":"false",children:t?(0,f.jsx)("span",{className:"vf-editor-chat-message-thumb-fallback",children:"Preview unavailable"}):(0,f.jsx)("img",{src:e.preview.url,alt:e.preview.label,className:"vf-editor-chat-message-attachment-thumb",loading:"lazy",onError:()=>n(!0)})})}function RR(e){return(0,f.jsx)("div",{className:"vf-editor-chat-message-attachment-row",children:(0,f.jsxs)("button",{type:"button",className:"vf-editor-chat-message-thumb-button",onClick:()=>e.onOpenModal(e.preview),"aria-label":`Preview ${e.preview.label}`,children:[(0,f.jsx)("video",{src:e.preview.url,className:"vf-editor-chat-message-attachment-thumb vf-editor-chat-message-video-thumb",preload:"metadata",muted:!0,playsInline:!0}),(0,f.jsx)("span",{className:"vf-editor-chat-message-video-play","aria-hidden":"true"})]})})}function xR(e){return e.previews.length?(0,f.jsx)("div",{className:"vf-editor-chat-message-image-rail","aria-label":"Image previews",children:e.previews.map(t=>(0,f.jsx)(zF,{preview:t,previews:e.previews,onOpenModal:e.onOpenModal},t.url))}):null}function jF(e){return(0,f.jsxs)("div",{className:"vf-editor-chat-composer-attachment-item",children:[$f(e.attachment)?(0,f.jsx)("img",{src:e.attachment.viewUrl,alt:e.attachment.fileName,className:"vf-editor-chat-composer-attachment-thumb"}):(0,f.jsx)("div",{className:"vf-editor-chat-composer-attachment-file","aria-hidden":"true",children:e.attachment.fileName.slice(0,1).toUpperCase()}),(0,f.jsx)("div",{className:"vf-editor-chat-composer-attachment-meta",children:(0,f.jsx)("span",{className:"vf-editor-chat-composer-attachment-name",children:e.attachment.fileName})}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-composer-attachment-remove","aria-label":`Remove ${e.attachment.fileName}`,onClick:e.onRemove,children:"\xD7"})]})}function WF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(!1),i=Uf(e.exchange.request.body),s=Uf(e.exchange.result.body),a=e.exchange.request.url,l=a.length>52?`${a.slice(0,52).trimEnd()}...`:a,c=e.exchange.result.status>=400||!!e.exchange.result.error,u=e.exchange.result.status>=200&&e.exchange.result.status<300;return(0,k.useEffect)(()=>{o(!0)},[]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"vf-editor-chat-http-card",children:(0,f.jsxs)("button",{type:"button",className:"vf-editor-chat-http-card-header",onClick:()=>n(!0),"aria-label":`Open HTTP details for ${e.exchange.request.method} ${a}`,children:[(0,f.jsx)("span",{className:"vf-editor-chat-http-pill",children:e.exchange.request.method}),(0,f.jsx)("span",{className:"vf-editor-chat-http-url",title:a,children:l}),(0,f.jsxs)("span",{className:"vf-editor-chat-http-status","data-error":c?"true":"false","data-success":u?"true":"false",children:[e.exchange.result.status,e.exchange.result.statusText?` ${e.exchange.result.statusText}`:""]}),(0,f.jsx)("span",{className:"vf-editor-chat-http-expand","aria-hidden":"true",children:"+"})]})}),r&&t?(0,ji.createPortal)((0,f.jsx)("div",{className:"vf-editor-chat-http-modal-backdrop",onClick:()=>n(!1),children:(0,f.jsxs)("div",{className:"vf-editor-chat-http-modal",onClick:d=>d.stopPropagation(),children:[(0,f.jsxs)("div",{className:"vf-editor-chat-http-modal-header",children:[(0,f.jsxs)("div",{className:"vf-editor-chat-http-modal-header-main",children:[(0,f.jsx)("span",{className:"vf-editor-chat-http-pill",children:e.exchange.request.method}),(0,f.jsx)("span",{className:"vf-editor-chat-http-modal-url",children:a}),(0,f.jsxs)("span",{className:"vf-editor-chat-http-status","data-error":c?"true":"false","data-success":u?"true":"false",children:[e.exchange.result.status,e.exchange.result.statusText?` ${e.exchange.result.statusText}`:""]})]}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-http-modal-close",onClick:()=>n(!1),"aria-label":"Close HTTP details",children:"\xD7"})]}),(0,f.jsxs)("div",{className:"vf-editor-chat-http-card-body is-modal",children:[e.exchange.explanation?(0,f.jsx)("div",{className:"vf-editor-chat-http-note",children:e.exchange.explanation}):null,(0,f.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,f.jsx)("div",{className:"vf-editor-chat-http-label",children:"URL"}),(0,f.jsx)("pre",{className:"vf-editor-chat-http-pre",children:a})]}),i?(0,f.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,f.jsx)("div",{className:"vf-editor-chat-http-label",children:"Request"}),(0,f.jsx)("pre",{className:"vf-editor-chat-http-pre",children:i})]}):null,(0,f.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,f.jsx)("div",{className:"vf-editor-chat-http-label",children:"Response"}),(0,f.jsx)("pre",{className:"vf-editor-chat-http-pre",children:e.exchange.result.error||s||"(empty)"})]}),Object.keys(e.exchange.result.headers).length?(0,f.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,f.jsx)("div",{className:"vf-editor-chat-http-label",children:"Headers"}),(0,f.jsx)("pre",{className:"vf-editor-chat-http-pre",children:Uf(e.exchange.result.headers)})]}):null]})]})}),document.body):null]})}function bR(e){return typeof e=="string"?JSON.stringify(e):typeof e=="number"||typeof e=="boolean"?String(e):e===null?"null":JSON.stringify(e)}function SS(e){if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(e);let t=document.createElement("textarea");return t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select(),document.execCommand("copy"),document.body.removeChild(t),Promise.resolve()}function Or(e){return(0,f.jsxs)("div",{className:"vf-editor-chat-json-line",style:{paddingLeft:`${e.depth*18+12}px`},children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-copy","aria-label":"Copy line",title:"Copy line",onClick:()=>e.onCopy(e.text),children:(0,f.jsx)(yS,{})}),(0,f.jsx)("span",{className:"vf-editor-chat-json-line-text",children:e.text})]})}function dS(e){let t=e.value,n=e.isLast?"":",";if(Array.isArray(t)){let r=e.path,o=e.collapsedPaths.has(r),i=`${e.linePrefix??""}[`;return t.length?o?(0,f.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(r),"aria-label":"Expand JSON block",children:(0,f.jsx)(Df,{open:!1})}),(0,f.jsx)(Or,{text:`${e.linePrefix??""}[ \u2026 ]${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(r),"aria-label":"Collapse JSON block",children:(0,f.jsx)(Df,{open:!0})}),(0,f.jsx)(Or,{text:i,depth:e.depth,onCopy:e.onCopy})]}),t.map((s,a)=>(0,f.jsx)(dS,{value:s,depth:e.depth+1,path:`${r}.${a}`,isLast:a===t.length-1,collapsedPaths:e.collapsedPaths,togglePath:e.togglePath,onCopy:e.onCopy},`${r}:${a}`)),(0,f.jsx)(Or,{text:`]${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,f.jsx)(Or,{text:`${e.linePrefix??""}[]${n}`,depth:e.depth,onCopy:e.onCopy})}if(t&&typeof t=="object"){let r=Object.entries(t),o=e.path,i=e.collapsedPaths.has(o),s=`${e.linePrefix??""}{`;return r.length?i?(0,f.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(o),"aria-label":"Expand JSON block",children:(0,f.jsx)(Df,{open:!1})}),(0,f.jsx)(Or,{text:`${e.linePrefix??""}{ \u2026 }${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(o),"aria-label":"Collapse JSON block",children:(0,f.jsx)(Df,{open:!0})}),(0,f.jsx)(Or,{text:s,depth:e.depth,onCopy:e.onCopy})]}),r.map(([a,l],c)=>{let u=`${JSON.stringify(a)}: `;return l&&typeof l=="object"?(0,f.jsx)(dS,{value:l,depth:e.depth+1,linePrefix:u,path:`${o}.${a}`,isLast:c===r.length-1,collapsedPaths:e.collapsedPaths,togglePath:e.togglePath,onCopy:e.onCopy},`${o}:${a}`):(0,f.jsx)(Or,{text:`${u}${bR(l)}${c===r.length-1?"":","}`,depth:e.depth+1,onCopy:e.onCopy},`${o}:${a}`)}),(0,f.jsx)(Or,{text:`}${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,f.jsx)(Or,{text:`${e.linePrefix??""}{}${n}`,depth:e.depth,onCopy:e.onCopy})}return(0,f.jsx)(Or,{text:`${e.linePrefix??""}${bR(t)}${n}`,depth:e.depth,onCopy:e.onCopy})}function qR(e){let[t,n]=(0,k.useState)(new Set),[r,o]=(0,k.useState)(""),i=a=>{n(l=>{let c=new Set(l);return c.has(a)?c.delete(a):c.add(a),c})},s=async a=>{try{await SS(a),o("done")}catch{o("error")}window.setTimeout(()=>o(""),1400)};return(0,f.jsxs)("div",{className:"vf-editor-chat-json-viewer",children:[(0,f.jsxs)("div",{className:"vf-editor-chat-json-toolbar",children:[(0,f.jsx)("span",{className:"vf-editor-chat-json-file",children:e.storageKey}),(0,f.jsx)("span",{className:"vf-editor-chat-json-copy-state","data-state":r,children:r==="done"?"Copied line":r==="error"?"Copy failed":"Hover a line to copy"})]}),(0,f.jsx)("div",{className:"vf-editor-chat-json-scroll",children:(0,f.jsx)(dS,{value:e.value,depth:0,path:"root",collapsedPaths:t,togglePath:i,onCopy:s})})]})}function GF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(""),i=BR(e.artifact.url,`${e.artifact.label}.json`),s=Uf(e.data);(0,k.useEffect)(()=>{n(!0)},[]);let a=async()=>{try{await SS(s),o("done")}catch{o("error")}window.setTimeout(()=>o(""),1600)};return(0,k.useEffect)(()=>{let l=c=>{c.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e]),t?(0,ji.createPortal)((0,f.jsx)("div",{className:"vf-editor-chat-media-modal-backdrop",onClick:e.onClose,children:(0,f.jsxs)("div",{className:"vf-editor-chat-json-modal",onClick:l=>l.stopPropagation(),children:[(0,f.jsxs)("div",{className:"vf-editor-chat-media-modal-header",children:[(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-link",href:e.artifact.url,target:"_blank",rel:"noopener noreferrer",children:e.artifact.label}),(0,f.jsxs)("div",{className:"vf-editor-chat-media-modal-actions",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control","data-state":r,onClick:()=>{a()},title:r==="done"?"Copied":r==="error"?"Copy failed":"Copy JSON","aria-label":r==="done"?"JSON copied":r==="error"?"Unable to copy JSON":"Copy JSON",children:(0,f.jsx)(yS,{})}),(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:e.artifact.url,download:i,title:"Download JSON","aria-label":"Download JSON",children:(0,f.jsx)(hS,{})}),(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:e.artifact.url,target:"_blank",rel:"noopener noreferrer",title:"Open raw JSON","aria-label":"Open raw JSON",children:(0,f.jsx)(gS,{})}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:e.onClose,"aria-label":"Close JSON preview",title:"Close",children:"\xD7"})]})]}),(0,f.jsx)("div",{className:"vf-editor-chat-json-modal-body",children:(0,f.jsx)(qR,{value:e.data,storageKey:e.artifact.label})})]})}),document.body):null}function VF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(!1),[i,s]=(0,k.useState)(null),[a,l]=(0,k.useState)(null),[c,u]=(0,k.useState)(!1),d=async()=>{if(!(i!==null||c)){u(!0),l(null);try{let _=await(await fetch(e.artifact.url,{credentials:"omit"})).json();s(_)}catch(y){l(y instanceof Error?y.message:"Unable to load JSON artifact.")}finally{u(!1)}}},p=()=>{let y=!t;n(y),y&&d()},h=()=>{d(),o(!0)};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"vf-editor-chat-json-card",children:[(0,f.jsxs)("div",{className:"vf-editor-chat-json-card-head",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"vf-editor-chat-json-card-kicker",children:"JSON result"}),(0,f.jsx)("div",{className:"vf-editor-chat-json-card-title",children:e.artifact.label})]}),(0,f.jsxs)("div",{className:"vf-editor-chat-json-card-actions",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action",onClick:p,children:t?"Hide preview":"Preview JSON"}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action is-strong",onClick:h,children:"Open"})]})]}),t?(0,f.jsx)("div",{className:"vf-editor-chat-json-card-body",children:c?(0,f.jsx)("div",{className:"vf-editor-chat-json-state",children:"Loading JSON\u2026"}):a?(0,f.jsx)("div",{className:"vf-editor-chat-json-state is-error",children:a}):i!==null?(0,f.jsx)(qR,{value:i,storageKey:e.artifact.label}):null}):null]}),r&&i!==null?(0,f.jsx)(GF,{artifact:e.artifact,data:i,onClose:()=>o(!1)}):null]})}function YR(e){return e.format==="markdown"?(0,f.jsx)("div",{className:"vf-editor-chat-doc-markdown",dangerouslySetInnerHTML:{__html:UR(e.text)}}):(0,f.jsx)("pre",{className:"vf-editor-chat-doc-pre",children:e.text})}function qF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(""),i=e.artifact.format==="markdown"?".md":".txt",s=BR(e.artifact.url,`${e.artifact.label}${i}`);(0,k.useEffect)(()=>{n(!0)},[]);let a=async()=>{try{await SS(e.text),o("done")}catch{o("error")}window.setTimeout(()=>o(""),1600)};return(0,k.useEffect)(()=>{let l=c=>{c.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e]),t?(0,ji.createPortal)((0,f.jsx)("div",{className:"vf-editor-chat-media-modal-backdrop",onClick:e.onClose,children:(0,f.jsxs)("div",{className:"vf-editor-chat-json-modal",onClick:l=>l.stopPropagation(),children:[(0,f.jsxs)("div",{className:"vf-editor-chat-media-modal-header",children:[(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-link",href:e.artifact.url,target:"_blank",rel:"noopener noreferrer",children:e.artifact.label}),(0,f.jsxs)("div",{className:"vf-editor-chat-media-modal-actions",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control","data-state":r,onClick:()=>{a()},title:r==="done"?"Copied":r==="error"?"Copy failed":e.artifact.format==="markdown"?"Copy markdown":"Copy text","aria-label":r==="done"?"Document copied":r==="error"?"Unable to copy document":e.artifact.format==="markdown"?"Copy markdown":"Copy text",children:(0,f.jsx)(yS,{})}),(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:e.artifact.url,download:s,title:e.artifact.format==="markdown"?"Download markdown":"Download text","aria-label":e.artifact.format==="markdown"?"Download markdown":"Download text",children:(0,f.jsx)(hS,{})}),(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:e.artifact.url,target:"_blank",rel:"noopener noreferrer",title:"Open raw file","aria-label":"Open raw file",children:(0,f.jsx)(gS,{})}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:e.onClose,"aria-label":"Close document preview",title:"Close",children:"\xD7"})]})]}),(0,f.jsx)("div",{className:"vf-editor-chat-json-modal-body",children:(0,f.jsx)("div",{className:"vf-editor-chat-doc-viewer",children:(0,f.jsx)(YR,{text:e.text,format:e.artifact.format})})})]})}),document.body):null}function YF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(!1),[i,s]=(0,k.useState)(null),[a,l]=(0,k.useState)(null),[c,u]=(0,k.useState)(!1),d=async()=>{if(!(i!==null||c)){u(!0),l(null);try{let _=await(await fetch(e.artifact.url,{credentials:"omit"})).text();s(_)}catch(y){l(y instanceof Error?y.message:"Unable to load document artifact.")}finally{u(!1)}}},p=()=>{let y=!t;n(y),y&&d()},h=()=>{d(),o(!0)};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"vf-editor-chat-json-card",children:[(0,f.jsxs)("div",{className:"vf-editor-chat-json-card-head",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"vf-editor-chat-json-card-kicker",children:e.artifact.format==="markdown"?"Markdown result":"Text result"}),(0,f.jsx)("div",{className:"vf-editor-chat-json-card-title",children:e.artifact.label})]}),(0,f.jsxs)("div",{className:"vf-editor-chat-json-card-actions",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action",onClick:p,children:t?"Hide preview":"Preview"}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action is-strong",onClick:h,children:"Open"})]})]}),t?(0,f.jsx)("div",{className:"vf-editor-chat-json-card-body",children:c?(0,f.jsx)("div",{className:"vf-editor-chat-json-state",children:"Loading document\u2026"}):a?(0,f.jsx)("div",{className:"vf-editor-chat-json-state is-error",children:a}):i!==null?(0,f.jsx)("div",{className:"vf-editor-chat-doc-viewer is-inline",children:(0,f.jsx)(YR,{text:i,format:e.artifact.format})}):null}):null]}),r&&i!==null?(0,f.jsx)(qF,{artifact:e.artifact,text:i,onClose:()=>o(!1)}):null]})}var KF=(0,k.memo)(function(t){let n=t.message.role==="assistant",r=t.message.text.trim().length>0,o=r?UR(t.message.text):"",[i,s]=(0,k.useState)(null),a=t.message.attachments.filter($f),l=t.message.attachments.filter(lS),c=t.message.attachments.filter(_=>!$f(_)&&!lS(_)),u=r?iF(t.message.text,t.message.attachments.map(_=>_.viewUrl)):[],d=u.filter(_=>_.kind==="image"),p=u.filter(_=>_.kind==="video"),h=(t.message.httpExchanges??[]).flatMap(_=>{let T=Hi(_.result.body);return T?$R(T):[]}).filter((_,T,g)=>g.findIndex(S=>S.url===_.url)===T),y=(t.message.httpExchanges??[]).flatMap(_=>{let T=Hi(_.result.body);return T?zR(T):[]}).filter((_,T,g)=>g.findIndex(S=>S.url===_.url)===T);return(0,f.jsxs)("div",{className:`vf-editor-chat-message ${n?"is-assistant":"is-user"}`,children:[(0,f.jsx)("div",{className:"vf-editor-chat-message-meta",children:n?"Copilot":"You"}),(0,f.jsxs)("div",{className:"vf-editor-chat-bubble","data-pending":t.message.isPending?"true":"false",children:[t.message.attachments.length?(0,f.jsxs)("div",{className:"vf-editor-chat-message-attachments",children:[c.map(_=>(0,f.jsx)("div",{className:"vf-editor-chat-message-attachment-row",children:(0,f.jsx)("a",{className:"vf-editor-chat-message-preview-link",href:_.viewUrl,target:"_blank",rel:"noopener noreferrer",children:(0,f.jsx)(BF,{attachment:_})})},_.id)),(0,f.jsx)(xR,{previews:a.map(_=>({kind:"image",url:_.viewUrl,label:_.fileName})),onOpenModal:(_,T)=>s({preview:_,gallery:T})}),l.map(_=>(0,f.jsx)(RR,{preview:{kind:"video",url:_.viewUrl,label:_.fileName},onOpenModal:T=>s({preview:T,gallery:[T]})},_.id))]}):null,t.message.statusText?(0,f.jsxs)("div",{className:"vf-editor-chat-message-status","aria-live":"polite",children:[(0,f.jsx)("span",{className:"vf-editor-chat-status-dot"}),t.message.statusText]}):null,t.message.httpExchanges?.length?(0,f.jsx)("div",{className:"vf-editor-chat-http-list",children:t.message.httpExchanges.map((_,T)=>(0,f.jsx)(WF,{exchange:_},`${_.request.method}:${_.request.url}:${T}`))}):null,r?(0,f.jsx)("div",{className:"vf-editor-chat-message-body",dangerouslySetInnerHTML:{__html:o}}):t.message.isPending?(0,f.jsxs)("div",{className:"vf-editor-chat-message-loading","aria-hidden":"true",children:[(0,f.jsx)("span",{}),(0,f.jsx)("span",{}),(0,f.jsx)("span",{})]}):null,u.length?(0,f.jsxs)("div",{className:"vf-editor-chat-message-attachments",children:[(0,f.jsx)(xR,{previews:d,onOpenModal:(_,T)=>s({preview:_,gallery:T})}),p.map(_=>(0,f.jsx)(RR,{preview:_,onOpenModal:T=>s({preview:T,gallery:[T]})},_.url))]}):null,h.length?(0,f.jsx)("div",{className:"vf-editor-chat-json-list",children:h.map(_=>(0,f.jsx)(VF,{artifact:_},_.key))}):null,y.length?(0,f.jsx)("div",{className:"vf-editor-chat-json-list",children:y.map(_=>(0,f.jsx)(YF,{artifact:_},_.key))}):null]}),i?(0,f.jsx)($F,{preview:i.preview,gallery:i.gallery,onClose:()=>s(null)}):null]})});function kR(e){if(!e||e<=0)return"Unknown size";let t=["B","KB","MB","GB"],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function NR(e){return $f(e.file)?(0,f.jsx)("img",{className:"vf-editor-upload-file-thumb",src:e.file.viewUrl,alt:e.file.fileName}):lS(e.file)?(0,f.jsx)("video",{className:"vf-editor-upload-file-thumb",src:e.file.viewUrl,muted:!0,playsInline:!0}):(0,f.jsx)("div",{className:"vf-editor-upload-file-icon","aria-hidden":"true",children:e.file.fileName.slice(0,1).toUpperCase()})}function fo(e){return e.split("/").map(t=>t.trim()).filter(Boolean).join("/")}function jf(e,t){return fo([e,t].filter(Boolean).join("/"))}function AR(e){let t=fo(e).split("/").filter(Boolean);return t.pop(),t.join("/")}function MR(e){return fo(e).split("/").filter(Boolean).at(-1)||"All files"}function JF(e){let t=fo(e.currentFolder),n=t?`${t}/`:"",r=new Map;for(let o of e.folders){let i=fo(o);if(!i||t&&i===t||!i.startsWith(n))continue;let a=i.slice(n.length).split("/")[0];a&&r.set(a,jf(t,a))}for(let o of e.files){let i=fo(o.folderPath??"");if(!i||t&&i===t||!i.startsWith(n))continue;let a=i.slice(n.length).split("/")[0];a&&r.set(a,jf(t,a))}return Array.from(r.entries()).map(([o,i])=>({name:o,path:i})).sort((o,i)=>o.name.localeCompare(i.name))}function aS(e){return e.name==="share"?(0,f.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("path",{d:"M14 4h6v6"}),(0,f.jsx)("path",{d:"M10 14 20 4"}),(0,f.jsx)("path",{d:"M20 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4"})]}):e.name==="link"?(0,f.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("path",{d:"M10 13a5 5 0 0 0 7.07 0l2.12-2.12a5 5 0 0 0-7.07-7.07L11 4.93"}),(0,f.jsx)("path",{d:"M14 11a5 5 0 0 0-7.07 0L4.81 13.12a5 5 0 0 0 7.07 7.07L13 19.07"})]}):(0,f.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("path",{d:"M3 6h18"}),(0,f.jsx)("path",{d:"M8 6V4h8v2"}),(0,f.jsx)("path",{d:"M19 6 18 20H6L5 6"}),(0,f.jsx)("path",{d:"M10 11v5"}),(0,f.jsx)("path",{d:"M14 11v5"})]})}function XF(e){let[t,n]=(0,k.useState)("my-files"),[r,o]=(0,k.useState)([]),[i,s]=(0,k.useState)([]),[a,l]=(0,k.useState)([]),[c,u]=(0,k.useState)(()=>new Set),[d,p]=(0,k.useState)([]),[h,y]=(0,k.useState)([]),[_,T]=(0,k.useState)(()=>new Set),[g,S]=(0,k.useState)(null),[E,R]=(0,k.useState)(!1),[M,A]=(0,k.useState)(""),[I,N]=(0,k.useState)(null),[U,x]=(0,k.useState)(null),[$,W]=(0,k.useState)(null),[ye,K]=(0,k.useState)(null),[et,pe]=(0,k.useState)(null),fe=(0,k.useRef)(null),D=(0,k.useRef)(null),Se=(0,k.useMemo)(()=>{let P=d.map(ne=>({...ne,recentSource:"generated"}));return[...h.map(ne=>({...ne,recentSource:"temporary"})),...P].sort((ne,ae)=>{let we=ne.createdAt?Date.parse(ne.createdAt):0;return(ae.createdAt?Date.parse(ae.createdAt):0)-we})},[d,h]),J=t==="upload"?r:t==="my-files"?i.filter(P=>c.has(P.id)):t==="recents"?Se.filter(P=>_.has(P.id)):[];async function le(){let P=await vF(e.apiKey);s(P.attachments),l(P.folders)}async function Ie(P){R(!0);try{let[F,ne]=P?[await _R(e.apiKey,P),null]:await Promise.all([_R(e.apiKey),EF(e.apiKey)]);p(ae=>P?[...ae,...F.media]:F.media),ne&&y(ne.files),S(F.nextCursor),P||T(new Set)}finally{R(!1)}}(0,k.useEffect)(()=>{e.open&&(K(null),W(null),le().catch(P=>K(P instanceof Error?P.message:"Unable to load My Files.")),Ie().catch(P=>K(P instanceof Error?P.message:"Unable to load recent media.")))},[e.open]);function _e(){o([]),u(new Set),T(new Set),W(null),K(null),N(null),x(null),e.onClose()}async function ut(P){try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(P);else{let F=document.createElement("textarea");F.value=P,F.style.position="fixed",F.style.opacity="0",document.body.appendChild(F),F.focus(),F.select(),document.execCommand("copy"),document.body.removeChild(F)}W("File URL copied.")}catch{K("Unable to copy file URL.")}}async function Xe(P,F){if(!P.length)return;K(null);let ne=[];for(let ae of P)try{if(W(`Uploading ${ae.name}...`),F==="upload"){let St=await GR({apiKey:e.apiKey,file:ae,folderPath:LR}),Z=await WR({attachment:St,file:ae,currentInlineBytes:jR([...r,...ne])});ne.push(Z);continue}let we=await _F({apiKey:e.apiKey,file:ae,folderPath:M,maxBytes:PR,limitLabel:"50 MB"});ne.push(we)}catch(we){K(we instanceof Error?we.message:"Upload failed.")}F==="upload"?(o(ae=>[...ae,...ne]),await Ie().catch(ae=>K(ae instanceof Error?ae.message:"Unable to refresh recent files."))):F==="my-files"&&(await le(),u(ae=>new Set([...ae,...ne.map(we=>we.id)]))),ne.length&&W(`${ne.length} file${ne.length===1?"":"s"} uploaded.`)}async function Yt(P,F){let ne=F==="my-files"?`/api/v1/user/me/attachments/${encodeURIComponent(P.id)}`:`/api/v1/user/me/temporary-files/${encodeURIComponent(P.id)}`,ae=await fetch(ne,{method:"DELETE",headers:ct(e.apiKey,"application/json")}),we=await ae.json().catch(()=>({}));if(!ae.ok)throw new Error(we.error||"Unable to delete file.");F==="my-files"&&(s(St=>St.filter(Z=>Z.id!==P.id)),u(St=>{let Z=new Set(St);return Z.delete(P.id),Z})),pe(null),W("File deleted.")}async function dt(P){if(P!=="my-files"||!U||U.mode!=="create")return;let F=jf(U.baseFolder,U.value);if(!F){K("Choose a folder name.");return}let ne=await fetch("/api/v1/user/me/attachments/folders",{method:"POST",headers:ct(e.apiKey,"application/json"),body:JSON.stringify({folder_path:F})}),ae=await ne.json().catch(()=>({}));if(!ne.ok){K(ae.error||"Unable to create folder.");return}l(we=>Array.from(new Set([...we,F])).sort()),x(null),W("Folder created.")}async function an(P,F){if(P!=="my-files"||!U||U.mode!=="rename")return;let ne=U.value.trim(),ae=jf(AR(F),ne);if(!ae||ae===F)return;let we=await fetch("/api/v1/user/me/attachments/folders",{method:"PATCH",headers:ct(e.apiKey,"application/json"),body:JSON.stringify({from_folder_path:F,to_folder_path:ae})}),St=await we.json().catch(()=>({}));if(!we.ok){K(St.error||"Unable to rename folder.");return}A(Z=>Z===F||Z.startsWith(`${F}/`)?`${ae}${Z.slice(F.length)}`:Z),await le(),N(null),x(null),W("Folder renamed.")}async function Tn(P,F){if(P!=="my-files")return;let ne=await fetch("/api/v1/user/me/attachments/folders",{method:"DELETE",headers:ct(e.apiKey,"application/json"),body:JSON.stringify({folder_path:F})}),ae=await ne.json().catch(()=>({}));if(!ne.ok){K(ae.error||"Unable to delete folder.");return}A(we=>we===F||we.startsWith(`${F}/`)?AR(F):we),await le(),N(null),x(null),W("Folder deleted.")}function On(P){let F=a,ne=i,ae=M,we=A,St=JF({folders:F,files:ne,currentFolder:ae}),Z=fo(ae).split("/").filter(Boolean);return(0,f.jsxs)("div",{className:"vf-editor-upload-browser",children:[(0,f.jsxs)("div",{className:"vf-editor-upload-browser-toolbar",children:[(0,f.jsxs)("div",{className:"vf-editor-upload-breadcrumb","aria-label":"Current folder",children:[(0,f.jsx)("button",{type:"button","data-current":!ae,onClick:()=>we(""),children:"files"}),Z.map((Fe,me)=>{let Ve=Z.slice(0,me+1).join("/");return(0,f.jsxs)("span",{className:"vf-editor-upload-breadcrumb-segment",children:[(0,f.jsx)("span",{"aria-hidden":"true",children:"/"}),(0,f.jsx)("button",{type:"button","data-current":Ve===ae,onClick:()=>we(Ve),children:Fe})]},Ve)})]}),(0,f.jsx)("button",{type:"button",onClick:()=>x({mode:"create",scope:"my-files",baseFolder:ae,value:""}),children:"New folder"})]}),St.length?(0,f.jsx)("div",{className:"vf-editor-upload-folder-grid",children:St.map(Fe=>(0,f.jsxs)("article",{className:"vf-editor-upload-folder-row",children:[(0,f.jsxs)("button",{type:"button",className:"vf-editor-upload-folder-open",onClick:()=>we(Fe.path),children:[(0,f.jsx)("span",{className:"vf-editor-upload-folder-icon","aria-hidden":"true"}),(0,f.jsx)("span",{children:Fe.name})]}),(0,f.jsx)("button",{type:"button",className:"vf-editor-upload-folder-menu-button","aria-label":`Folder actions for ${Fe.name}`,onClick:()=>N(I===Fe.path?null:Fe.path),children:"..."}),I===Fe.path?(0,f.jsxs)("div",{className:"vf-editor-upload-folder-menu",children:[(0,f.jsx)("button",{type:"button",onClick:()=>x({mode:"rename",scope:"my-files",folderPath:Fe.path,value:MR(Fe.path)}),children:"Rename"}),(0,f.jsx)("button",{type:"button","data-danger":"true",onClick:()=>x({mode:"delete",scope:"my-files",folderPath:Fe.path,value:""}),children:"Delete"})]}):null]},Fe.path))}):null]})}function po(P,F){let ne=F==="my-files"?c.has(P.id):F==="recents"?_.has(P.id):!1,ae="s3Url"in P&&P.s3Url?P.s3Url:P.viewUrl;return(0,f.jsxs)("article",{className:"vf-editor-upload-file-card","data-selected":ne?"true":"false",children:[(0,f.jsxs)("button",{type:"button",className:"vf-editor-upload-file-select",onClick:()=>{if(F==="temporary"){ut(ae);return}(F==="recents"?T:u)(St=>{let Z=new Set(St);return Z.has(P.id)?Z.delete(P.id):Z.add(P.id),Z})},children:[(0,f.jsx)(NR,{file:P}),(0,f.jsxs)("span",{className:"vf-editor-upload-file-main",children:[(0,f.jsx)("span",{className:"vf-editor-upload-file-name",children:P.fileName}),(0,f.jsxs)("span",{className:"vf-editor-upload-file-meta",children:[kR(P.sizeBytes),P.folderPath?` \xB7 ${P.folderPath}`:""]})]})]}),(0,f.jsxs)("div",{className:"vf-editor-upload-file-actions",children:[F==="my-files"||F==="recents"?(0,f.jsx)("span",{className:"vf-editor-upload-selection-indicator","data-selected":ne?"true":"false","aria-hidden":"true",children:ne?"\u2713":""}):null,(0,f.jsx)("a",{href:P.viewUrl,target:"_blank",rel:"noreferrer","aria-label":`View ${P.fileName}`,children:(0,f.jsx)(aS,{name:"share"})}),(0,f.jsx)("button",{type:"button","aria-label":`Copy URL for ${P.fileName}`,onClick:()=>{ut(ae)},children:(0,f.jsx)(aS,{name:"link"})}),F==="recents"?null:(0,f.jsx)("button",{type:"button","aria-label":`Delete ${P.fileName}`,onClick:()=>pe(et===P.id?null:P.id),children:(0,f.jsx)(aS,{name:"trash"})})]}),F!=="recents"&&et===P.id?(0,f.jsxs)("div",{className:"vf-editor-upload-popconfirm",children:[(0,f.jsx)("span",{children:"Delete this file?"}),(0,f.jsx)("button",{type:"button",onClick:()=>pe(null),children:"Cancel"}),(0,f.jsx)("button",{type:"button","data-danger":"true",onClick:()=>{Yt(P,F)},children:"Delete"})]}):null]},P.id)}function mo(){if(!U)return null;let P=U.mode==="create"?"New folder":U.mode==="rename"?"Rename folder":"Delete folder",F=U.mode==="delete"?U.folderPath:"";return(0,f.jsxs)("div",{className:"vf-editor-upload-folder-dialog",role:"dialog","aria-label":P,children:[(0,f.jsx)("div",{className:"vf-editor-upload-folder-dialog-title",children:P}),U.mode==="delete"?(0,f.jsxs)("div",{className:"vf-editor-upload-folder-dialog-copy",children:["Delete ",(0,f.jsx)("strong",{children:F})," and all files inside it?"]}):(0,f.jsx)("input",{value:U.value,autoFocus:!0,placeholder:"folder-name",onChange:ne=>x({...U,value:ne.target.value}),onKeyDown:ne=>{ne.key==="Enter"&&(ne.preventDefault(),U.mode==="create"?dt(U.scope):an(U.scope,U.folderPath))}}),(0,f.jsxs)("div",{className:"vf-editor-upload-folder-dialog-actions",children:[(0,f.jsx)("button",{type:"button",onClick:()=>x(null),children:"Cancel"}),U.mode==="create"?(0,f.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",onClick:()=>{dt(U.scope)},children:"Create"}):U.mode==="rename"?(0,f.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",onClick:()=>{an(U.scope,U.folderPath)},children:"Rename"}):(0,f.jsx)("button",{type:"button","data-danger":"true",onClick:()=>{Tn(U.scope,U.folderPath)},children:"Delete"})]})]})}if(!e.open)return null;let Gi=i.filter(P=>fo(P.folderPath??"")===fo(M));return(0,ji.createPortal)((0,f.jsx)("div",{className:"vf-editor-upload-drawer-backdrop",children:(0,f.jsxs)("aside",{className:"vf-editor-upload-drawer","aria-label":"Upload drawer",children:[(0,f.jsxs)("div",{className:"vf-editor-upload-header",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"vf-editor-upload-title",children:"Upload"}),(0,f.jsx)("div",{className:"vf-editor-upload-subtitle",children:"Upload, attach, and copy file URLs."})]}),(0,f.jsx)("button",{type:"button",className:"vf-editor-upload-close","aria-label":"Close upload drawer",onClick:_e,children:"\xD7"})]}),(0,f.jsxs)("div",{className:"vf-editor-upload-tabs",role:"tablist",children:[(0,f.jsx)("button",{type:"button","data-active":t==="upload",onClick:()=>n("upload"),children:"Upload file"}),(0,f.jsx)("button",{type:"button","data-active":t==="my-files",onClick:()=>n("my-files"),children:"My Files"}),(0,f.jsx)("button",{type:"button","data-active":t==="recents",onClick:()=>n("recents"),children:"Recents"})]}),(0,f.jsxs)("div",{className:"vf-editor-upload-body",children:[ye?(0,f.jsx)("div",{className:"vf-editor-upload-status","data-tone":"error",children:ye}):null,$?(0,f.jsx)("div",{className:"vf-editor-upload-status",children:$}):null,mo(),t==="upload"?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("button",{type:"button",className:"vf-editor-upload-drop",onClick:()=>fe.current?.click(),children:["Upload files to chat",(0,f.jsx)("span",{children:"Stored in Recents and attached after Confirm. Images get compressed inline previews when possible; other files attach by URL. Max 100 MB each."})]}),(0,f.jsx)("input",{ref:fe,type:"file",multiple:!0,hidden:!0,onChange:P=>{Xe(Array.from(P.target.files??[]),"upload"),P.target.value=""}}),(0,f.jsx)("div",{className:"vf-editor-upload-list",children:r.map(P=>(0,f.jsxs)("article",{className:"vf-editor-upload-file-card","data-selected":"true",children:[(0,f.jsx)(NR,{file:P}),(0,f.jsxs)("span",{className:"vf-editor-upload-file-main",children:[(0,f.jsx)("span",{className:"vf-editor-upload-file-name",children:P.fileName}),(0,f.jsx)("span",{className:"vf-editor-upload-file-meta",children:kR(P.sizeBytes)})]}),(0,f.jsx)("button",{type:"button",onClick:()=>o(F=>F.filter(ne=>ne.id!==P.id)),children:"\xD7"})]},P.id))})]}):t==="my-files"?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("button",{type:"button",className:"vf-editor-upload-drop",onClick:()=>D.current?.click(),children:["Add to My Files",(0,f.jsxs)("span",{children:["Uploads into ",MR(M)," and auto-selects. Max 50 MB each."]})]}),(0,f.jsx)("input",{ref:D,type:"file",multiple:!0,hidden:!0,onChange:P=>{Xe(Array.from(P.target.files??[]),"my-files"),P.target.value=""}}),On("my-files"),(0,f.jsx)("div",{className:"vf-editor-upload-list",children:Gi.length?Gi.map(P=>po(P,"my-files")):(0,f.jsx)("div",{className:"vf-editor-upload-empty",children:"No files in this folder."})})]}):t==="recents"?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"vf-editor-upload-list",children:Se.length?Se.map(P=>po(P,"recents")):(0,f.jsx)("div",{className:"vf-editor-upload-empty",children:E?"Loading recent files...":"No recent files yet."})}),g?(0,f.jsx)("button",{type:"button",className:"vf-editor-upload-more",disabled:E,onClick:()=>{Ie(g).catch(P=>K(P instanceof Error?P.message:"Unable to load more recent media."))},children:E?"Loading...":"Load more generated media"}):null]}):null]}),(0,f.jsxs)("div",{className:"vf-editor-upload-footer",children:[(0,f.jsx)("button",{type:"button",onClick:_e,children:"Cancel"}),(0,f.jsxs)("div",{className:"vf-editor-upload-footer-confirm",children:[(0,f.jsxs)("span",{children:[J.length," file",J.length===1?"":"s"," selected"]}),(0,f.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",disabled:!J.length,onClick:()=>{e.onConfirm(J),_e()},children:"Confirm"})]})]})]})}),document.body)}function KR({boot:e}){let t=e.template.templateId==="chat-brainstorm",n=t&&e.template.persistentHistorySidebar===!0,r=(0,k.useMemo)(()=>NF(e.template.templateId),[e.template.templateId]),o=(0,k.useMemo)(()=>AF(),[]),i=(0,k.useRef)(null),s=(0,k.useRef)(null),a=(0,k.useRef)(!0),l=(0,k.useRef)(!1),c=(0,k.useRef)(null),u=(0,k.useRef)(null),d=(0,k.useRef)(new Map),p=(0,k.useRef)({nextAvailableAt:0}),h=(0,k.useRef)([]),y=(0,k.useRef)(new Set),[_,T]=(0,k.useState)([]),[g,S]=(0,k.useState)(null),[E,R]=(0,k.useState)(null),[M,A]=(0,k.useState)(null),[I,N]=(0,k.useState)(""),[U,x]=(0,k.useState)([]),[$,W]=(0,k.useState)(null),[ye,K]=(0,k.useState)(null),[et,pe]=(0,k.useState)(null),[fe,D]=(0,k.useState)(!1),[Se,J]=(0,k.useState)(!1),[le,Ie]=(0,k.useState)(!1),[_e,ut]=(0,k.useState)(!1),[Xe,Yt]=(0,k.useState)(!1),[dt,an]=(0,k.useState)(null),[Tn,On]=(0,k.useState)(!1),[po,mo]=(0,k.useState)(null),[Gi,P]=(0,k.useState)(!1),[F,ne]=(0,k.useState)(()=>{let m=typeof window<"u"?window.__vidfarmEditorTracers:null;if(m)return m.get();if(typeof window<"u"){let v=Hf();if(v.length)return v}return tr(e.template.tracers||[])}),ae=(0,k.useMemo)(()=>{if(!e.threadsUrl)return null;let m=new URL(e.threadsUrl,window.location.origin);return t||m.searchParams.set("template_id",e.template.templateId),m.searchParams.set("include_messages","false"),m.searchParams.set("limit",t?"200":"50"),m.toString()},[e.template.templateId,e.threadsUrl,t]),we=m=>e.threadsUrl?new URL(`${e.threadsUrl.replace(/\/$/,"")}/${encodeURIComponent(m)}`,window.location.origin).toString():null;(0,k.useEffect)(()=>{let m=DF(o?.getItem(r.threads)??null,e.template.templateId),v=o?.getItem(r.activeThread)??null,w=ER(),b=window.__vidfarmEditorTracers?.get()??Hf(),B=w&&!m.some(ce=>ce.id===w)?[{id:w,templateId:e.template.templateId,title:"Loading chat",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),lastMessageAt:null,messageCount:0,tracers:b,hiddenFromView:!1,messages:[]},...m]:m,Y=B.filter(ce=>!ce.hiddenFromView),j=Y.find(ce=>Tc(ce,b));h.current=B,T(B),w&&Y.some(ce=>ce.id===w)?S(w):v&&Y.some(ce=>ce.id===v)&&(!b.length||Y.some(ce=>ce.id===v&&Tc(ce,b)))?S(v):S(j?.id??Y[0]?.id??null),D(!0)},[e.template.templateId,o,r]),(0,k.useEffect)(()=>{if(!e.vidfarmApiKey||!ae)return;let m=new AbortController;return(async()=>{try{let v=[],w=null,b=new Set;do{let B=new URL(ae);w&&B.searchParams.set("cursor",w);let Y=await fetch(B.toString(),{method:"GET",headers:ct(e.vidfarmApiKey),signal:m.signal});if(!Y.ok)return;let j=await Y.json().catch(()=>null);Array.isArray(j?.threads)&&v.push(...j.threads.map(he=>IR(he,e.template.templateId)).filter(he=>!!he));let ce=typeof j?.next_cursor=="string"&&j.next_cursor?j.next_cursor:null;!ce||b.has(ce)?w=null:(b.add(ce),w=ce)}while(w&&!m.signal.aborted);if(!v.length)return;T(B=>{let Y=wR(B,v);return h.current=Y,Y}),S(B=>B&&h.current.some(Y=>Y.id===B)?B:v[0]?.id??B)}catch(v){if(v instanceof DOMException&&v.name==="AbortError")return}})(),()=>{m.abort()}},[e.template.templateId,e.vidfarmApiKey,ae]),(0,k.useEffect)(()=>{h.current=_},[_]);let[St,Z]=(0,k.useState)(()=>{if(typeof window>"u")return null;try{return new URL(window.location.href).searchParams.get("fork")}catch{return null}});(0,k.useEffect)(()=>{let m=()=>{try{Z(new URL(window.location.href).searchParams.get("fork"))}catch{Z(null)}};return window.addEventListener("popstate",m),()=>{window.removeEventListener("popstate",m)}},[]);async function Fe(m){if(!e.vidfarmApiKey){mo("Sign in to see forks.");return}if(!Tn&&!(!m?.force&&dt!==null)){On(!0),mo(null);try{let v=await fetch("/api/v1/compositions",{method:"GET",headers:ct(e.vidfarmApiKey)});if(!v.ok){mo(v.status===401?"Sign in to see forks.":`Failed to load forks (${v.status}).`),an([]);return}let w=await v.json().catch(()=>null),B=(Array.isArray(w?.forks)?w.forks:[]).map(Y=>{if(!Y||typeof Y!="object")return null;let j=Y,ce=typeof j.fork_id=="string"?j.fork_id:null;return ce?{forkId:ce,templateId:typeof j.template_id=="string"?j.template_id:null,parentForkId:typeof j.parent_fork_id=="string"?j.parent_fork_id:null,parentVersion:typeof j.parent_version=="number"?j.parent_version:null,title:typeof j.title=="string"?j.title:null,visibility:typeof j.visibility=="string"?j.visibility:null,latestVersion:typeof j.latest_version=="number"?j.latest_version:null,ownerCustomerId:typeof j.owner_customer_id=="string"?j.owner_customer_id:null,createdAt:typeof j.created_at=="string"?j.created_at:null,updatedAt:typeof j.updated_at=="string"?j.updated_at:null}:null}).filter(Y=>!!Y).filter(Y=>Y.templateId===e.template.templateId).sort((Y,j)=>String(j.updatedAt??"").localeCompare(String(Y.updatedAt??"")));an(B)}catch{mo("Could not load forks. Please try again."),an([])}finally{On(!1)}}}(0,k.useEffect)(()=>{Xe&&dt===null&&!Tn&&Fe()},[Xe]),(0,k.useEffect)(()=>{let m=window.__vidfarmEditorTracers;if(m)return ne(m.get()),m.subscribe(w=>ne(w));let v=()=>{let w=Hf();ne(w.length?w:tr(e.template.tracers||[]))};return v(),window.addEventListener("popstate",v),()=>{window.removeEventListener("popstate",v)}},[e.template.tracers]);let me=(0,k.useRef)(_),Ve=(0,k.useRef)(g);(0,k.useEffect)(()=>{me.current=_,Ve.current=g},[_,g]),(0,k.useEffect)(()=>{if(!fe)return;let m=window.setTimeout(()=>{try{o?.setItem(r.threads,JSON.stringify(TR(me.current,Ve.current)))}catch(v){console.warn("Unable to persist editor chat threads.",v)}},300);return()=>window.clearTimeout(m)},[g,o,fe,r,_]),(0,k.useEffect)(()=>{if(fe)try{g?o?.setItem(r.activeThread,g):o?.removeItem(r.activeThread)}catch(m){console.warn("Unable to persist active editor chat thread.",m)}},[g,o,fe,r]),(0,k.useEffect)(()=>{if(!fe||typeof window>"u")return;let m=new URL(window.location.href),v=m.searchParams.get("thread_id");if(g){if(v===g)return;m.searchParams.set("thread_id",g)}else{if(!v)return;m.searchParams.delete("thread_id")}window.history.replaceState({},"",m.toString())},[g,fe]);let re=(0,k.useMemo)(()=>_.find(m=>m.id===g)??null,[g,_]),Dn=(0,k.useMemo)(()=>_.find(m=>m.id===M?.threadId)??null,[M?.threadId,_]);(0,k.useEffect)(()=>{if(!fe||!e.vidfarmApiKey||!g)return;let m=h.current.find(j=>j.id===g);if(y.current.has(g))return;let v=ER();if(!!(m&&(m.messageCount??0)===0&&m.messages.length===0)){y.current.add(g);return}let b=we(g);if(!b)return;let B=new AbortController;return!m?.messages.length&&R(g),(async()=>{try{let j=await fetch(b,{method:"GET",headers:ct(e.vidfarmApiKey),signal:B.signal});if(!j.ok){let ue=!!(m&&g!==v),de=!!(m&&(m.messageCount??0)===0&&m.messages.length===0);j.status===404&&!ue&&!de&&W(`Chat ID ${g} was not found for this account.`),y.current.add(g);return}let ce=await j.json().catch(()=>null),he=ce?.thread?IR(ce.thread,e.template.templateId):null;if(!he)return;y.current.add(he.id),W(null),T(ue=>{let de=wR(ue,[he]);return h.current=de,de})}catch(j){if(j instanceof DOMException&&j.name==="AbortError")return}finally{B.signal.aborted||R(j=>j===g?null:j)}})(),()=>{B.abort(),R(j=>j===g?null:j)}},[g,e.vidfarmApiKey,e.threadsUrl,fe]),(0,k.useEffect)(()=>{if(!fe||re&&!re.hiddenFromView)return;let m=_.find(v=>!v.hiddenFromView&&Tc(v,F));S(m?.id??_.find(v=>!v.hiddenFromView)?.id??null)},[re,fe,_,F]);let qf=(0,k.useMemo)(()=>re?.tracers.length?re.tracers:F,[re?.tracers,F]),Yf=(0,k.useMemo)(()=>_.filter(m=>!m.hiddenFromView).sort((m,v)=>{let w=Tc(m,F),b=Tc(v,F);return w!==b?w?-1:1:Date.parse(v.updatedAt)-Date.parse(m.updatedAt)}),[_,F]),ES=qf[0]??null,Kf=re?.messages??[],TS=ye!==null,Jf=!!(g&&ye===g),IS=(0,k.useMemo)(()=>(I.trim()||U.length)&&!TS,[I,U.length,TS]);(0,k.useEffect)(()=>{!fe||!e.vidfarmApiKey||!re||!re.messages.length||gx(re)},[re,e.vidfarmApiKey,fe]);async function wc(m,v){if(!e.vidfarmApiKey||!e.threadsUrl||!m.messages.length)return;let w=we(m.id);w&&await fetch(w,{method:"PATCH",headers:ct(e.vidfarmApiKey,"application/json"),body:JSON.stringify({template_id:e.template.templateId,title:v?.title??m.title,tracers:v?.tracers??m.tracers,hidden_from_view:v?.hiddenFromView??m.hiddenFromView===!0,archived:v?.archived})}).catch(()=>{})}async function ZR(m){if(!e.vidfarmApiKey||!e.threadsUrl||!m.messages.length)return;let v=we(m.threadId);v&&await fetch(`${v}/exchanges`,{method:"POST",headers:ct(e.vidfarmApiKey,"application/json"),body:JSON.stringify({template_id:m.templateId??e.template.templateId,title:m.title||"New chat",tracers:m.tracers,messages:m.messages.map(w=>({id:w.id,role:w.role,text:w.text,attachments:w.attachments.map(b=>({id:b.id,fileName:b.fileName,contentType:b.contentType,viewUrl:b.viewUrl})),toolExchanges:w.toolExchanges,httpExchanges:w.httpExchanges?.map(Ic)}))})}).catch(()=>{})}async function ex(m){if(!e.vidfarmApiKey||!e.threadsUrl)return;let v=we(m);v&&await fetch(v,{method:"DELETE",headers:ct(e.vidfarmApiKey)}).catch(()=>{})}function wS(m){let v=new URL(window.location.href);m.length?v.searchParams.set("tracers",m.join(",")):v.searchParams.delete("tracers"),window.history.replaceState({},"",v.toString()),window.dispatchEvent(new CustomEvent("vidfarm:editor-tracers-changed",{detail:{tracers:m}}))}function fa(m){let v=tr(m),w=window.__vidfarmEditorTracers;if(w){w.set(v);return}ne(v),wS(v)}function CS(){let m=window.__vidfarmEditorTracers;if(m)return m.add();let v=LF(e.template.templateSlug,F);return fa([v,...F]),v}function RS(m){let v=window.__vidfarmEditorTracers?.get()??F,w=m?OF(m,v):null,b=window.__vidfarmEditorTracers;return b?b.add(w??void 0):w?(fa([w,...v.filter(B=>B!==w)]),w):CS()}function tx(m){let v=m.trim();if(!v)return;let w=window.__vidfarmEditorTracers;w?w.add(v):F.includes(v)||fa([v,...F]),re&&ft(re.id,b=>({...b,tracers:[v,...b.tracers.filter(B=>B!==v)],updatedAt:new Date().toISOString()}))}function nx(m){let v=window.__vidfarmEditorTracers;if(v){v.remove(m);return}let w=F.filter(b=>b!==m);fa(w)}(0,k.useEffect)(()=>{wS(F)},[F]),(0,k.useEffect)(()=>{let m=s.current;if(!m)return;let v=()=>{a.current=uF(m),a.current||(l.current=!1)};return v(),m.addEventListener("scroll",v,{passive:!0}),()=>{m.removeEventListener("scroll",v)}},[]),(0,k.useLayoutEffect)(()=>{let m=s.current;if(!m)return;let v=c.current!==g;c.current=g,(v||l.current||a.current)&&(m.scrollTo({top:m.scrollHeight,behavior:"auto"}),a.current=!0,l.current=!1)},[Kf,g]),(0,k.useEffect)(()=>()=>{u.current?.abortController.abort(),u.current=null;for(let m of d.current.values())m.timeoutId!==null&&window.clearTimeout(m.timeoutId),m.abortController?.abort();d.current.clear()},[]),(0,k.useEffect)(()=>{if(!M)return;let m=()=>A(null);return document.addEventListener("click",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),()=>{document.removeEventListener("click",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0)}},[M]),(0,k.useEffect)(()=>{let m=()=>{if(document.visibilityState!=="visible"||!navigator.onLine)return;let v=Date.now();for(let w of d.current.values())w.inFlight||w.nextPollAt!==null&&w.nextPollAt<=v&&w.runPoll&&Qf(w,w.runPoll,w.nextPollAt-v)};return window.addEventListener("online",m),document.addEventListener("visibilitychange",m),()=>{window.removeEventListener("online",m),document.removeEventListener("visibilitychange",m)}},[]);function rx(m){if(re)return re.id;let v=new Date().toISOString(),w=vR(),b={id:w,templateId:e.template.templateId,title:Of(m||""),createdAt:v,updatedAt:v,lastMessageAt:null,messageCount:0,tracers:tr(F),messages:[]};return h.current=[b,...h.current],T(B=>[b,...B]),S(w),w}function Xf(m){let v=new Date().toISOString(),w=tr(m?.tracers??F),b=vR(),B={id:b,templateId:e.template.templateId,title:m?.title||"New chat",createdAt:v,updatedAt:v,lastMessageAt:null,messageCount:0,tracers:w,messages:[]};return h.current=[B,...h.current],T(Y=>[B,...Y]),m?.activate!==!1&&(S(b),N(""),x([]),W(null)),A(null),b}function xS(){Xf(),ut(!1)}function ox(m){let v=_.find(b=>b.id===m);if(!v||!window.confirm(`Delete conversation "${v.title}"?`))return;let w=_.filter(b=>b.id!==m);h.current=h.current.filter(b=>b.id!==m);for(let[b,B]of d.current.entries())B.threadId===m&&pa(b);T(w),g===m&&S(w[0]?.id??null),W(null),A(null),ex(m)}function ft(m,v){let w=UF(h.current.map(b=>b.id===m?v(b):b));h.current=w,T(w)}function ix(m,v){let w=tr(v);ft(m,B=>({...B,tracers:sS(B.tracers,w),updatedAt:new Date().toISOString()}));let b=h.current.find(B=>B.id===m);b&&wc({...b,tracers:sS(b.tracers,w),updatedAt:new Date().toISOString()},{tracers:sS(b.tracers,w)})}function bS(m,v){let w=m.trim();return w?h.current.find(b=>!b.hiddenFromView&&b.id!==v&&b.tracers.includes(w))?.id??null:null}function sx(m,v){let w=bS(m);return w||Xf({tracers:[m],title:v?.title||`Tracer ${m}`,activate:v?.activate??!1})}function ax(m){let v=m.toLowerCase();return/(?:own|separate|different|new)\s+(?:tracer\s+and\s+)?chat\s+threads?/.test(v)||/chat\s+threads?.{0,80}(?:own|separate|different|new)\s+tracers?/.test(v)||/each.{0,80}(?:own|separate|different|new).{0,80}chat\s+threads?/.test(v)||/(?:own|separate|different|new)\s+tracers?/.test(v)||/(?:each|every|per|one\s+per).{0,80}(?:own|separate|different|new).{0,80}tracers?/.test(v)||/(?:own|separate|different|new)\s+tracers?.{0,80}(?:each|every|per|outputs?|pieces?|posts?|jobs?|generations?)/.test(v)||/(?:outputs?|pieces?|posts?|jobs?|generations?).{0,80}(?:own|separate|different|new)\s+tracers?/.test(v)}function lx(m){let v=bS(m.tracer,m.sourceThreadId);if(!v&&!m.shouldCreateThread)return null;let w=v??sx(m.tracer,{title:`Tracer ${m.tracer}`,activate:!1});if(!w||w===m.sourceThreadId)return null;let b=Bf("assistant"),B=new Date().toISOString(),Y=m.job.status==="succeeded"||m.job.status==="failed"||m.job.status==="cancelled"?Lf(m.job):fR(m.job),j=m.job.status==="succeeded"||m.job.status==="failed"||m.job.status==="cancelled"?null:`Job ${m.job.job_id} is being tracked. ${Zf()}`,ce={id:b,role:"assistant",text:Y,attachments:[],httpExchanges:m.httpExchange?[m.httpExchange]:[],statusText:j,isPending:!1};ft(w,ue=>({...ue,updatedAt:B,messages:[...ue.messages,ce]}));let he=h.current.find(ue=>ue.id===w);return he&&ZR({threadId:w,templateId:he.templateId,title:he.title,tracers:he.tracers,messages:[ce]}),{threadId:w,messageId:b}}function cx(m){let v=_.find(B=>B.id===m);if(!v)return;let w=window.prompt("Thread tracers, comma separated",v.tracers.join(", "));if(w===null)return;let b=tr(w.split(","));ft(m,B=>({...B,tracers:b,updatedAt:new Date().toISOString()})),wc(v,{tracers:b}),A(null)}function ux(m){let v=_.find(B=>B.id===m);if(!v||!window.confirm(`Archive conversation "${v.title}"? Its tracer links will be prefixed with archived_.`))return;let b=tr(v.tracers.map(MF));ft(m,B=>({...B,tracers:b,updatedAt:new Date().toISOString()})),wc(v,{tracers:b,archived:!0}),A(null)}function dx(m){let v=_.find(b=>b.id===m);if(!(!v||!window.confirm(`Remove conversation "${v.title}" from this frontend view? The thread and tracer links stay available; Delete removes the thread completely.`))){for(let[b,B]of d.current.entries())B.threadId===m&&pa(b);if(ft(m,b=>({...b,hiddenFromView:!0,updatedAt:new Date().toISOString()})),g===m){let b=Yf.find(B=>B.id!==m);S(b?.id??null)}A(null),W(null),wc(v,{hiddenFromView:!0})}}async function fx(m){try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(m);else{let v=document.createElement("textarea");v.value=m,v.setAttribute("readonly",""),v.style.position="fixed",v.style.opacity="0",document.body.appendChild(v),v.select(),document.execCommand("copy"),document.body.removeChild(v)}W(null)}catch{W("Unable to copy chat ID.")}finally{A(null)}}function px(m,v){if(M?.threadId===m){A(null);return}let w=v.getBoundingClientRect(),b=148;A({threadId:m,top:w.bottom+6,left:Math.max(8,Math.min(window.innerWidth-b-8,w.right-b))})}function pa(m){let v=d.current.get(m);v&&(v.timeoutId!==null&&window.clearTimeout(v.timeoutId),v.abortController?.abort(),d.current.delete(m))}function ma(m,v,w){let b=d.current.get(m);b&&Qf(b,v,w)}function Qf(m,v,w){m.timeoutId!==null&&window.clearTimeout(m.timeoutId);let b=Math.max(gR,w);m.nextPollAt=Date.now()+b,m.timeoutId=window.setTimeout(()=>{m.timeoutId=null,v()},b)}function Vi(){return d.current.size>=mR?fF:pR}function qi(m=Vi()){if(m>=6e4){let v=Math.round(m/6e4);return`${v} min${v===1?"":"s"}`}return`${Math.round(m/1e3)}s`}function Zf(m=Vi()){return d.current.size>=mR?`Many renders are active, so the next check is in ${qi(m)}.`:`Checking again gently every ${qi(m)}.`}function mx(){let m=Vi();if(m===pR)return;let v=Date.now();for(let w of d.current.values()){if(w.inFlight||!w.runPoll)continue;(w.nextPollAt===null?0:w.nextPollAt-v)<m&&Qf(w,w.runPoll,m)}}function hx(m){let v=Math.max(m,p.current.nextAvailableAt);return p.current.nextAvailableAt=v+pF,v-m}function ep(m){let v=yR(m.threadId,m.assistantMessageId,m.jobId);if(d.current.has(v))return;d.current.set(v,{timeoutId:null,abortController:null,runPoll:null,inFlight:!1,nextPollAt:null,lastPollAt:null,attempts:0,threadId:m.threadId});let w=async()=>{let Y=d.current.get(v);if(!Y||Y.inFlight)return;let j=Date.now(),ce=Vi();if(Y.lastPollAt!==null&&j-Y.lastPollAt<ce){ma(v,w,ce-(j-Y.lastPollAt));return}if(Y.attempts>=hR){ft(m.threadId,ue=>({...ue,updatedAt:new Date().toISOString(),messages:ue.messages.map(de=>de.id===m.assistantMessageId?{...de,statusText:"Background polling stopped after multiple checks. Open the job route when you want to refresh again."}:de)})),pa(v);return}if(document.visibilityState!=="visible"||!navigator.onLine){ma(v,w,ce);return}let he=hx(Date.now());if(he>0){ma(v,w,he);return}Y.inFlight=!0,Y.lastPollAt=j,Y.nextPollAt=null,Y.attempts+=1,Y.abortController=new AbortController;try{ft(m.threadId,Be=>({...Be,updatedAt:new Date().toISOString(),messages:Be.messages.map(X=>X.id===m.assistantMessageId?{...X,statusText:`Job ${m.jobId} is being tracked. ${Zf(ce)}`}:X)}));let ue=m.primitiveId||mF(m.sourceRequestUrl)?`/api/v1/primitives/jobs/${encodeURIComponent(m.jobId)}`:`/api/v1/templates/${encodeURIComponent(e.template.templateId)}/jobs/${encodeURIComponent(m.jobId)}`,de=await fetch(ue,{method:"GET",headers:ct(e.vidfarmApiKey),signal:Y.abortController.signal}),ln=await de.json().catch(()=>null),ha=Object.fromEntries(de.headers.entries()),G=Hi(ln);if(ft(m.threadId,Be=>({...Be,updatedAt:new Date().toISOString(),messages:Be.messages.map(X=>{if(X.id!==m.assistantMessageId)return X;let Ee=dF(X.httpExchanges,Ic({explanation:`Automatic ${qi(ce)} job status check for ${m.jobId}`,pollJobId:m.jobId,pollMode:"automatic",request:{method:"GET",url:ue,headers:Object.fromEntries(ct(e.vidfarmApiKey).entries())},result:{status:de.status,statusText:de.statusText,headers:ha,body:ln}})),ke=G?G.status==="succeeded"?`Render ${G.job_id} succeeded.`:G.status==="failed"||G.status==="cancelled"?`Render ${G.job_id} ${G.status}.${G.error?.message?` ${G.error.message}`:""}`:`Render ${G.job_id} is ${G.status}. Next check in ${qi(ce)}.`:`Render ${m.jobId} checked. Next check in ${qi(ce)}.`;return{...X,httpExchanges:Ee,statusText:ke,text:G&&(G.status==="succeeded"||G.status==="failed"||G.status==="cancelled")?Ec(X.text,Lf(G)):X.text}})})),G&&(G.status==="succeeded"||G.status==="failed"||G.status==="cancelled")){pa(v);return}}catch(ue){if(ue instanceof DOMException&&ue.name==="AbortError")return;ft(m.threadId,de=>({...de,updatedAt:new Date().toISOString(),messages:de.messages.map(ln=>ln.id===m.assistantMessageId?{...ln,statusText:`Automatic polling paused after an error. It will retry in ${qi()}.`}:ln)}))}finally{let ue=d.current.get(v);if(!ue)return;ue.inFlight=!1,ue.abortController=null,ue.attempts<hR&&ue.timeoutId===null&&d.current.has(v)&&ma(v,w,Vi())}},b=d.current.get(v);b&&(b.runPoll=w),d.current.get(v)&&(ma(v,w,m.initialDelayMs??Vi()),mx())}function gx(m){for(let v of m.messages)if(!(v.role!=="assistant"||!v.httpExchanges?.length))for(let w of v.httpExchanges){if(w.request.method!=="POST")continue;let b=Hi(w.result.body),B=yR(m.id,v.id,b?.job_id??"");!b||ua(b.status)||d.current.has(B)||v.httpExchanges.some(j=>{let ce=Hi(j.result.body);return ce?.job_id===b.job_id&&ua(ce.status)})||ep({threadId:m.id,assistantMessageId:v.id,jobId:b.job_id,tracer:b.tracer,initialStatus:b.status,primitiveId:b.primitive_id,sourceRequestUrl:w.request.url,initialDelayMs:gR})}}async function tp(m){if(!m.length)return;W(null);let v=[],w=null;for(let b of m)try{let B=await GR({apiKey:e.vidfarmApiKey,file:b,folderPath:LR}),Y=await WR({attachment:B,file:b,currentInlineBytes:jR([...U,...v])});v.push(Y)}catch(B){w=B instanceof Error?B.message:"Unable to upload attachment."}w&&v.length===0&&W(w),v.length&&(x(b=>[...b,...v]),w&&W(w))}async function yx(m){let v=Array.from(m.target.files??[]);await tp(v),m.target.value=""}async function Sx(m){let v=Array.from(m.clipboardData.files??[]).filter(w=>w.size>0);v.length&&(m.preventDefault(),await tp(v))}async function _x(m){m.preventDefault(),J(!1);let v=Array.from(m.dataTransfer.files??[]).filter(w=>w.size>0);v.length&&await tp(v)}async function vx(m,v,w){let b=w??{},B=e.vidfarmApiKey,Y=window.location.origin,j=ct(B,"application/json"),ce=ct(B),he=X=>new Promise(Ee=>setTimeout(Ee,X)),ue=(X,Ee)=>{ft(m,ke=>({...ke,updatedAt:new Date().toISOString(),messages:ke.messages.map(Ne=>Ne.id===v?{...Ne,isPending:!1,statusText:X??Ne.statusText,text:Ee?Ec(Ne.text,Ee):Ne.text}:Ne)}))},de=async X=>{let Ee=await X.text();try{return Ee?JSON.parse(Ee):null}catch{return null}},ln=async X=>{let Ee=Date.now()+3e5;for(;;){let ke=await fetch(new URL(`/api/v1/videos/${encodeURIComponent(X)}`,Y),{headers:ce}),Ne=await de(ke),He=String(Ne?.status??"");if(He==="ready")return Ne;if(He==="failed")throw new Error(`source video download failed${Ne?.error?`: ${Ne.error}`:""}.`);if(Date.now()>Ee)throw new Error("source video download timed out.");await he(5e3)}},ha=X=>{let Ee=Te=>typeof Te=="string"&&Te.trim()?Te.trim():null,ke=X?.result&&typeof X.result=="object"?X.result:{},Ne=ke.output&&typeof ke.output=="object"?ke.output:ke,He=Ee(Ne?.primary_file_url)??Ee(Ne?.video?.file_url)??Ee(Ne?.image?.file_url)??Ee(Ne?.render?.output_url);if(He)return He;if(Array.isArray(Ne?.files))for(let Te of Ne.files){let Le=Ee(typeof Te=="string"?Te:Te?.file_url??Te?.url);if(Le)return Le}if(Array.isArray(X?.artifacts))for(let Te of X.artifacts){let Le=Ee(Te?.public_url);if(Le)return Le}return null},G=async X=>{let Ee=Date.now()+48e4;for(;;){await he(5e3);let ke=await fetch(new URL(`/api/v1/user/me/jobs/${encodeURIComponent(X)}`,Y),{headers:ce}),Ne=await de(ke),He=String(Ne?.status??""),Te=ha(Ne);if(Te)return Te;if(He==="failed"||He==="cancelled")throw new Error(`generation ${He}.`);if(Date.now()>Ee)throw new Error("generation timed out.")}},Be=async(X,Ee)=>{let ke=await(await fetch(X)).blob(),Ne=await fetch(new URL("/discover/templates/upload/presign",Y),{method:"POST",headers:j,body:JSON.stringify({file_name:"generated.mp4",content_type:"video/mp4",size_bytes:ke.size})}),He=await de(Ne);if(!Ne.ok)throw new Error(He?.error||`upload presign failed (${Ne.status})`);let Te=He?.storage_key,Le=He?.file_name||"generated.mp4";if(He?.transport==="presigned"&&He?.upload?.url){let Oe=await fetch(He.upload.url,{method:He.upload.method||"PUT",headers:He.upload.headers||{},body:ke});if(!Oe.ok)throw new Error(`upload failed (${Oe.status})`)}else{let Oe=new FormData;Oe.append("file",ke,"generated.mp4");let Kt=await fetch(new URL(He?.upload?.url||"/discover/templates/upload",Y),{method:"POST",headers:ce,body:Oe}),_t=await de(Kt);if(!Kt.ok||!_t?.storage_key)throw new Error(_t?.error||`upload failed (${Kt.status})`);Te=_t.storage_key,Le=_t.file_name||"generated.mp4"}if(!Te)throw new Error("upload did not return a storage key.");let ho=await fetch(new URL("/discover/templates",Y),{method:"POST",headers:j,body:JSON.stringify({upload:{storage_key:Te,file_name:Le},title:Ee})}),Ot=await de(ho);if(!ho.ok)throw new Error(Ot?.error||`ingest failed (${ho.status})`);return Ot};try{if(!B){ue(null,"\u26A0\uFE0F You need to be logged in to create a video.");return}let X=b.mode==="replicate"?"replicate":b.mode==="generate"?"generate":null,Ee,ke;if(X==="replicate"){let Kt=(b.source_url??"").trim();if(!/^https?:\/\//i.test(Kt)){ue(null,"\u26A0\uFE0F I need a video URL (TikTok/YouTube/Instagram/X) to replicate.");return}ke=(b.instructions??"").trim()||null,ue("Fetching the source video\u2026");let _t=await fetch(new URL("/discover/templates",Y),{method:"POST",headers:j,body:JSON.stringify({source_url:Kt})}),Dr=await de(_t);if(!_t.ok)throw new Error(Dr?.error||`couldn't fetch that URL (${_t.status})`);Ee=Dr?.status==="ready"?Dr:await ln(Dr?.inspiration_id)}else if(X==="generate"){let Kt=(b.prompt??"").trim();if(!Kt){ue(null,"\u26A0\uFE0F Tell me what the video should be about and I'll create it.");return}ke=Kt,ue("Generating your video\u2026 (this can take a couple of minutes)");let _t=await fetch(new URL("/api/v1/primitives/videos/generate",Y),{method:"POST",headers:j,body:JSON.stringify({tracer:`chat-create-${Date.now().toString(36)}`,payload:{prompt:Kt}})}),Dr=await de(_t);if(!_t.ok)throw new Error(Dr?.error||`couldn't start generation (${_t.status})`);let Ix=await G(Dr?.job_id);ue("Building an editable template from the generated video\u2026");let np=await Be(Ix,Kt.slice(0,80));Ee=np?.status==="ready"?np:await ln(np?.inspiration_id)}else{ue(null,"\u26A0\uFE0F I couldn't tell whether to generate a new video or replicate a URL \u2014 try rephrasing.");return}let Ne=Ee?.template_id,He=Ee?.inspiration_id;if(!Ne||!He)throw new Error("the template wasn't created from the video.");ue(X==="replicate"?"Recreating the scenes\u2026 (about a minute)":"Analyzing into an editable timeline\u2026");let Te=await fetch(new URL(`/api/v1/inspirations/${encodeURIComponent(He)}/decompose`,Y),{method:"POST",headers:j,body:JSON.stringify({user_prompt:ke})});if(!Te.ok){let Kt=await de(Te);throw new Error(Kt?.error||`scene analysis failed (${Te.status})`)}ue("Finalizing your editable copy\u2026");let Le=await fetch(new URL("/api/v1/compositions",Y),{method:"POST",headers:j,body:JSON.stringify({template_id:Ne})}),ho=await de(Le);if(!Le.ok)throw new Error(ho?.error||`couldn't create an editable copy (${Le.status})`);let Ot=ho?.fork_id,Oe=`${Y}/editor/${encodeURIComponent(Ne)}${Ot?`?fork=${encodeURIComponent(Ot)}`:""}`;ue("Your video is ready.",`\u2705 Your video is ready \u2014 [Open it in the editor](${Oe}).`)}catch(X){ue(null,`\u26A0\uFE0F I couldn't finish creating the video: ${X instanceof Error?X.message:String(X)}`)}}async function kS(){if(!IS)return;l.current=!0;let m=rx(I),v=new Date().toISOString(),w=h.current.find(he=>he.id===m),b={id:Bf("user"),role:"user",text:I.trim(),attachments:U},B={id:Bf("assistant"),role:"assistant",text:"",attachments:[],statusText:"Waiting for AI response\u2026",isPending:!0},Y=w?.messages??[],j=wF([...Y,b]);ft(m,he=>({...he,title:he.messages.length===0?Of(b.text):he.title,updatedAt:v,messages:[...he.messages,b,B]})),N(""),x([]),W(null),K(m),pe("Waiting for AI response\u2026");let ce=new AbortController;u.current={abortController:ce,threadId:m,assistantMessageId:B.id};try{let he=JSON.stringify({messages:RF(j),thread_id:m,thread_template_id:w?.templateId??e.template.templateId,thread_title:Y.length===0?Of(b.text):w?.title??Of(b.text),thread_tracers:qf,client_context:ZU(),user_message:{id:b.id,role:b.role,text:b.text,attachments:b.attachments.map(G=>({id:G.id,fileName:G.fileName,contentType:G.contentType,viewUrl:G.viewUrl}))},assistant_message:{id:B.id},template:{...e.template,tracers:qf,defaultRequestTracer:ES,activeTracer:ES},cached_context:{...e.cachedContext,...xF(),...bF()}});Lr("chat.send.attempt",{thread_id:m,template_id:e.template.templateId,message_count:j.length,attachment_count:b.attachments.length,text_length:b.text.length});let ue=Date.now(),de=await fetch(e.apiUrl||"/api/v1/editor-chat",{method:"POST",headers:ct(e.vidfarmApiKey,"application/json"),signal:ce.signal,body:he});if(!de.ok){let G=await de.json().catch(()=>({}));throw uo("chat.send.rejected",{thread_id:m,status:de.status,error:typeof G?.error=="string"?G.error:null}),new Error(typeof G?.error=="string"?G.error:`Chat failed with status ${de.status}.`)}Lr("chat.send.stream_open",{thread_id:m,latency_ms:Date.now()-ue});let ln=new Map,ha=ax(b.text);await kF(de,{onDelta:G=>{pe("AI is responding\u2026"),ft(m,Be=>({...Be,updatedAt:new Date().toISOString(),messages:Be.messages.map(X=>X.id===B.id?{...X,text:`${X.text}${G}`,statusText:"AI is responding\u2026",isPending:!1}:X)}))},onStatus:G=>{pe(G),ft(m,Be=>({...Be,messages:Be.messages.map(X=>X.id===B.id?{...X,statusText:G,isPending:!X.text}:X)}))},onToolCall:G=>{ln.set(G.toolCallId,{toolName:G.toolName,args:G.args}),ft(m,Be=>({...Be,updatedAt:new Date().toISOString(),messages:Be.messages.map(X=>X.id===B.id?{...X,toolExchanges:[...X.toolExchanges??[],{toolCallId:G.toolCallId,toolName:G.toolName,args:zi(G.args),status:"pending"}]}:X)}))},onToolResult:G=>{let Be=OR(G.result),X=ln.get(G.toolCallId);if(G.toolName==="create_video"&&vx(m,B.id,G.result),G.toolName==="frontend_action"){let Te=G.result;if(Te?.action==="add_tracer")RS(Te.tracer??void 0);else if(Te?.action==="remove_tracer"&&Te.tracer)nx(Te.tracer);else if(Te?.action==="activate_tracer"&&Te.tracer)tx(Te.tracer);else if(Te?.action==="create_thread"){let Le=Te.tracer?RS(Te.tracer):CS();Xf({tracers:Le?[Le]:[],title:Le?`Tracer ${Le}`:"New chat",activate:!1})}}let Ee=G.result,ke=Hi(Ee?.response?.body),Ne=Ee?.request&&Ee?.response?Ic({explanation:Ee.explanation??null,request:Ee.request,result:Ee.response}):void 0,He=Ee?.request?.method==="POST"&&ke?.tracer?lx({sourceThreadId:m,tracer:ke.tracer,job:ke,httpExchange:Ne,shouldCreateThread:ha}):null;He&&ke&&!ua(ke.status)&&ep({threadId:He.threadId,assistantMessageId:He.messageId,jobId:ke.job_id,tracer:ke.tracer,initialStatus:ke.status,primitiveId:ke.primitive_id,sourceRequestUrl:Ee?.request?.url}),ft(m,Te=>({...Te,updatedAt:new Date().toISOString(),messages:Te.messages.map(Le=>{if(Le.id!==B.id)return Le;let ho=(Le.toolExchanges??[]).map(_t=>_t.toolCallId===G.toolCallId?{..._t,result:Be,status:typeof G.result?.error=="string"?"error":"complete"}:_t),Ot=G.result,Oe=Hi(Ot?.response?.body),Kt=Ot?.request&&Ot?.response?[...Le.httpExchanges??[],Ic({explanation:Ot.explanation??null,request:Ot.request,result:Ot.response})]:Le.httpExchanges;if(X&&ln.delete(G.toolCallId),Ot?.request?.method==="POST"&&Oe?.tracer){let _t=window.__vidfarmEditorTracers;_t?_t.add(Oe.tracer):fa([Oe.tracer,...F.filter(Dr=>Dr!==Oe.tracer)]),ix(m,[Oe.tracer])}return Oe&&!He&&!ua(Oe.status)&&ep({threadId:m,assistantMessageId:B.id,jobId:Oe.job_id,tracer:Oe.tracer,initialStatus:Oe.status,primitiveId:Oe.primitive_id,sourceRequestUrl:Ot?.request?.url}),{...Le,toolExchanges:ho,httpExchanges:Kt,statusText:Oe&&!ua(Oe.status)?`Job ${Oe.job_id} is being tracked. ${Zf()}`:Le.statusText,isPending:!1,text:Oe&&Ot?.request?.method==="POST"&&Ot?.response?.status===202?Ec(Le.text,fR(Oe)):Oe&&ua(Oe.status)||Oe?Ec(Le.text,Lf(Oe)):Le.text}})}))},onError:G=>{uo("chat.stream.error",{thread_id:m,message:G}),W(G),pe(null),ft(m,Be=>({...Be,messages:Be.messages.filter(X=>X.id!==B.id)}))}}),Lr("chat.stream.completed",{thread_id:m,duration_ms:Date.now()-ue}),ft(m,G=>({...G,updatedAt:new Date().toISOString(),messages:G.messages.map(Be=>Be.id===B.id?{...Be,statusText:Be.statusText?.includes("being tracked")?Be.statusText:null,isPending:!1}:Be)}))}catch(he){if(he instanceof DOMException&&he.name==="AbortError"){eR("chat.send.aborted",{thread_id:m}),W(null),pe(null),ft(m,ue=>({...ue,updatedAt:new Date().toISOString(),messages:ue.messages.map(de=>de.id!==B.id?de:!!(de.text.trim()||de.toolExchanges?.length||de.httpExchanges?.length)?{...de,statusText:"Stopped.",isPending:!1}:{...de,text:"Stopped.",statusText:null,isPending:!1})}));return}uo("chat.send.failed",{thread_id:m,message:he instanceof Error?he.message:String(he)}),W(he instanceof Error?he.message:"Unable to send chat message."),pe(null),ft(m,ue=>({...ue,messages:ue.messages.map(de=>de.id===B.id?{...de,text:he instanceof Error?`Error: ${he.message}`:"Error: Unable to send chat message.",statusText:null,isPending:!1}:de)}))}finally{u.current?.assistantMessageId===B.id&&(u.current=null),K(he=>he===m?null:he),pe(null)}}function Ex(){pe("Stopping\u2026");let m=u.current;m&&ft(m.threadId,v=>({...v,updatedAt:new Date().toISOString(),messages:v.messages.map(w=>w.id===m.assistantMessageId?{...w,statusText:"Stopping\u2026"}:w)})),u.current?.abortController.abort()}(0,k.useEffect)(()=>()=>{u.current?.abortController.abort();for(let m of d.current.keys())pa(m);try{o?.setItem(r.threads,JSON.stringify(TR(me.current,Ve.current)))}catch{}},[o,r]);function Tx(m){m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),kS())}let NS=(0,f.jsx)("div",{className:`vf-editor-chat-thread-list${t?" vf-editor-chat-thread-list-sidebar":""}`,role:"tablist","aria-label":"Conversation threads",children:Yf.length?Yf.map(m=>(0,f.jsxs)("div",{role:"tab","aria-selected":m.id===g,className:"vf-editor-chat-thread-chip","data-active":m.id===g?"true":"false",children:[(0,f.jsxs)("button",{type:"button",className:"vf-editor-chat-thread-chip-main",onClick:()=>{S(m.id),W(null),A(null),ut(!1),t&&Ie(!1)},children:[(0,f.jsx)("span",{className:"vf-editor-chat-thread-chip-title",children:m.title}),m.tracers.length?(0,f.jsxs)("span",{className:"vf-editor-chat-thread-chip-tracers",children:[m.tracers.slice(0,2).join(", "),m.tracers.length>2?` +${m.tracers.length-2}`:""]}):null]}),(0,f.jsx)("div",{className:"vf-editor-chat-thread-menu-wrap",children:(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-thread-chip-menu","aria-label":`Actions for ${m.title}`,onClick:v=>{v.stopPropagation(),px(m.id,v.currentTarget)},children:"..."})})]},m.id)):(0,f.jsx)("div",{className:"vf-editor-chat-thread-empty",children:"Start a chat to create your first conversation thread."})});return(0,f.jsxs)("div",{className:"vf-editor-chat-shell","data-mobile-open":le?"true":"false","data-layout":t?"brainstorm":"default",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-mobile-fab","aria-label":"Open chat","aria-expanded":le,onClick:()=>Ie(!0),children:(0,f.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:(0,f.jsx)("path",{d:"M20 11.5a7.5 7.5 0 0 1-9.8 7.1L4 20l1.5-5.3A7.5 7.5 0 1 1 20 11.5Z"})})}),$?(0,f.jsx)("div",{className:"vf-editor-chat-error",role:"status",children:$}):null,(0,f.jsxs)("div",{className:`${t?"vf-editor-chat-body vf-editor-chat-brainstorm-layout":"vf-editor-chat-body"}${n?" has-sidebar":""}`,"data-history-open":_e||Xe?"true":"false",children:[n?(0,f.jsxs)("aside",{className:"vf-editor-chat-history-pane",children:[(0,f.jsx)("div",{className:"vf-editor-chat-history-header",children:(0,f.jsxs)("div",{className:"vf-editor-chat-history-header-main",children:[(0,f.jsxs)("a",{className:"vf-editor-chat-back-button",href:"/discover","aria-label":"Back to Discover",children:[(0,f.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,f.jsx)("path",{d:"m12 4-6 6 6 6"})}),"Discover"]}),(0,f.jsx)("div",{className:"vf-editor-chat-history-kicker",children:"Chat history"})]})}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-new-thread vf-editor-chat-new-thread-sidebar",onClick:xS,children:"New chat"}),NS]}):null,(0,f.jsxs)("div",{className:"vf-editor-chat-thread",children:[(0,f.jsxs)("div",{className:"vf-editor-chat-header",children:[(0,f.jsxs)("div",{className:"vf-editor-chat-header-row",children:[(0,f.jsx)("a",{className:"vf-editor-chat-back-button vf-editor-chat-back-button--header",href:"/discover","aria-label":"Back to Discover",children:(0,f.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,f.jsx)("path",{d:"m12 4-6 6 6 6"})})}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-history-icon","aria-label":_e?"Back to chat":"Open chat history","aria-pressed":_e,onClick:()=>{ut(m=>!m),Yt(!1)},children:_e?(0,f.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,f.jsx)("path",{d:"m12 4-6 6 6 6"})}):(0,f.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,f.jsx)("circle",{cx:"10",cy:"10",r:"7.2"}),(0,f.jsx)("path",{d:"M10 6v4l2.6 1.6"})]})}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-history-icon vf-editor-chat-branches-icon","aria-label":Xe?"Back to chat":"Open template forks","aria-pressed":Xe,onClick:()=>{Yt(m=>!m),ut(!1)},children:Xe?(0,f.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,f.jsx)("path",{d:"m12 4-6 6 6 6"})}):(0,f.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,f.jsx)("circle",{cx:"5.5",cy:"4.5",r:"1.9"}),(0,f.jsx)("circle",{cx:"5.5",cy:"15.5",r:"1.9"}),(0,f.jsx)("circle",{cx:"14.5",cy:"8",r:"1.9"}),(0,f.jsx)("path",{d:"M5.5 6.4v7.2"}),(0,f.jsx)("path",{d:"M5.5 13.6c0-3.2 2.4-3.6 4.4-3.9 2-.3 4.6-.5 4.6-3.7"})]})}),(0,f.jsxs)("div",{className:"vf-editor-chat-header-titles",children:[(0,f.jsx)("div",{className:"vf-editor-chat-header-title",children:"Vidfarm"}),(0,f.jsx)("div",{className:"vf-editor-chat-header-subtitle",children:_e?"Chat history":Xe?"Template forks":e.template.templateTitle})]}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-new-thread",onClick:xS,children:"New chat"}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-minimize","aria-label":"Minimize chat",onClick:()=>Ie(!1),children:"\xD7"})]}),M&&Dn?(0,ji.createPortal)((0,f.jsxs)("div",{className:"vf-editor-chat-thread-menu",role:"menu",style:{top:M.top,left:M.left},onClick:m=>m.stopPropagation(),children:[(0,f.jsx)("button",{type:"button",onClick:()=>fx(Dn.id),children:"Copy Chat ID"}),(0,f.jsx)("button",{type:"button",onClick:()=>cx(Dn.id),children:"Edit tracers"}),(0,f.jsx)("button",{type:"button",onClick:()=>dx(Dn.id),children:"Remove from view"}),(0,f.jsx)("button",{type:"button",onClick:()=>ux(Dn.id),children:"Archive thread"}),(0,f.jsx)("button",{type:"button","data-danger":"true",onClick:()=>ox(Dn.id),children:"Delete"})]}),document.body):null]}),(0,f.jsx)("div",{className:"vf-editor-chat-viewport",ref:s,children:_e?(0,f.jsx)("div",{className:"vf-editor-chat-history-panel",children:NS}):Xe?(0,f.jsxs)("div",{className:"vf-editor-chat-history-panel vf-editor-chat-branches-panel",children:[(0,f.jsxs)("div",{className:"vf-editor-chat-branches-header",children:[(0,f.jsxs)("div",{className:"vf-editor-chat-branches-header-main",children:[(0,f.jsx)("div",{className:"vf-editor-chat-branches-kicker",children:"Forks"}),(0,f.jsxs)("div",{className:"vf-editor-chat-branches-title",children:[dt?.length??0," fork",(dt?.length??0)===1?"":"s"," of this template"]})]}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-branches-refresh",onClick:()=>{Fe({force:!0})},disabled:Tn,"aria-label":"Refresh forks",children:Tn?"Loading\u2026":"Refresh"})]}),po?(0,f.jsx)("div",{className:"vf-editor-chat-thread-empty",role:"status",children:po}):Tn&&!dt?(0,f.jsx)("div",{className:"vf-editor-chat-thread-empty",children:"Loading forks\u2026"}):dt&&dt.length?(0,f.jsx)("div",{className:"vf-editor-chat-thread-list",children:dt.map(m=>{let v=St===m.forkId,w=`/editor/${encodeURIComponent(e.template.templateId)}?fork=${encodeURIComponent(m.forkId)}`,b=m.title&&m.title.trim()?m.title:m.forkId,B=m.parentForkId?` \xB7 forked from ${m.parentForkId.slice(0,12)}${m.parentVersion?`#v${m.parentVersion}`:""}`:"",Y=m.latestVersion&&m.latestVersion>0?` \xB7 v${m.latestVersion}`:"";return(0,f.jsx)("div",{role:"listitem",className:"vf-editor-chat-thread-chip","data-active":v?"true":"false",children:(0,f.jsxs)("a",{className:"vf-editor-chat-thread-chip-main vf-editor-chat-branch-chip-link",href:w,target:"_blank",rel:"noopener noreferrer",children:[(0,f.jsxs)("span",{className:"vf-editor-chat-thread-chip-title",children:[b,v?(0,f.jsx)("span",{className:"vf-editor-chat-branch-current-badge",children:"current"}):null]}),(0,f.jsxs)("span",{className:"vf-editor-chat-thread-chip-tracers",children:[m.visibility??"private",Y,B]})]})},m.forkId)})}):(0,f.jsx)("div",{className:"vf-editor-chat-thread-empty",children:"No forks yet for this template."})]}):Kf.length?Kf.map(m=>(0,f.jsx)(KF,{message:m},m.id)):g&&E===g?(0,f.jsxs)("div",{className:"vf-editor-chat-empty",children:[(0,f.jsx)("div",{className:"vf-editor-chat-kicker",children:"Loading chat"}),(0,f.jsxs)("h2",{children:["Opening ",g]})]}):(0,f.jsxs)("div",{className:"vf-editor-chat-empty",children:[(0,f.jsx)("div",{className:"vf-editor-chat-kicker",children:"AI Copilot"}),(0,f.jsx)("h2",{children:t?"Start a new chat.":"Repurpose this video."}),(0,f.jsx)("p",{children:t?"Use the brainstorm tools to go from zero context to angles, hooks, and a strategy you can actually test.":"Use the brainstorm tools to turn this video into a native ad for your product, spot product-placement opportunities, and shape the timeline you can actually test. You can also connect from your own AI coding agent, including Claude Code or OpenAI Codex, and ask it to work against this composition."}),(0,f.jsx)("div",{className:"vf-editor-chat-empty-prompts","aria-label":"Example prompts",children:t?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{children:"I don't know where to start"}),(0,f.jsx)("div",{children:"Help me think of persuasive angles"}),(0,f.jsx)("div",{children:"Help me think of viral hooks"})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{children:"I don't know where to start"}),(0,f.jsx)("div",{children:"Repurpose this video into a social media native ad for my product"}),(0,f.jsx)("div",{children:"Help me identify product placement opportunities in this video for my product"})]})})]})}),(0,f.jsx)("div",{className:"vf-editor-chat-footer",hidden:_e||Xe,children:(0,f.jsxs)("div",{className:"vf-editor-chat-composer","data-drop-target":Se?"true":"false",onDragEnter:m=>{m.preventDefault(),J(!0)},onDragOver:m=>{m.preventDefault(),Se||J(!0)},onDragLeave:m=>{m.preventDefault();let v=m.relatedTarget;v instanceof Node&&m.currentTarget.contains(v)||J(!1)},onDrop:m=>{_x(m)},children:[Se?(0,f.jsx)("div",{className:"vf-editor-chat-dropzone-hint",children:"Drop files to attach"}):null,U.length?(0,f.jsx)("div",{className:"vf-editor-chat-composer-attachments-strip",children:U.map(m=>(0,f.jsx)(jF,{attachment:m,onRemove:()=>x(v=>v.filter(w=>w.id!==m.id))},m.id))}):null,(0,f.jsxs)("div",{className:"vf-editor-chat-composer-row",children:[(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-attach-button","aria-label":"Open upload drawer",onClick:()=>P(!0),children:"\u{1F4CE}"}),(0,f.jsx)("textarea",{rows:1,placeholder:t?"Describe the offer, audience, or strategy problem you want help with...":"Ask it to call a route, inspect jobs, save config, or continue this thread...",className:"vf-editor-chat-input",value:I,onChange:m=>N(m.target.value),onKeyDown:Tx,onPaste:m=>{Sx(m)}}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-send-button",onClick:()=>{if(Jf){Ex();return}kS()},disabled:Jf?!1:!IS,children:Jf?"Stop":"Send"})]}),(0,f.jsx)("input",{ref:i,type:"file",accept:"image/*,video/*,audio/*,application/pdf,text/plain,text/markdown",multiple:!0,hidden:!0,onChange:m=>{yx(m)}})]})})]})]}),(0,f.jsx)(XF,{apiKey:e.vidfarmApiKey,open:Gi,onClose:()=>P(!1),onConfirm:m=>x(v=>[...v,...m])})]})}var En=In(vc(),1);tR();function QF(){let e=document.getElementById("page-runtime-boot");return e?.textContent?JSON.parse(e.textContent):null}function Gf(e){let t=new Date;return t.setDate(t.getDate()+e),t.toISOString()}async function ZF(e){if(!e.userId)return;let t=e.store.getState();if(!e.force&&t.channels.length&&t.channelsUpdatedAt)return;let n=new URLSearchParams({start_date:Gf(-7),end_date:Gf(30)}),r=await fetch(`/u/${encodeURIComponent(e.userId)}/calendar/feed?${n.toString()}`,{headers:{accept:"application/json"}}),o=await r.json().catch(()=>null);!r.ok||!o||(e.store.getState().setCalendarData({channels:Array.isArray(o.channels)?o.channels:[],posts:Array.isArray(o.posts)?o.posts:[],rangeStart:o.startDate||Gf(-7),rangeEnd:o.endDate||Gf(30),replaceRange:!0}),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated")))}function eB({boot:e}){let t=(0,Wi.useMemo)(()=>sR(e),[e]),n=ZC(t,i=>i.boot.title),[r,o]=(0,Wi.useState)(null);return(0,Wi.useEffect)(()=>{t.getState().setHydratedAt(new Date().toISOString()),document.documentElement.dataset.reactRuntime="true",document.documentElement.dataset.reactRuntimePage=e.pageKind,document.title=n},[e.pageKind,t,n]),(0,Wi.useEffect)(()=>{if(!e.editorChat)return;let i=document.querySelector("[data-template-editor-chat-root]");o(i instanceof HTMLElement?i:null)},[e.editorChat]),e.editorChat&&r?(0,JR.createPortal)((0,En.jsx)(Ls,{fallback:(0,En.jsx)(tB,{}),children:(0,En.jsx)(KR,{boot:e.editorChat})}),r):null}function tB(){return(0,En.jsxs)("div",{style:{display:"grid",placeItems:"center",height:"100%",padding:"24px",textAlign:"center",gap:"12px",color:"#5c6a82"},children:[(0,En.jsx)("div",{style:{fontSize:"0.72rem",fontWeight:800,letterSpacing:"0.14em",textTransform:"uppercase"},children:"Chat error"}),(0,En.jsx)("div",{style:{fontSize:"0.92rem"},children:"Something went wrong loading the chat. Reload the page to try again."}),(0,En.jsx)("button",{type:"button",onClick:()=>window.location.reload(),style:{marginTop:"4px",minHeight:"34px",padding:"0 16px",border:"1px solid rgba(191, 164, 109, 0.34)",borderRadius:"999px",background:"rgba(255, 255, 255, 0.92)",color:"#243041",fontWeight:700,cursor:"pointer"},children:"Reload"})]})}var Qo=QF(),_S=document.getElementById("page-runtime-root"),vS=iR(Qo?.userId??null),Vf=null;function QR(e={}){return!e.force&&Vf||(Vf=ZF({userId:Qo?.userId??null,store:vS,force:e.force}).catch(()=>{})),Vf}window.__vidfarmFlockPosterCache={readSnapshot:()=>eS(Qo?.userId??null),ensureHydrated:QR,setChannelsData:e=>{vS.getState().setChannelsData(e),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated"))},setCalendarData:e=>{vS.getState().setCalendarData(e),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated"))}};QR();Lr("page_runtime.boot",{has_boot:!!Qo,has_root:!!_S,page_kind:Qo?.pageKind??null,editor_chat_template_id:Qo?.editorChat?.template?.templateId??null});Qo&&_S&&(0,XR.createRoot)(_S).render((0,En.jsx)(Ls,{fallback:(0,En.jsx)(En.Fragment,{}),onError:e=>uo("page_runtime.render_error",{message:e instanceof Error?e.message:String(e)}),children:(0,En.jsx)(eB,{boot:Qo})}));
|
|
45
|
+
`).map(h=>h.trim()).find(h=>h.startsWith("data:"));if(!c)continue;let u=c.slice(5).trim();if(u==="[DONE]")continue;let f;try{f=JSON.parse(u)}catch{continue}if(!f||typeof f!="object")continue;let p=f;if(p.type==="text-delta"&&typeof p.delta=="string")t.onDelta(p.delta);else if(p.type==="status"){let h=typeof p.status=="string"?p.status:typeof p.message=="string"?p.message:null;h&&t.onStatus&&t.onStatus(h)}else p.type==="tool-call"&&typeof p.toolCallId=="string"&&typeof p.toolName=="string"&&t.onToolCall?t.onToolCall({toolCallId:p.toolCallId,toolName:p.toolName,args:p.args&&typeof p.args=="object"?p.args:void 0}):p.type==="tool-result"&&typeof p.toolCallId=="string"&&typeof p.toolName=="string"&&t.onToolResult?t.onToolResult({toolCallId:p.toolCallId,toolName:p.toolName,result:p.result}):p.type==="error"&&t.onError&&t.onError?.(typeof p.errorText=="string"?p.errorText:typeof p.error?.message=="string"?p.error.message:"Unable to read assistant response.")}}}function MF(e){return{threads:`vidfarm-editor-chat-threads:${e}`,activeThread:`vidfarm-editor-chat-active-thread:${e}`}}function PF(){if(typeof window>"u")return null;try{return window.sessionStorage}catch{try{return window.localStorage}catch{return null}}}function TR(){return`thread-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function $f(e){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`${e}-${crypto.randomUUID()}`:`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function tr(e){let t=new Set,n=[];for(let r of e){let o=r.trim();!o||t.has(o)||(t.add(o),n.push(o))}return n}function lS(...e){return tr(e.flat())}function LF(e){let t=e.trim();return!t||t.startsWith("archived_")?t:`archived_${t}`}function fS(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID().replace(/-/g,"").slice(-8):Math.random().toString(16).slice(2,10).padEnd(8,"0").slice(0,8)}function OF(e){return(e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"tracer").slice(0,28)}function DF(e,t){let n=OF(e),r="";do r=`${n}-${fS()}`;while(t.includes(r));return r}function UF(e,t){let n=e.trim();if(!n)return"";if(/-[a-z0-9]{8}$/i.test(n))return n;let r=`${n}-${fS()}`;for(;t.includes(r);)r=`${n}-${fS()}`;return r}function zf(){let e=new URLSearchParams(window.location.search),t=[...e.getAll("tracers"),...e.getAll("tracer")],n=[];for(let r of t){let o=r.trim();if(!o)continue;let i=o.startsWith("[")&&o.endsWith("]")?o.slice(1,-1):o;n.push(...i.split(",").map(s=>s.trim().replace(/^["']|["']$/g,"")))}return tr(n)}function IR(){let e=new URLSearchParams(window.location.search);return(e.get("thread_id")||e.get("threadId")||e.get("chat_id")||e.get("chatId")||"").trim()}function Uf(e){let t=e.trim().replace(/\s+/g," ");return t?t.length>42?`${t.slice(0,42).trimEnd()}\u2026`:t:"New chat"}function wR(e,t){return e.map(n=>({id:n.id,templateId:n.templateId,title:n.title,createdAt:n.createdAt,updatedAt:n.updatedAt,lastMessageAt:n.lastMessageAt??null,messageCount:Math.max(n.messageCount??0,n.messages.length),tracers:n.tracers,hiddenFromView:n.hiddenFromView,messages:(n.id===t?n.messages.slice(-eF):[]).map(r=>({id:r.id,role:r.role,text:r.text,attachments:r.attachments.map(o=>({id:o.id,fileName:o.fileName,contentType:o.contentType,viewUrl:o.viewUrl})),toolExchanges:r.toolExchanges?.map(o=>({...o,args:ji(o.args),result:UR(o.result)})),httpExchanges:r.httpExchanges?.map(Cc)}))}))}function FF(e,t){if(!e)return[];try{let n=JSON.parse(e);return Array.isArray(n)?n.filter(r=>r&&typeof r.id=="string").map(r=>({id:r.id,templateId:typeof r.templateId=="string"&&r.templateId.trim()?r.templateId:t,title:typeof r.title=="string"&&r.title.trim()?r.title:"New chat",createdAt:typeof r.createdAt=="string"?r.createdAt:new Date().toISOString(),updatedAt:typeof r.updatedAt=="string"?r.updatedAt:new Date().toISOString(),lastMessageAt:typeof r.lastMessageAt=="string"?r.lastMessageAt:null,messageCount:Math.max(typeof r.messageCount=="number"?r.messageCount:0,Array.isArray(r.messages)?r.messages.length:0),tracers:tr(Array.isArray(r.tracers)?r.tracers.filter(o=>typeof o=="string"):[]),hiddenFromView:r.hiddenFromView===!0,messages:Array.isArray(r.messages)?r.messages.map(o=>({id:o.id,role:o.role,text:o.text,attachments:Array.isArray(o.attachments)?o.attachments:[],toolExchanges:Array.isArray(o.toolExchanges)?o.toolExchanges:[],httpExchanges:Array.isArray(o.httpExchanges)?o.httpExchanges:[]})):[]})):[]}catch{return[]}}function CR(e,t){return!e||typeof e.id!="string"?null:{id:e.id,templateId:typeof e.templateId=="string"&&e.templateId.trim()?e.templateId:t,title:typeof e.title=="string"&&e.title.trim()?e.title:"New chat",createdAt:typeof e.createdAt=="string"?e.createdAt:new Date().toISOString(),updatedAt:typeof e.updatedAt=="string"?e.updatedAt:new Date().toISOString(),lastMessageAt:typeof e.lastMessageAt=="string"?e.lastMessageAt:null,messageCount:Math.max(typeof e.messageCount=="number"?e.messageCount:0,Array.isArray(e.messages)?e.messages.length:0),tracers:tr(Array.isArray(e.tracers)?e.tracers.filter(n=>typeof n=="string"):[]),hiddenFromView:e.hiddenFromView===!0,messages:Array.isArray(e.messages)?e.messages.map(n=>({id:n.id,role:n.role,text:n.text,attachments:Array.isArray(n.attachments)?n.attachments:[],toolExchanges:Array.isArray(n.toolExchanges)?n.toolExchanges:[],httpExchanges:Array.isArray(n.httpExchanges)?n.httpExchanges:[]})):[]}}function RR(e,t){let n=new Map;for(let r of t){let o=e.find(i=>i.id===r.id);n.set(r.id,{...r,lastMessageAt:r.lastMessageAt??o?.lastMessageAt??null,messageCount:Math.max(r.messageCount??0,o?.messageCount??0,r.messages.length,o?.messages.length??0),messages:r.messages.length?r.messages:o?.messages??[]})}for(let r of e)n.has(r.id)||n.set(r.id,r);return[...n.values()].sort((r,o)=>Date.parse(o.updatedAt)-Date.parse(r.updatedAt))}function BF(e){return[...e].sort((t,n)=>Date.parse(n.updatedAt)-Date.parse(t.updatedAt))}function wc(e,t){return t.length?e.tracers.some(n=>t.some(r=>HF(n,r))):!0}function HF(e,t){let n=e.trim(),r=t.trim();return!n||!r?!1:n===r?!0:n.startsWith(`${r}-`)&&/-[a-z0-9]{8}$/i.test(n)}function $F(e){return(0,d.jsxs)("div",{className:"vf-editor-chat-attachment",children:[(0,d.jsx)("span",{className:"vf-editor-chat-attachment-name",children:e.attachment.fileName}),e.onRemove?(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-attachment-remove","aria-label":"Remove attachment",onClick:e.onRemove,children:"\xD7"}):null]})}function yS(){return(0,d.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("path",{d:"M10 3v9"}),(0,d.jsx)("path",{d:"m6.5 8.5 3.5 3.5 3.5-3.5"}),(0,d.jsx)("path",{d:"M4 16h12"})]})}function zF(){return(0,d.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("path",{d:"M4.2 15.8c1.6.5 3.1-.1 3.7-1.7.6-1.4 1.8-2.1 3.5-2.1"}),(0,d.jsx)("path",{d:"m10.7 11.6 5.2-5.2a1.9 1.9 0 0 0-2.7-2.7L8 8.9"}),(0,d.jsx)("path",{d:"m7.9 9 3.1 3.1"}),(0,d.jsx)("path",{d:"M3.5 16.5c1.4.5 3.6.5 4.9-.8"})]})}function SS(){return(0,d.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("path",{d:"M8.4 11.6a3.2 3.2 0 0 0 4.5 0l2.2-2.2a3.2 3.2 0 0 0-4.5-4.5L9.4 6.1"}),(0,d.jsx)("path",{d:"M11.6 8.4a3.2 3.2 0 0 0-4.5 0L4.9 10.6a3.2 3.2 0 0 0 4.5 4.5l1.2-1.2"})]})}function _S(){return(0,d.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("rect",{x:"7",y:"7",width:"9",height:"9",rx:"2"}),(0,d.jsx)("path",{d:"M5 12H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1"})]})}function Ff(e){return(0,d.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{transform:e.open?"rotate(90deg)":"rotate(0deg)"},children:(0,d.jsx)("path",{d:"m7 4 6 6-6 6"})})}function YR(e){let t=e.label.trim().replace(/[\\/:*?"<>|]+/g,"-");if(t)return t;try{return new URL(e.url,window.location.href).pathname.split("/").filter(Boolean).pop()||"media"}catch{return"media"}}function xR(e,t=!1){if(typeof window>"u"||e.kind!=="image"||!e.url)return"";let n=new URL("/inpaint",window.location.origin),r=window.__vidfarmEditorTracers,i=(r?.get()??zf())[0]||(t?r?.add()??"":"");return i&&n.searchParams.set("tracer",i),n.searchParams.set("source_image_url",e.url),n.searchParams.set("source_image_name",e.label||YR(e)),n.toString()}function jF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(""),{onClose:i}=e,s=e.gallery?.length?e.gallery:[e.preview],a=Math.max(0,s.findIndex(T=>T.url===e.preview.url)),[l,c]=(0,k.useState)(a),u=s[l]||e.preview,f=s.length>1,p=u.kind==="image",h=p&&xR(u,!1)||"/inpaint";(0,k.useEffect)(()=>{n(!0)},[]),(0,k.useEffect)(()=>{o("")},[u.url]);let y=async()=>{try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(u.url);else{let T=document.createElement("textarea");T.value=u.url,T.style.position="fixed",T.style.opacity="0",document.body.appendChild(T),T.focus(),T.select(),document.execCommand("copy"),document.body.removeChild(T)}o("done")}catch{o("error")}window.setTimeout(()=>o(""),1600)},_=T=>{let g=xR(u,!0);if(!g){T.preventDefault();return}T.preventDefault(),window.open(g,"_blank","noopener,noreferrer")};return(0,k.useEffect)(()=>{let T=g=>{if(g.key==="Escape"){i();return}f&&(g.key==="ArrowLeft"?(g.preventDefault(),c(S=>(S-1+s.length)%s.length)):g.key==="ArrowRight"&&(g.preventDefault(),c(S=>(S+1)%s.length)))};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[f,s.length,i]),t?(0,Wi.createPortal)((0,d.jsx)("div",{className:"vf-editor-chat-media-modal-backdrop",onClick:e.onClose,children:(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal",onClick:T=>T.stopPropagation(),children:[(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-header",children:[(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-link",href:u.url,target:"_blank",rel:"noopener noreferrer",children:f?`${u.label} (${l+1} of ${s.length})`:u.label}),(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-actions",children:[f?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:()=>c(T=>(T-1+s.length)%s.length),"aria-label":"Previous image",title:"Previous image",children:"\u2039"}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:()=>c(T=>(T+1)%s.length),"aria-label":"Next image",title:"Next image",children:"\u203A"})]}):null,p?(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:h,target:"_blank",rel:"noopener noreferrer",onClick:_,"aria-label":"Open image editor",title:"Image edit",children:(0,d.jsx)(zF,{})}):null,(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:u.url,download:YR(u),"aria-label":"Download media",title:"Download",children:(0,d.jsx)(yS,{})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control","data-state":r,onClick:()=>{y()},"aria-label":r==="done"?"Media URL copied":r==="error"?"Unable to copy media URL":"Copy media URL",title:r==="done"?"Copied":r==="error"?"Copy failed":"Copy link",children:(0,d.jsx)(SS,{})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:e.onClose,"aria-label":"Close media preview",title:"Close",children:"\xD7"})]})]}),(0,d.jsx)("div",{className:"vf-editor-chat-media-modal-body",children:u.kind==="image"?(0,d.jsx)("img",{src:u.url,alt:u.label,className:"vf-editor-chat-media-modal-image"}):(0,d.jsx)("video",{src:u.url,className:"vf-editor-chat-media-modal-video",controls:!0,autoPlay:!0,playsInline:!0})})]})}),document.body):null}function WF(e){let[t,n]=(0,k.useState)(!1);return(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-message-thumb-button is-image",onClick:()=>e.onOpenModal(e.preview,e.previews),"aria-label":`Preview ${e.preview.label}`,title:e.preview.label,"data-error":t?"true":"false",children:t?(0,d.jsx)("span",{className:"vf-editor-chat-message-thumb-fallback",children:"Preview unavailable"}):(0,d.jsx)("img",{src:e.preview.url,alt:e.preview.label,className:"vf-editor-chat-message-attachment-thumb",loading:"lazy",onError:()=>n(!0)})})}function bR(e){return(0,d.jsx)("div",{className:"vf-editor-chat-message-attachment-row",children:(0,d.jsxs)("button",{type:"button",className:"vf-editor-chat-message-thumb-button",onClick:()=>e.onOpenModal(e.preview),"aria-label":`Preview ${e.preview.label}`,children:[(0,d.jsx)("video",{src:e.preview.url,className:"vf-editor-chat-message-attachment-thumb vf-editor-chat-message-video-thumb",preload:"metadata",muted:!0,playsInline:!0}),(0,d.jsx)("span",{className:"vf-editor-chat-message-video-play","aria-hidden":"true"})]})})}function kR(e){return e.previews.length?(0,d.jsx)("div",{className:"vf-editor-chat-message-image-rail","aria-label":"Image previews",children:e.previews.map(t=>(0,d.jsx)(WF,{preview:t,previews:e.previews,onOpenModal:e.onOpenModal},t.url))}):null}function GF(e){return(0,d.jsxs)("div",{className:"vf-editor-chat-composer-attachment-item",children:[jf(e.attachment)?(0,d.jsx)("img",{src:e.attachment.viewUrl,alt:e.attachment.fileName,className:"vf-editor-chat-composer-attachment-thumb"}):(0,d.jsx)("div",{className:"vf-editor-chat-composer-attachment-file","aria-hidden":"true",children:e.attachment.fileName.slice(0,1).toUpperCase()}),(0,d.jsx)("div",{className:"vf-editor-chat-composer-attachment-meta",children:(0,d.jsx)("span",{className:"vf-editor-chat-composer-attachment-name",children:e.attachment.fileName})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-composer-attachment-remove","aria-label":`Remove ${e.attachment.fileName}`,onClick:e.onRemove,children:"\xD7"})]})}function VF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(!1),i=Bf(e.exchange.request.body),s=Bf(e.exchange.result.body),a=e.exchange.request.url,l=a.length>52?`${a.slice(0,52).trimEnd()}...`:a,c=e.exchange.result.status>=400||!!e.exchange.result.error,u=e.exchange.result.status>=200&&e.exchange.result.status<300;return(0,k.useEffect)(()=>{o(!0)},[]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"vf-editor-chat-http-card",children:(0,d.jsxs)("button",{type:"button",className:"vf-editor-chat-http-card-header",onClick:()=>n(!0),"aria-label":`Open HTTP details for ${e.exchange.request.method} ${a}`,children:[(0,d.jsx)("span",{className:"vf-editor-chat-http-pill",children:e.exchange.request.method}),(0,d.jsx)("span",{className:"vf-editor-chat-http-url",title:a,children:l}),(0,d.jsxs)("span",{className:"vf-editor-chat-http-status","data-error":c?"true":"false","data-success":u?"true":"false",children:[e.exchange.result.status,e.exchange.result.statusText?` ${e.exchange.result.statusText}`:""]}),(0,d.jsx)("span",{className:"vf-editor-chat-http-expand","aria-hidden":"true",children:"+"})]})}),r&&t?(0,Wi.createPortal)((0,d.jsx)("div",{className:"vf-editor-chat-http-modal-backdrop",onClick:()=>n(!1),children:(0,d.jsxs)("div",{className:"vf-editor-chat-http-modal",onClick:f=>f.stopPropagation(),children:[(0,d.jsxs)("div",{className:"vf-editor-chat-http-modal-header",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-http-modal-header-main",children:[(0,d.jsx)("span",{className:"vf-editor-chat-http-pill",children:e.exchange.request.method}),(0,d.jsx)("span",{className:"vf-editor-chat-http-modal-url",children:a}),(0,d.jsxs)("span",{className:"vf-editor-chat-http-status","data-error":c?"true":"false","data-success":u?"true":"false",children:[e.exchange.result.status,e.exchange.result.statusText?` ${e.exchange.result.statusText}`:""]})]}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-http-modal-close",onClick:()=>n(!1),"aria-label":"Close HTTP details",children:"\xD7"})]}),(0,d.jsxs)("div",{className:"vf-editor-chat-http-card-body is-modal",children:[e.exchange.explanation?(0,d.jsx)("div",{className:"vf-editor-chat-http-note",children:e.exchange.explanation}):null,(0,d.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,d.jsx)("div",{className:"vf-editor-chat-http-label",children:"URL"}),(0,d.jsx)("pre",{className:"vf-editor-chat-http-pre",children:a})]}),i?(0,d.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,d.jsx)("div",{className:"vf-editor-chat-http-label",children:"Request"}),(0,d.jsx)("pre",{className:"vf-editor-chat-http-pre",children:i})]}):null,(0,d.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,d.jsx)("div",{className:"vf-editor-chat-http-label",children:"Response"}),(0,d.jsx)("pre",{className:"vf-editor-chat-http-pre",children:e.exchange.result.error||s||"(empty)"})]}),Object.keys(e.exchange.result.headers).length?(0,d.jsxs)("div",{className:"vf-editor-chat-http-block",children:[(0,d.jsx)("div",{className:"vf-editor-chat-http-label",children:"Headers"}),(0,d.jsx)("pre",{className:"vf-editor-chat-http-pre",children:Bf(e.exchange.result.headers)})]}):null]})]})}),document.body):null]})}function NR(e){return typeof e=="string"?JSON.stringify(e):typeof e=="number"||typeof e=="boolean"?String(e):e===null?"null":JSON.stringify(e)}function vS(e){if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(e);let t=document.createElement("textarea");return t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select(),document.execCommand("copy"),document.body.removeChild(t),Promise.resolve()}function Dr(e){return(0,d.jsxs)("div",{className:"vf-editor-chat-json-line",style:{paddingLeft:`${e.depth*18+12}px`},children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-copy","aria-label":"Copy line",title:"Copy line",onClick:()=>e.onCopy(e.text),children:(0,d.jsx)(_S,{})}),(0,d.jsx)("span",{className:"vf-editor-chat-json-line-text",children:e.text})]})}function pS(e){let t=e.value,n=e.isLast?"":",";if(Array.isArray(t)){let r=e.path,o=e.collapsedPaths.has(r),i=`${e.linePrefix??""}[`;return t.length?o?(0,d.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(r),"aria-label":"Expand JSON block",children:(0,d.jsx)(Ff,{open:!1})}),(0,d.jsx)(Dr,{text:`${e.linePrefix??""}[ \u2026 ]${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(r),"aria-label":"Collapse JSON block",children:(0,d.jsx)(Ff,{open:!0})}),(0,d.jsx)(Dr,{text:i,depth:e.depth,onCopy:e.onCopy})]}),t.map((s,a)=>(0,d.jsx)(pS,{value:s,depth:e.depth+1,path:`${r}.${a}`,isLast:a===t.length-1,collapsedPaths:e.collapsedPaths,togglePath:e.togglePath,onCopy:e.onCopy},`${r}:${a}`)),(0,d.jsx)(Dr,{text:`]${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,d.jsx)(Dr,{text:`${e.linePrefix??""}[]${n}`,depth:e.depth,onCopy:e.onCopy})}if(t&&typeof t=="object"){let r=Object.entries(t),o=e.path,i=e.collapsedPaths.has(o),s=`${e.linePrefix??""}{`;return r.length?i?(0,d.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(o),"aria-label":"Expand JSON block",children:(0,d.jsx)(Ff,{open:!1})}),(0,d.jsx)(Dr,{text:`${e.linePrefix??""}{ \u2026 }${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-toggle-row",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-toggle-icon",onClick:()=>e.togglePath(o),"aria-label":"Collapse JSON block",children:(0,d.jsx)(Ff,{open:!0})}),(0,d.jsx)(Dr,{text:s,depth:e.depth,onCopy:e.onCopy})]}),r.map(([a,l],c)=>{let u=`${JSON.stringify(a)}: `;return l&&typeof l=="object"?(0,d.jsx)(pS,{value:l,depth:e.depth+1,linePrefix:u,path:`${o}.${a}`,isLast:c===r.length-1,collapsedPaths:e.collapsedPaths,togglePath:e.togglePath,onCopy:e.onCopy},`${o}:${a}`):(0,d.jsx)(Dr,{text:`${u}${NR(l)}${c===r.length-1?"":","}`,depth:e.depth+1,onCopy:e.onCopy},`${o}:${a}`)}),(0,d.jsx)(Dr,{text:`}${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,d.jsx)(Dr,{text:`${e.linePrefix??""}{}${n}`,depth:e.depth,onCopy:e.onCopy})}return(0,d.jsx)(Dr,{text:`${e.linePrefix??""}${NR(t)}${n}`,depth:e.depth,onCopy:e.onCopy})}function KR(e){let[t,n]=(0,k.useState)(new Set),[r,o]=(0,k.useState)(""),i=a=>{n(l=>{let c=new Set(l);return c.has(a)?c.delete(a):c.add(a),c})},s=async a=>{try{await vS(a),o("done")}catch{o("error")}window.setTimeout(()=>o(""),1400)};return(0,d.jsxs)("div",{className:"vf-editor-chat-json-viewer",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-toolbar",children:[(0,d.jsx)("span",{className:"vf-editor-chat-json-file",children:e.storageKey}),(0,d.jsx)("span",{className:"vf-editor-chat-json-copy-state","data-state":r,children:r==="done"?"Copied line":r==="error"?"Copy failed":"Hover a line to copy"})]}),(0,d.jsx)("div",{className:"vf-editor-chat-json-scroll",children:(0,d.jsx)(pS,{value:e.value,depth:0,path:"root",collapsedPaths:t,togglePath:i,onCopy:s})})]})}function qF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(""),i=$R(e.artifact.url,`${e.artifact.label}.json`),s=Bf(e.data);(0,k.useEffect)(()=>{n(!0)},[]);let a=async()=>{try{await vS(s),o("done")}catch{o("error")}window.setTimeout(()=>o(""),1600)};return(0,k.useEffect)(()=>{let l=c=>{c.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e]),t?(0,Wi.createPortal)((0,d.jsx)("div",{className:"vf-editor-chat-media-modal-backdrop",onClick:e.onClose,children:(0,d.jsxs)("div",{className:"vf-editor-chat-json-modal",onClick:l=>l.stopPropagation(),children:[(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-header",children:[(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-link",href:e.artifact.url,target:"_blank",rel:"noopener noreferrer",children:e.artifact.label}),(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-actions",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control","data-state":r,onClick:()=>{a()},title:r==="done"?"Copied":r==="error"?"Copy failed":"Copy JSON","aria-label":r==="done"?"JSON copied":r==="error"?"Unable to copy JSON":"Copy JSON",children:(0,d.jsx)(_S,{})}),(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:e.artifact.url,download:i,title:"Download JSON","aria-label":"Download JSON",children:(0,d.jsx)(yS,{})}),(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:e.artifact.url,target:"_blank",rel:"noopener noreferrer",title:"Open raw JSON","aria-label":"Open raw JSON",children:(0,d.jsx)(SS,{})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:e.onClose,"aria-label":"Close JSON preview",title:"Close",children:"\xD7"})]})]}),(0,d.jsx)("div",{className:"vf-editor-chat-json-modal-body",children:(0,d.jsx)(KR,{value:e.data,storageKey:e.artifact.label})})]})}),document.body):null}function YF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(!1),[i,s]=(0,k.useState)(null),[a,l]=(0,k.useState)(null),[c,u]=(0,k.useState)(!1),f=async()=>{if(!(i!==null||c)){u(!0),l(null);try{let _=await(await fetch(e.artifact.url,{credentials:"omit"})).json();s(_)}catch(y){l(y instanceof Error?y.message:"Unable to load JSON artifact.")}finally{u(!1)}}},p=()=>{let y=!t;n(y),y&&f()},h=()=>{f(),o(!0)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-card",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-card-head",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"vf-editor-chat-json-card-kicker",children:"JSON result"}),(0,d.jsx)("div",{className:"vf-editor-chat-json-card-title",children:e.artifact.label})]}),(0,d.jsxs)("div",{className:"vf-editor-chat-json-card-actions",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action",onClick:p,children:t?"Hide preview":"Preview JSON"}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action is-strong",onClick:h,children:"Open"})]})]}),t?(0,d.jsx)("div",{className:"vf-editor-chat-json-card-body",children:c?(0,d.jsx)("div",{className:"vf-editor-chat-json-state",children:"Loading JSON\u2026"}):a?(0,d.jsx)("div",{className:"vf-editor-chat-json-state is-error",children:a}):i!==null?(0,d.jsx)(KR,{value:i,storageKey:e.artifact.label}):null}):null]}),r&&i!==null?(0,d.jsx)(qF,{artifact:e.artifact,data:i,onClose:()=>o(!1)}):null]})}function JR(e){return e.format==="markdown"?(0,d.jsx)("div",{className:"vf-editor-chat-doc-markdown",dangerouslySetInnerHTML:{__html:BR(e.text)}}):(0,d.jsx)("pre",{className:"vf-editor-chat-doc-pre",children:e.text})}function KF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(""),i=e.artifact.format==="markdown"?".md":".txt",s=$R(e.artifact.url,`${e.artifact.label}${i}`);(0,k.useEffect)(()=>{n(!0)},[]);let a=async()=>{try{await vS(e.text),o("done")}catch{o("error")}window.setTimeout(()=>o(""),1600)};return(0,k.useEffect)(()=>{let l=c=>{c.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e]),t?(0,Wi.createPortal)((0,d.jsx)("div",{className:"vf-editor-chat-media-modal-backdrop",onClick:e.onClose,children:(0,d.jsxs)("div",{className:"vf-editor-chat-json-modal",onClick:l=>l.stopPropagation(),children:[(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-header",children:[(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-link",href:e.artifact.url,target:"_blank",rel:"noopener noreferrer",children:e.artifact.label}),(0,d.jsxs)("div",{className:"vf-editor-chat-media-modal-actions",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control","data-state":r,onClick:()=>{a()},title:r==="done"?"Copied":r==="error"?"Copy failed":e.artifact.format==="markdown"?"Copy markdown":"Copy text","aria-label":r==="done"?"Document copied":r==="error"?"Unable to copy document":e.artifact.format==="markdown"?"Copy markdown":"Copy text",children:(0,d.jsx)(_S,{})}),(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:e.artifact.url,download:s,title:e.artifact.format==="markdown"?"Download markdown":"Download text","aria-label":e.artifact.format==="markdown"?"Download markdown":"Download text",children:(0,d.jsx)(yS,{})}),(0,d.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:e.artifact.url,target:"_blank",rel:"noopener noreferrer",title:"Open raw file","aria-label":"Open raw file",children:(0,d.jsx)(SS,{})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-media-modal-control",onClick:e.onClose,"aria-label":"Close document preview",title:"Close",children:"\xD7"})]})]}),(0,d.jsx)("div",{className:"vf-editor-chat-json-modal-body",children:(0,d.jsx)("div",{className:"vf-editor-chat-doc-viewer",children:(0,d.jsx)(JR,{text:e.text,format:e.artifact.format})})})]})}),document.body):null}function JF(e){let[t,n]=(0,k.useState)(!1),[r,o]=(0,k.useState)(!1),[i,s]=(0,k.useState)(null),[a,l]=(0,k.useState)(null),[c,u]=(0,k.useState)(!1),f=async()=>{if(!(i!==null||c)){u(!0),l(null);try{let _=await(await fetch(e.artifact.url,{credentials:"omit"})).text();s(_)}catch(y){l(y instanceof Error?y.message:"Unable to load document artifact.")}finally{u(!1)}}},p=()=>{let y=!t;n(y),y&&f()},h=()=>{f(),o(!0)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-card",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-json-card-head",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"vf-editor-chat-json-card-kicker",children:e.artifact.format==="markdown"?"Markdown result":"Text result"}),(0,d.jsx)("div",{className:"vf-editor-chat-json-card-title",children:e.artifact.label})]}),(0,d.jsxs)("div",{className:"vf-editor-chat-json-card-actions",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action",onClick:p,children:t?"Hide preview":"Preview"}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-json-card-action is-strong",onClick:h,children:"Open"})]})]}),t?(0,d.jsx)("div",{className:"vf-editor-chat-json-card-body",children:c?(0,d.jsx)("div",{className:"vf-editor-chat-json-state",children:"Loading document\u2026"}):a?(0,d.jsx)("div",{className:"vf-editor-chat-json-state is-error",children:a}):i!==null?(0,d.jsx)("div",{className:"vf-editor-chat-doc-viewer is-inline",children:(0,d.jsx)(JR,{text:i,format:e.artifact.format})}):null}):null]}),r&&i!==null?(0,d.jsx)(KF,{artifact:e.artifact,text:i,onClose:()=>o(!1)}):null]})}var XF=(0,k.memo)(function(t){let n=t.message.role==="assistant",r=t.message.text.trim().length>0,o=r?BR(t.message.text):"",[i,s]=(0,k.useState)(null),a=t.message.attachments.filter(jf),l=t.message.attachments.filter(uS),c=t.message.attachments.filter(_=>!jf(_)&&!uS(_)),u=r?aF(t.message.text,t.message.attachments.map(_=>_.viewUrl)):[],f=u.filter(_=>_.kind==="image"),p=u.filter(_=>_.kind==="video"),h=(t.message.httpExchanges??[]).flatMap(_=>{let T=$i(_.result.body);return T?jR(T):[]}).filter((_,T,g)=>g.findIndex(S=>S.url===_.url)===T),y=(t.message.httpExchanges??[]).flatMap(_=>{let T=$i(_.result.body);return T?WR(T):[]}).filter((_,T,g)=>g.findIndex(S=>S.url===_.url)===T);return(0,d.jsxs)("div",{className:`vf-editor-chat-message ${n?"is-assistant":"is-user"}`,children:[(0,d.jsx)("div",{className:"vf-editor-chat-message-meta",children:n?"Copilot":"You"}),(0,d.jsxs)("div",{className:"vf-editor-chat-bubble","data-pending":t.message.isPending?"true":"false",children:[t.message.attachments.length?(0,d.jsxs)("div",{className:"vf-editor-chat-message-attachments",children:[c.map(_=>(0,d.jsx)("div",{className:"vf-editor-chat-message-attachment-row",children:(0,d.jsx)("a",{className:"vf-editor-chat-message-preview-link",href:_.viewUrl,target:"_blank",rel:"noopener noreferrer",children:(0,d.jsx)($F,{attachment:_})})},_.id)),(0,d.jsx)(kR,{previews:a.map(_=>({kind:"image",url:_.viewUrl,label:_.fileName})),onOpenModal:(_,T)=>s({preview:_,gallery:T})}),l.map(_=>(0,d.jsx)(bR,{preview:{kind:"video",url:_.viewUrl,label:_.fileName},onOpenModal:T=>s({preview:T,gallery:[T]})},_.id))]}):null,t.message.statusText?(0,d.jsxs)("div",{className:"vf-editor-chat-message-status","aria-live":"polite",children:[(0,d.jsx)("span",{className:"vf-editor-chat-status-dot"}),t.message.statusText]}):null,t.message.httpExchanges?.length?(0,d.jsx)("div",{className:"vf-editor-chat-http-list",children:t.message.httpExchanges.map((_,T)=>(0,d.jsx)(VF,{exchange:_},`${_.request.method}:${_.request.url}:${T}`))}):null,r?(0,d.jsx)("div",{className:"vf-editor-chat-message-body",dangerouslySetInnerHTML:{__html:o}}):t.message.isPending?(0,d.jsxs)("div",{className:"vf-editor-chat-message-loading","aria-hidden":"true",children:[(0,d.jsx)("span",{}),(0,d.jsx)("span",{}),(0,d.jsx)("span",{})]}):null,u.length?(0,d.jsxs)("div",{className:"vf-editor-chat-message-attachments",children:[(0,d.jsx)(kR,{previews:f,onOpenModal:(_,T)=>s({preview:_,gallery:T})}),p.map(_=>(0,d.jsx)(bR,{preview:_,onOpenModal:T=>s({preview:T,gallery:[T]})},_.url))]}):null,h.length?(0,d.jsx)("div",{className:"vf-editor-chat-json-list",children:h.map(_=>(0,d.jsx)(YF,{artifact:_},_.key))}):null,y.length?(0,d.jsx)("div",{className:"vf-editor-chat-json-list",children:y.map(_=>(0,d.jsx)(JF,{artifact:_},_.key))}):null]}),i?(0,d.jsx)(jF,{preview:i.preview,gallery:i.gallery,onClose:()=>s(null)}):null]})});function AR(e){if(!e||e<=0)return"Unknown size";let t=["B","KB","MB","GB"],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function MR(e){return jf(e.file)?(0,d.jsx)("img",{className:"vf-editor-upload-file-thumb",src:e.file.viewUrl,alt:e.file.fileName}):uS(e.file)?(0,d.jsx)("video",{className:"vf-editor-upload-file-thumb",src:e.file.viewUrl,muted:!0,playsInline:!0}):(0,d.jsx)("div",{className:"vf-editor-upload-file-icon","aria-hidden":"true",children:e.file.fileName.slice(0,1).toUpperCase()})}function mo(e){return e.split("/").map(t=>t.trim()).filter(Boolean).join("/")}function Gf(e,t){return mo([e,t].filter(Boolean).join("/"))}function PR(e){let t=mo(e).split("/").filter(Boolean);return t.pop(),t.join("/")}function LR(e){return mo(e).split("/").filter(Boolean).at(-1)||"All files"}function QF(e){let t=mo(e.currentFolder),n=t?`${t}/`:"",r=new Map;for(let o of e.folders){let i=mo(o);if(!i||t&&i===t||!i.startsWith(n))continue;let a=i.slice(n.length).split("/")[0];a&&r.set(a,Gf(t,a))}for(let o of e.files){let i=mo(o.folderPath??"");if(!i||t&&i===t||!i.startsWith(n))continue;let a=i.slice(n.length).split("/")[0];a&&r.set(a,Gf(t,a))}return Array.from(r.entries()).map(([o,i])=>({name:o,path:i})).sort((o,i)=>o.name.localeCompare(i.name))}function cS(e){return e.name==="share"?(0,d.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("path",{d:"M14 4h6v6"}),(0,d.jsx)("path",{d:"M10 14 20 4"}),(0,d.jsx)("path",{d:"M20 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4"})]}):e.name==="link"?(0,d.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("path",{d:"M10 13a5 5 0 0 0 7.07 0l2.12-2.12a5 5 0 0 0-7.07-7.07L11 4.93"}),(0,d.jsx)("path",{d:"M14 11a5 5 0 0 0-7.07 0L4.81 13.12a5 5 0 0 0 7.07 7.07L13 19.07"})]}):(0,d.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("path",{d:"M3 6h18"}),(0,d.jsx)("path",{d:"M8 6V4h8v2"}),(0,d.jsx)("path",{d:"M19 6 18 20H6L5 6"}),(0,d.jsx)("path",{d:"M10 11v5"}),(0,d.jsx)("path",{d:"M14 11v5"})]})}function ZF(e){let[t,n]=(0,k.useState)("my-files"),[r,o]=(0,k.useState)([]),[i,s]=(0,k.useState)([]),[a,l]=(0,k.useState)([]),[c,u]=(0,k.useState)(()=>new Set),[f,p]=(0,k.useState)([]),[h,y]=(0,k.useState)([]),[_,T]=(0,k.useState)(()=>new Set),[g,S]=(0,k.useState)(null),[E,R]=(0,k.useState)(!1),[M,A]=(0,k.useState)(""),[I,N]=(0,k.useState)(null),[U,x]=(0,k.useState)(null),[H,j]=(0,k.useState)(null),[ge,X]=(0,k.useState)(null),[Ze,fe]=(0,k.useState)(null),de=(0,k.useRef)(null),D=(0,k.useRef)(null),ye=(0,k.useMemo)(()=>{let P=f.map(ie=>({...ie,recentSource:"generated"}));return[...h.map(ie=>({...ie,recentSource:"temporary"})),...P].sort((ie,Y)=>{let Ie=ie.createdAt?Date.parse(ie.createdAt):0;return(Y.createdAt?Date.parse(Y.createdAt):0)-Ie})},[f,h]),Q=t==="upload"?r:t==="my-files"?i.filter(P=>c.has(P.id)):t==="recents"?ye.filter(P=>_.has(P.id)):[];async function ae(){let P=await TF(e.apiKey);s(P.attachments),l(P.folders)}async function Re(P){R(!0);try{let[V,ie]=P?[await ER(e.apiKey,P),null]:await Promise.all([ER(e.apiKey),IF(e.apiKey)]);p(Y=>P?[...Y,...V.media]:V.media),ie&&y(ie.files),S(V.nextCursor),P||T(new Set)}finally{R(!1)}}(0,k.useEffect)(()=>{e.open&&(X(null),j(null),ae().catch(P=>X(P instanceof Error?P.message:"Unable to load My Files.")),Re().catch(P=>X(P instanceof Error?P.message:"Unable to load recent media.")))},[e.open]);function Te(){o([]),u(new Set),T(new Set),j(null),X(null),N(null),x(null),e.onClose()}async function St(P){try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(P);else{let V=document.createElement("textarea");V.value=P,V.style.position="fixed",V.style.opacity="0",document.body.appendChild(V),V.focus(),V.select(),document.execCommand("copy"),document.body.removeChild(V)}j("File URL copied.")}catch{X("Unable to copy file URL.")}}async function ot(P,V){if(!P.length)return;X(null);let ie=[];for(let Y of P)try{if(j(`Uploading ${Y.name}...`),V==="upload"){let dt=await qR({apiKey:e.apiKey,file:Y,folderPath:DR}),J=await VR({attachment:dt,file:Y,currentInlineBytes:GR([...r,...ie])});ie.push(J);continue}let Ie=await EF({apiKey:e.apiKey,file:Y,folderPath:M,maxBytes:OR,limitLabel:"50 MB"});ie.push(Ie)}catch(Ie){X(Ie instanceof Error?Ie.message:"Upload failed.")}V==="upload"?(o(Y=>[...Y,...ie]),await Re().catch(Y=>X(Y instanceof Error?Y.message:"Unable to refresh recent files."))):V==="my-files"&&(await ae(),u(Y=>new Set([...Y,...ie.map(Ie=>Ie.id)]))),ie.length&&j(`${ie.length} file${ie.length===1?"":"s"} uploaded.`)}async function bt(P,V){let ie=V==="my-files"?`/api/v1/user/me/attachments/${encodeURIComponent(P.id)}`:`/api/v1/user/me/temporary-files/${encodeURIComponent(P.id)}`,Y=await fetch(ie,{method:"DELETE",headers:ut(e.apiKey,"application/json")}),Ie=await Y.json().catch(()=>({}));if(!Y.ok)throw new Error(Ie.error||"Unable to delete file.");V==="my-files"&&(s(dt=>dt.filter(J=>J.id!==P.id)),u(dt=>{let J=new Set(dt);return J.delete(P.id),J})),fe(null),j("File deleted.")}async function it(P){if(P!=="my-files"||!U||U.mode!=="create")return;let V=Gf(U.baseFolder,U.value);if(!V){X("Choose a folder name.");return}let ie=await fetch("/api/v1/user/me/attachments/folders",{method:"POST",headers:ut(e.apiKey,"application/json"),body:JSON.stringify({folder_path:V})}),Y=await ie.json().catch(()=>({}));if(!ie.ok){X(Y.error||"Unable to create folder.");return}l(Ie=>Array.from(new Set([...Ie,V])).sort()),x(null),j("Folder created.")}async function In(P,V){if(P!=="my-files"||!U||U.mode!=="rename")return;let ie=U.value.trim(),Y=Gf(PR(V),ie);if(!Y||Y===V)return;let Ie=await fetch("/api/v1/user/me/attachments/folders",{method:"PATCH",headers:ut(e.apiKey,"application/json"),body:JSON.stringify({from_folder_path:V,to_folder_path:Y})}),dt=await Ie.json().catch(()=>({}));if(!Ie.ok){X(dt.error||"Unable to rename folder.");return}A(J=>J===V||J.startsWith(`${V}/`)?`${Y}${J.slice(V.length)}`:J),await ae(),N(null),x(null),j("Folder renamed.")}async function Dt(P,V){if(P!=="my-files")return;let ie=await fetch("/api/v1/user/me/attachments/folders",{method:"DELETE",headers:ut(e.apiKey,"application/json"),body:JSON.stringify({folder_path:V})}),Y=await ie.json().catch(()=>({}));if(!ie.ok){X(Y.error||"Unable to delete folder.");return}A(Ie=>Ie===V||Ie.startsWith(`${V}/`)?PR(V):Ie),await ae(),N(null),x(null),j("Folder deleted.")}function wn(P){let V=a,ie=i,Y=M,Ie=A,dt=QF({folders:V,files:ie,currentFolder:Y}),J=mo(Y).split("/").filter(Boolean);return(0,d.jsxs)("div",{className:"vf-editor-upload-browser",children:[(0,d.jsxs)("div",{className:"vf-editor-upload-browser-toolbar",children:[(0,d.jsxs)("div",{className:"vf-editor-upload-breadcrumb","aria-label":"Current folder",children:[(0,d.jsx)("button",{type:"button","data-current":!Y,onClick:()=>Ie(""),children:"files"}),J.map(($e,he)=>{let Je=J.slice(0,he+1).join("/");return(0,d.jsxs)("span",{className:"vf-editor-upload-breadcrumb-segment",children:[(0,d.jsx)("span",{"aria-hidden":"true",children:"/"}),(0,d.jsx)("button",{type:"button","data-current":Je===Y,onClick:()=>Ie(Je),children:$e})]},Je)})]}),(0,d.jsx)("button",{type:"button",onClick:()=>x({mode:"create",scope:"my-files",baseFolder:Y,value:""}),children:"New folder"})]}),dt.length?(0,d.jsx)("div",{className:"vf-editor-upload-folder-grid",children:dt.map($e=>(0,d.jsxs)("article",{className:"vf-editor-upload-folder-row",children:[(0,d.jsxs)("button",{type:"button",className:"vf-editor-upload-folder-open",onClick:()=>Ie($e.path),children:[(0,d.jsx)("span",{className:"vf-editor-upload-folder-icon","aria-hidden":"true"}),(0,d.jsx)("span",{children:$e.name})]}),(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-folder-menu-button","aria-label":`Folder actions for ${$e.name}`,onClick:()=>N(I===$e.path?null:$e.path),children:"..."}),I===$e.path?(0,d.jsxs)("div",{className:"vf-editor-upload-folder-menu",children:[(0,d.jsx)("button",{type:"button",onClick:()=>x({mode:"rename",scope:"my-files",folderPath:$e.path,value:LR($e.path)}),children:"Rename"}),(0,d.jsx)("button",{type:"button","data-danger":"true",onClick:()=>x({mode:"delete",scope:"my-files",folderPath:$e.path,value:""}),children:"Delete"})]}):null]},$e.path))}):null]})}function nr(P,V){let ie=V==="my-files"?c.has(P.id):V==="recents"?_.has(P.id):!1,Y="s3Url"in P&&P.s3Url?P.s3Url:P.viewUrl;return(0,d.jsxs)("article",{className:"vf-editor-upload-file-card","data-selected":ie?"true":"false",children:[(0,d.jsxs)("button",{type:"button",className:"vf-editor-upload-file-select",onClick:()=>{if(V==="temporary"){St(Y);return}(V==="recents"?T:u)(dt=>{let J=new Set(dt);return J.has(P.id)?J.delete(P.id):J.add(P.id),J})},children:[(0,d.jsx)(MR,{file:P}),(0,d.jsxs)("span",{className:"vf-editor-upload-file-main",children:[(0,d.jsx)("span",{className:"vf-editor-upload-file-name",children:P.fileName}),(0,d.jsxs)("span",{className:"vf-editor-upload-file-meta",children:[AR(P.sizeBytes),P.folderPath?` \xB7 ${P.folderPath}`:""]})]})]}),(0,d.jsxs)("div",{className:"vf-editor-upload-file-actions",children:[V==="my-files"||V==="recents"?(0,d.jsx)("span",{className:"vf-editor-upload-selection-indicator","data-selected":ie?"true":"false","aria-hidden":"true",children:ie?"\u2713":""}):null,(0,d.jsx)("a",{href:P.viewUrl,target:"_blank",rel:"noreferrer","aria-label":`View ${P.fileName}`,children:(0,d.jsx)(cS,{name:"share"})}),(0,d.jsx)("button",{type:"button","aria-label":`Copy URL for ${P.fileName}`,onClick:()=>{St(Y)},children:(0,d.jsx)(cS,{name:"link"})}),V==="recents"?null:(0,d.jsx)("button",{type:"button","aria-label":`Delete ${P.fileName}`,onClick:()=>fe(Ze===P.id?null:P.id),children:(0,d.jsx)(cS,{name:"trash"})})]}),V!=="recents"&&Ze===P.id?(0,d.jsxs)("div",{className:"vf-editor-upload-popconfirm",children:[(0,d.jsx)("span",{children:"Delete this file?"}),(0,d.jsx)("button",{type:"button",onClick:()=>fe(null),children:"Cancel"}),(0,d.jsx)("button",{type:"button","data-danger":"true",onClick:()=>{bt(P,V)},children:"Delete"})]}):null]},P.id)}function Vi(){if(!U)return null;let P=U.mode==="create"?"New folder":U.mode==="rename"?"Rename folder":"Delete folder",V=U.mode==="delete"?U.folderPath:"";return(0,d.jsxs)("div",{className:"vf-editor-upload-folder-dialog",role:"dialog","aria-label":P,children:[(0,d.jsx)("div",{className:"vf-editor-upload-folder-dialog-title",children:P}),U.mode==="delete"?(0,d.jsxs)("div",{className:"vf-editor-upload-folder-dialog-copy",children:["Delete ",(0,d.jsx)("strong",{children:V})," and all files inside it?"]}):(0,d.jsx)("input",{value:U.value,autoFocus:!0,placeholder:"folder-name",onChange:ie=>x({...U,value:ie.target.value}),onKeyDown:ie=>{ie.key==="Enter"&&(ie.preventDefault(),U.mode==="create"?it(U.scope):In(U.scope,U.folderPath))}}),(0,d.jsxs)("div",{className:"vf-editor-upload-folder-dialog-actions",children:[(0,d.jsx)("button",{type:"button",onClick:()=>x(null),children:"Cancel"}),U.mode==="create"?(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",onClick:()=>{it(U.scope)},children:"Create"}):U.mode==="rename"?(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",onClick:()=>{In(U.scope,U.folderPath)},children:"Rename"}):(0,d.jsx)("button",{type:"button","data-danger":"true",onClick:()=>{Dt(U.scope,U.folderPath)},children:"Delete"})]})]})}if(!e.open)return null;let Zo=i.filter(P=>mo(P.folderPath??"")===mo(M));return(0,Wi.createPortal)((0,d.jsx)("div",{className:"vf-editor-upload-drawer-backdrop",children:(0,d.jsxs)("aside",{className:"vf-editor-upload-drawer","aria-label":"Upload drawer",children:[(0,d.jsxs)("div",{className:"vf-editor-upload-header",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"vf-editor-upload-title",children:"Upload"}),(0,d.jsx)("div",{className:"vf-editor-upload-subtitle",children:"Upload, attach, and copy file URLs."})]}),(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-close","aria-label":"Close upload drawer",onClick:Te,children:"\xD7"})]}),(0,d.jsxs)("div",{className:"vf-editor-upload-tabs",role:"tablist",children:[(0,d.jsx)("button",{type:"button","data-active":t==="upload",onClick:()=>n("upload"),children:"Upload file"}),(0,d.jsx)("button",{type:"button","data-active":t==="my-files",onClick:()=>n("my-files"),children:"My Files"}),(0,d.jsx)("button",{type:"button","data-active":t==="recents",onClick:()=>n("recents"),children:"Recents"})]}),(0,d.jsxs)("div",{className:"vf-editor-upload-body",children:[ge?(0,d.jsx)("div",{className:"vf-editor-upload-status","data-tone":"error",children:ge}):null,H?(0,d.jsx)("div",{className:"vf-editor-upload-status",children:H}):null,Vi(),t==="upload"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{type:"button",className:"vf-editor-upload-drop",onClick:()=>de.current?.click(),children:["Upload files to chat",(0,d.jsx)("span",{children:"Stored in Recents and attached after Confirm. Images get compressed inline previews when possible; other files attach by URL. Max 100 MB each."})]}),(0,d.jsx)("input",{ref:de,type:"file",multiple:!0,hidden:!0,onChange:P=>{ot(Array.from(P.target.files??[]),"upload"),P.target.value=""}}),(0,d.jsx)("div",{className:"vf-editor-upload-list",children:r.map(P=>(0,d.jsxs)("article",{className:"vf-editor-upload-file-card","data-selected":"true",children:[(0,d.jsx)(MR,{file:P}),(0,d.jsxs)("span",{className:"vf-editor-upload-file-main",children:[(0,d.jsx)("span",{className:"vf-editor-upload-file-name",children:P.fileName}),(0,d.jsx)("span",{className:"vf-editor-upload-file-meta",children:AR(P.sizeBytes)})]}),(0,d.jsx)("button",{type:"button",onClick:()=>o(V=>V.filter(ie=>ie.id!==P.id)),children:"\xD7"})]},P.id))})]}):t==="my-files"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{type:"button",className:"vf-editor-upload-drop",onClick:()=>D.current?.click(),children:["Add to My Files",(0,d.jsxs)("span",{children:["Uploads into ",LR(M)," and auto-selects. Max 50 MB each."]})]}),(0,d.jsx)("input",{ref:D,type:"file",multiple:!0,hidden:!0,onChange:P=>{ot(Array.from(P.target.files??[]),"my-files"),P.target.value=""}}),wn("my-files"),(0,d.jsx)("div",{className:"vf-editor-upload-list",children:Zo.length?Zo.map(P=>nr(P,"my-files")):(0,d.jsx)("div",{className:"vf-editor-upload-empty",children:"No files in this folder."})})]}):t==="recents"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"vf-editor-upload-list",children:ye.length?ye.map(P=>nr(P,"recents")):(0,d.jsx)("div",{className:"vf-editor-upload-empty",children:E?"Loading recent files...":"No recent files yet."})}),g?(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-more",disabled:E,onClick:()=>{Re(g).catch(P=>X(P instanceof Error?P.message:"Unable to load more recent media."))},children:E?"Loading...":"Load more generated media"}):null]}):null]}),(0,d.jsxs)("div",{className:"vf-editor-upload-footer",children:[(0,d.jsx)("button",{type:"button",onClick:Te,children:"Cancel"}),(0,d.jsxs)("div",{className:"vf-editor-upload-footer-confirm",children:[(0,d.jsxs)("span",{children:[Q.length," file",Q.length===1?"":"s"," selected"]}),(0,d.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",disabled:!Q.length,onClick:()=>{e.onConfirm(Q),Te()},children:"Confirm"})]})]})]})}),document.body)}function XR({boot:e}){let t=e.template.templateId==="chat-brainstorm",n=t&&e.template.persistentHistorySidebar===!0,r=(0,k.useMemo)(()=>MF(e.template.templateId),[e.template.templateId]),o=(0,k.useMemo)(()=>PF(),[]),i=(0,k.useRef)(null),s=(0,k.useRef)(null),a=(0,k.useRef)(!0),l=(0,k.useRef)(!1),c=(0,k.useRef)(null),u=(0,k.useRef)(null),f=(0,k.useRef)(new Map),p=(0,k.useRef)({nextAvailableAt:0}),h=(0,k.useRef)([]),y=(0,k.useRef)(new Set),[_,T]=(0,k.useState)([]),[g,S]=(0,k.useState)(null),[E,R]=(0,k.useState)(null),[M,A]=(0,k.useState)(null),[I,N]=(0,k.useState)(""),[U,x]=(0,k.useState)([]),[H,j]=(0,k.useState)(null),[ge,X]=(0,k.useState)(null),[Ze,fe]=(0,k.useState)(null),[de,D]=(0,k.useState)(!1),[ye,Q]=(0,k.useState)(!1),[ae,Re]=(0,k.useState)(!1),[Te,St]=(0,k.useState)(!1),[ot,bt]=(0,k.useState)(!1),[it,In]=(0,k.useState)(!1),[Dt,wn]=(0,k.useState)(null),[nr,Vi]=(0,k.useState)(!1),[Zo,P]=(0,k.useState)(null),[V,ie]=(0,k.useState)(!1),[Y,Ie]=(0,k.useState)(()=>{let m=typeof window<"u"?window.__vidfarmEditorTracers:null;if(m)return m.get();if(typeof window<"u"){let v=zf();if(v.length)return v}return tr(e.template.tracers||[])}),dt=(0,k.useMemo)(()=>{if(!e.threadsUrl)return null;let m=new URL(e.threadsUrl,window.location.origin);return t||m.searchParams.set("template_id",e.template.templateId),m.searchParams.set("include_messages","false"),m.searchParams.set("limit",t?"200":"50"),m.toString()},[e.template.templateId,e.threadsUrl,t]),J=m=>e.threadsUrl?new URL(`${e.threadsUrl.replace(/\/$/,"")}/${encodeURIComponent(m)}`,window.location.origin).toString():null;(0,k.useEffect)(()=>{let m=FF(o?.getItem(r.threads)??null,e.template.templateId),v=o?.getItem(r.activeThread)??null,w=IR(),b=window.__vidfarmEditorTracers?.get()??zf(),F=w&&!m.some(le=>le.id===w)?[{id:w,templateId:e.template.templateId,title:"Loading chat",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),lastMessageAt:null,messageCount:0,tracers:b,hiddenFromView:!1,messages:[]},...m]:m,K=F.filter(le=>!le.hiddenFromView),z=K.find(le=>wc(le,b));h.current=F,T(F),w&&K.some(le=>le.id===w)?S(w):v&&K.some(le=>le.id===v)&&(!b.length||K.some(le=>le.id===v&&wc(le,b)))?S(v):S(z?.id??K[0]?.id??null),D(!0)},[e.template.templateId,o,r]),(0,k.useEffect)(()=>{if(!e.vidfarmApiKey||!dt)return;let m=new AbortController;return(async()=>{try{let v=[],w=null,b=new Set;do{let F=new URL(dt);w&&F.searchParams.set("cursor",w);let K=await fetch(F.toString(),{method:"GET",headers:ut(e.vidfarmApiKey),signal:m.signal});if(!K.ok)return;let z=await K.json().catch(()=>null);Array.isArray(z?.threads)&&v.push(...z.threads.map(pe=>CR(pe,e.template.templateId)).filter(pe=>!!pe));let le=typeof z?.next_cursor=="string"&&z.next_cursor?z.next_cursor:null;!le||b.has(le)?w=null:(b.add(le),w=le)}while(w&&!m.signal.aborted);if(!v.length)return;T(F=>{let K=RR(F,v);return h.current=K,K}),S(F=>F&&h.current.some(K=>K.id===F)?F:v[0]?.id??F)}catch(v){if(v instanceof DOMException&&v.name==="AbortError")return}})(),()=>{m.abort()}},[e.template.templateId,e.vidfarmApiKey,dt]),(0,k.useEffect)(()=>{h.current=_},[_]);let[$e,he]=(0,k.useState)(()=>{if(typeof window>"u")return null;try{return new URL(window.location.href).searchParams.get("fork")}catch{return null}});(0,k.useEffect)(()=>{let m=()=>{try{he(new URL(window.location.href).searchParams.get("fork"))}catch{he(null)}};return window.addEventListener("popstate",m),()=>{window.removeEventListener("popstate",m)}},[]);async function Je(m){if(!e.vidfarmApiKey){P("Sign in to see forks.");return}if(!nr&&!(!m?.force&&Dt!==null)){Vi(!0),P(null);try{let v=await fetch("/api/v1/compositions",{method:"GET",headers:ut(e.vidfarmApiKey)});if(!v.ok){P(v.status===401?"Sign in to see forks.":`Failed to load forks (${v.status}).`),wn([]);return}let w=await v.json().catch(()=>null),F=(Array.isArray(w?.forks)?w.forks:[]).map(K=>{if(!K||typeof K!="object")return null;let z=K,le=typeof z.fork_id=="string"?z.fork_id:null;return le?{forkId:le,templateId:typeof z.template_id=="string"?z.template_id:null,parentForkId:typeof z.parent_fork_id=="string"?z.parent_fork_id:null,parentVersion:typeof z.parent_version=="number"?z.parent_version:null,title:typeof z.title=="string"?z.title:null,visibility:typeof z.visibility=="string"?z.visibility:null,latestVersion:typeof z.latest_version=="number"?z.latest_version:null,ownerCustomerId:typeof z.owner_customer_id=="string"?z.owner_customer_id:null,createdAt:typeof z.created_at=="string"?z.created_at:null,updatedAt:typeof z.updated_at=="string"?z.updated_at:null}:null}).filter(K=>!!K).filter(K=>K.templateId===e.template.templateId).sort((K,z)=>String(z.updatedAt??"").localeCompare(String(K.updatedAt??"")));wn(F)}catch{P("Could not load forks. Please try again."),wn([])}finally{Vi(!1)}}}(0,k.useEffect)(()=>{it&&Dt===null&&!nr&&Je()},[it]),(0,k.useEffect)(()=>{let m=window.__vidfarmEditorTracers;if(m)return Ie(m.get()),m.subscribe(w=>Ie(w));let v=()=>{let w=zf();Ie(w.length?w:tr(e.template.tracers||[]))};return v(),window.addEventListener("popstate",v),()=>{window.removeEventListener("popstate",v)}},[e.template.tracers]);let Se=(0,k.useRef)(_),Ur=(0,k.useRef)(g);(0,k.useEffect)(()=>{Se.current=_,Ur.current=g},[_,g]),(0,k.useEffect)(()=>{if(!de)return;let m=window.setTimeout(()=>{try{o?.setItem(r.threads,JSON.stringify(wR(Se.current,Ur.current)))}catch(v){console.warn("Unable to persist editor chat threads.",v)}},300);return()=>window.clearTimeout(m)},[g,o,de,r,_]),(0,k.useEffect)(()=>{if(de)try{g?o?.setItem(r.activeThread,g):o?.removeItem(r.activeThread)}catch(m){console.warn("Unable to persist active editor chat thread.",m)}},[g,o,de,r]),(0,k.useEffect)(()=>{if(!de||typeof window>"u")return;let m=new URL(window.location.href),v=m.searchParams.get("thread_id");if(g){if(v===g)return;m.searchParams.set("thread_id",g)}else{if(!v)return;m.searchParams.delete("thread_id")}window.history.replaceState({},"",m.toString())},[g,de]);let Jt=(0,k.useMemo)(()=>_.find(m=>m.id===g)??null,[g,_]),qi=(0,k.useMemo)(()=>_.find(m=>m.id===M?.threadId)??null,[M?.threadId,_]);(0,k.useEffect)(()=>{if(!de||!e.vidfarmApiKey||!g)return;let m=h.current.find(z=>z.id===g);if(y.current.has(g))return;let v=IR();if(!!(m&&(m.messageCount??0)===0&&m.messages.length===0)){y.current.add(g);return}let b=J(g);if(!b)return;let F=new AbortController;return!m?.messages.length&&R(g),(async()=>{try{let z=await fetch(b,{method:"GET",headers:ut(e.vidfarmApiKey),signal:F.signal});if(!z.ok){let ce=!!(m&&g!==v),ue=!!(m&&(m.messageCount??0)===0&&m.messages.length===0);z.status===404&&!ce&&!ue&&j(`Chat ID ${g} was not found for this account.`),y.current.add(g);return}let le=await z.json().catch(()=>null),pe=le?.thread?CR(le.thread,e.template.templateId):null;if(!pe)return;y.current.add(pe.id),j(null),T(ce=>{let ue=RR(ce,[pe]);return h.current=ue,ue})}catch(z){if(z instanceof DOMException&&z.name==="AbortError")return}finally{F.signal.aborted||R(z=>z===g?null:z)}})(),()=>{F.abort(),R(z=>z===g?null:z)}},[g,e.vidfarmApiKey,e.threadsUrl,de]),(0,k.useEffect)(()=>{if(!de||Jt&&!Jt.hiddenFromView)return;let m=_.find(v=>!v.hiddenFromView&&wc(v,Y));S(m?.id??_.find(v=>!v.hiddenFromView)?.id??null)},[Jt,de,_,Y]);let Kf=(0,k.useMemo)(()=>Jt?.tracers.length?Jt.tracers:Y,[Jt?.tracers,Y]),Jf=(0,k.useMemo)(()=>_.filter(m=>!m.hiddenFromView).sort((m,v)=>{let w=wc(m,Y),b=wc(v,Y);return w!==b?w?-1:1:Date.parse(v.updatedAt)-Date.parse(m.updatedAt)}),[_,Y]),IS=Kf[0]??null,Xf=Jt?.messages??[],wS=ge!==null,Qf=!!(g&&ge===g),CS=(0,k.useMemo)(()=>(I.trim()||U.length)&&!wS,[I,U.length,wS]);(0,k.useEffect)(()=>{!de||!e.vidfarmApiKey||!Jt||!Jt.messages.length||Sx(Jt)},[Jt,e.vidfarmApiKey,de]);async function Rc(m,v){if(!e.vidfarmApiKey||!e.threadsUrl||!m.messages.length)return;let w=J(m.id);w&&await fetch(w,{method:"PATCH",headers:ut(e.vidfarmApiKey,"application/json"),body:JSON.stringify({template_id:e.template.templateId,title:v?.title??m.title,tracers:v?.tracers??m.tracers,hidden_from_view:v?.hiddenFromView??m.hiddenFromView===!0,archived:v?.archived})}).catch(()=>{})}async function tx(m){if(!e.vidfarmApiKey||!e.threadsUrl||!m.messages.length)return;let v=J(m.threadId);v&&await fetch(`${v}/exchanges`,{method:"POST",headers:ut(e.vidfarmApiKey,"application/json"),body:JSON.stringify({template_id:m.templateId??e.template.templateId,title:m.title||"New chat",tracers:m.tracers,messages:m.messages.map(w=>({id:w.id,role:w.role,text:w.text,attachments:w.attachments.map(b=>({id:b.id,fileName:b.fileName,contentType:b.contentType,viewUrl:b.viewUrl})),toolExchanges:w.toolExchanges,httpExchanges:w.httpExchanges?.map(Cc)}))})}).catch(()=>{})}async function nx(m){if(!e.vidfarmApiKey||!e.threadsUrl)return;let v=J(m);v&&await fetch(v,{method:"DELETE",headers:ut(e.vidfarmApiKey)}).catch(()=>{})}function RS(m){let v=new URL(window.location.href);m.length?v.searchParams.set("tracers",m.join(",")):v.searchParams.delete("tracers"),window.history.replaceState({},"",v.toString()),window.dispatchEvent(new CustomEvent("vidfarm:editor-tracers-changed",{detail:{tracers:m}}))}function ma(m){let v=tr(m),w=window.__vidfarmEditorTracers;if(w){w.set(v);return}Ie(v),RS(v)}function xS(){let m=window.__vidfarmEditorTracers;if(m)return m.add();let v=DF(e.template.templateSlug,Y);return ma([v,...Y]),v}function bS(m){let v=window.__vidfarmEditorTracers?.get()??Y,w=m?UF(m,v):null,b=window.__vidfarmEditorTracers;return b?b.add(w??void 0):w?(ma([w,...v.filter(F=>F!==w)]),w):xS()}function rx(m){let v=m.trim();if(!v)return;let w=window.__vidfarmEditorTracers;w?w.add(v):Y.includes(v)||ma([v,...Y]),Jt&&ft(Jt.id,b=>({...b,tracers:[v,...b.tracers.filter(F=>F!==v)],updatedAt:new Date().toISOString()}))}function ox(m){let v=window.__vidfarmEditorTracers;if(v){v.remove(m);return}let w=Y.filter(b=>b!==m);ma(w)}(0,k.useEffect)(()=>{RS(Y)},[Y]),(0,k.useEffect)(()=>{let m=s.current;if(!m)return;let v=()=>{a.current=fF(m),a.current||(l.current=!1)};return v(),m.addEventListener("scroll",v,{passive:!0}),()=>{m.removeEventListener("scroll",v)}},[]),(0,k.useLayoutEffect)(()=>{let m=s.current;if(!m)return;let v=c.current!==g;c.current=g,(v||l.current||a.current)&&(m.scrollTo({top:m.scrollHeight,behavior:"auto"}),a.current=!0,l.current=!1)},[Xf,g]),(0,k.useEffect)(()=>()=>{u.current?.abortController.abort(),u.current=null;for(let m of f.current.values())m.timeoutId!==null&&window.clearTimeout(m.timeoutId),m.abortController?.abort();f.current.clear()},[]),(0,k.useEffect)(()=>{if(!M)return;let m=()=>A(null);return document.addEventListener("click",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),()=>{document.removeEventListener("click",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0)}},[M]),(0,k.useEffect)(()=>{let m=()=>{if(document.visibilityState!=="visible"||!navigator.onLine)return;let v=Date.now();for(let w of f.current.values())w.inFlight||w.nextPollAt!==null&&w.nextPollAt<=v&&w.runPoll&&ep(w,w.runPoll,w.nextPollAt-v)};return window.addEventListener("online",m),document.addEventListener("visibilitychange",m),()=>{window.removeEventListener("online",m),document.removeEventListener("visibilitychange",m)}},[]);function ix(m){if(Jt)return Jt.id;let v=new Date().toISOString(),w=TR(),b={id:w,templateId:e.template.templateId,title:Uf(m||""),createdAt:v,updatedAt:v,lastMessageAt:null,messageCount:0,tracers:tr(Y),messages:[]};return h.current=[b,...h.current],T(F=>[b,...F]),S(w),w}function Zf(m){let v=new Date().toISOString(),w=tr(m?.tracers??Y),b=TR(),F={id:b,templateId:e.template.templateId,title:m?.title||"New chat",createdAt:v,updatedAt:v,lastMessageAt:null,messageCount:0,tracers:w,messages:[]};return h.current=[F,...h.current],T(K=>[F,...K]),m?.activate!==!1&&(S(b),N(""),x([]),j(null)),A(null),b}function kS(){Zf(),bt(!1)}function sx(m){let v=_.find(b=>b.id===m);if(!v||!window.confirm(`Delete conversation "${v.title}"?`))return;let w=_.filter(b=>b.id!==m);h.current=h.current.filter(b=>b.id!==m);for(let[b,F]of f.current.entries())F.threadId===m&&ha(b);T(w),g===m&&S(w[0]?.id??null),j(null),A(null),nx(m)}function ft(m,v){let w=BF(h.current.map(b=>b.id===m?v(b):b));h.current=w,T(w)}function ax(m,v){let w=tr(v);ft(m,F=>({...F,tracers:lS(F.tracers,w),updatedAt:new Date().toISOString()}));let b=h.current.find(F=>F.id===m);b&&Rc({...b,tracers:lS(b.tracers,w),updatedAt:new Date().toISOString()},{tracers:lS(b.tracers,w)})}function NS(m,v){let w=m.trim();return w?h.current.find(b=>!b.hiddenFromView&&b.id!==v&&b.tracers.includes(w))?.id??null:null}function lx(m,v){let w=NS(m);return w||Zf({tracers:[m],title:v?.title||`Tracer ${m}`,activate:v?.activate??!1})}function cx(m){let v=m.toLowerCase();return/(?:own|separate|different|new)\s+(?:tracer\s+and\s+)?chat\s+threads?/.test(v)||/chat\s+threads?.{0,80}(?:own|separate|different|new)\s+tracers?/.test(v)||/each.{0,80}(?:own|separate|different|new).{0,80}chat\s+threads?/.test(v)||/(?:own|separate|different|new)\s+tracers?/.test(v)||/(?:each|every|per|one\s+per).{0,80}(?:own|separate|different|new).{0,80}tracers?/.test(v)||/(?:own|separate|different|new)\s+tracers?.{0,80}(?:each|every|per|outputs?|pieces?|posts?|jobs?|generations?)/.test(v)||/(?:outputs?|pieces?|posts?|jobs?|generations?).{0,80}(?:own|separate|different|new)\s+tracers?/.test(v)}function ux(m){let v=NS(m.tracer,m.sourceThreadId);if(!v&&!m.shouldCreateThread)return null;let w=v??lx(m.tracer,{title:`Tracer ${m.tracer}`,activate:!1});if(!w||w===m.sourceThreadId)return null;let b=$f("assistant"),F=new Date().toISOString(),K=m.job.status==="succeeded"||m.job.status==="failed"||m.job.status==="cancelled"?Df(m.job):mR(m.job),z=m.job.status==="succeeded"||m.job.status==="failed"||m.job.status==="cancelled"?null:`Job ${m.job.job_id} is being tracked. ${tp()}`,le={id:b,role:"assistant",text:K,attachments:[],httpExchanges:m.httpExchange?[m.httpExchange]:[],statusText:z,isPending:!1};ft(w,ce=>({...ce,updatedAt:F,messages:[...ce.messages,le]}));let pe=h.current.find(ce=>ce.id===w);return pe&&tx({threadId:w,templateId:pe.templateId,title:pe.title,tracers:pe.tracers,messages:[le]}),{threadId:w,messageId:b}}function dx(m){let v=_.find(F=>F.id===m);if(!v)return;let w=window.prompt("Thread tracers, comma separated",v.tracers.join(", "));if(w===null)return;let b=tr(w.split(","));ft(m,F=>({...F,tracers:b,updatedAt:new Date().toISOString()})),Rc(v,{tracers:b}),A(null)}function fx(m){let v=_.find(F=>F.id===m);if(!v||!window.confirm(`Archive conversation "${v.title}"? Its tracer links will be prefixed with archived_.`))return;let b=tr(v.tracers.map(LF));ft(m,F=>({...F,tracers:b,updatedAt:new Date().toISOString()})),Rc(v,{tracers:b,archived:!0}),A(null)}function px(m){let v=_.find(b=>b.id===m);if(!(!v||!window.confirm(`Remove conversation "${v.title}" from this frontend view? The thread and tracer links stay available; Delete removes the thread completely.`))){for(let[b,F]of f.current.entries())F.threadId===m&&ha(b);if(ft(m,b=>({...b,hiddenFromView:!0,updatedAt:new Date().toISOString()})),g===m){let b=Jf.find(F=>F.id!==m);S(b?.id??null)}A(null),j(null),Rc(v,{hiddenFromView:!0})}}async function mx(m){try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(m);else{let v=document.createElement("textarea");v.value=m,v.setAttribute("readonly",""),v.style.position="fixed",v.style.opacity="0",document.body.appendChild(v),v.select(),document.execCommand("copy"),document.body.removeChild(v)}j(null)}catch{j("Unable to copy chat ID.")}finally{A(null)}}function hx(m,v){if(M?.threadId===m){A(null);return}let w=v.getBoundingClientRect(),b=148;A({threadId:m,top:w.bottom+6,left:Math.max(8,Math.min(window.innerWidth-b-8,w.right-b))})}function ha(m){let v=f.current.get(m);v&&(v.timeoutId!==null&&window.clearTimeout(v.timeoutId),v.abortController?.abort(),f.current.delete(m))}function ga(m,v,w){let b=f.current.get(m);b&&ep(b,v,w)}function ep(m,v,w){m.timeoutId!==null&&window.clearTimeout(m.timeoutId);let b=Math.max(SR,w);m.nextPollAt=Date.now()+b,m.timeoutId=window.setTimeout(()=>{m.timeoutId=null,v()},b)}function Yi(){return f.current.size>=gR?mF:hR}function Ki(m=Yi()){if(m>=6e4){let v=Math.round(m/6e4);return`${v} min${v===1?"":"s"}`}return`${Math.round(m/1e3)}s`}function tp(m=Yi()){return f.current.size>=gR?`Many renders are active, so the next check is in ${Ki(m)}.`:`Checking again gently every ${Ki(m)}.`}function gx(){let m=Yi();if(m===hR)return;let v=Date.now();for(let w of f.current.values()){if(w.inFlight||!w.runPoll)continue;(w.nextPollAt===null?0:w.nextPollAt-v)<m&&ep(w,w.runPoll,m)}}function yx(m){let v=Math.max(m,p.current.nextAvailableAt);return p.current.nextAvailableAt=v+hF,v-m}function np(m){let v=_R(m.threadId,m.assistantMessageId,m.jobId);if(f.current.has(v))return;f.current.set(v,{timeoutId:null,abortController:null,runPoll:null,inFlight:!1,nextPollAt:null,lastPollAt:null,attempts:0,threadId:m.threadId});let w=async()=>{let K=f.current.get(v);if(!K||K.inFlight)return;let z=Date.now(),le=Yi();if(K.lastPollAt!==null&&z-K.lastPollAt<le){ga(v,w,le-(z-K.lastPollAt));return}if(K.attempts>=yR){ft(m.threadId,ce=>({...ce,updatedAt:new Date().toISOString(),messages:ce.messages.map(ue=>ue.id===m.assistantMessageId?{...ue,statusText:"Background polling stopped after multiple checks. Open the job route when you want to refresh again."}:ue)})),ha(v);return}if(document.visibilityState!=="visible"||!navigator.onLine){ga(v,w,le);return}let pe=yx(Date.now());if(pe>0){ga(v,w,pe);return}K.inFlight=!0,K.lastPollAt=z,K.nextPollAt=null,K.attempts+=1,K.abortController=new AbortController;try{ft(m.threadId,Fe=>({...Fe,updatedAt:new Date().toISOString(),messages:Fe.messages.map(Z=>Z.id===m.assistantMessageId?{...Z,statusText:`Job ${m.jobId} is being tracked. ${tp(le)}`}:Z)}));let ce=m.primitiveId||gF(m.sourceRequestUrl)?`/api/v1/primitives/jobs/${encodeURIComponent(m.jobId)}`:`/api/v1/templates/${encodeURIComponent(e.template.templateId)}/jobs/${encodeURIComponent(m.jobId)}`,ue=await fetch(ce,{method:"GET",headers:ut(e.vidfarmApiKey),signal:K.abortController.signal}),cn=await ue.json().catch(()=>null),ya=Object.fromEntries(ue.headers.entries()),W=$i(cn);if(ft(m.threadId,Fe=>({...Fe,updatedAt:new Date().toISOString(),messages:Fe.messages.map(Z=>{if(Z.id!==m.assistantMessageId)return Z;let ve=pF(Z.httpExchanges,Cc({explanation:`Automatic ${Ki(le)} job status check for ${m.jobId}`,pollJobId:m.jobId,pollMode:"automatic",request:{method:"GET",url:ce,headers:Object.fromEntries(ut(e.vidfarmApiKey).entries())},result:{status:ue.status,statusText:ue.statusText,headers:ya,body:cn}})),ke=W?W.status==="succeeded"?`Render ${W.job_id} succeeded.`:W.status==="failed"||W.status==="cancelled"?`Render ${W.job_id} ${W.status}.${W.error?.message?` ${W.error.message}`:""}`:`Render ${W.job_id} is ${W.status}. Next check in ${Ki(le)}.`:`Render ${m.jobId} checked. Next check in ${Ki(le)}.`;return{...Z,httpExchanges:ve,statusText:ke,text:W&&(W.status==="succeeded"||W.status==="failed"||W.status==="cancelled")?Ic(Z.text,Df(W)):Z.text}})})),W&&(W.status==="succeeded"||W.status==="failed"||W.status==="cancelled")){ha(v);return}}catch(ce){if(ce instanceof DOMException&&ce.name==="AbortError")return;ft(m.threadId,ue=>({...ue,updatedAt:new Date().toISOString(),messages:ue.messages.map(cn=>cn.id===m.assistantMessageId?{...cn,statusText:`Automatic polling paused after an error. It will retry in ${Ki()}.`}:cn)}))}finally{let ce=f.current.get(v);if(!ce)return;ce.inFlight=!1,ce.abortController=null,ce.attempts<yR&&ce.timeoutId===null&&f.current.has(v)&&ga(v,w,Yi())}},b=f.current.get(v);b&&(b.runPoll=w),f.current.get(v)&&(ga(v,w,m.initialDelayMs??Yi()),gx())}function Sx(m){for(let v of m.messages)if(!(v.role!=="assistant"||!v.httpExchanges?.length))for(let w of v.httpExchanges){if(w.request.method!=="POST")continue;let b=$i(w.result.body),F=_R(m.id,v.id,b?.job_id??"");!b||fa(b.status)||f.current.has(F)||v.httpExchanges.some(z=>{let le=$i(z.result.body);return le?.job_id===b.job_id&&fa(le.status)})||np({threadId:m.id,assistantMessageId:v.id,jobId:b.job_id,tracer:b.tracer,initialStatus:b.status,primitiveId:b.primitive_id,sourceRequestUrl:w.request.url,initialDelayMs:SR})}}async function rp(m){if(!m.length)return;j(null);let v=[],w=null;for(let b of m)try{let F=await qR({apiKey:e.vidfarmApiKey,file:b,folderPath:DR}),K=await VR({attachment:F,file:b,currentInlineBytes:GR([...U,...v])});v.push(K)}catch(F){w=F instanceof Error?F.message:"Unable to upload attachment."}w&&v.length===0&&j(w),v.length&&(x(b=>[...b,...v]),w&&j(w))}async function _x(m){let v=Array.from(m.target.files??[]);await rp(v),m.target.value=""}async function vx(m){let v=Array.from(m.clipboardData.files??[]).filter(w=>w.size>0);v.length&&(m.preventDefault(),await rp(v))}async function Ex(m){m.preventDefault(),Q(!1);let v=Array.from(m.dataTransfer.files??[]).filter(w=>w.size>0);v.length&&await rp(v)}async function Tx(m,v,w){let b=w??{},F=e.vidfarmApiKey,K=window.location.origin,z=ut(F,"application/json"),le=ut(F),pe=Z=>new Promise(ve=>setTimeout(ve,Z)),ce=(Z,ve)=>{ft(m,ke=>({...ke,updatedAt:new Date().toISOString(),messages:ke.messages.map(Ne=>Ne.id===v?{...Ne,isPending:!1,statusText:Z??Ne.statusText,text:ve?Ic(Ne.text,ve):Ne.text}:Ne)}))},ue=async Z=>{let ve=await Z.text();try{return ve?JSON.parse(ve):null}catch{return null}},cn=async Z=>{let ve=Date.now()+3e5;for(;;){let ke=await fetch(new URL(`/api/v1/videos/${encodeURIComponent(Z)}`,K),{headers:le}),Ne=await ue(ke),Be=String(Ne?.status??"");if(Be==="ready")return Ne;if(Be==="failed")throw new Error(`source video download failed${Ne?.error?`: ${Ne.error}`:""}.`);if(Date.now()>ve)throw new Error("source video download timed out.");await pe(5e3)}},ya=Z=>{let ve=Ee=>typeof Ee=="string"&&Ee.trim()?Ee.trim():null,ke=Z?.result&&typeof Z.result=="object"?Z.result:{},Ne=ke.output&&typeof ke.output=="object"?ke.output:ke,Be=ve(Ne?.primary_file_url)??ve(Ne?.video?.file_url)??ve(Ne?.image?.file_url)??ve(Ne?.render?.output_url);if(Be)return Be;if(Array.isArray(Ne?.files))for(let Ee of Ne.files){let Le=ve(typeof Ee=="string"?Ee:Ee?.file_url??Ee?.url);if(Le)return Le}if(Array.isArray(Z?.artifacts))for(let Ee of Z.artifacts){let Le=ve(Ee?.public_url);if(Le)return Le}return null},W=async Z=>{let ve=Date.now()+48e4;for(;;){await pe(5e3);let ke=await fetch(new URL(`/api/v1/user/me/jobs/${encodeURIComponent(Z)}`,K),{headers:le}),Ne=await ue(ke),Be=String(Ne?.status??""),Ee=ya(Ne);if(Ee)return Ee;if(Be==="failed"||Be==="cancelled")throw new Error(`generation ${Be}.`);if(Date.now()>ve)throw new Error("generation timed out.")}},Fe=async(Z,ve)=>{let ke=await(await fetch(Z)).blob(),Ne=await fetch(new URL("/discover/templates/upload/presign",K),{method:"POST",headers:z,body:JSON.stringify({file_name:"generated.mp4",content_type:"video/mp4",size_bytes:ke.size})}),Be=await ue(Ne);if(!Ne.ok)throw new Error(Be?.error||`upload presign failed (${Ne.status})`);let Ee=Be?.storage_key,Le=Be?.file_name||"generated.mp4";if(Be?.transport==="presigned"&&Be?.upload?.url){let Oe=await fetch(Be.upload.url,{method:Be.upload.method||"PUT",headers:Be.upload.headers||{},body:ke});if(!Oe.ok)throw new Error(`upload failed (${Oe.status})`)}else{let Oe=new FormData;Oe.append("file",ke,"generated.mp4");let Xt=await fetch(new URL(Be?.upload?.url||"/discover/templates/upload",K),{method:"POST",headers:le,body:Oe}),_t=await ue(Xt);if(!Xt.ok||!_t?.storage_key)throw new Error(_t?.error||`upload failed (${Xt.status})`);Ee=_t.storage_key,Le=_t.file_name||"generated.mp4"}if(!Ee)throw new Error("upload did not return a storage key.");let ho=await fetch(new URL("/discover/templates",K),{method:"POST",headers:z,body:JSON.stringify({upload:{storage_key:Ee,file_name:Le},title:ve,origin:"raw"})}),Ut=await ue(ho);if(!ho.ok)throw new Error(Ut?.error||`ingest failed (${ho.status})`);return Ut};try{if(!F){ce(null,"\u26A0\uFE0F You need to be logged in to create a video.");return}let Z=b.mode==="replicate"?"replicate":b.mode==="generate"?"generate":null,ve,ke;if(Z==="replicate"){let Xt=(b.source_url??"").trim();if(!/^https?:\/\//i.test(Xt)){ce(null,"\u26A0\uFE0F I need a video URL (TikTok/YouTube/Instagram/X) to replicate.");return}ke=(b.instructions??"").trim()||null,ce("Fetching the source video\u2026");let _t=await fetch(new URL("/discover/templates",K),{method:"POST",headers:z,body:JSON.stringify({source_url:Xt})}),Fr=await ue(_t);if(!_t.ok)throw new Error(Fr?.error||`couldn't fetch that URL (${_t.status})`);ve=Fr?.status==="ready"?Fr:await cn(Fr?.inspiration_id)}else if(Z==="generate"){let Xt=(b.prompt??"").trim();if(!Xt){ce(null,"\u26A0\uFE0F Tell me what the video should be about and I'll create it.");return}ke=Xt,ce("Generating your video\u2026 (this can take a couple of minutes)");let _t=await fetch(new URL("/api/v1/primitives/videos/generate",K),{method:"POST",headers:z,body:JSON.stringify({tracer:`chat-create-${Date.now().toString(36)}`,payload:{prompt:Xt}})}),Fr=await ue(_t);if(!_t.ok)throw new Error(Fr?.error||`couldn't start generation (${_t.status})`);let Cx=await W(Fr?.job_id);ce("Building an editable template from the generated video\u2026");let op=await Fe(Cx,Xt.slice(0,80));ve=op?.status==="ready"?op:await cn(op?.inspiration_id)}else{ce(null,"\u26A0\uFE0F I couldn't tell whether to generate a new video or replicate a URL \u2014 try rephrasing.");return}let Ne=ve?.template_id,Be=ve?.inspiration_id;if(!Ne||!Be)throw new Error("the template wasn't created from the video.");ce(Z==="replicate"?"Recreating the scenes\u2026 (about a minute)":"Analyzing into an editable timeline\u2026");let Ee=await fetch(new URL(`/api/v1/inspirations/${encodeURIComponent(Be)}/decompose`,K),{method:"POST",headers:z,body:JSON.stringify({user_prompt:ke})});if(!Ee.ok){let Xt=await ue(Ee);throw new Error(Xt?.error||`scene analysis failed (${Ee.status})`)}ce("Finalizing your editable copy\u2026");let Le=await fetch(new URL("/api/v1/compositions",K),{method:"POST",headers:z,body:JSON.stringify({template_id:Ne})}),ho=await ue(Le);if(!Le.ok)throw new Error(ho?.error||`couldn't create an editable copy (${Le.status})`);let Ut=ho?.fork_id,Oe=`${K}/editor/${encodeURIComponent(Ne)}${Ut?`?fork=${encodeURIComponent(Ut)}`:""}`;ce("Your video is ready.",`\u2705 Your video is ready \u2014 [Open it in the editor](${Oe}).`)}catch(Z){ce(null,`\u26A0\uFE0F I couldn't finish creating the video: ${Z instanceof Error?Z.message:String(Z)}`)}}async function AS(){if(!CS)return;l.current=!0;let m=ix(I),v=new Date().toISOString(),w=h.current.find(pe=>pe.id===m),b={id:$f("user"),role:"user",text:I.trim(),attachments:U},F={id:$f("assistant"),role:"assistant",text:"",attachments:[],statusText:"Waiting for AI response\u2026",isPending:!0},K=w?.messages??[],z=RF([...K,b]);ft(m,pe=>({...pe,title:pe.messages.length===0?Uf(b.text):pe.title,updatedAt:v,messages:[...pe.messages,b,F]})),N(""),x([]),j(null),X(m),fe("Waiting for AI response\u2026");let le=new AbortController;u.current={abortController:le,threadId:m,assistantMessageId:F.id};try{let pe=JSON.stringify({messages:bF(z),thread_id:m,thread_template_id:w?.templateId??e.template.templateId,thread_title:K.length===0?Uf(b.text):w?.title??Uf(b.text),thread_tracers:Kf,client_context:tF(),user_message:{id:b.id,role:b.role,text:b.text,attachments:b.attachments.map(W=>({id:W.id,fileName:W.fileName,contentType:W.contentType,viewUrl:W.viewUrl}))},assistant_message:{id:F.id},template:{...e.template,tracers:Kf,defaultRequestTracer:IS,activeTracer:IS},cached_context:{...e.cachedContext,...kF(),...NF()}});Or("chat.send.attempt",{thread_id:m,template_id:e.template.templateId,message_count:z.length,attachment_count:b.attachments.length,text_length:b.text.length});let ce=Date.now(),ue=await fetch(e.apiUrl||"/api/v1/editor-chat",{method:"POST",headers:ut(e.vidfarmApiKey,"application/json"),signal:le.signal,body:pe});if(!ue.ok){let W=await ue.json().catch(()=>({}));throw po("chat.send.rejected",{thread_id:m,status:ue.status,error:typeof W?.error=="string"?W.error:null}),new Error(typeof W?.error=="string"?W.error:`Chat failed with status ${ue.status}.`)}Or("chat.send.stream_open",{thread_id:m,latency_ms:Date.now()-ce});let cn=new Map,ya=cx(b.text);await AF(ue,{onDelta:W=>{fe("AI is responding\u2026"),ft(m,Fe=>({...Fe,updatedAt:new Date().toISOString(),messages:Fe.messages.map(Z=>Z.id===F.id?{...Z,text:`${Z.text}${W}`,statusText:"AI is responding\u2026",isPending:!1}:Z)}))},onStatus:W=>{fe(W),ft(m,Fe=>({...Fe,messages:Fe.messages.map(Z=>Z.id===F.id?{...Z,statusText:W,isPending:!Z.text}:Z)}))},onToolCall:W=>{cn.set(W.toolCallId,{toolName:W.toolName,args:W.args}),ft(m,Fe=>({...Fe,updatedAt:new Date().toISOString(),messages:Fe.messages.map(Z=>Z.id===F.id?{...Z,toolExchanges:[...Z.toolExchanges??[],{toolCallId:W.toolCallId,toolName:W.toolName,args:ji(W.args),status:"pending"}]}:Z)}))},onToolResult:W=>{let Fe=UR(W.result),Z=cn.get(W.toolCallId);if(W.toolName==="create_video"&&Tx(m,F.id,W.result),W.toolName==="frontend_action"){let Ee=W.result;if(Ee?.action==="add_tracer")bS(Ee.tracer??void 0);else if(Ee?.action==="remove_tracer"&&Ee.tracer)ox(Ee.tracer);else if(Ee?.action==="activate_tracer"&&Ee.tracer)rx(Ee.tracer);else if(Ee?.action==="create_thread"){let Le=Ee.tracer?bS(Ee.tracer):xS();Zf({tracers:Le?[Le]:[],title:Le?`Tracer ${Le}`:"New chat",activate:!1})}}let ve=W.result,ke=$i(ve?.response?.body),Ne=ve?.request&&ve?.response?Cc({explanation:ve.explanation??null,request:ve.request,result:ve.response}):void 0,Be=ve?.request?.method==="POST"&&ke?.tracer?ux({sourceThreadId:m,tracer:ke.tracer,job:ke,httpExchange:Ne,shouldCreateThread:ya}):null;Be&&ke&&!fa(ke.status)&&np({threadId:Be.threadId,assistantMessageId:Be.messageId,jobId:ke.job_id,tracer:ke.tracer,initialStatus:ke.status,primitiveId:ke.primitive_id,sourceRequestUrl:ve?.request?.url}),ft(m,Ee=>({...Ee,updatedAt:new Date().toISOString(),messages:Ee.messages.map(Le=>{if(Le.id!==F.id)return Le;let ho=(Le.toolExchanges??[]).map(_t=>_t.toolCallId===W.toolCallId?{..._t,result:Fe,status:typeof W.result?.error=="string"?"error":"complete"}:_t),Ut=W.result,Oe=$i(Ut?.response?.body),Xt=Ut?.request&&Ut?.response?[...Le.httpExchanges??[],Cc({explanation:Ut.explanation??null,request:Ut.request,result:Ut.response})]:Le.httpExchanges;if(Z&&cn.delete(W.toolCallId),Ut?.request?.method==="POST"&&Oe?.tracer){let _t=window.__vidfarmEditorTracers;_t?_t.add(Oe.tracer):ma([Oe.tracer,...Y.filter(Fr=>Fr!==Oe.tracer)]),ax(m,[Oe.tracer])}return Oe&&!Be&&!fa(Oe.status)&&np({threadId:m,assistantMessageId:F.id,jobId:Oe.job_id,tracer:Oe.tracer,initialStatus:Oe.status,primitiveId:Oe.primitive_id,sourceRequestUrl:Ut?.request?.url}),{...Le,toolExchanges:ho,httpExchanges:Xt,statusText:Oe&&!fa(Oe.status)?`Job ${Oe.job_id} is being tracked. ${tp()}`:Le.statusText,isPending:!1,text:Oe&&Ut?.request?.method==="POST"&&Ut?.response?.status===202?Ic(Le.text,mR(Oe)):Oe&&fa(Oe.status)||Oe?Ic(Le.text,Df(Oe)):Le.text}})}))},onError:W=>{po("chat.stream.error",{thread_id:m,message:W}),j(W),fe(null),ft(m,Fe=>({...Fe,messages:Fe.messages.filter(Z=>Z.id!==F.id)}))}}),Or("chat.stream.completed",{thread_id:m,duration_ms:Date.now()-ce}),ft(m,W=>({...W,updatedAt:new Date().toISOString(),messages:W.messages.map(Fe=>Fe.id===F.id?{...Fe,statusText:Fe.statusText?.includes("being tracked")?Fe.statusText:null,isPending:!1}:Fe)}))}catch(pe){if(pe instanceof DOMException&&pe.name==="AbortError"){nR("chat.send.aborted",{thread_id:m}),j(null),fe(null),ft(m,ce=>({...ce,updatedAt:new Date().toISOString(),messages:ce.messages.map(ue=>ue.id!==F.id?ue:!!(ue.text.trim()||ue.toolExchanges?.length||ue.httpExchanges?.length)?{...ue,statusText:"Stopped.",isPending:!1}:{...ue,text:"Stopped.",statusText:null,isPending:!1})}));return}po("chat.send.failed",{thread_id:m,message:pe instanceof Error?pe.message:String(pe)}),j(pe instanceof Error?pe.message:"Unable to send chat message."),fe(null),ft(m,ce=>({...ce,messages:ce.messages.map(ue=>ue.id===F.id?{...ue,text:pe instanceof Error?`Error: ${pe.message}`:"Error: Unable to send chat message.",statusText:null,isPending:!1}:ue)}))}finally{u.current?.assistantMessageId===F.id&&(u.current=null),X(pe=>pe===m?null:pe),fe(null)}}function Ix(){fe("Stopping\u2026");let m=u.current;m&&ft(m.threadId,v=>({...v,updatedAt:new Date().toISOString(),messages:v.messages.map(w=>w.id===m.assistantMessageId?{...w,statusText:"Stopping\u2026"}:w)})),u.current?.abortController.abort()}(0,k.useEffect)(()=>()=>{u.current?.abortController.abort();for(let m of f.current.keys())ha(m);try{o?.setItem(r.threads,JSON.stringify(wR(Se.current,Ur.current)))}catch{}},[o,r]);function wx(m){m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),AS())}let MS=(0,d.jsx)("div",{className:`vf-editor-chat-thread-list${t?" vf-editor-chat-thread-list-sidebar":""}`,role:"tablist","aria-label":"Conversation threads",children:Jf.length?Jf.map(m=>(0,d.jsxs)("div",{role:"tab","aria-selected":m.id===g,className:"vf-editor-chat-thread-chip","data-active":m.id===g?"true":"false",children:[(0,d.jsxs)("button",{type:"button",className:"vf-editor-chat-thread-chip-main",onClick:()=>{S(m.id),j(null),A(null),bt(!1)},children:[(0,d.jsx)("span",{className:"vf-editor-chat-thread-chip-title",children:m.title}),m.tracers.length?(0,d.jsxs)("span",{className:"vf-editor-chat-thread-chip-tracers",children:[m.tracers.slice(0,2).join(", "),m.tracers.length>2?` +${m.tracers.length-2}`:""]}):null]}),(0,d.jsx)("div",{className:"vf-editor-chat-thread-menu-wrap",children:(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-thread-chip-menu","aria-label":`Actions for ${m.title}`,onClick:v=>{v.stopPropagation(),hx(m.id,v.currentTarget)},children:"..."})})]},m.id)):(0,d.jsx)("div",{className:"vf-editor-chat-thread-empty",children:"Start a chat to create your first conversation thread."})});return(0,d.jsxs)("div",{className:"vf-editor-chat-shell","data-mobile-open":ae?"true":"false","data-mobile-expanded":Te?"true":"false","data-layout":t?"brainstorm":"default",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-mobile-fab","aria-label":"Open chat","aria-expanded":ae,onClick:()=>{St(!1),Re(!0)},children:(0,d.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:(0,d.jsx)("path",{d:"M20 11.5a7.5 7.5 0 0 1-9.8 7.1L4 20l1.5-5.3A7.5 7.5 0 1 1 20 11.5Z"})})}),H?(0,d.jsx)("div",{className:"vf-editor-chat-error",role:"status",children:H}):null,(0,d.jsxs)("div",{className:`${t?"vf-editor-chat-body vf-editor-chat-brainstorm-layout":"vf-editor-chat-body"}${n?" has-sidebar":""}`,"data-history-open":ot||it?"true":"false",children:[n?(0,d.jsxs)("aside",{className:"vf-editor-chat-history-pane",children:[(0,d.jsx)("div",{className:"vf-editor-chat-history-header",children:(0,d.jsxs)("div",{className:"vf-editor-chat-history-header-main",children:[(0,d.jsxs)("a",{className:"vf-editor-chat-back-button",href:"/discover","aria-label":"Back to Discover",children:[(0,d.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,d.jsx)("path",{d:"m12 4-6 6 6 6"})}),"Discover"]}),(0,d.jsx)("div",{className:"vf-editor-chat-history-kicker",children:"Chat history"})]})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-new-thread vf-editor-chat-new-thread-sidebar",onClick:kS,children:"New chat"}),MS]}):null,(0,d.jsxs)("div",{className:"vf-editor-chat-thread",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-header",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-header-row",children:[(0,d.jsx)("a",{className:"vf-editor-chat-back-button vf-editor-chat-back-button--header",href:"/discover","aria-label":"Back to Discover",children:(0,d.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,d.jsx)("path",{d:"m12 4-6 6 6 6"})})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-history-icon","aria-label":ot?"Back to chat":"Open chat history","aria-pressed":ot,onClick:()=>{bt(m=>!m),In(!1)},children:ot?(0,d.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,d.jsx)("path",{d:"m12 4-6 6 6 6"})}):(0,d.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"10",cy:"10",r:"7.2"}),(0,d.jsx)("path",{d:"M10 6v4l2.6 1.6"})]})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-history-icon vf-editor-chat-branches-icon","aria-label":it?"Back to chat":"Open template forks","aria-pressed":it,onClick:()=>{In(m=>!m),bt(!1)},children:it?(0,d.jsx)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,d.jsx)("path",{d:"m12 4-6 6 6 6"})}):(0,d.jsxs)("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"5.5",cy:"4.5",r:"1.9"}),(0,d.jsx)("circle",{cx:"5.5",cy:"15.5",r:"1.9"}),(0,d.jsx)("circle",{cx:"14.5",cy:"8",r:"1.9"}),(0,d.jsx)("path",{d:"M5.5 6.4v7.2"}),(0,d.jsx)("path",{d:"M5.5 13.6c0-3.2 2.4-3.6 4.4-3.9 2-.3 4.6-.5 4.6-3.7"})]})}),(0,d.jsxs)("div",{className:"vf-editor-chat-header-titles",children:[(0,d.jsx)("div",{className:"vf-editor-chat-header-title",children:"Vidfarm"}),(0,d.jsx)("div",{className:"vf-editor-chat-header-subtitle",children:ot?"Chat history":it?"Template forks":e.template.templateTitle})]}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-new-thread",onClick:kS,children:"New chat"}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-expand","aria-label":Te?"Shrink chat":"Expand chat","aria-pressed":Te,onClick:()=>St(m=>!m),children:Te?(0,d.jsxs)("svg",{viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("path",{d:"M16.5 8.5h-5v-5"}),(0,d.jsx)("path",{d:"M11.5 8.5 17 3"}),(0,d.jsx)("path",{d:"M3.5 11.5h5v5"}),(0,d.jsx)("path",{d:"M8.5 11.5 3 17"})]}):(0,d.jsxs)("svg",{viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("path",{d:"M11.5 3.5h5v5"}),(0,d.jsx)("path",{d:"M16.5 3.5 11 9"}),(0,d.jsx)("path",{d:"M8.5 16.5h-5v-5"}),(0,d.jsx)("path",{d:"M3.5 16.5 9 11"})]})}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-minimize","aria-label":"Minimize chat",onClick:()=>Re(!1),children:"\xD7"})]}),M&&qi?(0,Wi.createPortal)((0,d.jsxs)("div",{className:"vf-editor-chat-thread-menu",role:"menu",style:{top:M.top,left:M.left},onClick:m=>m.stopPropagation(),children:[(0,d.jsx)("button",{type:"button",onClick:()=>mx(qi.id),children:"Copy Chat ID"}),(0,d.jsx)("button",{type:"button",onClick:()=>dx(qi.id),children:"Edit tracers"}),(0,d.jsx)("button",{type:"button",onClick:()=>px(qi.id),children:"Remove from view"}),(0,d.jsx)("button",{type:"button",onClick:()=>fx(qi.id),children:"Archive thread"}),(0,d.jsx)("button",{type:"button","data-danger":"true",onClick:()=>sx(qi.id),children:"Delete"})]}),document.body):null]}),(0,d.jsx)("div",{className:"vf-editor-chat-viewport",ref:s,children:ot?(0,d.jsx)("div",{className:"vf-editor-chat-history-panel",children:MS}):it?(0,d.jsxs)("div",{className:"vf-editor-chat-history-panel vf-editor-chat-branches-panel",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-branches-header",children:[(0,d.jsxs)("div",{className:"vf-editor-chat-branches-header-main",children:[(0,d.jsx)("div",{className:"vf-editor-chat-branches-kicker",children:"Forks"}),(0,d.jsxs)("div",{className:"vf-editor-chat-branches-title",children:[Dt?.length??0," fork",(Dt?.length??0)===1?"":"s"," of this template"]})]}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-branches-refresh",onClick:()=>{Je({force:!0})},disabled:nr,"aria-label":"Refresh forks",children:nr?"Loading\u2026":"Refresh"})]}),Zo?(0,d.jsx)("div",{className:"vf-editor-chat-thread-empty",role:"status",children:Zo}):nr&&!Dt?(0,d.jsx)("div",{className:"vf-editor-chat-thread-empty",children:"Loading forks\u2026"}):Dt&&Dt.length?(0,d.jsx)("div",{className:"vf-editor-chat-thread-list",children:Dt.map(m=>{let v=$e===m.forkId,w=`/editor/${encodeURIComponent(e.template.templateId)}?fork=${encodeURIComponent(m.forkId)}`,b=m.title&&m.title.trim()?m.title:m.forkId,F=m.parentForkId?` \xB7 forked from ${m.parentForkId.slice(0,12)}${m.parentVersion?`#v${m.parentVersion}`:""}`:"",K=m.latestVersion&&m.latestVersion>0?` \xB7 v${m.latestVersion}`:"";return(0,d.jsx)("div",{role:"listitem",className:"vf-editor-chat-thread-chip","data-active":v?"true":"false",children:(0,d.jsxs)("a",{className:"vf-editor-chat-thread-chip-main vf-editor-chat-branch-chip-link",href:w,target:"_blank",rel:"noopener noreferrer",children:[(0,d.jsxs)("span",{className:"vf-editor-chat-thread-chip-title",children:[b,v?(0,d.jsx)("span",{className:"vf-editor-chat-branch-current-badge",children:"current"}):null]}),(0,d.jsxs)("span",{className:"vf-editor-chat-thread-chip-tracers",children:[m.visibility??"private",K,F]})]})},m.forkId)})}):(0,d.jsx)("div",{className:"vf-editor-chat-thread-empty",children:"No forks yet for this template."})]}):Xf.length?Xf.map(m=>(0,d.jsx)(XF,{message:m},m.id)):g&&E===g?(0,d.jsxs)("div",{className:"vf-editor-chat-empty",children:[(0,d.jsx)("div",{className:"vf-editor-chat-kicker",children:"Loading chat"}),(0,d.jsxs)("h2",{children:["Opening ",g]})]}):(0,d.jsxs)("div",{className:"vf-editor-chat-empty",children:[(0,d.jsx)("div",{className:"vf-editor-chat-kicker",children:"AI Copilot"}),(0,d.jsx)("h2",{children:t?"Start a new chat.":"Repurpose this video."}),(0,d.jsx)("p",{children:t?"Use the brainstorm tools to go from zero context to angles, hooks, and a strategy you can actually test.":"Use the brainstorm tools to turn this video into a native ad for your product, spot product-placement opportunities, and shape the timeline you can actually test. You can also connect from your own AI coding agent, including Claude Code or OpenAI Codex, and ask it to work against this composition."}),(0,d.jsx)("div",{className:"vf-editor-chat-empty-prompts","aria-label":"Example prompts",children:t?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{children:"I don't know where to start"}),(0,d.jsx)("div",{children:"Help me think of persuasive angles"}),(0,d.jsx)("div",{children:"Help me think of viral hooks"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{children:"I don't know where to start"}),(0,d.jsx)("div",{children:"Repurpose this video into a social media native ad for my product"}),(0,d.jsx)("div",{children:"Help me identify product placement opportunities in this video for my product"})]})})]})}),(0,d.jsx)("div",{className:"vf-editor-chat-footer",hidden:ot||it,children:(0,d.jsxs)("div",{className:"vf-editor-chat-composer","data-drop-target":ye?"true":"false",onDragEnter:m=>{m.preventDefault(),Q(!0)},onDragOver:m=>{m.preventDefault(),ye||Q(!0)},onDragLeave:m=>{m.preventDefault();let v=m.relatedTarget;v instanceof Node&&m.currentTarget.contains(v)||Q(!1)},onDrop:m=>{Ex(m)},children:[ye?(0,d.jsx)("div",{className:"vf-editor-chat-dropzone-hint",children:"Drop files to attach"}):null,U.length?(0,d.jsx)("div",{className:"vf-editor-chat-composer-attachments-strip",children:U.map(m=>(0,d.jsx)(GF,{attachment:m,onRemove:()=>x(v=>v.filter(w=>w.id!==m.id))},m.id))}):null,(0,d.jsxs)("div",{className:"vf-editor-chat-composer-row",children:[(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-attach-button","aria-label":"Open upload drawer",onClick:()=>ie(!0),children:"\u{1F4CE}"}),(0,d.jsx)("textarea",{rows:1,placeholder:t?"Describe the offer, audience, or strategy problem you want help with...":"Ask it to call a route, inspect jobs, save config, or continue this thread...",className:"vf-editor-chat-input",value:I,onChange:m=>N(m.target.value),onKeyDown:wx,onPaste:m=>{vx(m)}}),(0,d.jsx)("button",{type:"button",className:"vf-editor-chat-send-button",onClick:()=>{if(Qf){Ix();return}AS()},disabled:Qf?!1:!CS,children:Qf?"Stop":"Send"})]}),(0,d.jsx)("input",{ref:i,type:"file",accept:"image/*,video/*,audio/*,application/pdf,text/plain,text/markdown",multiple:!0,hidden:!0,onChange:m=>{_x(m)}})]})})]})]}),(0,d.jsx)(ZF,{apiKey:e.vidfarmApiKey,open:V,onClose:()=>ie(!1),onConfirm:m=>x(v=>[...v,...m])})]})}var Tn=Cn(Tc(),1);rR();function eB(){let e=document.getElementById("page-runtime-boot");return e?.textContent?JSON.parse(e.textContent):null}function qf(e){let t=new Date;return t.setDate(t.getDate()+e),t.toISOString()}async function tB(e){if(!e.userId)return;let t=e.store.getState();if(!e.force&&t.channels.length&&t.channelsUpdatedAt)return;let n=new URLSearchParams({start_date:qf(-7),end_date:qf(30)}),r=await fetch(`/u/${encodeURIComponent(e.userId)}/calendar/feed?${n.toString()}`,{headers:{accept:"application/json"}}),o=await r.json().catch(()=>null);!r.ok||!o||(e.store.getState().setCalendarData({channels:Array.isArray(o.channels)?o.channels:[],posts:Array.isArray(o.posts)?o.posts:[],rangeStart:o.startDate||qf(-7),rangeEnd:o.endDate||qf(30),replaceRange:!0}),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated")))}function nB({boot:e}){let t=(0,Gi.useMemo)(()=>lR(e),[e]),n=tR(t,i=>i.boot.title),[r,o]=(0,Gi.useState)(null);return(0,Gi.useEffect)(()=>{t.getState().setHydratedAt(new Date().toISOString()),document.documentElement.dataset.reactRuntime="true",document.documentElement.dataset.reactRuntimePage=e.pageKind,document.title=n},[e.pageKind,t,n]),(0,Gi.useEffect)(()=>{if(!e.editorChat)return;let i=document.querySelector("[data-template-editor-chat-root]");o(i instanceof HTMLElement?i:null)},[e.editorChat]),e.editorChat&&r?(0,QR.createPortal)((0,Tn.jsx)(Ds,{fallback:(0,Tn.jsx)(rB,{}),children:(0,Tn.jsx)(XR,{boot:e.editorChat})}),r):null}function rB(){return(0,Tn.jsxs)("div",{style:{display:"grid",placeItems:"center",height:"100%",padding:"24px",textAlign:"center",gap:"12px",color:"#5c6a82"},children:[(0,Tn.jsx)("div",{style:{fontSize:"0.72rem",fontWeight:800,letterSpacing:"0.14em",textTransform:"uppercase"},children:"Chat error"}),(0,Tn.jsx)("div",{style:{fontSize:"0.92rem"},children:"Something went wrong loading the chat. Reload the page to try again."}),(0,Tn.jsx)("button",{type:"button",onClick:()=>window.location.reload(),style:{marginTop:"4px",minHeight:"34px",padding:"0 16px",border:"1px solid rgba(191, 164, 109, 0.34)",borderRadius:"999px",background:"rgba(255, 255, 255, 0.92)",color:"#243041",fontWeight:700,cursor:"pointer"},children:"Reload"})]})}var Qo=eB(),ES=document.getElementById("page-runtime-root"),TS=aR(Qo?.userId??null),Yf=null;function ex(e={}){return!e.force&&Yf||(Yf=tB({userId:Qo?.userId??null,store:TS,force:e.force}).catch(()=>{})),Yf}window.__vidfarmFlockPosterCache={readSnapshot:()=>nS(Qo?.userId??null),ensureHydrated:ex,setChannelsData:e=>{TS.getState().setChannelsData(e),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated"))},setCalendarData:e=>{TS.getState().setCalendarData(e),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated"))}};ex();Or("page_runtime.boot",{has_boot:!!Qo,has_root:!!ES,page_kind:Qo?.pageKind??null,editor_chat_template_id:Qo?.editorChat?.template?.templateId??null});Qo&&ES&&(0,ZR.createRoot)(ES).render((0,Tn.jsx)(Ds,{fallback:(0,Tn.jsx)(Tn.Fragment,{}),onError:e=>po("page_runtime.render_error",{message:e instanceof Error?e.message:String(e)}),children:(0,Tn.jsx)(nB,{boot:Qo})}));
|
|
46
46
|
/*! Bundled license information:
|
|
47
47
|
|
|
48
48
|
react/cjs/react.production.min.js:
|