// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("../../../chunks/tslib.es6 ../../../core/Logger ../../../core/maybe ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/Extent ../engine/BitmapContainer ./LayerView2D ./support/ExportStrategy ../../layers/LayerView ../../layers/RefreshableLayerView ../../layers/WMSLayerView".split(" "),function(h,x,y,z,A,p,d,J,B,C,q,D,E,F,G,H){d= class extends H(G(D.LayerView2DMixin(F))){constructor(){super(...arguments);this.bitmapContainer=new q.BitmapContainer}supportsSpatialReference(a){return this.layer.serviceSupportsSpatialReference(a)}update(a){this.strategy.update(a).catch(b=>{z.isAbortError(b)||x.getLogger(this).error(b)})}attach(){const {layer:a}=this,{imageMaxHeight:b,imageMaxWidth:e}=a;this.bitmapContainer=new q.BitmapContainer;this.container.addChild(this.bitmapContainer);this.strategy=new E({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this), requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:b,imageMaxWidth:e,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1});this.addAttachHandles(A.watch(()=>this.exportImageVersion,()=>this.requestUpdate()))}detach(){this.strategy=y.destroyMaybe(this.strategy);this.container.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(a){const {view:b,bitmapContainer:e}=this,{x:f,y:k}=a,{spatialReference:I}=b;let c,l=0,r=0;e.children.some(g=> {const {width:t,height:u,resolution:v,x:m,y:n}=g;g=m+v*t;const w=n-v*u;return f>=m&&f<=g&&k<=n&&k>=w?(c=new C({xmin:m,ymin:w,xmax:g,ymax:n,spatialReference:I}),l=t,r=u,!0):!1});if(!c)return null;a=c.width/l;return{extent:c,width:l,height:r,x:Math.round((f-c.xmin)/a),y:Math.round((c.ymax-k)/a)}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(a,b,e,f){return this.layer.fetchImageBitmap(a,b,e,{timeExtent:this.timeExtent,...f})}};h.__decorate([p.property()], d.prototype,"strategy",void 0);h.__decorate([p.property()],d.prototype,"updating",void 0);return d=h.__decorate([B.subclass("esri.views.2d.layers.WMSLayerView2D")],d)});