@inkeep/open-knowledge 0.67.0-beta.2 → 0.67.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/{acp-harness-probe-CQY5xnxl.mjs → acp-harness-probe-CAIOCT6d.mjs} +2 -2
  2. package/dist/cli.mjs +29 -29
  3. package/dist/constants-CsUYxRfV.mjs +2 -0
  4. package/dist/index.mjs +26 -26
  5. package/dist/init-BqfKh7Vw.mjs +1 -0
  6. package/dist/{init-BnAKA1pC.mjs → init-C3vpwARX.mjs} +12 -12
  7. package/dist/{launch-json-removal-BcBDWCAT.mjs → launch-json-removal-50hJcTaZ.mjs} +2 -2
  8. package/dist/{loader-DWla98le.mjs → loader-CtImrIWl.mjs} +2 -2
  9. package/dist/loader-d932-yXP.mjs +1 -0
  10. package/dist/{open-browser-B5VbCpAQ.mjs → open-browser-zyR1fJMP.mjs} +2 -2
  11. package/dist/{preview-CfABQUF8.mjs → preview-D9bPT-gK.mjs} +2 -2
  12. package/dist/preview-s6wGSaGi.mjs +1 -0
  13. package/dist/public/assets/{ActivityModeContent-DpHKV3Fo.js → ActivityModeContent-LZXobglw.js} +1 -1
  14. package/dist/public/assets/{AddPropertiesButton-DCG8p8wj.js → AddPropertiesButton-C_oEF-k6.js} +1 -1
  15. package/dist/public/assets/{AgentDiffPane-CyCKmqFc.js → AgentDiffPane-rwXOyXfA.js} +1 -1
  16. package/dist/public/assets/{CodeMirrorPropInput-u4XFoleT.js → CodeMirrorPropInput-Cg5Vd3nt.js} +1 -1
  17. package/dist/public/assets/{DocumentContext-Dnh6K82B.js → DocumentContext-CMYNrz-_.js} +1 -1
  18. package/dist/public/assets/{EditorModeToggle-DeXquZw1.js → EditorModeToggle-DX78JcBR.js} +1 -1
  19. package/dist/public/assets/{EnableSyncConfirmDialog-BQhuZB86.js → EnableSyncConfirmDialog-CrT56rTk.js} +1 -1
  20. package/dist/public/assets/{ExcalidrawDocEditor-B5oJcC6a.js → ExcalidrawDocEditor-DA40b8B-.js} +1 -1
  21. package/dist/public/assets/FeedbackForm-pTBV_Sai.js +1 -0
  22. package/dist/public/assets/{ImportSkillDialog-DrVFzW8E.js → ImportSkillDialog-BsGvRMLu.js} +1 -1
  23. package/dist/public/assets/{LintConfigEditor-DWVqaaqf.js → LintConfigEditor-3TmQmk5q.js} +1 -1
  24. package/dist/public/assets/ManagedArtifactProperties-DfK-lOLp.js +1 -0
  25. package/dist/public/assets/{ManagedArtifactProperties-PAJxXrcG.js → ManagedArtifactProperties-Dk0ISqgs.js} +1 -1
  26. package/dist/public/assets/{MermaidDocEditor-Cp9hfV1H.js → MermaidDocEditor-CNBiD7BP.js} +1 -1
  27. package/dist/public/assets/{PropertyDisplayRow-DAgkBnyy.js → PropertyDisplayRow-CcPBwh6r.js} +1 -1
  28. package/dist/public/assets/{SchemaConfigEditor-D2FZCIZ7.js → SchemaConfigEditor-Bp9Z2cMc.js} +1 -1
  29. package/dist/public/assets/{SessionsHost-CLKxzr4u.js → SessionsHost-Dgg43wAS.js} +2 -2
  30. package/dist/public/assets/{SettingsDialogBody-aojU_6yY.js → SettingsDialogBody-TzbcWBGf.js} +1 -1
  31. package/dist/public/assets/{ShareReceiveMissDialog-Bni3yXgl.js → ShareReceiveMissDialog-1s-ohJqA.js} +1 -1
  32. package/dist/public/assets/{SkillInstallMenu-BHR-9UNP.js → SkillInstallMenu-C9UMFcD3.js} +1 -1
  33. package/dist/public/assets/{SkillToolbarControls-iK4e4bEe.js → SkillToolbarControls-DaWIfh6l.js} +1 -1
  34. package/dist/public/assets/{SourceEditor-CRs3D5y2.js → SourceEditor-BxwgAoZn.js} +1 -1
  35. package/dist/public/assets/{TerminalWindowApp-CzZqjo-p.js → TerminalWindowApp-CLntLiBg.js} +1 -1
  36. package/dist/public/assets/{TextDocEditor-CdjxMtrt.js → TextDocEditor-DQNW37-H.js} +1 -1
  37. package/dist/public/assets/{ThreadView-C6uVuEhA.js → ThreadView-id1IVufe.js} +1 -1
  38. package/dist/public/assets/{TimelineDiffPane-DFbxsUjY.js → TimelineDiffPane-BVYNGbjv.js} +1 -1
  39. package/dist/public/assets/{agent-diff-store-CI9-nZ0i.js → agent-diff-store-BnFkUQtB.js} +1 -1
  40. package/dist/public/assets/{auth-state-cache-B_mn7bAt.js → auth-state-cache-CSFL7s9x.js} +1 -1
  41. package/dist/public/assets/{client-version-CEClhR52.js → client-version-DqyRNVDY.js} +1 -1
  42. package/dist/public/assets/{comment-chips-yb9PnjC0.js → comment-chips-Dj0DZmYi.js} +1 -1
  43. package/dist/public/assets/{config-provider-BKNG21ZO.js → config-provider-Flf2Xj2j.js} +1 -1
  44. package/dist/public/assets/{index-C7cNeh3S.js → index-DdYtMWnx.js} +7 -7
  45. package/dist/public/assets/{pending-receive-nav-store-Dw2-EiMe.js → pending-receive-nav-store-nAr29ZoF.js} +1 -1
  46. package/dist/public/assets/{progress-vSWRgJqM.js → progress-BVlIPHs6.js} +1 -1
  47. package/dist/public/assets/{selection-context-BPiksgZ3.js → selection-context-DyWxJNcr.js} +1 -1
  48. package/dist/public/assets/{src-Mka2WkyS.js → src-BLASU-Ua.js} +1 -1
  49. package/dist/public/assets/{telemetry-impl-ClRJ18fy.js → telemetry-impl-C-lVM95D.js} +1 -1
  50. package/dist/public/assets/{telemetry-startup-B_4IqvTc.js → telemetry-startup-Pp18qmqI.js} +1 -1
  51. package/dist/public/assets/{typing-burst-detector-dsiADuQh.js → typing-burst-detector-BU0mlOLf.js} +1 -1
  52. package/dist/public/assets/{use-activity-panel-CQXXnWdh.js → use-activity-panel-CucXmSmA.js} +1 -1
  53. package/dist/public/assets/{use-open-skill-Cl-CoKvQ.js → use-open-skill-F34G6MU_.js} +1 -1
  54. package/dist/public/assets/{use-terminal-enabled-DJjeF-1r.js → use-terminal-enabled-CeycTmer.js} +1 -1
  55. package/dist/public/assets/{use-timeline-entry-diff-j3PBCTgr.js → use-timeline-entry-diff-Dq2wYxOI.js} +1 -1
  56. package/dist/public/index.html +19 -19
  57. package/dist/{repair-launch-json-DxcVTMbs.mjs → repair-launch-json-Cvzqn61T.mjs} +2 -2
  58. package/dist/{repair-mcp-configs-DZQWWQln.mjs → repair-mcp-configs-DxNThLYs.mjs} +2 -2
  59. package/dist/repair-skills-B1grg5zx.mjs +1 -0
  60. package/dist/{repair-skills-k83Ipv-J.mjs → repair-skills-Cw8bOvSl.mjs} +2 -2
  61. package/dist/{resolve-project-root-DCYPHzur.mjs → resolve-project-root-GAALlgK0.mjs} +3 -3
  62. package/dist/{skill-teardown-CUW2_c9Q.mjs → skill-teardown-BOK6k1kP.mjs} +2 -2
  63. package/dist/src-B2uhXnAX.mjs +2045 -0
  64. package/dist/src-BQ4HXNsS.mjs +1 -0
  65. package/dist/{src-CA9zRmPt.mjs → src-DAPW933-.mjs} +2 -2
  66. package/dist/src-T0cE5ley.mjs +1 -0
  67. package/dist/start-BAn0n1M1.mjs +1 -0
  68. package/dist/{start-DuCVBkW-.mjs → start-CXk9FOLR.mjs} +3 -3
  69. package/package.json +4 -4
  70. package/dist/constants-CzBR8OPk.mjs +0 -2
  71. package/dist/init-BR7HCaX9.mjs +0 -1
  72. package/dist/loader-Dd9ywqT3.mjs +0 -1
  73. package/dist/preview-DDpTCIRk.mjs +0 -1
  74. package/dist/public/assets/FeedbackForm-2-zq8vF8.js +0 -1
  75. package/dist/public/assets/ManagedArtifactProperties-DGS7RCxV.js +0 -1
  76. package/dist/repair-skills-C7esPWUj.mjs +0 -1
  77. package/dist/src-CNuuM8T0.mjs +0 -2045
  78. package/dist/src-CkQqw1Wp.mjs +0 -1
  79. package/dist/src-DraT8WdY.mjs +0 -1
  80. package/dist/start-Cp7U3NfU.mjs +0 -1
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-Cym3gapE.js";import{n as s}from"./dist-CJhtNlOm2.js";import{t as c}from"./createLucideIcon-BulbvLvN.js";import{_ as l,c as u,i as d,l as f,m as p,n as m,o as h,t as g}from"./EnableSyncConfirmDialog-BQhuZB86.js";import{t as _}from"./arrow-up-right-BTi7mHwL.js";import{t as v}from"./check-Dut4Aov8.js";import{t as y}from"./folder-open-K9GIY2oQ.js";import{t as b}from"./info-GFoSMANR.js";import{t as x}from"./spinner-BY5pJxJc.js";import{n as S}from"./miss-dialog-store-C2psV7qs.js";import{t as C}from"./refresh-cw-DZ0cLdZU.js";import{t as w}from"./triangle-alert-BacEvDZF.js";import{g as T,r as E,s as D}from"./doc-paths-BQkA8AK7.js";import{t as O}from"./external-link-BhAKBz3y.js";var k=c(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),A=c(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),j=c(`file-x-corner`,[[`path`,{d:`M11 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5`,key:`1jo35a`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m15 17 5 5`,key:`36xl1x`}],[`path`,{d:`m20 17-5 5`,key:`vdz27y`}]]),M=a(),N=e(n(),1),P=t(),F=`https://git-scm.com/docs/git-push`;function I(e,t){return e===`empty`?!0:!(e!==`stale`&&e!==`absent`||e===`stale`&&t?.syncEnabled===!0)}function ee(e){return e?e.state!==`dormant`&&e.state!==`disabled`&&e.state!==`auth-error`&&e.state!==`conflict`:!1}function L(e){let t=(0,M.c)(52),{freshness:n,status:a,kind:s}=e,{_:c}=i(),{confirmOpen:l,setConfirmOpen:u,onToggleRequest:f,onConfirm:p}=d(h()),[y,S]=(0,N.useState)(`idle`),T=(0,N.useRef)(null),E,D;if(t[0]!==a||t[1]!==y?(E=()=>{if(!(y!==`pending`||!a)){if(a.pushError||a.pushErrorCode){S(`idle`);return}(a.lastSyncUtc??null)!==T.current&&S(`synced`)}},D=[y,a],t[0]=a,t[1]=y,t[2]=E,t[3]=D):(E=t[2],D=t[3]),(0,N.useEffect)(E,D),!I(n,a))return null;if(n===`empty`){let e;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),t[4]=e):e=t[4];let n;t[5]===c?n=t[6]:(n=c({id:`eazHgv`}),t[5]=c,t[6]=n);let r;return t[7]===n?r=t[8]:(r=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[e,(0,P.jsx)(`span`,{children:n})]}),t[7]=n,t[8]=r),r}if(y===`synced`){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[(0,P.jsx)(v,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{children:(0,P.jsx)(r,{id:`fxbCNQ`})})]}),t[9]=e):e=t[9],e}let O=a?.syncEnabled===!0,k=a?.pushPermission?.checkStatus===`denied`,A=!!(a?.pushError||a?.pushErrorCode),j=k||A,L=n===`absent`&&!O,B;if(n===`absent`&&!O){let e;t[10]!==c||t[11]!==s?(e=c(s===`folder`?{id:`PrJYSN`}:{id:`3BnyYc`}),t[10]=c,t[11]=s,t[12]=e):e=t[12],B=e}else if(n===`stale`){let e;t[13]!==c||t[14]!==s?(e=c(s===`folder`?{id:`Gt4gOO`}:{id:`2IYGkU`}),t[13]=c,t[14]=s,t[15]=e):e=t[15],B=e}else{let e;t[16]!==c||t[17]!==s?(e=c(s===`folder`?{id:`nqV0Kk`}:{id:`gwykHF`}),t[16]=c,t[17]=s,t[18]=e):e=t[18],B=e}let V;t[19]!==c||t[20]!==A||t[21]!==k?(V=k?c({id:`9OIqw4`}):A?c({id:`K6MQQk`}):null,t[19]=c,t[20]=A,t[21]=k,t[22]=V):V=t[22];let H=V,U;t[23]===a?.lastSyncUtc?U=t[24]:(U=()=>{T.current=a?.lastSyncUtc??null,S(`pending`),m(`sync`).catch(e=>{console.warn(`[share-freshness] sync trigger failed`,e instanceof Error?e.message:e),S(`idle`)})},t[23]=a?.lastSyncUtc,t[24]=U);let W=U,G=L?w:b,K;t[25]===G?K=t[26]:(K=(0,P.jsx)(G,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),t[25]=G,t[26]=K);let q;t[27]===B?q=t[28]:(q=(0,P.jsx)(`span`,{children:B}),t[27]=B,t[28]=q);let J;t[29]===H?J=t[30]:(J=H?(0,P.jsx)(`span`,{children:H}):null,t[29]=H,t[30]=J);let Y;t[31]!==j||t[32]!==W||t[33]!==f||t[34]!==a||t[35]!==O||t[36]!==y?(Y=j?null:O?ee(a)?(0,P.jsx)(`div`,{children:y===`pending`?(0,P.jsxs)(o,{variant:`outline`,size:`xs`,disabled:!0,children:[(0,P.jsx)(x,{icon:C,className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`EHu0x2`})]}):(0,P.jsx)(o,{variant:`outline`,size:`xs`,onClick:W,children:(0,P.jsx)(r,{id:`lb_UU4`})})}):null:(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,P.jsx)(o,{variant:`outline`,size:`xs`,onClick:()=>f(!0),children:(0,P.jsx)(r,{id:`pPiV8s`})}),(0,P.jsxs)(`a`,{href:F,target:`_blank`,rel:`noopener noreferrer`,onClick:z,onAuxClick:R,className:`inline-flex items-center gap-1 transition-colors hover:text-primary`,children:[(0,P.jsx)(r,{id:`GLxIKR`}),(0,P.jsx)(_,{className:`size-3 shrink-0`,"aria-hidden":`true`})]})]}),t[31]=j,t[32]=W,t[33]=f,t[34]=a,t[35]=O,t[36]=y,t[37]=Y):Y=t[37];let X;t[38]!==q||t[39]!==J||t[40]!==Y?(X=(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[q,J,Y]}),t[38]=q,t[39]=J,t[40]=Y,t[41]=X):X=t[41];let Z;t[42]!==K||t[43]!==X?(Z=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[K,X]}),t[42]=K,t[43]=X,t[44]=Z):Z=t[44];let Q;t[45]!==l||t[46]!==p||t[47]!==u?(Q=(0,P.jsx)(g,{open:l,onOpenChange:u,onConfirm:p}),t[45]=l,t[46]=p,t[47]=u,t[48]=Q):Q=t[48];let $;return t[49]!==Z||t[50]!==Q?($=(0,P.jsxs)(P.Fragment,{children:[Z,Q]}),t[49]=Z,t[50]=Q,t[51]=$):$=t[51],$}function R(e){return O(e,F)}function z(e){return O(e,F)}function B(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function V(e){let t=(0,M.c)(17),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={phase:`pending`},t[0]=n):n=t[0];let[r,i]=(0,N.useState)(n),[a,o]=(0,N.useState)(0),s=e.branch,c;t[1]!==s||t[2]!==e.contentRootDepth||t[3]!==e.kind||t[4]!==e.path||t[5]!==e.repositoryPath?(c=()=>{let t=window.okDesktop??null;if(!t||s===null){i({phase:`resolved`,resolution:{verdict:`unknown`}});return}let n=!1;return t.project.fetchTargetStatus({projectPath:t.config.projectPath,branch:s,path:e.repositoryPath??e.path,kind:e.kind,...e.contentRootDepth===void 0?{}:{contentRootDepth:e.contentRootDepth}}).then(e=>{n||i({phase:`resolved`,resolution:e??{verdict:`unknown`}})}).catch(e=>{n||(console.warn(`[receive] miss target-status fetch failed`,e instanceof Error?e.message:e),i({phase:`resolved`,resolution:{verdict:`unknown`}}))}),()=>{n=!0}},t[1]=s,t[2]=e.contentRootDepth,t[3]=e.kind,t[4]=e.path,t[5]=e.repositoryPath,t[6]=c):c=t[6];let l;t[7]!==s||t[8]!==a||t[9]!==e.contentRootDepth||t[10]!==e.kind||t[11]!==e.path||t[12]!==e.repositoryPath?(l=[s,e.kind,e.path,e.repositoryPath,e.contentRootDepth,a],t[7]=s,t[8]=a,t[9]=e.contentRootDepth,t[10]=e.kind,t[11]=e.path,t[12]=e.repositoryPath,t[13]=l):l=t[13],(0,N.useEffect)(c,l);let u;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{i({phase:`pending`}),o(H)},t[14]=u):u=t[14];let d;return t[15]===r?d=t[16]:(d={state:r,refetch:u},t[15]=r,t[16]=d),d}function H(e){return e+1}function U(e){let t=(0,M.c)(15),{onEnabled:n}=e,i=h(),a;t[0]===n?a=t[1]:(a={onEnabled:n},t[0]=n,t[1]=a);let{confirmOpen:s,setConfirmOpen:c,onToggleRequest:l,onConfirm:u}=d(i,a),f;t[2]===l?f=t[3]:(f=()=>l(!0),t[2]=l,t[3]=f);let p,m;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,P.jsx)(C,{className:`size-4`,"aria-hidden":`true`}),m=(0,P.jsx)(r,{id:`pPiV8s`}),t[4]=p,t[5]=m):(p=t[4],m=t[5]);let _;t[6]===f?_=t[7]:(_=(0,P.jsxs)(o,{onClick:f,"data-testid":`share-receive-miss-enable-sync`,children:[p,m]}),t[6]=f,t[7]=_);let v;t[8]!==s||t[9]!==u||t[10]!==c?(v=(0,P.jsx)(g,{open:s,onOpenChange:c,onConfirm:u}),t[8]=s,t[9]=u,t[10]=c,t[11]=v):v=t[11];let y;return t[12]!==_||t[13]!==v?(y=(0,P.jsxs)(P.Fragment,{children:[_,v]}),t[12]=_,t[13]=v,t[14]=y):y=t[14],y}function W(e){let t=(0,M.c)(23),{status:n,onSyncCompleted:a}=e,{_:c}=i(),[l,u]=(0,N.useState)(!1),d=(0,N.useRef)(null),f;t[0]!==a||t[1]!==l||t[2]!==n.lastSyncUtc||t[3]!==n.pushError||t[4]!==n.pushErrorCode?(f=()=>{if(l){if(n.pushError||n.pushErrorCode){u(!1);return}(n.lastSyncUtc??null)!==d.current&&(u(!1),a?.())}},t[0]=a,t[1]=l,t[2]=n.lastSyncUtc,t[3]=n.pushError,t[4]=n.pushErrorCode,t[5]=f):f=t[5];let p;t[6]!==a||t[7]!==l||t[8]!==n?(p=[l,n,a],t[6]=a,t[7]=l,t[8]=n,t[9]=p):p=t[9],(0,N.useEffect)(f,p);let h;t[10]!==c||t[11]!==n.lastSyncUtc?(h=()=>{d.current=n.lastSyncUtc??null,u(!0),m(`sync`).catch(e=>{console.warn(`[receive] miss sync trigger failed`,e instanceof Error?e.message:e),u(!1),s.error(c({id:`1u-mAI`}))})},t[10]=c,t[11]=n.lastSyncUtc,t[12]=h):h=t[12];let g=h,_;t[13]!==g||t[14]!==l?(_=l?(0,P.jsxs)(o,{disabled:!0,"aria-busy":`true`,"data-testid":`share-receive-miss-sync-now`,children:[(0,P.jsx)(x,{icon:C,className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`EHu0x2`})]}):(0,P.jsxs)(o,{onClick:g,"data-testid":`share-receive-miss-sync-now`,children:[(0,P.jsx)(C,{className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`lb_UU4`})]}),t[13]=g,t[14]=l,t[15]=_):_=t[15];let v;t[16]===l?v=t[17]:(v=l?(0,P.jsx)(r,{id:`dXOolp`}):null,t[16]=l,t[17]=v);let y;t[18]===v?y=t[19]:(y=(0,P.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,"data-testid":`share-receive-miss-sync-status`,children:v}),t[18]=v,t[19]=y);let b;return t[20]!==_||t[21]!==y?(b=(0,P.jsxs)(P.Fragment,{children:[_,y]}),t[20]=_,t[21]=y,t[22]=b):b=t[22],b}var G=!1;function K(e){return!G&&e!==null&&e.syncEnabled!==!0}function q(e){return e===null?!1:e.hasRemote&&e.lastPullUtc!==void 0&&e.state!==`conflict`}function J(e,t){let n=(0,M.c)(15),[r,i]=(0,N.useState)(!1),[a,o]=(0,N.useState)(null),[s,c]=(0,N.useState)(!1),l=(0,N.useRef)(null),u,d;n[0]!==t||n[1]!==r||n[2]!==e?(u=()=>{if(!r||(e?.lastPullUtc??null)===l.current)return;i(!1);let n=e?.lastPullOutcome??null;if(n===null){t?.();return}switch(n){case`refused`:case`error`:o(n);return;case`succeeded`:case`up-to-date`:if(K(e)){G=!0,c(!0);return}t?.();return;case`conflict`:t?.();return;default:t?.();return}},d=[r,e,t],n[0]=t,n[1]=r,n[2]=e,n[3]=u,n[4]=d):(u=n[3],d=n[4]),(0,N.useEffect)(u,d);let f;n[5]===t?f=n[6]:(f=()=>{c(!1),t?.()},n[5]=t,n[6]=f);let p;n[7]===e?.lastPullUtc?p=n[8]:(p=()=>{l.current=e?.lastPullUtc??null,o(null),i(!0),m(`pull`).catch(e=>{console.warn(`[receive] miss pull trigger failed`,e instanceof Error?e.message:e),i(!1),o(`error`)})},n[7]=e?.lastPullUtc,n[8]=p);let h;return n[9]!==a||n[10]!==s||n[11]!==r||n[12]!==f||n[13]!==p?(h={pending:r,failure:a,offering:s,resolveOffer:f,start:p},n[9]=a,n[10]=s,n[11]=r,n[12]=f,n[13]=p,n[14]=h):h=n[14],h}function Y(e){let t=(0,M.c)(10),{pending:n,onPull:i}=e,a;t[0]!==i||t[1]!==n?(a=n?(0,P.jsxs)(o,{disabled:!0,"aria-busy":`true`,"data-testid":`share-receive-miss-pull-now`,children:[(0,P.jsx)(x,{icon:C,className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`4uNLmk`})]}):(0,P.jsxs)(o,{onClick:i,"data-testid":`share-receive-miss-pull-now`,children:[(0,P.jsx)(l,{className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`fevEu0`})]}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let s;t[3]===n?s=t[4]:(s=n?(0,P.jsx)(r,{id:`glG1TR`}):null,t[3]=n,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,P.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,"data-testid":`share-receive-miss-pull-status`,children:s}),t[5]=s,t[6]=c);let u;return t[7]!==a||t[8]!==c?(u=(0,P.jsxs)(P.Fragment,{children:[a,c]}),t[7]=a,t[8]=c,t[9]=u):u=t[9],u}function X(e){let t=(0,M.c)(18),{onResolve:n,strandedCommitCount:r}=e,i=f(),a=(0,N.useRef)(!1),o;t[0]===n?o=t[1]:(o=function(){a.current||(a.current=!0,n())},t[0]=n,t[1]=o);let s=o,c;t[2]===s?c=t[3]:(c={onApplied:s},t[2]=s,t[3]=c);let{confirmOpen:l,setConfirmOpen:d,onModeSelect:p,onConfirm:m}=u(i,`off`,c),h=(0,N.useRef)(!1),_,v;t[4]===p?(_=t[5],v=t[6]):(_=()=>{h.current||(h.current=!0,p(`follow`))},v=[p],t[4]=p,t[5]=_,t[6]=v),(0,N.useEffect)(_,v);let y;t[7]!==s||t[8]!==d?(y=e=>{d(e),e||s()},t[7]=s,t[8]=d,t[9]=y):y=t[9];let b;t[10]!==m||t[11]!==s?(b=()=>{m(),s()},t[10]=m,t[11]=s,t[12]=b):b=t[12];let x;return t[13]!==l||t[14]!==r||t[15]!==y||t[16]!==b?(x=(0,P.jsx)(g,{open:l,onOpenChange:y,onConfirm:b,variant:`follow`,strandedCommitCount:r}),t[13]=l,t[14]=r,t[15]=y,t[16]=b,t[17]=x):x=t[17],x}function Z(e){let t=(0,M.c)(89),{nav:n,state:a,onBrowseFolder:s,onOpenRenamed:c,onEnableAutoSync:u,onSyncCompleted:d,onPullApplied:f}=e,{_:m}=i(),h=p(),g=J(h,f),_=n.branch,v;t[0]!==m||t[1]!==n.kind?(v=n.kind===`folder`?m({id:`ugoTXs`}):m({id:`XH30C4`}),t[0]=m,t[1]=n.kind,t[2]=v):v=t[2];let b=v;if(a.phase===`pending`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(x,{className:`size-5`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`c8jBgX`})]}),t[3]=e):e=t[3],e}let{resolution:C}=a,w,T;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,P.jsx)(y,{className:`size-4`,"aria-hidden":`true`}),T=(0,P.jsx)(r,{id:`hItdtk`}),t[4]=w,t[5]=T):(w=t[4],T=t[5]);let E;t[6]===s?E=t[7]:(E=(0,P.jsxs)(o,{variant:`outline`,onClick:s,"data-testid":`share-receive-miss-browse`,children:[w,T]}),t[6]=s,t[7]=E);let D=E,O,N,F,I=null;if(C.verdict===`renamed`){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(S,{className:`size-9`,"aria-hidden":`true`}),t[8]=e):e=t[8],O=e;let n;t[9]!==C.renamedTo||t[10]!==b?(n={0:C.renamedTo,targetNoun:b},t[9]=C.renamedTo,t[10]=b,t[11]=n):n=t[11];let i;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[12]=i):i=t[12];let a;t[13]===n?a=t[14]:(a=(0,P.jsx)(r,{id:`P0HC30`,values:n,components:i}),t[13]=n,t[14]=a),N=a;let s;t[15]!==c||t[16]!==C.renamedTo?(s=()=>c(C.renamedTo),t[15]=c,t[16]=C.renamedTo,t[17]=s):s=t[17];let l,u;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,P.jsx)(S,{className:`size-4`,"aria-hidden":`true`}),u=(0,P.jsx)(r,{id:`AItsE5`}),t[18]=l,t[19]=u):(l=t[18],u=t[19]);let d;t[20]===s?d=t[21]:(d=(0,P.jsxs)(o,{onClick:s,"data-testid":`share-receive-miss-open-renamed`,children:[l,u]}),t[20]=s,t[21]=d);let f;t[22]!==D||t[23]!==d?(f=(0,P.jsxs)(P.Fragment,{children:[d,D]}),t[22]=D,t[23]=d,t[24]=f):f=t[24],F=f}else if(C.verdict===`deleted`){let e;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(j,{className:`size-9`,"aria-hidden":`true`}),t[25]=e):e=t[25],O=e;let n;t[26]!==_||t[27]!==b?(n={targetNoun:b,branch:_},t[26]=_,t[27]=b,t[28]=n):n=t[28];let i;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[29]=i):i=t[29];let a;t[30]===n?a=t[31]:(a=(0,P.jsx)(r,{id:`kpqWwG`,values:n,components:i}),t[30]=n,t[31]=a),N=a,F=D}else if(C.verdict===`never-on-branch`){let e;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(A,{className:`size-9`,"aria-hidden":`true`}),t[32]=e):e=t[32],O=e;let n;t[33]!==_||t[34]!==b?(n={targetNoun:b,branch:_},t[33]=_,t[34]=b,t[35]=n):n=t[35];let i;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[36]=i):i=t[36];let a;t[37]===n?a=t[38]:(a=(0,P.jsx)(r,{id:`i9TPUi`,values:n,components:i}),t[37]=n,t[38]=a),N=a,F=D}else if(C.verdict===`changed-locally`){let e;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(k,{className:`size-9`,"aria-hidden":`true`}),t[39]=e):e=t[39],O=e;let n=h?.syncEnabled===!0,i=h?.pushPermission?.checkStatus===`denied`||!!(h?.pushError||h?.pushErrorCode);if(n){let e;t[40]!==_||t[41]!==b?(e=_===null?(0,P.jsx)(r,{id:`RyIKxy`,values:{targetNoun:b}}):(0,P.jsx)(r,{id:`l6kpzR`,values:{targetNoun:b,branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[40]=_,t[41]=b,t[42]=e):e=t[42],N=e}else{let e;t[43]!==_||t[44]!==b?(e=_===null?(0,P.jsx)(r,{id:`UuYo7g`,values:{targetNoun:b}}):(0,P.jsx)(r,{id:`HoWElC`,values:{targetNoun:b,branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[43]=_,t[44]=b,t[45]=e):e=t[45],N=e}let a=null;if(h?.syncEnabled){if(ee(h)&&!i){let e;t[46]!==d||t[47]!==h?(e=(0,P.jsx)(W,{status:h,onSyncCompleted:d}),t[46]=d,t[47]=h,t[48]=e):e=t[48],a=e}}else if(h!==null){let e;t[49]===u?e=t[50]:(e=(0,P.jsx)(U,{onEnabled:u}),t[49]=u,t[50]=e),a=e}let o;t[51]!==D||t[52]!==a?(o=(0,P.jsxs)(P.Fragment,{children:[a,D]}),t[51]=D,t[52]=a,t[53]=o):o=t[53],F=o}else{let e;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(l,{className:`size-9`,"aria-hidden":`true`}),t[54]=e):e=t[54],O=e;let n;t[55]===h?n=t[56]:(n=q(h),t[55]=h,t[56]=n);let i=n;if(i){let e;t[57]===_?e=t[58]:(e=_===null?(0,P.jsx)(r,{id:`gwEcOD`}):(0,P.jsx)(r,{id:`wvK7Ay`,values:{branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[57]=_,t[58]=e),N=e}else{let e;t[59]===_?e=t[60]:(e=_===null?(0,P.jsx)(r,{id:`Xewl6B`}):(0,P.jsx)(r,{id:`d1JjXo`,values:{branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[59]=_,t[60]=e),N=e}let a=g.failure===null?`sr-only`:`max-w-md text-balance text-1sm text-destructive`,o;t[61]===g.failure?o=t[62]:(o=g.failure===`refused`?(0,P.jsx)(r,{id:`Xp7Kq4`}):g.failure===`error`?(0,P.jsx)(r,{id:`JG_8KT`}):null,t[61]=g.failure,t[62]=o);let s;t[63]!==a||t[64]!==o?(s=(0,P.jsx)(`p`,{role:`alert`,className:a,"data-testid":`share-receive-miss-pull-error`,children:o}),t[63]=a,t[64]=o,t[65]=s):s=t[65],I=s;let c;t[66]!==i||t[67]!==g.pending||t[68]!==g.start?(c=i?(0,P.jsx)(Y,{pending:g.pending,onPull:g.start}):null,t[66]=i,t[67]=g.pending,t[68]=g.start,t[69]=c):c=t[69];let u;t[70]!==g.offering||t[71]!==g.resolveOffer||t[72]!==h?.ahead?(u=g.offering?(0,P.jsx)(X,{onResolve:g.resolveOffer,strandedCommitCount:h?.ahead??0}):null,t[70]=g.offering,t[71]=g.resolveOffer,t[72]=h?.ahead,t[73]=u):u=t[73];let d;t[74]!==D||t[75]!==c||t[76]!==u?(d=(0,P.jsxs)(P.Fragment,{children:[c,D,u]}),t[74]=D,t[75]=c,t[76]=u,t[77]=d):d=t[77],F=d}let L;t[78]===O?L=t[79]:(L=(0,P.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-full border bg-muted/40 text-muted-foreground`,children:O}),t[78]=O,t[79]=L);let R;t[80]===N?R=t[81]:(R=(0,P.jsx)(`p`,{className:`max-w-md text-balance text-base leading-6 text-foreground/90`,children:N}),t[80]=N,t[81]=R);let z;t[82]===F?z=t[83]:(z=(0,P.jsx)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-center`,children:F}),t[82]=F,t[83]=z);let B;return t[84]!==I||t[85]!==L||t[86]!==R||t[87]!==z?(B=(0,P.jsxs)(P.Fragment,{children:[L,R,I,z]}),t[84]=I,t[85]=L,t[86]=R,t[87]=z,t[88]=B):B=t[88],B}function Q(e){return e.replace(/^\/+|\/+$/g,``)}function $(e,t){if(t.kind===`folder`){if(T(e))return Q(t.path)===``;let n=D(e);return n!==null&&Q(n)===Q(t.path)}let n=D(e);return n===null?!1:E(n)===E(t.path)}function te(){let e=null,t=new Set,n=!1;function r(){for(let e of t)e()}function i(t){e!==t&&(e=t,r())}function a(){e!==null&&($(window.location.hash,e)||i(null))}function o(){n||typeof window>`u`||(n=!0,window.addEventListener(`hashchange`,a))}return{arm(e){o(),i(e)},clear(){i(null)},getSnapshot(){return e},subscribe(e){return t.add(e),()=>{t.delete(e)}},dispose(){n&&typeof window<`u`&&(window.removeEventListener(`hashchange`,a),n=!1),i(null)}}}var ne=te();function re(e,t){if(e.contentRootDepth===void 0)return{...e,path:t,repositoryPath:t};let n=(e.repositoryPath??e.path).split(`/`).slice(0,e.contentRootDepth);return{...e,path:t,repositoryPath:[...n,...t===``?[]:t.split(`/`)].join(`/`)}}function ie(e,t){return e===null||e.kind!==`missing`||t===null||E(t.path)!==e.target?null:t}export{B as a,I as c,Z as i,re as n,V as o,ne as r,L as s,ie as t};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-Cym3gapE.js";import{n as s}from"./dist-CJhtNlOm2.js";import{t as c}from"./createLucideIcon-BulbvLvN.js";import{_ as l,c as u,i as d,l as f,m as p,n as m,o as h,t as g}from"./EnableSyncConfirmDialog-CrT56rTk.js";import{t as _}from"./arrow-up-right-BTi7mHwL.js";import{t as v}from"./check-Dut4Aov8.js";import{t as y}from"./folder-open-K9GIY2oQ.js";import{t as b}from"./info-GFoSMANR.js";import{t as x}from"./spinner-BY5pJxJc.js";import{n as S}from"./miss-dialog-store-C2psV7qs.js";import{t as C}from"./refresh-cw-DZ0cLdZU.js";import{t as w}from"./triangle-alert-BacEvDZF.js";import{g as T,r as E,s as D}from"./doc-paths-BQkA8AK7.js";import{t as O}from"./external-link-BhAKBz3y.js";var k=c(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),A=c(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),j=c(`file-x-corner`,[[`path`,{d:`M11 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5`,key:`1jo35a`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m15 17 5 5`,key:`36xl1x`}],[`path`,{d:`m20 17-5 5`,key:`vdz27y`}]]),M=a(),N=e(n(),1),P=t(),F=`https://git-scm.com/docs/git-push`;function I(e,t){return e===`empty`?!0:!(e!==`stale`&&e!==`absent`||e===`stale`&&t?.syncEnabled===!0)}function ee(e){return e?e.state!==`dormant`&&e.state!==`disabled`&&e.state!==`auth-error`&&e.state!==`conflict`:!1}function L(e){let t=(0,M.c)(52),{freshness:n,status:a,kind:s}=e,{_:c}=i(),{confirmOpen:l,setConfirmOpen:u,onToggleRequest:f,onConfirm:p}=d(h()),[y,S]=(0,N.useState)(`idle`),T=(0,N.useRef)(null),E,D;if(t[0]!==a||t[1]!==y?(E=()=>{if(!(y!==`pending`||!a)){if(a.pushError||a.pushErrorCode){S(`idle`);return}(a.lastSyncUtc??null)!==T.current&&S(`synced`)}},D=[y,a],t[0]=a,t[1]=y,t[2]=E,t[3]=D):(E=t[2],D=t[3]),(0,N.useEffect)(E,D),!I(n,a))return null;if(n===`empty`){let e;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),t[4]=e):e=t[4];let n;t[5]===c?n=t[6]:(n=c({id:`eazHgv`}),t[5]=c,t[6]=n);let r;return t[7]===n?r=t[8]:(r=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[e,(0,P.jsx)(`span`,{children:n})]}),t[7]=n,t[8]=r),r}if(y===`synced`){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[(0,P.jsx)(v,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{children:(0,P.jsx)(r,{id:`fxbCNQ`})})]}),t[9]=e):e=t[9],e}let O=a?.syncEnabled===!0,k=a?.pushPermission?.checkStatus===`denied`,A=!!(a?.pushError||a?.pushErrorCode),j=k||A,L=n===`absent`&&!O,B;if(n===`absent`&&!O){let e;t[10]!==c||t[11]!==s?(e=c(s===`folder`?{id:`PrJYSN`}:{id:`3BnyYc`}),t[10]=c,t[11]=s,t[12]=e):e=t[12],B=e}else if(n===`stale`){let e;t[13]!==c||t[14]!==s?(e=c(s===`folder`?{id:`Gt4gOO`}:{id:`2IYGkU`}),t[13]=c,t[14]=s,t[15]=e):e=t[15],B=e}else{let e;t[16]!==c||t[17]!==s?(e=c(s===`folder`?{id:`nqV0Kk`}:{id:`gwykHF`}),t[16]=c,t[17]=s,t[18]=e):e=t[18],B=e}let V;t[19]!==c||t[20]!==A||t[21]!==k?(V=k?c({id:`9OIqw4`}):A?c({id:`K6MQQk`}):null,t[19]=c,t[20]=A,t[21]=k,t[22]=V):V=t[22];let H=V,U;t[23]===a?.lastSyncUtc?U=t[24]:(U=()=>{T.current=a?.lastSyncUtc??null,S(`pending`),m(`sync`).catch(e=>{console.warn(`[share-freshness] sync trigger failed`,e instanceof Error?e.message:e),S(`idle`)})},t[23]=a?.lastSyncUtc,t[24]=U);let W=U,G=L?w:b,K;t[25]===G?K=t[26]:(K=(0,P.jsx)(G,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),t[25]=G,t[26]=K);let q;t[27]===B?q=t[28]:(q=(0,P.jsx)(`span`,{children:B}),t[27]=B,t[28]=q);let J;t[29]===H?J=t[30]:(J=H?(0,P.jsx)(`span`,{children:H}):null,t[29]=H,t[30]=J);let Y;t[31]!==j||t[32]!==W||t[33]!==f||t[34]!==a||t[35]!==O||t[36]!==y?(Y=j?null:O?ee(a)?(0,P.jsx)(`div`,{children:y===`pending`?(0,P.jsxs)(o,{variant:`outline`,size:`xs`,disabled:!0,children:[(0,P.jsx)(x,{icon:C,className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`EHu0x2`})]}):(0,P.jsx)(o,{variant:`outline`,size:`xs`,onClick:W,children:(0,P.jsx)(r,{id:`lb_UU4`})})}):null:(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,P.jsx)(o,{variant:`outline`,size:`xs`,onClick:()=>f(!0),children:(0,P.jsx)(r,{id:`pPiV8s`})}),(0,P.jsxs)(`a`,{href:F,target:`_blank`,rel:`noopener noreferrer`,onClick:z,onAuxClick:R,className:`inline-flex items-center gap-1 transition-colors hover:text-primary`,children:[(0,P.jsx)(r,{id:`GLxIKR`}),(0,P.jsx)(_,{className:`size-3 shrink-0`,"aria-hidden":`true`})]})]}),t[31]=j,t[32]=W,t[33]=f,t[34]=a,t[35]=O,t[36]=y,t[37]=Y):Y=t[37];let X;t[38]!==q||t[39]!==J||t[40]!==Y?(X=(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[q,J,Y]}),t[38]=q,t[39]=J,t[40]=Y,t[41]=X):X=t[41];let Z;t[42]!==K||t[43]!==X?(Z=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[K,X]}),t[42]=K,t[43]=X,t[44]=Z):Z=t[44];let Q;t[45]!==l||t[46]!==p||t[47]!==u?(Q=(0,P.jsx)(g,{open:l,onOpenChange:u,onConfirm:p}),t[45]=l,t[46]=p,t[47]=u,t[48]=Q):Q=t[48];let $;return t[49]!==Z||t[50]!==Q?($=(0,P.jsxs)(P.Fragment,{children:[Z,Q]}),t[49]=Z,t[50]=Q,t[51]=$):$=t[51],$}function R(e){return O(e,F)}function z(e){return O(e,F)}function B(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function V(e){let t=(0,M.c)(17),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={phase:`pending`},t[0]=n):n=t[0];let[r,i]=(0,N.useState)(n),[a,o]=(0,N.useState)(0),s=e.branch,c;t[1]!==s||t[2]!==e.contentRootDepth||t[3]!==e.kind||t[4]!==e.path||t[5]!==e.repositoryPath?(c=()=>{let t=window.okDesktop??null;if(!t||s===null){i({phase:`resolved`,resolution:{verdict:`unknown`}});return}let n=!1;return t.project.fetchTargetStatus({projectPath:t.config.projectPath,branch:s,path:e.repositoryPath??e.path,kind:e.kind,...e.contentRootDepth===void 0?{}:{contentRootDepth:e.contentRootDepth}}).then(e=>{n||i({phase:`resolved`,resolution:e??{verdict:`unknown`}})}).catch(e=>{n||(console.warn(`[receive] miss target-status fetch failed`,e instanceof Error?e.message:e),i({phase:`resolved`,resolution:{verdict:`unknown`}}))}),()=>{n=!0}},t[1]=s,t[2]=e.contentRootDepth,t[3]=e.kind,t[4]=e.path,t[5]=e.repositoryPath,t[6]=c):c=t[6];let l;t[7]!==s||t[8]!==a||t[9]!==e.contentRootDepth||t[10]!==e.kind||t[11]!==e.path||t[12]!==e.repositoryPath?(l=[s,e.kind,e.path,e.repositoryPath,e.contentRootDepth,a],t[7]=s,t[8]=a,t[9]=e.contentRootDepth,t[10]=e.kind,t[11]=e.path,t[12]=e.repositoryPath,t[13]=l):l=t[13],(0,N.useEffect)(c,l);let u;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{i({phase:`pending`}),o(H)},t[14]=u):u=t[14];let d;return t[15]===r?d=t[16]:(d={state:r,refetch:u},t[15]=r,t[16]=d),d}function H(e){return e+1}function U(e){let t=(0,M.c)(15),{onEnabled:n}=e,i=h(),a;t[0]===n?a=t[1]:(a={onEnabled:n},t[0]=n,t[1]=a);let{confirmOpen:s,setConfirmOpen:c,onToggleRequest:l,onConfirm:u}=d(i,a),f;t[2]===l?f=t[3]:(f=()=>l(!0),t[2]=l,t[3]=f);let p,m;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,P.jsx)(C,{className:`size-4`,"aria-hidden":`true`}),m=(0,P.jsx)(r,{id:`pPiV8s`}),t[4]=p,t[5]=m):(p=t[4],m=t[5]);let _;t[6]===f?_=t[7]:(_=(0,P.jsxs)(o,{onClick:f,"data-testid":`share-receive-miss-enable-sync`,children:[p,m]}),t[6]=f,t[7]=_);let v;t[8]!==s||t[9]!==u||t[10]!==c?(v=(0,P.jsx)(g,{open:s,onOpenChange:c,onConfirm:u}),t[8]=s,t[9]=u,t[10]=c,t[11]=v):v=t[11];let y;return t[12]!==_||t[13]!==v?(y=(0,P.jsxs)(P.Fragment,{children:[_,v]}),t[12]=_,t[13]=v,t[14]=y):y=t[14],y}function W(e){let t=(0,M.c)(23),{status:n,onSyncCompleted:a}=e,{_:c}=i(),[l,u]=(0,N.useState)(!1),d=(0,N.useRef)(null),f;t[0]!==a||t[1]!==l||t[2]!==n.lastSyncUtc||t[3]!==n.pushError||t[4]!==n.pushErrorCode?(f=()=>{if(l){if(n.pushError||n.pushErrorCode){u(!1);return}(n.lastSyncUtc??null)!==d.current&&(u(!1),a?.())}},t[0]=a,t[1]=l,t[2]=n.lastSyncUtc,t[3]=n.pushError,t[4]=n.pushErrorCode,t[5]=f):f=t[5];let p;t[6]!==a||t[7]!==l||t[8]!==n?(p=[l,n,a],t[6]=a,t[7]=l,t[8]=n,t[9]=p):p=t[9],(0,N.useEffect)(f,p);let h;t[10]!==c||t[11]!==n.lastSyncUtc?(h=()=>{d.current=n.lastSyncUtc??null,u(!0),m(`sync`).catch(e=>{console.warn(`[receive] miss sync trigger failed`,e instanceof Error?e.message:e),u(!1),s.error(c({id:`1u-mAI`}))})},t[10]=c,t[11]=n.lastSyncUtc,t[12]=h):h=t[12];let g=h,_;t[13]!==g||t[14]!==l?(_=l?(0,P.jsxs)(o,{disabled:!0,"aria-busy":`true`,"data-testid":`share-receive-miss-sync-now`,children:[(0,P.jsx)(x,{icon:C,className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`EHu0x2`})]}):(0,P.jsxs)(o,{onClick:g,"data-testid":`share-receive-miss-sync-now`,children:[(0,P.jsx)(C,{className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`lb_UU4`})]}),t[13]=g,t[14]=l,t[15]=_):_=t[15];let v;t[16]===l?v=t[17]:(v=l?(0,P.jsx)(r,{id:`dXOolp`}):null,t[16]=l,t[17]=v);let y;t[18]===v?y=t[19]:(y=(0,P.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,"data-testid":`share-receive-miss-sync-status`,children:v}),t[18]=v,t[19]=y);let b;return t[20]!==_||t[21]!==y?(b=(0,P.jsxs)(P.Fragment,{children:[_,y]}),t[20]=_,t[21]=y,t[22]=b):b=t[22],b}var G=!1;function K(e){return!G&&e!==null&&e.syncEnabled!==!0}function q(e){return e===null?!1:e.hasRemote&&e.lastPullUtc!==void 0&&e.state!==`conflict`}function J(e,t){let n=(0,M.c)(15),[r,i]=(0,N.useState)(!1),[a,o]=(0,N.useState)(null),[s,c]=(0,N.useState)(!1),l=(0,N.useRef)(null),u,d;n[0]!==t||n[1]!==r||n[2]!==e?(u=()=>{if(!r||(e?.lastPullUtc??null)===l.current)return;i(!1);let n=e?.lastPullOutcome??null;if(n===null){t?.();return}switch(n){case`refused`:case`error`:o(n);return;case`succeeded`:case`up-to-date`:if(K(e)){G=!0,c(!0);return}t?.();return;case`conflict`:t?.();return;default:t?.();return}},d=[r,e,t],n[0]=t,n[1]=r,n[2]=e,n[3]=u,n[4]=d):(u=n[3],d=n[4]),(0,N.useEffect)(u,d);let f;n[5]===t?f=n[6]:(f=()=>{c(!1),t?.()},n[5]=t,n[6]=f);let p;n[7]===e?.lastPullUtc?p=n[8]:(p=()=>{l.current=e?.lastPullUtc??null,o(null),i(!0),m(`pull`).catch(e=>{console.warn(`[receive] miss pull trigger failed`,e instanceof Error?e.message:e),i(!1),o(`error`)})},n[7]=e?.lastPullUtc,n[8]=p);let h;return n[9]!==a||n[10]!==s||n[11]!==r||n[12]!==f||n[13]!==p?(h={pending:r,failure:a,offering:s,resolveOffer:f,start:p},n[9]=a,n[10]=s,n[11]=r,n[12]=f,n[13]=p,n[14]=h):h=n[14],h}function Y(e){let t=(0,M.c)(10),{pending:n,onPull:i}=e,a;t[0]!==i||t[1]!==n?(a=n?(0,P.jsxs)(o,{disabled:!0,"aria-busy":`true`,"data-testid":`share-receive-miss-pull-now`,children:[(0,P.jsx)(x,{icon:C,className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`4uNLmk`})]}):(0,P.jsxs)(o,{onClick:i,"data-testid":`share-receive-miss-pull-now`,children:[(0,P.jsx)(l,{className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`fevEu0`})]}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let s;t[3]===n?s=t[4]:(s=n?(0,P.jsx)(r,{id:`glG1TR`}):null,t[3]=n,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,P.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,"data-testid":`share-receive-miss-pull-status`,children:s}),t[5]=s,t[6]=c);let u;return t[7]!==a||t[8]!==c?(u=(0,P.jsxs)(P.Fragment,{children:[a,c]}),t[7]=a,t[8]=c,t[9]=u):u=t[9],u}function X(e){let t=(0,M.c)(18),{onResolve:n,strandedCommitCount:r}=e,i=f(),a=(0,N.useRef)(!1),o;t[0]===n?o=t[1]:(o=function(){a.current||(a.current=!0,n())},t[0]=n,t[1]=o);let s=o,c;t[2]===s?c=t[3]:(c={onApplied:s},t[2]=s,t[3]=c);let{confirmOpen:l,setConfirmOpen:d,onModeSelect:p,onConfirm:m}=u(i,`off`,c),h=(0,N.useRef)(!1),_,v;t[4]===p?(_=t[5],v=t[6]):(_=()=>{h.current||(h.current=!0,p(`follow`))},v=[p],t[4]=p,t[5]=_,t[6]=v),(0,N.useEffect)(_,v);let y;t[7]!==s||t[8]!==d?(y=e=>{d(e),e||s()},t[7]=s,t[8]=d,t[9]=y):y=t[9];let b;t[10]!==m||t[11]!==s?(b=()=>{m(),s()},t[10]=m,t[11]=s,t[12]=b):b=t[12];let x;return t[13]!==l||t[14]!==r||t[15]!==y||t[16]!==b?(x=(0,P.jsx)(g,{open:l,onOpenChange:y,onConfirm:b,variant:`follow`,strandedCommitCount:r}),t[13]=l,t[14]=r,t[15]=y,t[16]=b,t[17]=x):x=t[17],x}function Z(e){let t=(0,M.c)(89),{nav:n,state:a,onBrowseFolder:s,onOpenRenamed:c,onEnableAutoSync:u,onSyncCompleted:d,onPullApplied:f}=e,{_:m}=i(),h=p(),g=J(h,f),_=n.branch,v;t[0]!==m||t[1]!==n.kind?(v=n.kind===`folder`?m({id:`ugoTXs`}):m({id:`XH30C4`}),t[0]=m,t[1]=n.kind,t[2]=v):v=t[2];let b=v;if(a.phase===`pending`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(x,{className:`size-5`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`c8jBgX`})]}),t[3]=e):e=t[3],e}let{resolution:C}=a,w,T;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,P.jsx)(y,{className:`size-4`,"aria-hidden":`true`}),T=(0,P.jsx)(r,{id:`hItdtk`}),t[4]=w,t[5]=T):(w=t[4],T=t[5]);let E;t[6]===s?E=t[7]:(E=(0,P.jsxs)(o,{variant:`outline`,onClick:s,"data-testid":`share-receive-miss-browse`,children:[w,T]}),t[6]=s,t[7]=E);let D=E,O,N,F,I=null;if(C.verdict===`renamed`){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(S,{className:`size-9`,"aria-hidden":`true`}),t[8]=e):e=t[8],O=e;let n;t[9]!==C.renamedTo||t[10]!==b?(n={0:C.renamedTo,targetNoun:b},t[9]=C.renamedTo,t[10]=b,t[11]=n):n=t[11];let i;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[12]=i):i=t[12];let a;t[13]===n?a=t[14]:(a=(0,P.jsx)(r,{id:`P0HC30`,values:n,components:i}),t[13]=n,t[14]=a),N=a;let s;t[15]!==c||t[16]!==C.renamedTo?(s=()=>c(C.renamedTo),t[15]=c,t[16]=C.renamedTo,t[17]=s):s=t[17];let l,u;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,P.jsx)(S,{className:`size-4`,"aria-hidden":`true`}),u=(0,P.jsx)(r,{id:`AItsE5`}),t[18]=l,t[19]=u):(l=t[18],u=t[19]);let d;t[20]===s?d=t[21]:(d=(0,P.jsxs)(o,{onClick:s,"data-testid":`share-receive-miss-open-renamed`,children:[l,u]}),t[20]=s,t[21]=d);let f;t[22]!==D||t[23]!==d?(f=(0,P.jsxs)(P.Fragment,{children:[d,D]}),t[22]=D,t[23]=d,t[24]=f):f=t[24],F=f}else if(C.verdict===`deleted`){let e;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(j,{className:`size-9`,"aria-hidden":`true`}),t[25]=e):e=t[25],O=e;let n;t[26]!==_||t[27]!==b?(n={targetNoun:b,branch:_},t[26]=_,t[27]=b,t[28]=n):n=t[28];let i;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[29]=i):i=t[29];let a;t[30]===n?a=t[31]:(a=(0,P.jsx)(r,{id:`kpqWwG`,values:n,components:i}),t[30]=n,t[31]=a),N=a,F=D}else if(C.verdict===`never-on-branch`){let e;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(A,{className:`size-9`,"aria-hidden":`true`}),t[32]=e):e=t[32],O=e;let n;t[33]!==_||t[34]!==b?(n={targetNoun:b,branch:_},t[33]=_,t[34]=b,t[35]=n):n=t[35];let i;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[36]=i):i=t[36];let a;t[37]===n?a=t[38]:(a=(0,P.jsx)(r,{id:`i9TPUi`,values:n,components:i}),t[37]=n,t[38]=a),N=a,F=D}else if(C.verdict===`changed-locally`){let e;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(k,{className:`size-9`,"aria-hidden":`true`}),t[39]=e):e=t[39],O=e;let n=h?.syncEnabled===!0,i=h?.pushPermission?.checkStatus===`denied`||!!(h?.pushError||h?.pushErrorCode);if(n){let e;t[40]!==_||t[41]!==b?(e=_===null?(0,P.jsx)(r,{id:`RyIKxy`,values:{targetNoun:b}}):(0,P.jsx)(r,{id:`l6kpzR`,values:{targetNoun:b,branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[40]=_,t[41]=b,t[42]=e):e=t[42],N=e}else{let e;t[43]!==_||t[44]!==b?(e=_===null?(0,P.jsx)(r,{id:`UuYo7g`,values:{targetNoun:b}}):(0,P.jsx)(r,{id:`HoWElC`,values:{targetNoun:b,branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[43]=_,t[44]=b,t[45]=e):e=t[45],N=e}let a=null;if(h?.syncEnabled){if(ee(h)&&!i){let e;t[46]!==d||t[47]!==h?(e=(0,P.jsx)(W,{status:h,onSyncCompleted:d}),t[46]=d,t[47]=h,t[48]=e):e=t[48],a=e}}else if(h!==null){let e;t[49]===u?e=t[50]:(e=(0,P.jsx)(U,{onEnabled:u}),t[49]=u,t[50]=e),a=e}let o;t[51]!==D||t[52]!==a?(o=(0,P.jsxs)(P.Fragment,{children:[a,D]}),t[51]=D,t[52]=a,t[53]=o):o=t[53],F=o}else{let e;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(l,{className:`size-9`,"aria-hidden":`true`}),t[54]=e):e=t[54],O=e;let n;t[55]===h?n=t[56]:(n=q(h),t[55]=h,t[56]=n);let i=n;if(i){let e;t[57]===_?e=t[58]:(e=_===null?(0,P.jsx)(r,{id:`gwEcOD`}):(0,P.jsx)(r,{id:`wvK7Ay`,values:{branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[57]=_,t[58]=e),N=e}else{let e;t[59]===_?e=t[60]:(e=_===null?(0,P.jsx)(r,{id:`Xewl6B`}):(0,P.jsx)(r,{id:`d1JjXo`,values:{branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[59]=_,t[60]=e),N=e}let a=g.failure===null?`sr-only`:`max-w-md text-balance text-1sm text-destructive`,o;t[61]===g.failure?o=t[62]:(o=g.failure===`refused`?(0,P.jsx)(r,{id:`Xp7Kq4`}):g.failure===`error`?(0,P.jsx)(r,{id:`JG_8KT`}):null,t[61]=g.failure,t[62]=o);let s;t[63]!==a||t[64]!==o?(s=(0,P.jsx)(`p`,{role:`alert`,className:a,"data-testid":`share-receive-miss-pull-error`,children:o}),t[63]=a,t[64]=o,t[65]=s):s=t[65],I=s;let c;t[66]!==i||t[67]!==g.pending||t[68]!==g.start?(c=i?(0,P.jsx)(Y,{pending:g.pending,onPull:g.start}):null,t[66]=i,t[67]=g.pending,t[68]=g.start,t[69]=c):c=t[69];let u;t[70]!==g.offering||t[71]!==g.resolveOffer||t[72]!==h?.ahead?(u=g.offering?(0,P.jsx)(X,{onResolve:g.resolveOffer,strandedCommitCount:h?.ahead??0}):null,t[70]=g.offering,t[71]=g.resolveOffer,t[72]=h?.ahead,t[73]=u):u=t[73];let d;t[74]!==D||t[75]!==c||t[76]!==u?(d=(0,P.jsxs)(P.Fragment,{children:[c,D,u]}),t[74]=D,t[75]=c,t[76]=u,t[77]=d):d=t[77],F=d}let L;t[78]===O?L=t[79]:(L=(0,P.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-full border bg-muted/40 text-muted-foreground`,children:O}),t[78]=O,t[79]=L);let R;t[80]===N?R=t[81]:(R=(0,P.jsx)(`p`,{className:`max-w-md text-balance text-base leading-6 text-foreground/90`,children:N}),t[80]=N,t[81]=R);let z;t[82]===F?z=t[83]:(z=(0,P.jsx)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-center`,children:F}),t[82]=F,t[83]=z);let B;return t[84]!==I||t[85]!==L||t[86]!==R||t[87]!==z?(B=(0,P.jsxs)(P.Fragment,{children:[L,R,I,z]}),t[84]=I,t[85]=L,t[86]=R,t[87]=z,t[88]=B):B=t[88],B}function Q(e){return e.replace(/^\/+|\/+$/g,``)}function $(e,t){if(t.kind===`folder`){if(T(e))return Q(t.path)===``;let n=D(e);return n!==null&&Q(n)===Q(t.path)}let n=D(e);return n===null?!1:E(n)===E(t.path)}function te(){let e=null,t=new Set,n=!1;function r(){for(let e of t)e()}function i(t){e!==t&&(e=t,r())}function a(){e!==null&&($(window.location.hash,e)||i(null))}function o(){n||typeof window>`u`||(n=!0,window.addEventListener(`hashchange`,a))}return{arm(e){o(),i(e)},clear(){i(null)},getSnapshot(){return e},subscribe(e){return t.add(e),()=>{t.delete(e)}},dispose(){n&&typeof window<`u`&&(window.removeEventListener(`hashchange`,a),n=!1),i(null)}}}var ne=te();function re(e,t){if(e.contentRootDepth===void 0)return{...e,path:t,repositoryPath:t};let n=(e.repositoryPath??e.path).split(`/`).slice(0,e.contentRootDepth);return{...e,path:t,repositoryPath:[...n,...t===``?[]:t.split(`/`)].join(`/`)}}function ie(e,t){return e===null||e.kind!==`missing`||t===null||E(t.path)!==e.target?null:t}export{B as a,I as c,Z as i,re as n,V as o,ne as r,L as s,ie as t};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{I as n,L as r,N as i}from"./DocumentContext-Dnh6K82B.js";import{t as a}from"./react-f2sANaYj.js";import{r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./utils-CPqDy6Hr.js";import{r as l,t as u}from"./button-Cym3gapE.js";import{c as d,l as f}from"./dist-BcvirUWL.js";import"./separator-C6x7j8mC.js";import{Ha as p,Ja as m,La as h,Ua as g,Va as _,_a as v,ba as y,ca as b,la as x,mt as S,oa as C,qa as ee,sa as w}from"./dist-B09M7HMS.js";import{t as T}from"./dist-Cr4-nBVI.js";import{t as E}from"./workspace-paths-CAsMig07.js";import{t as te}from"./createLucideIcon-BulbvLvN.js";import{B as D,C as O,F as ne,H as re,S as k,f as A,g as ie,h as j,l as M,m as N,p as P,u as F}from"./CodeMirrorPropInput-u4XFoleT.js";import{t as I}from"./x-CteY0nHf.js";var L=e(a(),1),R=t(),z=`Progress`,B=100,[V,ae]=d(z),[H,U]=V(z),W=L.forwardRef((e,t)=>{let{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=q,...o}=e;(i||i===0)&&!oe(i)&&console.error(ce(`${i}`,`Progress`));let s=oe(i)?i:B;r!==null&&!se(r,s)&&console.error(le(`${r}`,`Progress`));let c=se(r,s)?r:null,l=Y(c)?a(c,s):void 0;return(0,R.jsx)(H,{scope:n,value:c,max:s,children:(0,R.jsx)(f.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":Y(c)?c:void 0,"aria-valuetext":l,role:`progressbar`,"data-state":J(c,s),"data-value":c??void 0,"data-max":s,...o,ref:t})})});W.displayName=z;var G=`ProgressIndicator`,K=L.forwardRef((e,t)=>{let{__scopeProgress:n,...r}=e,i=U(G,n);return(0,R.jsx)(f.div,{"data-state":J(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});K.displayName=G;function q(e,t){return`${Math.round(e/t*100)}%`}function J(e,t){return e==null?`indeterminate`:e===t?`complete`:`loading`}function Y(e){return typeof e==`number`}function oe(e){return Y(e)&&!isNaN(e)&&e>0}function se(e,t){return Y(e)&&!isNaN(e)&&e<=t&&e>=0}function ce(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${B}\`.`}function le(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{I as n,L as r,N as i}from"./DocumentContext-CMYNrz-_.js";import{t as a}from"./react-f2sANaYj.js";import{r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./utils-CPqDy6Hr.js";import{r as l,t as u}from"./button-Cym3gapE.js";import{c as d,l as f}from"./dist-BcvirUWL.js";import"./separator-C6x7j8mC.js";import{Ha as p,Ja as m,La as h,Ua as g,Va as _,_a as v,ba as y,ca as b,la as x,mt as S,oa as C,qa as ee,sa as w}from"./dist-B09M7HMS.js";import{t as T}from"./dist-Cr4-nBVI.js";import{t as E}from"./workspace-paths-CAsMig07.js";import{t as te}from"./createLucideIcon-BulbvLvN.js";import{B as D,C as O,F as ne,H as re,S as k,f as A,g as ie,h as j,l as M,m as N,p as P,u as F}from"./CodeMirrorPropInput-Cg5Vd3nt.js";import{t as I}from"./x-CteY0nHf.js";var L=e(a(),1),R=t(),z=`Progress`,B=100,[V,ae]=d(z),[H,U]=V(z),W=L.forwardRef((e,t)=>{let{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=q,...o}=e;(i||i===0)&&!oe(i)&&console.error(ce(`${i}`,`Progress`));let s=oe(i)?i:B;r!==null&&!se(r,s)&&console.error(le(`${r}`,`Progress`));let c=se(r,s)?r:null,l=Y(c)?a(c,s):void 0;return(0,R.jsx)(H,{scope:n,value:c,max:s,children:(0,R.jsx)(f.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":Y(c)?c:void 0,"aria-valuetext":l,role:`progressbar`,"data-state":J(c,s),"data-value":c??void 0,"data-max":s,...o,ref:t})})});W.displayName=z;var G=`ProgressIndicator`,K=L.forwardRef((e,t)=>{let{__scopeProgress:n,...r}=e,i=U(G,n);return(0,R.jsx)(f.div,{"data-state":J(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});K.displayName=G;function q(e,t){return`${Math.round(e/t*100)}%`}function J(e,t){return e==null?`indeterminate`:e===t?`complete`:`loading`}function Y(e){return typeof e==`number`}function oe(e){return Y(e)&&!isNaN(e)&&e>0}function se(e,t){return Y(e)&&!isNaN(e)&&e<=t&&e>=0}function ce(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${B}\`.`}function le(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
2
2
  - a positive number
3
3
  - less than the value passed to \`max\` (or ${B} if no \`max\` prop is set)
4
4
  - \`null\` or \`undefined\` if the progress is indeterminate.
@@ -1,4 +1,4 @@
1
- import{Y as e}from"./DocumentContext-Dnh6K82B.js";import{W as t}from"./CodeMirrorPropInput-u4XFoleT.js";function n(n){let r=e(n.state.selection.content(),n.state.schema);return t().serialize(r).trim()}function r(e){return e.lineCount===1&&e.charLen<100?{kind:`inline`,markdown:e.markdown}:e.surface===`source`&&e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?{kind:`lines`,startLine:e.sourceLineStart,endLine:e.sourceLineEnd}:{kind:`anchor`,markdown:e.markdown}}function i(e,t){return e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?`${t} (${e.sourceLineStart===e.sourceLineEnd?`${e.sourceLineStart}`:`${e.sourceLineStart}-${e.sourceLineEnd}`})`:e.lineCount>1?`${t} (${e.lineCount} lines)`:`${t} (selection)`}function a(e){let t=e.replace(/\r\n/g,`
1
+ import{Y as e}from"./DocumentContext-CMYNrz-_.js";import{W as t}from"./CodeMirrorPropInput-Cg5Vd3nt.js";function n(n){let r=e(n.state.selection.content(),n.state.schema);return t().serialize(r).trim()}function r(e){return e.lineCount===1&&e.charLen<100?{kind:`inline`,markdown:e.markdown}:e.surface===`source`&&e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?{kind:`lines`,startLine:e.sourceLineStart,endLine:e.sourceLineEnd}:{kind:`anchor`,markdown:e.markdown}}function i(e,t){return e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?`${t} (${e.sourceLineStart===e.sourceLineEnd?`${e.sourceLineStart}`:`${e.sourceLineStart}-${e.sourceLineEnd}`})`:e.lineCount>1?`${t} (${e.lineCount} lines)`:`${t} (selection)`}function a(e){let t=e.replace(/\r\n/g,`
2
2
  `).split(`
3
3
  `),n=[],r=!1;for(let e of t){let t=e.trim();if(/^(```|~~~)/.test(t)){r||n.push(`code`),r=!r;continue}if(r||t===``)continue;if(/^\|.*\|?$/.test(t)&&t.includes(`|`)){n[n.length-1]!==`table`&&n.push(`table`);continue}if(/^<\/?[A-Za-z]/.test(t)){n[n.length-1]!==`component`&&n.push(`component`);continue}let i=t.match(/^#{1,6}\s+(.*)$/);if(i){n.push(i[1]??``);continue}let a=t.match(/^[-*+]\s+(.*)$/);if(a){n.push(`• ${a[1]??``}`);continue}let o=t.match(/^\d+\.\s+(.*)$/);if(o){n.push(`• ${o[1]??``}`);continue}let s=t.match(/^>\s?(.*)$/);if(s){n.push(s[1]??``);continue}n.push(t)}return n.join(` `).replace(/\s+/g,` `).trim()}var o=new Map,s=new Set,c=(e,t)=>`${t}:${e}`;function l(){for(let e of s)e()}function u(e,t){return e.markdown===t.markdown&&e.sourceLineStart===t.sourceLineStart&&e.sourceLineEnd===t.sourceLineEnd}function d(e,t,n){let r=c(e,t);if(n===null){o.delete(r)&&l();return}let i=o.get(r);i&&u(i,n)||(o.set(r,n),l())}function f(e,t){return e===null?null:o.get(c(e,t))??null}function p(e){return s.add(e),()=>{s.delete(e)}}function m(e,t){if(e.state.selection.empty)return null;let r=n(e);return r.trim()?{surface:`wysiwyg`,docName:t,markdown:r,charLen:r.trim().length,lineCount:(r.match(/\n/g)?.length??0)+1}:null}function h(e,t){return e.trim()?{surface:`frontmatter`,docName:t,markdown:e,charLen:e.trim().length,lineCount:(e.match(/\n/g)?.length??0)+1}:null}function g(e,t){let n=[],r=1/0,i=-1;for(let t of e.state.selection.ranges)t.empty||(n.push(e.state.sliceDoc(t.from,t.to)),r=Math.min(r,t.from),i=Math.max(i,t.to));if(n.length===0)return null;let a=n.join(`
4
4
  `);if(!a.trim())return null;let o=e.state.doc.lineAt(r).number,s=e.state.doc.lineAt(i).number;return{surface:`source`,docName:t,markdown:a,charLen:a.trim().length,lineCount:s-o+1,sourceLineStart:o,sourceLineEnd:s}}export{h as a,r as c,i,p as l,a as n,g as o,d as r,m as s,f as t};
@@ -1,2 +1,2 @@
1
- import{yt as e}from"./CodeMirrorPropInput-u4XFoleT.js";import{C as t,D as n,E as r,G as i,L as a,S as o,U as s,W as c,g as l,it as u,rt as d}from"./config-provider-BKNG21ZO.js";import{$ as f,At as p,Ct as m,Nt as h,Ot as g,Y as _,Z as v,et as y}from"./dist-AlieiJjD.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:a(this.yanchor),yhead:a(this.yhead)}}static fromJSON(t){return new e(r(t.yanchor),r(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new l(e)}toYPos(e,t=0){return n(this.ytext,e,t)}fromYPos(e){let n=t(r(e),this.ytext.doc);if(n==null||n.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:n.index,assoc:n.assoc}}toYRange(e){let t=e.assoc;return new b(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?g.cursor(n.pos,n.assoc):g.range(t.pos,n.pos)}},S=p.define({combine(e){return e[e.length-1]}}),C=m.define(),w=class{constructor(e){this.view=e,this.conf=e.state.facet(S),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[C.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(C)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
1
+ import{yt as e}from"./CodeMirrorPropInput-Cg5Vd3nt.js";import{C as t,D as n,E as r,G as i,L as a,S as o,U as s,W as c,g as l,it as u,rt as d}from"./config-provider-Flf2Xj2j.js";import{$ as f,At as p,Ct as m,Nt as h,Ot as g,Y as _,Z as v,et as y}from"./dist-AlieiJjD.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:a(this.yanchor),yhead:a(this.yhead)}}static fromJSON(t){return new e(r(t.yanchor),r(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new l(e)}toYPos(e,t=0){return n(this.ytext,e,t)}fromYPos(e){let n=t(r(e),this.ytext.doc);if(n==null||n.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:n.index,assoc:n.assoc}}toYRange(e){let t=e.assoc;return new b(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?g.cursor(n.pos,n.assoc):g.range(t.pos,n.pos)}},S=p.define({combine(e){return e[e.length-1]}}),C=m.define(),w=class{constructor(e){this.view=e,this.conf=e.state.facet(S),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[C.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(C)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
2
2
  `);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},T=f.fromClass(w),E=v.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),D=m.define(),O=class extends y{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return s(`span`,[i(`class`,`cm-ySelectionCaret`),i(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[c(`⁠`),s(`div`,[i(`class`,`cm-ySelectionCaretDot`)]),c(`⁠`),s(`div`,[i(`class`,`cm-ySelectionInfo`)],[c(this.name)]),c(`⁠`)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},k=class{constructor(e){this.conf=e.state.facet(S),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[D.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=h.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let i=this.conf.ytext,a=i.doc,s=this.conf.awareness,c=[],l=this.conf.awareness.getLocalState();if(l!=null){let t=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),a=t?e.state.selection.main:null,c=l.cursor==null?null:r(l.cursor.anchor),u=l.cursor==null?null:r(l.cursor.head);if(a!=null){let e=n(i,a.anchor),t=n(i,a.head);(l.cursor==null||!o(c,e)||!o(u,t))&&s.setLocalStateField(`cursor`,{anchor:e,head:t})}else l.cursor!=null&&t&&s.setLocalStateField(`cursor`,null)}s.getStates().forEach((n,r)=>{if(r===s.doc.clientID)return;let o=n.cursor;if(o==null||o.anchor==null||o.head==null)return;let l=t(o.anchor,a),f=t(o.head,a);if(l==null||f==null||l.type!==i||f.type!==i)return;let{color:p=`#30bced`,name:m=`Anonymous`}=n.user||{},h=n.user&&n.user.colorLight||p+`33`,g=u(l.index,f.index),v=d(l.index,f.index),y=e.view.state.doc.lineAt(g),b=e.view.state.doc.lineAt(v);if(y.number===b.number)c.push({from:g,to:v,value:_.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})});else{c.push({from:g,to:y.from+y.length,value:_.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})}),c.push({from:b.from,to:v,value:_.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})});for(let t=y.number+1;t<b.number;t++){let n=e.view.state.doc.line(t).from;c.push({from:n,to:n,value:_.line({attributes:{style:`background-color: ${h}`,class:`cm-yLineSelection`}})})}}c.push({from:f.index,to:f.index,value:_.widget({side:f.index-l.index>0?-1:1,block:!1,widget:new O(p,m)})})}),this.decorations=_.set(c,!0)}},A=f.fromClass(k,{decorations:e=>e.decorations}),j=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},M=p.define({combine(e){return e[e.length-1]}});m.define();var N=class{constructor(t){this.view=t,this.conf=t.state.facet(M),this._undoManager=this.conf.undoManager,this.syncConf=t.state.facet(S),this._beforeChangeSelection=null,this._mux=e(),this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:e})=>{let n=e.meta.get(this);if(n){let e=this.syncConf.fromYRange(n);t.dispatch(t.state.update({selection:e,effects:[v.scrollIntoView(e)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(C)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},P=f.fromClass(N),F=({state:e,dispatch:t})=>e.facet(M).undo()||!0,I=({state:e,dispatch:t})=>e.facet(M).redo()||!0,L=[{key:`Mod-z`,run:F,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:I,preventDefault:!0},{key:`Mod-Shift-z`,run:I,preventDefault:!0}],R=(e,t,{undoManager:n=new l(e)}={})=>{let r=new x(e,t),i=[S.of(r),T];return t&&i.push(E,A),n!==!1&&i.push(M.of(new j(n)),P,v.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?F(t):e.inputType===`historyRedo`?I(t):!1}})),i};export{L as n,R as t};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./__vite-browser-external-Djp1xigf.js","./chunk-CYidjpOJ.js"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{a as n,c as r,d as i,f as a,i as o,l as s,n as c,o as l,p as u,r as d,t as f,u as p}from"./trace-api-BP9dN1Hz.js";import{n as ee,t as m}from"./propagation-api-DC5404fy.js";import{t as h}from"./context-api-dUnlgSJr.js";var te=class{constructor(){}createGauge(e,t){return fe}createHistogram(e,t){return pe}createCounter(e,t){return de}createUpDownCounter(e,t){return me}createObservableGauge(e,t){return ge}createObservableCounter(e,t){return he}createObservableUpDownCounter(e,t){return _e}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},g=class{},ne=class extends g{add(e,t){}},re=class extends g{add(e,t){}},ie=class extends g{record(e,t){}},ae=class extends g{record(e,t){}},oe=class{addCallback(e){}removeCallback(e){}},se=class extends oe{},ce=class extends oe{},le=class extends oe{},ue=new te,de=new ne,fe=new ie,pe=new ae,me=new re,he=new se,ge=new ce,_e=new le;function ve(){return ue}var ye;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(ye||={});var be;(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`})(be||={});var _=p.instance(),xe=new class{getMeter(e,t,n){return ue}},Se=`metrics`,Ce=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return a(Se,e,p.instance())}getMeterProvider(){return i(Se)||xe}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){u(Se,p.instance())}}.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()}},Te=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}};function Ee(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function De(e){if(e!=null)return()=>e}function Oe(e,t,n){return{timeoutMillis:Ee(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function ke(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}var Ae=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 je(e){return new Ae(e.concurrencyLimit)}var Me=s(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function Ne(e){return e.setValue(Me,!0)}function Pe(e){return e.getValue(Me)===!0}var Fe=`baggage`,Ie=4096;function Le(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function Re(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 ze(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,s;try{o=decodeURIComponent(i),s=decodeURIComponent(a)}catch{return}let c;return t!==-1&&t<e.length-1&&(c=ee(e.substring(t+1))),{key:o,value:s,metadata:c}}function Be(e,t,n,r){let i=0;for(;i<e.length&&n<180;){let a=e.indexOf(`,`,i),o=a===-1?e.length:a,s=o-i;if(s<=4096){let a=ze(e.substring(i,o));if(a){let e=(n===0?0:1)+s;if(r+e>8192)break;t[a.key]=a.metadata?{value:a.value,metadata:a.metadata}:{value:a.value},n++,r+=e}}if(a===-1)break;i=a+1}return[n,r]}var Ve=class{inject(e,t,n){let r=m.getBaggage(e);if(!r||Pe(e))return;let i=Le(Re(r).filter(e=>e.length<=Ie).slice(0,180));i.length>0&&n.set(t,Fe,i)}extract(e,t,n){let r=n.get(t,Fe);if(!r)return e;let i={},a=0,o=0;if(Array.isArray(r))for(let e=0;e<r.length;e++)[a,o]=Be(r[e],i,a,o);else [a]=Be(r,i,a,o);return a===0?e:m.setBaggage(e,m.createBaggage(i))}fields(){return[Fe]}};function v(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!He(n)){_.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Ue(r)){_.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function He(e){return typeof e==`string`&&e!==``}function Ue(e){return e==null?!0:Array.isArray(e)?We(e):Ge(typeof e)}function We(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Ge(e)){t=e;continue}return!1}return!1}}return!0}function Ge(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Ke(){return e=>{_.error(qe(e))}}function qe(e){return typeof e==`string`?e:JSON.stringify(Je(e))}function Je(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 Ye=Ke();function y(e){try{Ye(e)}catch{}}var Xe=globalThis,Ze=`2.8.0`,Qe=`http.url`,$e=`http.user_agent`,et=Qe,tt=$e,nt=`deployment.environment.name`,rt=`error.type`,it=`exception.message`,at=`exception.stacktrace`,ot=`exception.type`,st=`http.request.method`,ct=`http.request.method_original`,lt=`http.response.status_code`,ut=`server.address`,dt=`server.port`,ft=`service.name`,pt=`service.version`,mt=`telemetry.sdk.language`,ht=`webjs`,gt=`telemetry.sdk.name`,_t=`telemetry.sdk.version`,vt=`url.full`,yt=`process.runtime.name`,bt={[gt]:`opentelemetry`,[yt]:`browser`,[mt]:ht,[_t]:Ze},b=performance,xt=9,St=10**6,x=10**xt;function S(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*St)]}function C(e){return Et(S(b.timeOrigin),S(typeof e==`number`?e:b.now()))}function w(e){if(wt(e))return e;if(typeof e==`number`)return e<b.timeOrigin?C(e):S(e);if(e instanceof Date)return S(e.getTime());throw TypeError(`Invalid input type`)}function Ct(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=x),[n,r]}function T(e){return e[0]*x+e[1]}function wt(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function Tt(e){return wt(e)||typeof e==`number`||e instanceof Date}function Et(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=x&&(n[1]-=x,n[0]+=1),n}var E;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(E||={});var Dt=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];let t=new Set;for(let e of this._propagators){let n=typeof e.fields==`function`?e.fields():[];for(let e of n)t.add(e)}this._fields=Array.from(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()}},Ot=`[_0-9a-z-*/]`,kt=`[a-z]${Ot}{0,255}`,At=`[a-z0-9]${Ot}{0,240}@[a-z]${Ot}{0,13}`,jt=RegExp(`^(?:${kt}|${At})$`),Mt=/^[ -~]{0,255}[!-~]$/,Nt=/,|=/;function Pt(e){return jt.test(e)}function Ft(e){return Mt.test(e)&&!Nt.test(e)}var It=32,Lt=512,Rt=`,`,zt=`=`,Bt=class e{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!Pt(e)||!Ft(t))return this;let n=this._getState(),r=n.get(e),i=this._length;if(typeof r==`string`?i+=t.length-r.length:i+=e.length+t.length+(n.size>0?2:1),i>Lt)return this;let a=new Map(n);return a.delete(e),a.set(e,t),this._fromState(a,i)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=Rt+e),e=`${n[0]}${zt}${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(Rt),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(zt);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!Pt(a)||!Ft(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>Lt)&&(t.set(a,o),n=s,t.size>=It))break}return this._length=n,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}},D=`traceparent`,Vt=`tracestate`,Ht=`00`,Ut=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function Wt(e){let t=Ut.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Gt=class{inject(e,t,n){let r=f.getSpanContext(e);if(!r||Pe(e)||!d(r))return;let i=`${Ht}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||l.NONE).toString(16)}`;n.set(t,D,i),r.traceState&&n.set(t,Vt,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,D);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=Wt(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,Vt);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new Bt(typeof e==`string`?e:void 0)}return f.setSpanContext(e,a)}fields(){return[D,Vt]}},Kt=`[object Object]`,qt=`[object Null]`,Jt=`[object Undefined]`,Yt=Function.prototype.toString,Xt=Yt.call(Object),Zt=Object.getPrototypeOf,Qt=Object.prototype,$t=Qt.hasOwnProperty,O=Symbol?Symbol.toStringTag:void 0,en=Qt.toString;function tn(e){if(!nn(e)||rn(e)!==Kt)return!1;let t=Zt(e);if(t===null)return!0;let n=$t.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Yt.call(n)===Xt}function nn(e){return typeof e==`object`&&!!e}function rn(e){return e==null?e===void 0?Jt:qt:O&&O in Object(e)?an(e):on(e)}function an(e){let t=$t.call(e,O),n=e[O],r=!1;try{e[O]=void 0,r=!0}catch{}let i=en.call(e);return r&&(t?e[O]=n:delete e[O]),i}function on(e){return en.call(e)}var sn=20;function cn(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=un(t,e.shift(),0,n);return t}function ln(e){return k(e)?e.slice():e}function un(e,t,n=0,r){let i;if(!(n>sn)){if(n++,pn(e)||pn(t)||fn(t))i=ln(t);else if(k(e)){if(i=e.slice(),k(t))for(let e=0,n=t.length;e<n;e++)i.push(ln(t[e]));else if(A(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]=ln(t[r]))}}}else if(A(e))if(A(t)){if(!mn(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(pn(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(dn(e,s,r)||dn(t,s,r))delete i[s];else{if(A(a)&&A(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]=un(i[s],c,n,r)}}}}else i=t;return i}}function dn(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 k(e){return Array.isArray(e)}function fn(e){return typeof e==`function`}function A(e){return!pn(e)&&!k(e)&&!fn(e)&&typeof e==`object`}function pn(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function mn(e,t){return!(!tn(e)||!tn(t))}function hn(e,t){return typeof t==`string`?e===t:!!e.match(t)}function gn(e,t){if(!t)return!1;for(let n of t)if(hn(e,n))return!0;return!1}var _n=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)}},vn=class{_isCalled=!1;_deferred=new _n;_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}};function yn(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function bn(){return{handleResponse(e){e==null||!yn(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||_.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var xn=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:E.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:E.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:E.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:E.FAILED,error:e.error});return}else e.status===`retryable`?t({code:E.FAILED,error:new Te(`Export failed with retryable status`)}):t({code:E.FAILED,error:new Te(`Export failed with unknown error`)})},e=>t({code:E.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}};function Sn(e,t){return new xn(e.transport,e.serializer,bn(),e.promiseHandler,t.timeout)}function Cn(e,t,n){return Sn({transport:n,serializer:t,promiseHandler:je(e)},{timeout:e.timeoutMillis})}function wn(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function Tn(e){let t=new Uint8Array(e.length/2),n=0;for(let r=0;r<e.length;r+=2){let i=wn(e.charCodeAt(r)),a=wn(e.charCodeAt(r+1));t[n++]=i<<4|a}return t}function En(e){let t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}function Dn(e){return{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}function On(e){return Dn(En(e))}function kn(e){return En(e).toString()}var An=typeof BigInt<`u`?kn:T;function jn(e){return e}function Mn(e){if(e!==void 0)return Tn(e)}var Nn={encodeHrTime:On,encodeSpanContext:Tn,encodeOptionalSpanContext:Mn};function Pn(e){if(e===void 0)return Nn;let t=e.useLongBits??!0,n=e.useHex??!1;return{encodeHrTime:t?On:An,encodeSpanContext:n?jn:Tn,encodeOptionalSpanContext:n?jn:Mn}}function Fn(e){let t={attributes:Ln(e.attributes),droppedAttributesCount:0},n=e.schemaUrl;return n&&n!==``&&(t.schemaUrl=n),t}function In(e){return{name:e.name,version:e.version}}function Ln(e){return Object.keys(e).map(t=>Rn(t,e[t]))}function Rn(e,t){return{key:e,value:zn(t)}}function zn(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(zn)}}:t===`object`&&e!=null?{kvlistValue:{values:Object.entries(e).map(([e,t])=>Rn(e,t))}}:{}}function Bn(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:Ln(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>Hn(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>Vn(e,t)),droppedLinksCount:e.droppedLinksCount}}function Vn(e,t){return{attributes:e.attributes?Ln(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}function Hn(e,t){return{attributes:e.attributes?Ln(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Un(e,t){return{resourceSpans:Gn(e,Pn(t))}}function Wn(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 Gn(e,t){let n=Wn(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=>Bn(e,t));o.push({scope:In(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=Fn(e),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}var Kn={serializeRequest:e=>{let t=Un(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))}},qn=5,Jn=1e3,Yn=5e3,Xn=1.5,Zn=.2;function Qn(){return 2*Zn*Math.random()-Zn}var $n=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=qn,a=Jn;for(;r.status===`retryable`&&i>0;){i--;let t=Math.max(Math.min(a,Yn)+Qn(),0);a*=Xn;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 er(e){return new $n(e.transport)}function tr(e){return[429,502,503,504].includes(e)}function nr(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 rr=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&&tr(r.status)?n({status:`retryable`,retryInMillis:nr(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 ir(e){return new rr(e)}var ar=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 or(e){return new ar(e)}var sr=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`}):tr(i.status)?{status:`retryable`,retryInMillis:nr(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 cr(e){return new sr(e)}function lr(e,t){return Cn(e,t,er({transport:ir(e)}))}function ur(e,t){return Cn(e,t,er({transport:cr(e)}))}function dr(e,t){return Cn(e,t,er({transport:or({url:e.url,blobType:e.headers()[`Content-Type`]})}))}function fr(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 pr(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 mr(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 hr(n){return async r=>{let{Agent:i}=await t(()=>import(`./__vite-browser-external-Djp1xigf.js`).then(t=>e(t.default)),__vite__mapDeps([0,1]),import.meta.url);return new i(n)}}function gr(e,t,n){return{...Oe(e,t,n),headers:pr(fr(e.headers),t.headers,n.headers),url:mr(e.url)??t.url??n.url,agentFactory:e.agentFactory??t.agentFactory??n.agentFactory}}function _r(e,t){return{...ke(),headers:()=>e,url:`http://localhost:4318/`+t,agentFactory:hr({keepAlive:!0})}}function vr(e,t,n){return gr({url:e.url,timeoutMillis:e.timeoutMillis,headers:De(e.headers),concurrencyLimit:e.concurrencyLimit},{},_r(n,t))}function yr(e,t,n,r){return br(e.headers)(vr(e,n,r),t)}function br(e){return!e&&typeof navigator.sendBeacon==`function`?dr:globalThis.fetch===void 0?lr:ur}var xr=class extends we{constructor(e={}){super(yr(e,Kn,`v1/traces`,{"Content-Type":`application/json`}))}},Sr=class{emit(e){}},Cr=new Sr,wr=new class{getLogger(e,t,n){return new Sr}},Tr=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):Cr}},Er=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new Tr(this,e,t,n)}_getDelegate(){return this._delegate??wr}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}},Dr=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},j=Symbol.for(`io.opentelemetry.js.api.logs`),M=Dr;function Or(e,t,n){return r=>r===e?t:n}var kr=class e{constructor(){this._proxyLoggerProvider=new Er}static getInstance(){return this._instance||=new e,this._instance}setGlobalLoggerProvider(e){return M[j]?this.getLoggerProvider():(M[j]=Or(1,e,wr),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return M[j]?.call(M,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete M[j],this._proxyLoggerProvider=new Er}}.getInstance();function Ar(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 jr(e){e.forEach(e=>e.disable())}function Mr(e){let t=e.tracerProvider||f.getTracerProvider(),n=e.meterProvider||Ce.getMeterProvider(),r=e.loggerProvider||kr.getLoggerProvider(),i=e.instrumentations?.flat()??[];return Ar(i,t,n,r),()=>{jr(i)}}var N=console.error.bind(console);function P(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 Nr=(e,t,n)=>{if(!e||!e[t]){N(`no original function `+String(t)+` to wrap`);return}if(!n){N(`no wrapper function`),N(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){N(`original object and wrapper must be functions`);return}let i=n(r,t);return P(i,`__original`,r),P(i,`__unwrap`,()=>{e[t]===i&&P(e,t,r)}),P(i,`__wrapped`,!0),P(e,t,i),i},Pr=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{N(`must provide one or more modules to patch`),N(Error().stack);return}if(!(t&&Array.isArray(t))){N(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Nr(e,t,n)})})},Fr=(e,t)=>{if(!e||!e[t]){N(`no function to unwrap.`),N(Error().stack);return}let n=e[t];if(!n.__unwrap)N(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},Ir=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{N(`must provide one or more modules to patch`),N(Error().stack);return}if(!(t&&Array.isArray(t))){N(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Fr(e,t)})})};function F(e){e&&e.logger&&(typeof e.logger==`function`?N=e.logger:N(`new logger isn't a function, not replacing`))}F.wrap=Nr,F.massWrap=Pr,F.unwrap=Fr,F.massUnwrap=Ir;var Lr=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=f.getTracer(e,t),this._meter=Ce.getMeter(e,t),this._logger=kr.getLogger(e,t),this._updateMetricInstruments()}_wrap=Nr;_unwrap=Fr;_massWrap=Pr;_massUnwrap=Ir;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)}}},Rr=class extends Lr{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function I(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 L(e){return typeof e==`function`&&typeof e.__original==`function`&&typeof e.__unwrap==`function`&&e.__wrapped===!0}var R;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(R||={});function zr(e,t){let n=R.OLD,r=t?.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r??[])if(t.toLowerCase()===e+`/dup`){n=R.DUPLICATE;break}else t.toLowerCase()===e&&(n=R.STABLE);return n}var z;function Br(){if(z===void 0)try{let e=globalThis.process.argv0;z=e?`unknown_service:${e}`:`unknown_service`}catch{z=`unknown_service`}return z}var B=e=>typeof e==`object`&&!!e&&typeof e.then==`function`,Vr=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=Wr(t),r._asyncAttributesPending=t.filter(([e,t])=>B(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(B(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Wr(this._rawAttributes),this._schemaUrl=Gr(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,B(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(B(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=Kr(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function Hr(e,t){return Vr.FromAttributeList(Object.entries(e),t)}function Ur(){return Hr({[ft]:Br(),[mt]:bt[mt],[gt]:bt[gt],[_t]:bt[_t]})}function Wr(e){return e.map(([e,t])=>B(t)?[e,t.catch(t=>{_.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Gr(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 Kr(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 qr=`exception`,Jr=Symbol.for(`nodejs.util.inspect.custom`);function Yr(e){let t={};for(let[n,r]of e.getRawAttributes())typeof r?.then!=`function`&&r!=null&&(t[n]??=r);return t}function Xr(e,t,n,r,i){if(typeof n==`number`&&n<0){let t=`[${e}]`;return r?.stylize?r.stylize(t,`special`):t}return typeof i!=`function`||!r?t:`${e} ${i(t,{...r,depth:r.depth==null?r.depth:r.depth-1})}`}var Zr=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:c.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=b.now(),this._performanceOffset=t-(this._performanceStartTime+b.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(!Ue(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++),Tt(t)&&(Tt(n)||(n=t),t=void 0);let i=v(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=v(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===c.UNSET||this.status.code===c.OK)return this;let t={code:e.code};return e.code===c.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=Ct(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<=b.now())return C(e+this._performanceOffset);if(typeof e==`number`)return S(e);if(e instanceof Date)return S(e.getTime());if(wt(e))return e;if(this._startTimeProvided)return S(Date.now());let t=b.now()-this._performanceStartTime;return Et(this.startTime,S(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[it]=e:e&&(e.code?n[ot]=e.code.toString():e.name&&(n[ot]=e.name),e.message&&(n[it]=e.message),e.stack&&(n[at]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(qr,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}[Jr](e,t,n){return Xr(`SpanImpl`,{name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:Yr(this.resource)}},e,t,n)}},V;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(V||={});var Qr=`otel.component.name`,$r=`otel.component.type`,ei=`otel.span.parent.origin`,ti=`otel.span.sampling_result`,ni=`otel.sdk.processor.span.processed`,ri=`otel.sdk.processor.span.queue.capacity`,ii=`otel.sdk.processor.span.queue.size`,ai=`otel.sdk.span.live`,oi=`otel.sdk.span.started`,si=`batching_span_processor`,ci=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(oi,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(ai,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=ui(t);if(this.startedSpans.add(1,{[ei]:li(e),[ti]:n}),t===V.NOT_RECORD)return()=>{};let r={[ti]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function li(e){return e?e.isRemote?`remote`:`local`:`none`}function ui(e){switch(e){case V.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case V.RECORD:return`RECORD_ONLY`;case V.NOT_RECORD:return`DROP`}}var di=`2.9.0`,fi=class{_sampler;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t){this.instrumentationScope=e,this._sampler=t.sampler,this._spanLimits=t.spanLimits,this._resource=t.resource,this._idGenerator=t.idGenerator,this._spanProcessor=t.spanProcessor,this._tracerMetrics=new ci(t.meterProvider.getMeter(`@opentelemetry/sdk-trace`,di))}startSpan(e,t={},r=h.active()){t.root&&(r=f.deleteSpan(r));let i=f.getSpan(r);if(Pe(r))return _.debug(`Instrumentation suppressed, returning Noop Span`),f.wrapSpanContext(n);let a=i?.spanContext(),o=this._idGenerator.generateSpanId(),s,c,u;!a||!f.isSpanContextValid(a)?c=this._idGenerator.generateTraceId():(c=a.traceId,u=a.traceState,s=a);let d=t.kind??be.INTERNAL,p=(t.links??[]).map(e=>({context:e.context,attributes:v(e.attributes)})),ee=v(t.attributes),m=this._sampler.shouldSample(r,c,e,d,ee,p),te=this._tracerMetrics.startSpan(a,m.decision);u=m.traceState??u;let g=m.decision===ye.RECORD_AND_SAMPLED?l.SAMPLED:l.NONE,ne={traceId:c,spanId:o,traceFlags:g,traceState:u};if(m.decision===ye.NOT_RECORD)return _.debug(`Recording is off, propagating context in a non-recording span`),f.wrapSpanContext(ne);let re=v(Object.assign(ee,m.attributes));return new Zr({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:ne,name:e,kind:d,links:p,parentSpanContext:s,attributes:re,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:te})}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??h.active(),c=this.startSpan(e,i,s),l=f.setSpan(s,c);return h.with(l,o,void 0,c)}[Jr](e,t,n){return Xr(`Tracer`,{instrumentationScope:this.instrumentationScope,resource:{attributes:Yr(this._resource)},spanLimits:this._spanLimits},e,t,n)}},pi=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=>{y(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)})}},H=class{shouldSample(){return{decision:V.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},U=class{shouldSample(){return{decision:V.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},W=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(y(Error(`ParentBasedSampler must have a root sampler configured`)),new U),this._remoteParentSampled=e.remoteParentSampled??new U,this._remoteParentNotSampled=e.remoteParentNotSampled??new H,this._localParentSampled=e.localParentSampled??new U,this._localParentNotSampled=e.localParentNotSampled??new H}shouldSample(e,t,n,r,i,a){let o=f.getSpanContext(e);return!o||!d(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&l.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&l.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=new Map,hi=class{processedSpans;queueSize;queueSizeCallback;standardAttrs;droppedAttrs;constructor(e,t,n){let r=mi.get(e)??0;if(mi.set(e,r+1),this.standardAttrs={[$r]:e,[Qr]:`${e}/${r}`},this.droppedAttrs={...this.standardAttrs,[rt]:`queue_full`},this.processedSpans=t.createCounter(ni,{unit:`{span}`,description:`The number of spans for which the processing has finished, either successful or failed.`}),n){let{capacity:e,getQueueSize:r}=n;t.createUpDownCounter(ri,{unit:`{span}`,description:`The maximum number of spans the queue of a given instance of an SDK span processor can hold.`}).add(e,this.standardAttrs),this.queueSize=t.createObservableUpDownCounter(ii,{unit:`{span}`,description:`The number of spans in the queue of a given instance of an SDK span processor.`}),this.queueSizeCallback=e=>e.observe(r(),this.standardAttrs),this.queueSize.addCallback(this.queueSizeCallback)}}dropSpans(e){this.processedSpans.add(e,this.droppedAttrs)}finishSpans(e,t){if(!t){this.processedSpans.add(e,this.standardAttrs);return}let n={...this.standardAttrs,[rt]:t.name};this.processedSpans.add(e,n)}shutdown(){this.queueSize&&this.queueSizeCallback&&this.queueSize.removeCallback(this.queueSizeCallback)}},gi=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_metrics;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e){this._exporter=e.exporter,this._maxExportBatchSize=e.maxExportBatchSize??512,this._maxQueueSize=e.maxQueueSize??2048,this._scheduledDelayMillis=e.scheduledDelayMillis??5e3,this._exportTimeoutMillis=e.exportTimeoutMillis??3e4,this._shutdownOnce=new vn(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),this._metrics=new hi(si,e.selfObsMeterProvider?e.selfObsMeterProvider.getMeter(`@opentelemetry/sdk-trace`):ve(),{capacity:this._maxQueueSize,getQueueSize:()=>this._finishedSpans.length})}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&l.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>(this._metrics.shutdown(),this._exporter.shutdown()))}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&_.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++,this._metrics.dropSpans(1);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);h.with(Ne(h.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,i=>{clearTimeout(n),this._metrics.finishSpans(r.length,i.error),i.code===E.SUCCESS?e():t(i.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=>{y(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,y(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)}},_i=class extends gi{_visibilityChangeListener;_pageHideListener;constructor(e){super(e),this.onInit(e)}onInit(e){e.disableAutoFlushOnDocumentHide!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{y(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{y(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))}},vi=16,yi=8,bi=new Uint8Array(vi),xi=new Uint8Array(yi),Si=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Ci(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 wi(e){let t=``;for(let n=0;n<e.length;n++)t+=Si[e[n]];return t}var Ti=class{generateTraceId(){return Ci(bi),wi(bi)}generateSpanId(){return Ci(xi),wi(xi)}},G;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(G||={});var Ei=class{_resource;_activeSpanProcessor;_forceFlushTimeoutMillis;_tracerOptions;_tracers=new Map;constructor(e={}){this._forceFlushTimeoutMillis=e.forceFlushTimeoutMillis??3e4,this._resource=e.resource??Ur(),this._activeSpanProcessor=new pi(e.spanProcessors??[]),this._tracerOptions={resource:this._resource,sampler:e.sampler??new W({root:new U}),spanLimits:{attributeCountLimit:e.spanLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.spanLimits?.attributeValueLengthLimit??1/0,eventCountLimit:e.spanLimits?.eventCountLimit??128,linkCountLimit:e.spanLimits?.linkCountLimit??128,attributePerEventCountLimit:e.spanLimits?.attributePerEventCountLimit??128,attributePerLinkCountLimit:e.spanLimits?.attributePerLinkCountLimit??128},idGenerator:e.idGenerator||new Ti,spanProcessor:this._activeSpanProcessor,meterProvider:e.meterProvider??{getMeter(){return ve()}}}}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new fi({name:e,version:t,schemaUrl:n?.schemaUrl},this._tracerOptions)),this._tracers.get(r)}forceFlush(){let e=this._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=G.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==G.timeout&&(r=G.resolved,n(r))}).catch(e=>{clearTimeout(i),r=G.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==G.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}[Jr](e,t,n){let r=this._activeSpanProcessor._spanProcessors;return Xr(`TracerProvider`,{resource:{attributes:Yr(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:r.map(e=>e.constructor?.name??`SpanProcessor`)},e,t,n)}},Di=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:o(t)&&this._accumulate(t)<this._upperBound?V.RECORD_AND_SAMPLED:V.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<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}},K;(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`})(K||={});var Oi=1;function ki(){return{sampler:Ai(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function Ai(){let e=K.ParentBasedAlwaysOn;switch(e){case K.AlwaysOn:return new U;case K.AlwaysOff:return new H;case K.ParentBasedAlwaysOn:return new W({root:new U});case K.ParentBasedAlwaysOff:return new W({root:new H});case K.TraceIdRatio:return new Di(ji());case K.ParentBasedTraceIdRatio:return new W({root:new Di(ji())});default:return _.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${K.ParentBasedAlwaysOn}".`),new W({root:new U})}}function ji(){return _.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Oi}.`),Oi}function Mi(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 Ni=class extends Ei{constructor(e={}){let t=cn({},ki(),Mi(e));delete t.generalLimits,super(t)}},Pi=class extends _i{constructor(e,t){t||={};for(let[e,n]of[[`maxExportBatchSize`,`OTEL_BSP_MAX_EXPORT_BATCH_SIZE`],[`maxQueueSize`,`OTEL_BSP_MAX_QUEUE_SIZE`],[`scheduledDelayMillis`,`OTEL_BSP_SCHEDULE_DELAY`],[`exportTimeoutMillis`,`OTEL_BSP_EXPORT_TIMEOUT`]])t[e];super({exporter:e,...t})}},Fi=class{_enabled=!1;_currentContext=r;_bindFunction(e=r,t){let n=this,i=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(i,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),i}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=r,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=r,this)}with(e,t,n,...i){let a=this._currentContext;this._currentContext=e||r;try{return t.call(n,...i)}finally{this._currentContext=a}}};function Ii(e){if(e!==null){if(e===void 0){let e=new Fi;e.enable(),h.setGlobalContextManager(e);return}e.enable(),h.setGlobalContextManager(e)}}function Li(e){if(e!==null){if(e===void 0){m.setGlobalPropagator(new Dt({propagators:[new Gt,new Ve]}));return}m.setGlobalPropagator(e)}}var Ri=class extends Ni{constructor(e={}){super(e)}register(e={}){f.setGlobalTracerProvider(this),Li(e.propagator),Ii(e.contextManager)}},q;(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`})(q||={});var zi=`http.response_content_length`,Bi=`http.response_content_length_uncompressed`;function J(e,t){return t in e}function Y(e,t,n,r=!0){if(J(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function Vi(e,t,n=!1,r,i){if(r===void 0&&(r=t[q.START_TIME]!==0),n||(Y(e,q.FETCH_START,t,r),Y(e,q.DOMAIN_LOOKUP_START,t,r),Y(e,q.DOMAIN_LOOKUP_END,t,r),Y(e,q.CONNECT_START,t,r),Y(e,q.SECURE_CONNECTION_START,t,r),Y(e,q.CONNECT_END,t,r),Y(e,q.REQUEST_START,t,r),Y(e,q.RESPONSE_START,t,r),Y(e,q.RESPONSE_END,t,r)),!i){let n=t[q.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(zi,n);let r=t[q.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(Bi,r)}}function Hi(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return`/`;let n=Wi(e,t);if(t&&n.indexOf(`@id`)>0)return n;let r=``;return e.parentNode&&(r+=Hi(e.parentNode,t)),r+=n,r}function Ui(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 Wi(e,t){let n=e.nodeType,r=Ui(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 X;(function(e){e.DOCUMENT_LOAD=`documentLoad`,e.DOCUMENT_FETCH=`documentFetch`,e.RESOURCE_FETCH=`resourceFetch`})(X||={});var Gi=`0.49.0`,Ki=`@opentelemetry/instrumentation-document-load`,qi;(function(e){e.FIRST_PAINT=`firstPaint`,e.FIRST_CONTENTFUL_PAINT=`firstContentfulPaint`})(qi||={});var Ji=()=>{let e={},t=b.getEntriesByType?.(`navigation`)[0];if(t)Object.values(q).forEach(n=>{if(J(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}});else{let t=b.timing;t&&Object.values(q).forEach(n=>{if(J(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}})}return e},Yi={"first-paint":qi.FIRST_PAINT,"first-contentful-paint":qi.FIRST_CONTENTFUL_PAINT},Xi=e=>{let t=b.getEntriesByType?.(`paint`);t&&t.forEach(({name:t,startTime:n})=>{J(Yi,t)&&e.addEvent(Yi[t],n)})},Zi=class extends Rr{component=`document-load`;version=`1`;moduleName=this.component;constructor(e={}){super(Ki,Gi,e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){let t=b.getEntriesByType?.(`resource`);t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===D),t=Ji(),n=e&&e.content||``;h.with(m.extract(r,{traceparent:n}),()=>{let e=this._startSpan(X.DOCUMENT_LOAD,q.FETCH_START,t);e&&(h.with(f.setSpan(h.active(),e),()=>{let e=this._startSpan(X.DOCUMENT_FETCH,q.FETCH_START,t);e&&(e.setAttribute(et,location.href),h.with(f.setSpan(h.active(),e),()=>{Vi(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,q.RESPONSE_END,t)}))}),e.setAttribute(et,location.href),e.setAttribute(tt,navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(Y(e,q.FETCH_START,t),Y(e,q.UNLOAD_EVENT_START,t),Y(e,q.UNLOAD_EVENT_END,t),Y(e,q.DOM_INTERACTIVE,t),Y(e,q.DOM_CONTENT_LOADED_EVENT_START,t),Y(e,q.DOM_CONTENT_LOADED_EVENT_END,t),Y(e,q.DOM_COMPLETE,t),Y(e,q.LOAD_EVENT_START,t),Y(e,q.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||Xi(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,q.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(J(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){let n=this._startSpan(X.RESOURCE_FETCH,q.FETCH_START,e,t);n&&(n.setAttribute(et,e.name),Vi(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,q.RESPONSE_END,e))}_startSpan(e,t,n,r){if(J(n,t)&&typeof n[t]==`number`)return this.tracer.startSpan(e,{startTime:n[t]},r?f.setSpan(h.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&&I(()=>t(e),e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&I(()=>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)}},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 Qi=`http.response_content_length`,$i=`http.response_content_length_uncompressed`,ea;function ta(){return ea||=document.createElement(`a`),ea}function na(e,t){return t in e}function Q(e,t,n,r=!0){if(na(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function ra(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(Qi,n);let r=t[Z.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute($i,r)}}function ia(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 aa(){return typeof location<`u`?location.origin:void 0}function oa(e,t,n,r,i=new WeakSet,a){let o=la(e);e=o.toString();let s=ca(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=ia(s);if(o.origin!==aa()&&c.length>1){let e=c[0],t=sa(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 sa(e,t,n){let r=T(n),i=T(w(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=T(w(n[Z.FETCH_START])),c=r-T(w(n[Z.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function ca(e,t,n,r,i,a){let o=T(t),s=T(n),c=r.filter(t=>{let n=T(w(t[Z.FETCH_START])),r=T(w(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 la(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=ta();return t.href=e,t}function ua(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),la(e).origin===aa()?!0:n.some(t=>hn(e,t))}var da;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(da||={});var fa=`http.host`,pa=`http.method`,ma=`http.request.body.size`,ha=`http.request_content_length_uncompressed`,ga=`http.scheme`,_a=`http.status_code`,va=`http.url`,ya=`http.user_agent`,ba=_.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function xa(...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}=Sa(t.body);return t.body=e,n}else return Promise.resolve(wa(t.body))}else{let t=e[0];return t?.body?t.clone().text().then(e=>Ea(e)):Promise.resolve()}}function Sa(e){if(!e.pipeThrough)return ba.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 Ca(e){return typeof Document<`u`&&e instanceof Document}function wa(e){if(Ca(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Ea(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return Da(e);if(e instanceof URLSearchParams)return Ea(e.toString());if(e.byteLength!==void 0)return e.byteLength;ba.warn(`unknown body type`)}var Ta=new TextEncoder;function Ea(e){return Ta.encode(e).byteLength}function Da(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 Oa(e){let t=ja(),n=e.toUpperCase();return n in t?n:`_OTHER`}var ka={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0},Aa;function ja(){return Aa===void 0&&(Aa=ka),Aa}var Ma={"https:":`443`,"http:":`80`};function Na(e){let t=Number(e.port||Ma[e.protocol]);if(t&&!isNaN(t))return t}var Pa=`0.204.0`,Fa=300,Ia=typeof process==`object`&&process.release?.name===`node`,La=class extends Rr{component=`fetch`;version=Pa;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,Pa,e),this._semconvStability=zr(`http`,e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[Z.FETCH_START]},f.setSpan(h.active(),e)),r=!(this._semconvStability&R.OLD);ra(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[Z.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=la(t.url);if(this._semconvStability&R.OLD&&(e.setAttribute(_a,t.status),t.statusText!=null&&e.setAttribute(da.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(fa,n.host),e.setAttribute(ga,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(ya,navigator.userAgent)),this._semconvStability&R.STABLE){e.setAttribute(lt,t.status),e.setAttribute(ut,n.hostname);let r=Na(n);r&&e.setAttribute(dt,r)}}_addHeaders(e,t){if(!ua(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};m.inject(h.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)m.inject(h.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Headers)m.inject(h.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Map)m.inject(h.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t={};m.inject(h.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(gn(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&R.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[da.COMPONENT]=this.moduleName,r[pa]=i,r[va]=e}if(this._semconvStability&R.STABLE){let i=t.method,a=Oa(t.method||`GET`);n||=a,r[st]=a,a!==i&&(r[ct]=i),r[vt]=e}return this.tracer.startSpan(n,{kind:be.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=oa(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&R.OLD);ra(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=S(Date.now()),i=C();this._addFinalSpanAttributes(e,n),this._semconvStability&R.STABLE&&n.status>=400&&(e.setStatus({code:c.ERROR}),e.setAttribute(rt,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},Fa)}_patchConstructor(){return e=>{let t=this;return function(...n){let r=this,i=la(n[0]instanceof Request?n[0].url:String(n[0])).href,a=n[0]instanceof Request?n[0]:n[1]||{},o=t._createSpan(i,a);if(!o)return e.apply(this,n);let s=t._prepareSpanData(i);t.getConfig().measureRequestSize&&xa(...n).then(e=>{e&&(t._semconvStability&R.OLD&&o.setAttribute(ha,e),t._semconvStability&R.STABLE&&o.setAttribute(ma,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function c(e,n){t._applyAttributesAfterFetch(e,a,n),t._endSpan(e,s,{status:n.status||0,statusText:n.message,url:i})}function l(e,n){t._applyAttributesAfterFetch(e,a,n),n.status>=200&&n.status<400?t._endSpan(e,s,n):t._endSpan(e,s,{status:n.status,statusText:n.statusText,url:i})}function u(e,t,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?l(e,n):i()},t=>{c(e,t)})};i()}else l(e,n)}finally{t(n)}}function d(e,t,n){try{c(e,n)}finally{t(n)}}return new Promise((n,s)=>h.with(f.setSpan(h.active(),o),()=>(t._addHeaders(a,i),t._callRequestHook(o,a),t._tasksCount++,e.apply(r,a instanceof Request?[a]:[i,a]).then(u.bind(r,o,n),d.bind(r,o,s)))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&I(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&I(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=C(),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(Ia){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()`);return}L(fetch)&&(this._unwrap(Xe,`fetch`),this._diag.debug(`removing previous patch for constructor`)),this._wrap(Xe,`fetch`,this._patchConstructor())}disable(){Ia||(this._unwrap(Xe,`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 Ra=`0.49.0`,za=`@opentelemetry/instrumentation-user-interaction`,Ba=`OT_ZONE_CONTEXT`,Va=`Navigation:`,Ha=[`click`];function Ua(){return!1}var Wa=class extends Rr{version=Ra;moduleName=`user-interaction`;_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(e={}){super(za,Ra,e),this._eventNames=new Set(e?.eventNames??Ha),this._shouldPreventSpanCreation=typeof e?.shouldPreventSpanCreation==`function`?e.shouldPreventSpanCreation:Ua}init(){}_checkForTimeout(e,t){let n=this._spansData.get(t);n&&(e.source===`setTimeout`?n.hrTimeLastTimeout=C():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=Hi(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?f.setSpan(h.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(Ba);return t&&f.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,o=function(...t){let i,o=t[0],s=o?.target;o&&(i=e._eventsSpanMap.get(o)),a&&e.removePatchedListener(this,n,r);let c=e._createSpan(s,n,i);return c?(o&&e._eventsSpanMap.set(o,c),h.with(f.setSpan(h.active(),c),()=>{let n=e._invokeListener(r,this,t);return c.end(),n})):e._invokeListener(r,this,t)};if(e.addPatchedListener(this,n,r,o))return t.call(this,n,o,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(){L(history.replaceState)&&this._unwrap(history,`replaceState`),L(history.pushState)&&this._unwrap(history,`pushState`),L(history.back)&&this._unwrap(history,`back`),L(history.forward)&&this._unwrap(history,`forward`),L(history.go)&&this._unwrap(history,`go`)}_updateInteractionName(e){let t=f.getSpan(h.active());t&&typeof t.updateName==`function`&&t.updateName(`${Va} ${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,o,s=this;if(a){if(o=e._createSpan(a,n.eventName),o)return e._incrementTask(o),s.run(()=>{try{return h.with(f.setSpan(h.active(),o),()=>{let e=Zone.current;return n._zone=e,t.call(e,n,r,i)})}finally{e._decrementTask(o)}})}else o=e._getCurrentSpan(s);try{return t.call(s,n,r,i)}finally{o&&e._shouldCountTask(n,s)&&e._decrementTask(o)}}}_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?(L(e.prototype.runTask)&&(this._unwrap(e.prototype,`runTask`),this._diag.debug(`removing previous patch from method runTask`)),L(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,`scheduleTask`),this._diag.debug(`removing previous patch from method scheduleTask`)),L(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=>{L(e.addEventListener)&&(this._unwrap(e,`addEventListener`),this._diag.debug(`removing previous patch from method addEventListener`)),L(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?(L(e.prototype.runTask)&&this._unwrap(e.prototype,`runTask`),L(e.prototype.scheduleTask)&&this._unwrap(e.prototype,`scheduleTask`),L(e.prototype.cancelTask)&&this._unwrap(e.prototype,`cancelTask`)):this._getPatchableEventTargets().forEach(e=>{L(e.addEventListener)&&this._unwrap(e,`addEventListener`),L(e.removeEventListener)&&this._unwrap(e,`removeEventListener`)}),this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}},Ga=`open-knowledge-app`,Ka=!1;function qa(){return{BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.66.1`}?.VITE_OTEL_COLLECTOR_URL??`http://localhost:14318`}function Ja(){if(Ka)return;Ka=!0;let e=null,t=!1;try{let n=qa(),r={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.66.1`};e=new Ri({resource:Hr({[ft]:`open-knowledge-app`,[pt]:r?.VITE_APP_VERSION??`dev`,[nt]:r?.MODE??`dev`}),spanProcessors:[new Pi(new xr({url:`${n}/v1/traces`}),{maxExportBatchSize:50,scheduledDelayMillis:2e3})]}),e.register(),t=!0,Mr({instrumentations:[new Zi,new Wa({eventNames:[`click`,`submit`]}),new La({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(()=>{}),Ka=!1}}function Ya(){return f.getTracer(Ga)}export{Ya as getAppTracer,Ja as install};
2
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{a as n,c as r,d as i,f as a,i as o,l as s,n as c,o as l,p as u,r as d,t as f,u as p}from"./trace-api-BP9dN1Hz.js";import{n as ee,t as m}from"./propagation-api-DC5404fy.js";import{t as h}from"./context-api-dUnlgSJr.js";var te=class{constructor(){}createGauge(e,t){return fe}createHistogram(e,t){return pe}createCounter(e,t){return de}createUpDownCounter(e,t){return me}createObservableGauge(e,t){return ge}createObservableCounter(e,t){return he}createObservableUpDownCounter(e,t){return _e}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},g=class{},ne=class extends g{add(e,t){}},re=class extends g{add(e,t){}},ie=class extends g{record(e,t){}},ae=class extends g{record(e,t){}},oe=class{addCallback(e){}removeCallback(e){}},se=class extends oe{},ce=class extends oe{},le=class extends oe{},ue=new te,de=new ne,fe=new ie,pe=new ae,me=new re,he=new se,ge=new ce,_e=new le;function ve(){return ue}var ye;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(ye||={});var be;(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`})(be||={});var _=p.instance(),xe=new class{getMeter(e,t,n){return ue}},Se=`metrics`,Ce=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return a(Se,e,p.instance())}getMeterProvider(){return i(Se)||xe}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){u(Se,p.instance())}}.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()}},Te=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}};function Ee(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function De(e){if(e!=null)return()=>e}function Oe(e,t,n){return{timeoutMillis:Ee(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function ke(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}var Ae=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 je(e){return new Ae(e.concurrencyLimit)}var Me=s(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function Ne(e){return e.setValue(Me,!0)}function Pe(e){return e.getValue(Me)===!0}var Fe=`baggage`,Ie=4096;function Le(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function Re(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 ze(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,s;try{o=decodeURIComponent(i),s=decodeURIComponent(a)}catch{return}let c;return t!==-1&&t<e.length-1&&(c=ee(e.substring(t+1))),{key:o,value:s,metadata:c}}function Be(e,t,n,r){let i=0;for(;i<e.length&&n<180;){let a=e.indexOf(`,`,i),o=a===-1?e.length:a,s=o-i;if(s<=4096){let a=ze(e.substring(i,o));if(a){let e=(n===0?0:1)+s;if(r+e>8192)break;t[a.key]=a.metadata?{value:a.value,metadata:a.metadata}:{value:a.value},n++,r+=e}}if(a===-1)break;i=a+1}return[n,r]}var Ve=class{inject(e,t,n){let r=m.getBaggage(e);if(!r||Pe(e))return;let i=Le(Re(r).filter(e=>e.length<=Ie).slice(0,180));i.length>0&&n.set(t,Fe,i)}extract(e,t,n){let r=n.get(t,Fe);if(!r)return e;let i={},a=0,o=0;if(Array.isArray(r))for(let e=0;e<r.length;e++)[a,o]=Be(r[e],i,a,o);else [a]=Be(r,i,a,o);return a===0?e:m.setBaggage(e,m.createBaggage(i))}fields(){return[Fe]}};function v(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!He(n)){_.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Ue(r)){_.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function He(e){return typeof e==`string`&&e!==``}function Ue(e){return e==null?!0:Array.isArray(e)?We(e):Ge(typeof e)}function We(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Ge(e)){t=e;continue}return!1}return!1}}return!0}function Ge(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Ke(){return e=>{_.error(qe(e))}}function qe(e){return typeof e==`string`?e:JSON.stringify(Je(e))}function Je(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 Ye=Ke();function y(e){try{Ye(e)}catch{}}var Xe=globalThis,Ze=`2.8.0`,Qe=`http.url`,$e=`http.user_agent`,et=Qe,tt=$e,nt=`deployment.environment.name`,rt=`error.type`,it=`exception.message`,at=`exception.stacktrace`,ot=`exception.type`,st=`http.request.method`,ct=`http.request.method_original`,lt=`http.response.status_code`,ut=`server.address`,dt=`server.port`,ft=`service.name`,pt=`service.version`,mt=`telemetry.sdk.language`,ht=`webjs`,gt=`telemetry.sdk.name`,_t=`telemetry.sdk.version`,vt=`url.full`,yt=`process.runtime.name`,bt={[gt]:`opentelemetry`,[yt]:`browser`,[mt]:ht,[_t]:Ze},b=performance,xt=9,St=10**6,x=10**xt;function S(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*St)]}function C(e){return Et(S(b.timeOrigin),S(typeof e==`number`?e:b.now()))}function w(e){if(wt(e))return e;if(typeof e==`number`)return e<b.timeOrigin?C(e):S(e);if(e instanceof Date)return S(e.getTime());throw TypeError(`Invalid input type`)}function Ct(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=x),[n,r]}function T(e){return e[0]*x+e[1]}function wt(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function Tt(e){return wt(e)||typeof e==`number`||e instanceof Date}function Et(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=x&&(n[1]-=x,n[0]+=1),n}var E;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(E||={});var Dt=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];let t=new Set;for(let e of this._propagators){let n=typeof e.fields==`function`?e.fields():[];for(let e of n)t.add(e)}this._fields=Array.from(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()}},Ot=`[_0-9a-z-*/]`,kt=`[a-z]${Ot}{0,255}`,At=`[a-z0-9]${Ot}{0,240}@[a-z]${Ot}{0,13}`,jt=RegExp(`^(?:${kt}|${At})$`),Mt=/^[ -~]{0,255}[!-~]$/,Nt=/,|=/;function Pt(e){return jt.test(e)}function Ft(e){return Mt.test(e)&&!Nt.test(e)}var It=32,Lt=512,Rt=`,`,zt=`=`,Bt=class e{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!Pt(e)||!Ft(t))return this;let n=this._getState(),r=n.get(e),i=this._length;if(typeof r==`string`?i+=t.length-r.length:i+=e.length+t.length+(n.size>0?2:1),i>Lt)return this;let a=new Map(n);return a.delete(e),a.set(e,t),this._fromState(a,i)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=Rt+e),e=`${n[0]}${zt}${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(Rt),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(zt);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!Pt(a)||!Ft(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>Lt)&&(t.set(a,o),n=s,t.size>=It))break}return this._length=n,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}},D=`traceparent`,Vt=`tracestate`,Ht=`00`,Ut=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function Wt(e){let t=Ut.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Gt=class{inject(e,t,n){let r=f.getSpanContext(e);if(!r||Pe(e)||!d(r))return;let i=`${Ht}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||l.NONE).toString(16)}`;n.set(t,D,i),r.traceState&&n.set(t,Vt,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,D);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=Wt(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,Vt);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new Bt(typeof e==`string`?e:void 0)}return f.setSpanContext(e,a)}fields(){return[D,Vt]}},Kt=`[object Object]`,qt=`[object Null]`,Jt=`[object Undefined]`,Yt=Function.prototype.toString,Xt=Yt.call(Object),Zt=Object.getPrototypeOf,Qt=Object.prototype,$t=Qt.hasOwnProperty,O=Symbol?Symbol.toStringTag:void 0,en=Qt.toString;function tn(e){if(!nn(e)||rn(e)!==Kt)return!1;let t=Zt(e);if(t===null)return!0;let n=$t.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Yt.call(n)===Xt}function nn(e){return typeof e==`object`&&!!e}function rn(e){return e==null?e===void 0?Jt:qt:O&&O in Object(e)?an(e):on(e)}function an(e){let t=$t.call(e,O),n=e[O],r=!1;try{e[O]=void 0,r=!0}catch{}let i=en.call(e);return r&&(t?e[O]=n:delete e[O]),i}function on(e){return en.call(e)}var sn=20;function cn(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=un(t,e.shift(),0,n);return t}function ln(e){return k(e)?e.slice():e}function un(e,t,n=0,r){let i;if(!(n>sn)){if(n++,pn(e)||pn(t)||fn(t))i=ln(t);else if(k(e)){if(i=e.slice(),k(t))for(let e=0,n=t.length;e<n;e++)i.push(ln(t[e]));else if(A(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]=ln(t[r]))}}}else if(A(e))if(A(t)){if(!mn(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(pn(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(dn(e,s,r)||dn(t,s,r))delete i[s];else{if(A(a)&&A(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]=un(i[s],c,n,r)}}}}else i=t;return i}}function dn(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 k(e){return Array.isArray(e)}function fn(e){return typeof e==`function`}function A(e){return!pn(e)&&!k(e)&&!fn(e)&&typeof e==`object`}function pn(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function mn(e,t){return!(!tn(e)||!tn(t))}function hn(e,t){return typeof t==`string`?e===t:!!e.match(t)}function gn(e,t){if(!t)return!1;for(let n of t)if(hn(e,n))return!0;return!1}var _n=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)}},vn=class{_isCalled=!1;_deferred=new _n;_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}};function yn(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function bn(){return{handleResponse(e){e==null||!yn(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||_.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var xn=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:E.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:E.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:E.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:E.FAILED,error:e.error});return}else e.status===`retryable`?t({code:E.FAILED,error:new Te(`Export failed with retryable status`)}):t({code:E.FAILED,error:new Te(`Export failed with unknown error`)})},e=>t({code:E.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}};function Sn(e,t){return new xn(e.transport,e.serializer,bn(),e.promiseHandler,t.timeout)}function Cn(e,t,n){return Sn({transport:n,serializer:t,promiseHandler:je(e)},{timeout:e.timeoutMillis})}function wn(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function Tn(e){let t=new Uint8Array(e.length/2),n=0;for(let r=0;r<e.length;r+=2){let i=wn(e.charCodeAt(r)),a=wn(e.charCodeAt(r+1));t[n++]=i<<4|a}return t}function En(e){let t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}function Dn(e){return{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}function On(e){return Dn(En(e))}function kn(e){return En(e).toString()}var An=typeof BigInt<`u`?kn:T;function jn(e){return e}function Mn(e){if(e!==void 0)return Tn(e)}var Nn={encodeHrTime:On,encodeSpanContext:Tn,encodeOptionalSpanContext:Mn};function Pn(e){if(e===void 0)return Nn;let t=e.useLongBits??!0,n=e.useHex??!1;return{encodeHrTime:t?On:An,encodeSpanContext:n?jn:Tn,encodeOptionalSpanContext:n?jn:Mn}}function Fn(e){let t={attributes:Ln(e.attributes),droppedAttributesCount:0},n=e.schemaUrl;return n&&n!==``&&(t.schemaUrl=n),t}function In(e){return{name:e.name,version:e.version}}function Ln(e){return Object.keys(e).map(t=>Rn(t,e[t]))}function Rn(e,t){return{key:e,value:zn(t)}}function zn(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(zn)}}:t===`object`&&e!=null?{kvlistValue:{values:Object.entries(e).map(([e,t])=>Rn(e,t))}}:{}}function Bn(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:Ln(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>Hn(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>Vn(e,t)),droppedLinksCount:e.droppedLinksCount}}function Vn(e,t){return{attributes:e.attributes?Ln(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}function Hn(e,t){return{attributes:e.attributes?Ln(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Un(e,t){return{resourceSpans:Gn(e,Pn(t))}}function Wn(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 Gn(e,t){let n=Wn(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=>Bn(e,t));o.push({scope:In(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=Fn(e),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}var Kn={serializeRequest:e=>{let t=Un(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))}},qn=5,Jn=1e3,Yn=5e3,Xn=1.5,Zn=.2;function Qn(){return 2*Zn*Math.random()-Zn}var $n=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=qn,a=Jn;for(;r.status===`retryable`&&i>0;){i--;let t=Math.max(Math.min(a,Yn)+Qn(),0);a*=Xn;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 er(e){return new $n(e.transport)}function tr(e){return[429,502,503,504].includes(e)}function nr(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 rr=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&&tr(r.status)?n({status:`retryable`,retryInMillis:nr(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 ir(e){return new rr(e)}var ar=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 or(e){return new ar(e)}var sr=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`}):tr(i.status)?{status:`retryable`,retryInMillis:nr(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 cr(e){return new sr(e)}function lr(e,t){return Cn(e,t,er({transport:ir(e)}))}function ur(e,t){return Cn(e,t,er({transport:cr(e)}))}function dr(e,t){return Cn(e,t,er({transport:or({url:e.url,blobType:e.headers()[`Content-Type`]})}))}function fr(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 pr(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 mr(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 hr(n){return async r=>{let{Agent:i}=await t(()=>import(`./__vite-browser-external-Djp1xigf.js`).then(t=>e(t.default)),__vite__mapDeps([0,1]),import.meta.url);return new i(n)}}function gr(e,t,n){return{...Oe(e,t,n),headers:pr(fr(e.headers),t.headers,n.headers),url:mr(e.url)??t.url??n.url,agentFactory:e.agentFactory??t.agentFactory??n.agentFactory}}function _r(e,t){return{...ke(),headers:()=>e,url:`http://localhost:4318/`+t,agentFactory:hr({keepAlive:!0})}}function vr(e,t,n){return gr({url:e.url,timeoutMillis:e.timeoutMillis,headers:De(e.headers),concurrencyLimit:e.concurrencyLimit},{},_r(n,t))}function yr(e,t,n,r){return br(e.headers)(vr(e,n,r),t)}function br(e){return!e&&typeof navigator.sendBeacon==`function`?dr:globalThis.fetch===void 0?lr:ur}var xr=class extends we{constructor(e={}){super(yr(e,Kn,`v1/traces`,{"Content-Type":`application/json`}))}},Sr=class{emit(e){}},Cr=new Sr,wr=new class{getLogger(e,t,n){return new Sr}},Tr=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):Cr}},Er=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new Tr(this,e,t,n)}_getDelegate(){return this._delegate??wr}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}},Dr=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},j=Symbol.for(`io.opentelemetry.js.api.logs`),M=Dr;function Or(e,t,n){return r=>r===e?t:n}var kr=class e{constructor(){this._proxyLoggerProvider=new Er}static getInstance(){return this._instance||=new e,this._instance}setGlobalLoggerProvider(e){return M[j]?this.getLoggerProvider():(M[j]=Or(1,e,wr),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return M[j]?.call(M,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete M[j],this._proxyLoggerProvider=new Er}}.getInstance();function Ar(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 jr(e){e.forEach(e=>e.disable())}function Mr(e){let t=e.tracerProvider||f.getTracerProvider(),n=e.meterProvider||Ce.getMeterProvider(),r=e.loggerProvider||kr.getLoggerProvider(),i=e.instrumentations?.flat()??[];return Ar(i,t,n,r),()=>{jr(i)}}var N=console.error.bind(console);function P(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 Nr=(e,t,n)=>{if(!e||!e[t]){N(`no original function `+String(t)+` to wrap`);return}if(!n){N(`no wrapper function`),N(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){N(`original object and wrapper must be functions`);return}let i=n(r,t);return P(i,`__original`,r),P(i,`__unwrap`,()=>{e[t]===i&&P(e,t,r)}),P(i,`__wrapped`,!0),P(e,t,i),i},Pr=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{N(`must provide one or more modules to patch`),N(Error().stack);return}if(!(t&&Array.isArray(t))){N(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Nr(e,t,n)})})},Fr=(e,t)=>{if(!e||!e[t]){N(`no function to unwrap.`),N(Error().stack);return}let n=e[t];if(!n.__unwrap)N(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},Ir=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{N(`must provide one or more modules to patch`),N(Error().stack);return}if(!(t&&Array.isArray(t))){N(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Fr(e,t)})})};function F(e){e&&e.logger&&(typeof e.logger==`function`?N=e.logger:N(`new logger isn't a function, not replacing`))}F.wrap=Nr,F.massWrap=Pr,F.unwrap=Fr,F.massUnwrap=Ir;var Lr=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=f.getTracer(e,t),this._meter=Ce.getMeter(e,t),this._logger=kr.getLogger(e,t),this._updateMetricInstruments()}_wrap=Nr;_unwrap=Fr;_massWrap=Pr;_massUnwrap=Ir;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)}}},Rr=class extends Lr{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function I(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 L(e){return typeof e==`function`&&typeof e.__original==`function`&&typeof e.__unwrap==`function`&&e.__wrapped===!0}var R;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(R||={});function zr(e,t){let n=R.OLD,r=t?.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r??[])if(t.toLowerCase()===e+`/dup`){n=R.DUPLICATE;break}else t.toLowerCase()===e&&(n=R.STABLE);return n}var z;function Br(){if(z===void 0)try{let e=globalThis.process.argv0;z=e?`unknown_service:${e}`:`unknown_service`}catch{z=`unknown_service`}return z}var B=e=>typeof e==`object`&&!!e&&typeof e.then==`function`,Vr=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=Wr(t),r._asyncAttributesPending=t.filter(([e,t])=>B(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(B(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Wr(this._rawAttributes),this._schemaUrl=Gr(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,B(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(B(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=Kr(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function Hr(e,t){return Vr.FromAttributeList(Object.entries(e),t)}function Ur(){return Hr({[ft]:Br(),[mt]:bt[mt],[gt]:bt[gt],[_t]:bt[_t]})}function Wr(e){return e.map(([e,t])=>B(t)?[e,t.catch(t=>{_.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Gr(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 Kr(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 qr=`exception`,Jr=Symbol.for(`nodejs.util.inspect.custom`);function Yr(e){let t={};for(let[n,r]of e.getRawAttributes())typeof r?.then!=`function`&&r!=null&&(t[n]??=r);return t}function Xr(e,t,n,r,i){if(typeof n==`number`&&n<0){let t=`[${e}]`;return r?.stylize?r.stylize(t,`special`):t}return typeof i!=`function`||!r?t:`${e} ${i(t,{...r,depth:r.depth==null?r.depth:r.depth-1})}`}var Zr=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:c.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=b.now(),this._performanceOffset=t-(this._performanceStartTime+b.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(!Ue(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++),Tt(t)&&(Tt(n)||(n=t),t=void 0);let i=v(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=v(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===c.UNSET||this.status.code===c.OK)return this;let t={code:e.code};return e.code===c.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=Ct(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<=b.now())return C(e+this._performanceOffset);if(typeof e==`number`)return S(e);if(e instanceof Date)return S(e.getTime());if(wt(e))return e;if(this._startTimeProvided)return S(Date.now());let t=b.now()-this._performanceStartTime;return Et(this.startTime,S(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[it]=e:e&&(e.code?n[ot]=e.code.toString():e.name&&(n[ot]=e.name),e.message&&(n[it]=e.message),e.stack&&(n[at]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(qr,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}[Jr](e,t,n){return Xr(`SpanImpl`,{name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:Yr(this.resource)}},e,t,n)}},V;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(V||={});var Qr=`otel.component.name`,$r=`otel.component.type`,ei=`otel.span.parent.origin`,ti=`otel.span.sampling_result`,ni=`otel.sdk.processor.span.processed`,ri=`otel.sdk.processor.span.queue.capacity`,ii=`otel.sdk.processor.span.queue.size`,ai=`otel.sdk.span.live`,oi=`otel.sdk.span.started`,si=`batching_span_processor`,ci=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(oi,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(ai,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=ui(t);if(this.startedSpans.add(1,{[ei]:li(e),[ti]:n}),t===V.NOT_RECORD)return()=>{};let r={[ti]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function li(e){return e?e.isRemote?`remote`:`local`:`none`}function ui(e){switch(e){case V.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case V.RECORD:return`RECORD_ONLY`;case V.NOT_RECORD:return`DROP`}}var di=`2.9.0`,fi=class{_sampler;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t){this.instrumentationScope=e,this._sampler=t.sampler,this._spanLimits=t.spanLimits,this._resource=t.resource,this._idGenerator=t.idGenerator,this._spanProcessor=t.spanProcessor,this._tracerMetrics=new ci(t.meterProvider.getMeter(`@opentelemetry/sdk-trace`,di))}startSpan(e,t={},r=h.active()){t.root&&(r=f.deleteSpan(r));let i=f.getSpan(r);if(Pe(r))return _.debug(`Instrumentation suppressed, returning Noop Span`),f.wrapSpanContext(n);let a=i?.spanContext(),o=this._idGenerator.generateSpanId(),s,c,u;!a||!f.isSpanContextValid(a)?c=this._idGenerator.generateTraceId():(c=a.traceId,u=a.traceState,s=a);let d=t.kind??be.INTERNAL,p=(t.links??[]).map(e=>({context:e.context,attributes:v(e.attributes)})),ee=v(t.attributes),m=this._sampler.shouldSample(r,c,e,d,ee,p),te=this._tracerMetrics.startSpan(a,m.decision);u=m.traceState??u;let g=m.decision===ye.RECORD_AND_SAMPLED?l.SAMPLED:l.NONE,ne={traceId:c,spanId:o,traceFlags:g,traceState:u};if(m.decision===ye.NOT_RECORD)return _.debug(`Recording is off, propagating context in a non-recording span`),f.wrapSpanContext(ne);let re=v(Object.assign(ee,m.attributes));return new Zr({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:ne,name:e,kind:d,links:p,parentSpanContext:s,attributes:re,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:te})}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??h.active(),c=this.startSpan(e,i,s),l=f.setSpan(s,c);return h.with(l,o,void 0,c)}[Jr](e,t,n){return Xr(`Tracer`,{instrumentationScope:this.instrumentationScope,resource:{attributes:Yr(this._resource)},spanLimits:this._spanLimits},e,t,n)}},pi=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=>{y(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)})}},H=class{shouldSample(){return{decision:V.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},U=class{shouldSample(){return{decision:V.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},W=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(y(Error(`ParentBasedSampler must have a root sampler configured`)),new U),this._remoteParentSampled=e.remoteParentSampled??new U,this._remoteParentNotSampled=e.remoteParentNotSampled??new H,this._localParentSampled=e.localParentSampled??new U,this._localParentNotSampled=e.localParentNotSampled??new H}shouldSample(e,t,n,r,i,a){let o=f.getSpanContext(e);return!o||!d(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&l.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&l.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=new Map,hi=class{processedSpans;queueSize;queueSizeCallback;standardAttrs;droppedAttrs;constructor(e,t,n){let r=mi.get(e)??0;if(mi.set(e,r+1),this.standardAttrs={[$r]:e,[Qr]:`${e}/${r}`},this.droppedAttrs={...this.standardAttrs,[rt]:`queue_full`},this.processedSpans=t.createCounter(ni,{unit:`{span}`,description:`The number of spans for which the processing has finished, either successful or failed.`}),n){let{capacity:e,getQueueSize:r}=n;t.createUpDownCounter(ri,{unit:`{span}`,description:`The maximum number of spans the queue of a given instance of an SDK span processor can hold.`}).add(e,this.standardAttrs),this.queueSize=t.createObservableUpDownCounter(ii,{unit:`{span}`,description:`The number of spans in the queue of a given instance of an SDK span processor.`}),this.queueSizeCallback=e=>e.observe(r(),this.standardAttrs),this.queueSize.addCallback(this.queueSizeCallback)}}dropSpans(e){this.processedSpans.add(e,this.droppedAttrs)}finishSpans(e,t){if(!t){this.processedSpans.add(e,this.standardAttrs);return}let n={...this.standardAttrs,[rt]:t.name};this.processedSpans.add(e,n)}shutdown(){this.queueSize&&this.queueSizeCallback&&this.queueSize.removeCallback(this.queueSizeCallback)}},gi=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_metrics;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e){this._exporter=e.exporter,this._maxExportBatchSize=e.maxExportBatchSize??512,this._maxQueueSize=e.maxQueueSize??2048,this._scheduledDelayMillis=e.scheduledDelayMillis??5e3,this._exportTimeoutMillis=e.exportTimeoutMillis??3e4,this._shutdownOnce=new vn(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),this._metrics=new hi(si,e.selfObsMeterProvider?e.selfObsMeterProvider.getMeter(`@opentelemetry/sdk-trace`):ve(),{capacity:this._maxQueueSize,getQueueSize:()=>this._finishedSpans.length})}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&l.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>(this._metrics.shutdown(),this._exporter.shutdown()))}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&_.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++,this._metrics.dropSpans(1);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);h.with(Ne(h.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,i=>{clearTimeout(n),this._metrics.finishSpans(r.length,i.error),i.code===E.SUCCESS?e():t(i.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=>{y(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,y(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)}},_i=class extends gi{_visibilityChangeListener;_pageHideListener;constructor(e){super(e),this.onInit(e)}onInit(e){e.disableAutoFlushOnDocumentHide!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{y(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{y(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))}},vi=16,yi=8,bi=new Uint8Array(vi),xi=new Uint8Array(yi),Si=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Ci(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 wi(e){let t=``;for(let n=0;n<e.length;n++)t+=Si[e[n]];return t}var Ti=class{generateTraceId(){return Ci(bi),wi(bi)}generateSpanId(){return Ci(xi),wi(xi)}},G;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(G||={});var Ei=class{_resource;_activeSpanProcessor;_forceFlushTimeoutMillis;_tracerOptions;_tracers=new Map;constructor(e={}){this._forceFlushTimeoutMillis=e.forceFlushTimeoutMillis??3e4,this._resource=e.resource??Ur(),this._activeSpanProcessor=new pi(e.spanProcessors??[]),this._tracerOptions={resource:this._resource,sampler:e.sampler??new W({root:new U}),spanLimits:{attributeCountLimit:e.spanLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.spanLimits?.attributeValueLengthLimit??1/0,eventCountLimit:e.spanLimits?.eventCountLimit??128,linkCountLimit:e.spanLimits?.linkCountLimit??128,attributePerEventCountLimit:e.spanLimits?.attributePerEventCountLimit??128,attributePerLinkCountLimit:e.spanLimits?.attributePerLinkCountLimit??128},idGenerator:e.idGenerator||new Ti,spanProcessor:this._activeSpanProcessor,meterProvider:e.meterProvider??{getMeter(){return ve()}}}}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new fi({name:e,version:t,schemaUrl:n?.schemaUrl},this._tracerOptions)),this._tracers.get(r)}forceFlush(){let e=this._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=G.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==G.timeout&&(r=G.resolved,n(r))}).catch(e=>{clearTimeout(i),r=G.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==G.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}[Jr](e,t,n){let r=this._activeSpanProcessor._spanProcessors;return Xr(`TracerProvider`,{resource:{attributes:Yr(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:r.map(e=>e.constructor?.name??`SpanProcessor`)},e,t,n)}},Di=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:o(t)&&this._accumulate(t)<this._upperBound?V.RECORD_AND_SAMPLED:V.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<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}},K;(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`})(K||={});var Oi=1;function ki(){return{sampler:Ai(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function Ai(){let e=K.ParentBasedAlwaysOn;switch(e){case K.AlwaysOn:return new U;case K.AlwaysOff:return new H;case K.ParentBasedAlwaysOn:return new W({root:new U});case K.ParentBasedAlwaysOff:return new W({root:new H});case K.TraceIdRatio:return new Di(ji());case K.ParentBasedTraceIdRatio:return new W({root:new Di(ji())});default:return _.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${K.ParentBasedAlwaysOn}".`),new W({root:new U})}}function ji(){return _.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Oi}.`),Oi}function Mi(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 Ni=class extends Ei{constructor(e={}){let t=cn({},ki(),Mi(e));delete t.generalLimits,super(t)}},Pi=class extends _i{constructor(e,t){t||={};for(let[e,n]of[[`maxExportBatchSize`,`OTEL_BSP_MAX_EXPORT_BATCH_SIZE`],[`maxQueueSize`,`OTEL_BSP_MAX_QUEUE_SIZE`],[`scheduledDelayMillis`,`OTEL_BSP_SCHEDULE_DELAY`],[`exportTimeoutMillis`,`OTEL_BSP_EXPORT_TIMEOUT`]])t[e];super({exporter:e,...t})}},Fi=class{_enabled=!1;_currentContext=r;_bindFunction(e=r,t){let n=this,i=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(i,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),i}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=r,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=r,this)}with(e,t,n,...i){let a=this._currentContext;this._currentContext=e||r;try{return t.call(n,...i)}finally{this._currentContext=a}}};function Ii(e){if(e!==null){if(e===void 0){let e=new Fi;e.enable(),h.setGlobalContextManager(e);return}e.enable(),h.setGlobalContextManager(e)}}function Li(e){if(e!==null){if(e===void 0){m.setGlobalPropagator(new Dt({propagators:[new Gt,new Ve]}));return}m.setGlobalPropagator(e)}}var Ri=class extends Ni{constructor(e={}){super(e)}register(e={}){f.setGlobalTracerProvider(this),Li(e.propagator),Ii(e.contextManager)}},q;(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`})(q||={});var zi=`http.response_content_length`,Bi=`http.response_content_length_uncompressed`;function J(e,t){return t in e}function Y(e,t,n,r=!0){if(J(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function Vi(e,t,n=!1,r,i){if(r===void 0&&(r=t[q.START_TIME]!==0),n||(Y(e,q.FETCH_START,t,r),Y(e,q.DOMAIN_LOOKUP_START,t,r),Y(e,q.DOMAIN_LOOKUP_END,t,r),Y(e,q.CONNECT_START,t,r),Y(e,q.SECURE_CONNECTION_START,t,r),Y(e,q.CONNECT_END,t,r),Y(e,q.REQUEST_START,t,r),Y(e,q.RESPONSE_START,t,r),Y(e,q.RESPONSE_END,t,r)),!i){let n=t[q.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(zi,n);let r=t[q.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(Bi,r)}}function Hi(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return`/`;let n=Wi(e,t);if(t&&n.indexOf(`@id`)>0)return n;let r=``;return e.parentNode&&(r+=Hi(e.parentNode,t)),r+=n,r}function Ui(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 Wi(e,t){let n=e.nodeType,r=Ui(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 X;(function(e){e.DOCUMENT_LOAD=`documentLoad`,e.DOCUMENT_FETCH=`documentFetch`,e.RESOURCE_FETCH=`resourceFetch`})(X||={});var Gi=`0.49.0`,Ki=`@opentelemetry/instrumentation-document-load`,qi;(function(e){e.FIRST_PAINT=`firstPaint`,e.FIRST_CONTENTFUL_PAINT=`firstContentfulPaint`})(qi||={});var Ji=()=>{let e={},t=b.getEntriesByType?.(`navigation`)[0];if(t)Object.values(q).forEach(n=>{if(J(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}});else{let t=b.timing;t&&Object.values(q).forEach(n=>{if(J(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}})}return e},Yi={"first-paint":qi.FIRST_PAINT,"first-contentful-paint":qi.FIRST_CONTENTFUL_PAINT},Xi=e=>{let t=b.getEntriesByType?.(`paint`);t&&t.forEach(({name:t,startTime:n})=>{J(Yi,t)&&e.addEvent(Yi[t],n)})},Zi=class extends Rr{component=`document-load`;version=`1`;moduleName=this.component;constructor(e={}){super(Ki,Gi,e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){let t=b.getEntriesByType?.(`resource`);t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===D),t=Ji(),n=e&&e.content||``;h.with(m.extract(r,{traceparent:n}),()=>{let e=this._startSpan(X.DOCUMENT_LOAD,q.FETCH_START,t);e&&(h.with(f.setSpan(h.active(),e),()=>{let e=this._startSpan(X.DOCUMENT_FETCH,q.FETCH_START,t);e&&(e.setAttribute(et,location.href),h.with(f.setSpan(h.active(),e),()=>{Vi(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,q.RESPONSE_END,t)}))}),e.setAttribute(et,location.href),e.setAttribute(tt,navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(Y(e,q.FETCH_START,t),Y(e,q.UNLOAD_EVENT_START,t),Y(e,q.UNLOAD_EVENT_END,t),Y(e,q.DOM_INTERACTIVE,t),Y(e,q.DOM_CONTENT_LOADED_EVENT_START,t),Y(e,q.DOM_CONTENT_LOADED_EVENT_END,t),Y(e,q.DOM_COMPLETE,t),Y(e,q.LOAD_EVENT_START,t),Y(e,q.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||Xi(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,q.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(J(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){let n=this._startSpan(X.RESOURCE_FETCH,q.FETCH_START,e,t);n&&(n.setAttribute(et,e.name),Vi(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,q.RESPONSE_END,e))}_startSpan(e,t,n,r){if(J(n,t)&&typeof n[t]==`number`)return this.tracer.startSpan(e,{startTime:n[t]},r?f.setSpan(h.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&&I(()=>t(e),e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&I(()=>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)}},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 Qi=`http.response_content_length`,$i=`http.response_content_length_uncompressed`,ea;function ta(){return ea||=document.createElement(`a`),ea}function na(e,t){return t in e}function Q(e,t,n,r=!0){if(na(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function ra(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(Qi,n);let r=t[Z.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute($i,r)}}function ia(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 aa(){return typeof location<`u`?location.origin:void 0}function oa(e,t,n,r,i=new WeakSet,a){let o=la(e);e=o.toString();let s=ca(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=ia(s);if(o.origin!==aa()&&c.length>1){let e=c[0],t=sa(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 sa(e,t,n){let r=T(n),i=T(w(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=T(w(n[Z.FETCH_START])),c=r-T(w(n[Z.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function ca(e,t,n,r,i,a){let o=T(t),s=T(n),c=r.filter(t=>{let n=T(w(t[Z.FETCH_START])),r=T(w(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 la(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=ta();return t.href=e,t}function ua(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),la(e).origin===aa()?!0:n.some(t=>hn(e,t))}var da;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(da||={});var fa=`http.host`,pa=`http.method`,ma=`http.request.body.size`,ha=`http.request_content_length_uncompressed`,ga=`http.scheme`,_a=`http.status_code`,va=`http.url`,ya=`http.user_agent`,ba=_.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function xa(...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}=Sa(t.body);return t.body=e,n}else return Promise.resolve(wa(t.body))}else{let t=e[0];return t?.body?t.clone().text().then(e=>Ea(e)):Promise.resolve()}}function Sa(e){if(!e.pipeThrough)return ba.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 Ca(e){return typeof Document<`u`&&e instanceof Document}function wa(e){if(Ca(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Ea(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return Da(e);if(e instanceof URLSearchParams)return Ea(e.toString());if(e.byteLength!==void 0)return e.byteLength;ba.warn(`unknown body type`)}var Ta=new TextEncoder;function Ea(e){return Ta.encode(e).byteLength}function Da(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 Oa(e){let t=ja(),n=e.toUpperCase();return n in t?n:`_OTHER`}var ka={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0},Aa;function ja(){return Aa===void 0&&(Aa=ka),Aa}var Ma={"https:":`443`,"http:":`80`};function Na(e){let t=Number(e.port||Ma[e.protocol]);if(t&&!isNaN(t))return t}var Pa=`0.204.0`,Fa=300,Ia=typeof process==`object`&&process.release?.name===`node`,La=class extends Rr{component=`fetch`;version=Pa;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,Pa,e),this._semconvStability=zr(`http`,e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[Z.FETCH_START]},f.setSpan(h.active(),e)),r=!(this._semconvStability&R.OLD);ra(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[Z.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=la(t.url);if(this._semconvStability&R.OLD&&(e.setAttribute(_a,t.status),t.statusText!=null&&e.setAttribute(da.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(fa,n.host),e.setAttribute(ga,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(ya,navigator.userAgent)),this._semconvStability&R.STABLE){e.setAttribute(lt,t.status),e.setAttribute(ut,n.hostname);let r=Na(n);r&&e.setAttribute(dt,r)}}_addHeaders(e,t){if(!ua(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};m.inject(h.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)m.inject(h.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Headers)m.inject(h.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Map)m.inject(h.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t={};m.inject(h.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(gn(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&R.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[da.COMPONENT]=this.moduleName,r[pa]=i,r[va]=e}if(this._semconvStability&R.STABLE){let i=t.method,a=Oa(t.method||`GET`);n||=a,r[st]=a,a!==i&&(r[ct]=i),r[vt]=e}return this.tracer.startSpan(n,{kind:be.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=oa(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&R.OLD);ra(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=S(Date.now()),i=C();this._addFinalSpanAttributes(e,n),this._semconvStability&R.STABLE&&n.status>=400&&(e.setStatus({code:c.ERROR}),e.setAttribute(rt,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},Fa)}_patchConstructor(){return e=>{let t=this;return function(...n){let r=this,i=la(n[0]instanceof Request?n[0].url:String(n[0])).href,a=n[0]instanceof Request?n[0]:n[1]||{},o=t._createSpan(i,a);if(!o)return e.apply(this,n);let s=t._prepareSpanData(i);t.getConfig().measureRequestSize&&xa(...n).then(e=>{e&&(t._semconvStability&R.OLD&&o.setAttribute(ha,e),t._semconvStability&R.STABLE&&o.setAttribute(ma,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function c(e,n){t._applyAttributesAfterFetch(e,a,n),t._endSpan(e,s,{status:n.status||0,statusText:n.message,url:i})}function l(e,n){t._applyAttributesAfterFetch(e,a,n),n.status>=200&&n.status<400?t._endSpan(e,s,n):t._endSpan(e,s,{status:n.status,statusText:n.statusText,url:i})}function u(e,t,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?l(e,n):i()},t=>{c(e,t)})};i()}else l(e,n)}finally{t(n)}}function d(e,t,n){try{c(e,n)}finally{t(n)}}return new Promise((n,s)=>h.with(f.setSpan(h.active(),o),()=>(t._addHeaders(a,i),t._callRequestHook(o,a),t._tasksCount++,e.apply(r,a instanceof Request?[a]:[i,a]).then(u.bind(r,o,n),d.bind(r,o,s)))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&I(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&I(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=C(),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(Ia){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()`);return}L(fetch)&&(this._unwrap(Xe,`fetch`),this._diag.debug(`removing previous patch for constructor`)),this._wrap(Xe,`fetch`,this._patchConstructor())}disable(){Ia||(this._unwrap(Xe,`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 Ra=`0.49.0`,za=`@opentelemetry/instrumentation-user-interaction`,Ba=`OT_ZONE_CONTEXT`,Va=`Navigation:`,Ha=[`click`];function Ua(){return!1}var Wa=class extends Rr{version=Ra;moduleName=`user-interaction`;_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(e={}){super(za,Ra,e),this._eventNames=new Set(e?.eventNames??Ha),this._shouldPreventSpanCreation=typeof e?.shouldPreventSpanCreation==`function`?e.shouldPreventSpanCreation:Ua}init(){}_checkForTimeout(e,t){let n=this._spansData.get(t);n&&(e.source===`setTimeout`?n.hrTimeLastTimeout=C():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=Hi(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?f.setSpan(h.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(Ba);return t&&f.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,o=function(...t){let i,o=t[0],s=o?.target;o&&(i=e._eventsSpanMap.get(o)),a&&e.removePatchedListener(this,n,r);let c=e._createSpan(s,n,i);return c?(o&&e._eventsSpanMap.set(o,c),h.with(f.setSpan(h.active(),c),()=>{let n=e._invokeListener(r,this,t);return c.end(),n})):e._invokeListener(r,this,t)};if(e.addPatchedListener(this,n,r,o))return t.call(this,n,o,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(){L(history.replaceState)&&this._unwrap(history,`replaceState`),L(history.pushState)&&this._unwrap(history,`pushState`),L(history.back)&&this._unwrap(history,`back`),L(history.forward)&&this._unwrap(history,`forward`),L(history.go)&&this._unwrap(history,`go`)}_updateInteractionName(e){let t=f.getSpan(h.active());t&&typeof t.updateName==`function`&&t.updateName(`${Va} ${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,o,s=this;if(a){if(o=e._createSpan(a,n.eventName),o)return e._incrementTask(o),s.run(()=>{try{return h.with(f.setSpan(h.active(),o),()=>{let e=Zone.current;return n._zone=e,t.call(e,n,r,i)})}finally{e._decrementTask(o)}})}else o=e._getCurrentSpan(s);try{return t.call(s,n,r,i)}finally{o&&e._shouldCountTask(n,s)&&e._decrementTask(o)}}}_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?(L(e.prototype.runTask)&&(this._unwrap(e.prototype,`runTask`),this._diag.debug(`removing previous patch from method runTask`)),L(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,`scheduleTask`),this._diag.debug(`removing previous patch from method scheduleTask`)),L(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=>{L(e.addEventListener)&&(this._unwrap(e,`addEventListener`),this._diag.debug(`removing previous patch from method addEventListener`)),L(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?(L(e.prototype.runTask)&&this._unwrap(e.prototype,`runTask`),L(e.prototype.scheduleTask)&&this._unwrap(e.prototype,`scheduleTask`),L(e.prototype.cancelTask)&&this._unwrap(e.prototype,`cancelTask`)):this._getPatchableEventTargets().forEach(e=>{L(e.addEventListener)&&this._unwrap(e,`addEventListener`),L(e.removeEventListener)&&this._unwrap(e,`removeEventListener`)}),this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}},Ga=`open-knowledge-app`,Ka=!1;function qa(){return{BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.66.2`}?.VITE_OTEL_COLLECTOR_URL??`http://localhost:14318`}function Ja(){if(Ka)return;Ka=!0;let e=null,t=!1;try{let n=qa(),r={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.66.2`};e=new Ri({resource:Hr({[ft]:`open-knowledge-app`,[pt]:r?.VITE_APP_VERSION??`dev`,[nt]:r?.MODE??`dev`}),spanProcessors:[new Pi(new xr({url:`${n}/v1/traces`}),{maxExportBatchSize:50,scheduledDelayMillis:2e3})]}),e.register(),t=!0,Mr({instrumentations:[new Zi,new Wa({eventNames:[`click`,`submit`]}),new La({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(()=>{}),Ka=!1}}function Ya(){return f.getTracer(Ga)}export{Ya as getAppTracer,Ja as install};
@@ -1 +1 @@
1
- import{t as e}from"./propagation-api-DC5404fy.js";import{t}from"./context-api-dUnlgSJr.js";import{n}from"./startup-marks-oHCT4d7K.js";import{getAppTracer as r}from"./telemetry-impl-ClRJ18fy.js";var i;function a(){if(!i)try{let a=typeof window<`u`?window.okDesktop?.config.startupTraceparent:void 0;if(!a)return;let o=e.extract(t.active(),{traceparent:a}),s=r().startSpan(`ok.app-startup`,void 0,o);i=s,n(e=>{try{s.end(e)}catch{}i=void 0})}catch{}}export{a as initStartupTrace};
1
+ import{t as e}from"./propagation-api-DC5404fy.js";import{t}from"./context-api-dUnlgSJr.js";import{n}from"./startup-marks-oHCT4d7K.js";import{getAppTracer as r}from"./telemetry-impl-C-lVM95D.js";var i;function a(){if(!i)try{let a=typeof window<`u`?window.okDesktop?.config.startupTraceparent:void 0;if(!a)return;let o=e.extract(t.active(),{traceparent:a}),s=r().startSpan(`ok.app-startup`,void 0,o);i=s,n(e=>{try{s.end(e)}catch{}i=void 0})}catch{}}export{a as initStartupTrace};