@macrostrat/map-interface 0.0.12 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.js DELETED
@@ -1,4518 +0,0 @@
1
- import "./module.css";
2
- import {useMemo as $Zz0sd$useMemo, createContext as $Zz0sd$createContext, useContext as $Zz0sd$useContext, useState as $Zz0sd$useState, useRef as $Zz0sd$useRef, Component as $Zz0sd$Component, useCallback as $Zz0sd$useCallback, useLayoutEffect as $Zz0sd$useLayoutEffect, useEffect as $Zz0sd$useEffect, forwardRef as $Zz0sd$forwardRef, isValidElement as $Zz0sd$isValidElement, cloneElement as $Zz0sd$cloneElement, useReducer as $Zz0sd$useReducer} from "react";
3
- import {Spinner as $Zz0sd$Spinner, Button as $Zz0sd$Button, Navbar as $Zz0sd$Navbar, Card as $Zz0sd$Card, Icon as $Zz0sd$Icon, ButtonGroup as $Zz0sd$ButtonGroup, NonIdealState as $Zz0sd$NonIdealState, Intent as $Zz0sd$Intent, Alert as $Zz0sd$Alert, Collapse as $Zz0sd$Collapse, Tag as $Zz0sd$Tag, EditableText as $Zz0sd$EditableText, Toaster as $Zz0sd$Toaster, Classes as $Zz0sd$Classes, Slider as $Zz0sd$Slider, Callout as $Zz0sd$Callout, Overlay as $Zz0sd$Overlay, Position as $Zz0sd$Position, NavbarGroup as $Zz0sd$NavbarGroup, Alignment as $Zz0sd$Alignment, Switch as $Zz0sd$Switch} from "@blueprintjs/core";
4
- import $Zz0sd$macrostrathyper, {hyperStyled as $Zz0sd$hyperStyled, classed as $Zz0sd$classed} from "@macrostrat/hyper";
5
- import {useMapStatus as $Zz0sd$useMapStatus, useFocusState as $Zz0sd$useFocusState, LocationFocusButton as $Zz0sd$LocationFocusButton, isCentered as $Zz0sd$isCentered, ZoomControl as $Zz0sd$ZoomControl, MapboxMapProvider as $Zz0sd$MapboxMapProvider, MapControlWrapper as $Zz0sd$MapControlWrapper, ThreeDControl as $Zz0sd$ThreeDControl, CompassControl as $Zz0sd$CompassControl, GlobeControl as $Zz0sd$GlobeControl, useMapRef as $Zz0sd$useMapRef, useMapEaseToCenter as $Zz0sd$useMapEaseToCenter, useMapDispatch as $Zz0sd$useMapDispatch, useMapConditionalStyle as $Zz0sd$useMapConditionalStyle} from "@macrostrat/mapbox-react";
6
- import $Zz0sd$classnames from "classnames";
7
- import {memoize as $Zz0sd$memoize, debounce as $Zz0sd$debounce, isEqual as $Zz0sd$isEqual} from "underscore";
8
- import $Zz0sd$axios from "axios";
9
- import $Zz0sd$useasynceffect, {useAsyncEffect as $Zz0sd$useAsyncEffect} from "use-async-effect";
10
- import $Zz0sd$immutabilityhelper from "immutability-helper";
11
- import {stringify as $Zz0sd$stringify, parse as $Zz0sd$parse} from "query-string";
12
- import $Zz0sd$reactjsontree from "react-json-tree";
13
- import {pairs as $Zz0sd$pairs, group as $Zz0sd$group} from "d3-array";
14
- import $Zz0sd$uibox from "ui-box";
15
- import {useInView as $Zz0sd$useInView} from "react-intersection-observer";
16
- import $Zz0sd$reactdropzone from "react-dropzone";
17
- import {findDOMNode as $Zz0sd$findDOMNode, createPortal as $Zz0sd$createPortal} from "react-dom";
18
- import {DateInput as $Zz0sd$DateInput} from "@blueprintjs/datetime";
19
- import "@blueprintjs/datetime/lib/css/blueprint-datetime.css";
20
- import $Zz0sd$useelementdimensions from "use-element-dimensions";
21
- import {format as $Zz0sd$format} from "d3-format";
22
- import $Zz0sd$mapboxgl, {ScaleControl as $Zz0sd$ScaleControl, GeolocateControl as $Zz0sd$GeolocateControl, Marker as $Zz0sd$Marker} from "mapbox-gl";
23
- import {getMapboxStyle as $Zz0sd$getMapboxStyle, mergeStyles as $Zz0sd$mergeStyles, mapViewInfo as $Zz0sd$mapViewInfo, getMapPosition as $Zz0sd$getMapPosition, setMapPosition as $Zz0sd$setMapPosition} from "@macrostrat/mapbox-utils";
24
- import $Zz0sd$chromajs from "chroma-js";
25
- import {useTransition as $Zz0sd$useTransition} from "transition-hook";
26
- import $Zz0sd$useresizeobserver from "use-resize-observer";
27
- import {tileToGeoJSON as $Zz0sd$tileToGeoJSON} from "@mapbox/tilebelt";
28
-
29
- function $parcel$interopDefault(a) {
30
- return a && a.__esModule ? a.default : a;
31
- }
32
- function $parcel$export(e, n, v, s) {
33
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
34
- }
35
- function $parcel$exportWildcard(dest, source) {
36
- Object.keys(source).forEach(function(key) {
37
- if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
38
- return;
39
- }
40
-
41
- Object.defineProperty(dest, key, {
42
- enumerable: true,
43
- get: function get() {
44
- return source[key];
45
- }
46
- });
47
- });
48
-
49
- return dest;
50
- }
51
- var $6e914c81c8e053da$exports = {};
52
-
53
- $parcel$export($6e914c81c8e053da$exports, "LoadingButton", () => $6e914c81c8e053da$export$4ec83e90d030b2f3);
54
- $parcel$export($6e914c81c8e053da$exports, "MapLoadingButton", () => $6e914c81c8e053da$export$9e3bae3c08bde368);
55
- $parcel$export($6e914c81c8e053da$exports, "FloatingNavbar", () => $6e914c81c8e053da$export$a8cc0062d02a3841);
56
-
57
-
58
-
59
- var $fbe402416678c280$exports = {};
60
-
61
- $parcel$export($fbe402416678c280$exports, "searchbar-holder", () => $fbe402416678c280$export$3a39e67bbbcbd4ae, (v) => $fbe402416678c280$export$3a39e67bbbcbd4ae = v);
62
- $parcel$export($fbe402416678c280$exports, "status-tongue", () => $fbe402416678c280$export$764ade2d69041360, (v) => $fbe402416678c280$export$764ade2d69041360 = v);
63
- $parcel$export($fbe402416678c280$exports, "navbar-holder", () => $fbe402416678c280$export$d8779dd86528d602, (v) => $fbe402416678c280$export$d8779dd86528d602 = v);
64
- $parcel$export($fbe402416678c280$exports, "searchbar", () => $fbe402416678c280$export$2ac23befe9d406ee, (v) => $fbe402416678c280$export$2ac23befe9d406ee = v);
65
- var $fbe402416678c280$export$3a39e67bbbcbd4ae;
66
- var $fbe402416678c280$export$764ade2d69041360;
67
- var $fbe402416678c280$export$d8779dd86528d602;
68
- var $fbe402416678c280$export$2ac23befe9d406ee;
69
- $fbe402416678c280$export$3a39e67bbbcbd4ae = `_8hZKsW_searchbar-holder`;
70
- $fbe402416678c280$export$764ade2d69041360 = `_8hZKsW_status-tongue`;
71
- $fbe402416678c280$export$d8779dd86528d602 = `_8hZKsW_navbar-holder`;
72
- $fbe402416678c280$export$2ac23befe9d406ee = `_8hZKsW_searchbar`;
73
-
74
-
75
-
76
- const $6e914c81c8e053da$var$h = (0, $Zz0sd$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($fbe402416678c280$exports))));
77
- const $6e914c81c8e053da$var$spinnerElement = $6e914c81c8e053da$var$h((0, $Zz0sd$Spinner), {
78
- size: 16
79
- });
80
- function $6e914c81c8e053da$export$4ec83e90d030b2f3({ isLoading: isLoading = false , onClick: onClick , active: active = false , icon: icon = "menu" , }) {
81
- return $6e914c81c8e053da$var$h((0, $Zz0sd$Button), {
82
- icon: isLoading ? $6e914c81c8e053da$var$spinnerElement : icon,
83
- large: true,
84
- minimal: true,
85
- onClick: onClick,
86
- active: active && !isLoading
87
- });
88
- }
89
- function $6e914c81c8e053da$export$9e3bae3c08bde368(props) {
90
- const { isLoading: isLoading } = (0, $Zz0sd$useMapStatus)();
91
- const mapIsLoading = (0, $Zz0sd$useMemo)(()=>isLoading, [
92
- isLoading
93
- ]);
94
- return $6e914c81c8e053da$var$h($6e914c81c8e053da$export$4ec83e90d030b2f3, {
95
- ...props,
96
- isLoading: mapIsLoading
97
- });
98
- }
99
- function $6e914c81c8e053da$export$a8cc0062d02a3841({ className: className , children: children , statusElement: statusElement = null }) {
100
- return $6e914c81c8e053da$var$h("div.searchbar-holder", {
101
- className: className
102
- }, [
103
- $6e914c81c8e053da$var$h("div.navbar-holder", [
104
- $6e914c81c8e053da$var$h((0, $Zz0sd$Navbar), {
105
- className: "searchbar panel"
106
- }, children),
107
- ]),
108
- $6e914c81c8e053da$var$h.if(statusElement != null)((0, $Zz0sd$Card), {
109
- className: "status-tongue"
110
- }, statusElement),
111
- ]);
112
- }
113
-
114
-
115
- var $f50c3537aaff0cff$exports = {};
116
-
117
- $parcel$export($f50c3537aaff0cff$exports, "InfoDrawerContainer", () => $f50c3537aaff0cff$export$83f9a19cf91c2d06);
118
- $parcel$export($f50c3537aaff0cff$exports, "LocationPanel", () => $f50c3537aaff0cff$export$aa4baff5242ea6e1);
119
-
120
-
121
-
122
-
123
- var $29ab0212ea6844d0$exports = {};
124
-
125
- $parcel$export($29ab0212ea6844d0$exports, "infodrawer", () => $29ab0212ea6844d0$export$b5017f7ff265217d, (v) => $29ab0212ea6844d0$export$b5017f7ff265217d = v);
126
- $parcel$export($29ab0212ea6844d0$exports, "infodrawer-body", () => $29ab0212ea6844d0$export$310e8f86a84c074f, (v) => $29ab0212ea6844d0$export$310e8f86a84c074f = v);
127
- $parcel$export($29ab0212ea6844d0$exports, "copy-link-button", () => $29ab0212ea6844d0$export$d1352d0c31a65024, (v) => $29ab0212ea6844d0$export$d1352d0c31a65024 = v);
128
- $parcel$export($29ab0212ea6844d0$exports, "left-icon", () => $29ab0212ea6844d0$export$f750577db09821ce, (v) => $29ab0212ea6844d0$export$f750577db09821ce = v);
129
- $parcel$export($29ab0212ea6844d0$exports, "location-panel-header", () => $29ab0212ea6844d0$export$d821beb98a87c6d7, (v) => $29ab0212ea6844d0$export$d821beb98a87c6d7 = v);
130
- $parcel$export($29ab0212ea6844d0$exports, "position-controls", () => $29ab0212ea6844d0$export$dfae07a3bf0fbd6, (v) => $29ab0212ea6844d0$export$dfae07a3bf0fbd6 = v);
131
- $parcel$export($29ab0212ea6844d0$exports, "loading", () => $29ab0212ea6844d0$export$46c1c92549715335, (v) => $29ab0212ea6844d0$export$46c1c92549715335 = v);
132
- $parcel$export($29ab0212ea6844d0$exports, "spacer", () => $29ab0212ea6844d0$export$8cc075c801fd6817, (v) => $29ab0212ea6844d0$export$8cc075c801fd6817 = v);
133
- $parcel$export($29ab0212ea6844d0$exports, "infodrawer-header-item", () => $29ab0212ea6844d0$export$333d72514239bce8, (v) => $29ab0212ea6844d0$export$333d72514239bce8 = v);
134
- var $29ab0212ea6844d0$export$b5017f7ff265217d;
135
- var $29ab0212ea6844d0$export$310e8f86a84c074f;
136
- var $29ab0212ea6844d0$export$d1352d0c31a65024;
137
- var $29ab0212ea6844d0$export$f750577db09821ce;
138
- var $29ab0212ea6844d0$export$d821beb98a87c6d7;
139
- var $29ab0212ea6844d0$export$dfae07a3bf0fbd6;
140
- var $29ab0212ea6844d0$export$46c1c92549715335;
141
- var $29ab0212ea6844d0$export$8cc075c801fd6817;
142
- var $29ab0212ea6844d0$export$333d72514239bce8;
143
- $29ab0212ea6844d0$export$b5017f7ff265217d = `VPa3-W_infodrawer`;
144
- $29ab0212ea6844d0$export$310e8f86a84c074f = `VPa3-W_infodrawer-body`;
145
- $29ab0212ea6844d0$export$d1352d0c31a65024 = `VPa3-W_copy-link-button`;
146
- $29ab0212ea6844d0$export$f750577db09821ce = `VPa3-W_left-icon`;
147
- $29ab0212ea6844d0$export$d821beb98a87c6d7 = `VPa3-W_location-panel-header`;
148
- $29ab0212ea6844d0$export$dfae07a3bf0fbd6 = `VPa3-W_position-controls`;
149
- $29ab0212ea6844d0$export$46c1c92549715335 = `VPa3-W_loading`;
150
- $29ab0212ea6844d0$export$8cc075c801fd6817 = `VPa3-W_spacer`;
151
- $29ab0212ea6844d0$export$333d72514239bce8 = `VPa3-W_infodrawer-header-item`;
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
-
160
-
161
-
162
-
163
- function $07d653833556bec3$export$45a940cb1bd2c59c(v) {
164
- /** useState wrapper hook that requires updating using an "immutability-helper" spec */ const [state, setState] = (0, $Zz0sd$useState)(v);
165
- const updateState = function(cset) {
166
- const newState = (0, $Zz0sd$immutabilityhelper)(state, cset);
167
- return setState(newState);
168
- };
169
- return [
170
- state,
171
- updateState
172
- ];
173
- }
174
- function $07d653833556bec3$export$587475f9c8f166d3(obj, equalityFunction = (0, $Zz0sd$isEqual)) {
175
- /** Hook to keep a dependency up to date using a deep equals approach */ const ref = (0, $Zz0sd$useRef)(obj);
176
- if (ref.current, equalityFunction(obj, ref.current)) return ref.current;
177
- else {
178
- ref.current = obj;
179
- return obj;
180
- }
181
- }
182
- class $07d653833556bec3$export$d43a63efdfca7551 extends (0, $Zz0sd$Component) {
183
- constructor(props){
184
- console.warn("StatefulComponent is deprecated. Use useImmutableState instead.");
185
- super(props);
186
- this.updateState.bind(this);
187
- }
188
- updateState(spec) {
189
- const newState = (0, $Zz0sd$immutabilityhelper)(this.state, spec);
190
- this.setState(newState);
191
- }
192
- }
193
-
194
-
195
-
196
-
197
- function $69003d50cdf80feb$export$2b86bedf890eab8(ref, opts = {}) {
198
- /** Also see https://github.com/Swizec/useDimensions */ const { trackWindowResize: trackWindowResize = true } = opts;
199
- const [size, setSize] = (0, $Zz0sd$useState)(null);
200
- const sizeCallback = (0, $Zz0sd$useCallback)(()=>{
201
- if (ref.current == null) return;
202
- const { height: height , width: width } = ref.current.getBoundingClientRect();
203
- setSize({
204
- height: height,
205
- width: width
206
- });
207
- }, [
208
- ref
209
- ]);
210
- (0, $Zz0sd$useLayoutEffect)(sizeCallback, [
211
- ref
212
- ]);
213
- // Also respond on window resize (if "trackWindowResize" is set)
214
- (0, $Zz0sd$useEffect)(()=>{
215
- if (!trackWindowResize) return;
216
- window.addEventListener("resize", sizeCallback);
217
- return function() {
218
- window.removeEventListener("resize", sizeCallback);
219
- };
220
- }, [
221
- sizeCallback,
222
- trackWindowResize
223
- ]);
224
- return size;
225
- }
226
- function $69003d50cdf80feb$export$c0519b2d959c96bb(ref) {
227
- const [offset, setOffset] = (0, $Zz0sd$useState)(0);
228
- (0, $Zz0sd$useEffect)(()=>{
229
- ref.current?.addEventListener("scroll", (evt)=>{
230
- const el = evt.target;
231
- setOffset(el.scrollTop);
232
- });
233
- }, [
234
- ref.current
235
- ]);
236
- return offset;
237
- }
238
-
239
-
240
-
241
- function $83004cc6a8cd4af9$export$6b17a39e52c8ee53(params, opts = {}) {
242
- let p;
243
- if (typeof params === "string") p = params;
244
- else p = (0, $Zz0sd$stringify)(params, {
245
- arrayFormat: "comma",
246
- ...opts
247
- });
248
- return p;
249
- }
250
- function $83004cc6a8cd4af9$export$582f7198e76ee4c2(route, params = {}, opts) {
251
- const queryStr = $83004cc6a8cd4af9$export$6b17a39e52c8ee53(params, opts);
252
- if (queryStr == "") return route;
253
- else return route + "?" + queryStr;
254
- }
255
- // Base query string management
256
- function $83004cc6a8cd4af9$var$parseParams(paramString, opts) {
257
- const params = (0, $Zz0sd$parse)(paramString, {
258
- parseBooleans: true,
259
- parseNumbers: true,
260
- arrayFormat: "comma",
261
- ...opts
262
- });
263
- // Return null unless we have params defined
264
- return Object.keys(params).length > 0 ? params : null;
265
- }
266
- function $83004cc6a8cd4af9$var$updateURL(joinWith, args, opts) {
267
- const params = $83004cc6a8cd4af9$export$6b17a39e52c8ee53(args, opts);
268
- let pathname = document.location.pathname;
269
- if (params != "") pathname += joinWith + params;
270
- window.history.replaceState({}, "", pathname);
271
- }
272
- const $83004cc6a8cd4af9$export$b49fe6cbb2300d15 = (hashString)=>$83004cc6a8cd4af9$var$parseParams(hashString ?? document.location.hash);
273
- const $83004cc6a8cd4af9$export$87422f3aab402e79 = (args, opts)=>$83004cc6a8cd4af9$var$updateURL("#", args, opts);
274
- const $83004cc6a8cd4af9$export$18380b9f669996bd = (queryString)=>$83004cc6a8cd4af9$var$parseParams(queryString ?? document.location.search);
275
- const $83004cc6a8cd4af9$export$796b81a51be0b38a = (args, opts)=>$83004cc6a8cd4af9$var$updateURL("?", args, opts);
276
-
277
-
278
-
279
- class $962bc0f04255cfc3$export$19fffca37ef3e106 {
280
- constructor(name){
281
- this.get = this.get.bind(this);
282
- this.set = this.set.bind(this);
283
- this.name = name;
284
- }
285
- get() {
286
- const str = window.localStorage.getItem(this.name);
287
- try {
288
- const obj = JSON.parse(str);
289
- return obj;
290
- } catch {
291
- return null;
292
- }
293
- }
294
- set(obj) {
295
- const str = JSON.stringify(obj);
296
- return window.localStorage.setItem(this.name, str);
297
- }
298
- remove() {
299
- window.localStorage.removeItem(this.name);
300
- }
301
- }
302
- function $962bc0f04255cfc3$export$8b052fe25089340e(key1, initialState, isValid = null) {
303
- /** React hook for setting and getting values on local storage */ const storage = (0, $Zz0sd$useMemo)(()=>new $962bc0f04255cfc3$export$19fffca37ef3e106(key1), [
304
- key1
305
- ]);
306
- let initialValue = storage.get();
307
- const validator = (0, $Zz0sd$useCallback)((state)=>{
308
- if (isValid != null) return isValid(state);
309
- if (state == null) return false;
310
- if (typeof state != typeof initialState) return false;
311
- if (typeof state == "object") {
312
- const expectedKeys = Object.keys(initialState);
313
- const actualKeys = Object.keys(state);
314
- if (expectedKeys.length != actualKeys.length) return false;
315
- for (const [key, value] of Object.entries(initialState)){
316
- if (!actualKeys.includes(key)) return false;
317
- if (typeof value != typeof state[key]) return false;
318
- }
319
- }
320
- return true;
321
- }, [
322
- initialState,
323
- isValid
324
- ]);
325
- if (!validator(initialValue)) initialValue = null;
326
- const [state1, _setState] = (0, $Zz0sd$useState)(initialValue ?? initialState);
327
- const setState = (0, $Zz0sd$useCallback)((nextState, validate = true)=>{
328
- if (validate && !validator(nextState)) throw `State ${nextState} is not valid.`;
329
- _setState(nextState);
330
- storage.set(nextState);
331
- }, [
332
- validator
333
- ]);
334
- const resetState = (0, $Zz0sd$useCallback)(()=>{
335
- _setState(initialState);
336
- storage.remove();
337
- }, [
338
- initialState
339
- ]);
340
- return [
341
- state1,
342
- setState,
343
- resetState
344
- ];
345
- }
346
-
347
-
348
-
349
-
350
-
351
- var $439cdbb36f71c7cb$exports = {};
352
-
353
- $parcel$export($439cdbb36f71c7cb$exports, "json-view-container", () => $439cdbb36f71c7cb$export$34a5cf3b4678f4f4, (v) => $439cdbb36f71c7cb$export$34a5cf3b4678f4f4 = v);
354
- $parcel$export($439cdbb36f71c7cb$exports, "root-hidden", () => $439cdbb36f71c7cb$export$e525b52bb498dd65, (v) => $439cdbb36f71c7cb$export$e525b52bb498dd65 = v);
355
- $parcel$export($439cdbb36f71c7cb$exports, "flex-col", () => $439cdbb36f71c7cb$export$39076b5dbe08a0a4, (v) => $439cdbb36f71c7cb$export$39076b5dbe08a0a4 = v);
356
- $parcel$export($439cdbb36f71c7cb$exports, "flex-row", () => $439cdbb36f71c7cb$export$1ec2a4762acd7aec, (v) => $439cdbb36f71c7cb$export$1ec2a4762acd7aec = v);
357
- $parcel$export($439cdbb36f71c7cb$exports, "flex-spacer", () => $439cdbb36f71c7cb$export$b3bb2ed7c69eb53c, (v) => $439cdbb36f71c7cb$export$b3bb2ed7c69eb53c = v);
358
- var $439cdbb36f71c7cb$export$34a5cf3b4678f4f4;
359
- var $439cdbb36f71c7cb$export$e525b52bb498dd65;
360
- var $439cdbb36f71c7cb$export$39076b5dbe08a0a4;
361
- var $439cdbb36f71c7cb$export$1ec2a4762acd7aec;
362
- var $439cdbb36f71c7cb$export$b3bb2ed7c69eb53c;
363
- $439cdbb36f71c7cb$export$34a5cf3b4678f4f4 = `_39DLrq_json-view-container`;
364
- $439cdbb36f71c7cb$export$e525b52bb498dd65 = `_39DLrq_root-hidden`;
365
- $439cdbb36f71c7cb$export$39076b5dbe08a0a4 = `_39DLrq_flex-col`;
366
- $439cdbb36f71c7cb$export$1ec2a4762acd7aec = `_39DLrq_flex-row`;
367
- $439cdbb36f71c7cb$export$b3bb2ed7c69eb53c = `_39DLrq_flex-spacer`;
368
-
369
-
370
- const $e94acad285dc5835$var$h = (0, $Zz0sd$hyperStyled)((0, (/*@__PURE__*/$parcel$interopDefault($439cdbb36f71c7cb$exports))));
371
- const $e94acad285dc5835$var$monokai = {
372
- scheme: "monokai",
373
- author: "wimer hazenberg (http://www.monokai.nl)",
374
- base00: "transparent",
375
- base01: "#383830",
376
- base02: "#49483e",
377
- base03: "#75715e",
378
- base04: "#a59f85",
379
- base05: "#f8f8f2",
380
- base06: "#f5f4f1",
381
- base07: "#f9f8f5",
382
- base08: "#f92672",
383
- base09: "#fd971f",
384
- base0A: "#f4bf75",
385
- base0B: "#a6e22e",
386
- base0C: "#a1efe4",
387
- base0D: "#66d9ef",
388
- base0E: "#ae81ff",
389
- base0F: "#cc6633"
390
- };
391
- function $e94acad285dc5835$export$bb1a5c615d2117e4(props) {
392
- return $e94acad285dc5835$var$h("div.json-view-container", {
393
- className: (0, $Zz0sd$classnames)(props.className, {
394
- "root-hidden": props.hideRoot
395
- })
396
- }, $e94acad285dc5835$var$h((0, $Zz0sd$reactjsontree), {
397
- theme: $e94acad285dc5835$var$monokai,
398
- invertTheme: false,
399
- ...props
400
- }));
401
- }
402
-
403
-
404
-
405
-
406
- function $33b2bc830d733cb1$export$c6763f1ee4ac6ab6(markers, callback) {
407
- /** Hook that notifies when we pass a scroll marker */ const [lastMarker, setLastMarker] = (0, $Zz0sd$useState)(null);
408
- const [offset, setOffset] = (0, $Zz0sd$useState)(null);
409
- (0, $Zz0sd$useEffect)(()=>{
410
- const handleScroll = (event)=>setOffset(document.scrollingElement.scrollTop);
411
- window.addEventListener("scroll", handleScroll);
412
- return ()=>{
413
- window.removeEventListener("scroll", handleScroll);
414
- };
415
- });
416
- const markerPairs = (0, $Zz0sd$useMemo)(()=>{
417
- let sortedMarkers = [
418
- ...markers
419
- ];
420
- sortedMarkers.sort((a, b)=>a.offset - b.offset);
421
- return (0, $Zz0sd$pairs)([
422
- {
423
- id: "start",
424
- offset: 0
425
- },
426
- ...sortedMarkers,
427
- {
428
- id: "end",
429
- offset: Number.MAX_SAFE_INTEGER
430
- },
431
- ]);
432
- }, [
433
- markers
434
- ]);
435
- (0, $Zz0sd$useEffect)(()=>{
436
- for (const [m1, m2] of markerPairs)if (offset >= m1.offset && offset < m2.offset) {
437
- let markerToSet = m1.id === "start" ? null : m1;
438
- if (markerToSet != lastMarker) {
439
- setLastMarker(markerToSet);
440
- callback?.(markerToSet);
441
- }
442
- }
443
- }, [
444
- markerPairs,
445
- offset
446
- ]);
447
- return lastMarker;
448
- }
449
-
450
-
451
-
452
- function $e3ce48f24c4f89ba$var$usePrevious(value) {
453
- /** Use the previous value of a value */ const ref = (0, $Zz0sd$useRef)();
454
- (0, $Zz0sd$useEffect)(()=>{
455
- ref.current = value;
456
- });
457
- return ref.current;
458
- }
459
- function $e3ce48f24c4f89ba$export$e251a4f951868461(componentUpdater, props = {}, state = {}) {
460
- /** Run a function every time props and state changes.
461
- * Analogous to componentDidUpdate in a class component. This is useful for incrementally
462
- * transitioning from class to functional React components. */ const prevProps = $e3ce48f24c4f89ba$var$usePrevious(props);
463
- const prevState = $e3ce48f24c4f89ba$var$usePrevious(state);
464
- (0, $Zz0sd$useEffect)(()=>console.warn("The useComponentDidUpdate hook performs poorly and is only meant to ease the transition to functional components. Please transition to direct use of useEffect to remove this warning."), []);
465
- (0, $Zz0sd$useEffect)(()=>{
466
- if (prevProps == null) return;
467
- componentUpdater(prevProps, prevState ?? {});
468
- }, [
469
- ...Object.values(props ?? {}),
470
- ...Object.values(state ?? {})
471
- ]);
472
- }
473
-
474
-
475
- const $6c5e591df6884048$var$keys = function(main) {
476
- const allKeys = [
477
- "",
478
- "V",
479
- "H",
480
- "Left",
481
- "Right",
482
- "Top",
483
- "Bottom"
484
- ];
485
- return allKeys.map((d)=>main + d);
486
- };
487
- const $6c5e591df6884048$var$keyRemover = (type)=>function(obj) {
488
- let o1 = obj;
489
- for (let key of $6c5e591df6884048$var$keys(type))delete o1[key];
490
- return o1;
491
- };
492
- const $6c5e591df6884048$export$5fb36de03dcdcaea = $6c5e591df6884048$var$keyRemover("margin");
493
- const $6c5e591df6884048$export$9e682a1b5c74239d = $6c5e591df6884048$var$keyRemover("padding");
494
- const $6c5e591df6884048$export$d6ab876b578c601a = function(obj, remove = false) {
495
- /*
496
- I'm really annoyed I can't find a third-party implementation
497
- of this that covers edge cases...
498
- This eventually is useful for a React version of the SVG "margin convention"
499
- https://bl.ocks.org/mbostock/3019563
500
- */ let { marginLeft: marginLeft , marginRight: marginRight , marginTop: marginTop , marginBottom: marginBottom , marginV: marginV , marginH: marginH , margin: margin , } = obj;
501
- if (margin == null) margin = 0;
502
- if (marginV == null) marginV = margin;
503
- if (marginH == null) marginH = margin;
504
- if (marginLeft == null) marginLeft = marginH;
505
- if (marginRight == null) marginRight = marginH;
506
- if (marginTop == null) marginTop = marginV;
507
- if (marginBottom == null) marginBottom = marginV;
508
- if (remove) $6c5e591df6884048$export$5fb36de03dcdcaea(obj);
509
- return {
510
- marginLeft: marginLeft,
511
- marginRight: marginRight,
512
- marginTop: marginTop,
513
- marginBottom: marginBottom
514
- };
515
- };
516
- const $6c5e591df6884048$export$59809e23c33097c7 = function(obj, remove = false) {
517
- /*
518
- I'm really annoyed I can't find a third-party implementation
519
- of this that covers edge cases...
520
- This eventually is useful for a React version of the SVG "padding convention"
521
- https://bl.ocks.org/mbostock/3019563
522
- */ let { paddingLeft: paddingLeft , paddingRight: paddingRight , paddingTop: paddingTop , paddingBottom: paddingBottom , paddingV: paddingV , paddingH: paddingH , padding: padding , } = obj;
523
- if (padding == null) padding = 0;
524
- if (paddingV == null) paddingV = padding;
525
- if (paddingH == null) paddingH = padding;
526
- if (paddingLeft == null) paddingLeft = paddingH;
527
- if (paddingRight == null) paddingRight = paddingH;
528
- if (paddingTop == null) paddingTop = paddingV;
529
- if (paddingBottom == null) paddingBottom = paddingV;
530
- if (remove) $6c5e591df6884048$export$9e682a1b5c74239d(obj);
531
- return {
532
- paddingLeft: paddingLeft,
533
- paddingRight: paddingRight,
534
- paddingTop: paddingTop,
535
- paddingBottom: paddingBottom
536
- };
537
- };
538
- const $6c5e591df6884048$export$dd33b47872dc32cf = function(obj) {
539
- const margin = $6c5e591df6884048$export$d6ab876b578c601a(obj);
540
- let o1 = {
541
- ...obj
542
- };
543
- for (let key of [
544
- "margin",
545
- "marginV",
546
- "marginH"
547
- ])delete o1[key];
548
- return {
549
- ...o1,
550
- ...margin
551
- };
552
- };
553
- const $6c5e591df6884048$export$a54fa7cfd785f0f3 = function(obj) {
554
- const margin = $6c5e591df6884048$export$59809e23c33097c7(obj);
555
- let o1 = {
556
- ...obj
557
- };
558
- for (let key of [
559
- "padding",
560
- "paddingV",
561
- "paddingH"
562
- ])delete o1[key];
563
- return {
564
- ...o1,
565
- ...margin
566
- };
567
- };
568
- const $6c5e591df6884048$export$191d9ced4e88b0c6 = function(obj) {
569
- const n = $6c5e591df6884048$export$a54fa7cfd785f0f3(obj);
570
- const { innerHeight: innerHeight , innerWidth: innerWidth , height: height , width: width , ...rest } = n;
571
- if (innerHeight != null) {
572
- if (n.height == null) n.height = innerHeight + n.paddingTop + n.paddingBottom;
573
- }
574
- if (innerWidth != null) {
575
- if (n.width == null) n.width = innerWidth + n.paddingLeft + n.paddingRight;
576
- }
577
- delete n.innerHeight;
578
- delete n.innerWidth;
579
- return n;
580
- };
581
-
582
-
583
-
584
- function $b6cb1d0d2e16ece1$export$67f126879bce8c6(handler, options, deps) {
585
- if (Array.isArray(options)) {
586
- deps = options;
587
- options = {};
588
- }
589
- const { event: event1 = "keydown" , keys: keys = [] , target: target = document } = options;
590
- const _callback = (0, $Zz0sd$useCallback)((event)=>{
591
- if (keys.length === 0 || keys.includes(event.key)) handler(event);
592
- }, [
593
- handler,
594
- keys
595
- ]);
596
- return $b6cb1d0d2e16ece1$export$d9a4b984170e80fc(target, event1, _callback, deps);
597
- }
598
- function $b6cb1d0d2e16ece1$export$d9a4b984170e80fc(target, event2, handler, deps) {
599
- const _callback = deps ? (0, $Zz0sd$useCallback)(handler, deps) : handler;
600
- (0, $Zz0sd$useEffect)(()=>{
601
- const handleEvent = (event)=>{
602
- _callback(event);
603
- };
604
- target.addEventListener(event2, handleEvent);
605
- return ()=>{
606
- target.removeEventListener(event2, handleEvent);
607
- };
608
- }, [
609
- _callback,
610
- event2,
611
- target
612
- ]);
613
- }
614
-
615
-
616
-
617
-
618
-
619
-
620
- const $9197c0703088e02c$var$h = (0, $Zz0sd$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($439cdbb36f71c7cb$exports))));
621
- const $9197c0703088e02c$export$e71c4d32a2263218 = (0, $Zz0sd$uibox);
622
- const $9197c0703088e02c$export$ebc6f4ec7767938 = (0, $Zz0sd$forwardRef)((props, ref)=>{
623
- const { grow: grow , shrink: shrink , className: className , style: style , textAlign: textAlign , ...rest } = props;
624
- return $9197c0703088e02c$var$h($9197c0703088e02c$export$e71c4d32a2263218, {
625
- className: className,
626
- flexGrow: grow,
627
- flexShrink: shrink,
628
- ...rest
629
- });
630
- });
631
- function $9197c0703088e02c$export$210ea85e49c56827(props) {
632
- return $9197c0703088e02c$var$h($9197c0703088e02c$export$ebc6f4ec7767938, {
633
- display: "flex",
634
- flexDirection: "row",
635
- ...props
636
- });
637
- }
638
- function $9197c0703088e02c$export$e4e2a1fe1a881299(props) {
639
- return $9197c0703088e02c$var$h($9197c0703088e02c$export$ebc6f4ec7767938, {
640
- display: "flex",
641
- flexDirection: "row",
642
- ...props
643
- });
644
- }
645
- function $9197c0703088e02c$export$d7a54cba636a8cd6(props) {
646
- return $9197c0703088e02c$var$h($9197c0703088e02c$export$ebc6f4ec7767938, {
647
- flex: 1,
648
- ...props
649
- });
650
- }
651
-
652
-
653
-
654
-
655
- const $1ba261b8f20bb510$var$apiDefaults = {
656
- fullResponse: false,
657
- handleError: true,
658
- memoize: false,
659
- onError (err, opts) {
660
- let error = opts.error ?? opts;
661
- throw error;
662
- },
663
- onResponse (_) {},
664
- unwrapResponse (d) {
665
- return d;
666
- }
667
- };
668
- function $1ba261b8f20bb510$var$removeUndefined(o1) {
669
- let obj = {
670
- ...o1
671
- };
672
- Object.keys(obj).forEach((key)=>{
673
- if (obj[key] === undefined) delete obj[key];
674
- });
675
- return obj;
676
- }
677
- function $1ba261b8f20bb510$var$splitConfig(props) {
678
- const { config: config = {} , fullResponse: // These should maybe be reworked into a legacy options set...
679
- fullResponse , handleError: handleError , memoize: memoize1 , onError: onError , onResponse: onResponse , unwrapResponse: unwrapResponse , ...axiosConfig } = props;
680
- let legacyConfig = $1ba261b8f20bb510$var$removeUndefined({
681
- fullResponse: fullResponse,
682
- handleError: handleError,
683
- memoize: memoize1,
684
- onError: onError,
685
- onResponse: onResponse,
686
- unwrapResponse: unwrapResponse
687
- });
688
- const newConfig = {
689
- ...$1ba261b8f20bb510$var$apiDefaults,
690
- ...legacyConfig,
691
- ...config
692
- };
693
- return [
694
- axiosConfig,
695
- newConfig
696
- ];
697
- }
698
- const $1ba261b8f20bb510$var$defaultAxios = (0, $Zz0sd$axios).create();
699
- function $1ba261b8f20bb510$export$6acf7754017371fd(defaultProps = {}) {
700
- const [axiosConfig, config] = $1ba261b8f20bb510$var$splitConfig(defaultProps);
701
- const axiosInstance = (0, $Zz0sd$axios).create(axiosConfig);
702
- const defaultValue = {
703
- axiosInstance: axiosInstance,
704
- baseURL: axiosInstance.defaults.baseURL ?? "",
705
- config: config
706
- };
707
- return (0, $Zz0sd$createContext)(defaultValue);
708
- }
709
- let $1ba261b8f20bb510$var$APIMethod;
710
- (function(APIMethod1) {
711
- APIMethod1["POST"] = "POST";
712
- APIMethod1["GET"] = "GET";
713
- })($1ba261b8f20bb510$var$APIMethod || ($1ba261b8f20bb510$var$APIMethod = {}));
714
- const $1ba261b8f20bb510$export$e9e34775259af03f = $1ba261b8f20bb510$export$6acf7754017371fd();
715
- async function $1ba261b8f20bb510$var$handleResult(ctx, request, info) {
716
- const { processOptions: processOptions , buildURL: buildURL } = $1ba261b8f20bb510$export$e0fe1438ea49d99e(ctx);
717
- const { opts: opts , method: method , params: params , route: route } = info;
718
- const cfg = processOptions(opts);
719
- let res = null;
720
- let error = null;
721
- try {
722
- res = await request;
723
- cfg.onResponse(res);
724
- if (res.data != null) return cfg.unwrapResponse(res.data);
725
- } catch (err) {
726
- error = err;
727
- }
728
- error = error ?? Error(res.statusText || "No data!");
729
- if (cfg.handleError) {
730
- // Log errors if we're not throwing
731
- console.error(error);
732
- cfg.onError(error, {
733
- error: error,
734
- response: res,
735
- endpoint: buildURL(route, params),
736
- method: method
737
- });
738
- } else throw error;
739
- }
740
- const $1ba261b8f20bb510$export$e0fe1438ea49d99e = (ctx)=>({
741
- buildURL (route = "", params = {}) {
742
- // axios's getUri doesn't return baseURL for some inexplicable reason,
743
- // as of spring 2021.
744
- // this behavior could change sometime in the future...
745
- const uriPath = ctx.axiosInstance.getUri({
746
- url: route,
747
- params: params
748
- });
749
- return ctx.baseURL + uriPath;
750
- },
751
- processOptions (opts = {}) {
752
- let o1 = {
753
- ...ctx.config,
754
- ...opts
755
- };
756
- if (o1.fullResponse) o1.unwrapResponse = $1ba261b8f20bb510$var$apiDefaults.unwrapResponse;
757
- return o1;
758
- }
759
- });
760
- const $1ba261b8f20bb510$export$1b4fffb1855b248b = (ctx)=>{
761
- const { axiosInstance: axiosInstance } = ctx;
762
- return {
763
- post (route, ...args) {
764
- let opts, params, payload;
765
- if (args.length === 3) [params, payload, opts] = args;
766
- else if (args.length === 2) [payload, opts] = args;
767
- else if (args.length === 1) [payload] = args;
768
- else throw "No data to post";
769
- params ??= {};
770
- opts ??= {};
771
- const [axiosConfig, _] = $1ba261b8f20bb510$var$splitConfig(opts);
772
- const req = axiosInstance.post(route, payload, {
773
- ...axiosConfig,
774
- params: params
775
- });
776
- const info = {
777
- route: route,
778
- params: params,
779
- method: $1ba261b8f20bb510$var$APIMethod.POST,
780
- opts: opts
781
- };
782
- return $1ba261b8f20bb510$var$handleResult(ctx, req, info);
783
- },
784
- get (route, ...args) {
785
- let params, opts;
786
- if (args.length == 1) [opts] = args;
787
- else if (args.length == 2) [params, opts] = args;
788
- params ??= {};
789
- opts ??= {};
790
- const [axiosConfig, cfg] = $1ba261b8f20bb510$var$splitConfig(opts);
791
- const fn = cfg.memoize ? (0, $Zz0sd$memoize)(axiosInstance.get) : axiosInstance.get;
792
- const request = fn(route, {
793
- ...axiosConfig,
794
- params: params
795
- });
796
- const info = {
797
- route: route,
798
- params: params,
799
- method: $1ba261b8f20bb510$var$APIMethod.GET,
800
- opts: opts
801
- };
802
- return $1ba261b8f20bb510$var$handleResult(ctx, request, info);
803
- }
804
- };
805
- };
806
- function $1ba261b8f20bb510$export$434374b2a40d237(props) {
807
- /** Provider for APIContext
808
-
809
- can pass an alternative API context using "context" param
810
- */ const { context: context = $1ba261b8f20bb510$export$e9e34775259af03f , children: children , ...rest } = props;
811
- const [axiosConfig, config] = $1ba261b8f20bb510$var$splitConfig(rest);
812
- const axiosInstance = (0, $Zz0sd$axios).create(axiosConfig);
813
- const value = {
814
- axiosInstance: axiosInstance,
815
- baseURL: axiosInstance.defaults.baseURL ?? "",
816
- config: config
817
- };
818
- return (0, $Zz0sd$macrostrathyper)(context.Provider, {
819
- value: value
820
- }, children);
821
- }
822
- const $1ba261b8f20bb510$export$116f03ca263301c4 = (ctx = $1ba261b8f20bb510$export$e9e34775259af03f)=>{
823
- return $1ba261b8f20bb510$export$1b4fffb1855b248b((0, $Zz0sd$useContext)(ctx));
824
- };
825
- const $1ba261b8f20bb510$export$b5c9fa006a61dd96 = (ctx = $1ba261b8f20bb510$export$e9e34775259af03f)=>{
826
- return $1ba261b8f20bb510$export$e0fe1438ea49d99e((0, $Zz0sd$useContext)(ctx));
827
- };
828
- function $1ba261b8f20bb510$export$fb96f66d413116d6(context = $1ba261b8f20bb510$export$e9e34775259af03f) {
829
- return (0, $Zz0sd$useContext)(context).axiosInstance;
830
- }
831
- function $1ba261b8f20bb510$export$e8d49880d9779baa(route, params = null, opts = {}) {
832
- /* React hook for API results */ const paramsDep = (0, $07d653833556bec3$export$587475f9c8f166d3)(params);
833
- const deps = [
834
- route,
835
- paramsDep
836
- ]; //...Object.values(params ?? {})];
837
- const [result, setResult] = (0, $Zz0sd$useState)(null);
838
- if (typeof opts === "function") opts = {
839
- unwrapResponse: opts
840
- };
841
- const { debounce: _debounce , context: context , ...rest } = opts ?? {};
842
- let { get: get } = $1ba261b8f20bb510$export$116f03ca263301c4(context);
843
- const _getAPIData = async function() {
844
- if (route == null) return setResult(null);
845
- const res = await get(route, params, rest);
846
- return setResult(res);
847
- };
848
- const getAPIData = _debounce != null ? (0, $Zz0sd$debounce)(_getAPIData, _debounce) : _getAPIData;
849
- (0, $Zz0sd$useasynceffect)(getAPIData, deps);
850
- return result;
851
- }
852
-
853
-
854
-
855
-
856
-
857
- const $9c7f2732adc86639$var$APIResultContext = (0, $Zz0sd$createContext)({});
858
- function $9c7f2732adc86639$export$43c6ed89e8a21a35(props) {
859
- const { children: children , key: key , data: data } = props;
860
- const baseValue = (0, $Zz0sd$useContext)($9c7f2732adc86639$var$APIResultContext);
861
- const value = {
862
- ...baseValue,
863
- [key]: data
864
- };
865
- return (0, $Zz0sd$macrostrathyper)($9c7f2732adc86639$var$APIResultContext.Provider, {
866
- value: value
867
- }, children);
868
- }
869
- function $9c7f2732adc86639$export$233b8989724eb0e2(props) {
870
- const { route: route , params: params , children: children , key: key , ...opts } = props;
871
- const data = (0, $1ba261b8f20bb510$export$e8d49880d9779baa)(route, params, opts);
872
- return (0, $Zz0sd$macrostrathyper)($9c7f2732adc86639$export$43c6ed89e8a21a35, {
873
- key: key,
874
- data: data
875
- }, children);
876
- }
877
- function $9c7f2732adc86639$export$c1cf1cf4c5d51937(key) {
878
- return (0, $Zz0sd$useContext)($9c7f2732adc86639$var$APIResultContext)[key];
879
- }
880
-
881
-
882
-
883
-
884
-
885
-
886
-
887
-
888
-
889
-
890
- const $9419dfbe0ed171f8$var$IndexingContext = (0, $Zz0sd$createContext)(null);
891
- function $9419dfbe0ed171f8$export$9251b6be4313cb0a(props) {
892
- const { children: children , ...value } = props;
893
- return (0, $Zz0sd$macrostrathyper)($9419dfbe0ed171f8$var$IndexingContext.Provider, {
894
- value: value
895
- }, children);
896
- }
897
- const $9419dfbe0ed171f8$export$d8ac082ceda2abf1 = ()=>(0, $Zz0sd$useContext)($9419dfbe0ed171f8$var$IndexingContext);
898
-
899
-
900
- const $2ad085849a522749$var$APIResultPlaceholder = (props)=>{
901
- return (0, $Zz0sd$macrostrathyper)("div.api-result-placeholder", [
902
- (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Spinner))
903
- ]);
904
- };
905
- class $2ad085849a522749$export$afb22da0139d52 extends (0, $Zz0sd$Component) {
906
- static contextType = (0, $1ba261b8f20bb510$export$e9e34775259af03f);
907
- static defaultProps = {
908
- route: null,
909
- params: {},
910
- opts: {},
911
- debug: false,
912
- onSuccess: ()=>{},
913
- primaryKey: "id",
914
- // If placeholder is not defined, the render
915
- // method will be called with null data
916
- placeholder: $2ad085849a522749$var$APIResultPlaceholder,
917
- debounce: 300,
918
- children: (data)=>{
919
- return (0, $Zz0sd$macrostrathyper)((0, $e94acad285dc5835$export$bb1a5c615d2117e4), {
920
- data: data
921
- });
922
- }
923
- };
924
- constructor(props, context){
925
- super(props, context);
926
- this._didFetch = false;
927
- this.getData = this.getData.bind(this);
928
- this._lazyGetData = (0, $Zz0sd$debounce)(this.getData, this.props.debounce);
929
- this.state = {
930
- data: null,
931
- isLoading: false
932
- };
933
- this.getData();
934
- }
935
- buildURL(props = null) {
936
- const { route: route , params: params } = props ?? this.props;
937
- const { buildURL: buildURL } = (0, $1ba261b8f20bb510$export$e0fe1438ea49d99e)(this.context);
938
- return buildURL(route, params);
939
- }
940
- componentDidUpdate(prevProps) {
941
- if (prevProps.debounce !== this.props.debounce) this._lazyGetData = (0, $Zz0sd$debounce)(this.getData, this.props.debounce);
942
- if (this.buildURL() === this.buildURL(prevProps)) return;
943
- return this._lazyGetData();
944
- }
945
- async getData() {
946
- this._didFetch = false;
947
- // if (this.context?.get == null) {
948
- // return
949
- // }
950
- const { route: route , params: params , opts: opts } = this.props;
951
- if (route == null) return;
952
- const { get: get } = (0, $1ba261b8f20bb510$export$1b4fffb1855b248b)(this.context);
953
- this.setState({
954
- isLoading: true
955
- });
956
- const data = await get(route, params, opts);
957
- this._didFetch = true;
958
- // Run side effects...
959
- this.props.onSuccess(data);
960
- this.setState({
961
- data: data,
962
- isLoading: false
963
- });
964
- }
965
- renderInner() {
966
- const { data: data , isLoading: isLoading } = this.state;
967
- const { children: children } = this.props;
968
- if (typeof children == "function") return children(data);
969
- else if ((0, $Zz0sd$isValidElement)(children)) return (0, $Zz0sd$cloneElement)(children, {
970
- data: data,
971
- isLoading: isLoading
972
- });
973
- else throw new Error("The APIResultView component must have a single child element or a function");
974
- }
975
- render() {
976
- const { data: data , isLoading: isLoading } = this.state;
977
- const { placeholder: placeholder } = this.props;
978
- if (data == null && placeholder != null) return (0, $Zz0sd$macrostrathyper)(placeholder, {
979
- isLoading: isLoading
980
- });
981
- if (Array.isArray(data)) return (0, $Zz0sd$macrostrathyper)((0, $9419dfbe0ed171f8$export$9251b6be4313cb0a), {
982
- totalCount: data.length,
983
- indexOffset: 0
984
- }, this.renderInner());
985
- return this.renderInner();
986
- }
987
- }
988
-
989
-
990
-
991
-
992
-
993
-
994
- const $c72ce1a3cdf81bf8$export$68f5e1453c188a82 = (props)=>{
995
- const { currentPage: currentPage , nextDisabled: nextDisabled , setPage: setPage } = props;
996
- return (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$ButtonGroup), [
997
- (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Button), {
998
- onClick: setPage(currentPage - 1),
999
- icon: "arrow-left",
1000
- disabled: currentPage <= 0
1001
- }, "Previous"),
1002
- (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Button), {
1003
- onClick: setPage(currentPage + 1),
1004
- rightIcon: "arrow-right",
1005
- disabled: nextDisabled
1006
- }, "Next")
1007
- ]);
1008
- };
1009
- class $c72ce1a3cdf81bf8$export$8ca47a148f0106b7 extends (0, $Zz0sd$Component) {
1010
- static defaultProps = {
1011
- count: null,
1012
- perPage: 20,
1013
- topPagination: false,
1014
- bottomPagination: true,
1015
- extraPagination: null,
1016
- opts: {},
1017
- params: {},
1018
- getTotalCount (response) {
1019
- const { headers: headers } = response;
1020
- return parseInt(headers["x-total-count"]);
1021
- }
1022
- };
1023
- constructor(props){
1024
- super(props);
1025
- this.setPage = this.setPage.bind(this);
1026
- this.params = this.params.bind(this);
1027
- this.state = {
1028
- currentPage: 0,
1029
- count: null
1030
- };
1031
- }
1032
- setPage(i) {
1033
- return ()=>{
1034
- return this.setState({
1035
- currentPage: i
1036
- });
1037
- };
1038
- }
1039
- renderPagination() {
1040
- const { perPage: perPage } = this.props;
1041
- const { count: count } = this.state;
1042
- let nextDisabled = false;
1043
- let paginationInfo = null;
1044
- let currentPage = this.currentPage();
1045
- const lastPage = this.lastPage();
1046
- if (lastPage != null) {
1047
- if (currentPage >= lastPage) {
1048
- currentPage = lastPage;
1049
- nextDisabled = true;
1050
- }
1051
- paginationInfo = (0, $Zz0sd$macrostrathyper)("div", {
1052
- disabled: true
1053
- }, [
1054
- `${currentPage + 1} of ${lastPage + 1} (${count} records)`
1055
- ]);
1056
- }
1057
- return (0, $Zz0sd$macrostrathyper)("div.pagination-controls", [
1058
- (0, $Zz0sd$macrostrathyper)($c72ce1a3cdf81bf8$export$68f5e1453c188a82, {
1059
- currentPage: currentPage,
1060
- nextDisabled: nextDisabled,
1061
- setPage: this.setPage
1062
- }),
1063
- this.props.extraPagination,
1064
- paginationInfo
1065
- ]);
1066
- }
1067
- lastPage() {
1068
- const { count: count } = this.state;
1069
- const { perPage: perPage } = this.props;
1070
- if (count == null) return null;
1071
- let pages = Math.floor(count / perPage);
1072
- if (count % perPage === 0) pages -= 1;
1073
- return pages;
1074
- }
1075
- currentPage() {
1076
- let { currentPage: currentPage } = this.state;
1077
- const lastPage = this.lastPage();
1078
- if (lastPage != null && currentPage >= lastPage) return lastPage;
1079
- if (currentPage < 0) currentPage = 0;
1080
- return currentPage;
1081
- }
1082
- params() {
1083
- const { params: params , perPage: perPage } = this.props;
1084
- let { offset: offset , limit: limit , ...otherParams } = params;
1085
- const currentPage = this.currentPage();
1086
- if (offset == null) offset = 0;
1087
- offset += currentPage * perPage;
1088
- // This shouldn't happen but it does
1089
- if (offset < 0) offset = 0;
1090
- if (limit == null || limit > perPage) limit = perPage;
1091
- return {
1092
- offset: offset,
1093
- limit: limit,
1094
- ...otherParams
1095
- };
1096
- }
1097
- render() {
1098
- let { route: route , perPage: perPage , children: children , getTotalCount: getTotalCount , primaryKey: primaryKey , count: count , topPagination: topPagination , bottomPagination: bottomPagination , extraPagination: extraPagination , params: params , opts: opts , ...rest } = this.props;
1099
- params = this.params();
1100
- // Create new onResponse function
1101
- const { onResponse: __onResponse } = opts;
1102
- const onResponse = (response)=>{
1103
- count = getTotalCount(response);
1104
- this.setState({
1105
- count: count
1106
- });
1107
- // Run inherited onResponse if it exists
1108
- if (__onResponse != null) return __onResponse(response);
1109
- };
1110
- // Options for get
1111
- opts = {
1112
- ...opts,
1113
- onResponse: onResponse
1114
- };
1115
- const _children = (data)=>{
1116
- if (this.state.count === 0) return (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$NonIdealState), {
1117
- icon: "search",
1118
- title: "No results"
1119
- });
1120
- // @ts-ignore
1121
- return children(data);
1122
- };
1123
- return (0, $Zz0sd$macrostrathyper)("div.pagination-container", rest, [
1124
- topPagination ? this.renderPagination() : undefined,
1125
- (0, $Zz0sd$macrostrathyper)((0, $2ad085849a522749$export$afb22da0139d52), {
1126
- route: route,
1127
- params: params,
1128
- opts: opts,
1129
- primaryKey: primaryKey
1130
- }, _children),
1131
- bottomPagination ? this.renderPagination() : undefined
1132
- ]);
1133
- }
1134
- }
1135
-
1136
-
1137
-
1138
-
1139
-
1140
-
1141
-
1142
-
1143
-
1144
-
1145
-
1146
-
1147
-
1148
-
1149
-
1150
- function $c3a2838befa3702c$var$infiniteScrollReducer(state, action) {
1151
- switch(action.type){
1152
- case "update-state":
1153
- return (0, $Zz0sd$immutabilityhelper)(state, action.spec);
1154
- case "load-page":
1155
- action.callback(action);
1156
- return (0, $Zz0sd$immutabilityhelper)(state, {
1157
- // @ts-ignore
1158
- isLoadingPage: {
1159
- $set: action.params.page ?? 0
1160
- }
1161
- });
1162
- }
1163
- }
1164
- function $c3a2838befa3702c$var$InfiniteScroll(props) {
1165
- const { hasMore: hasMore , children: children , className: className , loadMore: loadMore } = props;
1166
- const { ref: ref , inView: inView } = (0, $Zz0sd$useInView)({
1167
- rootMargin: "0px 0px -100px 0px"
1168
- });
1169
- (0, $Zz0sd$useEffect)(()=>{
1170
- if (!hasMore || !inView) return;
1171
- loadMore();
1172
- }, [
1173
- inView,
1174
- hasMore
1175
- ]);
1176
- return (0, $Zz0sd$macrostrathyper)("div.infinite-scroll-container", {
1177
- className: className
1178
- }, [
1179
- children,
1180
- //h.if(state.isLoadingPage != null)(placeholder),
1181
- (0, $Zz0sd$macrostrathyper)("div.bottom-marker", {
1182
- ref: ref
1183
- }),
1184
- ]);
1185
- }
1186
- const $c3a2838befa3702c$var$Placeholder = (props)=>{
1187
- const { loading: loading , title: title = "No results yet" , description: description = null , ...rest } = props;
1188
- return (0, $Zz0sd$macrostrathyper)("div.placeholder", [
1189
- (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$NonIdealState), {
1190
- icon: "search-template",
1191
- className: "placeholder-inner",
1192
- title: title,
1193
- description: description,
1194
- ...rest
1195
- }),
1196
- ]);
1197
- };
1198
- const $c3a2838befa3702c$var$LoadingPlaceholder = (props)=>{
1199
- const { perPage: perPage = 10 , loadedCount: loadedCount = 0 , itemName: itemName = "results" } = props;
1200
- const { totalCount: totalCount = 0 } = props;
1201
- let description = null;
1202
- if (totalCount != null) {
1203
- const loadedPages = Math.ceil(loadedCount / perPage);
1204
- const totalPages = Math.ceil(totalCount / perPage);
1205
- description = `Page ${loadedPages} of ${totalPages}`;
1206
- }
1207
- return (0, $Zz0sd$macrostrathyper)($c3a2838befa3702c$var$Placeholder, {
1208
- icon: (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Spinner)),
1209
- title: "Loading " + itemName,
1210
- description: description
1211
- });
1212
- };
1213
- function $c3a2838befa3702c$var$EmptyPlaceholder() {
1214
- return (0, $Zz0sd$macrostrathyper)($c3a2838befa3702c$var$Placeholder, {
1215
- icon: "inbox",
1216
- title: "No results"
1217
- });
1218
- }
1219
- function $c3a2838befa3702c$var$FinishedPlaceholder({ totalCount: totalCount , ...rest }) {
1220
- const description = totalCount != null ? `${totalCount} total items` : null;
1221
- return (0, $Zz0sd$macrostrathyper)($c3a2838befa3702c$var$Placeholder, {
1222
- icon: null,
1223
- title: "No more results",
1224
- description: description,
1225
- ...rest
1226
- });
1227
- }
1228
- function $c3a2838befa3702c$export$cf3938cbf75fae22(props) {
1229
- /*
1230
- A container for cursor-based pagination. This is built for
1231
- the GeoDeepDive API right now, but it can likely be generalized
1232
- for other uses.
1233
- */ const { route: route , params: params , opts: opts , placeholder: placeholder , className: className , itemComponent: itemComponent = (0, $e94acad285dc5835$export$bb1a5c615d2117e4) , loadingPlaceholder: loadingPlaceholder = $c3a2838befa3702c$var$LoadingPlaceholder , emptyPlaceholder: emptyPlaceholder = $c3a2838befa3702c$var$EmptyPlaceholder , finishedPlaceholder: finishedPlaceholder = $c3a2838befa3702c$var$FinishedPlaceholder , resultsComponent: resultsComponent = "div.results" , perPage: perPage = 10 , startPage: startPage = 0 , } = props;
1234
- const { get: get } = (0, $1ba261b8f20bb510$export$116f03ca263301c4)();
1235
- const { getCount: getCount , getNextParams: getNextParams , getItems: getItems , hasMore: hasMore } = props;
1236
- const initialState = {
1237
- items: [],
1238
- scrollParams: params,
1239
- count: null,
1240
- error: null,
1241
- hasMore: true,
1242
- isLoadingPage: null,
1243
- pageIndex: startPage
1244
- };
1245
- const pageOffset = 0;
1246
- const [state, dispatch] = (0, $Zz0sd$useReducer)($c3a2838befa3702c$var$infiniteScrollReducer, initialState);
1247
- const loadPage = (0, $Zz0sd$useCallback)(async (action)=>{
1248
- const res = await get(route, action.params, opts);
1249
- console.log("Loaded page with params", action.params);
1250
- const itemVals = getItems(res);
1251
- const ival = {
1252
- $push: itemVals
1253
- };
1254
- const nextLength = state.items.length + itemVals.length;
1255
- const count = getCount(res);
1256
- console.log(state.items);
1257
- // if (state.isLoadingPage == null) {
1258
- // // We have externally cancelled this request (by e.g. moving to a new results set)
1259
- // console.log("Loading cancelled")
1260
- // return
1261
- // }
1262
- let p1 = getNextParams(res, params);
1263
- let hasNextParams = p1 != null;
1264
- console.log("Next page parameters", p1);
1265
- action.dispatch({
1266
- type: "update-state",
1267
- spec: {
1268
- items: ival,
1269
- // @ts-ignore
1270
- scrollParams: {
1271
- $set: p1
1272
- },
1273
- pageIndex: {
1274
- $set: state.pageIndex + 1
1275
- },
1276
- count: {
1277
- $set: count
1278
- },
1279
- hasMore: {
1280
- $set: hasMore(res) && itemVals.length > 0 && hasNextParams
1281
- },
1282
- isLoadingPage: {
1283
- $set: null
1284
- }
1285
- }
1286
- });
1287
- }, [
1288
- state.items,
1289
- route,
1290
- params,
1291
- opts
1292
- ]);
1293
- const loadMore = (0, $Zz0sd$useCallback)(()=>{
1294
- dispatch({
1295
- type: "load-page",
1296
- params: state.scrollParams,
1297
- dispatch: dispatch,
1298
- // @ts-ignore
1299
- callback: loadPage
1300
- });
1301
- }, [
1302
- state.scrollParams,
1303
- loadPage,
1304
- route,
1305
- params,
1306
- opts
1307
- ]);
1308
- const isInitialRender = (0, $Zz0sd$useRef)(true);
1309
- const loadInitialData = (0, $Zz0sd$useCallback)(function() {
1310
- // Don't run on initial render
1311
- if (isInitialRender.current) {
1312
- isInitialRender.current = false;
1313
- return;
1314
- }
1315
- console.log("Resetting to initial data");
1316
- /*
1317
- Get the initial dataset
1318
- */ // const success = await get(route, params, opts);
1319
- // parseResponse(success, true)
1320
- //if (state.items.length == 0 && state.isLoadingPage == null) return
1321
- dispatch({
1322
- type: "update-state",
1323
- spec: {
1324
- $set: initialState
1325
- }
1326
- });
1327
- //await loadNext(0)
1328
- }, [
1329
- isInitialRender,
1330
- route,
1331
- params,
1332
- opts
1333
- ]);
1334
- (0, $Zz0sd$useEffect)(loadInitialData, [
1335
- props.route,
1336
- props.params
1337
- ]);
1338
- if (state == null) return null;
1339
- //useAsyncEffect(getInitialData, [route, params]);
1340
- //const showLoader = state.isLoadingPage != null && state.items.length > 0
1341
- const data = state.items;
1342
- const isLoading = state.isLoadingPage != null;
1343
- const isEmpty = data.length == 0 && !isLoading;
1344
- const isFinished = !state.hasMore && !isLoading;
1345
- const totalCount = props.totalCount ?? state.count;
1346
- return (0, $Zz0sd$macrostrathyper)($c3a2838befa3702c$var$InfiniteScroll, {
1347
- pageStart: -1,
1348
- loadMore: loadMore,
1349
- hasMore: state.hasMore && state.isLoadingPage == null,
1350
- loader: placeholder,
1351
- useWindow: true,
1352
- className: className
1353
- }, [
1354
- (0, $Zz0sd$macrostrathyper).if(isEmpty)(emptyPlaceholder),
1355
- (0, $Zz0sd$macrostrathyper).if(!isEmpty)((0, $9419dfbe0ed171f8$export$9251b6be4313cb0a), {
1356
- totalCount: totalCount,
1357
- indexOffset: 0
1358
- }, [
1359
- (0, $Zz0sd$macrostrathyper)(resultsComponent, {
1360
- data: data
1361
- }, data.map((d, i)=>{
1362
- return (0, $Zz0sd$macrostrathyper)(itemComponent, {
1363
- key: i,
1364
- data: d,
1365
- index: i
1366
- });
1367
- })),
1368
- // @ts-ignore
1369
- (0, $Zz0sd$macrostrathyper).if(isLoading)(loadingPlaceholder, {
1370
- totalCount: totalCount,
1371
- scrollParams: state.scrollParams,
1372
- pageIndex: state.pageIndex,
1373
- loadedCount: data.length,
1374
- perPage: perPage
1375
- }),
1376
- // @ts-ignore
1377
- (0, $Zz0sd$macrostrathyper).if(isFinished)(finishedPlaceholder, {
1378
- totalCount: totalCount
1379
- }),
1380
- ]),
1381
- ]);
1382
- }
1383
- $c3a2838befa3702c$export$cf3938cbf75fae22.defaultProps = {
1384
- hasMore (a, b) {
1385
- return true;
1386
- },
1387
- getItems (d) {
1388
- return d;
1389
- },
1390
- getCount (d) {
1391
- return null;
1392
- },
1393
- getNextParams (response, params) {
1394
- const lastPage = params.page ?? 0;
1395
- return {
1396
- ...params,
1397
- page: lastPage + 1
1398
- };
1399
- },
1400
- placeholder: (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Spinner))
1401
- };
1402
-
1403
-
1404
-
1405
-
1406
-
1407
-
1408
-
1409
-
1410
- function $15bac256d3e3deba$export$d6f68d0fe29f8050(props) {
1411
- let { handleDelete: handleDelete = ()=>{} , alertContent: alertContent , itemDescription: itemDescription = "this item" , ...rest } = props;
1412
- const [alertIsShown, setIsShown] = (0, $Zz0sd$useState)(false);
1413
- alertContent = alertContent ?? (0, $Zz0sd$macrostrathyper)([
1414
- "Are you sure you want to delete ",
1415
- itemDescription,
1416
- "?"
1417
- ]);
1418
- const onCancel = (e)=>{
1419
- setIsShown(false);
1420
- e.stopPropagation();
1421
- };
1422
- const onClick = (e)=>{
1423
- setIsShown(true);
1424
- e.stopPropagation();
1425
- };
1426
- const intent = (0, $Zz0sd$Intent).DANGER;
1427
- const icon = "trash";
1428
- return (0, $Zz0sd$macrostrathyper)([
1429
- (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Button), {
1430
- onClick: onClick,
1431
- icon: icon,
1432
- intent: intent,
1433
- ...rest
1434
- }),
1435
- (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Alert), {
1436
- isOpen: alertIsShown,
1437
- cancelButtonText: "Cancel",
1438
- confirmButtonText: "Delete",
1439
- icon: icon,
1440
- intent: intent,
1441
- onCancel: onCancel,
1442
- onConfirm: (e)=>{
1443
- handleDelete();
1444
- onCancel(e);
1445
- }
1446
- }, alertContent),
1447
- ]);
1448
- }
1449
-
1450
-
1451
- const $c01f104a42266e75$export$4ecda0163efe6d1d = function(props) {
1452
- let { className: className , inProgress: inProgress , disabled: disabled , ...rest } = props;
1453
- className = (0, $Zz0sd$classnames)(className, "save-button");
1454
- let icon = "floppy-disk";
1455
- if (inProgress) {
1456
- icon = (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Spinner), {
1457
- size: 20
1458
- });
1459
- disabled = true;
1460
- }
1461
- return (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Button), {
1462
- icon: icon,
1463
- intent: (0, $Zz0sd$Intent).SUCCESS,
1464
- className: className,
1465
- disabled: disabled,
1466
- ...rest
1467
- });
1468
- };
1469
- const $c01f104a42266e75$export$488fee190faedb43 = function(props) {
1470
- let { className: className , ...rest } = props;
1471
- className = (0, $Zz0sd$classnames)(className, "cancel-button");
1472
- return (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Button), {
1473
- intent: (0, $Zz0sd$Intent).WARNING,
1474
- className: className,
1475
- ...rest
1476
- });
1477
- };
1478
- const $c01f104a42266e75$export$a8d3280cb45e38b8 = function(props) {
1479
- let { isEditing: isEditing , intent: intent , icon: icon , className: className , ...rest } = props;
1480
- if (isEditing) {
1481
- if (intent == null) intent = null;
1482
- if (icon == null) icon = "tick";
1483
- } else {
1484
- if (intent == null) intent = (0, $Zz0sd$Intent).PRIMARY;
1485
- if (icon == null) icon = "edit";
1486
- }
1487
- className = (0, $Zz0sd$classnames)(className, "edit-button");
1488
- return (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Button), {
1489
- icon: icon,
1490
- intent: intent,
1491
- className: className,
1492
- ...rest
1493
- });
1494
- };
1495
-
1496
-
1497
-
1498
-
1499
-
1500
- //import "./main.sass";
1501
- const $0168a4e438d202b8$var$HeaderButton = (0, $Zz0sd$classed)((0, $Zz0sd$Button), "ms-header-button");
1502
- class $0168a4e438d202b8$export$18dc2e00e9f1cdb6 extends (0, $Zz0sd$Component) {
1503
- static defaultProps = {
1504
- title: "Panel",
1505
- // `storageID` prop allows storage of state in
1506
- // localStorage or equivalent.
1507
- storageID: null
1508
- };
1509
- constructor(props){
1510
- super(props);
1511
- this.state = {
1512
- isOpen: false
1513
- };
1514
- }
1515
- componentWillMount() {
1516
- // Set open state from local storage if it is available
1517
- const { storageID: storageID } = this.props;
1518
- if (storageID == null) return;
1519
- const isOpen = this.savedState()[storageID];
1520
- if (isOpen == null) return;
1521
- return this.setState({
1522
- isOpen: isOpen
1523
- });
1524
- }
1525
- /*
1526
- Next functions are for state management
1527
- across pages, if storageID prop is passed
1528
- */ savedState() {
1529
- try {
1530
- const st = window.localStorage.getItem("collapse-panel-state");
1531
- return JSON.parse(st) || {};
1532
- } catch (error) {
1533
- return {};
1534
- }
1535
- }
1536
- checkLocalStorage() {
1537
- // Set open state from local storage if it is available
1538
- const { storageID: storageID } = this.props;
1539
- if (storageID == null) return;
1540
- let isOpen = this.savedState()[storageID] || null;
1541
- if (isOpen == null) isOpen = false;
1542
- return this.setState({
1543
- isOpen: isOpen
1544
- });
1545
- }
1546
- componentDidUpdate(prevProps, prevState) {
1547
- // Refresh object in local storage
1548
- const { storageID: storageID } = this.props;
1549
- if (storageID == null) return;
1550
- const { isOpen: isOpen } = this.state;
1551
- if (isOpen === prevState.isOpen) return;
1552
- const s = this.savedState();
1553
- s[storageID] = isOpen;
1554
- const j = JSON.stringify(s);
1555
- return window.localStorage.setItem("collapse-panel-state", j);
1556
- }
1557
- render() {
1558
- let { title: title , children: children , storageID: storageID , headerRight: headerRight , ...props } = this.props;
1559
- const { isOpen: isOpen } = this.state;
1560
- const icon = isOpen ? "collapse-all" : "expand-all";
1561
- const onClick = ()=>this.setState({
1562
- isOpen: !isOpen
1563
- });
1564
- if (headerRight == null) headerRight = null;
1565
- return (0, $Zz0sd$macrostrathyper)("div.collapse-panel", props, [
1566
- (0, $Zz0sd$macrostrathyper)("div.panel-header", [
1567
- (0, $Zz0sd$macrostrathyper)($0168a4e438d202b8$var$HeaderButton, {
1568
- icon: icon,
1569
- minimal: true,
1570
- onClick: onClick,
1571
- fill: true
1572
- }, [
1573
- (0, $Zz0sd$macrostrathyper)("h2", title),
1574
- (0, $Zz0sd$macrostrathyper)("span.expander"),
1575
- ]),
1576
- headerRight,
1577
- ]),
1578
- (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Collapse), {
1579
- isOpen: isOpen
1580
- }, children),
1581
- ]);
1582
- }
1583
- }
1584
-
1585
-
1586
-
1587
-
1588
- function $720b8541aa87291d$export$2c381a86421d5abf(props) {
1589
- let { linkComponent: linkComponent = "a" , to: to , href: href , className: className , elevation: elevation = 0 , ...rest } = props;
1590
- className = (0, $Zz0sd$classnames)("link-card", "bp4-card", `bp4-elevation-${elevation}`, className);
1591
- if (linkComponent == "a" && href == null) href = to;
1592
- return (0, $Zz0sd$macrostrathyper)(linkComponent, {
1593
- to: to,
1594
- href: href,
1595
- className: className,
1596
- ...rest
1597
- });
1598
- }
1599
-
1600
-
1601
-
1602
-
1603
-
1604
-
1605
-
1606
- const $9579b5932bc507f3$var$FileListItem = function(props) {
1607
- const { file: file } = props;
1608
- return (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Tag), {
1609
- icon: "document"
1610
- }, file.name);
1611
- };
1612
- const $9579b5932bc507f3$var$FileList = function(props) {
1613
- let { files: files , placeholder: placeholder } = props;
1614
- if (placeholder == null) placeholder = "Choose file...";
1615
- if (files == null || !(files.length > 0)) return placeholder;
1616
- return (0, $Zz0sd$macrostrathyper)("div.files", files.map((file)=>(0, $Zz0sd$macrostrathyper)($9579b5932bc507f3$var$FileListItem, {
1617
- file: file
1618
- })));
1619
- };
1620
- class $9579b5932bc507f3$export$c6861759eaf17d6d extends (0, $Zz0sd$Component) {
1621
- static defaultProps = {
1622
- onAddFile () {},
1623
- onCancel () {}
1624
- };
1625
- constructor(props){
1626
- super(props);
1627
- this.renderDropzone = this.renderDropzone.bind(this);
1628
- }
1629
- renderDropzone({ getRootProps: getRootProps , getInputProps: getInputProps , isDragActive: isDragActive }) {
1630
- const { files: files } = this.props;
1631
- const rootProps = getRootProps();
1632
- const className = (0, $Zz0sd$classnames)("file-upload", {
1633
- "dropzone-active": isDragActive
1634
- });
1635
- const inputProps = getInputProps();
1636
- inputProps.style = {};
1637
- inputProps.className = "bp4-large";
1638
- let msg = "Drop files here";
1639
- if (!isDragActive) msg += ", or click to upload";
1640
- return (0, $Zz0sd$macrostrathyper)("div", {
1641
- className: className,
1642
- ...rootProps
1643
- }, [
1644
- (0, $Zz0sd$macrostrathyper)("label.bp4-file-input.bp4-large", [
1645
- (0, $Zz0sd$macrostrathyper)("input", inputProps),
1646
- (0, $Zz0sd$macrostrathyper)("div.bp4-file-upload-input", [
1647
- (0, $Zz0sd$macrostrathyper)($9579b5932bc507f3$var$FileList, {
1648
- files: files,
1649
- placeholder: msg
1650
- }),
1651
- ]),
1652
- ]),
1653
- ]);
1654
- }
1655
- render() {
1656
- return (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$reactdropzone), {
1657
- onDrop: this.props.onAddFile,
1658
- onFileDialogCancel: this.props.onCancel
1659
- }, this.renderDropzone);
1660
- }
1661
- }
1662
-
1663
-
1664
-
1665
-
1666
-
1667
- class $ad5d6f888cccc15b$export$bc9e3f556d599374 extends (0, $Zz0sd$Component) {
1668
- constructor(props){
1669
- super(props);
1670
- this.state = {
1671
- imageSize: null
1672
- };
1673
- }
1674
- render() {
1675
- let { maxHeight: maxHeight , maxWidth: maxWidth , src: src } = this.props;
1676
- const { imageSize: imageSize } = this.state;
1677
- if (maxHeight == null) maxHeight = 200;
1678
- if (maxWidth == null) maxWidth = 200;
1679
- if (imageSize != null) {
1680
- if (maxHeight > imageSize.height) maxHeight = imageSize.height;
1681
- if (maxWidth > imageSize.width) maxWidth = imageSize.width;
1682
- }
1683
- const imgStyle = {
1684
- maxHeight: maxHeight,
1685
- maxWidth: maxWidth
1686
- };
1687
- const style = {
1688
- maxHeight: maxHeight,
1689
- maxWidth: maxWidth
1690
- };
1691
- return (0, $Zz0sd$macrostrathyper)("div.image-container", {
1692
- style: style
1693
- }, [
1694
- (0, $Zz0sd$macrostrathyper)("img", {
1695
- src: src,
1696
- style: imgStyle
1697
- }),
1698
- ]);
1699
- }
1700
- componentDidMount() {
1701
- const el = (0, $Zz0sd$findDOMNode)(this);
1702
- // @ts-ignore
1703
- const img = el.querySelector("img");
1704
- return img.onload = ()=>{
1705
- const height = img.naturalHeight / 2;
1706
- const width = img.naturalWidth / 2;
1707
- return this.setState({
1708
- imageSize: {
1709
- height: height,
1710
- width: width
1711
- }
1712
- });
1713
- };
1714
- }
1715
- }
1716
-
1717
-
1718
-
1719
-
1720
-
1721
-
1722
-
1723
-
1724
-
1725
-
1726
-
1727
- const $d8bf6f5b11aab3d4$export$7bb606b28f318c99 = (0, $Zz0sd$createContext)({});
1728
- function $d8bf6f5b11aab3d4$export$9405ac9c5e44a343(props) {
1729
- const { isEditing: isEditing , actions: actions } = (0, $Zz0sd$useContext)($d8bf6f5b11aab3d4$export$7bb606b28f318c99);
1730
- return (0, $Zz0sd$macrostrathyper)((0, $c01f104a42266e75$export$a8d3280cb45e38b8), {
1731
- isEditing: isEditing,
1732
- onClick: actions.toggleEditing,
1733
- ...props
1734
- });
1735
- }
1736
- class $d8bf6f5b11aab3d4$export$2790a62d45a916eb extends (0, $07d653833556bec3$export$d43a63efdfca7551) {
1737
- static defaultProps = {
1738
- canEdit: true
1739
- };
1740
- constructor(props){
1741
- super(props);
1742
- this.getValue = this.getValue.bind(this);
1743
- this.hasChanges = this.hasChanges.bind(this);
1744
- this.onChange = this.onChange.bind(this);
1745
- this.toggleEditing = this.toggleEditing.bind(this);
1746
- this.persistChanges = this.persistChanges.bind(this);
1747
- this.onPersistChanges = this.onPersistChanges.bind(this);
1748
- this.state = {
1749
- isEditing: props.isEditing || false,
1750
- isPersisting: null,
1751
- error: null,
1752
- model: props.model,
1753
- initialModel: props.model
1754
- };
1755
- }
1756
- render() {
1757
- const { model: model } = this.state;
1758
- const { canEdit: canEdit } = this.props;
1759
- const isEditing = this.state.isEditing && canEdit;
1760
- const actions = (()=>{
1761
- let onChange, persistChanges, toggleEditing, updateState;
1762
- return { onChange: onChange , toggleEditing: toggleEditing , updateState: updateState , persistChanges: persistChanges } = this;
1763
- })();
1764
- const value = {
1765
- actions: actions,
1766
- model: model,
1767
- isEditing: isEditing,
1768
- canEdit: canEdit,
1769
- hasChanges: this.hasChanges
1770
- };
1771
- return (0, $Zz0sd$macrostrathyper)($d8bf6f5b11aab3d4$export$7bb606b28f318c99.Provider, {
1772
- value: value
1773
- }, this.props.children);
1774
- }
1775
- getValue(field) {
1776
- return this.state.model[field];
1777
- }
1778
- hasChanges(field) {
1779
- if (field == null) return this.state.initialModel !== this.state.model;
1780
- return this.state.initialModel[field] !== this.state.model[field];
1781
- }
1782
- onChange(field) {
1783
- return (value)=>{
1784
- // @ts-ignore
1785
- return this.updateState({
1786
- model: {
1787
- [field]: {
1788
- $set: value
1789
- }
1790
- }
1791
- });
1792
- };
1793
- }
1794
- toggleEditing() {
1795
- const spec = {
1796
- $toggle: [
1797
- "isEditing"
1798
- ]
1799
- };
1800
- if (this.state.isEditing) spec.model = {
1801
- $set: this.state.initialModel
1802
- };
1803
- return this.updateState(spec);
1804
- }
1805
- onPersistChanges() {
1806
- return this.persistChanges(null);
1807
- }
1808
- async persistChanges(spec) {
1809
- const { persistChanges: persistChanges } = this.props;
1810
- // Persist changes expects a promise
1811
- let updatedModel = this.state.model;
1812
- if (spec != null) {
1813
- // If changeset is provided, we need to integrate
1814
- // it before proceeding
1815
- console.log(spec);
1816
- updatedModel = (0, $Zz0sd$immutabilityhelper)(this.state.model, spec);
1817
- }
1818
- console.log(updatedModel);
1819
- let ret = null;
1820
- if (persistChanges == null) return null;
1821
- try {
1822
- this.updateState({
1823
- isPersisting: {
1824
- $set: true
1825
- }
1826
- });
1827
- // Compute a shallow changeset of the model fields
1828
- const changeset = {};
1829
- for(let k in updatedModel){
1830
- const v = updatedModel[k];
1831
- if (v === this.state.initialModel[k]) continue;
1832
- changeset[k] = v;
1833
- }
1834
- ret = await persistChanges(updatedModel, changeset);
1835
- } catch (err) {
1836
- console.error(err);
1837
- } finally{
1838
- spec = {
1839
- isPersisting: {
1840
- $set: false
1841
- }
1842
- };
1843
- if (ret != null) {
1844
- // @ts-ignore
1845
- const newModel = (0, $Zz0sd$immutabilityhelper)(this.state.initialModel, {
1846
- $merge: ret
1847
- });
1848
- console.log(newModel);
1849
- spec.model = {
1850
- $set: newModel
1851
- };
1852
- spec.initialModel = {
1853
- $set: newModel
1854
- };
1855
- }
1856
- this.updateState(spec);
1857
- }
1858
- }
1859
- componentDidUpdate(prevProps) {
1860
- if (prevProps == null) return;
1861
- if (prevProps === this.props) return;
1862
- const spec = {};
1863
- if (this.props.isEditing !== prevProps.isEditing && this.props.isEditing !== this.state.isEditing) spec.isEditing = {
1864
- $set: this.props.isEditing
1865
- };
1866
- if (this.props.model !== prevProps.model) {
1867
- spec.initialModel = {
1868
- $set: this.props.model
1869
- };
1870
- if (!this.props.isEditing) // If we aren't in edit mode, we want to propagate changes into the model
1871
- spec.model = {
1872
- $set: this.props.model
1873
- };
1874
- }
1875
- return this.updateState(spec);
1876
- }
1877
- }
1878
- function $d8bf6f5b11aab3d4$export$87df09dd8c975450(props) {
1879
- let { field: field , className: className } = props;
1880
- const { actions: actions , model: model , isEditing: isEditing } = (0, $Zz0sd$useContext)($d8bf6f5b11aab3d4$export$7bb606b28f318c99);
1881
- let value = model[field];
1882
- const onChange = actions.onChange(field);
1883
- className = (0, $Zz0sd$classnames)(className, `field-${field}`);
1884
- if (isEditing) value = (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$EditableText), {
1885
- placeholder: `Edit ${field}`,
1886
- multiline: true,
1887
- className: className,
1888
- onChange: onChange,
1889
- value: value
1890
- });
1891
- return (0, $Zz0sd$macrostrathyper)("div.text", {
1892
- className: className
1893
- }, value);
1894
- }
1895
- class $d8bf6f5b11aab3d4$export$5b46768848f0b1af extends (0, $Zz0sd$Component) {
1896
- static contextType = $d8bf6f5b11aab3d4$export$7bb606b28f318c99;
1897
- render() {
1898
- const { field: field } = this.props;
1899
- const { actions: actions , model: model , isEditing: isEditing } = this.context;
1900
- const value = model[field];
1901
- if (!isEditing) return (0, $Zz0sd$macrostrathyper)("div.date-input.disabled", value);
1902
- return (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$DateInput), {
1903
- className: "date-input",
1904
- value: new Date(value),
1905
- formatDate: (date)=>date.toLocaleDateString(),
1906
- placeholder: "MM/DD/YYYY",
1907
- showActionsBar: true,
1908
- onChange: actions.onChange(field),
1909
- parseDate (d) {
1910
- return new Date(d);
1911
- }
1912
- });
1913
- }
1914
- }
1915
- const $d8bf6f5b11aab3d4$export$862ca33d4f264f44 = ()=>(0, $Zz0sd$useContext)($d8bf6f5b11aab3d4$export$7bb606b28f318c99);
1916
-
1917
-
1918
-
1919
-
1920
-
1921
-
1922
- // We might want to refactor this
1923
- function $c8a29764c15c7584$export$eabdb384c91c91d8() {
1924
- return (0, $Zz0sd$Toaster).create();
1925
- }
1926
- const $c8a29764c15c7584$var$ToasterCtx = (0, $Zz0sd$createContext)(null);
1927
- function $c8a29764c15c7584$var$ContextualToaster({ containerRef: containerRef , setToaster: setToaster , ...rest }) {
1928
- const toaster = (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Toaster), {
1929
- usePortal: false,
1930
- ref: (t)=>setToaster(t),
1931
- ...rest
1932
- });
1933
- if (containerRef?.current == null) return toaster;
1934
- return (0, $Zz0sd$createPortal)(toaster, containerRef.current);
1935
- }
1936
- function $c8a29764c15c7584$export$9194c0aa0cd7a9ff(props) {
1937
- const { children: children , toasts: toasts , containerRef: containerRef , ...rest } = props;
1938
- const [toaster, setToaster] = (0, $Zz0sd$useState)(null);
1939
- return (0, $Zz0sd$macrostrathyper)($c8a29764c15c7584$var$ToasterCtx.Provider, {
1940
- value: toaster
1941
- }, [
1942
- (0, $Zz0sd$macrostrathyper)($c8a29764c15c7584$var$ContextualToaster, {
1943
- containerRef: containerRef,
1944
- setToaster: setToaster,
1945
- ...rest
1946
- }, toasts),
1947
- children,
1948
- ]);
1949
- }
1950
- function $c8a29764c15c7584$export$f46171b59bb094f9() {
1951
- return (0, $Zz0sd$useContext)($c8a29764c15c7584$var$ToasterCtx);
1952
- }
1953
-
1954
-
1955
-
1956
-
1957
- const $82d0f2ad3888006d$var$Author = function(props) {
1958
- const { name: name , highlight: highlight } = props;
1959
- if (name === highlight) return (0, $Zz0sd$macrostrathyper)("b.author", name);
1960
- return (0, $Zz0sd$macrostrathyper)("span.author", name);
1961
- };
1962
- const $82d0f2ad3888006d$export$58d4e953cdb891c9 = function(props) {
1963
- const { names: names , highlight: highlight } = props;
1964
- const A = (name)=>(0, $Zz0sd$macrostrathyper)($82d0f2ad3888006d$var$Author, {
1965
- name: name,
1966
- highlight: highlight
1967
- });
1968
- if (!Array.isArray(names)) return A(names);
1969
- const n = names.length;
1970
- if (n === 0) return null;
1971
- if (n === 1) return A(names[0]);
1972
- const limit = props.limit ?? n;
1973
- const truncated = n > limit;
1974
- const penultimateIx = limit - 1;
1975
- const L = [];
1976
- for (const [i, name1] of names.entries()){
1977
- L.push(A(name1));
1978
- L.push(i < penultimateIx && n != 2 ? ", " : " ");
1979
- if (i === penultimateIx - 1 && n != 1 && !truncated) L.push("and ");
1980
- if (i >= limit - 1 && truncated) {
1981
- L.push("et al.");
1982
- break;
1983
- }
1984
- }
1985
- return (0, $Zz0sd$macrostrathyper)("span.author-list", L);
1986
- };
1987
-
1988
-
1989
-
1990
-
1991
-
1992
-
1993
-
1994
-
1995
-
1996
-
1997
- const $4d9090acf52f664f$var$VolumeNumber = function(props) {
1998
- const { volume: volume , number: number } = props;
1999
- const _ = [];
2000
- if (volume != null && volume !== "") _.push((0, $Zz0sd$macrostrathyper)("span.volume", null, volume));
2001
- if (number != null && number !== "") {
2002
- _.push("(");
2003
- _.push((0, $Zz0sd$macrostrathyper)("span.number", number));
2004
- _.push(")");
2005
- }
2006
- if (_.length === 0) return null;
2007
- _.push(", ");
2008
- return (0, $Zz0sd$macrostrathyper)("span", null, _);
2009
- };
2010
- function $4d9090acf52f664f$var$InnerCard(props) {
2011
- let { title: title , author: author , doi: doi , journal: journal , identifier: identifier , volume: volume , number: number , year: year } = props;
2012
- try {
2013
- ({ id: doi } = identifier.find((d)=>d.type === "doi"));
2014
- } catch (error) {
2015
- doi = null;
2016
- }
2017
- const names = author.map(function(d) {
2018
- const n = d.name.split(", ");
2019
- n.reverse();
2020
- return n.join(" ");
2021
- });
2022
- return (0, $Zz0sd$macrostrathyper)([
2023
- (0, $Zz0sd$macrostrathyper)((0, $82d0f2ad3888006d$export$58d4e953cdb891c9), {
2024
- names: names,
2025
- limit: 3
2026
- }),
2027
- ", ",
2028
- (0, $Zz0sd$macrostrathyper)("span.title", title),
2029
- ", ",
2030
- (0, $Zz0sd$macrostrathyper)("span.journal", journal),
2031
- ", ",
2032
- (0, $Zz0sd$macrostrathyper)($4d9090acf52f664f$var$VolumeNumber, {
2033
- volume: volume,
2034
- number: number
2035
- }),
2036
- (0, $Zz0sd$macrostrathyper)("span.year", year),
2037
- ", ",
2038
- (0, $Zz0sd$macrostrathyper)("span.doi-title", "doi: "),
2039
- (0, $Zz0sd$macrostrathyper)("span.doi", doi)
2040
- ]);
2041
- }
2042
- function $4d9090acf52f664f$export$10a18204501a9fa5(props) {
2043
- return (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Card), {
2044
- interactive: false,
2045
- className: "gdd-article"
2046
- }, [
2047
- // @ts-ignore
2048
- (0, $Zz0sd$macrostrathyper)($4d9090acf52f664f$var$InnerCard, props)
2049
- ]);
2050
- }
2051
- class $4d9090acf52f664f$export$6aebfcf875c7efcc extends (0, $Zz0sd$Component) {
2052
- render() {
2053
- let url;
2054
- const { link: link , ...rest } = this.props;
2055
- try {
2056
- ({ url: url } = link.find((d)=>d.type === "publisher"));
2057
- } catch (error) {
2058
- url = null;
2059
- }
2060
- return (0, $Zz0sd$macrostrathyper)((0, $720b8541aa87291d$export$2c381a86421d5abf), {
2061
- href: url,
2062
- target: "_blank",
2063
- className: "gdd-article"
2064
- }, // @ts-ignore
2065
- (0, $Zz0sd$macrostrathyper)($4d9090acf52f664f$var$InnerCard, rest));
2066
- }
2067
- }
2068
- function $4d9090acf52f664f$export$fba1dae4a8833e2c(props) {
2069
- const { data: data } = props;
2070
- return (0, $Zz0sd$macrostrathyper)([
2071
- (0, $Zz0sd$macrostrathyper)("h1", "Related Terms"),
2072
- (0, $Zz0sd$macrostrathyper)("ul#related_terms", data.map((item)=>(0, $Zz0sd$macrostrathyper)("li", item[0])))
2073
- ]);
2074
- }
2075
- const $4d9090acf52f664f$var$PlaceholderReference = ()=>{
2076
- return (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Card), {
2077
- className: `gdd-article ${(0, $Zz0sd$Classes).SKELETON}`
2078
- }, "word ".repeat(35));
2079
- };
2080
- const $4d9090acf52f664f$export$bf78a679dde24aee = (props)=>{
2081
- const { docid: docid } = props;
2082
- return (0, $Zz0sd$macrostrathyper)((0, $2ad085849a522749$export$afb22da0139d52), {
2083
- route: "https://geodeepdive.org/api/articles",
2084
- params: {
2085
- docid: docid
2086
- },
2087
- opts: {
2088
- unwrapResponse (res) {
2089
- return res.success.data[0];
2090
- },
2091
- memoize: true
2092
- },
2093
- placeholder: $4d9090acf52f664f$var$PlaceholderReference
2094
- }, (data)=>{
2095
- try {
2096
- return (0, $Zz0sd$macrostrathyper)($4d9090acf52f664f$export$6aebfcf875c7efcc, data);
2097
- } catch (error) {
2098
- return null;
2099
- }
2100
- });
2101
- };
2102
-
2103
-
2104
-
2105
-
2106
-
2107
- const $33f06e347cd34062$export$7460c8b7e4ce9582 = ({ src: src , ...rest })=>(0, $Zz0sd$macrostrathyper)("div", {
2108
- dangerouslySetInnerHTML: {
2109
- __html: src,
2110
- ...rest
2111
- }
2112
- });
2113
- const $33f06e347cd34062$export$9dcd2b1ca4768128 = $33f06e347cd34062$export$7460c8b7e4ce9582;
2114
-
2115
-
2116
-
2117
-
2118
-
2119
-
2120
- const $70366c8972398d2a$var$systemDarkMode = ()=>({
2121
- isEnabled: $70366c8972398d2a$var$matcher?.matches ?? false,
2122
- isAutoset: true
2123
- });
2124
- const $70366c8972398d2a$var$ValueContext = (0, $Zz0sd$createContext)({
2125
- isEnabled: false,
2126
- isAutoset: false
2127
- });
2128
- const $70366c8972398d2a$var$UpdaterContext = (0, $Zz0sd$createContext)(null);
2129
- const $70366c8972398d2a$var$matcher = window?.matchMedia("(prefers-color-scheme: dark)");
2130
- const $70366c8972398d2a$var$_DarkModeProvider = (props)=>{
2131
- const { addBodyClasses: addBodyClasses = true , isEnabled: isEnabled1 , followSystem: followSystem = false , children: children , } = props;
2132
- const [storedValue, updateValue, resetState] = (0, $962bc0f04255cfc3$export$8b052fe25089340e)("ui-dark-mode", $70366c8972398d2a$var$systemDarkMode());
2133
- // Guards so that we don't error on an invalid stored value
2134
- const value = {
2135
- isEnabled: storedValue?.isEnabled ?? false,
2136
- isAutoset: storedValue?.isAutoset ?? false
2137
- };
2138
- (0, $Zz0sd$useEffect)(()=>{
2139
- if (!followSystem) return;
2140
- updateValue($70366c8972398d2a$var$systemDarkMode());
2141
- }, []);
2142
- (0, $Zz0sd$useEffect)(()=>{
2143
- // Update value if isEnabled is provided
2144
- if (isEnabled1 == null) return;
2145
- updateValue({
2146
- isAutoset: false,
2147
- isEnabled: isEnabled1
2148
- });
2149
- }, [
2150
- isEnabled1
2151
- ]);
2152
- // Manage dark mode body classes
2153
- (0, $Zz0sd$useEffect)(()=>{
2154
- if (!addBodyClasses) return;
2155
- if (value.isEnabled) document.body.classList.add("bp4-dark");
2156
- else document.body.classList.remove("bp4-dark");
2157
- }, [
2158
- storedValue
2159
- ]);
2160
- const update = (enabled)=>{
2161
- if (enabled == null) return resetState();
2162
- const isEnabled = enabled ?? !value.isEnabled;
2163
- updateValue({
2164
- isAutoset: false,
2165
- isEnabled: isEnabled
2166
- });
2167
- };
2168
- const onSystemChange = (0, $Zz0sd$useCallback)((e)=>{
2169
- if (value.isAutoset || followSystem) updateValue($70366c8972398d2a$var$systemDarkMode());
2170
- }, [
2171
- value.isAutoset,
2172
- followSystem
2173
- ]);
2174
- (0, $Zz0sd$useEffect)(()=>{
2175
- if ($70366c8972398d2a$var$matcher == null) return;
2176
- $70366c8972398d2a$var$matcher.addEventListener("change", onSystemChange);
2177
- return ()=>{
2178
- $70366c8972398d2a$var$matcher.removeEventListener("change", onSystemChange);
2179
- };
2180
- }, [
2181
- onSystemChange
2182
- ]);
2183
- return (0, $Zz0sd$macrostrathyper)($70366c8972398d2a$var$ValueContext.Provider, {
2184
- value: value
2185
- }, (0, $Zz0sd$macrostrathyper)($70366c8972398d2a$var$UpdaterContext.Provider, {
2186
- value: update
2187
- }, children));
2188
- };
2189
- const $70366c8972398d2a$export$6c869dfd601c964b = (props)=>{
2190
- // Ensure that only one provider is active for an application
2191
- const parentCtx = (0, $Zz0sd$useContext)($70366c8972398d2a$var$UpdaterContext);
2192
- if (parentCtx != null) return props.children ?? null;
2193
- return (0, $Zz0sd$macrostrathyper)($70366c8972398d2a$var$_DarkModeProvider, props);
2194
- };
2195
- const $70366c8972398d2a$export$4673cbff94e146e2 = ()=>(0, $Zz0sd$useContext)($70366c8972398d2a$var$ValueContext);
2196
- const $70366c8972398d2a$export$da73e849bfb9b978 = ()=>$70366c8972398d2a$export$4673cbff94e146e2()?.isEnabled ?? false;
2197
- const $70366c8972398d2a$export$2158f0320fd21632 = ()=>(0, $Zz0sd$useContext)($70366c8972398d2a$var$UpdaterContext);
2198
- const $70366c8972398d2a$export$4ca1a7f9e076e79b = (props)=>{
2199
- const { allowReset: allowReset = true , showText: showText = false , children: children , ...rest } = props;
2200
- const { isEnabled: isEnabled , isAutoset: isAutoset } = $70366c8972398d2a$export$4673cbff94e146e2();
2201
- const icon = isEnabled ? "flash" : "moon";
2202
- const update = $70366c8972398d2a$export$2158f0320fd21632();
2203
- const onClick = (event)=>{
2204
- if (update == null) {
2205
- console.warn("No DarkModeProvider is available");
2206
- return;
2207
- }
2208
- if (allowReset && event.shiftKey) {
2209
- update(null);
2210
- return;
2211
- }
2212
- update(!isEnabled);
2213
- };
2214
- const active = !isAutoset;
2215
- return (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Button), {
2216
- active: active,
2217
- ...rest,
2218
- icon: icon,
2219
- onClick: onClick
2220
- }, [
2221
- (0, $Zz0sd$macrostrathyper).if(showText)([
2222
- isEnabled ? "Light" : "Dark"
2223
- ]),
2224
- children,
2225
- ]);
2226
- };
2227
-
2228
-
2229
-
2230
-
2231
-
2232
-
2233
- var $4ec1d86cd773cb72$exports = {};
2234
-
2235
- $parcel$export($4ec1d86cd773cb72$exports, "bp4-slider", () => $4ec1d86cd773cb72$export$cbeaddd6cc70281e, (v) => $4ec1d86cd773cb72$export$cbeaddd6cc70281e = v);
2236
- $parcel$export($4ec1d86cd773cb72$exports, "mui-slider-disabled", () => $4ec1d86cd773cb72$export$223d74fd94b8aafd, (v) => $4ec1d86cd773cb72$export$223d74fd94b8aafd = v);
2237
- $parcel$export($4ec1d86cd773cb72$exports, "bp4-slider-handle", () => $4ec1d86cd773cb72$export$4169bb8e8b0a147a, (v) => $4ec1d86cd773cb72$export$4169bb8e8b0a147a = v);
2238
- $parcel$export($4ec1d86cd773cb72$exports, "controls", () => $4ec1d86cd773cb72$export$cc1adf6fb659c762, (v) => $4ec1d86cd773cb72$export$cc1adf6fb659c762 = v);
2239
- $parcel$export($4ec1d86cd773cb72$exports, "nullable-slider", () => $4ec1d86cd773cb72$export$9d79918c5e5ccc23, (v) => $4ec1d86cd773cb72$export$9d79918c5e5ccc23 = v);
2240
- var $4ec1d86cd773cb72$export$cbeaddd6cc70281e;
2241
- var $4ec1d86cd773cb72$export$223d74fd94b8aafd;
2242
- var $4ec1d86cd773cb72$export$4169bb8e8b0a147a;
2243
- var $4ec1d86cd773cb72$export$cc1adf6fb659c762;
2244
- var $4ec1d86cd773cb72$export$9d79918c5e5ccc23;
2245
- $4ec1d86cd773cb72$export$cbeaddd6cc70281e = `TW5XUq_bp4-slider`;
2246
- $4ec1d86cd773cb72$export$223d74fd94b8aafd = `TW5XUq_mui-slider-disabled`;
2247
- $4ec1d86cd773cb72$export$4169bb8e8b0a147a = `TW5XUq_bp4-slider-handle`;
2248
- $4ec1d86cd773cb72$export$cc1adf6fb659c762 = `TW5XUq_controls`;
2249
- $4ec1d86cd773cb72$export$9d79918c5e5ccc23 = `TW5XUq_nullable-slider`;
2250
-
2251
-
2252
- const $23a8c77e45754d90$var$h = (0, $Zz0sd$hyperStyled)((0, (/*@__PURE__*/$parcel$interopDefault($4ec1d86cd773cb72$exports))));
2253
- const $23a8c77e45754d90$export$7ef4bdb422d782a6 = (props)=>{
2254
- const [value, setValue] = (0, $Zz0sd$useState)(props.value);
2255
- const onChange = (v)=>{
2256
- setValue(v), props.onChange?.(v);
2257
- };
2258
- (0, $Zz0sd$useEffect)(()=>setValue(props.value), [
2259
- props.value
2260
- ]);
2261
- return $23a8c77e45754d90$var$h((0, $Zz0sd$Slider), {
2262
- ...props,
2263
- onChange: onChange,
2264
- value: value
2265
- });
2266
- };
2267
- const $23a8c77e45754d90$export$3b926a11a6c9c62e = (props)=>{
2268
- let { value: value , showTrackFill: showTrackFill , className: className , ...rest } = props;
2269
- if (value == null) {
2270
- value = rest.min ?? 0;
2271
- showTrackFill = false;
2272
- className = (0, $Zz0sd$classnames)(className, "mui-slider-disabled");
2273
- }
2274
- const handleChange = props.onRelease ?? props.onChange;
2275
- const onClick = ()=>handleChange?.(null);
2276
- return $23a8c77e45754d90$var$h("div.nullable-slider", [
2277
- $23a8c77e45754d90$var$h($23a8c77e45754d90$export$7ef4bdb422d782a6, {
2278
- ...rest,
2279
- className: className,
2280
- value: value,
2281
- showTrackFill: showTrackFill
2282
- }),
2283
- $23a8c77e45754d90$var$h("div.controls", [
2284
- $23a8c77e45754d90$var$h((0, $Zz0sd$Button), {
2285
- minimal: true,
2286
- onClick: onClick,
2287
- small: true,
2288
- icon: "cross",
2289
- disabled: props.value == null,
2290
- intent: props.value == null ? null : (0, $Zz0sd$Intent).DANGER
2291
- }),
2292
- ]),
2293
- ]);
2294
- };
2295
-
2296
-
2297
-
2298
-
2299
-
2300
-
2301
-
2302
-
2303
- // Could rework this to use `constate` or similar
2304
- function $8ac9e51b4286144e$export$a869ef99cf8f9bed(defaultValue) {
2305
- /** Function that creates a context with an updateable settings object
2306
- */ const Context = (0, $Zz0sd$createContext)(defaultValue);
2307
- const UpdateContext = (0, $Zz0sd$createContext)(null);
2308
- const Provider = function(props) {
2309
- /*
2310
- A settings provider that can be used with LocalStorage
2311
- */ let { storageID: storageID , children: children , ...defaultSettings } = props;
2312
- // Update from local storage
2313
- let storage = null;
2314
- console.log("Setting up SettingsProvider [ui-components]");
2315
- if (storageID != null) {
2316
- // Merge initial options if set
2317
- storage = new (0, $962bc0f04255cfc3$export$19fffca37ef3e106)(storageID);
2318
- const v = storage.get() || {};
2319
- console.log("Loading from local storage", v);
2320
- // @ts-ignore
2321
- defaultSettings = (0, $Zz0sd$immutabilityhelper)(defaultSettings, {
2322
- $merge: v
2323
- });
2324
- }
2325
- // @ts-ignore
2326
- const [settings, setState] = (0, $Zz0sd$useState)(defaultSettings);
2327
- const updateState = function(spec) {
2328
- const newSettings = (0, $Zz0sd$immutabilityhelper)(settings, spec);
2329
- setState(newSettings);
2330
- if (storage != null) return storage.set(newSettings);
2331
- };
2332
- return (0, $Zz0sd$macrostrathyper)(Context.Provider, {
2333
- value: settings
2334
- }, [
2335
- (0, $Zz0sd$macrostrathyper)(UpdateContext.Provider, {
2336
- value: updateState
2337
- }, children),
2338
- ]);
2339
- };
2340
- const useValue = ()=>(0, $Zz0sd$useContext)(Context);
2341
- const useUpdater = (key)=>{
2342
- const updater = (0, $Zz0sd$useContext)(UpdateContext);
2343
- if (key == null) return updater;
2344
- //@ts-ignore
2345
- return (spec)=>updater({
2346
- [key]: spec
2347
- });
2348
- };
2349
- return [
2350
- Provider,
2351
- useValue,
2352
- useUpdater
2353
- ];
2354
- }
2355
- const [$8ac9e51b4286144e$export$e134aa690da9cc14, $8ac9e51b4286144e$export$9115b42802a3e44f, $8ac9e51b4286144e$var$useSettingsUpdater] = $8ac9e51b4286144e$export$a869ef99cf8f9bed({});
2356
- // Deprecated: this is kind of confusing
2357
- const $8ac9e51b4286144e$export$f558026a994b6051 = function(func) {
2358
- // Update settings using `immutability-helper` semantics
2359
- //@ts-ignore
2360
- const updater = $8ac9e51b4286144e$var$useSettingsUpdater();
2361
- return function() {
2362
- //@ts-ignore
2363
- return updater(func(...arguments));
2364
- };
2365
- };
2366
-
2367
-
2368
-
2369
-
2370
-
2371
- function $c79c8405513fe4b1$export$9d6f03762e546d45(props) {
2372
- const { error: error , title: title = "Unknown error" } = props;
2373
- return (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Callout), {
2374
- title: title,
2375
- icon: "error",
2376
- intent: "danger"
2377
- }, (0, $Zz0sd$macrostrathyper)("p", null, (props.description ?? error?.toString()) ?? "No description available"));
2378
- }
2379
- class $c79c8405513fe4b1$export$e926676385687eaf extends (0, $Zz0sd$Component) {
2380
- constructor(props){
2381
- super(props);
2382
- this.state = {
2383
- error: null
2384
- };
2385
- }
2386
- static getDerivedStateFromError(error) {
2387
- // Update state so the next render will show the fallback UI.
2388
- return {
2389
- error: error
2390
- };
2391
- }
2392
- componentDidCatch(error, info) {
2393
- // You can also log the error to an error reporting service
2394
- console.log(error);
2395
- this.props.onCatch?.(error, info);
2396
- }
2397
- render() {
2398
- const { error: error } = this.state;
2399
- const { override: override = false } = this.props;
2400
- if (error != null || override) {
2401
- if (this.props.fallback != null) return this.props.fallback;
2402
- // You can render any custom fallback UI
2403
- return (0, $Zz0sd$macrostrathyper)($c79c8405513fe4b1$export$9d6f03762e546d45, {
2404
- error: error,
2405
- description: (this.props.description ?? error?.toString()) ?? "No description available",
2406
- title: this.props.title ?? "A rendering error has occured"
2407
- });
2408
- }
2409
- return this.props.children;
2410
- }
2411
- }
2412
-
2413
-
2414
- function $6e768a33687f9de5$export$fe58198efe02b173(url) {
2415
- return new Promise((resolve, reject)=>{
2416
- const img = new Image();
2417
- img.crossOrigin = "anonymous";
2418
- img.addEventListener("load", ()=>resolve(img));
2419
- img.addEventListener("error", (err)=>reject(err));
2420
- img.src = url;
2421
- });
2422
- }
2423
- function $6e768a33687f9de5$export$ad9337e5f425216b(ctx, img, backgroundColor, color, backgroundAlpha = 1, alpha = 1) {
2424
- // create hidden canvas
2425
- ctx.drawImage(img, 0, 0, img.width, img.height);
2426
- //ctx.fillStyle = imgColor;
2427
- //ctx.fillRect(0, 0, 40, 40);
2428
- // overlay using source-atop to follow transparency
2429
- ctx.globalCompositeOperation = "source-in";
2430
- //ctx.globalAlpha = 0.3;
2431
- ctx.globalAlpha = alpha;
2432
- ctx.fillStyle = color;
2433
- ctx.fillRect(0, 0, img.width, img.height);
2434
- ctx.globalCompositeOperation = "destination-over";
2435
- //const map = ctx.getImageData(0, 0, img.width, img.height);
2436
- ctx.globalAlpha = backgroundAlpha;
2437
- ctx.fillStyle = backgroundColor;
2438
- ctx.fillRect(0, 0, img.width, img.height);
2439
- //ctx.putImageData(map, 0, 0);
2440
- // replace image source with canvas data
2441
- return ctx;
2442
- }
2443
- function $6e768a33687f9de5$var$createSolidColorImage(ctx, imgColor, alpha = 1) {
2444
- ctx.globalAlpha = alpha;
2445
- ctx.fillStyle = imgColor;
2446
- ctx.fillRect(0, 0, 40, 40);
2447
- return ctx;
2448
- //return ctx.getImageData(0, 0, 40, 40);
2449
- }
2450
- let $6e768a33687f9de5$export$9fa9727fede86e80;
2451
- (function(ImageDataFormat1) {
2452
- ImageDataFormat1["HTMLImageData"] = "image-data";
2453
- ImageDataFormat1["Base64"] = "base64";
2454
- })($6e768a33687f9de5$export$9fa9727fede86e80 || ($6e768a33687f9de5$export$9fa9727fede86e80 = {}));
2455
- async function $6e768a33687f9de5$export$5c6d3bde03dc1e29(spec, outputFormat = $6e768a33687f9de5$export$9fa9727fede86e80.HTMLImageData) {
2456
- let ctx;
2457
- var canvas = document.createElement("canvas");
2458
- if (spec.patternURL == null) {
2459
- canvas.width = 40;
2460
- canvas.height = 40;
2461
- ctx = $6e768a33687f9de5$var$createSolidColorImage(canvas.getContext("2d"), spec.color ?? spec.patternColor);
2462
- } else {
2463
- const img = await $6e768a33687f9de5$export$fe58198efe02b173(spec.patternURL);
2464
- canvas.width = img.width;
2465
- canvas.height = img.height;
2466
- ctx = canvas.getContext("2d");
2467
- ctx = $6e768a33687f9de5$export$ad9337e5f425216b(ctx, img, spec.color, spec.patternColor ?? "#000000");
2468
- }
2469
- switch(outputFormat){
2470
- case $6e768a33687f9de5$export$9fa9727fede86e80.HTMLImageData:
2471
- return ctx.getImageData(0, 0, canvas.width, canvas.height);
2472
- case $6e768a33687f9de5$export$9fa9727fede86e80.Base64:
2473
- return canvas.toDataURL();
2474
- }
2475
- }
2476
-
2477
-
2478
-
2479
- const $1842546ddd4798db$var$vizBaseURL = "https://visualization-assets.s3.amazonaws.com";
2480
- const $1842546ddd4798db$var$patternBaseURL = $1842546ddd4798db$var$vizBaseURL + "/geologic-patterns/png";
2481
- const $1842546ddd4798db$var$lineSymbolsURL = $1842546ddd4798db$var$vizBaseURL + "/geologic-line-symbols/png";
2482
- function $1842546ddd4798db$var$_geologyPatternBaseURL(symbol, baseURL = $1842546ddd4798db$var$patternBaseURL) {
2483
- if (symbol == null) return null;
2484
- return baseURL + `/${symbol}.png`;
2485
- }
2486
- async function $1842546ddd4798db$var$_geologyPatternURL(patternID, color = null, patternColor = null) {
2487
- const url = $1842546ddd4798db$var$_geologyPatternBaseURL(patternID);
2488
- if (color == null && patternColor == null) return url;
2489
- const img = await (0, $6e768a33687f9de5$export$5c6d3bde03dc1e29)({
2490
- patternURL: url,
2491
- color: color,
2492
- patternColor: patternColor
2493
- }, (0, $6e768a33687f9de5$export$9fa9727fede86e80).Base64);
2494
- return img;
2495
- }
2496
- const $1842546ddd4798db$export$c78a3108c669ffb3 = $1842546ddd4798db$var$_geologyPatternURL;
2497
- const $1842546ddd4798db$export$203f95137df77466 = async (...args)=>(0, $6e768a33687f9de5$export$fe58198efe02b173)(await $1842546ddd4798db$export$203f95137df77466(...args));
2498
-
2499
-
2500
-
2501
-
2502
-
2503
- function $dd30f84b43282b34$export$ae1920fef0a09de8(props) {
2504
- /** Collapsible card taken from COSMOS visualizer */ const { isOpen: isOpen = true , keepChildrenMounted: keepChildrenMounted = true , transitionDuration: transitionDuration = 500 , className: className , children: children , ...rest } = props;
2505
- return (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Collapse), {
2506
- isOpen: isOpen,
2507
- keepChildrenMounted: keepChildrenMounted,
2508
- transitionDuration: transitionDuration
2509
- }, [
2510
- (0, $Zz0sd$macrostrathyper)("div.collapse-card-outer", [
2511
- (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Card), {
2512
- elevation: 1,
2513
- className: (0, $Zz0sd$classnames)(className, "mui-collapse-card"),
2514
- ...rest
2515
- }, (0, $Zz0sd$macrostrathyper)("div.inner", null, children)),
2516
- ]),
2517
- ]);
2518
- }
2519
-
2520
-
2521
-
2522
-
2523
- var $7798de452206f42d$exports = {};
2524
-
2525
- $parcel$export($7798de452206f42d$exports, "panel-column", () => $7798de452206f42d$export$b41821d1dd2069d4, (v) => $7798de452206f42d$export$b41821d1dd2069d4 = v);
2526
- $parcel$export($7798de452206f42d$exports, "panel-content", () => $7798de452206f42d$export$8ca81bb4a7c3bee, (v) => $7798de452206f42d$export$8ca81bb4a7c3bee = v);
2527
- $parcel$export($7798de452206f42d$exports, "overflow-hidden", () => $7798de452206f42d$export$15ee5781b96cbd33, (v) => $7798de452206f42d$export$15ee5781b96cbd33 = v);
2528
- $parcel$export($7798de452206f42d$exports, "panel-container-inner", () => $7798de452206f42d$export$95530b1b29b21d7, (v) => $7798de452206f42d$export$95530b1b29b21d7 = v);
2529
- $parcel$export($7798de452206f42d$exports, "panel", () => $7798de452206f42d$export$21f42ab9b6679f44, (v) => $7798de452206f42d$export$21f42ab9b6679f44 = v);
2530
- $parcel$export($7798de452206f42d$exports, "panel-header", () => $7798de452206f42d$export$90b77e3be608e918, (v) => $7798de452206f42d$export$90b77e3be608e918 = v);
2531
- $parcel$export($7798de452206f42d$exports, "panel-outer", () => $7798de452206f42d$export$e671aa0933ea24f9, (v) => $7798de452206f42d$export$e671aa0933ea24f9 = v);
2532
- $parcel$export($7798de452206f42d$exports, "extra-space", () => $7798de452206f42d$export$cd109afefddca7db, (v) => $7798de452206f42d$export$cd109afefddca7db = v);
2533
- $parcel$export($7798de452206f42d$exports, "expander", () => $7798de452206f42d$export$f194ed9df726ec47, (v) => $7798de452206f42d$export$f194ed9df726ec47 = v);
2534
- $parcel$export($7798de452206f42d$exports, "panel-container", () => $7798de452206f42d$export$9dd9a0eceddf6af6, (v) => $7798de452206f42d$export$9dd9a0eceddf6af6 = v);
2535
- $parcel$export($7798de452206f42d$exports, "minimal", () => $7798de452206f42d$export$10c083462c34aef3, (v) => $7798de452206f42d$export$10c083462c34aef3 = v);
2536
- $parcel$export($7798de452206f42d$exports, "content-panel", () => $7798de452206f42d$export$75659614cf20214d, (v) => $7798de452206f42d$export$75659614cf20214d = v);
2537
- var $7798de452206f42d$export$b41821d1dd2069d4;
2538
- var $7798de452206f42d$export$8ca81bb4a7c3bee;
2539
- var $7798de452206f42d$export$15ee5781b96cbd33;
2540
- var $7798de452206f42d$export$95530b1b29b21d7;
2541
- var $7798de452206f42d$export$21f42ab9b6679f44;
2542
- var $7798de452206f42d$export$90b77e3be608e918;
2543
- var $7798de452206f42d$export$e671aa0933ea24f9;
2544
- var $7798de452206f42d$export$cd109afefddca7db;
2545
- var $7798de452206f42d$export$f194ed9df726ec47;
2546
- var $7798de452206f42d$export$9dd9a0eceddf6af6;
2547
- var $7798de452206f42d$export$10c083462c34aef3;
2548
- var $7798de452206f42d$export$75659614cf20214d;
2549
- $7798de452206f42d$export$b41821d1dd2069d4 = `TGPwIq_panel-column`;
2550
- $7798de452206f42d$export$8ca81bb4a7c3bee = `TGPwIq_panel-content`;
2551
- $7798de452206f42d$export$15ee5781b96cbd33 = `TGPwIq_overflow-hidden`;
2552
- $7798de452206f42d$export$95530b1b29b21d7 = `TGPwIq_panel-container-inner`;
2553
- $7798de452206f42d$export$21f42ab9b6679f44 = `TGPwIq_panel`;
2554
- $7798de452206f42d$export$90b77e3be608e918 = `TGPwIq_panel-header`;
2555
- $7798de452206f42d$export$e671aa0933ea24f9 = `TGPwIq_panel-outer`;
2556
- $7798de452206f42d$export$cd109afefddca7db = `TGPwIq_extra-space`;
2557
- $7798de452206f42d$export$f194ed9df726ec47 = `TGPwIq_expander`;
2558
- $7798de452206f42d$export$9dd9a0eceddf6af6 = `TGPwIq_panel-container`;
2559
- $7798de452206f42d$export$10c083462c34aef3 = `TGPwIq_minimal`;
2560
- $7798de452206f42d$export$75659614cf20214d = `TGPwIq_content-panel`;
2561
-
2562
-
2563
-
2564
-
2565
-
2566
- function $dd2b2fa8345d7168$export$56806b18b5e92993(props) {
2567
- const { open: open , children: children , headerStyles: headerStyles = {} , className: className = "overlay" , cardStyles: cardStyles = {} , top: top = 100 , left: left = 20 , } = props;
2568
- const [state, setState] = (0, $Zz0sd$useState)({
2569
- top: top,
2570
- left: left
2571
- });
2572
- const [offset, setOffset] = (0, $Zz0sd$useState)({
2573
- rel_x: 0,
2574
- rel_y: 0
2575
- });
2576
- const [dragging, setDragging] = (0, $Zz0sd$useState)(false);
2577
- (0, $Zz0sd$useEffect)(()=>{
2578
- //setup event listeners
2579
- if (!dragging) return;
2580
- document.addEventListener("mousemove", onMouseMove, true);
2581
- document.addEventListener("mouseup", onMouseUp, true);
2582
- return ()=>{
2583
- document.removeEventListener("mouseup", onMouseUp, true);
2584
- document.removeEventListener("mousemove", onMouseMove, true);
2585
- };
2586
- }, [
2587
- dragging
2588
- ]);
2589
- const onMouseDown = (e)=>{
2590
- if (e.button !== 0) return;
2591
- setDragging(true);
2592
- setOffset(getOffest(e));
2593
- };
2594
- const onMouseUp = (e)=>{
2595
- setDragging(false);
2596
- e.stopPropagation();
2597
- e.preventDefault();
2598
- };
2599
- const getOffest = (e)=>{
2600
- const rel_x = e.pageX - state.left;
2601
- const rel_y = e.pageY - state.top;
2602
- return {
2603
- rel_x: rel_x,
2604
- rel_y: rel_y
2605
- };
2606
- };
2607
- const onMouseMove = (e)=>{
2608
- if (dragging) {
2609
- const { rel_x: rel_x , rel_y: rel_y } = offset;
2610
- const left_ = e.pageX - rel_x;
2611
- const top_ = e.pageY - rel_y;
2612
- setState({
2613
- top: top_,
2614
- left: left_
2615
- });
2616
- }
2617
- e.stopPropagation();
2618
- e.preventDefault();
2619
- };
2620
- const overlayProperties = {
2621
- autoFocus: true,
2622
- canEscapeKeyClose: true,
2623
- canOutsideClickClose: true,
2624
- enforceFocus: false,
2625
- hasBackdrop: false,
2626
- usePortal: true,
2627
- useTallContent: false
2628
- };
2629
- const style = {
2630
- top: `${state.top}px`,
2631
- left: `${state.left}px`
2632
- };
2633
- return (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Overlay), {
2634
- isOpen: open,
2635
- ...overlayProperties
2636
- }, [
2637
- (0, $Zz0sd$macrostrathyper)(`div.${className}`, {
2638
- styles: style
2639
- }, [
2640
- (0, $Zz0sd$macrostrathyper)((0, $Zz0sd$Card), {
2641
- style: cardStyles
2642
- }, [
2643
- (0, $Zz0sd$macrostrathyper)("div", {
2644
- onMouseDown: onMouseDown,
2645
- styles: headerStyles
2646
- }, [
2647
- props.HeaderComponent,
2648
- ]),
2649
- children,
2650
- ]),
2651
- ]),
2652
- ]);
2653
- }
2654
-
2655
-
2656
- const $e64decd575080523$var$h = (0, $Zz0sd$hyperStyled)((0, (/*@__PURE__*/$parcel$interopDefault($7798de452206f42d$exports))));
2657
- const $e64decd575080523$export$968713404ca1c9aa = function(props) {
2658
- const { title: title , onClose: onClose , children: children , allowTitleWrap: allowTitleWrap = false } = props;
2659
- return $e64decd575080523$var$h("div.panel-header", [
2660
- $e64decd575080523$var$h.if(title != null)("h1.title", {
2661
- className: allowTitleWrap ? null : "overflow-hidden"
2662
- }, title),
2663
- $e64decd575080523$var$h.if(children != null)([
2664
- $e64decd575080523$var$h("div.expander"),
2665
- children,
2666
- $e64decd575080523$var$h("div.extra-space")
2667
- ]),
2668
- $e64decd575080523$var$h((0, $Zz0sd$Button), {
2669
- minimal: true,
2670
- icon: "cross",
2671
- onClick: onClose
2672
- }),
2673
- ]);
2674
- };
2675
- function $e64decd575080523$var$MinimalModalPanel(props) {
2676
- const { children: children , className: className , style: style , headerChildren: headerChildren , ...rest } = props;
2677
- return $e64decd575080523$var$h("div.panel-column", [
2678
- $e64decd575080523$var$h("div.panel.minimal", {
2679
- className: className,
2680
- style: style
2681
- }, [
2682
- $e64decd575080523$var$h($e64decd575080523$export$968713404ca1c9aa, rest, headerChildren),
2683
- $e64decd575080523$var$h("div.panel-content", null, children),
2684
- ]),
2685
- $e64decd575080523$var$h("div.expander"),
2686
- ]);
2687
- }
2688
- function $e64decd575080523$export$80a09bd95a8fb873(props) {
2689
- const { children: children , className: className , style: style , minimal: minimal = false , headerChildren: headerChildren = null , ...rest } = props;
2690
- if (minimal) return $e64decd575080523$var$h($e64decd575080523$var$MinimalModalPanel, {
2691
- ...rest,
2692
- children: children,
2693
- headerChildren: headerChildren,
2694
- className: className,
2695
- style: style
2696
- });
2697
- return $e64decd575080523$var$h("div.panel-column", [
2698
- $e64decd575080523$var$h("div.panel-container", [
2699
- $e64decd575080523$var$h("div.panel-container-inner", [
2700
- $e64decd575080523$var$h("div.panel-outer", [
2701
- $e64decd575080523$var$h("div.panel", {
2702
- className: className,
2703
- style: style
2704
- }, [
2705
- $e64decd575080523$var$h($e64decd575080523$export$968713404ca1c9aa, rest, headerChildren),
2706
- $e64decd575080523$var$h("div.panel-content", null, children),
2707
- ]),
2708
- $e64decd575080523$var$h("div.expander"),
2709
- ]),
2710
- ]),
2711
- ]),
2712
- ]);
2713
- }
2714
- const $e64decd575080523$export$25c607d6a337a384 = (props)=>$e64decd575080523$var$h("div.content-panel", props);
2715
-
2716
-
2717
-
2718
-
2719
- var $d75f5cd4dad80e8f$exports = {};
2720
-
2721
- $parcel$export($d75f5cd4dad80e8f$exports, "expanded", () => $d75f5cd4dad80e8f$export$52105d146316f63c, (v) => $d75f5cd4dad80e8f$export$52105d146316f63c = v);
2722
- $parcel$export($d75f5cd4dad80e8f$exports, "main-column", () => $d75f5cd4dad80e8f$export$9c88f9a435c40ccb, (v) => $d75f5cd4dad80e8f$export$9c88f9a435c40ccb = v);
2723
- $parcel$export($d75f5cd4dad80e8f$exports, "user-interface", () => $d75f5cd4dad80e8f$export$e005ee6dda35184b, (v) => $d75f5cd4dad80e8f$export$e005ee6dda35184b = v);
2724
- $parcel$export($d75f5cd4dad80e8f$exports, "spacer", () => $d75f5cd4dad80e8f$export$8cc075c801fd6817, (v) => $d75f5cd4dad80e8f$export$8cc075c801fd6817 = v);
2725
- $parcel$export($d75f5cd4dad80e8f$exports, "three-column", () => $d75f5cd4dad80e8f$export$55d10750d58b7b01, (v) => $d75f5cd4dad80e8f$export$55d10750d58b7b01 = v);
2726
- $parcel$export($d75f5cd4dad80e8f$exports, "context-column", () => $d75f5cd4dad80e8f$export$9b1daf63e7965780, (v) => $d75f5cd4dad80e8f$export$9b1daf63e7965780 = v);
2727
- var $d75f5cd4dad80e8f$export$52105d146316f63c;
2728
- var $d75f5cd4dad80e8f$export$9c88f9a435c40ccb;
2729
- var $d75f5cd4dad80e8f$export$e005ee6dda35184b;
2730
- var $d75f5cd4dad80e8f$export$8cc075c801fd6817;
2731
- var $d75f5cd4dad80e8f$export$55d10750d58b7b01;
2732
- var $d75f5cd4dad80e8f$export$9b1daf63e7965780;
2733
- $d75f5cd4dad80e8f$export$52105d146316f63c = `tBd70W_expanded`;
2734
- $d75f5cd4dad80e8f$export$9c88f9a435c40ccb = `tBd70W_main-column`;
2735
- $d75f5cd4dad80e8f$export$e005ee6dda35184b = `tBd70W_user-interface`;
2736
- $d75f5cd4dad80e8f$export$8cc075c801fd6817 = `tBd70W_spacer`;
2737
- $d75f5cd4dad80e8f$export$55d10750d58b7b01 = `tBd70W_three-column`;
2738
- $d75f5cd4dad80e8f$export$9b1daf63e7965780 = `tBd70W_context-column`;
2739
-
2740
-
2741
-
2742
-
2743
-
2744
-
2745
- const $1304e13f8704f9b3$var$h = (0, $Zz0sd$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($d75f5cd4dad80e8f$exports))));
2746
- let $1304e13f8704f9b3$var$SidePanel;
2747
- (function(SidePanel1) {
2748
- SidePanel1["Context"] = "context";
2749
- SidePanel1["Detail"] = "detail";
2750
- })($1304e13f8704f9b3$var$SidePanel || ($1304e13f8704f9b3$var$SidePanel = {}));
2751
- function $1304e13f8704f9b3$var$openPanels(panelState) {
2752
- const keys = Object.keys(panelState);
2753
- return new Set(keys.filter((k)=>panelState[k]));
2754
- }
2755
- const $1304e13f8704f9b3$var$LayoutDispatchContext = (0, $Zz0sd$createContext)((a)=>a);
2756
- function $1304e13f8704f9b3$export$d7a924d9e0d0c40d() {
2757
- return (0, $Zz0sd$useContext)($1304e13f8704f9b3$var$LayoutDispatchContext);
2758
- }
2759
- function $1304e13f8704f9b3$var$layoutReducer(state, action) {
2760
- let panel;
2761
- let shouldShow;
2762
- switch(action.type){
2763
- case "set-is-reduced":
2764
- return {
2765
- ...state,
2766
- isReduced: action.value
2767
- };
2768
- case "show-panel":
2769
- shouldShow = action.shouldShow;
2770
- case "toggle-panel":
2771
- panel = action.panel;
2772
- shouldShow ??= !state.panelState[panel];
2773
- const panelState = {
2774
- ...state.panelState,
2775
- [panel]: shouldShow
2776
- };
2777
- let keyPanel = state.keyPanel;
2778
- if (shouldShow) keyPanel = panel;
2779
- else if (state.keyPanel == panel) keyPanel = null;
2780
- const currentPanels = $1304e13f8704f9b3$var$openPanels(panelState);
2781
- if (currentPanels.size == 1) keyPanel = currentPanels.values().next().value;
2782
- return {
2783
- ...state,
2784
- panelState: panelState,
2785
- keyPanel: keyPanel
2786
- };
2787
- }
2788
- }
2789
- function $1304e13f8704f9b3$var$buttonProps(panel, desiredState, actualState, dispatch) {
2790
- const active = desiredState[panel];
2791
- const isActuallyShown = active && active == actualState[panel];
2792
- return {
2793
- active: active,
2794
- minimal: true,
2795
- intent: isActuallyShown ? (0, $Zz0sd$Intent).PRIMARY : null,
2796
- onClick () {
2797
- dispatch({
2798
- type: "show-panel",
2799
- panel: panel,
2800
- shouldShow: !isActuallyShown
2801
- });
2802
- }
2803
- };
2804
- }
2805
- function $1304e13f8704f9b3$export$24349bc9b29e1403(props) {
2806
- const { contextPanel: contextPanel , detailPanel: detailPanel , title: title = "User interface" , children: children , footer: footer , panelState: panelState = {} , twoPanelBreakpoint: twoPanelBreakpoint = 800 , preferredMainWidth: preferredMainWidth , expandedContext: expandedContext = false , headerActions: headerActions = null , contextButtonPlacement: contextButtonPlacement = (0, $Zz0sd$Position).LEFT , ...rest } = props;
2807
- let keyPanel = null;
2808
- if (panelState.detail) keyPanel = $1304e13f8704f9b3$var$SidePanel.Detail;
2809
- else if (panelState.context) keyPanel = $1304e13f8704f9b3$var$SidePanel.Context;
2810
- const [layoutState, dispatch] = (0, $Zz0sd$useReducer)($1304e13f8704f9b3$var$layoutReducer, {
2811
- panelState: {
2812
- context: true,
2813
- ...panelState
2814
- },
2815
- keyPanel: keyPanel,
2816
- isReduced: false
2817
- }, undefined);
2818
- const [size, ref] = (0, $Zz0sd$useelementdimensions)();
2819
- const [mainSize, mainRef] = (0, $Zz0sd$useelementdimensions)();
2820
- const panelDesiredState = {
2821
- ...layoutState.panelState,
2822
- ...panelState
2823
- };
2824
- let panelActualState = {
2825
- ...panelDesiredState
2826
- };
2827
- const nonKeyPanel = layoutState.keyPanel == $1304e13f8704f9b3$var$SidePanel.Context ? $1304e13f8704f9b3$var$SidePanel.Detail : $1304e13f8704f9b3$var$SidePanel.Context;
2828
- // We'd like the main panel to take up at least half the screen width
2829
- const preferredMainPanelWidth = preferredMainWidth ?? Math.max((size?.width ?? 0) * 0.5, twoPanelBreakpoint * 0.66);
2830
- if (layoutState.isReduced) panelActualState[nonKeyPanel] = false;
2831
- if (expandedContext) {
2832
- panelActualState[$1304e13f8704f9b3$var$SidePanel.Context] = true;
2833
- panelActualState[$1304e13f8704f9b3$var$SidePanel.Detail] = false;
2834
- }
2835
- (0, $Zz0sd$useEffect)(()=>{
2836
- if ($1304e13f8704f9b3$var$openPanels(panelActualState).size <= 1) return;
2837
- // Decide whether we need to reduce the layout ONLY when both panels are open
2838
- const shouldReduce = mainSize?.width < preferredMainPanelWidth;
2839
- dispatch({
2840
- type: "set-is-reduced",
2841
- value: shouldReduce
2842
- });
2843
- }, [
2844
- mainSize
2845
- ]);
2846
- const contextButton = $1304e13f8704f9b3$var$h.if(contextPanel != null)((0, $Zz0sd$Button), {
2847
- icon: "projects",
2848
- ...$1304e13f8704f9b3$var$buttonProps($1304e13f8704f9b3$var$SidePanel.Context, panelDesiredState, panelActualState, dispatch)
2849
- });
2850
- return $1304e13f8704f9b3$var$h($1304e13f8704f9b3$var$LayoutDispatchContext.Provider, {
2851
- value: dispatch
2852
- }, $1304e13f8704f9b3$var$h("div.user-interface", {
2853
- ref: ref,
2854
- ...rest
2855
- }, [
2856
- $1304e13f8704f9b3$var$h((0, $Zz0sd$Navbar), [
2857
- $1304e13f8704f9b3$var$h((0, $Zz0sd$Navbar).Group, [
2858
- $1304e13f8704f9b3$var$h.if(contextButtonPlacement == "left")([
2859
- contextButton,
2860
- $1304e13f8704f9b3$var$h("div.spacer"),
2861
- ]),
2862
- $1304e13f8704f9b3$var$h((0, $Zz0sd$Navbar).Heading, null, title),
2863
- ]),
2864
- $1304e13f8704f9b3$var$h((0, $Zz0sd$NavbarGroup), {
2865
- align: (0, $Zz0sd$Alignment).RIGHT
2866
- }, [
2867
- headerActions,
2868
- $1304e13f8704f9b3$var$h("div.spacer"),
2869
- $1304e13f8704f9b3$var$h((0, $Zz0sd$ButtonGroup), {
2870
- minimal: true
2871
- }, [
2872
- $1304e13f8704f9b3$var$h.if(contextButtonPlacement == "right")([
2873
- contextButton
2874
- ]),
2875
- $1304e13f8704f9b3$var$h.if(detailPanel != null)((0, $Zz0sd$Button), {
2876
- icon: "properties",
2877
- ...$1304e13f8704f9b3$var$buttonProps($1304e13f8704f9b3$var$SidePanel.Detail, panelDesiredState, panelActualState, dispatch)
2878
- }),
2879
- ]),
2880
- ]),
2881
- ]),
2882
- $1304e13f8704f9b3$var$h("div.three-column", [
2883
- $1304e13f8704f9b3$var$h.if(contextPanel != null && panelActualState.context)("div.column.context-column", {
2884
- className: (0, $Zz0sd$classnames)({
2885
- expanded: expandedContext ?? false
2886
- })
2887
- }, contextPanel),
2888
- $1304e13f8704f9b3$var$h.if(children != null)("div.column.main-column", {
2889
- ref: mainRef
2890
- }, children),
2891
- $1304e13f8704f9b3$var$h.if(detailPanel != null && panelActualState.detail)("div.column.detail-column", null, detailPanel),
2892
- ]),
2893
- $1304e13f8704f9b3$var$h.if(footer != null)("footer", null, footer),
2894
- ]));
2895
- }
2896
- $1304e13f8704f9b3$export$24349bc9b29e1403.Panels = $1304e13f8704f9b3$var$SidePanel;
2897
-
2898
-
2899
-
2900
-
2901
- var $4fae2d573d730db8$exports = {};
2902
-
2903
- $parcel$export($4fae2d573d730db8$exports, "ValueWithUnit", () => $4fae2d573d730db8$export$716098b85fd0efdf);
2904
- $parcel$export($4fae2d573d730db8$exports, "DegreeCoord", () => $4fae2d573d730db8$export$af8082af0bea3eb1);
2905
- $parcel$export($4fae2d573d730db8$exports, "LngLatCoords", () => $4fae2d573d730db8$export$f195b3550849e560);
2906
- $parcel$export($4fae2d573d730db8$exports, "Elevation", () => $4fae2d573d730db8$export$58bfb4f6ec5aa58d);
2907
-
2908
-
2909
- function $3e1bd09be8f70c4c$export$424827e271c4ba96(val, zoom) {
2910
- if (zoom < 2) return $3e1bd09be8f70c4c$export$e54bbd2c33d17485(val);
2911
- else if (zoom < 4) return $3e1bd09be8f70c4c$export$4c173b1b2f78faf7(val);
2912
- else if (zoom < 7) return $3e1bd09be8f70c4c$export$b1cb0f7fb990b3ea(val);
2913
- return $3e1bd09be8f70c4c$export$97c1b10e131a836d(val);
2914
- }
2915
- function $3e1bd09be8f70c4c$export$e94ac56c4c53fe58(lng) {
2916
- // via https://github.com/Leaflet/Leaflet/blob/32c9156cb1d1c9bd53130639ec4d8575fbeef5a6/src/core/Util.js#L87
2917
- return (((lng - 180) % 360 + 360) % 360 - 180).toFixed(4);
2918
- }
2919
- const $3e1bd09be8f70c4c$export$97c1b10e131a836d = (0, $Zz0sd$format)(".4~f");
2920
- const $3e1bd09be8f70c4c$export$b1cb0f7fb990b3ea = (0, $Zz0sd$format)(".3~f");
2921
- const $3e1bd09be8f70c4c$export$4c173b1b2f78faf7 = (0, $Zz0sd$format)(".2~f");
2922
- const $3e1bd09be8f70c4c$export$e54bbd2c33d17485 = (0, $Zz0sd$format)(".1~f");
2923
- const $3e1bd09be8f70c4c$export$bc135f63e2f56fd4 = (0, $Zz0sd$format)(".0f");
2924
- function $3e1bd09be8f70c4c$export$7c4d25c0c3217d8c(val, precision = 0) {
2925
- switch(precision){
2926
- case 4:
2927
- return $3e1bd09be8f70c4c$export$97c1b10e131a836d(val);
2928
- case 3:
2929
- return $3e1bd09be8f70c4c$export$b1cb0f7fb990b3ea(val);
2930
- case 2:
2931
- return $3e1bd09be8f70c4c$export$4c173b1b2f78faf7(val);
2932
- case 1:
2933
- return $3e1bd09be8f70c4c$export$e54bbd2c33d17485(val);
2934
- case 0:
2935
- return $3e1bd09be8f70c4c$export$bc135f63e2f56fd4(val);
2936
- default:
2937
- return $3e1bd09be8f70c4c$export$97c1b10e131a836d(val);
2938
- }
2939
- }
2940
- function $3e1bd09be8f70c4c$export$d284c26147b5ca34(meters, precision = 0) {
2941
- return (meters * 3.28084).toFixed(precision);
2942
- }
2943
-
2944
-
2945
- function $4fae2d573d730db8$export$716098b85fd0efdf(props) {
2946
- const { value: value , unit: unit } = props;
2947
- return (0, $Zz0sd$macrostrathyper)("span.value-with-unit", [
2948
- (0, $Zz0sd$macrostrathyper)("span.value", [
2949
- value
2950
- ]),
2951
- (0, $Zz0sd$macrostrathyper)("span.spacer", [
2952
- " "
2953
- ]),
2954
- (0, $Zz0sd$macrostrathyper)("span.unit", [
2955
- unit
2956
- ]),
2957
- ]);
2958
- }
2959
- function $4fae2d573d730db8$export$af8082af0bea3eb1(props) {
2960
- const { value: value , labels: labels , precision: precision = 3 , format: format = (0, $3e1bd09be8f70c4c$export$7c4d25c0c3217d8c) } = props;
2961
- const direction = value < 0 ? labels[1] : labels[0];
2962
- return (0, $Zz0sd$macrostrathyper)($4fae2d573d730db8$export$716098b85fd0efdf, {
2963
- value: format(Math.abs(value), precision) + "\xb0",
2964
- unit: direction
2965
- });
2966
- }
2967
- function $4fae2d573d730db8$export$f195b3550849e560(props) {
2968
- /** Formatted geographic coordinates */ const { position: position , className: className , precision: precision , zoom: zoom } = props;
2969
- let { format: format } = props;
2970
- if (position == null) return null;
2971
- let lat, lng;
2972
- if (Array.isArray(position)) [lng, lat] = position;
2973
- else ({ lat: lat , lng: lng } = position);
2974
- if (zoom != null && format == null && precision == null) format = (val, _)=>(0, $3e1bd09be8f70c4c$export$424827e271c4ba96)(val, zoom);
2975
- return (0, $Zz0sd$macrostrathyper)("div.lnglat-container", {
2976
- className: className
2977
- }, [
2978
- (0, $Zz0sd$macrostrathyper)("span.lnglat", [
2979
- (0, $Zz0sd$macrostrathyper)($4fae2d573d730db8$export$af8082af0bea3eb1, {
2980
- value: lat,
2981
- labels: [
2982
- "N",
2983
- "S"
2984
- ],
2985
- precision: precision,
2986
- format: format
2987
- }),
2988
- ", ",
2989
- (0, $Zz0sd$macrostrathyper)($4fae2d573d730db8$export$af8082af0bea3eb1, {
2990
- value: (0, $3e1bd09be8f70c4c$export$e94ac56c4c53fe58)(lng),
2991
- labels: [
2992
- "E",
2993
- "W"
2994
- ],
2995
- precision: precision,
2996
- format: format
2997
- }),
2998
- ]),
2999
- ]);
3000
- }
3001
- function $4fae2d573d730db8$export$58bfb4f6ec5aa58d(props) {
3002
- /** Renders an elevation value in meters and a parenthetical conversion to feet. */ const { elevation: elevation , className: className , includeFeet: includeFeet = true } = props;
3003
- if (elevation == null) return null;
3004
- return (0, $Zz0sd$macrostrathyper)("div.elevation", {
3005
- className: className
3006
- }, [
3007
- (0, $Zz0sd$macrostrathyper)($4fae2d573d730db8$export$716098b85fd0efdf, {
3008
- value: elevation,
3009
- unit: "m"
3010
- }),
3011
- (0, $Zz0sd$macrostrathyper).if(includeFeet)("span.secondary", [
3012
- " (",
3013
- (0, $Zz0sd$macrostrathyper)($4fae2d573d730db8$export$716098b85fd0efdf, {
3014
- value: (0, $3e1bd09be8f70c4c$export$d284c26147b5ca34)(elevation),
3015
- unit: "ft"
3016
- }),
3017
- ")",
3018
- ]),
3019
- ]);
3020
- }
3021
-
3022
-
3023
-
3024
- const $427faf94283514d4$var$h = (0, $Zz0sd$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($29ab0212ea6844d0$exports))));
3025
- function $427faf94283514d4$var$PositionButton({ position: position }) {
3026
- const focusState = (0, $Zz0sd$useFocusState)(position);
3027
- return $427faf94283514d4$var$h("div.position-controls", [
3028
- $427faf94283514d4$var$h((0, $Zz0sd$LocationFocusButton), {
3029
- location: position,
3030
- focusState: focusState
3031
- }, []),
3032
- (0, $Zz0sd$isCentered)(focusState) ? $427faf94283514d4$var$h($427faf94283514d4$var$CopyLinkButton, {
3033
- itemName: "position"
3034
- }) : null,
3035
- ]);
3036
- }
3037
- function $427faf94283514d4$var$CopyLinkButton({ itemName: itemName , children: children , onClick: onClick , ...rest }) {
3038
- const toaster = (0, $c8a29764c15c7584$export$f46171b59bb094f9)();
3039
- let message = `Copied link`;
3040
- if (itemName != null) message += ` to ${itemName}`;
3041
- message += "!";
3042
- return $427faf94283514d4$var$h((0, $Zz0sd$Button), {
3043
- className: "copy-link-button",
3044
- rightIcon: $427faf94283514d4$var$h((0, $Zz0sd$Icon), {
3045
- icon: "link",
3046
- size: 12
3047
- }),
3048
- minimal: true,
3049
- small: true,
3050
- onClick () {
3051
- navigator.clipboard.writeText(window.location.href).then(()=>{
3052
- toaster?.show({
3053
- message: message,
3054
- intent: "success",
3055
- icon: "clipboard",
3056
- timeout: 1000
3057
- });
3058
- onClick?.();
3059
- }, ()=>{
3060
- toaster?.show({
3061
- message: "Failed to copy link",
3062
- intent: "danger",
3063
- icon: "error",
3064
- timeout: 1000
3065
- });
3066
- });
3067
- },
3068
- ...rest
3069
- }, children ?? "Copy link");
3070
- }
3071
- function $427faf94283514d4$export$e9ff14c4822c2e8c(props) {
3072
- const { onClose: onClose , position: position , zoom: zoom = 7 , elevation: elevation } = props;
3073
- return $427faf94283514d4$var$h("header.location-panel-header", [
3074
- $427faf94283514d4$var$h($427faf94283514d4$var$PositionButton, {
3075
- position: position
3076
- }),
3077
- $427faf94283514d4$var$h("div.spacer"),
3078
- $427faf94283514d4$var$h((0, $4fae2d573d730db8$export$f195b3550849e560), {
3079
- position: position,
3080
- zoom: zoom,
3081
- className: "infodrawer-header-item"
3082
- }),
3083
- $427faf94283514d4$var$h.if(elevation != null)((0, $4fae2d573d730db8$export$58bfb4f6ec5aa58d), {
3084
- elevation: elevation,
3085
- className: "infodrawer-header-item"
3086
- }),
3087
- $427faf94283514d4$var$h((0, $Zz0sd$Button), {
3088
- minimal: true,
3089
- icon: "cross",
3090
- onClick: onClose
3091
- }),
3092
- ]);
3093
- }
3094
-
3095
-
3096
-
3097
-
3098
-
3099
- const $f50c3537aaff0cff$var$h = (0, $Zz0sd$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($29ab0212ea6844d0$exports))));
3100
- function $f50c3537aaff0cff$export$83f9a19cf91c2d06(props) {
3101
- const className = (0, $Zz0sd$classnames)("infodrawer", props.className);
3102
- return $f50c3537aaff0cff$var$h((0, $Zz0sd$Card), {
3103
- ...props,
3104
- className: className
3105
- });
3106
- }
3107
- function $f50c3537aaff0cff$export$aa4baff5242ea6e1(props) {
3108
- const { children: children , className: className , loading: loading = false , ...rest } = props;
3109
- const cls = (0, $Zz0sd$classnames)("location-panel", className, {
3110
- loading: loading
3111
- });
3112
- return $f50c3537aaff0cff$var$h($f50c3537aaff0cff$export$83f9a19cf91c2d06, {
3113
- className: cls
3114
- }, [
3115
- $f50c3537aaff0cff$var$h((0, $427faf94283514d4$export$e9ff14c4822c2e8c), rest),
3116
- $f50c3537aaff0cff$var$h("div.infodrawer-body", $f50c3537aaff0cff$var$h("div.infodrawer-contents", $f50c3537aaff0cff$var$h((0, $c79c8405513fe4b1$export$e926676385687eaf), null, children))),
3117
- ]);
3118
- }
3119
-
3120
-
3121
- var $b6d2ac1192949c28$exports = {};
3122
- var $a281a0612311d660$exports = {};
3123
-
3124
- $parcel$export($a281a0612311d660$exports, "MacrostratVectorTileset", () => $a281a0612311d660$export$dce4b6e67bb5f25a);
3125
- $parcel$export($a281a0612311d660$exports, "MacrostratRasterTileset", () => $a281a0612311d660$export$cc7c195070dfb906);
3126
- $parcel$export($a281a0612311d660$exports, "h", () => $a281a0612311d660$export$dda1d9f60106f0e9);
3127
- $parcel$export($a281a0612311d660$exports, "DevMapPage", () => $a281a0612311d660$export$2391061fbdfb71ef);
3128
-
3129
-
3130
-
3131
-
3132
-
3133
- var $64ee2eed3ed5ffbc$exports = {};
3134
-
3135
- $parcel$export($64ee2eed3ed5ffbc$exports, "buildXRayStyle", () => $64ee2eed3ed5ffbc$export$eff5fb2e10d05b1d);
3136
- $parcel$export($64ee2eed3ed5ffbc$exports, "buildInspectorStyle", () => $64ee2eed3ed5ffbc$export$e739dc8dfc0db9a6);
3137
-
3138
-
3139
- async function $64ee2eed3ed5ffbc$export$eff5fb2e10d05b1d(baseStyle, params = null) {
3140
- const { inDarkMode: inDarkMode = false , color: color = "rgb(74, 242, 161)" , mapboxToken: mapboxToken , xRaySources: xRaySources } = params;
3141
- const style = await (0, $Zz0sd$getMapboxStyle)(baseStyle, {
3142
- access_token: mapboxToken
3143
- });
3144
- const sources = xRaySources ?? Object.keys(style.sources);
3145
- let layers = [];
3146
- for (let layer of style.layers){
3147
- if (!sources.includes(layer.source)) {
3148
- layers.push(layer);
3149
- continue;
3150
- }
3151
- let newLayer = $64ee2eed3ed5ffbc$var$transformMapboxLayer(layer, color, inDarkMode);
3152
- if (newLayer != null) layers.push(newLayer);
3153
- }
3154
- return {
3155
- ...style,
3156
- layers: layers
3157
- };
3158
- }
3159
- function $64ee2eed3ed5ffbc$var$transformMapboxLayer(layer, color, inDarkMode) {
3160
- const c = (0, $Zz0sd$chromajs)(color);
3161
- const xRayColor = (opacity = 1, darken = 0)=>{
3162
- if (!inDarkMode) return (0, $Zz0sd$chromajs)(color).darken(2 - darken).alpha(opacity).css();
3163
- return c.alpha(opacity).darken(darken).css();
3164
- };
3165
- if (layer.type == "background") return null;
3166
- let newLayer = {
3167
- ...layer
3168
- };
3169
- if (layer.type == "fill") newLayer.paint = {
3170
- "fill-color": xRayColor(0.1),
3171
- "fill-outline-color": xRayColor(0.5)
3172
- };
3173
- else if (layer.type == "line") newLayer.paint = {
3174
- "line-color": xRayColor(0.5, 0),
3175
- "line-width": 1.5
3176
- };
3177
- else if (layer.type == "symbol") newLayer.paint = {
3178
- "text-color": xRayColor(1, -0.5),
3179
- "text-halo-color": "#000"
3180
- };
3181
- else if (layer.type == "circle") newLayer.paint = {
3182
- "circle-color": xRayColor(0.5, 0),
3183
- "circle-stroke-color": xRayColor(0.5, 1),
3184
- "circle-radius": 2
3185
- };
3186
- return newLayer;
3187
- }
3188
- async function $64ee2eed3ed5ffbc$export$e739dc8dfc0db9a6(baseStyle, overlayStyle = null, params = {}) {
3189
- const { mapboxToken: mapboxToken , xRay: xRay = false , xRaySources: _xRaySources , ...rest } = params;
3190
- let xRaySources = _xRaySources;
3191
- let style = await (0, $Zz0sd$getMapboxStyle)(baseStyle, {
3192
- access_token: mapboxToken
3193
- });
3194
- if (overlayStyle != null) {
3195
- const overlay = await (0, $Zz0sd$getMapboxStyle)(overlayStyle, {
3196
- access_token: mapboxToken
3197
- });
3198
- style = (0, $Zz0sd$mergeStyles)(style, overlay);
3199
- xRaySources ??= Object.keys(overlay.sources);
3200
- }
3201
- if (xRay) {
3202
- // If we haven't specified sources, then we'll use all of them
3203
- xRaySources ??= Object.keys(style.sources);
3204
- style = await $64ee2eed3ed5ffbc$export$eff5fb2e10d05b1d(style, {
3205
- ...rest,
3206
- mapboxToken: mapboxToken,
3207
- xRaySources: xRaySources
3208
- });
3209
- }
3210
- return style;
3211
- }
3212
-
3213
-
3214
- var $4bdfa9cd8240b2fd$exports = {};
3215
-
3216
- $parcel$export($4bdfa9cd8240b2fd$exports, "MapInterface", () => $4bdfa9cd8240b2fd$export$57b87f3e07d4bb90);
3217
- $parcel$export($4bdfa9cd8240b2fd$exports, "PanelCard", () => $4bdfa9cd8240b2fd$export$ec68dd77edbe678b);
3218
- $parcel$export($4bdfa9cd8240b2fd$exports, "MapStyledContainer", () => $4bdfa9cd8240b2fd$export$fa395a37c3898ae3);
3219
- $parcel$export($4bdfa9cd8240b2fd$exports, "MapAreaContainer", () => $4bdfa9cd8240b2fd$export$9fa5da0bcfd0a290);
3220
-
3221
- var $1f5c274a1b8d54c3$exports = {};
3222
-
3223
- $parcel$export($1f5c274a1b8d54c3$exports, "map-page", () => $1f5c274a1b8d54c3$export$5ec584901c06c5b9, (v) => $1f5c274a1b8d54c3$export$5ec584901c06c5b9 = v);
3224
- $parcel$export($1f5c274a1b8d54c3$exports, "fit-viewport", () => $1f5c274a1b8d54c3$export$2a73fca7b70dce31, (v) => $1f5c274a1b8d54c3$export$2a73fca7b70dce31 = v);
3225
- $parcel$export($1f5c274a1b8d54c3$exports, "compass-control", () => $1f5c274a1b8d54c3$export$cc73204c64cc0950, (v) => $1f5c274a1b8d54c3$export$cc73204c64cc0950 = v);
3226
- $parcel$export($1f5c274a1b8d54c3$exports, "map-is-rotated", () => $1f5c274a1b8d54c3$export$d2972e7dfac51dc2, (v) => $1f5c274a1b8d54c3$export$d2972e7dfac51dc2 = v);
3227
- $parcel$export($1f5c274a1b8d54c3$exports, "map-3d-control", () => $1f5c274a1b8d54c3$export$142b9410c523ef40, (v) => $1f5c274a1b8d54c3$export$142b9410c523ef40 = v);
3228
- $parcel$export($1f5c274a1b8d54c3$exports, "map-3d-available", () => $1f5c274a1b8d54c3$export$6bc2d6545947abbc, (v) => $1f5c274a1b8d54c3$export$6bc2d6545947abbc = v);
3229
- $parcel$export($1f5c274a1b8d54c3$exports, "globe-control", () => $1f5c274a1b8d54c3$export$b06313b17bd37b68, (v) => $1f5c274a1b8d54c3$export$b06313b17bd37b68 = v);
3230
- $parcel$export($1f5c274a1b8d54c3$exports, "map-is-global", () => $1f5c274a1b8d54c3$export$ea9cfbb56edd0e47, (v) => $1f5c274a1b8d54c3$export$ea9cfbb56edd0e47 = v);
3231
- $parcel$export($1f5c274a1b8d54c3$exports, "main-ui", () => $1f5c274a1b8d54c3$export$6d74761ad3ff486d, (v) => $1f5c274a1b8d54c3$export$6d74761ad3ff486d = v);
3232
- $parcel$export($1f5c274a1b8d54c3$exports, "panel-card", () => $1f5c274a1b8d54c3$export$8eff531ff0f1cffe, (v) => $1f5c274a1b8d54c3$export$8eff531ff0f1cffe = v);
3233
- $parcel$export($1f5c274a1b8d54c3$exports, "context-stack", () => $1f5c274a1b8d54c3$export$a15c1c170cdda69a, (v) => $1f5c274a1b8d54c3$export$a15c1c170cdda69a = v);
3234
- $parcel$export($1f5c274a1b8d54c3$exports, "searchbar", () => $1f5c274a1b8d54c3$export$2ac23befe9d406ee, (v) => $1f5c274a1b8d54c3$export$2ac23befe9d406ee = v);
3235
- $parcel$export($1f5c274a1b8d54c3$exports, "detail-stack", () => $1f5c274a1b8d54c3$export$bb1d4538b98f1621, (v) => $1f5c274a1b8d54c3$export$bb1d4538b98f1621 = v);
3236
- $parcel$export($1f5c274a1b8d54c3$exports, "panel-container", () => $1f5c274a1b8d54c3$export$9dd9a0eceddf6af6, (v) => $1f5c274a1b8d54c3$export$9dd9a0eceddf6af6 = v);
3237
- $parcel$export($1f5c274a1b8d54c3$exports, "panel-title", () => $1f5c274a1b8d54c3$export$9672a0c48c9048ad, (v) => $1f5c274a1b8d54c3$export$9672a0c48c9048ad = v);
3238
- $parcel$export($1f5c274a1b8d54c3$exports, "spacer", () => $1f5c274a1b8d54c3$export$8cc075c801fd6817, (v) => $1f5c274a1b8d54c3$export$8cc075c801fd6817 = v);
3239
- $parcel$export($1f5c274a1b8d54c3$exports, "map-view-container", () => $1f5c274a1b8d54c3$export$11aa7dc57218208d, (v) => $1f5c274a1b8d54c3$export$11aa7dc57218208d = v);
3240
- $parcel$export($1f5c274a1b8d54c3$exports, "searchbar-holder", () => $1f5c274a1b8d54c3$export$3a39e67bbbcbd4ae, (v) => $1f5c274a1b8d54c3$export$3a39e67bbbcbd4ae = v);
3241
- $parcel$export($1f5c274a1b8d54c3$exports, "right-panel", () => $1f5c274a1b8d54c3$export$3332ecdf6c5467a, (v) => $1f5c274a1b8d54c3$export$3332ecdf6c5467a = v);
3242
- $parcel$export($1f5c274a1b8d54c3$exports, "buttons", () => $1f5c274a1b8d54c3$export$bbea856fdb3e3c5f, (v) => $1f5c274a1b8d54c3$export$bbea856fdb3e3c5f = v);
3243
- $parcel$export($1f5c274a1b8d54c3$exports, "tab-button", () => $1f5c274a1b8d54c3$export$76800529067ae833, (v) => $1f5c274a1b8d54c3$export$76800529067ae833 = v);
3244
- $parcel$export($1f5c274a1b8d54c3$exports, "menu-card", () => $1f5c274a1b8d54c3$export$d94de0bab38fd59, (v) => $1f5c274a1b8d54c3$export$d94de0bab38fd59 = v);
3245
- $parcel$export($1f5c274a1b8d54c3$exports, "narrow-card", () => $1f5c274a1b8d54c3$export$9769f988dc28baf, (v) => $1f5c274a1b8d54c3$export$9769f988dc28baf = v);
3246
- $parcel$export($1f5c274a1b8d54c3$exports, "panel-header", () => $1f5c274a1b8d54c3$export$90b77e3be608e918, (v) => $1f5c274a1b8d54c3$export$90b77e3be608e918 = v);
3247
- $parcel$export($1f5c274a1b8d54c3$exports, "minimal", () => $1f5c274a1b8d54c3$export$10c083462c34aef3, (v) => $1f5c274a1b8d54c3$export$10c083462c34aef3 = v);
3248
- $parcel$export($1f5c274a1b8d54c3$exports, "context-panel-leave", () => $1f5c274a1b8d54c3$export$f3ad069e7751fe80, (v) => $1f5c274a1b8d54c3$export$f3ad069e7751fe80 = v);
3249
- $parcel$export($1f5c274a1b8d54c3$exports, "narrow-enter", () => $1f5c274a1b8d54c3$export$c20b2d766062840f, (v) => $1f5c274a1b8d54c3$export$c20b2d766062840f = v);
3250
- $parcel$export($1f5c274a1b8d54c3$exports, "menu-group", () => $1f5c274a1b8d54c3$export$3a4b737893473805, (v) => $1f5c274a1b8d54c3$export$3a4b737893473805 = v);
3251
- $parcel$export($1f5c274a1b8d54c3$exports, "menu-content", () => $1f5c274a1b8d54c3$export$3eeb6f640f2fe17b, (v) => $1f5c274a1b8d54c3$export$3eeb6f640f2fe17b = v);
3252
- $parcel$export($1f5c274a1b8d54c3$exports, "bp4-button-group", () => $1f5c274a1b8d54c3$export$e7ed5da3d9a53077, (v) => $1f5c274a1b8d54c3$export$e7ed5da3d9a53077 = v);
3253
- $parcel$export($1f5c274a1b8d54c3$exports, "detail-panel-open", () => $1f5c274a1b8d54c3$export$62a60ea2feb29c53, (v) => $1f5c274a1b8d54c3$export$62a60ea2feb29c53 = v);
3254
- $parcel$export($1f5c274a1b8d54c3$exports, "zoom-control", () => $1f5c274a1b8d54c3$export$61e54aa1efb913ad, (v) => $1f5c274a1b8d54c3$export$61e54aa1efb913ad = v);
3255
- $parcel$export($1f5c274a1b8d54c3$exports, "searching", () => $1f5c274a1b8d54c3$export$fddadf6320237c22, (v) => $1f5c274a1b8d54c3$export$fddadf6320237c22 = v);
3256
- $parcel$export($1f5c274a1b8d54c3$exports, "map-controls", () => $1f5c274a1b8d54c3$export$802dc54769b48aa7, (v) => $1f5c274a1b8d54c3$export$802dc54769b48aa7 = v);
3257
- $parcel$export($1f5c274a1b8d54c3$exports, "map-control", () => $1f5c274a1b8d54c3$export$521e5bd1ca520342, (v) => $1f5c274a1b8d54c3$export$521e5bd1ca520342 = v);
3258
- $parcel$export($1f5c274a1b8d54c3$exports, "map-scale-control", () => $1f5c274a1b8d54c3$export$b56f659d649f0d92, (v) => $1f5c274a1b8d54c3$export$b56f659d649f0d92 = v);
3259
- $parcel$export($1f5c274a1b8d54c3$exports, "detail-panel-enter", () => $1f5c274a1b8d54c3$export$e017ebf46ba443ed, (v) => $1f5c274a1b8d54c3$export$e017ebf46ba443ed = v);
3260
- $parcel$export($1f5c274a1b8d54c3$exports, "infodrawer-stack", () => $1f5c274a1b8d54c3$export$69fa1b5d46c139b9, (v) => $1f5c274a1b8d54c3$export$69fa1b5d46c139b9 = v);
3261
- $parcel$export($1f5c274a1b8d54c3$exports, "detail-panel", () => $1f5c274a1b8d54c3$export$c6930745f2610de0, (v) => $1f5c274a1b8d54c3$export$c6930745f2610de0 = v);
3262
- $parcel$export($1f5c274a1b8d54c3$exports, "panel-open", () => $1f5c274a1b8d54c3$export$10fedbc2931d16b1, (v) => $1f5c274a1b8d54c3$export$10fedbc2931d16b1 = v);
3263
- $parcel$export($1f5c274a1b8d54c3$exports, "layers", () => $1f5c274a1b8d54c3$export$7be255094ccdc533, (v) => $1f5c274a1b8d54c3$export$7be255094ccdc533 = v);
3264
- $parcel$export($1f5c274a1b8d54c3$exports, "settings", () => $1f5c274a1b8d54c3$export$a5a6e0b888b2c992, (v) => $1f5c274a1b8d54c3$export$a5a6e0b888b2c992 = v);
3265
- $parcel$export($1f5c274a1b8d54c3$exports, "detail-panel-from", () => $1f5c274a1b8d54c3$export$419647d5ce4279cb, (v) => $1f5c274a1b8d54c3$export$419647d5ce4279cb = v);
3266
- $parcel$export($1f5c274a1b8d54c3$exports, "detail-panel-leave", () => $1f5c274a1b8d54c3$export$1d0f1d0b062c3bee, (v) => $1f5c274a1b8d54c3$export$1d0f1d0b062c3bee = v);
3267
- $parcel$export($1f5c274a1b8d54c3$exports, "context-panel", () => $1f5c274a1b8d54c3$export$b4dbb67ffc3cc7a9, (v) => $1f5c274a1b8d54c3$export$b4dbb67ffc3cc7a9 = v);
3268
- $parcel$export($1f5c274a1b8d54c3$exports, "context-panel-from", () => $1f5c274a1b8d54c3$export$90f42dafd5c24d2d, (v) => $1f5c274a1b8d54c3$export$90f42dafd5c24d2d = v);
3269
- $parcel$export($1f5c274a1b8d54c3$exports, "context-panel-enter", () => $1f5c274a1b8d54c3$export$9ea3835d1b44cc08, (v) => $1f5c274a1b8d54c3$export$9ea3835d1b44cc08 = v);
3270
- var $1f5c274a1b8d54c3$export$5ec584901c06c5b9;
3271
- var $1f5c274a1b8d54c3$export$2a73fca7b70dce31;
3272
- var $1f5c274a1b8d54c3$export$cc73204c64cc0950;
3273
- var $1f5c274a1b8d54c3$export$d2972e7dfac51dc2;
3274
- var $1f5c274a1b8d54c3$export$142b9410c523ef40;
3275
- var $1f5c274a1b8d54c3$export$6bc2d6545947abbc;
3276
- var $1f5c274a1b8d54c3$export$b06313b17bd37b68;
3277
- var $1f5c274a1b8d54c3$export$ea9cfbb56edd0e47;
3278
- var $1f5c274a1b8d54c3$export$6d74761ad3ff486d;
3279
- var $1f5c274a1b8d54c3$export$8eff531ff0f1cffe;
3280
- var $1f5c274a1b8d54c3$export$a15c1c170cdda69a;
3281
- var $1f5c274a1b8d54c3$export$2ac23befe9d406ee;
3282
- var $1f5c274a1b8d54c3$export$bb1d4538b98f1621;
3283
- var $1f5c274a1b8d54c3$export$9dd9a0eceddf6af6;
3284
- var $1f5c274a1b8d54c3$export$9672a0c48c9048ad;
3285
- var $1f5c274a1b8d54c3$export$8cc075c801fd6817;
3286
- var $1f5c274a1b8d54c3$export$11aa7dc57218208d;
3287
- var $1f5c274a1b8d54c3$export$3a39e67bbbcbd4ae;
3288
- var $1f5c274a1b8d54c3$export$3332ecdf6c5467a;
3289
- var $1f5c274a1b8d54c3$export$bbea856fdb3e3c5f;
3290
- var $1f5c274a1b8d54c3$export$76800529067ae833;
3291
- var $1f5c274a1b8d54c3$export$d94de0bab38fd59;
3292
- var $1f5c274a1b8d54c3$export$9769f988dc28baf;
3293
- var $1f5c274a1b8d54c3$export$90b77e3be608e918;
3294
- var $1f5c274a1b8d54c3$export$10c083462c34aef3;
3295
- var $1f5c274a1b8d54c3$export$f3ad069e7751fe80;
3296
- var $1f5c274a1b8d54c3$export$c20b2d766062840f;
3297
- var $1f5c274a1b8d54c3$export$3a4b737893473805;
3298
- var $1f5c274a1b8d54c3$export$3eeb6f640f2fe17b;
3299
- var $1f5c274a1b8d54c3$export$e7ed5da3d9a53077;
3300
- var $1f5c274a1b8d54c3$export$62a60ea2feb29c53;
3301
- var $1f5c274a1b8d54c3$export$61e54aa1efb913ad;
3302
- var $1f5c274a1b8d54c3$export$fddadf6320237c22;
3303
- var $1f5c274a1b8d54c3$export$802dc54769b48aa7;
3304
- var $1f5c274a1b8d54c3$export$521e5bd1ca520342;
3305
- var $1f5c274a1b8d54c3$export$b56f659d649f0d92;
3306
- var $1f5c274a1b8d54c3$export$e017ebf46ba443ed;
3307
- var $1f5c274a1b8d54c3$export$69fa1b5d46c139b9;
3308
- var $1f5c274a1b8d54c3$export$c6930745f2610de0;
3309
- var $1f5c274a1b8d54c3$export$10fedbc2931d16b1;
3310
- var $1f5c274a1b8d54c3$export$7be255094ccdc533;
3311
- var $1f5c274a1b8d54c3$export$a5a6e0b888b2c992;
3312
- var $1f5c274a1b8d54c3$export$419647d5ce4279cb;
3313
- var $1f5c274a1b8d54c3$export$1d0f1d0b062c3bee;
3314
- var $1f5c274a1b8d54c3$export$b4dbb67ffc3cc7a9;
3315
- var $1f5c274a1b8d54c3$export$90f42dafd5c24d2d;
3316
- var $1f5c274a1b8d54c3$export$9ea3835d1b44cc08;
3317
- $1f5c274a1b8d54c3$export$5ec584901c06c5b9 = "map-page_4c0a66";
3318
- $1f5c274a1b8d54c3$export$2a73fca7b70dce31 = "fit-viewport_4c0a66";
3319
- $1f5c274a1b8d54c3$export$cc73204c64cc0950 = "compass-control_4c0a66";
3320
- $1f5c274a1b8d54c3$export$d2972e7dfac51dc2 = "map-is-rotated_4c0a66";
3321
- $1f5c274a1b8d54c3$export$142b9410c523ef40 = "map-3d-control_4c0a66";
3322
- $1f5c274a1b8d54c3$export$6bc2d6545947abbc = "map-3d-available_4c0a66";
3323
- $1f5c274a1b8d54c3$export$b06313b17bd37b68 = "globe-control_4c0a66";
3324
- $1f5c274a1b8d54c3$export$ea9cfbb56edd0e47 = "map-is-global_4c0a66";
3325
- $1f5c274a1b8d54c3$export$6d74761ad3ff486d = "main-ui_4c0a66";
3326
- $1f5c274a1b8d54c3$export$8eff531ff0f1cffe = "panel-card_4c0a66";
3327
- $1f5c274a1b8d54c3$export$a15c1c170cdda69a = "context-stack_4c0a66";
3328
- $1f5c274a1b8d54c3$export$2ac23befe9d406ee = "searchbar_4c0a66";
3329
- $1f5c274a1b8d54c3$export$bb1d4538b98f1621 = "detail-stack_4c0a66";
3330
- $1f5c274a1b8d54c3$export$9dd9a0eceddf6af6 = "panel-container_4c0a66";
3331
- $1f5c274a1b8d54c3$export$9672a0c48c9048ad = "panel-title_4c0a66";
3332
- $1f5c274a1b8d54c3$export$8cc075c801fd6817 = "spacer_4c0a66";
3333
- $1f5c274a1b8d54c3$export$11aa7dc57218208d = "map-view-container_4c0a66";
3334
- $1f5c274a1b8d54c3$export$3a39e67bbbcbd4ae = "searchbar-holder_4c0a66";
3335
- $1f5c274a1b8d54c3$export$3332ecdf6c5467a = "right-panel_4c0a66";
3336
- $1f5c274a1b8d54c3$export$bbea856fdb3e3c5f = "buttons_4c0a66";
3337
- $1f5c274a1b8d54c3$export$76800529067ae833 = "tab-button_4c0a66";
3338
- $1f5c274a1b8d54c3$export$d94de0bab38fd59 = "menu-card_4c0a66";
3339
- $1f5c274a1b8d54c3$export$9769f988dc28baf = "narrow-card_4c0a66";
3340
- $1f5c274a1b8d54c3$export$90b77e3be608e918 = "panel-header_4c0a66";
3341
- $1f5c274a1b8d54c3$export$10c083462c34aef3 = "minimal_4c0a66";
3342
- $1f5c274a1b8d54c3$export$f3ad069e7751fe80 = "context-panel-leave_4c0a66";
3343
- $1f5c274a1b8d54c3$export$c20b2d766062840f = "narrow-enter_4c0a66";
3344
- $1f5c274a1b8d54c3$export$3a4b737893473805 = "menu-group_4c0a66";
3345
- $1f5c274a1b8d54c3$export$3eeb6f640f2fe17b = "menu-content_4c0a66";
3346
- $1f5c274a1b8d54c3$export$e7ed5da3d9a53077 = "bp4-button-group_4c0a66";
3347
- $1f5c274a1b8d54c3$export$62a60ea2feb29c53 = "detail-panel-open_4c0a66";
3348
- $1f5c274a1b8d54c3$export$61e54aa1efb913ad = "zoom-control_4c0a66";
3349
- $1f5c274a1b8d54c3$export$fddadf6320237c22 = "searching_4c0a66";
3350
- $1f5c274a1b8d54c3$export$802dc54769b48aa7 = "map-controls_4c0a66";
3351
- $1f5c274a1b8d54c3$export$521e5bd1ca520342 = "map-control_4c0a66";
3352
- $1f5c274a1b8d54c3$export$b56f659d649f0d92 = "map-scale-control_4c0a66";
3353
- $1f5c274a1b8d54c3$export$e017ebf46ba443ed = "detail-panel-enter_4c0a66";
3354
- $1f5c274a1b8d54c3$export$69fa1b5d46c139b9 = "infodrawer-stack_4c0a66";
3355
- $1f5c274a1b8d54c3$export$c6930745f2610de0 = "detail-panel_4c0a66";
3356
- $1f5c274a1b8d54c3$export$10fedbc2931d16b1 = "panel-open_4c0a66";
3357
- $1f5c274a1b8d54c3$export$7be255094ccdc533 = "layers_4c0a66";
3358
- $1f5c274a1b8d54c3$export$a5a6e0b888b2c992 = "settings_4c0a66";
3359
- $1f5c274a1b8d54c3$export$419647d5ce4279cb = "detail-panel-from_4c0a66";
3360
- $1f5c274a1b8d54c3$export$1d0f1d0b062c3bee = "detail-panel-leave_4c0a66";
3361
- $1f5c274a1b8d54c3$export$b4dbb67ffc3cc7a9 = "context-panel_4c0a66";
3362
- $1f5c274a1b8d54c3$export$90f42dafd5c24d2d = "context-panel-from_4c0a66";
3363
- $1f5c274a1b8d54c3$export$9ea3835d1b44cc08 = "context-panel-enter_4c0a66";
3364
-
3365
-
3366
-
3367
-
3368
-
3369
-
3370
- var $91d5aa004eeb2226$exports = {};
3371
-
3372
- $parcel$export($91d5aa004eeb2226$exports, "MapBottomControls", () => $91d5aa004eeb2226$export$db1a2e058a06fb5c);
3373
-
3374
-
3375
-
3376
-
3377
-
3378
-
3379
- const $91d5aa004eeb2226$var$h = (0, $Zz0sd$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($1f5c274a1b8d54c3$exports))));
3380
- function $91d5aa004eeb2226$var$ScaleControl(props) {
3381
- const optionsRef = (0, $Zz0sd$useRef)({
3382
- maxWidth: 200,
3383
- unit: "metric"
3384
- });
3385
- return $91d5aa004eeb2226$var$h((0, $Zz0sd$MapControlWrapper), {
3386
- className: "map-scale-control",
3387
- control: (0, $Zz0sd$ScaleControl),
3388
- options: optionsRef.current,
3389
- ...props
3390
- });
3391
- }
3392
- function $91d5aa004eeb2226$var$GeolocationControl(props) {
3393
- const optionsRef = (0, $Zz0sd$useRef)({
3394
- showAccuracyCircle: true,
3395
- showUserLocation: true,
3396
- trackUserLocation: true,
3397
- positionOptions: {
3398
- enableHighAccuracy: true
3399
- }
3400
- });
3401
- return $91d5aa004eeb2226$var$h((0, $Zz0sd$MapControlWrapper), {
3402
- control: (0, $Zz0sd$GeolocateControl),
3403
- options: optionsRef.current,
3404
- ...props
3405
- });
3406
- }
3407
- function $91d5aa004eeb2226$export$db1a2e058a06fb5c() {
3408
- return $91d5aa004eeb2226$var$h("div.map-controls", [
3409
- $91d5aa004eeb2226$var$h($91d5aa004eeb2226$var$ScaleControl),
3410
- $91d5aa004eeb2226$var$h((0, $Zz0sd$ThreeDControl), {
3411
- className: "map-3d-control"
3412
- }),
3413
- $91d5aa004eeb2226$var$h((0, $Zz0sd$CompassControl), {
3414
- className: "compass-control"
3415
- }),
3416
- $91d5aa004eeb2226$var$h((0, $Zz0sd$GlobeControl), {
3417
- className: "globe-control"
3418
- }),
3419
- $91d5aa004eeb2226$var$h($91d5aa004eeb2226$var$GeolocationControl, {
3420
- className: "geolocation-control"
3421
- }),
3422
- ]);
3423
- }
3424
-
3425
-
3426
-
3427
-
3428
- function $4bdfa9cd8240b2fd$export$57b87f3e07d4bb90() {
3429
- return $4bdfa9cd8240b2fd$var$h("div", "Hello world");
3430
- }
3431
- const $4bdfa9cd8240b2fd$var$h = (0, $Zz0sd$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($1f5c274a1b8d54c3$exports))));
3432
- const $4bdfa9cd8240b2fd$export$ec68dd77edbe678b = (props)=>$4bdfa9cd8240b2fd$var$h((0, $Zz0sd$Card), {
3433
- ...props,
3434
- className: (0, $Zz0sd$classnames)("panel-card", props.className)
3435
- });
3436
- function $4bdfa9cd8240b2fd$var$_MapAreaContainer({ children: children , className: className , navbar: navbar , contextPanel: contextPanel = null , detailPanel: detailPanel = null , detailPanelOpen: detailPanelOpen , contextPanelOpen: contextPanelOpen = true , bottomPanel: bottomPanel = null , mainPanel: mainPanel , mapControls: mapControls = $4bdfa9cd8240b2fd$var$h((0, $91d5aa004eeb2226$export$db1a2e058a06fb5c)) , contextStackProps: contextStackProps = null , detailStackProps: detailStackProps = null , mapPosition: mapPosition = null , fitViewport: fitViewport = true , ...rest }) {
3437
- const _detailPanelOpen = detailPanelOpen ?? detailPanel != null;
3438
- const contextPanelTrans = (0, $Zz0sd$useTransition)(contextPanelOpen, 800);
3439
- const detailPanelTrans = (0, $Zz0sd$useTransition)(_detailPanelOpen, 800);
3440
- /*- We apply a custom style to the panel container when we are interacting
3441
- with the search bar, so that we can block map interactions until search
3442
- bar focus is lost.
3443
- - We also apply a custom style when the infodrawer is open so we can hide
3444
- the search bar on mobile platforms
3445
- - These styles are doubly applied so we can have both namespaced and
3446
- outside-accessible styles for each case.
3447
- */ const _className = (0, $Zz0sd$classnames)({
3448
- searching: false,
3449
- "detail-panel-open": _detailPanelOpen,
3450
- "map-context-open": _detailPanelOpen,
3451
- "fit-viewport": fitViewport
3452
- }, `context-panel-${contextPanelTrans.stage}`, `map-context-${contextPanelTrans.stage}`, `detail-panel-${detailPanelTrans.stage}`, `map-detail-${detailPanelTrans.stage}`);
3453
- return $4bdfa9cd8240b2fd$var$h($4bdfa9cd8240b2fd$export$fa395a37c3898ae3, {
3454
- className: (0, $Zz0sd$classnames)("map-page", className),
3455
- mapPosition: mapPosition
3456
- }, [
3457
- $4bdfa9cd8240b2fd$var$h("div.main-ui", {
3458
- className: _className,
3459
- ...rest
3460
- }, [
3461
- $4bdfa9cd8240b2fd$var$h("div.context-stack", contextStackProps, [
3462
- navbar,
3463
- $4bdfa9cd8240b2fd$var$h.if(contextPanelTrans.shouldMount)([
3464
- contextPanel
3465
- ]),
3466
- ]),
3467
- //h(MapView),
3468
- children ?? mainPanel,
3469
- $4bdfa9cd8240b2fd$var$h("div.detail-stack.infodrawer-container", detailStackProps, [
3470
- detailPanel,
3471
- $4bdfa9cd8240b2fd$var$h((0, $Zz0sd$ZoomControl), {
3472
- className: "zoom-control"
3473
- }),
3474
- $4bdfa9cd8240b2fd$var$h("div.spacer"),
3475
- mapControls,
3476
- ]),
3477
- ]),
3478
- $4bdfa9cd8240b2fd$var$h("div.bottom", null, bottomPanel),
3479
- ]);
3480
- }
3481
- const $4bdfa9cd8240b2fd$var$MapProviders = ({ children: children })=>$4bdfa9cd8240b2fd$var$h((0, $c8a29764c15c7584$export$9194c0aa0cd7a9ff), $4bdfa9cd8240b2fd$var$h((0, $Zz0sd$MapboxMapProvider), children));
3482
- const $4bdfa9cd8240b2fd$export$9fa5da0bcfd0a290 = (props)=>$4bdfa9cd8240b2fd$var$h($4bdfa9cd8240b2fd$var$MapProviders, $4bdfa9cd8240b2fd$var$h($4bdfa9cd8240b2fd$var$_MapAreaContainer, props));
3483
- function $4bdfa9cd8240b2fd$export$fa395a37c3898ae3({ className: className , children: children }) {
3484
- const { mapPosition: mapPosition } = (0, $Zz0sd$useMapStatus)();
3485
- if (mapPosition != null) {
3486
- const { mapIsRotated: mapIsRotated , mapUse3D: mapUse3D , mapIsGlobal: mapIsGlobal } = (0, $Zz0sd$mapViewInfo)(mapPosition);
3487
- className = (0, $Zz0sd$classnames)(className, {
3488
- "map-is-rotated": mapIsRotated,
3489
- "map-3d-available": mapUse3D,
3490
- "map-is-global": mapIsGlobal
3491
- });
3492
- }
3493
- return $4bdfa9cd8240b2fd$var$h("div", {
3494
- className: className
3495
- }, children);
3496
- } //const _MapPage = compose(HotkeysProvider, MapPage);
3497
-
3498
-
3499
-
3500
- var $4bc3dd5f0732eed3$exports = {};
3501
-
3502
- $parcel$export($4bc3dd5f0732eed3$exports, "MapResizeManager", () => $4bc3dd5f0732eed3$export$31b2e088aff2dc5d);
3503
- $parcel$export($4bc3dd5f0732eed3$exports, "MapPaddingManager", () => $4bc3dd5f0732eed3$export$2ab96428dea558d6);
3504
- $parcel$export($4bc3dd5f0732eed3$exports, "MapMovedReporter", () => $4bc3dd5f0732eed3$export$f6eeee399afc4e9a);
3505
- $parcel$export($4bc3dd5f0732eed3$exports, "MapLoadingReporter", () => $4bc3dd5f0732eed3$export$e57f9eaa51773f82);
3506
- $parcel$export($4bc3dd5f0732eed3$exports, "MapMarker", () => $4bc3dd5f0732eed3$export$5c90a91c7455938c);
3507
-
3508
-
3509
-
3510
-
3511
-
3512
-
3513
- var $82fe09613877ffc2$exports = {};
3514
-
3515
- $parcel$export($82fe09613877ffc2$exports, "getMapPadding", () => $82fe09613877ffc2$export$bb78f9f01775eef1);
3516
- $parcel$export($82fe09613877ffc2$exports, "useMapMarker", () => $82fe09613877ffc2$export$278090850f6b3a9f);
3517
-
3518
-
3519
- function $82fe09613877ffc2$var$calcMapPadding(rect, childRect) {
3520
- return {
3521
- left: Math.max(rect.left - childRect.left, 0),
3522
- top: Math.max(rect.top - childRect.top, 0),
3523
- right: Math.max(childRect.right - rect.right, 0),
3524
- bottom: Math.max(childRect.bottom - rect.bottom, 0)
3525
- };
3526
- }
3527
- function $82fe09613877ffc2$export$bb78f9f01775eef1(ref, parentRef) {
3528
- const rect = parentRef.current?.getBoundingClientRect();
3529
- const childRect = ref.current?.getBoundingClientRect();
3530
- if (rect == null || childRect == null) return;
3531
- return $82fe09613877ffc2$var$calcMapPadding(rect, childRect);
3532
- }
3533
- function $82fe09613877ffc2$export$278090850f6b3a9f(mapRef, markerRef, markerPosition) {
3534
- (0, $Zz0sd$useEffect)(()=>{
3535
- const map = mapRef.current;
3536
- if (map == null) return;
3537
- if (markerPosition == null) {
3538
- markerRef.current?.remove();
3539
- return;
3540
- }
3541
- const marker = markerRef.current ?? new (0, $Zz0sd$Marker)();
3542
- marker.setLngLat(markerPosition).addTo(map);
3543
- markerRef.current = marker;
3544
- return ()=>marker.remove();
3545
- }, [
3546
- mapRef.current,
3547
- markerPosition
3548
- ]);
3549
- }
3550
-
3551
-
3552
- function $4bc3dd5f0732eed3$export$31b2e088aff2dc5d({ containerRef: containerRef }) {
3553
- const mapRef = (0, $Zz0sd$useMapRef)();
3554
- const debouncedResize = (0, $Zz0sd$useRef)((0, $Zz0sd$debounce)(()=>{
3555
- mapRef.current?.resize();
3556
- }, 100));
3557
- (0, $Zz0sd$useresizeobserver)({
3558
- ref: containerRef,
3559
- onResize: debouncedResize.current
3560
- });
3561
- return null;
3562
- }
3563
- function $4bc3dd5f0732eed3$export$2ab96428dea558d6({ containerRef: containerRef , parentRef: parentRef , infoMarkerPosition: infoMarkerPosition }) {
3564
- const mapRef = (0, $Zz0sd$useMapRef)();
3565
- const [padding, setPadding] = (0, $Zz0sd$useState)((0, $82fe09613877ffc2$export$bb78f9f01775eef1)(containerRef, parentRef));
3566
- const updateMapPadding = (0, $Zz0sd$useCallback)(()=>{
3567
- const newPadding = (0, $82fe09613877ffc2$export$bb78f9f01775eef1)(containerRef, parentRef);
3568
- setPadding(newPadding);
3569
- }, [
3570
- containerRef.current,
3571
- parentRef.current
3572
- ]);
3573
- (0, $Zz0sd$useEffect)(()=>{
3574
- const map = mapRef.current;
3575
- if (map == null) return;
3576
- // Update map padding on load
3577
- updateMapPadding();
3578
- }, [
3579
- mapRef.current
3580
- ]);
3581
- (0, $Zz0sd$useresizeobserver)({
3582
- ref: parentRef,
3583
- onResize (sz) {
3584
- updateMapPadding();
3585
- }
3586
- });
3587
- (0, $Zz0sd$useMapEaseToCenter)(infoMarkerPosition, padding);
3588
- return null;
3589
- }
3590
- function $4bc3dd5f0732eed3$export$f6eeee399afc4e9a({ onMapMoved: onMapMoved = null }) {
3591
- const mapRef = (0, $Zz0sd$useMapRef)();
3592
- const dispatch = (0, $Zz0sd$useMapDispatch)();
3593
- const mapMovedCallback = (0, $Zz0sd$useCallback)(()=>{
3594
- const map = mapRef.current;
3595
- if (map == null) return;
3596
- const mapPosition = (0, $Zz0sd$getMapPosition)(map);
3597
- dispatch({
3598
- type: "map-moved",
3599
- payload: mapPosition
3600
- });
3601
- onMapMoved?.(mapPosition, map);
3602
- }, [
3603
- mapRef.current,
3604
- onMapMoved,
3605
- dispatch
3606
- ]);
3607
- (0, $Zz0sd$useEffect)(()=>{
3608
- // Get the current value of the map. Useful for gradually moving away
3609
- // from class component
3610
- const map = mapRef.current;
3611
- if (map == null) return;
3612
- // Update the URI when the map moves
3613
- mapMovedCallback();
3614
- const cb = (0, $Zz0sd$debounce)(mapMovedCallback, 100);
3615
- map.on("moveend", cb);
3616
- return ()=>{
3617
- map?.off("moveend", cb);
3618
- };
3619
- }, [
3620
- mapMovedCallback
3621
- ]);
3622
- return null;
3623
- }
3624
- function $4bc3dd5f0732eed3$export$e57f9eaa51773f82({ ignoredSources: ignoredSources , onMapLoading: onMapLoading = null , onMapIdle: onMapIdle = null , mapIsLoading: mapIsLoading1 , }) {
3625
- const mapRef = (0, $Zz0sd$useMapRef)();
3626
- const loadingRef = (0, $Zz0sd$useRef)(false);
3627
- const dispatch = (0, $Zz0sd$useMapDispatch)();
3628
- (0, $Zz0sd$useEffect)(()=>{
3629
- const map = mapRef.current;
3630
- const mapIsLoading = loadingRef.current;
3631
- if (map == null) return;
3632
- let didSendLoading = false;
3633
- const loadingCallback = (evt)=>{
3634
- if (ignoredSources.includes(evt.sourceId) || mapIsLoading) return;
3635
- if (didSendLoading) return;
3636
- onMapLoading?.(evt);
3637
- dispatch({
3638
- type: "set-loading",
3639
- payload: true
3640
- });
3641
- loadingRef.current = true;
3642
- didSendLoading = true;
3643
- };
3644
- const idleCallback = (evt)=>{
3645
- if (!mapIsLoading) return;
3646
- dispatch({
3647
- type: "set-loading",
3648
- payload: false
3649
- });
3650
- loadingRef.current = false;
3651
- onMapIdle?.(evt);
3652
- };
3653
- map.on("sourcedataloading", loadingCallback);
3654
- map.on("idle", idleCallback);
3655
- return ()=>{
3656
- map?.off("sourcedataloading", loadingCallback);
3657
- map?.off("idle", idleCallback);
3658
- };
3659
- }, [
3660
- ignoredSources,
3661
- mapRef.current,
3662
- mapIsLoading1
3663
- ]);
3664
- return null;
3665
- }
3666
- function $4bc3dd5f0732eed3$export$5c90a91c7455938c({ position: position , setPosition: setPosition , centerMarker: centerMarker = true }) {
3667
- const mapRef = (0, $Zz0sd$useMapRef)();
3668
- const markerRef = (0, $Zz0sd$useRef)(null);
3669
- (0, $82fe09613877ffc2$export$278090850f6b3a9f)(mapRef, markerRef, position);
3670
- const handleMapClick = (0, $Zz0sd$useCallback)((event)=>{
3671
- setPosition(event.lngLat, event, mapRef.current);
3672
- // We should integrate this with the "easeToCenter" hook
3673
- if (centerMarker) mapRef.current?.flyTo({
3674
- center: event.lngLat,
3675
- duration: 800
3676
- });
3677
- }, [
3678
- mapRef.current,
3679
- setPosition
3680
- ]);
3681
- (0, $Zz0sd$useEffect)(()=>{
3682
- const map = mapRef.current;
3683
- if (map != null && setPosition != null) map.on("click", handleMapClick);
3684
- return ()=>{
3685
- map?.off("click", handleMapClick);
3686
- };
3687
- }, [
3688
- mapRef.current,
3689
- setPosition
3690
- ]);
3691
- return null;
3692
- }
3693
-
3694
-
3695
-
3696
- var $9e150e311a3261e9$exports = {};
3697
-
3698
- $parcel$export($9e150e311a3261e9$exports, "MapView", () => $9e150e311a3261e9$export$ab1e7a67d6ec5ad8);
3699
- $parcel$export($9e150e311a3261e9$exports, "MapTerrainManager", () => $9e150e311a3261e9$export$cee395a8a2a00b29);
3700
-
3701
-
3702
-
3703
-
3704
-
3705
-
3706
- var $1ea1ddb7a7b84e13$exports = {};
3707
-
3708
- $parcel$export($1ea1ddb7a7b84e13$exports, "map-view-container", () => $1ea1ddb7a7b84e13$export$11aa7dc57218208d, (v) => $1ea1ddb7a7b84e13$export$11aa7dc57218208d = v);
3709
- var $1ea1ddb7a7b84e13$export$11aa7dc57218208d;
3710
- $1ea1ddb7a7b84e13$export$11aa7dc57218208d = `-mD4Aa_map-view-container`;
3711
-
3712
-
3713
-
3714
- function $286fbb15f2139dc1$export$b730542ee281c4b1(map, shouldEnable, sourceID = null) {
3715
- let demSourceID = (sourceID ?? $286fbb15f2139dc1$var$getTerrainSourceID(map)) ?? "mapbox-dem";
3716
- console.log("Enabling 3D terrain with source", demSourceID);
3717
- if (!map.style?._loaded) {
3718
- map.once("style.load", ()=>{
3719
- $286fbb15f2139dc1$export$b730542ee281c4b1(map, shouldEnable, demSourceID);
3720
- });
3721
- return;
3722
- }
3723
- // Enable or disable terrain depending on our current desires...
3724
- const currentTerrain = map.getTerrain();
3725
- if (!shouldEnable) {
3726
- if (currentTerrain != null) map.setTerrain(null);
3727
- return;
3728
- }
3729
- if (currentTerrain != null) return;
3730
- // Add a DEM source if one is not found already.
3731
- if (map.getSource(demSourceID) == null) map.addSource(demSourceID, {
3732
- type: "raster-dem",
3733
- url: "mapbox://mapbox.mapbox-terrain-dem-v1",
3734
- tileSize: 512,
3735
- maxzoom: 14
3736
- });
3737
- // add a sky layer that will show when the map is highly pitched
3738
- if (map.getLayer("sky") == null) map.addLayer({
3739
- id: "sky",
3740
- type: "sky",
3741
- paint: {
3742
- "sky-type": "atmosphere",
3743
- "sky-atmosphere-sun": [
3744
- 0.0,
3745
- 0.0
3746
- ],
3747
- "sky-atmosphere-sun-intensity": 15
3748
- }
3749
- });
3750
- map.setTerrain({
3751
- source: demSourceID,
3752
- exaggeration: 1
3753
- });
3754
- }
3755
- function $286fbb15f2139dc1$var$getTerrainSourceID(map) {
3756
- for (const [key, source] of Object.entries(map.getStyle().sources)){
3757
- if (source.type == "raster-dem") return key;
3758
- }
3759
- return null;
3760
- }
3761
-
3762
-
3763
-
3764
- const $9e150e311a3261e9$var$h = (0, $Zz0sd$macrostrathyper).styled({
3765
- ...(0, (/*@__PURE__*/$parcel$interopDefault($1ea1ddb7a7b84e13$exports))),
3766
- ...(0, (/*@__PURE__*/$parcel$interopDefault($1f5c274a1b8d54c3$exports)))
3767
- });
3768
- function $9e150e311a3261e9$var$initializeMap(container, args = {}) {
3769
- const map = new (0, $Zz0sd$mapboxgl).Map({
3770
- container: container,
3771
- maxZoom: 18,
3772
- //maxTileCacheSize: 0,
3773
- logoPosition: "bottom-left",
3774
- trackResize: true,
3775
- antialias: true,
3776
- optimizeForTerrain: true,
3777
- ...args
3778
- });
3779
- //setMapPosition(map, mapPosition);
3780
- return map;
3781
- }
3782
- const $9e150e311a3261e9$var$defaultMapPosition = {
3783
- camera: {
3784
- lat: 34,
3785
- lng: -120,
3786
- altitude: 300000
3787
- }
3788
- };
3789
- function $9e150e311a3261e9$export$ab1e7a67d6ec5ad8(props) {
3790
- let { terrainSourceID: terrainSourceID } = props;
3791
- const { enableTerrain: enableTerrain = true , style: style , transformRequest: transformRequest , mapPosition: mapPosition = $9e150e311a3261e9$var$defaultMapPosition , children: children , accessToken: accessToken , infoMarkerPosition: infoMarkerPosition , projection: projection , } = props;
3792
- if (enableTerrain) terrainSourceID ??= "mapbox-3d-dem";
3793
- if (accessToken != null) (0, $Zz0sd$mapboxgl).accessToken = accessToken;
3794
- const dispatch = (0, $Zz0sd$useMapDispatch)();
3795
- let mapRef = (0, $Zz0sd$useMapRef)();
3796
- const ref = (0, $Zz0sd$useRef)();
3797
- const parentRef = (0, $Zz0sd$useRef)();
3798
- // Keep track of map position for reloads
3799
- (0, $Zz0sd$useEffect)(()=>{
3800
- if (style == null || ref.current == null || dispatch == null) return;
3801
- if (mapRef?.current != null) return;
3802
- console.log("Initializing map");
3803
- const map = $9e150e311a3261e9$var$initializeMap(ref.current, {
3804
- style: style,
3805
- transformRequest: transformRequest,
3806
- projection: projection
3807
- });
3808
- dispatch({
3809
- type: "set-map",
3810
- payload: map
3811
- });
3812
- console.log("Map initialized");
3813
- return ()=>{
3814
- map.remove();
3815
- dispatch({
3816
- type: "set-map",
3817
- payload: null
3818
- });
3819
- };
3820
- }, [
3821
- transformRequest,
3822
- dispatch,
3823
- style
3824
- ]);
3825
- // Map style updating
3826
- (0, $Zz0sd$useEffect)(()=>{
3827
- if (mapRef?.current == null || style == null) return;
3828
- mapRef?.current?.setStyle(style);
3829
- }, [
3830
- mapRef.current,
3831
- style
3832
- ]);
3833
- (0, $Zz0sd$useEffect)(()=>{
3834
- const map = mapRef.current;
3835
- if (map == null || mapPosition == null) return;
3836
- (0, $Zz0sd$setMapPosition)(map, mapPosition);
3837
- }, [
3838
- mapRef.current
3839
- ]);
3840
- const { mapPosition: _computedMapPosition } = (0, $Zz0sd$useMapStatus)();
3841
- const { mapUse3D: mapUse3D , mapIsRotated: mapIsRotated } = (0, $Zz0sd$mapViewInfo)(_computedMapPosition);
3842
- // Get map projection
3843
- const _projection = mapRef.current?.getProjection()?.name ?? "mercator";
3844
- const className = (0, $Zz0sd$classnames)({
3845
- "is-rotated": mapIsRotated ?? false,
3846
- "is-3d-available": mapUse3D ?? false
3847
- }, `${_projection}-projection`);
3848
- return $9e150e311a3261e9$var$h("div.map-view-container.main-view", {
3849
- ref: parentRef
3850
- }, [
3851
- $9e150e311a3261e9$var$h("div.mapbox-map#map", {
3852
- ref: ref,
3853
- className: className
3854
- }),
3855
- $9e150e311a3261e9$var$h((0, $4bc3dd5f0732eed3$export$e57f9eaa51773f82), {
3856
- ignoredSources: [
3857
- "elevationMarker",
3858
- "crossSectionEndpoints"
3859
- ]
3860
- }),
3861
- $9e150e311a3261e9$var$h((0, $4bc3dd5f0732eed3$export$f6eeee399afc4e9a)),
3862
- $9e150e311a3261e9$var$h((0, $4bc3dd5f0732eed3$export$31b2e088aff2dc5d), {
3863
- containerRef: ref
3864
- }),
3865
- $9e150e311a3261e9$var$h((0, $4bc3dd5f0732eed3$export$2ab96428dea558d6), {
3866
- containerRef: ref,
3867
- parentRef: parentRef,
3868
- infoMarkerPosition: infoMarkerPosition
3869
- }),
3870
- $9e150e311a3261e9$var$h($9e150e311a3261e9$export$cee395a8a2a00b29, {
3871
- mapUse3D: mapUse3D,
3872
- terrainSourceID: terrainSourceID
3873
- }),
3874
- children,
3875
- ]);
3876
- }
3877
- function $9e150e311a3261e9$export$cee395a8a2a00b29({ mapUse3D: mapUse3D , terrainSourceID: terrainSourceID }) {
3878
- const mapRef = (0, $Zz0sd$useMapRef)();
3879
- (0, $Zz0sd$useEffect)(()=>{
3880
- const map = mapRef.current;
3881
- if (map == null) return;
3882
- (0, $286fbb15f2139dc1$export$b730542ee281c4b1)(map, mapUse3D, terrainSourceID);
3883
- }, [
3884
- mapRef.current,
3885
- mapUse3D
3886
- ]);
3887
- return null;
3888
- }
3889
-
3890
-
3891
- var $bfe9593b6c29b10b$exports = {};
3892
-
3893
- $parcel$export($bfe9593b6c29b10b$exports, "feature-panel", () => $bfe9593b6c29b10b$export$d27ce8c17b289f33, (v) => $bfe9593b6c29b10b$export$d27ce8c17b289f33 = v);
3894
- $parcel$export($bfe9593b6c29b10b$exports, "key-value", () => $bfe9593b6c29b10b$export$6025d8aaa4edba3b, (v) => $bfe9593b6c29b10b$export$6025d8aaa4edba3b = v);
3895
- $parcel$export($bfe9593b6c29b10b$exports, "key", () => $bfe9593b6c29b10b$export$df61b30b684217c0, (v) => $bfe9593b6c29b10b$export$df61b30b684217c0 = v);
3896
- $parcel$export($bfe9593b6c29b10b$exports, "value", () => $bfe9593b6c29b10b$export$2ab9a8f9f1186f14, (v) => $bfe9593b6c29b10b$export$2ab9a8f9f1186f14 = v);
3897
- $parcel$export($bfe9593b6c29b10b$exports, "feature-properties", () => $bfe9593b6c29b10b$export$4f7f4a0a9b87a0a1, (v) => $bfe9593b6c29b10b$export$4f7f4a0a9b87a0a1 = v);
3898
- $parcel$export($bfe9593b6c29b10b$exports, "feature-header", () => $bfe9593b6c29b10b$export$435bd1864bef6e22, (v) => $bfe9593b6c29b10b$export$435bd1864bef6e22 = v);
3899
- $parcel$export($bfe9593b6c29b10b$exports, "feature-group", () => $bfe9593b6c29b10b$export$a1386d43b662271, (v) => $bfe9593b6c29b10b$export$a1386d43b662271 = v);
3900
- $parcel$export($bfe9593b6c29b10b$exports, "tile-info", () => $bfe9593b6c29b10b$export$1ea80fe0e5d4f6be, (v) => $bfe9593b6c29b10b$export$1ea80fe0e5d4f6be = v);
3901
- $parcel$export($bfe9593b6c29b10b$exports, "opacity-slider", () => $bfe9593b6c29b10b$export$802c81ec652235aa, (v) => $bfe9593b6c29b10b$export$802c81ec652235aa = v);
3902
- $parcel$export($bfe9593b6c29b10b$exports, "unit-number", () => $bfe9593b6c29b10b$export$ce32b714ddd6b59, (v) => $bfe9593b6c29b10b$export$ce32b714ddd6b59 = v);
3903
- $parcel$export($bfe9593b6c29b10b$exports, "unit", () => $bfe9593b6c29b10b$export$523c0b569236b342, (v) => $bfe9593b6c29b10b$export$523c0b569236b342 = v);
3904
- $parcel$export($bfe9593b6c29b10b$exports, "page", () => $bfe9593b6c29b10b$export$523fb3936f49e028, (v) => $bfe9593b6c29b10b$export$523fb3936f49e028 = v);
3905
- $parcel$export($bfe9593b6c29b10b$exports, "dev-index-page", () => $bfe9593b6c29b10b$export$ee954d6f5e1b21cc, (v) => $bfe9593b6c29b10b$export$ee954d6f5e1b21cc = v);
3906
- var $bfe9593b6c29b10b$export$d27ce8c17b289f33;
3907
- var $bfe9593b6c29b10b$export$6025d8aaa4edba3b;
3908
- var $bfe9593b6c29b10b$export$df61b30b684217c0;
3909
- var $bfe9593b6c29b10b$export$2ab9a8f9f1186f14;
3910
- var $bfe9593b6c29b10b$export$4f7f4a0a9b87a0a1;
3911
- var $bfe9593b6c29b10b$export$435bd1864bef6e22;
3912
- var $bfe9593b6c29b10b$export$a1386d43b662271;
3913
- var $bfe9593b6c29b10b$export$1ea80fe0e5d4f6be;
3914
- var $bfe9593b6c29b10b$export$802c81ec652235aa;
3915
- var $bfe9593b6c29b10b$export$ce32b714ddd6b59;
3916
- var $bfe9593b6c29b10b$export$523c0b569236b342;
3917
- var $bfe9593b6c29b10b$export$523fb3936f49e028;
3918
- var $bfe9593b6c29b10b$export$ee954d6f5e1b21cc;
3919
- $bfe9593b6c29b10b$export$d27ce8c17b289f33 = "feature-panel_48e225";
3920
- $bfe9593b6c29b10b$export$6025d8aaa4edba3b = "key-value_48e225";
3921
- $bfe9593b6c29b10b$export$df61b30b684217c0 = "key_48e225";
3922
- $bfe9593b6c29b10b$export$2ab9a8f9f1186f14 = "value_48e225";
3923
- $bfe9593b6c29b10b$export$4f7f4a0a9b87a0a1 = "feature-properties_48e225";
3924
- $bfe9593b6c29b10b$export$435bd1864bef6e22 = "feature-header_48e225";
3925
- $bfe9593b6c29b10b$export$a1386d43b662271 = "feature-group_48e225";
3926
- $bfe9593b6c29b10b$export$1ea80fe0e5d4f6be = "tile-info_48e225";
3927
- $bfe9593b6c29b10b$export$802c81ec652235aa = "opacity-slider_48e225";
3928
- $bfe9593b6c29b10b$export$ce32b714ddd6b59 = "unit-number_48e225";
3929
- $bfe9593b6c29b10b$export$523c0b569236b342 = "unit_48e225";
3930
- $bfe9593b6c29b10b$export$523fb3936f49e028 = "page_48e225";
3931
- $bfe9593b6c29b10b$export$ee954d6f5e1b21cc = "dev-index-page_48e225";
3932
-
3933
-
3934
- var $1d4d29ef2725aa16$exports = {};
3935
-
3936
- $parcel$export($1d4d29ef2725aa16$exports, "TileExtentLayer", () => $1d4d29ef2725aa16$export$86c09739b12f23cd);
3937
-
3938
-
3939
-
3940
- function $1d4d29ef2725aa16$export$86c09739b12f23cd({ tile: tile , color: color = "red" }) {
3941
- const styleCallback = (0, $Zz0sd$useCallback)((map, val)=>{
3942
- const style = map.getStyle();
3943
- if (style.layers == null) return;
3944
- style.layers = style.layers.filter((l)=>l.id != "tile-extent");
3945
- if (val == null) return map.setStyle(style);
3946
- const { x: x , y: y , z: z } = val;
3947
- const extent = (0, $Zz0sd$tileToGeoJSON)([
3948
- x,
3949
- y,
3950
- z
3951
- ]);
3952
- const source = {
3953
- type: "geojson",
3954
- data: extent
3955
- };
3956
- const layer = {
3957
- id: "tile-extent",
3958
- type: "line",
3959
- source: "tile-extent",
3960
- paint: {
3961
- "line-color": color,
3962
- "line-width": 2
3963
- }
3964
- };
3965
- style.sources["tile-extent"] = source;
3966
- style.layers.push(layer);
3967
- map.setStyle(style);
3968
- }, [
3969
- color
3970
- ]);
3971
- const map1 = (0, $Zz0sd$useMapRef)();
3972
- (0, $Zz0sd$useMapConditionalStyle)(map1, tile, styleCallback);
3973
- return null;
3974
- }
3975
-
3976
-
3977
- var $b8c84b63e75fe4f2$exports = {};
3978
-
3979
- $parcel$export($b8c84b63e75fe4f2$exports, "FeatureRecord", () => $b8c84b63e75fe4f2$export$dc87b4d46cea200d);
3980
- $parcel$export($b8c84b63e75fe4f2$exports, "FeatureSelectionHandler", () => $b8c84b63e75fe4f2$export$214daccdda0f4ac6);
3981
- $parcel$export($b8c84b63e75fe4f2$exports, "TileInfo", () => $b8c84b63e75fe4f2$export$43c75dec9d0b96c);
3982
- $parcel$export($b8c84b63e75fe4f2$exports, "FeaturePanel", () => $b8c84b63e75fe4f2$export$43277c51a01761c1);
3983
-
3984
-
3985
-
3986
-
3987
-
3988
-
3989
-
3990
- var $d570ac304373e71c$exports = {};
3991
-
3992
- $parcel$export($d570ac304373e71c$exports, "ExpansionPanelSummary", () => $d570ac304373e71c$export$cea00a9d724d5a32);
3993
- $parcel$export($d570ac304373e71c$exports, "InfoPanelSection", () => $d570ac304373e71c$export$39c134eb0b07cf0e);
3994
- $parcel$export($d570ac304373e71c$exports, "ExpansionPanel", () => $d570ac304373e71c$export$40e646e38e6ed100);
3995
- $parcel$export($d570ac304373e71c$exports, "SubExpansionPanel", () => $d570ac304373e71c$export$d7160281aff7c3b8);
3996
- $parcel$export($d570ac304373e71c$exports, "ExpandableDetailsPanel", () => $d570ac304373e71c$export$44ad9ff780615135);
3997
- $parcel$export($d570ac304373e71c$exports, "ExpansionBody", () => $d570ac304373e71c$export$263416b670b3f129);
3998
-
3999
-
4000
-
4001
- var $3388ecc062e0c521$exports = {};
4002
-
4003
- $parcel$export($3388ecc062e0c521$exports, "panel-subhead", () => $3388ecc062e0c521$export$bb6008c7ec506dc5, (v) => $3388ecc062e0c521$export$bb6008c7ec506dc5 = v);
4004
- $parcel$export($3388ecc062e0c521$exports, "title", () => $3388ecc062e0c521$export$fb184b623420d9be, (v) => $3388ecc062e0c521$export$fb184b623420d9be = v);
4005
- $parcel$export($3388ecc062e0c521$exports, "expansion-panel", () => $3388ecc062e0c521$export$1db06abc8684077f, (v) => $3388ecc062e0c521$export$1db06abc8684077f = v);
4006
- $parcel$export($3388ecc062e0c521$exports, "sub-expansion-panel", () => $3388ecc062e0c521$export$e1943f56d410f24c, (v) => $3388ecc062e0c521$export$e1943f56d410f24c = v);
4007
- $parcel$export($3388ecc062e0c521$exports, "expansion-panel-header", () => $3388ecc062e0c521$export$771f363b9f663d2c, (v) => $3388ecc062e0c521$export$771f363b9f663d2c = v);
4008
- $parcel$export($3388ecc062e0c521$exports, "expansion-summary-title-help", () => $3388ecc062e0c521$export$47b2fa26e88e0093, (v) => $3388ecc062e0c521$export$47b2fa26e88e0093 = v);
4009
- $parcel$export($3388ecc062e0c521$exports, "expansion-children", () => $3388ecc062e0c521$export$d8457cb7ae0c47fd, (v) => $3388ecc062e0c521$export$d8457cb7ae0c47fd = v);
4010
- $parcel$export($3388ecc062e0c521$exports, "expansion-panel-subtext", () => $3388ecc062e0c521$export$f3447611ed163f53, (v) => $3388ecc062e0c521$export$f3447611ed163f53 = v);
4011
- $parcel$export($3388ecc062e0c521$exports, "expandable-details-main", () => $3388ecc062e0c521$export$561f0c2134cd9732, (v) => $3388ecc062e0c521$export$561f0c2134cd9732 = v);
4012
- $parcel$export($3388ecc062e0c521$exports, "expandable-details-header", () => $3388ecc062e0c521$export$ec357a59e90ee7ee, (v) => $3388ecc062e0c521$export$ec357a59e90ee7ee = v);
4013
- $parcel$export($3388ecc062e0c521$exports, "expandable-details-children", () => $3388ecc062e0c521$export$ae8d16cb87fbdc31, (v) => $3388ecc062e0c521$export$ae8d16cb87fbdc31 = v);
4014
- $parcel$export($3388ecc062e0c521$exports, "expandable-details-toggle", () => $3388ecc062e0c521$export$1089a6d45649b54c, (v) => $3388ecc062e0c521$export$1089a6d45649b54c = v);
4015
- $parcel$export($3388ecc062e0c521$exports, "expandable-details", () => $3388ecc062e0c521$export$20a01d7b55fba18b, (v) => $3388ecc062e0c521$export$20a01d7b55fba18b = v);
4016
- $parcel$export($3388ecc062e0c521$exports, "macrostrat-unit", () => $3388ecc062e0c521$export$fcdb9e479e3129ed, (v) => $3388ecc062e0c521$export$fcdb9e479e3129ed = v);
4017
- $parcel$export($3388ecc062e0c521$exports, "expansion-body", () => $3388ecc062e0c521$export$2d112e83849a3cf7, (v) => $3388ecc062e0c521$export$2d112e83849a3cf7 = v);
4018
- $parcel$export($3388ecc062e0c521$exports, "expansion-panel-detail-header", () => $3388ecc062e0c521$export$854d9fad3b5263eb, (v) => $3388ecc062e0c521$export$854d9fad3b5263eb = v);
4019
- $parcel$export($3388ecc062e0c521$exports, "expansion-panel-detail-body", () => $3388ecc062e0c521$export$494f9067c39d24ef, (v) => $3388ecc062e0c521$export$494f9067c39d24ef = v);
4020
- var $3388ecc062e0c521$export$bb6008c7ec506dc5;
4021
- var $3388ecc062e0c521$export$fb184b623420d9be;
4022
- var $3388ecc062e0c521$export$1db06abc8684077f;
4023
- var $3388ecc062e0c521$export$e1943f56d410f24c;
4024
- var $3388ecc062e0c521$export$771f363b9f663d2c;
4025
- var $3388ecc062e0c521$export$47b2fa26e88e0093;
4026
- var $3388ecc062e0c521$export$d8457cb7ae0c47fd;
4027
- var $3388ecc062e0c521$export$f3447611ed163f53;
4028
- var $3388ecc062e0c521$export$561f0c2134cd9732;
4029
- var $3388ecc062e0c521$export$ec357a59e90ee7ee;
4030
- var $3388ecc062e0c521$export$ae8d16cb87fbdc31;
4031
- var $3388ecc062e0c521$export$1089a6d45649b54c;
4032
- var $3388ecc062e0c521$export$20a01d7b55fba18b;
4033
- var $3388ecc062e0c521$export$fcdb9e479e3129ed;
4034
- var $3388ecc062e0c521$export$2d112e83849a3cf7;
4035
- var $3388ecc062e0c521$export$854d9fad3b5263eb;
4036
- var $3388ecc062e0c521$export$494f9067c39d24ef;
4037
- $3388ecc062e0c521$export$bb6008c7ec506dc5 = "panel-subhead_1340c8";
4038
- $3388ecc062e0c521$export$fb184b623420d9be = "title_1340c8";
4039
- $3388ecc062e0c521$export$1db06abc8684077f = "expansion-panel_1340c8";
4040
- $3388ecc062e0c521$export$e1943f56d410f24c = "sub-expansion-panel_1340c8";
4041
- $3388ecc062e0c521$export$771f363b9f663d2c = "expansion-panel-header_1340c8";
4042
- $3388ecc062e0c521$export$47b2fa26e88e0093 = "expansion-summary-title-help_1340c8";
4043
- $3388ecc062e0c521$export$d8457cb7ae0c47fd = "expansion-children_1340c8";
4044
- $3388ecc062e0c521$export$f3447611ed163f53 = "expansion-panel-subtext_1340c8";
4045
- $3388ecc062e0c521$export$561f0c2134cd9732 = "expandable-details-main_1340c8";
4046
- $3388ecc062e0c521$export$ec357a59e90ee7ee = "expandable-details-header_1340c8";
4047
- $3388ecc062e0c521$export$ae8d16cb87fbdc31 = "expandable-details-children_1340c8";
4048
- $3388ecc062e0c521$export$1089a6d45649b54c = "expandable-details-toggle_1340c8";
4049
- $3388ecc062e0c521$export$20a01d7b55fba18b = "expandable-details_1340c8";
4050
- $3388ecc062e0c521$export$fcdb9e479e3129ed = "macrostrat-unit_1340c8";
4051
- $3388ecc062e0c521$export$2d112e83849a3cf7 = "expansion-body_1340c8";
4052
- $3388ecc062e0c521$export$854d9fad3b5263eb = "expansion-panel-detail-header_1340c8";
4053
- $3388ecc062e0c521$export$494f9067c39d24ef = "expansion-panel-detail-body_1340c8";
4054
-
4055
-
4056
-
4057
-
4058
-
4059
-
4060
- const $72e497a412b1da0a$var$h = (0, $Zz0sd$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($3388ecc062e0c521$exports))));
4061
- function $72e497a412b1da0a$export$ed081779ec3709aa(props) {
4062
- const { title: title , component: component = "h3" , children: children , ...rest } = props;
4063
- return $72e497a412b1da0a$var$h("div.panel-subhead", rest, [
4064
- $72e497a412b1da0a$var$h(component, {
4065
- className: "title"
4066
- }, title),
4067
- children,
4068
- ]);
4069
- }
4070
-
4071
-
4072
- const $d570ac304373e71c$var$h = (0, $Zz0sd$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($3388ecc062e0c521$exports))));
4073
- function $d570ac304373e71c$export$cea00a9d724d5a32(props) {
4074
- const { expanded: expanded , children: children , onChange: onChange , className: className , title: title , titleComponent: titleComponent } = props;
4075
- const icon = expanded ? "chevron-up" : "chevron-down";
4076
- return $d570ac304373e71c$var$h((0, $72e497a412b1da0a$export$ed081779ec3709aa), {
4077
- className: (0, $Zz0sd$classnames)("expansion-panel-header", className),
4078
- onClick: onChange,
4079
- title: title,
4080
- component: titleComponent
4081
- }, [
4082
- children,
4083
- $d570ac304373e71c$var$h((0, $Zz0sd$Icon), {
4084
- icon: icon
4085
- })
4086
- ]);
4087
- }
4088
- function $d570ac304373e71c$var$ExpansionPanelBase(props) {
4089
- let { title: title , titleComponent: titleComponent = "h3" , children: children , expanded: expanded , helpText: helpText , onChange: onChange = ()=>{} , sideComponent: sideComponent = null , className: className , } = props;
4090
- const [isOpen, setOpen] = (0, $Zz0sd$useState)(expanded || false);
4091
- const onChange_ = ()=>{
4092
- onChange();
4093
- setOpen(!isOpen);
4094
- };
4095
- return $d570ac304373e71c$var$h("div.expansion-panel-base", {
4096
- className: (0, $Zz0sd$classnames)(className, {
4097
- expanded: isOpen,
4098
- collapsed: !isOpen
4099
- })
4100
- }, [
4101
- $d570ac304373e71c$var$h($d570ac304373e71c$export$cea00a9d724d5a32, {
4102
- onChange: onChange_,
4103
- expanded: isOpen,
4104
- title: title,
4105
- titleComponent: titleComponent
4106
- }, $d570ac304373e71c$var$h("div.expansion-summary-title-help", [
4107
- $d570ac304373e71c$var$h("span.expansion-panel-subtext", helpText),
4108
- " ",
4109
- sideComponent,
4110
- ])),
4111
- $d570ac304373e71c$var$h((0, $Zz0sd$Collapse), {
4112
- isOpen: isOpen
4113
- }, $d570ac304373e71c$var$h("div.expansion-children", null, children)),
4114
- ]);
4115
- }
4116
- function $d570ac304373e71c$export$39c134eb0b07cf0e(props) {
4117
- let { title: title , children: children , className: className , headerElement: headerElement = null } = props;
4118
- return $d570ac304373e71c$var$h("div.info-panel-section", {
4119
- className: className
4120
- }, [
4121
- $d570ac304373e71c$var$h("div.panel-subhead", null, headerElement ?? $d570ac304373e71c$var$h("h3", title)),
4122
- $d570ac304373e71c$var$h("div.panel-content", null, children),
4123
- ]);
4124
- }
4125
- function $d570ac304373e71c$export$40e646e38e6ed100(props) {
4126
- return $d570ac304373e71c$var$h($d570ac304373e71c$var$ExpansionPanelBase, {
4127
- ...props,
4128
- className: "expansion-panel"
4129
- });
4130
- }
4131
- function $d570ac304373e71c$export$d7160281aff7c3b8(props) {
4132
- return $d570ac304373e71c$var$h($d570ac304373e71c$var$ExpansionPanelBase, {
4133
- ...props,
4134
- className: "expansion-panel sub-expansion-panel",
4135
- titleComponent: "h4"
4136
- });
4137
- }
4138
- function $d570ac304373e71c$export$44ad9ff780615135(props) {
4139
- let { title: title , children: children , value: value , headerElement: headerElement , className: className } = props;
4140
- const [isOpen, setIsOpen] = (0, $Zz0sd$useState)(false);
4141
- headerElement ??= $d570ac304373e71c$var$h([
4142
- $d570ac304373e71c$var$h("div.title", title),
4143
- value
4144
- ]);
4145
- return $d570ac304373e71c$var$h("div.expandable-details", {
4146
- className: className
4147
- }, [
4148
- $d570ac304373e71c$var$h("div.expandable-details-main", [
4149
- $d570ac304373e71c$var$h("div.expandable-details-header", headerElement),
4150
- $d570ac304373e71c$var$h("div.expandable-details-toggle", [
4151
- $d570ac304373e71c$var$h((0, $Zz0sd$Button), {
4152
- small: true,
4153
- minimal: true,
4154
- active: isOpen,
4155
- onClick: ()=>setIsOpen(!isOpen),
4156
- icon: "more"
4157
- }),
4158
- ]),
4159
- ]),
4160
- $d570ac304373e71c$var$h((0, $Zz0sd$Collapse), {
4161
- isOpen: isOpen
4162
- }, $d570ac304373e71c$var$h("div.expandable-details-children", null, children)),
4163
- ]);
4164
- }
4165
- function $d570ac304373e71c$export$263416b670b3f129({ title: title , className: className , children: children }) {
4166
- return $d570ac304373e71c$var$h("div.expansion-body", {
4167
- className: className
4168
- }, [
4169
- $d570ac304373e71c$var$h("div.expansion-panel-detail-header", title),
4170
- $d570ac304373e71c$var$h("div.expansion-panel-detail-body", null, children),
4171
- ]);
4172
- }
4173
-
4174
-
4175
- const $b8c84b63e75fe4f2$var$h = (0, $Zz0sd$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($bfe9593b6c29b10b$exports))));
4176
- function $b8c84b63e75fe4f2$var$usePrevious(value) {
4177
- const ref = (0, $Zz0sd$useRef)();
4178
- (0, $Zz0sd$useEffect)(()=>{
4179
- ref.current = value;
4180
- });
4181
- return ref.current;
4182
- }
4183
- function $b8c84b63e75fe4f2$export$dc87b4d46cea200d({ feature: feature }) {
4184
- const props = feature.properties;
4185
- return $b8c84b63e75fe4f2$var$h("div.feature-record", [
4186
- $b8c84b63e75fe4f2$var$h.if(Object.keys(props).length > 0)("div.feature-properties", [
4187
- $b8c84b63e75fe4f2$var$h((0, $e94acad285dc5835$export$bb1a5c615d2117e4), {
4188
- data: props,
4189
- hideRoot: true
4190
- }),
4191
- ]),
4192
- ]);
4193
- }
4194
- function $b8c84b63e75fe4f2$export$214daccdda0f4ac6({ selectedLocation: selectedLocation , setFeatures: setFeatures , radius: radius = 2 }) {
4195
- const mapRef = (0, $Zz0sd$useMapRef)();
4196
- const { isLoading: isLoading } = (0, $Zz0sd$useMapStatus)();
4197
- const prevLocation = $b8c84b63e75fe4f2$var$usePrevious(selectedLocation);
4198
- (0, $Zz0sd$useEffect)(()=>{
4199
- const map = mapRef?.current;
4200
- if (map == null) return;
4201
- if (selectedLocation == null) {
4202
- setFeatures(null);
4203
- return;
4204
- }
4205
- // Don't update if the location hasn't changed
4206
- if (selectedLocation == prevLocation) return;
4207
- const r = radius;
4208
- const pt = map.project(selectedLocation);
4209
- const bbox = [
4210
- [
4211
- pt.x - r,
4212
- pt.y - r
4213
- ],
4214
- [
4215
- pt.x + r,
4216
- pt.y + r
4217
- ],
4218
- ];
4219
- const features = map.queryRenderedFeatures(bbox);
4220
- setFeatures(features);
4221
- }, [
4222
- mapRef?.current,
4223
- selectedLocation,
4224
- isLoading
4225
- ]);
4226
- return null;
4227
- }
4228
- function $b8c84b63e75fe4f2$var$FeatureHeader({ feature: feature }) {
4229
- return $b8c84b63e75fe4f2$var$h("div.feature-header", [
4230
- $b8c84b63e75fe4f2$var$h("h3", [
4231
- $b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$KeyValue, {
4232
- label: "Source",
4233
- value: feature.source
4234
- }),
4235
- $b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$KeyValue, {
4236
- label: "Source layer",
4237
- value: feature.sourceLayer
4238
- }),
4239
- ]),
4240
- ]);
4241
- }
4242
- function $b8c84b63e75fe4f2$var$KeyValue({ label: label , value: value }) {
4243
- return $b8c84b63e75fe4f2$var$h("span.key-value", [
4244
- $b8c84b63e75fe4f2$var$h("span.key", label),
4245
- $b8c84b63e75fe4f2$var$h("code.value", value)
4246
- ]);
4247
- }
4248
- function $b8c84b63e75fe4f2$var$LoadingAwareFeatureSet({ features: features , sourceID: sourceID }) {
4249
- const map = (0, $Zz0sd$useMapRef)();
4250
- if (map?.current == null) return null;
4251
- const [isLoaded1, setIsLoaded] = (0, $Zz0sd$useState)(false);
4252
- const sourceFeatures = features.filter((d)=>d.source == "burwell");
4253
- (0, $Zz0sd$useEffect)(()=>{
4254
- if (sourceFeatures.length > 0) {
4255
- setIsLoaded(true);
4256
- return;
4257
- }
4258
- const isLoaded = map.current.isSourceLoaded(sourceID);
4259
- setIsLoaded(isLoaded);
4260
- if (!isLoaded) map.current.once("sourcedata", (e)=>{
4261
- if (e.sourceId == sourceID) setIsLoaded(true);
4262
- });
4263
- }, [
4264
- map.current,
4265
- sourceID,
4266
- sourceFeatures.length
4267
- ]);
4268
- if (!isLoaded1) return $b8c84b63e75fe4f2$var$h((0, $Zz0sd$Spinner));
4269
- return $b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$Features, {
4270
- features: sourceFeatures
4271
- });
4272
- }
4273
- function $b8c84b63e75fe4f2$export$43c75dec9d0b96c({ feature: feature , showExtent: showExtent , setShowExtent: setShowExtent }) {
4274
- if (feature == null) return null;
4275
- const size = feature._vectorTileFeature._pbf.length;
4276
- return $b8c84b63e75fe4f2$var$h("div.tile-info", [
4277
- $b8c84b63e75fe4f2$var$h("h3", "Tile"),
4278
- $b8c84b63e75fe4f2$var$h("div.tile-index", [
4279
- $b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$KeyValue, {
4280
- label: "x",
4281
- value: feature._x
4282
- }),
4283
- $b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$KeyValue, {
4284
- label: "y",
4285
- value: feature._y
4286
- }),
4287
- $b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$KeyValue, {
4288
- label: "z",
4289
- value: feature._z
4290
- }),
4291
- ]),
4292
- $b8c84b63e75fe4f2$var$h("div.spacer"),
4293
- $b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$KeyValue, {
4294
- label: "Size",
4295
- value: $b8c84b63e75fe4f2$var$formatSize(size)
4296
- }),
4297
- $b8c84b63e75fe4f2$var$h((0, $Zz0sd$Switch), {
4298
- label: "Show extent",
4299
- alignIndicator: "right",
4300
- checked: showExtent,
4301
- onChange () {
4302
- setShowExtent(!showExtent);
4303
- }
4304
- }),
4305
- ]);
4306
- }
4307
- function $b8c84b63e75fe4f2$var$formatSize(size) {
4308
- if (size > 1000000) return $b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$UnitNumber, {
4309
- value: size / 1000000,
4310
- unit: "Mb"
4311
- });
4312
- if (size > 1000) return $b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$UnitNumber, {
4313
- value: size / 1000,
4314
- unit: "Kb"
4315
- });
4316
- return `${size} bytes`;
4317
- }
4318
- function $b8c84b63e75fe4f2$var$UnitNumber({ value: value , unit: unit , precision: precision = 1 }) {
4319
- return $b8c84b63e75fe4f2$var$h("span.unit-number", [
4320
- $b8c84b63e75fe4f2$var$h("span.number", value.toFixed(precision)),
4321
- $b8c84b63e75fe4f2$var$h("span.unit", unit),
4322
- ]);
4323
- }
4324
- function $b8c84b63e75fe4f2$export$43277c51a01761c1({ features: features , focusedSource: focusedSource = null , focusedSourceTitle: focusedSourceTitle = null , }) {
4325
- if (features == null) return null;
4326
- let focusedSourcePanel = null;
4327
- let filteredFeatures = features;
4328
- let title = "Features";
4329
- if (focusedSource != null) {
4330
- title = "Basemap features";
4331
- focusedSourcePanel = $b8c84b63e75fe4f2$var$h((0, $d570ac304373e71c$export$40e646e38e6ed100), {
4332
- title: "Macrostrat features",
4333
- className: "macrostrat-features",
4334
- expanded: true
4335
- }, [
4336
- $b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$LoadingAwareFeatureSet, {
4337
- features: features,
4338
- sourceID: focusedSource
4339
- }),
4340
- ]);
4341
- filteredFeatures = features.filter((d)=>d.source != focusedSource);
4342
- }
4343
- return $b8c84b63e75fe4f2$var$h("div.feature-panel", [
4344
- focusedSourcePanel,
4345
- $b8c84b63e75fe4f2$var$h((0, $d570ac304373e71c$export$40e646e38e6ed100), {
4346
- title: title,
4347
- className: "basemap-features",
4348
- expanded: focusedSource == null
4349
- }, [
4350
- $b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$Features, {
4351
- features: filteredFeatures
4352
- }),
4353
- ]),
4354
- ]);
4355
- }
4356
- function $b8c84b63e75fe4f2$var$Features({ features: features1 }) {
4357
- /** Group features by source and sourceLayer */ if (features1 == null) return null;
4358
- const groups = (0, $Zz0sd$group)(features1, (d)=>`${d.source} - ${d.sourceLayer}`);
4359
- return $b8c84b63e75fe4f2$var$h("div.features", Array.from(groups).map(([key, features])=>{
4360
- return $b8c84b63e75fe4f2$var$h("div.feature-group", [
4361
- $b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$var$FeatureHeader, {
4362
- feature: features[0]
4363
- }),
4364
- features.map((feature, i)=>$b8c84b63e75fe4f2$var$h($b8c84b63e75fe4f2$export$dc87b4d46cea200d, {
4365
- key: i,
4366
- feature: feature
4367
- })),
4368
- ]);
4369
- }));
4370
- }
4371
-
4372
-
4373
- let $a281a0612311d660$export$dce4b6e67bb5f25a;
4374
- (function(MacrostratVectorTileset1) {
4375
- MacrostratVectorTileset1["Carto"] = "carto";
4376
- MacrostratVectorTileset1["CartoSlim"] = "carto-slim";
4377
- MacrostratVectorTileset1["IGCPOrogens"] = "igcp-orogens";
4378
- })($a281a0612311d660$export$dce4b6e67bb5f25a || ($a281a0612311d660$export$dce4b6e67bb5f25a = {}));
4379
- let $a281a0612311d660$export$cc7c195070dfb906;
4380
- (function(MacrostratRasterTileset1) {
4381
- MacrostratRasterTileset1["Carto"] = "carto";
4382
- MacrostratRasterTileset1["Emphasized"] = "emphasized";
4383
- })($a281a0612311d660$export$cc7c195070dfb906 || ($a281a0612311d660$export$cc7c195070dfb906 = {}));
4384
- const $a281a0612311d660$export$dda1d9f60106f0e9 = (0, $Zz0sd$macrostrathyper).styled((0, (/*@__PURE__*/$parcel$interopDefault($bfe9593b6c29b10b$exports))));
4385
- function $a281a0612311d660$export$2391061fbdfb71ef({ title: title = "Map inspector" , headerElement: headerElement = null , transformRequest: transformRequest = null , mapPosition: mapPosition = null , mapboxToken: mapboxToken = null , overlayStyle: overlayStyle = null , children: children , style: style , focusedSource: focusedSource = null , focusedSourceTitle: focusedSourceTitle = null , projection: projection = null }) {
4386
- /* We apply a custom style to the panel container when we are interacting
4387
- with the search bar, so that we can block map interactions until search
4388
- bar focus is lost.
4389
- We also apply a custom style when the infodrawer is open so we can hide
4390
- the search bar on mobile platforms
4391
- */ const dark = (0, $70366c8972398d2a$export$4673cbff94e146e2)();
4392
- const isEnabled = dark?.isEnabled;
4393
- if (mapboxToken != null) (0, $Zz0sd$mapboxgl).accessToken = mapboxToken;
4394
- style ??= isEnabled ? "mapbox://styles/mapbox/dark-v10" : "mapbox://styles/mapbox/light-v10";
4395
- const [isOpen, setOpen] = (0, $Zz0sd$useState)(false);
4396
- const [state, setState] = (0, $962bc0f04255cfc3$export$8b052fe25089340e)("macrostrat:dev-map-page", {
4397
- showTileExtent: false,
4398
- xRay: false
4399
- });
4400
- const { showTileExtent: showTileExtent , xRay: xRay } = state;
4401
- const [actualStyle, setActualStyle] = (0, $Zz0sd$useState)(style);
4402
- (0, $Zz0sd$useEffect)(()=>{
4403
- (0, $64ee2eed3ed5ffbc$export$e739dc8dfc0db9a6)(style, overlayStyle, {
4404
- mapboxToken: mapboxToken,
4405
- inDarkMode: isEnabled,
4406
- xRay: xRay
4407
- }).then(setActualStyle);
4408
- }, [
4409
- style,
4410
- xRay,
4411
- mapboxToken,
4412
- isEnabled,
4413
- overlayStyle
4414
- ]);
4415
- const [inspectPosition, setInspectPosition] = (0, $Zz0sd$useState)(null);
4416
- const [data, setData] = (0, $Zz0sd$useState)(null);
4417
- const onSelectPosition = (0, $Zz0sd$useCallback)((position)=>{
4418
- setInspectPosition(position);
4419
- }, []);
4420
- let detailElement = null;
4421
- if (inspectPosition != null) detailElement = $a281a0612311d660$export$dda1d9f60106f0e9((0, $f50c3537aaff0cff$export$aa4baff5242ea6e1), {
4422
- onClose () {
4423
- setInspectPosition(null);
4424
- },
4425
- position: inspectPosition
4426
- }, [
4427
- $a281a0612311d660$export$dda1d9f60106f0e9((0, $b8c84b63e75fe4f2$export$43c75dec9d0b96c), {
4428
- feature: data?.[0] ?? null,
4429
- showExtent: showTileExtent,
4430
- setShowExtent () {
4431
- setState({
4432
- ...state,
4433
- showTileExtent: !showTileExtent
4434
- });
4435
- }
4436
- }),
4437
- $a281a0612311d660$export$dda1d9f60106f0e9((0, $b8c84b63e75fe4f2$export$43277c51a01761c1), {
4438
- features: data,
4439
- focusedSource: focusedSource,
4440
- focusedSourceTitle: focusedSourceTitle
4441
- }),
4442
- ]);
4443
- let tile = null;
4444
- if (showTileExtent && data?.[0] != null) {
4445
- let f = data[0];
4446
- tile = {
4447
- x: f._x,
4448
- y: f._y,
4449
- z: f._z
4450
- };
4451
- }
4452
- console.log("Style", actualStyle);
4453
- return $a281a0612311d660$export$dda1d9f60106f0e9((0, $4bdfa9cd8240b2fd$export$9fa5da0bcfd0a290), {
4454
- navbar: $a281a0612311d660$export$dda1d9f60106f0e9((0, $6e914c81c8e053da$export$a8cc0062d02a3841), [
4455
- headerElement ?? $a281a0612311d660$export$dda1d9f60106f0e9("h2", title),
4456
- $a281a0612311d660$export$dda1d9f60106f0e9((0, $9197c0703088e02c$export$d7a54cba636a8cd6)),
4457
- $a281a0612311d660$export$dda1d9f60106f0e9((0, $6e914c81c8e053da$export$9e3bae3c08bde368), {
4458
- active: isOpen,
4459
- onClick: ()=>setOpen(!isOpen)
4460
- }),
4461
- ]),
4462
- contextPanel: $a281a0612311d660$export$dda1d9f60106f0e9((0, $4bdfa9cd8240b2fd$export$ec68dd77edbe678b), [
4463
- $a281a0612311d660$export$dda1d9f60106f0e9((0, $Zz0sd$Switch), {
4464
- checked: xRay,
4465
- label: "X-ray mode",
4466
- onChange () {
4467
- setState({
4468
- ...state,
4469
- xRay: !xRay
4470
- });
4471
- }
4472
- }),
4473
- children,
4474
- ]),
4475
- detailPanel: detailElement,
4476
- contextPanelOpen: isOpen
4477
- }, $a281a0612311d660$export$dda1d9f60106f0e9((0, $9e150e311a3261e9$export$ab1e7a67d6ec5ad8), {
4478
- style: actualStyle,
4479
- transformRequest: transformRequest,
4480
- mapPosition: mapPosition,
4481
- projection: "globe"
4482
- }, [
4483
- $a281a0612311d660$export$dda1d9f60106f0e9((0, $b8c84b63e75fe4f2$export$214daccdda0f4ac6), {
4484
- selectedLocation: inspectPosition,
4485
- setFeatures: setData
4486
- }),
4487
- $a281a0612311d660$export$dda1d9f60106f0e9((0, $4bc3dd5f0732eed3$export$5c90a91c7455938c), {
4488
- position: inspectPosition,
4489
- setPosition: onSelectPosition
4490
- }),
4491
- $a281a0612311d660$export$dda1d9f60106f0e9((0, $1d4d29ef2725aa16$export$86c09739b12f23cd), {
4492
- tile: tile,
4493
- color: isEnabled ? "white" : "black"
4494
- }),
4495
- ]));
4496
- }
4497
-
4498
-
4499
-
4500
-
4501
-
4502
- $parcel$exportWildcard($b6d2ac1192949c28$exports, $a281a0612311d660$exports);
4503
- $parcel$exportWildcard($b6d2ac1192949c28$exports, $1d4d29ef2725aa16$exports);
4504
- $parcel$exportWildcard($b6d2ac1192949c28$exports, $b8c84b63e75fe4f2$exports);
4505
- $parcel$exportWildcard($b6d2ac1192949c28$exports, $64ee2eed3ed5ffbc$exports);
4506
-
4507
-
4508
-
4509
-
4510
-
4511
-
4512
-
4513
-
4514
-
4515
-
4516
-
4517
- export {$6e914c81c8e053da$export$4ec83e90d030b2f3 as LoadingButton, $6e914c81c8e053da$export$9e3bae3c08bde368 as MapLoadingButton, $6e914c81c8e053da$export$a8cc0062d02a3841 as FloatingNavbar, $f50c3537aaff0cff$export$83f9a19cf91c2d06 as InfoDrawerContainer, $f50c3537aaff0cff$export$aa4baff5242ea6e1 as LocationPanel, $a281a0612311d660$export$dce4b6e67bb5f25a as MacrostratVectorTileset, $a281a0612311d660$export$cc7c195070dfb906 as MacrostratRasterTileset, $a281a0612311d660$export$dda1d9f60106f0e9 as h, $a281a0612311d660$export$2391061fbdfb71ef as DevMapPage, $1d4d29ef2725aa16$export$86c09739b12f23cd as TileExtentLayer, $b8c84b63e75fe4f2$export$dc87b4d46cea200d as FeatureRecord, $b8c84b63e75fe4f2$export$214daccdda0f4ac6 as FeatureSelectionHandler, $b8c84b63e75fe4f2$export$43c75dec9d0b96c as TileInfo, $b8c84b63e75fe4f2$export$43277c51a01761c1 as FeaturePanel, $64ee2eed3ed5ffbc$export$eff5fb2e10d05b1d as buildXRayStyle, $64ee2eed3ed5ffbc$export$e739dc8dfc0db9a6 as buildInspectorStyle, $4bdfa9cd8240b2fd$export$57b87f3e07d4bb90 as MapInterface, $4bdfa9cd8240b2fd$export$ec68dd77edbe678b as PanelCard, $4bdfa9cd8240b2fd$export$fa395a37c3898ae3 as MapStyledContainer, $4bdfa9cd8240b2fd$export$9fa5da0bcfd0a290 as MapAreaContainer, $9e150e311a3261e9$export$ab1e7a67d6ec5ad8 as MapView, $9e150e311a3261e9$export$cee395a8a2a00b29 as MapTerrainManager, $91d5aa004eeb2226$export$db1a2e058a06fb5c as MapBottomControls, $4bc3dd5f0732eed3$export$31b2e088aff2dc5d as MapResizeManager, $4bc3dd5f0732eed3$export$2ab96428dea558d6 as MapPaddingManager, $4bc3dd5f0732eed3$export$f6eeee399afc4e9a as MapMovedReporter, $4bc3dd5f0732eed3$export$e57f9eaa51773f82 as MapLoadingReporter, $4bc3dd5f0732eed3$export$5c90a91c7455938c as MapMarker, $82fe09613877ffc2$export$bb78f9f01775eef1 as getMapPadding, $82fe09613877ffc2$export$278090850f6b3a9f as useMapMarker, $4fae2d573d730db8$export$716098b85fd0efdf as ValueWithUnit, $4fae2d573d730db8$export$af8082af0bea3eb1 as DegreeCoord, $4fae2d573d730db8$export$f195b3550849e560 as LngLatCoords, $4fae2d573d730db8$export$58bfb4f6ec5aa58d as Elevation, $d570ac304373e71c$export$cea00a9d724d5a32 as ExpansionPanelSummary, $d570ac304373e71c$export$39c134eb0b07cf0e as InfoPanelSection, $d570ac304373e71c$export$40e646e38e6ed100 as ExpansionPanel, $d570ac304373e71c$export$d7160281aff7c3b8 as SubExpansionPanel, $d570ac304373e71c$export$44ad9ff780615135 as ExpandableDetailsPanel, $d570ac304373e71c$export$263416b670b3f129 as ExpansionBody};
4518
- //# sourceMappingURL=module.js.map