1"use strict";(self["webpackChunkchalkyWeb"]=self["webpackChunkchalkyWeb"]||[]).push([[8187],{18187(e,i,n){n.d(i,{GeolocationWeb:()=>a});var t=n(70238);class a extends t.E_{constructor(){if(super(),this.latestOrientation=null,"undefined"!==typeof window){const e=window;"ondeviceorientationabsolute"in e?e.addEventListener("deviceorientationabsolute",e=>this.updateOrientation(e,!0),!0):"ondeviceorientation"in e&&e.addEventListener("deviceorientation",e=>this.updateOrientation(e,!1),!0)}}updateOrientation(e,i){let n=null,t=null,a=null;i&&null!==e.alpha?n=(360-e.alpha)%360:void 0!==e.webkitCompassHeading&&null!==e.webkitCompassHeading?(t=e.webkitCompassHeading,a=e.webkitCompassAccuracy):null!==e.alpha&&!0===e.absolute?n=(360-e.alpha)%360:null!==e.alpha&&(t=(360-e.alpha)%360),null===n&&null===t||(this.latestOrientation={trueHeading:n,magneticHeading:t,headingAccuracy:a})}augmentPosition(e,i=!1){var n,t,a,o,l,u,s;const c=e.coords,d=i?this.latestOrientation:null,r=null!==(a=null!==(t=null!==(n=null===d||void 0===d?void 0:d.trueHeading)&&void 0!==n?n:null===d||void 0===d?void 0:d.magneticHeading)&&void 0!==t?t:i?c.heading:null)&&void 0!==a?a:null;return{timestamp:e.timestamp,coords:{latitude:c.latitude,longitude:c.longitude,accuracy:c.accuracy,altitude:c.altitude,altitudeAccuracy:c.altitudeAccuracy,speed:c.speed,heading:r,magneticHeading:null!==(o=null===d||void 0===d?void 0:d.magneticHeading)&&void 0!==o?o:null,trueHeading:null!==(l=null===d||void 0===d?void 0:d.trueHeading)&&void 0!==l?l:null,headingAccuracy:null!==(u=null===d||void 0===d?void 0:d.headingAccuracy)&&void 0!==u?u:null,course:null!==(s=i?c.heading:null)&&void 0!==s?s:null}}}async getCurrentPosition(e){return new Promise((i,n)=>{navigator.geolocation.getCurrentPosition(e=>{i(this.augmentPosition(e,!1))},e=>{n(e)},Object.assign({enableHighAccuracy:!1,timeout:1e4,maximumAge:0},e))})}async watchPosition(e,i){const n=navigator.geolocation.watchPosition(e=>{i(this.augmentPosition(e,!0))},e=>{i(null,e)},Object.assign({enableHighAccuracy:!1,timeout:1e4,maximumAge:0,minimumUpdateInterval:5e3},e));return`${n}`}async clearWatch(e){navigator.geolocation.clearWatch(parseInt(e.id,10))}async checkPermissions(){if("undefined"===typeof navigator||!navigator.permissions)throw this.unavailable("Permissions API not available in this browser");const e=await navigator.permissions.query({name:"geolocation"});return{location:e.state,coarseLocation:e.state}}async requestPermissions(){throw this.unimplemented("Not implemented on web.")}}new a}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.