@mapvx/web-components 0.1.1 → 0.1.3

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.
Files changed (31) hide show
  1. package/dist/cjs/KTX2Loader-CNSoekFo.cjs +1 -5
  2. package/dist/cjs/{base-floor-selector-CbSa9Qw2.cjs → base-floor-selector-6B_D7uUw.cjs} +2 -2
  3. package/dist/cjs/{class-map-DQkA5L7H.cjs → class-map-CfJw8pY6.cjs} +2 -2
  4. package/dist/cjs/{compact-floor-selector-C_LgJzzv.cjs → compact-floor-selector-CPK6sXBk.cjs} +2 -2
  5. package/dist/cjs/{consume-D1MFwxfA.cjs → consume-B4K_oiFc.cjs} +2 -2
  6. package/dist/cjs/{custom-map-CsX48Rua.cjs → custom-map-CfhrBuF7.cjs} +3 -3
  7. package/dist/cjs/floor-selector-rW48Tktb.cjs +15 -0
  8. package/dist/cjs/{geojson-layer-BWursA41.cjs → geojson-layer-wtQbiowp.cjs} +2 -2
  9. package/dist/cjs/{index-OWjqDH0W.cjs → index-BAYbrXBp.cjs} +2 -2
  10. package/dist/cjs/{index-D4uHh_zx.cjs → index-DAac9HVL.cjs} +2 -2
  11. package/dist/cjs/index.cjs +1 -1
  12. package/dist/cjs/map-view-with-modal.cjs +1 -1
  13. package/dist/cjs/{qr-modal-DAjokbee.cjs → qr-modal-fSPvpyzj.cjs} +2 -2
  14. package/dist/cjs/{route-options-BW6OJ8pz.cjs → route-options-BjMH6A43.cjs} +2 -2
  15. package/dist/cjs/route-view-totems.cjs +1 -5
  16. package/dist/cjs/{sdk-controller-BcvviQ36.cjs → sdk-controller-5LmYQQhJ.cjs} +3 -3
  17. package/dist/es/assets/{compact-floor-selector-DM0rj7tE.js → compact-floor-selector-WL6DewCc.js} +2 -2
  18. package/dist/es/assets/{components-iq1KFC9T.js → components-BfTs1Lia.js} +9 -9
  19. package/dist/es/assets/{geojson-layer-BXJPA2B2.js → geojson-layer-CeMb7DTQ.js} +2 -2
  20. package/dist/es/assets/globe-viewport-CFdegSgy.js +4 -0
  21. package/dist/es/assets/{index-BV0wWAyE.js → index-D4Krpv5a.js} +2 -2
  22. package/dist/es/assets/{index-Bp1QRPSH.js → index-wdE7uK4l.js} +2 -6
  23. package/dist/es/assets/{map-view-with-modal-KAG4NGbk.js → map-view-with-modal-JYZY7d5R.js} +2 -2
  24. package/dist/es/assets/{route-view-totems-BHOMtYE0.js → route-view-totems-Dvggb-ZM.js} +4 -4
  25. package/dist/es/assets/{utils-BMph9fmy.js → utils-B4ksZYyJ.js} +3 -3
  26. package/dist/es/index.js +1 -1
  27. package/dist/es/route-view-totems.js +1 -1
  28. package/dist/iife/map-view-with-modal.js +2 -2
  29. package/dist/iife/route-view-totems.js +20 -20
  30. package/package.json +1 -1
  31. package/dist/cjs/floor-selector-DiJexma4.cjs +0 -15
