Agriculture-front-end/dist/assets/Modify.35edce3c.js

10 lines
182 KiB
JavaScript
Raw Normal View History

import{Q as Li}from"./index.9f28707e.js";import{R as as}from"./index.030fe210.js";const or={1:"The view center is not defined",2:"The view resolution is not defined",3:"The view rotation is not defined",4:"`image` and `src` cannot be provided at the same time",5:"`imgSize` must be set when `image` is provided",7:"`format` must be set when `url` is set",8:"Unknown `serverType` configured",9:"`url` must be configured or set using `#setUrl()`",10:"The default `geometryFunction` can only handle `Point` geometries",11:"`options.featureTypes` must be an Array",12:"`options.geometryName` must also be provided when `options.bbox` is set",13:"Invalid corner",14:"Invalid color",15:"Tried to get a value for a key that does not exist in the cache",16:"Tried to set a value for a key that is used already",17:"`resolutions` must be sorted in descending order",18:"Either `origin` or `origins` must be configured, never both",19:"Number of `tileSizes` and `resolutions` must be equal",20:"Number of `origins` and `resolutions` must be equal",22:"Either `tileSize` or `tileSizes` must be configured, never both",24:"Invalid extent or geometry provided as `geometry`",25:"Cannot fit empty extent provided as `geometry`",26:"Features must have an id set",27:"Features must have an id set",28:'`renderMode` must be `"hybrid"` or `"vector"`',30:"The passed `feature` was already added to the source",31:"Tried to enqueue an `element` that was already added to the queue",32:"Transformation matrix cannot be inverted",33:"Invalid units",34:"Invalid geometry layout",36:"Unknown SRS type",37:"Unknown geometry type found",38:"`styleMapValue` has an unknown type",39:"Unknown geometry type",40:"Expected `feature` to have a geometry",41:"Expected an `ol/style/Style` or an array of `ol/style/Style.js`",42:"Question unknown, the answer is 42",43:"Expected `layers` to be an array or a `Collection`",47:"Expected `controls` to be an array or an `ol/Collection`",48:"Expected `interactions` to be an array or an `ol/Collection`",49:"Expected `overlays` to be an array or an `ol/Collection`",50:"`options.featureTypes` should be an Array",51:"Either `url` or `tileJSON` options must be provided",52:"Unknown `serverType` configured",53:"Unknown `tierSizeCalculation` configured",55:"The {-y} placeholder requires a tile grid with extent",56:"mapBrowserEvent must originate from a pointer event",57:"At least 2 conditions are required",59:"Invalid command found in the PBF",60:"Missing or invalid `size`",61:"Cannot determine IIIF Image API version from provided image information JSON",62:"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`",64:"Layer opacity must be a number",66:"`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has not been enabled. This is done by providing adequate shaders using the `hitVertexShader` and `hitFragmentShader` properties of `WebGLPointsLayerRenderer`",67:"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both",68:"A VectorTile source can only be rendered if it has a projection compatible with the view projection",69:"`width` or `height` cannot be provided together with `scale`"};class ar extends Error{constructor(t){const e=or[t];super(e),this.code=t,this.name="AssertionError",this.message=e}}const ls=ar;function B(n,t){if(!n)throw new ls(t)}const Y={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function _t(n){const t=Xt();for(let e=0,i=n.length;e<i;++e)ds(t,n[e]);return t}function ei(n,t,e){return e?(e[0]=n[0]-t,e[1]=n[1]-t,e[2]=n[2]+t,e[3]=n[3]+t,e):[n[0]-t,n[1]-t,n[2]+t,n[3]+t]}function lr(n,t){return t?(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t):n.slice()}function Fi(n,t,e){let i,s;return t<n[0]?i=n[0]-t:n[2]<t?i=t-n[2]:i=0,e<n[1]?s=n[1]-e:n[3]<e?s=e-n[3]:s=0,i*i+s*s}function hr(n,t){return hs(n,t[0],t[1])}function Ht(n,t){return n[0]<=t[0]&&t[2]<=n[2]&&n[1]<=t[1]&&t[3]<=n[3]}function hs(n,t,e){return n[0]<=t&&t<=n[2]&&n[1]<=e&&e<=n[3]}function Si(n,t){const e=n[0],i=n[1],s=n[2],r=n[3],o=t[0],a=t[1];let l=Y.UNKNOWN;
`))?(Oi(Mi),Kt=null,Ti=void 0,It.set(g,100)):(It.set(g,It.get(g)+1,!0),h=!1))}h&&(clearInterval(r),r=void 0)}return function(h){const c=Ws(h);if(!c)return;const u=c.families;for(let d=0,g=u.length;d<g;++d){const f=u[d],_=c.style+`
`+c.weight+`
`+f;It.get(_)===void 0&&(It.set(_,100,!0),a(c.style,c.weight,f)||(It.set(_,0,!0),r===void 0&&(r=setInterval(l,32))))}}}(),Ia=function(){let n;return function(t){let e=Mi[t];if(e==null){if(bi){const i=Ws(t),s=Xs(t,"\u017Dg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(s.actualBoundingBoxAscent+s.actualBoundingBoxDescent)}else n||(n=document.createElement("div"),n.innerHTML="M",n.style.minHeight="0",n.style.maxHeight="none",n.style.height="auto",n.style.padding="0",n.style.border="none",n.style.position="absolute",n.style.display="block",n.style.left="-99999px"),n.style.font=t,document.body.appendChild(n),e=n.offsetHeight,document.body.removeChild(n);Mi[t]=e}return e}}();function Xs(n,t){return Kt||(Kt=lt(1,1)),n!=Ti&&(Kt.font=n,Ti=Kt.font),Kt.measureText(t)}function $e(n,t){return Xs(n,t).width}function zn(n,t,e){if(t in e)return e[t];const i=t.split(`
`).reduce((s,r)=>Math.max(s,$e(n,r)),0);return e[t]=i,i}function wa(n,t){const e=[],i=[],s=[];let r=0,o=0,a=0,l=0;for(let h=0,c=t.length;h<=c;h+=2){const u=t[h];if(u===`
`||h===c){r=Math.max(r,o),s.push(o),o=0,a+=l;continue}const d=t[h+1]||n.font,g=$e(d,u);e.push(g),o+=g;const f=Ia(d);i.push(f),l=Math.max(l,f)}return{width:r,height:a,widths:e,heights:i,lineWidths:s}}function Ta(n,t,e,i,s,r,o,a,l,h,c){n.save(),e!==1&&(n.globalAlpha*=e),t&&n.setTransform.apply(n,t),i.contextInstructions?(n.translate(l,h),n.scale(c[0],c[1]),Ma(i,n)):c[0]<0||c[1]<0?(n.translate(l,h),n.scale(c[0],c[1]),n.drawImage(i,s,r,o,a,0,0,o,a)):n.drawImage(i,s,r,o,a,l,h,o*c[0],a*c[1]),n.restore()}function Ma(n,t){const e=n.contextInstructions;for(let i=0,s=e.length;i<s;i+=2)Array.isArray(e[i+1])?t[e[i]].apply(t,e[i+1]):t[e[i]]=e[i+1]}class Zi extends Ns{constructor(t){const e=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:1,rotateWithView:e,rotation:t.rotation!==void 0?t.rotation:0,scale:t.scale!==void 0?t.scale:1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode}),this.canvas_=void 0,this.hitDetectionCanvas_=null,this.fill_=t.fill!==void 0?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=t.radius!==void 0?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=t.angle!==void 0?t.angle:0,this.stroke_=t.stroke!==void 0?t.stroke:null,this.size_=null,this.renderOptions_=null,this.render()}clone(){const t=this.getScale(),e=new Zi({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_;if(!t)return null;const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]/2-e[0]/i[0],t[1]/2+e[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(t){let e=this.canvas_[t];if(!e){const i=this.renderOptions_,s=lt(i.size*t,i.size*t);this.draw_(i,s,t),e=s.canvas,this.canvas_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return N.LOADED}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,i){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let s=this.radius_,r=this.radius2_===void 0?s:this.radius2_;if(s<r){const w=s;s=r,r=w}const o=this.radius2_===void 0?this.points_:this.points_*2,a=2*Math.PI/o,l=r*Math.sin(a),h=Math.sqrt(r*r-l*l),c=s-h,u=Math.sqrt(l*l+c*c),d=u/l;if(t==="miter"&&d<=i)return d*e;const g=e/2/d,f=e/2*(c/u),m=Math.sqrt((s+g)*(s+g)+f*f)-s;if(this.radius2_===void 0||t==="bevel")return m*2;const y=s*Math.sin(a),p=Math.sqrt(s*s-y*y),x=r-p,R=Math.sqrt(y*y+x*x)/y;if(R<=i){const w=R*e/2-r-s;return 2*Math.max(m,w)}return m*2}createRenderOptions(){let t=ne,e=0,i=null,s=0,r,o=0;this.stroke_&&(r=this.stroke_.getColor(),r===null&&(r=Ce),r=dt(r),o=this.stroke_.getWidth(),o===void 0&&(o=Ie),i=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset(),t=this.stroke_.getLineJoin(),t===void 0&&(t=ne),e=this.stroke_.getMiterLimit(),e===void 0&&(e=Re));const a=this.calculateLineJoinSize_(t,o,e),l=Math.max(this.radius_,this.radius2_||0),h=Math.ceil(2*l+a);return{strokeStyle:r,strokeWidth:o,size:h,lineDash:i,lineDashOffset:s,lineJoin:t,miterLimit:e}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]}draw_(t,e,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){let s=this.fill_.getColor();s===null&&(s=H),e.fillStyle=dt(s),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e
`,""),n.push(t,""),n}class il{constructor(t,e,i,s){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=s.instructions,this.coordinates=s.coordinates,this.coordinateCache_={},this.renderedTransform_=Lt(),this.hitDetectionInstructions=s.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=s.fillStates||{},this.strokeStates=s.strokeStates||{},this.textStates=s.textStates||{},this.widths_={},this.labels_={}}createLabel(t,e,i,s){const r=t+e+i+s;if(this.labels_[r])return this.labels_[r];const o=s?this.strokeStates[s]:null,a=i?this.fillStates[i]:null,l=this.textStates[e],h=this.pixelRatio,c=[l.scale[0]*h,l.scale[1]*h],u=Array.isArray(t),d=l.justify?ti[l.justify]:_i(Array.isArray(t)?t[0]:t,l.textAlign||Ee),g=s&&o.lineWidth?o.lineWidth:0,f=u?t:t.split(`
`).reduce(el,[]),{width:_,height:m,widths:y,heights:p,lineWidths:x}=wa(l,f),C=_+g,R=[],w=(C+2)*c[0],L=(m+g)*c[1],T={width:w<0?Math.floor(w):Math.ceil(w),height:L<0?Math.floor(L):Math.ceil(L),contextInstructions:R};(c[0]!=1||c[1]!=1)&&R.push("scale",c),s&&(R.push("strokeStyle",o.strokeStyle),R.push("lineWidth",g),R.push("lineCap",o.lineCap),R.push("lineJoin",o.lineJoin),R.push("miterLimit",o.miterLimit),R.push("setLineDash",[o.lineDash]),R.push("lineDashOffset",o.lineDashOffset)),i&&R.push("fillStyle",a.fillStyle),R.push("textBaseline","middle"),R.push("textAlign","center");const v=.5-d;let F=d*C+v*g;const W=[],P=[];let b=0,q=0,I=0,A=0,M;for(let D=0,X=f.length;D<X;D+=2){const z=f[D];if(z===`
`){q+=b,b=0,F=d*C+v*g,++A;continue}const ht=f[D+1]||l.font;ht!==M&&(s&&W.push("font",ht),i&&P.push("font",ht),M=ht),b=Math.max(b,p[I]);const S=[z,F+v*y[I]+d*(y[I]-x[A]),.5*(g+b)+q];F+=y[I],s&&W.push("strokeText",S),i&&P.push("fillText",S),++I}return Array.prototype.push.apply(R,W),Array.prototype.push.apply(R,P),this.labels_[r]=T,T}replayTextBackground_(t,e,i,s,r,o,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,s),t.lineTo.apply(t,r),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())}calculateImageOrLabelDimensions_(t,e,i,s,r,o,a,l,h,c,u,d,g,f,_,m){a*=d[0],l*=d[1];let y=i-a,p=s-l;const x=r+h>t?t-h:r,C=o+c>e?e-c:o,R=f[3]+x*d[0]+f[1],w=f[0]+C*d[1]+f[2],L=y-f[3],T=p-f[0];(_||u!==0)&&(wt[0]=L,Tt[0]=L,wt[1]=T,mt[1]=T,mt[0]=L+R,yt[0]=mt[0],yt[1]=T+w,Tt[1]=yt[1]);let v;return u!==0?(v=ve(Lt(),i,s,1,1,u,-i,-s),K(v,wt),K(v,mt),K(v,yt),K(v,Tt),ee(Math.min(wt[0],mt[0],yt[0],Tt[0]),Math.min(wt[1],mt[1],yt[1],Tt[1]),Math.max(wt[0],mt[0],yt[0],Tt[0]),Math.max(wt[1],mt[1],yt[1],Tt[1]),Ut)):ee(Math.min(L,L+R),Math.min(T,T+w),Math.max(L,L+R),Math.max(T,T+w),Ut),g&&(y=Math.round(y),p=Math.round(p)),{drawImageX:y,drawImageY:p,drawImageW:x,drawImageH:C,originX:h,originY:c,declutterBox:{minX:Ut[0],minY:Ut[1],maxX:Ut[2],maxY:Ut[3],value:m},canvasTransform:v,scale:d}}replayImageOrLabel_(t,e,i,s,r,o,a){const l=!!(o||a),h=s.declutterBox,c=t.canvas,u=a?a[2]*s.scale[0]/2:0;return h.minX-u<=c.width/e&&h.maxX+u>=0&&h.minY-u<=c.height/e&&h.maxY+u>=0&&(l&&this.replayTextBackground_(t,wt,mt,yt,Tt,o,a),Ta(t,s.canvasTransform,r,i,s.originX,s.originY,s.drawImageW,s.drawImageH,s.drawImageX,s.drawImageY,s.scale)),!0}fill_(t){if(this.alignFill_){const e=K(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6])}drawLabelWithPointPlacement_(t,e,i,s){const r=this.textStates[e],o=this.createLabel(t,e,s,i),a=this.strokeStates[i],l=this.pixelRatio,h=_i(Array.isArray(t)?t[0]:t,r.textAlign||Ee),c=ti[r.textBaseline||Je],u=a&&a.lineWidth?a.lineWidth:0,d=o.width/l-2*r.scale[0],g=h*d+2*(.5-h)*u,f=c*o.height/l+2*(.5-c)*u;return{label:o,anchorX:g,anchorY:f}}execute_(t,e,i,s,r,o,a,l){let h;this.pixelCoordinates_&&zt(i,this.renderedTransform_)?h=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),h=Bt(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),xo(this.renderedTransform_,i));let c=0;const u=s.length;let d=0,g,f,_,m,y,p,x,C,R,w,L,T,v=0,F=0,W=null,P=null;const b=this.coordinateCache_,q=this.viewRotation_,I=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,A={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:q},M=this.instructions!=s||this.overlaps?0:200;let D,X,z,ht;for(;c<u;){const S=s[c];switch(S[0]){case E.BEGIN_GEOMETRY:D=S[1],ht=S[3],D.getGeometry()?a!==void 0&&!at(a,ht.getExtent())?c=S[2]+1:++c:c=S[2];break;case E.BEGIN_PATH:v>M&&(this.fill_(t),v=0),F>M&&(t.stroke(),F=0),!v&&!F&&(t.beginPath(),m=NaN,y=NaN),++c;break;case E.CIRCLE:d=S[1];const ct=h[d],Yt=h[d+1],Ks=h[d+2],Hs=h[d+3],en=Ks-ct,nn=Hs-Yt,sn=Math.sqrt(en*en+nn*nn);t.moveTo(ct+sn,Yt),t.arc(ct,Yt,sn,0,2*Math.PI,!0),++c;break;case E.CLOSE_PATH:t.closePath(),++c;break;case E.CUSTOM:d=S[1],g=S[2];const qs=S[3],Js=S[4],rn=S.length==6?S[5]:void 0;A.geometry=qs,A.feature=D,c in b||(b[c]=[]);const re=b[c];rn?rn(h,d,g,2,re):(re[0]=h[d],re[1]=h[d+1],re.length=2),Js(re,A),++c;break;case E.DRAW_IMAGE:d=S[1],g=S[2],C=S[3],f=S[4],_=S[5];let si=S[6];const $s=S[7],Qs=S[8],tr=S[9],on=S[10];let ri=S[11];const er=S[12];let De=S[13];const an=S[14],oe=S[15];if(!C&&S.length>=20){R=S[19],w=S[20],L=S[21],T=S[22];const J=this.drawLabelWithPointPlacement_(R,w,L,T);C=J.label,S[3]=C;const Vt=S[23];f=(J.anchorX-Vt)*this.pixelRatio,S[4]=f;const et=S[24];_=(J.anchorY-et)*this.pixelRatio,S[5]=_,si=C.height,S[6]=si,De=C.width,S[13]=De}let oi;S.length>25&&(