atriusmaps-node-sdk 3.3.711 → 3.3.714
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/cjs/package.json.js +1 -1
- package/dist/cjs/plugins/wayfinder/src/segmentBadges.js +3 -0
- package/dist/cjs/plugins/wayfinder/src/segmentBuilder.js +4 -0
- package/dist/cjs/plugins/wayfinder/src/segmentCategories.js +3 -0
- package/dist/cjs/plugins/wayfinder/src/stepBuilder.js +15 -0
- package/dist/package.json.js +1 -1
- package/dist/plugins/wayfinder/src/segmentBadges.js +1 -1
- package/dist/plugins/wayfinder/src/segmentBuilder.js +1 -1
- package/dist/plugins/wayfinder/src/segmentCategories.js +1 -1
- package/dist/plugins/wayfinder/src/stepBuilder.js +1 -1
- package/package.json +1 -1
package/dist/cjs/package.json.js
CHANGED
|
@@ -9,6 +9,9 @@ const segmentBadges = {
|
|
|
9
9
|
STAIRS: 'wayfinding.stairs',
|
|
10
10
|
STAIRS_UP: 'wayfinding.stairs.up',
|
|
11
11
|
STAIRS_DOWN: 'wayfinding.stairs.down',
|
|
12
|
+
ACCESSIBLE_STAIRS: 'wayfinding.accessiblestairs',
|
|
13
|
+
ACCESSIBLE_STAIRS_UP: 'wayfinding.accessiblestairs.up',
|
|
14
|
+
ACCESSIBLE_STAIRS_DOWN: 'wayfinding.accessiblestairs.down',
|
|
12
15
|
ESCALATOR: 'wayfinding.escalator',
|
|
13
16
|
ESCALATOR_UP: 'wayfinding.escalator.up',
|
|
14
17
|
ESCALATOR_DOWN: 'wayfinding.escalator.down',
|
|
@@ -38,6 +38,10 @@ const setSegmentCategory = segments => {
|
|
|
38
38
|
if (segment.levelDifference > 0) segment.segmentCategory = segmentCategories.STAIRS_UP;
|
|
39
39
|
else if (segment.levelDifference < 0) segment.segmentCategory = segmentCategories.STAIRS_DOWN;
|
|
40
40
|
else segment.segmentCategory = segmentCategories.STAIRS;
|
|
41
|
+
} else if (segment.type === 'AccessibleStairs') {
|
|
42
|
+
if (segment.levelDifference > 0) segment.segmentCategory = segmentCategories.ACCESSIBLE_STAIRS_UP;
|
|
43
|
+
else if (segment.levelDifference < 0) segment.segmentCategory = segmentCategories.ACCESSIBLE_STAIRS_DOWN;
|
|
44
|
+
else segment.segmentCategory = segmentCategories.ACCESSIBLE_STAIRS;
|
|
41
45
|
} else if (segment.type === 'Elevator') {
|
|
42
46
|
if (segment.levelDifference > 0) segment.segmentCategory = segmentCategories.ELEVATOR_UP;
|
|
43
47
|
else if (segment.levelDifference < 0) segment.segmentCategory = segmentCategories.ELEVATOR_DOWN;
|
|
@@ -11,6 +11,9 @@ const segmentCategories = {
|
|
|
11
11
|
STAIRS: 'stairs',
|
|
12
12
|
STAIRS_UP: 'stairs.up',
|
|
13
13
|
STAIRS_DOWN: 'stairs.down',
|
|
14
|
+
ACCESSIBLE_STAIRS: 'accessiblestairs',
|
|
15
|
+
ACCESSIBLE_STAIRS_UP: 'accessiblestairs.up',
|
|
16
|
+
ACCESSIBLE_STAIRS_DOWN: 'accessiblestairs.down',
|
|
14
17
|
ESCALATOR: 'escalator',
|
|
15
18
|
ESCALATOR_UP: 'escalator.up',
|
|
16
19
|
ESCALATOR_DOWN: 'escalator.down',
|
|
@@ -147,6 +147,12 @@ function getIcon(segmentCategory) {
|
|
|
147
147
|
return segmentBadges.STAIRS_UP;
|
|
148
148
|
case segmentCategories.STAIRS_DOWN:
|
|
149
149
|
return segmentBadges.STAIRS_DOWN;
|
|
150
|
+
case segmentCategories.ACCESSIBLE_STAIRS:
|
|
151
|
+
return segmentBadges.ACCESSIBLE_STAIRS;
|
|
152
|
+
case segmentCategories.ACCESSIBLE_STAIRS_UP:
|
|
153
|
+
return segmentBadges.ACCESSIBLE_STAIRS_UP;
|
|
154
|
+
case segmentCategories.ACCESSIBLE_STAIRS_DOWN:
|
|
155
|
+
return segmentBadges.ACCESSIBLE_STAIRS_DOWN;
|
|
150
156
|
case segmentCategories.ESCALATOR:
|
|
151
157
|
return segmentBadges.ESCALATOR;
|
|
152
158
|
case segmentCategories.ESCALATOR_UP:
|
|
@@ -237,6 +243,9 @@ function getPrimaryText(segments, index, startName, destinationName, floorIdToNa
|
|
|
237
243
|
case segmentCategories.STAIRS:
|
|
238
244
|
case segmentCategories.STAIRS_DOWN:
|
|
239
245
|
case segmentCategories.STAIRS_UP:
|
|
246
|
+
case segmentCategories.ACCESSIBLE_STAIRS:
|
|
247
|
+
case segmentCategories.ACCESSIBLE_STAIRS_DOWN:
|
|
248
|
+
case segmentCategories.ACCESSIBLE_STAIRS_UP:
|
|
240
249
|
return getLevelName(segment, floorIdToNameMap);
|
|
241
250
|
default:
|
|
242
251
|
return T(`wayfinder:${segment.type}`);
|
|
@@ -273,6 +282,12 @@ function getSecondaryText(segment, minutes, T, ui, direction, currentUnits, curr
|
|
|
273
282
|
return T('wayfinder:Take stairs up to');
|
|
274
283
|
case segmentCategories.STAIRS_DOWN:
|
|
275
284
|
return T('wayfinder:Take stairs down to');
|
|
285
|
+
case segmentCategories.ACCESSIBLE_STAIRS:
|
|
286
|
+
return T('wayfinder:Take accessible stairs to');
|
|
287
|
+
case segmentCategories.ACCESSIBLE_STAIRS_UP:
|
|
288
|
+
return T('wayfinder:Take accessible stairs up to');
|
|
289
|
+
case segmentCategories.ACCESSIBLE_STAIRS_DOWN:
|
|
290
|
+
return T('wayfinder:Take accessible stairs down to');
|
|
276
291
|
case segmentCategories.ESCALATOR:
|
|
277
292
|
return T('wayfinder:Take escalator to');
|
|
278
293
|
case segmentCategories.ESCALATOR_UP:
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="web-engine",t="3.3.
|
|
1
|
+
var e="web-engine",t="3.3.714",s="UNLICENSED",r="module",o="src/main.js",i=["demo","deploy","nodesdk","src/extModules/flexapi","services/*","libraries/*"],l={colors:"cat utils/colors1.txt && node utils/processColors.js | pbcopy && cat utils/colors2.txt","cypress:comp":"cypress open --component --browser chrome","cypress:comp:ci":"cypress run --component",demo:"cd demo/ && yarn start",dev:"yarn mol e2e","format:check":"yarn prettier . --check","format:fix":"yarn prettier . --write",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh",lint:"eslint .",mod:"demo/startMod.sh",mol:"demo/startMol.sh","mol:build":"demo/startMolBuild.sh",molProd:"cd deploy && yarn buildAndRunMol","playwright:ci":"yarn playwright test --grep-invert sdk","playwright:ci:failed":"yarn playwright test --last-failed --grep-invert sdk","playwright:sdk":"yarn start-server-and-test 'cd ./deploy && yarn buildDev && yarn serveLocal' 8085 'cd ./test/sdk && npx http-server' 8080 'yarn playwright test sdk --ui'","playwright:ui":"yarn playwright test --ui --grep-invert sdk",prepare:"husky",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch","test:all":"yarn lint && yarn format:check && yarn test && yarn test:vitest && yarn cypress:comp:ci && yarn playwright:ci","test:vitest":"vitest run",typecheck:"tsc -p tsconfig.checkjs.json"},a=["defaults"],n={react:"^18.3.1"},c={"@azure/event-hubs":"^5.12.2","@csstools/normalize.css":"^11.0.1","@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@locus-labs/mod-badge":"^0.1.102","@locus-labs/mod-footer":"^0.0.111","@locus-labs/mod-header":"^0.0.105","@locus-labs/mod-location-marker":"^0.0.104","@locus-labs/mod-map-legend":"^0.0.104","@locus-labs/mod-offscreen-indicator":"^0.0.104","@locus-labs/mod-pin":"^0.0.104","@locus-labs/mod-qr-code-card":"^0.0.104","@locus-labs/mod-qr-code-window":"^0.0.105","@locus-labs/mod-walk-time-matrix":"^0.0.103","@mapbox/mapbox-gl-draw":"^1.5.0","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@microsoft/applicationinsights-web":"^3.3.6","@turf/area":"^7.2.0","@turf/bbox-clip":"^7.2.0","@turf/bbox-polygon":"^7.2.0","@turf/bearing":"^7.2.0","@turf/circle":"^7.2.0","@turf/helpers":"^7.2.0","@turf/point-to-line-distance":"^7.2.0","@vitejs/plugin-react":"^4.3.4","axe-core":"^4.10.3",browserslist:"^4.27.0","crypto-browserify":"^3.12.1","cypress-multi-reporters":"^2.0.5","cypress-real-events":"^1.14.0","file-loader":"^6.2.0",flexsearch:"^0.7.43","h3-js":"^4.1.0",i18next:"^20.6.1","i18next-browser-languagedetector":"^6.1.1","jest-transform-css":"6.0.2",jsdom:"^25.0.1",jsonschema:"^1.5.0",luxon:"^3.5.0","maplibre-gl":"^4.7.1","mini-css-extract-plugin":"^2.9.2","mocha-junit-reporter":"^2.2.1",mochawesome:"^7.1.3","node-polyfill-webpack-plugin":"^4.1.0","path-browserify":"^1.0.1","prop-types":"^15.8.1",ramda:"^0.30.1",react:"^18.3.1","react-compound-slider":"^3.4.0","react-dom":"^18.3.1","react-json-editor-ajrm":"^2.5.14","react-qr-svg":"^2.4.0","react-svg":"^16.3.0","react-virtualized-auto-sizer":"^1.0.25","react-window":"^1.8.11","smoothscroll-polyfill":"^0.4.4","styled-components":"^6.1.15","styled-normalize":"^8.1.1","throttle-debounce":"^5.0.2",trackjs:"^3.10.4","ua-parser-js":"^0.7.40",uuid:"11.1.0",zousan:"^3.0.1","zousan-plus":"^4.0.1"},p={"@applitools/eyes-playwright":"^1.44.1","@axe-core/playwright":"^4.10.2","@azure/identity":"^4.13.0","@azure/playwright":"^1.0.0","@babel/core":"^7.26.10","@babel/eslint-parser":"^7.26.10","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-syntax-import-assertions":"^7.26.0","@babel/plugin-transform-modules-commonjs":"^7.26.3","@babel/plugin-transform-runtime":"^7.26.10","@babel/preset-env":"^7.26.9","@babel/preset-react":"^7.26.3","@playwright/test":"^1.56.0","@testing-library/jest-dom":"^6.6.3","@types/react":"^19.0.10","@types/react-dom":"^19.0.4","@typescript-eslint/eslint-plugin":"^8.26.1","@typescript-eslint/parser":"^8.26.1","babel-jest":"^29.7.0","babel-loader":"^10.0.0","babel-plugin-inline-json-import":"^0.3.2","babel-plugin-module-resolver":"^5.0.2","babel-plugin-styled-components":"^2.1.4","chai-colors":"^1.0.1","css-loader":"^7.1.2",cypress:"^14.2.0","cypress-wait-until":"^3.0.2",eslint:"^8.57.1","eslint-config-prettier":"^10.1.8","eslint-config-standard":"^17.1.0","eslint-import-resolver-alias":"^1.1.2","eslint-import-resolver-typescript":"^3.9.1","eslint-plugin-cypress":"^2.15.2","eslint-plugin-import":"^2.31.0","eslint-plugin-jest":"^28.11.0","eslint-plugin-n":"^17.16.2","eslint-plugin-node":"^11.1.0","eslint-plugin-playwright":"^2.2.2","eslint-plugin-promise":"^5.2.0","eslint-plugin-react":"^7.37.4","eslint-plugin-standard":"^5.0.0","fetch-mock-jest":"^1.5.1",glob:"^11.0.1",husky:"^9.1.7",jest:"29.7.0","jest-environment-jsdom":"^29.7.0","lint-staged":"^15.5.0","node-fetch":"^2.7.0","null-loader":"^4.0.1",nx:"19.8.14","nx-remotecache-azure":"^19.0.0","os-browserify":"^0.3.0",prettier:"3.7.4","start-server-and-test":"^2.0.11",typescript:"^5.8.2",vite:"^4.3.9",vitest:"^4.0.17","webpack-merge":"^6.0.1"},d="yarn@4.7.0",m={node:"24.x"},u={},y={name:e,version:t,private:!0,license:s,type:r,main:o,workspaces:i,scripts:l,"lint-staged":{"*.js":["eslint --fix","prettier --check"],"*.{json,md,css,ts,tsx,jsx}":["prettier --check"]},browserslist:a,resolutions:n,dependencies:c,devDependencies:p,packageManager:d,engines:m,nx:u};export{a as browserslist,y as default,c as dependencies,p as devDependencies,m as engines,s as license,o as main,e as name,u as nx,d as packageManager,n as resolutions,l as scripts,r as type,t as version,i as workspaces};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const i={START:"wayfinding.start",END:"wayfinding.end",ELEVATOR:"wayfinding.elevator",ELEVATOR_UP:"wayfinding.elevator.up",ELEVATOR_DOWN:"wayfinding.elevator.down",STAIRS:"wayfinding.stairs",STAIRS_UP:"wayfinding.stairs.up",STAIRS_DOWN:"wayfinding.stairs.down",ACCESSIBLE_STAIRS:"wayfinding.accessiblestairs",ACCESSIBLE_STAIRS_UP:"wayfinding.accessiblestairs.up",ACCESSIBLE_STAIRS_DOWN:"wayfinding.accessiblestairs.down",ESCALATOR:"wayfinding.escalator",ESCALATOR_UP:"wayfinding.escalator.up",ESCALATOR_DOWN:"wayfinding.escalator.down",WALK:"wayfinding.movingwalkway",TRAIN:"wayfinding.train",TRAIN_UP:"wayfinding.train.up",TRAIN_DOWN:"wayfinding.train.down",BUS:"wayfinding.bus",BUS_UP:"wayfinding.bus.up",BUS_DOWN:"wayfinding.bus.down",SECURITY_CHECKPOINT:"wayfinding.security",RAMP:"wayfinding.ramp",RAMP_UP:"wayfinding.ramp.up",RAMP_DOWN:"wayfinding.ramp.down"};export{i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"ramda";import{bezierCurveTo as t}from"../../../src/utils/geom.js";import o from"./segmentCategories.js";import a from"./stepBuilder.js";const n=e.map(e.converge(e.assoc("coordinates"),[e=>e.waypoints.flatMap((e,o)=>o>0&&e.curvedPathForward&&e.curvedPathForward.length>0?e.curvedPathForward.flatMap(e=>t(e.start.lng,e.start.lat,e.in.lng,e.in.lat,e.out.lng,e.out.lat,e.end.lng,e.end.lat)).map(e=>[e.x,e.y]):[[e.position.lng,e.position.lat]]),e.identity])),r=t=>{const a=[];let n={segmentCategory:void 0,waypoints:[]},r=null,s=[];return n.waypoints=[t[0]],n.type=t[0].isPortal?t[0].portalType:"Walk",a.push(n),n={segmentCategory:void 0,waypoints:[]},t.forEach(e=>{s.push(e),r?(r.isPortal===e.isPortal&&r.isSecurityCheckpoint===e.isSecurityCheckpoint||(n.waypoints=s,e.isPortal||r.isPortal?(s.length>1&&s.pop(),s=!e.isPortal||"train"!==e.portalType.toLowerCase()&&"bus"!==e.portalType.toLowerCase()?[e]:[s[s.length-1],e]):s=[],r.poiId&&(n.poiId=r.poiId),a.push(n),n={segmentCategory:void 0,waypoints:[]},n.type=e.isPortal?e.portalType:"Walk"),n.levelDifference=e.levelDifference,r=e):(n.type=e.isPortal?e.portalType:"Walk",r=e)}),n.waypoints=s,0===s.length&&(n.waypoints=[r]),a.push(n),(e=>{e.forEach((t,a)=>{0===a?t.segmentCategory=o.START:t.waypoints[t.waypoints.length-1].isDestination?t.segmentCategory=o.WALKING_TO_END:"Security Checkpoint"===t.type?t.segmentCategory=o.SECURITY_CHECKPOINT:"Bus"===t.type?t.segmentCategory=o.BUS:"Train"===t.type?t.segmentCategory=o.TRAIN:"Stairs"===t.type?t.levelDifference>0?t.segmentCategory=o.STAIRS_UP:t.levelDifference<0?t.segmentCategory=o.STAIRS_DOWN:t.segmentCategory=o.STAIRS:"Elevator"===t.type?t.levelDifference>0?t.segmentCategory=o.ELEVATOR_UP:t.levelDifference<0?t.segmentCategory=o.ELEVATOR_DOWN:t.segmentCategory=o.ELEVATOR:"Escalator"===t.type?t.levelDifference>0?t.segmentCategory=o.ESCALATOR_UP:t.levelDifference<0?t.segmentCategory=o.ESCALATOR_DOWN:t.segmentCategory=o.ESCALATOR:"Ramp"===t.type?t.levelDifference>0?t.segmentCategory=o.RAMP_UP:t.levelDifference<0?t.segmentCategory=o.RAMP_DOWN:t.segmentCategory=o.RAMP:"Security Checkpoint"===e[a+1].type?t.segmentCategory=o.WALKING_TO_SECURITY_CHECKPOINT:"Walk"!==e[a+1].type&&(t.segmentCategory=o.WALKING_TO_PORTAL)})})(a),((e,t)=>{if(1===e.length){const a={segmentCategory:void 0,waypoints:[]};a.segmentCategory=o.WALKING_TO_END,a.type="Walk",a.waypoints=[t],e.push(a)}})(a,r),(t=>{t.forEach((o,a)=>{if(a>1&&0===e.head(o.waypoints).levelDifference){const n=e.last(t[a-1].waypoints);o.waypoints=e.prepend(n,o.waypoints)}})})(a),a},s=(t,s,i,p,
|
|
1
|
+
import*as e from"ramda";import{bezierCurveTo as t}from"../../../src/utils/geom.js";import o from"./segmentCategories.js";import a from"./stepBuilder.js";const n=e.map(e.converge(e.assoc("coordinates"),[e=>e.waypoints.flatMap((e,o)=>o>0&&e.curvedPathForward&&e.curvedPathForward.length>0?e.curvedPathForward.flatMap(e=>t(e.start.lng,e.start.lat,e.in.lng,e.in.lat,e.out.lng,e.out.lat,e.end.lng,e.end.lat)).map(e=>[e.x,e.y]):[[e.position.lng,e.position.lat]]),e.identity])),r=t=>{const a=[];let n={segmentCategory:void 0,waypoints:[]},r=null,s=[];return n.waypoints=[t[0]],n.type=t[0].isPortal?t[0].portalType:"Walk",a.push(n),n={segmentCategory:void 0,waypoints:[]},t.forEach(e=>{s.push(e),r?(r.isPortal===e.isPortal&&r.isSecurityCheckpoint===e.isSecurityCheckpoint||(n.waypoints=s,e.isPortal||r.isPortal?(s.length>1&&s.pop(),s=!e.isPortal||"train"!==e.portalType.toLowerCase()&&"bus"!==e.portalType.toLowerCase()?[e]:[s[s.length-1],e]):s=[],r.poiId&&(n.poiId=r.poiId),a.push(n),n={segmentCategory:void 0,waypoints:[]},n.type=e.isPortal?e.portalType:"Walk"),n.levelDifference=e.levelDifference,r=e):(n.type=e.isPortal?e.portalType:"Walk",r=e)}),n.waypoints=s,0===s.length&&(n.waypoints=[r]),a.push(n),(e=>{e.forEach((t,a)=>{0===a?t.segmentCategory=o.START:t.waypoints[t.waypoints.length-1].isDestination?t.segmentCategory=o.WALKING_TO_END:"Security Checkpoint"===t.type?t.segmentCategory=o.SECURITY_CHECKPOINT:"Bus"===t.type?t.segmentCategory=o.BUS:"Train"===t.type?t.segmentCategory=o.TRAIN:"Stairs"===t.type?t.levelDifference>0?t.segmentCategory=o.STAIRS_UP:t.levelDifference<0?t.segmentCategory=o.STAIRS_DOWN:t.segmentCategory=o.STAIRS:"AccessibleStairs"===t.type?t.levelDifference>0?t.segmentCategory=o.ACCESSIBLE_STAIRS_UP:t.levelDifference<0?t.segmentCategory=o.ACCESSIBLE_STAIRS_DOWN:t.segmentCategory=o.ACCESSIBLE_STAIRS:"Elevator"===t.type?t.levelDifference>0?t.segmentCategory=o.ELEVATOR_UP:t.levelDifference<0?t.segmentCategory=o.ELEVATOR_DOWN:t.segmentCategory=o.ELEVATOR:"Escalator"===t.type?t.levelDifference>0?t.segmentCategory=o.ESCALATOR_UP:t.levelDifference<0?t.segmentCategory=o.ESCALATOR_DOWN:t.segmentCategory=o.ESCALATOR:"Ramp"===t.type?t.levelDifference>0?t.segmentCategory=o.RAMP_UP:t.levelDifference<0?t.segmentCategory=o.RAMP_DOWN:t.segmentCategory=o.RAMP:"Security Checkpoint"===e[a+1].type?t.segmentCategory=o.WALKING_TO_SECURITY_CHECKPOINT:"Walk"!==e[a+1].type&&(t.segmentCategory=o.WALKING_TO_PORTAL)})})(a),((e,t)=>{if(1===e.length){const a={segmentCategory:void 0,waypoints:[]};a.segmentCategory=o.WALKING_TO_END,a.type="Walk",a.waypoints=[t],e.push(a)}})(a,r),(t=>{t.forEach((o,a)=>{if(a>1&&0===e.head(o.waypoints).levelDifference){const n=e.last(t[a-1].waypoints);o.waypoints=e.prepend(n,o.waypoints)}})})(a),a},s=(t,s,i,l,p,g,y,c,C)=>{let m=r(t);m=n(m),s&&m[0].coordinates.unshift([s.lng,s.lat]),i&&e.last(m).coordinates.push([i.lng,i.lat]);return{segments:m.map((t,a)=>{const n=e.last(t.waypoints),r=t.coordinates,s=!(t.levelDifference&&t.waypoints.every(e.prop("isPortal"))),i={levelId:n.position.structureId,ordinalId:`ordinal: ${n.position.ordinal}`,coordinates:r,shouldDrawSegment:s},l=[];if(o.WALKING_TO_PORTAL===t.segmentCategory){const t=m[a+1];l.push({canonicalName:`wayfinding.${t.segmentCategory}`,coordinates:e.last(r)})}else o.START!==t.segmentCategory&&l.push({canonicalName:`wayfinding.${t.segmentCategory}`,coordinates:e.last(r)});return i.badges=l,i.segmentType=(e=>"Train"===e.type?"nav.train":"Bus"===e.type?"nav.transit":"Security Checkpoint"===e.type?"nav.secure":"nav.primary")(t),t.poiId&&(i.poiId=t.poiId),i}),steps:a(m,e.prop("title",s),e.prop("title",i),l,p,g,y,c,C)}};export{s as buildSegments};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a={START:"start",WALKING_TO_SECURITY_CHECKPOINT:"walking to security checkpoint",WALKING_TO_PORTAL:"walking to portal",WALKING_TO_END:"walking to end",ELEVATOR:"elevator",ELEVATOR_UP:"elevator.up",ELEVATOR_DOWN:"elevator.down",STAIRS:"stairs",STAIRS_UP:"stairs.up",STAIRS_DOWN:"stairs.down",ESCALATOR:"escalator",ESCALATOR_UP:"escalator.up",ESCALATOR_DOWN:"escalator.down",WALK:"walk",WALK_DOWN:"walk.down",WALK_UP:"walk.up",TRAIN:"train",TRAIN_UP:"train.up",TRAIN_DOWN:"train.down",BUS:"bus",BUS_UP:"bus.up",BUS_DOWN:"bus.down",SECURITY_CHECKPOINT:"enduring security checkpoint",RAMP:"ramp",RAMP_UP:"ramp.up",RAMP_DOWN:"ramp.down"};export{a as default};
|
|
1
|
+
const a={START:"start",WALKING_TO_SECURITY_CHECKPOINT:"walking to security checkpoint",WALKING_TO_PORTAL:"walking to portal",WALKING_TO_END:"walking to end",ELEVATOR:"elevator",ELEVATOR_UP:"elevator.up",ELEVATOR_DOWN:"elevator.down",STAIRS:"stairs",STAIRS_UP:"stairs.up",STAIRS_DOWN:"stairs.down",ACCESSIBLE_STAIRS:"accessiblestairs",ACCESSIBLE_STAIRS_UP:"accessiblestairs.up",ACCESSIBLE_STAIRS_DOWN:"accessiblestairs.down",ESCALATOR:"escalator",ESCALATOR_UP:"escalator.up",ESCALATOR_DOWN:"escalator.down",WALK:"walk",WALK_DOWN:"walk.down",WALK_UP:"walk.up",TRAIN:"train",TRAIN_UP:"train.up",TRAIN_DOWN:"train.down",BUS:"bus",BUS_UP:"bus.up",BUS_DOWN:"bus.down",SECURITY_CHECKPOINT:"enduring security checkpoint",RAMP:"ramp",RAMP_UP:"ramp.up",RAMP_DOWN:"ramp.down"};export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bearing as e}from"@turf/bearing";import{point as t}from"@turf/helpers";import{compose as r,not as n,includes as a,__ as s,toLower as
|
|
1
|
+
import{bearing as e}from"@turf/bearing";import{point as t}from"@turf/helpers";import{compose as r,not as n,includes as a,__ as s,toLower as i,prop as o,find as c,drop as u,last as _,propEq as T}from"ramda";import{findBoundsOfWaypoints as A}from"../../../src/utils/bounds.js";import{metersToYards as S}from"../../../src/utils/distance.js";import{bearingToDirection as d,distance as R}from"../../../src/utils/geodesy.js";import E from"./segmentBadges.js";import I from"./segmentCategories.js";function O(r,n="",a="",s,i,c={},u,_=[],T){return r.map((u,R)=>{const O=N("securityWaitTimes")(u.waypoints),L=O&&!O.isTemporarilyClosed?O.queueTime:Math.round(1===(C=u.waypoints).length?C[0].eta:C.map(o("eta")).slice(1).reduce((e,t)=>e+t,0));var C;const P=Math.round(function(e){return 1===e.length?e[0].distance:e.map(e=>e.distance).slice(1).reduce((e,t)=>e+t,0)}(u.waypoints)),W="yards"===T?S(P):P,U=function(e){switch(e){case I.START:return E.START;case I.WALKING_TO_END:return E.END;case I.ELEVATOR:return E.ELEVATOR;case I.ELEVATOR_UP:return E.ELEVATOR_UP;case I.ELEVATOR_DOWN:return E.ELEVATOR_DOWN;case I.STAIRS:return E.STAIRS;case I.STAIRS_UP:return E.STAIRS_UP;case I.STAIRS_DOWN:return E.STAIRS_DOWN;case I.ACCESSIBLE_STAIRS:return E.ACCESSIBLE_STAIRS;case I.ACCESSIBLE_STAIRS_UP:return E.ACCESSIBLE_STAIRS_UP;case I.ACCESSIBLE_STAIRS_DOWN:return E.ACCESSIBLE_STAIRS_DOWN;case I.ESCALATOR:return E.ESCALATOR;case I.ESCALATOR_UP:return E.ESCALATOR_UP;case I.ESCALATOR_DOWN:return E.ESCALATOR_DOWN;case I.WALKING_TO_PORTAL:case I.WALK:case I.WALK_DOWN:case I.WALK_UP:return E.WALK;case I.TRAIN:return E.TRAIN;case I.TRAIN_UP:return E.TRAIN_UP;case I.TRAIN_DOWN:return E.TRAIN_DOWN;case I.BUS:return E.BUS;case I.BUS_UP:return E.BUS_UP;case I.BUS_DOWN:return E.BUS_DOWN;case I.SECURITY_CHECKPOINT:return E.SECURITY_CHECKPOINT;case I.RAMP:return E.RAMP;case I.RAMP_UP:return E.RAMP_UP;case I.RAMP_DOWN:return E.RAMP_DOWN;default:return E.WALK}}(u.segmentCategory),D=function(e,t){let r;switch(e){case I.START:r=0;break;case I.WALKING_TO_END:r=t.length-1;break;case I.WALKING_TO_PORTAL:r=Math.min(t.length-1,Math.ceil(t.length/2));break;default:r=t.length-1}return t[r].position}(u.segmentCategory,u.waypoints),g=(({waypoints:r},n)=>{const[a]=r,s=r[r.length-1],i=t([a.position.lng,a.position.lat]),o=t([s.position.lng,s.position.lat]),c=e(i,o);return d(c,n)})(u,i),K=function(e,t,r,n,a,s,i,o){const c=e[t];switch(c.segmentCategory){case I.START:return y(c.waypoints[0].position,r);case I.WALKING_TO_END:return y(c.waypoints[c.waypoints.length-1].position,n);case I.WALKING_TO_SECURITY_CHECKPOINT:{const r=e[t+1].waypoints,n=m(o,r),a=s("wayfinder:Security Lane"),u=n?`${n} ${a}`:null,_=w(r,i);return u||_||s(`wayfinder:${c.type}`)}case I.WALKING_TO_PORTAL:return s(`wayfinder:${e[t+1].type}`);case I.SECURITY_CHECKPOINT:{const e=m(o,c.waypoints),t=s("wayfinder:Security Lane"),r=e?`${e} ${t}`:null,n=w(c.waypoints,i);return r||n||l(c,a)}case I.ELEVATOR:case I.ELEVATOR_DOWN:case I.ELEVATOR_UP:case I.ESCALATOR:case I.ESCALATOR_DOWN:case I.ESCALATOR_UP:case I.STAIRS:case I.STAIRS_DOWN:case I.STAIRS_UP:case I.ACCESSIBLE_STAIRS:case I.ACCESSIBLE_STAIRS_DOWN:case I.ACCESSIBLE_STAIRS_UP:return l(c,a);default:return s(`wayfinder:${c.type}`)}}(r,R,n,a,s,i,_,c),h={primaryText:K,secondaryText:p(u,L,i,!1),secondaryTextUI:p(u,L,i,!0,g,T,W),icon:U,animationAnchor:D,eta:L,distance:P,bounds:A(u.waypoints),isAccessible:f(u),securityWaitTimes:O};return u.poiId&&(h.poiId=u.poiId),h})}function y(e,t){return e.name?e.name:t}function l(e,t){return t[_(e.waypoints).position.floorId]}function p(e,t,r,n,a,s,i){const o=C(t,r),c="Proceed";switch(e.segmentCategory){case I.START:return r("wayfinder:Begin route at");case I.ELEVATOR:return r("wayfinder:Take elevator to");case I.ELEVATOR_UP:return r("wayfinder:Take elevator up to");case I.ELEVATOR_DOWN:return r("wayfinder:Take elevator down to");case I.STAIRS:return r("wayfinder:Take stairs to");case I.STAIRS_UP:return r("wayfinder:Take stairs up to");case I.STAIRS_DOWN:return r("wayfinder:Take stairs down to");case I.ACCESSIBLE_STAIRS:return r("wayfinder:Take accessible stairs to");case I.ACCESSIBLE_STAIRS_UP:return r("wayfinder:Take accessible stairs up to");case I.ACCESSIBLE_STAIRS_DOWN:return r("wayfinder:Take accessible stairs down to");case I.ESCALATOR:return r("wayfinder:Take escalator to");case I.ESCALATOR_UP:return r("wayfinder:Take escalator up to");case I.ESCALATOR_DOWN:return r("wayfinder:Take escalator down to");case I.WALK:case I.WALKING_TO_SECURITY_CHECKPOINT:case I.WALKING_TO_PORTAL:case I.WALKING_TO_END:return n?L(i,s,a,r):o(`${c} <1 minute to`,`${c} xx minute to`);case I.WALK_DOWN:return o(`${c} <1 minute down to`,`${c} xx minute down to`);case I.WALK_UP:return o(`${c} <1 minute up to`,`${c} xx minute up to`);case I.TRAIN:return o("Take train <1 minute","Take train xx minute");case I.BUS:return o("Take bus <1 minute","Take bus xx minute");case I.SECURITY_CHECKPOINT:return r("wayfinder:Through");case I.RAMP:return r("wayfinder:Take ramp to");case I.RAMP_UP:return r("wayfinder:Take ramp up to");case I.RAMP_DOWN:return r("wayfinder:Take ramp down to");default:return""}}const L=(e,t,r,n)=>e>1?n("meters"===t?"wayfinder:Proceed __direction__ __count__ meter to_plural":"wayfinder:Proceed __direction__ __count__ yard to_plural",{direction:r,count:e}):e<=1?n("meters"===t?"wayfinder:Proceed __direction__ __count__ meter to":"wayfinder:Proceed __direction__ __count__ yard to",{direction:r,count:e}):void 0,C=(e,t)=>(r,n)=>0===e?t("wayfinder:"+r):t("wayfinder:"+n,{count:e}),f=r(n,a(s,["escalator","stairs"]),i,o("type")),m=(e,t)=>{const r=N("securityLane")(t);if(!r)return;const n=o(r.type,e),a=c(T(r.id,"id"),n);return o("displayText",a)},N=e=>r(o(e),c(o(e)),u(1)),w=(e,t)=>{if(!e||0===e.length)return null;const r=e[0],{lat:n,lng:a,floorId:s}=r.position,i=t.filter(e=>e.position&&e.position.floorId===s);let o=null,c=1/0;return i.forEach(e=>{const t=R(n,a,e.position.latitude,e.position.longitude);t<c&&(c=t,o=e)}),o?o.name:null};export{O as default};
|
package/package.json
CHANGED