text: // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  // See https://js.arcgis.com/4.11/esri/copyright.txt for details.
  //>>built
  define("require exports ./tsSupport/assignHelper dojo/io-query dojo/_base/url ../config ../kernel ./Error ./global ./lang ./Logger".split(" "),function(ia,d,W,l,X,F,G,Y,r,x,Z){function g(a){var b={path:null,query:null},c=new d.Url(a),e=a.indexOf("?");null===c.query?b.path=a:(b.path=a.substring(0,e),b.query=l.queryToObject(c.query));c.fragment&&(b.hash=c.fragment,null===c.query&&(b.path=b.path.substring(0,b.path.length-(c.fragment.length+1))));return b}function y(a){var b=a.indexOf("?");-1!==b?(q.path=
  a.slice(0,b),q.query=a.slice(b+1)):(q.path=a,q.query=null);return q}function H(a){a=y(a).path;a&&"/"===a[a.length-1]||(a+="/");a=z(a,!0);return a=a.toLowerCase()}function t(a){var b=m.proxyRules;a=H(a);for(var c=0;c<b.length;c++)if(0===a.indexOf(b[c].urlPrefix))return b[c]}function I(a){a=n(a);var b=a.indexOf("/sharing");return 0<b?a.substring(0,b):a.replace(/\/+$/,"")}function A(a,b,c){void 0===c&&(c=!1);a=B(a);b=B(b);return c||a.scheme===b.scheme?a.host.toLowerCase()===b.host.toLowerCase()&&a.port===
  b.port:!1}function p(a,b,c){void 0===b&&(b=d.appBaseUrl);if(f(a))return c&&c.preserveProtocolRelative?a:"http"===d.appUrl.scheme&&d.appUrl.authority===J(a).slice(2)?"http:"+a:"https:"+a;if(!u(a)){c=K;if("/"===a[0]){var e=b.indexOf("//"),e=b.indexOf("/",e+2);b=-1===e?b:b.slice(0,e)}return c(b,a)}return a}function L(a,b,c){void 0===b&&(b=d.appBaseUrl);if(!h(a))return a;var e=n(a),k=e.toLowerCase();b=n(b).toLowerCase().replace(/\/+$/,"");if((c=c?n(c).toLowerCase().replace(/\/+$/,""):null)&&0!==b.indexOf(c))return a;
  for(var M=function(a,b,c){c=a.indexOf(b,c);return-1===c?a.length:c},f=M(k,"/",k.indexOf("//")+2),g=-1;k.slice(0,f+1)===b.slice(0,f)+"/";){g=f+1;if(f===k.length)break;f=M(k,"/",f+1)}if(-1===g||c&&g<c.length)return a;a=e.slice(g);e=b.slice(g-1).replace(/[^/]+/g,"").length;if(0<e)for(k=0;k<e;k++)a="../"+a;else a="./"+a;return a}function n(a){a=a.trim();a=p(a);if(/^https?:\/\//i.test(a)){var b=y(a);a=b.path.replace(/\/{2,}/g,"/");a=a.replace("/","//");b.query&&(a+="?"+b.query)}a=a.replace(/^(https?:\/\/)(arcgis\.com)/i,
  "$1www.$2");return a=aa(a)}function K(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];if(a&&a.length){b=[];if(h(a[0])){var c=a[0],e=c.indexOf("//");b.push(c.slice(0,e+1));ba.test(a[0])&&(b[0]+="/");a[0]=c.slice(e+2)}else"/"===a[0][0]&&b.push("");a=a.reduce(function(a,b){return b?a.concat(b.split("/")):a},[]);for(c=0;c<a.length;c++)e=a[c],".."===e&&0<b.length&&".."!==b[b.length-1]?b.pop():!e||"."===e&&0!==b.length||b.push(e);return b.join("/")}}function J(a){if(N(a)||O(a))return null;var b=
  a.indexOf("://");if(-1===b&&f(a))b=2;else if(-1!==b)b+=3;else return null;b=a.indexOf("/",b);return-1===b?a:a.slice(0,b)}function h(a){return f(a)||u(a)}function N(a){return"blob:"===a.slice(0,5)}function O(a){return"data:"===a.slice(0,5)}function P(a){a=C(a);if(!a||!a.isBase64)return null;a=atob(a.data);for(var b=new Uint8Array(a.length),c=0;c<a.length;c++)b[c]=a.charCodeAt(c);return b.buffer}function C(a){return(a=a.match(ca))?{mediaType:a[1],isBase64:!!a[2],data:a[3]}:null}function D(a){var b=
  P(a);if(!b)return null;a=C(a);return new Blob([b],{type:a.mediaType})}function f(a){return a&&"/"===a[0]&&"/"===a[1]}function u(a){return Q.test(a)}function da(a){return R.test(a)||"http"===d.appUrl.scheme&&f(a)}function E(a){return f(a)?"https:"+a:a.replace(R,"https:")}function v(){return"https"===d.appUrl.scheme}function z(a,b){void 0===b&&(b=!1);if(f(a))return a.slice(2);a=a.replace(Q,"");b&&1<a.length&&"/"===a[0]&&"/"===a[1]&&(a=a.slice(2));return a}function aa(a){var b=m.httpsDomains;if(!da(a))return a;
  var c=a.indexOf("/",7),e;e=-1===c?a:a.slice(0,c);e=e.toLowerCase().slice(7);if(ea.test(e))if(x.endsWith(e,":80"))e=e.slice(0,-3),a=a.replace(":80","");else return a;if("http"===d.appUrl.scheme&&e===d.appUrl.authority&&!fa.test(a))return a;if(v()&&e===d.appUrl.authority||b&&b.some(function(a){return e===a||x.endsWith(e,"."+a)})||v()&&!t(a))a=E(a);return a}function w(a,b,c){if(!(b&&c&&a&&h(a)))return a;var e=a.indexOf("//"),d=a.indexOf("/",e+2),f=a.indexOf(":",e+2),d=Math.min(0>d?a.length:d,0>f?a.length:
  f);if(a.slice(e+2,d).toLowerCase()!==b.toLowerCase())return a;b=a.slice(0,e+2);a=a.slice(d);return""+b+c+a}function B(a){if("string"===typeof a)return new d.Url(p(a));a.scheme||(a.scheme=d.appUrl.scheme);return a}function S(a,b){var c=b&&b.url&&b.url.path;a&&c&&(a=p(a,c,{preserveProtocolRelative:!0}));(b=b&&b.portal)&&!b.isPortal&&b.urlKey&&b.customBaseUrl?(c=b.urlKey+"."+b.customBaseUrl,b=A(d.appUrl,d.appUrl.scheme+"://"+c)?w(a,b.portalHostname,c):w(a,c,b.portalHostname)):b=a;return b}function T(a,
  b){if(!a)return a;!h(a)&&b&&b.blockedRelativeUrls&&b.blockedRelativeUrls.push(a);var c=p(a);if(b){var e=b.verifyItemRelativeUrls&&b.verifyItemRelativeUrls.rootPath||b.url&&b.url.path;e&&(c=L(c,e,e),c!==a&&b.verifyItemRelativeUrls&&b.verifyItemRelativeUrls.writtenUrls.push(c))}a=c;c=(b=b&&b.portal)&&!b.isPortal&&b.urlKey&&b.customBaseUrl?w(a,b.urlKey+"."+b.customBaseUrl,b.portalHostname):a;h(c)&&(c=n(c));return c}function U(a,b,c){a=g(a);var e=a.query||{};e[b]=c;return a.path+"?"+l.objectToQuery(e)}
  Object.defineProperty(d,"__esModule",{value:!0});d.Url=X;var ga=Z.getLogger("esri.core.urlUtils"),m=F.request,Q=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,R=/^\s*http:/i,V=/^\s*https:/i,ba=/^\s*file:/i,ea=/:\d+$/,fa=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i;d.appUrl=new d.Url(F.applicationUrl);d.trustedServersUrlCache={};d.appBaseUrl=function(){var a=d.appUrl.path,a=a.substring(0,a.lastIndexOf(a.split("/")[a.split("/").length-1]));return""+(d.appUrl.scheme+"://"+d.appUrl.host+(null!=d.appUrl.port?":"+
  d.appUrl.port:""))+a}();d.urlToObject=g;d.getProxyUrl=function(a){void 0===a&&(a=!1);var b,c=m.proxyUrl;if("string"===typeof a){if(b=a,b=V.test(b)||"https"===d.appUrl.scheme&&f(b),a=t(a))c=a.proxyUrl}else b=!!a;if(!c)throw ga.warn("esri/config: esriConfig.request.proxyUrl is not set."),new Y("urlutils:proxy-not-set","esri/config: esriConfig.request.proxyUrl is not set.");b&&v()&&(c=E(c));return g(c)};d.addProxy=function(a){var b=t(a),c,e;b&&(e=y(b.proxyUrl),c=e.path,e=e.query?l.queryToObject(e.query):
  null);c&&(b=g(a),a=c+"?"+b.path,(c=l.objectToQuery(W({},e,b.query)))&&(a=a+"?"+c));return a};var q={path:"",query:""};d.addProxyRule=function(a){a={proxyUrl:a.proxyUrl,urlPrefix:H(a.urlPrefix)};for(var b=m.proxyRules,c=a.urlPrefix,e=b.length,d=0;d<b.length;d++){var f=b[d].urlPrefix;if(0===c.indexOf(f)){if(c.length===f.length)return-1;e=d;break}0===f.indexOf(c)&&(e=d+1)}b.splice(e,0,a);return e};d.getProxyRule=t;d.hasSamePortal=function(a,b){a=I(a);b=I(b);return z(a)===z(b)};d.getInterceptor=function(a){var b=
  function(b){return null==b||b instanceof RegExp&&b.test(a)||"string"===typeof b&&x.startsWith(a,b)},c=m.interceptors;if(c)for(var e=0;e<c.length;e++){var d=c[e];if(Array.isArray(d.urls)){if(d.urls.some(b))return d}else if(b(d.urls))return d}return null};d.hasSameOrigin=A;d.isTrustedServer=function(a){if("string"===typeof a)if(h(a))a=B(a);else return!0;for(var b=m.trustedServers||[],c=0;c<b.length;c++){var e;e=b[c];d.trustedServersUrlCache[e]||(u(e)||f(e)?d.trustedServersUrlCache[e]=[new d.Url(p(e))]:
  d.trustedServersUrlCache[e]=[new d.Url("http://"+e),new d.Url("https://"+e)]);e=d.trustedServersUrlCache[e];for(var g=0;g<e.length;g++)if(A(a,e[g]))return!0}return!1};d.makeAbsolute=p;d.makeRelative=L;d.normalize=n;d.join=K;d.getOrigin=J;d.isAbsolute=h;d.isBlobProtocol=N;d.isDataProtocol=O;d.dataToArrayBuffer=P;var ca=/^data:(.*?)(;base64)?,(.*)$/;d.dataComponents=C;d.makeData=function(a){return a.isBase64?"data:"+a.mediaType+";base64,"+a.data:"data:"+a.mediaType+","+a.data};d.dataToBlob=D;d.downloadDataAsFile=
  function(a,b){var c;a:if(c=document.createElement("a"),"download"in c){var d=null;if(r.URL&&r.URL.createObjectURL){d=D(a);if(!d){c=!1;break a}d=r.URL.createObjectURL(d)}c.download=b;c.href=d||a;c.style.display="none";document.body.appendChild(c);c.click();document.body.removeChild(c);d&&r.URL.revokeObjectURL(d);c=void 0}else c=!1;c||window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(D(a),b)};d.isProtocolRelative=f;d.hasProtocol=u;d.toHTTP=function(a){return f(a)?"http:"+a:a.replace(V,
  "http:")};d.toHTTPS=E;d.isAppHTTPS=v;d.removeFile=function(a){var b=0;if(h(a)){var c=a.indexOf("//");-1!==c&&(b=c+2)}c=a.lastIndexOf("/");return c<b?a:a.slice(0,c+1)};d.removeTrailingSlash=function(a){return a.replace(/\/+$/,"")};d.changeDomain=w;d.fromJSON=S;d.read=function(a,b,c){return S(a,c)};d.toJSON=T;d.write=function(a,b,c,d){(a=T(a,d))&&(b[c]=a)};d.isSVG=function(a){return ha.test(a)};d.removeQueryParameters=function(a,b){a=g(a);var c=Object.keys(a.query||{});0<c.length&&b&&b.warn("removeQueryParameters()",
  "Url query parameters are not supported, the following parameters have been removed: "+c.join(", ")+".");return a.path};d.addQueryParameter=U;d.addQueryParameters=function(a,b){a=g(a);var c=a.query||{},d;for(d in b)c[d]=b[d];return(b=l.objectToQuery(c))?a.path+"?"+b:a.path};d.removeQueryParameter=function(a,b){var c=g(a),d=c.path,c=c.query;if(!c)return a;delete c[b];return(a=l.objectToQuery(c))?d+"?"+a:d};d.addTokenParameter=function(a){var b=G.id&&G.id.findCredential(a);return b&&b.token?U(a,"token",
  b.token):a};var ha=/(^data:image\/svg|\.svg$)/i});