// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/layers/vectorTiles/core/lang","dojo/_base/array dojo/_base/kernel dojo/_base/lang dojo/date dojo/number dojo/date/locale dojo/i18n!../nls/common".split(" "),function(k,t,f,u,v,w,x){function m(b){return void 0!==b&&null!==b}function p(b){return m(b)?b:""}function l(b,c,a){var d=a.match(/([^\(]+)(\([^\)]+\))?/i),e=f.trim(d[1]);a=c[b];var d=JSON.parse((d[2]?f.trim(d[2]):"{}").replace(/^\(/,"{").replace(/\)$/,"}").replace(/([{,])\s*([0-9a-zA-Z\_]+)\s*:/gi,'$1"$2":').replace(/\"\s*:\s*\'/gi,
'":"').replace(/\'\s*(,|\})/gi,'"$1')),g=d.utcOffset;if(-1===k.indexOf(y,e))e=f.getObject(e),f.isFunction(e)&&(a=e(a,b,c,d));else if("number"===typeof a||"string"===typeof a&&a&&!isNaN(Number(a)))switch(a=Number(a),e){case "NumberFormat":b=f.mixin({},d);c=parseFloat(b.places);if(isNaN(c)||0>c)b.places=Infinity;return v.format(a,b);case "DateString":a=new Date(a);if(d.local||d.systemLocale)return d.systemLocale?a.toLocaleDateString()+(d.hideTime?"":" "+a.toLocaleTimeString()):a.toDateString()+(d.hideTime?
"":" "+a.toTimeString());a=a.toUTCString();d.hideTime&&(a=a.replace(/\s+\d\d\:\d\d\:\d\d\s+(utc|gmt)/i,""));return a;case "DateFormat":return a=new Date(a),m(g)&&(a=u.add(a,"minute",a.getTimezoneOffset()-g)),w.format(a,d)}return p(a)}function q(b,c){var a;if(c)for(a in b)b.hasOwnProperty(a)&&(void 0===b[a]?delete b[a]:b[a]instanceof Object&&q(b[a],!0));else for(a in b)b.hasOwnProperty(a)&&void 0===b[a]&&delete b[a];return b}function n(b){if(!b||"object"!=typeof b||f.isFunction(b))return b;if("function"===
typeof b.clone)b=b.clone();else if("function"===typeof b.map&&"function"===typeof b.forEach)b=b.map(n);else{var c={},a,d,e={};for(a in b){d=b[a];var g=!(a in e)||e[a]!==d;if(!(a in c)||c[a]!==d&&g)c[a]=n?n(d):d}b=c}return b}var y=["NumberFormat","DateString","DateFormat"],r=/<\/?[^>]+>/g;return{equals:function(b,c){return b===c||"number"===typeof b&&isNaN(b)&&"number"===typeof c&&isNaN(c)||f.isFunction((b||{}).getTime)&&f.isFunction((c||{}).getTime)&&b.getTime()==c.getTime()||f.isFunction((b||{}).equals)&&
b.equals(c)||f.isFunction((c||{}).equals)&&c.equals(b)||!1},valueOf:function(b,c){for(var a in b)if(b[a]==c)return a;return null},stripTags:function(b){if(b){var c=typeof b;if("string"===c)b=b.replace(r,"");else if("object"===c)for(var a in b)(c=b[a])&&"string"===typeof c&&(c=c.replace(r,"")),b[a]=c}return b},substitute:function(b,c,a){var d,e,g;m(a)&&(f.isObject(a)?(d=a.first,e=a.dateFormat,g=a.numberFormat):d=a);if(c&&"{*}"!==c)return f.replace(c,f.hitch({obj:b},function(b,a){var c=a.split(":");
return 1<c.length?(a=c[0],c.shift(),l(a,this.obj,c.join(":"))):e&&-1!==k.indexOf(e.properties||"",a)?l(a,this.obj,e.formatter||"DateString"):g&&-1!==k.indexOf(g.properties||"",a)?l(a,this.obj,g.formatter||"NumberFormat"):p(this.obj[a])}));c=[];var h;c.push('\x3ctable summary\x3d"'+x.fieldsSummary+'"\x3e\x3ctbody\x3e');for(h in b)if(a=b[h],e&&-1!==k.indexOf(e.properties||"",h)?a=l(h,b,e.formatter||"DateString"):g&&-1!==k.indexOf(g.properties||"",h)&&(a=l(h,b,g.formatter||"NumberFormat")),c.push("\x3ctr\x3e\x3cth\x3e"+
h+"\x3c/th\x3e\x3ctd\x3e"+p(a)+"\x3c/td\x3e\x3c/tr\x3e"),d)break;c.push("\x3c/tbody\x3e\x3c/table\x3e");return c.join("")},filter:function(b,c,a){c=[f.isString(b)?b.split(""):b,a||t.global,f.isString(c)?new Function("item","index","array",c):c];a={};var d;b=c[0];for(d in b)c[2].call(c[d],b[d],d,b)&&(a[d]=b[d]);return a},startsWith:function(b,c,a){a=a||0;return b.indexOf(c,a)===a},endsWith:function(b,c,a){if("number"!==typeof a||!isFinite(a)||Math.floor(a)!==a||a>b.length)a=b.length;a-=c.length;b=
b.indexOf(c,a);return-1!==b&&b===a},isDefined:m,fixJson:q,clone:n}});