text: // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  // See https://js.arcgis.com/3.38/esri/copyright.txt for details.
  //>>built
  define("esri/dijit/geoenrichment/ReportPlayer/core/grid/valueField/supportClasses/ResizeEngine","dojo/on dojo/dom-style esri/dijit/geoenrichment/utils/DomUtil esri/dijit/geoenrichment/utils/KeyboardUtil esri/dijit/geoenrichment/utils/MathUtil esri/dijit/geoenrichment/utils/MouseUtil".split(" "),function(z,B,A,C,k,x){var w={ALL_DIRECTIONS:"e se s sw w nw n ne".split(" "),trackSizer:function(d){var e=w._getSizerInfo(d),q,g=x.getCursorPosition().clientX,r=x.getCursorPosition().clientY,a=d.w,c=d.h,f=
  0,h=0,l=z(document.body,"mousemove",function(n){n.preventDefault();n.stopPropagation();d.applyShift(-f,-h);h=f=0;var b=x.getCursorPosition().clientX,p=x.getCursorPosition().clientY,m=[0,0,b-g,p-r];p=b=0;var t=d.supportsCtrlShift&&n.shiftKey;var u=d.supportsCtrlShift&&C.isCtrl(n);e.changeWVector&&e.changeHVector&&t&&(t=k.normalizeVector(e.vector),m=k.calcDotProduct(m,t),m=[0,0,t[2]*m,t[3]*m]);d.onSnapped(null);e.changeWVector&&(b=k.calcAngleBetweenVectors(e.changeWVector,m),b=k.calcVectorLength(m)*
  Math.cos(b)||0);e.changeHVector&&(p=k.calcAngleBetweenVectors(e.changeHVector,m),p=k.calcVectorLength(m)*Math.cos(p)||0);b=b&&w._restricVectorDelta(b,e.changeWVector,d);p=p&&w._restricVectorDelta(p,e.changeHVector,d);m=b&&w._snapVectorDelta(b,e.calcBoundaryWVectors(a,c,p),d);t=p&&w._snapVectorDelta(p,e.calcBoundaryHVectors(a,c,b),d);m&&m.canSnap&&t&&t.canSnap&&(m.canSnap=Math.abs(m.minDelta)<=Math.abs(t.minDelta),t.canSnap=Math.abs(t.minDelta)<Math.abs(m.minDelta));m&&m.canSnap&&(d.onSnapped(m.snapInfo),
  b=m.snappedDelta);t&&t.canSnap&&(d.onSnapped(t.snapInfo),p=t.snappedDelta);u&&(b*=2,p*=2);q||!b&&!p||(d.onPreChange(),q=!0);m=b||p;t=a+b;var y=c+p;m&&(u?(f=a/2-t/2,h=c/2-y/2):(u=e.calcOppositePoint(t,y),f=e.oppositePoint[0]-u[0],h=e.oppositePoint[1]-u[1]),d.applyShift(f,h),d.setWidth(t),d.setHeight(y));m&&d.onSizeChanged(n);b&&d.onWidthChanged(n);p&&d.onHeightChanged(n)}),v=z.once(document.body,"mouseup, click",function(n){n.preventDefault();n.stopPropagation();v.remove();l.remove();d.onEnd()})},
  _getSizerInfo:function(d){function e(a,c){var f;switch(q){case "e":var h=[a,c/2];var l=f=[0,c/2];var v=[[0,0,a,0],[0,c,a,c]];break;case "se":h=[a,c];l=[0,0];f=[0,c];var n=[a,0];v=[[0,c,a,c],[0,0,a,0]];var b=[[a,0,a,c],[0,0,0,c]];break;case "s":h=[a/2,c];l=n=[a/2,0];b=[[0,0,0,c],[a,0,a,c]];break;case "sw":h=[0,c];l=[a,0];f=[a,c];n=[0,0];v=[[a,c,0,c],[a,0,0,0]];b=[[0,0,0,c],[a,0,a,c]];break;case "w":h=[0,c/2];l=f=[a,c/2];v=[[a,0,0,0],[a,c,0,c]];break;case "nw":h=[0,0];l=[a,c];f=[a,0];n=[0,c];v=[[a,
  0,0,0],[a,c,0,c]];b=[[0,c,0,0],[a,c,a,0]];break;case "n":h=[a/2,0];l=n=[a/2,c];b=[[0,c,0,0],[a,c,a,0]];break;case "ne":h=[a,0],l=[0,c],f=[0,0],n=[a,c],v=[[0,0,a,0],[0,c,a,c]],b=[[a,c,a,0],[0,c,0,0]]}var p=[a/2,c/2];h=k.rotatePointAroundPoint(p,h,g);l=k.rotatePointAroundPoint(p,l,g);f=f&&k.rotatePointAroundPoint(p,f,g);n=n&&k.rotatePointAroundPoint(p,n,g);a=[l[0],l[1],h[0],h[1]];f=f&&[f[0],f[1],h[0],h[1]];n=n&&[n[0],n[1],h[0],h[1]];v=v&&v.map(function(m){return k.rotateVectorAroundPoint(m,p,g)});b=
  b&&b.map(function(m){return k.rotateVectorAroundPoint(m,p,g)});return{sizerPoint:h,oppositePoint:l,vector:a,changeWVector:f,changeHVector:n,boundaryWVectors:v,boundaryHVectors:b}}var q=d.dir,g=d.angle,r=e(d.w,d.h);return{oppositePoint:r.oppositePoint,vector:r.vector,changeWVector:r.changeWVector,changeHVector:r.changeHVector,calcOppositePoint:function(a,c){return e(a,c).oppositePoint},calcBoundaryWVectors:function(a,c,f){a=e(a,c).boundaryWVectors;f&&(f=k.addLengthToVector(k.normalizeVector(r.changeHVector),
  f),a[0]=k.addPointToVector(a[0],[f[2],f[3]]));return a},calcBoundaryHVectors:function(a,c,f){a=e(a,c).boundaryHVectors;f&&(f=k.addLengthToVector(k.normalizeVector(r.changeWVector),f),a[0]=k.addPointToVector(a[0],[f[2],f[3]]));return a}}},_restricVectorDelta:function(d,e,q){var g=q.getRestrictNodeBox();if(!g||0>=d||!d)return d;q=q.getThisBox();var r=k.calcVectorLength(e);e=k.addLengthToVector(e,d);e=k.addPointToVector(e,[q.x,q.y]);var a=[g.x+g.w,g.y,g.x+g.w,g.y+g.h],c=[g.x,g.y,g.x+g.w,g.y];d=[g.x,
  g.y+g.h,g.x+g.w,g.y+g.h];g=k.intersect2Lines(e,[g.x,g.y,g.x,g.y+g.h]);a=k.intersect2Lines(e,a);c=k.intersect2Lines(e,c);d=k.intersect2Lines(e,d);var f=k.calcVectorLength(e),h=e;[g,a,c,d].forEach(function(l){if(l&&(l=[e[0],e[1],l[0],l[1]],0<k.calcDotProduct(e,l))){var v=k.calcVectorLength(l);v<f&&(f=v,h=l)}});h=k.subtractPointFromVector(h,[q.x,q.y]);return k.calcVectorLength(h)-r},_snapVectorDelta:function(d,e,q){var g=q.getSnapNodeBoxes()||[];if(!g.length||!d)return d;var r=q.getThisBox(),a,c,f,h=
  Infinity;e.forEach(function(l){l=k.addLengthToVector(l,d);l=k.addPointToVector(l,[r.x,r.y]);var v=k.calcVectorLength(l);g.forEach(function(n){var b=n.box,p=n.tolerance;[[b.x,b.y,b.x,b.y+b.h],[b.x+b.w,b.y,b.x+b.w,b.y+b.h],[b.x+b.w/2,b.y,b.x+b.w/2,b.y+b.h],[b.x,b.y,b.x+b.w,b.y],[b.x,b.y+b.h,b.x+b.w,b.y+b.h],[b.x,b.y+b.h/2,b.x+b.w,b.y+b.h/2]].forEach(function(m,t){var u=k.intersect2Lines(l,m);u&&(u=[l[0],l[1],u[0],u[1]],0<k.calcDotProduct(l,u)&&(u=k.calcVectorLength(u)-v,Math.abs(u)<=Math.abs(h)&&Math.abs(u)<=
  p&&(h=u,a=m,f=b,c=2<t)))})})});return{canSnap:!!a,snapInfo:a&&{elementBox:q.getThisFullBox(),snapBox:f,to:c?a[1]:a[0],isHorizontal:c},minDelta:a?h:NaN,snappedDelta:a?d+h:NaN}},positionSizer:function(d){var e=d.sizer;e.style.display="block";var q=d.dir,g=d.w,r=d.h;d=d.angle;var a=e.offsetWidth||12,c=e.offsetHeight||12;switch(q){case "e":var f=g;var h=r/2;break;case "se":f=g;h=r;break;case "s":f=g/2;h=r;break;case "sw":f=0;h=r;break;case "w":f=0;h=r/2;break;case "nw":h=f=0;break;case "n":f=g/2;h=0;
  break;case "ne":f=g,h=0}d&&(h=k.rotatePointAroundPoint({x:g/2,y:r/2},{x:f,y:h},d),f=h.x,h=h.y);B.set(e,{left:f-a/2+"px",top:h-c/2+"px",cursor:w._getCursorDirection(q,d)+"-resize"});if("w"===q||"e"===q)A[30>r?"hide":"show"](e);if("s"===q||"n"===q)A[30>g?"hide":"show"](e);e.style.display=""},_getCursorDirection:function(d,e){if(!e)return d;e=k.angleTo0_360Range(e);e=Math.round(e/45);d=w.ALL_DIRECTIONS.indexOf(d)+e;return w.ALL_DIRECTIONS[d%w.ALL_DIRECTIONS.length]}};return w});