PageSourceSearch

https://app.boostt.ai/v2/_next/static/chunks/24495.fcea5f09a2bc18f3.js

js boostt.ai collected 2026-10-05 11:52:36 UTC 10,074 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[24495],{24495:function(t,e,o){o.d(e,{Z:function(){return y}});var n=o(27251),a=o(23625);let i=a.default.constants,{CommonSelectors:s,doubleClickZoom:r}=a.default.lib,l={onSetup(){var t;let e=this.newFeature({type:i.geojsonTypes.FEATURE,properties:{},geometry:{type:i.geojsonTypes.POLYGON,coordinates:[[]]}});return this.addFeature(e),this.clearSelectedFeatures(),r&&r.disable(this),(null===(t=this.map)||void 0===t?void 0:t.dragPan)&&this.map.dragPan.disable(),this.updateUIClasses({mouse:i.cursors.ADD}),this.activateUIButton(i.types.POLYGON),this.setActionableState({trash:!0}),{polygon:e,isDragging:!1,startLngLat:null,committed:!1}},onMouseDown:d,onTouchStart:d,onDrag:g,onMouseMove:g,onTouchMove:g,onMouseUp:u,onTouchEnd:u,onClick:u,onTap:u,onKeyUp(t,e){if(s.isEscapeKey(e)){var o;(null===(o=this.map)||void 0===o?void 0:o.dragPan)&&this.map.dragPan.enable(),t.isDragging=!1,t.startLngLat=null,this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(i.modes.SIMPLE_SELECT)}},onTrash(t){var e;(null===(e=this.map)||void 0===e?void 0:e.dragPan)&&this.map.dragPan.enable(),t.isDragging=!1,this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(i.modes.SIMPLE_SELECT)},onStop(t){var e,o;this.updateUIClasses({mouse:i.cursors.NONE}),r&&r.enable(this),this.activateUIButton(),(null===(e=this.map)||void 0===e?void 0:e.dragPan)&&this.map.dragPan.enable(),(null==t?void 0:null===(o=t.polygon)||void 0===o?void 0:o.id)&&!t.committed&&this.getFeature(t.polygon.id)&&this.deleteFeature([t.polygon.id],{silent:!0})},toDisplayFeatures:a.default.modes.draw_polygon.toDisplayFeatures};function d(t,e){if(s.isVertex(e))return;let o=e.originalEvent;o&&"button"in o&&"number"==typeof o.button&&0!==o.button||(t.isDragging=!0,t.startLngLat=e.lngLat,t.committed=!1)}function g(t,e){if(!t.isDragging||!t.startLngLat)return;let o=t.startLngLat,n=e.lngLat,a=Math.min(o.lng,n.lng),i=Math.max(o.lng,n.lng),s=Math.min(o.lat,n.lat),r=Math.max(o.lat,n.lat);t.polygon.setCoordinates([[[a,s],[i,s],[i,r],[a,r],[a,s]]])}function u(t){var e;if(!t.isDragging){t.committed||(this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(i.modes.SIMPLE_SELECT));return}t.isDragging=!1;let o=t.startLngLat;if(t.startLngLat=null,(null===(e=this.map)||void 0===e?void 0:e.dragPan)&&this.map.dragPan.enable(),!o){this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(i.modes.SIMPLE_SELECT);return}let n=t.polygon.coordinates[0];if(!n||n.length<4){this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(i.modes.SIMPLE_SELECT);return}let a=n[0][0],s=n[0][1],r=n[2][0],l=n[2][1];if(1e-12>Math.abs(r-a)||1e-12>Math.abs(l-s)){this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(i.modes.SIMPLE_SELECT);return}t.committed=!0,this.fire(i.events.CREATE,{features:[t.polygon.toGeoJSON()]}),this.changeMode(i.modes.SIMPLE_SELECT,{featureIds:[t.polygon.id]})}var h=o(2265),c=o(48421),p=o(51705);let m={Clear:"clear",Loading:"loading",Create:"draw.create",Delete:"draw.delete",Update:"draw.update",Add:"draw.add",ModeChange:"draw.modechange",SelectionChange:"draw.selectionchange"};var y=(0,h.memo)(function(t){let e=(0,c.useControl)(()=>{let e={...a.default.modes,draw_polygon:t.polygonMode||n.Z,draw_rectangle:l};return new a.default({modes:e,displayControlsDefault:!1,styles:p.L3})},()=>{t.onAdd&&t.onAdd()},()=>{},{position:t.position}),{current:o}=(0,c.useMap)(),i=(0,h.useRef)(t.onControlChange);i.current=t.onControlChange,(0,h.useEffect)(()=>{e&&i.current&&i.current(e)},[e]);let s=(0,h.useRef)(t);return s.current=t,(0,h.useEffect)(()=>{if(!o)return;let t={};return Object.entries(m).forEach(e=>{let[n,a]=e,i="onDraw".concat(n);t[a]=t=>{let e=s.current[i];"function"==typeof e&&e(t)},o.on(a,t[a])}),()=>{Object.entries(t).forEach(t=>{let[e,n]=t;o.off(e,n)})}},[o]),null})},27251:function(t,e,o){o.d(e,{k:function(){return l}});var n=o(23625),a=o(58033);let i=n.default.constants,{CommonSelectors:s,doubleClickZoom:r}=n.default.lib;function l(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{maxVertices:e,onVertexCountChange:o}=t,n=t=>{"function"==typeof o&&o(t)};return{onSetup(){var t;let e=this.newFeature({type:i.geojsonTypes.FEATURE,properties:{},geometry:{type:i.geojsonTypes.POLYGON,coordinates:[[]]}});return this.addFeature(e),this.clearSelectedFeatures(),(null===(t=this.map)||void 0===t?void 0:t.dragPan)&&this.map.dragPan.disable(),r&&r.disable(this),this.updateUIClasses({mouse:i.cursors.ADD}),this.activateUIButton(i.types.POLYGON),this.setActionableState({trash:!0}),{polygon:e,currentVertexPosition:0,isFreehand:!1,isMouseDown:!1,startLngLat:null,lastLngLat:null,dragPointsCount:0,committed:!1}},onMouseDown(t,e){if(s.isVertex(e))return;let o=e.originalEvent;o&&"button"in o&&"number"==typeof o.button&&0!==o.button||(t.isMouseDown=!0,t.startLngLat=e.lngLat,t.lastLngLat=e.lngLat,t.dragPointsCount=0)},onTouchStart(t,e){this.onMouseDown(t,e)},onDrag(t,o){if(!t.isMouseDown||!t.startLngLat)return;let a=o.lngLat.lng,s=o.lngLat.lat;if(!t.isFreehand&&0===t.currentVertexPosition){let e=Math.abs(a-t.startLngLat.lng),o=Math.abs(s-t.startLngLat.lat);if(e>1e-4||o>1e-4){t.isFreehand=!0,t.polygon.setCoordinates([[[t.startLngLat.lng,t.startLngLat.lat],[a,s]]]),t.dragPointsCount=2,n(2);return}}
1if(t.isFreehand){if(t.lastLngLat){let e=Math.abs(a-t.lastLngLat.lng),o=Math.abs(s-t.lastLngLat.lat);if(e<1e-6&&o<1e-6)return}if(t.lastLngLat=o.lngLat,this.updateUIClasses({mouse:i.cursors.ADD}),t.polygon.updateCoordinate("0.".concat(t.dragPointsCount),a,s),t.dragPointsCount++,n(t.dragPointsCount),e&&t.dragPointsCount>=e){this.finishFreehand(t);return}t.polygon.updateCoordinate("0.".concat(t.dragPointsCount),a,s)}},onMouseMove(t,e){if(!t.isMouseDown){t.currentVertexPosition>0&&t.polygon.updateCoordinate("0.".concat(t.currentVertexPosition),e.lngLat.lng,e.lngLat.lat);return}this.onDrag(t,e)},onTouchMove(t,e){this.onDrag(t,e)},finishFreehand(t){var e,o;(null===(e=this.map)||void 0===e?void 0:e.dragPan)&&this.map.dragPan.enable();let n=t.polygon.coordinates[0];if(!n||n.length<3){this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(i.modes.SIMPLE_SELECT);return}(n[0][0]!==n[n.length-1][0]||n[0][1]!==n[n.length-1][1])&&t.polygon.updateCoordinate("0.".concat(n.length),n[0][0],n[0][1]);try{let e="function"==typeof(null===(o=this.map)||void 0===o?void 0:o.getZoom)?this.map.getZoom():12;(0,a.Z)(t.polygon,{mutate:!0,tolerance:1/Math.pow(1.05,10*e),highQuality:!0})}catch(t){console.warn("Simplification error, keeping original coordinates:",t)}let s=t.polygon.coordinates[0];if(!s||s.length<4){this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(i.modes.SIMPLE_SELECT);return}t.committed=!0,this.fire(i.events.CREATE,{features:[t.polygon.toGeoJSON()]}),this.changeMode(i.modes.SIMPLE_SELECT,{featureIds:[t.polygon.id]})},onMouseUp(t,e){let o=t.isFreehand,n=t.dragPointsCount;if(t.isMouseDown=!1,t.isFreehand=!1,t.startLngLat=null,!t.committed){if(o&&n>=3){this.finishFreehand(t);return}this.handleClick(t,e)}},onTouchEnd(t,e){this.onMouseUp(t,e)},finishClickPolygon(t){var e;(null===(e=this.map)||void 0===e?void 0:e.dragPan)&&this.map.dragPan.enable();let o=(t.polygon.coordinates[0]||[]).slice(0,t.currentVertexPosition);return!(o.length<3)&&((o[0][0]!==o[o.length-1][0]||o[0][1]!==o[o.length-1][1])&&o.push([o[0][0],o[0][1]]),t.polygon.setCoordinates([o]),t.committed=!0,this.fire(i.events.CREATE,{features:[t.polygon.toGeoJSON()]}),this.changeMode(i.modes.SIMPLE_SELECT,{featureIds:[t.polygon.id]}),!0)},handleClick(t,o){let a=t.polygon.coordinates[0]||[],r=t.currentVertexPosition>0?a[t.currentVertexPosition-1]:null,l=!!r&&o.lngLat.lng===r[0]&&o.lngLat.lat===r[1],d=s.isVertex(o);if((l||d)&&t.currentVertexPosition>=3||(this.updateUIClasses({mouse:i.cursors.ADD}),t.polygon.updateCoordinate("0.".concat(t.currentVertexPosition),o.lngLat.lng,o.lngLat.lat),t.currentVertexPosition++,n(t.currentVertexPosition),e&&t.currentVertexPosition>=e)){this.finishClickPolygon(t);return}t.polygon.updateCoordinate("0.".concat(t.currentVertexPosition),o.lngLat.lng,o.lngLat.lat)},onKeyUp(t,e){if(s.isEscapeKey(e)){var o;(null===(o=this.map)||void 0===o?void 0:o.dragPan)&&this.map.dragPan.enable(),this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(i.modes.SIMPLE_SELECT)}else s.isEnterKey(e)&&t.currentVertexPosition>=3&&this.finishClickPolygon(t)},onTrash(t){var e;(null===(e=this.map)||void 0===e?void 0:e.dragPan)&&this.map.dragPan.enable(),this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(i.modes.SIMPLE_SELECT)},onStop(t){var e,o;this.updateUIClasses({mouse:i.cursors.NONE}),r&&r.enable(this),this.activateUIButton(),(null===(e=this.map)||void 0===e?void 0:e.dragPan)&&this.map.dragPan.enable(),(null==t?void 0:null===(o=t.polygon)||void 0===o?void 0:o.id)&&!t.committed&&this.getFeature(t.polygon.id)&&this.deleteFeature([t.polygon.id],{silent:!0})},toDisplayFeatures(t,e,o){var n;let a=e.properties.id===t.polygon.id;if(e.properties.active=a?i.activeStates.ACTIVE:i.activeStates.INACTIVE,!a)return o(e);if((null===(n=e.geometry)||void 0===n?void 0:n.coordinates)&&0!==e.geometry.coordinates.length&&0!==e.geometry.coordinates[0].length){if(e.geometry.coordinates[0].length<3){o({type:i.geojsonTypes.FEATURE,properties:{meta:i.meta.FEATURE,active:i.activeStates.ACTIVE},geometry:{type:i.geojsonTypes.LINE_STRING,coordinates:e.geometry.coordinates[0]}}
1),e.geometry.coordinates[0].forEach((e,n)=>{o({type:i.geojsonTypes.FEATURE,properties:{meta:i.meta.VERTEX,parent:t.polygon.id,coord_path:"0.".concat(n),active:n===t.currentVertexPosition-1?i.activeStates.ACTIVE:i.activeStates.INACTIVE},geometry:{type:i.geojsonTypes.POINT,coordinates:e}})});return}o(e),e.geometry.coordinates[0].forEach((e,n)=>{o({type:i.geojsonTypes.FEATURE,properties:{meta:i.meta.VERTEX,parent:t.polygon.id,coord_path:"0.".concat(n),active:0===n||n===t.currentVertexPosition-1?i.activeStates.ACTIVE:i.activeStates.INACTIVE},geometry:{type:i.geojsonTypes.POINT,coordinates:e}})})}}}}let d=l();e.Z=d}}]);
2//# sourceMappingURL=24495.fcea5f09a2bc18f3.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.