PageSourceSearch

https://stridenavigation.com/chunk-GEY5NERW.js

js stridenavigation.com collected 2026-09-24 14:53:25 UTC 3,869 bytes, 128 lines download raw bytes

1import {
2  APP_VERSION
3} from "./chunk-ODH7QDZO.js";
4import {
5  StorageService
6} from "./chunk-MAIAEXGG.js";
7import {
8  Injectable,
9  setClassMetadata,
10  ɵɵdefineInjectable,
11  ɵɵinject
12} from "./chunk-UQ6LLOJ6.js";
13import {
14  registerPlugin
15} from "./chunk-5LKHIIQE.js";
16import {
17  __async
18} from "./chunk-CO64IJQE.js";
19
20// src/app/services/signal-recorder/recording-limits.ts
21var MAX_RECORDING_UPLOAD_BYTES = 10 * 1024 * 1024;
22function isRecordingTooLarge(recording) {
23  return recording.byteSize > MAX_RECORDING_UPLOAD_BYTES;
24}
25function isRecordingJsonTooLarge(json) {
26  return new TextEncoder().encode(json).length > MAX_RECORDING_UPLOAD_BYTES;
27}
28
vendor: 171 bytes, lines 29-33
29// node_modules/@capacitor/device/dist/esm/index.js
30var Device = registerPlugin("Device", {
31  web: () => import("./chunk-INT7FEMU.js").then((m) => new m.DeviceWeb())
32});
33
34// src/app/services/device-identity/device-identity.service.ts
35var DEVICE_ID_KEY = "bug_report_device_id";
36var _DeviceIdentityService = class _DeviceIdentityService {
37  constructor(storageService) {
38    this.storageService = storageService;
39    this.cachedDeviceInfo = null;
40  }
41  /**
42   * Get device info including a persistent device identifier.
43   */
44  getDeviceInfo() {
45    return __async(this, null, function* () {
46      if (this.cachedDeviceInfo) {
47        return this.cachedDeviceInfo;
48      }
49      const [info, deviceId] = yield Promise.all([
50        this.getPlatformInfo(),
51        this.getOrCreateDeviceIdentifier()
52      ]);
53      this.cachedDeviceInfo = {
54        model: info.model,
55        platform: info.platform,
56        osVersion: info.osVersion,
57        appVersion: APP_VERSION,
58        deviceIdentifier: deviceId
59      };
60      return this.cachedDeviceInfo;
61    });
62  }
63  /**
64   * Get or create a persistent device identifier.
65   */
66  getOrCreateDeviceIdentifier() {
67    return __async(this, null, function* () {
68      const stored = yield this.storageService.get(DEVICE_ID_KEY);
69      if (stored) {
70        return stored;
71      }
72      const deviceId = yield this.getPlatformId();
73      const info = yield this.getPlatformInfo();
74      const rawId = `${info.model}_${info.platform}_${deviceId.identifier}`;
75      const identifier = this.simpleHash(rawId);
76      yield this.storageService.set(DEVICE_ID_KEY, identifier);
77      return identifier;
78    });
79  }
80  /**
81   * Plugin seams for the Capacitor Device plugin. Kept as instance methods
82   * (instead of direct plugin calls) so unit tests can stub them reliably —
83   * jasmine cannot spy on the plugin's lazily-loaded proxy object.
84   */
85  getPlatformInfo() {
86    return __async(this, null, function* () {
87      return Device.getInfo();
88    });
89  }
90  getPlatformId() {
91    return __async(this, null, function* () {
92      return Device.getId();
93    });
94  }
95  /**
96   * Simple hash function for device identifier.
97   */
98  simpleHash(str) {
99    let hash = 0;
100    for (let i = 0; i < str.length; i++) {
101      const char = str.charCodeAt(i);
102      hash = (hash << 5) - hash + char;
103      hash = hash & hash;
104    }
105    return Math.abs(hash).toString(36) + Date.now().toString(36).slice(-4);
106  }
107};
108_DeviceIdentityService.\u0275fac = function DeviceIdentityService_Factory(__ngFactoryType__) {
109  return new (__ngFactoryType__ || _DeviceIdentityService)(\u0275\u0275inject(StorageService));
110};
111_DeviceIdentityService.\u0275prov = /* @__PURE__ */ \u0275\u0275defineInjectable({ token: _DeviceIdentityService, factory: _DeviceIdentityService.\u0275fac, providedIn: "root" });
112var DeviceIdentityService = _DeviceIdentityService;
113(() => {
114  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DeviceIdentityService, [{
115    type: Injectable,
116    args: [{
117      providedIn: "root"
118    }]
119  }], () => [{ type: StorageService }], null);
120})();
121
122export {
123  MAX_RECORDING_UPLOAD_BYTES,
124  isRecordingTooLarge,
125  isRecordingJsonTooLarge,
126  Device,
127  DeviceIdentityService
128};

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.