/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../core/Logger","../core/object","../core/string","./date","./number"],(function(t,e,r,n,o,a){"use strict";const u=e.getLogger("esri.intl");function i(t,e,r={}){const{format:o={}}=r;return n.replace(t,(t=>s(t,e,o)))}function s(t,e,n){let o,a;const u=t.indexOf(":");if(-1===u?o=t.trim():(o=t.slice(0,u).trim(),a=t.slice(u+1).trim()),!o)return"";const i=r.getDeepValue(o,e);if(null==i)return"";const s=n[a]||n[o];return s?c(i,s):a?f(i,a):m(i)}function c(t,e){switch(e.type){case"date":return o.formatDate(t,e.intlOptions);case"number":return a.formatNumber(t,e.intlOptions);default:return u.warn("missing format descriptor for key {key}"),m(t)}}function f(t,e){switch(e.toLowerCase()){case"dateformat":return o.formatDate(t);case"numberformat":return a.formatNumber(t);default:return u.warn(`inline format is unsupported since 4.12: ${e}`),/^(dateformat|datestring)/i.test(e)?o.formatDate(t):/^numberformat/i.test(e)?a.formatNumber(t):m(t)}}function m(t){switch(typeof t){case"string":return t;case"number":return a.formatNumber(t);case"boolean":return""+t;default:return t instanceof Date?o.formatDate(t):""}}t.substitute=i,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
