/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../chunks/_rollupPluginBabelHelpers","../../../core/BidiText","../../../core/screenUtils","../engine/webgl/alignmentUtils","../engine/webgl/definitions","../engine/webgl/mesh/templates/shapingUtils"],(function(e,t,n,i,o,l,s){"use strict";function r(e,t,n){return a.apply(this,arguments)}function a(){return(a=t._asyncToGenerator((function*(e,t,r){var a,u,c;const p=o.getXAnchorDirection("center"),g=o.getYAnchorDirection("middle"),h=t.textureManager.rasterizeItem(e.toJSON(),window.devicePixelRatio||1,null,r),[,d]=n.bidiText(e.text),f=(yield h).glyphMosaicItems;return s.shapeGlyphs(f,d,{angle:null!=(a=e.angle)?a:0,xOffset:i.pt2px(null!=(u=e.xoffset)?u:0),yOffset:i.pt2px(null!=(c=e.yoffset)?c:0),lineHeight:l.MAGIC_LABEL_LINE_HEIGHT*Math.max(.25,e.lineHeight),maxLineWidth:Math.max(32,Math.min(i.pt2px(e.lineWidth),512)),decoration:e.font.decoration,scale:Math.min(Math.round(i.pt2px(e.font.size)),127)/l.GLYPH_SIZE,hAlign:p,vAlign:g,isCIM:!1}).boundsT}))).apply(this,arguments)}let u=r;function c(e,t,n){return p.apply(this,arguments)}function p(){return(p=t._asyncToGenerator((function*(e,t,n){return u(e,t,n)}))).apply(this,arguments)}const g={stubGetTextBounds:e=>u=e,restoreGetTextBounds:()=>u=r};e.getTextBounds=c,e.test=g,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
