@wikicasa-dev/utilities 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/dist/ArrayUtils.cjs +1 -0
  2. package/dist/ArrayUtils.js +4 -0
  3. package/dist/ColorUtils.cjs +1 -0
  4. package/dist/ColorUtils.js +8 -0
  5. package/dist/Control.Geocoder-Dyvby5gX.cjs +1 -0
  6. package/dist/Control.Geocoder-l0sNRNKZ.js +1 -0
  7. package/dist/CookieUtils.cjs +1 -0
  8. package/dist/CookieUtils.js +32 -0
  9. package/dist/CurrencyUtils.cjs +1 -0
  10. package/dist/CurrencyUtils.js +14 -0
  11. package/dist/DOMUtils.cjs +1 -0
  12. package/dist/DOMUtils.js +18 -0
  13. package/dist/DateUtils.cjs +1 -0
  14. package/dist/DateUtils.js +7 -0
  15. package/dist/DeviceDetectionUtils.cjs +1 -0
  16. package/dist/DeviceDetectionUtils.js +8 -0
  17. package/dist/EmailUtils.cjs +1 -0
  18. package/dist/EmailUtils.js +27 -0
  19. package/dist/FavoriteUtils.cjs +1 -0
  20. package/dist/FavoriteUtils.js +13 -0
  21. package/dist/FunctionUtils.cjs +1 -0
  22. package/dist/FunctionUtils.js +21 -0
  23. package/dist/GAutocompleteUtils.cjs +1 -0
  24. package/dist/GAutocompleteUtils.js +23 -0
  25. package/dist/GenericUtils.cjs +1 -0
  26. package/dist/GenericUtils.js +25 -0
  27. package/dist/LazyLoadingBg.cjs +1 -0
  28. package/dist/LazyLoadingBg.js +13 -0
  29. package/dist/Leaflet-BKkoCsyw.js +6436 -0
  30. package/dist/Leaflet-CHOsN941.cjs +1 -0
  31. package/dist/MapUtils.cjs +1 -0
  32. package/dist/MapUtils.js +79 -0
  33. package/dist/NumberUtils.cjs +1 -0
  34. package/dist/NumberUtils.js +50 -0
  35. package/dist/ObjectUtils.cjs +1 -0
  36. package/dist/ObjectUtils.js +23 -0
  37. package/dist/ObserverUtils.cjs +1 -0
  38. package/dist/ObserverUtils.js +20 -0
  39. package/dist/PermissionUtils.cjs +1 -0
  40. package/dist/PermissionUtils.js +18 -0
  41. package/dist/RESB_UrlBuilder.cjs +1 -0
  42. package/dist/RESB_UrlBuilder.js +30 -0
  43. package/dist/RequestUtils.cjs +1 -0
  44. package/dist/RequestUtils.js +13 -0
  45. package/dist/StringUtils.cjs +1 -0
  46. package/dist/StringUtils.js +40 -0
  47. package/dist/URLBuilderUtils.cjs +1 -0
  48. package/dist/URLBuilderUtils.js +11 -0
  49. package/dist/URLPagesFactory.cjs +1 -0
  50. package/dist/URLPagesFactory.js +12 -0
  51. package/dist/agencyAPI.cjs +1 -0
  52. package/dist/agencyAPI.js +61 -0
  53. package/dist/constants.cjs +1 -0
  54. package/dist/constants.js +5 -0
  55. package/dist/geographyAPI.cjs +1 -0
  56. package/dist/geographyAPI.js +73 -0
  57. package/dist/icons.cjs +1 -0
  58. package/dist/icons.js +32 -0
  59. package/dist/index.cjs +1 -0
  60. package/dist/index.d.ts +33 -33
  61. package/dist/index.js +142 -0
  62. package/dist/insightsAPI.cjs +1 -0
  63. package/dist/insightsAPI.js +15 -0
  64. package/dist/leaflet-Dyvby5gX.cjs +1 -0
  65. package/dist/leaflet-freedraw.esm-D8SxeKC1.js +26934 -0
  66. package/dist/leaflet-freedraw.esm-DSDVLXDC.cjs +7 -0
  67. package/dist/leaflet-l0sNRNKZ.js +1 -0
  68. package/dist/leaflet.draw-Dyvby5gX.cjs +1 -0
  69. package/dist/leaflet.draw-l0sNRNKZ.js +1 -0
  70. package/dist/leaflet_map.cjs +1 -0
  71. package/dist/leaflet_map.js +454 -0
  72. package/dist/mailAPI.cjs +1 -0
  73. package/dist/mailAPI.js +51 -0
  74. package/dist/main.cjs +1 -0
  75. package/dist/placesAPI.cjs +1 -0
  76. package/dist/placesAPI.js +47 -0
  77. package/dist/portfolioCustomerAPI.cjs +1 -0
  78. package/dist/portfolioCustomerAPI.js +14 -0
  79. package/dist/publicUserAPI.cjs +1 -0
  80. package/dist/publicUserAPI.js +142 -0
  81. package/dist/realEstateAPI.cjs +1 -0
  82. package/dist/realEstateAPI.js +67 -0
  83. package/dist/requestAPI.cjs +1 -0
  84. package/dist/requestAPI.js +17 -0
  85. package/dist/services/wikicasaPro.d.ts +1 -1
  86. package/dist/servicesUtils.cjs +3 -0
  87. package/dist/servicesUtils.js +12 -0
  88. package/dist/statisticsAPI.cjs +1 -0
  89. package/dist/statisticsAPI.js +58 -0
  90. package/dist/style.css +1 -0
  91. package/dist/types-BaBnqzzG.js +85 -0
  92. package/dist/types-CwWBrQCP.cjs +1 -0
  93. package/dist/valuationAPI.cjs +1 -0
  94. package/dist/valuationAPI.js +21 -0
  95. package/dist/vite-env.cjs +1 -0
  96. package/dist/vite-env.js +1 -0
  97. package/dist/wikicasaPro.cjs +1 -0
  98. package/dist/wikicasaPro.js +14 -0
  99. package/package.json +17 -13
  100. package/dist/utilities.cjs +0 -5
  101. package/dist/utilities.iife.js +0 -5
  102. package/dist/utilities.mjs +0 -2437
  103. package/index.html +0 -13
  104. package/src/custom/constants.ts +0 -3
  105. package/src/custom/icons.ts +0 -63
  106. package/src/custom/leaflet_map.ts +0 -946
  107. package/src/index.ts +0 -171
  108. package/src/services/agencyAPI.ts +0 -105
  109. package/src/services/geographyAPI.ts +0 -129
  110. package/src/services/insightsAPI.ts +0 -20
  111. package/src/services/mailAPI.ts +0 -89
  112. package/src/services/placesAPI.ts +0 -72
  113. package/src/services/portfolioCustomerAPI.ts +0 -16
  114. package/src/services/publicUserAPI.ts +0 -216
  115. package/src/services/realEstateAPI.ts +0 -133
  116. package/src/services/requestAPI.ts +0 -40
  117. package/src/services/servicesUtils.ts +0 -27
  118. package/src/services/statisticsAPI.ts +0 -84
  119. package/src/services/valuationAPI.ts +0 -45
  120. package/src/services/wikicasaPro.ts +0 -25
  121. package/src/utils/ArrayUtils.ts +0 -2
  122. package/src/utils/ColorUtils.ts +0 -11
  123. package/src/utils/CookieUtils.ts +0 -43
  124. package/src/utils/CurrencyUtils.ts +0 -18
  125. package/src/utils/DOMUtils.ts +0 -28
  126. package/src/utils/DateUtils.ts +0 -9
  127. package/src/utils/DeviceDetectionUtils.ts +0 -17
  128. package/src/utils/EmailUtils.ts +0 -45
  129. package/src/utils/FavoriteUtils.ts +0 -19
  130. package/src/utils/FunctionUtils.ts +0 -29
  131. package/src/utils/GAutocompleteUtils.ts +0 -70
  132. package/src/utils/GenericUtils.ts +0 -37
  133. package/src/utils/LazyLoadingBg.ts +0 -18
  134. package/src/utils/MapUtils.ts +0 -118
  135. package/src/utils/NumberUtils.ts +0 -90
  136. package/src/utils/ObjectUtils.ts +0 -34
  137. package/src/utils/ObserverUtils.ts +0 -32
  138. package/src/utils/PermissionUtils.ts +0 -41
  139. package/src/utils/RESB_UrlBuilder.ts +0 -99
  140. package/src/utils/RequestUtils.ts +0 -20
  141. package/src/utils/StringUtils.ts +0 -75
  142. package/src/utils/URLBuilderUtils.ts +0 -21
  143. package/src/utils/URLPagesFactory.ts +0 -20
  144. package/src/vite-env.d.ts +0 -1
  145. package/tsconfig.json +0 -38
  146. package/vite.config.ts +0 -42
  147. /package/{src/main.ts → dist/main.js} +0 -0
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+ "use strict";var v=Object.create;var y=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var T=(l,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _(e))!D.call(l,i)&&i!==t&&y(l,i,{get:()=>e[i],enumerable:!(r=L(e,i))||r.enumerable});return l};var w=(l,e,t)=>(t=l!=null?v(M(l)):{},T(e||!l||!l.__esModule?y(t,"default",{value:l,enumerable:!0}):t,l));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const E=require("./GenericUtils.cjs"),k=require("./constants.cjs"),P=require("./icons.cjs");let m,s;const b=18,x=l=>({guidelineDistance:15,showArea:!0,fillColor:l.lightPrimary,fillOpacity:.75,color:l.primary,opacity:1,weight:3,zIndex:1,stroke:!0,fill:!0,clickable:!0});let g;class H{markers;callbacks;initialized;markerClusterer;clusterHightlight;map;mapContainer;infowindow;infowindowCarousel;freeDraw;shapeLayer;config;drawHandler;spinner;buttonsWrapper;spinnerIcon;drawing;search;constructor(){this.callbacks=[],this.markers=new Map,this.initialized=!1,this.drawing=!1}findMarker(e){return this.markers.get(e)}findCluster(e){const t=this.markers.get(e);if(t)return this.markerClusterer.getVisibleParent(t)}highlightCluster(e){e&&(this.clusterHightlight&&this.clearHighlight(),this.clusterHightlight=e,this.clusterHightlight._icon.classList.add("marker-cluster-selected"))}highlightMarker(e){const t=this.markers.get(e);t&&(this.clusterHightlight=this.markerClusterer.getVisibleParent(t),this.clusterHightlight&&this.clusterHightlight._icon.classList.add("marker-cluster-selected"))}clearHighlight(){this.clusterHightlight&&this.clusterHightlight._icon&&this.clusterHightlight._icon.classList.remove("marker-cluster-selected")}addMarkerBulk(e,t,r,i="/_ui/img/map/mrkr-wikicasa.png"){const a=s.icon({iconUrl:i,iconSize:[27,34],iconAnchor:[0,33]}),o=[];t&&!this.validateCoordinate(t.lat,t.lng)&&(t=null);const h=r||window._mapRange||1e4;for(let n=0;n<e.length;n++){const d=e[n],c=d.id,p={lat:d.latitude,lng:d.longitude};if(!t||this.getDistance(t,p)<h){const u=s.marker(p,{icon:a});u.id=c,this.markers.set(c,u),this.markerClusterer?o.push(u):u.addTo(this.map)}}o.length>0&&this.markerClusterer.addLayers(o)}addMarker(e,t,r){const i={iconUrl:r||`${window._cdn}/_ui/img/Ico/pin-blue.svg`,iconSize:[48,48],iconAnchor:[24,48]},a=$.extend({},i,r),o=s.icon(a),h=s.marker(t,{icon:o});e!=null&&(h.id=e,this.markers.set(e,h)),this.markerClusterer?this.markerClusterer.addLayer(h):h.addTo(this.map)}addCompleteMarker(e){this.markers.set(e.id,e),this.markerClusterer?this.markerClusterer.addLayer(e):e.addTo(this.map)}removeMarker(e){const t=this.findMarker(e);t&&this.map.removeLayer(t)}getVisibleMarkersId(){const e=[],t=Object.keys(this.markers),r=this.map.getBounds();for(let i=0;i<t.length;i++){const a=t[i],o=this.findMarker(Number(a));o&&r.contains(o.getLatLng())&&e.push(Number(a))}return e}initMarkerClusterer(){const e={showCoverageOnHover:!0,spiderfyOnMaxZoom:!1,spiderLegPolylineOptions:{color:g.color},singleMarkerMode:!0},t=this;return new Promise((r,i)=>{Promise.all([import("leaflet.markercluster/dist/MarkerCluster.css"),import("leaflet.markercluster")]).then(()=>{t.markerClusterer=s.markerClusterGroup(e),t.map.addLayer(t.markerClusterer),r()}).catch(a=>{console.error(a),i()})})}detachMarkerClusterer(){this.map.removeLayer(this.markerClusterer)}attachMarkerClusterer(){this.map.addLayer(this.markerClusterer)}disableControls(){this.map.boxZoom.disable(),this.map.doubleClickZoom.disable(),this.map.dragging.disable(),this.map.keyboard.disable(),this.map.scrollWheelZoom.disable(),this.map.touchZoom.disable()}enableControls(){this.map.boxZoom.enable(),this.map.doubleClickZoom.enable(),this.map.dragging.enable(),this.map.keyboard.enable(),this.map.scrollWheelZoom.enable(),this.map.touchZoom.enable()}setDrawing(){this.stopDrawing(),this.disableControls(),this.freeDraw&&(this.freeDraw.mode(m.CREATE),this.map.touchExtend.enable()),this.shapeLayer&&(this.drawHandler=new s.Draw.Polygon(this.map,g),this.drawHandler.enable()),this.drawing=!0}stopDrawing(){this.enableControls(),this.freeDraw&&(this.map.touchExtend.disable(),this.freeDraw.cancel(),this.freeDraw.mode(m.EDIT)),this.drawHandler&&this.drawHandler.disable(),this.drawing=!1}isDrawing(){return this.drawing}initDrawingManager(){return window.touch?new Promise((e,t)=>{Promise.resolve().then(()=>require("./leaflet-freedraw.esm-DSDVLXDC.cjs")).then(r=>{m=r.default,this.freeDraw=new m,this.freeDraw.on("markers",i=>{if(i.eventType==="create"&&i.latLngs.length&&i.latLngs[0].length>2){const a=s.polygon(i.latLngs,g);this.fitBounds(a.getBounds()),this.map.fire("draw:created",{originalEvent:i,layer:a}),this.stopDrawing()}}),this.map.addLayer(this.freeDraw),this.freeDraw.mode(m.NONE),e()}).catch(r=>{console.error(r),t()})}):new Promise((e,t)=>{Promise.all([import("leaflet-draw"),Promise.resolve().then(()=>require("./leaflet.draw-Dyvby5gX.cjs"))]).then(()=>{this.shapeLayer=new s.FeatureGroup,this.map.addLayer(this.shapeLayer),this.map.on("draw:created",r=>{const i=r.layer;this.shapeLayer.clearLayers(),this.shapeLayer.addLayer(i),i.options.editing||(i.options.editing={}),i.editing.enable(),this.fitBounds(i.getBounds())}),s.drawLocal.draw.handlers.polygon.tooltip={start:"Clicca per iniziare a disegnare il poligono",cont:"Clicca per continuare a disegnare il poligono",end:"Clicca sul primo punto per chiudere il poligono"},e()}).catch(r=>{console.error(r),t()})})}drawPolygonFromPoints(e){if(!e)return;const t=s.polygon(e,g);this.freeDraw?this.freeDraw.create(t.getLatLngs()[0]):this.shapeLayer?this.shapeLayer.addLayer(t):(this.shapeLayer=new s.FeatureGroup,this.map.addLayer(this.shapeLayer),this.shapeLayer.addLayer(t)),this.map.fire("draw:created",{layer:t})}deleteMarkers(){const e=Object.keys(this.markers);for(let t=0;t<e.length;t++){const r=e[t],i=this.findMarker(Number(r));i&&this.map.removeLayer(i)}this.markers.clear(),this.markerClusterer&&this.markerClusterer.clearLayers()}deleteShape(){this.freeDraw&&this.freeDraw.clear(),this.shapeLayer&&this.shapeLayer.clearLayers(),this.map.fire("draw:deleted")}hasShape(){return this.freeDraw&&this.freeDraw.size()>0||this.shapeLayer&&this.shapeLayer.getLayers().length>0}getShape(){return this.freeDraw?this.freeDraw.all()[0]:this.shapeLayer?this.shapeLayer.getLayers()[0]:null}getShapePoints(){return this.getShape()?.getLatLngs()[0]??[]}initSearch(){return new Promise((e,t)=>{Promise.all([Promise.resolve().then(()=>require("./Control.Geocoder-Dyvby5gX.cjs")),import("leaflet-control-geocoder")]).then(()=>{this.search=new s.Control.Geocoder({defaultMarkGeocode:!1,collapsed:!1,placeholder:"Inserisci un indirizzo",errorMessage:"Nessun luogo trovato",geocoder:new s.Control.Geocoder.Mapbox(k.MAP_TILER_TOKEN,{serviceUrl:"https://api.mapbox.com/geocoding/v5/mapbox.places/",geocodingQueryParams:{language:"it"},reverseQueryParams:{}})}).on("markgeocode",r=>{this.stopDrawing(),this.deleteShape(),this.fitBounds(r.geocode.bbox),this.setDrawing()}).addTo(this.map),e()}).catch(r=>{console.error(r),t()})})}isInitialized(){return this.initialized}getInfowindow(){return this.infowindow}getInfowindowCarousel(){return this.infowindowCarousel}getMap(){return this.map}getMapContainer(){return this.mapContainer}getMarkers(){return this.markers}getMarkersCount(){return this.markers.size}getMarkerClusterer(){return this.markerClusterer}addListener(e,t,r){e.on(t,r)}init(e,t,r,i,a=null,o=12){if(this.mapContainer=e[0],!this.mapContainer||this.map)return;g=x(r);const h=this.mapContainer.getAttribute("data-zoom");h&&(o=parseInt(h));let n,d;a?(n=a.latitude,d=a.longitude):(n=parseFloat(this.mapContainer.getAttribute("data-lat")||String(0)),d=parseFloat(this.mapContainer.getAttribute("data-lng")||String(0)));const c=this.mapContainer.hasAttribute("data-drawing-manager"),p=this.mapContainer.hasAttribute("data-search"),u=this.mapContainer.hasAttribute("data-cluster");let f=[n,d];this.validateCoordinate(f[0],f[1])||(f=[45.464161,9.190336]),this.config={zoom:o,center:f,cluster:u,search:p,drawing:c},this.load(this.config,t,i)}load(e,t,r){this.spinner||(this.spinner=document.createElement("div"),this.spinner.className="spinner-wrapper",this.spinnerIcon=document.createElement("div"),this.spinnerIcon.className="spinner",this.spinnerIcon.innerHTML=P.SVG,this.spinner.appendChild(this.spinnerIcon),this.mapContainer.appendChild(this.spinner));const i={maxZoom:b,zoomControl:!1},a=$.extend({},i,r);C().then(([o])=>{window.L=o,s=o;const h=this;window.touch&&this.addTouchHandler(),this.map=new s.Map(this.mapContainer,a),s.control.zoom({position:"bottomright"}).addTo(this.map),s.tileLayer(`https://api.maptiler.com/maps/${k.MAP_TILER_STYLE}/{z}/{x}/{y}@2x.png?key=${t}`,{tileSize:512,zoomOffset:-1,minZoom:1,attribution:'<a href="https://www.maptiler.com/copyright/" target="_blank">© MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap contributors</a>',crossOrigin:!0}).addTo(this.map),this.map.setView(e.center,e.zoom),this.infowindow=s.popup().setContent('<div id="infowindow" class="infowindow"><div id="wrapper-single" class="wrapper-single"></div><div id="wrapper-multiple" class="wrapper-multiple"></div></div>'),s.Control.infowindowCarousel=s.Control.extend({options:{position:"bottomleft"},onAdd:function(n){return this._div=s.DomUtil.create("div"),this._div.id="infowindow-carousel",this._div.className="infowindow-carousel siema bg-white text-left m-0 d-sm-none",this._div.addEventListener("mouseover",()=>{n.dragging.disable()}),this._div.addEventListener("mouseout",()=>{n.dragging.enable()}),h.infowindowCarousel=this._div,this._div}}),this.map.addControl(new s.Control.infowindowCarousel),Promise.all([e.search?this.initSearch():Promise.resolve(),e.cluster?this.initMarkerClusterer():Promise.resolve(),e.drawing?this.initDrawingManager():Promise.resolve(),new Promise(n=>this.map.whenReady(()=>n()))]).then(()=>{this.stopSpinner(),this.mapContainer.dispatchEvent(E.createCustomEvent("ready",{detail:{description:"Map init is complete"},bubbles:!0,cancelable:!0})),this.initialized=!0;for(let n=0;n<this.callbacks.length;n++)this.callbacks[n]()})})}startSpinner(){this.spinner.style.display="block"}stopSpinner(){this.spinner.style.display="none"}ready(e){this.isInitialized()?e():this.callbacks.push(e)}on(e,t){this.ready(()=>{this.map.on(e,t)})}setCenter(e,t,r=13){this.map&&this.validateCoordinate(e,t)&&this.map.setView([e,t],r)}setZoom(e){this.map.setView(this.map.getCenter(),e)}getZoom(){return this.map.getZoom()}reset(){this.stopDrawing(),this.deleteShape(),this.deleteMarkers()}fitBounds(e,t={padding:[0,0]}){this.map.fitBounds(s.latLngBounds(e.getNorthEast(),e.getSouthWest()),t)}fitZoom(e){!this.map.getBounds().contains(e)&&this.map.getZoom()>1&&(this.map.setZoom(this.map.getZoom()-1),this.fitZoom(e))}validateCoordinate(e,t){return!(!e||e===0||90<Math.abs(e)||!t||t===0||180<Math.abs(t))}getDistance(e,t){return this.map.distance(e,t)}geocode(e){return $.ajax({dataType:"json",contentType:"application/json",type:"GET",url:`https://api.mapbox.com/geocoding/v5/mapbox.places/${e}.json?language=it&access_token=${k.MAP_TILER_TOKEN}`})}isMarkerInsidePolygon(e,t){const r=e[0],i=e[1];let a=!1;for(let o=0,h=t.length-1;o<t.length;h=o++){const n=t[o].lat,d=t[o].lng,c=t[h].lat,p=t[h].lng;d>i!=p>i&&r<(c-n)*(i-d)/(p-d)+n&&(a=!a)}return a}addButton(e){this.buttonsWrapper||(this.buttonsWrapper=$('<div class="map-btn"></div>'),$(this.mapContainer).append(this.buttonsWrapper)),this.buttonsWrapper.append(e)}addTouchHandler(){s.Map.mergeOptions({touchExtend:!0}),s.Map.TouchExtend=s.Handler.extend({initialize:function(e){this._map=e,this._container=e.getContainer()},addHooks:function(){s.DomEvent.on(this._container,"touchstart",this._onTouchStart,this),s.DomEvent.on(this._container,"touchend",this._onTouchEnd,this),s.DomEvent.on(this._container,"touchmove",this._onTouchMove,this)},removeHooks:function(){s.DomEvent.off(this._container,"touchstart",this._onTouchStart,this),s.DomEvent.off(this._container,"touchend",this._onTouchEnd,this),s.DomEvent.off(this._container,"touchmove",this._onTouchMove,this)},_onTouchEvent:function(e,t){if(!this._map._loaded)return;const r=e.touches[0],i=this._container.getBoundingClientRect(),a=r.clientX-i.left-this._container.clientLeft,o=r.clientY-i.top-this._container.clientTop,h=s.point(a,o),n=this._map.containerPointToLayerPoint(h),d=this._map.layerPointToLatLng(n);try{this._map.fire(t,{latlng:d,layerPoint:n,containerPoint:h,originalEvent:e})}catch{}},_onTouchStart:function(e){this._onTouchEvent(e,"mousedown")},_onTouchEnd:function(e){this._map._loaded&&this._map.fire("mouseup",{originalEvent:e})},_onTouchMove:function(e){this._onTouchEvent(e,"mousemove")}}),s.Map.addInitHook("addHandler","touchExtend",s.Map.TouchExtend)}}function C(){return Promise.all([Promise.resolve().then(()=>require("./Leaflet-CHOsN941.cjs")),Promise.resolve().then(()=>require("./leaflet-Dyvby5gX.cjs"))])}exports.MAX_ZOOM=b;exports.default=H;exports.getL=C;
@@ -0,0 +1,454 @@
1
+ import { createCustomEvent as k } from "./GenericUtils.js";
2
+ import { MAP_TILER_TOKEN as w, MAP_TILER_STYLE as y } from "./constants.js";
3
+ import { SVG as b } from "./icons.js";
4
+ let m, s;
5
+ const C = 18, v = (f) => ({
6
+ guidelineDistance: 15,
7
+ showArea: !0,
8
+ fillColor: f.lightPrimary,
9
+ fillOpacity: 0.75,
10
+ color: f.primary,
11
+ opacity: 1,
12
+ weight: 3,
13
+ zIndex: 1,
14
+ stroke: !0,
15
+ fill: !0,
16
+ clickable: !0
17
+ });
18
+ let u;
19
+ class E {
20
+ markers;
21
+ callbacks;
22
+ initialized;
23
+ markerClusterer;
24
+ clusterHightlight;
25
+ map;
26
+ mapContainer;
27
+ infowindow;
28
+ infowindowCarousel;
29
+ freeDraw;
30
+ shapeLayer;
31
+ config;
32
+ drawHandler;
33
+ spinner;
34
+ buttonsWrapper;
35
+ spinnerIcon;
36
+ drawing;
37
+ // @ts-ignore
38
+ search;
39
+ constructor() {
40
+ this.callbacks = [], this.markers = /* @__PURE__ */ new Map(), this.initialized = !1, this.drawing = !1;
41
+ }
42
+ findMarker(e) {
43
+ return this.markers.get(e);
44
+ }
45
+ findCluster(e) {
46
+ const t = this.markers.get(e);
47
+ if (t)
48
+ return this.markerClusterer.getVisibleParent(t);
49
+ }
50
+ highlightCluster(e) {
51
+ e && (this.clusterHightlight && this.clearHighlight(), this.clusterHightlight = e, this.clusterHightlight._icon.classList.add("marker-cluster-selected"));
52
+ }
53
+ highlightMarker(e) {
54
+ const t = this.markers.get(e);
55
+ t && (this.clusterHightlight = this.markerClusterer.getVisibleParent(t), this.clusterHightlight && this.clusterHightlight._icon.classList.add("marker-cluster-selected"));
56
+ }
57
+ clearHighlight() {
58
+ this.clusterHightlight && this.clusterHightlight._icon && this.clusterHightlight._icon.classList.remove("marker-cluster-selected");
59
+ }
60
+ addMarkerBulk(e, t, i, r = "/_ui/img/map/mrkr-wikicasa.png") {
61
+ const a = s.icon({
62
+ iconUrl: r,
63
+ iconSize: [27, 34],
64
+ iconAnchor: [0, 33]
65
+ /* popupAnchor: [-3, -76],
66
+ shadowSize: [68, 95],
67
+ shadowAnchor: [22, 94]*/
68
+ }), o = [];
69
+ t && !this.validateCoordinate(t.lat, t.lng) && (t = null);
70
+ const h = i || window._mapRange || 1e4;
71
+ for (let n = 0; n < e.length; n++) {
72
+ const l = e[n], d = l.id, c = {
73
+ lat: l.latitude,
74
+ lng: l.longitude
75
+ };
76
+ if (!t || this.getDistance(t, c) < h) {
77
+ const p = s.marker(c, { icon: a });
78
+ p.id = d, this.markers.set(d, p), this.markerClusterer ? o.push(p) : p.addTo(this.map);
79
+ }
80
+ }
81
+ o.length > 0 && this.markerClusterer.addLayers(o);
82
+ }
83
+ addMarker(e, t, i) {
84
+ const r = {
85
+ iconUrl: i || `${window._cdn}/_ui/img/Ico/pin-blue.svg`,
86
+ iconSize: [48, 48],
87
+ iconAnchor: [24, 48]
88
+ /* popupAnchor: [-3, -76],
89
+ shadowSize: [68, 95],
90
+ shadowAnchor: [22, 94]*/
91
+ }, a = $.extend({}, r, i), o = s.icon(a), h = s.marker(t, { icon: o });
92
+ e != null && (h.id = e, this.markers.set(e, h)), this.markerClusterer ? this.markerClusterer.addLayer(h) : h.addTo(this.map);
93
+ }
94
+ addCompleteMarker(e) {
95
+ this.markers.set(e.id, e), this.markerClusterer ? this.markerClusterer.addLayer(e) : e.addTo(this.map);
96
+ }
97
+ removeMarker(e) {
98
+ const t = this.findMarker(e);
99
+ t && this.map.removeLayer(t);
100
+ }
101
+ getVisibleMarkersId() {
102
+ const e = [], t = Object.keys(this.markers), i = this.map.getBounds();
103
+ for (let r = 0; r < t.length; r++) {
104
+ const a = t[r], o = this.findMarker(Number(a));
105
+ o && i.contains(o.getLatLng()) && e.push(Number(a));
106
+ }
107
+ return e;
108
+ }
109
+ initMarkerClusterer() {
110
+ const e = {
111
+ showCoverageOnHover: !0,
112
+ spiderfyOnMaxZoom: !1,
113
+ spiderLegPolylineOptions: {
114
+ color: u.color
115
+ },
116
+ singleMarkerMode: !0
117
+ }, t = this;
118
+ return new Promise(
119
+ (i, r) => {
120
+ Promise.all([
121
+ import("leaflet.markercluster/dist/MarkerCluster.css"),
122
+ import("leaflet.markercluster")
123
+ ]).then(() => {
124
+ t.markerClusterer = s.markerClusterGroup(e), t.map.addLayer(t.markerClusterer), i();
125
+ }).catch((a) => {
126
+ console.error(a), r();
127
+ });
128
+ }
129
+ );
130
+ }
131
+ detachMarkerClusterer() {
132
+ this.map.removeLayer(this.markerClusterer);
133
+ }
134
+ attachMarkerClusterer() {
135
+ this.map.addLayer(this.markerClusterer);
136
+ }
137
+ disableControls() {
138
+ this.map.boxZoom.disable(), this.map.doubleClickZoom.disable(), this.map.dragging.disable(), this.map.keyboard.disable(), this.map.scrollWheelZoom.disable(), this.map.touchZoom.disable();
139
+ }
140
+ enableControls() {
141
+ this.map.boxZoom.enable(), this.map.doubleClickZoom.enable(), this.map.dragging.enable(), this.map.keyboard.enable(), this.map.scrollWheelZoom.enable(), this.map.touchZoom.enable();
142
+ }
143
+ setDrawing() {
144
+ this.stopDrawing(), this.disableControls(), this.freeDraw && (this.freeDraw.mode(m.CREATE), this.map.touchExtend.enable()), this.shapeLayer && (this.drawHandler = new s.Draw.Polygon(this.map, u), this.drawHandler.enable()), this.drawing = !0;
145
+ }
146
+ stopDrawing() {
147
+ this.enableControls(), this.freeDraw && (this.map.touchExtend.disable(), this.freeDraw.cancel(), this.freeDraw.mode(m.EDIT)), this.drawHandler && this.drawHandler.disable(), this.drawing = !1;
148
+ }
149
+ isDrawing() {
150
+ return this.drawing;
151
+ }
152
+ initDrawingManager() {
153
+ return window.touch ? new Promise(
154
+ (e, t) => {
155
+ import("./leaflet-freedraw.esm-D8SxeKC1.js").then((i) => {
156
+ m = i.default, this.freeDraw = new m(), this.freeDraw.on("markers", (r) => {
157
+ if (r.eventType === "create" && r.latLngs.length && r.latLngs[0].length > 2) {
158
+ const a = s.polygon(
159
+ r.latLngs,
160
+ u
161
+ );
162
+ this.fitBounds(a.getBounds()), this.map.fire("draw:created", {
163
+ originalEvent: r,
164
+ layer: a
165
+ }), this.stopDrawing();
166
+ }
167
+ }), this.map.addLayer(this.freeDraw), this.freeDraw.mode(m.NONE), e();
168
+ }).catch((i) => {
169
+ console.error(i), t();
170
+ });
171
+ }
172
+ ) : new Promise(
173
+ (e, t) => {
174
+ Promise.all([
175
+ import("leaflet-draw"),
176
+ import("./leaflet.draw-l0sNRNKZ.js")
177
+ ]).then(() => {
178
+ this.shapeLayer = new s.FeatureGroup(), this.map.addLayer(this.shapeLayer), this.map.on("draw:created", (i) => {
179
+ const r = i.layer;
180
+ this.shapeLayer.clearLayers(), this.shapeLayer.addLayer(r), r.options.editing || (r.options.editing = {}), r.editing.enable(), this.fitBounds(r.getBounds());
181
+ }), s.drawLocal.draw.handlers.polygon.tooltip = {
182
+ start: "Clicca per iniziare a disegnare il poligono",
183
+ cont: "Clicca per continuare a disegnare il poligono",
184
+ end: "Clicca sul primo punto per chiudere il poligono"
185
+ }, e();
186
+ }).catch((i) => {
187
+ console.error(i), t();
188
+ });
189
+ }
190
+ );
191
+ }
192
+ drawPolygonFromPoints(e) {
193
+ if (!e)
194
+ return;
195
+ const t = s.polygon(e, u);
196
+ this.freeDraw ? this.freeDraw.create(t.getLatLngs()[0]) : this.shapeLayer ? this.shapeLayer.addLayer(t) : (this.shapeLayer = new s.FeatureGroup(), this.map.addLayer(this.shapeLayer), this.shapeLayer.addLayer(t)), this.map.fire("draw:created", {
197
+ layer: t
198
+ });
199
+ }
200
+ deleteMarkers() {
201
+ const e = Object.keys(this.markers);
202
+ for (let t = 0; t < e.length; t++) {
203
+ const i = e[t], r = this.findMarker(Number(i));
204
+ r && this.map.removeLayer(r);
205
+ }
206
+ this.markers.clear(), this.markerClusterer && this.markerClusterer.clearLayers();
207
+ }
208
+ deleteShape() {
209
+ this.freeDraw && this.freeDraw.clear(), this.shapeLayer && this.shapeLayer.clearLayers(), this.map.fire("draw:deleted");
210
+ }
211
+ hasShape() {
212
+ return this.freeDraw && this.freeDraw.size() > 0 || this.shapeLayer && this.shapeLayer.getLayers().length > 0;
213
+ }
214
+ getShape() {
215
+ return this.freeDraw ? this.freeDraw.all()[0] : this.shapeLayer ? this.shapeLayer.getLayers()[0] : null;
216
+ }
217
+ getShapePoints() {
218
+ return this.getShape()?.getLatLngs()[0] ?? [];
219
+ }
220
+ initSearch() {
221
+ return new Promise(
222
+ (e, t) => {
223
+ Promise.all([
224
+ import("./Control.Geocoder-l0sNRNKZ.js"),
225
+ import("leaflet-control-geocoder")
226
+ ]).then(() => {
227
+ this.search = new s.Control.Geocoder({
228
+ defaultMarkGeocode: !1,
229
+ collapsed: !1,
230
+ placeholder: "Inserisci un indirizzo",
231
+ errorMessage: "Nessun luogo trovato",
232
+ geocoder: new s.Control.Geocoder.Mapbox(w, {
233
+ serviceUrl: "https://api.mapbox.com/geocoding/v5/mapbox.places/",
234
+ geocodingQueryParams: { language: "it" },
235
+ reverseQueryParams: {}
236
+ })
237
+ }).on("markgeocode", (i) => {
238
+ this.stopDrawing(), this.deleteShape(), this.fitBounds(i.geocode.bbox), this.setDrawing();
239
+ }).addTo(this.map), e();
240
+ }).catch((i) => {
241
+ console.error(i), t();
242
+ });
243
+ }
244
+ );
245
+ }
246
+ isInitialized() {
247
+ return this.initialized;
248
+ }
249
+ getInfowindow() {
250
+ return this.infowindow;
251
+ }
252
+ getInfowindowCarousel() {
253
+ return this.infowindowCarousel;
254
+ }
255
+ getMap() {
256
+ return this.map;
257
+ }
258
+ getMapContainer() {
259
+ return this.mapContainer;
260
+ }
261
+ getMarkers() {
262
+ return this.markers;
263
+ }
264
+ getMarkersCount() {
265
+ return this.markers.size;
266
+ }
267
+ getMarkerClusterer() {
268
+ return this.markerClusterer;
269
+ }
270
+ addListener(e, t, i) {
271
+ e.on(t, i);
272
+ }
273
+ init(e, t, i, r, a = null, o = 12) {
274
+ if (this.mapContainer = e[0], !this.mapContainer || this.map)
275
+ return;
276
+ u = v(i);
277
+ const h = this.mapContainer.getAttribute("data-zoom");
278
+ h && (o = parseInt(h));
279
+ let n, l;
280
+ a ? (n = a.latitude, l = a.longitude) : (n = parseFloat(this.mapContainer.getAttribute("data-lat") || String(0)), l = parseFloat(this.mapContainer.getAttribute("data-lng") || String(0)));
281
+ const d = this.mapContainer.hasAttribute("data-drawing-manager"), c = this.mapContainer.hasAttribute("data-search"), p = this.mapContainer.hasAttribute("data-cluster");
282
+ let g = [n, l];
283
+ this.validateCoordinate(g[0], g[1]) || (g = [45.464161, 9.190336]), this.config = { zoom: o, center: g, cluster: p, search: c, drawing: d }, this.load(this.config, t, r);
284
+ }
285
+ load(e, t, i) {
286
+ this.spinner || (this.spinner = document.createElement("div"), this.spinner.className = "spinner-wrapper", this.spinnerIcon = document.createElement("div"), this.spinnerIcon.className = "spinner", this.spinnerIcon.innerHTML = b, this.spinner.appendChild(this.spinnerIcon), this.mapContainer.appendChild(this.spinner));
287
+ const r = {
288
+ maxZoom: C,
289
+ zoomControl: !1
290
+ }, a = $.extend({}, r, i);
291
+ L().then(([o]) => {
292
+ window.L = o, s = o;
293
+ const h = this;
294
+ window.touch && this.addTouchHandler(), this.map = new s.Map(this.mapContainer, a), s.control.zoom({
295
+ position: "bottomright"
296
+ }).addTo(this.map), s.tileLayer(
297
+ `https://api.maptiler.com/maps/${y}/{z}/{x}/{y}@2x.png?key=${t}`,
298
+ {
299
+ tileSize: 512,
300
+ zoomOffset: -1,
301
+ minZoom: 1,
302
+ // eslint-disable-next-line max-len
303
+ attribution: '<a href="https://www.maptiler.com/copyright/" target="_blank">© MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap contributors</a>',
304
+ crossOrigin: !0
305
+ }
306
+ ).addTo(this.map), this.map.setView(e.center, e.zoom), this.infowindow = s.popup().setContent(
307
+ '<div id="infowindow" class="infowindow"><div id="wrapper-single" class="wrapper-single"></div><div id="wrapper-multiple" class="wrapper-multiple"></div></div>'
308
+ ), s.Control.infowindowCarousel = s.Control.extend({
309
+ options: {
310
+ position: "bottomleft"
311
+ },
312
+ onAdd: function(n) {
313
+ return this._div = s.DomUtil.create("div"), this._div.id = "infowindow-carousel", this._div.className = "infowindow-carousel siema bg-white text-left m-0 d-sm-none", this._div.addEventListener("mouseover", () => {
314
+ n.dragging.disable();
315
+ }), this._div.addEventListener("mouseout", () => {
316
+ n.dragging.enable();
317
+ }), h.infowindowCarousel = this._div, this._div;
318
+ }
319
+ }), this.map.addControl(new s.Control.infowindowCarousel()), Promise.all([
320
+ e.search ? this.initSearch() : Promise.resolve(),
321
+ e.cluster ? this.initMarkerClusterer() : Promise.resolve(),
322
+ e.drawing ? this.initDrawingManager() : Promise.resolve(),
323
+ new Promise(
324
+ (n) => this.map.whenReady(() => n())
325
+ )
326
+ ]).then(() => {
327
+ this.stopSpinner(), this.mapContainer.dispatchEvent(
328
+ k("ready", {
329
+ detail: {
330
+ description: "Map init is complete"
331
+ },
332
+ bubbles: !0,
333
+ cancelable: !0
334
+ })
335
+ ), this.initialized = !0;
336
+ for (let n = 0; n < this.callbacks.length; n++)
337
+ this.callbacks[n]();
338
+ });
339
+ });
340
+ }
341
+ startSpinner() {
342
+ this.spinner.style.display = "block";
343
+ }
344
+ stopSpinner() {
345
+ this.spinner.style.display = "none";
346
+ }
347
+ ready(e) {
348
+ this.isInitialized() ? e() : this.callbacks.push(e);
349
+ }
350
+ on(e, t) {
351
+ this.ready(() => {
352
+ this.map.on(e, t);
353
+ });
354
+ }
355
+ setCenter(e, t, i = 13) {
356
+ this.map && this.validateCoordinate(e, t) && this.map.setView([e, t], i);
357
+ }
358
+ setZoom(e) {
359
+ this.map.setView(this.map.getCenter(), e);
360
+ }
361
+ getZoom() {
362
+ return this.map.getZoom();
363
+ }
364
+ reset() {
365
+ this.stopDrawing(), this.deleteShape(), this.deleteMarkers();
366
+ }
367
+ fitBounds(e, t = { padding: [0, 0] }) {
368
+ this.map.fitBounds(
369
+ s.latLngBounds(e.getNorthEast(), e.getSouthWest()),
370
+ t
371
+ );
372
+ }
373
+ fitZoom(e) {
374
+ !this.map.getBounds().contains(e) && this.map.getZoom() > 1 && (this.map.setZoom(this.map.getZoom() - 1), this.fitZoom(e));
375
+ }
376
+ validateCoordinate(e, t) {
377
+ return !(!e || e === 0 || 90 < Math.abs(e) || !t || t === 0 || 180 < Math.abs(t));
378
+ }
379
+ getDistance(e, t) {
380
+ return this.map.distance(e, t);
381
+ }
382
+ geocode(e) {
383
+ return $.ajax({
384
+ dataType: "json",
385
+ contentType: "application/json",
386
+ type: "GET",
387
+ url: `https://api.mapbox.com/geocoding/v5/mapbox.places/${e}.json?language=it&access_token=${w}`
388
+ });
389
+ }
390
+ isMarkerInsidePolygon(e, t) {
391
+ const i = e[0], r = e[1];
392
+ let a = !1;
393
+ for (let o = 0, h = t.length - 1; o < t.length; h = o++) {
394
+ const n = t[o].lat, l = t[o].lng, d = t[h].lat, c = t[h].lng;
395
+ l > r != c > r && i < (d - n) * (r - l) / (c - l) + n && (a = !a);
396
+ }
397
+ return a;
398
+ }
399
+ addButton(e) {
400
+ this.buttonsWrapper || (this.buttonsWrapper = $('<div class="map-btn"></div>'), $(this.mapContainer).append(this.buttonsWrapper)), this.buttonsWrapper.append(e);
401
+ }
402
+ addTouchHandler() {
403
+ s.Map.mergeOptions({
404
+ touchExtend: !0
405
+ }), s.Map.TouchExtend = s.Handler.extend({
406
+ initialize: function(e) {
407
+ this._map = e, this._container = e.getContainer();
408
+ },
409
+ addHooks: function() {
410
+ s.DomEvent.on(this._container, "touchstart", this._onTouchStart, this), s.DomEvent.on(this._container, "touchend", this._onTouchEnd, this), s.DomEvent.on(this._container, "touchmove", this._onTouchMove, this);
411
+ },
412
+ removeHooks: function() {
413
+ s.DomEvent.off(this._container, "touchstart", this._onTouchStart, this), s.DomEvent.off(this._container, "touchend", this._onTouchEnd, this), s.DomEvent.off(this._container, "touchmove", this._onTouchMove, this);
414
+ },
415
+ _onTouchEvent: function(e, t) {
416
+ if (!this._map._loaded)
417
+ return;
418
+ const i = e.touches[0], r = this._container.getBoundingClientRect(), a = i.clientX - r.left - this._container.clientLeft, o = i.clientY - r.top - this._container.clientTop, h = s.point(a, o), n = this._map.containerPointToLayerPoint(h), l = this._map.layerPointToLatLng(n);
419
+ try {
420
+ this._map.fire(t, {
421
+ latlng: l,
422
+ layerPoint: n,
423
+ containerPoint: h,
424
+ originalEvent: e
425
+ });
426
+ } catch {
427
+ }
428
+ },
429
+ _onTouchStart: function(e) {
430
+ this._onTouchEvent(e, "mousedown");
431
+ },
432
+ _onTouchEnd: function(e) {
433
+ this._map._loaded && this._map.fire("mouseup", {
434
+ originalEvent: e
435
+ });
436
+ },
437
+ _onTouchMove: function(e) {
438
+ this._onTouchEvent(e, "mousemove");
439
+ }
440
+ }), s.Map.addInitHook("addHandler", "touchExtend", s.Map.TouchExtend);
441
+ }
442
+ }
443
+ function L() {
444
+ return Promise.all([
445
+ //@ts-ignore
446
+ import("./Leaflet-BKkoCsyw.js"),
447
+ import("./leaflet-l0sNRNKZ.js")
448
+ ]);
449
+ }
450
+ export {
451
+ C as MAX_ZOOM,
452
+ E as default,
453
+ L as getL
454
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("axios"),t=require("./servicesUtils.cjs"),o=`${t.baseURL}/rest/mail`,n=async e=>{try{return(await s.post(`${o}/infoPremium`,e)).data}catch(r){throw t.handleAxiosError(r),r}},a=async e=>{try{return(await s.post(`${o}/sendBrochurePremium`,e)).data}catch(r){throw t.handleAxiosError(r),r}},c=async e=>{try{return(await s.post(`${o}/submitJobApplication`,e,{headers:{"Content-Type":"multipart/form-data"}})).data}catch(r){throw t.handleAxiosError(r),r}},i=async e=>{try{return(await s.post(`${o}/sendBrochureMR`,e)).data}catch(r){throw t.handleAxiosError(r),r}},d=async e=>{try{return(await s.post(`${o}/infoMR`,e)).data}catch(r){throw t.handleAxiosError(r),r}};exports.sendBrochureMR=i;exports.sendBrochureRequest=a;exports.sendInfoMR=d;exports.sendInfoPremium=n;exports.sendJobApplicationForm=c;
@@ -0,0 +1,51 @@
1
+ import e from "axios";
2
+ import { handleAxiosError as o, baseURL as a } from "./servicesUtils.js";
3
+ const s = `${a}/rest/mail`, i = async (t) => {
4
+ try {
5
+ return (await e.post(`${s}/infoPremium`, t)).data;
6
+ } catch (r) {
7
+ throw o(r), r;
8
+ }
9
+ }, h = async (t) => {
10
+ try {
11
+ return (await e.post(`${s}/sendBrochurePremium`, t)).data;
12
+ } catch (r) {
13
+ throw o(r), r;
14
+ }
15
+ }, d = async (t) => {
16
+ try {
17
+ return (await e.post(
18
+ `${s}/submitJobApplication`,
19
+ t,
20
+ {
21
+ headers: {
22
+ "Content-Type": "multipart/form-data"
23
+ }
24
+ }
25
+ )).data;
26
+ } catch (r) {
27
+ throw o(r), r;
28
+ }
29
+ }, m = async (t) => {
30
+ try {
31
+ return (await e.post(
32
+ `${s}/sendBrochureMR`,
33
+ t
34
+ )).data;
35
+ } catch (r) {
36
+ throw o(r), r;
37
+ }
38
+ }, u = async (t) => {
39
+ try {
40
+ return (await e.post(`${s}/infoMR`, t)).data;
41
+ } catch (r) {
42
+ throw o(r), r;
43
+ }
44
+ };
45
+ export {
46
+ m as sendBrochureMR,
47
+ h as sendBrochureRequest,
48
+ u as sendInfoMR,
49
+ i as sendInfoPremium,
50
+ d as sendJobApplicationForm
51
+ };
package/dist/main.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";console.log("Hello World");
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("axios"),i=require("./servicesUtils.cjs"),c=require("./URLBuilderUtils.cjs"),o=window._baseURLIt,a="/ws",u=async(r,t=[],e="")=>{try{return e||(e=""),(await n.get(`${a}/places?query=${r}&type=${t.join(",")}${e?`&provinceID=${e}`:""}`)).data}catch(s){throw i.handleAxiosError(s),s}};function y(r,t="C,P,Z,L,I,R,A"){return new Promise(e=>{n.get(`${a}/places?query=${r}&type=${t}`).then(s=>{s?.data||e([]),e(s?.data)})})}function g(r){return new Promise(t=>{n.get(`${a}/zones?cityID=${r}`).then(e=>{if(!e?.data){t([]);return}t(e?.data)})})}const l=async r=>{try{return(await n.get(c.appendQueryString(new URL(`${o}${a}/districts`),{zoneID:r}).toString())).data}catch(t){throw i.handleAxiosError(t),t}};exports.getDistrictsByZoneId=l;exports.getPlace=y;exports.getPlacesByQuery=u;exports.getZones=g;
@@ -0,0 +1,47 @@
1
+ import n from "axios";
2
+ import { handleAxiosError as s } from "./servicesUtils.js";
3
+ import { appendQueryString as i } from "./URLBuilderUtils.js";
4
+ const c = window._baseURLIt, o = "/ws", g = async (r, t = [], e = "") => {
5
+ try {
6
+ return e || (e = ""), (await n.get(
7
+ `${o}/places?query=${r}&type=${t.join(",")}${e ? `&provinceID=${e}` : ""}`
8
+ )).data;
9
+ } catch (a) {
10
+ throw s(a), a;
11
+ }
12
+ };
13
+ function w(r, t = "C,P,Z,L,I,R,A") {
14
+ return new Promise((e) => {
15
+ n.get(`${o}/places?query=${r}&type=${t}`).then((a) => {
16
+ a?.data || e([]), e(a?.data);
17
+ });
18
+ });
19
+ }
20
+ function d(r) {
21
+ return new Promise((t) => {
22
+ n.get(`${o}/zones?cityID=${r}`).then((e) => {
23
+ if (!e?.data) {
24
+ t([]);
25
+ return;
26
+ }
27
+ t(e?.data);
28
+ });
29
+ });
30
+ }
31
+ const f = async (r) => {
32
+ try {
33
+ return (await n.get(
34
+ i(new URL(`${c}${o}/districts`), {
35
+ zoneID: r
36
+ }).toString()
37
+ )).data;
38
+ } catch (t) {
39
+ throw s(t), t;
40
+ }
41
+ };
42
+ export {
43
+ f as getDistrictsByZoneId,
44
+ w as getPlace,
45
+ g as getPlacesByQuery,
46
+ d as getZones
47
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("axios"),s=require("./servicesUtils.cjs"),o=async t=>{try{return(await r.post(`/rest/portfolioCustomer/updateNewsletterConsent/?email=${t}`)).data}catch(e){throw s.handleAxiosError(e),e}};exports.updateNewsletterConsent=o;
@@ -0,0 +1,14 @@
1
+ import e from "axios";
2
+ import { handleAxiosError as o } from "./servicesUtils.js";
3
+ const n = async (r) => {
4
+ try {
5
+ return (await e.post(
6
+ `/rest/portfolioCustomer/updateNewsletterConsent/?email=${r}`
7
+ )).data;
8
+ } catch (t) {
9
+ throw o(t), t;
10
+ }
11
+ };
12
+ export {
13
+ n as updateNewsletterConsent
14
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./types-CwWBrQCP.cjs"),t=require("axios"),s=require("./servicesUtils.cjs"),i=window._baseURLIt,a=`${i}/rest/publicUser`,u=async()=>{try{return(await t.get(`${a}/getMenuInfo`)).data}catch(e){throw s.handleAxiosError(e),null}},l=async()=>{try{return(await t.get(`${a}/getUser`)).data}catch(e){throw s.handleAxiosError(e),null}},d=async e=>{try{return(await t.get(`${a}/getMarketingConsent?email=${e}`)).data}catch(r){return s.handleAxiosError(r),!1}},h=async()=>{try{return(await t.post(`${a}/deleteAllUserSaveSearch`)).data}catch(e){throw s.handleAxiosError(e),null}},y=async e=>{try{return(await t.post(`${a}/deleteUserSaveSearchParam/${e}`)).data}catch(r){throw s.handleAxiosError(r),null}},g=async()=>{try{return(await t.get(`${a}/getFavouriteIdList`)).data}catch(e){return s.handleAxiosError(e),[]}},v=async e=>{try{return(await t.post(`${a}/addUserFavourite/${e}`)).data}catch(r){return s.handleAxiosError(r),!1}},S=async e=>{try{return(await t.post(`${a}/deleteUserFavourite/${e}`)).data}catch(r){return s.handleAxiosError(r),!1}},U=async(e,r)=>{if(r===" "||r===" ")return!1;try{return(await t.post(`${a}/updateFavouriteNote`,{realEstateId:e,note:r})).data}catch(n){return s.handleAxiosError(n),!1}},$=async()=>{try{return(await t.post(`${a}/deleteAllUserFavourite`)).data}catch(e){return s.handleAxiosError(e),!1}},w=async e=>{try{return e?(await t.post(`${a}/refreshUserFirebaseToken?token=${e}`),!0):!1}catch{return!1}},p=async e=>{try{return await t.delete(`${a}/deleteUserFirebaseToken?token=${e}`),!0}catch{return!1}},b=async e=>{const{email:r,marketingConsent:n}=e;try{return await t.post(`${a}/updateMarketingConsent?email=${r}&marketingConsent=${n}`,e),!0}catch(o){return s.handleAxiosError(o),!1}},F=async(e=0,r=10)=>{try{return(await t.get(`${a}/getPublicUserSavedSearchBeanList/${e}/${r}`)).data}catch(n){return s.handleAxiosError(n),[]}},A=async e=>{try{return(await t.post(`${a}/updatePublicUserSavedSearchBean/`,e)).data}catch(r){return s.handleAxiosError(r),c.$()}},f=async()=>{try{return(await t.get(`${a}/getPublicUserSaveSearchCount`)).data}catch(e){return s.handleAxiosError(e),0}};exports.addUserFavorite=v;exports.deleteAllSaveSearch=h;exports.deleteSaveSearch=y;exports.deleteUserFavorite=S;exports.deleteUserFirebaseToken=p;exports.getFavourites=g;exports.getMarketingConsent=d;exports.getMenuInfo=u;exports.getPublicUser=l;exports.getPublicUserSaveSearchList=F;exports.getSavedSearchesCount=f;exports.removeFavourites=$;exports.saveUserFirebaseToken=w;exports.updateMarketingConsent=b;exports.updateNote=U;exports.updatePublicUserSavedSearchBean=A;