/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../request","../../core/screenUtils","./previewUtils"],(function(e,t,i,n){"use strict";function l(e,i,n){const l=e.thumbnail&&e.thumbnail.url;return l?t(l,{responseType:"image"}).then((e=>{const t=o(e.data,n);return n&&n.node?(n.node.appendChild(t),n.node):t})):e.fetchSymbol().then((e=>i(e,n)))}function o(e,t){const l=!/\\.svg$/i.test(e.src)&&t&&t.disableUpsampling,o=Math.max(e.width,e.height);let h=t&&null!=t.maxSize?i.pt2px(t.maxSize):n.SymbolSizeDefaults.maxSize;l&&(h=Math.min(o,h));const s="number"==typeof(null==t?void 0:t.size)?null==t?void 0:t.size:null,u=Math.min(h,null!=s?i.pt2px(s):o);if(u!==o){const t=0!==e.width&&0!==e.height?e.width/e.height:1;t>=1?(e.width=u,e.height=u/t):(e.width=u*t,e.height=u)}return e}e.previewWebStyleSymbol=l,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
