atriusmaps-node-sdk 3.2.30 → 3.3.31
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/README.md +2 -2
- package/dist/cjs/deploy/prepareSDKConfig.js +2 -2
- package/dist/cjs/package.json.js +7 -6
- package/dist/cjs/plugins/dynamicPois/src/dynamicPois.js +1 -1
- package/dist/cjs/plugins/poiDataManager/src/poiDataManager.js +1 -1
- package/dist/cjs/plugins/sdkServer/src/sdkHeadless.js +1 -1
- package/dist/cjs/plugins/sdkServer/src/sdkServer.js +1 -1
- package/dist/cjs/plugins/searchService/src/poiSearch.js +1 -1
- package/dist/cjs/plugins/searchService/src/utils.js +2 -2
- package/dist/cjs/plugins/venueDataLoader/src/venueDataLoader.js +2 -2
- package/dist/cjs/plugins/venueDataLoader/src/venueLoadingUtils.js +6 -5
- package/dist/cjs/plugins/wayfinder/src/navGraph.js +2 -1
- package/dist/cjs/plugins/wayfinder/src/wayfinder.js +1 -1
- package/dist/cjs/src/app.js +4 -4
- package/dist/cjs/src/configs/postproc-mol-url-parms.js +1 -1
- package/dist/cjs/src/configs/postproc-stateTracking.js +1 -1
- package/dist/cjs/src/env.js +2 -2
- package/dist/cjs/src/extModules/bustle.js +1 -1
- package/dist/cjs/src/extModules/flexapi/src/help.js +3 -3
- package/dist/cjs/src/utils/dom.js +2 -2
- package/dist/cjs/src/utils/i18n.js +1 -1
- package/lib/deploy/prepareSDKConfig.js +1 -1
- package/lib/package.json.js +1 -1
- package/lib/plugins/dynamicPois/src/dynamicPois.js +1 -1
- package/lib/plugins/poiDataManager/src/poiDataManager.js +1 -1
- package/lib/plugins/sdkServer/src/sdkHeadless.js +1 -1
- package/lib/plugins/sdkServer/src/sdkServer.js +1 -1
- package/lib/plugins/searchService/src/poiSearch.js +1 -1
- package/lib/plugins/searchService/src/utils.js +1 -1
- package/lib/plugins/venueDataLoader/src/venueDataLoader.js +1 -1
- package/lib/plugins/venueDataLoader/src/venueLoadingUtils.js +1 -1
- package/lib/plugins/wayfinder/src/navGraph.js +1 -1
- package/lib/plugins/wayfinder/src/wayfinder.js +1 -1
- package/lib/src/app.js +1 -1
- package/lib/src/configs/postproc-mol-url-parms.js +1 -1
- package/lib/src/configs/postproc-stateTracking.js +1 -1
- package/lib/src/env.js +1 -1
- package/lib/src/extModules/bustle.js +1 -1
- package/lib/src/extModules/flexapi/src/help.js +1 -1
- package/lib/src/utils/dom.js +1 -1
- package/lib/src/utils/i18n.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Then within your code, import the map initializer via:
|
|
|
14
14
|
|
|
15
15
|
or use `require`
|
|
16
16
|
|
|
17
|
-
`const Init = require("
|
|
17
|
+
`const Init = require("atriusmaps-node-sdk")`
|
|
18
18
|
|
|
19
19
|
## To Use
|
|
20
20
|
|
|
@@ -73,4 +73,4 @@ For example:
|
|
|
73
73
|
|
|
74
74
|
```bash
|
|
75
75
|
node main.js
|
|
76
|
-
```
|
|
76
|
+
```
|
|
@@ -4,6 +4,6 @@ var postprocMolUrlParms = require('../src/configs/postproc-mol-url-parms.js');
|
|
|
4
4
|
var postprocStateTracking = require('../src/configs/postproc-stateTracking.js');
|
|
5
5
|
var funcs = require('../src/utils/funcs.js');
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
function o(o){const{name:s,debug:r,headless:a,theme:l,defaultSearchTerms:c,venueId:p,accountId:d,poiCategories:u,preserveStateInURL:g,supportURLDeepLinks:h,initState:m,deepLinkParms:f,uiHide:v,renderDiv:S,parentConfig:k,desktopViewMinWidth:P,forceDesktop:V,hostAppId:w,hostAppVersion:A,hostAppProperties:b,logFilter:y,searchPlaceholder:L,dataFetch:D,engineName:I,dynamicPoisUrlBaseV1:j,plugins:Z,anaytics2ActiveFlag:F,enablePoiSelection:T,minZoom:x,maxZoom:C}=o,R=k?[k]:a?["sdkHeadless"]:["sdkVisual"],U=(e,i)=>e&&e.length>i?e.substring(0,i):e,W={name:s,engineName:I,extends:R,debug:r,logFilter:y,theme:l,uiHide:v,renderDiv:S,configPostProc:[],plugins:{venueDataLoader:{dataFetch:D,venueId:p,accountId:d},sdkServer:{headless:a},analytics2:{hostAppId:(e=>e?U(e.toString(),128):void 0)(w),hostAppVersion:(e=>e?U(e.toString(),128):void 0)(A),hostAppProperties:(e=>{if(!e||"object"!=typeof e)return;const i={},t=Object.keys(e);return t.length>10&&(t.length=10),t.forEach((t=>{let o=U(t.toString().replaceAll(/[^a-zA-Z0-9_]/g,""),128);o.match(/^[a-zA-Z]+/)||(o="X"+o);let n=e[t];null==n&&(n=""),n=U(n.toString(),128),i[o]=n;})),i})(b)}},uuid:"undefined"!=typeof document&&document&&document.location?document.location.host:"unknown"};void 0!==F&&(W.plugins.analytics2.active=F);const H=(e,i)=>void 0!==i?{[e]:i}:{};return a||(W.plugins["online/headerOnline"]={searchPlaceholder:L},W.plugins.mapRenderer={...H("enablePoiSelection",T),viewLimits:{...H("maxZoom",C),...H("minZoom",x)}}),W.plugins.searchService=c?{defaultSearchTerms:c}:{},n(o,"defaultSearchTerms",W.plugins.searchService),R.includes("sdkVisual")&&(W.plugins["online/homeView"]=u?{poiCategories:u}:{},n(o,"poiCategories",W.plugins["online/homeView"])),Z&&(Z.draw&&(W.plugins.draw=Z.draw),Z.flightStatus&&(W.plugins.flightStatus=Z.flightStatus,W.plugins["online/flightDetails"]={},W.plugins["online/flightDetailsSearch"]={})),g&&(W.configPostProc.push("stateTracking"),W.plugins.deepLinking={trackURL:!0}),h&&W.configPostProc.push("mol-url-parms"),m&&postprocStateTracking.setStateFromStateString(W,atob(m),!0),f&&postprocMolUrlParms.setDeepLinksForParms(W,f,!0),void 0!==P&&(W.desktopViewMinWidth=P),V&&(W.desktopViewMinWidth=0),j&&(W.plugins.dynamicPois={urlBaseV1:j}),funcs.filterOb(((e,i)=>void 0!==i),W)}function n(e,i,t){Object.keys(e).filter((e=>e.startsWith(i+"-"))).forEach((i=>t[i]=e[i]));}
|
|
8
8
|
|
|
9
|
-
module.exports =
|
|
9
|
+
module.exports = o;
|
package/dist/cjs/package.json.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var t=["demo","deploy","pagesSrc","src/extModules/flexapi"],r={demo:"cd demo/ && yarn start",e2eTest:"percy exec -- cypress run --browser chrome",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh",mod:"demo/startMod.sh",mol:"demo/startMol.sh",mos:"demo/startMos.sh",prepare:"husky install",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch"},n=["defaults"],i={"@aws-amplify/auth":"^4.1.2","@azure/event-hubs":"^5.6.0","@john-osullivan/react-window-dynamic-fork":"^1.9.0-alpha.1","@locus-labs/mod-badge":"^0.1.11","@locus-labs/mod-default-theme":"^0.0.27","@locus-labs/mod-footer":"^0.0.25","@locus-labs/mod-header":"^0.0.19","@locus-labs/mod-location-marker":"^0.0.18","@locus-labs/mod-map-legend":"^0.0.18","@locus-labs/mod-offscreen-indicator":"^0.0.18","@locus-labs/mod-pin":"^0.0.18","@locus-labs/mod-qr-code-card":"^0.0.18","@locus-labs/mod-qr-code-window":"^0.0.19","@locus-labs/mod-walk-time-matrix":"^0.0.17","@locus-labs/mol-desktop-building-level-selector":"^0.1.15","@locus-labs/mol-desktop-compass":"^0.1.29","@locus-labs/mol-desktop-default-theme":"^0.2.13","@locus-labs/mol-desktop-icon":"^0.1.45","@locus-labs/mol-desktop-logo":"^0.1.10","@locus-labs/mol-desktop-map-nav-button":"^0.1.39","@locus-labs/mol-desktop-submenu":"^0.1.30","@locus-labs/mol-desktop-tooltip":"^0.3.11","@locus-labs/mol-desktop-zoom-control":"^0.1.37","@locus-labs/mol-mobile-floating-action-button":"^0.0.20","@locus-labs/mol-mobile-toast":"^0.1.11","@mapbox/mapbox-gl-draw":"^1.3.0","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@turf/circle":"^6.5.0",IObject:"^0.6.2","crypto-browserify":"^3.12.0","file-loader":"^6.2.0",flexsearch:"^0.7.31","h3-js":"^4.1.0",i18next:"^20.3.4","i18next-browser-languagedetector":"^6.1.1",jsonschema:"^1.2.6",luxon:"^2.0.1","maplibre-gl":"~2.1.9","mini-css-extract-plugin":"^1.6.0",msal:"1.4.11","node-polyfill-webpack-plugin":"^1.1.4","path-browserify":"^1.0.1",polished:"^4.0.2","prop-types":"^15.7.2","query-string":"7.0.1",ramda:"^0.27.0",react:"^17.0.2","react-compound-slider":"^3.3.1","react-dom":"^17.0.2","react-json-editor-ajrm":"^2.5.13","react-qr-svg":"^2.2.1","react-svg":"^11.2.5","react-tageditor":"^0.2.3","react-virtualized-auto-sizer":"^1.0.2","smoothscroll-polyfill":"^0.4.4","styled-components":"5.1.0","styled-normalize":"^8.0.6","throttle-debounce":"^3.0.1",trackjs:"^3.7.4","ua-parser-js":"^0.7.23",uuid:"3.3.2",zousan:"^3.0.1","zousan-plus":"^4.0.1"},c={"@babel/core":"^7.14.8","@babel/plugin-proposal-class-properties":"^7.8.3","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-syntax-import-assertions":"^7.20.0","@babel/plugin-transform-modules-commonjs":"^7.8.3","@babel/plugin-transform-runtime":"^7.8.3","@babel/preset-env":"^7.14.8","@babel/preset-react":"^7.8.3","@percy/cli":"^1.0.0-beta.60","@percy/cypress":"^3.1.0","babel-eslint":"^10.0.1","babel-jest":"^27.0.6","babel-loader":"^8.2.2","babel-plugin-inline-json-import":"^0.3.2","babel-plugin-module-resolver":"^4.0.0","babel-polyfill":"^6.26.0","chai-colors":"^1.0.1","css-loader":"^5.2.4",cypress:"9.5.2","cypress-wait-until":"^1.7.1",eslint:"^7.4.0","eslint-config-standard":"^16.0.3","eslint-plugin-cypress":"^2.11.1","eslint-plugin-import":"^2.16.0","eslint-plugin-jest":"^24.3.6","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.1.0","eslint-plugin-react":"^7.12.4","eslint-plugin-standard":"^5.0.0","fetch-mock-jest":"^1.3.0",husky:"^6.0.0",jest:"^26.0.0","jest-transform-css":"^2.0.0","lint-staged":"^11.0.1","node-fetch":"^2.6.0","null-loader":"^4.0.1",webpack:"^5.45.1","webpack-merge":"^5.8.0"},p={name:"web-engine",version:"3.3.31",private:!0,license:"UNLICENSED",type:"module",main:"src/main.js",workspaces:t,scripts:r,"lint-staged":{"*.js":["eslint --fix"]},browserslist:n,dependencies:i,devDependencies:c,packageManager:"yarn@3.2.2"};
|
|
6
6
|
|
|
7
|
-
exports
|
|
8
|
-
exports
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
7
|
+
exports.browserslist = n;
|
|
8
|
+
exports["default"] = p;
|
|
9
|
+
exports.dependencies = i;
|
|
10
|
+
exports.devDependencies = c;
|
|
11
|
+
exports.scripts = r;
|
|
12
|
+
exports.workspaces = t;
|
|
@@ -28,6 +28,6 @@ function _interopNamespace(e) {
|
|
|
28
28
|
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
29
29
|
var a__default = /*#__PURE__*/_interopDefaultLegacy(a$1);
|
|
30
30
|
|
|
31
|
-
function a(a,
|
|
31
|
+
function a(a,s){let n=new a__default["default"];const i=new a__default["default"];function o(...e){r(...e),p(...e);}function r(t,s){const n=e__namespace.pipe(e__namespace.filter((e=>"parking"===e.category)),e__namespace.map((a=>{const s=a.dynamicAttributes;if(!s)throw Error(`No dynamicAttributes defined for parking POI ${a.poiId}`);return {...(t-a.timestamp)/1e3<s["parking.timeToLive"]?e__namespace.pick(["lotStatus","rateDay","rateHour","timeIsReal","timeToTerminal1","timeToTerminal2"],a):{lotStatus:s["parking.default"],rateDay:"$ -",rateHour:"$ -",timeIsReal:!1},lastUpdated:a.timestamp,lotName:a.lotName}})))(s);a.bus.send("poi/setDynamicData",{plugin:"parking",idValuesMap:n});}function u(t,s){const n=e__namespace.pipe(e__namespace.map((e=>[e.poiId,l(t,e)])),e__namespace.fromPairs)(s);a.bus.send("poi/setDynamicData",{plugin:"security",idValuesMap:n});}const l=(e,t)=>({queueTime:t.queueTime,isTemporarilyClosed:t.isTemporarilyClosed,timeIsReal:!t.isQueueTimeDefault&&t.expiration>e,lastUpdated:e});function p(t,s){const n=["dynamicData","openClosed"],i=e__namespace.filter(e__namespace.hasPath(n),s),o=e__namespace.map(e__namespace.path(n),i);if(!e__namespace.all(e__namespace.both(e__namespace.has("isOpen"),e__namespace.has("expiration")),e__namespace.values(o)))throw Error("Open Closed poi status is malformed.");{const s=e__namespace.pipe(e__namespace.prop("expiration"),e__namespace.lt(t)),n=e__namespace.filter(s,o);a.bus.send("poi/setDynamicData",{plugin:"open-closed-status",idValuesMap:n});}}return a.bus.on("venueData/venueDataLoaded",(({venueData:e})=>{n.v?n=a__default["default"].resolve(e):n.resolve(e);})),a.bus.on("sdk/readyWhenYouAre",(()=>i)),{init:async()=>{const e=s.urlBase||"https://rest.locuslabs.com/v3",t=s.urlBaseV1||s.urlBase||"https://rest.locuslabs.com/v1",r=a.config.plugins.venueDataLoader.accountId;async function l(){return n.then((e=>{let a=`${t}/venue/${e.id}/account/${r}/get-all-dynamic-pois/`;return (t.startsWith("./")||t.endsWith(".json"))&&(a=t),a}))}const p=async()=>n.then((t=>e.startsWith("./")||e.endsWith(".json")?e:`${e}/venueId/${t.id}/accountId/${r}/get-dynamic-queue-times/`)),c=async()=>{Promise.all([l().then(fetch).then((e=>e.json())).then((e=>o(Date.now(),e))),p().then(fetch).then((e=>e.json())).then((e=>u(Date.now(),e)))]).then((()=>i.resolve(!0))).catch((e=>{console.error(e),i.resolve(!0);}));},m=await a.bus.get("venueData/getQueueTypes");m.SecurityLane&&m.SecurityLane.length?n.then(c).then((()=>setInterval(c,3e4))):i.resolve(!0);},internal:{processSecurityWaitTimes:u,processParkingPOIS:r,processOpenClosedPois:p,processDynamicPois:o}}}
|
|
32
32
|
|
|
33
33
|
exports.create = a;
|
|
@@ -31,6 +31,6 @@ function _interopNamespace(e) {
|
|
|
31
31
|
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
32
32
|
var a__default = /*#__PURE__*/_interopDefaultLegacy(a);
|
|
33
33
|
|
|
34
|
-
async function n(a,n){const s=a.log.sublog("poiDataManager"),u=()=>{a.bus.send("venueData/loadPoiData");};let p=new a__default["default"];const d=(o,e)=>{const{position:t}=o,i=e.floorIdToStructure(t.floorId);if(!i)return s.error(`No structure found for floorId: ${t.floorId} for POI ${o.poiId}`),{...o};const a=e.floorIdToFloor(t.floorId),n={...t,structureName:i.name,buildingId:i.id,floorName:a.name,floorOrdinal:a.ordinal};return {...o,position:n}},c=(o,e)=>{o.roomInfo||(o.roomInfo=[]),o.roomInfo.push(e);},l=e__namespace.pipe(e__namespace.propOr([],"externalIds"),e__namespace.find(e__namespace.propEq("type","roomId")),e__namespace.prop("id"),e__namespace.unless(e__namespace.isNil,e__namespace.tail));a.bus.on("venueData/poiDataLoaded",(async({pois:e,structures:n})=>{if(e=((e,t)=>e__namespace.pipe(e__namespace.values,e__namespace.map((o=>{o.distance=null,o.isNavigable=void 0===o.isNavigable||!0===o.isNavigable,o.capacity&&c(o,{name:`Seats ${o.capacity.join("-")}`,svgId:"number-of-seats"}),o.category.startsWith("meeting")&&c(o,{name:a.gt()("poiView:Conference Room"),svgId:"conference-room"});const e=l(o);return e&&(o.roomId=e),[o.poiId,d(o,t)]})),e__namespace.fromPairs)(e))(e,buildStructureLookup.buildStructuresLookup(n)),configUtils.debugIsTrue(a,"pseudoTransPois"))for(const o in e)e[o]=r(e[o],a.i18n().language);e=function(o){const e=[];return Object.values(o).forEach((o=>{try{const t=o.position;t?["buildingId","structureName","floorId","floorName","floorOrdinal","latitude","longitude"].forEach((i=>{null!==t[i]&&void 0!==t[i]||e.push({id:o.poiId,e:`invalid position property: ${i}: ${t[i]}`});})):e.push({poi:o,e:"No position information"});}catch(t){s.error(t),e.push({id:o.poiId,e:t.message});}})),e.length&&(s.warn("badPois:",e),e.forEach((e=>{delete o[e.id];}))),o}(e),await async function(o){for(const e of Object.values(o))await y(e);return o}(e),p.resolve(e),a.config.debug&&a.env.isBrowser&&(window._pois=e),a.config.debug&&async function(o){const e=Date.now(),t=[],i=await a.bus.get("wayfinder/_getNavGraph");Object.values(o).forEach((o=>{try{const e=o.position;i.findClosestNode(e.floorId,e.latitude,e.longitude)||t.push({id:o.poiId,e:"No closest Navgraph Node"});}catch(e){s.error(e),t.push({id:o.poiId,e:e.message});}})),t.length&&s.warn("badPois:",t),s(`Total time for navgraph POI check: ${Date.now()-e}ms`);}(e);})),a.bus.on("poi/getById",(async({id:o})=>p.then((e=>e[o])))),a.bus.on("poi/getByFloorId",(async({floorId:e})=>p.then(e__namespace.pickBy(e__namespace.pathEq(["position","floorId"],e))))),a.bus.on("poi/getByCategoryId",(async({categoryId:e})=>p.then(e__namespace.pickBy((o=>o.category===e||o.category.startsWith(e+".")))))),a.bus.on("poi/getAll",(async()=>p));const f=["queue","primaryQueueId"],m=(e,t,i)=>{const a=e__namespace.path(["queue","queueType"],t);if(!a)return null;const n=e[a],r=e__namespace.path(f,t);return i.filter(e__namespace.pathEq(f,r)).filter((o=>o.poiId!==t.poiId)).map((e=>{const t=e__namespace.path(["queue","queueSubtype"],e),i=g(t)(n);return {poiId:e.poiId,...i}}))},g=e=>{return e__namespace.pipe(e__namespace.find(e__namespace.propEq("id",e)),(t=`No queue found with ID: ${e}`,o=>{if(null!=o)return o;throw Error(t)}),e__namespace.pick(["displayText","imageId"]));var t;};async function y(t){if(!t)return;const i="undefined"==typeof window?1:window.devicePixelRatio||1;return e__namespace.length(t.images)?t.images[0].startsWith("https:")||(t.images=await a__default["default"].all(t.images.map((o=>a.bus.get("venueData/getPoiImageUrl",{imageName:o,size:`${351*i}x${197*i}`}))))):t.images=[],t}a.bus.on("poi/addOtherSecurityLanes",(({poi:e})=>(async e=>{if(!e__namespace.path(f,e))return e;const t=await a.bus.get("venueData/getQueueTypes"),i=await a.bus.get("poi/getByCategoryId",{categoryId:"security"}),n=Object.values(i);return e.queue.otherQueues=m(t,e,n),e})(e)));const
|
|
34
|
+
async function n(a,n){const s=a.log.sublog("poiDataManager"),u=()=>{a.bus.send("venueData/loadPoiData");};let p=new a__default["default"];const d=(o,e)=>{const{position:t}=o,i=e.floorIdToStructure(t.floorId);if(!i)return s.error(`No structure found for floorId: ${t.floorId} for POI ${o.poiId}`),{...o};const a=e.floorIdToFloor(t.floorId),n={...t,structureName:i.name,buildingId:i.id,floorName:a.name,floorOrdinal:a.ordinal};return {...o,position:n}},c=(o,e)=>{o.roomInfo||(o.roomInfo=[]),o.roomInfo.push(e);},l=e__namespace.pipe(e__namespace.propOr([],"externalIds"),e__namespace.find(e__namespace.propEq("type","roomId")),e__namespace.prop("id"),e__namespace.unless(e__namespace.isNil,e__namespace.tail));a.bus.on("venueData/poiDataLoaded",(async({pois:e,structures:n})=>{if(e=((e,t)=>e__namespace.pipe(e__namespace.values,e__namespace.map((o=>{o.distance=null,o.isNavigable=void 0===o.isNavigable||!0===o.isNavigable,o.capacity&&c(o,{name:`Seats ${o.capacity.join("-")}`,svgId:"number-of-seats"}),o.category.startsWith("meeting")&&c(o,{name:a.gt()("poiView:Conference Room"),svgId:"conference-room"});const e=l(o);return e&&(o.roomId=e),[o.poiId,d(o,t)]})),e__namespace.fromPairs)(e))(e,buildStructureLookup.buildStructuresLookup(n)),configUtils.debugIsTrue(a,"pseudoTransPois"))for(const o in e)e[o]=r(e[o],a.i18n().language);e=function(o){const e=[];return Object.values(o).forEach((o=>{try{const t=o.position;t?["buildingId","structureName","floorId","floorName","floorOrdinal","latitude","longitude"].forEach((i=>{null!==t[i]&&void 0!==t[i]||e.push({id:o.poiId,e:`invalid position property: ${i}: ${t[i]}`});})):e.push({poi:o,e:"No position information"});}catch(t){s.error(t),e.push({id:o.poiId,e:t.message});}})),e.length&&(s.warn("badPois:",e),e.forEach((e=>{delete o[e.id];}))),o}(e),await async function(o){for(const e of Object.values(o))await y(e);return o}(e),p.resolve(e),a.config.debug&&a.env.isBrowser&&(window._pois=e),a.config.debug&&async function(o){const e=Date.now(),t=[],i=await a.bus.get("wayfinder/_getNavGraph");Object.values(o).forEach((o=>{try{const e=o.position;i.findClosestNode(e.floorId,e.latitude,e.longitude)||t.push({id:o.poiId,e:"No closest Navgraph Node"});}catch(e){s.error(e),t.push({id:o.poiId,e:e.message});}})),t.length&&s.warn("badPois:",t),s(`Total time for navgraph POI check: ${Date.now()-e}ms`);}(e);})),a.bus.on("poi/getById",(async({id:o})=>p.then((e=>e[o])))),a.bus.on("poi/getByFloorId",(async({floorId:e})=>p.then(e__namespace.pickBy(e__namespace.pathEq(["position","floorId"],e))))),a.bus.on("poi/getByCategoryId",(async({categoryId:e})=>p.then(e__namespace.pickBy((o=>o.category===e||o.category.startsWith(e+".")))))),a.bus.on("poi/getAll",(async()=>p));const f=["queue","primaryQueueId"],m=(e,t,i)=>{const a=e__namespace.path(["queue","queueType"],t);if(!a)return null;const n=e[a],r=e__namespace.path(f,t);return i.filter(e__namespace.pathEq(f,r)).filter((o=>o.poiId!==t.poiId)).map((e=>{const t=e__namespace.path(["queue","queueSubtype"],e),i=g(t)(n);return {poiId:e.poiId,...i}}))},g=e=>{return e__namespace.pipe(e__namespace.find(e__namespace.propEq("id",e)),(t=`No queue found with ID: ${e}`,o=>{if(null!=o)return o;throw Error(t)}),e__namespace.pick(["displayText","imageId"]));var t;};async function y(t){if(!t)return;const i="undefined"==typeof window?1:window.devicePixelRatio||1;return e__namespace.length(t.images)?t.images[0].startsWith("https:")||(t.images=await a__default["default"].all(t.images.map((o=>a.bus.get("venueData/getPoiImageUrl",{imageName:o,size:`${Math.round(351*i)}x${Math.round(197*i)}`}))))):t.images=[],t}a.bus.on("poi/addOtherSecurityLanes",(({poi:e})=>(async e=>{if(!e__namespace.path(f,e))return e;const t=await a.bus.get("venueData/getQueueTypes"),i=await a.bus.get("poi/getByCategoryId",{categoryId:"security"}),n=Object.values(i);return e.queue.otherQueues=m(t,e,n),e})(e)));const h=e__namespace.memoizeWith(e__namespace.identity,e__namespace.pipe(e__namespace.pluck("category"),e__namespace.values,e__namespace.uniq));a.bus.on("poi/getAllCategories",(async()=>p.then(h))),a.bus.on("venueData/loadNewVenue",(()=>{p=new a__default["default"],u();})),a.bus.on("poi/setDynamicData",(({plugin:e,idValuesMap:t})=>{p.then((i=>{for(const a in t){const n=i[a].dynamicData||{};n[e]={...t[a]};const r=e__namespace.mergeRight(i[a],{dynamicData:n});i[a]=r;}}));}));return {init:u,runTest:async o=>(await o(),p),internal:{addImages:y,pseudoTransPoi:r}}}function r(o,e){return ["description","nearbyLandmark","name","phone","operationHours"].forEach((t=>{o[t]&&(o[t]=i18n.toLang(o[t],e));})),o.keywords&&(o.keywords=o.keywords.map((o=>(o.name=i18n.toLang(o.name,e),o)))),o.position.floorName&&(o.position.floorName=i18n.toLang(o.position.floorName,e)),o.position.structureName&&(o.position.structureName=i18n.toLang(o.position.structureName,e)),o}
|
|
35
35
|
|
|
36
36
|
exports.create = n;
|
|
@@ -25,7 +25,7 @@ function _interopNamespace(e) {
|
|
|
25
25
|
|
|
26
26
|
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
27
27
|
|
|
28
|
-
const s=[{command:"destroy"},{command:"getDirections",args:[{name:"from",type:"location"},{name:"to",type:"location"},{name:"accessible",type:"boolean",optional:!0},{name:"queueTypes",type:"list",itemType:{type:"string"},optional:!0}]},{command:"getPOIDetails",args:[{name:"poiId",type:"integer",min:0}]},{command:"getAllPOIs"},{command:"getStructures"},{command:"getVenueData"},{command:"search",args:[{name:"term",type:"string",minLength:2},{name:"details",type:"boolean",optional:!0}]}];function a(s){s.bus.on("clientAPI/destroy",(async()=>s.destroy())),s.bus.on("clientAPI/getDirections",(async({from:n,to:a,accessible:o,queueTypes:i})=>{const r=await util.locationToEndpoint(s,n),c=await util.locationToEndpoint(s,a),u={requiresAccessibility:!!o};return i&&(u.selectedSecurityLanes={SecurityLane:i}),s.bus.get("wayfinder/getRoute",{fromEndpoint:r,toEndpoint:c,options:u}).then(e__namespace.pick(["distance","time","steps","navline"]))})),s.bus.on("clientAPI/getPOIDetails",(async({poiId:e})=>s.bus.get("poi/getById",{id:e}))),s.bus.on("clientAPI/getAllPOIs",(async()=>s.bus.get("poi/getAll"))),s.bus.on("clientAPI/getStructures",(()=>util.getStructures(s)));const a=e=>"function"!=typeof e;s.bus.on("clientAPI/getVenueData",(async()=>{const t=await s.bus.get("venueData/getVenueData");return e__namespace.filter(a,t)})),s.bus.on("clientAPI/search",(async({term:e,details:t})=>s.bus.get("search/queryAsync",{term:e}).then((n=>{const a=n.map((e=>e.poiId));return s.bus.send("event/search",{referrer:"prog",searchMethod:null,query:e,entities:a}),t?n:a}))));}
|
|
28
|
+
const s=[{command:"destroy"},{command:"getDirections",args:[{name:"from",type:"location"},{name:"to",type:"location"},{name:"accessible",type:"boolean",optional:!0},{name:"queueTypes",type:"list",itemType:{type:"string"},optional:!0}]},{command:"getPOIDetails",args:[{name:"poiId",type:"integer",min:0}]},{command:"getAllPOIs"},{command:"getStructures"},{command:"getVenueData"},{command:"search",args:[{name:"term",type:"string",minLength:2},{name:"details",type:"boolean",optional:!0}]}];function a(s){s.bus.on("clientAPI/destroy",(async()=>s.destroy())),s.bus.on("clientAPI/getDirections",(async({from:n,to:a,accessible:o,queueTypes:i})=>{const r=await util.locationToEndpoint(s,n),c=await util.locationToEndpoint(s,a),u={requiresAccessibility:!!o};return i&&(u.selectedSecurityLanes={SecurityLane:i}),s.bus.get("wayfinder/getRoute",{fromEndpoint:r,toEndpoint:c,options:u}).then(e__namespace.pick(["distance","time","steps","navline","waypoints"]))})),s.bus.on("clientAPI/getPOIDetails",(async({poiId:e})=>s.bus.get("poi/getById",{id:e}))),s.bus.on("clientAPI/getAllPOIs",(async()=>s.bus.get("poi/getAll"))),s.bus.on("clientAPI/getStructures",(()=>util.getStructures(s)));const a=e=>"function"!=typeof e;s.bus.on("clientAPI/getVenueData",(async()=>{const t=await s.bus.get("venueData/getVenueData");return e__namespace.filter(a,t)})),s.bus.on("clientAPI/search",(async({term:e,details:t})=>s.bus.get("search/queryAsync",{term:e}).then((n=>{const a=n.map((e=>e.poiId));return s.bus.send("event/search",{referrer:"prog",searchMethod:null,query:e,entities:a}),t?n:a}))));}
|
|
29
29
|
|
|
30
30
|
exports.handleHeadless = a;
|
|
31
31
|
exports.headlessCommands = s;
|
|
@@ -8,6 +8,6 @@ var sdkHeadless = require('./sdkHeadless.js');
|
|
|
8
8
|
|
|
9
9
|
function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, 'default': e }); }
|
|
10
10
|
|
|
11
|
-
let a=null;function s(e){const t=(e,t)=>{const o={payload:e,type:"LL-server"};t&&(o.clientMsgId=t);try{window.postMessage(o,"*");}catch(e){window.postMessage((e=>JSON.parse(JSON.stringify(e)))(o),"*");}};function o(o){const n=o.data;n&&"LL-client"===n.type&&e.bus.get("clientAPI/execute",n.payload).then((e=>t(e,n.msgId))).catch((t=>{e.config.debug&&console.error(t),((e,t)=>{const o={error:!0,payload:e,type:"LL-server"};t&&(o.clientMsgId=t),window.postMessage(o,"*");})(t.message,n.msgId);}));}return a&&a(),window.addEventListener("message",o),a=()=>window.removeEventListener("message",o),(e,t)=>{const o={event:e,payload:t,type:"LL-server"};window.postMessage(o,"*");}}async function r(a,r){const i=a.env.isBrowser?s(a):function(e){const o=observable();return e.eventListener=o,(e,t)=>o.fire(e,t)}(a);return function(t,o){t.bus.monitor("map/userMoveStart",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("userMoveStart",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a});})),t.bus.monitor("map/userMoving",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("userMoving",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a});})),t.bus.monitor("map/moveEnd",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("moveEnd",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a});})),t.bus.monitor("map/floorChanged",(({structure:e,floor:t})=>o("levelChange",{floorId:t?t.id:null,floorName:t?t.name:null,ord:t?t.ordinal:null,structureId:e?e.id:null,structureName:e?e.name:null}))),t.bus.monitor("map/poiClicked",(({poi:e})=>o("poiSelected",e))),t.bus.monitor("map/click",(async({lat:n,lng:a,ord:s})=>{const r=await t.bus.get("venueData/getStructures"),{building:i,floor:l}=geom.getBuildingAndFloorAtPoint(r,n,a,s,!0);o("mapClicked",{lat:n,lng:a,ord:s,building:i,floor:l});}));}(a,i),{init:async()=>{!function(e){e.bus.send("clientAPI/registerCustomType",{name:"latLngOrdLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"ord",type:"integer"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"latLngFloorLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"floorId",type:"string"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"poiIdLocation",spec:{type:"object",props:[{name:"poiId",type:"integer",min:0}]}}),e.bus.send("clientAPI/registerCustomType",{name:"location",spec:{type:"multi",types:[{type:"poiIdLocation"},{type:"latLngOrdLocation"},{type:"latLngFloorLocation"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"viewSettings",spec:{type:"object",props:[{name:"zoom",type:"float",optional:!0},{name:"pitch",type:"float",optional:!0},{name:"bearing",type:"float",optional:!0}]}});}(a),sdkHeadless.headlessCommands.forEach((e=>a.bus.send("clientAPI/registerCommand",e))),sdkHeadless.handleHeadless(a),r.headless||await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('../../../_virtual/_empty_module_placeholder.js')); }).then((e=>{e.visualCommands.forEach((e=>a.bus.send("clientAPI/registerCommand",e))),e.handleVisual(a,i);}));const e=async()=>{await a.bus.send("sdk/readyWhenYouAre"),a.bus.get("clientAPI/execute",{command:"getCommandJSON"}).then((e=>i("ready",{commandJSON:e}))),!r.headless&&a.config.uiHide&&a.config.uiHide.sidebar&&a.env.isDesktop()&&a.bus.send("map/changePadding",{padding:{left:55,right:55,top:72,bottom:22}});};r.headless?Promise.all([new Promise((e=>a.bus.monitor("venueData/navGraphLoaded",e))),new Promise((e=>a.bus.monitor("venueData/poiDataLoaded",e)))]).then(e):a.bus.on("map/mapReadyToShow",e);}}}
|
|
11
|
+
let a=null;function s(e){const t=(e,t)=>{const o={payload:e,type:"LL-server"};t&&(o.clientMsgId=t);try{window.postMessage(o,"*");}catch(e){window.postMessage((e=>JSON.parse(JSON.stringify(e)))(o),"*");}};function o(o){const n=o.data;n&&"LL-client"===n.type&&e.bus.get("clientAPI/execute",n.payload).then((e=>t(e,n.msgId))).catch((t=>{e.config.debug&&console.error(t),((e,t)=>{const o={error:!0,payload:e,type:"LL-server"};t&&(o.clientMsgId=t),window.postMessage(o,"*");})(t.message,n.msgId);}));}return a&&a(),window.addEventListener("message",o),a=()=>window.removeEventListener("message",o),(e,t)=>{const o={event:e,payload:t,type:"LL-server"};window.postMessage(o,"*");}}async function r(a,r){const i=a.env.isBrowser?s(a):function(e){const o=observable();return e.eventListener=o,(e,t)=>o.fire(e,t)}(a);return function(t,o){t.bus.monitor("map/userMoveStart",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("userMoveStart",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a});})),t.bus.monitor("map/userMoving",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("userMoving",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a});})),t.bus.monitor("map/moveEnd",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("moveEnd",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a});})),t.bus.monitor("map/floorChanged",(({structure:e,floor:t})=>o("levelChange",{floorId:t?t.id:null,floorName:t?t.name:null,ord:t?t.ordinal:null,structureId:e?e.id:null,structureName:e?e.name:null}))),t.bus.monitor("map/poiClicked",(({poi:e})=>o("poiSelected",e))),t.bus.monitor("poiDetails/showPoi",(({poi:e})=>o("poiShown",e))),t.bus.monitor("map/click",(async({lat:n,lng:a,ord:s})=>{const r=await t.bus.get("venueData/getStructures"),{building:i,floor:l}=geom.getBuildingAndFloorAtPoint(r,n,a,s,!0);o("mapClicked",{lat:n,lng:a,ord:s,building:i,floor:l});}));}(a,i),{init:async()=>{!function(e){e.bus.send("clientAPI/registerCustomType",{name:"latLngOrdLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"ord",type:"integer"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"latLngFloorLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"floorId",type:"string"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"poiIdLocation",spec:{type:"object",props:[{name:"poiId",type:"integer",min:0}]}}),e.bus.send("clientAPI/registerCustomType",{name:"location",spec:{type:"multi",types:[{type:"poiIdLocation"},{type:"latLngOrdLocation"},{type:"latLngFloorLocation"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"viewSettings",spec:{type:"object",props:[{name:"zoom",type:"float",optional:!0},{name:"pitch",type:"float",optional:!0},{name:"bearing",type:"float",optional:!0}]}});}(a),sdkHeadless.headlessCommands.forEach((e=>a.bus.send("clientAPI/registerCommand",e))),sdkHeadless.handleHeadless(a),r.headless||await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('../../../_virtual/_empty_module_placeholder.js')); }).then((e=>{e.visualCommands.forEach((e=>a.bus.send("clientAPI/registerCommand",e))),e.handleVisual(a,i);}));const e=async()=>{await a.bus.send("sdk/readyWhenYouAre"),a.bus.get("clientAPI/execute",{command:"getCommandJSON"}).then((e=>i("ready",{commandJSON:e}))),!r.headless&&a.config.uiHide&&a.config.uiHide.sidebar&&a.env.isDesktop()&&a.bus.send("map/changePadding",{padding:{left:55,right:55,top:72,bottom:22}});};r.headless?Promise.all([new Promise((e=>a.bus.monitor("venueData/navGraphLoaded",e))),new Promise((e=>a.bus.monitor("venueData/poiDataLoaded",e)))]).then(e):a.bus.on("map/mapReadyToShow",e),a.bus.on("sdkServer/sendEvent",(({eventName:e,...t})=>i(e,t)));}}}
|
|
12
12
|
|
|
13
13
|
exports.create = r;
|
|
@@ -23,6 +23,6 @@ function _interopNamespace(e) {
|
|
|
23
23
|
|
|
24
24
|
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
25
25
|
|
|
26
|
-
function t(t,e){const o=utils.getFlexSearchInstance({lang:e});function n(r){return Object.values(r).map((r=>{const{poiId:t,category:e="",name:o,keywords:n=[],roomId:c=""}=r,i=e__namespace.path(["dynamicData","grab","tags"],r)||[],p=n.filter(e__namespace.prop("isUserSearchable")).map(e__namespace.prop("name")),s=`${o} ${e.split(".").join(" ")} ${c} ${p.join(" ")} ${i.join(" ")}`;return [Number(t),s]}))}return
|
|
26
|
+
function t(t,e){const o=utils.getFlexSearchInstance({lang:e});function n(r){return Object.values(r).map((r=>{const{poiId:t,category:e="",name:o,keywords:n=[],roomId:c=""}=r,i=e__namespace.path(["dynamicData","grab","tags"],r)||[],p=n.filter(e__namespace.prop("isUserSearchable")).map(e__namespace.prop("name")),s=`${o} ${e.split(".").join(" ")} ${c} ${p.join(" ")} ${i.join(" ")}`;return [Number(t),s]}))}return n(t).forEach((([a,r])=>o.add(a,r))),{search:function(r){const e=o.search(r);return Object.values(e__namespace.pick(e,t))},updateMultiple:function(a){n(a).forEach((([a,r])=>o.update(a,r)));}}}
|
|
27
27
|
|
|
28
28
|
module.exports = t;
|
|
@@ -8,6 +8,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
8
8
|
|
|
9
9
|
var e__default = /*#__PURE__*/_interopDefaultLegacy(e);
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const n=["ko","ja","zh-Hans","zh-Hant"],r=({lang:r,type:t="standard"})=>{const s={tokenize:"forward",rtl:"ar"===r,stemmer:{s:"",es:"",ies:"y"}};return n.includes(r)&&(s.tokenize="full"),new e__default["default"].Index(s)};
|
|
12
12
|
|
|
13
|
-
exports.getFlexSearchInstance =
|
|
13
|
+
exports.getFlexSearchInstance = r;
|
|
@@ -31,6 +31,6 @@ function _interopNamespace(e) {
|
|
|
31
31
|
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
32
32
|
var a__default = /*#__PURE__*/_interopDefaultLegacy(a);
|
|
33
33
|
|
|
34
|
-
async function
|
|
34
|
+
async function l(l,d){const c=l.log.sublog("venueDataLoader");let p=new a__default["default"],g=new a__default["default"];const v=a=>a.defaultStructureId||e__namespace.path(["structureOrder",0],a)||e__namespace.path(["selectorOrder",0],a)||e__namespace.pipe(e__namespace.prop("structures"),Object.values,e__namespace.path([0,"id"]))(a);const f=e=>{const a=d.availableLanguages.find((a=>a.langCode===e));return a||{langCode:e,assetSuffix:""}};async function b(a){a.assetStage&&"prod"!==a.assetStage&&location.hostname;const s=a.auth?await async function(e){const a=await Auth(e,l);let s=null,u=0;for(;!s&&u<6;)s=await a.getToken(),u++,s||await funcs.delay(500)();return s?(l.bus.send("login/userLoggedIn",{token:s}),l.bus.on("app/logout",a.logout),s):l.bus.get("login/showLogin",{auth:a})}(a.auth):null,d=venueLoadingUtils.createFetchJson(s),g=venueLoadingUtils.createFetchText(s),b=await venueLoadingUtils.getVenueDataFromUrls(a,d),{accountId:m,venueId:h}=a;b.assetStage=a.assetStage,b.defaultOrdinal=b.defaultOrdinal||function(a){const t=v(a),n=Object.values(a.structures).find(e__namespace.propEq("id",t));return n.levels[n.defaultLevelId].ordinal}(b),b.structures=venueLoadingUtils.buildStructures(b);const y=l.i18n().language,D=f(y);return b.bareVenueId=h.slice(0,h.length-D.assetSuffix.length),b.getTranslatedContentPath=e=>`https://content.locuslabs.com/${b.category}/${e}/${h}/${m}`,b.fetchJson=d,b.fetchText=g,c.info("venueData ",b,D,y),l.config.debug&&l.env.isBrowser&&(window._venueData=b),b.queueTypes&&(b.securityQueueTypes=(()=>{const e=b.queueTypes.find((e=>"SecurityLane"===e.id));return e?e.subtypes.map((e=>e.id)):[]})()),l.bus.send("venueData/venueDataLoaded",{venueData:b}),p.resolve(b),p}function m(e){const a={id:"venueDataLoader"};e.id!==d.venueId&&(a.vid=e.id);const t=l.config.defaultLanguage||"en";return l.i18n().language!==t&&(a.lang=l.i18n().language),"prod"!==e.assetStage&&(a.stage=e.assetStage),l.bus.send("deepLinking/notifyState",a),e}l.bus.on("debugTools/fileDrop",(async({file:e,content:a})=>{if("application/json"===e.type){const e=JSON.parse(a);if(e.basemap&&e["basemap.venue"])return n=JSON.parse(a),void l.bus.send("map/replaceTheme",{theme:n});if(e.metadata&&e.metadata["mapbox:type"])return t=a,void l.bus.send("map/replaceStyle",{styleSrc:t})}var t,n;}));async function h(e){const a={...e},t=await l.bus.get("poi/getAll");return Object.values(a).forEach((e=>e.filter((e=>"poi"===e.properties.aiLayer&&"Point"===e.geometry.type)).forEach((e=>{const a=t[e.properties.id];a?a.mapLabel?e.properties.text=a.mapLabel:!1!==d.copyPOINamesToMap&&(e.properties.text=function(e){let a=e.name;return d.poiMapNameXForm?(Object.keys(d.poiMapNameXForm).filter((a=>((e,a)=>e===a||0===e.indexOf(a+"."))(e.category,a))).forEach((e=>{d.poiMapNameXForm[e].forEach((e=>a=a.replace(new RegExp(e.replace),e.with)));})),a):a}(a)):c.warn(`Unknown poi in style: ${e.properties.id}`);})))),a}const y=(a,t,n,s)=>{const u=a.replace(/-[^-]*$/,""),o=u===n?"landscape-background":`ordinal: ${s.find(e__namespace.hasPath(["levels",a])).levels[a].ordinal}`;return t.map((t=>{var s,r,i;return s="properties",r={venueId:n,structureId:u,ordinalId:o,levelId:a},i=t,t=e__namespace.over(e__namespace.lensProp(s),(a=>e__namespace.mergeRight(a||{},r)),i),t=e__namespace.assoc("id",t.properties.subid,t)}))};l.bus.on("venueData/loadMap",(async()=>{p.then((async t=>{const n=await t.fetchText(t.files.style),s=await t.fetchJson(t.files.theme),u=t.files.spritesheet,o=t.files.glyphs,{id:r,bounds:i,structures:c,venueCenter:p,venueRadius:v,defaultOrdinal:f}=t,b=t.venueList[r].mapTokens?{[r]:[]}:await async function(t){return e__namespace.pipe(e__namespace.prop("structures"),e__namespace.map(e__namespace.prop("levels")),e__namespace.chain(e__namespace.keys),e__namespace.prepend(t.id),e__namespace.map((e=>t.files.geoJson.replace("${geoJsonId}",e))),e__namespace.map(t.fetchJson),e__namespace.map(e__namespace.andThen((e=>[e.id,y(e.id,e.features,t.id,t.structures)]))),(e=>a__default["default"].all(e)),e__namespace.andThen(e__namespace.fromPairs))(t)}(t).then(h),m={mapFeatures:b,mapStyleSource:n,mapTheme:s,badgesSpriteUrl:u,mapGlyphsUrl:o,structures:c,defaultOrdinal:f,venueBounds:{n:i.ne.lat,s:i.sw.lat,e:i.ne.lng,w:i.sw.lng},venueId:r,venueCenter:p,venueRadius:v,accountId:d.accountId,secure:void 0!==d.auth,tileServerAuthInfo:t.tileServerAuthInfo};g.resolve(m),l.bus.send("venueData/mapDataLoaded",m);}));}));const D=e=>null==e.shouldDisplay||e.shouldDisplay;l.bus.on("venueData/loadBuildingSelectorData",(()=>p.then((async a=>{const t={buildings:a.structures.filter(D).map(e__namespace.evolve({levels:e__namespace.pipe(e__namespace.values,e__namespace.sortWith([e__namespace.descend(e__namespace.prop("ordinal"))]))})),structureOrder:a.structureOrder,selectorOrder:a.selectorOrder};return l.bus.send("venueData/buildingSelectorDataLoaded",t),t})))),l.bus.on("venueData/normalizeCoords",(({coords:e})=>p.then((a=>venueLoadingUtils.normalizeCoords(e,a.bounds)))));const I={edges:[],nodes:[]};l.bus.on("venueData/loadNavGraph",(async()=>p.then((async e=>{const a={navGraphData:e.files.nav?await e.fetchJson(e.files.nav):I,structures:e.structures};return l.bus.send("venueData/navGraphLoaded",a),a})))),l.bus.on("venueData/loadPoiData",(async()=>p.then((async e=>{const a=d.useOldDataModel?e.files.poisOld||e.files.pois:e.files.pois||e.files.poisOld;if(a){const t=await e.fetchJson(a);l.bus.send("venueData/poiDataLoaded",{pois:t,structures:e.structures});}})))),l.bus.on("venueData/getVenueCenter",(async()=>p.then((async e=>({lat:e.venueCenter[0],lng:e.venueCenter[1],ordinal:0}))))),l.bus.on("venueData/getContentUrl",(({type:e,name:a=""})=>p.then((t=>t.files[e]+a)))),l.bus.on("venueData/getFloorIdToNameMap",(()=>p.then(e__namespace.pipe(e__namespace.prop("structures"),e__namespace.map(e__namespace.prop("levels")),e__namespace.chain(e__namespace.values),e__namespace.map(e__namespace.props(["id","name"])),e__namespace.fromPairs)))),l.bus.on("venueData/getFloorIdName",(({floorId:a})=>p.then((async t=>{const n=e__namespace.pipe(e__namespace.values,e__namespace.find(e__namespace.hasPath(["levels",a])))(t.structures);return n?{structureId:n.id,structureName:n.name,floorName:n.levels[a].name}:null}))));const w=(a,t)=>()=>p.then(e__namespace.pipe(e__namespace.prop(a),e__namespace.defaultTo(t)));l.bus.on("venueData/getVenueData",(()=>p)),l.bus.on("venueData/getVenueName",w("name")),l.bus.on("venueData/getVenueCategory",w("category")),l.bus.on("venueData/getVenueTimezone",w("tz")),l.bus.on("venueData/getAccountId",(()=>d.accountId)),l.bus.on("venueData/getVenueId",w("id")),l.bus.on("venueData/getPositioningSupported",w("positioningSupported")),l.bus.on("venueData/getStructures",w("structures")),l.bus.on("venueData/loadNewVenue",(async({venueId:e,accountId:t,assetStage:n=d.assetStage})=>{p.reject(new Error("loadNewVenue called - previous loading ignored")),g.reject(new Error("loadNewVenue called - previous loading ignored")),p=new a__default["default"],g=new a__default["default"],b({...d,venueId:e,accountId:t,assetStage:n}).then(m);})),l.bus.on("venueData/changeVenueLanguage",(async({lang:e})=>p.then((async a=>{const t=f(e),n=`${a.bareVenueId}${t.assetSuffix}`;l.bus.send("venueData/loadNewVenue",{accountId:d.accountId,venueId:n});})))),l.bus.on("venueData/getPoiImageUrl",(({imageName:e,size:a})=>`https://img.locuslabs.com/resize/${d.accountId}/${a}cc/poi/${e}`)),l.bus.on("venueData/getDistributionId",(()=>p.then((e=>`${e.bareVenueId}-${d.accountId}`)))),l.bus.on("venueData/getCustomKeywords",(()=>p.then((e=>{const a=d.useOldDataModel&&e.files.searchOld||e.files.search;return e.fetchJson(a)})))),l.bus.on("venueData/isGrabEnabled",w("enableGrab")),l.bus.on("venueData/getGrabPoiIds",w("grabPoiIds",[])),l.bus.on("venueData/getAssetsTimestamp",w("version")),l.bus.on("venueData/getTranslatedFloorId",(async({floorId:e})=>p.then((a=>{const t=l.i18n().language,n=f(t);return `${a.bareVenueId}${n.assetSuffix}-${e.split("-").slice(1).join("-")}`})))),l.bus.on("venueData/getQueueTypes",(()=>p.then((e=>{const a=["tsapre","clear","globalEntry"];return e.queueTypes?e.queueTypes.reduce(((e,t)=>{const{id:n,subtypes:s}=t,u=s.map((e=>{const t=a.includes(e.id)&&`security-logo-${e.id.toLowerCase()}`;return {...e,imageId:t}}));return e[n]=u,e}),{}):{}}))));return {init:async()=>{const e=d.deepLinkProps||{},a=e.vid||d.venueId,t=d.useDynamicUrlParams&&e.stage?e.stage:d.assetStage,n=e.accountId||("alpha"===t?"A1VPTJKREFJWX5":d.accountId);b({...d,venueId:a,accountId:n,assetStage:t}).then(m);},runTest:async({testRoutine:e,reset:t=!1,venueData:n=null})=>{let s,u;return (t||n)&&(p=new a__default["default"],g=new a__default["default"]),n&&(p=a__default["default"].resolve(n)),await e(),p.v&&(s=await p),g.v&&(u=await g),{venueDataObj:s,mapDataObj:u}},internal:{getDefaultStructureId:v}}}
|
|
35
35
|
|
|
36
|
-
exports.create =
|
|
36
|
+
exports.create = l;
|
|
@@ -26,9 +26,10 @@ function _interopNamespace(e) {
|
|
|
26
26
|
|
|
27
27
|
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
28
28
|
|
|
29
|
-
const
|
|
29
|
+
const n=async(t,e)=>t?fetch(e,{headers:{Authorization:t}}):fetch(e),s=t=>e=>n(t,e).then((t=>t.json())),o=t=>e=>n(t,e).then((t=>t.text())),l=t=>`https://api.content.locuslabs.com/${t}`,r=(e,a,n,s,o)=>e__namespace.mapObjIndexed(((t,a)=>((t,e,a,n,s,o)=>"theme"===o||"style"===o?`${l(a)}/${e}/${o}/${s}/${n}/${o}.json`:t.replace(/https:\/\/content.locuslabs.com/gi,l(a)))(t,e,n,s,o,a)),a),i=async(t,e)=>{const n={alpha:"alpha-a.locuslabs.com",beta:"beta-a.locuslabs.com",gamma:"gamma-a.locuslabs.com",prod:"a.locuslabs.com"},{assetStage:s,venueId:o,accountId:l,formatVersion:i}=t,c=`https://${n[s]||n.prod}/accounts/${l}`,u=i||"v5",d=t.dataFetch&&configUtils.global[t.dataFetch]&&configUtils.global[t.dataFetch].getFiles?await configUtils.global[t.dataFetch].getFiles(t):await e(`${c}/${u}.json`);if(!d[o])throw Error(`Attempt to access venue ${o} which is not within venue list: ${Object.keys(d)}`);const g=d[o].files,h=(t.dataFetch&&configUtils.global[t.dataFetch]&&configUtils.global[t.dataFetch].getVenueData?await configUtils.global[t.dataFetch].getVenueData(t):await e(g.venueData))[o];h.tileServerAuthInfo&&function(t){const e={defaultOrdinal:0,defaultStructureId:"singleBuilding",formatVersion:"v5",structures:{singleBuilding:{name:"singleBuilding",boundsPolygon:[],defaultLevelId:"singleLevel",id:"singleBuilding",levels:{singleLevel:{boundsPolygon:[],clfloor:0,details:"",id:"singleLevel",name:"singleLevel",ordinal:0}}}},structureOrder:["singleBuilding"]};for(const a in e)t[a]=e[a];}(h),h.venueList=d;const m=(t=>{const e=t.deepLinkProps?t.deepLinkProps.contentStage:null;return "alpha"===e||"beta"===e||"prod"===e?e:null})(t);return h.files=m?r(h.category,g,m,l,o):g,h},c=t=>{const{structureOrder:a,structures:n}=t;return a.map((t=>{const a=n[t],s=bounds.findBoundsOfCoordinates(a.boundsPolygon);return {...a,bounds:s}}))};const u=([t,e,...a])=>[e,t,...a],d=(t,e)=>{return !t||!Array.isArray(t)||t.length<1?t:(a=t[0][0],n=e.ne.lng,s=e.sw.lng,(a>n?a<=s:t=>s)?t:t.map(u));var a,n,s;};
|
|
30
30
|
|
|
31
|
-
exports.buildStructures =
|
|
32
|
-
exports.createFetchJson =
|
|
33
|
-
exports.createFetchText =
|
|
34
|
-
exports.getVenueDataFromUrls =
|
|
31
|
+
exports.buildStructures = c;
|
|
32
|
+
exports.createFetchJson = s;
|
|
33
|
+
exports.createFetchText = o;
|
|
34
|
+
exports.getVenueDataFromUrls = i;
|
|
35
|
+
exports.normalizeCoords = d;
|
|
@@ -7,7 +7,8 @@ var geohasher = require('../../../src/extModules/geohasher.js');
|
|
|
7
7
|
var geodesy = require('../../../src/utils/geodesy.js');
|
|
8
8
|
var minPriorityQueue = require('./minPriorityQueue.js');
|
|
9
9
|
|
|
10
|
-
function d(r,
|
|
10
|
+
function d(r,s,l,u){const d={},c={};let a={};r.nodes.forEach((o=>{const n=s(o.floorId),e$1=l(o.floorId);!function(t){const o=t.floorId+":"+geohasher.encode(t.lat,t.lng).substr(0,7),n=t.floorId+":"+geohasher.encode(t.lat,t.lng).substr(0,8);c[o]||(c[o]=[]);c[o].push(t),c[n]||(c[n]=[]);c[n].push(t),d[t.id]=t;}({...e.pick(["id","lat","lng","floorId"],o),edges:[],ordinal:n,structureId:e$1});})),r.edges.forEach((t=>d[t.s].edges.push(function(t,n){const e$1=function(t){return t.x?"Security Checkpoint":""===t.t?"Ground":t.t}(t),r="escalator"!==e$1.toLowerCase()&&"stairs"!==e$1.toLowerCase(),i=f(t.s,t.d,n),s=t.l||i/60,l=t=>t.map((t=>({start:{lat:t.s[0],lng:t.s[1]},out:{lat:t.o[0],lng:t.o[1]},in:{lat:t.i[0],lng:t.i[1]},end:{lat:t.e[0],lng:t.e[1]}}))),u=t.p?l(t.p):null;return {distance:i,dst:t.d,o:t.o,isAccessible:r,isDriveway:!e.isNil(t.h)&&!t.h,src:t.s,transitTime:s,type:e$1,path:u,weight:s}}(t,d))));const h=t=>{if(void 0===t.floorId&&void 0===t.ordinal)throw Error("Endpoint specified in findRoute without floorId nor an ordinal");const o=t.lat||t.latitude,n=t.lng||t.longitude;return t.floorId?w(t.floorId,o,n,c,d):C(t.ordinal,o,n,d)};return {_nodes:d,_geoDb:c,findClosestNode:(t,o,n)=>w(t,o,n,c,d),findShortestPath:(t,o,n)=>function(t,o,n,e={}){return I(h(t),h(o),n,a,u,e)}(t,o,d,n),findAllShortestPaths:function(t,o,n){const e=h(t),r=o.map((t=>h(t)));return e&&r.length?function(t,o,n,e={},r={},i={}){return o.map((o=>{try{return I(t,o,n,e,r,i)}catch(t){return null}}))}(e,r,d,a,u,n):[]},floorIdToOrdinal:s,floorIdToStructureId:l,updateWithSecurityWaitTime:function(t){a=e.map(e.omit(["lastUpdated"]),t),y();},clearCache:y}}function f(t,o,n){const e=n[t],r=n[o];return geodesy.distance(e.lat,e.lng,r.lat,r.lng)}let c,a,h,p,g,m;const y=()=>{c={},a={},h={},p=new minPriorityQueue,g=null,m={};};function I(t,o,n,e$1={},i={},s={}){for(t.id===g&&m===JSON.stringify(s)||(y(),p.offerWithPriority(t.id,0),c[t.id]=0,h[t.id]=!0,g=t.id,m=JSON.stringify(s));!p.isEmpty()&&!h[o.id];){const t=n[p.poll()],o=c[t.id];for(let n=0;n<t.edges.length;n++){const l=t.edges[n];if(h[l.dst])continue;if(s.requiresAccessibility&&!l.isAccessible)continue;let u=l.weight;if(l.o&&e$1[l.o]){const t=e$1[l.o];t.queueTime&&(u=t.queueTime),t.isTemporarilyClosed&&(u=9999),l.securityWaitTimes=t;}if(l.o&&i[l.o]){l.securityLane=i[l.o];const{type:t,id:o}=i[l.o],n=e.path(["selectedSecurityLanes",t],s);if(n&&!n.includes(o))continue}void 0===c[l.dst]?(a[l.dst]=t,c[l.dst]=o+u,p.offerWithPriority(l.dst,o+u)):c[l.dst]>o+u&&(c[l.dst]=o+u,a[l.dst]=t,p.raisePriority(l.dst,o+u));}h[t.id]=!0;}if(!h[o.id])return null;const l=[];let u=o;for(;u;)l.push(u),u=a[u.id];return l.reverse()}function b(t,o,n,e){const r=o.substr(0,e),i=[];i.push(t+":"+geohasher.calculateAdjacent(geohasher.calculateAdjacent(r,"top"),"left")),i.push(t+":"+geohasher.calculateAdjacent(r,"top")),i.push(t+":"+geohasher.calculateAdjacent(geohasher.calculateAdjacent(r,"top"),"right")),i.push(t+":"+geohasher.calculateAdjacent(r,"left")),i.push(t+":"+r),i.push(t+":"+geohasher.calculateAdjacent(r,"right")),i.push(t+":"+geohasher.calculateAdjacent(geohasher.calculateAdjacent(r,"bottom"),"left")),i.push(t+":"+geohasher.calculateAdjacent(r,"bottom")),i.push(t+":"+geohasher.calculateAdjacent(geohasher.calculateAdjacent(r,"bottom"),"right"));const l=[];for(let t=0;t<i.length;t++){const o=n[i[t]];if(o)for(let t=0;t<o.length;t++)l.push(o[t]);}return l}function w(t,o,n,e,r){const s=function(t,o,n,e){let r=b(t,o,n,8);return r.length>0?r:(r=b(t,o,n,7),r.length>0?r:null)}(t,geohasher.encode(o,n),e)||function(t,o,n,e){const r=Object.values(e).filter((o=>o.floorId===t)).map((t=>[t,geodesy.distance(t.lat,t.lng,o,n)]));if(!r.length)throw Error(`findClosestNodeByFloor2 found no nodes on floor ${t}`);return S(r)}(t,o,n,r),u=[];for(let t=0;t<s.length;t++){const e=geodesy.distance(o,n,s[t].lat,s[t].lng);u.push([s[t],e]);}u.sort((function(t,o){return t[1]-o[1]}));const d=[];for(let t=0;t<u.length;t++)d.push(u[t][0]);return d[0]}function C(t,o,n,e){const r=Object.values(e).filter((o=>o.ordinal===t)).map((t=>[t,geodesy.distance(t.lat,t.lng,o,n)]));if(!r.length)throw Error(`findClosestNodeByOrdinal found no nodes on ordinal ${t}`);return S(r)}function S(t){let o=t[0];for(let n=1;n<t.length;n++)t[n][1]<o[1]&&(o=t[n]);return o[0]}
|
|
11
11
|
|
|
12
12
|
exports.createNavGraph = d;
|
|
13
|
+
exports.findClosestNodeByOrdinal = C;
|
|
13
14
|
exports.findShortestPath = I;
|
|
@@ -34,7 +34,7 @@ function _interopNamespace(e) {
|
|
|
34
34
|
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
35
35
|
var a__default = /*#__PURE__*/_interopDefaultLegacy(a);
|
|
36
36
|
|
|
37
|
-
const u={SECURITY:"SecurityLane",IMMIGRATION:"ImmigrationLane"};function d(d,p){const l=d.log.sublog("wayfinder"),c=async()=>{d.bus.send("venueData/loadNavGraph");};let f=new a__default["default"];d.bus.on("wayfinder/_getNavGraph",(()=>f)),d.bus.on("venueData/navGraphLoaded",(async({navGraphData:t,structures:n})=>{const e=buildStructureLookup.buildStructuresLookup(n),i=await y(),a=navGraph.createNavGraph(t,e.floorIdToOrdinal,e.floorIdToStructureId,i);f.resolve(a);}));const y=async()=>{const n=await d.bus.get("poi/getByCategoryId",{categoryId:"security"});return e__namespace.pipe(e__namespace.map(m),e__namespace.filter(e__namespace.identity))(n)},m=n=>n.queue&&{type:e__namespace.path(["queue","queueType"],n),id:e__namespace.path(["queue","queueSubtype"],n)};d.bus.on("wayfinder/showNavLineFromPhysicalLocation",(async({toEndpoint:t,selectedSecurityLanes:n=null,requiresAccessibility:o})=>async function(t,n,o){const e=await b({fromEndpoint:t,toEndpoint:n,options:o});if(e){const{segments:t}=e;o.primary&&d.bus.send("map/resetNavlineFeatures"),d.bus.send("map/showNavlineFeatures",{segments:t,alternative:!o.primary});}return e}(await d.bus.get("user/getPhysicalLocation"),t,{selectedSecurityLanes:n,requiresAccessibility:o,primary:!0})));const
|
|
37
|
+
const u={SECURITY:"SecurityLane",IMMIGRATION:"ImmigrationLane"};function d(d,p){const l=d.log.sublog("wayfinder"),c=async()=>{d.bus.send("venueData/loadNavGraph");};let f=new a__default["default"];d.bus.on("wayfinder/_getNavGraph",(()=>f)),d.bus.on("venueData/navGraphLoaded",(async({navGraphData:t,structures:n})=>{const e=buildStructureLookup.buildStructuresLookup(n),i=await y(),a=navGraph.createNavGraph(t,e.floorIdToOrdinal,e.floorIdToStructureId,i);f.resolve(a);}));const y=async()=>{const n=await d.bus.get("poi/getByCategoryId",{categoryId:"security"});return e__namespace.pipe(e__namespace.map(m),e__namespace.filter(e__namespace.identity))(n)},m=n=>n.queue&&{type:e__namespace.path(["queue","queueType"],n),id:e__namespace.path(["queue","queueSubtype"],n)};d.bus.on("wayfinder/showNavLineFromPhysicalLocation",(async({toEndpoint:t,selectedSecurityLanes:n=null,requiresAccessibility:o})=>async function(t,n,o){const e=await b({fromEndpoint:t,toEndpoint:n,options:o});if(e){const{segments:t}=e;o.primary&&d.bus.send("map/resetNavlineFeatures"),d.bus.send("map/showNavlineFeatures",{segments:t,alternative:!o.primary});}return e}(await d.bus.get("user/getPhysicalLocation"),t,{selectedSecurityLanes:n,requiresAccessibility:o,primary:!0})));const I=(t,n)=>d.bus.get("poi/getById",{id:t}).then((o=>{if(o&&o.position)return w(o,n);throw Error("Unknown POI ID "+t)}));const g=["lat","lng","floorId","ordinal"],h=e__namespace.pipe(e__namespace.pick(g),e__namespace.keys,e__namespace.propEq("length",g.length),Boolean),w=(t,n)=>({lat:t.position.latitude,lng:t.position.longitude,floorId:t.position.floorId,ordinal:n(t.position.floorId),title:t.name});async function b({fromEndpoint:t,toEndpoint:n,options:o={}}){return f.then((async e=>{o.compareFindPaths=p.compareFindPaths;const r=findRoute.findRoute(e,t,n,o);if(!r)return null;t.floorId&&n.floorId&&v(t,n,r);const a=await d.bus.get("venueData/getFloorIdToNameMap"),u=await d.bus.get("venueData/getQueueTypes"),c=d.gt(),{steps:f,segments:y}=segmentBuilder.buildSegments(r.waypoints,t,n,a,c,u);l.info("route",r);const m=Math.round(r.waypoints.reduce(((t,{eta:n})=>t+n),0)),I=Math.round(r.waypoints.reduce(((t,{distance:n})=>t+n),0));return {...r,segments:y,steps:f,time:m,distance:I}}))}d.bus.on("wayfinder/getNavigationEndpoint",(({ep:t})=>async function(t){return f.then((n=>{if(!t)throw Error("wayfinder: Invalid endpoint definition",t);if("number"==typeof t)return I(t,n.floorIdToOrdinal);if("string"==typeof t){if(t.match(/^\d+$/))return I(parseInt(t),n.floorIdToOrdinal);if(t.indexOf(",")>0){let[o,e,i,r]=t.split(",");if(!n.floorIdToStructureId(i))throw Error("Unknown floorId in endpoint: "+i);return r||(r="Starting Point"),{lat:parseFloat(o),lng:parseFloat(e),ordinal:n.floorIdToOrdinal(i),floorId:i,title:r}}}if(h(t))return t;if(t.latitude)return {lat:t.latitude,lng:t.longitude,floorId:t.floorId,ordinal:n.floorIdToOrdinal(t.floorId),title:t.title};if(t.position&&t.name)return w(t,n.floorIdToOrdinal);throw Error("Invalid start or end point: "+t)}))}(t))),d.bus.on("wayfinder/checkIfPathHasSecurity",(({fromEndpoint:n,toEndpoint:o,options:e={}})=>f.then((r=>{e.compareFindPaths=p.compareFindPaths;const a=findRoute.findRoute(r,n,o,e);if(!a)return {routeExists:!1};const s=n=>Boolean(a.waypoints.find(e__namespace.pathEq(["securityLane","type"],n)));return {routeExists:!0,queues:a.waypoints.filter((n=>e__namespace.pathEq(["securityLane","type"],u.SECURITY,n)||e__namespace.pathEq(["securityLane","type"],u.IMMIGRATION,n))),hasSecurity:s(u.SECURITY),hasImmigration:s(u.IMMIGRATION)}})))),d.bus.on("wayfinder/getRoute",b);const v=(t,n,o)=>d.bus.send("session/submitEvent",{type:"navigation",startPosition:{venueId:t.floorId.split("-")[0],buildingId:o.waypoints[0].position.structureId,floorId:o.waypoints[0].position.floorId,lat:o.waypoints[0].position.lat,lng:o.waypoints[0].position.lng},endPosition:{venueId:n.floorId.split("-")[0],buildingId:o.waypoints[o.waypoints.length-1].position.structureId,floorId:o.waypoints[o.waypoints.length-1].position.floorId,lat:o.waypoints[o.waypoints.length-1].position.lat,lng:o.waypoints[o.waypoints.length-1].position.lng}});function T(t){return S(t,"transitTime")}function E(t){return S(t,"distance")}function S(n,o){return e__namespace.aperture(2,n).map((([n,o])=>{return (e=o.id,n=>e__namespace.find((t=>t.dst===e),n.edges))(n);var e;})).map(e__namespace.prop(o)).reduce(((t,n)=>t+n),0)}function L(t,n){return t.distance=geodesy.distance(n.lat,n.lng,t.position.latitude,t.position.longitude),t}return d.bus.on("wayfinder/addPathTimeSingle",(async({poi:t,startLocation:n,options:o={}})=>n?f.then((e=>function(t,n,o,e){const i=w(o,t.floorIdToOrdinal),r=t.findShortestPath(e,i,n);if(!r)return (o=L(o,e)).transitTime=o.distance/60,o;return Object.assign(o,{transitTime:T(r),distance:E(r)})}(e,o,t,n))):t)),d.bus.on("wayfinder/addPathTimeMultiple",(async({pois:t,startLocation:n,options:o={}})=>n?f.then((e=>function(t,n,o,e){try{const i=o.map((n=>w(n,t.floorIdToOrdinal))),r=t.findAllShortestPaths(e,i,n);return o.map(((t,n)=>function(t,n,o){n&&n.length?t=Object.assign(t,{transitTime:T(n),distance:E(n)}):(t=L(t,o)).transitTime=t.distance/60;return t}(t,r[n],e)))}catch(t){return l.error(t),o}}(e,o,t,n))):t)),d.bus.on("venueData/loadNewVenue",(()=>{f=new a__default["default"],c();})),d.bus.on("poi/setDynamicData",(({plugin:t,idValuesMap:n})=>{"security"===t&&f.then((t=>t.updateWithSecurityWaitTime(n)));})),d.bus.on("wayfinder/getNavGraphFeatures",(()=>f.then((({_nodes:t})=>navGraphDebug.enrichDebugNavGraph(t))))),{init:c,internal:{resolveNavGraph:t=>f.resolve(t),prepareSecurityLanes:y}}}
|
|
38
38
|
|
|
39
39
|
exports.SecurityLaneType = u;
|
|
40
40
|
exports.create = d;
|
package/dist/cjs/src/app.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var e = require('IObject');
|
|
6
|
-
var
|
|
6
|
+
var n = require('query-string');
|
|
7
7
|
var e$1 = require('ramda');
|
|
8
8
|
var i = require('zousan-plus');
|
|
9
9
|
var package_json = require('../package.json.js');
|
|
@@ -36,9 +36,9 @@ function _interopNamespace(e) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
var e__default = /*#__PURE__*/_interopDefaultLegacy(e);
|
|
39
|
-
var
|
|
39
|
+
var n__default = /*#__PURE__*/_interopDefaultLegacy(n);
|
|
40
40
|
var i__default = /*#__PURE__*/_interopDefaultLegacy(i);
|
|
41
41
|
|
|
42
|
-
const
|
|
42
|
+
const c="undefined"!=typeof window;async function d(e,n,t){let o=n;if(o.includes("/")){const e=o.split("/");o=e[e.length-1];}if(void 0!==t.active){if(!1===t.active||"notLocalhost"===t.active&&e.env.isLocalhost())return e.log.info(`Plugin ${n} explicitly deativated`),null;e.log.info(`Plugin ${n} being instantiated!`,JSON.stringify(t));}else e.log.info(`Plugin ${n} being instantiated!`,JSON.stringify(t));return (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(`../plugins/${n}/src/${o}.js`).then((o=>(e.log.info(`Creating plugin ${n}`),o.create(e,t))))}async function p(e){return c?(function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(`./configs/${e}.json`):(function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(`./configs/${e}.json.js`)}async function m(e,n){let t={};const i=await Promise.all(n.map(p));for(const e of i){let n=e.default;n=n.extends?await m(n,n.extends):n,t=e$1.mergeDeepRight(t,n);}return t=e$1.mergeDeepRight(t,e),t}const f=e=>n=>(function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(`./configs/postproc-${e}.js`).then((e=>e.process(n)));async function y(o){const p=Object.create(null);let y=o.extends?await m(o,o.extends):o;y.plugins.monitoring&&Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('../_virtual/_empty_module_placeholder.js')); }).then((e=>e.activate(y))),y=await(async e=>e.configPostProc?i__default["default"].series(e,...e.configPostProc.map(f)):e)(y);const w=(e=>{const t=e.supportedLanguages||["ar","en","es","fr","ja","ko","zh-Hans","zh-Hant"];if("undefined"!=typeof window){let e=n__default["default"].parse(location.search).lang||navigator.language;for(;e;){if(e&&t.includes(e))return e;e=e.substring(0,e.lastIndexOf("-"));}}return e.defaultLanguage||"en"})(y),h=await i18n["default"](w,{debug:y.debug});p.i18n=()=>h,p.gt=()=>h.t.bind(h),p.config=y,p.plugins=new e__default["default"];const b=log.initLog("web-engine",{enabled:!!y.debug,isBrowser:c,color:"cyan",logFilter:y.logFilter,truncateObjects:!c});if(p.log=b.sublog(y.name),p.bus=bustle.create({trace:!1,showEvents:!0,reportAllErrors:!0,log:b}),p.info={wePkg:package_json["default"]},"undefined"!=typeof window&&(y.debug?(p.debug=e$1.map((e=>e.bind(p)),debugTools),debugTools.dndGo.call(p)):p.debug={},window._app=p,window.document&&window.document.title&&y.setWindowTitle&&(document.title=y.name)),p.env=env.buildEnv(p),y.theme?await i__default["default"].evaluate({name:"ThemeManagerModule",value:Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('../_virtual/_empty_module_placeholder.js')); })},{name:"HistoryManager",value:Promise.resolve().then(function () { return require('./historyManager.js'); })},{name:"LayerManager",value:Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('../_virtual/_empty_module_placeholder.js')); })}).then((async({LayerManager:e,HistoryManager:n,ThemeManagerModule:t})=>{const o=t.initThemeManager(p);p.themePack=await o.buildTheme(y.theme,y.defaultTheme),e.initLayerManager(p),n.initHistoryManager(p),p.destroy=()=>e.destroy(p);})):p.destroy=()=>{},y.plugins){for(const e in y.plugins)try{const n=y.plugins[e];if(p.plugins[e])throw Error(`Duplicate plugin name "${e}"`);const t=await d(p,e,n);t&&(p.plugins=p.plugins.set(e,t));}catch(n){b.error("Error instantiating plugin "+e),b.error(n);}for(const e in p.plugins)p.plugins[e].init();}return p}
|
|
43
43
|
|
|
44
|
-
exports.create =
|
|
44
|
+
exports.create = y;
|
|
@@ -4,6 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
require('query-string');
|
|
6
6
|
|
|
7
|
-
const e={navFrom:"online/getDirectionsFromTo",navTo:"online/getDirectionsFromTo",accessible:"online/getDirectionsFromTo",showNav:"online/getDirectionsFromTo",poiId:["online/getDirectionsFromTo","online/poiView"],vid:"venueDataLoader",stage:"venueDataLoader",contentStage:"venueDataLoader",search:"online/headerOnline",ho:["online/getDirectionsFromTo","analytics2"],home:"online/homeView",zoom:"mapRenderer",pitch:"mapRenderer",bearing:"mapRenderer",lat:"mapRenderer",lng:"mapRenderer",radius:"mapRenderer",buildingId:"mapRenderer",floorId:"mapRenderer",refInstallId:"analytics2"};function n(n,o,r){if(void 0!==o.lldebug)try{n.debug=JSON.parse(o.lldebug),null===n.debug&&(n.debug={});}catch(e){n.debug=!0;}return Object.keys(e).forEach((i=>{if(void 0!==o[i]){let a=e[i];Array.isArray(a)||(a=[a]),a.forEach((e=>{let a=n.plugins[e];!a&&r&&(a=n.plugins[e]={}),a.deepLinkProps={...a.deepLinkProps,[i]:o[i]};}));}})),o.poiId&&o.showNav&&delete n.plugins["online/poiView"].deepLinkProps.poiId,n}
|
|
7
|
+
const e={navFrom:"online/getDirectionsFromTo",navTo:"online/getDirectionsFromTo",accessible:"online/getDirectionsFromTo",showNav:"online/getDirectionsFromTo",poiId:["online/getDirectionsFromTo","online/poiView"],vid:"venueDataLoader",stage:"venueDataLoader",contentStage:"venueDataLoader",accountId:"venueDataLoader",search:"online/headerOnline",ho:["online/getDirectionsFromTo","analytics2"],home:"online/homeView",zoom:"mapRenderer",pitch:"mapRenderer",bearing:"mapRenderer",lat:"mapRenderer",lng:"mapRenderer",radius:"mapRenderer",buildingId:"mapRenderer",floorId:"mapRenderer",refInstallId:"analytics2"};function n(n,o,r){if(void 0!==o.lldebug)try{n.debug=JSON.parse(o.lldebug),null===n.debug&&(n.debug={});}catch(e){n.debug=!0;}return Object.keys(e).forEach((i=>{if(void 0!==o[i]){let a=e[i];Array.isArray(a)||(a=[a]),a.forEach((e=>{let a=n.plugins[e];!a&&r&&(a=n.plugins[e]={}),a.deepLinkProps={...a.deepLinkProps,[i]:o[i]};}));}})),o.poiId&&o.showNav&&delete n.plugins["online/poiView"].deepLinkProps.poiId,n}
|
|
8
8
|
|
|
9
9
|
exports.setDeepLinksForParms = n;
|
|
@@ -26,6 +26,6 @@ function _interopNamespace(e) {
|
|
|
26
26
|
|
|
27
27
|
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
28
28
|
|
|
29
|
-
function r(r,
|
|
29
|
+
function r(r,o,t){const n=JSON.parse(o);return Object.keys(n).forEach((o=>{const p=n[o];let s=r.plugins[o];if(!s&&t&&(s=r.plugins[o]={}),s){const r=s.deepLinkProps;s.deepLinkProps=r?e__namespace.mergeDeepRight(r,p):p;}})),r}
|
|
30
30
|
|
|
31
31
|
exports.setStateFromStateString = r;
|
package/dist/cjs/src/env.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
function i(i){const t=i.config.desktopViewMinWidth||0,o="undefined"!=typeof window,s={isBrowser:o,isMobile:()=>o&&innerWidth<t,isLocalhost:()=>location.host.startsWith("localhost")||location.host.startsWith("127.0.0.1"),isDesktop:()=>o&&!s.isMobile()};return o&&window.addEventListener("resize",(()=>i.bus.send("env/resize"))),s}
|
|
6
6
|
|
|
7
|
-
exports.buildEnv =
|
|
7
|
+
exports.buildEnv = i;
|
|
@@ -8,6 +8,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
8
8
|
|
|
9
9
|
var a__default = /*#__PURE__*/_interopDefaultLegacy(a);
|
|
10
10
|
|
|
11
|
-
const n=(o,n)=>o.splice(n,1)[0],t=(o,t)=>{let r=0;do{r=o.indexOf(t,r),r>=0&&n(o,r);}while(r>=0);return o};function r(n){const r=n.log?n.log.sublog?n.log.sublog("bustle",{color:"pink"}):n.log:console,e={},s={};function c(o,n){e[o]&&t(e[o],n);}function u(o,n){s[o]&&t(s[o],n);}function l(t,c){return n.trace&&(c||(c={}),c._stack=Error().stack),n.showEvents&&("function"==typeof n.showEvents?n.showEvents(t,c)&&r.info("send with",t," and ",c):r.info("send with",t," and ",c)),new a__default["default"]((u=>a__default["default"].soon(((t,c,u)=>()=>{const l=e[t],f=s[t],i=[];if(l)for(const t of l)try{i.push(t(c));}catch(t){n.reportAllErrors&&r.error(t),n.rejectOnError
|
|
11
|
+
const n=(o,n)=>o.splice(n,1)[0],t=(o,t)=>{let r=0;do{r=o.indexOf(t,r),r>=0&&n(o,r);}while(r>=0);return o};function r(n){const r=n.log?n.log.sublog?n.log.sublog("bustle",{color:"pink"}):n.log:console,e={},s={};function c(o,n){e[o]&&t(e[o],n);}function u(o,n){s[o]&&t(s[o],n);}function l(t,c){return n.trace&&(c||(c={}),c._stack=Error().stack),n.showEvents&&("function"==typeof n.showEvents?n.showEvents(t,c)&&r.info("send with",t," and ",c):r.info("send with",t," and ",c)),new a__default["default"]((u=>a__default["default"].soon(((t,c,u)=>()=>{const l=e[t],f=s[t],i=[];if(l)for(const t of l)try{i.push(t(c));}catch(t){n.reportAllErrors&&r.error(t),n.rejectOnError?i.push(a__default["default"].reject(t)):i.push(t);}const h=a__default["default"].all(i);if(f)for(const o of f)try{o(c,h);}catch(o){n.reportAllErrors&&r.error(o);}u(h);})(t,c,u))))}return {get:(n,t)=>l(n,t).then((t=>1!==t.length?a__default["default"].reject(`${n} event did not return a single result, but ${t.length} results.`):t[0])),moff:u,monitor:function(o,n){return s[o]||(s[o]=[]),s[o].push(n),()=>u(o,n)},off:c,on:function(o,n){return e[o]||(e[o]=[]),e[o].push(n),()=>c(o,n)},send:l}}
|
|
12
12
|
|
|
13
13
|
exports.create = r;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
function n(n,o){for(;o.length<n;)o+=" ";return o}const o=()=>n(18,"Command")+"Arguments\n"+n(18,"----------------")+"----------------\n",
|
|
5
|
+
function n(n,o){for(;o.length<n;)o+=" ";return o}const o=()=>n(18,"Command")+"Arguments\n"+n(18,"----------------")+"----------------\n",m=o=>n(18,o.command)+(o.args?o.args.map((n=>`${n.name} {${n.type}} ${n.optional?" (optional)":" (required)"}`)).join(", "):""),r=(n,o)=>n.command>o.command?1:-1,a=n=>n.sort(r).reduce(((n,o)=>`${n}${m(o)}\n`),o());
|
|
6
6
|
|
|
7
|
-
exports.getHelp =
|
|
7
|
+
exports.getHelp = m;
|
|
8
8
|
exports.getHelpHeader = o;
|
|
9
|
-
exports.getHelpList =
|
|
9
|
+
exports.getHelpList = a;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const t=(t,e)=>"string"==typeof t?(e||document).querySelector(t):t||null,e=(t,e)=>Array.prototype.slice.call((e||document).querySelectorAll(t));function n(t,e){const n=t||{};e=e
|
|
5
|
+
const t=(t,e)=>"string"==typeof t?(e||document).querySelector(t):t||null,e=(t,e)=>Array.prototype.slice.call((e||document).querySelectorAll(t));function n(t,e){const n=t||{};e=e?"string"==typeof e?document.querySelector(e):e:document.body;let l="div";n.tag&&(l=n.tag);const s=document.createElement(l);for(const t in n)null!=n[t]&&("klass"===t?s.setAttribute("class",n.klass):"tag"===t||("styles"===t?o(s,n.styles):"text"===t?s.textContent=n.text:"html"===t?s.innerHTML=n.html:s.setAttribute(t,n[t])));return e.appendChild(s),s}const o=(t,e)=>{for(const n in e)t.style[n]=e[n];};
|
|
6
6
|
|
|
7
7
|
exports.$ = t;
|
|
8
8
|
exports.$$ = e;
|
|
9
9
|
exports.ad = n;
|
|
10
|
-
exports.setStyles =
|
|
10
|
+
exports.setStyles = o;
|
|
@@ -8,7 +8,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
8
8
|
|
|
9
9
|
var n__default = /*#__PURE__*/_interopDefaultLegacy(n);
|
|
10
10
|
|
|
11
|
-
async function e(e,t){const
|
|
11
|
+
async function e(e,{debugMode:t,fallbackLng:a}){const o=n__default["default"].createInstance();return o.init({debug:t,interpolation:{escapeValue:!1},resources:{en:{translation:{"Walk xx minutes to":"Walk {{count}} minute to","Walk xx minutes to_plural":"Walk {{count}} minutes to"}}},fallbackLng:void 0===a?"en":a,lng:e,postProcess:["pseudoTrans"]}).then((()=>(t&&o.on("missingKey",(function(n,e,t,a){console.error("i18nNext: key not found. Language: "+o.language+", Key: "+t+", namespace: "+e+", lngs: ",n);})),o)))}const t={ar:"بال عن أمام الأخذ البرية. ثم كما وقام شاسعة الجنوبي, أمدها الإمداد عن انه. ٣٠ فكانت والكساد انه. أساسي الشمال الإتفاقية بال أم. زهاء المؤلّفة حين عل, سكان قررت هذه ان, شعار باستخدام ولم مع.\n\nدول الأمور الصفحة الأوروبية قد. تم حدى فاتّبع الهجوم, ما أوسع معاملة فعل, خلاف الأوروبية، إيو كل. تُصب واندونيسيا، حين قد. أي حاول حقول وهولندا، هذا, بين عن لهيمنة بالسيطرة.\n\nأعمال الإتحاد العمليات من وصل. وقوعها، باستخدام قد أخر, بل حتى علاقة التبرعات. فقد لم الأرض استبدال. حتى الخاسر اقتصادية بـ. أصقاع أعلنت اتفاقية تلك بل, كان إذ بحشد أخرى ليبين. الشتاء، اليابان، مكن أم, به، قد العالم، أوراقهم, بل لعدم لغزو أواخر مكن.\n",ja:"私は場合いよいよある所有らってのの末がしたた。無論結果に圧迫顔もよくその発展ないですまでを決するてみるでしでも発展云いませたから、そうには描いたないたた。機会へ載っない方は別に今をひょろひょろでずまし。むしろ嘉納さんを意味方面そう#「を積んない権力この自分何か記念をというおお尋ねだろででですで、ある今はこれか頼み例があるで、ネルソンさんののの引込のあなたにもっともお努力といと私赤に実建設が起っようにとやかくご附随を描いですましから、どうもとにかく相違に云おでてならますのが行っないませ。"},a=(n,e)=>"en"===e?n:o(n,t[e]),o=(n,e)=>n.length<e.length?e.substring(0,n.length):e;
|
|
12
12
|
|
|
13
13
|
exports["default"] = e;
|
|
14
14
|
exports.toLang = a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setDeepLinksForParms as e}from"../src/configs/postproc-mol-url-parms.js";import{setStateFromStateString as
|
|
1
|
+
import{setDeepLinksForParms as e}from"../src/configs/postproc-mol-url-parms.js";import{setStateFromStateString as i}from"../src/configs/postproc-stateTracking.js";import{filterOb as t}from"../src/utils/funcs.js";function o(o){const{name:s,debug:r,headless:a,theme:l,defaultSearchTerms:c,venueId:p,accountId:d,poiCategories:u,preserveStateInURL:g,supportURLDeepLinks:h,initState:m,deepLinkParms:f,uiHide:v,renderDiv:S,parentConfig:k,desktopViewMinWidth:P,forceDesktop:V,hostAppId:w,hostAppVersion:A,hostAppProperties:b,logFilter:y,searchPlaceholder:L,dataFetch:D,engineName:I,dynamicPoisUrlBaseV1:j,plugins:Z,anaytics2ActiveFlag:F,enablePoiSelection:T,minZoom:x,maxZoom:C}=o,R=k?[k]:a?["sdkHeadless"]:["sdkVisual"],U=(e,i)=>e&&e.length>i?e.substring(0,i):e,W={name:s,engineName:I,extends:R,debug:r,logFilter:y,theme:l,uiHide:v,renderDiv:S,configPostProc:[],plugins:{venueDataLoader:{dataFetch:D,venueId:p,accountId:d},sdkServer:{headless:a},analytics2:{hostAppId:(e=>e?U(e.toString(),128):void 0)(w),hostAppVersion:(e=>e?U(e.toString(),128):void 0)(A),hostAppProperties:(e=>{if(!e||"object"!=typeof e)return;const i={},t=Object.keys(e);return t.length>10&&(t.length=10),t.forEach((t=>{let o=U(t.toString().replaceAll(/[^a-zA-Z0-9_]/g,""),128);o.match(/^[a-zA-Z]+/)||(o="X"+o);let n=e[t];null==n&&(n=""),n=U(n.toString(),128),i[o]=n})),i})(b)}},uuid:"undefined"!=typeof document&&document&&document.location?document.location.host:"unknown"};void 0!==F&&(W.plugins.analytics2.active=F);const H=(e,i)=>void 0!==i?{[e]:i}:{};return a||(W.plugins["online/headerOnline"]={searchPlaceholder:L},W.plugins.mapRenderer={...H("enablePoiSelection",T),viewLimits:{...H("maxZoom",C),...H("minZoom",x)}}),W.plugins.searchService=c?{defaultSearchTerms:c}:{},n(o,"defaultSearchTerms",W.plugins.searchService),R.includes("sdkVisual")&&(W.plugins["online/homeView"]=u?{poiCategories:u}:{},n(o,"poiCategories",W.plugins["online/homeView"])),Z&&(Z.draw&&(W.plugins.draw=Z.draw),Z.flightStatus&&(W.plugins.flightStatus=Z.flightStatus,W.plugins["online/flightDetails"]={},W.plugins["online/flightDetailsSearch"]={})),g&&(W.configPostProc.push("stateTracking"),W.plugins.deepLinking={trackURL:!0}),h&&W.configPostProc.push("mol-url-parms"),m&&i(W,atob(m),!0),f&&e(W,f,!0),void 0!==P&&(W.desktopViewMinWidth=P),V&&(W.desktopViewMinWidth=0),j&&(W.plugins.dynamicPois={urlBaseV1:j}),t(((e,i)=>void 0!==i),W)}function n(e,i,t){Object.keys(e).filter((e=>e.startsWith(i+"-"))).forEach((i=>t[i]=e[i]))}export{o as default};
|
package/lib/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="web-engine",s="3.
|
|
1
|
+
var e="web-engine",s="3.3.31",o="UNLICENSED",l="module",a="src/main.js",t=["demo","deploy","pagesSrc","src/extModules/flexapi"],r={demo:"cd demo/ && yarn start",e2eTest:"percy exec -- cypress run --browser chrome",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh",mod:"demo/startMod.sh",mol:"demo/startMol.sh",mos:"demo/startMos.sh",prepare:"husky install",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch"},n=["defaults"],i={"@aws-amplify/auth":"^4.1.2","@azure/event-hubs":"^5.6.0","@john-osullivan/react-window-dynamic-fork":"^1.9.0-alpha.1","@locus-labs/mod-badge":"^0.1.11","@locus-labs/mod-default-theme":"^0.0.27","@locus-labs/mod-footer":"^0.0.25","@locus-labs/mod-header":"^0.0.19","@locus-labs/mod-location-marker":"^0.0.18","@locus-labs/mod-map-legend":"^0.0.18","@locus-labs/mod-offscreen-indicator":"^0.0.18","@locus-labs/mod-pin":"^0.0.18","@locus-labs/mod-qr-code-card":"^0.0.18","@locus-labs/mod-qr-code-window":"^0.0.19","@locus-labs/mod-walk-time-matrix":"^0.0.17","@locus-labs/mol-desktop-building-level-selector":"^0.1.15","@locus-labs/mol-desktop-compass":"^0.1.29","@locus-labs/mol-desktop-default-theme":"^0.2.13","@locus-labs/mol-desktop-icon":"^0.1.45","@locus-labs/mol-desktop-logo":"^0.1.10","@locus-labs/mol-desktop-map-nav-button":"^0.1.39","@locus-labs/mol-desktop-submenu":"^0.1.30","@locus-labs/mol-desktop-tooltip":"^0.3.11","@locus-labs/mol-desktop-zoom-control":"^0.1.37","@locus-labs/mol-mobile-floating-action-button":"^0.0.20","@locus-labs/mol-mobile-toast":"^0.1.11","@mapbox/mapbox-gl-draw":"^1.3.0","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@turf/circle":"^6.5.0",IObject:"^0.6.2","crypto-browserify":"^3.12.0","file-loader":"^6.2.0",flexsearch:"^0.7.31","h3-js":"^4.1.0",i18next:"^20.3.4","i18next-browser-languagedetector":"^6.1.1",jsonschema:"^1.2.6",luxon:"^2.0.1","maplibre-gl":"~2.1.9","mini-css-extract-plugin":"^1.6.0",msal:"1.4.11","node-polyfill-webpack-plugin":"^1.1.4","path-browserify":"^1.0.1",polished:"^4.0.2","prop-types":"^15.7.2","query-string":"7.0.1",ramda:"^0.27.0",react:"^17.0.2","react-compound-slider":"^3.3.1","react-dom":"^17.0.2","react-json-editor-ajrm":"^2.5.13","react-qr-svg":"^2.2.1","react-svg":"^11.2.5","react-tageditor":"^0.2.3","react-virtualized-auto-sizer":"^1.0.2","smoothscroll-polyfill":"^0.4.4","styled-components":"5.1.0","styled-normalize":"^8.0.6","throttle-debounce":"^3.0.1",trackjs:"^3.7.4","ua-parser-js":"^0.7.23",uuid:"3.3.2",zousan:"^3.0.1","zousan-plus":"^4.0.1"},c={"@babel/core":"^7.14.8","@babel/plugin-proposal-class-properties":"^7.8.3","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-syntax-import-assertions":"^7.20.0","@babel/plugin-transform-modules-commonjs":"^7.8.3","@babel/plugin-transform-runtime":"^7.8.3","@babel/preset-env":"^7.14.8","@babel/preset-react":"^7.8.3","@percy/cli":"^1.0.0-beta.60","@percy/cypress":"^3.1.0","babel-eslint":"^10.0.1","babel-jest":"^27.0.6","babel-loader":"^8.2.2","babel-plugin-inline-json-import":"^0.3.2","babel-plugin-module-resolver":"^4.0.0","babel-polyfill":"^6.26.0","chai-colors":"^1.0.1","css-loader":"^5.2.4",cypress:"9.5.2","cypress-wait-until":"^1.7.1",eslint:"^7.4.0","eslint-config-standard":"^16.0.3","eslint-plugin-cypress":"^2.11.1","eslint-plugin-import":"^2.16.0","eslint-plugin-jest":"^24.3.6","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.1.0","eslint-plugin-react":"^7.12.4","eslint-plugin-standard":"^5.0.0","fetch-mock-jest":"^1.3.0",husky:"^6.0.0",jest:"^26.0.0","jest-transform-css":"^2.0.0","lint-staged":"^11.0.1","node-fetch":"^2.6.0","null-loader":"^4.0.1",webpack:"^5.45.1","webpack-merge":"^5.8.0"},d="yarn@3.2.2",p={name:"web-engine",version:"3.3.31",private:!0,license:"UNLICENSED",type:"module",main:"src/main.js",workspaces:t,scripts:r,"lint-staged":{"*.js":["eslint --fix"]},browserslist:n,dependencies:i,devDependencies:c,packageManager:"yarn@3.2.2"};export{n as browserslist,p as default,i as dependencies,c as devDependencies,o as license,a as main,e as name,d as packageManager,r as scripts,l as type,s as version,t as workspaces};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"ramda";import t from"zousan";function a(a,
|
|
1
|
+
import*as e from"ramda";import t from"zousan";function a(a,s){let n=new t;const i=new t;function o(...e){r(...e),p(...e)}function r(t,s){const n=e.pipe(e.filter((e=>"parking"===e.category)),e.map((a=>{const s=a.dynamicAttributes;if(!s)throw Error(`No dynamicAttributes defined for parking POI ${a.poiId}`);return{...(t-a.timestamp)/1e3<s["parking.timeToLive"]?e.pick(["lotStatus","rateDay","rateHour","timeIsReal","timeToTerminal1","timeToTerminal2"],a):{lotStatus:s["parking.default"],rateDay:"$ -",rateHour:"$ -",timeIsReal:!1},lastUpdated:a.timestamp,lotName:a.lotName}})))(s);a.bus.send("poi/setDynamicData",{plugin:"parking",idValuesMap:n})}function u(t,s){const n=e.pipe(e.map((e=>[e.poiId,l(t,e)])),e.fromPairs)(s);a.bus.send("poi/setDynamicData",{plugin:"security",idValuesMap:n})}const l=(e,t)=>({queueTime:t.queueTime,isTemporarilyClosed:t.isTemporarilyClosed,timeIsReal:!t.isQueueTimeDefault&&t.expiration>e,lastUpdated:e});function p(t,s){const n=["dynamicData","openClosed"],i=e.filter(e.hasPath(n),s),o=e.map(e.path(n),i);if(!e.all(e.both(e.has("isOpen"),e.has("expiration")),e.values(o)))throw Error("Open Closed poi status is malformed.");{const s=e.pipe(e.prop("expiration"),e.lt(t)),n=e.filter(s,o);a.bus.send("poi/setDynamicData",{plugin:"open-closed-status",idValuesMap:n})}}return a.bus.on("venueData/venueDataLoaded",(({venueData:e})=>{n.v?n=t.resolve(e):n.resolve(e)})),a.bus.on("sdk/readyWhenYouAre",(()=>i)),{init:async()=>{const e=s.urlBase||"https://rest.locuslabs.com/v3",t=s.urlBaseV1||s.urlBase||"https://rest.locuslabs.com/v1",r=a.config.plugins.venueDataLoader.accountId;async function l(){return n.then((e=>{let a=`${t}/venue/${e.id}/account/${r}/get-all-dynamic-pois/`;return(t.startsWith("./")||t.endsWith(".json"))&&(a=t),a}))}const p=async()=>n.then((t=>e.startsWith("./")||e.endsWith(".json")?e:`${e}/venueId/${t.id}/accountId/${r}/get-dynamic-queue-times/`)),c=async()=>{Promise.all([l().then(fetch).then((e=>e.json())).then((e=>o(Date.now(),e))),p().then(fetch).then((e=>e.json())).then((e=>u(Date.now(),e)))]).then((()=>i.resolve(!0))).catch((e=>{console.error(e),i.resolve(!0)}))},m=await a.bus.get("venueData/getQueueTypes");m.SecurityLane&&m.SecurityLane.length?n.then(c).then((()=>setInterval(c,3e4))):i.resolve(!0)},internal:{processSecurityWaitTimes:u,processParkingPOIS:r,processOpenClosedPois:p,processDynamicPois:o}}}export{a as create};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as o from"ramda";import e from"zousan";import{buildStructuresLookup as t}from"../../../src/utils/buildStructureLookup.js";import{debugIsTrue as i}from"../../../src/utils/configUtils.js";import{toLang as a}from"../../../src/utils/i18n.js";async function n(a,n){const s=a.log.sublog("poiDataManager"),u=()=>{a.bus.send("venueData/loadPoiData")};let p=new e;const d=(o,e)=>{const{position:t}=o,i=e.floorIdToStructure(t.floorId);if(!i)return s.error(`No structure found for floorId: ${t.floorId} for POI ${o.poiId}`),{...o};const a=e.floorIdToFloor(t.floorId),n={...t,structureName:i.name,buildingId:i.id,floorName:a.name,floorOrdinal:a.ordinal};return{...o,position:n}},c=(o,e)=>{o.roomInfo||(o.roomInfo=[]),o.roomInfo.push(e)},l=o.pipe(o.propOr([],"externalIds"),o.find(o.propEq("type","roomId")),o.prop("id"),o.unless(o.isNil,o.tail));a.bus.on("venueData/poiDataLoaded",(async({pois:e,structures:n})=>{if(e=((e,t)=>o.pipe(o.values,o.map((o=>{o.distance=null,o.isNavigable=void 0===o.isNavigable||!0===o.isNavigable,o.capacity&&c(o,{name:`Seats ${o.capacity.join("-")}`,svgId:"number-of-seats"}),o.category.startsWith("meeting")&&c(o,{name:a.gt()("poiView:Conference Room"),svgId:"conference-room"});const e=l(o);return e&&(o.roomId=e),[o.poiId,d(o,t)]})),o.fromPairs)(e))(e,t(n)),i(a,"pseudoTransPois"))for(const o in e)e[o]=r(e[o],a.i18n().language);e=function(o){const e=[];return Object.values(o).forEach((o=>{try{const t=o.position;t?["buildingId","structureName","floorId","floorName","floorOrdinal","latitude","longitude"].forEach((i=>{null!==t[i]&&void 0!==t[i]||e.push({id:o.poiId,e:`invalid position property: ${i}: ${t[i]}`})})):e.push({poi:o,e:"No position information"})}catch(t){s.error(t),e.push({id:o.poiId,e:t.message})}})),e.length&&(s.warn("badPois:",e),e.forEach((e=>{delete o[e.id]}))),o}(e),await async function(o){for(const e of Object.values(o))await y(e);return o}(e),p.resolve(e),a.config.debug&&a.env.isBrowser&&(window._pois=e),a.config.debug&&async function(o){const e=Date.now(),t=[],i=await a.bus.get("wayfinder/_getNavGraph");Object.values(o).forEach((o=>{try{const e=o.position;i.findClosestNode(e.floorId,e.latitude,e.longitude)||t.push({id:o.poiId,e:"No closest Navgraph Node"})}catch(e){s.error(e),t.push({id:o.poiId,e:e.message})}})),t.length&&s.warn("badPois:",t),s(`Total time for navgraph POI check: ${Date.now()-e}ms`)}(e)})),a.bus.on("poi/getById",(async({id:o})=>p.then((e=>e[o])))),a.bus.on("poi/getByFloorId",(async({floorId:e})=>p.then(o.pickBy(o.pathEq(["position","floorId"],e))))),a.bus.on("poi/getByCategoryId",(async({categoryId:e})=>p.then(o.pickBy((o=>o.category===e||o.category.startsWith(e+".")))))),a.bus.on("poi/getAll",(async()=>p));const f=["queue","primaryQueueId"],m=(e,t,i)=>{const a=o.path(["queue","queueType"],t);if(!a)return null;const n=e[a],r=o.path(f,t);return i.filter(o.pathEq(f,r)).filter((o=>o.poiId!==t.poiId)).map((e=>{const t=o.path(["queue","queueSubtype"],e),i=g(t)(n);return{poiId:e.poiId,...i}}))},g=e=>{return o.pipe(o.find(o.propEq("id",e)),(t=`No queue found with ID: ${e}`,o=>{if(null!=o)return o;throw Error(t)}),o.pick(["displayText","imageId"]));var t};async function y(t){if(!t)return;const i="undefined"==typeof window?1:window.devicePixelRatio||1;return o.length(t.images)?t.images[0].startsWith("https:")||(t.images=await e.all(t.images.map((o=>a.bus.get("venueData/getPoiImageUrl",{imageName:o,size:`${351*i}x${197*i}`}))))):t.images=[],t}a.bus.on("poi/addOtherSecurityLanes",(({poi:e})=>(async e=>{if(!o.path(f,e))return e;const t=await a.bus.get("venueData/getQueueTypes"),i=await a.bus.get("poi/getByCategoryId",{categoryId:"security"}),n=Object.values(i);return e.queue.otherQueues=m(t,e,n),e})(e)));const
|
|
1
|
+
import*as o from"ramda";import e from"zousan";import{buildStructuresLookup as t}from"../../../src/utils/buildStructureLookup.js";import{debugIsTrue as i}from"../../../src/utils/configUtils.js";import{toLang as a}from"../../../src/utils/i18n.js";async function n(a,n){const s=a.log.sublog("poiDataManager"),u=()=>{a.bus.send("venueData/loadPoiData")};let p=new e;const d=(o,e)=>{const{position:t}=o,i=e.floorIdToStructure(t.floorId);if(!i)return s.error(`No structure found for floorId: ${t.floorId} for POI ${o.poiId}`),{...o};const a=e.floorIdToFloor(t.floorId),n={...t,structureName:i.name,buildingId:i.id,floorName:a.name,floorOrdinal:a.ordinal};return{...o,position:n}},c=(o,e)=>{o.roomInfo||(o.roomInfo=[]),o.roomInfo.push(e)},l=o.pipe(o.propOr([],"externalIds"),o.find(o.propEq("type","roomId")),o.prop("id"),o.unless(o.isNil,o.tail));a.bus.on("venueData/poiDataLoaded",(async({pois:e,structures:n})=>{if(e=((e,t)=>o.pipe(o.values,o.map((o=>{o.distance=null,o.isNavigable=void 0===o.isNavigable||!0===o.isNavigable,o.capacity&&c(o,{name:`Seats ${o.capacity.join("-")}`,svgId:"number-of-seats"}),o.category.startsWith("meeting")&&c(o,{name:a.gt()("poiView:Conference Room"),svgId:"conference-room"});const e=l(o);return e&&(o.roomId=e),[o.poiId,d(o,t)]})),o.fromPairs)(e))(e,t(n)),i(a,"pseudoTransPois"))for(const o in e)e[o]=r(e[o],a.i18n().language);e=function(o){const e=[];return Object.values(o).forEach((o=>{try{const t=o.position;t?["buildingId","structureName","floorId","floorName","floorOrdinal","latitude","longitude"].forEach((i=>{null!==t[i]&&void 0!==t[i]||e.push({id:o.poiId,e:`invalid position property: ${i}: ${t[i]}`})})):e.push({poi:o,e:"No position information"})}catch(t){s.error(t),e.push({id:o.poiId,e:t.message})}})),e.length&&(s.warn("badPois:",e),e.forEach((e=>{delete o[e.id]}))),o}(e),await async function(o){for(const e of Object.values(o))await y(e);return o}(e),p.resolve(e),a.config.debug&&a.env.isBrowser&&(window._pois=e),a.config.debug&&async function(o){const e=Date.now(),t=[],i=await a.bus.get("wayfinder/_getNavGraph");Object.values(o).forEach((o=>{try{const e=o.position;i.findClosestNode(e.floorId,e.latitude,e.longitude)||t.push({id:o.poiId,e:"No closest Navgraph Node"})}catch(e){s.error(e),t.push({id:o.poiId,e:e.message})}})),t.length&&s.warn("badPois:",t),s(`Total time for navgraph POI check: ${Date.now()-e}ms`)}(e)})),a.bus.on("poi/getById",(async({id:o})=>p.then((e=>e[o])))),a.bus.on("poi/getByFloorId",(async({floorId:e})=>p.then(o.pickBy(o.pathEq(["position","floorId"],e))))),a.bus.on("poi/getByCategoryId",(async({categoryId:e})=>p.then(o.pickBy((o=>o.category===e||o.category.startsWith(e+".")))))),a.bus.on("poi/getAll",(async()=>p));const f=["queue","primaryQueueId"],m=(e,t,i)=>{const a=o.path(["queue","queueType"],t);if(!a)return null;const n=e[a],r=o.path(f,t);return i.filter(o.pathEq(f,r)).filter((o=>o.poiId!==t.poiId)).map((e=>{const t=o.path(["queue","queueSubtype"],e),i=g(t)(n);return{poiId:e.poiId,...i}}))},g=e=>{return o.pipe(o.find(o.propEq("id",e)),(t=`No queue found with ID: ${e}`,o=>{if(null!=o)return o;throw Error(t)}),o.pick(["displayText","imageId"]));var t};async function y(t){if(!t)return;const i="undefined"==typeof window?1:window.devicePixelRatio||1;return o.length(t.images)?t.images[0].startsWith("https:")||(t.images=await e.all(t.images.map((o=>a.bus.get("venueData/getPoiImageUrl",{imageName:o,size:`${Math.round(351*i)}x${Math.round(197*i)}`}))))):t.images=[],t}a.bus.on("poi/addOtherSecurityLanes",(({poi:e})=>(async e=>{if(!o.path(f,e))return e;const t=await a.bus.get("venueData/getQueueTypes"),i=await a.bus.get("poi/getByCategoryId",{categoryId:"security"}),n=Object.values(i);return e.queue.otherQueues=m(t,e,n),e})(e)));const h=o.memoizeWith(o.identity,o.pipe(o.pluck("category"),o.values,o.uniq));a.bus.on("poi/getAllCategories",(async()=>p.then(h))),a.bus.on("venueData/loadNewVenue",(()=>{p=new e,u()})),a.bus.on("poi/setDynamicData",(({plugin:e,idValuesMap:t})=>{p.then((i=>{for(const a in t){const n=i[a].dynamicData||{};n[e]={...t[a]};const r=o.mergeRight(i[a],{dynamicData:n});i[a]=r}}))}));return{init:u,runTest:async o=>(await o(),p),internal:{addImages:y,pseudoTransPoi:r}}}function r(o,e){return["description","nearbyLandmark","name","phone","operationHours"].forEach((t=>{o[t]&&(o[t]=a(o[t],e))})),o.keywords&&(o.keywords=o.keywords.map((o=>(o.name=a(o.name,e),o)))),o.position.floorName&&(o.position.floorName=a(o.position.floorName,e)),o.position.structureName&&(o.position.structureName=a(o.position.structureName,e)),o}export{n as create};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"ramda";import{locationToEndpoint as t,getStructures as n}from"./util.js";const s=[{command:"destroy"},{command:"getDirections",args:[{name:"from",type:"location"},{name:"to",type:"location"},{name:"accessible",type:"boolean",optional:!0},{name:"queueTypes",type:"list",itemType:{type:"string"},optional:!0}]},{command:"getPOIDetails",args:[{name:"poiId",type:"integer",min:0}]},{command:"getAllPOIs"},{command:"getStructures"},{command:"getVenueData"},{command:"search",args:[{name:"term",type:"string",minLength:2},{name:"details",type:"boolean",optional:!0}]}];function a(s){s.bus.on("clientAPI/destroy",(async()=>s.destroy())),s.bus.on("clientAPI/getDirections",(async({from:n,to:a,accessible:o,queueTypes:i})=>{const r=await t(s,n),c=await t(s,a),u={requiresAccessibility:!!o};return i&&(u.selectedSecurityLanes={SecurityLane:i}),s.bus.get("wayfinder/getRoute",{fromEndpoint:r,toEndpoint:c,options:u}).then(e.pick(["distance","time","steps","navline"]))})),s.bus.on("clientAPI/getPOIDetails",(async({poiId:e})=>s.bus.get("poi/getById",{id:e}))),s.bus.on("clientAPI/getAllPOIs",(async()=>s.bus.get("poi/getAll"))),s.bus.on("clientAPI/getStructures",(()=>n(s)));const a=e=>"function"!=typeof e;s.bus.on("clientAPI/getVenueData",(async()=>{const t=await s.bus.get("venueData/getVenueData");return e.filter(a,t)})),s.bus.on("clientAPI/search",(async({term:e,details:t})=>s.bus.get("search/queryAsync",{term:e}).then((n=>{const a=n.map((e=>e.poiId));return s.bus.send("event/search",{referrer:"prog",searchMethod:null,query:e,entities:a}),t?n:a}))))}export{a as handleHeadless,s as headlessCommands};
|
|
1
|
+
import*as e from"ramda";import{locationToEndpoint as t,getStructures as n}from"./util.js";const s=[{command:"destroy"},{command:"getDirections",args:[{name:"from",type:"location"},{name:"to",type:"location"},{name:"accessible",type:"boolean",optional:!0},{name:"queueTypes",type:"list",itemType:{type:"string"},optional:!0}]},{command:"getPOIDetails",args:[{name:"poiId",type:"integer",min:0}]},{command:"getAllPOIs"},{command:"getStructures"},{command:"getVenueData"},{command:"search",args:[{name:"term",type:"string",minLength:2},{name:"details",type:"boolean",optional:!0}]}];function a(s){s.bus.on("clientAPI/destroy",(async()=>s.destroy())),s.bus.on("clientAPI/getDirections",(async({from:n,to:a,accessible:o,queueTypes:i})=>{const r=await t(s,n),c=await t(s,a),u={requiresAccessibility:!!o};return i&&(u.selectedSecurityLanes={SecurityLane:i}),s.bus.get("wayfinder/getRoute",{fromEndpoint:r,toEndpoint:c,options:u}).then(e.pick(["distance","time","steps","navline","waypoints"]))})),s.bus.on("clientAPI/getPOIDetails",(async({poiId:e})=>s.bus.get("poi/getById",{id:e}))),s.bus.on("clientAPI/getAllPOIs",(async()=>s.bus.get("poi/getAll"))),s.bus.on("clientAPI/getStructures",(()=>n(s)));const a=e=>"function"!=typeof e;s.bus.on("clientAPI/getVenueData",(async()=>{const t=await s.bus.get("venueData/getVenueData");return e.filter(a,t)})),s.bus.on("clientAPI/search",(async({term:e,details:t})=>s.bus.get("search/queryAsync",{term:e}).then((n=>{const a=n.map((e=>e.poiId));return s.bus.send("event/search",{referrer:"prog",searchMethod:null,query:e,entities:a}),t?n:a}))))}export{a as handleHeadless,s as headlessCommands};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getBuildingAndFloorAtPoint as e}from"../../../src/utils/geom.js";import t from"../../../src/utils/observable.js";import{headlessCommands as o,handleHeadless as n}from"./sdkHeadless.js";let a=null;function s(e){const t=(e,t)=>{const o={payload:e,type:"LL-server"};t&&(o.clientMsgId=t);try{window.postMessage(o,"*")}catch(e){window.postMessage((e=>JSON.parse(JSON.stringify(e)))(o),"*")}};function o(o){const n=o.data;n&&"LL-client"===n.type&&e.bus.get("clientAPI/execute",n.payload).then((e=>t(e,n.msgId))).catch((t=>{e.config.debug&&console.error(t),((e,t)=>{const o={error:!0,payload:e,type:"LL-server"};t&&(o.clientMsgId=t),window.postMessage(o,"*")})(t.message,n.msgId)}))}return a&&a(),window.addEventListener("message",o),a=()=>window.removeEventListener("message",o),(e,t)=>{const o={event:e,payload:t,type:"LL-server"};window.postMessage(o,"*")}}async function r(a,r){const i=a.env.isBrowser?s(a):function(e){const o=t();return e.eventListener=o,(e,t)=>o.fire(e,t)}(a);return function(t,o){t.bus.monitor("map/userMoveStart",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("userMoveStart",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a})})),t.bus.monitor("map/userMoving",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("userMoving",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a})})),t.bus.monitor("map/moveEnd",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("moveEnd",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a})})),t.bus.monitor("map/floorChanged",(({structure:e,floor:t})=>o("levelChange",{floorId:t?t.id:null,floorName:t?t.name:null,ord:t?t.ordinal:null,structureId:e?e.id:null,structureName:e?e.name:null}))),t.bus.monitor("map/poiClicked",(({poi:e})=>o("poiSelected",e))),t.bus.monitor("map/click",(async({lat:n,lng:a,ord:s})=>{const r=await t.bus.get("venueData/getStructures"),{building:i,floor:l}=e(r,n,a,s,!0);o("mapClicked",{lat:n,lng:a,ord:s,building:i,floor:l})}))}(a,i),{init:async()=>{!function(e){e.bus.send("clientAPI/registerCustomType",{name:"latLngOrdLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"ord",type:"integer"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"latLngFloorLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"floorId",type:"string"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"poiIdLocation",spec:{type:"object",props:[{name:"poiId",type:"integer",min:0}]}}),e.bus.send("clientAPI/registerCustomType",{name:"location",spec:{type:"multi",types:[{type:"poiIdLocation"},{type:"latLngOrdLocation"},{type:"latLngFloorLocation"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"viewSettings",spec:{type:"object",props:[{name:"zoom",type:"float",optional:!0},{name:"pitch",type:"float",optional:!0},{name:"bearing",type:"float",optional:!0}]}})}(a),o.forEach((e=>a.bus.send("clientAPI/registerCommand",e))),n(a),r.headless||await import("../../../_virtual/_empty_module_placeholder.js").then((e=>{e.visualCommands.forEach((e=>a.bus.send("clientAPI/registerCommand",e))),e.handleVisual(a,i)}));const e=async()=>{await a.bus.send("sdk/readyWhenYouAre"),a.bus.get("clientAPI/execute",{command:"getCommandJSON"}).then((e=>i("ready",{commandJSON:e}))),!r.headless&&a.config.uiHide&&a.config.uiHide.sidebar&&a.env.isDesktop()&&a.bus.send("map/changePadding",{padding:{left:55,right:55,top:72,bottom:22}})};r.headless?Promise.all([new Promise((e=>a.bus.monitor("venueData/navGraphLoaded",e))),new Promise((e=>a.bus.monitor("venueData/poiDataLoaded",e)))]).then(e):a.bus.on("map/mapReadyToShow",e)}}}export{r as create};
|
|
1
|
+
import{getBuildingAndFloorAtPoint as e}from"../../../src/utils/geom.js";import t from"../../../src/utils/observable.js";import{headlessCommands as o,handleHeadless as n}from"./sdkHeadless.js";let a=null;function s(e){const t=(e,t)=>{const o={payload:e,type:"LL-server"};t&&(o.clientMsgId=t);try{window.postMessage(o,"*")}catch(e){window.postMessage((e=>JSON.parse(JSON.stringify(e)))(o),"*")}};function o(o){const n=o.data;n&&"LL-client"===n.type&&e.bus.get("clientAPI/execute",n.payload).then((e=>t(e,n.msgId))).catch((t=>{e.config.debug&&console.error(t),((e,t)=>{const o={error:!0,payload:e,type:"LL-server"};t&&(o.clientMsgId=t),window.postMessage(o,"*")})(t.message,n.msgId)}))}return a&&a(),window.addEventListener("message",o),a=()=>window.removeEventListener("message",o),(e,t)=>{const o={event:e,payload:t,type:"LL-server"};window.postMessage(o,"*")}}async function r(a,r){const i=a.env.isBrowser?s(a):function(e){const o=t();return e.eventListener=o,(e,t)=>o.fire(e,t)}(a);return function(t,o){t.bus.monitor("map/userMoveStart",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("userMoveStart",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a})})),t.bus.monitor("map/userMoving",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("userMoving",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a})})),t.bus.monitor("map/moveEnd",(async({pitch:e,zoom:n,bearing:a})=>{const{lat:s,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");o("moveEnd",{lat:s,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:n,bearing:a})})),t.bus.monitor("map/floorChanged",(({structure:e,floor:t})=>o("levelChange",{floorId:t?t.id:null,floorName:t?t.name:null,ord:t?t.ordinal:null,structureId:e?e.id:null,structureName:e?e.name:null}))),t.bus.monitor("map/poiClicked",(({poi:e})=>o("poiSelected",e))),t.bus.monitor("poiDetails/showPoi",(({poi:e})=>o("poiShown",e))),t.bus.monitor("map/click",(async({lat:n,lng:a,ord:s})=>{const r=await t.bus.get("venueData/getStructures"),{building:i,floor:l}=e(r,n,a,s,!0);o("mapClicked",{lat:n,lng:a,ord:s,building:i,floor:l})}))}(a,i),{init:async()=>{!function(e){e.bus.send("clientAPI/registerCustomType",{name:"latLngOrdLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"ord",type:"integer"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"latLngFloorLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"floorId",type:"string"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"poiIdLocation",spec:{type:"object",props:[{name:"poiId",type:"integer",min:0}]}}),e.bus.send("clientAPI/registerCustomType",{name:"location",spec:{type:"multi",types:[{type:"poiIdLocation"},{type:"latLngOrdLocation"},{type:"latLngFloorLocation"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"viewSettings",spec:{type:"object",props:[{name:"zoom",type:"float",optional:!0},{name:"pitch",type:"float",optional:!0},{name:"bearing",type:"float",optional:!0}]}})}(a),o.forEach((e=>a.bus.send("clientAPI/registerCommand",e))),n(a),r.headless||await import("../../../_virtual/_empty_module_placeholder.js").then((e=>{e.visualCommands.forEach((e=>a.bus.send("clientAPI/registerCommand",e))),e.handleVisual(a,i)}));const e=async()=>{await a.bus.send("sdk/readyWhenYouAre"),a.bus.get("clientAPI/execute",{command:"getCommandJSON"}).then((e=>i("ready",{commandJSON:e}))),!r.headless&&a.config.uiHide&&a.config.uiHide.sidebar&&a.env.isDesktop()&&a.bus.send("map/changePadding",{padding:{left:55,right:55,top:72,bottom:22}})};r.headless?Promise.all([new Promise((e=>a.bus.monitor("venueData/navGraphLoaded",e))),new Promise((e=>a.bus.monitor("venueData/poiDataLoaded",e)))]).then(e):a.bus.on("map/mapReadyToShow",e),a.bus.on("sdkServer/sendEvent",(({eventName:e,...t})=>i(e,t)))}}}export{r as create};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as a from"ramda";import{getFlexSearchInstance as r}from"./utils.js";function t(t,e){const o=r({lang:e});function n(r){return Object.values(r).map((r=>{const{poiId:t,category:e="",name:o,keywords:n=[],roomId:c=""}=r,i=a.path(["dynamicData","grab","tags"],r)||[],p=n.filter(a.prop("isUserSearchable")).map(a.prop("name")),s=`${o} ${e.split(".").join(" ")} ${c} ${p.join(" ")} ${i.join(" ")}`;return[Number(t),s]}))}return
|
|
1
|
+
import*as a from"ramda";import{getFlexSearchInstance as r}from"./utils.js";function t(t,e){const o=r({lang:e});function n(r){return Object.values(r).map((r=>{const{poiId:t,category:e="",name:o,keywords:n=[],roomId:c=""}=r,i=a.path(["dynamicData","grab","tags"],r)||[],p=n.filter(a.prop("isUserSearchable")).map(a.prop("name")),s=`${o} ${e.split(".").join(" ")} ${c} ${p.join(" ")} ${i.join(" ")}`;return[Number(t),s]}))}return n(t).forEach((([a,r])=>o.add(a,r))),{search:function(r){const e=o.search(r);return Object.values(a.pick(e,t))},updateMultiple:function(a){n(a).forEach((([a,r])=>o.update(a,r)))}}}export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"flexsearch";const
|
|
1
|
+
import e from"flexsearch";const n=["ko","ja","zh-Hans","zh-Hant"],r=({lang:r,type:t="standard"})=>{const s={tokenize:"forward",rtl:"ar"===r,stemmer:{s:"",es:"",ies:"y"}};return n.includes(r)&&(s.tokenize="full"),new e.Index(s)};export{r as getFlexSearchInstance};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"ramda";import a from"zousan";import t from"../../../src/auth/Auth.js";import{delay as n}from"../../../src/utils/funcs.js";import{
|
|
1
|
+
import*as e from"ramda";import a from"zousan";import t from"../../../src/auth/Auth.js";import{delay as n}from"../../../src/utils/funcs.js";import{normalizeCoords as s,getVenueDataFromUrls as u,buildStructures as o,createFetchJson as r,createFetchText as i}from"./venueLoadingUtils.js";async function l(l,d){const c=l.log.sublog("venueDataLoader");let p=new a,g=new a;const v=a=>a.defaultStructureId||e.path(["structureOrder",0],a)||e.path(["selectorOrder",0],a)||e.pipe(e.prop("structures"),Object.values,e.path([0,"id"]))(a);const f=e=>{const a=d.availableLanguages.find((a=>a.langCode===e));return a||{langCode:e,assetSuffix:""}};async function b(a){a.assetStage&&"prod"!==a.assetStage&&location.hostname;const s=a.auth?await async function(e){const a=await t(e,l);let s=null,u=0;for(;!s&&u<6;)s=await a.getToken(),u++,s||await n(500)();return s?(l.bus.send("login/userLoggedIn",{token:s}),l.bus.on("app/logout",a.logout),s):l.bus.get("login/showLogin",{auth:a})}(a.auth):null,d=r(s),g=i(s),b=await u(a,d),{accountId:m,venueId:h}=a;b.assetStage=a.assetStage,b.defaultOrdinal=b.defaultOrdinal||function(a){const t=v(a),n=Object.values(a.structures).find(e.propEq("id",t));return n.levels[n.defaultLevelId].ordinal}(b),b.structures=o(b);const y=l.i18n().language,D=f(y);return b.bareVenueId=h.slice(0,h.length-D.assetSuffix.length),b.getTranslatedContentPath=e=>`https://content.locuslabs.com/${b.category}/${e}/${h}/${m}`,b.fetchJson=d,b.fetchText=g,c.info("venueData ",b,D,y),l.config.debug&&l.env.isBrowser&&(window._venueData=b),b.queueTypes&&(b.securityQueueTypes=(()=>{const e=b.queueTypes.find((e=>"SecurityLane"===e.id));return e?e.subtypes.map((e=>e.id)):[]})()),l.bus.send("venueData/venueDataLoaded",{venueData:b}),p.resolve(b),p}function m(e){const a={id:"venueDataLoader"};e.id!==d.venueId&&(a.vid=e.id);const t=l.config.defaultLanguage||"en";return l.i18n().language!==t&&(a.lang=l.i18n().language),"prod"!==e.assetStage&&(a.stage=e.assetStage),l.bus.send("deepLinking/notifyState",a),e}l.bus.on("debugTools/fileDrop",(async({file:e,content:a})=>{if("application/json"===e.type){const e=JSON.parse(a);if(e.basemap&&e["basemap.venue"])return n=JSON.parse(a),void l.bus.send("map/replaceTheme",{theme:n});if(e.metadata&&e.metadata["mapbox:type"])return t=a,void l.bus.send("map/replaceStyle",{styleSrc:t})}var t,n}));async function h(e){const a={...e},t=await l.bus.get("poi/getAll");return Object.values(a).forEach((e=>e.filter((e=>"poi"===e.properties.aiLayer&&"Point"===e.geometry.type)).forEach((e=>{const a=t[e.properties.id];a?a.mapLabel?e.properties.text=a.mapLabel:!1!==d.copyPOINamesToMap&&(e.properties.text=function(e){let a=e.name;return d.poiMapNameXForm?(Object.keys(d.poiMapNameXForm).filter((a=>((e,a)=>e===a||0===e.indexOf(a+"."))(e.category,a))).forEach((e=>{d.poiMapNameXForm[e].forEach((e=>a=a.replace(new RegExp(e.replace),e.with)))})),a):a}(a)):c.warn(`Unknown poi in style: ${e.properties.id}`)})))),a}const y=(a,t,n,s)=>{const u=a.replace(/-[^-]*$/,""),o=u===n?"landscape-background":`ordinal: ${s.find(e.hasPath(["levels",a])).levels[a].ordinal}`;return t.map((t=>{var s,r,i;return s="properties",r={venueId:n,structureId:u,ordinalId:o,levelId:a},i=t,t=e.over(e.lensProp(s),(a=>e.mergeRight(a||{},r)),i),t=e.assoc("id",t.properties.subid,t)}))};l.bus.on("venueData/loadMap",(async()=>{p.then((async t=>{const n=await t.fetchText(t.files.style),s=await t.fetchJson(t.files.theme),u=t.files.spritesheet,o=t.files.glyphs,{id:r,bounds:i,structures:c,venueCenter:p,venueRadius:v,defaultOrdinal:f}=t,b=t.venueList[r].mapTokens?{[r]:[]}:await async function(t){return e.pipe(e.prop("structures"),e.map(e.prop("levels")),e.chain(e.keys),e.prepend(t.id),e.map((e=>t.files.geoJson.replace("${geoJsonId}",e))),e.map(t.fetchJson),e.map(e.andThen((e=>[e.id,y(e.id,e.features,t.id,t.structures)]))),(e=>a.all(e)),e.andThen(e.fromPairs))(t)}(t).then(h),m={mapFeatures:b,mapStyleSource:n,mapTheme:s,badgesSpriteUrl:u,mapGlyphsUrl:o,structures:c,defaultOrdinal:f,venueBounds:{n:i.ne.lat,s:i.sw.lat,e:i.ne.lng,w:i.sw.lng},venueId:r,venueCenter:p,venueRadius:v,accountId:d.accountId,secure:void 0!==d.auth,tileServerAuthInfo:t.tileServerAuthInfo};g.resolve(m),l.bus.send("venueData/mapDataLoaded",m)}))}));const D=e=>null==e.shouldDisplay||e.shouldDisplay;l.bus.on("venueData/loadBuildingSelectorData",(()=>p.then((async a=>{const t={buildings:a.structures.filter(D).map(e.evolve({levels:e.pipe(e.values,e.sortWith([e.descend(e.prop("ordinal"))]))})),structureOrder:a.structureOrder,selectorOrder:a.selectorOrder};return l.bus.send("venueData/buildingSelectorDataLoaded",t),t})))),l.bus.on("venueData/normalizeCoords",(({coords:e})=>p.then((a=>s(e,a.bounds)))));const I={edges:[],nodes:[]};l.bus.on("venueData/loadNavGraph",(async()=>p.then((async e=>{const a={navGraphData:e.files.nav?await e.fetchJson(e.files.nav):I,structures:e.structures};return l.bus.send("venueData/navGraphLoaded",a),a})))),l.bus.on("venueData/loadPoiData",(async()=>p.then((async e=>{const a=d.useOldDataModel?e.files.poisOld||e.files.pois:e.files.pois||e.files.poisOld;if(a){const t=await e.fetchJson(a);l.bus.send("venueData/poiDataLoaded",{pois:t,structures:e.structures})}})))),l.bus.on("venueData/getVenueCenter",(async()=>p.then((async e=>({lat:e.venueCenter[0],lng:e.venueCenter[1],ordinal:0}))))),l.bus.on("venueData/getContentUrl",(({type:e,name:a=""})=>p.then((t=>t.files[e]+a)))),l.bus.on("venueData/getFloorIdToNameMap",(()=>p.then(e.pipe(e.prop("structures"),e.map(e.prop("levels")),e.chain(e.values),e.map(e.props(["id","name"])),e.fromPairs)))),l.bus.on("venueData/getFloorIdName",(({floorId:a})=>p.then((async t=>{const n=e.pipe(e.values,e.find(e.hasPath(["levels",a])))(t.structures);return n?{structureId:n.id,structureName:n.name,floorName:n.levels[a].name}:null}))));const w=(a,t)=>()=>p.then(e.pipe(e.prop(a),e.defaultTo(t)));l.bus.on("venueData/getVenueData",(()=>p)),l.bus.on("venueData/getVenueName",w("name")),l.bus.on("venueData/getVenueCategory",w("category")),l.bus.on("venueData/getVenueTimezone",w("tz")),l.bus.on("venueData/getAccountId",(()=>d.accountId)),l.bus.on("venueData/getVenueId",w("id")),l.bus.on("venueData/getPositioningSupported",w("positioningSupported")),l.bus.on("venueData/getStructures",w("structures")),l.bus.on("venueData/loadNewVenue",(async({venueId:e,accountId:t,assetStage:n=d.assetStage})=>{p.reject(new Error("loadNewVenue called - previous loading ignored")),g.reject(new Error("loadNewVenue called - previous loading ignored")),p=new a,g=new a,b({...d,venueId:e,accountId:t,assetStage:n}).then(m)})),l.bus.on("venueData/changeVenueLanguage",(async({lang:e})=>p.then((async a=>{const t=f(e),n=`${a.bareVenueId}${t.assetSuffix}`;l.bus.send("venueData/loadNewVenue",{accountId:d.accountId,venueId:n})})))),l.bus.on("venueData/getPoiImageUrl",(({imageName:e,size:a})=>`https://img.locuslabs.com/resize/${d.accountId}/${a}cc/poi/${e}`)),l.bus.on("venueData/getDistributionId",(()=>p.then((e=>`${e.bareVenueId}-${d.accountId}`)))),l.bus.on("venueData/getCustomKeywords",(()=>p.then((e=>{const a=d.useOldDataModel&&e.files.searchOld||e.files.search;return e.fetchJson(a)})))),l.bus.on("venueData/isGrabEnabled",w("enableGrab")),l.bus.on("venueData/getGrabPoiIds",w("grabPoiIds",[])),l.bus.on("venueData/getAssetsTimestamp",w("version")),l.bus.on("venueData/getTranslatedFloorId",(async({floorId:e})=>p.then((a=>{const t=l.i18n().language,n=f(t);return`${a.bareVenueId}${n.assetSuffix}-${e.split("-").slice(1).join("-")}`})))),l.bus.on("venueData/getQueueTypes",(()=>p.then((e=>{const a=["tsapre","clear","globalEntry"];return e.queueTypes?e.queueTypes.reduce(((e,t)=>{const{id:n,subtypes:s}=t,u=s.map((e=>{const t=a.includes(e.id)&&`security-logo-${e.id.toLowerCase()}`;return{...e,imageId:t}}));return e[n]=u,e}),{}):{}}))));return{init:async()=>{const e=d.deepLinkProps||{},a=e.vid||d.venueId,t=d.useDynamicUrlParams&&e.stage?e.stage:d.assetStage,n=e.accountId||("alpha"===t?"A1VPTJKREFJWX5":d.accountId);b({...d,venueId:a,accountId:n,assetStage:t}).then(m)},runTest:async({testRoutine:e,reset:t=!1,venueData:n=null})=>{let s,u;return(t||n)&&(p=new a,g=new a),n&&(p=a.resolve(n)),await e(),p.v&&(s=await p),g.v&&(u=await g),{venueDataObj:s,mapDataObj:u}},internal:{getDefaultStructureId:v}}}export{l as create};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as t from"ramda";import{findBoundsOfCoordinates as
|
|
1
|
+
import*as t from"ramda";import{findBoundsOfCoordinates as e}from"../../../src/utils/bounds.js";import{global as a}from"../../../src/utils/configUtils.js";const n=async(t,e)=>t?fetch(e,{headers:{Authorization:t}}):fetch(e),s=t=>e=>n(t,e).then((t=>t.json())),o=t=>e=>n(t,e).then((t=>t.text())),l=t=>`https://api.content.locuslabs.com/${t}`,r=(e,a,n,s,o)=>t.mapObjIndexed(((t,a)=>((t,e,a,n,s,o)=>"theme"===o||"style"===o?`${l(a)}/${e}/${o}/${s}/${n}/${o}.json`:t.replace(/https:\/\/content.locuslabs.com/gi,l(a)))(t,e,n,s,o,a)),a),i=async(t,e)=>{const n={alpha:"alpha-a.locuslabs.com",beta:"beta-a.locuslabs.com",gamma:"gamma-a.locuslabs.com",prod:"a.locuslabs.com"},{assetStage:s,venueId:o,accountId:l,formatVersion:i}=t,c=`https://${n[s]||n.prod}/accounts/${l}`,u=i||"v5",d=t.dataFetch&&a[t.dataFetch]&&a[t.dataFetch].getFiles?await a[t.dataFetch].getFiles(t):await e(`${c}/${u}.json`);if(!d[o])throw Error(`Attempt to access venue ${o} which is not within venue list: ${Object.keys(d)}`);const g=d[o].files,h=(t.dataFetch&&a[t.dataFetch]&&a[t.dataFetch].getVenueData?await a[t.dataFetch].getVenueData(t):await e(g.venueData))[o];h.tileServerAuthInfo&&function(t){const e={defaultOrdinal:0,defaultStructureId:"singleBuilding",formatVersion:"v5",structures:{singleBuilding:{name:"singleBuilding",boundsPolygon:[],defaultLevelId:"singleLevel",id:"singleBuilding",levels:{singleLevel:{boundsPolygon:[],clfloor:0,details:"",id:"singleLevel",name:"singleLevel",ordinal:0}}}},structureOrder:["singleBuilding"]};for(const a in e)t[a]=e[a]}(h),h.venueList=d;const m=(t=>{const e=t.deepLinkProps?t.deepLinkProps.contentStage:null;return"alpha"===e||"beta"===e||"prod"===e?e:null})(t);return h.files=m?r(h.category,g,m,l,o):g,h},c=t=>{const{structureOrder:a,structures:n}=t;return a.map((t=>{const a=n[t],s=e(a.boundsPolygon);return{...a,bounds:s}}))};const u=([t,e,...a])=>[e,t,...a],d=(t,e)=>{return!t||!Array.isArray(t)||t.length<1?t:(a=t[0][0],n=e.ne.lng,s=e.sw.lng,(a>n?a<=s:t=>s)?t:t.map(u));var a,n,s};export{c as buildStructures,s as createFetchJson,o as createFetchText,i as getVenueDataFromUrls,d as normalizeCoords};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pick as t,isNil as o,map as
|
|
1
|
+
import{pick as t,isNil as o,map as n,omit as e,path as r}from"ramda";import{encode as i,calculateAdjacent as s}from"../../../src/extModules/geohasher.js";import{distance as l}from"../../../src/utils/geodesy.js";import u from"./minPriorityQueue.js";function d(r,s,l,u){const d={},c={};let a={};r.nodes.forEach((o=>{const n=s(o.floorId),e=l(o.floorId);!function(t){const o=t.floorId+":"+i(t.lat,t.lng).substr(0,7),n=t.floorId+":"+i(t.lat,t.lng).substr(0,8);c[o]||(c[o]=[]);c[o].push(t),c[n]||(c[n]=[]);c[n].push(t),d[t.id]=t}({...t(["id","lat","lng","floorId"],o),edges:[],ordinal:n,structureId:e})})),r.edges.forEach((t=>d[t.s].edges.push(function(t,n){const e=function(t){return t.x?"Security Checkpoint":""===t.t?"Ground":t.t}(t),r="escalator"!==e.toLowerCase()&&"stairs"!==e.toLowerCase(),i=f(t.s,t.d,n),s=t.l||i/60,l=t=>t.map((t=>({start:{lat:t.s[0],lng:t.s[1]},out:{lat:t.o[0],lng:t.o[1]},in:{lat:t.i[0],lng:t.i[1]},end:{lat:t.e[0],lng:t.e[1]}}))),u=t.p?l(t.p):null;return{distance:i,dst:t.d,o:t.o,isAccessible:r,isDriveway:!o(t.h)&&!t.h,src:t.s,transitTime:s,type:e,path:u,weight:s}}(t,d))));const h=t=>{if(void 0===t.floorId&&void 0===t.ordinal)throw Error("Endpoint specified in findRoute without floorId nor an ordinal");const o=t.lat||t.latitude,n=t.lng||t.longitude;return t.floorId?w(t.floorId,o,n,c,d):C(t.ordinal,o,n,d)};return{_nodes:d,_geoDb:c,findClosestNode:(t,o,n)=>w(t,o,n,c,d),findShortestPath:(t,o,n)=>function(t,o,n,e={}){return I(h(t),h(o),n,a,u,e)}(t,o,d,n),findAllShortestPaths:function(t,o,n){const e=h(t),r=o.map((t=>h(t)));return e&&r.length?function(t,o,n,e={},r={},i={}){return o.map((o=>{try{return I(t,o,n,e,r,i)}catch(t){return null}}))}(e,r,d,a,u,n):[]},floorIdToOrdinal:s,floorIdToStructureId:l,updateWithSecurityWaitTime:function(t){a=n(e(["lastUpdated"]),t),y()},clearCache:y}}function f(t,o,n){const e=n[t],r=n[o];return l(e.lat,e.lng,r.lat,r.lng)}let c,a,h,p,g,m;const y=()=>{c={},a={},h={},p=new u,g=null,m={}};function I(t,o,n,e={},i={},s={}){for(t.id===g&&m===JSON.stringify(s)||(y(),p.offerWithPriority(t.id,0),c[t.id]=0,h[t.id]=!0,g=t.id,m=JSON.stringify(s));!p.isEmpty()&&!h[o.id];){const t=n[p.poll()],o=c[t.id];for(let n=0;n<t.edges.length;n++){const l=t.edges[n];if(h[l.dst])continue;if(s.requiresAccessibility&&!l.isAccessible)continue;let u=l.weight;if(l.o&&e[l.o]){const t=e[l.o];t.queueTime&&(u=t.queueTime),t.isTemporarilyClosed&&(u=9999),l.securityWaitTimes=t}if(l.o&&i[l.o]){l.securityLane=i[l.o];const{type:t,id:o}=i[l.o],n=r(["selectedSecurityLanes",t],s);if(n&&!n.includes(o))continue}void 0===c[l.dst]?(a[l.dst]=t,c[l.dst]=o+u,p.offerWithPriority(l.dst,o+u)):c[l.dst]>o+u&&(c[l.dst]=o+u,a[l.dst]=t,p.raisePriority(l.dst,o+u))}h[t.id]=!0}if(!h[o.id])return null;const l=[];let u=o;for(;u;)l.push(u),u=a[u.id];return l.reverse()}function b(t,o,n,e){const r=o.substr(0,e),i=[];i.push(t+":"+s(s(r,"top"),"left")),i.push(t+":"+s(r,"top")),i.push(t+":"+s(s(r,"top"),"right")),i.push(t+":"+s(r,"left")),i.push(t+":"+r),i.push(t+":"+s(r,"right")),i.push(t+":"+s(s(r,"bottom"),"left")),i.push(t+":"+s(r,"bottom")),i.push(t+":"+s(s(r,"bottom"),"right"));const l=[];for(let t=0;t<i.length;t++){const o=n[i[t]];if(o)for(let t=0;t<o.length;t++)l.push(o[t])}return l}function w(t,o,n,e,r){const s=function(t,o,n,e){let r=b(t,o,n,8);return r.length>0?r:(r=b(t,o,n,7),r.length>0?r:null)}(t,i(o,n),e)||function(t,o,n,e){const r=Object.values(e).filter((o=>o.floorId===t)).map((t=>[t,l(t.lat,t.lng,o,n)]));if(!r.length)throw Error(`findClosestNodeByFloor2 found no nodes on floor ${t}`);return S(r)}(t,o,n,r),u=[];for(let t=0;t<s.length;t++){const e=l(o,n,s[t].lat,s[t].lng);u.push([s[t],e])}u.sort((function(t,o){return t[1]-o[1]}));const d=[];for(let t=0;t<u.length;t++)d.push(u[t][0]);return d[0]}function C(t,o,n,e){const r=Object.values(e).filter((o=>o.ordinal===t)).map((t=>[t,l(t.lat,t.lng,o,n)]));if(!r.length)throw Error(`findClosestNodeByOrdinal found no nodes on ordinal ${t}`);return S(r)}function S(t){let o=t[0];for(let n=1;n<t.length;n++)t[n][1]<o[1]&&(o=t[n]);return o[0]}export{d as createNavGraph,C as findClosestNodeByOrdinal,I as findShortestPath};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as t from"ramda";import n from"zousan";import{buildStructuresLookup as o}from"../../../src/utils/buildStructureLookup.js";import{distance as e}from"../../../src/utils/geodesy.js";import{findRoute as i}from"./findRoute.js";import{createNavGraph as r}from"./navGraph.js";import{enrichDebugNavGraph as a}from"./navGraphDebug.js";import{buildSegments as s}from"./segmentBuilder.js";const u={SECURITY:"SecurityLane",IMMIGRATION:"ImmigrationLane"};function d(d,p){const l=d.log.sublog("wayfinder"),c=async()=>{d.bus.send("venueData/loadNavGraph")};let f=new n;d.bus.on("wayfinder/_getNavGraph",(()=>f)),d.bus.on("venueData/navGraphLoaded",(async({navGraphData:t,structures:n})=>{const e=o(n),i=await y(),a=r(t,e.floorIdToOrdinal,e.floorIdToStructureId,i);f.resolve(a)}));const y=async()=>{const n=await d.bus.get("poi/getByCategoryId",{categoryId:"security"});return t.pipe(t.map(m),t.filter(t.identity))(n)},m=n=>n.queue&&{type:t.path(["queue","queueType"],n),id:t.path(["queue","queueSubtype"],n)};d.bus.on("wayfinder/showNavLineFromPhysicalLocation",(async({toEndpoint:t,selectedSecurityLanes:n=null,requiresAccessibility:o})=>async function(t,n,o){const e=await b({fromEndpoint:t,toEndpoint:n,options:o});if(e){const{segments:t}=e;o.primary&&d.bus.send("map/resetNavlineFeatures"),d.bus.send("map/showNavlineFeatures",{segments:t,alternative:!o.primary})}return e}(await d.bus.get("user/getPhysicalLocation"),t,{selectedSecurityLanes:n,requiresAccessibility:o,primary:!0})));const
|
|
1
|
+
import*as t from"ramda";import n from"zousan";import{buildStructuresLookup as o}from"../../../src/utils/buildStructureLookup.js";import{distance as e}from"../../../src/utils/geodesy.js";import{findRoute as i}from"./findRoute.js";import{createNavGraph as r}from"./navGraph.js";import{enrichDebugNavGraph as a}from"./navGraphDebug.js";import{buildSegments as s}from"./segmentBuilder.js";const u={SECURITY:"SecurityLane",IMMIGRATION:"ImmigrationLane"};function d(d,p){const l=d.log.sublog("wayfinder"),c=async()=>{d.bus.send("venueData/loadNavGraph")};let f=new n;d.bus.on("wayfinder/_getNavGraph",(()=>f)),d.bus.on("venueData/navGraphLoaded",(async({navGraphData:t,structures:n})=>{const e=o(n),i=await y(),a=r(t,e.floorIdToOrdinal,e.floorIdToStructureId,i);f.resolve(a)}));const y=async()=>{const n=await d.bus.get("poi/getByCategoryId",{categoryId:"security"});return t.pipe(t.map(m),t.filter(t.identity))(n)},m=n=>n.queue&&{type:t.path(["queue","queueType"],n),id:t.path(["queue","queueSubtype"],n)};d.bus.on("wayfinder/showNavLineFromPhysicalLocation",(async({toEndpoint:t,selectedSecurityLanes:n=null,requiresAccessibility:o})=>async function(t,n,o){const e=await b({fromEndpoint:t,toEndpoint:n,options:o});if(e){const{segments:t}=e;o.primary&&d.bus.send("map/resetNavlineFeatures"),d.bus.send("map/showNavlineFeatures",{segments:t,alternative:!o.primary})}return e}(await d.bus.get("user/getPhysicalLocation"),t,{selectedSecurityLanes:n,requiresAccessibility:o,primary:!0})));const I=(t,n)=>d.bus.get("poi/getById",{id:t}).then((o=>{if(o&&o.position)return w(o,n);throw Error("Unknown POI ID "+t)}));const g=["lat","lng","floorId","ordinal"],h=t.pipe(t.pick(g),t.keys,t.propEq("length",g.length),Boolean),w=(t,n)=>({lat:t.position.latitude,lng:t.position.longitude,floorId:t.position.floorId,ordinal:n(t.position.floorId),title:t.name});async function b({fromEndpoint:t,toEndpoint:n,options:o={}}){return f.then((async e=>{o.compareFindPaths=p.compareFindPaths;const r=i(e,t,n,o);if(!r)return null;t.floorId&&n.floorId&&v(t,n,r);const a=await d.bus.get("venueData/getFloorIdToNameMap"),u=await d.bus.get("venueData/getQueueTypes"),c=d.gt(),{steps:f,segments:y}=s(r.waypoints,t,n,a,c,u);l.info("route",r);const m=Math.round(r.waypoints.reduce(((t,{eta:n})=>t+n),0)),I=Math.round(r.waypoints.reduce(((t,{distance:n})=>t+n),0));return{...r,segments:y,steps:f,time:m,distance:I}}))}d.bus.on("wayfinder/getNavigationEndpoint",(({ep:t})=>async function(t){return f.then((n=>{if(!t)throw Error("wayfinder: Invalid endpoint definition",t);if("number"==typeof t)return I(t,n.floorIdToOrdinal);if("string"==typeof t){if(t.match(/^\d+$/))return I(parseInt(t),n.floorIdToOrdinal);if(t.indexOf(",")>0){let[o,e,i,r]=t.split(",");if(!n.floorIdToStructureId(i))throw Error("Unknown floorId in endpoint: "+i);return r||(r="Starting Point"),{lat:parseFloat(o),lng:parseFloat(e),ordinal:n.floorIdToOrdinal(i),floorId:i,title:r}}}if(h(t))return t;if(t.latitude)return{lat:t.latitude,lng:t.longitude,floorId:t.floorId,ordinal:n.floorIdToOrdinal(t.floorId),title:t.title};if(t.position&&t.name)return w(t,n.floorIdToOrdinal);throw Error("Invalid start or end point: "+t)}))}(t))),d.bus.on("wayfinder/checkIfPathHasSecurity",(({fromEndpoint:n,toEndpoint:o,options:e={}})=>f.then((r=>{e.compareFindPaths=p.compareFindPaths;const a=i(r,n,o,e);if(!a)return{routeExists:!1};const s=n=>Boolean(a.waypoints.find(t.pathEq(["securityLane","type"],n)));return{routeExists:!0,queues:a.waypoints.filter((n=>t.pathEq(["securityLane","type"],u.SECURITY,n)||t.pathEq(["securityLane","type"],u.IMMIGRATION,n))),hasSecurity:s(u.SECURITY),hasImmigration:s(u.IMMIGRATION)}})))),d.bus.on("wayfinder/getRoute",b);const v=(t,n,o)=>d.bus.send("session/submitEvent",{type:"navigation",startPosition:{venueId:t.floorId.split("-")[0],buildingId:o.waypoints[0].position.structureId,floorId:o.waypoints[0].position.floorId,lat:o.waypoints[0].position.lat,lng:o.waypoints[0].position.lng},endPosition:{venueId:n.floorId.split("-")[0],buildingId:o.waypoints[o.waypoints.length-1].position.structureId,floorId:o.waypoints[o.waypoints.length-1].position.floorId,lat:o.waypoints[o.waypoints.length-1].position.lat,lng:o.waypoints[o.waypoints.length-1].position.lng}});function T(t){return S(t,"transitTime")}function E(t){return S(t,"distance")}function S(n,o){return t.aperture(2,n).map((([n,o])=>{return(e=o.id,n=>t.find((t=>t.dst===e),n.edges))(n);var e})).map(t.prop(o)).reduce(((t,n)=>t+n),0)}function L(t,n){return t.distance=e(n.lat,n.lng,t.position.latitude,t.position.longitude),t}return d.bus.on("wayfinder/addPathTimeSingle",(async({poi:t,startLocation:n,options:o={}})=>n?f.then((e=>function(t,n,o,e){const i=w(o,t.floorIdToOrdinal),r=t.findShortestPath(e,i,n);if(!r)return(o=L(o,e)).transitTime=o.distance/60,o;return Object.assign(o,{transitTime:T(r),distance:E(r)})}(e,o,t,n))):t)),d.bus.on("wayfinder/addPathTimeMultiple",(async({pois:t,startLocation:n,options:o={}})=>n?f.then((e=>function(t,n,o,e){try{const i=o.map((n=>w(n,t.floorIdToOrdinal))),r=t.findAllShortestPaths(e,i,n);return o.map(((t,n)=>function(t,n,o){n&&n.length?t=Object.assign(t,{transitTime:T(n),distance:E(n)}):(t=L(t,o)).transitTime=t.distance/60;return t}(t,r[n],e)))}catch(t){return l.error(t),o}}(e,o,t,n))):t)),d.bus.on("venueData/loadNewVenue",(()=>{f=new n,c()})),d.bus.on("poi/setDynamicData",(({plugin:t,idValuesMap:n})=>{"security"===t&&f.then((t=>t.updateWithSecurityWaitTime(n)))})),d.bus.on("wayfinder/getNavGraphFeatures",(()=>f.then((({_nodes:t})=>a(t))))),{init:c,internal:{resolveNavGraph:t=>f.resolve(t),prepareSecurityLanes:y}}}export{u as SecurityLaneType,d as create};
|
package/lib/src/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"IObject";import
|
|
1
|
+
import e from"IObject";import n from"query-string";import{map as t,mergeDeepRight as o}from"ramda";import i from"zousan-plus";import r from"../package.json.js";import a from"./debugTools.js";import{buildEnv as s}from"./env.js";import{create as l}from"./extModules/bustle.js";import{initLog as u}from"./extModules/log.js";import g from"./utils/i18n.js";const c="undefined"!=typeof window;async function d(e,n,t){let o=n;if(o.includes("/")){const e=o.split("/");o=e[e.length-1]}if(void 0!==t.active){if(!1===t.active||"notLocalhost"===t.active&&e.env.isLocalhost())return e.log.info(`Plugin ${n} explicitly deativated`),null;e.log.info(`Plugin ${n} being instantiated!`,JSON.stringify(t))}else e.log.info(`Plugin ${n} being instantiated!`,JSON.stringify(t));return import(`../plugins/${n}/src/${o}.js`).then((o=>(e.log.info(`Creating plugin ${n}`),o.create(e,t))))}async function p(e){return c?import(`./configs/${e}.json`):import(`./configs/${e}.json.js`)}async function m(e,n){let t={};const i=await Promise.all(n.map(p));for(const e of i){let n=e.default;n=n.extends?await m(n,n.extends):n,t=o(t,n)}return t=o(t,e),t}const f=e=>n=>import(`./configs/postproc-${e}.js`).then((e=>e.process(n)));async function y(o){const p=Object.create(null);let y=o.extends?await m(o,o.extends):o;y.plugins.monitoring&&import("../_virtual/_empty_module_placeholder.js").then((e=>e.activate(y))),y=await(async e=>e.configPostProc?i.series(e,...e.configPostProc.map(f)):e)(y);const w=(e=>{const t=e.supportedLanguages||["ar","en","es","fr","ja","ko","zh-Hans","zh-Hant"];if("undefined"!=typeof window){let e=n.parse(location.search).lang||navigator.language;for(;e;){if(e&&t.includes(e))return e;e=e.substring(0,e.lastIndexOf("-"))}}return e.defaultLanguage||"en"})(y),h=await g(w,{debug:y.debug});p.i18n=()=>h,p.gt=()=>h.t.bind(h),p.config=y,p.plugins=new e;const b=u("web-engine",{enabled:!!y.debug,isBrowser:c,color:"cyan",logFilter:y.logFilter,truncateObjects:!c});if(p.log=b.sublog(y.name),p.bus=l({trace:!1,showEvents:!0,reportAllErrors:!0,log:b}),p.info={wePkg:r},"undefined"!=typeof window&&(y.debug?(p.debug=t((e=>e.bind(p)),a),a.dndGo.call(p)):p.debug={},window._app=p,window.document&&window.document.title&&y.setWindowTitle&&(document.title=y.name)),p.env=s(p),y.theme?await i.evaluate({name:"ThemeManagerModule",value:import("../_virtual/_empty_module_placeholder.js")},{name:"HistoryManager",value:import("./historyManager.js")},{name:"LayerManager",value:import("../_virtual/_empty_module_placeholder.js")}).then((async({LayerManager:e,HistoryManager:n,ThemeManagerModule:t})=>{const o=t.initThemeManager(p);p.themePack=await o.buildTheme(y.theme,y.defaultTheme),e.initLayerManager(p),n.initHistoryManager(p),p.destroy=()=>e.destroy(p)})):p.destroy=()=>{},y.plugins){for(const e in y.plugins)try{const n=y.plugins[e];if(p.plugins[e])throw Error(`Duplicate plugin name "${e}"`);const t=await d(p,e,n);t&&(p.plugins=p.plugins.set(e,t))}catch(n){b.error("Error instantiating plugin "+e),b.error(n)}for(const e in p.plugins)p.plugins[e].init()}return p}export{y as create};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"query-string";const e={navFrom:"online/getDirectionsFromTo",navTo:"online/getDirectionsFromTo",accessible:"online/getDirectionsFromTo",showNav:"online/getDirectionsFromTo",poiId:["online/getDirectionsFromTo","online/poiView"],vid:"venueDataLoader",stage:"venueDataLoader",contentStage:"venueDataLoader",search:"online/headerOnline",ho:["online/getDirectionsFromTo","analytics2"],home:"online/homeView",zoom:"mapRenderer",pitch:"mapRenderer",bearing:"mapRenderer",lat:"mapRenderer",lng:"mapRenderer",radius:"mapRenderer",buildingId:"mapRenderer",floorId:"mapRenderer",refInstallId:"analytics2"};function n(n,o,r){if(void 0!==o.lldebug)try{n.debug=JSON.parse(o.lldebug),null===n.debug&&(n.debug={})}catch(e){n.debug=!0}return Object.keys(e).forEach((i=>{if(void 0!==o[i]){let a=e[i];Array.isArray(a)||(a=[a]),a.forEach((e=>{let a=n.plugins[e];!a&&r&&(a=n.plugins[e]={}),a.deepLinkProps={...a.deepLinkProps,[i]:o[i]}}))}})),o.poiId&&o.showNav&&delete n.plugins["online/poiView"].deepLinkProps.poiId,n}export{n as setDeepLinksForParms};
|
|
1
|
+
import"query-string";const e={navFrom:"online/getDirectionsFromTo",navTo:"online/getDirectionsFromTo",accessible:"online/getDirectionsFromTo",showNav:"online/getDirectionsFromTo",poiId:["online/getDirectionsFromTo","online/poiView"],vid:"venueDataLoader",stage:"venueDataLoader",contentStage:"venueDataLoader",accountId:"venueDataLoader",search:"online/headerOnline",ho:["online/getDirectionsFromTo","analytics2"],home:"online/homeView",zoom:"mapRenderer",pitch:"mapRenderer",bearing:"mapRenderer",lat:"mapRenderer",lng:"mapRenderer",radius:"mapRenderer",buildingId:"mapRenderer",floorId:"mapRenderer",refInstallId:"analytics2"};function n(n,o,r){if(void 0!==o.lldebug)try{n.debug=JSON.parse(o.lldebug),null===n.debug&&(n.debug={})}catch(e){n.debug=!0}return Object.keys(e).forEach((i=>{if(void 0!==o[i]){let a=e[i];Array.isArray(a)||(a=[a]),a.forEach((e=>{let a=n.plugins[e];!a&&r&&(a=n.plugins[e]={}),a.deepLinkProps={...a.deepLinkProps,[i]:o[i]}}))}})),o.poiId&&o.showNav&&delete n.plugins["online/poiView"].deepLinkProps.poiId,n}export{n as setDeepLinksForParms};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"query-string";import*as e from"ramda";import"zousan";function r(r,
|
|
1
|
+
import"query-string";import*as e from"ramda";import"zousan";function r(r,o,t){const n=JSON.parse(o);return Object.keys(n).forEach((o=>{const p=n[o];let s=r.plugins[o];if(!s&&t&&(s=r.plugins[o]={}),s){const r=s.deepLinkProps;s.deepLinkProps=r?e.mergeDeepRight(r,p):p}})),r}export{r as setStateFromStateString};
|
package/lib/src/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function i(i){const t=i.config.desktopViewMinWidth||0,o="undefined"!=typeof window,s={isBrowser:o,isMobile:()=>o&&innerWidth<t,isLocalhost:()=>location.host.startsWith("localhost")||location.host.startsWith("127.0.0.1"),isDesktop:()=>o&&!s.isMobile()};return o&&window.addEventListener("resize",(()=>i.bus.send("env/resize"))),s}export{i as buildEnv};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"zousan";const n=(o,n)=>o.splice(n,1)[0],t=(o,t)=>{let r=0;do{r=o.indexOf(t,r),r>=0&&n(o,r)}while(r>=0);return o};function r(n){const r=n.log?n.log.sublog?n.log.sublog("bustle",{color:"pink"}):n.log:console,e={},s={};function c(o,n){e[o]&&t(e[o],n)}function u(o,n){s[o]&&t(s[o],n)}function l(t,c){return n.trace&&(c||(c={}),c._stack=Error().stack),n.showEvents&&("function"==typeof n.showEvents?n.showEvents(t,c)&&r.info("send with",t," and ",c):r.info("send with",t," and ",c)),new o((u=>o.soon(((t,c,u)=>()=>{const l=e[t],f=s[t],i=[];if(l)for(const t of l)try{i.push(t(c))}catch(t){n.reportAllErrors&&r.error(t),n.rejectOnError
|
|
1
|
+
import o from"zousan";const n=(o,n)=>o.splice(n,1)[0],t=(o,t)=>{let r=0;do{r=o.indexOf(t,r),r>=0&&n(o,r)}while(r>=0);return o};function r(n){const r=n.log?n.log.sublog?n.log.sublog("bustle",{color:"pink"}):n.log:console,e={},s={};function c(o,n){e[o]&&t(e[o],n)}function u(o,n){s[o]&&t(s[o],n)}function l(t,c){return n.trace&&(c||(c={}),c._stack=Error().stack),n.showEvents&&("function"==typeof n.showEvents?n.showEvents(t,c)&&r.info("send with",t," and ",c):r.info("send with",t," and ",c)),new o((u=>o.soon(((t,c,u)=>()=>{const l=e[t],f=s[t],i=[];if(l)for(const t of l)try{i.push(t(c))}catch(t){n.reportAllErrors&&r.error(t),n.rejectOnError?i.push(o.reject(t)):i.push(t)}const h=o.all(i);if(f)for(const o of f)try{o(c,h)}catch(o){n.reportAllErrors&&r.error(o)}u(h)})(t,c,u))))}return{get:(n,t)=>l(n,t).then((t=>1!==t.length?o.reject(`${n} event did not return a single result, but ${t.length} results.`):t[0])),moff:u,monitor:function(o,n){return s[o]||(s[o]=[]),s[o].push(n),()=>u(o,n)},off:c,on:function(o,n){return e[o]||(e[o]=[]),e[o].push(n),()=>c(o,n)},send:l}}export{r as create};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function n(n,o){for(;o.length<n;)o+=" ";return o}const o=()=>n(18,"Command")+"Arguments\n"+n(18,"----------------")+"----------------\n",
|
|
1
|
+
function n(n,o){for(;o.length<n;)o+=" ";return o}const o=()=>n(18,"Command")+"Arguments\n"+n(18,"----------------")+"----------------\n",m=o=>n(18,o.command)+(o.args?o.args.map((n=>`${n.name} {${n.type}} ${n.optional?" (optional)":" (required)"}`)).join(", "):""),r=(n,o)=>n.command>o.command?1:-1,a=n=>n.sort(r).reduce(((n,o)=>`${n}${m(o)}\n`),o());export{m as getHelp,o as getHelpHeader,a as getHelpList};
|
package/lib/src/utils/dom.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=(t,e)=>"string"==typeof t?(e||document).querySelector(t):t||null,e=(t,e)=>Array.prototype.slice.call((e||document).querySelectorAll(t));function n(t,e){const n=t||{};e=e
|
|
1
|
+
const t=(t,e)=>"string"==typeof t?(e||document).querySelector(t):t||null,e=(t,e)=>Array.prototype.slice.call((e||document).querySelectorAll(t));function n(t,e){const n=t||{};e=e?"string"==typeof e?document.querySelector(e):e:document.body;let l="div";n.tag&&(l=n.tag);const s=document.createElement(l);for(const t in n)null!=n[t]&&("klass"===t?s.setAttribute("class",n.klass):"tag"===t||("styles"===t?o(s,n.styles):"text"===t?s.textContent=n.text:"html"===t?s.innerHTML=n.html:s.setAttribute(t,n[t])));return e.appendChild(s),s}const o=(t,e)=>{for(const n in e)t.style[n]=e[n]};export{t as $,e as $$,n as ad,o as setStyles};
|
package/lib/src/utils/i18n.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import n from"i18next";async function e(e,t){const
|
|
1
|
+
import n from"i18next";async function e(e,{debugMode:t,fallbackLng:a}){const o=n.createInstance();return o.init({debug:t,interpolation:{escapeValue:!1},resources:{en:{translation:{"Walk xx minutes to":"Walk {{count}} minute to","Walk xx minutes to_plural":"Walk {{count}} minutes to"}}},fallbackLng:void 0===a?"en":a,lng:e,postProcess:["pseudoTrans"]}).then((()=>(t&&o.on("missingKey",(function(n,e,t,a){console.error("i18nNext: key not found. Language: "+o.language+", Key: "+t+", namespace: "+e+", lngs: ",n)})),o)))}const t={ar:"بال عن أمام الأخذ البرية. ثم كما وقام شاسعة الجنوبي, أمدها الإمداد عن انه. ٣٠ فكانت والكساد انه. أساسي الشمال الإتفاقية بال أم. زهاء المؤلّفة حين عل, سكان قررت هذه ان, شعار باستخدام ولم مع.\n\nدول الأمور الصفحة الأوروبية قد. تم حدى فاتّبع الهجوم, ما أوسع معاملة فعل, خلاف الأوروبية، إيو كل. تُصب واندونيسيا، حين قد. أي حاول حقول وهولندا، هذا, بين عن لهيمنة بالسيطرة.\n\nأعمال الإتحاد العمليات من وصل. وقوعها، باستخدام قد أخر, بل حتى علاقة التبرعات. فقد لم الأرض استبدال. حتى الخاسر اقتصادية بـ. أصقاع أعلنت اتفاقية تلك بل, كان إذ بحشد أخرى ليبين. الشتاء، اليابان، مكن أم, به، قد العالم، أوراقهم, بل لعدم لغزو أواخر مكن.\n",ja:"私は場合いよいよある所有らってのの末がしたた。無論結果に圧迫顔もよくその発展ないですまでを決するてみるでしでも発展云いませたから、そうには描いたないたた。機会へ載っない方は別に今をひょろひょろでずまし。むしろ嘉納さんを意味方面そう#「を積んない権力この自分何か記念をというおお尋ねだろででですで、ある今はこれか頼み例があるで、ネルソンさんののの引込のあなたにもっともお努力といと私赤に実建設が起っようにとやかくご附随を描いですましから、どうもとにかく相違に云おでてならますのが行っないませ。"},a=(n,e)=>"en"===e?n:o(n,t[e]),o=(n,e)=>n.length<e.length?e.substring(0,n.length):e;export{e as default,a as toLang};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atriusmaps-node-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.31",
|
|
4
4
|
"description": "This project provides an API to Atrius Personal Wayfinder maps within a Node environment. See the README.md for more information",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"map",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"IObject": "^0.6.2",
|
|
37
|
-
"flexsearch": "0.
|
|
37
|
+
"flexsearch": "^0.7.31",
|
|
38
38
|
"i18next": "^20.3.4",
|
|
39
39
|
"node-fetch": "^2.6.1",
|
|
40
40
|
"query-string": "^7.0.1",
|