@mappedin/blue-dot 6.18.0-beta.0 → 6.19.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/chunk-IJA5ETXF.js +1 -0
- package/lib/esm/chunk-T4TSXXQK.js +2 -0
- package/lib/esm/debug/index.d.ts +9 -0
- package/lib/esm/debug/index.js +546 -1
- package/lib/esm/index.d.ts +9 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/react/index.d.ts +9 -0
- package/lib/esm/react/index.js +1 -1
- package/lib/rn/index-rn.js +2 -2
- package/lib/rn/models/model-manager.d.ts +10 -1
- package/lib/rn/types.d.ts +9 -0
- package/package.json +4 -4
- package/lib/esm/chunk-IPNIME5I.js +0 -1
- package/lib/esm/chunk-QFCRWBSD.js +0 -1
package/lib/esm/debug/index.js
CHANGED
|
@@ -1 +1,546 @@
|
|
|
1
|
-
import{a as S,c as d,g as L,h as e,i as h,j as u,k as s,m as D,n as w}from"../chunk-QFCRWBSD.js";D();D();D();function Ke(l){var r,m;let t={};for(let[p,c]of l.Sensors.getAll())t[p]={enabled:c.isEnabled};let n={timestamp:Date.now(),state:l.getState(),position:l.coordinate?{lat:l.coordinate.latitude,lon:l.coordinate.longitude,floor:(r=l.floor)==null?void 0:r.name}:null,accuracy:l.accuracy,heading:l.heading,sensors:t,anchor:l.anchor,displacement:l.displacement},i=new Blob([JSON.stringify(n,null,2)],{type:"application/json"}),a=new File([i],"bluedot-debug-".concat(Date.now(),".json"),{type:"application/json"});(m=navigator.canShare)!=null&&m.call(navigator,{files:[a]})?navigator.share({files:[a]}).catch(()=>{Je(i,a.name)}):Je(i,a.name)}d(Ke,"exportDebugData");function Je(l,t){let n=URL.createObjectURL(l),i=document.createElement("a");i.href=n,i.download=t,i.click(),URL.revokeObjectURL(n)}d(Je,"downloadFile");D();var V={heading:{headingResponsiveness:40,compassNoiseTolerance:30,headingSnapThreshold:10,magneticDisturbanceGating:!0,headingChangeThreshold:2},motion:{stepSensitivity:50,averageStepLength:.7,strideVariability:0,motionResponsiveness:50,pdrEnabled:!0}};function $e(l){return{complementaryAlpha:.99-l.headingResponsiveness/100*.79,gyroNoiseThreshold:.1+l.compassNoiseTolerance/100*4.9,maxHeadingError:l.headingSnapThreshold,magneticGatingEnabled:l.magneticDisturbanceGating,deltaThreshold:l.headingChangeThreshold}}d($e,"headingConfigToFilterParams");function Ae(l){return{stepDetectionThreshold:2-l.stepSensitivity/100*1.5,stepLength:l.averageStepLength,strideAdaptation:l.strideVariability/100*.3,motionThreshold:1-l.motionResponsiveness/100*.8,pdrEnabled:l.pdrEnabled}}d(Ae,"motionConfigToSensorParams");function I(l,t,n){return Math.min(Math.max(l,t),n)}d(I,"clamp");function rt(l){var n,i,a,r,m,p,c,b,_,y;let t=S({},V);return l.heading&&(t.heading={headingResponsiveness:I((n=l.heading.headingResponsiveness)!=null?n:30,0,100),compassNoiseTolerance:I((i=l.heading.compassNoiseTolerance)!=null?i:50,0,100),headingSnapThreshold:I((a=l.heading.headingSnapThreshold)!=null?a:30,10,90),magneticDisturbanceGating:(r=l.heading.magneticDisturbanceGating)!=null?r:!0,headingChangeThreshold:I((m=l.heading.headingChangeThreshold)!=null?m:2,1,10)}),l.motion&&(t.motion={stepSensitivity:I((p=l.motion.stepSensitivity)!=null?p:50,0,100),averageStepLength:I((c=l.motion.averageStepLength)!=null?c:.7,.4,1.2),strideVariability:I((b=l.motion.strideVariability)!=null?b:0,0,100),motionResponsiveness:I((_=l.motion.motionResponsiveness)!=null?_:50,0,100),pdrEnabled:(y=l.motion.pdrEnabled)!=null?y:!0}),t}d(rt,"normalizeTuningConfig");var Qe=".bluedot-hud {\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 10000;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n font-size: 14px;\n pointer-events: none;\n}\n\n.bluedot-hud--expanded {\n top: 0;\n display: flex;\n flex-direction: column;\n}\n\n.bluedot-hud * {\n box-sizing: border-box;\n}\n\n/* Collapsed bar */\n.bluedot-hud__collapsed {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 8px 12px;\n background: rgba(0, 0, 0, 0.85);\n color: #fff;\n pointer-events: auto;\n cursor: pointer;\n min-height: 36px;\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n}\n\n.bluedot-hud__status-dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n flex-shrink: 0;\n}\n\n.bluedot-hud__status-dot--active {\n background: #4ade80;\n box-shadow: 0 0 4px #4ade80;\n}\n\n.bluedot-hud__status-dot--inactive {\n background: #9ca3af;\n}\n\n.bluedot-hud__status-dot--error {\n background: #f87171;\n box-shadow: 0 0 4px #f87171;\n}\n\n.bluedot-hud__status-text {\n font-weight: 600;\n font-size: 12px;\n}\n\n.bluedot-hud__coords {\n color: #94a3b8;\n font-family: 'SF Mono', Monaco, 'Courier New', monospace;\n font-size: 10px;\n flex: 1;\n}\n\n.bluedot-hud__heading {\n color: #60a5fa;\n font-family: 'SF Mono', Monaco, 'Courier New', monospace;\n font-size: 11px;\n font-weight: 600;\n}\n\n/* Expanded panel */\n.bluedot-hud__expanded {\n display: none;\n flex-direction: column;\n background: rgba(0, 0, 0, 0.92);\n color: #fff;\n pointer-events: auto;\n flex: 1;\n overflow: hidden;\n backdrop-filter: blur(12px);\n -webkit-backdrop-filter: blur(12px);\n}\n\n.bluedot-hud__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px 12px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n cursor: pointer;\n min-height: 40px;\n}\n\n.bluedot-hud__title {\n font-weight: 600;\n font-size: 14px;\n}\n\n.bluedot-hud__header-right {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n\n.bluedot-hud__export-btn {\n background: #3b82f6;\n color: #fff;\n border: none;\n border-radius: 4px;\n padding: 6px 12px;\n font-size: 12px;\n font-weight: 500;\n cursor: pointer;\n}\n\n.bluedot-hud__export-btn:active {\n background: #2563eb;\n}\n\n.bluedot-hud__collapse-icon {\n font-size: 12px;\n color: #94a3b8;\n}\n\n.bluedot-hud__content {\n padding: 4px 0;\n flex: 1;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n}\n\n.bluedot-hud__section {\n padding: 6px 12px;\n}\n\n.bluedot-hud__section:not(:last-child) {\n border-bottom: 1px solid rgba(255, 255, 255, 0.08);\n}\n\n.bluedot-hud__section-title {\n font-weight: 600;\n font-size: 10px;\n color: #64748b;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n margin-bottom: 4px;\n}\n\n.bluedot-hud__row {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 1px 0;\n margin-right: 12px;\n}\n\n.bluedot-hud__label {\n color: #94a3b8;\n font-size: 11px;\n}\n\n.bluedot-hud__value {\n color: #fff;\n font-family: 'SF Mono', Monaco, 'Courier New', monospace;\n font-size: 11px;\n word-break: break-all;\n}\n\n.bluedot-hud__value--enabled {\n color: #4ade80;\n}\n\n.bluedot-hud__value--disabled {\n color: #6b7280;\n}\n\n.bluedot-hud__value--warning {\n color: #fbbf24;\n}\n\n.bluedot-hud__sensors {\n display: flex;\n flex-wrap: wrap;\n}\n\n/* Heading section with compass */\n.bluedot-hud__heading-content {\n display: flex;\n gap: 12px;\n align-items: flex-start;\n}\n\n/* Compass */\n.bluedot-hud__compass {\n position: relative;\n width: 56px;\n height: 56px;\n flex-shrink: 0;\n}\n\n.bluedot-hud__compass-ring {\n position: absolute;\n inset: 0;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-radius: 50%;\n}\n\n.bluedot-hud__compass-dir {\n position: absolute;\n font-size: 8px;\n font-weight: 600;\n color: #94a3b8;\n}\n\n.bluedot-hud__compass-dir--n {\n top: 2px;\n left: 50%;\n transform: translateX(-50%);\n color: #f87171;\n}\n\n.bluedot-hud__compass-dir--e {\n right: 2px;\n top: 50%;\n transform: translateY(-50%);\n}\n\n.bluedot-hud__compass-dir--s {\n bottom: 2px;\n left: 50%;\n transform: translateX(-50%);\n}\n\n.bluedot-hud__compass-dir--w {\n left: 2px;\n top: 50%;\n transform: translateY(-50%);\n}\n\n.bluedot-hud__compass-needle {\n position: absolute;\n left: 50%;\n top: 50%;\n width: 3px;\n height: 20px;\n background: linear-gradient(to top, #3b82f6 0%, #60a5fa 100%);\n border-radius: 2px;\n transform-origin: bottom center;\n transform: translate(-50%, -100%) rotate(0deg);\n transition: transform 0.15s ease-out;\n}\n\n.bluedot-hud__compass-needle::before {\n content: '';\n position: absolute;\n top: -4px;\n left: 50%;\n transform: translateX(-50%);\n width: 0;\n height: 0;\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-bottom: 6px solid #60a5fa;\n}\n\n.bluedot-hud__compass-center {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 6px;\n height: 6px;\n background: #fff;\n border-radius: 50%;\n border: 1px solid #3b82f6;\n}\n\n/* Heading comparison list */\n.bluedot-hud__headings {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.bluedot-hud__heading-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 2px 6px;\n background: rgba(255, 255, 255, 0.05);\n border-radius: 3px;\n font-size: 10px;\n}\n\n.bluedot-hud__heading-row--displayed {\n background: rgba(59, 130, 246, 0.2);\n border: 1px solid rgba(59, 130, 246, 0.3);\n}\n\n.bluedot-hud__heading-label {\n color: #94a3b8;\n font-size: 10px;\n}\n\n.bluedot-hud__heading-value {\n color: #fff;\n font-family: 'SF Mono', Monaco, 'Courier New', monospace;\n font-size: 10px;\n}\n\n.bluedot-hud__heading-diff {\n color: #94a3b8;\n margin-left: 3px;\n font-size: 9px;\n}\n\n.bluedot-hud__heading-diff--warning {\n color: #fbbf24;\n}\n\n/* State modifiers */\n.bluedot-hud--collapsed .bluedot-hud__collapsed {\n display: flex;\n}\n\n.bluedot-hud--collapsed .bluedot-hud__expanded {\n display: none;\n}\n\n.bluedot-hud--expanded .bluedot-hud__collapsed {\n display: none;\n}\n\n.bluedot-hud--expanded .bluedot-hud__expanded {\n display: flex;\n}\n\n/* Tuning section */\n.bluedot-hud__tuning {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.bluedot-hud__tuning-group {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 6px;\n padding: 8px;\n}\n\n.bluedot-hud__tuning-group-title {\n color: #94a3b8;\n font-size: 11px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n margin-bottom: 8px;\n}\n\n.bluedot-hud__tuning-row {\n display: flex;\n flex-direction: column;\n gap: 4px;\n margin-bottom: 10px;\n}\n\n.bluedot-hud__tuning-row--toggle {\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n gap: 8px;\n}\n\n.bluedot-hud__tuning-label-col {\n flex: 1;\n}\n\n.bluedot-hud__tuning-label {\n color: #e2e8f0;\n font-size: 12px;\n}\n\n.bluedot-hud__tuning-desc {\n color: #64748b;\n font-size: 10px;\n line-height: 1.3;\n margin-top: 1px;\n}\n\n.bluedot-hud__tuning-control {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.bluedot-hud__slider {\n flex: 1;\n height: 4px;\n background: #334155;\n border-radius: 2px;\n outline: none;\n -webkit-appearance: none;\n appearance: none;\n}\n\n.bluedot-hud__slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 14px;\n height: 14px;\n background: #3b82f6;\n border-radius: 50%;\n cursor: pointer;\n}\n\n.bluedot-hud__slider::-moz-range-thumb {\n width: 14px;\n height: 14px;\n background: #3b82f6;\n border-radius: 50%;\n cursor: pointer;\n border: none;\n}\n\n.bluedot-hud__slider-value {\n color: #94a3b8;\n font-size: 11px;\n font-family: 'SF Mono', Monaco, 'Courier New', monospace;\n min-width: 40px;\n text-align: right;\n}\n\n.bluedot-hud__toggle {\n width: 36px;\n height: 20px;\n background: #334155;\n border-radius: 10px;\n position: relative;\n -webkit-appearance: none;\n appearance: none;\n outline: none;\n cursor: pointer;\n transition: background 0.2s;\n}\n\n.bluedot-hud__toggle:checked {\n background: #3b82f6;\n}\n\n.bluedot-hud__toggle::before {\n content: '';\n position: absolute;\n top: 2px;\n left: 2px;\n width: 16px;\n height: 16px;\n background: #fff;\n border-radius: 50%;\n transition: transform 0.2s;\n}\n\n.bluedot-hud__toggle:checked::before {\n transform: translateX(16px);\n}\n\n.bluedot-hud__reset-btn {\n background: #334155;\n color: #e2e8f0;\n border: none;\n border-radius: 4px;\n padding: 8px 12px;\n font-size: 12px;\n cursor: pointer;\n transition: background 0.2s;\n margin-top: 8px;\n}\n\n.bluedot-hud__reset-btn:hover {\n background: #475569;\n}\n\n/* Console section */\n.bluedot-hud__console-header {\n display: flex;\n justify-content: flex-end;\n margin-bottom: 6px;\n}\n\n.bluedot-hud__console-clear {\n background: #334155;\n color: #94a3b8;\n border: none;\n border-radius: 3px;\n padding: 4px 8px;\n font-size: 10px;\n cursor: pointer;\n}\n\n.bluedot-hud__console-clear:active {\n background: #475569;\n}\n\n.bluedot-hud__console {\n background: rgba(0, 0, 0, 0.4);\n border-radius: 4px;\n padding: 6px;\n max-height: 200px;\n overflow-y: auto;\n font-family: 'SF Mono', Monaco, 'Courier New', monospace;\n font-size: 10px;\n line-height: 1.4;\n -webkit-overflow-scrolling: touch;\n}\n\n.bluedot-hud__console-line {\n padding: 2px 0;\n word-break: break-word;\n color: #d1d5db;\n}\n\n.bluedot-hud__console-line--warn {\n color: #fbbf24;\n}\n\n.bluedot-hud__console-line--error {\n color: #f87171;\n}\n\n.bluedot-hud__console-time {\n color: #6b7280;\n margin-right: 6px;\n}\n";var Ze="bluedot-debug-hud-css",ht="bluedot-debug-hud",ct=200;function pt(l,t){let n=document.getElementById(t);if(n instanceof HTMLStyleElement){n.textContent=l;return}n=document.createElement("style"),n.id=t,n.textContent=l,document.head.appendChild(n)}d(pt,"injectCSS");function mt(l){let t=Math.floor((Date.now()-l)/1e3);if(t<60)return"".concat(t,"s ago");let n=Math.floor(t/60);return n<60?"".concat(n,"m ago"):"".concat(Math.floor(n/60),"h ago")}d(mt,"formatTimeAgo");function gt(l,t){let n=Math.max(0,Math.floor((l+t-Date.now())/1e3));return n<=0?"expired":n<60?"".concat(n,"s"):"".concat(Math.floor(n/60),"m ").concat(n%60,"s")}d(gt,"formatTimeRemaining");var f,C,T,R,me,ge,g,$,X,P,Y,Z,ee,be,fe,_e,xe,U,W,A,te,ne,oe,ie,G,N,E,B,M,o,et,tt,Ee,Re,nt,ot,z,he,ce,F,we,O,Ue,H,it,Ie,st,at,ze,Pe,Ge,Se,dt,pe,Le,Be=class Be{constructor(t){h(this,o);h(this,f);h(this,C);h(this,T,!0);h(this,R,[]);h(this,me,new Map);h(this,ge,new Map);h(this,g,{heading:S({},V.heading),motion:S({},V.motion)});h(this,$);h(this,X);h(this,P);h(this,Y);h(this,Z);h(this,ee);h(this,be);h(this,fe);h(this,_e);h(this,xe);h(this,U);h(this,W);h(this,A);h(this,te);h(this,ne);h(this,oe);h(this,ie);h(this,G);h(this,N);h(this,E);h(this,B,[]);h(this,M,null);if(u(this,f,t),pt(Qe,Ze),u(this,C,s(this,o,ot).call(this)),!document.body)throw new Error("DebugHUD: document.body is not available. Ensure the DOM is ready before creating the HUD.");document.body.appendChild(e(this,C)),s(this,o,et).call(this),s(this,o,st).call(this),s(this,o,at).call(this)}clearConsole(){u(this,B,[]),s(this,o,Re).call(this)}getTuningConfig(){return S({},e(this,g))}setTuningConfig(t){t.heading&&(e(this,g).heading=S(S({},e(this,g).heading),t.heading)),t.motion&&(e(this,g).motion=S(S({},e(this,g).motion),t.motion)),s(this,o,H).call(this),e(this,N).innerHTML="",s(this,o,we).call(this,e(this,N))}show(){e(this,C).style.display=""}hide(){e(this,C).style.display="none"}get isExpanded(){return!e(this,T)}expand(){e(this,T)&&(u(this,T,!1),e(this,C).classList.remove("bluedot-hud--collapsed"),e(this,C).classList.add("bluedot-hud--expanded"))}collapse(){e(this,T)||(u(this,T,!0),e(this,C).classList.add("bluedot-hud--collapsed"),e(this,C).classList.remove("bluedot-hud--expanded"))}toggleExpanded(){return e(this,T)?this.expand():this.collapse(),!e(this,T)}destroy(){s(this,o,tt).call(this);for(let n of e(this,R))n();u(this,R,[]),e(this,C).remove();let t=document.getElementById(Ze);t&&t.remove()}};f=new WeakMap,C=new WeakMap,T=new WeakMap,R=new WeakMap,me=new WeakMap,ge=new WeakMap,g=new WeakMap,$=new WeakMap,X=new WeakMap,P=new WeakMap,Y=new WeakMap,Z=new WeakMap,ee=new WeakMap,be=new WeakMap,fe=new WeakMap,_e=new WeakMap,xe=new WeakMap,U=new WeakMap,W=new WeakMap,A=new WeakMap,te=new WeakMap,ne=new WeakMap,oe=new WeakMap,ie=new WeakMap,G=new WeakMap,N=new WeakMap,E=new WeakMap,B=new WeakMap,M=new WeakMap,o=new WeakSet,et=d(function(){u(this,M,{log:w.log.bind(w),warn:w.warn.bind(w),error:w.error.bind(w)}),w.log=(...t)=>{e(this,M).log(...t),s(this,o,Ee).call(this,"log",t.map(String).join(" "))},w.warn=(...t)=>{e(this,M).warn(...t),s(this,o,Ee).call(this,"warn",t.map(String).join(" "))},w.error=(...t)=>{e(this,M).error(...t),s(this,o,Ee).call(this,"error",t.map(String).join(" "))}},"#interceptLogger"),tt=d(function(){e(this,M)&&(w.log=e(this,M).log,w.warn=e(this,M).warn,w.error=e(this,M).error,u(this,M,null))},"#restoreLogger"),Ee=d(function(t,n){let i={time:Date.now(),level:t,message:n};e(this,B).push(i),e(this,B).length>ct&&e(this,B).shift(),s(this,o,Re).call(this)},"#addLogEntry"),Re=d(function(){if(!e(this,E))return;let t=e(this,E).scrollHeight-e(this,E).scrollTop<=e(this,E).clientHeight+5;e(this,E).innerHTML="";for(let n of e(this,B)){let i=document.createElement("div");i.className="bluedot-hud__console-line bluedot-hud__console-line--".concat(n.level);let a=new Date(n.time),r="".concat(a.getHours().toString().padStart(2,"0"),":").concat(a.getMinutes().toString().padStart(2,"0"),":").concat(a.getSeconds().toString().padStart(2,"0"),".").concat(a.getMilliseconds().toString().padStart(3,"0"));i.innerHTML='<span class="bluedot-hud__console-time">'.concat(r,"</span> ").concat(s(this,o,nt).call(this,n.message)),e(this,E).appendChild(i)}t&&(e(this,E).scrollTop=e(this,E).scrollHeight)},"#updateConsole"),nt=d(function(t){let n=document.createElement("div");return n.textContent=t,n.innerHTML},"#escapeHtml"),ot=d(function(){let t=document.createElement("div");t.id=ht,t.className="bluedot-hud bluedot-hud--collapsed";let n=document.createElement("div");n.className="bluedot-hud__collapsed",n.addEventListener("click",()=>s(this,o,Ie).call(this)),u(this,$,document.createElement("span")),e(this,$).className="bluedot-hud__status-dot",u(this,X,document.createElement("span")),e(this,X).className="bluedot-hud__status-text",u(this,P,document.createElement("span")),e(this,P).className="bluedot-hud__coords",u(this,Y,document.createElement("span")),e(this,Y).className="bluedot-hud__heading",n.appendChild(e(this,$)),n.appendChild(e(this,X)),n.appendChild(e(this,P)),n.appendChild(e(this,Y));let i=document.createElement("div");i.className="bluedot-hud__expanded";let a=document.createElement("div");a.className="bluedot-hud__header",a.addEventListener("click",()=>s(this,o,Ie).call(this));let r=document.createElement("span");r.className="bluedot-hud__title",r.textContent="BlueDot Debug";let m=document.createElement("div");m.className="bluedot-hud__header-right";let p=document.createElement("button");p.className="bluedot-hud__export-btn",p.textContent="Export",p.addEventListener("click",Ce=>{Ce.stopPropagation(),Ke(e(this,f))});let c=document.createElement("span");c.className="bluedot-hud__collapse-icon",c.textContent="\u25BC",m.appendChild(p),m.appendChild(c),a.appendChild(r),a.appendChild(m);let b=document.createElement("div");b.className="bluedot-hud__content";let _=s(this,o,z).call(this,"Status"),y=document.createElement("div");y.className="bluedot-hud__row",u(this,Z,s(this,o,ce).call(this,"--")),u(this,ee,s(this,o,ce).call(this,"no")),y.appendChild(s(this,o,he).call(this,"Status:")),y.appendChild(e(this,Z)),y.appendChild(s(this,o,he).call(this,"Following:")),y.appendChild(e(this,ee)),_.appendChild(y);let x=s(this,o,z).call(this,"Position");u(this,be,s(this,o,F).call(this,x,"Lat")),u(this,fe,s(this,o,F).call(this,x,"Lon")),u(this,_e,s(this,o,F).call(this,x,"Accuracy")),u(this,xe,s(this,o,F).call(this,x,"Floor"));let re=s(this,o,z).call(this,"Heading"),ve=document.createElement("div");ve.className="bluedot-hud__heading-content";let ue=document.createElement("div");ue.className="bluedot-hud__compass";let Ne=document.createElement("div");Ne.className="bluedot-hud__compass-ring",u(this,W,document.createElement("div")),e(this,W).className="bluedot-hud__compass-needle";let Ye=document.createElement("div");Ye.className="bluedot-hud__compass-center";let lt=["N","E","S","W"];for(let Ce of lt){let Fe=document.createElement("span");Fe.className="bluedot-hud__compass-dir bluedot-hud__compass-dir--".concat(Ce.toLowerCase()),Fe.textContent=Ce,Ne.appendChild(Fe)}ue.appendChild(Ne),ue.appendChild(e(this,W)),ue.appendChild(Ye),u(this,U,document.createElement("div")),e(this,U).className="bluedot-hud__headings",ve.appendChild(ue),ve.appendChild(e(this,U)),re.appendChild(ve);let Q=s(this,o,z).call(this,"Anchor");u(this,A,s(this,o,F).call(this,Q,"Status")),u(this,te,s(this,o,F).call(this,Q,"Position")),u(this,ne,s(this,o,F).call(this,Q,"Set")),u(this,oe,s(this,o,F).call(this,Q,"TTL")),u(this,ie,s(this,o,F).call(this,Q,"Drift"));let We=s(this,o,z).call(this,"Sensors");u(this,G,document.createElement("div")),e(this,G).className="bluedot-hud__sensors",We.appendChild(e(this,G));let qe=s(this,o,z).call(this,"Tuning");u(this,N,document.createElement("div")),e(this,N).className="bluedot-hud__tuning",s(this,o,we).call(this,e(this,N)),qe.appendChild(e(this,N));let ke=s(this,o,z).call(this,"Console"),De=document.createElement("div");De.className="bluedot-hud__console-header";let ye=document.createElement("button");return ye.className="bluedot-hud__console-clear",ye.textContent="Clear",ye.addEventListener("click",()=>this.clearConsole()),De.appendChild(ye),ke.appendChild(De),u(this,E,document.createElement("div")),e(this,E).className="bluedot-hud__console",ke.appendChild(e(this,E)),b.appendChild(_),b.appendChild(x),b.appendChild(re),b.appendChild(Q),b.appendChild(We),b.appendChild(qe),b.appendChild(ke),i.appendChild(a),i.appendChild(b),t.appendChild(n),t.appendChild(i),t},"#createDOM"),z=d(function(t){let n=document.createElement("div");n.className="bluedot-hud__section";let i=document.createElement("div");return i.className="bluedot-hud__section-title",i.textContent=t,n.appendChild(i),n},"#createSection"),he=d(function(t){let n=document.createElement("span");return n.className="bluedot-hud__label",n.textContent=t,n},"#createLabel"),ce=d(function(t){let n=document.createElement("span");return n.className="bluedot-hud__value",n.textContent=t,n},"#createValue"),F=d(function(t,n){let i=document.createElement("div");i.className="bluedot-hud__row",i.appendChild(s(this,o,he).call(this,"".concat(n,":")));let a=s(this,o,ce).call(this,"--");return i.appendChild(a),t.appendChild(i),a},"#appendRow"),we=d(function(t){let n=document.createElement("div");n.className="bluedot-hud__tuning-group",n.innerHTML='<div class="bluedot-hud__tuning-group-title">Heading</div>',s(this,o,O).call(this,n,{id:"heading-responsiveness",label:"Heading responsiveness",description:"Higher = compass corrects heading faster (may jump)",min:0,max:100,value:e(this,g).heading.headingResponsiveness,onChange:d(r=>{e(this,g).heading.headingResponsiveness=r,s(this,o,H).call(this)},"onChange")}),s(this,o,O).call(this,n,{id:"compass-noise",label:"Rotation filtering",description:"Higher = ignore small turns, steadier heading",min:0,max:100,value:e(this,g).heading.compassNoiseTolerance,onChange:d(r=>{e(this,g).heading.compassNoiseTolerance=r,s(this,o,H).call(this)},"onChange")}),s(this,o,O).call(this,n,{id:"snap-threshold",label:"Heading snap threshold",description:"Higher = tolerate more drift before jumping",min:10,max:90,value:e(this,g).heading.headingSnapThreshold,unit:"\xB0",onChange:d(r=>{e(this,g).heading.headingSnapThreshold=r,s(this,o,H).call(this)},"onChange")}),s(this,o,Ue).call(this,n,{id:"magnetic-gating",label:"Magnetic disturbance gating",description:"On = ignore compass near metal/magnets",value:e(this,g).heading.magneticDisturbanceGating,onChange:d(r=>{e(this,g).heading.magneticDisturbanceGating=r,s(this,o,H).call(this)},"onChange")});let i=document.createElement("div");i.className="bluedot-hud__tuning-group",i.innerHTML='<div class="bluedot-hud__tuning-group-title">Motion (PDR)</div>',s(this,o,Ue).call(this,i,{id:"pdr-enabled",label:"PDR enabled",description:"On = dot moves with detected steps",value:e(this,g).motion.pdrEnabled,onChange:d(r=>{e(this,g).motion.pdrEnabled=r,s(this,o,H).call(this)},"onChange")}),s(this,o,O).call(this,i,{id:"step-sensitivity",label:"Step sensitivity",description:"Higher = more steps detected, more false positives",min:0,max:100,value:e(this,g).motion.stepSensitivity,onChange:d(r=>{e(this,g).motion.stepSensitivity=r,s(this,o,H).call(this)},"onChange")}),s(this,o,O).call(this,i,{id:"step-length",label:"Average step length",description:"Higher = dot moves farther per step",min:.4,max:1.2,step:.05,value:e(this,g).motion.averageStepLength,unit:"m",onChange:d(r=>{e(this,g).motion.averageStepLength=r,s(this,o,H).call(this)},"onChange")}),s(this,o,O).call(this,i,{id:"stride-variability",label:"Stride variability",description:"Higher = faster walking = longer steps",min:0,max:100,value:e(this,g).motion.strideVariability,onChange:d(r=>{e(this,g).motion.strideVariability=r,s(this,o,H).call(this)},"onChange")});let a=document.createElement("button");a.className="bluedot-hud__reset-btn",a.textContent="Reset to Defaults",a.addEventListener("click",()=>s(this,o,it).call(this)),t.appendChild(n),t.appendChild(i),t.appendChild(a)},"#createTuningControls"),O=d(function(t,n){var _,y;let i=document.createElement("div");i.className="bluedot-hud__tuning-row";let a=document.createElement("div");a.className="bluedot-hud__tuning-label-row";let r=document.createElement("label");r.className="bluedot-hud__tuning-label",r.htmlFor="bluedot-tuning-".concat(n.id),r.textContent=n.label;let m=document.createElement("div");m.className="bluedot-hud__tuning-desc",m.textContent=n.description,a.appendChild(r),a.appendChild(m);let p=document.createElement("div");p.className="bluedot-hud__tuning-control";let c=document.createElement("input");c.type="range",c.id="bluedot-tuning-".concat(n.id),c.className="bluedot-hud__slider",c.min=String(n.min),c.max=String(n.max),c.step=String((_=n.step)!=null?_:1),c.value=String(n.value);let b=document.createElement("span");b.className="bluedot-hud__slider-value",b.textContent="".concat(n.value).concat((y=n.unit)!=null?y:""),c.addEventListener("input",()=>{var re;let x=parseFloat(c.value);b.textContent="".concat(n.step&&n.step<1?x.toFixed(2):x).concat((re=n.unit)!=null?re:""),n.onChange(x)}),p.appendChild(c),p.appendChild(b),i.appendChild(a),i.appendChild(p),t.appendChild(i)},"#createSlider"),Ue=d(function(t,n){let i=document.createElement("div");i.className="bluedot-hud__tuning-row bluedot-hud__tuning-row--toggle";let a=document.createElement("div");a.className="bluedot-hud__tuning-label-col";let r=document.createElement("label");r.className="bluedot-hud__tuning-label",r.htmlFor="bluedot-tuning-".concat(n.id),r.textContent=n.label;let m=document.createElement("div");m.className="bluedot-hud__tuning-desc",m.textContent=n.description,a.appendChild(r),a.appendChild(m);let p=document.createElement("input");p.type="checkbox",p.id="bluedot-tuning-".concat(n.id),p.className="bluedot-hud__toggle",p.checked=n.value,p.addEventListener("change",()=>{n.onChange(p.checked)}),i.appendChild(a),i.appendChild(p),t.appendChild(i)},"#createToggle"),H=d(function(){let t=$e(e(this,g).heading);e(this,f).Fusion.headingFilter.configure(t);let n=Ae(e(this,g).motion),i=e(this,f).Sensors.get("devicemotion");i==null||i.configure(n);let a=e(this,f).Sensors.get("deviceorientation");a==null||a.configure({deltaThreshold:e(this,g).heading.headingChangeThreshold})},"#applyTuning"),it=d(function(){u(this,g,{heading:S({},V.heading),motion:S({},V.motion)}),s(this,o,H).call(this),e(this,N).innerHTML="",s(this,o,we).call(this,e(this,N))},"#resetTuning"),Ie=d(function(){u(this,T,!e(this,T)),e(this,C).classList.toggle("bluedot-hud--collapsed",e(this,T)),e(this,C).classList.toggle("bluedot-hud--expanded",!e(this,T))},"#toggle"),st=d(function(){let t=e(this,f).on("position-update",()=>s(this,o,Pe).call(this)),n=e(this,f).on("status-change",()=>s(this,o,ze).call(this)),i=e(this,f).on("follow-change",()=>s(this,o,Ge).call(this)),a=e(this,f).on("anchor-set",()=>s(this,o,pe).call(this)),r=e(this,f).on("anchor-expired",()=>s(this,o,pe).call(this));e(this,R).push(t,n,i,a,r);let m=e(this,f).Sensors.on("absolute-update",({sensorId:b,update:_})=>{_.heading!==void 0&&(e(this,me).set(b,_.heading),s(this,o,Se).call(this)),(_.accuracy!==void 0||_.confidence!==void 0)&&(e(this,ge).set(b,{accuracy:_.accuracy,confidence:_.confidence}),s(this,o,Le).call(this))});e(this,R).push(m);let p=setInterval(()=>s(this,o,pe).call(this),1e3);e(this,R).push(()=>clearInterval(p));let c=setInterval(()=>s(this,o,Le).call(this),1e3);e(this,R).push(()=>clearInterval(c))},"#subscribeToEvents"),at=d(function(){s(this,o,ze).call(this),s(this,o,Pe).call(this),s(this,o,Ge).call(this),s(this,o,Se).call(this),s(this,o,pe).call(this),s(this,o,Le).call(this)},"#updateAll"),ze=d(function(){let t=e(this,f).status;e(this,X).textContent=t,e(this,Z).textContent=t,e(this,$).classList.remove("bluedot-hud__status-dot--active","bluedot-hud__status-dot--inactive","bluedot-hud__status-dot--error"),t==="active"?e(this,$).classList.add("bluedot-hud__status-dot--active"):t==="inactive"||t==="hidden"?e(this,$).classList.add("bluedot-hud__status-dot--inactive"):e(this,$).classList.add("bluedot-hud__status-dot--error")},"#updateStatus"),Pe=d(function(){var a;let t=e(this,f).coordinate,n=e(this,f).accuracy,i=e(this,f).floor;t?e(this,P).textContent="".concat(t.latitude.toFixed(5),", ").concat(t.longitude.toFixed(5)):e(this,P).textContent="--",e(this,be).textContent=t?t.latitude.toFixed(6):"--",e(this,fe).textContent=t?t.longitude.toFixed(6):"--",e(this,_e).textContent=n!=null?"".concat(n.toFixed(1),"m"):"--",e(this,xe).textContent=(a=i==null?void 0:i.name)!=null?a:"--",s(this,o,Se).call(this)},"#updatePosition"),Ge=d(function(){e(this,ee).textContent=e(this,f).isFollowing?"yes":"no"},"#updateFollowing"),Se=d(function(){let t=e(this,f).heading;e(this,Y).textContent=t!=null?"".concat(t.toFixed(0),"\xB0"):"--",t!=null&&(e(this,W).style.transform="translate(-50%, -100%) rotate(".concat(t,"deg)")),e(this,U).innerHTML="";let n=document.createElement("div");n.className="bluedot-hud__heading-row bluedot-hud__heading-row--displayed",n.innerHTML='\n <span class="bluedot-hud__heading-label">Displayed</span>\n <span class="bluedot-hud__heading-value">'.concat(t!=null?"".concat(t.toFixed(0),"\xB0"):"--","</span>\n "),e(this,U).appendChild(n);for(let[i,a]of e(this,me)){let r=document.createElement("div");r.className="bluedot-hud__heading-row";let m=a!=null&&t!=null?s(this,o,dt).call(this,a-t):null,p=m!=null?" (".concat(m>=0?"+":"").concat(m.toFixed(0),"\xB0)"):"",c=m!=null&&Math.abs(m)>10?"bluedot-hud__heading-diff--warning":"";r.innerHTML='\n <span class="bluedot-hud__heading-label">'.concat(i,'</span>\n <span class="bluedot-hud__heading-value">').concat(a!=null?"".concat(a.toFixed(0),"\xB0"):"--",'<span class="bluedot-hud__heading-diff ').concat(c,'">').concat(p,"</span></span>\n "),e(this,U).appendChild(r)}},"#updateHeadings"),dt=d(function(t){for(;t>180;)t-=360;for(;t<-180;)t+=360;return t},"#normalizeAngleDiff"),pe=d(function(){let t=e(this,f).anchor,n=e(this,f).displacement;if(t){e(this,A).textContent="set (".concat(t.sensorId,")"),e(this,A).classList.add("bluedot-hud__value--enabled"),e(this,A).classList.remove("bluedot-hud__value--disabled"),e(this,te).textContent="".concat(t.latitude.toFixed(6),", ").concat(t.longitude.toFixed(6)),e(this,ne).textContent=mt(t.timestamp),e(this,oe).textContent=gt(t.timestamp,t.ttl);let i=Math.sqrt(n.dx**2+n.dy**2);e(this,ie).textContent="dx=".concat(n.dx>=0?"+":"").concat(n.dx.toFixed(2),"m, dy=").concat(n.dy>=0?"+":"").concat(n.dy.toFixed(2),"m (").concat(i.toFixed(2),"m)")}else e(this,A).textContent="none",e(this,A).classList.remove("bluedot-hud__value--enabled"),e(this,A).classList.add("bluedot-hud__value--disabled"),e(this,te).textContent="--",e(this,ne).textContent="--",e(this,oe).textContent="--",e(this,ie).textContent="--"},"#updateAnchor"),Le=d(function(){var t;e(this,G).innerHTML="";for(let[n,i]of e(this,f).Sensors.getAll()){let a=document.createElement("div");a.className="bluedot-hud__row";let r="".concat(n,":");n==="geolocation"&&(r=i.isLikelyIPS?"IPS (Wi-Fi):":"GPS:");let m=s(this,o,he).call(this,r),p=i.isEnabled?"enabled":"disabled",c=e(this,ge).get(n);if(i.isEnabled&&c){let x=[];c.accuracy!==void 0&&x.push("".concat(c.accuracy.toFixed(1),"m")),c.confidence!==void 0&&x.push("conf=".concat((c.confidence*100).toFixed(0),"%")),x.length>0&&(p=x.join(", "))}let b=s(this,o,ce).call(this,p);b.classList.add(i.isEnabled?"bluedot-hud__value--enabled":"bluedot-hud__value--disabled");let _=n==="geolocation"?i:null,y=(t=_==null?void 0:_.isLikelyIPS)!=null?t:!1;(c==null?void 0:c.confidence)!==void 0&&c.confidence<.5&&!y&&b.classList.add("bluedot-hud__value--warning"),a.appendChild(m),a.appendChild(b),e(this,G).appendChild(a)}},"#updateSensors"),d(Be,"DebugHUD");var Me=Be;D();var v,se,ae,Ve=class Ve{constructor(t=100){h(this,v,[]);h(this,se);h(this,ae,0);u(this,se,t)}record(t,n=Date.now()){e(this,v).push(t),e(this,v).length>e(this,se)&&e(this,v).shift(),u(this,ae,n)}getRate(){if(e(this,v).length<2)return 0;let t=e(this,ae)-(Date.now()-e(this,se)*100);return t>0?e(this,v).length/t*1e3:0}getAverage(){if(e(this,v).length===0)return 0;let t=0;for(let n of e(this,v))t+=n;return t/e(this,v).length}getLatest(){return e(this,v)[e(this,v).length-1]}getCount(){return e(this,v).length}clear(){u(this,v,[]),u(this,ae,0)}};v=new WeakMap,se=new WeakMap,ae=new WeakMap,d(Ve,"MetricTracker");var q=Ve,k,de,le,He,Oe=class Oe{constructor(t=5e3){h(this,le);h(this,k,[]);h(this,de);u(this,de,t)}tick(t=Date.now()){e(this,k).push(t),s(this,le,He).call(this,t)}getRate(t=Date.now()){return s(this,le,He).call(this,t),e(this,k).length===0?0:e(this,k).length/e(this,de)*1e3}getCount(t=Date.now()){return s(this,le,He).call(this,t),e(this,k).length}clear(){u(this,k,[])}};k=new WeakMap,de=new WeakMap,le=new WeakSet,He=d(function(t){let n=t-e(this,de);for(;e(this,k).length>0&&e(this,k)[0]<n;)e(this,k).shift()},"#prune"),d(Oe,"EventCounter");var J=Oe,K,j,Xe=class Xe{constructor(){h(this,K,new Map);h(this,j,!1);L(this,"compassUpdates",new J);L(this,"gyroUpdates",new J);L(this,"stepsDetected",new J);L(this,"positionUpdates",new J);L(this,"compassHeading",new q(50));L(this,"gyroAngularVelocity",new q(50));L(this,"stepLength",new q(20));L(this,"positionAccuracy",new q(20));L(this,"isMoving",!1);L(this,"magneticDisturbanceActive",!1);L(this,"lastFusedHeading",null)}enable(){u(this,j,!0)}disable(){u(this,j,!1)}get isEnabled(){return e(this,j)}emit(t,n){if(!e(this,j))return;let i=Date.now();switch(t){case"compass-update":this.compassUpdates.tick(i),this.compassHeading.record(n.heading,i);break;case"gyro-update":this.gyroUpdates.tick(i),this.gyroAngularVelocity.record(n.angularVelocity,i);break;case"step-detected":this.stepsDetected.tick(i),this.stepLength.record(n.stepLength,i);break;case"motion-state":this.isMoving=n.isMoving;break;case"magnetic-disturbance":this.magneticDisturbanceActive=n.active;break;case"heading-fused":this.lastFusedHeading=n.heading;break;case"position-update":this.positionUpdates.tick(i),this.positionAccuracy.record(n.accuracy,i);break}let a=e(this,K).get(t);if(a)for(let r of a)r(n)}on(t,n){let i=e(this,K).get(t);return i||(i=new Set,e(this,K).set(t,i)),i.add(n),()=>{i.delete(n)}}getSummary(){return{compassRate:this.compassUpdates.getRate(),gyroRate:this.gyroUpdates.getRate(),stepRate:this.stepsDetected.getRate(),positionRate:this.positionUpdates.getRate(),avgCompassHeading:this.compassHeading.getAverage(),avgGyroVelocity:this.gyroAngularVelocity.getAverage(),avgStepLength:this.stepLength.getAverage(),avgAccuracy:this.positionAccuracy.getAverage(),isMoving:this.isMoving,magneticDisturbanceActive:this.magneticDisturbanceActive,lastFusedHeading:this.lastFusedHeading}}clear(){this.compassUpdates.clear(),this.gyroUpdates.clear(),this.stepsDetected.clear(),this.positionUpdates.clear(),this.compassHeading.clear(),this.gyroAngularVelocity.clear(),this.stepLength.clear(),this.positionAccuracy.clear(),this.isMoving=!1,this.magneticDisturbanceActive=!1,this.lastFusedHeading=null}destroy(){this.clear(),e(this,K).clear(),u(this,j,!1)}};K=new WeakMap,j=new WeakMap,d(Xe,"Telemetry");var je=Xe;function $t(l){return new Me(l)}d($t,"enableDebugHUD");export{V as DEFAULT_TUNING_CONFIG,J as EventCounter,q as MetricTracker,je as Telemetry,$t as enableDebugHUD,$e as headingConfigToFilterParams,Ae as motionConfigToSensorParams,rt as normalizeTuningConfig};
|
|
1
|
+
import{a,d as w,e,f as h,g as u,h as i,j as N,k as T}from"../chunk-T4TSXXQK.js";N();N();N();function Je(d){let t={};for(let[l,m]of d.Sensors.getAll())t[l]={enabled:m.isEnabled};let n={timestamp:Date.now(),state:d.getState(),position:d.coordinate?{lat:d.coordinate.latitude,lon:d.coordinate.longitude,floor:d.floor?.name}:null,accuracy:d.accuracy,heading:d.heading,sensors:t,anchor:d.anchor,displacement:d.displacement},s=new Blob([JSON.stringify(n,null,2)],{type:"application/json"}),r=new File([s],`bluedot-debug-${Date.now()}.json`,{type:"application/json"});navigator.canShare?.({files:[r]})?navigator.share({files:[r]}).catch(()=>{qe(s,r.name)}):qe(s,r.name)}a(Je,"exportDebugData");function qe(d,t){let n=URL.createObjectURL(d),s=document.createElement("a");s.href=n,s.download=t,s.click(),URL.revokeObjectURL(n)}a(qe,"downloadFile");N();var B={heading:{headingResponsiveness:40,compassNoiseTolerance:30,headingSnapThreshold:10,magneticDisturbanceGating:!0,headingChangeThreshold:2},motion:{stepSensitivity:50,averageStepLength:.7,strideVariability:0,motionResponsiveness:50,pdrEnabled:!0}};function De(d){return{complementaryAlpha:.99-d.headingResponsiveness/100*.79,gyroNoiseThreshold:.1+d.compassNoiseTolerance/100*4.9,maxHeadingError:d.headingSnapThreshold,magneticGatingEnabled:d.magneticDisturbanceGating,deltaThreshold:d.headingChangeThreshold}}a(De,"headingConfigToFilterParams");function Fe(d){return{stepDetectionThreshold:2-d.stepSensitivity/100*1.5,stepLength:d.averageStepLength,strideAdaptation:d.strideVariability/100*.3,motionThreshold:1-d.motionResponsiveness/100*.8,pdrEnabled:d.pdrEnabled}}a(Fe,"motionConfigToSensorParams");function R(d,t,n){return Math.min(Math.max(d,t),n)}a(R,"clamp");function rt(d){let t={...B};return d.heading&&(t.heading={headingResponsiveness:R(d.heading.headingResponsiveness??30,0,100),compassNoiseTolerance:R(d.heading.compassNoiseTolerance??50,0,100),headingSnapThreshold:R(d.heading.headingSnapThreshold??30,10,90),magneticDisturbanceGating:d.heading.magneticDisturbanceGating??!0,headingChangeThreshold:R(d.heading.headingChangeThreshold??2,1,10)}),d.motion&&(t.motion={stepSensitivity:R(d.motion.stepSensitivity??50,0,100),averageStepLength:R(d.motion.averageStepLength??.7,.4,1.2),strideVariability:R(d.motion.strideVariability??0,0,100),motionResponsiveness:R(d.motion.motionResponsiveness??50,0,100),pdrEnabled:d.motion.pdrEnabled??!0}),t}a(rt,"normalizeTuningConfig");var Ke=`.bluedot-hud {
|
|
2
|
+
position: fixed;
|
|
3
|
+
bottom: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
right: 0;
|
|
6
|
+
z-index: 10000;
|
|
7
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
8
|
+
font-size: 14px;
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.bluedot-hud--expanded {
|
|
13
|
+
top: 0;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.bluedot-hud * {
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* Collapsed bar */
|
|
23
|
+
.bluedot-hud__collapsed {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: 10px;
|
|
27
|
+
padding: 8px 12px;
|
|
28
|
+
background: rgba(0, 0, 0, 0.85);
|
|
29
|
+
color: #fff;
|
|
30
|
+
pointer-events: auto;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
min-height: 36px;
|
|
33
|
+
backdrop-filter: blur(8px);
|
|
34
|
+
-webkit-backdrop-filter: blur(8px);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.bluedot-hud__status-dot {
|
|
38
|
+
width: 8px;
|
|
39
|
+
height: 8px;
|
|
40
|
+
border-radius: 50%;
|
|
41
|
+
flex-shrink: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.bluedot-hud__status-dot--active {
|
|
45
|
+
background: #4ade80;
|
|
46
|
+
box-shadow: 0 0 4px #4ade80;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.bluedot-hud__status-dot--inactive {
|
|
50
|
+
background: #9ca3af;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.bluedot-hud__status-dot--error {
|
|
54
|
+
background: #f87171;
|
|
55
|
+
box-shadow: 0 0 4px #f87171;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.bluedot-hud__status-text {
|
|
59
|
+
font-weight: 600;
|
|
60
|
+
font-size: 12px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.bluedot-hud__coords {
|
|
64
|
+
color: #94a3b8;
|
|
65
|
+
font-family: 'SF Mono', Monaco, 'Courier New', monospace;
|
|
66
|
+
font-size: 10px;
|
|
67
|
+
flex: 1;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.bluedot-hud__heading {
|
|
71
|
+
color: #60a5fa;
|
|
72
|
+
font-family: 'SF Mono', Monaco, 'Courier New', monospace;
|
|
73
|
+
font-size: 11px;
|
|
74
|
+
font-weight: 600;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Expanded panel */
|
|
78
|
+
.bluedot-hud__expanded {
|
|
79
|
+
display: none;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
background: rgba(0, 0, 0, 0.92);
|
|
82
|
+
color: #fff;
|
|
83
|
+
pointer-events: auto;
|
|
84
|
+
flex: 1;
|
|
85
|
+
overflow: hidden;
|
|
86
|
+
backdrop-filter: blur(12px);
|
|
87
|
+
-webkit-backdrop-filter: blur(12px);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.bluedot-hud__header {
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: space-between;
|
|
94
|
+
padding: 10px 12px;
|
|
95
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
min-height: 40px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.bluedot-hud__title {
|
|
101
|
+
font-weight: 600;
|
|
102
|
+
font-size: 14px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.bluedot-hud__header-right {
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
gap: 12px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.bluedot-hud__export-btn {
|
|
112
|
+
background: #3b82f6;
|
|
113
|
+
color: #fff;
|
|
114
|
+
border: none;
|
|
115
|
+
border-radius: 4px;
|
|
116
|
+
padding: 6px 12px;
|
|
117
|
+
font-size: 12px;
|
|
118
|
+
font-weight: 500;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.bluedot-hud__export-btn:active {
|
|
123
|
+
background: #2563eb;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.bluedot-hud__collapse-icon {
|
|
127
|
+
font-size: 12px;
|
|
128
|
+
color: #94a3b8;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.bluedot-hud__content {
|
|
132
|
+
padding: 4px 0;
|
|
133
|
+
flex: 1;
|
|
134
|
+
overflow-y: auto;
|
|
135
|
+
-webkit-overflow-scrolling: touch;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.bluedot-hud__section {
|
|
139
|
+
padding: 6px 12px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.bluedot-hud__section:not(:last-child) {
|
|
143
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.bluedot-hud__section-title {
|
|
147
|
+
font-weight: 600;
|
|
148
|
+
font-size: 10px;
|
|
149
|
+
color: #64748b;
|
|
150
|
+
text-transform: uppercase;
|
|
151
|
+
letter-spacing: 0.5px;
|
|
152
|
+
margin-bottom: 4px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.bluedot-hud__row {
|
|
156
|
+
display: inline-flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
gap: 4px;
|
|
159
|
+
padding: 1px 0;
|
|
160
|
+
margin-right: 12px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.bluedot-hud__label {
|
|
164
|
+
color: #94a3b8;
|
|
165
|
+
font-size: 11px;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.bluedot-hud__value {
|
|
169
|
+
color: #fff;
|
|
170
|
+
font-family: 'SF Mono', Monaco, 'Courier New', monospace;
|
|
171
|
+
font-size: 11px;
|
|
172
|
+
word-break: break-all;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.bluedot-hud__value--enabled {
|
|
176
|
+
color: #4ade80;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.bluedot-hud__value--disabled {
|
|
180
|
+
color: #6b7280;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.bluedot-hud__value--warning {
|
|
184
|
+
color: #fbbf24;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.bluedot-hud__sensors {
|
|
188
|
+
display: flex;
|
|
189
|
+
flex-wrap: wrap;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/* Heading section with compass */
|
|
193
|
+
.bluedot-hud__heading-content {
|
|
194
|
+
display: flex;
|
|
195
|
+
gap: 12px;
|
|
196
|
+
align-items: flex-start;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* Compass */
|
|
200
|
+
.bluedot-hud__compass {
|
|
201
|
+
position: relative;
|
|
202
|
+
width: 56px;
|
|
203
|
+
height: 56px;
|
|
204
|
+
flex-shrink: 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.bluedot-hud__compass-ring {
|
|
208
|
+
position: absolute;
|
|
209
|
+
inset: 0;
|
|
210
|
+
border: 2px solid rgba(255, 255, 255, 0.3);
|
|
211
|
+
border-radius: 50%;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.bluedot-hud__compass-dir {
|
|
215
|
+
position: absolute;
|
|
216
|
+
font-size: 8px;
|
|
217
|
+
font-weight: 600;
|
|
218
|
+
color: #94a3b8;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.bluedot-hud__compass-dir--n {
|
|
222
|
+
top: 2px;
|
|
223
|
+
left: 50%;
|
|
224
|
+
transform: translateX(-50%);
|
|
225
|
+
color: #f87171;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.bluedot-hud__compass-dir--e {
|
|
229
|
+
right: 2px;
|
|
230
|
+
top: 50%;
|
|
231
|
+
transform: translateY(-50%);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.bluedot-hud__compass-dir--s {
|
|
235
|
+
bottom: 2px;
|
|
236
|
+
left: 50%;
|
|
237
|
+
transform: translateX(-50%);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.bluedot-hud__compass-dir--w {
|
|
241
|
+
left: 2px;
|
|
242
|
+
top: 50%;
|
|
243
|
+
transform: translateY(-50%);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.bluedot-hud__compass-needle {
|
|
247
|
+
position: absolute;
|
|
248
|
+
left: 50%;
|
|
249
|
+
top: 50%;
|
|
250
|
+
width: 3px;
|
|
251
|
+
height: 20px;
|
|
252
|
+
background: linear-gradient(to top, #3b82f6 0%, #60a5fa 100%);
|
|
253
|
+
border-radius: 2px;
|
|
254
|
+
transform-origin: bottom center;
|
|
255
|
+
transform: translate(-50%, -100%) rotate(0deg);
|
|
256
|
+
transition: transform 0.15s ease-out;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.bluedot-hud__compass-needle::before {
|
|
260
|
+
content: '';
|
|
261
|
+
position: absolute;
|
|
262
|
+
top: -4px;
|
|
263
|
+
left: 50%;
|
|
264
|
+
transform: translateX(-50%);
|
|
265
|
+
width: 0;
|
|
266
|
+
height: 0;
|
|
267
|
+
border-left: 4px solid transparent;
|
|
268
|
+
border-right: 4px solid transparent;
|
|
269
|
+
border-bottom: 6px solid #60a5fa;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.bluedot-hud__compass-center {
|
|
273
|
+
position: absolute;
|
|
274
|
+
left: 50%;
|
|
275
|
+
top: 50%;
|
|
276
|
+
transform: translate(-50%, -50%);
|
|
277
|
+
width: 6px;
|
|
278
|
+
height: 6px;
|
|
279
|
+
background: #fff;
|
|
280
|
+
border-radius: 50%;
|
|
281
|
+
border: 1px solid #3b82f6;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/* Heading comparison list */
|
|
285
|
+
.bluedot-hud__headings {
|
|
286
|
+
flex: 1;
|
|
287
|
+
display: flex;
|
|
288
|
+
flex-direction: column;
|
|
289
|
+
gap: 2px;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.bluedot-hud__heading-row {
|
|
293
|
+
display: flex;
|
|
294
|
+
justify-content: space-between;
|
|
295
|
+
align-items: center;
|
|
296
|
+
padding: 2px 6px;
|
|
297
|
+
background: rgba(255, 255, 255, 0.05);
|
|
298
|
+
border-radius: 3px;
|
|
299
|
+
font-size: 10px;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.bluedot-hud__heading-row--displayed {
|
|
303
|
+
background: rgba(59, 130, 246, 0.2);
|
|
304
|
+
border: 1px solid rgba(59, 130, 246, 0.3);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.bluedot-hud__heading-label {
|
|
308
|
+
color: #94a3b8;
|
|
309
|
+
font-size: 10px;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.bluedot-hud__heading-value {
|
|
313
|
+
color: #fff;
|
|
314
|
+
font-family: 'SF Mono', Monaco, 'Courier New', monospace;
|
|
315
|
+
font-size: 10px;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.bluedot-hud__heading-diff {
|
|
319
|
+
color: #94a3b8;
|
|
320
|
+
margin-left: 3px;
|
|
321
|
+
font-size: 9px;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.bluedot-hud__heading-diff--warning {
|
|
325
|
+
color: #fbbf24;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/* State modifiers */
|
|
329
|
+
.bluedot-hud--collapsed .bluedot-hud__collapsed {
|
|
330
|
+
display: flex;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.bluedot-hud--collapsed .bluedot-hud__expanded {
|
|
334
|
+
display: none;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.bluedot-hud--expanded .bluedot-hud__collapsed {
|
|
338
|
+
display: none;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.bluedot-hud--expanded .bluedot-hud__expanded {
|
|
342
|
+
display: flex;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/* Tuning section */
|
|
346
|
+
.bluedot-hud__tuning {
|
|
347
|
+
display: flex;
|
|
348
|
+
flex-direction: column;
|
|
349
|
+
gap: 12px;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.bluedot-hud__tuning-group {
|
|
353
|
+
background: rgba(0, 0, 0, 0.2);
|
|
354
|
+
border-radius: 6px;
|
|
355
|
+
padding: 8px;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.bluedot-hud__tuning-group-title {
|
|
359
|
+
color: #94a3b8;
|
|
360
|
+
font-size: 11px;
|
|
361
|
+
font-weight: 600;
|
|
362
|
+
text-transform: uppercase;
|
|
363
|
+
letter-spacing: 0.5px;
|
|
364
|
+
margin-bottom: 8px;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.bluedot-hud__tuning-row {
|
|
368
|
+
display: flex;
|
|
369
|
+
flex-direction: column;
|
|
370
|
+
gap: 4px;
|
|
371
|
+
margin-bottom: 10px;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.bluedot-hud__tuning-row--toggle {
|
|
375
|
+
flex-direction: row;
|
|
376
|
+
justify-content: space-between;
|
|
377
|
+
align-items: flex-start;
|
|
378
|
+
gap: 8px;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.bluedot-hud__tuning-label-col {
|
|
382
|
+
flex: 1;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.bluedot-hud__tuning-label {
|
|
386
|
+
color: #e2e8f0;
|
|
387
|
+
font-size: 12px;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.bluedot-hud__tuning-desc {
|
|
391
|
+
color: #64748b;
|
|
392
|
+
font-size: 10px;
|
|
393
|
+
line-height: 1.3;
|
|
394
|
+
margin-top: 1px;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.bluedot-hud__tuning-control {
|
|
398
|
+
display: flex;
|
|
399
|
+
align-items: center;
|
|
400
|
+
gap: 8px;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.bluedot-hud__slider {
|
|
404
|
+
flex: 1;
|
|
405
|
+
height: 4px;
|
|
406
|
+
background: #334155;
|
|
407
|
+
border-radius: 2px;
|
|
408
|
+
outline: none;
|
|
409
|
+
-webkit-appearance: none;
|
|
410
|
+
appearance: none;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.bluedot-hud__slider::-webkit-slider-thumb {
|
|
414
|
+
-webkit-appearance: none;
|
|
415
|
+
appearance: none;
|
|
416
|
+
width: 14px;
|
|
417
|
+
height: 14px;
|
|
418
|
+
background: #3b82f6;
|
|
419
|
+
border-radius: 50%;
|
|
420
|
+
cursor: pointer;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.bluedot-hud__slider::-moz-range-thumb {
|
|
424
|
+
width: 14px;
|
|
425
|
+
height: 14px;
|
|
426
|
+
background: #3b82f6;
|
|
427
|
+
border-radius: 50%;
|
|
428
|
+
cursor: pointer;
|
|
429
|
+
border: none;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.bluedot-hud__slider-value {
|
|
433
|
+
color: #94a3b8;
|
|
434
|
+
font-size: 11px;
|
|
435
|
+
font-family: 'SF Mono', Monaco, 'Courier New', monospace;
|
|
436
|
+
min-width: 40px;
|
|
437
|
+
text-align: right;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.bluedot-hud__toggle {
|
|
441
|
+
width: 36px;
|
|
442
|
+
height: 20px;
|
|
443
|
+
background: #334155;
|
|
444
|
+
border-radius: 10px;
|
|
445
|
+
position: relative;
|
|
446
|
+
-webkit-appearance: none;
|
|
447
|
+
appearance: none;
|
|
448
|
+
outline: none;
|
|
449
|
+
cursor: pointer;
|
|
450
|
+
transition: background 0.2s;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.bluedot-hud__toggle:checked {
|
|
454
|
+
background: #3b82f6;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.bluedot-hud__toggle::before {
|
|
458
|
+
content: '';
|
|
459
|
+
position: absolute;
|
|
460
|
+
top: 2px;
|
|
461
|
+
left: 2px;
|
|
462
|
+
width: 16px;
|
|
463
|
+
height: 16px;
|
|
464
|
+
background: #fff;
|
|
465
|
+
border-radius: 50%;
|
|
466
|
+
transition: transform 0.2s;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.bluedot-hud__toggle:checked::before {
|
|
470
|
+
transform: translateX(16px);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.bluedot-hud__reset-btn {
|
|
474
|
+
background: #334155;
|
|
475
|
+
color: #e2e8f0;
|
|
476
|
+
border: none;
|
|
477
|
+
border-radius: 4px;
|
|
478
|
+
padding: 8px 12px;
|
|
479
|
+
font-size: 12px;
|
|
480
|
+
cursor: pointer;
|
|
481
|
+
transition: background 0.2s;
|
|
482
|
+
margin-top: 8px;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
.bluedot-hud__reset-btn:hover {
|
|
486
|
+
background: #475569;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/* Console section */
|
|
490
|
+
.bluedot-hud__console-header {
|
|
491
|
+
display: flex;
|
|
492
|
+
justify-content: flex-end;
|
|
493
|
+
margin-bottom: 6px;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.bluedot-hud__console-clear {
|
|
497
|
+
background: #334155;
|
|
498
|
+
color: #94a3b8;
|
|
499
|
+
border: none;
|
|
500
|
+
border-radius: 3px;
|
|
501
|
+
padding: 4px 8px;
|
|
502
|
+
font-size: 10px;
|
|
503
|
+
cursor: pointer;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
.bluedot-hud__console-clear:active {
|
|
507
|
+
background: #475569;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.bluedot-hud__console {
|
|
511
|
+
background: rgba(0, 0, 0, 0.4);
|
|
512
|
+
border-radius: 4px;
|
|
513
|
+
padding: 6px;
|
|
514
|
+
max-height: 200px;
|
|
515
|
+
overflow-y: auto;
|
|
516
|
+
font-family: 'SF Mono', Monaco, 'Courier New', monospace;
|
|
517
|
+
font-size: 10px;
|
|
518
|
+
line-height: 1.4;
|
|
519
|
+
-webkit-overflow-scrolling: touch;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.bluedot-hud__console-line {
|
|
523
|
+
padding: 2px 0;
|
|
524
|
+
word-break: break-word;
|
|
525
|
+
color: #d1d5db;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
.bluedot-hud__console-line--warn {
|
|
529
|
+
color: #fbbf24;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.bluedot-hud__console-line--error {
|
|
533
|
+
color: #f87171;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.bluedot-hud__console-time {
|
|
537
|
+
color: #6b7280;
|
|
538
|
+
margin-right: 6px;
|
|
539
|
+
}
|
|
540
|
+
`;var Qe="bluedot-debug-hud-css",ut="bluedot-debug-hud",ht=200;function ct(d,t){let n=document.getElementById(t);if(n instanceof HTMLStyleElement){n.textContent=d;return}n=document.createElement("style"),n.id=t,n.textContent=d,document.head.appendChild(n)}a(ct,"injectCSS");function pt(d){let t=Math.floor((Date.now()-d)/1e3);if(t<60)return`${t}s ago`;let n=Math.floor(t/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}a(pt,"formatTimeAgo");function mt(d,t){let n=Math.max(0,Math.floor((d+t-Date.now())/1e3));return n<=0?"expired":n<60?`${n}s`:`${Math.floor(n/60)}m ${n%60}s`}a(mt,"formatTimeRemaining");var g,v,y,$,ce,pe,p,D,V,I,O,K,Q,me,ge,be,fe,A,X,F,Z,ee,te,ne,z,M,C,P,S,o,Ze,et,Ce,$e,tt,nt,U,le,ue,k,Te,j,Ae,L,ot,Re,it,st,Ue,Ie,ze,Ee,at,he,we,Pe=class Pe{constructor(t){h(this,o);h(this,g);h(this,v);h(this,y,!0);h(this,$,[]);h(this,ce,new Map);h(this,pe,new Map);h(this,p,{heading:{...B.heading},motion:{...B.motion}});h(this,D);h(this,V);h(this,I);h(this,O);h(this,K);h(this,Q);h(this,me);h(this,ge);h(this,be);h(this,fe);h(this,A);h(this,X);h(this,F);h(this,Z);h(this,ee);h(this,te);h(this,ne);h(this,z);h(this,M);h(this,C);h(this,P,[]);h(this,S,null);if(u(this,g,t),ct(Ke,Qe),u(this,v,i(this,o,nt).call(this)),!document.body)throw new Error("DebugHUD: document.body is not available. Ensure the DOM is ready before creating the HUD.");document.body.appendChild(e(this,v)),i(this,o,Ze).call(this),i(this,o,it).call(this),i(this,o,st).call(this)}clearConsole(){u(this,P,[]),i(this,o,$e).call(this)}getTuningConfig(){return{...e(this,p)}}setTuningConfig(t){t.heading&&(e(this,p).heading={...e(this,p).heading,...t.heading}),t.motion&&(e(this,p).motion={...e(this,p).motion,...t.motion}),i(this,o,L).call(this),e(this,M).innerHTML="",i(this,o,Te).call(this,e(this,M))}show(){e(this,v).style.display=""}hide(){e(this,v).style.display="none"}get isExpanded(){return!e(this,y)}expand(){e(this,y)&&(u(this,y,!1),e(this,v).classList.remove("bluedot-hud--collapsed"),e(this,v).classList.add("bluedot-hud--expanded"))}collapse(){e(this,y)||(u(this,y,!0),e(this,v).classList.add("bluedot-hud--collapsed"),e(this,v).classList.remove("bluedot-hud--expanded"))}toggleExpanded(){return e(this,y)?this.expand():this.collapse(),!e(this,y)}destroy(){i(this,o,et).call(this);for(let n of e(this,$))n();u(this,$,[]),e(this,v).remove();let t=document.getElementById(Qe);t&&t.remove()}};g=new WeakMap,v=new WeakMap,y=new WeakMap,$=new WeakMap,ce=new WeakMap,pe=new WeakMap,p=new WeakMap,D=new WeakMap,V=new WeakMap,I=new WeakMap,O=new WeakMap,K=new WeakMap,Q=new WeakMap,me=new WeakMap,ge=new WeakMap,be=new WeakMap,fe=new WeakMap,A=new WeakMap,X=new WeakMap,F=new WeakMap,Z=new WeakMap,ee=new WeakMap,te=new WeakMap,ne=new WeakMap,z=new WeakMap,M=new WeakMap,C=new WeakMap,P=new WeakMap,S=new WeakMap,o=new WeakSet,Ze=a(function(){u(this,S,{log:T.log.bind(T),warn:T.warn.bind(T),error:T.error.bind(T)}),T.log=(...t)=>{e(this,S).log(...t),i(this,o,Ce).call(this,"log",t.map(String).join(" "))},T.warn=(...t)=>{e(this,S).warn(...t),i(this,o,Ce).call(this,"warn",t.map(String).join(" "))},T.error=(...t)=>{e(this,S).error(...t),i(this,o,Ce).call(this,"error",t.map(String).join(" "))}},"#interceptLogger"),et=a(function(){e(this,S)&&(T.log=e(this,S).log,T.warn=e(this,S).warn,T.error=e(this,S).error,u(this,S,null))},"#restoreLogger"),Ce=a(function(t,n){let s={time:Date.now(),level:t,message:n};e(this,P).push(s),e(this,P).length>ht&&e(this,P).shift(),i(this,o,$e).call(this)},"#addLogEntry"),$e=a(function(){if(!e(this,C))return;let t=e(this,C).scrollHeight-e(this,C).scrollTop<=e(this,C).clientHeight+5;e(this,C).innerHTML="";for(let n of e(this,P)){let s=document.createElement("div");s.className=`bluedot-hud__console-line bluedot-hud__console-line--${n.level}`;let r=new Date(n.time),l=`${r.getHours().toString().padStart(2,"0")}:${r.getMinutes().toString().padStart(2,"0")}:${r.getSeconds().toString().padStart(2,"0")}.${r.getMilliseconds().toString().padStart(3,"0")}`;s.innerHTML=`<span class="bluedot-hud__console-time">${l}</span> ${i(this,o,tt).call(this,n.message)}`,e(this,C).appendChild(s)}t&&(e(this,C).scrollTop=e(this,C).scrollHeight)},"#updateConsole"),tt=a(function(t){let n=document.createElement("div");return n.textContent=t,n.innerHTML},"#escapeHtml"),nt=a(function(){let t=document.createElement("div");t.id=ut,t.className="bluedot-hud bluedot-hud--collapsed";let n=document.createElement("div");n.className="bluedot-hud__collapsed",n.addEventListener("click",()=>i(this,o,Re).call(this)),u(this,D,document.createElement("span")),e(this,D).className="bluedot-hud__status-dot",u(this,V,document.createElement("span")),e(this,V).className="bluedot-hud__status-text",u(this,I,document.createElement("span")),e(this,I).className="bluedot-hud__coords",u(this,O,document.createElement("span")),e(this,O).className="bluedot-hud__heading",n.appendChild(e(this,D)),n.appendChild(e(this,V)),n.appendChild(e(this,I)),n.appendChild(e(this,O));let s=document.createElement("div");s.className="bluedot-hud__expanded";let r=document.createElement("div");r.className="bluedot-hud__header",r.addEventListener("click",()=>i(this,o,Re).call(this));let l=document.createElement("span");l.className="bluedot-hud__title",l.textContent="BlueDot Debug";let m=document.createElement("div");m.className="bluedot-hud__header-right";let c=document.createElement("button");c.className="bluedot-hud__export-btn",c.textContent="Export",c.addEventListener("click",ve=>{ve.stopPropagation(),Je(e(this,g))});let b=document.createElement("span");b.className="bluedot-hud__collapse-icon",b.textContent="\u25BC",m.appendChild(c),m.appendChild(b),r.appendChild(l),r.appendChild(m);let f=document.createElement("div");f.className="bluedot-hud__content";let _=i(this,o,U).call(this,"Status"),E=document.createElement("div");E.className="bluedot-hud__row",u(this,K,i(this,o,ue).call(this,"--")),u(this,Q,i(this,o,ue).call(this,"no")),E.appendChild(i(this,o,le).call(this,"Status:")),E.appendChild(e(this,K)),E.appendChild(i(this,o,le).call(this,"Following:")),E.appendChild(e(this,Q)),_.appendChild(E);let de=i(this,o,U).call(this,"Position");u(this,me,i(this,o,k).call(this,de,"Lat")),u(this,ge,i(this,o,k).call(this,de,"Lon")),u(this,be,i(this,o,k).call(this,de,"Accuracy")),u(this,fe,i(this,o,k).call(this,de,"Floor"));let Oe=i(this,o,U).call(this,"Heading"),_e=document.createElement("div");_e.className="bluedot-hud__heading-content";let re=document.createElement("div");re.className="bluedot-hud__compass";let Me=document.createElement("div");Me.className="bluedot-hud__compass-ring",u(this,X,document.createElement("div")),e(this,X).className="bluedot-hud__compass-needle";let Xe=document.createElement("div");Xe.className="bluedot-hud__compass-center";let dt=["N","E","S","W"];for(let ve of dt){let ke=document.createElement("span");ke.className=`bluedot-hud__compass-dir bluedot-hud__compass-dir--${ve.toLowerCase()}`,ke.textContent=ve,Me.appendChild(ke)}re.appendChild(Me),re.appendChild(e(this,X)),re.appendChild(Xe),u(this,A,document.createElement("div")),e(this,A).className="bluedot-hud__headings",_e.appendChild(re),_e.appendChild(e(this,A)),Oe.appendChild(_e);let J=i(this,o,U).call(this,"Anchor");u(this,F,i(this,o,k).call(this,J,"Status")),u(this,Z,i(this,o,k).call(this,J,"Position")),u(this,ee,i(this,o,k).call(this,J,"Set")),u(this,te,i(this,o,k).call(this,J,"TTL")),u(this,ne,i(this,o,k).call(this,J,"Drift"));let Ye=i(this,o,U).call(this,"Sensors");u(this,z,document.createElement("div")),e(this,z).className="bluedot-hud__sensors",Ye.appendChild(e(this,z));let We=i(this,o,U).call(this,"Tuning");u(this,M,document.createElement("div")),e(this,M).className="bluedot-hud__tuning",i(this,o,Te).call(this,e(this,M)),We.appendChild(e(this,M));let He=i(this,o,U).call(this,"Console"),Ne=document.createElement("div");Ne.className="bluedot-hud__console-header";let xe=document.createElement("button");return xe.className="bluedot-hud__console-clear",xe.textContent="Clear",xe.addEventListener("click",()=>this.clearConsole()),Ne.appendChild(xe),He.appendChild(Ne),u(this,C,document.createElement("div")),e(this,C).className="bluedot-hud__console",He.appendChild(e(this,C)),f.appendChild(_),f.appendChild(de),f.appendChild(Oe),f.appendChild(J),f.appendChild(Ye),f.appendChild(We),f.appendChild(He),s.appendChild(r),s.appendChild(f),t.appendChild(n),t.appendChild(s),t},"#createDOM"),U=a(function(t){let n=document.createElement("div");n.className="bluedot-hud__section";let s=document.createElement("div");return s.className="bluedot-hud__section-title",s.textContent=t,n.appendChild(s),n},"#createSection"),le=a(function(t){let n=document.createElement("span");return n.className="bluedot-hud__label",n.textContent=t,n},"#createLabel"),ue=a(function(t){let n=document.createElement("span");return n.className="bluedot-hud__value",n.textContent=t,n},"#createValue"),k=a(function(t,n){let s=document.createElement("div");s.className="bluedot-hud__row",s.appendChild(i(this,o,le).call(this,`${n}:`));let r=i(this,o,ue).call(this,"--");return s.appendChild(r),t.appendChild(s),r},"#appendRow"),Te=a(function(t){let n=document.createElement("div");n.className="bluedot-hud__tuning-group",n.innerHTML='<div class="bluedot-hud__tuning-group-title">Heading</div>',i(this,o,j).call(this,n,{id:"heading-responsiveness",label:"Heading responsiveness",description:"Higher = compass corrects heading faster (may jump)",min:0,max:100,value:e(this,p).heading.headingResponsiveness,onChange:a(l=>{e(this,p).heading.headingResponsiveness=l,i(this,o,L).call(this)},"onChange")}),i(this,o,j).call(this,n,{id:"compass-noise",label:"Rotation filtering",description:"Higher = ignore small turns, steadier heading",min:0,max:100,value:e(this,p).heading.compassNoiseTolerance,onChange:a(l=>{e(this,p).heading.compassNoiseTolerance=l,i(this,o,L).call(this)},"onChange")}),i(this,o,j).call(this,n,{id:"snap-threshold",label:"Heading snap threshold",description:"Higher = tolerate more drift before jumping",min:10,max:90,value:e(this,p).heading.headingSnapThreshold,unit:"\xB0",onChange:a(l=>{e(this,p).heading.headingSnapThreshold=l,i(this,o,L).call(this)},"onChange")}),i(this,o,Ae).call(this,n,{id:"magnetic-gating",label:"Magnetic disturbance gating",description:"On = ignore compass near metal/magnets",value:e(this,p).heading.magneticDisturbanceGating,onChange:a(l=>{e(this,p).heading.magneticDisturbanceGating=l,i(this,o,L).call(this)},"onChange")});let s=document.createElement("div");s.className="bluedot-hud__tuning-group",s.innerHTML='<div class="bluedot-hud__tuning-group-title">Motion (PDR)</div>',i(this,o,Ae).call(this,s,{id:"pdr-enabled",label:"PDR enabled",description:"On = dot moves with detected steps",value:e(this,p).motion.pdrEnabled,onChange:a(l=>{e(this,p).motion.pdrEnabled=l,i(this,o,L).call(this)},"onChange")}),i(this,o,j).call(this,s,{id:"step-sensitivity",label:"Step sensitivity",description:"Higher = more steps detected, more false positives",min:0,max:100,value:e(this,p).motion.stepSensitivity,onChange:a(l=>{e(this,p).motion.stepSensitivity=l,i(this,o,L).call(this)},"onChange")}),i(this,o,j).call(this,s,{id:"step-length",label:"Average step length",description:"Higher = dot moves farther per step",min:.4,max:1.2,step:.05,value:e(this,p).motion.averageStepLength,unit:"m",onChange:a(l=>{e(this,p).motion.averageStepLength=l,i(this,o,L).call(this)},"onChange")}),i(this,o,j).call(this,s,{id:"stride-variability",label:"Stride variability",description:"Higher = faster walking = longer steps",min:0,max:100,value:e(this,p).motion.strideVariability,onChange:a(l=>{e(this,p).motion.strideVariability=l,i(this,o,L).call(this)},"onChange")});let r=document.createElement("button");r.className="bluedot-hud__reset-btn",r.textContent="Reset to Defaults",r.addEventListener("click",()=>i(this,o,ot).call(this)),t.appendChild(n),t.appendChild(s),t.appendChild(r)},"#createTuningControls"),j=a(function(t,n){let s=document.createElement("div");s.className="bluedot-hud__tuning-row";let r=document.createElement("div");r.className="bluedot-hud__tuning-label-row";let l=document.createElement("label");l.className="bluedot-hud__tuning-label",l.htmlFor=`bluedot-tuning-${n.id}`,l.textContent=n.label;let m=document.createElement("div");m.className="bluedot-hud__tuning-desc",m.textContent=n.description,r.appendChild(l),r.appendChild(m);let c=document.createElement("div");c.className="bluedot-hud__tuning-control";let b=document.createElement("input");b.type="range",b.id=`bluedot-tuning-${n.id}`,b.className="bluedot-hud__slider",b.min=String(n.min),b.max=String(n.max),b.step=String(n.step??1),b.value=String(n.value);let f=document.createElement("span");f.className="bluedot-hud__slider-value",f.textContent=`${n.value}${n.unit??""}`,b.addEventListener("input",()=>{let _=parseFloat(b.value);f.textContent=`${n.step&&n.step<1?_.toFixed(2):_}${n.unit??""}`,n.onChange(_)}),c.appendChild(b),c.appendChild(f),s.appendChild(r),s.appendChild(c),t.appendChild(s)},"#createSlider"),Ae=a(function(t,n){let s=document.createElement("div");s.className="bluedot-hud__tuning-row bluedot-hud__tuning-row--toggle";let r=document.createElement("div");r.className="bluedot-hud__tuning-label-col";let l=document.createElement("label");l.className="bluedot-hud__tuning-label",l.htmlFor=`bluedot-tuning-${n.id}`,l.textContent=n.label;let m=document.createElement("div");m.className="bluedot-hud__tuning-desc",m.textContent=n.description,r.appendChild(l),r.appendChild(m);let c=document.createElement("input");c.type="checkbox",c.id=`bluedot-tuning-${n.id}`,c.className="bluedot-hud__toggle",c.checked=n.value,c.addEventListener("change",()=>{n.onChange(c.checked)}),s.appendChild(r),s.appendChild(c),t.appendChild(s)},"#createToggle"),L=a(function(){let t=De(e(this,p).heading);e(this,g).Fusion.headingFilter.configure(t);let n=Fe(e(this,p).motion);e(this,g).Sensors.get("devicemotion")?.configure(n),e(this,g).Sensors.get("deviceorientation")?.configure({deltaThreshold:e(this,p).heading.headingChangeThreshold})},"#applyTuning"),ot=a(function(){u(this,p,{heading:{...B.heading},motion:{...B.motion}}),i(this,o,L).call(this),e(this,M).innerHTML="",i(this,o,Te).call(this,e(this,M))},"#resetTuning"),Re=a(function(){u(this,y,!e(this,y)),e(this,v).classList.toggle("bluedot-hud--collapsed",e(this,y)),e(this,v).classList.toggle("bluedot-hud--expanded",!e(this,y))},"#toggle"),it=a(function(){let t=e(this,g).on("position-update",()=>i(this,o,Ie).call(this)),n=e(this,g).on("status-change",()=>i(this,o,Ue).call(this)),s=e(this,g).on("follow-change",()=>i(this,o,ze).call(this)),r=e(this,g).on("anchor-set",()=>i(this,o,he).call(this)),l=e(this,g).on("anchor-expired",()=>i(this,o,he).call(this));e(this,$).push(t,n,s,r,l);let m=e(this,g).Sensors.on("absolute-update",({sensorId:f,update:_})=>{_.heading!==void 0&&(e(this,ce).set(f,_.heading),i(this,o,Ee).call(this)),(_.accuracy!==void 0||_.confidence!==void 0)&&(e(this,pe).set(f,{accuracy:_.accuracy,confidence:_.confidence}),i(this,o,we).call(this))});e(this,$).push(m);let c=setInterval(()=>i(this,o,he).call(this),1e3);e(this,$).push(()=>clearInterval(c));let b=setInterval(()=>i(this,o,we).call(this),1e3);e(this,$).push(()=>clearInterval(b))},"#subscribeToEvents"),st=a(function(){i(this,o,Ue).call(this),i(this,o,Ie).call(this),i(this,o,ze).call(this),i(this,o,Ee).call(this),i(this,o,he).call(this),i(this,o,we).call(this)},"#updateAll"),Ue=a(function(){let t=e(this,g).status;e(this,V).textContent=t,e(this,K).textContent=t,e(this,D).classList.remove("bluedot-hud__status-dot--active","bluedot-hud__status-dot--inactive","bluedot-hud__status-dot--error"),t==="active"?e(this,D).classList.add("bluedot-hud__status-dot--active"):t==="inactive"||t==="hidden"?e(this,D).classList.add("bluedot-hud__status-dot--inactive"):e(this,D).classList.add("bluedot-hud__status-dot--error")},"#updateStatus"),Ie=a(function(){let t=e(this,g).coordinate,n=e(this,g).accuracy,s=e(this,g).floor;t?e(this,I).textContent=`${t.latitude.toFixed(5)}, ${t.longitude.toFixed(5)}`:e(this,I).textContent="--",e(this,me).textContent=t?t.latitude.toFixed(6):"--",e(this,ge).textContent=t?t.longitude.toFixed(6):"--",e(this,be).textContent=n!=null?`${n.toFixed(1)}m`:"--",e(this,fe).textContent=s?.name??"--",i(this,o,Ee).call(this)},"#updatePosition"),ze=a(function(){e(this,Q).textContent=e(this,g).isFollowing?"yes":"no"},"#updateFollowing"),Ee=a(function(){let t=e(this,g).heading;e(this,O).textContent=t!=null?`${t.toFixed(0)}\xB0`:"--",t!=null&&(e(this,X).style.transform=`translate(-50%, -100%) rotate(${t}deg)`),e(this,A).innerHTML="";let n=document.createElement("div");n.className="bluedot-hud__heading-row bluedot-hud__heading-row--displayed",n.innerHTML=`
|
|
541
|
+
<span class="bluedot-hud__heading-label">Displayed</span>
|
|
542
|
+
<span class="bluedot-hud__heading-value">${t!=null?`${t.toFixed(0)}\xB0`:"--"}</span>
|
|
543
|
+
`,e(this,A).appendChild(n);for(let[s,r]of e(this,ce)){let l=document.createElement("div");l.className="bluedot-hud__heading-row";let m=r!=null&&t!=null?i(this,o,at).call(this,r-t):null,c=m!=null?` (${m>=0?"+":""}${m.toFixed(0)}\xB0)`:"",b=m!=null&&Math.abs(m)>10?"bluedot-hud__heading-diff--warning":"";l.innerHTML=`
|
|
544
|
+
<span class="bluedot-hud__heading-label">${s}</span>
|
|
545
|
+
<span class="bluedot-hud__heading-value">${r!=null?`${r.toFixed(0)}\xB0`:"--"}<span class="bluedot-hud__heading-diff ${b}">${c}</span></span>
|
|
546
|
+
`,e(this,A).appendChild(l)}},"#updateHeadings"),at=a(function(t){for(;t>180;)t-=360;for(;t<-180;)t+=360;return t},"#normalizeAngleDiff"),he=a(function(){let t=e(this,g).anchor,n=e(this,g).displacement;if(t){e(this,F).textContent=`set (${t.sensorId})`,e(this,F).classList.add("bluedot-hud__value--enabled"),e(this,F).classList.remove("bluedot-hud__value--disabled"),e(this,Z).textContent=`${t.latitude.toFixed(6)}, ${t.longitude.toFixed(6)}`,e(this,ee).textContent=pt(t.timestamp),e(this,te).textContent=mt(t.timestamp,t.ttl);let s=Math.sqrt(n.dx**2+n.dy**2);e(this,ne).textContent=`dx=${n.dx>=0?"+":""}${n.dx.toFixed(2)}m, dy=${n.dy>=0?"+":""}${n.dy.toFixed(2)}m (${s.toFixed(2)}m)`}else e(this,F).textContent="none",e(this,F).classList.remove("bluedot-hud__value--enabled"),e(this,F).classList.add("bluedot-hud__value--disabled"),e(this,Z).textContent="--",e(this,ee).textContent="--",e(this,te).textContent="--",e(this,ne).textContent="--"},"#updateAnchor"),we=a(function(){e(this,z).innerHTML="";for(let[t,n]of e(this,g).Sensors.getAll()){let s=document.createElement("div");s.className="bluedot-hud__row";let r=`${t}:`;t==="geolocation"&&(r=n.isLikelyIPS?"IPS (Wi-Fi):":"GPS:");let l=i(this,o,le).call(this,r),m=n.isEnabled?"enabled":"disabled",c=e(this,pe).get(t);if(n.isEnabled&&c){let E=[];c.accuracy!==void 0&&E.push(`${c.accuracy.toFixed(1)}m`),c.confidence!==void 0&&E.push(`conf=${(c.confidence*100).toFixed(0)}%`),E.length>0&&(m=E.join(", "))}let b=i(this,o,ue).call(this,m);b.classList.add(n.isEnabled?"bluedot-hud__value--enabled":"bluedot-hud__value--disabled");let _=(t==="geolocation"?n:null)?.isLikelyIPS??!1;c?.confidence!==void 0&&c.confidence<.5&&!_&&b.classList.add("bluedot-hud__value--warning"),s.appendChild(l),s.appendChild(b),e(this,z).appendChild(s)}},"#updateSensors"),a(Pe,"DebugHUD");var Se=Pe;N();var x,oe,ie,Be=class Be{constructor(t=100){h(this,x,[]);h(this,oe);h(this,ie,0);u(this,oe,t)}record(t,n=Date.now()){e(this,x).push(t),e(this,x).length>e(this,oe)&&e(this,x).shift(),u(this,ie,n)}getRate(){if(e(this,x).length<2)return 0;let t=e(this,ie)-(Date.now()-e(this,oe)*100);return t>0?e(this,x).length/t*1e3:0}getAverage(){if(e(this,x).length===0)return 0;let t=0;for(let n of e(this,x))t+=n;return t/e(this,x).length}getLatest(){return e(this,x)[e(this,x).length-1]}getCount(){return e(this,x).length}clear(){u(this,x,[]),u(this,ie,0)}};x=new WeakMap,oe=new WeakMap,ie=new WeakMap,a(Be,"MetricTracker");var Y=Be,H,se,ae,Le,je=class je{constructor(t=5e3){h(this,ae);h(this,H,[]);h(this,se);u(this,se,t)}tick(t=Date.now()){e(this,H).push(t),i(this,ae,Le).call(this,t)}getRate(t=Date.now()){return i(this,ae,Le).call(this,t),e(this,H).length===0?0:e(this,H).length/e(this,se)*1e3}getCount(t=Date.now()){return i(this,ae,Le).call(this,t),e(this,H).length}clear(){u(this,H,[])}};H=new WeakMap,se=new WeakMap,ae=new WeakSet,Le=a(function(t){let n=t-e(this,se);for(;e(this,H).length>0&&e(this,H)[0]<n;)e(this,H).shift()},"#prune"),a(je,"EventCounter");var W=je,q,G,Ve=class Ve{constructor(){h(this,q,new Map);h(this,G,!1);w(this,"compassUpdates",new W);w(this,"gyroUpdates",new W);w(this,"stepsDetected",new W);w(this,"positionUpdates",new W);w(this,"compassHeading",new Y(50));w(this,"gyroAngularVelocity",new Y(50));w(this,"stepLength",new Y(20));w(this,"positionAccuracy",new Y(20));w(this,"isMoving",!1);w(this,"magneticDisturbanceActive",!1);w(this,"lastFusedHeading",null)}enable(){u(this,G,!0)}disable(){u(this,G,!1)}get isEnabled(){return e(this,G)}emit(t,n){if(!e(this,G))return;let s=Date.now();switch(t){case"compass-update":this.compassUpdates.tick(s),this.compassHeading.record(n.heading,s);break;case"gyro-update":this.gyroUpdates.tick(s),this.gyroAngularVelocity.record(n.angularVelocity,s);break;case"step-detected":this.stepsDetected.tick(s),this.stepLength.record(n.stepLength,s);break;case"motion-state":this.isMoving=n.isMoving;break;case"magnetic-disturbance":this.magneticDisturbanceActive=n.active;break;case"heading-fused":this.lastFusedHeading=n.heading;break;case"position-update":this.positionUpdates.tick(s),this.positionAccuracy.record(n.accuracy,s);break}let r=e(this,q).get(t);if(r)for(let l of r)l(n)}on(t,n){let s=e(this,q).get(t);return s||(s=new Set,e(this,q).set(t,s)),s.add(n),()=>{s.delete(n)}}getSummary(){return{compassRate:this.compassUpdates.getRate(),gyroRate:this.gyroUpdates.getRate(),stepRate:this.stepsDetected.getRate(),positionRate:this.positionUpdates.getRate(),avgCompassHeading:this.compassHeading.getAverage(),avgGyroVelocity:this.gyroAngularVelocity.getAverage(),avgStepLength:this.stepLength.getAverage(),avgAccuracy:this.positionAccuracy.getAverage(),isMoving:this.isMoving,magneticDisturbanceActive:this.magneticDisturbanceActive,lastFusedHeading:this.lastFusedHeading}}clear(){this.compassUpdates.clear(),this.gyroUpdates.clear(),this.stepsDetected.clear(),this.positionUpdates.clear(),this.compassHeading.clear(),this.gyroAngularVelocity.clear(),this.stepLength.clear(),this.positionAccuracy.clear(),this.isMoving=!1,this.magneticDisturbanceActive=!1,this.lastFusedHeading=null}destroy(){this.clear(),e(this,q).clear(),u(this,G,!1)}};q=new WeakMap,G=new WeakMap,a(Ve,"Telemetry");var Ge=Ve;function Ft(d){return new Se(d)}a(Ft,"enableDebugHUD");export{B as DEFAULT_TUNING_CONFIG,W as EventCounter,Y as MetricTracker,Ge as Telemetry,Ft as enableDebugHUD,De as headingConfigToFilterParams,Fe as motionConfigToSensorParams,rt as normalizeTuningConfig};
|