@mapvx/web-components 0.0.33 → 0.0.35

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components-BeCPn1I0.js","sources":["../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/context-request-event.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/controllers/context-consumer.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/value-notifier.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/controllers/context-provider.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/decorators/consume.js","../../../src/utils/sdk-context.ts","../../../src/components/custom-map.ts","../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.js","../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/class-map.js","../../../src/components/base-floor-selector.ts","../../../src/components/floor-selector.ts","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js","../../../node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js","../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js","../../../src/components/qr-modal.ts","../../../src/assets/device-mobile-pin.svg?raw","../../../src/components/route-options.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nclass s extends Event{constructor(s,t,e,o){super(\"context-request\",{bubbles:!0,composed:!0}),this.context=s,this.contextTarget=t,this.callback=e,this.subscribe=o??!1}}export{s as ContextRequestEvent};\n//# sourceMappingURL=context-request-event.js.map\n","import{ContextRequestEvent as t}from\"../context-request-event.js\";\n/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class s{constructor(t,s,i,h){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(t,s)=>{this.unsubscribe&&(this.unsubscribe!==s&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=t,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(t,s)),this.unsubscribe=s},this.host=t,void 0!==s.context){const t=s;this.context=t.context,this.callback=t.callback,this.subscribe=t.subscribe??!1}else this.context=s,this.callback=i,this.subscribe=h??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new t(this.context,this.host,this.t,this.subscribe))}}export{s as ContextConsumer};\n//# sourceMappingURL=context-consumer.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nclass s{get value(){return this.o}set value(s){this.setValue(s)}setValue(s,t=!1){const i=t||!Object.is(s,this.o);this.o=s,i&&this.updateObservers()}constructor(s){this.subscriptions=new Map,this.updateObservers=()=>{for(const[s,{disposer:t}]of this.subscriptions)s(this.o,t)},void 0!==s&&(this.value=s)}addCallback(s,t,i){if(!i)return void s(this.value);this.subscriptions.has(s)||this.subscriptions.set(s,{disposer:()=>{this.subscriptions.delete(s)},consumerHost:t});const{disposer:h}=this.subscriptions.get(s);s(this.value,h)}clearCallbacks(){this.subscriptions.clear()}}export{s as ValueNotifier};\n//# sourceMappingURL=value-notifier.js.map\n","import{ContextRequestEvent as t}from\"../context-request-event.js\";import{ValueNotifier as s}from\"../value-notifier.js\";\n/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class e extends Event{constructor(t,s){super(\"context-provider\",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=s}}class i extends s{constructor(s,e,i){super(void 0!==e.context?e.initialValue:i),this.onContextRequest=t=>{if(t.context!==this.context)return;const s=t.contextTarget??t.composedPath()[0];s!==this.host&&(t.stopPropagation(),this.addCallback(t.callback,s,t.subscribe))},this.onProviderRequest=s=>{if(s.context!==this.context)return;if((s.contextTarget??s.composedPath()[0])===this.host)return;const e=new Set;for(const[s,{consumerHost:i}]of this.subscriptions)e.has(s)||(e.add(s),i.dispatchEvent(new t(this.context,i,s,!0)));s.stopPropagation()},this.host=s,void 0!==e.context?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener(\"context-request\",this.onContextRequest),this.host.addEventListener(\"context-provider\",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new e(this.context,this.host))}}export{i as ContextProvider,e as ContextProviderEvent};\n//# sourceMappingURL=context-provider.js.map\n","import{ContextConsumer as t}from\"../controllers/context-consumer.js\";\n/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function c({context:c,subscribe:e}){return(o,n)=>{\"object\"==typeof n?n.addInitializer((function(){new t(this,{context:c,callback:t=>{o.set.call(this,t)},subscribe:e})})):o.constructor.addInitializer((o=>{new t(o,{context:c,callback:t=>{o[n]=t},subscribe:e})}))}}export{c as consume};\n//# sourceMappingURL=consume.js.map\n","import { createContext } from '@lit/context';\nimport { Configuration, InnerFloor, LazarilloSDK, LzPlace, LzRoute } from '@lzdevelopers/my-maps-js';\nimport { MarkerContext } from '../models/marker-context.interface';\n\nexport interface SDKContextType {\n generalConfig?: Configuration;\n sdk?: LazarilloSDK;\n parentPlace?: LzPlace;\n route?: LzRoute;\n currentFloor?: InnerFloor;\n origin?: LzPlace;\n destination?: LzPlace;\n locale?: string;\n parentPlaceId?: string;\n originId?: string;\n destinationId?: string;\n accessibleRoute?: boolean;\n isRouteAnimating?: boolean;\n loadingRoute?: boolean;\n routeError?: string;\n mapReady?: boolean;\n cameraInitialized?: boolean;\n enabledFloors?: InnerFloor[];\n markers: MarkerContext[];\n}\n\nexport const sdkContext = createContext<SDKContextType>('lazarillo-sdk');\n","import { consume } from '@lit/context';\nimport { Configuration, LazarilloMap, MapConfig } from '@lzdevelopers/my-maps-js';\nimport { html, LitElement, unsafeCSS, css } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { MapModalData } from '../models/mapModalData';\nimport { MarkerController } from '../utils/marker-controller';\nimport { RouteAnimationController } from '../utils/route-animation-controller';\nimport { RouteAnimationHandlers } from '../utils/route-animation-handlers';\nimport { sdkContext, SDKContextType } from '../utils/sdk-context';\nimport style from '../styles/custom-map.css?inline';\n\n@customElement('custom-map')\nexport class CustomMap extends LitElement {\n @consume({ context: sdkContext, subscribe: true })\n protected sdkData?: SDKContextType;\n\n /**\n * Extra left padding for fitCoordinates to account for UI overlays (e.g., side panels).\n * This value is added to the base padding when fitting markers or routes.\n */\n @property({ type: Number, attribute: 'padding-left' })\n accessor paddingLeft: number = 0;\n\n static override styles = [\n css`\n :host {\n height: 100%;\n width: 100%;\n }\n `,\n unsafeCSS(style),\n css`\n :host([compact-mode]) {\n border-radius: 12px !important;\n overflow: hidden !important;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;\n border: 2px solid #e9ecef !important;\n }\n\n :host([compact-mode]) #map {\n border-radius: 12px !important;\n }\n\n :host([compact-mode]) .maplibregl-canvas {\n border-radius: 12px !important;\n }\n\n :host([zoom-size='small']) {\n --zoom-button-size: 32px;\n --zoom-button-margin: 8px;\n }\n\n :host([zoom-size='normal']) {\n --zoom-button-size: 40px;\n --zoom-button-margin: 12px;\n }\n\n :host([zoom-size='large']) {\n --zoom-button-size: 48px;\n --zoom-button-margin: 16px;\n }\n\n /* Apply CSS variables to zoom buttons */\n :host([zoom-size='small']) .maplibregl-ctrl {\n width: 32px !important;\n height: 58px !important;\n bottom: 8px !important;\n right: 8px !important;\n }\n\n :host([zoom-size='normal']) .maplibregl-ctrl {\n width: 40px !important;\n height: 72px !important;\n bottom: 12px !important;\n right: 12px !important;\n }\n\n :host([zoom-size='large']) .maplibregl-ctrl {\n width: 48px !important;\n height: 86px !important;\n bottom: 16px !important;\n right: 16px !important;\n }\n\n /* Icon size is independent from container size */\n .maplibregl-ctrl button {\n font-size: var(--zoom-icon-size, 18px) !important;\n }\n\n .maplibregl-ctrl-group button::after {\n font-size: var(--zoom-icon-size, 18px) !important;\n }\n\n /* Zoom button container customizable via CSS variables */\n .maplibregl-ctrl {\n border: var(--zoom-border-width, 0px) solid var(--zoom-border-color, transparent) !important;\n box-shadow: var(--zoom-shadow, none) !important;\n background: var(--zoom-background, #fff) !important;\n }\n\n .maplibregl-ctrl button {\n border: none;\n border-radius: unset;\n }\n\n /* Divider between zoom-in and zoom-out buttons, overridable separately */\n .maplibregl-ctrl-group button + button {\n border-top: var(--zoom-divider-width, var(--zoom-border-width, 0px)) solid\n var(--zoom-divider-color, var(--zoom-border-color, transparent)) !important;\n }\n\n .maplibregl-ctrl button:hover {\n background-color: var(--zoom-hover-bg, var(--zoom-border-color, #251660)) !important;\n color: var(--zoom-hover-color, #fff) !important;\n }\n `,\n ];\n\n private mapReady = false;\n private config: Configuration | undefined;\n private routeAnimationController: RouteAnimationController;\n private markerController: MarkerController;\n private modalData: MapModalData | undefined;\n\n private routeAnimationHandlers: RouteAnimationHandlers = {\n onRouteAnimationFinished: () => {\n this.dispatchEvent(\n new CustomEvent('routeAnimationFinished', {\n bubbles: true,\n composed: true,\n })\n );\n },\n onFloorChange: (floorId: string) => {\n this.dispatchEvent(\n new CustomEvent('floorChange', {\n detail: floorId,\n bubbles: true,\n composed: true,\n })\n );\n },\n onStartRouteAnimation: () => {\n this.dispatchEvent(\n new CustomEvent('startRouteAnimation', {\n bubbles: true,\n composed: true,\n })\n );\n },\n onShowMapModal: (modal: MapModalData) => {\n this.modalData = modal;\n },\n onDismissModal: () => {\n this.modalData = undefined;\n },\n };\n\n constructor() {\n super();\n this.routeAnimationController = new RouteAnimationController(this, this.routeAnimationHandlers);\n this.markerController = new MarkerController(this);\n }\n\n async firstUpdated() {\n if (this.shadowRoot) {\n const style = document.createElement('style');\n style.textContent = (await import('@lzdevelopers/my-maps-js/dist/styles.css?inline')).default;\n this.shadowRoot.appendChild(style);\n }\n }\n\n private mapContainer: HTMLElement | null = null;\n\n lzMap: LazarilloMap | undefined;\n pendingUpdateMarkers = false;\n pendingUpdateCamera = false;\n\n protected override async updated(): Promise<void> {\n // Update attributes according to properties\n this.updateAttributes();\n\n if (!this.sdkData?.sdk) return;\n\n const {\n sdk,\n parentPlace,\n locale,\n generalConfig,\n currentFloor,\n markers,\n route,\n isRouteAnimating,\n cameraInitialized,\n } = this.sdkData;\n if (!this.lzMap && sdk && parentPlace && locale && this.shadowRoot && generalConfig) {\n this.routeAnimationController.setParentPlace(parentPlace);\n this.routeAnimationController.setLocale(locale);\n this.routeAnimationController.setConfig(generalConfig);\n this.mapContainer = this.shadowRoot.getElementById('map') as HTMLElement;\n this.shadowRoot?.appendChild(this.mapContainer);\n this.config = generalConfig;\n const mapConfig: MapConfig = {\n zoom: generalConfig.initialZoom || 18,\n parentPlaceId: parentPlace?.lazarilloId,\n center: generalConfig.initialCenter || { lat: 0, lng: 0 },\n minZoom: generalConfig.limitZoomOut || 15,\n maxZoom: generalConfig.limitZoomIn || 22,\n showCompass: false,\n navigationPosition: 'bottom-right',\n pitch: generalConfig.pitch || 0,\n lang: locale,\n maxBounds: generalConfig.pointsOfInterest || [],\n otherPotentialParentPlacesIds: generalConfig.potentialParentPlaces || [],\n onMapReady: () => {\n this.mapReady = true;\n this.markerController.setMapReady(true);\n this.pendingUpdateCamera = true;\n this.dispatchEvent(\n new CustomEvent('mapReady', {\n detail: {},\n bubbles: true,\n composed: true,\n })\n );\n },\n onFloorChange: (newFloorId: string) => {\n this.setCurrentMapFloor(newFloorId);\n },\n };\n this.lzMap = sdk.createMap(this.mapContainer, mapConfig);\n this.lzMap.setParentPlace(parentPlace, false);\n this.routeAnimationController.setMap(this.lzMap);\n this.routeAnimationController.setExtraLeftPadding(this.paddingLeft);\n this.markerController.setMap(this.lzMap);\n this.markerController.setParentPlace(parentPlace);\n this.markerController.setConfig(generalConfig);\n this.markerController.setExtraLeftPadding(this.paddingLeft);\n }\n\n // Update extra left padding if it changed\n if (this.markerController && this.routeAnimationController) {\n this.markerController.setExtraLeftPadding(this.paddingLeft);\n this.routeAnimationController.setExtraLeftPadding(this.paddingLeft);\n }\n\n // Sync current floor with the context\n if (currentFloor && currentFloor.key !== this._currentMapFloor && this.mapReady) {\n this.setCurrentMapFloor(currentFloor.key);\n }\n // Update markers if they have changed (check both directions for complete comparison)\n const currentMarkerIds = this.markerController.getMarkersIds();\n const newMarkerIds = markers.map(m => m.id);\n const markersChanged =\n markers.length !== currentMarkerIds.length ||\n newMarkerIds.some(id => !currentMarkerIds.includes(id)) ||\n currentMarkerIds.some(id => !newMarkerIds.includes(id));\n\n if (markersChanged) {\n if (this.mapReady) {\n this.updateMarkers();\n } else {\n this.pendingUpdateMarkers = true;\n }\n }\n if (this.pendingUpdateMarkers && this.mapReady) {\n this.updateMarkers();\n }\n if ((this.pendingUpdateCamera || (!cameraInitialized && this.mapReady)) && this.sdkData?.destination) {\n this._initializeCamera();\n this.pendingUpdateCamera = false;\n }\n\n const currentRoute = this.routeAnimationController.getCurrentRoute();\n if (!currentRoute || currentRoute.id !== route?.id) {\n if (currentRoute) {\n this.routeAnimationController.removeRoute();\n }\n if (route) {\n this.routeAnimationController.startRouteAnimation(route);\n }\n }\n if (!this.routeAnimationController.isAnimating() && isRouteAnimating && route) {\n this.routeAnimationController.startRouteAnimation(route);\n }\n }\n private updateMarkers() {\n const markers = this.sdkData?.markers ?? [];\n this.markerController.updateMarkers(markers);\n this.pendingUpdateMarkers = false;\n }\n\n /**\n * Public method to clear all markers from the map.\n * Useful when resetting the component or navigating away.\n */\n public clearAllMarkers() {\n this.markerController.clearAllMarkers();\n }\n\n private _initializeCamera() {\n if (!this.lzMap || !this.mapReady || !this.sdkData) return;\n const { destination, origin, route } = this.sdkData;\n\n // If no route, fit to both origin and destination if on same floor\n if (!route) {\n const originFloor = origin?.inFloors?.[0];\n const destFloor = destination?.inFloors?.[0];\n\n // If both markers are on the same floor, fit to show both\n if (origin && destination && originFloor && destFloor && originFloor === destFloor) {\n const coordinates = [origin.position, destination.position];\n setTimeout(() => {\n this.lzMap?.fitCoordinates(coordinates, {\n padding: {\n top: 200,\n bottom: 200,\n left: 200 + this.paddingLeft,\n right: 200,\n },\n });\n }, 200);\n } else {\n // Different floors or missing data: center on destination (or origin as fallback)\n const center = destination ? destination.position : origin?.position;\n this.lzMap?.updateCamera({\n bearing: this.config?.mapRotations?.[origin?.lazarilloId ?? '']?.angle ?? 0,\n animate: false,\n pitch: this.config?.pitch ?? 0,\n center,\n zoom: this.config?.initialZoom ?? 18,\n });\n }\n } else {\n // With route, fit to route steps on the same floor as origin, including origin/destination markers\n const originFloor = origin?.inFloors?.[0];\n if (originFloor && route.legs) {\n const routeCoordinates = route.legs\n .flatMap(leg => leg.steps)\n .filter(step => step.startInsideFloor === originFloor || step.endInsideFloor === originFloor)\n .flatMap(step => step.coordinates);\n\n // Include origin and destination markers if on the same floor\n const allCoordinates = [...routeCoordinates];\n if (origin?.position && origin?.inFloors?.[0] === originFloor) {\n allCoordinates.push(origin.position);\n }\n if (destination?.position && destination?.inFloors?.[0] === originFloor) {\n allCoordinates.push(destination.position);\n }\n\n if (allCoordinates.length > 0) {\n setTimeout(() => {\n this.lzMap?.fitCoordinates(allCoordinates, {\n padding: {\n top: 200,\n bottom: 200,\n left: 200 + this.paddingLeft,\n right: 200,\n },\n });\n }, 200);\n } else {\n // Fallback if no coordinates on origin floor\n const center = destination ? destination.position : origin?.position;\n this.lzMap?.updateCamera({\n bearing: this.config?.mapRotations?.[origin?.lazarilloId ?? '']?.angle ?? 0,\n animate: false,\n pitch: this.config?.pitch ?? 0,\n center,\n zoom: this.config?.initialZoom ?? 18,\n });\n }\n } else {\n // Fallback if no origin floor or route legs\n const center = destination ? destination.position : origin?.position;\n this.lzMap?.updateCamera({\n bearing: this.config?.mapRotations?.[origin?.lazarilloId ?? '']?.angle ?? 0,\n animate: false,\n pitch: this.config?.pitch ?? 0,\n center,\n zoom: this.config?.initialZoom ?? 18,\n });\n }\n }\n\n const floor = destination?.inFloors?.[0];\n if (floor) {\n this.lzMap?.updateFloor(floor);\n }\n\n // Dispatch camera initialized event\n // Important:\n // This event indicates the camera has been initialized and the map is ready to be used.\n // The parent component should listen and update context.\n // Clients should also listen to know when the map is ready and remove loading UI.\n this.dispatchEvent(\n new CustomEvent('cameraInitialized', {\n detail: {},\n bubbles: true,\n composed: true,\n })\n );\n }\n\n private _currentMapFloor: string | undefined;\n\n private setCurrentMapFloor(floorId: string) {\n if (this._currentMapFloor === floorId || !this.lzMap) return;\n this._currentMapFloor = floorId;\n this.lzMap?.updateFloor(floorId);\n this.routeAnimationController.setCurrentFloor(floorId);\n this.dispatchEvent(\n new CustomEvent('floorChange', {\n detail: floorId,\n bubbles: true,\n composed: true,\n })\n );\n }\n\n private updateAttributes() {\n // Get attributes from the parent component\n const parentElement = this.closest('map-view-with-modal');\n if (parentElement) {\n const compactMode = parentElement.hasAttribute('compact-mode');\n const zoomSize = parentElement.getAttribute('zoom-size') || 'normal';\n\n // Apply attributes to the host\n if (compactMode) {\n this.setAttribute('compact-mode', '');\n } else {\n this.removeAttribute('compact-mode');\n }\n\n this.setAttribute('zoom-size', zoomSize);\n }\n }\n\n override render() {\n return html`<div id=\"map\"></div>\n <div id=\"modal\" style=\"display: ${this.modalData ? 'flex' : 'none'}\">\n <div class=\"modal-content\">\n <img class=\"modal-icon\" .src=${this.modalData?.iconPath}></img>\n <p class=\"modal-text\">${this.modalData?.title}</p>\n </div>\n </div>`;\n }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};\n//# sourceMappingURL=directive.js.map\n","import{noChange as t}from\"../lit-html.js\";import{directive as s,Directive as i,PartType as r}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=s(class extends i{constructor(t){if(super(t),t.type!==r.ATTRIBUTE||\"class\"!==t.name||t.strings?.length>2)throw Error(\"`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.\")}render(t){return\" \"+Object.keys(t).filter(s=>t[s]).join(\" \")+\" \"}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(\" \").split(/\\s/).filter(t=>\"\"!==t)));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return t}});export{e as classMap};\n//# sourceMappingURL=class-map.js.map\n","import { consume } from '@lit/context';\nimport { LitElement } from 'lit';\nimport { sdkContext, SDKContextType } from '../utils/sdk-context';\nimport { InnerFloor } from '@lzdevelopers/my-maps-js';\n\nexport abstract class BaseFloorSelector extends LitElement {\n @consume({ context: sdkContext, subscribe: true })\n protected sdkData?: SDKContextType;\n\n protected getFloors(): InnerFloor[] {\n if (!this.sdkData) return [];\n\n const { parentPlace, generalConfig } = this.sdkData;\n let floors: InnerFloor[] = parentPlace?.innerFloors || [];\n\n if (generalConfig?.enabledFloors?.length > 0) {\n floors = floors.filter(floor => generalConfig.enabledFloors.includes(floor.key));\n }\n\n return floors;\n }\n\n protected getCurrentFloor(): InnerFloor | undefined {\n return this.sdkData?.currentFloor;\n }\n\n protected getEnabledFloors(): InnerFloor[] {\n return this.sdkData?.enabledFloors || [];\n }\n\n protected isFloorActive(floor: InnerFloor): boolean {\n const currentFloor = this.getCurrentFloor();\n return floor.key === currentFloor?.key;\n }\n\n protected isFloorEnabled(floor: InnerFloor): boolean {\n const enabledFloors = this.getEnabledFloors();\n return enabledFloors.some(f => f.key === floor.key);\n }\n\n protected selectFloor(floorKey: string) {\n this.dispatchEvent(\n new CustomEvent('floorChange', {\n detail: floorKey,\n bubbles: true,\n composed: true,\n })\n );\n }\n\n protected getFloorDisplayName(floor: InnerFloor): string {\n return floor.name || floor.title || floor.key;\n }\n}\n","import { html, unsafeCSS } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { BaseFloorSelector } from './base-floor-selector';\nimport style from '../styles/floor-selector.css?inline';\n\n@customElement('floor-selector')\nexport class FloorSelector extends BaseFloorSelector {\n static override styles = [unsafeCSS(style)];\n\n override render() {\n if (!this.sdkData) {\n return html`<div>No data</div>`;\n }\n\n const floors = this.getFloors();\n\n return html`\n <div class=\"floor-selector-container\">\n ${floors.map(floor => {\n const isActive = this.isFloorActive(floor);\n const isEnabled = this.isFloorEnabled(floor);\n\n return html`\n <div class=\"floor-btn-container\">\n <button\n class=${classMap({\n 'floor-btn': true,\n active: isActive,\n disabled: !isActive && !isEnabled,\n })}\n @click=${() => (isEnabled ? this.selectFloor(floor.key) : null)}\n >\n <span>${this.getFloorDisplayName(floor)}</span>\n </button>\n </div>\n `;\n })}\n </div>\n `;\n }\n}\n","// can-promise has a crash in some versions of react native that dont have\n// standard global objects\n// https://github.com/soldair/node-qrcode/issues/157\n\nmodule.exports = function () {\n return typeof Promise === 'function' && Promise.prototype && Promise.prototype.then\n}\n","let toSJISFunction\nconst CODEWORDS_COUNT = [\n 0, // Not used\n 26, 44, 70, 100, 134, 172, 196, 242, 292, 346,\n 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085,\n 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185,\n 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706\n]\n\n/**\n * Returns the QR Code size for the specified version\n *\n * @param {Number} version QR Code version\n * @return {Number} size of QR code\n */\nexports.getSymbolSize = function getSymbolSize (version) {\n if (!version) throw new Error('\"version\" cannot be null or undefined')\n if (version < 1 || version > 40) throw new Error('\"version\" should be in range from 1 to 40')\n return version * 4 + 17\n}\n\n/**\n * Returns the total number of codewords used to store data and EC information.\n *\n * @param {Number} version QR Code version\n * @return {Number} Data length in bits\n */\nexports.getSymbolTotalCodewords = function getSymbolTotalCodewords (version) {\n return CODEWORDS_COUNT[version]\n}\n\n/**\n * Encode data with Bose-Chaudhuri-Hocquenghem\n *\n * @param {Number} data Value to encode\n * @return {Number} Encoded value\n */\nexports.getBCHDigit = function (data) {\n let digit = 0\n\n while (data !== 0) {\n digit++\n data >>>= 1\n }\n\n return digit\n}\n\nexports.setToSJISFunction = function setToSJISFunction (f) {\n if (typeof f !== 'function') {\n throw new Error('\"toSJISFunc\" is not a valid function.')\n }\n\n toSJISFunction = f\n}\n\nexports.isKanjiModeEnabled = function () {\n return typeof toSJISFunction !== 'undefined'\n}\n\nexports.toSJIS = function toSJIS (kanji) {\n return toSJISFunction(kanji)\n}\n","exports.L = { bit: 1 }\nexports.M = { bit: 0 }\nexports.Q = { bit: 3 }\nexports.H = { bit: 2 }\n\nfunction fromString (string) {\n if (typeof string !== 'string') {\n throw new Error('Param is not a string')\n }\n\n const lcStr = string.toLowerCase()\n\n switch (lcStr) {\n case 'l':\n case 'low':\n return exports.L\n\n case 'm':\n case 'medium':\n return exports.M\n\n case 'q':\n case 'quartile':\n return exports.Q\n\n case 'h':\n case 'high':\n return exports.H\n\n default:\n throw new Error('Unknown EC Level: ' + string)\n }\n}\n\nexports.isValid = function isValid (level) {\n return level && typeof level.bit !== 'undefined' &&\n level.bit >= 0 && level.bit < 4\n}\n\nexports.from = function from (value, defaultValue) {\n if (exports.isValid(value)) {\n return value\n }\n\n try {\n return fromString(value)\n } catch (e) {\n return defaultValue\n }\n}\n","const ECLevel = require('./error-correction-level')\r\n\r\nconst EC_BLOCKS_TABLE = [\r\n// L M Q H\r\n 1, 1, 1, 1,\r\n 1, 1, 1, 1,\r\n 1, 1, 2, 2,\r\n 1, 2, 2, 4,\r\n 1, 2, 4, 4,\r\n 2, 4, 4, 4,\r\n 2, 4, 6, 5,\r\n 2, 4, 6, 6,\r\n 2, 5, 8, 8,\r\n 4, 5, 8, 8,\r\n 4, 5, 8, 11,\r\n 4, 8, 10, 11,\r\n 4, 9, 12, 16,\r\n 4, 9, 16, 16,\r\n 6, 10, 12, 18,\r\n 6, 10, 17, 16,\r\n 6, 11, 16, 19,\r\n 6, 13, 18, 21,\r\n 7, 14, 21, 25,\r\n 8, 16, 20, 25,\r\n 8, 17, 23, 25,\r\n 9, 17, 23, 34,\r\n 9, 18, 25, 30,\r\n 10, 20, 27, 32,\r\n 12, 21, 29, 35,\r\n 12, 23, 34, 37,\r\n 12, 25, 34, 40,\r\n 13, 26, 35, 42,\r\n 14, 28, 38, 45,\r\n 15, 29, 40, 48,\r\n 16, 31, 43, 51,\r\n 17, 33, 45, 54,\r\n 18, 35, 48, 57,\r\n 19, 37, 51, 60,\r\n 19, 38, 53, 63,\r\n 20, 40, 56, 66,\r\n 21, 43, 59, 70,\r\n 22, 45, 62, 74,\r\n 24, 47, 65, 77,\r\n 25, 49, 68, 81\r\n]\r\n\r\nconst EC_CODEWORDS_TABLE = [\r\n// L M Q H\r\n 7, 10, 13, 17,\r\n 10, 16, 22, 28,\r\n 15, 26, 36, 44,\r\n 20, 36, 52, 64,\r\n 26, 48, 72, 88,\r\n 36, 64, 96, 112,\r\n 40, 72, 108, 130,\r\n 48, 88, 132, 156,\r\n 60, 110, 160, 192,\r\n 72, 130, 192, 224,\r\n 80, 150, 224, 264,\r\n 96, 176, 260, 308,\r\n 104, 198, 288, 352,\r\n 120, 216, 320, 384,\r\n 132, 240, 360, 432,\r\n 144, 280, 408, 480,\r\n 168, 308, 448, 532,\r\n 180, 338, 504, 588,\r\n 196, 364, 546, 650,\r\n 224, 416, 600, 700,\r\n 224, 442, 644, 750,\r\n 252, 476, 690, 816,\r\n 270, 504, 750, 900,\r\n 300, 560, 810, 960,\r\n 312, 588, 870, 1050,\r\n 336, 644, 952, 1110,\r\n 360, 700, 1020, 1200,\r\n 390, 728, 1050, 1260,\r\n 420, 784, 1140, 1350,\r\n 450, 812, 1200, 1440,\r\n 480, 868, 1290, 1530,\r\n 510, 924, 1350, 1620,\r\n 540, 980, 1440, 1710,\r\n 570, 1036, 1530, 1800,\r\n 570, 1064, 1590, 1890,\r\n 600, 1120, 1680, 1980,\r\n 630, 1204, 1770, 2100,\r\n 660, 1260, 1860, 2220,\r\n 720, 1316, 1950, 2310,\r\n 750, 1372, 2040, 2430\r\n]\r\n\r\n/**\r\n * Returns the number of error correction block that the QR Code should contain\r\n * for the specified version and error correction level.\r\n *\r\n * @param {Number} version QR Code version\r\n * @param {Number} errorCorrectionLevel Error correction level\r\n * @return {Number} Number of error correction blocks\r\n */\r\nexports.getBlocksCount = function getBlocksCount (version, errorCorrectionLevel) {\r\n switch (errorCorrectionLevel) {\r\n case ECLevel.L:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 0]\r\n case ECLevel.M:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 1]\r\n case ECLevel.Q:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 2]\r\n case ECLevel.H:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 3]\r\n default:\r\n return undefined\r\n }\r\n}\r\n\r\n/**\r\n * Returns the number of error correction codewords to use for the specified\r\n * version and error correction level.\r\n *\r\n * @param {Number} version QR Code version\r\n * @param {Number} errorCorrectionLevel Error correction level\r\n * @return {Number} Number of error correction codewords\r\n */\r\nexports.getTotalCodewordsCount = function getTotalCodewordsCount (version, errorCorrectionLevel) {\r\n switch (errorCorrectionLevel) {\r\n case ECLevel.L:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 0]\r\n case ECLevel.M:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 1]\r\n case ECLevel.Q:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 2]\r\n case ECLevel.H:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 3]\r\n default:\r\n return undefined\r\n }\r\n}\r\n","const GF = require('./galois-field')\n\n/**\n * Multiplies two polynomials inside Galois Field\n *\n * @param {Uint8Array} p1 Polynomial\n * @param {Uint8Array} p2 Polynomial\n * @return {Uint8Array} Product of p1 and p2\n */\nexports.mul = function mul (p1, p2) {\n const coeff = new Uint8Array(p1.length + p2.length - 1)\n\n for (let i = 0; i < p1.length; i++) {\n for (let j = 0; j < p2.length; j++) {\n coeff[i + j] ^= GF.mul(p1[i], p2[j])\n }\n }\n\n return coeff\n}\n\n/**\n * Calculate the remainder of polynomials division\n *\n * @param {Uint8Array} divident Polynomial\n * @param {Uint8Array} divisor Polynomial\n * @return {Uint8Array} Remainder\n */\nexports.mod = function mod (divident, divisor) {\n let result = new Uint8Array(divident)\n\n while ((result.length - divisor.length) >= 0) {\n const coeff = result[0]\n\n for (let i = 0; i < divisor.length; i++) {\n result[i] ^= GF.mul(divisor[i], coeff)\n }\n\n // remove all zeros from buffer head\n let offset = 0\n while (offset < result.length && result[offset] === 0) offset++\n result = result.slice(offset)\n }\n\n return result\n}\n\n/**\n * Generate an irreducible generator polynomial of specified degree\n * (used by Reed-Solomon encoder)\n *\n * @param {Number} degree Degree of the generator polynomial\n * @return {Uint8Array} Buffer containing polynomial coefficients\n */\nexports.generateECPolynomial = function generateECPolynomial (degree) {\n let poly = new Uint8Array([1])\n for (let i = 0; i < degree; i++) {\n poly = exports.mul(poly, new Uint8Array([1, GF.exp(i)]))\n }\n\n return poly\n}\n","const EXP_TABLE = new Uint8Array(512)\nconst LOG_TABLE = new Uint8Array(256)\n/**\n * Precompute the log and anti-log tables for faster computation later\n *\n * For each possible value in the galois field 2^8, we will pre-compute\n * the logarithm and anti-logarithm (exponential) of this value\n *\n * ref {@link https://en.wikiversity.org/wiki/Reed%E2%80%93Solomon_codes_for_coders#Introduction_to_mathematical_fields}\n */\n;(function initTables () {\n let x = 1\n for (let i = 0; i < 255; i++) {\n EXP_TABLE[i] = x\n LOG_TABLE[x] = i\n\n x <<= 1 // multiply by 2\n\n // The QR code specification says to use byte-wise modulo 100011101 arithmetic.\n // This means that when a number is 256 or larger, it should be XORed with 0x11D.\n if (x & 0x100) { // similar to x >= 256, but a lot faster (because 0x100 == 256)\n x ^= 0x11D\n }\n }\n\n // Optimization: double the size of the anti-log table so that we don't need to mod 255 to\n // stay inside the bounds (because we will mainly use this table for the multiplication of\n // two GF numbers, no more).\n // @see {@link mul}\n for (let i = 255; i < 512; i++) {\n EXP_TABLE[i] = EXP_TABLE[i - 255]\n }\n}())\n\n/**\n * Returns log value of n inside Galois Field\n *\n * @param {Number} n\n * @return {Number}\n */\nexports.log = function log (n) {\n if (n < 1) throw new Error('log(' + n + ')')\n return LOG_TABLE[n]\n}\n\n/**\n * Returns anti-log value of n inside Galois Field\n *\n * @param {Number} n\n * @return {Number}\n */\nexports.exp = function exp (n) {\n return EXP_TABLE[n]\n}\n\n/**\n * Multiplies two number inside Galois Field\n *\n * @param {Number} x\n * @param {Number} y\n * @return {Number}\n */\nexports.mul = function mul (x, y) {\n if (x === 0 || y === 0) return 0\n\n // should be EXP_TABLE[(LOG_TABLE[x] + LOG_TABLE[y]) % 255] if EXP_TABLE wasn't oversized\n // @see {@link initTables}\n return EXP_TABLE[LOG_TABLE[x] + LOG_TABLE[y]]\n}\n","/**\n * Check if QR Code version is valid\n *\n * @param {Number} version QR Code version\n * @return {Boolean} true if valid version, false otherwise\n */\nexports.isValid = function isValid (version) {\n return !isNaN(version) && version >= 1 && version <= 40\n}\n","const numeric = '[0-9]+'\nconst alphanumeric = '[A-Z $%*+\\\\-./:]+'\nlet kanji = '(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|' +\n '[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|' +\n '[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|' +\n '[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+'\nkanji = kanji.replace(/u/g, '\\\\u')\n\nconst byte = '(?:(?![A-Z0-9 $%*+\\\\-./:]|' + kanji + ')(?:.|[\\r\\n]))+'\n\nexports.KANJI = new RegExp(kanji, 'g')\nexports.BYTE_KANJI = new RegExp('[^A-Z0-9 $%*+\\\\-./:]+', 'g')\nexports.BYTE = new RegExp(byte, 'g')\nexports.NUMERIC = new RegExp(numeric, 'g')\nexports.ALPHANUMERIC = new RegExp(alphanumeric, 'g')\n\nconst TEST_KANJI = new RegExp('^' + kanji + '$')\nconst TEST_NUMERIC = new RegExp('^' + numeric + '$')\nconst TEST_ALPHANUMERIC = new RegExp('^[A-Z0-9 $%*+\\\\-./:]+$')\n\nexports.testKanji = function testKanji (str) {\n return TEST_KANJI.test(str)\n}\n\nexports.testNumeric = function testNumeric (str) {\n return TEST_NUMERIC.test(str)\n}\n\nexports.testAlphanumeric = function testAlphanumeric (str) {\n return TEST_ALPHANUMERIC.test(str)\n}\n","const VersionCheck = require('./version-check')\nconst Regex = require('./regex')\n\n/**\n * Numeric mode encodes data from the decimal digit set (0 - 9)\n * (byte values 30HEX to 39HEX).\n * Normally, 3 data characters are represented by 10 bits.\n *\n * @type {Object}\n */\nexports.NUMERIC = {\n id: 'Numeric',\n bit: 1 << 0,\n ccBits: [10, 12, 14]\n}\n\n/**\n * Alphanumeric mode encodes data from a set of 45 characters,\n * i.e. 10 numeric digits (0 - 9),\n * 26 alphabetic characters (A - Z),\n * and 9 symbols (SP, $, %, *, +, -, ., /, :).\n * Normally, two input characters are represented by 11 bits.\n *\n * @type {Object}\n */\nexports.ALPHANUMERIC = {\n id: 'Alphanumeric',\n bit: 1 << 1,\n ccBits: [9, 11, 13]\n}\n\n/**\n * In byte mode, data is encoded at 8 bits per character.\n *\n * @type {Object}\n */\nexports.BYTE = {\n id: 'Byte',\n bit: 1 << 2,\n ccBits: [8, 16, 16]\n}\n\n/**\n * The Kanji mode efficiently encodes Kanji characters in accordance with\n * the Shift JIS system based on JIS X 0208.\n * The Shift JIS values are shifted from the JIS X 0208 values.\n * JIS X 0208 gives details of the shift coded representation.\n * Each two-byte character value is compacted to a 13-bit binary codeword.\n *\n * @type {Object}\n */\nexports.KANJI = {\n id: 'Kanji',\n bit: 1 << 3,\n ccBits: [8, 10, 12]\n}\n\n/**\n * Mixed mode will contain a sequences of data in a combination of any of\n * the modes described above\n *\n * @type {Object}\n */\nexports.MIXED = {\n bit: -1\n}\n\n/**\n * Returns the number of bits needed to store the data length\n * according to QR Code specifications.\n *\n * @param {Mode} mode Data mode\n * @param {Number} version QR Code version\n * @return {Number} Number of bits\n */\nexports.getCharCountIndicator = function getCharCountIndicator (mode, version) {\n if (!mode.ccBits) throw new Error('Invalid mode: ' + mode)\n\n if (!VersionCheck.isValid(version)) {\n throw new Error('Invalid version: ' + version)\n }\n\n if (version >= 1 && version < 10) return mode.ccBits[0]\n else if (version < 27) return mode.ccBits[1]\n return mode.ccBits[2]\n}\n\n/**\n * Returns the most efficient mode to store the specified data\n *\n * @param {String} dataStr Input data string\n * @return {Mode} Best mode\n */\nexports.getBestModeForData = function getBestModeForData (dataStr) {\n if (Regex.testNumeric(dataStr)) return exports.NUMERIC\n else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC\n else if (Regex.testKanji(dataStr)) return exports.KANJI\n else return exports.BYTE\n}\n\n/**\n * Return mode name as string\n *\n * @param {Mode} mode Mode object\n * @returns {String} Mode name\n */\nexports.toString = function toString (mode) {\n if (mode && mode.id) return mode.id\n throw new Error('Invalid mode')\n}\n\n/**\n * Check if input param is a valid mode object\n *\n * @param {Mode} mode Mode object\n * @returns {Boolean} True if valid mode, false otherwise\n */\nexports.isValid = function isValid (mode) {\n return mode && mode.bit && mode.ccBits\n}\n\n/**\n * Get mode object from its name\n *\n * @param {String} string Mode name\n * @returns {Mode} Mode object\n */\nfunction fromString (string) {\n if (typeof string !== 'string') {\n throw new Error('Param is not a string')\n }\n\n const lcStr = string.toLowerCase()\n\n switch (lcStr) {\n case 'numeric':\n return exports.NUMERIC\n case 'alphanumeric':\n return exports.ALPHANUMERIC\n case 'kanji':\n return exports.KANJI\n case 'byte':\n return exports.BYTE\n default:\n throw new Error('Unknown mode: ' + string)\n }\n}\n\n/**\n * Returns mode from a value.\n * If value is not a valid mode, returns defaultValue\n *\n * @param {Mode|String} value Encoding mode\n * @param {Mode} defaultValue Fallback value\n * @return {Mode} Encoding mode\n */\nexports.from = function from (value, defaultValue) {\n if (exports.isValid(value)) {\n return value\n }\n\n try {\n return fromString(value)\n } catch (e) {\n return defaultValue\n }\n}\n","const Utils = require('./utils')\nconst ECCode = require('./error-correction-code')\nconst ECLevel = require('./error-correction-level')\nconst Mode = require('./mode')\nconst VersionCheck = require('./version-check')\n\n// Generator polynomial used to encode version information\nconst G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0)\nconst G18_BCH = Utils.getBCHDigit(G18)\n\nfunction getBestVersionForDataLength (mode, length, errorCorrectionLevel) {\n for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, mode)) {\n return currentVersion\n }\n }\n\n return undefined\n}\n\nfunction getReservedBitsCount (mode, version) {\n // Character count indicator + mode indicator bits\n return Mode.getCharCountIndicator(mode, version) + 4\n}\n\nfunction getTotalBitsFromDataArray (segments, version) {\n let totalBits = 0\n\n segments.forEach(function (data) {\n const reservedBits = getReservedBitsCount(data.mode, version)\n totalBits += reservedBits + data.getBitsLength()\n })\n\n return totalBits\n}\n\nfunction getBestVersionForMixedData (segments, errorCorrectionLevel) {\n for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n const length = getTotalBitsFromDataArray(segments, currentVersion)\n if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) {\n return currentVersion\n }\n }\n\n return undefined\n}\n\n/**\n * Returns version number from a value.\n * If value is not a valid version, returns defaultValue\n *\n * @param {Number|String} value QR Code version\n * @param {Number} defaultValue Fallback value\n * @return {Number} QR Code version number\n */\nexports.from = function from (value, defaultValue) {\n if (VersionCheck.isValid(value)) {\n return parseInt(value, 10)\n }\n\n return defaultValue\n}\n\n/**\n * Returns how much data can be stored with the specified QR code version\n * and error correction level\n *\n * @param {Number} version QR Code version (1-40)\n * @param {Number} errorCorrectionLevel Error correction level\n * @param {Mode} mode Data mode\n * @return {Number} Quantity of storable data\n */\nexports.getCapacity = function getCapacity (version, errorCorrectionLevel, mode) {\n if (!VersionCheck.isValid(version)) {\n throw new Error('Invalid QR Code version')\n }\n\n // Use Byte mode as default\n if (typeof mode === 'undefined') mode = Mode.BYTE\n\n // Total codewords for this QR code version (Data + Error correction)\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n\n // Total number of error correction codewords\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n\n // Total number of data codewords\n const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8\n\n if (mode === Mode.MIXED) return dataTotalCodewordsBits\n\n const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version)\n\n // Return max number of storable codewords\n switch (mode) {\n case Mode.NUMERIC:\n return Math.floor((usableBits / 10) * 3)\n\n case Mode.ALPHANUMERIC:\n return Math.floor((usableBits / 11) * 2)\n\n case Mode.KANJI:\n return Math.floor(usableBits / 13)\n\n case Mode.BYTE:\n default:\n return Math.floor(usableBits / 8)\n }\n}\n\n/**\n * Returns the minimum version needed to contain the amount of data\n *\n * @param {Segment} data Segment of data\n * @param {Number} [errorCorrectionLevel=H] Error correction level\n * @param {Mode} mode Data mode\n * @return {Number} QR Code version\n */\nexports.getBestVersionForData = function getBestVersionForData (data, errorCorrectionLevel) {\n let seg\n\n const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M)\n\n if (Array.isArray(data)) {\n if (data.length > 1) {\n return getBestVersionForMixedData(data, ecl)\n }\n\n if (data.length === 0) {\n return 1\n }\n\n seg = data[0]\n } else {\n seg = data\n }\n\n return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl)\n}\n\n/**\n * Returns version information with relative error correction bits\n *\n * The version information is included in QR Code symbols of version 7 or larger.\n * It consists of an 18-bit sequence containing 6 data bits,\n * with 12 error correction bits calculated using the (18, 6) Golay code.\n *\n * @param {Number} version QR Code version\n * @return {Number} Encoded version info bits\n */\nexports.getEncodedBits = function getEncodedBits (version) {\n if (!VersionCheck.isValid(version) || version < 7) {\n throw new Error('Invalid QR Code version')\n }\n\n let d = version << 12\n\n while (Utils.getBCHDigit(d) - G18_BCH >= 0) {\n d ^= (G18 << (Utils.getBCHDigit(d) - G18_BCH))\n }\n\n return (version << 12) | d\n}\n","'use strict';\n\n/******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n * Wyatt Baldwin <self@wyattbaldwin.com>\n * All rights reserved\n *\n * Licensed under the MIT license.\n *\n * http://www.opensource.org/licenses/mit-license.php\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *****************************************************************************/\nvar dijkstra = {\n single_source_shortest_paths: function(graph, s, d) {\n // Predecessor map for each node that has been encountered.\n // node ID => predecessor node ID\n var predecessors = {};\n\n // Costs of shortest paths from s to all nodes encountered.\n // node ID => cost\n var costs = {};\n costs[s] = 0;\n\n // Costs of shortest paths from s to all nodes encountered; differs from\n // `costs` in that it provides easy access to the node that currently has\n // the known shortest path from s.\n // XXX: Do we actually need both `costs` and `open`?\n var open = dijkstra.PriorityQueue.make();\n open.push(s, 0);\n\n var closest,\n u, v,\n cost_of_s_to_u,\n adjacent_nodes,\n cost_of_e,\n cost_of_s_to_u_plus_cost_of_e,\n cost_of_s_to_v,\n first_visit;\n while (!open.empty()) {\n // In the nodes remaining in graph that have a known cost from s,\n // find the node, u, that currently has the shortest path from s.\n closest = open.pop();\n u = closest.value;\n cost_of_s_to_u = closest.cost;\n\n // Get nodes adjacent to u...\n adjacent_nodes = graph[u] || {};\n\n // ...and explore the edges that connect u to those nodes, updating\n // the cost of the shortest paths to any or all of those nodes as\n // necessary. v is the node across the current edge from u.\n for (v in adjacent_nodes) {\n if (adjacent_nodes.hasOwnProperty(v)) {\n // Get the cost of the edge running from u to v.\n cost_of_e = adjacent_nodes[v];\n\n // Cost of s to u plus the cost of u to v across e--this is *a*\n // cost from s to v that may or may not be less than the current\n // known cost to v.\n cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n // If we haven't visited v yet OR if the current known cost from s to\n // v is greater than the new cost we just found (cost of s to u plus\n // cost of u to v across e), update v's cost in the cost list and\n // update v's predecessor in the predecessor list (it's now u).\n cost_of_s_to_v = costs[v];\n first_visit = (typeof costs[v] === 'undefined');\n if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n costs[v] = cost_of_s_to_u_plus_cost_of_e;\n open.push(v, cost_of_s_to_u_plus_cost_of_e);\n predecessors[v] = u;\n }\n }\n }\n }\n\n if (typeof d !== 'undefined' && typeof costs[d] === 'undefined') {\n var msg = ['Could not find a path from ', s, ' to ', d, '.'].join('');\n throw new Error(msg);\n }\n\n return predecessors;\n },\n\n extract_shortest_path_from_predecessor_list: function(predecessors, d) {\n var nodes = [];\n var u = d;\n var predecessor;\n while (u) {\n nodes.push(u);\n predecessor = predecessors[u];\n u = predecessors[u];\n }\n nodes.reverse();\n return nodes;\n },\n\n find_path: function(graph, s, d) {\n var predecessors = dijkstra.single_source_shortest_paths(graph, s, d);\n return dijkstra.extract_shortest_path_from_predecessor_list(\n predecessors, d);\n },\n\n /**\n * A very naive priority queue implementation.\n */\n PriorityQueue: {\n make: function (opts) {\n var T = dijkstra.PriorityQueue,\n t = {},\n key;\n opts = opts || {};\n for (key in T) {\n if (T.hasOwnProperty(key)) {\n t[key] = T[key];\n }\n }\n t.queue = [];\n t.sorter = opts.sorter || T.default_sorter;\n return t;\n },\n\n default_sorter: function (a, b) {\n return a.cost - b.cost;\n },\n\n /**\n * Add a new item to the queue and ensure the highest priority element\n * is at the front of the queue.\n */\n push: function (value, cost) {\n var item = {value: value, cost: cost};\n this.queue.push(item);\n this.queue.sort(this.sorter);\n },\n\n /**\n * Return the highest priority element in the queue.\n */\n pop: function () {\n return this.queue.shift();\n },\n\n empty: function () {\n return this.queue.length === 0;\n }\n }\n};\n\n\n// node.js module exports\nif (typeof module !== 'undefined') {\n module.exports = dijkstra;\n}\n","const Mode = require('./mode')\nconst NumericData = require('./numeric-data')\nconst AlphanumericData = require('./alphanumeric-data')\nconst ByteData = require('./byte-data')\nconst KanjiData = require('./kanji-data')\nconst Regex = require('./regex')\nconst Utils = require('./utils')\nconst dijkstra = require('dijkstrajs')\n\n/**\n * Returns UTF8 byte length\n *\n * @param {String} str Input string\n * @return {Number} Number of byte\n */\nfunction getStringByteLength (str) {\n return unescape(encodeURIComponent(str)).length\n}\n\n/**\n * Get a list of segments of the specified mode\n * from a string\n *\n * @param {Mode} mode Segment mode\n * @param {String} str String to process\n * @return {Array} Array of object with segments data\n */\nfunction getSegments (regex, mode, str) {\n const segments = []\n let result\n\n while ((result = regex.exec(str)) !== null) {\n segments.push({\n data: result[0],\n index: result.index,\n mode: mode,\n length: result[0].length\n })\n }\n\n return segments\n}\n\n/**\n * Extracts a series of segments with the appropriate\n * modes from a string\n *\n * @param {String} dataStr Input string\n * @return {Array} Array of object with segments data\n */\nfunction getSegmentsFromString (dataStr) {\n const numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr)\n const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr)\n let byteSegs\n let kanjiSegs\n\n if (Utils.isKanjiModeEnabled()) {\n byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr)\n kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr)\n } else {\n byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr)\n kanjiSegs = []\n }\n\n const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs)\n\n return segs\n .sort(function (s1, s2) {\n return s1.index - s2.index\n })\n .map(function (obj) {\n return {\n data: obj.data,\n mode: obj.mode,\n length: obj.length\n }\n })\n}\n\n/**\n * Returns how many bits are needed to encode a string of\n * specified length with the specified mode\n *\n * @param {Number} length String length\n * @param {Mode} mode Segment mode\n * @return {Number} Bit length\n */\nfunction getSegmentBitsLength (length, mode) {\n switch (mode) {\n case Mode.NUMERIC:\n return NumericData.getBitsLength(length)\n case Mode.ALPHANUMERIC:\n return AlphanumericData.getBitsLength(length)\n case Mode.KANJI:\n return KanjiData.getBitsLength(length)\n case Mode.BYTE:\n return ByteData.getBitsLength(length)\n }\n}\n\n/**\n * Merges adjacent segments which have the same mode\n *\n * @param {Array} segs Array of object with segments data\n * @return {Array} Array of object with segments data\n */\nfunction mergeSegments (segs) {\n return segs.reduce(function (acc, curr) {\n const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null\n if (prevSeg && prevSeg.mode === curr.mode) {\n acc[acc.length - 1].data += curr.data\n return acc\n }\n\n acc.push(curr)\n return acc\n }, [])\n}\n\n/**\n * Generates a list of all possible nodes combination which\n * will be used to build a segments graph.\n *\n * Nodes are divided by groups. Each group will contain a list of all the modes\n * in which is possible to encode the given text.\n *\n * For example the text '12345' can be encoded as Numeric, Alphanumeric or Byte.\n * The group for '12345' will contain then 3 objects, one for each\n * possible encoding mode.\n *\n * Each node represents a possible segment.\n *\n * @param {Array} segs Array of object with segments data\n * @return {Array} Array of object with segments data\n */\nfunction buildNodes (segs) {\n const nodes = []\n for (let i = 0; i < segs.length; i++) {\n const seg = segs[i]\n\n switch (seg.mode) {\n case Mode.NUMERIC:\n nodes.push([seg,\n { data: seg.data, mode: Mode.ALPHANUMERIC, length: seg.length },\n { data: seg.data, mode: Mode.BYTE, length: seg.length }\n ])\n break\n case Mode.ALPHANUMERIC:\n nodes.push([seg,\n { data: seg.data, mode: Mode.BYTE, length: seg.length }\n ])\n break\n case Mode.KANJI:\n nodes.push([seg,\n { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }\n ])\n break\n case Mode.BYTE:\n nodes.push([\n { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }\n ])\n }\n }\n\n return nodes\n}\n\n/**\n * Builds a graph from a list of nodes.\n * All segments in each node group will be connected with all the segments of\n * the next group and so on.\n *\n * At each connection will be assigned a weight depending on the\n * segment's byte length.\n *\n * @param {Array} nodes Array of object with segments data\n * @param {Number} version QR Code version\n * @return {Object} Graph of all possible segments\n */\nfunction buildGraph (nodes, version) {\n const table = {}\n const graph = { start: {} }\n let prevNodeIds = ['start']\n\n for (let i = 0; i < nodes.length; i++) {\n const nodeGroup = nodes[i]\n const currentNodeIds = []\n\n for (let j = 0; j < nodeGroup.length; j++) {\n const node = nodeGroup[j]\n const key = '' + i + j\n\n currentNodeIds.push(key)\n table[key] = { node: node, lastCount: 0 }\n graph[key] = {}\n\n for (let n = 0; n < prevNodeIds.length; n++) {\n const prevNodeId = prevNodeIds[n]\n\n if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) {\n graph[prevNodeId][key] =\n getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) -\n getSegmentBitsLength(table[prevNodeId].lastCount, node.mode)\n\n table[prevNodeId].lastCount += node.length\n } else {\n if (table[prevNodeId]) table[prevNodeId].lastCount = node.length\n\n graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) +\n 4 + Mode.getCharCountIndicator(node.mode, version) // switch cost\n }\n }\n }\n\n prevNodeIds = currentNodeIds\n }\n\n for (let n = 0; n < prevNodeIds.length; n++) {\n graph[prevNodeIds[n]].end = 0\n }\n\n return { map: graph, table: table }\n}\n\n/**\n * Builds a segment from a specified data and mode.\n * If a mode is not specified, the more suitable will be used.\n *\n * @param {String} data Input data\n * @param {Mode | String} modesHint Data mode\n * @return {Segment} Segment\n */\nfunction buildSingleSegment (data, modesHint) {\n let mode\n const bestMode = Mode.getBestModeForData(data)\n\n mode = Mode.from(modesHint, bestMode)\n\n // Make sure data can be encoded\n if (mode !== Mode.BYTE && mode.bit < bestMode.bit) {\n throw new Error('\"' + data + '\"' +\n ' cannot be encoded with mode ' + Mode.toString(mode) +\n '.\\n Suggested mode is: ' + Mode.toString(bestMode))\n }\n\n // Use Mode.BYTE if Kanji support is disabled\n if (mode === Mode.KANJI && !Utils.isKanjiModeEnabled()) {\n mode = Mode.BYTE\n }\n\n switch (mode) {\n case Mode.NUMERIC:\n return new NumericData(data)\n\n case Mode.ALPHANUMERIC:\n return new AlphanumericData(data)\n\n case Mode.KANJI:\n return new KanjiData(data)\n\n case Mode.BYTE:\n return new ByteData(data)\n }\n}\n\n/**\n * Builds a list of segments from an array.\n * Array can contain Strings or Objects with segment's info.\n *\n * For each item which is a string, will be generated a segment with the given\n * string and the more appropriate encoding mode.\n *\n * For each item which is an object, will be generated a segment with the given\n * data and mode.\n * Objects must contain at least the property \"data\".\n * If property \"mode\" is not present, the more suitable mode will be used.\n *\n * @param {Array} array Array of objects with segments data\n * @return {Array} Array of Segments\n */\nexports.fromArray = function fromArray (array) {\n return array.reduce(function (acc, seg) {\n if (typeof seg === 'string') {\n acc.push(buildSingleSegment(seg, null))\n } else if (seg.data) {\n acc.push(buildSingleSegment(seg.data, seg.mode))\n }\n\n return acc\n }, [])\n}\n\n/**\n * Builds an optimized sequence of segments from a string,\n * which will produce the shortest possible bitstream.\n *\n * @param {String} data Input string\n * @param {Number} version QR Code version\n * @return {Array} Array of segments\n */\nexports.fromString = function fromString (data, version) {\n const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled())\n\n const nodes = buildNodes(segs)\n const graph = buildGraph(nodes, version)\n const path = dijkstra.find_path(graph.map, 'start', 'end')\n\n const optimizedSegs = []\n for (let i = 1; i < path.length - 1; i++) {\n optimizedSegs.push(graph.table[path[i]].node)\n }\n\n return exports.fromArray(mergeSegments(optimizedSegs))\n}\n\n/**\n * Splits a string in various segments with the modes which\n * best represent their content.\n * The produced segments are far from being optimized.\n * The output of this function is only used to estimate a QR Code version\n * which may contain the data.\n *\n * @param {string} data Input string\n * @return {Array} Array of segments\n */\nexports.rawSplit = function rawSplit (data) {\n return exports.fromArray(\n getSegmentsFromString(data, Utils.isKanjiModeEnabled())\n )\n}\n","const Mode = require('./mode')\n\nfunction NumericData (data) {\n this.mode = Mode.NUMERIC\n this.data = data.toString()\n}\n\nNumericData.getBitsLength = function getBitsLength (length) {\n return 10 * Math.floor(length / 3) + ((length % 3) ? ((length % 3) * 3 + 1) : 0)\n}\n\nNumericData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nNumericData.prototype.getBitsLength = function getBitsLength () {\n return NumericData.getBitsLength(this.data.length)\n}\n\nNumericData.prototype.write = function write (bitBuffer) {\n let i, group, value\n\n // The input data string is divided into groups of three digits,\n // and each group is converted to its 10-bit binary equivalent.\n for (i = 0; i + 3 <= this.data.length; i += 3) {\n group = this.data.substr(i, 3)\n value = parseInt(group, 10)\n\n bitBuffer.put(value, 10)\n }\n\n // If the number of input digits is not an exact multiple of three,\n // the final one or two digits are converted to 4 or 7 bits respectively.\n const remainingNum = this.data.length - i\n if (remainingNum > 0) {\n group = this.data.substr(i)\n value = parseInt(group, 10)\n\n bitBuffer.put(value, remainingNum * 3 + 1)\n }\n}\n\nmodule.exports = NumericData\n","const Mode = require('./mode')\n\n/**\n * Array of characters available in alphanumeric mode\n *\n * As per QR Code specification, to each character\n * is assigned a value from 0 to 44 which in this case coincides\n * with the array index\n *\n * @type {Array}\n */\nconst ALPHA_NUM_CHARS = [\n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',\n ' ', '$', '%', '*', '+', '-', '.', '/', ':'\n]\n\nfunction AlphanumericData (data) {\n this.mode = Mode.ALPHANUMERIC\n this.data = data\n}\n\nAlphanumericData.getBitsLength = function getBitsLength (length) {\n return 11 * Math.floor(length / 2) + 6 * (length % 2)\n}\n\nAlphanumericData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nAlphanumericData.prototype.getBitsLength = function getBitsLength () {\n return AlphanumericData.getBitsLength(this.data.length)\n}\n\nAlphanumericData.prototype.write = function write (bitBuffer) {\n let i\n\n // Input data characters are divided into groups of two characters\n // and encoded as 11-bit binary codes.\n for (i = 0; i + 2 <= this.data.length; i += 2) {\n // The character value of the first character is multiplied by 45\n let value = ALPHA_NUM_CHARS.indexOf(this.data[i]) * 45\n\n // The character value of the second digit is added to the product\n value += ALPHA_NUM_CHARS.indexOf(this.data[i + 1])\n\n // The sum is then stored as 11-bit binary number\n bitBuffer.put(value, 11)\n }\n\n // If the number of input data characters is not a multiple of two,\n // the character value of the final character is encoded as a 6-bit binary number.\n if (this.data.length % 2) {\n bitBuffer.put(ALPHA_NUM_CHARS.indexOf(this.data[i]), 6)\n }\n}\n\nmodule.exports = AlphanumericData\n","const Mode = require('./mode')\n\nfunction ByteData (data) {\n this.mode = Mode.BYTE\n if (typeof (data) === 'string') {\n this.data = new TextEncoder().encode(data)\n } else {\n this.data = new Uint8Array(data)\n }\n}\n\nByteData.getBitsLength = function getBitsLength (length) {\n return length * 8\n}\n\nByteData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nByteData.prototype.getBitsLength = function getBitsLength () {\n return ByteData.getBitsLength(this.data.length)\n}\n\nByteData.prototype.write = function (bitBuffer) {\n for (let i = 0, l = this.data.length; i < l; i++) {\n bitBuffer.put(this.data[i], 8)\n }\n}\n\nmodule.exports = ByteData\n","const Mode = require('./mode')\nconst Utils = require('./utils')\n\nfunction KanjiData (data) {\n this.mode = Mode.KANJI\n this.data = data\n}\n\nKanjiData.getBitsLength = function getBitsLength (length) {\n return length * 13\n}\n\nKanjiData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nKanjiData.prototype.getBitsLength = function getBitsLength () {\n return KanjiData.getBitsLength(this.data.length)\n}\n\nKanjiData.prototype.write = function (bitBuffer) {\n let i\n\n // In the Shift JIS system, Kanji characters are represented by a two byte combination.\n // These byte values are shifted from the JIS X 0208 values.\n // JIS X 0208 gives details of the shift coded representation.\n for (i = 0; i < this.data.length; i++) {\n let value = Utils.toSJIS(this.data[i])\n\n // For characters with Shift JIS values from 0x8140 to 0x9FFC:\n if (value >= 0x8140 && value <= 0x9FFC) {\n // Subtract 0x8140 from Shift JIS value\n value -= 0x8140\n\n // For characters with Shift JIS values from 0xE040 to 0xEBBF\n } else if (value >= 0xE040 && value <= 0xEBBF) {\n // Subtract 0xC140 from Shift JIS value\n value -= 0xC140\n } else {\n throw new Error(\n 'Invalid SJIS character: ' + this.data[i] + '\\n' +\n 'Make sure your charset is UTF-8')\n }\n\n // Multiply most significant byte of result by 0xC0\n // and add least significant byte to product\n value = (((value >>> 8) & 0xff) * 0xC0) + (value & 0xff)\n\n // Convert result to a 13-bit binary string\n bitBuffer.put(value, 13)\n }\n}\n\nmodule.exports = KanjiData\n","const Utils = require('./utils')\nconst ECLevel = require('./error-correction-level')\nconst BitBuffer = require('./bit-buffer')\nconst BitMatrix = require('./bit-matrix')\nconst AlignmentPattern = require('./alignment-pattern')\nconst FinderPattern = require('./finder-pattern')\nconst MaskPattern = require('./mask-pattern')\nconst ECCode = require('./error-correction-code')\nconst ReedSolomonEncoder = require('./reed-solomon-encoder')\nconst Version = require('./version')\nconst FormatInfo = require('./format-info')\nconst Mode = require('./mode')\nconst Segments = require('./segments')\n\n/**\n * QRCode for JavaScript\n *\n * modified by Ryan Day for nodejs support\n * Copyright (c) 2011 Ryan Day\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/mit-license.php\n *\n//---------------------------------------------------------------------\n// QRCode for JavaScript\n//\n// Copyright (c) 2009 Kazuhiko Arase\n//\n// URL: http://www.d-project.com/\n//\n// Licensed under the MIT license:\n// http://www.opensource.org/licenses/mit-license.php\n//\n// The word \"QR Code\" is registered trademark of\n// DENSO WAVE INCORPORATED\n// http://www.denso-wave.com/qrcode/faqpatent-e.html\n//\n//---------------------------------------------------------------------\n*/\n\n/**\n * Add finder patterns bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupFinderPattern (matrix, version) {\n const size = matrix.size\n const pos = FinderPattern.getPositions(version)\n\n for (let i = 0; i < pos.length; i++) {\n const row = pos[i][0]\n const col = pos[i][1]\n\n for (let r = -1; r <= 7; r++) {\n if (row + r <= -1 || size <= row + r) continue\n\n for (let c = -1; c <= 7; c++) {\n if (col + c <= -1 || size <= col + c) continue\n\n if ((r >= 0 && r <= 6 && (c === 0 || c === 6)) ||\n (c >= 0 && c <= 6 && (r === 0 || r === 6)) ||\n (r >= 2 && r <= 4 && c >= 2 && c <= 4)) {\n matrix.set(row + r, col + c, true, true)\n } else {\n matrix.set(row + r, col + c, false, true)\n }\n }\n }\n }\n}\n\n/**\n * Add timing pattern bits to matrix\n *\n * Note: this function must be called before {@link setupAlignmentPattern}\n *\n * @param {BitMatrix} matrix Modules matrix\n */\nfunction setupTimingPattern (matrix) {\n const size = matrix.size\n\n for (let r = 8; r < size - 8; r++) {\n const value = r % 2 === 0\n matrix.set(r, 6, value, true)\n matrix.set(6, r, value, true)\n }\n}\n\n/**\n * Add alignment patterns bits to matrix\n *\n * Note: this function must be called after {@link setupTimingPattern}\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupAlignmentPattern (matrix, version) {\n const pos = AlignmentPattern.getPositions(version)\n\n for (let i = 0; i < pos.length; i++) {\n const row = pos[i][0]\n const col = pos[i][1]\n\n for (let r = -2; r <= 2; r++) {\n for (let c = -2; c <= 2; c++) {\n if (r === -2 || r === 2 || c === -2 || c === 2 ||\n (r === 0 && c === 0)) {\n matrix.set(row + r, col + c, true, true)\n } else {\n matrix.set(row + r, col + c, false, true)\n }\n }\n }\n }\n}\n\n/**\n * Add version info bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupVersionInfo (matrix, version) {\n const size = matrix.size\n const bits = Version.getEncodedBits(version)\n let row, col, mod\n\n for (let i = 0; i < 18; i++) {\n row = Math.floor(i / 3)\n col = i % 3 + size - 8 - 3\n mod = ((bits >> i) & 1) === 1\n\n matrix.set(row, col, mod, true)\n matrix.set(col, row, mod, true)\n }\n}\n\n/**\n * Add format info bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @param {Number} maskPattern Mask pattern reference value\n */\nfunction setupFormatInfo (matrix, errorCorrectionLevel, maskPattern) {\n const size = matrix.size\n const bits = FormatInfo.getEncodedBits(errorCorrectionLevel, maskPattern)\n let i, mod\n\n for (i = 0; i < 15; i++) {\n mod = ((bits >> i) & 1) === 1\n\n // vertical\n if (i < 6) {\n matrix.set(i, 8, mod, true)\n } else if (i < 8) {\n matrix.set(i + 1, 8, mod, true)\n } else {\n matrix.set(size - 15 + i, 8, mod, true)\n }\n\n // horizontal\n if (i < 8) {\n matrix.set(8, size - i - 1, mod, true)\n } else if (i < 9) {\n matrix.set(8, 15 - i - 1 + 1, mod, true)\n } else {\n matrix.set(8, 15 - i - 1, mod, true)\n }\n }\n\n // fixed module\n matrix.set(size - 8, 8, 1, true)\n}\n\n/**\n * Add encoded data bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Uint8Array} data Data codewords\n */\nfunction setupData (matrix, data) {\n const size = matrix.size\n let inc = -1\n let row = size - 1\n let bitIndex = 7\n let byteIndex = 0\n\n for (let col = size - 1; col > 0; col -= 2) {\n if (col === 6) col--\n\n while (true) {\n for (let c = 0; c < 2; c++) {\n if (!matrix.isReserved(row, col - c)) {\n let dark = false\n\n if (byteIndex < data.length) {\n dark = (((data[byteIndex] >>> bitIndex) & 1) === 1)\n }\n\n matrix.set(row, col - c, dark)\n bitIndex--\n\n if (bitIndex === -1) {\n byteIndex++\n bitIndex = 7\n }\n }\n }\n\n row += inc\n\n if (row < 0 || size <= row) {\n row -= inc\n inc = -inc\n break\n }\n }\n }\n}\n\n/**\n * Create encoded codewords from data input\n *\n * @param {Number} version QR Code version\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @param {ByteData} data Data input\n * @return {Uint8Array} Buffer containing encoded codewords\n */\nfunction createData (version, errorCorrectionLevel, segments) {\n // Prepare data buffer\n const buffer = new BitBuffer()\n\n segments.forEach(function (data) {\n // prefix data with mode indicator (4 bits)\n buffer.put(data.mode.bit, 4)\n\n // Prefix data with character count indicator.\n // The character count indicator is a string of bits that represents the\n // number of characters that are being encoded.\n // The character count indicator must be placed after the mode indicator\n // and must be a certain number of bits long, depending on the QR version\n // and data mode\n // @see {@link Mode.getCharCountIndicator}.\n buffer.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version))\n\n // add binary data sequence to buffer\n data.write(buffer)\n })\n\n // Calculate required number of bits\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8\n\n // Add a terminator.\n // If the bit string is shorter than the total number of required bits,\n // a terminator of up to four 0s must be added to the right side of the string.\n // If the bit string is more than four bits shorter than the required number of bits,\n // add four 0s to the end.\n if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) {\n buffer.put(0, 4)\n }\n\n // If the bit string is fewer than four bits shorter, add only the number of 0s that\n // are needed to reach the required number of bits.\n\n // After adding the terminator, if the number of bits in the string is not a multiple of 8,\n // pad the string on the right with 0s to make the string's length a multiple of 8.\n while (buffer.getLengthInBits() % 8 !== 0) {\n buffer.putBit(0)\n }\n\n // Add pad bytes if the string is still shorter than the total number of required bits.\n // Extend the buffer to fill the data capacity of the symbol corresponding to\n // the Version and Error Correction Level by adding the Pad Codewords 11101100 (0xEC)\n // and 00010001 (0x11) alternately.\n const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8\n for (let i = 0; i < remainingByte; i++) {\n buffer.put(i % 2 ? 0x11 : 0xEC, 8)\n }\n\n return createCodewords(buffer, version, errorCorrectionLevel)\n}\n\n/**\n * Encode input data with Reed-Solomon and return codewords with\n * relative error correction bits\n *\n * @param {BitBuffer} bitBuffer Data to encode\n * @param {Number} version QR Code version\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @return {Uint8Array} Buffer containing encoded codewords\n */\nfunction createCodewords (bitBuffer, version, errorCorrectionLevel) {\n // Total codewords for this QR code version (Data + Error correction)\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n\n // Total number of error correction codewords\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n\n // Total number of data codewords\n const dataTotalCodewords = totalCodewords - ecTotalCodewords\n\n // Total number of blocks\n const ecTotalBlocks = ECCode.getBlocksCount(version, errorCorrectionLevel)\n\n // Calculate how many blocks each group should contain\n const blocksInGroup2 = totalCodewords % ecTotalBlocks\n const blocksInGroup1 = ecTotalBlocks - blocksInGroup2\n\n const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks)\n\n const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks)\n const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1\n\n // Number of EC codewords is the same for both groups\n const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1\n\n // Initialize a Reed-Solomon encoder with a generator polynomial of degree ecCount\n const rs = new ReedSolomonEncoder(ecCount)\n\n let offset = 0\n const dcData = new Array(ecTotalBlocks)\n const ecData = new Array(ecTotalBlocks)\n let maxDataSize = 0\n const buffer = new Uint8Array(bitBuffer.buffer)\n\n // Divide the buffer into the required number of blocks\n for (let b = 0; b < ecTotalBlocks; b++) {\n const dataSize = b < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2\n\n // extract a block of data from buffer\n dcData[b] = buffer.slice(offset, offset + dataSize)\n\n // Calculate EC codewords for this data block\n ecData[b] = rs.encode(dcData[b])\n\n offset += dataSize\n maxDataSize = Math.max(maxDataSize, dataSize)\n }\n\n // Create final data\n // Interleave the data and error correction codewords from each block\n const data = new Uint8Array(totalCodewords)\n let index = 0\n let i, r\n\n // Add data codewords\n for (i = 0; i < maxDataSize; i++) {\n for (r = 0; r < ecTotalBlocks; r++) {\n if (i < dcData[r].length) {\n data[index++] = dcData[r][i]\n }\n }\n }\n\n // Apped EC codewords\n for (i = 0; i < ecCount; i++) {\n for (r = 0; r < ecTotalBlocks; r++) {\n data[index++] = ecData[r][i]\n }\n }\n\n return data\n}\n\n/**\n * Build QR Code symbol\n *\n * @param {String} data Input string\n * @param {Number} version QR Code version\n * @param {ErrorCorretionLevel} errorCorrectionLevel Error level\n * @param {MaskPattern} maskPattern Mask pattern\n * @return {Object} Object containing symbol data\n */\nfunction createSymbol (data, version, errorCorrectionLevel, maskPattern) {\n let segments\n\n if (Array.isArray(data)) {\n segments = Segments.fromArray(data)\n } else if (typeof data === 'string') {\n let estimatedVersion = version\n\n if (!estimatedVersion) {\n const rawSegments = Segments.rawSplit(data)\n\n // Estimate best version that can contain raw splitted segments\n estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel)\n }\n\n // Build optimized segments\n // If estimated version is undefined, try with the highest version\n segments = Segments.fromString(data, estimatedVersion || 40)\n } else {\n throw new Error('Invalid data')\n }\n\n // Get the min version that can contain data\n const bestVersion = Version.getBestVersionForData(segments, errorCorrectionLevel)\n\n // If no version is found, data cannot be stored\n if (!bestVersion) {\n throw new Error('The amount of data is too big to be stored in a QR Code')\n }\n\n // If not specified, use min version as default\n if (!version) {\n version = bestVersion\n\n // Check if the specified version can contain the data\n } else if (version < bestVersion) {\n throw new Error('\\n' +\n 'The chosen QR Code version cannot contain this amount of data.\\n' +\n 'Minimum version required to store current data is: ' + bestVersion + '.\\n'\n )\n }\n\n const dataBits = createData(version, errorCorrectionLevel, segments)\n\n // Allocate matrix buffer\n const moduleCount = Utils.getSymbolSize(version)\n const modules = new BitMatrix(moduleCount)\n\n // Add function modules\n setupFinderPattern(modules, version)\n setupTimingPattern(modules)\n setupAlignmentPattern(modules, version)\n\n // Add temporary dummy bits for format info just to set them as reserved.\n // This is needed to prevent these bits from being masked by {@link MaskPattern.applyMask}\n // since the masking operation must be performed only on the encoding region.\n // These blocks will be replaced with correct values later in code.\n setupFormatInfo(modules, errorCorrectionLevel, 0)\n\n if (version >= 7) {\n setupVersionInfo(modules, version)\n }\n\n // Add data codewords\n setupData(modules, dataBits)\n\n if (isNaN(maskPattern)) {\n // Find best mask pattern\n maskPattern = MaskPattern.getBestMask(modules,\n setupFormatInfo.bind(null, modules, errorCorrectionLevel))\n }\n\n // Apply mask pattern\n MaskPattern.applyMask(maskPattern, modules)\n\n // Replace format info bits with correct values\n setupFormatInfo(modules, errorCorrectionLevel, maskPattern)\n\n return {\n modules: modules,\n version: version,\n errorCorrectionLevel: errorCorrectionLevel,\n maskPattern: maskPattern,\n segments: segments\n }\n}\n\n/**\n * QR Code\n *\n * @param {String | Array} data Input data\n * @param {Object} options Optional configurations\n * @param {Number} options.version QR Code version\n * @param {String} options.errorCorrectionLevel Error correction level\n * @param {Function} options.toSJISFunc Helper func to convert utf8 to sjis\n */\nexports.create = function create (data, options) {\n if (typeof data === 'undefined' || data === '') {\n throw new Error('No input text')\n }\n\n let errorCorrectionLevel = ECLevel.M\n let version\n let mask\n\n if (typeof options !== 'undefined') {\n // Use higher error correction level as default\n errorCorrectionLevel = ECLevel.from(options.errorCorrectionLevel, ECLevel.M)\n version = Version.from(options.version)\n mask = MaskPattern.from(options.maskPattern)\n\n if (options.toSJISFunc) {\n Utils.setToSJISFunction(options.toSJISFunc)\n }\n }\n\n return createSymbol(data, version, errorCorrectionLevel, mask)\n}\n","function BitBuffer () {\n this.buffer = []\n this.length = 0\n}\n\nBitBuffer.prototype = {\n\n get: function (index) {\n const bufIndex = Math.floor(index / 8)\n return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1) === 1\n },\n\n put: function (num, length) {\n for (let i = 0; i < length; i++) {\n this.putBit(((num >>> (length - i - 1)) & 1) === 1)\n }\n },\n\n getLengthInBits: function () {\n return this.length\n },\n\n putBit: function (bit) {\n const bufIndex = Math.floor(this.length / 8)\n if (this.buffer.length <= bufIndex) {\n this.buffer.push(0)\n }\n\n if (bit) {\n this.buffer[bufIndex] |= (0x80 >>> (this.length % 8))\n }\n\n this.length++\n }\n}\n\nmodule.exports = BitBuffer\n","/**\n * Helper class to handle QR Code symbol modules\n *\n * @param {Number} size Symbol size\n */\nfunction BitMatrix (size) {\n if (!size || size < 1) {\n throw new Error('BitMatrix size must be defined and greater than 0')\n }\n\n this.size = size\n this.data = new Uint8Array(size * size)\n this.reservedBit = new Uint8Array(size * size)\n}\n\n/**\n * Set bit value at specified location\n * If reserved flag is set, this bit will be ignored during masking process\n *\n * @param {Number} row\n * @param {Number} col\n * @param {Boolean} value\n * @param {Boolean} reserved\n */\nBitMatrix.prototype.set = function (row, col, value, reserved) {\n const index = row * this.size + col\n this.data[index] = value\n if (reserved) this.reservedBit[index] = true\n}\n\n/**\n * Returns bit value at specified location\n *\n * @param {Number} row\n * @param {Number} col\n * @return {Boolean}\n */\nBitMatrix.prototype.get = function (row, col) {\n return this.data[row * this.size + col]\n}\n\n/**\n * Applies xor operator at specified location\n * (used during masking process)\n *\n * @param {Number} row\n * @param {Number} col\n * @param {Boolean} value\n */\nBitMatrix.prototype.xor = function (row, col, value) {\n this.data[row * this.size + col] ^= value\n}\n\n/**\n * Check if bit at specified location is reserved\n *\n * @param {Number} row\n * @param {Number} col\n * @return {Boolean}\n */\nBitMatrix.prototype.isReserved = function (row, col) {\n return this.reservedBit[row * this.size + col]\n}\n\nmodule.exports = BitMatrix\n","/**\n * Alignment pattern are fixed reference pattern in defined positions\n * in a matrix symbology, which enables the decode software to re-synchronise\n * the coordinate mapping of the image modules in the event of moderate amounts\n * of distortion of the image.\n *\n * Alignment patterns are present only in QR Code symbols of version 2 or larger\n * and their number depends on the symbol version.\n */\n\nconst getSymbolSize = require('./utils').getSymbolSize\n\n/**\n * Calculate the row/column coordinates of the center module of each alignment pattern\n * for the specified QR Code version.\n *\n * The alignment patterns are positioned symmetrically on either side of the diagonal\n * running from the top left corner of the symbol to the bottom right corner.\n *\n * Since positions are simmetrical only half of the coordinates are returned.\n * Each item of the array will represent in turn the x and y coordinate.\n * @see {@link getPositions}\n *\n * @param {Number} version QR Code version\n * @return {Array} Array of coordinate\n */\nexports.getRowColCoords = function getRowColCoords (version) {\n if (version === 1) return []\n\n const posCount = Math.floor(version / 7) + 2\n const size = getSymbolSize(version)\n const intervals = size === 145 ? 26 : Math.ceil((size - 13) / (2 * posCount - 2)) * 2\n const positions = [size - 7] // Last coord is always (size - 7)\n\n for (let i = 1; i < posCount - 1; i++) {\n positions[i] = positions[i - 1] - intervals\n }\n\n positions.push(6) // First coord is always 6\n\n return positions.reverse()\n}\n\n/**\n * Returns an array containing the positions of each alignment pattern.\n * Each array's element represent the center point of the pattern as (x, y) coordinates\n *\n * Coordinates are calculated expanding the row/column coordinates returned by {@link getRowColCoords}\n * and filtering out the items that overlaps with finder pattern\n *\n * @example\n * For a Version 7 symbol {@link getRowColCoords} returns values 6, 22 and 38.\n * The alignment patterns, therefore, are to be centered on (row, column)\n * positions (6,22), (22,6), (22,22), (22,38), (38,22), (38,38).\n * Note that the coordinates (6,6), (6,38), (38,6) are occupied by finder patterns\n * and are not therefore used for alignment patterns.\n *\n * let pos = getPositions(7)\n * // [[6,22], [22,6], [22,22], [22,38], [38,22], [38,38]]\n *\n * @param {Number} version QR Code version\n * @return {Array} Array of coordinates\n */\nexports.getPositions = function getPositions (version) {\n const coords = []\n const pos = exports.getRowColCoords(version)\n const posLength = pos.length\n\n for (let i = 0; i < posLength; i++) {\n for (let j = 0; j < posLength; j++) {\n // Skip if position is occupied by finder patterns\n if ((i === 0 && j === 0) || // top-left\n (i === 0 && j === posLength - 1) || // bottom-left\n (i === posLength - 1 && j === 0)) { // top-right\n continue\n }\n\n coords.push([pos[i], pos[j]])\n }\n }\n\n return coords\n}\n","const getSymbolSize = require('./utils').getSymbolSize\nconst FINDER_PATTERN_SIZE = 7\n\n/**\n * Returns an array containing the positions of each finder pattern.\n * Each array's element represent the top-left point of the pattern as (x, y) coordinates\n *\n * @param {Number} version QR Code version\n * @return {Array} Array of coordinates\n */\nexports.getPositions = function getPositions (version) {\n const size = getSymbolSize(version)\n\n return [\n // top-left\n [0, 0],\n // top-right\n [size - FINDER_PATTERN_SIZE, 0],\n // bottom-left\n [0, size - FINDER_PATTERN_SIZE]\n ]\n}\n","/**\n * Data mask pattern reference\n * @type {Object}\n */\nexports.Patterns = {\n PATTERN000: 0,\n PATTERN001: 1,\n PATTERN010: 2,\n PATTERN011: 3,\n PATTERN100: 4,\n PATTERN101: 5,\n PATTERN110: 6,\n PATTERN111: 7\n}\n\n/**\n * Weighted penalty scores for the undesirable features\n * @type {Object}\n */\nconst PenaltyScores = {\n N1: 3,\n N2: 3,\n N3: 40,\n N4: 10\n}\n\n/**\n * Check if mask pattern value is valid\n *\n * @param {Number} mask Mask pattern\n * @return {Boolean} true if valid, false otherwise\n */\nexports.isValid = function isValid (mask) {\n return mask != null && mask !== '' && !isNaN(mask) && mask >= 0 && mask <= 7\n}\n\n/**\n * Returns mask pattern from a value.\n * If value is not valid, returns undefined\n *\n * @param {Number|String} value Mask pattern value\n * @return {Number} Valid mask pattern or undefined\n */\nexports.from = function from (value) {\n return exports.isValid(value) ? parseInt(value, 10) : undefined\n}\n\n/**\n* Find adjacent modules in row/column with the same color\n* and assign a penalty value.\n*\n* Points: N1 + i\n* i is the amount by which the number of adjacent modules of the same color exceeds 5\n*/\nexports.getPenaltyN1 = function getPenaltyN1 (data) {\n const size = data.size\n let points = 0\n let sameCountCol = 0\n let sameCountRow = 0\n let lastCol = null\n let lastRow = null\n\n for (let row = 0; row < size; row++) {\n sameCountCol = sameCountRow = 0\n lastCol = lastRow = null\n\n for (let col = 0; col < size; col++) {\n let module = data.get(row, col)\n if (module === lastCol) {\n sameCountCol++\n } else {\n if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5)\n lastCol = module\n sameCountCol = 1\n }\n\n module = data.get(col, row)\n if (module === lastRow) {\n sameCountRow++\n } else {\n if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5)\n lastRow = module\n sameCountRow = 1\n }\n }\n\n if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5)\n if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5)\n }\n\n return points\n}\n\n/**\n * Find 2x2 blocks with the same color and assign a penalty value\n *\n * Points: N2 * (m - 1) * (n - 1)\n */\nexports.getPenaltyN2 = function getPenaltyN2 (data) {\n const size = data.size\n let points = 0\n\n for (let row = 0; row < size - 1; row++) {\n for (let col = 0; col < size - 1; col++) {\n const last = data.get(row, col) +\n data.get(row, col + 1) +\n data.get(row + 1, col) +\n data.get(row + 1, col + 1)\n\n if (last === 4 || last === 0) points++\n }\n }\n\n return points * PenaltyScores.N2\n}\n\n/**\n * Find 1:1:3:1:1 ratio (dark:light:dark:light:dark) pattern in row/column,\n * preceded or followed by light area 4 modules wide\n *\n * Points: N3 * number of pattern found\n */\nexports.getPenaltyN3 = function getPenaltyN3 (data) {\n const size = data.size\n let points = 0\n let bitsCol = 0\n let bitsRow = 0\n\n for (let row = 0; row < size; row++) {\n bitsCol = bitsRow = 0\n for (let col = 0; col < size; col++) {\n bitsCol = ((bitsCol << 1) & 0x7FF) | data.get(row, col)\n if (col >= 10 && (bitsCol === 0x5D0 || bitsCol === 0x05D)) points++\n\n bitsRow = ((bitsRow << 1) & 0x7FF) | data.get(col, row)\n if (col >= 10 && (bitsRow === 0x5D0 || bitsRow === 0x05D)) points++\n }\n }\n\n return points * PenaltyScores.N3\n}\n\n/**\n * Calculate proportion of dark modules in entire symbol\n *\n * Points: N4 * k\n *\n * k is the rating of the deviation of the proportion of dark modules\n * in the symbol from 50% in steps of 5%\n */\nexports.getPenaltyN4 = function getPenaltyN4 (data) {\n let darkCount = 0\n const modulesCount = data.data.length\n\n for (let i = 0; i < modulesCount; i++) darkCount += data.data[i]\n\n const k = Math.abs(Math.ceil((darkCount * 100 / modulesCount) / 5) - 10)\n\n return k * PenaltyScores.N4\n}\n\n/**\n * Return mask value at given position\n *\n * @param {Number} maskPattern Pattern reference value\n * @param {Number} i Row\n * @param {Number} j Column\n * @return {Boolean} Mask value\n */\nfunction getMaskAt (maskPattern, i, j) {\n switch (maskPattern) {\n case exports.Patterns.PATTERN000: return (i + j) % 2 === 0\n case exports.Patterns.PATTERN001: return i % 2 === 0\n case exports.Patterns.PATTERN010: return j % 3 === 0\n case exports.Patterns.PATTERN011: return (i + j) % 3 === 0\n case exports.Patterns.PATTERN100: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 === 0\n case exports.Patterns.PATTERN101: return (i * j) % 2 + (i * j) % 3 === 0\n case exports.Patterns.PATTERN110: return ((i * j) % 2 + (i * j) % 3) % 2 === 0\n case exports.Patterns.PATTERN111: return ((i * j) % 3 + (i + j) % 2) % 2 === 0\n\n default: throw new Error('bad maskPattern:' + maskPattern)\n }\n}\n\n/**\n * Apply a mask pattern to a BitMatrix\n *\n * @param {Number} pattern Pattern reference number\n * @param {BitMatrix} data BitMatrix data\n */\nexports.applyMask = function applyMask (pattern, data) {\n const size = data.size\n\n for (let col = 0; col < size; col++) {\n for (let row = 0; row < size; row++) {\n if (data.isReserved(row, col)) continue\n data.xor(row, col, getMaskAt(pattern, row, col))\n }\n }\n}\n\n/**\n * Returns the best mask pattern for data\n *\n * @param {BitMatrix} data\n * @return {Number} Mask pattern reference number\n */\nexports.getBestMask = function getBestMask (data, setupFormatFunc) {\n const numPatterns = Object.keys(exports.Patterns).length\n let bestPattern = 0\n let lowerPenalty = Infinity\n\n for (let p = 0; p < numPatterns; p++) {\n setupFormatFunc(p)\n exports.applyMask(p, data)\n\n // Calculate penalty\n const penalty =\n exports.getPenaltyN1(data) +\n exports.getPenaltyN2(data) +\n exports.getPenaltyN3(data) +\n exports.getPenaltyN4(data)\n\n // Undo previously applied mask\n exports.applyMask(p, data)\n\n if (penalty < lowerPenalty) {\n lowerPenalty = penalty\n bestPattern = p\n }\n }\n\n return bestPattern\n}\n","const Polynomial = require('./polynomial')\n\nfunction ReedSolomonEncoder (degree) {\n this.genPoly = undefined\n this.degree = degree\n\n if (this.degree) this.initialize(this.degree)\n}\n\n/**\n * Initialize the encoder.\n * The input param should correspond to the number of error correction codewords.\n *\n * @param {Number} degree\n */\nReedSolomonEncoder.prototype.initialize = function initialize (degree) {\n // create an irreducible generator polynomial\n this.degree = degree\n this.genPoly = Polynomial.generateECPolynomial(this.degree)\n}\n\n/**\n * Encodes a chunk of data\n *\n * @param {Uint8Array} data Buffer containing input data\n * @return {Uint8Array} Buffer containing encoded data\n */\nReedSolomonEncoder.prototype.encode = function encode (data) {\n if (!this.genPoly) {\n throw new Error('Encoder not initialized')\n }\n\n // Calculate EC for this data block\n // extends data size to data+genPoly size\n const paddedData = new Uint8Array(data.length + this.degree)\n paddedData.set(data)\n\n // The error correction codewords are the remainder after dividing the data codewords\n // by a generator polynomial\n const remainder = Polynomial.mod(paddedData, this.genPoly)\n\n // return EC data blocks (last n byte, where n is the degree of genPoly)\n // If coefficients number in remainder are less than genPoly degree,\n // pad with 0s to the left to reach the needed number of coefficients\n const start = this.degree - remainder.length\n if (start > 0) {\n const buff = new Uint8Array(this.degree)\n buff.set(remainder, start)\n\n return buff\n }\n\n return remainder\n}\n\nmodule.exports = ReedSolomonEncoder\n","const Utils = require('./utils')\n\nconst G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0)\nconst G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1)\nconst G15_BCH = Utils.getBCHDigit(G15)\n\n/**\n * Returns format information with relative error correction bits\n *\n * The format information is a 15-bit sequence containing 5 data bits,\n * with 10 error correction bits calculated using the (15, 5) BCH code.\n *\n * @param {Number} errorCorrectionLevel Error correction level\n * @param {Number} mask Mask pattern\n * @return {Number} Encoded format information bits\n */\nexports.getEncodedBits = function getEncodedBits (errorCorrectionLevel, mask) {\n const data = ((errorCorrectionLevel.bit << 3) | mask)\n let d = data << 10\n\n while (Utils.getBCHDigit(d) - G15_BCH >= 0) {\n d ^= (G15 << (Utils.getBCHDigit(d) - G15_BCH))\n }\n\n // xor final data with mask pattern in order to ensure that\n // no combination of Error Correction Level and data mask pattern\n // will result in an all-zero data string\n return ((data << 10) | d) ^ G15_MASK\n}\n","function hex2rgba (hex) {\n if (typeof hex === 'number') {\n hex = hex.toString()\n }\n\n if (typeof hex !== 'string') {\n throw new Error('Color should be defined as hex string')\n }\n\n let hexCode = hex.slice().replace('#', '').split('')\n if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) {\n throw new Error('Invalid hex color: ' + hex)\n }\n\n // Convert from short to long form (fff -> ffffff)\n if (hexCode.length === 3 || hexCode.length === 4) {\n hexCode = Array.prototype.concat.apply([], hexCode.map(function (c) {\n return [c, c]\n }))\n }\n\n // Add default alpha value\n if (hexCode.length === 6) hexCode.push('F', 'F')\n\n const hexValue = parseInt(hexCode.join(''), 16)\n\n return {\n r: (hexValue >> 24) & 255,\n g: (hexValue >> 16) & 255,\n b: (hexValue >> 8) & 255,\n a: hexValue & 255,\n hex: '#' + hexCode.slice(0, 6).join('')\n }\n}\n\nexports.getOptions = function getOptions (options) {\n if (!options) options = {}\n if (!options.color) options.color = {}\n\n const margin = typeof options.margin === 'undefined' ||\n options.margin === null ||\n options.margin < 0\n ? 4\n : options.margin\n\n const width = options.width && options.width >= 21 ? options.width : undefined\n const scale = options.scale || 4\n\n return {\n width: width,\n scale: width ? 4 : scale,\n margin: margin,\n color: {\n dark: hex2rgba(options.color.dark || '#000000ff'),\n light: hex2rgba(options.color.light || '#ffffffff')\n },\n type: options.type,\n rendererOpts: options.rendererOpts || {}\n }\n}\n\nexports.getScale = function getScale (qrSize, opts) {\n return opts.width && opts.width >= qrSize + opts.margin * 2\n ? opts.width / (qrSize + opts.margin * 2)\n : opts.scale\n}\n\nexports.getImageWidth = function getImageWidth (qrSize, opts) {\n const scale = exports.getScale(qrSize, opts)\n return Math.floor((qrSize + opts.margin * 2) * scale)\n}\n\nexports.qrToImageData = function qrToImageData (imgData, qr, opts) {\n const size = qr.modules.size\n const data = qr.modules.data\n const scale = exports.getScale(size, opts)\n const symbolSize = Math.floor((size + opts.margin * 2) * scale)\n const scaledMargin = opts.margin * scale\n const palette = [opts.color.light, opts.color.dark]\n\n for (let i = 0; i < symbolSize; i++) {\n for (let j = 0; j < symbolSize; j++) {\n let posDst = (i * symbolSize + j) * 4\n let pxColor = opts.color.light\n\n if (i >= scaledMargin && j >= scaledMargin &&\n i < symbolSize - scaledMargin && j < symbolSize - scaledMargin) {\n const iSrc = Math.floor((i - scaledMargin) / scale)\n const jSrc = Math.floor((j - scaledMargin) / scale)\n pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0]\n }\n\n imgData[posDst++] = pxColor.r\n imgData[posDst++] = pxColor.g\n imgData[posDst++] = pxColor.b\n imgData[posDst] = pxColor.a\n }\n }\n}\n","const Utils = require('./utils')\n\nfunction clearCanvas (ctx, canvas, size) {\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n\n if (!canvas.style) canvas.style = {}\n canvas.height = size\n canvas.width = size\n canvas.style.height = size + 'px'\n canvas.style.width = size + 'px'\n}\n\nfunction getCanvasElement () {\n try {\n return document.createElement('canvas')\n } catch (e) {\n throw new Error('You need to specify a canvas element')\n }\n}\n\nexports.render = function render (qrData, canvas, options) {\n let opts = options\n let canvasEl = canvas\n\n if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n opts = canvas\n canvas = undefined\n }\n\n if (!canvas) {\n canvasEl = getCanvasElement()\n }\n\n opts = Utils.getOptions(opts)\n const size = Utils.getImageWidth(qrData.modules.size, opts)\n\n const ctx = canvasEl.getContext('2d')\n const image = ctx.createImageData(size, size)\n Utils.qrToImageData(image.data, qrData, opts)\n\n clearCanvas(ctx, canvasEl, size)\n ctx.putImageData(image, 0, 0)\n\n return canvasEl\n}\n\nexports.renderToDataURL = function renderToDataURL (qrData, canvas, options) {\n let opts = options\n\n if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n opts = canvas\n canvas = undefined\n }\n\n if (!opts) opts = {}\n\n const canvasEl = exports.render(qrData, canvas, opts)\n\n const type = opts.type || 'image/png'\n const rendererOpts = opts.rendererOpts || {}\n\n return canvasEl.toDataURL(type, rendererOpts.quality)\n}\n","const Utils = require('./utils')\n\nfunction getColorAttrib (color, attrib) {\n const alpha = color.a / 255\n const str = attrib + '=\"' + color.hex + '\"'\n\n return alpha < 1\n ? str + ' ' + attrib + '-opacity=\"' + alpha.toFixed(2).slice(1) + '\"'\n : str\n}\n\nfunction svgCmd (cmd, x, y) {\n let str = cmd + x\n if (typeof y !== 'undefined') str += ' ' + y\n\n return str\n}\n\nfunction qrToPath (data, size, margin) {\n let path = ''\n let moveBy = 0\n let newRow = false\n let lineLength = 0\n\n for (let i = 0; i < data.length; i++) {\n const col = Math.floor(i % size)\n const row = Math.floor(i / size)\n\n if (!col && !newRow) newRow = true\n\n if (data[i]) {\n lineLength++\n\n if (!(i > 0 && col > 0 && data[i - 1])) {\n path += newRow\n ? svgCmd('M', col + margin, 0.5 + row + margin)\n : svgCmd('m', moveBy, 0)\n\n moveBy = 0\n newRow = false\n }\n\n if (!(col + 1 < size && data[i + 1])) {\n path += svgCmd('h', lineLength)\n lineLength = 0\n }\n } else {\n moveBy++\n }\n }\n\n return path\n}\n\nexports.render = function render (qrData, options, cb) {\n const opts = Utils.getOptions(options)\n const size = qrData.modules.size\n const data = qrData.modules.data\n const qrcodesize = size + opts.margin * 2\n\n const bg = !opts.color.light.a\n ? ''\n : '<path ' + getColorAttrib(opts.color.light, 'fill') +\n ' d=\"M0 0h' + qrcodesize + 'v' + qrcodesize + 'H0z\"/>'\n\n const path =\n '<path ' + getColorAttrib(opts.color.dark, 'stroke') +\n ' d=\"' + qrToPath(data, size, opts.margin) + '\"/>'\n\n const viewBox = 'viewBox=\"' + '0 0 ' + qrcodesize + ' ' + qrcodesize + '\"'\n\n const width = !opts.width ? '' : 'width=\"' + opts.width + '\" height=\"' + opts.width + '\" '\n\n const svgTag = '<svg xmlns=\"http://www.w3.org/2000/svg\" ' + width + viewBox + ' shape-rendering=\"crispEdges\">' + bg + path + '</svg>\\n'\n\n if (typeof cb === 'function') {\n cb(null, svgTag)\n }\n\n return svgTag\n}\n","\nconst canPromise = require('./can-promise')\n\nconst QRCode = require('./core/qrcode')\nconst CanvasRenderer = require('./renderer/canvas')\nconst SvgRenderer = require('./renderer/svg-tag.js')\n\nfunction renderCanvas (renderFunc, canvas, text, opts, cb) {\n const args = [].slice.call(arguments, 1)\n const argsNum = args.length\n const isLastArgCb = typeof args[argsNum - 1] === 'function'\n\n if (!isLastArgCb && !canPromise()) {\n throw new Error('Callback required as last argument')\n }\n\n if (isLastArgCb) {\n if (argsNum < 2) {\n throw new Error('Too few arguments provided')\n }\n\n if (argsNum === 2) {\n cb = text\n text = canvas\n canvas = opts = undefined\n } else if (argsNum === 3) {\n if (canvas.getContext && typeof cb === 'undefined') {\n cb = opts\n opts = undefined\n } else {\n cb = opts\n opts = text\n text = canvas\n canvas = undefined\n }\n }\n } else {\n if (argsNum < 1) {\n throw new Error('Too few arguments provided')\n }\n\n if (argsNum === 1) {\n text = canvas\n canvas = opts = undefined\n } else if (argsNum === 2 && !canvas.getContext) {\n opts = text\n text = canvas\n canvas = undefined\n }\n\n return new Promise(function (resolve, reject) {\n try {\n const data = QRCode.create(text, opts)\n resolve(renderFunc(data, canvas, opts))\n } catch (e) {\n reject(e)\n }\n })\n }\n\n try {\n const data = QRCode.create(text, opts)\n cb(null, renderFunc(data, canvas, opts))\n } catch (e) {\n cb(e)\n }\n}\n\nexports.create = QRCode.create\nexports.toCanvas = renderCanvas.bind(null, CanvasRenderer.render)\nexports.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL)\n\n// only svg for now.\nexports.toString = renderCanvas.bind(null, function (data, _, opts) {\n return SvgRenderer.render(data, opts)\n})\n","import { consume } from '@lit/context';\nimport { html, LitElement, unsafeCSS } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { QRCodeToDataURLOptions, toDataURL } from 'qrcode';\nimport deviceIcon from '../assets/device-mobile-pin.svg?raw';\nimport { sdkContext, SDKContextType } from '../utils/sdk-context';\nimport { AnalyticsController } from '../utils/analytics-controller';\nimport style from '../styles/qr-modal.css?inline';\n\n@customElement('qr-modal')\nexport class QRModal extends LitElement {\n @consume({ context: sdkContext, subscribe: true })\n protected sdkData?: SDKContextType;\n\n static override styles = [unsafeCSS(style)];\n private lastOriginId?: string;\n private lastDestinationId?: string;\n\n override updated() {\n const { originId, destinationId, generalConfig } = this.sdkData ?? {};\n \n // Check if originId or destinationId have changed\n const hasChanged = \n originId !== this.lastOriginId || \n destinationId !== this.lastDestinationId;\n \n if (hasChanged && originId && destinationId && generalConfig) {\n // Update last values\n this.lastOriginId = originId;\n this.lastDestinationId = destinationId;\n \n const { baseUrl } = generalConfig;\n const url = `${baseUrl}/?origin=${originId}&destination=${destinationId}&utm_source=qr-totem&utm_content=route&utm_referrer=totem`;\n const options: QRCodeToDataURLOptions = {\n errorCorrectionLevel: 'M',\n type: 'image/webp',\n margin: 1,\n width: 150,\n };\n toDataURL(url, options).then((dataUrl: string) => {\n const qr = this.shadowRoot?.getElementById('qr');\n if (qr && qr instanceof HTMLImageElement) {\n qr.src = dataUrl;\n // Track QR code generation\n AnalyticsController.getInstance().trackEvent('qr_modal_displayed', {\n origin_id: originId,\n destination_id: destinationId,\n qr_url: url,\n });\n }\n });\n }\n }\n\n override render() {\n const { cameraInitialized } = this.sdkData ?? {};\n return html`\n <div class=${classMap({ card: true, hidden: !cameraInitialized })}>\n <div class=\"modal-content\">\n <div class=\"pin-container\">\n <span .innerHTML=${deviceIcon}></span>\n </div>\n <div class=\"qr-text\">\n <span>Continúa la ruta en tu celular, escaneando el código QR</span>\n </div>\n <div class=\"qr-code qr-container\">\n <img id=\"qr\" src=\"\" alt=\"QR Code\" />\n </div>\n </div>\n </div>\n `;\n }\n}\n","export default \"<svg width=\\\"63\\\" height=\\\"63\\\" viewBox=\\\"0 0 63 63\\\" fill=\\\"none\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n<g clip-path=\\\"url(#clip0_15_10760)\\\">\\n<path d=\\\"M32.8125 55.125H21C19.6076 55.125 18.2723 54.5719 17.2877 53.5873C16.3031 52.6027 15.75 51.2674 15.75 49.875V13.125C15.75 11.7326 16.3031 10.3973 17.2877 9.41269C18.2723 8.42812 19.6076 7.875 21 7.875H42C43.3924 7.875 44.7277 8.42812 45.7123 9.41269C46.6969 10.3973 47.25 11.7326 47.25 13.125V28.875\\\" stroke=\\\"#DAEBF2\\\" stroke-width=\\\"5.25\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/>\\n<path d=\\\"M28.8758 10.4992H34.1258\\\" stroke=\\\"#DAEBF2\\\" stroke-width=\\\"5.25\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/>\\n<path d=\\\"M55.4418 52.8193C56.5434 51.7181 57.2937 50.3149 57.5977 48.7872C57.9018 47.2595 57.746 45.676 57.15 44.2369C56.554 42.7978 55.5447 41.5678 54.2496 40.7023C52.9545 39.8369 51.4318 39.375 49.8742 39.375C48.3166 39.375 46.7939 39.8369 45.4988 40.7023C44.2038 41.5678 43.1944 42.7978 42.5984 44.2369C42.0025 45.676 41.8466 47.2595 42.1507 48.7872C42.4548 50.3149 43.205 51.7181 44.3066 52.8193C45.4038 53.9192 47.2597 55.5624 49.8742 57.7517C52.6331 55.4154 54.4916 53.7722 55.4418 52.8193Z\\\" stroke=\\\"#DAEBF2\\\" stroke-width=\\\"5.25\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/>\\n<path d=\\\"M49.8742 47.25V47.2757\\\" stroke=\\\"#DAEBF2\\\" stroke-width=\\\"5.25\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/>\\n<path d=\\\"M31.5 44.6258V44.6515\\\" stroke=\\\"#DAEBF2\\\" stroke-width=\\\"5.25\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/>\\n</g>\\n<defs>\\n<clipPath id=\\\"clip0_15_10760\\\">\\n<rect width=\\\"63\\\" height=\\\"63\\\" fill=\\\"white\\\"/>\\n</clipPath>\\n</defs>\\n</svg>\\n\"","import { consume } from '@lit/context';\nimport { html, LitElement, unsafeCSS } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { sdkContext, SDKContextType } from '../utils/sdk-context';\nimport { AnalyticsController } from '../utils/analytics-controller';\nimport style from '../styles/route-options.css?inline';\n\n// Dynamic imports for assets\nconst loadAssets = async () => {\n const [accessibilityIcon, backIcon, destinationPoint, originPoint, repeatIcon, walkingIcon] = await Promise.all([\n import('../assets/accessibility.svg?raw'),\n import('../assets/back_arrow.svg?raw'),\n import('../assets/icon-destination-point.svg'),\n import('../assets/icon-origin-point.svg'),\n import('../assets/repeat_icon.svg?raw'),\n import('../assets/walking.svg?raw'),\n ]);\n return {\n accessibilityIcon: accessibilityIcon.default,\n backIcon: backIcon.default,\n destinationPoint: destinationPoint.default,\n originPoint: originPoint.default,\n repeatIcon: repeatIcon.default,\n walkingIcon: walkingIcon.default,\n };\n};\n\n@customElement('route-options')\nexport class RouteOptions extends LitElement {\n @consume({ context: sdkContext, subscribe: true })\n protected sdkData?: SDKContextType;\n\n static override styles = [unsafeCSS(style)];\n\n private assets: Awaited<ReturnType<typeof loadAssets>> | null = null;\n\n constructor() {\n super();\n this._loadAssets();\n }\n\n private async _loadAssets() {\n this.assets = await loadAssets();\n this.requestUpdate();\n }\n\n private handleBack() {\n this.dispatchEvent(\n new CustomEvent('back', {\n detail: {},\n bubbles: true,\n composed: true,\n })\n );\n\n // Implementar la lógica para volver atrás\n }\n\n private handleAccessibility() {\n this.dispatchEvent(\n new CustomEvent('accessibilityChange', {\n detail: !this.sdkData?.accessibleRoute,\n bubbles: true,\n composed: true,\n })\n );\n // Implementar la lógica para cambiar el tipo de ruta\n }\n\n private handleRepeatRoute() {\n this.dispatchEvent(\n new CustomEvent('repeatRoute', {\n detail: true,\n bubbles: true,\n composed: true,\n })\n );\n // Implementar la lógica para repetir la ruta\n }\n\n private handleGenerateRoute() {\n this.dispatchEvent(\n new CustomEvent('generateRoute', {\n detail: {\n accessible: !!this.sdkData?.accessibleRoute,\n },\n bubbles: true,\n composed: true,\n })\n );\n // Implementar la lógica para generar la ruta\n }\n\n private _dismissError() {\n // Track error modal dismissal\n AnalyticsController.getInstance().trackEvent('error_modal_dismissed', {\n error_message: this.sdkData?.routeError,\n origin_id: this.sdkData?.originId,\n destination_id: this.sdkData?.destinationId,\n });\n this.dispatchEvent(\n new CustomEvent('dismissRouteError', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n override render() {\n if (!this.sdkData) return html``;\n const { destination, accessibleRoute, parentPlace, origin, route, isRouteAnimating } = this.sdkData;\n const defaultIcon = accessibleRoute ? this.assets?.accessibilityIcon : this.assets?.walkingIcon;\n const destinationName = destination?.title ?? '';\n const parentPlaceFloors = parentPlace?.innerFloors ?? [];\n const originFloor = (origin && typeof origin.inFloor === 'function' ? origin.inFloor(parentPlaceFloors) : undefined)?.name ?? '';\n const destinationFloor = (destination && typeof destination.inFloor === 'function' ? destination.inFloor(parentPlaceFloors) : undefined)?.name ?? '';\n const isAnimating = isRouteAnimating ?? false;\n let distance = '';\n if (route && route.legs && route.legs.length > 0 && route.legs[0].distance) {\n distance = `• ${route.legs[0].distance.toFixed(0)} mts`;\n }\n return html`\n <div class=\"route-panel\">\n <div class=\"flex flex-col h-full\">\n <div class=\"back-panel\" @click=${this.handleBack}>\n <div class=\"back-content\">\n <span .innerHTML=${this.assets?.backIcon}></span>\n <span class=\"back-text\">Volver</span>\n </div>\n </div>\n\n <div class=\"route-modal\">\n <div class=\"entrance-name d-flex align-items-center\">\n <div class=\"icon_switcher_user_type\">\n <span .innerHTML=${defaultIcon}></span>\n </div>\n <span class=\"justify-content-center place-name\"> ${destinationName} </span>\n ${route\n ? html`\n <button class=\"repeat-route-btn\" @click=${this.handleRepeatRoute} ?disabled=${isAnimating}>\n <span .innerHTML=${this.assets?.repeatIcon}></span>\n <span>Repetir ruta</span>\n </button>\n `\n : ''}\n </div>\n <div class=\"floor-specs\">\n <span class=\"floor-name\">${destinationFloor}</span>\n <span class=\"route-distance\">${distance}</span>\n </div>\n <div class=\"d-flex flex-wrap container-controls\">\n <div class=\"flex-fill route-input-wrapper\">\n <div class=\"c-route-input c-route-input-from\">\n <div class=\"c-route-input-icon\">\n <img src=${this.assets?.originPoint} alt=\"\" class=\"icon-point\" />\n </div>\n Desde mi ubicación\n <span>${originFloor}</span>\n </div>\n <div class=\"c-route-input\" @click=${this.handleBack}>\n <div class=\"c-route-input-icon\">\n <img src=${this.assets?.destinationPoint} alt=\"\" class=\"icon-point\" />\n </div>\n ${destinationName}\n <span>${destinationFloor}</span>\n </div>\n </div>\n <div\n class=\"accessibility-switch ${this.sdkData?.accessibleRoute ? 'accessible' : ''}\"\n @click=${this.handleAccessibility}\n >\n <div class=\"accessibility-switch-icon ${!this.sdkData?.accessibleRoute ? 'active' : ''}\">\n <span .innerHTML=${this.assets?.walkingIcon}></span>\n </div>\n <div class=\"accessibility-switch-icon ${this.sdkData?.accessibleRoute ? 'active' : ''}\">\n <span .innerHTML=${this.assets?.accessibilityIcon}></span>\n </div>\n </div>\n </div>\n\n ${!route\n ? html`\n <div class=\"generate-route-container d-flex justify-content-center align-items-center mt-3\">\n <button class=\"generate-route-btn\" @click=${this.handleGenerateRoute}>\n <span> Generar ruta</span>\n </button>\n </div>\n `\n : ''}\n </div>\n </div>\n </div>\n <qr-modal></qr-modal>\n ${this.sdkData?.routeError\n ? html`\n <div class=\"error-modal-overlay\">\n <div class=\"error-modal\">\n <div class=\"error-icon\">\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z\" stroke=\"currentColor\" stroke-width=\"2\"/>\n <path d=\"M12 8V12\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"/>\n <circle cx=\"12\" cy=\"16\" r=\"1\" fill=\"currentColor\"/>\n </svg>\n </div>\n <p class=\"error-message\">${this.sdkData.routeError}</p>\n <button class=\"error-btn\" @click=${this._dismissError}>Aceptar</button>\n </div>\n </div>\n `\n : ''}\n `;\n }\n}\n"],"names":["Event","constructor","s","t","e","o","super","bubbles","composed","this","context","contextTarget","callback","subscribe","s$1","i","h","provided","value","unsubscribe","host","requestUpdate","addController","hostConnected","dispatchRequest","hostDisconnected","dispatchEvent","setValue","Object","is","updateObservers","subscriptions","Map","disposer","addCallback","has","set","delete","consumerHost","get","clearCallbacks","clear","e$2","i$1","initialValue","onContextRequest","composedPath","stopPropagation","onProviderRequest","Set","add","attachListeners","addEventListener","c","n","addInitializer","call","sdkContext","_paddingLeft","CustomMap","LitElement","mapReady","routeAnimationHandlers","onRouteAnimationFinished","CustomEvent","onFloorChange","floorId","detail","onStartRouteAnimation","onShowMapModal","modal","modalData","onDismissModal","mapContainer","pendingUpdateMarkers","pendingUpdateCamera","routeAnimationController","RouteAnimationController","markerController","MarkerController","paddingLeft","_","firstUpdated","shadowRoot","style","document","createElement","textContent","import","default","appendChild","updated","updateAttributes","sdkData","sdk","parentPlace","locale","generalConfig","currentFloor","markers","route","isRouteAnimating","cameraInitialized","lzMap","setParentPlace","setLocale","setConfig","getElementById","config","mapConfig","zoom","initialZoom","parentPlaceId","lazarilloId","center","initialCenter","lat","lng","minZoom","limitZoomOut","maxZoom","limitZoomIn","showCompass","navigationPosition","pitch","lang","maxBounds","pointsOfInterest","otherPotentialParentPlacesIds","potentialParentPlaces","onMapReady","setMapReady","newFloorId","setCurrentMapFloor","createMap","setMap","setExtraLeftPadding","key","_currentMapFloor","currentMarkerIds","getMarkersIds","newMarkerIds","map","m","id","length","some","includes","updateMarkers","destination","_initializeCamera","currentRoute","getCurrentRoute","removeRoute","startRouteAnimation","isAnimating","clearAllMarkers","origin","originFloor","inFloors","legs","allCoordinates","flatMap","leg","steps","filter","step","startInsideFloor","endInsideFloor","coordinates","position","push","setTimeout","fitCoordinates","padding","top","bottom","left","right","updateCamera","bearing","mapRotations","angle","animate","destFloor","floor","updateFloor","setCurrentFloor","parentElement","closest","compactMode","hasAttribute","zoomSize","getAttribute","setAttribute","removeAttribute","render","html","iconPath","title","WeakMap","styles","css","unsafeCSS","__decorateClass","consume","prototype","property","type","Number","attribute","customElement","_$AU","_$AM","_$AT","_$Ct","_$Ci","_$AS","update","_$litDirective$","values","r","name","strings","Error","keys","join","st","nt","split","element","classList","remove","BaseFloorSelector","getFloors","floors","innerFloors","enabledFloors","getCurrentFloor","getEnabledFloors","isFloorActive","isFloorEnabled","f","selectFloor","floorKey","getFloorDisplayName","FloorSelector","isActive","isEnabled","classMap","active","disabled","canPromise","Promise","then","toSJISFunction","CODEWORDS_COUNT","utils","getSymbolSize","version","getSymbolTotalCodewords","getBCHDigit","data","digit","setToSJISFunction","isKanjiModeEnabled","toSJIS","kanji","L","bit","exports","M","Q","H","isValid","level","from","defaultValue","string","toLowerCase","fromString","ECLevel","require$$0","EC_BLOCKS_TABLE","EC_CODEWORDS_TABLE","errorCorrectionCode","getBlocksCount","errorCorrectionLevel","getTotalCodewordsCount","GF","EXP_TABLE","Uint8Array","LOG_TABLE","x","galoisField","log","exp","mul","y","p1","p2","coeff","j","mod","divident","divisor","result","offset","slice","generateECPolynomial","degree","poly","versionCheck","isNaN","numeric","replace","byte","regex","KANJI","RegExp","BYTE_KANJI","BYTE","NUMERIC","ALPHANUMERIC","TEST_KANJI","TEST_NUMERIC","TEST_ALPHANUMERIC","testKanji","str","test","testNumeric","testAlphanumeric","VersionCheck","Regex","require$$1","ccBits","MIXED","getCharCountIndicator","mode","getBestModeForData","dataStr","toString","Utils","ECCode","require$$2","Mode","require$$3","require$$4","G18_BCH","getReservedBitsCount","getTotalBitsFromDataArray","segments","totalBits","forEach","reservedBits","getBitsLength","parseInt","getCapacity","dataTotalCodewordsBits","usableBits","Math","getBestVersionForData","seg","ecl","Array","isArray","currentVersion","getBestVersionForMixedData","getBestVersionForDataLength","getLength","getEncodedBits","d","dijkstra","single_source_shortest_paths","graph","predecessors","costs","u","v","cost_of_s_to_u","adjacent_nodes","cost_of_s_to_u_plus_cost_of_e","cost_of_s_to_v","open","PriorityQueue","make","empty","pop","cost","hasOwnProperty","msg","extract_shortest_path_from_predecessor_list","nodes","reverse","find_path","opts","T","queue","sorter","default_sorter","a","b","item","sort","shift","module","NumericData","write","bitBuffer","group","substr","put","remainingNum","numericData","AlphanumericData","ALPHA_NUM_CHARS","indexOf","alphanumericData","ByteData","TextEncoder","encode","l","byteData","KanjiData","kanjiData","require$$5","require$$6","require$$7","getStringByteLength","unescape","encodeURIComponent","getSegments","exec","index","getSegmentsFromString","numSegs","alphaNumSegs","byteSegs","kanjiSegs","concat","s1","s2","obj","getSegmentBitsLength","buildSingleSegment","modesHint","bestMode","fromArray","array","reduce","acc","segs","buildNodes","table","start","prevNodeIds","nodeGroup","currentNodeIds","node","lastCount","prevNodeId","end","buildGraph","path","optimizedSegs","curr","prevSeg","mergeSegments","rawSplit","BitBuffer","buffer","bufIndex","num","putBit","getLengthInBits","BitMatrix","size","reservedBit","row","col","reserved","xor","isReserved","bitMatrix","AlignmentPattern","getRowColCoords","posCount","intervals","ceil","positions","getPositions","coords","pos","posLength","FinderPattern","finderPattern","MaskPattern","Patterns","PATTERN000","PATTERN001","PATTERN010","PATTERN011","PATTERN100","PATTERN101","PATTERN110","PATTERN111","PenaltyScores","getMaskAt","maskPattern","mask","undefined","getPenaltyN1","points","sameCountCol","sameCountRow","lastCol","lastRow","getPenaltyN2","last","getPenaltyN3","bitsCol","bitsRow","getPenaltyN4","darkCount","modulesCount","abs","applyMask","pattern","getBestMask","setupFormatFunc","numPatterns","bestPattern","lowerPenalty","Infinity","p","penalty","ReedSolomonEncoder","Polynomial","genPoly","initialize","paddedData","remainder","buff","reedSolomonEncoder","require$$8","Version","require$$9","FormatInfo","G15_BCH","formatInfo","require$$10","require$$11","Segments","require$$12","setupFormatInfo","matrix","bits","createData","remainingByte","totalCodewords","ecTotalCodewords","dataTotalCodewords","ecTotalBlocks","blocksInGroup2","blocksInGroup1","totalCodewordsInGroup1","dataCodewordsInGroup1","dataCodewordsInGroup2","ecCount","rs","dcData","ecData","maxDataSize","dataSize","max","createCodewords","createSymbol","estimatedVersion","rawSegments","bestVersion","dataBits","moduleCount","modules","setupFinderPattern","setupTimingPattern","setupAlignmentPattern","setupVersionInfo","inc","bitIndex","byteIndex","dark","setupData","bind","qrcode","create","options","toSJISFunc","hex2rgba","hex","hexCode","apply","hexValue","g","getOptions","color","margin","width","scale","light","rendererOpts","getScale","qrSize","getImageWidth","qrToImageData","imgData","qr","symbolSize","scaledMargin","palette","posDst","pxColor","qrData","canvas","canvasEl","getContext","getCanvasElement","ctx","image","createImageData","clearRect","height","clearCanvas","putImageData","renderToDataURL","toDataURL","quality","getColorAttrib","attrib","alpha","toFixed","svgCmd","cmd","svgTag","cb","qrcodesize","bg","moveBy","newRow","lineLength","qrToPath","viewBox","QRCode","CanvasRenderer","SvgRenderer","renderCanvas","renderFunc","text","args","arguments","argsNum","isLastArgCb","resolve","reject","browser","toCanvas","QRModal","originId","destinationId","lastOriginId","lastDestinationId","baseUrl","url","dataUrl","HTMLImageElement","src","AnalyticsController","getInstance","trackEvent","origin_id","destination_id","qr_url","card","hidden","RouteOptions","assets","_loadAssets","async","accessibilityIcon","backIcon","destinationPoint","originPoint","repeatIcon","walkingIcon","all","loadAssets","handleBack","handleAccessibility","accessibleRoute","handleRepeatRoute","handleGenerateRoute","accessible","_dismissError","error_message","routeError","defaultIcon","destinationName","parentPlaceFloors","inFloor","destinationFloor","distance"],"mappings":";;;;;SAKA,cAAgBA,MAAM,WAAAC,CAAYC,EAAEC,EAAEC,EAAEC,GAAGC,MAAM,kBAAkB,CAACC,SAAQ,EAAGC,UAAS,IAAKC,KAAKC,QAAQR,EAAEO,KAAKE,cAAcR,EAAEM,KAAKG,SAASR,EAAEK,KAAKI,UAAUR,IAAG,CAAE;;;;;;;;;;;ACArK,IAAAS,EAAG,MAAQ,WAAAb,CAAYE,EAAED,EAAEa,EAAEC,GAAG,GAAGP,KAAKI,WAAU,EAAGJ,KAAKQ,UAAS,EAAGR,KAAKS,WAAM,EAAOT,KAAKN,EAAE,CAACA,EAAED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KAAK+qB;;wDAE2B/qB,KAAKoF,SAAS4lB,gBAA6B,GAAX;qCACpDhrB,KAAKmqB,QAAQQ;;wDAEM3qB,KAAKoF,SAAS4lB,gBAAkB,SAAW;qCAC9DhrB,KAAKmqB,QAAQG;;;;;cAKnC3kB,EAQC,GAPAiG,CAAA;;gEAEgD5L,KAAKkrB;;;;;;;;;QAU7DlrB,KAAKoF,SAASkmB,WACZ1f,CAAA;;;;;;;;;;2CAUiC5L,KAAKoF,QAAQkmB;mDACLtrB,KAAKorB;;;YAI9C;KAER,GAvLWlB,GAIKle,OAAS,CAACE,4/KAFhBC,GAAA,CADTC,EAAQ,CAAEnM,QAAS+C,EAAY5C,WAAW,KADhC8pB,GAED7d,UAAA,UAAA,GAFC6d,GAAN/d,GAAA,CADNO,EAAc,kBACFwd","x_google_ignoreList":[0,1,2,3,4,7,8,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-destination-point-DEI58b8w.js","sources":["../../../src/assets/icon-destination-point.svg"],"sourcesContent":["export default \"data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Environment'%3e%3cpath%20id='Vector'%20d='M15.8827%204.52335C15.5044%203.65124%2014.9591%202.86161%2014.2775%202.19902C13.5937%201.53045%2012.7875%200.99981%2011.903%200.636077C10.9829%200.254381%2010.0065%200.0615234%209.00007%200.0615234C7.9936%200.0615234%207.01726%200.254381%206.09717%200.634068C5.20721%201.0017%204.40967%201.52804%203.72261%202.19701C3.04143%202.85997%202.49619%203.64951%202.11748%204.52134C1.72574%205.42536%201.52686%206.38563%201.52686%207.37402C1.52686%208.79233%201.86636%2010.2046%202.53333%2011.5667C3.06971%2012.6615%203.81904%2013.7283%204.76324%2014.7428C6.37641%2016.4745%208.06793%2017.5332%208.54806%2017.8164C8.68435%2017.8969%208.83978%2017.9393%208.99806%2017.939C9.15476%2017.939%209.30944%2017.8988%209.44806%2017.8164C9.92819%2017.5332%2011.6197%2016.4745%2013.2329%2014.7428C14.1771%2013.7303%2014.9264%2012.6615%2015.4628%2011.5667C16.1338%2010.2066%2016.4733%208.79634%2016.4733%207.37603C16.4733%206.38764%2016.2744%205.42737%2015.8827%204.52335ZM9.00007%2016.3981C7.67619%2015.5564%202.97328%2012.2236%202.97328%207.37603C2.97328%205.81108%203.59806%204.34054%204.73311%203.23161C5.87217%202.12068%207.3869%201.50795%209.00007%201.50795C10.6132%201.50795%2012.128%202.12068%2013.267%203.23362C14.4021%204.34054%2015.0269%205.81108%2015.0269%207.37603C15.0269%2012.2236%2010.324%2015.5564%209.00007%2016.3981ZM9.00007%203.99902C7.04739%203.99902%205.46436%205.58206%205.46436%207.53474C5.46436%209.48742%207.04739%2011.0705%209.00007%2011.0705C10.9527%2011.0705%2012.5358%209.48742%2012.5358%207.53474C12.5358%205.58206%2010.9527%203.99902%209.00007%203.99902ZM10.5911%209.12581C10.3825%209.33509%2010.1345%209.50105%209.8614%209.61413C9.58834%209.72722%209.29562%209.7852%209.00007%209.78474C8.3994%209.78474%207.83489%209.54969%207.409%209.12581C7.19972%208.91713%207.03376%208.66912%206.92067%208.39606C6.80759%208.12301%206.74961%207.83029%206.75007%207.53474C6.75007%206.93407%206.98511%206.36956%207.409%205.94367C7.83489%205.51777%208.3994%205.28474%209.00007%205.28474C9.60074%205.28474%2010.1652%205.51777%2010.5911%205.94367C11.017%206.36956%2011.2501%206.93407%2011.2501%207.53474C11.2501%208.13541%2011.017%208.69992%2010.5911%209.12581Z'%20fill='black'%20fill-opacity='0.85'/%3e%3c/g%3e%3c/svg%3e\""],"names":["iconDestinationPoint"],"mappings":"AAAA,MAAAA,EAAe"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-origin-point-GS06gE2l.js","sources":["../../../src/assets/icon-origin-point.svg"],"sourcesContent":["export default \"data:image/svg+xml,%3csvg%20width='22'%20height='22'%20viewBox='0%200%2022%2022'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='11'%20cy='11'%20r='11'%20fill='%23E7F1F7'/%3e%3ccircle%20cx='11.0002'%20cy='10.9999'%20r='6.61538'%20fill='%23396FE5'%20stroke='white'%20stroke-width='2'/%3e%3c/svg%3e\""],"names":["iconOriginPoint"],"mappings":"AAAA,MAAAA,EAAe"}
@@ -1,4 +1,4 @@
1
- import{i as e,n as t,a as o,A as r,l as a,b as i,p as s,R as l,c as n,t as c}from"./route-view-totems-B9nWTUnc.js";import{S as p}from"./utils-DKJkAKFi.js";var d,h,m,v,f,w,y,x,u,g=Object.defineProperty,b=Object.getOwnPropertyDescriptor,z=e=>{throw TypeError(e)},S=(e,t,o,r)=>{for(var a,i=r>1?void 0:r?b(t,o):t,s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r?a(t,o,i):a(i))||i);return r&&i&&g(t,o,i),i},I=(e,t,o)=>t.has(e)||z("Cannot "+o),k=(e,t,o)=>(I(e,t,"read from private field"),o?o.call(e):t.get(e)),P=(e,t,o)=>t.has(e)?z("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,o),C=(e,t,o,r)=>(I(e,t,"write to private field"),t.set(e,o),o);let _=class extends o{constructor(){super(...arguments),P(this,d,""),P(this,h,""),P(this,m,"es"),P(this,v,""),P(this,f,!1),P(this,w,"normal"),P(this,y,!0),P(this,x,"top-left"),P(this,u,!1),this._swPath="/mvx-tiles-sw.js",this._swScope="/",this.sdkController=new p(this),this.analyticsController=r.getInstance(),this.currentFloorId=""}get apiKey(){return k(this,d)}set apiKey(e){C(this,d,e)}get parentPlaceId(){return k(this,h)}set parentPlaceId(e){C(this,h,e)}get locale(){return k(this,m)}set locale(e){C(this,m,e)}get placeId(){return k(this,v)}set placeId(e){C(this,v,e)}get compactMode(){return k(this,f)}set compactMode(e){C(this,f,e)}get zoomButtonSize(){return k(this,w)}set zoomButtonSize(e){C(this,w,e)}get showFloorSelector(){return k(this,y)}set showFloorSelector(e){C(this,y,e)}get floorSelectorPosition(){return k(this,x)}set floorSelectorPosition(e){C(this,x,e)}get floorSelectorDisabled(){return k(this,u)}set floorSelectorDisabled(e){C(this,u,e)}async _loadComponents(){await Promise.all([a(),i()])}_preloadApiRequests(){const e=this.apiKey||this.getAttribute("apiKey")||"",t=this.parentPlaceId||this.getAttribute("parentPlaceId")||"",o=this.locale||this.getAttribute("locale")||"es";if(!e||!t)return;const r=e=>{const t=`mvx-preload:${e}`;if(document.head.querySelector(`link[data-mvx-preload="${t}"]`))return;const o=document.createElement("link");o.rel="preload",o.as="fetch",o.href=e,o.crossOrigin="anonymous",o.setAttribute("fetchpriority","high"),o.setAttribute("data-mvx-preload",t),document.head.appendChild(o)},a="https://api.mapvx.com/sdk/",i=encodeURIComponent;r(`${a}v3/place?token=${i(e)}&place_id=${i(t)}&lang=${i(o)}`),r(`https://api.mapvx.com/api/configuration?token=${i(e)}&lang=${i(o)}&place_id=${i(t)}`),this.placeId&&r(`${a}v3/place?token=${i(e)}&place_id=${i(this.placeId)}&lang=${i(o)}`)}async _registerTileCacheSW(){if("serviceWorker"in navigator)try{await navigator.serviceWorker.register(this._swPath,{scope:this._swScope})}catch{}}async firstUpdated(){this._registerTileCacheSW();const e=this._loadComponents(),t=s();await Promise.all([e,t]),this.analyticsController.initialize("map-view-with-modal"),l.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(e){const t=e.detail;if(this.currentFloorId===t)return;this.currentFloorId=t,this.sdkController.setFloor(t);const o=this.baseParams();o.floor_id=t,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 e={"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 e[this.floorSelectorPosition]||e["top-left"]}updated(e){this.apiKey&&this.locale&&this.parentPlaceId&&(e.has("apiKey")||e.has("locale")||e.has("parentPlaceId"))&&(this._preloadApiRequests(),this.sdkController.prewarm(this.apiKey,this.locale,this.parentPlaceId,{destinationId:this.placeId}),this.sdkController.initialize(this.apiKey,this.locale,this.parentPlaceId)),this.placeId&&e.has("placeId")&&this.sdkController.setOriginAndDestination("",this.placeId)}render(){return n`
1
+ import{i as e,n as t,a as o,A as r,l as a,b as i,p as s,R as l,c as n,t as c}from"./route-view-totems-C-vpK0Jw.js";import{S as p}from"./utils-CIDFE1sK.js";var d,h,m,v,f,w,y,x,u,g=Object.defineProperty,b=Object.getOwnPropertyDescriptor,z=e=>{throw TypeError(e)},S=(e,t,o,r)=>{for(var a,i=r>1?void 0:r?b(t,o):t,s=e.length-1;s>=0;s--)(a=e[s])&&(i=(r?a(t,o,i):a(i))||i);return r&&i&&g(t,o,i),i},I=(e,t,o)=>t.has(e)||z("Cannot "+o),k=(e,t,o)=>(I(e,t,"read from private field"),o?o.call(e):t.get(e)),P=(e,t,o)=>t.has(e)?z("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,o),C=(e,t,o,r)=>(I(e,t,"write to private field"),t.set(e,o),o);let _=class extends o{constructor(){super(...arguments),P(this,d,""),P(this,h,""),P(this,m,"es"),P(this,v,""),P(this,f,!1),P(this,w,"normal"),P(this,y,!0),P(this,x,"top-left"),P(this,u,!1),this._swPath="/mvx-tiles-sw.js",this._swScope="/",this.sdkController=new p(this),this.analyticsController=r.getInstance(),this.currentFloorId=""}get apiKey(){return k(this,d)}set apiKey(e){C(this,d,e)}get parentPlaceId(){return k(this,h)}set parentPlaceId(e){C(this,h,e)}get locale(){return k(this,m)}set locale(e){C(this,m,e)}get placeId(){return k(this,v)}set placeId(e){C(this,v,e)}get compactMode(){return k(this,f)}set compactMode(e){C(this,f,e)}get zoomButtonSize(){return k(this,w)}set zoomButtonSize(e){C(this,w,e)}get showFloorSelector(){return k(this,y)}set showFloorSelector(e){C(this,y,e)}get floorSelectorPosition(){return k(this,x)}set floorSelectorPosition(e){C(this,x,e)}get floorSelectorDisabled(){return k(this,u)}set floorSelectorDisabled(e){C(this,u,e)}async _loadComponents(){await Promise.all([a(),i()])}_preloadApiRequests(){const e=this.apiKey||this.getAttribute("apiKey")||"",t=this.parentPlaceId||this.getAttribute("parentPlaceId")||"",o=this.locale||this.getAttribute("locale")||"es";if(!e||!t)return;const r=e=>{const t=`mvx-preload:${e}`;if(document.head.querySelector(`link[data-mvx-preload="${t}"]`))return;const o=document.createElement("link");o.rel="preload",o.as="fetch",o.href=e,o.crossOrigin="anonymous",o.setAttribute("fetchpriority","high"),o.setAttribute("data-mvx-preload",t),document.head.appendChild(o)},a="https://api.mapvx.com/sdk/",i=encodeURIComponent;r(`${a}v3/place?token=${i(e)}&place_id=${i(t)}&lang=${i(o)}`),r(`https://api.mapvx.com/api/configuration?token=${i(e)}&lang=${i(o)}&place_id=${i(t)}`),this.placeId&&r(`${a}v3/place?token=${i(e)}&place_id=${i(this.placeId)}&lang=${i(o)}`)}async _registerTileCacheSW(){if("serviceWorker"in navigator)try{await navigator.serviceWorker.register(this._swPath,{scope:this._swScope})}catch{}}async firstUpdated(){this._registerTileCacheSW();const e=this._loadComponents(),t=s();await Promise.all([e,t]),this.analyticsController.initialize("map-view-with-modal"),l.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(e){const t=e.detail;if(this.currentFloorId===t)return;this.currentFloorId=t,this.sdkController.setFloor(t);const o=this.baseParams();o.floor_id=t,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 e={"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 e[this.floorSelectorPosition]||e["top-left"]}updated(e){this.apiKey&&this.locale&&this.parentPlaceId&&(e.has("apiKey")||e.has("locale")||e.has("parentPlaceId"))&&(this._preloadApiRequests(),this.sdkController.prewarm(this.apiKey,this.locale,this.parentPlaceId,{destinationId:this.placeId}),this.sdkController.initialize(this.apiKey,this.locale,this.parentPlaceId)),this.placeId&&e.has("placeId")&&this.sdkController.setOriginAndDestination("",this.placeId)}render(){return n`
2
2
  <div class="route-container" style="height: 100%; width: 100%; position: relative;">
3
3
  <custom-map
4
4
  class="map-container"
@@ -74,4 +74,4 @@ import{i as e,n as t,a as o,A as r,l as a,b as i,p as s,R as l,c as n,t as c}fro
74
74
  overflow: hidden;
75
75
  }
76
76
  `],S([t({type:String})],_.prototype,"apiKey",1),S([t({type:String})],_.prototype,"parentPlaceId",1),S([t({type:String})],_.prototype,"locale",1),S([t({type:String})],_.prototype,"placeId",1),S([t({type:Boolean,attribute:"compact-mode",reflect:!0})],_.prototype,"compactMode",1),S([t({type:String,attribute:"zoom-size",reflect:!0})],_.prototype,"zoomButtonSize",1),S([t({type:Boolean})],_.prototype,"showFloorSelector",1),S([t({type:String})],_.prototype,"floorSelectorPosition",1),S([t({type:Boolean})],_.prototype,"floorSelectorDisabled",1),_=S([c("map-view-with-modal")],_);export{_ as M};
77
- //# sourceMappingURL=map-view-with-modal-BP3m9mf6.js.map
77
+ //# sourceMappingURL=map-view-with-modal-D-9U3spD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-view-with-modal-D-9U3spD.js","sources":["../../../src/map-view-with-modal.ts"],"sourcesContent":["import { LitElement, html, css, PropertyValues } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { RollbarController } from './utils/rollbar-controller';\nimport { SDKController } from './utils/sdk-controller';\nimport { AnalyticsController } from './utils/analytics-controller';\nimport { loadCustomMap, loadCompactFloorSelector, preloadMaplibreCss } from './components/lazy-load';\n\n@customElement('map-view-with-modal')\nexport class MapViewWithModal extends LitElement {\n static override styles = [\n css`\n :host {\n display: block;\n height: 100%;\n width: 100%;\n\n /* THEME: Base colors */\n --mvx-primary-color: #251660;\n --mvx-surface-color: #ffffff;\n --mvx-on-surface-color: #251660;\n\n /* THEME: Border and elevation */\n --mvx-border-color: var(--mvx-primary-color);\n --mvx-border-width: 1px;\n --mvx-radius: 8px;\n --mvx-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n\n /* THEME: Typography */\n --mvx-font-family: Poppins, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;\n }\n `,\n css`\n .map-container {\n height: 100%;\n width: 100%;\n }\n `,\n css`\n :host([compact-mode]) .map-container {\n border-radius: 12px;\n overflow: hidden;\n }\n `,\n ];\n\n @property({ type: String })\n accessor apiKey: string = '';\n\n @property({ type: String })\n accessor parentPlaceId: string = '';\n\n @property({ type: String })\n accessor locale: string = 'es';\n\n @property({ type: String })\n accessor placeId: string = '';\n\n @property({ type: Boolean, attribute: 'compact-mode', reflect: true })\n accessor compactMode: boolean = false;\n\n @property({ type: String, attribute: 'zoom-size', reflect: true })\n accessor zoomButtonSize: string = 'normal'; // 'small', 'normal', 'large'\n\n @property({ type: Boolean })\n accessor showFloorSelector: boolean = true;\n\n @property({ type: String })\n accessor floorSelectorPosition: string = 'top-left'; // 'top-left', 'top-center', 'top-right', 'center-left', 'center-right', 'bottom-left', 'bottom-center', 'bottom-right'\n\n @property({ type: Boolean })\n accessor floorSelectorDisabled: boolean = false;\n\n // Internal: automatic Service Worker registration for tile cache\n private readonly _swPath: string = '/mvx-tiles-sw.js';\n private readonly _swScope: string = '/';\n\n private sdkController = new SDKController(this);\n private analyticsController = AnalyticsController.getInstance();\n private currentFloorId: string = '';\n\n private async _loadComponents() {\n await Promise.all([loadCustomMap(), loadCompactFloorSelector()]);\n }\n\n private _preloadApiRequests() {\n const token = this.apiKey || this.getAttribute('apiKey') || '';\n const parent = this.parentPlaceId || this.getAttribute('parentPlaceId') || '';\n const lang = this.locale || this.getAttribute('locale') || 'es';\n if (!token || !parent) return;\n const addPreload = (url: string) => {\n const key = `mvx-preload:${url}`;\n if (document.head.querySelector(`link[data-mvx-preload=\"${key}\"]`)) return;\n const link = document.createElement('link');\n link.rel = 'preload';\n // @ts-expect-error property supported by browsers\n link.as = 'fetch';\n link.href = url;\n link.crossOrigin = 'anonymous';\n link.setAttribute('fetchpriority', 'high');\n link.setAttribute('data-mvx-preload', key);\n document.head.appendChild(link);\n };\n const baseSDK = 'https://api.mapvx.com/sdk/';\n const baseAPI = 'https://api.mapvx.com/api/';\n const enc = encodeURIComponent;\n addPreload(`${baseSDK}v3/place?token=${enc(token)}&place_id=${enc(parent)}&lang=${enc(lang)}`);\n addPreload(`${baseAPI}configuration?token=${enc(token)}&lang=${enc(lang)}&place_id=${enc(parent)}`);\n if (this.placeId) {\n addPreload(`${baseSDK}v3/place?token=${enc(token)}&place_id=${enc(this.placeId)}&lang=${enc(lang)}`);\n }\n }\n\n private async _registerTileCacheSW() {\n // Only attempt in secure contexts and when SW is supported\n if (!('serviceWorker' in navigator)) return;\n try {\n await navigator.serviceWorker.register(this._swPath, { scope: this._swScope });\n } catch {\n // ignore registration errors to avoid breaking host apps\n }\n }\n\n override async firstUpdated() {\n // Try to register Service Worker for tiles early (non-blocking)\n void this._registerTileCacheSW();\n const componentsPromise = this._loadComponents();\n const cssPromise = preloadMaplibreCss();\n await Promise.all([componentsPromise, cssPromise]);\n if (import.meta.env?.PROD) {\n this.analyticsController.initialize('map-view-with-modal');\n RollbarController.initialize('map-view-with-modal');\n }\n }\n\n private _mapReadyHandler() {\n this.sdkController.setMapReady(true);\n this.analyticsController.trackEvent('map_ready', this.baseParams());\n }\n\n private _cameraInitializedHandler() {\n this.sdkController.setCameraInitialized(true);\n this.analyticsController.trackEvent('camera_initialized', this.baseParams());\n }\n\n private _updateFloorHandler(event: CustomEvent) {\n const floorId = event.detail;\n\n // Avoid unnecessary calls if the floor is already the same\n if (this.currentFloorId === floorId) {\n return;\n }\n\n this.currentFloorId = floorId;\n this.sdkController.setFloor(floorId);\n const params: Record<string, string | number> = this.baseParams();\n params['floor_id'] = floorId;\n this.analyticsController.trackEvent('floor_change', params);\n }\n\n private baseParams() {\n return {\n apiKey: this.apiKey,\n locale: this.locale,\n parentPlaceId: this.parentPlaceId,\n placeId: this.placeId,\n host: window.location.host,\n pathname: window.location.pathname,\n search: window.location.search,\n hash: window.location.hash,\n referrer: document.referrer,\n userAgent: navigator.userAgent,\n screenWidth: window.innerWidth,\n };\n }\n\n private getFloorSelectorPositionStyles(): string {\n const positions = {\n 'top-left': 'top: 20px; left: 20px;',\n 'top-center': 'top: 20px; left: 50%; transform: translateX(-50%);',\n 'top-right': 'top: 20px; right: 20px;',\n 'center-left': 'top: 50%; left: 20px; transform: translateY(-50%);',\n 'center-right': 'top: 50%; right: 20px; transform: translateY(-50%);',\n 'bottom-left': 'bottom: 20px; left: 20px;',\n 'bottom-center': 'bottom: 20px; left: 50%; transform: translateX(-50%);',\n 'bottom-right': 'bottom: 20px; right: 20px;',\n };\n\n return positions[this.floorSelectorPosition as keyof typeof positions] || positions['top-left'];\n }\n\n override updated(changedProperties: PropertyValues) {\n if (\n this.apiKey &&\n this.locale &&\n this.parentPlaceId &&\n (changedProperties.has('apiKey') || changedProperties.has('locale') || changedProperties.has('parentPlaceId'))\n ) {\n // Ensure preload tags exist when inputs change\n this._preloadApiRequests();\n // Start SDK prewarm in parallel\n this.sdkController.prewarm(this.apiKey, this.locale, this.parentPlaceId, {\n destinationId: this.placeId,\n });\n this.sdkController.initialize(this.apiKey, this.locale, this.parentPlaceId);\n }\n if (this.placeId && changedProperties.has('placeId')) {\n this.sdkController.setOriginAndDestination('', this.placeId);\n }\n }\n\n render() {\n return html`\n <div class=\"route-container\" style=\"height: 100%; width: 100%; position: relative;\">\n <custom-map\n class=\"map-container\"\n ?compact-mode=${this.compactMode}\n zoom-size=${this.zoomButtonSize}\n style=\"\n /* Forward theme to custom-map */\n --zoom-border-color: var(--mvx-zoom-border-color, var(--mvx-border-color));\n --zoom-border-width: var(--mvx-zoom-border-width, var(--mvx-border-width));\n --zoom-shadow: var(--mvx-zoom-shadow, var(--mvx-shadow));\n --zoom-divider-color: var(--mvx-zoom-divider-color, var(--mvx-zoom-border-color, var(--mvx-border-color)));\n --zoom-divider-width: var(--mvx-zoom-divider-width, var(--mvx-zoom-border-width, var(--mvx-border-width)));\n --zoom-icon-size: var(--mvx-zoom-icon-size, 18px);\n --zoom-icon-color: var(--mvx-zoom-icon-color, var(--mvx-primary-color));\n \"\n @mapReady=${this._mapReadyHandler}\n @cameraInitialized=${this._cameraInitializedHandler}\n @floorChange=${this._updateFloorHandler}\n ></custom-map>\n\n ${this.showFloorSelector\n ? html`\n <!-- Compact floor selector -->\n <div style=\"position: absolute; ${this.getFloorSelectorPositionStyles()} z-index: 1000;\">\n <compact-floor-selector\n @floorChange=${this._updateFloorHandler}\n ?disabled=${this.floorSelectorDisabled}\n style=\"\n /* Forward theme to floor selector */\n --floor-selector-surface: var(--mvx-surface-color);\n --floor-selector-color: var(--mvx-on-surface-color);\n --floor-selector-border-color: var(--mvx-floor-selector-border-color, var(--mvx-border-color));\n --floor-selector-border-width: var(--mvx-floor-selector-border-width, var(--mvx-border-width));\n --floor-selector-radius: var(--mvx-radius);\n --floor-selector-shadow: var(--mvx-floor-selector-shadow, var(--mvx-shadow));\n --floor-selector-hover-accent: var(--mvx-primary-color);\n --floor-selector-active-bg: #f3e7ff;\n --floor-selector-font-family: var(--mvx-font-family);\n --floor-selector-font-size: var(--mvx-floor-selector-font-size, 14px);\n --floor-selector-font-weight: var(--mvx-floor-selector-font-weight, 500);\n \"\n ></compact-floor-selector>\n </div>\n `\n : ''}\n </div>\n `;\n }\n}\n"],"names":["_apiKey","_parentPlaceId","_locale","_placeId","_compactMode","_zoomButtonSize","_showFloorSelector","_floorSelectorPosition","_floorSelectorDisabled","MapViewWithModal","LitElement","constructor","super","arguments","__privateAdd","this","_swPath","_swScope","sdkController","SDKController","analyticsController","AnalyticsController","getInstance","currentFloorId","apiKey","__privateGet","_","__privateSet","parentPlaceId","locale","placeId","compactMode","zoomButtonSize","showFloorSelector","floorSelectorPosition","floorSelectorDisabled","_loadComponents","Promise","all","loadCustomMap","loadCompactFloorSelector","_preloadApiRequests","token","getAttribute","parent","lang","addPreload","url","key","document","head","querySelector","link","createElement","rel","as","href","crossOrigin","setAttribute","appendChild","baseSDK","enc","encodeURIComponent","_registerTileCacheSW","navigator","serviceWorker","register","scope","firstUpdated","componentsPromise","cssPromise","preloadMaplibreCss","initialize","RollbarController","_mapReadyHandler","setMapReady","trackEvent","baseParams","_cameraInitializedHandler","setCameraInitialized","_updateFloorHandler","event","floorId","detail","setFloor","params","host","window","location","pathname","search","hash","referrer","userAgent","screenWidth","innerWidth","getFloorSelectorPositionStyles","positions","updated","changedProperties","has","prewarm","destinationId","setOriginAndDestination","render","html","WeakMap","styles","css","__decorateClass","property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A,cAAA,GAGAJ,EAAA,CADRC,EAAS,CAAEC,KAAMC,OAAQG,UAAW,YAAaC,SAAS,KApDhD3G,EAqDFwG,UAAA,iBAAA,GAGAJ,EAAA,CADRC,EAAS,CAAEC,KAAMG,WAvDPzG,EAwDFwG,UAAA,oBAAA,GAGAJ,EAAA,CADRC,EAAS,CAAEC,KAAMC,UA1DPvG,EA2DFwG,UAAA,wBAAA,GAGAJ,EAAA,CADRC,EAAS,CAAEC,KAAMG,WA7DPzG,EA8DFwG,UAAA,wBAAA,GA9DExG,EAANoG,EAAA,CADNQ,EAAc,wBACF5G"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repeat_icon-DN4_p9eh.js","sources":["../../../src/assets/repeat_icon.svg?raw"],"sourcesContent":["export default \"<svg width=\\\"21\\\" height=\\\"20\\\" viewBox=\\\"0 0 21 20\\\" fill=\\\"currentColor\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n<path d=\\\"M6.36016 17.7535C6.43073 18.1345 6.36016 18.4258 6.17199 18.6051C5.98381 18.7843 5.6545 18.8292 5.27816 18.7395L0.691401 17.4622C-0.0848194 17.2605 -0.22595 16.6555 0.362095 16.1401L1.60875 15.042C1.58523 15.0196 1.58523 14.9972 1.56171 14.9748C-0.978649 10.8964 -0.0848196 5.80955 3.39641 2.73953C3.91389 2.26894 4.50194 1.86558 5.13702 1.48462C6.71299 0.588264 8.43008 0.140085 10.1472 0.117676V1.59667C8.71234 1.64149 7.25399 2.02244 5.93677 2.76193C5.39576 3.07566 4.90181 3.4342 4.45489 3.81516C1.53819 6.39219 0.761966 10.6051 2.76132 14.0112L4.0315 12.8908C4.61954 12.3754 5.23111 12.5547 5.39576 13.2941L6.36016 17.7535ZM15.6278 6.70591C15.7924 7.44541 16.404 7.62468 16.992 7.10927L18.2622 5.98883C20.2616 9.39499 19.4853 13.6079 16.5922 16.1849C16.1452 16.5883 15.6513 16.9244 15.1103 17.2381C13.7931 18 12.3347 18.3586 10.8999 18.4034V19.8824C12.617 19.8376 14.3341 19.3894 15.91 18.5154C16.5451 18.1569 17.1332 17.7311 17.6506 17.2605C21.1083 14.1905 21.9786 9.10367 19.4383 5.04765C19.4148 5.02524 19.4148 5.00283 19.3913 4.98042L20.6379 3.88238C21.226 3.36698 21.0848 2.76193 20.3086 2.56025L15.7218 1.30535C15.3455 1.19331 15.0162 1.26053 14.828 1.4398C14.6398 1.61908 14.5458 1.91039 14.6398 2.29135L15.6278 6.70591Z\\\" fill=\\\"currentColor\\\"/>\\n</svg>\\n\""],"names":["repeat_icon"],"mappings":"AAAA,MAAAA,EAAe"}