@@ -1,6 +1,2 @@
1
-
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="eaaf1858-b061-541c-b263-d3639047fc6e")}catch(e){}}();
3
- import{G as t,u as n,L as o,p as i,c as s,a as r,M as a,C as l}from"./geojson-layer-BXJPA2B2.js";export{A as ArcLayer,B as BitmapLayer,e as GeoJsonLayer,I as IconLayer,b as PathLayer,P as PointCloudLayer,d as PolygonLayer,S as ScatterplotLayer,f as SolidPolygonLayer,T as TextLayer,g as _MultiIconLayer,h as _TextBackgroundLayer}from"./geojson-layer-BXJPA2B2.js";import{U as c}from"./webgl-developer-tools-DVr-vTMm.js";class u extends t{constructor(e={}){const{id:t=n("cube-geometry"),indices:o=!0}=e;super(o?{...e,id:t,topology:"triangle-list",indices:{size:1,value:p},attributes:{...C,...e.attributes}}:{...e,id:t,topology:"triangle-list",indices:void 0,attributes:{...L,...e.attributes}})}}const p=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),v=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),_=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),w=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),m=new Float32Array([1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,-1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,1,1,1,1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,-1,-1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1]),x=new Float32Array([1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0]),y=new Float32Array([1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1,0,1,0,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,0,0,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,0,1,0,1,0,1]),C={POSITION:{size:3,value:v},NORMAL:{size:3,value:_},TEXCOORD_0:{size:2,value:w}},L={POSITION:{size:3,value:m},TEXCOORD_0:{size:2,value:x},COLOR_0:{size:3,value:y}},k="layout(std140) uniform lineUniforms {\n float widthScale;\n float widthMinPixels;\n float widthMaxPixels;\n float useShortestPath;\n highp int widthUnits;\n} line;\n",z={name:"line",source:"",vs:k,fs:k,uniformTypes:{widthScale:"f32",widthMinPixels:"f32",widthMaxPixels:"f32",useShortestPath:"f32",widthUnits:"i32"}},O={getSourcePosition:{type:"accessor",value:e=>e.sourcePosition},getTargetPosition:{type:"accessor",value:e=>e.targetPosition},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}};class M extends o{getBounds(){return this.getAttributeManager()?.getBounds(["instanceSourcePositions","instanceTargetPositions"])}getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME line-layer-vertex-shader\nin vec3 positions;\nin vec3 instanceSourcePositions;\nin vec3 instanceTargetPositions;\nin vec3 instanceSourcePositions64Low;\nin vec3 instanceTargetPositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin float instanceWidths;\nout vec4 vColor;\nout vec2 uv;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\nvec2 dir_screenspace = normalize(line_clipspace * project.viewportSize);\ndir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\nreturn dir_screenspace * offset_direction * width / 2.0;\n}\nvec3 splitLine(vec3 a, vec3 b, float x) {\nfloat t = (x - a.x) / (b.x - a.x);\nreturn vec3(x, mix(a.yz, b.yz, t));\n}\nvoid main(void) {\ngeometry.worldPosition = instanceSourcePositions;\ngeometry.worldPositionAlt = instanceTargetPositions;\nvec3 source_world = instanceSourcePositions;\nvec3 target_world = instanceTargetPositions;\nvec3 source_world_64low = instanceSourcePositions64Low;\nvec3 target_world_64low = instanceTargetPositions64Low;\nif (line.useShortestPath > 0.5 || line.useShortestPath < -0.5) {\nsource_world.x = mod(source_world.x + 180., 360.0) - 180.;\ntarget_world.x = mod(target_world.x + 180., 360.0) - 180.;\nfloat deltaLng = target_world.x - source_world.x;\nif (deltaLng * line.useShortestPath > 180.) {\nsource_world.x += 360. * line.useShortestPath;\nsource_world = splitLine(source_world, target_world, 180. * line.useShortestPath);\nsource_world_64low = vec3(0.0);\n} else if (deltaLng * line.useShortestPath < -180.) {\ntarget_world.x += 360. * line.useShortestPath;\ntarget_world = splitLine(source_world, target_world, 180. * line.useShortestPath);\ntarget_world_64low = vec3(0.0);\n} else if (line.useShortestPath < 0.) {\ngl_Position = vec4(0.);\nreturn;\n}\n}\nvec4 source_commonspace;\nvec4 target_commonspace;\nvec4 source = project_position_to_clipspace(source_world, source_world_64low, vec3(0.), source_commonspace);\nvec4 target = project_position_to_clipspace(target_world, target_world_64low, vec3(0.), target_commonspace);\nfloat segmentIndex = positions.x;\nvec4 p = mix(source, target, segmentIndex);\ngeometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\nuv = positions.xy;\ngeometry.uv = uv;\ngeometry.pickingColor = instancePickingColors;\nfloat widthPixels = clamp(\nproject_size_to_pixel(instanceWidths * line.widthScale, line.widthUnits),\nline.widthMinPixels, line.widthMaxPixels\n);\nvec3 offset = vec3(\ngetExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\nDECKGL_FILTER_GL_POSITION(p, geometry);\ngl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\nvColor = vec4(instanceColors.rgb, instanceColors.a * layer.opacity);\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME line-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nin vec2 uv;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = uv;\nfragColor = vColor;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",source:'// ---------- Helper Structures & Functions ----------\n\n// Placeholder filter functions.\nfn deckgl_filter_size(offset: vec3<f32>, geometry: Geometry) -> vec3<f32> {\n return offset;\n}\nfn deckgl_filter_gl_position(p: vec4<f32>, geometry: Geometry) -> vec4<f32> {\n if (picking.isAttribute > 0.5) {\n // For depth picking, write normalized depth into the picking payload.\n // This mirrors the legacy DECKGL_FILTER_GL_POSITION hook on WebGL.\n }\n return p;\n}\n\n// Compute an extrusion offset given a line direction (in clipspace),\n// an offset direction (-1 or 1), and a width in pixels.\n// Assumes a uniform "project" with a viewportSize field is available.\nfn getExtrusionOffset(line_clipspace: vec2<f32>, offset_direction: f32, width: f32) -> vec2<f32> {\n // project.viewportSize should be provided as a uniform (not shown here)\n let dir_screenspace = normalize(line_clipspace * project.viewportSize);\n // Rotate by 90°: (x,y) becomes (-y,x)\n let rotated = vec2<f32>(-dir_screenspace.y, dir_screenspace.x);\n return rotated * offset_direction * width / 2.0;\n}\n\n// Splits the line between two points at a given x coordinate.\n// Interpolates the y and z components.\nfn splitLine(a: vec3<f32>, b: vec3<f32>, x: f32) -> vec3<f32> {\n let t: f32 = (x - a.x) / (b.x - a.x);\n return vec3<f32>(x, a.yz + t * (b.yz - a.yz));\n}\n\n// ---------- Uniforms & Global Structures ----------\n\nstruct LineUniforms {\n widthScale: f32,\n widthMinPixels: f32,\n widthMaxPixels: f32,\n useShortestPath: f32,\n widthUnits: i32,\n};\n\n@group(0) @binding(0)\nvar<uniform> line: LineUniforms;\n\n\n\n// ---------- Vertex Output Structure ----------\n\nstruct Varyings {\n @builtin(position) gl_Position: vec4<f32>,\n @location(0) vColor: vec4<f32>,\n @location(1) uv: vec2<f32>,\n @location(2) pickingColor: vec3<f32>,\n};\n\n// ---------- Vertex Shader Entry Point ----------\n\n@vertex\nfn vertexMain(\n @location(0) positions: vec3<f32>,\n @location(1) instanceSourcePositions: vec3<f32>,\n @location(2) instanceTargetPositions: vec3<f32>,\n @location(3) instanceSourcePositions64Low: vec3<f32>,\n @location(4) instanceTargetPositions64Low: vec3<f32>,\n @location(5) instanceColors: vec4<f32>,\n @location(6) instancePickingColors: vec3<f32>,\n @location(7) instanceWidths: f32\n) -> Varyings {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n\n var source_world: vec3<f32> = instanceSourcePositions;\n var target_world: vec3<f32> = instanceTargetPositions;\n var source_world_64low: vec3<f32> = instanceSourcePositions64Low;\n var target_world_64low: vec3<f32> = instanceTargetPositions64Low;\n\n // Apply shortest-path adjustments if needed.\n if (line.useShortestPath > 0.5 || line.useShortestPath < -0.5) {\n source_world.x = (source_world.x + 180.0 % 360.0) - 180.0;\n target_world.x = (target_world.x + 180.0 % 360.0) - 180.0;\n let deltaLng: f32 = target_world.x - source_world.x;\n\n if (deltaLng * line.useShortestPath > 180.0) {\n source_world.x = source_world.x + 360.0 * line.useShortestPath;\n source_world = splitLine(source_world, target_world, 180.0 * line.useShortestPath);\n source_world_64low = vec3<f32>(0.0, 0.0, 0.0);\n } else if (deltaLng * line.useShortestPath < -180.0) {\n target_world.x = target_world.x + 360.0 * line.useShortestPath;\n target_world = splitLine(source_world, target_world, 180.0 * line.useShortestPath);\n target_world_64low = vec3<f32>(0.0, 0.0, 0.0);\n } else if (line.useShortestPath < 0.0) {\n var abortOut: Varyings;\n abortOut.gl_Position = vec4<f32>(0.0);\n abortOut.vColor = vec4<f32>(0.0);\n abortOut.uv = vec2<f32>(0.0);\n return abortOut;\n }\n }\n\n // Project Pos and target positions to clip space.\n let sourceResult = project_position_to_clipspace_and_commonspace(source_world, source_world_64low, vec3<f32>(0.0));\n let targetResult = project_position_to_clipspace_and_commonspace(target_world, target_world_64low, vec3<f32>(0.0));\n let sourcePos: vec4<f32> = sourceResult.clipPosition;\n let targetPos: vec4<f32> = targetResult.clipPosition;\n let source_commonspace: vec4<f32> = sourceResult.commonPosition;\n let target_commonspace: vec4<f32> = targetResult.commonPosition;\n\n // Interpolate along the line segment.\n let segmentIndex: f32 = positions.x;\n let p: vec4<f32> = sourcePos + segmentIndex * (targetPos - sourcePos);\n geometry.position = source_commonspace + segmentIndex * (target_commonspace - source_commonspace);\n let uv: vec2<f32> = positions.xy;\n geometry.uv = uv;\n geometry.pickingColor = instancePickingColors;\n\n // Determine width in pixels.\n let widthPixels: f32 = clamp(\n project_unit_size_to_pixel(instanceWidths * line.widthScale, line.widthUnits),\n line.widthMinPixels, line.widthMaxPixels\n );\n\n // Compute extrusion offset.\n let extrusion: vec2<f32> = getExtrusionOffset(targetPos.xy - sourcePos.xy, positions.y, widthPixels);\n let offset: vec3<f32> = vec3<f32>(extrusion, 0.0);\n\n // Apply deck.gl filter functions.\n let filteredOffset = deckgl_filter_size(offset, geometry);\n let filteredP = deckgl_filter_gl_position(p, geometry);\n\n let clipOffset: vec2<f32> = project_pixel_size_to_clipspace(filteredOffset.xy);\n let finalPosition: vec4<f32> = filteredP + vec4<f32>(clipOffset, 0.0, 0.0);\n\n // Compute color.\n var vColor: vec4<f32> = vec4<f32>(instanceColors.rgb, instanceColors.a * layer.opacity);\n // vColor = deckgl_filter_color(vColor, geometry);\n\n var output: Varyings;\n output.gl_Position = finalPosition;\n output.vColor = vColor;\n output.uv = uv;\n output.pickingColor = instancePickingColors;\n return output;\n}\n\n@fragment\nfn fragmentMain(\n @location(0) vColor: vec4<f32>,\n @location(1) uv: vec2<f32>,\n @location(2) pickingColor: vec3<f32>\n) -> @location(0) vec4<f32> {\n // Create and initialize geometry with the provided uv.\n var geometry: Geometry;\n geometry.uv = uv;\n\n // Start with the input color.\n var fragColor: vec4<f32> = vColor;\n\n if (picking.isActive > 0.5) {\n if (!picking_isColorValid(pickingColor)) {\n discard;\n }\n return vec4<f32>(pickingColor, 1.0);\n }\n\n if (picking.isHighlightActive > 0.5) {\n let highlightedObjectColor = picking_normalizeColor(picking.highlightedObjectColor);\n if (picking_isColorZero(abs(pickingColor - highlightedObjectColor))) {\n let highLightAlpha = picking.highlightColor.a;\n let blendedAlpha = highLightAlpha + fragColor.a * (1.0 - highLightAlpha);\n if (blendedAlpha > 0.0) {\n let highLightRatio = highLightAlpha / blendedAlpha;\n fragColor = vec4<f32>(\n mix(fragColor.rgb, picking.highlightColor.rgb, highLightRatio),\n blendedAlpha\n );\n } else {\n fragColor = vec4<f32>(fragColor.rgb, 0.0);\n }\n }\n }\n\n // Apply premultiplied alpha as required by transparent canvas\n fragColor = deckgl_premultiplied_alpha(fragColor);\n\n return fragColor;\n}\n',modules:[i,s,r,z]})}get wrapLongitude(){return!1}initializeState(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1}})}updateState(e){super.updateState(e),e.changeFlags.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){const{widthUnits:t,widthScale:n,widthMinPixels:o,widthMaxPixels:i,wrapLongitude:s}=this.props,r=this.state.model,a={widthUnits:c[t],widthScale:n,widthMinPixels:o,widthMaxPixels:i,useShortestPath:s?1:0};r.shaderInputs.setProps({line:a}),r.draw(this.context.renderPass),s&&(r.shaderInputs.setProps({line:{...a,useShortestPath:-1}}),r.draw(this.context.renderPass))}_getModel(){return new a(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new t({topology:"triangle-strip",attributes:{positions:{size:3,value:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}}),isInstanced:!0})}}M.layerName="LineLayer",M.defaultProps=O;class E extends l{_updateGeometry(){const e=new u;this.state.fillModel.setGeometry(e)}draw({uniforms:e}){const{elevationScale:t,extruded:n,offset:o,coverage:i,cellSize:s,angle:r,radiusUnits:a}=this.props,l=this.state.fillModel,d={radius:s/2,radiusUnits:c[a],angle:r,offset:o,extruded:n,stroked:!1,coverage:i,elevationScale:t,edgeDistance:1,isStroke:!1,widthUnits:0,widthScale:0,widthMinPixels:0,widthMaxPixels:0};l.shaderInputs.setProps({column:d}),l.draw(this.context.renderPass)}}E.layerName="GridCellLayer",E.defaultProps={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",value:[1,1]}};export{l as ColumnLayer,E as GridCellLayer,M as LineLayer};
4
- //# sourceMappingURL=index-Bp1QRPSH.js.map
5
-
6
- //# debugId=eaaf1858-b061-541c-b263-d3639047fc6e
1
+ import{G as t,u as n,L as o,p as i,c as s,a as r,M as a,C as l}from"./geojson-layer-CeMb7DTQ.js";export{A as ArcLayer,B as BitmapLayer,e as GeoJsonLayer,I as IconLayer,b as PathLayer,P as PointCloudLayer,d as PolygonLayer,S as ScatterplotLayer,f as SolidPolygonLayer,T as TextLayer,g as _MultiIconLayer,h as _TextBackgroundLayer}from"./geojson-layer-CeMb7DTQ.js";import{U as c}from"./webgl-developer-tools-DVr-vTMm.js";class u extends t{constructor(e={}){const{id:t=n("cube-geometry"),indices:o=!0}=e;super(o?{...e,id:t,topology:"triangle-list",indices:{size:1,value:p},attributes:{...C,...e.attributes}}:{...e,id:t,topology:"triangle-list",indices:void 0,attributes:{...L,...e.attributes}})}}const p=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),v=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),_=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),w=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),m=new Float32Array([1,-1,1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,-1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,1,1,1,1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,1,-1,1,1,1,-1,1,1,-1,-1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1]),x=new Float32Array([1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0]),y=new Float32Array([1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1,0,1,0,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,0,0,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,0,1,0,1,0,1]),C={POSITION:{size:3,value:v},NORMAL:{size:3,value:_},TEXCOORD_0:{size:2,value:w}},L={POSITION:{size:3,value:m},TEXCOORD_0:{size:2,value:x},COLOR_0:{size:3,value:y}},k="layout(std140) uniform lineUniforms {\n float widthScale;\n float widthMinPixels;\n float widthMaxPixels;\n float useShortestPath;\n highp int widthUnits;\n} line;\n",z={name:"line",source:"",vs:k,fs:k,uniformTypes:{widthScale:"f32",widthMinPixels:"f32",widthMaxPixels:"f32",useShortestPath:"f32",widthUnits:"i32"}},O={getSourcePosition:{type:"accessor",value:e=>e.sourcePosition},getTargetPosition:{type:"accessor",value:e=>e.targetPosition},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}};class M extends o{getBounds(){return this.getAttributeManager()?.getBounds(["instanceSourcePositions","instanceTargetPositions"])}getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME line-layer-vertex-shader\nin vec3 positions;\nin vec3 instanceSourcePositions;\nin vec3 instanceTargetPositions;\nin vec3 instanceSourcePositions64Low;\nin vec3 instanceTargetPositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin float instanceWidths;\nout vec4 vColor;\nout vec2 uv;\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\nvec2 dir_screenspace = normalize(line_clipspace * project.viewportSize);\ndir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\nreturn dir_screenspace * offset_direction * width / 2.0;\n}\nvec3 splitLine(vec3 a, vec3 b, float x) {\nfloat t = (x - a.x) / (b.x - a.x);\nreturn vec3(x, mix(a.yz, b.yz, t));\n}\nvoid main(void) {\ngeometry.worldPosition = instanceSourcePositions;\ngeometry.worldPositionAlt = instanceTargetPositions;\nvec3 source_world = instanceSourcePositions;\nvec3 target_world = instanceTargetPositions;\nvec3 source_world_64low = instanceSourcePositions64Low;\nvec3 target_world_64low = instanceTargetPositions64Low;\nif (line.useShortestPath > 0.5 || line.useShortestPath < -0.5) {\nsource_world.x = mod(source_world.x + 180., 360.0) - 180.;\ntarget_world.x = mod(target_world.x + 180., 360.0) - 180.;\nfloat deltaLng = target_world.x - source_world.x;\nif (deltaLng * line.useShortestPath > 180.) {\nsource_world.x += 360. * line.useShortestPath;\nsource_world = splitLine(source_world, target_world, 180. * line.useShortestPath);\nsource_world_64low = vec3(0.0);\n} else if (deltaLng * line.useShortestPath < -180.) {\ntarget_world.x += 360. * line.useShortestPath;\ntarget_world = splitLine(source_world, target_world, 180. * line.useShortestPath);\ntarget_world_64low = vec3(0.0);\n} else if (line.useShortestPath < 0.) {\ngl_Position = vec4(0.);\nreturn;\n}\n}\nvec4 source_commonspace;\nvec4 target_commonspace;\nvec4 source = project_position_to_clipspace(source_world, source_world_64low, vec3(0.), source_commonspace);\nvec4 target = project_position_to_clipspace(target_world, target_world_64low, vec3(0.), target_commonspace);\nfloat segmentIndex = positions.x;\nvec4 p = mix(source, target, segmentIndex);\ngeometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\nuv = positions.xy;\ngeometry.uv = uv;\ngeometry.pickingColor = instancePickingColors;\nfloat widthPixels = clamp(\nproject_size_to_pixel(instanceWidths * line.widthScale, line.widthUnits),\nline.widthMinPixels, line.widthMaxPixels\n);\nvec3 offset = vec3(\ngetExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n0.0);\nDECKGL_FILTER_SIZE(offset, geometry);\nDECKGL_FILTER_GL_POSITION(p, geometry);\ngl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\nvColor = vec4(instanceColors.rgb, instanceColors.a * layer.opacity);\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME line-layer-fragment-shader\nprecision highp float;\nin vec4 vColor;\nin vec2 uv;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = uv;\nfragColor = vColor;\nDECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",source:'// ---------- Helper Structures & Functions ----------\n\n// Placeholder filter functions.\nfn deckgl_filter_size(offset: vec3<f32>, geometry: Geometry) -> vec3<f32> {\n return offset;\n}\nfn deckgl_filter_gl_position(p: vec4<f32>, geometry: Geometry) -> vec4<f32> {\n if (picking.isAttribute > 0.5) {\n // For depth picking, write normalized depth into the picking payload.\n // This mirrors the legacy DECKGL_FILTER_GL_POSITION hook on WebGL.\n }\n return p;\n}\n\n// Compute an extrusion offset given a line direction (in clipspace),\n// an offset direction (-1 or 1), and a width in pixels.\n// Assumes a uniform "project" with a viewportSize field is available.\nfn getExtrusionOffset(line_clipspace: vec2<f32>, offset_direction: f32, width: f32) -> vec2<f32> {\n // project.viewportSize should be provided as a uniform (not shown here)\n let dir_screenspace = normalize(line_clipspace * project.viewportSize);\n // Rotate by 90°: (x,y) becomes (-y,x)\n let rotated = vec2<f32>(-dir_screenspace.y, dir_screenspace.x);\n return rotated * offset_direction * width / 2.0;\n}\n\n// Splits the line between two points at a given x coordinate.\n// Interpolates the y and z components.\nfn splitLine(a: vec3<f32>, b: vec3<f32>, x: f32) -> vec3<f32> {\n let t: f32 = (x - a.x) / (b.x - a.x);\n return vec3<f32>(x, a.yz + t * (b.yz - a.yz));\n}\n\n// ---------- Uniforms & Global Structures ----------\n\nstruct LineUniforms {\n widthScale: f32,\n widthMinPixels: f32,\n widthMaxPixels: f32,\n useShortestPath: f32,\n widthUnits: i32,\n};\n\n@group(0) @binding(0)\nvar<uniform> line: LineUniforms;\n\n\n\n// ---------- Vertex Output Structure ----------\n\nstruct Varyings {\n @builtin(position) gl_Position: vec4<f32>,\n @location(0) vColor: vec4<f32>,\n @location(1) uv: vec2<f32>,\n @location(2) pickingColor: vec3<f32>,\n};\n\n// ---------- Vertex Shader Entry Point ----------\n\n@vertex\nfn vertexMain(\n @location(0) positions: vec3<f32>,\n @location(1) instanceSourcePositions: vec3<f32>,\n @location(2) instanceTargetPositions: vec3<f32>,\n @location(3) instanceSourcePositions64Low: vec3<f32>,\n @location(4) instanceTargetPositions64Low: vec3<f32>,\n @location(5) instanceColors: vec4<f32>,\n @location(6) instancePickingColors: vec3<f32>,\n @location(7) instanceWidths: f32\n) -> Varyings {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n\n var source_world: vec3<f32> = instanceSourcePositions;\n var target_world: vec3<f32> = instanceTargetPositions;\n var source_world_64low: vec3<f32> = instanceSourcePositions64Low;\n var target_world_64low: vec3<f32> = instanceTargetPositions64Low;\n\n // Apply shortest-path adjustments if needed.\n if (line.useShortestPath > 0.5 || line.useShortestPath < -0.5) {\n source_world.x = (source_world.x + 180.0 % 360.0) - 180.0;\n target_world.x = (target_world.x + 180.0 % 360.0) - 180.0;\n let deltaLng: f32 = target_world.x - source_world.x;\n\n if (deltaLng * line.useShortestPath > 180.0) {\n source_world.x = source_world.x + 360.0 * line.useShortestPath;\n source_world = splitLine(source_world, target_world, 180.0 * line.useShortestPath);\n source_world_64low = vec3<f32>(0.0, 0.0, 0.0);\n } else if (deltaLng * line.useShortestPath < -180.0) {\n target_world.x = target_world.x + 360.0 * line.useShortestPath;\n target_world = splitLine(source_world, target_world, 180.0 * line.useShortestPath);\n target_world_64low = vec3<f32>(0.0, 0.0, 0.0);\n } else if (line.useShortestPath < 0.0) {\n var abortOut: Varyings;\n abortOut.gl_Position = vec4<f32>(0.0);\n abortOut.vColor = vec4<f32>(0.0);\n abortOut.uv = vec2<f32>(0.0);\n return abortOut;\n }\n }\n\n // Project Pos and target positions to clip space.\n let sourceResult = project_position_to_clipspace_and_commonspace(source_world, source_world_64low, vec3<f32>(0.0));\n let targetResult = project_position_to_clipspace_and_commonspace(target_world, target_world_64low, vec3<f32>(0.0));\n let sourcePos: vec4<f32> = sourceResult.clipPosition;\n let targetPos: vec4<f32> = targetResult.clipPosition;\n let source_commonspace: vec4<f32> = sourceResult.commonPosition;\n let target_commonspace: vec4<f32> = targetResult.commonPosition;\n\n // Interpolate along the line segment.\n let segmentIndex: f32 = positions.x;\n let p: vec4<f32> = sourcePos + segmentIndex * (targetPos - sourcePos);\n geometry.position = source_commonspace + segmentIndex * (target_commonspace - source_commonspace);\n let uv: vec2<f32> = positions.xy;\n geometry.uv = uv;\n geometry.pickingColor = instancePickingColors;\n\n // Determine width in pixels.\n let widthPixels: f32 = clamp(\n project_unit_size_to_pixel(instanceWidths * line.widthScale, line.widthUnits),\n line.widthMinPixels, line.widthMaxPixels\n );\n\n // Compute extrusion offset.\n let extrusion: vec2<f32> = getExtrusionOffset(targetPos.xy - sourcePos.xy, positions.y, widthPixels);\n let offset: vec3<f32> = vec3<f32>(extrusion, 0.0);\n\n // Apply deck.gl filter functions.\n let filteredOffset = deckgl_filter_size(offset, geometry);\n let filteredP = deckgl_filter_gl_position(p, geometry);\n\n let clipOffset: vec2<f32> = project_pixel_size_to_clipspace(filteredOffset.xy);\n let finalPosition: vec4<f32> = filteredP + vec4<f32>(clipOffset, 0.0, 0.0);\n\n // Compute color.\n var vColor: vec4<f32> = vec4<f32>(instanceColors.rgb, instanceColors.a * layer.opacity);\n // vColor = deckgl_filter_color(vColor, geometry);\n\n var output: Varyings;\n output.gl_Position = finalPosition;\n output.vColor = vColor;\n output.uv = uv;\n output.pickingColor = instancePickingColors;\n return output;\n}\n\n@fragment\nfn fragmentMain(\n @location(0) vColor: vec4<f32>,\n @location(1) uv: vec2<f32>,\n @location(2) pickingColor: vec3<f32>\n) -> @location(0) vec4<f32> {\n // Create and initialize geometry with the provided uv.\n var geometry: Geometry;\n geometry.uv = uv;\n\n // Start with the input color.\n var fragColor: vec4<f32> = vColor;\n\n if (picking.isActive > 0.5) {\n if (!picking_isColorValid(pickingColor)) {\n discard;\n }\n return vec4<f32>(pickingColor, 1.0);\n }\n\n if (picking.isHighlightActive > 0.5) {\n let highlightedObjectColor = picking_normalizeColor(picking.highlightedObjectColor);\n if (picking_isColorZero(abs(pickingColor - highlightedObjectColor))) {\n let highLightAlpha = picking.highlightColor.a;\n let blendedAlpha = highLightAlpha + fragColor.a * (1.0 - highLightAlpha);\n if (blendedAlpha > 0.0) {\n let highLightRatio = highLightAlpha / blendedAlpha;\n fragColor = vec4<f32>(\n mix(fragColor.rgb, picking.highlightColor.rgb, highLightRatio),\n blendedAlpha\n );\n } else {\n fragColor = vec4<f32>(fragColor.rgb, 0.0);\n }\n }\n }\n\n // Apply premultiplied alpha as required by transparent canvas\n fragColor = deckgl_premultiplied_alpha(fragColor);\n\n return fragColor;\n}\n',modules:[i,s,r,z]})}get wrapLongitude(){return!1}initializeState(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1}})}updateState(e){super.updateState(e),e.changeFlags.extensionsChanged&&(this.state.model?.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){const{widthUnits:t,widthScale:n,widthMinPixels:o,widthMaxPixels:i,wrapLongitude:s}=this.props,r=this.state.model,a={widthUnits:c[t],widthScale:n,widthMinPixels:o,widthMaxPixels:i,useShortestPath:s?1:0};r.shaderInputs.setProps({line:a}),r.draw(this.context.renderPass),s&&(r.shaderInputs.setProps({line:{...a,useShortestPath:-1}}),r.draw(this.context.renderPass))}_getModel(){return new a(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new t({topology:"triangle-strip",attributes:{positions:{size:3,value:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}}),isInstanced:!0})}}M.layerName="LineLayer",M.defaultProps=O;class E extends l{_updateGeometry(){const e=new u;this.state.fillModel.setGeometry(e)}draw({uniforms:e}){const{elevationScale:t,extruded:n,offset:o,coverage:i,cellSize:s,angle:r,radiusUnits:a}=this.props,l=this.state.fillModel,d={radius:s/2,radiusUnits:c[a],angle:r,offset:o,extruded:n,stroked:!1,coverage:i,elevationScale:t,edgeDistance:1,isStroke:!1,widthUnits:0,widthScale:0,widthMinPixels:0,widthMaxPixels:0};l.shaderInputs.setProps({column:d}),l.draw(this.context.renderPass)}}E.layerName="GridCellLayer",E.defaultProps={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",value:[1,1]}};export{l as ColumnLayer,E as GridCellLayer,M as LineLayer};
2
+ //# sourceMappingURL=index-wdE7uK4l.js.map
@@ -1,4 +1,4 @@
1
- import{i as t,n as e,a as o,A as i,l as r,b as a,r as s,w as n,s as l,t as d,p,S as h,c,d as m}from"./route-view-totems-BHOMtYE0.js";import{S as f}from"./utils-BMph9fmy.js";var u,v,g,y,w,x,b,P,z,I,M,S,k,_,C,W,$,R,F,T,K=Object.defineProperty,N=Object.getOwnPropertyDescriptor,B=t=>{throw TypeError(t)},Z=(t,e,o,i)=>{for(var r,a=i>1?void 0:i?N(e,o):e,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i?r(e,o,a):r(a))||a);return i&&a&&K(e,o,a),a},H=(t,e,o)=>e.has(t)||B("Cannot "+o),D=(t,e,o)=>(H(t,e,"read from private field"),o?o.call(t):e.get(t)),E=(t,e,o)=>e.has(t)?B("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,o),A=(t,e,o,i)=>(H(t,e,"write to private field"),e.set(t,o),o);let j=class extends o{constructor(){super(...arguments),E(this,u,""),E(this,v,""),E(this,g,"es"),E(this,y,!0),E(this,w,""),E(this,x,""),E(this,b,""),E(this,P,!1),E(this,z,"normal"),E(this,I,22.5),E(this,M,22.5),E(this,S,22.5),E(this,k,24),E(this,_,24),E(this,C,24),E(this,W,24),E(this,$,"none"),E(this,R,!0),E(this,F,"top-left"),E(this,T,!1),this._swPath="/mvx-tiles-sw.js",this._swScope="/",this._swRegistration=null,this.sdkController=new f(this),this.analyticsController=i.getInstance(),this.currentFloorId=""}get apiKey(){return D(this,u)}set apiKey(t){A(this,u,t)}get parentPlaceId(){return D(this,v)}set parentPlaceId(t){A(this,v,t)}get locale(){return D(this,g)}set locale(t){A(this,g,t)}get enable3D(){return D(this,y)}set enable3D(t){A(this,y,t)}get placeId(){return D(this,w)}set placeId(t){A(this,w,t)}get institutionId(){return D(this,x)}set institutionId(t){A(this,x,t)}get institutionName(){return D(this,b)}set institutionName(t){A(this,b,t)}get compactMode(){return D(this,P)}set compactMode(t){A(this,P,t)}get zoomButtonSize(){return D(this,z)}set zoomButtonSize(t){A(this,z,t)}get fitMaxZoom(){return D(this,I)}set fitMaxZoom(t){A(this,I,t)}get singlePointMaxZoom(){return D(this,M)}set singlePointMaxZoom(t){A(this,M,t)}get routeFitMaxZoom(){return D(this,S)}set routeFitMaxZoom(t){A(this,S,t)}get cameraPaddingTop(){return D(this,k)}set cameraPaddingTop(t){A(this,k,t)}get cameraPaddingRight(){return D(this,_)}set cameraPaddingRight(t){A(this,_,t)}get cameraPaddingBottom(){return D(this,C)}set cameraPaddingBottom(t){A(this,C,t)}get cameraPaddingLeft(){return D(this,W)}set cameraPaddingLeft(t){A(this,W,t)}get overlayPaddingMode(){return D(this,$)}set overlayPaddingMode(t){A(this,$,t)}get showFloorSelector(){return D(this,R)}set showFloorSelector(t){A(this,R,t)}get floorSelectorPosition(){return D(this,F)}set floorSelectorPosition(t){A(this,F,t)}get floorSelectorDisabled(){return D(this,T)}set floorSelectorDisabled(t){A(this,T,t)}async _loadComponents(){await Promise.all([r(),a()])}mapVxRequestContext(){if("undefined"==typeof window)return{mvxProduct:"webcomponents",institutionId:this.institutionId||void 0,institutionName:this.institutionName||void 0};return{mvxProduct:"webcomponents",baseUrl:`${window.location.origin}${window.location.pathname}`.replace(/\/$/,"")||window.location.origin,parentPlace:this.parentPlaceId||void 0,institutionId:this.institutionId||void 0,institutionName:this.institutionName||void 0,fullUrl:window.location.href}}_tilePrefetchCredentials(){return{apiKey:this.apiKey||this.getAttribute("apiKey")||"",placeId:this.parentPlaceId||this.getAttribute("parentPlaceId")||""}}async _initTileServiceWorker(){if(this._swRegistration=await s(this._swPath,this._swScope),await n(),this._syncTilePrefetch(),!this._stopTileRefresh){const{apiKey:t,placeId:e}=this._tilePrefetchCredentials();this._stopTileRefresh=l(this._swRegistration,{apiKey:t,placeId:e})}}_syncTilePrefetch(){const{apiKey:t,placeId:e}=this._tilePrefetchCredentials();d(this._swRegistration,{apiKey:t,placeId:e})}async firstUpdated(){this._initTileServiceWorker();const t=this._loadComponents(),e=p();await Promise.all([t,e]),this.analyticsController.initialize("map-view-with-modal"),h.initialize("map-view-with-modal")}_mapReadyHandler(){this.sdkController.setMapReady(!0),this.analyticsController.trackEvent("map_ready",this.baseParams())}_cameraInitializedHandler(){this.sdkController.setCameraInitialized(!0),this.analyticsController.trackEvent("camera_initialized",this.baseParams())}_updateFloorHandler(t){const e=t.detail;if(this.currentFloorId===e)return;this.currentFloorId=e,this.sdkController.setFloor(e);const o=this.baseParams();o.floor_id=e,this.analyticsController.trackEvent("floor_change",o)}baseParams(){return{apiKey:this.apiKey,locale:this.locale,parentPlaceId:this.parentPlaceId,placeId:this.placeId,host:window.location.host,pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,referrer:document.referrer,userAgent:navigator.userAgent,screenWidth:window.innerWidth}}getFloorSelectorPositionStyles(){const t={"top-left":"top: 20px; left: 20px;","top-center":"top: 20px; left: 50%; transform: translateX(-50%);","top-right":"top: 20px; right: 20px;","center-left":"top: 50%; left: 20px; transform: translateY(-50%);","center-right":"top: 50%; right: 20px; transform: translateY(-50%);","bottom-left":"bottom: 20px; left: 20px;","bottom-center":"bottom: 20px; left: 50%; transform: translateX(-50%);","bottom-right":"bottom: 20px; right: 20px;"};return t[this.floorSelectorPosition]||t["top-left"]}updated(t){if(this.apiKey&&this.locale&&this.parentPlaceId&&(t.has("apiKey")||t.has("locale")||t.has("parentPlaceId")||t.has("institutionId")||t.has("institutionName"))){const e=this.mapVxRequestContext();this.sdkController.prewarm(this.apiKey,this.locale,this.parentPlaceId,{destinationId:this.placeId,mapvxRequestContext:e}),this.sdkController.initialize(this.apiKey,this.locale,this.parentPlaceId,e),(t.has("apiKey")||t.has("parentPlaceId"))&&this._syncTilePrefetch()}this.placeId&&t.has("placeId")&&this.sdkController.setOriginAndDestination("",this.placeId)}render(){return c`
1
+ import{i as t,n as e,a as o,A as i,l as r,b as a,r as s,w as n,s as l,t as d,p,S as h,c,d as m}from"./route-view-totems-Dvggb-ZM.js";import{S as f}from"./utils-B4ksZYyJ.js";var u,v,g,y,w,x,b,P,z,I,M,S,k,_,C,W,$,R,F,T,K=Object.defineProperty,N=Object.getOwnPropertyDescriptor,B=t=>{throw TypeError(t)},Z=(t,e,o,i)=>{for(var r,a=i>1?void 0:i?N(e,o):e,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i?r(e,o,a):r(a))||a);return i&&a&&K(e,o,a),a},H=(t,e,o)=>e.has(t)||B("Cannot "+o),D=(t,e,o)=>(H(t,e,"read from private field"),o?o.call(t):e.get(t)),E=(t,e,o)=>e.has(t)?B("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,o),A=(t,e,o,i)=>(H(t,e,"write to private field"),e.set(t,o),o);let j=class extends o{constructor(){super(...arguments),E(this,u,""),E(this,v,""),E(this,g,"es"),E(this,y,!0),E(this,w,""),E(this,x,""),E(this,b,""),E(this,P,!1),E(this,z,"normal"),E(this,I,22.5),E(this,M,22.5),E(this,S,22.5),E(this,k,24),E(this,_,24),E(this,C,24),E(this,W,24),E(this,$,"none"),E(this,R,!0),E(this,F,"top-left"),E(this,T,!1),this._swPath="/mvx-tiles-sw.js",this._swScope="/",this._swRegistration=null,this.sdkController=new f(this),this.analyticsController=i.getInstance(),this.currentFloorId=""}get apiKey(){return D(this,u)}set apiKey(t){A(this,u,t)}get parentPlaceId(){return D(this,v)}set parentPlaceId(t){A(this,v,t)}get locale(){return D(this,g)}set locale(t){A(this,g,t)}get enable3D(){return D(this,y)}set enable3D(t){A(this,y,t)}get placeId(){return D(this,w)}set placeId(t){A(this,w,t)}get institutionId(){return D(this,x)}set institutionId(t){A(this,x,t)}get institutionName(){return D(this,b)}set institutionName(t){A(this,b,t)}get compactMode(){return D(this,P)}set compactMode(t){A(this,P,t)}get zoomButtonSize(){return D(this,z)}set zoomButtonSize(t){A(this,z,t)}get fitMaxZoom(){return D(this,I)}set fitMaxZoom(t){A(this,I,t)}get singlePointMaxZoom(){return D(this,M)}set singlePointMaxZoom(t){A(this,M,t)}get routeFitMaxZoom(){return D(this,S)}set routeFitMaxZoom(t){A(this,S,t)}get cameraPaddingTop(){return D(this,k)}set cameraPaddingTop(t){A(this,k,t)}get cameraPaddingRight(){return D(this,_)}set cameraPaddingRight(t){A(this,_,t)}get cameraPaddingBottom(){return D(this,C)}set cameraPaddingBottom(t){A(this,C,t)}get cameraPaddingLeft(){return D(this,W)}set cameraPaddingLeft(t){A(this,W,t)}get overlayPaddingMode(){return D(this,$)}set overlayPaddingMode(t){A(this,$,t)}get showFloorSelector(){return D(this,R)}set showFloorSelector(t){A(this,R,t)}get floorSelectorPosition(){return D(this,F)}set floorSelectorPosition(t){A(this,F,t)}get floorSelectorDisabled(){return D(this,T)}set floorSelectorDisabled(t){A(this,T,t)}async _loadComponents(){await Promise.all([r(),a()])}mapVxRequestContext(){if("undefined"==typeof window)return{mvxProduct:"webcomponents",institutionId:this.institutionId||void 0,institutionName:this.institutionName||void 0};return{mvxProduct:"webcomponents",baseUrl:`${window.location.origin}${window.location.pathname}`.replace(/\/$/,"")||window.location.origin,parentPlace:this.parentPlaceId||void 0,institutionId:this.institutionId||void 0,institutionName:this.institutionName||void 0,fullUrl:window.location.href}}_tilePrefetchCredentials(){return{apiKey:this.apiKey||this.getAttribute("apiKey")||"",placeId:this.parentPlaceId||this.getAttribute("parentPlaceId")||""}}async _initTileServiceWorker(){if(this._swRegistration=await s(this._swPath,this._swScope),await n(),this._syncTilePrefetch(),!this._stopTileRefresh){const{apiKey:t,placeId:e}=this._tilePrefetchCredentials();this._stopTileRefresh=l(this._swRegistration,{apiKey:t,placeId:e})}}_syncTilePrefetch(){const{apiKey:t,placeId:e}=this._tilePrefetchCredentials();d(this._swRegistration,{apiKey:t,placeId:e})}async firstUpdated(){this._initTileServiceWorker();const t=this._loadComponents(),e=p();await Promise.all([t,e]),this.analyticsController.initialize("map-view-with-modal"),h.initialize("map-view-with-modal")}_mapReadyHandler(){this.sdkController.setMapReady(!0),this.analyticsController.trackEvent("map_ready",this.baseParams())}_cameraInitializedHandler(){this.sdkController.setCameraInitialized(!0),this.analyticsController.trackEvent("camera_initialized",this.baseParams())}_updateFloorHandler(t){const e=t.detail;if(this.currentFloorId===e)return;this.currentFloorId=e,this.sdkController.setFloor(e);const o=this.baseParams();o.floor_id=e,this.analyticsController.trackEvent("floor_change",o)}baseParams(){return{apiKey:this.apiKey,locale:this.locale,parentPlaceId:this.parentPlaceId,placeId:this.placeId,host:window.location.host,pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,referrer:document.referrer,userAgent:navigator.userAgent,screenWidth:window.innerWidth}}getFloorSelectorPositionStyles(){const t={"top-left":"top: 20px; left: 20px;","top-center":"top: 20px; left: 50%; transform: translateX(-50%);","top-right":"top: 20px; right: 20px;","center-left":"top: 50%; left: 20px; transform: translateY(-50%);","center-right":"top: 50%; right: 20px; transform: translateY(-50%);","bottom-left":"bottom: 20px; left: 20px;","bottom-center":"bottom: 20px; left: 50%; transform: translateX(-50%);","bottom-right":"bottom: 20px; right: 20px;"};return t[this.floorSelectorPosition]||t["top-left"]}updated(t){if(this.apiKey&&this.locale&&this.parentPlaceId&&(t.has("apiKey")||t.has("locale")||t.has("parentPlaceId")||t.has("institutionId")||t.has("institutionName"))){const e=this.mapVxRequestContext();this.sdkController.prewarm(this.apiKey,this.locale,this.parentPlaceId,{destinationId:this.placeId,mapvxRequestContext:e}),this.sdkController.initialize(this.apiKey,this.locale,this.parentPlaceId,e),(t.has("apiKey")||t.has("parentPlaceId"))&&this._syncTilePrefetch()}this.placeId&&t.has("placeId")&&this.sdkController.setOriginAndDestination("",this.placeId)}render(){return c`
2
2
  <div class="route-container" style="height: 100%; width: 100%; position: relative;">
3
3
  <custom-map
4
4
  class="map-container"
@@ -83,4 +83,4 @@ import{i as t,n as e,a as o,A as i,l as r,b as a,r as s,w as n,s as l,t as d,p,S
83
83
  overflow: hidden;
84
84
  }
85
85
  `],Z([e({type:String})],j.prototype,"apiKey",1),Z([e({type:String})],j.prototype,"parentPlaceId",1),Z([e({type:String})],j.prototype,"locale",1),Z([e({type:Boolean,attribute:"enable-3d"})],j.prototype,"enable3D",1),Z([e({type:String})],j.prototype,"placeId",1),Z([e({type:String,attribute:"institution-id"})],j.prototype,"institutionId",1),Z([e({type:String,attribute:"institution-name"})],j.prototype,"institutionName",1),Z([e({type:Boolean,attribute:"compact-mode",reflect:!0})],j.prototype,"compactMode",1),Z([e({type:String,attribute:"zoom-size",reflect:!0})],j.prototype,"zoomButtonSize",1),Z([e({type:Number,attribute:"fit-max-zoom"})],j.prototype,"fitMaxZoom",1),Z([e({type:Number,attribute:"single-point-max-zoom"})],j.prototype,"singlePointMaxZoom",1),Z([e({type:Number,attribute:"route-fit-max-zoom"})],j.prototype,"routeFitMaxZoom",1),Z([e({type:Number,attribute:"camera-padding-top"})],j.prototype,"cameraPaddingTop",1),Z([e({type:Number,attribute:"camera-padding-right"})],j.prototype,"cameraPaddingRight",1),Z([e({type:Number,attribute:"camera-padding-bottom"})],j.prototype,"cameraPaddingBottom",1),Z([e({type:Number,attribute:"camera-padding-left"})],j.prototype,"cameraPaddingLeft",1),Z([e({type:String,attribute:"overlay-padding-mode"})],j.prototype,"overlayPaddingMode",1),Z([e({type:Boolean})],j.prototype,"showFloorSelector",1),Z([e({type:String})],j.prototype,"floorSelectorPosition",1),Z([e({type:Boolean})],j.prototype,"floorSelectorDisabled",1),j=Z([m("map-view-with-modal")],j);export{j as M};
86
- //# sourceMappingURL=map-view-with-modal-KAG4NGbk.js.map
86
+ //# sourceMappingURL=map-view-with-modal-JYZY7d5R.js.map