@mevdragon/vidfarm-devcli 0.5.2 → 0.6.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.
Files changed (113) hide show
  1. package/README.md +3 -3
  2. package/demo/README.md +28 -0
  3. package/demo/dist/app.css +1 -0
  4. package/demo/dist/app.js +1184 -0
  5. package/demo/dist/chunks/chunk-DXB73IDG.js +1 -0
  6. package/demo/dist/chunks/chunk-S7OWAJDS.js +36 -0
  7. package/demo/dist/chunks/chunk-VTIBZ6AN.js +1 -0
  8. package/demo/dist/chunks/dist-ADSJKBVE.js +332 -0
  9. package/demo/dist/chunks/domEditingLayers-VZMLL4AP-SGHWPND4.js +1 -0
  10. package/demo/dist/chunks/hyperframes-player-XB65TCD6.js +425 -0
  11. package/demo/dist/chunks/lib-XAQ37YOE.js +1 -0
  12. package/demo/dist/chunks/src-TJ2QYA4U.js +207 -0
  13. package/demo/dist/favicon.ico +0 -0
  14. package/demo/dist/icons/timeline/audio.svg +7 -0
  15. package/demo/dist/icons/timeline/captions.svg +5 -0
  16. package/demo/dist/icons/timeline/composition.svg +12 -0
  17. package/demo/dist/icons/timeline/image.svg +18 -0
  18. package/demo/dist/icons/timeline/music.svg +10 -0
  19. package/demo/dist/icons/timeline/text.svg +3 -0
  20. package/demo/dist/index.html +15 -0
  21. package/dist/src/account-pages-legacy.js +9396 -0
  22. package/dist/src/account-pages.js +61 -0
  23. package/dist/src/app.js +14378 -0
  24. package/dist/src/cli.js +1 -1
  25. package/dist/src/composition-runtime.js +613 -0
  26. package/dist/src/config.js +166 -0
  27. package/dist/src/context.js +447 -0
  28. package/dist/src/dev-app-legacy.js +739 -0
  29. package/dist/src/dev-app.js +6 -0
  30. package/dist/src/domain.js +2 -0
  31. package/dist/src/editor-chat-history.js +82 -0
  32. package/dist/src/editor-chat.js +449 -0
  33. package/dist/src/editor-dark-theme.js +1128 -0
  34. package/dist/src/frontend/debug.js +71 -0
  35. package/dist/src/frontend/flockposter-cache-store.js +124 -0
  36. package/dist/src/frontend/homepage-client.js +182 -0
  37. package/dist/src/frontend/homepage-shared.js +4 -0
  38. package/dist/src/frontend/homepage-store.js +28 -0
  39. package/dist/src/frontend/homepage-view.js +547 -0
  40. package/dist/src/frontend/page-runtime-client.js +132 -0
  41. package/dist/src/frontend/page-runtime-store.js +9 -0
  42. package/dist/src/frontend/sentry.js +42 -0
  43. package/dist/src/frontend/template-editor-chat.js +3960 -0
  44. package/dist/src/help-page.js +346 -0
  45. package/dist/src/homepage.js +1235 -0
  46. package/dist/src/hyperframes/composition.js +180 -0
  47. package/dist/src/index.js +16 -0
  48. package/dist/src/instrument.js +30 -0
  49. package/dist/src/lib/crypto.js +45 -0
  50. package/dist/src/lib/dev-log.js +54 -0
  51. package/dist/src/lib/display-name.js +11 -0
  52. package/dist/src/lib/ids.js +24 -0
  53. package/dist/src/lib/images.js +19 -0
  54. package/dist/src/lib/json.js +15 -0
  55. package/dist/src/lib/package-root.js +47 -0
  56. package/dist/src/lib/template-paths.js +28 -0
  57. package/dist/src/lib/time.js +7 -0
  58. package/dist/src/lib/url-clean.js +85 -0
  59. package/dist/src/page-runtime.js +2 -0
  60. package/dist/src/page-shell.js +1381 -0
  61. package/dist/src/primitive-context.js +357 -0
  62. package/dist/src/primitive-registry.js +2436 -0
  63. package/dist/src/primitive-sdk.js +4 -0
  64. package/dist/src/primitives/hyperframes-media.js +108 -0
  65. package/dist/src/react-page-shell.js +35 -0
  66. package/dist/src/ready-post-schedule-component.js +1540 -0
  67. package/dist/src/registry.js +296 -0
  68. package/dist/src/runtime.js +35 -0
  69. package/dist/src/services/api-call-history.js +249 -0
  70. package/dist/src/services/auth.js +152 -0
  71. package/dist/src/services/billing-pricing.js +39 -0
  72. package/dist/src/services/billing.js +228 -0
  73. package/dist/src/services/cast.js +127 -0
  74. package/dist/src/services/chat-threads.js +92 -0
  75. package/dist/src/services/composition-sanitize.js +124 -0
  76. package/dist/src/services/composition-watch.js +79 -0
  77. package/dist/src/services/fork-access.js +93 -0
  78. package/dist/src/services/fork-manifest.js +42 -0
  79. package/dist/src/services/ghostcut.js +179 -0
  80. package/dist/src/services/hyperframes.js +2307 -0
  81. package/dist/src/services/job-capacity.js +14 -0
  82. package/dist/src/services/job-logs.js +197 -0
  83. package/dist/src/services/jobs.js +136 -0
  84. package/dist/src/services/local-dynamo.js +0 -0
  85. package/dist/src/services/media-processing.js +766 -0
  86. package/dist/src/services/primitive-media-lambda.js +280 -0
  87. package/dist/src/services/providers.js +2926 -0
  88. package/dist/src/services/rate-limits.js +262 -0
  89. package/dist/src/services/serverless-auth.js +382 -0
  90. package/dist/src/services/serverless-jobs.js +1082 -0
  91. package/dist/src/services/serverless-provider-keys.js +409 -0
  92. package/dist/src/services/serverless-records.js +1385 -0
  93. package/dist/src/services/serverless-template-configs.js +75 -0
  94. package/dist/src/services/storage.js +383 -0
  95. package/dist/src/services/template-certification.js +413 -0
  96. package/dist/src/services/template-loader.js +99 -0
  97. package/dist/src/services/template-runtime-bundles.js +217 -0
  98. package/dist/src/services/template-sources.js +1017 -0
  99. package/dist/src/services/video-normalization.js +2 -0
  100. package/dist/src/services/webhooks.js +62 -0
  101. package/dist/src/template-editor-pages.js +2576 -0
  102. package/dist/src/template-editor-shell.js +2840 -0
  103. package/dist/src/template-sdk.js +4 -0
  104. package/dist/src/worker.js +17 -0
  105. package/package.json +6 -4
  106. package/public/assets/homepage-app.js +54 -0
  107. package/public/assets/homepage-client-app.js +80 -0
  108. package/public/assets/page-runtime-client-app.js +94 -0
  109. package/src/assets/SELLING_AWARENESS_STAGES.md +579 -0
  110. package/src/assets/SELLING_WITH_HOOKS.md +377 -0
  111. package/src/assets/SELLING_WITH_VSLS.md +606 -0
  112. package/src/assets/favicon.ico +0 -0
  113. package/src/assets/logo-vidfarm.png +0 -0
@@ -0,0 +1,94 @@
1
+ var ER=Object.create;var xS=Object.defineProperty;var TR=Object.getOwnPropertyDescriptor;var IR=Object.getOwnPropertyNames;var wR=Object.getPrototypeOf,CR=Object.prototype.hasOwnProperty;var Mr=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var xR=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of IR(t))!CR.call(e,o)&&o!==n&&xS(e,o,{get:()=>t[o],enumerable:!(r=TR(t,o))||r.enumerable});return e};var hn=(e,t,n)=>(n=e!=null?ER(wR(e)):{},xR(t||!e||!e.__esModule?xS(n,"default",{value:e,enumerable:!0}):n,e));var SI=Mr(ye=>{"use strict";var El=Symbol.for("react.element"),oO=Symbol.for("react.portal"),iO=Symbol.for("react.fragment"),sO=Symbol.for("react.strict_mode"),aO=Symbol.for("react.profiler"),lO=Symbol.for("react.provider"),cO=Symbol.for("react.context"),uO=Symbol.for("react.forward_ref"),dO=Symbol.for("react.suspense"),fO=Symbol.for("react.memo"),pO=Symbol.for("react.lazy"),aI=Symbol.iterator;function mO(e){return e===null||typeof e!="object"?null:(e=aI&&e[aI]||e["@@iterator"],typeof e=="function"?e:null)}var uI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},dI=Object.assign,fI={};function bs(e,t,n){this.props=e,this.context=t,this.refs=fI,this.updater=n||uI}bs.prototype.isReactComponent={};bs.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")};bs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function pI(){}pI.prototype=bs.prototype;function xh(e,t,n){this.props=e,this.context=t,this.refs=fI,this.updater=n||uI}var Rh=xh.prototype=new pI;Rh.constructor=xh;dI(Rh,bs.prototype);Rh.isPureReactComponent=!0;var lI=Array.isArray,mI=Object.prototype.hasOwnProperty,bh={current:null},hI={key:!0,ref:!0,__self:!0,__source:!0};function gI(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)mI.call(t,r)&&!hI.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:El,type:e,key:i,ref:s,props:o,_owner:bh.current}}function hO(e,t){return{$$typeof:El,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function kh(e){return typeof e=="object"&&e!==null&&e.$$typeof===El}function gO(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var cI=/\/+/g;function Ch(e,t){return typeof e=="object"&&e!==null&&e.key!=null?gO(""+e.key):t.toString(36)}function nd(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 El:case oO:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Ch(s,0):r,lI(o)?(n="",e!=null&&(n=e.replace(cI,"$&/")+"/"),nd(o,t,n,"",function(c){return c})):o!=null&&(kh(o)&&(o=hO(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(cI,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",lI(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Ch(i,a);s+=nd(i,t,n,l,o)}else if(l=mO(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Ch(i,a++),s+=nd(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 td(e,t,n){if(e==null)return e;var r=[],o=0;return nd(e,r,"","",function(i){return t.call(n,i,o++)}),r}function yO(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 Yt={current:null},rd={transition:null},SO={ReactCurrentDispatcher:Yt,ReactCurrentBatchConfig:rd,ReactCurrentOwner:bh};function yI(){throw Error("act(...) is not supported in production builds of React.")}ye.Children={map:td,forEach:function(e,t,n){td(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return td(e,function(){t++}),t},toArray:function(e){return td(e,function(t){return t})||[]},only:function(e){if(!kh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ye.Component=bs;ye.Fragment=iO;ye.Profiler=aO;ye.PureComponent=xh;ye.StrictMode=sO;ye.Suspense=dO;ye.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=SO;ye.act=yI;ye.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=dI({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=bh.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)mI.call(t,l)&&!hI.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:El,type:e.type,key:o,ref:i,props:r,_owner:s}};ye.createContext=function(e){return e={$$typeof:cO,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:lO,_context:e},e.Consumer=e};ye.createElement=gI;ye.createFactory=function(e){var t=gI.bind(null,e);return t.type=e,t};ye.createRef=function(){return{current:null}};ye.forwardRef=function(e){return{$$typeof:uO,render:e}};ye.isValidElement=kh;ye.lazy=function(e){return{$$typeof:pO,_payload:{_status:-1,_result:e},_init:yO}};ye.memo=function(e,t){return{$$typeof:fO,type:e,compare:t===void 0?null:t}};ye.startTransition=function(e){var t=rd.transition;rd.transition={};try{e()}finally{rd.transition=t}};ye.unstable_act=yI;ye.useCallback=function(e,t){return Yt.current.useCallback(e,t)};ye.useContext=function(e){return Yt.current.useContext(e)};ye.useDebugValue=function(){};ye.useDeferredValue=function(e){return Yt.current.useDeferredValue(e)};ye.useEffect=function(e,t){return Yt.current.useEffect(e,t)};ye.useId=function(){return Yt.current.useId()};ye.useImperativeHandle=function(e,t,n){return Yt.current.useImperativeHandle(e,t,n)};ye.useInsertionEffect=function(e,t){return Yt.current.useInsertionEffect(e,t)};ye.useLayoutEffect=function(e,t){return Yt.current.useLayoutEffect(e,t)};ye.useMemo=function(e,t){return Yt.current.useMemo(e,t)};ye.useReducer=function(e,t,n){return Yt.current.useReducer(e,t,n)};ye.useRef=function(e){return Yt.current.useRef(e)};ye.useState=function(e){return Yt.current.useState(e)};ye.useSyncExternalStore=function(e,t,n){return Yt.current.useSyncExternalStore(e,t,n)};ye.useTransition=function(){return Yt.current.useTransition()};ye.version="18.3.1"});var qr=Mr((pY,_I)=>{"use strict";_I.exports=SI()});var DI=Mr(De=>{"use strict";function Dh(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<od(o,t))e[r]=t,e[n]=o,n=r;else break e}}function sr(e){return e.length===0?null:e[0]}function sd(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>od(a,n))l<o&&0>od(c,a)?(e[r]=c,e[l]=n,r=l):(e[r]=a,e[s]=n,r=s);else if(l<o&&0>od(c,n))e[r]=c,e[l]=n,r=l;else break e}}return t}function od(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(RI=performance,De.unstable_now=function(){return RI.now()}):(Ph=Date,bI=Ph.now(),De.unstable_now=function(){return Ph.now()-bI});var RI,Ph,bI,wr=[],Co=[],TO=1,Hn=null,Dt=3,ad=!1,_i=!1,Il=!1,AI=typeof setTimeout=="function"?setTimeout:null,MI=typeof clearTimeout=="function"?clearTimeout:null,kI=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Uh(e){for(var t=sr(Co);t!==null;){if(t.callback===null)sd(Co);else if(t.startTime<=e)sd(Co),t.sortIndex=t.expirationTime,Dh(wr,t);else break;t=sr(Co)}}function Fh(e){if(Il=!1,Uh(e),!_i)if(sr(wr)!==null)_i=!0,Hh(Bh);else{var t=sr(Co);t!==null&&$h(Fh,t.startTime-e)}}function Bh(e,t){_i=!1,Il&&(Il=!1,MI(wl),wl=-1),ad=!0;var n=Dt;try{for(Uh(t),Hn=sr(wr);Hn!==null&&(!(Hn.expirationTime>t)||e&&!OI());){var r=Hn.callback;if(typeof r=="function"){Hn.callback=null,Dt=Hn.priorityLevel;var o=r(Hn.expirationTime<=t);t=De.unstable_now(),typeof o=="function"?Hn.callback=o:Hn===sr(wr)&&sd(wr),Uh(t)}else sd(wr);Hn=sr(wr)}if(Hn!==null)var i=!0;else{var s=sr(Co);s!==null&&$h(Fh,s.startTime-t),i=!1}return i}finally{Hn=null,Dt=n,ad=!1}}var ld=!1,id=null,wl=-1,PI=5,LI=-1;function OI(){return!(De.unstable_now()-LI<PI)}function Lh(){if(id!==null){var e=De.unstable_now();LI=e;var t=!0;try{t=id(!0,e)}finally{t?Tl():(ld=!1,id=null)}}else ld=!1}var Tl;typeof kI=="function"?Tl=function(){kI(Lh)}:typeof MessageChannel<"u"?(Oh=new MessageChannel,NI=Oh.port2,Oh.port1.onmessage=Lh,Tl=function(){NI.postMessage(null)}):Tl=function(){AI(Lh,0)};var Oh,NI;function Hh(e){id=e,ld||(ld=!0,Tl())}function $h(e,t){wl=AI(function(){e(De.unstable_now())},t)}De.unstable_IdlePriority=5;De.unstable_ImmediatePriority=1;De.unstable_LowPriority=4;De.unstable_NormalPriority=3;De.unstable_Profiling=null;De.unstable_UserBlockingPriority=2;De.unstable_cancelCallback=function(e){e.callback=null};De.unstable_continueExecution=function(){_i||ad||(_i=!0,Hh(Bh))};De.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"):PI=0<e?Math.floor(1e3/e):5};De.unstable_getCurrentPriorityLevel=function(){return Dt};De.unstable_getFirstCallbackNode=function(){return sr(wr)};De.unstable_next=function(e){switch(Dt){case 1:case 2:case 3:var t=3;break;default:t=Dt}var n=Dt;Dt=t;try{return e()}finally{Dt=n}};De.unstable_pauseExecution=function(){};De.unstable_requestPaint=function(){};De.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=Dt;Dt=e;try{return t()}finally{Dt=n}};De.unstable_scheduleCallback=function(e,t,n){var r=De.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:TO++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,Dh(Co,e),sr(wr)===null&&e===sr(Co)&&(Il?(MI(wl),wl=-1):Il=!0,$h(Fh,n-r))):(e.sortIndex=o,Dh(wr,e),_i||ad||(_i=!0,Hh(Bh))),e};De.unstable_shouldYield=OI;De.unstable_wrapCallback=function(e){var t=Dt;return function(){var n=Dt;Dt=t;try{return e.apply(this,arguments)}finally{Dt=n}}}});var FI=Mr((LY,UI)=>{"use strict";UI.exports=DI()});var zC=Mr(xn=>{"use strict";var IO=qr(),wn=FI();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 Gw=new Set,Vl={};function Mi(e,t){Js(e,t),Js(e+"Capture",t)}function Js(e,t){for(Vl[e]=t,e=0;e<t.length;e++)Gw.add(t[e])}var eo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ug=Object.prototype.hasOwnProperty,wO=/^[: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]*$/,BI={},HI={};function CO(e){return ug.call(HI,e)?!0:ug.call(BI,e)?!1:wO.test(e)?HI[e]=!0:(BI[e]=!0,!1)}function xO(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 RO(e,t,n,r){if(t===null||typeof t>"u"||xO(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 Xt(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 Rt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Rt[e]=new Xt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Rt[t]=new Xt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Rt[e]=new Xt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Rt[e]=new Xt(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){Rt[e]=new Xt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Rt[e]=new Xt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Rt[e]=new Xt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Rt[e]=new Xt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Rt[e]=new Xt(e,5,!1,e.toLowerCase(),null,!1,!1)});var ny=/[\-:]([a-z])/g;function ry(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(ny,ry);Rt[t]=new Xt(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(ny,ry);Rt[t]=new Xt(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(ny,ry);Rt[t]=new Xt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Rt[e]=new Xt(e,1,!1,e.toLowerCase(),null,!1,!1)});Rt.xlinkHref=new Xt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Rt[e]=new Xt(e,1,!1,e.toLowerCase(),null,!0,!0)});function oy(e,t,n,r){var o=Rt.hasOwnProperty(t)?Rt[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(RO(t,n,o,r)&&(n=null),r||o===null?CO(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 oo=IO.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,cd=Symbol.for("react.element"),Ms=Symbol.for("react.portal"),Ps=Symbol.for("react.fragment"),iy=Symbol.for("react.strict_mode"),dg=Symbol.for("react.profiler"),Vw=Symbol.for("react.provider"),qw=Symbol.for("react.context"),sy=Symbol.for("react.forward_ref"),fg=Symbol.for("react.suspense"),pg=Symbol.for("react.suspense_list"),ay=Symbol.for("react.memo"),Ro=Symbol.for("react.lazy"),Yw=Symbol.for("react.offscreen"),$I=Symbol.iterator;function Cl(e){return e===null||typeof e!="object"?null:(e=$I&&e[$I]||e["@@iterator"],typeof e=="function"?e:null)}var Xe=Object.assign,zh;function Pl(e){if(zh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);zh=t&&t[1]||""}return`
2
+ `+zh+e}var jh=!1;function Wh(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
+ `),i=r.stack.split(`
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{jh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Pl(e):""}function bO(e){switch(e.tag){case 5:return Pl(e.type);case 16:return Pl("Lazy");case 13:return Pl("Suspense");case 19:return Pl("SuspenseList");case 0:case 2:case 15:return e=Wh(e.type,!1),e;case 11:return e=Wh(e.type.render,!1),e;case 1:return e=Wh(e.type,!0),e;default:return""}}function mg(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 Ps:return"Fragment";case Ms:return"Portal";case dg:return"Profiler";case iy:return"StrictMode";case fg:return"Suspense";case pg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case qw:return(e.displayName||"Context")+".Consumer";case Vw:return(e._context.displayName||"Context")+".Provider";case sy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ay:return t=e.displayName||null,t!==null?t:mg(e.type)||"Memo";case Ro:t=e._payload,e=e._init;try{return mg(e(t))}catch{}}return null}function kO(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 mg(t);case 8:return t===iy?"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 $o(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Kw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function NO(e){var t=Kw(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 ud(e){e._valueTracker||(e._valueTracker=NO(e))}function Jw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Kw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Fd(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 hg(e,t){var n=t.checked;return Xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function zI(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=$o(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 Xw(e,t){t=t.checked,t!=null&&oy(e,"checked",t,!1)}function gg(e,t){Xw(e,t);var n=$o(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")?yg(e,t.type,n):t.hasOwnProperty("defaultValue")&&yg(e,t.type,$o(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 yg(e,t,n){(t!=="number"||Fd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ll=Array.isArray;function Ws(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=""+$o(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 Sg(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(L(91));return Xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function WI(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(Ll(n)){if(1<n.length)throw Error(L(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:$o(n)}}function Qw(e,t){var n=$o(t.value),r=$o(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 GI(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Zw(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 _g(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Zw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var dd,e0=(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(dd=dd||document.createElement("div"),dd.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=dd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ql(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ul={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},AO=["Webkit","ms","Moz","O"];Object.keys(Ul).forEach(function(e){AO.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ul[t]=Ul[e]})});function t0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ul.hasOwnProperty(e)&&Ul[e]?(""+t).trim():t+"px"}function n0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=t0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var MO=Xe({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 vg(e,t){if(t){if(MO[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 Eg(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 Tg=null;function ly(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ig=null,Gs=null,Vs=null;function VI(e){if(e=dc(e)){if(typeof Ig!="function")throw Error(L(280));var t=e.stateNode;t&&(t=pf(t),Ig(e.stateNode,e.type,t))}}function r0(e){Gs?Vs?Vs.push(e):Vs=[e]:Gs=e}function o0(){if(Gs){var e=Gs,t=Vs;if(Vs=Gs=null,VI(e),t)for(e=0;e<t.length;e++)VI(t[e])}}function i0(e,t){return e(t)}function s0(){}var Gh=!1;function a0(e,t,n){if(Gh)return e(t,n);Gh=!0;try{return i0(e,t,n)}finally{Gh=!1,(Gs!==null||Vs!==null)&&(s0(),o0())}}function Yl(e,t){var n=e.stateNode;if(n===null)return null;var r=pf(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 wg=!1;if(eo)try{Ns={},Object.defineProperty(Ns,"passive",{get:function(){wg=!0}}),window.addEventListener("test",Ns,Ns),window.removeEventListener("test",Ns,Ns)}catch{wg=!1}var Ns;function PO(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 Fl=!1,Bd=null,Hd=!1,Cg=null,LO={onError:function(e){Fl=!0,Bd=e}};function OO(e,t,n,r,o,i,s,a,l){Fl=!1,Bd=null,PO.apply(LO,arguments)}function DO(e,t,n,r,o,i,s,a,l){if(OO.apply(this,arguments),Fl){if(Fl){var c=Bd;Fl=!1,Bd=null}else throw Error(L(198));Hd||(Hd=!0,Cg=c)}}function Pi(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 l0(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(Pi(e)!==e)throw Error(L(188))}function UO(e){var t=e.alternate;if(!t){if(t=Pi(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 c0(e){return e=UO(e),e!==null?u0(e):null}function u0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=u0(e);if(t!==null)return t;e=e.sibling}return null}var d0=wn.unstable_scheduleCallback,YI=wn.unstable_cancelCallback,FO=wn.unstable_shouldYield,BO=wn.unstable_requestPaint,it=wn.unstable_now,HO=wn.unstable_getCurrentPriorityLevel,cy=wn.unstable_ImmediatePriority,f0=wn.unstable_UserBlockingPriority,$d=wn.unstable_NormalPriority,$O=wn.unstable_LowPriority,p0=wn.unstable_IdlePriority,cf=null,br=null;function zO(e){if(br&&typeof br.onCommitFiberRoot=="function")try{br.onCommitFiberRoot(cf,e,void 0,(e.current.flags&128)===128)}catch{}}var dr=Math.clz32?Math.clz32:GO,jO=Math.log,WO=Math.LN2;function GO(e){return e>>>=0,e===0?32:31-(jO(e)/WO|0)|0}var fd=64,pd=4194304;function Ol(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 zd(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=Ol(a):(i&=s,i!==0&&(r=Ol(i)))}else s=n&~o,s!==0?r=Ol(s):i!==0&&(r=Ol(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-dr(t),o=1<<n,r|=e[n],t&=~o;return r}function VO(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-dr(i),a=1<<s,l=o[s];l===-1?((a&n)===0||(a&r)!==0)&&(o[s]=VO(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function xg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function m0(){var e=fd;return fd<<=1,(fd&4194240)===0&&(fd=64),e}function Vh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function cc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-dr(t),e[t]=n}function YO(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-dr(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function uy(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-dr(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var Ne=0;function h0(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var g0,dy,y0,S0,_0,Rg=!1,md=[],Po=null,Lo=null,Oo=null,Kl=new Map,Jl=new Map,ko=[],KO="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 KI(e,t){switch(e){case"focusin":case"focusout":Po=null;break;case"dragenter":case"dragleave":Lo=null;break;case"mouseover":case"mouseout":Oo=null;break;case"pointerover":case"pointerout":Kl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Jl.delete(t.pointerId)}}function xl(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=dc(t),t!==null&&dy(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function JO(e,t,n,r,o){switch(t){case"focusin":return Po=xl(Po,e,t,n,r,o),!0;case"dragenter":return Lo=xl(Lo,e,t,n,r,o),!0;case"mouseover":return Oo=xl(Oo,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Kl.set(i,xl(Kl.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Jl.set(i,xl(Jl.get(i)||null,e,t,n,r,o)),!0}return!1}function v0(e){var t=Ti(e.target);if(t!==null){var n=Pi(t);if(n!==null){if(t=n.tag,t===13){if(t=l0(n),t!==null){e.blockedOn=t,_0(e.priority,function(){y0(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 bd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bg(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Tg=r,n.target.dispatchEvent(r),Tg=null}else return t=dc(n),t!==null&&dy(t),e.blockedOn=n,!1;t.shift()}return!0}function JI(e,t,n){bd(e)&&n.delete(t)}function XO(){Rg=!1,Po!==null&&bd(Po)&&(Po=null),Lo!==null&&bd(Lo)&&(Lo=null),Oo!==null&&bd(Oo)&&(Oo=null),Kl.forEach(JI),Jl.forEach(JI)}function Rl(e,t){e.blockedOn===t&&(e.blockedOn=null,Rg||(Rg=!0,wn.unstable_scheduleCallback(wn.unstable_NormalPriority,XO)))}function Xl(e){function t(o){return Rl(o,e)}if(0<md.length){Rl(md[0],e);for(var n=1;n<md.length;n++){var r=md[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Po!==null&&Rl(Po,e),Lo!==null&&Rl(Lo,e),Oo!==null&&Rl(Oo,e),Kl.forEach(t),Jl.forEach(t),n=0;n<ko.length;n++)r=ko[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ko.length&&(n=ko[0],n.blockedOn===null);)v0(n),n.blockedOn===null&&ko.shift()}var qs=oo.ReactCurrentBatchConfig,jd=!0;function QO(e,t,n,r){var o=Ne,i=qs.transition;qs.transition=null;try{Ne=1,fy(e,t,n,r)}finally{Ne=o,qs.transition=i}}function ZO(e,t,n,r){var o=Ne,i=qs.transition;qs.transition=null;try{Ne=4,fy(e,t,n,r)}finally{Ne=o,qs.transition=i}}function fy(e,t,n,r){if(jd){var o=bg(e,t,n,r);if(o===null)Zh(e,t,r,Wd,n),KI(e,r);else if(JO(o,e,t,n,r))r.stopPropagation();else if(KI(e,r),t&4&&-1<KO.indexOf(e)){for(;o!==null;){var i=dc(o);if(i!==null&&g0(i),i=bg(e,t,n,r),i===null&&Zh(e,t,r,Wd,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Zh(e,t,r,null,n)}}var Wd=null;function bg(e,t,n,r){if(Wd=null,e=ly(r),e=Ti(e),e!==null)if(t=Pi(e),t===null)e=null;else if(n=t.tag,n===13){if(e=l0(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 Wd=e,null}function E0(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(HO()){case cy:return 1;case f0:return 4;case $d:case $O:return 16;case p0:return 536870912;default:return 16}default:return 16}}var Ao=null,py=null,kd=null;function T0(){if(kd)return kd;var e,t=py,n=t.length,r,o="value"in Ao?Ao.value:Ao.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 kd=o.slice(e,1<r?1-r:void 0)}function Nd(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 hd(){return!0}function XI(){return!1}function Cn(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)?hd:XI,this.isPropagationStopped=XI,this}return Xe(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=hd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=hd)},persist:function(){},isPersistent:hd}),t}var ra={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},my=Cn(ra),uc=Xe({},ra,{view:0,detail:0}),eD=Cn(uc),qh,Yh,bl,uf=Xe({},uc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hy,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!==bl&&(bl&&e.type==="mousemove"?(qh=e.screenX-bl.screenX,Yh=e.screenY-bl.screenY):Yh=qh=0,bl=e),qh)},movementY:function(e){return"movementY"in e?e.movementY:Yh}}),QI=Cn(uf),tD=Xe({},uf,{dataTransfer:0}),nD=Cn(tD),rD=Xe({},uc,{relatedTarget:0}),Kh=Cn(rD),oD=Xe({},ra,{animationName:0,elapsedTime:0,pseudoElement:0}),iD=Cn(oD),sD=Xe({},ra,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),aD=Cn(sD),lD=Xe({},ra,{data:0}),ZI=Cn(lD),cD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},uD={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"},dD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=dD[e])?!!t[e]:!1}function hy(){return fD}var pD=Xe({},uc,{key:function(e){if(e.key){var t=cD[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Nd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?uD[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hy,charCode:function(e){return e.type==="keypress"?Nd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Nd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),mD=Cn(pD),hD=Xe({},uf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ew=Cn(hD),gD=Xe({},uc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hy}),yD=Cn(gD),SD=Xe({},ra,{propertyName:0,elapsedTime:0,pseudoElement:0}),_D=Cn(SD),vD=Xe({},uf,{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}),ED=Cn(vD),TD=[9,13,27,32],gy=eo&&"CompositionEvent"in window,Bl=null;eo&&"documentMode"in document&&(Bl=document.documentMode);var ID=eo&&"TextEvent"in window&&!Bl,I0=eo&&(!gy||Bl&&8<Bl&&11>=Bl),tw=" ",nw=!1;function w0(e,t){switch(e){case"keyup":return TD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function C0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ls=!1;function wD(e,t){switch(e){case"compositionend":return C0(t);case"keypress":return t.which!==32?null:(nw=!0,tw);case"textInput":return e=t.data,e===tw&&nw?null:e;default:return null}}function CD(e,t){if(Ls)return e==="compositionend"||!gy&&w0(e,t)?(e=T0(),kd=py=Ao=null,Ls=!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 I0&&t.locale!=="ko"?null:t.data;default:return null}}var xD={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 rw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!xD[e.type]:t==="textarea"}function x0(e,t,n,r){r0(r),t=Gd(t,"onChange"),0<t.length&&(n=new my("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Hl=null,Ql=null;function RD(e){U0(e,0)}function df(e){var t=Us(e);if(Jw(t))return e}function bD(e,t){if(e==="change")return t}var R0=!1;eo&&(eo?(yd="oninput"in document,yd||(Jh=document.createElement("div"),Jh.setAttribute("oninput","return;"),yd=typeof Jh.oninput=="function"),gd=yd):gd=!1,R0=gd&&(!document.documentMode||9<document.documentMode));var gd,yd,Jh;function ow(){Hl&&(Hl.detachEvent("onpropertychange",b0),Ql=Hl=null)}function b0(e){if(e.propertyName==="value"&&df(Ql)){var t=[];x0(t,Ql,e,ly(e)),a0(RD,t)}}function kD(e,t,n){e==="focusin"?(ow(),Hl=t,Ql=n,Hl.attachEvent("onpropertychange",b0)):e==="focusout"&&ow()}function ND(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return df(Ql)}function AD(e,t){if(e==="click")return df(t)}function MD(e,t){if(e==="input"||e==="change")return df(t)}function PD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pr=typeof Object.is=="function"?Object.is:PD;function Zl(e,t){if(pr(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(!ug.call(t,o)||!pr(e[o],t[o]))return!1}return!0}function iw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function sw(e,t){var n=iw(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=iw(n)}}function k0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?k0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function N0(){for(var e=window,t=Fd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fd(e.document)}return t}function yy(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 LD(e){var t=N0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&k0(n.ownerDocument.documentElement,n)){if(r!==null&&yy(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=sw(n,i);var s=sw(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 OD=eo&&"documentMode"in document&&11>=document.documentMode,Os=null,kg=null,$l=null,Ng=!1;function aw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ng||Os==null||Os!==Fd(r)||(r=Os,"selectionStart"in r&&yy(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}),$l&&Zl($l,r)||($l=r,r=Gd(kg,"onSelect"),0<r.length&&(t=new my("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Os)))}function Sd(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ds={animationend:Sd("Animation","AnimationEnd"),animationiteration:Sd("Animation","AnimationIteration"),animationstart:Sd("Animation","AnimationStart"),transitionend:Sd("Transition","TransitionEnd")},Xh={},A0={};eo&&(A0=document.createElement("div").style,"AnimationEvent"in window||(delete Ds.animationend.animation,delete Ds.animationiteration.animation,delete Ds.animationstart.animation),"TransitionEvent"in window||delete Ds.transitionend.transition);function ff(e){if(Xh[e])return Xh[e];if(!Ds[e])return e;var t=Ds[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in A0)return Xh[e]=t[n];return e}var M0=ff("animationend"),P0=ff("animationiteration"),L0=ff("animationstart"),O0=ff("transitionend"),D0=new Map,lw="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 jo(e,t){D0.set(e,t),Mi(t,[e])}for(_d=0;_d<lw.length;_d++)vd=lw[_d],cw=vd.toLowerCase(),uw=vd[0].toUpperCase()+vd.slice(1),jo(cw,"on"+uw);var vd,cw,uw,_d;jo(M0,"onAnimationEnd");jo(P0,"onAnimationIteration");jo(L0,"onAnimationStart");jo("dblclick","onDoubleClick");jo("focusin","onFocus");jo("focusout","onBlur");jo(O0,"onTransitionEnd");Js("onMouseEnter",["mouseout","mouseover"]);Js("onMouseLeave",["mouseout","mouseover"]);Js("onPointerEnter",["pointerout","pointerover"]);Js("onPointerLeave",["pointerout","pointerover"]);Mi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Mi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Mi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Mi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Mi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Mi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dl="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(" "),DD=new Set("cancel close invalid load scroll toggle".split(" ").concat(Dl));function dw(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,DO(r,t,void 0,e),e.currentTarget=null}function U0(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;dw(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;dw(o,a,c),i=l}}}if(Hd)throw e=Cg,Hd=!1,Cg=null,e}function ze(e,t){var n=t[Og];n===void 0&&(n=t[Og]=new Set);var r=e+"__bubble";n.has(r)||(F0(t,e,2,!1),n.add(r))}function Qh(e,t,n){var r=0;t&&(r|=4),F0(n,e,r,t)}var Ed="_reactListening"+Math.random().toString(36).slice(2);function ec(e){if(!e[Ed]){e[Ed]=!0,Gw.forEach(function(n){n!=="selectionchange"&&(DD.has(n)||Qh(n,!1,e),Qh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ed]||(t[Ed]=!0,Qh("selectionchange",!1,t))}}function F0(e,t,n,r){switch(E0(t)){case 1:var o=QO;break;case 4:o=ZO;break;default:o=fy}n=o.bind(null,t,n,e),o=void 0,!wg||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 Zh(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=Ti(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}a0(function(){var c=i,u=ly(n),d=[];e:{var p=D0.get(e);if(p!==void 0){var h=my,y=e;switch(e){case"keypress":if(Nd(n)===0)break e;case"keydown":case"keyup":h=mD;break;case"focusin":y="focus",h=Kh;break;case"focusout":y="blur",h=Kh;break;case"beforeblur":case"afterblur":h=Kh;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=QI;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=nD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=yD;break;case M0:case P0:case L0:h=iD;break;case O0:h=_D;break;case"scroll":h=eD;break;case"wheel":h=ED;break;case"copy":case"cut":case"paste":h=aD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=ew}var _=(t&4)!==0,T=!_&&e==="scroll",g=_?p!==null?p+"Capture":null:p;_=[];for(var S=c,E;S!==null;){E=S;var x=E.stateNode;if(E.tag===5&&x!==null&&(E=x,g!==null&&(x=Yl(S,g),x!=null&&_.push(tc(S,x,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!==Tg&&(y=n.relatedTarget||n.fromElement)&&(Ti(y)||y[to]))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?Ti(y):null,y!==null&&(T=Pi(y),y!==T||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=c),h!==y)){if(_=QI,x="onMouseLeave",g="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(_=ew,x="onPointerLeave",g="onPointerEnter",S="pointer"),T=h==null?p:Us(h),E=y==null?p:Us(y),p=new _(x,S+"leave",h,n,u),p.target=T,p.relatedTarget=E,x=null,Ti(u)===c&&(_=new _(g,S+"enter",y,n,u),_.target=E,_.relatedTarget=T,x=_),T=x,h&&y)t:{for(_=h,g=y,S=0,E=_;E;E=As(E))S++;for(E=0,x=g;x;x=As(x))E++;for(;0<S-E;)_=As(_),S--;for(;0<E-S;)g=As(g),E--;for(;S--;){if(_===g||g!==null&&_===g.alternate)break t;_=As(_),g=As(g)}_=null}else _=null;h!==null&&fw(d,p,h,_,!1),y!==null&&T!==null&&fw(d,T,y,_,!0)}}e:{if(p=c?Us(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var M=bD;else if(rw(p))if(R0)M=MD;else{M=ND;var A=kD}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(M=AD);if(M&&(M=M(e,c))){x0(d,M,n,u);break e}A&&A(e,p,c),e==="focusout"&&(A=p._wrapperState)&&A.controlled&&p.type==="number"&&yg(p,"number",p.value)}switch(A=c?Us(c):window,e){case"focusin":(rw(A)||A.contentEditable==="true")&&(Os=A,kg=c,$l=null);break;case"focusout":$l=kg=Os=null;break;case"mousedown":Ng=!0;break;case"contextmenu":case"mouseup":case"dragend":Ng=!1,aw(d,n,u);break;case"selectionchange":if(OD)break;case"keydown":case"keyup":aw(d,n,u)}var I;if(gy)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 Ls?w0(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(I0&&n.locale!=="ko"&&(Ls||N!=="onCompositionStart"?N==="onCompositionEnd"&&Ls&&(I=T0()):(Ao=u,py="value"in Ao?Ao.value:Ao.textContent,Ls=!0)),A=Gd(c,N),0<A.length&&(N=new ZI(N,e,null,n,u),d.push({event:N,listeners:A}),I?N.data=I:(I=C0(n),I!==null&&(N.data=I)))),(I=ID?wD(e,n):CD(e,n))&&(c=Gd(c,"onBeforeInput"),0<c.length&&(u=new ZI("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=I))}U0(d,t)})}function tc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Gd(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Yl(e,n),i!=null&&r.unshift(tc(e,i,o)),i=Yl(e,t),i!=null&&r.push(tc(e,i,o))),e=e.return}return r}function As(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function fw(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=Yl(n,i),l!=null&&s.unshift(tc(n,l,a))):o||(l=Yl(n,i),l!=null&&s.push(tc(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var UD=/\r\n?/g,FD=/\u0000|\uFFFD/g;function pw(e){return(typeof e=="string"?e:""+e).replace(UD,`
6
+ `).replace(FD,"")}function Td(e,t,n){if(t=pw(t),pw(e)!==t&&n)throw Error(L(425))}function Vd(){}var Ag=null,Mg=null;function Pg(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 Lg=typeof setTimeout=="function"?setTimeout:void 0,BD=typeof clearTimeout=="function"?clearTimeout:void 0,mw=typeof Promise=="function"?Promise:void 0,HD=typeof queueMicrotask=="function"?queueMicrotask:typeof mw<"u"?function(e){return mw.resolve(null).then(e).catch($D)}:Lg;function $D(e){setTimeout(function(){throw e})}function eg(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),Xl(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Xl(t)}function Do(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 hw(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 oa=Math.random().toString(36).slice(2),Rr="__reactFiber$"+oa,nc="__reactProps$"+oa,to="__reactContainer$"+oa,Og="__reactEvents$"+oa,zD="__reactListeners$"+oa,jD="__reactHandles$"+oa;function Ti(e){var t=e[Rr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[to]||n[Rr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=hw(e);e!==null;){if(n=e[Rr])return n;e=hw(e)}return t}e=n,n=e.parentNode}return null}function dc(e){return e=e[Rr]||e[to],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Us(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(L(33))}function pf(e){return e[nc]||null}var Dg=[],Fs=-1;function Wo(e){return{current:e}}function je(e){0>Fs||(e.current=Dg[Fs],Dg[Fs]=null,Fs--)}function Ue(e,t){Fs++,Dg[Fs]=e.current,e.current=t}var zo={},Ht=Wo(zo),un=Wo(!1),Ri=zo;function Xs(e,t){var n=e.type.contextTypes;if(!n)return zo;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 dn(e){return e=e.childContextTypes,e!=null}function qd(){je(un),je(Ht)}function gw(e,t,n){if(Ht.current!==zo)throw Error(L(168));Ue(Ht,t),Ue(un,n)}function B0(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,kO(e)||"Unknown",o));return Xe({},n,r)}function Yd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zo,Ri=Ht.current,Ue(Ht,e),Ue(un,un.current),!0}function yw(e,t,n){var r=e.stateNode;if(!r)throw Error(L(169));n?(e=B0(e,t,Ri),r.__reactInternalMemoizedMergedChildContext=e,je(un),je(Ht),Ue(Ht,e)):je(un),Ue(un,n)}var Jr=null,mf=!1,tg=!1;function H0(e){Jr===null?Jr=[e]:Jr.push(e)}function WD(e){mf=!0,H0(e)}function Go(){if(!tg&&Jr!==null){tg=!0;var e=0,t=Ne;try{var n=Jr;for(Ne=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Jr=null,mf=!1}catch(o){throw Jr!==null&&(Jr=Jr.slice(e+1)),d0(cy,Go),o}finally{Ne=t,tg=!1}}return null}var Bs=[],Hs=0,Kd=null,Jd=0,$n=[],zn=0,bi=null,Xr=1,Qr="";function vi(e,t){Bs[Hs++]=Jd,Bs[Hs++]=Kd,Kd=e,Jd=t}function $0(e,t,n){$n[zn++]=Xr,$n[zn++]=Qr,$n[zn++]=bi,bi=e;var r=Xr;e=Qr;var o=32-dr(r)-1;r&=~(1<<o),n+=1;var i=32-dr(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,Xr=1<<32-dr(t)+o|n<<o|r,Qr=i+e}else Xr=1<<i|n<<o|r,Qr=e}function Sy(e){e.return!==null&&(vi(e,1),$0(e,1,0))}function _y(e){for(;e===Kd;)Kd=Bs[--Hs],Bs[Hs]=null,Jd=Bs[--Hs],Bs[Hs]=null;for(;e===bi;)bi=$n[--zn],$n[zn]=null,Qr=$n[--zn],$n[zn]=null,Xr=$n[--zn],$n[zn]=null}var In=null,Tn=null,Ve=!1,ur=null;function z0(e,t){var n=jn(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 Sw(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,In=e,Tn=Do(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,In=e,Tn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=bi!==null?{id:Xr,overflow:Qr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=jn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,In=e,Tn=null,!0):!1;default:return!1}}function Ug(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Fg(e){if(Ve){var t=Tn;if(t){var n=t;if(!Sw(e,t)){if(Ug(e))throw Error(L(418));t=Do(n.nextSibling);var r=In;t&&Sw(e,t)?z0(r,n):(e.flags=e.flags&-4097|2,Ve=!1,In=e)}}else{if(Ug(e))throw Error(L(418));e.flags=e.flags&-4097|2,Ve=!1,In=e}}}function _w(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;In=e}function Id(e){if(e!==In)return!1;if(!Ve)return _w(e),Ve=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Pg(e.type,e.memoizedProps)),t&&(t=Tn)){if(Ug(e))throw j0(),Error(L(418));for(;t;)z0(e,t),t=Do(t.nextSibling)}if(_w(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){Tn=Do(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Tn=null}}else Tn=In?Do(e.stateNode.nextSibling):null;return!0}function j0(){for(var e=Tn;e;)e=Do(e.nextSibling)}function Qs(){Tn=In=null,Ve=!1}function vy(e){ur===null?ur=[e]:ur.push(e)}var GD=oo.ReactCurrentBatchConfig;function kl(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 wd(e,t){throw e=Object.prototype.toString.call(t),Error(L(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function vw(e){var t=e._init;return t(e._payload)}function W0(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=Ho(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,x){return S===null||S.tag!==6?(S=lg(E,g.mode,x),S.return=g,S):(S=o(S,E),S.return=g,S)}function l(g,S,E,x){var M=E.type;return M===Ps?u(g,S,E.props.children,x,E.key):S!==null&&(S.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===Ro&&vw(M)===S.type)?(x=o(S,E.props),x.ref=kl(g,S,E),x.return=g,x):(x=Ud(E.type,E.key,E.props,null,g.mode,x),x.ref=kl(g,S,E),x.return=g,x)}function c(g,S,E,x){return S===null||S.tag!==4||S.stateNode.containerInfo!==E.containerInfo||S.stateNode.implementation!==E.implementation?(S=cg(E,g.mode,x),S.return=g,S):(S=o(S,E.children||[]),S.return=g,S)}function u(g,S,E,x,M){return S===null||S.tag!==7?(S=xi(E,g.mode,x,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=lg(""+S,g.mode,E),S.return=g,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case cd:return E=Ud(S.type,S.key,S.props,null,g.mode,E),E.ref=kl(g,null,S),E.return=g,E;case Ms:return S=cg(S,g.mode,E),S.return=g,S;case Ro:var x=S._init;return d(g,x(S._payload),E)}if(Ll(S)||Cl(S))return S=xi(S,g.mode,E,null),S.return=g,S;wd(g,S)}return null}function p(g,S,E,x){var M=S!==null?S.key:null;if(typeof E=="string"&&E!==""||typeof E=="number")return M!==null?null:a(g,S,""+E,x);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case cd:return E.key===M?l(g,S,E,x):null;case Ms:return E.key===M?c(g,S,E,x):null;case Ro:return M=E._init,p(g,S,M(E._payload),x)}if(Ll(E)||Cl(E))return M!==null?null:u(g,S,E,x,null);wd(g,E)}return null}function h(g,S,E,x,M){if(typeof x=="string"&&x!==""||typeof x=="number")return g=g.get(E)||null,a(S,g,""+x,M);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case cd:return g=g.get(x.key===null?E:x.key)||null,l(S,g,x,M);case Ms:return g=g.get(x.key===null?E:x.key)||null,c(S,g,x,M);case Ro:var A=x._init;return h(g,S,E,A(x._payload),M)}if(Ll(x)||Cl(x))return g=g.get(E)||null,u(S,g,x,M,null);wd(S,x)}return null}function y(g,S,E,x){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 R=p(g,I,E[N],x);if(R===null){I===null&&(I=U);break}e&&I&&R.alternate===null&&t(g,I),S=i(R,S,N),A===null?M=R:A.sibling=R,A=R,I=U}if(N===E.length)return n(g,I),Ve&&vi(g,N),M;if(I===null){for(;N<E.length;N++)I=d(g,E[N],x),I!==null&&(S=i(I,S,N),A===null?M=I:A.sibling=I,A=I);return Ve&&vi(g,N),M}for(I=r(g,I);N<E.length;N++)U=h(I,g,N,E[N],x),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,$)}),Ve&&vi(g,N),M}function _(g,S,E,x){var M=Cl(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,R=E.next();I!==null&&!R.done;N++,R=E.next()){I.index>N?(U=I,I=null):U=I.sibling;var $=p(g,I,R.value,x);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(R.done)return n(g,I),Ve&&vi(g,N),M;if(I===null){for(;!R.done;N++,R=E.next())R=d(g,R.value,x),R!==null&&(S=i(R,S,N),A===null?M=R:A.sibling=R,A=R);return Ve&&vi(g,N),M}for(I=r(g,I);!R.done;N++,R=E.next())R=h(I,g,N,R.value,x),R!==null&&(e&&R.alternate!==null&&I.delete(R.key===null?N:R.key),S=i(R,S,N),A===null?M=R:A.sibling=R,A=R);return e&&I.forEach(function(j){return t(g,j)}),Ve&&vi(g,N),M}function T(g,S,E,x){if(typeof E=="object"&&E!==null&&E.type===Ps&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case cd:e:{for(var M=E.key,A=S;A!==null;){if(A.key===M){if(M=E.type,M===Ps){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===Ro&&vw(M)===A.type){n(g,A.sibling),S=o(A,E.props),S.ref=kl(g,A,E),S.return=g,g=S;break e}n(g,A);break}else t(g,A);A=A.sibling}E.type===Ps?(S=xi(E.props.children,g.mode,x,E.key),S.return=g,g=S):(x=Ud(E.type,E.key,E.props,null,g.mode,x),x.ref=kl(g,S,E),x.return=g,g=x)}return s(g);case Ms: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=cg(E,g.mode,x),S.return=g,g=S}return s(g);case Ro:return A=E._init,T(g,S,A(E._payload),x)}if(Ll(E))return y(g,S,E,x);if(Cl(E))return _(g,S,E,x);wd(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=lg(E,g.mode,x),S.return=g,g=S),s(g)):n(g,S)}return T}var Zs=W0(!0),G0=W0(!1),Xd=Wo(null),Qd=null,$s=null,Ey=null;function Ty(){Ey=$s=Qd=null}function Iy(e){var t=Xd.current;je(Xd),e._currentValue=t}function Bg(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 Ys(e,t){Qd=e,Ey=$s=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(cn=!0),e.firstContext=null)}function Gn(e){var t=e._currentValue;if(Ey!==e)if(e={context:e,memoizedValue:t,next:null},$s===null){if(Qd===null)throw Error(L(308));$s=e,Qd.dependencies={lanes:0,firstContext:e}}else $s=$s.next=e;return t}var Ii=null;function wy(e){Ii===null?Ii=[e]:Ii.push(e)}function V0(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,wy(t)):(n.next=o.next,o.next=n),t.interleaved=n,no(e,r)}function no(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 bo=!1;function Cy(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 Zr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Uo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ie&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,no(e,n)}return o=r.interleaved,o===null?(t.next=t,wy(r)):(t.next=o.next,o.next=t),r.interleaved=t,no(e,n)}function Ad(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,uy(e,n)}}function Ew(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 Zd(e,t,n,r){var o=e.updateQueue;bo=!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=Xe({},d,p);break e;case 2:bo=!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);Ni|=s,e.lanes=s,e.memoizedState=d}}function Tw(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 fc={},kr=Wo(fc),rc=Wo(fc),oc=Wo(fc);function wi(e){if(e===fc)throw Error(L(174));return e}function xy(e,t){switch(Ue(oc,t),Ue(rc,e),Ue(kr,fc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:_g(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=_g(t,e)}je(kr),Ue(kr,t)}function ea(){je(kr),je(rc),je(oc)}function Y0(e){wi(oc.current);var t=wi(kr.current),n=_g(t,e.type);t!==n&&(Ue(rc,e),Ue(kr,n))}function Ry(e){rc.current===e&&(je(kr),je(rc))}var Ke=Wo(0);function ef(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 ng=[];function by(){for(var e=0;e<ng.length;e++)ng[e]._workInProgressVersionPrimary=null;ng.length=0}var Md=oo.ReactCurrentDispatcher,rg=oo.ReactCurrentBatchConfig,ki=0,Je=null,ht=null,_t=null,tf=!1,zl=!1,ic=0,VD=0;function Ut(){throw Error(L(321))}function ky(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!pr(e[n],t[n]))return!1;return!0}function Ny(e,t,n,r,o,i){if(ki=i,Je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Md.current=e===null||e.memoizedState===null?JD:XD,e=n(r,o),zl){i=0;do{if(zl=!1,ic=0,25<=i)throw Error(L(301));i+=1,_t=ht=null,t.updateQueue=null,Md.current=QD,e=n(r,o)}while(zl)}if(Md.current=nf,t=ht!==null&&ht.next!==null,ki=0,_t=ht=Je=null,tf=!1,t)throw Error(L(300));return e}function Ay(){var e=ic!==0;return ic=0,e}function xr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?Je.memoizedState=_t=e:_t=_t.next=e,_t}function Vn(){if(ht===null){var e=Je.alternate;e=e!==null?e.memoizedState:null}else e=ht.next;var t=_t===null?Je.memoizedState:_t.next;if(t!==null)_t=t,ht=e;else{if(e===null)throw Error(L(310));ht=e,e={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},_t===null?Je.memoizedState=_t=e:_t=_t.next=e}return _t}function sc(e,t){return typeof t=="function"?t(e):t}function og(e){var t=Vn(),n=t.queue;if(n===null)throw Error(L(311));n.lastRenderedReducer=e;var r=ht,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((ki&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,Je.lanes|=u,Ni|=u}c=c.next}while(c!==null&&c!==i);l===null?s=r:l.next=a,pr(r,t.memoizedState)||(cn=!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,Je.lanes|=i,Ni|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ig(e){var t=Vn(),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);pr(i,t.memoizedState)||(cn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function K0(){}function J0(e,t){var n=Je,r=Vn(),o=t(),i=!pr(r.memoizedState,o);if(i&&(r.memoizedState=o,cn=!0),r=r.queue,My(Z0.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||_t!==null&&_t.memoizedState.tag&1){if(n.flags|=2048,ac(9,Q0.bind(null,n,r,o,t),void 0,null),vt===null)throw Error(L(349));(ki&30)!==0||X0(n,t,o)}return o}function X0(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Je.updateQueue,t===null?(t={lastEffect:null,stores:null},Je.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Q0(e,t,n,r){t.value=n,t.getSnapshot=r,eC(t)&&tC(e)}function Z0(e,t,n){return n(function(){eC(t)&&tC(e)})}function eC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!pr(e,n)}catch{return!0}}function tC(e){var t=no(e,1);t!==null&&fr(t,e,1,-1)}function Iw(e){var t=xr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:sc,lastRenderedState:e},t.queue=e,e=e.dispatch=KD.bind(null,Je,e),[t.memoizedState,e]}function ac(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Je.updateQueue,t===null?(t={lastEffect:null,stores:null},Je.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 nC(){return Vn().memoizedState}function Pd(e,t,n,r){var o=xr();Je.flags|=e,o.memoizedState=ac(1|t,n,void 0,r===void 0?null:r)}function hf(e,t,n,r){var o=Vn();r=r===void 0?null:r;var i=void 0;if(ht!==null){var s=ht.memoizedState;if(i=s.destroy,r!==null&&ky(r,s.deps)){o.memoizedState=ac(t,n,i,r);return}}Je.flags|=e,o.memoizedState=ac(1|t,n,i,r)}function ww(e,t){return Pd(8390656,8,e,t)}function My(e,t){return hf(2048,8,e,t)}function rC(e,t){return hf(4,2,e,t)}function oC(e,t){return hf(4,4,e,t)}function iC(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 sC(e,t,n){return n=n!=null?n.concat([e]):null,hf(4,4,iC.bind(null,t,e),n)}function Py(){}function aC(e,t){var n=Vn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ky(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function lC(e,t){var n=Vn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ky(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function cC(e,t,n){return(ki&21)===0?(e.baseState&&(e.baseState=!1,cn=!0),e.memoizedState=n):(pr(n,t)||(n=m0(),Je.lanes|=n,Ni|=n,e.baseState=!0),t)}function qD(e,t){var n=Ne;Ne=n!==0&&4>n?n:4,e(!0);var r=rg.transition;rg.transition={};try{e(!1),t()}finally{Ne=n,rg.transition=r}}function uC(){return Vn().memoizedState}function YD(e,t,n){var r=Bo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},dC(e))fC(t,n);else if(n=V0(e,t,n,r),n!==null){var o=Jt();fr(n,e,r,o),pC(n,t,r)}}function KD(e,t,n){var r=Bo(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(dC(e))fC(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,pr(a,s)){var l=t.interleaved;l===null?(o.next=o,wy(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}n=V0(e,t,o,r),n!==null&&(o=Jt(),fr(n,e,r,o),pC(n,t,r))}}function dC(e){var t=e.alternate;return e===Je||t!==null&&t===Je}function fC(e,t){zl=tf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pC(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,uy(e,n)}}var nf={readContext:Gn,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useInsertionEffect:Ut,useLayoutEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useMutableSource:Ut,useSyncExternalStore:Ut,useId:Ut,unstable_isNewReconciler:!1},JD={readContext:Gn,useCallback:function(e,t){return xr().memoizedState=[e,t===void 0?null:t],e},useContext:Gn,useEffect:ww,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Pd(4194308,4,iC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Pd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Pd(4,2,e,t)},useMemo:function(e,t){var n=xr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=xr();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=YD.bind(null,Je,e),[r.memoizedState,e]},useRef:function(e){var t=xr();return e={current:e},t.memoizedState=e},useState:Iw,useDebugValue:Py,useDeferredValue:function(e){return xr().memoizedState=e},useTransition:function(){var e=Iw(!1),t=e[0];return e=qD.bind(null,e[1]),xr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Je,o=xr();if(Ve){if(n===void 0)throw Error(L(407));n=n()}else{if(n=t(),vt===null)throw Error(L(349));(ki&30)!==0||X0(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,ww(Z0.bind(null,r,i,e),[e]),r.flags|=2048,ac(9,Q0.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=xr(),t=vt.identifierPrefix;if(Ve){var n=Qr,r=Xr;n=(r&~(1<<32-dr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ic++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=VD++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},XD={readContext:Gn,useCallback:aC,useContext:Gn,useEffect:My,useImperativeHandle:sC,useInsertionEffect:rC,useLayoutEffect:oC,useMemo:lC,useReducer:og,useRef:nC,useState:function(){return og(sc)},useDebugValue:Py,useDeferredValue:function(e){var t=Vn();return cC(t,ht.memoizedState,e)},useTransition:function(){var e=og(sc)[0],t=Vn().memoizedState;return[e,t]},useMutableSource:K0,useSyncExternalStore:J0,useId:uC,unstable_isNewReconciler:!1},QD={readContext:Gn,useCallback:aC,useContext:Gn,useEffect:My,useImperativeHandle:sC,useInsertionEffect:rC,useLayoutEffect:oC,useMemo:lC,useReducer:ig,useRef:nC,useState:function(){return ig(sc)},useDebugValue:Py,useDeferredValue:function(e){var t=Vn();return ht===null?t.memoizedState=e:cC(t,ht.memoizedState,e)},useTransition:function(){var e=ig(sc)[0],t=Vn().memoizedState;return[e,t]},useMutableSource:K0,useSyncExternalStore:J0,useId:uC,unstable_isNewReconciler:!1};function lr(e,t){if(e&&e.defaultProps){t=Xe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Hg(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Xe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var gf={isMounted:function(e){return(e=e._reactInternals)?Pi(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Jt(),o=Bo(e),i=Zr(r,o);i.payload=t,n!=null&&(i.callback=n),t=Uo(e,i,o),t!==null&&(fr(t,e,o,r),Ad(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Jt(),o=Bo(e),i=Zr(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Uo(e,i,o),t!==null&&(fr(t,e,o,r),Ad(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Jt(),r=Bo(e),o=Zr(n,r);o.tag=2,t!=null&&(o.callback=t),t=Uo(e,o,r),t!==null&&(fr(t,e,r,n),Ad(t,e,r))}};function Cw(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?!Zl(n,r)||!Zl(o,i):!0}function mC(e,t,n){var r=!1,o=zo,i=t.contextType;return typeof i=="object"&&i!==null?i=Gn(i):(o=dn(t)?Ri:Ht.current,r=t.contextTypes,i=(r=r!=null)?Xs(e,o):zo),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=gf,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function xw(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&&gf.enqueueReplaceState(t,t.state,null)}function $g(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Cy(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Gn(i):(i=dn(t)?Ri:Ht.current,o.context=Xs(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Hg(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&&gf.enqueueReplaceState(o,o.state,null),Zd(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function ta(e,t){try{var n="",r=t;do n+=bO(r),r=r.return;while(r);var o=n}catch(i){o=`
7
+ Error generating stack: `+i.message+`
8
+ `+i.stack}return{value:e,source:t,stack:o,digest:null}}function sg(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function zg(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ZD=typeof WeakMap=="function"?WeakMap:Map;function hC(e,t,n){n=Zr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){of||(of=!0,Qg=r),zg(e,t)},n}function gC(e,t,n){n=Zr(-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(){zg(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){zg(e,t),typeof r!="function"&&(Fo===null?Fo=new Set([this]):Fo.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Rw(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ZD;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=pU.bind(null,e,t,n),t.then(e,e))}function bw(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 kw(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=Zr(-1,1),t.tag=2,Uo(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var eU=oo.ReactCurrentOwner,cn=!1;function Kt(e,t,n,r){t.child=e===null?G0(t,null,n,r):Zs(t,e.child,n,r)}function Nw(e,t,n,r,o){n=n.render;var i=t.ref;return Ys(t,o),r=Ny(e,t,n,r,i,o),n=Ay(),e!==null&&!cn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ro(e,t,o)):(Ve&&n&&Sy(t),t.flags|=1,Kt(e,t,r,o),t.child)}function Aw(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!$y(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,yC(e,t,i,r,o)):(e=Ud(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:Zl,n(s,r)&&e.ref===t.ref)return ro(e,t,o)}return t.flags|=1,e=Ho(i,r),e.ref=t.ref,e.return=t,t.child=e}function yC(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Zl(i,r)&&e.ref===t.ref)if(cn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)(e.flags&131072)!==0&&(cn=!0);else return t.lanes=e.lanes,ro(e,t,o)}return jg(e,t,n,r,o)}function SC(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},Ue(js,En),En|=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,Ue(js,En),En|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Ue(js,En),En|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Ue(js,En),En|=r;return Kt(e,t,o,n),t.child}function _C(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=dn(n)?Ri:Ht.current;return i=Xs(t,i),Ys(t,o),n=Ny(e,t,n,r,i,o),r=Ay(),e!==null&&!cn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ro(e,t,o)):(Ve&&r&&Sy(t),t.flags|=1,Kt(e,t,n,o),t.child)}function Mw(e,t,n,r,o){if(dn(n)){var i=!0;Yd(t)}else i=!1;if(Ys(t,o),t.stateNode===null)Ld(e,t),mC(t,n,r),$g(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=Gn(c):(c=dn(n)?Ri:Ht.current,c=Xs(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)&&xw(t,s,r,c),bo=!1;var p=t.memoizedState;s.state=p,Zd(t,r,s,o),l=t.memoizedState,a!==r||p!==l||un.current||bo?(typeof u=="function"&&(Hg(t,n,u,r),l=t.memoizedState),(a=bo||Cw(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:lr(t.type,a),s.props=c,d=t.pendingProps,p=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Gn(l):(l=dn(n)?Ri:Ht.current,l=Xs(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)&&xw(t,s,r,l),bo=!1,p=t.memoizedState,s.state=p,Zd(t,r,s,o);var y=t.memoizedState;a!==d||p!==y||un.current||bo?(typeof h=="function"&&(Hg(t,n,h,r),y=t.memoizedState),(c=bo||Cw(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 Wg(e,t,n,r,i,o)}function Wg(e,t,n,r,o,i){_C(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&yw(t,n,!1),ro(e,t,i);r=t.stateNode,eU.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Zs(t,e.child,null,i),t.child=Zs(t,null,a,i)):Kt(e,t,a,i),t.memoizedState=r.state,o&&yw(t,n,!0),t.child}function vC(e){var t=e.stateNode;t.pendingContext?gw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&gw(e,t.context,!1),xy(e,t.containerInfo)}function Pw(e,t,n,r,o){return Qs(),vy(o),t.flags|=256,Kt(e,t,n,r),t.child}var Gg={dehydrated:null,treeContext:null,retryLane:0};function Vg(e){return{baseLanes:e,cachePool:null,transitions:null}}function EC(e,t,n){var r=t.pendingProps,o=Ke.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),Ue(Ke,o&1),e===null)return Fg(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=_f(s,r,0,null),e=xi(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Vg(n),t.memoizedState=Gg,e):Ly(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return tU(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=Ho(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Ho(a,i):(i=xi(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?Vg(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Gg,r}return i=e.child,e=i.sibling,r=Ho(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 Ly(e,t){return t=_f({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Cd(e,t,n,r){return r!==null&&vy(r),Zs(t,e.child,null,n),e=Ly(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tU(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=sg(Error(L(422))),Cd(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=_f({mode:"visible",children:r.children},o,0,null),i=xi(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,(t.mode&1)!==0&&Zs(t,e.child,null,s),t.child.memoizedState=Vg(s),t.memoizedState=Gg,i);if((t.mode&1)===0)return Cd(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=sg(i,r,void 0),Cd(e,t,s,r)}if(a=(s&e.childLanes)!==0,cn||a){if(r=vt,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,no(e,o),fr(r,e,o,-1))}return Hy(),r=sg(Error(L(421))),Cd(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=mU.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Tn=Do(o.nextSibling),In=t,Ve=!0,ur=null,e!==null&&($n[zn++]=Xr,$n[zn++]=Qr,$n[zn++]=bi,Xr=e.id,Qr=e.overflow,bi=t),t=Ly(t,r.children),t.flags|=4096,t)}function Lw(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Bg(e.return,t,n)}function ag(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 TC(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Kt(e,t,r.children,n),r=Ke.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&&Lw(e,n,t);else if(e.tag===19)Lw(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(Ue(Ke,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&&ef(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ag(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&&ef(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ag(t,!0,n,null,i);break;case"together":ag(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ld(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ro(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ni|=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=Ho(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ho(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function nU(e,t,n){switch(t.tag){case 3:vC(t),Qs();break;case 5:Y0(t);break;case 1:dn(t.type)&&Yd(t);break;case 4:xy(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Ue(Xd,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ue(Ke,Ke.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?EC(e,t,n):(Ue(Ke,Ke.current&1),e=ro(e,t,n),e!==null?e.sibling:null);Ue(Ke,Ke.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return TC(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ue(Ke,Ke.current),r)break;return null;case 22:case 23:return t.lanes=0,SC(e,t,n)}return ro(e,t,n)}var IC,qg,wC,CC;IC=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(){};wC=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,wi(kr.current);var i=null;switch(n){case"input":o=hg(e,o),r=hg(e,r),i=[];break;case"select":o=Xe({},o,{value:void 0}),r=Xe({},r,{value:void 0}),i=[];break;case"textarea":o=Sg(e,o),r=Sg(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Vd)}vg(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"&&(Vl.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"&&(Vl.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&ze("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)}};CC=function(e,t,n,r){n!==r&&(t.flags|=4)};function Nl(e,t){if(!Ve)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 Ft(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 rU(e,t,n){var r=t.pendingProps;switch(_y(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ft(t),null;case 1:return dn(t.type)&&qd(),Ft(t),null;case 3:return r=t.stateNode,ea(),je(un),je(Ht),by(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Id(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ur!==null&&(ty(ur),ur=null))),qg(e,t),Ft(t),null;case 5:Ry(t);var o=wi(oc.current);if(n=t.type,e!==null&&t.stateNode!=null)wC(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 Ft(t),null}if(e=wi(kr.current),Id(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Rr]=t,r[nc]=i,e=(t.mode&1)!==0,n){case"dialog":ze("cancel",r),ze("close",r);break;case"iframe":case"object":case"embed":ze("load",r);break;case"video":case"audio":for(o=0;o<Dl.length;o++)ze(Dl[o],r);break;case"source":ze("error",r);break;case"img":case"image":case"link":ze("error",r),ze("load",r);break;case"details":ze("toggle",r);break;case"input":zI(r,i),ze("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ze("invalid",r);break;case"textarea":WI(r,i),ze("invalid",r)}vg(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&&Td(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Td(r.textContent,a,e),o=["children",""+a]):Vl.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&ze("scroll",r)}switch(n){case"input":ud(r),jI(r,i,!0);break;case"textarea":ud(r),GI(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Vd)}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=Zw(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[Rr]=t,e[nc]=r,IC(e,t,!1,!1),t.stateNode=e;e:{switch(s=Eg(n,r),n){case"dialog":ze("cancel",e),ze("close",e),o=r;break;case"iframe":case"object":case"embed":ze("load",e),o=r;break;case"video":case"audio":for(o=0;o<Dl.length;o++)ze(Dl[o],e);o=r;break;case"source":ze("error",e),o=r;break;case"img":case"image":case"link":ze("error",e),ze("load",e),o=r;break;case"details":ze("toggle",e),o=r;break;case"input":zI(e,r),o=hg(e,r),ze("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Xe({},r,{value:void 0}),ze("invalid",e);break;case"textarea":WI(e,r),o=Sg(e,r),ze("invalid",e);break;default:o=r}vg(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?n0(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&e0(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&ql(e,l):typeof l=="number"&&ql(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Vl.hasOwnProperty(i)?l!=null&&i==="onScroll"&&ze("scroll",e):l!=null&&oy(e,i,l,s))}switch(n){case"input":ud(e),jI(e,r,!1);break;case"textarea":ud(e),GI(e);break;case"option":r.value!=null&&e.setAttribute("value",""+$o(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Ws(e,!!r.multiple,i,!1):r.defaultValue!=null&&Ws(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Vd)}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 Ft(t),null;case 6:if(e&&t.stateNode!=null)CC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(L(166));if(n=wi(oc.current),wi(kr.current),Id(t)){if(r=t.stateNode,n=t.memoizedProps,r[Rr]=t,(i=r.nodeValue!==n)&&(e=In,e!==null))switch(e.tag){case 3:Td(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Td(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Rr]=t,t.stateNode=r}return Ft(t),null;case 13:if(je(Ke),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ve&&Tn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)j0(),Qs(),t.flags|=98560,i=!1;else if(i=Id(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[Rr]=t}else Qs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ft(t),i=!1}else ur!==null&&(ty(ur),ur=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||(Ke.current&1)!==0?gt===0&&(gt=3):Hy())),t.updateQueue!==null&&(t.flags|=4),Ft(t),null);case 4:return ea(),qg(e,t),e===null&&ec(t.stateNode.containerInfo),Ft(t),null;case 10:return Iy(t.type._context),Ft(t),null;case 17:return dn(t.type)&&qd(),Ft(t),null;case 19:if(je(Ke),i=t.memoizedState,i===null)return Ft(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Nl(i,!1);else{if(gt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=ef(e),s!==null){for(t.flags|=128,Nl(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 Ue(Ke,Ke.current&1|2),t.child}e=e.sibling}i.tail!==null&&it()>na&&(t.flags|=128,r=!0,Nl(i,!1),t.lanes=4194304)}else{if(!r)if(e=ef(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Nl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Ve)return Ft(t),null}else 2*it()-i.renderingStartTime>na&&n!==1073741824&&(t.flags|=128,r=!0,Nl(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=it(),t.sibling=null,n=Ke.current,Ue(Ke,r?n&1|2:n&1),t):(Ft(t),null);case 22:case 23:return By(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(En&1073741824)!==0&&(Ft(t),t.subtreeFlags&6&&(t.flags|=8192)):Ft(t),null;case 24:return null;case 25:return null}throw Error(L(156,t.tag))}function oU(e,t){switch(_y(t),t.tag){case 1:return dn(t.type)&&qd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ea(),je(un),je(Ht),by(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Ry(t),null;case 13:if(je(Ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));Qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return je(Ke),null;case 4:return ea(),null;case 10:return Iy(t.type._context),null;case 22:case 23:return By(),null;case 24:return null;default:return null}}var xd=!1,Bt=!1,iU=typeof WeakSet=="function"?WeakSet:Set,H=null;function zs(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){tt(e,t,r)}else n.current=null}function Yg(e,t,n){try{n()}catch(r){tt(e,t,r)}}var Ow=!1;function sU(e,t){if(Ag=jd,e=N0(),yy(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(Mg={focusedElem:e,selectionRange:n},jd=!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?_:lr(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(x){tt(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,H=e;break}H=t.return}return y=Ow,Ow=!1,y}function jl(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&&Yg(t,n,i)}o=o.next}while(o!==r)}}function yf(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 Kg(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 xC(e){var t=e.alternate;t!==null&&(e.alternate=null,xC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Rr],delete t[nc],delete t[Og],delete t[zD],delete t[jD])),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 RC(e){return e.tag===5||e.tag===3||e.tag===4}function Dw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||RC(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 Jg(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=Vd));else if(r!==4&&(e=e.child,e!==null))for(Jg(e,t,n),e=e.sibling;e!==null;)Jg(e,t,n),e=e.sibling}function Xg(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(Xg(e,t,n),e=e.sibling;e!==null;)Xg(e,t,n),e=e.sibling}var Ct=null,cr=!1;function xo(e,t,n){for(n=n.child;n!==null;)bC(e,t,n),n=n.sibling}function bC(e,t,n){if(br&&typeof br.onCommitFiberUnmount=="function")try{br.onCommitFiberUnmount(cf,n)}catch{}switch(n.tag){case 5:Bt||zs(n,t);case 6:var r=Ct,o=cr;Ct=null,xo(e,t,n),Ct=r,cr=o,Ct!==null&&(cr?(e=Ct,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ct.removeChild(n.stateNode));break;case 18:Ct!==null&&(cr?(e=Ct,n=n.stateNode,e.nodeType===8?eg(e.parentNode,n):e.nodeType===1&&eg(e,n),Xl(e)):eg(Ct,n.stateNode));break;case 4:r=Ct,o=cr,Ct=n.stateNode.containerInfo,cr=!0,xo(e,t,n),Ct=r,cr=o;break;case 0:case 11:case 14:case 15:if(!Bt&&(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)&&Yg(n,t,s),o=o.next}while(o!==r)}xo(e,t,n);break;case 1:if(!Bt&&(zs(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){tt(n,t,a)}xo(e,t,n);break;case 21:xo(e,t,n);break;case 22:n.mode&1?(Bt=(r=Bt)||n.memoizedState!==null,xo(e,t,n),Bt=r):xo(e,t,n);break;default:xo(e,t,n)}}function Uw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new iU),t.forEach(function(r){var o=hU.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function ar(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:Ct=a.stateNode,cr=!1;break e;case 3:Ct=a.stateNode.containerInfo,cr=!0;break e;case 4:Ct=a.stateNode.containerInfo,cr=!0;break e}a=a.return}if(Ct===null)throw Error(L(160));bC(i,s,o),Ct=null,cr=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(c){tt(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)kC(t,e),t=t.sibling}function kC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ar(t,e),Cr(e),r&4){try{jl(3,e,e.return),yf(3,e)}catch(_){tt(e,e.return,_)}try{jl(5,e,e.return)}catch(_){tt(e,e.return,_)}}break;case 1:ar(t,e),Cr(e),r&512&&n!==null&&zs(n,n.return);break;case 5:if(ar(t,e),Cr(e),r&512&&n!==null&&zs(n,n.return),e.flags&32){var o=e.stateNode;try{ql(o,"")}catch(_){tt(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&&Xw(o,i),Eg(a,s);var c=Eg(a,i);for(s=0;s<l.length;s+=2){var u=l[s],d=l[s+1];u==="style"?n0(o,d):u==="dangerouslySetInnerHTML"?e0(o,d):u==="children"?ql(o,d):oy(o,u,d,c)}switch(a){case"input":gg(o,i);break;case"textarea":Qw(o,i);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Ws(o,!!i.multiple,h,!1):p!==!!i.multiple&&(i.defaultValue!=null?Ws(o,!!i.multiple,i.defaultValue,!0):Ws(o,!!i.multiple,i.multiple?[]:"",!1))}o[nc]=i}catch(_){tt(e,e.return,_)}}break;case 6:if(ar(t,e),Cr(e),r&4){if(e.stateNode===null)throw Error(L(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(_){tt(e,e.return,_)}}break;case 3:if(ar(t,e),Cr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Xl(t.containerInfo)}catch(_){tt(e,e.return,_)}break;case 4:ar(t,e),Cr(e);break;case 13:ar(t,e),Cr(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Uy=it())),r&4&&Uw(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(Bt=(c=Bt)||u,ar(t,e),Bt=c):ar(t,e),Cr(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:jl(4,p,p.return);break;case 1:zs(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(_){tt(r,n,_)}}break;case 5:zs(p,p.return);break;case 22:if(p.memoizedState!==null){Bw(d);continue}}h!==null?(h.return=p,H=h):Bw(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=t0("display",s))}catch(_){tt(e,e.return,_)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(_){tt(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:ar(t,e),Cr(e),r&4&&Uw(e);break;case 21:break;default:ar(t,e),Cr(e)}}function Cr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(RC(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&&(ql(o,""),r.flags&=-33);var i=Dw(e);Xg(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=Dw(e);Jg(e,a,s);break;default:throw Error(L(161))}}catch(l){tt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function aU(e,t,n){H=e,NC(e,t,n)}function NC(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||xd;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||Bt;a=xd;var c=Bt;if(xd=s,(Bt=l)&&!c)for(H=o;H!==null;)s=H,l=s.child,s.tag===22&&s.memoizedState!==null?Hw(o):l!==null?(l.return=s,H=l):Hw(o);for(;i!==null;)H=i,NC(i,t,n),i=i.sibling;H=o,xd=a,Bt=c}Fw(e,t,n)}else(o.subtreeFlags&8772)!==0&&i!==null?(i.return=o,H=i):Fw(e,t,n)}}function Fw(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:Bt||yf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Bt)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:lr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Tw(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}Tw(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&&Xl(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(L(163))}Bt||t.flags&512&&Kg(t)}catch(p){tt(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 Bw(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 Hw(e){for(;H!==null;){var t=H;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{yf(4,t)}catch(l){tt(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){tt(t,o,l)}}var i=t.return;try{Kg(t)}catch(l){tt(t,i,l)}break;case 5:var s=t.return;try{Kg(t)}catch(l){tt(t,s,l)}}}catch(l){tt(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 lU=Math.ceil,rf=oo.ReactCurrentDispatcher,Oy=oo.ReactCurrentOwner,Wn=oo.ReactCurrentBatchConfig,Ie=0,vt=null,ut=null,xt=0,En=0,js=Wo(0),gt=0,lc=null,Ni=0,Sf=0,Dy=0,Wl=null,ln=null,Uy=0,na=1/0,Kr=null,of=!1,Qg=null,Fo=null,Rd=!1,Mo=null,sf=0,Gl=0,Zg=null,Od=-1,Dd=0;function Jt(){return(Ie&6)!==0?it():Od!==-1?Od:Od=it()}function Bo(e){return(e.mode&1)===0?1:(Ie&2)!==0&&xt!==0?xt&-xt:GD.transition!==null?(Dd===0&&(Dd=m0()),Dd):(e=Ne,e!==0||(e=window.event,e=e===void 0?16:E0(e.type)),e)}function fr(e,t,n,r){if(50<Gl)throw Gl=0,Zg=null,Error(L(185));cc(e,n,r),((Ie&2)===0||e!==vt)&&(e===vt&&((Ie&2)===0&&(Sf|=n),gt===4&&No(e,xt)),fn(e,r),n===1&&Ie===0&&(t.mode&1)===0&&(na=it()+500,mf&&Go()))}function fn(e,t){var n=e.callbackNode;qO(e,t);var r=zd(e,e===vt?xt:0);if(r===0)n!==null&&YI(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&YI(n),t===1)e.tag===0?WD($w.bind(null,e)):H0($w.bind(null,e)),HD(function(){(Ie&6)===0&&Go()}),n=null;else{switch(h0(r)){case 1:n=cy;break;case 4:n=f0;break;case 16:n=$d;break;case 536870912:n=p0;break;default:n=$d}n=FC(n,AC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function AC(e,t){if(Od=-1,Dd=0,(Ie&6)!==0)throw Error(L(327));var n=e.callbackNode;if(Ks()&&e.callbackNode!==n)return null;var r=zd(e,e===vt?xt:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=af(e,r);else{t=r;var o=Ie;Ie|=2;var i=PC();(vt!==e||xt!==t)&&(Kr=null,na=it()+500,Ci(e,t));do try{dU();break}catch(a){MC(e,a)}while(!0);Ty(),rf.current=i,Ie=o,ut!==null?t=0:(vt=null,xt=0,t=gt)}if(t!==0){if(t===2&&(o=xg(e),o!==0&&(r=o,t=ey(e,o))),t===1)throw n=lc,Ci(e,0),No(e,r),fn(e,it()),n;if(t===6)No(e,r);else{if(o=e.current.alternate,(r&30)===0&&!cU(o)&&(t=af(e,r),t===2&&(i=xg(e),i!==0&&(r=i,t=ey(e,i))),t===1))throw n=lc,Ci(e,0),No(e,r),fn(e,it()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(L(345));case 2:Ei(e,ln,Kr);break;case 3:if(No(e,r),(r&130023424)===r&&(t=Uy+500-it(),10<t)){if(zd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Jt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Lg(Ei.bind(null,e,ln,Kr),t);break}Ei(e,ln,Kr);break;case 4:if(No(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-dr(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=it()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*lU(r/1960))-r,10<r){e.timeoutHandle=Lg(Ei.bind(null,e,ln,Kr),r);break}Ei(e,ln,Kr);break;case 5:Ei(e,ln,Kr);break;default:throw Error(L(329))}}}return fn(e,it()),e.callbackNode===n?AC.bind(null,e):null}function ey(e,t){var n=Wl;return e.current.memoizedState.isDehydrated&&(Ci(e,t).flags|=256),e=af(e,t),e!==2&&(t=ln,ln=n,t!==null&&ty(t)),e}function ty(e){ln===null?ln=e:ln.push.apply(ln,e)}function cU(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(!pr(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 No(e,t){for(t&=~Dy,t&=~Sf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-dr(t),r=1<<n;e[n]=-1,t&=~r}}function $w(e){if((Ie&6)!==0)throw Error(L(327));Ks();var t=zd(e,0);if((t&1)===0)return fn(e,it()),null;var n=af(e,t);if(e.tag!==0&&n===2){var r=xg(e);r!==0&&(t=r,n=ey(e,r))}if(n===1)throw n=lc,Ci(e,0),No(e,t),fn(e,it()),n;if(n===6)throw Error(L(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ei(e,ln,Kr),fn(e,it()),null}function Fy(e,t){var n=Ie;Ie|=1;try{return e(t)}finally{Ie=n,Ie===0&&(na=it()+500,mf&&Go())}}function Ai(e){Mo!==null&&Mo.tag===0&&(Ie&6)===0&&Ks();var t=Ie;Ie|=1;var n=Wn.transition,r=Ne;try{if(Wn.transition=null,Ne=1,e)return e()}finally{Ne=r,Wn.transition=n,Ie=t,(Ie&6)===0&&Go()}}function By(){En=js.current,je(js)}function Ci(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,BD(n)),ut!==null)for(n=ut.return;n!==null;){var r=n;switch(_y(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&qd();break;case 3:ea(),je(un),je(Ht),by();break;case 5:Ry(r);break;case 4:ea();break;case 13:je(Ke);break;case 19:je(Ke);break;case 10:Iy(r.type._context);break;case 22:case 23:By()}n=n.return}if(vt=e,ut=e=Ho(e.current,null),xt=En=t,gt=0,lc=null,Dy=Sf=Ni=0,ln=Wl=null,Ii!==null){for(t=0;t<Ii.length;t++)if(n=Ii[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}Ii=null}return e}function MC(e,t){do{var n=ut;try{if(Ty(),Md.current=nf,tf){for(var r=Je.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}tf=!1}if(ki=0,_t=ht=Je=null,zl=!1,ic=0,Oy.current=null,n===null||n.return===null){gt=1,lc=t,ut=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=xt,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=bw(s);if(h!==null){h.flags&=-257,kw(h,s,a,i,t),h.mode&1&&Rw(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){Rw(i,c,t),Hy();break e}l=Error(L(426))}}else if(Ve&&a.mode&1){var T=bw(s);if(T!==null){(T.flags&65536)===0&&(T.flags|=256),kw(T,s,a,i,t),vy(ta(l,a));break e}}i=l=ta(l,a),gt!==4&&(gt=2),Wl===null?Wl=[i]:Wl.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=hC(i,l,t);Ew(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"&&(Fo===null||!Fo.has(E)))){i.flags|=65536,t&=-t,i.lanes|=t;var x=gC(i,a,t);Ew(i,x);break e}}i=i.return}while(i!==null)}OC(n)}catch(M){t=M,ut===n&&n!==null&&(ut=n=n.return);continue}break}while(!0)}function PC(){var e=rf.current;return rf.current=nf,e===null?nf:e}function Hy(){(gt===0||gt===3||gt===2)&&(gt=4),vt===null||(Ni&268435455)===0&&(Sf&268435455)===0||No(vt,xt)}function af(e,t){var n=Ie;Ie|=2;var r=PC();(vt!==e||xt!==t)&&(Kr=null,Ci(e,t));do try{uU();break}catch(o){MC(e,o)}while(!0);if(Ty(),Ie=n,rf.current=r,ut!==null)throw Error(L(261));return vt=null,xt=0,gt}function uU(){for(;ut!==null;)LC(ut)}function dU(){for(;ut!==null&&!FO();)LC(ut)}function LC(e){var t=UC(e.alternate,e,En);e.memoizedProps=e.pendingProps,t===null?OC(e):ut=t,Oy.current=null}function OC(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=rU(n,t,En),n!==null){ut=n;return}}else{if(n=oU(n,t),n!==null){n.flags&=32767,ut=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{gt=6,ut=null;return}}if(t=t.sibling,t!==null){ut=t;return}ut=t=e}while(t!==null);gt===0&&(gt=5)}function Ei(e,t,n){var r=Ne,o=Wn.transition;try{Wn.transition=null,Ne=1,fU(e,t,n,r)}finally{Wn.transition=o,Ne=r}return null}function fU(e,t,n,r){do Ks();while(Mo!==null);if((Ie&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(YO(e,i),e===vt&&(ut=vt=null,xt=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Rd||(Rd=!0,FC($d,function(){return Ks(),null})),i=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||i){i=Wn.transition,Wn.transition=null;var s=Ne;Ne=1;var a=Ie;Ie|=4,Oy.current=null,sU(e,n),kC(n,e),LD(Mg),jd=!!Ag,Mg=Ag=null,e.current=n,aU(n,e,o),BO(),Ie=a,Ne=s,Wn.transition=i}else e.current=n;if(Rd&&(Rd=!1,Mo=e,sf=o),i=e.pendingLanes,i===0&&(Fo=null),zO(n.stateNode,r),fn(e,it()),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(of)throw of=!1,e=Qg,Qg=null,e;return(sf&1)!==0&&e.tag!==0&&Ks(),i=e.pendingLanes,(i&1)!==0?e===Zg?Gl++:(Gl=0,Zg=e):Gl=0,Go(),null}function Ks(){if(Mo!==null){var e=h0(sf),t=Wn.transition,n=Ne;try{if(Wn.transition=null,Ne=16>e?16:e,Mo===null)var r=!1;else{if(e=Mo,Mo=null,sf=0,(Ie&6)!==0)throw Error(L(331));var o=Ie;for(Ie|=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:jl(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(xC(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:jl(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:yf(9,a)}}catch(M){tt(a,a.return,M)}if(a===s){H=null;break e}var x=a.sibling;if(x!==null){x.return=a.return,H=x;break e}H=a.return}}if(Ie=o,Go(),br&&typeof br.onPostCommitFiberRoot=="function")try{br.onPostCommitFiberRoot(cf,e)}catch{}r=!0}return r}finally{Ne=n,Wn.transition=t}}return!1}function zw(e,t,n){t=ta(n,t),t=hC(e,t,1),e=Uo(e,t,1),t=Jt(),e!==null&&(cc(e,1,t),fn(e,t))}function tt(e,t,n){if(e.tag===3)zw(e,e,n);else for(;t!==null;){if(t.tag===3){zw(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Fo===null||!Fo.has(r))){e=ta(n,e),e=gC(t,e,1),t=Uo(t,e,1),e=Jt(),t!==null&&(cc(t,1,e),fn(t,e));break}}t=t.return}}function pU(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Jt(),e.pingedLanes|=e.suspendedLanes&n,vt===e&&(xt&n)===n&&(gt===4||gt===3&&(xt&130023424)===xt&&500>it()-Uy?Ci(e,0):Dy|=n),fn(e,t)}function DC(e,t){t===0&&((e.mode&1)===0?t=1:(t=pd,pd<<=1,(pd&130023424)===0&&(pd=4194304)));var n=Jt();e=no(e,t),e!==null&&(cc(e,t,n),fn(e,n))}function mU(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),DC(e,n)}function hU(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),DC(e,n)}var UC;UC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||un.current)cn=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return cn=!1,nU(e,t,n);cn=(e.flags&131072)!==0}else cn=!1,Ve&&(t.flags&1048576)!==0&&$0(t,Jd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ld(e,t),e=t.pendingProps;var o=Xs(t,Ht.current);Ys(t,n),o=Ny(null,t,r,e,o,n);var i=Ay();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,dn(r)?(i=!0,Yd(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Cy(t),o.updater=gf,t.stateNode=o,o._reactInternals=t,$g(t,r,e,n),t=Wg(null,t,r,!0,i,n)):(t.tag=0,Ve&&i&&Sy(t),Kt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ld(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=yU(r),e=lr(r,e),o){case 0:t=jg(null,t,r,e,n);break e;case 1:t=Mw(null,t,r,e,n);break e;case 11:t=Nw(null,t,r,e,n);break e;case 14:t=Aw(null,t,r,lr(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:lr(r,o),jg(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:lr(r,o),Mw(e,t,r,o,n);case 3:e:{if(vC(t),e===null)throw Error(L(387));r=t.pendingProps,i=t.memoizedState,o=i.element,q0(e,t),Zd(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=ta(Error(L(423)),t),t=Pw(e,t,r,n,o);break e}else if(r!==o){o=ta(Error(L(424)),t),t=Pw(e,t,r,n,o);break e}else for(Tn=Do(t.stateNode.containerInfo.firstChild),In=t,Ve=!0,ur=null,n=G0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qs(),r===o){t=ro(e,t,n);break e}Kt(e,t,r,n)}t=t.child}return t;case 5:return Y0(t),e===null&&Fg(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Pg(r,o)?s=null:i!==null&&Pg(r,i)&&(t.flags|=32),_C(e,t),Kt(e,t,s,n),t.child;case 6:return e===null&&Fg(t),null;case 13:return EC(e,t,n);case 4:return xy(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zs(t,null,r,n):Kt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:lr(r,o),Nw(e,t,r,o,n);case 7:return Kt(e,t,t.pendingProps,n),t.child;case 8:return Kt(e,t,t.pendingProps.children,n),t.child;case 12:return Kt(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,Ue(Xd,r._currentValue),r._currentValue=s,i!==null)if(pr(i.value,s)){if(i.children===o.children&&!un.current){t=ro(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=Zr(-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),Bg(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),Bg(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}Kt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Ys(t,n),o=Gn(o),r=r(o),t.flags|=1,Kt(e,t,r,n),t.child;case 14:return r=t.type,o=lr(r,t.pendingProps),o=lr(r.type,o),Aw(e,t,r,o,n);case 15:return yC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:lr(r,o),Ld(e,t),t.tag=1,dn(r)?(e=!0,Yd(t)):e=!1,Ys(t,n),mC(t,r,o),$g(t,r,o,n),Wg(null,t,r,!0,e,n);case 19:return TC(e,t,n);case 22:return SC(e,t,n)}throw Error(L(156,t.tag))};function FC(e,t){return d0(e,t)}function gU(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 jn(e,t,n,r){return new gU(e,t,n,r)}function $y(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yU(e){if(typeof e=="function")return $y(e)?1:0;if(e!=null){if(e=e.$$typeof,e===sy)return 11;if(e===ay)return 14}return 2}function Ho(e,t){var n=e.alternate;return n===null?(n=jn(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 Ud(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")$y(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Ps:return xi(n.children,o,i,t);case iy:s=8,o|=8;break;case dg:return e=jn(12,n,t,o|2),e.elementType=dg,e.lanes=i,e;case fg:return e=jn(13,n,t,o),e.elementType=fg,e.lanes=i,e;case pg:return e=jn(19,n,t,o),e.elementType=pg,e.lanes=i,e;case Yw:return _f(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Vw:s=10;break e;case qw:s=9;break e;case sy:s=11;break e;case ay:s=14;break e;case Ro:s=16,r=null;break e}throw Error(L(130,e==null?e:typeof e,""))}return t=jn(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function xi(e,t,n,r){return e=jn(7,e,r,t),e.lanes=n,e}function _f(e,t,n,r){return e=jn(22,e,r,t),e.elementType=Yw,e.lanes=n,e.stateNode={isHidden:!1},e}function lg(e,t,n){return e=jn(6,e,null,t),e.lanes=n,e}function cg(e,t,n){return t=jn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function SU(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=Vh(0),this.expirationTimes=Vh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vh(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function zy(e,t,n,r,o,i,s,a,l){return e=new SU(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=jn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Cy(i),e}function _U(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ms,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function BC(e){if(!e)return zo;e=e._reactInternals;e:{if(Pi(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(dn(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(dn(n))return B0(e,n,t)}return t}function HC(e,t,n,r,o,i,s,a,l){return e=zy(n,r,!0,e,o,i,s,a,l),e.context=BC(null),n=e.current,r=Jt(),o=Bo(n),i=Zr(r,o),i.callback=t??null,Uo(n,i,o),e.current.lanes=o,cc(e,o,r),fn(e,r),e}function vf(e,t,n,r){var o=t.current,i=Jt(),s=Bo(o);return n=BC(n),t.context===null?t.context=n:t.pendingContext=n,t=Zr(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Uo(o,t,s),e!==null&&(fr(e,o,s,i),Ad(e,o,s)),s}function lf(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 vU(){return null}var $C=typeof reportError=="function"?reportError:function(e){console.error(e)};function Wy(e){this._internalRoot=e}Ef.prototype.render=Wy.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(L(409));vf(e,t,null,null)};Ef.prototype.unmount=Wy.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ai(function(){vf(null,e,null,null)}),t[to]=null}};function Ef(e){this._internalRoot=e}Ef.prototype.unstable_scheduleHydration=function(e){if(e){var t=S0();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ko.length&&t!==0&&t<ko[n].priority;n++);ko.splice(n,0,e),n===0&&v0(e)}};function Gy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Tf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ww(){}function EU(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=lf(s);i.call(c)}}var s=HC(t,r,e,0,null,!1,!1,"",Ww);return e._reactRootContainer=s,e[to]=s.current,ec(e.nodeType===8?e.parentNode:e),Ai(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=lf(l);a.call(c)}}var l=zy(e,0,!1,null,null,!1,!1,"",Ww);return e._reactRootContainer=l,e[to]=l.current,ec(e.nodeType===8?e.parentNode:e),Ai(function(){vf(t,l,n,r)}),l}function If(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=lf(s);a.call(l)}}vf(t,s,e,o)}else s=EU(n,t,e,o,r);return lf(s)}g0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ol(t.pendingLanes);n!==0&&(uy(t,n|1),fn(t,it()),(Ie&6)===0&&(na=it()+500,Go()))}break;case 13:Ai(function(){var r=no(e,1);if(r!==null){var o=Jt();fr(r,e,1,o)}}),jy(e,1)}};dy=function(e){if(e.tag===13){var t=no(e,134217728);if(t!==null){var n=Jt();fr(t,e,134217728,n)}jy(e,134217728)}};y0=function(e){if(e.tag===13){var t=Bo(e),n=no(e,t);if(n!==null){var r=Jt();fr(n,e,t,r)}jy(e,t)}};S0=function(){return Ne};_0=function(e,t){var n=Ne;try{return Ne=e,t()}finally{Ne=n}};Ig=function(e,t,n){switch(t){case"input":if(gg(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=pf(r);if(!o)throw Error(L(90));Jw(r),gg(r,o)}}}break;case"textarea":Qw(e,n);break;case"select":t=n.value,t!=null&&Ws(e,!!n.multiple,t,!1)}};i0=Fy;s0=Ai;var TU={usingClientEntryPoint:!1,Events:[dc,Us,pf,r0,o0,Fy]},Al={findFiberByHostInstance:Ti,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},IU={bundleType:Al.bundleType,version:Al.version,rendererPackageName:Al.rendererPackageName,rendererConfig:Al.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:oo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=c0(e),e===null?null:e.stateNode},findFiberByHostInstance:Al.findFiberByHostInstance||vU,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Ml=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Ml.isDisabled&&Ml.supportsFiber))try{cf=Ml.inject(IU),br=Ml}catch{}var Ml;xn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=TU;xn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Gy(t))throw Error(L(200));return _U(e,t,null,n)};xn.createRoot=function(e,t){if(!Gy(e))throw Error(L(299));var n=!1,r="",o=$C;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=zy(e,1,!1,null,null,n,!1,r,o),e[to]=t.current,ec(e.nodeType===8?e.parentNode:e),new Wy(t)};xn.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=c0(t),e=e===null?null:e.stateNode,e};xn.flushSync=function(e){return Ai(e)};xn.hydrate=function(e,t,n){if(!Tf(t))throw Error(L(200));return If(null,e,t,!0,n)};xn.hydrateRoot=function(e,t,n){if(!Gy(e))throw Error(L(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=$C;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=HC(t,null,e,1,n??null,o,!1,i,s),e[to]=t.current,ec(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 Ef(t)};xn.render=function(e,t,n){if(!Tf(t))throw Error(L(200));return If(null,e,t,!1,n)};xn.unmountComponentAtNode=function(e){if(!Tf(e))throw Error(L(40));return e._reactRootContainer?(Ai(function(){If(null,null,e,!1,function(){e._reactRootContainer=null,e[to]=null})}),!0):!1};xn.unstable_batchedUpdates=Fy;xn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Tf(n))throw Error(L(200));if(e==null||e._reactInternals===void 0)throw Error(L(38));return If(e,t,n,!1,r)};xn.version="18.3.1-next-f1338f8080-20240426"});var wf=Mr((DY,WC)=>{"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(),WC.exports=zC()});var VC=Mr(Vy=>{"use strict";var GC=wf();Vy.createRoot=GC.createRoot,Vy.hydrateRoot=GC.hydrateRoot;var UY});var rx=Mr(Rf=>{"use strict";var PU=qr(),LU=Symbol.for("react.element"),OU=Symbol.for("react.fragment"),DU=Object.prototype.hasOwnProperty,UU=PU.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,FU={key:!0,ref:!0,__self:!0,__source:!0};function nx(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)DU.call(t,r)&&!FU.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:LU,type:e,key:i,ref:s,props:o,_owner:UU.current}}Rf.Fragment=OU;Rf.jsx=nx;Rf.jsxs=nx});var mc=Mr((qY,ox)=>{"use strict";ox.exports=rx()});var O=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var W=globalThis;var gr="10.56.0";function gn(){return qo(W),W}function qo(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||gr,t[gr]=t[gr]||{}}function Jn(e,t,n=W){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[gr]=r[gr]||{};return o[e]||(o[e]=t())}var _c=["debug","info","warn","error","log","assert","trace"],RR="Sentry Logger ",Yo={};function Et(e){if(!("console"in W))return e();let t=W.console,n={},r=Object.keys(Yo);r.forEach(o=>{let i=Yo[o];n[o]=t[o],t[o]=i});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function bR(){Zf().enabled=!0}function kR(){Zf().enabled=!1}function RS(){return Zf().enabled}function NR(...e){Qf("log",...e)}function AR(...e){Qf("warn",...e)}function MR(...e){Qf("error",...e)}function Qf(e,...t){O&&RS()&&Et(()=>{W.console[e](`${RR}[${e}]:`,...t)})}function Zf(){return O?Jn("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var C={enable:bR,disable:kR,isEnabled:RS,log:NR,warn:AR,error:MR};var bS=/\(error: (.*)\)/,kS=/captureMessage|captureException/;function ua(...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=bS.test(l)?l.replace(bS,"$1"):l;if(!c.includes("Error: ")){for(let u of t){let d=u(c);if(d){i.push(d);break}}if(i.length>=50+o)break}}return tp(i.slice(o))}}function Ec(e){return Array.isArray(e)?ua(...e):e}function tp(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(vc(t).function||"")&&t.pop(),t.reverse(),kS.test(vc(t).function||"")&&(t.pop(),kS.test(vc(t).function||"")&&t.pop()),t.slice(0,50).map(n=>({...n,filename:n.filename||vc(t).filename,function:n.function||"?"}))}function vc(e){return e[e.length-1]||{}}var ep="<anonymous>";function zt(e){try{return!e||typeof e!="function"?ep:e.name||ep}catch{return ep}}function da(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 fa={},NS={};function kt(e,t){return fa[e]=fa[e]||[],fa[e].push(t),()=>{let n=fa[e];if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}function Nt(e,t){if(!NS[e]){NS[e]=!0;try{t()}catch(n){O&&C.error(`Error while instrumenting ${e}`,n)}}}function at(e,t){let n=e&&fa[e];if(n)for(let r of n)try{r(t)}catch(o){O&&C.error(`Error while triggering instrumentation handler.
10
+ Type: ${e}
11
+ Name: ${zt(r)}
12
+ Error:`,o)}}var np=null;function pa(e){let t="error";kt(t,e),Nt(t,PR)}function PR(){np=W.onerror,W.onerror=function(e,t,n,r,o){return at("error",{column:r,error:o,line:n,msg:e,url:t}),np?np.apply(this,arguments):!1},W.onerror.__SENTRY_INSTRUMENTED__=!0}var rp=null;function ma(e){let t="unhandledrejection";kt(t,e),Nt(t,LR)}function LR(){rp=W.onunhandledrejection,W.onunhandledrejection=function(e){return at("unhandledrejection",e),rp?rp.apply(this,arguments):!0},W.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var AS=Object.prototype.toString;function kn(e){switch(AS.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Qn(e,Error)}}function ji(e,t){return AS.call(e)===`[object ${t}]`}function Wi(e){return ji(e,"ErrorEvent")}function ha(e){return ji(e,"DOMError")}function Tc(e){return ji(e,"DOMException")}function At(e){return ji(e,"String")}function co(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function en(e){return e===null||co(e)||typeof e!="object"&&typeof e!="function"}function Nn(e){return ji(e,"Object")}function uo(e){return typeof Event<"u"&&Qn(e,Event)}function Ic(e){return ji(e,"RegExp")}function Xn(e){return!!(e?.then&&typeof e.then=="function")}function Qn(e,t){try{return e instanceof t}catch{return!1}}function ga(e){return typeof Request<"u"&&Qn(e,Request)}function Qe(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&ya(o,r);try{e[t]=o}catch{O&&C.log(`Failed to replace method "${t}" in object`,e)}}function He(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 ya(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,He(e,"__sentry_original__",t)}catch{}}function fo(e){return e.__sentry_original__}function Sa(e){if(kn(e))return{message:e.message,name:e.name,stack:e.stack,...MS(e)};if(uo(e)){let{type:t,target:n,currentTarget:r,detail:o}=e;return{type:t,target:n,currentTarget:r,...o?{detail:o}:{},...MS(e)}}return e}function MS(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function wc(e){let t=Object.keys(Sa(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}var Gi;function Ko(e){if(Gi!==void 0)return Gi?Gi(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=W;return t in n&&typeof n[t]=="function"?(Gi=n[t],Gi(e)):(Gi=null,e())}function An(){return Ko(()=>Math.random())}function Jo(){return Ko(()=>Date.now())}var OR=Symbol.for("sentry.skipNormalization"),DR=Symbol.for("sentry.overrideNormalizationDepth");function PS(e){return!!e[OR]}function LS(e){let t=e[DR];return typeof t=="number"?t:void 0}var op;function Vi(e){op=e}function Mt(e,t=100,n=1/0){try{return ip("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function _a(e,t=3,n=100*1024){let r=Mt(e,t);return BR(r)>n?_a(e,t-1,n):r}function ip(e,t,n=1/0,r=1/0,o=HR()){let[i,s]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let a=sp(e,t);if(!a.startsWith("[object "))return a;if(PS(t))return t;let l=LS(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 ip("",y,c-1,r,o)}catch{}let d=Array.isArray(t)?[]:{},p=0,h=Sa(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]=ip(y,_,c-1,r,o),p++}return s(t),d}function sp(e,t){try{if(op){let r=op(t);if(r)return r}return typeof global<"u"&&t===global?"[Global]":typeof t=="number"&&!Number.isFinite(t)?`[${t}]`:typeof t=="function"?`[Function: ${zt(t)}]`:typeof t=="symbol"?`[${String(t)}]`:typeof t=="bigint"?`[BigInt: ${String(t)}]`:`[object ${UR(t)}]`}catch(n){return`**non-serializable** (${n})`}}function UR(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function FR(e){return~-encodeURI(e).split(/%..|./).length}function BR(e){return FR(JSON.stringify(e))}function HR(){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 Xo(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function va(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let o=e[r];en(o)?n.push(String(o)):o instanceof Error?n.push(o.message?`${o.name}: ${o.message}`:o.name):n.push(sp(void 0,o))}return n.join(t)}function po(e,t,n=!1){return At(e)?Ic(t)?t.test(e):At(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function Tt(e,t=[],n=!1){for(let r of t)if(po(e,r,n))return!0;return!1}function $R(){let e=W;return e.crypto||e.msCrypto}var ap;function zR(){return An()*16}function Ze(e=$R()){try{if(e?.randomUUID)return Ko(()=>e.randomUUID()).replace(/-/g,"")}catch{}return ap||(ap="10000000100040008000"+1e11),ap.replace(/[018]/g,t=>(t^(zR()&15)>>t/4).toString(16))}function OS(e){return e.exception?.values?.[0]}function Zn(e){let{message:t,event_id:n}=e;if(t)return t;let r=OS(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Qo(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 Mn(e,t){let n=OS(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 Ea(e){if(lp(e))return!0;try{He(e,"__sentry_captured__",!0)}catch{}return!1}function lp(e){try{return e.__sentry_captured__}catch{}}var US=1e3;function tn(){return Jo()/US}function jR(){let{performance:e}=W;if(!e?.now||!e.timeOrigin)return tn;let t=e.timeOrigin;return()=>(t+Ko(()=>e.now()))/US}var DS;function xe(){return(DS??(DS=jR()))()}var cp=null;function WR(){let{performance:e}=W;if(!e?.now)return;let t=3e5,n=Ko(()=>e.now()),r=Jo(),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 Pe(){return cp===null&&(cp=WR()),cp}function FS(e){let t=xe(),n={sid:Ze(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>GR(n)};return e&&Pr(n,e),n}function Pr(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||xe(),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:Ze()),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 BS(e,t){let n={};t?n={status:t}:e.status==="ok"&&(n={status:"exited"}),Pr(e,n)}function GR(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 mo(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]=mo(r[o],t[o],n-1));return r}function jt(){return Ze()}function Pt(){return Ze().substring(16)}function Cc(e){try{let t=W.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function xc(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var up="_sentrySpan";function ho(e,t){t?He(e,up,Cc(t)):delete e[up]}function Zo(e){return xc(e[up])}var VR=100,nn=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:jt(),sampleRand:An()}}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,ho(t,Zo(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&&Pr(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():Nn(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,ho(this,void 0),this._attachments=[],this.setPropagationContext({traceId:jt(),sampleRand:An()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){let r=typeof n=="number"?n:VR;if(r<=0)return this;let o={timestamp:tn(),...t,message:t.message?Xo(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:Zo(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=mo(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){let r=n?.event_id||Ze();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||Ze();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||Ze();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 HS(){return Jn("defaultCurrentScope",()=>new nn)}function $S(){return Jn("defaultIsolationScope",()=>new nn)}var zS=e=>e instanceof Promise&&!e[jS],jS=Symbol("chained PromiseLike"),WS=(e,t,n)=>{let r=e.then(o=>(t(o),o),o=>{throw n(o),o});return zS(r)&&zS(e)?r:qR(e,r)},qR=(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 dp=class{constructor(t,n){let r;t?r=t:r=new nn;let o;n?o=n:o=new nn,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 Xn(r)?WS(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=gn(),t=qo(e);return t.stack=t.stack||new dp(HS(),$S())}function YR(e){return qi().withScope(e)}function KR(e,t){let n=qi();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function GS(e){return qi().withScope(()=>e(qi().getIsolationScope()))}function VS(){return{withIsolationScope:GS,withScope:YR,withSetScope:KR,withSetIsolationScope:(e,t)=>GS(t),getCurrentScope:()=>qi().getScope(),getIsolationScope:()=>qi().getIsolationScope()}}function yr(e){let t=qo(e);return t.acs?t.acs:VS()}function JR(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function XR(e,t){let{value:n,unit:r}=JR(e)?e:{value:e,unit:void 0},o=QR(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 fp(e,t=!1){let n={};for(let[r,o]of Object.entries(e??{})){let i=XR(o,t);i&&(n[r]=i)}return n}function QR(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 pp(){return qS?.()}function Rc(){return qS!==void 0}function Q(){let e=gn();return yr(e).getCurrentScope()}function Ge(){let e=gn();return yr(e).getIsolationScope()}function Ta(){return Jn("globalScope",()=>new nn)}function Pn(...e){let t=gn(),n=yr(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 Q().getClient()}function bc(e){let t=pp();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||Pt()};return o&&(s.parent_span_id=o),s}var pt="sentry.source",Lr="sentry.sample_rate",Yi="sentry.previous_trace_sample_rate",$e="sentry.op",Ee="sentry.origin",Or="sentry.idle_span_finish_reason",er="sentry.measurement_unit",tr="sentry.measurement_value";var Ki="sentry.custom_span_name",ei="sentry.profile_id",Lt="sentry.exclusive_time";var kc="sentry.link.type",Nc="gen_ai.conversation.id";function mp(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 Ji(e,t){e.setAttribute("http.response.status_code",t);let n=mp(t);n.message!=="unknown_error"&&e.setStatus(n)}var YS="_sentryScope",KS="_sentryIsolationScope";function JS(e,t,n){e&&(He(e,KS,Cc(n)),He(e,YS,t))}function ti(e){let t=e;return{scope:t[YS],isolationScope:xc(t[KS])}}var Ia="sentry-";var ZR=8192;function Ac(e){let t=eb(e);if(!t)return;let n=Object.entries(t).reduce((r,[o,i])=>{if(o.startsWith(Ia)){let s=o.slice(Ia.length);r[s]=i}return r},{});if(Object.keys(n).length>0)return n}function hp(e){if(!e)return;let t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${Ia}${r}`]=o),n),{});return tb(t)}function eb(e){if(!(!e||!At(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{let r=XS(n);return Object.entries(r).forEach(([o,i])=>{t[o]=i}),t},{}):XS(e)}function XS(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 tb(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>ZR?(O&&C.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):s},"")}var nb=/^o(\d+)\./,rb=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function ob(e){return e==="http"||e==="https"}function yn(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 ib(e){let t=rb.exec(e);if(!t){Et(()=>{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 QS({host:i,pass:o,path:l,projectId:c,port:s,protocol:n,publicKey:r})}function QS(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function sb(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+$/)?ob(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 ab(e){return e.match(nb)?.[1]}function ZS(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=ab(n)),r}function Mc(e){let t=typeof e=="string"?ib(e):QS(e);if(!(!t||!sb(t)))return t}function Sn(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 Pc=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function e_(e){if(!e)return;let t=e.match(Pc);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 gp(e,t){let n=e_(e),r=Ac(t);if(!n?.traceId)return{traceId:jt(),sampleRand:An()};let o=lb(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 wa(e=jt(),t=Pt(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function Ca(e=jt(),t=Pt(),n){return`00-${e}-${t}-${n?"01":"00"}`}function lb(e,t){let n=Sn(t?.sample_rand);if(n!==void 0)return n;let r=Sn(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?An()*r:r+An()*(1-r):An()}var Lc=0,Ra=1,t_=!1;function o_(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:o,parent_span_id:i,status:s,origin:a,links:l}=Z(e);return{parent_span_id:i,span_id:t,trace_id:n,data:r,op:o,status:s,origin:a,links:l}}function Oc(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:Z(e).parent_span_id,i=ti(e).scope,s=r?i?.getPropagationContext().propagationSpanId||Pt():t;return{parent_span_id:o,span_id:s,trace_id:n}}function ba(e){let{traceId:t,spanId:n}=e.spanContext(),r=on(e);return wa(t,n,r)}function i_(e){let{traceId:t,spanId:n}=e.spanContext(),r=on(e);return Ca(t,n,r)}function ka(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===Ra,attributes:i,...o}))}function _p(e){if(e?.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===Ra,attributes:o}))}function rn(e){return typeof e=="number"?n_(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?n_(e.getTime()):xe()}function n_(e){return e>9999999999?e/1e3:e}function Z(e){if(c_(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(l_(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:s_(e),start_timestamp:rn(o),timestamp:rn(s)||void 0,status:Aa(a),op:r[$e],origin:r[Ee],links:ka(l)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Na(e){if(c_(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(l_(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:s_(e),start_timestamp:rn(o),end_timestamp:rn(s),is_segment:e===xa(e),status:vp(a),attributes:r,links:_p(l)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===xa(e)}}function s_(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function a_(e){return{...e,attributes:fp(e.attributes),links:e.links?.map(t=>({...t,attributes:fp(t.attributes)}))}}function l_(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function c_(e){return typeof e.getSpanJSON=="function"}function on(e){let{traceFlags:t}=e.spanContext();return t===Ra}function Aa(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function vp(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}var ni="_sentryChildSpans",yp="_sentryRootSpan";function Ma(e,t){let n=e[yp]||e;He(t,yp,n),e[ni]?e[ni].add(t):He(e,ni,new Set([t]))}function u_(e,t){e[ni]&&e[ni].delete(t)}function Dr(e){let t=new Set;function n(r){if(!t.has(r)&&on(r)){t.add(r);let o=r[ni]?Array.from(r[ni]):[];for(let i of o)n(i)}}return n(e),Array.from(t)}var Ce=xa;function xa(e){return e[yp]||e}function Re(){let e=gn(),t=yr(e);return t.getActiveSpan?t.getActiveSpan():Zo(Q())}function Pa(){t_||(Et(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),t_=!0)}var d_=!1;function Dc(){if(d_)return;function e(){let t=Re(),n=t&&Ce(t);if(n){let r="internal_error";O&&C.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}d_=!0,pa(e),ma(e)}function mt(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||z()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function f_(e){C.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Ur(e,t){if(!t?.length)return!1;for(let n of t){if(ub(n)){if(e.description&&po(e.description,n))return O&&f_(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&&po(e.description,n.name):!0,i=n.op?e.op&&po(e.op,n.op):!0,s=n.attributes?Object.entries(n.attributes).every(([a,l])=>cb(e.attributes?.[a],l)):!0;if(o&&i&&s)return O&&f_(e),!0}return!1}function cb(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?po(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e===t}function p_(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 ub(e){return typeof e=="string"||e instanceof RegExp}var Xi="production";var m_="_frozenDsc";function Qi(e,t){He(e,m_,t)}function Uc(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||Xi,release:n.release,public_key:r,trace_id:e,org_id:ZS(t)};return t.emit("createDsc",o),o}function Zi(e,t){let n=t.getPropagationContext();return n.dsc||Uc(n.traceId,e)}function lt(e){let t=z();if(!t)return{};let n=Ce(e),r=Z(n),o=r.data,i=n.spanContext().traceState,s=i?.get("sentry.sample_rate")??o[Lr]??o[Yi];function a(y){return(typeof s=="number"||typeof s=="string")&&(y.sample_rate=`${s}`),y}let l=n[m_];if(l)return a(l);let c=i?.get("sentry.dsc"),u=c&&Ac(c);if(u)return a(u);let d=Uc(e.spanContext().traceId,t),p=o[pt]??o["sentry.span.source"],h=r.description;return p!=="url"&&h&&(d.transaction=h),mt()&&(d.sampled=String(on(n)),d.sample_rand=i?.get("sentry.sample_rand")??ti(n).scope?.getPropagationContext().sampleRand.toString()),a(d),t.emit("createDsc",d,n),d}var It=class{constructor(t={}){this._traceId=t.traceId||jt(),this._spanId=t.spanId||Pt(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Lc}}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 Fc(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function Wt(e,t=[]){return[e,t]}function Bc(e,t){let[n,r]=e;return[n,[...r,t]]}function La(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 Tp(e,t){return La(e,(n,r)=>t.includes(r))}function Ep(e){let t=qo(W);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Ip(e){let[t,n]=e,r=JSON.stringify(t);function o(i){typeof r=="string"?r=typeof i=="string"?r+i:[Ep(r),i]:r.push(typeof i=="string"?Ep(i):i)}for(let i of n){let[s,a]=i;if(o(`
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(Mt(a))}o(l)}}return typeof r=="string"?r:db(r)}function db(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 wp(e){return[{type:"span"},e]}function Cp(e){let t=typeof e.data=="string"?Ep(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var h_={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 fb(e){return e in h_}function Hc(e){return fb(e)?h_[e]:e}function es(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Oa(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:yn(r)},...o&&{trace:o}}}function pb(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 g_(e,t,n,r){let o=es(n),i={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:yn(t)}},s="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Wt(i,[s])}function y_(e,t,n,r){let o=es(n),i=e.type&&e.type!=="replay_event"?e.type:"event";pb(e,n?.sdk);let s=Oa(e,o,r,t);return delete e.sdkProcessingMetadata,Wt(s,[[{type:i},e]])}function S_(e,t){function n(h){return!!h.trace_id&&!!h.public_key}let r=lt(e[0]),o=t?.getDsn(),i=t?.getOptions().tunnel,s={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!i&&o&&{dsn:yn(o)}},{beforeSendSpan:a,ignoreSpans:l}=t?.getOptions()||{},c=l?.length?e.filter(h=>{let y=Z(h);return!Ur({description:y.description,op:y.op,attributes:y.data},l)}):e,u=e.length-c.length;u&&t?.recordDroppedEvent("before_send","span",u);let d=a?h=>{let y=Z(h),_=Fc(a)?y:a(y);return _||(Pa(),y)}:Z,p=[];for(let h of c){let y=d(h);y&&p.push(wp(y))}return Wt(s,p)}function __(e){if(!O)return;let{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=Z(e),{spanId:o}=e.spanContext(),i=on(e),s=Ce(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:d}=Z(s);c.push(`root ID: ${s.spanContext().spanId}`),u&&c.push(`root op: ${u}`),d&&c.push(`root description: ${d}`)}C.log(`${l}
15
+ ${c.join(`
16
+ `)}`)}function v_(e){if(!O)return;let{description:t="< unknown name >",op:n="< unknown op >"}=Z(e),{spanId:r}=e.spanContext(),i=Ce(e)===e,s=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;C.log(s)}function $c(e,t,n,r=Re()){let o=r&&Ce(r);o&&(O&&C.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[tr]:t,[er]:n}))}function zc(e){if(!e||e.length===0)return;let t={};return e.forEach(n=>{let r=n.attributes||{},o=r[er],i=r[tr];typeof o=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:o})}),t}function wt(e){return e.getOptions().traceLifecycle==="stream"}var E_=1e3,go=class{constructor(t={}){this._traceId=t.traceId||jt(),this._spanId=t.spanId||Pt(),this._startTime=t.startTimestamp||xe(),this._links=t.links,this._attributes={},this.setAttributes({[Ee]:"manual",[$e]: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?Ra:Lc}}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=rn(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(pt,"custom"),this}end(t){this._endTime||(this._endTime=rn(t),v_(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[$e],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Aa(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[Ee],profile_id:this._attributes[ei],exclusive_time:this._attributes[Lt],measurements:zc(this._events),is_segment:this._isStandaloneSpan&&Ce(this)===this||void 0,segment_id:this._isStandaloneSpan?Ce(this).spanContext().spanId:void 0,links:ka(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===Ce(this),status:vp(this._status),attributes:this._attributes,links:_p(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){O&&C.log("[Tracing] Adding an event to span:",t);let o=T_(n)?n:r||xe(),i=T_(n)?{}:n||{},s={name:t,time:rn(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===Ce(this)))return;if(this._isStandaloneSpan){this._sampled?hb(S_([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&&wt(t)){t.emit("afterSegmentSpanEnd",this);return}let r=this._convertSpanToTransaction();r&&(ti(this).scope||Q()).captureEvent(r)}_convertSpanToTransaction(){if(!I_(Z(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}=ti(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let i=Dr(this).filter(d=>d!==this&&!mb(d)).map(d=>Z(d)).filter(I_),s=this._attributes[pt];delete this._attributes[Ki];let a=!1;i.forEach(d=>{delete d.data[Ki],d.op?.startsWith("gen_ai.")&&(a=!0)});let l={contexts:{trace:o_(this)},spans:i.length>E_?i.sort((d,p)=>d.start_timestamp-p.start_timestamp).slice(0,E_):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:lt(this),hasGenAiSpans:a},request:r,...s&&{transaction_info:{source:s}}},c=zc(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 T_(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function I_(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function mb(e){return e instanceof go&&e.isStandaloneSpan()}function hb(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 w_(e,t,n){if(!mt(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=Sn(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 xp="__SENTRY_SUPPRESS_TRACING__";function yt(e){let t=x_();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=yb(e),{forceTransaction:r,parentSpan:o}=e;return(e.scope?s=>Pn(e.scope,s):o!==void 0?s=>ts(o,s):s=>s())(()=>{let s=Q(),a=_b(s,o),l=z();return e.onlyIfParent&&!a?(l?.recordDroppedEvent("no_parent_span","span"),new It):gb({parentSpan:a,spanArguments:n,forceTransaction:r,scope:s})})}function ts(e,t){let n=x_();return n.withActiveSpan?n.withActiveSpan(e,t):Pn(r=>(ho(r,e||void 0),t(r)))}function gb({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!mt()){let a=new It;if(n||!e){let l={sampled:"false",sample_rate:"0",transaction:t.name,...lt(a)};Qi(a,l)}return a}let o=z();if(vb(o,t))return Rp(r)||o?.recordDroppedEvent("ignored","span"),new It({dropReason:"ignored",traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});let i=Ge(),s;if(e&&!n)s=Sb(e,r,t),Ma(e,s);else if(e){let a=lt(e),{traceId:l,spanId:c}=e.spanContext(),u=on(e);s=C_({traceId:l,parentSpanId:c,...t},r,u),Qi(s,a)}else{let{traceId:a,dsc:l,parentSpanId:c,sampled:u}={...i.getPropagationContext(),...r.getPropagationContext()};s=C_({traceId:a,parentSpanId:c,...t},r,u),l&&Qi(s,l)}return __(s),JS(s,r,i),s}function yb(e){let n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let r={...n};return r.startTimestamp=rn(e.startTime),delete r.startTime,r}return n}function x_(){let e=gn();return yr(e)}function C_(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=Rp(t),[d,p,h]=u?[!1]:w_(o,{name:i,parentSampled:a,attributes:l,parentSampleRate:Sn(c.dsc?.sample_rate)},c.sampleRand),y=new go({...e,attributes:{[pt]:"custom",[Lr]: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",wt(r)?"span":"transaction")),r&&r.emit("spanStart",y),y}function Sb(e,t,n){let{spanId:r,traceId:o}=e.spanContext(),i=Rp(t),s=i?!1:on(e),a=s?new go({...n,parentSpanId:r,traceId:o,sampled:s}):new It({traceId:o});Ma(e,a);let l=z();return l&&(wt(l)&&a instanceof It&&(e instanceof It&&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 _b(e,t){if(t)return t;if(t===null)return;let n=Zo(e);if(!n)return;let r=z();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Ce(n):n}function vb(e,t){let n=e?.getOptions().ignoreSpans;return!e||!wt(e)||!n?.length?!1:Ur({description:t.name||"",op:t.attributes?.[$e]||t.op,attributes:t.attributes},n)}function Rp(e){return e.getScopeData().sdkProcessingMetadata[xp]===!0}var ns={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},Eb="heartbeatFailed",Tb="idleTimeout",Ib="finalTimeout",wb="externalFinish";function jc(e,t={}){let n=new Map,r=!1,o,i=wb,s=!t.disableAutoFinish,a=[],{idleTimeout:l=ns.idleTimeout,finalTimeout:c=ns.finalTimeout,childSpanTimeout:u=ns.childSpanTimeout,beforeSpanEnd:d,trimIdleSpanEndTimestamp:p=!0}=t,h=z();if(!h||!mt()){let I=new It,N={sample_rate:"0",sampled:"false",...lt(I)};return Qi(I,N),I}let y=Q(),_=Re(),T=Cb(e);T.end=new Proxy(T.end,{apply(I,N,U){if(d&&d(T),N instanceof It)return;let[R,...$]=U,j=R||xe(),pe=rn(j),Y=Dr(T).filter(K=>K!==T),qe=Z(T);if(!Y.length||!p)return A(pe),Reflect.apply(I,N,[pe,...$]);let ce=h.getOptions().ignoreSpans,le=Y?.reduce((K,ae)=>{let Se=Z(ae);return!Se.timestamp||ce&&Ur({description:Se.description,op:Se.op,attributes:Se.data},ce)?K:K?Math.max(K,Se.timestamp):Se.timestamp},void 0),D=qe.start_timestamp,me=Math.min(D?D+c/1e3:1/0,Math.max(D||-1/0,Math.min(pe,le||1/0)));return A(me),Reflect.apply(I,N,[me,...$])}});function g(){o&&(clearTimeout(o),o=void 0)}function S(I){g(),o=setTimeout(()=>{!r&&n.size===0&&s&&(i=Tb,T.end(I))},l)}function E(I){o=setTimeout(()=>{!r&&s&&(i=Eb,T.end(I))},u)}function x(I){g(),n.set(I,!0);let N=xe();E(N+u/1e3)}function M(I){if(n.has(I)&&n.delete(I),n.size===0){let N=xe();S(N+l/1e3)}}function A(I){r=!0,n.clear(),a.forEach(Y=>Y()),ho(y,_);let N=Z(T),{start_timestamp:U}=N;if(!U)return;N.data[Or]||T.setAttribute(Or,i);let $=N.status;(!$||$==="unknown")&&T.setStatus({code:1}),C.log(`[Tracing] Idle span "${N.op}" finished`);let j=Dr(T).filter(Y=>Y!==T),pe=0;j.forEach(Y=>{Y.isRecording()&&(Y.setStatus({code:2,message:"cancelled"}),Y.end(I),O&&C.log("[Tracing] Cancelling span since span ended early",JSON.stringify(Y,void 0,2)));let qe=Z(Y),{timestamp:ce=0,start_timestamp:le=0}=qe,D=le<=I,me=(c+l)/1e3,K=ce-le<=me;if(O){let ae=JSON.stringify(Y,void 0,2);D?K||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)}(!K||!D)&&(u_(T,Y),pe++)}),pe>0&&T.setAttribute("sentry.idle_span_discarded_spans",pe)}return a.push(h.on("spanStart",I=>{if(r||I===T||Z(I).timestamp||I instanceof go&&I.isStandaloneSpan())return;Dr(T).includes(I)&&x(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=Ib,T.end())},c),T}function Cb(e){let t=yt(e);return ho(Q(),t),O&&C.log("[Tracing] Started span is an idle span"),t}function b_(e,t){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=t;xb(e,t),r&&kb(e,r),Nb(e,n),Rb(e,o),bb(e,i)}function R_(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;Da(e,"extra",n),Da(e,"tags",r),Da(e,"attributes",o),Da(e,"user",i),Da(e,"contexts",s),e.sdkProcessingMetadata=mo(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 Da(e,t,n){e[t]=mo(e[t],n,1)}function Wc(e,t){let n=Ta().getScopeData();return e&&R_(n,e.getScopeData()),t&&R_(n,t.getScopeData()),n}function xb(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 Rb(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function bb(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function kb(e,t){e.contexts={trace:Oc(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:lt(t),...e.sdkProcessingMetadata};let n=Ce(t),r=Z(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function Nb(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 Ab="thismessage:/";function oi(e){return"isRelative"in e}function Sr(e,t){let n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=t??(n?Ab: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 rs(e){if(oi(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 Ln(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 Gc(e){return e.split(/[?#]/,1)[0]}function Ot(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 yo(e,t){let n=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}var bp=0,k_=1,N_=2;function _r(e){return new Ua(t=>{t(e)})}function ii(e){return new Ua((t,n)=>{n(e)})}var Ua=class e{constructor(t){this._state=bp,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===bp)return;let t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===k_&&n[1](this._value),this._state===N_&&n[2](this._value),n[0]=!0)})}_runExecutor(t){let n=(i,s)=>{if(this._state===bp){if(Xn(s)){s.then(r,o);return}this._state=i,this._value=s,this._executeHandlers()}},r=i=>{n(k_,i)},o=i=>{n(N_,i)};try{t(r,o)}catch(i){o(i)}}};function A_(e,t,n,r=0){try{let o=kp(t,n,e,r);return Xn(o)?o:_r(o)}catch(o){return ii(o)}}function kp(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`),Xn(i)?i.then(s=>kp(s,t,n,r+1)):kp(i,t,n,r+1)}var si,M_,P_,So;function L_(e){let t=W._sentryDebugIds,n=W._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(So&&r.length===M_&&o.length===P_)return So;M_=r.length,P_=o.length,So={},si||(si={});let i=(s,a)=>{for(let l of s){let c=a[l],u=si?.[l];if(u&&So&&c)So[u[0]]=c,si&&(si[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&&So&&si){So[y]=c,si[l]=[y,c];break}}}}};return t&&i(r,t),n&&i(o,n),So}function Fa(e,t,n,r,o,i){let{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=e,l={...t,event_id:t.event_id||n.event_id||Ze(),timestamp:t.timestamp||tn()},c=n.integrations||e.integrations.map(g=>g.name);Mb(l,e),Ob(l,c),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&Pb(l,e.stackParser);let u=Ub(r,n.captureContext);n.mechanism&&Mn(l,n.mechanism);let d=o?o.getEventProcessors():[],p=Wc(i,u),h=[...n.attachments||[],...p.attachments];h.length&&(n.attachments=h),b_(l,p);let y=[...d,...p.eventProcessors];return(n.data&&n.data.__sentry__===!0?_r(l):A_(y,l,n)).then(g=>(g&&Lb(g),typeof s=="number"&&s>0?Db(g,s,a):g))}function Mb(e,t){let{environment:n,release:r,dist:o,maxValueLength:i}=t;e.environment=e.environment||n||Xi,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);let s=e.request;s?.url&&i&&(s.url=Xo(s.url,i)),i&&e.exception?.values?.forEach(a=>{a.value&&(a.value=Xo(a.value,i))})}function Pb(e,t){let n=L_(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function Lb(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 Ob(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Db(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:Mt(o.data,t,n)}}))},...e.user&&{user:Mt(e.user,t,n)},...e.contexts&&{contexts:Mt(e.contexts,t,n)},...e.extra&&{extra:Mt(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Mt(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:Mt(o.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=Mt(e.contexts.flags,3,n)),r}function Ub(e,t){if(!t)return e;let n=e?e.clone():new nn;return n.update(t),n}function O_(e){if(e)return Fb(e)?{captureContext:e}:Hb(e)?{captureContext:e}:e}function Fb(e){return e instanceof nn||typeof e=="function"}var Bb=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Hb(e){return Object.keys(e).some(t=>Bb.includes(t))}function Fr(e,t){return Q().captureException(e,O_(t))}function os(e,t){return Q().captureEvent(e,t)}function ai(e,t){Ge().setContext(e,t)}function Ba(){return Ge().lastEventId()}function Ha(){let e=z();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function $a(e){Ge().addEventProcessor(e)}function is(e){let t=Ge(),{user:n}=Wc(t,Q()),{userAgent:r}=W.navigator||{},o=FS({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return i?.status==="ok"&&Pr(i,{status:"exited"}),za(),t.setSession(o),o}function za(){let e=Ge(),n=Q().getSession()||e.getSession();n&&BS(n),D_(),e.setSession()}function D_(){let e=Ge(),t=z(),n=e.getSession();n&&t&&t.captureSession(n)}function li(e=!1){if(e){za();return}D_()}var U_="7";function F_(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function $b(e){return`${F_(e)}${e.projectId}/envelope/`}function zb(e,t){let n={sentry_version:U_};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Ap(e,t,n){return t||`${$b(e)}?${zb(e,n)}`}function Mp(e,t){let n=Mc(e);if(!n)return"";let r=`${F_(n)}embed/error-page/`,o=`dsn=${yn(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 Pp=[];function jb(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 Lp(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 jb(r)}function B_(e,t){let n={};return t.forEach(r=>{r?.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&Dp(e,r,n)}),n}function Op(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Dp(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,!Pp.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Pp.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 Up(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Fp(){return"npm"}function H_(){return!Up()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function On(){return typeof window<"u"&&(!H_()||Wb())}function Wb(){return W.process?.type==="renderer"}function Gb(e,t){let n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...On()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function $_(e,t,n,r,o){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=yn(r)),Wt(i,[Gb(e,o)])}function ss(e,t){let n=t??Vb(e)??[];if(n.length===0)return;let r=e.getOptions(),o=$_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);z_().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function Vb(e){return z_().get(e)}function z_(){return Jn("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,...On()&&{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=yn(r)),Wt(i,[qb(e,o)])}function ja(e,t){let n=t??Yb(e)??[];if(n.length===0)return;let r=e.getOptions(),o=j_(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);W_().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function Yb(e){return W_().get(e)}function W_(){return Jn("clientToMetricBufferMap",()=>new WeakMap)}function G_(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 a_(t)}function V_(e,t){if(e.type!=="transaction"||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||!t.getOptions().streamGenAiSpans||wt(t))return;let n=[],r=[];for(let i of e.spans)i.op?.startsWith("gen_ai.")?n.push(G_(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,...On()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:n}]}function Vc(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var as=Symbol.for("SentryBufferFullError");function ci(e=100){let t=new Set;function n(){return t.size<e}function r(s){t.delete(s)}function o(s){if(!n())return ii(as);let a=s();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function i(s){if(!t.size)return _r(!0);let a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!s)return a;let l=[a,new Promise(c=>Vc(setTimeout(()=>c(!1),s)))];return Promise.race(l)}return{get $(){return Array.from(t)},add:o,drain:i}}var q_=60*1e3;function Y_(e,t=Jo()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?q_:r-t}function K_(e,t){return e[t]||e.all||0}function Wa(e,t,n=Jo()){return K_(e,t)>n}function Ga(e,{statusCode:t,headers:n},r=Jo()){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+Y_(s,r):t===429&&(o.all=r+60*1e3);return o}var Bp=64;function qc(e,t,n=ci(e.bufferSize||Bp)){let r={},o=s=>n.drain(s);function i(s){let a=[];if(La(s,(d,p)=>{let h=Hc(p);Wa(r,h)?e.recordDroppedEvent("ratelimit_backoff",h):a.push(d)}),a.length===0)return Promise.resolve({});let l=Wt(s[0],a),c=d=>{if(Tp(l,["client_report"])){O&&C.warn(`Dropping client report. Will not send outcomes (reason: ${d}).`);return}La(l,(p,h)=>{e.recordDroppedEvent(d,Hc(h))})},u=()=>t({body:Ip(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=Ga(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===as)return O&&C.error("Skipped sending event because buffer is full."),c("queue_overflow"),Promise.resolve({});throw d})}return{send:i,flush:o}}function J_(e,t,n){let r=[{type:"client_report"},{timestamp:n||tn(),discarded_events:e}];return Wt(t?{dsn:t}:{},[r])}function Yc(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 X_(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?.[ei],exclusive_time:s?.[Lt],measurements:e.measurements,is_segment:!0}}function Q_(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&&{[ei]:e.profile_id},...e.exclusive_time&&{[Lt]:e.exclusive_time}}}},measurements:e.measurements}}var Va=["forwarded","-ip","remote-","via","-user"];function Z_(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:Va},httpHeaders:{request:{deny:Va},response:{deny:Va}},httpBodies:[],queryParams:{deny:Va},genAI:{inputs:!1,outputs:!1},stackFrameVariables:!0,frameContextLines:5}}var Kb={userInfo:!1,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:[],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:5};function ev(e){let t=e.dataCollection!=null?Kb:Z_(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 tv="Not capturing exception because it's already been captured.",nv="Discarded session because of missing or non-string release",lv=Symbol.for("SentryInternalError"),cv=Symbol.for("SentryDoNotSendEventError"),Jb=5e3;function Kc(e){return{message:e,[lv]:!0}}function Hp(e){return{message:e,[cv]:!0}}function rv(e){return!!e&&typeof e=="object"&&lv in e}function ov(e){return!!e&&typeof e=="object"&&cv in e}function iv(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??Jb;c>0&&(a=!0,s=Vc(setTimeout(()=>{o(e)},c)))}}),e.on("flush",()=>{o(e)})}var qa=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=ci(t.transportOptions?.bufferSize??Bp),this._dataCollection=ev(t),t.dsn?this._dsn=Mc(t.dsn):O&&C.warn("No DSN provided, client will not send events."),this._dsn){let r=Ap(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&&iv(this,"afterCaptureLog","flushLogs",ek,ss),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&iv(this,"afterCaptureMetric","flushMetrics",Zb,ja)}captureException(t,n,r){let o=Ze();if(Ea(t))return O&&C.log(tv),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:Ze(),...r},s=co(t)?t:String(t),a=en(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=Ze();if(n?.originalException&&Ea(n.originalException))return O&&C.log(tv),o;let i={event_id:o,...n},s=t.sdkProcessingMetadata||{},a=s.capturedSpanScope,l=s.capturedSpanIsolationScope,c=sv(t.type);return this._process(()=>this._captureEvent(t,i,a||r,l),c),i.event_id}captureSession(t){this.sendSession(t),Pr(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){ss(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),Dp(this,t,this._integrations),n||Op(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=V_(t,this),o=y_(t,this._dsn,this._options._metadata,this._options.tunnel);for(let i of n.attachments||[])o=Bc(o,Cp(i));r&&(o=Bc(o,r)),this.sendEnvelope(o).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){let{release:n,environment:r=Xi}=this._options;if("aggregates"in t){let i=t.attrs||{};if(!i.release&&!n){O&&C.warn(nv);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){O&&C.warn(nv);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);let o=g_(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=B_(this,t),Op(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)&&(Pr(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),Fa(i,t,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...a.contexts?.trace,...bc(r)},...a.contexts};let l=Zi(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:l,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=Q(),o=Ge()){return O&&$p(t)&&C.log(`Captured error event \`${Yc(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(i=>i.event_id,i=>{O&&(ov(i)?C.log(i.message):rv(i)?C.warn(i.message):C.warn(i))})}_processEvent(t,n,r,o){let i=this.getOptions(),{sampleRate:s}=i,a=uv(t),l=$p(t),u=`before send for type \`${t.type||"error"}\``,d=typeof s>"u"?void 0:Sn(s);if(l&&typeof d=="number"&&An()>d)return this.recordDroppedEvent("sample_rate","error"),ii(Hp(`Discarding event because it's not included in the random sample (sampling rate = ${s})`));let p=sv(t.type);return this._prepareEvent(t,n,r,o).then(h=>{if(h===null)throw this.recordDroppedEvent("event_processor",p),Hp("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return h;let _=Qb(this,i,h,n);return Xb(_,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 Hp(`${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 ov(h)||rv(h)?h:(this.captureException(h,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:h}),Kc(`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===as&&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=J_(t,this._options.tunnel&&yn(this._dsn));this.sendEnvelope(n)}};function sv(e){return e==="replay_event"?"replay":e||"error"}function Xb(e,t){let n=`${t} must return \`null\` or a valid event.`;if(Xn(e))return e.then(r=>{if(!Nn(r)&&r!==null)throw Kc(n);return r},r=>{throw Kc(`${t} rejected with ${r}`)});if(!Nn(e)&&e!==null)throw Kc(n);return e}function Qb(e,t,n,r){let{beforeSend:o,beforeSendTransaction:i,ignoreSpans:s}=t,a=!Fc(t.beforeSendSpan)&&t.beforeSendSpan,l=n;if($p(l)&&o)return o(l,r);if(uv(l)){if(a||s){let c=X_(l);if(s?.length&&Ur({description:c.description,op:c.op,attributes:c.data},s))return null;if(a){let u=a(c);u?l=mo(n,Q_(u)):Pa()}if(l.spans){let u=[],d=l.spans;for(let h of d){if(s?.length&&Ur({description:h.description,op:h.op,attributes:h.data},s)){p_(d,h);continue}if(a){let y=a(h);y?u.push(y):(Pa(),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 $p(e){return e.type===void 0}function uv(e){return e.type==="transaction"}function Zb(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+dv(e.attributes)}function ek(e){let t=0;return e.message&&(t+=e.message.length*2),t+dv(e.attributes)}function dv(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*av(n[0]):en(n)?t+=av(n):t+=100}),t}function av(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function zp(e,t){t.debug===!0&&(O?C.enable():Et(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Q().update(t.initialScope);let r=new e(t);return jp(r),r.init(),r}function jp(e){Q().setClient(e)}function Wp(e,t){let n=t?.getDsn(),r=t?.getOptions().tunnel;return nk(e,n)||tk(e,r)}function tk(e,t){return t?fv(e)===fv(t):!1}function nk(e,t){let n=Sr(e);return!n||oi(n)||!t?!1:rk(n.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function rk(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function fv(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function Gp(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 Ya(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:gr})),o.version=gr)}function ls(e={}){let t=e.client||z();if(!Ha()||!t)return{};let n=gn(),r=yr(n);if(r.getTraceData)return r.getTraceData(e);let o=e.scope||Q(),i=e.span||Re();if(!i&&Rc())return{};let s=i?ba(i):ok(o),a=i?lt(i):Zi(t,o),l=hp(a);if(!Pc.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?i_(i):ik(o)),u}function ok(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return wa(t,r,n)}function ik(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Ca(t,r,n)}function Vp(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 d(){return o&&clearTimeout(o),o=a(l,t),s&&i===void 0&&(i=a(l,s)),r}return d.cancel=c,d.flush=u,d}var sk=100;function _n(e,t){let n=z(),r=Ge();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:i=sk}=n.getOptions();if(i<=0)return;let a={timestamp:tn(),...e},l=o?Et(()=>o(a,t)):a;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,t),r.addBreadcrumb(l,i))}var pv,ak="FunctionToString",mv=new WeakMap,lk=(()=>({name:ak,setupOnce(){pv=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=fo(this),n=mv.has(z())&&t!==void 0?t:this;return pv.apply(n,e)}}catch{}},setup(e){mv.set(e,!0)}})),Jc=lk;var ck=[/^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$/],uk="EventFilters",qp=(e={})=>{let t;return{name:uk,setup(n){let r=n.getOptions();t=hv(e,r)},processEvent(n,r,o){if(!t){let i=o.getOptions();t=hv(e,i)}return dk(n,t)?null:n}}},Qc=((e={})=>({...qp(e),name:"InboundFilters"}));function hv(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:ck],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function dk(e,t){if(e.type){if(e.type==="transaction"&&pk(e,t.ignoreTransactions))return O&&C.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
18
+ Event: ${Zn(e)}`),!0}else{if(fk(e,t.ignoreErrors))return O&&C.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
19
+ Event: ${Zn(e)}`),!0;if(yk(e))return O&&C.warn(`Event dropped due to not having an error message, error type or stacktrace.
20
+ Event: ${Zn(e)}`),!0;if(mk(e,t.denyUrls))return O&&C.warn(`Event dropped due to being matched by \`denyUrls\` option.
21
+ Event: ${Zn(e)}.
22
+ Url: ${Xc(e)}`),!0;if(!hk(e,t.allowUrls))return O&&C.warn(`Event dropped due to not being matched by \`allowUrls\` option.
23
+ Event: ${Zn(e)}.
24
+ Url: ${Xc(e)}`),!0}return!1}function fk(e,t){return t?.length?Yc(e).some(n=>Tt(n,t)):!1}function pk(e,t){if(!t?.length)return!1;let n=e.transaction;return n?Tt(n,t):!1}function mk(e,t){if(!t?.length)return!1;let n=Xc(e);return n?Tt(n,t):!1}function hk(e,t){if(!t?.length)return!0;let n=Xc(e);return n?Tt(n,t):!0}function gk(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 Xc(e){try{let n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?gk(n):null}catch{return O&&C.error(`Cannot extract url for event ${Zn(e)}`),null}}function yk(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function Kp(e,t,n,r,o,i){if(!o.exception?.values||!i||!Qn(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=Yp(e,t,r,i.originalException,n,o.exception.values,s,0))}function Yp(e,t,n,r,o,i,s,a){if(i.length>=n+1)return i;let l=[...i];if(Qn(r[o],Error)){gv(s,a,r);let c=e(t,r[o]),u=l.length;yv(c,o,u,a),l=Yp(e,t,n,r[o],o,[c,...l],c,u)}return Sv(r)&&r.errors.forEach((c,u)=>{if(Qn(c,Error)){gv(s,a,r);let d=e(t,c),p=l.length;yv(d,`errors[${u}]`,p,a),l=Yp(e,t,n,c,o,[d,...l],d,p)}}),l}function Sv(e){return Array.isArray(e.errors)}function gv(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Sv(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function yv(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Sk(e){return kn(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Zc(e){return Sk(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var _v=new Set([]);function Jp(e){let t="console",n=kt(t,e);return Nt(t,_k),n}function _k(){"console"in W&&_c.forEach(function(e){e in W.console&&Qe(W.console,e,function(t){return Yo[e]=t,function(...n){let r=n[0],o=Yo[e],i=_v.size&&typeof r=="string"&&Tt(r,_v);i||at("console",{args:n,level:e}),(!i||O&&C.isEnabled())&&o?.apply(W.console,n)}})})}function cs(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var vk="Dedupe",Ek=(()=>{let e;return{name:vk,processEvent(t){if(t.type)return t;try{if(Tk(t,e))return O&&C.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),eu=Ek;function Tk(e,t){return t?!!(Ik(e,t)||wk(e,t)):!1}function Ik(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Tv(e,t)||!Ev(e,t))}function wk(e,t){let n=vv(t),r=vv(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Tv(e,t)||!Ev(e,t))}function Ev(e,t){let n=da(e),r=da(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 Tv(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 vv(e){return e.exception?.values?.[0]}var Ck="ConversationId",xk=(()=>({name:Ck,setup(e){e.on("spanStart",t=>{let n=Q().getScopeData(),r=Ge().getScopeData(),o=n.conversationId||r.conversationId;if(o){let{op:i,data:s,description:a}=Z(t);if(!i?.startsWith("gen_ai.")&&!s["ai.operationId"]&&!a?.startsWith("ai."))return;t.setAttribute(Nc,o)}})}})),Xp=xk;function Qp(e,t,n,r,o){if(!e.fetchData)return;let{method:i,url:s}=e.fetchData,a=mt()&&t(s);if(e.endTimestamp){let y=e.fetchData.__span;if(!y)return;let _=r[y];_&&(a&&(bk(_,e),Rk(_,e,o)),delete r[y]);return}let{spanOrigin:l="auto.http.browser",propagateTraceparent:c=!1}=typeof o=="object"?o:{spanOrigin:o},u=z(),p=!!Re()||!!u&&wt(u),h=a&&p?yt(Ak(s,i,l)):new It;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=wv(y,_,mt()&&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 Rk(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function wv(e,t,n,r){let o=ls({span:n,propagateTraceparent:r}),i=o["sentry-trace"],s=o.baggage,a=o.traceparent;if(!i)return;let l=t.headers||(ga(e)?e.headers:void 0);if(l)if(kk(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?tu(u)||c.set("baggage",`${u},${s}`):c.set("baggage",s)}return c}else if(Nk(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"&&tu(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(_=>tu(_)):tu(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 bk(e,t){if(t.response){Ji(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 tu(e){return typeof e!="string"?!1:e.split(",").some(t=>t.trim().startsWith(Ia))}function kk(e){return typeof Headers<"u"&&Qn(e,Headers)}function Nk(e){return Array.isArray(e)?e.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"):!1}function Ak(e,t,n){if(e.startsWith("data:")){let i=Ot(e);return{name:`${t} ${i}`,attributes:Iv(e,void 0,t,n)}}let r=Sr(e),o=r?rs(r):e;return{name:`${t} ${o}`,attributes:Iv(e,r,t,n)}}function Iv(e,t,n,r){let o={url:Ot(e),type:"fetch","http.method":n,[Ee]:r,[$e]:"http.client"};return t&&(oi(t)||(o["http.url"]=Ot(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function nu(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}var Ka=W;function Zp(){return"history"in Ka&&!!Ka.history}function Mk(){if(!("fetch"in Ka))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function Ja(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function em(){if(typeof EdgeRuntime=="string")return!0;if(!Mk())return!1;if(Ja(Ka.fetch))return!0;let e=!1,t=Ka.document;if(t&&typeof t.createElement=="function")try{let n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=Ja(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 _o(e,t){let n="fetch",r=kt(n,e);return Nt(n,()=>xv(void 0,t)),r}function ou(e){let t="fetch-body-resolved",n=kt(t,e);return Nt(t,()=>xv(Lk)),n}function xv(e,t=!1){t&&!em()||Qe(W,"fetch",function(n){return function(...r){let o=new Error,{method:i,url:s}=Ok(r),a={args:r,fetchData:{method:i,url:s},startTimestamp:xe()*1e3,virtualError:o,headers:Dk(r)};return e||at("fetch",{...a}),n.apply(W,r).then(async l=>(e?e(l):at("fetch",{...a,endTimestamp:xe()*1e3,response:l}),l),l=>{at("fetch",{...a,endTimestamp:xe()*1e3,error:l}),kn(l)&&l.stack===void 0&&(l.stack=o.stack,He(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})`:He(l,"__sentry_fetch_url_host__",h)}catch{}throw l})}})}async function Pk(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 Lk(e){let t;try{t=e.clone()}catch{return}Pk(t,()=>{at("fetch-body-resolved",{endTimestamp:xe()*1e3,response:e})})}function ru(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Cv(e){return typeof e=="string"?e:e?ru(e,"url")?e.url:e.toString?e.toString():"":""}function Ok(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[n,r]=e;return{url:Cv(n),method:ru(r,"method")?String(r.method).toUpperCase():ga(n)&&ru(n,"method")?String(n.method).toUpperCase():"GET"}}let t=e[0];return{url:Cv(t),method:ru(t,"method")?String(t.method).toUpperCase():"GET"}}function Dk(e){let[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(ga(t))return new Headers(t.headers)}catch{}}var Rv=W;function sn(){try{return Rv.document.location.href}catch{return""}}function us(e,t=5){if(!Rv.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 J=W,tm=0;function nm(){return tm>0}function gN(){tm++,setTimeout(()=>{tm--})}function ui(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(fo(e))return e}catch{return e}let r=function(...o){W._sentryWrappedDepth=(W._sentryWrappedDepth||0)+1;try{let i=o.map(s=>ui(s,t));return e.apply(this,i)}catch(i){throw gN(),Pn(s=>{s.addEventProcessor(a=>(t.mechanism&&(Qo(a,void 0,void 0),Mn(a,t.mechanism)),a.extra={...a.extra,arguments:o},a)),Fr(i)}),i}finally{W._sentryWrappedDepth=(W._sentryWrappedDepth||0)-1}};try{for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}ya(r,e),He(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function ds(){let e=sn(),{referrer:t}=J.document||{},{userAgent:n}=J.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}function iu(e,t){let n=su(e,t),r={type:EN(t),value:TN(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function yN(e,t,n,r){let i=z()?.getOptions().normalizeDepth,s=CN(t),a={__serialized__:_a(t,i)};if(s)return{exception:{values:[iu(e,s)]},extra:a};let l={exception:{values:[{type:uo(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:IN(t,{isUnhandledRejection:r})}]},extra:a};if(n){let c=su(e,n);c.length&&(l.exception.values[0].stacktrace={frames:c})}return l}function rm(e,t){return{exception:{values:[iu(e,t)]}}}function su(e,t){let n=t.stacktrace||t.stack||"",r=_N(t),o=vN(t);try{return e(n,r,o)}catch{}return[]}var SN=/Minified React error #\d+;/i;function _N(e){return e&&SN.test(e.message)?1:0}function vN(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Gv(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function EN(e){let t=e?.name;return!t&&Gv(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function TN(e){let t=e?.message;return Gv(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?Zc(t.error):Zc(e):"No error message"}function Vv(e,t,n,r){let o=n?.syntheticException||void 0,i=au(e,t,o,r);return Mn(i),i.level="error",n?.event_id&&(i.event_id=n.event_id),_r(i)}function qv(e,t,n="info",r,o){let i=r?.syntheticException||void 0,s=om(e,t,i,o);return s.level=n,r?.event_id&&(s.event_id=r.event_id),_r(s)}function au(e,t,n,r,o){let i;if(Wi(t)&&t.error)return rm(e,t.error);if(ha(t)||Tc(t)){let s=t;if("stack"in t){i=rm(e,t);let a=i.exception?.values?.[0];if(r&&n&&a&&!a.stacktrace){let l=su(e,n);l.length&&(a.stacktrace={frames:l},Mn(i,{synthetic:!0}))}}else{let a=s.name||(ha(s)?"DOMError":"DOMException"),l=s.message?`${a}: ${s.message}`:a;i=om(e,l,n,r),Qo(i,l)}return"code"in s&&(i.tags={...i.tags,"DOMException.code":`${s.code}`}),i}return kn(t)?rm(e,t):Nn(t)||uo(t)?(i=yN(e,t,n,o),Mn(i,{synthetic:!0}),i):(i=om(e,t,n,r),Qo(i,`${t}`,void 0),Mn(i,{synthetic:!0}),i)}function om(e,t,n,r){let o={};if(r&&n){let i=su(e,n);i.length&&(o.exception={values:[{value:t,stacktrace:{frames:i}}]}),Mn(o,{synthetic:!0})}if(co(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 IN(e,{isUnhandledRejection:t}){let n=wc(e),r=t?"promise rejection":"exception";return Wi(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:uo(e)?`Event \`${wN(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function wN(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function CN(e){return Object.values(e).find(t=>t instanceof Error)}var lu=class extends qa{constructor(t){let n=xN(t),r=J.SENTRY_SDK_SOURCE||Fp();Ya(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;J.document&&(i||s||c)&&J.document.addEventListener("visibilitychange",()=>{J.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),s&&ss(this),c&&ja(this))}),o&&this.on("beforeSendSession",Gp)}eventFromException(t,n){return Vv(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 xN(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:J.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var St=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var G=W;var RN=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",vr=(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=RN(t.value,n),e(t)))}};var Hr=(e=!0)=>{let t=G.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t};var Dn=()=>Hr()?.activationStart??0;function Un(e,t,n){G.document&&G.addEventListener(e,t,n)}function di(e,t,n){G.document&&G.removeEventListener(e,t,n)}var fs=-1,Yv=new Set,bN=()=>G.document?.visibilityState==="hidden"&&!G.document?.prerendering?0:1/0,cu=e=>{if(kN(e)&&fs>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(let t of Yv)t();isFinite(fs)||(fs=e.type==="visibilitychange"?e.timeStamp:0,di("prerenderingchange",cu,!0))}},Er=()=>{if(G.document&&fs<0){let e=Dn();fs=(G.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??bN(),Un("visibilitychange",cu,!0),Un("pagehide",cu,!0),Un("prerenderingchange",cu,!0)}return{get firstHiddenTime(){return fs},onHidden(e){Yv.add(e)}}};function kN(e){return e.type==="pagehide"||G.document?.visibilityState==="hidden"}var Kv=()=>`v5-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`;var Tr=(e,t=-1)=>{let n=Hr(),r="navigate";return n&&(G.document?.prerendering||Dn()>0?r="prerender":G.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:Kv(),navigationType:r}};var im=new WeakMap;function ps(e,t){try{return im.get(e)||im.set(e,new t),im.get(e)}catch{return new t}}var uu=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 Fn=(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 ms=e=>{let t=!1;return()=>{t||(e(),t=!0)}};var Eo=e=>{G.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()};var NN=[1800,3e3],Jv=(e,t={})=>{Eo(()=>{let n=Er(),r=Tr("FCP"),o,s=Fn("paint",a=>{for(let l of a)l.name==="first-contentful-paint"&&(s.disconnect(),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-Dn(),0),r.entries.push(l),o(!0)))});s&&(o=vr(e,r,NN,t.reportAllChanges))})};var AN=[.1,.25],Xv=(e,t={})=>{Jv(ms(()=>{let n=Tr("CLS",0),r,o=Er(),i=ps(t,uu),s=l=>{for(let c of l)i._processEntry(c);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},a=Fn("layout-shift",s);a&&(r=vr(e,n,AN,t.reportAllChanges),o.onHidden(()=>{s(a.takeRecords()),r(!0)}),G?.setTimeout?.(r))}))};var Qv=0,sm=1/0,du=0,MN=e=>{e.forEach(t=>{t.interactionId&&(sm=Math.min(sm,t.interactionId),du=Math.max(du,t.interactionId),Qv=du?(du-sm)/7+1:0)})},am,lm=()=>am?Qv:performance.interactionCount||0,Zv=()=>{"interactionCount"in performance||am||(am=Fn("event",MN,{type:"event",buffered:!0,durationThreshold:0}))};var cm=10,eE=0,PN=()=>lm()-eE,fu=class{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){eE=lm(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let t=Math.min(this._longestInteractionList.length-1,Math.floor(PN()/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<cm||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>cm){let o=this._longestInteractionList.splice(cm);for(let i of o)this._longestInteractionMap.delete(i.id)}this._onAfterProcessingINPCandidate?.(r)}}};var pu=e=>{let t=G.requestIdleCallback||G.setTimeout;G.document?.visibilityState==="hidden"?e():(e=ms(e),Un("visibilitychange",e,{once:!0,capture:!0}),Un("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),di("visibilitychange",e,{capture:!0}),di("pagehide",e,{capture:!0})}))};var LN=[200,500],ON=40,tE=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;let n=Er();Eo(()=>{Zv();let r=Tr("INP"),o,i=ps(t,fu),s=l=>{pu(()=>{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=Fn("event",s,{durationThreshold:t.durationThreshold??ON});o=vr(e,r,LN,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{s(a.takeRecords()),o(!0)}))})};var mu=class{_processEntry(t){this._onBeforeProcessingEntry?.(t)}};var DN=[2500,4e3],nE=(e,t={})=>{Eo(()=>{let n=Er(),r=Tr("LCP"),o,i=ps(t,mu),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-Dn(),0),r.entries=[c],o())},a=Fn("largest-contentful-paint",s);if(a){o=vr(e,r,DN,t.reportAllChanges);let l=ms(()=>{s(a.takeRecords()),a.disconnect(),o(!0)}),c=u=>{u.isTrusted&&(pu(l),di(u.type,c,{capture:!0}))};for(let u of["keydown","click","visibilitychange"])Un(u,c,{capture:!0})}})};var UN=[800,1800],um=e=>{G.document?.prerendering?Eo(()=>um(e)):G.document?.readyState!=="complete"?addEventListener("load",()=>um(e),!0):setTimeout(e)},rE=(e,t={})=>{let n=Tr("TTFB"),r=vr(e,n,UN,t.reportAllChanges);um(()=>{let o=Hr();o&&(n.value=Math.max(o.responseStart-Dn(),0),n.entries=[o],r(!0))})};var Xa={},hu={},oE,iE,sE,aE;function $r(e,t=!1){return gu("cls",e,FN,oE,t)}function zr(e,t=!1){return gu("lcp",e,BN,iE,t)}function dm(e){return gu("ttfb",e,HN,sE)}function fi(e){return gu("inp",e,$N,aE)}function nr(e,t){return lE(e,t),hu[e]||(zN(e),hu[e]=!0),cE(e,t)}function Qa(e,t){let n=Xa[e];if(n?.length)for(let r of n)try{r(t)}catch(o){St&&C.error(`Error while triggering instrumentation handler.
25
+ Type: ${e}
26
+ Name: ${zt(r)}
27
+ Error:`,o)}}function FN(){return Xv(e=>{Qa("cls",{metric:e}),oE=e},{reportAllChanges:!0})}function BN(){return nE(e=>{Qa("lcp",{metric:e}),iE=e},{reportAllChanges:!0})}function HN(){return rE(e=>{Qa("ttfb",{metric:e}),sE=e})}function $N(){return tE(e=>{Qa("inp",{metric:e}),aE=e})}function gu(e,t,n,r,o=!1){lE(e,t);let i;return hu[e]||(i=n(),hu[e]=!0),r&&t({metric:r}),cE(e,t,o?i:void 0)}function zN(e){let t={};e==="event"&&(t.durationThreshold=0),Fn(e,n=>{Qa(e,{entries:n})},t)}function lE(e,t){Xa[e]=Xa[e]||[],Xa[e].push(t)}function cE(e,t,n){return()=>{n&&n();let r=Xa[e];if(!r)return;let o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function uE(e){return"duration"in e}var jN=80;function Ae(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||jN;for(;n&&i++<r&&(c=WN(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 WN(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&&At(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 dE=e=>{let t=n=>{(n.type==="pagehide"||G.document?.visibilityState==="hidden")&&e(n)};Un("visibilitychange",t,{capture:!0,once:!0}),Un("pagehide",t,{capture:!0,once:!0})};function yu(e){return typeof e=="number"&&isFinite(e)}function jr(e,t,n,{...r}){let o=Z(e).start_timestamp;return o&&o>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),ts(e,()=>{let i=yt({startTime:t,...r});return i&&i.end(n),i})}function hs(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=Q(),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":G.navigator?.userAgent,"client.address":l?"{{auto}}":void 0,...o};return yt({name:n,attributes:_,startTime:i,experimental:{standalone:!0}})}function Wr(){return G.addEventListener&&G.performance}function be(e){return e/1e3}function fE(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 pi(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function mi(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n.spanContext().spanId,n),r=!0}dE(()=>{o("pagehide")});let i=e.on("beforeStartNavigationSpan",(a,l)=>{l?.isRedirect||(o("navigation"),i(),s())}),s=e.on("afterStartPageLoadSpan",a=>{n=a,s()})}function pE(e){let t=0,n;if(!pi("layout-shift"))return;let r=$r(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);mi(e,(o,i)=>{GN(t,n,i,o),r()})}function GN(e,t,n,r){St&&C.log(`Sending CLS span (${e})`);let o=t?be((Pe()||0)+t.startTime):xe(),i=Q().getScopeData().transactionName,s=t?Ae(t.sources[0]?.node):"Layout shift",a={[Ee]:"auto.http.browser.cls",[$e]:"ui.webvital.cls",[Lt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((c,u)=>{a[`cls.source.${u+1}`]=Ae(c.node)});let l=hs({name:s,transaction:i,attributes:a,startTime:o});l&&(l.addEvent("cls",{[er]:"",[tr]:e}),l.end(o))}var VN=6e4;function hi(e){return e!=null&&e>0&&e<=VN}function mE(e){let t=0,n;if(!pi("largest-contentful-paint"))return;let r=zr(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!hi(o.value)||(t=o.value,n=i)},!0);mi(e,(o,i)=>{qN(t,n,i,o),r()})}function qN(e,t,n,r){if(!hi(e))return;St&&C.log(`Sending LCP span (${e})`);let o=be((Pe()||0)+(t?.startTime||0)),i=Q().getScopeData().transactionName,s=t?Ae(t.element):"Largest contentful paint",a={[Ee]:"auto.http.browser.lcp",[$e]:"ui.webvital.lcp",[Lt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=Ae(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=hs({name:s,transaction:i,attributes:a,startTime:o});l&&(l.addEvent("lcp",{[er]:"millisecond",[tr]:e}),l.end(o))}function Bn(e){return e&&((Pe()||performance.timeOrigin)+e)/1e3}function Za(e){let t={};if(e.nextHopProtocol!=null){let{name:n,version:r}=fE(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return Pe()||Wr()?.timeOrigin?YN({...t,"http.request.redirect_start":Bn(e.redirectStart),"http.request.redirect_end":Bn(e.redirectEnd),"http.request.worker_start":Bn(e.workerStart),"http.request.fetch_start":Bn(e.fetchStart),"http.request.domain_lookup_start":Bn(e.domainLookupStart),"http.request.domain_lookup_end":Bn(e.domainLookupEnd),"http.request.connect_start":Bn(e.connectStart),"http.request.secure_connection_start":Bn(e.secureConnectionStart),"http.request.connection_end":Bn(e.connectEnd),"http.request.request_start":Bn(e.requestStart),"http.request.response_start":Bn(e.responseStart),"http.request.response_end":Bn(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function YN(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}var KN=2147483647,hE=0,Gt={},an,_u;function fm({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){let r=Wr();if(r&&Pe()){r.mark&&G.performance.mark("sentry-tracing-init");let o=t?mE(n):t===!1?XN():void 0,i=e?pE(n):e===!1?JN():void 0,s=QN();return()=>{s(),o?.(),i?.()}}return()=>{}}function pm(){nr("longtask",({entries:e})=>{let t=Re();if(!t)return;let{op:n,start_timestamp:r}=Z(t);for(let o of e){let i=be(Pe()+o.startTime),s=be(o.duration);n==="navigation"&&r&&i<r||jr(t,i,i+s,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[Ee]:"auto.ui.browser.metrics"}})}})}function mm(){new PerformanceObserver(t=>{let n=Re();if(n)for(let r of t.getEntries()){if(!r.scripts[0])continue;let o=be(Pe()+r.startTime),{start_timestamp:i,op:s}=Z(n);if(s==="navigation"&&i&&o<i)continue;let a=be(r.duration),l={[Ee]:"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),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 hm(){nr("event",({entries:e})=>{let t=Re();if(t){for(let n of e)if(n.name==="click"){let r=be(Pe()+n.startTime),o=be(n.duration),i={name:Ae(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[Ee]:"auto.ui.browser.metrics"}},s=us(n.target);s&&(i.attributes["ui.component_name"]=s),jr(t,r,r+o,i)}}})}function JN(){return $r(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(Gt.cls={value:e.value,unit:""},_u=t)},!0)}function XN(){return zr(({metric:e})=>{let t=e.entries[e.entries.length-1];!t||!hi(e.value)||(Gt.lcp={value:e.value,unit:"millisecond"},an=t)},!0)}function QN(){return dm(({metric:e})=>{e.entries[e.entries.length-1]&&(Gt.ttfb={value:e.value,unit:"millisecond"})})}function gm(e,t){let n=Wr(),r=Pe();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:o,ignorePerformanceApiSpans:i,ignoreResourceSpans:s,recordClsOnPageloadSpan:a,recordLcpOnPageloadSpan:l}=t,c=be(r),u=n.getEntries(),{op:d,start_timestamp:p}=Z(e);if(u.slice(hE).forEach(h=>{let y=be(h.startTime),_=be(Math.max(0,h.duration));if(!(d==="navigation"&&p&&c+y<p))switch(h.entryType){case"navigation":{nA(e,h,c);break}case"mark":case"paint":case"measure":{eA(e,h,y,_,c,i);let T=Er(),g=h.startTime<T.firstHiddenTime;h.name==="first-paint"&&g&&(Gt.fp={value:h.startTime,unit:"millisecond"}),h.name==="first-contentful-paint"&&g&&(Gt.fcp={value:h.startTime,unit:"millisecond"});break}case"resource":{iA(e,h,h.name,y,_,c,s);break}}}),hE=Math.max(u.length-1,0),sA(e,o),d==="pageload"){if(cA(Gt),o){let h=(y,_,T)=>{let g=T??`browser.web_vital.${y}.value`;e.setAttribute(g,_),St&&C.log("Setting web vital attribute",{[g]:_},"on pageload span")};["ttfb","fp","fcp"].forEach(y=>{Gt[y]&&h(y,Gt[y].value)}),Gt["ttfb.requestTime"]&&h("ttfb.requestTime",Gt["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else a||delete Gt.cls,l||delete Gt.lcp,Object.entries(Gt).forEach(([h,y])=>{$c(h,y.value,y.unit)}),aA(e,t);e.setAttribute(o?"browser.performance.time_origin":"performance.timeOrigin",c),e.setAttribute(o?"browser.performance.navigation.activation_start":"performance.activationStart",Dn())}an=void 0,_u=void 0,Gt={}}function ZN(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components \u269B"}catch{return}}function eA(e,t,n,r,o,i){if(ZN(t)||["mark","measure"].includes(t.entryType)&&Tt(t.name,i))return;let s=Hr(!1),a=be(s?s.requestStart:0),l=o+Math.max(n,a),c=o+n,u=c+r,d={[Ee]:"auto.resource.browser.metrics"};l!==c&&(d["sentry.browser.measure_happened_before_request"]=!0,d["sentry.browser.measure_start_time"]=l),tA(d,t),l<=u&&jr(e,l,u,{name:t.name,op:t.entryType,attributes:d})}function tA(e,t){try{let n=t.detail;if(!n)return;if(typeof n=="object"){for(let[r,o]of Object.entries(n))if(o&&en(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(en(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function nA(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Su(e,t,r,n)}),Su(e,t,"secureConnection",n,"TLS/SSL"),Su(e,t,"fetch",n,"cache"),Su(e,t,"domainLookup",n,"DNS"),oA(e,t,n)}function Su(e,t,n,r,o=n){let i=rA(n),s=t[i],a=t[`${n}Start`];!a||!s||jr(e,r+be(a),r+be(s),{op:`browser.${o}`,name:t.name,attributes:{[Ee]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function rA(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function oA(e,t,n){let r=n+be(t.requestStart),o=n+be(t.responseEnd),i=n+be(t.responseStart);t.responseEnd&&(jr(e,r,o,{op:"browser.request",name:t.name,attributes:{[Ee]:"auto.ui.browser.metrics"}}),jr(e,i,o,{op:"browser.response",name:t.name,attributes:{[Ee]:"auto.ui.browser.metrics"}}))}function iA(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={[Ee]:"auto.resource.browser.metrics"},c=Ln(n);c.protocol&&(l["url.scheme"]=c.protocol.split(":").pop()),c.host&&(l["server.address"]=c.host),l["url.same_origin"]=n.includes(G.location.origin),lA(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,...Za(t)},d=i+r,p=d+o;jr(e,d,p,{name:n.replace(G.location.origin,""),op:a,attributes:u})}function sA(e,t){let n=G.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),yu(r.rtt)&&(Gt["connection.rtt"]={value:r.rtt,unit:"millisecond"},t&&e.setAttribute("network.connection.rtt",r.rtt))),yu(n.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",n.deviceMemory):e.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),yu(n.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",n.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function aA(e,t){an&&t.recordLcpOnPageloadSpan&&(an.element&&e.setAttribute("lcp.element",Ae(an.element)),an.id&&e.setAttribute("lcp.id",an.id),an.url&&e.setAttribute("lcp.url",an.url.trim().slice(0,200)),an.loadTime!=null&&e.setAttribute("lcp.loadTime",an.loadTime),an.renderTime!=null&&e.setAttribute("lcp.renderTime",an.renderTime),e.setAttribute("lcp.size",an.size)),_u?.sources&&t.recordClsOnPageloadSpan&&_u.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Ae(n.node)))}function lA(e,t,n){n.forEach(([r,o])=>{let i=e[r];i!=null&&(typeof i=="number"&&i<KN||typeof i=="string")&&(t[o]=i)})}function cA(e){let t=Hr(!1);if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}var ym=[],el=new Map,gs=new Map,Sm=60;function _m(){if(Wr()&&Pe()){let t=uA();return()=>{t()}}return()=>{}}var ys={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 uA(){return fi(dA)}var dA=({metric:e})=>{if(e.value==null)return;let t=be(e.value);if(t>Sm)return;let n=e.entries.find(y=>y.duration===e.value&&ys[y.name]);if(!n)return;let{interactionId:r}=n,o=ys[n.name],i=be(Pe()+n.startTime),s=Re(),a=s?Ce(s):void 0,l=r!=null?el.get(r):void 0,c=l?.span||a,u=c?Z(c).description:Q().getScopeData().transactionName,d=l?.elementName||Ae(n.target),p={[Ee]:"auto.http.browser.inp",[$e]:`ui.interaction.${o}`,[Lt]:n.duration},h=hs({name:d,transaction:u,attributes:p,startTime:i});h&&(h.addEvent("inp",{[er]:"millisecond",[tr]:e.value}),h.end(i+t))};function gE(e){return e!=null?el.get(e):void 0}function vm(){let e=Object.keys(ys);On()&&e.forEach(o=>{G.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){let i=o.target;if(!i)return;let s=Ae(i),a=Math.round(o.timeStamp);if(gs.set(a,s),gs.size>50){let l=gs.keys().next().value;l!==void 0&&gs.delete(l)}}function n(o){let i=Math.round(o.startTime),s=gs.get(i);if(!s)for(let a=-5;a<=5;a++){let l=gs.get(i+a);if(l){s=l;break}}return s||"<unknown>"}let r=({entries:o})=>{let i=Re(),s=i&&Ce(i);o.forEach(a=>{if(!uE(a))return;let l=a.interactionId;if(l==null||el.has(l))return;let c=a.target?Ae(a.target):n(a);if(ym.length>10){let u=ym.shift();el.delete(u)}ym.push(l),el.set(l,{span:s,elementName:c})})};nr("event",r),nr("first-input",r)}function Em(e){let{name:t,op:n,origin:r,metricName:o,value:i,attributes:s,parentSpan:a,reportEvent:l,startTime:c,endTime:u}=e,d=Q().getScopeData().transactionName,p={[Ee]:r,[$e]:n,[Lt]:0,[`browser.web_vital.${o}.value`]:i,"sentry.transaction":d,"user_agent.original":G.navigator?.userAgent,...s};a&&Na(a).attributes?.[$e]==="pageload"&&(p["sentry.pageload.span_id"]=a.spanContext().spanId),l&&(p[`browser.web_vital.${o}.report_event`]=l);let h=yt({name:t,attributes:p,startTime:c,parentSpan:a});h&&h.end(u??c)}function Tm(e){let t=0,n;if(!pi("largest-contentful-paint"))return;let r=zr(({metric:o})=>{let i=o.entries[o.entries.length-1];!i||!hi(o.value)||(t=o.value,n=i)},!0);mi(e,(o,i,s)=>{fA(t,n,s,o),r()})}function fA(e,t,n,r){if(!hi(e))return;St&&C.log(`Sending LCP span (${e})`);let o=Pe()||0,i=be(o),s=be(o+(t?.startTime||0)),a=t?Ae(t.element):"Largest contentful paint",l={};t?.element&&(l["browser.web_vital.lcp.element"]=Ae(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),Em({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 Im(e){let t=0,n;if(!pi("layout-shift"))return;let r=$r(({metric:o})=>{let i=o.entries[o.entries.length-1];i&&(t=o.value,n=i)},!0);mi(e,(o,i,s)=>{pA(t,n,s,o),r()})}function pA(e,t,n,r){St&&C.log(`Sending CLS span (${e})`);let o=t?be((Pe()||0)+t.startTime):xe(),i=t?Ae(t.sources[0]?.node):"Layout shift",s={};t?.sources&&t.sources.forEach((a,l)=>{s[`browser.web_vital.cls.source.${l+1}`]=Ae(a.node)}),Em({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:s,parentSpan:n,reportEvent:r,startTime:o})}function wm(){if(!Wr()||!Pe())return;fi(({metric:n})=>{if(n.value==null||be(n.value)>Sm)return;let o=n.entries.find(i=>i.duration===n.value&&ys[i.name]);o&&mA(n.value,o)})}function mA(e,t){St&&C.log(`Sending INP span (${e})`);let n=be(Pe()+t.startTime),r=be(e),o=ys[t.name],i=gE(t.interactionId),s=Re(),a=s?Ce(s):void 0,l=i?.span||a,c=l?Na(l).name:Q().getScopeData().transactionName,u=i?.elementName||Ae(t.target);Em({name:u,op:`ui.interaction.${o}`,origin:"auto.http.browser.inp",metricName:"inp",value:e,attributes:{[Lt]:t.duration,"sentry.transaction":c},startTime:n,endTime:n+r,parentSpan:l})}var hA=1e3,yE,Cm,xm;function tl(e){kt("dom",e),Nt("dom",gA)}function gA(){if(!G.document)return;let e=at.bind(null,"dom"),t=SE(e,!0);G.document.addEventListener("click",t,!1),G.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{let o=G[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(Qe(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=SE(e);u.handler=d,i.call(this,s,d,l)}u.refCount++}catch{}return i.call(this,s,a,l)}}),Qe(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 yA(e){if(e.type!==Cm)return!1;try{if(!e.target||e.target._sentryId!==xm)return!1}catch{}return!0}function SA(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function SE(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=_A(n);if(SA(n.type,r))return;He(n,"_sentryCaptured",!0),r&&!r._sentryId&&He(r,"_sentryId",Ze());let o=n.type==="keypress"?"input":n.type;yA(n)||(e({event:n,name:o,global:t}),Cm=n.type,xm=r?r._sentryId:void 0),clearTimeout(yE),yE=G.setTimeout(()=>{xm=void 0,Cm=void 0},hA)}}function _A(e){try{return e.target}catch{return null}}var vu;function Gr(e){let t="history";kt(t,e),Nt(t,vA)}function vA(){if(G.addEventListener("popstate",()=>{let t=G.location.href,n=vu;if(vu=t,n===t)return;at("history",{from:n,to:t})}),!Zp())return;function e(t){return function(...n){let r=n.length>2?n[2]:void 0;if(r){let o=vu,i=EA(String(r));if(vu=i,o===i)return t.apply(this,n);at("history",{from:o,to:i})}return t.apply(this,n)}}Qe(G.history,"pushState",e),Qe(G.history,"replaceState",e)}function EA(e){try{return new URL(e,G.location.origin).toString()}catch{return e}}var Eu={};function Tu(e){let t=Eu[e];if(t)return t;let n=G[e];if(Ja(n))return Eu[e]=n.bind(G);let r=G.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){St&&C.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(Eu[e]=n.bind(G))}function Rm(e){Eu[e]=void 0}function gi(...e){return Tu("setTimeout")(...e)}var rr="__sentry_xhr_v3__";function nl(e){kt("xhr",e),Nt("xhr",TA)}function TA(){if(!G.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){let o=new Error,i=xe()*1e3,s=At(r[0])?r[0].toUpperCase():void 0,a=IA(r[1]);if(!s||!a)return t.apply(n,r);n[rr]={method:s,url:a,request_headers:{}},s==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);let l=()=>{let c=n[rr];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}let u={endTimestamp:xe()*1e3,startTimestamp:i,xhr:n,virtualError:o};at("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[rr];return y&&At(p)&&At(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[rr];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);let i={startTimestamp:xe()*1e3,xhr:n};return at("xhr",i),t.apply(n,r)}})}function IA(e){if(At(e))return e;try{return e.toString()}catch{}}var wA=Symbol.for("sentry__originalRequestBody");function Iu(e){return new URLSearchParams(e).toString()}function wu(e,t=C){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[Iu(e)];if(!e)return[void 0]}catch(n){return St&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return St&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Cu(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][wA];return n!==void 0?n:void 0}}function rl(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return St&&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 bm(e){if(typeof Element>"u")return!1;try{return e instanceof Element}catch{return!1}}var CA=40;function _E(e,t=Tu("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 Rm("fetch"),l}finally{n-=s,r--}}return qc(e,o,ci(e.bufferSize||CA))}var Ye=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var xA=30;var RA=50;function km(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 bA=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,kA=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,NA=/\((\S*)(?::(\d+))(?::(\d+))\)/,AA=/at (.+?) ?\(data:(.+?),/,MA=e=>{let t=e.match(AA);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=bA.exec(e);if(n){let[,o,i,s]=n;return km(o,"?",+i,+s)}let r=kA.exec(e);if(r){if(r[2]?.indexOf("eval")===0){let a=NA.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}let[i,s]=EE(r[1]||"?",r[2]);return km(s,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},PA=[xA,MA],LA=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,OA=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,DA=e=>{let t=LA.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let i=OA.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]=EE(o,r),km(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},UA=[RA,DA];var FA=[PA,UA],vE=ua(...FA),EE=(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 xu=1024,BA="Breadcrumbs",HA=((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:BA,setup(n){t.console&&Jp(jA(n)),t.dom&&tl(zA(n,t.dom)),t.xhr&&nl(WA(n)),t.fetch&&_o(GA(n)),t.history&&Gr(VA(n)),t.sentry&&n.on("beforeSendEvent",$A(n))}}}),TE=HA;function $A(e){return function(n){z()===e&&_n({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Zn(n)},{event:n})}}function zA(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>xu&&(Ye&&C.warn(`\`dom.maxStringLength\` cannot exceed ${xu}, but a value of ${a} was configured. Sentry will use ${xu} instead.`),a=xu),typeof s=="string"&&(s=[s]);try{let c=r.event,u=qA(c)?c.target:c;o=Ae(u,{keyAttrs:s,maxStringLength:a}),i=us(u)}catch{o="<unknown>"}if(o.length===0)return;let l={category:`ui.${r.name}`,message:o};i&&(l.data={"ui.component_name":i}),_n(l,{event:r.event,name:r.name,global:r.global})}}function jA(e){return function(n){if(z()!==e)return;let r={category:"console",data:{arguments:n.args,logger:"console"},level:cs(n.level),message:va(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${va(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;_n(r,{input:n.args,level:n.level})}}function WA(e){return function(n){if(z()!==e)return;let{startTimestamp:r,endTimestamp:o}=n,i=n.xhr[rr];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:nu(l)};e.emit("beforeOutgoingRequestBreadcrumb",p,d),_n(p,d)}}function GA(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),_n(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:nu(s.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",l,a),_n(l,a)}}}function VA(e){return function(n){if(z()!==e)return;let r=n.from,o=n.to,i=Ln(J.location.href),s=r?Ln(r):void 0,a=Ln(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),_n({category:"navigation",data:{from:r,to:o}})}}function qA(e){return!!e&&!!e.target}var YA="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(","),KA="BrowserApiErrors",JA=((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:KA,setupOnce(){t.setTimeout&&Qe(J,"setTimeout",IE),t.setInterval&&Qe(J,"setInterval",IE),t.requestAnimationFrame&&Qe(J,"requestAnimationFrame",XA),t.XMLHttpRequest&&"XMLHttpRequest"in J&&Qe(XMLHttpRequest.prototype,"send",QA);let n=t.eventTarget;n&&(Array.isArray(n)?n:YA).forEach(o=>ZA(o,t))}}}),wE=JA;function IE(e){return function(...t){let n=t[0];return t[0]=ui(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${zt(e)}`}}),e.apply(this,t)}}function XA(e){return function(t){return e.apply(this,[ui(t,{mechanism:{data:{handler:zt(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function QA(e){return function(...t){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&Qe(n,o,function(i){let s={mechanism:{data:{handler:zt(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=fo(i);return a&&(s.mechanism.data.handler=zt(a)),ui(i,s)})}),e.apply(this,t)}}function ZA(e,t){let r=J[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Qe(r,"addEventListener",function(o){return function(i,s,a){try{e1(s)&&(s.handleEvent=ui(s.handleEvent,{mechanism:{data:{handler:zt(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&t1(this,i,s),o.apply(this,[i,ui(s,{mechanism:{data:{handler:zt(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),Qe(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 e1(e){return typeof e.handleEvent=="function"}function t1(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}var CE=(e={})=>{let t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof J.document>"u"){Ye&&C.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}is({ignoreDuration:!0}),li();let n=Ge(),r=n.getUser();n.addScopeListener(o=>{let i=o.getUser();(r?.id!==i?.id||r?.ip_address!==i?.ip_address)&&(li(),r=i)}),t==="route"&&Gr(({from:o,to:i})=>{o!==i&&(is({ignoreDuration:!0}),li())})}}};var n1="CultureContext",r1=(()=>({name:n1,preprocessEvent(e){let t=xE();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=xE();t&&yo(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})),RE=r1;function xE(){try{let e=J.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var o1="GlobalHandlers",i1=((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:o1,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(s1(n),bE("onerror")),t.onunhandledrejection&&(a1(n),bE("onunhandledrejection"))}}}),kE=i1;function s1(e){pa(t=>{let{stackParser:n,attachStacktrace:r}=NE();if(z()!==e||nm())return;let{msg:o,url:i,line:s,column:a,error:l}=t,c=u1(au(n,l||o,void 0,r,!1),i,s,a);c.level="error",os(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function a1(e){ma(t=>{let{stackParser:n,attachStacktrace:r}=NE();if(z()!==e||nm())return;let o=l1(t),i=en(o)?c1(o):au(n,o,void 0,r,!0);i.level="error",os(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function l1(e){if(en(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 c1(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function u1(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:d1(t)??sn(),function:"?",in_app:!0}),e}function bE(e){Ye&&C.log(`Global Handler attached: ${e}`)}function NE(){return z()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function d1(e){if(!(!At(e)||e.length===0))return e.startsWith("data:")?`<${Ot(e,!1)}>`:e}var AE=()=>({name:"HttpContext",preprocessEvent(e){if(!J.navigator&&!J.location&&!J.document)return;let t=ds(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){if(!J.navigator&&!J.location&&!J.document)return;let t=ds();yo(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers["User-Agent"],"http.request.header.referer":t.headers.Referer})}});var f1="cause",p1=5,m1="LinkedErrors",h1=((e={})=>{let t=e.limit||p1,n=e.key||f1;return{name:m1,preprocessEvent(r,o,i){let s=i.getOptions();Kp(iu,s.stackParser,n,t,r,o)}}}),ME=h1;var g1=/^HTML(\w*)Element$/;function ol(e){if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(bm(e)){let t=y1(e);if(g1.test(t))return`[HTMLElement: ${Ae(e)}]`}}function y1(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function PE(){return S1()?(Ye&&Et(()=>{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 S1(){if(typeof J.window>"u")return!1;let e=J;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let n=sn();return!(J===J.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function LE(e){return[Qc(),Jc(),Xp(),wE(),TE(),kE(),ME(),eu(),AE(),RE(),CE()]}function Nm(e={}){let t=!e.skipBrowserExtensionCheck&&PE(),n=e.defaultIntegrations==null?LE():e.defaultIntegrations,r={...e,enabled:t?!1:e.enabled,stackParser:Ec(e.stackParser||vE),integrations:Lp({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||_E};return Vi(ol),zp(lu,r)}function Ru(e={}){let t=J.document,n=t?.head||t?.body;if(!n){Ye&&C.error("[showReportDialog] Global document not defined");return}let r=Q(),i=z()?.getDsn();if(!i){Ye&&C.error("[showReportDialog] DSN not configured");return}let s={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||Ba()},a=J.document.createElement("script");a.async=!0,a.crossOrigin="anonymous",a.src=Mp(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{J.removeEventListener("message",u)}};J.addEventListener("message",u)}n.appendChild(a)}var Oe=W,sh="sentryReplaySession",_1="replay_event",ah="Unable to send Replay",v1=3e5,E1=9e5,T1=5e3,I1=5500,w1=6e4,C1=5e3,x1=3,OE=15e4,bu=5e3,R1=3e3,b1=300,lh=2e7,k1=4999,N1=5e4,DE=36e5,A1=Object.defineProperty,M1=(e,t,n)=>t in e?A1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,UE=(e,t,n)=>M1(e,typeof t!="symbol"?t+"":t,n),ct=(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))(ct||{});function P1(e){return e.nodeType===e.ELEMENT_NODE}function al(e){return e?.host?.shadowRoot===e}function ll(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function L1(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 O1(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 Pu(e){try{let t=e.rules||e.cssRules;return t?L1(Array.from(t,aT).join("")):null}catch{return null}}function D1(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 aT(e){let t;if(F1(e))try{t=Pu(e.styleSheet)||O1(e)}catch{}else if(B1(e)){let n=e.cssText,r=e.selectorText.includes(":"),o=typeof e.style.all=="string"&&e.style.all;if(o&&(n=D1(e)),r&&(n=U1(n)),r||o)return n}return t||e.cssText}function U1(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function F1(e){return"styleSheet"in e}function B1(e){return"selectorText"in e}var Lu=class{constructor(){UE(this,"idNodeMap",new Map),UE(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 H1(){return new Lu}function Yu({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 ul({isMasked:e,element:t,value:n,maskInputFn:r}){let o=n||"";return e?(r&&(o=r(o,t)),"*".repeat(o.length)):o}function Cs(e){return e.toLowerCase()}function Dm(e){return e.toUpperCase()}var FE="__rrweb_original__";function $1(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=FE in i?i[FE]: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 ch(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Cs(t):null}function Ou(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function lT(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 BE={};function cT(e){let t=BE[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 BE[e]=r.bind(window)}function Um(...e){return cT("setTimeout")(...e)}function uT(...e){return cT("clearTimeout")(...e)}function dT(e){try{return e.contentDocument}catch{}}function z1(e){try{return e.contentWindow}catch{}}var j1=1,W1=new RegExp("[^a-z0-9-_:]"),dl=-2;function uh(){return j1++}function G1(e){if(e instanceof HTMLFormElement)return"form";let t=Cs(e.tagName);return W1.test(t)?"div":t}function V1(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var Ss,HE,q1=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Y1=/^(?:[a-z+]+:)?\/\//i,K1=/^www\..*/i,J1=/^(data:)([^,]*),(.*)/i;function X1(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 Du(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(Y1.test(l)||K1.test(l))return`url(${c}${l}${c})`;if(J1.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${V1(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 Q1=/^[^ \t\n\r\u000c]+/,Z1=/^[, \t\n\r\u000c]+/;function eM(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(Z1),!(n>=t.length);){let i=r(Q1);if(i.slice(-1)===",")i=Es(e,i.substring(0,i.length-1)),o.push(i);else{let s="";i=Es(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 $E=new WeakMap;function Es(e,t){return!t||t.trim()===""?t:Ku(e,t)}function tM(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Ku(e,t){let n=$E.get(e);if(n||(n=e.createElement("a"),$E.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function fT(e,t,n,r,o,i,s){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return Es(e,r);if(n==="xlink:href"&&r[0]!=="#")return Es(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return Es(e,r);if(n==="srcset")return eM(e,r);if(n==="style"){let a=Du(r,Ku(e));return s&&s.size>0&&(a=X1(a,s)),a}else if(t==="object"&&n==="data")return Es(e,r);return typeof i=="function"?i(n,r,o):r}function pT(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function nM(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 rM(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function yi(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:yi(e.parentNode,t,n,r+1)}function Ts(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(rM(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function xs(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=yi(s,Ts(r,o)),l<0)return!0;a=yi(s,Ts(t,n),l>=0?l:1/0)}else{if(a=yi(s,Ts(t,n)),a<0)return!1;l=yi(s,Ts(r,o),a>=0?a:1/0)}return a>=0?l>=0?a<=l:!0:l>=0?!1:!!i}catch{}return!!i}function oM(e,t,n){let r=z1(e);if(!r)return;let o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){let a=Um(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{uT(a),o=!0,t()});return}let s="about:blank";if(r.location.href!==s||e.src===s||e.src==="")return Um(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function iM(e,t,n){let r=!1,o;try{o=e.sheet}catch{o=null}if(o)return;let i=Um(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{uT(i),r=!0,t()})}function sM(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:x,newlyAddedElement:M=!1,ignoreCSSAttributes:A}=t,I=aM(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ct.Document,childNodes:[],compatMode:e.compatMode}:{type:ct.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ct.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return cM(e,{doc:n,blockClass:o,blockSelector:i,unblockSelector:s,inlineStylesheet:h,maskAttributeFn:l,maskInputOptions:y,maskInputFn:T,dataURLOptions:g,inlineImages:S,recordCanvas:E,keepIframeSrcFn:x,newlyAddedElement:M,rootId:I,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:p,ignoreCSSAttributes:A});case e.TEXT_NODE:return lM(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:ct.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:ct.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function aM(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function lM(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=Pu(e.parentNode.sheet))}catch(g){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${g}`,e)}p=Du(p,Ku(t.doc))}y&&(p="SCRIPT_PLACEHOLDER");let T=xs(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=Yu({type:null,tagName:d,maskInputOptions:l});p=ul({isMasked:xs(e,r,i,o,s,g),element:e,value:p,maskInputFn:c})}return{type:ct.Text,textContent:p||"",isStyle:h,rootId:u}}function cM(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:x}=t,M=nM(e,r,o,i),A=G1(e),I={},N=e.attributes.length;for(let R=0;R<N;R++){let $=e.attributes[R];$.name&&!pT(A,$.name,$.value)&&(I[$.name]=fT(n,A,Cs($.name),$.value,e,l,x))}if(A==="link"&&s){let R=Array.from(n.styleSheets).find(j=>j.href===e.href),$=null;R&&($=Pu(R)),$&&(I.rel=null,I.href=null,I.crossorigin=null,I._cssText=Du($,R.href))}if(A==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){let R=Pu(e.sheet);R&&(I._cssText=Du(R,Ku(n)))}if(A==="input"||A==="textarea"||A==="select"||A==="option"){let R=e,$=ch(R),j=Ou(R,Dm(A),$),pe=R.checked;if($!=="submit"&&$!=="button"&&j){let Y=xs(R,T,S,g,E,Yu({type:$,tagName:Dm(A),maskInputOptions:a}));I.value=ul({isMasked:Y,element:R,value:j,maskInputFn:c})}pe&&(I.checked=pe)}if(A==="option"&&(e.selected&&!a.select?I.selected=!0:delete I.selected),A==="canvas"&&p){if(e.__context==="2d")$1(e)||(I.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){let R=e.toDataURL(u.type,u.quality),$=n.createElement("canvas");$.width=e.width,$.height=e.height;let j=$.toDataURL(u.type,u.quality);R!==j&&(I.rr_dataURL=R)}}if(A==="img"&&d){Ss||(Ss=n.createElement("canvas"),HE=Ss.getContext("2d"));let R=e,$=R.currentSrc||R.getAttribute("src")||"<unknown-src>",j=R.crossOrigin,pe=()=>{R.removeEventListener("load",pe);try{Ss.width=R.naturalWidth,Ss.height=R.naturalHeight,HE.drawImage(R,0,0),I.rr_dataURL=Ss.toDataURL(u.type,u.quality)}catch(Y){if(R.crossOrigin!=="anonymous"){R.crossOrigin="anonymous",R.complete&&R.naturalWidth!==0?pe():R.addEventListener("load",pe);return}else console.warn(`Cannot inline img src=${$}! Error: ${Y}`)}R.crossOrigin==="anonymous"&&(j?I.crossOrigin=j:R.removeAttribute("crossorigin"))};R.complete&&R.naturalWidth!==0?pe():R.addEventListener("load",pe)}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:R,height:$}=e.getBoundingClientRect();I={class:I.class,rr_width:`${R}px`,rr_height:`${$}px`}}A==="iframe"&&!h(I.src)&&(!M&&!dT(e)&&(I.rr_src=I.src),delete I.src);let U;try{customElements.get(A)&&(U=!0)}catch{}return{type:ct.Element,tagName:A,attributes:I,childNodes:[],isSVG:tM(e)||void 0,needBlock:M,rootId:_,isCustom:U}}function Le(e){return e==null?"":e.toLowerCase()}function uM(e,t){if(t.comment&&e.type===ct.Comment)return!0;if(e.type===ct.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"&&lT(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(Le(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Le(e.attributes.name)==="application-name"||Le(e.attributes.rel)==="icon"||Le(e.attributes.rel)==="apple-touch-icon"||Le(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&Le(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Le(e.attributes.property).match(/^(og|twitter|fb):/)||Le(e.attributes.name).match(/^(og|twitter):/)||Le(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(Le(e.attributes.name)==="robots"||Le(e.attributes.name)==="googlebot"||Le(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(Le(e.attributes.name)==="author"||Le(e.attributes.name)==="generator"||Le(e.attributes.name)==="framework"||Le(e.attributes.name)==="publisher"||Le(e.attributes.name)==="progid"||Le(e.attributes.property).match(/^article:/)||Le(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(Le(e.attributes.name)==="google-site-verification"||Le(e.attributes.name)==="yandex-verification"||Le(e.attributes.name)==="csrf-token"||Le(e.attributes.name)==="p:domain_verify"||Le(e.attributes.name)==="verify-v1"||Le(e.attributes.name)==="verification"||Le(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Is(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:x=!1,recordCanvas:M=!1,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N=5e3,onBlockedImageLoad:U,onStylesheetLoad:R,stylesheetLoadTimeout:$=5e3,keepIframeSrcFn:j=()=>!1,newlyAddedElement:pe=!1,ignoreCSSAttributes:Y}=t,{preserveWhiteSpace:qe=!0}=t,ce=sM(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:x,recordCanvas:M,keepIframeSrcFn:j,newlyAddedElement:pe,ignoreCSSAttributes:Y});if(!ce)return console.warn(e,"not serialized"),null;let le;r.hasNode(e)?le=r.getId(e):uM(ce,S)||!qe&&ce.type===ct.Text&&!ce.isStyle&&!ce.textContent.trim().length?le=dl:le=uh();let D=Object.assign(ce,{id:le});if(r.add(e,D),le===dl)return null;A&&A(e);let me=!p;if(D.type===ct.Element){me=me&&!D.needBlock;let K=e.shadowRoot;K&&ll(K)&&(D.isShadowHost=!0)}if((D.type===ct.Document||D.type===ct.Element)&&me){S.headWhitespace&&D.type===ct.Element&&D.tagName==="head"&&(qe=!1);let K={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:x,recordCanvas:M,preserveWhiteSpace:qe,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onBlockedImageLoad:U,onStylesheetLoad:R,stylesheetLoadTimeout:$,keepIframeSrcFn:j,ignoreCSSAttributes:Y},ae=e.childNodes?Array.from(e.childNodes):[];for(let Se of ae){let he=Is(Se,K);he&&D.childNodes.push(he)}if(P1(e)&&e.shadowRoot)for(let Se of Array.from(e.shadowRoot.childNodes)){let he=Is(Se,K);he&&(ll(e.shadowRoot)&&(he.isShadow=!0),D.childNodes.push(he))}}if(e.parentNode&&al(e.parentNode)&&ll(e.parentNode)&&(D.isShadow=!0),D.type===ct.Element&&D.tagName==="iframe"&&!D.needBlock&&oM(e,()=>{let K=dT(e);if(K&&I){let ae=Is(K,{doc:K,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:x,recordCanvas:M,preserveWhiteSpace:qe,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onStylesheetLoad:R,stylesheetLoadTimeout:$,keepIframeSrcFn:j,ignoreCSSAttributes:Y});ae&&I(e,ae)}},N),D.type===ct.Element&&D.tagName==="img"&&!e.complete&&D.needBlock){let K=e,ae=()=>{if(K.isConnected&&!K.complete&&U)try{let Se=K.getBoundingClientRect();Se.width>0&&Se.height>0&&U(K,D,Se)}catch{}K.removeEventListener("load",ae)};K.isConnected&&K.addEventListener("load",ae)}return D.type===ct.Element&&D.tagName==="link"&&typeof D.attributes.rel=="string"&&(D.attributes.rel==="stylesheet"||D.attributes.rel==="preload"&&typeof D.attributes.href=="string"&&lT(D.attributes.href)==="css")&&iM(e,()=>{if(R){let K=Is(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:x,recordCanvas:M,preserveWhiteSpace:qe,onSerialize:A,onIframeLoad:I,iframeLoadTimeout:N,onStylesheetLoad:R,stylesheetLoadTimeout:$,keepIframeSrcFn:j,ignoreCSSAttributes:Y});K&&R(e,K)}},$),D.type===ct.Element&&delete D.needBlock,D}function dM(e,t){let{mirror:n=new Lu,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:x,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:I,onBlockedImageLoad:N,onStylesheetLoad:U,stylesheetLoadTimeout:R,keepIframeSrcFn:$=()=>!1,ignoreCSSAttributes:j=new Set([])}=t||{};return Is(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:x,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:I,onBlockedImageLoad:N,onStylesheetLoad:U,stylesheetLoadTimeout:R,keepIframeSrcFn:$,newlyAddedElement:!1,ignoreCSSAttributes:j})}function qt(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var _s=`Please stop import mirror directly. Instead of that,\r
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.`,zE={map:{},getId(){return console.error(_s),-1},getNode(){return console.error(_s),null},removeNodeFromMap(){console.error(_s)},has(){return console.error(_s),!1},reset(){console.error(_s)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(zE=new Proxy(zE,{get(e,t,n){return t==="map"&&console.error(_s),Reflect.get(e,t,n)}}));function fl(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&&(yM(r),r=null),o=s,e.apply(l,i)):!r&&n.trailing!==!1&&(r=Ju(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(l,i)},a))}}function mT(e,t,n,r,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(s){Ju(()=>{n.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>mT(e,t,i||{},!0)}function dh(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 Uu=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Uu=()=>new Date().getTime());function hT(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 gT(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function yT(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ST(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function vn(e,t,n,r,o){if(!e)return!1;let i=ST(e);if(!i)return!1;let s=Ts(t,n);if(!o){let c=r&&i.matches(r);return s(i)&&!c}let a=yi(i,s),l=-1;return a<0?!1:(r&&(l=yi(i,Ts(null,r))),a>-1&&l<0?!0:a<l)}function fM(e,t){return t.getId(e)!==-1}function Am(e,t){return t.getId(e)===dl}function _T(e,t){if(al(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?_T(e.parentNode,t):!0:!0}function Fm(e){return!!e.changedTouches}function pM(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 vT(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function ET(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Bm(e){return!!e?.shadowRoot}var Hm=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 TT(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function mM(e){let t=e,n;for(;n=TT(t);)t=n;return t}function hM(e){let t=e.ownerDocument;if(!t)return!1;let n=mM(e);return t.contains(n)}function IT(e){let t=e.ownerDocument;return t?t.contains(e)||hM(e):!1}var jE={};function fh(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 gM(...e){return fh("requestAnimationFrame")(...e)}function Ju(...e){return fh("setTimeout")(...e)}function yM(...e){return fh("clearTimeout")(...e)}var fe=(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))(fe||{}),ie=(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))(ie||{}),Vt=(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))(Vt||{}),Vr=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Vr||{}),vs=(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))(vs||{}),cl;function SM(e){cl=e}function _M(){cl=void 0}var Te=e=>cl?((...n)=>{try{return e(...n)}catch(r){if(cl&&cl(r)===!0)return()=>{};throw r}}):e,WE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",vM=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(il=0;il<WE.length;il++)vM[WE.charCodeAt(il)]=il;var il,Fu=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function ph(e){try{return e.contentDocument}catch{}}function pl(e){try{return e.contentWindow}catch{}}var $m=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 GE(e){return"__ln"in e}var zm=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&&GE(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&&GE(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--)}},VE=(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 zm,o=l=>{let c=l,u=dl;for(;u===dl;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},i=l=>{if(!l.parentNode||!IT(l))return;let c=al(l.parentNode)?this.mirror.getId(TT(l)):this.mirror.getId(l.parentNode),u=o(l);if(c===-1||u===-1)return r.addNode(l);let d=Is(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=>{vT(p,this.mirror)&&!vn(p,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(p),ET(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Bm(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,this.doc)},onIframeLoad:(p,h)=>{if(vn(p,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(p,h);let y=pl(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)!YE(this.droppedSet,l)&&!qE(this.removes,l,this.mirror)||YE(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(!Am(t.target,this.mirror))switch(t.type){case"characterData":{let n=t.target.textContent;!vn(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:xs(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,ST(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=ch(n),a=n.tagName;o=Ou(n,a,s);let l=Yu({maskInputOptions:this.maskInputOptions,tagName:a,type:s}),c=xs(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,l);o=ul({isMasked:c,element:n,value:o,maskInputFn:this.maskInputFn})}if(vn(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(!ph(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"),!pT(n.tagName,r)&&(i.attributes[r]=fT(this.doc,Cs(n.tagName),Cs(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(vn(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=al(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);vn(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Am(n,this.mirror)||!fM(n,this.mirror)||(this.addedSet.has(n)?(Wm(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||_T(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[VE(r,o)]?Wm(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:al(t.target)&&ll(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(Am(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[VE(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);vn(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),Bm(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 $m(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 Wm(e,t){e.delete(t),t.childNodes?.forEach(n=>Wm(e,n))}function qE(e,t,n){return e.length===0?!1:EM(e,t,n)}function EM(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 YE(e,t){return e.size===0?!1:wT(e,t)}function wT(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:wT(e,n):!1}var ws=[];function Sl(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 CT(e,t){let n=new jm;ws.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(Te(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 TM({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=fl(Te(d=>{let p=Date.now()-a;e(s.map(h=>(h.timeOffset-=p,h)),d),s=[],a=null}),i),c=Te(fl(Te(d=>{let p=Sl(d),{clientX:h,clientY:y}=Fm(d)?d.changedTouches[0]:d;a||(a=Uu()),s.push({x:h,y,id:r.getId(p),timeOffset:Uu()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?ie.Drag:d instanceof MouseEvent?ie.MouseMove:ie.TouchMove)}),o,{trailing:!1})),u=[qt("mousemove",c,n),qt("touchmove",c,n),qt("drag",c,n)];return Te(()=>{u.forEach(d=>d())})}function IM({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=Sl(p);if(vn(h,r,o,i,!0))return;let y=null,_=d;if("pointerType"in p){switch(p.pointerType){case"mouse":y=Vr.Mouse;break;case"touch":y=Vr.Touch;break;case"pen":y=Vr.Pen;break}y===Vr.Touch?Vt[d]===Vt.MouseDown?_="TouchStart":Vt[d]===Vt.MouseUp&&(_="TouchEnd"):Vr.Pen}else Fm(p)&&(y=Vr.Touch);y!==null?(c=y,(_.startsWith("Touch")&&y===Vr.Touch||_.startsWith("Mouse")&&y===Vr.Mouse)&&(y=null)):Vt[d]===Vt.Click&&(y=c,c=null);let T=Fm(p)?p.changedTouches[0]:p;if(!T)return;let g=n.getId(h),{clientX:S,clientY:E}=T;Te(e)({type:Vt[_],id:g,x:S,y:E,...y!==null&&{pointerType:y}})};return Object.keys(Vt).filter(d=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&a[d]!==!1).forEach(d=>{let p=Cs(d),h=u(d);if(window.PointerEvent)switch(Vt[d]){case Vt.MouseDown:case Vt.MouseUp:p=p.replace("mouse","pointer");break;case Vt.TouchStart:case Vt.TouchEnd:return}l.push(qt(p,h,t))}),Te(()=>{l.forEach(d=>d())})}function xT({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,sampling:s}){let a=Te(fl(Te(l=>{let c=Sl(l);if(!c||vn(c,r,o,i,!0))return;let u=n.getId(c);if(c===t&&t.defaultView){let d=hT(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 qt("scroll",a,t)}function wM({viewportResizeCb:e},{win:t}){let n=-1,r=-1,o=Te(fl(Te(()=>{let i=gT(),s=yT();(n!==i||r!==s)&&(e({width:Number(s),height:Number(i)}),n=i,r=s)}),200));return qt("resize",o,t)}var CM=["INPUT","TEXTAREA","SELECT"],KE=new WeakMap;function xM({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=Sl(I),U=I.isTrusted,R=N&&Dm(N.tagName);if(R==="OPTION"&&(N=N.parentElement),!N||!R||CM.indexOf(R)<0||vn(N,r,o,i,!0))return;let $=N;if($.classList.contains(s)||a&&$.matches(a))return;let j=ch(N),pe=Ou($,R,j),Y=!1,qe=Yu({maskInputOptions:l,tagName:R,type:j}),ce=xs(N,p,y,h,_,qe);(j==="radio"||j==="checkbox")&&(Y=N.checked),pe=ul({isMasked:ce,element:N,value:pe,maskInputFn:c}),g(N,d?{text:pe,isChecked:Y,userTriggered:U}:{text:pe,isChecked:Y});let le=N.name;j==="radio"&&le&&Y&&t.querySelectorAll(`input[type="radio"][name="${le}"]`).forEach(D=>{if(D!==N){let me=ul({isMasked:ce,element:D,value:Ou(D,R,j),maskInputFn:c});g(D,d?{text:me,isChecked:!Y,userTriggered:!1}:{text:me,isChecked:!Y})}})}function g(I,N){let U=KE.get(I);if(!U||U.text!==N.text||U.isChecked!==N.isChecked){KE.set(I,N);let R=n.getId(I);Te(e)({...N,id:R})}}let E=(u.input==="last"?["change"]:["input","change"]).map(I=>qt(I,Te(T),t)),x=t.defaultView;if(!x)return()=>{E.forEach(I=>I())};let M=x.Object.getOwnPropertyDescriptor(x.HTMLInputElement.prototype,"value"),A=[[x.HTMLInputElement.prototype,"value"],[x.HTMLInputElement.prototype,"checked"],[x.HTMLSelectElement.prototype,"value"],[x.HTMLTextAreaElement.prototype,"value"],[x.HTMLSelectElement.prototype,"selectedIndex"],[x.HTMLOptionElement.prototype,"selected"]];return M&&M.set&&E.push(...A.map(I=>mT(I[0],I[1],{set(){Te(T)({target:this,isTrusted:!1})}},!1,x))),Te(()=>{E.forEach(I=>I())})}function Bu(e){let t=[];function n(r,o){if(ku("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||ku("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||ku("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||ku("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 To(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function RM({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:Te((u,d,p)=>{let[h,y]=p,{id:_,styleId:T}=To(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:Te((u,d,p)=>{let[h]=p,{id:y,styleId:_}=To(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:Te((u,d,p)=>{let[h]=p,{id:y,styleId:_}=To(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:Te((u,d,p)=>{let[h]=p,{id:y,styleId:_}=To(d,t,n.styleMirror);return(y&&y!==-1||_&&_!==-1)&&e({id:y,styleId:_,replaceSync:h}),u.apply(d,p)})}));let l={};Nu("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(Nu("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),Nu("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),Nu("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:Te((p,h,y)=>{let[_,T]=y,{id:g,styleId:S}=To(h.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,adds:[{rule:_,index:[...Bu(h),T||0]}]}),p.apply(h,y)})}),d.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:Te((p,h,y)=>{let[_]=y,{id:T,styleId:g}=To(h.parentStyleSheet,t,n.styleMirror);return(T&&T!==-1||g&&g!==-1)&&e({id:T,styleId:g,removes:[{index:[...Bu(h),_]}]}),p.apply(h,y)})})}),Te(()=>{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 RT({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}}),Te(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function bM({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Te((a,l,c)=>{let[u,d,p]=c;if(n.has(u))return i.apply(l,[u,d,p]);let{id:h,styleId:y}=To(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:Bu(l.parentRule)}),a.apply(l,c)})});let s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Te((a,l,c)=>{let[u]=c;if(n.has(u))return s.apply(l,[u]);let{id:d,styleId:p}=To(l.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||p&&p!==-1)&&e({id:d,styleId:p,remove:{property:u},index:Bu(l.parentRule)}),a.apply(l,c)})}),Te(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s})}function kM({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:o,sampling:i,doc:s}){let a=Te(c=>fl(Te(u=>{let d=Sl(u);if(!d||vn(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=[qt("play",a(vs.Play),s),qt("pause",a(vs.Pause),s),qt("seeked",a(vs.Seeked),s),qt("volumechange",a(vs.VolumeChange),s),qt("ratechange",a(vs.RateChange),s)];return Te(()=>{l.forEach(c=>c())})}function NM({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=dh(t.fonts,"add",function(a){return function(l){return Ju(Te(()=>{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),Te(()=>{r.forEach(a=>a())})}function AM(e){let{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:i,selectionCb:s}=e,a=!0,l=Te(()=>{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;vn(y,r,o,i,!0)||vn(T,r,o,i,!0)||u.push({start:n.getId(y),startOffset:_,end:n.getId(T),endOffset:g})}s({ranges:u})});return l(),qt("selectionchange",l)}function MM({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:dh(n.customElements,"define",function(o){return function(i,s,a){try{t({define:{name:i}})}catch{}return o.apply(this,[i,s,a])}})}function PM(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=CT(e,e.doc));let o=TM(e),i=IM(e),s=xT(e),a=wM(e,{win:n}),l=xM(e),c=kM(e),u=()=>{},d=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(u=RM(e,{win:n}),d=RT(e,e.doc),p=bM(e,{win:n}),e.collectFonts&&(h=NM(e)));let y=AM(e),_=MM(e),T=[];for(let g of e.plugins)T.push(g.observer(g.callback,n,g.options));return Te(()=>{ws.forEach(g=>g.reset()),r?.disconnect(),o(),i(),s(),a(),l(),c(),u(),d(),p(),h(),y(),_(),T.forEach(g=>g())})}function ku(e){return typeof window[e]<"u"}function Nu(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ml=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}},Gm=class{constructor(){this.crossOriginIframeMirror=new ml(uh),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},Vm=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ml(uh),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ml(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=pl(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&&pl(t)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(t);let r=ph(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 fe.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:fe.IncrementalSnapshot,data:{source:ie.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case fe.Meta:case fe.Load:case fe.DomContentLoaded:return!1;case fe.Plugin:return n;case fe.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case fe.IncrementalSnapshot:switch(n.data.source){case ie.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 ie.Drag:case ie.TouchMove:case ie.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case ie.ViewportResize:return!1;case ie.MediaInteraction:case ie.MouseInteraction:case ie.Scroll:case ie.CanvasMutation:case ie.Input:return this.replaceIds(n.data,t,["id"]),n;case ie.StyleSheetRule:case ie.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case ie.Font:return n;case ie.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case ie.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!==ct.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}},qm=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},Ym=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(!ll(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);let r=CT({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(xT({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),Ju(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(RT({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){let n=ph(t),r=pl(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){let r=this;this.restoreHandlers.push(dh(t.prototype,"attachShadow",function(o){return function(i){let s=o.call(this,i);return this.shadowRoot&&IT(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()}},Km=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Hm,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:aT(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){}},Jm=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,gM(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}},et,Hu;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 or=H1();function ir(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:x,maxCanvasSize:M=null,packFn:A,sampling:I={},dataURLOptions:N={},mousemoveWait:U,recordDOM:R=!0,recordCanvas:$=!1,recordCrossOriginIframes:j=!1,recordAfter:pe=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:Y=!1,collectFonts:qe=!1,inlineImages:ce=!1,plugins:le,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:me=new Set([]),errorHandler:K,onMutation:ae,getCanvasManager:Se}=e;SM(K);let he=j?window.parent===window:!0,nt=!1;if(!he)try{window.parent.document&&(nt=!1)}catch{nt=!0}if(he&&!t)throw new Error("emit function is required");if(!he&&!nt)return()=>{};U!==void 0&&I.mousemove===void 0&&(I.mousemove=U),or.reset();let We=_===!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:{},$t=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||{};pM();let rt,Qt=0,mn=X=>{for(let Me of le||[])Me.eventProcessor&&(X=Me.eventProcessor(X));return A&&!nt&&(X=A(X)),X};et=(X,Me)=>{let ue=X;if(ue.timestamp=Uu(),ws[0]?.isFrozen()&&ue.type!==fe.FullSnapshot&&!(ue.type===fe.IncrementalSnapshot&&ue.data.source===ie.Mutation)&&ws.forEach(Fe=>Fe.unfreeze()),he)t?.(mn(ue),Me);else if(nt){let Fe={type:"rrweb",event:mn(ue),origin:window.location.origin,isCheckout:Me};window.parent.postMessage(Fe,"*")}if(ue.type===fe.FullSnapshot)rt=ue,Qt=0;else if(ue.type===fe.IncrementalSnapshot){if(ue.data.source===ie.Mutation&&ue.data.isAttachIframe)return;Qt++;let Fe=r&&Qt>=r,te=n&&rt&&ue.timestamp-rt.timestamp>n;(Fe||te)&&ft(!0)}};let Rn=X=>{et({type:fe.IncrementalSnapshot,data:{source:ie.Mutation,...X}})},ao=X=>et({type:fe.IncrementalSnapshot,data:{source:ie.Scroll,...X}}),lo=X=>et({type:fe.IncrementalSnapshot,data:{source:ie.CanvasMutation,...X}}),Bi=X=>et({type:fe.IncrementalSnapshot,data:{source:ie.AdoptedStyleSheet,...X}}),P=new Km({mutationCb:Rn,adoptedStyleSheetCb:Bi}),F=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Gm:new Vm({mirror:or,mutationCb:Rn,stylesheetManager:P,recordCrossOriginIframes:j,wrappedEmit:et});for(let X of le||[])X.getMirror&&X.getMirror({nodeMirror:or,crossOriginIframeMirror:F.crossOriginIframeMirror,crossOriginIframeStyleMirror:F.crossOriginIframeStyleMirror});let ee=new Jm,se=OM(Se,{mirror:or,win:window,mutationCb:X=>et({type:fe.IncrementalSnapshot,data:{source:ie.CanvasMutation,...X}}),recordCanvas:$,blockClass:o,blockSelector:i,unblockSelector:s,maxCanvasSize:M,sampling:I.canvas,dataURLOptions:N,errorHandler:K}),_e=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new qm:new Ym({mutationCb:Rn,scrollCb:ao,bypassOptions:{onMutation:ae,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,inlineStylesheet:y,maskInputOptions:We,dataURLOptions:N,maskAttributeFn:S,maskTextFn:x,maskInputFn:E,recordCanvas:$,inlineImages:ce,sampling:I,slimDOMOptions:$t,iframeManager:F,stylesheetManager:P,canvasManager:se,keepIframeSrcFn:D,processedNodeManager:ee,ignoreCSSAttributes:me},mirror:or}),ft=(X=!1)=>{if(!R)return;et({type:fe.Meta,data:{href:window.location.href,width:yT(),height:gT()}},X),P.reset(),_e.init(),ws.forEach(ue=>ue.lock());let Me=dM(document,{mirror:or,blockClass:o,blockSelector:i,unblockSelector:s,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,inlineStylesheet:y,maskAllInputs:We,maskAttributeFn:S,maskInputFn:E,maskTextFn:x,slimDOM:$t,dataURLOptions:N,recordCanvas:$,inlineImages:ce,onSerialize:ue=>{vT(ue,or)&&F.addIframe(ue),ET(ue,or)&&P.trackLinkElement(ue),Bm(ue)&&_e.addShadowRoot(ue.shadowRoot,document)},onIframeLoad:(ue,Fe)=>{F.attachIframe(ue,Fe);let te=pl(ue);te&&se.addWindow(te),_e.observeAttachShadow(ue)},onStylesheetLoad:(ue,Fe)=>{P.attachLinkElement(ue,Fe)},onBlockedImageLoad:(ue,Fe,{width:te,height:bn})=>{Rn({adds:[],removes:[],texts:[],attributes:[{id:Fe.id,attributes:{style:{width:`${te}px`,height:`${bn}px`}}}]})},keepIframeSrcFn:D,ignoreCSSAttributes:me});if(!Me)return console.warn("Failed to snapshot the document");et({type:fe.FullSnapshot,data:{node:Me,initialOffset:hT(window)}}),ws.forEach(ue=>ue.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&P.adoptStyleSheets(document.adoptedStyleSheets,or.getId(document))};Hu=ft;try{let X=[],Me=Fe=>Te(PM)({onMutation:ae,mutationCb:Rn,mousemoveCb:(te,bn)=>et({type:fe.IncrementalSnapshot,data:{source:bn,positions:te}}),mouseInteractionCb:te=>et({type:fe.IncrementalSnapshot,data:{source:ie.MouseInteraction,...te}}),scrollCb:ao,viewportResizeCb:te=>et({type:fe.IncrementalSnapshot,data:{source:ie.ViewportResize,...te}}),inputCb:te=>et({type:fe.IncrementalSnapshot,data:{source:ie.Input,...te}}),mediaInteractionCb:te=>et({type:fe.IncrementalSnapshot,data:{source:ie.MediaInteraction,...te}}),styleSheetRuleCb:te=>et({type:fe.IncrementalSnapshot,data:{source:ie.StyleSheetRule,...te}}),styleDeclarationCb:te=>et({type:fe.IncrementalSnapshot,data:{source:ie.StyleDeclaration,...te}}),canvasMutationCb:lo,fontCb:te=>et({type:fe.IncrementalSnapshot,data:{source:ie.Font,...te}}),selectionCb:te=>{et({type:fe.IncrementalSnapshot,data:{source:ie.Selection,...te}})},customElementCb:te=>{et({type:fe.IncrementalSnapshot,data:{source:ie.CustomElement,...te}})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,maskInputOptions:We,inlineStylesheet:y,sampling:I,recordDOM:R,recordCanvas:$,inlineImages:ce,userTriggeredOnInput:Y,collectFonts:qe,doc:Fe,maskAttributeFn:S,maskInputFn:E,maskTextFn:x,keepIframeSrcFn:D,blockSelector:i,unblockSelector:s,slimDOMOptions:$t,dataURLOptions:N,mirror:or,iframeManager:F,stylesheetManager:P,shadowDomManager:_e,processedNodeManager:ee,canvasManager:se,ignoreCSSAttributes:me,plugins:le?.filter(te=>te.observer)?.map(te=>({observer:te.observer,options:te.options,callback:bn=>et({type:fe.Plugin,data:{plugin:te.name,payload:bn}})}))||[]},{});F.addLoadListener(Fe=>{try{X.push(Me(Fe.contentDocument))}catch(te){console.warn(te)}});let ue=()=>{ft(),X.push(Me(document))};return document.readyState==="interactive"||document.readyState==="complete"?ue():(X.push(qt("DOMContentLoaded",()=>{et({type:fe.DomContentLoaded,data:{}}),pe==="DOMContentLoaded"&&ue()})),X.push(qt("load",()=>{et({type:fe.Load,data:{}}),pe==="load"&&ue()},window))),()=>{X.forEach(Fe=>Fe()),ee.destroy(),Hu=void 0,_M()}}catch(X){console.warn(X)}}function LM(e){if(!Hu)throw new Error("please take full snapshot after start recording");Hu(e)}ir.mirror=or;ir.takeFullSnapshot=LM;function OM(e,t){try{return e?e(t):new Fu}catch{return console.warn("Unable to initialize CanvasManager"),new Fu}}var JE;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(JE||(JE={}));var DM=3,UM=5;function mh(e){return e>9999999999?e:e*1e3}function Mm(e){return e>9999999999?e/1e3:e}function _l(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:fe.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Mt(t,10,1e3)}}),t.category==="console")))}var FM="button,a";function bT(e){return e.closest(FM)||e}function kT(e){let t=NT(e);return!t||!(t instanceof Element)?t:bT(t)}function NT(e){return BM(e)?e.target:e}function BM(e){return typeof e=="object"&&!!e&&"target"in e}var Io;function HM(e){return Io||(Io=[],$M()),Io.push(e),()=>{let t=Io?Io.indexOf(e):-1;t>-1&&Io.splice(t,1)}}function $M(){Qe(Oe,"open",function(e){return function(...t){if(Io)try{Io.forEach(n=>n())}catch{}return e.apply(Oe,t)}})}var zM=new Set([ie.Mutation,ie.StyleSheetRule,ie.StyleDeclaration,ie.AdoptedStyleSheet,ie.CanvasMutation,ie.Selection,ie.MediaInteraction]);function jM(e,t,n){e.handleClick(t,n)}var Xm=class{constructor(t,n,r=_l){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=HM(()=>{this._lastMutation=XE()});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(GM(n,this._ignoreSelector)||!VM(t))return;let r={timestamp:Mm(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=Mm(t)}registerScroll(t=Date.now()){this._lastScroll=Mm(t)}registerClick(t){let n=bT(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=XE();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:Oe.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:Oe.location.href,route:n.getCurrentRoute(),clickCount:s,metric:!0}};this._addBreadcrumbEvent(n,l)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=gi(()=>this._checkClicks(),1e3)}},WM=["A","BUTTON","INPUT"];function GM(e,t){return!!(!WM.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 VM(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function XE(){return Date.now()/1e3}function qM(e,t){try{if(!YM(t))return;let{source:n}=t.data;if(zM.has(n)&&e.registerMutation(t.timestamp),n===ie.Scroll&&e.registerScroll(t.timestamp),KM(t)){let{type:r,id:o}=t.data,i=ir.mirror.getNode(o);i instanceof HTMLElement&&r===Vt.Click&&e.registerClick(i)}}catch{}}function YM(e){return e.type===DM}function KM(e){return e.data.source===ie.MouseInteraction}function Ir(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var Xu=(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))(Xu||{}),JM=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function XM(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(JM.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}var QM=e=>t=>{if(!e.isEnabled())return;let n=ZM(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&&jM(e.clickDetector,n,kT(t.event)),_l(e,n)};function AT(e,t){let n=ir.mirror.getId(e),r=n&&ir.mirror.getNode(n),o=r&&ir.mirror.getMeta(r),i=o&&tP(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===Xu.Text&&s.textContent).filter(Boolean).map(s=>s.trim()).join(""),attributes:XM(i.attributes)}}:{}}}function ZM(e){let{target:t,message:n}=eP(e);return Ir({category:`ui.${e.name}`,...AT(t,n)})}function eP(e){let t=e.name==="click",n,r=null;try{r=t?kT(e.event):NT(e.event),n=Ae(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function tP(e){return e.type===Xu.Element}function nP(e,t){if(!e.isEnabled())return;e.updateUserActivity();let n=rP(t);n&&_l(e,n)}function rP(e){let{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i,target:s}=e;if(!s||oP(s)||!i)return null;let a=t||r||o,l=i.length===1;if(!a&&l)return null;let c=Ae(s,{maxStringLength:200})||"<unknown>",u=AT(s,c);return Ir({category:"ui.keyDown",message:c,data:{...u.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:i}})}function oP(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}var iP={resource:uP,paint:lP,navigation:cP};function Pm(e,t){return({metric:n})=>{t.replayPerformanceEntries.push(e(n))}}function sP(e){return e.map(aP).filter(Boolean)}function aP(e){let t=iP[e.entryType];return t?t(e):null}function Rs(e){return((Pe()||Oe.performance.timeOrigin)+e)/1e3}function lP(e){let{duration:t,entryType:n,name:r,startTime:o}=e,i=Rs(o);return{type:n,name:r,start:i,end:i+t,data:void 0}}function cP(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:Rs(h),end:Rs(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 uP(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:Rs(i),end:Rs(o),name:r,data:{size:c,statusCode:l,decodedBodySize:s,encodedBodySize:a}}}function dP(e){let t=e.entries[e.entries.length-1],n=t?.element?[t.element]:void 0;return hh(e,"largest-contentful-paint",n)}function fP(e){return e.sources!==void 0}function pP(e){let t=[],n=[];for(let r of e.entries)if(fP(r)){let o=[];for(let i of r.sources)if(i.node){n.push(i.node);let s=ir.mirror.getId(i.node);s&&o.push(s)}t.push({value:r.value,nodeIds:o.length?o:void 0})}return hh(e,"cumulative-layout-shift",n,t)}function mP(e){let t=e.entries[e.entries.length-1],n=t?.target?[t.target]:void 0;return hh(e,"interaction-to-next-paint",n)}function hh(e,t,n,r){let o=e.value,i=e.rating,s=Rs(o);return{type:"web-vital",name:t,start:s,end:s,data:{value:o,size:o,rating:i,nodeIds:n?n.map(a=>ir.mirror.getId(a)):void 0,attributions:r}}}function hP(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(nr(o,n))}),r.push(zr(Pm(dP,e)),$r(Pm(pP,e)),fi(Pm(mP,e))),()=>{r.forEach(o=>o())}}var re=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,gP='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 yP(){let e=new Blob([gP]);return URL.createObjectURL(e)}var QE=["log","warn","error"],Mu="[Replay] ";function Lm(e,t="info"){_n({category:"console",data:{logger:"replay"},level:t,message:`${Mu}${e}`},{level:t})}function SP(){let e=!1,t=!1,n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return re?(QE.forEach(r=>{n[r]=(...o)=>{C[r](Mu,...o),t&&Lm(o.join(""),cs(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),C.error(Mu,r),e?Fr(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&Lm(r,"error")},n.infoTick=(...r)=>{C.log(Mu,...r),t&&setTimeout(()=>Lm(r[0]),0)}):QE.forEach(r=>{n[r]=()=>{}}),n}var oe=SP(),hl=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${lh}.`)}},$u=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>lh)throw new hl;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:mh(t)}},Qm=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++}},Zm=class{constructor(t){this._worker=new Qm(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=mh(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);let r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>lh?Promise.reject(new hl):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}},eh=class{constructor(t){this._fallback=new $u,this._compression=new Zm(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 _P({useCompression:e,workerUrl:t}){if(e&&window.Worker){let n=vP(t);if(n)return n}return re&&oe.log("Using simple buffer"),new $u}function vP(e){try{let t=e||EP();if(!t)return;re&&oe.log(`Using compression worker${e?` from ${e}`:""}`);let n=new Worker(t);return new eh(n)}catch(t){re&&oe.exception(t,"Failed to create compression worker")}}function EP(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?yP():""}function gh(){try{return"sessionStorage"in Oe&&!!Oe.sessionStorage}catch{return!1}}function TP(e){IP(),e.session=void 0}function IP(){if(gh())try{Oe.sessionStorage.removeItem(sh)}catch{}}function MT(e){return e===void 0?!1:Math.random()<e}function Qu(e){if(gh())try{Oe.sessionStorage.setItem(sh,JSON.stringify(e))}catch{}}function PT(e){let t=Date.now(),n=e.id||Ze(),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 wP(e,t){return MT(e)?"session":t?"buffer":!1}function ZE({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){let o=wP(e,t),i=PT({sampled:o,previousSessionId:r});return n&&Qu(i),i}function CP(){if(!gh())return null;try{let e=Oe.sessionStorage.getItem(sh);if(!e)return null;let t=JSON.parse(e);return re&&oe.infoTick("Loading existing session"),PT(t)}catch{return null}}function th(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function xP(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return th(e.started,t,r)||th(e.lastActivity,n,r)}function zu(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!xP(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function Om({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){let o=r.stickySession&&CP();return o?zu(o,{sessionIdleExpire:e,maxReplayDuration:t})?(re&&oe.infoTick("Session in sessionStorage is expired, creating new one..."),ZE(r,{previousSessionId:o.id})):o:(re&&oe.infoTick("Creating new session"),ZE(r,{previousSessionId:n}))}function RP(e){return e.type===fe.Custom}function yh(e,t,n){return OT(e,t)?(LT(e,t,n),!0):!1}function bP(e,t,n){return OT(e,t)?LT(e,t,n):Promise.resolve(null)}async function LT(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=kP(t,i.beforeAddRecordingEvent);return s?await r.addEvent(s):void 0}catch(i){let s=i&&i instanceof hl,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 OT(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;let n=mh(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 kP(e,t){try{if(typeof t=="function"&&RP(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 Sh(e){return!e.type}function nh(e){return e.type==="transaction"}function NP(e){return e.type==="replay_event"}function eT(e){return e.type==="feedback"}function AP(e){return(t,n)=>{if(!e.isEnabled()||!Sh(t)&&!nh(t))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(nh(t)){MP(e,t);return}PP(e,t)}}}function MP(e,t){let n=e.getContext();t.contexts?.trace?.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function PP(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)||gi(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(o){e.handleException(o)}})}function LP(e){return t=>{!e.isEnabled()||!Sh(t)||OP(e,t)}}function OP(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=Ir({category:"replay.hydrate-error",data:{url:sn()}});_l(e,r)}}function DP(e){let t=z();t&&t.on("beforeAddBreadcrumb",n=>UP(e,n))}function UP(e,t){if(!e.isEnabled()||!DT(t))return;let n=FP(t);n&&_l(e,n)}function FP(e){return!DT(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?BP(e):Ir(e)}function BP(e){let t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return Ir(e);let n=!1,r=t.map(o=>{if(!o)return o;if(typeof o=="string")return o.length>bu?(n=!0,`${o.slice(0,bu)}\u2026`):o;if(typeof o=="object")try{let i=Mt(o,7);return JSON.stringify(i).length>bu?(n=!0,`${JSON.stringify(i,null,2).slice(0,bu)}\u2026`):i}catch{}return o});return Ir({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function DT(e){return!!e.category}function HP(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function ju(){let e=Q().getPropagationContext().dsc;e&&delete e.replay_id;let t=Re();if(t){let n=lt(t);delete n.replay_id}}function tT(e){let t=Q().getPropagationContext().dsc;t&&(t.replay_id=e);let n=Re();if(n){let r=lt(n);r.replay_id=e}}function $P(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:fe.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 zP(e,t){return e.recordingMode!=="buffer"||t.message===ah||!t.exception||t.type?!1:MT(e.getOptions().errorSampleRate)}function jP(e){return Object.assign((t,n)=>{if(e.session&&zu(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&ju(),!e.isEnabled()||e.isPaused())return t;if(NP(t))return delete t.breadcrumbs,t;if(!Sh(t)&&!nh(t)&&!eT(t))return t;if(!e.checkAndHandleExpiredSession())return ju(),t;if(eT(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),$P(e,t),t;if(HP(t,n)&&!e.getOptions()._experiments.captureExceptions)return re&&oe.log("Ignoring error from rrweb internals",t),null;let o=zP(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&&Qu(s)}return t},{id:"Replay"})}function Zu(e,t){return t.map(({type:n,start:r,end:o,name:i,data:s})=>{let a=e.throttledAddEvent({type:fe.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 WP(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 GP(e){return t=>{if(!e.isEnabled())return;let n=WP(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(Zu(e,[n]),!1)))}}function VP(e,t){return re&&e.getOptions()._experiments.traceInternals?!1:Wp(t,z())}function UT(e,t){e.isEnabled()&&t!==null&&(VP(e,t.name)||e.addUpdate(()=>(Zu(e,[t]),!0)))}function ed(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=Iu(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function FT(e){if(!e)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}function Wu(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 BT(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 gl(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function wo(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 rh(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>OE,n=YP(e);if(t){let r=e.slice(0,OE);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 YP(e){let t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function Gu(e,t){let n=KP(e);return Tt(n,t)}function KP(e,t=Oe.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(Oe.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 JP(e,t,n){try{let r=await QP(e,t,n),o=BT("resource.fetch",r);UT(n.replay,o)}catch(r){re&&oe.exception(r,"Failed to capture fetch breadcrumb")}}function XP(e,t){let{input:n,response:r}=t,o=n?Cu(n):void 0,i=ed(o),s=r?FT(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 QP(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=Gu(s,n.networkDetailAllowUrls)&&!Gu(s,n.networkDetailDenyUrls),p=d?ZP(n,t.input,c):gl(c),h=await eL(d,n,t.response,u);return{startTimestamp:o,endTimestamp:i,url:s,method:a,statusCode:l,request:p,response:h}}function ZP({networkCaptureBodies:e,networkRequestHeaders:t},n,r){let o=n?rL(n,t):{};if(!e)return wo(o,r,void 0);let i=Cu(n),[s,a]=wu(i,oe),l=wo(o,r,s);return a?Wu(l,a):l}async function eL(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,o){if(!e&&o!==void 0)return gl(o);let i=r?HT(r.headers,n):{};if(!r||!t&&o!==void 0)return wo(i,o,void 0);let[s,a]=await nL(r),l=tL(s,{networkCaptureBodies:t,responseBodySize:o,captureDetails:e,headers:i});return a?Wu(l,a):l}function tL(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:o}){try{let i=e?.length&&n===void 0?ed(e):n;return r?t?wo(o,i,e):wo(o,i,void 0):gl(i)}catch(i){return re&&oe.exception(i,"Failed to serialize response body"),wo(o,n,void 0)}}async function nL(e){let t=oL(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await iL(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 HT(e,t){let n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function rL(e,t){return e.length===1&&typeof e[0]!="string"?nT(e[0],t):e.length===2?nT(e[1],t):{}}function nT(e,t){if(!e)return{};let n=e.headers;return n?n instanceof Headers?HT(n,t):Array.isArray(n)?{}:rh(n,t):{}}function oL(e){try{return e.clone()}catch(t){re&&oe.exception(t,"Failed to clone response body")}}function iL(e){return new Promise((t,n)=>{let r=gi(()=>n(new Error("Timeout while trying to read response body")),500);sL(e).then(o=>t(o),o=>n(o)).finally(()=>clearTimeout(r))})}async function sL(e){return await e.text()}async function aL(e,t,n){try{let r=cL(e,t,n),o=BT("resource.xhr",r);UT(n.replay,o)}catch(r){re&&oe.exception(r,"Failed to capture xhr breadcrumb")}}function lL(e,t){let{xhr:n,input:r}=t;if(!n)return;let o=ed(r),i=n.getResponseHeader("content-length")?FT(n.getResponseHeader("content-length")):fL(n.response,n.responseType);o!==void 0&&(e.data.request_body_size=o),i!==void 0&&(e.data.response_body_size=i)}function cL(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||!Gu(l,n.networkDetailAllowUrls)||Gu(l,n.networkDetailDenyUrls)){let A=gl(d),I=gl(p);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:u,request:A,response:I}}let h=a[rr],y=h?rh(h.request_headers,n.networkRequestHeaders):{},_=rh(rl(a),n.networkResponseHeaders),[T,g]=n.networkCaptureBodies?wu(s,oe):[void 0],[S,E]=n.networkCaptureBodies?uL(a):[void 0],x=wo(y,d,T),M=wo(_,p,S);return{startTimestamp:o,endTimestamp:i,url:l,method:c,statusCode:u,request:g?Wu(x,g):x,response:E?Wu(M,E):M}}function uL(e){let t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return dL(e.response,e.responseType)}catch(n){t.push(n)}return re&&oe.warn("Failed to get xhr response body",...t),[void 0]}function dL(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 fL(e,t){try{let n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return ed(n)}catch{return}}function pL(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)=>mL(a,l,c))}catch{}}function mL(e,t,n){if(t.data)try{hL(t)&&yL(n)&&(lL(t,n),aL(t,n,e)),gL(t)&&SL(n)&&(XP(t,n),JP(t,n,e))}catch(r){re&&oe.exception(r,"Error when enriching network breadcrumb")}}function hL(e){return e.category==="xhr"}function gL(e){return e.category==="fetch"}function yL(e){return e?.xhr}function SL(e){return e?.input!==void 0}function _L(e){let t=z();tl(QM(e)),Gr(GP(e)),DP(e),pL(e);let n=jP(e);$a(n),t&&(t.on("beforeSendEvent",LP(e)),t.on("afterSendEvent",AP(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 vL(e){try{return Promise.all(Zu(e,[EL(Oe.performance.memory)]))}catch{return[]}}function EL(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 TL(e,t,n){return Vp(e,t,{...n,setTimeoutImpl:gi})}var Au=W.navigator;function IL(){return/iPhone|iPad|iPod/i.test(Au?.userAgent??"")||/Macintosh/i.test(Au?.userAgent??"")&&Au?.maxTouchPoints&&Au?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function wL(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,CL(n),e.clickDetector&&qM(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&o&&e.setInitialState(),!yh(e,n,o))return!0;if(!o)return!1;let i=e.session;if(RL(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&&Qu(i))}return i?.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function CL(e){let t=e.data;if(!(e.type!==fe.IncrementalSnapshot||!t||typeof t!="object"||!("source"in t)||t.source!==ie.Mutation||!("attributes"in t)||!Array.isArray(t.attributes)))for(let n of t.attributes){let r=ir.mirror.getNode(n.id),o=r&&ir.mirror.getMeta(r);if(o?.type===Xu.Element)for(let[i,s]of Object.entries(n.attributes))s===null?delete o.attributes[i]:o.attributes[i]=s}}function xL(e){let t=e.getOptions();return{type:fe.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 RL(e,t){!t||e.session?.segmentId!==0||yh(e,xL(e),!1)}function bL(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function kL(e,t,n,r){return Wt(Oa(e,es(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function NL({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 AL({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 Fa(e.getOptions(),r,i,t,e,Ge());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 ML({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:o,session:i}){let s=NL({recordingData:e,headers:{segment_id:n}}),{urls:a,errorIds:l,traceIds:c,initialTimestamp:u}=r,d=z(),p=Q(),h=d?.getTransport(),y=d?.getDsn();if(!d||!h||!y||!i.sampled)return Promise.resolve({});let _={type:_1,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 AL({scope:p,client:d,replayId:t,event:_});if(!T)return d.recordDroppedEvent("event_processor","replay"),re&&oe.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete T.sdkProcessingMetadata;let g=kL(T,s,y,d.getOptions().tunnel),S;try{S=await h.send(g)}catch(x){let M=new Error(ah);try{M.cause=x}catch{}throw M}let E=Ga({},S);if(Wa(E,"replay"))throw new yl(E);if(typeof S.statusCode=="number"&&(S.statusCode<200||S.statusCode>=300))throw new Vu(S.statusCode);return S}var Vu=class extends Error{constructor(t){super(`Transport returned status code ${t}`)}},yl=class extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}},qu=class extends Error{constructor(){super("Session is too long, not sending replay")}};async function $T(e,t={count:0,interval:C1}){let{recordingData:n,onError:r}=e;if(n.length)try{return await ML(e),!0}catch(o){if(o instanceof Vu||o instanceof yl)throw o;if(ai("Replays",{_retryCount:t.count}),r&&r(o),t.count>=x1){let i=new Error(`${ah} - max retries exceeded`);try{i.cause=o}catch{}throw i}return t.interval*=++t.count,new Promise((i,s)=>{gi(async()=>{try{await $T(e,t),i(!0)}catch(a){s(a)}},t.interval)})}}var zT="__THROTTLED",PL="__SKIPPED";function LL(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?PL:zT}s=!1;let c=r.get(l)||0;return r.set(l,c+1),e(...a)}}var oh=class{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:v1,sessionIdleExpire:E1},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=TL(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=LL((s,a)=>bP(this,s,a),300,5);let{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),i=r?{threshold:Math.min(R1,r),timeout:r,scrollTimeout:b1,ignoreSelector:o?o.join(","):""}:void 0;if(i&&(this.clickDetector=new Xm(this,i)),re){let s=t._experiments;oe.setConfig({captureExceptions:!!s.captureExceptions,traceInternals:!!s.traceInternals})}this._handleVisibilityChange=()=>{Oe.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{let s=Ir({category:"ui.blur"});this._doChangeToBackgroundTasks(s)},this._handleWindowFocus=()=>{let s=Ir({category:"ui.focus"});this._doChangeToForegroundTasks(s)},this._handleKeyboardEvent=s=>{nP(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=Om({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=Om({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=ir({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:w1}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:wL(this),...IL(),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{re&&oe.log(`Stopping Replay triggered by ${r}`),ju(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,TP(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(),tT(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&&th(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){let t=`${Oe.location.pathname}${Oe.location.hash}${Oe.location.search}`,n=`${Oe.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===zT){let o=Ir({category:"replay.throttled"});this.addUpdate(()=>!yh(this,{type:UM,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){let t=this.lastActiveSpan||Re(),n=t&&Ce(t),o=(n&&Z(n).data||{})[pt];if(!(!n||!o||!["route","custom"].includes(o)))return Z(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=_P({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&&tT(this.session.id)}_initializeSessionForSampling(t){let n=this._options.errorSampleRate>0,r=Om({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 zu(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{Oe.document.addEventListener("visibilitychange",this._handleVisibilityChange),Oe.addEventListener("blur",this._handleWindowBlur),Oe.addEventListener("focus",this._handleWindowFocus),Oe.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(_L(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=hP(this)}_removeListeners(){try{Oe.document.removeEventListener("visibilitychange",this._handleVisibilityChange),Oe.removeEventListener("blur",this._handleWindowBlur),Oe.removeEventListener("focus",this._handleWindowFocus),Oe.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(zu(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){ju();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:fe.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=sP(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(Zu(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 vL(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let n=Date.now();if(n-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new qu;let r=this._popEventContext(),o=this.session.segmentId++;this._maybeSaveSession();let i=await this.eventBuffer.finish();await $T({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 yl?o="ratelimit_backoff":n instanceof qu?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&&Qu(this.session)}_onMutationHandler(t){let{ignoreMutations:n}=this._options._experiments;if(n?.length&&t.some(a=>{let l=bL(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=Ir({category:"replay.mutations",data:{count:r,limit:s}});this._createCustomBreadcrumb(a)}return s?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}};function sl(e,t){return[...e,...t].join(",")}function OL({mask:e,unmask:t,block:n,unblock:r,ignore:o}){let i=["base","iframe[srcdoc]:not([src])"],s=sl(e,[".sentry-mask","[data-sentry-mask]"]),a=sl(t,[]);return{maskTextSelector:s,unmaskTextSelector:a,blockSelector:sl(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:sl(r,[]),ignoreSelector:sl(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function DL({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 rT='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',UL=["content-length","content-type","accept"],FL=Symbol.for("sentry__originalRequestBody"),oT=!1,iT=!1;function BL(){if(typeof Request>"u"||iT)return;let e=Request;try{let t=function(n,r){let o=new e(n,r);return r?.body!=null&&(o[FL]=r.body),o};t.prototype=e.prototype,W.Request=t,iT=!0}catch{}}var _h=(e=>new ih(e)),ih=class{constructor({flushMinDelay:t=T1,flushMaxDelay:n=I1,minReplayDuration:r=k1,maxReplayDuration:o=DE,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:x=[],mask:M=[],maskAttributes:A=["title","placeholder","aria-label"],unmask:I=[],block:N=[],unblock:U=[],ignore:R=[],maskFn:$,beforeAddRecordingEvent:j,beforeErrorSampling:pe,onError:Y,attachRawBodyFromRequest:qe=!1}={}){this.name="Replay";let ce=OL({mask:M,unmask:I,block:N,unblock:U,ignore:R});if(this._recordingOptions={maskAllInputs:u,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:$,maskInputFn:$,maskAttributeFn:(le,D,me)=>DL({maskAttributes:A,maskAllText:c,privacyOptions:ce,key:le,value:D,el:me}),...ce,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:le=>{try{le.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!l.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,N1),maxReplayDuration:Math.min(o,DE),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:sT(E),networkResponseHeaders:sT(x),beforeAddRecordingEvent:j,beforeErrorSampling:pe,onError:Y,attachRawBodyFromRequest:qe,_experiments:l},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${rT}`:rT,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&On())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return oT}set _isInitialized(t){oT=t}afterAllSetup(t){!On()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&BL(),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&&yo(t,{"sentry.replay_id":n})}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){let n=HL(this._initialOptions,t);this._replay=new oh({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{let n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}};function HL(e,t){let n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},o=Sn(n.replaysSessionSampleRate),i=Sn(n.replaysOnErrorSampleRate);return o==null&&i==null&&Et(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),i!=null&&(r.errorSampleRate=i),r}function sT(e){return[...UL,...e.map(t=>t.toLowerCase())]}function jT(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function vh(e){try{return new URL(e,J.location.origin).href}catch{return}}function WT(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function Eh(e){try{return new Headers(e)}catch{return}}var Th={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function VT(e,t){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:i,tracePropagationTargets:s,onRequestSpanStart:a,onRequestSpanEnd:l}={...Th,...t},c=typeof o=="function"?o:h=>!0,u=h=>zL(h,s),d={},p=e.getOptions().propagateTraceparent;n&&_o(h=>{let y=Qp(h,c,u,d,{propagateTraceparent:p,onRequestSpanEnd:l});if(y){let _=vh(h.fetchData.url),T=_?Ln(_).host:void 0;y.setAttributes({"http.url":_?Ot(_):void 0,"server.address":T}),i&&GT(y,e),a?.(y,{headers:h.headers})}}),r&&nl(h=>{let y=jL(h,c,u,d,p,l);y&&(i&&GT(y,e),a?.(y,{headers:Eh(h.xhr.__sentry_xhr_v3__?.request_headers)}))})}var $L=300;function GT(e,t){let{url:n}=Z(e).data;if(!n||typeof n!="string")return;let r=()=>{setTimeout(o)};if(wt(t)){let i=e.end.bind(e);e.end=s=>{let a=s??xe(),l=!1,c=()=>{l||(l=!0,setTimeout(o),i(a),clearTimeout(u))};r=c;let u=setTimeout(c,$L)}}let o=nr("resource",({entries:i})=>{i.forEach(s=>{WT(s)&&s.name.endsWith(n)&&(e.setAttributes(Za(s)),r())})})}function zL(e,t){let n=sn();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?Tt(r.toString(),t)||i&&Tt(r.pathname,t):i}else{let r=!!e.match(/^\/(?!\/)/);return t?Tt(e,t):r}}function jL(e,t,n,r,o,i){let s=e.xhr,a=s?.[rr];if(!s||s.__sentry_own_request__||!a)return;let{url:l,method:c}=a,u=mt()&&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&&(Ji(E,a.status_code),E.end(),i?.(E,{headers:Eh(rl(s)),error:e.error})),delete r[S]);return}let d=vh(l),p=d?Ln(d):Ln(l),h=Ot(Gc(l)),y=z(),T=!!Re()||!!y&&wt(y),g=u&&T?yt({name:`${c} ${h}`,attributes:{url:Ot(l),type:"xhr","http.method":c,"http.url":d?Ot(d):void 0,"server.address":p?.host,[Ee]:"auto.http.browser",[$e]:"http.client",...p?.search&&{"http.query":p?.search},...p?.hash&&{"http.fragment":p?.hash}}}):new It;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)&&WL(s,mt()&&T?g:void 0,o),y&&y.emit("beforeOutgoingRequestSpan",g,e),g}function WL(e,t,n){let{"sentry-trace":r,baggage:o,traceparent:i}=ls({span:t,propagateTraceparent:n});r&&GL(e,r,o,i)}function GL(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 qT=new WeakMap,YT=new WeakMap,VL=9e4,qL=["text/event-stream","application/x-ndjson","application/stream+json"],KT=()=>({name:"FetchStreamPerformance",setup(){ou(e=>{if(e.response){let t=qT.get(e.response);if(t&&e.endTimestamp){t.end(e.endTimestamp);let n=YT.get(e.response);n&&clearTimeout(n)}}}),_o(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=Sr(n),i=n.startsWith("data:")?Ot(n):o?rs(o):n,s=yt({name:`${r} ${i}`,startTime:e.endTimestamp,attributes:{url:Ot(n),"http.method":r,type:"fetch",[$e]:"http.client.stream",[Ee]:"auto.http.browser.stream"}});qT.set(e.response,s);let a=setTimeout(()=>{s.isRecording()&&s.end()},VL);YT.set(e.response,a)}})}});function JT(){J.document?J.document.addEventListener("visibilitychange",()=>{let e=Re();if(!e)return;let t=Ce(e);if(J.document.hidden&&t){let n="cancelled",{op:r,status:o}=Z(t);Ye&&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()}}):Ye&&C.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var YL=3600,XT="sentry_previous_trace",KL="sentry.previous_trace";function QT(e,{linkPreviousTrace:t,consistentTraceSampling:n}){let r=t==="session-storage",o=r?QL():void 0;e.on("spanStart",s=>{if(Ce(s)!==s)return;let a=Q().getPropagationContext();o=JL(o,s,a),r&&XL(o)});let i=!0;n&&e.on("beforeSampling",s=>{if(!o)return;let a=Q(),l=a.getPropagationContext();if(i&&l.parentSpanId){i=!1;return}a.setPropagationContext({...l,dsc:{...l.dsc,sample_rate:String(o.sampleRate),sampled:String(Ih(o.spanContext))},sampleRand:o.sampleRand}),s.parentSampled=Ih(o.spanContext),s.parentSampleRate=o.sampleRate,s.spanAttributes={...s.spanAttributes,[Yi]:o.sampleRate}})}function JL(e,t,n){let r=Z(t);function o(){try{let a=Number(r.data?.[Lr]??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<=YL&&(Ye&&C.log(`Adding previous_trace \`${JSON.stringify(s)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:s,attributes:{[kc]:"previous_trace"}}),t.setAttribute(KL,`${s.traceId}-${s.spanId}-${Ih(s)?1:0}`)),i)}function XL(e){try{J.sessionStorage.setItem(XT,JSON.stringify(e))}catch(t){Ye&&C.warn("Could not store previous trace in sessionStorage",t)}}function QL(){try{let e=J.sessionStorage?.getItem(XT);return JSON.parse(e)}catch{return}}function Ih(e){return e.traceFlags===1}var ZL="BrowserTracing",eO=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function rI(){let e=J.navigator;return e?.userAgent?eO.test(e.userAgent):!1}var tO={...ns,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...Th},wh=((e={})=>{"enableElementTiming"in e&&Et(()=>{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=J.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:x,instrumentPageLoad:M,instrumentNavigation:A,detectRedirects:I,linkPreviousTrace:N,consistentTraceSampling:U,enableReportPageLoaded:R,onRequestSpanStart:$,onRequestSpanEnd:j}={...tO,...e},pe=rI(),Y,qe,ce;function le(D,me,K=!0){let ae=me.op==="pageload",Se=me.name,he=c?c(me):me,nt=he.attributes||{};if(Se!==he.name&&(nt[pt]="custom",he.attributes=nt),!K){let rt=tn();yt({...he,startTime:rt}).end(rt);return}t.name=he.name,t.source=nt[pt];let We=jc(he,{idleTimeout:u,finalTimeout:d,childSpanTimeout:p,disableAutoFinish:ae,beforeSpanEnd:rt=>{Y?.();let Qt=wt(D);gm(rt,{recordClsOnPageloadSpan:!Qt&&!a,recordLcpOnPageloadSpan:!Qt&&!l,ignoreResourceSpans:E,ignorePerformanceApiSpans:x,spanStreamingEnabled:Qt}),tI(D,void 0);let mn=Q(),Rn=mn.getPropagationContext();mn.setPropagationContext({...Rn,traceId:We.spanContext().traceId,sampled:on(We),dsc:lt(rt)}),ae&&(ce=void 0)},trimIdleSpanEndTimestamp:!R});ae&&R&&(ce=We),tI(D,We);function $t(){n&&["interactive","complete"].includes(n.readyState)&&D.emit("idleSpanEnableAutoFinish",We)}ae&&!R&&n&&(n.addEventListener("readystatechange",()=>{$t()}),$t())}return{name:ZL,setup(D){if(pe){Ye&&C.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}Dc();let me=wt(D);if(Y=fm({recordClsStandaloneSpans:me?void 0:a||!1,recordLcpStandaloneSpans:me?void 0:l||!1,client:D}),me?(Tm(D),Im(D),r&&wm()):r&&_m(),i&&W.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?mm():o&&pm(),s&&hm(),I&&n){let ae=()=>{qe=xe()};addEventListener("click",ae,{capture:!0}),addEventListener("keydown",ae,{capture:!0,passive:!0})}function K(){let ae=vl(D);ae&&!Z(ae).timestamp&&(Ye&&C.log(`[Tracing] Finishing current active span with op: ${Z(ae).op}`),ae.setAttribute(Or,"cancelled"),ae.end())}D.on("startNavigationSpan",(ae,Se)=>{if(z()!==D)return;if(Se?.isRedirect){Ye&&C.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),le(D,{op:"navigation.redirect",...ae},!1);return}qe=void 0,K(),Ge().setPropagationContext({traceId:jt(),sampleRand:Math.random(),propagationSpanId:mt()?void 0:Pt()});let he=Q();he.setPropagationContext({traceId:jt(),sampleRand:Math.random(),propagationSpanId:mt()?void 0:Pt()}),he.setSDKProcessingMetadata({normalizedRequest:void 0}),le(D,{op:"navigation",...ae,parentSpan:null,forceTransaction:!0})}),D.on("startPageLoadSpan",(ae,Se={})=>{if(z()!==D)return;K();let he=Se.sentryTrace||ZT("sentry-trace")||eI("sentry-trace"),nt=Se.baggage||ZT("baggage")||eI("baggage"),We=gp(he,nt),$t=Q();$t.setPropagationContext(We),mt()||($t.getPropagationContext().propagationSpanId=Pt()),$t.setSDKProcessingMetadata({normalizedRequest:ds()}),le(D,{op:"pageload",...ae})}),D.on("endPageloadSpan",()=>{R&&ce&&(ce.setAttribute(Or,"reportPageLoaded"),ce.end())})},afterAllSetup(D){if(pe)return;let me=sn();if(N!=="off"&&QT(D,{linkPreviousTrace:N,consistentTraceSampling:U}),J.location){if(M){let K=Pe();oI(D,{name:J.location.pathname,startTime:K?K/1e3:void 0,attributes:{[pt]:"url",[Ee]:"auto.pageload.browser"}})}A&&Gr(({to:K,from:ae})=>{if(ae===void 0&&me?.indexOf(K)!==-1){me=void 0;return}me=void 0;let Se=Sr(K),he=vl(D),nt=he&&I&&rO(he,qe);iI(D,{name:Se?.pathname||J.location.pathname,attributes:{[pt]:"url",[Ee]:"auto.navigation.browser"}},{url:K,isRedirect:nt})})}h&&JT(),s&&nO(D,u,d,p,t),r&&vm(),VT(D,{traceFetch:y,traceXHR:_,tracePropagationTargets:D.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:g,enableHTTPTimings:S,onRequestSpanStart:$,onRequestSpanEnd:j}),T&&D.addIntegration(KT())}}});function oI(e,t,n){e.emit("startPageLoadSpan",t,n),Q().setTransactionName(t.name);let r=vl(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function iI(e,t,n){let{url:r,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o}),e.emit("startNavigationSpan",t,{isRedirect:o});let i=Q();return i.setTransactionName(t.name),r&&!o&&i.setSDKProcessingMetadata({normalizedRequest:{...ds(),url:r}}),vl(e)}function ZT(e){return J.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function eI(e){return J.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===e)?.description}function nO(e,t,n,r,o){let i=J.document,s,a=()=>{let l="ui.action.click",c=vl(e);if(c){let u=Z(c).op;if(["navigation","pageload"].includes(u)){Ye&&C.warn(`[Tracing] Did not create ${l} span because a pageload or navigation span is in progress.`);return}}if(s&&(s.setAttribute(Or,"interactionInterrupted"),s.end(),s=void 0),!o.name){Ye&&C.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}s=jc({name:o.name,op:l,attributes:{[pt]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",a,{capture:!0})}var sI="_sentry_idleSpan";function vl(e){return e[sI]}function tI(e,t){He(e,sI,t)}var nI=1.5;function rO(e,t){let n=Z(e),r=tn(),o=n.start_timestamp;return!(r-o>nI||t&&r-t<=nI)}var EI=hn(qr(),1);function vI(e){return Nn(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Nh(e){let t={...e};Ya(t,"react"),ai("react",{version:EI.version});let n=Nm(t);return Vi(_O),n}function _O(e){return vI(e)?"[SyntheticEvent]":ol(e)}var TI=hn(qr(),1);function vO(e){let t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}function EO(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 II(e,{componentStack:t},n){if(vO(TI.version)&&kn(e)&&t){let r=new Error(e.message);r.name=`React ErrorBoundary ${e.name}`,r.stack=t,EO(e,r)}return Pn(r=>(r.setContext("react",{componentStack:t}),Fr(e,n)))}var Si=hn(qr(),1);var wI=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Ah={componentStack:null,error:null,eventId:null},ks=class extends Si.Component{constructor(t){super(t),this.state=Ah,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&&Ru({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,n){let{componentStack:r}=n,{beforeCapture:o,onError:i,showDialog:s,dialogOptions:a}=this.props;Pn(l=>{o&&o(l,t,r);let c=this.props.handled!=null?this.props.handled:!!this.props.fallback,u=II(t,n,{mechanism:{handled:c,type:"auto.function.react.error_boundary"}});i&&i(t,r,u),s&&(this._lastEventId=u,this._openFallbackReportDialog&&Ru({...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===Ah?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(Ah)}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"?Si.createElement(t,{error:r.error,componentStack:r.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:r.eventId}):t;return Si.isValidElement(o)?o:(t&&wI&&C.warn("fallback did not produce a valid ReactElement"),null)}};function Mh(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 Yr=window.__vidfarmSentry,xI=Yr?.dsn?.trim()||"";if(xI){let e=Yr?.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,...Yr?.tracePropagationTargets??[]].filter(Boolean)));Nh({dsn:xI,environment:e,release:Yr?.release?.trim()||void 0,integrations:[wh(),_h({maskAllText:!0,blockAllMedia:!0})],tracesSampleRate:Mh(Yr?.tracesSampleRate,t),tracePropagationTargets:o,replaysSessionSampleRate:Mh(Yr?.replaysSessionSampleRate,n),replaysOnErrorSampleRate:Mh(Yr?.replaysOnErrorSampleRate,1),enableLogs:Yr?.enableLogs??!0,sendDefaultPii:Yr?.sendDefaultPii??!0})}var Fi=hn(qr(),1),Gx=hn(wf(),1),Vx=hn(VC(),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},Cf=(e=>e?qC(e):qC);var pc=hn(qr(),1);var wU=e=>e;function YC(e,t=wU){let n=pc.default.useSyncExternalStore(e.subscribe,pc.default.useCallback(()=>t(e.getState()),[e,t]),pc.default.useCallback(()=>t(e.getInitialState()),[e,t]));return pc.default.useDebugValue(n),n}var CU="[vidfarm]";function xU(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)),xU(e)&&console[e==="debug"?"log":e](CU,t,n??"")}function Nr(e,t){qy("info",e,t)}function KC(e,t){qy("warn",e,t)}function io(e,t){qy("error",e,t)}function JC(){typeof window>"u"||window.__VIDFARM_DEBUG_HOOKS__||(window.__VIDFARM_DEBUG_HOOKS__=!0,Nr("boot.hooks-installed",{href:window.location.href,readyState:document.readyState,userAgent:navigator.userAgent}),window.addEventListener("error",e=>{io("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=>{io("window.unhandledrejection",{reason:e.reason instanceof Error?e.reason.stack:e.reason})}))}var RU="vidfarm:flockposter-cache:v1",bU="public",xf={channels:[],posts:[],channelsUpdatedAt:null,calendarUpdatedAt:null,calendarRangeStart:null,calendarRangeEnd:null};function ZC(e){return`${RU}_${e?.trim()||bU}`}function Ky(e){if(typeof window>"u")return xf;try{let t=window.localStorage.getItem(ZC(e));if(!t)return xf;let n=JSON.parse(t);return!n||typeof n!="object"?xf:{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 xf}}function XC(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(ZC(t),JSON.stringify(e))}catch{}}function ex(e){let t=Ky(e);return Cf((n,r)=>({...t,setChannelsData:o=>{let i=r(),s={...i,channels:[...i.channels.filter(QC),...o.filter(a=>!QC(a))],channelsUpdatedAt:new Date().toISOString()};XC(s,e),n(s)},setCalendarData:o=>{let i=r(),s=kU([...i.channels,...o.channels]),a=o.replaceRange?NU(i.posts,o.posts,o.rangeStart,o.rangeEnd):Yy([...i.posts,...o.posts]),l={...i,channels:s,posts:a,channelsUpdatedAt:new Date().toISOString(),calendarUpdatedAt:new Date().toISOString(),calendarRangeStart:AU(i.calendarRangeStart,o.rangeStart),calendarRangeEnd:MU(i.calendarRangeEnd,o.rangeEnd)};XC(l,e),n(l)}}))}function kU(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function QC(e){return e.id.startsWith("email:")||e.platform?.toLowerCase()==="email"}function Yy(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function NU(e,t,n,r){let o=Date.parse(n),i=Date.parse(r);return Number.isNaN(o)||Number.isNaN(i)?Yy([...e,...t]):Yy([...e.filter(s=>{let a=Date.parse(s.scheduledAt);return Number.isNaN(a)||a<o||a>i}),...t])}function AU(e,t){return e?Date.parse(t)<Date.parse(e)?t:e:t}function MU(e,t){return e?Date.parse(t)>Date.parse(e)?t:e:t}function tx(e){return Cf(t=>({boot:e,hydratedAt:null,setHydratedAt:n=>t({hydratedAt:n})}))}var b=hn(qr(),1),Ui=hn(wf(),1);var f=hn(mc(),1),Bf=1024*1024,bx=50*Bf,BU=2*Bf,HU=3*Bf,$U=Math.floor(3.5*Bf),zU=2048,kx="chat";function sa(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 Df(e){return e.contentType.startsWith("image/")}function rS(e){return e.contentType.startsWith("video/")}var jU=new Set(["apng","avif","gif","jpeg","jpg","png","svg","webp"]),WU=new Set(["m4v","mov","mp4","mpeg","mpg","ogv","webm"]),ix=1200,Jy=24,Xy=80,GU=/^data:([^;,]+)[^,]*,/i,sx=/authorization|api[-_]?key|secret|token|vidfarm-api-key/i,VU=48e3,Qy=14,qU=12e3,YU=1200,KU=30;function Mf(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 Pf(e){let t=GU.exec(e);return t?`[${t[1]} data URL omitted, ${e.length.toLocaleString()} chars]`:e.length>ix?`${e.slice(0,ix)}\u2026 [truncated ${e.length.toLocaleString()} chars]`:e}function Di(e,t=0){if(e==null)return e;if(typeof e=="string")return Pf(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,Jy).map(r=>Di(r,t+1));return e.length>Jy&&n.push(`[${e.length-Jy} more items omitted]`),n}if(typeof e=="object"){let n={},r=Object.entries(e);for(let[o,i]of r.slice(0,Xy)){let s=Di(i,t+1);s!==void 0&&(n[o]=s)}return r.length>Xy&&(n.__omitted_keys=r.length-Xy),n}return String(e)}}function Nx(e){return Di(e)}function gc(e){return{...e,request:{...e.request,headers:Object.fromEntries(Object.entries(e.request.headers).map(([t,n])=>[t,sx.test(t)?"[redacted]":Pf(n)])),body:Di(e.request.body)},result:{...e.result,headers:Object.fromEntries(Object.entries(e.result.headers).map(([t,n])=>[t,sx.test(t)?"[redacted]":Pf(n)])),body:Di(e.result.body),error:e.result.error?Pf(e.result.error):e.result.error}}}function JU(){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 Ax(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Zy(e){let t=Ax(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 Mx(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>${Ax(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>${Zy(c)}</li>`).join("")}</ul>`:i.every(l=>/^\d+\.\s+/.test(l.trim()))?`<ol>${i.map(c=>c.trim().replace(/^\d+\.\s+/,"")).map(c=>`<li>${Zy(c)}</li>`).join("")}</ol>`:`<p>${i.map(l=>Zy(l.trim())).join("<br />")}</p>`}).filter(Boolean).join(""):""}function XU(e){return e.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase())}function QU(e){return/^item \d+$/i.test(e.trim())||/^output$/i.test(e.trim())}function ZU(e){try{let n=new URL(e).searchParams.get("key");return n?.trim()?n.trim().replace(/^\/+/,""):null}catch{return null}}function Uf(e){try{return decodeURIComponent(e)}catch{return e}}function aS(e){let t=ZU(e);if(t){let n=Uf(t.split("/").filter(Boolean).pop()||"");if(n)return n}try{let n=new URL(e).pathname;return Uf(n.split("/").filter(Boolean).pop()||"")}catch{return""}}function Px(e){return aS(e)||"Output"}function Lx(e,t){let n=aS(e);return n||t.trim().replace(/[\\/:*?"<>|]+/g,"-")||"download"}function eF(e){let n=aS(e).split(".").pop()?.trim().toLowerCase()||"";return jU.has(n)?"image":WU.has(n)?"video":null}function tF(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 nF(e,t=[]){let n=new Set(t),r=new Set,o=[];for(let i of tF(e)){if(n.has(i)||r.has(i))continue;let s=eF(i);s&&(r.add(i),o.push({kind:s,url:i,label:Px(i)}))}return o}function oS(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=XU(i),a=Px(o);t.push({label:a!=="Output"?a:s&&!QU(i)?s:a,url:o})}return}if(Array.isArray(e)){for(let[o,i]of e.entries())if(oS(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(oS(i,t,n,[...r,o]),t.length>=12)return}}}function ax(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
+
35
+ `)}function lS(e){return typeof e=="string"&&e.startsWith("primitive:brainstorm_")}function cS(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 Ox(e){return e?Uf(e.split("/").filter(Boolean).pop()||"result.json"):"JSON result"}function rF(e){return Uf(e?.split("/").filter(Boolean).pop()||"")}function oF(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 Dx(e){if(e.status!=="succeeded"||!lS(e.primitive_id))return[];let t=[];for(let[n,r]of cS(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=Ox(r.storage_key),l=oF(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 iF(e){return e==="primitive:brainstorm_awareness_stages"?"Awareness response":"Brainstorm response"}function Ux(e){if(e.status!=="succeeded"||!lS(e.primitive_id))return[];let t=[];for(let[n,r]of cS(e.artifacts).entries()){let o=r.public_url?.trim(),i=r.storage_key?.trim(),s=rF(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=iF(e.primitive_id);t.push({key:r.artifact_id||`${e.job_id}:${o}:${n}`,url:o,label:s==="response.md"||s==="response.txt"?u:Ox(i),jobId:e.job_id,format:l?"markdown":"text"})}return t}function bf(e){if(e.status==="succeeded"){let t=[];oS(e.result,t);let n=[`Render \`${e.job_id}\` succeeded.`];return lS(e.primitive_id)&&(Dx(e).length||Ux(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 kf(e,t){let n=e.trim(),r=t.trim();return!r||n.includes(r)?e:n?`${n}
37
+
38
+ ${r}`:r}var sF=48;function aF(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=sF}function lF(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 lx=3e4,cF=18e4,cx=4,ux=40,uF=1500,dx=250;function Li(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:cS(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 dF(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 ia(e){return e==="succeeded"||e==="failed"||e==="cancelled"}function fx(e,t,n){return`${e}::${t}::${n}`}function dt(e,t){let n=new Headers;return e&&n.set("vidfarm-api-key",e),t&&n.set("content-type",t),n}async function Oi(e){return await e.json()}async function eS(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 px(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 fF(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 Fx(e){return e.reduce((t,n)=>t+fF(n.transportData),0)}async function pF(e,t,n){return await new Promise(r=>{e.toBlob(o=>r(o),t,n)})}async function mF(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 hF(e,t){if(!e.type.startsWith("image/")||t<=0)return;let n=Math.min(HU,t),r=Math.min(BU,n);if(e.size<=r)return eS(e);let o=await mF(e);if(!o||o.width<=0||o.height<=0)return e.size<=n?eS(e):void 0;try{let i=null,s=[zU,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)),d=Math.max(1,Math.round(o.height*c)),p=document.createElement("canvas");p.width=u,p.height=d;let h=p.getContext("2d");if(h){h.fillStyle="#fff",h.fillRect(0,0,u,d),h.drawImage(o.source,0,0,u,d);for(let y of a){let _=await pF(p,"image/jpeg",y);if(_&&(_.size<=n&&(!i||_.size<i.size)&&(i=_),_.size<=r))return px(_)}}}return i&&(e.size>n||i.size<e.size)?px(i):e.size<=n?eS(e):void 0}finally{o.close?.()}}async function Bx(e){let t=$U-e.currentInlineBytes,n=await hF(e.file,t).catch(()=>{});return n?{...e.attachment,transportData:n}:e.attachment}async function gF(e){let t=e.maxBytes??bx,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||""),Nr("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:dt(e.apiKey),body:r}),i=await Oi(o);if(!o.ok||!i.attachment)throw io("chat.upload.failed",{file_name:e.file.name,status:o.status,error:i.error}),new Error(i.error||"Unable to upload attachment.");return Nr("chat.upload.succeeded",{file_name:e.file.name,attachment_id:i.attachment.id}),sa(i.attachment)??(()=>{throw new Error("Attachment response was incomplete.")})()}async function yF(e){let t=await fetch("/api/v1/user/me/attachments",{headers:dt(e)}),n=await Oi(t);if(!t.ok)throw new Error(n.error||"Unable to load My Files.");let r=[];for(let o of n.attachments??[]){let i=sa(o);i&&r.push({...i,createdAt:o.createdAt??o.created_at})}return{attachments:r,folders:n.folders??[]}}async function Hx(e){if(e.file.size>100*1024*1024)throw new Error("Temporary files can be at most 100 MB.");Nr("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:dt(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 Oi(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:dt(e.apiKey),body:a}),c=await Oi(l);if(!l.ok||!c.file)throw new Error(c.error||"Unable to upload temporary file.");let u=sa(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:dt(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 Oi(o);if(!o.ok||!i.file)throw new Error(i.error||"Unable to save temporary file.");let s=sa(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 SF(e){let t=await fetch("/api/v1/user/me/temporary-files",{headers:dt(e)}),n=await Oi(t);if(!t.ok)throw new Error(n.error||"Unable to load temporary files.");let r=[];for(let o of n.files??[]){let i=sa(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 mx(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:dt(e)}),o=await Oi(r);if(!r.ok)throw new Error(o.error||"Unable to load recent media.");let i=[];for(let s of o.media??[]){let a=sa(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 _F(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 vF(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 EF(e){if(e.length<=Qy||_F(e)<=VU)return e;let t=e.slice(-Qy),n=e.slice(0,-Qy),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}]: ${vF(`${i.text}${s}`,YU)}`;if(o+a.length>qU){r.push(`[${n.length-r.length} earlier messages omitted]`);break}r.push(a),o+=a.length}return[{id:Lf("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
+
40
+ `)].join(`
41
+ `),attachments:[]},...t]}function TF(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 IF(e){let t=e.length-1;return e.map((n,r)=>{let o=TF(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 wF(){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 CF(){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 xF(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
+
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 RF(e){return{threads:`vidfarm-editor-chat-threads:${e}`,activeThread:`vidfarm-editor-chat-active-thread:${e}`}}function bF(){if(typeof window>"u")return null;try{return window.sessionStorage}catch{try{return window.localStorage}catch{return null}}}function hx(){return`thread-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function Lf(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 qn(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 tS(...e){return qn(e.flat())}function kF(e){let t=e.trim();return!t||t.startsWith("archived_")?t:`archived_${t}`}function iS(){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 NF(e){return(e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"tracer").slice(0,28)}function AF(e,t){let n=NF(e),r="";do r=`${n}-${iS()}`;while(t.includes(r));return r}function MF(e,t){let n=e.trim();if(!n)return"";if(/-[a-z0-9]{8}$/i.test(n))return n;let r=`${n}-${iS()}`;for(;t.includes(r);)r=`${n}-${iS()}`;return r}function Of(){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 qn(n)}function gx(){let e=new URLSearchParams(window.location.search);return(e.get("thread_id")||e.get("threadId")||e.get("chat_id")||e.get("chatId")||"").trim()}function Nf(e){let t=e.trim().replace(/\s+/g," ");return t?t.length>42?`${t.slice(0,42).trimEnd()}\u2026`:t:"New chat"}function yx(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(-KU):[]).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:Di(o.args),result:Nx(o.result)})),httpExchanges:r.httpExchanges?.map(gc)}))}))}function PF(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:qn(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 Sx(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:qn(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 _x(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 LF(e){return[...e].sort((t,n)=>Date.parse(n.updatedAt)-Date.parse(t.updatedAt))}function hc(e,t){return t.length?e.tracers.some(n=>t.some(r=>OF(n,r))):!0}function OF(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 DF(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 uS(){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 UF(){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 dS(){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 fS(){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 Af(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 $x(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 vx(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()??Of())[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||$x(e)),n.toString()}function FF(e){let[t,n]=(0,b.useState)(!1),[r,o]=(0,b.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,b.useState)(a),u=s[l]||e.preview,d=s.length>1,p=u.kind==="image",h=p&&vx(u,!1)||"/inpaint";(0,b.useEffect)(()=>{n(!0)},[]),(0,b.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=vx(u,!0);if(!g){T.preventDefault();return}T.preventDefault(),window.open(g,"_blank","noopener,noreferrer")};return(0,b.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,Ui.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)(UF,{})}):null,(0,f.jsx)("a",{className:"vf-editor-chat-media-modal-control",href:u.url,download:$x(u),"aria-label":"Download media",title:"Download",children:(0,f.jsx)(uS,{})}),(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)(dS,{})}),(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 BF(e){let[t,n]=(0,b.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 Ex(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 Tx(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)(BF,{preview:t,previews:e.previews,onOpenModal:e.onOpenModal},t.url))}):null}function HF(e){return(0,f.jsxs)("div",{className:"vf-editor-chat-composer-attachment-item",children:[Df(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 $F(e){let[t,n]=(0,b.useState)(!1),[r,o]=(0,b.useState)(!1),i=Mf(e.exchange.request.body),s=Mf(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,b.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,Ui.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:Mf(e.exchange.result.headers)})]}):null]})]})}),document.body):null]})}function Ix(e){return typeof e=="string"?JSON.stringify(e):typeof e=="number"||typeof e=="boolean"?String(e):e===null?"null":JSON.stringify(e)}function pS(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 Ar(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)(fS,{})}),(0,f.jsx)("span",{className:"vf-editor-chat-json-line-text",children:e.text})]})}function sS(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)(Af,{open:!1})}),(0,f.jsx)(Ar,{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)(Af,{open:!0})}),(0,f.jsx)(Ar,{text:i,depth:e.depth,onCopy:e.onCopy})]}),t.map((s,a)=>(0,f.jsx)(sS,{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)(Ar,{text:`]${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,f.jsx)(Ar,{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)(Af,{open:!1})}),(0,f.jsx)(Ar,{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)(Af,{open:!0})}),(0,f.jsx)(Ar,{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)(sS,{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)(Ar,{text:`${u}${Ix(l)}${c===r.length-1?"":","}`,depth:e.depth+1,onCopy:e.onCopy},`${o}:${a}`)}),(0,f.jsx)(Ar,{text:`}${n}`,depth:e.depth,onCopy:e.onCopy})]}):(0,f.jsx)(Ar,{text:`${e.linePrefix??""}{}${n}`,depth:e.depth,onCopy:e.onCopy})}return(0,f.jsx)(Ar,{text:`${e.linePrefix??""}${Ix(t)}${n}`,depth:e.depth,onCopy:e.onCopy})}function zx(e){let[t,n]=(0,b.useState)(new Set),[r,o]=(0,b.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 pS(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)(sS,{value:e.value,depth:0,path:"root",collapsedPaths:t,togglePath:i,onCopy:s})})]})}function zF(e){let[t,n]=(0,b.useState)(!1),[r,o]=(0,b.useState)(""),i=Lx(e.artifact.url,`${e.artifact.label}.json`),s=Mf(e.data);(0,b.useEffect)(()=>{n(!0)},[]);let a=async()=>{try{await pS(s),o("done")}catch{o("error")}window.setTimeout(()=>o(""),1600)};return(0,b.useEffect)(()=>{let l=c=>{c.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e]),t?(0,Ui.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)(fS,{})}),(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)(uS,{})}),(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)(dS,{})}),(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)(zx,{value:e.data,storageKey:e.artifact.label})})]})}),document.body):null}function jF(e){let[t,n]=(0,b.useState)(!1),[r,o]=(0,b.useState)(!1),[i,s]=(0,b.useState)(null),[a,l]=(0,b.useState)(null),[c,u]=(0,b.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)(zx,{value:i,storageKey:e.artifact.label}):null}):null]}),r&&i!==null?(0,f.jsx)(zF,{artifact:e.artifact,data:i,onClose:()=>o(!1)}):null]})}function jx(e){return e.format==="markdown"?(0,f.jsx)("div",{className:"vf-editor-chat-doc-markdown",dangerouslySetInnerHTML:{__html:Mx(e.text)}}):(0,f.jsx)("pre",{className:"vf-editor-chat-doc-pre",children:e.text})}function WF(e){let[t,n]=(0,b.useState)(!1),[r,o]=(0,b.useState)(""),i=e.artifact.format==="markdown"?".md":".txt",s=Lx(e.artifact.url,`${e.artifact.label}${i}`);(0,b.useEffect)(()=>{n(!0)},[]);let a=async()=>{try{await pS(e.text),o("done")}catch{o("error")}window.setTimeout(()=>o(""),1600)};return(0,b.useEffect)(()=>{let l=c=>{c.key==="Escape"&&e.onClose()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e]),t?(0,Ui.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)(fS,{})}),(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)(uS,{})}),(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)(dS,{})}),(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)(jx,{text:e.text,format:e.artifact.format})})})]})}),document.body):null}function GF(e){let[t,n]=(0,b.useState)(!1),[r,o]=(0,b.useState)(!1),[i,s]=(0,b.useState)(null),[a,l]=(0,b.useState)(null),[c,u]=(0,b.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)(jx,{text:i,format:e.artifact.format})}):null}):null]}),r&&i!==null?(0,f.jsx)(WF,{artifact:e.artifact,text:i,onClose:()=>o(!1)}):null]})}var VF=(0,b.memo)(function(t){let n=t.message.role==="assistant",r=t.message.text.trim().length>0,o=r?Mx(t.message.text):"",[i,s]=(0,b.useState)(null),a=t.message.attachments.filter(Df),l=t.message.attachments.filter(rS),c=t.message.attachments.filter(_=>!Df(_)&&!rS(_)),u=r?nF(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=Li(_.result.body);return T?Dx(T):[]}).filter((_,T,g)=>g.findIndex(S=>S.url===_.url)===T),y=(t.message.httpExchanges??[]).flatMap(_=>{let T=Li(_.result.body);return T?Ux(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)(DF,{attachment:_})})},_.id)),(0,f.jsx)(Tx,{previews:a.map(_=>({kind:"image",url:_.viewUrl,label:_.fileName})),onOpenModal:(_,T)=>s({preview:_,gallery:T})}),l.map(_=>(0,f.jsx)(Ex,{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)($F,{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)(Tx,{previews:d,onOpenModal:(_,T)=>s({preview:_,gallery:T})}),p.map(_=>(0,f.jsx)(Ex,{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)(jF,{artifact:_},_.key))}):null,y.length?(0,f.jsx)("div",{className:"vf-editor-chat-json-list",children:y.map(_=>(0,f.jsx)(GF,{artifact:_},_.key))}):null]}),i?(0,f.jsx)(FF,{preview:i.preview,gallery:i.gallery,onClose:()=>s(null)}):null]})});function wx(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 Cx(e){return Df(e.file)?(0,f.jsx)("img",{className:"vf-editor-upload-file-thumb",src:e.file.viewUrl,alt:e.file.fileName}):rS(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 so(e){return e.split("/").map(t=>t.trim()).filter(Boolean).join("/")}function Ff(e,t){return so([e,t].filter(Boolean).join("/"))}function xx(e){let t=so(e).split("/").filter(Boolean);return t.pop(),t.join("/")}function Rx(e){return so(e).split("/").filter(Boolean).at(-1)||"All files"}function qF(e){let t=so(e.currentFolder),n=t?`${t}/`:"",r=new Map;for(let o of e.folders){let i=so(o);if(!i||t&&i===t||!i.startsWith(n))continue;let a=i.slice(n.length).split("/")[0];a&&r.set(a,Ff(t,a))}for(let o of e.files){let i=so(o.folderPath??"");if(!i||t&&i===t||!i.startsWith(n))continue;let a=i.slice(n.length).split("/")[0];a&&r.set(a,Ff(t,a))}return Array.from(r.entries()).map(([o,i])=>({name:o,path:i})).sort((o,i)=>o.name.localeCompare(i.name))}function nS(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 YF(e){let[t,n]=(0,b.useState)("my-files"),[r,o]=(0,b.useState)([]),[i,s]=(0,b.useState)([]),[a,l]=(0,b.useState)([]),[c,u]=(0,b.useState)(()=>new Set),[d,p]=(0,b.useState)([]),[h,y]=(0,b.useState)([]),[_,T]=(0,b.useState)(()=>new Set),[g,S]=(0,b.useState)(null),[E,x]=(0,b.useState)(!1),[M,A]=(0,b.useState)(""),[I,N]=(0,b.useState)(null),[U,R]=(0,b.useState)(null),[$,j]=(0,b.useState)(null),[pe,Y]=(0,b.useState)(null),[qe,ce]=(0,b.useState)(null),le=(0,b.useRef)(null),D=(0,b.useRef)(null),me=(0,b.useMemo)(()=>{let P=d.map(ee=>({...ee,recentSource:"generated"}));return[...h.map(ee=>({...ee,recentSource:"temporary"})),...P].sort((ee,se)=>{let _e=ee.createdAt?Date.parse(ee.createdAt):0;return(se.createdAt?Date.parse(se.createdAt):0)-_e})},[d,h]),K=t==="upload"?r:t==="my-files"?i.filter(P=>c.has(P.id)):t==="recents"?me.filter(P=>_.has(P.id)):[];async function ae(){let P=await yF(e.apiKey);s(P.attachments),l(P.folders)}async function Se(P){x(!0);try{let[F,ee]=P?[await mx(e.apiKey,P),null]:await Promise.all([mx(e.apiKey),SF(e.apiKey)]);p(se=>P?[...se,...F.media]:F.media),ee&&y(ee.files),S(F.nextCursor),P||T(new Set)}finally{x(!1)}}(0,b.useEffect)(()=>{e.open&&(Y(null),j(null),ae().catch(P=>Y(P instanceof Error?P.message:"Unable to load My Files.")),Se().catch(P=>Y(P instanceof Error?P.message:"Unable to load recent media.")))},[e.open]);function he(){o([]),u(new Set),T(new Set),j(null),Y(null),N(null),R(null),e.onClose()}async function nt(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)}j("File URL copied.")}catch{Y("Unable to copy file URL.")}}async function We(P,F){if(!P.length)return;Y(null);let ee=[];for(let se of P)try{if(j(`Uploading ${se.name}...`),F==="upload"){let ft=await Hx({apiKey:e.apiKey,file:se,folderPath:kx}),X=await Bx({attachment:ft,file:se,currentInlineBytes:Fx([...r,...ee])});ee.push(X);continue}let _e=await gF({apiKey:e.apiKey,file:se,folderPath:M,maxBytes:bx,limitLabel:"50 MB"});ee.push(_e)}catch(_e){Y(_e instanceof Error?_e.message:"Upload failed.")}F==="upload"?(o(se=>[...se,...ee]),await Se().catch(se=>Y(se instanceof Error?se.message:"Unable to refresh recent files."))):F==="my-files"&&(await ae(),u(se=>new Set([...se,...ee.map(_e=>_e.id)]))),ee.length&&j(`${ee.length} file${ee.length===1?"":"s"} uploaded.`)}async function $t(P,F){let ee=F==="my-files"?`/api/v1/user/me/attachments/${encodeURIComponent(P.id)}`:`/api/v1/user/me/temporary-files/${encodeURIComponent(P.id)}`,se=await fetch(ee,{method:"DELETE",headers:dt(e.apiKey,"application/json")}),_e=await se.json().catch(()=>({}));if(!se.ok)throw new Error(_e.error||"Unable to delete file.");F==="my-files"&&(s(ft=>ft.filter(X=>X.id!==P.id)),u(ft=>{let X=new Set(ft);return X.delete(P.id),X})),ce(null),j("File deleted.")}async function rt(P){if(P!=="my-files"||!U||U.mode!=="create")return;let F=Ff(U.baseFolder,U.value);if(!F){Y("Choose a folder name.");return}let ee=await fetch("/api/v1/user/me/attachments/folders",{method:"POST",headers:dt(e.apiKey,"application/json"),body:JSON.stringify({folder_path:F})}),se=await ee.json().catch(()=>({}));if(!ee.ok){Y(se.error||"Unable to create folder.");return}l(_e=>Array.from(new Set([..._e,F])).sort()),R(null),j("Folder created.")}async function Qt(P,F){if(P!=="my-files"||!U||U.mode!=="rename")return;let ee=U.value.trim(),se=Ff(xx(F),ee);if(!se||se===F)return;let _e=await fetch("/api/v1/user/me/attachments/folders",{method:"PATCH",headers:dt(e.apiKey,"application/json"),body:JSON.stringify({from_folder_path:F,to_folder_path:se})}),ft=await _e.json().catch(()=>({}));if(!_e.ok){Y(ft.error||"Unable to rename folder.");return}A(X=>X===F||X.startsWith(`${F}/`)?`${se}${X.slice(F.length)}`:X),await ae(),N(null),R(null),j("Folder renamed.")}async function mn(P,F){if(P!=="my-files")return;let ee=await fetch("/api/v1/user/me/attachments/folders",{method:"DELETE",headers:dt(e.apiKey,"application/json"),body:JSON.stringify({folder_path:F})}),se=await ee.json().catch(()=>({}));if(!ee.ok){Y(se.error||"Unable to delete folder.");return}A(_e=>_e===F||_e.startsWith(`${F}/`)?xx(F):_e),await ae(),N(null),R(null),j("Folder deleted.")}function Rn(P){let F=a,ee=i,se=M,_e=A,ft=qF({folders:F,files:ee,currentFolder:se}),X=so(se).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":!se,onClick:()=>_e(""),children:"files"}),X.map((Me,ue)=>{let Fe=X.slice(0,ue+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":Fe===se,onClick:()=>_e(Fe),children:Me})]},Fe)})]}),(0,f.jsx)("button",{type:"button",onClick:()=>R({mode:"create",scope:"my-files",baseFolder:se,value:""}),children:"New folder"})]}),ft.length?(0,f.jsx)("div",{className:"vf-editor-upload-folder-grid",children:ft.map(Me=>(0,f.jsxs)("article",{className:"vf-editor-upload-folder-row",children:[(0,f.jsxs)("button",{type:"button",className:"vf-editor-upload-folder-open",onClick:()=>_e(Me.path),children:[(0,f.jsx)("span",{className:"vf-editor-upload-folder-icon","aria-hidden":"true"}),(0,f.jsx)("span",{children:Me.name})]}),(0,f.jsx)("button",{type:"button",className:"vf-editor-upload-folder-menu-button","aria-label":`Folder actions for ${Me.name}`,onClick:()=>N(I===Me.path?null:Me.path),children:"..."}),I===Me.path?(0,f.jsxs)("div",{className:"vf-editor-upload-folder-menu",children:[(0,f.jsx)("button",{type:"button",onClick:()=>R({mode:"rename",scope:"my-files",folderPath:Me.path,value:Rx(Me.path)}),children:"Rename"}),(0,f.jsx)("button",{type:"button","data-danger":"true",onClick:()=>R({mode:"delete",scope:"my-files",folderPath:Me.path,value:""}),children:"Delete"})]}):null]},Me.path))}):null]})}function ao(P,F){let ee=F==="my-files"?c.has(P.id):F==="recents"?_.has(P.id):!1,se="s3Url"in P&&P.s3Url?P.s3Url:P.viewUrl;return(0,f.jsxs)("article",{className:"vf-editor-upload-file-card","data-selected":ee?"true":"false",children:[(0,f.jsxs)("button",{type:"button",className:"vf-editor-upload-file-select",onClick:()=>{if(F==="temporary"){nt(se);return}(F==="recents"?T:u)(ft=>{let X=new Set(ft);return X.has(P.id)?X.delete(P.id):X.add(P.id),X})},children:[(0,f.jsx)(Cx,{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:[wx(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":ee?"true":"false","aria-hidden":"true",children:ee?"\u2713":""}):null,(0,f.jsx)("a",{href:P.viewUrl,target:"_blank",rel:"noreferrer","aria-label":`View ${P.fileName}`,children:(0,f.jsx)(nS,{name:"share"})}),(0,f.jsx)("button",{type:"button","aria-label":`Copy URL for ${P.fileName}`,onClick:()=>{nt(se)},children:(0,f.jsx)(nS,{name:"link"})}),F==="recents"?null:(0,f.jsx)("button",{type:"button","aria-label":`Delete ${P.fileName}`,onClick:()=>ce(qe===P.id?null:P.id),children:(0,f.jsx)(nS,{name:"trash"})})]}),F!=="recents"&&qe===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:()=>ce(null),children:"Cancel"}),(0,f.jsx)("button",{type:"button","data-danger":"true",onClick:()=>{$t(P,F)},children:"Delete"})]}):null]},P.id)}function lo(){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:ee=>R({...U,value:ee.target.value}),onKeyDown:ee=>{ee.key==="Enter"&&(ee.preventDefault(),U.mode==="create"?rt(U.scope):Qt(U.scope,U.folderPath))}}),(0,f.jsxs)("div",{className:"vf-editor-upload-folder-dialog-actions",children:[(0,f.jsx)("button",{type:"button",onClick:()=>R(null),children:"Cancel"}),U.mode==="create"?(0,f.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",onClick:()=>{rt(U.scope)},children:"Create"}):U.mode==="rename"?(0,f.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",onClick:()=>{Qt(U.scope,U.folderPath)},children:"Rename"}):(0,f.jsx)("button",{type:"button","data-danger":"true",onClick:()=>{mn(U.scope,U.folderPath)},children:"Delete"})]})]})}if(!e.open)return null;let Bi=i.filter(P=>so(P.folderPath??"")===so(M));return(0,Ui.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:he,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:[pe?(0,f.jsx)("div",{className:"vf-editor-upload-status","data-tone":"error",children:pe}):null,$?(0,f.jsx)("div",{className:"vf-editor-upload-status",children:$}):null,lo(),t==="upload"?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("button",{type:"button",className:"vf-editor-upload-drop",onClick:()=>le.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:le,type:"file",multiple:!0,hidden:!0,onChange:P=>{We(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)(Cx,{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:wx(P.sizeBytes)})]}),(0,f.jsx)("button",{type:"button",onClick:()=>o(F=>F.filter(ee=>ee.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 ",Rx(M)," and auto-selects. Max 50 MB each."]})]}),(0,f.jsx)("input",{ref:D,type:"file",multiple:!0,hidden:!0,onChange:P=>{We(Array.from(P.target.files??[]),"my-files"),P.target.value=""}}),Rn("my-files"),(0,f.jsx)("div",{className:"vf-editor-upload-list",children:Bi.length?Bi.map(P=>ao(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:me.length?me.map(P=>ao(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:()=>{Se(g).catch(P=>Y(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:he,children:"Cancel"}),(0,f.jsxs)("div",{className:"vf-editor-upload-footer-confirm",children:[(0,f.jsxs)("span",{children:[K.length," file",K.length===1?"":"s"," selected"]}),(0,f.jsx)("button",{type:"button",className:"vf-editor-upload-confirm",disabled:!K.length,onClick:()=>{e.onConfirm(K),he()},children:"Confirm"})]})]})]})}),document.body)}function Wx({boot:e}){let t=e.template.templateId==="chat-brainstorm",n=t&&e.template.persistentHistorySidebar===!0,r=(0,b.useMemo)(()=>RF(e.template.templateId),[e.template.templateId]),o=(0,b.useMemo)(()=>bF(),[]),i=(0,b.useRef)(null),s=(0,b.useRef)(null),a=(0,b.useRef)(!0),l=(0,b.useRef)(!1),c=(0,b.useRef)(null),u=(0,b.useRef)(null),d=(0,b.useRef)(new Map),p=(0,b.useRef)({nextAvailableAt:0}),h=(0,b.useRef)([]),y=(0,b.useRef)(new Set),[_,T]=(0,b.useState)([]),[g,S]=(0,b.useState)(null),[E,x]=(0,b.useState)(null),[M,A]=(0,b.useState)(null),[I,N]=(0,b.useState)(""),[U,R]=(0,b.useState)([]),[$,j]=(0,b.useState)(null),[pe,Y]=(0,b.useState)(null),[qe,ce]=(0,b.useState)(null),[le,D]=(0,b.useState)(!1),[me,K]=(0,b.useState)(!1),[ae,Se]=(0,b.useState)(!1),[he,nt]=(0,b.useState)(!1),[We,$t]=(0,b.useState)(!1),[rt,Qt]=(0,b.useState)(null),[mn,Rn]=(0,b.useState)(!1),[ao,lo]=(0,b.useState)(null),[Bi,P]=(0,b.useState)(!1),[F,ee]=(0,b.useState)(()=>{let m=typeof window<"u"?window.__vidfarmEditorTracers:null;if(m)return m.get();if(typeof window<"u"){let v=Of();if(v.length)return v}return qn(e.template.tracers||[])}),se=(0,b.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]),_e=m=>e.threadsUrl?new URL(`${e.threadsUrl.replace(/\/$/,"")}/${encodeURIComponent(m)}`,window.location.origin).toString():null;(0,b.useEffect)(()=>{let m=PF(o?.getItem(r.threads)??null,e.template.templateId),v=o?.getItem(r.activeThread)??null,w=gx(),k=window.__vidfarmEditorTracers?.get()??Of(),B=w&&!m.some(de=>de.id===w)?[{id:w,templateId:e.template.templateId,title:"Loading chat",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),lastMessageAt:null,messageCount:0,tracers:k,hiddenFromView:!1,messages:[]},...m]:m,ne=B.filter(de=>!de.hiddenFromView),q=ne.find(de=>hc(de,k));h.current=B,T(B),w&&ne.some(de=>de.id===w)?S(w):v&&ne.some(de=>de.id===v)&&(!k.length||ne.some(de=>de.id===v&&hc(de,k)))?S(v):S(q?.id??ne[0]?.id??null),D(!0)},[e.template.templateId,o,r]),(0,b.useEffect)(()=>{if(!e.vidfarmApiKey||!se)return;let m=new AbortController;return(async()=>{try{let v=[],w=null,k=new Set;do{let B=new URL(se);w&&B.searchParams.set("cursor",w);let ne=await fetch(B.toString(),{method:"GET",headers:dt(e.vidfarmApiKey),signal:m.signal});if(!ne.ok)return;let q=await ne.json().catch(()=>null);Array.isArray(q?.threads)&&v.push(...q.threads.map(ge=>Sx(ge,e.template.templateId)).filter(ge=>!!ge));let de=typeof q?.next_cursor=="string"&&q.next_cursor?q.next_cursor:null;!de||k.has(de)?w=null:(k.add(de),w=de)}while(w&&!m.signal.aborted);if(!v.length)return;T(B=>{let ne=_x(B,v);return h.current=ne,ne}),S(B=>B&&h.current.some(ne=>ne.id===B)?B:v[0]?.id??B)}catch(v){if(v instanceof DOMException&&v.name==="AbortError")return}})(),()=>{m.abort()}},[e.template.templateId,e.vidfarmApiKey,se]),(0,b.useEffect)(()=>{h.current=_},[_]);let[ft,X]=(0,b.useState)(()=>{if(typeof window>"u")return null;try{return new URL(window.location.href).searchParams.get("fork")}catch{return null}});(0,b.useEffect)(()=>{let m=()=>{try{X(new URL(window.location.href).searchParams.get("fork"))}catch{X(null)}};return window.addEventListener("popstate",m),()=>{window.removeEventListener("popstate",m)}},[]);async function Me(m){if(!e.vidfarmApiKey){lo("Sign in to see forks.");return}if(!mn&&!(!m?.force&&rt!==null)){Rn(!0),lo(null);try{let v=await fetch("/api/v1/compositions",{method:"GET",headers:dt(e.vidfarmApiKey)});if(!v.ok){lo(v.status===401?"Sign in to see forks.":`Failed to load forks (${v.status}).`),Qt([]);return}let w=await v.json().catch(()=>null),B=(Array.isArray(w?.forks)?w.forks:[]).map(ne=>{if(!ne||typeof ne!="object")return null;let q=ne,de=typeof q.fork_id=="string"?q.fork_id:null;return de?{forkId:de,templateId:typeof q.template_id=="string"?q.template_id:null,parentForkId:typeof q.parent_fork_id=="string"?q.parent_fork_id:null,parentVersion:typeof q.parent_version=="number"?q.parent_version:null,title:typeof q.title=="string"?q.title:null,visibility:typeof q.visibility=="string"?q.visibility:null,latestVersion:typeof q.latest_version=="number"?q.latest_version:null,ownerCustomerId:typeof q.owner_customer_id=="string"?q.owner_customer_id:null,createdAt:typeof q.created_at=="string"?q.created_at:null,updatedAt:typeof q.updated_at=="string"?q.updated_at:null}:null}).filter(ne=>!!ne).filter(ne=>ne.templateId===e.template.templateId).sort((ne,q)=>String(q.updatedAt??"").localeCompare(String(ne.updatedAt??"")));Qt(B)}catch{lo("Could not load forks. Please try again."),Qt([])}finally{Rn(!1)}}}(0,b.useEffect)(()=>{We&&rt===null&&!mn&&Me()},[We]),(0,b.useEffect)(()=>{let m=window.__vidfarmEditorTracers;if(m)return ee(m.get()),m.subscribe(w=>ee(w));let v=()=>{let w=Of();ee(w.length?w:qn(e.template.tracers||[]))};return v(),window.addEventListener("popstate",v),()=>{window.removeEventListener("popstate",v)}},[e.template.tracers]);let ue=(0,b.useRef)(_),Fe=(0,b.useRef)(g);(0,b.useEffect)(()=>{ue.current=_,Fe.current=g},[_,g]),(0,b.useEffect)(()=>{if(!le)return;let m=window.setTimeout(()=>{try{o?.setItem(r.threads,JSON.stringify(yx(ue.current,Fe.current)))}catch(v){console.warn("Unable to persist editor chat threads.",v)}},300);return()=>window.clearTimeout(m)},[g,o,le,r,_]),(0,b.useEffect)(()=>{if(le)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,le,r]),(0,b.useEffect)(()=>{if(!le||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,le]);let te=(0,b.useMemo)(()=>_.find(m=>m.id===g)??null,[g,_]),bn=(0,b.useMemo)(()=>_.find(m=>m.id===M?.threadId)??null,[M?.threadId,_]);(0,b.useEffect)(()=>{if(!le||!e.vidfarmApiKey||!g)return;let m=h.current.find(q=>q.id===g);if(y.current.has(g))return;let v=gx();if(!!(m&&(m.messageCount??0)===0&&m.messages.length===0)){y.current.add(g);return}let k=_e(g);if(!k)return;let B=new AbortController;return!m?.messages.length&&x(g),(async()=>{try{let q=await fetch(k,{method:"GET",headers:dt(e.vidfarmApiKey),signal:B.signal});if(!q.ok){let we=!!(m&&g!==v),ve=!!(m&&(m.messageCount??0)===0&&m.messages.length===0);q.status===404&&!we&&!ve&&j(`Chat ID ${g} was not found for this account.`),y.current.add(g);return}let de=await q.json().catch(()=>null),ge=de?.thread?Sx(de.thread,e.template.templateId):null;if(!ge)return;y.current.add(ge.id),j(null),T(we=>{let ve=_x(we,[ge]);return h.current=ve,ve})}catch(q){if(q instanceof DOMException&&q.name==="AbortError")return}finally{B.signal.aborted||x(q=>q===g?null:q)}})(),()=>{B.abort(),x(q=>q===g?null:q)}},[g,e.vidfarmApiKey,e.threadsUrl,le]),(0,b.useEffect)(()=>{if(!le||te&&!te.hiddenFromView)return;let m=_.find(v=>!v.hiddenFromView&&hc(v,F));S(m?.id??_.find(v=>!v.hiddenFromView)?.id??null)},[te,le,_,F]);let zf=(0,b.useMemo)(()=>te?.tracers.length?te.tracers:F,[te?.tracers,F]),jf=(0,b.useMemo)(()=>_.filter(m=>!m.hiddenFromView).sort((m,v)=>{let w=hc(m,F),k=hc(v,F);return w!==k?w?-1:1:Date.parse(v.updatedAt)-Date.parse(m.updatedAt)}),[_,F]),gS=zf[0]??null,Wf=te?.messages??[],yS=pe!==null,Gf=!!(g&&pe===g),SS=(0,b.useMemo)(()=>(I.trim()||U.length)&&!yS,[I,U.length,yS]);(0,b.useEffect)(()=>{!le||!e.vidfarmApiKey||!te||!te.messages.length||dR(te)},[te,e.vidfarmApiKey,le]);async function yc(m,v){if(!e.vidfarmApiKey||!e.threadsUrl||!m.messages.length)return;let w=_e(m.id);w&&await fetch(w,{method:"PATCH",headers:dt(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 Yx(m){if(!e.vidfarmApiKey||!e.threadsUrl||!m.messages.length)return;let v=_e(m.threadId);v&&await fetch(`${v}/exchanges`,{method:"POST",headers:dt(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(k=>({id:k.id,fileName:k.fileName,contentType:k.contentType,viewUrl:k.viewUrl})),toolExchanges:w.toolExchanges,httpExchanges:w.httpExchanges?.map(gc)}))})}).catch(()=>{})}async function Kx(m){if(!e.vidfarmApiKey||!e.threadsUrl)return;let v=_e(m);v&&await fetch(v,{method:"DELETE",headers:dt(e.vidfarmApiKey)}).catch(()=>{})}function _S(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 aa(m){let v=qn(m),w=window.__vidfarmEditorTracers;if(w){w.set(v);return}ee(v),_S(v)}function vS(){let m=window.__vidfarmEditorTracers;if(m)return m.add();let v=AF(e.template.templateSlug,F);return aa([v,...F]),v}function ES(m){let v=window.__vidfarmEditorTracers?.get()??F,w=m?MF(m,v):null,k=window.__vidfarmEditorTracers;return k?k.add(w??void 0):w?(aa([w,...v.filter(B=>B!==w)]),w):vS()}function Jx(m){let v=m.trim();if(!v)return;let w=window.__vidfarmEditorTracers;w?w.add(v):F.includes(v)||aa([v,...F]),te&&st(te.id,k=>({...k,tracers:[v,...k.tracers.filter(B=>B!==v)],updatedAt:new Date().toISOString()}))}function Xx(m){let v=window.__vidfarmEditorTracers;if(v){v.remove(m);return}let w=F.filter(k=>k!==m);aa(w)}(0,b.useEffect)(()=>{_S(F)},[F]),(0,b.useEffect)(()=>{let m=s.current;if(!m)return;let v=()=>{a.current=aF(m),a.current||(l.current=!1)};return v(),m.addEventListener("scroll",v,{passive:!0}),()=>{m.removeEventListener("scroll",v)}},[]),(0,b.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)},[Wf,g]),(0,b.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,b.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,b.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 Qx(m){if(te)return te.id;let v=new Date().toISOString(),w=hx(),k={id:w,templateId:e.template.templateId,title:Nf(m||""),createdAt:v,updatedAt:v,lastMessageAt:null,messageCount:0,tracers:qn(F),messages:[]};return h.current=[k,...h.current],T(B=>[k,...B]),S(w),w}function Vf(m){let v=new Date().toISOString(),w=qn(m?.tracers??F),k=hx(),B={id:k,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(ne=>[B,...ne]),m?.activate!==!1&&(S(k),N(""),R([]),j(null)),A(null),k}function TS(){Vf(),nt(!1)}function Zx(m){let v=_.find(k=>k.id===m);if(!v||!window.confirm(`Delete conversation "${v.title}"?`))return;let w=_.filter(k=>k.id!==m);h.current=h.current.filter(k=>k.id!==m);for(let[k,B]of d.current.entries())B.threadId===m&&la(k);T(w),g===m&&S(w[0]?.id??null),j(null),A(null),Kx(m)}function st(m,v){let w=LF(h.current.map(k=>k.id===m?v(k):k));h.current=w,T(w)}function eR(m,v){let w=qn(v);st(m,B=>({...B,tracers:tS(B.tracers,w),updatedAt:new Date().toISOString()}));let k=h.current.find(B=>B.id===m);k&&yc({...k,tracers:tS(k.tracers,w),updatedAt:new Date().toISOString()},{tracers:tS(k.tracers,w)})}function IS(m,v){let w=m.trim();return w?h.current.find(k=>!k.hiddenFromView&&k.id!==v&&k.tracers.includes(w))?.id??null:null}function tR(m,v){let w=IS(m);return w||Vf({tracers:[m],title:v?.title||`Tracer ${m}`,activate:v?.activate??!1})}function nR(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 rR(m){let v=IS(m.tracer,m.sourceThreadId);if(!v&&!m.shouldCreateThread)return null;let w=v??tR(m.tracer,{title:`Tracer ${m.tracer}`,activate:!1});if(!w||w===m.sourceThreadId)return null;let k=Lf("assistant"),B=new Date().toISOString(),ne=m.job.status==="succeeded"||m.job.status==="failed"||m.job.status==="cancelled"?bf(m.job):ax(m.job),q=m.job.status==="succeeded"||m.job.status==="failed"||m.job.status==="cancelled"?null:`Job ${m.job.job_id} is being tracked. ${Yf()}`,de={id:k,role:"assistant",text:ne,attachments:[],httpExchanges:m.httpExchange?[m.httpExchange]:[],statusText:q,isPending:!1};st(w,we=>({...we,updatedAt:B,messages:[...we.messages,de]}));let ge=h.current.find(we=>we.id===w);return ge&&Yx({threadId:w,templateId:ge.templateId,title:ge.title,tracers:ge.tracers,messages:[de]}),{threadId:w,messageId:k}}function oR(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 k=qn(w.split(","));st(m,B=>({...B,tracers:k,updatedAt:new Date().toISOString()})),yc(v,{tracers:k}),A(null)}function iR(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 k=qn(v.tracers.map(kF));st(m,B=>({...B,tracers:k,updatedAt:new Date().toISOString()})),yc(v,{tracers:k,archived:!0}),A(null)}function sR(m){let v=_.find(k=>k.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[k,B]of d.current.entries())B.threadId===m&&la(k);if(st(m,k=>({...k,hiddenFromView:!0,updatedAt:new Date().toISOString()})),g===m){let k=jf.find(B=>B.id!==m);S(k?.id??null)}A(null),j(null),yc(v,{hiddenFromView:!0})}}async function aR(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 lR(m,v){if(M?.threadId===m){A(null);return}let w=v.getBoundingClientRect(),k=148;A({threadId:m,top:w.bottom+6,left:Math.max(8,Math.min(window.innerWidth-k-8,w.right-k))})}function la(m){let v=d.current.get(m);v&&(v.timeoutId!==null&&window.clearTimeout(v.timeoutId),v.abortController?.abort(),d.current.delete(m))}function ca(m,v,w){let k=d.current.get(m);k&&qf(k,v,w)}function qf(m,v,w){m.timeoutId!==null&&window.clearTimeout(m.timeoutId);let k=Math.max(dx,w);m.nextPollAt=Date.now()+k,m.timeoutId=window.setTimeout(()=>{m.timeoutId=null,v()},k)}function Hi(){return d.current.size>=cx?cF:lx}function $i(m=Hi()){if(m>=6e4){let v=Math.round(m/6e4);return`${v} min${v===1?"":"s"}`}return`${Math.round(m/1e3)}s`}function Yf(m=Hi()){return d.current.size>=cx?`Many renders are active, so the next check is in ${$i(m)}.`:`Checking again gently every ${$i(m)}.`}function cR(){let m=Hi();if(m===lx)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 uR(m){let v=Math.max(m,p.current.nextAvailableAt);return p.current.nextAvailableAt=v+uF,v-m}function Kf(m){let v=fx(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 ne=d.current.get(v);if(!ne||ne.inFlight)return;let q=Date.now(),de=Hi();if(ne.lastPollAt!==null&&q-ne.lastPollAt<de){ca(v,w,de-(q-ne.lastPollAt));return}if(ne.attempts>=ux){st(m.threadId,we=>({...we,updatedAt:new Date().toISOString(),messages:we.messages.map(ve=>ve.id===m.assistantMessageId?{...ve,statusText:"Background polling stopped after multiple checks. Open the job route when you want to refresh again."}:ve)})),la(v);return}if(document.visibilityState!=="visible"||!navigator.onLine){ca(v,w,de);return}let ge=uR(Date.now());if(ge>0){ca(v,w,ge);return}ne.inFlight=!0,ne.lastPollAt=q,ne.nextPollAt=null,ne.attempts+=1,ne.abortController=new AbortController;try{st(m.threadId,Be=>({...Be,updatedAt:new Date().toISOString(),messages:Be.messages.map(ke=>ke.id===m.assistantMessageId?{...ke,statusText:`Job ${m.jobId} is being tracked. ${Yf(de)}`}:ke)}));let we=m.primitiveId||dF(m.sourceRequestUrl)?`/api/v1/primitives/jobs/${encodeURIComponent(m.jobId)}`:`/api/v1/templates/${encodeURIComponent(e.template.templateId)}/jobs/${encodeURIComponent(m.jobId)}`,ve=await fetch(we,{method:"GET",headers:dt(e.vidfarmApiKey),signal:ne.abortController.signal}),Yn=await ve.json().catch(()=>null),Xf=Object.fromEntries(ve.headers.entries()),V=Li(Yn);if(st(m.threadId,Be=>({...Be,updatedAt:new Date().toISOString(),messages:Be.messages.map(ke=>{if(ke.id!==m.assistantMessageId)return ke;let mr=lF(ke.httpExchanges,gc({explanation:`Automatic ${$i(de)} job status check for ${m.jobId}`,pollJobId:m.jobId,pollMode:"automatic",request:{method:"GET",url:we,headers:Object.fromEntries(dt(e.vidfarmApiKey).entries())},result:{status:ve.status,statusText:ve.statusText,headers:Xf,body:Yn}})),Kn=V?V.status==="succeeded"?`Render ${V.job_id} succeeded.`:V.status==="failed"||V.status==="cancelled"?`Render ${V.job_id} ${V.status}.${V.error?.message?` ${V.error.message}`:""}`:`Render ${V.job_id} is ${V.status}. Next check in ${$i(de)}.`:`Render ${m.jobId} checked. Next check in ${$i(de)}.`;return{...ke,httpExchanges:mr,statusText:Kn,text:V&&(V.status==="succeeded"||V.status==="failed"||V.status==="cancelled")?kf(ke.text,bf(V)):ke.text}})})),V&&(V.status==="succeeded"||V.status==="failed"||V.status==="cancelled")){la(v);return}}catch(we){if(we instanceof DOMException&&we.name==="AbortError")return;st(m.threadId,ve=>({...ve,updatedAt:new Date().toISOString(),messages:ve.messages.map(Yn=>Yn.id===m.assistantMessageId?{...Yn,statusText:`Automatic polling paused after an error. It will retry in ${$i()}.`}:Yn)}))}finally{let we=d.current.get(v);if(!we)return;we.inFlight=!1,we.abortController=null,we.attempts<ux&&we.timeoutId===null&&d.current.has(v)&&ca(v,w,Hi())}},k=d.current.get(v);k&&(k.runPoll=w),d.current.get(v)&&(ca(v,w,m.initialDelayMs??Hi()),cR())}function dR(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 k=Li(w.result.body),B=fx(m.id,v.id,k?.job_id??"");!k||ia(k.status)||d.current.has(B)||v.httpExchanges.some(q=>{let de=Li(q.result.body);return de?.job_id===k.job_id&&ia(de.status)})||Kf({threadId:m.id,assistantMessageId:v.id,jobId:k.job_id,tracer:k.tracer,initialStatus:k.status,primitiveId:k.primitive_id,sourceRequestUrl:w.request.url,initialDelayMs:dx})}}async function Jf(m){if(!m.length)return;j(null);let v=[],w=null;for(let k of m)try{let B=await Hx({apiKey:e.vidfarmApiKey,file:k,folderPath:kx}),ne=await Bx({attachment:B,file:k,currentInlineBytes:Fx([...U,...v])});v.push(ne)}catch(B){w=B instanceof Error?B.message:"Unable to upload attachment."}w&&v.length===0&&j(w),v.length&&(R(k=>[...k,...v]),w&&j(w))}async function fR(m){let v=Array.from(m.target.files??[]);await Jf(v),m.target.value=""}async function pR(m){let v=Array.from(m.clipboardData.files??[]).filter(w=>w.size>0);v.length&&(m.preventDefault(),await Jf(v))}async function mR(m){m.preventDefault(),K(!1);let v=Array.from(m.dataTransfer.files??[]).filter(w=>w.size>0);v.length&&await Jf(v)}async function wS(){if(!SS)return;l.current=!0;let m=Qx(I),v=new Date().toISOString(),w=h.current.find(ge=>ge.id===m),k={id:Lf("user"),role:"user",text:I.trim(),attachments:U},B={id:Lf("assistant"),role:"assistant",text:"",attachments:[],statusText:"Waiting for AI response\u2026",isPending:!0},ne=w?.messages??[],q=EF([...ne,k]);st(m,ge=>({...ge,title:ge.messages.length===0?Nf(k.text):ge.title,updatedAt:v,messages:[...ge.messages,k,B]})),N(""),R([]),j(null),Y(m),ce("Waiting for AI response\u2026");let de=new AbortController;u.current={abortController:de,threadId:m,assistantMessageId:B.id};try{let ge=JSON.stringify({messages:IF(q),thread_id:m,thread_template_id:w?.templateId??e.template.templateId,thread_title:ne.length===0?Nf(k.text):w?.title??Nf(k.text),thread_tracers:zf,client_context:JU(),user_message:{id:k.id,role:k.role,text:k.text,attachments:k.attachments.map(V=>({id:V.id,fileName:V.fileName,contentType:V.contentType,viewUrl:V.viewUrl}))},assistant_message:{id:B.id},template:{...e.template,tracers:zf,defaultRequestTracer:gS,activeTracer:gS},cached_context:{...e.cachedContext,...wF(),...CF()}});Nr("chat.send.attempt",{thread_id:m,template_id:e.template.templateId,message_count:q.length,attachment_count:k.attachments.length,text_length:k.text.length});let we=Date.now(),ve=await fetch(e.apiUrl||"/api/v1/editor-chat",{method:"POST",headers:dt(e.vidfarmApiKey,"application/json"),signal:de.signal,body:ge});if(!ve.ok){let V=await ve.json().catch(()=>({}));throw io("chat.send.rejected",{thread_id:m,status:ve.status,error:typeof V?.error=="string"?V.error:null}),new Error(typeof V?.error=="string"?V.error:`Chat failed with status ${ve.status}.`)}Nr("chat.send.stream_open",{thread_id:m,latency_ms:Date.now()-we});let Yn=new Map,Xf=nR(k.text);await xF(ve,{onDelta:V=>{ce("AI is responding\u2026"),st(m,Be=>({...Be,updatedAt:new Date().toISOString(),messages:Be.messages.map(ke=>ke.id===B.id?{...ke,text:`${ke.text}${V}`,statusText:"AI is responding\u2026",isPending:!1}:ke)}))},onStatus:V=>{ce(V),st(m,Be=>({...Be,messages:Be.messages.map(ke=>ke.id===B.id?{...ke,statusText:V,isPending:!ke.text}:ke)}))},onToolCall:V=>{Yn.set(V.toolCallId,{toolName:V.toolName,args:V.args}),st(m,Be=>({...Be,updatedAt:new Date().toISOString(),messages:Be.messages.map(ke=>ke.id===B.id?{...ke,toolExchanges:[...ke.toolExchanges??[],{toolCallId:V.toolCallId,toolName:V.toolName,args:Di(V.args),status:"pending"}]}:ke)}))},onToolResult:V=>{let Be=Nx(V.result),ke=Yn.get(V.toolCallId);if(V.toolName==="frontend_action"){let Zt=V.result;if(Zt?.action==="add_tracer")ES(Zt.tracer??void 0);else if(Zt?.action==="remove_tracer"&&Zt.tracer)Xx(Zt.tracer);else if(Zt?.action==="activate_tracer"&&Zt.tracer)Jx(Zt.tracer);else if(Zt?.action==="create_thread"){let bt=Zt.tracer?ES(Zt.tracer):vS();Vf({tracers:bt?[bt]:[],title:bt?`Tracer ${bt}`:"New chat",activate:!1})}}let mr=V.result,Kn=Li(mr?.response?.body),yR=mr?.request&&mr?.response?gc({explanation:mr.explanation??null,request:mr.request,result:mr.response}):void 0,Sc=mr?.request?.method==="POST"&&Kn?.tracer?rR({sourceThreadId:m,tracer:Kn.tracer,job:Kn,httpExchange:yR,shouldCreateThread:Xf}):null;Sc&&Kn&&!ia(Kn.status)&&Kf({threadId:Sc.threadId,assistantMessageId:Sc.messageId,jobId:Kn.job_id,tracer:Kn.tracer,initialStatus:Kn.status,primitiveId:Kn.primitive_id,sourceRequestUrl:mr?.request?.url}),st(m,Zt=>({...Zt,updatedAt:new Date().toISOString(),messages:Zt.messages.map(bt=>{if(bt.id!==B.id)return bt;let SR=(bt.toolExchanges??[]).map(zi=>zi.toolCallId===V.toolCallId?{...zi,result:Be,status:typeof V.result?.error=="string"?"error":"complete"}:zi),hr=V.result,ot=Li(hr?.response?.body),_R=hr?.request&&hr?.response?[...bt.httpExchanges??[],gc({explanation:hr.explanation??null,request:hr.request,result:hr.response})]:bt.httpExchanges;if(ke&&Yn.delete(V.toolCallId),hr?.request?.method==="POST"&&ot?.tracer){let zi=window.__vidfarmEditorTracers;zi?zi.add(ot.tracer):aa([ot.tracer,...F.filter(vR=>vR!==ot.tracer)]),eR(m,[ot.tracer])}return ot&&!Sc&&!ia(ot.status)&&Kf({threadId:m,assistantMessageId:B.id,jobId:ot.job_id,tracer:ot.tracer,initialStatus:ot.status,primitiveId:ot.primitive_id,sourceRequestUrl:hr?.request?.url}),{...bt,toolExchanges:SR,httpExchanges:_R,statusText:ot&&!ia(ot.status)?`Job ${ot.job_id} is being tracked. ${Yf()}`:bt.statusText,isPending:!1,text:ot&&hr?.request?.method==="POST"&&hr?.response?.status===202?kf(bt.text,ax(ot)):ot&&ia(ot.status)||ot?kf(bt.text,bf(ot)):bt.text}})}))},onError:V=>{io("chat.stream.error",{thread_id:m,message:V}),j(V),ce(null),st(m,Be=>({...Be,messages:Be.messages.filter(ke=>ke.id!==B.id)}))}}),Nr("chat.stream.completed",{thread_id:m,duration_ms:Date.now()-we}),st(m,V=>({...V,updatedAt:new Date().toISOString(),messages:V.messages.map(Be=>Be.id===B.id?{...Be,statusText:Be.statusText?.includes("being tracked")?Be.statusText:null,isPending:!1}:Be)}))}catch(ge){if(ge instanceof DOMException&&ge.name==="AbortError"){KC("chat.send.aborted",{thread_id:m}),j(null),ce(null),st(m,we=>({...we,updatedAt:new Date().toISOString(),messages:we.messages.map(ve=>ve.id!==B.id?ve:!!(ve.text.trim()||ve.toolExchanges?.length||ve.httpExchanges?.length)?{...ve,statusText:"Stopped.",isPending:!1}:{...ve,text:"Stopped.",statusText:null,isPending:!1})}));return}io("chat.send.failed",{thread_id:m,message:ge instanceof Error?ge.message:String(ge)}),j(ge instanceof Error?ge.message:"Unable to send chat message."),ce(null),st(m,we=>({...we,messages:we.messages.map(ve=>ve.id===B.id?{...ve,text:ge instanceof Error?`Error: ${ge.message}`:"Error: Unable to send chat message.",statusText:null,isPending:!1}:ve)}))}finally{u.current?.assistantMessageId===B.id&&(u.current=null),Y(ge=>ge===m?null:ge),ce(null)}}function hR(){ce("Stopping\u2026");let m=u.current;m&&st(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,b.useEffect)(()=>()=>{u.current?.abortController.abort();for(let m of d.current.keys())la(m);try{o?.setItem(r.threads,JSON.stringify(yx(ue.current,Fe.current)))}catch{}},[o,r]);function gR(m){m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),wS())}let CS=(0,f.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,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),j(null),A(null),nt(!1),t&&Se(!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(),lR(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":ae?"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":ae,onClick:()=>Se(!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":he||We?"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:TS,children:"New chat"}),CS]}):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":he?"Back to chat":"Open chat history","aria-pressed":he,onClick:()=>{nt(m=>!m),$t(!1)},children:he?(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":We?"Back to chat":"Open template forks","aria-pressed":We,onClick:()=>{$t(m=>!m),nt(!1)},children:We?(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:he?"Chat history":We?"Template forks":e.template.templateTitle})]}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-new-thread",onClick:TS,children:"New chat"}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-minimize","aria-label":"Minimize chat",onClick:()=>Se(!1),children:"\xD7"})]}),M&&bn?(0,Ui.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:()=>aR(bn.id),children:"Copy Chat ID"}),(0,f.jsx)("button",{type:"button",onClick:()=>oR(bn.id),children:"Edit tracers"}),(0,f.jsx)("button",{type:"button",onClick:()=>sR(bn.id),children:"Remove from view"}),(0,f.jsx)("button",{type:"button",onClick:()=>iR(bn.id),children:"Archive thread"}),(0,f.jsx)("button",{type:"button","data-danger":"true",onClick:()=>Zx(bn.id),children:"Delete"})]}),document.body):null]}),(0,f.jsx)("div",{className:"vf-editor-chat-viewport",ref:s,children:he?(0,f.jsx)("div",{className:"vf-editor-chat-history-panel",children:CS}):We?(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:[rt?.length??0," fork",(rt?.length??0)===1?"":"s"," of this template"]})]}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-branches-refresh",onClick:()=>{Me({force:!0})},disabled:mn,"aria-label":"Refresh forks",children:mn?"Loading\u2026":"Refresh"})]}),ao?(0,f.jsx)("div",{className:"vf-editor-chat-thread-empty",role:"status",children:ao}):mn&&!rt?(0,f.jsx)("div",{className:"vf-editor-chat-thread-empty",children:"Loading forks\u2026"}):rt&&rt.length?(0,f.jsx)("div",{className:"vf-editor-chat-thread-list",children:rt.map(m=>{let v=ft===m.forkId,w=`/editor/${encodeURIComponent(e.template.templateId)}?fork=${encodeURIComponent(m.forkId)}`,k=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}`:""}`:"",ne=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:[k,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",ne,B]})]})},m.forkId)})}):(0,f.jsx)("div",{className:"vf-editor-chat-thread-empty",children:"No forks yet for this template."})]}):Wf.length?Wf.map(m=>(0,f.jsx)(VF,{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:he||We,children:(0,f.jsxs)("div",{className:"vf-editor-chat-composer","data-drop-target":me?"true":"false",onDragEnter:m=>{m.preventDefault(),K(!0)},onDragOver:m=>{m.preventDefault(),me||K(!0)},onDragLeave:m=>{m.preventDefault();let v=m.relatedTarget;v instanceof Node&&m.currentTarget.contains(v)||K(!1)},onDrop:m=>{mR(m)},children:[me?(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)(HF,{attachment:m,onRemove:()=>R(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:gR,onPaste:m=>{pR(m)}}),(0,f.jsx)("button",{type:"button",className:"vf-editor-chat-send-button",onClick:()=>{if(Gf){hR();return}wS()},disabled:Gf?!1:!SS,children:Gf?"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=>{fR(m)}})]})})]})]}),(0,f.jsx)(YF,{apiKey:e.vidfarmApiKey,open:Bi,onClose:()=>P(!1),onConfirm:m=>R(v=>[...v,...m])})]})}var pn=hn(mc(),1);JC();function KF(){let e=document.getElementById("page-runtime-boot");return e?.textContent?JSON.parse(e.textContent):null}function Hf(e){let t=new Date;return t.setDate(t.getDate()+e),t.toISOString()}async function JF(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:Hf(-7),end_date:Hf(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||Hf(-7),rangeEnd:o.endDate||Hf(30),replaceRange:!0}),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated")))}function XF({boot:e}){let t=(0,Fi.useMemo)(()=>tx(e),[e]),n=YC(t,i=>i.boot.title),[r,o]=(0,Fi.useState)(null);return(0,Fi.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,Fi.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,Gx.createPortal)((0,pn.jsx)(ks,{fallback:(0,pn.jsx)(QF,{}),children:(0,pn.jsx)(Wx,{boot:e.editorChat})}),r):null}function QF(){return(0,pn.jsxs)("div",{style:{display:"grid",placeItems:"center",height:"100%",padding:"24px",textAlign:"center",gap:"12px",color:"#5c6a82"},children:[(0,pn.jsx)("div",{style:{fontSize:"0.72rem",fontWeight:800,letterSpacing:"0.14em",textTransform:"uppercase"},children:"Chat error"}),(0,pn.jsx)("div",{style:{fontSize:"0.92rem"},children:"Something went wrong loading the chat. Reload the page to try again."}),(0,pn.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 Vo=KF(),mS=document.getElementById("page-runtime-root"),hS=ex(Vo?.userId??null),$f=null;function qx(e={}){return!e.force&&$f||($f=JF({userId:Vo?.userId??null,store:hS,force:e.force}).catch(()=>{})),$f}window.__vidfarmFlockPosterCache={readSnapshot:()=>Ky(Vo?.userId??null),ensureHydrated:qx,setChannelsData:e=>{hS.getState().setChannelsData(e),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated"))},setCalendarData:e=>{hS.getState().setCalendarData(e),window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated"))}};qx();Nr("page_runtime.boot",{has_boot:!!Vo,has_root:!!mS,page_kind:Vo?.pageKind??null,editor_chat_template_id:Vo?.editorChat?.template?.templateId??null});Vo&&mS&&(0,Vx.createRoot)(mS).render((0,pn.jsx)(ks,{fallback:(0,pn.jsx)(pn.Fragment,{}),onError:e=>io("page_runtime.render_error",{message:e instanceof Error?e.message:String(e)}),children:(0,pn.jsx)(XF,{boot:Vo})}));
46
+ /*! Bundled license information:
47
+
48
+ react/cjs/react.production.min.js:
49
+ (**
50
+ * @license React
51
+ * react.production.min.js
52
+ *
53
+ * Copyright (c) Facebook, Inc. and its affiliates.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE file in the root directory of this source tree.
57
+ *)
58
+
59
+ scheduler/cjs/scheduler.production.min.js:
60
+ (**
61
+ * @license React
62
+ * scheduler.production.min.js
63
+ *
64
+ * Copyright (c) Facebook, Inc. and its affiliates.
65
+ *
66
+ * This source code is licensed under the MIT license found in the
67
+ * LICENSE file in the root directory of this source tree.
68
+ *)
69
+
70
+ react-dom/cjs/react-dom.production.min.js:
71
+ (**
72
+ * @license React
73
+ * react-dom.production.min.js
74
+ *
75
+ * Copyright (c) Facebook, Inc. and its affiliates.
76
+ *
77
+ * This source code is licensed under the MIT license found in the
78
+ * LICENSE file in the root directory of this source tree.
79
+ *)
80
+
81
+ react/cjs/react-jsx-runtime.production.min.js:
82
+ (**
83
+ * @license React
84
+ * react-jsx-runtime.production.min.js
85
+ *
86
+ * Copyright (c) Facebook, Inc. and its affiliates.
87
+ *
88
+ * This source code is licensed under the MIT license found in the
89
+ * LICENSE file in the root directory of this source tree.
90
+ *)
91
+
92
+ @sentry/core/build/esm/utils/env.js:
93
+ (*! __SENTRY_SDK_SOURCE__ *)
94
+ */