@glandais/vcyclist-engine 1.2.1 → 3.0.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.
@@ -1,103 +1,113 @@
1
1
  (function (factory) {
2
2
  if (typeof define === 'function' && define.amd)
3
- define(['exports', './kotlin-kotlin-stdlib.js', './vcyclist-elevation.js', './xmlutil-core.js', './kotlinx-coroutines-core.js'], factory);
3
+ define(['exports', './kotlin-kotlin-stdlib.js', './vcyclist-gpx.js', './vcyclist-elevation.js', './kotlinx-coroutines-core.js', './vcyclist-fit.js'], factory);
4
4
  else if (typeof exports === 'object')
5
- factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./vcyclist-elevation.js'), require('./xmlutil-core.js'), require('./kotlinx-coroutines-core.js'));
5
+ factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./vcyclist-gpx.js'), require('./vcyclist-elevation.js'), require('./kotlinx-coroutines-core.js'), require('./vcyclist-fit.js'));
6
6
  else {
7
7
  if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
8
8
  throw new Error("Error loading module 'io.github.glandais:engine'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'io.github.glandais:engine'.");
9
9
  }
10
+ if (typeof globalThis['vcyclist-gpx'] === 'undefined') {
11
+ throw new Error("Error loading module 'io.github.glandais:engine'. Its dependency 'vcyclist-gpx' was not found. Please, check whether 'vcyclist-gpx' is loaded prior to 'io.github.glandais:engine'.");
12
+ }
10
13
  if (typeof globalThis['vcyclist-elevation'] === 'undefined') {
11
14
  throw new Error("Error loading module 'io.github.glandais:engine'. Its dependency 'vcyclist-elevation' was not found. Please, check whether 'vcyclist-elevation' is loaded prior to 'io.github.glandais:engine'.");
12
15
  }
13
- if (typeof globalThis['xmlutil-core'] === 'undefined') {
14
- throw new Error("Error loading module 'io.github.glandais:engine'. Its dependency 'xmlutil-core' was not found. Please, check whether 'xmlutil-core' is loaded prior to 'io.github.glandais:engine'.");
15
- }
16
16
  if (typeof globalThis['kotlinx-coroutines-core'] === 'undefined') {
17
17
  throw new Error("Error loading module 'io.github.glandais:engine'. Its dependency 'kotlinx-coroutines-core' was not found. Please, check whether 'kotlinx-coroutines-core' is loaded prior to 'io.github.glandais:engine'.");
18
18
  }
19
- globalThis['io.github.glandais:engine'] = factory(typeof globalThis['io.github.glandais:engine'] === 'undefined' ? {} : globalThis['io.github.glandais:engine'], globalThis['kotlin-kotlin-stdlib'], globalThis['vcyclist-elevation'], globalThis['xmlutil-core'], globalThis['kotlinx-coroutines-core']);
19
+ if (typeof globalThis['vcyclist-fit'] === 'undefined') {
20
+ throw new Error("Error loading module 'io.github.glandais:engine'. Its dependency 'vcyclist-fit' was not found. Please, check whether 'vcyclist-fit' is loaded prior to 'io.github.glandais:engine'.");
21
+ }
22
+ globalThis['io.github.glandais:engine'] = factory(typeof globalThis['io.github.glandais:engine'] === 'undefined' ? {} : globalThis['io.github.glandais:engine'], globalThis['kotlin-kotlin-stdlib'], globalThis['vcyclist-gpx'], globalThis['vcyclist-elevation'], globalThis['kotlinx-coroutines-core'], globalThis['vcyclist-fit']);
20
23
  }
21
- }(function (_, kotlin_kotlin, kotlin_io_github_glandais_elevation, kotlin_io_github_pdvrieze_xmlutil_core, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core) {
24
+ }(function (_, kotlin_kotlin, kotlin_io_github_glandais_gpx, kotlin_io_github_glandais_elevation, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core, kotlin_io_github_glandais_fit) {
22
25
  'use strict';
23
26
  //region block: imports
24
27
  var imul = Math.imul;
25
- var protoOf = kotlin_kotlin.$_$.h5;
26
- var initMetadataForCompanion = kotlin_kotlin.$_$.v4;
28
+ var hypot = Math.hypot;
29
+ var sign = Math.sign;
30
+ var protoOf = kotlin_kotlin.$_$.a6;
31
+ var initMetadataForCompanion = kotlin_kotlin.$_$.m5;
27
32
  var VOID = kotlin_kotlin.$_$.a;
28
- var getNumberHashCode = kotlin_kotlin.$_$.q4;
29
- var equals = kotlin_kotlin.$_$.o4;
30
- var initMetadataForClass = kotlin_kotlin.$_$.u4;
31
- var toString = kotlin_kotlin.$_$.j5;
32
- var hashCode = kotlin_kotlin.$_$.t4;
33
- var getBooleanHashCode = kotlin_kotlin.$_$.p4;
34
- var CoroutineImpl = kotlin_kotlin.$_$.p3;
35
- var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.a3;
36
- var Unit_instance = kotlin_kotlin.$_$.r;
37
- var initMetadataForCoroutine = kotlin_kotlin.$_$.w4;
38
- var initMetadataForObject = kotlin_kotlin.$_$.a5;
39
- var getStringHashCode = kotlin_kotlin.$_$.s4;
40
- var toString_0 = kotlin_kotlin.$_$.n7;
41
- var ArrayList_init_$Create$ = kotlin_kotlin.$_$.t;
42
- var MathConstants_getInstance = kotlin_io_github_glandais_elevation.$_$.d;
43
- var isNaN_0 = kotlin_kotlin.$_$.i7;
44
- var numberToLong = kotlin_kotlin.$_$.c4;
45
- var Long = kotlin_kotlin.$_$.y6;
46
- var compare = kotlin_kotlin.$_$.v3;
47
- var roundToInt = kotlin_kotlin.$_$.k5;
48
- var listOf = kotlin_kotlin.$_$.q2;
49
- var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.j1;
50
- var EventType_START_ELEMENT_getInstance = kotlin_io_github_pdvrieze_xmlutil_core.$_$.a;
51
- var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.u;
52
- var THROW_CCE = kotlin_kotlin.$_$.c7;
53
- var isCharSequence = kotlin_kotlin.$_$.b5;
54
- var trim = kotlin_kotlin.$_$.s6;
55
- var charSequenceLength = kotlin_kotlin.$_$.k4;
56
- var isBlank = kotlin_kotlin.$_$.h6;
57
- var toDoubleOrNull = kotlin_kotlin.$_$.p6;
58
- var numberToInt = kotlin_kotlin.$_$.f5;
59
- var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.d1;
60
- var Companion_getInstance = kotlin_kotlin.$_$.p;
61
- var IllegalArgumentException = kotlin_kotlin.$_$.x6;
62
- var get_xmlStreaming = kotlin_io_github_pdvrieze_xmlutil_core.$_$.e;
63
- var IllegalArgumentException_init_$Create$_0 = kotlin_kotlin.$_$.k1;
64
- var XmlException = kotlin_io_github_pdvrieze_xmlutil_core.$_$.c;
65
- var firstOrNull = kotlin_kotlin.$_$.m2;
66
- var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.l1;
67
- var toNumber = kotlin_kotlin.$_$.e4;
68
- var XmlDeclMode_None_getInstance = kotlin_io_github_pdvrieze_xmlutil_core.$_$.b;
69
- var newGenericWriter = kotlin_io_github_pdvrieze_xmlutil_core.$_$.d;
70
- var LatLon = kotlin_io_github_glandais_elevation.$_$.g;
71
- var ElevationSmoother_instance = kotlin_io_github_glandais_elevation.$_$.c;
72
- var until = kotlin_kotlin.$_$.r5;
73
- var LatLonElevation = kotlin_io_github_glandais_elevation.$_$.f;
74
- var arrayCopy = kotlin_kotlin.$_$.a2;
75
- var Distance_instance = kotlin_io_github_glandais_elevation.$_$.a;
33
+ var getNumberHashCode = kotlin_kotlin.$_$.h5;
34
+ var equals = kotlin_kotlin.$_$.f5;
35
+ var initMetadataForClass = kotlin_kotlin.$_$.l5;
36
+ var toString = kotlin_kotlin.$_$.c6;
37
+ var hashCode = kotlin_kotlin.$_$.k5;
38
+ var getBooleanHashCode = kotlin_kotlin.$_$.g5;
39
+ var CoroutineImpl = kotlin_kotlin.$_$.f4;
40
+ var PointPerDistance_instance = kotlin_io_github_glandais_gpx.$_$.h;
41
+ var ElevationStep_instance = kotlin_io_github_glandais_gpx.$_$.e;
42
+ var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.q3;
43
+ var Unit_instance = kotlin_kotlin.$_$.t;
44
+ var PointPerSecond_instance = kotlin_io_github_glandais_gpx.$_$.i;
45
+ var PathSimplifier_instance = kotlin_io_github_glandais_gpx.$_$.f;
46
+ var initMetadataForCoroutine = kotlin_kotlin.$_$.n5;
47
+ var initMetadataForObject = kotlin_kotlin.$_$.r5;
48
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.x;
49
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.m1;
50
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.w;
51
+ var last = kotlin_kotlin.$_$.y2;
52
+ var toIntArray = kotlin_kotlin.$_$.j3;
53
+ var sortedWith = kotlin_kotlin.$_$.h3;
54
+ var toMutableList = kotlin_kotlin.$_$.m3;
55
+ var first = kotlin_kotlin.$_$.s2;
56
+ var removeAll = kotlin_kotlin.$_$.c3;
57
+ var numberRangeToNumber = kotlin_kotlin.$_$.w5;
58
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.j2;
59
+ var Vector3D = kotlin_io_github_glandais_elevation.$_$.g;
60
+ var emptyList = kotlin_kotlin.$_$.p2;
61
+ var coerceIn = kotlin_kotlin.$_$.j6;
76
62
  var DouglasPeucker_instance = kotlin_io_github_glandais_elevation.$_$.b;
77
- var collectionSizeOrDefault = kotlin_kotlin.$_$.e2;
78
- var mapCapacity = kotlin_kotlin.$_$.s2;
79
- var coerceAtLeast = kotlin_kotlin.$_$.m5;
80
- var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.x;
81
- var enumEntries = kotlin_kotlin.$_$.r3;
82
- var Enum = kotlin_kotlin.$_$.u6;
83
- var noWhenBranchMatchedException = kotlin_kotlin.$_$.k7;
84
- var LinkedHashMap_init_$Create$_0 = kotlin_kotlin.$_$.y;
85
- var multiply = kotlin_kotlin.$_$.b4;
86
- var subtract = kotlin_kotlin.$_$.d4;
87
- var equalsLong = kotlin_kotlin.$_$.y3;
88
- var add = kotlin_kotlin.$_$.u3;
89
- var get_ONE = kotlin_kotlin.$_$.t3;
90
- var sorted = kotlin_kotlin.$_$.v2;
91
- var Default_getInstance = kotlin_kotlin.$_$.o;
92
- var emptyList = kotlin_kotlin.$_$.k2;
63
+ var FunctionAdapter = kotlin_kotlin.$_$.v4;
64
+ var isInterface = kotlin_kotlin.$_$.t5;
65
+ var Comparator = kotlin_kotlin.$_$.y7;
66
+ var compareValues = kotlin_kotlin.$_$.o3;
67
+ var until = kotlin_kotlin.$_$.n6;
68
+ var Pair = kotlin_kotlin.$_$.f8;
69
+ var listOf = kotlin_kotlin.$_$.z2;
70
+ var Default_getInstance = kotlin_kotlin.$_$.p;
71
+ var PointField_TEMPERATURE_getInstance = kotlin_io_github_glandais_gpx.$_$.l;
72
+ var isNaN_0 = kotlin_kotlin.$_$.p8;
73
+ var get_entries = kotlin_io_github_glandais_gpx.$_$.u;
74
+ var Path = kotlin_io_github_glandais_gpx.$_$.t;
75
+ var GpxParser_instance = kotlin_io_github_glandais_gpx.$_$.a;
76
+ var copyToArray = kotlin_kotlin.$_$.o2;
77
+ var firstTrackAsPath = kotlin_io_github_glandais_gpx.$_$.n;
78
+ var tracksAsPaths = kotlin_io_github_glandais_gpx.$_$.q;
79
+ var segmentsAsPaths = kotlin_io_github_glandais_gpx.$_$.o;
80
+ var GpxPathKind_TRACK_getInstance = kotlin_io_github_glandais_gpx.$_$.k;
81
+ var setOf = kotlin_kotlin.$_$.f3;
82
+ var GpxPathKind_ROUTE_getInstance = kotlin_io_github_glandais_gpx.$_$.j;
83
+ var GpxWriter_instance = kotlin_io_github_glandais_gpx.$_$.b;
84
+ var toList = kotlin_kotlin.$_$.l3;
85
+ var toGpxDocument = kotlin_io_github_glandais_gpx.$_$.p;
86
+ var Companion_getInstance = kotlin_kotlin.$_$.r;
87
+ var numberToLong = kotlin_kotlin.$_$.s4;
93
88
  var GlobalScope_instance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.a;
94
89
  var promise = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.j;
95
- var copyToArray = kotlin_kotlin.$_$.j2;
90
+ var Companion_getInstance_0 = kotlin_io_github_glandais_gpx.$_$.g;
91
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.o1;
92
+ var CsvWriter_instance = kotlin_io_github_glandais_gpx.$_$.c;
93
+ var firstOrNull = kotlin_kotlin.$_$.b7;
94
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.b;
95
+ var Char = kotlin_kotlin.$_$.x7;
96
+ var CsvOptions = kotlin_io_github_glandais_gpx.$_$.r;
97
+ var JsonWriter_instance = kotlin_io_github_glandais_gpx.$_$.d;
98
+ var JsonOptions = kotlin_io_github_glandais_gpx.$_$.s;
99
+ var toFitBytes = kotlin_io_github_glandais_fit.$_$.a;
100
+ var Companion_getInstance_1 = kotlin_kotlin.$_$.q;
101
+ var DurationUnit_MILLISECONDS_getInstance = kotlin_kotlin.$_$.u;
102
+ var toDuration = kotlin_kotlin.$_$.w7;
103
+ var toFitBytes_0 = kotlin_io_github_glandais_fit.$_$.b;
104
+ var toNumber = kotlin_kotlin.$_$.u4;
105
+ var GpxWaypoint = kotlin_io_github_glandais_gpx.$_$.m;
106
+ var THROW_CCE = kotlin_kotlin.$_$.i8;
96
107
  var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.h;
97
- var isInterface = kotlin_kotlin.$_$.c5;
98
- var ElevationProvider = kotlin_io_github_glandais_elevation.$_$.e;
99
- var initMetadataForLambda = kotlin_kotlin.$_$.z4;
100
- var constructCallableReference = kotlin_kotlin.$_$.m4;
108
+ var ElevationProvider = kotlin_io_github_glandais_elevation.$_$.d;
109
+ var initMetadataForLambda = kotlin_kotlin.$_$.q5;
110
+ var constructCallableReference = kotlin_kotlin.$_$.d5;
101
111
  //endregion
102
112
  //region block: pre-declaration
103
113
  initMetadataForCompanion(Companion);
@@ -112,32 +122,19 @@
112
122
  initMetadataForClass(EnhanceOptions, 'EnhanceOptions', EnhanceOptions);
113
123
  initMetadataForCoroutine($enhanceCourseCOROUTINE$, CoroutineImpl);
114
124
  initMetadataForObject(Enhancer, 'Enhancer', VOID, VOID, VOID, [3]);
115
- initMetadataForClass(GpxDocument, 'GpxDocument');
116
- initMetadataForClass(GpxTrack, 'GpxTrack');
117
- initMetadataForClass(GpxTrackPoint, 'GpxTrackPoint');
118
- initMetadataForClass(ExtensionsAccumulator, 'ExtensionsAccumulator', ExtensionsAccumulator);
119
- initMetadataForObject(GpxParser, 'GpxParser');
120
- initMetadataForObject(GpxWriter, 'GpxWriter');
121
- initMetadataForCoroutine($fixElevationCOROUTINE$, CoroutineImpl);
122
- initMetadataForObject(ElevationStep, 'ElevationStep', VOID, VOID, VOID, [2]);
123
- initMetadataForClass(GeneratedPath, 'GeneratedPath');
125
+ initMetadataForClass(Climb, 'Climb');
126
+ initMetadataForClass(ClimbPart, 'ClimbPart');
124
127
  initMetadataForCompanion(Companion_3);
125
- initMetadataForClass(BoundsRad, 'BoundsRad');
128
+ initMetadataForClass(ClimbOptions, 'ClimbOptions', ClimbOptions);
126
129
  initMetadataForCompanion(Companion_4);
127
- initMetadataForClass(Path, 'Path', VOID, GeneratedPath);
128
- initMetadataForObject(PathSimplifier, 'PathSimplifier');
129
- initMetadataForCompanion(Companion_5);
130
- initMetadataForClass(PointField, 'PointField', VOID, Enum);
131
- initMetadataForClass(PointFieldCategory, 'PointFieldCategory', VOID, Enum);
132
- initMetadataForClass(Copy, 'Copy');
133
- initMetadataForClass(Interpolate, 'Interpolate');
134
- initMetadataForObject(PointPerDistance, 'PointPerDistance');
135
- initMetadataForClass(Copy_0, 'Copy');
136
- initMetadataForClass(Interpolate_0, 'Interpolate');
137
- initMetadataForObject(PointPerSecond, 'PointPerSecond');
130
+ initMetadataForClass(Profile, 'Profile');
131
+ initMetadataForClass(Candidate, 'Candidate');
132
+ initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
133
+ initMetadataForClass(sam$kotlin_Comparator$0_0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
134
+ initMetadataForObject(ClimbDetector, 'ClimbDetector');
138
135
  initMetadataForObject(AeroPowerProvider, 'AeroPowerProvider');
139
136
  initMetadataForObject(AeroProviderConstant, 'AeroProviderConstant');
140
- initMetadataForCompanion(Companion_6);
137
+ initMetadataForCompanion(Companion_5);
141
138
  initMetadataForClass(CyclistPowerProviderBase, 'CyclistPowerProviderBase');
142
139
  initMetadataForObject(GravPowerProvider, 'GravPowerProvider');
143
140
  initMetadataForClass(Harmonic, 'Harmonic');
@@ -152,7 +149,7 @@
152
149
  initMetadataForObject(RollingResistancePowerProvider, 'RollingResistancePowerProvider');
153
150
  initMetadataForObject(VirtualizeService, 'VirtualizeService');
154
151
  initMetadataForObject(WheelBearingsPowerProvider, 'WheelBearingsPowerProvider');
155
- initMetadataForCompanion(Companion_7);
152
+ initMetadataForCompanion(Companion_6);
156
153
  initMetadataForClass(Wind, 'Wind');
157
154
  initMetadataForObject(WindProviderNone, 'WindProviderNone');
158
155
  initMetadataForClass(WindProviderConstant, 'WindProviderConstant');
@@ -161,36 +158,36 @@
161
158
  //endregion
162
159
  function Companion() {
163
160
  Companion_instance = this;
164
- this.x1o_1 = new Bike();
161
+ this.y1y_1 = new Bike();
165
162
  }
166
163
  var Companion_instance;
167
- function Companion_getInstance_0() {
164
+ function Companion_getInstance_2() {
168
165
  if (Companion_instance == null)
169
166
  new Companion();
170
167
  return Companion_instance;
171
168
  }
172
169
  function Bike(crr, inertiaFront, inertiaRear, wheelRadiusM, efficiency) {
173
- Companion_getInstance_0();
170
+ Companion_getInstance_2();
174
171
  crr = crr === VOID ? 0.004 : crr;
175
172
  inertiaFront = inertiaFront === VOID ? 0.05 : inertiaFront;
176
173
  inertiaRear = inertiaRear === VOID ? 0.07 : inertiaRear;
177
174
  wheelRadiusM = wheelRadiusM === VOID ? 0.7 : wheelRadiusM;
178
175
  efficiency = efficiency === VOID ? 0.976 : efficiency;
179
- this.y1o_1 = crr;
180
- this.z1o_1 = inertiaFront;
181
- this.a1p_1 = inertiaRear;
182
- this.b1p_1 = wheelRadiusM;
183
- this.c1p_1 = efficiency;
176
+ this.z1y_1 = crr;
177
+ this.a1z_1 = inertiaFront;
178
+ this.b1z_1 = inertiaRear;
179
+ this.c1z_1 = wheelRadiusM;
180
+ this.d1z_1 = efficiency;
184
181
  }
185
182
  protoOf(Bike).toString = function () {
186
- return 'Bike(crr=' + this.y1o_1 + ', inertiaFront=' + this.z1o_1 + ', inertiaRear=' + this.a1p_1 + ', wheelRadiusM=' + this.b1p_1 + ', efficiency=' + this.c1p_1 + ')';
183
+ return 'Bike(crr=' + this.z1y_1 + ', inertiaFront=' + this.a1z_1 + ', inertiaRear=' + this.b1z_1 + ', wheelRadiusM=' + this.c1z_1 + ', efficiency=' + this.d1z_1 + ')';
187
184
  };
188
185
  protoOf(Bike).hashCode = function () {
189
- var result = getNumberHashCode(this.y1o_1);
190
- result = imul(result, 31) + getNumberHashCode(this.z1o_1) | 0;
191
- result = imul(result, 31) + getNumberHashCode(this.a1p_1) | 0;
192
- result = imul(result, 31) + getNumberHashCode(this.b1p_1) | 0;
193
- result = imul(result, 31) + getNumberHashCode(this.c1p_1) | 0;
186
+ var result = getNumberHashCode(this.z1y_1);
187
+ result = imul(result, 31) + getNumberHashCode(this.a1z_1) | 0;
188
+ result = imul(result, 31) + getNumberHashCode(this.b1z_1) | 0;
189
+ result = imul(result, 31) + getNumberHashCode(this.c1z_1) | 0;
190
+ result = imul(result, 31) + getNumberHashCode(this.d1z_1) | 0;
194
191
  return result;
195
192
  };
196
193
  protoOf(Bike).equals = function (other) {
@@ -198,41 +195,41 @@
198
195
  return true;
199
196
  if (!(other instanceof Bike))
200
197
  return false;
201
- if (!equals(this.y1o_1, other.y1o_1))
198
+ if (!equals(this.z1y_1, other.z1y_1))
202
199
  return false;
203
- if (!equals(this.z1o_1, other.z1o_1))
200
+ if (!equals(this.a1z_1, other.a1z_1))
204
201
  return false;
205
- if (!equals(this.a1p_1, other.a1p_1))
202
+ if (!equals(this.b1z_1, other.b1z_1))
206
203
  return false;
207
- if (!equals(this.b1p_1, other.b1p_1))
204
+ if (!equals(this.c1z_1, other.c1z_1))
208
205
  return false;
209
- if (!equals(this.c1p_1, other.c1p_1))
206
+ if (!equals(this.d1z_1, other.d1z_1))
210
207
  return false;
211
208
  return true;
212
209
  };
213
210
  function Course(path, cyclist, bike) {
214
- cyclist = cyclist === VOID ? Companion_getInstance_2().d1p_1 : cyclist;
215
- bike = bike === VOID ? Companion_getInstance_0().x1o_1 : bike;
216
- this.e1p_1 = path;
217
- this.f1p_1 = cyclist;
218
- this.g1p_1 = bike;
211
+ cyclist = cyclist === VOID ? Companion_getInstance_4().e1z_1 : cyclist;
212
+ bike = bike === VOID ? Companion_getInstance_2().y1y_1 : bike;
213
+ this.f1z_1 = path;
214
+ this.g1z_1 = cyclist;
215
+ this.h1z_1 = bike;
219
216
  }
220
- protoOf(Course).h1p = function (path, cyclist, bike) {
217
+ protoOf(Course).i1z = function (path, cyclist, bike) {
221
218
  return new Course(path, cyclist, bike);
222
219
  };
223
- protoOf(Course).i1p = function (path, cyclist, bike, $super) {
224
- path = path === VOID ? this.e1p_1 : path;
225
- cyclist = cyclist === VOID ? this.f1p_1 : cyclist;
226
- bike = bike === VOID ? this.g1p_1 : bike;
227
- return $super === VOID ? this.h1p(path, cyclist, bike) : $super.h1p.call(this, path, cyclist, bike);
220
+ protoOf(Course).j1z = function (path, cyclist, bike, $super) {
221
+ path = path === VOID ? this.f1z_1 : path;
222
+ cyclist = cyclist === VOID ? this.g1z_1 : cyclist;
223
+ bike = bike === VOID ? this.h1z_1 : bike;
224
+ return $super === VOID ? this.i1z(path, cyclist, bike) : $super.i1z.call(this, path, cyclist, bike);
228
225
  };
229
226
  protoOf(Course).toString = function () {
230
- return 'Course(path=' + toString(this.e1p_1) + ', cyclist=' + this.f1p_1.toString() + ', bike=' + this.g1p_1.toString() + ')';
227
+ return 'Course(path=' + toString(this.f1z_1) + ', cyclist=' + this.g1z_1.toString() + ', bike=' + this.h1z_1.toString() + ')';
231
228
  };
232
229
  protoOf(Course).hashCode = function () {
233
- var result = hashCode(this.e1p_1);
234
- result = imul(result, 31) + this.f1p_1.hashCode() | 0;
235
- result = imul(result, 31) + this.g1p_1.hashCode() | 0;
230
+ var result = hashCode(this.f1z_1);
231
+ result = imul(result, 31) + this.g1z_1.hashCode() | 0;
232
+ result = imul(result, 31) + this.h1z_1.hashCode() | 0;
236
233
  return result;
237
234
  };
238
235
  protoOf(Course).equals = function (other) {
@@ -240,65 +237,65 @@
240
237
  return true;
241
238
  if (!(other instanceof Course))
242
239
  return false;
243
- if (!equals(this.e1p_1, other.e1p_1))
240
+ if (!equals(this.f1z_1, other.f1z_1))
244
241
  return false;
245
- if (!this.f1p_1.equals(other.f1p_1))
242
+ if (!this.g1z_1.equals(other.g1z_1))
246
243
  return false;
247
- if (!this.g1p_1.equals(other.g1p_1))
244
+ if (!this.h1z_1.equals(other.h1z_1))
248
245
  return false;
249
246
  return true;
250
247
  };
251
248
  function Companion_0() {
252
249
  Companion_instance_0 = this;
253
- this.j1p_1 = new PowerProviderConstant(280.0);
250
+ this.k1z_1 = new PowerProviderConstant(280.0);
254
251
  }
255
252
  var Companion_instance_0;
256
- function Companion_getInstance_1() {
253
+ function Companion_getInstance_3() {
257
254
  if (Companion_instance_0 == null)
258
255
  new Companion_0();
259
256
  return Companion_instance_0;
260
257
  }
261
258
  function CoursePhysics(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) {
262
- Companion_getInstance_1();
259
+ Companion_getInstance_3();
263
260
  rhoProvider = rhoProvider === VOID ? RhoProviderDefault_instance : rhoProvider;
264
261
  aeroProvider = aeroProvider === VOID ? AeroProviderConstant_instance : aeroProvider;
265
262
  windProvider = windProvider === VOID ? WindProviderNone_instance : windProvider;
266
- cyclistPowerProvider = cyclistPowerProvider === VOID ? Companion_getInstance_1().j1p_1 : cyclistPowerProvider;
267
- this.k1p_1 = course;
268
- this.l1p_1 = rhoProvider;
269
- this.m1p_1 = aeroProvider;
270
- this.n1p_1 = windProvider;
271
- this.o1p_1 = cyclistPowerProvider;
263
+ cyclistPowerProvider = cyclistPowerProvider === VOID ? Companion_getInstance_3().k1z_1 : cyclistPowerProvider;
264
+ this.l1z_1 = course;
265
+ this.m1z_1 = rhoProvider;
266
+ this.n1z_1 = aeroProvider;
267
+ this.o1z_1 = windProvider;
268
+ this.p1z_1 = cyclistPowerProvider;
272
269
  }
273
- protoOf(CoursePhysics).p1p = function () {
274
- return this.k1p_1.e1p_1;
270
+ protoOf(CoursePhysics).q1z = function () {
271
+ return this.l1z_1.f1z_1;
275
272
  };
276
- protoOf(CoursePhysics).q1p = function () {
277
- return this.k1p_1.f1p_1;
273
+ protoOf(CoursePhysics).r1z = function () {
274
+ return this.l1z_1.g1z_1;
278
275
  };
279
- protoOf(CoursePhysics).r1p = function () {
280
- return this.k1p_1.g1p_1;
276
+ protoOf(CoursePhysics).s1z = function () {
277
+ return this.l1z_1.h1z_1;
281
278
  };
282
- protoOf(CoursePhysics).s1p = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) {
279
+ protoOf(CoursePhysics).t1z = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) {
283
280
  return new CoursePhysics(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider);
284
281
  };
285
- protoOf(CoursePhysics).t1p = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider, $super) {
286
- course = course === VOID ? this.k1p_1 : course;
287
- rhoProvider = rhoProvider === VOID ? this.l1p_1 : rhoProvider;
288
- aeroProvider = aeroProvider === VOID ? this.m1p_1 : aeroProvider;
289
- windProvider = windProvider === VOID ? this.n1p_1 : windProvider;
290
- cyclistPowerProvider = cyclistPowerProvider === VOID ? this.o1p_1 : cyclistPowerProvider;
291
- return $super === VOID ? this.s1p(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) : $super.s1p.call(this, course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider);
282
+ protoOf(CoursePhysics).u1z = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider, $super) {
283
+ course = course === VOID ? this.l1z_1 : course;
284
+ rhoProvider = rhoProvider === VOID ? this.m1z_1 : rhoProvider;
285
+ aeroProvider = aeroProvider === VOID ? this.n1z_1 : aeroProvider;
286
+ windProvider = windProvider === VOID ? this.o1z_1 : windProvider;
287
+ cyclistPowerProvider = cyclistPowerProvider === VOID ? this.p1z_1 : cyclistPowerProvider;
288
+ return $super === VOID ? this.t1z(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) : $super.t1z.call(this, course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider);
292
289
  };
293
290
  protoOf(CoursePhysics).toString = function () {
294
- return 'CoursePhysics(course=' + this.k1p_1.toString() + ', rhoProvider=' + toString(this.l1p_1) + ', aeroProvider=' + toString(this.m1p_1) + ', windProvider=' + toString(this.n1p_1) + ', cyclistPowerProvider=' + toString(this.o1p_1) + ')';
291
+ return 'CoursePhysics(course=' + this.l1z_1.toString() + ', rhoProvider=' + toString(this.m1z_1) + ', aeroProvider=' + toString(this.n1z_1) + ', windProvider=' + toString(this.o1z_1) + ', cyclistPowerProvider=' + toString(this.p1z_1) + ')';
295
292
  };
296
293
  protoOf(CoursePhysics).hashCode = function () {
297
- var result = this.k1p_1.hashCode();
298
- result = imul(result, 31) + hashCode(this.l1p_1) | 0;
299
- result = imul(result, 31) + hashCode(this.m1p_1) | 0;
300
- result = imul(result, 31) + hashCode(this.n1p_1) | 0;
301
- result = imul(result, 31) + hashCode(this.o1p_1) | 0;
294
+ var result = this.l1z_1.hashCode();
295
+ result = imul(result, 31) + hashCode(this.m1z_1) | 0;
296
+ result = imul(result, 31) + hashCode(this.n1z_1) | 0;
297
+ result = imul(result, 31) + hashCode(this.o1z_1) | 0;
298
+ result = imul(result, 31) + hashCode(this.p1z_1) | 0;
302
299
  return result;
303
300
  };
304
301
  protoOf(CoursePhysics).equals = function (other) {
@@ -306,64 +303,64 @@
306
303
  return true;
307
304
  if (!(other instanceof CoursePhysics))
308
305
  return false;
309
- if (!this.k1p_1.equals(other.k1p_1))
306
+ if (!this.l1z_1.equals(other.l1z_1))
310
307
  return false;
311
- if (!equals(this.l1p_1, other.l1p_1))
308
+ if (!equals(this.m1z_1, other.m1z_1))
312
309
  return false;
313
- if (!equals(this.m1p_1, other.m1p_1))
310
+ if (!equals(this.n1z_1, other.n1z_1))
314
311
  return false;
315
- if (!equals(this.n1p_1, other.n1p_1))
312
+ if (!equals(this.o1z_1, other.o1z_1))
316
313
  return false;
317
- if (!equals(this.o1p_1, other.o1p_1))
314
+ if (!equals(this.p1z_1, other.p1z_1))
318
315
  return false;
319
316
  return true;
320
317
  };
321
318
  function Companion_1() {
322
319
  Companion_instance_1 = this;
323
- this.d1p_1 = new Cyclist();
320
+ this.e1z_1 = new Cyclist();
324
321
  }
325
322
  var Companion_instance_1;
326
- function Companion_getInstance_2() {
323
+ function Companion_getInstance_4() {
327
324
  if (Companion_instance_1 == null)
328
325
  new Companion_1();
329
326
  return Companion_instance_1;
330
327
  }
331
328
  function Cyclist(massKg, maxBrakeG, cd, frontalAreaM2, maxLeanAngleDeg, maxSpeedKmH) {
332
- Companion_getInstance_2();
329
+ Companion_getInstance_4();
333
330
  massKg = massKg === VOID ? 80.0 : massKg;
334
331
  maxBrakeG = maxBrakeG === VOID ? 0.6 : maxBrakeG;
335
332
  cd = cd === VOID ? 0.7 : cd;
336
333
  frontalAreaM2 = frontalAreaM2 === VOID ? 0.5 : frontalAreaM2;
337
334
  maxLeanAngleDeg = maxLeanAngleDeg === VOID ? 35.0 : maxLeanAngleDeg;
338
335
  maxSpeedKmH = maxSpeedKmH === VOID ? 100.0 : maxSpeedKmH;
339
- this.u1p_1 = massKg;
340
- this.v1p_1 = maxBrakeG;
341
- this.w1p_1 = cd;
342
- this.x1p_1 = frontalAreaM2;
343
- this.y1p_1 = maxLeanAngleDeg;
344
- this.z1p_1 = maxSpeedKmH;
345
- }
346
- protoOf(Cyclist).a1q = function () {
336
+ this.v1z_1 = massKg;
337
+ this.w1z_1 = maxBrakeG;
338
+ this.x1z_1 = cd;
339
+ this.y1z_1 = frontalAreaM2;
340
+ this.z1z_1 = maxLeanAngleDeg;
341
+ this.a20_1 = maxSpeedKmH;
342
+ }
343
+ protoOf(Cyclist).b20 = function () {
347
344
  // Inline function 'kotlin.math.tan' call
348
- var x = this.y1p_1 * 3.141592653589793 / 180.0;
345
+ var x = this.z1z_1 * 3.141592653589793 / 180.0;
349
346
  return Math.tan(x);
350
347
  };
351
- protoOf(Cyclist).b1q = function () {
352
- return this.v1p_1 * 9.8;
348
+ protoOf(Cyclist).c20 = function () {
349
+ return this.w1z_1 * 9.8;
353
350
  };
354
- protoOf(Cyclist).c1q = function () {
355
- return this.z1p_1 / 3.6;
351
+ protoOf(Cyclist).d20 = function () {
352
+ return this.a20_1 / 3.6;
356
353
  };
357
354
  protoOf(Cyclist).toString = function () {
358
- return 'Cyclist(massKg=' + this.u1p_1 + ', maxBrakeG=' + this.v1p_1 + ', cd=' + this.w1p_1 + ', frontalAreaM2=' + this.x1p_1 + ', maxLeanAngleDeg=' + this.y1p_1 + ', maxSpeedKmH=' + this.z1p_1 + ')';
355
+ return 'Cyclist(massKg=' + this.v1z_1 + ', maxBrakeG=' + this.w1z_1 + ', cd=' + this.x1z_1 + ', frontalAreaM2=' + this.y1z_1 + ', maxLeanAngleDeg=' + this.z1z_1 + ', maxSpeedKmH=' + this.a20_1 + ')';
359
356
  };
360
357
  protoOf(Cyclist).hashCode = function () {
361
- var result = getNumberHashCode(this.u1p_1);
362
- result = imul(result, 31) + getNumberHashCode(this.v1p_1) | 0;
363
- result = imul(result, 31) + getNumberHashCode(this.w1p_1) | 0;
364
- result = imul(result, 31) + getNumberHashCode(this.x1p_1) | 0;
365
- result = imul(result, 31) + getNumberHashCode(this.y1p_1) | 0;
366
- result = imul(result, 31) + getNumberHashCode(this.z1p_1) | 0;
358
+ var result = getNumberHashCode(this.v1z_1);
359
+ result = imul(result, 31) + getNumberHashCode(this.w1z_1) | 0;
360
+ result = imul(result, 31) + getNumberHashCode(this.x1z_1) | 0;
361
+ result = imul(result, 31) + getNumberHashCode(this.y1z_1) | 0;
362
+ result = imul(result, 31) + getNumberHashCode(this.z1z_1) | 0;
363
+ result = imul(result, 31) + getNumberHashCode(this.a20_1) | 0;
367
364
  return result;
368
365
  };
369
366
  protoOf(Cyclist).equals = function (other) {
@@ -371,17 +368,17 @@
371
368
  return true;
372
369
  if (!(other instanceof Cyclist))
373
370
  return false;
374
- if (!equals(this.u1p_1, other.u1p_1))
371
+ if (!equals(this.v1z_1, other.v1z_1))
375
372
  return false;
376
- if (!equals(this.v1p_1, other.v1p_1))
373
+ if (!equals(this.w1z_1, other.w1z_1))
377
374
  return false;
378
- if (!equals(this.w1p_1, other.w1p_1))
375
+ if (!equals(this.x1z_1, other.x1z_1))
379
376
  return false;
380
- if (!equals(this.x1p_1, other.x1p_1))
377
+ if (!equals(this.y1z_1, other.y1z_1))
381
378
  return false;
382
- if (!equals(this.y1p_1, other.y1p_1))
379
+ if (!equals(this.z1z_1, other.z1z_1))
383
380
  return false;
384
- if (!equals(this.z1p_1, other.z1p_1))
381
+ if (!equals(this.a20_1, other.a20_1))
385
382
  return false;
386
383
  return true;
387
384
  };
@@ -389,17 +386,17 @@
389
386
  enabled = enabled === VOID ? true : enabled;
390
387
  toleranceM = toleranceM === VOID ? 10.0 : toleranceM;
391
388
  zExaggeration = zExaggeration === VOID ? 3.0 : zExaggeration;
392
- this.d1q_1 = enabled;
393
- this.e1q_1 = toleranceM;
394
- this.f1q_1 = zExaggeration;
389
+ this.e20_1 = enabled;
390
+ this.f20_1 = toleranceM;
391
+ this.g20_1 = zExaggeration;
395
392
  }
396
393
  protoOf(SimplifyPathOptions).toString = function () {
397
- return 'SimplifyPathOptions(enabled=' + this.d1q_1 + ', toleranceM=' + this.e1q_1 + ', zExaggeration=' + this.f1q_1 + ')';
394
+ return 'SimplifyPathOptions(enabled=' + this.e20_1 + ', toleranceM=' + this.f20_1 + ', zExaggeration=' + this.g20_1 + ')';
398
395
  };
399
396
  protoOf(SimplifyPathOptions).hashCode = function () {
400
- var result = getBooleanHashCode(this.d1q_1);
401
- result = imul(result, 31) + getNumberHashCode(this.e1q_1) | 0;
402
- result = imul(result, 31) + getNumberHashCode(this.f1q_1) | 0;
397
+ var result = getBooleanHashCode(this.e20_1);
398
+ result = imul(result, 31) + getNumberHashCode(this.f20_1) | 0;
399
+ result = imul(result, 31) + getNumberHashCode(this.g20_1) | 0;
403
400
  return result;
404
401
  };
405
402
  protoOf(SimplifyPathOptions).equals = function (other) {
@@ -407,46 +404,46 @@
407
404
  return true;
408
405
  if (!(other instanceof SimplifyPathOptions))
409
406
  return false;
410
- if (!(this.d1q_1 === other.d1q_1))
407
+ if (!(this.e20_1 === other.e20_1))
411
408
  return false;
412
- if (!equals(this.e1q_1, other.e1q_1))
409
+ if (!equals(this.f20_1, other.f20_1))
413
410
  return false;
414
- if (!equals(this.f1q_1, other.f1q_1))
411
+ if (!equals(this.g20_1, other.g20_1))
415
412
  return false;
416
413
  return true;
417
414
  };
418
415
  function Companion_2() {
419
416
  Companion_instance_2 = this;
420
- this.g1q_1 = new EnhanceOptions();
417
+ this.h20_1 = new EnhanceOptions();
421
418
  }
422
419
  var Companion_instance_2;
423
- function Companion_getInstance_3() {
420
+ function Companion_getInstance_5() {
424
421
  if (Companion_instance_2 == null)
425
422
  new Companion_2();
426
423
  return Companion_instance_2;
427
424
  }
428
425
  function EnhanceOptions(fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath) {
429
- Companion_getInstance_3();
426
+ Companion_getInstance_5();
430
427
  fixElevation = fixElevation === VOID ? true : fixElevation;
431
428
  computeMaxSpeeds = computeMaxSpeeds === VOID ? true : computeMaxSpeeds;
432
429
  virtualizeTrack = virtualizeTrack === VOID ? true : virtualizeTrack;
433
430
  computeOnePointPerSecond = computeOnePointPerSecond === VOID ? true : computeOnePointPerSecond;
434
431
  simplifyPath = simplifyPath === VOID ? new SimplifyPathOptions() : simplifyPath;
435
- this.h1q_1 = fixElevation;
436
- this.i1q_1 = computeMaxSpeeds;
437
- this.j1q_1 = virtualizeTrack;
438
- this.k1q_1 = computeOnePointPerSecond;
439
- this.l1q_1 = simplifyPath;
432
+ this.i20_1 = fixElevation;
433
+ this.j20_1 = computeMaxSpeeds;
434
+ this.k20_1 = virtualizeTrack;
435
+ this.l20_1 = computeOnePointPerSecond;
436
+ this.m20_1 = simplifyPath;
440
437
  }
441
438
  protoOf(EnhanceOptions).toString = function () {
442
- return 'EnhanceOptions(fixElevation=' + this.h1q_1 + ', computeMaxSpeeds=' + this.i1q_1 + ', virtualizeTrack=' + this.j1q_1 + ', computeOnePointPerSecond=' + this.k1q_1 + ', simplifyPath=' + this.l1q_1.toString() + ')';
439
+ return 'EnhanceOptions(fixElevation=' + this.i20_1 + ', computeMaxSpeeds=' + this.j20_1 + ', virtualizeTrack=' + this.k20_1 + ', computeOnePointPerSecond=' + this.l20_1 + ', simplifyPath=' + this.m20_1.toString() + ')';
443
440
  };
444
441
  protoOf(EnhanceOptions).hashCode = function () {
445
- var result = getBooleanHashCode(this.h1q_1);
446
- result = imul(result, 31) + getBooleanHashCode(this.i1q_1) | 0;
447
- result = imul(result, 31) + getBooleanHashCode(this.j1q_1) | 0;
448
- result = imul(result, 31) + getBooleanHashCode(this.k1q_1) | 0;
449
- result = imul(result, 31) + this.l1q_1.hashCode() | 0;
442
+ var result = getBooleanHashCode(this.i20_1);
443
+ result = imul(result, 31) + getBooleanHashCode(this.j20_1) | 0;
444
+ result = imul(result, 31) + getBooleanHashCode(this.k20_1) | 0;
445
+ result = imul(result, 31) + getBooleanHashCode(this.l20_1) | 0;
446
+ result = imul(result, 31) + this.m20_1.hashCode() | 0;
450
447
  return result;
451
448
  };
452
449
  protoOf(EnhanceOptions).equals = function (other) {
@@ -454,2175 +451,744 @@
454
451
  return true;
455
452
  if (!(other instanceof EnhanceOptions))
456
453
  return false;
457
- if (!(this.h1q_1 === other.h1q_1))
454
+ if (!(this.i20_1 === other.i20_1))
458
455
  return false;
459
- if (!(this.i1q_1 === other.i1q_1))
456
+ if (!(this.j20_1 === other.j20_1))
460
457
  return false;
461
- if (!(this.j1q_1 === other.j1q_1))
458
+ if (!(this.k20_1 === other.k20_1))
462
459
  return false;
463
- if (!(this.k1q_1 === other.k1q_1))
460
+ if (!(this.l20_1 === other.l20_1))
464
461
  return false;
465
- if (!this.l1q_1.equals(other.l1q_1))
462
+ if (!this.m20_1.equals(other.m20_1))
466
463
  return false;
467
464
  return true;
468
465
  };
469
466
  function $enhanceCourseCOROUTINE$(_this__u8e3s4, course, options, elevationProvider, resultContinuation) {
470
467
  CoroutineImpl.call(this, resultContinuation);
471
- this.u1q_1 = _this__u8e3s4;
472
- this.v1q_1 = course;
473
- this.w1q_1 = options;
474
- this.x1q_1 = elevationProvider;
468
+ this.v20_1 = _this__u8e3s4;
469
+ this.w20_1 = course;
470
+ this.x20_1 = options;
471
+ this.y20_1 = elevationProvider;
475
472
  }
476
- protoOf($enhanceCourseCOROUTINE$).o6 = function () {
477
- var suspendResult = this.i6_1;
473
+ protoOf($enhanceCourseCOROUTINE$).p6 = function () {
474
+ var suspendResult = this.j6_1;
478
475
  $sm: do
479
476
  try {
480
- var tmp = this.g6_1;
477
+ var tmp = this.h6_1;
481
478
  switch (tmp) {
482
479
  case 0:
483
- this.h6_1 = 3;
484
- this.y1q_1 = this.v1q_1.p1p();
485
- this.y1q_1 = PointPerDistance_instance.z1q(this.y1q_1, -1.0, 30.0);
486
- if (this.w1q_1.h1q_1 && !(this.x1q_1 == null)) {
487
- this.g6_1 = 1;
488
- suspendResult = ElevationStep_instance.b1r(this.y1q_1, this.x1q_1, this);
480
+ this.i6_1 = 3;
481
+ this.z20_1 = this.w20_1.q1z();
482
+ this.z20_1 = PointPerDistance_instance.a1x(this.z20_1, -1.0, 30.0);
483
+ if (this.x20_1.i20_1 && !(this.y20_1 == null)) {
484
+ this.h6_1 = 1;
485
+ suspendResult = ElevationStep_instance.s1u(this.z20_1, this.y20_1, this);
489
486
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
490
487
  return suspendResult;
491
488
  }
492
489
  continue $sm;
493
490
  } else {
494
- this.g6_1 = 2;
491
+ this.h6_1 = 2;
495
492
  continue $sm;
496
493
  }
497
494
 
498
495
  case 1:
499
- this.y1q_1 = suspendResult;
500
- this.g6_1 = 2;
496
+ this.z20_1 = suspendResult;
497
+ this.h6_1 = 2;
501
498
  continue $sm;
502
499
  case 2:
503
- this.y1q_1 = PointPerDistance_instance.z1q(this.y1q_1, 1.0, 2.0);
504
- this.y1q_1 = ElevationStep_instance.c1r(this.y1q_1);
505
- var working = this.v1q_1.t1p(this.v1q_1.k1p_1.i1p(this.y1q_1));
506
- if (this.w1q_1.i1q_1 || this.w1q_1.j1q_1) {
507
- MaxSpeedComputer_instance.i1r(working.k1p_1);
500
+ this.z20_1 = PointPerDistance_instance.a1x(this.z20_1, 1.0, 2.0);
501
+ this.z20_1 = ElevationStep_instance.v1u(this.z20_1);
502
+ var working = this.w20_1.u1z(this.w20_1.l1z_1.j1z(this.z20_1));
503
+ if (this.x20_1.j20_1 || this.x20_1.k20_1) {
504
+ MaxSpeedComputer_instance.f21(working.l1z_1);
508
505
  }
509
506
 
510
- if (this.w1q_1.j1q_1) {
511
- this.y1q_1 = VirtualizeService_instance.k1r(working);
512
- working = working.t1p(working.k1p_1.i1p(this.y1q_1));
507
+ if (this.x20_1.k20_1) {
508
+ this.z20_1 = VirtualizeService_instance.h21(working);
509
+ working = working.u1z(working.l1z_1.j1z(this.z20_1));
513
510
  }
514
511
 
515
- if (this.w1q_1.k1q_1) {
516
- this.y1q_1 = PointPerSecond_instance.l1r(this.y1q_1);
512
+ if (this.x20_1.l20_1) {
513
+ this.z20_1 = PointPerSecond_instance.g1x(this.z20_1);
517
514
  }
518
515
 
519
- if (this.w1q_1.l1q_1.d1q_1) {
520
- this.y1q_1 = PathSimplifier_instance.m1r(this.y1q_1, this.w1q_1.l1q_1.e1q_1, this.w1q_1.l1q_1.f1q_1);
516
+ if (this.x20_1.m20_1.e20_1) {
517
+ this.z20_1 = PathSimplifier_instance.o1w(this.z20_1, this.x20_1.m20_1.f20_1, this.x20_1.m20_1.g20_1);
521
518
  }
522
519
 
523
- return this.y1q_1;
520
+ return this.z20_1;
524
521
  case 3:
525
- throw this.j6_1;
522
+ throw this.k6_1;
526
523
  }
527
524
  } catch ($p) {
528
525
  var e = $p;
529
- if (this.h6_1 === 3) {
526
+ if (this.i6_1 === 3) {
530
527
  throw e;
531
528
  } else {
532
- this.g6_1 = this.h6_1;
533
- this.j6_1 = e;
529
+ this.h6_1 = this.i6_1;
530
+ this.k6_1 = e;
534
531
  }
535
532
  }
536
533
  while (true);
537
534
  };
538
535
  function Enhancer() {
539
536
  }
540
- protoOf(Enhancer).n1r = function (path) {
537
+ protoOf(Enhancer).i21 = function (path) {
541
538
  return new CoursePhysics(new Course(path), RhoProviderEstimate_instance, AeroProviderConstant_instance, WindProviderNone_instance, new PowerProviderConstant(280.0));
542
539
  };
543
- protoOf(Enhancer).o1r = function (path, elevationProvider, options, $completion) {
544
- return this.p1r(this.n1r(path), options, elevationProvider, $completion);
540
+ protoOf(Enhancer).j21 = function (path, elevationProvider, options, $completion) {
541
+ return this.k21(this.i21(path), options, elevationProvider, $completion);
545
542
  };
546
- protoOf(Enhancer).p1r = function (course, options, elevationProvider, $completion) {
543
+ protoOf(Enhancer).k21 = function (course, options, elevationProvider, $completion) {
547
544
  var tmp = new $enhanceCourseCOROUTINE$(this, course, options, elevationProvider, $completion);
548
- tmp.i6_1 = Unit_instance;
549
- tmp.j6_1 = null;
550
- return tmp.o6();
545
+ tmp.j6_1 = Unit_instance;
546
+ tmp.k6_1 = null;
547
+ return tmp.p6();
551
548
  };
552
549
  var Enhancer_instance;
553
550
  function Enhancer_getInstance() {
554
551
  return Enhancer_instance;
555
552
  }
556
- function GpxDocument(name, tracks) {
557
- name = name === VOID ? 'noname' : name;
558
- this.q1r_1 = name;
559
- this.r1r_1 = tracks;
560
- }
561
- protoOf(GpxDocument).toString = function () {
562
- return 'GpxDocument(name=' + this.q1r_1 + ', tracks=' + toString(this.r1r_1) + ')';
563
- };
564
- protoOf(GpxDocument).hashCode = function () {
565
- var result = getStringHashCode(this.q1r_1);
566
- result = imul(result, 31) + hashCode(this.r1r_1) | 0;
553
+ function Climb(startIndex, endIndex, startDistanceM, endDistanceM, startElevationM, endElevationM, positiveElevationM, negativeElevationM, parts) {
554
+ this.l21_1 = startIndex;
555
+ this.m21_1 = endIndex;
556
+ this.n21_1 = startDistanceM;
557
+ this.o21_1 = endDistanceM;
558
+ this.p21_1 = startElevationM;
559
+ this.q21_1 = endElevationM;
560
+ this.r21_1 = positiveElevationM;
561
+ this.s21_1 = negativeElevationM;
562
+ this.t21_1 = parts;
563
+ }
564
+ protoOf(Climb).u21 = function () {
565
+ return this.o21_1 - this.n21_1;
566
+ };
567
+ protoOf(Climb).v21 = function () {
568
+ return this.q21_1 - this.p21_1;
569
+ };
570
+ protoOf(Climb).w21 = function () {
571
+ return this.u21() === 0.0 ? 0.0 : this.v21() / this.u21();
572
+ };
573
+ protoOf(Climb).x21 = function () {
574
+ // Inline function 'kotlin.collections.filter' call
575
+ var tmp0 = this.t21_1;
576
+ // Inline function 'kotlin.collections.filterTo' call
577
+ var destination = ArrayList_init_$Create$();
578
+ var _iterator__ex2g4s = tmp0.i();
579
+ while (_iterator__ex2g4s.j()) {
580
+ var element = _iterator__ex2g4s.k();
581
+ if (element.v21() > 0) {
582
+ destination.h(element);
583
+ }
584
+ }
585
+ // Inline function 'kotlin.collections.sumOf' call
586
+ var sum = 0;
587
+ var _iterator__ex2g4s_0 = destination.i();
588
+ while (_iterator__ex2g4s_0.j()) {
589
+ var element_0 = _iterator__ex2g4s_0.k();
590
+ var tmp = sum;
591
+ sum = tmp + element_0.u21();
592
+ }
593
+ var climbingLength = sum;
594
+ return climbingLength === 0.0 ? 0.0 : this.r21_1 / climbingLength;
595
+ };
596
+ protoOf(Climb).toString = function () {
597
+ return 'Climb(startIndex=' + this.l21_1 + ', endIndex=' + this.m21_1 + ', startDistanceM=' + this.n21_1 + ', endDistanceM=' + this.o21_1 + ', startElevationM=' + this.p21_1 + ', endElevationM=' + this.q21_1 + ', positiveElevationM=' + this.r21_1 + ', negativeElevationM=' + this.s21_1 + ', parts=' + toString(this.t21_1) + ')';
598
+ };
599
+ protoOf(Climb).hashCode = function () {
600
+ var result = this.l21_1;
601
+ result = imul(result, 31) + this.m21_1 | 0;
602
+ result = imul(result, 31) + getNumberHashCode(this.n21_1) | 0;
603
+ result = imul(result, 31) + getNumberHashCode(this.o21_1) | 0;
604
+ result = imul(result, 31) + getNumberHashCode(this.p21_1) | 0;
605
+ result = imul(result, 31) + getNumberHashCode(this.q21_1) | 0;
606
+ result = imul(result, 31) + getNumberHashCode(this.r21_1) | 0;
607
+ result = imul(result, 31) + getNumberHashCode(this.s21_1) | 0;
608
+ result = imul(result, 31) + hashCode(this.t21_1) | 0;
567
609
  return result;
568
610
  };
569
- protoOf(GpxDocument).equals = function (other) {
611
+ protoOf(Climb).equals = function (other) {
570
612
  if (this === other)
571
613
  return true;
572
- if (!(other instanceof GpxDocument))
614
+ if (!(other instanceof Climb))
573
615
  return false;
574
- if (!(this.q1r_1 === other.q1r_1))
616
+ if (!(this.l21_1 === other.l21_1))
575
617
  return false;
576
- if (!equals(this.r1r_1, other.r1r_1))
618
+ if (!(this.m21_1 === other.m21_1))
577
619
  return false;
578
- return true;
579
- };
580
- function GpxTrack(name, type, points) {
581
- name = name === VOID ? null : name;
582
- type = type === VOID ? null : type;
583
- this.s1r_1 = name;
584
- this.t1r_1 = type;
585
- this.u1r_1 = points;
586
- }
587
- protoOf(GpxTrack).toString = function () {
588
- return 'GpxTrack(name=' + this.s1r_1 + ', type=' + this.t1r_1 + ', points=' + toString(this.u1r_1) + ')';
589
- };
590
- protoOf(GpxTrack).hashCode = function () {
591
- var result = this.s1r_1 == null ? 0 : getStringHashCode(this.s1r_1);
592
- result = imul(result, 31) + (this.t1r_1 == null ? 0 : getStringHashCode(this.t1r_1)) | 0;
593
- result = imul(result, 31) + hashCode(this.u1r_1) | 0;
594
- return result;
595
- };
596
- protoOf(GpxTrack).equals = function (other) {
597
- if (this === other)
598
- return true;
599
- if (!(other instanceof GpxTrack))
620
+ if (!equals(this.n21_1, other.n21_1))
621
+ return false;
622
+ if (!equals(this.o21_1, other.o21_1))
623
+ return false;
624
+ if (!equals(this.p21_1, other.p21_1))
600
625
  return false;
601
- if (!(this.s1r_1 == other.s1r_1))
626
+ if (!equals(this.q21_1, other.q21_1))
602
627
  return false;
603
- if (!(this.t1r_1 == other.t1r_1))
628
+ if (!equals(this.r21_1, other.r21_1))
604
629
  return false;
605
- if (!equals(this.u1r_1, other.u1r_1))
630
+ if (!equals(this.s21_1, other.s21_1))
631
+ return false;
632
+ if (!equals(this.t21_1, other.t21_1))
606
633
  return false;
607
634
  return true;
608
635
  };
609
- function GpxTrackPoint(latitudeDeg, longitudeDeg, elevationM, timeEpochMs, heartRate, cadence, temperatureC, powerW) {
610
- elevationM = elevationM === VOID ? null : elevationM;
611
- timeEpochMs = timeEpochMs === VOID ? null : timeEpochMs;
612
- heartRate = heartRate === VOID ? null : heartRate;
613
- cadence = cadence === VOID ? null : cadence;
614
- temperatureC = temperatureC === VOID ? null : temperatureC;
615
- powerW = powerW === VOID ? null : powerW;
616
- this.v1r_1 = latitudeDeg;
617
- this.w1r_1 = longitudeDeg;
618
- this.x1r_1 = elevationM;
619
- this.y1r_1 = timeEpochMs;
620
- this.z1r_1 = heartRate;
621
- this.a1s_1 = cadence;
622
- this.b1s_1 = temperatureC;
623
- this.c1s_1 = powerW;
624
- }
625
- protoOf(GpxTrackPoint).toString = function () {
626
- return 'GpxTrackPoint(latitudeDeg=' + this.v1r_1 + ', longitudeDeg=' + this.w1r_1 + ', elevationM=' + this.x1r_1 + ', timeEpochMs=' + toString_0(this.y1r_1) + ', heartRate=' + this.z1r_1 + ', cadence=' + this.a1s_1 + ', temperatureC=' + this.b1s_1 + ', powerW=' + this.c1s_1 + ')';
627
- };
628
- protoOf(GpxTrackPoint).hashCode = function () {
629
- var result = getNumberHashCode(this.v1r_1);
630
- result = imul(result, 31) + getNumberHashCode(this.w1r_1) | 0;
631
- result = imul(result, 31) + (this.x1r_1 == null ? 0 : getNumberHashCode(this.x1r_1)) | 0;
632
- result = imul(result, 31) + (this.y1r_1 == null ? 0 : this.y1r_1.hashCode()) | 0;
633
- result = imul(result, 31) + (this.z1r_1 == null ? 0 : this.z1r_1) | 0;
634
- result = imul(result, 31) + (this.a1s_1 == null ? 0 : this.a1s_1) | 0;
635
- result = imul(result, 31) + (this.b1s_1 == null ? 0 : getNumberHashCode(this.b1s_1)) | 0;
636
- result = imul(result, 31) + (this.c1s_1 == null ? 0 : getNumberHashCode(this.c1s_1)) | 0;
636
+ function ClimbPart(startDistanceM, endDistanceM, startElevationM, endElevationM) {
637
+ this.y21_1 = startDistanceM;
638
+ this.z21_1 = endDistanceM;
639
+ this.a22_1 = startElevationM;
640
+ this.b22_1 = endElevationM;
641
+ }
642
+ protoOf(ClimbPart).u21 = function () {
643
+ return this.z21_1 - this.y21_1;
644
+ };
645
+ protoOf(ClimbPart).v21 = function () {
646
+ return this.b22_1 - this.a22_1;
647
+ };
648
+ protoOf(ClimbPart).c22 = function () {
649
+ return this.u21() === 0.0 ? 0.0 : this.v21() / this.u21();
650
+ };
651
+ protoOf(ClimbPart).toString = function () {
652
+ return 'ClimbPart(startDistanceM=' + this.y21_1 + ', endDistanceM=' + this.z21_1 + ', startElevationM=' + this.a22_1 + ', endElevationM=' + this.b22_1 + ')';
653
+ };
654
+ protoOf(ClimbPart).hashCode = function () {
655
+ var result = getNumberHashCode(this.y21_1);
656
+ result = imul(result, 31) + getNumberHashCode(this.z21_1) | 0;
657
+ result = imul(result, 31) + getNumberHashCode(this.a22_1) | 0;
658
+ result = imul(result, 31) + getNumberHashCode(this.b22_1) | 0;
637
659
  return result;
638
660
  };
639
- protoOf(GpxTrackPoint).equals = function (other) {
661
+ protoOf(ClimbPart).equals = function (other) {
640
662
  if (this === other)
641
663
  return true;
642
- if (!(other instanceof GpxTrackPoint))
643
- return false;
644
- if (!equals(this.v1r_1, other.v1r_1))
645
- return false;
646
- if (!equals(this.w1r_1, other.w1r_1))
647
- return false;
648
- if (!equals(this.x1r_1, other.x1r_1))
664
+ if (!(other instanceof ClimbPart))
649
665
  return false;
650
- if (!equals(this.y1r_1, other.y1r_1))
666
+ if (!equals(this.y21_1, other.y21_1))
651
667
  return false;
652
- if (!(this.z1r_1 == other.z1r_1))
668
+ if (!equals(this.z21_1, other.z21_1))
653
669
  return false;
654
- if (!(this.a1s_1 == other.a1s_1))
670
+ if (!equals(this.a22_1, other.a22_1))
655
671
  return false;
656
- if (!equals(this.b1s_1, other.b1s_1))
657
- return false;
658
- if (!equals(this.c1s_1, other.c1s_1))
672
+ if (!equals(this.b22_1, other.b22_1))
659
673
  return false;
660
674
  return true;
661
675
  };
662
- function toGpxTrack(_this__u8e3s4, name, type) {
663
- name = name === VOID ? null : name;
664
- type = type === VOID ? 'cycling' : type;
665
- // Inline function 'kotlin.collections.List' call
666
- // Inline function 'kotlin.collections.MutableList' call
667
- var size = _this__u8e3s4.d1s_1;
668
- var list = ArrayList_init_$Create$(size);
669
- // Inline function 'kotlin.repeat' call
670
- var inductionVariable = 0;
671
- if (inductionVariable < size)
672
- do {
673
- var index = inductionVariable;
674
- inductionVariable = inductionVariable + 1 | 0;
675
- var tmp = _this__u8e3s4.f1s(index) * MathConstants_getInstance().yv_1;
676
- var tmp_0 = _this__u8e3s4.g1s(index) * MathConstants_getInstance().yv_1;
677
- // Inline function 'kotlin.takeUnless' call
678
- var this_0 = _this__u8e3s4.h1s(index);
679
- var tmp_1;
680
- if (!isNaN_0(this_0)) {
681
- tmp_1 = this_0;
682
- } else {
683
- tmp_1 = null;
684
- }
685
- var tmp_2 = tmp_1;
686
- // Inline function 'kotlin.takeIf' call
687
- var this_1 = numberToLong(_this__u8e3s4.i1s(index));
688
- var tmp_3;
689
- if (compare(this_1, new Long(0, 0)) > 0) {
690
- tmp_3 = this_1;
691
- } else {
692
- tmp_3 = null;
693
- }
694
- var tmp_4 = tmp_3;
695
- // Inline function 'kotlin.takeUnless' call
696
- var this_2 = _this__u8e3s4.j1s(index);
697
- var tmp_5;
698
- if (!(isNaN_0(this_2) || this_2 === 0.0)) {
699
- tmp_5 = this_2;
700
- } else {
701
- tmp_5 = null;
702
- }
703
- var tmp0_safe_receiver = tmp_5;
704
- var tmp_6 = tmp0_safe_receiver == null ? null : roundToInt(tmp0_safe_receiver);
705
- // Inline function 'kotlin.takeUnless' call
706
- var this_3 = _this__u8e3s4.k1s(index);
707
- var tmp_7;
708
- if (!(isNaN_0(this_3) || this_3 === 0.0)) {
709
- tmp_7 = this_3;
710
- } else {
711
- tmp_7 = null;
712
- }
713
- var tmp1_safe_receiver = tmp_7;
714
- var tmp_8 = tmp1_safe_receiver == null ? null : roundToInt(tmp1_safe_receiver);
715
- // Inline function 'kotlin.takeUnless' call
716
- var this_4 = _this__u8e3s4.l1s(index);
717
- var tmp_9;
718
- if (!(isNaN_0(this_4) || this_4 === 0.0)) {
719
- tmp_9 = this_4;
720
- } else {
721
- tmp_9 = null;
722
- }
723
- var tmp_10 = tmp_9;
724
- // Inline function 'kotlin.takeUnless' call
725
- var this_5 = _this__u8e3s4.m1s(index);
726
- var tmp_11;
727
- if (!(isNaN_0(this_5) || this_5 === 0.0)) {
728
- tmp_11 = this_5;
729
- } else {
730
- tmp_11 = null;
731
- }
732
- var tmp$ret$15 = tmp_11;
733
- var tmp$ret$4 = new GpxTrackPoint(tmp, tmp_0, tmp_2, tmp_4, tmp_6, tmp_8, tmp_10, tmp$ret$15);
734
- list.n(tmp$ret$4);
735
- }
736
- while (inductionVariable < size);
737
- var points = list;
738
- return new GpxTrack(name, type, points);
739
- }
740
- function toGpxDocument(_this__u8e3s4, name, trackName) {
741
- name = name === VOID ? 'noname' : name;
742
- trackName = trackName === VOID ? null : trackName;
743
- return new GpxDocument(name, listOf(toGpxTrack(_this__u8e3s4, trackName)));
744
- }
745
- function parseDocument($this, reader) {
746
- while (reader.i()) {
747
- var ev = reader.j();
748
- if (ev.equals(EventType_START_ELEMENT_getInstance())) {
749
- if (!(reader.u16() === 'gpx')) {
750
- throw IllegalArgumentException_init_$Create$('Invalid GPX file: missing gpx root element (found ' + reader.u16() + ')');
751
- }
752
- return parseGpxRoot($this, reader);
753
- }
754
- }
755
- throw IllegalArgumentException_init_$Create$('Invalid GPX file: missing gpx root element');
756
- }
757
- function parseGpxRoot($this, reader) {
758
- var name = 'noname';
759
- // Inline function 'kotlin.collections.mutableListOf' call
760
- var tracks = ArrayList_init_$Create$_0();
761
- while (reader.i()) {
762
- var ev = reader.j();
763
- switch (ev.n1_1) {
764
- case 1:
765
- switch (reader.u16()) {
766
- case 'metadata':
767
- var metaName = parseMetadataName($this, reader);
768
- if (!(metaName == null))
769
- name = metaName;
770
- break;
771
- case 'trk':
772
- tracks.n(parseTrack($this, reader));
773
- break;
774
- default:
775
- skipElement($this, reader);
776
- break;
777
- }
778
-
779
- break;
780
- case 2:
781
- return new GpxDocument(name, tracks);
782
- default:
783
- break;
784
- }
785
- }
786
- return new GpxDocument(name, tracks);
787
- }
788
- function parseMetadataName($this, reader) {
789
- var name = null;
790
- while (reader.i()) {
791
- var ev = reader.j();
792
- switch (ev.n1_1) {
793
- case 1:
794
- if (reader.u16() === 'name' && name == null) {
795
- // Inline function 'kotlin.text.trim' call
796
- var this_0 = readElementText($this, reader);
797
- // Inline function 'kotlin.text.ifEmpty' call
798
- var this_1 = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
799
- var tmp;
800
- // Inline function 'kotlin.text.isEmpty' call
801
- if (charSequenceLength(this_1) === 0) {
802
- tmp = null;
803
- } else {
804
- tmp = this_1;
805
- }
806
- name = tmp;
807
- } else {
808
- skipElement($this, reader);
809
- }
810
-
811
- break;
812
- case 2:
813
- return name;
814
- default:
815
- break;
816
- }
817
- }
818
- return name;
819
- }
820
- function parseTrack($this, reader) {
821
- var name = null;
822
- var type = null;
823
- // Inline function 'kotlin.collections.mutableListOf' call
824
- var points = ArrayList_init_$Create$_0();
825
- while (reader.i()) {
826
- var ev = reader.j();
827
- switch (ev.n1_1) {
828
- case 1:
829
- switch (reader.u16()) {
830
- case 'name':
831
- // Inline function 'kotlin.text.trim' call
832
-
833
- var this_0 = readElementText($this, reader);
834
- // Inline function 'kotlin.text.ifEmpty' call
835
-
836
- var this_1 = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
837
- var tmp;
838
- // Inline function 'kotlin.text.isEmpty' call
839
-
840
- if (charSequenceLength(this_1) === 0) {
841
- tmp = null;
842
- } else {
843
- tmp = this_1;
844
- }
845
-
846
- name = tmp;
847
- break;
848
- case 'type':
849
- // Inline function 'kotlin.text.trim' call
850
-
851
- var this_2 = readElementText($this, reader);
852
- // Inline function 'kotlin.text.ifEmpty' call
853
-
854
- var this_3 = toString(trim(isCharSequence(this_2) ? this_2 : THROW_CCE()));
855
- var tmp_0;
856
- // Inline function 'kotlin.text.isEmpty' call
857
-
858
- if (charSequenceLength(this_3) === 0) {
859
- tmp_0 = null;
860
- } else {
861
- tmp_0 = this_3;
862
- }
863
-
864
- type = tmp_0;
865
- break;
866
- case 'trkseg':
867
- parseTrackSegment($this, reader, points);
868
- break;
869
- default:
870
- skipElement($this, reader);
871
- break;
872
- }
873
-
874
- break;
875
- case 2:
876
- return new GpxTrack(name, type, points);
877
- default:
878
- break;
879
- }
880
- }
881
- return new GpxTrack(name, type, points);
882
- }
883
- function parseTrackSegment($this, reader, accum) {
884
- while (reader.i()) {
885
- var ev = reader.j();
886
- switch (ev.n1_1) {
887
- case 1:
888
- if (reader.u16() === 'trkpt') {
889
- accum.n(parseTrackPoint($this, reader));
890
- } else {
891
- skipElement($this, reader);
892
- }
893
-
894
- break;
895
- case 2:
896
- return Unit_instance;
897
- default:
898
- break;
899
- }
900
- }
901
- }
902
- function parseTrackPoint($this, reader) {
903
- var latStr = reader.f17(null, 'lat');
904
- var lonStr = reader.f17(null, 'lon');
905
- var tmp;
906
- // Inline function 'kotlin.text.isNullOrBlank' call
907
- if (latStr == null || isBlank(latStr)) {
908
- tmp = true;
909
- } else {
910
- // Inline function 'kotlin.text.isNullOrBlank' call
911
- tmp = lonStr == null || isBlank(lonStr);
912
- }
913
- if (tmp) {
914
- throw IllegalArgumentException_init_$Create$('Invalid track point: missing latitude or longitude attribute');
915
- }
916
- var tmp0_elvis_lhs = toDoubleOrNull(latStr);
917
- var tmp_0;
918
- if (tmp0_elvis_lhs == null) {
919
- throw IllegalArgumentException_init_$Create$("Invalid track point: latitude '" + latStr + "' is not a valid number");
920
- } else {
921
- tmp_0 = tmp0_elvis_lhs;
922
- }
923
- var lat = tmp_0;
924
- var tmp1_elvis_lhs = toDoubleOrNull(lonStr);
925
- var tmp_1;
926
- if (tmp1_elvis_lhs == null) {
927
- throw IllegalArgumentException_init_$Create$("Invalid track point: longitude '" + lonStr + "' is not a valid number");
928
- } else {
929
- tmp_1 = tmp1_elvis_lhs;
930
- }
931
- var lon = tmp_1;
932
- var elevation = null;
933
- var timeMs = null;
934
- var ext = new ExtensionsAccumulator();
935
- while (reader.i()) {
936
- var ev = reader.j();
937
- switch (ev.n1_1) {
938
- case 1:
939
- switch (reader.u16()) {
940
- case 'ele':
941
- // Inline function 'kotlin.text.trim' call
942
-
943
- var this_0 = readElementText($this, reader);
944
- var txt = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
945
- // Inline function 'kotlin.text.isNotEmpty' call
946
-
947
- if (charSequenceLength(txt) > 0) {
948
- var tmp4_elvis_lhs = toDoubleOrNull(txt);
949
- elevation = tmp4_elvis_lhs == null ? elevation : tmp4_elvis_lhs;
950
- }
951
-
952
- break;
953
- case 'time':
954
- // Inline function 'kotlin.text.trim' call
955
-
956
- var this_1 = readElementText($this, reader);
957
- var txt_0 = toString(trim(isCharSequence(this_1) ? this_1 : THROW_CCE()));
958
- // Inline function 'kotlin.text.isNotEmpty' call
959
-
960
- if (charSequenceLength(txt_0) > 0)
961
- timeMs = parseTimeIsoToMs($this, txt_0);
962
- break;
963
- case 'extensions':
964
- parseExtensions($this, reader, ext);
965
- break;
966
- default:
967
- skipElement($this, reader);
968
- break;
969
- }
970
-
971
- break;
972
- case 2:
973
- return new GpxTrackPoint(lat, lon, elevation, timeMs, ext.n1s_1, ext.o1s_1, ext.p1s_1, ext.q1s_1);
974
- default:
975
- break;
976
- }
977
- }
978
- return new GpxTrackPoint(lat, lon, elevation, timeMs, ext.n1s_1, ext.o1s_1, ext.p1s_1, ext.q1s_1);
979
- }
980
- function parseExtensions($this, reader, ext) {
981
- while (reader.i()) {
982
- var ev = reader.j();
983
- switch (ev.n1_1) {
984
- case 1:
985
- var ln = reader.u16();
986
- // Inline function 'kotlin.text.lowercase' call
987
-
988
- // Inline function 'kotlin.js.asDynamic' call
989
-
990
- switch (ln.toLowerCase()) {
991
- case 'power':
992
- var tmp2_safe_receiver = readNumeric($this, reader);
993
- if (tmp2_safe_receiver == null)
994
- null;
995
- else {
996
- // Inline function 'kotlin.let' call
997
- var tmp = ext;
998
- var tmp0_elvis_lhs = ext.q1s_1;
999
- tmp.q1s_1 = tmp0_elvis_lhs == null ? tmp2_safe_receiver : tmp0_elvis_lhs;
1000
- }
1001
-
1002
- break;
1003
- case 'hr':
1004
- case 'heartrate':
1005
- var tmp3_safe_receiver = readNumeric($this, reader);
1006
- if (tmp3_safe_receiver == null)
1007
- null;
1008
- else {
1009
- // Inline function 'kotlin.let' call
1010
- if (ext.n1s_1 == null)
1011
- ext.n1s_1 = numberToInt(tmp3_safe_receiver);
1012
- }
1013
-
1014
- break;
1015
- case 'cad':
1016
- case 'cadence':
1017
- var tmp4_safe_receiver = readNumeric($this, reader);
1018
- if (tmp4_safe_receiver == null)
1019
- null;
1020
- else {
1021
- // Inline function 'kotlin.let' call
1022
- if (ext.o1s_1 == null)
1023
- ext.o1s_1 = numberToInt(tmp4_safe_receiver);
1024
- }
1025
-
1026
- break;
1027
- case 'atemp':
1028
- case 'temperature':
1029
- case 'temp':
1030
- var tmp5_safe_receiver = readNumeric($this, reader);
1031
- if (tmp5_safe_receiver == null)
1032
- null;
1033
- else {
1034
- // Inline function 'kotlin.let' call
1035
- var tmp_0 = ext;
1036
- var tmp0_elvis_lhs_0 = ext.p1s_1;
1037
- tmp_0.p1s_1 = tmp0_elvis_lhs_0 == null ? tmp5_safe_receiver : tmp0_elvis_lhs_0;
1038
- }
1039
-
1040
- break;
1041
- default:
1042
- parseExtensions($this, reader, ext);
1043
- break;
1044
- }
1045
-
1046
- break;
1047
- case 2:
1048
- return Unit_instance;
1049
- default:
1050
- break;
1051
- }
1052
- }
1053
- }
1054
- function readElementText($this, reader) {
1055
- var sb = StringBuilder_init_$Create$();
1056
- while (reader.i()) {
1057
- var ev = reader.j();
1058
- switch (ev.n1_1) {
1059
- case 4:
1060
- case 5:
1061
- case 9:
1062
- sb.u5(reader.z16());
1063
- break;
1064
- case 1:
1065
- skipElement($this, reader);
1066
- break;
1067
- case 2:
1068
- return sb.toString();
1069
- default:
1070
- break;
1071
- }
1072
- }
1073
- return sb.toString();
1074
- }
1075
- function readNumeric($this, reader) {
1076
- // Inline function 'kotlin.text.trim' call
1077
- var this_0 = readElementText($this, reader);
1078
- var txt = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
1079
- return toDoubleOrNull(txt);
1080
- }
1081
- function skipElement($this, reader) {
1082
- var depth = 1;
1083
- while (reader.i() && depth > 0) {
1084
- switch (reader.j().n1_1) {
1085
- case 1:
1086
- depth = depth + 1 | 0;
1087
- break;
1088
- case 2:
1089
- depth = depth - 1 | 0;
1090
- break;
1091
- default:
1092
- break;
1093
- }
1094
- }
1095
- }
1096
- function parseTimeIsoToMs($this, text) {
1097
- var tmp;
1098
- try {
1099
- tmp = Companion_getInstance().wc(text).ad();
1100
- } catch ($p) {
1101
- var tmp_0;
1102
- if ($p instanceof IllegalArgumentException) {
1103
- var e = $p;
1104
- tmp_0 = null;
1105
- } else {
1106
- if ($p instanceof Error) {
1107
- var e_0 = $p;
1108
- tmp_0 = null;
1109
- } else {
1110
- throw $p;
1111
- }
1112
- }
1113
- tmp = tmp_0;
1114
- }
1115
- return tmp;
1116
- }
1117
- function ExtensionsAccumulator(heartRate, cadence, temperatureC, powerW) {
1118
- heartRate = heartRate === VOID ? null : heartRate;
1119
- cadence = cadence === VOID ? null : cadence;
1120
- temperatureC = temperatureC === VOID ? null : temperatureC;
1121
- powerW = powerW === VOID ? null : powerW;
1122
- this.n1s_1 = heartRate;
1123
- this.o1s_1 = cadence;
1124
- this.p1s_1 = temperatureC;
1125
- this.q1s_1 = powerW;
1126
- }
1127
- function GpxParser() {
1128
- }
1129
- protoOf(GpxParser).r1s = function (xml) {
1130
- var tmp;
1131
- try {
1132
- tmp = get_xmlStreaming().z17(xml);
1133
- } catch ($p) {
1134
- var tmp_0;
1135
- if ($p instanceof XmlException) {
1136
- var e = $p;
1137
- throw IllegalArgumentException_init_$Create$_0('Invalid GPX XML: ' + e.e(), e);
1138
- } else {
1139
- throw $p;
1140
- }
1141
- }
1142
- var reader = tmp;
1143
- var tmp_1;
1144
- try {
1145
- tmp_1 = parseDocument(this, reader);
1146
- } catch ($p_0) {
1147
- var tmp_2;
1148
- if ($p_0 instanceof XmlException) {
1149
- var e_0 = $p_0;
1150
- throw IllegalArgumentException_init_$Create$_0('Invalid GPX XML: ' + e_0.e(), e_0);
1151
- } else {
1152
- throw $p_0;
1153
- }
1154
- }
1155
- finally {
1156
- reader.h17();
1157
- }
1158
- return tmp_1;
1159
- };
1160
- var GpxParser_instance;
1161
- function GpxParser_getInstance() {
1162
- return GpxParser_instance;
1163
- }
1164
- function firstTrackAsPath(_this__u8e3s4) {
1165
- var tmp0_elvis_lhs = firstOrNull(_this__u8e3s4.r1r_1);
1166
- var tmp;
1167
- if (tmp0_elvis_lhs == null) {
1168
- // Inline function 'kotlin.error' call
1169
- var message = 'GpxDocument has no track';
1170
- throw IllegalStateException_init_$Create$(toString(message));
1171
- } else {
1172
- tmp = tmp0_elvis_lhs;
1173
- }
1174
- var track = tmp;
1175
- return toPath(track);
1176
- }
1177
- function toPath(_this__u8e3s4) {
1178
- var n = _this__u8e3s4.u1r_1.k();
1179
- var path = new Path(n);
1180
- var iterator = _this__u8e3s4.u1r_1.h();
1181
- var index = 0;
1182
- while (iterator.i()) {
1183
- var i = index;
1184
- index = index + 1 | 0;
1185
- var p = iterator.j();
1186
- path.s1s(i, p.v1r_1 * MathConstants_getInstance().xv_1);
1187
- path.t1s(i, p.w1r_1 * MathConstants_getInstance().xv_1);
1188
- var tmp0_elvis_lhs = p.x1r_1;
1189
- path.u1s(i, tmp0_elvis_lhs == null ? 0.0 : tmp0_elvis_lhs);
1190
- var tmp1_elvis_lhs = p.y1r_1;
1191
- path.v1s(i, toNumber(tmp1_elvis_lhs == null ? new Long(0, 0) : tmp1_elvis_lhs));
1192
- var tmp2_safe_receiver = p.c1s_1;
1193
- if (tmp2_safe_receiver == null)
1194
- null;
1195
- else {
1196
- // Inline function 'kotlin.let' call
1197
- path.w1s(i, tmp2_safe_receiver);
1198
- }
1199
- var tmp3_safe_receiver = p.z1r_1;
1200
- if (tmp3_safe_receiver == null)
1201
- null;
1202
- else {
1203
- // Inline function 'kotlin.let' call
1204
- path.x1s(i, tmp3_safe_receiver);
1205
- }
1206
- var tmp4_safe_receiver = p.a1s_1;
1207
- if (tmp4_safe_receiver == null)
1208
- null;
1209
- else {
1210
- // Inline function 'kotlin.let' call
1211
- path.y1s(i, tmp4_safe_receiver);
1212
- }
1213
- var tmp5_safe_receiver = p.b1s_1;
1214
- if (tmp5_safe_receiver == null)
1215
- null;
1216
- else {
1217
- // Inline function 'kotlin.let' call
1218
- path.z1s(i, tmp5_safe_receiver);
1219
- }
1220
- }
1221
- path.j1t();
1222
- return path;
1223
- }
1224
- function writeDocument($this, w, document) {
1225
- w.z18('', 'http://www.topografix.com/GPX/1/1');
1226
- w.z18('xsi', 'http://www.w3.org/2001/XMLSchema-instance');
1227
- w.z18('gpxtpx', 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1');
1228
- w.b19('http://www.topografix.com/GPX/1/1', 'gpx', '');
1229
- w.d19(null, 'version', null, '1.1');
1230
- w.d19(null, 'creator', null, '@glandais/vcyclist');
1231
- w.a19('', 'http://www.topografix.com/GPX/1/1');
1232
- w.a19('xsi', 'http://www.w3.org/2001/XMLSchema-instance');
1233
- w.a19('gpxtpx', 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1');
1234
- w.d19('http://www.w3.org/2001/XMLSchema-instance', 'schemaLocation', 'xsi', 'http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd');
1235
- writeMetadata($this, w, document.q1r_1);
1236
- var _iterator__ex2g4s = document.r1r_1.h();
1237
- while (_iterator__ex2g4s.i()) {
1238
- var track = _iterator__ex2g4s.j();
1239
- writeTrack($this, w, track);
1240
- }
1241
- w.g19('http://www.topografix.com/GPX/1/1', 'gpx', '');
1242
- }
1243
- function writeMetadata($this, w, name) {
1244
- w.b19('http://www.topografix.com/GPX/1/1', 'metadata', '');
1245
- writeSimpleText($this, w, 'name', name);
1246
- w.g19('http://www.topografix.com/GPX/1/1', 'metadata', '');
1247
- }
1248
- function writeTrack($this, w, track) {
1249
- w.b19('http://www.topografix.com/GPX/1/1', 'trk', '');
1250
- var tmp0_safe_receiver = track.s1r_1;
1251
- if (tmp0_safe_receiver == null)
1252
- null;
1253
- else {
1254
- // Inline function 'kotlin.let' call
1255
- writeSimpleText(GpxWriter_instance, w, 'name', tmp0_safe_receiver);
1256
- }
1257
- var tmp1_safe_receiver = track.t1r_1;
1258
- if (tmp1_safe_receiver == null)
1259
- null;
1260
- else {
1261
- // Inline function 'kotlin.let' call
1262
- writeSimpleText(GpxWriter_instance, w, 'type', tmp1_safe_receiver);
1263
- }
1264
- w.b19('http://www.topografix.com/GPX/1/1', 'trkseg', '');
1265
- var _iterator__ex2g4s = track.u1r_1.h();
1266
- while (_iterator__ex2g4s.i()) {
1267
- var p = _iterator__ex2g4s.j();
1268
- writeTrackPoint($this, w, p);
1269
- }
1270
- w.g19('http://www.topografix.com/GPX/1/1', 'trkseg', '');
1271
- w.g19('http://www.topografix.com/GPX/1/1', 'trk', '');
1272
- }
1273
- function writeTrackPoint($this, w, p) {
1274
- w.b19('http://www.topografix.com/GPX/1/1', 'trkpt', '');
1275
- w.d19(null, 'lat', null, p.v1r_1.toString());
1276
- w.d19(null, 'lon', null, p.w1r_1.toString());
1277
- var tmp0_safe_receiver = p.y1r_1;
1278
- if (tmp0_safe_receiver == null)
1279
- null;
1280
- else {
1281
- // Inline function 'kotlin.let' call
1282
- writeSimpleText(GpxWriter_instance, w, 'time', Companion_getInstance().tc(tmp0_safe_receiver).toString());
1283
- }
1284
- var tmp1_safe_receiver = p.x1r_1;
1285
- if (tmp1_safe_receiver == null)
1286
- null;
1287
- else {
1288
- // Inline function 'kotlin.let' call
1289
- writeSimpleText(GpxWriter_instance, w, 'ele', tmp1_safe_receiver.toString());
1290
- }
1291
- var hasGarminExt = !(p.z1r_1 == null) || !(p.a1s_1 == null) || !(p.b1s_1 == null);
1292
- var hasPower = !(p.c1s_1 == null);
1293
- if (hasGarminExt || hasPower) {
1294
- w.b19('http://www.topografix.com/GPX/1/1', 'extensions', '');
1295
- if (hasPower) {
1296
- writeSimpleText($this, w, 'power', p.c1s_1.toString());
1297
- }
1298
- if (hasGarminExt) {
1299
- w.b19('http://www.garmin.com/xmlschemas/TrackPointExtension/v1', 'TrackPointExtension', 'gpxtpx');
1300
- var tmp2_safe_receiver = p.z1r_1;
1301
- if (tmp2_safe_receiver == null)
1302
- null;
1303
- else {
1304
- // Inline function 'kotlin.let' call
1305
- writeNamespaced(GpxWriter_instance, w, 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1', 'hr', 'gpxtpx', tmp2_safe_receiver.toString());
1306
- }
1307
- var tmp3_safe_receiver = p.a1s_1;
1308
- if (tmp3_safe_receiver == null)
1309
- null;
1310
- else {
1311
- // Inline function 'kotlin.let' call
1312
- writeNamespaced(GpxWriter_instance, w, 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1', 'cad', 'gpxtpx', tmp3_safe_receiver.toString());
1313
- }
1314
- var tmp4_safe_receiver = p.b1s_1;
1315
- if (tmp4_safe_receiver == null)
1316
- null;
1317
- else {
1318
- // Inline function 'kotlin.let' call
1319
- writeNamespaced(GpxWriter_instance, w, 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1', 'atemp', 'gpxtpx', tmp4_safe_receiver.toString());
1320
- }
1321
- w.g19('http://www.garmin.com/xmlschemas/TrackPointExtension/v1', 'TrackPointExtension', 'gpxtpx');
1322
- }
1323
- w.g19('http://www.topografix.com/GPX/1/1', 'extensions', '');
1324
- }
1325
- w.g19('http://www.topografix.com/GPX/1/1', 'trkpt', '');
1326
- }
1327
- function writeSimpleText($this, w, localName, text) {
1328
- w.b19('http://www.topografix.com/GPX/1/1', localName, '');
1329
- w.c19(text);
1330
- w.g19('http://www.topografix.com/GPX/1/1', localName, '');
1331
- }
1332
- function writeNamespaced($this, w, namespace, localName, prefix, text) {
1333
- w.b19(namespace, localName, prefix);
1334
- w.c19(text);
1335
- w.g19(namespace, localName, prefix);
1336
- }
1337
- function GpxWriter() {
1338
- this.k1t_1 = 'http://www.topografix.com/GPX/1/1';
1339
- this.l1t_1 = 'http://www.w3.org/2001/XMLSchema-instance';
1340
- this.m1t_1 = 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1';
1341
- this.n1t_1 = 'xsi';
1342
- this.o1t_1 = 'gpxtpx';
1343
- this.p1t_1 = 'http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd';
1344
- this.q1t_1 = '@glandais/vcyclist';
1345
- }
1346
- protoOf(GpxWriter).r1t = function (document) {
1347
- var out = StringBuilder_init_$Create$();
1348
- out.u5('<?xml version="1.0" encoding="UTF-8"?>\n');
1349
- var writer = newGenericWriter(get_xmlStreaming(), out, false, XmlDeclMode_None_getInstance());
1350
- try {
1351
- writeDocument(this, writer, document);
1352
- }finally {
1353
- writer.h17();
1354
- }
1355
- return out.toString();
1356
- };
1357
- var GpxWriter_instance;
1358
- function GpxWriter_getInstance() {
1359
- return GpxWriter_instance;
1360
- }
1361
- function copyAllSlots($this, source) {
1362
- var out = new Path(source.d1s_1);
1363
- var inductionVariable = 0;
1364
- var last = source.d1s_1;
1365
- if (inductionVariable < last)
1366
- do {
1367
- var i = inductionVariable;
1368
- inductionVariable = inductionVariable + 1 | 0;
1369
- var _iterator__ex2g4s = get_entries().h();
1370
- while (_iterator__ex2g4s.i()) {
1371
- var field = _iterator__ex2g4s.j();
1372
- out.t1t(i, field, source.s1t(i, field));
1373
- }
1374
- }
1375
- while (inductionVariable < last);
1376
- return out;
1377
- }
1378
- function $fixElevationCOROUTINE$(_this__u8e3s4, source, provider, resultContinuation) {
1379
- CoroutineImpl.call(this, resultContinuation);
1380
- this.c1u_1 = _this__u8e3s4;
1381
- this.d1u_1 = source;
1382
- this.e1u_1 = provider;
1383
- }
1384
- protoOf($fixElevationCOROUTINE$).o6 = function () {
1385
- var suspendResult = this.i6_1;
1386
- $sm: do
1387
- try {
1388
- var tmp = this.g6_1;
1389
- switch (tmp) {
1390
- case 0:
1391
- this.h6_1 = 2;
1392
- if (this.d1u_1.d1s_1 === 0)
1393
- return new Path(0);
1394
- var size = this.d1u_1.d1s_1;
1395
- var list = ArrayList_init_$Create$(size);
1396
- var inductionVariable = 0;
1397
- if (inductionVariable < size)
1398
- do {
1399
- var index = inductionVariable;
1400
- inductionVariable = inductionVariable + 1 | 0;
1401
- list.n(new LatLon(this.d1u_1.f1s(index) * MathConstants_getInstance().yv_1, this.d1u_1.g1s(index) * MathConstants_getInstance().yv_1));
1402
- }
1403
- while (inductionVariable < size);
1404
- var coords = list;
1405
- this.g6_1 = 1;
1406
- suspendResult = this.e1u_1.xz(coords, VOID, this);
1407
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
1408
- return suspendResult;
1409
- }
1410
-
1411
- continue $sm;
1412
- case 1:
1413
- var corrected = suspendResult;
1414
- var out = copyAllSlots(this.c1u_1, this.d1u_1);
1415
- var inductionVariable_0 = 0;
1416
- var last = out.d1s_1;
1417
- if (inductionVariable_0 < last)
1418
- do {
1419
- var i = inductionVariable_0;
1420
- inductionVariable_0 = inductionVariable_0 + 1 | 0;
1421
- out.u1s(i, corrected.l(i).cw());
1422
- }
1423
- while (inductionVariable_0 < last);
1424
- out.j1t();
1425
- return out;
1426
- case 2:
1427
- throw this.j6_1;
1428
- }
1429
- } catch ($p) {
1430
- var e = $p;
1431
- if (this.h6_1 === 2) {
1432
- throw e;
1433
- } else {
1434
- this.g6_1 = this.h6_1;
1435
- this.j6_1 = e;
1436
- }
1437
- }
1438
- while (true);
1439
- };
1440
- function ElevationStep() {
1441
- this.a1r_1 = 150.0;
1442
- }
1443
- protoOf(ElevationStep).b1r = function (source, provider, $completion) {
1444
- var tmp = new $fixElevationCOROUTINE$(this, source, provider, $completion);
1445
- tmp.i6_1 = Unit_instance;
1446
- tmp.j6_1 = null;
1447
- return tmp.o6();
1448
- };
1449
- protoOf(ElevationStep).f1u = function (source, windowM) {
1450
- if (source.d1s_1 === 0)
1451
- return new Path(0);
1452
- // Inline function 'kotlin.collections.List' call
1453
- // Inline function 'kotlin.collections.MutableList' call
1454
- var size = source.d1s_1;
1455
- var list = ArrayList_init_$Create$(size);
1456
- // Inline function 'kotlin.repeat' call
1457
- var inductionVariable = 0;
1458
- if (inductionVariable < size)
1459
- do {
1460
- var index = inductionVariable;
1461
- inductionVariable = inductionVariable + 1 | 0;
1462
- var tmp$ret$4 = source.g1u(index);
1463
- list.n(tmp$ret$4);
1464
- }
1465
- while (inductionVariable < size);
1466
- var coords = list;
1467
- var smoothed = ElevationSmoother_instance.rv(coords, windowM);
1468
- var out = copyAllSlots(this, source);
1469
- var inductionVariable_0 = 0;
1470
- var last = out.d1s_1;
1471
- if (inductionVariable_0 < last)
1472
- do {
1473
- var i = inductionVariable_0;
1474
- inductionVariable_0 = inductionVariable_0 + 1 | 0;
1475
- out.u1s(i, smoothed.l(i).cw());
1476
- }
1477
- while (inductionVariable_0 < last);
1478
- out.j1t();
1479
- return out;
1480
- };
1481
- protoOf(ElevationStep).c1r = function (source, windowM, $super) {
1482
- windowM = windowM === VOID ? 150.0 : windowM;
1483
- return $super === VOID ? this.f1u(source, windowM) : $super.f1u.call(this, source, windowM);
1484
- };
1485
- var ElevationStep_instance;
1486
- function ElevationStep_getInstance() {
1487
- return ElevationStep_instance;
1488
- }
1489
- function GeneratedPath(size) {
1490
- this.d1s_1 = size;
1491
- // Inline function 'kotlin.require' call
1492
- if (!(this.d1s_1 >= 0)) {
1493
- var message = 'Negative size: ' + this.d1s_1;
1494
- throw IllegalArgumentException_init_$Create$(toString(message));
1495
- }
1496
- this.e1s_1 = new Float64Array(imul(this.d1s_1, 36));
1497
- }
1498
- protoOf(GeneratedPath).s1t = function (i, field) {
1499
- return this.e1s_1[imul(i, 36) + field.n1_1 | 0];
1500
- };
1501
- protoOf(GeneratedPath).t1t = function (i, field, v) {
1502
- this.e1s_1[imul(i, 36) + field.n1_1 | 0] = v;
1503
- };
1504
- protoOf(GeneratedPath).f1s = function (i) {
1505
- return this.e1s_1[imul(i, 36) + 0 | 0];
1506
- };
1507
- protoOf(GeneratedPath).s1s = function (i, v) {
1508
- this.e1s_1[imul(i, 36) + 0 | 0] = v;
1509
- };
1510
- protoOf(GeneratedPath).g1s = function (i) {
1511
- return this.e1s_1[imul(i, 36) + 1 | 0];
1512
- };
1513
- protoOf(GeneratedPath).t1s = function (i, v) {
1514
- this.e1s_1[imul(i, 36) + 1 | 0] = v;
1515
- };
1516
- protoOf(GeneratedPath).h1u = function (i) {
1517
- return this.e1s_1[imul(i, 36) + 2 | 0];
1518
- };
1519
- protoOf(GeneratedPath).i1u = function (i, v) {
1520
- this.e1s_1[imul(i, 36) + 2 | 0] = v;
1521
- };
1522
- protoOf(GeneratedPath).j1u = function (i, v) {
1523
- this.e1s_1[imul(i, 36) + 3 | 0] = v;
1524
- };
1525
- protoOf(GeneratedPath).i1s = function (i) {
1526
- return this.e1s_1[imul(i, 36) + 4 | 0];
1527
- };
1528
- protoOf(GeneratedPath).v1s = function (i, v) {
1529
- this.e1s_1[imul(i, 36) + 4 | 0] = v;
1530
- };
1531
- protoOf(GeneratedPath).k1u = function (i) {
1532
- return this.e1s_1[imul(i, 36) + 5 | 0];
1533
- };
1534
- protoOf(GeneratedPath).l1u = function (i, v) {
1535
- this.e1s_1[imul(i, 36) + 5 | 0] = v;
1536
- };
1537
- protoOf(GeneratedPath).m1u = function (i) {
1538
- return this.e1s_1[imul(i, 36) + 6 | 0];
1539
- };
1540
- protoOf(GeneratedPath).n1u = function (i, v) {
1541
- this.e1s_1[imul(i, 36) + 6 | 0] = v;
1542
- };
1543
- protoOf(GeneratedPath).o1u = function (i) {
1544
- return this.e1s_1[imul(i, 36) + 7 | 0];
1545
- };
1546
- protoOf(GeneratedPath).p1u = function (i, v) {
1547
- this.e1s_1[imul(i, 36) + 7 | 0] = v;
1548
- };
1549
- protoOf(GeneratedPath).h1s = function (i) {
1550
- return this.e1s_1[imul(i, 36) + 8 | 0];
1551
- };
1552
- protoOf(GeneratedPath).u1s = function (i, v) {
1553
- this.e1s_1[imul(i, 36) + 8 | 0] = v;
1554
- };
1555
- protoOf(GeneratedPath).q1u = function (i) {
1556
- return this.e1s_1[imul(i, 36) + 9 | 0];
1557
- };
1558
- protoOf(GeneratedPath).r1u = function (i, v) {
1559
- this.e1s_1[imul(i, 36) + 9 | 0] = v;
1560
- };
1561
- protoOf(GeneratedPath).s1u = function (i, v) {
1562
- this.e1s_1[imul(i, 36) + 10 | 0] = v;
1563
- };
1564
- protoOf(GeneratedPath).t1u = function (i, v) {
1565
- this.e1s_1[imul(i, 36) + 11 | 0] = v;
1566
- };
1567
- protoOf(GeneratedPath).u1u = function (i, v) {
1568
- this.e1s_1[imul(i, 36) + 12 | 0] = v;
1569
- };
1570
- protoOf(GeneratedPath).v1u = function (i, v) {
1571
- this.e1s_1[imul(i, 36) + 13 | 0] = v;
1572
- };
1573
- protoOf(GeneratedPath).w1u = function (i, v) {
1574
- this.e1s_1[imul(i, 36) + 14 | 0] = v;
1575
- };
1576
- protoOf(GeneratedPath).x1u = function (i, v) {
1577
- this.e1s_1[imul(i, 36) + 15 | 0] = v;
1578
- };
1579
- protoOf(GeneratedPath).y1u = function (i, v) {
1580
- this.e1s_1[imul(i, 36) + 16 | 0] = v;
1581
- };
1582
- protoOf(GeneratedPath).z1u = function (i, v) {
1583
- this.e1s_1[imul(i, 36) + 17 | 0] = v;
1584
- };
1585
- protoOf(GeneratedPath).m1s = function (i) {
1586
- return this.e1s_1[imul(i, 36) + 18 | 0];
1587
- };
1588
- protoOf(GeneratedPath).w1s = function (i, v) {
1589
- this.e1s_1[imul(i, 36) + 18 | 0] = v;
1590
- };
1591
- protoOf(GeneratedPath).a1v = function (i, v) {
1592
- this.e1s_1[imul(i, 36) + 19 | 0] = v;
1593
- };
1594
- protoOf(GeneratedPath).b1v = function (i, v) {
1595
- this.e1s_1[imul(i, 36) + 20 | 0] = v;
1596
- };
1597
- protoOf(GeneratedPath).c1v = function (i, v) {
1598
- this.e1s_1[imul(i, 36) + 21 | 0] = v;
1599
- };
1600
- protoOf(GeneratedPath).d1v = function (i, v) {
1601
- this.e1s_1[imul(i, 36) + 22 | 0] = v;
1602
- };
1603
- protoOf(GeneratedPath).e1v = function (i, v) {
1604
- this.e1s_1[imul(i, 36) + 23 | 0] = v;
1605
- };
1606
- protoOf(GeneratedPath).f1v = function (i, v) {
1607
- this.e1s_1[imul(i, 36) + 24 | 0] = v;
1608
- };
1609
- protoOf(GeneratedPath).g1v = function (i, v) {
1610
- this.e1s_1[imul(i, 36) + 25 | 0] = v;
1611
- };
1612
- protoOf(GeneratedPath).h1v = function (i) {
1613
- return this.e1s_1[imul(i, 36) + 26 | 0];
1614
- };
1615
- protoOf(GeneratedPath).i1v = function (i, v) {
1616
- this.e1s_1[imul(i, 36) + 26 | 0] = v;
1617
- };
1618
- protoOf(GeneratedPath).j1v = function (i) {
1619
- return this.e1s_1[imul(i, 36) + 27 | 0];
1620
- };
1621
- protoOf(GeneratedPath).k1v = function (i, v) {
1622
- this.e1s_1[imul(i, 36) + 27 | 0] = v;
1623
- };
1624
- protoOf(GeneratedPath).l1v = function (i) {
1625
- return this.e1s_1[imul(i, 36) + 28 | 0];
1626
- };
1627
- protoOf(GeneratedPath).m1v = function (i, v) {
1628
- this.e1s_1[imul(i, 36) + 28 | 0] = v;
1629
- };
1630
- protoOf(GeneratedPath).n1v = function (i, v) {
1631
- this.e1s_1[imul(i, 36) + 29 | 0] = v;
1632
- };
1633
- protoOf(GeneratedPath).o1v = function (i, v) {
1634
- this.e1s_1[imul(i, 36) + 30 | 0] = v;
1635
- };
1636
- protoOf(GeneratedPath).l1s = function (i) {
1637
- return this.e1s_1[imul(i, 36) + 31 | 0];
1638
- };
1639
- protoOf(GeneratedPath).z1s = function (i, v) {
1640
- this.e1s_1[imul(i, 36) + 31 | 0] = v;
1641
- };
1642
- protoOf(GeneratedPath).p1v = function (i, v) {
1643
- this.e1s_1[imul(i, 36) + 32 | 0] = v;
1644
- };
1645
- protoOf(GeneratedPath).q1v = function (i, v) {
1646
- this.e1s_1[imul(i, 36) + 33 | 0] = v;
1647
- };
1648
- protoOf(GeneratedPath).j1s = function (i) {
1649
- return this.e1s_1[imul(i, 36) + 34 | 0];
1650
- };
1651
- protoOf(GeneratedPath).x1s = function (i, v) {
1652
- this.e1s_1[imul(i, 36) + 34 | 0] = v;
1653
- };
1654
- protoOf(GeneratedPath).k1s = function (i) {
1655
- return this.e1s_1[imul(i, 36) + 35 | 0];
1656
- };
1657
- protoOf(GeneratedPath).y1s = function (i, v) {
1658
- this.e1s_1[imul(i, 36) + 35 | 0] = v;
1659
- };
1660
676
  function Companion_3() {
1661
677
  Companion_instance_3 = this;
1662
- this.r1v_1 = new BoundsRad(0.0, 0.0, 0.0, 0.0);
678
+ this.d22_1 = new ClimbOptions();
1663
679
  }
1664
680
  var Companion_instance_3;
1665
- function Companion_getInstance_4() {
681
+ function Companion_getInstance_6() {
1666
682
  if (Companion_instance_3 == null)
1667
683
  new Companion_3();
1668
684
  return Companion_instance_3;
1669
685
  }
1670
- function BoundsRad(minLat, maxLat, minLon, maxLon) {
1671
- Companion_getInstance_4();
1672
- this.s1v_1 = minLat;
1673
- this.t1v_1 = maxLat;
1674
- this.u1v_1 = minLon;
1675
- this.v1v_1 = maxLon;
1676
- }
1677
- protoOf(BoundsRad).toString = function () {
1678
- return 'BoundsRad(minLat=' + this.s1v_1 + ', maxLat=' + this.t1v_1 + ', minLon=' + this.u1v_1 + ', maxLon=' + this.v1v_1 + ')';
1679
- };
1680
- protoOf(BoundsRad).hashCode = function () {
1681
- var result = getNumberHashCode(this.s1v_1);
1682
- result = imul(result, 31) + getNumberHashCode(this.t1v_1) | 0;
1683
- result = imul(result, 31) + getNumberHashCode(this.u1v_1) | 0;
1684
- result = imul(result, 31) + getNumberHashCode(this.v1v_1) | 0;
686
+ function ClimbOptions(minMinClimbElevationM, maxMinClimbElevationM, minClimbElevationRatio, minGradePercent, maxDiffRealGradeRatio, booster, maxAnalysisPoints) {
687
+ Companion_getInstance_6();
688
+ minMinClimbElevationM = minMinClimbElevationM === VOID ? 10.0 : minMinClimbElevationM;
689
+ maxMinClimbElevationM = maxMinClimbElevationM === VOID ? 35.0 : maxMinClimbElevationM;
690
+ minClimbElevationRatio = minClimbElevationRatio === VOID ? 100.0 : minClimbElevationRatio;
691
+ minGradePercent = minGradePercent === VOID ? 3.0 : minGradePercent;
692
+ maxDiffRealGradeRatio = maxDiffRealGradeRatio === VOID ? 1.3 : maxDiffRealGradeRatio;
693
+ booster = booster === VOID ? 1.3 : booster;
694
+ maxAnalysisPoints = maxAnalysisPoints === VOID ? 3000 : maxAnalysisPoints;
695
+ this.e22_1 = minMinClimbElevationM;
696
+ this.f22_1 = maxMinClimbElevationM;
697
+ this.g22_1 = minClimbElevationRatio;
698
+ this.h22_1 = minGradePercent;
699
+ this.i22_1 = maxDiffRealGradeRatio;
700
+ this.j22_1 = booster;
701
+ this.k22_1 = maxAnalysisPoints;
702
+ // Inline function 'kotlin.require' call
703
+ if (!(this.k22_1 >= 2)) {
704
+ var message = 'maxAnalysisPoints must be at least 2';
705
+ throw IllegalArgumentException_init_$Create$(toString(message));
706
+ }
707
+ }
708
+ protoOf(ClimbOptions).toString = function () {
709
+ return 'ClimbOptions(minMinClimbElevationM=' + this.e22_1 + ', maxMinClimbElevationM=' + this.f22_1 + ', minClimbElevationRatio=' + this.g22_1 + ', minGradePercent=' + this.h22_1 + ', maxDiffRealGradeRatio=' + this.i22_1 + ', booster=' + this.j22_1 + ', maxAnalysisPoints=' + this.k22_1 + ')';
710
+ };
711
+ protoOf(ClimbOptions).hashCode = function () {
712
+ var result = getNumberHashCode(this.e22_1);
713
+ result = imul(result, 31) + getNumberHashCode(this.f22_1) | 0;
714
+ result = imul(result, 31) + getNumberHashCode(this.g22_1) | 0;
715
+ result = imul(result, 31) + getNumberHashCode(this.h22_1) | 0;
716
+ result = imul(result, 31) + getNumberHashCode(this.i22_1) | 0;
717
+ result = imul(result, 31) + getNumberHashCode(this.j22_1) | 0;
718
+ result = imul(result, 31) + this.k22_1 | 0;
1685
719
  return result;
1686
720
  };
1687
- protoOf(BoundsRad).equals = function (other) {
721
+ protoOf(ClimbOptions).equals = function (other) {
1688
722
  if (this === other)
1689
723
  return true;
1690
- if (!(other instanceof BoundsRad))
724
+ if (!(other instanceof ClimbOptions))
725
+ return false;
726
+ if (!equals(this.e22_1, other.e22_1))
1691
727
  return false;
1692
- if (!equals(this.s1v_1, other.s1v_1))
728
+ if (!equals(this.f22_1, other.f22_1))
1693
729
  return false;
1694
- if (!equals(this.t1v_1, other.t1v_1))
730
+ if (!equals(this.g22_1, other.g22_1))
1695
731
  return false;
1696
- if (!equals(this.u1v_1, other.u1v_1))
732
+ if (!equals(this.h22_1, other.h22_1))
1697
733
  return false;
1698
- if (!equals(this.v1v_1, other.v1v_1))
734
+ if (!equals(this.i22_1, other.i22_1))
735
+ return false;
736
+ if (!equals(this.j22_1, other.j22_1))
737
+ return false;
738
+ if (!(this.k22_1 === other.k22_1))
1699
739
  return false;
1700
740
  return true;
1701
741
  };
1702
- function copyStatsFrom($this, other) {
1703
- $this.c1t_1 = other.c1t_1;
1704
- $this.d1t_1 = other.d1t_1;
1705
- $this.e1t_1 = other.e1t_1;
1706
- $this.f1t_1 = other.f1t_1;
1707
- $this.g1t_1 = other.g1t_1;
1708
- $this.h1t_1 = other.h1t_1;
1709
- $this.i1t_1 = other.i1t_1;
1710
- }
1711
- function resetStats($this) {
1712
- $this.c1t_1 = 0.0;
1713
- $this.d1t_1 = 0.0;
1714
- $this.e1t_1 = 0.0;
1715
- $this.f1t_1 = 0.0;
1716
- $this.g1t_1 = 0.0;
1717
- $this.h1t_1 = 0.0;
1718
- $this.i1t_1 = Companion_getInstance_4().r1v_1;
1719
- }
1720
- function computeBearing($this, from, to) {
1721
- var lat1 = $this.f1s(from);
1722
- var lon1 = $this.g1s(from);
1723
- var lat2 = $this.f1s(to);
1724
- var lon2 = $this.g1s(to);
1725
- // Inline function 'kotlin.math.cos' call
1726
- var x1 = lon1 * Math.cos(lat1);
1727
- var y1 = lat1;
1728
- // Inline function 'kotlin.math.cos' call
1729
- var x2 = lon2 * Math.cos(lat2);
1730
- var y2 = lat2;
1731
- var dy = y2 - y1;
1732
- var dx = x2 - x1;
1733
- // Inline function 'kotlin.math.atan2' call
1734
- var y = -dy;
1735
- return Math.atan2(y, dx);
1736
- }
1737
742
  function Companion_4() {
1738
743
  }
744
+ protoOf(Companion_4).l22 = function (path, maxPoints) {
745
+ var tmp;
746
+ if (path.f1r_1 <= maxPoints) {
747
+ var tmp_0 = 0;
748
+ var tmp_1 = path.f1r_1;
749
+ var tmp_2 = new Int32Array(tmp_1);
750
+ while (tmp_0 < tmp_1) {
751
+ var tmp_3 = tmp_0;
752
+ tmp_2[tmp_3] = tmp_3;
753
+ tmp_0 = tmp_0 + 1 | 0;
754
+ }
755
+ tmp = tmp_2;
756
+ } else {
757
+ var stride = ((path.f1r_1 + maxPoints | 0) - 1 | 0) / maxPoints | 0;
758
+ var kept = ArrayList_init_$Create$_0(maxPoints + 1 | 0);
759
+ var i = 0;
760
+ while (i < path.f1r_1) {
761
+ kept.h(i);
762
+ i = i + stride | 0;
763
+ }
764
+ if (!(last(kept) === (path.f1r_1 - 1 | 0))) {
765
+ kept.h(path.f1r_1 - 1 | 0);
766
+ }
767
+ tmp = toIntArray(kept);
768
+ }
769
+ var indices = tmp;
770
+ var tmp_4 = 0;
771
+ var tmp_5 = indices.length;
772
+ var tmp_6 = new Float64Array(tmp_5);
773
+ while (tmp_4 < tmp_5) {
774
+ var tmp_7 = tmp_4;
775
+ tmp_6[tmp_7] = path.w1u(indices[tmp_7]);
776
+ tmp_4 = tmp_4 + 1 | 0;
777
+ }
778
+ var tmp_8 = 0;
779
+ var tmp_9 = indices.length;
780
+ var tmp_10 = new Float64Array(tmp_9);
781
+ while (tmp_8 < tmp_9) {
782
+ var tmp_11 = tmp_8;
783
+ tmp_10[tmp_11] = path.j1r(indices[tmp_11]);
784
+ tmp_8 = tmp_8 + 1 | 0;
785
+ }
786
+ return new Profile(tmp_6, tmp_10, indices);
787
+ };
1739
788
  var Companion_instance_4;
1740
- function Companion_getInstance_5() {
789
+ function Companion_getInstance_7() {
1741
790
  return Companion_instance_4;
1742
791
  }
1743
- function Path(size) {
1744
- GeneratedPath.call(this, size);
1745
- this.c1t_1 = 0.0;
1746
- this.d1t_1 = 0.0;
1747
- this.e1t_1 = 0.0;
1748
- this.f1t_1 = 0.0;
1749
- this.g1t_1 = 0.0;
1750
- this.h1t_1 = 0.0;
1751
- this.i1t_1 = Companion_getInstance_4().r1v_1;
1752
- }
1753
- protoOf(Path).w1v = function () {
1754
- return until(0, this.d1s_1);
1755
- };
1756
- protoOf(Path).x1v = function (i) {
1757
- return this.f1s(i) * MathConstants_getInstance().yv_1;
1758
- };
1759
- protoOf(Path).y1v = function (i) {
1760
- return this.g1s(i) * MathConstants_getInstance().yv_1;
1761
- };
1762
- protoOf(Path).g1u = function (i) {
1763
- return new LatLonElevation(this.x1v(i), this.y1v(i), this.h1s(i));
1764
- };
1765
- protoOf(Path).z1v = function () {
1766
- var out = new Path(this.d1s_1);
1767
- var tmp0 = this.e1s_1;
1768
- var tmp2 = out.e1s_1;
1769
- // Inline function 'kotlin.collections.copyInto' call
1770
- var endIndex = this.e1s_1.length;
1771
- // Inline function 'kotlin.js.unsafeCast' call
1772
- // Inline function 'kotlin.js.asDynamic' call
1773
- var tmp = tmp0;
1774
- // Inline function 'kotlin.js.unsafeCast' call
1775
- // Inline function 'kotlin.js.asDynamic' call
1776
- arrayCopy(tmp, tmp2, 0, 0, endIndex);
1777
- copyStatsFrom(out, this);
1778
- return out;
1779
- };
1780
- protoOf(Path).j1t = function () {
1781
- resetStats(this);
1782
- if (this.d1s_1 === 0)
1783
- return Unit_instance;
1784
- var timeStart = this.i1s(0);
1785
- var cumDist = 0.0;
1786
- var minLat = Infinity;
1787
- var maxLat = -Infinity;
1788
- var minLon = Infinity;
1789
- var maxLon = -Infinity;
1790
- var minEle = Infinity;
1791
- var maxEle = -Infinity;
1792
- var gain = 0.0;
1793
- var loss = 0.0;
1794
- var inductionVariable = 0;
1795
- var last = this.d1s_1;
792
+ function Profile(distance, elevation, sourceIndex) {
793
+ this.m22_1 = distance;
794
+ this.n22_1 = elevation;
795
+ this.o22_1 = sourceIndex;
796
+ }
797
+ protoOf(Profile).l = function () {
798
+ return this.m22_1.length;
799
+ };
800
+ function bestCandidateFrom($this, profile, i, minClimbElevation, options) {
801
+ var startDist = profile.m22_1[i];
802
+ var startEle = profile.n22_1[i];
803
+ var positiveElevation = 0.0;
804
+ var negativeElevation = 0.0;
805
+ var distClimbing = 0.0;
806
+ var bestScore = 0.0;
807
+ var best = null;
808
+ var inductionVariable = i + 1 | 0;
809
+ var last = profile.l();
1796
810
  if (inductionVariable < last)
1797
- do {
1798
- var i = inductionVariable;
811
+ $l$loop: do {
812
+ var j = inductionVariable;
1799
813
  inductionVariable = inductionVariable + 1 | 0;
1800
- var lat = this.f1s(i);
1801
- var lon = this.g1s(i);
1802
- var ele = this.h1s(i);
1803
- // Inline function 'kotlin.math.min' call
1804
- var a = minLat;
1805
- minLat = Math.min(a, lat);
1806
- // Inline function 'kotlin.math.max' call
1807
- var a_0 = maxLat;
1808
- maxLat = Math.max(a_0, lat);
1809
- // Inline function 'kotlin.math.min' call
1810
- var a_1 = minLon;
1811
- minLon = Math.min(a_1, lon);
1812
- // Inline function 'kotlin.math.max' call
1813
- var a_2 = maxLon;
1814
- maxLon = Math.max(a_2, lon);
1815
- // Inline function 'kotlin.math.min' call
1816
- var a_3 = minEle;
1817
- minEle = Math.min(a_3, ele);
1818
- // Inline function 'kotlin.math.max' call
1819
- var a_4 = maxEle;
1820
- maxEle = Math.max(a_4, ele);
1821
- if (i > 0) {
1822
- var prevCoord = new LatLon(this.x1v(i - 1 | 0), this.y1v(i - 1 | 0));
1823
- var curCoord = new LatLon(this.x1v(i), this.y1v(i));
1824
- cumDist = cumDist + Distance_instance.vv(prevCoord, curCoord);
1825
- var dEle = ele - this.h1s(i - 1 | 0);
1826
- if (dEle > 0)
1827
- gain = gain + dEle;
1828
- else
1829
- loss = loss + dEle;
814
+ var endDist = profile.m22_1[j];
815
+ var endEle = profile.n22_1[j];
816
+ var dEle = endEle - profile.n22_1[j - 1 | 0];
817
+ if (dEle > 0) {
818
+ positiveElevation = positiveElevation + dEle;
819
+ distClimbing = distClimbing + (endDist - profile.m22_1[j - 1 | 0]);
820
+ } else {
821
+ negativeElevation = negativeElevation + dEle;
822
+ }
823
+ var length = endDist - startDist;
824
+ if (length <= 10.0)
825
+ continue $l$loop;
826
+ var netElevation = endEle - startEle;
827
+ var gradePercent = 100.0 * netElevation / length;
828
+ var climbingGradePercent = distClimbing > 0 ? 100.0 * positiveElevation / distClimbing : 0.0;
829
+ // Inline function 'kotlin.math.pow' call
830
+ var x = options.j22_1;
831
+ var score = length * Math.pow(gradePercent, x);
832
+ var qualifies = gradePercent >= options.h22_1 && netElevation >= minClimbElevation && score >= bestScore && climbingGradePercent / gradePercent <= options.i22_1;
833
+ if (qualifies) {
834
+ bestScore = score;
835
+ best = new Candidate(i, j, score, positiveElevation, negativeElevation);
1830
836
  }
1831
- this.i1u(i, cumDist);
1832
837
  }
1833
838
  while (inductionVariable < last);
1834
- this.c1t_1 = cumDist;
1835
- this.d1t_1 = minEle === Infinity ? 0.0 : minEle;
1836
- this.e1t_1 = maxEle === -Infinity ? 0.0 : maxEle;
1837
- this.f1t_1 = gain;
1838
- this.g1t_1 = loss;
1839
- this.i1t_1 = new BoundsRad(minLat, maxLat, minLon, maxLon);
1840
- this.h1t_1 = this.d1s_1 >= 2 ? this.i1s(this.d1s_1 - 1 | 0) - timeStart : 0.0;
1841
- var inductionVariable_0 = 0;
1842
- var last_0 = this.d1s_1;
1843
- if (inductionVariable_0 < last_0)
1844
- $l$loop: do {
1845
- var i_0 = inductionVariable_0;
1846
- inductionVariable_0 = inductionVariable_0 + 1 | 0;
1847
- this.l1u(i_0, (this.i1s(i_0) - timeStart) / 1000.0);
1848
- if (this.d1s_1 <= 1)
1849
- continue $l$loop;
1850
- // Inline function 'kotlin.math.max' call
1851
- var b = i_0 - 1 | 0;
1852
- var im1 = Math.max(0, b);
1853
- var tmp0 = this.d1s_1 - 1 | 0;
1854
- // Inline function 'kotlin.math.min' call
1855
- var b_0 = i_0 + 1 | 0;
1856
- var ip1 = Math.min(tmp0, b_0);
1857
- this.p1u(i_0, computeBearing(this, im1, ip1));
1858
- var dDist = (this.h1u(ip1) - this.h1u(im1)) / 2.0;
1859
- var dEle_0 = (this.h1s(ip1) - this.h1s(im1)) / 2.0;
1860
- var grade = dDist === 0.0 ? 0.0 : dEle_0 / dDist;
1861
- this.r1u(i_0, grade);
1862
- var dTime = (this.i1s(ip1) - this.i1s(im1)) / 2000.0;
1863
- this.j1u(i_0, dDist);
1864
- this.n1u(i_0, dTime);
1865
- this.k1v(i_0, dTime === 0.0 ? 0.0 : dDist / dTime);
839
+ return best;
840
+ }
841
+ function dedupeByScore($this, candidates) {
842
+ // Inline function 'kotlin.collections.sortedByDescending' call
843
+ // Inline function 'kotlin.comparisons.compareByDescending' call
844
+ var tmp = ClimbDetector$dedupeByScore$lambda;
845
+ var tmp$ret$1 = new sam$kotlin_Comparator$0_0(tmp);
846
+ var tmp$ret$0 = sortedWith(candidates, tmp$ret$1);
847
+ var remaining = toMutableList(tmp$ret$0);
848
+ // Inline function 'kotlin.collections.mutableListOf' call
849
+ var kept = ArrayList_init_$Create$();
850
+ $l$loop: while (true) {
851
+ // Inline function 'kotlin.collections.isNotEmpty' call
852
+ if (!!remaining.n()) {
853
+ break $l$loop;
1866
854
  }
1867
- while (inductionVariable_0 < last_0);
1868
- };
1869
- function PathSimplifier() {
855
+ var best = first(remaining);
856
+ kept.h(best);
857
+ removeAll(remaining, ClimbDetector$dedupeByScore$lambda_0(best));
858
+ }
859
+ return kept;
1870
860
  }
1871
- protoOf(PathSimplifier).m1r = function (path, toleranceM, zExaggeration) {
1872
- if (path.d1s_1 <= 2)
1873
- return path.z1v();
1874
- var coords = ArrayList_init_$Create$(path.d1s_1);
1875
- var inductionVariable = 0;
1876
- var last = path.d1s_1;
1877
- if (inductionVariable < last)
861
+ function toClimb($this, $receiver, path, profile) {
862
+ return new Climb(profile.o22_1[$receiver.p22_1], profile.o22_1[$receiver.q22_1], profile.m22_1[$receiver.p22_1], profile.m22_1[$receiver.q22_1], profile.n22_1[$receiver.p22_1], profile.n22_1[$receiver.q22_1], $receiver.s22_1, $receiver.t22_1, splitIntoParts($this, profile, $receiver.p22_1, $receiver.q22_1));
863
+ }
864
+ function splitIntoParts($this, profile, startIndex, endIndex) {
865
+ // Inline function 'kotlin.collections.map' call
866
+ var this_0 = numberRangeToNumber(startIndex, endIndex);
867
+ // Inline function 'kotlin.collections.mapTo' call
868
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
869
+ var inductionVariable = this_0.lc_1;
870
+ var last = this_0.mc_1;
871
+ if (inductionVariable <= last)
1878
872
  do {
1879
- var i = inductionVariable;
873
+ var item = inductionVariable;
1880
874
  inductionVariable = inductionVariable + 1 | 0;
1881
- // Inline function 'kotlin.collections.plusAssign' call
1882
- var element = new LatLonElevation(path.f1s(i) * MathConstants_getInstance().yv_1, path.g1s(i) * MathConstants_getInstance().yv_1, path.h1s(i));
1883
- coords.n(element);
1884
- }
1885
- while (inductionVariable < last);
1886
- var simplified = DouglasPeucker_instance.sv(coords, toleranceM, zExaggeration);
1887
- var retainedIndices = ArrayList_init_$Create$(simplified.k());
1888
- var cursor = 0;
1889
- var _iterator__ex2g4s = simplified.h();
1890
- while (_iterator__ex2g4s.i()) {
1891
- var kept = _iterator__ex2g4s.j();
1892
- while (cursor < coords.k() && !(coords.l(cursor) === kept)) {
1893
- cursor = cursor + 1 | 0;
875
+ var i = item;
876
+ var tmp$ret$2 = new Vector3D(profile.m22_1[i], profile.n22_1[i], 0.0);
877
+ destination.h(tmp$ret$2);
1894
878
  }
1895
- if (cursor === coords.k()) {
1896
- // Inline function 'kotlin.error' call
1897
- var message = 'PathSimplifier: retained point not found in source';
1898
- throw IllegalStateException_init_$Create$(toString(message));
879
+ while (!(item === last));
880
+ var points = destination;
881
+ if (points.l() < 2)
882
+ return emptyList();
883
+ var elevationGain = profile.n22_1[endIndex] - profile.n22_1[startIndex];
884
+ var tolerance = coerceIn(elevationGain / 50.0, 10.0, 50.0);
885
+ var keptIndices = DouglasPeucker_instance.gx(points, tolerance);
886
+ var tmp$ret$3;
887
+ $l$block: {
888
+ // Inline function 'kotlin.collections.zipWithNext' call
889
+ var iterator = keptIndices.i();
890
+ if (!iterator.j()) {
891
+ tmp$ret$3 = emptyList();
892
+ break $l$block;
1899
893
  }
1900
- // Inline function 'kotlin.collections.plusAssign' call
1901
- var element_0 = cursor;
1902
- retainedIndices.n(element_0);
1903
- cursor = cursor + 1 | 0;
1904
- }
1905
- var out = new Path(retainedIndices.k());
1906
- var iterator = retainedIndices.h();
1907
- var index = 0;
1908
- while (iterator.i()) {
1909
- var dstIdx = index;
1910
- index = index + 1 | 0;
1911
- var srcIdx = iterator.j();
1912
- var _iterator__ex2g4s_0 = get_entries().h();
1913
- while (_iterator__ex2g4s_0.i()) {
1914
- var field = _iterator__ex2g4s_0.j();
1915
- out.t1t(dstIdx, field, path.s1t(srcIdx, field));
894
+ // Inline function 'kotlin.collections.mutableListOf' call
895
+ var result = ArrayList_init_$Create$();
896
+ var current = iterator.k();
897
+ while (iterator.j()) {
898
+ var next = iterator.k();
899
+ var a = current;
900
+ var tmp0_startDistanceM = points.m(a).bx_1;
901
+ var tmp1_startElevationM = points.m(a).cx_1;
902
+ var tmp2_endDistanceM = points.m(next).bx_1;
903
+ var tmp3_endElevationM = points.m(next).cx_1;
904
+ var tmp$ret$5 = new ClimbPart(tmp0_startDistanceM, tmp2_endDistanceM, tmp1_startElevationM, tmp3_endElevationM);
905
+ result.h(tmp$ret$5);
906
+ current = next;
1916
907
  }
908
+ tmp$ret$3 = result;
1917
909
  }
1918
- out.j1t();
1919
- return out;
1920
- };
1921
- var PathSimplifier_instance;
1922
- function PathSimplifier_getInstance() {
1923
- return PathSimplifier_instance;
1924
- }
1925
- var PointField_LATITUDE_instance;
1926
- var PointField_LONGITUDE_instance;
1927
- var PointField_DISTANCE_instance;
1928
- var PointField_DX_instance;
1929
- var PointField_TIME_instance;
1930
- var PointField_ELAPSED_instance;
1931
- var PointField_DT_instance;
1932
- var PointField_BEARING_instance;
1933
- var PointField_ELEVATION_instance;
1934
- var PointField_GRADE_instance;
1935
- var PointField_RADIUS_instance;
1936
- var PointField_AERO_COEF_instance;
1937
- var PointField_WIND_BEARING_instance;
1938
- var PointField_WIND_ALPHA_instance;
1939
- var PointField_P_AERO_instance;
1940
- var PointField_P_GRAVITY_instance;
1941
- var PointField_P_ROLLING_RESISTANCE_instance;
1942
- var PointField_P_WHEEL_BEARINGS_instance;
1943
- var PointField_P_INPUT_POWER_instance;
1944
- var PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_instance;
1945
- var PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_instance;
1946
- var PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_instance;
1947
- var PointField_P_CYCLIST_PROVIDED_MUSCULAR_instance;
1948
- var PointField_P_CYCLIST_PROVIDED_WHEEL_instance;
1949
- var PointField_P_COMPUTED_TOTAL_POWER_instance;
1950
- var PointField_P_COMPUTED_WHEEL_POWER_instance;
1951
- var PointField_POWER_instance;
1952
- var PointField_SPEED_instance;
1953
- var PointField_SPEED_MAX_instance;
1954
- var PointField_SPEED_MAX_INCLINE_instance;
1955
- var PointField_VIRT_SPEED_CURRENT_instance;
1956
- var PointField_TEMPERATURE_instance;
1957
- var PointField_WIND_SPEED_instance;
1958
- var PointField_WIND_DIRECTION_instance;
1959
- var PointField_HEART_RATE_instance;
1960
- var PointField_CADENCE_instance;
1961
- function Companion_5() {
1962
- Companion_instance_5 = this;
1963
- this.a1w_1 = 36;
1964
- var tmp = this;
1965
- // Inline function 'kotlin.collections.associateBy' call
1966
- var this_0 = get_entries();
1967
- var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
1968
- // Inline function 'kotlin.collections.associateByTo' call
1969
- var destination = LinkedHashMap_init_$Create$(capacity);
1970
- var _iterator__ex2g4s = this_0.h();
1971
- while (_iterator__ex2g4s.i()) {
1972
- var element = _iterator__ex2g4s.j();
1973
- var tmp$ret$2 = element.e1w_1;
1974
- destination.a3(tmp$ret$2, element);
1975
- }
1976
- tmp.b1w_1 = destination;
1977
- }
1978
- protoOf(Companion_5).k1w = function (prop) {
1979
- return this.b1w_1.j1(prop);
910
+ return tmp$ret$3;
911
+ }
912
+ function Candidate(startIndex, endIndex, score, positiveElevationM, negativeElevationM) {
913
+ this.p22_1 = startIndex;
914
+ this.q22_1 = endIndex;
915
+ this.r22_1 = score;
916
+ this.s22_1 = positiveElevationM;
917
+ this.t22_1 = negativeElevationM;
918
+ }
919
+ protoOf(Candidate).u22 = function (other) {
920
+ return other.p22_1 <= this.p22_1 && this.p22_1 <= other.q22_1 || (other.p22_1 <= this.q22_1 && this.q22_1 <= other.q22_1) || (this.p22_1 <= other.p22_1 && other.q22_1 <= this.q22_1);
921
+ };
922
+ protoOf(Candidate).toString = function () {
923
+ return 'Candidate(startIndex=' + this.p22_1 + ', endIndex=' + this.q22_1 + ', score=' + this.r22_1 + ', positiveElevationM=' + this.s22_1 + ', negativeElevationM=' + this.t22_1 + ')';
924
+ };
925
+ protoOf(Candidate).hashCode = function () {
926
+ var result = this.p22_1;
927
+ result = imul(result, 31) + this.q22_1 | 0;
928
+ result = imul(result, 31) + getNumberHashCode(this.r22_1) | 0;
929
+ result = imul(result, 31) + getNumberHashCode(this.s22_1) | 0;
930
+ result = imul(result, 31) + getNumberHashCode(this.t22_1) | 0;
931
+ return result;
1980
932
  };
1981
- var Companion_instance_5;
1982
- function Companion_getInstance_6() {
1983
- PointField_initEntries();
1984
- if (Companion_instance_5 == null)
1985
- new Companion_5();
1986
- return Companion_instance_5;
1987
- }
1988
- function values() {
1989
- return [PointField_LATITUDE_getInstance(), PointField_LONGITUDE_getInstance(), PointField_DISTANCE_getInstance(), PointField_DX_getInstance(), PointField_TIME_getInstance(), PointField_ELAPSED_getInstance(), PointField_DT_getInstance(), PointField_BEARING_getInstance(), PointField_ELEVATION_getInstance(), PointField_GRADE_getInstance(), PointField_RADIUS_getInstance(), PointField_AERO_COEF_getInstance(), PointField_WIND_BEARING_getInstance(), PointField_WIND_ALPHA_getInstance(), PointField_P_AERO_getInstance(), PointField_P_GRAVITY_getInstance(), PointField_P_ROLLING_RESISTANCE_getInstance(), PointField_P_WHEEL_BEARINGS_getInstance(), PointField_P_INPUT_POWER_getInstance(), PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_getInstance(), PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_getInstance(), PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_getInstance(), PointField_P_CYCLIST_PROVIDED_MUSCULAR_getInstance(), PointField_P_CYCLIST_PROVIDED_WHEEL_getInstance(), PointField_P_COMPUTED_TOTAL_POWER_getInstance(), PointField_P_COMPUTED_WHEEL_POWER_getInstance(), PointField_POWER_getInstance(), PointField_SPEED_getInstance(), PointField_SPEED_MAX_getInstance(), PointField_SPEED_MAX_INCLINE_getInstance(), PointField_VIRT_SPEED_CURRENT_getInstance(), PointField_TEMPERATURE_getInstance(), PointField_WIND_SPEED_getInstance(), PointField_WIND_DIRECTION_getInstance(), PointField_HEART_RATE_getInstance(), PointField_CADENCE_getInstance()];
1990
- }
1991
- function get_entries() {
1992
- if ($ENTRIES == null)
1993
- $ENTRIES = enumEntries(values());
1994
- return $ENTRIES;
1995
- }
1996
- var PointField_entriesInitialized;
1997
- function PointField_initEntries() {
1998
- if (PointField_entriesInitialized)
1999
- return Unit_instance;
2000
- PointField_entriesInitialized = true;
2001
- PointField_LATITUDE_instance = new PointField('LATITUDE', 0, 'latitude', 'radians', 'Latitude (radians)', PointFieldCategory_COORDINATES_getInstance(), true, true);
2002
- PointField_LONGITUDE_instance = new PointField('LONGITUDE', 1, 'longitude', 'radians', 'Longitude (radians)', PointFieldCategory_COORDINATES_getInstance(), true, true);
2003
- PointField_DISTANCE_instance = new PointField('DISTANCE', 2, 'distance', 'meters', 'Distance (meters)', PointFieldCategory_COORDINATES_getInstance());
2004
- PointField_DX_instance = new PointField('DX', 3, 'dx', 'meters', 'dx (meters)', PointFieldCategory_COORDINATES_getInstance());
2005
- PointField_TIME_instance = new PointField('TIME', 4, 'time', 'ms', 'Timestamp (ms since epoch)', PointFieldCategory_TEMPORAL_getInstance(), true);
2006
- PointField_ELAPSED_instance = new PointField('ELAPSED', 5, 'elapsed', 'ms', 'Elapsed duration (ms)', PointFieldCategory_TEMPORAL_getInstance());
2007
- PointField_DT_instance = new PointField('DT', 6, 'dt', 'ms', 'dt (ms)', PointFieldCategory_TEMPORAL_getInstance());
2008
- PointField_BEARING_instance = new PointField('BEARING', 7, 'bearing', 'radians', 'Direction bearing (radians)', PointFieldCategory_ANGLES_getInstance(), VOID, true);
2009
- PointField_ELEVATION_instance = new PointField('ELEVATION', 8, 'elevation', 'meters', 'Elevation (meters)', PointFieldCategory_ELEVATION_getInstance());
2010
- PointField_GRADE_instance = new PointField('GRADE', 9, 'grade', '%', 'Road grade/slope (%)', PointFieldCategory_GRADE_getInstance());
2011
- PointField_RADIUS_instance = new PointField('RADIUS', 10, 'radius', 'meters', 'Turn radius (meters)', PointFieldCategory_RADIUS_getInstance());
2012
- PointField_AERO_COEF_instance = new PointField('AERO_COEF', 11, 'aeroCoef', 'aero', 'Aerodynamic coefficient', PointFieldCategory_AERO_COEF_getInstance());
2013
- PointField_WIND_BEARING_instance = new PointField('WIND_BEARING', 12, 'windBearing', 'radians', 'Wind bearing (radians)', PointFieldCategory_CYCLIST_WIND_getInstance(), VOID, true);
2014
- PointField_WIND_ALPHA_instance = new PointField('WIND_ALPHA', 13, 'windAlpha', 'radians', 'Wind angle (radians)', PointFieldCategory_CYCLIST_WIND_getInstance(), VOID, true);
2015
- PointField_P_AERO_instance = new PointField('P_AERO', 14, 'pAero', 'watts', 'Aerodynamic power', PointFieldCategory_POWER_PHYSICS_getInstance());
2016
- PointField_P_GRAVITY_instance = new PointField('P_GRAVITY', 15, 'pGravity', 'watts', 'Gravitational power', PointFieldCategory_POWER_PHYSICS_getInstance());
2017
- PointField_P_ROLLING_RESISTANCE_instance = new PointField('P_ROLLING_RESISTANCE', 16, 'pRollingResistance', 'watts', 'Rolling resistance power', PointFieldCategory_POWER_PHYSICS_getInstance());
2018
- PointField_P_WHEEL_BEARINGS_instance = new PointField('P_WHEEL_BEARINGS', 17, 'pWheelBearings', 'watts', 'Wheel bearings power', PointFieldCategory_POWER_PHYSICS_getInstance());
2019
- PointField_P_INPUT_POWER_instance = new PointField('P_INPUT_POWER', 18, 'pInputPower', 'watts', 'GPX input power', PointFieldCategory_POWER_CYCLIST_getInstance());
2020
- PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_instance = new PointField('P_CYCLIST_PROVIDED_OPTIMAL_POWER', 19, 'pCyclistProvidedOptimalPower', 'watts', 'Optimal power', PointFieldCategory_POWER_CYCLIST_getInstance());
2021
- PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_instance = new PointField('P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS', 20, 'pCyclistProvidedOptimalPowerWithHarmonics', 'watts', 'Optimal power with harmonics', PointFieldCategory_POWER_CYCLIST_getInstance());
2022
- PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_instance = new PointField('P_CYCLIST_PROVIDED_POWER_NEEDED', 21, 'pCyclistPowerNeeded', 'watts', 'Power needed', PointFieldCategory_POWER_CYCLIST_getInstance());
2023
- PointField_P_CYCLIST_PROVIDED_MUSCULAR_instance = new PointField('P_CYCLIST_PROVIDED_MUSCULAR', 22, 'pCyclistProvidedMuscular', 'watts', 'Raw cyclist power', PointFieldCategory_POWER_CYCLIST_getInstance());
2024
- PointField_P_CYCLIST_PROVIDED_WHEEL_instance = new PointField('P_CYCLIST_PROVIDED_WHEEL', 23, 'pCyclistProvidedWheel', 'watts', 'Cyclist power transmitted to ground', PointFieldCategory_POWER_CYCLIST_getInstance());
2025
- PointField_P_COMPUTED_TOTAL_POWER_instance = new PointField('P_COMPUTED_TOTAL_POWER', 24, 'pComputedTotalPower', 'watts', 'Power from kinetic energy change', PointFieldCategory_POWER_POST_getInstance());
2026
- PointField_P_COMPUTED_WHEEL_POWER_instance = new PointField('P_COMPUTED_WHEEL_POWER', 25, 'pComputedWheelPower', 'watts', 'Wheel power from kinetic energy change', PointFieldCategory_POWER_POST_getInstance());
2027
- PointField_POWER_instance = new PointField('POWER', 26, 'pComputedPower', 'watts', 'Total power (watts)', PointFieldCategory_POWER_POST_getInstance());
2028
- PointField_SPEED_instance = new PointField('SPEED', 27, 'speed', 'm/s', 'Current speed (m/s)', PointFieldCategory_SPEED_getInstance());
2029
- PointField_SPEED_MAX_instance = new PointField('SPEED_MAX', 28, 'speedMax', 'm/s', 'Maximum speed (m/s)', PointFieldCategory_SPEED_getInstance());
2030
- PointField_SPEED_MAX_INCLINE_instance = new PointField('SPEED_MAX_INCLINE', 29, 'speedMaxIncline', 'm/s', 'Max speed on incline (m/s)', PointFieldCategory_SPEED_getInstance());
2031
- PointField_VIRT_SPEED_CURRENT_instance = new PointField('VIRT_SPEED_CURRENT', 30, 'virtSpeedCurrent', 'm/s', 'Virtual current speed (m/s)', PointFieldCategory_SPEED_getInstance());
2032
- PointField_TEMPERATURE_instance = new PointField('TEMPERATURE', 31, 'temperature', 'celsius', 'Temperature (celsius)', PointFieldCategory_ENVIRONMENTAL_getInstance());
2033
- PointField_WIND_SPEED_instance = new PointField('WIND_SPEED', 32, 'windSpeed', 'm/s', 'Wind speed (m/s)', PointFieldCategory_ENVIRONMENTAL_getInstance());
2034
- PointField_WIND_DIRECTION_instance = new PointField('WIND_DIRECTION', 33, 'windDirection', 'radians', 'Wind direction (radians)', PointFieldCategory_ENVIRONMENTAL_getInstance(), VOID, true);
2035
- PointField_HEART_RATE_instance = new PointField('HEART_RATE', 34, 'heartRate', 'bpm', 'Heart rate (bpm)', PointFieldCategory_PHYSIOLOGICAL_getInstance());
2036
- PointField_CADENCE_instance = new PointField('CADENCE', 35, 'cadence', 'rpm', 'Pedaling cadence (rpm)', PointFieldCategory_PHYSIOLOGICAL_getInstance());
2037
- Companion_getInstance_6();
2038
- }
2039
- var $ENTRIES;
2040
- function PointField(name, ordinal, prop, unit, shortDescription, category, notSelectable, anglesInRadians) {
2041
- notSelectable = notSelectable === VOID ? false : notSelectable;
2042
- anglesInRadians = anglesInRadians === VOID ? false : anglesInRadians;
2043
- Enum.call(this, name, ordinal);
2044
- this.e1w_1 = prop;
2045
- this.f1w_1 = unit;
2046
- this.g1w_1 = shortDescription;
2047
- this.h1w_1 = category;
2048
- this.i1w_1 = notSelectable;
2049
- this.j1w_1 = anglesInRadians;
2050
- }
2051
- function PointField_LATITUDE_getInstance() {
2052
- PointField_initEntries();
2053
- return PointField_LATITUDE_instance;
2054
- }
2055
- function PointField_LONGITUDE_getInstance() {
2056
- PointField_initEntries();
2057
- return PointField_LONGITUDE_instance;
2058
- }
2059
- function PointField_DISTANCE_getInstance() {
2060
- PointField_initEntries();
2061
- return PointField_DISTANCE_instance;
2062
- }
2063
- function PointField_DX_getInstance() {
2064
- PointField_initEntries();
2065
- return PointField_DX_instance;
2066
- }
2067
- function PointField_TIME_getInstance() {
2068
- PointField_initEntries();
2069
- return PointField_TIME_instance;
2070
- }
2071
- function PointField_ELAPSED_getInstance() {
2072
- PointField_initEntries();
2073
- return PointField_ELAPSED_instance;
2074
- }
2075
- function PointField_DT_getInstance() {
2076
- PointField_initEntries();
2077
- return PointField_DT_instance;
2078
- }
2079
- function PointField_BEARING_getInstance() {
2080
- PointField_initEntries();
2081
- return PointField_BEARING_instance;
2082
- }
2083
- function PointField_ELEVATION_getInstance() {
2084
- PointField_initEntries();
2085
- return PointField_ELEVATION_instance;
2086
- }
2087
- function PointField_GRADE_getInstance() {
2088
- PointField_initEntries();
2089
- return PointField_GRADE_instance;
2090
- }
2091
- function PointField_RADIUS_getInstance() {
2092
- PointField_initEntries();
2093
- return PointField_RADIUS_instance;
2094
- }
2095
- function PointField_AERO_COEF_getInstance() {
2096
- PointField_initEntries();
2097
- return PointField_AERO_COEF_instance;
2098
- }
2099
- function PointField_WIND_BEARING_getInstance() {
2100
- PointField_initEntries();
2101
- return PointField_WIND_BEARING_instance;
2102
- }
2103
- function PointField_WIND_ALPHA_getInstance() {
2104
- PointField_initEntries();
2105
- return PointField_WIND_ALPHA_instance;
2106
- }
2107
- function PointField_P_AERO_getInstance() {
2108
- PointField_initEntries();
2109
- return PointField_P_AERO_instance;
2110
- }
2111
- function PointField_P_GRAVITY_getInstance() {
2112
- PointField_initEntries();
2113
- return PointField_P_GRAVITY_instance;
2114
- }
2115
- function PointField_P_ROLLING_RESISTANCE_getInstance() {
2116
- PointField_initEntries();
2117
- return PointField_P_ROLLING_RESISTANCE_instance;
2118
- }
2119
- function PointField_P_WHEEL_BEARINGS_getInstance() {
2120
- PointField_initEntries();
2121
- return PointField_P_WHEEL_BEARINGS_instance;
2122
- }
2123
- function PointField_P_INPUT_POWER_getInstance() {
2124
- PointField_initEntries();
2125
- return PointField_P_INPUT_POWER_instance;
2126
- }
2127
- function PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_getInstance() {
2128
- PointField_initEntries();
2129
- return PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_instance;
2130
- }
2131
- function PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_getInstance() {
2132
- PointField_initEntries();
2133
- return PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_instance;
2134
- }
2135
- function PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_getInstance() {
2136
- PointField_initEntries();
2137
- return PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_instance;
2138
- }
2139
- function PointField_P_CYCLIST_PROVIDED_MUSCULAR_getInstance() {
2140
- PointField_initEntries();
2141
- return PointField_P_CYCLIST_PROVIDED_MUSCULAR_instance;
2142
- }
2143
- function PointField_P_CYCLIST_PROVIDED_WHEEL_getInstance() {
2144
- PointField_initEntries();
2145
- return PointField_P_CYCLIST_PROVIDED_WHEEL_instance;
2146
- }
2147
- function PointField_P_COMPUTED_TOTAL_POWER_getInstance() {
2148
- PointField_initEntries();
2149
- return PointField_P_COMPUTED_TOTAL_POWER_instance;
2150
- }
2151
- function PointField_P_COMPUTED_WHEEL_POWER_getInstance() {
2152
- PointField_initEntries();
2153
- return PointField_P_COMPUTED_WHEEL_POWER_instance;
2154
- }
2155
- function PointField_POWER_getInstance() {
2156
- PointField_initEntries();
2157
- return PointField_POWER_instance;
2158
- }
2159
- function PointField_SPEED_getInstance() {
2160
- PointField_initEntries();
2161
- return PointField_SPEED_instance;
2162
- }
2163
- function PointField_SPEED_MAX_getInstance() {
2164
- PointField_initEntries();
2165
- return PointField_SPEED_MAX_instance;
2166
- }
2167
- function PointField_SPEED_MAX_INCLINE_getInstance() {
2168
- PointField_initEntries();
2169
- return PointField_SPEED_MAX_INCLINE_instance;
2170
- }
2171
- function PointField_VIRT_SPEED_CURRENT_getInstance() {
2172
- PointField_initEntries();
2173
- return PointField_VIRT_SPEED_CURRENT_instance;
2174
- }
2175
- function PointField_TEMPERATURE_getInstance() {
2176
- PointField_initEntries();
2177
- return PointField_TEMPERATURE_instance;
2178
- }
2179
- function PointField_WIND_SPEED_getInstance() {
2180
- PointField_initEntries();
2181
- return PointField_WIND_SPEED_instance;
2182
- }
2183
- function PointField_WIND_DIRECTION_getInstance() {
2184
- PointField_initEntries();
2185
- return PointField_WIND_DIRECTION_instance;
2186
- }
2187
- function PointField_HEART_RATE_getInstance() {
2188
- PointField_initEntries();
2189
- return PointField_HEART_RATE_instance;
2190
- }
2191
- function PointField_CADENCE_getInstance() {
2192
- PointField_initEntries();
2193
- return PointField_CADENCE_instance;
2194
- }
2195
- var PointFieldCategory_COORDINATES_instance;
2196
- var PointFieldCategory_TEMPORAL_instance;
2197
- var PointFieldCategory_ANGLES_instance;
2198
- var PointFieldCategory_ELEVATION_instance;
2199
- var PointFieldCategory_GRADE_instance;
2200
- var PointFieldCategory_RADIUS_instance;
2201
- var PointFieldCategory_AERO_COEF_instance;
2202
- var PointFieldCategory_CYCLIST_WIND_instance;
2203
- var PointFieldCategory_POWER_PHYSICS_instance;
2204
- var PointFieldCategory_POWER_CYCLIST_instance;
2205
- var PointFieldCategory_POWER_POST_instance;
2206
- var PointFieldCategory_SPEED_instance;
2207
- var PointFieldCategory_ENVIRONMENTAL_instance;
2208
- var PointFieldCategory_PHYSIOLOGICAL_instance;
2209
- var PointFieldCategory_entriesInitialized;
2210
- function PointFieldCategory_initEntries() {
2211
- if (PointFieldCategory_entriesInitialized)
2212
- return Unit_instance;
2213
- PointFieldCategory_entriesInitialized = true;
2214
- PointFieldCategory_COORDINATES_instance = new PointFieldCategory('COORDINATES', 0, 'coordinates', 'Coordinates');
2215
- PointFieldCategory_TEMPORAL_instance = new PointFieldCategory('TEMPORAL', 1, 'temporal', 'Temporal');
2216
- PointFieldCategory_ANGLES_instance = new PointFieldCategory('ANGLES', 2, 'angles', 'Angles');
2217
- PointFieldCategory_ELEVATION_instance = new PointFieldCategory('ELEVATION', 3, 'elevation', '\uD83C\uDFD4\uFE0F Elevation');
2218
- PointFieldCategory_GRADE_instance = new PointFieldCategory('GRADE', 4, 'grade', '\uD83D\uDCD0 Grade');
2219
- PointFieldCategory_RADIUS_instance = new PointFieldCategory('RADIUS', 5, 'radius', 'Radius');
2220
- PointFieldCategory_AERO_COEF_instance = new PointFieldCategory('AERO_COEF', 6, 'aero_coef', 'Aero coef');
2221
- PointFieldCategory_CYCLIST_WIND_instance = new PointFieldCategory('CYCLIST_WIND', 7, 'cyclist_wind', 'Cyclist wind');
2222
- PointFieldCategory_POWER_PHYSICS_instance = new PointFieldCategory('POWER_PHYSICS', 8, 'power_physics', '\u26A1 Power Physics');
2223
- PointFieldCategory_POWER_CYCLIST_instance = new PointFieldCategory('POWER_CYCLIST', 9, 'power_cyclist', '\u26A1 Power Cyclist');
2224
- PointFieldCategory_POWER_POST_instance = new PointFieldCategory('POWER_POST', 10, 'power_post', '\u26A1 Power Post processed');
2225
- PointFieldCategory_SPEED_instance = new PointFieldCategory('SPEED', 11, 'speed', 'Speed & Motion');
2226
- PointFieldCategory_ENVIRONMENTAL_instance = new PointFieldCategory('ENVIRONMENTAL', 12, 'environmental', 'Environmental');
2227
- PointFieldCategory_PHYSIOLOGICAL_instance = new PointFieldCategory('PHYSIOLOGICAL', 13, 'physiological', 'Physiological');
2228
- }
2229
- function PointFieldCategory(name, ordinal, id, displayName) {
2230
- Enum.call(this, name, ordinal);
2231
- this.n1w_1 = id;
2232
- this.o1w_1 = displayName;
2233
- }
2234
- function PointFieldCategory_COORDINATES_getInstance() {
2235
- PointFieldCategory_initEntries();
2236
- return PointFieldCategory_COORDINATES_instance;
2237
- }
2238
- function PointFieldCategory_TEMPORAL_getInstance() {
2239
- PointFieldCategory_initEntries();
2240
- return PointFieldCategory_TEMPORAL_instance;
2241
- }
2242
- function PointFieldCategory_ANGLES_getInstance() {
2243
- PointFieldCategory_initEntries();
2244
- return PointFieldCategory_ANGLES_instance;
2245
- }
2246
- function PointFieldCategory_ELEVATION_getInstance() {
2247
- PointFieldCategory_initEntries();
2248
- return PointFieldCategory_ELEVATION_instance;
2249
- }
2250
- function PointFieldCategory_GRADE_getInstance() {
2251
- PointFieldCategory_initEntries();
2252
- return PointFieldCategory_GRADE_instance;
2253
- }
2254
- function PointFieldCategory_RADIUS_getInstance() {
2255
- PointFieldCategory_initEntries();
2256
- return PointFieldCategory_RADIUS_instance;
2257
- }
2258
- function PointFieldCategory_AERO_COEF_getInstance() {
2259
- PointFieldCategory_initEntries();
2260
- return PointFieldCategory_AERO_COEF_instance;
2261
- }
2262
- function PointFieldCategory_CYCLIST_WIND_getInstance() {
2263
- PointFieldCategory_initEntries();
2264
- return PointFieldCategory_CYCLIST_WIND_instance;
2265
- }
2266
- function PointFieldCategory_POWER_PHYSICS_getInstance() {
2267
- PointFieldCategory_initEntries();
2268
- return PointFieldCategory_POWER_PHYSICS_instance;
2269
- }
2270
- function PointFieldCategory_POWER_CYCLIST_getInstance() {
2271
- PointFieldCategory_initEntries();
2272
- return PointFieldCategory_POWER_CYCLIST_instance;
2273
- }
2274
- function PointFieldCategory_POWER_POST_getInstance() {
2275
- PointFieldCategory_initEntries();
2276
- return PointFieldCategory_POWER_POST_instance;
2277
- }
2278
- function PointFieldCategory_SPEED_getInstance() {
2279
- PointFieldCategory_initEntries();
2280
- return PointFieldCategory_SPEED_instance;
2281
- }
2282
- function PointFieldCategory_ENVIRONMENTAL_getInstance() {
2283
- PointFieldCategory_initEntries();
2284
- return PointFieldCategory_ENVIRONMENTAL_instance;
2285
- }
2286
- function PointFieldCategory_PHYSIOLOGICAL_getInstance() {
2287
- PointFieldCategory_initEntries();
2288
- return PointFieldCategory_PHYSIOLOGICAL_instance;
2289
- }
2290
- function Copy(sourceIndex) {
2291
- this.p1w_1 = sourceIndex;
2292
- }
2293
- protoOf(Copy).toString = function () {
2294
- return 'Copy(sourceIndex=' + this.p1w_1 + ')';
2295
- };
2296
- protoOf(Copy).hashCode = function () {
2297
- return this.p1w_1;
2298
- };
2299
- protoOf(Copy).equals = function (other) {
933
+ protoOf(Candidate).equals = function (other) {
2300
934
  if (this === other)
2301
935
  return true;
2302
- if (!(other instanceof Copy))
936
+ if (!(other instanceof Candidate))
2303
937
  return false;
2304
- if (!(this.p1w_1 === other.p1w_1))
938
+ if (!(this.p22_1 === other.p22_1))
2305
939
  return false;
2306
- return true;
2307
- };
2308
- function Interpolate(from, to, coef) {
2309
- this.q1w_1 = from;
2310
- this.r1w_1 = to;
2311
- this.s1w_1 = coef;
2312
- }
2313
- protoOf(Interpolate).toString = function () {
2314
- return 'Interpolate(from=' + this.q1w_1 + ', to=' + this.r1w_1 + ', coef=' + this.s1w_1 + ')';
2315
- };
2316
- protoOf(Interpolate).hashCode = function () {
2317
- var result = this.q1w_1;
2318
- result = imul(result, 31) + this.r1w_1 | 0;
2319
- result = imul(result, 31) + getNumberHashCode(this.s1w_1) | 0;
2320
- return result;
2321
- };
2322
- protoOf(Interpolate).equals = function (other) {
2323
- if (this === other)
2324
- return true;
2325
- if (!(other instanceof Interpolate))
940
+ if (!(this.q22_1 === other.q22_1))
2326
941
  return false;
2327
- if (!(this.q1w_1 === other.q1w_1))
942
+ if (!equals(this.r22_1, other.r22_1))
2328
943
  return false;
2329
- if (!(this.r1w_1 === other.r1w_1))
944
+ if (!equals(this.s22_1, other.s22_1))
2330
945
  return false;
2331
- if (!equals(this.s1w_1, other.s1w_1))
946
+ if (!equals(this.t22_1, other.t22_1))
2332
947
  return false;
2333
948
  return true;
2334
949
  };
2335
- function buildPlan($this, source, minDistanceM, maxDistanceM) {
2336
- var n = source.d1s_1;
2337
- var plan = ArrayList_init_$Create$(n);
2338
- // Inline function 'kotlin.collections.plusAssign' call
2339
- var element = new Copy(0);
2340
- plan.n(element);
2341
- var lastAddedDistance = source.h1u(0);
2342
- var lastAddedIndex = 0;
2343
- var inductionVariable = 1;
2344
- if (inductionVariable < n)
2345
- $l$loop: do {
2346
- var i = inductionVariable;
2347
- inductionVariable = inductionVariable + 1 | 0;
2348
- var curDist = source.h1u(i);
2349
- var gap = curDist - lastAddedDistance;
2350
- if (gap < minDistanceM)
2351
- continue $l$loop;
2352
- else if (gap <= maxDistanceM) {
2353
- // Inline function 'kotlin.collections.plusAssign' call
2354
- var element_0 = new Copy(i);
2355
- plan.n(element_0);
2356
- lastAddedDistance = curDist;
2357
- lastAddedIndex = i;
2358
- } else {
2359
- // Inline function 'kotlin.math.ceil' call
2360
- var x = gap / maxDistanceM;
2361
- var tmp$ret$2 = Math.ceil(x);
2362
- var numSegments = numberToInt(tmp$ret$2);
2363
- var spacing = gap / numSegments;
2364
- var index1 = lastAddedIndex;
2365
- var inductionVariable_0 = 1;
2366
- if (inductionVariable_0 < numSegments)
2367
- do {
2368
- var j = inductionVariable_0;
2369
- inductionVariable_0 = inductionVariable_0 + 1 | 0;
2370
- var targetDistance = lastAddedDistance + j * spacing;
2371
- while (index1 < (i - 1 | 0) && source.h1u(index1 + 1 | 0) < targetDistance) {
2372
- index1 = index1 + 1 | 0;
2373
- }
2374
- var dist1 = source.h1u(index1);
2375
- var dist2 = source.h1u(index1 + 1 | 0);
2376
- var coef = (targetDistance - dist1) / (dist2 - dist1);
2377
- // Inline function 'kotlin.collections.plusAssign' call
2378
- var element_1 = new Interpolate(index1, index1 + 1 | 0, coef);
2379
- plan.n(element_1);
2380
- }
2381
- while (inductionVariable_0 < numSegments);
2382
- // Inline function 'kotlin.collections.plusAssign' call
2383
- var element_2 = new Copy(i);
2384
- plan.n(element_2);
2385
- lastAddedDistance = curDist;
2386
- lastAddedIndex = i;
2387
- }
2388
- }
2389
- while (inductionVariable < n);
2390
- return plan;
2391
- }
2392
- function materialize($this, source, plan) {
2393
- var out = new Path(plan.k());
2394
- var iterator = plan.h();
2395
- var index = 0;
2396
- while (iterator.i()) {
2397
- var dstIdx = index;
2398
- index = index + 1 | 0;
2399
- var op = iterator.j();
2400
- if (op instanceof Copy) {
2401
- copyFields($this, source, op.p1w_1, out, dstIdx);
2402
- } else {
2403
- if (op instanceof Interpolate) {
2404
- interpolateFields($this, source, op.q1w_1, op.r1w_1, op.s1w_1, out, dstIdx);
2405
- } else {
2406
- noWhenBranchMatchedException();
2407
- }
2408
- }
2409
- }
2410
- out.j1t();
2411
- return out;
2412
- }
2413
- function copyFields($this, src, srcIdx, dst, dstIdx) {
2414
- var _iterator__ex2g4s = get_entries().h();
2415
- while (_iterator__ex2g4s.i()) {
2416
- var field = _iterator__ex2g4s.j();
2417
- dst.t1t(dstIdx, field, src.s1t(srcIdx, field));
2418
- }
950
+ function sam$kotlin_Comparator$0(function_0) {
951
+ this.v22_1 = function_0;
2419
952
  }
2420
- function interpolateFields($this, src, i1, i2, coef, dst, dstIdx) {
2421
- var _iterator__ex2g4s = get_entries().h();
2422
- while (_iterator__ex2g4s.i()) {
2423
- var field = _iterator__ex2g4s.j();
2424
- var v1 = src.s1t(i1, field);
2425
- var v2 = src.s1t(i2, field);
2426
- var v = isNaN_0(v1) || isNaN_0(v2) ? NaN : v1 + (v2 - v1) * coef;
2427
- dst.t1t(dstIdx, field, v);
2428
- }
2429
- }
2430
- function PointPerDistance() {
2431
- }
2432
- protoOf(PointPerDistance).z1q = function (source, minDistanceM, maxDistanceM) {
2433
- return this.t1w(source, minDistanceM, maxDistanceM);
953
+ protoOf(sam$kotlin_Comparator$0).l9 = function (a, b) {
954
+ return this.v22_1(a, b);
2434
955
  };
2435
- protoOf(PointPerDistance).t1w = function (source, minDistanceM, maxDistanceM) {
2436
- // Inline function 'kotlin.require' call
2437
- if (!(maxDistanceM > 0.0)) {
2438
- var message = 'maxDistanceM must be > 0, got ' + maxDistanceM;
2439
- throw IllegalArgumentException_init_$Create$(toString(message));
2440
- }
2441
- if (source.d1s_1 === 0)
2442
- return new Path(0);
2443
- if (source.d1s_1 === 1) {
2444
- var out = new Path(1);
2445
- copyFields(this, source, 0, out, 0);
2446
- out.j1t();
2447
- return out;
2448
- }
2449
- var plan = buildPlan(this, source, minDistanceM, maxDistanceM);
2450
- return materialize(this, source, plan);
956
+ protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
957
+ return this.l9(a, b);
2451
958
  };
2452
- var PointPerDistance_instance;
2453
- function PointPerDistance_getInstance() {
2454
- return PointPerDistance_instance;
2455
- }
2456
- function Copy_0(sourceIndex) {
2457
- this.u1w_1 = sourceIndex;
2458
- }
2459
- protoOf(Copy_0).toString = function () {
2460
- return 'Copy(sourceIndex=' + this.u1w_1 + ')';
959
+ protoOf(sam$kotlin_Comparator$0).x1 = function () {
960
+ return this.v22_1;
2461
961
  };
2462
- protoOf(Copy_0).hashCode = function () {
2463
- return this.u1w_1;
962
+ protoOf(sam$kotlin_Comparator$0).equals = function (other) {
963
+ var tmp;
964
+ if (!(other == null) ? isInterface(other, Comparator) : false) {
965
+ var tmp_0;
966
+ if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
967
+ tmp_0 = equals(this.x1(), other.x1());
968
+ } else {
969
+ tmp_0 = false;
970
+ }
971
+ tmp = tmp_0;
972
+ } else {
973
+ tmp = false;
974
+ }
975
+ return tmp;
2464
976
  };
2465
- protoOf(Copy_0).equals = function (other) {
2466
- if (this === other)
2467
- return true;
2468
- if (!(other instanceof Copy_0))
2469
- return false;
2470
- if (!(this.u1w_1 === other.u1w_1))
2471
- return false;
2472
- return true;
977
+ protoOf(sam$kotlin_Comparator$0).hashCode = function () {
978
+ return hashCode(this.x1());
2473
979
  };
2474
- function Interpolate_0(from, to, coef) {
2475
- this.v1w_1 = from;
2476
- this.w1w_1 = to;
2477
- this.x1w_1 = coef;
980
+ function sam$kotlin_Comparator$0_0(function_0) {
981
+ this.w22_1 = function_0;
2478
982
  }
2479
- protoOf(Interpolate_0).toString = function () {
2480
- return 'Interpolate(from=' + this.v1w_1 + ', to=' + this.w1w_1 + ', coef=' + this.x1w_1 + ')';
983
+ protoOf(sam$kotlin_Comparator$0_0).l9 = function (a, b) {
984
+ return this.w22_1(a, b);
2481
985
  };
2482
- protoOf(Interpolate_0).hashCode = function () {
2483
- var result = this.v1w_1;
2484
- result = imul(result, 31) + this.w1w_1 | 0;
2485
- result = imul(result, 31) + getNumberHashCode(this.x1w_1) | 0;
2486
- return result;
986
+ protoOf(sam$kotlin_Comparator$0_0).compare = function (a, b) {
987
+ return this.l9(a, b);
2487
988
  };
2488
- protoOf(Interpolate_0).equals = function (other) {
2489
- if (this === other)
2490
- return true;
2491
- if (!(other instanceof Interpolate_0))
2492
- return false;
2493
- if (!(this.v1w_1 === other.v1w_1))
2494
- return false;
2495
- if (!(this.w1w_1 === other.w1w_1))
2496
- return false;
2497
- if (!equals(this.x1w_1, other.x1w_1))
2498
- return false;
2499
- return true;
989
+ protoOf(sam$kotlin_Comparator$0_0).x1 = function () {
990
+ return this.w22_1;
2500
991
  };
2501
- function buildPlan_0($this, source) {
2502
- var plan = LinkedHashMap_init_$Create$_0();
2503
- var n = source.d1s_1;
2504
- var inductionVariable = 0;
2505
- if (inductionVariable < n)
2506
- $l$loop_0: do {
2507
- var i = inductionVariable;
992
+ protoOf(sam$kotlin_Comparator$0_0).equals = function (other) {
993
+ var tmp;
994
+ if (!(other == null) ? isInterface(other, Comparator) : false) {
995
+ var tmp_0;
996
+ if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
997
+ tmp_0 = equals(this.x1(), other.x1());
998
+ } else {
999
+ tmp_0 = false;
1000
+ }
1001
+ tmp = tmp_0;
1002
+ } else {
1003
+ tmp = false;
1004
+ }
1005
+ return tmp;
1006
+ };
1007
+ protoOf(sam$kotlin_Comparator$0_0).hashCode = function () {
1008
+ return hashCode(this.x1());
1009
+ };
1010
+ function ClimbDetector$detect$lambda(a, b) {
1011
+ // Inline function 'kotlin.comparisons.compareValuesBy' call
1012
+ var tmp = a.p22_1;
1013
+ var tmp$ret$2 = b.p22_1;
1014
+ return compareValues(tmp, tmp$ret$2);
1015
+ }
1016
+ function ClimbDetector$dedupeByScore$lambda(a, b) {
1017
+ // Inline function 'kotlin.comparisons.compareValuesBy' call
1018
+ var tmp = b.r22_1;
1019
+ var tmp$ret$2 = a.r22_1;
1020
+ return compareValues(tmp, tmp$ret$2);
1021
+ }
1022
+ function ClimbDetector$dedupeByScore$lambda_0($best) {
1023
+ return function (it) {
1024
+ return it.u22($best);
1025
+ };
1026
+ }
1027
+ function ClimbDetector() {
1028
+ this.x22_1 = 10.0;
1029
+ this.y22_1 = 10.0;
1030
+ this.z22_1 = 50.0;
1031
+ this.a23_1 = 50.0;
1032
+ }
1033
+ protoOf(ClimbDetector).b23 = function (path, options) {
1034
+ if (path.f1r_1 < 2)
1035
+ return emptyList();
1036
+ var tmp0 = options.e22_1;
1037
+ var tmp0_0 = options.f22_1;
1038
+ // Inline function 'kotlin.comparisons.minOf' call
1039
+ var b = path.m1s_1 / options.g22_1;
1040
+ // Inline function 'kotlin.comparisons.maxOf' call
1041
+ var b_0 = Math.min(tmp0_0, b);
1042
+ var minClimbElevation = Math.max(tmp0, b_0);
1043
+ var profile = Companion_instance_4.l22(path, options.k22_1);
1044
+ // Inline function 'kotlin.collections.mapNotNull' call
1045
+ var tmp0_1 = until(0, profile.l());
1046
+ // Inline function 'kotlin.collections.mapNotNullTo' call
1047
+ var destination = ArrayList_init_$Create$();
1048
+ // Inline function 'kotlin.collections.forEach' call
1049
+ var inductionVariable = tmp0_1.lc_1;
1050
+ var last = tmp0_1.mc_1;
1051
+ if (inductionVariable <= last)
1052
+ do {
1053
+ var element = inductionVariable;
2508
1054
  inductionVariable = inductionVariable + 1 | 0;
2509
- var time1 = source.i1s(i);
2510
- // Inline function 'kotlin.math.floor' call
2511
- var x = time1 / 1000.0;
2512
- var tmp$ret$0 = Math.floor(x);
2513
- var epoch1 = numberToLong(tmp$ret$0);
2514
- var msInSec1 = subtract(numberToLong(time1), multiply(epoch1, new Long(1000, 0)));
2515
- if (i === 0 && !equalsLong(msInSec1, new Long(0, 0))) {
2516
- // Inline function 'kotlin.collections.set' call
2517
- var value = new Copy_0(i);
2518
- plan.a3(epoch1, value);
2519
- }
2520
- if (i === (n - 1 | 0)) {
2521
- if (!equalsLong(msInSec1, new Long(0, 0))) {
2522
- var tmp2 = add(epoch1, new Long(1, 0));
2523
- // Inline function 'kotlin.collections.set' call
2524
- var value_0 = new Copy_0(i);
2525
- plan.a3(tmp2, value_0);
2526
- }
2527
- continue $l$loop_0;
2528
- }
2529
- var time2 = source.i1s(i + 1 | 0);
2530
- // Inline function 'kotlin.math.floor' call
2531
- var x_0 = time2 / 1000.0;
2532
- var tmp$ret$3 = Math.floor(x_0);
2533
- var epoch2 = numberToLong(tmp$ret$3);
2534
- if (equalsLong(epoch1, epoch2))
2535
- continue $l$loop_0;
2536
- var duration12 = time2 - time1;
2537
- var epochStart = equalsLong(msInSec1, new Long(0, 0)) ? epoch1 : add(epoch1, new Long(1, 0));
2538
- var epochEnd = epoch2;
2539
- var e = epochStart;
2540
- while (compare(e, epochEnd) <= 0) {
2541
- // Inline function 'kotlin.Long.times' call
2542
- var this_0 = e;
2543
- var epochTime = toNumber(this_0) * 1000.0;
2544
- var coef = (epochTime - time1) / duration12;
2545
- var tmp2_0 = e;
2546
- // Inline function 'kotlin.collections.set' call
2547
- var value_1 = new Interpolate_0(i, i + 1 | 0, coef);
2548
- plan.a3(tmp2_0, value_1);
2549
- var _unary__edvuaz = e;
2550
- e = add(_unary__edvuaz, get_ONE());
1055
+ var i = element;
1056
+ var tmp0_safe_receiver = bestCandidateFrom(ClimbDetector_instance, profile, i, minClimbElevation, options);
1057
+ if (tmp0_safe_receiver == null)
1058
+ null;
1059
+ else {
1060
+ // Inline function 'kotlin.let' call
1061
+ destination.h(tmp0_safe_receiver);
2551
1062
  }
2552
1063
  }
2553
- while (inductionVariable < n);
2554
- return plan;
2555
- }
2556
- function materialize_0($this, source, plan) {
2557
- var sortedEpochs = sorted(plan.k1());
2558
- var out = new Path(sortedEpochs.k());
2559
- var iterator = sortedEpochs.h();
2560
- var index = 0;
2561
- $l$loop: while (iterator.i()) {
2562
- var idx = index;
2563
- index = index + 1 | 0;
2564
- var epoch = iterator.j();
2565
- var tmp0_elvis_lhs = plan.j1(epoch);
1064
+ while (!(element === last));
1065
+ var candidates = destination;
1066
+ // Inline function 'kotlin.collections.sortedBy' call
1067
+ var this_0 = dedupeByScore(this, candidates);
1068
+ // Inline function 'kotlin.comparisons.compareBy' call
1069
+ var tmp = ClimbDetector$detect$lambda;
1070
+ var tmp$ret$10 = new sam$kotlin_Comparator$0(tmp);
1071
+ // Inline function 'kotlin.collections.map' call
1072
+ var this_1 = sortedWith(this_0, tmp$ret$10);
1073
+ // Inline function 'kotlin.collections.mapTo' call
1074
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
1075
+ var _iterator__ex2g4s = this_1.i();
1076
+ while (_iterator__ex2g4s.j()) {
1077
+ var item = _iterator__ex2g4s.k();
1078
+ var tmp$ret$13 = toClimb(ClimbDetector_instance, item, path, profile);
1079
+ destination_0.h(tmp$ret$13);
1080
+ }
1081
+ return destination_0;
1082
+ };
1083
+ protoOf(ClimbDetector).c23 = function (path, options, $super) {
1084
+ options = options === VOID ? Companion_getInstance_6().d22_1 : options;
1085
+ return $super === VOID ? this.b23(path, options) : $super.b23.call(this, path, options);
1086
+ };
1087
+ var ClimbDetector_instance;
1088
+ function ClimbDetector_getInstance() {
1089
+ return ClimbDetector_instance;
1090
+ }
1091
+ function dominantHeadwindDirection(_this__u8e3s4) {
1092
+ var sumX = 0.0;
1093
+ var sumY = 0.0;
1094
+ var contributing = 0;
1095
+ var _iterator__ex2g4s = _this__u8e3s4.i();
1096
+ $l$loop: while (_iterator__ex2g4s.j()) {
1097
+ var path = _iterator__ex2g4s.k();
1098
+ var tmp0_elvis_lhs = meanDirectionFromStart(path);
2566
1099
  var tmp;
2567
1100
  if (tmp0_elvis_lhs == null) {
2568
1101
  continue $l$loop;
2569
1102
  } else {
2570
1103
  tmp = tmp0_elvis_lhs;
2571
1104
  }
2572
- var data = tmp;
2573
- if (data instanceof Copy_0) {
2574
- copyFields_0($this, source, data.u1w_1, out, idx);
2575
- } else {
2576
- if (data instanceof Interpolate_0) {
2577
- interpolateFields_0($this, source, data.v1w_1, data.w1w_1, data.x1w_1, out, idx);
2578
- } else {
2579
- noWhenBranchMatchedException();
2580
- }
2581
- }
2582
- out.v1s(idx, toNumber(multiply(epoch, new Long(1000, 0))));
1105
+ var mean = tmp;
1106
+ sumX = sumX + mean.oe_1;
1107
+ sumY = sumY + mean.pe_1;
1108
+ contributing = contributing + 1 | 0;
2583
1109
  }
2584
- out.j1t();
2585
- return out;
1110
+ if (contributing === 0)
1111
+ return null;
1112
+ var tmp0 = sumX;
1113
+ // Inline function 'kotlin.math.hypot' call
1114
+ var y = sumY;
1115
+ var magnitude = hypot(tmp0, y);
1116
+ if (magnitude < 1.0E-12)
1117
+ return null;
1118
+ return new Vector3D(-sumX / magnitude, -sumY / magnitude, 0.0);
1119
+ }
1120
+ function meanDirectionFromStart(_this__u8e3s4) {
1121
+ if (_this__u8e3s4.f1r_1 <= 3)
1122
+ return null;
1123
+ var lat0 = _this__u8e3s4.h1r(0);
1124
+ var lon0 = _this__u8e3s4.i1r(0);
1125
+ // Inline function 'kotlin.math.cos' call
1126
+ var cosLat0 = Math.cos(lat0);
1127
+ var sumX = 0.0;
1128
+ var sumY = 0.0;
1129
+ var inductionVariable = 1;
1130
+ var last = _this__u8e3s4.f1r_1;
1131
+ if (inductionVariable < last)
1132
+ $l$loop: do {
1133
+ var i = inductionVariable;
1134
+ inductionVariable = inductionVariable + 1 | 0;
1135
+ var dx = (_this__u8e3s4.i1r(i) - lon0) * cosLat0;
1136
+ var dy = _this__u8e3s4.h1r(i) - lat0;
1137
+ // Inline function 'kotlin.math.hypot' call
1138
+ var length = hypot(dx, dy);
1139
+ if (length < 1.0E-12)
1140
+ continue $l$loop;
1141
+ sumX = sumX + dx / length;
1142
+ sumY = sumY + dy / length;
1143
+ }
1144
+ while (inductionVariable < last);
1145
+ var n = _this__u8e3s4.f1r_1 - 1 | 0;
1146
+ return new Pair(sumX / n, sumY / n);
2586
1147
  }
2587
- function copyFields_0($this, src, srcIdx, dst, dstIdx) {
2588
- var _iterator__ex2g4s = get_entries().h();
2589
- while (_iterator__ex2g4s.i()) {
2590
- var field = _iterator__ex2g4s.j();
2591
- dst.t1t(dstIdx, field, src.s1t(srcIdx, field));
2592
- }
1148
+ function dominantHeadwindAzimuthDeg(_this__u8e3s4) {
1149
+ return dominantHeadwindAzimuthDeg_0(listOf(_this__u8e3s4));
2593
1150
  }
2594
- function interpolateFields_0($this, src, i1, i2, coef, dst, dstIdx) {
2595
- var _iterator__ex2g4s = get_entries().h();
2596
- while (_iterator__ex2g4s.i()) {
2597
- var field = _iterator__ex2g4s.j();
2598
- var v1 = src.s1t(i1, field);
2599
- var v2 = src.s1t(i2, field);
2600
- var v = isNaN_0(v1) || isNaN_0(v2) ? NaN : v1 + (v2 - v1) * coef;
2601
- dst.t1t(dstIdx, field, v);
1151
+ function dominantHeadwindAzimuthDeg_0(_this__u8e3s4) {
1152
+ var tmp0_elvis_lhs = dominantHeadwindDirection(_this__u8e3s4);
1153
+ var tmp;
1154
+ if (tmp0_elvis_lhs == null) {
1155
+ return NaN;
1156
+ } else {
1157
+ tmp = tmp0_elvis_lhs;
2602
1158
  }
2603
- }
2604
- function PointPerSecond() {
2605
- }
2606
- protoOf(PointPerSecond).l1r = function (source) {
2607
- if (source.d1s_1 === 0)
2608
- return new Path(0);
2609
- var plan = buildPlan_0(this, source);
2610
- return materialize_0(this, source, plan);
2611
- };
2612
- var PointPerSecond_instance;
2613
- function PointPerSecond_getInstance() {
2614
- return PointPerSecond_instance;
1159
+ var direction = tmp;
1160
+ var tmp0 = direction.bx_1;
1161
+ // Inline function 'kotlin.math.atan2' call
1162
+ var x = direction.cx_1;
1163
+ // Inline function 'kotlin.mod' call
1164
+ var r = Math.atan2(tmp0, x) * 57.29577951308232 % 360.0;
1165
+ var tmp_0;
1166
+ var tmp_1;
1167
+ if (!(r === 0.0)) {
1168
+ // Inline function 'kotlin.math.sign' call
1169
+ var tmp_2 = sign(r);
1170
+ // Inline function 'kotlin.math.sign' call
1171
+ tmp_1 = !(tmp_2 === sign(360.0));
1172
+ } else {
1173
+ tmp_1 = false;
1174
+ }
1175
+ if (tmp_1) {
1176
+ tmp_0 = r + 360.0;
1177
+ } else {
1178
+ tmp_0 = r;
1179
+ }
1180
+ return tmp_0;
2615
1181
  }
2616
1182
  function computeWithWind($this, path, i, aeroCoef, wind) {
2617
- var speed = path.j1v(i);
2618
- var bearing = path.o1u(i);
2619
- path.p1v(i, wind.y1w_1);
2620
- path.q1v(i, wind.z1w_1);
2621
- var windDirectionAsBearing = 3.141592653589793 / 2.0 - wind.z1w_1;
2622
- path.u1u(i, windDirectionAsBearing);
1183
+ var speed = path.x1v(i);
1184
+ var bearing = path.d1v(i);
1185
+ path.d1w(i, wind.d23_1);
1186
+ path.e1w(i, wind.e23_1);
1187
+ var windDirectionAsBearing = 3.141592653589793 / 2.0 - wind.e23_1;
1188
+ path.j1v(i, windDirectionAsBearing);
2623
1189
  var alpha = windDirectionAsBearing - bearing;
2624
- path.v1u(i, alpha);
2625
- var v = wind.y1w_1;
1190
+ path.k1v(i, alpha);
1191
+ var v = wind.d23_1;
2626
1192
  // Inline function 'kotlin.math.cos' call
2627
1193
  var l1 = speed + v * Math.cos(alpha);
2628
1194
  var l2 = l1 * l1;
@@ -2637,21 +1203,21 @@
2637
1203
  return tmp_1 * Math.sqrt(l3) * l1 * speed;
2638
1204
  }
2639
1205
  function AeroPowerProvider() {
2640
- this.a1x_1 = 1.2;
1206
+ this.f23_1 = 1.2;
2641
1207
  }
2642
- protoOf(AeroPowerProvider).b1x = function (course, path, pointIndex) {
2643
- var aeroCoef = course.m1p_1.c1x(course, path, pointIndex);
2644
- path.t1u(pointIndex, aeroCoef);
2645
- var wind = course.n1p_1.d1x(course.k1p_1, path, pointIndex);
1208
+ protoOf(AeroPowerProvider).g23 = function (course, path, pointIndex) {
1209
+ var aeroCoef = course.n1z_1.h23(course, path, pointIndex);
1210
+ path.i1v(pointIndex, aeroCoef);
1211
+ var wind = course.o1z_1.i23(course.l1z_1, path, pointIndex);
2646
1212
  var tmp;
2647
- if (wind.y1w_1 === 0.0) {
2648
- var v = path.j1v(pointIndex);
1213
+ if (wind.d23_1 === 0.0) {
1214
+ var v = path.x1v(pointIndex);
2649
1215
  tmp = -aeroCoef * v * v * v;
2650
1216
  } else {
2651
1217
  tmp = computeWithWind(this, path, pointIndex, aeroCoef, wind);
2652
1218
  }
2653
1219
  var pAir = tmp;
2654
- path.w1u(pointIndex, pAir);
1220
+ path.l1v(pointIndex, pAir);
2655
1221
  return pAir;
2656
1222
  };
2657
1223
  var AeroPowerProvider_instance;
@@ -2660,79 +1226,79 @@
2660
1226
  }
2661
1227
  function AeroProviderConstant() {
2662
1228
  }
2663
- protoOf(AeroProviderConstant).c1x = function (course, path, pointIndex) {
2664
- var rho = course.l1p_1.e1x(course.k1p_1, path, pointIndex);
2665
- return course.q1p().w1p_1 * course.q1p().x1p_1 * rho / 2.0;
1229
+ protoOf(AeroProviderConstant).h23 = function (course, path, pointIndex) {
1230
+ var rho = course.m1z_1.j23(course.l1z_1, path, pointIndex);
1231
+ return course.r1z().x1z_1 * course.r1z().y1z_1 * rho / 2.0;
2666
1232
  };
2667
1233
  var AeroProviderConstant_instance;
2668
1234
  function AeroProviderConstant_getInstance() {
2669
1235
  return AeroProviderConstant_instance;
2670
1236
  }
2671
- function Companion_6() {
2672
- this.f1x_1 = 0.05;
2673
- this.g1x_1 = 3.0;
1237
+ function Companion_5() {
1238
+ this.k23_1 = 0.05;
1239
+ this.l23_1 = 3.0;
2674
1240
  }
2675
- var Companion_instance_6;
2676
- function Companion_getInstance_7() {
2677
- return Companion_instance_6;
1241
+ var Companion_instance_5;
1242
+ function Companion_getInstance_8() {
1243
+ return Companion_instance_5;
2678
1244
  }
2679
1245
  function CyclistPowerProviderBase(useHarmonics, random) {
2680
1246
  random = random === VOID ? Default_getInstance() : random;
2681
- this.h1x_1 = useHarmonics;
1247
+ this.m23_1 = useHarmonics;
2682
1248
  var tmp = this;
2683
1249
  var tmp_0;
2684
- if (this.h1x_1) {
1250
+ if (this.m23_1) {
2685
1251
  // Inline function 'kotlin.collections.List' call
2686
1252
  // Inline function 'kotlin.collections.MutableList' call
2687
- var list = ArrayList_init_$Create$(20);
1253
+ var list = ArrayList_init_$Create$_0(20);
2688
1254
  // Inline function 'kotlin.repeat' call
2689
1255
  var inductionVariable = 0;
2690
1256
  if (inductionVariable < 20)
2691
1257
  do {
2692
1258
  var index = inductionVariable;
2693
1259
  inductionVariable = inductionVariable + 1 | 0;
2694
- var tmp$ret$4 = new Harmonic(1.0 + random.qb() * 9.0, random.qb() * 3.141592653589793, random.qb() * 0.01);
2695
- list.n(tmp$ret$4);
1260
+ var tmp$ret$4 = new Harmonic(1.0 + random.zb() * 9.0, random.zb() * 3.141592653589793, random.zb() * 0.01);
1261
+ list.h(tmp$ret$4);
2696
1262
  }
2697
1263
  while (inductionVariable < 20);
2698
1264
  tmp_0 = list;
2699
1265
  } else {
2700
1266
  tmp_0 = emptyList();
2701
1267
  }
2702
- tmp.i1x_1 = tmp_0;
2703
- }
2704
- protoOf(CyclistPowerProviderBase).b1x = function (course, path, pointIndex) {
2705
- var power = this.j1x(course, path, pointIndex);
2706
- path.a1v(pointIndex, power);
2707
- if (this.h1x_1) {
2708
- var x = path.i1s(pointIndex) / 10000.0;
2709
- var _iterator__ex2g4s = this.i1x_1.h();
2710
- while (_iterator__ex2g4s.i()) {
2711
- var h = _iterator__ex2g4s.j();
1268
+ tmp.n23_1 = tmp_0;
1269
+ }
1270
+ protoOf(CyclistPowerProviderBase).g23 = function (course, path, pointIndex) {
1271
+ var power = this.o23(course, path, pointIndex);
1272
+ path.p1v(pointIndex, power);
1273
+ if (this.m23_1) {
1274
+ var x = path.k1r(pointIndex) / 10000.0;
1275
+ var _iterator__ex2g4s = this.n23_1.i();
1276
+ while (_iterator__ex2g4s.j()) {
1277
+ var h = _iterator__ex2g4s.k();
2712
1278
  var tmp = power;
2713
- var tmp_0 = h.m1x_1 * power;
1279
+ var tmp_0 = h.r23_1 * power;
2714
1280
  // Inline function 'kotlin.math.cos' call
2715
- var x_0 = h.k1x_1 * x - h.l1x_1;
1281
+ var x_0 = h.p23_1 * x - h.q23_1;
2716
1282
  power = tmp + tmp_0 * Math.cos(x_0);
2717
1283
  }
2718
1284
  }
2719
- path.b1v(pointIndex, power);
2720
- var powerNeeded = -PowerComputer_instance.n1x(course, path, pointIndex, false);
2721
- path.c1v(pointIndex, powerNeeded);
1285
+ path.q1v(pointIndex, power);
1286
+ var powerNeeded = -PowerComputer_instance.s23(course, path, pointIndex, false);
1287
+ path.r1v(pointIndex, powerNeeded);
2722
1288
  return power;
2723
1289
  };
2724
1290
  function GravPowerProvider() {
2725
1291
  }
2726
- protoOf(GravPowerProvider).b1x = function (course, path, pointIndex) {
2727
- var m = course.q1p().u1p_1;
2728
- var grade = path.q1u(pointIndex);
2729
- var speed = path.j1v(pointIndex);
1292
+ protoOf(GravPowerProvider).g23 = function (course, path, pointIndex) {
1293
+ var m = course.r1z().v1z_1;
1294
+ var grade = path.f1v(pointIndex);
1295
+ var speed = path.x1v(pointIndex);
2730
1296
  var tmp = -m * 9.8 * speed;
2731
1297
  // Inline function 'kotlin.math.atan' call
2732
1298
  // Inline function 'kotlin.math.sin' call
2733
1299
  var x = Math.atan(grade);
2734
1300
  var p = tmp * Math.sin(x);
2735
- path.x1u(pointIndex, p);
1301
+ path.m1v(pointIndex, p);
2736
1302
  return p;
2737
1303
  };
2738
1304
  var GravPowerProvider_instance;
@@ -2740,17 +1306,17 @@
2740
1306
  return GravPowerProvider_instance;
2741
1307
  }
2742
1308
  function Harmonic(freqRadS, phaseRad, amp) {
2743
- this.k1x_1 = freqRadS;
2744
- this.l1x_1 = phaseRad;
2745
- this.m1x_1 = amp;
1309
+ this.p23_1 = freqRadS;
1310
+ this.q23_1 = phaseRad;
1311
+ this.r23_1 = amp;
2746
1312
  }
2747
1313
  protoOf(Harmonic).toString = function () {
2748
- return 'Harmonic(freqRadS=' + this.k1x_1 + ', phaseRad=' + this.l1x_1 + ', amp=' + this.m1x_1 + ')';
1314
+ return 'Harmonic(freqRadS=' + this.p23_1 + ', phaseRad=' + this.q23_1 + ', amp=' + this.r23_1 + ')';
2749
1315
  };
2750
1316
  protoOf(Harmonic).hashCode = function () {
2751
- var result = getNumberHashCode(this.k1x_1);
2752
- result = imul(result, 31) + getNumberHashCode(this.l1x_1) | 0;
2753
- result = imul(result, 31) + getNumberHashCode(this.m1x_1) | 0;
1317
+ var result = getNumberHashCode(this.p23_1);
1318
+ result = imul(result, 31) + getNumberHashCode(this.q23_1) | 0;
1319
+ result = imul(result, 31) + getNumberHashCode(this.r23_1) | 0;
2754
1320
  return result;
2755
1321
  };
2756
1322
  protoOf(Harmonic).equals = function (other) {
@@ -2758,39 +1324,39 @@
2758
1324
  return true;
2759
1325
  if (!(other instanceof Harmonic))
2760
1326
  return false;
2761
- if (!equals(this.k1x_1, other.k1x_1))
1327
+ if (!equals(this.p23_1, other.p23_1))
2762
1328
  return false;
2763
- if (!equals(this.l1x_1, other.l1x_1))
1329
+ if (!equals(this.q23_1, other.q23_1))
2764
1330
  return false;
2765
- if (!equals(this.m1x_1, other.m1x_1))
1331
+ if (!equals(this.r23_1, other.r23_1))
2766
1332
  return false;
2767
1333
  return true;
2768
1334
  };
2769
1335
  function computeCorneringLimit($this, course, currentIndex, window_0) {
2770
- var path = course.e1p_1;
1336
+ var path = course.f1z_1;
2771
1337
  var radius = computeRadiusWindowed($this, path, currentIndex, window_0);
2772
1338
  // Inline function 'kotlin.math.sqrt' call
2773
- var x = 9.8 * radius * course.f1p_1.a1q();
1339
+ var x = 9.8 * radius * course.g1z_1.b20();
2774
1340
  var vMax = Math.sqrt(x);
2775
1341
  // Inline function 'kotlin.math.min' call
2776
- var a = course.f1p_1.c1q();
1342
+ var a = course.g1z_1.d20();
2777
1343
  var result = Math.min(a, vMax);
2778
- path.n1v(currentIndex, result);
1344
+ path.b1w(currentIndex, result);
2779
1345
  return result;
2780
1346
  }
2781
1347
  function computeRadiusWindowed($this, path, i, k) {
2782
1348
  // Inline function 'kotlin.math.max' call
2783
1349
  var b = i - k | 0;
2784
1350
  var mini = Math.max(0, b);
2785
- var tmp0 = path.d1s_1 - 1 | 0;
1351
+ var tmp0 = path.f1r_1 - 1 | 0;
2786
1352
  // Inline function 'kotlin.math.min' call
2787
1353
  var b_0 = i + k | 0;
2788
1354
  var maxi = Math.min(tmp0, b_0);
2789
- var totalBearingChange = $this.o1x(path.o1u(maxi) - path.o1u(mini));
2790
- var totalDistance = path.h1u(maxi) - path.h1u(mini);
1355
+ var totalBearingChange = $this.t23(path.d1v(maxi) - path.d1v(mini));
1356
+ var totalDistance = path.w1u(maxi) - path.w1u(mini);
2791
1357
  // Inline function 'kotlin.math.abs' call
2792
1358
  if (Math.abs(totalBearingChange) < 0.001) {
2793
- path.s1u(i, 200.0);
1359
+ path.h1v(i, 200.0);
2794
1360
  return 200.0;
2795
1361
  }
2796
1362
  // Inline function 'kotlin.math.abs' call
@@ -2799,47 +1365,47 @@
2799
1365
  // Inline function 'kotlin.math.max' call
2800
1366
  var b_1 = Math.min(200.0, raw);
2801
1367
  var clamped = Math.max(5.0, b_1);
2802
- path.s1u(i, clamped);
1368
+ path.h1v(i, clamped);
2803
1369
  return clamped;
2804
1370
  }
2805
1371
  function computeBrakingLimit($this, course, currentIndex, nextIndex) {
2806
- var path = course.e1p_1;
2807
- var vf = path.l1v(nextIndex);
2808
- var a = course.f1p_1.b1q();
2809
- var d = path.h1u(nextIndex) - path.h1u(currentIndex);
1372
+ var path = course.f1z_1;
1373
+ var vf = path.z1v(nextIndex);
1374
+ var a = course.g1z_1.c20();
1375
+ var d = path.w1u(nextIndex) - path.w1u(currentIndex);
2810
1376
  // Inline function 'kotlin.math.sqrt' call
2811
1377
  var x = vf * vf + 2.0 * a * d;
2812
1378
  return Math.sqrt(x);
2813
1379
  }
2814
1380
  function MaxSpeedComputer() {
2815
- this.d1r_1 = 200.0;
2816
- this.e1r_1 = 5.0;
2817
- this.f1r_1 = 2.0;
2818
- this.g1r_1 = 0.001;
2819
- this.h1r_1 = 10;
2820
- }
2821
- protoOf(MaxSpeedComputer).i1r = function (course) {
2822
- var path = course.e1p_1;
2823
- var n = path.d1s_1;
1381
+ this.a21_1 = 200.0;
1382
+ this.b21_1 = 5.0;
1383
+ this.c21_1 = 2.0;
1384
+ this.d21_1 = 0.001;
1385
+ this.e21_1 = 10;
1386
+ }
1387
+ protoOf(MaxSpeedComputer).f21 = function (course) {
1388
+ var path = course.f1z_1;
1389
+ var n = path.f1r_1;
2824
1390
  var inductionVariable = n - 1 | 0;
2825
1391
  if (0 <= inductionVariable)
2826
1392
  do {
2827
1393
  var i = inductionVariable;
2828
1394
  inductionVariable = inductionVariable + -1 | 0;
2829
1395
  if (i === (n - 1 | 0)) {
2830
- path.m1v(i, 2.0);
1396
+ path.a1w(i, 2.0);
2831
1397
  } else {
2832
1398
  var cornering = computeCorneringLimit(this, course, i, 10);
2833
1399
  var braking = computeBrakingLimit(this, course, i, i + 1 | 0);
2834
1400
  // Inline function 'kotlin.math.min' call
2835
1401
  var tmp$ret$0 = Math.min(cornering, braking);
2836
- path.m1v(i, tmp$ret$0);
1402
+ path.a1w(i, tmp$ret$0);
2837
1403
  }
2838
1404
  }
2839
1405
  while (0 <= inductionVariable);
2840
- path.j1t();
1406
+ path.q1s();
2841
1407
  };
2842
- protoOf(MaxSpeedComputer).o1x = function (angleIn) {
1408
+ protoOf(MaxSpeedComputer).t23 = function (angleIn) {
2843
1409
  var a = angleIn;
2844
1410
  while (a > 3.141592653589793)
2845
1411
  a = a - 2.0 * 3.141592653589793;
@@ -2853,11 +1419,11 @@
2853
1419
  }
2854
1420
  function MuscularPowerProvider() {
2855
1421
  }
2856
- protoOf(MuscularPowerProvider).b1x = function (course, path, pointIndex) {
2857
- var muscular = course.o1p_1.b1x(course, path, pointIndex);
2858
- path.d1v(pointIndex, muscular);
2859
- var wheel = muscular * course.r1p().c1p_1;
2860
- path.e1v(pointIndex, wheel);
1422
+ protoOf(MuscularPowerProvider).g23 = function (course, path, pointIndex) {
1423
+ var muscular = course.p1z_1.g23(course, path, pointIndex);
1424
+ path.s1v(pointIndex, muscular);
1425
+ var wheel = muscular * course.s1z().d1z_1;
1426
+ path.t1v(pointIndex, wheel);
2861
1427
  return wheel;
2862
1428
  };
2863
1429
  var MuscularPowerProvider_instance;
@@ -2870,7 +1436,7 @@
2870
1436
  var tol = dx / 1.0E7;
2871
1437
  while (dt2 - dt1 >= tol) {
2872
1438
  var dtMid = (dt1 + dt2) / 2.0;
2873
- var dxMid = $this.p1x(pSum, equivalentMass, currentSpeed, dtMid);
1439
+ var dxMid = $this.u23(pSum, equivalentMass, currentSpeed, dtMid);
2874
1440
  if (dxMid < dx)
2875
1441
  dt1 = dtMid;
2876
1442
  else
@@ -2880,18 +1446,18 @@
2880
1446
  }
2881
1447
  function PowerComputer() {
2882
1448
  }
2883
- protoOf(PowerComputer).n1x = function (course, path, pointIndex, withCyclist) {
1449
+ protoOf(PowerComputer).s23 = function (course, path, pointIndex, withCyclist) {
2884
1450
  var pSum = 0.0;
2885
- pSum = pSum + WheelBearingsPowerProvider_instance.b1x(course, path, pointIndex);
2886
- pSum = pSum + RollingResistancePowerProvider_instance.b1x(course, path, pointIndex);
2887
- pSum = pSum + AeroPowerProvider_instance.b1x(course, path, pointIndex);
2888
- pSum = pSum + GravPowerProvider_instance.b1x(course, path, pointIndex);
1451
+ pSum = pSum + WheelBearingsPowerProvider_instance.g23(course, path, pointIndex);
1452
+ pSum = pSum + RollingResistancePowerProvider_instance.g23(course, path, pointIndex);
1453
+ pSum = pSum + AeroPowerProvider_instance.g23(course, path, pointIndex);
1454
+ pSum = pSum + GravPowerProvider_instance.g23(course, path, pointIndex);
2889
1455
  if (withCyclist) {
2890
- pSum = pSum + MuscularPowerProvider_instance.b1x(course, path, pointIndex);
1456
+ pSum = pSum + MuscularPowerProvider_instance.g23(course, path, pointIndex);
2891
1457
  }
2892
1458
  return pSum;
2893
1459
  };
2894
- protoOf(PowerComputer).p1x = function (pSum, equivalentMass, currentSpeed, dt) {
1460
+ protoOf(PowerComputer).u23 = function (pSum, equivalentMass, currentSpeed, dt) {
2895
1461
  // Inline function 'kotlin.math.sqrt' call
2896
1462
  var x = dt * pSum / (0.5 * equivalentMass) + currentSpeed * currentSpeed;
2897
1463
  var tmp0 = Math.sqrt(x);
@@ -2900,40 +1466,40 @@
2900
1466
  var newSpeed = Math.max(tmp0, b);
2901
1467
  return (currentSpeed + newSpeed) * dt / 2.0;
2902
1468
  };
2903
- protoOf(PowerComputer).q1x = function (equivalentMass, s1, s2, dt) {
1469
+ protoOf(PowerComputer).v23 = function (equivalentMass, s1, s2, dt) {
2904
1470
  return 0.5 * equivalentMass * (s2 * s2 - s1 * s1) / dt;
2905
1471
  };
2906
- protoOf(PowerComputer).r1x = function (pSum, equivalentMass, currentSpeed, dx) {
1472
+ protoOf(PowerComputer).w23 = function (pSum, equivalentMass, currentSpeed, dx) {
2907
1473
  var dt = 0.1;
2908
- while (this.p1x(pSum, equivalentMass, currentSpeed, dt) <= dx) {
1474
+ while (this.u23(pSum, equivalentMass, currentSpeed, dt) <= dx) {
2909
1475
  dt = dt + 0.1;
2910
1476
  }
2911
1477
  return getDtInner(this, pSum, equivalentMass, currentSpeed, dx, dt - 0.1, dt);
2912
1478
  };
2913
- protoOf(PowerComputer).s1x = function (course, path, equivalentMass, i) {
1479
+ protoOf(PowerComputer).x23 = function (course, path, equivalentMass, i) {
2914
1480
  if (i === 0) {
2915
- path.i1v(i, 0.0);
1481
+ path.w1v(i, 0.0);
2916
1482
  return Unit_instance;
2917
1483
  }
2918
- var resistive = this.n1x(course, path, i - 1 | 0, false);
2919
- var s1 = path.j1v(i - 1 | 0);
2920
- var s2 = path.j1v(i);
2921
- var dtSeconds = path.m1u(i) / 1000.0;
2922
- var totPower = this.q1x(equivalentMass, s1, s2, dtSeconds);
2923
- path.f1v(i, totPower);
1484
+ var resistive = this.s23(course, path, i - 1 | 0, false);
1485
+ var s1 = path.x1v(i - 1 | 0);
1486
+ var s2 = path.x1v(i);
1487
+ var dtSeconds = path.b1v(i) / 1000.0;
1488
+ var totPower = this.v23(equivalentMass, s1, s2, dtSeconds);
1489
+ path.u1v(i, totPower);
2924
1490
  var powerWheel = totPower - resistive;
2925
- path.g1v(i, powerWheel);
1491
+ path.v1v(i, powerWheel);
2926
1492
  // Inline function 'kotlin.math.max' call
2927
- var computed = Math.max(0.0, powerWheel) / course.r1p().c1p_1;
2928
- path.i1v(i, computed);
1493
+ var computed = Math.max(0.0, powerWheel) / course.s1z().d1z_1;
1494
+ path.w1v(i, computed);
2929
1495
  };
2930
- protoOf(PowerComputer).t1x = function (course) {
2931
- var m = course.f1p_1.u1p_1;
2932
- var totalInertia = course.g1p_1.z1o_1 + course.g1p_1.a1p_1;
2933
- return m + totalInertia / (course.g1p_1.b1p_1 * course.g1p_1.b1p_1);
1496
+ protoOf(PowerComputer).y23 = function (course) {
1497
+ var m = course.g1z_1.v1z_1;
1498
+ var totalInertia = course.h1z_1.a1z_1 + course.h1z_1.b1z_1;
1499
+ return m + totalInertia / (course.h1z_1.c1z_1 * course.h1z_1.c1z_1);
2934
1500
  };
2935
- protoOf(PowerComputer).u1x = function (course) {
2936
- return this.t1x(course.k1p_1);
1501
+ protoOf(PowerComputer).z23 = function (course) {
1502
+ return this.y23(course.l1z_1);
2937
1503
  };
2938
1504
  var PowerComputer_instance;
2939
1505
  function PowerComputer_getInstance() {
@@ -2943,34 +1509,34 @@
2943
1509
  useHarmonics = useHarmonics === VOID ? false : useHarmonics;
2944
1510
  random = random === VOID ? Default_getInstance() : random;
2945
1511
  CyclistPowerProviderBase.call(this, useHarmonics, random);
2946
- this.x1x_1 = power;
1512
+ this.c24_1 = power;
2947
1513
  }
2948
- protoOf(PowerProviderConstant).j1x = function (course, path, pointIndex) {
2949
- return this.x1x_1;
1514
+ protoOf(PowerProviderConstant).o23 = function (course, path, pointIndex) {
1515
+ return this.c24_1;
2950
1516
  };
2951
1517
  function PowerProviderConstantWithTiring(power, useHarmonics, durationSeconds, random) {
2952
1518
  useHarmonics = useHarmonics === VOID ? false : useHarmonics;
2953
1519
  random = random === VOID ? Default_getInstance() : random;
2954
1520
  CyclistPowerProviderBase.call(this, useHarmonics, random);
2955
- this.a1y_1 = power;
2956
- this.b1y_1 = durationSeconds;
1521
+ this.f24_1 = power;
1522
+ this.g24_1 = durationSeconds;
2957
1523
  // Inline function 'kotlin.require' call
2958
- if (!(this.b1y_1 > 0.0)) {
2959
- var message = 'durationSeconds must be > 0, got ' + this.b1y_1;
1524
+ if (!(this.g24_1 > 0.0)) {
1525
+ var message = 'durationSeconds must be > 0, got ' + this.g24_1;
2960
1526
  throw IllegalArgumentException_init_$Create$(toString(message));
2961
1527
  }
2962
1528
  }
2963
- protoOf(PowerProviderConstantWithTiring).j1x = function (course, path, pointIndex) {
2964
- var elapsedS = path.k1u(pointIndex) / 1000.0;
1529
+ protoOf(PowerProviderConstantWithTiring).o23 = function (course, path, pointIndex) {
1530
+ var elapsedS = path.z1u(pointIndex) / 1000.0;
2965
1531
  // Inline function 'kotlin.math.max' call
2966
- var b = 1.0 - 0.6 * elapsedS / this.b1y_1;
1532
+ var b = 1.0 - 0.6 * elapsedS / this.g24_1;
2967
1533
  var c = Math.max(0.5, b);
2968
- return this.a1y_1 * c;
1534
+ return this.f24_1 * c;
2969
1535
  };
2970
1536
  function PowerProviderFromData() {
2971
1537
  }
2972
- protoOf(PowerProviderFromData).b1x = function (course, path, pointIndex) {
2973
- return path.m1s(pointIndex);
1538
+ protoOf(PowerProviderFromData).g23 = function (course, path, pointIndex) {
1539
+ return path.o1r(pointIndex);
2974
1540
  };
2975
1541
  var PowerProviderFromData_instance;
2976
1542
  function PowerProviderFromData_getInstance() {
@@ -2978,7 +1544,7 @@
2978
1544
  }
2979
1545
  function RhoProviderDefault() {
2980
1546
  }
2981
- protoOf(RhoProviderDefault).e1x = function (course, path, pointIndex) {
1547
+ protoOf(RhoProviderDefault).j23 = function (course, path, pointIndex) {
2982
1548
  return 1.225;
2983
1549
  };
2984
1550
  var RhoProviderDefault_instance;
@@ -2986,16 +1552,16 @@
2986
1552
  return RhoProviderDefault_instance;
2987
1553
  }
2988
1554
  function RhoProviderEstimate() {
2989
- this.c1y_1 = 101325.0;
2990
- this.d1y_1 = 288.15;
2991
- this.e1y_1 = 9.80665;
2992
- this.f1y_1 = 0.0065;
2993
- this.g1y_1 = 287.05;
2994
- }
2995
- protoOf(RhoProviderEstimate).e1x = function (course, path, pointIndex) {
2996
- var providedTemp = path.s1t(pointIndex, PointField_TEMPERATURE_getInstance());
2997
- var temperatureC = isNaN_0(providedTemp) || providedTemp === 0.0 ? 15.0 : providedTemp;
2998
- var providedElevation = path.h1s(pointIndex);
1555
+ this.h24_1 = 101325.0;
1556
+ this.i24_1 = 288.15;
1557
+ this.j24_1 = 9.80665;
1558
+ this.k24_1 = 0.0065;
1559
+ this.l24_1 = 287.05;
1560
+ }
1561
+ protoOf(RhoProviderEstimate).j23 = function (course, path, pointIndex) {
1562
+ var providedTemp = path.y1t(pointIndex, PointField_TEMPERATURE_getInstance());
1563
+ var temperatureC = isNaN_0(providedTemp) ? 15.0 : providedTemp;
1564
+ var providedElevation = path.j1r(pointIndex);
2999
1565
  var altitude = isNaN_0(providedElevation) ? 0.0 : providedElevation;
3000
1566
  var tKelvin = temperatureC + 273.15;
3001
1567
  var tmp0 = 1.0 - 0.0065 * altitude / 288.15;
@@ -3010,17 +1576,17 @@
3010
1576
  }
3011
1577
  function RollingResistancePowerProvider() {
3012
1578
  }
3013
- protoOf(RollingResistancePowerProvider).b1x = function (course, path, pointIndex) {
3014
- var m = course.q1p().u1p_1;
3015
- var crr = course.r1p().y1o_1;
3016
- var grade = path.q1u(pointIndex);
3017
- var speed = path.j1v(pointIndex);
1579
+ protoOf(RollingResistancePowerProvider).g23 = function (course, path, pointIndex) {
1580
+ var m = course.r1z().v1z_1;
1581
+ var crr = course.s1z().z1y_1;
1582
+ var grade = path.f1v(pointIndex);
1583
+ var speed = path.x1v(pointIndex);
3018
1584
  // Inline function 'kotlin.math.atan' call
3019
1585
  // Inline function 'kotlin.math.cos' call
3020
1586
  var x = Math.atan(grade);
3021
1587
  var coef = Math.cos(x);
3022
1588
  var p = -coef * m * 9.8 * speed * crr;
3023
- path.y1u(pointIndex, p);
1589
+ path.n1v(pointIndex, p);
3024
1590
  return p;
3025
1591
  };
3026
1592
  var RollingResistancePowerProvider_instance;
@@ -3028,18 +1594,18 @@
3028
1594
  return RollingResistancePowerProvider_instance;
3029
1595
  }
3030
1596
  function copyAllFields($this, src, i, dst, j) {
3031
- var _iterator__ex2g4s = get_entries().h();
3032
- while (_iterator__ex2g4s.i()) {
3033
- var field = _iterator__ex2g4s.j();
3034
- dst.t1t(j, field, src.s1t(i, field));
1597
+ var _iterator__ex2g4s = get_entries().i();
1598
+ while (_iterator__ex2g4s.j()) {
1599
+ var field = _iterator__ex2g4s.k();
1600
+ dst.f1u(j, field, src.y1t(i, field));
3035
1601
  }
3036
1602
  }
3037
1603
  function VirtualizeService() {
3038
- this.j1r_1 = 100000;
1604
+ this.g21_1 = 100000;
3039
1605
  }
3040
- protoOf(VirtualizeService).k1r = function (course) {
3041
- var input = course.p1p();
3042
- var n = input.d1s_1;
1606
+ protoOf(VirtualizeService).h21 = function (course) {
1607
+ var input = course.q1z();
1608
+ var n = input.f1r_1;
3043
1609
  if (n === 0)
3044
1610
  return new Path(0);
3045
1611
  if (n === 1) {
@@ -3047,54 +1613,54 @@
3047
1613
  copyAllFields(this, input, 0, singleton, 0);
3048
1614
  return singleton;
3049
1615
  }
3050
- var mEq = PowerComputer_instance.u1x(course);
1616
+ var mEq = PowerComputer_instance.z23(course);
3051
1617
  var out = new Path(n);
3052
1618
  copyAllFields(this, input, 0, out, 0);
3053
1619
  var speed = 0.5555555555555556;
3054
1620
  var startTimeMs = 0.0;
3055
1621
  var timeMs = startTimeMs;
3056
- out.v1s(0, timeMs);
3057
- out.l1u(0, 0.0);
3058
- out.k1v(0, speed);
3059
- out.o1v(0, speed);
1622
+ out.c1s(0, timeMs);
1623
+ out.a1v(0, 0.0);
1624
+ out.y1v(0, speed);
1625
+ out.c1w(0, speed);
3060
1626
  var i = 1;
3061
1627
  var iter = 0;
3062
1628
  $l$loop: while (i < n) {
3063
- var dx = input.h1u(i) - input.h1u(i - 1 | 0);
3064
- var pSum = PowerComputer_instance.n1x(course, out, i - 1 | 0, true);
3065
- var dt = PowerComputer_instance.r1x(pSum, mEq, speed, dx);
1629
+ var dx = input.w1u(i) - input.w1u(i - 1 | 0);
1630
+ var pSum = PowerComputer_instance.s23(course, out, i - 1 | 0, true);
1631
+ var dt = PowerComputer_instance.w23(pSum, mEq, speed, dx);
3066
1632
  var speedNew = 2.0 * dx / dt - speed;
3067
1633
  copyAllFields(this, input, i, out, i);
3068
- var speedMax = input.l1v(i);
1634
+ var speedMax = input.z1v(i);
3069
1635
  if (speedNew > speedMax) {
3070
1636
  speedNew = speedMax;
3071
1637
  dt = 2.0 * dx / (speedNew + speed);
3072
1638
  }
3073
1639
  speed = speedNew;
3074
1640
  timeMs = timeMs + dt * 1000.0;
3075
- out.v1s(i, timeMs);
3076
- out.l1u(i, timeMs - startTimeMs);
3077
- out.j1u(i, dx);
3078
- out.n1u(i, dt * 1000.0);
3079
- out.k1v(i, speed);
3080
- out.o1v(i, speed);
1641
+ out.c1s(i, timeMs);
1642
+ out.a1v(i, timeMs - startTimeMs);
1643
+ out.y1u(i, dx);
1644
+ out.c1v(i, dt * 1000.0);
1645
+ out.y1v(i, speed);
1646
+ out.c1w(i, speed);
3081
1647
  i = i + 1 | 0;
3082
1648
  var _unary__edvuaz = iter;
3083
1649
  iter = _unary__edvuaz + 1 | 0;
3084
1650
  if (_unary__edvuaz > 100000)
3085
1651
  break $l$loop;
3086
1652
  }
3087
- var progression = out.w1v();
3088
- var inductionVariable = progression.bc_1;
3089
- var last = progression.cc_1;
1653
+ var progression = out.k1w();
1654
+ var inductionVariable = progression.lc_1;
1655
+ var last = progression.mc_1;
3090
1656
  if (inductionVariable <= last)
3091
1657
  do {
3092
1658
  var j = inductionVariable;
3093
1659
  inductionVariable = inductionVariable + 1 | 0;
3094
- PowerComputer_instance.s1x(course, out, mEq, j);
1660
+ PowerComputer_instance.x23(course, out, mEq, j);
3095
1661
  }
3096
1662
  while (!(j === last));
3097
- out.j1t();
1663
+ out.q1s();
3098
1664
  return out;
3099
1665
  };
3100
1666
  var VirtualizeService_instance;
@@ -3103,37 +1669,37 @@
3103
1669
  }
3104
1670
  function WheelBearingsPowerProvider() {
3105
1671
  }
3106
- protoOf(WheelBearingsPowerProvider).b1x = function (course, path, pointIndex) {
3107
- var speed = path.j1v(pointIndex);
1672
+ protoOf(WheelBearingsPowerProvider).g23 = function (course, path, pointIndex) {
1673
+ var speed = path.x1v(pointIndex);
3108
1674
  var p = -speed * (91.0 + 8.7 * speed) / 1000.0;
3109
- path.z1u(pointIndex, p);
1675
+ path.o1v(pointIndex, p);
3110
1676
  return p;
3111
1677
  };
3112
1678
  var WheelBearingsPowerProvider_instance;
3113
1679
  function WheelBearingsPowerProvider_getInstance() {
3114
1680
  return WheelBearingsPowerProvider_instance;
3115
1681
  }
3116
- function Companion_7() {
3117
- Companion_instance_7 = this;
3118
- this.h1y_1 = new Wind(0.0, 0.0);
1682
+ function Companion_6() {
1683
+ Companion_instance_6 = this;
1684
+ this.m24_1 = new Wind(0.0, 0.0);
3119
1685
  }
3120
- var Companion_instance_7;
3121
- function Companion_getInstance_8() {
3122
- if (Companion_instance_7 == null)
3123
- new Companion_7();
3124
- return Companion_instance_7;
1686
+ var Companion_instance_6;
1687
+ function Companion_getInstance_9() {
1688
+ if (Companion_instance_6 == null)
1689
+ new Companion_6();
1690
+ return Companion_instance_6;
3125
1691
  }
3126
1692
  function Wind(speedMS, directionRad) {
3127
- Companion_getInstance_8();
3128
- this.y1w_1 = speedMS;
3129
- this.z1w_1 = directionRad;
1693
+ Companion_getInstance_9();
1694
+ this.d23_1 = speedMS;
1695
+ this.e23_1 = directionRad;
3130
1696
  }
3131
1697
  protoOf(Wind).toString = function () {
3132
- return 'Wind(speedMS=' + this.y1w_1 + ', directionRad=' + this.z1w_1 + ')';
1698
+ return 'Wind(speedMS=' + this.d23_1 + ', directionRad=' + this.e23_1 + ')';
3133
1699
  };
3134
1700
  protoOf(Wind).hashCode = function () {
3135
- var result = getNumberHashCode(this.y1w_1);
3136
- result = imul(result, 31) + getNumberHashCode(this.z1w_1) | 0;
1701
+ var result = getNumberHashCode(this.d23_1);
1702
+ result = imul(result, 31) + getNumberHashCode(this.e23_1) | 0;
3137
1703
  return result;
3138
1704
  };
3139
1705
  protoOf(Wind).equals = function (other) {
@@ -3141,50 +1707,114 @@
3141
1707
  return true;
3142
1708
  if (!(other instanceof Wind))
3143
1709
  return false;
3144
- if (!equals(this.y1w_1, other.y1w_1))
1710
+ if (!equals(this.d23_1, other.d23_1))
3145
1711
  return false;
3146
- if (!equals(this.z1w_1, other.z1w_1))
1712
+ if (!equals(this.e23_1, other.e23_1))
3147
1713
  return false;
3148
1714
  return true;
3149
1715
  };
3150
1716
  function WindProviderNone() {
3151
1717
  }
3152
- protoOf(WindProviderNone).d1x = function (course, path, pointIndex) {
3153
- return Companion_getInstance_8().h1y_1;
1718
+ protoOf(WindProviderNone).i23 = function (course, path, pointIndex) {
1719
+ return Companion_getInstance_9().m24_1;
3154
1720
  };
3155
1721
  var WindProviderNone_instance;
3156
1722
  function WindProviderNone_getInstance() {
3157
1723
  return WindProviderNone_instance;
3158
1724
  }
3159
1725
  function WindProviderConstant(wind) {
3160
- this.i1y_1 = wind;
1726
+ this.n24_1 = wind;
3161
1727
  }
3162
- protoOf(WindProviderConstant).d1x = function (course, path, pointIndex) {
3163
- return this.i1y_1;
1728
+ protoOf(WindProviderConstant).i23 = function (course, path, pointIndex) {
1729
+ return this.n24_1;
3164
1730
  };
1731
+ function parseGpxWaypoints(xml) {
1732
+ // Inline function 'kotlin.collections.map' call
1733
+ var this_0 = GpxParser_instance.y1r(xml).n1q_1;
1734
+ // Inline function 'kotlin.collections.mapTo' call
1735
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
1736
+ var _iterator__ex2g4s = this_0.i();
1737
+ while (_iterator__ex2g4s.j()) {
1738
+ var item = _iterator__ex2g4s.k();
1739
+ var tmp$ret$2 = waypointObj(item);
1740
+ destination.h(tmp$ret$2);
1741
+ }
1742
+ // Inline function 'kotlin.collections.toTypedArray' call
1743
+ return copyToArray(destination);
1744
+ }
3165
1745
  function parseGpx(xml) {
3166
- return firstTrackAsPath(GpxParser_instance.r1s(xml));
1746
+ return firstTrackAsPath(GpxParser_instance.y1r(xml));
1747
+ }
1748
+ function parseGpxTracks(xml) {
1749
+ // Inline function 'kotlin.collections.toTypedArray' call
1750
+ var this_0 = tracksAsPaths(GpxParser_instance.y1r(xml));
1751
+ return copyToArray(this_0);
1752
+ }
1753
+ function parseGpxSegments(xml) {
1754
+ // Inline function 'kotlin.collections.toTypedArray' call
1755
+ var this_0 = segmentsAsPaths(GpxParser_instance.y1r(xml));
1756
+ return copyToArray(this_0);
1757
+ }
1758
+ function parseGpxTracksOnly(xml) {
1759
+ // Inline function 'kotlin.collections.toTypedArray' call
1760
+ var this_0 = tracksAsPaths(GpxParser_instance.y1r(xml), setOf(GpxPathKind_TRACK_getInstance()));
1761
+ return copyToArray(this_0);
1762
+ }
1763
+ function parseGpxRoutesOnly(xml) {
1764
+ // Inline function 'kotlin.collections.toTypedArray' call
1765
+ var this_0 = tracksAsPaths(GpxParser_instance.y1r(xml), setOf(GpxPathKind_ROUTE_getInstance()));
1766
+ return copyToArray(this_0);
1767
+ }
1768
+ function writeGpxTracks(paths, waypoints, writeExtensions) {
1769
+ var tmp;
1770
+ if (waypoints === VOID) {
1771
+ // Inline function 'kotlin.emptyArray' call
1772
+ tmp = [];
1773
+ } else {
1774
+ tmp = waypoints;
1775
+ }
1776
+ waypoints = tmp;
1777
+ writeExtensions = writeExtensions === VOID ? true : writeExtensions;
1778
+ var tmp_0 = GpxWriter_instance;
1779
+ var tmp_1 = toList(paths);
1780
+ // Inline function 'kotlin.collections.map' call
1781
+ // Inline function 'kotlin.collections.mapTo' call
1782
+ var destination = ArrayList_init_$Create$_0(waypoints.length);
1783
+ var inductionVariable = 0;
1784
+ var last = waypoints.length;
1785
+ while (inductionVariable < last) {
1786
+ var item = waypoints[inductionVariable];
1787
+ inductionVariable = inductionVariable + 1 | 0;
1788
+ var tmp$ret$3 = toGpxWaypoint(item);
1789
+ destination.h(tmp$ret$3);
1790
+ }
1791
+ return tmp_0.a1t(tmp_1, VOID, VOID, destination, VOID, writeExtensions);
3167
1792
  }
3168
1793
  function pathSize(path) {
3169
- return path.d1s_1;
1794
+ return path.f1r_1;
3170
1795
  }
3171
1796
  function pathTotalDistance(path) {
3172
- return path.c1t_1;
1797
+ return path.j1s_1;
3173
1798
  }
3174
1799
  function pathDurationMs(path) {
3175
- return path.h1t_1;
1800
+ return path.o1s_1;
3176
1801
  }
3177
1802
  function pathElevationGain(path) {
3178
- return path.f1t_1;
1803
+ return path.m1s_1;
3179
1804
  }
3180
1805
  function pathElevationLoss(path) {
3181
- return path.g1t_1;
1806
+ return path.n1s_1;
3182
1807
  }
3183
1808
  function pointAt(path, i) {
3184
- return pointObj(path.x1v(i), path.y1v(i), path.h1s(i), path.i1s(i), path.j1v(i), path.h1v(i), path.h1u(i), path.q1u(i));
1809
+ return pointObj(path.l1w(i), path.m1w(i), path.j1r(i), path.k1r(i), path.x1v(i), path.p1r(i), path.w1u(i), path.f1v(i));
1810
+ }
1811
+ function writeGpx(path, writeExtensions) {
1812
+ writeExtensions = writeExtensions === VOID ? true : writeExtensions;
1813
+ return GpxWriter_instance.y1s(toGpxDocument(path, VOID, 'virtualized'), writeExtensions);
3185
1814
  }
3186
- function writeGpx(path) {
3187
- return GpxWriter_instance.r1t(toGpxDocument(path, VOID, 'virtualized'));
1815
+ function writeGpxAt(path, startTimeEpochMs, writeExtensions) {
1816
+ writeExtensions = writeExtensions === VOID ? true : writeExtensions;
1817
+ return GpxWriter_instance.y1s(toGpxDocument(path, VOID, 'virtualized', Companion_getInstance().nd(numberToLong(startTimeEpochMs))), writeExtensions);
3188
1818
  }
3189
1819
  function enhance(path, options) {
3190
1820
  var tmp = GlobalScope_instance;
@@ -3195,7 +1825,7 @@
3195
1825
  return promise(tmp, VOID, VOID, enhanceWithCourse$slambda_0(options, path, cyclist, bike, wind, power, null));
3196
1826
  }
3197
1827
  function getField(path, i, fieldProp) {
3198
- var tmp0_elvis_lhs = Companion_getInstance_6().k1w(fieldProp);
1828
+ var tmp0_elvis_lhs = Companion_getInstance_0().r1w(fieldProp);
3199
1829
  var tmp;
3200
1830
  if (tmp0_elvis_lhs == null) {
3201
1831
  // Inline function 'kotlin.error' call
@@ -3205,35 +1835,111 @@
3205
1835
  tmp = tmp0_elvis_lhs;
3206
1836
  }
3207
1837
  var field = tmp;
3208
- return path.s1t(i, field);
1838
+ return path.y1t(i, field);
3209
1839
  }
3210
1840
  function fieldDefinitions() {
3211
1841
  // Inline function 'kotlin.collections.map' call
3212
1842
  var this_0 = get_entries();
3213
1843
  // Inline function 'kotlin.collections.mapTo' call
3214
- var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
3215
- var _iterator__ex2g4s = this_0.h();
3216
- while (_iterator__ex2g4s.i()) {
3217
- var item = _iterator__ex2g4s.j();
1844
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
1845
+ var _iterator__ex2g4s = this_0.i();
1846
+ while (_iterator__ex2g4s.j()) {
1847
+ var item = _iterator__ex2g4s.k();
3218
1848
  var o = {};
3219
- o.prop = item.e1w_1;
3220
- o.unit = item.f1w_1;
3221
- o.shortDescription = item.g1w_1;
3222
- o.categoryId = item.h1w_1.n1w_1;
3223
- o.categoryName = item.h1w_1.o1w_1;
3224
- o.notSelectable = item.i1w_1;
3225
- o.anglesInRadians = item.j1w_1;
1849
+ o.prop = item.m1t_1;
1850
+ o.unit = item.n1t_1;
1851
+ o.shortDescription = item.o1t_1;
1852
+ o.categoryId = item.p1t_1.u1w_1;
1853
+ o.categoryName = item.p1t_1.v1w_1;
1854
+ o.notSelectable = item.q1t_1;
1855
+ o.anglesInRadians = item.r1t_1;
3226
1856
  // Inline function 'kotlin.js.unsafeCast' call
3227
- destination.n(o);
1857
+ destination.h(o);
3228
1858
  }
3229
1859
  // Inline function 'kotlin.collections.toTypedArray' call
3230
1860
  return copyToArray(destination);
3231
1861
  }
3232
1862
  function pathLatitudeDeg(path, i) {
3233
- return path.x1v(i);
1863
+ return path.l1w(i);
3234
1864
  }
3235
1865
  function pathLongitudeDeg(path, i) {
3236
- return path.y1v(i);
1866
+ return path.m1w(i);
1867
+ }
1868
+ function pathToCsv(path, separator, unitsInHeader) {
1869
+ var tmp = CsvWriter_instance;
1870
+ var tmp0_elvis_lhs = firstOrNull(separator);
1871
+ var tmp_0;
1872
+ var tmp_1 = tmp0_elvis_lhs;
1873
+ if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
1874
+ tmp_0 = _Char___init__impl__6a9atx(44);
1875
+ } else {
1876
+ tmp_0 = tmp0_elvis_lhs;
1877
+ }
1878
+ return tmp.x1t(path, new CsvOptions(VOID, tmp_0, unitsInHeader));
1879
+ }
1880
+ function pathToJson(path, pretty) {
1881
+ return JsonWriter_instance.e1u(path, new JsonOptions(VOID, pretty));
1882
+ }
1883
+ function pathToFit(path, name, startTimeEpochMs) {
1884
+ return toFitBytes(path, name, Companion_getInstance().nd(numberToLong(startTimeEpochMs)));
1885
+ }
1886
+ function pathsToFit(paths, name, startTimeEpochMs, interPathGapMs) {
1887
+ interPathGapMs = interPathGapMs === VOID ? 0.0 : interPathGapMs;
1888
+ var tmp = toList(paths);
1889
+ var tmp_0 = Companion_getInstance().nd(numberToLong(startTimeEpochMs));
1890
+ Companion_getInstance_1();
1891
+ // Inline function 'kotlin.time.Companion.milliseconds' call
1892
+ var this_0 = numberToLong(interPathGapMs);
1893
+ var tmp$ret$0 = toDuration(this_0, DurationUnit_MILLISECONDS_getInstance());
1894
+ return toFitBytes_0(tmp, name, tmp_0, VOID, tmp$ret$0);
1895
+ }
1896
+ function dominantHeadwindAzimuth(path) {
1897
+ return dominantHeadwindAzimuthDeg(path);
1898
+ }
1899
+ function dominantHeadwindAzimuthOfTracks(paths) {
1900
+ return dominantHeadwindAzimuthDeg_0(toList(paths));
1901
+ }
1902
+ function detectClimbs(path) {
1903
+ // Inline function 'kotlin.collections.map' call
1904
+ var this_0 = ClimbDetector_instance.c23(path);
1905
+ // Inline function 'kotlin.collections.mapTo' call
1906
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
1907
+ var _iterator__ex2g4s = this_0.i();
1908
+ while (_iterator__ex2g4s.j()) {
1909
+ var item = _iterator__ex2g4s.k();
1910
+ var tmp$ret$2 = toDto_0(item);
1911
+ destination.h(tmp$ret$2);
1912
+ }
1913
+ // Inline function 'kotlin.collections.toTypedArray' call
1914
+ return copyToArray(destination);
1915
+ }
1916
+ function detectClimbsWithOptions(path, minMinClimbElevationM, maxMinClimbElevationM, minClimbElevationRatio, minGradePercent, maxDiffRealGrade, booster) {
1917
+ // Inline function 'kotlin.collections.map' call
1918
+ var this_0 = ClimbDetector_instance.b23(path, new ClimbOptions(minMinClimbElevationM, maxMinClimbElevationM, minClimbElevationRatio, minGradePercent, maxDiffRealGrade, booster));
1919
+ // Inline function 'kotlin.collections.mapTo' call
1920
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
1921
+ var _iterator__ex2g4s = this_0.i();
1922
+ while (_iterator__ex2g4s.j()) {
1923
+ var item = _iterator__ex2g4s.k();
1924
+ var tmp$ret$2 = toDto_0(item);
1925
+ destination.h(tmp$ret$2);
1926
+ }
1927
+ // Inline function 'kotlin.collections.toTypedArray' call
1928
+ return copyToArray(destination);
1929
+ }
1930
+ function waypointObj(w) {
1931
+ var o = {};
1932
+ o.latitudeDeg = w.d1q_1;
1933
+ o.longitudeDeg = w.e1q_1;
1934
+ o.elevationM = w.f1q_1;
1935
+ o.name = w.g1q_1;
1936
+ o.description = w.h1q_1;
1937
+ o.symbol = w.i1q_1;
1938
+ o.type = w.j1q_1;
1939
+ var tmp0_safe_receiver = w.k1q_1;
1940
+ o.timeEpochMs = tmp0_safe_receiver == null ? null : toNumber(tmp0_safe_receiver);
1941
+ // Inline function 'kotlin.js.unsafeCast' call
1942
+ return o;
3237
1943
  }
3238
1944
  function pointObj(latitudeDeg, longitudeDeg, elevation, timeMs, speed, pComputedPower, distance, grade) {
3239
1945
  var o = {};
@@ -3248,6 +1954,17 @@
3248
1954
  // Inline function 'kotlin.js.unsafeCast' call
3249
1955
  return o;
3250
1956
  }
1957
+ function toGpxWaypoint(_this__u8e3s4) {
1958
+ var tmp = _this__u8e3s4.latitudeDeg;
1959
+ var tmp_0 = _this__u8e3s4.longitudeDeg;
1960
+ var tmp_1 = _this__u8e3s4.elevationM;
1961
+ var tmp_2 = _this__u8e3s4.name;
1962
+ var tmp_3 = _this__u8e3s4.description;
1963
+ var tmp_4 = _this__u8e3s4.symbol;
1964
+ var tmp_5 = _this__u8e3s4.type;
1965
+ var tmp0_safe_receiver = _this__u8e3s4.timeEpochMs;
1966
+ return new GpxWaypoint(tmp, tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, tmp_5, tmp0_safe_receiver == null ? null : numberToLong(tmp0_safe_receiver));
1967
+ }
3251
1968
  function toEnhanceOptions(_this__u8e3s4) {
3252
1969
  if (_this__u8e3s4 == null)
3253
1970
  return defaultJsOptions();
@@ -3314,32 +2031,73 @@
3314
2031
  }
3315
2032
  return tmp;
3316
2033
  }
2034
+ function toDto(_this__u8e3s4) {
2035
+ var o = {};
2036
+ o.startDistanceM = _this__u8e3s4.y21_1;
2037
+ o.endDistanceM = _this__u8e3s4.z21_1;
2038
+ o.startElevationM = _this__u8e3s4.a22_1;
2039
+ o.endElevationM = _this__u8e3s4.b22_1;
2040
+ o.lengthM = _this__u8e3s4.u21();
2041
+ o.elevationGainM = _this__u8e3s4.v21();
2042
+ o.grade = _this__u8e3s4.c22();
2043
+ // Inline function 'kotlin.js.unsafeCast' call
2044
+ return o;
2045
+ }
2046
+ function toDto_0(_this__u8e3s4) {
2047
+ var o = {};
2048
+ o.startIndex = _this__u8e3s4.l21_1;
2049
+ o.endIndex = _this__u8e3s4.m21_1;
2050
+ o.startDistanceM = _this__u8e3s4.n21_1;
2051
+ o.endDistanceM = _this__u8e3s4.o21_1;
2052
+ o.startElevationM = _this__u8e3s4.p21_1;
2053
+ o.endElevationM = _this__u8e3s4.q21_1;
2054
+ o.lengthM = _this__u8e3s4.u21();
2055
+ o.elevationGainM = _this__u8e3s4.v21();
2056
+ o.averageGrade = _this__u8e3s4.w21();
2057
+ o.climbingGrade = _this__u8e3s4.x21();
2058
+ o.positiveElevationM = _this__u8e3s4.r21_1;
2059
+ o.negativeElevationM = _this__u8e3s4.s21_1;
2060
+ // Inline function 'kotlin.collections.map' call
2061
+ var this_0 = _this__u8e3s4.t21_1;
2062
+ // Inline function 'kotlin.collections.mapTo' call
2063
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
2064
+ var _iterator__ex2g4s = this_0.i();
2065
+ while (_iterator__ex2g4s.j()) {
2066
+ var item = _iterator__ex2g4s.k();
2067
+ var tmp$ret$2 = toDto(item);
2068
+ destination.h(tmp$ret$2);
2069
+ }
2070
+ // Inline function 'kotlin.collections.toTypedArray' call
2071
+ o.parts = copyToArray(destination);
2072
+ // Inline function 'kotlin.js.unsafeCast' call
2073
+ return o;
2074
+ }
3317
2075
  function enhance$slambda($options, $path, resultContinuation) {
3318
- this.r1y_1 = $options;
3319
- this.s1y_1 = $path;
2076
+ this.w24_1 = $options;
2077
+ this.x24_1 = $path;
3320
2078
  CoroutineImpl.call(this, resultContinuation);
3321
2079
  }
3322
- protoOf(enhance$slambda).u1y = function ($this$promise, $completion) {
3323
- var tmp = this.q10($this$promise, $completion);
3324
- tmp.i6_1 = Unit_instance;
3325
- tmp.j6_1 = null;
3326
- return tmp.o6();
2080
+ protoOf(enhance$slambda).z24 = function ($this$promise, $completion) {
2081
+ var tmp = this.l11($this$promise, $completion);
2082
+ tmp.j6_1 = Unit_instance;
2083
+ tmp.k6_1 = null;
2084
+ return tmp.p6();
3327
2085
  };
3328
- protoOf(enhance$slambda).w6 = function (p1, $completion) {
3329
- return this.u1y((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
2086
+ protoOf(enhance$slambda).x6 = function (p1, $completion) {
2087
+ return this.z24((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
3330
2088
  };
3331
- protoOf(enhance$slambda).o6 = function () {
3332
- var suspendResult = this.i6_1;
2089
+ protoOf(enhance$slambda).p6 = function () {
2090
+ var suspendResult = this.j6_1;
3333
2091
  $sm: do
3334
2092
  try {
3335
- var tmp = this.g6_1;
2093
+ var tmp = this.h6_1;
3336
2094
  switch (tmp) {
3337
2095
  case 0:
3338
- this.h6_1 = 2;
3339
- var opts = toEnhanceOptions(this.r1y_1);
3340
- var provider = opts.h1q_1 ? new ElevationProvider() : null;
3341
- this.g6_1 = 1;
3342
- suspendResult = Enhancer_instance.o1r(this.s1y_1, provider, opts, this);
2096
+ this.i6_1 = 2;
2097
+ var opts = toEnhanceOptions(this.w24_1);
2098
+ var provider = opts.i20_1 ? new ElevationProvider() : null;
2099
+ this.h6_1 = 1;
2100
+ suspendResult = Enhancer_instance.j21(this.x24_1, provider, opts, this);
3343
2101
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
3344
2102
  return suspendResult;
3345
2103
  }
@@ -3348,61 +2106,61 @@
3348
2106
  case 1:
3349
2107
  return suspendResult;
3350
2108
  case 2:
3351
- throw this.j6_1;
2109
+ throw this.k6_1;
3352
2110
  }
3353
2111
  } catch ($p) {
3354
2112
  var e = $p;
3355
- if (this.h6_1 === 2) {
2113
+ if (this.i6_1 === 2) {
3356
2114
  throw e;
3357
2115
  } else {
3358
- this.g6_1 = this.h6_1;
3359
- this.j6_1 = e;
2116
+ this.h6_1 = this.i6_1;
2117
+ this.k6_1 = e;
3360
2118
  }
3361
2119
  }
3362
2120
  while (true);
3363
2121
  };
3364
- protoOf(enhance$slambda).q10 = function ($this$promise, completion) {
3365
- var i = new enhance$slambda(this.r1y_1, this.s1y_1, completion);
3366
- i.t1y_1 = $this$promise;
2122
+ protoOf(enhance$slambda).l11 = function ($this$promise, completion) {
2123
+ var i = new enhance$slambda(this.w24_1, this.x24_1, completion);
2124
+ i.y24_1 = $this$promise;
3367
2125
  return i;
3368
2126
  };
3369
2127
  function enhance$slambda_0($options, $path, resultContinuation) {
3370
2128
  var i = new enhance$slambda($options, $path, resultContinuation);
3371
2129
  return constructCallableReference(function ($this$promise, $completion) {
3372
- return i.u1y($this$promise, $completion);
2130
+ return i.z24($this$promise, $completion);
3373
2131
  }, 1);
3374
2132
  }
3375
2133
  function enhanceWithCourse$slambda($options, $path, $cyclist, $bike, $wind, $power, resultContinuation) {
3376
- this.d1z_1 = $options;
3377
- this.e1z_1 = $path;
3378
- this.f1z_1 = $cyclist;
3379
- this.g1z_1 = $bike;
3380
- this.h1z_1 = $wind;
3381
- this.i1z_1 = $power;
2134
+ this.i25_1 = $options;
2135
+ this.j25_1 = $path;
2136
+ this.k25_1 = $cyclist;
2137
+ this.l25_1 = $bike;
2138
+ this.m25_1 = $wind;
2139
+ this.n25_1 = $power;
3382
2140
  CoroutineImpl.call(this, resultContinuation);
3383
2141
  }
3384
- protoOf(enhanceWithCourse$slambda).u1y = function ($this$promise, $completion) {
3385
- var tmp = this.q10($this$promise, $completion);
3386
- tmp.i6_1 = Unit_instance;
3387
- tmp.j6_1 = null;
3388
- return tmp.o6();
2142
+ protoOf(enhanceWithCourse$slambda).z24 = function ($this$promise, $completion) {
2143
+ var tmp = this.l11($this$promise, $completion);
2144
+ tmp.j6_1 = Unit_instance;
2145
+ tmp.k6_1 = null;
2146
+ return tmp.p6();
3389
2147
  };
3390
- protoOf(enhanceWithCourse$slambda).w6 = function (p1, $completion) {
3391
- return this.u1y((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
2148
+ protoOf(enhanceWithCourse$slambda).x6 = function (p1, $completion) {
2149
+ return this.z24((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
3392
2150
  };
3393
- protoOf(enhanceWithCourse$slambda).o6 = function () {
3394
- var suspendResult = this.i6_1;
2151
+ protoOf(enhanceWithCourse$slambda).p6 = function () {
2152
+ var suspendResult = this.j6_1;
3395
2153
  $sm: do
3396
2154
  try {
3397
- var tmp = this.g6_1;
2155
+ var tmp = this.h6_1;
3398
2156
  switch (tmp) {
3399
2157
  case 0:
3400
- this.h6_1 = 2;
3401
- var opts = toEnhanceOptions(this.d1z_1);
3402
- var provider = opts.h1q_1 ? new ElevationProvider() : null;
3403
- var course = new CoursePhysics(new Course(this.e1z_1, toCyclist(this.f1z_1), toBike(this.g1z_1)), RhoProviderEstimate_instance, AeroProviderConstant_instance, toWindProvider(this.h1z_1), toCyclistPowerProvider(this.i1z_1));
3404
- this.g6_1 = 1;
3405
- suspendResult = Enhancer_instance.p1r(course, opts, provider, this);
2158
+ this.i6_1 = 2;
2159
+ var opts = toEnhanceOptions(this.i25_1);
2160
+ var provider = opts.i20_1 ? new ElevationProvider() : null;
2161
+ var course = new CoursePhysics(new Course(this.j25_1, toCyclist(this.k25_1), toBike(this.l25_1)), RhoProviderEstimate_instance, AeroProviderConstant_instance, toWindProvider(this.m25_1), toCyclistPowerProvider(this.n25_1));
2162
+ this.h6_1 = 1;
2163
+ suspendResult = Enhancer_instance.k21(course, opts, provider, this);
3406
2164
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
3407
2165
  return suspendResult;
3408
2166
  }
@@ -3411,42 +2169,37 @@
3411
2169
  case 1:
3412
2170
  return suspendResult;
3413
2171
  case 2:
3414
- throw this.j6_1;
2172
+ throw this.k6_1;
3415
2173
  }
3416
2174
  } catch ($p) {
3417
2175
  var e = $p;
3418
- if (this.h6_1 === 2) {
2176
+ if (this.i6_1 === 2) {
3419
2177
  throw e;
3420
2178
  } else {
3421
- this.g6_1 = this.h6_1;
3422
- this.j6_1 = e;
2179
+ this.h6_1 = this.i6_1;
2180
+ this.k6_1 = e;
3423
2181
  }
3424
2182
  }
3425
2183
  while (true);
3426
2184
  };
3427
- protoOf(enhanceWithCourse$slambda).q10 = function ($this$promise, completion) {
3428
- var i = new enhanceWithCourse$slambda(this.d1z_1, this.e1z_1, this.f1z_1, this.g1z_1, this.h1z_1, this.i1z_1, completion);
3429
- i.j1z_1 = $this$promise;
2185
+ protoOf(enhanceWithCourse$slambda).l11 = function ($this$promise, completion) {
2186
+ var i = new enhanceWithCourse$slambda(this.i25_1, this.j25_1, this.k25_1, this.l25_1, this.m25_1, this.n25_1, completion);
2187
+ i.o25_1 = $this$promise;
3430
2188
  return i;
3431
2189
  };
3432
2190
  function enhanceWithCourse$slambda_0($options, $path, $cyclist, $bike, $wind, $power, resultContinuation) {
3433
2191
  var i = new enhanceWithCourse$slambda($options, $path, $cyclist, $bike, $wind, $power, resultContinuation);
3434
2192
  return constructCallableReference(function ($this$promise, $completion) {
3435
- return i.u1y($this$promise, $completion);
2193
+ return i.z24($this$promise, $completion);
3436
2194
  }, 1);
3437
2195
  }
3438
2196
  //region block: init
3439
2197
  Enhancer_instance = new Enhancer();
3440
- GpxParser_instance = new GpxParser();
3441
- GpxWriter_instance = new GpxWriter();
3442
- ElevationStep_instance = new ElevationStep();
3443
2198
  Companion_instance_4 = new Companion_4();
3444
- PathSimplifier_instance = new PathSimplifier();
3445
- PointPerDistance_instance = new PointPerDistance();
3446
- PointPerSecond_instance = new PointPerSecond();
2199
+ ClimbDetector_instance = new ClimbDetector();
3447
2200
  AeroPowerProvider_instance = new AeroPowerProvider();
3448
2201
  AeroProviderConstant_instance = new AeroProviderConstant();
3449
- Companion_instance_6 = new Companion_6();
2202
+ Companion_instance_5 = new Companion_5();
3450
2203
  GravPowerProvider_instance = new GravPowerProvider();
3451
2204
  MaxSpeedComputer_instance = new MaxSpeedComputer();
3452
2205
  MuscularPowerProvider_instance = new MuscularPowerProvider();
@@ -3465,7 +2218,13 @@
3465
2218
  var github = io.github || (io.github = {});
3466
2219
  var glandais = github.glandais || (github.glandais = {});
3467
2220
  var engine = glandais.engine || (glandais.engine = {});
2221
+ engine.parseGpxWaypoints = parseGpxWaypoints;
3468
2222
  engine.parseGpx = parseGpx;
2223
+ engine.parseGpxTracks = parseGpxTracks;
2224
+ engine.parseGpxSegments = parseGpxSegments;
2225
+ engine.parseGpxTracksOnly = parseGpxTracksOnly;
2226
+ engine.parseGpxRoutesOnly = parseGpxRoutesOnly;
2227
+ engine.writeGpxTracks = writeGpxTracks;
3469
2228
  engine.pathSize = pathSize;
3470
2229
  engine.pathTotalDistance = pathTotalDistance;
3471
2230
  engine.pathDurationMs = pathDurationMs;
@@ -3473,12 +2232,21 @@
3473
2232
  engine.pathElevationLoss = pathElevationLoss;
3474
2233
  engine.pointAt = pointAt;
3475
2234
  engine.writeGpx = writeGpx;
2235
+ engine.writeGpxAt = writeGpxAt;
3476
2236
  engine.enhance = enhance;
3477
2237
  engine.enhanceWithCourse = enhanceWithCourse;
3478
2238
  engine.getField = getField;
3479
2239
  engine.fieldDefinitions = fieldDefinitions;
3480
2240
  engine.pathLatitudeDeg = pathLatitudeDeg;
3481
2241
  engine.pathLongitudeDeg = pathLongitudeDeg;
2242
+ engine.pathToCsv = pathToCsv;
2243
+ engine.pathToJson = pathToJson;
2244
+ engine.pathToFit = pathToFit;
2245
+ engine.pathsToFit = pathsToFit;
2246
+ engine.dominantHeadwindAzimuth = dominantHeadwindAzimuth;
2247
+ engine.dominantHeadwindAzimuthOfTracks = dominantHeadwindAzimuthOfTracks;
2248
+ engine.detectClimbs = detectClimbs;
2249
+ engine.detectClimbsWithOptions = detectClimbsWithOptions;
3482
2250
  }
3483
2251
  $jsExportAll$(_);
3484
2252
  kotlin_io_github_glandais_elevation.$jsExportAll$(_);