@inkeep/open-knowledge 0.0.0-dev-20260424205527 → 0.0.0-dev-20260424235440
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/skills/open-knowledge/SKILL.md +5 -0
- package/dist/cli.mjs +64 -61
- package/dist/constants-Bp2eH26E.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/{init-i7vPAWv4.mjs → init-0LxWJ-6l.mjs} +2 -2
- package/dist/init-CQtHg31y.mjs +1 -0
- package/dist/init-CUmfZczR.mjs +5 -0
- package/dist/init-EmyViDSm.mjs +1 -0
- package/dist/{loader-CEfLKIxb.mjs → loader-5fUYhvT7.mjs} +2 -2
- package/dist/loader-CLKYIpRM.mjs +1 -0
- package/dist/paths-Bmv6OTgc.mjs +1 -0
- package/dist/{paths-BN0gQKmX.mjs → paths-D7eyE9c-.mjs} +2 -2
- package/dist/preview-Bwvil0xG.mjs +1 -0
- package/dist/{preview-BmSvc-WZ.mjs → preview-DW48ZUVb.mjs} +2 -2
- package/dist/public/assets/ActivityModeContent-DER5Nogg.js +2 -0
- package/dist/public/assets/ActivityPanelDiffView-DVyTW-J7.js +13 -0
- package/dist/public/assets/ActivityPanelDiffView-legcy4jI.css +1 -0
- package/dist/public/assets/DocumentContext--jj-O3yz.js +5 -0
- package/dist/public/assets/GraphPanel-CBqnoz3m.js +46 -0
- package/dist/public/assets/McpConsentDialogBody-D_7y-PBs.js +1 -0
- package/dist/public/assets/{panel-jSlO39XJ.js → PageListContext-DdGQSVEJ.js} +76 -76
- package/dist/public/assets/SourceEditor-C2oyeI25.js +3 -0
- package/dist/public/assets/agent-presence-BQu9C0ej.js +1 -0
- package/dist/public/assets/button-B1XQHQcX.js +1 -0
- package/dist/public/assets/clipboard-DRhtxu43.js +32 -0
- package/dist/public/assets/compiler-runtime-Y11fyRVL.js +1 -0
- package/dist/public/assets/dialog-xzAlDsHy.js +45 -0
- package/dist/public/assets/{dist-Crc5NE1l.js → dist-BqO6NfD-.js} +1 -1
- package/dist/public/assets/{dist-DRn8lLJe.js → dist-CgLbXgrr.js} +1 -1
- package/dist/public/assets/{dist-BCB7v76S.js → dist-D2wwoXzm.js} +1 -1
- package/dist/public/assets/{dist-DF16X4DB.js → dist-DR1MrLJC.js} +1 -1
- package/dist/public/assets/{dist-Dx3W_u4i.js → dist-DeDgmJv2.js} +1 -1
- package/dist/public/assets/{dist-CjujjdB3.js → dist-DlS42TIP.js} +1 -1
- package/dist/public/assets/{dist-CDhLtkvx.js → dist-GlH2KPqY.js} +1 -1
- package/dist/public/assets/index-CIIADYsi.css +1 -0
- package/dist/public/assets/index-D_7iKKj-.js +27 -0
- package/dist/public/assets/panel-rtdrPcLu.js +1 -0
- package/dist/public/assets/{telemetry-impl-D_lLX0fS.js → telemetry-impl-BTqkcpTj.js} +2 -2
- package/dist/public/assets/toggle-group-B86VAmbm.js +1 -0
- package/dist/public/assets/tooltip-C2q723j6.js +1 -0
- package/dist/public/index.html +16 -11
- package/dist/src-CO-0JWV1.mjs +1 -0
- package/dist/src-DNH9XQcP.mjs +1 -0
- package/dist/{src-DBQiBMMB.mjs → src-H34RCSr9.mjs} +28 -18
- package/dist/start-D22sG9zf.mjs +1 -0
- package/dist/{start-J6AfuX7h.mjs → start-DbI7KgzR.mjs} +2 -2
- package/package.json +1 -1
- package/dist/constants-Dqmeg2oi.mjs +0 -2
- package/dist/init-3UxRGVAs.mjs +0 -1
- package/dist/init-AmgsVReV.mjs +0 -1
- package/dist/init-DIbZ0Udv.mjs +0 -5
- package/dist/loader-CQUrJ6T-.mjs +0 -1
- package/dist/paths-HWNY8fZl.mjs +0 -1
- package/dist/preview-DzHGOZjd.mjs +0 -1
- package/dist/public/assets/GraphPanel-CMj_CKRD.js +0 -46
- package/dist/public/assets/McpConsentDialogBody-BpxsNx0A.js +0 -1
- package/dist/public/assets/SourceEditor-BSUZdSkZ.js +0 -3
- package/dist/public/assets/button-D7O9FEkM.js +0 -1
- package/dist/public/assets/clipboard-B0g7jEdf.js +0 -36
- package/dist/public/assets/dialog-DzmWgC4p.js +0 -45
- package/dist/public/assets/index-Bnp3jcJM.js +0 -27
- package/dist/public/assets/index-tR5M38z1.css +0 -1
- package/dist/public/assets/toggle-group-D0c1wSh_.js +0 -1
- package/dist/src-DjVVQCyp.mjs +0 -1
- package/dist/src-zcKwR9RH.mjs +0 -1
- package/dist/start-Dta5BSHL.mjs +0 -1
- /package/dist/public/assets/{__vite-browser-external-BFtnoaxY.js → __vite-browser-external-Dz2JgTKm.js} +0 -0
- /package/dist/public/assets/{go-BL7jA4zR.js → go-DatQmDtN.js} +0 -0
- /package/dist/public/assets/{shell-DKDblpGA.js → shell-7yok6dsz.js} +0 -0
- /package/dist/public/assets/{w3c-keyname-B56rf6AD.js → w3c-keyname-CSlwavrd.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./compiler-runtime-Y11fyRVL.js";import{n as i}from"./button-B1XQHQcX.js";var a=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},o=new class extends a{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},s={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},c=new class{#e=s;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function l(e){setTimeout(e,0)}var u=typeof window>`u`||`Deno`in globalThis;function d(){}function f(e,t){return typeof e==`function`?e(t):e}function p(e){return typeof e==`number`&&e>=0&&e!==1/0}function m(e,t){return Math.max(e+(t||0)-Date.now(),0)}function h(e,t){return typeof e==`function`?e(t):e}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==y(o,t.options))return!1}else if(!x(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function v(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(b(t.options.mutationKey)!==b(a))return!1}else if(!x(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function y(e,t){return(t?.queryKeyHashFn||b)(e)}function b(e){return JSON.stringify(e,(e,t)=>E(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function x(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>x(e[n],t[n])):!1}var S=Object.prototype.hasOwnProperty;function C(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=T(e)&&T(t);if(!r&&!(E(e)&&E(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:S.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=C(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function w(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function T(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function E(e){if(!D(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!D(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function D(e){return Object.prototype.toString.call(e)===`[object Object]`}function ee(e){return new Promise(t=>{c.setTimeout(t,e)})}function O(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:C(e,t)}function te(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ne(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var k=Symbol();function A(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===k?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function j(e,t){return typeof e==`function`?e(...t):!!e}function re(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var M=(()=>{let e=()=>u;return{isServer(){return e()},setIsServer(t){e=t}}})();function N(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ie=l;function ae(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ie,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var P=ae(),F=new class extends a{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function oe(e){return Math.min(1e3*2**e,3e4)}function I(e){return(e??`online`)===`online`?F.isOnline():!0}var L=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function R(e){let t=!1,n=0,r,i=N(),a=()=>i.status!==`pending`,s=t=>{if(!a()){let n=new L(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>o.isFocused()&&(e.networkMode===`always`||F.isOnline())&&e.canRun(),d=()=>I(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(M.isServer()?0:3),o=e.retryDelay??oe,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),ee(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:s,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),i)}}var z=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),p(this.gcTime)&&(this.#e=c.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(M.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(c.clearTimeout(this.#e),this.#e=void 0)}},se=class extends z{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=H(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=H(this.options);e.data!==void 0&&(this.setState(V(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=O(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(d).catch(d):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>g(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===k||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>h(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!m(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=A(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=R({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof L&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof L){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...B(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...V(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),P.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function B(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:I(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function V(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function H(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var ce=class extends a{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=N(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),U(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return W(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return W(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof g(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!w(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&G(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||h(this.options.staleTime,this.#t)!==h(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ue(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(d)),t}#g(){this.#b();let e=h(this.options.staleTime,this.#t);if(M.isServer()||this.#r.isStale||!p(e))return;let t=m(this.#r.dataUpdatedAt,e)+1;this.#d=c.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(M.isServer()||g(this.options.enabled,this.#t)===!1||!p(this.#p)||this.#p===0)&&(this.#f=c.setInterval(()=>{(this.options.refetchIntervalInBackground||o.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(c.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(c.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&U(e,t),o=i&&G(e,n,t,r);(a||o)&&(l={...l,...B(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=O(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=O(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let _=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&_,x=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:K(e,t),refetch:this.refetch,promise:this.#o,isEnabled:g(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{i(this.#o=S.promise=N())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!w(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){P.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function le(e,t){return g(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function U(e,t){return le(e,t)||e.state.data!==void 0&&W(e,t,t.refetchOnMount)}function W(e,t,n){if(g(t.enabled,e)!==!1&&h(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&K(e,t)}return!1}function G(e,t,n,r){return(e!==t||g(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&K(e,n)}function K(e,t){return g(t.enabled,e)!==!1&&e.isStaleByTime(h(t.staleTime,e))}function ue(e,t){return!w(e.getCurrentResult(),t)}var q=e(t(),1),J=n(),Y=q.createContext(void 0),X=e=>{let t=q.useContext(Y);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},de=({client:e,children:t})=>(q.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,J.jsx)(Y.Provider,{value:e,children:t})),fe=q.createContext(!1),pe=()=>q.useContext(fe);fe.Provider;function me(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var he=q.createContext(me()),ge=()=>q.useContext(he),_e=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?j(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},ve=e=>{q.useEffect(()=>{e.clearReset()},[e])},ye=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||j(n,[e.error,r])),be=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},xe=(e,t)=>e.isLoading&&e.isFetching&&!t,Se=(e,t)=>e?.suspense&&t.isPending,Ce=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function we(e,t,n){let r=pe(),i=ge(),a=X(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,be(o),_e(o,i,s),ve(i);let c=!a.getQueryCache().get(o.queryHash),[l]=q.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),f=!r&&e.subscribed!==!1;if(q.useSyncExternalStore(q.useCallback(e=>{let t=f?l.subscribe(P.batchCalls(e)):d;return l.updateResult(),t},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),q.useEffect(()=>{l.setOptions(o)},[o,l]),Se(o,u))throw Ce(o,l,i);if(ye({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!M.isServer()&&xe(u,r)&&(c?Ce(o,l,i):s?.promise)?.catch(d).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function Te(e,t){return we(e,ce,t)}var Ee=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},De=[`light`,`dark`],Oe=`(prefers-color-scheme: dark)`,ke=typeof window>`u`,Z=q.createContext(void 0),Ae={setTheme:e=>{},themes:[]},je=()=>q.useContext(Z)??Ae,Me=e=>q.useContext(Z)?q.createElement(q.Fragment,null,e.children):q.createElement(Pe,{...e}),Ne=[`light`,`dark`],Pe=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i=`theme`,themes:a=Ne,defaultTheme:o=n?`system`:`light`,attribute:s=`data-theme`,value:c,children:l,nonce:u,scriptProps:d})=>{let[f,p]=q.useState(()=>Ie(i,o)),[m,h]=q.useState(()=>f===`system`?Q():f),g=c?Object.values(c):a,_=q.useCallback(e=>{let i=e;if(!i)return;e===`system`&&n&&(i=Q());let a=c?c[i]:i,l=t?Le(u):null,d=document.documentElement,f=e=>{e===`class`?(d.classList.remove(...g),a&&d.classList.add(a)):e.startsWith(`data-`)&&(a?d.setAttribute(e,a):d.removeAttribute(e))};if(Array.isArray(s)?s.forEach(f):f(s),r){let e=De.includes(o)?o:null,t=De.includes(i)?i:e;d.style.colorScheme=t}l?.()},[u]),v=q.useCallback(e=>{let t=typeof e==`function`?e(f):e;p(t);try{localStorage.setItem(i,t)}catch{}},[f]),y=q.useCallback(t=>{h(Q(t)),f===`system`&&n&&!e&&_(`system`)},[f,e]);q.useEffect(()=>{let e=window.matchMedia(Oe);return e.addListener(y),y(e),()=>e.removeListener(y)},[y]),q.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?p(e.newValue):v(o))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[v]),q.useEffect(()=>{_(e??f)},[e,f]);let b=q.useMemo(()=>({theme:f,setTheme:v,forcedTheme:e,resolvedTheme:f===`system`?m:f,themes:n?[...a,`system`]:a,systemTheme:n?m:void 0}),[f,v,e,m,n,a]);return q.createElement(Z.Provider,{value:b},q.createElement(Fe,{forcedTheme:e,storageKey:i,attribute:s,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:u,scriptProps:d}),l)},Fe=q.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:l})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return q.createElement(`script`,{...l,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${Ee.toString()})(${u})`}})}),Ie=(e,t)=>{if(ke)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},Le=e=>{let t=document.createElement(`style`);return e&&t.setAttribute(`nonce`,e),t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Q=e=>(e||=window.matchMedia(Oe),e.matches?`dark`:`light`),$=r();function Re(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`flex h-full min-h-0 flex-col`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`section`,{"data-slot":`panel`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function ze(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`shrink-0 flex items-center justify-between px-4 py-3`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`div`,{"data-slot":`panel-header`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Be(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-sm font-medium uppercase font-mono tracking-wider text-muted-foreground`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`h2`,{"data-slot":`panel-title`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Ve(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-xs text-muted-foreground font-mono bg-muted-foreground/5 rounded-md px-2 py-1`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`p`,{"data-slot":`panel-count`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function He(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`subtle-scrollbar min-h-0 flex-1 overflow-y-auto px-4 py-3`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`div`,{"data-slot":`panel-body`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function Ue(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-sm text-muted-foreground/60`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`p`,{"data-slot":`panel-empty`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function We(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let a;t[3]===n?a=t[4]:(a=i(`text-sm text-destructive`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,J.jsx)(`p`,{"data-slot":`panel-error`,className:a,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}export{k as A,b as C,d as D,_ as E,a as M,x as O,f as S,v as T,P as _,We as a,ne as b,Me as c,de as d,X as f,F as g,R as h,Ue as i,o as j,h as k,je as l,z as m,He as n,ze as o,se as p,Ve as r,Be as s,Re as t,Te as u,re as v,y as w,A as x,te as y};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-
|
|
2
|
-
import{r as e}from"./chunk-DECur_0Z.js";import{a as t,c as n,d as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./propagation-api-CQodqriD.js";var f=class{constructor(){}createGauge(e,t){return ue}createHistogram(e,t){return de}createCounter(e,t){return le}createUpDownCounter(e,t){return fe}createObservableGauge(e,t){return me}createObservableCounter(e,t){return pe}createObservableUpDownCounter(e,t){return he}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},p=class{},ee=class extends p{add(e,t){}},te=class extends p{add(e,t){}},ne=class extends p{record(e,t){}},re=class extends p{record(e,t){}},ie=class{addCallback(e){}removeCallback(e){}},ae=class extends ie{},oe=class extends ie{},se=class extends ie{},ce=new f,le=new ee,ue=new ne,de=new re,fe=new te,pe=new ae,me=new oe,he=new se;function ge(){return ce}var m;(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(m||={});var _e={traceId:`00000000000000000000000000000000`,spanId:`0000000000000000`,traceFlags:m.NONE},h=class{constructor(e=_e){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}},ve=t(`OpenTelemetry Context Key SPAN`);function ye(e){return e.getValue(ve)||void 0}function be(){return ye(c.getInstance().active())}function xe(e,t){return e.setValue(ve,t)}function Se(e){return e.deleteValue(ve)}function Ce(e,t){return xe(e,new h(t))}function we(e){return ye(e)?.spanContext()}var Te=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function Ee(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(Te[e.charCodeAt(t)]|0)+(Te[e.charCodeAt(t+1)]|0)+(Te[e.charCodeAt(t+2)]|0)+(Te[e.charCodeAt(t+3)]|0);return n===t}function De(e){return Ee(e,32)&&e!==`00000000000000000000000000000000`}function Oe(e){return Ee(e,16)&&e!==`0000000000000000`}function ke(e){return De(e.traceId)&&Oe(e.spanId)}function Ae(e){return new h(e)}var je=c.getInstance(),Me=class{startSpan(e,t,n=je.active()){if(t?.root)return new h;let r=n&&we(n);return Ne(r)&&ke(r)?new h(r):new h}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??je.active(),c=this.startSpan(e,i,s),l=xe(s,c);return je.with(l,o,void 0,c)}};function Ne(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}var Pe=new Me,Fe=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Pe}},Ie=new class{getTracer(e,t,n){return new Me}},Le=class{getTracer(e,t,n){return this.getDelegateTracer(e,t,n)??new Fe(this,e,t,n)}getDelegate(){return this._delegate??Ie}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){return this._delegate?.getTracer(e,t,n)}},Re;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(Re||={});var ze;(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(ze||={});var g;(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(g||={});var _=l.instance(),Be=new class{getMeter(e,t,n){return ce}},Ve=`metrics`,He=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return a(Ve,e,l.instance())}getMeterProvider(){return n(Ve)||Be}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){d(Ve,l.instance())}}.getInstance(),Ue=`trace`,v=class e{constructor(){this._proxyTracerProvider=new Le,this.wrapSpanContext=Ae,this.isSpanContextValid=ke,this.deleteSpan=Se,this.getSpan=ye,this.getActiveSpan=be,this.getSpanContext=we,this.setSpan=xe,this.setSpanContext=Ce}static getInstance(){return this._instance||=new e,this._instance}setGlobalTracerProvider(e){let t=a(Ue,this._proxyTracerProvider,l.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return n(Ue)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){d(Ue,l.instance()),this._proxyTracerProvider=new Le}}.getInstance(),We=class{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}},Ge=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}};function Ke(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function qe(e){if(e!=null)return()=>e}function Je(e,t,n){return{timeoutMillis:Ke(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function Ye(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}var Xe=class{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}};function Ze(e){return new Xe(e.concurrencyLimit)}var Qe=`http.url`,$e=`http.user_agent`,et=Qe,tt=$e,nt=`error.type`,rt=`exception.message`,it=`exception.stacktrace`,at=`exception.type`,ot=`http.request.method`,st=`http.request.method_original`,ct=`http.response.status_code`,lt=`server.address`,ut=`server.port`,dt=`service.name`,ft=`service.version`,pt=`telemetry.sdk.language`,mt=`webjs`,ht=`telemetry.sdk.name`,gt=`telemetry.sdk.version`,_t=`url.full`,y;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(y||={});function vt(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function yt(){return{handleResponse(e){e==null||!vt(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||_.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var bt=class{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,t,n,r,i){this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=_.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:y.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:y.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:y.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:y.FAILED,error:e.error});return}else e.status===`retryable`?t({code:y.FAILED,error:new Ge(`Export failed with retryable status`)}):t({code:y.FAILED,error:new Ge(`Export failed with unknown error`)})},e=>t({code:y.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}};function xt(e,t){return new bt(e.transport,e.serializer,yt(),e.promiseHandler,t.timeout)}function St(e,t,n){return xt({transport:n,serializer:t,promiseHandler:Ze(e)},{timeout:e.timeoutMillis})}var Ct=10**9;function wt(e){return e[0]*Ct+e[1]}function Tt(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function Et(e){let t=new Uint8Array(e.length/2),n=0;for(let r=0;r<e.length;r+=2){let i=Tt(e.charCodeAt(r)),a=Tt(e.charCodeAt(r+1));t[n++]=i<<4|a}return t}function Dt(e){let t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}function Ot(e){return{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}function kt(e){return Ot(Dt(e))}function At(e){return Dt(e).toString()}var jt=typeof BigInt<`u`?At:wt;function Mt(e){return e}function Nt(e){if(e!==void 0)return Et(e)}var Pt={encodeHrTime:kt,encodeSpanContext:Et,encodeOptionalSpanContext:Nt};function Ft(e){if(e===void 0)return Pt;let t=e.useLongBits??!0,n=e.useHex??!1;return{encodeHrTime:t?kt:jt,encodeSpanContext:n?Mt:Et,encodeOptionalSpanContext:n?Mt:Nt}}function It(e){let t={attributes:b(e.attributes),droppedAttributesCount:0},n=e.schemaUrl;return n&&n!==``&&(t.schemaUrl=n),t}function Lt(e){return{name:e.name,version:e.version}}function b(e){return Object.keys(e).map(t=>Rt(t,e[t]))}function Rt(e,t){return{key:e,value:zt(t)}}function zt(e){let t=typeof e;return t===`string`?{stringValue:e}:t===`number`?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:t===`boolean`?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(zt)}}:t===`object`&&e!=null?{kvlistValue:{values:Object.entries(e).map(([e,t])=>Rt(e,t))}}:{}}function Bt(e,t){let n=e.spanContext(),r=e.status,i=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:i,traceState:n.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:b(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>Ht(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>Vt(e,t)),droppedLinksCount:e.droppedLinksCount}}function Vt(e,t){return{attributes:e.attributes?b(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}function Ht(e,t){return{attributes:e.attributes?b(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Ut(e,t){return{resourceSpans:Gt(e,Ft(t))}}function Wt(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function Gt(e,t){let n=Wt(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>Bt(e,t));o.push({scope:Lt(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=It(e),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}var Kt={serializeRequest:e=>{let t=Ut(e,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))}},qt=5,Jt=1e3,Yt=5e3,Xt=1.5,Zt=.2;function Qt(){return 2*Zt*Math.random()-Zt}var $t=class{_transport;constructor(e){this._transport=e}retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}async send(e,t){let n=Date.now()+t,r=await this._transport.send(e,t),i=qt,a=Jt;for(;r.status===`retryable`&&i>0;){i--;let t=Math.max(Math.min(a,Yt)+Qt(),0);a*=Xt;let o=r.retryInMillis??t,s=n-Date.now();if(o>s)return r;r=await this.retry(e,s,o)}return r}shutdown(){return this._transport.shutdown()}};function en(e){return new $t(e.transport)}function tn(e){return[429,502,503,504].includes(e)}function nn(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let n=new Date(e).getTime()-Date.now();return n>=0?n:0}var rn=class{_parameters;constructor(e){this._parameters=e}send(e,t){return new Promise(n=>{let r=new XMLHttpRequest;r.timeout=t,r.open(`POST`,this._parameters.url);let i=this._parameters.headers();Object.entries(i).forEach(([e,t])=>{r.setRequestHeader(e,t)}),r.ontimeout=e=>{n({status:`failure`,error:Error(`XHR request timed out`)})},r.onreadystatechange=()=>{r.status>=200&&r.status<=299?(_.debug(`XHR success`),n({status:`success`})):r.status&&tn(r.status)?n({status:`retryable`,retryInMillis:nn(r.getResponseHeader(`Retry-After`))}):r.status!==0&&n({status:`failure`,error:Error(`XHR request failed with non-retryable status`)})},r.onabort=()=>{n({status:`failure`,error:Error(`XHR request aborted`)})},r.onerror=()=>{n({status:`failure`,error:Error(`XHR request errored`)})},r.send(e)})}shutdown(){}};function an(e){return new rn(e)}var on=class{_params;constructor(e){this._params=e}send(e){return new Promise(t=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(_.debug(`SendBeacon success`),t({status:`success`})):t({status:`failure`,error:Error(`SendBeacon failed`)})})}shutdown(){}};function sn(e){return new on(e)}var cn=class{_parameters;constructor(e){this._parameters=e}async send(e,t){let n=new AbortController,r=setTimeout(()=>n.abort(),t);try{let t=!!globalThis.location,r=new URL(this._parameters.url),i=await fetch(r.href,{method:`POST`,headers:this._parameters.headers(),body:e,signal:n.signal,keepalive:t,mode:t?globalThis.location?.origin===r.origin?`same-origin`:`cors`:`no-cors`});return i.status>=200&&i.status<=299?(_.debug(`response success`),{status:`success`}):tn(i.status)?{status:`retryable`,retryInMillis:nn(i.headers.get(`Retry-After`))}:{status:`failure`,error:Error(`Fetch request failed with non-retryable status`)}}catch(e){return e?.name===`AbortError`?{status:`failure`,error:Error(`Fetch request timed out`,{cause:e})}:{status:`failure`,error:Error(`Fetch request errored`,{cause:e})}}finally{clearTimeout(r)}}shutdown(){}};function ln(e){return new cn(e)}function un(e,t){return St(e,t,en({transport:an(e)}))}function dn(e,t){return St(e,t,en({transport:ln(e)}))}function fn(e,t){return St(e,t,en({transport:sn({url:e.url,blobType:e.headers()[`Content-Type`]})}))}function pn(e){return()=>{let t={};return Object.entries(e?.()??{}).forEach(([e,n])=>{n===void 0?_.warn(`Header "${e}" has invalid value (${n}) and will be ignored`):t[e]=String(n)}),t}}function mn(e,t,n){let r={...n()},i={};return()=>(t!=null&&Object.assign(i,t()),e!=null&&Object.assign(i,e()),Object.assign(i,r))}function hn(e){if(e!=null)try{let t=globalThis.location?.href;return new URL(e,t).href}catch{throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function gn(t){return async n=>{let{Agent:i}=await r(()=>import(`./__vite-browser-external-BFtnoaxY.js`).then(t=>e(t.default)),__vite__mapDeps([0,1]));return new i(t)}}function _n(e,t,n){return{...Je(e,t,n),headers:mn(pn(e.headers),t.headers,n.headers),url:hn(e.url)??t.url??n.url,agentFactory:e.agentFactory??t.agentFactory??n.agentFactory}}function vn(e,t){return{...Ye(),headers:()=>e,url:`http://localhost:4318/`+t,agentFactory:gn({keepAlive:!0})}}function yn(e,t,n){return _n({url:e.url,timeoutMillis:e.timeoutMillis,headers:qe(e.headers),concurrencyLimit:e.concurrencyLimit},{},vn(n,t))}function bn(e,t,n,r){return xn(e.headers)(yn(e,n,r),t)}function xn(e){return!e&&typeof navigator.sendBeacon==`function`?fn:globalThis.fetch===void 0?un:dn}var Sn=class extends We{constructor(e={}){super(bn(e,Kt,`v1/traces`,{"Content-Type":`application/json`}))}},Cn=class{emit(e){}},wn=new Cn,Tn=new class{getLogger(e,t,n){return new Cn}},En=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):wn}},Dn=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new En(this,e,t,n)}_getDelegate(){return this._delegate??Tn}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}},On=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},x=Symbol.for(`io.opentelemetry.js.api.logs`),S=On;function kn(e,t,n){return r=>r===e?t:n}var An=class e{constructor(){this._proxyLoggerProvider=new Dn}static getInstance(){return this._instance||=new e,this._instance}setGlobalLoggerProvider(e){return S[x]?this.getLoggerProvider():(S[x]=kn(1,e,Tn),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return S[x]?.call(S,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete S[x],this._proxyLoggerProvider=new Dn}}.getInstance();function jn(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function Mn(e){e.forEach(e=>e.disable())}function Nn(e){let t=e.tracerProvider||v.getTracerProvider(),n=e.meterProvider||He.getMeterProvider(),r=e.loggerProvider||An.getLoggerProvider(),i=e.instrumentations?.flat()??[];return jn(i,t,n,r),()=>{Mn(i)}}var C=console.error.bind(console);function w(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var Pn=(e,t,n)=>{if(!e||!e[t]){C(`no original function `+String(t)+` to wrap`);return}if(!n){C(`no wrapper function`),C(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){C(`original object and wrapper must be functions`);return}let i=n(r,t);return w(i,`__original`,r),w(i,`__unwrap`,()=>{e[t]===i&&w(e,t,r)}),w(i,`__wrapped`,!0),w(e,t,i),i},Fn=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{C(`must provide one or more modules to patch`),C(Error().stack);return}if(!(t&&Array.isArray(t))){C(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Pn(e,t,n)})})},In=(e,t)=>{if(!e||!e[t]){C(`no function to unwrap.`),C(Error().stack);return}let n=e[t];if(!n.__unwrap)C(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},Ln=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{C(`must provide one or more modules to patch`),C(Error().stack);return}if(!(t&&Array.isArray(t))){C(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{In(e,t)})})};function T(e){e&&e.logger&&(typeof e.logger==`function`?C=e.logger:C(`new logger isn't a function, not replacing`))}T.wrap=Pn,T.massWrap=Fn,T.unwrap=In,T.massUnwrap=Ln;var Rn=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=_.createComponentLogger({namespace:e}),this._tracer=v.getTracer(e,t),this._meter=He.getMeter(e,t),this._logger=An.getLogger(e,t),this._updateMetricInstruments()}_wrap=Pn;_unwrap=In;_massWrap=Fn;_massUnwrap=Ln;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},zn=class extends Rn{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function E(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}function D(e){return typeof e==`function`&&typeof e.__original==`function`&&typeof e.__unwrap==`function`&&e.__wrapped===!0}var O;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(O||={});function Bn(e,t){let n=O.OLD,r=t?.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r??[])if(t.toLowerCase()===e+`/dup`){n=O.DUPLICATE;break}else t.toLowerCase()===e&&(n=O.STABLE);return n}var Vn=t(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function Hn(e){return e.setValue(Vn,!0)}function Un(e){return e.getValue(Vn)===!0}var Wn=`baggage`,Gn=4096;function Kn(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function qn(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function Jn(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),r=n.indexOf(`=`);if(r<=0)return;let i=n.substring(0,r).trim(),a=n.substring(r+1).trim();if(!i||!a)return;let o,c;try{o=decodeURIComponent(i),c=decodeURIComponent(a)}catch{return}let l;return t!==-1&&t<e.length-1&&(l=s(e.substring(t+1))),{key:o,value:c,metadata:l}}var Yn=class{inject(e,t,n){let r=u.getBaggage(e);if(!r||Un(e))return;let i=Kn(qn(r).filter(e=>e.length<=Gn).slice(0,180));i.length>0&&n.set(t,Wn,i)}extract(e,t,n){let r=n.get(t,Wn),i=Array.isArray(r)?r.join(`,`):r;if(!i)return e;let a={};return i.length===0||(i.split(`,`).forEach(e=>{let t=Jn(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),a[t.key]=e}}),Object.entries(a).length===0)?e:u.setBaggage(e,u.createBaggage(a))}fields(){return[Wn]}};function k(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Xn(n)){_.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Zn(r)){_.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Xn(e){return typeof e==`string`&&e!==``}function Zn(e){return e==null?!0:Array.isArray(e)?Qn(e):$n(typeof e)}function Qn(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if($n(e)){t=e;continue}return!1}return!1}}return!0}function $n(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function er(){return e=>{_.error(tr(e))}}function tr(e){return typeof e==`string`?e:JSON.stringify(nr(e))}function nr(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var rr=er();function A(e){try{rr(e)}catch{}}var ir=`2.7.0`,ar=`process.runtime.name`,or={[ht]:`opentelemetry`,[ar]:`browser`,[pt]:mt,[gt]:ir},j=performance,sr=9,cr=10**6,lr=10**sr;function M(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*cr)]}function ur(e){return mr(M(j.timeOrigin),M(typeof e==`number`?e:j.now()))}function dr(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=lr),[n,r]}function fr(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function pr(e){return fr(e)||typeof e==`number`||e instanceof Date}function mr(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=lr&&(n[1]-=lr,n[0]+=1),n}var hr;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(hr||={});var gr=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(e=>typeof e.fields==`function`?e.fields():[]).reduce((e,t)=>e.concat(t),[])))}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){_.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){_.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}},_r=`[_0-9a-z-*/]`,vr=`[a-z]${_r}{0,255}`,yr=`[a-z0-9]${_r}{0,240}@[a-z]${_r}{0,13}`,br=RegExp(`^(?:${vr}|${yr})$`),xr=/^[ -~]{0,255}[!-~]$/,Sr=/,|=/;function Cr(e){return br.test(e)}function wr(e){return xr.test(e)&&!Sr.test(e)}var Tr=32,Er=512,Dr=`,`,Or=`=`,kr=class e{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,t){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+Or+this.get(t)),e),[]).join(Dr)}_parse(e){e.length>Er||(this._internalState=e.split(Dr).reverse().reduce((e,t)=>{let n=t.trim(),r=n.indexOf(Or);if(r!==-1){let i=n.slice(0,r),a=n.slice(r+1,t.length);Cr(i)&&wr(a)&&e.set(i,a)}return e},new Map),this._internalState.size>Tr&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Tr))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}},N=`traceparent`,Ar=`tracestate`,jr=`00`,Mr=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function Nr(e){let t=Mr.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Pr=class{inject(e,t,n){let r=v.getSpanContext(e);if(!r||Un(e)||!ke(r))return;let i=`${jr}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||m.NONE).toString(16)}`;n.set(t,N,i),r.traceState&&n.set(t,Ar,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,N);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=Nr(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,Ar);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new kr(typeof e==`string`?e:void 0)}return v.setSpanContext(e,a)}fields(){return[N,Ar]}},Fr=`[object Object]`,Ir=`[object Null]`,Lr=`[object Undefined]`,Rr=Function.prototype.toString,zr=Rr.call(Object),Br=Object.getPrototypeOf,Vr=Object.prototype,Hr=Vr.hasOwnProperty,P=Symbol?Symbol.toStringTag:void 0,Ur=Vr.toString;function Wr(e){if(!Gr(e)||Kr(e)!==Fr)return!1;let t=Br(e);if(t===null)return!0;let n=Hr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Rr.call(n)===zr}function Gr(e){return typeof e==`object`&&!!e}function Kr(e){return e==null?e===void 0?Lr:Ir:P&&P in Object(e)?qr(e):Jr(e)}function qr(e){let t=Hr.call(e,P),n=e[P],r=!1;try{e[P]=void 0,r=!0}catch{}let i=Ur.call(e);return r&&(t?e[P]=n:delete e[P]),i}function Jr(e){return Ur.call(e)}var Yr=20;function Xr(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=Qr(t,e.shift(),0,n);return t}function Zr(e){return F(e)?e.slice():e}function Qr(e,t,n=0,r){let i;if(!(n>Yr)){if(n++,L(e)||L(t)||ei(t))i=Zr(t);else if(F(e)){if(i=e.slice(),F(t))for(let e=0,n=t.length;e<n;e++)i.push(Zr(t[e]));else if(I(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=Zr(t[r]))}}}else if(I(e))if(I(t)){if(!ti(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(L(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if($r(e,s,r)||$r(t,s,r))delete i[s];else{if(I(a)&&I(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=Qr(i[s],c,n,r)}}}}else i=t;return i}}function $r(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function F(e){return Array.isArray(e)}function ei(e){return typeof e==`function`}function I(e){return!L(e)&&!F(e)&&!ei(e)&&typeof e==`object`}function L(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function ti(e,t){return!(!Wr(e)||!Wr(t))}var ni=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}},ri=class{_isCalled=!1;_deferred=new ni;_callback;_that;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}},R;function ii(){if(R===void 0)try{let e=globalThis.process.argv0;R=e?`unknown_service:${e}`:`unknown_service`}catch{R=`unknown_service`}return R}var z=e=>typeof e==`object`&&!!e&&typeof e.then==`function`,ai=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=ci(t),r._asyncAttributesPending=t.filter(([e,t])=>z(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(z(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=ci(this._rawAttributes),this._schemaUrl=li(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,z(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&_.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(z(n)){_.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=ui(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function oi(e,t){return ai.FromAttributeList(Object.entries(e),t)}function si(){return oi({[dt]:ii(),[pt]:or[pt],[ht]:or[ht],[gt]:or[gt]})}function ci(e){return e.map(([e,t])=>z(t)?[e,t.catch(t=>{_.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function li(e){if(typeof e==`string`||e===void 0)return e;_.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function ui(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;_.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var di=`exception`,fi=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:g.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=j.now(),this._performanceOffset=t-(this._performanceStartTime+j.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return _.warn(`Invalid attribute key: ${e}`),this;if(!Zn(t))return _.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return _.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&_.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),pr(t)&&(pr(n)||(n=t),t=void 0);let i=k(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&_.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=k(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===g.UNSET||this.status.code===g.OK)return this;let t={code:e.code};return e.code===g.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&_.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){if(this._isSpanEnded()){_.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=dr(this.startTime,this.endTime),this._duration[0]<0&&(_.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&_.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&_.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=j.now())return ur(e+this._performanceOffset);if(typeof e==`number`)return M(e);if(e instanceof Date)return M(e.getTime());if(fr(e))return e;if(this._startTimeProvided)return M(Date.now());let t=j.now()-this._performanceStartTime;return mr(this.startTime,M(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[rt]=e:e&&(e.code?n[at]=e.code.toString():e.name&&(n[at]=e.name),e.message&&(n[rt]=e.message),e.stack&&(n[it]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(di,n,t):_.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);_.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(_.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}},B;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(B||={});var V=class{shouldSample(){return{decision:B.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},H=class{shouldSample(){return{decision:B.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},pi=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(A(Error(`ParentBasedSampler must have a root sampler configured`)),new H),this._remoteParentSampled=e.remoteParentSampled??new H,this._remoteParentNotSampled=e.remoteParentNotSampled??new V,this._localParentSampled=e.localParentSampled??new H,this._localParentNotSampled=e.localParentNotSampled??new V}shouldSample(e,t,n,r,i,a){let o=v.getSpanContext(e);return!o||!ke(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&m.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&m.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},mi=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:De(t)&&this._accumulate(t)<this._upperBound?B.RECORD_AND_SAMPLED:B.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){let r=n*8,i=parseInt(e.slice(r,r+8),16);t=(t^i)>>>0}return t}},U;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(U||={});var hi=1;function gi(){return{sampler:_i(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function _i(){let e=U.ParentBasedAlwaysOn;switch(e){case U.AlwaysOn:return new H;case U.AlwaysOff:return new V;case U.ParentBasedAlwaysOn:return new pi({root:new H});case U.ParentBasedAlwaysOff:return new pi({root:new V});case U.TraceIdRatio:return new mi(vi());case U.ParentBasedTraceIdRatio:return new pi({root:new mi(vi())});default:return _.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${U.ParentBasedAlwaysOn}".`),new pi({root:new H})}}function vi(){return _.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${hi}.`),hi}function yi(e){let t={sampler:_i()},n=gi(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}function bi(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??1/0,Object.assign({},e,{spanLimits:t})}var xi=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,t){this._exporter=e,this._maxExportBatchSize=typeof t?.maxExportBatchSize==`number`?t.maxExportBatchSize:512,this._maxQueueSize=typeof t?.maxQueueSize==`number`?t.maxQueueSize:2048,this._scheduledDelayMillis=typeof t?.scheduledDelayMillis==`number`?t.scheduledDelayMillis:5e3,this._exportTimeoutMillis=typeof t?.exportTimeoutMillis==`number`?t.exportTimeoutMillis:3e4,this._shutdownOnce=new ri(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(_.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&m.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&_.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(_.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);o.with(Hn(o.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,r=>{clearTimeout(n),r.code===hr.SUCCESS?e():t(r.error??Error(`BatchSpanProcessor: span export failed`))}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a??=[],a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{A(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,A(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},Si=class extends xi{_visibilityChangeListener;_pageHideListener;constructor(e,t){super(e,t),this.onInit(t)}onInit(e){e?.disableAutoFlushOnDocumentHide!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{A(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{A(e)})},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}onShutdown(){typeof document<`u`&&(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}},Ci=16,wi=8,Ti=new Uint8Array(Ci),Ei=new Uint8Array(wi),Di=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Oi(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function ki(e){let t=``;for(let n=0;n<e.length;n++)t+=Di[e[n]];return t}var Ai=class{generateTraceId(){return Oi(Ti),ki(Ti)}generateSpanId(){return Oi(Ei),ki(Ei)}},ji=`otel.span.parent.origin`,Mi=`otel.span.sampling_result`,Ni=`otel.sdk.span.live`,Pi=`otel.sdk.span.started`,Fi=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(Pi,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(Ni,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=Li(t);if(this.startedSpans.add(1,{[ji]:Ii(e),[Mi]:n}),t===B.NOT_RECORD)return()=>{};let r={[Mi]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function Ii(e){return e?e.isRemote?`remote`:`local`:`none`}function Li(e){switch(e){case B.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case B.RECORD:return`RECORD_ONLY`;case B.NOT_RECORD:return`DROP`}}var Ri=`2.7.0`,zi=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t,n,r){let i=yi(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Ai,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e,this._tracerMetrics=new Fi(i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,Ri):ge())}startSpan(e,t={},n=o.active()){t.root&&(n=v.deleteSpan(n));let r=v.getSpan(n);if(Un(n))return _.debug(`Instrumentation suppressed, returning Noop Span`),v.wrapSpanContext(_e);let i=r?.spanContext(),a=this._idGenerator.generateSpanId(),s,c,l;!i||!v.isSpanContextValid(i)?c=this._idGenerator.generateTraceId():(c=i.traceId,l=i.traceState,s=i);let u=t.kind??ze.INTERNAL,d=(t.links??[]).map(e=>({context:e.context,attributes:k(e.attributes)})),f=k(t.attributes),p=this._sampler.shouldSample(n,c,e,u,f,d),ee=this._tracerMetrics.startSpan(i,p.decision);l=p.traceState??l;let te=p.decision===Re.RECORD_AND_SAMPLED?m.SAMPLED:m.NONE,ne={traceId:c,spanId:a,traceFlags:te,traceState:l};if(p.decision===Re.NOT_RECORD)return _.debug(`Recording is off, propagating context in a non-recording span`),v.wrapSpanContext(ne);let re=k(Object.assign(f,p.attributes));return new fi({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:ne,name:e,kind:u,links:d,parentSpanContext:s,attributes:re,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:ee})}startActiveSpan(e,t,n,r){let i,a,s;if(arguments.length<2)return;arguments.length===2?s=t:arguments.length===3?(i=t,s=n):(i=t,a=n,s=r);let c=a??o.active(),l=this.startSpan(e,i,c),u=v.setSpan(c,l);return o.with(u,s,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}},Bi=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{A(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},W;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(W||={});var Vi=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){let t=Xr({},gi(),bi(e));this._resource=t.resource??si(),this._config=Object.assign({},t,{resource:this._resource});let n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new Bi(n)}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new zi({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=W.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==W.timeout&&(r=W.resolved,n(r))}).catch(e=>{clearTimeout(i),r=W.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==W.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}},Hi=class{_enabled=!1;_currentContext=i;_bindFunction(e=i,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=i,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=i,this)}with(e,t,n,...r){let a=this._currentContext;this._currentContext=e||i;try{return t.call(n,...r)}finally{this._currentContext=a}}};function Ui(e){if(e!==null){if(e===void 0){let e=new Hi;e.enable(),o.setGlobalContextManager(e);return}e.enable(),o.setGlobalContextManager(e)}}function Wi(e){if(e!==null){if(e===void 0){u.setGlobalPropagator(new gr({propagators:[new Pr,new Yn]}));return}u.setGlobalPropagator(e)}}var Gi=class extends Vi{constructor(e={}){super(e)}register(e={}){v.setGlobalTracerProvider(this),Wi(e.propagator),Ui(e.contextManager)}},G;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(G||={});var Ki=`http.response_content_length`,qi=`http.response_content_length_uncompressed`;function K(e,t){return t in e}function q(e,t,n,r=!0){if(K(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function Ji(e,t,n=!1,r,i){if(r===void 0&&(r=t[G.START_TIME]!==0),n||(q(e,G.FETCH_START,t,r),q(e,G.DOMAIN_LOOKUP_START,t,r),q(e,G.DOMAIN_LOOKUP_END,t,r),q(e,G.CONNECT_START,t,r),q(e,G.SECURE_CONNECTION_START,t,r),q(e,G.CONNECT_END,t,r),q(e,G.REQUEST_START,t,r),q(e,G.RESPONSE_START,t,r),q(e,G.RESPONSE_END,t,r)),!i){let n=t[G.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(Ki,n);let r=t[G.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(qi,r)}}function Yi(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return`/`;let n=Zi(e,t);if(t&&n.indexOf(`@id`)>0)return n;let r=``;return e.parentNode&&(r+=Yi(e.parentNode,t)),r+=n,r}function Xi(e){if(!e.parentNode)return 0;let t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);let n=Array.from(e.parentNode.childNodes);return n=n.filter(n=>{let r=n.localName;return t.indexOf(n.nodeType)>=0&&r===e.localName}),n.length>=1?n.indexOf(e)+1:0}function Zi(e,t){let n=e.nodeType,r=Xi(e),i=``;if(n===Node.ELEMENT_NODE){let n=e.getAttribute(`id`);if(t&&n)return`//*[@id="${n}"]`;i=e.localName}else if(n===Node.TEXT_NODE||n===Node.CDATA_SECTION_NODE)i=`text()`;else if(n===Node.COMMENT_NODE)i=`comment()`;else return``;return i&&r>1?`/${i}[${r}]`:`/${i}`}var Qi;(function(e){e.DOCUMENT_LOAD=`documentLoad`,e.DOCUMENT_FETCH=`documentFetch`,e.RESOURCE_FETCH=`resourceFetch`})(Qi||={});var $i=`0.49.0`,ea=`@opentelemetry/instrumentation-document-load`,ta;(function(e){e.FIRST_PAINT=`firstPaint`,e.FIRST_CONTENTFUL_PAINT=`firstContentfulPaint`})(ta||={});var na=()=>{let e={},t=j.getEntriesByType?.(`navigation`)[0];if(t)Object.values(G).forEach(n=>{if(K(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}});else{let t=j.timing;t&&Object.values(G).forEach(n=>{if(K(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}})}return e},ra={"first-paint":ta.FIRST_PAINT,"first-contentful-paint":ta.FIRST_CONTENTFUL_PAINT},ia=e=>{let t=j.getEntriesByType?.(`paint`);t&&t.forEach(({name:t,startTime:n})=>{K(ra,t)&&e.addEvent(ra[t],n)})},aa=class extends zn{component=`document-load`;version=`1`;moduleName=this.component;constructor(e={}){super(ea,$i,e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){let t=j.getEntriesByType?.(`resource`);t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===N),t=na(),n=e&&e.content||``;o.with(u.extract(i,{traceparent:n}),()=>{let e=this._startSpan(Qi.DOCUMENT_LOAD,G.FETCH_START,t);e&&(o.with(v.setSpan(o.active(),e),()=>{let e=this._startSpan(Qi.DOCUMENT_FETCH,G.FETCH_START,t);e&&(e.setAttribute(et,location.href),o.with(v.setSpan(o.active(),e),()=>{Ji(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,G.RESPONSE_END,t)}))}),e.setAttribute(et,location.href),e.setAttribute(tt,navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(q(e,G.FETCH_START,t),q(e,G.UNLOAD_EVENT_START,t),q(e,G.UNLOAD_EVENT_END,t),q(e,G.DOM_INTERACTIVE,t),q(e,G.DOM_CONTENT_LOADED_EVENT_START,t),q(e,G.DOM_CONTENT_LOADED_EVENT_END,t),q(e,G.DOM_COMPLETE,t),q(e,G.LOAD_EVENT_START,t),q(e,G.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||ia(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,G.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(K(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){let n=this._startSpan(Qi.RESOURCE_FETCH,G.FETCH_START,e,t);n&&(n.setAttribute(et,e.name),Ji(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,G.RESPONSE_END,e))}_startSpan(e,t,n,r){if(K(n,t)&&typeof n[t]==`number`)return this.tracer.startSpan(e,{startTime:n[t]},r?v.setSpan(o.active(),r):void 0)}_waitForPageLoad(){window.document.readyState===`complete`?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener(`load`,this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&E(()=>t(e),e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&E(()=>n(e,t),e=>{e&&this._diag.error(`addCustomAttributesOnResourceSpan`,e)},!0)}enable(){window.removeEventListener(`load`,this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener(`load`,this._onDocumentLoaded)}},oa=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},sa=performance,ca=9,la=10**6,ua=10**ca;function J(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*la)]}function da(){let e=sa.timeOrigin;if(typeof e!=`number`){let t=sa;e=t.timing&&t.timing.fetchStart}return e}function fa(e){return ma(J(da()),J(typeof e==`number`?e:sa.now()))}function Y(e){if(pa(e))return e;if(typeof e==`number`)return e<da()?fa(e):J(e);if(e instanceof Date)return J(e.getTime());throw TypeError(`Invalid input type`)}function X(e){return e[0]*ua+e[1]}function pa(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function ma(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=ua&&(n[1]-=ua,n[0]+=1),n}function ha(e,t){return typeof t==`string`?e===t:!!e.match(t)}function ga(e,t){if(!t)return!1;for(let n of t)if(ha(e,n))return!0;return!1}var Z;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(Z||={});var _a=`http.response_content_length`,va=`http.response_content_length_uncompressed`,ya;function ba(){return ya||=document.createElement(`a`),ya}function xa(e,t){return t in e}function Q(e,t,n,r=!0){if(xa(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function Sa(e,t,n=!1,r,i){if(r===void 0&&(r=t[Z.START_TIME]!==0),n||(Q(e,Z.FETCH_START,t,r),Q(e,Z.DOMAIN_LOOKUP_START,t,r),Q(e,Z.DOMAIN_LOOKUP_END,t,r),Q(e,Z.CONNECT_START,t,r),Q(e,Z.SECURE_CONNECTION_START,t,r),Q(e,Z.CONNECT_END,t,r),Q(e,Z.REQUEST_START,t,r),Q(e,Z.RESPONSE_START,t,r),Q(e,Z.RESPONSE_END,t,r)),!i){let n=t[Z.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(_a,n);let r=t[Z.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(va,r)}}function Ca(e){return e.slice().sort((e,t)=>{let n=e[Z.FETCH_START],r=t[Z.FETCH_START];return n>r?1:n<r?-1:0})}function wa(){return typeof location<`u`?location.origin:void 0}function Ta(e,t,n,r,i=new WeakSet,a){let o=Oa(e);e=o.toString();let s=Da(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=Ca(s);if(o.origin!==wa()&&c.length>1){let e=c[0],t=Ea(c,e[Z.RESPONSE_END],n),r=e[Z.RESPONSE_END];return t[Z.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}else return{mainRequest:s[0]}}function Ea(e,t,n){let r=X(n),i=X(Y(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=X(Y(n[Z.FETCH_START])),c=r-X(Y(n[Z.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function Da(e,t,n,r,i,a){let o=X(t),s=X(n),c=r.filter(t=>{let n=X(Y(t[Z.FETCH_START])),r=X(Y(t[Z.RESPONSE_END]));return t.initiatorType.toLowerCase()===(a||`xmlhttprequest`)&&t.name===e&&n>=o&&r<=s});return c.length>0&&(c=c.filter(e=>!i.has(e))),c}function Oa(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=ba();return t.href=e,t}function ka(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),Oa(e).origin===wa()?!0:n.some(t=>ha(e,t))}var Aa;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(Aa||={});var ja=`http.host`,Ma=`http.method`,Na=`http.request.body.size`,Pa=`http.request_content_length_uncompressed`,Fa=`http.scheme`,Ia=`http.status_code`,La=`http.url`,Ra=`http.user_agent`,za=_.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function Ba(...e){if(e[0]instanceof URL||typeof e[0]==`string`){let t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){let{body:e,length:n}=Va(t.body);return t.body=e,n}else return Promise.resolve(Ua(t.body))}else{let t=e[0];return t?.body?t.clone().text().then(e=>Ga(e)):Promise.resolve()}}function Va(e){if(!e.pipeThrough)return za.warn(`Platform has ReadableStream but not pipeThrough!`),{body:e,length:Promise.resolve(void 0)};let t=0,n,r=new Promise(e=>{n=e}),i=new TransformStream({start(){},async transform(e,n){let r=await e;t+=r.byteLength,n.enqueue(e)},flush(){n(t)}});return{body:e.pipeThrough(i),length:r}}function Ha(e){return typeof Document<`u`&&e instanceof Document}function Ua(e){if(Ha(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Ga(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return Ka(e);if(e instanceof URLSearchParams)return Ga(e.toString());if(e.byteLength!==void 0)return e.byteLength;za.warn(`unknown body type`)}var Wa=new TextEncoder;function Ga(e){return Wa.encode(e).byteLength}function Ka(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function qa(e){let t=Xa(),n=e.toUpperCase();return n in t?n:`_OTHER`}var Ja={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0},Ya;function Xa(){return Ya===void 0&&(Ya=Ja),Ya}var Za={"https:":`443`,"http:":`80`};function Qa(e){let t=Number(e.port||Za[e.protocol]);if(t&&!isNaN(t))return t}var $a=`0.204.0`,eo=300,to=typeof process==`object`&&process.release?.name===`node`,no=class extends zn{component=`fetch`;version=$a;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,$a,e),this._semconvStability=Bn(`http`,e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[Z.FETCH_START]},v.setSpan(o.active(),e)),r=!(this._semconvStability&O.OLD);Sa(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[Z.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=Oa(t.url);if(this._semconvStability&O.OLD&&(e.setAttribute(Ia,t.status),t.statusText!=null&&e.setAttribute(Aa.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(ja,n.host),e.setAttribute(Fa,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(Ra,navigator.userAgent)),this._semconvStability&O.STABLE){e.setAttribute(ct,t.status),e.setAttribute(lt,n.hostname);let r=Qa(n);r&&e.setAttribute(ut,r)}}_addHeaders(e,t){if(!ka(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};u.inject(o.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)u.inject(o.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Headers)u.inject(o.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Map)u.inject(o.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t={};u.inject(o.active(),t),e.headers=Object.assign({},t,e.headers||{})}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(ga(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&O.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[Aa.COMPONENT]=this.moduleName,r[Ma]=i,r[La]=e}if(this._semconvStability&O.STABLE){let i=t.method,a=qa(t.method||`GET`);n||=a,r[ot]=a,a!==i&&(r[st]=i),r[_t]=e}return this.tracer.startSpan(n,{kind:ze.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=Ta(t.spanUrl,t.startTime,n,r,this._usedResources,`fetch`);if(i.mainRequest){let t=i.mainRequest;this._markResourceAsUsed(t);let n=i.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&O.OLD);Sa(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=J(Date.now()),i=fa();this._addFinalSpanAttributes(e,n),this._semconvStability&O.STABLE&&n.status>=400&&(e.setStatus({code:g.ERROR}),e.setAttribute(nt,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},eo)}_patchConstructor(){return e=>{let t=this;return function(...n){let r=this,i=Oa(n[0]instanceof Request?n[0].url:String(n[0])).href,a=n[0]instanceof Request?n[0]:n[1]||{},s=t._createSpan(i,a);if(!s)return e.apply(this,n);let c=t._prepareSpanData(i);t.getConfig().measureRequestSize&&Ba(...n).then(e=>{e&&(t._semconvStability&O.OLD&&s.setAttribute(Pa,e),t._semconvStability&O.STABLE&&s.setAttribute(Na,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function l(e,n){t._applyAttributesAfterFetch(e,a,n),t._endSpan(e,c,{status:n.status||0,statusText:n.message,url:i})}function u(e,n){t._applyAttributesAfterFetch(e,a,n),n.status>=200&&n.status<400?t._endSpan(e,c,n):t._endSpan(e,c,{status:n.status,statusText:n.statusText,url:i})}function d(e,t,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?u(e,n):i()},t=>{l(e,t)})};i()}else u(e,n)}finally{t(n)}}function f(e,t,n){try{l(e,n)}finally{t(n)}}return new Promise((n,c)=>o.with(v.setSpan(o.active(),s),()=>(t._addHeaders(a,i),t._callRequestHook(s,a),t._tasksCount++,e.apply(r,a instanceof Request?[a]:[i,a]).then(d.bind(r,s,n),f.bind(r,s,c)))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&E(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&E(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=fa(),n=[];if(typeof PerformanceObserver!=`function`)return{entries:n,startTime:t,spanUrl:e};let r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{t.initiatorType===`fetch`&&t.name===e&&n.push(t)})});return r.observe({entryTypes:[`resource`]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){if(to){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()`);return}D(fetch)&&(this._unwrap(oa,`fetch`),this._diag.debug(`removing previous patch for constructor`)),this._wrap(oa,`fetch`,this._patchConstructor())}disable(){to||(this._unwrap(oa,`fetch`),this._usedResources=new WeakSet)}},$;(function(e){e.EVENT_TYPE=`event_type`,e.TARGET_ELEMENT=`target_element`,e.TARGET_XPATH=`target_xpath`,e.HTTP_URL=`http.url`})($||={});var ro=`0.49.0`,io=`@opentelemetry/instrumentation-user-interaction`,ao=`OT_ZONE_CONTEXT`,oo=`Navigation:`,so=[`click`];function co(){return!1}var lo=class extends zn{version=ro;moduleName=`user-interaction`;_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(e={}){super(io,ro,e),this._eventNames=new Set(e?.eventNames??so),this._shouldPreventSpanCreation=typeof e?.shouldPreventSpanCreation==`function`?e.shouldPreventSpanCreation:co}init(){}_checkForTimeout(e,t){let n=this._spansData.get(t);n&&(e.source===`setTimeout`?n.hrTimeLastTimeout=ur():e.source!==`Promise.then`&&e.source!==`setTimeout`&&(n.hrTimeLastTimeout=void 0))}_allowEventName(e){return this._eventNames.has(e)}_createSpan(e,t,n){if(!(e instanceof HTMLElement)||!e.getAttribute||e.hasAttribute(`disabled`)||!this._allowEventName(t))return;let r=Yi(e,!0);try{let i=this.tracer.startSpan(t,{attributes:{[$.EVENT_TYPE]:t,[$.TARGET_ELEMENT]:e.tagName,[$.TARGET_XPATH]:r,[$.HTTP_URL]:window.location.href}},n?v.setSpan(o.active(),n):void 0);return this._shouldPreventSpanCreation(t,e,i)===!0?void 0:(this._spansData.set(i,{taskCount:0}),i)}catch(e){this._diag.error(`failed to start create new user interaction span`,e)}}_decrementTask(e){let t=this._spansData.get(e);t&&(t.taskCount--,t.taskCount===0&&this._tryToEndSpan(e,t.hrTimeLastTimeout))}_getCurrentSpan(e){let t=e.get(ao);return t&&v.getSpan(t)}_incrementTask(e){let t=this._spansData.get(e);t&&t.taskCount++}addPatchedListener(e,t,n,r){let i=this._wrappedListeners.get(n);i||(i=new Map,this._wrappedListeners.set(n,i));let a=i.get(t);return a||(a=new Map,i.set(t,a)),a.has(e)?!1:(a.set(e,r),!0)}removePatchedListener(e,t,n){let r=this._wrappedListeners.get(n);if(!r)return;let i=r.get(t);if(!i)return;let a=i.get(e);return a&&(i.delete(e),i.size===0&&(r.delete(t),r.size===0&&this._wrappedListeners.delete(n))),a}_invokeListener(e,t,n){return typeof e==`function`?e.apply(t,n):e.handleEvent(n[0])}_patchAddEventListener(){let e=this;return t=>function(n,r,i){if(!r)return t.call(this,n,r,i);let a=i&&typeof i==`object`&&i.once,s=function(...t){let i,s=t[0],c=s?.target;s&&(i=e._eventsSpanMap.get(s)),a&&e.removePatchedListener(this,n,r);let l=e._createSpan(c,n,i);return l?(s&&e._eventsSpanMap.set(s,l),o.with(v.setSpan(o.active(),l),()=>{let n=e._invokeListener(r,this,t);return l.end(),n})):e._invokeListener(r,this,t)};if(e.addPatchedListener(this,n,r,s))return t.call(this,n,s,i)}}_patchRemoveEventListener(){let e=this;return t=>function(n,r,i){let a=e.removePatchedListener(this,n,r);return a?t.call(this,n,a,i):t.call(this,n,r,i)}}_getPatchableEventTargets(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]}_patchHistoryApi(){this._unpatchHistoryApi(),this._wrap(history,`replaceState`,this._patchHistoryMethod()),this._wrap(history,`pushState`,this._patchHistoryMethod()),this._wrap(history,`back`,this._patchHistoryMethod()),this._wrap(history,`forward`,this._patchHistoryMethod()),this._wrap(history,`go`,this._patchHistoryMethod())}_patchHistoryMethod(){let e=this;return t=>function(...n){let r=`${location.pathname}${location.hash}${location.search}`,i=t.apply(this,n),a=`${location.pathname}${location.hash}${location.search}`;return r!==a&&e._updateInteractionName(a),i}}_unpatchHistoryApi(){D(history.replaceState)&&this._unwrap(history,`replaceState`),D(history.pushState)&&this._unwrap(history,`pushState`),D(history.back)&&this._unwrap(history,`back`),D(history.forward)&&this._unwrap(history,`forward`),D(history.go)&&this._unwrap(history,`go`)}_updateInteractionName(e){let t=v.getSpan(o.active());t&&typeof t.updateName==`function`&&t.updateName(`${oo} ${e}`)}_patchZoneCancelTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&e._decrementTask(i),t.call(this,n)}}_patchZoneScheduleTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&(e._incrementTask(i),e._checkForTimeout(n,i)),t.call(this,n)}}_patchZoneRunTask(){let e=this;return t=>function(n,r,i){let a=(Array.isArray(i)&&i[0]instanceof Event?i[0]:void 0)?.target,s,c=this;if(a){if(s=e._createSpan(a,n.eventName),s)return e._incrementTask(s),c.run(()=>{try{return o.with(v.setSpan(o.active(),s),()=>{let e=Zone.current;return n._zone=e,t.call(e,n,r,i)})}finally{e._decrementTask(s)}})}else s=e._getCurrentSpan(c);try{return t.call(c,n,r,i)}finally{s&&e._shouldCountTask(n,c)&&e._decrementTask(s)}}}_shouldCountTask(e,t){if(e._zone&&(t=e._zone),!t||!e.data||e.data.isPeriodic)return!1;let n=this._getCurrentSpan(t);return!n||!this._spansData.get(n)?!1:e.type===`macroTask`||e.type===`microTask`}_tryToEndSpan(e,t){e&&this._spansData.get(e)&&(e.end(t),this._spansData.delete(e))}enable(){let e=this._getZoneWithPrototype();this._diag.debug(`applying patch to`,this.moduleName,this.version,`zone:`,!!e),e?(D(e.prototype.runTask)&&(this._unwrap(e.prototype,`runTask`),this._diag.debug(`removing previous patch from method runTask`)),D(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,`scheduleTask`),this._diag.debug(`removing previous patch from method scheduleTask`)),D(e.prototype.cancelTask)&&(this._unwrap(e.prototype,`cancelTask`),this._diag.debug(`removing previous patch from method cancelTask`)),this._zonePatched=!0,this._wrap(e.prototype,`runTask`,this._patchZoneRunTask()),this._wrap(e.prototype,`scheduleTask`,this._patchZoneScheduleTask()),this._wrap(e.prototype,`cancelTask`,this._patchZoneCancelTask())):(this._zonePatched=!1,this._getPatchableEventTargets().forEach(e=>{D(e.addEventListener)&&(this._unwrap(e,`addEventListener`),this._diag.debug(`removing previous patch from method addEventListener`)),D(e.removeEventListener)&&(this._unwrap(e,`removeEventListener`),this._diag.debug(`removing previous patch from method removeEventListener`)),this._wrap(e,`addEventListener`,this._patchAddEventListener()),this._wrap(e,`removeEventListener`,this._patchRemoveEventListener())})),this._patchHistoryApi()}disable(){let e=this._getZoneWithPrototype();this._diag.debug(`removing patch from`,this.moduleName,this.version,`zone:`,!!e),e&&this._zonePatched?(D(e.prototype.runTask)&&this._unwrap(e.prototype,`runTask`),D(e.prototype.scheduleTask)&&this._unwrap(e.prototype,`scheduleTask`),D(e.prototype.cancelTask)&&this._unwrap(e.prototype,`cancelTask`)):this._getPatchableEventTargets().forEach(e=>{D(e.addEventListener)&&this._unwrap(e,`addEventListener`),D(e.removeEventListener)&&this._unwrap(e,`removeEventListener`)}),this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}},uo=`deployment.environment.name`,fo=!1;function po(){return{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}?.VITE_OTEL_COLLECTOR_URL??`http://localhost:4318`}function mo(){if(fo)return;fo=!0;let e=null,t=!1;try{let n=po(),r={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1};e=new Gi({resource:oi({[dt]:`open-knowledge-app`,[ft]:r?.VITE_APP_VERSION??`dev`,[uo]:r?.MODE??`dev`}),spanProcessors:[new Si(new Sn({url:`${n}/v1/traces`}),{maxExportBatchSize:50,scheduledDelayMillis:2e3})]}),e.register(),t=!0,Nn({instrumentations:[new aa,new lo({eventNames:[`click`,`submit`]}),new no({propagateTraceHeaderCorsUrls:[/^https?:\/\/localhost(:\d+)?\/api\//,/^https?:\/\/127\.0\.0\.1(:\d+)?\/api\//,/^\/api\//],clearTimingResources:!0})]}),console.info(`[otel] frontend telemetry initialized — OTLP/HTTP → ${n}/v1/traces`)}catch(n){console.warn(`[otel] frontend telemetry init failed — continuing without`,n),t&&e&&e.shutdown().catch(()=>{}),fo=!1}}export{mo as install};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-Dz2JgTKm.js","assets/chunk-DECur_0Z.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./chunk-DECur_0Z.js";import{a as t,c as n,d as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./propagation-api-CQodqriD.js";var f=class{constructor(){}createGauge(e,t){return ue}createHistogram(e,t){return de}createCounter(e,t){return le}createUpDownCounter(e,t){return fe}createObservableGauge(e,t){return me}createObservableCounter(e,t){return pe}createObservableUpDownCounter(e,t){return he}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},p=class{},ee=class extends p{add(e,t){}},te=class extends p{add(e,t){}},ne=class extends p{record(e,t){}},re=class extends p{record(e,t){}},ie=class{addCallback(e){}removeCallback(e){}},ae=class extends ie{},oe=class extends ie{},se=class extends ie{},ce=new f,le=new ee,ue=new ne,de=new re,fe=new te,pe=new ae,me=new oe,he=new se;function ge(){return ce}var m;(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(m||={});var _e={traceId:`00000000000000000000000000000000`,spanId:`0000000000000000`,traceFlags:m.NONE},h=class{constructor(e=_e){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}},ve=t(`OpenTelemetry Context Key SPAN`);function ye(e){return e.getValue(ve)||void 0}function be(){return ye(c.getInstance().active())}function xe(e,t){return e.setValue(ve,t)}function Se(e){return e.deleteValue(ve)}function Ce(e,t){return xe(e,new h(t))}function we(e){return ye(e)?.spanContext()}var Te=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function Ee(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(Te[e.charCodeAt(t)]|0)+(Te[e.charCodeAt(t+1)]|0)+(Te[e.charCodeAt(t+2)]|0)+(Te[e.charCodeAt(t+3)]|0);return n===t}function De(e){return Ee(e,32)&&e!==`00000000000000000000000000000000`}function Oe(e){return Ee(e,16)&&e!==`0000000000000000`}function ke(e){return De(e.traceId)&&Oe(e.spanId)}function Ae(e){return new h(e)}var je=c.getInstance(),Me=class{startSpan(e,t,n=je.active()){if(t?.root)return new h;let r=n&&we(n);return Ne(r)&&ke(r)?new h(r):new h}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??je.active(),c=this.startSpan(e,i,s),l=xe(s,c);return je.with(l,o,void 0,c)}};function Ne(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}var Pe=new Me,Fe=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Pe}},Ie=new class{getTracer(e,t,n){return new Me}},Le=class{getTracer(e,t,n){return this.getDelegateTracer(e,t,n)??new Fe(this,e,t,n)}getDelegate(){return this._delegate??Ie}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){return this._delegate?.getTracer(e,t,n)}},Re;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(Re||={});var ze;(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(ze||={});var g;(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(g||={});var _=l.instance(),Be=new class{getMeter(e,t,n){return ce}},Ve=`metrics`,He=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return a(Ve,e,l.instance())}getMeterProvider(){return n(Ve)||Be}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){d(Ve,l.instance())}}.getInstance(),Ue=`trace`,v=class e{constructor(){this._proxyTracerProvider=new Le,this.wrapSpanContext=Ae,this.isSpanContextValid=ke,this.deleteSpan=Se,this.getSpan=ye,this.getActiveSpan=be,this.getSpanContext=we,this.setSpan=xe,this.setSpanContext=Ce}static getInstance(){return this._instance||=new e,this._instance}setGlobalTracerProvider(e){let t=a(Ue,this._proxyTracerProvider,l.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return n(Ue)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){d(Ue,l.instance()),this._proxyTracerProvider=new Le}}.getInstance(),We=class{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}},Ge=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}};function Ke(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function qe(e){if(e!=null)return()=>e}function Je(e,t,n){return{timeoutMillis:Ke(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function Ye(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}var Xe=class{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}};function Ze(e){return new Xe(e.concurrencyLimit)}var Qe=`http.url`,$e=`http.user_agent`,et=Qe,tt=$e,nt=`error.type`,rt=`exception.message`,it=`exception.stacktrace`,at=`exception.type`,ot=`http.request.method`,st=`http.request.method_original`,ct=`http.response.status_code`,lt=`server.address`,ut=`server.port`,dt=`service.name`,ft=`service.version`,pt=`telemetry.sdk.language`,mt=`webjs`,ht=`telemetry.sdk.name`,gt=`telemetry.sdk.version`,_t=`url.full`,y;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(y||={});function vt(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function yt(){return{handleResponse(e){e==null||!vt(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||_.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var bt=class{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,t,n,r,i){this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=_.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:y.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:y.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:y.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:y.FAILED,error:e.error});return}else e.status===`retryable`?t({code:y.FAILED,error:new Ge(`Export failed with retryable status`)}):t({code:y.FAILED,error:new Ge(`Export failed with unknown error`)})},e=>t({code:y.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}};function xt(e,t){return new bt(e.transport,e.serializer,yt(),e.promiseHandler,t.timeout)}function St(e,t,n){return xt({transport:n,serializer:t,promiseHandler:Ze(e)},{timeout:e.timeoutMillis})}var Ct=10**9;function wt(e){return e[0]*Ct+e[1]}function Tt(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function Et(e){let t=new Uint8Array(e.length/2),n=0;for(let r=0;r<e.length;r+=2){let i=Tt(e.charCodeAt(r)),a=Tt(e.charCodeAt(r+1));t[n++]=i<<4|a}return t}function Dt(e){let t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}function Ot(e){return{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}function kt(e){return Ot(Dt(e))}function At(e){return Dt(e).toString()}var jt=typeof BigInt<`u`?At:wt;function Mt(e){return e}function Nt(e){if(e!==void 0)return Et(e)}var Pt={encodeHrTime:kt,encodeSpanContext:Et,encodeOptionalSpanContext:Nt};function Ft(e){if(e===void 0)return Pt;let t=e.useLongBits??!0,n=e.useHex??!1;return{encodeHrTime:t?kt:jt,encodeSpanContext:n?Mt:Et,encodeOptionalSpanContext:n?Mt:Nt}}function It(e){let t={attributes:b(e.attributes),droppedAttributesCount:0},n=e.schemaUrl;return n&&n!==``&&(t.schemaUrl=n),t}function Lt(e){return{name:e.name,version:e.version}}function b(e){return Object.keys(e).map(t=>Rt(t,e[t]))}function Rt(e,t){return{key:e,value:zt(t)}}function zt(e){let t=typeof e;return t===`string`?{stringValue:e}:t===`number`?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:t===`boolean`?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(zt)}}:t===`object`&&e!=null?{kvlistValue:{values:Object.entries(e).map(([e,t])=>Rt(e,t))}}:{}}function Bt(e,t){let n=e.spanContext(),r=e.status,i=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:i,traceState:n.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:b(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>Ht(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>Vt(e,t)),droppedLinksCount:e.droppedLinksCount}}function Vt(e,t){return{attributes:e.attributes?b(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}function Ht(e,t){return{attributes:e.attributes?b(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Ut(e,t){return{resourceSpans:Gt(e,Ft(t))}}function Wt(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function Gt(e,t){let n=Wt(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>Bt(e,t));o.push({scope:Lt(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=It(e),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}var Kt={serializeRequest:e=>{let t=Ut(e,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))}},qt=5,Jt=1e3,Yt=5e3,Xt=1.5,Zt=.2;function Qt(){return 2*Zt*Math.random()-Zt}var $t=class{_transport;constructor(e){this._transport=e}retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}async send(e,t){let n=Date.now()+t,r=await this._transport.send(e,t),i=qt,a=Jt;for(;r.status===`retryable`&&i>0;){i--;let t=Math.max(Math.min(a,Yt)+Qt(),0);a*=Xt;let o=r.retryInMillis??t,s=n-Date.now();if(o>s)return r;r=await this.retry(e,s,o)}return r}shutdown(){return this._transport.shutdown()}};function en(e){return new $t(e.transport)}function tn(e){return[429,502,503,504].includes(e)}function nn(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let n=new Date(e).getTime()-Date.now();return n>=0?n:0}var rn=class{_parameters;constructor(e){this._parameters=e}send(e,t){return new Promise(n=>{let r=new XMLHttpRequest;r.timeout=t,r.open(`POST`,this._parameters.url);let i=this._parameters.headers();Object.entries(i).forEach(([e,t])=>{r.setRequestHeader(e,t)}),r.ontimeout=e=>{n({status:`failure`,error:Error(`XHR request timed out`)})},r.onreadystatechange=()=>{r.status>=200&&r.status<=299?(_.debug(`XHR success`),n({status:`success`})):r.status&&tn(r.status)?n({status:`retryable`,retryInMillis:nn(r.getResponseHeader(`Retry-After`))}):r.status!==0&&n({status:`failure`,error:Error(`XHR request failed with non-retryable status`)})},r.onabort=()=>{n({status:`failure`,error:Error(`XHR request aborted`)})},r.onerror=()=>{n({status:`failure`,error:Error(`XHR request errored`)})},r.send(e)})}shutdown(){}};function an(e){return new rn(e)}var on=class{_params;constructor(e){this._params=e}send(e){return new Promise(t=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(_.debug(`SendBeacon success`),t({status:`success`})):t({status:`failure`,error:Error(`SendBeacon failed`)})})}shutdown(){}};function sn(e){return new on(e)}var cn=class{_parameters;constructor(e){this._parameters=e}async send(e,t){let n=new AbortController,r=setTimeout(()=>n.abort(),t);try{let t=!!globalThis.location,r=new URL(this._parameters.url),i=await fetch(r.href,{method:`POST`,headers:this._parameters.headers(),body:e,signal:n.signal,keepalive:t,mode:t?globalThis.location?.origin===r.origin?`same-origin`:`cors`:`no-cors`});return i.status>=200&&i.status<=299?(_.debug(`response success`),{status:`success`}):tn(i.status)?{status:`retryable`,retryInMillis:nn(i.headers.get(`Retry-After`))}:{status:`failure`,error:Error(`Fetch request failed with non-retryable status`)}}catch(e){return e?.name===`AbortError`?{status:`failure`,error:Error(`Fetch request timed out`,{cause:e})}:{status:`failure`,error:Error(`Fetch request errored`,{cause:e})}}finally{clearTimeout(r)}}shutdown(){}};function ln(e){return new cn(e)}function un(e,t){return St(e,t,en({transport:an(e)}))}function dn(e,t){return St(e,t,en({transport:ln(e)}))}function fn(e,t){return St(e,t,en({transport:sn({url:e.url,blobType:e.headers()[`Content-Type`]})}))}function pn(e){return()=>{let t={};return Object.entries(e?.()??{}).forEach(([e,n])=>{n===void 0?_.warn(`Header "${e}" has invalid value (${n}) and will be ignored`):t[e]=String(n)}),t}}function mn(e,t,n){let r={...n()},i={};return()=>(t!=null&&Object.assign(i,t()),e!=null&&Object.assign(i,e()),Object.assign(i,r))}function hn(e){if(e!=null)try{let t=globalThis.location?.href;return new URL(e,t).href}catch{throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function gn(t){return async n=>{let{Agent:i}=await r(()=>import(`./__vite-browser-external-Dz2JgTKm.js`).then(t=>e(t.default)),__vite__mapDeps([0,1]));return new i(t)}}function _n(e,t,n){return{...Je(e,t,n),headers:mn(pn(e.headers),t.headers,n.headers),url:hn(e.url)??t.url??n.url,agentFactory:e.agentFactory??t.agentFactory??n.agentFactory}}function vn(e,t){return{...Ye(),headers:()=>e,url:`http://localhost:4318/`+t,agentFactory:gn({keepAlive:!0})}}function yn(e,t,n){return _n({url:e.url,timeoutMillis:e.timeoutMillis,headers:qe(e.headers),concurrencyLimit:e.concurrencyLimit},{},vn(n,t))}function bn(e,t,n,r){return xn(e.headers)(yn(e,n,r),t)}function xn(e){return!e&&typeof navigator.sendBeacon==`function`?fn:globalThis.fetch===void 0?un:dn}var Sn=class extends We{constructor(e={}){super(bn(e,Kt,`v1/traces`,{"Content-Type":`application/json`}))}},Cn=class{emit(e){}},wn=new Cn,Tn=new class{getLogger(e,t,n){return new Cn}},En=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):wn}},Dn=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new En(this,e,t,n)}_getDelegate(){return this._delegate??Tn}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}},On=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},x=Symbol.for(`io.opentelemetry.js.api.logs`),S=On;function kn(e,t,n){return r=>r===e?t:n}var An=class e{constructor(){this._proxyLoggerProvider=new Dn}static getInstance(){return this._instance||=new e,this._instance}setGlobalLoggerProvider(e){return S[x]?this.getLoggerProvider():(S[x]=kn(1,e,Tn),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return S[x]?.call(S,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete S[x],this._proxyLoggerProvider=new Dn}}.getInstance();function jn(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function Mn(e){e.forEach(e=>e.disable())}function Nn(e){let t=e.tracerProvider||v.getTracerProvider(),n=e.meterProvider||He.getMeterProvider(),r=e.loggerProvider||An.getLoggerProvider(),i=e.instrumentations?.flat()??[];return jn(i,t,n,r),()=>{Mn(i)}}var C=console.error.bind(console);function w(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var Pn=(e,t,n)=>{if(!e||!e[t]){C(`no original function `+String(t)+` to wrap`);return}if(!n){C(`no wrapper function`),C(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){C(`original object and wrapper must be functions`);return}let i=n(r,t);return w(i,`__original`,r),w(i,`__unwrap`,()=>{e[t]===i&&w(e,t,r)}),w(i,`__wrapped`,!0),w(e,t,i),i},Fn=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{C(`must provide one or more modules to patch`),C(Error().stack);return}if(!(t&&Array.isArray(t))){C(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Pn(e,t,n)})})},In=(e,t)=>{if(!e||!e[t]){C(`no function to unwrap.`),C(Error().stack);return}let n=e[t];if(!n.__unwrap)C(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},Ln=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{C(`must provide one or more modules to patch`),C(Error().stack);return}if(!(t&&Array.isArray(t))){C(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{In(e,t)})})};function T(e){e&&e.logger&&(typeof e.logger==`function`?C=e.logger:C(`new logger isn't a function, not replacing`))}T.wrap=Pn,T.massWrap=Fn,T.unwrap=In,T.massUnwrap=Ln;var Rn=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=_.createComponentLogger({namespace:e}),this._tracer=v.getTracer(e,t),this._meter=He.getMeter(e,t),this._logger=An.getLogger(e,t),this._updateMetricInstruments()}_wrap=Pn;_unwrap=In;_massWrap=Fn;_massUnwrap=Ln;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},zn=class extends Rn{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function E(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}function D(e){return typeof e==`function`&&typeof e.__original==`function`&&typeof e.__unwrap==`function`&&e.__wrapped===!0}var O;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(O||={});function Bn(e,t){let n=O.OLD,r=t?.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r??[])if(t.toLowerCase()===e+`/dup`){n=O.DUPLICATE;break}else t.toLowerCase()===e&&(n=O.STABLE);return n}var Vn=t(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function Hn(e){return e.setValue(Vn,!0)}function Un(e){return e.getValue(Vn)===!0}var Wn=`baggage`,Gn=4096;function Kn(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function qn(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function Jn(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),r=n.indexOf(`=`);if(r<=0)return;let i=n.substring(0,r).trim(),a=n.substring(r+1).trim();if(!i||!a)return;let o,c;try{o=decodeURIComponent(i),c=decodeURIComponent(a)}catch{return}let l;return t!==-1&&t<e.length-1&&(l=s(e.substring(t+1))),{key:o,value:c,metadata:l}}var Yn=class{inject(e,t,n){let r=u.getBaggage(e);if(!r||Un(e))return;let i=Kn(qn(r).filter(e=>e.length<=Gn).slice(0,180));i.length>0&&n.set(t,Wn,i)}extract(e,t,n){let r=n.get(t,Wn),i=Array.isArray(r)?r.join(`,`):r;if(!i)return e;let a={};return i.length===0||(i.split(`,`).forEach(e=>{let t=Jn(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),a[t.key]=e}}),Object.entries(a).length===0)?e:u.setBaggage(e,u.createBaggage(a))}fields(){return[Wn]}};function k(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Xn(n)){_.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Zn(r)){_.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Xn(e){return typeof e==`string`&&e!==``}function Zn(e){return e==null?!0:Array.isArray(e)?Qn(e):$n(typeof e)}function Qn(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if($n(e)){t=e;continue}return!1}return!1}}return!0}function $n(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function er(){return e=>{_.error(tr(e))}}function tr(e){return typeof e==`string`?e:JSON.stringify(nr(e))}function nr(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var rr=er();function A(e){try{rr(e)}catch{}}var ir=`2.7.0`,ar=`process.runtime.name`,or={[ht]:`opentelemetry`,[ar]:`browser`,[pt]:mt,[gt]:ir},j=performance,sr=9,cr=10**6,lr=10**sr;function M(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*cr)]}function ur(e){return mr(M(j.timeOrigin),M(typeof e==`number`?e:j.now()))}function dr(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=lr),[n,r]}function fr(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function pr(e){return fr(e)||typeof e==`number`||e instanceof Date}function mr(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=lr&&(n[1]-=lr,n[0]+=1),n}var hr;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(hr||={});var gr=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(e=>typeof e.fields==`function`?e.fields():[]).reduce((e,t)=>e.concat(t),[])))}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){_.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){_.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}},_r=`[_0-9a-z-*/]`,vr=`[a-z]${_r}{0,255}`,yr=`[a-z0-9]${_r}{0,240}@[a-z]${_r}{0,13}`,br=RegExp(`^(?:${vr}|${yr})$`),xr=/^[ -~]{0,255}[!-~]$/,Sr=/,|=/;function Cr(e){return br.test(e)}function wr(e){return xr.test(e)&&!Sr.test(e)}var Tr=32,Er=512,Dr=`,`,Or=`=`,kr=class e{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,t){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+Or+this.get(t)),e),[]).join(Dr)}_parse(e){e.length>Er||(this._internalState=e.split(Dr).reverse().reduce((e,t)=>{let n=t.trim(),r=n.indexOf(Or);if(r!==-1){let i=n.slice(0,r),a=n.slice(r+1,t.length);Cr(i)&&wr(a)&&e.set(i,a)}return e},new Map),this._internalState.size>Tr&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Tr))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}},N=`traceparent`,Ar=`tracestate`,jr=`00`,Mr=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function Nr(e){let t=Mr.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Pr=class{inject(e,t,n){let r=v.getSpanContext(e);if(!r||Un(e)||!ke(r))return;let i=`${jr}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||m.NONE).toString(16)}`;n.set(t,N,i),r.traceState&&n.set(t,Ar,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,N);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=Nr(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,Ar);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new kr(typeof e==`string`?e:void 0)}return v.setSpanContext(e,a)}fields(){return[N,Ar]}},Fr=`[object Object]`,Ir=`[object Null]`,Lr=`[object Undefined]`,Rr=Function.prototype.toString,zr=Rr.call(Object),Br=Object.getPrototypeOf,Vr=Object.prototype,Hr=Vr.hasOwnProperty,P=Symbol?Symbol.toStringTag:void 0,Ur=Vr.toString;function Wr(e){if(!Gr(e)||Kr(e)!==Fr)return!1;let t=Br(e);if(t===null)return!0;let n=Hr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Rr.call(n)===zr}function Gr(e){return typeof e==`object`&&!!e}function Kr(e){return e==null?e===void 0?Lr:Ir:P&&P in Object(e)?qr(e):Jr(e)}function qr(e){let t=Hr.call(e,P),n=e[P],r=!1;try{e[P]=void 0,r=!0}catch{}let i=Ur.call(e);return r&&(t?e[P]=n:delete e[P]),i}function Jr(e){return Ur.call(e)}var Yr=20;function Xr(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=Qr(t,e.shift(),0,n);return t}function Zr(e){return F(e)?e.slice():e}function Qr(e,t,n=0,r){let i;if(!(n>Yr)){if(n++,L(e)||L(t)||ei(t))i=Zr(t);else if(F(e)){if(i=e.slice(),F(t))for(let e=0,n=t.length;e<n;e++)i.push(Zr(t[e]));else if(I(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=Zr(t[r]))}}}else if(I(e))if(I(t)){if(!ti(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(L(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if($r(e,s,r)||$r(t,s,r))delete i[s];else{if(I(a)&&I(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=Qr(i[s],c,n,r)}}}}else i=t;return i}}function $r(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function F(e){return Array.isArray(e)}function ei(e){return typeof e==`function`}function I(e){return!L(e)&&!F(e)&&!ei(e)&&typeof e==`object`}function L(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function ti(e,t){return!(!Wr(e)||!Wr(t))}var ni=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}},ri=class{_isCalled=!1;_deferred=new ni;_callback;_that;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}},R;function ii(){if(R===void 0)try{let e=globalThis.process.argv0;R=e?`unknown_service:${e}`:`unknown_service`}catch{R=`unknown_service`}return R}var z=e=>typeof e==`object`&&!!e&&typeof e.then==`function`,ai=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=ci(t),r._asyncAttributesPending=t.filter(([e,t])=>z(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(z(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=ci(this._rawAttributes),this._schemaUrl=li(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,z(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&_.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(z(n)){_.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=ui(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function oi(e,t){return ai.FromAttributeList(Object.entries(e),t)}function si(){return oi({[dt]:ii(),[pt]:or[pt],[ht]:or[ht],[gt]:or[gt]})}function ci(e){return e.map(([e,t])=>z(t)?[e,t.catch(t=>{_.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function li(e){if(typeof e==`string`||e===void 0)return e;_.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function ui(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;_.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var di=`exception`,fi=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:g.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=j.now(),this._performanceOffset=t-(this._performanceStartTime+j.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return _.warn(`Invalid attribute key: ${e}`),this;if(!Zn(t))return _.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return _.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&_.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),pr(t)&&(pr(n)||(n=t),t=void 0);let i=k(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&_.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=k(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===g.UNSET||this.status.code===g.OK)return this;let t={code:e.code};return e.code===g.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&_.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){if(this._isSpanEnded()){_.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=dr(this.startTime,this.endTime),this._duration[0]<0&&(_.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&_.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&_.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=j.now())return ur(e+this._performanceOffset);if(typeof e==`number`)return M(e);if(e instanceof Date)return M(e.getTime());if(fr(e))return e;if(this._startTimeProvided)return M(Date.now());let t=j.now()-this._performanceStartTime;return mr(this.startTime,M(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[rt]=e:e&&(e.code?n[at]=e.code.toString():e.name&&(n[at]=e.name),e.message&&(n[rt]=e.message),e.stack&&(n[it]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(di,n,t):_.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);_.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(_.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}},B;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(B||={});var V=class{shouldSample(){return{decision:B.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},H=class{shouldSample(){return{decision:B.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},pi=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(A(Error(`ParentBasedSampler must have a root sampler configured`)),new H),this._remoteParentSampled=e.remoteParentSampled??new H,this._remoteParentNotSampled=e.remoteParentNotSampled??new V,this._localParentSampled=e.localParentSampled??new H,this._localParentNotSampled=e.localParentNotSampled??new V}shouldSample(e,t,n,r,i,a){let o=v.getSpanContext(e);return!o||!ke(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&m.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&m.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},mi=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:De(t)&&this._accumulate(t)<this._upperBound?B.RECORD_AND_SAMPLED:B.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){let r=n*8,i=parseInt(e.slice(r,r+8),16);t=(t^i)>>>0}return t}},U;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(U||={});var hi=1;function gi(){return{sampler:_i(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function _i(){let e=U.ParentBasedAlwaysOn;switch(e){case U.AlwaysOn:return new H;case U.AlwaysOff:return new V;case U.ParentBasedAlwaysOn:return new pi({root:new H});case U.ParentBasedAlwaysOff:return new pi({root:new V});case U.TraceIdRatio:return new mi(vi());case U.ParentBasedTraceIdRatio:return new pi({root:new mi(vi())});default:return _.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${U.ParentBasedAlwaysOn}".`),new pi({root:new H})}}function vi(){return _.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${hi}.`),hi}function yi(e){let t={sampler:_i()},n=gi(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}function bi(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??1/0,Object.assign({},e,{spanLimits:t})}var xi=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,t){this._exporter=e,this._maxExportBatchSize=typeof t?.maxExportBatchSize==`number`?t.maxExportBatchSize:512,this._maxQueueSize=typeof t?.maxQueueSize==`number`?t.maxQueueSize:2048,this._scheduledDelayMillis=typeof t?.scheduledDelayMillis==`number`?t.scheduledDelayMillis:5e3,this._exportTimeoutMillis=typeof t?.exportTimeoutMillis==`number`?t.exportTimeoutMillis:3e4,this._shutdownOnce=new ri(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(_.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&m.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&_.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(_.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);o.with(Hn(o.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,r=>{clearTimeout(n),r.code===hr.SUCCESS?e():t(r.error??Error(`BatchSpanProcessor: span export failed`))}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a??=[],a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{A(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,A(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},Si=class extends xi{_visibilityChangeListener;_pageHideListener;constructor(e,t){super(e,t),this.onInit(t)}onInit(e){e?.disableAutoFlushOnDocumentHide!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{A(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{A(e)})},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}onShutdown(){typeof document<`u`&&(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}},Ci=16,wi=8,Ti=new Uint8Array(Ci),Ei=new Uint8Array(wi),Di=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Oi(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function ki(e){let t=``;for(let n=0;n<e.length;n++)t+=Di[e[n]];return t}var Ai=class{generateTraceId(){return Oi(Ti),ki(Ti)}generateSpanId(){return Oi(Ei),ki(Ei)}},ji=`otel.span.parent.origin`,Mi=`otel.span.sampling_result`,Ni=`otel.sdk.span.live`,Pi=`otel.sdk.span.started`,Fi=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(Pi,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(Ni,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=Li(t);if(this.startedSpans.add(1,{[ji]:Ii(e),[Mi]:n}),t===B.NOT_RECORD)return()=>{};let r={[Mi]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function Ii(e){return e?e.isRemote?`remote`:`local`:`none`}function Li(e){switch(e){case B.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case B.RECORD:return`RECORD_ONLY`;case B.NOT_RECORD:return`DROP`}}var Ri=`2.7.0`,zi=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t,n,r){let i=yi(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Ai,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e,this._tracerMetrics=new Fi(i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,Ri):ge())}startSpan(e,t={},n=o.active()){t.root&&(n=v.deleteSpan(n));let r=v.getSpan(n);if(Un(n))return _.debug(`Instrumentation suppressed, returning Noop Span`),v.wrapSpanContext(_e);let i=r?.spanContext(),a=this._idGenerator.generateSpanId(),s,c,l;!i||!v.isSpanContextValid(i)?c=this._idGenerator.generateTraceId():(c=i.traceId,l=i.traceState,s=i);let u=t.kind??ze.INTERNAL,d=(t.links??[]).map(e=>({context:e.context,attributes:k(e.attributes)})),f=k(t.attributes),p=this._sampler.shouldSample(n,c,e,u,f,d),ee=this._tracerMetrics.startSpan(i,p.decision);l=p.traceState??l;let te=p.decision===Re.RECORD_AND_SAMPLED?m.SAMPLED:m.NONE,ne={traceId:c,spanId:a,traceFlags:te,traceState:l};if(p.decision===Re.NOT_RECORD)return _.debug(`Recording is off, propagating context in a non-recording span`),v.wrapSpanContext(ne);let re=k(Object.assign(f,p.attributes));return new fi({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:ne,name:e,kind:u,links:d,parentSpanContext:s,attributes:re,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:ee})}startActiveSpan(e,t,n,r){let i,a,s;if(arguments.length<2)return;arguments.length===2?s=t:arguments.length===3?(i=t,s=n):(i=t,a=n,s=r);let c=a??o.active(),l=this.startSpan(e,i,c),u=v.setSpan(c,l);return o.with(u,s,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}},Bi=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{A(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},W;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(W||={});var Vi=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){let t=Xr({},gi(),bi(e));this._resource=t.resource??si(),this._config=Object.assign({},t,{resource:this._resource});let n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new Bi(n)}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new zi({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=W.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==W.timeout&&(r=W.resolved,n(r))}).catch(e=>{clearTimeout(i),r=W.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==W.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}},Hi=class{_enabled=!1;_currentContext=i;_bindFunction(e=i,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=i,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=i,this)}with(e,t,n,...r){let a=this._currentContext;this._currentContext=e||i;try{return t.call(n,...r)}finally{this._currentContext=a}}};function Ui(e){if(e!==null){if(e===void 0){let e=new Hi;e.enable(),o.setGlobalContextManager(e);return}e.enable(),o.setGlobalContextManager(e)}}function Wi(e){if(e!==null){if(e===void 0){u.setGlobalPropagator(new gr({propagators:[new Pr,new Yn]}));return}u.setGlobalPropagator(e)}}var Gi=class extends Vi{constructor(e={}){super(e)}register(e={}){v.setGlobalTracerProvider(this),Wi(e.propagator),Ui(e.contextManager)}},G;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(G||={});var Ki=`http.response_content_length`,qi=`http.response_content_length_uncompressed`;function K(e,t){return t in e}function q(e,t,n,r=!0){if(K(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function Ji(e,t,n=!1,r,i){if(r===void 0&&(r=t[G.START_TIME]!==0),n||(q(e,G.FETCH_START,t,r),q(e,G.DOMAIN_LOOKUP_START,t,r),q(e,G.DOMAIN_LOOKUP_END,t,r),q(e,G.CONNECT_START,t,r),q(e,G.SECURE_CONNECTION_START,t,r),q(e,G.CONNECT_END,t,r),q(e,G.REQUEST_START,t,r),q(e,G.RESPONSE_START,t,r),q(e,G.RESPONSE_END,t,r)),!i){let n=t[G.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(Ki,n);let r=t[G.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(qi,r)}}function Yi(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return`/`;let n=Zi(e,t);if(t&&n.indexOf(`@id`)>0)return n;let r=``;return e.parentNode&&(r+=Yi(e.parentNode,t)),r+=n,r}function Xi(e){if(!e.parentNode)return 0;let t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);let n=Array.from(e.parentNode.childNodes);return n=n.filter(n=>{let r=n.localName;return t.indexOf(n.nodeType)>=0&&r===e.localName}),n.length>=1?n.indexOf(e)+1:0}function Zi(e,t){let n=e.nodeType,r=Xi(e),i=``;if(n===Node.ELEMENT_NODE){let n=e.getAttribute(`id`);if(t&&n)return`//*[@id="${n}"]`;i=e.localName}else if(n===Node.TEXT_NODE||n===Node.CDATA_SECTION_NODE)i=`text()`;else if(n===Node.COMMENT_NODE)i=`comment()`;else return``;return i&&r>1?`/${i}[${r}]`:`/${i}`}var Qi;(function(e){e.DOCUMENT_LOAD=`documentLoad`,e.DOCUMENT_FETCH=`documentFetch`,e.RESOURCE_FETCH=`resourceFetch`})(Qi||={});var $i=`0.49.0`,ea=`@opentelemetry/instrumentation-document-load`,ta;(function(e){e.FIRST_PAINT=`firstPaint`,e.FIRST_CONTENTFUL_PAINT=`firstContentfulPaint`})(ta||={});var na=()=>{let e={},t=j.getEntriesByType?.(`navigation`)[0];if(t)Object.values(G).forEach(n=>{if(K(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}});else{let t=j.timing;t&&Object.values(G).forEach(n=>{if(K(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}})}return e},ra={"first-paint":ta.FIRST_PAINT,"first-contentful-paint":ta.FIRST_CONTENTFUL_PAINT},ia=e=>{let t=j.getEntriesByType?.(`paint`);t&&t.forEach(({name:t,startTime:n})=>{K(ra,t)&&e.addEvent(ra[t],n)})},aa=class extends zn{component=`document-load`;version=`1`;moduleName=this.component;constructor(e={}){super(ea,$i,e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){let t=j.getEntriesByType?.(`resource`);t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===N),t=na(),n=e&&e.content||``;o.with(u.extract(i,{traceparent:n}),()=>{let e=this._startSpan(Qi.DOCUMENT_LOAD,G.FETCH_START,t);e&&(o.with(v.setSpan(o.active(),e),()=>{let e=this._startSpan(Qi.DOCUMENT_FETCH,G.FETCH_START,t);e&&(e.setAttribute(et,location.href),o.with(v.setSpan(o.active(),e),()=>{Ji(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,G.RESPONSE_END,t)}))}),e.setAttribute(et,location.href),e.setAttribute(tt,navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(q(e,G.FETCH_START,t),q(e,G.UNLOAD_EVENT_START,t),q(e,G.UNLOAD_EVENT_END,t),q(e,G.DOM_INTERACTIVE,t),q(e,G.DOM_CONTENT_LOADED_EVENT_START,t),q(e,G.DOM_CONTENT_LOADED_EVENT_END,t),q(e,G.DOM_COMPLETE,t),q(e,G.LOAD_EVENT_START,t),q(e,G.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||ia(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,G.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(K(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){let n=this._startSpan(Qi.RESOURCE_FETCH,G.FETCH_START,e,t);n&&(n.setAttribute(et,e.name),Ji(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,G.RESPONSE_END,e))}_startSpan(e,t,n,r){if(K(n,t)&&typeof n[t]==`number`)return this.tracer.startSpan(e,{startTime:n[t]},r?v.setSpan(o.active(),r):void 0)}_waitForPageLoad(){window.document.readyState===`complete`?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener(`load`,this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&E(()=>t(e),e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&E(()=>n(e,t),e=>{e&&this._diag.error(`addCustomAttributesOnResourceSpan`,e)},!0)}enable(){window.removeEventListener(`load`,this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener(`load`,this._onDocumentLoaded)}},oa=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},sa=performance,ca=9,la=10**6,ua=10**ca;function J(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*la)]}function da(){let e=sa.timeOrigin;if(typeof e!=`number`){let t=sa;e=t.timing&&t.timing.fetchStart}return e}function fa(e){return ma(J(da()),J(typeof e==`number`?e:sa.now()))}function Y(e){if(pa(e))return e;if(typeof e==`number`)return e<da()?fa(e):J(e);if(e instanceof Date)return J(e.getTime());throw TypeError(`Invalid input type`)}function X(e){return e[0]*ua+e[1]}function pa(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function ma(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=ua&&(n[1]-=ua,n[0]+=1),n}function ha(e,t){return typeof t==`string`?e===t:!!e.match(t)}function ga(e,t){if(!t)return!1;for(let n of t)if(ha(e,n))return!0;return!1}var Z;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(Z||={});var _a=`http.response_content_length`,va=`http.response_content_length_uncompressed`,ya;function ba(){return ya||=document.createElement(`a`),ya}function xa(e,t){return t in e}function Q(e,t,n,r=!0){if(xa(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function Sa(e,t,n=!1,r,i){if(r===void 0&&(r=t[Z.START_TIME]!==0),n||(Q(e,Z.FETCH_START,t,r),Q(e,Z.DOMAIN_LOOKUP_START,t,r),Q(e,Z.DOMAIN_LOOKUP_END,t,r),Q(e,Z.CONNECT_START,t,r),Q(e,Z.SECURE_CONNECTION_START,t,r),Q(e,Z.CONNECT_END,t,r),Q(e,Z.REQUEST_START,t,r),Q(e,Z.RESPONSE_START,t,r),Q(e,Z.RESPONSE_END,t,r)),!i){let n=t[Z.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(_a,n);let r=t[Z.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(va,r)}}function Ca(e){return e.slice().sort((e,t)=>{let n=e[Z.FETCH_START],r=t[Z.FETCH_START];return n>r?1:n<r?-1:0})}function wa(){return typeof location<`u`?location.origin:void 0}function Ta(e,t,n,r,i=new WeakSet,a){let o=Oa(e);e=o.toString();let s=Da(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=Ca(s);if(o.origin!==wa()&&c.length>1){let e=c[0],t=Ea(c,e[Z.RESPONSE_END],n),r=e[Z.RESPONSE_END];return t[Z.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}else return{mainRequest:s[0]}}function Ea(e,t,n){let r=X(n),i=X(Y(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=X(Y(n[Z.FETCH_START])),c=r-X(Y(n[Z.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function Da(e,t,n,r,i,a){let o=X(t),s=X(n),c=r.filter(t=>{let n=X(Y(t[Z.FETCH_START])),r=X(Y(t[Z.RESPONSE_END]));return t.initiatorType.toLowerCase()===(a||`xmlhttprequest`)&&t.name===e&&n>=o&&r<=s});return c.length>0&&(c=c.filter(e=>!i.has(e))),c}function Oa(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=ba();return t.href=e,t}function ka(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),Oa(e).origin===wa()?!0:n.some(t=>ha(e,t))}var Aa;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(Aa||={});var ja=`http.host`,Ma=`http.method`,Na=`http.request.body.size`,Pa=`http.request_content_length_uncompressed`,Fa=`http.scheme`,Ia=`http.status_code`,La=`http.url`,Ra=`http.user_agent`,za=_.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function Ba(...e){if(e[0]instanceof URL||typeof e[0]==`string`){let t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){let{body:e,length:n}=Va(t.body);return t.body=e,n}else return Promise.resolve(Ua(t.body))}else{let t=e[0];return t?.body?t.clone().text().then(e=>Ga(e)):Promise.resolve()}}function Va(e){if(!e.pipeThrough)return za.warn(`Platform has ReadableStream but not pipeThrough!`),{body:e,length:Promise.resolve(void 0)};let t=0,n,r=new Promise(e=>{n=e}),i=new TransformStream({start(){},async transform(e,n){let r=await e;t+=r.byteLength,n.enqueue(e)},flush(){n(t)}});return{body:e.pipeThrough(i),length:r}}function Ha(e){return typeof Document<`u`&&e instanceof Document}function Ua(e){if(Ha(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Ga(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return Ka(e);if(e instanceof URLSearchParams)return Ga(e.toString());if(e.byteLength!==void 0)return e.byteLength;za.warn(`unknown body type`)}var Wa=new TextEncoder;function Ga(e){return Wa.encode(e).byteLength}function Ka(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function qa(e){let t=Xa(),n=e.toUpperCase();return n in t?n:`_OTHER`}var Ja={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0},Ya;function Xa(){return Ya===void 0&&(Ya=Ja),Ya}var Za={"https:":`443`,"http:":`80`};function Qa(e){let t=Number(e.port||Za[e.protocol]);if(t&&!isNaN(t))return t}var $a=`0.204.0`,eo=300,to=typeof process==`object`&&process.release?.name===`node`,no=class extends zn{component=`fetch`;version=$a;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,$a,e),this._semconvStability=Bn(`http`,e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[Z.FETCH_START]},v.setSpan(o.active(),e)),r=!(this._semconvStability&O.OLD);Sa(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[Z.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=Oa(t.url);if(this._semconvStability&O.OLD&&(e.setAttribute(Ia,t.status),t.statusText!=null&&e.setAttribute(Aa.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(ja,n.host),e.setAttribute(Fa,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(Ra,navigator.userAgent)),this._semconvStability&O.STABLE){e.setAttribute(ct,t.status),e.setAttribute(lt,n.hostname);let r=Qa(n);r&&e.setAttribute(ut,r)}}_addHeaders(e,t){if(!ka(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};u.inject(o.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)u.inject(o.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Headers)u.inject(o.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Map)u.inject(o.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t={};u.inject(o.active(),t),e.headers=Object.assign({},t,e.headers||{})}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(ga(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&O.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[Aa.COMPONENT]=this.moduleName,r[Ma]=i,r[La]=e}if(this._semconvStability&O.STABLE){let i=t.method,a=qa(t.method||`GET`);n||=a,r[ot]=a,a!==i&&(r[st]=i),r[_t]=e}return this.tracer.startSpan(n,{kind:ze.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=Ta(t.spanUrl,t.startTime,n,r,this._usedResources,`fetch`);if(i.mainRequest){let t=i.mainRequest;this._markResourceAsUsed(t);let n=i.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&O.OLD);Sa(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=J(Date.now()),i=fa();this._addFinalSpanAttributes(e,n),this._semconvStability&O.STABLE&&n.status>=400&&(e.setStatus({code:g.ERROR}),e.setAttribute(nt,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},eo)}_patchConstructor(){return e=>{let t=this;return function(...n){let r=this,i=Oa(n[0]instanceof Request?n[0].url:String(n[0])).href,a=n[0]instanceof Request?n[0]:n[1]||{},s=t._createSpan(i,a);if(!s)return e.apply(this,n);let c=t._prepareSpanData(i);t.getConfig().measureRequestSize&&Ba(...n).then(e=>{e&&(t._semconvStability&O.OLD&&s.setAttribute(Pa,e),t._semconvStability&O.STABLE&&s.setAttribute(Na,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function l(e,n){t._applyAttributesAfterFetch(e,a,n),t._endSpan(e,c,{status:n.status||0,statusText:n.message,url:i})}function u(e,n){t._applyAttributesAfterFetch(e,a,n),n.status>=200&&n.status<400?t._endSpan(e,c,n):t._endSpan(e,c,{status:n.status,statusText:n.statusText,url:i})}function d(e,t,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?u(e,n):i()},t=>{l(e,t)})};i()}else u(e,n)}finally{t(n)}}function f(e,t,n){try{l(e,n)}finally{t(n)}}return new Promise((n,c)=>o.with(v.setSpan(o.active(),s),()=>(t._addHeaders(a,i),t._callRequestHook(s,a),t._tasksCount++,e.apply(r,a instanceof Request?[a]:[i,a]).then(d.bind(r,s,n),f.bind(r,s,c)))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&E(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&E(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=fa(),n=[];if(typeof PerformanceObserver!=`function`)return{entries:n,startTime:t,spanUrl:e};let r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{t.initiatorType===`fetch`&&t.name===e&&n.push(t)})});return r.observe({entryTypes:[`resource`]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){if(to){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()`);return}D(fetch)&&(this._unwrap(oa,`fetch`),this._diag.debug(`removing previous patch for constructor`)),this._wrap(oa,`fetch`,this._patchConstructor())}disable(){to||(this._unwrap(oa,`fetch`),this._usedResources=new WeakSet)}},$;(function(e){e.EVENT_TYPE=`event_type`,e.TARGET_ELEMENT=`target_element`,e.TARGET_XPATH=`target_xpath`,e.HTTP_URL=`http.url`})($||={});var ro=`0.49.0`,io=`@opentelemetry/instrumentation-user-interaction`,ao=`OT_ZONE_CONTEXT`,oo=`Navigation:`,so=[`click`];function co(){return!1}var lo=class extends zn{version=ro;moduleName=`user-interaction`;_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(e={}){super(io,ro,e),this._eventNames=new Set(e?.eventNames??so),this._shouldPreventSpanCreation=typeof e?.shouldPreventSpanCreation==`function`?e.shouldPreventSpanCreation:co}init(){}_checkForTimeout(e,t){let n=this._spansData.get(t);n&&(e.source===`setTimeout`?n.hrTimeLastTimeout=ur():e.source!==`Promise.then`&&e.source!==`setTimeout`&&(n.hrTimeLastTimeout=void 0))}_allowEventName(e){return this._eventNames.has(e)}_createSpan(e,t,n){if(!(e instanceof HTMLElement)||!e.getAttribute||e.hasAttribute(`disabled`)||!this._allowEventName(t))return;let r=Yi(e,!0);try{let i=this.tracer.startSpan(t,{attributes:{[$.EVENT_TYPE]:t,[$.TARGET_ELEMENT]:e.tagName,[$.TARGET_XPATH]:r,[$.HTTP_URL]:window.location.href}},n?v.setSpan(o.active(),n):void 0);return this._shouldPreventSpanCreation(t,e,i)===!0?void 0:(this._spansData.set(i,{taskCount:0}),i)}catch(e){this._diag.error(`failed to start create new user interaction span`,e)}}_decrementTask(e){let t=this._spansData.get(e);t&&(t.taskCount--,t.taskCount===0&&this._tryToEndSpan(e,t.hrTimeLastTimeout))}_getCurrentSpan(e){let t=e.get(ao);return t&&v.getSpan(t)}_incrementTask(e){let t=this._spansData.get(e);t&&t.taskCount++}addPatchedListener(e,t,n,r){let i=this._wrappedListeners.get(n);i||(i=new Map,this._wrappedListeners.set(n,i));let a=i.get(t);return a||(a=new Map,i.set(t,a)),a.has(e)?!1:(a.set(e,r),!0)}removePatchedListener(e,t,n){let r=this._wrappedListeners.get(n);if(!r)return;let i=r.get(t);if(!i)return;let a=i.get(e);return a&&(i.delete(e),i.size===0&&(r.delete(t),r.size===0&&this._wrappedListeners.delete(n))),a}_invokeListener(e,t,n){return typeof e==`function`?e.apply(t,n):e.handleEvent(n[0])}_patchAddEventListener(){let e=this;return t=>function(n,r,i){if(!r)return t.call(this,n,r,i);let a=i&&typeof i==`object`&&i.once,s=function(...t){let i,s=t[0],c=s?.target;s&&(i=e._eventsSpanMap.get(s)),a&&e.removePatchedListener(this,n,r);let l=e._createSpan(c,n,i);return l?(s&&e._eventsSpanMap.set(s,l),o.with(v.setSpan(o.active(),l),()=>{let n=e._invokeListener(r,this,t);return l.end(),n})):e._invokeListener(r,this,t)};if(e.addPatchedListener(this,n,r,s))return t.call(this,n,s,i)}}_patchRemoveEventListener(){let e=this;return t=>function(n,r,i){let a=e.removePatchedListener(this,n,r);return a?t.call(this,n,a,i):t.call(this,n,r,i)}}_getPatchableEventTargets(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]}_patchHistoryApi(){this._unpatchHistoryApi(),this._wrap(history,`replaceState`,this._patchHistoryMethod()),this._wrap(history,`pushState`,this._patchHistoryMethod()),this._wrap(history,`back`,this._patchHistoryMethod()),this._wrap(history,`forward`,this._patchHistoryMethod()),this._wrap(history,`go`,this._patchHistoryMethod())}_patchHistoryMethod(){let e=this;return t=>function(...n){let r=`${location.pathname}${location.hash}${location.search}`,i=t.apply(this,n),a=`${location.pathname}${location.hash}${location.search}`;return r!==a&&e._updateInteractionName(a),i}}_unpatchHistoryApi(){D(history.replaceState)&&this._unwrap(history,`replaceState`),D(history.pushState)&&this._unwrap(history,`pushState`),D(history.back)&&this._unwrap(history,`back`),D(history.forward)&&this._unwrap(history,`forward`),D(history.go)&&this._unwrap(history,`go`)}_updateInteractionName(e){let t=v.getSpan(o.active());t&&typeof t.updateName==`function`&&t.updateName(`${oo} ${e}`)}_patchZoneCancelTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&e._decrementTask(i),t.call(this,n)}}_patchZoneScheduleTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&(e._incrementTask(i),e._checkForTimeout(n,i)),t.call(this,n)}}_patchZoneRunTask(){let e=this;return t=>function(n,r,i){let a=(Array.isArray(i)&&i[0]instanceof Event?i[0]:void 0)?.target,s,c=this;if(a){if(s=e._createSpan(a,n.eventName),s)return e._incrementTask(s),c.run(()=>{try{return o.with(v.setSpan(o.active(),s),()=>{let e=Zone.current;return n._zone=e,t.call(e,n,r,i)})}finally{e._decrementTask(s)}})}else s=e._getCurrentSpan(c);try{return t.call(c,n,r,i)}finally{s&&e._shouldCountTask(n,c)&&e._decrementTask(s)}}}_shouldCountTask(e,t){if(e._zone&&(t=e._zone),!t||!e.data||e.data.isPeriodic)return!1;let n=this._getCurrentSpan(t);return!n||!this._spansData.get(n)?!1:e.type===`macroTask`||e.type===`microTask`}_tryToEndSpan(e,t){e&&this._spansData.get(e)&&(e.end(t),this._spansData.delete(e))}enable(){let e=this._getZoneWithPrototype();this._diag.debug(`applying patch to`,this.moduleName,this.version,`zone:`,!!e),e?(D(e.prototype.runTask)&&(this._unwrap(e.prototype,`runTask`),this._diag.debug(`removing previous patch from method runTask`)),D(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,`scheduleTask`),this._diag.debug(`removing previous patch from method scheduleTask`)),D(e.prototype.cancelTask)&&(this._unwrap(e.prototype,`cancelTask`),this._diag.debug(`removing previous patch from method cancelTask`)),this._zonePatched=!0,this._wrap(e.prototype,`runTask`,this._patchZoneRunTask()),this._wrap(e.prototype,`scheduleTask`,this._patchZoneScheduleTask()),this._wrap(e.prototype,`cancelTask`,this._patchZoneCancelTask())):(this._zonePatched=!1,this._getPatchableEventTargets().forEach(e=>{D(e.addEventListener)&&(this._unwrap(e,`addEventListener`),this._diag.debug(`removing previous patch from method addEventListener`)),D(e.removeEventListener)&&(this._unwrap(e,`removeEventListener`),this._diag.debug(`removing previous patch from method removeEventListener`)),this._wrap(e,`addEventListener`,this._patchAddEventListener()),this._wrap(e,`removeEventListener`,this._patchRemoveEventListener())})),this._patchHistoryApi()}disable(){let e=this._getZoneWithPrototype();this._diag.debug(`removing patch from`,this.moduleName,this.version,`zone:`,!!e),e&&this._zonePatched?(D(e.prototype.runTask)&&this._unwrap(e.prototype,`runTask`),D(e.prototype.scheduleTask)&&this._unwrap(e.prototype,`scheduleTask`),D(e.prototype.cancelTask)&&this._unwrap(e.prototype,`cancelTask`)):this._getPatchableEventTargets().forEach(e=>{D(e.addEventListener)&&this._unwrap(e,`addEventListener`),D(e.removeEventListener)&&this._unwrap(e,`removeEventListener`)}),this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}},uo=`deployment.environment.name`,fo=!1;function po(){return{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}?.VITE_OTEL_COLLECTOR_URL??`http://localhost:4318`}function mo(){if(fo)return;fo=!0;let e=null,t=!1;try{let n=po(),r={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1};e=new Gi({resource:oi({[dt]:`open-knowledge-app`,[ft]:r?.VITE_APP_VERSION??`dev`,[uo]:r?.MODE??`dev`}),spanProcessors:[new Si(new Sn({url:`${n}/v1/traces`}),{maxExportBatchSize:50,scheduledDelayMillis:2e3})]}),e.register(),t=!0,Nn({instrumentations:[new aa,new lo({eventNames:[`click`,`submit`]}),new no({propagateTraceHeaderCorsUrls:[/^https?:\/\/localhost(:\d+)?\/api\//,/^https?:\/\/127\.0\.0\.1(:\d+)?\/api\//,/^\/api\//],clearTimingResources:!0})]}),console.info(`[otel] frontend telemetry initialized — OTLP/HTTP → ${n}/v1/traces`)}catch(n){console.warn(`[otel] frontend telemetry init failed — continuing without`,n),t&&e&&e.shutdown().catch(()=>{}),fo=!1}}export{mo as install};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./compiler-runtime-Y11fyRVL.js";import{a as i,b as a,c as o,f as s,g as c,n as l,o as u,p as d,u as f,x as p,y as m}from"./button-B1XQHQcX.js";import{q as h}from"./PageListContext-DdGQSVEJ.js";var g=p(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),_=p(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),v=p(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),y=p(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),b=e(t(),1),x=n();function S(e){let t=e+`CollectionProvider`,[n,r]=s(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=b.useRef(null),a=b.useRef(new Map).current;return(0,x.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let l=e+`CollectionSlot`,u=c(l),d=b.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,x.jsx)(u,{ref:m(t,a(l,n).collectionRef),children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,h=c(f),g=b.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=b.useRef(null),s=m(t,o),c=a(f,n);return b.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,x.jsx)(h,{[p]:``,ref:s,children:r})});g.displayName=f;function _(t){let n=a(e+`CollectionConsumer`,t);return b.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:d,ItemSlot:g},_,r]}var C=b.createContext(void 0);function w(e){let t=b.useContext(C);return e||t||`ltr`}var T=`rovingFocusGroup.onEntryFocus`,ee={bubbles:!1,cancelable:!0},E=`RovingFocusGroup`,[D,O,k]=S(E),[A,j]=s(E,[k]),[te,M]=A(E),N=b.forwardRef((e,t)=>(0,x.jsx)(D.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,x.jsx)(D.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,x.jsx)(P,{...e,ref:t})})}));N.displayName=E;var P=b.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:p,preventScrollOnEntryFocus:h=!1,...g}=e,_=b.useRef(null),v=m(t,_),y=w(s),[S,C]=o({prop:c,defaultProp:l??null,onChange:u,caller:E}),[D,k]=b.useState(!1),A=i(p),j=O(n),M=b.useRef(!1),[N,P]=b.useState(0);return b.useEffect(()=>{let e=_.current;if(e)return e.addEventListener(T,A),()=>e.removeEventListener(T,A)},[A]),(0,x.jsx)(te,{scope:n,orientation:r,dir:y,loop:a,currentTabStopId:S,onItemFocus:b.useCallback(e=>C(e),[C]),onItemShiftTab:b.useCallback(()=>k(!0),[]),onFocusableItemAdd:b.useCallback(()=>P(e=>e+1),[]),onFocusableItemRemove:b.useCallback(()=>P(e=>e-1),[]),children:(0,x.jsx)(d.div,{tabIndex:D||N===0?-1:0,"data-orientation":r,...g,ref:v,style:{outline:`none`,...e.style},onMouseDown:f(e.onMouseDown,()=>{M.current=!0}),onFocus:f(e.onFocus,e=>{let t=!M.current;if(e.target===e.currentTarget&&t&&!D){let t=new CustomEvent(T,ee);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=j().filter(e=>e.focusable);L([e.find(e=>e.active),e.find(e=>e.id===S),...e].filter(Boolean).map(e=>e.ref.current),h)}}M.current=!1}),onBlur:f(e.onBlur,()=>k(!1))})})}),F=`RovingFocusGroupItem`,I=b.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=u(),l=a||c,p=M(F,n),m=p.currentTabStopId===l,h=O(n),{onFocusableItemAdd:g,onFocusableItemRemove:_,currentTabStopId:v}=p;return b.useEffect(()=>{if(r)return g(),()=>_()},[r,g,_]),(0,x.jsx)(D.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,x.jsx)(d.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...s,ref:t,onMouseDown:f(e.onMouseDown,e=>{r?p.onItemFocus(l):e.preventDefault()}),onFocus:f(e.onFocus,()=>p.onItemFocus(l)),onKeyDown:f(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){p.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ie(e,p.orientation,p.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=p.loop?ae(n,r+1):n.slice(r+1)}setTimeout(()=>L(n))}}),children:typeof o==`function`?o({isCurrentTabStop:m,hasTabStop:v!=null}):o})})});I.displayName=F;var ne={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function re(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function ie(e,t,n){let r=re(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return ne[r]}function L(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ae(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var R=N,z=I,B=`Toggle`,V=b.forwardRef((e,t)=>{let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[s,c]=o({prop:n,onChange:i,defaultProp:r??!1,caller:B});return(0,x.jsx)(d.button,{type:`button`,"aria-pressed":s,"data-state":s?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:f(e.onClick,()=>{e.disabled||c(!s)})})});V.displayName=B;var H=`ToggleGroup`,[U,oe]=s(H,[j]),W=j(),G=b.forwardRef((e,t)=>{let{type:n,...r}=e;if(n===`single`)return(0,x.jsx)(se,{...r,ref:t});if(n===`multiple`)return(0,x.jsx)(ce,{...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${H}\``)});G.displayName=H;var[K,q]=U(H),se=b.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[s,c]=o({prop:n,defaultProp:r??``,onChange:i,caller:H});return(0,x.jsx)(K,{scope:e.__scopeToggleGroup,type:`single`,value:b.useMemo(()=>s?[s]:[],[s]),onItemActivate:c,onItemDeactivate:b.useCallback(()=>c(``),[c]),children:(0,x.jsx)(J,{...a,ref:t})})}),ce=b.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[s,c]=o({prop:n,defaultProp:r??[],onChange:i,caller:H}),l=b.useCallback(e=>c((t=[])=>[...t,e]),[c]),u=b.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return(0,x.jsx)(K,{scope:e.__scopeToggleGroup,type:`multiple`,value:s,onItemActivate:l,onItemDeactivate:u,children:(0,x.jsx)(J,{...a,ref:t})})});G.displayName=H;var[le,ue]=U(H),J=b.forwardRef((e,t)=>{let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=W(n),u=w(o),f={role:`group`,dir:u,...c};return(0,x.jsx)(le,{scope:n,rovingFocus:i,disabled:r,children:i?(0,x.jsx)(R,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,x.jsx)(d.div,{...f,ref:t})}):(0,x.jsx)(d.div,{...f,ref:t})})}),Y=`ToggleGroupItem`,X=b.forwardRef((e,t)=>{let n=q(Y,e.__scopeToggleGroup),r=ue(Y,e.__scopeToggleGroup),i=W(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=b.useRef(null);return r.rovingFocus?(0,x.jsx)(z,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,x.jsx)(Z,{...s,ref:t})}):(0,x.jsx)(Z,{...s,ref:t})});X.displayName=Y;var Z=b.forwardRef((e,t)=>{let{__scopeToggleGroup:n,value:r,...i}=e,a=q(Y,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0};return(0,x.jsx)(V,{...a.type===`single`?o:void 0,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})}),de=G,fe=X;function pe(e){switch(e.kind){case`doc`:return`doc`;case`folder`:case`folder-index`:return`folder`;case`missing`:return`missing`}}function me(e,t){let n=h(e,t);return{resolvedTarget:n,hashDocName:n.target,displayState:pe(n)}}var Q=r(),he=a(`group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted`,segmented:`text-muted-foreground hover:bg-muted-foreground/10 data-[state=on]:bg-background data-[state=on]:shadow-sm data-[state=on]:text-foreground dark:data-[state=on]:bg-muted`},size:{default:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}}),$=b.createContext({size:`default`,variant:`default`,spacing:0,orientation:`horizontal`});function ge(e){let t=(0,Q.c)(29),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({className:r,variant:c,size:a,spacing:o,orientation:s,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let u=o===void 0?0:o,d=s===void 0?`horizontal`:s,f;t[8]===u?f=t[9]:(f={"--gap":u},t[8]=u,t[9]=f);let p=f,m;t[10]===r?m=t[11]:(m=l(`group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch`,r),t[10]=r,t[11]=m);let h;t[12]!==d||t[13]!==a||t[14]!==u||t[15]!==c?(h={variant:c,size:a,spacing:u,orientation:d},t[12]=d,t[13]=a,t[14]=u,t[15]=c,t[16]=h):h=t[16];let g;t[17]!==n||t[18]!==h?(g=(0,x.jsx)($.Provider,{value:h,children:n}),t[17]=n,t[18]=h,t[19]=g):g=t[19];let _;return t[20]!==d||t[21]!==i||t[22]!==a||t[23]!==u||t[24]!==p||t[25]!==m||t[26]!==g||t[27]!==c?(_=(0,x.jsx)(de,{"data-slot":`toggle-group`,"data-variant":c,"data-size":a,"data-spacing":u,"data-orientation":d,style:p,className:m,...i,children:g}),t[20]=d,t[21]=i,t[22]=a,t[23]=u,t[24]=p,t[25]=m,t[26]=g,t[27]=c,t[28]=_):_=t[28],_}function _e(e){let t=(0,Q.c)(19),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,variant:a,size:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?`default`:a,c=o===void 0?`default`:o,u=b.use($),d=u.variant||s,f=u.size||c,p=u.spacing,m;t[6]!==r||t[7]!==u.size||t[8]!==u.variant||t[9]!==c||t[10]!==s?(m=l(`shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t text-muted-foreground data-[state=on]:text-foreground`,he({variant:u.variant||s,size:u.size||c}),r),t[6]=r,t[7]=u.size,t[8]=u.variant,t[9]=c,t[10]=s,t[11]=m):m=t[11];let h;return t[12]!==n||t[13]!==u.spacing||t[14]!==i||t[15]!==d||t[16]!==f||t[17]!==m?(h=(0,x.jsx)(fe,{"data-slot":`toggle-group-item`,"data-variant":d,"data-size":f,"data-spacing":p,className:m,...i,children:n}),t[12]=n,t[13]=u.spacing,t[14]=i,t[15]=d,t[16]=f,t[17]=m,t[18]=h):h=t[18],h}export{R as a,S as c,_ as d,g as f,z as i,y as l,_e as n,j as o,me as r,w as s,ge as t,v as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./compiler-runtime-Y11fyRVL.js";import{S as i,_ as a,a as o,c as s,f as c,i as l,l as u,n as d,o as f,p,r as m,s as h,u as g,y as _}from"./button-B1XQHQcX.js";import{Bt as v,Ft as y,It as b,Nt as x,Pt as S,Rt as C,Vt as w,jt as T,zt as E}from"./PageListContext-DdGQSVEJ.js";var ee=e(i(),1),D=e(t(),1),O=n(),k=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),A=`VisuallyHidden`,j=D.forwardRef((e,t)=>(0,O.jsx)(p.span,{...e,ref:t,style:{...k,...e.style}}));j.displayName=A;var M=j;function N(e){let[t,n]=D.useState(void 0);return u(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var P=typeof document<`u`?D.useLayoutEffect:function(){};function F(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!F(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!F(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function I(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function L(e,t){let n=I(e);return Math.round(t*n)/n}function R(e){let t=D.useRef(e);return P(()=>{t.current=e}),t}function z(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=D.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=D.useState(r);F(f,r)||p(r);let[m,h]=D.useState(null),[g,_]=D.useState(null),v=D.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=D.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),b=a||m,x=o||g,C=D.useRef(null),w=D.useRef(null),T=D.useRef(u),E=c!=null,O=R(c),k=R(i),A=R(l),j=D.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};k.current&&(e.platform=k.current),S(C.current,w.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!F(T.current,t)&&(T.current=t,ee.flushSync(()=>{d(t)}))})},[f,t,n,k,A]);P(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=D.useRef(!1);P(()=>(M.current=!0,()=>{M.current=!1}),[]),P(()=>{if(b&&(C.current=b),x&&(w.current=x),b&&x){if(O.current)return O.current(b,x,j);j()}},[b,x,j,O,E]);let N=D.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:y}),[v,y]),z=D.useMemo(()=>({reference:b,floating:x}),[b,x]),B=D.useMemo(()=>{let e={position:n,left:0,top:0};if(!z.floating)return e;let t=L(z.floating,u.x),r=L(z.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...I(z.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,z.floating,u.x,u.y]);return D.useMemo(()=>({...u,update:j,refs:N,elements:z,floatingStyles:B}),[u,j,N,z,B])}var B=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:T({element:r.current,padding:i}).fn(n):r?T({element:r,padding:i}).fn(n):{}}}},te=(e,t)=>{let n=E(e);return{name:n.name,fn:n.fn,options:[e,t]}},ne=(e,t)=>{let n=v(e);return{name:n.name,fn:n.fn,options:[e,t]}},re=(e,t)=>({fn:C(e).fn,options:[e,t]}),ie=(e,t)=>{let n=y(e);return{name:n.name,fn:n.fn,options:[e,t]}},ae=(e,t)=>{let n=w(e);return{name:n.name,fn:n.fn,options:[e,t]}},oe=(e,t)=>{let n=b(e);return{name:n.name,fn:n.fn,options:[e,t]}},se=(e,t)=>{let n=B(e);return{name:n.name,fn:n.fn,options:[e,t]}},V=`Arrow`,H=D.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,O.jsx)(p.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,O.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});H.displayName=V;var U=H,W=`Popper`,[G,K]=c(W),[ce,le]=G(W),q=e=>{let{__scopePopper:t,children:n}=e,[r,i]=D.useState(null);return(0,O.jsx)(ce,{scope:t,anchor:r,onAnchorChange:i,children:n})};q.displayName=W;var ue=`PopperAnchor`,de=D.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=le(ue,n),o=D.useRef(null),s=_(t,o),c=D.useRef(null);return D.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,O.jsx)(p.div,{...i,ref:s})});de.displayName=ue;var fe=`PopperContent`,[pe,me]=G(fe),he=D.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:m=`partial`,hideWhenDetached:h=!1,updatePositionStrategy:g=`optimized`,onPlaced:v,...y}=e,b=le(fe,n),[S,C]=D.useState(null),w=_(t,e=>C(e)),[T,E]=D.useState(null),ee=N(T),k=ee?.width??0,A=ee?.height??0,j=r+(a===`center`?``:`-`+a),M=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},P=Array.isArray(d)?d:[d],F=P.length>0,I={padding:M,boundary:P.filter(ye),altBoundary:F},{refs:L,floatingStyles:R,placement:B,isPositioned:V,middlewareData:H}=z({strategy:`fixed`,placement:j,whileElementsMounted:(...e)=>x(...e,{animationFrame:g===`always`}),elements:{reference:b.anchor},middleware:[te({mainAxis:i+A,alignmentAxis:s}),l&&ne({mainAxis:!0,crossAxis:!1,limiter:m===`partial`?re():void 0,...I}),l&&ie({...I}),ae({...I,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),T&&se({element:T,padding:c}),be({arrowWidth:k,arrowHeight:A}),h&&oe({strategy:`referenceHidden`,...I})]}),[U,W]=xe(B),G=o(v);u(()=>{V&&G?.()},[V,G]);let K=H.arrow?.x,ce=H.arrow?.y,q=H.arrow?.centerOffset!==0,[ue,de]=D.useState();return u(()=>{S&&de(window.getComputedStyle(S).zIndex)},[S]),(0,O.jsx)(`div`,{ref:L.setFloating,"data-radix-popper-content-wrapper":``,style:{...R,transform:V?R.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ue,"--radix-popper-transform-origin":[H.transformOrigin?.x,H.transformOrigin?.y].join(` `),...H.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,O.jsx)(pe,{scope:n,placedSide:U,onArrowChange:E,arrowX:K,arrowY:ce,shouldHideArrow:q,children:(0,O.jsx)(p.div,{"data-side":U,"data-align":W,...y,ref:w,style:{...y.style,animation:V?void 0:`none`}})})})});he.displayName=fe;var ge=`PopperArrow`,_e={top:`bottom`,right:`left`,bottom:`top`,left:`right`},ve=D.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=me(ge,n),a=_e[i.placedSide];return(0,O.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,O.jsx)(U,{...r,ref:t,style:{...r.style,display:`block`}})})});ve.displayName=ge;function ye(e){return e!==null}var be=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=xe(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function xe(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Se=q,Ce=de,we=he,Te=ve,[J,Ee]=c(`Tooltip`,[K]),Y=K(),De=`TooltipProvider`,Oe=700,ke=`tooltip.open`,[Ae,je]=J(De),Me=e=>{let{__scopeTooltip:t,delayDuration:n=Oe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=D.useRef(!0),s=D.useRef(!1),c=D.useRef(0);return D.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,O.jsx)(Ae,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:D.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:D.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:D.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};Me.displayName=De;var X=`Tooltip`,[Ne,Z]=J(X),Pe=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:c}=e,l=je(X,e.__scopeTooltip),u=Y(t),[d,p]=D.useState(null),m=f(),h=D.useRef(0),g=o??l.disableHoverableContent,_=c??l.delayDuration,v=D.useRef(!1),[y,b]=s({prop:r,defaultProp:i??!1,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(ke))):l.onClose(),a?.(e)},caller:X}),x=D.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=D.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=D.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=D.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);return D.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]),(0,O.jsx)(Se,{...u,children:(0,O.jsx)(Ne,{scope:t,contentId:m,open:y,stateAttribute:x,trigger:d,onTriggerChange:p,onTriggerEnter:D.useCallback(()=>{l.isOpenDelayedRef.current?w():S()},[l.isOpenDelayedRef,w,S]),onTriggerLeave:D.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})};Pe.displayName=X;var Fe=`TooltipTrigger`,Ie=D.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Z(Fe,n),a=je(Fe,n),o=Y(n),s=_(t,D.useRef(null),i.onTriggerChange),c=D.useRef(!1),l=D.useRef(!1),u=D.useCallback(()=>c.current=!1,[]);return D.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,O.jsx)(Ce,{asChild:!0,...o,children:(0,O.jsx)(p.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:g(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:g(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:g(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:g(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:g(e.onBlur,i.onClose),onClick:g(e.onClick,i.onClose)})})});Ie.displayName=Fe;var Le=`TooltipPortal`,[Re,ze]=J(Le,{forceMount:void 0}),Be=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Z(Le,t);return(0,O.jsx)(Re,{scope:t,forceMount:n,children:(0,O.jsx)(h,{present:n||a.open,children:(0,O.jsx)(m,{asChild:!0,container:i,children:r})})})};Be.displayName=Le;var Q=`TooltipContent`,Ve=D.forwardRef((e,t)=>{let n=ze(Q,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Z(Q,e.__scopeTooltip);return(0,O.jsx)(h,{present:r||o.open,children:o.disableHoverableContent?(0,O.jsx)(Ke,{side:i,...a,ref:t}):(0,O.jsx)(He,{side:i,...a,ref:t})})}),He=D.forwardRef((e,t)=>{let n=Z(Q,e.__scopeTooltip),r=je(Q,e.__scopeTooltip),i=D.useRef(null),a=_(t,i),[o,s]=D.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=D.useCallback(()=>{s(null),d(!1)},[d]),p=D.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Xe(r,Ye(r,n.getBoundingClientRect())),a=Ze(t.getBoundingClientRect());s($e([...i,...a])),d(!0)},[d]);return D.useEffect(()=>()=>f(),[f]),D.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),D.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Qe(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,O.jsx)(Ke,{...e,ref:a})}),[Ue,We]=J(X,{isInside:!1}),Ge=a(`TooltipContent`),Ke=D.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=Z(Q,n),u=Y(n),{onClose:d}=c;return D.useEffect(()=>(document.addEventListener(ke,d),()=>document.removeEventListener(ke,d)),[d]),D.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,d]),(0,O.jsx)(l,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,O.jsxs)(we,{"data-state":c.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,O.jsx)(Ge,{children:r}),(0,O.jsx)(Ue,{scope:n,isInside:!0,children:(0,O.jsx)(M,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});Ve.displayName=Q;var qe=`TooltipArrow`,Je=D.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Y(n);return We(qe,n).isInside?null:(0,O.jsx)(Te,{...i,...r,ref:t})});Je.displayName=qe;function Ye(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Xe(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Ze(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Qe(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function $e(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),et(t)}function et(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var tt=Me,nt=Pe,rt=Ie,it=Be,at=Ve,ot=Je,$=r();function st(e){let t=(0,$.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delayDuration:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?0:r,a;return t[3]!==i||t[4]!==n?(a=(0,O.jsx)(tt,{"data-slot":`tooltip-provider`,delayDuration:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function ct(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,O.jsx)(nt,{"data-slot":`tooltip`,...n}),t[2]=n,t[3]=r),r}function lt(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,O.jsx)(rt,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function ut(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,sideOffset:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?0:a,s;t[5]===r?s=t[6]:(s=d(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,O.jsx)(ot,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,O.jsx)(it,{children:(0,O.jsxs)(at,{"data-slot":`tooltip-content`,sideOffset:o,className:s,...i,children:[n,c]})}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}export{Ce as a,Se as c,lt as i,K as l,ut as n,Te as o,st as r,we as s,ct as t,N as u};
|
package/dist/public/index.html
CHANGED
|
@@ -20,19 +20,24 @@
|
|
|
20
20
|
nothing for the formatter to reindent.
|
|
21
21
|
-->
|
|
22
22
|
<script>(() => { let mode = 'wysiwyg'; try { const raw = localStorage.getItem('ok-editor-mode-v1'); if (raw === 'wysiwyg' || raw === 'source') mode = raw; } catch {} window.__OK_EDITOR_MODE__ = mode; })();</script>
|
|
23
|
-
<script type="module" crossorigin src="/assets/index-
|
|
23
|
+
<script type="module" crossorigin src="/assets/index-D_7iKKj-.js"></script>
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/assets/chunk-DECur_0Z.js">
|
|
25
25
|
<link rel="modulepreload" crossorigin href="/assets/propagation-api-CQodqriD.js">
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/assets/w3c-keyname-
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
30
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
31
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
32
|
-
<link rel="modulepreload" crossorigin href="/assets/dialog-
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
34
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
35
|
-
<link rel="
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/assets/w3c-keyname-CSlwavrd.js">
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-CgLbXgrr.js">
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-D2wwoXzm.js">
|
|
29
|
+
<link rel="modulepreload" crossorigin href="/assets/compiler-runtime-Y11fyRVL.js">
|
|
30
|
+
<link rel="modulepreload" crossorigin href="/assets/PageListContext-DdGQSVEJ.js">
|
|
31
|
+
<link rel="modulepreload" crossorigin href="/assets/button-B1XQHQcX.js">
|
|
32
|
+
<link rel="modulepreload" crossorigin href="/assets/dialog-xzAlDsHy.js">
|
|
33
|
+
<link rel="modulepreload" crossorigin href="/assets/DocumentContext--jj-O3yz.js">
|
|
34
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-GlH2KPqY.js">
|
|
35
|
+
<link rel="modulepreload" crossorigin href="/assets/panel-rtdrPcLu.js">
|
|
36
|
+
<link rel="modulepreload" crossorigin href="/assets/clipboard-DRhtxu43.js">
|
|
37
|
+
<link rel="modulepreload" crossorigin href="/assets/tooltip-C2q723j6.js">
|
|
38
|
+
<link rel="modulepreload" crossorigin href="/assets/toggle-group-B86VAmbm.js">
|
|
39
|
+
<link rel="modulepreload" crossorigin href="/assets/agent-presence-BQu9C0ej.js">
|
|
40
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CIIADYsi.css">
|
|
36
41
|
</head>
|
|
37
42
|
|
|
38
43
|
<body class="antialiased">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./src-CB-sXsMW.mjs";import{Wt as e,c as t,ft as n,gt as r,ht as i,mt as a,n as o,pt as s,r as c}from"./src-H34RCSr9.mjs";import{f as l,r as u}from"./server-lock-4vgF5yho.mjs";export{o as ProjectGitInitError,n as UiLockCollisionError,s as acquireUiLock,t as bootServer,c as ensureProjectGit,e as getLogger,l as isProcessAlive,u as readServerLock,a as readUiLock,i as releaseUiLock,r as updateUiLockPort};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./init-CUmfZczR.mjs";import"./loader-5fUYhvT7.mjs";export{};
|